text stringlengths 4 6.14k |
|---|
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/popupwin.h
// Purpose: wxPopupWindow class for wxMSW
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.01.01
// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_POPUPWIN_H_
#define _WX_MSW_POPUPWIN_H_
// ----------------------------------------------------------------------------
// wxPopupWindow
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase
{
public:
wxPopupWindow() { m_owner = NULL; }
wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
{ (void)Create(parent, flags); }
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual ~wxPopupWindow();
virtual void SetFocus() wxOVERRIDE;
virtual bool Show(bool show = true) wxOVERRIDE;
// return the style to be used for the popup windows
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const wxOVERRIDE;
// get the HWND to be used as parent of this window with CreateWindow()
virtual WXHWND MSWGetParent() const wxOVERRIDE;
// Implementation only from now on.
// Return the top level window parent of this popup or null.
wxWindow* MSWGetOwner() const { return m_owner; }
// This is a way to notify non-wxPU_CONTAINS_CONTROLS windows about the
// events that should result in their dismissal.
virtual void MSWDismissUnfocusedPopup() { }
private:
wxWindow* m_owner;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow);
};
#endif // _WX_MSW_POPUPWIN_H_
|
/*
* Copyright (c) 2006, 2007 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* 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.
*
* 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 <linux/mm.h>
#include <linux/device.h>
#include <linux/sched.h>
#include "ipath_kernel.h"
static void __ipath_release_user_pages(struct page **p, size_t num_pages,
int dirty)
{
size_t i;
for (i = 0; i < num_pages; i++) {
ipath_cdbg(MM, "%lu/%lu put_page %p\n", (unsigned long) i,
(unsigned long) num_pages, p[i]);
if (dirty)
set_page_dirty_lock(p[i]);
put_page(p[i]);
}
}
/* call with current->mm->mmap_sem held */
static int __get_user_pages(unsigned long start_page, size_t num_pages,
struct page **p, struct vm_area_struct **vma)
{
unsigned long lock_limit;
size_t got;
int ret;
lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >>
PAGE_SHIFT;
if (num_pages > lock_limit) {
ret = -ENOMEM;
goto bail;
}
ipath_cdbg(VERBOSE, "pin %lx pages from vaddr %lx\n",
(unsigned long) num_pages, start_page);
for (got = 0; got < num_pages; got += ret) {
ret = get_user_pages(current, current->mm,
start_page + got * PAGE_SIZE,
num_pages - got, 1, 1,
p + got, vma);
if (ret < 0)
goto bail_release;
}
current->mm->locked_vm += num_pages;
ret = 0;
goto bail;
bail_release:
__ipath_release_user_pages(p, got, 0);
bail:
return ret;
}
/**
* ipath_map_page - a safety wrapper around pci_map_page()
*
* A dma_addr of all 0's is interpreted by the chip as "disabled".
* Unfortunately, it can also be a valid dma_addr returned on some
* architectures.
*
* The powerpc iommu assigns dma_addrs in ascending order, so we don't
* have to bother with retries or mapping a dummy page to insure we
* don't just get the same mapping again.
*
* I'm sure we won't be so lucky with other iommu's, so FIXME.
*/
dma_addr_t ipath_map_page(struct pci_dev *hwdev, struct page *page,
unsigned long offset, size_t size, int direction)
{
dma_addr_t phys;
phys = pci_map_page(hwdev, page, offset, size, direction);
if (phys == 0) {
pci_unmap_page(hwdev, phys, size, direction);
phys = pci_map_page(hwdev, page, offset, size, direction);
/*
* FIXME: If we get 0 again, we should keep this page,
* map another, then free the 0 page.
*/
}
return phys;
}
/**
* ipath_map_single - a safety wrapper around pci_map_single()
*
* Same idea as ipath_map_page().
*/
dma_addr_t ipath_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
int direction)
{
dma_addr_t phys;
phys = pci_map_single(hwdev, ptr, size, direction);
if (phys == 0) {
pci_unmap_single(hwdev, phys, size, direction);
phys = pci_map_single(hwdev, ptr, size, direction);
/*
* FIXME: If we get 0 again, we should keep this page,
* map another, then free the 0 page.
*/
}
return phys;
}
/**
* ipath_get_user_pages - lock user pages into memory
* @start_page: the start page
* @num_pages: the number of pages
* @p: the output page structures
*
* This function takes a given start page (page aligned user virtual
* address) and pins it and the following specified number of pages. For
* now, num_pages is always 1, but that will probably change at some point
* (because caller is doing expected sends on a single virtually contiguous
* buffer, so we can do all pages at once).
*/
int ipath_get_user_pages(unsigned long start_page, size_t num_pages,
struct page **p)
{
int ret;
down_write(¤t->mm->mmap_sem);
ret = __get_user_pages(start_page, num_pages, p, NULL);
up_write(¤t->mm->mmap_sem);
return ret;
}
void ipath_release_user_pages(struct page **p, size_t num_pages)
{
down_write(¤t->mm->mmap_sem);
__ipath_release_user_pages(p, num_pages, 1);
current->mm->locked_vm -= num_pages;
up_write(¤t->mm->mmap_sem);
}
struct ipath_user_pages_work {
struct work_struct work;
struct mm_struct *mm;
unsigned long num_pages;
};
static void user_pages_account(struct work_struct *_work)
{
struct ipath_user_pages_work *work =
container_of(_work, struct ipath_user_pages_work, work);
down_write(&work->mm->mmap_sem);
work->mm->locked_vm -= work->num_pages;
up_write(&work->mm->mmap_sem);
mmput(work->mm);
kfree(work);
}
void ipath_release_user_pages_on_close(struct page **p, size_t num_pages)
{
struct ipath_user_pages_work *work;
struct mm_struct *mm;
__ipath_release_user_pages(p, num_pages, 1);
mm = get_task_mm(current);
if (!mm)
return;
work = kmalloc(sizeof(*work), GFP_KERNEL);
if (!work)
goto bail_mm;
INIT_WORK(&work->work, user_pages_account);
work->mm = mm;
work->num_pages = num_pages;
schedule_work(&work->work);
return;
bail_mm:
mmput(mm);
return;
}
|
//
// FTPStreamFactory.h
//
// $Id: //poco/1.4/Net/include/Poco/Net/FTPStreamFactory.h#1 $
//
// Library: Net
// Package: FTP
// Module: FTPStreamFactory
//
// Definition of the FTPStreamFactory class.
//
// Copyright (c) 2005-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 Net_FTPStreamFactory_INCLUDED
#define Net_FTPStreamFactory_INCLUDED
#include "Poco/Net/Net.h"
#include "Poco/Net/HTTPSession.h"
#include "Poco/URIStreamFactory.h"
namespace Poco {
namespace Net {
class Net_API FTPPasswordProvider
/// The base class for all password providers.
/// An instance of a subclass of this class can be
/// registered with the FTPStreamFactory to
/// provide a password
{
public:
virtual std::string password(const std::string& username, const std::string& host) = 0;
/// Provide the password for the given user on the given host.
protected:
FTPPasswordProvider();
virtual ~FTPPasswordProvider();
};
class Net_API FTPStreamFactory: public Poco::URIStreamFactory
/// An implementation of the URIStreamFactory interface
/// that handles File Transfer Protocol (ftp) URIs.
///
/// The URI's path may end with an optional type specification
/// in the form (;type=<typecode>), where <typecode> is
/// one of a, i or d. If type=a, the file identified by the path
/// is transferred in ASCII (text) mode. If type=i, the file
/// is transferred in Image (binary) mode. If type=d, a directory
/// listing (in NLST format) is returned. This corresponds with
/// the FTP URL format specified in RFC 1738.
///
/// If the URI does not contain a username and password, the
/// username "anonymous" and the password "
{
public:
FTPStreamFactory();
/// Creates the FTPStreamFactory.
~FTPStreamFactory();
/// Destroys the FTPStreamFactory.
std::istream* open(const Poco::URI& uri);
/// Creates and opens a HTTP stream for the given URI.
/// The URI must be a ftp://... URI.
///
/// Throws a NetException if anything goes wrong.
static void setAnonymousPassword(const std::string& password);
/// Sets the password used for anonymous FTP.
///
/// WARNING: Setting the anonymous password is not
/// thread-safe, so it's best to call this method
/// during application initialization, before the
/// FTPStreamFactory is used for the first time.
static const std::string& getAnonymousPassword();
/// Returns the password used for anonymous FTP.
static void setPasswordProvider(FTPPasswordProvider* pProvider);
/// Sets the FTPPasswordProvider. If NULL is given,
/// no password provider is used.
///
/// WARNING: Setting the password provider is not
/// thread-safe, so it's best to call this method
/// during application initialization, before the
/// FTPStreamFactory is used for the first time.
static FTPPasswordProvider* getPasswordProvider();
/// Returns the FTPPasswordProvider currently in use,
/// or NULL if no one has been set.
static void registerFactory();
/// Registers the FTPStreamFactory with the
/// default URIStreamOpener instance.
protected:
static void splitUserInfo(const std::string& userInfo, std::string& username, std::string& password);
static void getUserInfo(const Poco::URI& uri, std::string& username, std::string& password);
static void getPathAndType(const Poco::URI& uri, std::string& path, char& type);
private:
static std::string _anonymousPassword;
static FTPPasswordProvider* _pPasswordProvider;
};
} } // namespace Poco::Net
#endif // Net_FTPStreamFactory_INCLUDED
|
/* This file contains some structures used by the Mitsumi cdrom driver.
*
* Feb 13 1995 Author: Michel R. Prevenier
*/
/* Index into the mss arrays */
#define MINUTES 0
#define SECONDS 1
#define SECTOR 2
struct cd_play_mss
{
u8_t begin_mss[3];
u8_t end_mss[3];
};
struct cd_play_track
{
u8_t begin_track;
u8_t end_track;
};
struct cd_disk_info
{
u8_t first_track;
u8_t last_track;
u8_t disk_length_mss[3];
u8_t first_track_mss[3];
};
struct cd_toc_entry
{
u8_t control_address;
u8_t track_nr;
u8_t index_nr;
u8_t track_time_mss[3];
u8_t reserved;
u8_t position_mss[3];
};
|
/* Copyright 2012 exMULTI, Inc.
* Distributed under the MIT/X11 software license, see the accompanying
* file COPYING or http://www.opensource.org/licenses/mit-license.php.
*/
#include "picocoin-config.h"
#include <string.h>
#include <ccoin/coredefs.h>
#include <ccoin/util.h>
const struct chain_info chain_metadata[] = {
[CHAIN_BITCOIN] = {
CHAIN_BITCOIN, "bitcoin",
PUBKEY_ADDRESS, SCRIPT_ADDRESS,
"\xf9\xbe\xb4\xd9",
"0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
},
[CHAIN_TESTNET3] = {
CHAIN_TESTNET3, "testnet3",
PUBKEY_ADDRESS_TEST, SCRIPT_ADDRESS_TEST,
"\x0b\x11\x09\x07",
"0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"
},
};
const struct chain_info *chain_find(const char *name)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(chain_metadata); i++) {
const struct chain_info *chain;
chain = &chain_metadata[i];
if (!chain->name || !chain->genesis_hash)
continue;
if (!strcmp(name, chain->name))
return chain;
}
return NULL;
}
const struct chain_info *chain_find_by_netmagic(const unsigned char netmagic[4])
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(chain_metadata); i++) {
const struct chain_info *chain;
chain = &chain_metadata[i];
if (!chain->name || !chain->genesis_hash)
continue;
if (!memcmp(netmagic, chain->netmagic, 4))
return chain;
}
return NULL;
}
|
/*
* Copyright 2012 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 <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol FBGraphObject;
@interface FBUtility : NSObject
+ (NSDictionary*)dictionaryByParsingURLQueryPart:(NSString *)encodedString;
+ (NSString *)stringByURLDecodingString:(NSString*)escapedString;
+ (NSString*)stringByURLEncodingString:(NSString*)unescapedString;
+ (id<FBGraphObject>)graphObjectInArray:(NSArray*)array withSameIDAs:(id<FBGraphObject>)item;
+ (unsigned long)currentTimeInMilliseconds;
+ (NSTimeInterval)randomTimeInterval:(NSTimeInterval)minValue withMaxValue:(NSTimeInterval)maxValue;
+ (void)centerView:(UIView*)view tableView:(UITableView*)tableView;
+ (NSString *)stringFBIDFromObject:(id)object;
+ (NSBundle *)facebookSDKBundle;
+ (NSString *)localizedStringForKey:(NSString *)key
withDefault:(NSString *)value;
+ (NSString *)localizedStringForKey:(NSString *)key
withDefault:(NSString *)value
inBundle:(NSBundle *)bundle;
@end
#define FBConditionalLog(condition, desc, ...) \
do { \
if (!(condition)) { \
NSString *msg = [NSString stringWithFormat:(desc), ##__VA_ARGS__]; \
NSLog(@"FBConditionalLog: %@", msg); \
} \
} while(NO)
#define FB_BASE_URL @"facebook.com"
|
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//===========================================================================//
#if !defined( IVIEWRENDER_H )
#define IVIEWRENDER_H
#ifdef _WIN32
#pragma once
#endif
#include "ivrenderview.h"
#define MAX_DEPTH_TEXTURE_SHADOWS 16
#define MAX_DEPTH_TEXTURE_HIGHRES_SHADOWS 0
#define MAX_DEPTH_TEXTURE_SHADOWS_TOOLS 8
#define MAX_DEPTH_TEXTURE_HIGHRES_SHADOWS_TOOLS 0
// These are set as it draws reflections, refractions, etc, so certain effects can avoid
// drawing themselves in reflections.
enum DrawFlags_t
{
DF_RENDER_REFRACTION = 0x1,
DF_RENDER_REFLECTION = 0x2,
DF_CLIP_Z = 0x4,
DF_CLIP_BELOW = 0x8,
DF_RENDER_UNDERWATER = 0x10,
DF_RENDER_ABOVEWATER = 0x20,
DF_RENDER_WATER = 0x40,
DF_UNUSED1 = 0x100,
DF_WATERHEIGHT = 0x200,
DF_UNUSED2 = 0x400,
DF_DRAWSKYBOX = 0x800,
DF_FUDGE_UP = 0x1000,
DF_DRAW_ENTITITES = 0x2000,
DF_SKIP_WORLD = 0x4000,
DF_SKIP_WORLD_DECALS_AND_OVERLAYS = 0x8000,
DF_UNUSED5 = 0x10000,
DF_SAVEGAMESCREENSHOT = 0x20000,
DF_CLIP_SKYBOX = 0x40000,
DF_SHADOW_DEPTH_MAP = 0x100000 // Currently rendering a shadow depth map
};
//-----------------------------------------------------------------------------
// Purpose: View setup and rendering
//-----------------------------------------------------------------------------
class CViewSetup;
class C_BaseEntity;
struct vrect_t;
class C_BaseViewModel;
abstract_class IViewRender
{
public:
// SETUP
// Initialize view renderer
virtual void Init( void ) = 0;
// Clear any systems between levels
virtual void LevelInit( void ) = 0;
virtual void LevelShutdown( void ) = 0;
// Shutdown
virtual void Shutdown( void ) = 0;
// RENDERING
// Called right before simulation. It must setup the view model origins and angles here so
// the correct attachment points can be used during simulation.
virtual void OnRenderStart() = 0;
// Called to render the entire scene
virtual void Render( vrect_t *rect ) = 0;
// Called to render just a particular setup ( for timerefresh and envmap creation )
// First argument is 3d view setup, second is for the HUD (in most cases these are ==, but in split screen the client .dll handles this differently)
virtual void RenderView( const CViewSetup &view, const CViewSetup &hudViewSetup, int nClearFlags, int whatToDraw ) = 0;
// What are we currently rendering? Returns a combination of DF_ flags.
virtual int GetDrawFlags() = 0;
// MISC
// Start and stop pitch drifting logic
virtual void StartPitchDrift( void ) = 0;
virtual void StopPitchDrift( void ) = 0;
// This can only be called during rendering (while within RenderView).
virtual VPlane* GetFrustum() = 0;
virtual bool ShouldDrawBrushModels( void ) = 0;
virtual const CViewSetup *GetPlayerViewSetup( int nSlot = -1 ) const = 0;
virtual const CViewSetup *GetViewSetup( void ) const = 0;
virtual void DisableVis( void ) = 0;
virtual int BuildWorldListsNumber() const = 0;
virtual void SetCheapWaterStartDistance( float flCheapWaterStartDistance ) = 0;
virtual void SetCheapWaterEndDistance( float flCheapWaterEndDistance ) = 0;
virtual void GetWaterLODParams( float &flCheapWaterStartDistance, float &flCheapWaterEndDistance ) = 0;
virtual void DriftPitch (void) = 0;
virtual void SetScreenOverlayMaterial( IMaterial *pMaterial ) = 0;
virtual IMaterial *GetScreenOverlayMaterial( ) = 0;
virtual void WriteSaveGameScreenshot( const char *pFilename ) = 0;
virtual void WriteSaveGameScreenshotOfSize( const char *pFilename, int width, int height ) = 0;
// Draws another rendering over the top of the screen
virtual void QueueOverlayRenderView( const CViewSetup &view, int nClearFlags, int whatToDraw ) = 0;
// Returns znear and zfar
virtual float GetZNear() = 0;
virtual float GetZFar() = 0;
virtual void GetScreenFadeDistances( float *min, float *max ) = 0;
virtual bool AllowScreenspaceFade( void ) = 0;
virtual C_BaseEntity *GetCurrentlyDrawingEntity() = 0;
virtual void SetCurrentlyDrawingEntity( C_BaseEntity *pEnt ) = 0;
virtual bool UpdateShadowDepthTexture( ITexture *pRenderTarget, ITexture *pDepthTexture, const CViewSetup &shadowView ) = 0;
virtual void FreezeFrame( float flFreezeTime ) = 0;
virtual void InitFadeData( void ) = 0;
};
extern IViewRender *view;
extern IViewRender *GetViewRenderInstance();
#endif // IVIEWRENDER_H
|
//
// TKProgressCircleView.h
// TapkuLibrary
//
// Created by Devin Ross on 1/1/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TKProgressCircleView : UIView {
BOOL _twirlMode;
float _progress,_displayProgress;
}
- (id) init;
@property (assign,nonatomic) float progress; // between 0.0 & 1.0
@property (assign,nonatomic,getter=isTwirling) BOOL twirlMode;
- (void) setProgress:(float)progress animated:(BOOL)animated;
@end |
/* Generated automatically. */
static const char configuration_arguments[] = "../gcc/configure --target=x86_64-elf --prefix=/Users/zhiayang/cross --disable-nls --enable-languages=c,c++ --without-headers";
static const char thread_model[] = "single";
static const struct {
const char *name, *value;
} configure_default_options[] = { { "cpu", "generic" }, { "arch", "x86-64" } };
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Navigation\0.18.8\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Triggers.Actions.TriggerAction.h>
namespace g{namespace Fuse{namespace Navigation{struct NavigationTriggerAction;}}}
namespace g{namespace Fuse{struct Node;}}
namespace g{
namespace Fuse{
namespace Navigation{
// public abstract class NavigationTriggerAction :2013
// {
struct NavigationTriggerAction_type : ::g::Fuse::Triggers::Actions::TriggerAction_type
{
void(*fp_Perform1)(::g::Fuse::Navigation::NavigationTriggerAction*, uObject*, ::g::Fuse::Node*);
};
NavigationTriggerAction_type* NavigationTriggerAction_typeof();
void NavigationTriggerAction__ctor_1_fn(NavigationTriggerAction* __this);
void NavigationTriggerAction__get_NavigationContext_fn(NavigationTriggerAction* __this, uObject** __retval);
void NavigationTriggerAction__set_NavigationContext_fn(NavigationTriggerAction* __this, uObject* value);
void NavigationTriggerAction__Perform_fn(NavigationTriggerAction* __this, ::g::Fuse::Node* n);
struct NavigationTriggerAction : ::g::Fuse::Triggers::Actions::TriggerAction
{
uStrong<uObject*> _NavigationContext;
void ctor_1();
uObject* NavigationContext();
void NavigationContext(uObject* value);
void Perform1(uObject* ctx, ::g::Fuse::Node* n) { (((NavigationTriggerAction_type*)__type)->fp_Perform1)(this, ctx, n); }
};
// }
}}} // ::g::Fuse::Navigation
|
#ifndef STK_BOWTABL_H
#define STK_BOWTABL_H
#include "Function.h"
#include <cmath>
namespace stk {
/***************************************************/
/*! \class BowTable
\brief STK bowed string table class.
This class implements a simple bowed string
non-linear function, as described by Smith
(1986). The output is an instantaneous
reflection coefficient value.
by Perry R. Cook and Gary P. Scavone, 1995--2014.
*/
/***************************************************/
class BowTable : public Function
{
public:
//! Default constructor.
BowTable( void ) : offset_(0.0), slope_(0.1), minOutput_(0.01), maxOutput_(0.98) {};
//! Set the table offset value.
/*!
The table offset is a bias which controls the
symmetry of the friction. If you want the
friction to vary with direction, use a non-zero
value for the offset. The default value is zero.
*/
void setOffset( StkFloat offset ) { offset_ = offset; };
//! Set the table slope value.
/*!
The table slope controls the width of the friction
pulse, which is related to bow force.
*/
void setSlope( StkFloat slope ) { slope_ = slope; };
//! Set the minimum table output value (0.0 - 1.0).
void setMinOutput( StkFloat minimum ) { minOutput_ = minimum; };
//! Set the maximum table output value (0.0 - 1.0).
void setMaxOutput( StkFloat maximum ) { maxOutput_ = maximum; };
//! Take one sample input and map to one sample of output.
StkFloat tick( StkFloat input );
//! Take a channel of the StkFrames object as inputs to the table and replace with corresponding outputs.
/*!
The StkFrames argument reference is returned. The \c channel
argument must be less than the number of channels in the
StkFrames argument (the first channel is specified by 0).
However, range checking is only performed if _STK_DEBUG_ is
defined during compilation, in which case an out-of-range value
will trigger an StkError exception.
*/
StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
//! Take a channel of the \c iFrames object as inputs to the table and write outputs to the \c oFrames object.
/*!
The \c iFrames object reference is returned. Each channel
argument must be less than the number of channels in the
corresponding StkFrames argument (the first channel is specified
by 0). However, range checking is only performed if _STK_DEBUG_
is defined during compilation, in which case an out-of-range value
will trigger an StkError exception.
*/
StkFrames& tick( StkFrames& iFrames, StkFrames &oFrames, unsigned int iChannel = 0, unsigned int oChannel = 0 );
protected:
StkFloat offset_;
StkFloat slope_;
StkFloat minOutput_;
StkFloat maxOutput_;
};
inline StkFloat BowTable :: tick( StkFloat input )
{
// The input represents differential string vs. bow velocity.
StkFloat sample = input + offset_; // add bias to input
sample *= slope_; // then scale it
lastFrame_[0] = (StkFloat) fabs( (double) sample ) + (StkFloat) 0.75;
lastFrame_[0] = (StkFloat) pow( lastFrame_[0], (StkFloat) -4.0 );
// Set minimum threshold
if ( lastFrame_[0] < minOutput_ ) lastFrame_[0] = minOutput_;
// Set maximum threshold
if ( lastFrame_[0] > maxOutput_ ) lastFrame_[0] = maxOutput_;
return lastFrame_[0];
}
inline StkFrames& BowTable :: tick( StkFrames& frames, unsigned int channel )
{
#if defined(_STK_DEBUG_)
if ( channel >= frames.channels() ) {
oStream_ << "BowTable::tick(): channel and StkFrames arguments are incompatible!";
handleError( StkError::FUNCTION_ARGUMENT );
}
#endif
StkFloat *samples = &frames[channel];
unsigned int hop = frames.channels();
for ( unsigned int i=0; i<frames.frames(); i++, samples += hop ) {
*samples = *samples + offset_;
*samples *= slope_;
*samples = (StkFloat) fabs( (double) *samples ) + 0.75;
*samples = (StkFloat) pow( *samples, (StkFloat) -4.0 );
if ( *samples > 1.0) *samples = 1.0;
}
lastFrame_[0] = *(samples-hop);
return frames;
}
inline StkFrames& BowTable :: tick( StkFrames& iFrames, StkFrames& oFrames, unsigned int iChannel, unsigned int oChannel )
{
#if defined(_STK_DEBUG_)
if ( iChannel >= iFrames.channels() || oChannel >= oFrames.channels() ) {
oStream_ << "BowTable::tick(): channel and StkFrames arguments are incompatible!";
handleError( StkError::FUNCTION_ARGUMENT );
}
#endif
StkFloat *iSamples = &iFrames[iChannel];
StkFloat *oSamples = &oFrames[oChannel];
unsigned int iHop = iFrames.channels(), oHop = oFrames.channels();
for ( unsigned int i=0; i<iFrames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
*oSamples = *iSamples + offset_;
*oSamples *= slope_;
*oSamples = (StkFloat) fabs( (double) *oSamples ) + 0.75;
*oSamples = (StkFloat) pow( *oSamples, (StkFloat) -4.0 );
if ( *oSamples > 1.0) *oSamples = 1.0;
}
lastFrame_[0] = *(oSamples-oHop);
return iFrames;
}
} // stk namespace
#endif
|
/*
Copyright 2011 Etay Meiri
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIGHTING_TECHNIQUE_H
#define LIGHTING_TECHNIQUE_H
#include "technique.h"
#include "ogldev_math_3d.h"
struct DirectionalLight
{
Vector3f Color;
float AmbientIntensity;
Vector3f Direction;
float DiffuseIntensity;
};
class LightingTechnique : public Technique
{
public:
LightingTechnique();
virtual bool Init();
void SetWVP(const Matrix4f& WVP);
void SetWorldMatrix(const Matrix4f& WVP);
void SetTextureUnit(unsigned int TextureUnit);
void SetDirectionalLight(const DirectionalLight& Light);
private:
GLuint m_WVPLocation;
GLuint m_WorldMatrixLocation;
GLuint m_samplerLocation;
struct {
GLuint Color;
GLuint AmbientIntensity;
GLuint Direction;
GLuint DiffuseIntensity;
} m_dirLightLocation;
};
#endif /* LIGHTING_TECHNIQUE_H */
|
//
// LPMainViewController.h
// LPPlacesAutocomplateService
//
// Created by Luka Penger on 8/21/13.
// Copyright (c) 2013 Luka Penger. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import "LPGoogleFunctions.h"
@interface LPMainViewController : UIViewController <LPGoogleFunctionsDelegate, CLLocationManagerDelegate>
@property (nonatomic, strong) IBOutlet UITextView *textView;
@end
|
/*
* PHP Libgit2 Extension
*
* https://github.com/libgit2/php-git
*
* Copyright 2014 Shuhei Tanuma. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef PHP_GIT2_STATUS_H
#define PHP_GIT2_STATUS_H
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_foreach, 0, 0, 3)
ZEND_ARG_INFO(0, repo)
ZEND_ARG_INFO(0, callback)
ZEND_ARG_INFO(1, payload)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_foreach_ext, 0, 0, 4)
ZEND_ARG_INFO(0, repo)
ZEND_ARG_INFO(0, opts)
ZEND_ARG_INFO(0, callback)
ZEND_ARG_INFO(1, payload)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_file, 0, 0, 3)
ZEND_ARG_INFO(0, status_flags)
ZEND_ARG_INFO(0, repo)
ZEND_ARG_INFO(0, path)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_list_new, 0, 0, 2)
ZEND_ARG_INFO(0, repo)
ZEND_ARG_INFO(0, opts)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_list_entrycount, 0, 0, 1)
ZEND_ARG_INFO(0, statuslist)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_byindex, 0, 0, 2)
ZEND_ARG_INFO(0, statuslist)
ZEND_ARG_INFO(0, idx)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_list_free, 0, 0, 1)
ZEND_ARG_INFO(0, statuslist)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_status_should_ignore, 0, 0, 3)
ZEND_ARG_INFO(0, ignored)
ZEND_ARG_INFO(0, repo)
ZEND_ARG_INFO(0, path)
ZEND_END_ARG_INFO()
/* {{{ proto long git_status_foreach(repo, callback, payload)
*/
PHP_FUNCTION(git_status_foreach);
/* {{{ proto long git_status_foreach_ext(repo, opts, callback, payload)
*/
PHP_FUNCTION(git_status_foreach_ext);
/* {{{ proto long git_status_file(status_flags, repo, path)
*/
PHP_FUNCTION(git_status_file);
/* {{{ proto resource git_status_list_new(repo, opts)
*/
PHP_FUNCTION(git_status_list_new);
/* {{{ proto resource git_status_list_entrycount(statuslist)
*/
PHP_FUNCTION(git_status_list_entrycount);
/* {{{ proto resource git_status_byindex(statuslist, idx)
*/
PHP_FUNCTION(git_status_byindex);
/* {{{ proto void git_status_list_free(statuslist)
*/
PHP_FUNCTION(git_status_list_free);
/* {{{ proto long git_status_should_ignore(ignored, repo, path)
*/
PHP_FUNCTION(git_status_should_ignore);
PHP_FUNCTION(git_status_options_new);
#endif |
/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef _CONN_MW_BLE_L2CAP_H_
#define _CONN_MW_BLE_L2CAP_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**@brief Handles @ref sd_ble_l2cap_cid_register command and prepares response.
*
* @param[in] p_rx_buf Pointer to input buffer.
* @param[in] rx_buf_len Size of p_rx_buf.
* @param[out] p_tx_buf Pointer to output buffer.
* @param[in,out] p_tx_buf_len \c in: size of \p p_tx_buf buffer.
* \c out: Length of valid data in \p p_tx_buf.
*
* @retval NRF_SUCCESS Handler success.
* @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied.
* @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length.
* @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type.
*/
uint32_t conn_mw_ble_l2cap_cid_register(uint8_t const * const p_rx_buf,
uint32_t rx_buf_len,
uint8_t * const p_tx_buf,
uint32_t * const p_tx_buf_len);
/**@brief Handles @ref sd_ble_l2cap_cid_unregister command and prepares response.
*
* @param[in] p_rx_buf Pointer to input buffer.
* @param[in] rx_buf_len Size of p_rx_buf.
* @param[out] p_tx_buf Pointer to output buffer.
* @param[in,out] p_tx_buf_len \c in: size of \p p_tx_buf buffer.
* \c out: Length of valid data in \p p_tx_buf.
*
* @retval NRF_SUCCESS Handler success.
* @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied.
* @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length.
* @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type.
*/
uint32_t conn_mw_ble_l2cap_cid_unregister(uint8_t const * const p_rx_buf,
uint32_t rx_buf_len,
uint8_t * const p_tx_buf,
uint32_t * const p_tx_buf_len);
/**@brief Handles @ref sd_ble_l2cap_tx command and prepares response.
*
* @param[in] p_rx_buf Pointer to input buffer.
* @param[in] rx_buf_len Size of p_rx_buf.
* @param[out] p_tx_buf Pointer to output buffer.
* @param[in,out] p_tx_buf_len \c in: size of \p p_tx_buf buffer.
* \c out: Length of valid data in \p p_tx_buf.
*
* @retval NRF_SUCCESS Handler success.
* @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied.
* @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length.
* @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type.
*/
uint32_t conn_mw_ble_l2cap_tx(uint8_t const * const p_rx_buf,
uint32_t rx_buf_len,
uint8_t * const p_tx_buf,
uint32_t * const p_tx_buf_len);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* serial-iec.h
*
* Written by
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#ifndef VICE_SERIAL_IEC_H
#define VICE_SERIAL_IEC_H
#include "types.h"
extern int serial_iec_open(unsigned int unit, unsigned int secondary,
const char *name, unsigned int length);
extern int serial_iec_close(unsigned int unit, unsigned int secondary);
extern int serial_iec_read(unsigned int unit, unsigned int secondary,
BYTE *data);
extern int serial_iec_write(unsigned int unit, unsigned int secondary,
BYTE data);
extern int serial_iec_flush(unsigned int unit, unsigned int secondary);
#endif
|
/* sam_opts.c -- utilities to aid parsing common command line options.
Copyright (C) 2015 Genome Research Ltd.
Author: James Bonfield <jkb@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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sam_opts.h"
/*
* Processes a standard "global" samtools long option.
*
* The 'c' value is the return value from a getopt_long() call. It is checked
* against the lopt[] array to find the corresponding value as this may have
* been reassigned by the individual subcommand.
*
* Having found the entry, the corresponding long form is used to apply the
* option, storing the setting in sam_global_args *ga.
*
* Returns 0 on success,
* -1 on failure.
*/
int parse_sam_global_opt(int c, const char *optarg, const struct option *lopt,
sam_global_args *ga) {
int r = 0;
while (lopt->name) {
if (c != lopt->val) {
lopt++;
continue;
}
if (strcmp(lopt->name, "input-fmt") == 0) {
r = hts_parse_format(&ga->in, optarg);
break;
} else if (strcmp(lopt->name, "input-fmt-option") == 0) {
r = hts_opt_add((hts_opt **)&ga->in.specific, optarg);
break;
} else if (strcmp(lopt->name, "output-fmt") == 0) {
r = hts_parse_format(&ga->out, optarg);
break;
} else if (strcmp(lopt->name, "output-fmt-option") == 0) {
r = hts_opt_add((hts_opt **)&ga->out.specific, optarg);
break;
} else if (strcmp(lopt->name, "reference") == 0) {
char *ref = malloc(10 + strlen(optarg) + 1);
sprintf(ref, "reference=%s", optarg);
ga->reference = strdup(optarg);
r = hts_opt_add((hts_opt **)&ga->in.specific, ref);
r |= hts_opt_add((hts_opt **)&ga->out.specific, ref);
free(ref);
break;
} else if (strcmp(lopt->name, "threads") == 0) {
ga->nthreads = atoi(optarg);
break;
// } else if (strcmp(lopt->name, "verbose") == 0) {
// ga->verbosity++;
// break;
}
}
if (!lopt->name) {
fprintf(stderr, "Unexpected global option: %s\n", lopt->name);
return -1;
}
return r;
}
/*
* Report the usage for global options.
*
* This accepts a string with one character per SAM_OPT_GLOBAL_OPTIONS option
* to determine which options need to be printed and how.
* Each character should be one of:
* '.' No short option has been assigned. Use --long-opt only.
* '-' The long (and short) option has been disabled.
* <c> Otherwise the short option is character <c>.
*/
void sam_global_opt_help(FILE *fp, const char *shortopts) {
int i = 0;
static const struct option lopts[] = {
SAM_OPT_GLOBAL_OPTIONS(0,0,0,0,0,0),
{ NULL, 0, NULL, 0 }
};
for (i = 0; shortopts && shortopts[i] && lopts[i].name; i++) {
if (shortopts[i] == '-')
continue;
if (shortopts[i] == '.')
fprintf(fp, " --");
else
fprintf(fp, " -%c, --", shortopts[i]);
if (strcmp(lopts[i].name, "input-fmt") == 0)
fprintf(fp,"input-fmt FORMAT[,OPT[=VAL]]...\n"
" Specify input format (SAM, BAM, CRAM)\n");
else if (strcmp(lopts[i].name, "input-fmt-option") == 0)
fprintf(fp,"input-fmt-option OPT[=VAL]\n"
" Specify a single input file format option in the form\n"
" of OPTION or OPTION=VALUE\n");
else if (strcmp(lopts[i].name, "output-fmt") == 0)
fprintf(fp,"output-fmt FORMAT[,OPT[=VAL]]...\n"
" Specify output format (SAM, BAM, CRAM)\n");
else if (strcmp(lopts[i].name, "output-fmt-option") == 0)
fprintf(fp,"output-fmt-option OPT[=VAL]\n"
" Specify a single output file format option in the form\n"
" of OPTION or OPTION=VALUE\n");
else if (strcmp(lopts[i].name, "reference") == 0)
fprintf(fp,"reference FILE\n"
" Reference sequence FASTA FILE [null]\n");
else if (strcmp(lopts[i].name, "threads") == 0)
fprintf(fp,"threads INT\n"
" Number of additional threads to use [0]\n");
// else if (strcmp(lopts[i].name, "verbose") == 0)
// fprintf(fp,"verbose\n"
// " Increment level of verbosity\n");
}
}
void sam_global_args_init(sam_global_args *ga) {
if (!ga)
return;
memset(ga, 0, sizeof(*ga));
}
void sam_global_args_free(sam_global_args *ga) {
if (ga->in.specific)
hts_opt_free(ga->in.specific);
if (ga->out.specific)
hts_opt_free(ga->out.specific);
if (ga->reference)
free(ga->reference);
}
|
/* A special sequence is a sequence where no two adjacent numbers are the same,
* and it only uses the numbers 1, 2, 3 and 4.
*
* We are interested in finding every special sequence with a given number of 1s, 2s,
* 3s and 4s. Let n1 be the desired number of 1s, n2 the desired number of 2s, etc.
*
* Write a method that, given n1, n2, n3 and n4, returns how many special sequences exist.
*
* EXAMPLE
* If n1 = n2 = n3 = n4, we are looking for special sequences that have a 1, a 2 a 3 and a 4.
* There are 24 of these:
* 1, 2, 3, 4
* 1, 2, 4, 3
* 1, 4, 2, 3
* ...
*
* Source: Careercup (Google interview)
*/
#include <stdio.h>
unsigned generate_sequences_aux(unsigned available[4], unsigned still_usable, unsigned last) {
if (still_usable == 0) {
return 1;
}
unsigned res = 0;
size_t i;
for (i = 0; i < 4; i++) {
if (available[i] == 0 || i+1 == last) {
continue;
}
available[i]--;
still_usable--;
res += generate_sequences_aux(available, still_usable, i+1);
available[i]++;
still_usable++;
}
return res;
}
unsigned generate_sequences(unsigned available[4]) {
unsigned total = 0;
size_t i;
for (i = 0; i < 4; i++) {
total += available[i];
}
if (total == 0) {
return 0;
}
unsigned res = 0;
for (i = 0; i < 4; i++) {
if (available[i] > 0) {
available[i]--;
res += generate_sequences_aux(available, total-1, i+1);
available[i]++;
}
}
return res;
}
int main(void) {
unsigned values[4];
printf("Enter n1, n2, n3 and n4\n");
printf("> ");
while (scanf("%u%u%u%u", &values[0], &values[1], &values[2], &values[3]) == 4) {
printf("There are %u possible sequences\n", generate_sequences(values));
printf("> ");
}
return 0;
}
|
/*
* S2E Selective Symbolic Execution Framework
*
* Copyright (c) 2010, Dependable Systems Laboratory, EPFL
* 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 Dependable Systems Laboratory, EPFL 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 DEPENDABLE SYSTEMS LABORATORY, EPFL 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.
*
* Currently maintained by:
* Vitaly Chipounov <vitaly.chipounov@epfl.ch>
* Volodymyr Kuznetsov <vova.kuznetsov@epfl.ch>
*
* All contributors are listed in S2E-AUTHORS file.
*
*/
#ifndef S2E_PLUGINS_BSOD_H
#define S2E_PLUGINS_BSOD_H
#include <s2e/Plugin.h>
#include <s2e/Plugins/CorePlugin.h>
#include <s2e/S2EExecutionState.h>
#include "WindowsMonitor.h"
#include "WindowsImage.h"
#include "WindowsCrashDumpGenerator.h"
namespace s2e {
namespace plugins {
enum BsodCodes
{
CRITICAL_OBJECT_TERMINATION = 0xf4
};
class BlueScreenInterceptor : public Plugin
{
S2E_PLUGIN
public:
BlueScreenInterceptor(S2E* s2e): Plugin(s2e) {}
void initialize();
void generateDump(S2EExecutionState *state, const std::string &prefix);
void generateDumpOnBsod(S2EExecutionState *state, const std::string &prefix);
void enableCrashDumpGeneration(bool b) {
m_generateCrashDump = b;
}
private:
WindowsMonitor *m_monitor;
WindowsCrashDumpGenerator *m_crashdumper;
bool m_generateCrashDump;
unsigned m_maxDumpCount;
unsigned m_currentDumpCount;
void onTranslateBlockStart(
ExecutionSignal *signal,
S2EExecutionState *state,
TranslationBlock *tb,
uint64_t pc);
void dumpCriticalObjectTermination(S2EExecutionState *state);
void dispatchErrorCodes(S2EExecutionState *state);
void onBsod(S2EExecutionState *state, uint64_t pc);
};
} // namespace plugins
} // namespace s2e
#endif // S2E_PLUGINS_EXAMPLE_H
|
/************************************************************************
Copyright : 2005-2007, Huawei Tech. Co., Ltd.
File name : MmaForAtInc.h
Author : Áõïr
Version : V200R001
Date : 2005-12-12
Description : ¸ÃÍ·Îļþ¶¨ÒåÁË---µ¥¶ÀΪATÌṩµÄ½Ó¿ÚÓëÀàÐͶ¨Òå
History :
1. Date:2005-12-12
Author: Áõïr
Modification:Create
2.ÈÕ ÆÚ : 2006Äê08ÔÂ09ÈÕ
×÷ Õß : ½¯ÀöƼj60010247
ÐÞ¸ÄÄÚÈÝ : ÎÊÌâµ¥A32D03479£¬ÔÚPC»úÉÏʵÏÖʱ½«#pragma pack(0)ºÍ#pragma pack()¼Ó±àÒ뿪¹Ø
3.ÈÕ ÆÚ : 2006Äê09ÔÂ20ÈÕ
×÷ Õß : s46746
ÐÞ¸ÄÄÚÈÝ : ÎÊÌâµ¥A32D06255
************************************************************************/
#ifndef _MMA_FOR_AT_H_
#define _MMA_FOR_AT_H_
/*****************************************************************************
1 ÆäËûÍ·Îļþ°üº¬
*****************************************************************************/
#include "vos.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#pragma pack(4)
/*****************************************************************************
2 ºê¶¨Òå
*****************************************************************************/
/*ÄÚ²¿Ê¹ÓõIJÎÊý²éѯºê¶¨Òå*/
#define TAF_MMA_AT_QUERY_PARA_BEGIN (TAF_TELE_PARA_BUTT + 1)/*143*/
/* ɾ³ýTAF_PH_ROAM_STATUS_PARA */
/*»ñÈ¡ÊÖ»úËù´¦ÓòÐÅÏ¢*/
#define TAF_PH_DOMAIN_PARA (TAF_MMA_AT_QUERY_PARA_BEGIN + 1)/*144*/
/*GMRÃüÁ»ñÈ¡mobile software revision, release date, release time*/
#define TAF_PH_GMR_PARA (TAF_PH_DOMAIN_PARA + 1)/*145*/
/*²úÆ·Ãû³Æ£¬GMM£¬CGMMʹÓÃ*/
#define TAF_PH_PRODUCT_NAME_PARA (TAF_PH_GMR_PARA + 1)/*146*/
/*ÔÝʱ²»Ö§³ÖµÄƵ´ø¶¨Òå*/
/*
10000£¨CM_BAND_PREF_GSM_450£© GSM 450
20000£¨CM_BAND_PREF_GSM_480£© GSM 480
40000£¨CM_BAND_PREF_GSM_750£© GSM 750
80000£¨CM_BAND_PREF_GSM_850£© GSM 850
800000£¨CM_BAND_PREF_WCDMA_II_PCS_1900£© WCDMA PCS
1000000£¨CM_BAND_PREF_WCDMA_III_1700£© WCDMA 1700
*/
#define TAF_PH_BAND_PREF_GSM_450 0x10000
#define TAF_PH_BAND_PREF_GSM_480 0x20000
#define TAF_PH_BAND_PREF_GSM_750 0x40000
#define TAF_PH_BAND_PREF_WCDMA_II_PCS_1900 0x800000
#define TAF_PH_BAND_PREF_WCDMA_III_1700 0x1000000
/*******************************************************************************
3 ö¾Ù¶¨Òå
*******************************************************************************/
/*****************************************************************************
4 È«¾Ö±äÁ¿ÉùÃ÷
*****************************************************************************/
/*****************************************************************************
5 ÏûϢͷ¶¨Òå
*****************************************************************************/
/*****************************************************************************
6 ÏûÏ¢¶¨Òå
*****************************************************************************/
/*****************************************************************************
7 STRUCT¶¨Òå
*****************************************************************************/
/*****************************************************************************
8 UNION¶¨Òå
*****************************************************************************/
/*****************************************************************************
8 OTHERS¶¨Òå
*****************************************************************************/
TAF_UINT32 Taf_DefPhFreq(MN_CLIENT_ID_T ClientId, MN_OPERATION_ID_T OpId,
TAF_UINT32 ulDlFreqHighFreq,
TAF_UINT32 ulDlFreqLowFreq,
TAF_UINT8 ucRadioAccessMode);
#if ((VOS_OS_VER == VOS_WIN32) || (VOS_OS_VER == VOS_NUCLEUS))
#pragma pack()
#else
#pragma pack(0)
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* end of MmaForAtInc.h*/
|
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* 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 version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
* GPL HEADER END
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
* libcfs/include/libcfs/libcfs_string.h
*
* Generic string manipulation functions.
*
* Author: Nathan Rutman <nathan.rutman@sun.com>
*/
#ifndef __LIBCFS_STRING_H__
#define __LIBCFS_STRING_H__
/* libcfs_string.c */
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
int *oldmask, int minmask, int allmask);
/* Allocate space for and copy an existing string.
* Must free with cfs_free().
*/
char *cfs_strdup(const char *str, u_int32_t flags);
/* safe vsnprintf */
int cfs_vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
/* safe snprintf */
int cfs_snprintf(char *buf, size_t size, const char *fmt, ...);
#endif
|
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* UIVMCloseDialog class declaration
*/
/*
* Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __UIVMCloseDialog_h__
#define __UIVMCloseDialog_h__
/* GUI includes: */
#include "QIWithRetranslateUI.h"
#include "QIDialog.h"
#include "UIDefs.h"
/* Forward declarations: */
enum MachineCloseAction;
class CMachine;
class QLabel;
class QRadioButton;
class QCheckBox;
/* QIDialog extension to handle Runtime UI close-event: */
class UIVMCloseDialog : public QIWithRetranslateUI<QIDialog>
{
Q_OBJECT;
public:
/* Constructor: */
UIVMCloseDialog(QWidget *pParent, CMachine &machine,
bool fIsACPIEnabled, MachineCloseAction restictedCloseActions);
/* API: Validation stuff: */
bool isValid() const { return m_fValid; }
private slots:
/* Handler: Update stuff: */
void sltUpdateWidgetAvailability();
/* Handler: Accept stuff: */
void accept();
private:
/* API: Pixmap stuff: */
void setPixmap(const QPixmap &pixmap);
/* API: Save-button stuff: */
void setSaveButtonEnabled(bool fEnabled);
void setSaveButtonVisible(bool fVisible);
/* API: Shutdown-button stuff: */
void setShutdownButtonEnabled(bool fEnabled);
void setShutdownButtonVisible(bool fVisible);
/* API: Power-off-button stuff: */
void setPowerOffButtonEnabled(bool fEnabled);
void setPowerOffButtonVisible(bool fVisible);
/* API: Discard-check-box stuff: */
void setDiscardCheckBoxVisible(bool fVisible);
/* Helpers: Prepare stuff: */
void prepare();
void configure();
/* Helper: Translate stuff: */
void retranslateUi();
/* Handler: Event-filtering stuff: */
bool eventFilter(QObject *pWatched, QEvent *pEvent);
/* Handler: Polish-event stuff: */
void polishEvent(QShowEvent *pEvent);
/* Widgets: */
QLabel *m_pIcon;
QLabel *m_pLabel;
QLabel *m_pSaveIcon;
QRadioButton *m_pSaveRadio;
QLabel *m_pShutdownIcon;
QRadioButton *m_pShutdownRadio;
QLabel *m_pPowerOffIcon;
QRadioButton *m_pPowerOffRadio;
QCheckBox *m_pDiscardCheckBox;
/* Variables: */
CMachine &m_machine;
const MachineCloseAction m_restictedCloseActions;
bool m_fIsACPIEnabled;
bool m_fValid;
QString m_strDiscardCheckBoxText;
MachineCloseAction m_lastCloseAction;
};
#endif // __UIVMCloseDialog_h__
|
#ifndef NEPOMUKINTEGRATION_H
#define NEPOMUKINTEGRATION_H
#include <QtCore/QThread>
#include <QtCore/QMutex>
#include <QtCore/QTimer>
//For DEBUG_WIN:
#include "global.h"
#include "debugwindow.h"
class QString;
class KUrl;
class BasketScene;
class nepomukIntegration : public QObject
{
Q_OBJECT
public:
static void updateMetadata(BasketScene * basket);
static void deleteMetadata(const QString &fullPath);
static bool doDelete(const QString &fullPath);
private:
static nepomukIntegration *instance;
static QMutex instanceMutex;
nepomukIntegration(BasketScene * basket, int idleTime);
~nepomukIntegration() {
//I hope deletion is handled automatically
//delete workerThread;
//delete cleanupIdle;
DEBUG_WIN << "nepomukUpdater object destructed";
}
int idleTime;
QThread workerThread;
QTimer cleanupTimer;
QMutex mutex;
QList<BasketScene *> basketList;
bool isDoingUpdate;
QList<KUrl> requestedIndexList;
bool isCleaningupRequestedIndexes;
void queueBasket(BasketScene * basket);
void queueIndexRequest(KUrl file);
signals:
void updateCompleted(QString basketFolderName, bool successful);
//void indexCleanupCompleted(KUrl file);
private slots:
void doUpdate();
void checkQueue();
void cleanupRequestedIndexes();
void cleanup();
};
#endif // NEPOMUKINTEGRATION_H
|
#define ALIGNMENT 4
#define CHAR_BIT 8
#define D_BIT (D_SIZE * CHAR_BIT)
#define D_EXP_BIAS ((1 << (D_EXP_BIT - 1)) - 1)
#define D_EXP_BIT 11
#define D_EXP_INFINITE ((1 << D_EXP_BIT) - 1)
#define D_EXP_MASK (((1 << D_EXP_BIT) - 1) << D_EXP_SHIFT)
#define D_EXP_SHIFT (REG_BIT - (1 + D_EXP_BIT))
#define D_FRAC_BIT 53
#define D_FRAC_MASK (D_NORM_MASK - 1)
#define D_HIGH 4
#define D_HUGE_HIGH (D_EXP_MASK - 1)
#define D_HUGE_LOW 0xFFFFFFFF
#define D_LOW 0
#define D_NORM_BIT (D_FRAC_BIT - 1 - REG_BIT)
#define D_NORM_MASK (1 << D_NORM_BIT)
#define D_SIGN_BIT 63
#define D_SIGN_MASK (1 << (D_SIGN_BIT - REG_BIT))
#define D_SIZE 8
#define F_BIT (F_SIZE * CHAR_BIT)
#define F_EXP_BIAS ((1 << (F_EXP_BIT - 1)) - 1)
#define F_EXP_BIT 8
#define F_EXP_INFINITE ((1 << F_EXP_BIT) - 1)
#define F_EXP_MASK (((1 << F_EXP_BIT) - 1) << F_EXP_SHIFT)
#define F_EXP_SHIFT (REG_BIT - (1 + F_EXP_BIT))
#define F_FRAC_BIT 24
#define F_FRAC_MASK (F_NORM_MASK - 1)
#define F_HIGH 0
#define F_HUGE_HIGH (F_EXP_MASK - 1)
#define F_NORM_BIT (F_FRAC_BIT - 1)
#define F_NORM_MASK (1 << F_NORM_BIT)
#define F_SIGN_BIT 31
#define F_SIGN_MASK (1 << F_SIGN_BIT)
#define F_SIZE 4
#define FREE_D_SIGN_BIT_TEST (D_SIGN_BIT % REG_BIT == REG_BIT - 1)
#define GENREG_SIZE 4
#define INT_BIT 32
#define INT_MAX 0x7FFFFFFF
#define INT_MIN (-0x7FFFFFFF - 1)
#define PC_SIZE 4
#define REG_BIT 32
#define SHORT_BIT 16
#define UINT_MAX 0xFFFFFFFF
|
/* $Id: kbd-std.c,v 1.1 1998/10/28 12:38:14 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Routines for standard PC style keyboards accessible via I/O ports.
*
* Copyright (C) 1998 by Ralf Baechle
*/
#include <linux/pc_keyb.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <asm/keyboard.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 1
#define AUX_IRQ 12
static void std_kbd_request_region(void)
{
request_region(0x60, 16, "keyboard");
}
static int std_kbd_request_irq(void (*handler)(int, void *, struct pt_regs *))
{
return request_irq(KEYBOARD_IRQ, handler, 0, "keyboard", NULL);
}
static int std_aux_request_irq(void (*handler)(int, void *, struct pt_regs *))
{
return request_irq(AUX_IRQ, handler, 0, "PS/2 Mouse", NULL);
}
static void std_aux_free_irq(void)
{
free_irq(AUX_IRQ, NULL);
}
static unsigned char std_kbd_read_input(void)
{
return inb(KBD_DATA_REG);
}
static void std_kbd_write_output(unsigned char val)
{
int status;
do {
status = inb(KBD_CNTL_REG);
} while (status & KBD_STAT_IBF);
outb(val, KBD_DATA_REG);
}
static void std_kbd_write_command(unsigned char val)
{
int status;
do {
status = inb(KBD_CNTL_REG);
} while (status & KBD_STAT_IBF);
outb(val, KBD_CNTL_REG);
}
static unsigned char std_kbd_read_status(void)
{
return inb(KBD_STATUS_REG);
}
struct kbd_ops std_kbd_ops = {
std_kbd_request_region,
std_kbd_request_irq,
std_aux_request_irq,
std_aux_free_irq,
std_kbd_read_input,
std_kbd_write_output,
std_kbd_write_command,
std_kbd_read_status
};
|
/* kernel/power/earlysuspend.c
*
* Copyright (C) 2005-2008 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/earlysuspend.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/rtc.h>
#include <linux/syscalls.h> /* sys_sync */
#include <linux/wakelock.h>
#include <linux/workqueue.h>
#include "power.h"
enum {
DEBUG_USER_STATE = 1U << 0,
DEBUG_SUSPEND = 1U << 2,
DEBUG_VERBOSE = 1U << 3,
};
static int debug_mask = DEBUG_USER_STATE;
module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP);
static DEFINE_MUTEX(early_suspend_lock);
static LIST_HEAD(early_suspend_handlers);
static void early_suspend(struct work_struct *work);
static void late_resume(struct work_struct *work);
static DECLARE_WORK(early_suspend_work, early_suspend);
static DECLARE_WORK(late_resume_work, late_resume);
static DEFINE_SPINLOCK(state_lock);
enum {
SUSPEND_REQUESTED = 0x1,
SUSPENDED = 0x2,
SUSPEND_REQUESTED_AND_SUSPENDED = SUSPEND_REQUESTED | SUSPENDED,
};
static int state;
void register_early_suspend(struct early_suspend *handler)
{
struct list_head *pos;
mutex_lock(&early_suspend_lock);
list_for_each(pos, &early_suspend_handlers) {
struct early_suspend *e;
e = list_entry(pos, struct early_suspend, link);
if (e->level > handler->level)
break;
}
list_add_tail(&handler->link, pos);
if ((state & SUSPENDED) && handler->suspend)
handler->suspend(handler);
mutex_unlock(&early_suspend_lock);
}
EXPORT_SYMBOL(register_early_suspend);
void unregister_early_suspend(struct early_suspend *handler)
{
mutex_lock(&early_suspend_lock);
list_del(&handler->link);
mutex_unlock(&early_suspend_lock);
}
EXPORT_SYMBOL(unregister_early_suspend);
static void early_suspend(struct work_struct *work)
{
struct early_suspend *pos;
unsigned long irqflags;
int abort = 0;
mutex_lock(&early_suspend_lock);
spin_lock_irqsave(&state_lock, irqflags);
if (state == SUSPEND_REQUESTED)
state |= SUSPENDED;
else
abort = 1;
spin_unlock_irqrestore(&state_lock, irqflags);
if (abort) {
if (debug_mask & DEBUG_SUSPEND)
pr_info("early_suspend: abort, state %d\n", state);
mutex_unlock(&early_suspend_lock);
goto abort;
}
if (debug_mask & DEBUG_SUSPEND)
pr_info("early_suspend: call handlers\n");
list_for_each_entry(pos, &early_suspend_handlers, link) {
if (pos->suspend != NULL) {
if (debug_mask & DEBUG_VERBOSE)
pr_info("early_suspend: calling %pf\n", pos->suspend);
pos->suspend(pos);
}
}
mutex_unlock(&early_suspend_lock);
abort:
spin_lock_irqsave(&state_lock, irqflags);
if (state == SUSPEND_REQUESTED_AND_SUSPENDED)
wake_unlock(&main_wake_lock);
spin_unlock_irqrestore(&state_lock, irqflags);
}
static void late_resume(struct work_struct *work)
{
struct early_suspend *pos;
unsigned long irqflags;
int abort = 0;
mutex_lock(&early_suspend_lock);
spin_lock_irqsave(&state_lock, irqflags);
if (state == SUSPENDED)
state &= ~SUSPENDED;
else
abort = 1;
spin_unlock_irqrestore(&state_lock, irqflags);
if (abort) {
if (debug_mask & DEBUG_SUSPEND)
pr_info("late_resume: abort, state %d\n", state);
goto abort;
}
if (debug_mask & DEBUG_SUSPEND)
pr_info("late_resume: call handlers\n");
list_for_each_entry_reverse(pos, &early_suspend_handlers, link) {
if (pos->resume != NULL) {
if (debug_mask & DEBUG_VERBOSE)
pr_info("late_resume: calling %pf\n", pos->resume);
pos->resume(pos);
}
}
if (debug_mask & DEBUG_SUSPEND)
pr_info("late_resume: done\n");
abort:
mutex_unlock(&early_suspend_lock);
}
void request_suspend_state(suspend_state_t new_state)
{
unsigned long irqflags;
int old_sleep;
spin_lock_irqsave(&state_lock, irqflags);
old_sleep = state & SUSPEND_REQUESTED;
if (debug_mask & DEBUG_USER_STATE) {
struct timespec ts;
struct rtc_time tm;
getnstimeofday(&ts);
rtc_time_to_tm(ts.tv_sec, &tm);
pr_info("request_suspend_state: %s (%d->%d) at %lld "
"(%d-%02d-%02d %02d:%02d:%02d.%09lu) Shanghai\n",
new_state != PM_SUSPEND_ON ? "sleep" : "wakeup",
requested_suspend_state, new_state,
ktime_to_ns(ktime_get()),
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
(tm.tm_hour + 8) % 24, tm.tm_min, tm.tm_sec, ts.tv_nsec);
}
if (!old_sleep && new_state != PM_SUSPEND_ON) {
state |= SUSPEND_REQUESTED;
queue_work(suspend_work_queue, &early_suspend_work);
} else if (old_sleep && new_state == PM_SUSPEND_ON) {
state &= ~SUSPEND_REQUESTED;
wake_lock(&main_wake_lock);
queue_work(suspend_work_queue, &late_resume_work);
}
requested_suspend_state = new_state;
spin_unlock_irqrestore(&state_lock, irqflags);
}
suspend_state_t get_suspend_state(void)
{
return requested_suspend_state;
}
|
#ifndef __LINUX_COMPLETION_H
#define __LINUX_COMPLETION_H
/*
* (C) Copyright 2001 Linus Torvalds
*
* Atomic wait-for-completion handler data structures.
* See kernel/sched.c for details.
*/
#include <linux/wait.h>
/*
* struct completion - structure used to maintain state for a "completion"
*
* This is the opaque structure used to maintain the state for a "completion".
* Completions currently use a FIFO to queue threads that have to wait for
* the "completion" event.
*
* See also: complete(), wait_for_completion() (and friends _timeout,
* _interruptible, _interruptible_timeout, and _killable), init_completion(),
* reinit_completion(), and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and
* INIT_COMPLETION().
*/
struct completion {
unsigned int done;
wait_queue_head_t wait;
};
#define COMPLETION_INITIALIZER(work) \
{ 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
#define COMPLETION_INITIALIZER_ONSTACK(work) \
({ init_completion(&work); work; })
/**
* DECLARE_COMPLETION - declare and initialize a completion structure
* @work: identifier for the completion structure
*
* This macro declares and initializes a completion structure. Generally used
* for static declarations. You should use the _ONSTACK variant for automatic
* variables.
*/
#define DECLARE_COMPLETION(work) \
struct completion work = COMPLETION_INITIALIZER(work)
/*
* Lockdep needs to run a non-constant initializer for on-stack
* completions - so we use the _ONSTACK() variant for those that
* are on the kernel stack:
*/
/**
* DECLARE_COMPLETION_ONSTACK - declare and initialize a completion structure
* @work: identifier for the completion structure
*
* This macro declares and initializes a completion structure on the kernel
* stack.
*/
#ifdef CONFIG_LOCKDEP
# define DECLARE_COMPLETION_ONSTACK(work) \
struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
#else
# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
#endif
/**
* init_completion - Initialize a dynamically allocated completion
* @x: completion structure that is to be initialized
*
* This inline function will initialize a dynamically created completion
* structure.
*/
static inline void init_completion(struct completion *x)
{
x->done = 0;
init_waitqueue_head(&x->wait);
}
/**
* reinit_completion - reinitialize a completion structure
* @x: pointer to completion structure that is to be reinitialized
*
* This inline function should be used to reinitialize a completion structure so it can
* be reused. This is especially important after complete_all() is used.
*/
static inline void reinit_completion(struct completion *x)
{
x->done = 0;
}
extern void wait_for_completion(struct completion *);
extern int wait_for_completion_interruptible(struct completion *x);
extern int wait_for_completion_killable(struct completion *x);
extern unsigned long wait_for_completion_timeout(struct completion *x,
unsigned long timeout);
extern long wait_for_completion_interruptible_timeout(
struct completion *x, unsigned long timeout);
extern long wait_for_completion_killable_timeout(
struct completion *x, unsigned long timeout);
extern bool try_wait_for_completion(struct completion *x);
extern bool completion_done(struct completion *x);
extern void complete(struct completion *);
extern void complete_all(struct completion *);
/**
* INIT_COMPLETION - reinitialize a completion structure
* @x: completion structure to be reinitialized
*
* This macro should be used to reinitialize a completion structure so it can
* be reused. This is especially important after complete_all() is used.
*/
#define INIT_COMPLETION(x) ((x).done = 0)
#endif
|
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
#include "libbb.h"
#include "bb_archive.h"
enum {
//TAR_FILETYPE,
TAR_MODE,
TAR_FILENAME,
TAR_REALNAME,
#if ENABLE_FEATURE_TAR_UNAME_GNAME
TAR_UNAME,
TAR_GNAME,
#endif
TAR_SIZE,
TAR_UID,
TAR_GID,
TAR_MAX,
};
static const char *const tar_var[] = {
// "FILETYPE",
"MODE",
"FILENAME",
"REALNAME",
#if ENABLE_FEATURE_TAR_UNAME_GNAME
"UNAME",
"GNAME",
#endif
"SIZE",
"UID",
"GID",
};
static void xputenv(char *str)
{
if (putenv(str))
bb_die_memory_exhausted();
}
static void str2env(char *env[], int idx, const char *str)
{
env[idx] = xasprintf("TAR_%s=%s", tar_var[idx], str);
xputenv(env[idx]);
}
static void dec2env(char *env[], int idx, unsigned long long val)
{
env[idx] = xasprintf("TAR_%s=%llu", tar_var[idx], val);
xputenv(env[idx]);
}
static void oct2env(char *env[], int idx, unsigned long val)
{
env[idx] = xasprintf("TAR_%s=%lo", tar_var[idx], val);
xputenv(env[idx]);
}
void FAST_FUNC data_extract_to_command(archive_handle_t *archive_handle)
{
file_header_t *file_header = archive_handle->file_header;
#if 0 /* do we need this? ENABLE_FEATURE_TAR_SELINUX */
char *sctx = archive_handle->tar__sctx[PAX_NEXT_FILE];
if (!sctx)
sctx = archive_handle->tar__sctx[PAX_GLOBAL];
if (sctx) { /* setfscreatecon is 4 syscalls, avoid if possible */
setfscreatecon(sctx);
free(archive_handle->tar__sctx[PAX_NEXT_FILE]);
archive_handle->tar__sctx[PAX_NEXT_FILE] = NULL;
}
#endif
if ((file_header->mode & S_IFMT) == S_IFREG) {
pid_t pid;
int p[2], status;
char *tar_env[TAR_MAX];
memset(tar_env, 0, sizeof(tar_env));
xpipe(p);
pid = BB_MMU ? xfork() : xvfork();
if (pid == 0) {
/* Child */
/* str2env(tar_env, TAR_FILETYPE, "f"); - parent should do it once */
oct2env(tar_env, TAR_MODE, file_header->mode);
str2env(tar_env, TAR_FILENAME, file_header->name);
str2env(tar_env, TAR_REALNAME, file_header->name);
#if ENABLE_FEATURE_TAR_UNAME_GNAME
str2env(tar_env, TAR_UNAME, file_header->tar__uname);
str2env(tar_env, TAR_GNAME, file_header->tar__gname);
#endif
dec2env(tar_env, TAR_SIZE, file_header->size);
dec2env(tar_env, TAR_UID, file_header->uid);
dec2env(tar_env, TAR_GID, file_header->gid);
close(p[1]);
xdup2(p[0], STDIN_FILENO);
signal(SIGPIPE, SIG_DFL);
execl(archive_handle->tar__to_command_shell,
archive_handle->tar__to_command_shell,
"-c",
archive_handle->tar__to_command,
(char *)0);
bb_perror_msg_and_die("can't execute '%s'", archive_handle->tar__to_command_shell);
}
close(p[0]);
/* Our caller is expected to do signal(SIGPIPE, SIG_IGN)
* so that we don't die if child don't read all the input: */
bb_copyfd_exact_size(archive_handle->src_fd, p[1], -file_header->size);
close(p[1]);
status = wait_for_exitstatus(pid);
if (WIFEXITED(status) && WEXITSTATUS(status))
bb_error_msg_and_die("'%s' returned status %d",
archive_handle->tar__to_command, WEXITSTATUS(status));
if (WIFSIGNALED(status))
bb_error_msg_and_die("'%s' terminated by signal %d",
archive_handle->tar__to_command, WTERMSIG(status));
if (!BB_MMU) {
int i;
for (i = 0; i < TAR_MAX; i++) {
if (tar_env[i])
bb_unsetenv_and_free(tar_env[i]);
}
}
}
#if 0 /* ENABLE_FEATURE_TAR_SELINUX */
if (sctx)
/* reset the context after creating an entry */
setfscreatecon(NULL);
#endif
}
|
int main() { return sync(); }
|
/*
* include/linux/tegra_pm_domains.h
*
* Copyright (c) 2012-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 _INCLUDE_TEGRA_PM_DOMAINS_H_
#define _INCLUDE_TEGRA_PM_DOMAINS_H_
#include <linux/clk.h>
#include <linux/pm_domain.h>
#define PD_MAX_CLK 3
struct tegra_pm_domain {
struct generic_pm_domain gpd;
struct clk *clk[PD_MAX_CLK];
};
#define to_tegra_pd(_pd) container_of(_pd, struct tegra_pm_domain, gpd);
#if defined(CONFIG_TEGRA20_APB_DMA)
int tegra_dma_restore(void);
int tegra_dma_save(void);
#else
static inline int tegra_dma_restore(void)
{ return -ENODEV; }
static inline int tegra_dma_save(void)
{ return -ENODEV; }
#endif
#if defined(CONFIG_TEGRA_ACTMON)
int tegra_actmon_save(void);
int tegra_actmon_restore(void);
#else
static inline int tegra_actmon_save(void)
{ return -ENODEV; }
static inline int tegra_actmon_restore(void)
{ return -ENODEV; }
#endif
#ifdef CONFIG_TEGRA_MC_DOMAINS
void tegra_pd_add_device(struct device *dev);
void tegra_pd_remove_device(struct device *dev);
void tegra_pd_add_sd(struct generic_pm_domain *sd);
void tegra_pd_remove_sd(struct generic_pm_domain *sd);
void tegra_ape_pd_add_device(struct device *dev);
void tegra_ape_pd_remove_device(struct device *dev);
void tegra_adsp_pd_add_device(struct device *dev);
void tegra_adsp_pd_remove_device(struct device *dev);
#else
static inline void tegra_pd_add_device(struct device *dev) { }
static inline void tegra_pd_remove_device(struct device *dev) { }
static inline void tegra_pd_add_sd(struct generic_pm_domain *sd) { }
static inline void tegra_pd_remove_sd(struct generic_pm_domain *sd) { }
static inline void tegra_ape_pd_add_device(struct device *dev) { }
static inline void tegra_ape_pd_remove_device(struct device *dev) { }
static inline void tegra_adsp_pd_add_device(struct device *dev) { }
static inline void tegra_adsp_pd_remove_device(struct device *dev) { }
#endif /* CONFIG_TEGRA_MC_DOMAINS */
#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
int tegra_pd_get_powergate_id(struct of_device_id *dev_id);
#else
static inline int tegra_pd_get_powergate_id(struct of_device_id *dev_id)
{
return -EINVAL;
}
#endif
#ifdef CONFIG_ARCH_TEGRA_21x_SOC
extern void disable_scx_states(void);
#else /* !CONFIG_ARCH_TEGRA_21x_SOC */
static inline void disable_scx_states(void) { }
#endif
#endif /* _INCLUDE_TEGRA_PM_DOMAINS_H_ */
|
/* pkcs7.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL 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.
*
* wolfSSL 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-1335, USA
*/
/* pkcs7.h for openSSL */
#ifndef WOLFSSL_PKCS7_H_
#define WOLFSSL_PKCS7_H_
#include <wolfssl/openssl/ssl.h>
#include <wolfssl/wolfcrypt/pkcs7.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(OPENSSL_ALL) && defined(HAVE_PKCS7)
#define PKCS7_NOINTERN 0x0010
#define PKCS7_NOVERIFY 0x0020
typedef struct WOLFSSL_PKCS7
{
PKCS7 pkcs7;
unsigned char* data;
int len;
WOLFSSL_STACK* certs;
} WOLFSSL_PKCS7;
WOLFSSL_API PKCS7* wolfSSL_PKCS7_new(void);
WOLFSSL_API PKCS7_SIGNED* wolfSSL_PKCS7_SIGNED_new(void);
WOLFSSL_API void wolfSSL_PKCS7_free(PKCS7* p7);
WOLFSSL_API void wolfSSL_PKCS7_SIGNED_free(PKCS7_SIGNED* p7);
WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7(PKCS7** p7, const unsigned char** in,
int len);
WOLFSSL_LOCAL PKCS7* wolfSSL_d2i_PKCS7_ex(PKCS7** p7, const unsigned char** in,
int len, byte* content, word32 contentSz);
WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7_bio(WOLFSSL_BIO* bio, PKCS7** p7);
WOLFSSL_API int wolfSSL_i2d_PKCS7_bio(WOLFSSL_BIO *bio, PKCS7 *p7);
WOLFSSL_API int wolfSSL_i2d_PKCS7(PKCS7 *p7, unsigned char **out);
WOLFSSL_API int wolfSSL_PKCS7_verify(PKCS7* p7, WOLFSSL_STACK* certs,
WOLFSSL_X509_STORE* store, WOLFSSL_BIO* in, WOLFSSL_BIO* out, int flags);
WOLFSSL_API int wolfSSL_PKCS7_encode_certs(PKCS7* p7, WOLFSSL_STACK* certs,
WOLFSSL_BIO* out);
WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_to_stack(PKCS7* pkcs7);
WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_get0_signers(PKCS7* p7,
WOLFSSL_STACK* certs, int flags);
WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7);
#if defined(HAVE_SMIME)
WOLFSSL_API PKCS7* wolfSSL_SMIME_read_PKCS7(WOLFSSL_BIO* in, WOLFSSL_BIO** bcont);
#endif /* HAVE_SMIME */
#define PKCS7_new wolfSSL_PKCS7_new
#define PKCS7_SIGNED_new wolfSSL_PKCS7_SIGNED_new
#define PKCS7_free wolfSSL_PKCS7_free
#define PKCS7_SIGNED_free wolfSSL_PKCS7_SIGNED_free
#define d2i_PKCS7 wolfSSL_d2i_PKCS7
#define d2i_PKCS7_bio wolfSSL_d2i_PKCS7_bio
#define i2d_PKCS7_bio wolfSSL_i2d_PKCS7_bio
#define i2d_PKCS7 wolfSSL_i2d_PKCS7
#define PKCS7_verify wolfSSL_PKCS7_verify
#define PKCS7_get0_signers wolfSSL_PKCS7_get0_signers
#define PEM_write_bio_PKCS7 wolfSSL_PEM_write_bio_PKCS7
#if defined(HAVE_SMIME)
#define SMIME_read_PKCS7 wolfSSL_SMIME_read_PKCS7
#endif /* HAVE_SMIME */
#endif /* OPENSSL_ALL && HAVE_PKCS7 */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WOLFSSL_PKCS7_H_ */
|
// Copyright (C) 2012 GlavSoft LLC.
// All rights reserved.
//
//-------------------------------------------------------------------------
// This file is part of the TightVNC software. Please visit our Web site:
//
// http://www.tightvnc.com/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//-------------------------------------------------------------------------
//
#ifdef WIN32
#include <Tchar.h>
#endif // WIN32
|
#import <UIKit/UIKit.h>
#import "MediaSearchFilterHeaderView.h"
// Notifications
extern NSString *const MediaFeaturedImageSelectedNotification;
extern NSString *const MediaShouldInsertBelowNotification;
@class Blog, AbstractPost;
@interface MediaBrowserViewController : UIViewController <MediaSearchFilterDelegate, UISearchBarDelegate, UIActionSheetDelegate, UIImagePickerControllerDelegate>
@property (nonatomic, strong) Blog *blog;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
- (id)initWithPost:(AbstractPost *)post;
- (id)initWithPost:(AbstractPost *)post selectingMediaForPost:(BOOL)selectingMediaForPost;
- (id)initWithPost:(AbstractPost *)post selectingFeaturedImage:(BOOL)selectingFeaturedImage;
@end
|
#ifndef PROPERTIES_COLLECTOR_H
#define PROPERTIES_COLLECTOR_H
#include <vector>
#include "rocksdb/table_properties.h"
#include "rdb_datadic.h"
struct CompactionParams {
uint64_t deletes_, window_, file_size_;
};
class MyRocksTablePropertiesCollector
: public rocksdb::TablePropertiesCollector {
public:
struct IndexStats {
enum {
INDEX_STATS_VERSION= 1,
};
uint32_t index_number;
int64_t data_size, rows, approximate_size;
std::vector<int64_t> distinct_keys_per_prefix;
std::string name; // name is not persisted
static std::string materialize(std::vector<IndexStats>);
static int unmaterialize(const std::string& s, std::vector<IndexStats>&);
IndexStats() : IndexStats(0) {}
IndexStats(uint32_t _index_number) :
index_number(_index_number),
data_size(0),
rows(0),
approximate_size(0) {}
void merge(const IndexStats& s);
};
MyRocksTablePropertiesCollector(
Table_ddl_manager* ddl_manager,
CompactionParams params
);
virtual rocksdb::Status AddUserKey(
const rocksdb::Slice& key, const rocksdb::Slice& value,
rocksdb::EntryType type, rocksdb::SequenceNumber seq,
uint64_t file_size);
virtual rocksdb::Status Finish(rocksdb::UserCollectedProperties* properties) override;
virtual const char* Name() const override {
return "MyRocksTablePropertiesCollector";
}
static std::string
GetReadableStats(const MyRocksTablePropertiesCollector::IndexStats& it);
rocksdb::UserCollectedProperties GetReadableProperties() const override;
static std::vector<IndexStats> GetStatsFromTableProperties(
const std::shared_ptr<const rocksdb::TableProperties>& table_props
);
static void GetStats(
const rocksdb::TablePropertiesCollection& collection,
const std::unordered_set<uint32_t>& index_numbers,
std::map<uint32_t, MyRocksTablePropertiesCollector::IndexStats>& stats
);
bool NeedCompact() const;
uint64_t GetMaxDeletedRows() const {
return max_deleted_rows_;
}
private:
std::unique_ptr<RDBSE_KEYDEF> keydef_;
Table_ddl_manager* ddl_manager_;
std::vector<IndexStats> stats_;
static const char* INDEXSTATS_KEY;
// last added key
std::string last_key_;
// floating window to count deleted rows
std::vector<bool> deleted_rows_window_;
uint64_t rows_, deleted_rows_, max_deleted_rows_;
uint64_t file_size_;
CompactionParams params_;
};
class MyRocksTablePropertiesCollectorFactory
: public rocksdb::TablePropertiesCollectorFactory {
public:
MyRocksTablePropertiesCollectorFactory(
Table_ddl_manager* ddl_manager
) : ddl_manager_(ddl_manager) {
}
virtual rocksdb::TablePropertiesCollector* CreateTablePropertiesCollector() override {
return new MyRocksTablePropertiesCollector(
ddl_manager_, params_);
}
virtual const char* Name() const override {
return "MyRocksTablePropertiesCollectorFactory";
}
void SetCompactionParams(const CompactionParams& params) {
params_ = params;
}
private:
Table_ddl_manager* ddl_manager_;
CompactionParams params_;
};
#endif
|
/**
******************************************************************************
* @file stm32f0xx_hal_cortex.h
* @author MCD Application Team
* @version V1.1.0
* @date 03-Oct-2014
* @brief Header file of CORTEX HAL module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F0xx_HAL_CORTEX_H
#define __STM32F0xx_HAL_CORTEX_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f0xx_hal_def.h"
/** @addtogroup STM32F0xx_HAL_Driver
* @{
*/
/** @addtogroup CORTEX CORTEX HAL module driver
* @{
*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants
* @{
*/
/** @defgroup CORTEX_Priority CORTEX Priority
* @{
*/
#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x4)
/**
* @}
*/
/** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick clock source
* @{
*/
#define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000)
#define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004)
#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \
((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8))
/**
* @}
*/
/**
* @}
*/
/* Exported Macros -----------------------------------------------------------*/
/** @defgroup CORTEX_Exported_Macro CORTEX Exported Macro
* @{
*/
/** @brief Configures the SysTick clock source.
* @param __CLKSRC__: specifies the SysTick clock source.
* This parameter can be one of the following values:
* @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
* @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
* @retval None
*/
#define __HAL_CORTEX_SYSTICKCLK_CONFIG(__CLKSRC__) \
do { \
if ((__CLKSRC__) == SYSTICK_CLKSOURCE_HCLK) \
{ \
SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; \
} \
else \
SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK; \
} while(0)
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup CORTEX_Exported_Functions CORTEX Exported Functions
* @{
*/
/** @addtogroup CORTEX_Exported_Functions_Group1 Initialization and de-initialization functions
* @brief Initialization and Configuration functions
* @{
*/
/* Initialization and de-initialization functions *******************************/
void HAL_NVIC_SetPriority(IRQn_Type IRQn,uint32_t PreemptPriority, uint32_t SubPriority);
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn);
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn);
void HAL_NVIC_SystemReset(void);
uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
/**
* @}
*/
/** @addtogroup CORTEX_Exported_Functions_Group2 Peripheral Control functions
* @brief Cortex control functions
* @{
*/
/* Peripheral Control functions *************************************************/
uint32_t HAL_NVIC_GetPriority(IRQn_Type IRQn);
uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn);
void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn);
void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource);
void HAL_SYSTICK_IRQHandler(void);
void HAL_SYSTICK_Callback(void);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F0xx_HAL_CORTEX_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#pragma once
/*
* Copyright (C) 2005-2013 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/>.
*
*/
#include "StdString.h"
#include "threads/Thread.h"
class CGUITextLayout;
class CGUIImage;
class CSplash : public CThread
{
public:
CSplash(const CStdString& imageName);
virtual ~CSplash();
bool Start();
void Stop();
// In case you don't want to use another thread
void Show();
void Show(const CStdString& message);
void Hide();
private:
virtual void Process();
virtual void OnStartup();
virtual void OnExit();
float fade;
CStdString m_ImageName;
CGUITextLayout* m_messageLayout;
CGUIImage* m_image;
bool m_layoutWasLoading;
#ifdef HAS_DX
D3DGAMMARAMP newRamp;
D3DGAMMARAMP oldRamp;
#endif
};
|
/*******************************************************************************
Copyright (C) Marvell International Ltd. and its affiliates
This software file (the "File") is owned and distributed by Marvell
International Ltd. and/or its affiliates ("Marvell") under the following
alternative licensing terms. Once you have made an election to distribute the
File under one of the following license alternatives, please (i) delete this
introductory statement regarding license alternatives, (ii) delete the two
license alternatives that you have not elected to use and (iii) preserve the
Marvell copyright notice above.
********************************************************************************
Marvell Commercial License Option
If you received this File from Marvell and you have entered into a commercial
license agreement (a "Commercial License") with Marvell, the File is licensed
to you under the terms of the applicable Commercial License.
********************************************************************************
Marvell GPL License Option
If you received this File from Marvell, you may opt to use, redistribute and/or
modify this File in accordance with the terms and conditions of the General
Public License Version 2, June 1991 (the "GPL License"), a copy of which is
available along with the File in the license.txt file or by writing to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
DISCLAIMED. The GPL License provides additional details about this warranty
disclaimer.
********************************************************************************
Marvell BSD License Option
If you received this File from Marvell, you may opt to use, redistribute and/or
modify this File under the following licensing terms.
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 Marvell 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 __INCmvCpuIfh
#define __INCmvCpuIfh
/* includes */
#include "ctrlEnv/mvCtrlEnvLib.h"
#include "ctrlEnv/sys/mvCpuIfRegs.h"
#include "ctrlEnv/sys/mvAhbToMbus.h"
#if defined(MV_INCLUDE_PEX)
#include "pex/mvPex.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* defines */
/* typedefs */
/* This structure describes CPU interface address decode window */
typedef struct _mvCpuIfDecWin {
MV_ADDR_WIN addrWin; /* An address window */
MV_U32 winNum; /* Window Number in the AHB To Mbus bridge */
MV_BOOL enable; /* Address decode window is enabled/disabled */
} MV_CPU_DEC_WIN;
/* mvCpuIfLib.h API list */
/* mvCpuIfLib.h API list */
MV_STATUS mvCpuIfInit(MV_CPU_DEC_WIN *cpuAddrWinMap);
MV_STATUS mvCpuIfDramInit(MV_VOID);
MV_STATUS mvCpuIfTargetWinSet(MV_TARGET target, MV_CPU_DEC_WIN *pAddrDecWin);
MV_STATUS mvCpuIfTargetWinGet(MV_TARGET target, MV_CPU_DEC_WIN *pAddrDecWin);
MV_STATUS mvCpuIfTargetWinEnable(MV_TARGET target, MV_BOOL enable);
MV_U32 mvCpuIfTargetWinSizeGet(MV_TARGET target);
MV_U32 mvCpuIfTargetWinBaseLowGet(MV_TARGET target);
MV_U32 mvCpuIfTargetWinBaseHighGet(MV_TARGET target);
MV_TARGET mvCpuIfTargetOfBaseAddressGet(MV_U32 baseAddress);
MV_STATUS mvCpuIfSramWinDisable(MV_VOID);
#if defined(MV_INCLUDE_PEX)
MV_U32 mvCpuIfPexRemap(MV_TARGET pexTarget, MV_ADDR_WIN *pAddrDecWin);
MV_VOID mvCpuIfEnablePex(MV_U32 pexUnit);
#endif
#if defined(MV_INCLUDE_PCI)
MV_U32 mvCpuIfPciRemap(MV_TARGET pciTarget, MV_ADDR_WIN *pAddrDecWin);
#endif
MV_VOID mvCpuIfAddDecShow(MV_VOID);
MV_STATUS mvCpuIfLvdsPadsEnable(MV_BOOL enable);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __INCmvCpuIfh */
|
// cmdline_resolver.h -*-c++-*-
//
// Copyright (C) 2005, 2007-2008, 2010 Daniel Burrows
//
// 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; see the file COPYING. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#ifndef CMDLINE_RESOLVER_H
#define CMDLINE_RESOLVER_H
// Local includes:
#include "cmdline_common.h"
// We need these two to declare get_current_solution().
//#include <generic/apt/aptitude_resolver_universe.h>
#include <generic/problemresolver/solution.h>
// System includes:
#include <boost/shared_ptr.hpp>
/** \file cmdline_resolver.h
*/
class aptitude_universe;
class pkgPolicy;
namespace aptitude
{
namespace cmdline
{
class terminal_metrics;
/** \brief Represents the termination state of the
* command-line resolver.
*/
enum cmdline_resolver_result
{
/** \brief The resolver produced and applied a solution
* to the broken dependencies.
*/
resolver_success,
/** \brief The resolver encountered a fatal (possibly
* internal) error or was cancelled by the user; the caller
* should fall back to manual resolution.
*/
resolver_incomplete,
/** \brief The user asked to quit (i.e., pressed "q");
* the caller should terminate the program.
*/
resolver_user_exit
};
}
}
/** \brief Compute the current solution with a command-line-appropriate
* UI.
*
* \param print_resolving_dependencies if \b true, print a message
* saying "Resolving dependencies..." before running the resolver.
* This is used by safe-upgrade to suppress the message on subsequent
* resolver runs.
*
* \param term The terminal object to use for I/O.
*
* \return the resolver manager's current solution; if it needs to be
* calculated first, run the calculation in the background
* and display a spinner in the foreground.
*
* \note The exceptions are the same as the exceptions of the
* resolver manager's get_solution.
*
* \throw NoMoreSolutions if the list of solutions is exhausted
* \throw NoMoreTime if time is exhausted while searching for
* the solution (time here is counted separately
* at each step).
* \throw ResolverManagerThreadClashException if a new solution
* would be generated and a background thread exists.
* \throw Exception if the background thread aborted with an exception.
*/
generic_solution<aptitude_universe> calculate_current_solution(bool print_resolving_dependencies,
const boost::shared_ptr<aptitude::cmdline::terminal_metrics> &term_metrics);
/** \brief Write the resolver state to a file as appropriate.
*
* If the configuration option Aptitude::CMdLine::Resolver-Dump is
* set, its value is taken to be the name of a file to which the
* resolver state should be written.
*/
void cmdline_dump_resolver();
/** Run the resolver once, possibly prompting the user in the process.
*
* \param to_install a list of packages which the user explicitly
* asked to install
*
* \param to_hold a list of packages which the user explicitly asked
* to hold back
*
* \param to_remove a list of packages which the user explicitly
* asked to remove
*
* \param to_purge a list of packages which the user explicitly asked
* to purge
*
* \param assume_yes if \b true, try to find a single solution
* (regardless of how long it takes) and accept it immediately.
*
* \param force_no_change if \b true, assign extra version scores to
* heavily bias the resolver against changing any packages in the
* supplied sets.
* \param verbose the verbosity level set by the user
*
* \param policy the package policy object used to look up priorities.
* \param arch_only if \b true, architecture-independent build-dependencies
* are ignored.
*/
aptitude::cmdline::cmdline_resolver_result
cmdline_resolve_deps(pkgset &to_install,
pkgset &to_hold,
pkgset &to_remove,
pkgset &to_purge,
bool assume_yes,
bool force_no_change,
int verbose,
pkgPolicy &policy,
bool arch_only,
const boost::shared_ptr<aptitude::cmdline::terminal_metrics> &term_metrics);
namespace aptitude
{
namespace cmdline
{
/** \brief Try to resolve packages without removing anything.
*
* \param verbose The verbosity level (increase to get more
* warnings about being unable to resolve
* deps).
* \param no_new_installs If true, packages not currently
* on the system will not be installed.
* \param no_new_upgrades If true, packages not currently
* flagged for upgrade will not be
* upgraded.
* \param show_story If true, an explanation of the arrived-at
* solution as a sequence of dependency
* resolutions will be displayed.
*
* \return \b true iff a solution was found and applied.
*/
bool safe_resolve_deps(int verbose,
bool no_new_installs,
bool no_new_upgrades,
bool show_story,
const boost::shared_ptr<terminal_metrics> &term_metrics);
}
}
#endif // CMDLINE_RESOLVER_H
|
//#***************************************************************************************
//# filename: hotint_version_info.h
//# authors: Peter Gruber
//# generated: March 2013
//# description: Data structure for storing and comparing the versions of Hotint
//#
//# remarks:
//#
//# Copyright (c) 2003-2013 Johannes Gerstmayr, Linz Center of Mechatronics GmbH, Austrian
//# Center of Competence in Mechatronics GmbH, Institute of Technical Mechanics at the
//# Johannes Kepler Universitaet Linz, Austria. All rights reserved.
//#
//# This file is part of HotInt.
//# HotInt is free software: you can redistribute it and/or modify it under the terms of
//# the HOTINT license. See folder 'licenses' for more details.
//#
//# bug reports are welcome!!!
//# WWW: www.hotint.org
//# email: bug_reports@hotint.org or support@hotint.org
//#***************************************************************************************
#ifndef __HOTINTVERSIONINFO__
#define __HOTINTVERSIONINFO__
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//$ PG 2013-3-7: old versioning system
//const double HOTINT_version_info = 1.001; //X.Y ... Major/minor revision
//const int HOTINT_log_number = 423; //Z ... log-number
//$ PG 2013-3-7: new versioning system
// The following class handles version numbers of Hotint.
class HotintVersionInfo
{
int major_revision;
int minor_revision;
int log_number;
public:
HotintVersionInfo(int major_revision, int minor_revision, int log_number)
{
this->major_revision = major_revision;
this->minor_revision = minor_revision;
this->log_number = log_number;
}
HotintVersionInfo(const HotintVersionInfo& rhs)
{
major_revision = rhs.major_revision;
minor_revision = rhs.minor_revision;
log_number = rhs.log_number;
}
// In the edc and data files (etc.) double values are stored, which refer to
// the version of Hotint. Such a double consists of the major revision number
// berfore and the minor revision number past the comma
// (Version 1.4.231 ->> 1.004).
// The following constructor is used to convert a double of such type into an
// object of HotintVersionInfo.
HotintVersionInfo(double x)
{
major_revision = (int)x;
minor_revision = (int)((x - major_revision + 1e-15)*1e3);
log_number = 0;
}
HotintVersionInfo(mystr str) //$ DR 2013-03-20
{
major_revision = 0; minor_revision = 0; log_number = 0;
mystr substr;
int pos = 0;
char dot = '.';
if(str.GetUntil(pos,dot,substr))
{
major_revision = substr.MakeInt();
//pos += substr.Length();
pos++; //$ DR 2013-12-11, offset for "dot"
if(str.GetUntil(pos,dot,substr))
{
minor_revision = substr.MakeInt();
//pos += substr.Length();
pos++; //$ DR 2013-12-11, offset for "dot"
str.GetUntil(pos,dot,substr);
log_number = substr.MakeInt();
}
}
}
int GetMajorRevision() const {return major_revision;}
int GetMinorRevision() const {return minor_revision;}
int GetLogNumber() const {return log_number;}
// The following method returns the version of Hotint in form of a double value.
// See also the constructor HotintVersionInfo(double x).
double GetDoubleValue() const
{
return (double)major_revision + ((double)minor_revision)*1e-3;
}
// Return the version string (e.g., "1.3.254")
char* GetString() const
{
char* buffer = new char[32];
if (log_number == 0)
{
sprintf(buffer, "%i.%i", major_revision, minor_revision);
}
else
{
sprintf(buffer, "%i.%i.%i", major_revision, minor_revision, log_number);
}
return buffer;
}
};
static bool operator> (const HotintVersionInfo& lhs, const HotintVersionInfo& rhs)
{
// log_number is not taken into account
if (lhs.GetMajorRevision() > rhs.GetMajorRevision())
return true;
if (lhs.GetMajorRevision() < rhs.GetMajorRevision())
return false;
// so we know lhs.GetMajorRevision() == rhs.GetMajorRevision()
if (lhs.GetMinorRevision() > rhs.GetMinorRevision())
return true;
return false;
}
static bool operator== (const HotintVersionInfo& lhs, const HotintVersionInfo& rhs)
{
// log_number is not taken into account
if (lhs.GetMajorRevision() == rhs.GetMajorRevision() && lhs.GetMinorRevision() == rhs.GetMinorRevision())
return true;
return false;
}
static bool operator!= (const HotintVersionInfo& lhs, const HotintVersionInfo& rhs)
{
// log_number is not taken into account
return !(lhs==rhs);
}
#include "hotint_version.h"
#endif // __HOTINTVERSIONINFO__ |
/* Copyright (C) 1992, 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <hurd.h>
#include <hurd/fd.h>
#include <hurd/socket.h>
/* Put the address of the peer connected to socket FD into *ADDR
(which is *LEN bytes long), and its actual length into *LEN. */
int
__getpeername (int fd, __SOCKADDR_ARG addrarg, socklen_t *len)
{
error_t err;
mach_msg_type_number_t buflen = *len;
int type;
struct sockaddr *addr = addrarg.__sockaddr__;
char *buf = (char *) addr;
addr_port_t aport;
if (err = HURD_DPORT_USE (fd, __socket_peername (port, &aport)))
return __hurd_dfail (fd, err);
err = __socket_whatis_address (aport, &type, &buf, &buflen);
__mach_port_deallocate (__mach_task_self (), aport);
if (err)
return __hurd_dfail (fd, err);
if (*len > buflen)
*len = buflen;
if (buf != (char *) addr)
{
memcpy (addr, buf, *len);
__vm_deallocate (__mach_task_self (), (vm_address_t) buf, buflen);
}
addr->sa_family = type;
return 0;
}
weak_alias (__getpeername, getpeername)
|
/****************************************************************************
*
* Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved.
* Copyright (C) 2003-2013 Sourcefire, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation. You may not use, modify or
* distribute this program under any other version of the GNU General
* Public License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
****************************************************************************/
/**
** @file hi_mi.c
**
** @author Daniel Roelker <droelker@sourcefire.com>
**
** @brief This file contains functions that deal with the logic of
** selecting the appropriate mode inspection (client, server,
** or anomalous server detection).
**
** Not too much more to say about this file, it's really just one function
** that wraps which mode gets called.
**
** NOTES:
** - 3.2.03: Initial development. DJR
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "hi_si.h"
#include "hi_client.h"
#include "hi_server.h"
#include "hi_return_codes.h"
/*
** NAME
** hi_mi_mode_inspection::
*/
/**
** Wrap the logic that HttpInspect uses for which mode to inspect.
**
** This function just uses logic to decide which type of inspection to
** do depending on the inspection mode. Not much to it.
**
** @param Session pointer to the session inspection structure
** @param iInspectMode the type of inspection to perform
** @param data the packet payload
** @param dsize the size of the data
**
** @return integer
**
** @retval HI_SUCCESS function successful
** @retval HI_NONFATAL_ERR the inspection mode is unknown
** @retval HI_INVALID_ARG argument(s) was invalid or NULL
*/
int hi_mi_mode_inspection(HI_SESSION *Session, int iInspectMode,
Packet *p, HttpSessionData *hsd)
{
int iRet;
if (!Session || !p->data || (p->dsize == 0))
return HI_INVALID_ARG;
/*
** Depending on the mode, we inspect the packet differently.
**
** HI_SI_CLIENT_MODE:
** Inspect for HTTP client communication.
**
** HI_SI_SERVER_MODE:
** Inspect for HTTP server communication.
*/
if(iInspectMode == HI_SI_CLIENT_MODE)
{
if ( ScPafEnabled() )
iRet = hi_client_inspection(p, (void *)Session, hsd, !PacketHasStartOfPDU(p));
else
iRet = hi_client_inspection(p, (void *)Session, hsd, p->packet_flags & PKT_STREAM_INSERT);
if (iRet)
return iRet;
}
else if( hsd && iInspectMode == HI_SI_SERVER_MODE )
{
iRet = hi_server_inspection((void *)Session, p, hsd);
if (iRet)
return iRet;
}
else
{
/*
** We only get here if the inspection mode is different, then
** the defines, which we should never get here. In case we do
** then we return non-fatal error.
*/
return HI_NONFATAL_ERR;
}
return HI_SUCCESS;
}
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QAUDIOBUFFER_H
#define QAUDIOBUFFER_H
#include <QtCore/qshareddata.h>
#include <QtMultimedia/qtmultimediaglobal.h>
#include <QtMultimedia/qmultimedia.h>
#include <QtMultimedia/qaudio.h>
#include <QtMultimedia/qaudioformat.h>
QT_BEGIN_NAMESPACE
class QAbstractAudioBuffer;
class QAudioBufferPrivate;
class Q_MULTIMEDIA_EXPORT QAudioBuffer
{
public:
QAudioBuffer();
QAudioBuffer(QAbstractAudioBuffer *provider);
QAudioBuffer(const QAudioBuffer &other);
QAudioBuffer(const QByteArray &data, const QAudioFormat &format, qint64 startTime = -1);
QAudioBuffer(int numFrames, const QAudioFormat &format, qint64 startTime = -1); // Initialized to empty
QAudioBuffer& operator=(const QAudioBuffer &other);
~QAudioBuffer();
bool isValid() const;
QAudioFormat format() const;
int frameCount() const;
int sampleCount() const;
int byteCount() const;
qint64 duration() const;
qint64 startTime() const;
// Data modification
// void clear();
// Other ideas
// operator *=
// operator += (need to be careful about different formats)
// Data access
const void* constData() const; // Does not detach, preferred
const void* data() const; // Does not detach
void *data(); // detaches
// Structures for easier access to stereo data
template <typename T> struct StereoFrameDefault { enum { Default = 0 }; };
template <typename T> struct StereoFrame {
StereoFrame()
: left(T(StereoFrameDefault<T>::Default))
, right(T(StereoFrameDefault<T>::Default))
{
}
StereoFrame(T leftSample, T rightSample)
: left(leftSample)
, right(rightSample)
{
}
StereoFrame& operator=(const StereoFrame &other)
{
// Two straight assigns is probably
// cheaper than a conditional check on
// self assignment
left = other.left;
right = other.right;
return *this;
}
T left;
T right;
T average() const {return (left + right) / 2;}
void clear() {left = right = T(StereoFrameDefault<T>::Default);}
};
typedef StereoFrame<unsigned char> S8U;
typedef StereoFrame<signed char> S8S;
typedef StereoFrame<unsigned short> S16U;
typedef StereoFrame<signed short> S16S;
typedef StereoFrame<float> S32F;
template <typename T> const T* constData() const {
return static_cast<const T*>(constData());
}
template <typename T> const T* data() const {
return static_cast<const T*>(data());
}
template <typename T> T* data() {
return static_cast<T*>(data());
}
private:
QAudioBufferPrivate *d;
};
template <> struct QAudioBuffer::StereoFrameDefault<unsigned char> { enum { Default = 128 }; };
template <> struct QAudioBuffer::StereoFrameDefault<unsigned short> { enum { Default = 32768 }; };
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QAudioBuffer)
#endif // QAUDIOBUFFER_H
|
#ifndef MY_PAGE_FAULT_H
#define MY_PAGE_FAULT_H
extern int register_my_page_fault_handler(void);
extern void unregister_my_page_fault_handler(void);
#endif
|
// Copyright (c) 2012-2013 Andre Martins
// All Rights Reserved.
//
// This file is part of TurboParser 2.1.
//
// TurboParser 2.1 is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// TurboParser 2.1 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 TurboParser 2.1. If not, see <http://www.gnu.org/licenses/>.
#ifndef SEQUENCEINSTANCENUMERIC_H_
#define SEQUENCEINSTANCENUMERIC_H_
#include "SequenceInstance.h"
#include "SequenceDictionary.h"
#include <vector>
#include <string>
using namespace std;
class SequenceInstanceNumeric : public Instance {
public:
SequenceInstanceNumeric() {};
virtual ~SequenceInstanceNumeric() { Clear(); };
int size() { return form_ids_.size(); };
void Clear() {
form_ids_.clear();
prefix_ids_.clear();
suffix_ids_.clear();
has_digit_.clear();
has_upper_.clear();
has_hyphen_.clear();
tag_ids_.clear();
}
int Initialize(const SequenceDictionary &dictionary,
SequenceInstance *instance);
const vector<int> &GetFormIds() const { return form_ids_; }
const vector<int> &GetTagIds() const { return tag_ids_; }
int GetFormId(int i) { return form_ids_[i]; };
int GetMaxPrefixLength(int i) { return prefix_ids_[i].size(); }
int GetMaxSuffixLength(int i) { return suffix_ids_[i].size(); }
int GetPrefixId(int i, int length) { return prefix_ids_[i][length-1]; };
int GetSuffixId(int i, int length) { return suffix_ids_[i][length-1]; };
bool HasDigit(int i) { return has_digit_[i]; };
bool HasUpper(int i) { return has_upper_[i]; };
bool HasHyphen(int i) { return has_hyphen_[i]; };
int GetTagId(int i) { return tag_ids_[i]; };
protected:
bool IsUpperCase(char c) { return (c >= 'A' && c <= 'Z'); }
bool IsLowerCase(char c) { return (c >= 'a' && c <= 'z'); }
bool IsDigit(char c) { return (c >= '0' && c <= '9'); }
bool IsPeriod(char c) { return (c == '.'); }
bool IsPunctuation(char c) { return (c == '\'') || (c == '-') || (c == '&'); }
bool AllUpperCase(const char* word, int len) {
for (int i = 0; i < len; ++i) {
if (!IsUpperCase(word[i])) return false;
}
return true;
};
bool AllLowerCase(const char* word, int len) {
for (int i = 0; i < len; ++i) {
if (!IsLowerCase(word[i])) return false;
}
return true;
};
bool IsCapitalized(const char* word, int len) {
if (len <= 0) return false;
return IsUpperCase(word[0]);
};
bool IsMixedCase(const char* word, int len) {
if (len <= 0) return false;
if (!IsLowerCase(word[0])) return false;
for (int i = 1; i < len; ++i) {
if (IsUpperCase(word[i])) return true;
}
return false;
};
bool EndsWithPeriod(const char* word, int len) {
if (len <= 0) return false;
return IsPeriod(word[len-1]);
};
bool HasInternalPeriod(const char* word, int len) {
if (len <= 0) return false;
for (int i = 0; i < len - 1; ++i) {
if (IsPeriod(word[i])) return true;
}
return false;
};
bool HasInternalPunctuation(const char* word, int len) {
if (len <= 0) return false;
for (int i = 0; i < len - 1; ++i) {
if (IsPunctuation(word[i])) return true;
}
return false;
};
int CountDigits(const char* word, int len) {
int num_digits = 0;
for (int i = 0; i < len; ++i) {
if (IsDigit(word[i])) ++num_digits;
}
return num_digits;
};
bool HasUpperCaseLetters(const char* word, int len) {
for (int i = 0; i < len; ++i) {
if (IsUpperCase(word[i])) return true;
}
return false;
};
bool HasHyphen(const char* word, int len) {
for (int i = 0; i < len; ++i) {
if ('-' == word[i]) return true;
}
return false;
};
private:
vector<int> form_ids_;
vector<vector<int> > prefix_ids_;
vector<vector<int> > suffix_ids_;
vector<bool> has_digit_;
vector<bool> has_upper_;
vector<bool> has_hyphen_;
vector<int> tag_ids_;
};
#endif /* SEQUENCEINSTANCENUMERIC_H_ */
|
/*
Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
static char USMID[] = "@(#) libf/tape/c1/startsp.c 92.0 10/08/98 14:30:10";
#include <errno.h>
#include <liberrno.h>
#include <ffio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "fio.h"
/*
* STARTSP - Begins special processing at EOV
*
* unump - name or unit number of file
*
* istat - status
* 0 OK
* nonzero - Not OK
*/
void
STARTSP(_f_int *unump, _f_int *istat)
{
register int ret;
FIOSPTR css;
unit *cup;
GET_FIOS_PTR(css);
STMT_BEGIN(*unump, 0, T_TAPE, NULL, css, cup);
if (cup == NULL)
_ferr(css, FENOTOPN);
*istat = 0;
if (cup->ufs == FS_FDC) {
ret = XRCALL(cup->ufp.fdc, fcntlrtn) cup->ufp.fdc,
FC_STARTSP, 0, &cup->uffsw);
if (ret < 0)
*istat = cup->uffsw.sw_error;
else {
cup->uwrt = NO;
cup->uspcproc = 1;
}
}
else
_ferr(css, FECONNTP);
STMT_END(cup, T_TAPE, NULL, css);
return;
}
|
/* stringhelp.h
* Copyright (C) 1998, 1999, 2000, 2001, 2003,
* 2006, 2007, 2009 Free Software Foundation, Inc.
*
* This file is part of JNLIB, which is a subsystem of GnuPG.
*
* JNLIB 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.
*
* JNLIB 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 copies of the GNU General Public License
* and the GNU Lesser General Public License along with this program;
* if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBJNLIB_STRINGHELP_H
#define LIBJNLIB_STRINGHELP_H
#include "types.h"
/*-- stringhelp.c --*/
char *has_leading_keyword (const char *string, const char *keyword);
const char *memistr (const void *buf, size_t buflen, const char *sub);
char *mem2str( char *, const void *, size_t);
char *trim_spaces( char *string );
char *trim_trailing_spaces( char *string );
unsigned int trim_trailing_chars( unsigned char *line, unsigned len,
const char *trimchars);
unsigned int trim_trailing_ws( unsigned char *line, unsigned len );
size_t length_sans_trailing_chars (const unsigned char *line, size_t len,
const char *trimchars );
size_t length_sans_trailing_ws (const unsigned char *line, size_t len);
char *make_basename(const char *filepath, const char *inputpath);
char *make_dirname(const char *filepath);
char *make_filename( const char *first_part, ... ) GNUPG_GCC_A_SENTINEL(0);
char *make_filename_try (const char *first_part, ... ) GNUPG_GCC_A_SENTINEL(0);
char *make_absfilename (const char *first_part, ...) GNUPG_GCC_A_SENTINEL(0);
char *make_absfilename_try (const char *first_part,
...) GNUPG_GCC_A_SENTINEL(0);
int compare_filenames( const char *a, const char *b );
int hextobyte (const char *s);
size_t print_sanitized_buffer (FILE *fp, const void *buffer, size_t length,
int delim);
size_t print_sanitized_buffer2 (FILE *fp, const void *buffer, size_t length,
int delim, int delim2);
size_t print_sanitized_utf8_buffer (FILE *fp, const void *buffer,
size_t length, int delim);
size_t print_sanitized_string (FILE *fp, const char *string, int delim);
size_t print_sanitized_string2 (FILE *fp, const char *string,
int delim, int delim2);
size_t print_sanitized_utf8_string (FILE *fp, const char *string, int delim);
char *sanitize_buffer (const void *p, size_t n, int delim);
size_t utf8_charcount (const char *s);
#ifdef HAVE_W32_SYSTEM
const char *w32_strerror (int ec);
#endif
int ascii_isupper (int c);
int ascii_islower (int c);
int ascii_toupper (int c);
int ascii_tolower (int c);
int ascii_strcasecmp( const char *a, const char *b );
int ascii_strncasecmp (const char *a, const char *b, size_t n);
int ascii_memcasecmp( const void *a, const void *b, size_t n );
const char *ascii_memistr ( const void *buf, size_t buflen, const char *sub);
void *ascii_memcasemem (const void *haystack, size_t nhaystack,
const void *needle, size_t nneedle);
#ifndef HAVE_MEMICMP
int memicmp( const char *a, const char *b, size_t n );
#endif
#ifndef HAVE_STPCPY
char *stpcpy(char *a,const char *b);
#endif
#ifndef HAVE_STRSEP
char *strsep (char **stringp, const char *delim);
#endif
#ifndef HAVE_STRLWR
char *strlwr(char *a);
#endif
#ifndef HAVE_STRTOUL
# define strtoul(a,b,c) ((unsigned long)strtol((a),(b),(c)))
#endif
#ifndef HAVE_MEMMOVE
# define memmove(d, s, n) bcopy((s), (d), (n))
#endif
#ifndef HAVE_STRICMP
# define stricmp(a,b) strcasecmp( (a), (b) )
#endif
#ifndef HAVE_MEMRCHR
void *memrchr (const void *buffer, int c, size_t n);
#endif
#ifndef HAVE_ISASCII
static inline int
isascii (int c)
{
return (((c) & ~0x7f) == 0);
}
#endif /* !HAVE_ISASCII */
#ifndef STR
# define STR(v) #v
#endif
#define STR2(v) STR(v)
/* Percent-escape the string STR by replacing colons with '%3a'. If
EXTRA is not NULL, also replace all characters given in EXTRA. The
"try_" variant fails with NULL if not enough memory can be
allocated. */
char *percent_escape (const char *str, const char *extra);
char *try_percent_escape (const char *str, const char *extra);
/* Concatenate the string S1 with all the following strings up to a
NULL. Returns a malloced buffer with the new string or NULL on a
malloc error or if too many arguments are given. */
char *strconcat (const char *s1, ...) GNUPG_GCC_A_SENTINEL(0);
/* Ditto, but die on error. */
char *xstrconcat (const char *s1, ...) GNUPG_GCC_A_SENTINEL(0);
/*-- mapstrings.c --*/
const char *map_static_macro_string (const char *string);
#endif /*LIBJNLIB_STRINGHELP_H*/
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "InformationElements"
* found in "../asn/InformationElements.asn"
* `asn1c -fcompound-names -fnative-types`
*/
#include "DL-UM-RLC-Mode-r6.h"
static asn_TYPE_member_t asn_MBR_DL_UM_RLC_Mode_r6_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct DL_UM_RLC_Mode_r6, dl_UM_RLC_LI_size),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_DL_UM_RLC_LI_size,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"dl-UM-RLC-LI-size"
},
{ ATF_POINTER, 1, offsetof(struct DL_UM_RLC_Mode_r6, dl_Reception_Window_Size),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_DL_Reception_Window_Size_r6,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"dl-Reception-Window-Size"
},
};
static int asn_MAP_DL_UM_RLC_Mode_r6_oms_1[] = { 1 };
static ber_tlv_tag_t asn_DEF_DL_UM_RLC_Mode_r6_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_DL_UM_RLC_Mode_r6_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* dl-UM-RLC-LI-size at 3693 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* dl-Reception-Window-Size at 3694 */
};
static asn_SEQUENCE_specifics_t asn_SPC_DL_UM_RLC_Mode_r6_specs_1 = {
sizeof(struct DL_UM_RLC_Mode_r6),
offsetof(struct DL_UM_RLC_Mode_r6, _asn_ctx),
asn_MAP_DL_UM_RLC_Mode_r6_tag2el_1,
2, /* Count of tags in the map */
asn_MAP_DL_UM_RLC_Mode_r6_oms_1, /* Optional members */
1, 0, /* Root/Additions */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_DL_UM_RLC_Mode_r6 = {
"DL-UM-RLC-Mode-r6",
"DL-UM-RLC-Mode-r6",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
0, /* Use generic outmost tag fetcher */
asn_DEF_DL_UM_RLC_Mode_r6_tags_1,
sizeof(asn_DEF_DL_UM_RLC_Mode_r6_tags_1)
/sizeof(asn_DEF_DL_UM_RLC_Mode_r6_tags_1[0]), /* 1 */
asn_DEF_DL_UM_RLC_Mode_r6_tags_1, /* Same as above */
sizeof(asn_DEF_DL_UM_RLC_Mode_r6_tags_1)
/sizeof(asn_DEF_DL_UM_RLC_Mode_r6_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_DL_UM_RLC_Mode_r6_1,
2, /* Elements count */
&asn_SPC_DL_UM_RLC_Mode_r6_specs_1 /* Additional specs */
};
|
/*
* This definitions of the PIC18LF2539 MCU.
*
* This file is part of the GNU PIC library for SDCC, originally
* created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
*
* This file is generated automatically by the cinc2h.pl, 2016-04-13 17:24:01 UTC.
*
* SDCC is licensed under the GNU Public license (GPL) v2. Note that
* this license covers the code to the compiler and other executables,
* but explicitly does not cover any code or objects generated by sdcc.
*
* For pic device libraries and header files which are derived from
* Microchip header (.inc) and linker script (.lkr) files Microchip
* requires that "The header files should state that they are only to be
* used with authentic Microchip devices" which makes them incompatible
* with the GPL. Pic device libraries and header files are located at
* non-free/lib and non-free/include directories respectively.
* Sdcc should be run with the --use-non-free command line option in
* order to include non-free header files and libraries.
*
* See http://sdcc.sourceforge.net/ for the latest information on sdcc.
*/
#include <pic18lf2539.h>
//==============================================================================
__at(0x0F80) __sfr PORTA;
__at(0x0F80) volatile __PORTAbits_t PORTAbits;
__at(0x0F81) __sfr PORTB;
__at(0x0F81) volatile __PORTBbits_t PORTBbits;
__at(0x0F82) __sfr PORTC;
__at(0x0F82) volatile __PORTCbits_t PORTCbits;
__at(0x0F89) __sfr LATA;
__at(0x0F89) volatile __LATAbits_t LATAbits;
__at(0x0F8A) __sfr LATB;
__at(0x0F8A) volatile __LATBbits_t LATBbits;
__at(0x0F8B) __sfr LATC;
__at(0x0F8B) volatile __LATCbits_t LATCbits;
__at(0x0F92) __sfr DDRA;
__at(0x0F92) volatile __DDRAbits_t DDRAbits;
__at(0x0F92) __sfr TRISA;
__at(0x0F92) volatile __TRISAbits_t TRISAbits;
__at(0x0F93) __sfr DDRB;
__at(0x0F93) volatile __DDRBbits_t DDRBbits;
__at(0x0F93) __sfr TRISB;
__at(0x0F93) volatile __TRISBbits_t TRISBbits;
__at(0x0F94) __sfr DDRC;
__at(0x0F94) volatile __DDRCbits_t DDRCbits;
__at(0x0F94) __sfr TRISC;
__at(0x0F94) volatile __TRISCbits_t TRISCbits;
__at(0x0F9D) __sfr PIE1;
__at(0x0F9D) volatile __PIE1bits_t PIE1bits;
__at(0x0F9E) __sfr PIR1;
__at(0x0F9E) volatile __PIR1bits_t PIR1bits;
__at(0x0F9F) __sfr IPR1;
__at(0x0F9F) volatile __IPR1bits_t IPR1bits;
__at(0x0FA0) __sfr PIE2;
__at(0x0FA0) volatile __PIE2bits_t PIE2bits;
__at(0x0FA1) __sfr PIR2;
__at(0x0FA1) volatile __PIR2bits_t PIR2bits;
__at(0x0FA2) __sfr IPR2;
__at(0x0FA2) volatile __IPR2bits_t IPR2bits;
__at(0x0FA6) __sfr EECON1;
__at(0x0FA6) volatile __EECON1bits_t EECON1bits;
__at(0x0FA7) __sfr EECON2;
__at(0x0FA8) __sfr EEDATA;
__at(0x0FA9) __sfr EEADR;
__at(0x0FAB) __sfr RCSTA;
__at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
__at(0x0FAC) __sfr TXSTA;
__at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
__at(0x0FAD) __sfr TXREG;
__at(0x0FAE) __sfr RCREG;
__at(0x0FAF) __sfr SPBRG;
__at(0x0FB1) __sfr T3CON;
__at(0x0FB1) volatile __T3CONbits_t T3CONbits;
__at(0x0FB2) __sfr TMR3;
__at(0x0FB2) __sfr TMR3L;
__at(0x0FB3) __sfr TMR3H;
__at(0x0FBA) __sfr CCP2CON;
__at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
__at(0x0FBB) __sfr CCPR2;
__at(0x0FBB) __sfr CCPR2L;
__at(0x0FBC) __sfr CCPR2H;
__at(0x0FBD) __sfr CCP1CON;
__at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
__at(0x0FBE) __sfr CCPR1;
__at(0x0FBE) __sfr CCPR1L;
__at(0x0FBF) __sfr CCPR1H;
__at(0x0FC1) __sfr ADCON1;
__at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
__at(0x0FC2) __sfr ADCON0;
__at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
__at(0x0FC3) __sfr ADRES;
__at(0x0FC3) __sfr ADRESL;
__at(0x0FC4) __sfr ADRESH;
__at(0x0FC5) __sfr SSPCON2;
__at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
__at(0x0FC6) __sfr SSPCON1;
__at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
__at(0x0FC7) __sfr SSPSTAT;
__at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
__at(0x0FC8) __sfr SSPADD;
__at(0x0FC9) __sfr SSPBUF;
__at(0x0FCA) __sfr T2CON;
__at(0x0FCA) volatile __T2CONbits_t T2CONbits;
__at(0x0FCB) __sfr PR2;
__at(0x0FCC) __sfr TMR2;
__at(0x0FCD) __sfr T1CON;
__at(0x0FCD) volatile __T1CONbits_t T1CONbits;
__at(0x0FCE) __sfr TMR1;
__at(0x0FCE) __sfr TMR1L;
__at(0x0FCF) __sfr TMR1H;
__at(0x0FD0) __sfr RCON;
__at(0x0FD0) volatile __RCONbits_t RCONbits;
__at(0x0FD1) __sfr WDTCON;
__at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
__at(0x0FD2) __sfr LVDCON;
__at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
__at(0x0FD3) __sfr OSCCON;
__at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
__at(0x0FD5) __sfr T0CON;
__at(0x0FD5) volatile __T0CONbits_t T0CONbits;
__at(0x0FD6) __sfr TMR0;
__at(0x0FD6) __sfr TMR0L;
__at(0x0FD7) __sfr TMR0H;
__at(0x0FD8) __sfr STATUS;
__at(0x0FD8) volatile __STATUSbits_t STATUSbits;
__at(0x0FD9) __sfr FSR2L;
__at(0x0FDA) __sfr FSR2H;
__at(0x0FDB) __sfr PLUSW2;
__at(0x0FDC) __sfr PREINC2;
__at(0x0FDD) __sfr POSTDEC2;
__at(0x0FDE) __sfr POSTINC2;
__at(0x0FDF) __sfr INDF2;
__at(0x0FE0) __sfr BSR;
__at(0x0FE1) __sfr FSR1L;
__at(0x0FE2) __sfr FSR1H;
__at(0x0FE3) __sfr PLUSW1;
__at(0x0FE4) __sfr PREINC1;
__at(0x0FE5) __sfr POSTDEC1;
__at(0x0FE6) __sfr POSTINC1;
__at(0x0FE7) __sfr INDF1;
__at(0x0FE8) __sfr WREG;
__at(0x0FE9) __sfr FSR0L;
__at(0x0FEA) __sfr FSR0H;
__at(0x0FEB) __sfr PLUSW0;
__at(0x0FEC) __sfr PREINC0;
__at(0x0FED) __sfr POSTDEC0;
__at(0x0FEE) __sfr POSTINC0;
__at(0x0FEF) __sfr INDF0;
__at(0x0FF0) __sfr INTCON3;
__at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
__at(0x0FF1) __sfr INTCON2;
__at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
__at(0x0FF2) __sfr INTCON;
__at(0x0FF2) volatile __INTCONbits_t INTCONbits;
__at(0x0FF3) __sfr PROD;
__at(0x0FF3) __sfr PRODL;
__at(0x0FF4) __sfr PRODH;
__at(0x0FF5) __sfr TABLAT;
__at(0x0FF6) __sfr TBLPTR;
__at(0x0FF6) __sfr TBLPTRL;
__at(0x0FF7) __sfr TBLPTRH;
__at(0x0FF8) __sfr TBLPTRU;
__at(0x0FF9) __sfr PC;
__at(0x0FF9) __sfr PCL;
__at(0x0FFA) __sfr PCLATH;
__at(0x0FFB) __sfr PCLATU;
__at(0x0FFC) __sfr STKPTR;
__at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
__at(0x0FFD) __sfr TOS;
__at(0x0FFD) __sfr TOSL;
__at(0x0FFE) __sfr TOSH;
__at(0x0FFF) __sfr TOSU;
|
#pragma once
#include "../../Shared.h"
#include "../AbstractCommand.h"
#include "Global.h"
#include <boost/foreach.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <QtCore/QObject>
#include <QtCore/QString>
class QXmlStreamWriter;
class CORE_EXPORT PanasonicPresetCommand : public AbstractCommand
{
Q_OBJECT
public:
explicit PanasonicPresetCommand(QObject* parent = 0);
virtual void readProperties(boost::property_tree::wptree& pt);
virtual void writeProperties(QXmlStreamWriter* writer);
const QString& getAddress() const;
int getPreset() const;
bool getTriggerOnNext() const;
void setAddress(const QString& address);
void setPreset(int preset);
void setTriggerOnNext(bool triggerOnNext);
private:
QString address = Panasonic::DEFAULT_ADDRESS;
int preset = Panasonic::DEFAULT_PRESET;
bool triggerOnNext = Panasonic::DEFAULT_TRIGGER_ON_NEXT;
Q_SIGNAL void addressChanged(const QString&);
Q_SIGNAL void presetChanged(int);
Q_SIGNAL void triggerOnNextChanged(bool);
};
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSGTEXTURE_P_H
#define QSGTEXTURE_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 <QtQuick/qtquickglobal.h>
#include <private/qobject_p.h>
#if QT_CONFIG(opengl)
# include <QtGui/qopengl.h>
#endif
#include "qsgtexture.h"
#include <QtQuick/private/qsgcontext_p.h>
QT_BEGIN_NAMESPACE
class QSGTexturePrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QSGTexture)
public:
QSGTexturePrivate();
uint wrapChanged : 1;
uint filteringChanged : 1;
uint anisotropyChanged : 1;
uint horizontalWrap : 1;
uint verticalWrap : 1;
uint mipmapMode : 2;
uint filterMode : 2;
uint anisotropyLevel: 3;
};
class Q_QUICK_PRIVATE_EXPORT QSGPlainTexture : public QSGTexture
{
Q_OBJECT
public:
QSGPlainTexture();
virtual ~QSGPlainTexture();
void setOwnsTexture(bool owns) { m_owns_texture = owns; }
bool ownsTexture() const { return m_owns_texture; }
void setTextureId(int id);
int textureId() const override;
void setTextureSize(const QSize &size) { m_texture_size = size; }
QSize textureSize() const override { return m_texture_size; }
void setHasAlphaChannel(bool alpha) { m_has_alpha = alpha; }
bool hasAlphaChannel() const override { return m_has_alpha; }
bool hasMipmaps() const override { return mipmapFiltering() != QSGTexture::None; }
void setImage(const QImage &image);
const QImage &image() { return m_image; }
void bind() override;
static QSGPlainTexture *fromImage(const QImage &image) {
QSGPlainTexture *t = new QSGPlainTexture();
t->setImage(image);
return t;
}
protected:
QImage m_image;
uint m_texture_id;
QSize m_texture_size;
QRectF m_texture_rect;
uint m_has_alpha : 1;
uint m_dirty_texture : 1;
uint m_dirty_bind_options : 1;
uint m_owns_texture : 1;
uint m_mipmaps_generated : 1;
uint m_retain_image: 1;
};
Q_QUICK_PRIVATE_EXPORT bool qsg_safeguard_texture(QSGTexture *);
QT_END_NAMESPACE
#endif // QSGTEXTURE_P_H
|
/*
* C Interface: ptk-file-list
*
* Description:
*
*
* Author: Hong Jen Yee (PCMan) <pcman.tw (AT) gmail.com>, (C) 2006
*
* Copyright: See COPYING file that comes with this distribution
*
*/
#ifndef _PTK_FILE_LIST_H_
#define _PTK_FILE_LIST_H_
#include <gtk/gtk.h>
#include <glib.h>
#include <glib-object.h>
#include <sys/types.h>
#include "vfs-dir.h"
G_BEGIN_DECLS
#define PTK_TYPE_FILE_LIST (ptk_file_list_get_type())
#define PTK_FILE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PTK_TYPE_FILE_LIST, PtkFileList))
#define PTK_FILE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PTK_TYPE_FILE_LIST, PtkFileListClass))
#define PTK_IS_FILE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PTK_TYPE_FILE_LIST))
#define PTK_IS_FILE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PTK_TYPE_FILE_LIST))
#define PTK_FILE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PTK_TYPE_FILE_LIST, PtkFileListClass))
/* Columns of folder view */
enum{
COL_FILE_BIG_ICON = 0,
COL_FILE_SMALL_ICON,
COL_FILE_NAME,
COL_FILE_SIZE,
COL_FILE_DESC,
COL_FILE_PERM,
COL_FILE_OWNER,
COL_FILE_MTIME,
COL_FILE_INFO,
N_FILE_LIST_COLS
};
// sort_dir of folder view - do not change order, saved
// see also: main-window.c main_window_socket_command() get sort_first
enum{
PTK_LIST_SORT_DIR_MIXED = 0,
PTK_LIST_SORT_DIR_FIRST,
PTK_LIST_SORT_DIR_LAST
};
typedef struct _PtkFileList PtkFileList;
typedef struct _PtkFileListClass PtkFileListClass;
struct _PtkFileList
{
GObject parent;
/* <private> */
VFSDir* dir;
GList* files;
guint n_files;
gboolean show_hidden : 1;
gboolean big_thumbnail : 1;
int max_thumbnail;
int sort_col;
GtkSortType sort_order;
gboolean sort_natural; //sfm
gboolean sort_case; //sfm
gboolean sort_hidden_first; //sfm
char sort_dir; //sfm
/* Random integer to check whether an iter belongs to our model */
gint stamp;
};
struct _PtkFileListClass
{
GObjectClass parent;
/* Default signal handlers */
void ( *file_created ) ( VFSDir* dir, const char* file_name );
void ( *file_deleted ) ( VFSDir* dir, const char* file_name );
void ( *file_changed ) ( VFSDir* dir, const char* file_name );
void ( *load_complete ) ( VFSDir* dir );
};
GType ptk_file_list_get_type (void);
PtkFileList *ptk_file_list_new ( VFSDir* dir, gboolean show_hidden );
void ptk_file_list_set_dir( PtkFileList* list, VFSDir* dir );
gboolean ptk_file_list_find_iter( PtkFileList* list, GtkTreeIter* it, VFSFileInfo* fi );
void ptk_file_list_file_created( VFSDir* dir, VFSFileInfo* file,
PtkFileList* list );
void ptk_file_list_file_deleted( VFSDir* dir, VFSFileInfo* file,
PtkFileList* list );
void ptk_file_list_file_changed( VFSDir* dir, VFSFileInfo* file,
PtkFileList* list );
void ptk_file_list_show_thumbnails( PtkFileList* list, gboolean is_big,
int max_file_size );
void ptk_file_list_sort ( PtkFileList* list ); //sfm
G_END_DECLS
#endif
|
/*
* binary file loading utilities
* Copyright 2009 Greg Hewgill
*
* This file is part of Emulino.
*
* Emulino 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.
*
* Emulino 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 Emulino. If not, see <http://www.gnu.org/licenses/>.
*/
#include "util.h"
#ifdef __cplusplus
extern "C" {
#endif
u32 load_file(const char *fn, u8 *buf, u32 bufsize);
#ifdef __cplusplus
} // extern "C"
#endif
|
// David Eberly, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2017
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// File Version: 3.0.0 (2016/06/19)
#pragma once
#include <Mathematics/GteVector3.h>
#include <Mathematics/GteHypersphere.h>
#include <Mathematics/GteCone.h>
#include <Mathematics/GteFIQuery.h>
#include <Mathematics/GteTIQuery.h>
namespace gte
{
template <typename Real>
class TIQuery<Real, Sphere3<Real>, Cone3<Real>>
{
public:
struct Result
{
bool intersect;
};
Result operator()(Sphere3<Real> const& sphere, Cone3<Real> const& cone);
};
template <typename Real>
class FIQuery<Real, Sphere3<Real>, Cone3<Real>>
{
public:
struct Result
{
// If an intersection occurs, it is potentially an infinite set. If
// the cone vertex is inside the sphere, 'point' is set to the cone
// vertex; else if the sphere center is inside the cone, 'point' is
// set to the sphere center; else 'point' is set to the cone point
// closest to the cone vertex.
bool intersect;
Vector3<Real> point;
};
Result operator()(Sphere3<Real> const& sphere, Cone3<Real> const& cone);
};
template <typename Real>
typename TIQuery<Real, Sphere3<Real>, Cone3<Real>>::Result
TIQuery<Real, Sphere3<Real>, Cone3<Real>>::operator()(
Sphere3<Real> const& sphere, Cone3<Real> const& cone)
{
Result result;
Real invSin = ((Real)1) / cone.sinAngle;
Real cosSqr = cone.cosAngle * cone.cosAngle;
Vector3<Real> CmV = sphere.center - cone.ray.origin;
Vector3<Real> D = CmV + (sphere.radius * invSin) * cone.ray.direction;
Real lenSqr = Dot(D, D);
Real e = Dot(D, cone.ray.direction);
if (e > (Real)0 && e*e >= lenSqr*cosSqr)
{
Real sinSqr = cone.sinAngle * cone.sinAngle;
lenSqr = Dot(CmV, CmV);
e = -Dot(CmV, cone.ray.direction);
if (e > (Real)0 && e*e >= lenSqr*sinSqr)
{
Real rSqr = sphere.radius * sphere.radius;
result.intersect = (lenSqr <= rSqr);
}
else
{
result.intersect = true;
}
}
else
{
result.intersect = false;
}
return result;
}
template <typename Real>
typename FIQuery<Real, Sphere3<Real>, Cone3<Real>>::Result
FIQuery<Real, Sphere3<Real>, Cone3<Real>>::operator()(
Sphere3<Real> const& sphere, Cone3<Real> const& cone)
{
Result result;
// Test whether the cone vertex is inside the sphere.
Vector3<Real> diff = sphere.center - cone.ray.origin;
Real rSqr = sphere.radius * sphere.radius;
Real lenSqr = Dot(diff, diff);
if (lenSqr <= rSqr)
{
// The cone vertex is inside the sphere, so the sphere and cone
// intersect.
result.intersect = true;
result.point = cone.ray.origin;
return result;
}
// Test whether the sphere center is inside the cone.
Real dot = Dot(diff, cone.ray.direction);
Real dotSqr = dot*dot;
Real cosSqr = cone.cosAngle * cone.cosAngle;
if (dotSqr >= lenSqr*cosSqr && dot > (Real)0)
{
// The sphere center is inside cone, so the sphere and cone
// intersect.
result.intersect = true;
result.point = sphere.center;
return result;
}
// The sphere center is outside the cone. The problem now reduces to
// computing an intersection between the circle and the ray in the plane
// containing the cone vertex and spanned by the cone axis and vector
// from the cone vertex to the sphere center.
// The ray is t*D+V (t >= 0) where |D| = 1 and dot(A,D) = cos(angle).
// Also, D = e*A+f*(C-V). Plugging the ray equation into sphere equation
// yields R^2 = |t*D+V-C|^2, so the quadratic for intersections is
// t^2 - 2*dot(D,C-V)*t + |C-V|^2 - R^2 = 0. An intersection occurs
// if and only if the discriminant is nonnegative. This test becomes
//
// dot(D,C-V)^2 >= dot(C-V,C-V) - R^2
//
// Note that if the right-hand side is nonpositive, then the inequality
// is true (the sphere contains V). This is already ruled out in the
// first block of code in this function.
Real uLen = sqrt(std::max(lenSqr - dotSqr, (Real)0));
Real test = cone.cosAngle * dot + cone.sinAngle * uLen;
Real discr = test * test - lenSqr + rSqr;
if (discr >= (Real)0 && test >= (Real)0)
{
// Compute the point of intersection closest to the cone vertex.
result.intersect = true;
Real t = test - sqrt(std::max(discr, (Real)0));
Vector3<Real> B = diff - dot * cone.ray.direction;
Real tmp = cone.sinAngle / uLen;
result.point = t * (cone.cosAngle * cone.ray.direction + tmp * B);
}
else
{
result.intersect = false;
}
return result;
}
}
|
/**
* Copyright (C) 2007-2012 Hypertable, Inc.
*
* This file is part of Hypertable.
*
* Hypertable is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 3 of the
* License, or any later version.
*
* Hypertable 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 HYPERTABLE_RANGE_TRANSFER_INFO_H
#define HYPERTABLE_RANGE_TRANSFER_INFO_H
namespace Hypertable {
/**
*/
class RangeTransferInfo {
public:
RangeTransferInfo() { }
void set_split(const String &split_row, bool split_off_high) {
m_split_row = split_row;
m_split_off_high = split_off_high;
}
bool transferring(const char *row) {
if (m_split_row.length() == 0)
return true;
int cmp = strcmp(row, m_split_row.c_str());
return ((cmp <= 0 && !m_split_off_high) || (cmp > 0 && m_split_off_high));
}
void clear() { m_split_row = ""; }
private:
String m_split_row;
bool m_split_off_high;
};
}
#endif // HYPERTABLE_RANGE_TRANSFER_INFO_H
|
/******************** (C) COPYRIGHT 2011 STMicroelectronics ********************
* File Name : usb_pwr.h
* Author : MCD Application Team
* Version : V3.3.0
* Date : 21-March-2011
* Description : Connection/disconnection & power management header
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USB_PWR_H
#define __USB_PWR_H
/* Includes ------------------------------------------------------------------*/
#include "usb_core.h"
#include "usb_type.h"
/* Exported types ------------------------------------------------------------*/
typedef enum _RESUME_STATE
{
RESUME_EXTERNAL,
RESUME_INTERNAL,
RESUME_LATER,
RESUME_WAIT,
RESUME_START,
RESUME_ON,
RESUME_OFF,
RESUME_ESOF
} RESUME_STATE;
typedef enum _DEVICE_STATE
{
UNCONNECTED,
ATTACHED,
POWERED,
SUSPENDED,
ADDRESSED,
CONFIGURED
} DEVICE_STATE;
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void Suspend(void);
void Resume_Init(void);
void Resume(RESUME_STATE eResumeSetVal);
RESULT PowerOn(void);
RESULT PowerOff(void);
/* External variables --------------------------------------------------------*/
extern __IO uint32_t bDeviceState; /* USB device status */
extern __IO bool fSuspendEnabled; /* true when suspend is possible */
#endif /*__USB_PWR_H*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
#ifndef ATOMIFY_UNITS_H
#define ATOMIFY_UNITS_H
#include <QObject>
#include <mpi.h>
#include <lammps.h>
class Units : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString time READ time WRITE setTime NOTIFY timeChanged)
Q_PROPERTY(QString volume READ volume WRITE setVolume NOTIFY volumeChanged)
Q_PROPERTY(QString density READ density WRITE setDensity NOTIFY densityChanged)
Q_PROPERTY(QString length READ length WRITE setLength NOTIFY lengthChanged)
Q_PROPERTY(int dimensions READ dimensions WRITE setDimensions NOTIFY dimensionsChanged)
public:
enum Type { LJ, Real, Metal, SI, CGS, Electron, Micro, Nano };
explicit Units(QObject *parent = 0);
~Units();
void synchronize(LAMMPS_NS::LAMMPS *lammps);
void reset();
QString name() const;
QString time() const;
QString volume() const;
QString density() const;
QString length() const;
int dimensions() const;
Q_INVOKABLE QString timeToFormattedString(int seconds, QString format);
signals:
void nameChanged(QString name);
void timeChanged(QString time);
void volumeChanged(QString volume);
void densityChanged(QString density);
void lengthChanged(QString length);
void dimensionsChanged(int dimensions);
public slots:
void setName(QString name);
void setTime(QString time);
void setVolume(QString volume);
void setDensity(QString density);
void setLength(QString length);
void setDimensions(int dimensions);
private:
Type type;
char *unit_style = nullptr; // From lammps
QString m_name;
QString m_time;
QString m_volume;
QString m_density;
QString m_length;
int m_dimensions = 3;
};
#endif // ATOMIFY_UNITS_H
|
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RY_EGS_CLIENT_MESSAGES_H
#define RY_EGS_CLIENT_MESSAGES_H
/**
* class used to handle message from client with the new IOS message forwaeding system
* \author Nicolas Brigand
* \author Nevrax France
* \date 2002
*/
class CClientMessages
{
public:
static void init();
static void release();
};
#endif // RY_EGS_CLIENT_MESSAGES_H
/* End of client_messages.h */
|
//
// Copyright (C) 2013-2016 University of Amsterdam
//
// 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 OPTIONTERM_H
#define OPTIONTERM_H
#include "optionterms.h"
class OptionTerm : public OptionTerms
{
public:
OptionTerm();
virtual Json::Value asJSON()const OVERRIDE;
virtual void set(const Json::Value& value) OVERRIDE;
virtual Option* clone() const OVERRIDE;
virtual void setValue(const std::vector<std::string> &value) OVERRIDE;
std::vector<std::string> term() const;
};
#endif // OPTIONTERM_H
|
#define ED25519_SUFFIX _sse2
#define ED25519_SSE2
#include "../../ed25519/ed25519.c"
|
//============================================================================
// Name : hello.cpp
// Author : Oliver
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <string>
using namespace std;
int main(){
string strCoins1, strCoins2;
string strStatus;
int t;
int * aryTracking;
cin >> t;
for( int i = 1; i <= t; i++ ){
aryTracking = new int [12]();
for( int r = 1; r <= 3; r++ ){
cin >> strCoins1 >> strCoins2;
cin >> strStatus;
if( strStatus == "even" ){
for( int j = 0; j < 4; j++ ){
aryTracking[strCoins1[j]-'A'] = 10;
aryTracking[strCoins2[j]-'A'] = 10;
}
}else if( strStatus == "up" ){
for( int j = 0; j < 4; j++ ){
if( aryTracking[strCoins1[j]-'A'] != 10 )
aryTracking[strCoins1[j]-'A'] = 11;
if( aryTracking[strCoins2[j]-'A'] != 10 )
aryTracking[strCoins2[j]-'A'] = 9;
}
}else{
for( int j = 0; j < 4; j++ ){
if( aryTracking[strCoins1[j]-'A'] != 10 )
aryTracking[strCoins1[j]-'A'] = 9;
if( aryTracking[strCoins2[j]-'A'] != 10 )
aryTracking[strCoins2[j]-'A'] = 11;
}
}
}
for( int r = 0; r <= 11; r++ ){
if( aryTracking[r] != 10 ){
if( aryTracking[r] == 11 ){
cout << static_cast<char>(r + 'A');
cout << " is the counterfeit coin and it is " << "heavy" << "." << endl;
}else if( aryTracking[r] == 9 ){
cout << static_cast<char>(r + 'A');
cout << " is the counterfeit coin and it is " << "light" << "." << endl;
}
}
}
delete [] aryTracking;
}
return 0;
}
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// 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.
#ifndef Patternist_DelegatingNamespaceResolver_H
#define Patternist_DelegatingNamespaceResolver_H
#include <QHash>
#include "qnamespaceresolver_p.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
namespace QPatternist
{
/**
* @short Contains a set of bindings, plus a pointer to another resolver
* which is delegates requests to, in case it can't handle a lookup on its
* own.
*
* @ingroup Patternist
* @author Frans Englich <frans.englich@nokia.com>
*/
class DelegatingNamespaceResolver : public NamespaceResolver
{
public:
DelegatingNamespaceResolver(const NamespaceResolver::Ptr &ns);
DelegatingNamespaceResolver(const NamespaceResolver::Ptr &ns,
const Bindings &overrides);
virtual void addBinding(const QXmlName nb);
virtual QXmlName::NamespaceCode lookupNamespaceURI(const QXmlName::PrefixCode prefix) const;
virtual Bindings bindings() const;
private:
const NamespaceResolver::Ptr m_nsResolver;
Bindings m_bindings;
};
}
QT_END_NAMESPACE
QT_END_HEADER
#endif
|
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture, development version *
* (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH *
* *
* 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/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef SOFA_GUI_QT_QSOFARECORDER_H
#define SOFA_GUI_QT_QSOFARECORDER_H
#include "SofaGUIQt.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <QWidget>
#include <QPushButton>
#include <QSlider>
#include <QLineEdit>
#include <QLabel>
#include <QTimer>
namespace sofa
{
namespace simulation
{
class Node;
}
namespace gui
{
namespace qt
{
class QSofaRecorder : public QWidget
{
Q_OBJECT
public:
QSofaRecorder(QWidget* parent);
void Clear(simulation::Node* root);
void SetRecordDirectory(const std::string&);
void SetSimulation(simulation::Node* root, const std::string& initT,
const std::string& endT, const std::string& writeName);
void setInitialTime(double);
void setFinalTime(double);
void setCurrentTime(double);
void setTimeSimulation(double);
void setFPS(double);
void Start();
static void sleep(float seconds, float init_time);
inline double getInitialTime() const
{
std::string init_time = initialTime->text().toStdString();
init_time.resize(init_time.size()-2);
return fabs(atof((init_time.substr(6)).c_str()));
}
inline double getFinalTime() const
{
std::string final_time = finalTime->text().toStdString();
final_time.resize(final_time.size()-2);
return fabs(atof((final_time.substr(5)).c_str()));
}
inline double getCurrentTime() const
{
return fabs(loadRecordTime->text().toDouble());
}
QLabel *getTimeLabel() {return timeLabel;};
QLabel *getFPSLabel() {return fpsLabel;};
void UpdateTime(simulation::Node* root);
public slots:
void TimerStart(bool);
signals:
void RecordSimulation(bool);
void NewTime();
protected:
bool querySimulationName();
void addWriteState(const std::string& writeSceneName);
void addReadState(const std::string& writeSceneName,bool init);
QPushButton* record;
QPushButton* stepbackward;
QPushButton* playforward;
QPushButton* stepforward;
QPushButton* forward;
QPushButton* backward;
QSlider* timeSlider;
QLabel* timeRecord ;
QLineEdit* loadRecordTime;
QLabel* initialTime;
QLabel* finalTime;
QLabel* fpsLabel;
QLabel* timeLabel;
QTimer* timerStep;
std::string simulationBaseName_;
std::string writeSceneName_;
std::string record_directory;
simulation::Node* root;
protected slots:
void slot_recordSimulation( bool);
void slot_backward( );
void slot_stepbackward( );
void slot_playforward( );
void slot_stepforward( );
void slot_forward( );
void slot_loadrecord_timevalue(bool updateTime = true);
void slot_sliderValue(int value, bool updateTime = true);
void loadSimulation(bool one_step = false);
};
}
}
}
#endif //SOFA_GUI_QT_QSOFARECORDER_H
|
//
// HTTPRequestHandlerFactory.h
//
// $Id: //poco/1.4/Net/include/Poco/Net/HTTPRequestHandlerFactory.h#2 $
//
// Library: Net
// Package: HTTPServer
// Module: HTTPRequestHandlerFactory
//
// Definition of the HTTPRequestHandlerFactory class.
//
// Copyright (c) 2005-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 Net_HTTPRequestHandlerFactory_INCLUDED
#define Net_HTTPRequestHandlerFactory_INCLUDED
#include "Poco/Net/Net.h"
#include "Poco/SharedPtr.h"
#include "Poco/BasicEvent.h"
namespace Poco {
namespace Net {
class HTTPServerRequest;
class HTTPServerResponse;
class HTTPRequestHandler;
class Net_API HTTPRequestHandlerFactory
/// A factory for HTTPRequestHandler objects.
/// Subclasses must override the createRequestHandler()
/// method.
{
public:
typedef Poco::SharedPtr<HTTPRequestHandlerFactory> Ptr;
HTTPRequestHandlerFactory();
/// Creates the HTTPRequestHandlerFactory.
virtual ~HTTPRequestHandlerFactory();
/// Destroys the HTTPRequestHandlerFactory.
virtual HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request) = 0;
/// Must be overridden by sublasses.
///
/// Creates a new request handler for the given HTTP request.
protected:
Poco::BasicEvent<const bool> serverStopped;
private:
HTTPRequestHandlerFactory(const HTTPRequestHandlerFactory&);
HTTPRequestHandlerFactory& operator = (const HTTPRequestHandlerFactory&);
friend class HTTPServer;
friend class HTTPServerConnection;
};
} } // namespace Poco::Net
#endif // Net_HTTPRequestHandlerFactory_INCLUDED
|
/*
* Motif
*
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* HISTORY
*/
/* $XConsortium: ArrowBGP.h /main/13 1995/07/14 10:09:51 drk $ */
/*
* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
#ifndef _XmArrowGadgetP_h
#define _XmArrowGadgetP_h
#include <Xm/ArrowBG.h>
#include <Xm/GadgetP.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Arrow class structure */
typedef struct _XmArrowButtonGadgetClassPart
{
XtPointer extension;
} XmArrowButtonGadgetClassPart;
/* Full class record declaration for Arrow class */
typedef struct _XmArrowButtonGadgetClassRec
{
RectObjClassPart rect_class;
XmGadgetClassPart gadget_class;
XmArrowButtonGadgetClassPart arrow_button_class;
} XmArrowButtonGadgetClassRec;
externalref XmArrowButtonGadgetClassRec xmArrowButtonGadgetClassRec;
/* The Arrow instance record */
typedef struct _XmArrowButtonGadgetPart
{
XtCallbackList activate_callback;
XtCallbackList arm_callback;
XtCallbackList disarm_callback;
unsigned char direction; /* The direction the arrow is pointing. */
Boolean selected;
short top_count;
short cent_count;
short bot_count;
XRectangle *top;
XRectangle *cent;
XRectangle *bot;
Position old_x;
Position old_y;
GC arrow_GC;
XtIntervalId timer;
unsigned char multiClick; /* KEEP/DISCARD resource */
int click_count;
GC insensitive_GC;
GC background_GC;
GC top_shadow_GC;
GC bottom_shadow_GC;
GC highlight_GC;
Pixel foreground;
Pixel background;
Pixel top_shadow_color;
Pixmap top_shadow_pixmap;
Pixel bottom_shadow_color;
Pixmap bottom_shadow_pixmap;
Pixel highlight_color;
Pixmap highlight_pixmap;
Boolean fill_bg_box;
Dimension detail_shadow_thickness ;
} XmArrowButtonGadgetPart;
/* Full instance record declaration */
typedef struct _XmArrowButtonGadgetRec
{
ObjectPart object;
RectObjPart rectangle;
XmGadgetPart gadget;
XmArrowButtonGadgetPart arrowbutton;
} XmArrowButtonGadgetRec;
#define ArrowBG_BackgroundGC(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. background_GC)
#define ArrowBG_TopShadowGC(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. top_shadow_GC)
#define ArrowBG_BottomShadowGC(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. bottom_shadow_GC)
#define ArrowBG_HighlightGC(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. highlight_GC)
#define ArrowBG_Foreground(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. foreground)
#define ArrowBG_Background(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. background)
#define ArrowBG_TopShadowColor(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. top_shadow_color)
#define ArrowBG_TopShadowPixmap(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. top_shadow_pixmap)
#define ArrowBG_BottomShadowColor(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. bottom_shadow_color)
#define ArrowBG_BottomShadowPixmap(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. bottom_shadow_pixmap)
#define ArrowBG_HighlightColor(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. highlight_color)
#define ArrowBG_HighlightPixmap(w) (((XmArrowButtonGadget)(w)) -> \
arrowbutton. highlight_pixmap)
/******** Private Function Declarations ********/
/******** End Private Function Declarations ********/
#ifdef __cplusplus
} /* Close scope of 'extern "C"' declaration which encloses file. */
#endif
#endif /* _XmArrowGadgetP_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
#import <UIKit/UIKit.h>
@class MITDiningMeal, MITDiningAggregatedMeal, MITDiningComparisonDataManager, MITDiningHouseDay;
@interface MITDiningMenuComparisonViewController : UIViewController
@property (nonatomic, strong) NSSet * filtersApplied;
@property (nonatomic, strong) MITDiningMeal *visibleMeal;
@property (nonatomic, strong) MITDiningAggregatedMeal *visibleAggregatedMeal;
@property (nonatomic, strong) MITDiningHouseDay *visibleDay;
@property (nonatomic, strong) NSArray *houseVenues;
@property (nonatomic, strong) MITDiningComparisonDataManager *dataManager;
@end
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef SLEPCSUPPORT_H
#define SLEPCSUPPORT_H
#include "libmesh/libmesh_config.h"
#ifdef LIBMESH_HAVE_SLEPC
#include "Moose.h"
class EigenProblem;
class InputParameters;
namespace Moose
{
namespace SlepcSupport
{
/**
* @return InputParameters object containing the SLEPC related parameters
*
* The output of this function should be added to the the parameters object of the overarching class
* @see EigenProblem
*/
InputParameters getSlepcValidParams(InputParameters & params);
InputParameters getSlepcEigenProblemValidParams();
void storeSlepcOptions(FEProblemBase & fe_problem, const InputParameters & params);
void storeSlepcEigenProblemOptions(EigenProblem & eigen_problem, const InputParameters & params);
void slepcSetOptions(EigenProblem & eigen_problem, const InputParameters & params);
void setSlepcEigenSolverTolerances(EigenProblem & eigen_problem, const InputParameters & params);
void setSlepcOutputOptions(EigenProblem & eigen_problem);
PetscErrorCode mooseSlepcEigenFormJacobianA(SNES snes, Vec x, Mat jac, Mat pc, void * ctx);
PetscErrorCode mooseSlepcEigenFormJacobianB(SNES snes, Vec x, Mat jac, Mat pc, void * ctx);
PetscErrorCode mooseSlepcEigenFormFunctionA(SNES snes, Vec x, Vec r, void * ctx);
PetscErrorCode mooseSlepcEigenFormFunctionB(SNES snes, Vec x, Vec r, void * ctx);
} // namespace SlepcSupport
} // namespace moose
#endif // LIBMESH_HAVE_SLEPC
#endif // SLEPCSUPPORT_H
|
/*-
* pylibssh2 - python bindings for libssh2 library
*
* Copyright (C) 2005 Keyphrene.com.
* Copyright (C) 2010 Wallix Inc.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <Python.h>
#define PYLIBSSH2_MODULE
#include "pylibssh2.h"
/* {{{ PYLIBSSH2_Listener_accept
*/
static char PYLIBSSH2_Listener_accept_doc[] = "\n\
\n\
Arguments:\n\
\n\
Returns:\n\
";
static PyObject *
PYLIBSSH2_Listener_accept(PYLIBSSH2_LISTENER *self, PyObject *args)
{
LIBSSH2_CHANNEL *channel;
Py_BEGIN_ALLOW_THREADS
channel = libssh2_channel_forward_accept(self->listener);
Py_END_ALLOW_THREADS
if (channel == NULL) {
PyErr_SetString(PYLIBSSH2_Error, "Unable to accept listener on channel.");
Py_INCREF(Py_None);
return Py_None;
}
return (PyObject *)PYLIBSSH2_Channel_New(channel, 1);
}
/* }}} */
/* {{{ PYLIBSSH2_Listener_cancel
*/
static char PYLIBSSH2_Listener_cancel_doc[] = "\n\
\n\
Arguments:\n\
\n\
Returns:\n\
";
static PyObject *
PYLIBSSH2_Listener_cancel(PYLIBSSH2_LISTENER *self, PyObject *args)
{
int rc;
Py_BEGIN_ALLOW_THREADS
rc = libssh2_channel_forward_cancel(self->listener);
Py_END_ALLOW_THREADS
return Py_BuildValue("i", rc);
}
/* }}} */
/* {{{ PYLIBSSH2_Listener_methods[]
*
* ADD_METHOD(name) expands to a correct PyMethodDef declaration
* { 'name', (PyCFunction)PYLIBSSH2_Listener_name, METHOD_VARARGS }
* for convenience
*/
#define ADD_METHOD(name) \
{ #name, (PyCFunction)PYLIBSSH2_Listener_##name, METH_VARARGS, PYLIBSSH2_Listener_##name##_doc }
struct PyMethodDef PYLIBSSH2_Listener_methods[] = {
ADD_METHOD(accept),
ADD_METHOD(cancel),
{ NULL, NULL }
};
#undef ADD_METHOD
/* }}} */
/* {{{ PYLIBSSH2_Listener_New
*/
PYLIBSSH2_LISTENER *
PYLIBSSH2_Listener_New(LIBSSH2_LISTENER *listener, int dealloc)
{
PYLIBSSH2_LISTENER *self;
self = PyObject_New(PYLIBSSH2_LISTENER, &PYLIBSSH2_Listener_Type);
if (self == NULL) {
return NULL;
}
self->listener = listener;
self->dealloc = dealloc;
return self;
}
/* }}} */
/* {{{ PYLIBSSH2_Listener_dealloc
*/
static void
PYLIBSSH2_Listener_dealloc(PYLIBSSH2_LISTENER *self)
{
if (self) {
PyObject_Del(self);
}
}
/* }}} */
/* {{{ PYLIBSSH2_Listener_getattr
*/
static PyObject *
PYLIBSSH2_Listener_getattr(PYLIBSSH2_LISTENER *self, char *name)
{
return Py_FindMethod(PYLIBSSH2_Listener_methods, (PyObject *) self, name);
}
/* }}} */
/* {{{ PYLIBSSH2_Listener_Type
*
* see /usr/include/python2.5/object.h line 261
*/
PyTypeObject PYLIBSSH2_Listener_Type = {
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
"Listener", /* tp_name */
sizeof(PYLIBSSH2_LISTENER), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)PYLIBSSH2_Listener_dealloc, /* tp_dealloc */
0, /* tp_print */
(getattrfunc)PYLIBSSH2_Listener_getattr, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
"Listener objects", /* tp_doc */
};
/* }}} */
/* {{{ init_libssh2_Listener
*/
int
init_libssh2_Listener(PyObject *dict)
{
PYLIBSSH2_Listener_Type.ob_type = &PyType_Type;
Py_XINCREF(&PYLIBSSH2_Listener_Type);
PyDict_SetItemString(dict, "ListenerType", (PyObject *)&PYLIBSSH2_Listener_Type);
return 1;
}
/* }}} */
|
/* XMMS2 - X Music Multiplexer System
* Copyright (C) 2003-2012 XMMS2 Team
*
* PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef __IPC_CALL_H__
#define __IPC_CALL_H__
#include <stdarg.h>
#include <glib.h>
#include "xmms/xmms_object.h"
#include "xmmsc/xmmsc_compiler.h"
xmmsv_t *__xmms_ipc_call (xmms_object_t *object, gint cmd, ...) XMMS_SENTINEL(0);
#define XMMS_IPC_CALL(obj, cmd, ...) __xmms_ipc_call (XMMS_OBJECT (obj), cmd, __VA_ARGS__, NULL);
typedef struct xmms_future_St xmms_future_t;
xmms_future_t *__xmms_ipc_check_signal (xmms_object_t *object, gint message, glong delay, glong timeout);
#define XMMS_FUTURE_USEC_DELAY_DEFAULT 75000L
#define XMMS_FUTURE_USEC_TIMEOUT_DEFAULT 2500000L
#define XMMS_IPC_CHECK_SIGNAL(obj, cmd) __xmms_ipc_check_signal (XMMS_OBJECT (obj), cmd, XMMS_FUTURE_USEC_DELAY_DEFAULT, XMMS_FUTURE_USEC_TIMEOUT_DEFAULT);
void xmms_future_free (xmms_future_t *future);
xmmsv_t *xmms_future_await (xmms_future_t *future, gint count);
#endif
|
/*
* This file is part of Cockpit.
*
* Copyright (C) 2017 Red Hat, Inc.
*
* Cockpit 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.
*
* Cockpit 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 Cockpit; If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __COCKPIT_SSH_RELAY_H__
#define __COCKPIT_SSH_RELAY_H__
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
/* EXIT CODE CONSTANTS */
#define INTERNAL_ERROR 1
#define AUTHENTICATION_FAILED 2
#define DISCONNECTED 254
#define TERMINATED 255
#define NO_COCKPIT 127
#define COCKPIT_TYPE_SSH_RELAY (cockpit_ssh_relay_get_type ())
typedef struct _CockpitSshRelay CockpitSshRelay;
typedef struct _CockpitSshRelay CockpitSshRelayClass;
GType cockpit_ssh_relay_get_type (void) G_GNUC_CONST;
CockpitSshRelay * cockpit_ssh_relay_new (const gchar *connection_string);
gint cockpit_ssh_relay_result (CockpitSshRelay* self);
G_END_DECLS
#endif
|
/*
* genetik - Genetic Kernel Library
*
* Copyright (C) 2006 Alessandro Bahgat Shehata, Daniele Castagna
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Alessandro Bahgat Shehata - ale (DOT) bahgat (AT) gmail (DOT) com
* Daniele Castagna - daniele (DOT) castagna (AT) gmail (DOT) com
*
*/
/*! @defgroup genetiK Common GenetiK framework
@brief Main framework
This is the base module of GenetiK framework
*/
/*!
@file src/genetik.h
@ingroup genetiK
@brief Main include file for genetiK namespace
This file groups all header files of elements of genetiK
*/
#ifndef GENETIK_H
#define GENETIK_H
#include "EvolutionaryAlgorithm.h"
#include "RouletteWheel.h"
#include "SelectionMethod.h"
#include "IndividualFactory.h"
#include "StopCriterion.h"
#include "Individual.h"
#include "StopCriterionMaxIteration.h"
#include "Population.h"
#include "TournamentSelection.h"
#include "RankingSelection.h"
#endif
|
#include "pthread_impl.h"
int pthread_mutexattr_settype(pthread_mutexattr_t *a, int type)
{
if ((unsigned)type > 2) return EINVAL;
*a = (*a & ~3) | type;
return 0;
}
|
/*************************************************************************\
* Copyright (C) Michael Kerrisk, 2015. *
* *
* This program is free software. You may use, modify, and redistribute it *
* under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 or (at your option) *
* any later version. This program is distributed without any warranty. *
* See the files COPYING.lgpl-v3 and COPYING.gpl-v3 for details. *
\*************************************************************************/
/* Header file for Listing 8-1 */
#ifndef UGID_FUNCTIONS_H
#define UGID_FUNCTIONS_H
#include "tlpi_hdr.h"
char *userNameFromId(uid_t uid);
uid_t userIdFromName(const char *name);
char *groupNameFromId(gid_t gid);
gid_t groupIdFromName(const char *name);
#endif
|
#ifndef __domGles_texcombiner_command_h__
#define __domGles_texcombiner_command_h__
#include <dae/daeDocument.h>
#include <dom/domTypes.h>
#include <dom/domElements.h>
#include <dom/domGles_texture_constant.h>
#include <dom/domGles_texcombiner_command_rgb.h>
#include <dom/domGles_texcombiner_command_alpha.h>
class DAE;
class domGles_texcombiner_command : public daeElement
{
public:
virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::GLES_TEXCOMBINER_COMMAND; }
static daeInt ID() { return 266; }
virtual daeInt typeID() const { return ID(); }
protected: // Elements
domGles_texture_constantRef elemConstant;
domGles_texcombiner_command_rgbRef elemRGB;
domGles_texcombiner_command_alphaRef elemAlpha;
public: //Accessors and Mutators
/**
* Gets the constant element.
* @return a daeSmartRef to the constant element.
*/
const domGles_texture_constantRef getConstant() const { return elemConstant; }
/**
* Gets the RGB element.
* @return a daeSmartRef to the RGB element.
*/
const domGles_texcombiner_command_rgbRef getRGB() const { return elemRGB; }
/**
* Gets the alpha element.
* @return a daeSmartRef to the alpha element.
*/
const domGles_texcombiner_command_alphaRef getAlpha() const { return elemAlpha; }
protected:
/**
* Constructor
*/
domGles_texcombiner_command(DAE& dae) : daeElement(dae), elemConstant(), elemRGB(), elemAlpha() {}
/**
* Destructor
*/
virtual ~domGles_texcombiner_command() {}
/**
* Overloaded assignment operator
*/
virtual domGles_texcombiner_command &operator=( const domGles_texcombiner_command &cpy ) { (void)cpy; return *this; }
public: // STATIC METHODS
/**
* Creates an instance of this class and returns a daeElementRef referencing it.
* @return a daeElementRef referencing an instance of this object.
*/
static DLLSPEC daeElementRef create(DAE& dae);
/**
* Creates a daeMetaElement object that describes this element in the meta object reflection framework.
* If a daeMetaElement already exists it will return that instead of creating a new one.
* @return A daeMetaElement describing this COLLADA element.
*/
static DLLSPEC daeMetaElement* registerElement(DAE& dae);
};
#endif
|
/*
Copyright (C) 2000-2012 Novell, Inc
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) version 3.0 of the License. This library
is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details. You should have received a copy of the GNU
Lesser General Public License along with this library; if not, write
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor, Boston, MA 02110-1301 USA
*/
/*-/
File: YCheckBoxFrame.h
Author: Stefan Hundhammer <shundhammer@suse.de>
/-*/
#ifndef YCheckBoxFrame_h
#define YCheckBoxFrame_h
#include <string>
#include "YSingleChildContainerWidget.h"
#include "ImplPtr.h"
class YCheckBoxFramePrivate;
/**
* A frame with a check-box, may auto-disable frame contents based on the check.
* See #setAutoEnable, #invertAutoEnable.
**/
class YCheckBoxFrame : public YSingleChildContainerWidget
{
public:
/**
* Constructor.
**/
YCheckBoxFrame( YWidget * parent,
const std::string & label,
bool checked );
/**
* Destructor.
**/
virtual ~YCheckBoxFrame();
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
**/
virtual const char * widgetClass() const { return "YCheckBoxFrame"; }
/**
* Return the label text on the CheckBoxFrame.
**/
std::string label() const;
/**
* Change the label text on the CheckBoxFrame.
*
* Derived classes should overload this, but call this base class function
* in the overloaded function.
**/
virtual void setLabel( const std::string & label );
/**
* Check or uncheck the CheckBoxFrame's check box.
*
* Derived classes are required to implement this.
**/
virtual void setValue( bool isChecked ) = 0;
/**
* Get the status of the CheckBoxFrame's check box.
*
* Derived classes are required to implement this.
**/
virtual bool value() = 0;
/**
* Handle children enabling/disabling automatically based on the
* CheckBoxFrame's check box?
**/
bool autoEnable() const;
/**
* Change autoEnabled flag.
*
* Derived classes are free to overload this, but they should call this
* base class function in the overloaded function.
**/
virtual void setAutoEnable( bool autoEnable );
/**
* Invert the meaning of the CheckBoxFrame's check box, i.e., disable child
* widgets when checked?
**/
bool invertAutoEnable() const;
/**
* Change invertAutonEnable flag.
*
* Derived classes are free to overload this, but they should call this
* base class function in the overloaded function.
**/
virtual void setInvertAutoEnable( bool invertAutoEnable );
/**
* Handle enabling/disabling of child widgets based on 'isChecked' (the
* current status of the check box) and autoEnable() and
* invertAutoEnable().
*
* Derived classes should call this when the check box status changes
* rather than try to handle it on their level.
*
* This method also needs to be called after new child widgets are added to
* establish the initial enabled or disabled state of the child widgets.
**/
void handleChildrenEnablement( bool isChecked );
/**
* Get the string of this widget that holds the keyboard shortcut.
*
* Reimplemented from YWidget.
**/
virtual std::string shortcutString() const { return label(); }
/**
* Set the string of this widget that holds the keyboard shortcut.
*
* Reimplemented from YWidget.
**/
virtual void setShortcutString( const std::string & str )
{ setLabel( str ); }
/**
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
const char * userInputProperty() { return YUIProperty_Value; }
/**
* Set a property.
* Reimplemented from YWidget.
*
* This method may throw exceptions, for example
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
*
* This function returns 'true' if the value was successfully set and
* 'false' if that value requires special handling (not in error cases:
* those are covered by exceptions).
**/
virtual bool setProperty( const std::string & propertyName,
const YPropertyValue & val );
/**
* Get a property.
* Reimplemented from YWidget.
*
* This method may throw exceptions, for example
* - if there is no property with that name
**/
virtual YPropertyValue getProperty( const std::string & propertyName );
/**
* Return this class's property set.
* This also initializes the property set upon the first call.
*
* Reimplemented from YWidget.
**/
virtual const YPropertySet & propertySet();
private:
ImplPtr<YCheckBoxFramePrivate> priv;
};
#endif // YCheckBoxFrame_h
|
//============================================================================
// I B E X
// File : ibex_UnconstrainedLocalSearch.h
// Author : Jordan Ninin, Gilles Chabert
// Copyright : Ecole des Mines de Nantes (France)
// License : See the LICENSE file
// Created : Mar 19, 2014
// Last Update : Mar 19, 2014
//============================================================================
#ifndef __IBEX_UNCONSTRAINED_LOCAL_SEARCH_H__
#define __IBEX_UNCONSTRAINED_LOCAL_SEARCH_H__
#include "ibex_IntervalVector.h"
#include "ibex_Function.h"
#include "ibex_BitSet.h"
#include "ibex_LineSearch.h"
namespace ibex {
/**
* \ingroup strategy
*
* \brief Local optimizer based on trust region
*
* This is an implementation of the algorithm given in
* "Testing a Class of Methods for Solving Minimization
* Problems with Simple Bounds on the Variables" by Andrew R. Conn,
* Nicholas I.M. Gould and Philippe L. Toint, Mathematics of Computation
* vol 50, p 399-430, 1988.
*/
class UnconstrainedLocalSearch {
public:
/**
* \brief Return codes of minimize
*
* <ul>
* <li> SUCCESS - convergence achieved with eps criterion
* <li> TOO_MANY_ITER - the number of iterations has exceeded max_iter
* <li> INVALID_POINT - the iteration has given a point outside of the
* definition domain of f (or its gradient)
* </ul>
*
*
*/
typedef enum { SUCCESS, TOO_MANY_ITER, INVALID_POINT } ReturnCode;
/**
* \brief Build the local optimizer.
*
* \param f - the function to minimize
* \param box - the bounding box (boundary constraints)
*/
UnconstrainedLocalSearch(const Function& f, const IntervalVector& box);
/**
* \brief Run the optimization.
*
* \return - x_min contains the final point. In the case the iteration is *
* interrupted prematurely (return code different from SUCCESS),
* x_min contains the last valid point found. However, note that
* if the initial point x_0 is invalid, x_min is x_0 anyway.
*
* \param x0 - initial point
* \param x_min - final point
* \param eps - precision (on projected gradient onto the box).
* The procedure stops when the norm of the projection of the gradient onto the
* bounding box is less than eps.
*/
ReturnCode minimize( const Vector& x0, Vector& x_min, double eps=1.e-8, int max_iter=100);
/**
* \brief get the number of iteration of the last minimization
*/
int nb_iter() const;
/**
* \brief Set the bounding box which the minize is perform on.
*/
void set_box( const IntervalVector& box );
virtual ~UnconstrainedLocalSearch();
private:
/**
* \brief Invalid point.
*
* Thrown when the iteration has given a point outside of the
* definition domain of f (or its gradient)
*/
class InvalidPointException { };
const Function f; // function
IntervalVector box; // bounding box;
int n; // number of variables
// see constructor
double eps;
// sigma is set to (eps/sqrt(n+1)) to be compatible with
// the convergence criterion (see stop function)
double sigma;
// number of iteration
int niter ;
LineSearchData data; // for internal usage of LineSearch
/**
* \brief Return true when ||P[x-g]-x||<eps.
*/
bool stop(const Vector& z, const Vector& g);
/**
* \brief Compute the GCP (Generalized Cauchy point).
*
* Step 2 in the paper.
*/
Vector find_gcp(const Vector& gk, const Matrix& Bk, const Vector& zk, const IntervalVector& region);
/**
* \brief Apply conjugate gradients (on a face)
*
* \param z_gcp -
* \param I - defines the face (I[i]<=>the ith constraint is activated)
*
* Step 3 in the paper.
*/
Vector conj_grad(const Vector& gk, const Matrix& Bk, const Vector& zk, const Vector& z_gcp, const IntervalVector& region, const BitSet& I);
/**
* \brief Compute eta = min(0.1,sqrt(||gk||))*||gk||:
*/
double get_eta(const Vector& gk, const Vector& zk, const IntervalVector& region, const BitSet& I);
/**
* \brief Update the approximation Bk of the Hessian
*
* Update after an iteration, using rank 1 correction formula
*
* \param sk - x_{k+1}-x_k
* \param gk - g(x_k)
* \param gk1 - g(x_{k+1})
*/
void update_B_SR1(Matrix& Bk, const Vector& sk, const Vector& gk, const Vector& gk1);
/*
* \brief Return the midpoint if the interval is not empty,
* throw a InvalidPointException otherwise.
*/
double _mid(const Interval& x);
/**
* \see #_mid(const Interval&).
*/
Vector _mid(const IntervalVector& x);
};
/** Streams out this expression. */
std::ostream& operator<<(std::ostream& cc, const UnconstrainedLocalSearch::ReturnCode& res);
/*============================================ inline implementation ============================================ */
inline int UnconstrainedLocalSearch::nb_iter() const {
return this->niter;
}
inline double UnconstrainedLocalSearch::_mid(const Interval& x) {
if (x.is_empty() || x.is_unbounded()) throw InvalidPointException();
else return x.mid();
}
inline Vector UnconstrainedLocalSearch::_mid(const IntervalVector& x) {
if (x.is_empty() || x.is_unbounded()) throw InvalidPointException();
else return x.mid();
}
} // end namespace
#endif /* __IBEX_UNCONSTRAINED_LOCAL_SEARCH_H__ */
|
/*
FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS 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 MODIFIED BY!<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS 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. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FLASH_LED_H
#define FLASH_LED_H
void vStartLEDFlashTasks( UBaseType_t uxPriority );
#endif
|
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef __REDIS_CONNECTION__H__
#define __REDIS_CONNECTION__H__
#include <string>
#include <boost/asio.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <tbb/mutex.h>
#include "hiredis/hiredis.h"
#include "hiredis/async.h"
#include "hiredis/boostasio.hpp"
#include "io/event_manager.h"
/*
* Class for maintaining an async connection to Redis, aka RAC - redis async connection
*/
class RedisAsyncConnection {
public:
static const int RedisReconnectTime = 5;
typedef boost::function<void (void)> ClientConnectCbFn;
typedef boost::function<void (void)> ClientDisconnectCbFn;
typedef boost::function<void (const redisAsyncContext *c, void *r, void *privdata)> ClientAsyncCmdCbFn;
typedef boost::function<void (const redisReply *reply)> RAC_StatCbFn;
typedef boost::function<void (const struct redisAsyncContext*, int)> RAC_ConnectCbFn;
typedef boost::function<void (const struct redisAsyncContext*, int)> RAC_DisconnectCbFn;
struct RAC_CbFns {
RAC_CbFns() :
stat_cbfn_(NULL),
connect_cbfn_(NULL),
disconnect_cbfn_(NULL),
client_async_cmd_cbfn_(NULL) { }
RAC_StatCbFn stat_cbfn_;
RAC_ConnectCbFn connect_cbfn_;
RAC_DisconnectCbFn disconnect_cbfn_;
ClientAsyncCmdCbFn client_async_cmd_cbfn_;
};
typedef boost::ptr_map<const redisAsyncContext *, RAC_CbFns> RAC_CbFnsMap;
RedisAsyncConnection(EventManager *evm, const std::string & redis_ip,
unsigned short redis_port, ClientConnectCbFn client_connect_cb = NULL,
ClientDisconnectCbFn client_disconnect_cb = NULL);
virtual ~RedisAsyncConnection();
bool RAC_Connect(void);
bool IsConnUp() {
return (state_ == REDIS_ASYNC_CONNECTION_CONNECTED);
}
bool SetClientAsyncCmdCb(ClientAsyncCmdCbFn cb_fn);
bool RedisAsyncCommand(void *rpi, const char *format, ...);
bool RedisAsyncArgCmd(void *rpi, const std::vector<std::string> &args);
void RAC_StatUpdate(const redisReply *reply);
static RAC_CbFnsMap& rac_cb_fns_map() {
return rac_cb_fns_map_;
}
EventManager * GetEVM() { return evm_; }
uint64_t CallDisconnected() { return callDisconnected_; }
uint64_t CallFailed() { return callFailed_; }
uint64_t CallSucceeded() { return callSucceeded_; }
uint64_t CallbackNull() { return callbackNull_; }
uint64_t CallbackFailed() { return callbackFailed_; }
uint64_t CallbackSucceeded() { return callbackSucceeded_; }
private:
enum RedisState {
REDIS_ASYNC_CONNECTION_INIT = 0,
REDIS_ASYNC_CONNECTION_PENDING = 1,
REDIS_ASYNC_CONNECTION_CONNECTED = 2,
REDIS_ASYNC_CONNECTION_DISCONNECTED = 3,
};
EventManager *evm_;
const std::string hostname_;
const unsigned short port_;
uint64_t callDisconnected_;
uint64_t callFailed_;
uint64_t callSucceeded_;
uint64_t callbackNull_;
uint64_t callbackFailed_;
uint64_t callbackSucceeded_;
redisAsyncContext *context_;
//boost::scoped_ptr<redisBoostClient> client_;
boost::shared_ptr<redisBoostClient> client_;
tbb::mutex mutex_;
RedisState state_;
boost::asio::deadline_timer reconnect_timer_;
void RAC_Reconnect(const boost::system::error_code &error);
/* the flow for connect callback is
* 1. RAC_ConnectCallback gets called from hiredis lib
* 2. A lookup against redisAsyncContext in rac_cb_fns_map_ yields
* RAC_ConnectCallbackProcess_ptr, which is same as
* RAC_ConnectCallbackProcess
* 3. From RAC_ConnectCallbackProcess client's client_connect_cb_ gets called
*
* Flow for other callbacks is similar...
*/
/* connect callback related fields */
void RAC_ConnectCallbackProcess(const struct redisAsyncContext *c, int status);
static void RAC_ConnectCallback(const struct redisAsyncContext *c, int status);
//RAC_ConnectCbFn RAC_ConnectCallbackProcess_ptr;
ClientConnectCbFn client_connect_cb_;
/* disconnect callback related fields */
void RAC_DisconnectCallbackProcess(const struct redisAsyncContext *c, int status);
static void RAC_DisconnectCallback(const struct redisAsyncContext *c, int status);
//RAC_DisconnectCbFn RAC_DisconnectCallbackProcess_ptr;
ClientDisconnectCbFn client_disconnect_cb_;
/* async command callback related fields */
static void RAC_AsyncCmdCallback(redisAsyncContext *c, void *r, void *privdata);
static RAC_CbFnsMap rac_cb_fns_map_;
static tbb::mutex rac_cb_fns_map_mutex_;
};
#endif
|
/**************************************************************************//**
* @file efm32hg_prs_signals.h
* @brief EFM32HG_PRS_SIGNALS register and bit field definitions
* @version 5.6.0
******************************************************************************
* # License
* <b>Copyright 2018 Silicon Laboratories, Inc. www.silabs.com</b>
******************************************************************************
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software.@n
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.@n
* 3. This notice may not be removed or altered from any source distribution.
*
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc.
* has no obligation to support this Software. Silicon Laboratories, Inc. is
* providing the Software "AS IS", with no express or implied warranties of any
* kind, including, but not limited to, any implied warranties of
* merchantability or fitness for any particular purpose or warranties against
* infringement of any proprietary rights of a third party.
*
* Silicon Laboratories, Inc. will not be liable for any consequential,
* incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software.
*
*****************************************************************************/
#if defined(__ICCARM__)
#pragma system_include /* Treat file as system include file. */
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#pragma clang system_header /* Treat file as system include file. */
#endif
/**************************************************************************//**
* @addtogroup Parts
* @{
******************************************************************************/
/**************************************************************************//**
* @addtogroup EFM32HG_PRS_Signals
* @{
* @brief PRS Signal names
*****************************************************************************/
#define PRS_VCMP_OUT ((1 << 16) + 0) /**< PRS Voltage comparator output */
#define PRS_ACMP0_OUT ((2 << 16) + 0) /**< PRS Analog comparator output */
#define PRS_ADC0_SINGLE ((8 << 16) + 0) /**< PRS ADC single conversion done */
#define PRS_ADC0_SCAN ((8 << 16) + 1) /**< PRS ADC scan conversion done */
#define PRS_USART0_IRTX ((16 << 16) + 0) /**< PRS USART 0 IRDA out */
#define PRS_USART0_TXC ((16 << 16) + 1) /**< PRS USART 0 TX complete */
#define PRS_USART0_RXDATAV ((16 << 16) + 2) /**< PRS USART 0 RX Data Valid */
#define PRS_USART1_IRTX ((17 << 16) + 0) /**< PRS USART 1 IRDA out */
#define PRS_USART1_TXC ((17 << 16) + 1) /**< PRS USART 1 TX complete */
#define PRS_USART1_RXDATAV ((17 << 16) + 2) /**< PRS USART 1 RX Data Valid */
#define PRS_TIMER0_UF ((28 << 16) + 0) /**< PRS Timer 0 Underflow */
#define PRS_TIMER0_OF ((28 << 16) + 1) /**< PRS Timer 0 Overflow */
#define PRS_TIMER0_CC0 ((28 << 16) + 2) /**< PRS Timer 0 Compare/Capture 0 */
#define PRS_TIMER0_CC1 ((28 << 16) + 3) /**< PRS Timer 0 Compare/Capture 1 */
#define PRS_TIMER0_CC2 ((28 << 16) + 4) /**< PRS Timer 0 Compare/Capture 2 */
#define PRS_TIMER1_UF ((29 << 16) + 0) /**< PRS Timer 1 Underflow */
#define PRS_TIMER1_OF ((29 << 16) + 1) /**< PRS Timer 1 Overflow */
#define PRS_TIMER1_CC0 ((29 << 16) + 2) /**< PRS Timer 1 Compare/Capture 0 */
#define PRS_TIMER1_CC1 ((29 << 16) + 3) /**< PRS Timer 1 Compare/Capture 1 */
#define PRS_TIMER1_CC2 ((29 << 16) + 4) /**< PRS Timer 1 Compare/Capture 2 */
#define PRS_TIMER2_UF ((30 << 16) + 0) /**< PRS Timer 2 Underflow */
#define PRS_TIMER2_OF ((30 << 16) + 1) /**< PRS Timer 2 Overflow */
#define PRS_TIMER2_CC0 ((30 << 16) + 2) /**< PRS Timer 2 Compare/Capture 0 */
#define PRS_TIMER2_CC1 ((30 << 16) + 3) /**< PRS Timer 2 Compare/Capture 1 */
#define PRS_TIMER2_CC2 ((30 << 16) + 4) /**< PRS Timer 2 Compare/Capture 2 */
#define PRS_USB_SOF ((36 << 16) + 0) /**< PRS USB Start of Frame */
#define PRS_USB_SOFSR ((36 << 16) + 1) /**< PRS USB Start of Frame Sent/Received */
#define PRS_RTC_OF ((40 << 16) + 0) /**< PRS RTC Overflow */
#define PRS_RTC_COMP0 ((40 << 16) + 1) /**< PRS RTC Compare 0 */
#define PRS_RTC_COMP1 ((40 << 16) + 2) /**< PRS RTC Compare 1 */
#define PRS_GPIO_PIN0 ((48 << 16) + 0) /**< PRS GPIO pin 0 */
#define PRS_GPIO_PIN1 ((48 << 16) + 1) /**< PRS GPIO pin 1 */
#define PRS_GPIO_PIN2 ((48 << 16) + 2) /**< PRS GPIO pin 2 */
#define PRS_GPIO_PIN3 ((48 << 16) + 3) /**< PRS GPIO pin 3 */
#define PRS_GPIO_PIN4 ((48 << 16) + 4) /**< PRS GPIO pin 4 */
#define PRS_GPIO_PIN5 ((48 << 16) + 5) /**< PRS GPIO pin 5 */
#define PRS_GPIO_PIN6 ((48 << 16) + 6) /**< PRS GPIO pin 6 */
#define PRS_GPIO_PIN7 ((48 << 16) + 7) /**< PRS GPIO pin 7 */
#define PRS_GPIO_PIN8 ((49 << 16) + 0) /**< PRS GPIO pin 8 */
#define PRS_GPIO_PIN9 ((49 << 16) + 1) /**< PRS GPIO pin 9 */
#define PRS_GPIO_PIN10 ((49 << 16) + 2) /**< PRS GPIO pin 10 */
#define PRS_GPIO_PIN11 ((49 << 16) + 3) /**< PRS GPIO pin 11 */
#define PRS_GPIO_PIN12 ((49 << 16) + 4) /**< PRS GPIO pin 12 */
#define PRS_GPIO_PIN13 ((49 << 16) + 5) /**< PRS GPIO pin 13 */
#define PRS_GPIO_PIN14 ((49 << 16) + 6) /**< PRS GPIO pin 14 */
#define PRS_GPIO_PIN15 ((49 << 16) + 7) /**< PRS GPIO pin 15 */
#define PRS_PCNT0_TCC ((54 << 16) + 0) /**< PRS Triggered compare match */
/** @} End of group EFM32HG_PRS */
/** @} End of group Parts */
|
/*=========================================================================
*
* 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 __itkComplexToImaginaryImageFilter_h
#define __itkComplexToImaginaryImageFilter_h
#include "itkUnaryFunctorImageFilter.h"
#include "vnl/vnl_math.h"
namespace itk
{
/** \class ComplexToImaginaryImageFilter
* \brief Computes pixel-wise the imaginary part of a complex image.
*
* \ingroup IntensityImageFilters MultiThreaded
* \ingroup ITKImageIntensity
*/
namespace Functor
{
template< class TInput, class TOutput >
class ComplexToImaginary
{
public:
ComplexToImaginary() {}
~ComplexToImaginary() {}
bool operator!=(const ComplexToImaginary &) const
{
return false;
}
bool operator==(const ComplexToImaginary & other) const
{
return !( *this != other );
}
inline TOutput operator()(const TInput & A) const
{
return (TOutput)( A.imag() );
}
};
}
template< class TInputImage, class TOutputImage >
class ITK_EXPORT ComplexToImaginaryImageFilter:
public
UnaryFunctorImageFilter< TInputImage, TOutputImage,
Functor::ComplexToImaginary<
typename TInputImage::PixelType,
typename TOutputImage::PixelType > >
{
public:
/** Standard class typedefs. */
typedef ComplexToImaginaryImageFilter Self;
typedef UnaryFunctorImageFilter<
TInputImage, TOutputImage,
Functor::ComplexToImaginary< typename TInputImage::PixelType,
typename TOutputImage::PixelType > > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Runtime information support. */
itkTypeMacro(ComplexToImaginaryImageFilter,
UnaryFunctorImageFilter);
typedef typename TInputImage::PixelType InputPixelType;
typedef typename TOutputImage::PixelType OutputPixelType;
typedef typename NumericTraits< InputPixelType >::ValueType InputPixelValueType;
#ifdef ITK_USE_CONCEPT_CHECKING
/** Begin concept checking */
itkConceptMacro( InputConvertibleToOutputCheck,
( Concept::Convertible< InputPixelValueType, OutputPixelType > ) );
/** End concept checking */
#endif
protected:
ComplexToImaginaryImageFilter() {}
virtual ~ComplexToImaginaryImageFilter() {}
private:
ComplexToImaginaryImageFilter(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
};
} // end namespace itk
#endif
|
// Copyright 2020 Google LLC
//
// 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
//
// https://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 PLATFORM_PUBLIC_PIPE_H_
#define PLATFORM_PUBLIC_PIPE_H_
#include "internal/platform/base_pipe.h"
namespace location {
namespace nearby {
// See for details:
// http://google3/platform/base/base_pipe.h
class Pipe final : public BasePipe {
public:
Pipe();
~Pipe() override = default;
Pipe(Pipe&&) = delete;
Pipe& operator=(Pipe&&) = delete;
};
} // namespace nearby
} // namespace location
#endif // PLATFORM_PUBLIC_PIPE_H_
|
//
// AppDelegate.h
// DiscoveryExample
//
// Created by Ömer Faruk Gül on 08/02/15.
// Copyright (c) 2015 Ömer Faruk Gül. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/**
* Copyright 2014-2016 CyberVision, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file ext_log_storage.h
* @brief External log storage interface used by Kaa data collection subsystem to temporarily store the logs
* before sending them to Operations server.
* Must be implemented in a concrete application for the data collection feature to function.
*/
#ifndef EXT_LOG_STORAGE_H_
#define EXT_LOG_STORAGE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include "../kaa_error.h"
/**
* Wrapper for a serialized log entry.
*/
typedef struct {
char *data; /**< Serialized data */
size_t size; /**< Size of data */
uint16_t bucket_id; /**< Bucket ID of this record */
} kaa_log_record_t;
/**
* @brief Allocates the data buffer to serialize a log entry into.
*
* Allocates the @c data buffer of @c size bytes in the @c record.
*
* @param[in] context Log storage context.
* @param[in,out] record Log record to allocate buffer to.
*
* @return Error code.
*/
kaa_error_t ext_log_storage_allocate_log_record_buffer(void *context, kaa_log_record_t *record);
/**
* @brief Deallocates the data buffer of a log record.
*
* Deallocates the @c data buffer in the @c record and sets @c size to 0.
*
* @param[in] context Log storage context.
* @param[in,out] record Log record to deallocate buffer of.
*
* @return Error code.
*/
kaa_error_t ext_log_storage_deallocate_log_record_buffer(void *context, kaa_log_record_t *record);
/**
* @brief Adds a log entry to the log storage.
*
* In case of success assumes ownership of the @c record @c data buffer.
* (No need to call @link ext_log_storage_destroy_log_record_buffer @endlink.)
*
* @param[in] context Log storage context.
* @param[in] record Log record to add to log storage.
*
* @return Error code.
*/
kaa_error_t ext_log_storage_add_log_record(void *context, kaa_log_record_t *record);
/**
* @brief Writes the next unmarked log entry into the supplied buffer and marks
* it with @c bucket_id the record size does not exceed the @c buffer_len.
*
* @param[in] context Log storage context.
* @param[in] buffer Buffer to write next unmarked record into.
* @param[in] buffer_len Buffer length in bytes.
* @param[out] bucket_id Optional bucket ID of the next record.
* @param[out] record_len Size of the record data.
*
* @return Error code:\br
* @link KAA_ERR_NONE @endlink when a record of @c record_len was successfully written into the buffer.\br
* @link KAA_ERR_NOT_FOUND @endlink when there were no unmarked records in the storage.
* @c record_len is set to 0 in this case.\br
* @link KAA_ERR_INSUFFICIENT_BUFFER @endlink when the buffer size was not sufficient to fit in the next unmarked entry.
* @c record_len is set to the size of the record that was not written.\br
*/
kaa_error_t ext_log_storage_write_next_record(void *context, char *buffer, size_t buffer_len, uint16_t *bucket_id, size_t *record_len);
/**
* @brief Removes from the storage all records marked with the provided @c bucket_id.
*
* @param[in] context Log storage context.
* @param[in] bucket_id Non-zero bucket ID to search for records to be removed.
*
* @return Error code
*/
kaa_error_t ext_log_storage_remove_by_bucket_id(void *context, uint16_t bucket_id);
/**
* @brief Unmarks all records marked with the provided @c bucket_id.
*
* @param[in] context Log storage context.
* @param[in] bucket_id Non-zero bucket ID to search for records to be unmarked.
*
* @return Error code
*/
kaa_error_t ext_log_storage_unmark_by_bucket_id(void *context, uint16_t bucket_id);
/**
* @brief Returns total size occupied by logs in the log storage.
*
* @param[in] context Log storage context.
*
* @return Total log storage size in bytes, occupied by log records. Zero in case of errors.
*/
size_t ext_log_storage_get_total_size(const void *context);
/**
* @brief Returns total log records count.
*
* @param[in] context Log storage context.
*
* @return Total amount of log records in the storage. Zero in case of errors.
*/
size_t ext_log_storage_get_records_count(const void *context);
/**
* @brief Destroys the log storage (which may decide to self-destroy).
*
* @param[in] context Log storage context.
*
* @return Error code
*/
kaa_error_t ext_log_storage_destroy(void *context);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* EXT_LOG_STORAGE_H_ */
|
//
// TablesObject.h
// EpiInfo
//
// Created by labuser on 7/1/13.
// Copyright (c) 2013 John Copeland. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AnalysisDataObject.h"
#import "SQLiteData.h"
#import "sqlite3.h"
@interface TablesObject : NSObject
{
sqlite3 *analysisDB;
}
@property (nonatomic, strong) NSString *exposureVariable;
@property (nonatomic, strong) NSString *outcomeVariable;
@property (nonatomic, strong) NSArray *exposureValues;
@property (nonatomic, strong) NSArray *outcomeValues;
@property (nonatomic, strong) NSArray *cellCounts;
-(id)initWithAnalysisDataObject:(AnalysisDataObject *)dataSet AndOutcomeVariable:(NSString *)outcomeVariable AndExposureVariable:(NSString *)exposureVariable AndIncludeMissing:(BOOL)includeMissing;
-(id)initWithSQLiteData:(SQLiteData *)dataSet AndWhereClause:(NSString *)whereClause AndOutcomeVariable:(NSString *)outcomeVariable AndExposureVariable:(NSString *)exposureVariable AndIncludeMissing:(BOOL)includeMissing;
@end
|
/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief ARCv2 system fatal error handler
*
* This module provides the _SysFatalErrorHandler() routine for ARCv2 BSPs.
*/
#include <kernel.h>
#include <toolchain.h>
#include <sections.h>
#include <kernel_structs.h>
#include <misc/printk.h>
/**
*
* @brief Fatal error handler
*
* This routine implements the corrective action to be taken when the system
* detects a fatal error.
*
* This sample implementation attempts to abort the current thread and allow
* the system to continue executing, which may permit the system to continue
* functioning with degraded capabilities.
*
* System designers may wish to enhance or substitute this sample
* implementation to take other actions, such as logging error (or debug)
* information to a persistent repository and/or rebooting the system.
*
* @param reason the fatal error reason
* @param pEsf pointer to exception stack frame
*
* @return N/A
*/
FUNC_NORETURN void _SysFatalErrorHandler(unsigned int reason,
const NANO_ESF *pEsf)
{
ARG_UNUSED(pEsf);
#if !defined(CONFIG_SIMPLE_FATAL_ERROR_HANDLER)
if (reason == _NANO_ERR_KERNEL_PANIC) {
goto hang_system;
}
if (k_is_in_isr() || _is_thread_essential()) {
printk("Fatal fault in %s! Spinning...\n",
k_is_in_isr() ? "ISR" : "essential thread");
goto hang_system;
}
printk("Fatal fault in thread %p! Aborting.\n", _current);
k_thread_abort(_current);
hang_system:
#else
ARG_UNUSED(reason);
#endif
for (;;) {
k_cpu_idle();
}
CODE_UNREACHABLE;
}
|
/*
*
* Mathematics Subpackage (VrMath)
*
*
* Author: Samuel R. Buss, sbuss@ucsd.edu.
* Web page: http://math.ucsd.edu/~sbuss/MathCG
*
*
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*
*
*/
#ifndef _CLASS_NODE
#define _CLASS_NODE
#include "LinearR3.h"
enum Purpose {JOINT, EFFECTOR};
class VectorR3;
class Node {
friend class Tree;
public:
Node(const VectorR3&, const VectorR3&, double, Purpose, double minTheta=-PI, double maxTheta=PI, double restAngle=0.);
void PrintNode();
void InitNode();
const VectorR3& GetAttach() const { return attach; }
double GetTheta() const { return theta; }
double AddToTheta( double& delta ) {
//double orgTheta = theta;
theta += delta;
#if 0
if (theta < minTheta)
theta = minTheta;
if (theta > maxTheta)
theta = maxTheta;
double actualDelta = theta - orgTheta;
delta = actualDelta;
#endif
return theta; }
double UpdateTheta( double& delta ) {
theta = delta;
return theta; }
const VectorR3& GetS() const { return s; }
const VectorR3& GetW() const { return w; }
double GetMinTheta() const { return minTheta; }
double GetMaxTheta() const { return maxTheta; }
double GetRestAngle() const { return restAngle; } ;
void SetTheta(double newTheta) { theta = newTheta; }
void ComputeS(void);
void ComputeW(void);
bool IsEffector() const { return purpose==EFFECTOR; }
bool IsJoint() const { return purpose==JOINT; }
int GetEffectorNum() const { return seqNumEffector; }
int GetJointNum() const { return seqNumJoint; }
bool IsFrozen() const { return freezed; }
void Freeze() { freezed = true; }
void UnFreeze() { freezed = false; }
//private:
bool freezed; // Is this node frozen?
int seqNumJoint; // sequence number if this node is a joint
int seqNumEffector; // sequence number if this node is an effector
double size; // size
Purpose purpose; // joint / effector / both
VectorR3 attach; // attachment point
VectorR3 r; // relative position vector
VectorR3 v; // rotation axis
double theta; // joint angle (radian)
double minTheta; // lower limit of joint angle
double maxTheta; // upper limit of joint angle
double restAngle; // rest position angle
VectorR3 s; // GLobal Position
VectorR3 w; // Global rotation axis
Node* left; // left child
Node* right; // right sibling
Node* realparent; // pointer to real parent
};
#endif |
/*
* sunxi csi cci register read/write interface header file
* Author:raymonxiu
*/
#ifndef __CSI__CCI__REG__H__
#define __CSI__CCI__REG__H__
#define MAX_CSI 2
#define CCI_HCLK 24*1000*1000
#define FIFO_DEPTH 64
//#define _OS
#include <linux/delay.h>
#ifdef _OS
#define CCI_INLINE_FUNC inline
#define csi_cci_udelay(x) udelay(x)
#else
#define CCI_INLINE_FUNC
#define csi_cci_udelay(x) udelay(x)
#endif
enum cci_io_vol
{
LOW,
HIGH,
};
enum cci_trans_mode
{
SINGLE,
REPEAT,
};
enum cci_rs_mode
{
RESTART = 0,
STOP_START = 1,
};
enum cci_rd_start
{
START_WITH_ID_W = 0,
START_WITHOUT_ID_W = 1,
};
enum cci_src
{
FIFO = 0,
DRAM = 1,
};
enum cci_packet_mode
{
COMPACT = 0,
COMPLETE = 1,
};
enum cci_trig_src
{
NO_TRIG = 0,
CSI0_TRIG = 2,
CSI1_TRIG = 3,
};
enum cci_trig_con
{
TRIG_DEFAULT =0,
TRIG_HREF_FIRST =0,
TRIG_HREF_LAST =1,
TRIG_LN_CNT =2,
};
struct cci_bus_fmt
{
enum cci_rs_mode rs_mode;
enum cci_rd_start rs_start;
unsigned char saddr_7bit;
unsigned char wr_flag;
unsigned char addr_len;
unsigned char data_len;
};
struct cci_tx_buf
{
enum cci_src buf_src;
enum cci_packet_mode pkt_mode;
unsigned int pkt_cnt;
};
struct cci_tx_trig
{
enum cci_trig_src trig_src;
enum cci_trig_con trig_con;
};
struct cci_int_status
{
_Bool complete;
_Bool error;
};
enum cci_int_sel
{
CCI_INT_FINISH = 0X1,
CCI_INT_ERROR = 0X2,
CCI_INT_ALL = 0x3,
};
struct cci_line_status
{
enum cci_io_vol cci_sck;
enum cci_io_vol cci_sda;
};
enum cci_bus_status
{
BUS_ERR = 0x00,
START_TX = 0x08,
RPT_START_TX = 0x10,
ADDR_WR_TX_WI_ACK = 0x18,
ADDR_WR_TX_WO_ACK = 0x20,
DATA_TX_WI_ACK = 0x28,
DATA_TX_WO_ACK = 0x30,
ARBIT_LOST = 0x38,
ADDR_RD_TX_WI_ACK = 0x40,
ADDR_RD_TX_WO_ACK = 0x48,
DATA_RX_WI_ACK = 0x50,
DATA_RX_WO_ACK = 0x58,
ACK_TIMEOUT = 0x01,
NONE_DEFINED ,
};
int csi_cci_set_base_addr(unsigned int sel, unsigned long addr);
void csi_cci_enable(unsigned int sel);
void csi_cci_disable(unsigned int sel);
void csi_cci_reset(unsigned int sel);
void csi_cci_set_clk_div(unsigned int sel, unsigned char *div_coef);
//interval unit in 40 scl cycles
void csi_cci_set_pkt_interval(unsigned int sel, unsigned char interval);
//timeout unit in scl cycle
void csi_cci_set_ack_timeout(unsigned int sel, unsigned char to_val);
//trig delay unit in scl cycle
void csi_cci_set_trig_dly(unsigned int sel, unsigned int dly);
void csi_cci_trans_start(unsigned int sel, enum cci_trans_mode trans_mode);
unsigned int csi_cci_get_trans_done(unsigned int sel);
void csi_cci_set_bus_fmt(unsigned int sel, struct cci_bus_fmt *bus_fmt);
void csi_cci_set_tx_buf_mode(unsigned int sel, struct cci_tx_buf *tx_buf_mode);
void csi_cci_fifo_pt_reset(unsigned int sel);
void csi_cci_fifo_pt_add(unsigned int sel, unsigned int byte_cnt);
void csi_cci_fifo_pt_sub(unsigned int sel, unsigned int byte_cnt);
void csi_cci_wr_tx_buf(unsigned int sel, unsigned char *buf, unsigned int byte_cnt);
void csi_cci_rd_tx_buf(unsigned int sel, unsigned char *buf, unsigned int byte_cnt);
void csi_cci_set_trig_mode(unsigned int sel, struct cci_tx_trig *tx_trig_mode);
void csi_cci_set_trig_line_cnt(unsigned int sel, unsigned int line_cnt);
void cci_int_enable(unsigned int sel, enum cci_int_sel interrupt);
void cci_int_disable(unsigned int sel, enum cci_int_sel interrupt);
void CCI_INLINE_FUNC cci_int_get_status(unsigned int sel, struct cci_int_status *status);
void CCI_INLINE_FUNC cci_int_clear_status(unsigned int sel, enum cci_int_sel interrupt);
enum cci_bus_status CCI_INLINE_FUNC cci_get_bus_status(unsigned int sel);
void cci_get_line_status(unsigned int sel, struct cci_line_status *status);
void cci_pad_en(unsigned int sel);
void cci_stop(unsigned int sel);
void cci_sck_cycles(unsigned int sel, unsigned int cycle_times);
void cci_print_info(unsigned int sel);
#endif //__CSI__CCI__REG__H__
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Igor V. Stolyarov
*/
#ifndef __BLITTER__
#define __BLITTER__
#include "SurfaceDataStructure.h"
#include "LUTTables.h"
const static int COMPOSITE_CLEAR = 1;
const static int COMPOSITE_SRC = 2;
const static int COMPOSITE_SRC_OVER = 3;
const static int COMPOSITE_DST_OVER = 4;
const static int COMPOSITE_SRC_IN = 5;
const static int COMPOSITE_DST_IN = 6;
const static int COMPOSITE_SRC_OUT = 7;
const static int COMPOSITE_DST_OUT = 8;
const static int COMPOSITE_DST = 9;
const static int COMPOSITE_SRC_ATOP = 10;
const static int COMPOSITE_DST_ATOP = 11;
const static int COMPOSITE_XOR = 12;
void src_over_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_over_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void src_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void xor_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void xor_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void src_atop_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_atop_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void src_in_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_in_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void src_out_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_out_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void clear_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void dst_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void dst_atop_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void dst_atop_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void dst_in_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void dst_in_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void dst_over_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void dst_over_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void dst_out_custom
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void dst_out_custom_bg
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int, int);
void src_over_intrgb_intrgb
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_over_intrgb_intargb
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_over_intargb_intrgb
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_over_intargb_intargb
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void src_over_byteindexed_intargb
(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
void getRGB
(int, int, SURFACE_STRUCTURE *, void *, unsigned char &, unsigned char &, unsigned char &, unsigned char &, bool);
void setRGB
(int, int, SURFACE_STRUCTURE *, void *, unsigned char, unsigned char, unsigned char, unsigned char, bool);
extern void (* src_over_blt[14][14])(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
extern void (* src_blt[14][14])(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
extern void (* xor_blt[14][14])(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
#endif
|
/*
* BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER
*
* Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.com>
*
* 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
*/
#ifndef AVCODEC_BFIN_PIXELS_H
#define AVCODEC_BFIN_PIXELS_H
#include <stdint.h>
#include "libavutil/bfin/attributes.h"
void ff_bfin_z_put_pixels16_xy2(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h) attribute_l1_text;
void ff_bfin_z_put_pixels8_xy2(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h) attribute_l1_text;
void ff_bfin_put_pixels8uc(uint8_t *block, const uint8_t *s0,
const uint8_t *s1, int dest_size, int line_size,
int h) attribute_l1_text;
void ff_bfin_put_pixels16uc(uint8_t *block, const uint8_t *s0,
const uint8_t *s1, int dest_size, int line_size,
int h) attribute_l1_text;
#endif /* AVCODEC_BFIN_PIXELS_H */
|
#import "MTCardLayout.h"
@interface MTDraggableCardLayout : MTCardLayout
@end
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/emr-containers/EMRContainers_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace EMRContainers
{
namespace Model
{
class AWS_EMRCONTAINERS_API CreateManagedEndpointResult
{
public:
CreateManagedEndpointResult();
CreateManagedEndpointResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
CreateManagedEndpointResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline const Aws::String& GetId() const{ return m_id; }
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline void SetId(const Aws::String& value) { m_id = value; }
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline void SetId(Aws::String&& value) { m_id = std::move(value); }
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline void SetId(const char* value) { m_id.assign(value); }
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithId(const Aws::String& value) { SetId(value); return *this;}
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
/**
* <p>The output contains the ID of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithId(const char* value) { SetId(value); return *this;}
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline void SetName(const Aws::String& value) { m_name = value; }
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline void SetName(Aws::String&& value) { m_name = std::move(value); }
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline void SetName(const char* value) { m_name.assign(value); }
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithName(const Aws::String& value) { SetName(value); return *this;}
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
/**
* <p>The output contains the name of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithName(const char* value) { SetName(value); return *this;}
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline const Aws::String& GetArn() const{ return m_arn; }
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline void SetArn(const Aws::String& value) { m_arn = value; }
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline void SetArn(Aws::String&& value) { m_arn = std::move(value); }
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline void SetArn(const char* value) { m_arn.assign(value); }
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithArn(const Aws::String& value) { SetArn(value); return *this;}
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;}
/**
* <p>The output contains the ARN of the managed endpoint.</p>
*/
inline CreateManagedEndpointResult& WithArn(const char* value) { SetArn(value); return *this;}
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline const Aws::String& GetVirtualClusterId() const{ return m_virtualClusterId; }
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline void SetVirtualClusterId(const Aws::String& value) { m_virtualClusterId = value; }
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline void SetVirtualClusterId(Aws::String&& value) { m_virtualClusterId = std::move(value); }
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline void SetVirtualClusterId(const char* value) { m_virtualClusterId.assign(value); }
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline CreateManagedEndpointResult& WithVirtualClusterId(const Aws::String& value) { SetVirtualClusterId(value); return *this;}
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline CreateManagedEndpointResult& WithVirtualClusterId(Aws::String&& value) { SetVirtualClusterId(std::move(value)); return *this;}
/**
* <p>The output contains the ID of the virtual cluster.</p>
*/
inline CreateManagedEndpointResult& WithVirtualClusterId(const char* value) { SetVirtualClusterId(value); return *this;}
private:
Aws::String m_id;
Aws::String m_name;
Aws::String m_arn;
Aws::String m_virtualClusterId;
};
} // namespace Model
} // namespace EMRContainers
} // namespace Aws
|
/* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
/*!
* @file Store.h
* @brief Interface definition file for Store
*/
/* Copyright (c) 2009 Webroot Software, 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 STORE_H
#define STORE_H
#include <voldemort/VersionedValue.h>
#include <list>
#include <string>
namespace Voldemort {
/**
* The basic interface used for storage.
*/
class Store
{
public:
virtual ~Store() { }
/**
* Get the values associated with the given key or NULL if no
* values to retrieve.
*
* @param key The key to retrieve
* @return A newly-allocated list of values or NULL if no values
* to retrieve.
*/
virtual std::list<VersionedValue>* get(const std::string& key) = 0;
/**
* Associate the value with the key and version in this store.
*
* @param key The key to store
* @param value The value to store
*/
virtual void put(const std::string& key,
const VersionedValue& value) = 0;
/**
* Delete all entries prior to the given version
*
* @param key The key to delete
* @param version the version to use
* @return True if anything was deleted
*/
virtual bool deleteKey(const std::string& key,
const Version& version) = 0;
/**
* Get the name for this store. The memory is owned by the Store
* object and should not be freed by the caller.
*
* @returns the name of the store.
*/
virtual const std::string* getName() = 0;
/**
* Close the store
*/
virtual void close() = 0;
};
} /* namespace Voldemort */
#endif /* STORE_H */
|
/*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _ALLOCMAN_MSPACE_H_
#define _ALLOCMAN_MSPACE_H_
#include <allocman/properties.h>
struct allocman;
struct mspace_interface {
void *(*alloc)(struct allocman *alloc, void *cookie, uint32_t bytes, int *error);
void (*free)(struct allocman *alloc, void *cookie, void *ptr, uint32_t bytes);
struct allocman_properties properties;
void *mspace;
};
#endif
|
/*!
* \copy
* Copyright (c) 2009-2013, Cisco Systems
* 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.
*
* 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.
*
*
* \file WelsThreadLib.h
*
* \brief Interfaces introduced in thread programming
*
* \date 11/17/2009 Created
*
*************************************************************************************
*/
#ifndef _WELS_THREAD_API_H_
#define _WELS_THREAD_API_H_
#include "typedefs.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32)
#include <windows.h>
typedef HANDLE WELS_THREAD_HANDLE;
typedef LPTHREAD_START_ROUTINE LPWELS_THREAD_ROUTINE;
typedef CRITICAL_SECTION WELS_MUTEX;
typedef HANDLE WELS_EVENT;
#define WELS_THREAD_ROUTINE_TYPE DWORD WINAPI
#define WELS_THREAD_ROUTINE_RETURN(rc) return (DWORD)rc;
#else // NON-WINDOWS
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fcntl.h>
typedef pthread_t WELS_THREAD_HANDLE;
typedef void* (*LPWELS_THREAD_ROUTINE) (void*);
typedef pthread_mutex_t WELS_MUTEX;
typedef sem_t* WELS_EVENT;
#define WELS_THREAD_ROUTINE_TYPE void *
#define WELS_THREAD_ROUTINE_RETURN(rc) return (void*)(intptr_t)rc;
#endif//_WIN32
typedef int32_t WELS_THREAD_ERROR_CODE;
typedef int32_t WELS_THREAD_ATTR;
typedef struct _WelsLogicalProcessorInfo {
int32_t ProcessorCount;
} WelsLogicalProcessInfo;
#define WELS_THREAD_ERROR_OK 0
#define WELS_THREAD_ERROR_GENERAL ((uint32_t)(-1))
#define WELS_THREAD_ERROR_WAIT_OBJECT_0 0
#define WELS_THREAD_ERROR_WAIT_TIMEOUT ((uint32_t)0x00000102L)
#define WELS_THREAD_ERROR_WAIT_FAILED WELS_THREAD_ERROR_GENERAL
WELS_THREAD_ERROR_CODE WelsMutexInit (WELS_MUTEX* mutex);
WELS_THREAD_ERROR_CODE WelsMutexLock (WELS_MUTEX* mutex);
WELS_THREAD_ERROR_CODE WelsMutexUnlock (WELS_MUTEX* mutex);
WELS_THREAD_ERROR_CODE WelsMutexDestroy (WELS_MUTEX* mutex);
WELS_THREAD_ERROR_CODE WelsEventOpen (WELS_EVENT* p_event, const char* event_name);
WELS_THREAD_ERROR_CODE WelsEventClose (WELS_EVENT* event, const char* event_name);
WELS_THREAD_ERROR_CODE WelsEventSignal (WELS_EVENT* event);
WELS_THREAD_ERROR_CODE WelsEventWait (WELS_EVENT* event);
WELS_THREAD_ERROR_CODE WelsEventWaitWithTimeOut (WELS_EVENT* event, uint32_t dwMilliseconds);
WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount, WELS_EVENT* event_list,
WELS_EVENT* master_event = NULL);
WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitAllBlocking (uint32_t nCount, WELS_EVENT* event_list,
WELS_EVENT* master_event = NULL);
WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_THREAD_ROUTINE routine,
void* arg, WELS_THREAD_ATTR attr);
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread);
WELS_THREAD_HANDLE WelsThreadSelf();
WELS_THREAD_ERROR_CODE WelsQueryLogicalProcessInfo (WelsLogicalProcessInfo* pInfo);
#ifdef __cplusplus
}
#endif
#endif
|
enum E {
x,
y = 2,
z,
};
int
main()
{
enum E e;
if(x != 0)
return 1;
if(y != 2)
return 2;
if(z != 3)
return 3;
e = x;
return x;
}
|
// Copyright 2010-2015, 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 MOZC_WIN32_TIP_TIP_EDIT_SESSION_IMPL_H_
#define MOZC_WIN32_TIP_TIP_EDIT_SESSION_IMPL_H_
#include <msctf.h>
#include "base/port.h"
namespace mozc {
namespace commands {
class Output;
class SessionCommand;
} // namespace commands
namespace win32 {
namespace tsf {
class TipTextService;
// A helper function to update the context based on the response from
// mozc_server.
// TODO(yukawa): Use more descriptive class name.
class TipEditSessionImpl {
public:
// A high level logic to handle on-composition-terminated event.
static HRESULT OnCompositionTerminated(TipTextService *text_service,
ITfContext *context,
ITfComposition *composition,
TfEditCookie write_cookie);
// Does post-edit status checking for composition (if exists). For example,
// when the composition is canceled by the application, this method sends
// REVERT message to the server so that the status is kept to be consistent.
static HRESULT OnEndEdit(TipTextService *text_service,
ITfContext *context,
TfEditCookie write_cookie,
ITfEditRecord *edit_record);
// A core logic of response handler. This function does
// - Updates composition string.
// - Updates candidate strings.
// - Updates private context including IME On/Off state and input mode.
// - Invokes UI update. (by calling UpdateUI)
static HRESULT UpdateContext(TipTextService *text_service,
ITfContext *context,
TfEditCookie write_cookie,
const commands::Output &output);
// A core logic of UI handler. This function does
// - Invokes UI update.
static void UpdateUI(TipTextService *text_service,
ITfContext *context,
TfEditCookie read_cookie);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(TipEditSessionImpl);
};
} // namespace tsf
} // namespace win32
} // namespace mozc
#endif // MOZC_WIN32_TIP_TIP_EDIT_SESSION_IMPL_H_
|
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#import <Foundation/Foundation.h>
#import "WebRTC/RTCVideoRenderer.h"
// Check if metal is supported in WebRTC.
// NOTE: Currently arm64 == Metal.
#if defined(__aarch64__)
#define RTC_SUPPORTS_METAL
#endif
NS_ASSUME_NONNULL_BEGIN
/**
* RTCMTLVideoView is thin wrapper around MTKView.
*
* It has id<RTCVideoRenderer> property that renders video frames in the view's
* bounds using Metal.
*/
NS_CLASS_AVAILABLE_IOS(9)
RTC_EXPORT
@interface RTCMTLVideoView : UIView <RTCVideoRenderer>
@end
NS_ASSUME_NONNULL_END
|
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WorkerReportingProxy_h
#define WorkerReportingProxy_h
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
namespace blink {
class ConsoleMessage;
class WorkerGlobalScope;
// APIs used by workers to report console and worker activity.
class CORE_EXPORT WorkerReportingProxy {
public:
virtual ~WorkerReportingProxy() { }
virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) = 0;
virtual void reportConsoleMessage(ConsoleMessage*) = 0;
virtual void postMessageToPageInspector(const String&) = 0;
virtual void postWorkerConsoleAgentEnabled() = 0;
// Invoked when the worker script is evaluated. |success| is true if the
// evaluation completed with no uncaught exception.
virtual void didEvaluateWorkerScript(bool success) = 0;
// Invoked when the thread creates a worker script context.
virtual void didInitializeWorkerContext() { }
// Invoked when the new WorkerGlobalScope is started.
virtual void workerGlobalScopeStarted(WorkerGlobalScope*) = 0;
// Invoked when close() is invoked on the worker context.
virtual void workerGlobalScopeClosed() = 0;
// Invoked when the thread is stopped and WorkerGlobalScope is being
// destructed. (This is be the last method that is called on this
// interface)
virtual void workerThreadTerminated() = 0;
// Invoked when the thread is about to be stopped and WorkerGlobalScope
// is to be destructed. (When this is called it is guaranteed that
// WorkerGlobalScope is still alive)
virtual void willDestroyWorkerGlobalScope() = 0;
};
} // namespace blink
#endif // WorkerReportingProxy_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 MEDIA_FILTERS_DECODER_SELECTOR_H_
#define MEDIA_FILTERS_DECODER_SELECTOR_H_
#include <memory>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "media/base/demuxer_stream.h"
#include "media/base/pipeline_status.h"
#include "media/filters/decoder_stream_traits.h"
namespace base {
class SingleThreadTaskRunner;
}
namespace media {
class CdmContext;
class DecoderBuffer;
class DecryptingDemuxerStream;
class MediaLog;
// DecoderSelector (creates if necessary and) initializes the proper
// Decoder for a given DemuxerStream. If the given DemuxerStream is
// encrypted, a DecryptingDemuxerStream may also be created.
// The template parameter |StreamType| is the type of stream we will be
// selecting a decoder for.
template<DemuxerStream::Type StreamType>
class MEDIA_EXPORT DecoderSelector {
public:
typedef DecoderStreamTraits<StreamType> StreamTraits;
typedef typename StreamTraits::DecoderType Decoder;
// Indicates completion of Decoder selection.
// - First parameter: The initialized Decoder. If it's set to NULL, then
// Decoder initialization failed.
// - Second parameter: The initialized DecryptingDemuxerStream. If it's not
// NULL, then a DecryptingDemuxerStream is created and initialized to do
// decryption for the initialized Decoder.
// Note: The caller owns selected Decoder and DecryptingDemuxerStream.
// The caller should call DecryptingDemuxerStream::Reset() before
// calling Decoder::Reset() to release any pending decryption or read.
typedef base::Callback<void(std::unique_ptr<Decoder>,
std::unique_ptr<DecryptingDemuxerStream>)>
SelectDecoderCB;
// |decoders| contains the Decoders to use when initializing.
DecoderSelector(
const scoped_refptr<base::SingleThreadTaskRunner>& message_loop,
ScopedVector<Decoder> decoders,
const scoped_refptr<MediaLog>& media_log);
// Aborts pending Decoder selection and fires |select_decoder_cb| with
// NULL and NULL immediately if it's pending.
~DecoderSelector();
// Initializes and selects the first Decoder that can decode the |stream|.
// The selected Decoder (and DecryptingDemuxerStream) is returned via
// the |select_decoder_cb|.
// Notes:
// 1. This must not be called again before |select_decoder_cb| is run.
// 2. Decoders that fail to initialize will be deleted. Future calls will
// select from the decoders following the decoder that was last returned.
// 3. |cdm_context| is optional. If |cdm_context| is
// null, no CDM will be available to perform decryption.
void SelectDecoder(DemuxerStream* stream,
CdmContext* cdm_context,
const SelectDecoderCB& select_decoder_cb,
const typename Decoder::OutputCB& output_cb,
const base::Closure& waiting_for_decryption_key_cb);
private:
#if !defined(OS_ANDROID)
void InitializeDecryptingDecoder();
void DecryptingDecoderInitDone(bool success);
#endif
void InitializeDecryptingDemuxerStream();
void DecryptingDemuxerStreamInitDone(PipelineStatus status);
void InitializeDecoder();
void DecoderInitDone(bool success);
void ReturnNullDecoder();
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
ScopedVector<Decoder> decoders_;
scoped_refptr<MediaLog> media_log_;
DemuxerStream* input_stream_;
CdmContext* cdm_context_;
SelectDecoderCB select_decoder_cb_;
typename Decoder::OutputCB output_cb_;
base::Closure waiting_for_decryption_key_cb_;
std::unique_ptr<Decoder> decoder_;
std::unique_ptr<DecryptingDemuxerStream> decrypted_stream_;
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<DecoderSelector> weak_ptr_factory_;
DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector);
};
typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector;
typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector;
} // namespace media
#endif // MEDIA_FILTERS_DECODER_SELECTOR_H_
|
#include "cvProjection.h"
#include <stdio.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
float calc_sum_9(float *pos, size_t width)
{
float *pos1, *pos2, *pos3, *pos4, *pos5;
pos1 = pos - 1 * width - 1;
pos2 = pos - 1;
pos3 = pos + width - 1;
return
*pos1 + *(pos1+1) + *(pos1+2) +
*pos2 + *(pos2+1) + *(pos2+2) +
*pos3 + *(pos3+1) + *(pos3+2);
}
IplImage *project_polar(IplImage *src)
{
IplImage *dst;
unsigned int w, h, x, y, px, py, minx, maxx, miny, maxy, sumx, sumy, count;
unsigned int new_width, new_height, src_stride, dst_stride;
float value, a, r, rmin, rmax, cx, cy, ratio;
float *src_data, *dst_data, *src_pos, *dst_pos;
CvSize size = cvGetSize(src);
src_data = (float*)src->imageData;
src_stride = (int)(src->widthStep / sizeof(float));
w = size.width;
h = size.height;
minx = 2000000000;
maxx = 0;
miny = 2000000000;
maxy = 0;
sumx = 0;
sumy = 0;
count = 0;
/* find the extents of object */
for (y = 0; y < h; y++) {
src_pos = src_data + y * src_stride;
for (x = 0; x < w; x++, src_pos++) {
value = *src_pos;
if (value > 0.0001) {
if (x < minx) minx = x;
if (x > maxx) maxx = x;
if (y < miny) miny = y;
if (y > maxy) maxy = y;
sumx += x;
sumy += y;
count += 1;
}
}
}
cx = (float)sumx / count;
cy = (float)sumy / count;
ratio = (float)(maxy - miny) / (float)(maxx - minx);
printf("w=%d h=%d cx=%f cy=%f ratio=%f\n", w, h, cx, cy, ratio);
rmin = 2000000000;
rmax = 0;
for (y = 0; y < h; y++) {
src_pos = src_data + y * src_stride;
for (x = 0; x < w; x++, src_pos++) {
value = *src_pos;
if (value > 0.0001) {
px = floor(x - cx);
py = floor((y / ratio) - (cy / ratio));
r = sqrt(py*py + px*px);
if (r < rmin) rmin = r;
if (r > rmax) rmax = r;
}
}
}
new_height = ceil(rmax - rmin);
new_width = ceil(2 * M_PI * rmax);
printf("w=%d h=%d rmin=%f rmax=%f\n", new_width, new_height, rmin, rmax);
size.width = new_width;
size.height = new_height;
dst = cvCreateImage(size, IPL_DEPTH_32F, 1);
dst_data = (float*)dst->imageData;
dst_stride = (int)(dst->widthStep / sizeof(float));
for (y = 0; y < new_height; y++) {
dst_pos = dst_data + y * dst_stride;
r = (float)(rmax - y);
for (x = 0; x < new_width; x++, dst_pos++) {
a = ((float)x / (float)new_width) * 2 * M_PI;
px = floor(cx + (r * cos(a)));
py = floor(((cy / ratio) + (r * sin(a))) * ratio);
if (px < 0 || py < 0 || px >= w || py >= h) {
/*printf(".");*/
}
else {
src_pos = src_data + py * src_stride + px;
value = *src_pos;
if (value < 0.0001) {
if (px > 0 && py > 0 && px < w-1 && py < h-1) {
value = calc_sum_9(src_pos, src_stride) / 9;
if (value < 0.0001) {
value = 0.5;
}
}
else {
value = 0.5;
}
}
*dst_pos = value;
}
}
}
return dst;
}
/*
int w = (int)(2 * M_PI * r);
tmp = ensure32F(src);
dst = wrapCreateImage32F(w,h,1);
if (r < cx && r < cy && h <= r) {
float *src_data = (float *)tmp->imageData;
float *dst_data = (float *)dst->imageData;
int src_stride = (int)(tmp->widthStep / sizeof(float));
int dst_stride = (int)(dst->widthStep / sizeof(float));
int px, py;
double angle;
double radius;
for (int i = 0; i < w; i++) {
angle = ((double)i / (double)w) * (2 * M_PI);
for (int j = 0; j < h; j++) {
radius = (double)(r-j);
px = cx + floor(radius * cos(angle));
py = cy + floor(radius * sin(angle));
*(dst_data + j * dst_stride + i) = *(src_data + py * src_stride + px);
}
}
}
else {
printf("image too small\n");
}
*/
|
#include <stdio.h>
int print_hash_value = 1;
static void platform_main_begin(void)
{
}
static unsigned crc32_tab[256];
static unsigned crc32_context = 0xFFFFFFFFUL;
static void
crc32_gentab (void)
{
unsigned crc;
unsigned poly = 0xEDB88320UL;
int i, j;
for (i = 0; i < 256; i++) {
crc = i;
for (j = 8; j > 0; j--) {
if (crc & 1) {
crc = (crc >> 1) ^ poly;
} else {
crc >>= 1;
}
}
crc32_tab[i] = crc;
}
}
static void
crc32_byte (unsigned char b) {
crc32_context =
((crc32_context >> 8) & 0x00FFFFFF) ^
crc32_tab[(crc32_context ^ b) & 0xFF];
}
extern int strcmp ( char *, char *);
static void
crc32_8bytes (unsigned val)
{
crc32_byte ((val>>0) & 0xff);
crc32_byte ((val>>8) & 0xff);
crc32_byte ((val>>16) & 0xff);
crc32_byte ((val>>24) & 0xff);
}
static void
transparent_crc (unsigned val, char* vname, int flag)
{
crc32_8bytes(val);
if (flag) {
printf("...checksum after hashing %s : %X\n", vname, crc32_context ^ 0xFFFFFFFFU);
}
}
static void
platform_main_end (int x, int flag)
{
if (!flag) printf ("checksum = %x\n", x);
}
static long __undefined;
void csmith_compute_hash(void);
void step_hash(int stmt_id);
static int g_5 = (-1L);
static int *g_4 = &g_5;
static unsigned short func_1(void);
static int * func_2(int * p_3);
static unsigned short func_1(void)
{
int **l_10 = &g_4;
unsigned l_11 = 7UL;
step_hash(4);
(*l_10) = func_2(g_4);
step_hash(5);
return l_11;
}
static int * func_2(int * p_3)
{
unsigned short l_6 = 6UL;
int *l_9 = &g_5;
step_hash(2);
++l_6;
step_hash(3);
return l_9;
}
void csmith_compute_hash(void)
{
transparent_crc(g_5, "g_5", print_hash_value);
}
void step_hash(int stmt_id)
{
int i = 0;
csmith_compute_hash();
printf("before stmt(%d): checksum = %X\n", stmt_id, crc32_context ^ 0xFFFFFFFFUL);
crc32_context = 0xFFFFFFFFUL;
for (i = 0; i < 256; i++) {
crc32_tab[i] = 0;
}
crc32_gentab();
}
int main (void)
{
int print_hash_value = 0;
platform_main_begin();
crc32_gentab();
func_1();
csmith_compute_hash();
platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.