text stringlengths 4 6.14k |
|---|
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#ifndef _EXIDEVICE_AMBASEBOARD_H
#define _EXIDEVICE_AMBASEBOARD_H
class CEXIAMBaseboard : public IEXIDevice
{
public:
CEXIAMBaseboard();
virtual void SetCS(int _iCS) override;
virtual bool IsPresent() override;
virtual bool IsInterruptSet() override;
virtual void DoState(PointerWrap &p) override;
private:
virtual void TransferByte(u8& _uByte) override;
int m_position;
bool m_have_irq;
unsigned char m_command[4];
};
#endif
|
/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
***/
#include <errno.h>
#include <unistd.h>
#include "fileio.h"
#include "fileio-label.h"
#include "fs-util.h"
#include "log.h"
#include "selinux-util.h"
#include "string-util.h"
#include "util.h"
int main(int argc, char*argv[]) {
int r, k;
if (argc != 2) {
log_error("This program requires one argument.");
return EXIT_FAILURE;
}
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();
umask(0022);
mac_selinux_init();
if (streq(argv[1], "start")) {
r = unlink_or_warn("/run/nologin");
k = unlink_or_warn("/etc/nologin");
if (k < 0 && r >= 0)
r = k;
} else if (streq(argv[1], "stop"))
r = create_shutdown_run_nologin_or_warn();
else {
log_error("Unknown verb '%s'.", argv[1]);
r = -EINVAL;
}
mac_selinux_finish();
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
|
/* SCCS Id: @(#)gnsignal.h 3.4 2000/07/16 */
/* Copyright (C) 1998 by Anthony Taylor <tonyt@ptialaska.net> */
/* NetHack may be freely redistributed. See license for details. */
#ifndef GnomeHackSignals_h
#define GnomeHackSignals_h
#include <gtk/gtk.h>
#include <gnome.h>
#include "gnomeprv.h"
#include "gnglyph.h"
/* The list of custom signals */
enum {
GHSIG_CURS,
GHSIG_PUTSTR,
GHSIG_PRINT_GLYPH,
GHSIG_CLEAR,
GHSIG_DISPLAY,
GHSIG_START_MENU,
GHSIG_ADD_MENU,
GHSIG_END_MENU,
GHSIG_SELECT_MENU,
GHSIG_CLIPAROUND,
GHSIG_FADE_HIGHLIGHT,
GHSIG_DELAY,
GHSIG_LAST_SIG
};
guint ghack_signals[GHSIG_LAST_SIG];
extern void ghack_init_signals( void);
void ghack_handle_key_press(GtkWidget *widget, GdkEventKey *event,
gpointer data);
void ghack_handle_button_press(GtkWidget *widget, GdkEventButton *event,
gpointer data);
typedef struct {
int x, y, mod;
} GHClick;
extern GList *g_keyBuffer;
extern GList *g_clickBuffer;
extern int g_numKeys;
extern int g_numClicks;
extern int g_askingQuestion;
void ghack_delay( GtkWidget *win, int numMillisecs, gpointer data);
#endif /* GnomeHackSignals_h */
|
/********************************************************************************************************
*
* File : ws_pcf8563.h
* Hardware Environment:
* Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
* Version :
* By : Su Wei Feng
*
* (c) Copyright 2005-2010, WaveShare
* http://www.waveshare.net
* All Rights Reserved
*
*********************************************************************************************************/
#ifndef _WS_PCF8563_H_
#define _WS_PCF8563_H_
#define CTRL_BUF1 0x00
#define CTRL_BUF2 0x01
#define SECOND_DATA_BUF 0x02
#define MINUTE_DATA_BUF 0x03
#define HOUR_DATA_BUF 0x04
#define DAY_DATA_BUF 0x05
#define WEEK_DATA_BUF 0x06
#define MONTH_DATA_BUF 0x07
#define YEAR_DATA_BUF 0x08
#define MINUTE_AE_BUF 0x09
#define HOUR_AE_BUF 0x0A
#define DAY_AE_BUF 0x0B
#define WEEK_AE_BUF 0x0C
#define CLK_FRQ_BUF 0x0D
#define TIMER_CTRL_BUF 0x0E
#define COUNT_VAL_BUF 0x0F
void WriteAByte(uchar wordAdr,uchar dat)
{
SMBus_Write(0xA2,wordAdr,dat,2);
}
void ReadNByte(uchar wordAdr,uchar *pRdDat)
{
SMBus_Write(0xA2,wordAdr,0,1);
SMBus_Read(0xA3,pRdDat,4);
}
void PCF8563_getTime(uchar *buf)
{
ReadNByte(SECOND_DATA_BUF,buf);
buf[0] = buf[0] & 0x7f; //get second data
buf[1] = buf[1] & 0x7f; //get minute data
buf[2] = buf[2] & 0x3f; //get hour data
buf[0] = changeHexToInt(buf[0]);
buf[1] = changeHexToInt(buf[1]);
buf[2] = changeHexToInt(buf[2]);
}
void PCF8563_setTime(uchar hour,uchar minute,uchar second)
{
hour = changeIntToHex(hour); //½«Êý¾ÝµÄDex¸ñʽת»»ÎªHex¸ñʽ
minute = changeIntToHex(minute);
second = changeIntToHex(second);
WriteAByte(HOUR_DATA_BUF,hour);
WriteAByte(MINUTE_DATA_BUF,minute);
WriteAByte(SECOND_DATA_BUF,second);
}
void PCF8563_init(void)
{
WriteAByte(CTRL_BUF1,0x00); //basic setting
WriteAByte(CTRL_BUF2,0x12); //alarm enable
}
#endif /*_WS_PCF8563_H_*/
|
/******************************************************************************
* Wormux is a convivial mass murder game.
* Copyright (C) 2001-2010 Wormux Team.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
******************************************************************************
* Refresh character strings.
*****************************************************************************/
#ifndef STRING_TOOLS_H
#define STRING_TOOLS__H
#include "include/base.h"
#include <string>
// Conversion string -> type
// Renvoie false cas d'erreur
bool str2long (const std::string &txt, long &valeur);
bool str2int (const std::string &txt, int &valeur);
bool str2Double (const std::string &txt, Double &valeur);
bool str2bool(const std::string &str, bool &value);
// Conversion type -> string
std::string long2str (long x);
std::string ulong2str (ulong x);
std::string Double2str (Double x, int places = -1);
std::string bool2str (bool x);
#ifdef _WIN32
// Allocated with new
char* LocaleToUTF8(const char* orig);
#endif
#endif
|
/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
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/>. */
#include <ctype.h>
#include <wctype.h>
#include "wchar-lookup.h"
#undef __iswctype
int
__iswctype (wint_t wc, wctype_t desc)
{
/* If the user passes in an invalid DESC valid (the one returned from
`wctype' in case of an error) simply return 0. */
if (desc == (wctype_t) 0)
return 0;
return wctype_table_lookup ((const char *) desc, wc);
}
libc_hidden_def (__iswctype)
weak_alias (__iswctype, iswctype)
|
/*
* Copyright (C) 2011 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 INC. AND ITS 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 APPLE INC. OR ITS 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 CorrectionPanel_h
#define CorrectionPanel_h
#if USE(AUTOCORRECTION_PANEL)
#import <AppKit/NSSpellChecker.h>
#import <WebCore/AlternativeTextClient.h>
#import <wtf/RetainPtr.h>
@class WebView;
class CorrectionPanel {
WTF_MAKE_NONCOPYABLE(CorrectionPanel);
public:
CorrectionPanel();
~CorrectionPanel();
void show(WebView*, WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
String dismiss(WebCore::ReasonForDismissingAlternativeText);
static void recordAutocorrectionResponse(NSInteger spellCheckerDocumentTag, NSCorrectionResponse, const String& replacedString, const String& replacementString);
private:
bool isShowing() const { return m_view; }
String dismissInternal(WebCore::ReasonForDismissingAlternativeText, bool dismissingExternally);
void handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType);
bool m_wasDismissedExternally;
WebCore::ReasonForDismissingAlternativeText m_reasonForDismissing;
RetainPtr<WebView> m_view;
RetainPtr<NSString> m_resultForDismissal;
};
#endif // USE(AUTOCORRECTION_PANEL)
#endif // CorrectionPanel_h
|
/* Copyright (C) 2005-2017 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/>. */
#include <unistd.h>
#include <sys/param.h>
ssize_t
__pread_chk (int fd, void *buf, size_t nbytes, off_t offset, size_t buflen)
{
if (nbytes > buflen)
__chk_fail ();
return __pread (fd, buf, nbytes, offset);
}
|
/**-------------------------------------------------------------------**
** CLooG **
**-------------------------------------------------------------------**
** statement.h **
**-------------------------------------------------------------------**
** First version: november 4th 2001 **
**-------------------------------------------------------------------**/
/******************************************************************************
* CLooG : the Chunky Loop Generator (experimental) *
******************************************************************************
* *
* Copyright (C) 2001-2005 Cedric Bastoul *
* *
* This 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 software 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 software; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
* *
* CLooG, the Chunky Loop Generator *
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
* *
******************************************************************************/
#ifndef CLOOG_STATEMENT_H
#define CLOOG_STATEMENT_H
#if defined(__cplusplus)
extern "C"
{
#endif
struct cloogstatement
{ int _number ; /* The statement unique number. */
void *_usr ; /* A pointer for library users convenience. */
struct cloogstatement *_next ; /* Pointer to the next statement with the
* same original domain and the same
* scattering function.
*/
} ;
typedef struct cloogstatement CloogStatement ;
static inline int cloog_statement_number (CloogStatement *s)
{
return s->_number;
}
static inline void cloog_statement_set_number (CloogStatement *s, int n)
{
s->_number = n;
}
static inline void *cloog_statement_usr (CloogStatement *s)
{
return s->_usr;
}
static inline void cloog_statement_set_usr (CloogStatement *s, void *u)
{
s->_usr = u;
}
static inline CloogStatement *cloog_statement_next (CloogStatement *s)
{
return s->_next;
}
static inline void cloog_statement_set_next (CloogStatement *s, CloogStatement *n)
{
s->_next = n;
}
/******************************************************************************
* Structure display function *
******************************************************************************/
void cloog_statement_print_structure(FILE *, CloogStatement *, int) ;
void cloog_statement_print(FILE *, CloogStatement *) ;
/******************************************************************************
* Memory deallocation function *
******************************************************************************/
void cloog_statement_free(CloogStatement *) ;
/******************************************************************************
* Processing functions *
******************************************************************************/
CloogStatement * cloog_statement_malloc(void);
CloogStatement * cloog_statement_alloc(int) ;
CloogStatement * cloog_statement_copy(CloogStatement *) ;
void cloog_statement_add(CloogStatement**, CloogStatement**, CloogStatement*) ;
#if defined(__cplusplus)
}
#endif
#endif /* define _H */
|
/**
* @file
*
* Instantiate the clock driver shell.
*/
/*
* COPYRIGHT (c) 1989-2012.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#include <rtems.h>
#include <bsp/irq.h>
#include <bsp.h>
#include <stdio.h>
#include <stdlib.h>
#include "yamon_api.h"
/* #define CLOCK_DRIVER_USE_FAST_IDLE 1 */
#define CLOCK_VECTOR TX4938_IRQ_TMR0
#define TX4938_TIMER_INTERVAL_MODE 1
#define TX4938_TIMER_MODE TX4938_TIMER_INTERVAL_MODE
#if (TX4938_TIMER_MODE == TX4938_TIMER_INTERVAL_MODE)
#define TX4938_TIMER_INTERRUPT_FLAG TIIS
#define Clock_driver_support_initialize_hardware() \
Initialize_timer0_in_interval_mode()
#else
#error "Build Error: unsupported timer mode"
#endif
void new_brk_esr(void);
t_yamon_retfunc esr_retfunc = 0;
t_yamon_ref original_brk_esr = 0;
t_yamon_ref original_tmr0_isr = 0;
void new_brk_esr(void)
{
if (original_tmr0_isr)
{
YAMON_FUNC_DEREGISTER_IC_ISR( original_tmr0_isr );
original_tmr0_isr = 0;
}
if (esr_retfunc)
esr_retfunc();
}
#define Clock_driver_support_install_isr( _new, _old ) \
do { \
rtems_interrupt_handler_install( \
CLOCK_VECTOR, \
"clock", \
0, \
_new, \
NULL \
); \
YAMON_FUNC_REGISTER_IC_ISR(17,(t_yamon_isr)_new,0,&original_tmr0_isr); /* Call Yamon to enable interrupt */ \
} while(0)
#define Clock_driver_support_at_tick() \
do { \
uint32_t interrupt_flag; \
do { \
int loop_count; \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_TISR, 0x0 ); /* Clear timer 0 interrupt */ \
loop_count = 0; \
do { /* Wait until interrupt flag is cleared (this prevents re-entering interrupt) */ \
/* Read back interrupt status register and isolate interval timer flag */ \
interrupt_flag = TX4938_REG_READ( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_TISR ) & TX4938_TIMER_INTERRUPT_FLAG; \
} while (interrupt_flag && (++loop_count < 10)); /* Loop while timer interrupt bit is set, or loop count is lees than 10 */ \
} while(interrupt_flag); \
} while(0)
/* Setup timer in interval mode to generate peiodic interrupts */
#define Initialize_timer0_in_interval_mode() \
do { \
uint32_t temp; \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_TCR, 0x0 ); /* Disable timer */ \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_CCDR, 0x0 ); /* Set register for divide by 2 clock */ \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_ITMR, TIMER_CLEAR_ENABLE_MASK ); /* Set interval timer mode register */ \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_CPRA, 0x3d090 ); /* Set tmier period ,10.0 msec (25 MHz timer clock) */ \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_TCR, 0xC0 ); /* Enable timer in interval mode */ \
temp = TX4938_REG_READ( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_ITMR ); /* Enable interval timer interrupts */ \
temp |= TIMER_INT_ENABLE_MASK; \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_ITMR, temp ); \
} while(0)
#define Clock_driver_support_shutdown_hardware() \
do { \
uint32_t temp; \
temp = TX4938_REG_READ( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_ITMR ); /* Disable interval timer interrupt */ \
temp &= ~TIMER_INT_ENABLE_MASK; \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_ITMR, temp ); \
temp = TX4938_REG_READ( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_PGMR ); /* Disable pulse generator interrupt */ \
temp &= ~(TPIAE | TPIBE); \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_PGMR, temp ); \
TX4938_REG_WRITE( TX4938_REG_BASE, TX4938_TIMER0_BASE + TX4938_TIMER_TCR, 0x0 ); /* Disable timer */ \
} while(0)
#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
#include "../../../shared/clockdrv_shell.h"
|
#include <asm/arch/acs.h>
#ifdef CONFIG_ACS
//main acs struct
struct acs_setting __acs_set={
.acs_magic = "acs_",
//chip id, m6:0x22 m8:0x24
.chip_type = 0x22,
.version = 1,
.acs_set_length = sizeof(__acs_set),
.ddr_magic = "ddr_",
.ddr_set_version= 1,
.ddr_set_length = sizeof(__ddr_setting),
.ddr_set_addr = &__ddr_setting,
.pll_magic = "pll_",
.pll_set_version= 1,
.pll_set_length = sizeof(__plls),
.pll_set_addr = &__plls,
.partition_table_magic = "part",
.partition_table_version = 1,
.partition_table_length = (MAX_PART_NUM*sizeof(struct partitions)),
.partition_table_addr = & partition_table,
.store_config_magic ="stor",
.store_config_version = 1,
.store_config_length = sizeof(store_configs),
.store_config_addr =& store_configs,
};
#endif
|
/*
* gnome-keyring
*
* Copyright (C) 2009 Stefan Walter
*
* This program 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 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __GKM_SECRET_BINARY_H__
#define __GKM_SECRET_BINARY_H__
#include "gkm-secret-collection.h"
#include "gkm/gkm-data-types.h"
#include "gkm/gkm-types.h"
GkmDataResult gkm_secret_binary_read (GkmSecretCollection *collection,
GkmSecretData *sdata,
gconstpointer data,
gsize n_data);
GkmDataResult gkm_secret_binary_write (GkmSecretCollection *collection,
GkmSecretData *sdata,
gpointer *data,
gsize *n_data);
#endif /* __GKM_SECRET_BINARY_H__ */
|
/* string.c
* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
* This file is part of the Linux-8086 C library and is distributed
* under the GNU Library General Public License.
*/
#include <string.h>
/********************** Function strrchr ************************************/
char *strrchr(const char *s, int c)
{
register const char *p = s + strlen(s);
/* For null it's just like strlen */
if (c == '\0')
return (char *)p;
while (p != s) {
if (*--p == c)
return (char *)p;
}
return NULL;
}
|
/*
* Copyright 2007 Freescale Semiconductor, Inc.
* York Sun <yorksun@freescale.com>
*
* FSL DIU Framebuffer driver
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <command.h>
#include <asm/io.h>
#ifdef CONFIG_FSL_DIU_FB
#include "../common/pixis.h"
#include "../common/fsl_diu_fb.h"
#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
#include <devices.h>
#include <video_fb.h>
#endif
extern unsigned int FSL_Logo_BMP[];
static int xres, yres;
void diu_set_pixel_clock(unsigned int pixclock)
{
volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
volatile ccsr_gur_t *gur = &immap->im_gur;
volatile unsigned int *guts_clkdvdr = &gur->clkdvdr;
unsigned long speed_ccb, temp, pixval;
speed_ccb = get_bus_freq(0);
temp = 1000000000/pixclock;
temp *= 1000;
pixval = speed_ccb / temp;
debug("DIU pixval = %lu\n", pixval);
/* Modify PXCLK in GUTS CLKDVDR */
debug("DIU: Current value of CLKDVDR = 0x%08x\n", *guts_clkdvdr);
temp = *guts_clkdvdr & 0x2000FFFF;
*guts_clkdvdr = temp; /* turn off clock */
*guts_clkdvdr = temp | 0x80000000 | ((pixval & 0x1F) << 16);
debug("DIU: Modified value of CLKDVDR = 0x%08x\n", *guts_clkdvdr);
}
void mpc8610hpcd_diu_init(void)
{
char *monitor_port;
int gamma_fix;
unsigned int pixel_format;
unsigned char tmp_val;
unsigned char pixis_arch;
tmp_val = in8(PIXIS_BASE + PIXIS_BRDCFG0);
pixis_arch = in8(PIXIS_BASE + PIXIS_VER);
monitor_port = getenv("monitor");
if (!strncmp(monitor_port, "0", 1)) { /* 0 - DVI */
xres = 1280;
yres = 1024;
if (pixis_arch == 0x01)
pixel_format = 0x88882317;
else
pixel_format = 0x88883316;
gamma_fix = 0;
out8(PIXIS_BASE + PIXIS_BRDCFG0, tmp_val | 0x08);
} else if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */
xres = 1024;
yres = 768;
pixel_format = 0x88883316;
gamma_fix = 0;
out8(PIXIS_BASE + PIXIS_BRDCFG0, (tmp_val & 0xf7) | 0x10);
} else if (!strncmp(monitor_port, "2", 1)) { /* 2 - Double link LVDS */
xres = 1280;
yres = 1024;
pixel_format = 0x88883316;
gamma_fix = 1;
out8(PIXIS_BASE + PIXIS_BRDCFG0, tmp_val & 0xe7);
} else { /* DVI */
xres = 1280;
yres = 1024;
pixel_format = 0x88882317;
gamma_fix = 0;
out8(PIXIS_BASE + PIXIS_BRDCFG0, tmp_val | 0x08);
}
fsl_diu_init(xres, pixel_format, gamma_fix,
(unsigned char *)FSL_Logo_BMP);
}
int mpc8610diu_init_show_bmp(cmd_tbl_t *cmdtp,
int flag, int argc, char *argv[])
{
unsigned int addr;
if (argc < 2) {
cmd_usage(cmdtp);
return 1;
}
if (!strncmp(argv[1],"init",4)) {
#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
fsl_diu_clear_screen();
drv_video_init();
#else
mpc8610hpcd_diu_init();
#endif
} else {
addr = simple_strtoul(argv[1], NULL, 16);
fsl_diu_clear_screen();
fsl_diu_display_bmp((unsigned char *)addr, 0, 0, 0);
}
return 0;
}
U_BOOT_CMD(
diufb, CONFIG_SYS_MAXARGS, 1, mpc8610diu_init_show_bmp,
"Init or Display BMP file",
"init\n - initialize DIU\n"
"addr\n - display bmp at address 'addr'\n"
);
#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
/*
* The Graphic Device
*/
GraphicDevice ctfb;
void *video_hw_init(void)
{
GraphicDevice *pGD = (GraphicDevice *) &ctfb;
struct fb_info *info;
mpc8610hpcd_diu_init();
/* fill in Graphic device struct */
sprintf(pGD->modeIdent,
"%dx%dx%d %ldkHz %ldHz",
xres, yres, 32, 64, 60);
pGD->frameAdrs = (unsigned int)fsl_fb_open(&info);
pGD->winSizeX = xres;
pGD->winSizeY = yres - info->logo_height;
pGD->plnSizeX = pGD->winSizeX;
pGD->plnSizeY = pGD->winSizeY;
pGD->gdfBytesPP = 4;
pGD->gdfIndex = GDF_32BIT_X888RGB;
pGD->isaBase = 0;
pGD->pciBase = 0;
pGD->memSize = info->screen_size - info->logo_size;
/* Cursor Start Address */
pGD->dprBase = 0;
pGD->vprBase = 0;
pGD->cprBase = 0;
return (void *)pGD;
}
void video_set_lut (unsigned int index, /* color number */
unsigned char r, /* red */
unsigned char g, /* green */
unsigned char b /* blue */
)
{
return;
}
#endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */
#endif /* CONFIG_FSL_DIU_FB */
|
/*
* Copyright (c) 2003 Matteo Frigo
* Copyright (c) 2003 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Sat Jul 5 22:11:28 EDT 2003 */
#include "codelet-rdft.h"
/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_hc2hc -compact -variables 4 -sign 1 -n 8 -dif -name hb_8 -include hb.h */
/*
* This function contains 66 FP additions, 32 FP multiplications,
* (or, 52 additions, 18 multiplications, 14 fused multiply/add),
* 30 stack variables, and 32 memory accesses
*/
/*
* Generator Id's :
* $Id: algsimp.ml,v 1.7 2003/03/15 20:29:42 stevenj Exp $
* $Id: fft.ml,v 1.2 2003/03/15 20:29:42 stevenj Exp $
* $Id: gen_hc2hc.ml,v 1.9 2003/04/17 19:25:50 athena Exp $
*/
#include "hb.h"
static const R *hb_8(R *rio, R *iio, const R *W, stride ios, int m, int dist)
{
DK(KP707106781, +0.707106781186547524400844362104849039284835938);
int i;
for (i = m - 2; i > 0; i = i - 2, rio = rio + dist, iio = iio - dist, W = W + 14) {
E T7, T18, T1d, Tg, Tx, TT, TY, TG, Te, TZ, T10, Tn, Tq, TM, TP;
E TH;
{
E T3, TR, Tt, TX, T6, TW, Tw, TS;
{
E T1, T2, Tr, Ts;
T1 = rio[0];
T2 = iio[-WS(ios, 4)];
T3 = T1 + T2;
TR = T1 - T2;
Tr = iio[0];
Ts = rio[WS(ios, 4)];
Tt = Tr - Ts;
TX = Tr + Ts;
}
{
E T4, T5, Tu, Tv;
T4 = rio[WS(ios, 2)];
T5 = iio[-WS(ios, 6)];
T6 = T4 + T5;
TW = T4 - T5;
Tu = iio[-WS(ios, 2)];
Tv = rio[WS(ios, 6)];
Tw = Tu - Tv;
TS = Tu + Tv;
}
T7 = T3 + T6;
T18 = TX - TW;
T1d = TR + TS;
Tg = T3 - T6;
Tx = Tt - Tw;
TT = TR - TS;
TY = TW + TX;
TG = Tt + Tw;
}
{
E Ta, TO, Tj, TN, Td, TK, Tm, TL;
{
E T8, T9, Th, Ti;
T8 = rio[WS(ios, 1)];
T9 = iio[-WS(ios, 5)];
Ta = T8 + T9;
TO = T8 - T9;
Th = iio[-WS(ios, 1)];
Ti = rio[WS(ios, 5)];
Tj = Th - Ti;
TN = Th + Ti;
}
{
E Tb, Tc, Tk, Tl;
Tb = iio[-WS(ios, 7)];
Tc = rio[WS(ios, 3)];
Td = Tb + Tc;
TK = Tb - Tc;
Tk = iio[-WS(ios, 3)];
Tl = rio[WS(ios, 7)];
Tm = Tk - Tl;
TL = Tl + Tk;
}
Te = Ta + Td;
TZ = TO + TN;
T10 = TK + TL;
Tn = Tj - Tm;
Tq = Td - Ta;
TM = TK - TL;
TP = TN - TO;
TH = Tj + Tm;
}
rio[0] = T7 + Te;
iio[-WS(ios, 7)] = TH + TG;
{
E To, Ty, Tf, Tp;
To = Tg + Tn;
Ty = Tq + Tx;
Tf = W[10];
Tp = W[11];
rio[WS(ios, 6)] = FNMS(Tp, Ty, Tf * To);
iio[-WS(ios, 1)] = FMA(Tp, To, Tf * Ty);
}
{
E TE, TI, TD, TF;
TE = T7 - Te;
TI = TG - TH;
TD = W[6];
TF = W[7];
rio[WS(ios, 4)] = FNMS(TF, TI, TD * TE);
iio[-WS(ios, 3)] = FMA(TF, TE, TD * TI);
}
{
E TA, TC, Tz, TB;
TA = Tg - Tn;
TC = Tx - Tq;
Tz = W[2];
TB = W[3];
rio[WS(ios, 2)] = FNMS(TB, TC, Tz * TA);
iio[-WS(ios, 5)] = FMA(TB, TA, Tz * TC);
}
{
E TU, T16, T12, T14, TQ, T11;
TQ = KP707106781 * (TM - TP);
TU = TQ + TT;
T16 = TT - TQ;
T11 = KP707106781 * (TZ - T10);
T12 = TY + T11;
T14 = TY - T11;
{
E TJ, TV, T13, T15;
TJ = W[0];
TV = W[1];
rio[WS(ios, 1)] = FNMS(TV, T12, TJ * TU);
iio[-WS(ios, 6)] = FMA(TJ, T12, TV * TU);
T13 = W[8];
T15 = W[9];
iio[-WS(ios, 2)] = FMA(T13, T14, T15 * T16);
rio[WS(ios, 5)] = FNMS(T15, T14, T13 * T16);
}
}
{
E T1a, T1i, T1e, T1g, T19, T1c;
T19 = KP707106781 * (TP + TM);
T1a = T18 + T19;
T1i = T18 - T19;
T1c = KP707106781 * (TZ + T10);
T1e = T1c + T1d;
T1g = T1d - T1c;
{
E T17, T1b, T1f, T1h;
T17 = W[12];
T1b = W[13];
iio[0] = FMA(T17, T1a, T1b * T1e);
rio[WS(ios, 7)] = FNMS(T1b, T1a, T17 * T1e);
T1f = W[4];
T1h = W[5];
rio[WS(ios, 3)] = FNMS(T1h, T1i, T1f * T1g);
iio[-WS(ios, 4)] = FMA(T1f, T1i, T1h * T1g);
}
}
}
return W;
}
static const tw_instr twinstr[] = {
{TW_FULL, 0, 8},
{TW_NEXT, 1, 0}
};
static const hc2hc_desc desc = { 8, "hb_8", twinstr, {52, 18, 14, 0}, &GENUS, 0, 0, 0 };
void X(codelet_hb_8) (planner *p) {
X(khc2hc_dif_register) (p, hb_8, &desc);
}
|
/*
* ProFTPD - FTP server daemon
* Copyright (c) 2014 The ProFTPD Project team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*
* As a special exemption, the ProFTPD Project team and other respective
* copyright holders give permission to link this program with OpenSSL, and
* distribute the resulting executable, without including the source code for
* OpenSSL in the source distribution.
*/
/* Signal handling API. */
#ifndef PR_SIGNALS_H
#define PR_SIGNALS_H
#include "config.h"
void pr_signals_block(void);
void pr_signals_unblock(void);
void pr_signals_handle(void);
/* Signal handling functions. */
RETSIGTYPE pr_signals_handle_disconnect(int);
RETSIGTYPE pr_signals_handle_event(int);
/* Internal use only. */
int init_signals(void);
#endif /* PR_SIGNALS_H */
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <device/device.h>
#include "chip.h"
struct chip_operations mainboard_ops = {
CHIP_NAME("Tyan S1846 Mainboard")
};
|
/*
* Copyright (C) 2013-2015 DeathCore <http://www.noffearrdeathproject.net/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.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 DEF_RAMPARTS_H
#define DEF_RAMPARTS_H
#define DataHeader "HR"
uint32 const EncounterCount = 4;
enum DataTypes
{
DATA_WATCHKEEPER_GARGOLMAR = 0,
DATA_OMOR_THE_UNSCARRED = 1,
DATA_VAZRUDEN = 2,
DATA_NAZAN = 3
};
enum CreatureIds
{
NPC_HELLFIRE_SENTRY = 17517,
NPC_VAZRUDEN_HERALD = 17307,
NPC_VAZRUDEN = 17537,
NPC_NAZAN = 17536,
NPC_LIQUID_FIRE = 22515
};
enum GameobjectIds
{
GO_FEL_IRON_CHEST_NORMAL = 185168,
GO_FEL_IRON_CHECT_HEROIC = 185169
};
#endif
|
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
#define BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
///The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMeshShape.
///Note that each btBvhTriangleMeshShape still can have its own local scaling, independent from this btScaledBvhTriangleMeshShape 'localScaling'
ATTRIBUTE_ALIGNED16(class) btScaledBvhTriangleMeshShape : public btConcaveShape
{
btVector3 m_localScaling;
btBvhTriangleMeshShape* m_bvhTriMeshShape;
public:
BT_DECLARE_ALIGNED_ALLOCATOR();
btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape* childShape,const btVector3& localScaling);
virtual ~btScaledBvhTriangleMeshShape();
virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
virtual void setLocalScaling(const btVector3& scaling);
virtual const btVector3& getLocalScaling() const;
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;
virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
btBvhTriangleMeshShape* getChildShape()
{
return m_bvhTriMeshShape;
}
const btBvhTriangleMeshShape* getChildShape() const
{
return m_bvhTriMeshShape;
}
//debugging
virtual const char* getName()const {return "SCALEDBVHTRIANGLEMESH";}
virtual int calculateSerializeBufferSize() const;
///fills the dataBuffer and returns the struct name (and 0 on failure)
virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
};
///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
struct btScaledTriangleMeshShapeData
{
btTriangleMeshShapeData m_trimeshShapeData;
btVector3FloatData m_localScaling;
};
SIMD_FORCE_INLINE int btScaledBvhTriangleMeshShape::calculateSerializeBufferSize() const
{
return sizeof(btScaledTriangleMeshShapeData);
}
///fills the dataBuffer and returns the struct name (and 0 on failure)
SIMD_FORCE_INLINE const char* btScaledBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
{
btScaledTriangleMeshShapeData* scaledMeshData = (btScaledTriangleMeshShapeData*) dataBuffer;
m_bvhTriMeshShape->serialize(&scaledMeshData->m_trimeshShapeData,serializer);
scaledMeshData->m_trimeshShapeData.m_collisionShapeData.m_shapeType = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE;
m_localScaling.serializeFloat(scaledMeshData->m_localScaling);
return "btScaledTriangleMeshShapeData";
}
#endif //BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
|
#ifndef __ASM_SMPBOOT_H
#define __ASM_SMPBOOT_H
/*emum for clustered_apic_mode values*/
enum{
CLUSTERED_APIC_NONE = 0,
CLUSTERED_APIC_XAPIC,
CLUSTERED_APIC_NUMAQ
};
#ifdef CONFIG_X86_CLUSTERED_APIC
extern unsigned int apic_broadcast_id;
extern unsigned char clustered_apic_mode;
extern unsigned char esr_disable;
extern unsigned char int_delivery_mode;
extern unsigned int int_dest_addr_mode;
extern int cyclone_setup(char*);
static inline void detect_clustered_apic(char* oem, char* prod)
{
/*
* Can't recognize Summit xAPICs at present, so use the OEM ID.
*/
if (!strncmp(oem, "IBM ENSW", 8) && !strncmp(prod, "VIGIL SMP", 9)){
clustered_apic_mode = CLUSTERED_APIC_XAPIC;
apic_broadcast_id = APIC_BROADCAST_ID_XAPIC;
int_dest_addr_mode = APIC_DEST_PHYSICAL;
int_delivery_mode = dest_Fixed;
esr_disable = 1;
/*Start cyclone clock*/
cyclone_setup(0);
/* check for ACPI tables */
} else if (!strncmp(oem, "IBM", 3) &&
(!strncmp(prod, "SERVIGIL", 8) ||
!strncmp(prod, "EXA", 3) ||
!strncmp(prod, "RUTHLESS", 8))){
clustered_apic_mode = CLUSTERED_APIC_XAPIC;
apic_broadcast_id = APIC_BROADCAST_ID_XAPIC;
int_dest_addr_mode = APIC_DEST_PHYSICAL;
int_delivery_mode = dest_Fixed;
esr_disable = 1;
/*Start cyclone clock*/
cyclone_setup(0);
} else if (!strncmp(oem, "IBM NUMA", 8)){
clustered_apic_mode = CLUSTERED_APIC_NUMAQ;
apic_broadcast_id = APIC_BROADCAST_ID_APIC;
int_dest_addr_mode = APIC_DEST_LOGICAL;
int_delivery_mode = dest_LowestPrio;
esr_disable = 1;
}
}
#define INT_DEST_ADDR_MODE (int_dest_addr_mode)
#define INT_DELIVERY_MODE (int_delivery_mode)
#else /* CONFIG_X86_CLUSTERED_APIC */
#define apic_broadcast_id (APIC_BROADCAST_ID_APIC)
#define clustered_apic_mode (CLUSTERED_APIC_NONE)
#define esr_disable (0)
#define detect_clustered_apic(x,y)
#define INT_DEST_ADDR_MODE (APIC_DEST_LOGICAL) /* logical delivery */
#define INT_DELIVERY_MODE (dest_LowestPrio)
#endif /* CONFIG_X86_CLUSTERED_APIC */
#define BAD_APICID 0xFFu
#define TRAMPOLINE_LOW phys_to_virt((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?0x8:0x467)
#define TRAMPOLINE_HIGH phys_to_virt((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?0xa:0x469)
#define boot_cpu_apicid ((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?boot_cpu_logical_apicid:boot_cpu_physical_apicid)
extern unsigned char raw_phys_apicid[NR_CPUS];
/*
* How to map from the cpu_present_map
*/
static inline int cpu_present_to_apicid(int mps_cpu)
{
if (clustered_apic_mode == CLUSTERED_APIC_XAPIC)
return raw_phys_apicid[mps_cpu];
if(clustered_apic_mode == CLUSTERED_APIC_NUMAQ)
return (mps_cpu/4)*16 + (1<<(mps_cpu%4));
return mps_cpu;
}
static inline unsigned long apicid_to_phys_cpu_present(int apicid)
{
if(clustered_apic_mode)
return 1UL << (((apicid >> 4) << 2) + (apicid & 0x3));
return 1UL << apicid;
}
#define physical_to_logical_apicid(phys_apic) ( (1ul << (phys_apic & 0x3)) | (phys_apic & 0xF0u) )
/*
* Mappings between logical cpu number and logical / physical apicid
* The first four macros are trivial, but it keeps the abstraction consistent
*/
extern volatile int logical_apicid_2_cpu[];
extern volatile int cpu_2_logical_apicid[];
extern volatile int physical_apicid_2_cpu[];
extern volatile int cpu_2_physical_apicid[];
#define logical_apicid_to_cpu(apicid) logical_apicid_2_cpu[apicid]
#define cpu_to_logical_apicid(cpu) cpu_2_logical_apicid[cpu]
#define physical_apicid_to_cpu(apicid) physical_apicid_2_cpu[apicid]
#define cpu_to_physical_apicid(cpu) cpu_2_physical_apicid[cpu]
#ifdef CONFIG_MULTIQUAD /* use logical IDs to bootstrap */
#define boot_apicid_to_cpu(apicid) logical_apicid_2_cpu[apicid]
#define cpu_to_boot_apicid(cpu) cpu_2_logical_apicid[cpu]
#else /* !CONFIG_MULTIQUAD */ /* use physical IDs to bootstrap */
#define boot_apicid_to_cpu(apicid) physical_apicid_2_cpu[apicid]
#define cpu_to_boot_apicid(cpu) cpu_2_physical_apicid[cpu]
#endif /* CONFIG_MULTIQUAD */
#ifdef CONFIG_X86_CLUSTERED_APIC
static inline int target_cpus(void)
{
static int cpu;
switch(clustered_apic_mode){
case CLUSTERED_APIC_NUMAQ:
/* Broadcast intrs to local quad only. */
return APIC_BROADCAST_ID_APIC;
case CLUSTERED_APIC_XAPIC:
/*round robin the interrupts*/
cpu = (cpu+1)%smp_num_cpus;
return cpu_to_physical_apicid(cpu);
default:
}
return cpu_online_map;
}
#else
#define target_cpus() (cpu_online_map)
#endif
#endif
|
#ifndef QPEER_H
#define QPEER_H
#include <libtorrent/entry.hpp>
#include <QString>
struct QPeer {
bool operator!=(const QPeer &other) const {
return qhash() != other.qhash();
}
bool operator==(const QPeer &other) const {
return qhash() == other.qhash();
}
QString qhash() const {
return ip+":"+QString::number(port);
}
libtorrent::entry toEntry(bool no_peer_id) const {
libtorrent::entry::dictionary_type peer_map;
if (!no_peer_id)
peer_map["id"] = libtorrent::entry(peer_id.toStdString());
peer_map["ip"] = libtorrent::entry(ip.toStdString());
peer_map["port"] = libtorrent::entry(port);
return libtorrent::entry(peer_map);
}
QString ip;
QString peer_id;
int port;
};
#endif // QPEER_H
|
/*
* drivers/battery/sm5703_fuelgauge.h
*
* Header of SiliconMitus SM5703 Fuelgauge Driver
*
* Copyright (C) 2015 SiliconMitus
* Author: SW Jung
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*/
#ifndef SM5703_FUELGAUGE_H
#define SM5703_FUELGAUGE_H
#include <linux/i2c.h>
#include <linux/mfd/sm5703.h>
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#endif /* #ifdef CONFIG_DEBUG_FS */
#define FG_DRIVER_VER "0.0.0.1"
struct battery_data_t {
const int battery_type; /* 4200 or 4350 or 4400*/
const int battery_table[3][16];
const int rce_value[3];
const int dtcd_value;
const int rs_value[4];
const int vit_period;
const int mix_value[2];
const int topoff_soc[2];
const int volt_cal;
const int curr_cal;
const int temp_std;
const int temp_offset;
const int temp_offset_cal;
const int charge_offset_cal;
};
struct sec_fg_info {
/* State Of Connect */
int online;
/* battery SOC (capacity) */
int batt_soc;
/* battery voltage */
int batt_voltage;
/* battery AvgVoltage */
int batt_avgvoltage;
/* battery OCV */
int batt_ocv;
/* Current */
int batt_current;
/* battery Avg Current */
int batt_avgcurrent;
struct battery_data_t *comp_pdata;
struct mutex param_lock;
/* copy from platform data /
* DTS or update by shell script */
struct mutex io_lock;
struct device *dev;
int32_t temperature;; /* 0.1 deg C*/
int32_t temp_fg;; /* 0.1 deg C*/
/* register programming */
int reg_addr;
u8 reg_data[2];
int battery_table[3][16];
int rce_value[3];
int dtcd_value;
int rs_value[4]; /*rs mix_factor max min*/
int vit_period;
int mix_value[2]; /*mix_rate init_blank*/
int enable_topoff_soc;
int topoff_soc;
int volt_cal;
int curr_cal;
int temp_std;
int temp_offset;
int temp_offset_cal;
int charge_offset_cal;
int battery_type; /* 4200 or 4350 or 4400*/
uint32_t soc_alert_flag : 1; /* 0 : nu-occur, 1: occur */
uint32_t volt_alert_flag : 1; /* 0 : nu-occur, 1: occur */
uint32_t flag_full_charge : 1; /* 0 : no , 1 : yes*/
uint32_t flag_chg_status : 1; /* 0 : discharging, 1: charging*/
int32_t irq_ctrl;
uint32_t is_FG_initialised;
int iocv_error_count;
int n_tem_poff;
int n_tem_poff_offset;
int l_tem_poff;
int l_tem_poff_offset;
/* previous battery voltage current*/
int p_batt_voltage;
int p_batt_current;
};
struct sec_fuelgauge_info {
struct i2c_client *client;
sec_battery_platform_data_t *pdata;
struct power_supply psy_fg;
struct delayed_work isr_work;
int cable_type;
bool is_charging;
/* HW-dedicated fuel guage info structure
* used in individual fuel gauge file only
* (ex. dummy_fuelgauge.c)
*/
struct sec_fg_info info;
bool is_fuel_alerted;
bool volt_alert_flag;
struct wake_lock fuel_alert_wake_lock;
unsigned int capacity_old; /* only for atomic calculation */
unsigned int capacity_max; /* only for dynamic calculation */
bool initial_update_of_soc;
struct mutex fg_lock;
/* register programming */
int reg_addr;
u8 reg_data[2];
int fg_irq;
};
bool sec_hal_fg_init(struct i2c_client *);
bool sec_hal_fg_suspend(struct i2c_client *);
bool sec_hal_fg_resume(struct i2c_client *);
bool sec_hal_fg_fuelalert_init(struct i2c_client *, int);
bool sec_hal_fg_is_fuelalerted(struct i2c_client *);
bool sec_hal_fg_fuelalert_process(void *, bool);
bool sec_hal_fg_full_charged(struct i2c_client *);
bool sec_hal_fg_reset(struct i2c_client *);
bool sec_hal_fg_get_property(struct i2c_client *,
enum power_supply_property,
union power_supply_propval *);
bool sec_hal_fg_set_property(struct i2c_client *,
enum power_supply_property,
const union power_supply_propval *);
ssize_t sec_hal_fg_show_attrs(struct device *dev,
const ptrdiff_t offset, char *buf);
ssize_t sec_hal_fg_store_attrs(struct device *dev,
const ptrdiff_t offset,
const char *buf, size_t count);
ssize_t sec_fg_show_attrs(struct device *dev,
struct device_attribute *attr, char *buf);
ssize_t sec_fg_store_attrs(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count);
#ifdef CONFIG_OF
extern void board_fuelgauge_init(struct sec_fuelgauge_info *fuelgauge);
extern bool sec_bat_check_jig_status(void);
#endif
#define SEC_FG_ATTR(_name) \
{ \
.attr = {.name = #_name, .mode = 0664}, \
.show = sec_fg_show_attrs, \
.store = sec_fg_store_attrs, \
}
enum {
FG_REG = 0,
FG_DATA,
FG_REGS,
};
#endif // SM5703_FUELGAUGE_H
|
#define HIETH_SFV300
#include "hieth.h"
#include "ctrl.h"
static inline int _hieth_irq_enable(struct hieth_netdev_local *ld, int irqs)
{
int old;
old = hieth_readl(ld, GLB_RW_IRQ_ENA);
hieth_writel(ld, old | irqs, GLB_RW_IRQ_ENA);
return old;
}
static inline int _hieth_irq_disable(struct hieth_netdev_local *ld, int irqs)
{
int old;
old = hieth_readl(ld, GLB_RW_IRQ_ENA);
hieth_writel(ld, old & (~irqs), GLB_RW_IRQ_ENA);
return old;
}
static inline int _hieth_read_irqstatus(struct hieth_netdev_local *ld)
{
int status;
status = hieth_readl(ld, GLB_RO_IRQ_STAT);
return status;
}
static inline int _test_xmit_queue_ready(struct hieth_netdev_local *ld)
{
return hieth_readl_bits(ld, UD_REG_NAME(GLB_RO_QUEUE_STAT), BITS_XMITQ_RDY);
}
static inline int _test_recv_queue_ready(struct hieth_netdev_local *ld)
{
return hieth_readl_bits(ld, UD_REG_NAME(GLB_RO_QUEUE_STAT), BITS_RECVQ_RDY);
}
int hieth_irq_enable(struct hieth_netdev_local *ld, int irqs)
{
int old;
local_lock(ld);
old = _hieth_irq_enable(ld, irqs);
local_unlock(ld);
return old;
}
int hieth_irq_disable(struct hieth_netdev_local *ld, int irqs)
{
int old;
local_lock(ld);
old = _hieth_irq_disable(ld, irqs);
local_unlock(ld);
return old;
}
int hieth_read_irqstatus(struct hieth_netdev_local *ld)
{
int status;
local_lock(ld);
status = _hieth_read_irqstatus(ld);
local_unlock(ld);
return status;
}
int hieth_read_raw_irqstatus(struct hieth_netdev_local *ld)
{
int status;
local_lock(ld);
status = hieth_readl(ld, GLB_RO_IRQ_STAT);
local_unlock(ld);
return status;
}
int hieth_clear_irqstatus(struct hieth_netdev_local *ld, int irqs)
{
int status;
local_lock(ld);
hieth_writel(ld, irqs, GLB_RW_IRQ_RAW);
status = _hieth_read_irqstatus(ld);
local_unlock(ld);
return status;
}
int hieth_set_endian_mode(struct hieth_netdev_local *ld, int mode)
{
int old;
local_lock(ld);
old = hieth_readl_bits(ld, GLB_ENDIAN_MOD, BITS_ENDIAN);
hieth_writel_bits(ld, mode, GLB_ENDIAN_MOD, BITS_ENDIAN);
local_unlock(ld);
return old;
}
|
//
// Copyright (C) 2014 OpenSim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//
#ifndef __INET_IMODULATION_H
#define __INET_IMODULATION_H
#include "inet/physicallayer/contract/packetlevel/IPrintableObject.h"
namespace inet {
namespace physicallayer {
/**
* This interface represents the process of varying one or more physical
* properties of a periodic waveform, called the carrier signal, with a
* modulating signal that typically contains information to be transmitted.
*/
class INET_API IModulation : public IPrintableObject
{
public:
/**
* Returns the bit error rate as a function of the signal to noise and
* interference ratio, the bandwidth, and the gross (physical) bitrate.
*/
virtual double calculateBER(double snir, Hz bandwidth, bps bitrate) const = 0;
/**
* Returns the symbol error rate as a function of the signal to noise
* and interference ratio, the bandwidth, and the gross (physical) bitrate.
*/
virtual double calculateSER(double snir, Hz bandwidth, bps bitrate) const = 0;
};
} // namespace physicallayer
} // namespace inet
#endif // ifndef __INET_IMODULATION_H
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef AGS_SHARED_AC_INVENTORY_ITEM_INFO_H
#define AGS_SHARED_AC_INVENTORY_ITEM_INFO_H
#include "ags/shared/core/types.h"
namespace AGS3 {
namespace AGS {
namespace Shared {
class Stream;
} // namespace Shared
} // namespace AGS
using namespace AGS; // FIXME later
#define IFLG_STARTWITH 1
struct InventoryItemInfo {
char name[25];
int pic;
int cursorPic, hotx, hoty;
int32_t reserved[5];
int8 flags;
void ReadFromFile(Shared::Stream *in);
void WriteToFile(Shared::Stream *out);
void ReadFromSavegame(Shared::Stream *in);
void WriteToSavegame(Shared::Stream *out) const;
};
} // namespace AGS3
#endif
|
/*
* (C) Copyright 2009-2014
* Gerald Kerma <dreagle@doukki.net>
* Marvell Semiconductor <www.marvell.com>
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef _CONFIG_SHEEVAPLUG_H
#define _CONFIG_SHEEVAPLUG_H
/*
* Version number information
*/
#define CONFIG_IDENT_STRING "\nMarvell-Sheevaplug"
/*
* High Level Configuration Options (easy to change)
*/
#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */
#define CONFIG_MACH_SHEEVAPLUG /* Machine type */
/*
* Commands configuration
*/
#define CONFIG_CMD_MMC
/*
* Standard filesystems
*/
#define CONFIG_SYS_MVFS
/*
* mv-plug-common.h should be defined after CMD configs since it used them
* to enable certain macros
*/
#include "mv-plug-common.h"
/*
* Environment variables configurations
*/
#ifdef CONFIG_CMD_NAND
#define CONFIG_ENV_IS_IN_NAND 1
#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
#else
#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */
#endif
/*
* max 4k env size is enough, but in case of nand
* it has to be rounded to sector size
*/
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
#define CONFIG_ENV_ADDR 0x80000
#define CONFIG_ENV_OFFSET 0x80000 /* env starts here */
/*
* Default environment variables
*/
#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \
"setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \
"${x_bootcmd_usb}; bootm 0x6400000;"
#define CONFIG_MTDPARTS \
"mtdparts=orion_nand:512K(uboot)," \
"512K(env),1M(script),6M(kernel)," \
"12M(ramdisk),4M(spare),-(rootfs)"
#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \
"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS \
"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
"x_bootcmd_usb=usb start\0" \
"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
#define MTDIDS_DEFAULT "nand0=orion_nand"
#define MTDPARTS_DEFAULT \
"mtdparts="CONFIG_MTDPARTS
/*
* Ethernet Driver configuration
*/
#ifdef CONFIG_CMD_NET
#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
#define CONFIG_PHY_BASE_ADR 0
#endif /* CONFIG_CMD_NET */
/*
* SDIO/MMC Card Configuration
*/
#ifdef CONFIG_CMD_MMC
#define CONFIG_MMC
#define CONFIG_GENERIC_MMC
#define CONFIG_MVEBU_MMC
#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE
#endif /* CONFIG_CMD_MMC */
/*
* SATA driver configuration
*/
#ifdef CONFIG_CMD_IDE
#define __io
#define CONFIG_IDE_PREINIT
#define CONFIG_DOS_PARTITION
#define CONFIG_MVSATA_IDE_USE_PORT0
#define CONFIG_MVSATA_IDE_USE_PORT1
#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
#endif /* CONFIG_CMD_IDE */
#endif /* _CONFIG_SHEEVAPLUG_H */
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "GUIControl.h"
#include "addons/Visualization.h"
#include "cores/AudioEngine/Interfaces/IAudioCallback.h"
#include "utils/rfft.h"
#define AUDIO_BUFFER_SIZE 512 // MUST BE A POWER OF 2!!!
#define MAX_AUDIO_BUFFERS 16
class CAudioBuffer
{
public:
CAudioBuffer(int iSize);
virtual ~CAudioBuffer();
const float* Get() const;
int Size() const;
void Set(const float* psBuffer, int iSize);
private:
CAudioBuffer();
float* m_pBuffer;
int m_iLen;
};
class CGUIVisualisationControl : public CGUIControl, public IAudioCallback
{
public:
CGUIVisualisationControl(int parentID, int controlID, float posX, float posY, float width, float height);
CGUIVisualisationControl(const CGUIVisualisationControl &from);
CGUIVisualisationControl *Clone() const override { return new CGUIVisualisationControl(*this); }; //! @todo check for naughties
// Child functions related to IAudioCallback
void OnInitialize(int channels, int samplesPerSec, int bitsPerSample) override;
void OnAudioData(const float* audioData, unsigned int audioDataLength) override;
// Child functions related to CGUIControl
void FreeResources(bool immediately = false) override;
void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
virtual bool IsDirty();
void Render() override;
void UpdateVisibility(const CGUIListItem *item = nullptr) override;
bool OnAction(const CAction &action) override;
bool OnMessage(CGUIMessage &message) override;
bool CanFocus() const override { return false; }
bool CanFocusFromPoint(const CPoint &point) const override;
std::string Name();
void UpdateTrack();
bool HasPresets();
void SetPreset(int idx);
bool IsLocked();
int GetActivePreset();
std::string GetActivePresetName();
bool GetPresetList(std::vector<std::string>& vecpresets);
private:
bool InitVisualization();
void DeInitVisualization();
inline void CreateBuffers();
inline void ClearBuffers();
bool m_callStart;
bool m_alreadyStarted;
bool m_attemptedLoad;
bool m_updateTrack;
std::list<std::unique_ptr<CAudioBuffer>> m_vecBuffers;
unsigned int m_numBuffers; /*!< Number of Audio buffers */
bool m_wantsFreq;
float m_freq[AUDIO_BUFFER_SIZE]; /*!< Frequency data */
std::vector<std::string> m_presets; /*!< cached preset list */
std::unique_ptr<RFFT> m_transform;
/* values set from "OnInitialize" IAudioCallback */
int m_channels;
int m_samplesPerSec;
int m_bitsPerSample;
std::string m_albumThumb; /*!< track information */
std::string m_name; /*!< To add-on sended name */
std::string m_presetsPath; /*!< To add-on sended preset path */
std::string m_profilePath; /*!< To add-on sended profile path */
ADDON::CVisualization* m_instance;
};
|
/*
* MODULE: midi.h
* AUTHOR: Brian King
* COPYRIGHT: Copyright 1999 under GNU Public License
* VERSION: 1.0
*/
#ifndef __MIDI_H__
#define __MIDI_H__
#define MIDI_BUFFERS 2
#define BUFFLEN 32766
#define MAXTEMPO 350
#define MINTEMPO 10
#define MIDI_NOTEOFF 0x80
#define MIDI_NOTEON 0x90
#define MIDI_PTOUCH 0xA0
#define MIDI_CCHANGE 0xB0
#define MIDI_PCHANGE 0xC0
#define MIDI_MTOUCH 0xD0
#define MIDI_PBEND 0xE0
#define MIDI_SYSX 0xF0
#define MIDI_MTC 0xF1
#define MIDI_SONGPP 0xF2
#define MIDI_SONGS 0xF3
#define MIDI_EOX 0xF7
#define MIDI_CLOCK 0xF8
#define MIDI_START 0xFA
#define MIDI_CONTINUE 0xFB
#define MIDI_STOP 0xFC
#define MIDI_SENSE 0xFE
typedef struct mos
{
BYTE status;
BYTE byte1;
BYTE byte2;
int length;
int posn;
int sysex;
int timecode;
int unknown;
} MidiOutStatus;
typedef enum
{
midi_input,
midi_output
} midi_direction_e;
extern BOOL midi_ready;
extern int Midi_Parse (midi_direction_e direction, BYTE *c);
extern int Midi_Open (void);
extern void Midi_Close (void);
extern LONG getmidibyte(void);
extern int ismidibyte(void);
#endif
|
/* Malloc interposition test, dynamically-linked version without threads.
Copyright (C) 2016-2017 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; see the file COPYING.LIB. If
not, see <http://www.gnu.org/licenses/>. */
#define INTERPOSE_THREADS 0
#include "tst-interpose-skeleton.c"
|
/* Copyright (C) 2007-2016 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Victor Julien <victor@inliniac.net>
*/
#ifndef __STREAM_TCP_INLINE_H__
#define __STREAM_TCP_INLINE_H__
#include "stream-tcp-private.h"
int StreamTcpInlineSegmentCompare(TcpStream *, Packet *, TcpSegment *);
void StreamTcpInlineSegmentReplacePacket(TcpStream *, Packet *, TcpSegment *);
void StreamTcpInlineRegisterTests(void);
#endif /* __STREAM_TCP_INLINE_H__ */
|
/*
* linux/arch/arm/mach-pxa/generic.c
*
* Author: Nicolas Pitre
* Created: Jun 15, 2001
* Copyright: MontaVista Software Inc.
*
* Code common to all PXA machines.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Since this file should be linked before any other machine specific file,
* the __initcall() here will be executed first. This serves as default
* initialization stuff for PXA machines which can be overridden later if
* need be.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/ioport.h>
#include <linux/pm.h>
#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/udc.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h>
#include "generic.h"
/*
* Handy function to set GPIO alternate functions
*/
void pxa_gpio_mode(int gpio_mode)
{
unsigned long flags;
int gpio = gpio_mode & GPIO_MD_MASK_NR;
int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
int gafr;
local_irq_save(flags);
if (gpio_mode & GPIO_MD_MASK_DIR)
GPDR(gpio) |= GPIO_bit(gpio);
else
GPDR(gpio) &= ~GPIO_bit(gpio);
gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
local_irq_restore(flags);
}
EXPORT_SYMBOL(pxa_gpio_mode);
/*
* Routine to safely enable or disable a clock in the CKEN
*/
void pxa_set_cken(int clock, int enable)
{
unsigned long flags;
local_irq_save(flags);
if (enable)
CKEN |= clock;
else
CKEN &= ~clock;
local_irq_restore(flags);
}
EXPORT_SYMBOL(pxa_set_cken);
/*
* Intel PXA2xx internal register mapping.
*
* Note 1: not all PXA2xx variants implement all those addresses.
*
* Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table
* and cache flush area.
*/
static struct map_desc standard_io_desc[] __initdata = {
/* virtual physical length type */
{ 0xf2000000, 0x40000000, 0x01800000, MT_DEVICE }, /* Devs */
{ 0xf4000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */
{ 0xf6000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */
{ 0xf8000000, 0x4c000000, 0x00100000, MT_DEVICE }, /* USB host */
{ 0xfa000000, 0x50000000, 0x00100000, MT_DEVICE }, /* Camera */
{ 0xfe000000, 0x58000000, 0x00100000, MT_DEVICE }, /* IMem ctl */
{ 0xff000000, 0x00000000, 0x00100000, MT_DEVICE } /* UNCACHED_PHYS_0 */
};
void __init pxa_map_io(void)
{
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
get_clk_frequency_khz(1);
}
static struct resource pxamci_resources[] = {
[0] = {
.start = 0x41100000,
.end = 0x41100fff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_MMC,
.end = IRQ_MMC,
.flags = IORESOURCE_IRQ,
},
};
static u64 pxamci_dmamask = 0xffffffffUL;
static struct platform_device pxamci_device = {
.name = "pxa2xx-mci",
.id = -1,
.dev = {
.dma_mask = &pxamci_dmamask,
.coherent_dma_mask = 0xffffffff,
},
.num_resources = ARRAY_SIZE(pxamci_resources),
.resource = pxamci_resources,
};
void __init pxa_set_mci_info(struct pxamci_platform_data *info)
{
pxamci_device.dev.platform_data = info;
}
EXPORT_SYMBOL(pxa_set_mci_info);
static struct pxa2xx_udc_mach_info pxa_udc_info;
void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
{
memcpy(&pxa_udc_info, info, sizeof *info);
}
EXPORT_SYMBOL(pxa_set_udc_info);
static struct resource pxa2xx_udc_resources[] = {
[0] = {
.start = 0x40600000,
.end = 0x4060ffff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_USB,
.end = IRQ_USB,
.flags = IORESOURCE_IRQ,
},
};
static u64 udc_dma_mask = ~(u32)0;
static struct platform_device udc_device = {
.name = "pxa2xx-udc",
.id = -1,
.resource = pxa2xx_udc_resources,
.num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
.dev = {
.platform_data = &pxa_udc_info,
.dma_mask = &udc_dma_mask,
}
};
static struct pxafb_mach_info pxa_fb_info;
void __init set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info)
{
memcpy(&pxa_fb_info,hard_pxa_fb_info,sizeof(struct pxafb_mach_info));
}
EXPORT_SYMBOL(set_pxa_fb_info);
static struct resource pxafb_resources[] = {
[0] = {
.start = 0x44000000,
.end = 0x4400ffff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_LCD,
.end = IRQ_LCD,
.flags = IORESOURCE_IRQ,
},
};
static u64 fb_dma_mask = ~(u64)0;
static struct platform_device pxafb_device = {
.name = "pxa2xx-fb",
.id = -1,
.dev = {
.platform_data = &pxa_fb_info,
.dma_mask = &fb_dma_mask,
.coherent_dma_mask = 0xffffffff,
},
.num_resources = ARRAY_SIZE(pxafb_resources),
.resource = pxafb_resources,
};
static struct platform_device ffuart_device = {
.name = "pxa2xx-uart",
.id = 0,
};
static struct platform_device btuart_device = {
.name = "pxa2xx-uart",
.id = 1,
};
static struct platform_device stuart_device = {
.name = "pxa2xx-uart",
.id = 2,
};
static struct platform_device *devices[] __initdata = {
&pxamci_device,
&udc_device,
&pxafb_device,
&ffuart_device,
&btuart_device,
&stuart_device,
};
static int __init pxa_init(void)
{
return platform_add_devices(devices, ARRAY_SIZE(devices));
}
subsys_initcall(pxa_init);
|
/*
* This file is part of nzbget. See <http://nzbget.net>.
*
* Copyright (C) 2013-2016 Andrey Prygunkov <hugbug@users.sourceforge.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 FEEDFILTER_H
#define FEEDFILTER_H
#include "NString.h"
#include "DownloadInfo.h"
#include "FeedInfo.h"
#include "Util.h"
class FeedFilter
{
public:
FeedFilter(const char* filter);
void Match(FeedItemInfo& feedItemInfo);
private:
typedef std::vector<CString> RefValues;
enum ETermCommand
{
fcText,
fcRegex,
fcEqual,
fcLess,
fcLessEqual,
fcGreater,
fcGreaterEqual,
fcOpeningBrace,
fcClosingBrace,
fcOrOperator
};
class Term
{
public:
Term() {}
Term(Term&&) = delete; // catch performance issues
void SetRefValues(RefValues* refValues) { m_refValues = refValues; }
bool Compile(char* token);
bool Match(FeedItemInfo& feedItemInfo);
ETermCommand GetCommand() { return m_command; }
private:
bool m_positive;
CString m_field;
ETermCommand m_command;
CString m_param;
int64 m_intParam = 0;
double m_floatParam = 0.0;
bool m_float = false;
std::unique_ptr<RegEx> m_regEx;
RefValues* m_refValues = nullptr;
bool GetFieldData(const char* field, FeedItemInfo* feedItemInfo,
const char** StrValue, int64* IntValue);
bool ParseParam(const char* field, const char* param);
bool ParseSizeParam(const char* param);
bool ParseAgeParam(const char* param);
bool ParseNumericParam(const char* param);
bool MatchValue(const char* strValue, int64 intValue);
bool MatchText(const char* strValue);
bool MatchRegex(const char* strValue);
void FillWildMaskRefValues(const char* strValue, WildMask* mask, int refOffset);
void FillRegExRefValues(const char* strValue, RegEx* regEx);
};
typedef std::deque<Term> TermList;
enum ERuleCommand
{
frAccept,
frReject,
frRequire,
frOptions,
frComment
};
class Rule
{
public:
Rule() {}
Rule(Rule&&) = delete; // catch performance issues
void Compile(char* rule);
bool IsValid() { return m_isValid; }
ERuleCommand GetCommand() { return m_command; }
const char* GetCategory() { return m_category; }
int GetPriority() { return m_priority; }
int GetAddPriority() { return m_addPriority; }
bool GetPause() { return m_pause; }
const char* GetDupeKey() { return m_dupeKey; }
const char* GetAddDupeKey() { return m_addDupeKey; }
int GetDupeScore() { return m_dupeScore; }
int GetAddDupeScore() { return m_addDupeScore; }
EDupeMode GetDupeMode() { return m_dupeMode; }
const char* GetRageId() { return m_rageId; }
const char* GetTvdbId() { return m_tvdbId; }
const char* GetTvmazeId() { return m_tvmazeId; }
const char* GetSeries() { return m_series; }
bool HasCategory() { return m_hasCategory; }
bool HasPriority() { return m_hasPriority; }
bool HasAddPriority() { return m_hasAddPriority; }
bool HasPause() { return m_hasPause; }
bool HasDupeScore() { return m_hasDupeScore; }
bool HasAddDupeScore() { return m_hasAddDupeScore; }
bool HasDupeKey() { return m_hasDupeKey; }
bool HasAddDupeKey() { return m_hasAddDupeKey; }
bool HasDupeMode() { return m_hasDupeMode; }
bool HasRageId() { return m_hasRageId; }
bool HasTvdbId() { return m_hasTvdbId; }
bool HasTvmazeId() { return m_hasTvmazeId; }
bool HasSeries() { return m_hasSeries; }
bool Match(FeedItemInfo& feedItemInfo);
void ExpandRefValues(FeedItemInfo& feedItemInfo, CString* destStr, const char* patStr);
const char* GetRefValue(FeedItemInfo& feedItemInfo, const char* varName);
private:
bool m_isValid = false;
ERuleCommand m_command = frAccept;
CString m_category;
int m_priority = 0;
int m_addPriority = 0;
bool m_pause = false;
int m_dupeScore;
int m_addDupeScore = 0;
CString m_dupeKey;
CString m_addDupeKey;
EDupeMode m_dupeMode = dmScore;
CString m_series;
CString m_rageId;
CString m_tvdbId;
CString m_tvmazeId;
bool m_hasCategory = false;
bool m_hasPriority = false;
bool m_hasAddPriority = false;
bool m_hasPause = false;
bool m_hasDupeScore = false;
bool m_hasAddDupeScore = false;
bool m_hasDupeKey = false;
bool m_hasAddDupeKey = false;
bool m_hasDupeMode = false;
bool m_hasPatCategory = false;
bool m_hasPatDupeKey = false;
bool m_hasPatAddDupeKey = false;
bool m_hasSeries = false;
bool m_hasRageId = false;
bool m_hasTvdbId = false;
bool m_hasTvmazeId = false;
CString m_patCategory;
CString m_patDupeKey;
CString m_patAddDupeKey;
TermList m_terms;
RefValues m_refValues;
char* CompileCommand(char* rule);
char* CompileOptions(char* rule);
bool CompileTerm(char* term);
bool MatchExpression(FeedItemInfo& feedItemInfo);
};
typedef std::deque<Rule> RuleList;
RuleList m_rules;
void Compile(const char* filter);
void CompileRule(char* rule);
void ApplyOptions(Rule& rule, FeedItemInfo& feedItemInfo);
};
#endif
|
/*****************************************************************************
* Copyright (c) 2014-2021 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../ride/VehicleColour.h"
#include "EntityBase.h"
class DataSerialiser;
struct CoordsXYZ;
struct paint_session;
struct VehicleCrashParticle : EntityBase
{
static constexpr auto cEntityType = EntityType::CrashedVehicleParticle;
uint16_t frame;
uint16_t time_to_live;
uint8_t colour[2];
uint16_t crashed_sprite_base;
int16_t velocity_x;
int16_t velocity_y;
int16_t velocity_z;
int32_t acceleration_x;
int32_t acceleration_y;
int32_t acceleration_z;
static void Create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos);
void Update();
void Serialise(DataSerialiser& stream);
void Paint(paint_session& session, int32_t imageDirection) const;
};
struct CrashSplashParticle : EntityBase
{
static constexpr auto cEntityType = EntityType::CrashSplash;
uint16_t frame;
static void Create(const CoordsXYZ& splashPos);
void Update();
void Serialise(DataSerialiser& stream);
void Paint(paint_session& session, int32_t imageDirection) const;
};
struct ExplosionFlare : EntityBase
{
static constexpr auto cEntityType = EntityType::ExplosionFlare;
uint16_t frame;
static void Create(const CoordsXYZ& flarePos);
void Update();
void Serialise(DataSerialiser& stream);
void Paint(paint_session& session, int32_t imageDirection) const;
};
struct ExplosionCloud : EntityBase
{
static constexpr auto cEntityType = EntityType::ExplosionCloud;
uint16_t frame;
static void Create(const CoordsXYZ& cloudPos);
void Update();
void Serialise(DataSerialiser& stream);
void Paint(paint_session& session, int32_t imageDirection) const;
};
struct SteamParticle : EntityBase
{
static constexpr auto cEntityType = EntityType::SteamParticle;
uint16_t frame;
uint16_t time_to_move;
static void Create(const CoordsXYZ& coords);
void Update();
void Serialise(DataSerialiser& stream);
void Paint(paint_session& session, int32_t imageDirection) const;
};
|
/*!
flashbench -- Flash memory benchmark for ZTEX USB-FPGA Modules 2.13
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see http://www.gnu.org/licenses/.
!*/
#include[ztex-conf.h] // Loads the configuration macros, see ztex-conf.h for the available macros
#include[ztex-utils.h] // include basic functions and variables
// select ZTEX USB FPGA Module 2.13 as target
IDENTITY_UFM_2_13(10.17.0.0,0);
// this product string is also used for identification by the host software
#define[PRODUCT_STRING]["flashbench for UFM 2.13"]
//USE_4KSECTORS;
// enable Flash support
ENABLE_FLASH;
// include the main part of the firmware kit, define the descriptors, ...
#include[ztex.h]
void main(void)
{
init_USB(); // init everything ...
while (1) { } // ... and twiddle thumbs
}
|
#ifndef UTIL_AUTOCORRELATION_H
#define UTIL_AUTOCORRELATION_H
/*
* Simpatico - Simulation Package for Polymeric and Molecular Liquids
*
* Copyright 2010 - 2014, The Regents of the University of Minnesota
* Distributed under the terms of the GNU General Public License.
*/
#include <util/global.h>
#include "AutoCorrStage.h" // base class
#include <util/param/ParamComposite.h> // base class
#include <util/containers/GArray.h> // member
namespace Util
{
/**
* Auto-correlation function, using hierarchical algorithm.
*
* This class represents the primary stage of a linked list of
* AutoCorrStage objects that implement a hierarchical blocking
* algorithm for an auto-correlation function.
*
* \ingroup Accumulators_Module
*/
template <typename Data, typename Product>
class AutoCorrelation : public AutoCorrStage<Data, Product>,
public ParamComposite
{
public:
/**
* Constructor
*/
AutoCorrelation();
/**
* Read parameters from file and initialize.
*
* \param in input parameter file
*/
virtual void readParameters(std::istream& in);
/**
* Load internal state from an archive.
*
* \param ar input/loading archive
*/
virtual void load(Serializable::IArchive &ar);
/**
* Save internal state to an archive.
*
* \param ar output/saving archive
*/
virtual void save(Serializable::OArchive &ar);
/**
* Return maximum delay, in primary samples.
*/
int maxDelay() const;
using AutoCorrStage<Data, Product>::setParam;
using AutoCorrStage<Data, Product>::sample;
using AutoCorrStage<Data, Product>::clear;
using AutoCorrStage<Data, Product>::serialize;
using AutoCorrStage<Data, Product>::output;
using AutoCorrStage<Data, Product>::bufferCapacity;
using AutoCorrStage<Data, Product>::nSample;
using AutoCorrStage<Data, Product>::stageInterval;
using AutoCorrStage<Data, Product>::autoCorrelation;
using AutoCorrStage<Data, Product>::corrTime;
protected:
using AutoCorrStage<Data, Product>::bufferCapacity_;
using AutoCorrStage<Data, Product>::maxStageId_;
using AutoCorrStage<Data, Product>::blockFactor_;
using AutoCorrStage<Data, Product>::allocate;
using AutoCorrStage<Data, Product>::serializePrivate;
/**
* Register a descendant stage.
*
* This should be called only by a root stage.
*
* \param ptr pointer to a descendant AutoCorrelation.
*/
virtual void registerDescendant(AutoCorrStage<Data, Product>* ptr);
private:
// Pointers to descendant AutoCorrStage objects
GArray< AutoCorrStage<Data, Product>* > descendants_;
};
}
#endif
|
// -*- C++ -*-
// $Id$
// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
// Copyright 1999, 2000 Scott Thomas Haug
// 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.
// The id3lib authors encourage improvements and optimisations to be sent to
// the id3lib coordinator. Please see the README file for details on where to
// send such submissions. See the AUTHORS file for a list of people who have
// contributed to id3lib. See the ChangeLog file for a list of changes to
// id3lib. These files are distributed with id3lib at
// http://download.sourceforge.net/id3lib/
#ifndef _ID3LIB_HEADER_FRAME_H_
#define _ID3LIB_HEADER_FRAME_H_
#include "header.h"
#include "field.h"
struct ID3_FrameDef;
class ID3_FrameHeader : public ID3_Header
{
public:
enum
{
TAGALTER = 1 << 15,
FILEALTER = 1 << 14,
READONLY = 1 << 13,
COMPRESSION = 1 << 7,
ENCRYPTION = 1 << 6,
GROUPING = 1 << 5
};
ID3_FrameHeader() : _frame_def(NULL), _dyn_frame_def(false) { ; }
virtual ~ID3_FrameHeader() { this->Clear(); }
/* */ size_t Size() const;
/* */ bool Parse(ID3_Reader&);
/* */ void Render(ID3_Writer&) const;
/* */ bool SetFrameID(ID3_FrameID id);
/* */ ID3_FrameID GetFrameID() const;
const char* GetTextID() const;
const ID3_FrameDef* GetFrameDef() const;
/* */ bool Clear();
ID3_FrameHeader& operator=(const ID3_FrameHeader&);
bool SetCompression(bool b) { return this->SetFlags(COMPRESSION, b); }
bool SetEncryption(bool b) { return this->SetFlags(ENCRYPTION, b); }
bool SetGrouping(bool b) { return this->SetFlags(GROUPING, b); }
bool GetCompression() const { return _flags.test(COMPRESSION); }
bool GetEncryption() const { return _flags.test(ENCRYPTION); }
bool GetGrouping() const { return _flags.test(GROUPING); }
bool GetReadOnly() const { return _flags.test(READONLY); }
void SetUnknownFrame(const char*);
protected:
bool SetFlags(uint16 f, bool b)
{
bool changed = _flags.set(f, b);
_changed = _changed || changed;
return changed;
}
// following is moved to public due to bug unknownframes corrupting a tag
// void SetUnknownFrame(const char*);
private:
ID3_FrameDef* _frame_def;
bool _dyn_frame_def;
}
;
#endif /* _ID3LIB_HEADER_FRAME_ */
|
// Copyright 2012 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
// -----------------------------------------------------------------------------
//
// Rescaling functions
//
// Author: Skal (pascal.massimino@gmail.com)
#ifndef WEBP_UTILS_RESCALER_UTILS_H_
#define WEBP_UTILS_RESCALER_UTILS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "src/webp/types.h"
#define WEBP_RESCALER_RFIX 32 // fixed-point precision for multiplies
#define WEBP_RESCALER_ONE (1ull << WEBP_RESCALER_RFIX)
#define WEBP_RESCALER_FRAC(x, y) \
((uint32_t)(((uint64_t)(x) << WEBP_RESCALER_RFIX) / (y)))
// Structure used for on-the-fly rescaling
typedef uint32_t rescaler_t; // type for side-buffer
typedef struct WebPRescaler WebPRescaler;
struct WebPRescaler {
int x_expand; // true if we're expanding in the x direction
int y_expand; // true if we're expanding in the y direction
int num_channels; // bytes to jump between pixels
uint32_t fx_scale; // fixed-point scaling factors
uint32_t fy_scale; // ''
uint32_t fxy_scale; // ''
int y_accum; // vertical accumulator
int y_add, y_sub; // vertical increments
int x_add, x_sub; // horizontal increments
int src_width, src_height; // source dimensions
int dst_width, dst_height; // destination dimensions
int src_y, dst_y; // row counters for input and output
uint8_t* dst;
int dst_stride;
rescaler_t* irow, *frow; // work buffer
};
// Initialize a rescaler given scratch area 'work' and dimensions of src & dst.
void WebPRescalerInit(WebPRescaler* const rescaler,
int src_width, int src_height,
uint8_t* const dst,
int dst_width, int dst_height, int dst_stride,
int num_channels,
rescaler_t* const work);
// If either 'scaled_width' or 'scaled_height' (but not both) is 0 the value
// will be calculated preserving the aspect ratio, otherwise the values are
// left unmodified. Returns true on success, false if either value is 0 after
// performing the scaling calculation.
int WebPRescalerGetScaledDimensions(int src_width, int src_height,
int* const scaled_width,
int* const scaled_height);
// Returns the number of input lines needed next to produce one output line,
// considering that the maximum available input lines are 'max_num_lines'.
int WebPRescaleNeededLines(const WebPRescaler* const rescaler,
int max_num_lines);
// Import multiple rows over all channels, until at least one row is ready to
// be exported. Returns the actual number of lines that were imported.
int WebPRescalerImport(WebPRescaler* const rescaler, int num_rows,
const uint8_t* src, int src_stride);
// Export as many rows as possible. Return the numbers of rows written.
int WebPRescalerExport(WebPRescaler* const rescaler);
// Return true if input is finished
static WEBP_INLINE
int WebPRescalerInputDone(const WebPRescaler* const rescaler) {
return (rescaler->src_y >= rescaler->src_height);
}
// Return true if output is finished
static WEBP_INLINE
int WebPRescalerOutputDone(const WebPRescaler* const rescaler) {
return (rescaler->dst_y >= rescaler->dst_height);
}
// Return true if there are pending output rows ready.
static WEBP_INLINE
int WebPRescalerHasPendingOutput(const WebPRescaler* const rescaler) {
return !WebPRescalerOutputDone(rescaler) && (rescaler->y_accum <= 0);
}
//------------------------------------------------------------------------------
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* WEBP_UTILS_RESCALER_UTILS_H_ */
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _LOG4CXX_HELPERS_LOG_LOG_H
#define _LOG4CXX_HELPERS_LOG_LOG_H
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/mutex.h>
#include <exception>
namespace log4cxx
{
namespace helpers
{
/**
This class used to output log statements from within the log4cxx package.
<p>Log4cxx components cannot make log4cxx logging calls. However, it is
sometimes useful for the user to learn about what log4cxx is
doing. You can enable log4cxx internal logging by calling the
<b>#setInternalDebugging</b> method.
<p>All log4cxx internal debug calls go to standard output
where as internal error messages are sent to
standard error output. All internal messages are prepended with
the string "log4cxx: ".
*/
class LOG4CXX_EXPORT LogLog
{
private:
bool debugEnabled;
/**
In quietMode not even errors generate any output.
*/
bool quietMode;
Mutex mutex;
LogLog();
LogLog(const LogLog&);
LogLog& operator=(const LogLog&);
static LogLog& getInstance();
public:
/**
Allows to enable/disable log4cxx internal logging.
*/
static void setInternalDebugging(bool enabled);
/**
This method is used to output log4cxx internal debug
statements. Output goes to the standard output.
*/
static void debug(const LogString& msg);
static void debug(const LogString& msg, const std::exception& e);
/**
This method is used to output log4cxx internal error
statements. There is no way to disable error statements.
Output goes to stderr.
*/
static void error(const LogString& msg);
static void error(const LogString& msg, const std::exception& e);
/**
In quiet mode LogLog generates strictly no output, not even
for errors.
@param quietMode <code>true</code> for no output.
*/
static void setQuietMode(bool quietMode);
/**
This method is used to output log4cxx internal warning
statements. There is no way to disable warning statements.
Output goes to stderr.
*/
static void warn(const LogString& msg);
static void warn(const LogString& msg, const std::exception& e);
private:
static void emit(const LogString& msg);
static void emit(const std::exception& ex);
};
} // namespace helpers
} // namespace log4cxx
#define LOGLOG_DEBUG(log) { \
log4cxx::helpers::LogLog::debug(log) ; }
#define LOGLOG_WARN(log) { \
log4cxx::helpers::LogLog::warn(log) ; }
#define LOGLOG_ERROR(log) { \
log4cxx::helpers::LogLog::warn(log); }
#endif //_LOG4CXX_HELPERS_LOG_LOG_H
|
/*
* Copyright (c) 2010,
* Gavriloaie Eugen-Andrei (shiretu@gmail.com)
*
* This file is part of crtmpserver.
* crtmpserver 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.
*
* crtmpserver 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 crtmpserver. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _BASESTREAM_H
#define _BASESTREAM_H
#include "common.h"
#include "streaming/streamcapabilities.h"
class StreamsManager;
class BaseProtocol;
/*!
@class BaseStream
*/
class DLLEXP BaseStream {
private:
static uint32_t _uniqueIdGenerator;
Variant _connectionType;
protected:
string _ip;
uint16_t _port;
StreamsManager *_pStreamsManager;
uint64_t _type;
uint32_t _uniqueId;
BaseProtocol *_pProtocol;
string _name;
double _creationTimestamp;
public:
BaseStream(BaseProtocol *pProtocol, uint64_t type, string name);
virtual ~BaseStream();
virtual bool SetStreamsManager(StreamsManager *pStreamsManager);
/*!
@brief Returns the stream manager. This is read-only
*/
StreamsManager * GetStreamsManager();
/*!
@brief Returns the stream capabilities. Specifically, codec and codec related info
*/
virtual StreamCapabilities * GetCapabilities() = 0;
/*!
@brief Returns the type of this stream. This is read-only
*/
uint64_t GetType();
/*!
@brief Returns the unique id of this stream. This is read-only
*/
uint32_t GetUniqueId();
/*!
@brief returns the creation timestamp expressed in milliseconds for 1970 epoch
*/
double GetSpawnTimestamp();
/*!
@brief Returns the name of this stream. This is setup-once
*/
string GetName();
/*!
@brief Sets the name of the stream
@param name - Name of stream in string format
*/
void SetName(string name);
/*!
@brief This will return information about the stream
@param info
*/
virtual void GetStats(Variant &info, uint32_t namespaceId = 0);
/*!
@brief Returns the protocol that owns this stream.
*/
BaseProtocol * GetProtocol();
/*!
@brief Tells if this stream is enqueued for delete or not based on the pProtocol
*/
virtual bool IsEnqueueForDelete();
/*!
@brief Will enqueue this stream for delete along with his protocol
*/
virtual void EnqueueForDelete();
/*!
@brief This will start the feeding process
@param dts - the timestamp where we want to see before start the feeding process
@param length - time limit
*/
virtual bool Play(double dts, double length) = 0;
/*!
@brief This will pause the feeding process
*/
virtual bool Pause() = 0;
/*!
@brief This will resume the feeding process
*/
virtual bool Resume() = 0;
/*!
@brief will seek to the specified point in time.
@param dts
*/
virtual bool Seek(double dts) = 0;
/*!
@brief This will stop the feeding process
*/
virtual bool Stop() = 0;
/*!
@brief Called when a play command was issued
@param dts - the timestamp where we want to seek before start the feeding process
@param length
*/
virtual bool SignalPlay(double &dts, double &length) = 0;
/*!
@brief Called when a pasue command was issued
*/
virtual bool SignalPause() = 0;
/*!
@brief Called when a resume command was issued
*/
virtual bool SignalResume() = 0;
/*!
@brief Called when a seek command was issued
@param dts
*/
virtual bool SignalSeek(double &dts) = 0;
/*!
@brief Called when a stop command was issued
*/
virtual bool SignalStop() = 0;
/*!
@param pData - the buffer containing the data
@param dataLength - the size of pData in bytes
@param processedLength - if pData is only partial data, this shows the numbers of bytes processed so far, excluding pData
@param totalLength - if pData is only partial data, this shows the total number of bytes inside the current packet
@param isAudio - true if pData is audio data, false if pData is video data
@discussion Rules:
dataLength+processedLength<=totalLength
dataLength<=totalLength
processedLength<=totalLength
dataLength!=0
*/
virtual bool FeedData(uint8_t *pData, uint32_t dataLength,
uint32_t processedLength, uint32_t totalLength,
double pts, double dts, bool isAudio) = 0;
/*!
@brief The networking layer signaled the availability for sending data
*/
virtual void ReadyForSend() = 0;
/*!
@brief This is called to ensure that the linking process can be done
@param type - the target type to which this strem must be linked against
*/
virtual bool IsCompatibleWithType(uint64_t type) = 0;
private:
void StoreConnectionType();
void GetIpPort();
};
#endif /* _BASESTREAM_H */
|
/*
---------------------------------------------------------------------------------------
This source file is part of SWG:ANH (Star Wars Galaxies - A New Hope - Server Emulator)
For more information, visit http://www.swganh.com
Copyright (c) 2006 - 2010 The SWG:ANH Team
---------------------------------------------------------------------------------------
Use of this source code is governed by the GPL v3 license that can be found
in the COPYING file or at http://www.gnu.org/licenses/gpl-3.0.html
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
---------------------------------------------------------------------------------------
*/
#ifndef ANH_DATABASEMANAGER_DATABASEJOB_H
#define ANH_DATABASEMANAGER_DATABASEJOB_H
#include <stdlib.h>
#include <cstring>
#include <boost/optional.hpp>
#include "DatabaseManager/DatabaseCallback.h"
class DatabaseResult;
class DataBinding;
struct DatabaseJob {
public:
DatabaseJob()
: old_callback(NULL)
, result(NULL)
, client_reference(NULL)
, multi_job(false)
{}
boost::optional<AsyncDatabaseCallback> callback;
DatabaseCallback* old_callback;
DatabaseResult* result;
void* client_reference;
std::string query;
bool multi_job;
};
#endif // ANH_DATABASEMANAGER_DATABASEJOB_H
|
/* ----------------------------------------------------------------------
* I-SIMPA (http://i-simpa.ifsttar.fr). This file is part of I-SIMPA.
*
* I-SIMPA is a GUI for 3D numerical sound propagation modelling dedicated
* to scientific acoustic simulations.
* Copyright (C) 2007-2014 - IFSTTAR - Judicael Picaut, Nicolas Fortin
*
* I-SIMPA 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.
*
* I-SIMPA 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 or
* see <http://ww.gnu.org/licenses/>
*
* For more information, please consult: <http://i-simpa.ifsttar.fr> or
* send an email to i-simpa@ifsttar.fr
*
* To contact Ifsttar, write to Ifsttar, 14-20 Boulevard Newton
* Cite Descartes, Champs sur Marne F-77447 Marne la Vallee Cedex 2 FRANCE
* or write to scientific.computing@ifsttar.fr
* ----------------------------------------------------------------------*/
#include "first_header_include.hpp"
#include "data_manager/element.h"
#include "data_manager/appconfig.h"
/** \file e_scene_projet_informations.h
* \brief Element représentant les informations du projet
*/
/**
* \brief Element représentant les informations du projet
*/
class E_Scene_Projet_Information: public Element
{
public:
E_Scene_Projet_Information( wxXmlNode* noeudCourant , Element* parent)
:Element(parent,wxTRANSLATE("Information"),Element::ELEMENT_TYPE_SCENE_PROJET_INFORMATION,noeudCourant)
{
SetIcon(GRAPH_STATE_ALL,GRAPH_INFORMATION);
if(!this->IsPropertyExist("nbencombrementenable"))
{
AppendNewProperties();
this->SetReadOnlyAllConfig();
}
}
E_Scene_Projet_Information( Element* parent)
:Element(parent, wxTRANSLATE("Information"),Element::ELEMENT_TYPE_SCENE_PROJET_INFORMATION)
{
SetIcon(GRAPH_STATE_ALL,GRAPH_INFORMATION);
InitProperties();
}
/**
* Nouveaux champs à la version 1.02 du logiciel
*/
void AppendNewProperties()
{
this->AppendPropertyInteger("nbencombrementenable",wxTRANSLATE("Number of active fitting zones"),0);
this->AppendPropertyInteger("nbsourcesenable",wxTRANSLATE("Number of active sound sources"),0);
}
/*
* Ajoute les éléments de configuration tel que l'emplacement du fichier de modèle et le chemin de sauvegarde par défaut du projet
*/
void InitProperties()
{
this->AppendPropertyInteger("nbfacemodel",wxTRANSLATE("Model face count"),0);
this->AppendPropertyInteger("nbencombrement",wxTRANSLATE("Number of fitting zones"),0);
this->AppendPropertyInteger("nbrecepteurp",wxTRANSLATE("Number of punctual receivers"),0);
this->AppendPropertyInteger("nbrecepteurs",wxTRANSLATE("Number of surfaces receivers"),0);
this->AppendPropertyInteger("nbsources",wxTRANSLATE("Number of sound sources"),0);
this->AppendPropertyInteger("nbsurfacegroup",wxTRANSLATE("Number of surface groups"),0);
this->AppendPropertyDecimal("volmodel",wxTRANSLATE("Scene volume (m3)"),0.f,true,1);
this->AppendPropertyDecimal("surfscene",wxTRANSLATE("Scene surface (m2)"),0.f,true,1);
AppendNewProperties();
this->SetReadOnlyAllConfig();
}
void InitProp()
{
this->UpdateEntierConfig("nbfacemodel",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_Faces);
this->UpdateEntierConfig("nbencombrement",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_Encombrement);
this->UpdateEntierConfig("nbencombrementenable",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_Encombrement_Actifs);
this->UpdateEntierConfig("nbrecepteurp",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_RecepteurP);
this->UpdateEntierConfig("nbrecepteurs",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_RecepteurS);
this->UpdateEntierConfig("nbsources",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_Sources);
this->UpdateEntierConfig("nbsourcesenable",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_Sources_Actives);
this->UpdateEntierConfig("nbsurfacegroup",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.quant_SurfGroup);
if(ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.volScene!=-1)
this->UpdateDecimalConfig("volmodel",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.volScene);
if(ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.surfScene!=-1)
this->UpdateDecimalConfig("surfscene",ApplicationConfiguration::GLOBAL_CURRENT_APPLICATION_INFORMATIONS.surfScene);
}
wxXmlNode* SaveXMLDoc(wxXmlNode* NoeudParent)
{
wxXmlNode* thisNode = Element::SaveXMLDoc(NoeudParent);
thisNode->SetName("info"); // Nom de la balise xml ( pas d'espace autorise )
return thisNode;
}
};
|
/*
* Renderware TeXture Dictionary (.txd) image decoder
* Copyright (c) 2007 Ivo van Poorten
*
* See also: http://wiki.multimedia.cx/index.php?title=TXD
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "bytestream.h"
#include "avcodec.h"
#include "bytestream.h"
#include "s3tc.h"
typedef struct TXDContext {
AVFrame picture;
} TXDContext;
static av_cold int txd_init(AVCodecContext *avctx) {
TXDContext *s = avctx->priv_data;
avcodec_get_frame_defaults(&s->picture);
avctx->coded_frame = &s->picture;
return 0;
}
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt) {
TXDContext * const s = avctx->priv_data;
GetByteContext gb;
AVFrame *picture = data;
AVFrame * const p = &s->picture;
unsigned int version, w, h, d3d_format, depth, stride, flags;
unsigned int av_unused mipmap_count;
unsigned int y, v;
uint8_t *ptr;
uint32_t *pal;
bytestream2_init(&gb, avpkt->data, avpkt->size);
version = bytestream2_get_le32(&gb);
bytestream2_skip(&gb, 72);
d3d_format = bytestream2_get_le32(&gb);
w = bytestream2_get_le16(&gb);
h = bytestream2_get_le16(&gb);
depth = bytestream2_get_byte(&gb);
mipmap_count = bytestream2_get_byte(&gb);
bytestream2_skip(&gb, 1);
flags = bytestream2_get_byte(&gb);
if (version < 8 || version > 9) {
av_log(avctx, AV_LOG_ERROR, "texture data version %i is unsupported\n",
version);
return -1;
}
if (depth == 8) {
avctx->pix_fmt = PIX_FMT_PAL8;
} else if (depth == 16 || depth == 32) {
avctx->pix_fmt = PIX_FMT_RGB32;
} else {
av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth);
return -1;
}
if (p->data[0])
avctx->release_buffer(avctx, p);
if (av_image_check_size(w, h, 0, avctx))
return -1;
if (w != avctx->width || h != avctx->height)
avcodec_set_dimensions(avctx, w, h);
if (avctx->get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
p->pict_type = AV_PICTURE_TYPE_I;
ptr = p->data[0];
stride = p->linesize[0];
if (depth == 8) {
pal = (uint32_t *) p->data[1];
for (y = 0; y < 256; y++) {
v = bytestream2_get_be32(&gb);
pal[y] = (v >> 8) + (v << 24);
}
if (bytestream2_get_bytes_left(&gb) < w * h)
return AVERROR_INVALIDDATA;
bytestream2_skip(&gb, 4);
for (y=0; y<h; y++) {
bytestream2_get_buffer(&gb, ptr, w);
ptr += stride;
}
} else if (depth == 16) {
bytestream2_skip(&gb, 4);
switch (d3d_format) {
case 0:
if (!(flags & 1))
goto unsupported;
case FF_S3TC_DXT1:
if (bytestream2_get_bytes_left(&gb) < (w/4) * (h/4) * 8)
return AVERROR_INVALIDDATA;
ff_decode_dxt1(&gb, ptr, w, h, stride);
break;
case FF_S3TC_DXT3:
if (bytestream2_get_bytes_left(&gb) < (w/4) * (h/4) * 16)
return AVERROR_INVALIDDATA;
ff_decode_dxt3(&gb, ptr, w, h, stride);
break;
default:
goto unsupported;
}
} else if (depth == 32) {
switch (d3d_format) {
case 0x15:
case 0x16:
if (bytestream2_get_bytes_left(&gb) < h * w * 4)
return AVERROR_INVALIDDATA;
for (y=0; y<h; y++) {
bytestream2_get_buffer(&gb, ptr, w * 4);
ptr += stride;
}
break;
default:
goto unsupported;
}
}
*picture = s->picture;
*data_size = sizeof(AVPicture);
return avpkt->size;
unsupported:
av_log(avctx, AV_LOG_ERROR, "unsupported d3d format (%08x)\n", d3d_format);
return -1;
}
static av_cold int txd_end(AVCodecContext *avctx) {
TXDContext *s = avctx->priv_data;
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
return 0;
}
AVCodec ff_txd_decoder = {
.name = "txd",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_TXD,
.priv_data_size = sizeof(TXDContext),
.init = txd_init,
.close = txd_end,
.decode = txd_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"),
};
|
/* ty0 -- test file for the Bessel function of second kind (order 0)
Copyright 2007-2015 Free Software Foundation, Inc.
Contributed by the AriC and Caramel 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 3 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.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
#include "mpfr-test.h"
#define TEST_FUNCTION mpfr_y0
#define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), 8, RANDS)
#include "tgeneric.c"
int
main (int argc, char *argv[])
{
mpfr_t x, y;
tests_start_mpfr ();
mpfr_init (x);
mpfr_init (y);
/* special values */
mpfr_set_nan (x);
mpfr_y0 (y, x, MPFR_RNDN);
MPFR_ASSERTN(mpfr_nan_p (y));
mpfr_set_inf (x, 1); /* +Inf */
mpfr_y0 (y, x, MPFR_RNDN);
MPFR_ASSERTN(mpfr_cmp_ui (y, 0) == 0 && MPFR_IS_POS (y));
mpfr_set_inf (x, -1); /* -Inf */
mpfr_y0 (y, x, MPFR_RNDN);
MPFR_ASSERTN(mpfr_nan_p (y));
mpfr_set_ui (x, 0, MPFR_RNDN); /* +0 */
mpfr_y0 (y, x, MPFR_RNDN);
MPFR_ASSERTN(mpfr_inf_p (y) && MPFR_IS_NEG (y)); /* y0(+0)=-Inf */
mpfr_set_ui (x, 0, MPFR_RNDN);
mpfr_neg (x, x, MPFR_RNDN); /* -0 */
mpfr_y0 (y, x, MPFR_RNDN);
MPFR_ASSERTN(mpfr_inf_p (y) && MPFR_IS_NEG (y)); /* y0(-0)=-Inf */
mpfr_set_prec (x, 53);
mpfr_set_prec (y, 53);
mpfr_set_ui (x, 1, MPFR_RNDN);
mpfr_y0 (y, x, MPFR_RNDN);
mpfr_set_str_binary (x, "0.00010110100110000000001000100110111100110101100011011111");
if (mpfr_cmp (x, y))
{
printf ("Error in mpfr_y0 for x=1, rnd=MPFR_RNDN\n");
printf ("Expected "); mpfr_dump (x);
printf ("Got "); mpfr_dump (y);
exit (1);
}
mpfr_set_si (x, -1, MPFR_RNDN);
mpfr_y0 (y, x, MPFR_RNDN);
if (!mpfr_nan_p (y))
{
printf ("Error in mpfr_y0 for x=-1, rnd=MPFR_RNDN\n");
printf ("Expected NaN\n");
printf ("Got "); mpfr_dump (y);
exit (1);
}
mpfr_clear (x);
mpfr_clear (y);
test_generic (2, 100, 1);
data_check ("data/y0", mpfr_y0, "mpfr_y0");
tests_end_mpfr ();
return 0;
}
|
/***************************************************************************
* Copyright (C) 2014 Joseph Wenninger <jowenn@kde.org> *
* Copyright (C) 2008 by Montel Laurent <montel@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
***************************************************************************/
#ifndef _KATESESSIONSMODEL_H_
#define _KATESESSIONSMODEL_H_
/*
#include <plasma/popupapplet.h>
#include "ui_katesessionConfig.h"
*/
#include <QStandardItemModel>
class QModelIndex;
class KConfigDialog;
class QStringList;
class KateSessionsModel : public QStandardItemModel
{
Q_OBJECT
public:
KateSessionsModel(QObject *parent);
~KateSessionsModel();
QHash< int, QByteArray > roleNames() const override;
enum SpecificRoles {
Uuid = Qt::UserRole+3,
TypeRole = Qt::UserRole+4
};
protected Q_SLOTS:
// void slotOnItemClicked(const QModelIndex &index);
void slotUpdateSessionMenu();
// void slotSaveConfig();
protected:
void initSessionFiles();
/* void createConfigurationInterface(KConfigDialog *parent);
void configChanged();*/
private:
QStringList m_sessions;
QStringList m_fullList;
QString m_sessionsDir;
// KateSessionConfigInterface *m_config;
};
#endif
|
/*
* IFF (.iff) file demuxer
* Copyright (c) 2008 Jaikrishnan Menon <realityman@gmx.net>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file libavformat/iff.c
* IFF file demuxer
* by Jaikrishnan Menon
* for more information on the .iff file format, visit:
* http://wiki.multimedia.cx/index.php?title=IFF
*/
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#define ID_8SVX MKTAG('8','S','V','X')
#define ID_VHDR MKTAG('V','H','D','R')
#define ID_ATAK MKTAG('A','T','A','K')
#define ID_RLSE MKTAG('R','L','S','E')
#define ID_CHAN MKTAG('C','H','A','N')
#define ID_FORM MKTAG('F','O','R','M')
#define ID_ANNO MKTAG('A','N','N','O')
#define ID_AUTH MKTAG('A','U','T','H')
#define ID_CHRS MKTAG('C','H','R','S')
#define ID_COPYRIGHT MKTAG('(','c',')',' ')
#define ID_CSET MKTAG('C','S','E','T')
#define ID_FVER MKTAG('F','V','E','R')
#define ID_NAME MKTAG('N','A','M','E')
#define ID_TEXT MKTAG('T','E','X','T')
#define ID_BODY MKTAG('B','O','D','Y')
#define LEFT 2
#define RIGHT 4
#define STEREO 6
#define PACKET_SIZE 1024
typedef enum {COMP_NONE, COMP_FIB, COMP_EXP} svx8_compression_type;
typedef struct {
uint32_t body_size;
uint32_t sent_bytes;
uint32_t audio_frame_count;
} IffDemuxContext;
static void interleave_stereo(const uint8_t *src, uint8_t *dest, int size)
{
uint8_t *end = dest + size;
size = size>>1;
while(dest < end) {
*dest++ = *src;
*dest++ = *(src+size);
src++;
}
}
static int iff_probe(AVProbeData *p)
{
const uint8_t *d = p->buf;
if ( AV_RL32(d) == ID_FORM &&
AV_RL32(d+8) == ID_8SVX)
return AVPROBE_SCORE_MAX;
return 0;
}
static int iff_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
IffDemuxContext *iff = s->priv_data;
ByteIOContext *pb = s->pb;
AVStream *st;
uint32_t chunk_id, data_size;
int padding, done = 0;
st = av_new_stream(s, 0);
if (!st)
return AVERROR(ENOMEM);
st->codec->channels = 1;
url_fskip(pb, 12);
while(!done && !url_feof(pb)) {
chunk_id = get_le32(pb);
data_size = get_be32(pb);
padding = data_size & 1;
switch(chunk_id) {
case ID_VHDR:
url_fskip(pb, 12);
st->codec->sample_rate = get_be16(pb);
url_fskip(pb, 1);
st->codec->codec_tag = get_byte(pb);
url_fskip(pb, 4);
break;
case ID_BODY:
iff->body_size = data_size;
done = 1;
break;
case ID_CHAN:
st->codec->channels = (get_be32(pb) < 6) ? 1 : 2;
break;
default:
url_fseek(pb, data_size + padding, SEEK_CUR);
break;
}
}
if(!st->codec->sample_rate)
return AVERROR_INVALIDDATA;
av_set_pts_info(st, 32, 1, st->codec->sample_rate);
st->codec->codec_type = CODEC_TYPE_AUDIO;
switch(st->codec->codec_tag) {
case COMP_NONE:
st->codec->codec_id = CODEC_ID_PCM_S8;
break;
case COMP_FIB:
st->codec->codec_id = CODEC_ID_8SVX_FIB;
break;
case COMP_EXP:
st->codec->codec_id = CODEC_ID_8SVX_EXP;
break;
default:
av_log(s, AV_LOG_ERROR, "iff: unknown compression method\n");
return -1;
}
st->codec->bits_per_coded_sample = 8;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_coded_sample;
st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
return 0;
}
static int iff_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
IffDemuxContext *iff = s->priv_data;
ByteIOContext *pb = s->pb;
int ret;
if(iff->sent_bytes > iff->body_size)
return AVERROR(EIO);
if(s->streams[0]->codec->channels == 2) {
uint8_t sample_buffer[PACKET_SIZE];
ret = get_buffer(pb, sample_buffer, PACKET_SIZE);
if(av_new_packet(pkt, PACKET_SIZE) < 0) {
av_log(s, AV_LOG_ERROR, "iff: cannot allocate packet \n");
return AVERROR(ENOMEM);
}
interleave_stereo(sample_buffer, pkt->data, PACKET_SIZE);
}
else {
ret = av_get_packet(pb, pkt, PACKET_SIZE);
}
if(iff->sent_bytes == 0)
pkt->flags |= PKT_FLAG_KEY;
iff->sent_bytes += PACKET_SIZE;
pkt->stream_index = 0;
pkt->pts = iff->audio_frame_count;
iff->audio_frame_count += ret / s->streams[0]->codec->channels;
return ret;
}
AVInputFormat iff_demuxer = {
"IFF",
NULL_IF_CONFIG_SMALL("IFF format"),
sizeof(IffDemuxContext),
iff_probe,
iff_read_header,
iff_read_packet,
};
|
/*
* OpenRPT report writer and rendering engine
* Copyright (C) 2001-2014 by OpenMFG, LLC
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Please contact info@openmfg.com with any questions on this license.
*/
#ifndef DETAILSECTIONDIALOG_H
#define DETAILSECTIONDIALOG_H
class ORGraphicsSectionDetail;
#include <QDialog>
#include "ui_detailsectiondialog.h"
class DetailSectionDialog : public QDialog, public Ui::DetailSectionDialog
{
Q_OBJECT
public:
DetailSectionDialog(QWidget* parent = 0, Qt::WindowFlags fl = 0);
~DetailSectionDialog();
void setReportSectionDetail( ORGraphicsSectionDetail * gsd );
public slots:
virtual void btnAdd_clicked();
virtual void btnEdit_clicked();
virtual void btnRemove_clicked();
virtual void btnMoveUp_clicked();
virtual void brnMoveDown_clicked();
protected:
ORGraphicsSectionDetail * _gsd;
protected slots:
virtual void languageChange();
};
#endif // DETAILSECTIONDIALOG_H
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef DUMMYCONTEXTOBJECT_H
#define DUMMYCONTEXTOBJECT_H
#include <QObject>
#include <QWeakPointer>
#include <qdeclarative.h>
namespace QmlDesigner {
class DummyContextObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QObject * parent READ parentDummy WRITE setParentDummy NOTIFY parentDummyChanged DESIGNABLE false FINAL)
public:
explicit DummyContextObject(QObject *parent = 0);
QObject *parentDummy() const;
void setParentDummy(QObject *parentDummy);
signals:
void parentDummyChanged();
private:
QWeakPointer<QObject> m_dummyParent;
};
} // namespace QmlDesigner
QML_DECLARE_TYPE(QmlDesigner::DummyContextObject)
#endif // DUMMYCONTEXTOBJECT_H
|
#include <stdlib.h>
int square(x){
return (x*x);
}
int cube(x){
return (x*x*x);
}
int main(void) {
int counter;
int x = 3;
for (counter = square(x); counter < 5; counter = cube(counter)) {
int a = 0;
}
return (0);
}
|
/*
* @file ccnd/loadsharing_strategy.c
*
* Part of ccnd - the CCNx Daemon
*
* Copyright (C) 2013 Palo Alto Research Center, Inc.
*
* This work is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
* This work is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include "ccnd_strategy.h"
#define INACTIVE_PENALTY 1000
#define SLOW_PENALTY 32
static unsigned mybitindex;
/**
* This implements a distribution by performance strategy.
*
* The number of pending interests is a proxy for the performance of the face,
* an interest is sent on the face with the minimum pending, or randomly to
* one selected from those with the minimum.
*/
void
ccnd_loadsharing_strategy_impl(struct ccnd_handle *h,
struct strategy_instance *instance,
struct ccn_strategy *strategy,
enum ccn_strategy_op op,
unsigned faceid)
{
struct pit_face_item *p = NULL;
struct face *face = NULL;
unsigned count;
int best;
unsigned smallestq;
unsigned upending;
unsigned outstanding;
unsigned slowface;
unsigned nfaces;
switch (op) {
case CCNST_NOP:
break;
case CCNST_INIT:
mybitindex = faceattr_bool_index_from_name(h, "slow");
break;
case CCNST_FIRST:
break;
case CCNST_UPDATE:
count = 0;
smallestq = INT_MAX;
upending = 0;
nfaces = 0;
for (p = strategy->pfl; p!= NULL; p = p->next) {
nfaces++;
if ((p->pfi_flags & CCND_PFI_UPENDING) != 0)
upending++;
}
if (upending == 0) {
for (p = strategy->pfl; p!= NULL; p = p->next) {
if ((p->pfi_flags & CCND_PFI_ATTENTION) == 0)
continue;
face = ccnd_face_from_faceid(h, p->faceid);
outstanding = face_outstanding_interests(face);
slowface = faceattr_get(h, face, mybitindex);
/*
* Inactive faces attract a penalty against their queue size
* but randomly get probed to update their status
*/
if (p->pfi_flags & CCND_PFI_INACTIVE) {
outstanding += INACTIVE_PENALTY;
if ((ccnd_random(h) & 255) == 0)
p->pfi_flags |= CCND_PFI_SENDUPST;
}
if (slowface) {
outstanding += SLOW_PENALTY;
if ((ccnd_random(h) & 63) == 0)
p->pfi_flags |= CCND_PFI_SENDUPST;
}
if (outstanding < smallestq) {
count = 1;
smallestq = outstanding;
} else if (outstanding == smallestq) {
count++;
}
}
if (count > 0) {
best = ccnd_random(h) % count;
for (p = strategy->pfl; p!= NULL; p = p->next) {
if ((p->pfi_flags & CCND_PFI_ATTENTION) == 0)
continue;
face = ccnd_face_from_faceid(h, p->faceid);
outstanding = face_outstanding_interests(face);
slowface = faceattr_get(h, face, mybitindex);
if (p->pfi_flags & CCND_PFI_INACTIVE)
outstanding += INACTIVE_PENALTY;
if (slowface)
outstanding += SLOW_PENALTY;
if (outstanding == smallestq &&
((p->pfi_flags & CCND_PFI_UPSTREAM) != 0)) {
if (best == 0) {
p->pfi_flags |= CCND_PFI_SENDUPST;
break;
}
best--;
}
}
}
}
for (p = strategy->pfl; p!= NULL; p = p->next) {
p->pfi_flags &= ~CCND_PFI_ATTENTION;
}
break;
case CCNST_EXPUP:
face = ccnd_face_from_faceid(h, faceid);
faceattr_set(h, face, mybitindex, 1);
break;
case CCNST_EXPDN:
break;
case CCNST_REFRESH:
break;
case CCNST_TIMER:
break;
case CCNST_SATISFIED:
face = ccnd_face_from_faceid(h, faceid);
faceattr_set(h, face, mybitindex, 0);
break;
case CCNST_TIMEOUT: // all downstreams timed out, PIT entry will go away
/* Interest has not been satisfied or refreshed */
break;
case CCNST_FINALIZE:
/* Free the strategy per registration point private data */
break;
}
}
|
//
// DemoiPhoneViewController.h
// Beautify
//
// Created by Chris Grant on 20/09/2013.
// Copyright (c) 2013 Beautify. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DemoViewController : UIViewController
@property BOOL applyCustomStyles;
@property NSString *beautifyDescripiton;
@end |
//===----------------------------------------------------------------------===//
//
// Peloton
//
// utility.h
//
// Identification: src/include/common/utility.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
#pragma once
#include <string>
namespace peloton{
int peloton_close(int fd);
std::string peloton_error_message();
}
|
/*
* We're using Capsicum!
*/
#ifndef CAPSICUM_H
#define CAPSICUM_H
#include <sys/queue.h>
#include <nv.h>
void startSandbox(void *data);
void stopSandbox(void *ptr);
void startNullSandbox(void);
struct sandbox * findSandbox(void *ptr);
struct sandbox *startChild(void *data);
void killChild(void);
void suicide(int signal);
nvlist_t * sendCommand(nvlist_t *nvl, void *ptr);
#endif /* !CAPSICUM_H */ |
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_API_TEST_MOCK_RTPSENDER_H_
#define WEBRTC_API_TEST_MOCK_RTPSENDER_H_
#include <string>
#include <vector>
#include "webrtc/api/rtpsenderinterface.h"
#include "webrtc/test/gmock.h"
namespace webrtc {
class MockRtpSender : public rtc::RefCountedObject<RtpSenderInterface> {
public:
MOCK_METHOD1(SetTrack, bool(MediaStreamTrackInterface*));
MOCK_CONST_METHOD0(track, rtc::scoped_refptr<MediaStreamTrackInterface>());
MOCK_CONST_METHOD0(ssrc, uint32_t());
MOCK_CONST_METHOD0(media_type, cricket::MediaType());
MOCK_CONST_METHOD0(id, std::string());
MOCK_CONST_METHOD0(stream_ids, std::vector<std::string>());
MOCK_CONST_METHOD0(GetParameters, RtpParameters());
MOCK_METHOD1(SetParameters, bool(const RtpParameters&));
MOCK_CONST_METHOD0(GetDtmfSender, rtc::scoped_refptr<DtmfSenderInterface>());
};
} // namespace webrtc
#endif // WEBRTC_API_TEST_MOCK_RTPSENDER_H_
|
/***************************************************************************
Copyright (c) 2016, The OpenBLAS Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the name of the OpenBLAS project nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT 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 "common.h"
#include <math.h>
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf=0.0;
BLASLONG min=0;
if (n <= 0 || inc_x <= 0) return(min);
minf=x[0];
ix += inc_x;
i++;
while(i < n)
{
if( x[ix] > minf )
{
min = i;
minf = x[ix];
}
ix += inc_x;
i++;
}
return(min+1);
}
|
/*
Copyright (C) 2014, The University of Texas at Austin
This file is part of libflame and is available under the 3-Clause
BSD license, which can be found in the LICENSE file at the top-level
directory, or at http://opensource.org/licenses/BSD-3-Clause
*/
#include "FLAME.h"
FLA_Error REF_Svd_uv( FLA_Obj A, FLA_Obj s, FLA_Obj U, FLA_Obj V,
double* dtime_bred, double* dtime_bsvd, double* dtime_appq,
double* dtime_qrfa, double* dtime_gemm )
{
*dtime_bred = 1;
*dtime_bsvd = 1;
*dtime_appq = 1;
*dtime_qrfa = 1;
*dtime_gemm = 1;
return FLA_Svd_external( FLA_SVD_VECTORS_ALL, FLA_SVD_VECTORS_ALL, A, s, U, V );
}
|
// 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 JINGLE_NOTIFIER_COMMUNICATOR_CONNECTION_SETTINGS_H_
#define JINGLE_NOTIFIER_COMMUNICATOR_CONNECTION_SETTINGS_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "net/base/host_port_pair.h"
#include "jingle/notifier/base/server_information.h"
namespace jingle_xmpp {
class XmppClientSettings;
} // namespace
namespace notifier {
// The port for SSLTCP (just the regular port for SSL).
extern const uint16_t kSslTcpPort;
enum SslTcpMode { DO_NOT_USE_SSLTCP, USE_SSLTCP };
struct ConnectionSettings {
public:
ConnectionSettings(const net::HostPortPair& server,
SslTcpMode ssltcp_mode,
SslTcpSupport ssltcp_support);
ConnectionSettings();
~ConnectionSettings();
bool Equals(const ConnectionSettings& settings) const;
std::string ToString() const;
// Fill in the connection-related fields of |client_settings|.
void FillXmppClientSettings(jingle_xmpp::XmppClientSettings* client_settings) const;
net::HostPortPair server;
SslTcpMode ssltcp_mode;
SslTcpSupport ssltcp_support;
};
typedef std::vector<ConnectionSettings> ConnectionSettingsList;
// Given a list of servers in priority order, generate a list of
// ConnectionSettings to try in priority order. If |try_ssltcp_first|
// is set, for each server that supports SSLTCP, the
// ConnectionSettings using SSLTCP will come first. If it is not set,
// the ConnectionSettings using SSLTCP will come last.
ConnectionSettingsList MakeConnectionSettingsList(
const ServerList& servers,
bool try_ssltcp_first);
} // namespace notifier
#endif // JINGLE_NOTIFIER_COMMUNICATOR_CONNECTION_SETTINGS_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 CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_
#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_
#include <stdint.h>
#include <map>
#include <string>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/platform_notification_service.h"
#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h"
#include "url/gurl.h"
namespace content {
class DesktopNotificationDelegate;
struct NotificationResources;
struct PlatformNotificationData;
// Responsible for tracking active notifications and allowed origins for the
// Web Notification API when running layout tests.
class LayoutTestNotificationManager : public PlatformNotificationService {
public:
LayoutTestNotificationManager();
~LayoutTestNotificationManager() override;
// Simulates a click on the notification titled |title|. |action_index|
// indicates which action was clicked, or -1 if the main notification body was
// clicked. Must be called on the UI thread.
void SimulateClick(const std::string& title, int action_index);
// Simulates the closing a notification titled |title|. Must be called on
// the UI thread.
void SimulateClose(const std::string& title, bool by_user);
// PlatformNotificationService implementation.
blink::WebNotificationPermission CheckPermissionOnUIThread(
BrowserContext* browser_context,
const GURL& origin,
int render_process_id) override;
blink::WebNotificationPermission CheckPermissionOnIOThread(
ResourceContext* resource_context,
const GURL& origin,
int render_process_id) override;
void DisplayNotification(BrowserContext* browser_context,
const GURL& origin,
const PlatformNotificationData& notification_data,
const NotificationResources& notification_resources,
scoped_ptr<DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) override;
void DisplayPersistentNotification(
BrowserContext* browser_context,
int64_t persistent_notification_id,
const GURL& origin,
const PlatformNotificationData& notification_data,
const NotificationResources& notification_resources) override;
void ClosePersistentNotification(
BrowserContext* browser_context,
int64_t persistent_notification_id) override;
bool GetDisplayedPersistentNotifications(
BrowserContext* browser_context,
std::set<std::string>* displayed_notifications) override;
private:
// Structure to represent the information of a persistent notification.
struct PersistentNotification {
BrowserContext* browser_context = nullptr;
GURL origin;
int64_t persistent_id = 0;
};
// Closes the notification titled |title|. Must be called on the UI thread.
void Close(const std::string& title);
// Fakes replacing the notification identified by |params| when it has a tag
// and a previous notification has been displayed using the same tag. All
// notifications, both page and persistent ones, will be considered for this.
void ReplaceNotificationIfNeeded(
const PlatformNotificationData& notification_data);
// Checks if |origin| has permission to display notifications. May be called
// on both the IO and the UI threads.
blink::WebNotificationPermission CheckPermission(const GURL& origin);
std::map<std::string, DesktopNotificationDelegate*> page_notifications_;
std::map<std::string, PersistentNotification> persistent_notifications_;
std::map<std::string, std::string> replacements_;
base::WeakPtrFactory<LayoutTestNotificationManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LayoutTestNotificationManager);
};
} // content
#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NOTIFICATION_MANAGER_H_
|
/*
* libjingle
* Copyright 2004--2005, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR 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 TALK_BASE_EVENT_H__
#define TALK_BASE_EVENT_H__
namespace talk_base {
#ifdef WIN32
class Event {
public:
Event() {
event_ = CreateEvent(NULL, FALSE, FALSE, NULL);
}
~Event() {
CloseHandle(event_);
}
void Set() {
SetEvent(event_);
}
void Reset() {
ResetEvent(event_);
}
void Wait() {
WaitForSingleObject(event_, INFINITE);
}
private:
HANDLE event_;
};
#endif
#ifdef POSIX
#include <cassert>
class Event {
Event() {
assert(false);
}
~Event() {
assert(false);
}
void Set() {
assert(false);
}
void Reset() {
assert(false);
}
void Wait() {
assert(false);
}
};
#endif
} // namespace talk_base
#endif // TALK_BASE_EVENT_H__
|
/* sgetrf Example Program Text */
/*
* ACML version 1.0 Copyright AMD,NAG 2003
*/
#include <acml.h>
#include <stdio.h>
int main(void)
{
#define NMAX 8
#define NRHMAX 8
const long lda=NMAX, ldb=NMAX;
long i, info, j, n, nrhs;
float a[NMAX*NMAX], b[NMAX*NRHMAX];
long ipiv[NMAX];
/* These macros allow access to 1-d arrays as though
they are 2-d arrays stored in column-major order,
as required by ACML C routines. */
#define A(I,J) a[((J)-1)*lda+(I)-1]
#define B(I,J) b[((J)-1)*ldb+(I)-1]
printf("ACML example: solution of linear equations using sgetrf/sgetrs\n");
printf("--------------------------------------------------------------\n");
printf("\n");
/* Initialize matrix A */
n = 4;
A(1,1) = 1.80;
A(1,2) = 2.88;
A(1,3) = 2.05;
A(1,4) = -0.89;
A(2,1) = 5.25;
A(2,2) = -2.95;
A(2,3) = -0.95;
A(2,4) = -3.80;
A(3,1) = 1.58;
A(3,2) = -2.69;
A(3,3) = -2.90;
A(3,4) = -1.04;
A(4,1) = -1.11;
A(4,2) = -0.66;
A(4,3) = -0.59;
A(4,4) = 0.80;
/* Initialize right-hand-side matrix B */
nrhs = 2;
B(1,1) = 9.52;
B(1,2) = 18.47;
B(2,1) = 24.35;
B(2,2) = 2.25;
B(3,1) = 0.77;
B(3,2) = -13.28;
B(4,1) = -6.22;
B(4,2) = -6.21;
printf("Matrix A:\n");
for (i = 1; i <= n; i++)
{
for (j = 1; j <= n; j++)
printf("%8.4f ", A(i,j));
printf("\n");
}
printf("\n");
printf("Right-hand-side matrix B:\n");
for (i = 1; i <= n; i++)
{
for (j = 1; j <= nrhs; j++)
printf("%8.4f ", B(i,j));
printf("\n");
}
/* Factorize A */
sgetrf(n,n,a,lda,ipiv,&info);
printf("\n");
if (info == 0)
{
/* Compute solution */
sgetrs('N',n,nrhs,a,lda,ipiv,b,ldb,&info);
/* Print solution */
printf("Solution matrix X of equations A*X = B:\n");
for (i = 1; i <= n; i++)
{
for (j = 1; j <= nrhs; j++)
printf("%8.4f ", B(i,j));
printf("\n");
}
}
else
printf("The factor U of matrix A is singular\n");
return 0;
}
|
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// BlitGL.h: Defines the BlitGL class, a helper for blitting textures
#ifndef LIBANGLE_RENDERER_GL_BLITGL_H_
#define LIBANGLE_RENDERER_GL_BLITGL_H_
#include "angle_gl.h"
#include "common/angleutils.h"
#include "libANGLE/angletypes.h"
#include "libANGLE/Error.h"
namespace gl
{
class Framebuffer;
}
namespace rx
{
class FramebufferGL;
class FunctionsGL;
class StateManagerGL;
struct WorkaroundsGL;
class BlitGL : public angle::NonCopyable
{
public:
BlitGL(const FunctionsGL *functions,
const WorkaroundsGL &workarounds,
StateManagerGL *stateManager);
~BlitGL();
gl::Error copyImageToLUMAWorkaroundTexture(GLuint texture,
GLenum textureType,
GLenum target,
GLenum lumaFormat,
size_t level,
const gl::Rectangle &sourceArea,
GLenum internalFormat,
const gl::Framebuffer *source);
gl::Error copySubImageToLUMAWorkaroundTexture(GLuint texture,
GLenum textureType,
GLenum target,
GLenum lumaFormat,
size_t level,
const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
const gl::Framebuffer *source);
gl::Error initializeResources();
private:
const FunctionsGL *mFunctions;
const WorkaroundsGL &mWorkarounds;
StateManagerGL *mStateManager;
GLuint mBlitProgram;
GLuint mScratchTexture;
GLuint mScratchFBO;
GLuint mVAO;
};
}
#endif // LIBANGLE_RENDERER_GL_BLITGL_H_
|
/*
* Copyright (c) 1993 Christopher G. Demetriou
* Copyright (c) 1988, 1990 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1988 Regents of the University of California.\n\
All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static const char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* This program is not related to David Wall, whose Stanford Ph.D. thesis
* is entitled "Mechanisms for Broadcast and Selective Broadcast".
*/
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <rpc/rpc.h>
#include <rpcsvc/rwall.h>
#include <err.h>
#include <paths.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
static char *mbuf;
static char notty[] = "no tty";
static void makemsg(const char *);
static void usage(void);
/* ARGSUSED */
int
main(int argc, char *argv[])
{
char *wallhost, res;
CLIENT *cl;
struct timeval tv;
if ((argc < 2) || (argc > 3))
usage();
wallhost = argv[1];
makemsg(argv[2]);
/*
* Create client "handle" used for calling MESSAGEPROG on the
* server designated on the command line. We tell the rpc package
* to use the "tcp" protocol when contacting the server.
*/
cl = clnt_create(wallhost, WALLPROG, WALLVERS, "udp");
if (cl == NULL) {
/*
* Couldn't establish connection with server.
* Print error message and die.
*/
errx(1, "%s", clnt_spcreateerror(wallhost));
}
tv.tv_sec = 15; /* XXX ?? */
tv.tv_usec = 0;
if (clnt_call(cl, WALLPROC_WALL, (xdrproc_t)xdr_wrapstring, &mbuf,
(xdrproc_t)xdr_void, &res, tv) != RPC_SUCCESS) {
/*
* An error occurred while calling the server.
* Print error message and die.
*/
errx(1, "%s", clnt_sperror(cl, wallhost));
}
return (0);
}
static void
usage(void)
{
fprintf(stderr, "usage: rwall host [file]\n");
exit(1);
}
static void
makemsg(const char *fname)
{
struct tm *lt;
struct passwd *pw;
struct stat sbuf;
time_t now;
FILE *fp;
int fd;
size_t mbufsize;
char *tty, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
const char *whom;
snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
if ((fd = mkstemp(tmpname)) == -1 || (fp = fdopen(fd, "r+")) == NULL)
err(1, "can't open temporary file");
unlink(tmpname);
whom = getlogin();
if (!whom) {
pw = getpwuid(getuid());
whom = pw ? pw->pw_name : "???";
}
gethostname(hostname, sizeof(hostname));
time(&now);
lt = localtime(&now);
/*
* all this stuff is to blank out a square for the message;
* we wrap message lines at column 79, not 80, because some
* terminals wrap after 79, some do not, and we can't tell.
* Which means that we may leave a non-blank character
* in column 80, but that can't be helped.
*/
fprintf(fp, "Remote Broadcast Message from %s@%s\n",
whom, hostname);
tty = ttyname(STDERR_FILENO);
if (tty == NULL)
tty = notty;
fprintf(fp, " (%s) at %d:%02d ...\n", tty,
lt->tm_hour, lt->tm_min);
putc('\n', fp);
if (fname && !(freopen(fname, "r", stdin)))
err(1, "can't read %s", fname);
while (fgets(lbuf, sizeof(lbuf), stdin))
fputs(lbuf, fp);
rewind(fp);
if (fstat(fd, &sbuf))
err(1, "can't stat temporary file");
mbufsize = (size_t)sbuf.st_size;
mbuf = malloc(mbufsize);
if (mbuf == NULL)
err(1, "out of memory");
if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != (u_int)mbufsize)
err(1, "can't read temporary file");
close(fd);
}
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMACSWIPEGESTURERECOGNIZER_MAC_P_H
#define QMACSWIPEGESTURERECOGNIZER_MAC_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qtimer.h"
#include "qpoint.h"
#include "qgesturerecognizer.h"
#ifndef QT_NO_GESTURES
QT_BEGIN_NAMESPACE
class QMacSwipeGestureRecognizer : public QGestureRecognizer
{
public:
QMacSwipeGestureRecognizer();
QGesture *create(QObject *target);
QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event);
void reset(QGesture *gesture);
};
class QMacPinchGestureRecognizer : public QGestureRecognizer
{
public:
QMacPinchGestureRecognizer();
QGesture *create(QObject *target);
QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event);
void reset(QGesture *gesture);
};
#if defined(QT_MAC_USE_COCOA)
class QMacPanGestureRecognizer : public QObject, public QGestureRecognizer
{
public:
QMacPanGestureRecognizer();
QGesture *create(QObject *target);
QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event);
void reset(QGesture *gesture);
private:
QPointF _startPos;
QBasicTimer _panTimer;
bool _panCanceled;
};
#endif
QT_END_NAMESPACE
#endif // QT_NO_GESTURES
#endif // QMACSWIPEGESTURERECOGNIZER_MAC_P_H
|
/*
Copyright (C) 2014, The University of Texas at Austin
This file is part of libflame and is available under the 3-Clause
BSD license, which can be found in the LICENSE file at the top-level
directory, or at http://opensource.org/licenses/BSD-3-Clause
*/
#include "FLAME.h"
#ifdef FLA_ENABLE_NON_CRITICAL_CODE
FLA_Error FLA_Her2k_lh_blk_var4( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C, fla_her2k_t* cntl )
{
FLA_Obj AL, AR, A0, A1, A2;
FLA_Obj BL, BR, B0, B1, B2;
FLA_Obj CTL, CTR, C00, C01, C02,
CBL, CBR, C10, C11, C12,
C20, C21, C22;
dim_t b;
FLA_Scalr_internal( FLA_LOWER_TRIANGULAR, beta, C,
FLA_Cntl_sub_scalr( cntl ) );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
FLA_Part_2x2( C, &CTL, &CTR,
&CBL, &CBR, 0, 0, FLA_TL );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
b = FLA_Determine_blocksize( AR, FLA_RIGHT, FLA_Cntl_blocksize( cntl ) );
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2,
b, FLA_RIGHT );
FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2,
b, FLA_RIGHT );
FLA_Repart_2x2_to_3x3( CTL, /**/ CTR, &C00, /**/ &C01, &C02,
/* ************* */ /* ******************** */
&C10, /**/ &C11, &C12,
CBL, /**/ CBR, &C20, /**/ &C21, &C22,
b, b, FLA_BR );
/*------------------------------------------------------------*/
/* C21 = C21 + A2' * B1 */
FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
alpha, A2, B1, FLA_ONE, C21,
FLA_Cntl_sub_gemm1( cntl ) );
/* C21 = C21 + B2' * A1 */
FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
alpha, B2, A1, FLA_ONE, C21,
FLA_Cntl_sub_gemm2( cntl ) );
/* C11 = C11 + A1' * B1 + B1' * A1 */
FLA_Her2k_internal( FLA_LOWER_TRIANGULAR, FLA_CONJ_TRANSPOSE,
alpha, A1, B1, FLA_ONE, C11,
FLA_Cntl_sub_her2k( cntl ) );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2,
FLA_LEFT );
FLA_Cont_with_3x3_to_2x2( &CTL, /**/ &CTR, C00, C01, /**/ C02,
C10, C11, /**/ C12,
/* ************** */ /* ****************** */
&CBL, /**/ &CBR, C20, C21, /**/ C22,
FLA_TL );
}
return FLA_SUCCESS;
}
#endif
|
/***********************************************************************************************************************
**
** Copyright (c) 2011, 2015 ETH Zurich
** 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 ETH Zurich nor the names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
***********************************************************************************************************************/
#pragma once
#include "../../informationscripting_api.h"
#include "../nodes/QueryNodeContainer.h"
#include "VisualizationBase/src/declarative/DeclarativeItem.h"
#include "VisualizationBase/src/items/ItemWithNode.h"
namespace InformationScripting {
class INFORMATIONSCRIPTING_API VQueryNodeContainer
: public Super<Visualization::ItemWithNode< VQueryNodeContainer,
Visualization::DeclarativeItem<VQueryNodeContainer>,
QueryNodeContainer>>
{
ITEM_COMMON_CUSTOM_STYLENAME(VQueryNodeContainer, Visualization::DeclarativeItemBaseStyle)
public:
VQueryNodeContainer(Item* parent, NodeType* node, const StyleType* style = itemStyles().get());
static void initializeForms();
private:
Visualization::Item* query_{};
};
}
|
#ifndef DSYNC_BRAIN_PRIVATE_H
#define DSYNC_BRAIN_PRIVATE_H
#include "hash.h"
#include "dsync-brain.h"
#include "dsync-mailbox.h"
#include "dsync-mailbox-state.h"
#define DSYNC_LOCK_FILENAME ".dovecot-sync.lock"
struct dsync_mailbox_tree_sync_change;
enum dsync_state {
DSYNC_STATE_MASTER_RECV_HANDSHAKE,
DSYNC_STATE_SLAVE_RECV_HANDSHAKE,
/* if sync_type=STATE, the master brain knows the saved "last common
mailbox state". this state is sent to the slave. */
DSYNC_STATE_MASTER_SEND_LAST_COMMON,
DSYNC_STATE_SLAVE_RECV_LAST_COMMON,
/* both sides send their mailbox trees */
DSYNC_STATE_SEND_MAILBOX_TREE,
DSYNC_STATE_SEND_MAILBOX_TREE_DELETES,
DSYNC_STATE_RECV_MAILBOX_TREE,
DSYNC_STATE_RECV_MAILBOX_TREE_DELETES,
/* master decides in which order mailboxes are synced (it knows the
slave's mailboxes by looking at the received mailbox tree) */
DSYNC_STATE_MASTER_SEND_MAILBOX,
DSYNC_STATE_SLAVE_RECV_MAILBOX,
/* once mailbox is selected, the mails inside it are synced.
after the mails are synced, another mailbox is synced. */
DSYNC_STATE_SYNC_MAILS,
DSYNC_STATE_DONE
};
enum dsync_box_state {
DSYNC_BOX_STATE_MAILBOX,
DSYNC_BOX_STATE_CHANGES,
DSYNC_BOX_STATE_ATTRIBUTES,
DSYNC_BOX_STATE_MAIL_REQUESTS,
DSYNC_BOX_STATE_MAILS,
DSYNC_BOX_STATE_RECV_LAST_COMMON,
DSYNC_BOX_STATE_DONE
};
struct dsync_brain {
pool_t pool;
struct mail_user *user;
struct dsync_ibc *ibc;
struct mail_namespace *sync_ns;
const char *sync_box;
guid_128_t sync_box_guid;
const char *const *exclude_mailboxes;
enum dsync_brain_sync_type sync_type;
unsigned int lock_timeout;
int lock_fd;
const char *lock_path;
struct file_lock *lock;
char hierarchy_sep;
struct dsync_mailbox_tree *local_mailbox_tree;
struct dsync_mailbox_tree *remote_mailbox_tree;
struct dsync_mailbox_tree_iter *local_tree_iter;
enum dsync_state state, pre_box_state;
enum dsync_box_state box_recv_state;
enum dsync_box_state box_send_state;
unsigned int proctitle_update_counter;
struct dsync_transaction_log_scan *log_scan;
struct dsync_mailbox_importer *box_importer;
struct dsync_mailbox_exporter *box_exporter;
struct mailbox *box;
struct dsync_mailbox local_dsync_box, remote_dsync_box;
/* list of mailbox states
for master brain: given to brain at init and
for slave brain: received from DSYNC_STATE_SLAVE_RECV_LAST_COMMON */
HASH_TABLE_TYPE(dsync_mailbox_state) mailbox_states;
/* DSYNC_STATE_MASTER_SEND_LAST_COMMON: current send position */
struct hash_iterate_context *mailbox_states_iter;
/* state of the mailbox we're currently syncing, changed at
init and deinit */
struct dsync_mailbox_state mailbox_state;
/* new states for synced mailboxes */
ARRAY_TYPE(dsync_mailbox_state) remote_mailbox_states;
unsigned int master_brain:1;
unsigned int mail_requests:1;
unsigned int backup_send:1;
unsigned int backup_recv:1;
unsigned int purge:1;
unsigned int debug:1;
unsigned int sync_visible_namespaces:1;
unsigned int no_mail_sync:1;
unsigned int no_backup_overwrite:1;
unsigned int changes_during_sync:1;
unsigned int verbose_proctitle:1;
unsigned int failed:1;
};
extern const char *dsync_box_state_names[DSYNC_BOX_STATE_DONE+1];
void dsync_brain_mailbox_trees_init(struct dsync_brain *brain);
void dsync_brain_send_mailbox_tree(struct dsync_brain *brain);
void dsync_brain_send_mailbox_tree_deletes(struct dsync_brain *brain);
bool dsync_brain_recv_mailbox_tree(struct dsync_brain *brain);
bool dsync_brain_recv_mailbox_tree_deletes(struct dsync_brain *brain);
int dsync_brain_mailbox_tree_sync_change(struct dsync_brain *brain,
const struct dsync_mailbox_tree_sync_change *change);
void dsync_brain_sync_mailbox_deinit(struct dsync_brain *brain);
int dsync_brain_mailbox_alloc(struct dsync_brain *brain, const guid_128_t guid,
struct mailbox **box_r, const char **error_r);
void dsync_brain_mailbox_update_pre(struct dsync_brain *brain,
struct mailbox *box,
const struct dsync_mailbox *local_box,
const struct dsync_mailbox *remote_box);
bool dsync_boxes_need_sync(struct dsync_brain *brain,
const struct dsync_mailbox *box1,
const struct dsync_mailbox *box2);
void dsync_brain_sync_init_box_states(struct dsync_brain *brain);
void dsync_brain_master_send_mailbox(struct dsync_brain *brain);
bool dsync_brain_slave_recv_mailbox(struct dsync_brain *brain);
int dsync_brain_sync_mailbox_open(struct dsync_brain *brain,
const struct dsync_mailbox *remote_dsync_box);
bool dsync_brain_sync_mails(struct dsync_brain *brain);
#endif
|
#import <AVFoundation/AVBase.h>
#import <AVFoundation/AVAsset.h>
#import <AVFoundation/AVVideoCompositing.h>
#import <Foundation/Foundation.h>
#import <CoreVideo/CoreVideo.h>
#import <CoreMedia/CMTime.h>
#import <CoreMedia/CMTimeRange.h>
@import AVFoundation;
@import JavaScriptCore;
@protocol JSBNSObject;
@protocol JSBAVVideoCompositionLayerInstruction <JSExport, JSBNSObject>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property (nonatomic, readonly) CMPersistentTrackID passthroughTrackID;
@property (nonatomic, retain) id backgroundColor;
@property (nonatomic, readonly) float renderScale;
@property (nonatomic, retain, readonly) AVVideoCompositionCoreAnimationTool *animationTool;
@property (nonatomic, readonly) CGSize renderSize;
@property (nonatomic, readonly) CMTime frameDuration;
@property (nonatomic, retain, readonly) Class customVideoCompositorClass;
@property (nonatomic, copy, readonly) NSArray *layerInstructions;
@property (nonatomic, assign, readonly) CMTimeRange timeRange;
@property (nonatomic, readonly) NSArray *requiredSourceTrackIDs;
@property (nonatomic, assign, readonly) CMPersistentTrackID trackID;
@property (nonatomic, copy, readonly) NSArray *instructions;
@property (nonatomic, assign, readonly) BOOL enablePostProcessing;
- (BOOL)getTransformRampForTime:(CMTime)time startTransform:(CGAffineTransform *)startTransform endTransform:(CGAffineTransform *)endTransform timeRange:(CMTimeRange *)timeRange;
- (BOOL)getOpacityRampForTime:(CMTime)time startOpacity:(float *)startOpacity endOpacity:(float *)endOpacity timeRange:(CMTimeRange *)timeRange;
- (BOOL)getCropRectangleRampForTime:(CMTime)time startCropRectangle:(CGRect *)startCropRectangle endCropRectangle:(CGRect *)endCropRectangle timeRange:(CMTimeRange *)timeRange;
#pragma clang diagnostic pop
@end
|
/*
* Tencent is pleased to support the open source community by making
* WCDB available.
*
* Copyright (C) 2017 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of
* the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <WCDB/WCTDeclare.h>
#import <WCDB/WCTPropertyBase.h>
#import <WCDB/abstract.h>
typedef WCTProperty (^WCTPropertyNamed)(NSString *);
class WCTProperty : public WCDB::Column, public WCTPropertyBase {
public:
WCTProperty(const char *name = "");
WCTProperty(NSString *name = @"");
WCTProperty(const char *name,
Class cls,
const std::shared_ptr<WCTColumnBinding> &columnBinding);
//distinct
WCTResultList distinct() const;
//table
WCTProperty inTable(NSString *table) const;
//order
WCTOrderBy order(WCTOrderTerm term = WCTOrderedNotSet) const;
//index
WCTIndex index(WCTOrderTerm term = WCTOrderedNotSet) const;
//aggregate functions
WCTExpr avg(bool distinct = false) const;
WCTExpr count(bool distinct = false) const;
WCTExpr groupConcat(bool distinct = false) const;
WCTExpr groupConcat(NSString *seperator, bool distinct = false) const;
WCTExpr max(bool distinct = false) const;
WCTExpr min(bool distinct = false) const;
WCTExpr sum(bool distinct = false) const;
WCTExpr total(bool distinct = false) const;
//core functions
WCTExpr abs(bool distinct = false) const;
WCTExpr hex(bool distinct = false) const;
WCTExpr length(bool distinct = false) const;
WCTExpr lower(bool distinct = false) const;
WCTExpr upper(bool distinct = false) const;
WCTExpr round(bool distinct = false) const;
//FTS3
//See http://www.sqlite.org/fts3.html#snippet for further information
WCTExpr matchinfo() const;
WCTExpr offsets() const;
WCTExpr snippet() const;
//def
WCTColumnDef def(WCTColumnType type,
bool isPrimary = false,
WCTOrderTerm term = WCTOrderedNotSet,
bool autoIncrement = false) const;
//condition
//unary
WCTExpr operator!() const;
WCTExpr operator+() const;
WCTExpr operator-() const;
WCTExpr operator~() const;
//binary
WCTExpr operator||(const WCTExpr &operand) const; //or, not concat
WCTExpr operator&&(const WCTExpr &operand) const;
WCTExpr operator*(const WCTExpr &operand) const;
WCTExpr operator/(const WCTExpr &operand) const;
WCTExpr operator%(const WCTExpr &operand) const;
WCTExpr operator+(const WCTExpr &operand) const;
WCTExpr operator-(const WCTExpr &operand) const;
WCTExpr operator<<(const WCTExpr &operand) const;
WCTExpr operator>>(const WCTExpr &operand) const;
WCTExpr operator&(const WCTExpr &operand) const;
WCTExpr operator|(const WCTExpr &operand) const;
WCTExpr operator<(const WCTExpr &operand) const;
WCTExpr operator<=(const WCTExpr &operand) const;
WCTExpr operator>(const WCTExpr &operand) const;
WCTExpr operator>=(const WCTExpr &operand) const;
WCTExpr operator==(const WCTExpr &operand) const;
WCTExpr operator!=(const WCTExpr &operand) const;
WCTExpr concat(const WCTExpr &operand) const;
WCTExpr substr(const WCTExpr &start, const WCTExpr &length) const;
WCTExpr in(const WCTExprList &exprList) const;
WCTExpr notIn(const WCTExprList &exprList) const;
WCTExpr in(const WCDB::StatementSelectList &statementSelectList) const;
WCTExpr notIn(const WCDB::StatementSelectList &statementSelectList) const;
WCTExpr in(NSArray<WCTValue *> *valueList) const;
WCTExpr notIn(NSArray<WCTValue *> *valueList) const;
WCTExpr in(NSString *table) const;
WCTExpr notIn(NSString *table) const;
WCTExpr between(const WCTExpr &left, const WCTExpr &right) const;
WCTExpr notBetween(const WCTExpr &left, const WCTExpr &right) const;
WCTExpr like(const WCTExpr &operand) const;
WCTExpr glob(const WCTExpr &operand) const;
WCTExpr match(const WCTExpr &operand) const;
WCTExpr regexp(const WCTExpr &operand) const;
WCTExpr notLike(const WCTExpr &operand) const;
WCTExpr notGlob(const WCTExpr &operand) const;
WCTExpr notMatch(const WCTExpr &operand) const;
WCTExpr notRegexp(const WCTExpr &operand) const;
WCTExpr like(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr glob(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr match(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr regexp(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr notLike(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr notGlob(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr notMatch(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr notRegexp(const WCTExpr &operand, const WCTExpr &escape) const;
WCTExpr isNull() const;
WCTExpr isNotNull() const;
WCTExpr is(const WCTExpr &operand) const;
WCTExpr isNot(const WCTExpr &operand) const;
NSString *getDescription() const;
static WCTPropertyNamed PropertyNamed;
protected:
WCTProperty(const WCDB::Column &column,
Class cls,
const std::shared_ptr<WCTColumnBinding> &columnBinding);
};
class WCTPropertyList : public std::list<const WCTProperty> {
public:
WCTPropertyList();
WCTPropertyList(const WCTProperty &property);
WCTPropertyList(std::initializer_list<const WCTProperty> il);
WCTPropertyList inTable(NSString *tableName) const;
};
|
/***************************************************************************/
/* */
/* sfnt.c */
/* */
/* Single object library component. */
/* */
/* Copyright 1996-2006, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "sfntpic.c"
#include "ttload.c"
#include "ttmtx.c"
#include "ttcmap.c"
#include "ttkern.c"
#include "sfobjs.c"
#include "sfdriver.c"
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
#include "pngshim.c"
#include "ttsbit.c"
#endif
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.c"
#endif
#ifdef TT_CONFIG_OPTION_BDF
#include "ttbdf.c"
#endif
/* END */
|
/*
* NetworkTableKeyListenerAdapter.h
*
* Created on: Oct 17, 2012
* Author: Mitchell Wills
*/
#ifndef NETWORKTABLEKEYLISTENERADAPTER_H_
#define NETWORKTABLEKEYLISTENERADAPTER_H_
class NetworkTableKeyListenerAdapter;
#include "tables/ITableListener.h"
#include "tables/ITable.h"
#include <string>
#include "networktables/NetworkTable.h"
class NetworkTableKeyListenerAdapter : public ITableListener{
private:
std::string relativeKey;
std::string fullKey;
NetworkTable* targetSource;
ITableListener* targetListener;
public:
NetworkTableKeyListenerAdapter(std::string relativeKey, std::string fullKey, NetworkTable* targetSource, ITableListener* targetListener);
virtual ~NetworkTableKeyListenerAdapter();
void ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew);
};
#endif /* NETWORKTABLEKEYLISTENERADAPTER_H_ */
|
/*
* Copyright (c) 2012, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef DISTCAPS_H
#define DISTCAPS_H
#include <kernel.h>
#include <barrelfish_kpi/types.h>
#include <barrelfish_kpi/capabilities.h>
#include <barrelfish_kpi/distcaps.h>
#include <mdb/mdb.h>
#include <capabilities.h>
struct cte;
static inline distcap_state_t
distcap_get_state(struct cte *dcap)
{
distcap_state_t result = 0;
if (dcap->mdbnode.owner != my_core_id) {
result |= DISTCAP_STATE_FOREIGN;
}
if (dcap->mdbnode.locked || dcap->mdbnode.in_delete) {
result |= DISTCAP_STATE_BUSY;
}
return result;
}
static inline bool
distcap_is_foreign(struct cte *dcap)
{
return dcap->mdbnode.owner != my_core_id;
}
static inline bool
distcap_is_in_delete(struct cte *dcap)
{
return dcap->mdbnode.in_delete;
}
static inline void
distcap_set_deleted(struct cte *dcap)
{
dcap->mdbnode.in_delete = true;
}
#endif
|
#ifndef org_apache_lucene_queryparser_surround_parser_CharStream_H
#define org_apache_lucene_queryparser_surround_parser_CharStream_H
#include "java/lang/Object.h"
namespace java {
namespace lang {
class String;
class Class;
}
namespace io {
class IOException;
}
}
template<class T> class JArray;
namespace org {
namespace apache {
namespace lucene {
namespace queryparser {
namespace surround {
namespace parser {
class CharStream : public ::java::lang::Object {
public:
enum {
mid_BeginToken_54c6a173,
mid_Done_54c6a166,
mid_GetImage_14c7b5c5,
mid_GetSuffix_b4292e99,
mid_backup_39c7bd3c,
mid_getBeginColumn_54c6a179,
mid_getBeginLine_54c6a179,
mid_getColumn_54c6a179,
mid_getEndColumn_54c6a179,
mid_getEndLine_54c6a179,
mid_getLine_54c6a179,
mid_readChar_54c6a173,
max_mid
};
static ::java::lang::Class *class$;
static jmethodID *mids$;
static bool live$;
static jclass initializeClass(bool);
explicit CharStream(jobject obj) : ::java::lang::Object(obj) {
if (obj != NULL)
env->getClass(initializeClass);
}
CharStream(const CharStream& obj) : ::java::lang::Object(obj) {}
jchar BeginToken() const;
void Done() const;
::java::lang::String GetImage() const;
JArray< jchar > GetSuffix(jint) const;
void backup(jint) const;
jint getBeginColumn() const;
jint getBeginLine() const;
jint getColumn() const;
jint getEndColumn() const;
jint getEndLine() const;
jint getLine() const;
jchar readChar() const;
};
}
}
}
}
}
}
#include <Python.h>
namespace org {
namespace apache {
namespace lucene {
namespace queryparser {
namespace surround {
namespace parser {
extern PyTypeObject PY_TYPE(CharStream);
class t_CharStream {
public:
PyObject_HEAD
CharStream object;
static PyObject *wrap_Object(const CharStream&);
static PyObject *wrap_jobject(const jobject&);
static void install(PyObject *module);
static void initialize(PyObject *module);
};
}
}
}
}
}
}
#endif
|
//
// DBMetadata.h
// DropboxSDK
//
// Created by Brian Smith on 5/3/10.
// Copyright 2010 Dropbox, Inc. All rights reserved.
//
@interface DBMetadata : NSObject <NSCoding> {
BOOL thumbnailExists;
long long totalBytes;
NSDate* lastModifiedDate;
NSString* path;
BOOL isDirectory;
NSArray* contents;
NSString* hash;
NSString* humanReadableSize;
NSString* root;
NSString* icon;
NSString* rev;
long long revision; // Deprecated; will be removed in version 2. Use rev whenever possible
BOOL isDeleted;
NSString *filename;
}
- (id)initWithDictionary:(NSDictionary*)dict;
@property (nonatomic, readonly) BOOL thumbnailExists;
@property (nonatomic, readonly) long long totalBytes;
@property (nonatomic, readonly) NSDate* lastModifiedDate;
@property (nonatomic, readonly) NSString* path;
@property (nonatomic, readonly) BOOL isDirectory;
@property (nonatomic, readonly) NSArray* contents;
@property (nonatomic, readonly) NSString* hash;
@property (nonatomic, readonly) NSString* humanReadableSize;
@property (nonatomic, readonly) NSString* root;
@property (nonatomic, readonly) NSString* icon;
@property (nonatomic, readonly) long long revision; // Deprecated, use rev instead
@property (nonatomic, readonly) NSString* rev;
@property (nonatomic, readonly) BOOL isDeleted;
@property (nonatomic, readonly) NSString* filename;
@end
|
#import <Foundation/Foundation.h>
#import "CCBWarnings.h"
@class PublishRenamedFilesLookup;
@interface CCBPublishingTarget : NSObject
@property (nonatomic, strong) NSArray *inputDirectories;
@property (nonatomic, copy) NSString *outputDirectory;
@property (nonatomic, copy) NSString *directoryToClean;
@property (nonatomic) CCBPublisherOSType osType;
@property (nonatomic, strong) NSArray *resolutions;
@property (nonatomic) CCBPublishEnvironment publishEnvironment;
@property (nonatomic) NSInteger audioQuality;
@property (nonatomic, copy) NSString *zipOutputPath;
@property (nonatomic, strong) NSMutableSet *publishedPNGFiles;
@property (nonatomic, strong) PublishRenamedFilesLookup *renamedFilesLookup;
@property (nonatomic, strong) NSMutableSet *publishedSpriteSheetFiles;
@end |
/* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for license. */
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
#ifndef _NIMESH_H_
#define _NIMESH_H_
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "NiRenderObject.h"
// Include structures
#include "../gen/SphereBV.h"
#include "../gen/MeshData.h"
#include "../Ref.h"
#include "../gen/ExtraMeshDataEpicMickey.h"
#include "../gen/ExtraMeshDataEpicMickey2.h"
namespace Niflib {
// Forward define of referenced NIF objects
class NiMeshModifier;
class NiMesh;
typedef Ref<NiMesh> NiMeshRef;
/*! */
class NiMesh : public NiRenderObject {
public:
/*! Constructor */
NIFLIB_API NiMesh();
/*! Destructor */
NIFLIB_API virtual ~NiMesh();
/*!
* A constant value which uniquly identifies objects of this type.
*/
NIFLIB_API static const Type TYPE;
/*!
* A factory function used during file reading to create an instance of this type of object.
* \return A pointer to a newly allocated instance of this type of object.
*/
NIFLIB_API static NiObject * Create();
/*!
* Summarizes the information contained in this object in English.
* \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out.
* \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same.
*/
NIFLIB_API virtual string asString( bool verbose = false ) const;
/*!
* Used to determine the type of a particular instance of this object.
* \return The type constant for the actual type of the object.
*/
NIFLIB_API virtual const Type & GetType() const;
//--BEGIN MISC CUSTOM CODE--//
//--END CUSTOM CODE--//
protected:
/*! The primitive type of the mesh, such as triangles or lines. */
MeshPrimitiveType primitiveType;
/*! Unknown. */
int unknown51;
/*! Unknown. */
int unknown52;
/*! Unknown. */
int unknown53;
/*! Unknown. */
int unknown54;
/*! Unknown. */
float unknown55;
/*! Unknown. */
int unknown56;
/*! The number of submeshes contained in this mesh. */
unsigned short numSubmeshes;
/*! Sets whether hardware instancing is being used. */
bool instancingEnabled;
/*! The combined bounding volume of all submeshes. */
SphereBV bound;
/*! Unknown. */
mutable unsigned int numDatas;
/*! Unknown. */
vector<MeshData > datas;
/*! Unknown. */
mutable unsigned int numModifiers;
/*! Unknown. */
vector<Ref<NiMeshModifier > > modifiers;
/*! Unknown. */
byte unknown100;
/*! Unknown. */
int unknown101;
/*! Size of additional data. */
mutable unsigned int unknown102;
/*! Unknown. */
vector<float > unknown103;
/*! Unknown. */
mutable int unknown200;
/*! Unknown. */
vector<ExtraMeshDataEpicMickey > unknown201;
/*! Unknown. */
mutable int unknown250;
/*! Unknown. */
vector<int > unknown251;
/*! Unknown. */
int unknown300;
/*! Unknown. */
short unknown301;
/*! Unknown. */
mutable int unknown302;
/*! Unknown. */
vector<byte > unknown303;
/*! Unknown. */
mutable int unknown350;
/*! Unknown. */
vector<ExtraMeshDataEpicMickey2 > unknown351;
/*! Unknown. */
int unknown400;
public:
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info );
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info );
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const;
};
//--BEGIN FILE FOOT CUSTOM CODE--//
//--END CUSTOM CODE--//
} //End Niflib namespace
#endif
|
#ifndef org_apache_lucene_store_Lock_H
#define org_apache_lucene_store_Lock_H
#include "java/lang/Object.h"
namespace java {
namespace lang {
class Class;
}
namespace io {
class IOException;
class Closeable;
}
}
template<class T> class JArray;
namespace org {
namespace apache {
namespace lucene {
namespace store {
class Lock : public ::java::lang::Object {
public:
enum {
mid_init$_54c6a166,
mid_close_54c6a166,
mid_isLocked_54c6a16a,
mid_obtain_54c6a16a,
mid_obtain_0ee6df23,
max_mid
};
static ::java::lang::Class *class$;
static jmethodID *mids$;
static bool live$;
static jclass initializeClass(bool);
explicit Lock(jobject obj) : ::java::lang::Object(obj) {
if (obj != NULL)
env->getClass(initializeClass);
}
Lock(const Lock& obj) : ::java::lang::Object(obj) {}
static jlong LOCK_OBTAIN_WAIT_FOREVER;
static jlong LOCK_POLL_INTERVAL;
Lock();
void close() const;
jboolean isLocked() const;
jboolean obtain() const;
jboolean obtain(jlong) const;
};
}
}
}
}
#include <Python.h>
namespace org {
namespace apache {
namespace lucene {
namespace store {
extern PyTypeObject PY_TYPE(Lock);
class t_Lock {
public:
PyObject_HEAD
Lock object;
static PyObject *wrap_Object(const Lock&);
static PyObject *wrap_jobject(const jobject&);
static void install(PyObject *module);
static void initialize(PyObject *module);
};
}
}
}
}
#endif
|
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#ifdef AWS_MULTI_FRAMEWORK
#import <AWSRuntime/AmazonServiceRequestConfig.h>
#else
#import "../AmazonServiceRequestConfig.h"
#endif
/**
* Describe Alarms Request
*/
@interface CloudWatchDescribeAlarmsRequest:AmazonServiceRequestConfig
{
NSMutableArray *alarmNames;
NSString *alarmNamePrefix;
NSString *stateValue;
NSString *actionPrefix;
NSNumber *maxRecords;
NSString *nextToken;
}
/**
* Default constructor for a new object. Callers should use the
* property methods to initialize this object after creating it.
*/
-(id)init;
/**
* A list of alarm names to retrieve information for.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>0 - 100<br/>
*/
@property (nonatomic, retain) NSMutableArray *alarmNames;
/**
* The alarm name prefix. <code>AlarmNames</code> cannot be specified if
* this parameter is specified.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*/
@property (nonatomic, retain) NSString *alarmNamePrefix;
/**
* The state value to be used in matching alarms.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>OK, ALARM, INSUFFICIENT_DATA
*/
@property (nonatomic, retain) NSString *stateValue;
/**
* The action name prefix.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 1024<br/>
*/
@property (nonatomic, retain) NSString *actionPrefix;
/**
* The maximum number of alarm descriptions to retrieve.
* <p>
* <b>Constraints:</b><br/>
* <b>Range: </b>1 - 100<br/>
*/
@property (nonatomic, retain) NSNumber *maxRecords;
/**
* The token returned by a previous call to indicate that there is more
* data available.
*/
@property (nonatomic, retain) NSString *nextToken;
/**
* Adds a single object to alarmNames.
* This function will alloc and init alarmNames if not already done.
*/
-(void)addAlarmName:(NSString *)alarmNameObject;
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*/
-(NSString *)description;
@end
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
// This file is used by AsmOffsets.cpp to validate that our
// assembly-code offsets always match their C++ counterparts.
// You must #define PLAT_ASM_OFFSET and PLAT_ASM_SIZEOF before you #include this file
#ifdef BIT64
#define ASM_OFFSET(offset32, offset64, cls, member) PLAT_ASM_OFFSET(offset64, cls, member)
#define ASM_SIZEOF(sizeof32, sizeof64, cls ) PLAT_ASM_SIZEOF(sizeof64, cls)
#define ASM_CONST(const32, const64, expr) PLAT_ASM_CONST(const64, expr)
#else
#define ASM_OFFSET(offset32, offset64, cls, member) PLAT_ASM_OFFSET(offset32, cls, member)
#define ASM_SIZEOF(sizeof32, sizeof64, cls ) PLAT_ASM_SIZEOF(sizeof32, cls)
#define ASM_CONST(const32, const64, expr) PLAT_ASM_CONST(const32, expr)
#endif
// NOTE: the values MUST be in hex notation WITHOUT the 0x prefix
// 32-bit,64-bit, constant symbol
ASM_CONST( 14c08, 14c08, RH_LARGE_OBJECT_SIZE)
ASM_CONST( 400, 800, CLUMP_SIZE)
ASM_CONST( a, b, LOG2_CLUMP_SIZE)
// 32-bit,64-bit, class, member
ASM_OFFSET( 0, 0, Object, m_pEEType)
ASM_OFFSET( 4, 8, Array, m_Length)
ASM_OFFSET( 4, 8, String, m_Length)
ASM_OFFSET( 8, C, String, m_FirstChar)
ASM_CONST( 2, 2, STRING_COMPONENT_SIZE)
ASM_CONST( E, 16, STRING_BASE_SIZE)
ASM_CONST(3FFFFFDF,3FFFFFDF,MAX_STRING_LENGTH)
ASM_OFFSET( 0, 0, EEType, m_usComponentSize)
ASM_OFFSET( 2, 2, EEType, m_usFlags)
ASM_OFFSET( 4, 4, EEType, m_uBaseSize)
#if defined(EETYPE_TYPE_MANAGER)
ASM_OFFSET( 18, 20, EEType, m_VTable)
#else
ASM_OFFSET( 14, 18, EEType, m_VTable)
#endif
ASM_OFFSET( 0, 0, Thread, m_rgbAllocContextBuffer)
ASM_OFFSET( 28, 38, Thread, m_ThreadStateFlags)
ASM_OFFSET( 2c, 40, Thread, m_pTransitionFrame)
ASM_OFFSET( 30, 48, Thread, m_pHackPInvokeTunnel)
ASM_OFFSET( 40, 68, Thread, m_ppvHijackedReturnAddressLocation)
ASM_OFFSET( 44, 70, Thread, m_pvHijackedReturnAddress)
#ifdef BIT64
ASM_OFFSET( 0, 78, Thread, m_uHijackedReturnValueFlags)
#endif
ASM_OFFSET( 48, 80, Thread, m_pExInfoStackHead)
ASM_OFFSET( 4c, 88, Thread, m_threadAbortException)
ASM_SIZEOF( 14, 20, EHEnum)
ASM_OFFSET( 0, 0, gc_alloc_context, alloc_ptr)
ASM_OFFSET( 4, 8, gc_alloc_context, alloc_limit)
#ifdef FEATURE_CACHED_INTERFACE_DISPATCH
ASM_OFFSET( 4, 8, InterfaceDispatchCell, m_pCache)
#ifndef BIT64
ASM_OFFSET( 8, 0, InterfaceDispatchCache, m_pCell)
#endif
ASM_OFFSET( 10, 20, InterfaceDispatchCache, m_rgEntries)
ASM_SIZEOF( 8, 10, InterfaceDispatchCacheEntry)
#endif
ASM_OFFSET( 4, 8, StaticClassConstructionContext, m_initialized)
#ifdef FEATURE_DYNAMIC_CODE
ASM_OFFSET( 0, 0, CallDescrData, pSrc)
ASM_OFFSET( 4, 8, CallDescrData, numStackSlots)
ASM_OFFSET( 8, C, CallDescrData, fpReturnSize)
ASM_OFFSET( C, 10, CallDescrData, pArgumentRegisters)
ASM_OFFSET( 10, 18, CallDescrData, pFloatArgumentRegisters)
ASM_OFFSET( 14, 20, CallDescrData, pTarget)
ASM_OFFSET( 18, 28, CallDescrData, pReturnBuffer)
#endif
// Undefine macros that are only used in this header for convenience.
#undef ASM_OFFSET
#undef ASM_SIZEOF
#undef ASM_CONST
// Define platform specific offsets
#include "AsmOffsetsCpu.h"
//#define USE_COMPILE_TIME_CONSTANT_FINDER // Uncomment this line to use the constant finder
#if defined(__cplusplus) && defined(USE_COMPILE_TIME_CONSTANT_FINDER)
// This class causes the compiler to emit an error with the constant we're interested in
// in the error message. This is useful if a size or offset changes. To use, comment out
// the compile-time assert that is firing, enable the constant finder, add the appropriate
// constant to find to BogusFunction(), and build.
//
// Here's a sample compiler error:
// In file included from corert/src/Native/Runtime/AsmOffsetsVerify.cpp:38:
// corert/src/Native/Runtime/Full/../AsmOffsets.h:117:61: error: calling a private constructor of class
// 'AsmOffsets::FindCompileTimeConstant<25>'
// FindCompileTimeConstant<offsetof(ExInfo, m_passNumber)> bogus_variable;
// ^
// corert/src/Native/Runtime/Full/../AsmOffsets.h:111:5: note: declared private here
// FindCompileTimeConstant();
// ^
template<size_t N>
class FindCompileTimeConstant
{
private:
FindCompileTimeConstant();
};
void BogusFunction()
{
// Sample usage to generate the error
FindCompileTimeConstant<sizeof(ExInfo)> bogus_variable;
FindCompileTimeConstant<offsetof(ExInfo, m_notifyDebuggerSP)> bogus_variable2;
FindCompileTimeConstant<sizeof(StackFrameIterator)> bogus_variable3;
FindCompileTimeConstant<sizeof(PAL_LIMITED_CONTEXT)> bogus_variable4;
FindCompileTimeConstant<offsetof(PAL_LIMITED_CONTEXT, IP)> bogus_variable5;
}
#endif // defined(__cplusplus) && defined(USE_COMPILE_TIME_CONSTANT_FINDER)
|
#ifndef _MD_BOOTLOADER_H_
#define _MD_BOOTLOADER_H_
extern uint32_t _srom;
extern uint32_t _lrom;
extern uint32_t _erom;
#define BOOTLOADER_SERIAL_MAX_SIZE 20 //DO NOT MODIFY!
#ifdef KEYBOARD_massdrop_ctrl
//WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support
extern uint32_t _eram;
#define BOOTLOADER_MAGIC 0x3B9ACA00
#define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4)
#endif
#ifdef MD_BOOTLOADER
#define MCU_HZ 48000000
#define I2C_HZ 0 //Not used
#endif //MD_BOOTLOADER
#endif //_MD_BOOTLOADER_H_
|
/*
* Copyright (C) 2013 HuaWei, Inc.
* Author: YQ <>
*
* 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.
*/
#ifndef __BALONG_CPUFREQ_H__
#define __BALONG_CPUFREQ_H__
#include <linux/io.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <bsp_om.h>
#include <bsp_cpufreq.h>
#define cpufreq_err(fmt,...) (bsp_trace(BSP_LOG_LEVEL_ERROR, BSP_MUDU_CPUFREQ, "[cpufreq]: <%s> <%d>"fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define cpufreq_info(fmt,...) (bsp_trace(BSP_LOG_LEVEL_INFO, BSP_MUDU_CPUFREQ, "[cpufreq]: <%s> <%d>"fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define cpufreq_debug(fmt,...) (bsp_trace(BSP_LOG_LEVEL_DEBUG, BSP_MUDU_CPUFREQ, "[cpufreq]: <%s> <%d>"fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__))
#ifndef BSP_OK
#define BSP_OK (0)
#endif
#ifndef BSP_ERROR
#define BSP_ERROR (-1)
#endif
#ifndef BSP_TRUE
#define BSP_TRUE (1)
#endif
#ifndef BSP_FALSE
#define BSP_FALSE (0)
#endif
#ifndef BSP_NULL
#define BSP_NULL (void*)0
#endif
#ifndef SEM_EMPTY
#define SEM_EMPTY 0
#endif
#define DEF_FREQUENCY_DOWN_THRESHOLD (20)
#define DEF_FREQUENCY_UP_THRESHOLD (40)
#define DEF_SAMPLING_DOWN_FACTOR (1)
#define TRANSITION_LATENCY_LIMIT (10 * 1000 * 1000)
/*ÈÎÎñÑÓ³Ùʱ¼ä*/
#define CPUFREQ_DEALY_TIME_OF_TASK 4000000 /*us*/
#define CPUFREQ_DOWN_THRESHOLD_TIMES 3
/*µ÷Ƶ²ßÂÔÐèÒªÐÅÏ¢µÄ½á¹¹Ì壬¸ù¾ÝÇé¿ö¿ÉÔö¼õ same with g_stDfsCcpuControl*/
struct cpu_dbs_info_s {
s32 cpu;
struct cpufreq_policy *cur_policy;
struct delayed_work work;
struct cpufreq_frequency_table *freq_table;
cputime64_t prev_cpu_idle;
cputime64_t prev_cpu_wall;
u32 start_time;
u32 cpu_down_time;/*·ûºÏϵ÷Ìõ¼þ´ÎÊý*/
u32 cpu_up_time;/*·ûºÏÉϵ÷Ìõ¼þ´ÎÊý*/
};
/*same with g_stDfsCcpuConfigInfo*/
struct dbs_tuners {
u32 sampling_rate;/*²ÉÑùÖµ*/
u32 up_threshold;/*µ÷ƵCPUÕ¼ÓÃÉÏÏÞãÐÖµ*/
u32 down_threshold;/*µ÷ƵCPUÕ¼ÓÃÏÂÏÞãÐÖµ*/
u32 down_threshold_times;/*ϵ÷ãÐÖµ*/
u32 up_threshold_times;/*Éϵ÷ãÐÖµ*/
};
#endif /* __BALONG_CPUFREQ_H__ */
|
/* $Id$ */
/*-
* Copyright (c) 2004-2007 Benedikt Meurer <benny@xfce.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __THUNAR_LIST_MODEL_H__
#define __THUNAR_LIST_MODEL_H__
#include <thunar/thunar-folder.h>
G_BEGIN_DECLS;
typedef struct _ThunarListModelClass ThunarListModelClass;
typedef struct _ThunarListModel ThunarListModel;
#define THUNAR_TYPE_LIST_MODEL (thunar_list_model_get_type ())
#define THUNAR_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_TYPE_LIST_MODEL, ThunarListModel))
#define THUNAR_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_TYPE_LIST_MODEL, ThunarListModelClass))
#define THUNAR_IS_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_TYPE_LIST_MODEL))
#define THUNAR_IS_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_TYPE_LIST_MODEL))
#define THUNAR_LIST_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_TYPE_LIST_MODEL, ThunarListModelClass))
GType thunar_list_model_get_type (void) G_GNUC_CONST;
ThunarListModel *thunar_list_model_new (void);
ThunarFolder *thunar_list_model_get_folder (ThunarListModel *store);
void thunar_list_model_set_folder (ThunarListModel *store,
ThunarFolder *folder);
void thunar_list_model_set_folders_first (ThunarListModel *store,
gboolean folders_first);
gboolean thunar_list_model_get_show_hidden (ThunarListModel *store);
void thunar_list_model_set_show_hidden (ThunarListModel *store,
gboolean show_hidden);
ThunarFile *thunar_list_model_get_file (ThunarListModel *store,
GtkTreeIter *iter);
GList *thunar_list_model_get_paths_for_files (ThunarListModel *store,
GList *files);
GList *thunar_list_model_get_paths_for_pattern (ThunarListModel *store,
const gchar *pattern);
gchar *thunar_list_model_get_statusbar_text (ThunarListModel *store,
GList *selected_items);
G_END_DECLS;
#endif /* !__THUNAR_LIST_MODEL_H__ */
|
/*
** Copyright (C) 1998-2013 George Tzanetakis <gtzan@cs.uvic.ca>
**
** 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 MARSYAS_DEBUG_FILE_IO_INCLUDED
#define MARSYAS_DEBUG_FILE_IO_INCLUDED
#include <marsyas/debug/record.h>
#include <marsyas/system/MarSystem.h>
#include <marsyas/export.h>
#include <fstream>
namespace Marsyas { namespace Debug {
void copy_swap_bytes(char *destination, const char * source, int size );
template <typename T>
void to_bytes( const T & src, char dst_bytes[sizeof(T)] )
{
const char *src_bytes = reinterpret_cast<const char*>(&src);
copy_swap_bytes(dst_bytes, src_bytes, sizeof(T));
}
template <typename T>
void from_bytes( T & dst, const char src_bytes[sizeof(T)] )
{
char *dst_bytes = reinterpret_cast<char*>(&dst);
copy_swap_bytes(dst_bytes, src_bytes, sizeof(T));
}
class marsyas_EXPORT FileWriter
{
struct SystemDescriptor
{
std::string path;
int out_columns;
int out_rows;
};
std::ofstream m_file;
std::vector<SystemDescriptor> m_descriptors;
public:
FileWriter( const std::string & filename, MarSystem * system );
~FileWriter();
bool isOpen() { return m_file.is_open(); }
bool write( const Record & record )
{
return write_record(record);
}
private:
void recursive_store_descriptor( MarSystem * system );
void write_magic();
void write_header();
bool write_record( const Record & record );
};
class marsyas_EXPORT FileReader
{
struct SystemDescriptor
{
std::string path;
int out_columns;
int out_rows;
};
typedef std::ifstream::pos_type pos_t;
std::ifstream m_file;
std::vector<SystemDescriptor> m_descriptors;
size_t m_record_size;
pos_t m_start_pos;
public:
FileReader( const std::string & filename );
~FileReader();
bool isOpen() { return m_file.is_open(); }
bool eof() { return m_file.eof(); }
bool read( Record & record )
{
return read_record(record);
}
void rewind();
private:
bool read_magic();
bool read_header();
bool read_record( Record & record );
};
}} // namespace Marsyas::Debug
#endif // MARSYAS_DEBUG_FILE_IO_INCLUDED
|
/* Copyright (C) 2011 emsys Embedded Systems GmbH
*
* 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 DRIVERS_USB_GADGET_PERSONALITY_PMSCADB_H
#define DRIVERS_USB_GADGET_PERSONALITY_PMSCADB_H
#include "p_adb.h"
#include "p_msc.h"
void personality_msc_adb(struct usb_composite_dev* cdev, const char* name);
#endif /* ndef DRIVERS_USB_GADGET_PERSONALITY_PMSCADB_H */
|
/* ----------------------------------------------------------------------
SPPARKS - Stochastic Parallel PARticle Kinetic Simulator
http://www.cs.sandia.gov/~sjplimp/spparks.html
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
Copyright (2008) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level SPPARKS directory.
------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(create_sites,CreateSites)
#else
#ifndef SPK_CREATE_SITES_H
#define SPK_CREATE_SITES_H
#include "pointers.h"
namespace SPPARKS_NS {
class CreateSites : protected Pointers {
friend class ReadSites;
public:
CreateSites(class SPPARKS *);
void command(int, char **);
void read_sites(class AppLattice *);
void ghosts_from_connectivity(class AppLattice *, int);
private:
int style,nregion,valueflag,valueindex,ivalue;
double dvalue;
int *basisflag,*basis_ivalue;
double *basis_dvalue;
int maxneigh;
int latticeflag;
class AppLattice *applattice;
class AppOffLattice *appoff;
tagint **idneigh; // global indices of neighbors of each site
// same as AppLattice neighbor, but tagint,
// tmp storage until convert to local indices
int **siteijk; // global indices of each site
// 0,1,2 = i,j,k lattice indices
// 3 = which basis atom in unit cell
int ***cmap; // connectivity map for regular lattices
// cmap[nbasis][maxneigh][4]
// 0,1,2 = i,j,k lattice unit cell offsets
// 3 = which basis atom in unit cell
// geometry info for building structured lattice with neighbors
int nx,ny,nz;
int xlo,xhi,ylo,yhi,zlo,zhi;
double xorig,yorig,zorig;
int latstyle,nbasis;
double xlattice,ylattice,zlattice;
struct Site {
int id,proc,index;
double x,y,z;
};
void structured_lattice();
void structured_connectivity();
void random_sites();
void random_connectivity();
void offsets(double **);
void offsets_2d(int, double **, double, double, int, int **);
void offsets_3d(int, double **, double, double, int, int **);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Create_sites command before app_style set
Self-explanatory.
E: Create_sites command before simulation box is defined
Self-explanatory.
E: Cannot create sites after sites already exist
Self-explanatory.
E: Cannot create sites with undefined lattice
Must use lattice commands first to define a lattice.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running SPPARKS to see the offending
line.
E: Create_sites region ID does not exist
Self-explanatory.
E: Creating a quantity application does not support
The application defines what variables it supports. You cannot set a
variable with the create_sites command for a variable that isn't
supported.
E: Must use value option before basis option in create_sites command
Self-explanatory.
E: Cannot use create_sites basis with random lattice
Self-explanatory.
E: Periodic box is not a multiple of lattice spacing
UNDOCUMENTED
E: Did not create correct number of sites
One or more created sites were not assigned to a processor
correctly.
E: Bad neighbor site ID
UNDOCUMENTED
E: Random lattice has no connectivity
The cutoff distance is likely too short.
E: Ghost site was not found
Internal SPPARKS error. Should not occur.
E: Ghost connection was not found
Internal SPPARKS error. Should not occur.
E: Incorrect lattice neighbor count
Internal SPPARKS error.
*/
|
/*
* linux/drivers/video/fb_defio.c
*
* Copyright (C) 2006 Jaya Kumar
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/fb.h>
#include <linux/list.h>
/* to support deferred IO */
#include <linux/rmap.h>
#include <linux/pagemap.h>
/* this is to find and return the vmalloc-ed fb pages */
static int fb_deferred_io_fault(struct vm_area_struct *vma,
struct vm_fault *vmf)
{
unsigned long offset;
struct page *page;
struct fb_info *info = vma->vm_private_data;
/* info->screen_base is virtual memory */
void *screen_base = (void __force *) info->screen_base;
offset = vmf->pgoff << PAGE_SHIFT;
if (offset >= info->fix.smem_len)
return VM_FAULT_SIGBUS;
page = vmalloc_to_page(screen_base + offset);
if (!page)
return VM_FAULT_SIGBUS;
get_page(page);
if (vma->vm_file)
page->mapping = vma->vm_file->f_mapping;
else
printk(KERN_ERR "no mapping available\n");
BUG_ON(!page->mapping);
page->index = vmf->pgoff;
vmf->page = page;
return 0;
}
int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
{
struct fb_info *info = file->private_data;
/* Kill off the delayed work */
cancel_rearming_delayed_work(&info->deferred_work);
/* Run it immediately */
return schedule_delayed_work(&info->deferred_work, 0);
}
EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
/* vm_ops->page_mkwrite handler */
static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
struct page *page)
{
struct fb_info *info = vma->vm_private_data;
struct fb_deferred_io *fbdefio = info->fbdefio;
/* this is a callback we get when userspace first tries to
write to the page. we schedule a workqueue. that workqueue
will eventually mkclean the touched pages and execute the
deferred framebuffer IO. then if userspace touches a page
again, we repeat the same scheme */
/* protect against the workqueue changing the page list */
mutex_lock(&fbdefio->lock);
list_add(&page->lru, &fbdefio->pagelist);
mutex_unlock(&fbdefio->lock);
/* come back after delay to process the deferred IO */
schedule_delayed_work(&info->deferred_work, fbdefio->delay);
return 0;
}
static struct vm_operations_struct fb_deferred_io_vm_ops = {
.fault = fb_deferred_io_fault,
.page_mkwrite = fb_deferred_io_mkwrite,
};
static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
vma->vm_ops = &fb_deferred_io_vm_ops;
vma->vm_flags |= ( VM_IO | VM_RESERVED | VM_DONTEXPAND );
vma->vm_private_data = info;
return 0;
}
/* workqueue callback */
static void fb_deferred_io_work(struct work_struct *work)
{
struct fb_info *info = container_of(work, struct fb_info,
deferred_work.work);
struct list_head *node, *next;
struct page *cur;
struct fb_deferred_io *fbdefio = info->fbdefio;
/* here we mkclean the pages, then do all deferred IO */
mutex_lock(&fbdefio->lock);
list_for_each_entry(cur, &fbdefio->pagelist, lru) {
lock_page(cur);
page_mkclean(cur);
unlock_page(cur);
}
/* driver's callback with pagelist */
fbdefio->deferred_io(info, &fbdefio->pagelist);
/* clear the list */
list_for_each_safe(node, next, &fbdefio->pagelist) {
list_del(node);
}
mutex_unlock(&fbdefio->lock);
}
void fb_deferred_io_init(struct fb_info *info)
{
struct fb_deferred_io *fbdefio = info->fbdefio;
BUG_ON(!fbdefio);
mutex_init(&fbdefio->lock);
info->fbops->fb_mmap = fb_deferred_io_mmap;
INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work);
INIT_LIST_HEAD(&fbdefio->pagelist);
if (fbdefio->delay == 0) /* set a default of 1 s */
fbdefio->delay = HZ;
}
EXPORT_SYMBOL_GPL(fb_deferred_io_init);
void fb_deferred_io_cleanup(struct fb_info *info)
{
void *screen_base = (void __force *) info->screen_base;
struct fb_deferred_io *fbdefio = info->fbdefio;
struct page *page;
int i;
BUG_ON(!fbdefio);
cancel_delayed_work(&info->deferred_work);
flush_scheduled_work();
/* clear out the mapping that we setup */
for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) {
page = vmalloc_to_page(screen_base + i);
page->mapping = NULL;
}
}
EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup);
MODULE_LICENSE("GPL");
|
/**********************************************************************
Audacity: A Digital Audio Editor
ExportMP3.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_EXPORTMP3__
#define __AUDACITY_EXPORTMP3__
/* --------------------------------------------------------------------------*/
#include "../MemoryX.h"
class ExportPlugin;
class wxString;
class wxWindow;
/** Factory method New_ExportMP3() which creates a NEW ExportMP3 object and
* returns a pointer to it. The rest of the class declaration is in ExportMP3.cpp
*/
movable_ptr<ExportPlugin> New_ExportMP3();
//----------------------------------------------------------------------------
// Get MP3 library versioqn
//----------------------------------------------------------------------------
wxString GetMP3Version(wxWindow *parent, bool prompt);
#endif
|
/* XenClient Xen Manager
Copyright (C) 2010 Citrix Systems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
#include <stdio.h>
#include <termios.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
int open_serial_raw(const char *dev)
{
struct termios options;
int fd, rv;
size_t written;
char buf[64];
fd = open(dev, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd < 0) {
char msg[256];
snprintf(msg, sizeof(msg), "open_serial_raw: Unable to open %s: ", dev);
perror(msg);
return fd;
}
tcgetattr(fd, &options);
cfmakeraw(&options);
options.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL | CRTSCTS);
options.c_cflag |= CLOCAL;
options.c_cflag |= CS8;
options.c_cflag |= CREAD;
options.c_iflag = IGNBRK | IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;
options.c_cc[VMIN] = 1;
options.c_cc[VTIME] = 0;
tcsetattr(fd, TCSAFLUSH, &options);
/* drain the thing */
if (fcntl(fd, F_SETFL, FNDELAY) < 0) {
perror("fcntl");
return -1;
}
for (;;) {
rv = read(fd, &buf, 1);
if (rv < 0 && errno != EAGAIN) {
perror("read");
return -1;
} else if (!rv || errno == EAGAIN) {
break;
}
}
/* set blocking behaviour */
if (fcntl(fd, F_SETFL, 0) < 0) {
perror("fcntl");
return -1;
}
return fd;
}
|
/******************************************************************************
* vga.c
*
* VGA support routines.
*/
#include <xen/config.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/mm.h>
#include <xen/vga.h>
#include <asm/io.h>
/* Filled in by arch boot code. */
struct xen_vga_console_info vga_console_info;
static int vgacon_keep;
static unsigned int xpos, ypos;
static unsigned char *video;
static void vga_text_puts(const char *s);
static void vga_noop_puts(const char *s) {}
void (*vga_puts)(const char *) = vga_noop_puts;
/*
* 'vga=<mode-specifier>[,keep]' where <mode-specifier> is one of:
*
* 'vga=ask':
* display a vga menu of available modes
*
* 'vga=current':
* use the current vga mode without modification
*
* 'vga=text-80x<rows>':
* text mode, where <rows> is one of {25,28,30,34,43,50,60}
*
* 'vga=gfx-<width>x<height>x<depth>':
* graphics mode, e.g., vga=gfx-1024x768x16
*
* 'vga=mode-<mode>:
* specifies a mode as specified in 'vga=ask' menu
* (NB. menu modes are displayed in hex, so mode numbers here must
* be prefixed with '0x' (e.g., 'vga=mode-0x0318'))
*
* The option 'keep' causes Xen to continue to print to the VGA console even
* after domain 0 starts to boot. The default behaviour is to relinquish
* control of the console to domain 0.
*/
static char __initdata opt_vga[30] = "";
string_param("vga", opt_vga);
/* VGA text-mode definitions. */
static unsigned int columns, lines;
#define ATTRIBUTE 7
#ifdef CONFIG_X86_64
void vesa_early_init(void);
void vesa_endboot(bool_t keep);
#else
#define vesa_early_init() ((void)0)
#define vesa_endboot(x) ((void)0)
#endif
void __init vga_init(void)
{
char *p;
/* Look for 'keep' in comma-separated options. */
for ( p = opt_vga; p != NULL; p = strchr(p, ',') )
{
if ( *p == ',' )
p++;
if ( strncmp(p, "keep", 4) == 0 )
vgacon_keep = 1;
}
switch ( vga_console_info.video_type )
{
case XEN_VGATYPE_TEXT_MODE_3:
if ( page_is_ram_type(paddr_to_pfn(0xB8000), RAM_TYPE_CONVENTIONAL) ||
((video = ioremap(0xB8000, 0x8000)) == NULL) )
return;
outw(0x200a, 0x3d4); /* disable cursor */
columns = vga_console_info.u.text_mode_3.columns;
lines = vga_console_info.u.text_mode_3.rows;
memset(video, 0, columns * lines * 2);
vga_puts = vga_text_puts;
break;
case XEN_VGATYPE_VESA_LFB:
case XEN_VGATYPE_EFI_LFB:
vesa_early_init();
break;
default:
memset(&vga_console_info, 0, sizeof(vga_console_info));
break;
}
}
void __init vga_endboot(void)
{
if ( vga_puts == vga_noop_puts )
return;
printk("Xen is %s VGA console.\n",
vgacon_keep ? "keeping" : "relinquishing");
if ( !vgacon_keep )
vga_puts = vga_noop_puts;
switch ( vga_console_info.video_type )
{
case XEN_VGATYPE_TEXT_MODE_3:
if ( !vgacon_keep )
memset(video, 0, columns * lines * 2);
break;
case XEN_VGATYPE_VESA_LFB:
case XEN_VGATYPE_EFI_LFB:
vesa_endboot(vgacon_keep);
break;
default:
BUG();
}
}
static void vga_text_puts(const char *s)
{
char c;
while ( (c = *s++) != '\0' )
{
if ( (c == '\n') || (xpos >= columns) )
{
if ( ++ypos >= lines )
{
ypos = lines - 1;
memmove(video, video + 2 * columns, ypos * 2 * columns);
memset(video + ypos * 2 * columns, 0, 2 * xpos);
}
xpos = 0;
}
if ( c != '\n' )
{
video[(xpos + ypos * columns) * 2] = c;
video[(xpos + ypos * columns) * 2 + 1] = ATTRIBUTE;
xpos++;
}
}
}
int __init fill_console_start_info(struct dom0_vga_console_info *ci)
{
memcpy(ci, &vga_console_info, sizeof(*ci));
return 1;
}
|
/* Configuration for GNU C-compiler for hosts running System V Release 3
Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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.
GNU CC 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 CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define USG
#ifndef SVR3
#define SVR3
#endif
|
#ifndef __GSCAM_GSCAM_H
#define __GSCAM_GSCAM_H
extern "C"{
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
}
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <camera_info_manager/camera_info_manager.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/CameraInfo.h>
#include <sensor_msgs/SetCameraInfo.h>
#include <stdexcept>
namespace gscam {
class GSCam {
public:
GSCam(ros::NodeHandle nh_camera, ros::NodeHandle nh_private);
~GSCam();
bool configure();
bool init_stream();
void publish_stream();
void cleanup_stream();
void run();
private:
// General gstreamer configuration
std::string gsconfig_;
// Gstreamer structures
GstElement *pipeline_;
GstElement *sink_;
// Appsink configuration
bool sync_sink_;
bool preroll_;
bool reopen_on_eof_;
bool use_gst_timestamps_;
// Camera publisher configuration
std::string frame_id_;
int width_, height_;
std::string image_encoding_;
std::string camera_name_;
std::string camera_info_url_;
// ROS Inteface
// Calibration between ros::Time and gst timestamps
double time_offset_;
ros::NodeHandle nh_, nh_private_;
image_transport::ImageTransport image_transport_;
camera_info_manager::CameraInfoManager camera_info_manager_;
image_transport::CameraPublisher camera_pub_;
// Case of a jpeg only publisher
ros::Publisher jpeg_pub_;
ros::Publisher cinfo_pub_;
};
}
#endif // ifndef __GSCAM_GSCAM_H
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007-2009 coresystems GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <types.h>
#include <string.h>
#include <cbmem.h>
#include <console/console.h>
#include <arch/acpi.h>
#include <arch/ioapic.h>
#include <arch/acpigen.h>
#include <arch/smp/mpspec.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <cpu/cpu.h>
#include <cpu/x86/msr.h>
#include <southbridge/intel/bd82x6x/pch.h>
#include <southbridge/intel/bd82x6x/nvs.h>
#include "thermal.h"
static void acpi_update_thermal_table(global_nvs_t *gnvs)
{
/* EC handles all thermal and fan control on Butterfly. */
gnvs->tcrt = CRITICAL_TEMPERATURE;
gnvs->tpsv = PASSIVE_TEMPERATURE;
}
void acpi_create_gnvs(global_nvs_t *gnvs)
{
/* Disable USB ports in S3 by default */
gnvs->s3u0 = 0;
gnvs->s3u1 = 0;
/* Disable USB ports in S5 by default */
gnvs->s5u0 = 0;
gnvs->s5u1 = 0;
acpi_update_thermal_table(gnvs);
}
|
#ifndef CONFIG_INTERFACE_H
#define CONFIG_INTERFACE_H
#include <linux/types.h>
#include <linux/fs.h>
/* optmize lcd self adapt function */
extern int lcd_detect_panel(const char *pstring);
extern bool audio_get_enhance_type(char* pstring, size_t count);
extern bool get_lightsensor_type(char *pstring, int count);
extern bool is_leds_ctl_pwm(void);
extern bool is_leds_ctl_tca6507(void);
extern bool is_leds_ctl_mpp(void);
int get_leds_max_brightness(void);
extern bool get_product_type(char *pname);
extern bool is_sdcard_in_voltage_high(void);
/*Add sensor self adapt*/
extern bool is_gsensor_layout_top(void);
extern bool is_gyro_sensor_layout_top(void);
extern bool is_compass_sensor_layout_top(void);
extern bool product_type(char *pname);
extern bool get_lcd_name(char *pstring);
extern bool get_sdcard_drive_current_val(char* item_name, unsigned int *sdcard_current);
/*Add TP self adapt*/
extern void get_tp_resolution(char *version, int count);
extern void get_touchkey_keyorder(char *version, int count);
#ifdef CONFIG_HUAWEI_GPIO_UNITE
extern struct gpio_config_type *get_gpio_config_table(void);
extern int get_gpio_num_by_name(char *name);
extern struct pm_gpio_cfg_t *get_pm_gpio_config_table(void);
extern int get_pm_gpio_num_by_name(char *name);
#endif
#ifdef CONFIG_BATTERY_BQ275x0
extern bool is_use_fuel_gauge(void);
#endif
extern bool is_usbswitch_exist(void);
extern bool is_mhl_exist(void);
extern bool is_hdmi_exist(void);
/*delete some unused lines*/
extern int camera_detect_power_seq(const char *pstring);
enum CAMERA_POWRER_SEQ_TYPE {
POWER_SEQ_DCM=1,
POWER_SEQ_SBM,
POWER_SEQ_U9202L,
POWER_SEQ_VRZ,
POWER_SEQ_C8869L,
POWER_SEQ_MAX,
};
#ifdef CONFIG_HW_POWER_TREE
extern struct hw_config_power_tree *get_power_config_table(void);
#endif
extern int acdb_type_read(struct file *filp,char __user *buffer,size_t count, loff_t *ppos);
extern int acdb_debugfs(void);
extern bool is_felica_exist(void);
extern bool get_pa_val_by_name(char *pstring);
extern bool is_use_wireless_charger(void);
extern bool get_hw_config(const char* key, char* pbuf, size_t count, unsigned int *ptype);
extern bool get_hw_config_int(const char* key, unsigned int* pbuf, unsigned int *ptype);
extern bool is_use_new_tz(void);//added for using new tz
extern bool is_use_cradle_adapt(void);//added for cradle charge
#endif
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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 CollectionMgr_h__
#define CollectionMgr_h__
#include "Define.h"
#include "DatabaseEnvFwd.h"
#include "EnumFlag.h"
#include "ObjectGuid.h"
#include <boost/dynamic_bitset_fwd.hpp>
#include <map>
#include <unordered_map>
#include <unordered_set>
class Item;
class WorldSession;
struct ItemModifiedAppearanceEntry;
enum HeirloomPlayerFlags
{
HEIRLOOM_FLAG_NONE = 0x00,
HEIRLOOM_FLAG_BONUS_LEVEL_90 = 0x01,
HEIRLOOM_FLAG_BONUS_LEVEL_100 = 0x02,
HEIRLOOM_FLAG_BONUS_LEVEL_110 = 0x04,
HEIRLOOM_FLAG_BONUS_LEVEL_120 = 0x08
};
enum HeirloomItemFlags
{
HEIRLOOM_ITEM_FLAG_NONE = 0x00,
HEIRLOOM_ITEM_FLAG_SHOW_ONLY_IF_KNOWN = 0x01,
HEIRLOOM_ITEM_FLAG_PVP = 0x02
};
struct HeirloomData
{
HeirloomData(uint32 _flags = 0, uint32 _bonusId = 0) : flags(_flags), bonusId(_bonusId) { }
uint32 flags;
uint32 bonusId;
};
enum class ToyFlags : uint32
{
None = 0,
Favorite = 0x01,
HasFanfare = 0x02
};
DEFINE_ENUM_FLAG(ToyFlags);
typedef std::map<uint32, EnumFlag<ToyFlags>> ToyBoxContainer;
typedef std::map<uint32, HeirloomData> HeirloomContainer;
enum MountStatusFlags : uint8
{
MOUNT_STATUS_NONE = 0x00,
MOUNT_NEEDS_FANFARE = 0x01,
MOUNT_IS_FAVORITE = 0x02
};
typedef std::map<uint32, MountStatusFlags> MountContainer;
typedef std::unordered_map<uint32, uint32> MountDefinitionMap;
class TC_GAME_API CollectionMgr
{
public:
explicit CollectionMgr(WorldSession* owner);
~CollectionMgr();
static void LoadMountDefinitions();
// Account-wide toys
void LoadToys();
void LoadAccountToys(PreparedQueryResult result);
void SaveAccountToys(LoginDatabaseTransaction& trans);
void ToySetFavorite(uint32 itemId, bool favorite);
void ToyClearFanfare(uint32 itemId);
bool AddToy(uint32 itemId, bool isFavourite, bool hasFanfare);
bool UpdateAccountToys(uint32 itemId, bool isFavourite, bool hasFanfare);
bool HasToy(uint32 itemId) const { return _toys.count(itemId) > 0; }
ToyBoxContainer const& GetAccountToys() const { return _toys; }
void OnItemAdded(Item* item);
// Account-wide heirlooms
void LoadHeirlooms();
void LoadAccountHeirlooms(PreparedQueryResult result);
void SaveAccountHeirlooms(LoginDatabaseTransaction& trans);
void AddHeirloom(uint32 itemId, uint32 flags);
void UpgradeHeirloom(uint32 itemId, int32 castItem);
void CheckHeirloomUpgrades(Item* item);
bool UpdateAccountHeirlooms(uint32 itemId, uint32 flags);
bool CanApplyHeirloomXpBonus(uint32 itemId, uint32 level);
uint32 GetHeirloomBonus(uint32 itemId) const;
HeirloomContainer const& GetAccountHeirlooms() const { return _heirlooms; }
// Account-wide mounts
void LoadMounts();
void LoadAccountMounts(PreparedQueryResult result);
void SaveAccountMounts(LoginDatabaseTransaction& trans);
bool AddMount(uint32 spellId, MountStatusFlags flags, bool factionMount = false, bool learned = false);
void MountSetFavorite(uint32 spellId, bool favorite);
void SendSingleMountUpdate(std::pair<uint32, MountStatusFlags> mount);
MountContainer const& GetAccountMounts() const { return _mounts; }
// Appearances
void LoadItemAppearances();
void LoadAccountItemAppearances(PreparedQueryResult knownAppearances, PreparedQueryResult favoriteAppearances);
void SaveAccountItemAppearances(LoginDatabaseTransaction& trans);
void AddItemAppearance(Item* item);
void AddItemAppearance(uint32 itemId, uint32 appearanceModId = 0);
void AddTransmogSet(uint32 transmogSetId);
bool IsSetCompleted(uint32 transmogSetId) const;
void RemoveTemporaryAppearance(Item* item);
// returns pair<hasAppearance, isTemporary>
std::pair<bool, bool> HasItemAppearance(uint32 itemModifiedAppearanceId) const;
std::unordered_set<ObjectGuid> GetItemsProvidingTemporaryAppearance(uint32 itemModifiedAppearanceId) const;
// returns ItemAppearance::ID, not ItemModifiedAppearance::ID
std::unordered_set<uint32> GetAppearanceIds() const;
enum class FavoriteAppearanceState
{
New,
Removed,
Unchanged
};
void SetAppearanceIsFavorite(uint32 itemModifiedAppearanceId, bool apply);
void SendFavoriteAppearances() const;
private:
bool CanAddAppearance(ItemModifiedAppearanceEntry const* itemModifiedAppearance) const;
void AddItemAppearance(ItemModifiedAppearanceEntry const* itemModifiedAppearance);
void AddTemporaryAppearance(ObjectGuid const& itemGuid, ItemModifiedAppearanceEntry const* itemModifiedAppearance);
WorldSession* _owner;
ToyBoxContainer _toys;
HeirloomContainer _heirlooms;
MountContainer _mounts;
std::unique_ptr<boost::dynamic_bitset<uint32>> _appearances;
std::unordered_map<uint32, std::unordered_set<ObjectGuid>> _temporaryAppearances;
std::unordered_map<uint32, FavoriteAppearanceState> _favoriteAppearances;
};
#endif // CollectionMgr_h__
|
/* FluidSynth - A Software Synthesizer
*
* Copyright (C) 2003 Peter Hanappe and others.
*
* 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 Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#include "fluid_rvoice_event.h"
#include "fluid_rvoice.h"
#include "fluid_rvoice_mixer.h"
#include "fluid_iir_filter.h"
#include "fluid_lfo.h"
#include "fluid_adsr_env.h"
static int fluid_rvoice_eventhandler_push_LOCAL(fluid_rvoice_eventhandler_t *handler, const fluid_rvoice_event_t *src_event);
static FLUID_INLINE void
fluid_rvoice_event_dispatch(fluid_rvoice_event_t *event)
{
event->method(event->object, event->param);
}
/**
* In order to be able to push more than one event atomically,
* use push for all events, then use flush to commit them to the
* queue. If threadsafe is false, all events are processed immediately. */
int
fluid_rvoice_eventhandler_push_int_real(fluid_rvoice_eventhandler_t *handler,
fluid_rvoice_function_t method, void *object, int intparam,
fluid_real_t realparam)
{
fluid_rvoice_event_t local_event;
local_event.method = method;
local_event.object = object;
local_event.param[0].i = intparam;
local_event.param[1].real = realparam;
return fluid_rvoice_eventhandler_push_LOCAL(handler, &local_event);
}
int
fluid_rvoice_eventhandler_push(fluid_rvoice_eventhandler_t *handler, fluid_rvoice_function_t method, void *object, fluid_rvoice_param_t param[MAX_EVENT_PARAMS])
{
fluid_rvoice_event_t local_event;
local_event.method = method;
local_event.object = object;
FLUID_MEMCPY(&local_event.param, param, sizeof(*param) * MAX_EVENT_PARAMS);
return fluid_rvoice_eventhandler_push_LOCAL(handler, &local_event);
}
int
fluid_rvoice_eventhandler_push_ptr(fluid_rvoice_eventhandler_t *handler,
fluid_rvoice_function_t method, void *object, void *ptr)
{
fluid_rvoice_event_t local_event;
local_event.method = method;
local_event.object = object;
local_event.param[0].ptr = ptr;
return fluid_rvoice_eventhandler_push_LOCAL(handler, &local_event);
}
static int fluid_rvoice_eventhandler_push_LOCAL(fluid_rvoice_eventhandler_t *handler, const fluid_rvoice_event_t *src_event)
{
fluid_rvoice_event_t *event;
int old_queue_stored = fluid_atomic_int_add(&handler->queue_stored, 1);
event = fluid_ringbuffer_get_inptr(handler->queue, old_queue_stored);
if(event == NULL)
{
fluid_atomic_int_add(&handler->queue_stored, -1);
FLUID_LOG(FLUID_WARN, "Ringbuffer full, try increasing polyphony!");
return FLUID_FAILED; // Buffer full...
}
FLUID_MEMCPY(event, src_event, sizeof(*event));
return FLUID_OK;
}
void
fluid_rvoice_eventhandler_finished_voice_callback(fluid_rvoice_eventhandler_t *eventhandler, fluid_rvoice_t *rvoice)
{
fluid_rvoice_t **vptr = fluid_ringbuffer_get_inptr(eventhandler->finished_voices, 0);
if(vptr == NULL)
{
return; // Buffer full
}
*vptr = rvoice;
fluid_ringbuffer_next_inptr(eventhandler->finished_voices, 1);
}
fluid_rvoice_eventhandler_t *
new_fluid_rvoice_eventhandler(int queuesize,
int finished_voices_size, int bufs, int fx_bufs, int fx_units, fluid_real_t sample_rate, int extra_threads, int prio)
{
fluid_rvoice_eventhandler_t *eventhandler = FLUID_NEW(fluid_rvoice_eventhandler_t);
if(eventhandler == NULL)
{
FLUID_LOG(FLUID_ERR, "Out of memory");
return NULL;
}
eventhandler->mixer = NULL;
eventhandler->queue = NULL;
eventhandler->finished_voices = NULL;
fluid_atomic_int_set(&eventhandler->queue_stored, 0);
eventhandler->finished_voices = new_fluid_ringbuffer(finished_voices_size,
sizeof(fluid_rvoice_t *));
if(eventhandler->finished_voices == NULL)
{
goto error_recovery;
}
eventhandler->queue = new_fluid_ringbuffer(queuesize, sizeof(fluid_rvoice_event_t));
if(eventhandler->queue == NULL)
{
goto error_recovery;
}
eventhandler->mixer = new_fluid_rvoice_mixer(bufs, fx_bufs, fx_units, sample_rate, eventhandler, extra_threads, prio);
if(eventhandler->mixer == NULL)
{
goto error_recovery;
}
return eventhandler;
error_recovery:
delete_fluid_rvoice_eventhandler(eventhandler);
return NULL;
}
int
fluid_rvoice_eventhandler_dispatch_count(fluid_rvoice_eventhandler_t *handler)
{
return fluid_ringbuffer_get_count(handler->queue);
}
/**
* Call fluid_rvoice_event_dispatch for all events in queue
* @return number of events dispatched
*/
int
fluid_rvoice_eventhandler_dispatch_all(fluid_rvoice_eventhandler_t *handler)
{
fluid_rvoice_event_t *event;
int result = 0;
while(NULL != (event = fluid_ringbuffer_get_outptr(handler->queue)))
{
fluid_rvoice_event_dispatch(event);
result++;
fluid_ringbuffer_next_outptr(handler->queue);
}
return result;
}
void
delete_fluid_rvoice_eventhandler(fluid_rvoice_eventhandler_t *handler)
{
fluid_return_if_fail(handler != NULL);
delete_fluid_rvoice_mixer(handler->mixer);
delete_fluid_ringbuffer(handler->queue);
delete_fluid_ringbuffer(handler->finished_voices);
FLUID_FREE(handler);
}
|
/********************************************************************
*
* Unless otherwise specified, Copyright (C) 2004-2005 Barco Control Rooms
*
* $Source: /home/cvs/s3c-u-boot-1.1.6/board/barco/speed.h,v $
* $Revision: 1.1.1.1 $
* $Author: scsuh $
* $Date: 2006/12/06 00:22:11 $
*
* Last ChangeLog Entry
* $Log: speed.h,v $
* Revision 1.1.1.1 2006/12/06 00:22:11 scsuh
* new start of u-boot 1.1.6
*
* Revision 1.2 2005/02/21 12:48:58 mleeman
* update of copyright years (feedback wd)
*
* Revision 1.1 2005/02/14 09:23:46 mleeman
* - moved 'barcohydra' directory to a more generic barco; since we will be
* supporting and adding multiple boards
*
* Revision 1.2 2005/02/09 12:56:23 mleeman
* add generic header to track changes in sources
*
*
*******************************************************************/
/*
* (C) Copyright 2000
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
/*-----------------------------------------------------------------------
* Timer value for timer 2, ICLK = 10
*
* SPEED_FCOUNT2 = GCLK / (16 * (TIMER_TMR_PS + 1))
* SPEED_TMR3_PS = (GCLK / (16 * SPEED_FCOUNT3)) - 1
*
* SPEED_FCOUNT2 timer 2 counting frequency
* GCLK CPU clock
* SPEED_TMR2_PS prescaler
*/
#define SPEED_TMR2_PS (250 - 1) /* divide by 250 */
/*-----------------------------------------------------------------------
* Timer value for PIT
*
* PIT_TIME = SPEED_PITC / PITRTCLK
* PITRTCLK = 8192
*/
#define SPEED_PITC (82 << 16) /* start counting from 82 */
/*
* The new value for PTA is calculated from
*
* PTA = (gclk * Trefresh) / (2 ^ (2 * DFBRG) * PTP * NCS)
*
* gclk CPU clock (not bus clock !)
* Trefresh Refresh cycle * 4 (four word bursts used)
* DFBRG For normal mode (no clock reduction) always 0
* PTP Prescaler (already adjusted for no. of banks and 4K / 8K refresh)
* NCS Number of SDRAM banks (chip selects) on this UPM.
*/
|
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>
#include <linux/crypto.h>
#include <linux/gracl.h>
#if !defined(CONFIG_CRYPTO) || defined(CONFIG_CRYPTO_MODULE) || !defined(CONFIG_CRYPTO_SHA256) || defined(CONFIG_CRYPTO_SHA256_MODULE)
#error "crypto and sha256 must be built into the kernel"
#endif
int
chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum)
{
char *p;
struct crypto_hash *tfm;
struct hash_desc desc;
struct scatterlist sg;
unsigned char temp_sum[GR_SHA_LEN];
volatile int retval = 0;
volatile int dummy = 0;
unsigned int i;
sg_init_table(&sg, 1);
tfm = crypto_alloc_hash("sha256", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(tfm)) {
/* should never happen, since sha256 should be built in */
return 1;
}
desc.tfm = tfm;
desc.flags = 0;
crypto_hash_init(&desc);
p = salt;
sg_set_buf(&sg, p, GR_SALT_LEN);
crypto_hash_update(&desc, &sg, sg.length);
p = entry->pw;
sg_set_buf(&sg, p, strlen(p));
crypto_hash_update(&desc, &sg, sg.length);
crypto_hash_final(&desc, temp_sum);
memset(entry->pw, 0, GR_PW_LEN);
for (i = 0; i < GR_SHA_LEN; i++)
if (sum[i] != temp_sum[i])
retval = 1;
else
dummy = 1; // waste a cycle
crypto_free_hash(tfm);
return retval;
}
|
/*****************************************************************************
** $Source: /cygdrive/d/Private/_SVNROOT/bluemsx/blueMSX/Src/Input/Sg1000JoystickDevice.h,v $
**
** $Revision: 1.3 $
**
** $Date: 2008-03-30 18:38:40 $
**
** More info: http://www.bluemsx.com
**
** Copyright (C) 2003-2006 Daniel Vik
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
******************************************************************************
*/
#ifndef SG1000_JOYSTICK_DEVICE_H
#define SG1000_JOYSTICK_DEVICE_H
#include "MsxTypes.h"
// Base class for SG-1000 Joystick devices.
typedef struct {
UInt8 (*read)(void*);
void (*write)(void*, UInt8);
void (*destroy)(void*);
void (*reset)(void*);
void (*saveState)(void*);
void (*loadState)(void*);
} Sg1000JoystickDevice;
#endif
|
#ifndef MUPDF_PDF_CMAP_H
#define MUPDF_PDF_CMAP_H
/*
* CMap
*/
typedef struct pdf_cmap_s pdf_cmap;
typedef struct pdf_range_s pdf_range;
typedef struct pdf_xrange_s pdf_xrange;
typedef struct pdf_mrange_s pdf_mrange;
#define PDF_MRANGE_CAP 8
struct pdf_range_s
{
unsigned short low, high, out;
};
struct pdf_xrange_s
{
unsigned int low, high, out;
};
struct pdf_mrange_s
{
unsigned int low, len, out[PDF_MRANGE_CAP];
};
struct pdf_cmap_s
{
fz_storable storable;
char cmap_name[32];
char usecmap_name[32];
pdf_cmap *usecmap;
int wmode;
int codespace_len;
struct
{
int n;
unsigned int low;
unsigned int high;
} codespace[40];
int rlen, rcap;
pdf_range *ranges;
int xlen, xcap;
pdf_xrange *xranges;
int mlen, mcap;
pdf_mrange *mranges;
};
pdf_cmap *pdf_new_cmap(fz_context *ctx);
pdf_cmap *pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap);
void pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap);
void pdf_drop_cmap_imp(fz_context *ctx, fz_storable *cmap);
unsigned int pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap);
int pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap);
void pdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode);
void pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap);
void pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int n);
void pdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *map, int len);
void pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int srclo, unsigned int srchi, int dstlo);
void pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int one, int *many, int len);
void pdf_sort_cmap(fz_context *ctx, pdf_cmap *cmap);
int pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt);
int pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out);
int pdf_decode_cmap(pdf_cmap *cmap, unsigned char *s, unsigned char *e, unsigned int *cpt);
pdf_cmap *pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes);
pdf_cmap *pdf_load_cmap(fz_context *ctx, fz_stream *file);
pdf_cmap *pdf_load_system_cmap(fz_context *ctx, char *name);
pdf_cmap *pdf_load_builtin_cmap(fz_context *ctx, char *name);
pdf_cmap *pdf_load_embedded_cmap(fz_context *ctx, pdf_document *doc, pdf_obj *ref);
void pdf_print_cmap(fz_context *ctx, fz_output *out, pdf_cmap *cmap);
#endif
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/s3/model/Tag.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{
/**
* <p>A container for specifying S3 Intelligent-Tiering filters. The filters
* determine the subset of objects to which the rule applies.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/IntelligentTieringAndOperator">AWS
* API Reference</a></p>
*/
class AWS_S3_API IntelligentTieringAndOperator
{
public:
IntelligentTieringAndOperator();
IntelligentTieringAndOperator(const Aws::Utils::Xml::XmlNode& xmlNode);
IntelligentTieringAndOperator& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline const Aws::String& GetPrefix() const{ return m_prefix; }
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; }
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline void SetPrefix(const Aws::String& value) { m_prefixHasBeenSet = true; m_prefix = value; }
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline void SetPrefix(Aws::String&& value) { m_prefixHasBeenSet = true; m_prefix = std::move(value); }
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline void SetPrefix(const char* value) { m_prefixHasBeenSet = true; m_prefix.assign(value); }
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline IntelligentTieringAndOperator& WithPrefix(const Aws::String& value) { SetPrefix(value); return *this;}
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline IntelligentTieringAndOperator& WithPrefix(Aws::String&& value) { SetPrefix(std::move(value)); return *this;}
/**
* <p>An object key name prefix that identifies the subset of objects to which the
* configuration applies.</p>
*/
inline IntelligentTieringAndOperator& WithPrefix(const char* value) { SetPrefix(value); return *this;}
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline IntelligentTieringAndOperator& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline IntelligentTieringAndOperator& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline IntelligentTieringAndOperator& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
/**
* <p>All of these tags must exist in the object's tag set in order for the
* configuration to apply.</p>
*/
inline IntelligentTieringAndOperator& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }
private:
Aws::String m_prefix;
bool m_prefixHasBeenSet;
Aws::Vector<Tag> m_tags;
bool m_tagsHasBeenSet;
};
} // namespace Model
} // namespace S3
} // namespace Aws
|
/****************************************************************/
/* 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 MOOSEOBJECT_H
#define MOOSEOBJECT_H
// MOOSE includes
#include "InputParameters.h"
#include "ConsoleStreamInterface.h"
// libMesh includes
#include "libmesh/parallel_object.h"
class MooseApp;
class MooseObject;
template<>
InputParameters validParams<MooseObject>();
/**
* Every object that can be built by the factory should be derived from this class.
*/
class MooseObject :
public ConsoleStreamInterface,
public libMesh::ParallelObject
{
public:
MooseObject(const InputParameters & parameters);
virtual ~MooseObject() = default;
/**
* Get the name of the object
* @return The name of the object
*/
const std::string & name() const { return _name; }
/**
* Get the parameters of the object
* @return The parameters of the object
*/
const InputParameters & parameters() const { return _pars; }
/**
* Retrieve a parameter for the object
* @param name The name of the parameter
* @return The value of the parameter
*/
template <typename T>
const T & getParam(const std::string & name) const;
/**
* Test if the supplied parameter is valid
* @param name The name of the parameter to test
*/
inline bool isParamValid(const std::string &name) const { return _pars.isParamValid(name); }
/**
* Get the MooseApp this object is associated with.
*/
MooseApp & getMooseApp() { return _app; }
/**
* Return the enabled status of the object.
*/
virtual bool enabled() { return _enabled; }
protected:
/// The MooseApp this object is associated with
MooseApp & _app;
/// Parameters of this object, references the InputParameters stored in the InputParametersWarehouse
const InputParameters & _pars;
/// The name of this object, reference to value stored in InputParameters
const std::string & _name;
/// Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects
const bool & _enabled;
};
template <typename T>
const T &
MooseObject::getParam(const std::string & name) const
{
return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
}
#endif /* MOOSEOBJECT_H*/
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "VectorKernel.h"
class CoupledVectorDiffusion : public VectorKernel
{
public:
static InputParameters validParams();
CoupledVectorDiffusion(const InputParameters & parameters);
protected:
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
virtual Real computeQpOffDiagJacobian(unsigned jvar) override;
MooseEnum _state;
const VectorVariableGradient & _grad_v;
unsigned _v_id;
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.