text stringlengths 4 6.14k |
|---|
/* Structures and definitions for the user accounting database. GNU version.
Copyright (C) 1997, 1998, 2000, 2001, 2002 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, see
<http://www.gnu.org/licenses/>. */
#ifndef _UTMPX_H
# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
#endif
#include <bits/types.h>
#include <sys/time.h>
#include <bits/wordsize.h>
#ifdef __USE_GNU
# include <paths.h>
# define _PATH_UTMPX _PATH_UTMP
# define _PATH_WTMPX _PATH_WTMP
#endif
#define __UT_LINESIZE 32
#define __UT_NAMESIZE 32
#define __UT_HOSTSIZE 256
/* The structure describing the status of a terminated process. This
type is used in `struct utmpx' below. */
struct __exit_status
{
#ifdef __USE_GNU
short int e_termination; /* Process termination status. */
short int e_exit; /* Process exit status. */
#else
short int __e_termination; /* Process termination status. */
short int __e_exit; /* Process exit status. */
#endif
};
/* The structure describing an entry in the user accounting database. */
struct utmpx
{
short int ut_type; /* Type of login. */
__pid_t ut_pid; /* Process ID of login process. */
char ut_line[__UT_LINESIZE]; /* Devicename. */
char ut_id[4]; /* Inittab ID. */
char ut_user[__UT_NAMESIZE]; /* Username. */
char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */
struct __exit_status ut_exit; /* Exit status of a process marked
as DEAD_PROCESS. */
/* The fields ut_session and ut_tv must be the same size when compiled
32- and 64-bit. This allows files and shared memory to be shared
between 32- and 64-bit applications. */
#ifdef __WORDSIZE_TIME64_COMPAT32
__int32_t ut_session; /* Session ID, used for windowing. */
struct
{
__int32_t tv_sec; /* Seconds. */
__int32_t tv_usec; /* Microseconds. */
} ut_tv; /* Time entry was made. */
#else
long int ut_session; /* Session ID, used for windowing. */
struct timeval ut_tv; /* Time entry was made. */
#endif
__int32_t ut_addr_v6[4]; /* Internet address of remote host. */
char __unused[20]; /* Reserved for future use. */
};
/* Values for the `ut_type' field of a `struct utmpx'. */
#define EMPTY 0 /* No valid user accounting information. */
#ifdef __USE_GNU
# define RUN_LVL 1 /* The system's runlevel. */
#endif
#define BOOT_TIME 2 /* Time of system boot. */
#define NEW_TIME 3 /* Time after system clock changed. */
#define OLD_TIME 4 /* Time when system clock changed. */
#define INIT_PROCESS 5 /* Process spawned by the init process. */
#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
#define USER_PROCESS 7 /* Normal process. */
#define DEAD_PROCESS 8 /* Terminated process. */
#ifdef __USE_GNU
# define ACCOUNTING 9 /* System accounting. */
#endif
|
/* Blackfin General Purpose Ports (GPIO) model
Copyright (C) 2010-2011 Free Software Foundation, Inc.
Contributed by Analog Devices, Inc.
This file is part of simulators.
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 DV_BFIN_GPIO_H
#define DV_BFIN_GPIO_H
/* XXX: This should be pushed into the model data. */
#define BFIN_MMR_GPIO_SIZE (17 * 4)
#endif
|
/*
* This definitions of the PIC12F629 MCU.
*
* This file is part of the GNU PIC library for SDCC, originally
* created by Molnar Karoly <molnarkaroly@users.sf.net> 2012.
*
* This file is generated automatically by the cinc2h.pl, 2012-09-28 08:19:44 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 <pic12f629.h>
//==============================================================================
__at(0x0000) __sfr INDF;
__at(0x0001) __sfr TMR0;
__at(0x0002) __sfr PCL;
__at(0x0003) __sfr STATUS;
__at(0x0003) volatile __STATUSbits_t STATUSbits;
__at(0x0004) __sfr FSR;
__at(0x0005) __sfr GPIO;
__at(0x0005) volatile __GPIObits_t GPIObits;
__at(0x000A) __sfr PCLATH;
__at(0x000B) __sfr INTCON;
__at(0x000B) volatile __INTCONbits_t INTCONbits;
__at(0x000C) __sfr PIR1;
__at(0x000C) volatile __PIR1bits_t PIR1bits;
__at(0x000E) __sfr TMR1;
__at(0x000E) __sfr TMR1L;
__at(0x000F) __sfr TMR1H;
__at(0x0010) __sfr T1CON;
__at(0x0010) volatile __T1CONbits_t T1CONbits;
__at(0x0019) __sfr CMCON;
__at(0x0019) volatile __CMCONbits_t CMCONbits;
__at(0x0081) __sfr OPTION_REG;
__at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
__at(0x0085) __sfr TRISIO;
__at(0x0085) volatile __TRISIObits_t TRISIObits;
__at(0x008C) __sfr PIE1;
__at(0x008C) volatile __PIE1bits_t PIE1bits;
__at(0x008E) __sfr PCON;
__at(0x008E) volatile __PCONbits_t PCONbits;
__at(0x0090) __sfr OSCCAL;
__at(0x0090) volatile __OSCCALbits_t OSCCALbits;
__at(0x0095) __sfr WPU;
__at(0x0095) volatile __WPUbits_t WPUbits;
__at(0x0096) __sfr IOC;
__at(0x0096) volatile __IOCbits_t IOCbits;
__at(0x0096) __sfr IOCB;
__at(0x0096) volatile __IOCBbits_t IOCBbits;
__at(0x0099) __sfr VRCON;
__at(0x0099) volatile __VRCONbits_t VRCONbits;
__at(0x009A) __sfr EEDAT;
__at(0x009A) __sfr EEDATA;
__at(0x009B) __sfr EEADR;
__at(0x009C) __sfr EECON1;
__at(0x009C) volatile __EECON1bits_t EECON1bits;
__at(0x009D) __sfr EECON2;
|
#include <vxWorks.h>
#include <stdio.h>
#include <string.h>
#include "BasicFunc.h"
#include "common.h"
#include "mem_fun.h"
#define HICICOMV500
int cicom_v500_trans_config(UINT32 src_addr, UINT32 des_addr, UINT32 num_8);
void cicom_v500_trans_en();
int cicom_v500_trans_check(UINT32 src_addr, UINT32 des_addr, UINT32 num_8);
#ifdef HICICOMV500
#define CICOM_BaseAddr CICOM_BASEADDR
#define asicCICOMCICOM_STATE_RESET CICOM_BaseAddr+0x00000000
#define asicCICOMPRIOR_SELECT CICOM_BaseAddr+0x00000004
#define asicCICOMLLI_PARAM_ADDR_UL CICOM_BaseAddr+0x00000008
#define asicCICOMGLOBAL_CFG_UL CICOM_BaseAddr+0x0000000c
#define asicCICOMCHL_FST_ADDR_UL CICOM_BaseAddr+0x00000010
#define asicCICOMCHL_LST_ADDR_UL CICOM_BaseAddr+0x00000014
#define asicCICOMINT_EN_UL CICOM_BaseAddr+0x00000018
#define asicCICOMINT_RAW_UL CICOM_BaseAddr+0x0000001c
#define asicCICOMINT_CLR_UL CICOM_BaseAddr+0x00000020
#define asicCICOMINT_MSK_UL CICOM_BaseAddr+0x00000024
#define asicCICOMEN_UL CICOM_BaseAddr+0x00000028
#define asicCICOMCK_ADDR_UL CICOM_BaseAddr+0x0000002c
#define asicCICOMCK_31_0_UL CICOM_BaseAddr+0x00000030
#define asicCICOMCK_63_32_UL CICOM_BaseAddr+0x00000034
#define asicCICOMCK_95_64_UL CICOM_BaseAddr+0x00000038
#define asicCICOMCK_127_96_UL CICOM_BaseAddr+0x0000003c
#define asicCICOMCC_UL CICOM_BaseAddr+0x00000040
#define asicCICOMSRC_PDU_TOTAL_LEN_UL CICOM_BaseAddr+0x00000044
#define asicCICOMCUSTOM_CFG_UL CICOM_BaseAddr+0x00000048
#define asicCICOMSRC_PDU_SEG_ADDR_UL CICOM_BaseAddr+0x0000004c
#define asicCICOMSRC_PDU_SEG_LEN_UL CICOM_BaseAddr+0x00000050
#define asicCICOMLLI_SRC_PDU_SEG_ADDR_UL CICOM_BaseAddr+0x00000054
#define asicCICOMDST_TTF_SEG_ADDR_UL CICOM_BaseAddr+0x00000058
#define asicCICOMDST_TTF_SEG_LEN_UL CICOM_BaseAddr+0x0000005c
#define asicCICOMLLI_DST_TTF_SEG_ADDR_UL CICOM_BaseAddr+0x00000060
#define asicCICOMDST_MBX_SEG_ADDR_UL CICOM_BaseAddr+0x00000064
#define asicCICOMDST_MBX_SEG_LEN_UL CICOM_BaseAddr+0x00000068
#define asicCICOMLLI_DST_MBX_SEG_ADDR_UL CICOM_BaseAddr+0x0000006c
#define asicCICOMERROR_ADDR_UL CICOM_BaseAddr+0x00000070
#define asicCICOMSRC_SEG_RD_ADDR_UL CICOM_BaseAddr+0x00000074
#define asicCICOMSRC_SEG_LEAVE_LEN_UL CICOM_BaseAddr+0x00000078
#define asicCICOMTTF_SEG_WR_ADDR_UL CICOM_BaseAddr+0x0000007c
#define asicCICOMTTF_SEG_LEAVE_LEN_UL CICOM_BaseAddr+0x00000080
#define asicCICOMMBX_SEG_WR_ADDR_UL CICOM_BaseAddr+0x00000084
#define asicCICOMMBX_SEG_LEAVE_LEN_UL CICOM_BaseAddr+0x00000088
#define asicCICOMLLI_PARAM_ADDR_DL CICOM_BaseAddr+0x00000108
#define asicCICOMGLOBAL_CFG_DL CICOM_BaseAddr+0x0000010c
#define asicCICOMINT_EN_DL CICOM_BaseAddr+0x00000118
#define asicCICOMINT_RAW_DL CICOM_BaseAddr+0x0000011c
#define asicCICOMINT_CLR_DL CICOM_BaseAddr+0x00000120
#define asicCICOMINT_MSK_DL CICOM_BaseAddr+0x00000124
#define asicCICOMEN_DL CICOM_BaseAddr+0x00000128
#define asicCICOMCK_ADDR_DL CICOM_BaseAddr+0x0000012c
#define asicCICOMCK_31_0_DL CICOM_BaseAddr+0x00000130
#define asicCICOMCK_63_32_DL CICOM_BaseAddr+0x00000134
#define asicCICOMCK_95_64_DL CICOM_BaseAddr+0x00000138
#define asicCICOMCK_127_96_DL CICOM_BaseAddr+0x0000013c
#define asicCICOMCC_DL CICOM_BaseAddr+0x00000140
#define asicCICOMSRC_PDU_TOTAL_LEN_DL CICOM_BaseAddr+0x00000144
#define asicCICOMCUSTOM_CFG_DL CICOM_BaseAddr+0x00000148
#define asicCICOMSRC_PDU_SEG_ADDR_DL CICOM_BaseAddr+0x0000014c
#define asicCICOMSRC_PDU_SEG_LEN_DL CICOM_BaseAddr+0x00000150
#define asicCICOMLLI_SRC_PDU_SEG_ADDR_DL CICOM_BaseAddr+0x00000154
#define asicCICOMDST_TTF_SEG_ADDR_DL CICOM_BaseAddr+0x00000158
#define asicCICOMDST_TTF_SEG_LEN_DL CICOM_BaseAddr+0x0000015c
#define asicCICOMLLI_DST_TTF_SEG_ADDR_DL CICOM_BaseAddr+0x00000160
#define asicCICOMERROR_ADDR_DL CICOM_BaseAddr+0x00000170
#define asicCICOMSRC_SEG_RD_ADDR_DL CICOM_BaseAddr+0x00000174
#define asicCICOMSRC_SEG_LEAVE_LEN_DL CICOM_BaseAddr+0x00000178
#define asicCICOMTTF_SEG_WR_ADDR_DL CICOM_BaseAddr+0x0000017c
#define asicCICOMTTF_SEG_LEAVE_LEN_DL CICOM_BaseAddr+0x00000180
#endif/* !defined HICICOMV500 */
|
/*
** uudecode.c function
*/
int uudecode(FILE *, char *, char *, int *, struct Push *);
|
/*
* Copyright (C) 2013-2015 DeathCore <http://www.noffearrdeathproject.net/>
*
* 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 _GROUPMGR_H
#define _GROUPMGR_H
#include "Group.h"
class GroupMgr
{
private:
GroupMgr();
~GroupMgr();
public:
static GroupMgr* instance()
{
static GroupMgr instance;
return &instance;
}
typedef std::map<uint32, Group*> GroupContainer;
typedef std::vector<Group*> GroupDbContainer;
Group* GetGroupByGUID(uint32 guid) const;
uint32 GenerateNewGroupDbStoreId();
void RegisterGroupDbStoreId(uint32 storageId, Group* group);
void FreeGroupDbStoreId(Group* group);
void SetNextGroupDbStoreId(uint32 storageId) { NextGroupDbStoreId = storageId; };
Group* GetGroupByDbStoreId(uint32 storageId) const;
void SetGroupDbStoreSize(uint32 newSize) { GroupDbStore.resize(newSize); }
void LoadGroups();
uint32 GenerateGroupId();
void AddGroup(Group* group);
void RemoveGroup(Group* group);
protected:
uint32 NextGroupId;
uint32 NextGroupDbStoreId;
GroupContainer GroupStore;
GroupDbContainer GroupDbStore;
};
#define sGroupMgr GroupMgr::instance()
#endif
|
/*
* Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License ONLY.
*
* 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 __XFSM_ERRORS_H__
#define __XFSM_ERRORS_H__
#include <glib-object.h>
#define XFSM_TYPE_ERROR (xfsm_error_get_type ())
#define XFSM_ERROR (xfsm_error_get_quark ())
#define ERROR_MSG(err) ((err) != NULL ? (err)->message : "Error not set")
G_BEGIN_DECLS
typedef enum
{
XFSM_ERROR_BAD_STATE = 0,
XFSM_ERROR_BAD_VALUE,
XFSM_ERROR_UNSUPPORTED,
} XfsmError;
GType xfsm_error_get_type (void) G_GNUC_CONST;
GQuark xfsm_error_get_quark (void) G_GNUC_CONST;
void xfsm_error_dbus_init (void);
G_END_DECLS
#endif /* !__XFSM_ERRORS_H__ */
|
/**********************************************************************
* File: pitsync1.h (Formerly pitsync.h)
* Description: Code to find the optimum fixed pitch segmentation of some blobs.
* Author: Ray Smith
* Created: Thu Nov 19 11:48:05 GMT 1992
*
* (C) Copyright 1992, Hewlett-Packard Ltd.
** 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 PITSYNC1_H
#define PITSYNC1_H
#include "elst.h"
#include "clst.h"
#include "blobbox.h"
#include "params.h"
#include "statistc.h"
#include "pithsync.h"
class FPSEGPT_LIST;
class FPSEGPT:public ELIST_LINK
{
public:
FPSEGPT() { //empty
}
FPSEGPT( //constructor
inT16 x); //position
FPSEGPT( //constructor
inT16 x, //position
BOOL8 faking, //faking this one
inT16 offset, //extra cost dist
inT16 region_index, //segment number
inT16 pitch, //proposed pitch
inT16 pitch_error, //allowed tolerance
FPSEGPT_LIST *prev_list); //previous segment
FPSEGPT(FPCUTPT *cutpt); //build from new type
inT32 position() { //access func
return xpos;
}
double cost_function() {
return cost;
}
double squares() {
return sq_sum;
}
double sum() {
return mean_sum;
}
FPSEGPT *previous() {
return pred;
}
inT16 cheap_cuts() const { //no of cheap cuts
return mid_cuts;
}
//faked split point
BOOL8 faked;
BOOL8 terminal; //successful end
inT16 fake_count; //total fakes to here
private:
inT16 mid_cuts; //no of cheap cuts
inT32 xpos; //location
FPSEGPT *pred; //optimal previous
double mean_sum; //mean so far
double sq_sum; //summed distsances
double cost; //cost function
};
ELISTIZEH (FPSEGPT) CLISTIZEH (FPSEGPT_LIST)
extern
INT_VAR_H (pitsync_linear_version, 0, "Use new fast algorithm");
extern
double_VAR_H (pitsync_joined_edge, 0.75,
"Dist inside big blob for chopping");
extern
double_VAR_H (pitsync_offset_freecut_fraction, 0.25,
"Fraction of cut for free cuts");
extern
INT_VAR_H (pitsync_fake_depth, 1, "Max advance fake generation");
double check_pitch_sync( //find segmentation
BLOBNBOX_IT *blob_it, //blobs to do
inT16 blob_count, //no of blobs
inT16 pitch, //pitch estimate
inT16 pitch_error, //tolerance
STATS *projection, //vertical
FPSEGPT_LIST *seg_list //output list
);
void make_illegal_segment( //find segmentation
FPSEGPT_LIST *prev_list, //previous segments
TBOX blob_box, //bounding box
BLOBNBOX_IT blob_it, //iterator
inT16 region_index, //number of segment
inT16 pitch, //pitch estimate
inT16 pitch_error, //tolerance
FPSEGPT_LIST *seg_list //output list
);
inT16 vertical_torow_projection( //project whole row
TO_ROW *row, //row to do
STATS *projection //output
);
void vertical_cblob_projection( //project outlines
C_BLOB *blob, //blob to project
STATS *stats //output
);
void vertical_coutline_projection( //project outlines
C_OUTLINE *outline, //outline to project
STATS *stats //output
);
#endif
|
/*
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITY_DISABLEMGR_H
#define TRINITY_DISABLEMGR_H
#include "VMapManager2.h"
#include "Define.h"
class Unit;
enum DisableType
{
DISABLE_TYPE_SPELL = 0,
DISABLE_TYPE_QUEST = 1,
DISABLE_TYPE_MAP = 2,
DISABLE_TYPE_BATTLEGROUND = 3,
DISABLE_TYPE_CRITERIA = 4,
DISABLE_TYPE_OUTDOORPVP = 5,
DISABLE_TYPE_VMAP = 6,
DISABLE_TYPE_MMAP = 7,
MAX_DISABLE_TYPES
};
enum SpellDisableTypes
{
SPELL_DISABLE_PLAYER = 0x1,
SPELL_DISABLE_CREATURE = 0x2,
SPELL_DISABLE_PET = 0x4,
SPELL_DISABLE_DEPRECATED_SPELL = 0x8,
SPELL_DISABLE_MAP = 0x10,
SPELL_DISABLE_AREA = 0x20,
SPELL_DISABLE_LOS = 0x40,
MAX_SPELL_DISABLE_TYPE = ( SPELL_DISABLE_PLAYER | SPELL_DISABLE_CREATURE | SPELL_DISABLE_PET |
SPELL_DISABLE_DEPRECATED_SPELL | SPELL_DISABLE_MAP | SPELL_DISABLE_AREA |
SPELL_DISABLE_LOS)
};
enum MMapDisableTypes
{
MMAP_DISABLE_PATHFINDING = 0x0
};
namespace DisableMgr
{
TC_GAME_API void LoadDisables();
TC_GAME_API bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0);
TC_GAME_API void CheckQuestDisables();
TC_GAME_API bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
TC_GAME_API bool IsPathfindingEnabled(uint32 mapId);
}
#endif //TRINITY_DISABLEMGR_H
|
/* -*- mode: c++; c-basic-offset:4 -*-
decryptverifyemailcontroller.h
This file is part of Kleopatra, the KDE keymanager
Copyright (c) 2008 Klarälvdalens Datakonsult AB
Kleopatra is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef __KLEOPATRA_CRYPTO_DECRYPTVERIFYEMAILCONTROLLER_H__
#define __KLEOPATRA_CRYPTO_DECRYPTVERIFYEMAILCONTROLLER_H__
#include <crypto/controller.h>
#include <utils/types.h>
#include <gpgme++/global.h>
#include <QMetaType>
#include <boost/shared_ptr.hpp>
#include <vector>
class QFile;
namespace KMime {
namespace Types {
class Mailbox;
}
}
namespace GpgME {
class VerificationResult;
}
namespace Kleo {
class AssuanCommand;
class Input;
class Output;
namespace Crypto {
class DecryptVerifyResult;
class DecryptVerifyEMailController : public Controller {
Q_OBJECT
public:
explicit DecryptVerifyEMailController( QObject * parent=0 );
explicit DecryptVerifyEMailController( const boost::shared_ptr<const ExecutionContext> & cmd, QObject * parent=0 );
~DecryptVerifyEMailController();
void setInput( const boost::shared_ptr<Input> & input );
void setInputs( const std::vector<boost::shared_ptr<Input> > & inputs );
void setSignedData( const boost::shared_ptr<Input> & data );
void setSignedData( const std::vector<boost::shared_ptr<Input> > & data );
void setOutput( const boost::shared_ptr<Output> & output );
void setOutputs( const std::vector<boost::shared_ptr<Output> > & outputs );
void setInformativeSenders( const std::vector<KMime::Types::Mailbox> & senders );
void setWizardShown( bool shown );
void setOperation( DecryptVerifyOperation operation );
void setVerificationMode( VerificationMode vm );
void setProtocol( GpgME::Protocol protocol );
void setSessionId( unsigned int id );
void start();
public Q_SLOTS:
void cancel();
Q_SIGNALS:
void verificationResult( const GpgME::VerificationResult & );
private:
/* reimp */ void doTaskDone( const Task* task, const boost::shared_ptr<const Task::Result> & result );
class Private;
kdtools::pimpl_ptr<Private> d;
Q_PRIVATE_SLOT( d, void slotWizardCanceled() )
Q_PRIVATE_SLOT( d, void schedule() )
};
} //namespace Crypto
} //namespace Kleo
Q_DECLARE_METATYPE( GpgME::VerificationResult )
#endif // __KLEOPATRA_CTYPTO_DECRYPTVERIFYEMAILCONTROLLER_H__
|
/*
* COPYRIGHT: LGPL, See LGPL.txt in the top level directory
* PROJECT: ReactOS CRT library
* FILE: lib/sdk/crt/time/futime.c
* PURPOSE: Implementation of _futime
* PROGRAMERS: Wine team
*/
/*
* msvcrt.dll file functions
*
* Copyright 1996,1998 Marcus Meissner
* Copyright 1996 Jukka Iivonen
* Copyright 1997,2000 Uwe Bonnes
* Copyright 2000 Jon Griffiths
* Copyright 2004 Eric Pouech
* Copyright 2004 Juan Lang
*
* 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
*
* TODO
* Use the file flag hints O_SEQUENTIAL, O_RANDOM, O_SHORT_LIVED
*/
#include <precomp.h>
#define RC_INVOKED 1 // to prevent inline functions
#include <time.h>
#include <sys/utime.h>
#include "bitsfixup.h"
HANDLE fdtoh(int fd);
/******************************************************************************
* \name _futime
* \brief Set a file's modification time.
* \param [out] ptimeb Pointer to a structure of type struct _timeb that
* receives the current time.
* \sa http://msdn.microsoft.com/en-us/library/95e68951.aspx
*/
int
_futime(int fd, struct _utimbuf *filetime)
{
HANDLE handle;
FILETIME at, wt;
handle = fdtoh(fd);
if (handle == INVALID_HANDLE_VALUE)
{
return -1;
}
if (!filetime)
{
time_t currTime;
_time(&currTime);
RtlSecondsSince1970ToTime((ULONG)currTime,
(LARGE_INTEGER *)&at);
wt = at;
}
else
{
RtlSecondsSince1970ToTime((ULONG)filetime->actime,
(LARGE_INTEGER *)&at);
if (filetime->actime == filetime->modtime)
{
wt = at;
}
else
{
RtlSecondsSince1970ToTime((ULONG)filetime->modtime,
(LARGE_INTEGER *)&wt);
}
}
if (!SetFileTime(handle, NULL, &at, &wt))
{
_dosmaperr(GetLastError());
return -1 ;
}
return 0;
}
|
/*
* Copyright 2011-2013 Blender Foundation
*
* 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.
*/
CCL_NAMESPACE_BEGIN
/* Turbulence */
ccl_device_noinline float noise_turbulence(float3 p, float octaves, int hard)
{
float fscale = 1.0f;
float amp = 1.0f;
float sum = 0.0f;
int i, n;
octaves = clamp(octaves, 0.0f, 16.0f);
n = float_to_int(octaves);
for(i = 0; i <= n; i++) {
float t = noise(fscale*p);
if(hard)
t = fabsf(2.0f*t - 1.0f);
sum += t*amp;
amp *= 0.5f;
fscale *= 2.0f;
}
float rmd = octaves - floorf(octaves);
if(rmd != 0.0f) {
float t = noise(fscale*p);
if(hard)
t = fabsf(2.0f*t - 1.0f);
float sum2 = sum + t*amp;
sum *= ((float)(1 << n)/(float)((1 << (n+1)) - 1));
sum2 *= ((float)(1 << (n+1))/(float)((1 << (n+2)) - 1));
return (1.0f - rmd)*sum + rmd*sum2;
}
else {
sum *= ((float)(1 << n)/(float)((1 << (n+1)) - 1));
return sum;
}
}
CCL_NAMESPACE_END
|
/* xgettext Perl backend.
Copyright (C) 2002-2003, 2006, 2010, 2015 Free Software Foundation,
Inc.
Written by Guido Flohr <guido@imperia.net>, 2002-2003
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include "message.h"
#include "xgettext.h"
#ifdef __cplusplus
extern "C" {
#endif
#define EXTENSIONS_PERL \
{ "pl", "perl" }, \
{ "PL", "perl" }, \
{ "pm", "perl" }, \
{ "perl", "perl" }, \
{ "cgi", "perl" }, \
#define SCANNERS_PERL \
{ "perl", extract_perl, \
&flag_table_perl, &formatstring_perl, &formatstring_perl_brace, NULL }, \
/* Scan a Perl file and add its translatable strings to mdlp. */
extern void extract_perl (FILE *fp, const char *real_filename,
const char *logical_filename,
flag_context_list_table_ty *flag_table,
msgdomain_list_ty *mdlp);
extern void x_perl_keyword (const char *keyword);
extern void x_perl_extract_all (void);
extern void init_flag_table_perl (void);
#ifdef __cplusplus
}
#endif
|
/*******************************************************************************
License:
This software and/or related materials was developed at the National Institute
of Standards and Technology (NIST) by employees of the Federal Government
in the course of their official duties. Pursuant to title 17 Section 105
of the United States Code, this software is not subject to copyright
protection and is in the public domain.
This software and/or related materials have been determined to be not subject
to the EAR (see Part 734.3 of the EAR for exact details) because it is
a publicly available technology and software, and is freely distributed
to any interested party with no licensing requirements. Therefore, it is
permissible to distribute this software as a free download from the internet.
Disclaimer:
This software and/or related materials was developed to promote biometric
standards and biometric technology testing for the Federal Government
in accordance with the USA PATRIOT Act and the Enhanced Border Security
and Visa Entry Reform Act. Specific hardware and software products identified
in this software were used in order to perform the software development.
In no case does such identification imply recommendation or endorsement
by the National Institute of Standards and Technology, nor does it imply that
the products and equipment identified are necessarily the best available
for the purpose.
This software and/or related materials are provided "AS-IS" without warranty
of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
licensed product, however used. In no event shall NIST be liable for any
damages and/or costs, including but not limited to incidental or consequential
damages of any kind, including economic damage or injury to property and lost
profits, regardless of whether NIST shall be advised, have reason to know,
or in fact shall know of the possibility.
By using this software, you agree to bear all risk relating to quality,
use and performance of the software and/or related materials. You agree
to hold the Government harmless from any claim arising from your use
of the software.
*******************************************************************************/
/***********************************************************************
LIBRARY: AN2K - ANSI/NIST Reference Implementation
FILE: SEG.C
AUTHOR: Margaret Lepley
DATE: 3/12/2008
Contains routines for working with SEG structures found in Type-14
records.
***********************************************************************
ROUTINES:
lookup_type14_segments()
***********************************************************************/
#include <stdio.h>
#include <an2k.h>
#include <an2kseg.h>
#include <defs.h>
/*************************************************************************
**************************************************************************
#cat: lookup_type14_segments - Examines Type-14 record for any FINGER
#cat: SEGMENT POSITION and if found stores it in a SEG array.
Input:
record - Type-14 tagged field image record.
Output:
osegs - points to array of SEG structures
onsgs - number of SEG entries
Return Code:
Zero - successful completion
Negative - system error
**************************************************************************/
int lookup_type14_segments(SEG **osegs, int *onsgs, RECORD *record)
{
FIELD *field;
SUBFIELD *subfield;
int field_i, subfield_i;
SEG *segs;
int nsgs;
/* Check that record is Type-14 */
if(record->type != TYPE_14_ID) {
fprintf(stderr, "ERROR : lookup_type14_segments : "
"unsupported record type : Type-%d\n", record->type);
return(-2);
}
/* Find segment data ... */
if(!lookup_ANSI_NIST_field(&field, &field_i, SEG_ID, record)){
*onsgs = 0;
*osegs = (SEG *) NULL;
return(0);
}
else {
nsgs = field->num_subfields;
}
segs = (SEG *)malloc(nsgs * sizeof(SEG));
if(segs == NULL){
fprintf(stderr, "ERROR : lookup_type14_segments : "
"malloc : %d segs (%u bytes)\n", nsgs, nsgs * sizeof(SEG));
return(-3);
}
/* For each subfield in SEG field ... */
for(subfield_i = 0; subfield_i < nsgs; subfield_i++){
subfield = field->subfields[subfield_i];
segs[subfield_i].finger = atoi((char *)subfield->items[0]->value);
segs[subfield_i].left = atoi((char *)subfield->items[1]->value);
segs[subfield_i].right = atoi((char *)subfield->items[2]->value);
segs[subfield_i].top = atoi((char *)subfield->items[3]->value);
segs[subfield_i].bottom = atoi((char *)subfield->items[4]->value);
}
/* Set output pointers. */
*osegs = segs;
*onsgs = nsgs;
/* Return normally. */
return(0);
}
|
/*****************************************************************************
*
* XVID MPEG-4 VIDEO CODEC
* - GMC interpolation module header -
*
* Copyright(C) 2002-2003 Pascal Massimino <skal@planet-d.net>
*
* 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
*
* $Id: gmc.h,v 1.1.1.1 2005-07-13 14:36:14 jeanlf Exp $
*
****************************************************************************/
#include "portab.h"
#include "global.h"
#define RDIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
#define RSHIFT(a,b) ( (a)>0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b))
#define MLT(i) (((16-(i))<<16) + (i))
static const dword MTab[16] = {
MLT( 0), MLT( 1), MLT( 2), MLT( 3), MLT( 4), MLT( 5), MLT( 6), MLT( 7),
MLT( 8), MLT( 9), MLT(10), MLT(11), MLT(12), MLT(13), MLT(14), MLT(15)
};
#undef MLT
/* *************************************************************
* Warning! It's Accuracy being passed, not 'resolution'!
*/
void generate_GMCparameters(int nb_pts, int accuracy, const WARPPOINTS *pts, int width, int height, NEW_GMC_DATA *gmc);
|
#define ARDUINO_NANO
|
/****************************************************************/
/* 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 SHAPEUSEROBJECT_H
#define SHAPEUSEROBJECT_H
#include "Assembly.h"
#include "Coupleable.h"
#include "InputParameters.h"
#include "MooseVariable.h"
#include "MooseObject.h"
/**
* Users of this template class must specify the type of shape functions that
* will be used in the Jacobian calculation. Current options are for volume
* shape functions (specified with ShapeType::Element, accessed with _assembly.phi())
* and for surface shape functions (specified with ShapeType::Side, accessed with
* _assembly.phiFace())
*/
enum class ShapeType
{
Element,
Side
};
/**
* UserObject template class in which the _phi and _grad_phi shape function data
* is available and correctly initialized on EXEC_NONLINEAR (the Jacobian calculation).
* This enables the calculation of Jacobian matrix contributions inside a UO.
*
* \warning It is up to the user to ensure _fe_problem.currentlyComputingJacobian()
* returns true before utilizing the shape functions.
*/
template <typename T>
class ShapeUserObject : public T
{
public:
ShapeUserObject(const InputParameters & parameters, ShapeType type);
/// check if jacobian is to be computed in user objects
const bool & computeJacobianFlag() const { return _compute_jacobians; }
/**
* Returns the set of variables a Jacobian has been requested for
*/
const std::set<MooseVariable *> & jacobianMooseVariables() const
{
return _jacobian_moose_variables;
}
/**
* This function will be called with the shape functions for jvar initialized. It
* can be used to compute Jacobian contributions of the by implementing executeJacobian.
*/
virtual void executeJacobianWrapper(unsigned int jvar,
const std::vector<dof_id_type> & dof_indices);
static InputParameters validParams();
protected:
/**
* Implement this function to compute Jacobian terms for this UserObject. The
* shape function index _j and its corrsponding global DOF index _j_global
* will be provided.
*/
virtual void executeJacobian(unsigned int /*jvar*/) = 0;
/**
* Returns the index for a coupled variable by name and requests the computation
* of a Jacobian w.r.t. to this variable i.e. the call to executeJacobian() with
* shapefunctions initialized for this variable.
*/
virtual unsigned int coupled(const std::string & var_name, unsigned int comp = 0);
/// shape function values
const VariablePhiValue & _phi;
/// shape function gradients
const VariablePhiGradient & _grad_phi;
/// j-th index for enumerating the shape functions
unsigned int _j;
/// global DOF ID corresponding to _j
dof_id_type _j_global;
private:
const bool _compute_jacobians;
std::set<MooseVariable *> _jacobian_moose_variables;
};
template <typename T>
ShapeUserObject<T>::ShapeUserObject(const InputParameters & parameters, ShapeType type)
: T(parameters),
_phi(type == ShapeType::Element ? this->_assembly.phi() : this->_assembly.phiFace()),
_grad_phi(type == ShapeType::Element ? this->_assembly.gradPhi()
: this->_assembly.gradPhiFace()),
_compute_jacobians(MooseObject::getParam<bool>("compute_jacobians"))
{
mooseWarning("Jacobian calculation in UserObjects is an experimental capability with a "
"potentially unstable interface.");
}
template <typename T>
InputParameters
ShapeUserObject<T>::validParams()
{
InputParameters params = emptyInputParameters();
params.addParam<bool>("compute_jacobians", true, "Compute Jacobians for coupled variables");
params.addParamNamesToGroup("compute_jacobians", "Advanced");
return params;
}
template <typename T>
unsigned int
ShapeUserObject<T>::coupled(const std::string & var_name, unsigned int comp)
{
MooseVariable * var = Coupleable::getVar(var_name, comp);
// add to the set of variables for which executeJacobian will be called
if (_compute_jacobians && var->kind() == Moose::VAR_NONLINEAR)
_jacobian_moose_variables.insert(var);
// return the variable number
return T::coupled(var_name, comp);
}
template <typename T>
void
ShapeUserObject<T>::executeJacobianWrapper(unsigned int jvar,
const std::vector<dof_id_type> & dof_indices)
{
for (_j = 0; _j < _phi.size(); ++_j)
{
_j_global = dof_indices[_j];
executeJacobian(jvar);
}
}
#endif // SHAPEUSEROBJECT_H
|
/***********************************************************************
* pragmatics.h - inference engine pragmatics analysis
*
* The analysis of how to organize the fetching of metrics (pragmatics)
* and other parts of the inference engine that are particularly
* sensitive to details of the performance metrics API are kept here.
***********************************************************************
*
* Copyright (c) 1995 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PRAG_H
#define PRAG_H
#include "pmapi.h"
/* report where PCP data is coming from */
char *findsource(char *);
/* initialize performance metrics API */
void pmcsInit(void);
/* juggle contexts */
int newContext(char *);
/* initialize access to archive */
int initArchive(Archive *);
/* initialize timezone */
void zoneInit(void);
/* convert to canonical units */
pmUnits canon(pmUnits);
/* scale factor to canonical pmUnits */
double scale(pmUnits);
/* initialize Metric */
int initMetric(Metric *);
/* reinitialize Metric */
int reinitMetric(Metric *);
/* put initialiaed Metric onto fetch list */
void bundleMetric(Host *, Metric *);
/* reconnect attempt to host */
int reconnect(Host *);
/* pragmatics analysis */
void pragmatics(Symbol, RealTime);
/* execute fetches for given Task */
void taskFetch(Task *);
/* convert Expr value to pmValueSet value */
void fillVSet(Expr *, pmValueSet *);
/* send pmDescriptors for all expressions in given task */
void sendDescs(Task *);
/* put Metric onto wait list */
void waitMetric(Metric *);
/* remove Metric from wait list */
void unwaitMetric(Metric *);
/* check that pmUnits dimensions are equal */
#define dimeq(x, y) (((x).dimSpace == (y).dimSpace) && \
((x).dimTime == (y).dimTime) && \
((x).dimCount == (y).dimCount))
/* check equality of two pmUnits */
#define unieq(x, y) (((x).dimSpace == (y).dimSpace) && \
((x).dimTime == (y).dimTime) && \
((x).dimCount == (y).dimCount) && \
((x).scaleSpace == (y).scaleSpace) && \
((x).scaleTime == (y).scaleTime) && \
((x).scaleCount == (y).scaleCount))
/* for initialization of pmUnits struct */
extern pmUnits noUnits;
extern pmUnits countUnits;
/* flag processes spawned */
extern int need_wait;
#endif /* PRAG_H */
|
/* Feel free to use this example code in any way
you see fit (Public Domain) */
#include <sys/types.h>
#ifndef _WIN32
#include <sys/select.h>
#include <sys/socket.h>
#else
#include <winsock2.h>
#endif
#include <microhttpd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define PORT 8888
#define POSTBUFFERSIZE 512
#define MAXNAMESIZE 20
#define MAXANSWERSIZE 512
#define GET 0
#define POST 1
struct connection_info_struct
{
int connectiontype;
char *answerstring;
struct MHD_PostProcessor *postprocessor;
};
const char *askpage = "<html><body>\
What's your name, Sir?<br>\
<form action=\"/namepost\" method=\"post\">\
<input name=\"name\" type=\"text\">\
<input type=\"submit\" value=\" Send \"></form>\
</body></html>";
const char *greetingpage =
"<html><body><h1>Welcome, %s!</center></h1></body></html>";
const char *errorpage =
"<html><body>This doesn't seem to be right.</body></html>";
static int
send_page (struct MHD_Connection *connection, const char *page)
{
int ret;
struct MHD_Response *response;
response =
MHD_create_response_from_buffer (strlen (page), (void *) page,
MHD_RESPMEM_PERSISTENT);
if (!response)
return MHD_NO;
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
return ret;
}
static int
iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key,
const char *filename, const char *content_type,
const char *transfer_encoding, const char *data, uint64_t off,
size_t size)
{
struct connection_info_struct *con_info = coninfo_cls;
if (0 == strcmp (key, "name"))
{
if ((size > 0) && (size <= MAXNAMESIZE))
{
char *answerstring;
answerstring = malloc (MAXANSWERSIZE);
if (!answerstring)
return MHD_NO;
snprintf (answerstring, MAXANSWERSIZE, greetingpage, data);
con_info->answerstring = answerstring;
}
else
con_info->answerstring = NULL;
return MHD_NO;
}
return MHD_YES;
}
static void
request_completed (void *cls, struct MHD_Connection *connection,
void **con_cls, enum MHD_RequestTerminationCode toe)
{
struct connection_info_struct *con_info = *con_cls;
if (NULL == con_info)
return;
if (con_info->connectiontype == POST)
{
MHD_destroy_post_processor (con_info->postprocessor);
if (con_info->answerstring)
free (con_info->answerstring);
}
free (con_info);
*con_cls = NULL;
}
static int
answer_to_connection (void *cls, struct MHD_Connection *connection,
const char *url, const char *method,
const char *version, const char *upload_data,
size_t *upload_data_size, void **con_cls)
{
if (NULL == *con_cls)
{
struct connection_info_struct *con_info;
con_info = malloc (sizeof (struct connection_info_struct));
if (NULL == con_info)
return MHD_NO;
con_info->answerstring = NULL;
if (0 == strcmp (method, "POST"))
{
con_info->postprocessor =
MHD_create_post_processor (connection, POSTBUFFERSIZE,
iterate_post, (void *) con_info);
if (NULL == con_info->postprocessor)
{
free (con_info);
return MHD_NO;
}
con_info->connectiontype = POST;
}
else
con_info->connectiontype = GET;
*con_cls = (void *) con_info;
return MHD_YES;
}
if (0 == strcmp (method, "GET"))
{
return send_page (connection, askpage);
}
if (0 == strcmp (method, "POST"))
{
struct connection_info_struct *con_info = *con_cls;
if (*upload_data_size != 0)
{
MHD_post_process (con_info->postprocessor, upload_data,
*upload_data_size);
*upload_data_size = 0;
return MHD_YES;
}
else if (NULL != con_info->answerstring)
return send_page (connection, con_info->answerstring);
}
return send_page (connection, errorpage);
}
int
main ()
{
struct MHD_Daemon *daemon;
daemon = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY, PORT, NULL, NULL,
&answer_to_connection, NULL,
MHD_OPTION_NOTIFY_COMPLETED, request_completed,
NULL, MHD_OPTION_END);
if (NULL == daemon)
return 1;
(void) getchar ();
MHD_stop_daemon (daemon);
return 0;
}
|
/*
* Copyright (c) 2016 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ARM_CLOCK_CONTROL_H_
#define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ARM_CLOCK_CONTROL_H_
#include <clock_control.h>
/**
* @file
*
* @brief Clock subsystem IDs for ARM family SoCs
*/
/* CMSDK BUS Mapping */
enum arm_bus_type_t {
CMSDK_AHB = 0,
CMSDK_APB,
};
/* CPU States */
enum arm_soc_state_t {
SOC_ACTIVE = 0,
SOC_SLEEP,
SOC_DEEPSLEEP,
};
struct arm_clock_control_t {
/* ARM family SoCs supported Bus types */
enum arm_bus_type_t bus;
/* Clock can be configured for 3 states: Active, Sleep, Deep Sleep */
enum arm_soc_state_t state;
/* Identifies the device on the bus */
u32_t device;
};
#endif /* ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ARM_CLOCK_CONTROL_H_ */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_NETWORK
#import <Foundation/Foundation.h>
#import "TiProxy.h"
#import "TiBlob.h"
#import "NetworkModule.h"
@interface TiNetworkTCPSocketProxy : TiProxy {
CFSocketRef socket;
NSString* hostName;
int port;
NSMutableDictionary* remoteSocketDictionary; // remoteSocket->{inputStream, outputStream, writeBuffer, writePos}
NSCondition* configureCondition;
BOOL stripTerminator;
SocketMode mode;
CFRunLoopSourceRef socketRunLoop;
}
-(void)listen:(id)unused;
-(void)connect:(id)unused;
-(void)close:(id)unused;
-(void)write:(id)arg;
@property(readonly, nonatomic) NSString* hostName;
@property(readonly, nonatomic) NSNumber* port;
@property(readonly, nonatomic) NSNumber* mode;
@property(readonly, nonatomic, getter=isValid) NSNumber* valid;
@property(nonatomic, assign) NSNumber* stripTerminator;
@end
#endif |
#ifndef SC2_CODE_H
#define SC2_CODE_H
#include "expr.h"
Expr *read_code();
Expr *check_code(Expr *); // compute the type for the given code
Expr *run_code(Expr *);
int read_index();
extern bool dbg_prog;
extern bool run_scc;
#endif
|
/* $NetBSD: compat_getpwent.c,v 1.3 2009/06/01 06:04:37 yamt Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_getpwent.c,v 1.3 2009/06/01 06:04:37 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
#include "namespace.h"
#include <stdint.h>
#include <stdlib.h>
#include <pwd.h>
#include <compat/include/pwd.h>
__warn_references(getpwuid,
"warning: reference to compatibility getpwuid(); include <pwd.h> to generate correct reference")
__warn_references(getpwnam,
"warning: reference to compatibility getpwnam(); include <pwd.h> to generate correct reference")
__warn_references(getpwnam_r,
"warning: reference to compatibility getpwnam_r(); include <pwd.h> to generate correct reference")
__warn_references(getpwuid_r,
"warning: reference to compatibility getpwuid_r(); include <pwd.h> to generate correct reference")
__warn_references(getpwent,
"warning: reference to compatibility getpwent(); include <pwd.h> to generate correct reference")
#ifdef notdef /* for libutil */
__warn_references(pw_scan,
"warning: reference to compatibility pw_scan(); include <pwd.h> to generate correct reference")
#endif
__warn_references(getpwent_r,
"warning: reference to compatibility getpwent_r(); include <pwd.h> to generate correct reference")
__warn_references(pwcache_userdb,
"warning: reference to compatibility pwcache_userdb(); include <pwd.h> to generate correct reference")
#ifdef __weak_alias
__weak_alias(getpwent, _getpwent)
__weak_alias(getpwent_r, _getpwent_r)
__weak_alias(getpwuid, _getpwuid)
__weak_alias(getpwuid_r, _getpwuid_r)
__weak_alias(getpwnam, _getpwnam)
__weak_alias(getpwnam_r, _getpwnam_r)
__weak_alias(pwcache_userdb, _pwcache_userdb)
#endif
static struct passwd50 *
cvt(struct passwd *p)
{
struct passwd50 *q = (void *)p;
if (q == NULL) {
return NULL;
}
q->pw_change = (int32_t)p->pw_change;
q->pw_class = p->pw_class;
q->pw_gecos = p->pw_gecos;
q->pw_dir = p->pw_dir;
q->pw_shell = p->pw_shell;
q->pw_expire = (int32_t)p->pw_expire;
return q;
}
struct passwd50 *
getpwuid(uid_t uid)
{
return cvt(__getpwuid50(uid));
}
struct passwd50 *
getpwnam(const char *name)
{
return cvt(__getpwnam50(name));
}
int
getpwnam_r(const char *name , struct passwd50 *p, char *buf, size_t len,
struct passwd50 **q)
{
struct passwd px, *qx;
int rv = __getpwnam_r50(name, &px, buf, len, &qx);
*q = p;
passwd_to_passwd50(&px, p);
return rv;
}
int
getpwuid_r(uid_t uid, struct passwd50 *p, char *buf, size_t len,
struct passwd50 **q)
{
struct passwd px, *qx;
int rv = __getpwuid_r50(uid, &px, buf, len, &qx);
*q = p;
passwd_to_passwd50(&px, p);
return rv;
}
struct passwd50 *
getpwent(void)
{
return cvt(__getpwent50());
}
#ifdef notdef /* for libutil */
int
pw_scan(char *buf, struct passwd50 *p, int *flags)
{
struct passwd px;
int rv = __pw_scan50(buf, &px, flags);
passwd_to_passwd50(&px, p);
return rv;
}
#endif
int
getpwent_r(struct passwd50 *p, char *buf, size_t len, struct passwd50 **q)
{
struct passwd px, *qx;
int rv = __getpwent_r50(&px, buf, len, &qx);
*q = p;
passwd_to_passwd50(&px, p);
return rv;
}
static struct passwd50 * (*__getpwnamf)(const char *);
static struct passwd50 * (*__getpwuidf)(uid_t);
static struct passwd pw;
static struct passwd *
internal_getpwnam(const char *name)
{
struct passwd50 *p = (*__getpwnamf)(name);
passwd50_to_passwd(p, &pw);
return &pw;
}
static struct passwd *
internal_getpwuid(uid_t uid)
{
struct passwd50 *p = (*__getpwuidf)(uid);
passwd50_to_passwd(p, &pw);
return &pw;
}
int pwcache_userdb(int (*setpassentf)(int), void (*endpwentf)(void),
struct passwd50 * (*getpwnamf)(const char *),
struct passwd50 * (*getpwuidf)(uid_t))
{
__getpwnamf = getpwnamf;
__getpwuidf = getpwuidf;
return __pwcache_userdb50(setpassentf, endpwentf, internal_getpwnam,
internal_getpwuid);
}
|
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under both the Apache 2.0 license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
#pragma once
#include <osquery/enroll.h>
namespace osquery {
class TLSEnrollPlugin : public EnrollPlugin {
private:
/// Enroll called, return cached key or if no key cached, call requestKey.
std::string enroll() override;
private:
/// Request an enrollment key response from the TLS endpoint.
Status requestKey(const std::string& uri, std::string& node_key);
private:
friend class TLSEnrollTests;
};
}
|
/* Copyright (c) 2013, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file
*
* ODP memory barriers
*/
#ifndef ODP_API_SYNC_H_
#define ODP_API_SYNC_H_
#include <odp/visibility_begin.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup odp_barrier
* @details
* <b> Memory barriers </b>
*
* Memory barriers enforce ordering of memory load and store operations
* specified before and after the barrier. These barriers may affect both
* compiler optimizations and CPU out-of-order execution. All ODP
* synchronization mechanisms (e.g. execution barriers, locks, queues, etc )
* include all necessary memory barriers, so these calls are not needed when
* using those. Also ODP atomic operations have memory ordered versions. These
* explicit barriers may be needed when thread synchronization is based on
* a non-ODP defined mechanism. Depending on the HW platform, heavy usage of
* memory barriers may cause significant performance degradation.
*
* @{
*/
/**
* Memory barrier for release operations
*
* This memory barrier has release semantics. It synchronizes with a pairing
* barrier for acquire operations. The releasing and acquiring threads
* synchronize through shared memory. The releasing thread must call this
* barrier before signaling the acquiring thread. After the acquiring thread
* receives the signal, it must call odp_mb_acquire() before it reads the
* memory written by the releasing thread.
*
* This call is not needed when using ODP defined synchronization mechanisms.
*
* @see odp_mb_acquire()
*/
void odp_mb_release(void);
/**
* Memory barrier for acquire operations
*
* This memory barrier has acquire semantics. It synchronizes with a pairing
* barrier for release operations. The releasing and acquiring threads
* synchronize through shared memory. The releasing thread must call
* odp_mb_release() before signaling the acquiring thread. After the acquiring
* thread receives the signal, it must call this barrier before it reads the
* memory written by the releasing thread.
*
* This call is not needed when using ODP defined synchronization mechanisms.
*
* @see odp_mb_release()
*/
void odp_mb_acquire(void);
/**
* Full memory barrier
*
* This is a full memory barrier. It guarantees that all load and store
* operations specified before it are visible to other threads before
* all load and store operations specified after it.
*
* This call is not needed when using ODP defined synchronization mechanisms.
*/
void odp_mb_full(void);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#include <odp/visibility_end.h>
#endif
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2011, John Haddon. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided with
// the distribution.
//
// * Neither the name of John Haddon nor the names of
// any other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////
#ifndef GAFFERUIBINDINGS_CONNECTIONGADGETBINDING_H
#define GAFFERUIBINDINGS_CONNECTIONGADGETBINDING_H
namespace GafferUIBindings
{
void bindConnectionGadget();
} // namespace GafferUIBindings
#endif // GAFFERUIBINDINGS_CONNECTIONGADGETBINDING_H
|
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <semaphore.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include "md5.h"
#include "utils.h"
static const char MY_NAME[] = "Mrs. Conclusion";
// Set up a Mrs. Premise & Mrs. Conclusion conversation.
int main() {
sem_t *the_semaphore = NULL;
int rc;
char s[1024];
int i;
int done;
int fd;
void *pSharedMemory = NULL;
char last_message_i_wrote[256];
char md5ified_message[256];
struct param_struct params;
say(MY_NAME, "Oooo 'ello, I'm Mrs. Conclusion!");
read_params(¶ms);
// Mrs. Premise has already created the semaphore and shared memory.
// I just need to get handles to them.
the_semaphore = sem_open(params.semaphore_name, 0);
if (the_semaphore == SEM_FAILED) {
the_semaphore = NULL;
sprintf(s, "Getting a handle to the semaphore failed; errno is %d", errno);
say(MY_NAME, s);
}
else {
// get a handle to the shared memory
fd = shm_open(params.shared_memory_name, O_RDWR, params.permissions);
if (fd == -1) {
sprintf(s, "Couldn't get a handle to the shared memory; errno is %d", errno);
say(MY_NAME, s);
}
else {
// mmap it.
pSharedMemory = mmap((void *)0, (size_t)params.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (pSharedMemory == MAP_FAILED) {
sprintf(s, "MMapping the shared memory failed; errno is %d", errno);
say(MY_NAME, s);
}
else {
sprintf(s, "pSharedMemory = %p", pSharedMemory);
say(MY_NAME, s);
i = 0;
done = 0;
last_message_i_wrote[0] = '\0';
while (!done) {
sprintf(s, "iteration %d", i);
say(MY_NAME, s);
// Wait for Mrs. Premise to free up the semaphore.
rc = acquire_semaphore(MY_NAME, the_semaphore, params.live_dangerously);
if (rc)
done = 1;
else {
while ( (!rc) && \
(!strcmp((char *)pSharedMemory, last_message_i_wrote))
) {
// Nothing new; give Mrs. Premise another change to respond.
sprintf(s, "Read %zu characters '%s'", strlen((char *)pSharedMemory), (char *)pSharedMemory);
say(MY_NAME, s);
say(MY_NAME, "Releasing the semaphore");
rc = release_semaphore(MY_NAME, the_semaphore, params.live_dangerously);
if (!rc) {
say(MY_NAME, "Waiting to acquire the semaphore");
rc = acquire_semaphore(MY_NAME, the_semaphore, params.live_dangerously);
}
}
md5ify(last_message_i_wrote, md5ified_message);
// I always accept the first message (when i == 0)
if ( (i == 0) || (!strcmp(md5ified_message, (char *)pSharedMemory)) ) {
// All is well
i++;
if (i == params.iterations)
done = 1;
// MD5 the reply and write back to Mrs. Premise.
md5ify((char *)pSharedMemory, md5ified_message);
// Write back to Mrs. Premise.
sprintf(s, "Writing %zu characters '%s'", strlen(md5ified_message), md5ified_message);
say(MY_NAME, s);
strcpy((char *)pSharedMemory, md5ified_message);
strcpy(last_message_i_wrote, md5ified_message);
}
else {
sprintf(s, "Shared memory corruption after %d iterations.", i);
say(MY_NAME, s);
sprintf(s, "Mismatch; rc = %d, new message is '%s', expected '%s'.", rc, (char *)pSharedMemory, md5ified_message);
say(MY_NAME, s);
done = 1;
}
}
// Release the semaphore.
rc = release_semaphore(MY_NAME, the_semaphore, params.live_dangerously);
if (rc)
done = 1;
}
}
// Un-mmap the memory
rc = munmap(pSharedMemory, (size_t)params.size);
if (rc) {
sprintf(s, "Unmapping the memory failed; errno is %d", errno);
say(MY_NAME, s);
}
// Close the shared memory segment's file descriptor
if (-1 == close(fd)) {
sprintf(s, "Closing memory's file descriptor failed; errno is %d", errno);
say(MY_NAME, s);
}
}
rc = sem_close(the_semaphore);
if (rc) {
sprintf(s, "Closing the semaphore failed; errno is %d", errno);
say(MY_NAME, s);
}
}
return 0;
}
|
int a;
int main() {
int b;
a = 10;
b = 11;
return a + b;
}
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008-2011, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of Image Engine Design nor the names of any
// other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////
#ifndef IECOREMAYA_FROMMAYACURVECONVERTER_H
#define IECOREMAYA_FROMMAYACURVECONVERTER_H
#include "IECoreMaya/FromMayaShapeConverter.h"
#include "IECore/TypedParameter.h"
class MFnNurbsCurve;
namespace IECoreMaya
{
/// Converts maya curveShape objects into IECore::CurvesPrimitive objects.
/// \ingroup conversionGroup
class IECOREMAYA_API FromMayaCurveConverter : public FromMayaShapeConverter
{
public :
IE_CORE_DECLARERUNTIMETYPEDEXTENSION( FromMayaCurveConverter, FromMayaCurveConverterTypeId, FromMayaShapeConverter );
FromMayaCurveConverter( const MObject &object );
FromMayaCurveConverter( const MDagPath &dagPath );
IECore::BoolParameterPtr linearParameter();
IECore::ConstBoolParameterPtr linearParameter() const;
protected :
virtual IECoreScene::PrimitivePtr doPrimitiveConversion( const MObject &object, IECore::ConstCompoundObjectPtr operands ) const;
virtual IECoreScene::PrimitivePtr doPrimitiveConversion( const MDagPath &dagPath, IECore::ConstCompoundObjectPtr operands ) const;
private :
void constructCommon();
IECoreScene::PrimitivePtr doPrimitiveConversion( MFnNurbsCurve &fnCurve ) const;
static Description<FromMayaCurveConverter> m_description;
static Description<FromMayaCurveConverter> m_dataDescription;
IECore::BoolParameterPtr m_linearParameter;
};
IE_CORE_DECLAREPTR( FromMayaCurveConverter );
} // namespace IECoreMaya
#endif // IECOREMAYA_FROMMAYACURVECONVERTER_H
|
/*
* SimString similarity measures.
*
* Copyright (c) 2009,2010 Naoaki Okazaki
* 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 authors 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.
*/
/* $Id$ */
#ifndef __SIMSTRING_MEASURE_H__
#define __SIMSTRING_MEASURE_H__
#include <limits.h>
namespace simstring { namespace measure {
/**
* This class implements the traits of exact matching.
*/
struct exact
{
inline static int min_size(int qsize, double alpha)
{
return qsize;
}
inline static int max_size(int qsize, double alpha)
{
return qsize;
}
inline static int min_match(int qsize, int rsize, double alpha)
{
return qsize;
}
};
/**
* This class implements the traits of dice coefficient.
*/
struct dice
{
inline static int min_size(int qsize, double alpha)
{
return (int)std::ceil(alpha * qsize / (2. - qsize));
}
inline static int max_size(int qsize, double alpha)
{
return (int)std::floor((2. - alpha) * qsize / alpha);
}
inline static int min_match(int qsize, int rsize, double alpha)
{
return (int)std::ceil(0.5 * alpha * (qsize + rsize));
}
};
/**
* This class implements the traits of cosine coefficient.
*/
struct cosine
{
inline static int min_size(int qsize, double alpha)
{
return (int)std::ceil(alpha * alpha * qsize);
}
inline static int max_size(int qsize, double alpha)
{
return (int)std::floor(qsize / (alpha * alpha));
}
inline static int min_match(int qsize, int rsize, double alpha)
{
return (int)std::ceil(alpha * std::sqrt((double)qsize * rsize));
}
};
/**
* This class implements the traits of Jaccard coefficient.
*/
struct jaccard
{
inline static int min_size(int qsize, double alpha)
{
return (int)std::ceil(alpha * qsize);
}
inline static int max_size(int qsize, double alpha)
{
return (int)std::floor(qsize / alpha);
}
inline static int min_match(int qsize, int rsize, double alpha)
{
return (int)std::ceil(alpha * (qsize + rsize) / (1 + alpha));
}
};
/**
* This class implements the traits of overlap coefficient.
*/
struct overlap
{
inline static int min_size(int qsize, double alpha)
{
return 1;
}
inline static int max_size(int qsize, double alpha)
{
return (int)INT_MAX;
}
inline static int min_match(int qsize, int rsize, double alpha)
{
return (int)std::ceil(alpha * std::min(qsize, rsize));
}
};
}; };
#endif/*__SIMSTRING_MEASURE_H__*/
|
/*
* Copyright (c) 2014 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <string.h>
#include "native_client/src/include/minsfi_priv.h"
/*
* This is the memory base variable which the SFI-sandboxed pointers are
* treated relative to. It is defined in the trusted runtime, exported and then
* imported by the untrusted code via the compiler transforms. It is a 64-bit
* unsigned integer on both 32-bit and 64-bit platforms. See comments in the
* SandboxMemoryAccesses MinSFI LLVM pass for more details.
*/
uint64_t __sfi_memory_base = 0;
static MinsfiSandbox ActiveSandbox = { .mem_base = NULL };
MinsfiSandbox *MinsfiGetActiveSandbox(void) {
if (ActiveSandbox.mem_base != NULL)
return &ActiveSandbox;
else
return NULL;
}
void MinsfiSetActiveSandbox(const MinsfiSandbox *sb) {
if (sb != NULL)
memcpy(&ActiveSandbox, sb, sizeof(MinsfiSandbox));
else
ActiveSandbox.mem_base = NULL;
__sfi_memory_base = (uintptr_t) ActiveSandbox.mem_base;
}
|
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2010, Willow Garage, 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 Willow Garage, 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.
*
* $Id$
*
*/
#ifndef PCL_PCL_VISUALIZER_COMMON_IO_H_
#define PCL_PCL_VISUALIZER_COMMON_IO_H_
#include <pcl/visualization/common/actor_map.h>
#include <pcl/visualization/vtk.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/console/print.h>
namespace pcl
{
namespace visualization
{
/** \brief Obtain a list of corresponding indices, for a set of vtk points,
* from a pcl::PointCloud
* \param src the set of vtk points
* \param tgt the target pcl::PointCloud that we need to obtain indices from
* \param indices the resultant list of indices
* \ingroup visualization
*/
PCL_EXPORTS void
getCorrespondingPointCloud (vtkPolyData *src, const pcl::PointCloud<pcl::PointXYZ> &tgt, std::vector<int> &indices);
/** \brief Saves the vtk-formatted Point Cloud data into a set of files, based on whether
* the data comes from previously loaded PCD files. The PCD files are matched using the
* a list of names for the actors on screen.
* \param data the vtk data
* \param out_file the output file (extra indices will be appended to it)
* \param actors the list of actors present on screen
* \ingroup visualization
*/
PCL_EXPORTS bool
savePointData (vtkPolyData* data, const std::string &out_file, const boost::shared_ptr<CloudActorMap> &actors);
}
}
#endif
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_UTILITY_SANDBOX_DELEGATE_H_
#define CONTENT_BROWSER_UTILITY_SANDBOX_DELEGATE_H_
#include "base/command_line.h"
#include "base/environment.h"
#include "build/build_config.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "content/public/common/zygote/zygote_buildflags.h"
#include "sandbox/policy/mojom/sandbox.mojom.h"
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
#include "content/common/zygote/zygote_handle_impl_linux.h"
#endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
#if BUILDFLAG(IS_WIN)
#include "sandbox/win/src/sandbox_policy.h"
#endif // BUILDFLAG(IS_WIN)
namespace content {
class UtilitySandboxedProcessLauncherDelegate
: public SandboxedProcessLauncherDelegate {
public:
UtilitySandboxedProcessLauncherDelegate(sandbox::mojom::Sandbox sandbox_type,
const base::EnvironmentMap& env,
const base::CommandLine& cmd_line);
~UtilitySandboxedProcessLauncherDelegate() override;
sandbox::mojom::Sandbox GetSandboxType() override;
#if BUILDFLAG(IS_WIN)
bool GetAppContainerId(std::string* appcontainer_id) override;
bool DisableDefaultPolicy() override;
bool ShouldLaunchElevated() override;
bool PreSpawnTarget(sandbox::TargetPolicy* policy) override;
bool ShouldUnsandboxedRunInJob() override;
bool CetCompatible() override;
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
ZygoteHandle GetZygote() override;
#endif // BUILDFLAG(USE_ZYGOTE_HANDLE)
#if BUILDFLAG(IS_POSIX)
base::EnvironmentMap GetEnvironment() override;
#endif // BUILDFLAG(IS_POSIX)
private:
#if BUILDFLAG(IS_POSIX)
base::EnvironmentMap env_;
#endif // BUILDFLAG(IS_POSIX)
sandbox::mojom::Sandbox sandbox_type_;
base::CommandLine cmd_line_;
};
} // namespace content
#endif // CONTENT_BROWSER_UTILITY_SANDBOX_DELEGATE_H_
|
/*************************************************************************/
/* world.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* 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 WORLD_H
#define WORLD_H
#include "resource.h"
#include "servers/physics_server.h"
#include "servers/visual_server.h"
#include "servers/spatial_sound_server.h"
#include "scene/resources/environment.h"
class SpatialIndexer;
class Camera;
class VisibilityNotifier;
class World : public Resource {
OBJ_TYPE(World, Resource);
RES_BASE_EXTENSION("wrd");
private:
RID space;
RID scenario;
RID sound_space;
SpatialIndexer* indexer;
Ref<Environment> environment;
protected:
static void _bind_methods();
friend class Camera;
friend class VisibilityNotifier;
void _register_camera(Camera* p_camera);
void _update_camera(Camera* p_camera);
void _remove_camera(Camera* p_camera);
void _register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect);
void _update_notifier(VisibilityNotifier *p_notifier,const AABB& p_rect);
void _remove_notifier(VisibilityNotifier* p_notifier);
friend class Viewport;
void _update(uint64_t p_frame);
public:
RID get_space() const;
RID get_scenario() const;
RID get_sound_space() const;
void set_environment(const Ref<Environment>& p_environment);
Ref<Environment> get_environment() const;
World();
~World();
};
#endif // WORLD_H
|
/*!
@file
@author Albert Semenov
@date 08/2008
@module
*/
#ifndef STATISTIC_INFO_H_
#define STATISTIC_INFO_H_
#include <MyGUI.h>
namespace diagnostic
{
class StatisticInfo
{
public:
StatisticInfo() :
mInfo(nullptr),
mOffset(20, 20)
{
const std::string layer = "Statistic";
if (!MyGUI::LayerManager::getInstance().isExist(layer))
return;
mInfo = MyGUI::Gui::getInstance().createWidget<MyGUI::TextBox>("TextBox", MyGUI::IntCoord(), MyGUI::Align::Default, layer);
mInfo->setTextColour(MyGUI::Colour::White);
mInfo->setTextShadow(true);
}
~StatisticInfo()
{
if (mInfo != nullptr)
{
MyGUI::Gui::getInstance().destroyChildWidget(mInfo);
mInfo = nullptr;
}
}
template <typename T>
void change(const std::string& _key, const T& _value)
{
for (MyGUI::VectorStringPairs::iterator iter = mParams.begin(); iter != mParams.end(); ++iter)
{
if (iter->first == _key)
{
iter->second = MyGUI::utility::toString<T>(_value);
return;
}
}
mParams.push_back(std::make_pair(_key, MyGUI::utility::toString<T>(_value)));
}
void remove(const std::string& _key)
{
for (MyGUI::VectorStringPairs::iterator iter = mParams.begin(); iter != mParams.end(); ++iter)
{
if (iter->first == _key)
{
mParams.erase(iter);
return;
}
}
}
void update()
{
if (mInfo != nullptr)
{
std::ostringstream stream;
for (MyGUI::VectorStringPairs::iterator iter = mParams.begin(); iter != mParams.end(); ++iter)
{
if (iter != mParams.begin()) stream << "\n";
stream << iter->first << " : " << iter->second;
}
mInfo->setCaption(stream.str());
MyGUI::ISubWidgetText* text = mInfo->getSubWidgetText();
if (text != nullptr)
{
const MyGUI::IntSize& size = text->getTextSize() + mInfo->getSize() - text->getSize();
const MyGUI::IntSize& size_view = MyGUI::RenderManager::getInstance().getViewSize();
MyGUI::IntCoord coord(size_view.width - size.width - mOffset.left, size_view.height - size.height - mOffset.top, size.width, size.height);
if (coord != mInfo->getCoord())
mInfo->setCoord(coord);
}
}
}
void clear()
{
mParams.clear();
}
void clear(const std::string& _key)
{
for (MyGUI::VectorStringPairs::iterator iter = mParams.begin(); iter != mParams.end(); ++iter)
{
if (iter->first == _key)
{
mParams.erase(iter);
return;
}
}
}
void setVisible(bool _value)
{
if (mInfo != nullptr)
mInfo->setVisible(_value);
}
bool getVisible()
{
if (mInfo != nullptr)
return mInfo->getVisible();
return false;
}
void setOffset(const MyGUI::IntPoint& _value)
{
mOffset = _value;
}
private:
MyGUI::TextBox* mInfo;
MyGUI::VectorStringPairs mParams;
MyGUI::IntPoint mOffset;
};
} // namespace diagnostic
#endif // STATISTIC_INFO_H_
|
#pragma once
#include <reflectionzeug/property/AbstractTypedProperty.h>
#include <reflectionzeug/property/AbstractBooleanInterface.h>
namespace reflectionzeug
{
/**
* @brief
* Property implementation for type bool
*/
template <typename T>
class PropertyBool : public AbstractTypedProperty<T>, public AbstractBooleanInterface
{
public:
/**
* @brief
* Constructor
*/
template <typename... Args>
PropertyBool(Args&&... args);
/**
* @brief
* Destructor
*/
virtual ~PropertyBool();
/**
* @brief
* Toggle boolean value
*/
void toggleValue();
// Virtual AbstractBooleanInterface interface
virtual bool toBool() const override;
virtual bool fromBool(bool value) override;
// Virtual AbstractProperty interface
virtual std::string toString() const override;
virtual bool fromString(const std::string & string) override;
virtual void accept(AbstractVisitor * visitor) override;
};
} // namespace reflectionzeug
#include <reflectionzeug/property/PropertyBool.hpp>
|
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2014 Torus Knot Software Ltd
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 __CompositorPassQuadDef_H__
#define __CompositorPassQuadDef_H__
#include "OgreHeaderPrefix.h"
#include "../OgreCompositorPassDef.h"
#include "OgreCommon.h"
namespace Ogre
{
class CompositorNodeDef;
/** \addtogroup Core
* @{
*/
/** \addtogroup Effects
* @{
*/
class _OgreExport CompositorPassQuadDef : public CompositorPassDef
{
public:
struct QuadTextureSource
{
/// Index of texture unit state to change
size_t texUnitIdx;
/// Name of the texture (can come from input channel, local textures, or global ones)
IdString textureName;
/// Index in case of MRT. Ignored if textureSource isn't mrt
size_t mrtIndex;
QuadTextureSource( size_t _texUnitIdx, IdString _textureName, size_t _mrtIndex ) :
texUnitIdx( _texUnitIdx ), textureName( _textureName ), mrtIndex( _mrtIndex ) {}
};
typedef vector<QuadTextureSource>::type TextureSources;
protected:
TextureSources mTextureSources;
CompositorNodeDef *mParentNodeDef;
public:
enum FrustumCorners
{
NO_CORNERS,
VIEW_SPACE_CORNERS,
WORLD_SPACE_CORNERS,
};
/** Whether to use a full screen quad or triangle. (default: false). Note that you may not
always get the triangle (for example, if you ask for WORLD_SPACE_CORNERS)
*/
bool mUseQuad;
/** When true, the user is telling Ogre this pass just performs a custom FSAA resolve filter.
Hence we should skip this pass for those APIs that don't support explicit resolving
TODO: Not really implemented yet!!!
@remarks
@See TextureDefinitionBase::TextureDefinition::fsaaExplicitResolve
*/
bool mIsResolve;
String mMaterialName;
/** Type of frustum corners to pass in the quad normals.
mCameraName contains which camera's frustum to pass
*/
FrustumCorners mFrustumCorners;
IdString mCameraName;
CompositorPassQuadDef( CompositorNodeDef *parentNodeDef, uint32 rtIndex ) :
CompositorPassDef( PASS_QUAD, rtIndex ),
mParentNodeDef( parentNodeDef ),
mUseQuad( false ),
mIsResolve( false ),
mFrustumCorners( NO_CORNERS )
{
}
/** Indicates the pass to change the texture units to use the specified texture sources.
@See QuadTextureSource for params
*/
void addQuadTextureSource( size_t texUnitIdx, const String &textureName, size_t mrtIndex );
const TextureSources& getTextureSources(void) const { return mTextureSources; }
};
/** @} */
/** @} */
}
#include "OgreHeaderSuffix.h"
#endif
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Android\0.19.3\.cache\GeneratedCode\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Controls.TextBlock.h>
#include <Uno.UX.ITemplate.h>
#include <Uno.UX.Template-1.h>
namespace g{namespace Fuse{namespace Android{struct NativeStyle__Template;}}}
namespace g{namespace Fuse{namespace Android{struct NativeStyle__Template__Template1;}}}
namespace g{
namespace Fuse{
namespace Android{
// public partial sealed class NativeStyle.Template.Template1 :14
// {
::g::Uno::UX::Template_type* NativeStyle__Template__Template1_typeof();
void NativeStyle__Template__Template1__ctor_1_fn(NativeStyle__Template__Template1* __this, ::g::Fuse::Android::NativeStyle__Template* parent);
void NativeStyle__Template__Template1__New1_fn(::g::Fuse::Android::NativeStyle__Template* parent, NativeStyle__Template__Template1** __retval);
void NativeStyle__Template__Template1__OnApply_fn(NativeStyle__Template__Template1* __this, ::g::Fuse::Controls::TextBlock* self);
struct NativeStyle__Template__Template1 : ::g::Uno::UX::Template
{
uStrong< ::g::Fuse::Android::NativeStyle__Template*> __parent1;
void ctor_1(::g::Fuse::Android::NativeStyle__Template* parent);
static NativeStyle__Template__Template1* New1(::g::Fuse::Android::NativeStyle__Template* parent);
};
// }
}}} // ::g::Fuse::Android
|
/*++
/* NAME
/* nvtable 3
/* SUMMARY
/* attribute list manager
/* SYNOPSIS
/* #include <nvtable.h>
/*
/* typedef struct {
/* .in +4
/* char *key;
/* char *value;
/* /* private fields... */
/* .in -4
/* } NVTABLE_INFO;
/*
/* NVTABLE *nvtable_create(size)
/* int size;
/*
/* NVTABLE_INFO *nvtable_update(table, key, value)
/* NVTABLE *table;
/* const char *key;
/* const char *value;
/*
/* char *nvtable_find(table, key)
/* NVTABLE *table;
/* const char *key;
/*
/* NVTABLE_INFO *nvtable_locate(table, key)
/* NVTABLE *table;
/* const char *key;
/*
/* void nvtable_delete(table, key)
/* NVTABLE *table;
/* const char *key;
/*
/* void nvtable_free(table)
/* NVTABLE *table;
/*
/* void nvtable_walk(table, action, ptr)
/* NVTABLE *table;
/* void (*action)(NVTABLE_INFO *, char *ptr);
/* char *ptr;
/*
/* NVTABLE_INFO **nvtable_list(table)
/* NVTABLE *table;
/* DESCRIPTION
/* This module maintains one or more attribute lists. It provides a
/* more convenient interface than hash tables, although it uses the
/* same underlying implementation. Each attribute list entry consists
/* of a unique string-valued lookup key and a string value.
/*
/* nvtable_create() creates a table of the specified size and returns a
/* pointer to the result.
/*
/* nvtable_update() stores or updates a (key, value) pair in the specified
/* table and returns a pointer to the resulting entry. The key and the
/* value are copied.
/*
/* nvtable_find() returns the value that was stored under the given key,
/* or a null pointer if it was not found. In order to distinguish
/* a null value from a non-existent value, use nvtable_locate().
/*
/* nvtable_locate() returns a pointer to the entry that was stored
/* for the given key, or a null pointer if it was not found.
/*
/* nvtable_delete() removes one entry that was stored under the given key.
/*
/* nvtable_free() destroys a hash table, including contents.
/*
/* nvtable_walk() invokes the action function for each table entry, with
/* a pointer to the entry as its argument. The ptr argument is passed
/* on to the action function.
/*
/* nvtable_list() returns a null-terminated list of pointers to
/* all elements in the named table. The list should be passed to
/* myfree().
/* RESTRICTIONS
/* A callback function should not modify the attribute list that is
/* specified to its caller.
/* DIAGNOSTICS
/* The following conditions are reported and cause the program to
/* terminate immediately: memory allocation failure; an attempt
/* to delete a non-existent entry.
/* SEE ALSO
/* mymalloc(3) memory management wrapper
/* htable(3) hash table manager
/* LICENSE
/* .ad
/* .fi
/* The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
/* C library */
#include <sys_defs.h>
/* Utility library. */
#include <mymalloc.h>
#include <htable.h>
#include <nvtable.h>
/* nvtable_update - update or enter (key, value) pair */
NVTABLE_INFO *nvtable_update(NVTABLE * table, const char *key, const char *value)
{
NVTABLE_INFO *ht;
if ((ht = htable_locate(table, key)) != 0) {
myfree(ht->value);
} else {
ht = htable_enter(table, key, (void *) 0);
}
ht->value = mystrdup(value);
return (ht);
}
|
/*
* Copyright (c) 2003, 2007-11 Matteo Frigo
* Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
*
* 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
*
*/
/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Sat Apr 28 11:05:06 EDT 2012 */
#include "codelet-rdft.h"
#ifdef HAVE_FMA
/* Generated by: ../../../genfft/gen_hc2cdft_c.native -fma -reorder-insns -schedule-for-pipeline -simd -compact -variables 4 -pipeline-latency 8 -trivial-stores -variables 32 -no-generate-bytw -n 2 -dit -name hc2cfdftv_2 -include hc2cfv.h */
/*
* This function contains 5 FP additions, 6 FP multiplications,
* (or, 3 additions, 4 multiplications, 2 fused multiply/add),
* 9 stack variables, 1 constants, and 4 memory accesses
*/
#include "hc2cfv.h"
static void hc2cfdftv_2(R *Rp, R *Ip, R *Rm, R *Im, const R *W, stride rs, INT mb, INT me, INT ms)
{
DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
{
INT m;
for (m = mb, W = W + ((mb - 1) * ((TWVL / VL) * 2)); m < me; m = m + VL, Rp = Rp + (VL * ms), Ip = Ip + (VL * ms), Rm = Rm - (VL * ms), Im = Im - (VL * ms), W = W + (TWVL * 2), MAKE_VOLATILE_STRIDE(rs)) {
V T1, T2, T4, T3, T5, T7, T6;
T1 = LD(&(Rp[0]), ms, &(Rp[0]));
T2 = LD(&(Rm[0]), -ms, &(Rm[0]));
T4 = LDW(&(W[0]));
T3 = VFMACONJ(T2, T1);
T5 = VZMULIJ(T4, VFNMSCONJ(T2, T1));
T7 = VCONJ(VMUL(LDK(KP500000000), VADD(T3, T5)));
T6 = VMUL(LDK(KP500000000), VSUB(T3, T5));
ST(&(Rm[0]), T7, -ms, &(Rm[0]));
ST(&(Rp[0]), T6, ms, &(Rp[0]));
}
}
VLEAVE();
}
static const tw_instr twinstr[] = {
VTW(1, 1),
{TW_NEXT, VL, 0}
};
static const hc2c_desc desc = { 2, XSIMD_STRING("hc2cfdftv_2"), twinstr, &GENUS, {3, 4, 2, 0} };
void XSIMD(codelet_hc2cfdftv_2) (planner *p) {
X(khc2c_register) (p, hc2cfdftv_2, &desc, HC2C_VIA_DFT);
}
#else /* HAVE_FMA */
/* Generated by: ../../../genfft/gen_hc2cdft_c.native -simd -compact -variables 4 -pipeline-latency 8 -trivial-stores -variables 32 -no-generate-bytw -n 2 -dit -name hc2cfdftv_2 -include hc2cfv.h */
/*
* This function contains 5 FP additions, 4 FP multiplications,
* (or, 5 additions, 4 multiplications, 0 fused multiply/add),
* 10 stack variables, 1 constants, and 4 memory accesses
*/
#include "hc2cfv.h"
static void hc2cfdftv_2(R *Rp, R *Ip, R *Rm, R *Im, const R *W, stride rs, INT mb, INT me, INT ms)
{
DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
{
INT m;
for (m = mb, W = W + ((mb - 1) * ((TWVL / VL) * 2)); m < me; m = m + VL, Rp = Rp + (VL * ms), Ip = Ip + (VL * ms), Rm = Rm - (VL * ms), Im = Im - (VL * ms), W = W + (TWVL * 2), MAKE_VOLATILE_STRIDE(rs)) {
V T4, T6, T1, T3, T2, T5, T7, T8;
T1 = LD(&(Rp[0]), ms, &(Rp[0]));
T2 = LD(&(Rm[0]), -ms, &(Rm[0]));
T3 = VCONJ(T2);
T4 = VADD(T1, T3);
T5 = LDW(&(W[0]));
T6 = VZMULIJ(T5, VSUB(T3, T1));
T7 = VCONJ(VMUL(LDK(KP500000000), VSUB(T4, T6)));
ST(&(Rm[0]), T7, -ms, &(Rm[0]));
T8 = VMUL(LDK(KP500000000), VADD(T4, T6));
ST(&(Rp[0]), T8, ms, &(Rp[0]));
}
}
VLEAVE();
}
static const tw_instr twinstr[] = {
VTW(1, 1),
{TW_NEXT, VL, 0}
};
static const hc2c_desc desc = { 2, XSIMD_STRING("hc2cfdftv_2"), twinstr, &GENUS, {5, 4, 0, 0} };
void XSIMD(codelet_hc2cfdftv_2) (planner *p) {
X(khc2c_register) (p, hc2cfdftv_2, &desc, HC2C_VIA_DFT);
}
#endif /* HAVE_FMA */
|
/*
Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
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.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ABSTRACT_DUMP_TASK_INCLUDED
#define ABSTRACT_DUMP_TASK_INCLUDED
#include "abstract_simple_dump_task.h"
#include "abstract_data_object.h"
#include "i_callable.h"
#include "base/mutex.h"
#include <vector>
namespace Mysql{
namespace Tools{
namespace Dump{
/**
Base class for most individual dump process tasks, not suitable for
lightweight dump tasks (e.g. Row).
*/
class Abstract_dump_task : public Abstract_simple_dump_task
{
public:
Abstract_dump_task(Abstract_data_object* related_object);
virtual ~Abstract_dump_task();
I_data_object* get_related_db_object() const;
std::vector<const Abstract_dump_task*> get_dependencies() const;
std::vector<Abstract_dump_task*> get_dependents() const;
void add_dependency(Abstract_dump_task* dependency);
bool can_be_executed() const;
void set_completed();
/**
Registers callback to be called once this task is able to be executed.
*/
void register_execution_availability_callback(
Mysql::I_callable<void, const Abstract_dump_task*>* availability_callback);
private:
void check_execution_availability();
Abstract_data_object* m_related_object;
std::vector<const Abstract_dump_task*> m_dependencies;
std::vector<Abstract_dump_task*> m_dependents;
std::vector<Mysql::I_callable<void, const Abstract_dump_task*>*>
m_availability_callbacks;
my_boost::mutex m_task_mutex;
};
}
}
}
#endif
|
//
// Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
//
// Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
//
// This file is part of the VNC system.
//
// The VNC system 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.
//
// If the source code for the VNC system is not available from the place
// whence you received this file, check http://www.uk.research.att.com/vnc or contact
// the authors on vnc@uk.research.att.com for information on obtaining it.
// rfb.h
// This includes the rfb spec header, the port numbers,
// the CARD type definitions and various useful macros.
//
#ifndef RFB_H__
#define RFB_H__
// Define the CARD* types as used in X11/Xmd.h
typedef unsigned long CARD32;
typedef unsigned short CARD16;
typedef short INT16;
typedef unsigned char CARD8;
// Define the port number offsets
#define FLASH_PORT_OFFSET 5400
#define INCOMING_PORT_OFFSET 5500
#define HTTP_PORT_OFFSET 5800 // we don't use this in Venice
#define RFB_PORT_OFFSET 5900
#define PORT_TO_DISPLAY(p) ( (p) - RFB_PORT_OFFSET )
#define DISPLAY_TO_PORT(d) ( (d) + RFB_PORT_OFFSET )
// include the protocol spec
#include <rfb/rfbproto.h>
// define some quick endian conversions
// change this if necessary
#define LITTLE_ENDIAN_HOST
#ifdef LITTLE_ENDIAN_HOST
#define Swap16IfLE(s) \
((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)))
#define Swap32IfLE(l) \
((CARD32) ((((l) & 0xff000000) >> 24) | \
(((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \
(((l) & 0x000000ff) << 24)))
#else
#define Swap16IfLE(s) (s)
#define Swap32IfLE(l) (l)
#endif
#endif
|
/*
SESC: Super ESCalar simulator
Copyright (C) 2003 University of Illinois.
Contributed by Jose Renau
This file is part of SESC.
SESC 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.
SESC 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
SESC; see the file COPYING. If not, write to the Free Software Foundation, 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LDSTBUFFER_H
#define LDSTBUFFER_H
#include "estl.h"
#include "nanassert.h"
#include "Snippets.h"
#include "DInst.h"
#include "callback.h"
#include "ThreadContext.h"
/** Load Store Buffer class
*
* This class enforces dependences between load and store, by tracking the store
* addresses.
*
* Acquire, Release, and MemFence dependences are also enforced in this class.
*/
class LDSTBuffer {
private:
typedef HASH_MAP<VAddr,DInst *,VAddr_hash> EntryType;
typedef HASH_MAP<int32_t, DInst*> FenceEntryType;
static EntryType stores;
static FenceEntryType fences;
// pendingBarrier can be an Acquire or a MemFence, NOT a Release. Releases are
// like a store.
static DInst *pendingBarrier;
static VAddr calcWord(const DInst *dinst) {
// Just remove the two lower bits
return (dinst->getVaddr()) >> 2;
}
public:
/** Get an entry from the LDSTQueue
*
* Store, Acquire, MemFence would occupy an entry in this
* structure.
*/
/* getEntry called at rename time for FetchOp, memFence, Acquire, and
* Release
*/
static void getFenceEntry(DInst *dinst);
static void fenceLocallyPerformed(DInst *dinst);
/** Store gets an entry in the LDSTBuffer
*
* The request is in the same order than the instructions are fetched.
*
*/
static void getStoreEntry(DInst *dinst);
/** Loads check for an entry in the LDSTBuffer
*
* The request is in the same order than the instructions are feched.
*
*/
static void getLoadEntry(DInst *dinst);
static void storeLocallyPerformed(DInst *dinst);
static void dump(const char *str);
};
#endif // LDSTBUFFER_H
|
/**
* $Id$
*
* Public interface for dreamcast.c -
* Central switchboard for the system. This pulls all the individual modules
* together into some kind of coherent structure. This is also where you'd
* add Naomi support, if I ever get a board to play with...
*
* Copyright (c) 2005 Nathan Keynes.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef lxdream_dreamcast_H
#define lxdream_dreamcast_H 1
#include <stdio.h>
#include "lxdream.h"
#ifdef __cplusplus
extern "C" {
#endif
#define DEFAULT_TIMESLICE_LENGTH 1000000 /* nanoseconds */
#define XLAT_NEW_CACHE_SIZE 40 MB
#define XLAT_TEMP_CACHE_SIZE 2 MB
#define XLAT_OLD_CACHE_SIZE 8 MB
struct lxdream_config_group; // Forward declaration
void dreamcast_configure(gboolean use_bootrom);
void dreamcast_configure_aica_only(void);
void dreamcast_init(gboolean use_bootrom);
void dreamcast_reset(void);
void dreamcast_run(void);
void dreamcast_set_run_time( unsigned int seconds, unsigned int nanosecs );
void dreamcast_set_exit_on_stop( gboolean flag );
void dreamcast_stop(void);
void dreamcast_shutdown(void);
gboolean dreamcast_is_running(void);
gboolean dreamcast_config_changed(void *data, struct lxdream_config_group *group, unsigned item,
const gchar *oldval, const gchar *newval);
/**
* Return if it's possible to start the VM - currently this requires
* a) A configured system
* b) Some code to run (either a user program or a ROM)
*/
gboolean dreamcast_can_run(void);
/**
* Notify the VM that a program (ELF or other binary) has been loaded.
*
*/
void dreamcast_program_loaded( const gchar *name, sh4addr_t entry_point );
#define DREAMCAST_SAVE_MAGIC "%!-lxDream!Save\0"
#define DREAMCAST_SAVE_VERSION 0x00010006
int dreamcast_save_state( const gchar *filename );
int dreamcast_load_state( const gchar *filename );
/* Quick saves */
#define MAX_QUICK_STATE 9
#define QUICK_STATE_FILENAME "%s/quicksave%d.dst"
void dreamcast_quick_save();
void dreamcast_quick_load();
unsigned int dreamcast_get_quick_state();
void dreamcast_set_quick_state( unsigned int state );
gboolean dreamcast_has_quick_state( unsigned int state );
/**
* Load the front-buffer image from the specified file.
* If the file is not a valid save state, returns NULL. Otherwise,
* returns a newly allocated frame_buffer that should be freed
* by the caller. (The data buffer is contained within the
* allocation and does not need to be freed separately)
*/
frame_buffer_t dreamcast_load_preview( const gchar *filename );
gboolean dreamcast_load_fakebios();
#define SCENE_SAVE_MAGIC "%!-lxDream!Scene"
#define SCENE_SAVE_VERSION 0x00010000
extern unsigned char dc_main_ram[];
extern unsigned char dc_boot_rom[];
extern unsigned char dc_flash_ram[];
#ifdef __cplusplus
}
#endif
#endif /* !lxdream_dreamcast_H */
|
#ifndef __ATE_H__
#define __ATE_H__
#ifdef LINUX
#define ate_print printk
#define ATEDBGPRINT DBGPRINT
#ifdef RTMP_MAC_USB
#define EEPROM_SIZE 0x400
#ifdef CONFIG_STA_SUPPORT
#define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2870STA/e2p.bin"
#endif // CONFIG_STA_SUPPORT //
#endif // RTMP_MAC_USB //
#endif // LINUX //
#define ATE_ON(_p) (((_p)->ate.Mode) != ATE_STOP)
#ifdef RTMP_MAC_USB
#define ATE_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV)
#define ATE_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V)
#define BULK_OUT_LOCK(pLock, IrqFlags) \
if(1 /*!(in_interrupt() & 0xffff0000)*/) \
RTMP_IRQ_LOCK((pLock), IrqFlags);
#define BULK_OUT_UNLOCK(pLock, IrqFlags) \
if(1 /*!(in_interrupt() & 0xffff0000)*/) \
RTMP_IRQ_UNLOCK((pLock), IrqFlags);
#ifdef LINUX
// Prototypes of completion funuc.
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#define ATE_RTUSBBulkOutDataPacketComplete(purb, pt_regs) ATE_RTUSBBulkOutDataPacketComplete(purb)
#endif
#endif // LINUX //
VOID ATE_RTUSBBulkOutDataPacketComplete(
IN purbb_t purb,
OUT struct pt_regs *pt_regs);
VOID ATE_RTUSBBulkOutDataPacket(
IN PRTMP_ADAPTER pAd,
IN UCHAR BulkOutPipeId);
VOID ATE_RTUSBCancelPendingBulkInIRP(
IN PRTMP_ADAPTER pAd);
VOID ATEResetBulkIn(
IN PRTMP_ADAPTER pAd);
INT ATEResetBulkOut(
IN PRTMP_ADAPTER pAd);
#endif // RTMP_MAC_USB //
#ifdef RTMP_RF_RW_SUPPORT
#define ATE_RF_IO_READ8_BY_REG_ID(_A, _I, _pV) RT30xxReadRFRegister(_A, _I, _pV)
#define ATE_RF_IO_WRITE8_BY_REG_ID(_A, _I, _V) RT30xxWriteRFRegister(_A, _I, _V)
#endif // RTMP_RF_RW_SUPPORT //
VOID rt_ee_read_all(
IN PRTMP_ADAPTER pAd,
OUT USHORT *Data);
VOID rt_ee_write_all(
IN PRTMP_ADAPTER pAd,
IN USHORT *Data);
INT Set_ATE_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_DA_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_SA_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_BSSID_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_CHANNEL_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_POWER0_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_POWER1_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_Antenna_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_RX_Antenna_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_FREQOFFSET_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_BW_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_LENGTH_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_COUNT_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_MCS_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_MODE_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_TX_GI_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_RX_FER_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Read_RF_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
#ifndef RTMP_RF_RW_SUPPORT
INT Set_ATE_Write_RF1_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Write_RF2_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Write_RF3_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Write_RF4_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
#endif // RTMP_RF_RW_SUPPORT //
INT Set_ATE_Load_E2P_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Read_E2P_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Show_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_ATE_Help_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
#ifdef RALINK_28xx_QA
VOID ATE_QA_Statistics(
IN PRTMP_ADAPTER pAd,
IN PRXWI_STRUC pRxWI,
IN PRT28XX_RXD_STRUC p28xxRxD,
IN PHEADER_802_11 pHeader);
VOID RtmpDoAte(
IN PRTMP_ADAPTER pAdapter,
IN struct iwreq *wrq);
VOID BubbleSort(
IN INT32 n,
IN INT32 a[]);
VOID CalNoiseLevel(
IN PRTMP_ADAPTER pAdapter,
IN UCHAR channel,
OUT INT32 buffer[3][10]);
BOOLEAN SyncTxRxConfig(
IN PRTMP_ADAPTER pAdapter,
IN USHORT offset,
IN UCHAR value);
INT Set_TxStop_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_RxStop_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
#ifdef DBG
INT Set_EERead_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_EEWrite_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_BBPRead_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_BBPWrite_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
INT Set_RFWrite_Proc(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg);
#endif // DBG //
#endif // RALINK_28xx_QA //
VOID ATEAsicSwitchChannel(
IN PRTMP_ADAPTER pAd);
VOID ATEDisableAsicProtect(
IN PRTMP_ADAPTER pAd);
CHAR ATEConvertToRssi(
IN PRTMP_ADAPTER pAd,
IN CHAR Rssi,
IN UCHAR RssiNumber);
VOID ATESampleRssi(
IN PRTMP_ADAPTER pAd,
IN PRXWI_STRUC pRxWI);
#ifdef CONFIG_STA_SUPPORT
VOID RTMPStationStop(
IN PRTMP_ADAPTER pAd);
VOID RTMPStationStart(
IN PRTMP_ADAPTER pAd);
#endif // CONFIG_STA_SUPPORT //
#endif // __ATE_H__ //
|
/*
* aym.h
* Misc. functions
* AYM 1999-03-15
*/
/*
This file is part of Yadex.
Yadex incorporates code from DEU 5.21 that was put in the public domain in
1994 by Raphaël Quinet and Brendon Wyber.
The rest of Yadex is Copyright © 1997-2003 André Majorel and others.
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 YH_AYM /* DO NOT INSERT ANYTHING BEFORE THIS LINE */
#define YH_AYM
int levelname2levelno (const char *name);
int levelname2rank (const char *name);
const char *spec_path (const char *spec);
int fncmp (const char *name1, const char *name2);
int is_absolute (const char *filename);
int y_stricmp (const char *s1, const char *s2);
int y_strnicmp (const char *s1, const char *s2, size_t len);
int y_snprintf (char *buf, size_t size, const char *fmt, ...);
int y_vsnprintf (char *buf, size_t size, const char *fmt, va_list args);
void y_strupr (char *string);
int is_one_of (const char *needle, ...);
bool file_exists (const char *);
void y_filename (char *buf, size_t size, const char *path);
/*
* within
* Is <value> >= <lower_bound> and <= <upper_bound> ?
*/
inline int within (int value, int lower_bound, int upper_bound)
{
return value >= lower_bound && value <= upper_bound;
}
/*
* outside
* Is <value> < <lower_bound> or > <upper_bound> ?
*/
inline int outside (int value, int lower_bound, int upper_bound)
{
return value < lower_bound || value > upper_bound;
}
/*
* dectoi
* If <c> is a decimal digit ("[0-9]"), return its value.
* Else, return a negative number.
*/
inline int dectoi (char c)
{
if (isdigit ((unsigned char) c))
return c - '0';
else
return -1;
}
/*
* hextoi
* If <c> is a hexadecimal digit ("[0-9A-Fa-f]"), return its value.
* Else, return a negative number.
*/
inline int hextoi (char c)
{
if (isdigit ((unsigned char) c))
return c - '0';
else if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
else if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
else
return -1;
}
/*
* b36toi
* If <c> is a base 36 digit ("[0-9A-Za-z]"), return its value.
* Else, return a negative number.
*/
inline int b36toi (char c)
{
if (isdigit ((unsigned char) c))
return c - '0';
else if (islower (c))
return c - 'a' + 10;
else if (isupper (c))
return c - 'A' + 10;
else
return -1;
}
/*
* y_isident - return true iff <c> is one of a-z, A-Z, 0-9 or "_".
*
* Intentionally not using isalpha() and co. because I
* don't want the results to depend on the locale.
*/
inline bool y_isident (char c)
{
switch (c)
{
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
case 's': case 't': case 'u': case 'v': case 'w': case 'x':
case 'y': case 'z':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
case 'Y': case 'Z':
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
case '_':
return true;
default:
return false;
}
}
/*
* fnewline
* Write a newline to a binary file. For Unix, LF. For
* other platforms, CR LF.
* Return EOF on failure.
*/
inline int fnewline (FILE *fd)
{
#ifdef Y_UNIX
return putc ('\n', fd);
#else
return putc ('\r', fd), putc ('\n', fd);
#endif
}
/*
* round_up
* Round a value up to the next multiple of quantum.
*
* Both the value and the quantum are supposed to be positive.
*/
inline void round_up (int& value, int quantum)
{
value = ((value + quantum - 1) / quantum) * quantum;
}
/*
* y_isprint
* Is <c> a printable character in ISO-8859-1 ?
*/
inline bool y_isprint (char c)
{
return (c & 0x60) && (c != 0x7f);
}
#endif /* DO NOT ADD ANYTHING AFTER THIS LINE */
|
/* SPDX-License-Identifier: GPL-2.0-only */
#include <fsp/util.h>
#include <soc/meminit.h>
#include <soc/romstage.h>
void mainboard_memory_init_params(FSPM_UPD *mupd)
{
const struct mb_cfg board_cfg = {
.type = MEM_TYPE_DDR4,
};
const struct mem_spd spd_info = {
.topo = MEM_TOPO_DIMM_MODULE,
.smbus = {
[0] = { .addr_dimm[0] = 0x50, },
[1] = { .addr_dimm[0] = 0x52, },
},
};
const bool half_populated = false;
memcfg_init(&mupd->FspmConfig, &board_cfg, &spd_info, half_populated);
}
|
/***********************************************************************
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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.
***********************************************************************/
#ifndef FC__CHATLINE_H
#define FC__CHATLINE_H
#include <gtk/gtk.h>
/* client */
#include "chatline_g.h"
void chatline_init(void);
void inputline_make_chat_link(struct tile *ptile, bool unit);
bool inputline_has_focus(void);
void inputline_grab_focus(void);
bool inputline_is_visible(void);
void set_output_window_text(const char *text);
bool chatline_is_scrolled_to_bottom(void);
void chatline_scroll_to_bottom(bool delayed);
void set_message_buffer_view_link_handlers(GtkWidget *view);
GtkWidget *inputline_toolkit_view_new(void);
void inputline_toolkit_view_append_button(GtkWidget *toolkit_view,
GtkWidget *button);
void apply_text_tag(const struct text_tag *ptag, GtkTextBuffer *buf,
ft_offset_t text_start_offset, const char *text);
void scroll_if_necessary(GtkTextView *textview, GtkTextMark *scroll_target);
#endif /* FC__CHATLINE_H */
|
/* Native-dependent definitions for ARM running NetBSD, for GDB.
Copyright 1986, 1987, 1989, 1992, 1994, 1999 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 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 NM_NBSDAOUT_H
#define NM_NBSDAOUT_H
#include "config/nm-nbsd.h"
/* Get generic NetBSD a.out native definitions. */
#include "config/nm-nbsdaout.h"
#endif /* NM_NBSDAOUT_H */
|
/*
* "$Id: fl_call_main.c 5848 2007-05-20 16:18:31Z mike $"
*
* Copyright 1998-2005 by Bill Spitzak and others.
*
* fl_call_main() calls main() for you Windows people. Needs to be done in C
* because Borland C++ won't let you call main() from C++.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
* Please report all bugs and problems on the following page:
*
* http://www.fltk.org/str.php
*/
/*
* This WinMain() function can be overridden by an application and
* is provided for compatibility with programs written for other
* operating systems that conform to the ANSI standard entry point
* "main()". This will allow you to build a WIN32 Application
* without any special settings.
*
* Because of problems with the Microsoft Visual C++ header files
* and/or compiler, you cannot have a WinMain function in a DLL.
* I don't know why. Thus, this nifty feature is only available
* if you link to the static library.
*
* Currently the debug version of this library will create a
* console window for your application so you can put printf()
* statements for debugging or informational purposes. Ultimately
* we want to update this to always use the parent's console,
* but at present we have not identified a function or API in
* Microsoft(r) Windows(r) that allows for it.
*/
#if defined(WIN32) && !defined(FL_DLL) && !defined (__GNUC__)
# include <windows.h>
# include <stdio.h>
# include <stdlib.h>
# ifdef __MWERKS__
# include <crtl.h>
# endif
extern int main(int, char *[]);
# ifdef BORLAND5
# define __argc _argc
# define __argv _argv
# endif /* BORLAND5 */
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {
int rc;
# ifdef _DEBUG
/*
* If we are using compiling in debug mode, open a console window so
* we can see any printf's, etc...
*
* While we can detect if the program was run from the command-line -
* look at the CMDLINE environment variable, it will be "WIN" for
* programs started from the GUI - the shell seems to run all WIN32
* applications in the background anyways...
*/
AllocConsole();
freopen("conin$", "r", stdin);
freopen("conout$", "w", stdout);
freopen("conout$", "w", stderr);
# endif /* _DEBUG */
/* Run the standard main entry point function... */
rc = main(__argc, __argv);
# ifdef _DEBUG
fclose(stdin);
fclose(stdout);
fclose(stderr);
# endif /* _DEBUG */
return rc;
}
#elif defined(__hpux)
/* This code to prevent "empty translation unit" or similar warnings... */
static void dummy(void) {}
#endif // WIN32 && !FL_DLL && !__GNUC__
/*
* End of "$Id: fl_call_main.c 5848 2007-05-20 16:18:31Z mike $".
*/
|
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <linux/types.h>
#include "missing_btrfs.h"
/* linux@db6711600e27c885aed89751f04e727f3af26715 (4.7) */
#if HAVE_LINUX_BTRFS_TREE_H
#include <linux/btrfs_tree.h>
#else
#define BTRFS_ROOT_TREE_OBJECTID 1
#define BTRFS_QUOTA_TREE_OBJECTID 8
#define BTRFS_FIRST_FREE_OBJECTID 256
#define BTRFS_LAST_FREE_OBJECTID -256ULL
#define BTRFS_ROOT_ITEM_KEY 132
#define BTRFS_ROOT_BACKREF_KEY 144
#define BTRFS_QGROUP_STATUS_KEY 240
#define BTRFS_QGROUP_INFO_KEY 242
#define BTRFS_QGROUP_LIMIT_KEY 244
#define BTRFS_QGROUP_RELATION_KEY 246
struct btrfs_disk_key {
__le64 objectid;
__u8 type;
__le64 offset;
} __attribute__ ((__packed__));
struct btrfs_timespec {
__le64 sec;
__le32 nsec;
} __attribute__ ((__packed__));
struct btrfs_inode_item {
__le64 generation;
__le64 transid;
__le64 size;
__le64 nbytes;
__le64 block_group;
__le32 nlink;
__le32 uid;
__le32 gid;
__le32 mode;
__le64 rdev;
__le64 flags;
__le64 sequence;
__le64 reserved[4];
struct btrfs_timespec atime;
struct btrfs_timespec ctime;
struct btrfs_timespec mtime;
struct btrfs_timespec otime;
} __attribute__ ((__packed__));
#define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0)
struct btrfs_root_item {
struct btrfs_inode_item inode;
__le64 generation;
__le64 root_dirid;
__le64 bytenr;
__le64 byte_limit;
__le64 bytes_used;
__le64 last_snapshot;
__le64 flags;
__le32 refs;
struct btrfs_disk_key drop_progress;
__u8 drop_level;
__u8 level;
__le64 generation_v2;
__u8 uuid[BTRFS_UUID_SIZE];
__u8 parent_uuid[BTRFS_UUID_SIZE];
__u8 received_uuid[BTRFS_UUID_SIZE];
__le64 ctransid; /* updated when an inode changes */
__le64 otransid; /* trans when created */
__le64 stransid; /* trans when sent. non-zero for received subvol */
__le64 rtransid; /* trans when received. non-zero for received subvol */
struct btrfs_timespec ctime;
struct btrfs_timespec otime;
struct btrfs_timespec stime;
struct btrfs_timespec rtime;
__le64 reserved[8]; /* for future */
} __attribute__ ((__packed__));
struct btrfs_root_ref {
__le64 dirid;
__le64 sequence;
__le16 name_len;
} __attribute__ ((__packed__));
#define BTRFS_QGROUP_LEVEL_SHIFT 48
struct btrfs_qgroup_info_item {
__le64 generation;
__le64 rfer;
__le64 rfer_cmpr;
__le64 excl;
__le64 excl_cmpr;
} __attribute__ ((__packed__));
struct btrfs_qgroup_limit_item {
__le64 flags;
__le64 max_rfer;
__le64 max_excl;
__le64 rsv_rfer;
__le64 rsv_excl;
} __attribute__ ((__packed__));
#endif
|
/*
* Adium is the legal property of its developers, whose names are listed in the copyright file included
* with this source distribution.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <Adium/AIContentControllerProtocol.h>
@interface CBActionSupportPlugin : AIPlugin <AIHTMLContentFilter, AIContentFilter>{}
@end
|
union indir {
int data; // always odd
union indir *next; // always even
};
union indir *a; // an array
int foo() {
int i, acc = 0;
for(i=0;i<100;i++) {
union indir e = a[i];
while(e.data % 2 == 0) e = * e.next;
acc += (e.data >> 1);
}
return acc;
}
|
/*
* Copyright (C) 2007 Casey Schaufler <casey@schaufler-ca.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, version 2.
*
* Author:
* Casey Schaufler <casey@schaufler-ca.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#ifdef HAVE_LINUX_NETLINK_H
#include <linux/netlink.h>
#endif
#include <sys/xattr.h>
int main(int argc, char *argv[])
{
char message[256];
char *anin = "security.SMACK64IPIN";
char *anout = "security.SMACK64IPOUT";
char *annot = "security.SMACK64IPNOT";
char *avin = "TheOne";
char *avout = "TheOther";
char *avnot = "TheBadValue";
int sock;
int rc;
if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
sprintf(message, "%s Socket creation failure", argv[0]);
perror(message);
exit(1);
}
rc = fsetxattr(sock, anin, avin, strlen(avin) + 1, 0);
if (rc < 0) {
sprintf(message, "%s fsetxattr of %s to %s failure",
argv[0], anin, avin);
perror(message);
exit(1);
}
rc = fsetxattr(sock, anout, avout, strlen(avout) + 1, 0);
if (rc < 0) {
sprintf(message, "%s fsetxattr of %s to %s failure",
argv[0], anout, avout);
perror(message);
exit(1);
}
rc = fsetxattr(sock, annot, avnot, strlen(avnot) + 1, 0);
if (rc >= 0) {
sprintf(message, "%s fsetxattr of %s to %s succeeded in error",
argv[0], anout, avout);
perror(message);
exit(1);
}
exit(0);
}
|
#include <openssl/ssl.h>
#define LOG_TAG "SSL_ctrl_stub"
#include <log/log.h>
long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg) {
ALOGD("SSL_ctrl: ssl=%p cmd=%d larg=%ld parg=%p", ssl, cmd, larg, parg);
return -1;
}
long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) {
ALOGD("SSL_CTX_ctrl: ctx=%p cmd=%d larg=%ld parg=%p", ctx, cmd, larg, parg);
return -1;
}
void CRYPTO_free(void *str) {
free(str);
}
void *CRYPTO_malloc(int num, const char *file, int line) {
ALOGD("CRYPTO_malloc: num=%d file=%s line=%d", num, file, line);
return malloc(num);
}
void CRYPTO_lock(int mode, int type, const char *file, int line) {
ALOGD("CRYPTO_lock: mode=%d type=%d file=%s line=%d", mode, type, file, line);
}
|
/* sd2snes - SD card based universal cartridge for the SNES
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
This file was adapted from sd2iec, written by Ingo Korb.
Original copyright header follows:
*/
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
Inspiration and low-level SD/MMC access based on code from MMC2IEC
by Lars Pontoppidan et al., see sdcard.c|h and config.h.
FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License only.
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
uart.h: Definitions for the UART access routines
*/
#ifndef UART_H
#define UART_H
#ifdef CONFIG_UART_DEBUG
#include <avr/pgmspace.h>
void uart_init(void);
unsigned char uart_getc(void);
void uart_putc(char c);
void uart_puthex(uint8_t num);
void uart_puthexlong(uint32_t num);
void uart_puthexshort(uint16_t num);
void uart_trace(void *ptr, uint16_t start, uint16_t len);
void uart_flush(void);
void uart_puts_P(prog_char *text);
void uart_putcrlf(void);
#include <stdio.h>
#define dprintf(str,...) printf_P(PSTR(str), ##__VA_ARGS__)
#else
#define uart_init() do {} while(0)
#define uart_getc() 0
#define uart_putc(x) do {} while(0)
#define uart_puthex(x) do {} while(0)
#define uart_flush() do {} while(0)
#define uart_puts_P(x) do {} while(0)
#define uart_putcrlf() do {} while(0)
#define uart_trace(a,b,c) do {} while(0)
#endif
#endif
|
/*
* Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/Executor.h>
namespace folly {
/// When work is "queued", execute it immediately inline.
/// Usually when you think you want this, you actually want a
/// QueuedImmediateExecutor.
class InlineExecutor : public Executor {
public:
void add(Func f) override {
f();
}
};
}
|
#ifndef ASEMANAUDIOENCODERSETTINGS_H
#define ASEMANAUDIOENCODERSETTINGS_H
#include <QObject>
#include <QVariant>
#include <QMultimedia>
class QAudioEncoderSettings;
class AsemanAudioEncoderSettingsPrivate;
class AsemanAudioEncoderSettings : public QObject
{
Q_OBJECT
Q_ENUMS(EncodingQuality)
Q_ENUMS(EncodingMode)
Q_PROPERTY(int bitRate READ bitRate WRITE setBitRate NOTIFY bitRateChanged)
Q_PROPERTY(int channelCount READ channelCount WRITE setChannelCount NOTIFY channelCountChanged)
Q_PROPERTY(QString codec READ codec WRITE setCodec NOTIFY codecChanged)
Q_PROPERTY(int encodingMode READ encodingMode WRITE setEncodingMode NOTIFY encodingModeChanged)
Q_PROPERTY(QVariantMap encodingOptions READ encodingOptions WRITE setEncodingOptions NOTIFY encodingOptionsChanged)
Q_PROPERTY(int quality READ quality WRITE setQuality NOTIFY qualityChanged)
Q_PROPERTY(int sampleRate READ sampleRate WRITE setSampleRate NOTIFY sampleRateChanged)
public:
enum EncodingQuality
{
VeryLowQuality = QMultimedia::VeryLowQuality,
LowQuality = QMultimedia::LowQuality,
NormalQuality = QMultimedia::NormalQuality,
HighQuality = QMultimedia::HighQuality,
VeryHighQuality = QMultimedia::VeryHighQuality
};
enum EncodingMode
{
ConstantQualityEncoding = QMultimedia::ConstantQualityEncoding,
ConstantBitRateEncoding = QMultimedia::ConstantBitRateEncoding,
AverageBitRateEncoding = QMultimedia::AverageBitRateEncoding,
TwoPassEncoding = QMultimedia::TwoPassEncoding
};
AsemanAudioEncoderSettings(QObject *parent = 0);
~AsemanAudioEncoderSettings();
int bitRate() const;
void setBitRate(int rate);
int channelCount() const;
void setChannelCount(int channels);
QString codec() const;
void setCodec(const QString & codec);
int encodingMode() const;
void setEncodingMode(int mode);
QVariantMap encodingOptions() const;
void setEncodingOptions(const QVariantMap & options);
int quality() const;
void setQuality(int quality);
int sampleRate() const;
void setSampleRate(int rate);
QAudioEncoderSettings exportSettings() const;
signals:
void bitRateChanged();
void channelCountChanged();
void codecChanged();
void encodingModeChanged();
void encodingOptionsChanged();
void qualityChanged();
void sampleRateChanged();
private:
AsemanAudioEncoderSettingsPrivate *p;
};
#endif // ASEMANAUDIOENCODERSETTINGS_H
|
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file CTF.h
/// \author ruben.shahoyan@cern.ch
/// \brief Definitions for PHOS CTF data
#ifndef O2_PHS_CTF_H
#define O2_PHS_CTF_H
#include <vector>
#include <Rtypes.h>
#include "DetectorsCommonDataFormats/EncodedBlocks.h"
#include "DataFormatsPHOS/TriggerRecord.h"
#include "DataFormatsPHOS/Cell.h"
namespace o2
{
namespace phos
{
/// Header for a single CTF
struct CTFHeader : public o2::ctf::CTFDictHeader {
uint32_t nTriggers = 0; /// number of triggers
uint32_t nCells = 0; /// number of referred cells
uint32_t firstOrbit = 0; /// orbit of 1st trigger
uint16_t firstBC = 0; /// bc of 1st trigger
ClassDefNV(CTFHeader, 2);
};
/// wrapper for the Entropy-encoded triggers and cells of the TF
struct CTF : public o2::ctf::EncodedBlocks<CTFHeader, 7, uint32_t> {
static constexpr size_t N = getNBlocks();
enum Slots { BLC_bcIncTrig,
BLC_orbitIncTrig,
BLC_entriesTrig,
BLC_packedID,
BLC_time,
BLC_energy,
BLC_status
};
ClassDefNV(CTF, 1);
};
} // namespace phos
} // namespace o2
#endif
|
/*
*
* Copyright (c) 2007 by Christian Dietrich <stettberger@dokucode.de>
* Copyright (c) 2008 by Stefan Siegl <stesie@brokenpipe.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* For more information on the GPL, please go to:
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef _NAMED_PIN_H
#define _NAMED_PIN_H
#include "config.h"
#ifdef NAMED_PIN_SUPPORT
#include "user_config.h"
void named_pin_init(void);
#ifdef PORTIO_SUPPORT
struct PinConfiguration {
uint8_t port, pin;
uint8_t input;
uint8_t active_high;
const char *name;
};
uint8_t named_pin_by_name(const char *name);
uint8_t named_pin_by_pin(uint8_t port, uint8_t pin);
extern const struct PinConfiguration portio_pincfg[];
#endif /* PORTIO_SUPPORT */
#endif /* NAMED_PIN_SUPPORT */
#endif /* _NAMED_PIN_H */
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: mods/deathmatch/logic/packets/CVehiclePuresyncPacket.h
* PURPOSE: Vehicle pure synchronization packet class
* DEVELOPERS: Christian Myhre Lundheim <>
* Jax <>
* Cecill Etheredge <>
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __PACKETS_CVEHICLEPURESYNCPACKET_H
#define __PACKETS_CVEHICLEPURESYNCPACKET_H
#include "CCommon.h"
#include "CPacket.h"
#include "CPlayer.h"
class CVehicle;
class CVehiclePuresyncPacket : public CPacket
{
public:
inline CVehiclePuresyncPacket ( void ) {};
inline explicit CVehiclePuresyncPacket ( class CPlayer* pPlayer ) { m_pSourceElement = pPlayer; };
inline ePacketID GetPacketID ( void ) const { return PACKET_ID_PLAYER_VEHICLE_PURESYNC; };
inline unsigned long GetFlags ( void ) const { return PACKET_LOW_PRIORITY | PACKET_SEQUENCED; };
bool Read ( NetBitStreamInterface& BitStream );
bool Write ( NetBitStreamInterface& BitStream ) const;
private:
void ReadVehicleSpecific ( class CVehicle* pVehicle, NetBitStreamInterface& BitStream );
void WriteVehicleSpecific ( class CVehicle* pVehicle, NetBitStreamInterface& BitStream ) const;
};
#endif
|
/* statistics/gsl_statistics_uchar.h
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000 Jim Davies, Brian Gough
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __GSL_STATISTICS_UCHAR_H__
#define __GSL_STATISTICS_UCHAR_H__
#include <stddef.h>
#include <gsl/gsl_types.h>
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
GSL_EXPORT double gsl_stats_uchar_mean (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_variance (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_sd (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_variance_with_fixed_mean (const unsigned char data[], const size_t stride, const size_t n, const double mean);
GSL_EXPORT double gsl_stats_uchar_sd_with_fixed_mean (const unsigned char data[], const size_t stride, const size_t n, const double mean);
GSL_EXPORT double gsl_stats_uchar_absdev (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_skew (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_kurtosis (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_lag1_autocorrelation (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_covariance (const unsigned char data1[], const size_t stride1,const unsigned char data2[], const size_t stride2, const size_t n);
GSL_EXPORT double gsl_stats_uchar_variance_m (const unsigned char data[], const size_t stride, const size_t n, const double mean);
GSL_EXPORT double gsl_stats_uchar_sd_m (const unsigned char data[], const size_t stride, const size_t n, const double mean);
GSL_EXPORT double gsl_stats_uchar_absdev_m (const unsigned char data[], const size_t stride, const size_t n, const double mean);
GSL_EXPORT double gsl_stats_uchar_skew_m_sd (const unsigned char data[], const size_t stride, const size_t n, const double mean, const double sd);
GSL_EXPORT double gsl_stats_uchar_kurtosis_m_sd (const unsigned char data[], const size_t stride, const size_t n, const double mean, const double sd);
GSL_EXPORT double gsl_stats_uchar_lag1_autocorrelation_m (const unsigned char data[], const size_t stride, const size_t n, const double mean);
GSL_EXPORT double gsl_stats_uchar_covariance_m (const unsigned char data1[], const size_t stride1,const unsigned char data2[], const size_t stride2, const size_t n, const double mean1, const double mean2);
GSL_EXPORT double gsl_stats_uchar_pvariance (const unsigned char data1[], const size_t stride1, const size_t n1, const unsigned char data2[], const size_t stride2, const size_t n2);
GSL_EXPORT double gsl_stats_uchar_ttest (const unsigned char data1[], const size_t stride1, const size_t n1, const unsigned char data2[], const size_t stride2, const size_t n2);
GSL_EXPORT unsigned char gsl_stats_uchar_max (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT unsigned char gsl_stats_uchar_min (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT void gsl_stats_uchar_minmax (unsigned char * min, unsigned char * max, const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT size_t gsl_stats_uchar_max_index (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT size_t gsl_stats_uchar_min_index (const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT void gsl_stats_uchar_minmax_index (size_t * min_index, size_t * max_index, const unsigned char data[], const size_t stride, const size_t n);
GSL_EXPORT double gsl_stats_uchar_median_from_sorted_data (const unsigned char sorted_data[], const size_t stride, const size_t n) ;
GSL_EXPORT double gsl_stats_uchar_quantile_from_sorted_data (const unsigned char sorted_data[], const size_t stride, const size_t n, const double f) ;
__END_DECLS
#endif /* __GSL_STATISTICS_UCHAR_H__ */
|
/*
* Virtual memory layout of ARM systems.
*/
#ifndef __MEMLAYOUT_H__
#define __MEMLAYOUT_H__
#ifndef __ASSEMBLY__
#include L4LIB_INC_GLUE(memory.h)
#endif
#define KERNEL_AREA_START 0xF0000000
#define KERNEL_AREA_END 0xF8000000 /* 128 MB */
#define KERNEL_AREA_SIZE (KERNEL_AREA_END - KERNEL_AREA_START)
#define KERNEL_AREA_SECTIONS (KERNEL_AREA_SIZE / ARM_SECTION_SIZE)
#define UTCB_SIZE (sizeof(int) * 64)
#define IO_AREA_START 0xF9000000
#define IO_AREA_END 0xFF000000
#define IO_AREA_SIZE (IO_AREA_END - IO_AREA_START)
#define IO_AREA_SECTIONS (IO_AREA_SIZE / ARM_SECTION_SIZE)
#define USER_KIP_PAGE 0xFF000000
/* ARM-specific offset in KIP that tells the address of UTCB page */
#define UTCB_KIP_OFFSET 0x50
#define IO_AREA0_VADDR IO_AREA_START
#define IO_AREA1_VADDR (IO_AREA_START + (SZ_1MB*1))
#define IO_AREA2_VADDR (IO_AREA_START + (SZ_1MB*2))
#define IO_AREA3_VADDR (IO_AREA_START + (SZ_1MB*3))
#define IO_AREA4_VADDR (IO_AREA_START + (SZ_1MB*4))
#define IO_AREA5_VADDR (IO_AREA_START + (SZ_1MB*5))
#define IO_AREA6_VADDR (IO_AREA_START + (SZ_1MB*6))
#define IO_AREA7_VADDR (IO_AREA_START + (SZ_1MB*7))
/*
* IO_AREA8_VADDR
* The beginning page in this slot is used for userspace uart mapping
*/
#define ARM_HIGH_VECTOR 0xFFFF0000
#define ARM_SYSCALL_VECTOR 0xFFFFFF00
#if !defined(__LINUX_CONTAINER__)
#define KERNEL_OFFSET (KERNEL_AREA_START - PLATFORM_PHYS_MEM_START)
#endif
/* User tasks define them differently */
#if defined (__KERNEL__) && !defined(__LINUX_CONTAINER__)
#define phys_to_virt(addr) ((unsigned int)(addr) + KERNEL_OFFSET)
#define virt_to_phys(addr) ((unsigned int)(addr) - KERNEL_OFFSET)
#endif
#define KERN_ADDR(x) ((x >= KERNEL_AREA_START) && (x < KERNEL_AREA_END))
#define UTCB_ADDR(x) ((x >= UTCB_AREA_START) && (x < UTCB_AREA_END))
#define is_kernel_address(x) (KERN_ADDR(x) || (x >= ARM_HIGH_VECTOR) || \
(x >= IO_AREA_START && x < IO_AREA_END))
#endif /* __MEMLAYOUT_H__ */
|
/* -*- c++ -*- */
/*
* Copyright 2002 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_GRI_IIR_H
#define INCLUDED_GRI_IIR_H
#include <gr_core_api.h>
#include <vector>
#include <stdexcept>
/*!
* \brief base class template for Infinite Impulse Response filter (IIR)
*/
template<class i_type, class o_type, class tap_type>
class gri_iir {
public:
/*!
* \brief Construct an IIR with the given taps.
*
* This filter uses the Direct Form I implementation, where
* \p fftaps contains the feed-forward taps, and \p fbtaps the feedback ones.
*
* \p fftaps and \p fbtaps must have equal numbers of taps
*
* The input and output satisfy a difference equation of the form
\f[
y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
\f]
* with the corresponding rational system function
\f[
H(z) = \frac{\sum_{k=0}^{N} b_k z^{-k}}{1 - \sum_{k=1}^{M} a_k z^{-k}}
\f]
* Note that some texts define the system function with a + in the denominator.
* If you're using that convention, you'll need to negate the feedback taps.
*/
gri_iir (const std::vector<tap_type>& fftaps,
const std::vector<tap_type>& fbtaps) throw (std::invalid_argument)
{
set_taps (fftaps, fbtaps);
}
gri_iir () : d_latest_n(0),d_latest_m(0) { }
~gri_iir () {}
/*!
* \brief compute a single output value.
* \returns the filtered input value.
*/
o_type filter (const i_type input);
/*!
* \brief compute an array of N output values.
* \p input must have N valid entries.
*/
void filter_n (o_type output[], const i_type input[], long n);
/*!
* \return number of taps in filter.
*/
unsigned ntaps_ff () const { return d_fftaps.size (); }
unsigned ntaps_fb () const { return d_fbtaps.size (); }
/*!
* \brief install new taps.
*/
void set_taps (const std::vector<tap_type> &fftaps,
const std::vector<tap_type> &fbtaps) throw (std::invalid_argument)
{
d_latest_n = 0;
d_latest_m = 0;
d_fftaps = fftaps;
d_fbtaps = fbtaps;
int n = fftaps.size ();
int m = fbtaps.size ();
d_prev_input.resize (2 * n);
d_prev_output.resize (2 * m);
for (int i = 0; i < 2 * n; i++){
d_prev_input[i] = 0;
}
for (int i = 0; i < 2 * m; i++){
d_prev_output[i] = 0;
}
}
protected:
std::vector<tap_type> d_fftaps;
std::vector<tap_type> d_fbtaps;
int d_latest_n;
int d_latest_m;
std::vector<tap_type> d_prev_output;
std::vector<i_type> d_prev_input;
};
//
// general case. We may want to specialize this
//
template<class i_type, class o_type, class tap_type>
o_type
gri_iir<i_type, o_type, tap_type>::filter (const i_type input)
{
tap_type acc;
unsigned i = 0;
unsigned n = ntaps_ff ();
unsigned m = ntaps_fb ();
if (n == 0)
return (o_type) 0;
int latest_n = d_latest_n;
int latest_m = d_latest_m;
acc = d_fftaps[0] * input;
for (i = 1; i < n; i ++)
acc += (d_fftaps[i] * d_prev_input[latest_n + i]);
for (i = 1; i < m; i ++)
acc += (d_fbtaps[i] * d_prev_output[latest_m + i]);
// store the values twice to avoid having to handle wrap-around in the loop
d_prev_output[latest_m] = acc;
d_prev_output[latest_m+m] = acc;
d_prev_input[latest_n] = input;
d_prev_input[latest_n+n] = input;
latest_n--;
latest_m--;
if (latest_n < 0)
latest_n += n;
if (latest_m < 0)
latest_m += m;
d_latest_m = latest_m;
d_latest_n = latest_n;
return (o_type) acc;
}
template<class i_type, class o_type, class tap_type>
void
gri_iir<i_type, o_type, tap_type>::filter_n (o_type output[],
const i_type input[],
long n)
{
for (int i = 0; i < n; i++)
output[i] = filter (input[i]);
}
#endif /* INCLUDED_GRI_IIR_H */
|
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-s1ap.h */
/* ../../tools/asn2wrs.py -p s1ap -c ./s1ap.cnf -s ./packet-s1ap-template -D . S1AP-CommonDataTypes.asn S1AP-Constants.asn S1AP-Containers.asn S1AP-IEs.asn S1AP-PDU-Contents.asn S1AP-PDU-Descriptions.asn S1AP-SonTransfer-IEs.asn */
/* Input file: packet-s1ap-template.h */
#line 1 "packet-s1ap-template.h"
/* packet-s1ap.h
* Routines for E-UTRAN S1 Application Protocol (S1AP) packet dissection
*
* $Id: packet-s1ap.h 36130 2011-03-03 07:20:34Z etxrab $
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef PACKET_S1AP_H
#define PACKET_S1AP_H
/*--- Included file: packet-s1ap-exp.h ---*/
#line 1 "packet-s1ap-exp.h"
WS_VAR_IMPORT const value_string s1ap_CauseMisc_vals[];
WS_VAR_IMPORT const value_string s1ap_CauseProtocol_vals[];
WS_VAR_IMPORT const value_string s1ap_CauseRadioNetwork_vals[];
WS_VAR_IMPORT const value_string s1ap_CauseTransport_vals[];
WS_VAR_IMPORT const value_string s1ap_CauseNas_vals[];
extern const value_string s1ap_SONtransferRequestContainer_vals[];
extern const value_string s1ap_SONtransferResponseContainer_vals[];
int dissect_s1ap_Global_ENB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
int dissect_s1ap_SONtransferRequestContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
int dissect_s1ap_SONtransferResponseContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
int dissect_s1ap_Global_ENB_ID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_);
int dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_);
int dissect_s1ap_SONtransferApplicationIdentity_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_);
int dissect_s1ap_SONtransferRequestContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_);
int dissect_s1ap_SONtransferResponseContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_);
int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_);
/*--- End of included file: packet-s1ap-exp.h ---*/
#line 29 "packet-s1ap-template.h"
#endif /* PACKET_S1AP_H */
|
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
* *
* Copyright (C) 2001-2011, International Business Machines *
* Corporation and others. All Rights Reserved. *
* *
******************************************************************************
* file name: ucln_io.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2006August11
* created by: George Rhoten
*/
#ifndef __UCLN_IO_H__
#define __UCLN_IO_H__
#include "unicode/utypes.h"
#include "ucln.h"
/*
Please keep the order of enums declared in same order
as the functions are suppose to be called. */
typedef enum ECleanupIOType {
UCLN_IO_START = -1,
UCLN_IO_LOCBUND,
UCLN_IO_PRINTF,
UCLN_IO_COUNT /* This must be last */
} ECleanupIOType;
/* Main library cleanup registration function. */
/* See common/ucln.h for details on adding a cleanup function. */
U_CFUNC void U_EXPORT2 ucln_io_registerCleanup(ECleanupIOType type,
cleanupFunc *func);
#endif
|
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
* Copyright (C) <2005> Tim-Philipp Müller <tim@centricular.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef __GST_TIME_OVERLAY_H__
#define __GST_TIME_OVERLAY_H__
#include "gstbasetextoverlay.h"
G_BEGIN_DECLS
#define GST_TYPE_TIME_OVERLAY \
(gst_time_overlay_get_type())
#define GST_TIME_OVERLAY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TIME_OVERLAY,GstTimeOverlay))
#define GST_TIME_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TIME_OVERLAY,GstTimeOverlayClass))
#define GST_IS_TIME_OVERLAY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TIME_OVERLAY))
#define GST_IS_TIME_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TIME_OVERLAY))
#define GST_TIME_OVERLAY_CAST(obj) ((GstTimeOverlay*)(obj))
typedef struct _GstTimeOverlay GstTimeOverlay;
typedef struct _GstTimeOverlayClass GstTimeOverlayClass;
typedef enum {
GST_TIME_OVERLAY_TIME_LINE_BUFFER_TIME,
GST_TIME_OVERLAY_TIME_LINE_STREAM_TIME,
GST_TIME_OVERLAY_TIME_LINE_RUNNING_TIME,
GST_TIME_OVERLAY_TIME_LINE_TIME_CODE
} GstTimeOverlayTimeLine;
/**
* GstTimeOverlay:
*
* Opaque timeoverlay data structure.
*/
struct _GstTimeOverlay {
GstBaseTextOverlay textoverlay;
/*< private >*/
GstTimeOverlayTimeLine time_line;
};
struct _GstTimeOverlayClass {
GstBaseTextOverlayClass parent_class;
};
GType gst_time_overlay_get_type (void);
G_END_DECLS
#endif /* __GST_TIME_OVERLAY_H__ */
|
/**
* Copyright (c) 2019 Oticon A/S
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Service D
*
* This code is auto-generated from the Excel Workbook
* 'GATT_Test_Databases.xlsm' Sheet: 'Large Database 3'
*/
#ifndef SERVICE_D_3_H
#define SERVICE_D_3_H
#ifdef __cplusplus
extern "C" {
#endif
void service_d_3_init(void);
void service_d_3_remove(void);
#ifdef __cplusplus
}
#endif
#endif /* SERVICE_D_3_H */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_IMAGE_DECODER_H_
#define CHROME_BROWSER_IMAGE_DECODER_H_
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/utility_process_host_client.h"
class SkBitmap;
// Decodes an image in a sandboxed process.
class ImageDecoder : public content::UtilityProcessHostClient {
public:
class Delegate {
public:
// Called when image is decoded.
// |decoder| is used to identify the image in case of decoding several
// images simultaneously.
virtual void OnImageDecoded(const ImageDecoder* decoder,
const SkBitmap& decoded_image) = 0;
// Called when decoding image failed. Delegate can do some cleanup in
// this handler.
virtual void OnDecodeImageFailed(const ImageDecoder* decoder) {}
protected:
virtual ~Delegate() {}
};
enum ImageCodec {
DEFAULT_CODEC = 0, // Uses WebKit image decoding (via WebImage).
ROBUST_JPEG_CODEC, // Restrict decoding to robust jpeg codec.
};
ImageDecoder(Delegate* delegate,
const std::string& image_data,
ImageCodec image_codec);
// Starts image decoding on current thread of |task_runner|.
void Start(scoped_refptr<base::SequencedTaskRunner> task_runner);
const std::vector<unsigned char>& get_image_data() const {
return image_data_;
}
void set_delegate(Delegate* delegate) { delegate_ = delegate; }
private:
// It's a reference counted object, so destructor is private.
virtual ~ImageDecoder();
// Overidden from UtilityProcessHostClient:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// IPC message handlers.
void OnDecodeImageSucceeded(const SkBitmap& decoded_image);
void OnDecodeImageFailed();
// Launches sandboxed process that will decode the image.
void DecodeImageInSandbox(const std::vector<unsigned char>& image_data);
Delegate* delegate_;
std::vector<unsigned char> image_data_;
const ImageCodec image_codec_;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
};
#endif // CHROME_BROWSER_IMAGE_DECODER_H_
|
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebGLRenderingContext_h
#define WebGLRenderingContext_h
#include "core/html/canvas/WebGLRenderingContextBase.h"
namespace blink {
class WebGLRenderingContext final : public WebGLRenderingContextBase {
DEFINE_WRAPPERTYPEINFO();
public:
static PassOwnPtrWillBeRawPtr<WebGLRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&);
virtual ~WebGLRenderingContext();
virtual unsigned version() const override { return 1; }
virtual String contextName() const override { return "WebGLRenderingContext"; }
virtual void registerContextExtensions() override;
DECLARE_VIRTUAL_TRACE();
private:
WebGLRenderingContext(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3D>, const WebGLContextAttributes&);
// Enabled extension objects.
RefPtrWillBeMember<ANGLEInstancedArrays> m_angleInstancedArrays;
RefPtrWillBeMember<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform;
RefPtrWillBeMember<EXTBlendMinMax> m_extBlendMinMax;
RefPtrWillBeMember<EXTFragDepth> m_extFragDepth;
RefPtrWillBeMember<EXTShaderTextureLOD> m_extShaderTextureLOD;
RefPtrWillBeMember<EXTsRGB> m_extsRGB;
RefPtrWillBeMember<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
RefPtrWillBeMember<OESTextureFloat> m_oesTextureFloat;
RefPtrWillBeMember<OESTextureFloatLinear> m_oesTextureFloatLinear;
RefPtrWillBeMember<OESTextureHalfFloat> m_oesTextureHalfFloat;
RefPtrWillBeMember<OESTextureHalfFloatLinear> m_oesTextureHalfFloatLinear;
RefPtrWillBeMember<OESStandardDerivatives> m_oesStandardDerivatives;
RefPtrWillBeMember<OESVertexArrayObject> m_oesVertexArrayObject;
RefPtrWillBeMember<OESElementIndexUint> m_oesElementIndexUint;
RefPtrWillBeMember<WebGLLoseContext> m_webglLoseContext;
RefPtrWillBeMember<WebGLDebugRendererInfo> m_webglDebugRendererInfo;
RefPtrWillBeMember<WebGLDebugShaders> m_webglDebugShaders;
RefPtrWillBeMember<WebGLDrawBuffers> m_webglDrawBuffers;
RefPtrWillBeMember<WebGLCompressedTextureATC> m_webglCompressedTextureATC;
RefPtrWillBeMember<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1;
RefPtrWillBeMember<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
RefPtrWillBeMember<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;
RefPtrWillBeMember<WebGLDepthTexture> m_webglDepthTexture;
};
DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context,
context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 1,
context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 1);
} // namespace blink
#endif // WebGLRenderingContext_h
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_URL_REQUEST_URL_FETCHER_DELEGATE_H_
#define NET_URL_REQUEST_URL_FETCHER_DELEGATE_H_
#include <stdint.h>
#include <memory>
#include <string>
#include "net/base/net_export.h"
namespace net {
class URLFetcher;
// A delegate interface for users of URLFetcher.
class NET_EXPORT URLFetcherDelegate {
public:
// This will be called when the URL has been fetched, successfully or not.
// Use accessor methods on |source| to get the results.
virtual void OnURLFetchComplete(const URLFetcher* source) = 0;
// This will be called when some part of the response is read. |current|
// denotes the number of bytes received up to the call, and |total| is the
// expected total size of the response (or -1 if not determined).
virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
int64_t current,
int64_t total);
// This will be called when uploading of POST or PUT requests proceeded.
// |current| denotes the number of bytes sent so far, and |total| is the
// total size of uploading data (or -1 if chunked upload is enabled).
virtual void OnURLFetchUploadProgress(const URLFetcher* source,
int64_t current,
int64_t total);
protected:
virtual ~URLFetcherDelegate();
};
} // namespace net
#endif // NET_URL_REQUEST_URL_FETCHER_DELEGATE_H_
|
// This file has been prepared for Doxygen automatic documentation generation.
/*! \file *********************************************************************
*
* \brief API for the BCD algorithms
*
*
*
* \par Application note:
* AVR2017: RZRAVEN FW
*
* \par Documentation
*
* \author
* Atmel Corporation: http://www.atmel.com \n
* Support email: avr@atmel.com
*
* $Id: bcd.h 41436 2008-05-09 00:02:43Z hmyklebust $
*
* Copyright (c) 2008 , Atmel Corporation. All rights reserved.
*
* Licensed under Atmels Limited License Agreement (RZRaven Evaluation and Starter Kit).
*****************************************************************************/
#ifndef __BCD_H__
#define __BCD_H__
/*========================= INCLUDES =========================*/
#include <stdint.h>
/*========================= CONSTANT DEFINES =========================*/
/*========================= MACROS DEFINES =========================*/
/*========================= TYPEDEFS =========================*/
/*========================= PUBLIC VARIABLES =========================*/
/*========================= PUBLIC FUNCTIONS =========================*/
/*! \brief Convert integer(unsigned 16 bit) to Binary Coded Decimal number
*
* \param[in] integer Integer to convert
*
* \returns BCD coded integer
*/
uint16_t itobcd(uint16_t integer);
/*! \brief Convert Binary Coded Decimal number to integer(unsigned 16 bit)
*
* \param[in] bcd_number Binary Coded Decimal number to convert
*
* \returns Integer
*/
uint16_t bcdtoi(uint16_t bcd_number);
#endif // __BCD_H__
/*EOF*/
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Interface of a host that receives commands from a Chromoting client.
//
// This interface handles control messages defined in control.proto.
#ifndef REMOTING_PROTOCOL_HOST_STUB_H_
#define REMOTING_PROTOCOL_HOST_STUB_H_
#include "base/basictypes.h"
namespace remoting {
namespace protocol {
class AudioControl;
class Capabilities;
class ClientResolution;
class PairingResponse;
class PairingRequest;
class VideoControl;
class HostStub {
public:
HostStub() {}
// Notification of the client dimensions and pixel density.
// This may be used to resize the host display to match the client area.
virtual void NotifyClientResolution(const ClientResolution& resolution) = 0;
// Configures video update properties. Currently only pausing & resuming the
// video channel is supported.
virtual void ControlVideo(const VideoControl& video_control) = 0;
// Configures audio properties. Currently only pausing & resuming the audio
// channel is supported.
virtual void ControlAudio(const AudioControl& audio_control) = 0;
// Passes the set of capabilities supported by the client to the host.
virtual void SetCapabilities(const Capabilities& capabilities) = 0;
// Requests pairing between the host and client for PIN-less authentication.
virtual void RequestPairing(const PairingRequest& pairing_request) = 0;
protected:
virtual ~HostStub() {}
private:
DISALLOW_COPY_AND_ASSIGN(HostStub);
};
} // namespace protocol
} // namespace remoting
#endif // REMOTING_PROTOCOL_HOST_STUB_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 DisplayItemList_h
#define DisplayItemList_h
#include "platform/PlatformExport.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "wtf/HashMap.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/Vector.h"
namespace blink {
class GraphicsContext;
typedef Vector<OwnPtr<DisplayItem>> DisplayItems;
class PLATFORM_EXPORT DisplayItemList {
WTF_MAKE_NONCOPYABLE(DisplayItemList);
WTF_MAKE_FAST_ALLOCATED(DisplayItemList);
public:
static PassOwnPtr<DisplayItemList> create()
{
return adoptPtr(new DisplayItemList());
}
// These methods are called during paint invalidation.
void invalidate(DisplayItemClient);
void invalidateAll();
// These methods are called during painting.
void add(WTF::PassOwnPtr<DisplayItem>);
void beginScope(DisplayItemClient);
void endScope(DisplayItemClient);
// Must be called when a painting is finished.
void commitNewDisplayItems();
// Get the paint list generated after the last painting.
const DisplayItems& displayItems() const;
bool clientCacheIsValid(DisplayItemClient) const;
// Commits the new display items and plays back the updated display items into the given context.
void commitNewDisplayItemsAndReplay(GraphicsContext& context)
{
commitNewDisplayItems();
replay(context);
}
bool displayItemConstructionIsDisabled() const { return m_constructionDisabled; }
void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructionDisabled = disable; }
#if ENABLE(ASSERT)
size_t newDisplayItemsSize() const { return m_newDisplayItems.size(); }
#endif
#ifndef NDEBUG
void showDebugData() const;
#endif
protected:
DisplayItemList()
: m_validlyCachedClientsDirty(false)
, m_constructionDisabled(false) { }
private:
friend class DisplayItemListTest;
friend class DisplayItemListPaintTest;
friend class LayoutObjectDrawingRecorderTest;
void updateValidlyCachedClientsIfNeeded() const;
#ifndef NDEBUG
WTF::String displayItemsAsDebugString(const DisplayItems&) const;
#endif
// Indices into PaintList of all DrawingDisplayItems and BeginSubtreeDisplayItems of each client.
// Temporarily used during merge to find out-of-order display items.
using DisplayItemIndicesByClientMap = HashMap<DisplayItemClient, Vector<size_t>>;
static size_t findMatchingItemFromIndex(const DisplayItem&, DisplayItem::Type matchingType, const DisplayItemIndicesByClientMap&, const DisplayItems&);
static void addItemToIndex(const DisplayItem&, size_t index, DisplayItemIndicesByClientMap&);
size_t findOutOfOrderCachedItem(size_t& currentDisplayItemsIndex, const DisplayItem&, DisplayItem::Type, DisplayItemIndicesByClientMap&);
size_t findOutOfOrderCachedItemForward(size_t& currentDisplayItemsIndex, const DisplayItem&, DisplayItem::Type, DisplayItemIndicesByClientMap&);
#if ENABLE(ASSERT)
// The following two methods are for checking under-invalidations
// (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled).
void checkCachedDisplayItemIsUnchanged(const DisplayItem&, DisplayItemIndicesByClientMap&);
void checkNoRemainingCachedDisplayItems();
#endif
void replay(GraphicsContext&) const;
DisplayItems m_currentDisplayItems;
DisplayItems m_newDisplayItems;
// Contains all clients having valid cached paintings if updated.
// It's lazily updated in updateValidlyCachedClientsIfNeeded().
// FIXME: In the future we can replace this with client-side repaint flags
// to avoid the cost of building and querying the hash table.
mutable HashSet<DisplayItemClient> m_validlyCachedClients;
mutable bool m_validlyCachedClientsDirty;
// Allow display item construction to be disabled to isolate the costs of construction
// in performance metrics.
bool m_constructionDisabled;
// Scope ids are allocated per client to ensure that the ids are stable for non-invalidated
// clients between frames, so that we can use the id to match new display items to cached
// display items.
struct Scope {
Scope(DisplayItemClient c, int i) : client(c), id(i) { }
DisplayItemClient client;
int id;
};
typedef HashMap<DisplayItemClient, int> ClientScopeIdMap;
ClientScopeIdMap m_clientScopeIdMap;
Vector<Scope> m_scopeStack;
#if ENABLE(ASSERT)
// This is used to check duplicated ids during add(). We could also check during
// updatePaintList(), but checking during add() helps developer easily find where
// the duplicated ids are from.
DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
#endif
};
} // namespace blink
#endif // DisplayItemList_h
|
// dC0026.c
// implicit int in K&R decl
void pack12 (p, n, last)
register char *p;
register /*implicit-int*/ n;
int last;
{}
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PAYMENTS_CONTENT_SECURE_PAYMENT_CONFIRMATION_APP_FACTORY_H_
#define COMPONENTS_PAYMENTS_CONTENT_SECURE_PAYMENT_CONFIRMATION_APP_FACTORY_H_
#include <map>
#include <memory>
#include "base/memory/weak_ptr.h"
#include "components/payments/content/payment_app_factory.h"
#include "components/webdata/common/web_data_service_consumer.h"
#include "content/public/browser/web_contents_observer.h"
namespace payments {
struct SecurePaymentConfirmationCredential;
class SecurePaymentConfirmationAppFactory
: public PaymentAppFactory,
public WebDataServiceConsumer,
public content::WebContentsObserver {
public:
SecurePaymentConfirmationAppFactory();
~SecurePaymentConfirmationAppFactory() override;
SecurePaymentConfirmationAppFactory(
const SecurePaymentConfirmationAppFactory& other) = delete;
SecurePaymentConfirmationAppFactory& operator=(
const SecurePaymentConfirmationAppFactory& other) = delete;
// PaymentAppFactory:
void Create(base::WeakPtr<Delegate> delegate) override;
private:
struct Request;
// WebDataServiceConsumer:
void OnWebDataServiceRequestDone(
WebDataServiceBase::Handle handle,
std::unique_ptr<WDTypedResult> result) override;
// WebContentsObserver:
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
void OnIsUserVerifyingPlatformAuthenticatorAvailable(
std::unique_ptr<Request> request,
bool is_available);
void OnAppIcon(
std::unique_ptr<SecurePaymentConfirmationCredential> credential,
std::unique_ptr<Request> request,
const SkBitmap& icon);
// Called after downloading the icon whose URL was passed into PaymentRequest
// API.
void DidDownloadIcon(
std::unique_ptr<SecurePaymentConfirmationCredential> credential,
std::unique_ptr<Request> request,
int request_id,
int unused_http_status_code,
const GURL& unused_image_url,
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& unused_sizes);
std::map<WebDataServiceBase::Handle, std::unique_ptr<Request>> requests_;
base::WeakPtrFactory<SecurePaymentConfirmationAppFactory> weak_ptr_factory_{
this};
};
} // namespace payments
#endif // COMPONENTS_PAYMENTS_CONTENT_SECURE_PAYMENT_CONFIRMATION_APP_FACTORY_H_
|
/*
* tclFileSystem.h --
*
* This file contains the common defintions and prototypes for use by
* Tcl's filesystem and path handling layers.
*
* Copyright (c) 2003 Vince Darley.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TCLFILESYSTEM
#define _TCLFILESYSTEM
#include "tcl.h"
/*
* The internal TclFS API provides routines for handling and manipulating
* paths efficiently, taking direct advantage of the "path" Tcl_Obj type.
*
* These functions are not exported at all at present.
*/
MODULE_SCOPE int TclFSCwdPointerEquals(Tcl_Obj **pathPtrPtr);
MODULE_SCOPE int TclFSNormalizeToUniquePath(Tcl_Interp *interp,
Tcl_Obj *pathPtr, int startAt);
MODULE_SCOPE Tcl_Obj * TclFSMakePathRelative(Tcl_Interp *interp,
Tcl_Obj *pathPtr, Tcl_Obj *cwdPtr);
MODULE_SCOPE int TclFSEnsureEpochOk(Tcl_Obj *pathPtr,
Tcl_Filesystem **fsPtrPtr);
MODULE_SCOPE void TclFSSetPathDetails(Tcl_Obj *pathPtr,
Tcl_Filesystem *fsPtr, ClientData clientData);
MODULE_SCOPE Tcl_Obj * TclFSNormalizeAbsolutePath(Tcl_Interp *interp,
Tcl_Obj *pathPtr);
MODULE_SCOPE int TclFSEpoch(void);
/*
* Private shared variables for use by tclIOUtil.c and tclPathObj.c
*/
MODULE_SCOPE Tcl_Filesystem tclNativeFilesystem;
/*
* Private shared functions for use by tclIOUtil.c, tclPathObj.c and
* tclFileName.c, and any platform-specific filesystem code.
*/
MODULE_SCOPE Tcl_PathType TclFSGetPathType(Tcl_Obj *pathPtr,
Tcl_Filesystem **filesystemPtrPtr,
int *driveNameLengthPtr);
MODULE_SCOPE Tcl_PathType TclFSNonnativePathType(CONST char *pathPtr,
int pathLen, Tcl_Filesystem **filesystemPtrPtr,
int *driveNameLengthPtr, Tcl_Obj **driveNameRef);
MODULE_SCOPE Tcl_PathType TclGetPathType(Tcl_Obj *pathPtr,
Tcl_Filesystem **filesystemPtrPtr,
int *driveNameLengthPtr, Tcl_Obj **driveNameRef);
MODULE_SCOPE int TclFSEpochOk(int filesystemEpoch);
MODULE_SCOPE int TclFSCwdIsNative(void);
MODULE_SCOPE Tcl_Obj * TclWinVolumeRelativeNormalize(Tcl_Interp *interp,
CONST char *path, Tcl_Obj **useThisCwdPtr);
MODULE_SCOPE Tcl_FSPathInFilesystemProc TclNativePathInFilesystem;
MODULE_SCOPE Tcl_FSCreateInternalRepProc TclNativeCreateNativeRep;
#endif /* _TCLFILESYSTEM */
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_RENDERER_WAKE_EVENT_PAGE_H_
#define EXTENSIONS_RENDERER_WAKE_EVENT_PAGE_H_
#include <memory>
#include <string>
#include <unordered_map>
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "content/public/renderer/render_thread_observer.h"
#include "ipc/ipc_sync_message_filter.h"
#include "v8/include/v8-forward.h"
namespace content {
class RenderThread;
}
namespace extensions {
class ScriptContext;
// This class implements the wake-event-page JavaScript function, which wakes
// an event page and runs a callback when done.
//
// Note, the function will do a round trip to the browser even if event page is
// open. Any optimisation to prevent this must be at the JavaScript level.
class WakeEventPage : public content::RenderThreadObserver {
public:
WakeEventPage();
WakeEventPage(const WakeEventPage&) = delete;
WakeEventPage& operator=(const WakeEventPage&) = delete;
~WakeEventPage() override;
// Returns the single instance of the WakeEventPage object.
//
// Thread safe.
static WakeEventPage* Get();
// Initializes the WakeEventPage.
//
// This must be called before any bindings are installed, and must be called
// on the render thread.
void Init(content::RenderThread* render_thread);
// Returns the wake-event-page function bound to a given context. The
// function will be cached as a hidden value in the context's global object.
//
// To mix C++ and JavaScript, example usage might be:
//
// WakeEventPage::Get().GetForContext(context)(function() {
// ...
// });
//
// Thread safe.
v8::Local<v8::Function> GetForContext(ScriptContext* context);
private:
class WakeEventPageNativeHandler;
// The response from an ExtensionHostMsg_WakeEvent call, passed true if the
// call was successful, false on failure.
using OnResponseCallback = base::OnceCallback<void(bool)>;
// Makes an ExtensionHostMsg_WakeEvent request for an extension ID. The
// second argument is a callback to run when the request has completed.
using MakeRequestCallback =
base::RepeatingCallback<void(const std::string&, OnResponseCallback)>;
// For |requests_|.
struct RequestData {
RequestData(int thread_id, OnResponseCallback on_response);
~RequestData();
// The thread ID the request was made on. |on_response| must be called on
// that thread.
int thread_id;
// Callback to run when the response to the request arrives.
OnResponseCallback on_response;
};
// Runs |on_response|, passing it |success|.
static void RunOnResponseWithResult(OnResponseCallback on_response,
bool success);
// Sends the ExtensionHostMsg_WakeEvent IPC for |extension_id|, and
// updates |requests_| bookkeeping.
void MakeRequest(const std::string& extension_id,
OnResponseCallback on_response);
// content::RenderThreadObserver:
bool OnControlMessageReceived(const IPC::Message& message) override;
// OnControlMessageReceived handlers:
void OnWakeEventPageResponse(int request_id, bool success);
// IPC sender. Belongs to the render thread, but thread safe.
scoped_refptr<IPC::SyncMessageFilter> message_filter_;
// All in-flight requests, keyed by request ID. Used on multiple threads, so
// must be guarded by |requests_lock_|.
std::unordered_map<int, std::unique_ptr<RequestData>> requests_;
// Lock for |requests_|.
base::Lock requests_lock_;
};
} // namespace extensions
#endif // EXTENSIONS_RENDERER_WAKE_EVENT_PAGE_H_
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_FILESYSTEM_FILE_WRITER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_FILESYSTEM_FILE_WRITER_H_
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/core/probe/async_task_context.h"
#include "third_party/blink/renderer/modules/event_target_modules.h"
#include "third_party/blink/renderer/modules/filesystem/file_writer_base.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/prefinalizer.h"
namespace blink {
class Blob;
class DOMException;
class ExceptionState;
class ExecutionContext;
enum class FileErrorCode;
class FileWriter final : public EventTargetWithInlineData,
public FileWriterBase,
public ActiveScriptWrappable<FileWriter>,
public ExecutionContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
USING_PRE_FINALIZER(FileWriter, Dispose);
public:
explicit FileWriter(ExecutionContext*);
~FileWriter() override;
enum ReadyState { kInit = 0, kWriting = 1, kDone = 2 };
void write(Blob*, ExceptionState&);
void seek(int64_t position, ExceptionState&);
void truncate(int64_t length, ExceptionState&);
void abort(ExceptionState&);
ReadyState getReadyState() const { return ready_state_; }
DOMException* error() const { return error_.Get(); }
// FileWriterBase
void DidWriteImpl(int64_t bytes, bool complete) override;
void DidTruncateImpl() override;
void DidFailImpl(base::File::Error error) override;
void DoTruncate(const KURL& path, int64_t offset) override;
void DoWrite(const KURL& path,
const String& blob_id,
int64_t offset) override;
void DoCancel() override;
// ExecutionContextLifecycleObserver
void ContextDestroyed() override;
// ScriptWrappable
bool HasPendingActivity() const final;
// EventTarget
const AtomicString& InterfaceName() const override;
ExecutionContext* GetExecutionContext() const override {
return ExecutionContextLifecycleObserver::GetExecutionContext();
}
DEFINE_ATTRIBUTE_EVENT_LISTENER(writestart, kWritestart)
DEFINE_ATTRIBUTE_EVENT_LISTENER(progress, kProgress)
DEFINE_ATTRIBUTE_EVENT_LISTENER(write, kWrite)
DEFINE_ATTRIBUTE_EVENT_LISTENER(abort, kAbort)
DEFINE_ATTRIBUTE_EVENT_LISTENER(error, kError)
DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend, kWriteend)
void Trace(Visitor*) const override;
private:
enum Operation {
kOperationNone,
kOperationWrite,
kOperationTruncate,
kOperationAbort
};
void CompleteAbort();
void DoOperation(Operation);
void SignalCompletion(base::File::Error error_code);
void FireEvent(const AtomicString& type);
void SetError(FileErrorCode, ExceptionState&);
void Dispose();
Member<DOMException> error_;
ReadyState ready_state_;
Operation operation_in_progress_;
Operation queued_operation_;
uint64_t bytes_written_;
uint64_t bytes_to_write_;
uint64_t truncate_length_;
uint64_t num_aborts_;
uint8_t recursion_depth_;
base::TimeTicks last_progress_notification_time_;
Member<Blob> blob_being_written_;
int request_id_;
probe::AsyncTaskContext async_task_context_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_FILESYSTEM_FILE_WRITER_H_
|
/*
* arch/arm/mach-clps711x/include/mach/system.h
*
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <linux/io.h>
#include <mach/hardware.h>
#include <asm/hardware/clps7111.h>
static inline void arch_idle(void)
{
clps_writel(1, HALT);
__asm__ __volatile__(
"mov r0, r0\n\
mov r0, r0");
}
static inline void arch_reset(char mode, const char *cmd)
{
cpu_reset(0);
}
#endif
|
/*
* Copyright 2011 Luc Verhaegen <libv@codethink.co.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, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE 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.
*
*/
/*
* Quick 'n Dirty bitmap dumper.
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include "write_bmp.h"
#define FILENAME_SIZE 1024
struct bmp_header {
unsigned short magic;
unsigned int size;
unsigned int unused;
unsigned int start;
} __attribute__((__packed__));
struct dib_header {
unsigned int size;
unsigned int width;
unsigned int height;
unsigned short planes;
unsigned short bpp;
unsigned int compression;
unsigned int data_size;
unsigned int h_res;
unsigned int v_res;
unsigned int colours;
unsigned int important_colours;
unsigned int red_mask;
unsigned int green_mask;
unsigned int blue_mask;
unsigned int alpha_mask;
unsigned int colour_space;
unsigned int unused[12];
} __attribute__((__packed__));
static int
bmp_header_write(int fd, int width, int height, int bgra, int noflip, int alpha)
{
struct bmp_header bmp_header = {
.magic = 0x4d42,
.size = (width * height * 4) +
sizeof(struct bmp_header) + sizeof(struct dib_header),
.start = sizeof(struct bmp_header) + sizeof(struct dib_header),
};
struct dib_header dib_header = {
.size = sizeof(struct dib_header),
.width = width,
.height = noflip ? -height : height,
.planes = 1,
.bpp = 32,
.compression = 3,
.data_size = 4 * width * height,
.h_res = 0xB13,
.v_res = 0xB13,
.colours = 0,
.important_colours = 0,
.red_mask = 0x000000FF,
.green_mask = 0x0000FF00,
.blue_mask = 0x00FF0000,
.alpha_mask = alpha ? 0xFF000000 : 0x00000000,
.colour_space = 0x57696E20,
};
if (bgra) {
dib_header.red_mask = 0x00FF0000;
dib_header.blue_mask = 0x000000FF;
}
write(fd, &bmp_header, sizeof(struct bmp_header));
write(fd, &dib_header, sizeof(struct dib_header));
return 0;
}
void
bmp_dump32(char *buffer, unsigned width, unsigned height, bool bgra, const char *filename)
{
int fd;
fd = open(filename, O_WRONLY| O_TRUNC | O_CREAT, 0666);
if (fd == -1) {
printf("Failed to open %s: %s\n", filename, strerror(errno));
return;
}
bmp_header_write(fd, width, height, bgra, false, true);
write(fd, buffer, width * height * 4);
}
void
bmp_dump32_noflip(char *buffer, unsigned width, unsigned height, bool bgra, const char *filename)
{
int fd;
fd = open(filename, O_WRONLY| O_TRUNC | O_CREAT, 0666);
if (fd == -1) {
printf("Failed to open %s: %s\n", filename, strerror(errno));
return;
}
bmp_header_write(fd, width, height, bgra, true, true);
write(fd, buffer, width * height * 4);
}
void
bmp_dump32_ex(char *buffer, unsigned width, unsigned height, bool flip, bool bgra, bool alpha, const char *filename)
{
int fd;
fd = open(filename, O_WRONLY| O_TRUNC | O_CREAT, 0666);
if (fd == -1) {
printf("Failed to open %s: %s\n", filename, strerror(errno));
return;
}
bmp_header_write(fd, width, height, bgra, flip, alpha);
write(fd, buffer, width * height * 4);
}
|
30 mtime=1375350454.352333212
29 atime=1394128264.14927783
30 ctime=1375350454.352333212
|
/* parens.c -- Implementation of matching parentheses feature. */
/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
The GNU Readline Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. */
#define READLINE_LIBRARY
#if defined (__TANDEM)
# include <floss.h>
#endif
#include "rlconf.h"
#if defined (HAVE_CONFIG_H)
# include "config_readline.h"
#endif
#include <stdio.h>
#include <sys/types.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#if defined (FD_SET) && !defined (HAVE_SELECT)
# define HAVE_SELECT
#endif
#if defined (HAVE_SELECT)
# include <sys/time.h>
#endif /* HAVE_SELECT */
#if defined (HAVE_SYS_SELECT_H)
# include <sys/select.h>
#endif
#if defined (HAVE_STRING_H)
# include <string.h>
#else /* !HAVE_STRING_H */
# include <strings.h>
#endif /* !HAVE_STRING_H */
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
#include "readline.h"
#include "rlprivate.h"
static int find_matching_open PARAMS((char *, int, int));
/* Non-zero means try to blink the matching open parenthesis when the
close parenthesis is inserted. */
#if defined (HAVE_SELECT)
int rl_blink_matching_paren = 1;
#else /* !HAVE_SELECT */
int rl_blink_matching_paren = 0;
#endif /* !HAVE_SELECT */
static int _paren_blink_usec = 500000;
/* Change emacs_standard_keymap to have bindings for paren matching when
ON_OR_OFF is 1, change them back to self_insert when ON_OR_OFF == 0. */
void
_rl_enable_paren_matching (on_or_off)
int on_or_off;
{
if (on_or_off)
{ /* ([{ */
rl_bind_key_in_map (')', rl_insert_close, emacs_standard_keymap);
rl_bind_key_in_map (']', rl_insert_close, emacs_standard_keymap);
rl_bind_key_in_map ('}', rl_insert_close, emacs_standard_keymap);
}
else
{ /* ([{ */
rl_bind_key_in_map (')', rl_insert, emacs_standard_keymap);
rl_bind_key_in_map (']', rl_insert, emacs_standard_keymap);
rl_bind_key_in_map ('}', rl_insert, emacs_standard_keymap);
}
}
int
rl_set_paren_blink_timeout (u)
int u;
{
int o;
o = _paren_blink_usec;
if (u > 0)
_paren_blink_usec = u;
return (o);
}
int
rl_insert_close (count, invoking_key)
int count, invoking_key;
{
if (rl_explicit_arg || !rl_blink_matching_paren)
_rl_insert_char (count, invoking_key);
else
{
#if defined (HAVE_SELECT)
int orig_point, match_point;
struct timeval timer;
fd_set readfds;
_rl_insert_char (1, invoking_key);
(*rl_redisplay_function) ();
match_point =
find_matching_open (rl_line_buffer, rl_point - 2, invoking_key);
/* Emacs might message or ring the bell here, but I don't. */
if (match_point < 0)
return -1;
FD_ZERO (&readfds);
FD_SET (fileno (rl_instream), &readfds);
timer.tv_sec = 0;
timer.tv_usec = _paren_blink_usec;
orig_point = rl_point;
rl_point = match_point;
(*rl_redisplay_function) ();
select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
rl_point = orig_point;
#else /* !HAVE_SELECT */
_rl_insert_char (count, invoking_key);
#endif /* !HAVE_SELECT */
}
return 0;
}
static int
find_matching_open (string, from, closer)
char *string;
int from, closer;
{
register int i;
int opener, level, delimiter;
switch (closer)
{
case ']': opener = '['; break;
case '}': opener = '{'; break;
case ')': opener = '('; break;
default:
return (-1);
}
level = 1; /* The closer passed in counts as 1. */
delimiter = 0; /* Delimited state unknown. */
for (i = from; i > -1; i--)
{
if (delimiter && (string[i] == delimiter))
delimiter = 0;
else if (rl_basic_quote_characters && strchr (rl_basic_quote_characters, string[i]))
delimiter = string[i];
else if (!delimiter && (string[i] == closer))
level++;
else if (!delimiter && (string[i] == opener))
level--;
if (!level)
break;
}
return (i);
}
|
/*****************************************************************************/
// Copyright 2006 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in
// accordance with the terms of the Adobe license agreement accompanying it.
/*****************************************************************************/
/* $Id: //mondo/dng_sdk_1_3/dng_sdk/source/dng_temperature.h#1 $ */
/* $DateTime: 2009/06/22 05:04:49 $ */
/* $Change: 578634 $ */
/* $Author: tknoll $ */
#ifndef __dng_temperature__
#define __dng_temperature__
/*****************************************************************************/
#include "dng_classes.h"
#include "dng_types.h"
/*****************************************************************************/
class dng_temperature
{
private:
real64 fTemperature;
real64 fTint;
public:
dng_temperature ()
: fTemperature (0.0)
, fTint (0.0)
{
}
dng_temperature (real64 temperature,
real64 tint)
: fTemperature (temperature)
, fTint (tint )
{
}
dng_temperature (const dng_xy_coord &xy)
: fTemperature (0.0)
, fTint (0.0)
{
Set_xy_coord (xy);
}
void SetTemperature (real64 temperature)
{
fTemperature = temperature;
}
real64 Temperature () const
{
return fTemperature;
}
void SetTint (real64 tint)
{
fTint = tint;
}
real64 Tint () const
{
return fTint;
}
void Set_xy_coord (const dng_xy_coord &xy);
dng_xy_coord Get_xy_coord () const;
};
/*****************************************************************************/
#endif
/*****************************************************************************/
|
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
#define N 16
#define DIFF 242
unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
__attribute__ ((noinline)) void
main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
{
int i;
unsigned short udiff = 2;
unsigned short umax = x;
unsigned short umin = x;
for (i = 0; i < N; i++) {
udiff += (unsigned short)(ub[i] - uc[i]);
}
for (i = 0; i < N; i++) {
umax = umax < uc[i] ? uc[i] : umax;
}
for (i = 0; i < N; i++) {
umin = umin > uc[i] ? uc[i] : umin;
}
/* check results: */
if (udiff != DIFF)
abort ();
if (umax != max_result)
abort ();
if (umin != min_result)
abort ();
}
int main (void)
{
check_vect ();
main1 (100, 100, 1);
main1 (0, 15, 0);
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
|
/* mpfr_ui_sub -- subtract a floating-point number from an integer
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by the Arenaire and Cacao projects, INRIA.
This file is part of the GNU MPFR Library.
The GNU MPFR 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 MPFR 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 MPFR Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301, USA. */
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
int
mpfr_ui_sub (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mp_rnd_t rnd_mode)
{
mpfr_t uu;
mp_limb_t up[1];
unsigned long cnt;
if (MPFR_UNLIKELY (u == 0))
return mpfr_neg (y, x, rnd_mode);
if (MPFR_UNLIKELY(MPFR_IS_SINGULAR(x)))
{
if (MPFR_IS_NAN(x))
{
MPFR_SET_NAN(y);
MPFR_RET_NAN;
}
else if (MPFR_IS_INF(x))
{
/* u - Inf = -Inf and u - -Inf = +Inf */
MPFR_SET_INF(y);
MPFR_SET_OPPOSITE_SIGN(y,x);
MPFR_RET(0); /* +/-infinity is exact */
}
else /* x is zero */
/* u - 0 = u */
return mpfr_set_ui(y, u, rnd_mode);
}
else
{
MPFR_TMP_INIT1 (up, uu, BITS_PER_MP_LIMB);
MPFR_ASSERTN(u == (mp_limb_t) u);
count_leading_zeros (cnt, (mp_limb_t) u);
*up = (mp_limb_t) u << cnt;
MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt);
return mpfr_sub (y, uu, x, rnd_mode);
}
}
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2013-2017 Free Software Foundation, Inc.
Contributed by Intel Corp. <markus.t.metzger@intel.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 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/>. */
#include <pthread.h>
static pthread_barrier_t barrier;
static int global;
static void *
test (void *arg)
{
pthread_barrier_wait (&barrier);
global = 42; /* bp.1 */
pthread_barrier_wait (&barrier);
global = 42; /* bp.2 */
return arg;
}
int
main (void)
{
pthread_t th;
pthread_barrier_init (&barrier, NULL, 2);
pthread_create (&th, NULL, test, NULL);
test (NULL);
pthread_join (th, NULL);
pthread_barrier_destroy (&barrier);
return 0; /* bp.3 */
}
|
/** @file
Guid used to define the Firmware File System 2.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Revision Reference:
GUIDs introduced in PI Version 1.0.
**/
#ifndef __FIRMWARE_FILE_SYSTEM2_GUID_H__
#define __FIRMWARE_FILE_SYSTEM2_GUID_H__
///
/// The firmware volume header contains a data field for
/// the file system GUID
///
#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \
{ 0x8c8ce578, 0x8a3d, 0x4f1c, { 0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } }
///
/// A Volume Top File (VTF) is a file that must be
/// located such that the last byte of the file is
/// also the last byte of the firmware volume
///
#define EFI_FFS_VOLUME_TOP_FILE_GUID \
{ 0x1BA0062E, 0xC779, 0x4582, { 0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9 } }
extern EFI_GUID gEfiFirmwareFileSystem2Guid;
extern EFI_GUID gEfiFirmwareVolumeTopFileGuid;
#endif
|
// Windows/Control/ComboBox.h
#ifndef __WINDOWS_WX_CONTROL_COMBOBOX_H
#define __WINDOWS_WX_CONTROL_COMBOBOX_H
#include "Windows/Window.h"
#include "Windows/Defs.h"
#include "Windows/Control/Window2.h" // NMHDR
#ifndef _WIN32
#define CB_ERR (-1) // wxNOT_FOUND
#endif
typedef struct
{
NMHDR hdr;
#define CBENF_ESCAPE 1
#define CBENF_RETURN 2
int iWhy;
} NMCBEENDEDITW;
typedef NMCBEENDEDITW * PNMCBEENDEDITW;
class wxComboBox;
namespace NWindows {
namespace NControl {
class CComboBox // : public CWindow
{
wxComboBox* _choice;
public:
CComboBox() : _choice(0) {}
void Attach(wxWindow * newWindow);
wxWindow * Detach();
operator HWND() const;
int AddString(const TCHAR * txt);
void SetText(LPCTSTR s);
void GetText(CSysString &s);
int GetCount() const ;
void GetLBText(int index, CSysString &s);
void SetCurSel(int index);
int GetCurSel();
void SetItemData(int index, int val);
LRESULT GetItemData(int index);
LRESULT GetItemData_of_CurSel() { return GetItemData(GetCurSel()); }
void Enable(bool state);
void ResetContent();
};
class CComboBoxEx : public CComboBox // : public CWindow
{
public:
/* FIXME
LRESULT DeleteItem(int index)
{ return SendMessage(CBEM_DELETEITEM, index, 0); }
LRESULT InsertItem(COMBOBOXEXITEM *item)
{ return SendMessage(CBEM_INSERTITEM, 0, (LPARAM)item); }
DWORD SetExtendedStyle(DWORD exMask, DWORD exStyle)
{ return (DWORD)SendMessage(CBEM_SETEXTENDEDSTYLE, exMask, exStyle); }
HWND GetEditControl()
{ return (HWND)SendMessage(CBEM_GETEDITCONTROL, 0, 0); }
*/
};
}
}
#endif // __WINDOWS_WX_CONTROL_COMBOBOX_H
|
/*
* Definitions for akm8963 compass chip.
*/
#ifndef APDS993X_H
#define APDS993X_H
struct apds993x_platform_data {
int ps_pulse_number;
int ps_detect_threshold;
int ps_hysteresis_threshold;
int als_hysteresis_threshold;
int irq;
};
#endif
|
void SiiHmdiTxLiteDrvPrepareAviInfoframe ( void );
void SiiHmdiTxLiteDrvSendHwAviInfoFrame( void );
void SendAudioInfoFrame (void);
|
/*
* udp_diag.c Module for monitoring UDP transport protocols sockets.
*
* Authors: Pavel Emelyanov, <xemul@parallels.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.
*/
#include <linux/module.h>
#include <linux/inet_diag.h>
#include <linux/udp.h>
#include <net/udp.h>
#include <net/udplite.h>
#include <linux/inet_diag.h>
#include <linux/sock_diag.h>
static int sk_diag_dump(struct sock *sk, struct sk_buff *skb,
struct netlink_callback *cb, struct inet_diag_req *req,
struct nlattr *bc)
{
if (!inet_diag_bc_sk(bc, sk))
return 0;
return inet_sk_diag_fill(sk, NULL, skb, req, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
}
static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
const struct nlmsghdr *nlh, struct inet_diag_req *req)
{
int err = -EINVAL;
struct sock *sk;
struct sk_buff *rep;
if (req->sdiag_family == AF_INET)
sk = __udp4_lib_lookup(&init_net,
req->id.idiag_src[0], req->id.idiag_sport,
req->id.idiag_dst[0], req->id.idiag_dport,
req->id.idiag_if, tbl);
#if IS_ENABLED(CONFIG_IPV6)
else if (req->sdiag_family == AF_INET6)
sk = __udp6_lib_lookup(&init_net,
(struct in6_addr *)req->id.idiag_src,
req->id.idiag_sport,
(struct in6_addr *)req->id.idiag_dst,
req->id.idiag_dport,
req->id.idiag_if, tbl);
#endif
else
goto out_nosk;
err = -ENOENT;
if (sk == NULL)
goto out_nosk;
err = sock_diag_check_cookie(sk, req->id.idiag_cookie);
if (err)
goto out;
err = -ENOMEM;
rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) +
sizeof(struct inet_diag_meminfo) +
64)), GFP_KERNEL);
if (!rep)
goto out;
err = inet_sk_diag_fill(sk, NULL, rep, req,
NETLINK_CB(in_skb).pid,
nlh->nlmsg_seq, 0, nlh);
if (err < 0) {
WARN_ON(err == -EMSGSIZE);
kfree_skb(rep);
goto out;
}
err = netlink_unicast(sock_diag_nlsk, rep, NETLINK_CB(in_skb).pid,
MSG_DONTWAIT);
if (err > 0)
err = 0;
out:
if (sk)
sock_put(sk);
out_nosk:
return err;
}
static void udp_dump(struct udp_table *table, struct sk_buff *skb, struct netlink_callback *cb,
struct inet_diag_req *r, struct nlattr *bc)
{
int num, s_num, slot, s_slot;
s_slot = cb->args[0];
num = s_num = cb->args[1];
for (slot = s_slot; slot <= table->mask; num = s_num = 0, slot++) {
struct sock *sk;
struct hlist_nulls_node *node;
struct udp_hslot *hslot = &table->hash[slot];
if (hlist_nulls_empty(&hslot->head))
continue;
spin_lock_bh(&hslot->lock);
sk_nulls_for_each(sk, node, &hslot->head) {
struct inet_sock *inet = inet_sk(sk);
if (num < s_num)
goto next;
if (!(r->idiag_states & (1 << sk->sk_state)))
goto next;
if (r->sdiag_family != AF_UNSPEC &&
sk->sk_family != r->sdiag_family)
goto next;
if (r->id.idiag_sport != inet->inet_sport &&
r->id.idiag_sport)
goto next;
if (r->id.idiag_dport != inet->inet_dport &&
r->id.idiag_dport)
goto next;
if (sk_diag_dump(sk, skb, cb, r, bc) < 0) {
spin_unlock_bh(&hslot->lock);
goto done;
}
next:
num++;
}
spin_unlock_bh(&hslot->lock);
}
done:
cb->args[0] = slot;
cb->args[1] = num;
}
static void udp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
struct inet_diag_req *r, struct nlattr *bc)
{
udp_dump(&udp_table, skb, cb, r, bc);
}
static int udp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
struct inet_diag_req *req)
{
return udp_dump_one(&udp_table, in_skb, nlh, req);
}
static const struct inet_diag_handler udp_diag_handler = {
.dump = udp_diag_dump,
.dump_one = udp_diag_dump_one,
.idiag_type = IPPROTO_UDP,
};
static void udplite_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
struct inet_diag_req *r, struct nlattr *bc)
{
udp_dump(&udplite_table, skb, cb, r, bc);
}
static int udplite_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
struct inet_diag_req *req)
{
return udp_dump_one(&udplite_table, in_skb, nlh, req);
}
static const struct inet_diag_handler udplite_diag_handler = {
.dump = udplite_diag_dump,
.dump_one = udplite_diag_dump_one,
.idiag_type = IPPROTO_UDPLITE,
};
static int __init udp_diag_init(void)
{
int err;
err = inet_diag_register(&udp_diag_handler);
if (err)
goto out;
err = inet_diag_register(&udplite_diag_handler);
if (err)
goto out_lite;
out:
return err;
out_lite:
inet_diag_unregister(&udp_diag_handler);
goto out;
}
static void __exit udp_diag_exit(void)
{
inet_diag_unregister(&udplite_diag_handler);
inet_diag_unregister(&udp_diag_handler);
}
module_init(udp_diag_init);
module_exit(udp_diag_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-17 /* AF_INET - IPPROTO_UDP */);
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-136 /* AF_INET - IPPROTO_UDPLITE */);
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* DDR controller registers of the i.MX7 architecture
*
* (C) Copyright 2017 CompuLab, Ltd. http://www.compulab.com
*
* Author: Uri Mashiach <uri.mashiach@compulab.co.il>
*/
#ifndef __ASM_ARCH_MX7_DDR_H__
#define __ASM_ARCH_MX7_DDR_H__
#ifndef __ASSEMBLY__
#include <linux/bitops.h>
#endif
/* DDRC Registers (DDRC_IPS_BASE_ADDR) */
struct ddrc {
u32 mstr; /* 0x0000 */
u32 reserved1[0x18];
u32 rfshtmg; /* 0x0064 */
u32 reserved2[0x1a];
u32 init0; /* 0x00d0 */
u32 init1; /* 0x00d4 */
u32 reserved3;
u32 init3; /* 0x00dc */
u32 init4; /* 0x00e0 */
u32 init5; /* 0x00e4 */
u32 reserved4[0x03];
u32 rankctl; /* 0x00f4 */
u32 reserved5[0x02];
u32 dramtmg0; /* 0x0100 */
u32 dramtmg1; /* 0x0104 */
u32 dramtmg2; /* 0x0108 */
u32 dramtmg3; /* 0x010c */
u32 dramtmg4; /* 0x0110 */
u32 dramtmg5; /* 0x0114 */
u32 reserved6[0x02];
u32 dramtmg8; /* 0x0120 */
u32 reserved7[0x17];
u32 zqctl0; /* 0x0180 */
u32 zqctl1; /* 0x0184 */
u32 zqctl2; /* 0x0188 */
u32 zqstat; /* 0x018c */
u32 dfitmg0; /* 0x0190 */
u32 dfitmg1; /* 0x0194 */
u32 reserved9[0x02];
u32 dfiupd0; /* 0x01a0 */
u32 dfiupd1; /* 0x01a4 */
u32 dfiupd2; /* 0x01a8 */
u32 reserved10[0x15];
u32 addrmap0; /* 0x0200 */
u32 addrmap1; /* 0x0204 */
u32 addrmap2; /* 0x0208 */
u32 addrmap3; /* 0x020c */
u32 addrmap4; /* 0x0210 */
u32 addrmap5; /* 0x0214 */
u32 addrmap6; /* 0x0218 */
u32 reserved12[0x09];
u32 odtcfg; /* 0x0240 */
u32 odtmap; /* 0x0244 */
};
/* DDRC_MSTR fields */
#define MSTR_DATA_BUS_WIDTH_MASK 0x3 << 12
#define MSTR_DATA_BUS_WIDTH_SHIFT 12
#define MSTR_DATA_ACTIVE_RANKS_MASK 0xf << 24
#define MSTR_DATA_ACTIVE_RANKS_SHIFT 24
/* DDRC_ADDRMAP1 fields */
#define ADDRMAP1_BANK_B0_MASK 0x1f << 0
#define ADDRMAP1_BANK_B0_SHIFT 0
#define ADDRMAP1_BANK_B1_MASK 0x1f << 8
#define ADDRMAP1_BANK_B1_SHIFT 8
#define ADDRMAP1_BANK_B2_MASK 0x1f << 16
#define ADDRMAP1_BANK_B2_SHIFT 16
/* DDRC_ADDRMAP2 fields */
#define ADDRMAP2_COL_B2_MASK 0xF << 0
#define ADDRMAP2_COL_B2_SHIFT 0
#define ADDRMAP2_COL_B3_MASK 0xF << 8
#define ADDRMAP2_COL_B3_SHIFT 8
#define ADDRMAP2_COL_B4_MASK 0xF << 16
#define ADDRMAP2_COL_B4_SHIFT 16
#define ADDRMAP2_COL_B5_MASK 0xF << 24
#define ADDRMAP2_COL_B5_SHIFT 24
/* DDRC_ADDRMAP3 fields */
#define ADDRMAP3_COL_B6_MASK 0xF << 0
#define ADDRMAP3_COL_B6_SHIFT 0
#define ADDRMAP3_COL_B7_MASK 0xF << 8
#define ADDRMAP3_COL_B7_SHIFT 8
#define ADDRMAP3_COL_B8_MASK 0xF << 16
#define ADDRMAP3_COL_B8_SHIFT 16
#define ADDRMAP3_COL_B9_MASK 0xF << 24
#define ADDRMAP3_COL_B9_SHIFT 24
/* DDRC_ADDRMAP4 fields */
#define ADDRMAP4_COL_B10_MASK 0xF << 0
#define ADDRMAP4_COL_B10_SHIFT 0
#define ADDRMAP4_COL_B11_MASK 0xF << 8
#define ADDRMAP4_COL_B11_SHIFT 8
/* DDRC_ADDRMAP5 fields */
#define ADDRMAP5_ROW_B0_MASK 0xF << 0
#define ADDRMAP5_ROW_B0_SHIFT 0
#define ADDRMAP5_ROW_B1_MASK 0xF << 8
#define ADDRMAP5_ROW_B1_SHIFT 8
#define ADDRMAP5_ROW_B2_10_MASK 0xF << 16
#define ADDRMAP5_ROW_B2_10_SHIFT 16
#define ADDRMAP5_ROW_B11_MASK 0xF << 24
#define ADDRMAP5_ROW_B11_SHIFT 24
/* DDRC_ADDRMAP6 fields */
#define ADDRMAP6_ROW_B12_MASK 0xF << 0
#define ADDRMAP6_ROW_B12_SHIFT 0
#define ADDRMAP6_ROW_B13_MASK 0xF << 8
#define ADDRMAP6_ROW_B13_SHIFT 8
#define ADDRMAP6_ROW_B14_MASK 0xF << 16
#define ADDRMAP6_ROW_B14_SHIFT 16
#define ADDRMAP6_ROW_B15_MASK 0xF << 24
#define ADDRMAP6_ROW_B15_SHIFT 24
/* DDRC_MP Registers */
#define DDRC_MP_BASE_ADDR (DDRC_IPS_BASE_ADDR + 0x03fc)
struct ddrc_mp {
u32 reserved1[0x25];
u32 pctrl_0; /* 0x0094 */
};
/* DDR_PHY registers */
struct ddr_phy {
u32 phy_con0; /* 0x0000 */
u32 phy_con1; /* 0x0004 */
u32 reserved1[0x02];
u32 phy_con4; /* 0x0010 */
u32 reserved2;
u32 offset_lp_con0; /* 0x0018 */
u32 reserved3;
u32 offset_rd_con0; /* 0x0020 */
u32 reserved4[0x03];
u32 offset_wr_con0; /* 0x0030 */
u32 reserved5[0x07];
u32 cmd_sdll_con0; /* 0x0050 */
u32 reserved6[0x06];
u32 cmd_lvl_con0; /* 0x006c */
u32 reserved7[0x02];
u32 cmd_lvl_con3; /* 0x0078 */
u32 cmd_deskew_con0; /* 0x007c */
u32 cmd_deskew_con1; /* 0x0080 */
u32 cmd_deskew_con2; /* 0x0084 */
u32 cmd_deskew_con3; /* 0x0088 */
u32 reserved8[0x02];
u32 cmd_deskew_con4; /* 0x0094 */
u32 reserved9;
u32 drvds_con0; /* 0x009c */
u32 reserved10[0x04];
u32 mdll_con0; /* 0x00b0 */
u32 reserved11[0x03];
u32 zq_con0; /* 0x00c0 */
};
#define DDR_PHY_CMD_SDLL_CON0_CTRL_RESYNC_MASK BIT(24)
#define MX7_CAL_VAL_MAX 5
/* Calibration parameters */
struct mx7_calibration {
int num_val; /* Number of calibration values */
u32 values[MX7_CAL_VAL_MAX]; /* calibration values */
};
void mx7_dram_cfg(struct ddrc *ddrc_regs_val, struct ddrc_mp *ddrc_mp_val,
struct ddr_phy *ddr_phy_regs_val,
struct mx7_calibration *calib_param);
#endif /*__ASM_ARCH_MX7_DDR_H__ */
|
/*
* sleep.c - x86-specific ACPI sleep support.
*
* Copyright (C) 2001-2003 Patrick Mochel
* Copyright (C) 2001-2003 Pavel Machek <pavel@suse.cz>
*/
#include <linux/acpi.h>
#include <linux/bootmem.h>
#include <linux/dmi.h>
#include <linux/cpumask.h>
#include <asm/segment.h>
#include <asm/desc.h>
#include "realmode/wakeup.h"
#include "sleep.h"
unsigned long acpi_wakeup_address;
unsigned long acpi_realmode_flags;
/* address in low memory of the wakeup routine. */
static unsigned long acpi_realmode;
#if defined(CONFIG_SMP) && defined(CONFIG_64BIT)
static char temp_stack[10240];
#endif
/**
* acpi_save_state_mem - save kernel state
*
* Create an identity mapped page table and copy the wakeup routine to
* low memory.
*
* Note that this is too late to change acpi_wakeup_address.
*/
int acpi_save_state_mem(void)
{
struct wakeup_header *header;
if (!acpi_realmode) {
printk(KERN_ERR "Could not allocate memory during boot, "
"S3 disabled\n");
return -ENOMEM;
}
memcpy((void *)acpi_realmode, &wakeup_code_start, WAKEUP_SIZE);
header = (struct wakeup_header *)(acpi_realmode + HEADER_OFFSET);
if (header->signature != 0x51ee1111) {
printk(KERN_ERR "wakeup header does not match\n");
return -EINVAL;
}
header->video_mode = saved_video_mode;
header->wakeup_jmp_seg = acpi_wakeup_address >> 4;
/*
* Set up the wakeup GDT. We set these up as Big Real Mode,
* that is, with limits set to 4 GB. At least the Lenovo
* Thinkpad X61 is known to need this for the video BIOS
* initialization quirk to work; this is likely to also
* be the case for other laptops or integrated video devices.
*/
/* GDT[0]: GDT self-pointer */
header->wakeup_gdt[0] =
(u64)(sizeof(header->wakeup_gdt) - 1) +
((u64)(acpi_wakeup_address +
((char *)&header->wakeup_gdt - (char *)acpi_realmode))
<< 16);
/* GDT[1]: big real mode-like code segment */
header->wakeup_gdt[1] =
GDT_ENTRY(0x809b, acpi_wakeup_address, 0xfffff);
/* GDT[2]: big real mode-like data segment */
header->wakeup_gdt[2] =
GDT_ENTRY(0x8093, acpi_wakeup_address, 0xfffff);
#ifndef CONFIG_64BIT
store_gdt((struct desc_ptr *)&header->pmode_gdt);
header->pmode_efer_low = nx_enabled;
if (header->pmode_efer_low & 1) {
/* This is strange, why not save efer, always? */
rdmsr(MSR_EFER, header->pmode_efer_low,
header->pmode_efer_high);
}
#endif /* !CONFIG_64BIT */
header->pmode_cr0 = read_cr0();
header->pmode_cr4 = read_cr4_safe();
header->realmode_flags = acpi_realmode_flags;
header->real_magic = 0x12345678;
#ifndef CONFIG_64BIT
header->pmode_entry = (u32)&wakeup_pmode_return;
header->pmode_cr3 = (u32)(swsusp_pg_dir - __PAGE_OFFSET);
saved_magic = 0x12345678;
#else /* CONFIG_64BIT */
header->trampoline_segment = setup_trampoline() >> 4;
#ifdef CONFIG_SMP
stack_start.sp = temp_stack + 4096;
early_gdt_descr.address =
(unsigned long)get_cpu_gdt_table(smp_processor_id());
#endif
initial_code = (unsigned long)wakeup_long64;
saved_magic = 0x123456789abcdef0;
#endif /* CONFIG_64BIT */
return 0;
}
/*
* acpi_restore_state - undo effects of acpi_save_state_mem
*/
void acpi_restore_state_mem(void)
{
}
/**
* acpi_reserve_bootmem - do _very_ early ACPI initialisation
*
* We allocate a page from the first 1MB of memory for the wakeup
* routine for when we come back from a sleep state. The
* runtime allocator allows specification of <16MB pages, but not
* <1MB pages.
*/
void __init acpi_reserve_bootmem(void)
{
if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) {
printk(KERN_ERR
"ACPI: Wakeup code way too big, S3 disabled.\n");
return;
}
acpi_realmode = (unsigned long)alloc_bootmem_low(WAKEUP_SIZE);
if (!acpi_realmode) {
printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n");
return;
}
acpi_wakeup_address = virt_to_phys((void *)acpi_realmode);
}
static int __init acpi_sleep_setup(char *str)
{
while ((str != NULL) && (*str != '\0')) {
if (strncmp(str, "s3_bios", 7) == 0)
acpi_realmode_flags |= 1;
if (strncmp(str, "s3_mode", 7) == 0)
acpi_realmode_flags |= 2;
if (strncmp(str, "s3_beep", 7) == 0)
acpi_realmode_flags |= 4;
#ifdef CONFIG_HIBERNATION
if (strncmp(str, "s4_nohwsig", 10) == 0)
acpi_no_s4_hw_signature();
#endif
if (strncmp(str, "old_ordering", 12) == 0)
acpi_old_suspend_ordering();
str = strchr(str, ',');
if (str != NULL)
str += strspn(str, ", \t");
}
return 1;
}
__setup("acpi_sleep=", acpi_sleep_setup);
|
/** @file
Provides a service to retrieve a pointer to the Standalone MM Services Table.
Only available to MM_STANDALONE, SMM/DXE Combined and SMM module types.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __MM_SERVICES_TABLE_LIB_H__
#define __MM_SERVICES_TABLE_LIB_H__
#include <PiMm.h>
extern EFI_MM_SYSTEM_TABLE *gMmst;
#endif
|
/*
* Copyright (C) 2007 HTC Incorporated
* Author: Jay Tu (jay_tu@htc.com)
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _HTC_BATTERY_H_
#define _HTC_BATTERY_H_
#include <linux/notifier.h>
#include <linux/power_supply.h>
#define BATT_EVENT_SUSPEND 0x01
enum batt_ctl_t {
DISABLE = 0,
ENABLE_SLOW_CHG,
ENABLE_FAST_CHG
};
/* This order is the same as htc_power_supplies[]
* And it's also the same as htc_cable_status_update()
*/
enum charger_type_t {
CHARGER_UNKNOWN = -1,
CHARGER_BATTERY = 0,
CHARGER_USB,
CHARGER_AC
};
enum {
GUAGE_NONE,
GUAGE_MODEM,
GUAGE_DS2784,
};
enum {
LINEAR_CHARGER,
SWITCH_CHARGER,
};
struct battery_info_reply {
u32 batt_id; /* Battery ID from ADC */
u32 batt_vol; /* Battery voltage from ADC */
s32 batt_temp; /* Battery Temperature (C) from formula and ADC */
u32 batt_current; /* Battery current from ADC */
u32 level; /* formula */
u32 charging_source; /* 0: no cable, 1:usb, 2:AC */
u32 charging_enabled; /* 0: Disable, 1: Enable */
u32 full_bat; /* Full capacity of battery (mAh) */
u32 full_level; /* Full Level */
u32 over_vchg; /* 0:normal, 1:over voltage charger */
};
struct htc_battery_platform_data {
int (*func_show_batt_attr)(struct device_attribute *attr,
char *buf);
int gpio_mbat_in;
int gpio_usb_id;
int gpio_mchg_en_n;
int gpio_iset;
int guage_driver;
int m2a_cable_detect;
int charger;
};
#if CONFIG_HTC_BATTCHG
extern int register_notifier_cable_status(struct notifier_block *nb);
extern int unregister_notifier_cable_status(struct notifier_block *nb);
#else
static int register_notifier_cable_status(struct notifier_block *nb) { return 0; }
static int unregister_notifier_cable_status(struct notifier_block *nb) { return 0; }
#endif
#ifdef CONFIG_BATTERY_DS2784
extern int battery_charging_ctrl(enum batt_ctl_t ctl);
#endif
#ifdef CONFIG_HTC_BATTCHG
extern int batt_register_client(struct notifier_block *nb);
extern int batt_unregister_client(struct notifier_block *nb);
extern int batt_notifier_call_chain(unsigned long val, void *v);
#else
static int batt_register_client(struct notifier_block *nb)
{
return 0;
}
static int batt_unregister_client(struct notifier_block *nb)
{
return 0;
}
static int batt_notifier_call_chain(unsigned long val, void *v)
{
return 0;
}
#endif
extern unsigned int batt_get_status(enum power_supply_property psp);
#endif
|
/*
* arch/arm/mach-spear3xx/spear3xx.c
*
* SPEAr3XX machines common source file
*
* Copyright (C) 2009-2012 ST Microelectronics
* Viresh Kumar <viresh.kumar@st.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#define pr_fmt(fmt) "SPEAr3xx: " fmt
#include <linux/amba/pl022.h>
#include <linux/amba/pl08x.h>
#include <linux/of_irq.h>
#include <linux/io.h>
#include <asm/hardware/pl080.h>
#include <asm/hardware/vic.h>
#include <plat/pl080.h>
#include <mach/generic.h>
#include <mach/spear.h>
/* ssp device registration */
struct pl022_ssp_controller pl022_plat_data = {
.bus_id = 0,
.enable_dma = 1,
.dma_filter = pl08x_filter_id,
.dma_tx_param = "ssp0_tx",
.dma_rx_param = "ssp0_rx",
/*
* This is number of spi devices that can be connected to spi. There are
* two type of chipselects on which slave devices can work. One is chip
* select provided by spi masters other is controlled through external
* gpio's. We can't use chipselect provided from spi master (because as
* soon as FIFO becomes empty, CS is disabled and transfer ends). So
* this number now depends on number of gpios available for spi. each
* slave on each master requires a separate gpio pin.
*/
.num_chipselect = 2,
};
/* dmac device registration */
struct pl08x_platform_data pl080_plat_data = {
.memcpy_channel = {
.bus_id = "memcpy",
.cctl = (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \
PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \
PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \
PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \
PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \
PL080_CONTROL_PROT_SYS),
},
.lli_buses = PL08X_AHB1,
.mem_buses = PL08X_AHB1,
.get_signal = pl080_get_signal,
.put_signal = pl080_put_signal,
};
/*
* Following will create 16MB static virtual/physical mappings
* PHYSICAL VIRTUAL
* 0xD0000000 0xFD000000
* 0xFC000000 0xFC000000
*/
struct map_desc spear3xx_io_desc[] __initdata = {
{
.virtual = VA_SPEAR3XX_ICM1_2_BASE,
.pfn = __phys_to_pfn(SPEAR3XX_ICM1_2_BASE),
.length = SZ_16M,
.type = MT_DEVICE
}, {
.virtual = VA_SPEAR3XX_ICM3_SMI_CTRL_BASE,
.pfn = __phys_to_pfn(SPEAR3XX_ICM3_SMI_CTRL_BASE),
.length = SZ_16M,
.type = MT_DEVICE
},
};
/* This will create static memory mapping for selected devices */
void __init spear3xx_map_io(void)
{
iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
}
static void __init spear3xx_timer_init(void)
{
char pclk_name[] = "pll3_48m_clk";
struct clk *gpt_clk, *pclk;
spear3xx_clk_init();
/* get the system timer clock */
gpt_clk = clk_get_sys("gpt0", NULL);
if (IS_ERR(gpt_clk)) {
pr_err("%s:couldn't get clk for gpt\n", __func__);
BUG();
}
/* get the suitable parent clock for timer*/
pclk = clk_get(NULL, pclk_name);
if (IS_ERR(pclk)) {
pr_err("%s:couldn't get %s as parent for gpt\n",
__func__, pclk_name);
BUG();
}
clk_set_parent(gpt_clk, pclk);
clk_put(gpt_clk);
clk_put(pclk);
spear_setup_of_timer();
}
struct sys_timer spear3xx_timer = {
.init = spear3xx_timer_init,
};
static const struct of_device_id vic_of_match[] __initconst = {
{ .compatible = "arm,pl190-vic", .data = vic_of_init, },
{ /* Sentinel */ }
};
void __init spear3xx_dt_init_irq(void)
{
of_irq_init(vic_of_match);
}
|
/* The IGEN simulator generator for GDB, the GNU Debugger.
Copyright 2002, 2007, 2008 Free Software Foundation, Inc.
Contributed by Andrew Cagney.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
typedef struct _opcode_field opcode_field;
struct _opcode_field
{
int word_nr;
int first;
int last;
int is_boolean;
int nr_opcodes;
unsigned boolean_constant;
opcode_field *parent;
};
typedef struct _opcode_bits opcode_bits;
struct _opcode_bits
{
int value;
int first;
int last;
insn_field_entry *field;
opcode_field *opcode;
opcode_bits *next;
};
typedef struct _insn_opcodes insn_opcodes;
struct _insn_opcodes
{
opcode_field *opcode;
insn_opcodes *next;
};
typedef struct _insn_list insn_list;
struct _insn_list
{
/* the instruction */
insn_entry *insn;
/* list of non constant bits that have been made constant */
opcode_bits *expanded_bits;
/* list of the various opcode field paths used to reach this
instruction */
insn_opcodes *opcodes;
/* number of prefetched words for this instruction */
int nr_prefetched_words;
/* The semantic function list_entry corresponding to this insn */
insn_list *semantic;
/* linked list */
insn_list *next;
};
/* forward */
typedef struct _gen_list gen_list;
typedef struct _gen_entry gen_entry;
struct _gen_entry
{
/* as an entry in a table */
int word_nr;
int opcode_nr;
gen_entry *sibling;
opcode_bits *expanded_bits;
gen_entry *parent; /* parent has the opcode* data */
/* as a table containing entries */
decode_table *opcode_rule;
opcode_field *opcode;
int nr_prefetched_words;
int nr_entries;
gen_entry *entries;
/* as both an entry and a table */
int nr_insns;
insn_list *insns;
/* if siblings are being combined */
gen_entry *combined_next;
gen_entry *combined_parent;
/* our top-of-tree */
gen_list *top;
};
struct _gen_list
{
model_entry *model;
insn_table *isa;
gen_entry *table;
gen_list *next;
};
typedef struct _gen_table gen_table;
struct _gen_table
{
/* list of all the instructions */
insn_table *isa;
/* list of all the semantic functions */
decode_table *rules;
/* list of all the generated instruction tables */
gen_list *tables;
/* list of all the semantic functions */
int nr_semantics;
insn_list *semantics;
};
extern gen_table *make_gen_tables (insn_table *isa, decode_table *rules);
extern void gen_tables_expand_insns (gen_table *gen);
extern void gen_tables_expand_semantics (gen_table *gen);
extern int gen_entry_depth (gen_entry *table);
/* Traverse the created data structure */
typedef void gen_entry_handler
(lf *file, gen_entry *entry, int depth, void *data);
extern void gen_entry_traverse_tree
(lf *file,
gen_entry *table,
int depth,
gen_entry_handler * start,
gen_entry_handler * leaf, gen_entry_handler * end, void *data);
/* Misc functions - actually in igen.c */
/* Cache functions: */
extern int print_icache_function_formal (lf *file, int nr_prefetched_words);
extern int print_icache_function_actual (lf *file, int nr_prefetched_words);
extern int print_icache_function_type (lf *file);
extern int print_semantic_function_formal (lf *file, int nr_prefetched_words);
extern int print_semantic_function_actual (lf *file, int nr_prefetched_words);
extern int print_semantic_function_type (lf *file);
extern int print_idecode_function_formal (lf *file, int nr_prefetched_words);
extern int print_idecode_function_actual (lf *file, int nr_prefetched_words);
typedef enum
{
function_name_prefix_semantics,
function_name_prefix_idecode,
function_name_prefix_itable,
function_name_prefix_icache,
function_name_prefix_engine,
function_name_prefix_none
}
lf_function_name_prefixes;
typedef enum
{
is_function_declaration = 0,
is_function_definition = 1,
is_function_variable,
}
function_decl_type;
extern int print_function_name
(lf *file,
const char *basename,
const char *format_name,
const char *model_name,
opcode_bits *expanded_bits, lf_function_name_prefixes prefix);
extern void print_my_defines
(lf *file,
const char *basename, const char *format_name, opcode_bits *expanded_bits);
extern void print_itrace (lf *file, insn_entry * insn, int idecode);
extern void print_sim_engine_abort (lf *file, const char *message);
extern void print_include (lf *file, igen_module module);
extern void print_include_inline (lf *file, igen_module module);
extern void print_includes (lf *file);
|
#undef CONFIG_CRYPTPW
|
/***************************************************************************
Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
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 Texas Instruments Incorporated 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 __BATTERY_H__
#define __BATTERY_H__
#include <openchronos.h>
void battery_init(void);
void battery_measurement(void);
/* Battery high voltage threshold */
#define BATTERY_HIGH_THRESHOLD (360u)
/* Battery end of life voltage threshold -> disable radio,
show "lobatt" message */
#define BATTERY_LOW_THRESHOLD (240u)
/* Where we consider the battery full - A guess, but a pretty safe one at this point*/
#define BATTERY_FULL_THRESHOLD (310u)
/* Where we consider the battery empty */
#define BATTERY_EMPTY_THRESHOLD (220u)
struct {
/* Battery voltage */
uint16_t voltage;
/* Battery voltage offset */
int16_t offset;
} battery_info;
#endif /* __BATTERY_H__ */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.