text
stringlengths 4
6.14k
|
|---|
/*
* Character.h
*
* Created on: Nov 5, 2014
* Author: cristianmiranda
*/
#ifndef MODEL_CHARACTER_CHARACTER_H_
#define MODEL_CHARACTER_CHARACTER_H_
#include "../Actor.h"
#include "../../../../DKK/src/utils/includes/Connection.h"
#include "../../../../DKK/src/common/SharedConstants.h"
class Character : public Actor {
public:
SDL_Surface *pj;
SDL_Rect *rightClip;
SDL_Rect *leftClip;
// Uso un buffer para impedir que salte varias veces en el aire
int jumpBuffer;
// Socket utilizado para la conexión con el servidor de partida
int socket;
int paulines;
bool isClient;
bool isMario;
char name[45];
Character(int x, int y) : Actor(x, y){}
void move();
void show();
//Maneja la tecla presionada y administra la velocidad
void handle_input();
void die();
void win();
void reborn();
private:
void notifyDeath();
void notifyRescue();
char* receiveEvents();
bool checkBarrels();
bool checkFlames();
bool checkPauline();
};
#endif /* MODEL_CHARACTER_CHARACTER_H_ */
|
/****************************************************************
*
* Copyright 2013, Big Switch Networks, Inc.
*
* Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
*
* 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.
*
****************************************************************/
/**************************************************************************//**
*
* @file
* @brief AIM Daemon and Supervisor Support.
*
* Provides:
* - daemonization() support.
* - conditional automatic restart.
*
* @addtogroup aim-daemon
* @{
*
*****************************************************************************/
#ifndef __AIM_DAEMON_H__
#define __AIM_DAEMON_H__
#include <AIM/aim_config.h>
#if AIM_CONFIG_INCLUDE_DAEMONIZE == 1
#include <AIM/aim_bitmap.h>
#include <AIM/aim_pvs.h>
/**
* Configuration for automatic daemon restarts.
*/
typedef struct aim_daemon_restart_config_s {
/**
* Bitmap of signal codes that should cause an automatic restart.
*
* If the daemonized process exits with a signal, and that signal bit
* is set in this bitmask, then the process will be automatically
* restarted with the original command line arguments.
*
* If the signal bit is not set then everything is allowed to terminate.
*/
aim_bitmap256_t signal_restarts;
/**
* Bitmap of exit codes that should cause an automatic restart.
*
* If the daemonized process exits normally, and the exit code
* from the process is set in this bitmask, then the process will
* be automatically restarted with the original command line arguments.
*
* If the exit code bit is not set then everything is allowed to terminate.
*/
aim_bitmap256_t exit_restarts;
/**
* Maximum restart count, if applicable.
* Set to zero for infinite restarts.
*/
int maximum_restarts;
/**
* Maximum restart rate, if applicable.
* Abort if restarts occur faster than the given rate.
*
* Not currently implemented.
*/
int maximum_restart_rate;
/**
* Logfile for the watchdog restart process.
* Process restart events will be logged to this file, if specified.
*/
const char* restart_log;
/**
* Output PVS for the watchdog restart process.
* Process restart events will be logged to this PVS if specified.
*/
aim_pvs_t* pvs;
/**
* Program argument vector.
*/
char** argv;
} aim_daemon_restart_config_t;
/**
* Daemon configuration.
*/
typedef struct aim_daemon_config_s {
/** Working Directory */
const char* wd;
/** Set stdout/stderr to this file. /dev/null if unspecified. */
const char* stdlog;
/**
* Use a lockfile.
*
* Not currently implemented.
*/
const char* lockfile;
} aim_daemon_config_t;
/**
* @brief Initialize an aim_daemon_restart_t structure.
* @param [out] config The configuration to initialize.
* @param signalbits Initial value for all signal_restart bits.
* @param exitbits Initial value for all exit_restart bits.
* @note This must be called prior to modifing it or passing it
* to aim_daemonize()
*/
void aim_daemon_restart_config_init(aim_daemon_restart_config_t* config,
int signalbits, int exitbits,
char** argv);
/**
* @brief Daemonize ourselves.
* @param daemon_config Daemon configuration.
* @param restart_config Restart configuration (Optional).
*
* @note daemon_config can be NULL, in which case all configuration
* values will be treated as unset.
*
* @note restart_config can be NULL, in which case no restart processing
* is enabled. We fork and daemonize only, with no additional watchdog process.
*
* @note If restart_config is not NULL, a restart process will be forked()
* which monitors the exit status of the original daemon. If the conditions
* in the restart_config are satisfied, the entire daemon will be restarted
* using the original AIM commandline arguments.
*
* @note Simply calling aim_daemonize(NULL, NULL) is sufficient to perform traditional daemonization.
*/
void aim_daemonize(aim_daemon_config_t* daemon_config,
aim_daemon_restart_config_t* restart_config);
#endif /* AIM_CONFIG_INCLUDE_DAEMONIZE */
#endif /* __AIM_DAEMON_H__ */
/* @} */
|
//===--- CompletionInstance.h ---------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_IDE_COMPLETIONINSTANCE_H
#define SWIFT_IDE_COMPLETIONINSTANCE_H
#include "swift/Frontend/Frontend.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/VirtualFileSystem.h"
namespace swift {
class CompilerInstance;
class CompilerInvocation;
class DiagnosticConsumer;
namespace ide {
/// Copy a memory buffer inserting '\0' at the position of \c origBuf.
std::unique_ptr<llvm::MemoryBuffer>
makeCodeCompletionMemoryBuffer(const llvm::MemoryBuffer *origBuf,
unsigned &Offset,
llvm::StringRef bufferIdentifier);
/// Manages \c CompilerInstance for completion like operations.
class CompletionInstance {
unsigned MaxASTReuseCount = 100;
std::mutex mtx;
std::unique_ptr<CompilerInstance> CachedCI;
llvm::hash_code CachedArgHash;
unsigned CachedReuseCount = 0;
/// Calls \p Callback with cached \c CompilerInstance if it's usable for the
/// specified completion request.
/// Returns \c if the callback was called. Returns \c false if the compiler
/// argument has changed, primary file is not the same, the \c Offset is not
/// in function bodies, or the interface hash of the file has changed.
bool performCachedOperaitonIfPossible(
const swift::CompilerInvocation &Invocation, llvm::hash_code ArgsHash,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
DiagnosticConsumer *DiagC,
llvm::function_ref<void(CompilerInstance &)> Callback);
/// Calls \p Callback with new \c CompilerInstance for the completion
/// request. The \c CompilerInstace passed to the callback already performed
/// the first pass.
/// Returns \c false if it fails to setup the \c CompilerInstance.
bool performNewOperation(
llvm::Optional<llvm::hash_code> ArgsHash,
swift::CompilerInvocation &Invocation,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
std::string &Error, DiagnosticConsumer *DiagC,
llvm::function_ref<void(CompilerInstance &)> Callback);
public:
/// Calls \p Callback with a \c CompilerInstance which is prepared for the
/// second pass. \p Callback is resposible to perform the second pass on it.
/// The \c CompilerInstance may be reused from the previous completions,
/// and may be cached for the next completion.
/// Return \c true if \p is successfully called, \c it fails. In failure
/// cases \p Error is populated with an error message.
///
/// NOTE: \p Args is only used for checking the equaity of the invocation.
/// Since this function assumes that it is already normalized, exact the same
/// arguments including their order is considered as the same invocation.
bool performOperation(
swift::CompilerInvocation &Invocation, llvm::ArrayRef<const char *> Args,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
bool EnableASTCaching, std::string &Error, DiagnosticConsumer *DiagC,
llvm::function_ref<void(CompilerInstance &)> Callback);
};
} // namespace ide
} // namespace swift
#endif // SWIFT_IDE_COMPLETIONINSTANCE_H
|
/**
* \file psa/crypto_driver_common.h
* \brief Definitions for all PSA crypto drivers
*
* This file contains common definitions shared by all PSA crypto drivers.
* Do not include it directly: instead, include the header file(s) for
* the type(s) of driver that you are implementing. For example, if
* you are writing a dynamically registered driver for a secure element,
* include `psa/crypto_se_driver.h`.
*
* This file is part of the PSA Crypto Driver Model, containing functions for
* driver developers to implement to enable hardware to be called in a
* standardized way by a PSA Cryptographic API implementation. The functions
* comprising the driver model, which driver authors implement, are not
* intended to be called by application developers.
*/
/*
* Copyright The Mbed TLS Contributors
* 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 PSA_CRYPTO_DRIVER_COMMON_H
#define PSA_CRYPTO_DRIVER_COMMON_H
#include <stddef.h>
#include <stdint.h>
/* Include type definitions (psa_status_t, psa_algorithm_t,
* psa_key_type_t, etc.) and macros to build and analyze values
* of these types. */
#include "crypto_types.h"
#include "crypto_values.h"
/** For encrypt-decrypt functions, whether the operation is an encryption
* or a decryption. */
typedef enum {
PSA_CRYPTO_DRIVER_DECRYPT,
PSA_CRYPTO_DRIVER_ENCRYPT
} psa_encrypt_or_decrypt_t;
#endif /* PSA_CRYPTO_DRIVER_COMMON_H */
|
/*
Copyright 2013-present Barefoot Networks, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <assert.h>
#include <pthread.h>
#include "pkt_manager.h"
#include "pipeline.h"
#include "parser.h"
#include "deparser.h"
#include "queuing.h"
#include "mirroring_internal.h"
#include "rmt_internal.h"
#include "enums.h"
#include "lf.h"
#include <p4utils/circular_buffer.h>
#define TRANSMIT_CB_SIZE 1024
circular_buffer_t *rmt_transmit_cb; /* only 1 */
pthread_t pkt_out_thread;
uint64_t packet_id;
typedef struct transmit_pkt_s {
buffered_pkt_t pkt;
int egress;
} transmit_pkt_t;
int pkt_manager_receive(int ingress, void *pkt, int len) {
void *pkt_data = malloc(len);
memcpy(pkt_data, pkt, len);
++packet_id;
ingress_pipeline_receive(ingress, NULL, NULL,
pkt_data, len, packet_id,
PKT_INSTANCE_TYPE_NORMAL);
return 0;
}
int pkt_manager_transmit(int egress, void *pkt, int len, uint64_t packet_id) {
transmit_pkt_t *t_pkt = malloc(sizeof(transmit_pkt_t));
buffered_pkt_t *b_pkt = &t_pkt->pkt;
t_pkt->egress = egress;
b_pkt->pkt_data = pkt;
b_pkt->pkt_len = len;
cb_write(rmt_transmit_cb, t_pkt);
return 0;
}
static void *pkt_out_loop(void *arg) {
while(1) {
transmit_pkt_t *t_pkt = (transmit_pkt_t *) cb_read(rmt_transmit_cb);
buffered_pkt_t *b_pkt = &t_pkt->pkt;
RMT_LOG(P4_LOG_LEVEL_TRACE, "outgoing thread: packet dequeued\n");
if(rmt_instance->tx_fn) {
RMT_LOG(P4_LOG_LEVEL_VERBOSE,
"outgoing thread: sending pkt out of port %d\n",
t_pkt->egress);
rmt_instance->tx_fn(t_pkt->egress, b_pkt->pkt_data, b_pkt->pkt_len);
}
free(b_pkt->pkt_data);
free(t_pkt);
}
return NULL;
}
void pkt_manager_init(void) {
rmt_transmit_cb = cb_init(TRANSMIT_CB_SIZE, CB_WRITE_BLOCK, CB_READ_BLOCK);
packet_id = 0;
lf_init();
ingress_pipeline_init();
queuing_init();
mirroring_init();
egress_pipeline_init();
pthread_create(&pkt_out_thread, NULL,
pkt_out_loop, NULL);
}
|
#pragma once
#include "../script_callback_ex.h"
class CUIWindow;
struct SCallbackInfo{
CScriptCallbackEx<void> m_callback;
fastdelegate::FastDelegate2<CUIWindow*,void*,void> m_cpp_callback;
shared_str m_controlName;
s16 m_event;
SCallbackInfo():m_controlName(""),m_event(-1){};
};
|
//
// AgreementListTableViewController.h
// XieshiPrivate
//
// Created by 明溢 李 on 14-12-26.
// Copyright (c) 2014年 Lessu. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LSPagedTableViewController.h"
@interface AgreementListViewController : LSPagedTableViewController
@property(nonatomic,strong) NSString *projectId;
@end
|
/****************************************************************************
*
* Copyright 2016 Samsung Electronics 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 __APPS_SYSTEM_UTILS_KDBG_COMMANDS_H
#define __APPS_SYSTEM_UTILS_KDBG_COMMANDS_H
#include <tinyara/config.h>
#if defined(CONFIG_ENABLE_DATE)
int kdbg_date(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_DMESG)
int kdbg_dmesg(int argc, char **args);
#endif
#ifndef CONFIG_DISABLE_ENVIRON
#if defined(CONFIG_ENABLE_ENV_GET)
int kdbg_env_get(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_ENV_SET)
int kdbg_env_set(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_ENV_UNSET)
int kdbg_env_unset(int argc, char **args);
#endif
#endif /* !CONFIG_DISABLE_ENVIRON */
#if defined(CONFIG_ENABLE_FREE)
int kdbg_free(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_HEAPINFO)
int kdbg_heapinfo(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_IRQINFO)
int kdbg_irqinfo(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_KILL)
int kdbg_kill(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_KILLALL)
int kdbg_killall(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_PS)
int kdbg_ps(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_STACKMONITOR)
int kdbg_stackmonitor(int argc, char **args);
#endif
#if defined(CONFIG_TTRACE)
int kdbg_ttrace(int argc, char **args);
#endif
#if defined(CONFIG_ENABLE_UPTIME)
int kdbg_uptime(int argc, char **args);
#endif
#endif /* __APPS_SYSTEM_UTILS_KDBG_COMMANDS_H */
|
#ifndef UGTEXTCODEC_H
#define UGTEXTCODEC_H
#include "Stream/ugdefs.h"
namespace UGC {
//! \brief µ±Ç°µÄ±àÂ뷽ʽ£¬ÓÉÍⲿÓû§Öƶ¨
static UGString::Charset g_charset;
static UGbool g_bUseGlobal = FALSE;
//! \brief ×Ö·û¼¯×ª»»Æ÷, ÄÚ²¿²ÉÓÃiconvʵÏÖ
class TOOLKIT_API UGTextCodec
{
public:
//! \brief Toolkit
UGTextCodec();
//! \brief Toolkit
~UGTextCodec();
//! \brief Toolkit
UGTextCodec(const UGMBString& to, const UGMBString& from);
//! \brief Toolkit
UGTextCodec(UGString::Charset to, UGString::Charset from);
public:
//! \brief Toolkit
static UGString GetCharsetName(UGString::Charset charset);
//! \brief Toolkit
static UGString::Charset GetCharset(const UGString &strCharsetName);
#ifdef _UGUNICODE
//! \brief Toolkit
static UGString::Charset GetCharset(const UGMBString &strCharsetName)
{
return GetCharset(UGString().FromMBString(strCharsetName.Cstr(), strCharsetName.GetLength()));
}
#endif
//! ÍⲿÓû§ÓõÄCharset
static UGString::Charset GetGlobalCharset();
static UGString::Charset GetStrGlobalCharset(const UGString& strCharset);
static void SetGlobalCharset(const UGString& strCharset,UGbool bUseGlobal = TRUE);
static void SetGlobalCharset(UGString::Charset charset,UGbool bUseGlobal = TRUE);
static void SetUseGlobalCharset(UGbool bUseGlobal = TRUE);
static UGbool IsUseGlobalCharset();
public:
// modified by jifang, 07/29/2005.
//! \remarks Õâ¸öº¯ÊýÔÚÓõÄʱºò, ÊÇϵͳÏà¹ØµÄ, Òª¿´ÏµÍ³ËùÖ§³ÖµÄ±àÂëÖ®¼äµÄת»».
//! ¶øÇÒÖ±½ÓÖ¸¶¨×Ö·û´®ºÜÈÝÒ×µ¼Ö´ò¿ªÊ§°Ü, Èç¹ûÄÜÓÃÏÂÃæµÄö¾Ù²ÎÊýµÄº¯Êý,
//! ¾Í¾¡Á¿ÓÃÏÂÃæµÄÖØÔØº¯Êý, ʵÔÚ²»ÐеÄ, ÔÙÖ±½ÓÓÃÕâ¸öº¯Êý.
//! ×ÜÖ®Ò»¾ä»°, ʹÓÃʱҪСÐÄ, ½÷×ñÒ½Öö, ·ñÔòÖÎËÀÈ˲»³¥Ãü!
UGbool Open(const UGMBString& to, const UGMBString& from);
//! \brief Toolkit
UGbool Open(UGString::Charset to, UGString::Charset from);
//! \brief Toolkit
UGbool IsOpen();
//! \brief Toolkit
void Close();
//! ´«Èë pSource ºÍ nSize(°´×Ö½Ú¼Æ)£¬
//! ÓÃtarget´«³öת»»ºóµÄ×Ö·û´®
//! remark ±¾º¯ÊýÊÊÓÃÓÚת»»ºóµÄ×Ö·û´®ÊôÓÚMBCS£¨¶à×Ö½Ú±àÂ룩
//! \brief Toolkit
UGbool Convert(UGMBString& target,const UGMBString& source);
//! \brief Toolkit
UGbool Convert(UGMBString& target, const UGachar* pSource, UGint nSize);
UGbool Convert(UGbyte *pDest, UGint nCapacity, UGint &nDestSize, const UGbyte* pSource, UGint nSize);
// by zengzm 2007-11-21 Õ⼸¸öº¯Êý ÓÐÎÊÌâ(static ¶ÔÏó), ÏÈ·âÆðÀ´
//! \brief Toolkit
//static UGTextCodec& UGTOMBCS(Charset charset);
//! \brief Toolkit
//static UGTextCodec& UGTOUCS(Charset charset);
//!\remarks if bDirction == TRUE convert the Unicode to MBCS and vice versa
//! \brief Toolkit
//static UGTextCodec& GetDefault(UGbool bDirection = TRUE);
// by zengzm 2007-11-21 ¾¹ý²âÊÔ,·¢ÏÖ TextCodecµÄOpen 100Íò´ÎµÄʱ¼äÔÚ2Ãë×óÓÒ,
// ЧÂÊ»¹ÂíÂí»¢»¢, Òò´Ë,ÔÝʱ²»½øÐÐÌØÊâµÄÓÅ»¯; ÒÔºóË·¢ÏÖÕâ¸öÊÇÐÔÄÜÆ¿¾±,ÔÙ×öÕë¶Ô´¦Àí
//! µÃµ½Ä³¸ö×Ö·û¼¯×ª»»Îª UCS2LEµÄ ת»»Æ÷
//! \param charset ×Ö·û¼¯ÀàÐÍ
//! \remarks ÄÚ²¿²ÉÓ÷µ»ØÌض¨¾²Ì¬¶ÔÏóµÄ·½Ê½, Ìá¸ßЧÂÊ
//! \return ·µ»Ø×ª»»Æ÷
// static UGTextCodec& ToUCS2LE(Charset charset);
//! µÃ°ÑUCS2LE ת»»Îª ij¸ö×Ö·û¼¯µÄ ת»»Æ÷
//! \param charset ×Ö·û¼¯ÀàÐÍ
//! \remarks ÄÚ²¿²ÉÓ÷µ»ØÌض¨¾²Ì¬¶ÔÏóµÄ·½Ê½, Ìá¸ßЧÂÊ
//! \return ·µ»Ø×ª»»Æ÷
// static UGTextCodec& ToUCS2LE(Charset charset);
private:
void* m_pHandle;
// ¾¹ý²âÊÔ,·¢ÏÖiconvÓ¦¸ÃÖ§³Ö¶àÏß³Ì, Òò´Ë°Ñbuffer·Åµ½º¯ÊýÄÚ²¿, ÒÔ±ãTextcodecÒ²ÄÜÖ§³Ö¶àÏß³Ì
// UGMBString m_strBuffer;
//add by cuiwz ·¢ÏÖÔÚubuntu8.0.XµÄ°æ±¾·¢£¬iconvÔÚÏàͬ±àÂëת»»µÄʱºò»á±ÀÀ££¬
//¼ÓÁËÒ»¸ö»·¾³±äÁ¿ÓÃÓÚ¿ØÖÆÏàͬ±àÂëת»»¡£
UGbool m_bCharsetEqual;
};
}
#endif
|
// Copyright (c) 2014 ASMlover. 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 ofconditions 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 materialsprovided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#ifndef __UTIL_THREAD_HEADER_H__
#define __UTIL_THREAD_HEADER_H__
namespace util {
class Routiner : private UnCopyable {
public:
Routiner(void) {}
virtual ~Routiner(void) {}
virtual void Run(void) = 0;
};
template <typename Routine>
class ThreadRoutiner : public Routiner {
Routine routine_;
void* argument_;
public:
explicit ThreadRoutiner(Routine routine, void* argument = NULL)
: routine_(routine)
, argument_(argument) {
}
~ThreadRoutiner(void) {
}
virtual void Run(void) {
routine_(argument_);
}
};
}
#if defined(PLATFORM_WIN)
# include "win_thread.h"
#elif defined(PLATFORM_LINUX)
# include "posix_thread.h"
#endif
#endif // __UTIL_THREAD_HEADER_H__
|
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2014 Varnish Software AS
* All rights reserved.
*
* Author: Martin Blix Grydeland <martin@varnish-software.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.
*
* 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 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.
*
* Common functions for the utilities
*/
#include "vdef.h"
typedef int VUT_cb_f(void);
struct VUT {
const char *progname;
char *name;
/* Options */
int d_opt;
int D_opt;
int g_arg;
char *P_arg;
char *q_arg;
char *r_arg;
/* State */
struct VSL_data *vsl;
struct VSM_data *vsm;
struct VSLQ *vslq;
struct vpf_fh *pfh;
int sighup;
int sigint;
int sigusr1;
/* Callback functions */
VUT_cb_f *idle_f;
VUT_cb_f *sighup_f;
VSLQ_dispatch_f *dispatch_f;
void *dispatch_priv;
};
extern struct VUT VUT;
void VUT_Error(int status, const char *fmt, ...)
__printflike(2, 3);
int VUT_g_Arg(const char *arg);
int VUT_Arg(int opt, const char *arg);
void VUT_Setup(void);
void VUT_Init(const char *progname);
void VUT_Fini(void);
int VUT_Main(void);
|
/* ---------------------------------------------------------------------------- */
/* Atmel Microcontroller Software Support */
/* SAM Software Package License */
/* ---------------------------------------------------------------------------- */
/* Copyright (c) 2015, Atmel Corporation */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following condition is met: */
/* */
/* - Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the disclaimer below. */
/* */
/* Atmel's name may not be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAM4CP_TRNG_INSTANCE_
#define _SAM4CP_TRNG_INSTANCE_
/* ========== Register definition for TRNG peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_TRNG_CR (0x40048000U) /**< \brief (TRNG) Control Register */
#define REG_TRNG_IER (0x40048010U) /**< \brief (TRNG) Interrupt Enable Register */
#define REG_TRNG_IDR (0x40048014U) /**< \brief (TRNG) Interrupt Disable Register */
#define REG_TRNG_IMR (0x40048018U) /**< \brief (TRNG) Interrupt Mask Register */
#define REG_TRNG_ISR (0x4004801CU) /**< \brief (TRNG) Interrupt Status Register */
#define REG_TRNG_ODATA (0x40048050U) /**< \brief (TRNG) Output Data Register */
#else
#define REG_TRNG_CR (*(__O uint32_t*)0x40048000U) /**< \brief (TRNG) Control Register */
#define REG_TRNG_IER (*(__O uint32_t*)0x40048010U) /**< \brief (TRNG) Interrupt Enable Register */
#define REG_TRNG_IDR (*(__O uint32_t*)0x40048014U) /**< \brief (TRNG) Interrupt Disable Register */
#define REG_TRNG_IMR (*(__I uint32_t*)0x40048018U) /**< \brief (TRNG) Interrupt Mask Register */
#define REG_TRNG_ISR (*(__I uint32_t*)0x4004801CU) /**< \brief (TRNG) Interrupt Status Register */
#define REG_TRNG_ODATA (*(__I uint32_t*)0x40048050U) /**< \brief (TRNG) Output Data Register */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
#endif /* _SAM4CP_TRNG_INSTANCE_ */
|
#ifndef _helix_devfs_module_h
#define _helix_devfs_module_h
#include <base/vfs/vfs.h>
#include <base/errors.h>
#endif
|
// Copyright (c) 2006-2008 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 WEBKIT_GLUE_CONTEXT_MENU_CLIENT_IMPL_H__
#define WEBKIT_GLUE_CONTEXT_MENU_CLIENT_IMPL_H__
#include "build/build_config.h"
#include "base/compiler_specific.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "ContextMenuClient.h"
MSVC_POP_WARNING();
class WebViewImpl;
// Handles window-level notifications from WebCore on behalf of a WebView.
class ContextMenuClientImpl : public WebCore::ContextMenuClient {
public:
ContextMenuClientImpl(WebViewImpl* webview) : webview_(webview) {
}
virtual ~ContextMenuClientImpl();
virtual void contextMenuDestroyed();
virtual WebCore::PlatformMenuDescription getCustomMenuFromDefaultItems(
WebCore::ContextMenu*);
virtual void contextMenuItemSelected(WebCore::ContextMenuItem*,
const WebCore::ContextMenu*);
virtual void downloadURL(const WebCore::KURL&);
virtual void copyImageToClipboard(const WebCore::HitTestResult&);
virtual void searchWithGoogle(const WebCore::Frame*);
virtual void lookUpInDictionary(WebCore::Frame*);
virtual void speak(const WebCore::String&);
virtual bool isSpeaking();
virtual void stopSpeaking();
virtual bool shouldIncludeInspectElementItem();
#if defined(OS_MACOSX)
virtual void searchWithSpotlight();
#endif
private:
WebViewImpl* webview_; // weak pointer
};
#endif // WEBKIT_GLUE_CONTEXT_MENU_CLIENT_IMPL_H__
|
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkStructureSensorParameterWidget_h
#define QmitkStructureSensorParameterWidget_h
#include "MitkToFUIExports.h"
#include "ui_QmitkStructureSensorParameterWidgetControls.h"
#include <mitkToFImageGrabber.h>
#include <QWidget>
/**
* @brief Widget for configuring the Structure Sensor device (Occipital, Inc.)
*
* @note This device is currently not available open-source, because the required WiFi
* protocol is part of the commercial mbits source code (http://mbits.info/). If you
* want to use the device please contact mitk-users@dkfz-heidelberg.de.
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkStructureSensorParameterWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkStructureSensorParameterWidget(QWidget* p = nullptr, Qt::WindowFlags f = nullptr);
~QmitkStructureSensorParameterWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief returns the ToFImageGrabber
\return ToFImageGrabber currently used by the widget
*/
mitk::ToFImageGrabber* GetToFImageGrabber();
/*!
\brief sets the ToFImageGrabber
*/
void SetToFImageGrabber(mitk::ToFImageGrabber* aToFImageGrabber);
/*!
\brief activate camera settings according to the parameters from GUI
*/
void ActivateAllParameters();
/**
* @brief GetSelectedResolution getter for 640/320 resolution.
* @return 320: 320x240, 640: 640x480 else -1 and a warning.
*/
int GetSelectedResolution();
protected slots:
/**
* @brief OnResolutionChanged called when the resolution combobox is changed.
*/
void OnResolutionChanged();
protected:
Ui::QmitkStructureSensorParameterWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< image grabber object to be configured by the widget
};
#endif // QmitkStructureSensorParameterWidget_h
|
/*** Copyright (c), The Regents of the University of California ***
*** For more information please refer to files in the COPYRIGHT directory ***/
/* ncInqId.h
*/
#ifndef NC_INQ_ID_H
#define NC_INQ_ID_H
/* This is a NETCDF API call */
#include "rods.h"
#include "rcMisc.h"
#include "procApiRequest.h"
#include "apiNumber.h"
#include "initServer.h"
#include "dataObjInpOut.h"
#include "ncOpen.h"
/* definition for paramType */
#define NC_VAR_T 0 /* nc variable */
#define NC_DIM_T 1 /* nc dimension */
typedef struct {
int paramType;
int ncid;
int myid; /* used by some APIs such as rcNcInqWithId */
int flags; /* not used */
char name[MAX_NAME_LEN];
keyValPair_t condInput;
} ncInqIdInp_t;
#define NcInqIdInp_PI "int paramType; int ncid; int myId; int flags; str name[MAX_NAME_LEN]; struct KeyValPair_PI;"
#if defined(RODS_SERVER) && defined(NETCDF_API)
#define RS_NC_INQ_ID rsNcInqId
/* prototype for the server handler */
int
rsNcInqId (rsComm_t *rsComm, ncInqIdInp_t *ncInqIdInp, int **outId);
int
_rsNcInqId (int type, int ncid, char *name, int **outId);
#else
#define RS_NC_INQ_ID NULL
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* rcNcInqId - general netcdf inq for id (equivalent to nc_inq_dimid,
* nc_inq_varid, ....
* Input -
* rcComm_t *conn - The client connection handle.
* ncInqIdInp_t struct:
* paramType - parameter type - NC_VAR_T, NC_DIM_T, ....
* ncid - the the ncid.
* OutPut -
* id - the nc location id. varid for NC_VAR_T, dimid for NC_DIM_T,
*/
/* prototype for the client call */
int
rcNcInqId (rcComm_t *conn, ncInqIdInp_t *ncInqIdInp, int **outId);
#ifdef __cplusplus
}
#endif
#endif /* NC_INQ_ID_H */
|
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Radu Serban
// =============================================================================
#ifndef CH_LINK_ROTSPRING_CB_H
#define CH_LINK_ROTSPRING_CB_H
#include "chrono/physics/ChLinkMarkers.h"
namespace chrono {
/// Class for rotational spring-damper systems with the torque specified through a
/// functor object.
/// It is ASSUMED that the two bodies are joined such that they have a rotational
/// degree of freedom about the z axis of the specified link reference frame (i.e.,
/// they are connected through a revolute, cylindrical, or screw joint). The
/// relative angle and relative angular speed of this link are about the common axis.
class ChApi ChLinkRotSpringCB : public ChLinkMarkers {
public:
ChLinkRotSpringCB();
ChLinkRotSpringCB(const ChLinkRotSpringCB& other);
virtual ~ChLinkRotSpringCB() {}
/// "Virtual" copy constructor (covariant return type).
virtual ChLinkRotSpringCB* Clone() const override { return new ChLinkRotSpringCB(*this); }
/// Get the current relative angle about the common rotation axis.
double GetRotSpringAngle() const { return relAngle; }
/// Get the current relative angular speed about the common rotation axis.
double GetRotSpringSpeed() const { return Vdot(relWvel, relAxis); }
/// Get the current generated torque.
double GetRotSpringTorque() const { return m_torque; }
/// Class to be used as a functor interface for calculating the general spring-damper torque.
/// A derived class must implement the virtual operator().
class TorqueFunctor {
public:
virtual ~TorqueFunctor() {}
/// Calculate and return the general spring-damper torque at the specified configuration.
virtual double operator()(double time, ///< current time
double angle, ///< relative angle of rotation
double vel, ///< relative angular speed
ChLinkRotSpringCB* link ///< back-pointer to associated link
) = 0;
};
/// Specify the functor object for calculating the torque.
void RegisterTorqueFunctor(TorqueFunctor* functor) { m_torque_fun = functor; }
/// Include the rotational spring custom torque.
virtual void UpdateForces(double time) override;
/// Method to allow serialization of transient data to archives.
virtual void ArchiveOUT(ChArchiveOut& marchive) override;
/// Method to allow deserialization of transient data from archives.
virtual void ArchiveIN(ChArchiveIn& marchive) override;
protected:
TorqueFunctor* m_torque_fun; ///< functor for torque calculation
double m_torque; ///< resulting torque along relative axis of rotation
};
CH_CLASS_VERSION(ChLinkRotSpringCB, 0)
} // end namespace chrono
#endif
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__unsigned_int_max_add_54b.c
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-54b.tmpl.c
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: max Set data to the max value for unsigned int
* GoodSource: Set data to a small, non-zero number (two)
* Sinks: add
* GoodSink: Ensure there will not be an overflow before adding 1 to data
* BadSink : Add 1 to data, which can cause an overflow
* Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files
*
* */
#include "std_testcase.h"
#ifndef OMITBAD
/* bad function declaration */
void CWE190_Integer_Overflow__unsigned_int_max_add_54c_badSink(unsigned int data);
void CWE190_Integer_Overflow__unsigned_int_max_add_54b_badSink(unsigned int data)
{
CWE190_Integer_Overflow__unsigned_int_max_add_54c_badSink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE190_Integer_Overflow__unsigned_int_max_add_54c_goodG2BSink(unsigned int data);
void CWE190_Integer_Overflow__unsigned_int_max_add_54b_goodG2BSink(unsigned int data)
{
CWE190_Integer_Overflow__unsigned_int_max_add_54c_goodG2BSink(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE190_Integer_Overflow__unsigned_int_max_add_54c_goodB2GSink(unsigned int data);
void CWE190_Integer_Overflow__unsigned_int_max_add_54b_goodB2GSink(unsigned int data)
{
CWE190_Integer_Overflow__unsigned_int_max_add_54c_goodB2GSink(data);
}
#endif /* OMITGOOD */
|
/*****************************************************************************
Copyright (c) 2014, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************
* Contents: Native high-level C interface to LAPACK function dsytri_3
* Author: Intel Corporation
* Generated December 2016
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_dsytri_3( int matrix_layout, char uplo, lapack_int n, double* a,
lapack_int lda, const double* e, const lapack_int* ipiv )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* work = NULL;
double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dsytri_3", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dsy_nancheck( matrix_layout, uplo, n, a, lda ) ) {
return -4;
}
if( LAPACKE_d_nancheck( n, e, 1 ) ) {
return -6;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_dsytri_3_work( matrix_layout, uplo, n, a, lda, e, ipiv,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for working array(s) */
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dsytri_3_work( matrix_layout, uplo, n, a, lda, e, ipiv, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dsytri_3", info );
}
return info;
}
|
/* Copyright 2021 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "base_fw_config.h"
#include "board_fw_config.h"
bool board_is_convertible(void)
{
return 1;
}
bool board_has_kblight(void)
{
return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET,
FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES);
}
enum board_usb_c1_mux board_get_usb_c1_mux(void)
{
return USB_C1_MUX_PS8818;
};
enum board_usb_a1_retimer board_get_usb_a1_retimer(void)
{
return USB_A1_RETIMER_UNKNOWN;
};
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_
#define CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_
#pragma once
#include <string>
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop_helpers.h"
#include "build/build_config.h"
#include "content/public/browser/browser_thread.h"
class PrintPreviewHandler;
namespace base {
class DictionaryValue;
class StringValue;
}
namespace printing {
class PrintBackend;
struct PrinterCapsAndDefaults;
}
#if defined(UNIT_TEST) && defined(USE_CUPS) && !defined(OS_MACOSX)
typedef struct cups_option_s cups_option_t;
namespace printing_internal {
// Helper function to parse the lpoptions custom settings. |num_options| and
// |options| will be updated if the custom settings for |printer_name| are
// found, otherwise nothing is done.
// NOTE: This function is declared here so it can be exposed for unit testing.
void parse_lpoptions(const FilePath& filepath, const std::string& printer_name,
int* num_options, cups_option_t** options);
} // namespace printing_internal
#endif
class PrintSystemTaskProxy
: public base::RefCountedThreadSafe<
PrintSystemTaskProxy, content::BrowserThread::DeleteOnUIThread> {
public:
PrintSystemTaskProxy(const base::WeakPtr<PrintPreviewHandler>& handler,
printing::PrintBackend* print_backend,
bool has_logged_printers_count);
void GetDefaultPrinter();
void EnumeratePrinters();
void GetPrinterCapabilities(const std::string& printer_name);
private:
friend struct content::BrowserThread::DeleteOnThread<
content::BrowserThread::UI>;
friend class base::DeleteHelper<PrintSystemTaskProxy>;
#if defined(UNIT_TEST) && defined(USE_CUPS)
FRIEND_TEST_ALL_PREFIXES(PrintSystemTaskProxyTest, DetectDuplexModeCUPS);
FRIEND_TEST_ALL_PREFIXES(PrintSystemTaskProxyTest, DetectNoDuplexModeCUPS);
// Only used for testing.
PrintSystemTaskProxy();
#endif
#if defined(USE_CUPS)
static bool GetPrinterCapabilitiesCUPS(
const printing::PrinterCapsAndDefaults& printer_info,
const std::string& printer_name,
bool* set_color_as_default,
int* printer_color_space_for_color,
int* printer_color_space_for_black,
bool* set_duplex_as_default,
int* default_duplex_setting_value);
#elif defined(OS_WIN)
void GetPrinterCapabilitiesWin(
const printing::PrinterCapsAndDefaults& printer_info,
bool* set_color_as_default,
int* printer_color_space_for_color,
int* printer_color_space_for_black,
bool* set_duplex_as_default,
int* default_duplex_setting_value);
#endif
void SendDefaultPrinter(const std::string* default_printer,
const std::string* cloud_print_data);
void SetupPrinterList(base::ListValue* printers);
void SendPrinterCapabilities(base::DictionaryValue* settings_info);
~PrintSystemTaskProxy();
base::WeakPtr<PrintPreviewHandler> handler_;
scoped_refptr<printing::PrintBackend> print_backend_;
bool has_logged_printers_count_;
DISALLOW_COPY_AND_ASSIGN(PrintSystemTaskProxy);
};
#endif // CHROME_BROWSER_PRINTING_PRINT_SYSTEM_TASK_PROXY_H_
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67b.c
Label Definition File: CWE134_Uncontrolled_Format_String.label.xml
Template File: sources-sinks-67b.tmpl.c
*/
/*
* @description
* CWE: 134 Uncontrolled Format String
* BadSource: console Read input from the console
* GoodSource: Copy a fixed string into data
* Sinks: printf
* GoodSink: wprintf with "%s" as the first argument and data as the second
* BadSink : wprintf with only data as an argument
* Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files
*
* */
#include "std_testcase.h"
#ifndef _WIN32
#include <wchar.h>
#endif
typedef struct _CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67_structType
{
wchar_t * structFirst;
} CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67_structType;
#ifndef OMITBAD
void CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67b_badSink(CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
wprintf(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67b_goodG2BSink(CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
wprintf(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67b_goodB2GSink(CWE134_Uncontrolled_Format_String__wchar_t_console_printf_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* FIX: Specify the format disallowing a format string vulnerability */
wprintf(L"%s\n", data);
}
#endif /* OMITGOOD */
|
/*
* Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NPV8Object_h
#define NPV8Object_h
#include "bindings/v8/V8DOMWrapper.h"
// Chromium uses npruntime.h from the Chromium source repository under
// third_party/npapi/bindings.
#include <bindings/npruntime.h>
#include <v8.h>
namespace WebCore {
class DOMWindow;
static const int npObjectInternalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
WrapperTypeInfo* npObjectTypeInfo();
extern NPClass* npScriptObjectClass;
// A V8NPObject is a NPObject which carries additional V8-specific information. It is allocated and deallocated by
// AllocV8NPObject() and FreeV8NPObject() methods.
struct V8NPObject {
WTF_MAKE_NONCOPYABLE(V8NPObject);
public:
NPObject object;
v8::Persistent<v8::Object> v8Object;
DOMWindow* rootObject;
};
struct PrivateIdentifier {
union {
const NPUTF8* string;
int32_t number;
} value;
bool isString;
};
NPObject* npCreateV8ScriptObject(NPP, v8::Handle<v8::Object>, DOMWindow*);
NPObject* v8ObjectToNPObject(v8::Handle<v8::Object>);
} // namespace WebCore
#endif // NPV8Object_h
|
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Display.h: Defines the egl::Display class, representing the abstract
// display on which graphics are drawn. Implements EGLDisplay.
// [EGL 1.4] section 2.1.2 page 3.
#ifndef INCLUDE_DISPLAY_H_
#define INCLUDE_DISPLAY_H_
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <d3d9.h>
#include "Config.h"
#include "Surface.h"
#include "libGLESv2/Context.h"
#include <set>
namespace egl
{
class Display
{
public:
Display(HDC deviceContext);
~Display();
bool initialize();
void terminate();
bool getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig);
bool getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value);
egl::Surface *createWindowSurface(HWND window, EGLConfig config);
EGLContext createContext(EGLConfig configHandle);
void destroySurface(egl::Surface *surface);
void destroyContext(gl::Context *context);
bool isInitialized();
bool isValidConfig(EGLConfig config);
bool isValidContext(gl::Context *context);
bool isValidSurface(egl::Surface *surface);
bool hasExistingWindowSurface(HWND window);
virtual IDirect3DDevice9 *getDevice();
private:
DISALLOW_COPY_AND_ASSIGN(Display);
const HDC mDc;
UINT mAdapter;
D3DDEVTYPE mDeviceType;
IDirect3D9 *mD3d9;
IDirect3DDevice9 *mDevice;
typedef std::set<Surface*> SurfaceSet;
SurfaceSet mSurfaceSet;
ConfigSet mConfigSet;
typedef std::set<gl::Context*> ContextSet;
ContextSet mContextSet;
};
}
#endif // INCLUDE_DISPLAY_H_
|
// Copyright (c) 2009 Aurelio Lucchesi
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file "LICENSE.txt" in this distribution.
//
// OpMidiOut.h
#ifndef _OP_MIDI_OUT_H_
#define _OP_MIDI_OUT_H_
#include "OpDEF.h"
#include "Op.h"
#ifdef OP_INC_OP_MIDI_OUT
#include "OpMidiDevOut.h"
// MIDI Output
////////////////////////////////////////////////////////////////////////////////
class COpMidiOut : public COp
{
public:
COpMidiOut ();
virtual ~COpMidiOut();
public:
virtual void Proc();
virtual void Update();
virtual void Validate();
#ifdef OP_USE_ROUTINES
virtual void Routine( unsigned int uiIndex );
#endif // OP_USE_ROUTINES
OP_GENERIC_COPY_CTOR_DEC( COpMidiOut )
OP_GENERIC_METHODS_DEC( COpMidiOut )
protected:
void Init();
protected:
CMidiOut *m_poDev;
unsigned int m_uiFuncNum;
};
#endif // OP_INC_OP_MIDI_OUT
#endif // _OP_MIDI_H_
|
/*
* AliAnalysisTaskNanoBBar.h
*
* Created on: May 13, 2019
* Author: schmollweger
*/
#ifndef PWGCF_FEMTOSCOPY_FEMTODREAM_ALIANALYSISTASKNANOBBAR_H_
#define PWGCF_FEMTOSCOPY_FEMTODREAM_ALIANALYSISTASKNANOBBAR_H_
#include "AliAnalysisTaskSE.h"
#include "AliFemtoDreamEventCuts.h"
#include "AliFemtoDreamEvent.h"
#include "AliFemtoDreamTrackCuts.h"
#include "AliFemtoDreamTrack.h"
#include "AliFemtoDreamv0.h"
#include "AliFemtoDreamv0Cuts.h"
#include "AliFemtoDreamCascade.h"
#include "AliFemtoDreamCascadeCuts.h"
#include "AliFemtoDreamCollConfig.h"
#include "AliFemtoDreamPairCleaner.h"
#include "AliFemtoDreamPartCollection.h"
#include "AliFemtoDreamControlSample.h"
class AliAnalysisTaskNanoBBar : public AliAnalysisTaskSE {
public:
AliAnalysisTaskNanoBBar();
AliAnalysisTaskNanoBBar(const char* name, bool isMC);
virtual ~AliAnalysisTaskNanoBBar();
virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t *option);
void ResetGlobalTrackReference();
void StoreGlobalTrackReference(AliVTrack *track);
void SetRunTaskLightWeight(bool light) {
fisLightWeight = light;
}
void SetEventCuts(AliFemtoDreamEventCuts* evtCuts) {
fEventCuts = evtCuts;
}
void SetProtonCuts(AliFemtoDreamTrackCuts* trkCuts) {
fProton = trkCuts;
}
void SetAntiProtonCuts(AliFemtoDreamTrackCuts* trkCuts) {
fAntiProton = trkCuts;
}
void Setv0Cuts(AliFemtoDreamv0Cuts* v0Cuts) {
fLambda = v0Cuts;
}
void SetAntiv0Cuts(AliFemtoDreamv0Cuts* v0Cuts) {
fAntiLambda = v0Cuts;
}
void SetXiCuts(AliFemtoDreamCascadeCuts* cascCuts) {
fXi = cascCuts;
}
void SetAntiXiCuts(AliFemtoDreamCascadeCuts* cascCuts) {
fAntiXi = cascCuts;
}
void SetCorrelationConfig(AliFemtoDreamCollConfig* config) {
fConfig=config;
}
private:
AliAnalysisTaskNanoBBar(const AliAnalysisTaskNanoBBar &task);
AliAnalysisTaskNanoBBar &operator=(const AliAnalysisTaskNanoBBar &task);
bool fisLightWeight;//
bool fIsMC; //
TList *fQA; //!
AliFemtoDreamEvent* fEvent;//!
AliFemtoDreamEventCuts* fEventCuts;//
TList* fEvtList;//!
AliFemtoDreamTrack* fTrack;//!
AliFemtoDreamTrackCuts* fProton;//
TList* fProtonList;//!
TList* fProtonMCList;//!
AliFemtoDreamTrackCuts* fAntiProton;//
TList* fAntiProtonList;//!
TList* fAntiProtonMCList;//!
AliFemtoDreamv0* fv0;//!
AliFemtoDreamv0Cuts* fLambda;//
TList* fLambdaList;//!
TList* fLambdaMCList;//!
AliFemtoDreamv0Cuts* fAntiLambda;//
TList* fAntiLambdaList;//!
TList* fAntiLambdaMCList;//!
AliFemtoDreamCascade* fCascade;//!
AliFemtoDreamCascadeCuts* fXi;//
TList* fXiList;//!
TList* fXiMCList;//!
AliFemtoDreamCascadeCuts* fAntiXi;//
TList* fAntiXiList;//!
TList* fAntiXiMCList;//!
AliFemtoDreamCollConfig *fConfig; //
AliFemtoDreamPairCleaner *fPairCleaner; //!
AliFemtoDreamPartCollection *fPartColl; //!
TList *fResults;//!
TList *fResultsQA;//!
AliFemtoDreamControlSample *fSample; //!
TList *fResultsSample;//!
TList *fResultsSampleQA;//!
int fTrackBufferSize;//
AliVTrack **fGTI; //!
ClassDef(AliAnalysisTaskNanoBBar,3)
};
#endif /* PWGCF_FEMTOSCOPY_FEMTODREAM_ALIANALYSISTASKNANOBBAR_H_ */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
#define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
#pragma once
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include <string>
#include <vector>
class MetricsLogBase;
// Manages all the log objects used by a MetricsService implementation. Keeps
// track of both an in progress log and a log that is staged for uploading as
// text, as well as saving logs to, and loading logs from, persistent storage.
class MetricsLogManager {
public:
MetricsLogManager();
~MetricsLogManager();
// Takes ownership of |log|, and makes it the current_log.
// This should only be called if there is not a current log.
void BeginLoggingWithLog(MetricsLogBase* log);
// Returns the in-progress log.
MetricsLogBase* current_log() { return current_log_.get(); }
// Closes |current_log| and stages it for upload, leaving |current_log| NULL.
void StageCurrentLogForUpload();
// Returns true if there is a log that needs to be, or is being, uploaded.
// Note that this returns true even if compressing the log text failed.
bool has_staged_log() const;
// The compressed text of the staged log. Empty if there is no staged log,
// or if compression of the staged log failed.
const std::string& staged_log_text() { return compressed_staged_log_text_; }
// Discards the staged log.
void DiscardStagedLog();
// Closes and discards |current_log|.
void DiscardCurrentLog();
// Sets current_log to NULL, but saves the current log for future use with
// ResumePausedLog(). Only one log may be paused at a time.
// TODO(stuartmorgan): Pause/resume support is really a workaround for a
// design issue in initial log writing; that should be fixed, and pause/resume
// removed.
void PauseCurrentLog();
// Restores the previously paused log (if any) to current_log.
// This should only be called if there is not a current log.
void ResumePausedLog();
// Returns true if there are any logs left over from previous sessions that
// need to be uploaded.
bool has_unsent_logs() const {
return !unsent_initial_logs_.empty() || !unsent_ongoing_logs_.empty();
}
enum LogType {
INITIAL_LOG, // The first log of a session.
ONGOING_LOG, // Subsequent logs in a session.
};
// Saves the staged log as the given type (or discards it in accordance with
// set_max_ongoing_log_store_size), then clears the staged log.
// This can only be called after StageCurrentLogForUpload.
void StoreStagedLogAsUnsent(LogType log_type);
// Populates staged_log_text with the next stored log to send.
void StageNextStoredLogForUpload();
// Sets the threshold for how large an onging log can be and still be stored.
// Ongoing logs larger than this will be discarded. 0 is interpreted as no
// limit.
void set_max_ongoing_log_store_size(size_t max_size) {
max_ongoing_log_store_size_ = max_size;
}
// Interface for a utility class to serialize and deserialize logs for
// persistent storage.
class LogSerializer {
public:
virtual ~LogSerializer() {}
// Serializes |logs| to persistent storage, replacing any previously
// serialized logs of the same type.
virtual void SerializeLogs(const std::vector<std::string>& logs,
LogType log_type) = 0;
// Populates |logs| with logs of type |log_type| deserialized from
// persistent storage.
virtual void DeserializeLogs(LogType log_type,
std::vector<std::string>* logs) = 0;
};
// Sets the serializer to use for persisting and loading logs; takes ownership
// of |serializer|.
void set_log_serializer(LogSerializer* serializer) {
log_serializer_.reset(serializer);
}
// Saves any unsent logs to persistent storage using the current log
// serializer. Can only be called after set_log_serializer.
void PersistUnsentLogs();
// Loads any unsent logs from persistent storage using the current log
// serializer. Can only be called after set_log_serializer.
void LoadPersistedUnsentLogs();
private:
// Compresses staged_log_ and stores the result in
// compressed_staged_log_text_.
void CompressStagedLog();
// Compresses the text in |input| using bzip2, store the result in |output|.
static bool Bzip2Compress(const std::string& input, std::string* output);
// The log that we are still appending to.
scoped_ptr<MetricsLogBase> current_log_;
// A paused, previously-current log.
scoped_ptr<MetricsLogBase> paused_log_;
// The log that we are currently transmiting, or about to try to transmit.
// Note that when using StageNextStoredLogForUpload, this can be NULL while
// compressed_staged_log_text_ is non-NULL.
scoped_ptr<MetricsLogBase> staged_log_;
// Helper class to handle serialization/deserialization of logs for persistent
// storage. May be NULL.
scoped_ptr<LogSerializer> log_serializer_;
// The compressed text of the staged log, ready for upload to the server.
std::string compressed_staged_log_text_;
// Logs from a previous session that have not yet been sent.
// Note that the vector has the oldest logs listed first (early in the
// vector), and we'll discard old logs if we have gathered too many logs.
std::vector<std::string> unsent_initial_logs_;
std::vector<std::string> unsent_ongoing_logs_;
size_t max_ongoing_log_store_size_;
DISALLOW_COPY_AND_ASSIGN(MetricsLogManager);
};
#endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
#define NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_sent_packet_manager.h"
namespace net {
class SendAlgorithmInterface;
namespace test {
class QuicSentPacketManagerPeer {
public:
static size_t GetMaxTailLossProbes(
QuicSentPacketManager* sent_packet_manager);
static void SetMaxTailLossProbes(
QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes);
static bool GetUseNewRto(QuicSentPacketManager* sent_packet_manager);
static QuicByteCount GetReceiveWindow(
QuicSentPacketManager* sent_packet_manager);
static void SetIsServer(QuicSentPacketManager* sent_packet_manager,
bool is_server);
static const SendAlgorithmInterface* GetSendAlgorithm(
const QuicSentPacketManager& sent_packet_manager);
static void SetSendAlgorithm(QuicSentPacketManager* sent_packet_manager,
SendAlgorithmInterface* send_algorithm);
static const LossDetectionInterface* GetLossAlgorithm(
QuicSentPacketManager* sent_packet_manager);
static void SetLossAlgorithm(QuicSentPacketManager* sent_packet_manager,
LossDetectionInterface* loss_detector);
static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager);
static QuicPacketCount GetNackCount(
const QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number);
static size_t GetPendingRetransmissionCount(
const QuicSentPacketManager* sent_packet_manager);
static bool HasPendingPackets(
const QuicSentPacketManager* sent_packet_manager);
static QuicTime GetSentTime(const QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number);
// Returns true if |sequence_number| is a retransmission of a packet.
static bool IsRetransmission(QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number);
static void MarkForRetransmission(QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number,
TransmissionType transmission_type);
static QuicTime::Delta GetRetransmissionDelay(
const QuicSentPacketManager* sent_packet_manager);
static bool HasUnackedCryptoPackets(
const QuicSentPacketManager* sent_packet_manager);
static size_t GetNumRetransmittablePackets(
const QuicSentPacketManager* sent_packet_manager);
static QuicByteCount GetBytesInFlight(
const QuicSentPacketManager* sent_packet_manager);
static QuicSentPacketManager::NetworkChangeVisitor* GetNetworkChangeVisitor(
const QuicSentPacketManager* sent_packet_manager);
static QuicSustainedBandwidthRecorder& GetBandwidthRecorder(
QuicSentPacketManager* sent_packet_manager);
private:
DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer);
};
} // namespace test
} // namespace net
#endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
|
/*
This is an Arduino driver for the Silicon Labs Si7020-A10 Humidiy
and Temperature sensor. It utilizes the standard Arduino Wire library
for I2C communications.
Author: Brian Eccles
*/
#ifndef TEMPHUMID_H
#define TEMPHUMID_H
#include <Arduino.h>
#include <Wire.h>
#define CONFIG_BYTE 0x00
#define MEASURE_TEMP_CMD_HOLD 0xE3
#define MEASURE_HUMID_CMD_HOLD 0xE5
#define MEASURE_TEMP_CMD_NOHOLD 0xF3
#define MEASURE_HUMID_CMD_NOHOLD 0xF5
#define READ_TEMP 0xE0
#define WRITE_REG_CMD 0xE6
class TempHumid
{
private:
//I2C Slave Address
int address;
//True if begin has been called
bool started;
//Stores values when read is called
int humidity;
int temp;
public:
TempHumid();
//Setup this object, must call before using get functions
//address - Slave address of device (check datasheet)
void begin(int address);
//Issue a command to measure humidity and temperature, follow by a call to readAll at least 20ms later
void measure();
//Reads humidity and temperature from the device, measure must be called about 20ms prior to calling this
//Returns true if reading succeeded
bool readAll();
//Get the temperature value read by readAll() as a 16 bit integer in hundredths of degrees C
int getTemp();
//Get the humidity value read by readAll() as a 16 bit integer in hundredths of a percent
int getHumidity();
//Returns temperature as a 16 bit integer in hundredths of degrees C, blocks during measurment (~3ms)
int getTempNow();
//Returns relative humidity as a 16 bit integer in hundredths of a percent, blocks during measurement (~20ms)
int getHumidityNow();
};
#endif
|
// bindgen-flags: --raw-line "#![cfg(not(test))]" -- --target=i686-pc-win32
// bindgen-unstable
//
// We can only check that this builds, but not that it actually passes, because
// we have no CI on the target platform.
struct JNINativeInterface_ {
int (__stdcall *GetVersion)(void *env);
unsigned long long __hack; // A hack so the field alignment is the same than
// for 64-bit, where we run CI.
};
__stdcall void bar();
|
/* (C) 2007-2009 Jean-Marc Valin, CSIRO
*/
/*
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 Xiph.org Foundation 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 FOUNDATION 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
#include "modes.h"
#include "cwrs.h"
#include "arch.h"
#include "os_support.h"
#include "entcode.h"
#include "rate.h"
#ifndef STATIC_MODES
celt_int16_t **compute_alloc_cache(CELTMode *m, int C)
{
int i, prevN;
int error = 0;
celt_int16_t **bits;
const celt_int16_t *eBands = m->eBands;
bits = celt_alloc(m->nbEBands*sizeof(celt_int16_t*));
if (bits==NULL)
return NULL;
prevN = -1;
for (i=0;i<m->nbEBands;i++)
{
int N = C*(eBands[i+1]-eBands[i]);
if (N == prevN && eBands[i] < m->pitchEnd)
{
bits[i] = bits[i-1];
} else {
bits[i] = celt_alloc(MAX_PULSES*sizeof(celt_int16_t));
if (bits[i]!=NULL) {
get_required_bits(bits[i], N, MAX_PULSES, BITRES);
} else {
error=1;
}
prevN = N;
}
}
if (error)
{
const celt_int16_t *prevPtr = NULL;
if (bits!=NULL)
{
for (i=0;i<m->nbEBands;i++)
{
if (bits[i] != prevPtr)
{
prevPtr = bits[i];
celt_free((int*)bits[i]);
}
}
free(bits);
bits=NULL;
}
}
return bits;
}
#endif /* !STATIC_MODES */
static void interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int total, int *bits, int *ebits, int *fine_priority, int len)
{
int psum;
int lo, hi;
int j;
const int C = CHANNELS(m);
SAVE_STACK;
lo = 0;
hi = 1<<BITRES;
while (hi-lo != 1)
{
int mid = (lo+hi)>>1;
psum = 0;
for (j=0;j<len;j++)
psum += ((1<<BITRES)-mid)*bits1[j] + mid*bits2[j];
if (psum > (total<<BITRES))
hi = mid;
else
lo = mid;
}
psum = 0;
/*printf ("interp bisection gave %d\n", lo);*/
for (j=0;j<len;j++)
{
bits[j] = ((1<<BITRES)-lo)*bits1[j] + lo*bits2[j];
psum += bits[j];
}
/* Allocate the remaining bits */
{
int left, perband;
left = (total<<BITRES)-psum;
perband = left/len;
for (j=0;j<len;j++)
bits[j] += perband;
left = left-len*perband;
for (j=0;j<left;j++)
bits[j]++;
}
for (j=0;j<len;j++)
{
int N, d;
int offset;
N=m->eBands[j+1]-m->eBands[j];
d=C*N<<BITRES;
offset = 50 - log2_frac(N, 4);
/* Offset for the number of fine bits compared to their "fair share" of total/N */
offset = bits[j]-offset*N*C;
if (offset < 0)
offset = 0;
ebits[j] = (2*offset+d)/(2*d);
fine_priority[j] = ebits[j]*d >= offset;
/* Make sure not to bust */
if (C*ebits[j] > (bits[j]>>BITRES))
ebits[j] = bits[j]/C >> BITRES;
if (ebits[j]>7)
ebits[j]=7;
/* The bits used for fine allocation can't be used for pulses */
bits[j] -= C*ebits[j]<<BITRES;
if (bits[j] < 0)
bits[j] = 0;
}
RESTORE_STACK;
}
void compute_allocation(const CELTMode *m, int *offsets, int total, int *pulses, int *ebits, int *fine_priority)
{
int lo, hi, len, j;
VARDECL(int, bits1);
VARDECL(int, bits2);
SAVE_STACK;
len = m->nbEBands;
ALLOC(bits1, len, int);
ALLOC(bits2, len, int);
lo = 0;
hi = m->nbAllocVectors - 1;
while (hi-lo != 1)
{
int psum = 0;
int mid = (lo+hi) >> 1;
for (j=0;j<len;j++)
{
bits1[j] = (m->allocVectors[mid*len+j] + offsets[j])<<BITRES;
if (bits1[j] < 0)
bits1[j] = 0;
psum += bits1[j];
/*printf ("%d ", bits[j]);*/
}
/*printf ("\n");*/
if (psum > (total<<BITRES))
hi = mid;
else
lo = mid;
/*printf ("lo = %d, hi = %d\n", lo, hi);*/
}
/*printf ("interp between %d and %d\n", lo, hi);*/
for (j=0;j<len;j++)
{
bits1[j] = m->allocVectors[lo*len+j] + offsets[j];
bits2[j] = m->allocVectors[hi*len+j] + offsets[j];
if (bits1[j] < 0)
bits1[j] = 0;
if (bits2[j] < 0)
bits2[j] = 0;
}
interp_bits2pulses(m, bits1, bits2, total, pulses, ebits, fine_priority, len);
RESTORE_STACK;
}
|
/*
Copyright (c) 2009-2015, Jack Poulson
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#include "El.h"
ElError ElSizeOfCBool( unsigned* boolSize )
{ *boolSize = sizeof(bool); return EL_SUCCESS; }
|
/*++
Copyright (c) 2005 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PciBus.h
Abstract:
PCI Bus Driver
Revision History
--*/
#ifndef _EFI_PCI_BUS_H
#define _EFI_PCI_BUS_H
#include "Tiano.h"
#include "EfiDriverLib.h"
#include "EfiImage.h"
#include "Pci.h"
#include "Acpi.h"
#include "LinkedList.h"
//
// Driver Consumed Protocol Prototypes
//
#include EFI_PROTOCOL_DEFINITION (DevicePath)
#include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo)
#include EFI_PROTOCOL_DEFINITION (Decompress)
#include EFI_PROTOCOL_DEFINITION (LoadedImage)
#include EFI_PROTOCOL_DEFINITION (UgaIo)
//
// Driver Consumed Protocol Prototypes
//
#include EFI_PROTOCOL_DEFINITION (DriverBinding)
#include EFI_PROTOCOL_DEFINITION (ComponentName)
#include EFI_PROTOCOL_DEFINITION (PciIo)
#include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride)
//
// Driver Produced Protocol Prototypes
//
#define VGABASE1 0x3B0
#define VGALIMIT1 0x3BB
#define VGABASE2 0x3C0
#define VGALIMIT2 0x3DF
#define ISABASE 0x100
#define ISALIMIT 0x3FF
typedef enum {
PciBarTypeUnknown = 0,
PciBarTypeIo16,
PciBarTypeIo32,
PciBarTypeMem32,
PciBarTypePMem32,
PciBarTypeMem64,
PciBarTypePMem64,
PciBarTypeIo,
PciBarTypeMem,
PciBarTypeMaxType
} PCI_BAR_TYPE;
typedef struct {
UINT64 BaseAddress;
UINT64 Length;
UINT64 Alignment;
PCI_BAR_TYPE BarType;
BOOLEAN Prefetchable;
UINT8 MemType;
UINT8 Offset;
} PCI_BAR;
#define PCI_IO_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('p','c','i','o')
#define EFI_BRIDGE_IO32_DECODE_SUPPORTED 0x0001
#define EFI_BRIDGE_PMEM32_DECODE_SUPPORTED 0x0002
#define EFI_BRIDGE_PMEM64_DECODE_SUPPORTED 0x0004
#define EFI_BRIDGE_IO16_DECODE_SUPPORTED 0x0008
#define EFI_BRIDGE_PMEM_MEM_COMBINE_SUPPORTED 0x0010
#define EFI_BRIDGE_MEM64_DECODE_SUPPORTED 0x0020
#define EFI_BRIDGE_MEM32_DECODE_SUPPORTED 0x0040
typedef struct _PCI_IO_DEVICE {
UINT32 Signature;
EFI_HANDLE Handle;
EFI_PCI_IO_PROTOCOL PciIo;
EFI_LIST_ENTRY Link;
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL PciDriverOverride;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
//
// PCI configuration space header type
//
PCI_TYPE00 Pci;
//
// Bus number, Device number, Function number
//
UINT8 BusNumber;
UINT8 DeviceNumber;
UINT8 FunctionNumber;
//
// BAR for this PCI Device
//
PCI_BAR PciBar[PCI_MAX_BAR];
//
// The bridge device this pci device is subject to
//
struct _PCI_IO_DEVICE *Parent;
//
// A linked list for children Pci Device if it is bridge device
//
EFI_LIST_ENTRY ChildList;
//
// TURE if the PCI bus driver creates the handle for this PCI device
//
BOOLEAN Registered;
//
// TRUE if the PCI bus driver successfully allocates the resource required by
// this PCI device
//
BOOLEAN Allocated;
//
// The attribute this PCI device currently set
//
UINT64 Attributes;
//
// The attributes this PCI device actually supports
//
UINT64 Supports;
//
// The resource decode the bridge supports
//
UINT32 Decodes;
//
// The OptionRom Size
//
UINT64 RomSize;
//
// TRUE if there is any EFI driver in the OptionRom
//
BOOLEAN BusOverride;
//
// A list tracking reserved resource on a bridge device
//
EFI_LIST_ENTRY ReservedResourceList;
//
// A list tracking image handle of platform specific overriding driver
//
EFI_LIST_ENTRY OptionRomDriverList;
BOOLEAN IsPciExp;
} PCI_IO_DEVICE;
#define PCI_IO_DEVICE_FROM_PCI_IO_THIS(a) \
CR (a, PCI_IO_DEVICE, PciIo, PCI_IO_DEVICE_SIGNATURE)
#define PCI_IO_DEVICE_FROM_PCI_DRIVER_OVERRIDE_THIS(a) \
CR (a, PCI_IO_DEVICE, PciDriverOverride, PCI_IO_DEVICE_SIGNATURE)
#define PCI_IO_DEVICE_FROM_LINK(a) \
CR (a, PCI_IO_DEVICE, Link, PCI_IO_DEVICE_SIGNATURE)
//
// Global Variables
//
extern EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gPciBusComponentName;
extern BOOLEAN gFullEnumeration;
static UINT64 gAllOne = 0xFFFFFFFFFFFFFFFF;
static UINT64 gAllZero = 0;
#include "PciIo.h"
#include "PciCommand.h"
#include "PciDeviceSupport.h"
#include "PciEnumerator.h"
#include "PciEnumeratorSupport.h"
#include "PciDriverOverride.h"
#include "PciRomTable.h"
#include "PciOptionRomSupport.h"
#include "PciPowerManagement.h"
#define IS_ISA_BRIDGE(_p) IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_ISA)
#define IS_INTEL_ISA_BRIDGE(_p) (IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_ISA_POSITIVE_DECODE) && ((_p)->Hdr.VendorId == 0x8086) && ((_p)->Hdr.DeviceId == 0x7110))
#endif
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_63b.c
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.label.xml
Template File: sources-sink-63b.tmpl.c
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Set data pointer to the bad buffer
* GoodSource: Set data pointer to the good buffer
* Sinks: loop
* BadSink : Copy int array to data using a loop
* Flow Variant: 63 Data flow: pointer to data passed from one function to another in different source files
*
* */
#include "std_testcase.h"
#ifndef OMITBAD
void CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_63b_badSink(int * * dataPtr)
{
int * data = *dataPtr;
{
int source[100] = {0}; /* fill with 0's */
{
size_t i;
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
printIntLine(data[0]);
}
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_63b_goodG2BSink(int * * dataPtr)
{
int * data = *dataPtr;
{
int source[100] = {0}; /* fill with 0's */
{
size_t i;
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
printIntLine(data[0]);
}
}
}
#endif /* OMITGOOD */
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE194_Unexpected_Sign_Extension__fgets_memcpy_54e.c
Label Definition File: CWE194_Unexpected_Sign_Extension.label.xml
Template File: sources-sink-54e.tmpl.c
*/
/*
* @description
* CWE: 194 Unexpected Sign Extension
* BadSource: fgets Read data from the console using fgets()
* GoodSource: Positive integer
* Sink: memcpy
* BadSink : Copy strings using memcpy() with the length of data
* Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files
*
* */
#include "std_testcase.h"
/* Must be at least 8 for atoi() to work properly */
#define CHAR_ARRAY_SIZE 8
/* all the sinks are the same, we just want to know where the hit originated if a tool flags one */
#ifndef OMITBAD
void CWE194_Unexpected_Sign_Extension__fgets_memcpy_54e_badSink(short data)
{
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign extension could result in a very large number */
memcpy(dest, source, data);
dest[data] = '\0'; /* NULL terminate */
}
printLine(dest);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE194_Unexpected_Sign_Extension__fgets_memcpy_54e_goodG2BSink(short data)
{
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign extension could result in a very large number */
memcpy(dest, source, data);
dest[data] = '\0'; /* NULL terminate */
}
printLine(dest);
}
}
#endif /* OMITGOOD */
|
// Copyright 2017 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 CHROMECAST_MEDIA_CMA_BACKEND_SYSTEM_VOLUME_CONTROL_H_
#define CHROMECAST_MEDIA_CMA_BACKEND_SYSTEM_VOLUME_CONTROL_H_
#include <memory>
#include "base/macros.h"
namespace chromecast {
namespace media {
// Handles setting the volume and mute state on the appropriate system mixer
// elements (based on command-line args); also detects changes to the mute state
// or volume and informs a delegate.
// Must be created on an IO thread, and all methods must be called on that
// thread.
class SystemVolumeControl {
public:
class Delegate {
public:
// Called whenever the system volume or mute state have changed.
// Unfortunately it is not possible in all cases to differentiate between
// a volume change and a mute change, so the two events must be combined.
virtual void OnSystemVolumeOrMuteChange(float new_volume,
bool new_mute) = 0;
protected:
virtual ~Delegate() = default;
};
static std::unique_ptr<SystemVolumeControl> Create(Delegate* delegate);
SystemVolumeControl() = default;
SystemVolumeControl(const SystemVolumeControl&) = delete;
SystemVolumeControl& operator=(const SystemVolumeControl&) = delete;
virtual ~SystemVolumeControl() = default;
// Returns the value that you would get if you called GetVolume() after
// SetVolume(volume).
virtual float GetRoundtripVolume(float volume) = 0;
// Returns the current system volume (0 <= volume <= 1).
virtual float GetVolume() = 0;
// Sets the system volume to |level| (0 <= level <= 1).
virtual void SetVolume(float level) = 0;
// Returns |true| if system is currently muted.
virtual bool IsMuted() = 0;
// Sets the system mute state to |muted|.
virtual void SetMuted(bool muted) = 0;
// Sets the system power save state to |power_save_on|.
virtual void SetPowerSave(bool power_save_on) = 0;
// Sets the volume limit to be applied to the system volume.
virtual void SetLimit(float limit) = 0;
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_CMA_BACKEND_SYSTEM_VOLUME_CONTROL_H_
|
/******************************************************************
*
* mUPnP for C++
*
* Copyright (C) Satoshi Konno 2002
*
* This is licensed under BSD-style license, see file COPYING.
*
******************************************************************/
#ifndef _MUPMPCC_PROPERTY_H_
#define _MUPMPCC_PROPERTY_H_
#include <string>
namespace mUPnP {
class Property {
std::string name;
std::string value;
public:
////////////////////////////////////////////////
// Constructor
////////////////////////////////////////////////
Property() {
}
////////////////////////////////////////////////
// name
////////////////////////////////////////////////
const char *getName() {
return name.c_str();
}
void setName(const std::string &val) {
name = val;
}
////////////////////////////////////////////////
// value
////////////////////////////////////////////////
const char *getValue() {
return value.c_str();
}
void setValue(const std::string &val) {
value = val;
}
};
}
#endif
|
/* dtkVrTrackerVrpn.h ---
*
* Author: Julien Wintz
* Copyright (C) 2008 - Julien Wintz, Inria.
* Created: Thu Feb 18 20:35:23 2010 (+0100)
* Version: $Id$
* Last-Updated: Thu Apr 26 17:47:35 2012 (+0200)
* By: Julien Wintz
* Update #: 29
*/
/* Commentary:
*
*/
/* Change log:
*
*/
#pragma once
#include "dtkVrSupportExport.h"
#include "dtkVrTracker.h"
#include <dtkMathSupport/dtkVector3D.h>
#include <QtCore>
using namespace dtkDeprecated;
class dtkVrTrackerVrpnPrivate;
class DTKVRSUPPORT_EXPORT dtkVrTrackerVrpn : public dtkVrTracker
{
Q_OBJECT
public:
dtkVrTrackerVrpn(void);
~dtkVrTrackerVrpn(void);
public:
void initialize(void);
void uninitialize(void);
public:
void setUrl(const QUrl& url);
public:
dtkVector3D<double> headPosition(void);
dtkVector3D<double> devicePosition(void);
dtkQuaternion<double> headOrientation(void);
dtkQuaternion<double> deviceOrientation(void);
public:
typedef void (*dtkVrTrackerVrpnAxesHandler)(int, float);
void registerAxesHandler1(dtkVrTrackerVrpn::dtkVrTrackerVrpnAxesHandler handler);
void registerAxesHandler2(dtkVrTrackerVrpn::dtkVrTrackerVrpnAxesHandler handler);
void registerAxesHandler3(dtkVrTrackerVrpn::dtkVrTrackerVrpnAxesHandler handler);
void registerAxesHandler4(dtkVrTrackerVrpn::dtkVrTrackerVrpnAxesHandler handler);
void registerAxesHandler5(dtkVrTrackerVrpn::dtkVrTrackerVrpnAxesHandler handler);
void registerAxesHandler6(dtkVrTrackerVrpn::dtkVrTrackerVrpnAxesHandler handler);
typedef void (*dtkVrTrackerVrpnPositionHandler)(float, float, float);
void registerPositionHandler1(dtkVrTrackerVrpn::dtkVrTrackerVrpnPositionHandler handler);
void registerPositionHandler2(dtkVrTrackerVrpn::dtkVrTrackerVrpnPositionHandler handler);
void registerPositionHandler3(dtkVrTrackerVrpn::dtkVrTrackerVrpnPositionHandler handler);
void registerPositionHandler4(dtkVrTrackerVrpn::dtkVrTrackerVrpnPositionHandler handler);
void registerPositionHandler5(dtkVrTrackerVrpn::dtkVrTrackerVrpnPositionHandler handler);
void registerPositionHandler6(dtkVrTrackerVrpn::dtkVrTrackerVrpnPositionHandler handler);
typedef void (*dtkVrTrackerVrpnOrientationHandler)(float, float, float, float);
void registerOrientationHandler1(dtkVrTrackerVrpn::dtkVrTrackerVrpnOrientationHandler handler);
void registerOrientationHandler2(dtkVrTrackerVrpn::dtkVrTrackerVrpnOrientationHandler handler);
void registerOrientationHandler3(dtkVrTrackerVrpn::dtkVrTrackerVrpnOrientationHandler handler);
void registerOrientationHandler4(dtkVrTrackerVrpn::dtkVrTrackerVrpnOrientationHandler handler);
void registerOrientationHandler5(dtkVrTrackerVrpn::dtkVrTrackerVrpnOrientationHandler handler);
void registerOrientationHandler6(dtkVrTrackerVrpn::dtkVrTrackerVrpnOrientationHandler handler);
enum Button {
dtkVrTrackerVrpnButton0,
dtkVrTrackerVrpnButton1,
dtkVrTrackerVrpnButton2,
dtkVrTrackerVrpnButton3,
dtkVrTrackerVrpnButton4,
dtkVrTrackerVrpnButton5,
dtkVrTrackerVrpnButton6,
dtkVrTrackerVrpnButton7,
dtkVrTrackerVrpnButton8,
dtkVrTrackerVrpnButton9,
dtkVrTrackerVrpnButtonUndefined
};
QString description(void) const;
signals:
void buttonPressed(int button);
void buttonReleased(int button);
public slots:
void startConnection(const QUrl& server);
void stopConnection(void);
protected:
void runAxesHandlers1(int axis, float angle);
void runAxesHandlers2(int axis, float angle);
void runAxesHandlers3(int axis, float angle);
void runAxesHandlers4(int axis, float angle);
void runAxesHandlers5(int axis, float angle);
void runAxesHandlers6(int axis, float angle);
void runPositionHandlers1(float x, float y, float z);
void runPositionHandlers2(float x, float y, float z);
void runPositionHandlers3(float x, float y, float z);
void runPositionHandlers4(float x, float y, float z);
void runPositionHandlers5(float x, float y, float z);
void runPositionHandlers6(float x, float y, float z);
void runOrientationHandlers1(float q0, float q1, float q2, float q3);
void runOrientationHandlers2(float q0, float q1, float q2, float q3);
void runOrientationHandlers3(float q0, float q1, float q2, float q3);
void runOrientationHandlers4(float q0, float q1, float q2, float q3);
void runOrientationHandlers5(float q0, float q1, float q2, float q3);
void runOrientationHandlers6(float q0, float q1, float q2, float q3);
private:
friend class dtkVrTrackerVrpnPrivate; dtkVrTrackerVrpnPrivate *d;
};
|
//
// SCLButton.h
// SCLAlertView
//
// Created by Diogo Autilio on 9/26/14.
// Copyright (c) 2014 AnyKey Entertainment. All rights reserved.
//
@import UIKit;
@interface SCLButton : UIButton
typedef void (^SCLActionBlock)(void);
typedef BOOL (^SCLValidationBlock)(void);
typedef NSDictionary* (^CompleteButtonFormatBlock)(void);
typedef NSDictionary* (^ButtonFormatBlock)(void);
// Action Types
typedef NS_ENUM(NSInteger, SCLActionType)
{
None,
Selector,
Block
};
/** Set button action type.
*
* Holds the button action type.
*/
@property SCLActionType actionType;
/** TODO
*
* TODO
*/
@property (nonatomic, copy) SCLActionBlock actionBlock;
/** TODO
*
* TODO
*/
@property (nonatomic, copy) SCLValidationBlock validationBlock;
/** Set Complete button format block.
*
* Holds the complete button format block.
* Support keys : backgroundColor, borderColor, textColor
*/
@property (nonatomic, copy) CompleteButtonFormatBlock completeButtonFormatBlock;
/** Set button format block.
*
* Holds the button format block.
* Support keys : backgroundColor, borderColor, textColor
*/
@property (nonatomic, copy) ButtonFormatBlock buttonFormatBlock;
/** Set SCLButton color.
*
* Set SCLButton color.
*/
@property (nonatomic, strong) UIColor *defaultBackgroundColor;
/** Set Target object.
*
* Target is an object that holds the information necessary to send a message to another object when an event occurs.
*/
@property id target;
/** Set selector id.
*
* A selector is the name used to select a method to execute for an object,
* or the unique identifier that replaces the name when the source code is compiled.
*/
@property SEL selector;
/** Parse button configuration
*
* Parse ButtonFormatBlock and CompleteButtonFormatBlock setting custom configuration.
* Set keys : backgroundColor, borderColor, textColor
*/
- (void)parseConfig:(NSDictionary *)buttonConfig;
@end
|
/**
* @file lpc17xx_dac.c
* @brief Contains all functions support for DAC firmware library on LPC17xx
* @version 2.0
* @date 21. May. 2010
* @author NXP MCU SW Application Team
**************************************************************************
* Software that is described herein is for illustrative purposes only
* which provides customers with programming information regarding the
* products. This software is supplied "AS IS" without any warranties.
* NXP Semiconductors assumes no responsibility or liability for the
* use of the software, conveys no license or title under any patent,
* copyright, or mask work right to the product. NXP Semiconductors
* reserves the right to make changes in the software without
* notification. NXP Semiconductors also make no representation or
* warranty that such application will be suitable for the specified
* use without further testing or modification.
**********************************************************************/
/* Peripheral group ----------------------------------------------------------- */
/** @addtogroup DAC
* @{
*/
/* Includes ------------------------------------------------------------------- */
#include "lpc17xx_dac.h"
#include "lpc17xx_clkpwr.h"
/* If this source file built with example, the LPC17xx FW library configuration
* file in each example directory ("lpc17xx_libcfg.h") must be included,
* otherwise the default FW library configuration file must be included instead
*/
#ifdef __BUILD_WITH_EXAMPLE__
#include "lpc17xx_libcfg.h"
#else
#include "lpc17xx_libcfg_default.h"
#endif /* __BUILD_WITH_EXAMPLE__ */
#ifdef _DAC
/* Public Functions ----------------------------------------------------------- */
/** @addtogroup DAC_Public_Functions
* @{
*/
/*********************************************************************//**
* @brief Initial ADC configuration
* - Maximum current is 700 uA
* - Value to AOUT is 0
* @param[in] DACx pointer to LPC_DAC_TypeDef, should be: LPC_DAC
* @return None
***********************************************************************/
void DAC_Init(LPC_DAC_TypeDef *DACx)
{
CHECK_PARAM(PARAM_DACx(DACx));
/* Set default clock divider for DAC */
// CLKPWR_SetPCLKDiv (CLKPWR_PCLKSEL_DAC, CLKPWR_PCLKSEL_CCLK_DIV_4);
//Set maximum current output
DAC_SetBias(LPC_DAC,DAC_MAX_CURRENT_700uA);
}
/*********************************************************************//**
* @brief Update value to DAC
* @param[in] DACx pointer to LPC_DAC_TypeDef, should be: LPC_DAC
* @param[in] dac_value : value 10 bit to be converted to output
* @return None
***********************************************************************/
void DAC_UpdateValue (LPC_DAC_TypeDef *DACx,uint32_t dac_value)
{
uint32_t tmp;
CHECK_PARAM(PARAM_DACx(DACx));
tmp = DACx->DACR & DAC_BIAS_EN;
tmp |= DAC_VALUE(dac_value);
// Update value
DACx->DACR = tmp;
}
/*********************************************************************//**
* @brief Set Maximum current for DAC
* @param[in] DACx pointer to LPC_DAC_TypeDef, should be: LPC_DAC
* @param[in] bias : 0 is 700 uA
* 1 350 uA
* @return None
***********************************************************************/
void DAC_SetBias (LPC_DAC_TypeDef *DACx,uint32_t bias)
{
CHECK_PARAM(PARAM_DAC_CURRENT_OPT(bias));
DACx->DACR &=~DAC_BIAS_EN;
if (bias == DAC_MAX_CURRENT_350uA)
{
DACx->DACR |= DAC_BIAS_EN;
}
}
/*********************************************************************//**
* @brief To enable the DMA operation and control DMA timer
* @param[in] DACx pointer to LPC_DAC_TypeDef, should be: LPC_DAC
* @param[in] DAC_ConverterConfigStruct pointer to DAC_CONVERTER_CFG_Type
* - DBLBUF_ENA : enable/disable DACR double buffering feature
* - CNT_ENA : enable/disable timer out counter
* - DMA_ENA : enable/disable DMA access
* @return None
***********************************************************************/
void DAC_ConfigDAConverterControl (LPC_DAC_TypeDef *DACx,DAC_CONVERTER_CFG_Type *DAC_ConverterConfigStruct)
{
CHECK_PARAM(PARAM_DACx(DACx));
DACx->DACCTRL &= ~DAC_DACCTRL_MASK;
if (DAC_ConverterConfigStruct->DBLBUF_ENA)
DACx->DACCTRL |= DAC_DBLBUF_ENA;
if (DAC_ConverterConfigStruct->CNT_ENA)
DACx->DACCTRL |= DAC_CNT_ENA;
if (DAC_ConverterConfigStruct->DMA_ENA)
DACx->DACCTRL |= DAC_DMA_ENA;
}
/*********************************************************************//**
* @brief Set reload value for interrupt/DMA counter
* @param[in] DACx pointer to LPC_DAC_TypeDef, should be: LPC_DAC
* @param[in] time_out time out to reload for interrupt/DMA counter
* @return None
***********************************************************************/
void DAC_SetDMATimeOut(LPC_DAC_TypeDef *DACx, uint32_t time_out)
{
CHECK_PARAM(PARAM_DACx(DACx));
DACx->DACCNTVAL = DAC_CCNT_VALUE(time_out);
}
/**
* @}
*/
#endif /* _DAC */
/**
* @}
*/
/* --------------------------------- End Of File ------------------------------ */
|
//
// BRSocketHelpers.h
// BreadWallet
//
// Created by Samuel Sutch on 2/17/16.
// Copyright (c) 2016 breadwallet LLC
// Copyright © 2016 Litecoin Association <loshan1212@gmail.com>
//
// 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 BRSocketHelpers_h
#define BRSocketHelpers_h
#include <stdio.h>
int bw_nbioify(int fd);
struct bw_select_request {
int write_fd_len;
int read_fd_len;
int *write_fds;
int *read_fds;
};
struct bw_select_result {
int error; // if > 0 there is an error
int write_fd_len;
int read_fd_len;
int error_fd_len;
int *write_fds;
int *read_fds;
int *error_fds;
};
struct bw_select_result bw_select(struct bw_select_request);
#endif /* BRSocketHelpers_h */
|
#include <stdlib.h>
int main(int argc, char **argv) {
qsort_r(0, 0, 0, 0, 0);
return 0;
}
|
/*!
* @header BAKit.h
* BABaseProject
*
* @brief BAKit
*
* @author 博爱
* @copyright Copyright © 2016年 博爱. All rights reserved.
* @version V1.0
*/
// _ooOoo_
// o8888888o
// 88" . "88
// (| -_- |)
// O\ = /O
// ____/`---'\____
// . ' \\| |// `.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
// | \_| ''\---/'' | |
// \ .-\__ `-` ___/-. /
// ___`. .' /--.--\ `. . __
// ."" '< `.___\_<|>_/___.' >'"".
// | | : `- \`.;`\ _ /`;.`/ - ` : | |
// \ \ `-. \_ __\ /__ _/ .-` / /
// ======`-.____`-.___\_____/___.-`____.-'======
// `=---='
//
// .............................................
// 佛祖镇楼 BUG辟易
// 佛曰:
// 写字楼里写字间,写字间里程序员;
// 程序人员写程序,又拿程序换酒钱。
// 酒醒只在网上坐,酒醉还来网下眠;
// 酒醉酒醒日复日,网上网下年复年。
// 但愿老死电脑间,不愿鞠躬老板前;
// 奔驰宝马贵者趣,公交自行程序员。
// 别人笑我忒疯癫,我笑自己命太贱;
// 不见满街漂亮妹,哪个归得程序员?
/*
*********************************************************************************
*
* 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug
*
* QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】)
* 微博 : 博爱1616
* Email : 137361770@qq.com
* GitHub : https://github.com/boai
* 博客园 : http://www.cnblogs.com/boai/
* 博客 : http://boai.github.io
* 简书 : http://www.jianshu.com/users/95c9800fdf47/latest_articles
* 简书专题 : http://www.jianshu.com/collection/072d578bf782
*********************************************************************************
*************************** BACustomAlertView 项目简介: **********************
1、开发人员:
孙博岩:[『https://github.com/boai』](https://github.com/boai)<br>
陆晓峰:[『https://github.com/zeR0Lu』](https://github.com/zeR0Lu)<br>
陈集 :[『https://github.com/chenjipdc』](https://github.com/chenjipdc)
2、项目源码地址:
https://github.com/boai/BACustomAlertView
3、安装及使用方式:
* 3.1、pod 导入【当前最新版本:1.0.4】:
pod 'BACustomAlertView'
导入头文件:#import <BACustomAlertView.h>
* 3.2、下载demo,把 BACustomAlertView 文件夹拖入项目即可,
导入头文件:#import "BACustomAlertView.h"
4、如果开发中遇到特殊情况或者bug,请及时反馈给我们,谢谢!
5、也可以加入我们的大家庭:QQ群 【 479663605 】,希望广大小白和大神能够积极加入!
*/
#import <UIKit/UIKit.h>
#define SCREENWIDTH [UIScreen mainScreen].bounds.size.width
#define SCREENHEIGHT [UIScreen mainScreen].bounds.size.height
#define BAWeak __weak __typeof(self) weakSelf = self
/*! 背景高斯模糊枚举 默认:1 */
typedef NS_ENUM(NSInteger, BACustomAlertViewBlurEffectStyle) {
/*! 较亮的白色模糊 */
BACustomAlertViewBlurEffectStyleExtraLight = 1,
/*! 一般亮的白色模糊 */
BACustomAlertViewBlurEffectStyleLight,
/*! 深色背景模糊 */
BACustomAlertViewBlurEffectStyleDark
} NS_ENUM_AVAILABLE_IOS(8_0);
/*! 进出场动画枚举 默认:1 */
typedef NS_ENUM(NSUInteger, BACustomAlertViewAnimatingStyle) {
/*! 缩放显示动画 */
BACustomAlertViewAnimatingStyleScale = 1,
/*! 晃动动画 */
BACustomAlertViewAnimatingStyleShake,
/*! 天上掉下动画 / 上升动画 */
BACustomAlertViewAnimatingStyleFall,
};
@interface BACustomAlertView : UIView
/*! 背景颜色 默认:半透明*/
@property (nonatomic, strong) UIColor *bgColor;
/*! 按钮字体颜色 默认:白色*/
@property (nonatomic, strong) UIColor *buttonTitleColor;
/*! 是否开启边缘触摸隐藏 alert 默认:NO */
@property (nonatomic, assign) BOOL isTouchEdgeHide;
/*! 背景图片名字 默认:没有图片*/
@property (nonatomic, strong) NSString *bgImageName;
/*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */
@property (nonatomic, assign) BOOL isShowAnimate;
/*! 进出场动画枚举 默认:1 ,并且默认开启动画开关 */
@property (nonatomic, assign) BACustomAlertViewAnimatingStyle animatingStyle;
/*! 背景高斯模糊枚举 默认:1 */
@property (nonatomic, assign) BACustomAlertViewBlurEffectStyle blurEffectStyle;
/*!
* 按钮点击事件回调
*/
@property (strong, nonatomic) void (^buttonActionBlock)(NSInteger index);
#pragma mark - 1、高度封装一行即可完全配置alert,如不习惯,可使用第二种常用方法
/*!
* 创建一个完全自定义的 alertView
*
* @param customView 自定义 View
* @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide...
*/
+ (void)ba_showCustomView:(UIView *)customView
configuration:(void (^)(BACustomAlertView *tempView)) configuration;
/*!
* 创建一个类似于系统的alert
*
* @param title 标题:可空
* @param message 消息内容:可空
* @param image 图片:可空
* @param buttonTitles 按钮标题:不可空
* @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide...
* @param action 按钮的点击事件处理
*/
+ (void)ba_showAlertWithTitle:(NSString *)title
message:(NSString *)message
image:(UIImage *)image
buttonTitles:(NSArray *)buttonTitles
configuration:(void (^)(BACustomAlertView *tempView)) configuration
actionClick:(void (^)(NSInteger index)) action;
#pragma mark - 2、常用方法
/*!
* 初始化自定义动画视图
* @return instancetype
*/
- (instancetype)initWithCustomView:(UIView *)customView;
/*!
* 创建一个类似系统的警告框
*
* @param title title
* @param message message
* @param image image
* @param buttonTitles 按钮的标题
*
* @return 创建一个类似系统的警告框
*/
- (instancetype)ba_showTitle:(NSString *)title
message:(NSString *)message
image:(UIImage *)image
buttonTitles:(NSArray *)buttonTitles;
/*!
* 视图显示
*/
- (void)ba_showAlertView;
/*!
* 视图消失
*/
- (void)ba_dismissAlertView;
@end
|
#ifndef _MRampAttribute
#define _MRampAttribute
//
//-
// ==========================================================================
// Copyright (C) 1995 - 2006 Autodesk, Inc., and/or its licensors. All
// rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its
// licensors, which is protected by U.S. and Canadian federal copyright law
// and by international treaties.
//
// The Data may not be disclosed or distributed to third parties or be
// copied or duplicated, in whole or in part, without the prior written
// consent of Autodesk.
//
// The copyright notices in the Software and this entire statement,
// including the above license grant, this restriction and the following
// disclaimer, must be included in all copies of the Software, in whole
// or in part, and all derivative works of the Software, unless such copies
// or derivative works are solely in the form of machine-executable object
// code generated by a source language processor.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
// AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED
// WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF
// NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
// OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO
// EVENT WILL AUTODESK AND/OR ITS LICENSORS BE LIABLE FOR ANY LOST
// REVENUES, DATA, OR PROFITS, OR SPECIAL, DIRECT, INDIRECT, OR
// CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS LICENSORS HAS
// BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.
// ==========================================================================
//+
//
// CLASS: MRampAttribute
//
// *****************************************************************************
//
// CLASS DESCRIPTION (MRampAttribute)
//
// This class is used to manipulate ramp attributes. You can add, delete, and set
// entries in both color and curve ramps.
// You can't create a ramp attribute from this class, you can only modifying existing
// ramps.
//
// *****************************************************************************
#if defined __cplusplus
// INCLUDED HEADER FILES
#include <maya/MTypes.h>
#include <maya/MDGContext.h>
// *****************************************************************************
// DECLARATIONS
// *****************************************************************************
class MString;
class MStatus;
class MPlug;
class MColor;
class MFloatArray;
class MColorArray;
class MIntArray;
class MObject;
// CLASS DECLARATION (MRampAttribute)
#ifdef _WIN32
#pragma warning(disable: 4522)
#endif // _WIN32
/// Ramp data attribute function wrapper class
/**
Wrapper class for ramp data attributes.
*/
class OPENMAYA_EXPORT MRampAttribute
{
public:
///
MRampAttribute ();
///
MRampAttribute (const MRampAttribute& other);
///
MRampAttribute (const MPlug& obj, MStatus* ReturnStatus = NULL);
///
MRampAttribute (const MObject& node, const MObject& attr, MStatus* ReturnStatus = NULL);
///
MRampAttribute& operator =( const MRampAttribute & other );
///
~MRampAttribute ();
///
enum MInterpolation {
///
kLinear = 0,
///
kNone = 1,
///
kSpline = 2,
///
kSmooth = 3
};
///
unsigned int getNumEntries (MStatus * returnStatus = NULL);
///
void getEntries (MIntArray& indexes,
MFloatArray& positions,
MFloatArray& values,
MIntArray& interps,
MStatus * returnStatus = NULL);
///
void getEntries (MIntArray& indexes,
MFloatArray& positions,
MColorArray& colors,
MIntArray& interps,
MStatus * returnStatus = NULL);
///
void addEntries (MFloatArray& positions,
MColorArray& values,
MIntArray& interps,
MStatus * returnStatus = NULL);
///
void addEntries (MFloatArray& positions,
MFloatArray& values,
MIntArray& interps,
MStatus * returnStatus = NULL);
///
void deleteEntries (MIntArray& indexes,
MStatus * returnStatus = NULL);
///
void setColorAtIndex (MColor& color, unsigned int index, MStatus * returnStatus = NULL);
///
void setValueAtIndex (float value, unsigned int index, MStatus * returnStatus = NULL);
///
void setPositionAtIndex (float position, unsigned int index, MStatus * returnStatus = NULL);
///
void setInterpolationAtIndex (MRampAttribute::MInterpolation interp, unsigned int index, MStatus * returnStatus = NULL);
///
bool isColorRamp(MStatus * returnStatus = NULL);
///
bool isCurveRamp(MStatus * returnStatus = NULL);
///
void getColorAtPosition (float position, MColor& color, MStatus * returnStatus = NULL, MDGContext& = MDGContext::fsNormal);
///
void getValueAtPosition (float position, float& value, MStatus * returnStatus = NULL, MDGContext& = MDGContext::fsNormal);
///
static MObject createCurveRamp(MString& attrLongName, MString& attrShortName, MStatus* ReturnStatus = NULL);
///
static MObject createColorRamp(MString& attrLongName, MString& attrShortName, MStatus* ReturnStatus = NULL);
protected:
// No protected members
private:
static const char* className();
const void * fData;
bool fOwn;
};
#ifdef _WIN32
#pragma warning(default: 4522)
#endif // _WIN32
// *****************************************************************************
#endif /* __cplusplus */
#endif /* _MFnRampDataAttribute */
|
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef NRF6310_H__
#define NRF6310_H__
#include "nrf_gpio.h"
#define LED_START 8
#define LED_0 8
#define LED_1 9
#define LED_2 10
#define LED_3 11
#define LED_4 12
#define LED_5 13
#define LED_6 14
#define LED_7 15
#define LED_STOP 15
#define BUTTON_START 0
#define BUTTON_0 0
#define BUTTON_1 1
#define BUTTON_2 2
#define BUTTON_3 3
#define BUTTON_4 4
#define BUTTON_5 5
#define BUTTON_6 6
#define BUTTON_7 7
#define BUTTON_STOP 7
#define BUTTON_PULL NRF_GPIO_PIN_NOPULL
#define RX_PIN_NUMBER 16 // UART RX pin number.
#define TX_PIN_NUMBER 17 // UART TX pin number.
#define CTS_PIN_NUMBER 18 // UART Clear To Send pin number. Not used if HWFC is set to false.
#define RTS_PIN_NUMBER 19 // UART Request To Send pin number. Not used if HWFC is set to false.
#define HWFC false // UART hardware flow control.
#define SPIS_MISO_PIN 20 // SPI MISO signal.
#define SPIS_CSN_PIN 21 // SPI CSN signal.
#define SPIS_MOSI_PIN 22 // SPI MOSI signal.
#define SPIS_SCK_PIN 23 // SPI SCK signal.
#define SPIM0_SCK_PIN 23u /**< SPI clock GPIO pin number. */
#define SPIM0_MOSI_PIN 20u /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM0_MISO_PIN 22u /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM0_SS_PIN 21u /**< SPI Slave Select GPIO pin number. */
#define SPIM1_SCK_PIN 16u /**< SPI clock GPIO pin number. */
#define SPIM1_MOSI_PIN 18u /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM1_MISO_PIN 17u /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM1_SS_PIN 19u /**< SPI Slave Select GPIO pin number. */
// serialization APPLICATION board
#define SER_APP_RX_PIN 16 // UART RX pin number.
#define SER_APP_TX_PIN 17 // UART TX pin number.
#define SER_APP_CTS_PIN 18 // UART Clear To Send pin number.
#define SER_APP_RTS_PIN 19 // UART Request To Send pin number.
#if 0
#define SER_APP_SPIM0_SCK_PIN 20 // SPI clock GPIO pin number.
#define SER_APP_SPIM0_MOSI_PIN 17 // SPI Master Out Slave In GPIO pin number
#define SER_APP_SPIM0_MISO_PIN 16 // SPI Master In Slave Out GPIO pin number
#define SER_APP_SPIM0_SS_PIN 21 // SPI Slave Select GPIO pin number
#define SER_APP_SPIM0_RDY_PIN 19 // SPI READY GPIO pin number
#define SER_APP_SPIM0_REQ_PIN 18 // SPI REQUEST GPIO pin number
#else
#define SER_APP_SPIM0_SCK_PIN 23 // SPI clock GPIO pin number.
#define SER_APP_SPIM0_MOSI_PIN 20 // SPI Master Out Slave In GPIO pin number
#define SER_APP_SPIM0_MISO_PIN 22 // SPI Master In Slave Out GPIO pin number
#define SER_APP_SPIM0_SS_PIN 21 // SPI Slave Select GPIO pin number
#define SER_APP_SPIM0_RDY_PIN 29 // SPI READY GPIO pin number
#define SER_APP_SPIM0_REQ_PIN 28 // SPI REQUEST GPIO pin number
#endif
// serialization CONNECTIVITY board
#if 0
#define SER_CON_RX_PIN 17 // UART RX pin number.
#define SER_CON_TX_PIN 16 // UART TX pin number.
#define SER_CON_CTS_PIN 19 // UART Clear To Send pin number. Not used if HWFC is set to false.
#define SER_CON_RTS_PIN 18 // UART Request To Send pin number. Not used if HWFC is set to false.
#else
#define SER_CON_RX_PIN 16 // UART RX pin number.
#define SER_CON_TX_PIN 17 // UART TX pin number.
#define SER_CON_CTS_PIN 18 // UART Clear To Send pin number. Not used if HWFC is set to false.
#define SER_CON_RTS_PIN 19 // UART Request To Send pin number. Not used if HWFC is set to false.
#endif
#if 0
#define SER_CON_SPIS_SCK_PIN 20 // SPI SCK signal.
#define SER_CON_SPIS_MISO_PIN 16 // SPI MISO signal.
#define SER_CON_SPIS_MOSI_PIN 17 // SPI MOSI signal.
#define SER_CON_SPIS_CSN_PIN 21 // SPI CSN signal.
#define SER_CON_SPIS_RDY_PIN 19 // SPI READY GPIO pin number.
#define SER_CON_SPIS_REQ_PIN 18 // SPI REQUEST GPIO pin number.
#else
#define SER_CON_SPIS_SCK_PIN 23 // SPI SCK signal.
#define SER_CON_SPIS_MOSI_PIN 22 // SPI MOSI signal.
#define SER_CON_SPIS_MISO_PIN 20 // SPI MISO signal.
#define SER_CON_SPIS_CSN_PIN 21 // SPI CSN signal.
#define SER_CON_SPIS_RDY_PIN 29 // SPI READY GPIO pin number.
#define SER_CON_SPIS_REQ_PIN 28 // SPI REQUEST GPIO pin number.
#endif
#define SER_CONN_ASSERT_LED_PIN LED_2
#endif // NRF6310_H__
|
//
// RCFileMessage.h
// RongIMLib
//
// Created by 珏王 on 16/5/23.
// Copyright © 2016年 RongCloud. All rights reserved.
//
#import <RongIMLib/RongIMLib.h>
/*!
发送文件消息的类型名
*/
#define RCFileMessageTypeIdentifier @"RC:SFMsg"
@interface RCFileMessage : RCMessageContent
/*!
文件的本地路径
*/
@property(nonatomic, strong) NSString *filePath;
/*!
发送文件消息的附加信息
*/
@property(nonatomic, strong) NSString *extra;
/*!
初始化发送文件消息
@param filePath 文件的本地路径
@return 发送文件消息对象
*/
+ (instancetype)messageWithFile:(NSString *)filePath;
@end
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Entities\0.18.8\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Float2.h>
#include <Uno.Object.h>
namespace g{namespace Fuse{namespace Entities{struct Entity;}}}
namespace g{namespace Fuse{namespace Entities{struct MeshRenderer;}}}
namespace g{namespace Fuse{namespace Entities{struct Raycasting__EntityVisitor;}}}
namespace g{namespace Fuse{struct DrawContext;}}
namespace g{
namespace Fuse{
namespace Entities{
// private sealed class Raycasting.EntityVisitor :1813
// {
uType* Raycasting__EntityVisitor_typeof();
void Raycasting__EntityVisitor__ctor__fn(Raycasting__EntityVisitor* __this, ::g::Fuse::DrawContext* tc);
void Raycasting__EntityVisitor__New1_fn(::g::Fuse::DrawContext* tc, Raycasting__EntityVisitor** __retval);
void Raycasting__EntityVisitor__Visit_fn(Raycasting__EntityVisitor* __this, ::g::Fuse::Entities::Entity* e, ::g::Uno::Float2* p, bool* __retval);
void Raycasting__EntityVisitor__VisitMeshRenderer_fn(Raycasting__EntityVisitor* __this, ::g::Fuse::Entities::MeshRenderer* mr);
struct Raycasting__EntityVisitor : uObject
{
bool _foundAnyIntersections;
float _minDistance;
::g::Uno::Float2 _point;
uStrong< ::g::Fuse::DrawContext*> _tc;
void ctor_(::g::Fuse::DrawContext* tc);
bool Visit(::g::Fuse::Entities::Entity* e, ::g::Uno::Float2* p);
void VisitMeshRenderer(::g::Fuse::Entities::MeshRenderer* mr);
static Raycasting__EntityVisitor* New1(::g::Fuse::DrawContext* tc);
};
// }
}}} // ::g::Fuse::Entities
|
// Copyright (C) 2014 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_SIMPLE_ObJECT_DETECTOR_ABSTRACT_H__
#ifdef DLIB_SIMPLE_ObJECT_DETECTOR_ABSTRACT_H__
#include <dlib/image_processing/object_detector_abstract.h>
#include <dlib/image_processing/scan_fhog_pyramid_abstract.h>
#include <dlib/svm/structural_object_detection_trainer_abstract.h>
#include <dlib/data_io/image_dataset_metadata.h>
#include <dlib/matrix.h>
namespace dlib
{
// ----------------------------------------------------------------------------------------
struct fhog_training_options
{
/*!
WHAT THIS OBJECT REPRESENTS
This object is a container for the options to the train_simple_object_detector()
routine. The parameters have the following interpretations:
- be_verbose: If true, train_simple_object_detector() will print out a
lot of information to the screen while training.
- add_left_right_image_flips: if true, train_simple_object_detector()
will assume the objects are left/right symmetric and add in left
right flips of the training images. This doubles the size of the
training dataset.
- num_threads: train_simple_object_detector() will use this many
threads of execution. Set this to the number of CPU cores on your
machine to obtain the fastest training speed.
- detection_window_size: The sliding window used will have about this
many pixels inside it.
- C is the usual SVM C regularization parameter. So it is passed to
structural_object_detection_trainer::set_c(). Larger values of C
will encourage the trainer to fit the data better but might lead to
overfitting. Therefore, you must determine the proper setting of
this parameter experimentally.
- epsilon is the stopping epsilon. Smaller values make the trainer's
solver more accurate but might take longer to train.
!*/
fhog_training_options()
{
be_verbose = false;
add_left_right_image_flips = false;
num_threads = 4;
detection_window_size = 80*80;
C = 1;
epsilon = 0.01;
}
bool be_verbose;
bool add_left_right_image_flips;
unsigned long num_threads;
unsigned long detection_window_size;
double C;
double epsilon;
};
// ----------------------------------------------------------------------------------------
typedef object_detector<scan_fhog_pyramid<pyramid_down<6> > > simple_object_detector;
// ----------------------------------------------------------------------------------------
void train_simple_object_detector (
const std::string& dataset_filename,
const std::string& detector_output_filename,
const fhog_training_options& options
);
/*!
requires
- options.C > 0
ensures
- Uses the structural_object_detection_trainer to train a
simple_object_detector based on the labeled images in the XML file
dataset_filename. This function assumes the file dataset_filename is in the
XML format produced by the save_image_dataset_metadata() routine.
- This function will apply a reasonable set of default parameters and
preprocessing techniques to the training procedure for simple_object_detector
objects. So the point of this function is to provide you with a very easy
way to train a basic object detector.
- The trained object detector is serialized to the file detector_output_filename.
!*/
// ----------------------------------------------------------------------------------------
struct simple_test_results
{
double precision;
double recall;
double average_precision;
};
inline const simple_test_results test_simple_object_detector (
const std::string& dataset_filename,
const std::string& detector_filename
);
/*!
ensures
- Loads an image dataset from dataset_filename. We assume dataset_filename is
a file using the XML format written by save_image_dataset_metadata().
- Loads a simple_object_detector from the file detector_filename. This means
detector_filename should be a file produced by the train_simple_object_detector()
routine defined above.
- This function tests the detector against the dataset and returns three
numbers that tell you how well the detector does at detecting the objects in
the dataset. The return value of this function is identical to that of
test_object_detection_function(). Therefore, see the documentation for
test_object_detection_function() for an extended definition of these metrics.
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_SIMPLE_ObJECT_DETECTOR_ABSTRACT_H__
|
/* Copyright (C) 2000 The PARI group.
This file is part of the PARI/GP package.
PARI/GP 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. It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY WHATSOEVER.
Check the License for details. You should have received a copy of it, along
with the package; see the file 'COPYING'. If not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
/*******************************************************************/
/* HIGH RESOLUTION PLOT VIA POSTSCRIPT FILE */
/*******************************************************************/
#include "pari.h"
#include "paripriv.h"
#include "rect.h"
void
rectdraw0(long *w, long *x, long *y, long lw)
{
struct plot_eng plot;
FILE *file;
char *s, *cmd;
const char *v;
if (pari_daemon()) return; /* parent process returns */
s = pari_unique_filename("plotps");
pari_unlink(s);
s = stack_strcat(s, ".ps");
file = fopen(s, "w");
if (!file) pari_err_FILE("postscript file", s);
psplot_init(&plot, file, 1.0, 1.0, 9);
fprintf(file,"0 %ld translate -90 rotate\n", plot.pl->height - 50);
gen_rectdraw0(&plot, w, x, y, lw, 1, 1);
fprintf(file,"stroke showpage\n"); (void)fclose(file);
v = os_getenv("GP_POSTSCRIPT_VIEWER");
if (!v) v = "open -W";
cmd = pari_sprintf("%s \"%s\" 2>/dev/null", v, s);
gpsystem(cmd);
pari_unlink(s); exit(0);
}
void
PARI_get_plot(void)
{
if (pari_plot.init) return;
pari_plot.width = 400;
pari_plot.height = 300;
pari_plot.fheight = 9;
pari_plot.fwidth = 6;
pari_plot.hunit = 3;
pari_plot.vunit = 3;
pari_plot.init = 1;
}
|
/*
* Copyright (C) 2016 MediaTek Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
*/
/*****************************************************************************
*
* Filename:
* ---------
* IMX258mipiraw_Sensor.h
*
* Project:
* --------
* ALPS
*
* Description:
* ------------
* CMOS sensor header file
*
****************************************************************************/
#ifndef _IMX258MIPIRAW_SENSOR_H
#define _IMX258MIPIRAW_SENSOR_H
typedef enum {
IMGSENSOR_MODE_INIT,
IMGSENSOR_MODE_PREVIEW,
IMGSENSOR_MODE_CAPTURE,
IMGSENSOR_MODE_VIDEO,
IMGSENSOR_MODE_HIGH_SPEED_VIDEO,
IMGSENSOR_MODE_SLIM_VIDEO,
} IMGSENSOR_MODE;
typedef struct imgsensor_mode_struct {
kal_uint32 pclk; /* record different mode's pclk */
kal_uint32 linelength; /* record different mode's linelength */
kal_uint32 framelength; /* record different mode's framelength */
kal_uint8 startx; /* record different mode's startx of grabwindow */
kal_uint8 starty; /* record different mode's startx of grabwindow */
kal_uint16 grabwindow_width; /* record different mode's width of grabwindow */
kal_uint16 grabwindow_height; /* record different mode's height of grabwindow */
/* following for MIPIDataLowPwr2HighSpeedSettleDelayCount by different scenario */
kal_uint8 mipi_data_lp2hs_settle_dc;
/* following for GetDefaultFramerateByScenario() */
kal_uint16 max_framerate;
} imgsensor_mode_struct;
/* SENSOR PRIVATE STRUCT FOR VARIABLES*/
typedef struct imgsensor_struct {
kal_uint8 mirror; /* mirrorflip information */
kal_uint8 sensor_mode; /* record IMGSENSOR_MODE enum value */
kal_uint32 shutter; /* current shutter */
kal_uint16 gain; /* current gain */
kal_uint32 pclk; /* current pclk */
kal_uint32 frame_length; /* current framelength */
kal_uint32 line_length; /* current linelength */
kal_uint32 min_frame_length; /* current min framelength to max framerate */
kal_uint16 dummy_pixel; /* current dummypixel */
kal_uint16 dummy_line; /* current dummline */
kal_uint16 current_fps; /* current max fps */
kal_bool autoflicker_en; /* record autoflicker enable or disable */
kal_bool test_pattern; /* record test pattern mode or not */
MSDK_SCENARIO_ID_ENUM current_scenario_id; /* current scenario id */
kal_uint8 ihdr_en; /* ihdr enable or disable */
kal_uint8 pdaf_mode; /* ihdr enable or disable */
kal_uint8 i2c_write_id; /* record current sensor's i2c write id */
} imgsensor_struct;
/* SENSOR PRIVATE STRUCT FOR CONSTANT*/
typedef struct imgsensor_info_struct {
kal_uint32 sensor_id; /* record sensor id defined in Kd_imgsensor.h */
kal_uint32 checksum_value; /* checksum value for Camera Auto Test */
imgsensor_mode_struct pre; /* preview scenario relative information */
imgsensor_mode_struct cap; /* capture scenario relative information */
imgsensor_mode_struct cap1; /* capture for PIP 24fps relative information,
capture1 mode must use same framelength, linelength with Capture mode for shutter calculate */
imgsensor_mode_struct normal_video; /* normal video scenario relative information */
imgsensor_mode_struct hs_video; /* high speed video scenario relative information */
imgsensor_mode_struct slim_video; /* slim video for VT scenario relative information */
kal_uint8 ae_shut_delay_frame; /* shutter delay frame for AE cycle */
kal_uint8 ae_sensor_gain_delay_frame; /* sensor gain delay frame for AE cycle */
kal_uint8 ae_ispGain_delay_frame; /* isp gain delay frame for AE cycle */
kal_uint8 ihdr_support; /* 1, support; 0,not support */
kal_uint8 ihdr_le_firstline; /* 1,le first ; 0, se first */
kal_uint8 sensor_mode_num; /* support sensor mode num */
kal_uint8 cap_delay_frame; /* enter capture delay frame num */
kal_uint8 pre_delay_frame; /* enter preview delay frame num */
kal_uint8 video_delay_frame; /* enter video delay frame num */
kal_uint8 hs_video_delay_frame; /* enter high speed video delay frame num */
kal_uint8 slim_video_delay_frame; /* enter slim video delay frame num */
kal_uint8 margin; /* sensor framelength & shutter margin */
kal_uint32 min_shutter; /* min shutter */
kal_uint32 max_frame_length; /* max framelength by sensor register's limitation */
kal_uint8 isp_driving_current; /* mclk driving current */
kal_uint8 sensor_interface_type; /* sensor_interface_type */
kal_uint8 mipi_sensor_type;
/* 0,MIPI_OPHY_NCSI2; 1,MIPI_OPHY_CSI2, default is NCSI2, don't modify this para */
kal_uint8 mipi_settle_delay_mode;
/* 0, high speed signal auto detect; 1, use settle delay,unit is ns,
default is auto detect, don't modify this para */
kal_uint8 sensor_output_dataformat; /* sensor output first pixel color */
kal_uint8 mclk; /* mclk value, suggest 24 or 26 for 24Mhz or 26Mhz */
kal_uint8 mipi_lane_num; /* mipi lane num */
kal_uint8 i2c_addr_table[5]; /* record sensor support all write id addr, only supprt 4must end with 0xff */
kal_uint32 i2c_speed; /* i2c speed */
} imgsensor_info_struct;
/* SENSOR READ/WRITE ID */
/* #define IMGSENSOR_WRITE_ID_1 (0x6c) */
/* #define IMGSENSOR_READ_ID_1 (0x6d) */
/* #define IMGSENSOR_WRITE_ID_2 (0x20) */
/* #define IMGSENSOR_READ_ID_2 (0x21) */
extern int iReadRegI2C(u8 *a_pSendData, u16 a_sizeSendData, u8 *a_pRecvData, u16 a_sizeRecvData,
u16 i2cId);
extern int iWriteRegI2C(u8 *a_pSendData, u16 a_sizeSendData, u16 i2cId);
extern int iWriteReg(u16 a_u2Addr, u32 a_u4Data, u32 a_u4Bytes, u16 i2cId);
extern void kdSetI2CSpeed(u16 i2cSpeed);
extern int iMultiReadReg(u16 a_u2Addr, u8 *a_puBuff, u16 i2cId, u8 number);
extern int iReadReg(u16 a_u2Addr, u8 *a_puBuff, u16 i2cId);
#endif
|
/**
* Copyright 2015 OneSignal
* Portions Copyright 2014 StackMob
*
* This file includes portions from the StackMob iOS SDK and distributed under an Apache 2.0 license.
* StackMob was acquired by PayPal and ceased operation on May 22, 2014.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
typedef void (^OneSignalResultSuccessBlock)(NSDictionary* result);
typedef void (^OneSignalFailureBlock)(NSError* error);
typedef void (^OneSignalIdsAvailableBlock)(NSString* userId, NSString* pushToken);
typedef void (^OneSignalHandleNotificationBlock)(NSString* message, NSDictionary* additionalData, BOOL isActive);
/**
`OneSignal` provides a high level interface to interact with OneSignal's push service.
`OneSignal` exposes a defaultClient for applications which use a globally available client to share configuration settings.
Include `#import "OneSignal/OneSignal.h"` in your application files to access OneSignal's methods.
### Setting up the SDK ###
Follow the documentation from http://documentation.gamethrive.com/v1.0/docs/installing-the-gamethrive-ios-sdk to setup with your game.
*/
@interface OneSignal : NSObject
@property(nonatomic, readonly, copy) NSString* app_id;
extern NSString* const ONESIGNAL_VERSION;
typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE
};
///--------------------
/// @name Initialize
///--------------------
/**
Initialize OneSignal. Sends push token to OneSignal so you can later send notifications.
*/
- (id)initWithLaunchOptions:(NSDictionary*)launchOptions;
- (id)initWithLaunchOptions:(NSDictionary*)launchOptions autoRegister:(BOOL)autoRegister;
- (id)initWithLaunchOptions:(NSDictionary*)launchOptions handleNotification:(OneSignalHandleNotificationBlock)callback;
- (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotification:(OneSignalHandleNotificationBlock)callback;
- (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotification:(OneSignalHandleNotificationBlock)callback autoRegister:(BOOL)autoRegister;
// Only use if you passed FALSE to autoRegister
- (void)registerForPushNotifications;
+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel;
+ (void)setDefaultClient:(OneSignal*)client;
+ (OneSignal*)defaultClient;
- (void)sendTag:(NSString*)key value:(NSString*)value onSuccess:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
- (void)sendTag:(NSString*)key value:(NSString*)value;
- (void)sendTags:(NSDictionary*)keyValuePair onSuccess:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
- (void)sendTags:(NSDictionary*)keyValuePair;
- (void)sendTagsWithJsonString:(NSString*)jsonString;
- (void)getTags:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
- (void)getTags:(OneSignalResultSuccessBlock)successBlock;
- (void)deleteTag:(NSString*)key onSuccess:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
- (void)deleteTag:(NSString*)key;
- (void)deleteTags:(NSArray*)keys onSuccess:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
- (void)deleteTags:(NSArray*)keys;
- (void)deleteTagsWithJsonString:(NSString*)jsonString;
- (void)IdsAvailable:(OneSignalIdsAvailableBlock)idsAvailableBlock;
- (void)enableInAppAlertNotification:(BOOL)enable;
- (void)setSubscription:(BOOL)enable;
- (void)postNotification:(NSDictionary*)jsonData;
- (void)postNotification:(NSDictionary*)jsonData onSuccess:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
- (void)postNotificationWithJsonString:(NSString*)jsonData onSuccess:(OneSignalResultSuccessBlock)successBlock onFailure:(OneSignalFailureBlock)failureBlock;
@end
|
/*
* arch/arm/include/asm/hardware/gic.h
*
* Copyright (C) 2002 ARM Limited, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_ARM_HARDWARE_GIC_H
#define __ASM_ARM_HARDWARE_GIC_H
#include <linux/compiler.h>
#define GIC_CPU_CTRL 0x00
#define GIC_CPU_PRIMASK 0x04
#define GIC_CPU_BINPOINT 0x08
#define GIC_CPU_INTACK 0x0c
#define GIC_CPU_EOI 0x10
#define GIC_CPU_RUNNINGPRI 0x14
#define GIC_CPU_HIGHPRI 0x18
#define GIC_DIST_CTRL 0x000
#define GIC_DIST_CTR 0x004
#define GIC_DIST_ENABLE_SET 0x100
#define GIC_DIST_ENABLE_CLEAR 0x180
#define GIC_DIST_PENDING_SET 0x200
#define GIC_DIST_PENDING_CLEAR 0x280
#define GIC_DIST_ACTIVE_BIT 0x300
#define GIC_DIST_PRI 0x400
#define GIC_DIST_TARGET 0x800
#define GIC_DIST_CONFIG 0xc00
#define GIC_DIST_SOFTINT 0xf00
#ifndef __ASSEMBLY__
extern void __iomem *gic_cpu_base_addr;
extern struct irq_chip gic_arch_extn;
void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
void gic_secondary_init(unsigned int);
void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
void gic_enable_ppi(unsigned int);
struct gic_chip_data {
unsigned int irq_offset;
void __iomem *dist_base;
void __iomem *cpu_base;
#ifdef CONFIG_CPU_PM
u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
u32 __percpu *saved_ppi_enable;
u32 __percpu *saved_ppi_conf;
#endif
unsigned int gic_irqs;
};
#endif
#endif
|
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(prd,PRD)
#else
#ifndef LMP_PRD_H
#define LMP_PRD_H
#include "pointers.h"
namespace LAMMPS_NS {
class PRD : protected Pointers {
public:
PRD(class LAMMPS *);
~PRD() {}
void command(int, char **);
private:
int me,nprocs;
int nsteps,t_event,n_dephase,t_dephase,t_corr;
double etol,ftol,temp_dephase;
int maxiter,maxeval,temp_flag;
char *loop_setting,*dist_setting;
int equal_size_replicas,natoms;
int neigh_every,neigh_delay,neigh_dist_check;
int quench_reneighbor;
bigint nbuild,ndanger;
double time_dephase,time_dynamics,time_quench,time_comm,time_output;
double time_start;
MPI_Comm comm_replica;
int *tagall,*displacements,*imageall;
double **xall;
int ncoincident;
class RanPark *random_select;
class RanMars *random_dephase;
class Compute *compute_event;
class FixEventPRD *fix_event;
class Velocity *velocity;
class Compute *temperature;
class Finish *finish;
void dephase();
void dynamics();
void quench();
int check_event(int replica = -1);
void share_event(int, int);
void log_event();
void replicate(int);
void options(int, char **);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: PRD command before simulation box is defined
The prd command cannot be used before a read_data,
read_restart, or create_box command.
E: Cannot use PRD with multi-processor replicas unless atom map exists
Use the atom_modify command to create an atom map.
W: Running PRD with only one replica
This is allowed, but you will get no parallel speed-up.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Invalid t_event in prd command
Self-explanatory.
E: PRD nsteps must be multiple of t_event
Self-explanatory.
E: PRD t_corr must be multiple of t_event
Self-explanatory.
E: Could not find compute ID for PRD
Self-explanatory.
W: Resetting reneighboring criteria during PRD
A PRD simulation requires that neigh_modify settings be delay = 0,
every = 1, check = yes. Since these settings were not in place,
LAMMPS changed them and will restore them to their original values
after the PRD simulation.
E: Too many timesteps
The cummulative timesteps must fit in a 64-bit integer.
E: Cannot use PRD with a time-dependent fix defined
PRD alters the timestep in ways that will mess up these fixes.
E: Cannot use PRD with a time-dependent region defined
PRD alters the timestep in ways that will mess up these regions.
E: Cannot use PRD with atom_modify sort enabled
This is a current restriction of PRD. You must turn off sorting,
which is enabled by default, via the atom_modify command.
E: Too many iterations
You must use a number of iterations that fit in a 32-bit integer
for minimization.
*/
|
#pragma once
#include "Screen.h"
class InGamePlayScreen : public Screen {
public:
InGamePlayScreen();
virtual ~InGamePlayScreen();
virtual void tick();
virtual void handleDirection(DirectionId, float, float);
virtual bool renderGameBehind() const;
virtual bool isModal() const;
virtual bool isShowingMenu() const;
virtual bool shouldStealMouse() const;
virtual void render(int, int, float);
};
|
/****************************************************************************
**
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
**
** This file is part of the Edyuk project <http://edyuk.org>
**
** This file may be used under the terms of the GNU General Public License
** version 3 as published by the Free Software Foundation and appearing in the
** file GPL.txt included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef _QGOTO_LINE__DIALOG_H_
#define _QGOTO_LINE__DIALOG_H_
#include "qce-config.h"
/*!
\file qgotodialog.h
\brief Definition of the QGotoLineDialog class
\see QGotoLineDialog
*/
#include "ui_gotolinedialog.h"
#include <QDialog>
class QEditor;
class QCE_EXPORT QGotoLineDialog : public QDialog, private Ui::GotoDialog
{
Q_OBJECT
public:
QGotoLineDialog(QWidget *w = 0);
public slots:
void exec(QEditor *e);
};
#endif // _QGOTO_LINE__DIALOG_H_
|
/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. 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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/* support for Services */
#include <service_versions.h>
struct st_service_ref {
const char *name;
uint version;
void *service;
};
static struct my_snprintf_service_st my_snprintf_handler = {
my_snprintf,
my_vsnprintf
};
static struct thd_alloc_service_st thd_alloc_handler= {
thd_alloc,
thd_calloc,
thd_strdup,
thd_strmake,
thd_memdup,
thd_make_lex_string
};
static struct thd_wait_service_st thd_wait_handler= {
thd_wait_begin,
thd_wait_end
};
static struct my_thread_scheduler_service my_thread_scheduler_handler= {
my_connection_handler_set,
my_connection_handler_reset
};
static struct my_plugin_log_service my_plugin_log_handler= {
my_plugin_log_message
};
static struct mysql_string_service_st mysql_string_handler= {
mysql_string_convert_to_char_ptr,
mysql_string_get_iterator,
mysql_string_iterator_next,
mysql_string_iterator_isupper,
mysql_string_iterator_islower,
mysql_string_iterator_isdigit,
mysql_string_to_lowercase,
mysql_string_free,
mysql_string_iterator_free,
};
static struct mysql_malloc_service_st mysql_malloc_handler=
{
my_malloc,
my_realloc,
my_free,
my_memdup,
my_strdup,
my_strndup
};
static struct st_service_ref list_of_services[]=
{
{ "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
{ "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler },
{ "thd_wait_service", VERSION_thd_wait, &thd_wait_handler },
{ "my_thread_scheduler_service",
VERSION_my_thread_scheduler, &my_thread_scheduler_handler },
{ "my_plugin_log_service", VERSION_my_plugin_log, &my_plugin_log_handler },
{ "mysql_string_service",
VERSION_mysql_string, &mysql_string_handler },
{ "mysql_malloc_service", VERSION_mysql_malloc, &mysql_malloc_handler }
};
|
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyright(C) 2004-2012 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* 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 (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
#ifndef __VCG_EXCEPTION_H
#define __VCG_EXCEPTION_H
namespace vcg
{
class MissingComponentException : public std::runtime_error
{
public:
MissingComponentException(const std::string &err):std::runtime_error(err)
{
std::cout << "Missing Component Exception -" << err << "- \n";
}
virtual const char *what() const throw ()
{
static char buf[128]="Missing Component";
return buf;
}
};
class MissingCompactnessException : public std::runtime_error
{
public:
MissingCompactnessException(const std::string &err):std::runtime_error(err)
{
std::cout << "Lack of Compactness Exception -" << err << "- \n";
}
virtual const char *what() const throw ()
{
static char buf[128]="Lack of Compactness";
return buf;
}
};
class MissingTriangularRequirementException : public std::runtime_error
{
public:
MissingTriangularRequirementException(const std::string &err):std::runtime_error(err)
{
std::cout << "Mesh has to be composed by triangle and not polygons -" << err << "- \n";
}
virtual const char *what() const throw ()
{
static char buf[128]="Mesh has to be composed by triangle and not polygons";
return buf;
}
};
}
#endif // EXCEPTION_H
|
/*
Copyright (C) 1997-2001 Id Software, 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 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 __linux__
#ifndef __FreeBSD__
#error You shouldnt be including this file on non-Linux platforms
#endif
#endif
#ifndef __GLW_LINUX_H__
#define __GLW_LINUX_H__
typedef struct
{
void *OpenGLLib; // instance of OpenGL library
FILE *log_fp;
} glwstate_t;
extern glwstate_t glw_state;
#endif
|
#include <srl.h>
#include "consumer_proto.h"
FUNC(cons_func)
{
srl_mwmr_t input = GET_ARG(input);
char buf[32];
srl_mwmr_read(input, buf, 32);
srl_log_printf(NONE, "Consumer : %s\n\n", buf);
}
|
/*
* Copyright (c) 2004, Bull SA. All rights reserved.
* Created by: Laurent.Vivier@bull.net
* 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.
*/
/*
* assertion:
*
* aio_write() shall fail or the error status of the operation shall be [EINVAL] if:
* aio_offset would be invalid, or aio_reqprio is not a valid value, or
* aio_nbytes is an invalid value.
*
* Testing invalid offset
*
* method:
*
* - setup an aiocb with an invalid aio_offset
* - call aio_write with this aiocb
* - check return code and errno
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <time.h>
#include <aio.h>
#include "posixtest.h"
#include "tempfile.h"
#define TNAME "aio_write/9-1.c"
int main(void)
{
char tmpfname[PATH_MAX];
#define BUF_SIZE 111
char buf[BUF_SIZE];
int fd;
struct aiocb aiocb;
struct timespec completion_wait_ts = {0, 10000000};
if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L)
return PTS_UNSUPPORTED;
PTS_GET_TMP_FILENAME(tmpfname, "pts_aio_write_9_1");
unlink(tmpfname);
fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
if (fd == -1) {
printf(TNAME " Error at open(): %s\n", strerror(errno));
exit(PTS_UNRESOLVED);
}
unlink(tmpfname);
memset(&aiocb, 0, sizeof(struct aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_offset = -1;
aiocb.aio_nbytes = BUF_SIZE;
if (aio_write(&aiocb) != -1) {
int err;
do {
nanosleep(&completion_wait_ts, NULL);
err = aio_error(&aiocb);
} while (err == EINPROGRESS);
int ret = aio_return(&aiocb);
if (ret != -1) {
printf(TNAME " bad aio_write return value\n");
close(fd);
exit(PTS_FAIL);
} else if (err != EINVAL) {
printf(TNAME " error code is not EINVAL %s\n",
strerror(errno));
close(fd);
exit(PTS_FAIL);
}
} else {
if (errno != EINVAL) {
printf(TNAME " errno is not EINVAL %s\n",
strerror(errno));
close(fd);
exit(PTS_FAIL);
}
}
close(fd);
printf("Test PASSED\n");
return PTS_PASS;
}
|
#include <linux/delay.h>
#include "../hdmi-cec.h"
#include "rk3288_hdmi.h"
#include "rk3288_hdmi_hw.h"
/* static wait_queue_head_t wait;*/
static int init = 1;
void rk3288_hdmi_cec_isr(struct hdmi_dev *hdmi_dev, char cec_int)
{
CECDBG("%s cec 0x%x\n", __func__, cec_int);
if (cec_int & m_EOM)
hdmi_cec_submit_work(EVENT_RX_FRAME, 0, NULL);
if (cec_int & m_DONE)
CECDBG("send frame success\n");
}
static int rk3288_hdmi_cec_readframe(struct hdmi *hdmi,
struct cec_framedata *frame)
{
struct hdmi_dev *hdmi_dev = hdmi->property->priv;
int i, count;
char *data = (char *)frame;
if (frame == NULL)
return -1;
count = hdmi_readl(hdmi_dev, CEC_RX_CNT);
CECDBG("%s count %d\n", __func__, count);
for (i = 0; i < count; i++) {
data[i] = hdmi_readl(hdmi_dev, CEC_RX_DATA0 + i);
CECDBG("%02x\n", data[i]);
}
hdmi_writel(hdmi_dev, CEC_LOCK, 0x0);
return 0;
}
void rk3288_hdmi_cec_setcecla(struct hdmi *hdmi, int ceclgaddr)
{
struct hdmi_dev *hdmi_dev = hdmi->property->priv;
short val;
if (ceclgaddr < 0 || ceclgaddr > 16)
return;
val = 1 << ceclgaddr;
hdmi_writel(hdmi_dev, CEC_ADDR_L, val & 0xff);
hdmi_writel(hdmi_dev, CEC_ADDR_H, val>>8);
}
static int rk3288_hdmi_cec_sendframe(struct hdmi *hdmi,
struct cec_framedata *frame)
{
struct hdmi_dev *hdmi_dev = hdmi->property->priv;
int i, interrupt;
int reTryCnt = 0;
int PingRetry = 0, PingFlg = 0;
CECDBG("TX srcDestAddr %02x opcode %02x ",
frame->srcDestAddr, frame->opcode);
if (frame->argCount) {
CECDBG("args:");
for (i = 0; i < frame->argCount; i++)
CECDBG("%02x ", frame->args[i]);
}
CECDBG("\n");
while(reTryCnt < 3) {
if(reTryCnt) {
hdmi_msk_reg(hdmi_dev, CEC_CTRL, m_CEC_FRAME_TYPE, v_CEC_FRAME_TYPE(0));
}
CECDBG("reTryCnt: %d\n", reTryCnt);
if ((frame->srcDestAddr & 0x0f) == ((frame->srcDestAddr >> 4) & 0x0f)) {
/*it is a ping command*/
PingFlg = 1;
if(PingRetry >= 3)
{
break;
}
CECDBG("PingRetry: %d\n", PingRetry);
hdmi_writel(hdmi_dev, CEC_TX_DATA0, frame->srcDestAddr);
hdmi_writel(hdmi_dev, CEC_TX_CNT, 1);
} else {
hdmi_writel(hdmi_dev, CEC_TX_DATA0, frame->srcDestAddr);
hdmi_writel(hdmi_dev, CEC_TX_DATA0 + 1, frame->opcode);
for (i = 0; i < frame->argCount; i++)
hdmi_writel(hdmi_dev,
CEC_TX_DATA0 + 2 + i, frame->args[i]);
hdmi_writel(hdmi_dev, CEC_TX_CNT, frame->argCount + 2);
}
/*Start TX*/
hdmi_msk_reg(hdmi_dev, CEC_CTRL, m_CEC_SEND, v_CEC_SEND(1));
i = 60;
while (i--) {
udelay(2000);
interrupt = hdmi_readl(hdmi_dev, IH_CEC_STAT0);
if (interrupt & (m_ERR_INITIATOR | m_ARB_LOST |
m_NACK | m_DONE)) {
hdmi_writel(hdmi_dev, IH_CEC_STAT0,
interrupt & (m_ERR_INITIATOR |
m_ARB_LOST | m_NACK | m_DONE));
break;
}
}
if((interrupt & m_DONE)) {
if(reTryCnt > 1) {
hdmi_msk_reg(hdmi_dev, CEC_CTRL, m_CEC_FRAME_TYPE, v_CEC_FRAME_TYPE(2));
}
break;
}
else {
reTryCnt ++;
}
if(PingFlg == 1) {
if(!(interrupt & (m_DONE | m_NACK))) {/*not DONE, not NACK, retry ping action*/
PingRetry ++;
}
else { /*got ack or nonack, finish ping retry action*/
if(reTryCnt > 1) {
hdmi_msk_reg(hdmi_dev, CEC_CTRL, m_CEC_FRAME_TYPE, v_CEC_FRAME_TYPE(2));
}
break;
}
}
}
if(reTryCnt >= 3) {
CECDBG("send cec frame retry timeout !\n");
}
if(PingRetry >= 3) {
CECDBG("send cec frame pingretry timeout !\n");
}
CECDBG("%s interrupt 0x%02x\n", __func__, interrupt);
if (interrupt & m_DONE)
return 0;
else if (interrupt & m_NACK)
return 1;
else
return -1;
}
void rk3288_hdmi_cec_init(struct hdmi *hdmi)
{
struct hdmi_dev *hdmi_dev = hdmi->property->priv;
if (!hdmi->cecenable) {
hdmi_writel(hdmi_dev, CEC_MASK, 0x7f);
return;
}
if ( init) {
hdmi_cec_init(hdmi, rk3288_hdmi_cec_sendframe,
rk3288_hdmi_cec_readframe,
rk3288_hdmi_cec_setcecla);
init = 0;
/* init_waitqueue_head(&wait); */
}
hdmi_writel(hdmi_dev, CEC_MASK, 0x00);
hdmi_writel(hdmi_dev, IH_MUTE_CEC_STAT0, m_ERR_INITIATOR |
m_ARB_LOST | m_NACK | m_DONE);
CECDBG("%s", __func__);
}
|
/*
* BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
*
* $Copyright Open Broadcom Corporation$
*
* $Id: sbsdram.h,v 13.18 2006-03-29 02:14:24 csm Exp $
*/
#ifndef _SBSDRAM_H
#define _SBSDRAM_H
#ifndef _LANGUAGE_ASSEMBLY
/* Sonics side: SDRAM core registers */
typedef volatile struct sbsdramregs {
uint32 initcontrol; /* Generates external SDRAM initialization sequence */
uint32 config; /* Initializes external SDRAM mode register */
uint32 refresh; /* Controls external SDRAM refresh rate */
uint32 pad1;
uint32 pad2;
} sbsdramregs_t;
#endif /* !_LANGUAGE_ASSEMBLY */
/* SDRAM initialization control (initcontrol) register bits */
#define SDRAM_CBR 0x0001 /* Writing 1 generates refresh cycle and toggles bit */
#define SDRAM_PRE 0x0002 /* Writing 1 generates precharge cycle and toggles bit */
#define SDRAM_MRS 0x0004 /* Writing 1 generates mode register select cycle and toggles bit */
#define SDRAM_EN 0x0008 /* When set, enables access to SDRAM */
#define SDRAM_16Mb 0x0000 /* Use 16 Megabit SDRAM */
#define SDRAM_64Mb 0x0010 /* Use 64 Megabit SDRAM */
#define SDRAM_128Mb 0x0020 /* Use 128 Megabit SDRAM */
#define SDRAM_RSVMb 0x0030 /* Use special SDRAM */
#define SDRAM_RST 0x0080 /* Writing 1 causes soft reset of controller */
#define SDRAM_SELFREF 0x0100 /* Writing 1 enables self refresh mode */
#define SDRAM_PWRDOWN 0x0200 /* Writing 1 causes controller to power down */
#define SDRAM_32BIT 0x0400 /* When set, indicates 32 bit SDRAM interface */
#define SDRAM_9BITCOL 0x0800 /* When set, indicates 9 bit column */
/* SDRAM configuration (config) register bits */
#define SDRAM_BURSTFULL 0x0000 /* Use full page bursts */
#define SDRAM_BURST8 0x0001 /* Use burst of 8 */
#define SDRAM_BURST4 0x0002 /* Use burst of 4 */
#define SDRAM_BURST2 0x0003 /* Use burst of 2 */
#define SDRAM_CAS3 0x0000 /* Use CAS latency of 3 */
#define SDRAM_CAS2 0x0004 /* Use CAS latency of 2 */
/* SDRAM refresh control (refresh) register bits */
#define SDRAM_REF(p) (((p)&0xff) | SDRAM_REF_EN) /* Refresh period */
#define SDRAM_REF_EN 0x8000 /* Writing 1 enables periodic refresh */
/* SDRAM Core default Init values (OCP ID 0x803) */
#define SDRAM_INIT MEM4MX16X2
#define SDRAM_CONFIG SDRAM_BURSTFULL
#define SDRAM_REFRESH SDRAM_REF(0x40)
#define MEM1MX16 0x009 /* 2 MB */
#define MEM1MX16X2 0x409 /* 4 MB */
#define MEM2MX8X2 0x809 /* 4 MB */
#define MEM2MX8X4 0xc09 /* 8 MB */
#define MEM2MX32 0x439 /* 8 MB */
#define MEM4MX16 0x019 /* 8 MB */
#define MEM4MX16X2 0x419 /* 16 MB */
#define MEM8MX8X2 0x819 /* 16 MB */
#define MEM8MX16 0x829 /* 16 MB */
#define MEM4MX32 0x429 /* 16 MB */
#define MEM8MX8X4 0xc19 /* 32 MB */
#define MEM8MX16X2 0xc29 /* 32 MB */
#endif /* _SBSDRAM_H */
|
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmLocalVisualStudio6Generator_h
#define cmLocalVisualStudio6Generator_h
#include "cmLocalVisualStudioGenerator.h"
class cmTarget;
class cmSourceFile;
class cmSourceGroup;
class cmCustomCommand;
/** \class cmLocalVisualStudio6Generator
* \brief Write a LocalUnix makefiles.
*
* cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
* member this->Makefile.
*/
class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
{
public:
///! Set cache only and recurse to false by default.
cmLocalVisualStudio6Generator();
virtual ~cmLocalVisualStudio6Generator();
virtual void AddHelperCommands();
/**
* Generate the makefile for this directory.
*/
virtual void Generate();
void OutputDSPFile();
enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
/**
* Specify the type of the build: static, dll, or executable.
*/
void SetBuildType(BuildType, const char* libName, cmTarget&);
virtual std::string GetTargetDirectory(cmTarget const& target) const;
void GetTargetObjectFileDirectories(cmTarget* target,
std::vector<std::string>&
dirs);
private:
std::string DSPHeaderTemplate;
std::string DSPFooterTemplate;
void CreateSingleDSP(const char *lname, cmTarget &tgt);
void WriteDSPFile(std::ostream& fout, const char *libName,
cmTarget &tgt);
void WriteDSPBeginGroup(std::ostream& fout,
const char* group,
const char* filter);
void WriteDSPEndGroup(std::ostream& fout);
void WriteDSPHeader(std::ostream& fout, const char *libName,
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
void WriteDSPFooter(std::ostream& fout);
void AddDSPBuildRule(cmTarget& tgt);
void WriteCustomRule(std::ostream& fout,
const char* source,
const cmCustomCommand& command,
const char* flags);
void AddUtilityCommandHack(cmTarget& target, int count,
std::vector<std::string>& depends,
const cmCustomCommand& origCommand);
void WriteGroup(const cmSourceGroup *sg, cmTarget& target,
std::ostream &fout, const char *libName);
class EventWriter;
friend class EventWriter;
cmsys::auto_ptr<cmCustomCommand>
MaybeCreateOutputDir(cmTarget& target, const char* config);
std::string CreateTargetRules(cmTarget &target,
const char* configName,
const char *libName);
void ComputeLinkOptions(cmTarget& target, const char* configName,
const std::string extraOptions,
std::string& options);
std::string IncludeOptions;
std::vector<std::string> Configurations;
std::string GetConfigName(std::string const& configuration) const;
// Special definition check for VS6.
virtual bool CheckDefinition(std::string const& define) const;
};
#endif
|
/*
Copyright (C) 2013 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
bool windows_opengl_init();
bool initContext(HWND hwnd, HGLRC *hRC);
|
/*****************************************************************************
* pce *
*****************************************************************************/
/*****************************************************************************
* File name: src/drivers/char/char-pty.c *
* Created: 2009-03-08 by Hampa Hug <hampa@hampa.ch> *
* Copyright: (C) 2009-2012 Hampa Hug <hampa@hampa.ch> *
*****************************************************************************/
/*****************************************************************************
* This program is free software. You can redistribute it and / or modify it *
* under the terms of the GNU General Public License version 2 as published *
* by the Free Software Foundation. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY, without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
* Public License for more details. *
*****************************************************************************/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <drivers/options.h>
#include <drivers/char/char.h>
#include <drivers/char/char-pty.h>
static
void chr_pty_close (char_drv_t *cdrv)
{
char_pty_t *drv;
drv = cdrv->ext;
if (drv->symlink != NULL) {
unlink (drv->symlink);
free (drv->symlink);
}
if (drv->ptsname != NULL) {
free (drv->ptsname);
}
if (drv->fd >= 0) {
close (drv->fd);
}
free (drv);
}
static
unsigned chr_pty_read (char_drv_t *cdrv, void *buf, unsigned cnt)
{
char_pty_t *drv;
ssize_t r;
drv = cdrv->ext;
if (drv->fd < 0) {
return (0);
}
#if UINT_MAX > SSIZE_MAX
if (cnt > SSIZE_MAX) {
cnt = SSIZE_MAX;
}
#endif
r = read (drv->fd, buf, cnt);
if (r <= 0) {
return (0);
}
return (r);
}
static
unsigned chr_pty_write (char_drv_t *cdrv, const void *buf, unsigned cnt)
{
char_pty_t *drv;
ssize_t r;
drv = cdrv->ext;
if (drv->fd < 0) {
return (cnt);
}
#if UINT_MAX > SSIZE_MAX
if (cnt > SSIZE_MAX) {
cnt = SSIZE_MAX;
}
#endif
r = write (drv->fd, buf, cnt);
if (r <= 0) {
return (0);
}
return (r);
}
static
int chr_pty_init_pt (char_pty_t *drv, int fd)
{
const char *pts;
if (grantpt (fd)) {
return (1);
}
if (unlockpt (fd)) {
return (1);
}
pts = ptsname (fd);
if (pts == NULL) {
return (1);
}
if (strlen (pts) > 255) {
return (1);
}
drv->ptsname = strdup (pts);
fprintf (stderr, "char-pty: %s\n", drv->ptsname);
return (0);
}
static
int chr_pty_set_nonblock (int fd)
{
long fl;
fl = fcntl (fd, F_GETFD);
if (fl == -1) {
return (1);
}
if (fcntl (fd, F_SETFL, fl | O_NONBLOCK) == -1) {
return (1);
}
return (0);
}
static
int chr_pty_disable_echo (int fd)
{
struct termios tio;
if (tcgetattr (fd, &tio)) {
return (1);
}
tio.c_iflag &= ~(IGNCR | ICRNL | INLCR);
tio.c_lflag &= ~(ECHO | ECHOE);
if (tcsetattr (fd, TCSANOW, &tio)) {
return (1);
}
tcflush (fd, TCIOFLUSH);
return (0);
}
static
int chr_pty_init (char_pty_t *drv, const char *name)
{
chr_init (&drv->cdrv, drv);
drv->cdrv.close = chr_pty_close;
drv->cdrv.read = chr_pty_read;
drv->cdrv.write = chr_pty_write;
drv->ptsname = NULL;
drv->symlink = drv_get_option (name, "symlink");
drv->fd = posix_openpt (O_RDWR | O_NOCTTY);
if (drv->fd < 0) {
return (1);
}
if (chr_pty_init_pt (drv, drv->fd)) {
return (1);
}
chr_pty_set_nonblock (drv->fd);
chr_pty_disable_echo (drv->fd);
if (drv->symlink != NULL) {
if (symlink (drv->ptsname, drv->symlink)) {
fprintf (stderr,
"*** error creating symlink %s -> %s\n",
drv->ptsname, drv->symlink
);
}
}
return (0);
}
char_drv_t *chr_pty_open (const char *name)
{
char_pty_t *drv;
drv = malloc (sizeof (char_pty_t));
if (drv == NULL) {
return (NULL);
}
if (chr_pty_init (drv, name)) {
chr_pty_close (&drv->cdrv);
return (NULL);
}
return (&drv->cdrv);
}
|
/*******************************************************************************
* This file is part of OpenWSN, the Open Wireless Sensor Network Platform.
*
* Copyright (C) 2005-2010 zhangwei(TongJi University)
*
* OpenWSN is a free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 or (at your option) any later version.
*
* OpenWSN 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.
*
* For non-opensource or commercial applications, please choose commercial license.
* Refer to OpenWSN site http://code.google.com/p/openwsn/ for more detail.
*
* For other questions, you can contact the author through email openwsn#gmail.com
* or the mailing address: Dr. Wei Zhang, Dept. of Control, Dianxin Hall, TongJi
* University, 4800 Caoan Road, Shanghai, China. Zip: 201804
*
******************************************************************************/
#ifndef _EEPROM_H_5783_
#define _EEPROM_H_5783_
/*******************************************************************************
* This module provides the interface to read/write e2prom.
*
* @attention
* - This module is firstly introduced on OpenWSN 2.0/3.5 hardware, which
* uses LPC2136/LPC2146 from Philips(now NXP).
* - The atmegal128 micro-controller used by the MicaZ and GAINZ node has 4KB E2PROM.
*
******************************************************************************/
#include "hal_foundation.h"
void eeprom_rawread( uint32 flashaddr, uint32 memaddr, uint32 size );
void eeprom_rawwrite( uint32 flashaddr, uint32 memaddr, uint32 size );
#endif
|
/*
* Copyright (C) 2012-2014 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained from Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* @file mali_sync.h
*
* Mali interface for Linux sync objects.
*/
#ifndef _MALI_SYNC_H_
#define _MALI_SYNC_H_
#if defined(CONFIG_SYNC)
#include <linux/seq_file.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
#include <linux/sync.h>
#else
#include <sync.h>
#endif
#include "mali_osk.h"
struct mali_sync_flag;
struct mali_timeline;
/**
* Create a sync timeline.
*
* @param name Name of the sync timeline.
* @return The new sync timeline if successful, NULL if not.
*/
struct sync_timeline *mali_sync_timeline_create(struct mali_timeline *timeline, const char *name);
/**
* Check if sync timeline belongs to Mali.
*
* @param sync_tl Sync timeline to check.
* @return MALI_TRUE if sync timeline belongs to Mali, MALI_FALSE if not.
*/
mali_bool mali_sync_timeline_is_ours(struct sync_timeline *sync_tl);
/**
* Creates a file descriptor representing the sync fence. Will release sync fence if allocation of
* file descriptor fails.
*
* @param sync_fence Sync fence.
* @return File descriptor representing sync fence if successful, or -1 if not.
*/
s32 mali_sync_fence_fd_alloc(struct sync_fence *sync_fence);
/**
* Merges two sync fences. Both input sync fences will be released.
*
* @param sync_fence1 First sync fence.
* @param sync_fence2 Second sync fence.
* @return New sync fence that is the result of the merger if successful, or NULL if not.
*/
struct sync_fence *mali_sync_fence_merge(struct sync_fence *sync_fence1, struct sync_fence *sync_fence2);
/**
* Create a sync fence that is already signaled.
*
* @param tl Sync timeline.
* @return New signaled sync fence if successful, NULL if not.
*/
struct sync_fence *mali_sync_timeline_create_signaled_fence(struct sync_timeline *sync_tl);
/**
* Create a sync flag.
*
* @param sync_tl Sync timeline.
* @param point Point on Mali timeline.
* @return New sync flag if successful, NULL if not.
*/
struct mali_sync_flag *mali_sync_flag_create(struct sync_timeline *sync_tl, u32 point);
/**
* Grab sync flag reference.
*
* @param flag Sync flag.
*/
void mali_sync_flag_get(struct mali_sync_flag *flag);
/**
* Release sync flag reference. If this was the last reference, the sync flag will be freed.
*
* @param flag Sync flag.
*/
void mali_sync_flag_put(struct mali_sync_flag *flag);
/**
* Signal sync flag. All sync fences created from this flag will be signaled.
*
* @param flag Sync flag to signal.
* @param error Negative error code, or 0 if no error.
*/
void mali_sync_flag_signal(struct mali_sync_flag *flag, int error);
/**
* Create a sync fence attached to given sync flag.
*
* @param flag Sync flag.
* @return New sync fence if successful, NULL if not.
*/
struct sync_fence *mali_sync_flag_create_fence(struct mali_sync_flag *flag);
#endif /* defined(CONFIG_SYNC) */
#endif /* _MALI_SYNC_H_ */
|
/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#pragma once
#include "vsfilter_config.h"
#include "../DSUtil/SharedInclude.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <afx.h>
#include <afxwin.h> // MFC core and standard components
#include "../../include/stdafx_common_dshow.h"
#include "../DSUtil/DSUtil.h"
#ifdef LINUX
#include <pmmintrin.h>
#else
#include<intrin.h>
#endif
#include "xy_logger.h"
|
// Copyright (C) 2009,2010,2011,2012 GlavSoft LLC.
// All rights reserved.
//
//-------------------------------------------------------------------------
// This file is part of the TightVNC software. Please visit our Web site:
//
// http://www.tightvnc.com/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//-------------------------------------------------------------------------
//
#ifndef _APPLET_PARAMETER_H_
#define _APPLET_PARAMETER_H_
#include "util/AnsiStringStorage.h"
class AppletParameter
{
public:
AppletParameter(const char *name, const char *value);
virtual ~AppletParameter();
// Returns formatted string for HTML output or NULL is arguments is not valid.
// Remark: string format is "<PARAM NAME="%s" VALUE="%s">".
const char *getFormattedString() const;
// Returns true if applet parameter is valid, false otherwise.
bool isValid() const;
protected:
// Returns true if str is valid, false otherwise.
bool isStringValid(const char *str) const;
protected:
AnsiStringStorage m_formattedString;
bool m_isValid;
};
#endif
|
//
// UIView+CustomFrame.h
// RMCalendar
//
// Created by 迟浩东 on 15/4/30.
// Copyright (c) 2015年 CHD. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (CustomFrame)
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGPoint origin;
@end
|
#include "nxlib.h"
int
XChangeWindowAttributes(Display * display, Window w, unsigned long valuemask,
XSetWindowAttributes * attributes)
{
debug_printf("XChangeWindowAttributes: valuemask 0x%X\n", valuemask);
if (valuemask & CWBackPixel)
XSetWindowBackground(display, w, attributes->background_pixel);
if (valuemask & CWBorderPixel)
XSetWindowBorder(display, w, attributes->border_pixel);
if (valuemask & CWEventMask)
XSelectInput(display, w, attributes->event_mask);
if (valuemask & CWOverrideRedirect) {
GR_WM_PROPERTIES props;
GrGetWMProperties(w, &props);
if (props.title)
free(props.title);
props.flags = GR_WM_FLAGS_PROPS;
if (attributes->override_redirect)
props.props |= GR_WM_PROPS_NODECORATE;
else props.props &= ~GR_WM_PROPS_NODECORATE;
GrSetWMProperties(w, &props);
}
// FIXME handle additional attributes
return 1;
}
int
XSetLineAttributes(Display * display, GC gc, unsigned int line_width,
int line_style, int cap_style, int join_style)
{
unsigned long ls;
switch (line_style) {
case LineOnOffDash:
case LineDoubleDash:
/*ls = GR_LINE_DOUBLE_DASH;*/ /* nyi*/
ls = GR_LINE_ONOFF_DASH;
break;
default:
ls = GR_LINE_SOLID;
break;
}
if (line_width > 1)
debug_printf("XSetLineAttributes: width %d\n", line_width);
if (join_style != JoinMiter)
debug_printf("XSetLineAttributes: We don't support join style yet\n");
GrSetGCLineAttributes(gc->gid, ls);
return 1;
}
|
/*
* Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef AWT_SCROLLPANE_H
#define AWT_SCROLLPANE_H
#include "awt_Canvas.h"
#include "java_awt_ScrollPane.h"
#include "java_awt_Insets.h"
#include "sun_awt_windows_WScrollPanePeer.h"
/************************************************************************
* AwtScrollPane class
*/
class AwtScrollPane : public AwtCanvas {
public:
/* java.awt.ScrollPane fields */
static jfieldID scrollbarDisplayPolicyID;
static jfieldID hAdjustableID;
static jfieldID vAdjustableID;
/* java.awt.ScrollPaneAdjustable fields */
static jfieldID unitIncrementID;
static jfieldID blockIncrementID;
/* sun.awt.windows.WScrollPanePeer methods */
static jmethodID postScrollEventID;
AwtScrollPane();
virtual LPCTSTR GetClassName();
static AwtScrollPane* Create(jobject self, jobject hParent);
void SetInsets(JNIEnv *env);
void RecalcSizes(int parentWidth, int parentHeight,
int childWidth, int childHeight);
virtual void Show(JNIEnv *env);
virtual void Reshape(int x, int y, int w, int h);
virtual void BeginValidate() {}
virtual void EndValidate() {}
/*
* Fix for bug 4046446
* Returns scroll position for the appropriate scrollbar.
*/
int GetScrollPos(int orient);
/*
* Windows message handler functions
*/
virtual MsgRouting WmNcHitTest(int x, int y, LRESULT& retVal);
virtual MsgRouting WmHScroll(UINT scrollCode, UINT pos, HWND hScrollBar);
virtual MsgRouting WmVScroll(UINT scrollCode, UINT pos, HWND hScrollBar);
virtual MsgRouting HandleEvent(MSG *msg, BOOL synthetic);
// some methods invoked on Toolkit thread
static jint _GetOffset(void *param);
static void _SetInsets(void *param);
static void _SetScrollPos(void *param);
static void _SetSpans(void *param);
#ifdef DEBUG
virtual void VerifyState(); /* verify target and peer are in sync. */
#endif
private:
void PostScrollEvent(int orient, int scrollCode, int pos);
void SetScrollInfo(int orient, int max, int page, BOOL disableNoScroll);
};
#endif /* AWT_SCROLLPANE_H */
|
#ifndef T4KB3_OTP_H
#define T4KB3_OTP_H
#include "msm_sensor.h"
extern uint16_t t4kb3_af_macro_value;
extern uint16_t t4kb3_af_inifity_value;
extern uint16_t t4kb3_af_otp_status;
void t4kb3_update_otp_para(struct msm_sensor_ctrl_t *s_ctrl);
#endif
|
/*
** my_strlowcase.c for corewar in /home/pirou_g/corewar/lib_src
**
** Made by Guillaume Pirou
** Login <pirou_g@epitech.net>
**
** Started on Sun Apr 12 17:19:05 2015 Guillaume Pirou
** Last update Sun Apr 12 17:19:05 2015 Guillaume Pirou
*/
#include <stdlib.h>
char *my_strlowcase(char *str)
{
int lp;
if (str == NULL)
return (NULL);
lp = 0;
while (str[lp] != '\0')
{
if (str[lp] >= 65 && str[lp] <= 90)
str[lp] += 32;
++lp;
}
return (str);
}
|
/*
* Copyright (c) 2007 Cyrille Berger <cberger@cberger.net>
*
* 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; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KOCOMPOSITEOPOVERLAY_H_
#define _KOCOMPOSITEOPOVERLAY_H_
#include "KoCompositeOpAlphaBase.h"
/**
* A template version of the burn composite operation to use in colorspaces.
*/
template<class _CSTraits>
class KoCompositeOpOverlay : public KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpOverlay<_CSTraits>, true >
{
typedef typename _CSTraits::channels_type channels_type;
typedef typename KoColorSpaceMathsTraits<typename _CSTraits::channels_type>::compositetype compositetype;
public:
KoCompositeOpOverlay(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpOverlay<_CSTraits>, true >(cs, COMPOSITE_OVERLAY, i18n("Overlay"), KoCompositeOp::categoryArithmetic()) {
}
public:
inline static channels_type selectAlpha(channels_type srcAlpha, channels_type dstAlpha) {
return qMin(srcAlpha, dstAlpha);
}
inline static void composeColorChannels(channels_type srcBlend,
const channels_type* src,
channels_type* dst,
bool allChannelFlags,
const QBitArray & channelFlags) {
for (uint channel = 0; channel < _CSTraits::channels_nb; channel++) {
if ((int)channel != _CSTraits::alpha_pos && (allChannelFlags || channelFlags.testBit(channel))) {
compositetype srcColor = src[channel];
compositetype dstColor = dst[channel];
// srcColor = UINT8_MULT(dstColor, dstColor + UINT8_MULT(2 * srcColor, UINT8_MAX - dstColor));
// KoColorSpaceMaths<channels_type>::multiply
srcColor = KoColorSpaceMaths<channels_type>::multiply(dstColor, dstColor + KoColorSpaceMaths<channels_type>::multiply(2 * srcColor, NATIVE_MAX_VALUE - dstColor));
channels_type newColor = KoColorSpaceMaths<channels_type>::blend(srcColor, dstColor, srcBlend);
dst[channel] = newColor;
}
}
}
};
#endif
|
/*
* Register all the grabbing devices.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "avdevice.h"
#define REGISTER_OUTDEV(X,x) { \
extern AVOutputFormat ff_##x##_muxer; \
if(CONFIG_##X##_OUTDEV) av_register_output_format(&ff_##x##_muxer); }
#define REGISTER_INDEV(X,x) { \
extern AVInputFormat ff_##x##_demuxer; \
if(CONFIG_##X##_INDEV) av_register_input_format(&ff_##x##_demuxer); }
#define REGISTER_INOUTDEV(X,x) REGISTER_OUTDEV(X,x); REGISTER_INDEV(X,x)
void avdevice_register_all(void)
{
static int initialized;
if (initialized)
return;
initialized = 1;
/* devices */
REGISTER_INOUTDEV (ALSA, alsa);
REGISTER_INDEV (BKTR, bktr);
REGISTER_INDEV (DSHOW, dshow);
REGISTER_INDEV (DV1394, dv1394);
REGISTER_INDEV (FBDEV, fbdev);
REGISTER_INDEV (JACK, jack);
REGISTER_INDEV (LAVFI, lavfi);
REGISTER_INDEV (OPENAL, openal);
REGISTER_INOUTDEV (OSS, oss);
REGISTER_INDEV (PULSE, pulse);
REGISTER_OUTDEV (SDL, sdl);
REGISTER_INOUTDEV (SNDIO, sndio);
REGISTER_INDEV (V4L2, v4l2);
#if FF_API_V4L
REGISTER_INDEV (V4L, v4l);
#endif
REGISTER_INDEV (VFWCAP, vfwcap);
REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device);
/* external libraries */
REGISTER_INDEV (LIBCDIO, libcdio);
REGISTER_INDEV (LIBDC1394, libdc1394);
}
|
// Debugging support implementation -*- C++ -*-
// Copyright (C) 2003, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _GLIBCXX_DEBUG_DEBUG_H
#define _GLIBCXX_DEBUG_DEBUG_H 1
/** Macros used by the implementation outside of debug wrappers to
* verify certain properties. The __glibcxx_requires_xxx macros are
* merely wrappers around the __glibcxx_check_xxx wrappers when we
* are compiling with debug mode, but disappear when we are in
* release mode so that there is no checking performed in, e.g., the
* standard library algorithms.
*/
#ifdef _GLIBCXX_DEBUG
# include <debug/macros.h>
# include <cstdlib>
# include <cstdio>
// Avoid the use of assert, because we're trying to keep the <cassert>
// include out of the mix.
namespace __gnu_debug
{
inline void
__replacement_assert(const char* __file, int __line, const char* __function,
const char* __condition)
{
std::printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
__function, __condition);
std::abort();
}
}
#define _GLIBCXX_DEBUG_ASSERT(_Condition) \
do { \
if (! (_Condition)) \
::__gnu_debug::__replacement_assert(__FILE__, __LINE__, \
__PRETTY_FUNCTION__, \
#_Condition); \
} while (false)
# ifdef _GLIBCXX_DEBUG_PEDANTIC
# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition)
# else
# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
# endif
# define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg)
# define __glibcxx_requires_valid_range(_First,_Last) \
__glibcxx_check_valid_range(_First,_Last)
# define __glibcxx_requires_sorted(_First,_Last) \
__glibcxx_check_sorted(_First,_Last)
# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) \
__glibcxx_check_sorted_pred(_First,_Last,_Pred)
# define __glibcxx_requires_partitioned(_First,_Last,_Value) \
__glibcxx_check_partitioned(_First,_Last,_Value)
# define __glibcxx_requires_partitioned_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_partitioned_pred(_First,_Last,_Value,_Pred)
# define __glibcxx_requires_heap(_First,_Last) \
__glibcxx_check_heap(_First,_Last)
# define __glibcxx_requires_heap_pred(_First,_Last,_Pred) \
__glibcxx_check_heap_pred(_First,_Last,_Pred)
# define __glibcxx_requires_nonempty() __glibcxx_check_nonempty()
# define __glibcxx_requires_string(_String) __glibcxx_check_string(_String)
# define __glibcxx_requires_string_len(_String,_Len) \
__glibcxx_check_string_len(_String,_Len)
# define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N)
# include <debug/functions.h>
# include <debug/formatter.h>
#else
# define _GLIBCXX_DEBUG_ASSERT(_Condition)
# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
# define __glibcxx_requires_cond(_Cond,_Msg)
# define __glibcxx_requires_valid_range(_First,_Last)
# define __glibcxx_requires_sorted(_First,_Last)
# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred)
# define __glibcxx_requires_partitioned(_First,_Last,_Value)
# define __glibcxx_requires_partitioned_pred(_First,_Last,_Value,_Pred)
# define __glibcxx_requires_heap(_First,_Last)
# define __glibcxx_requires_heap_pred(_First,_Last,_Pred)
# define __glibcxx_requires_nonempty()
# define __glibcxx_requires_string(_String)
# define __glibcxx_requires_string_len(_String,_Len)
# define __glibcxx_requires_subscript(_N)
#endif
#endif
|
#ifndef COMMON_REG_H
#define COMMON_REG_H
#include <iostream>
#include <cstdlib>
#include "MarSystemManager.h"
#include "Collection.h"
#include "FileName.h"
#define CLOSE_ENOUGH 0.0001
using namespace std;
using namespace Marsyas;
static MarSystemManager mng;
// really useful global functions
mrs_real addSource(MarSystem* net, string infile);
void addDest(MarSystem* net, string outfile);
#endif
|
/* packet-osi.h
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _PACKET_OSI_H
#define _PACKET_OSI_H
#include <epan/osi-utils.h>
#define PDU_TYPE_ESIS_ESH 100
#define PDU_TYPE_ESIS_ISH 101
#define PDU_TYPE_ESIS_RD 102
#define PDU_TYPE_ISIS_L1_HELLO 201
#define PDU_TYPE_ISIS_L2_HELLO 202
#define PDU_TYPE_ISIS_PTP_HELLO 203
#define PDU_TYPE_ISIS_L1_CSNP 204
#define PDU_TYPE_ISIS_L1_PSNP 205
#define PDU_TYPE_ISIS_L2_CSNP 206
#define PDU_TYPE_ISIS_L2_PSNP 207
#define PROTO_STRING_ISIS "ISO 10589 ISIS InTRA Domain Routeing Information Exchange Protocol"
#define PROTO_STRING_IDRP "ISO 10747 IDRP InTER Domain Routeing Information Exchange Protocol"
#define PROTO_STRING_ESIS "ISO 9542 ESIS Routeing Information Exchange Protocol"
#define PROTO_STRING_CLNP "ISO 8473 CLNP ConnectionLess Network Protocol"
#define PROTO_STRING_COTP "ISO 8073 COTP Connection-Oriented Transport Protocol"
#define PROTO_STRING_CLTP "ISO 8602 CLTP ConnectionLess Transport Protocol"
#define PROTO_STRING_LSP "ISO 10589 ISIS Link State Protocol Data Unit"
#define PROTO_STRING_CSNP "ISO 10589 ISIS Complete Sequence Numbers Protocol Data Unit"
#define PROTO_STRING_PSNP "ISO 10589 ISIS Partial Sequence Numbers Protocol Data Unit"
#define OSI_PDU_TYPE_MASK 0x1f
#define BIS_PDU_TYPE MASK 0xff
#define BIT_1 0x01
#define BIT_2 0x02
#define BIT_3 0x04
#define BIT_4 0x08
#define BIT_5 0x10
#define BIT_6 0x20
#define BIT_7 0x40
#define BIT_8 0x80
#define BIT_9 0x0100
#define BIT_10 0x0200
#define BIT_11 0x0400
#define BIT_12 0x0800
#define BIT_13 0x1000
#define BIT_14 0x2000
#define BIT_15 0x4000
#define BIT_16 0x8000
/*
* published API functions
*/
typedef enum {
NO_CKSUM, /* checksum field is 0 */
DATA_MISSING, /* not all the data covered by the checksum was captured */
CKSUM_OK, /* checksum is OK */
CKSUM_NOT_OK /* checksum is not OK */
} cksum_status_t;
extern cksum_status_t calc_checksum(tvbuff_t *, int, guint, guint);
extern cksum_status_t check_and_get_checksum( tvbuff_t *, int, guint, guint, int, guint16*);
#endif /* _PACKET_OSI_H */
|
/*
* Copyright (c) 2003, Intel Corporation. All rights reserved.
* Created by: julie.n.fleischer 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.
*/
/*
* Will not test returning EACCESS when privileges are denied as POSIX does not
* define when this error occurs.
*/
#include <stdio.h>
#include "posixtest.h"
int main()
{
printf("Will not test returning EACCESS when privileges are denied\n");
printf("as POSIX does not define when this error occurs.\n");
return PTS_UNTESTED;
}
|
/* $Id: b1lli.h,v 1.1 2011/07/05 17:16:01 ian Exp $
*
* ISDN lowlevel-module for AVM B1-card.
*
* Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#ifndef _B1LLI_H_
#define _B1LLI_H_
/*
* struct for loading t4 file
*/
typedef struct avmb1_t4file {
int len;
unsigned char *data;
} avmb1_t4file;
typedef struct avmb1_loaddef {
int contr;
avmb1_t4file t4file;
} avmb1_loaddef;
typedef struct avmb1_loadandconfigdef {
int contr;
avmb1_t4file t4file;
avmb1_t4file t4config;
} avmb1_loadandconfigdef;
typedef struct avmb1_resetdef {
int contr;
} avmb1_resetdef;
typedef struct avmb1_getdef {
int contr;
int cardtype;
int cardstate;
} avmb1_getdef;
/*
* struct for adding new cards
*/
typedef struct avmb1_carddef {
int port;
int irq;
} avmb1_carddef;
#define AVM_CARDTYPE_B1 0
#define AVM_CARDTYPE_T1 1
#define AVM_CARDTYPE_M1 2
#define AVM_CARDTYPE_M2 3
typedef struct avmb1_extcarddef {
int port;
int irq;
int cardtype;
int cardnr; /* for HEMA/T1 */
} avmb1_extcarddef;
#define AVMB1_LOAD 0 /* load image to card */
#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */
#define AVMB1_RESETCARD 2 /* reset a card */
#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
#define AVMB1_GET_CARDINFO 5 /* get cardtype */
#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */
#define AVMB1_REGISTERCARD_IS_OBSOLETE
#endif /* _B1LLI_H_ */
|
/*
* Copyright (C) 2012 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ISP_DRV_HEADER_
#define _ISP_DRV_HEADER_
#include <linux/semaphore.h>
#include <linux/spinlock_types.h>
#define ISP_QUEUE_LENGTH 16
#define ISP_BING4AWB_NUM 2
struct isp_node {
uint32_t irq_val0;
uint32_t irq_val1;
uint32_t irq_val2;
uint32_t irq_val3;
uint32_t reserved;
};
struct isp_queue {
struct isp_node node[ISP_QUEUE_LENGTH];
struct isp_node *write;
struct isp_node *read;
};
struct isp_b4awb_buf {
uint32_t buf_id;
uint32_t buf_flag;
unsigned long buf_phys_addr;
};
struct isp_k_private {
atomic_t users;
struct device_node *dn;
struct clk *clock;
struct semaphore device_lock;
struct semaphore ioctl_lock;
unsigned long block_buf_addr;
uint32_t block_buf_len;
unsigned long reg_buf_addr;
uint32_t reg_buf_len;
unsigned long lsc_buf_addr;
uint32_t lsc_buf_len;
uint32_t lsc_buf_order;
uint32_t lsc_load_buf_id;
uint32_t lsc_update_buf_id;
unsigned long raw_aem_buf_addr;
uint32_t raw_aem_buf_len;
uint32_t ct_load_buf_id;
unsigned long full_gamma_buf_addr;
uint32_t full_gamma_buf_len;
uint32_t full_gamma_buf_id;
unsigned long yuv_ygamma_buf_addr;
uint32_t yuv_ygamma_buf_len;
uint32_t yuv_ygamma_buf_id;
unsigned long raw_awbm_buf_addr;
uint32_t raw_awbm_buf_len;
unsigned long bing4awb_buf_addr;
uint32_t bing4awb_buf_len;
uint32_t bing4awb_buf_order;
struct isp_b4awb_buf b4awb_buf[ISP_BING4AWB_NUM];
uint32_t lsc_buf_phys_addr;
unsigned long yiq_antiflicker_buf_addr;
uint32_t yiq_antiflicker_len;
uint32_t yiq_antiflicker_order;
};
struct isp_drv_private {
spinlock_t isr_lock;
struct semaphore isr_done_lock;
struct isp_queue queue;
};
struct isp_k_file {
struct isp_k_private *isp_private;
struct isp_drv_private drv_private;
};
int32_t isp_get_int_num(struct isp_node *node);
void isp_clr_int(void);
void isp_en_irq(uint32_t irq_mode);
int32_t isp_axi_bus_waiting(void);
int32_t isp_capability(void *param);
int32_t isp_cfg_param(void *param, struct isp_k_private *isp_private);
#endif
|
/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation. You may not use, modify or
* distribute this program under any other version of the GNU General
* Public License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved.
* Copyright (C) 2012-2013 Sourcefire, Inc.
*
* Author: Michael Altizer <maltizer@sourcefire.com>
*
* Dynamic Side Channel Lib function declarations
*
*/
#ifndef _SF_DYNAMIC_SIDE_CHANNEL_H_
#define _SF_DYNAMIC_SIDE_CHANNEL_H_
#include <stdint.h>
#include "sf_dynamic_common.h"
#include "sf_dynamic_meta.h"
#include "sidechannel_define.h"
#define SIDE_CHANNEL_DATA_VERSION 1
typedef int (*RegisterRXHandler)(uint16_t type, SCMProcessMsgFunc processMsgFunc, void *data);
typedef int (*RegisterTXHandler)(uint16_t type, SCMProcessMsgFunc processMsgFunc, void *data);
typedef void (*UnregisterRXHandler)(uint16_t type, SCMProcessMsgFunc processMsgFunc);
typedef void (*UnregisterTXHandler)(uint16_t type, SCMProcessMsgFunc processMsgFunc);
typedef int (*PreallocMessageRX)(uint32_t length, SCMsgHdr **hdr, uint8_t **msg_ptr, void **msg_handle);
typedef int (*PreallocMessageTX)(uint32_t length, SCMsgHdr **hdr, uint8_t **msg_ptr, void **msg_handle);
typedef int (*DiscardMessageRX)(void *msg_handle);
typedef int (*DiscardMessageTX)(void *msg_handle);
typedef int (*EnqueueMessageRX)(SCMsgHdr *hdr, const uint8_t *msg, uint32_t length, void *msg_handle, SCMQMsgFreeFunc msgFreeFunc);
typedef int (*EnqueueMessageTX)(SCMsgHdr *hdr, const uint8_t *msg, uint32_t length, void *msg_handle, SCMQMsgFreeFunc msgFreeFunc);
typedef int (*EnqueueDataRX)(SCMsgHdr *hdr, uint8_t *msg, uint32_t length, SCMQMsgFreeFunc msgFreeFunc);
typedef int (*EnqueueDataTX)(SCMsgHdr *hdr, uint8_t *msg, uint32_t length, SCMQMsgFreeFunc msgFreeFunc);
typedef void (*RegisterModule)(const char *keyword, SCMFunctionBundle *funcs);
typedef sigset_t (*SnortSignalMask)(void);
typedef struct _DynamicSideChannelData
{
int version;
int size;
RegisterModule registerModule;
RegisterRXHandler registerRXHandler;
RegisterTXHandler registerTXHandler;
UnregisterRXHandler unregisterRXHandler;
UnregisterTXHandler unregisterTXHandler;
PreallocMessageRX allocMessageRX;
PreallocMessageTX allocMessageTX;
DiscardMessageRX discardMessageRX;
DiscardMessageRX discardMessageTX;
EnqueueMessageRX enqueueMessageRX;
EnqueueMessageTX enqueueMessageTX;
EnqueueDataRX enqueueDataRX;
EnqueueDataTX enqueueDataTX;
LogMsgFunc logMsg;
LogMsgFunc errMsg;
LogMsgFunc fatalMsg;
DebugMsgFunc debugMsg;
GetSnortInstance getSnortInstance;
SnortSignalMask snortSignalMask;
} DynamicSideChannelData;
/* Function prototypes for Dynamic Detection Plugins */
int LoadDynamicSideChannelLib(const char * const library_name, int indent);
void CloseDynamicSideChannelLibs(void);
void LoadAllDynamicSideChannelLibs(const char * const path);
void RemoveDuplicateSideChannelPlugins(void);
int InitDynamicSideChannelPlugins(void);
typedef int (*InitSideChannelLibFunc)(DynamicSideChannelData *dscd);
void *GetNextSideChannelPluginVersion(void *p);
DynamicPluginMeta *GetSideChannelPluginMetaData(void *p);
extern DynamicSideChannelData _dscd;
#endif /* _SF_DYNAMIC_SIDE_CHANNEL_H_ */
|
/*
* * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>,
* * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <rawstudio.h>
#include <gtk/gtk.h>
static void raw_mrw_walker(RAWFILE *rawfile, guint offset, RSMetadata *meta);
static void
raw_mrw_walker(RAWFILE *rawfile, guint offset, RSMetadata *meta)
{
guint rawstart=0;
guint tag=0, len=0;
gushort ushort_temp1=0;
meta->make = MAKE_MINOLTA;
raw_get_uint(rawfile, offset+4, &rawstart);
rawstart += 8;
offset += 8;
while(offset < rawstart)
{
raw_get_uint(rawfile, offset, &tag);
raw_get_uint(rawfile, offset+4, &len);
offset += 8;
switch (tag)
{
case 0x00545457: /* TTW */
rs_filetype_meta_load(".tiff", meta, rawfile, offset);
raw_reset_base(rawfile);
break;
case 0x00574247: /* WBG */
/* rggb format */
raw_get_ushort(rawfile, offset+4, &ushort_temp1);
meta->cam_mul[0] = (gdouble) ushort_temp1;
raw_get_ushort(rawfile, offset+6, &ushort_temp1);
meta->cam_mul[1] = (gdouble) ushort_temp1;
raw_get_ushort(rawfile, offset+8, &ushort_temp1);
meta->cam_mul[3] = (gdouble) ushort_temp1;
raw_get_ushort(rawfile, offset+10, &ushort_temp1);
meta->cam_mul[2] = (gdouble) ushort_temp1;
rs_metadata_normalize_wb(meta);
break;
}
offset += (len);
}
return;
}
static gboolean
mrw_load_meta(const gchar *service, RAWFILE *rawfile, guint offset, RSMetadata *meta)
{
GdkPixbuf *pixbuf=NULL, *pixbuf2=NULL;
guint start=0, length=0;
raw_mrw_walker(rawfile, offset, meta);
if ((meta->thumbnail_start>0) && (meta->thumbnail_length>0))
{
start = meta->thumbnail_start;
length = meta->thumbnail_length;
}
else if ((meta->preview_start>0) && (meta->preview_length>0))
{
start = meta->preview_start;
length = meta->preview_length;
}
if ((start>0) && (length>0))
{
guchar *thumbbuffer;
gdouble ratio;
GdkPixbufLoader *pl;
start++; /* stupid! */
length--;
thumbbuffer = g_malloc(length+1);
thumbbuffer[0] = '\xff';
raw_strcpy(rawfile, start, thumbbuffer+1, length);
pl = gdk_pixbuf_loader_new();
gdk_pixbuf_loader_write(pl, thumbbuffer, length+1, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf(pl);
gdk_pixbuf_loader_close(pl, NULL);
g_free(thumbbuffer);
if (pixbuf==NULL) return TRUE;
ratio = ((gdouble) gdk_pixbuf_get_width(pixbuf))/((gdouble) gdk_pixbuf_get_height(pixbuf));
if (ratio>1.0)
pixbuf2 = gdk_pixbuf_scale_simple(pixbuf, 128, (gint) (128.0/ratio), GDK_INTERP_BILINEAR);
else
pixbuf2 = gdk_pixbuf_scale_simple(pixbuf, (gint) (128.0*ratio), 128, GDK_INTERP_BILINEAR);
g_object_unref(pixbuf);
pixbuf = pixbuf2;
switch (meta->orientation)
{
/* this is very COUNTER-intuitive - gdk_pixbuf_rotate_simple() is wierd */
case 90:
pixbuf2 = gdk_pixbuf_rotate_simple(pixbuf, GDK_PIXBUF_ROTATE_CLOCKWISE);
g_object_unref(pixbuf);
pixbuf = pixbuf2;
break;
case 270:
pixbuf2 = gdk_pixbuf_rotate_simple(pixbuf, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
g_object_unref(pixbuf);
pixbuf = pixbuf2;
break;
}
meta->thumbnail = pixbuf;
}
return TRUE;
}
G_MODULE_EXPORT void
rs_plugin_load(RSPlugin *plugin)
{
rs_filetype_register_meta_loader(".mrw", "Minolta raw", mrw_load_meta, 10, RS_LOADER_FLAGS_RAW);
}
|
/// This plugin can read image formats that casacore supports.
#pragma once
#include "CartaLib/IPlugin.h"
#include <QObject>
#include <QString>
class CasaImageLoader : public QObject, public IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.cartaviewer.IPlugin")
Q_INTERFACES( IPlugin)
public:
CasaImageLoader(QObject *parent = 0);
virtual bool handleHook(BaseHook & hookData) override;
virtual std::vector<HookId> getInitialHookList() override;
virtual ~CasaImageLoader();
// void forgot_to_define_this();
private:
Carta::Lib::Image::ImageInterface::SharedPtr loadImage(const QString & fname);
};
|
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIESREGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
* LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
* ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
* of this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_cg_intprg.c
* Version : Code Generator for RX71M V1.00.02.02 [28 May 2015]
* Device(s) : R5F571MLCxFC
* Tool-Chain : CCRX
* Description : Setting of B.
* Creation Date: 20/09/2015
***********************************************************************************************************************/
/***********************************************************************************************************************
Pragma directive
***********************************************************************************************************************/
/* Start user code for pragma. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "r_cg_macrodriver.h"
#include <machine.h>
#include "r_cg_vect.h"
#include "r_cg_userdefine.h"
/***********************************************************************************************************************
Global variables and functions
***********************************************************************************************************************/
#pragma section IntPRG
/* Undefined exceptions for supervisor instruction, undefined instruction and floating point exceptions */
void r_undefined_exception(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* Reserved */
void r_reserved_exception(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* NMI */
void r_nmi_exception(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* BRK */
void r_brk_exception(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* ICU GROUPBE0 */
void r_icu_group_be0_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* ICU GROUPBL0 */
void r_icu_group_bl0_interrupt(void)
{
if (ICU.GRPBL0.BIT.IS14 == 1U)
{
r_sci7_transmitend_interrupt();
}
if (ICU.GRPBL0.BIT.IS15 == 1U)
{
r_sci7_receiveerror_interrupt();
}
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* ICU GROUPBL1 */
void r_icu_group_bl1_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* ICU GROUPAL0 */
void r_icu_group_al0_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* ICU GROUPAL1 */
void r_icu_group_al1_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* Start user code for adding. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
|
/*****************************************************************************
* Copyright (c) 2014 Ted John
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* This file is part of OpenRCT2.
*
* OpenRCT2 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 _RIDE_STATION_H_
#define _RIDE_STATION_H_
#include "../common.h"
#include "../world/map.h"
#include "ride.h"
void ride_update_station(rct_ride *ride, int stationIndex);
rct_map_element *ride_get_station_start_track_element(rct_ride *ride, int stationIndex);
rct_map_element *ride_get_station_exit_element(rct_ride *ride, int x, int y, int z);
#endif
|
/*
Filename : DVDWaitReady.bin
Date created: Wed Jul 27 23:28:54 2011
*/
#define DVDWaitReady_size 0x94
unsigned char DVDWaitReady[] = {
0x38, 0x00, 0x00, 0x00, 0x3C, 0xE0, 0x80, 0x00, 0x38, 0xE7, 0x2F, 0x20, 0x7C, 0x00, 0x38, 0xAC,
0x44, 0x00, 0x00, 0x02, 0x3C, 0xE0, 0x80, 0x00, 0x80, 0x07, 0x2F, 0x30, 0x90, 0x07, 0x2F, 0x2C,
0x70, 0x00, 0x00, 0x14, 0x2C, 0x00, 0x00, 0x00, 0x41, 0x82, 0x00, 0x2C, 0x3C, 0xA0, 0xCC, 0x00,
0x3C, 0x00, 0xAB, 0x00, 0x90, 0x05, 0x60, 0x08, 0x38, 0x00, 0x00, 0x2A, 0x90, 0x05, 0x60, 0x00,
0x38, 0x00, 0x00, 0x01, 0x90, 0x05, 0x60, 0x1C, 0x38, 0x00, 0x00, 0x00, 0x90, 0x07, 0x2F, 0x30,
0x48, 0x00, 0x00, 0x0C, 0x38, 0x00, 0x00, 0x17, 0x90, 0x07, 0x2F, 0x28, 0x80, 0x01, 0x00, 0x2C,
0x83, 0xE1, 0x00, 0x24, 0x83, 0xC1, 0x00, 0x20, 0x83, 0xA1, 0x00, 0x1C, 0x38, 0x21, 0x00, 0x28,
0x7C, 0x08, 0x03, 0xA6, 0x4E, 0x80, 0x00, 0x20, 0x80, 0x01, 0x00, 0x24, 0x83, 0xE1, 0x00, 0x1C,
0x83, 0xA1, 0x00, 0x14, 0x83, 0x81, 0x00, 0x10, 0x38, 0x21, 0x00, 0x20, 0x7C, 0x08, 0x03, 0xA6,
0x4E, 0x80, 0x00, 0x20
};
|
/*
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* 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 <QtCore/QtGlobal>
#if defined(UBUNTUGESTURESQML_LIBRARY)
# define UBUNTUGESTURESQML_EXPORT Q_DECL_EXPORT
#else
# define UBUNTUGESTURESQML_EXPORT Q_DECL_IMPORT
#endif
|
/*
Copyright (C) 2013 Erik Ogenvik
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef ADMINMOVEMENTADJUSTER_H_
#define ADMINMOVEMENTADJUSTER_H_
#include "OgreIncludes.h"
#include "framework/TimeFrame.h"
#include "framework/ConsoleCommandWrapper.h"
#include "framework/ConsoleObject.h"
#include <OgreVector3.h>
#include <sigc++/trackable.h>
namespace Eris
{
class View;
}
namespace Ember
{
namespace OgreView
{
namespace Camera
{
class MainCamera;
}
class MovementController;
/**
* @brief Warps the position of the avatar to match the camera.
*
* This is mainly of use when authoring and using the free flying mode.
* In fact, the class will check with MovementController if we indeed are in free flying mode, and if so adjust the position.
*
* Note that this can only be applied when logged in as an admin (since otherwise you won't have the ability to set the position of the avatar).
*/
class AvatarCameraWarper: public ConsoleObject, public virtual sigc::trackable
{
public:
/**
* @brief Ctor.
* @param movementController The main movement controller.
* @param camera The main camera.
* @param view The view of the world.
* @param movementThreshold Default threshold for movement. If the distance between the camera and the avatar is larger than this, the avatar is moved.
*/
AvatarCameraWarper(MovementController& movementController, const Camera::MainCamera& camera, Eris::View& view, float movementThreshold = 20.0f);
/**
* @brief Dtor.
*/
virtual ~AvatarCameraWarper();
/**
* @brief Sets whether the adjuster should be enabled or not.
* @param enabled
*/
void setEnabled(bool enabled);
void runCommand(const std::string& command, const std::string& args);
ConsoleCommandWrapper AvatarFollowsCamera;
private:
/**
* @brief The main movement controller.
*/
MovementController& mMovementController;
/**
* @brief The main camera.
*/
const Camera::MainCamera& mCamera;
/**
* @brief The view of the world.
*/
Eris::View& mView;
/**
* @brief Threshold for movement. If the distance between the camera and the avatar is larger than this, the avatar is moved.
*/
float mMovementThreshold;
/**
* @brief Keep track of the position of the camera when we last moved.
*
* This is used to determine if we should move the avatar again.
*/
Ogre::Vector3 mLastPosition;
/**
* @brief True if enabled.
*/
bool mEnabled;
void frameProcessed(const TimeFrame& timeFrame, unsigned int eventMask);
/**
* @brief Updated the position of the avatar.
* @param worldPosition The new position in the world.
*/
void updateAvatarPosition(const Ogre::Vector3& worldPosition);
};
}
}
#endif /* ADMINMOVEMENTADJUSTER_H_ */
|
/*
* Copyright (C) 2006-2010 - Frictional Games
*
* This file is part of Penumbra Overture.
*
* Penumbra Overture is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Penumbra Overture is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Penumbra Overture. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GAME_GAME_MESSAGE_HANDLER_H
#define GAME_GAME_MESSAGE_HANDLER_H
#include "StdAfx.h"
#include "GameTypes.h"
using namespace hpl;
class cInit;
class cGameMessageHandler;
class cGameMessage
{
public:
cGameMessage(const tWString &asText, cGameMessageHandler *apMessHandler);
void Update(float afTimeStep);
void Draw(iFontData *apFont);
bool mbActive;
tWString msText;
float mfFade;
float mfFadeAdd;
cGameMessageHandler *mpMessHandler;
};
typedef std::list<cGameMessage*> tGameMessageList;
typedef tGameMessageList::iterator tGameMessageListIt;
//---------------------------------------
class cGameMessageHandler : public iUpdateable
{
friend class cGameMessage;
public:
cGameMessageHandler(cInit *apInit);
~cGameMessageHandler();
void Add(const tWString& asText);
void ShowNext();
void Update(float afTimeStep);
void OnDraw();
void Reset();
void OnWorldLoad();
void OnWorldExit();
bool HasMessage(){ return !mlstMessages.empty();}
void SetOnMessagesOverCallback(const tString& asFunction);
void SetFocusIsedUsed(bool abX){mbFocusIsedUsed = abX;}
void SetBlackText(bool abX){ mbBlackText = abX;}
private:
cInit* mpInit;
iFontData *mpFont;
ePlayerState mLastState;
tString msOverCallback;
bool mbFocusIsedUsed;
bool mbBlackText;
tGameMessageList mlstMessages;
};
#endif // GAME_GAME_MESSAGE_HANDLER_H
|
/*
* callback routines for "user" splitting functions in causalTree
*/
#include <R.h>
#include <Rinternals.h>
/* don't include causalTree.h: it conflicts */
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(String) dgettext ("causalTree", String)
#else
#define _(String) (String)
#endif
static int ysave; /* number of columns of y */
static int rsave; /* the length of the returned "mean" from the
* user's eval routine */
static SEXP expr1; /* the evaluation expression for splits */
static SEXP expr2; /* the evaluation expression for values */
static SEXP rho;
static double *ydata; /* pointer to the data portion of yback */
static double *xdata; /* pointer to the data portion of xback */
static double *wdata; /* pointer to the data portion of wback */
static int *ndata; /* pointer to the data portion of nback */
/*
* The first routine saves the parameters, the location
* of the evaluation frame and the 2 expressions to be computed within it,
* and away the memory location of the 4 "callback" objects.
*/
SEXP
init_ctcallback(SEXP rhox, SEXP ny, SEXP nr, SEXP expr1x, SEXP expr2x)
{
SEXP stemp;
rho = rhox;
ysave = asInteger(ny);
rsave = asInteger(nr);
expr1 = expr1x;
expr2 = expr2x;
stemp = findVarInFrame(rho, install("yback"));
if (!stemp)
error(_("'yback' not found"));
ydata = REAL(stemp);
stemp = findVarInFrame(rho, install("wback"));
if (!stemp)
error(_("'wback' not found"));
wdata = REAL(stemp);
stemp = findVarInFrame(rho, install("xback"));
if (!stemp)
error(_("'xback' not found"));
xdata = REAL(stemp);
stemp = findVarInFrame(rho, install("nback"));
if (!stemp)
error(_("'nback' not found"));
ndata = INTEGER(stemp);
return R_NilValue;
}
/*
* This is called by the usersplit init function
* For the "hardcoded" user routines, this is a constant written into
* their init routine, but here we need to grab it from outside.
*/
void
causalTree_callback0(int *nr)
{
*nr = rsave;
}
/*
* This is called by the evaluation function
*/
void
causalTree_callback1(int n, double *y[], double *wt, double *z)
{
int i, j, k;
SEXP value;
double *dptr;
/* Copy n and wt into the parent frame */
for (i = 0, k = 0; i < ysave; i++)
for (j = 0; j < n; j++)
ydata[k++] = y[j][i];
for (i = 0; i < n; i++)
wdata[i] = wt[i];
ndata[0] = n;
/*
* Evaluate the saved expression in the parent frame
* The result should be a vector of numerics containing the
* "deviance" followed by the "mean"
*/
/* no need to protect as no memory allocation (or error) below */
value = eval(expr2, rho);
if (!isReal(value))
error(_("return value not a vector"));
if (LENGTH(value) != (1 + rsave))
error(_("returned value is the wrong length"));
dptr = REAL(value);
for (i = 0; i <= rsave; i++)
z[i] = dptr[i];
}
/*
* This part is called by the causalTree "split" function.
* It is expected to return an n-1 length vector of "goodness of split"
*/
void
causalTree_callback2(int n, int ncat, double *y[], double *wt,
double *x, double *good)
{
int i, j, k;
SEXP goodness;
double *dptr;
for (i = 0, k = 0; i < ysave; i++)
for (j = 0; j < n; j++)
ydata[k++] = y[j][i];
for (i = 0; i < n; i++) {
wdata[i] = wt[i];
xdata[i] = x[i];
}
ndata[0] = (ncat > 0) ? -n : n;
/* the negative serves as a marker for causalTree.R */
/* no need to protect as no memory allocation (or error) below */
goodness = eval(expr1, rho);
if (!isReal(goodness))
error(_("the expression expr1 did not return a vector!"));
j = LENGTH(goodness);
dptr = REAL(goodness);
/*
* yes, the lengths have already been checked in the C code --- call
* this extra documenation then
*/
if (ncat == 0) {
if (j != 2 * (n - 1))
error("the expression expr1 returned a list of %d elements, %d required",
j, 2 * (n - 1));
for (i = 0; i < j; i++)
good[i] = dptr[i];
} else {
/*
* If not all categories were present in X, then the return list
* will have 2(#categories present) - 1 elements
* The first element of "good" contains the number of groups found
*/
good[0] = (j + 1) / 2;
for (i = 0; i < j; i++)
good[i + 1] = dptr[i];
}
}
|
/******************************************************************************
* Spine Runtimes Software License v2.5
*
* Copyright (c) 2013-2016, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable, and
* non-transferable license to use, install, execute, and perform the Spine
* Runtimes software and derivative works solely for personal or internal
* use. Without the written permission of Esoteric Software (see Section 2 of
* the Spine Software License Agreement), you may not (a) modify, translate,
* adapt, or develop new applications using the Spine Runtimes or otherwise
* create derivative works or improvements of the Spine Runtimes or (b) remove,
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "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 ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
* USE, DATA, OR PROFITS) 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 SPINE_POINTATTACHMENT_H_
#define SPINE_POINTATTACHMENT_H_
#include <spine/dll.h>
#include <spine/Attachment.h>
#include <spine/VertexAttachment.h>
#include <spine/Atlas.h>
#include <spine/Slot.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct spPointAttachment {
spVertexAttachment super;
float x, y, rotation;
spColor color;
} spPointAttachment;
SP_API spPointAttachment* spPointAttachment_create (const char* name);
SP_API void spPointAttachment_computeWorldPosition (spPointAttachment* self, spBone* bone, float* x, float* y);
SP_API float spPointAttachment_computeWorldRotation (spPointAttachment* self, spBone* bone);
#ifdef SPINE_SHORT_NAMES
typedef spPointAttachment PointAttachment;
#define PointAttachment_create(...) spPointAttachment_create(__VA_ARGS__)
#define PointAttachment_computeWorldPosition(...) spPointAttachment_computeWorldPosition(__VA_ARGS__)
#define PointAttachment_computeWorldRotation(...) spPointAttachment_computeWorldRotation(__VA_ARGS__)
#endif
#ifdef __cplusplus
}
#endif
#endif /* SPINE_POINTATTACHMENT_H_ */
|
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : hwsetup.h
* Description : Hardware setup header file.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/* Multiple inclusion prevention macro */
#ifndef HWSETUP_H
#define HWSETUP_H
/***********************************************************************************************************************
Exported global functions (to be accessed by other files)
***********************************************************************************************************************/
/* Hardware setup funtion declaration */
void hardware_setup(void);
/* End of multiple inclusion prevention macro */
#endif
|
/* Language-specific hook definitions for C front end.
Copyright (C) 1991, 1995, 1997, 1998,
1999, 2000, 2001 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 2, 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.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "c-tree.h"
#include "langhooks.h"
#include "langhooks-def.h"
static const char *c_init PARAMS ((const char *));
static void c_init_options PARAMS ((void));
/* ### When changing hooks, consider if ObjC needs changing too!! ### */
#undef LANG_HOOKS_NAME
#define LANG_HOOKS_NAME "GNU C"
#undef LANG_HOOKS_INIT
#define LANG_HOOKS_INIT c_init
#undef LANG_HOOKS_FINISH
#define LANG_HOOKS_FINISH c_common_finish
#undef LANG_HOOKS_INIT_OPTIONS
#define LANG_HOOKS_INIT_OPTIONS c_init_options
#undef LANG_HOOKS_DECODE_OPTION
#define LANG_HOOKS_DECODE_OPTION c_decode_option
#undef LANG_HOOKS_POST_OPTIONS
#define LANG_HOOKS_POST_OPTIONS c_common_post_options
#undef LANG_HOOKS_GET_ALIAS_SET
#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
#undef LANG_HOOKS_SAFE_FROM_P
#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
#undef LANG_HOOKS_PRINT_IDENTIFIER
#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier
#undef LANG_HOOKS_SET_YYDEBUG
#define LANG_HOOKS_SET_YYDEBUG c_set_yydebug
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
c_cannot_inline_tree_fn
#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
c_disregard_inline_limits
#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
anon_aggr_type_p
#undef LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
c_convert_parm_for_inlining
/* ### When changing hooks, consider if ObjC needs changing too!! ### */
/* Each front end provides its own. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
static void
c_init_options ()
{
c_common_init_options (clk_c);
}
static const char *
c_init (filename)
const char *filename;
{
return c_objc_common_init (filename);
}
/* Used by c-lex.c, but only for objc. */
tree
lookup_interface (arg)
tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
tree
is_class_name (arg)
tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
void
maybe_objc_check_decl (decl)
tree decl ATTRIBUTE_UNUSED;
{
}
int
maybe_objc_comptypes (lhs, rhs, reflexive)
tree lhs ATTRIBUTE_UNUSED;
tree rhs ATTRIBUTE_UNUSED;
int reflexive ATTRIBUTE_UNUSED;
{
return -1;
}
tree
maybe_building_objc_message_expr ()
{
return 0;
}
int
recognize_objc_keyword ()
{
return 0;
}
/* Used by c-typeck.c (build_external_ref), but only for objc. */
tree
lookup_objc_ivar (id)
tree id ATTRIBUTE_UNUSED;
{
return 0;
}
void
finish_file ()
{
c_objc_common_finish_file ();
}
|
/* Read a symlink relative to an open directory.
Copyright (C) 2009-2019 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* written by Eric Blake */
#include <config.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#if HAVE_READLINKAT
# undef readlinkat
ssize_t
rpl_readlinkat (int fd, char const *file, char *buf, size_t len)
{
# if READLINK_TRAILING_SLASH_BUG
size_t file_len = strlen (file);
if (file_len && file[file_len - 1] == '/')
{
/* Even if FILE without the slash is a symlink to a directory,
both lstat() and stat() must resolve the trailing slash to
the directory rather than the symlink. We can therefore
safely use stat() to distinguish between EINVAL and
ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */
struct stat st;
if (stat (file, &st) == 0)
errno = EINVAL;
return -1;
}
# endif /* READLINK_TRAILING_SLASH_BUG */
return readlinkat (fd, file, buf, len);
}
#else
/* Gnulib provides a readlink stub for mingw; use it for distinction
between EINVAL and ENOENT, rather than always failing with ENOSYS. */
/* POSIX 2008 says that unlike readlink, readlinkat returns 0 for
success instead of the buffer length. But this would render
readlinkat worthless since readlink does not guarantee a
NUL-terminated buffer. Assume this was a bug in POSIX. */
/* Read the contents of symlink FILE into buffer BUF of size LEN, in the
directory open on descriptor FD. If possible, do it without changing
the working directory. Otherwise, resort to using save_cwd/fchdir,
then readlink/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero. */
# define AT_FUNC_NAME readlinkat
# define AT_FUNC_F1 readlink
# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
# define AT_FUNC_POST_FILE_ARGS , buf, len
# define AT_FUNC_RESULT ssize_t
# include "at-func.c"
# undef AT_FUNC_NAME
# undef AT_FUNC_F1
# undef AT_FUNC_POST_FILE_PARAM_DECLS
# undef AT_FUNC_POST_FILE_ARGS
# undef AT_FUNC_RESULT
#endif
|
#pragma once
/*
* Copyright 2010-2015 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../Engine/State.h"
namespace OpenXcom
{
class Window;
class Text;
class TextButton;
class TextList;
/**
* Window which displays manufacture dependencies tree.
*/
class ManufactureDependenciesTreeState : public State
{
private:
Window *_window;
Text *_txtTitle;
TextList *_lstTopics;
TextButton *_btnOk, *_btnShowAll;
std::string _selectedItem;
bool _showAll;
void initList();
public:
/// Creates the ManufactureDependenciesTree state.
ManufactureDependenciesTreeState(const std::string &selectedItem);
/// Cleans up the ManufactureDependenciesTree state
~ManufactureDependenciesTreeState();
/// Initializes the state.
void init() override;
/// Handler for clicking the OK button.
void btnOkClick(Action *action);
/// Handler for clicking the [Show All] button.
void btnShowAllClick(Action *action);
};
}
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#ifndef _SCREENSHOT_H_
#define _SCREENSHOT_H_
void screenshot_check();
int screenshot_dump();
void screenshot_giant();
int cmdline_for_screenshot(const char **argv, int argc);
#endif
|
/* BranchTypes.h */
#ifndef __BRANCHTYPES_H
#define __BRANCHTYPES_H
#ifndef _7ZIP_BYTE_DEFINED
#define _7ZIP_BYTE_DEFINED
typedef unsigned char Byte;
#endif
#ifndef _7ZIP_UINT16_DEFINED
#define _7ZIP_UINT16_DEFINED
typedef unsigned short UInt16;
#endif
#ifndef _7ZIP_UINT32_DEFINED
#define _7ZIP_UINT32_DEFINED
#ifdef _LZMA_UINT32_IS_ULONG
typedef unsigned long UInt32;
#else
typedef unsigned int UInt32;
#endif
#endif
#endif
|
/*
* opencog/atomspace/ProtoAtom.h
*
* Copyright (C) 2015 Linas Vepstas
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* at http://opencog.org/wiki/Licenses
*
* 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 Affero General Public License
* along with this program; if not, write to:
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _OPENCOG_PROTO_ATOM_H
#define _OPENCOG_PROTO_ATOM_H
#include <memory>
#include <string>
#include <opencog/atoms/base/ClassServer.h>
#include <opencog/atoms/base/Handle.h>
#include <opencog/atoms/base/types.h>
namespace opencog
{
/** \addtogroup grp_atomspace
* @{
*/
/**
* ProtoAtoms are the base class for the Atom shared pointer.
*/
class ProtoAtom
: public std::enable_shared_from_this<ProtoAtom>
{
protected:
// We store the type locally, to avoid the overhead of
// turning getType into a virtual method.
Type _type;
public:
ProtoAtom(Type t) : _type(t) {}
virtual ~ProtoAtom() {}
inline Type getType() const { return _type; }
/** Basic predicate */
bool isType(Type t, bool subclass) const
{
Type at(getType());
if (not subclass) return t == at;
return classserver().isA(at, t);
}
virtual bool isAtom() const { return false; }
virtual bool isNode() const { return false; }
virtual bool isLink() const { return false; }
/**
* Returns a string representation of the proto-atom.
*/
virtual std::string toString(const std::string& indent) const = 0;
virtual std::string toShortString(const std::string& indent) const
{ return toString(indent); }
// Work around gdb's inability to build a string on the fly,
// see http://stackoverflow.com/questions/16734783 for more
// explanation.
std::string toString() const { return toString(""); }
std::string toShortString() const { return toShortString(""); }
/**
* Returns whether two proto-atoms are equal.
*
* @return true if the proto-atoms are equal, false otherwise.
*/
virtual bool operator==(const ProtoAtom&) const = 0;
/**
* Returns whether two proto-atoms are different.
*
* @return true if the proto-atoms are different, false otherwise.
*/
bool operator!=(const ProtoAtom& other) const
{ return not operator==(other); }
};
typedef std::shared_ptr<ProtoAtom> ProtoAtomPtr;
#if NOT_RIGHT_NOW
struct ProtoAtomPtr : public std::shared_ptr<ProtoAtom>
{
ProtoAtomPtr(std::shared_ptr<ProtoAtom> pa) :
std::shared_ptr<ProtoAtom>(pa) {}
ProtoAtomPtr(AtomPtr a) :
std::shared_ptr<ProtoAtom>(
std::dynamic_pointer_cast<ProtoAtom>(a)) {}
ProtoAtomPtr(Handle h) :
std::shared_ptr<ProtoAtom>(
std::dynamic_pointer_cast<ProtoAtom>(AtomPtr(h))) {}
operator AtomPtr() const
{ return AtomPtr(std::dynamic_pointer_cast<Atom>(*this)); }
operator Handle() const
{ return Handle(AtomPtr(*this)); }
};
#endif
typedef std::vector<ProtoAtomPtr> ProtomSeq;
/** @}*/
} // namespace opencog
// overload of operator<< to print ProtoAtoms
namespace std
{
template<typename Out>
Out& operator<<(Out& out, const opencog::ProtoAtomPtr& pa)
{
out << pa->toString("");
return out;
}
} // ~namespace std
#endif // _OPENCOG_PROTO_ATOM_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.