text
stringlengths 4
6.14k
|
|---|
/*
* Copyright (C) 2012 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.
* * 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 ContextFeatures_h
#define ContextFeatures_h
#include "platform/RefCountedSupplement.h"
namespace blink {
class ContextFeaturesClient;
class Document;
class Page;
#if ENABLE(OILPAN)
class ContextFeatures final : public GarbageCollectedFinalized<ContextFeatures>, public HeapSupplement<Page> {
USING_GARBAGE_COLLECTED_MIXIN(ContextFeatures);
public:
typedef HeapSupplement<Page> SupplementType;
#else
class ContextFeatures : public RefCountedSupplement<Page, ContextFeatures> {
public:
typedef RefCountedSupplement<Page, ContextFeatures> SupplementType;
#endif
enum FeatureType {
PagePopup = 0,
MutationEvents,
PushState,
FeatureTypeSize // Should be the last entry.
};
static const char* supplementName();
static ContextFeatures* defaultSwitch();
static PassRefPtrWillBeRawPtr<ContextFeatures> create(PassOwnPtr<ContextFeaturesClient>);
static bool pagePopupEnabled(Document*);
static bool mutationEventsEnabled(Document*);
static bool pushStateEnabled(Document*);
bool isEnabled(Document*, FeatureType, bool) const;
void urlDidChange(Document*);
#if ENABLE(OILPAN)
virtual void trace(Visitor* visitor) override { HeapSupplement<Page>::trace(visitor); }
#endif
private:
explicit ContextFeatures(PassOwnPtr<ContextFeaturesClient> client)
: m_client(client)
{ }
OwnPtr<ContextFeaturesClient> m_client;
};
class ContextFeaturesClient {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<ContextFeaturesClient> empty();
virtual ~ContextFeaturesClient() { }
virtual bool isEnabled(Document*, ContextFeatures::FeatureType, bool defaultValue) { return defaultValue; }
virtual void urlDidChange(Document*) { }
};
void provideContextFeaturesTo(Page&, PassOwnPtr<ContextFeaturesClient>);
void provideContextFeaturesToDocumentFrom(Document&, Page&);
inline PassRefPtrWillBeRawPtr<ContextFeatures> ContextFeatures::create(PassOwnPtr<ContextFeaturesClient> client)
{
return adoptRefWillBeNoop(new ContextFeatures(client));
}
inline bool ContextFeatures::isEnabled(Document* document, FeatureType type, bool defaultValue) const
{
if (!m_client)
return defaultValue;
return m_client->isEnabled(document, type, defaultValue);
}
inline void ContextFeatures::urlDidChange(Document* document)
{
// FIXME: The original code, commented out below, is obviously
// wrong, but the seemingly correct fix of negating the test to
// the more logical 'if (!m_client)' crashes the renderer.
// See issue 294180
//
// if (m_client)
// return;
// m_client->urlDidChange(document);
}
} // namespace blink
#endif // ContextFeatures_h
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <Foundation/Foundation.h>
#import "DVTCancellable.h"
@class NSString;
@interface DVTBlockBasedCancellationToken : NSObject <DVTCancellable>
{
unsigned char _cancelled;
CDUnknownBlockType _block;
}
- (void).cxx_destruct;
@property(readonly, getter=isCancelled) BOOL cancelled;
- (void)cancel;
- (id)initWithBlock:(CDUnknownBlockType)arg1;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
|
// 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_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_
#pragma once
#include "base/message_loop.h"
#include "chrome/browser/extensions/test_extension_prefs.h"
#include "content/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
class Value;
}
// Base class for extension preference-related unit tests.
class ExtensionPrefsTest : public testing::Test {
public:
ExtensionPrefsTest();
virtual ~ExtensionPrefsTest();
// This function will get called once, and is the right place to do operations
// on ExtensionPrefs that write data.
virtual void Initialize() = 0;
// This function will be called twice - once while the original ExtensionPrefs
// object is still alive, and once after recreation. Thus, it tests that
// things don't break after any ExtensionPrefs startup work.
virtual void Verify() = 0;
// This function is called to Register preference default values.
virtual void RegisterPreferences();
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
protected:
ExtensionPrefs* prefs() { return prefs_.prefs(); }
MessageLoop message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
TestExtensionPrefs prefs_;
private:
DISALLOW_COPY_AND_ASSIGN(ExtensionPrefsTest);
};
class ExtensionPrefsPrepopulatedTest : public ExtensionPrefsTest {
public:
ExtensionPrefsPrepopulatedTest();
virtual ~ExtensionPrefsPrepopulatedTest();
virtual void RegisterPreferences() OVERRIDE;
void InstallExtControlledPref(Extension *ext,
const std::string& key,
base::Value* val);
void InstallExtControlledPrefIncognito(Extension *ext,
const std::string& key,
base::Value* val);
void InstallExtControlledPrefIncognitoSessionOnly(
Extension *ext,
const std::string& key,
base::Value* val);
void InstallExtension(Extension *ext);
void UninstallExtension(const std::string& extension_id);
// Weak references, for convenience.
Extension* ext1_;
Extension* ext2_;
Extension* ext3_;
Extension* ext4_;
// Flags indicating whether each of the extensions has been installed, yet.
bool installed[4];
private:
void EnsureExtensionInstalled(Extension *ext);
void EnsureExtensionUninstalled(const std::string& extension_id);
scoped_refptr<Extension> ext1_scoped_;
scoped_refptr<Extension> ext2_scoped_;
scoped_refptr<Extension> ext3_scoped_;
scoped_refptr<Extension> ext4_scoped_;
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_
|
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
* Copyright (C) 1999-2003, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: scrptrun.h
*
* created on: 10/17/2001
* created by: Eric R. Mader
*/
#ifndef __SCRPTRUN_H
#define __SCRPTRUN_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/uscript.h"
struct ScriptRecord
{
UChar32 startChar;
UChar32 endChar;
UScriptCode scriptCode;
};
struct ParenStackEntry
{
int32_t pairIndex;
UScriptCode scriptCode;
};
class ScriptRun : public UObject {
public:
ScriptRun();
ScriptRun(const UChar chars[], int32_t length);
ScriptRun(const UChar chars[], int32_t start, int32_t length);
void reset();
void reset(int32_t start, int32_t count);
void reset(const UChar chars[], int32_t start, int32_t length);
int32_t getScriptStart();
int32_t getScriptEnd();
UScriptCode getScriptCode();
UBool next();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @stable ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @stable ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
private:
static UBool sameScript(int32_t scriptOne, int32_t scriptTwo);
int32_t charStart;
int32_t charLimit;
const UChar *charArray;
int32_t scriptStart;
int32_t scriptEnd;
UScriptCode scriptCode;
ParenStackEntry parenStack[128];
int32_t parenSP;
static int8_t highBit(int32_t value);
static int32_t getPairIndex(UChar32 ch);
static UChar32 pairedChars[];
static const int32_t pairedCharCount;
static const int32_t pairedCharPower;
static const int32_t pairedCharExtra;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
};
inline ScriptRun::ScriptRun()
{
reset(NULL, 0, 0);
}
inline ScriptRun::ScriptRun(const UChar chars[], int32_t length)
{
reset(chars, 0, length);
}
inline ScriptRun::ScriptRun(const UChar chars[], int32_t start, int32_t length)
{
reset(chars, start, length);
}
inline int32_t ScriptRun::getScriptStart()
{
return scriptStart;
}
inline int32_t ScriptRun::getScriptEnd()
{
return scriptEnd;
}
inline UScriptCode ScriptRun::getScriptCode()
{
return scriptCode;
}
inline void ScriptRun::reset()
{
scriptStart = charStart;
scriptEnd = charStart;
scriptCode = USCRIPT_INVALID_CODE;
parenSP = -1;
}
inline void ScriptRun::reset(int32_t start, int32_t length)
{
charStart = start;
charLimit = start + length;
reset();
}
inline void ScriptRun::reset(const UChar chars[], int32_t start, int32_t length)
{
charArray = chars;
reset(start, length);
}
#endif
|
#import <Foundation/Foundation.h>
//
// This controller demonstrates how to use SMCalloutView with a basic UIScrollView.
//
@interface ScrollViewController : UIViewController
@end
|
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux 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 "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 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.
*/
#include <reg.h>
#include <debug.h>
#include <malloc.h>
#include <smem.h>
#include <stdint.h>
#include <libfdt.h>
#include <platform.h>
#include <platform/iomap.h>
#include <dev_tree.h>
uint32_t target_dev_tree_mem(void *fdt, uint32_t memory_node_offset)
{
ram_partition ptn_entry;
unsigned int index;
int ret = 0;
uint32_t len = 0;
/* Make sure RAM partition table is initialized */
ASSERT(smem_ram_ptable_init_v1());
len = smem_get_ram_ptable_len();
/* Calculating the size of the mem_info_ptr */
for (index = 0 ; index < len; index++)
{
smem_get_ram_ptable_entry(&ptn_entry, index);
if((ptn_entry.category == SDRAM) &&
(ptn_entry.type == SYS_MEMORY))
{
/* Pass along all other usable memory regions to Linux */
ret = dev_tree_add_mem_info(fdt,
memory_node_offset,
ptn_entry.start,
ptn_entry.size);
if (ret)
{
dprintf(CRITICAL, "Failed to add secondary banks memory addresses\n");
goto target_dev_tree_mem_err;
}
}
}
target_dev_tree_mem_err:
return ret;
}
void *target_get_scratch_address(void)
{
return ((void *) VA((addr_t)SCRATCH_REGION2));
}
unsigned target_get_max_flash_size(void)
{
return (SCRATCH_REGION2_SIZE);
}
|
// Copyright 2014 Applause. All rights reserved.
#import <Foundation/Foundation.h>
#import "APLSetting.h"
@protocol APLLogging <NSObject>
/**
* Default settings:
* - applicationVersionName is equal to CFBundleShortVersionString
* - applicationVersionCode is equal to CFBundleVersion
* - reportOnShakeEnabled is equal to YES
* @return an object conforming to APLSetting protocol with default values. You can easily change SDK behaviour by simply changing it's properties.
*/
+ (id<APLSetting>)settings;
/**
* ONLY FOR PRE PRODUCTION
* Pre Production is using CMMotionManager for shake gesture. Apple advices to use one CMMotionManager per application.
* If your application is using one, please register it to Pre Production library via this method.
* If you won't do this Pre Production will create it's own CMMotionManager.
*/
+ (void)registerMotionManager:(id)motionManager;
/**
* Starting session. Should be called once per application run - doing otherwise will result in an undefined behavior.
* If you want to change default settings change properties for object [LOGGER_CLASSNAME settings].
* @param applicationID Application ID that you can get from Web Server
*/
+ (void)startNewSessionWithApplicationKey:(NSString *)applicationId;
/**
* Logs exception. Screenshot will be included in the data sent to the server.
* You can use APLUncaughtExceptionHandler as a convenience accessor to this method.
* @param error Exception that will be passed to Web Server
*/
+ (void)logApplicationException:(NSException *)error;
/**
* This method will register object for logging, meaning each and every method sent to it will be logged, including timestamp.
* @param object Object that will be registered for logging
*/
+ (id)registerObjectForLogging:(id)object;
/**
* Forces the contents of the session log buffer to be send.
*/
+ (void)flush;
/**
* ONLY FOR PRE PRODUCTION
* This function manually shows report screen that is normally accessible by shaking device.
*/
+ (void)showReportScreen;
/**
* ONLY FOR PRODUCTION
* Function to show feedback modal where user can write and send feedback about application.
* You can theme this using Appearance protocol (above iOS 5.0).
* @param title Title of modal header
* @param placeholder Placeholder of text field
*/
+ (void)feedback:(NSString *)title placeholder:(NSString *)placeholder DEPRECATED_ATTRIBUTE;
/**
* ONLY FOR PRODUCTION
* @see LOGGER_CLASSNAME#feedback:placeholder:
*/
+ (void)feedback:(NSString *)title DEPRECATED_ATTRIBUTE;
/**
* ONLY FOR PRODUCTION
* Default title is "Feedback".
* @see LOGGER_CLASSNAME#feedback:placeholder:
*/
+ (void)feedback DEPRECATED_ATTRIBUTE;
/**
* ONLY FOR PRODUCTION
* Function which sends feedback to Applause. It is used by feedback modal.
* @param feedback Text which you want send to Applause.
*/
+ (void)sendFeedback:(NSString *)feedback DEPRECATED_ATTRIBUTE;
@end
|
#ifndef _FPU_PROTO_H
#define _FPU_PROTO_H
/* errors.c */
extern void Un_impl(void);
extern void FPU_illegal(void);
extern void FPU_printall(void);
asmlinkage void FPU_exception(int n);
extern int real_1op_NaN(FPU_REG *a);
extern int real_2op_NaN(FPU_REG const *b, u_char tagb, int deststnr,
FPU_REG const *defaultNaN);
extern int arith_invalid(int deststnr);
extern int FPU_divide_by_zero(int deststnr, u_char sign);
extern int set_precision_flag(int flags);
extern void set_precision_flag_up(void);
extern void set_precision_flag_down(void);
extern int denormal_operand(void);
extern int arith_overflow(FPU_REG *dest);
extern int arith_round_overflow(FPU_REG *dest, u8 sign);
extern int arith_underflow(FPU_REG *dest);
extern void FPU_stack_overflow(void);
extern void FPU_stack_underflow(void);
extern void FPU_stack_underflow_i(int i);
extern void FPU_stack_underflow_pop(int i);
/* fpu_arith.c */
extern void fadd__(void);
extern void fmul__(void);
extern void fsub__(void);
extern void fsubr_(void);
extern void fdiv__(void);
extern void fdivr_(void);
extern void fadd_i(void);
extern void fmul_i(void);
extern void fsubri(void);
extern void fsub_i(void);
extern void fdivri(void);
extern void fdiv_i(void);
extern void faddp_(void);
extern void fmulp_(void);
extern void fsubrp(void);
extern void fsubp_(void);
extern void fdivrp(void);
extern void fdivp_(void);
/* fpu_aux.c */
extern void fclex(void);
extern void finit(void);
extern void finit_(void);
extern void fstsw_(void);
extern void fp_nop(void);
extern void fld_i_(void);
extern void fxch_i(void);
extern void ffree_(void);
extern void ffreep(void);
extern void fst_i_(void);
extern void fstp_i(void);
/* fpu_entry.c */
extern void math_emulate(long arg);
extern void math_abort(struct info *info, unsigned int signal);
/* fpu_etc.c */
extern void FPU_etc(void);
/* fpu_tags.c */
extern int FPU_gettag0(void);
extern int FPU_gettagi(int stnr);
extern int FPU_gettag(int regnr);
extern void FPU_settag0(int tag);
extern void FPU_settagi(int stnr, int tag);
extern void FPU_settag(int regnr, int tag);
extern int FPU_Special(FPU_REG const *ptr);
extern int isNaN(FPU_REG const *ptr);
extern void FPU_pop(void);
extern int FPU_empty_i(int stnr);
extern int FPU_stackoverflow(FPU_REG **st_new_ptr);
extern void FPU_sync_tags(void);
extern void FPU_copy_to_regi(FPU_REG const *r, u_char tag, int stnr);
extern void FPU_copy_to_reg1(FPU_REG const *r, u_char tag);
extern void FPU_copy_to_reg0(FPU_REG const *r, u_char tag);
/* fpu_trig.c */
extern void FPU_triga(void);
extern void FPU_trigb(void);
/* get_address.c */
extern void *FPU_get_address(u_char FPU_modrm, u32 *fpu_eip,
struct address *addr, fpu_addr_modes addr_modes);
extern void *FPU_get_address_16(u_char FPU_modrm, u32 *fpu_eip,
struct address *addr, fpu_addr_modes addr_modes);
/* load_store.c */
extern int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
void *data_address);
/* poly_2xm1.c */
extern int poly_2xm1(u_char sign, FPU_REG *arg, FPU_REG *result);
/* poly_atan.c */
extern void poly_atan(FPU_REG *st0_ptr, u_char st0_tag, FPU_REG *st1_ptr,
u_char st1_tag);
/* poly_l2.c */
extern void poly_l2(FPU_REG *st0_ptr, FPU_REG *st1_ptr, u_char st1_sign);
extern int poly_l2p1(u_char s0, u_char s1, FPU_REG *r0, FPU_REG *r1,
FPU_REG *d);
/* poly_sin.c */
extern void poly_sine(FPU_REG *st0_ptr);
extern void poly_cos(FPU_REG *st0_ptr);
/* poly_tan.c */
extern void poly_tan(FPU_REG *st0_ptr, int flag);
/* reg_add_sub.c */
extern int FPU_add(FPU_REG const *b, u_char tagb, int destrnr, u16 control_w);
extern int FPU_sub(int flags, FPU_REG *rm, u16 control_w); // bbd: changed arg2 from int to FPU_REG*
/* reg_compare.c */
extern int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag);
extern void fcom_st(void);
extern void fcompst(void);
extern void fcompp(void);
extern void fucom_(void);
extern void fucomp(void);
extern void fucompp(void);
/* reg_constant.c */
extern void fconst(void);
/* reg_ld_str.c */
extern int FPU_load_extended(long double *s, int stnr);
extern int FPU_load_double(double *dfloat, FPU_REG *loaded_data);
extern int FPU_load_single(float *single, FPU_REG *loaded_data);
extern int FPU_load_int64(s64 *_s);
extern int FPU_load_int32(s32 *_s, FPU_REG *loaded_data);
extern int FPU_load_int16(s16 *_s, FPU_REG *loaded_data);
extern int FPU_load_bcd(u_char *s);
extern int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag,
long double *d);
extern int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat);
extern int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single);
extern int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, s64 *d);
extern int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, s32 *d);
extern int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, s16 *d);
extern int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d);
extern int FPU_round_to_int(FPU_REG *r, u_char tag);
extern u_char *fldenv(fpu_addr_modes addr_modes, u_char *s);
extern void frstor(fpu_addr_modes addr_modes, u_char *data_address);
extern u_char *fstenv(fpu_addr_modes addr_modes, u_char *d);
extern void fsave(fpu_addr_modes addr_modes, u_char *data_address);
extern int FPU_tagof(FPU_REG *ptr);
/* reg_mul.c */
extern int FPU_mul(FPU_REG const *b, u_char tagb, int deststnr, int control_w);
extern int FPU_div(int flags, FPU_REG *regrm, int control_w); // bbd: changed arg2 from int to FPU_REG*
/* reg_convert.c */
extern int FPU_to_exp16(FPU_REG const *a, FPU_REG *x);
#endif /* _FPU_PROTO_H */
|
/****************************************************************************************
* Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.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, see <http://www.gnu.org/licenses/>. *
****************************************************************************************/
#ifndef AMAROK_COLLECTION_MYSQLQUERYMAKER_H
#define AMAROK_COLLECTION_MYSQLQUERYMAKER_H
#include "MySqlCollection.h"
#include "SqlQueryMaker.h"
class MySqlQueryMaker : public SqlQueryMaker
{
public:
MySqlQueryMaker( MySqlCollection* collection );
virtual ~MySqlQueryMaker();
protected:
virtual QString escape( QString text ) const;
};
#endif
|
/*--------------------------------------------------------------------*/
/*--- Read 'stabs' format debug info. priv_readstabs.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2000-2012 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __PRIV_READSTABS_H
#define __PRIV_READSTABS_H
/*
Stabs reader greatly improved by Nick Nethercote, Apr 02.
This module was also extensively hacked on by Jeremy Fitzhardinge
and Tom Hughes.
*/
/* --------------------
Stabs reader
-------------------- */
extern
void ML_(read_debuginfo_stabs) ( struct _DebugInfo* di,
UChar* stabC, Int stab_sz,
UChar* stabstr, Int stabstr_sz );
#endif /* ndef __PRIV_READSTABS_H */
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
|
/*
* linux/regulator/max77838-regulator.h
*
*
* 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 __LINUX_MAX77838_REGULATOR_H
#define __LINUX_MAX77838_REGULATOR_H
/*******************************************************************************
* Useful Macros
******************************************************************************/
#undef __CONST_FFS
#define __CONST_FFS(_x) \
((_x) & 0x0F ? ((_x) & 0x03 ? ((_x) & 0x01 ? 0 : 1) :\
((_x) & 0x04 ? 2 : 3)) :\
((_x) & 0x30 ? ((_x) & 0x10 ? 4 : 5) :\
((_x) & 0x40 ? 6 : 7)))
#undef BIT_RSVD
#define BIT_RSVD 0
#undef BITS
#define BITS(_end, _start) \
((BIT(_end) - BIT(_start)) + BIT(_end))
#undef __BITS_GET
#define __BITS_GET(_word, _mask, _shift) \
(((_word) & (_mask)) >> (_shift))
#undef BITS_GET
#define BITS_GET(_word, _bit) \
__BITS_GET(_word, _bit, FFS(_bit))
#undef __BITS_SET
#define __BITS_SET(_word, _mask, _shift, _val) \
(((_word) & ~(_mask)) | (((_val) << (_shift)) & (_mask)))
#undef BITS_SET
#define BITS_SET(_word, _bit, _val) \
__BITS_SET(_word, _bit, FFS(_bit), _val)
#undef BITS_MATCH
#define BITS_MATCH(_word, _bit) \
(((_word) & (_bit)) == (_bit))
enum max77838_reg_id {
MAX77838_LDO1 = 1,
MAX77838_LDO2,
MAX77838_LDO3,
MAX77838_LDO4,
MAX77838_LDO_MAX = MAX77838_LDO4,
MAX77838_BUCK,
MAX77838_REGULATORS = MAX77838_BUCK,
};
struct max77838_regulator_data {
int active_discharge_enable;
struct regulator_init_data *initdata;
struct device_node *of_node;
};
struct max77838_regulator_platform_data
{
int num_regulators;
struct max77838_regulator_data *regulators;
int buck_ramp_up;
int buck_ramp_down;
int buck_fpwm;
int buck_fsrad;
int uvlo_fall_threshold;
};
#endif
|
/*****************************************************************************
*
* Filename:
* ---------
* camera_sensor_para.h
*
* Project:
* --------
* DUMA
*
* Description:
* ------------
* Header file of Sensor tuning parameters that should be generated by CCT
*
*
* Author:
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by CC/CQ. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* $Revision:$
* $Modtime:$
* $Log:$
*
* 04 12 2013 guoqing.liu
* [ALPS00564761] sensor driver check in
* sensor driver check in.
*
* 07 31 2012 chengxue.shen
* NULL
* 3h2+lens.
*
* 02 11 2011 koli.lin
* [ALPS00030473] [Camera]
* Create IMX073 sensor driver to database.
*
* Apr 7 2009 mtk02204
* [DUMA00004012] [Camera] Restructure and rename camera related custom folders and folder name of came
*
*
* Feb 24 2009 mtk02204
* [DUMA00001084] First Check in of MT6516 multimedia drivers
*
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by CC/CQ. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
/* SENSOR FULL SIZE */
#ifndef __CAMERA_SENSOR_PARA_H
#define __CAMERA_SENSOR_PARA_H
#define CAMERA_SENSOR_REG_DEFAULT_VALUE \
/* ARRAY: SENSOR.reg[11] */\
{\
/* STRUCT: SENSOR.reg[0] */\
{\
/* SENSOR.reg[0].addr */ 0xFFFFFFFF, /* SENSOR.reg[0].para */ 0x00000000\
},\
/* STRUCT: SENSOR.reg[1] */\
{\
/* SENSOR.reg[1].addr */ 0xFFFFFFFF, /* SENSOR.reg[1].para */ 0x0000000D\
},\
/* STRUCT: SENSOR.reg[2] */\
{\
/* SENSOR.reg[2].addr */ 0xFFFFFFFF, /* SENSOR.reg[2].para */ 0x00000000\
},\
/* STRUCT: SENSOR.reg[3] */\
{\
/* SENSOR.reg[3].addr */ 0xFFFFFFFF, /* SENSOR.reg[3].para */ 0x000000C0\
},\
/* STRUCT: SENSOR.reg[4] */\
{\
/* SENSOR.reg[4].addr */ 0xFFFFFFFF, /* SENSOR.reg[4].para */ 0x00000000\
},\
/* STRUCT: SENSOR.reg[5] */\
{\
/* SENSOR.reg[5].addr */ 0xFFFFFFFF, /* SENSOR.reg[5].para */ 0x00000004\
},\
/* STRUCT: SENSOR.reg[6] */\
{\
/* SENSOR.reg[6].addr */ 0xFFFFFFFF, /* SENSOR.reg[6].para */ 0x00000000\
},\
/* STRUCT: SENSOR.reg[7] */\
{\
/* SENSOR.reg[7].addr */ 0xFFFFFFFF, /* SENSOR.reg[7].para */ 0x00000002\
},\
/* STRUCT: SENSOR.reg[8] */\
{\
/* SENSOR.reg[8].addr */ 0xFFFFFFFF, /* SENSOR.reg[8].para */ 0x00000000\
},\
/* STRUCT: SENSOR.reg[9] */\
{\
/* SENSOR.reg[9].addr */ 0xFFFFFFFF, /* SENSOR.reg[9].para */ 0x00000008\
},\
/* STRUCT: SENSOR.reg[10] */\
{\
/* SENSOR.reg[10].addr */ 0xFFFFFFFF, /* SENSOR.reg[10].para */ 0x00000001\
}\
}
//BASEGAIN, Digital R gain, Digital Gr gain, Digital Gb gain, Digital B gain
#define CAMERA_SENSOR_CCT_DEFAULT_VALUE {{ 0x0205, 0x00 } ,{ 0x0211, 0x00 } ,{ 0x020F, 0x00 } ,{ 0x0215, 0x00 } ,{ 0x0213, 0x00 }}
#endif /* __CAMERA_SENSOR_PARA_H */
|
/*
* Copyright(c) 2011-2016 Intel Corporation. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Zhi Wang <zhi.a.wang@intel.com>
*
* Contributors:
* Ping Gao <ping.a.gao@intel.com>
* Tina Zhang <tina.zhang@intel.com>
* Chanbin Du <changbin.du@intel.com>
* Min He <min.he@intel.com>
* Bing Niu <bing.niu@intel.com>
* Zhenyu Wang <zhenyuw@linux.intel.com>
*
*/
#ifndef _GVT_SCHEDULER_H_
#define _GVT_SCHEDULER_H_
struct intel_gvt_workload_scheduler {
struct intel_vgpu *current_vgpu;
struct intel_vgpu *next_vgpu;
struct intel_vgpu_workload *current_workload[I915_NUM_ENGINES];
bool need_reschedule;
spinlock_t mmio_context_lock;
/* can be null when owner is host */
struct intel_vgpu *engine_owner[I915_NUM_ENGINES];
wait_queue_head_t workload_complete_wq;
struct task_struct *thread[I915_NUM_ENGINES];
wait_queue_head_t waitq[I915_NUM_ENGINES];
void *sched_data;
struct intel_gvt_sched_policy_ops *sched_ops;
};
#define INDIRECT_CTX_ADDR_MASK 0xffffffc0
#define INDIRECT_CTX_SIZE_MASK 0x3f
struct shadow_indirect_ctx {
struct drm_i915_gem_object *obj;
unsigned long guest_gma;
unsigned long shadow_gma;
void *shadow_va;
u32 size;
};
#define PER_CTX_ADDR_MASK 0xfffff000
struct shadow_per_ctx {
unsigned long guest_gma;
unsigned long shadow_gma;
unsigned valid;
};
struct intel_shadow_wa_ctx {
struct shadow_indirect_ctx indirect_ctx;
struct shadow_per_ctx per_ctx;
};
struct intel_vgpu_workload {
struct intel_vgpu *vgpu;
int ring_id;
struct i915_request *req;
/* if this workload has been dispatched to i915? */
bool dispatched;
bool shadow; /* if workload has done shadow of guest request */
int status;
struct intel_vgpu_mm *shadow_mm;
/* different submission model may need different handler */
int (*prepare)(struct intel_vgpu_workload *);
int (*complete)(struct intel_vgpu_workload *);
struct list_head list;
DECLARE_BITMAP(pending_events, INTEL_GVT_EVENT_MAX);
void *shadow_ring_buffer_va;
/* execlist context information */
struct execlist_ctx_descriptor_format ctx_desc;
struct execlist_ring_context *ring_context;
unsigned long rb_head, rb_tail, rb_ctl, rb_start, rb_len;
bool restore_inhibit;
struct intel_vgpu_elsp_dwords elsp_dwords;
bool emulate_schedule_in;
atomic_t shadow_ctx_active;
wait_queue_head_t shadow_ctx_status_wq;
u64 ring_context_gpa;
/* shadow batch buffer */
struct list_head shadow_bb;
struct intel_shadow_wa_ctx wa_ctx;
/* oa registers */
u32 oactxctrl;
u32 flex_mmio[7];
};
struct intel_vgpu_shadow_bb {
struct list_head list;
struct drm_i915_gem_object *obj;
struct i915_vma *vma;
void *va;
u32 *bb_start_cmd_va;
unsigned int clflush;
bool accessing;
unsigned long bb_offset;
bool ppgtt;
};
#define workload_q_head(vgpu, ring_id) \
(&(vgpu->submission.workload_q_head[ring_id]))
void intel_vgpu_queue_workload(struct intel_vgpu_workload *workload);
int intel_gvt_init_workload_scheduler(struct intel_gvt *gvt);
void intel_gvt_clean_workload_scheduler(struct intel_gvt *gvt);
void intel_gvt_wait_vgpu_idle(struct intel_vgpu *vgpu);
int intel_vgpu_setup_submission(struct intel_vgpu *vgpu);
void intel_vgpu_reset_submission(struct intel_vgpu *vgpu,
intel_engine_mask_t engine_mask);
void intel_vgpu_clean_submission(struct intel_vgpu *vgpu);
int intel_vgpu_select_submission_ops(struct intel_vgpu *vgpu,
intel_engine_mask_t engine_mask,
unsigned int interface);
extern const struct intel_vgpu_submission_ops
intel_vgpu_execlist_submission_ops;
struct intel_vgpu_workload *
intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id,
struct execlist_ctx_descriptor_format *desc);
void intel_vgpu_destroy_workload(struct intel_vgpu_workload *workload);
void intel_vgpu_clean_workloads(struct intel_vgpu *vgpu,
intel_engine_mask_t engine_mask);
#endif
|
/////////////////////////////////////////////////////////////////////////////
// (c) Copyright The Code Project Open License (CPOL)
// http://www.codeproject.com/info/cpol10.aspx
//
// Marius Samoila, Nikolai Teofilov, 2011
//
// FILE NAME
// ElementPoint.h: Declaration of the CElementPoint class
//
// CLASS NAME
// CElementPoint
//
// DESCRIPTION
//
// MODIFICATIONS
// 01-Dec-2011 MSamoila created from old CElementPoint
//
#pragma once
///////////////////////////////////////////////////////////
// Declaration of the CElementPoint class.
class CElementPoint
{
public:
double x, y;
CElementPoint ()
{
x=y=0;
}
CElementPoint (double c1, double c2)
{
x = c1;
y = c2;
}
CElementPoint& operator=(const CElementPoint& pt)
{
x = pt.x;
y = pt.y;
return *this;
}
CElementPoint (const CElementPoint& pt)
{
*this = pt;
}
};
|
/*
* Copyright (C) 2008-2009 Tobias Brunner
* Copyright (C) 2007 Martin Willi
* Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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 GUEST_H
#define GUEST_H
#include <library.h>
#include <collections/enumerator.h>
typedef enum guest_state_t guest_state_t;
typedef struct guest_t guest_t;
#include "iface.h"
/**
* State of a guest (started, stopped, ...)
*/
enum guest_state_t {
/** guest kernel not running at all */
GUEST_STOPPED,
/** kernel started, but not yet available */
GUEST_STARTING,
/** guest is up and running */
GUEST_RUNNING,
/** guest has been paused */
GUEST_PAUSED,
/** guest is stopping (shutting down) */
GUEST_STOPPING,
};
/**
* string mappings for guest_state_t
*/
extern enum_name_t *guest_state_names;
/**
* Invoke function which lauches the UML guest.
*
* Consoles are all set to NULL, you may change them by adding additional UML
* options to args before invocation.
*
* @param data callback data
* @param guest guest to start
* @param args args to use for guest invocation, args[0] is kernel
* @param argc number of elements in args
* @param idle
* @return PID of child, 0 if failed
*/
typedef pid_t (*invoke_function_t)(void *data, guest_t *guest,
char *args[], int argc);
/**
* Idle function to pass to start().
*/
typedef void (*idle_function_t)(void);
/**
* A guest is a UML instance running on the host.
**/
struct guest_t {
/**
* Get the name of this guest.
*
* @return name of the guest
*/
char* (*get_name) (guest_t *this);
/**
* Get the process ID of the guest child process.
*
* @return name of the guest
*/
pid_t (*get_pid) (guest_t *this);
/**
* Get the state of the guest (stopped, started, etc.).
*
* @return guests state
*/
guest_state_t (*get_state)(guest_t *this);
/**
* Start the guest.
*
* @param invoke UML guest invocation function
* @param data data to pass back to invoke function
* @param idle idle function to call while waiting on child
* @return TRUE if guest successfully started
*/
bool (*start) (guest_t *this, invoke_function_t invoke, void *data,
idle_function_t idle);
/**
* Kill the guest.
*
* @param idle idle function to call while waiting to termination
*/
void (*stop) (guest_t *this, idle_function_t idle);
/**
* Create a new interface in the current scenario.
*
* @param name name of the interface in the guest
* @return created interface, or NULL if failed
*/
iface_t* (*create_iface)(guest_t *this, char *name);
/**
* Destroy an interface on guest.
*
* @param iface interface to destroy
*/
void (*destroy_iface)(guest_t *this, iface_t *iface);
/**
* Create an enumerator over all guest interfaces.
*
* @return enumerator over iface_t's
*/
enumerator_t* (*create_iface_enumerator)(guest_t *this);
/**
* Adds a COWFS overlay. The directory is created if it does not exist.
*
* @param dir directory where overlay diff should point to
* @return FALSE, if failed
*/
bool (*add_overlay)(guest_t *this, char *dir);
/**
* Removes the specified COWFS overlay.
*
* @param dir directory where overlay diff points to
* @return FALSE, if no found
*/
bool (*del_overlay)(guest_t *this, char *dir);
/**
* Removes the latest COWFS overlay.
*
* @return FALSE, if no overlay was found
*/
bool (*pop_overlay)(guest_t *this);
/**
* Execute a command on the guests mconsole.
*
* @param cb callback to call for each read block
* @param data data to pass to callback
* @param cmd command to execute
* @param ... printf style argument list for cmd
* @return return value
*/
int (*exec)(guest_t *this, void(*cb)(void*,char*,size_t), void *data,
char *cmd, ...);
/**
* Execute a command on the guests mconsole, with output formatter.
*
* If lines is TRUE, callback is invoked for each output line. Otherwise
* the full result is returned in one callback invocation.
*
* @note This function does not work with binary output.
*
* @param cb callback to call for each line or for the complete output
* @param lines TRUE if the callback should be called for each line
* @param data data to pass to callback
* @param cmd command to execute
* @param ... printf style argument list for cmd
* @return return value
*/
int (*exec_str)(guest_t *this, void(*cb)(void*,char*), bool lines,
void *data, char *cmd, ...);
/**
* Called whenever a SIGCHILD for the guests PID is received.
*/
void (*sigchild)(guest_t *this);
/**
* Close and destroy a guest with all interfaces
*/
void (*destroy) (guest_t *this);
};
/**
* Create a new, unstarted guest.
*
* @param parent parent directory to create the guest in
* @param name name of the guest to create
* @param kernel kernel this guest uses
* @param master read-only master filesystem for guest
* @param args additional args to pass to kernel
* @param mem amount of memory to give the guest
*/
guest_t *guest_create(char *parent, char *name, char *kernel,
char *master, char *args);
/**
* Load a guest created with guest_create().
*
* @param parent parent directory to look for a guest
* @param name name of the guest directory
*/
guest_t *guest_load(char *parent, char *name);
#endif /* GUEST_H */
|
/*
* Copyright 2007 Xu, Chuan <xuchuan@gmail.com>
*
* This file is part of ZOJ.
*
* ZOJ 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.
*
* ZOJ 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 ZOJ. if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TEST_UTIL_INL_H
#define __TEST_UTIL_INL_H
#include "common_io.h"
#include "util.h"
static inline int TryReadUint32(int fd) {
uint32_t t;
if (ReadUint32(fd, &t) < 0) {
return -1;
}
return (int)t;
}
static inline int ReadUint32(int fd) {
uint32_t t;
ASSERT_EQUAL(0, ReadUint32(fd, &t));
return (int)t;
}
static inline int ReadLastUint32(int fd) {
uint32_t t;
ASSERT_EQUAL(0, ReadUint32(fd, &t));
char ch;
ASSERT_EQUAL(0, read(fd, &ch, 1));
return (int)t;
}
extern int ReadUntilNotRunning(int fd) {
for (;;) {
int reply = TryReadUint32(fd);
if (reply != RUNNING) {
return reply;
}
int time = ReadUint32(fd);
int memory = ReadUint32(fd);
ASSERT(time >= 0);
ASSERT(memory >= 0);
}
}
extern int ReadUntilNotJudging(int fd) {
for (;;) {
int reply = ReadUint32(fd);
if (reply != JUDGING) {
return reply;
}
}
}
extern inline int Eof(int fd) {
char ch;
return !read(fd, &ch, 1);
}
#endif
|
/*
* Copyright (C) 2014 Christian Mehlis <mehlis@inf.fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @defgroup boards_airfy-beacon Airfy Beacon
* @ingroup boards
* @brief Board specific files for the Arify Beacon board
* @{
*
* @file
* @brief Board specific definitions for the Arify Beacon board
*
* @author Christian Mehlis <mehlis@inf.fu-berlin.de>
*/
#ifndef BOARD_H_
#define BOARD_H_
#include "cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Define the nominal CPU core clock in this board
*/
#define F_CPU (16000000UL)
/**
* @brief Xtimer configuration
* @{
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xff000000)
#define XTIMER_SHIFT_ON_COMPARE (2)
#define XTIMER_BACKOFF (40)
/** @} */
/**
* @name Define the boards stdio
* @{
*/
#define STDIO UART_DEV(0)
#define STDIO_BAUDRATE (115200U)
#define STDIO_RX_BUFSIZE (64U)
/** @} */
/**
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED_RED_PIN 16
#define LED_RED_ON (NRF_GPIO->OUTSET = (1 << LED_RED_PIN))
#define LED_RED_OFF (NRF_GPIO->OUTCLR = (1 << LED_RED_PIN))
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= (1 << LED_RED_PIN))
/* @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif /* BOARD_H_ */
/** @} */
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_TEST_CHROMEDRIVER_TEST_UTIL_H_
#define CHROME_TEST_CHROMEDRIVER_TEST_UTIL_H_
#include <string>
#include "base/basictypes.h"
#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_MACOSX)
#include <Carbon/Carbon.h>
#include "base/mac/scoped_cftyperef.h"
#endif
// Restores the keyboard layout that was active at this object's creation
// when this object goes out of scope.
class RestoreKeyboardLayoutOnDestruct {
public:
RestoreKeyboardLayoutOnDestruct();
~RestoreKeyboardLayoutOnDestruct();
private:
#if defined(OS_WIN)
HKL layout_;
#elif defined(OS_MACOSX)
base::mac::ScopedCFTypeRef<TISInputSourceRef> layout_;
#endif
DISALLOW_COPY_AND_ASSIGN(RestoreKeyboardLayoutOnDestruct);
};
#if defined(OS_WIN)
// Loads and activates the given keyboard layout. |input_locale_identifier|
// is composed of a device and language ID. Returns true on success.
// See http://msdn.microsoft.com/en-us/library/dd318693(v=vs.85).aspx
// Example: "00000409" is the default en-us keyboard layout.
bool SwitchKeyboardLayout(const std::string& input_locale_identifier);
#endif // defined(OS_WIN)
#if defined(OS_MACOSX)
// Selects the input source for the given input source ID. Returns true on
// success.
// Example: "com.apple.keyboardlayout.US" is the default en-us keyboard layout.
bool SwitchKeyboardLayout(const std::string& input_source_id);
#endif // defined(OS_MACOSX)
#endif // CHROME_TEST_CHROMEDRIVER_TEST_UTIL_H_
|
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
#import <IGListKit/IGListDiffable.h>
#import <IGListKit/IGListIndexPathResult.h>
#import <IGListKit/IGListIndexSetResult.h>
NS_ASSUME_NONNULL_BEGIN
/**
An option for how to do comparisons between similar objects.
*/
NS_SWIFT_NAME(ListDiffOption)
typedef NS_ENUM(NSInteger, IGListDiffOption) {
/**
Compare objects using pointer personality.
*/
IGListDiffPointerPersonality,
/**
Compare objects using `-[IGListDiffable isEqualToDiffableObject:]`.
*/
IGListDiffEquality
};
/**
Creates a diff using indexes between two collections.
@param oldArray The old objects to diff against.
@param newArray The new objects.
@param option An option on how to compare objects.
@return A result object containing affected indexes.
*/
NS_SWIFT_NAME(ListDiff(oldArray:newArray:option:))
FOUNDATION_EXTERN IGListIndexSetResult *IGListDiff(NSArray<id<IGListDiffable>> *_Nullable oldArray,
NSArray<id<IGListDiffable>> *_Nullable newArray,
IGListDiffOption option);
/**
Creates a diff using index paths between two collections.
@param fromSection The old section.
@param toSection The new section.
@param oldArray The old objects to diff against.
@param newArray The new objects.
@param option An option on how to compare objects.
@return A result object containing affected indexes.
*/
NS_SWIFT_NAME(ListDiffPaths(fromSection:toSection:oldArray:newArray:option:))
FOUNDATION_EXTERN IGListIndexPathResult *IGListDiffPaths(NSInteger fromSection,
NSInteger toSection,
NSArray<id<IGListDiffable>> *_Nullable oldArray,
NSArray<id<IGListDiffable>> *_Nullable newArray,
IGListDiffOption option);
NS_ASSUME_NONNULL_END
|
/*
* Copyright 2010-present Facebook.
*
* 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 <SenTestingKit/SenTestingKit.h>
@interface FBAppLinkDataTests : SenTestCase
@end
|
/*****************************************************************************
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 middle-level C interface to LAPACK function chetrs_rook
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_chetrs_rook_work( int matrix_layout, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a,
lapack_int lda, const lapack_int* ipiv,
lapack_complex_float* b, lapack_int ldb )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_chetrs_rook( &uplo, &n, &nrhs, a, &lda, ipiv, b, &ldb, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
lapack_int ldb_t = MAX(1,n);
lapack_complex_float* a_t = NULL;
lapack_complex_float* b_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_chetrs_rook_work", info );
return info;
}
if( ldb < nrhs ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_chetrs_rook_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
b_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) *
ldb_t * MAX(1,nrhs) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_che_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_chetrs_rook( &uplo, &n, &nrhs, a_t, &lda_t, ipiv, b_t, &ldb_t,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_chetrs_rook_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_chetrs_rook_work", info );
}
return info;
}
|
/*
* This file is a part of the open source stm32plus library.
* Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk>
* Please see website for licensing terms.
*/
#pragma once
#include "display/graphic/GraphicsLibrary.h"
#include "display/graphic/Serial4WireSpiAccessMode.h"
#include "display/graphic/oled/ssd1306/SSD1306.h"
/*
* Useful typedefs to ease the pain of typing out template parameters
*/
namespace stm32plus {
namespace display {
/*
* SSD1306 interface landscape only
*/
typedef GraphicsLibrary<SSD1306<LANDSCAPE,Serial4WireSpiAccessMode>,Serial4WireSpiAccessMode> SSD1306_Landscape_Serial4;
}
}
|
/*
* Copyright (C) 2010 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 THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_TEXT_RUN_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_TEXT_RUN_H_
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/public/platform/web_string.h"
namespace blink {
class TextRun;
struct WebTextRun {
WebTextRun(const WebString& t, bool is_rtl, bool has_directional_override)
: text(t), rtl(is_rtl), directional_override(has_directional_override) {}
WebTextRun() : rtl(false), directional_override(false) {}
WebString text;
bool rtl;
bool directional_override;
#if INSIDE_BLINK
// The resulting blink::TextRun will refer to the text in this
// struct, so "this" must outlive the WebCore text run.
BLINK_PLATFORM_EXPORT operator TextRun() const;
#endif
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_TEXT_RUN_H_
|
#ifndef ALITRIGGERINPUT_H
#define ALITRIGGERINPUT_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
//
// Class to define a Trigger Input from an specific detector //
//
//
// name description id mask
// Ej:
// AliTriggerInput( "V0_MB_L0", "VO minimum bias", 0x01 );
// AliTriggerInput( "V0_SC_L0", "VO semi central", 0x02 );
// AliTriggerInput( "V0_C_L0", "VO central", 0x04 );
// The name must be globaly unique. Spaces are not allowed.
// As convention should start with detector name then an id
// and the trigger level (L0, L1, L2)
//
// A maximun of 60 inputs trigger are allow.
// So, the id mask should set only bit from the position 1 to 60.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TNamed
#include <TNamed.h>
#endif
#include "AliDAQ.h"
class AliTriggerInput : public TNamed {
public:
AliTriggerInput();
AliTriggerInput( TString name, TString det, UChar_t level, Int_t signature = -1, Char_t number = -1);
AliTriggerInput( TString name, TString det, UChar_t level, Int_t signature, UInt_t indexCTP, UInt_t indexSwitch);
AliTriggerInput( AliTriggerInput & inp );
virtual ~AliTriggerInput() {}
// Setters
void Set() { if (fIsActive) fValue = fMask; }
void Reset() { fValue = 0; }
void Enable() { fIsActive = kTRUE; }
// Getters
Bool_t Status() const { return (Bool_t)fValue; }
ULong64_t GetValue() const { return fValue; }
ULong64_t GetMask() const { return fMask; }
Int_t GetSignature() const { return fSignature; }
TString GetInputName() const { return GetName(); }
TString GetDetector() const { return GetTitle(); }
TString GetModule() const;
Char_t GetDetectorId() const { return fDetectorId; }
UChar_t GetLevel() const { return fLevel; }
Bool_t IsActive() const { return fIsActive; }
UInt_t GetIndexCTP() const;
UInt_t GetIndexSwitch() const { return fIndexSwitch; }
virtual void Print( const Option_t* opt ="" ) const;
static Bool_t fgkIsTriggerDetector[AliDAQ::kNDetectors]; // List of trigger detectors
static const char* fgkCTPDetectorName[AliDAQ::kNDetectors];
protected:
ULong64_t fMask; // Trigger ID mask (1 bit)
ULong64_t fValue; // Trigger Signal (0 = false, > 1 = true = fMask )
Int_t fSignature; // 8 bit signature (internal CTP inputs can have longer signature)
UChar_t fLevel; // L0, L1 or L2
Char_t fDetectorId; // Alice-wide detector id, see AliDAQ class for details
Bool_t fIsActive; // Is trigger input active (during simulation)
UInt_t fIndexCTP; // input position as seen at CTP (fMask=(1<<(fIndexCTP-1)) [1..24]
UInt_t fIndexSwitch; // input position in connector to CTP board (as seen in IR2) [1..48]
// void fDectParameterTable; //-> link to detector parameter table????
ClassDef( AliTriggerInput, 5 ) // Define a Trigger Input
};
#endif
|
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// $Id$
/// \ingroup basic
/// \enum AliMq::Station12Type
/// Enumeration for refering to a MUON station12.
/// It is defined in a different namespace than StationType
/// in order to prevent from unwanted mixing of both types
/// in switch command.
///
/// \author Ivana Hrivnacova; IPN Orsay
#ifndef ALI_MP_STATION_12_TYPE_H
#define ALI_MP_STATION_12_TYPE_H
#include <TString.h>
namespace AliMq {
enum Station12Type
{
kStation1, ///< station 1
kStation2, ///< station 2
kNotSt12 ///< value for all non sector stations
};
/// Return name for given stationType
TString Station12TypeName(AliMq::Station12Type station12Type);
}
#endif //ALI_MP_SECTOR_STATION_TYPE_H
|
#ifndef ALIMDC_H
#define ALIMDC_H
// @(#)alimdc:$Name: $:$Id$
// Author: Fons Rademakers 26/11/99
/* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
//////////////////////////////////////////////////////////////////////////
// //
// AliMDC //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TObject
#include <TObject.h>
#endif
#ifndef ROOT_TObjArray
#include <TObjArray.h>
#endif
#ifndef ROOT_TSysEvtHandler
#include <TSysEvtHandler.h>
#endif
// Forward class declarations
class AliRawEventHeaderBase;
class AliRawEquipmentHeader;
class AliRawData;
class AliRawDB;
class AliTagDB;
class AliRawEventTag;
class AliESDEvent;
#include "AliRawEventV2.h"
#include "AliESDEvent.h"
#include "AliRawDB.h"
#include "AliTagDB.h"
#include "AliRawData.h"
#include "AliRawEventTag.h"
class AliMDC : public TObject {
public:
enum EWriteMode { kLOCAL, kRFIO, kROOTD, kCASTOR, kDEVNULL };
enum EFilterMode { kFilterOff, kFilterTransparent, kFilterOn };
enum EErrorCode { kErrStartEndRun = -1,
kErrHeader = -2,
kErrHeaderSize = -3,
kErrSubHeader = -4,
kErrDataSize = -5,
kErrEquipmentHeader = -6,
kErrEquipment = -7,
kErrFileSize = -8,
kFilterReject = -9,
kErrWriting = -10,
kErrTagFile = -11};
AliMDC(Int_t compress, Bool_t deleteFiles,
EFilterMode filterMode = kFilterTransparent,
Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL,
const char* guidFileFolder = NULL,
Int_t basketsize = 32000, Long64_t autoflush=-5000000LL);
virtual ~AliMDC();
Int_t Open(EWriteMode mode, const char* fileName,
Double_t maxFileSize = 0,
const char* fs1 = NULL, const char* fs2 = NULL);
Int_t ProcessEvent(void* event, Bool_t isIovecArray = kFALSE);
Long64_t GetTotalSize();
Long64_t Close();
Long64_t AutoSave();
Int_t Run(const char* inputFile, Bool_t loop,
EWriteMode mode, Double_t maxFileSize,
const char* fs1 = NULL, const char* fs2 = NULL);
void Stop();
private:
class AliMDCInterruptHandler : public TSignalHandler {
public:
AliMDCInterruptHandler(AliMDC *mdc) : TSignalHandler(kSigUser1, kFALSE), fMDC(mdc) { }
Bool_t Notify() {
Info("Notify", "received a SIGUSR1 signal");
fMDC->Stop();
return kTRUE;
}
private:
AliMDC *fMDC; // alimdc to signal
AliMDCInterruptHandler(const AliMDCInterruptHandler& handler); // Not implemented
AliMDCInterruptHandler& operator=(const AliMDCInterruptHandler& handler); // Not implemented
};
AliRawEventV2 *fEvent; // produced AliRawEvent
AliESDEvent *fESD; // pointer to HLT ESD object
AliRawDB *fRawDB; // raw data DB
AliTagDB *fTagDB; // tag DB
AliRawEventTag *fEventTag; // raw-data event tag object
Int_t fCompress; // compression factor used for raw output DB
Int_t fBasketSize; // root i/o basket size (default = 32000)
Long64_t fAutoFlush; // tree autoflush setting
Bool_t fDeleteFiles; // flag for deletion of files
EFilterMode fFilterMode; // high level filter mode
TObjArray fFilters; // filter algorithms
Bool_t fStop; // stop execution (triggered by SIGUSR1)
Bool_t fIsTagDBCreated; // is tag db already created
Double_t fMaxSizeTagDB;// max size of the tag DB
TString fFileNameTagDB;// tag DB file name
TString fGuidFileFolder; // guid files folder
// Filter names
enum {kNFilters = 1};
static const char* const fgkFilterName[kNFilters];
AliMDC(const AliMDC& mdc);
AliMDC& operator = (const AliMDC& mdc);
Int_t Read(const char *name) { return TObject::Read(name); }
Int_t Read(Int_t fd, void *buffer, Int_t length);
Int_t ReadEquipmentHeader(AliRawEquipmentHeader &header,
Bool_t isSwapped, char*& data);
Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data);
ClassDef(AliMDC,4) // MDC processor
};
#endif
|
/*****************************************************************************
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 middle-level C interface to LAPACK function csycon
* Author: Intel Corporation
* Generated November 2015
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_csycon_work( int matrix_layout, char uplo, lapack_int n,
const lapack_complex_float* a, lapack_int lda,
const lapack_int* ipiv, float anorm,
float* rcond, lapack_complex_float* work )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_csycon( &uplo, &n, a, &lda, ipiv, &anorm, rcond, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
lapack_complex_float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_csycon_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_csy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_csycon( &uplo, &n, a_t, &lda_t, ipiv, &anorm, rcond, work,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_csycon_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_csycon_work", info );
}
return info;
}
|
/*!
@file
@author Generate utility by Albert Semenov
@date 01/2009
@module
*/
#pragma once
#include "../BaseWidget.h"
namespace MyGUI
{
namespace Managed
{
public ref class WidgetCropped abstract : public BaseWidget
{
private:
typedef MyGUI::Widget ThisType;
public:
WidgetCropped() : BaseWidget() { }
internal:
WidgetCropped( MyGUI::Widget* _native ) : BaseWidget(_native) { }
//InsertPoint
public:
property Convert<int>::Type Height
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getHeight() );
}
}
public:
property Convert<int>::Type Width
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getWidth() );
}
}
public:
property Convert<int>::Type Bottom
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getBottom() );
}
}
public:
property Convert<int>::Type Top
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getTop() );
}
}
public:
property Convert<int>::Type Right
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getRight() );
}
}
public:
property Convert<int>::Type Left
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getLeft() );
}
}
public:
property Convert<int>::Type AbsoluteTop
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getAbsoluteTop() );
}
}
public:
property Convert<int>::Type AbsoluteLeft
{
Convert<int>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<int>::To( static_cast<ThisType*>(mNative)->getAbsoluteLeft() );
}
}
public:
property Convert<MyGUI::types::TCoord < int >>::Type AbsoluteCoord
{
Convert<MyGUI::types::TCoord < int >>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<MyGUI::types::TCoord < int >>::To( static_cast<ThisType*>(mNative)->getAbsoluteCoord() );
}
}
public:
property Convert<MyGUI::types::TRect < int >>::Type AbsoluteRect
{
Convert<MyGUI::types::TRect < int >>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<MyGUI::types::TRect < int >>::To( static_cast<ThisType*>(mNative)->getAbsoluteRect() );
}
}
public:
property Convert<const MyGUI::types::TPoint < int > &>::Type AbsolutePosition
{
Convert<const MyGUI::types::TPoint < int > &>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<const MyGUI::types::TPoint < int > &>::To( static_cast<ThisType*>(mNative)->getAbsolutePosition() );
}
}
public:
property Convert<const MyGUI::types::TCoord < int > &>::Type Coord
{
Convert<const MyGUI::types::TCoord < int > &>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<const MyGUI::types::TCoord < int > &>::To( static_cast<ThisType*>(mNative)->getCoord() );
}
void set(Convert<const MyGUI::types::TCoord < int > &>::Type _value)
{
MMYGUI_CHECK_NATIVE(mNative);
static_cast<ThisType*>(mNative)->setCoord( Convert<const MyGUI::types::TCoord < int > &>::From(_value) );
}
}
public:
property Convert<MyGUI::types::TSize < int >>::Type Size
{
Convert<MyGUI::types::TSize < int >>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<MyGUI::types::TSize < int >>::To( static_cast<ThisType*>(mNative)->getSize() );
}
void set(Convert<const MyGUI::types::TSize < int > &>::Type _value)
{
MMYGUI_CHECK_NATIVE(mNative);
static_cast<ThisType*>(mNative)->setSize( Convert<const MyGUI::types::TSize < int > &>::From(_value) );
}
}
public:
property Convert<MyGUI::types::TPoint < int >>::Type Position
{
Convert<MyGUI::types::TPoint < int >>::Type get( )
{
MMYGUI_CHECK_NATIVE(mNative);
return Convert<MyGUI::types::TPoint < int >>::To( static_cast<ThisType*>(mNative)->getPosition() );
}
void set(Convert<const MyGUI::types::TPoint < int > &>::Type _value)
{
MMYGUI_CHECK_NATIVE(mNative);
static_cast<ThisType*>(mNative)->setPosition( Convert<const MyGUI::types::TPoint < int > &>::From(_value) );
}
}
};
} // namespace Managed
} // namespace MyGUI
|
/* Skelix by Xiaoming Mo (xiaoming.mo@skelix.org)
* Licence: GPLv2 */
#ifndef KPRINTF_H
#define KPRINTF_H
#include <scr.h>
enum KP_LEVEL {KPL_DUMP, KPL_PANIC};
void kprintf(enum KP_LEVEL, const char *fmt, ...);
#endif
|
/* mpz_sqrt(root, u) -- Set ROOT to floor(sqrt(U)).
Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2012 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
The GNU MP 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 copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */
#include "gmp.h"
#include "gmp-impl.h"
void
mpz_sqrt (mpz_ptr root, mpz_srcptr op)
{
mp_size_t op_size, root_size;
mp_ptr root_ptr, op_ptr;
op_size = SIZ (op);
if (UNLIKELY (op_size <= 0))
{
if (op_size < 0)
SQRT_OF_NEGATIVE;
SIZ(root) = 0;
return;
}
/* The size of the root is accurate after this simple calculation. */
root_size = (op_size + 1) / 2;
SIZ (root) = root_size;
op_ptr = PTR (op);
if (root == op)
{
/* Allocate temp space for the root, which we then copy to the
shared OP/ROOT variable. */
TMP_DECL;
TMP_MARK;
root_ptr = TMP_ALLOC_LIMBS (root_size);
mpn_sqrtrem (root_ptr, NULL, op_ptr, op_size);
MPN_COPY (op_ptr, root_ptr, root_size);
TMP_FREE;
}
else
{
root_ptr = MPZ_NEWALLOC (root, root_size);
mpn_sqrtrem (root_ptr, NULL, op_ptr, op_size);
}
}
|
/*
Copyright 2018 Jumail Mundekkat
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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x4024
#define DEVICE_VER 0x0001
#define MANUFACTURER PrimeKB
#define PRODUCT Prime_M
#define DESCRIPTION 6x5 Macropad
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 6
/* Keyboard Matrix Assignments */
#define MATRIX_ROW_PINS { C5, B5, B2, D5, D3 }
#define MATRIX_COL_PINS { B3, C7, C6, D2, D1, D0 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
#define BACKLIGHT_PIN B7
/*#define BACKLIGHT_BREATHING*/
#define BACKLIGHT_LEVELS 4
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
|
/* -- isp16.h
*
* Header for detection and initialisation of cdrom interface (only) on
* ISP16 (MAD16, Mozart) sound card.
*
* 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.
*
*/
/* These are the default values */
#define ISP16_CDROM_TYPE "Sanyo"
#define ISP16_CDROM_IO_BASE 0x340
#define ISP16_CDROM_IRQ 0
#define ISP16_CDROM_DMA 0
/* Some (Media)Magic */
/* define types of drive the interface on an ISP16 card may be looking at */
#define ISP16_DRIVE_X 0x00
#define ISP16_SONY 0x02
#define ISP16_PANASONIC0 0x02
#define ISP16_SANYO0 0x02
#define ISP16_MITSUMI 0x04
#define ISP16_PANASONIC1 0x06
#define ISP16_SANYO1 0x06
#define ISP16_DRIVE_NOT_USED 0x08 /* not used */
#define ISP16_DRIVE_SET_MASK 0xF1 /* don't change 0-bit or 4-7-bits*/
/* ...for port */
#define ISP16_DRIVE_SET_PORT 0xF8D
/* set io parameters */
#define ISP16_BASE_340 0x00
#define ISP16_BASE_330 0x40
#define ISP16_BASE_360 0x80
#define ISP16_BASE_320 0xC0
#define ISP16_IRQ_X 0x00
#define ISP16_IRQ_5 0x04 /* shouldn't be used to avoid sound card conflicts */
#define ISP16_IRQ_7 0x08 /* shouldn't be used to avoid sound card conflicts */
#define ISP16_IRQ_3 0x0C
#define ISP16_IRQ_9 0x10
#define ISP16_IRQ_10 0x14
#define ISP16_IRQ_11 0x18
#define ISP16_DMA_X 0x03
#define ISP16_DMA_3 0x00
#define ISP16_DMA_5 0x00
#define ISP16_DMA_6 0x01
#define ISP16_DMA_7 0x02
#define ISP16_IO_SET_MASK 0x20 /* don't change 5-bit */
/* ...for port */
#define ISP16_IO_SET_PORT 0xF8E
/* enable the card */
#define ISP16_C928__ENABLE_PORT 0xF90 /* ISP16 with OPTi 82C928 chip */
#define ISP16_C929__ENABLE_PORT 0xF91 /* ISP16 with OPTi 82C929 chip */
#define ISP16_ENABLE_CDROM 0x80 /* seven bit */
/* the magic stuff */
#define ISP16_CTRL_PORT 0xF8F
#define ISP16_C928__CTRL 0xE2 /* ISP16 with OPTi 82C928 chip */
#define ISP16_C929__CTRL 0xE3 /* ISP16 with OPTi 82C929 chip */
#define ISP16_IO_BASE 0xF8D
#define ISP16_IO_SIZE 5 /* ports used from 0xF8D up to 0xF91 */
void isp16_setup(char *str, int *ints);
int isp16_init(void);
|
/* call_graph.h
Copyright (C) 2000-2017 Free Software Foundation, Inc.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#ifndef call_graph_h
#define call_graph_h
extern void cg_tally (bfd_vma, bfd_vma, unsigned long);
extern void cg_read_rec (FILE *, const char *);
extern void cg_write_arcs (FILE *, const char *);
#endif /* call_graph_h */
|
/* SPU specific support for 32-bit ELF.
Copyright (C) 2006-2017 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
struct spu_elf_params
{
/* Stash various callbacks for --auto-overlay. */
void (*place_spu_section) (asection *, asection *, const char *);
bfd_size_type (*spu_elf_load_ovl_mgr) (void);
FILE *(*spu_elf_open_overlay_script) (void);
void (*spu_elf_relink) (void);
/* Bit 0 set if --auto-overlay.
Bit 1 set if --auto-relink.
Bit 2 set if --overlay-rodata. */
unsigned int auto_overlay : 3;
#define AUTO_OVERLAY 1
#define AUTO_RELINK 2
#define OVERLAY_RODATA 4
/* Type of overlays, enum _ovly_flavour. */
unsigned int ovly_flavour : 1;
unsigned int compact_stub : 1;
/* Set if we should emit symbols for stubs. */
unsigned int emit_stub_syms : 1;
/* Set if we want stubs on calls out of overlay regions to
non-overlay regions. */
unsigned int non_overlay_stubs : 1;
/* Set if lr liveness analysis should be done. */
unsigned int lrlive_analysis : 1;
/* Set if stack size analysis should be done. */
unsigned int stack_analysis : 1;
/* Set if __stack_* syms will be emitted. */
unsigned int emit_stack_syms : 1;
/* Set if non-icache code should be allowed in icache lines. */
unsigned int non_ia_text : 1;
/* Set when the .fixup section should be generated. */
unsigned int emit_fixups : 1;
/* Range of valid addresses for loadable sections. */
bfd_vma local_store_lo;
bfd_vma local_store_hi;
/* Control --auto-overlay feature. */
unsigned int num_lines;
unsigned int line_size;
unsigned int max_branch;
unsigned int auto_overlay_fixed;
unsigned int auto_overlay_reserved;
int extra_stack_space;
};
/* Extra info kept for SPU sections. */
struct spu_elf_stack_info;
struct _spu_elf_section_data
{
struct bfd_elf_section_data elf;
union {
/* Info kept for input sections. */
struct {
/* Stack analysis info kept for this section. */
struct spu_elf_stack_info *stack_info;
} i;
/* Info kept for output sections. */
struct {
/* Non-zero for overlay output sections. */
unsigned int ovl_index;
unsigned int ovl_buf;
} o;
} u;
};
#define spu_elf_section_data(sec) \
((struct _spu_elf_section_data *) elf_section_data (sec))
enum _ovly_flavour
{
ovly_normal,
ovly_soft_icache
};
struct _ovl_stream
{
const void *start;
const void *end;
};
extern void spu_elf_setup (struct bfd_link_info *, struct spu_elf_params *);
extern void spu_elf_plugin (int);
extern bfd_boolean spu_elf_open_builtin_lib (bfd **,
const struct _ovl_stream *);
extern bfd_boolean spu_elf_create_sections (struct bfd_link_info *);
extern bfd_boolean spu_elf_size_sections (bfd *, struct bfd_link_info *);
extern int spu_elf_find_overlays (struct bfd_link_info *);
extern int spu_elf_size_stubs (struct bfd_link_info *);
extern void spu_elf_place_overlay_data (struct bfd_link_info *);
extern asection *spu_elf_check_vma (struct bfd_link_info *);
|
/*
* Copyright (c) 2015, ARM Limited and Contributors. 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 ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __CCI_H__
#define __CCI_H__
/* Slave interface offsets from PERIPHBASE */
#define SLAVE_IFACE6_OFFSET 0x7000
#define SLAVE_IFACE5_OFFSET 0x6000
#define SLAVE_IFACE4_OFFSET 0x5000
#define SLAVE_IFACE3_OFFSET 0x4000
#define SLAVE_IFACE2_OFFSET 0x3000
#define SLAVE_IFACE1_OFFSET 0x2000
#define SLAVE_IFACE0_OFFSET 0x1000
#define SLAVE_IFACE_OFFSET(index) (SLAVE_IFACE0_OFFSET + \
(0x1000 * (index)))
/* Slave interface event and count register offsets from PERIPHBASE */
#define EVENT_SELECT7_OFFSET 0x80000
#define EVENT_SELECT6_OFFSET 0x70000
#define EVENT_SELECT5_OFFSET 0x60000
#define EVENT_SELECT4_OFFSET 0x50000
#define EVENT_SELECT3_OFFSET 0x40000
#define EVENT_SELECT2_OFFSET 0x30000
#define EVENT_SELECT1_OFFSET 0x20000
#define EVENT_SELECT0_OFFSET 0x10000
#define EVENT_OFFSET(index) (EVENT_SELECT0_OFFSET + \
(0x10000 * (index)))
/* Control and ID register offsets */
#define CTRL_OVERRIDE_REG 0x0
#define SECURE_ACCESS_REG 0x8
#define STATUS_REG 0xc
#define IMPRECISE_ERR_REG 0x10
#define PERFMON_CTRL_REG 0x100
#define IFACE_MON_CTRL_REG 0x104
/* Component and peripheral ID registers */
#define PERIPHERAL_ID0 0xFE0
#define PERIPHERAL_ID1 0xFE4
#define PERIPHERAL_ID2 0xFE8
#define PERIPHERAL_ID3 0xFEC
#define PERIPHERAL_ID4 0xFD0
#define PERIPHERAL_ID5 0xFD4
#define PERIPHERAL_ID6 0xFD8
#define PERIPHERAL_ID7 0xFDC
#define COMPONENT_ID0 0xFF0
#define COMPONENT_ID1 0xFF4
#define COMPONENT_ID2 0xFF8
#define COMPONENT_ID3 0xFFC
#define COMPONENT_ID4 0x1000
#define COMPONENT_ID5 0x1004
#define COMPONENT_ID6 0x1008
#define COMPONENT_ID7 0x100C
/* Slave interface register offsets */
#define SNOOP_CTRL_REG 0x0
#define SH_OVERRIDE_REG 0x4
#define READ_CHNL_QOS_VAL_OVERRIDE_REG 0x100
#define WRITE_CHNL_QOS_VAL_OVERRIDE_REG 0x104
#define MAX_OT_REG 0x110
/* Snoop Control register bit definitions */
#define DVM_EN_BIT (1 << 1)
#define SNOOP_EN_BIT (1 << 0)
#define SUPPORT_SNOOPS (1 << 30)
#define SUPPORT_DVM (1 << 31)
/* Status register bit definitions */
#define CHANGE_PENDING_BIT (1 << 0)
/* Event and count register offsets */
#define EVENT_SELECT_REG 0x0
#define EVENT_COUNT_REG 0x4
#define COUNT_CNTRL_REG 0x8
#define COUNT_OVERFLOW_REG 0xC
/* Slave interface monitor registers */
#define INT_MON_REG_SI0 0x90000
#define INT_MON_REG_SI1 0x90004
#define INT_MON_REG_SI2 0x90008
#define INT_MON_REG_SI3 0x9000C
#define INT_MON_REG_SI4 0x90010
#define INT_MON_REG_SI5 0x90014
#define INT_MON_REG_SI6 0x90018
/* Master interface monitor registers */
#define INT_MON_REG_MI0 0x90100
#define INT_MON_REG_MI1 0x90104
#define INT_MON_REG_MI2 0x90108
#define INT_MON_REG_MI3 0x9010c
#define INT_MON_REG_MI4 0x90110
#define INT_MON_REG_MI5 0x90114
#define SLAVE_IF_UNUSED -1
#if ARM_CCI_PRODUCT_ID == 400
#define CCI_SLAVE_INTERFACE_COUNT 5
#elif ARM_CCI_PRODUCT_ID == 500
#define CCI_SLAVE_INTERFACE_COUNT 7
#else
#error "Invalid CCI product or CCI not supported"
#endif
#ifndef __ASSEMBLY__
#include <stdint.h>
/* Function declarations */
/*
* The ARM CCI driver needs the following:
* 1. Base address of the CCI-500/CCI-400
* 2. An array of map between AMBA 4 master ids and ACE/ACE lite slave
* interfaces.
* 3. Size of the array.
*
* SLAVE_IF_UNUSED should be used in the map to represent no AMBA 4 master exists
* for that interface.
*/
void cci_init(uintptr_t cci_base,
const int *map,
unsigned int num_cci_masters);
void cci_enable_snoop_dvm_reqs(unsigned int master_id);
void cci_disable_snoop_dvm_reqs(unsigned int master_id);
#endif /* __ASSEMBLY__ */
#endif /* __CCI_H__ */
|
#import <Foundation/Foundation.h>
@class CDEEntityAutosaveInformation;
// This class is mutable by design
@interface CDEAutosaveInformation : NSObject
#pragma mark - Creating
- (instancetype)initWithDictionaryRepresentation:(NSDictionary *)dictionaryRepresentation;
#pragma mark - Working with the Information
- (CDEEntityAutosaveInformation *)informationForEntityNamed:(NSString *)name; // may return nil
- (void)setInformation:(CDEEntityAutosaveInformation *)information forEntityNamed:(NSString *)name; // if information = nil then information will be removed
#pragma mark - Properties
@property (nonatomic, readonly) id representationForSerialization;
#pragma mark - Equality
- (BOOL)isEqualToAutosaveInformation:(CDEAutosaveInformation *)autosaveInformation;
@end
|
/****************************************************************************
* examples/posix_spawn/filesystem/hello/hello.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
/****************************************************************************
* Public Functions
****************************************************************************/
int main(int argc, char **argv)
{
int i;
/* Mandatory "Hello, world!" */
puts("Getting ready to say \"Hello, world\"\n");
printf("Hello, world!\n");
puts("It has been said.\n");
/* Print arguments */
printf("argc\t= %d\n", argc);
printf("argv\t= 0x%p\n", argv);
for (i = 0; i < argc; i++)
{
printf("argv[%d]\t= ", i);
if (argv[i])
{
printf("(0x%p) \"%s\"\n", argv[i], argv[i]);
}
else
{
printf("NULL?\n");
}
}
printf("argv[%d]\t= 0x%p\n", argc, argv[argc]);
printf("Goodbye, world!\n");
return 0;
}
|
/* -*- c++ -*- */
/*
* Copyright 2019 Ettus Research, a National Instruments Brand.
* Copyright 2020 Free Software Foundation, Inc.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_UHD_RFNOC_TX_STREAMER_H
#define INCLUDED_GR_UHD_RFNOC_TX_STREAMER_H
#include <gnuradio/sync_block.h>
#include <gnuradio/uhd/api.h>
#include <gnuradio/uhd/rfnoc_graph.h>
#include <uhd/stream.hpp>
namespace gr {
namespace uhd {
/*! RFNoC Tx Streamer: Block to handle data flow from a GNU Radio flow graph
* into an RFNoC flow graph.
*
* Use this block for egress from a GNU Radio flow graph. "Tx" is from the
* viewpoint of the GNU Radio flow graph. For example, if the GNU Radio flow
* graph is creating samples to be transmitted to a radio, use this block to
* transport the samples out of GNU Radio.
*
* Note: The output ports of this block can only connect to other RFNoC blocks.
*
* \ingroup ettus
*/
class GR_UHD_API rfnoc_tx_streamer : virtual public gr::sync_block
{
public:
typedef std::shared_ptr<rfnoc_tx_streamer> sptr;
/*!
* \param graph Reference to the graph this block is connected to
* \param num_chans Number of input- and output ports
* \param stream_args These will be passed on to
* rfnoc_graph::create_tx_streamer, see that for details.
* The cpu_format and otw_format parts of these args will
* be used to determine the in- and output signatures of
* this block.
* \param vlen Vector length
*/
static sptr make(rfnoc_graph::sptr graph,
const size_t num_chans,
const ::uhd::stream_args_t& stream_args,
const size_t vlen = 1);
//! Return the unique ID associated with the underlying RFNoC streamer
virtual std::string get_unique_id() const = 0;
};
} // namespace uhd
} // namespace gr
#endif /* INCLUDED_GR_UHD_RFNOC_TX_STREAMER_H */
|
/* voc 2.1.0 [2019/11/01]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
#ifndef extTools__h
#define extTools__h
#include "SYSTEM.h"
import void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len);
import void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len);
import void *extTools__init(void);
#endif // extTools
|
/*
* Copyright 2013 MongoDB, 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.
*/
#ifndef HA_TEST_H
#define HA_TEST_H
#include <bson.h>
#include <mongoc.h>
#include <mongoc-thread-private.h>
BSON_BEGIN_DECLS
typedef struct _ha_sharded_cluster_t ha_sharded_cluster_t;
typedef struct _ha_replica_set_t ha_replica_set_t;
typedef struct _ha_node_t ha_node_t;
struct _ha_sharded_cluster_t
{
char *name;
ha_replica_set_t *replicas[12];
ha_node_t *configs;
ha_node_t *routers;
int next_port;
#ifdef MONGOC_ENABLE_SSL
mongoc_ssl_opt_t *ssl_opt;
#endif
};
struct _ha_replica_set_t
{
char *name;
ha_node_t *nodes;
int next_port;
#ifdef MONGOC_ENABLE_SSL
mongoc_ssl_opt_t *ssl_opt;
#endif
};
#ifdef BSON_OS_WIN32
typedef struct {
bool is_alive;
HANDLE proc;
HANDLE thread;
} bson_ha_pid_t;
#else
typedef pid_t bson_ha_pid_t;
#endif
struct _ha_node_t
{
ha_node_t *next;
char *name;
char *repl_set;
char *dbpath;
char *configopt;
bool is_arbiter : 1;
bool is_config : 1;
bool is_router : 1;
bson_ha_pid_t pid;
uint16_t port;
#ifdef MONGOC_ENABLE_SSL
mongoc_ssl_opt_t *ssl_opt;
#endif
};
ha_replica_set_t *ha_replica_set_new (const char *name);
ha_node_t *ha_replica_set_add_arbiter (ha_replica_set_t *replica_set,
const char *name);
ha_node_t *ha_replica_set_add_replica (ha_replica_set_t *replica_set,
const char *name);
mongoc_client_t *ha_replica_set_create_client (ha_replica_set_t *replica_set);
void ha_replica_set_start (ha_replica_set_t *replica_set);
void ha_replica_set_shutdown (ha_replica_set_t *replica_set);
void ha_replica_set_destroy (ha_replica_set_t *replica_set);
void ha_replica_set_wait_for_healthy (ha_replica_set_t *replica_set);
#ifdef MONGOC_ENABLE_SSL
void ha_replica_set_ssl (ha_replica_set_t *repl_set,
mongoc_ssl_opt_t *opt);
#endif
void ha_node_kill (ha_node_t *node);
void ha_node_restart (ha_node_t *node);
ha_sharded_cluster_t *ha_sharded_cluster_new (const char *name);
void ha_sharded_cluster_start (ha_sharded_cluster_t *cluster);
void ha_sharded_cluster_wait_for_healthy (ha_sharded_cluster_t *cluster);
ha_node_t * ha_sharded_cluster_add_config (ha_sharded_cluster_t *cluster,
const char *name);
ha_node_t * ha_sharded_cluster_add_router (ha_sharded_cluster_t *cluster,
const char *name);
void ha_sharded_cluster_add_replica_set (ha_sharded_cluster_t *cluster,
ha_replica_set_t *replica_set);
void ha_sharded_cluster_shutdown (ha_sharded_cluster_t *cluster);
mongoc_client_t *ha_sharded_cluster_get_client (ha_sharded_cluster_t *cluster);
BSON_END_DECLS
#endif /* HA_TEST_H */
|
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <math.h>
#include <stdlib.h>
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/hostdevice.h"
namespace paddle {
namespace operators {
namespace math {
template <typename T, bool same_row>
struct CosSimFunctor {
CosSimFunctor(const T* x, const T* y, T* x_norm, T* y_norm, T* z, int cols)
: x_norm_(x_norm),
y_norm_(y_norm),
x_(x),
y_(y),
z_(z),
cols_(static_cast<size_t>(cols)) {}
inline HOSTDEVICE void operator()(size_t row_id) const {
auto* x = x_ + cols_ * row_id;
T xx = 0, xy = 0, yy = 0;
if (same_row) {
auto* y = y_ + cols_ * row_id;
T tep_x, tep_y;
for (size_t i = 0; i < cols_; ++i) {
tep_x = x[i];
tep_y = y[i];
xx += tep_x * tep_x;
yy += tep_y * tep_y;
xy += tep_x * tep_y;
}
xx = sqrt(xx);
yy = sqrt(yy);
y_norm_[row_id] = yy;
x_norm_[row_id] = xx;
z_[row_id] = xy / (xx * yy);
} else { // This can be wrote in a better way.
T tep_x, tep_y;
for (size_t i = 0; i < cols_; ++i) {
tep_x = x[i];
tep_y = y_[i];
xx += tep_x * tep_x;
yy += tep_y * tep_y;
xy += tep_x * tep_y;
}
xx = sqrt(xx);
yy = sqrt(yy);
if (row_id == 0) y_norm_[0] = yy;
x_norm_[row_id] = xx;
z_[row_id] = xy / (xx * yy);
}
}
T* x_norm_;
T* y_norm_;
const T* x_;
const T* y_;
T* z_;
const size_t cols_;
};
template <typename T>
struct CosSimGradFunctor {
CosSimGradFunctor(const T* x_norm, const T* y_norm, const T* x, const T* y,
const T* z, const T* dz, T* dx, int cols)
: x_norm_(x_norm),
y_norm_(y_norm),
x_(x),
y_(y),
z_(z),
dz_(dz),
dx_(dx),
cols_(static_cast<size_t>(cols)) {}
inline HOSTDEVICE void operator()(size_t row_id) const {
auto x_norm_square = x_norm_[row_id] * x_norm_[row_id];
auto xy_norm_prod = x_norm_[row_id] * y_norm_[row_id];
auto dz = dz_[row_id];
auto z = z_[row_id];
auto* dx = dx_ + cols_ * row_id;
auto* x = x_ + cols_ * row_id;
auto* y = y_ + cols_ * row_id;
auto reciprocal_xy_norm_prod = 1 / xy_norm_prod;
auto reciprocal_x_norm_square = 1 / x_norm_square;
for (size_t i = 0; i < cols_; ++i) {
dx[i] = dz * (y[i] * reciprocal_xy_norm_prod -
z * x[i] * reciprocal_x_norm_square);
}
}
const T* x_norm_;
const T* y_norm_;
const T* x_;
const T* y_;
const T* z_;
const T* dz_;
T* dx_;
const size_t cols_;
};
template <typename T>
struct CosSimDxFunctor {
CosSimDxFunctor(const T* x_norm, const T* y_norm, const T* x, const T* y,
const T* z, const T* dz, T* dx, int cols)
: x_norm_(x_norm),
y_norm_(y_norm),
x_(x),
y_(y),
z_(z),
dz_(dz),
dx_(dx),
cols_(static_cast<size_t>(cols)) {}
inline HOSTDEVICE void operator()(size_t row_id) const {
auto xy_norm_prod = x_norm_[row_id] * y_norm_[0];
auto dz = dz_[row_id];
auto z = z_[row_id];
auto* x = x_ + cols_ * row_id;
auto reciprocal_xy_norm_prod = 1 / xy_norm_prod;
auto x_norm_square = x_norm_[row_id] * x_norm_[row_id];
auto* dx = dx_ + cols_ * row_id;
auto reciprocal_x_norm_square = 1 / x_norm_square;
for (size_t i = 0; i < cols_; ++i) {
dx[i] = dz * (y_[i] * reciprocal_xy_norm_prod -
z * x[i] * reciprocal_x_norm_square);
}
}
const T* x_norm_;
const T* y_norm_;
const T* x_;
const T* y_;
const T* z_;
const T* dz_;
T* dx_;
const size_t cols_;
};
template <typename DeviceContext, typename T>
struct CosSimDyFunctor {
void operator()(const DeviceContext& ctx, const T* x_norm, const T* y_norm,
const T* x, const T* y, const T* z, const T* dz,
const size_t rows, const size_t cols, T* dy) const;
};
} // namespace math
} // namespace operators
} // namespace paddle
|
#ifndef AliFemtoVertexMultAnalysisOnlyMixP1_hh
#define AliFemtoVertexMultAnalysisOnlyMixP1_hh
//===============================================================================//
// dongfang.wang@cern.ch
// AliFemtoVertexMultAnalysisOnlyMixP1: Making pool which keep update/save
// as long as the first particle has been found in this event!
// Only difference with AliFemtoVertexMultAnalysis.cxx in line 217.
//===============================================================================//
#include "AliFemtoSimpleAnalysisOnlyMixP1.h"
class AliFemtoVertexMultAnalysisOnlyMixP1 : public AliFemtoSimpleAnalysisOnlyMixP1{
public:
AliFemtoVertexMultAnalysisOnlyMixP1(UInt_t binsVertex=10,
Double_t minVertex=-100.0,
Double_t maxVertex=+100.0,
UInt_t binsMult=10,
Double_t minMult=-1.0e9,
Double_t maxMult=+1.0e9);
AliFemtoVertexMultAnalysisOnlyMixP1(const AliFemtoVertexMultAnalysisOnlyMixP1 &OriAnalysis);
AliFemtoVertexMultAnalysisOnlyMixP1& operator =(const AliFemtoVertexMultAnalysisOnlyMixP1 &OriAnalysis);
virtual ~AliFemtoVertexMultAnalysisOnlyMixP1();
virtual void ProcessEvent(const AliFemtoEvent* HbtEventToProcess);
virtual AliFemtoString Report();
virtual TList* ListSettings();
virtual UInt_t OverflowVertexZ() const; ///< Number of events above vertex-z range
virtual UInt_t UnderflowVertexZ() const; ///< Number of events below vertex-z range
virtual UInt_t OverflowMult() const; ///< Number of events above multiplicity range
virtual UInt_t UnderflowMult() const; ///< Number of events below multiplicity range
protected:
Double_t fVertexZ[2]; ///< min/max z-vertex position allowed to be processed
UInt_t fVertexZBins; ///< number of VERTEX mixing bins in z-vertex in EventMixing Buffer
UInt_t fOverFlowVertexZ; ///< number of events encountered which had too large z-vertex
UInt_t fUnderFlowVertexZ; ///< number of events encountered which had too small z-vertex
Double_t fMult[2]; ///< min/max multiplicity allowed for event to be processed
UInt_t fMultBins; ///< number of MULTIPLICITY mixing bins in z-vertex in EventMixing Buffer
UInt_t fOverFlowMult; ///< number of events encountered which had too large multiplicity
UInt_t fUnderFlowMult; ///< number of events encountered which had too small multiplicity
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
#ifdef __ROOT__
/// \cond CLASSIMP
ClassDef(AliFemtoVertexMultAnalysisOnlyMixP1, 1);
/// \endcond
#endif
};
inline UInt_t AliFemtoVertexMultAnalysisOnlyMixP1::OverflowVertexZ() const
{
return fOverFlowVertexZ;
}
inline UInt_t AliFemtoVertexMultAnalysisOnlyMixP1::UnderflowVertexZ() const
{
return fUnderFlowVertexZ;
}
inline UInt_t AliFemtoVertexMultAnalysisOnlyMixP1::OverflowMult() const
{
return fOverFlowMult;
}
inline UInt_t AliFemtoVertexMultAnalysisOnlyMixP1::UnderflowMult() const
{
return fUnderFlowMult;
}
#endif
|
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_REMOVE_FORMAT_COMMAND_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_REMOVE_FORMAT_COMMAND_H_
#include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h"
namespace blink {
class RemoveFormatCommand final : public CompositeEditCommand {
public:
explicit RemoveFormatCommand(Document&);
private:
void DoApply(EditingState*) override;
InputEvent::InputType GetInputType() const override;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_REMOVE_FORMAT_COMMAND_H_
|
/*
* libEtPan! -- a mail stuff library
*
* Copyright (C) 2001, 2005 - DINH Viet Hoa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the libEtPan! project nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* $Id: mailfolder.c,v 1.6 2006/05/22 13:39:40 hoa Exp $
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "mailfolder.h"
#include <string.h>
#include "maildriver.h"
#include "mailstorage.h"
LIBETPAN_EXPORT
int mailfolder_noop(struct mailfolder * folder)
{
return mailsession_noop(folder->fld_session);
}
LIBETPAN_EXPORT
int mailfolder_check(struct mailfolder * folder)
{
return mailsession_check_folder(folder->fld_session);
}
LIBETPAN_EXPORT
int mailfolder_expunge(struct mailfolder * folder)
{
return mailsession_expunge_folder(folder->fld_session);
}
LIBETPAN_EXPORT
int mailfolder_status(struct mailfolder * folder,
uint32_t * result_messages, uint32_t * result_recent,
uint32_t * result_unseen)
{
return mailsession_status_folder(folder->fld_session,
folder->fld_pathname, result_messages,
result_recent, result_unseen);
}
LIBETPAN_EXPORT
int mailfolder_append_message(struct mailfolder * folder,
char * message, size_t size)
{
return mailsession_append_message(folder->fld_session, message, size);
}
LIBETPAN_EXPORT
int mailfolder_append_message_flags(struct mailfolder * folder,
char * message, size_t size, struct mail_flags * flags)
{
return mailsession_append_message_flags(folder->fld_session, message,
size, flags);
}
LIBETPAN_EXPORT
int mailfolder_get_messages_list(struct mailfolder * folder,
struct mailmessage_list ** result)
{
int r;
struct mailmessage_list * msg_list;
unsigned int i;
struct mailstorage * storage;
/* workaround for POP3 case - begin */
storage = folder->fld_storage;
if (strcmp(storage->sto_driver->sto_name, "pop3") == 0) {
mailstorage_disconnect(storage);
r = mailstorage_connect(storage);
if (r != MAIL_NO_ERROR)
return r;
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR)
return r;
}
/* workaround for POP3 case - begin */
r = mailsession_get_messages_list(folder->fld_session, &msg_list);
if (r != MAIL_NO_ERROR)
return r;
for(i = 0 ; i < carray_count(msg_list->msg_tab) ; i ++) {
mailmessage * msg;
msg = carray_get(msg_list->msg_tab, i);
msg->msg_folder = folder;
}
* result = msg_list;
return MAIL_NO_ERROR;
}
LIBETPAN_EXPORT
int mailfolder_get_envelopes_list(struct mailfolder * folder,
struct mailmessage_list * result)
{
return mailsession_get_envelopes_list(folder->fld_session, result);
}
LIBETPAN_EXPORT
int mailfolder_get_message(struct mailfolder * folder,
uint32_t num, mailmessage ** result)
{
mailmessage * msg;
int r;
r = mailsession_get_message(folder->fld_session, num, &msg);
if (r != MAIL_NO_ERROR)
return r;
msg->msg_folder = folder;
* result = msg;
return MAIL_NO_ERROR;
}
LIBETPAN_EXPORT
int mailfolder_get_message_by_uid(struct mailfolder * folder,
const char * uid, mailmessage ** result)
{
mailmessage * msg;
int r;
r = mailsession_get_message_by_uid(folder->fld_session, uid, &msg);
if (r != MAIL_NO_ERROR)
return r;
msg->msg_folder = folder;
* result = msg;
return MAIL_NO_ERROR;
}
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_WM_CORE_CURSOR_MANAGER_H_
#define UI_WM_CORE_CURSOR_MANAGER_H_
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/base/cursor/cursor.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/wm/core/native_cursor_manager_delegate.h"
#include "ui/wm/wm_export.h"
namespace gfx {
class Display;
}
namespace ui {
class KeyEvent;
}
namespace wm {
namespace internal {
class CursorState;
}
class NativeCursorManager;
// This class receives requests to change cursor properties, as well as
// requests to queue any further changes until a later time. It sends changes
// to the NativeCursorManager, which communicates back to us when these changes
// were made through the NativeCursorManagerDelegate interface.
class WM_EXPORT CursorManager : public aura::client::CursorClient,
public NativeCursorManagerDelegate {
public:
explicit CursorManager(scoped_ptr<NativeCursorManager> delegate);
~CursorManager() override;
// Overridden from aura::client::CursorClient:
void SetCursor(gfx::NativeCursor) override;
gfx::NativeCursor GetCursor() const override;
void ShowCursor() override;
void HideCursor() override;
bool IsCursorVisible() const override;
void SetCursorSet(ui::CursorSetType cursor_set) override;
ui::CursorSetType GetCursorSet() const override;
void EnableMouseEvents() override;
void DisableMouseEvents() override;
bool IsMouseEventsEnabled() const override;
void SetDisplay(const gfx::Display& display) override;
void LockCursor() override;
void UnlockCursor() override;
bool IsCursorLocked() const override;
void AddObserver(aura::client::CursorClientObserver* observer) override;
void RemoveObserver(aura::client::CursorClientObserver* observer) override;
bool ShouldHideCursorOnKeyEvent(const ui::KeyEvent& event) const override;
private:
// Overridden from NativeCursorManagerDelegate:
void CommitCursor(gfx::NativeCursor cursor) override;
void CommitVisibility(bool visible) override;
void CommitCursorSet(ui::CursorSetType cursor_set) override;
void CommitMouseEventsEnabled(bool enabled) override;
scoped_ptr<NativeCursorManager> delegate_;
// Number of times LockCursor() has been invoked without a corresponding
// UnlockCursor().
int cursor_lock_count_;
// The current state of the cursor.
scoped_ptr<internal::CursorState> current_state_;
// The cursor state to restore when the cursor is unlocked.
scoped_ptr<internal::CursorState> state_on_unlock_;
base::ObserverList<aura::client::CursorClientObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(CursorManager);
};
} // namespace wm
#endif // UI_WM_CORE_CURSOR_MANAGER_H_
|
// Copyright 2020 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 MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_METRICS_H_
#define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_METRICS_H_
#include "base/containers/span.h"
#include "media/capture/video/video_capture_device_info.h"
namespace media {
CAPTURE_EXPORT
void LogCaptureDeviceMetrics(
base::span<const media::VideoCaptureDeviceInfo> devices_info);
} // namespace media
#endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_METRICS_H_
|
/******************************************************************************
* Filename: rf_ble_mailbox.h
* Revised: 2017-08-28 10:10:48 +0200 (Mon, 28 Aug 2017)
* Revision: 17894
*
* Description: Definitions for BLE interface
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1) Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3) Neither the name of the ORGANIZATION nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL 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 _BLE_MAILBOX_H
#define _BLE_MAILBOX_H
/// \name Radio operation status
///@{
/// \name Operation finished normally
///@{
#define BLE_DONE_OK 0x1400 ///< Operation ended normally
#define BLE_DONE_RXTIMEOUT 0x1401 ///< Timeout of first Rx of slave operation or end of scan window
#define BLE_DONE_NOSYNC 0x1402 ///< Timeout of subsequent Rx
#define BLE_DONE_RXERR 0x1403 ///< Operation ended because of receive error (CRC or other)
#define BLE_DONE_CONNECT 0x1404 ///< CONNECT_REQ received or transmitted
#define BLE_DONE_MAXNACK 0x1405 ///< Maximum number of retransmissions exceeded
#define BLE_DONE_ENDED 0x1406 ///< Operation stopped after end trigger
#define BLE_DONE_ABORT 0x1407 ///< Operation aborted by command
#define BLE_DONE_STOPPED 0x1408 ///< Operation stopped after stop command
///@}
/// \name Operation finished with error
///@{
#define BLE_ERROR_PAR 0x1800 ///< Illegal parameter
#define BLE_ERROR_RXBUF 0x1801 ///< No available Rx buffer (Advertiser, Scanner, Initiator)
#define BLE_ERROR_NO_SETUP 0x1802 ///< Operation using Rx or Tx attemted when not in BLE mode
#define BLE_ERROR_NO_FS 0x1803 ///< Operation using Rx or Tx attemted without frequency synth configured
#define BLE_ERROR_SYNTH_PROG 0x1804 ///< Synthesizer programming failed to complete on time
#define BLE_ERROR_RXOVF 0x1805 ///< Receiver overflowed during operation
#define BLE_ERROR_TXUNF 0x1806 ///< Transmitter underflowed during operation
///@}
///@}
#endif
|
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Abhishek Malik <abhishek.malik@intel.com>
* Copyright (c) 2016 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "moisture.h"
moisture_context moisture_init(int pin) {
// make sure MRAA is initialized
int mraa_rv;
if ((mraa_rv = mraa_init()) != MRAA_SUCCESS)
{
printf("%s: mraa_init() failed (%d).\n", __FUNCTION__, mraa_rv);
return NULL;
}
moisture_context dev =
(moisture_context) malloc(sizeof(struct _moisture_context));
if (dev == NULL) {
printf("Unable to allocate memory for device context\n");
return NULL;
}
dev->analog_pin = pin;
dev->aio = mraa_aio_init(dev->analog_pin);
if (dev->aio == NULL) {
printf("mraa_aio_init() failed.\n");
free(dev);
return NULL;
}
return dev;
}
void moisture_close(moisture_context dev) {
mraa_aio_close(dev->aio);
free(dev);
}
upm_result_t moisture_get_moisture(moisture_context dev,
int* moisture) {
*moisture = mraa_aio_read(dev->aio);
return UPM_SUCCESS;
}
|
#ifndef HMAC_CRAM_MD5_H
#define HMAC_CRAM_MD5_H
#include "hmac.h"
#define CRAM_MD5_CONTEXTLEN 32
void hmac_md5_get_cram_context(struct hmac_context *ctx,
unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
void hmac_md5_set_cram_context(struct hmac_context *ctx,
const unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
#endif
|
/* { dg-do compile } */
/* { dg-options "-O2 -march=haswell -mno-stackrealign" } */
extern int numBins;
extern int binOffst;
extern int binWidth;
extern int Trybin;
void foo (int);
void bar (int aleft, int axcenter)
{
int a1LoBin = (((Trybin=((axcenter + aleft)-binOffst)/binWidth)<0)
? 0 : ((Trybin>numBins) ? numBins : Trybin));
foo (a1LoBin);
}
/* We do not want the RA to spill %esi for it's dual-use but using
pminsd is OK. */
/* { dg-final { scan-assembler-not "rsp" { target { ! { ia32 } } } } } */
/* { dg-final { scan-assembler "pminsd" } } */
|
/*
* Copyright (c) 2010-2014, Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Macros to abstract toolchain specific capabilities
*
* This file contains various macros to abstract compiler capabilities that
* utilize toolchain specific attributes and/or pragmas.
*/
#ifndef _TOOLCHAIN_H
#define _TOOLCHAIN_H
#if defined(__XCC__)
#include <toolchain/xcc.h>
#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__))
#include <toolchain/gcc.h>
#else
#include <toolchain/other.h>
#endif
#endif /* _TOOLCHAIN_H */
|
#pragma once
#include "BlockHandler.h"
#include "MetaRotator.h"
#include "Item.h"
#include "ChunkInterface.h"
class cPlayer;
class cWorldInterface;
class cBlockBedHandler :
public cMetaRotator<cBlockHandler, 0x3, 0x02, 0x03, 0x00, 0x01, true>
{
public:
cBlockBedHandler(BLOCKTYPE a_BlockType)
: cMetaRotator<cBlockHandler, 0x3, 0x02, 0x03, 0x00, 0x01, true>(a_BlockType)
{
}
virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override;
virtual bool IsUseable(void) override
{
return true;
}
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
// Reset meta to zero
a_Pickups.push_back(cItem(E_ITEM_BED, 1, 0));
}
// Bed specific helper functions
static NIBBLETYPE RotationToMetaData(double a_Rotation)
{
a_Rotation += 180 + (180 / 4); // So its not aligned with axis
if (a_Rotation > 360)
{
a_Rotation -= 360;
}
a_Rotation = (a_Rotation / 360) * 4;
return (static_cast<NIBBLETYPE>(a_Rotation + 2)) % 4;
}
static Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData)
{
switch (a_MetaData)
{
case 0: return Vector3i(0, 0, 1);
case 1: return Vector3i(-1, 0, 0);
case 2: return Vector3i(0, 0, -1);
case 3: return Vector3i(1, 0, 0);
}
return Vector3i();
}
static void SetBedOccupationState(cChunkInterface & a_ChunkInterface, const Vector3i & a_BedPosition, bool a_IsOccupied)
{
auto Meta = a_ChunkInterface.GetBlockMeta(a_BedPosition.x, a_BedPosition.y, a_BedPosition.z);
if (a_IsOccupied)
{
Meta |= 0x04; // Where 0x4 = occupied bit
}
else
{
Meta &= 0x0b; // Clear the "occupied" bit of the bed's block
}
a_ChunkInterface.SetBlockMeta(a_BedPosition.x, a_BedPosition.y, a_BedPosition.z, Meta);
}
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);
return 28;
}
} ;
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
#define CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/trace_event/trace_event.h"
#include "cc/debug/traced_value.h"
namespace cc {
class DisplayItemList;
class TracedDisplayItemList
: public base::trace_event::ConvertableToTraceFormat {
public:
static std::unique_ptr<ConvertableToTraceFormat> AsTraceableDisplayItemList(
scoped_refptr<const DisplayItemList> list,
bool include_items) {
return std::unique_ptr<ConvertableToTraceFormat>(
new TracedDisplayItemList(list, include_items));
}
void AppendAsTraceFormat(std::string* out) const override;
private:
explicit TracedDisplayItemList(scoped_refptr<const DisplayItemList> list,
bool include_items);
~TracedDisplayItemList() override;
scoped_refptr<const DisplayItemList> display_item_list_;
bool include_items_;
DISALLOW_COPY_AND_ASSIGN(TracedDisplayItemList);
};
} // namespace cc
#endif // CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CYCLE_SUPER_H_
#define CYCLE_SUPER_H_
#include "heap/stubs.h"
namespace WebCore {
class D;
// This contains a leaking cycle:
// D -per-> C -sup-> B -sup-> A -ref-> D
class A : public GarbageCollectedFinalized<A> {
public:
virtual void trace(Visitor*);
private:
RefPtr<D> m_d;
};
class B : public A {
public:
virtual void trace(Visitor*);
};
class C : public B {
public:
virtual void trace(Visitor*);
};
class D : public RefCounted<C> {
private:
Persistent<C> m_c;
};
}
#endif
|
/*
* Copyright © 2013 Raspberry Pi Foundation
*
* 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 (including the
* next paragraph) 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 RPI_RENDERER_H
#define RPI_RENDERER_H
struct rpi_renderer_parameters {
int single_buffer;
int opaque_regions;
};
int
rpi_renderer_create(struct weston_compositor *compositor,
const struct rpi_renderer_parameters *params);
int
rpi_renderer_output_create(struct weston_output *base,
DISPMANX_DISPLAY_HANDLE_T display);
void
rpi_renderer_output_destroy(struct weston_output *base);
void
rpi_renderer_set_update_handle(struct weston_output *base,
DISPMANX_UPDATE_HANDLE_T handle);
void
rpi_renderer_finish_frame(struct weston_output *base);
#endif /* RPI_RENDERER_H */
|
/*
* Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __FSP_VPD_H__
#define __FSP_VPD_H__
/* IvyBridge FSP does not support VPD/UPD */
#endif
|
#pragma once
#include <string>
#include <boost/unordered_map.hpp>
#include "module.h"
#include "localscope.h"
class Builtins
{
public:
typedef boost::unordered_map<std::string, class AbstractFunction*> FunctionContainer;
typedef boost::unordered_map<std::string, class AbstractModule*> ModuleContainer;
static Builtins *instance(bool erase = false);
static void init(const char *name, class AbstractModule *module);
static void init(const char *name, class AbstractFunction *function);
void initialize();
std::string isDeprecated(const std::string &name);
const LocalScope &getGlobalScope() { return this->globalscope; }
private:
Builtins();
~Builtins();
LocalScope globalscope;
boost::unordered_map<std::string, std::string> deprecations;
};
|
#ifndef __gtksourceview_marshal_MARSHAL_H__
#define __gtksourceview_marshal_MARSHAL_H__
#include <glib-object.h>
G_BEGIN_DECLS
/* VOID:VOID (gtksourceview-marshal.list:1) */
#define gtksourceview_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID
/* VOID:BOOLEAN (gtksourceview-marshal.list:2) */
#define gtksourceview_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN
/* VOID:BOXED (gtksourceview-marshal.list:3) */
#define gtksourceview_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED
/* VOID:BOXED,BOXED (gtksourceview-marshal.list:4) */
extern void gtksourceview_marshal_VOID__BOXED_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data);
/* VOID:STRING (gtksourceview-marshal.list:5) */
#define gtksourceview_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING
G_END_DECLS
#endif /* __gtksourceview_marshal_MARSHAL_H__ */
|
/*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <_lfs_64.h>
#include <sys/syscall.h>
#ifdef __NR_getdents64
#include <assert.h>
#include <errno.h>
#include <dirent.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
#include <bits/wordsize.h>
#include <bits/uClibc_alloc.h>
struct kernel_dirent64
{
uint64_t d_ino;
int64_t d_off;
unsigned short d_reclen;
unsigned char d_type;
char d_name[256];
};
# define __NR___syscall_getdents64 __NR_getdents64
static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count)
ssize_t __getdents64 (int fd, char *buf, size_t nbytes)
{
struct dirent64 *dp;
off64_t last_offset = -1;
ssize_t retval;
size_t red_nbytes;
struct kernel_dirent64 *skdp, *kdp;
const size_t size_diff = (offsetof (struct dirent64, d_name)
- offsetof (struct kernel_dirent64, d_name));
red_nbytes = MIN (nbytes - ((nbytes /
(offsetof (struct dirent64, d_name) + 14)) * size_diff),
nbytes - size_diff);
dp = (struct dirent64 *) buf;
skdp = kdp = stack_heap_alloc(red_nbytes);
retval = __syscall_getdents64(fd, (unsigned char *)kdp, red_nbytes);
if (retval == -1) {
stack_heap_free(skdp);
return -1;
}
while ((char *) kdp < (char *) skdp + retval) {
const size_t alignment = __alignof__ (struct dirent64);
/* Since kdp->d_reclen is already aligned for the kernel structure
this may compute a value that is bigger than necessary. */
size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
& ~(alignment - 1));
if ((char *) dp + new_reclen > buf + nbytes) {
/* Our heuristic failed. We read too many entries. Reset
the stream. */
assert (last_offset != -1);
lseek64(fd, last_offset, SEEK_SET);
if ((char *) dp == buf) {
/* The buffer the user passed in is too small to hold even
one entry. */
stack_heap_free(skdp);
__set_errno (EINVAL);
return -1;
}
break;
}
last_offset = kdp->d_off;
dp->d_ino = kdp->d_ino;
dp->d_off = kdp->d_off;
dp->d_reclen = new_reclen;
dp->d_type = kdp->d_type;
memcpy (dp->d_name, kdp->d_name,
kdp->d_reclen - offsetof (struct kernel_dirent64, d_name));
dp = (struct dirent64 *) ((char *) dp + new_reclen);
kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen);
}
stack_heap_free(skdp);
return (char *) dp - buf;
}
#if __WORDSIZE == 64 || (defined __UCLIBC_HAS_LFS__ && !defined __NR_getdents)
/* since getdents doesnt give us d_type but getdents64 does, try and
* use getdents64 as much as possible */
strong_alias(__getdents64,__getdents)
#endif
#endif
|
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_register.h
//
// Description: Allows the caller to specify user-defined callback functions
// to open files DevIL does not support, to parse files
// differently, or anything else a person can think up.
//
//-----------------------------------------------------------------------------
#ifndef REGISTER_H
#define REGISTER_H
#include "il_internal.h"
typedef struct iFormatL
{
ILstring Ext;
IL_LOADPROC Load;
struct iFormatL *Next;
} iFormatL;
typedef struct iFormatS
{
ILstring Ext;
IL_SAVEPROC Save;
struct iFormatS *Next;
} iFormatS;
#define I_LOAD_FUNC 0
#define I_SAVE_FUNC 1
ILboolean iRegisterLoad(ILconst_string FileName);
ILboolean iRegisterSave(ILconst_string FileName);
#endif//REGISTER_H
|
/*
zip_unchange.c -- undo changes to file in zip archive
Copyright (C) 1999-2019 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
*/
#include <stdlib.h>
#include "zipint.h"
ZIP_EXTERN int
zip_unchange(zip_t *za, zip_uint64_t idx) {
return _zip_unchange(za, idx, 0);
}
int
_zip_unchange(zip_t *za, zip_uint64_t idx, int allow_duplicates) {
zip_int64_t i;
const char *orig_name, *changed_name;
if (idx >= za->nentry) {
zip_error_set(&za->error, ZIP_ER_INVAL, 0);
return -1;
}
if (!allow_duplicates && za->entry[idx].changes && (za->entry[idx].changes->changed & ZIP_DIRENT_FILENAME)) {
if (za->entry[idx].orig != NULL) {
if ((orig_name = _zip_get_name(za, idx, ZIP_FL_UNCHANGED, &za->error)) == NULL) {
return -1;
}
i = _zip_name_locate(za, orig_name, 0, NULL);
if (i >= 0 && (zip_uint64_t)i != idx) {
zip_error_set(&za->error, ZIP_ER_EXISTS, 0);
return -1;
}
}
else {
orig_name = NULL;
}
if ((changed_name = _zip_get_name(za, idx, 0, &za->error)) == NULL) {
return -1;
}
if (orig_name) {
if (_zip_hash_add(za->names, (const zip_uint8_t *)orig_name, idx, 0, &za->error) == false) {
return -1;
}
}
if (_zip_hash_delete(za->names, (const zip_uint8_t *)changed_name, &za->error) == false) {
_zip_hash_delete(za->names, (const zip_uint8_t *)orig_name, NULL);
return -1;
}
}
_zip_dirent_free(za->entry[idx].changes);
za->entry[idx].changes = NULL;
_zip_unchange_data(za->entry + idx);
return 0;
}
|
/*
zip_file_get_comment.c -- get file comment
Copyright (C) 2006-2019 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
*/
#include "zipint.h"
/* lenp is 32 bit because converted comment can be longer than ZIP_UINT16_MAX */
ZIP_EXTERN const char *
zip_file_get_comment(zip_t *za, zip_uint64_t idx, zip_uint32_t *lenp, zip_flags_t flags) {
zip_dirent_t *de;
zip_uint32_t len;
const zip_uint8_t *str;
if ((de = _zip_get_dirent(za, idx, flags, NULL)) == NULL)
return NULL;
if ((str = _zip_string_get(de->comment, &len, flags, &za->error)) == NULL)
return NULL;
if (lenp)
*lenp = len;
return (const char *)str;
}
|
//
// GBDeviceInfo_Subclass.h
// GBDeviceInfo
//
// Created by Luka Mirosevic on 24/03/2015.
// Copyright (c) 2015 Luka Mirosevic. All rights reserved.
//
@interface GBDeviceInfo_Common ()
@property (strong, atomic, readwrite) NSString *rawSystemInfoString;
@property (assign, atomic, readwrite) GBCPUInfo cpuInfo;
@property (assign, atomic, readwrite) CGFloat physicalMemory;
@property (assign, atomic, readwrite) GBOSVersion osVersion;
@property (assign, atomic, readwrite) GBDeviceFamily family;
+ (NSString *)_sysctlStringForKey:(NSString *)key;
+ (CGFloat)_sysctlCGFloatForKey:(NSString *)key;
+ (GBCPUInfo)_cpuInfo;
+ (CGFloat)_physicalMemory;
+ (GBByteOrder)_systemByteOrder;
@end
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOutlineCornerSource.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkOutlineCornerSource - create wireframe outline corners around bounding box
// .SECTION Description
// vtkOutlineCornerSource creates wireframe outline corners around a user-specified
// bounding box.
#ifndef __vtkOutlineCornerSource_h
#define __vtkOutlineCornerSource_h
#include "vtkOutlineSource.h"
class VTK_GRAPHICS_EXPORT vtkOutlineCornerSource : public vtkOutlineSource
{
public:
vtkTypeMacro(vtkOutlineCornerSource,vtkOutlineSource);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Construct outline corner source with default corner factor = 0.2
static vtkOutlineCornerSource *New();
// Description:
// Set/Get the factor that controls the relative size of the corners
// to the length of the corresponding bounds
vtkSetClampMacro(CornerFactor, double, 0.001, 0.5);
vtkGetMacro(CornerFactor, double);
protected:
vtkOutlineCornerSource();
~vtkOutlineCornerSource() {};
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
double CornerFactor;
private:
vtkOutlineCornerSource(const vtkOutlineCornerSource&); // Not implemented.
void operator=(const vtkOutlineCornerSource&); // Not implemented.
};
#endif
|
//
// ____ _ __ _ _____
// / ___\ /_\ /\/\ /\ /\ /__\ /_\ \_ \
// \ \ //_\\ / \ / / \ \ / \// //_\\ / /\/
// /\_\ \ / _ \ / /\/\ \ \ \_/ / / _ \ / _ \ /\/ /_
// \____/ \_/ \_/ \/ \/ \___/ \/ \_/ \_/ \_/ \____/
//
// Copyright Samurai development team and other contributors
//
// http://www.samurai-framework.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.
//
#import "Samurai.h"
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#pragma mark -
@interface SamuraiHtmlElementDir : UIView
@end
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
/*
* Copyright (c) Huawei Technologies Co., Ltd., 2015
* 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.
*/
/*
* Verify that:
* If a namespace isn't another namespace's ancestor, the process in
* first namespace does not have the CAP_SYS_ADMIN capability in the
* second namespace and the setns() call fails.
*/
#define _GNU_SOURCE
#include <sys/wait.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "test.h"
#include "userns_helper.h"
char *TCID = "user_namespace4";
int TST_TOTAL = 1;
static void setup(void)
{
check_newuser();
ltp_syscall(__NR_setns, -1, 0);
tst_tmpdir();
TST_CHECKPOINT_INIT(NULL);
}
static void cleanup(void)
{
tst_rmdir();
}
static int child_fn1(void *arg LTP_ATTRIBUTE_UNUSED)
{
TST_SAFE_CHECKPOINT_WAIT(NULL, 0);
return 0;
}
static int child_fn2(void *arg)
{
int exit_val = 0;
int ret;
ret = ltp_syscall(__NR_setns, ((long)arg), CLONE_NEWUSER);
if (ret != -1) {
printf("child2 setns() unexpected success\n");
exit_val = 1;
} else if (errno != EPERM) {
printf("child2 setns() unexpected error: (%d) %s\n",
errno, strerror(errno));
exit_val = 1;
}
TST_SAFE_CHECKPOINT_WAIT(NULL, 1);
return exit_val;
}
static void test_cap_sys_admin(void)
{
pid_t cpid1, cpid2, cpid3;
char path[BUFSIZ];
int fd;
/* child 1 */
cpid1 = ltp_clone_quick(CLONE_NEWUSER | SIGCHLD,
(void *)child_fn1, NULL);
if (cpid1 < 0)
tst_brkm(TBROK | TERRNO, cleanup, "clone failed");
/* child 2 */
sprintf(path, "/proc/%d/ns/user", cpid1);
fd = SAFE_OPEN(cleanup, path, O_RDONLY, 0644);
cpid2 = ltp_clone_quick(CLONE_NEWUSER | SIGCHLD,
(void *)child_fn2, (void *)((long)fd));
if (cpid2 < 0)
tst_brkm(TBROK | TERRNO, cleanup, "clone failed");
/* child 3 - throw-away process changing ns to child1 */
switch (cpid3 = fork()) {
case -1:
tst_brkm(TBROK | TERRNO, cleanup, "fork");
case 0:
if (ltp_syscall(__NR_setns, fd, CLONE_NEWUSER) == -1) {
printf("parent pid setns failure: (%d) %s",
errno, strerror(errno));
exit(1);
}
exit(0);
}
TST_SAFE_CHECKPOINT_WAKE(cleanup, 0);
TST_SAFE_CHECKPOINT_WAKE(cleanup, 1);
tst_record_childstatus(cleanup, cpid1);
tst_record_childstatus(cleanup, cpid2);
tst_record_childstatus(cleanup, cpid3);
SAFE_CLOSE(cleanup, fd);
}
int main(int argc, char *argv[])
{
int lc;
setup();
tst_parse_opts(argc, argv, NULL, NULL);
for (lc = 0; TEST_LOOPING(lc); lc++) {
tst_count = 0;
test_cap_sys_admin();
}
cleanup();
tst_exit();
}
|
/* dlmain.c -- hello test program that uses simulated dynamic linking
Copyright (C) 1996-1999, 2004, 2006, 2007, 2010 Free Software
Foundation, Inc.
This file is part of GNU Libtool.
GNU Libtool 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.
GNU Libtool 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 Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "foo.h"
#include <stdio.h>
#include <string.h>
#define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols
typedef struct
{
const char *name;
lt_ptr_t address;
} lt_dlsymlist;
extern LT_DLSYM_CONST lt_dlsymlist lt_preloaded_symbols[];
int
main ()
{
const lt_dlsymlist *s;
int (*pfoo)() = 0;
int (*phello)() = 0;
int *pnothing = 0;
printf ("Welcome to *modular* GNU Hell!\n");
/* Look up the symbols we require for this demonstration. */
s = lt_preloaded_symbols;
while (s->name)
{
if (s->address) {
const char *name = s->name;
printf ("found symbol: %s\n", name);
if (!strcmp ("hello", name))
phello = (int(*)())s->address;
else if (!strcmp ("foo", name))
pfoo = (int(*)())s->address;
else if (!strcmp ("nothing", name))
#ifndef _WIN32
/* In an ideal world we could do this... */
pnothing = (int*)s->address;
#else /* !_WIN32 */
/* In an ideal world a shared lib would be able to export data */
pnothing = (int*)¬hing;
#endif
} else
printf ("found file: %s\n", s->name);
s ++;
}
/* Try assigning to the nothing variable. */
if (pnothing)
*pnothing = 1;
else
fprintf (stderr, "did not find the `nothing' variable\n");
/* Just call the functions and check return values. */
if (pfoo)
{
if ((*pfoo) () != FOO_RET)
return 1;
}
else
fprintf (stderr, "did not find the `foo' function\n");
if (phello)
{
if ((*phello) () != HELLO_RET)
return 3;
}
else
fprintf (stderr, "did not find the `hello' function\n");
return 0;
}
|
/*
fe-dcc-chat-messages.c : irssi
Copyright (C) 2002 Timo Sirainen
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 "module.h"
#include "signals.h"
#include "levels.h"
#include "irc-servers.h"
#include "irc-queries.h"
#include "dcc-chat.h"
#include "ignore.h"
#include "module-formats.h"
#include "printtext.h"
static void sig_message_dcc_own(CHAT_DCC_REC *dcc, const char *msg)
{
TEXT_DEST_REC dest;
QUERY_REC *query;
char *tag;
tag = g_strconcat("=", dcc->id, NULL);
query = query_find(NULL, tag);
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
MSGLEVEL_DCCMSGS | MSGLEVEL_NOHILIGHT |
MSGLEVEL_NO_ACT, NULL);
printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_QUERY :
IRCTXT_OWN_DCC, dcc->mynick, dcc->id, msg);
g_free(tag);
}
static void sig_message_dcc_own_action(CHAT_DCC_REC *dcc, const char *msg)
{
TEXT_DEST_REC dest;
QUERY_REC *query;
char *tag;
tag = g_strconcat("=", dcc->id, NULL);
query = query_find(NULL, tag);
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS |
MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL);
printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_ACTION_QUERY :
IRCTXT_OWN_DCC_ACTION, dcc->mynick, dcc->id, msg);
g_free(tag);
}
static void sig_message_dcc_own_ctcp(CHAT_DCC_REC *dcc, const char *cmd,
const char *data)
{
TEXT_DEST_REC dest;
char *tag;
tag = g_strconcat("=", dcc->id, NULL);
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
MSGLEVEL_DCC | MSGLEVEL_CTCPS |
MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL);
printformat_dest(&dest, IRCTXT_OWN_DCC_CTCP, dcc->id, cmd, data);
g_free(tag);
}
static void sig_message_dcc(CHAT_DCC_REC *dcc, const char *msg)
{
TEXT_DEST_REC dest;
QUERY_REC *query;
char *tag;
int level = MSGLEVEL_DCCMSGS;
tag = g_strconcat("=", dcc->id, NULL);
query = query_find(NULL, tag);
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
level | MSGLEVEL_NO_ACT))
level |= MSGLEVEL_NO_ACT;
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
level, NULL);
printformat_dest(&dest, query != NULL ? IRCTXT_DCC_MSG_QUERY :
IRCTXT_DCC_MSG, dcc->id, msg);
g_free(tag);
}
static void sig_message_dcc_action(CHAT_DCC_REC *dcc, const char *msg)
{
TEXT_DEST_REC dest;
QUERY_REC *query;
char *tag;
int level = MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS;
tag = g_strconcat("=", dcc->id, NULL);
query = query_find(NULL, tag);
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
level | MSGLEVEL_NO_ACT))
level |= MSGLEVEL_NO_ACT;
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
level, NULL);
printformat_dest(&dest, query != NULL ? IRCTXT_ACTION_DCC_QUERY :
IRCTXT_ACTION_DCC, dcc->id, msg);
g_free(tag);
}
static void sig_message_dcc_ctcp(CHAT_DCC_REC *dcc, const char *cmd,
const char *data)
{
TEXT_DEST_REC dest;
char *tag;
int level = MSGLEVEL_DCCMSGS | MSGLEVEL_CTCPS;
tag = g_strconcat("=", dcc->id, NULL);
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, cmd,
level | MSGLEVEL_NO_ACT))
level |= MSGLEVEL_NO_ACT;
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
level, NULL);
printformat_dest(&dest, IRCTXT_DCC_CTCP, dcc->id, cmd, data);
g_free(tag);
}
void fe_dcc_chat_messages_init(void)
{
signal_add("message dcc own", (SIGNAL_FUNC) sig_message_dcc_own);
signal_add("message dcc own_action", (SIGNAL_FUNC) sig_message_dcc_own_action);
signal_add("message dcc own_ctcp", (SIGNAL_FUNC) sig_message_dcc_own_ctcp);
signal_add("message dcc", (SIGNAL_FUNC) sig_message_dcc);
signal_add("message dcc action", (SIGNAL_FUNC) sig_message_dcc_action);
signal_add("message dcc ctcp", (SIGNAL_FUNC) sig_message_dcc_ctcp);
}
void fe_dcc_chat_messages_deinit(void)
{
signal_remove("message dcc own", (SIGNAL_FUNC) sig_message_dcc_own);
signal_remove("message dcc own_action", (SIGNAL_FUNC) sig_message_dcc_own_action);
signal_remove("message dcc own_ctcp", (SIGNAL_FUNC) sig_message_dcc_own_ctcp);
signal_remove("message dcc", (SIGNAL_FUNC) sig_message_dcc);
signal_remove("message dcc action", (SIGNAL_FUNC) sig_message_dcc_action);
signal_remove("message dcc ctcp", (SIGNAL_FUNC) sig_message_dcc_ctcp);
}
|
/*
* Copyright (c) International Business Machines Corp., 2001
*
* 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
*
* Ported by John George
*/
/*
* Test that EPERM is set when setreuid is given an invalid user id.
*/
#include <wait.h>
#include <limits.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "test.h"
#include "compat_16.h"
#define INVAL_USER (USHRT_MAX-2)
TCID_DEFINE(setreuid06);
int TST_TOTAL = 1;
static struct passwd *ltpuser;
static void setup(void);
static void cleanup(void);
int main(int argc, char **argv)
{
int lc;
tst_parse_opts(argc, argv, NULL, NULL);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
tst_count = 0;
TEST(SETREUID(cleanup, -1, INVAL_USER));
if (TEST_RETURN != -1) {
tst_resm(TFAIL, "%s did not fail as expected", TCID);
} else if (TEST_ERRNO == EPERM) {
tst_resm(TPASS, "setreuid set errno to EPERM as "
"expected");
} else {
tst_resm(TFAIL, "setreuid FAILED, expected 1 but "
"returned %d", TEST_ERRNO);
}
}
cleanup();
tst_exit();
}
static void setup(void)
{
tst_require_root();
tst_sig(FORK, DEF_HANDLER, cleanup);
umask(0);
ltpuser = getpwnam("nobody");
if (ltpuser == NULL)
tst_brkm(TBROK, NULL, "nobody must be a valid user.");
if (setuid(ltpuser->pw_uid) == -1)
tst_brkm(TBROK | TERRNO, NULL, "setuid failed to "
"to set the effective uid to %d", ltpuser->pw_uid);
TEST_PAUSE;
}
static void cleanup(void)
{
}
|
/* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_BLACK_TEMPLE_H
#define DEF_BLACK_TEMPLE_H
enum
{
MAX_ENCOUNTER = 9,
TYPE_NAJENTUS = 1,
TYPE_SUPREMUS = 2,
TYPE_SHADE = 3,
TYPE_GOREFIEND = 4,
TYPE_BLOODBOIL = 5,
TYPE_RELIQUIARY = 6,
TYPE_SHAHRAZ = 7,
TYPE_COUNCIL = 8,
TYPE_ILLIDAN = 9,
DATA_HIGHWARLORDNAJENTUS = 10,
DATA_SUPREMUS = 11,
DATA_SHADEOFAKAMA = 12,
DATA_AKAMA_SHADE = 13,
DATA_ILLIDARICOUNCIL = 14,
DATA_BLOOD_ELF_COUNCIL_VOICE = 15,
DATA_LADYMALANDE = 16,
DATA_HIGHNETHERMANCERZEREVOR = 17,
DATA_GATHIOSTHESHATTERER = 18,
DATA_VERASDARKSHADOW = 19,
DATA_AKAMA = 20,
DATA_ILLIDANSTORMRAGE = 21,
DATA_GAMEOBJECT_NAJENTUS_GATE = 22,
DATA_GAMEOBJECT_SUPREMUS_DOORS = 23,
DATA_GO_PRE_SHAHRAZ_DOOR = 24,
DATA_GO_POST_SHAHRAZ_DOOR = 25,
DATA_GO_COUNCIL_DOOR = 26,
DATA_GAMEOBJECT_ILLIDAN_GATE = 27,
DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 28,
DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 29
};
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef LASTEXPRESS_VESNA_H
#define LASTEXPRESS_VESNA_H
#include "lastexpress/entities/entity.h"
namespace LastExpress {
class LastExpressEngine;
class Vesna : public Entity {
public:
Vesna(LastExpressEngine *engine);
~Vesna() override {}
/**
* Resets the entity
*/
DECLARE_FUNCTION(reset)
/**
* Plays sound
*
* @param filename The sound filename
*/
DECLARE_VFUNCTION_1(playSound, const char *filename)
/**
* Handles entering/exiting a compartment.
*
* @param sequence The sequence to draw
* @param compartment The compartment
*/
DECLARE_VFUNCTION_2(enterExitCompartment, const char *sequence, ObjectIndex compartment)
/**
* Draws the entity
*
* @param sequence The sequence to draw
*/
DECLARE_FUNCTION_1(draw, const char *sequence)
/**
* Updates the entity
*
* @param car The car
* @param entityPosition The entity position
*/
DECLARE_VFUNCTION_2(updateEntity, CarIndex car, EntityPosition entityPosition)
/**
* Updates parameter 2 using time value
*
* @param time The time to add
*/
DECLARE_FUNCTION_1(updateFromTime, uint32 time)
/**
* Updates the entity
*
* @param car The car
* @param entityPosition The entity position
*/
DECLARE_FUNCTION_2(updateEntity2, CarIndex car, EntityPosition entityPosition)
/**
* Process callback action when somebody is standing in the restaurant or salon.
*/
DECLARE_FUNCTION(callbackActionRestaurantOrSalon)
/**
* Process callback action when the entity direction is not kDirectionRight
*/
DECLARE_FUNCTION(callbackActionOnDirection)
/**
* Saves the game
*
* @param savegameType The type of the savegame
* @param param The param for the savegame (EventIndex or TimeValue)
*/
DECLARE_VFUNCTION_2(savegame, SavegameType savegameType, uint32 param)
DECLARE_FUNCTION(homeAlone)
/**
* Setup Chapter 1
*/
DECLARE_VFUNCTION(chapter1)
DECLARE_FUNCTION(withMilos)
DECLARE_FUNCTION(homeTogether)
DECLARE_FUNCTION(function15)
/**
* Setup Chapter 2
*/
DECLARE_VFUNCTION(chapter2)
/**
* Handle Chapter 2 events
*/
DECLARE_FUNCTION(chapter2Handler)
DECLARE_FUNCTION(checkTrain)
/**
* Setup Chapter 3
*/
DECLARE_VFUNCTION(chapter3)
DECLARE_FUNCTION(inCompartment)
DECLARE_FUNCTION(takeAWalk)
DECLARE_FUNCTION(killAnna)
DECLARE_FUNCTION(killedAnna)
/**
* Setup Chapter 4
*/
DECLARE_VFUNCTION(chapter4)
DECLARE_FUNCTION(exitLocation)
DECLARE_FUNCTION(done)
DECLARE_FUNCTION(function27)
/**
* Setup Chapter 5
*/
DECLARE_VFUNCTION(chapter5)
DECLARE_FUNCTION(guarding)
DECLARE_FUNCTION(climbing)
DECLARE_NULL_FUNCTION()
};
} // End of namespace LastExpress
#endif // LASTEXPRESS_VESNA_H
|
/* XzEnc.h -- Xz Encode
2009-04-15 : Igor Pavlov : Public domain */
#ifndef __XZ_ENC_H
#define __XZ_ENC_H
#include "Lzma2Enc.h"
#include "Xz.h"
#ifdef __cplusplus
extern "C" {
#endif
SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream,
const CLzma2EncProps *lzma2Props, Bool useSubblock,
ICompressProgress *progress);
SRes Xz_EncodeEmpty(ISeqOutStream *outStream);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* SPI Driver for EP93xx
*
* Copyright (C) 2013 Sergey Kostanabev <sergey.kostanbaev <at> fairwaves.ru>
*
* Inspired form linux kernel driver and atmel uboot driver
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <spi.h>
#include <malloc.h>
#include <asm/io.h>
#include <asm/arch/ep93xx.h>
#define SSPBASE SPI_BASE
#define SSPCR0 0x0000
#define SSPCR0_MODE_SHIFT 6
#define SSPCR0_SCR_SHIFT 8
#define SSPCR0_SPH BIT(7)
#define SSPCR0_SPO BIT(6)
#define SSPCR0_FRF_SPI 0
#define SSPCR0_DSS_8BIT 7
#define SSPCR1 0x0004
#define SSPCR1_RIE BIT(0)
#define SSPCR1_TIE BIT(1)
#define SSPCR1_RORIE BIT(2)
#define SSPCR1_LBM BIT(3)
#define SSPCR1_SSE BIT(4)
#define SSPCR1_MS BIT(5)
#define SSPCR1_SOD BIT(6)
#define SSPDR 0x0008
#define SSPSR 0x000c
#define SSPSR_TFE BIT(0)
#define SSPSR_TNF BIT(1)
#define SSPSR_RNE BIT(2)
#define SSPSR_RFF BIT(3)
#define SSPSR_BSY BIT(4)
#define SSPCPSR 0x0010
#define SSPIIR 0x0014
#define SSPIIR_RIS BIT(0)
#define SSPIIR_TIS BIT(1)
#define SSPIIR_RORIS BIT(2)
#define SSPICR SSPIIR
#define SSPCLOCK 14745600
#define SSP_MAX_RATE (SSPCLOCK / 2)
#define SSP_MIN_RATE (SSPCLOCK / (254 * 256))
/* timeout in milliseconds */
#define SPI_TIMEOUT 5
/* maximum depth of RX/TX FIFO */
#define SPI_FIFO_SIZE 8
struct ep93xx_spi_slave {
struct spi_slave slave;
unsigned sspcr0;
unsigned sspcpsr;
};
static inline struct ep93xx_spi_slave *to_ep93xx_spi(struct spi_slave *slave)
{
return container_of(slave, struct ep93xx_spi_slave, slave);
}
void spi_init()
{
}
static inline void ep93xx_spi_write_u8(u16 reg, u8 value)
{
writel(value, (unsigned int *)(SSPBASE + reg));
}
static inline u8 ep93xx_spi_read_u8(u16 reg)
{
return readl((unsigned int *)(SSPBASE + reg));
}
static inline void ep93xx_spi_write_u16(u16 reg, u16 value)
{
writel(value, (unsigned int *)(SSPBASE + reg));
}
static inline u16 ep93xx_spi_read_u16(u16 reg)
{
return (u16)readl((unsigned int *)(SSPBASE + reg));
}
static int ep93xx_spi_init_hw(unsigned int rate, unsigned int mode,
struct ep93xx_spi_slave *slave)
{
unsigned cpsr, scr;
if (rate > SSP_MAX_RATE)
rate = SSP_MAX_RATE;
if (rate < SSP_MIN_RATE)
return -1;
/* Calculate divisors so that we can get speed according the
* following formula:
* rate = spi_clock_rate / (cpsr * (1 + scr))
*
* cpsr must be even number and starts from 2, scr can be any number
* between 0 and 255.
*/
for (cpsr = 2; cpsr <= 254; cpsr += 2) {
for (scr = 0; scr <= 255; scr++) {
if ((SSPCLOCK / (cpsr * (scr + 1))) <= rate) {
/* Set CHPA and CPOL, SPI format and 8bit */
unsigned sspcr0 = (scr << SSPCR0_SCR_SHIFT) |
SSPCR0_FRF_SPI | SSPCR0_DSS_8BIT;
if (mode & SPI_CPHA)
sspcr0 |= SSPCR0_SPH;
if (mode & SPI_CPOL)
sspcr0 |= SSPCR0_SPO;
slave->sspcr0 = sspcr0;
slave->sspcpsr = cpsr;
return 0;
}
}
}
return -1;
}
void spi_set_speed(struct spi_slave *slave, unsigned int hz)
{
struct ep93xx_spi_slave *as = to_ep93xx_spi(slave);
unsigned int mode = 0;
if (as->sspcr0 & SSPCR0_SPH)
mode |= SPI_CPHA;
if (as->sspcr0 & SSPCR0_SPO)
mode |= SPI_CPOL;
ep93xx_spi_init_hw(hz, mode, as);
}
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode)
{
struct ep93xx_spi_slave *as;
if (!spi_cs_is_valid(bus, cs))
return NULL;
as = spi_alloc_slave(struct ep93xx_spi_slave, bus, cs);
if (!as)
return NULL;
if (ep93xx_spi_init_hw(max_hz, mode, as)) {
free(as);
return NULL;
}
return &as->slave;
}
void spi_free_slave(struct spi_slave *slave)
{
struct ep93xx_spi_slave *as = to_ep93xx_spi(slave);
free(as);
}
int spi_claim_bus(struct spi_slave *slave)
{
struct ep93xx_spi_slave *as = to_ep93xx_spi(slave);
/* Enable the SPI hardware */
ep93xx_spi_write_u8(SSPCR1, SSPCR1_SSE);
ep93xx_spi_write_u8(SSPCPSR, as->sspcpsr);
ep93xx_spi_write_u16(SSPCR0, as->sspcr0);
debug("Select CS:%d SSPCPSR=%02x SSPCR0=%04x\n",
slave->cs, as->sspcpsr, as->sspcr0);
return 0;
}
void spi_release_bus(struct spi_slave *slave)
{
/* Disable the SPI hardware */
ep93xx_spi_write_u8(SSPCR1, 0);
}
int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
const void *dout, void *din, unsigned long flags)
{
unsigned int len_tx;
unsigned int len_rx;
unsigned int len;
u32 status;
const u8 *txp = dout;
u8 *rxp = din;
u8 value;
debug("spi_xfer: slave %u:%u dout %p din %p bitlen %u\n",
slave->bus, slave->cs, (uint *)dout, (uint *)din, bitlen);
if (bitlen == 0)
/* Finish any previously submitted transfers */
goto out;
if (bitlen % 8) {
/* Errors always terminate an ongoing transfer */
flags |= SPI_XFER_END;
goto out;
}
len = bitlen / 8;
if (flags & SPI_XFER_BEGIN) {
/* Empty RX FIFO */
while ((ep93xx_spi_read_u8(SSPSR) & SSPSR_RNE))
ep93xx_spi_read_u8(SSPDR);
spi_cs_activate(slave);
}
for (len_tx = 0, len_rx = 0; len_rx < len; ) {
status = ep93xx_spi_read_u8(SSPSR);
if ((len_tx < len) && (status & SSPSR_TNF)) {
if (txp)
value = *txp++;
else
value = 0xff;
ep93xx_spi_write_u8(SSPDR, value);
len_tx++;
}
if (status & SSPSR_RNE) {
value = ep93xx_spi_read_u8(SSPDR);
if (rxp)
*rxp++ = value;
len_rx++;
}
}
out:
if (flags & SPI_XFER_END) {
/*
* Wait until the transfer is completely done before
* we deactivate CS.
*/
do {
status = ep93xx_spi_read_u8(SSPSR);
} while (status & SSPSR_BSY);
spi_cs_deactivate(slave);
}
return 0;
}
|
#include <pjnath/natnl_tnl_cache.h>
// global natnl_tnl_cache list
static natnl_tnl_cache tnl_cache = {0};
static pj_mutex_t *cache_lock = NULL;
/* Compare module name, used for searching module based on name. */
static int cmp_device_id(void *device_id, const void *cache)
{
return pj_stricmp((const pj_str_t*)device_id, &((natnl_tnl_cache*)cache)->device_id);
}
PJ_DEF(void) natnl_tnl_cache_init(pj_pool_t *pool)
{
pj_status_t status;
if(!cache_lock)
{
status = pj_mutex_create_simple(pool, NULL, &cache_lock);
pj_list_init(&tnl_cache);
}
}
PJ_DEF(void) natnl_tnl_cache_deinit()
{
natnl_tnl_cache *cache;
pj_mutex_lock(cache_lock);
cache = tnl_cache.next;
while (cache != &tnl_cache)
{
natnl_tnl_cache *pre_cache;
free(cache->check->lcand);
cache->check->lcand = NULL;
free(cache->check->rcand);
cache->check->rcand = NULL;
free(cache->check);
cache->check = NULL;
free(cache->device_id.ptr);
cache->device_id.ptr = NULL;
cache = cache->next;
pre_cache = cache->prev;
if (pre_cache != &tnl_cache)
{
pj_list_erase(cache);
free(pre_cache);
pre_cache = NULL;
}
}
pj_mutex_unlock(cache_lock);
pj_mutex_destroy(cache_lock);
cache_lock = NULL;
}
PJ_DEF(void) natnl_save_to_cache(pj_str_t *device_id, pj_ice_sess_check *check)
{
natnl_tnl_cache *temp_cache;
pj_mutex_lock(cache_lock);
temp_cache = natnl_get_from_cache(device_id);
if (temp_cache)
{
pj_list_erase(temp_cache);
free(temp_cache->check->lcand);
temp_cache->check->lcand = NULL;
free(temp_cache->check->rcand);
temp_cache->check->rcand = NULL;
free(temp_cache->check);
temp_cache->check = NULL;
free(temp_cache->device_id.ptr);
temp_cache->device_id.ptr = NULL;
free(temp_cache);
temp_cache = NULL;
}
temp_cache = (natnl_tnl_cache *)malloc(sizeof(natnl_tnl_cache));//PJ_POOL_ZALLOC_T(pool, natnl_tnl_cache);
//temp_cache->device_id = device_id;
temp_cache->device_id.ptr = (char *)malloc(device_id->slen);//pj_pool_zalloc(pool, device_id->slen);
pj_strncpy(&temp_cache->device_id, device_id, device_id->slen);
//temp_cache->check = check;
temp_cache->check = (pj_ice_sess_check *)malloc(sizeof(pj_ice_sess_check));//PJ_POOL_ZALLOC_T(pool, pj_ice_sess_check);
pj_memcpy(temp_cache->check, check, sizeof(pj_ice_sess_check));
temp_cache->check->lcand = (pj_ice_sess_cand *)malloc(sizeof(pj_ice_sess_cand));
pj_memcpy(temp_cache->check->lcand, check->lcand, sizeof(pj_ice_sess_cand));
temp_cache->check->rcand = (pj_ice_sess_cand *)malloc(sizeof(pj_ice_sess_cand));
pj_memcpy(temp_cache->check->rcand, check->rcand, sizeof(pj_ice_sess_cand));
pj_list_push_back(&tnl_cache, temp_cache);
pj_mutex_unlock(cache_lock);
}
PJ_DEF(natnl_tnl_cache *) natnl_get_from_cache(pj_str_t *device_id)
{
natnl_tnl_cache *temp_cache = (natnl_tnl_cache *)pj_list_search(&tnl_cache, device_id, &cmp_device_id);
return temp_cache;
}
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <stdint.h>
#include "platform.h"
#include "streambuf.h"
sbuf_t *sbufInit(sbuf_t *sbuf, uint8_t *ptr, uint8_t *end)
{
sbuf->ptr = ptr;
sbuf->end = end;
return sbuf;
}
void sbufWriteU8(sbuf_t *dst, uint8_t val)
{
*dst->ptr++ = val;
}
void sbufWriteU16(sbuf_t *dst, uint16_t val)
{
sbufWriteU8(dst, val >> 0);
sbufWriteU8(dst, val >> 8);
}
void sbufWriteU32(sbuf_t *dst, uint32_t val)
{
sbufWriteU8(dst, val >> 0);
sbufWriteU8(dst, val >> 8);
sbufWriteU8(dst, val >> 16);
sbufWriteU8(dst, val >> 24);
}
void sbufWriteU16BigEndian(sbuf_t *dst, uint16_t val)
{
sbufWriteU8(dst, val >> 8);
sbufWriteU8(dst, (uint8_t)val);
}
void sbufWriteU32BigEndian(sbuf_t *dst, uint32_t val)
{
sbufWriteU8(dst, val >> 24);
sbufWriteU8(dst, val >> 16);
sbufWriteU8(dst, val >> 8);
sbufWriteU8(dst, (uint8_t)val);
}
void sbufFill(sbuf_t *dst, uint8_t data, int len)
{
memset(dst->ptr, data, len);
dst->ptr += len;
}
void sbufWriteData(sbuf_t *dst, const void *data, int len)
{
memcpy(dst->ptr, data, len);
dst->ptr += len;
}
void sbufWriteString(sbuf_t *dst, const char *string)
{
sbufWriteData(dst, string, strlen(string));
}
void sbufWriteStringWithZeroTerminator(sbuf_t *dst, const char *string)
{
sbufWriteData(dst, string, strlen(string) + 1);
}
uint8_t sbufReadU8(sbuf_t *src)
{
return *src->ptr++;
}
uint16_t sbufReadU16(sbuf_t *src)
{
uint16_t ret;
ret = sbufReadU8(src);
ret |= sbufReadU8(src) << 8;
return ret;
}
uint32_t sbufReadU32(sbuf_t *src)
{
uint32_t ret;
ret = sbufReadU8(src);
ret |= sbufReadU8(src) << 8;
ret |= sbufReadU8(src) << 16;
ret |= sbufReadU8(src) << 24;
return ret;
}
void sbufReadData(sbuf_t *src, void *data, int len)
{
memcpy(data, src->ptr, len);
}
// reader - return bytes remaining in buffer
// writer - return available space
int sbufBytesRemaining(sbuf_t *buf)
{
return buf->end - buf->ptr;
}
uint8_t* sbufPtr(sbuf_t *buf)
{
return buf->ptr;
}
const uint8_t* sbufConstPtr(const sbuf_t *buf)
{
return buf->ptr;
}
// advance buffer pointer
// reader - skip data
// writer - commit written data
void sbufAdvance(sbuf_t *buf, int size)
{
buf->ptr += size;
}
// modifies streambuf so that written data are prepared for reading
void sbufSwitchToReader(sbuf_t *buf, uint8_t *base)
{
buf->end = buf->ptr;
buf->ptr = base;
}
|
/*
* Copyright (c) 2016 Thomas Pornin <pornin@bolet.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "inner.h"
/* see bearssl_x509.h */
void
br_x509_knownkey_init_rsa(br_x509_knownkey_context *ctx,
const br_rsa_public_key *pk, unsigned usages)
{
ctx->vtable = &br_x509_knownkey_vtable;
ctx->pkey.key_type = BR_KEYTYPE_RSA;
ctx->pkey.key.rsa = *pk;
ctx->usages = usages;
}
/* see bearssl_x509.h */
void
br_x509_knownkey_init_ec(br_x509_knownkey_context *ctx,
const br_ec_public_key *pk, unsigned usages)
{
ctx->vtable = &br_x509_knownkey_vtable;
ctx->pkey.key_type = BR_KEYTYPE_EC;
ctx->pkey.key.ec = *pk;
ctx->usages = usages;
}
static void
kk_start_chain(const br_x509_class **ctx, const char *server_name)
{
(void)ctx;
(void)server_name;
}
static void
kk_start_cert(const br_x509_class **ctx, uint32_t length)
{
(void)ctx;
(void)length;
}
static void
kk_append(const br_x509_class **ctx, const unsigned char *buf, size_t len)
{
(void)ctx;
(void)buf;
(void)len;
}
static void
kk_end_cert(const br_x509_class **ctx)
{
(void)ctx;
}
static unsigned
kk_end_chain(const br_x509_class **ctx)
{
(void)ctx;
return 0;
}
static const br_x509_pkey *
kk_get_pkey(const br_x509_class *const *ctx, unsigned *usages)
{
const br_x509_knownkey_context *xc;
xc = (const br_x509_knownkey_context *)ctx;
if (usages != NULL) {
*usages = xc->usages;
}
return &xc->pkey;
}
/* see bearssl_x509.h */
const br_x509_class br_x509_knownkey_vtable = {
sizeof(br_x509_knownkey_context),
kk_start_chain,
kk_start_cert,
kk_append,
kk_end_cert,
kk_end_chain,
kk_get_pkey
};
|
/*
* (C) 2003-2006 Gabest
* (C) 2006-2012, 2015 see Authors.txt
*
* This file is part of MPC-HC.
*
* MPC-HC 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.
*
* MPC-HC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <afxole.h>
#define DROPEFFECT_APPEND 16
struct CDropClient {
virtual void OnDropFiles(CAtlList<CString>& slFiles, DROPEFFECT dropEffect) PURE;
virtual DROPEFFECT OnDropAccept(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) PURE;
};
class CDropTarget : public COleDropTarget
{
const CLIPFORMAT CF_URL = static_cast<CLIPFORMAT>(RegisterClipboardFormat(_T("UniformResourceLocator")));
CComPtr<IDropTargetHelper> m_pDropHelper;
public:
CDropTarget();
virtual ~CDropTarget() = default;
protected:
DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) override;
DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) override;
BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) override;
DROPEFFECT OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point) override;
void OnDragLeave(CWnd* pWnd) override;
DROPEFFECT OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point) override;
};
|
#ifndef CRIS_TARGET_SIGNAL_H
#define CRIS_TARGET_SIGNAL_H
#include "cpu.h"
/* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack {
abi_ulong ss_sp;
abi_ulong ss_size;
abi_long ss_flags;
} target_stack_t;
/*
* sigaltstack controls
*/
#define TARGET_SS_ONSTACK 1
#define TARGET_SS_DISABLE 2
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192
static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
{
return state->regs[14];
}
#endif /* CRIS_TARGET_SIGNAL_H */
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkCompensatedSummation_h
#define itkCompensatedSummation_h
#include "itkNumericTraits.h"
#include "itkConceptChecking.h"
namespace itk
{
/** \class CompensatedSummation
* \brief Perform more precise accumulation of floating point numbers.
*
* The \c float and \c double datatypes only have finite precision. When
* performing a running sum of floats, the accumulated errors get progressively
* worse as the magnitude of the sum gets large relative to new elements.
*
* From Wikipedia, http://en.wikipedia.org/wiki/Kahan_summation_algorithm
*
* "In numerical analysis, the Kahan summation algorithm (also known as
* compensated summation) significantly reduces the numerical error in the total
* obtained by adding a sequence of finite precision floating point numbers,
* compared to the obvious approach. This is done by keeping a separate running
* compensation (a variable to accumulate small errors)."
*
* For example, instead of
* \code
* double sum = 0.0;
* for( unsigned int i = 0; i < array.Size(); ++i )
* {
* sum += array.GetElement(i);
* }
* \endcode
*
* do
*
* \code
* typedef CompensatedSummation<double> CompensatedSummationType;
* CompensatedSummationType compensatedSummation;
* for( unsigned int i = 0; i < array.Size(); ++i )
* {
* compensatedSummation += array.GetElement(i);
* }
* double sum = compensatedSummation.GetSum();
* \endcode
*
* \ingroup ITKCommon
*/
template < typename TFloat >
class CompensatedSummation
{
public:
/** Type of the input elements. */
typedef TFloat FloatType;
/** Type used for the sum and compensation. */
typedef typename NumericTraits< FloatType >::AccumulateType AccumulateType;
/** Standard class typedefs. */
typedef CompensatedSummation Self;
/** Constructor. */
CompensatedSummation();
/** Copy constructor. */
CompensatedSummation( const Self & rhs );
/** Assignment operator. */
Self & operator=( const Self & rhs );
/** Add an element to the sum. */
void AddElement( const FloatType & element );
Self & operator+=( const FloatType & rhs );
/** Subtract an element from the sum. */
Self & operator-=( const FloatType & rhs );
/** Division and multiplication. These do not provide any numerical advantages
* relative to vanilla division and multiplication. */
Self & operator*=( const FloatType & rhs );
Self & operator/=( const FloatType & rhs );
/** Reset the sum and compensation to zero. */
void ResetToZero();
/** Reset the sum to the given value and the compensation to zero. */
Self & operator=( const FloatType & rhs );
/** Get the sum. */
const AccumulateType & GetSum() const;
private:
AccumulateType m_Sum;
AccumulateType m_Compensation;
// Maybe support more types in the future with template specialization.
#ifdef ITK_USE_CONCEPT_CHECKING
itkConceptMacro( OnlyDefinedForFloatingPointTypes, ( itk::Concept::IsFloatingPoint< TFloat > ) );
#endif // ITK_USE_CONCEPT_CHECKING
};
void ITKCommon_EXPORT CompensatedSummationAddElement( float& compensation, float& sum, const float& element );
void ITKCommon_EXPORT CompensatedSummationAddElement( double& compensation, double& sum, const double& element );
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkCompensatedSummation.hxx"
#endif
#endif
|
/*
* Copyright (c) 2014, Analog Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \author Ian Martin <martini@redwirellc.com>
*/
void uart0_set_input(int (*input)(unsigned char c));
|
/* bam_import.c -- SAM format parsing.
Copyright (C) 2008-2013 Genome Research Ltd.
Author: Heng Li <lh3@sanger.ac.uk>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. */
#include <config.h>
#include <zlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "htslib/kstring.h"
#include "bam.h"
#include "htslib/kseq.h"
KSTREAM_INIT(gzFile, gzread, 16384)
bam_header_t *sam_header_read2(const char *fn)
{
bam_header_t *header;
int c, dret, n_targets = 0;
gzFile fp;
kstream_t *ks;
kstring_t *str;
kstring_t samstr = { 0, 0, NULL };
if (fn == 0) return 0;
fp = (strcmp(fn, "-") == 0)? gzdopen(fileno(stdin), "r") : gzopen(fn, "r");
if (fp == 0) return 0;
ks = ks_init(fp);
str = (kstring_t*)calloc(1, sizeof(kstring_t));
while (ks_getuntil(ks, 0, str, &dret) > 0) {
ksprintf(&samstr, "@SQ\tSN:%s", str->s);
ks_getuntil(ks, 0, str, &dret);
ksprintf(&samstr, "\tLN:%d\n", atoi(str->s));
n_targets++;
if (dret != '\n')
while ((c = ks_getc(ks)) != '\n' && c != -1);
}
ks_destroy(ks);
gzclose(fp);
free(str->s); free(str);
header = sam_hdr_parse(samstr.l, samstr.s? samstr.s : "");
free(samstr.s);
fprintf(stderr, "[sam_header_read2] %d sequences loaded.\n", n_targets);
return header;
}
|
#ifndef KARAOKELYRICSMANAGER_H
#define KARAOKELYRICSMANAGER_H
/*
* Copyright (C) 2005-2012 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
// C++ Interface: karaokelyricsmanager
class CKaraokeLyrics;
class CGUIDialogKaraokeSongSelectorSmall;
//! This is the main lyrics manager class, which is called from XBMC code.
class CKaraokeLyricsManager
{
public:
//! The class instance created only once during the application life,
//! and is destroyed when the app shuts down.
CKaraokeLyricsManager();
~CKaraokeLyricsManager();
//! A new song is started playing
bool Start( const CStdString& strSongPath );
//! Called when the current song is being paused or unpaused
void SetPaused( bool now_paused );
//! Called when the current song is being stopped. Changing to a new song
//! in the queue generates Stop() with followed Start() calls. May be called even if
//! Start() was not called before, so please check.
void Stop();
//! Might pop up a selection dialog if playback is ended
void ProcessSlow();
private:
//! Critical section protects this class from requests from different threads
CCriticalSection m_CritSection;
//! A class which handles loading and rendering for this specific karaoke song.
//! Obtained from KaraokeLyricsFactory
CKaraokeLyrics * m_Lyrics;
//! True if we're playing a karaoke song
bool m_karaokeSongPlaying;
//! True if we played a karaoke song
bool m_karaokeSongPlayed;
//! Stores the last time the song was still played
unsigned int m_lastPlayedTime;
};
#endif
|
/** @file
Legacy Master Boot Record Format Definition.
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _MBR_H_
#define _MBR_H_
#define MBR_SIGNATURE 0xaa55
#define EXTENDED_DOS_PARTITION 0x05
#define EXTENDED_WINDOWS_PARTITION 0x0F
#define MAX_MBR_PARTITIONS 4
#define PMBR_GPT_PARTITION 0xEE
#define EFI_PARTITION 0xEF
#define MBR_SIZE 512
#pragma pack(1)
///
/// MBR Partition Entry
///
typedef struct {
UINT8 BootIndicator;
UINT8 StartHead;
UINT8 StartSector;
UINT8 StartTrack;
UINT8 OSIndicator;
UINT8 EndHead;
UINT8 EndSector;
UINT8 EndTrack;
UINT8 StartingLBA[4];
UINT8 SizeInLBA[4];
} MBR_PARTITION_RECORD;
///
/// MBR Partition Table
///
typedef struct {
UINT8 BootStrapCode[440];
UINT8 UniqueMbrSignature[4];
UINT8 Unknown[2];
MBR_PARTITION_RECORD Partition[MAX_MBR_PARTITIONS];
UINT16 Signature;
} MASTER_BOOT_RECORD;
#pragma pack()
#endif
|
/*-------------------------------------------------------------------------
_divslonglong.c - routine for divsion of 64 bit unsigned long long
Copyright (C) 2012, Philipp Klaus Krause . pkk@spth.de
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, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library 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.
-------------------------------------------------------------------------*/
#pragma std_c99
#include <stdint.h>
#include <stdbool.h>
#ifdef __SDCC_LONGLONG
long long
_divslonglong (long long numerator, long long denominator)
{
bool numeratorneg = (numerator < 0);
bool denominatorneg = (denominator < 0);
long long d;
if (numeratorneg)
numerator = -numerator;
if (denominatorneg)
denominator = -denominator;
d = (unsigned long long)numerator / (unsigned long long)denominator;
return ((numeratorneg ^ denominatorneg) ? -d : d);
}
#endif
|
/* PR target/89290 */
/* { dg-do compile { target { tls && lp64 } } } */
/* { dg-options "-O0 -mcmodel=large" } */
struct S { long int a, b; } e;
__thread struct S s;
__thread struct S t[2];
void
foo (void)
{
s = e;
}
void
bar (void)
{
t[1] = e;
}
|
/* $NoKeywords:$ */
/**
* @file
*
* Config Fch USB OHCI controller
*
* Init USB OHCI features.
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: FCH
* @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 2010) $
*
*/
/*;********************************************************************************
;
* Copyright (c) 2011, Advanced Micro Devices, 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 Advanced Micro Devices, 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 ADVANCED MICRO DEVICES, INC. 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.
;*********************************************************************************/
#include "FchPlatform.h"
#include "Filecode.h"
#define FILECODE PROC_FCH_USB_OHCIENV_FILECODE
/**
* FchInitEnvUsbOhci - Config USB OHCI controller before PCI
* emulation
*
*
*
* @param[in] FchDataPtr Fch configuration structure pointer.
*
*/
VOID
FchInitEnvUsbOhci (
IN VOID *FchDataPtr
)
{
}
|
//
// UniqueExpireCacheTest.h
//
// $Id: //poco/1.4/Foundation/testsuite/src/UniqueExpireCacheTest.h#1 $
//
// Tests for ExpireCache
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef UniqueExpireCacheTest_INCLUDED
#define UniqueExpireCacheTest_INCLUDED
#include "Poco/Foundation.h"
#include "CppUnit/TestCase.h"
class UniqueExpireCacheTest: public CppUnit::TestCase
{
public:
UniqueExpireCacheTest(const std::string& name);
~UniqueExpireCacheTest();
void testClear();
void testAccessClear();
void testDuplicateAdd();
void testAccessDuplicateAdd();
void testExpire0();
void testAccessExpire0();
void testExpireN();
void testExpirationDecorator();
void testAccessUpdate();
void setUp();
void tearDown();
static CppUnit::Test* suite();
};
#endif // UniqueExpireCacheTest_INCLUDED
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef NUVIE_FILES_U6_SHAPE_H
#define NUVIE_FILES_U6_SHAPE_H
/*
* ==========
* Includes
* ==========
*/
#include "ultima/shared/std/string.h"
namespace Ultima {
namespace Nuvie {
class U6Lib_n;
class Configuration;
/*
* ==================
* Class definition
* ==================
*
* U6Shape can load Ultima VI shape files and return the shapes
* stored into these files either as a Graphics::ManagedSurface or as raw data.
*/
class U6Shape {
private:
uint16 hotx, hoty;
protected:
unsigned char *raw;
uint16 width, height;
public:
U6Shape();
virtual ~U6Shape();
bool init(uint16 w, uint16 h, uint16 hx = 0, uint16 hy = 0);
virtual bool load(Std::string filename);
bool load(U6Lib_n *file, uint32 index);
virtual bool load(unsigned char *buf);
bool load_from_lzc(Std::string filename, uint32 idx, uint32 sub_idx);
bool load_WoU_background(Configuration *config, nuvie_game_t game_type);
unsigned char *get_data();
Graphics::ManagedSurface *get_shape_surface();
bool get_hot_point(uint16 *x, uint16 *y);
bool get_size(uint16 *w, uint16 *h);
void draw_line(uint16 sx, uint16 sy, uint16 ex, uint16 ey, uint8 color);
bool blit(U6Shape *shp, uint16 x, uint16 y);
void fill(uint8 color);
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif
|
/*
* Copyright (c) 2013
* Minchan Kim <minchan@kernel.org>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*/
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/buffer_head.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/cpumask.h>
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
#include "decompressor.h"
#include "squashfs.h"
/*
* This file implements multi-threaded decompression in the
* decompressor framework
*/
/*
* The reason that multiply two is that a CPU can request new I/O
* while it is waiting previous request.
*/
#define MAX_DECOMPRESSOR (num_online_cpus() * 2)
int squashfs_max_decompressors(void)
{
return MAX_DECOMPRESSOR;
}
struct squashfs_stream {
void *comp_opts;
struct list_head strm_list;
struct mutex mutex;
int avail_decomp;
wait_queue_head_t wait;
};
struct decomp_stream {
void *stream;
struct list_head list;
};
static void put_decomp_stream(struct decomp_stream *decomp_strm,
struct squashfs_stream *stream)
{
mutex_lock(&stream->mutex);
list_add(&decomp_strm->list, &stream->strm_list);
mutex_unlock(&stream->mutex);
wake_up(&stream->wait);
}
void *squashfs_decompressor_create(struct squashfs_sb_info *msblk,
void *comp_opts)
{
struct squashfs_stream *stream;
struct decomp_stream *decomp_strm = NULL;
int err = -ENOMEM;
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
if (!stream)
goto out;
stream->comp_opts = comp_opts;
mutex_init(&stream->mutex);
INIT_LIST_HEAD(&stream->strm_list);
init_waitqueue_head(&stream->wait);
/*
* We should have a decompressor at least as default
* so if we fail to allocate new decompressor dynamically,
* we could always fall back to default decompressor and
* file system works.
*/
decomp_strm = kmalloc(sizeof(*decomp_strm), GFP_KERNEL);
if (!decomp_strm)
goto out;
decomp_strm->stream = msblk->decompressor->init(msblk,
stream->comp_opts);
if (IS_ERR(decomp_strm->stream)) {
err = PTR_ERR(decomp_strm->stream);
goto out;
}
list_add(&decomp_strm->list, &stream->strm_list);
stream->avail_decomp = 1;
return stream;
out:
kfree(decomp_strm);
kfree(stream);
return ERR_PTR(err);
}
void squashfs_decompressor_destroy(struct squashfs_sb_info *msblk)
{
struct squashfs_stream *stream = msblk->stream;
if (stream) {
struct decomp_stream *decomp_strm;
while (!list_empty(&stream->strm_list)) {
decomp_strm = list_entry(stream->strm_list.prev,
struct decomp_stream, list);
list_del(&decomp_strm->list);
msblk->decompressor->free(decomp_strm->stream);
kfree(decomp_strm);
stream->avail_decomp--;
}
}
WARN_ON(stream->avail_decomp);
kfree(stream->comp_opts);
kfree(stream);
}
static struct decomp_stream *get_decomp_stream(struct squashfs_sb_info *msblk,
struct squashfs_stream *stream)
{
struct decomp_stream *decomp_strm;
while (1) {
mutex_lock(&stream->mutex);
/* There is available decomp_stream */
if (!list_empty(&stream->strm_list)) {
decomp_strm = list_entry(stream->strm_list.prev,
struct decomp_stream, list);
list_del(&decomp_strm->list);
mutex_unlock(&stream->mutex);
break;
}
/*
* If there is no available decomp and already full,
* let's wait for releasing decomp from other users.
*/
if (stream->avail_decomp >= MAX_DECOMPRESSOR)
goto wait;
/* Let's allocate new decomp */
decomp_strm = kmalloc(sizeof(*decomp_strm), GFP_KERNEL);
if (!decomp_strm)
goto wait;
decomp_strm->stream = msblk->decompressor->init(msblk,
stream->comp_opts);
if (IS_ERR(decomp_strm->stream)) {
kfree(decomp_strm);
goto wait;
}
stream->avail_decomp++;
WARN_ON(stream->avail_decomp > MAX_DECOMPRESSOR);
mutex_unlock(&stream->mutex);
break;
wait:
/*
* If system memory is tough, let's for other's
* releasing instead of hurting VM because it could
* make page cache thrashing.
*/
mutex_unlock(&stream->mutex);
wait_event(stream->wait,
!list_empty(&stream->strm_list));
}
return decomp_strm;
}
int squashfs_decompress(struct squashfs_sb_info *msblk, struct buffer_head **bh,
int b, int offset, int length, struct squashfs_page_actor *output)
{
int res;
struct squashfs_stream *stream = msblk->stream;
struct decomp_stream *decomp_stream = get_decomp_stream(msblk, stream);
res = msblk->decompressor->decompress(msblk, decomp_stream->stream,
bh, b, offset, length, output);
put_decomp_stream(decomp_stream, stream);
if (res < 0)
ERROR("%s decompression failed, data probably corrupt\n",
msblk->decompressor->name);
return res;
}
|
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 2011 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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 St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _IXGBE_SRIOV_H_
#define _IXGBE_SRIOV_H_
void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
void ixgbe_msg_task(struct ixgbe_adapter *adapter);
int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter);
void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);
void ixgbe_dump_registers(struct ixgbe_adapter *adapter);
int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);
int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,
u8 qos);
int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate);
int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting);
int ixgbe_ndo_get_vf_config(struct net_device *netdev,
int vf, struct ifla_vf_info *ivi);
void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter);
void ixgbe_disable_sriov(struct ixgbe_adapter *adapter);
void ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
const struct ixgbe_info *ii);
int ixgbe_check_vf_assignment(struct ixgbe_adapter *adapter);
#endif /* _IXGBE_SRIOV_H_ */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_EXIT_TIANIA_H
#define TITANIC_EXIT_TIANIA_H
#include "titanic/moves/move_player_to.h"
namespace Titanic {
class CExitTiania : public CMovePlayerTo {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
private:
int _fieldC8;
CString _viewNames[3];
public:
CLASSDEF;
CExitTiania();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_EXIT_TIANIA_H */
|
/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).
License: GPLv3 */
#define SZ_PDF_FILTER_CLSID L"{55808EA8-81FE-43c6-AAE8-1D8149F941D3}"
#define SZ_PDF_FILTER_HANDLER L"{26CA6565-F22A-4f5e-B688-0AD051D56E96}"
#ifdef BUILD_TEX_IFILTER
#define SZ_TEX_FILTER_CLSID L"{AF57F784-ED93-4f2c-8C1D-CCDCB6E27CA6}"
#define SZ_TEX_FILTER_HANDLER L"{3FAB27F8-08EC-4b9e-9EEE-181A6E846B8D}"
#endif
#ifdef BUILD_EPUB_IFILTER
#define SZ_EPUB_FILTER_CLSID L"{FE4C7847-4260-43e3-A449-08ED76009F94}"
#define SZ_EPUB_FILTER_HANDLER L"{FF68D1A0-DA54-4fbf-A406-06CFDB764CA9}"
#endif
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSYSTEMSEMAPHORE_P_H
#define QSYSTEMSEMAPHORE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qsystemsemaphore.h"
#ifndef QT_NO_SYSTEMSEMAPHORE
#include "qsharedmemory_p.h"
#ifndef Q_OS_WINCE
# include <sys/types.h>
#endif
#ifdef QT_POSIX_IPC
# include <semaphore.h>
#endif
QT_BEGIN_NAMESPACE
class QSystemSemaphorePrivate
{
public:
QSystemSemaphorePrivate();
QString makeKeyFileName()
{
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
}
inline void setError(QSystemSemaphore::SystemSemaphoreError e, const QString &message)
{ error = e; errorString = message; }
inline void clearError()
{ setError(QSystemSemaphore::NoError, QString()); }
#ifdef Q_OS_WIN
Qt::HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function);
#elif defined(QT_POSIX_IPC)
bool handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function);
#else
key_t handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function);
#endif
void cleanHandle();
bool modifySemaphore(int count);
QString key;
QString fileName;
int initialValue;
#ifdef Q_OS_WIN
Qt::HANDLE semaphore;
Qt::HANDLE semaphoreLock;
#elif defined(QT_POSIX_IPC)
sem_t *semaphore;
bool createdSemaphore;
#else
key_t unix_key;
int semaphore;
bool createdFile;
bool createdSemaphore;
#endif
QString errorString;
QSystemSemaphore::SystemSemaphoreError error;
};
QT_END_NAMESPACE
#endif // QT_NO_SYSTEMSEMAPHORE
#endif // QSYSTEMSEMAPHORE_P_H
|
/*
* 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.
*
* Written (W) 2013 Kevin Hughes
*
* Thanks to Andreas Ziehe and Cedric Gouy-Pailler
*/
#ifndef APPROXJOINTDIAGONALIZER_H_
#define APPROXJOINTDIAGONALIZER_H_
#include <shogun/lib/config.h>
#include <shogun/lib/common.h>
#include <shogun/lib/SGMatrix.h>
#include <shogun/lib/SGNDArray.h>
#include <shogun/base/SGObject.h>
#include <shogun/mathematics/Math.h>
namespace shogun
{
/** @brief Class ApproxJointDiagonalizer defines an
* Approximate Joint Diagonalizer (AJD) interface.
*
* AJD finds the matrix V that best diagonalizes
* a set \f${C^1 ... C^k}\f$ of real valued symmetric
* \f$NxN\f$ matrices - \f$V*C*V^T\f$
*/
class CApproxJointDiagonalizer : public CSGObject
{
public:
/** constructor */
CApproxJointDiagonalizer() : CSGObject()
{
};
/** destructor */
virtual ~CApproxJointDiagonalizer()
{
}
/** Computes the matrix V that best diagonalizes C
* @param C the set of matrices to be diagonalized
* @param V0 an estimate of the matrix V
* @param eps machine epsilon or desired epsilon
* @param itermax maximum number of iterations
* @return V the matrix that best diagonalizes C
*/
virtual SGMatrix<float64_t> compute(SGNDArray<float64_t> C,
SGMatrix<float64_t> V0 = SGMatrix<float64_t>(NULL,0,0,false),
double eps=CMath::MACHINE_EPSILON,
int itermax=200) = 0;
/** return the matrix V that best diagonalizes C */
SGMatrix<float64_t> get_V()
{
return m_V;
}
protected:
/** the matrix V that best diagonalizes C */
SGMatrix<float64_t> m_V;
};
}
#endif //APPROXJOINTDIAGONALIZER_H_
|
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2013 Werner Schweer
//
// 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 and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __JUMP_H__
#define __JUMP_H__
#include "text.h"
namespace Ms {
//---------------------------------------------------------
// @@ Jump
/// Jump label
//
// @P continueAt string
// @P jumpTo string
// not used?
// jumpType enum (Jump.DC, .DC_AL_FINE, .DC_AL_CODA, .DS_AL_CODA, .DS_AL_FINE, .DS, USER) (read only)
// @P playUntil string
//---------------------------------------------------------
class Jump : public Text {
Q_OBJECT
Q_PROPERTY(QString continueAt READ continueAt WRITE undoSetContinueAt)
Q_PROPERTY(QString jumpTo READ jumpTo WRITE undoSetJumpTo)
Q_PROPERTY(QString playUntil READ playUntil WRITE undoSetPlayUntil)
//Q_Property(Ms::Jump::Type READ jumpType)
//Q_ENUMS(Type)
QString _jumpTo;
QString _playUntil;
QString _continueAt;
public:
enum class Type : char {
DC,
DC_AL_FINE,
DC_AL_CODA,
DS_AL_CODA,
DS_AL_FINE,
DS,
USER
};
Jump(Score*);
void setJumpType(Type t);
Type jumpType() const;
QString jumpTypeUserName() const;
virtual Jump* clone() const override { return new Jump(*this); }
virtual Element::Type type() const override { return Element::Type::JUMP; }
Measure* measure() const { return (Measure*)parent(); }
virtual void read(XmlReader&) override;
virtual void write(Xml& xml) const override;
QString jumpTo() const { return _jumpTo; }
QString playUntil() const { return _playUntil; }
QString continueAt() const { return _continueAt; }
void setJumpTo(const QString& s) { _jumpTo = s; }
void setPlayUntil(const QString& s) { _playUntil = s; }
void setContinueAt(const QString& s) { _continueAt = s; }
void undoSetJumpTo(const QString& s);
void undoSetPlayUntil(const QString& s);
void undoSetContinueAt(const QString& s);
virtual bool systemFlag() const override { return true; }
virtual QVariant getProperty(P_ID propertyId) const override;
virtual bool setProperty(P_ID propertyId, const QVariant&) override;
virtual QVariant propertyDefault(P_ID) const override;
Element* nextElement() override;
Element* prevElement() override;
virtual QString accessibleInfo() override;
};
struct JumpTypeTable {
Jump::Type type;
TextStyleType textStyleType;
const char* text;
const char* jumpTo;
const char* playUntil;
const char* continueAt;
QString userText;
};
extern const JumpTypeTable jumpTypeTable[];
int jumpTypeTableSize();
} // namespace Ms
Q_DECLARE_METATYPE(Ms::Jump::Type);
#endif
|
/*
* (C) Copyright 2003
* Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <command.h>
#if defined(CONFIG_INCA_IP)
# include <asm/inca-ip.h>
#elif defined(CONFIG_IFX_MIPS)
# include <asm/danube.h>
# include "ifx_cpu.c"
#endif
#include <asm/mipsregs.h>
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
#if defined(CONFIG_INCA_IP)
*INCA_IP_WDT_RST_REQ = 0x3f;
#elif defined(CONFIG_PURPLE) || defined(CONFIG_TB0229)
void (*f)(void) = (void *) 0xbfc00000;
f();
#elif defined(CONFIG_IFX_MIPS)
IFX_CPU_RESET;
#endif
fprintf(stderr, "*** reset failed ***\n");
return 0;
}
void flush_cache (ulong start_addr, ulong size)
{
}
void write_one_tlb( int index, u32 pagemask, u32 hi, u32 low0, u32 low1 ){
write_32bit_cp0_register(CP0_ENTRYLO0, low0);
write_32bit_cp0_register(CP0_PAGEMASK, pagemask);
write_32bit_cp0_register(CP0_ENTRYLO1, low1);
write_32bit_cp0_register(CP0_ENTRYHI, hi);
write_32bit_cp0_register(CP0_INDEX, index);
tlb_write_indexed();
}
|
#ifndef TOUCHPANEL_H__
#define TOUCHPANEL_H__
/* Pre-defined definition */
#define TPD_TYPE_CAPACITIVE
#define TPD_TYPE_RESISTIVE
#define TPD_POWER_SOURCE MT6573_POWER_VGP2
#define TPD_I2C_NUMBER 0
#define TPD_WAKEUP_TRIAL 60
#define TPD_WAKEUP_DELAY 100
#define TPD_DELAY (2*HZ/100)
//#define TPD_RES_X 480
//#define TPD_RES_Y 800
#define TPD_CALIBRATION_MATRIX {962,0,0,0,1600,0,0,0};
#define TPD_HAVE_BUTTON
#define TPD_BUTTON_HEIGHT 480
#define TPD_KEY_COUNT 3
#define TPD_KEYS { KEY_MENU, KEY_SEARCH,KEY_BACK}
#define TPD_KEYS_DIM {{53,505,106,50},{159,505,106,50},{265,505,106,50}}
//#define TPD_HAVE_CALIBRATION
//#define TPD_HAVE_BUTTON
#define TPD_HAVE_TREMBLE_ELIMINATION
#endif /* TOUCHPANEL_H__ */
|
/*
* SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, int, msgflg)
*/
#include <sys/types.h>
#include <linux/msg.h>
#include "compat.h"
#include "sanitise.h"
struct syscallentry syscall_msgsnd = {
.name = "msgsnd",
.num_args = 4,
.arg1name = "msqid",
.arg2name = "msgp",
.arg2type = ARG_ADDRESS,
.arg3name = "msgsz",
.arg3type = ARG_LEN,
.arg4name = "msgflg",
.arg4type = ARG_LIST,
.arg4list = {
.num = 4,
.values = { MSG_NOERROR, MSG_EXCEPT, MSG_COPY, IPC_NOWAIT },
},
};
|
/*
* WavPack muxer
* Copyright (c) 2012 Paul B Mahol
*
* 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 "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
#include "apetag.h"
#define WV_EXTRA_SIZE 12
#define WV_END_BLOCK 0x1000
typedef struct{
uint32_t duration;
} WVMuxContext;
static int write_header(AVFormatContext *s)
{
AVCodecContext *codec = s->streams[0]->codec;
if (s->nb_streams > 1) {
av_log(s, AV_LOG_ERROR, "only one stream is supported\n");
return AVERROR(EINVAL);
}
if (codec->codec_id != AV_CODEC_ID_WAVPACK) {
av_log(s, AV_LOG_ERROR, "unsupported codec\n");
return AVERROR(EINVAL);
}
if (codec->extradata_size > 0) {
av_log_missing_feature(s, "remuxing from matroska container", 0);
return AVERROR_PATCHWELCOME;
}
avpriv_set_pts_info(s->streams[0], 64, 1, codec->sample_rate);
return 0;
}
static int write_packet(AVFormatContext *s, AVPacket *pkt)
{
WVMuxContext *wc = s->priv_data;
AVCodecContext *codec = s->streams[0]->codec;
AVIOContext *pb = s->pb;
uint64_t size;
uint32_t flags;
uint32_t left = pkt->size;
uint8_t *ptr = pkt->data;
int off = codec->channels > 2 ? 4 : 0;
/* FIXME: Simplify decoder/demuxer so bellow code can support midstream
* change of stream parameters */
wc->duration += pkt->duration;
ffio_wfourcc(pb, "wvpk");
if (off) {
size = AV_RL32(pkt->data);
if (size <= 12)
return AVERROR_INVALIDDATA;
size -= 12;
} else {
size = pkt->size;
}
if (size + off > left)
return AVERROR_INVALIDDATA;
avio_wl32(pb, size + 12);
avio_wl16(pb, 0x410);
avio_w8(pb, 0);
avio_w8(pb, 0);
avio_wl32(pb, -1);
avio_wl32(pb, pkt->pts);
ptr += off; left -= off;
flags = AV_RL32(ptr + 4);
avio_write(pb, ptr, size);
ptr += size; left -= size;
while (!(flags & WV_END_BLOCK) &&
(left >= 4 + WV_EXTRA_SIZE)) {
ffio_wfourcc(pb, "wvpk");
size = AV_RL32(ptr);
ptr += 4; left -= 4;
if (size < 24 || size - 24 > left)
return AVERROR_INVALIDDATA;
avio_wl32(pb, size);
avio_wl16(pb, 0x410);
avio_w8(pb, 0);
avio_w8(pb, 0);
avio_wl32(pb, -1);
avio_wl32(pb, pkt->pts);
flags = AV_RL32(ptr + 4);
avio_write(pb, ptr, WV_EXTRA_SIZE);
ptr += WV_EXTRA_SIZE; left -= WV_EXTRA_SIZE;
avio_write(pb, ptr, size - 24);
ptr += size - 24; left -= size - 24;
}
avio_flush(pb);
return 0;
}
static int write_trailer(AVFormatContext *s)
{
WVMuxContext *wc = s->priv_data;
AVIOContext *pb = s->pb;
ff_ape_write(s);
if (pb->seekable) {
avio_seek(pb, 12, SEEK_SET);
avio_wl32(pb, wc->duration);
avio_flush(pb);
}
return 0;
}
AVOutputFormat ff_wv_muxer = {
.name = "wv",
.long_name = NULL_IF_CONFIG_SMALL("WavPack"),
.priv_data_size = sizeof(WVMuxContext),
.extensions = "wv",
.audio_codec = AV_CODEC_ID_WAVPACK,
.video_codec = AV_CODEC_ID_NONE,
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
};
|
/*
* Copyright 2010 Red Hat Inc.
*
* 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
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, 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 (including the next
* paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Dave Airlie
*/
#ifndef R300_SCREEN_BUFFER_H
#define R300_SCREEN_BUFFER_H
#include <stdio.h>
#include "pipe/p_compiler.h"
#include "pipe/p_state.h"
#include "util/u_transfer.h"
#include "r300_screen.h"
#include "r300_context.h"
/* Functions. */
void r300_upload_index_buffer(struct r300_context *r300,
struct pipe_resource **index_buffer,
unsigned index_size, unsigned *start,
unsigned count, const uint8_t *ptr);
struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *templ);
/* Inline functions. */
static INLINE struct r300_buffer *r300_buffer(struct pipe_resource *buffer)
{
return (struct r300_buffer *)buffer;
}
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.