answer
stringlengths 15
1.25M
|
|---|
using UnityEngine;
using System.Collections;
public class Metrics : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
|
<?php
declare(strict_types=1);
namespace PoPCMSSchema\QueriedObject\TypeResolvers\InterfaceType;
use PoP\ComponentModel\TypeResolvers\InterfaceType\<API key>;
class <API key> extends <API key>
{
public function getTypeName(): string
{
return 'Queryable';
}
public function getTypeDescription(): ?string
{
return $this->__('Entities that can be queried through an URL', 'queriedobject');
}
}
|
#ifndef TRINITYCORE_TOTEM_H
#define TRINITYCORE_TOTEM_H
#include "TemporarySummon.h"
enum TotemType
{
TOTEM_PASSIVE = 0,
TOTEM_ACTIVE = 1,
TOTEM_STATUE = 2 // copied straight from MaNGOS, may need more implementation to work
};
class TC_GAME_API Totem : public Minion
{
public:
Totem(<API key> const* properties, Unit* owner);
virtual ~Totem() { }
void Update(uint32 time) override;
void InitStats(uint32 duration) override;
void InitSummon() override;
void UnSummon(uint32 msTime = 0) override;
uint32 GetSpell(uint8 slot = 0) const { return m_spells[slot]; }
uint32 GetTotemDuration() const { return m_duration; }
void SetTotemDuration(uint32 duration) { m_duration = duration; }
TotemType GetTotemType() const { return m_type; }
bool UpdateStats(Stats /*stat*/) override { return true; }
bool UpdateAllStats() override { return true; }
void UpdateResistances(uint32 /*school*/) override { }
void UpdateArmor() override { }
void UpdateMaxHealth() override { }
void UpdateMaxPower(Powers /*power*/) override { }
void <API key>(bool /*ranged*/) override { }
void <API key>(WeaponAttackType /*attType*/) override { }
bool <API key>(SpellInfo const* spellInfo, uint32 index) const override;
protected:
TotemType m_type;
uint32 m_duration;
};
#endif
|
#!/usr/bin/perl -w
# This script generates a C header file that maps the target device (as
# indicated via the sdcc generated -Dpic18fxxx macro) to its device
# family and the device families to their respective style of ADC and
# USART programming for use in the SDCC PIC16 I/O library.
# This file is part of SDCC.
# SDCC is free software: you can redistribute it and/or modify it under
# option) any later version.
# SDCC is distributed in the hope that it will be useful, but WITHOUT
# for more details.
# Usage: perl pic18fam-h-gen.pl
# This will create pic18fam.h.gen in your current directory.
# Check sanity of the file and move it to .../include/pic16/pic18fam.h.
# If you assigned new I/O styles, implement them in
# .../include/pic16/{adc,i2c,usart}.h and
# .../lib/pic16/libio/*/*.c
use strict;
my $head = '__SDCC_PIC';
my %families = ();
my %adc = ();
my %usart = ();
my $update = "Please update your pic16/pic18fam.h manually and/or inform the maintainer.";
while (<DATA>) {
chomp;
s/\s*#.*$//; # remove comments
s/\s*//g; # strip whitespace
next if (/^\s*$/); # ignore empty lines
my $line = $_;
my @fields = split(/:/, $line);
die "Invalid record >$line<" if (4 != scalar @fields);
my ($id, $memberlist, $adcstyle, $usartstyle) = @fields;
# extract numeric family id
$id = 0+$id;
# extract family members
my @arr = split(/,/, $memberlist);
@arr = sort(map { uc($_); } @arr);
$families{$id} = \@arr;
# ADC style per device family
$adcstyle = 0+$adcstyle;
if (not defined $adc{$adcstyle}) {
$adc{$adcstyle} = [];
}
push @{$adc{$adcstyle}}, $id;
# (E)USART style per device family
$usartstyle = 0+$usartstyle;
if (not defined $usart{$usartstyle}) {
$usart{$usartstyle} = [];
}
push @{$usart{$usartstyle}}, $id;
}
my $fname = "pic18fam.h.gen";
open(FH, ">", "$fname") or die "Could not open >$fname<";
print FH <<EOT
/*
* pic18fam.h - PIC16 families
*
* This file is has been generated using $0 .
*/
#ifndef __SDCC_PIC18FAM_H__
#define __SDCC_PIC18FAM_H__ 1
/*
* Define device families.
*/
#undef __SDCC_PIC16_FAMILY
EOT
;
my $pp = "#if ";
for my $id (sort keys %families) {
my $list = $families{$id};
my $memb = "defined($head" . join(") \\\n || defined($head", @$list) . ")";
print FH <<EOT
${pp} ${memb}
#define __SDCC_PIC16_FAMILY ${id}
EOT
;
$pp = "#elif ";
} # for
print FH <<EOT
#else
#warning No family associated with the target device. ${update}
#endif
/*
* Define ADC style per device family.
*/
#undef __SDCC_ADC_STYLE
EOT
;
$pp = "#if ";
for my $s (sort keys %adc) {
my $fams = join (" \\\n || ", map { "(__SDCC_PIC16_FAMILY == $_)" } sort @{$adc{$s}});
print FH <<EOT
${pp} ${fams}
#define __SDCC_ADC_STYLE ${s}
EOT
;
$pp = "#elif ";
} # for
print FH <<EOT
#else
#warning No ADC style associated with the target device. ${update}
#endif
/*
* Define (E)USART style per device family.
*/
#undef __SDCC_USART_STYLE
EOT
;
$pp = "#if ";
for my $s (sort keys %usart) {
my $fams = join (" \\\n || ", map { "(__SDCC_PIC16_FAMILY == $_)" } sort @{$usart{$s}});
print FH <<EOT
${pp} ${fams}
#define __SDCC_USART_STYLE ${s}
EOT
;
$pp = "#elif ";
} # for
print FH <<EOT
#else
#warning No (E)USART style associated with the target device. ${update}
#endif
EOT
;
print FH <<EOT
#endif /* !__SDCC_PIC18FAM_H__ */
EOT
;
__END__
# <id>:<head>{,<member>}:<adc>:<usart>
# Each line provides a colon separated list of
# * a numeric family name, derived from the first family member as follows:
# - 18F<num> -> printf("18%04d0", <num>)
# - 18F<num1>J<num2> -> printf("18%02d%02d1", <num1>, <num2>)
# - 18F<num1>K<num2> -> printf("18%02d%02d2", <num1>, <num2>)
# * a comma-separated list of members of a device family,
# where a family comprises all devices that share a single data sheet,
# * the ADC style (numeric family name or 0, if not applicable)
# * the USART style (numeric family name or 0, if not applicable)
# This data has been gathered manually from data sheets published by
# Microchip Technology Inc.
1812200:18f1220,18f1320:1812200:1812200
1812300:18f1230,18f1330:1812300:1812300
1813502:18f13k50,18f14k50:1813502:1813502
1822200:18f2220,18f2320,18f4220,18f4320:1822200:1822200
1822210:18f2221,18f2321,18f4221,18f4321:1822200:1822210
1823310:18f2331,18f2431,18f4331,18f4431:0:1822210
1823202:18f23k20,18f24k20,18f25k20,18f26k20,18f43k20,18f44k20,18f45k20,18f46k20:1822200:1822210
1823222:18f23k22,18f24k22,18f25k22,18f26k22,18f43k22,18f44k22,18f45k22,18f46k22:1823222:1822210
1824100:18f2410,18f2510,18f2515,18f2610,18f4410,18f4510,18f4515,18f4610:1822200:1822210
1802420:18f242,18f252,18f442,18f452:1802420:1822200 # TODO: verify family members and USART
1824200:18f2420,18f2520,18f4420,18f4520:1822200:1822210
1824230:18f2423,18f2523,18f4423,18f4523:1822200:1822210
1824500:18f2450,18f4450:1822200:1824500
1824550:18f2455,18f2550,18f4455,18f4550:1822200:1822210
1802480:18f248,18f258,18f448,18f458:1802420:1822200 # TODO: verify family members and USART
1824800:18f2480,18f2580,18f4480,18f4580:1822200:1824500
1824101:18f24j10,18f25j10,18f44j10,18f45j10:1822200:1822210
1824501:18f24j50,18f25j50,18f26j50,18f44j50,18f45j50,18f46j50:1824501:1824501
1825250:18f2525,18f2620,18f4525,18f4620:1822200:1822210
1825850:18f2585,18f2680,18f4585,18f4680:1822200:1824500
1826820:18f2682,18f2685,18f4682,18f4685:1822200:1824500
1865200:18f6520,18f6620,18f6720,18f8520,18f8620,18f8720:1822200:1865200
1865270:18f6527,18f6622,18f6627,18f6722,18f8527,18f8622,18f8627,18f8722:1822200:1824501
1865850:18f6585,18f6680,18f8585,18f8680:1822200:1822200 # TODO: verify family members and USART
1865501:18f65j50,18f66j50,18f66j55,18f67j50,18f85j50,18f86j50,18f86j55,18f87j50:1865501:1824501
1866601:18f66j60,18f66j65,18f67j60,18f86j60,18f86j65,18f87j60,18f96j60,18f96j65,18f97j60:1822200:1824501
|
<?php
require_once dirname(__FILE__) . '/Interface.php';
class <API key> implements <API key>
{
/**
* @var <API key>
*/
protected $_pm;
/**
* @var <API key>
*/
protected $_application;
/**
* @var string
*/
protected $_output;
/**
* The default error reporting level
* @var int
*/
protected $_errorReporting;
/**
* @param <API key> $pm
*/
public function __construct (<API key> $pm)
{
$this->_pm = $pm;
}
/**
* Loads the admin application
*/
public function load()
{
$this->_registerAutostart();
require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Zend/Application.php';
$this->_application = new <API key>($this->_pm->getEnv()->getEnvironmet());
// set the dynamic options from php config file
$this->_application->setOptions($this-><API key>());
// run the application bootstrap
$this->_pm->getLogger()->logPrefixed('Bootstrapping application...');
$this->_application->bootstrap();
}
protected function _registerAutostart()
{
require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Application/Adapter/ZendFw/Autostart/EnqueueScripts.php';
require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Application/Adapter/ZendFw/Autostart/StripSlashes.php';
require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Application/Adapter/ZendFw/Autostart/ZendFormTranslation.php';
$result = array(
new <API key>($this),
new <API key>($this),
new <API key>($this),
);
foreach($result as $autostart) {
$autostart->execute();
}
}
/**
* Retrieves the application options
* @return array
*/
protected function <API key>()
{
$options = include $this->_pm->getPathinfo()->getRootAdminMenu() . 'configs/application.php';
if ($this->_pm->getEnv()->getEnvironmet() == 'development') {
$options['resources']['FrontController']['params']['displayExceptions'] = 1;
$options['phpSettings']['error_reporting'] = 6143; // E_ALL & ~E_STRICT
$options['phpSettings']['display_errors'] = 1;
$options['phpSettings']['<API key>'] = 1;
}
return $options;
}
/**
* @param $controllerName
* @param string $module
*/
public function overwriteController($controllerName, $module = 'default')
{
$front = <API key>::getInstance();
$request = new <API key>();
$request->setParam('controller', $controllerName);
$request->setParam('mod', $module);
$front->setRequest($request);
}
/**
* Inits the controller
*/
public function init()
{
$this-><API key>();
try {
// init the controller object to add actions before load-{page-id} action
$this->_application->initController();
} catch (Exception $e) {
$this->_handleException($e);
}
$this-><API key>();
}
/**
* @return mixed|void
*/
public function render()
{
$this-><API key>();
try {
$this->_output = $this->_application->run();
} catch (Exception $e) {
$this->_handleException($e);
}
$this-><API key>();
}
/**
* @return mixed|void
*/
public function display()
{
$this-><API key>();
try {
echo $this->_output;
} catch (Exception $e) {
$this->_handleException($e);
}
$this-><API key>();
}
/**
* Activates the error reporting in dev mode
*/
protected function <API key>()
{
// store the default error level
$this->_errorReporting = error_reporting();
if ($this->_pm->getEnv()->getEnvironmet() == 'development' || $this->_pm->getConfig()->debug->show_errors == '1') {
// E_ALL & ~E_STRICT
error_reporting(6143);
}
}
/**
* Resets the error reporting to default in dev mode
*/
protected function <API key>()
{
if ($this->_pm->getEnv()->getEnvironmet() == 'development' || $this->_pm->getConfig()->debug->show_errors == '1') {
error_reporting($this->_errorReporting);
}
}
/**
* @param Exception $e
*/
protected function _handleException(Exception $e)
{
$this->_pm->getLogger()->error($e->getMessage());
$request = <API key>::getInstance()->getRequest();
// Repoint the request to the default error handler
// $request->setModuleName('default');
// $request->setControllerName('Psn-ewrror');
// $request->setActionName('error');
// Set up the error handler
$error = new <API key>(array(
'controller' => $this->_pm->getAbbrLower() . '-error'
));
$error->type = <API key>::<API key>;
$error->request = clone($request);
$error->exception = $e;
$request->setParam('error_handler', $error);
}
/**
* @return <API key>
*/
public function getPluginManager()
{
return $this->_pm;
}
}
|
#ifndef _FFNet_Pattern_h_
#define _FFNet_Pattern_h_
/*
djmw 19950113
djmw 20020712 GPL header
djmw 20110307 Latest modification
*/
#include "Pattern.h"
#include "FFNet.h"
void <API key>( FFNet me, Pattern pattern, Graphics g, long ipattern );
#endif /* _FFNet_Pattern_h_ */
|
#ifndef TUPSOUNDPLAYER_H
#define TUPSOUNDPLAYER_H
#include "tglobal.h"
#include "timagebutton.h"
#include "<API key>.h"
#include "tuplibraryobject.h"
#include <QFrame>
#include <QBoxLayout>
#include <QSlider>
#include <QLabel>
#include <QSpinBox>
#include <QMediaPlayer>
#include <QUrl>
#include <QTime>
#include <QCheckBox>
/**
* @author Gustav Gonzalez
**/
class TUPITUBE_EXPORT TupSoundPlayer : public QFrame
{
Q_OBJECT
public:
TupSoundPlayer(QWidget *parent = nullptr);
~TupSoundPlayer();
QSize sizeHint() const;
void setSoundParams(TupLibraryObject *sound);
void stopFile();
bool isPlaying();
void reset();
QString getSoundID() const;
void updateInitFrame(int frame);
void <API key>(bool enabled, int frame);
signals:
void frameUpdated(int frame);
void muteEnabled(bool mute);
private slots:
void playFile();
void startPlayer();
void positionChanged(qint64 value);
void durationChanged(qint64 value);
void stateChanged(QMediaPlayer::State state);
void updateSoundPos(int pos);
void updateLoopState();
void muteAction();
private:
QLabel *frameLabel;
QMediaPlayer *player;
QSlider *slider;
QLabel *timer;
TImageButton *playButton;
TImageButton *muteButton;
bool playing;
qint64 duration;
QTime soundTotalTime;
QString totalTime;
QCheckBox *loopBox;
bool loop;
bool mute;
QSpinBox *frameBox;
QWidget *frameWidget;
QString soundID;
};
#endif
|
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/wakelock.h>
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
#include <mach/usb_phy.h>
#include "board.h"
#include "devices.h"
#include <mach/board_htc.h>
#include <linux/pm_qos_params.h>
#include <asm/mach-types.h>
#include "gpio-names.h"
#include "baseband-xmm-power.h"
MODULE_LICENSE("GPL");
unsigned long modem_ver = XMM_MODEM_VER_1130;
/*
* HTC: version history
*
* v04 - bert_lin - 20111025
* 1. remove completion & wait for probe race, use nv solution instead
* 2. add a attribute for host usb debugging
* v05 - bert_lin - 20111026
* 1. sync patch from nv michael. re-arrange the first_time var
* after flight off, device cant goes to L2 suspend
* 2. modify the files to meet the coding style
* v06 - bert_lin - 20111026
* 1. item 12: L0 -> flight -> suspend fail because of wakelock holding
* check wakelock in L3 and release it if neccessary
* v07 - bert_lin - 20111104
* workaround for item 18, AP L2->L0 fail! submit urb return -113
* add more logs on usb_chr for modem download issue
* v08 - bert_lin - 20111125
* workaround, origin l3 -> host_wake -> deepsleep
* after: L3 -> host_wakeup -> noirq suspend fail -> resume
* v09 - bert_lin - 20111214
* autopm
* v10 - bert_lin - 20111226
* log reduce
*/
/* HTC: macro, variables */
#include <mach/htc_hostdbg.h>
#define MODULE_NAME "[XMM_v15]"
unsigned int host_dbg_flag = 0;
EXPORT_SYMBOL(host_dbg_flag);
/* HTC: provide interface for user space to enable usb host debugging */
static ssize_t host_dbg_show(struct device *dev,
struct device_attribute *attr, char *buf);
static ssize_t host_dbg_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size);
static DEVICE_ATTR(host_dbg, 0664, host_dbg_show, host_dbg_store);
/* HTC: Create attribute for host debug purpose */
static ssize_t host_dbg_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
int ret = -EINVAL;
ret = sprintf(buf, "%x\n", host_dbg_flag);
return ret;
}
/**
* HTC: get the runtime debug flags from user.
*
* @buf: user strings
* @size: user strings plus one 0x0a char
*/
static ssize_t host_dbg_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
const int hedge = 2 + 8 + 1;
/* hedge: "0x" 2 chars, max: 8 chars, plus one 0x0a char */
pr_info(MODULE_NAME "%s size = %d\n", __func__, size);
if (size > hedge) {
pr_info(MODULE_NAME "%s size > hedge:%d, return\n",
__func__, hedge);
return size;
}
host_dbg_flag = simple_strtoul(buf, NULL, 16);
pr_info(MODULE_NAME "%s set host_dbg_flag as 0x%08x\n",
__func__, host_dbg_flag);
return size;
}
struct pm_qos_request_list <API key>;
EXPORT_SYMBOL_GPL(<API key>);
#define BOOST_CPU_FREQ_MIN 1500000
EXPORT_SYMBOL(modem_ver);
unsigned long modem_flash;
EXPORT_SYMBOL(modem_flash);
unsigned long modem_pm = 1;
EXPORT_SYMBOL(modem_pm);
unsigned long autosuspend_delay = 3000; /* 5000 msec */
EXPORT_SYMBOL(autosuspend_delay);
unsigned long enum_delay_ms = 1000; /* ignored if !modem_flash */
module_param(modem_ver, ulong, 0644);
MODULE_PARM_DESC(modem_ver,
"baseband xmm power - modem software version");
module_param(modem_flash, ulong, 0644);
MODULE_PARM_DESC(modem_flash,
"baseband xmm power - modem flash (1 = flash, 0 = flashless)");
module_param(modem_pm, ulong, 0644);
MODULE_PARM_DESC(modem_pm,
"baseband xmm power - modem power management (1 = pm, 0 = no pm)");
module_param(enum_delay_ms, ulong, 0644);
MODULE_PARM_DESC(enum_delay_ms,
"baseband xmm power - delay in ms between modem on and enumeration");
module_param(autosuspend_delay, ulong, 0644);
MODULE_PARM_DESC(autosuspend_delay, "baseband xmm power - autosuspend delay for autopm");
#define auto_sleep(x) \
if (in_interrupt() || in_atomic())\
mdelay(x);\
else\
msleep(x);
static bool short_autosuspend;
static int <API key> = 100;
static struct usb_device_id xmm_pm_ids[] = {
{ USB_DEVICE(VENDOR_ID, PRODUCT_ID),
.driver_info = 0 },
{}
};
//for power on modem
static struct gpio <API key>[] = {
{ -1, GPIOF_OUT_INIT_LOW, "BB_RSTn" },
{ -1, GPIOF_OUT_INIT_LOW, "BB_ON" },
{ -1, GPIOF_OUT_INIT_LOW, "IPC_BB_WAKE" },
{ -1, GPIOF_IN, "IPC_AP_WAKE" },
{ -1, GPIOF_OUT_INIT_HIGH, "IPC_HSIC_ACTIVE" },
{ -1, GPIOF_OUT_INIT_LOW, "IPC_HSIC_SUS_REQ" },
{ -1, GPIOF_OUT_INIT_LOW, "BB_VDD_EN" },
{ -1, GPIOF_OUT_INIT_LOW, "AP2BB_RST_PWRDWNn" },
{ -1, GPIOF_IN, "BB2AP_RST2" },
};
/*HTC*/
//for power consumation , power off modem
static struct gpio <API key>[] = {
{ -1, GPIOF_OUT_INIT_LOW, "BB_RSTn" },
{ -1, GPIOF_OUT_INIT_LOW, "BB_ON" },
{ -1, GPIOF_OUT_INIT_LOW, "IPC_BB_WAKE" },
{ -1, GPIOF_OUT_INIT_LOW, "IPC_AP_WAKE" },
{ -1, GPIOF_OUT_INIT_LOW, "IPC_HSIC_ACTIVE" },
{ -1, GPIOF_OUT_INIT_LOW, "IPC_HSIC_SUS_REQ" },
{ -1, GPIOF_OUT_INIT_LOW, "BB_VDD_EN" },
{ -1, GPIOF_OUT_INIT_LOW, "AP2BB_RST_PWRDWNn" },
{ -1, GPIOF_OUT_INIT_LOW, "BB2AP_RST2" },
};
static enum {
IPC_AP_WAKE_UNINIT,
<API key>,
IPC_AP_WAKE_INIT1,
IPC_AP_WAKE_INIT2,
IPC_AP_WAKE_L,
IPC_AP_WAKE_H,
} ipc_ap_wake_state = IPC_AP_WAKE_INIT2;
enum <API key> <API key>;
static struct workqueue_struct *workqueue;
static struct work_struct init1_work;
static struct work_struct init2_work;
static struct work_struct L2_resume_work;
//static struct delayed_work init4_work;
static struct <API key> *<API key>;
static int <API key> = 0;
static bool <API key>;
static struct wake_lock wakelock;
static struct usb_device *usbdev;
static bool CP_initiated_L2toL0;
static bool modem_power_on;
static bool first_time = true;
static int power_onoff;
static void <API key>(void);
static DEFINE_MUTEX(<API key>);
#ifndef <API key>
static int <API key>(
struct <API key> *data);
#endif
static bool wakeup_pending;
static int uart_pin_pull_state=1; // 1 for UART, 0 for GPIO
static bool modem_sleep_flag = false;
//static struct regulator *endeavor_dsi_reg = NULL;//for avdd_csi_dsi
static spinlock_t xmm_lock;
static bool system_suspending;
static int <API key>; //ICS only
static int htcpcbid=0;
static struct workqueue_struct *workqueue_susp;
static struct work_struct work_shortsusp, work_defaultsusp;
static struct workqueue_struct *workqueue_debug;
static struct work_struct <API key>;
static int s_sku_id = 0;
static const int SKU_ID_ENRC2_GLOBAL = 0x00034600;
static const int SKU_ID_ENRC2_TMO = 0x00032900;
static const int SKU_ID_ENDEAVORU = 0x0002F300;
static struct kset *silent_reset_kset;
static struct kobject *silent_reset_kobj;
#ifndef MIN
static inline int MIN( int x, int y ) { return x > y ? y : x; }
#endif
ssize_t debug_handler(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
if( !strncmp( buf, "0", MIN( count, strlen("0") ) ) )
{
debug_gpio_dump();
}
else if( !strncmp( buf, "1", MIN( count, strlen("1") ) ) )
{
debug_gpio_dump();
<API key>();
}
else if( !strncmp( buf, "2", MIN( count, strlen("2") ) ) )
{
<API key>("From User Space");
}
else
{
pr_info("%s: do nothing\n", __func__);
}
return count;
}
EXPORT_SYMBOL_GPL(debug_handler);
#define PRINT_GPIO(gpio,name) pr_info( "PRINT_GPIO %s <%d>", name, gpio_get_value(gpio) )
int debug_gpio_dump()
{
PRINT_GPIO( TEGRA_GPIO_PM4, "BB_VDD_EN" );
PRINT_GPIO( TEGRA_GPIO_PC1, "AP2BB_RST_PWRDWNn" );
PRINT_GPIO( TEGRA_GPIO_PN0, "AP2BB_RSTn" );
PRINT_GPIO( TEGRA_GPIO_PN3, "AP2BB_PWRON" );
PRINT_GPIO( TEGRA_GPIO_PN2, "BB2AP_RADIO_FATAL" );
PRINT_GPIO( TEGRA_GPIO_PN1, "IPC_HSIC_ACTIVE" );
PRINT_GPIO( TEGRA_GPIO_PV0, "HSIC_SUS_REQ" );
PRINT_GPIO( TEGRA_GPIO_PC6, "IPC_BB_WAKE" );
PRINT_GPIO( TEGRA_GPIO_PS2, "IPC_AP_WAKE" );
if(SKU_ID_ENDEAVORU != s_sku_id)
{
PRINT_GPIO( TEGRA_GPIO_PS5, "BB2AP_RST2" );
}
return true;
}
EXPORT_SYMBOL_GPL(debug_gpio_dump);
int <API key>(void)
{
#if 0
if (!reason)
reason = "No Reason";
pr_info("Trigger Modem Fatal!! reason <%s>", reason);
/*set BB2AP_SUSPEND_REQ Pin (TEGRA_GPIO_PV0) to OutPut High to trigger Modem fatal*/
int ret=<API key>(TEGRA_GPIO_PV0,1);
if (ret < 0)
pr_err("%s: set BB2AP_SUSPEND_REQ Pin to Output error", __func__);
/* reset HOST_ACTIVE to notify modem since suspend req is not a wakeup source of modem. */
queue_work( workqueue_debug, &<API key> );
#else
pr_info("Didn't trigger fatal for better user experience");
#endif
return 0;
}
EXPORT_SYMBOL_GPL(<API key>);
int <API key>(char *reason)
{
#define MSIZE 30
char message[MSIZE] = "ResetReason=";
char *envp[] = { message, NULL };
int left_size = MSIZE -1 -strlen(message);
if (!reason)
reason = "No Reason";
strncat(message, reason, MIN(strlen(reason),left_size));
pr_info("%s: message<%s>", __func__, message);
if(silent_reset_kobj)
{
kobject_uevent_env( silent_reset_kobj, KOBJ_ADD, envp);
}
else
{
pr_err("%s: kobj is NULL.", __func__);
}
return 0;
}
EXPORT_SYMBOL_GPL(<API key>);
static DEVICE_ATTR(debug_handler, S_IRUSR | S_IWUSR | S_IRGRP, NULL, debug_handler);
int Modem_is_6360()
{
return s_sku_id == SKU_ID_ENRC2_TMO;
}
EXPORT_SYMBOL_GPL(Modem_is_6360);
int Modem_is_6260()
{
return ( s_sku_id == SKU_ID_ENRC2_GLOBAL || s_sku_id == SKU_ID_ENDEAVORU );
}
EXPORT_SYMBOL_GPL(Modem_is_6260);
int Modem_is_IMC(void)
{
return ( machine_is_enrc2b() || <API key>() || machine_is_enrc2u() );
}
EXPORT_SYMBOL_GPL(Modem_is_IMC);
static irqreturn_t radio_reset_irq(int irq, void *dev_id)
{
pr_err("%s: Radio reset detected!", __func__);
debug_gpio_dump();
return IRQ_HANDLED;
}
#if 0
int <API key>()
{
pr_info(MODULE_NAME "[xmm]%s\n",__func__);
int ret=0;
if (endeavor_dsi_reg == NULL) {
endeavor_dsi_reg = regulator_get(NULL, "avdd_dsi_csi");
pr_info(MODULE_NAME "[xmm]%s regulator_getED\n",__func__);
if (IS_ERR_OR_NULL(endeavor_dsi_reg)) {
pr_err("dsi: Could not get regulator avdd_dsi_csi\n");
endeavor_dsi_reg = NULL;
return PTR_ERR(endeavor_dsi_reg);
}
}
ret = regulator_enable(endeavor_dsi_reg);
if (ret < 0) {
printk(KERN_ERR
"DSI regulator avdd_dsi_csi couldn't be enabled\n",ret);
}
return ret;
}
int <API key>()
{
pr_info(MODULE_NAME "[xmm]%s\n",__func__);
int ret=0;
if (endeavor_dsi_reg == NULL) {
endeavor_dsi_reg = regulator_get(NULL, "avdd_dsi_csi");
pr_info(MODULE_NAME "[xmm]%s regulator_getED\n",__func__);
if (IS_ERR_OR_NULL(endeavor_dsi_reg)) {
pr_err("dsi: Could not get regulator avdd_dsi_csi\n");
endeavor_dsi_reg = NULL;
return PTR_ERR(endeavor_dsi_reg);
}
}
ret = regulator_disable(endeavor_dsi_reg);
if (ret < 0) {
printk(KERN_ERR
"DSI regulator avdd_dsi_csi couldn't be disabled\n",ret);
}
endeavor_dsi_reg=NULL;
return ret;
}
#endif
int <API key>(unsigned gpio, unsigned long flags, const char *label)
{
int err=0;
if (flags & GPIOF_DIR_IN)
err = <API key>(gpio);
else
err = <API key>(gpio,
(flags & GPIOF_INIT_HIGH) ? 1 : 0);
return err;
}
int <API key>(struct gpio *array, size_t num)
{
int i, err=0;
for (i = 0; i < num; i++, array++) {
if( array->gpio != -1 )
{
err = <API key>(array->gpio, array->flags, array->label);
if (err)
goto err_free;
}
}
return 0;
err_free:
//while (i--)
//gpio_free((--array)->gpio);
return err;
}
int <API key>(unsigned gpio,const char *label)
{
int err = gpio_request(gpio, label);
if (err) return err;
else return 0;
}
int <API key>(struct gpio *array, size_t num)
{
int i, err=0;
for (i = 0; i < num; i++, array++) {
if( array->gpio != -1 )
{
err = <API key>(array->gpio, array->label);
if (err)
goto err_free;
}
}
return 0;
err_free:
while (i
gpio_free((--array)->gpio);
return err;
}
static int gpio_o_l_uart(int gpio, char* name)
{
int ret=0;
pr_info(MODULE_NAME "%s ,name=%s gpio=%d\n", __func__,name,gpio);
ret = <API key>(gpio, 0);
if (ret < 0) {
pr_err(" %s: <API key> failed %d\n", __func__, ret);
gpio_free(gpio);
return ret;
}
tegra_gpio_enable(gpio);
gpio_export(gpio, true);
return ret;
}
void <API key>(void)
{
pr_info(MODULE_NAME "%s ,first_time=%s uart_pin_pull_low=%d\n", __func__,first_time?"true":"false",uart_pin_pull_state);
if(uart_pin_pull_state==0){
//if uart pin pull low, then we put back to normal
pr_info(MODULE_NAME "%s tegra_gpio_disable for UART\n", __func__);
tegra_gpio_disable(TEGRA_GPIO_PJ7);
tegra_gpio_disable(TEGRA_GPIO_PK7);
tegra_gpio_disable(TEGRA_GPIO_PB0);
tegra_gpio_disable(TEGRA_GPIO_PB1);
uart_pin_pull_state=1;//set back to UART
}
}
int <API key>(void)
{
int err=0;
pr_info(MODULE_NAME "%s uart_pin_pull_low=%d\n", __func__,uart_pin_pull_state);
if(uart_pin_pull_state==1){
//if uart pin not pull low yet, then we pull them low+enable
err=gpio_o_l_uart(TEGRA_GPIO_PJ7, "IMC_UART_TX");
err=gpio_o_l_uart(TEGRA_GPIO_PK7, "IMC_UART_RTS");
err=gpio_o_l_uart(TEGRA_GPIO_PB0 ,"IMC_UART_RX");
err=gpio_o_l_uart(TEGRA_GPIO_PB1, "IMC_UART_CTS");
uart_pin_pull_state=0;//chagne to gpio
}
return err;
}
int <API key>(struct gpio *array, size_t num)
{
//pr_info(MODULE_NAME "%s 1219_01\n", __func__);
int err=0;
err = <API key>(<API key>,
ARRAY_SIZE(<API key>));
if (err < 0) {
pr_err("%s - gpio_config_array gpio(s) for modem off failed\n", __func__);
return -ENODEV;
}
return err;
}
#if 0
int <API key>(struct gpio *array, size_t num)
{
pr_info(MODULE_NAME "%s \n", __func__);
int err=0;
err = <API key>(<API key>,
ARRAY_SIZE(<API key>));
if (err < 0) {
pr_err("%s - gpio_config_array gpio(s) for modem off failed\n", __func__);
return -ENODEV;
}
return err;
}
#endif
int <API key>(void)
{
int err=0;
pr_info(MODULE_NAME "%s for power consumation 4st \n", __func__);
#if 1
/* config baseband gpio(s) for modem off */
err = <API key>(<API key>,
ARRAY_SIZE(<API key>));
if (err < 0) {
pr_err("%s - gpio_config_array gpio(s) for modem off failed\n", __func__);
return -ENODEV;
}
#endif
/* config uart gpio(s) for modem off */
err=<API key>();
if (err < 0) {
pr_err("%s - <API key> gpio(s)\n", __func__);
return -ENODEV;
}
return err;
}
#if 0
int <API key>()
{
int err=0;
pr_info(MODULE_NAME "%s for power consumation 4st \n", __func__);
#if 1
/* config baseband gpio(s) for modem off */
err = <API key>(<API key>,
ARRAY_SIZE(<API key>));
if (err < 0) {
pr_err("%s - gpio_config_array gpio(s) for modem off failed\n", __func__);
return -ENODEV;
}
#endif
/* config uart gpio(s) for modem off */
<API key>();
return err;
}
#endif
/*HTC--*/
extern void <API key>(bool mode_on);
static int <API key>(struct <API key> *data)
{
/* HTC: called in atomic context */
int ret=0, i=0;
pr_info("%s VP: 07/05 22.52{\n", __func__);
if (!data) {
pr_err("%s: data is NULL\n", __func__);
return -1;
}
/* reset / power on sequence */
gpio_set_value(data->modem.xmm.bb_vdd_en, 1); /* give modem power */
auto_sleep(1);
gpio_set_value(data->modem.xmm.bb_rst, 0); /* set to low first */
//pr_info("%s(%d)\n", __func__, __LINE__);
for (i = 0; i < 7; i++) /* 5 ms BB_RST low */
udelay(1000);
ret = gpio_get_value(data->modem.xmm.bb_rst_pwrdn);
//pr_info("%s(%d) get AP2BB_RST_PWRDWNn=%d \n", __func__, __LINE__, ret);
//pr_info("%s(%d) set AP2BB_RST_PWRDWNn=1\n", __func__, __LINE__);
gpio_set_value(data->modem.xmm.bb_rst_pwrdn, 1); /* 20 ms RST_PWRDWNn high */
auto_sleep(25); /* need 20 but 40 is more safe */ //steven markded
//pr_info("%s(%d) set modem.xmm.bb_rst=1\n", __func__, __LINE__);
gpio_set_value(data->modem.xmm.bb_rst, 1); /* 1 ms BB_RST high */
auto_sleep(40); /* need 20 but 40 is more safe */
/* Use RST2 to identify if modem is powered on into boot rom. */
/* Fix issue of power leakage in ENRC2. */
if (machine_is_enrc2b() || machine_is_enrc2u())
{
<API key>(data->modem.xmm.bb_rst2);
}
<API key>(data->modem.xmm.ipc_ap_wake);
<API key>(TEGRA_GPIO_PN2);
//pr_info("%s(%d) set modem.xmm.bb_on=1 duration is 60us\n", __func__, __LINE__);
gpio_set_value(data->modem.xmm.bb_on, 1); /* power on sequence */
udelay(60);
gpio_set_value(data->modem.xmm.bb_on, 0);
//pr_info("%s(%d) set modem.xmm.bb_on=0\n", __func__, __LINE__);
auto_sleep(10);
//pr_info("%s:VP pm qos request CPU 1.5GHz\n", __func__);
//<API key>(&<API key>, (s32)BOOST_CPU_FREQ_MIN);
/* Use RST2 to identify if modem is powered on into boot rom. */
/* Fix issue of power leakage in ENRC2. */
if (machine_is_enrc2b() || machine_is_enrc2u())
{
int counter = 0;
const int max_retry = 10;
while (!gpio_get_value(data->modem.xmm.bb_rst2) && counter < max_retry)
{
counter++;
mdelay(3);
}
if(counter == max_retry)
pr_info("%s: Wait BB2AP_RST2 timeout.", __func__);
}
<API key>(data->modem.xmm.ipc_hsic_active, 1);
<API key>();
pr_info("%s }\n", __func__);
return 0;
}
static int <API key>(struct platform_device *device)
{
struct <API key> *data
= (struct <API key> *)
device->dev.platform_data;
int ret; /* HTC: ENR#U wakeup src fix */
//int value;
pr_info(MODULE_NAME "%s{\n", __func__);
/* check for platform data */
if (!data) {
pr_err("%s: !data\n", __func__);
return -EINVAL;
}
if (<API key> != BBXMM_PS_UNINIT) {
pr_err("%s: <API key> != BBXMM_PS_UNINIT\n",
__func__);
return -EINVAL;
}
#if 0 /*HTC*/
pr_info(MODULE_NAME " htc_get_pcbid_info= %d\n",htcpcbid );
if(htcpcbid < PROJECT_PHASE_XE) {
<API key>();
}
#endif
/* reset the state machine */
<API key> = BBXMM_PS_INIT;
first_time = true;
modem_sleep_flag = false;
/* HTC use IPC_AP_WAKE_INIT2 */
if (modem_ver < XMM_MODEM_VER_1130)
ipc_ap_wake_state = IPC_AP_WAKE_INIT1;
else
ipc_ap_wake_state = IPC_AP_WAKE_INIT2;
/* pr_info("%s - %d\n", __func__, __LINE__); */
/* register usb host controller */
if (!modem_flash) {
/* pr_info("%s - %d\n", __func__, __LINE__); */
/* register usb host controller only once */
if (<API key>) {
pr_info("%s(%d)register usb host controller\n", __func__, __LINE__);
modem_power_on = true;
if (data->hsic_register)
data->modem.xmm.hsic_device =
data->hsic_register();
else
pr_err("%s: hsic_register is missing\n",
__func__);
<API key> = false;
} else {
/* register usb host controller */
if (data->hsic_register)
data->modem.xmm.hsic_device =
data->hsic_register();
/* turn on modem */
pr_info("%s call <API key>\n", __func__);
<API key>(data);
}
}
if (machine_is_enrc2b() || machine_is_enrc2u())
{
pr_info("%s: register BB2AP_RST2 handler", __func__);
ret = request_irq( gpio_to_irq(TEGRA_GPIO_PS5),
radio_reset_irq,
<API key>,
"RADIO_RESET",
NULL );
if (ret < 0)
pr_err("%s: register BB2AP_RST2 handler err <%d>", __func__, ret);
}
pr_info("%s: before enable irq wake", __func__);
ret = enable_irq_wake(gpio_to_irq(data->modem.xmm.ipc_ap_wake));
if (ret < 0)
pr_err("%s: enable_irq_wake ap_wake err <%d>", __func__, ret);
ret = enable_irq_wake(gpio_to_irq(TEGRA_GPIO_PN2));
if (ret < 0)
pr_err("%s: enable_irq_wake radio_fatal err <%d>", __func__, ret);
if (machine_is_enrc2b() || machine_is_enrc2u())
{
ret = enable_irq_wake(gpio_to_irq(TEGRA_GPIO_PS5));
if (ret < 0)
pr_err("%s: enable_irq_wake radio_reset err <%d>", __func__, ret);
}
pr_info("%s }\n", __func__);
return 0;
}
static int <API key>(struct platform_device *device)
{
struct <API key> *data;
int ret; /* HTC: ENR#U wakeup src fix */
unsigned long flags;
pr_info("%s {\n", __func__);
if (<API key> == BBXMM_PS_UNINIT) {
pr_err("%s: <API key> != BBXMM_PS_UNINIT\n",
__func__);
return -EINVAL;
}
/* check for device / platform data */
if (!device) {
pr_err("%s: !device\n", __func__);
return -EINVAL;
}
data = (struct <API key> *)
device->dev.platform_data;
if (!data) {
pr_err("%s: !data\n", __func__);
return -EINVAL;
}
ipc_ap_wake_state = IPC_AP_WAKE_UNINIT;
/* Set this flag to have proper flash-less first enumearation */
<API key> = true;
pr_info("%s: before disable irq wake", __func__);
ret = disable_irq_wake(gpio_to_irq(data->modem.xmm.ipc_ap_wake));
if (ret < 0)
pr_err("%s: disable_irq_wake ap_wake err <%d>", __func__, ret);
ret = disable_irq_wake(gpio_to_irq(TEGRA_GPIO_PN2));
if (ret < 0)
pr_err("%s: disable_irq_wake radio_fatal err <%d>", __func__, ret);
if (machine_is_enrc2b() || machine_is_enrc2u())
{
ret = disable_irq_wake(gpio_to_irq(TEGRA_GPIO_PS5));
if (ret < 0)
pr_err("%s: disable_irq_wake radio_reset err <%d>", __func__, ret);
pr_info("%s: before free radio_reset irq", __func__);
free_irq( gpio_to_irq(TEGRA_GPIO_PS5), NULL );
if (ret < 0)
pr_err("%s: free_irq radio_reset err <%d>", __func__, ret);
}
/* unregister usb host controller */
pr_info("%s: hsic device: %x\n", __func__, (unsigned int)data->modem.xmm.hsic_device);
if (data->hsic_unregister && data->modem.xmm.hsic_device)
{
data->hsic_unregister(data->modem.xmm.hsic_device);
data->modem.xmm.hsic_device = NULL;
}
else
pr_err("%s: hsic_unregister is missing\n", __func__);
/* set IPC_HSIC_ACTIVE low */
gpio_set_value(<API key>->
modem.xmm.ipc_hsic_active, 0);
/* wait 20 ms */
msleep(20);
/* drive bb_rst low */
//Sophia:0118:modem power down sequence: don't need to clear BB_RST
//gpio_set_value(data->modem.xmm.bb_rst, 0);
#ifdef BB_XMM_OEM1
//msleep(1);
msleep(20);
/* turn off the modem power */
gpio_set_value(<API key>->modem.xmm.bb_vdd_en, 0);
msleep(68);//for IMC Modem discharge.
#else /* !BB_XMM_OEM1 */
msleep(1);
#endif /* !BB_XMM_OEM1 */
#if 1/*HTC*/
//for power consumation
pr_info("%s <API key>\n", __func__);
<API key>();
//err=<API key>();
//if (err < 0) {
// pr_err("%s - <API key> gpio(s)\n", __func__);
// return -ENODEV;
#endif
/* HTC: remove <API key> for ENR */
/* <API key>(true); */
<API key> = BBXMM_PS_UNINIT;
modem_sleep_flag = false;
CP_initiated_L2toL0 = false;
spin_lock_irqsave(&xmm_lock, flags);
wakeup_pending = false;
system_suspending = false;
<API key>(&xmm_lock, flags);
<API key> = true; //start reg process again for xmm on
#if 0 /*HTC*/
pr_info(MODULE_NAME " htc_get_pcbid_info= %d\n", htcpcbid);
if(htcpcbid< PROJECT_PHASE_XE) {
<API key>();
}
#endif
/*set Radio fatal Pin to OutPut Low*/
ret=<API key>(TEGRA_GPIO_PN2,0);
if (ret < 0)
pr_err("%s: set Radio fatal Pin to Output error\n", __func__);
/*set BB2AP_SUSPEND_REQ Pin (TEGRA_GPIO_PV0) to OutPut Low*/
ret=<API key>(TEGRA_GPIO_PV0,0);
if (ret < 0)
pr_err("%s: set BB2AP_SUSPEND_REQ Pin to Output error\n", __func__);
pr_info("%s }\n", __func__);
return 0;
}
static ssize_t baseband_xmm_onoff(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
//int size;
struct platform_device *device = to_platform_device(dev);
mutex_lock(&<API key>);
/* check input */
if (buf == NULL) {
pr_err("%s: buf NULL\n", __func__);
mutex_unlock(&<API key>);
return -EINVAL;
}
/* pr_info("%s: count=%d\n", __func__, count); */
/* parse input */
#ifdef BB_XMM_OEM1
if (buf[0] == 0x01 || buf[0] == '1') {
/* pr_info("%s: buf[0] = 0x%x\n", __func__, buf[0]); */
power_onoff = 1;
} else
power_onoff = 0;
#else /* !BB_XMM_OEM1 */
size = sscanf(buf, "%d", &power_onoff);
if (size != 1) {
pr_err("%s: size=%d -EINVAL\n", __func__, size);
mutex_unlock(&<API key>);
return -EINVAL;
}
#endif /* !BB_XMM_OEM1 */
pr_info("%s power_onoff=%d count=%d, buf[0]=0x%x\n",
__func__, power_onoff, count, buf[0]);
if (power_onoff == 0)
<API key>(device);
else if (power_onoff == 1)
<API key>(device);
mutex_unlock(&<API key>);
return count;
}
static DEVICE_ATTR(xmm_onoff, S_IRUSR | S_IWUSR | S_IRGRP,
NULL, baseband_xmm_onoff);
void <API key>(unsigned int status)
{
struct <API key> *data = <API key>;
//int value = 0;
unsigned long flags;
if (<API key> == status)
return;
pr_info(MODULE_NAME"%s{ status=%d\n", __func__,status);
switch (status) {
case BBXMM_PS_L0:
if (modem_sleep_flag) {
#ifdef <API key>
pr_info("%s, resume to L0 with modem_sleep_flag", __func__ );
#else
pr_info("%s Resume from L3 without calling resume function\n", __func__);
<API key>(data);
#endif
}
pr_info("L0\n");
<API key> = status;
/* HTC: don't hold the wakelock multiple times */
if (!wake_lock_active(&wakelock)) {
pr_info("%s: wake_lock [%s] in L0\n",
__func__, wakelock.name);
#ifdef <API key>
wake_lock_timeout(&wakelock, HZ*2);
#else
wake_lock(&wakelock);
//wake_lock_timeout(&wakelock, HZ * 5);
#endif
}
if (modem_power_on) {
modem_power_on = false;
<API key>(data);
}
//pr_info("gpio host active high->\n");
/* hack to restart autosuspend after exiting LP0
* (aka re-entering L0 from L3)
*/
#if 0
//remove on 0305
if (usbdev) {
struct usb_interface *intf;
intf = usb_ifnum_to_if(usbdev, 0);
//pr_info("%s - autopm_get - usbdev = %d - %d {\n", __func__, usbdev, __LINE__);
//pr_info("%s: cnt %d intf=%p &intf->dev=%p kobje=%s\n",
//__func__, atomic_read(&intf->dev.power.usage_count),intf,&intf->dev,kobject_name(&intf->dev.kobj));
if (<API key>(intf) >= 0) {
pr_info("get_interface_async succeeded"
" - call put_interface\n");
//pr_info("%s - usb_put - usbdev = %d - %d {\n", __func__, usbdev, __LINE__);
<API key>(intf);
//pr_info("%s - usb_put - usbdev = %d - %d {\n", __func__, usbdev, __LINE__);
} else {
pr_info("get_interface_async failed"
" - do not call put_interface\n");
}
}
#endif
break;
case BBXMM_PS_L2:
pr_info("L2 wake_unlock[%s]\n", wakelock.name);
<API key> = status;
spin_lock_irqsave(&xmm_lock, flags);
if (wakeup_pending) {
<API key>(&xmm_lock, flags);
#ifdef <API key>
pr_info("%s: wakeup pending\n", __func__);
#endif
<API key>();
} else {
<API key>(&xmm_lock, flags);
wake_unlock(&wakelock);
modem_sleep_flag = true;
}
if (short_autosuspend && (&usbdev->dev)) {
pr_info("autosuspend delay %d ms,disable short_autosuspend\n", (int)autosuspend_delay);
queue_work(workqueue_susp, &work_defaultsusp);
short_autosuspend = false;
}
#if 0
if (usbdev) {
struct usb_interface *intf;
intf = usb_ifnum_to_if(usbdev, 0);
pr_info("%s: cnt %d intf=%p &intf->dev=%p kobje=%s\n",
__func__, atomic_read(&intf->dev.power.usage_count),intf,&intf->dev,kobject_name(&intf->dev.kobj));
}
#endif
break;
#ifndef <API key>
case BBXMM_PS_L3:
if (<API key> == BBXMM_PS_L2TOL0) {
pr_info("%s: <API key> == BBXMM_PS_L2TOL0\n", __func__);
if (!gpio_get_value(data->modem.xmm.ipc_ap_wake)) {
spin_lock_irqsave(&xmm_lock, flags);
wakeup_pending = true;
<API key>(&xmm_lock, flags);
pr_info("%s: L2 race condition-CP wakeup pending\n", __func__);
}
}
pr_info("L3\n");
<API key> = status;
spin_lock_irqsave(&xmm_lock, flags);
system_suspending = false;
<API key>(&xmm_lock, flags);
if (wake_lock_active(&wakelock)) {
pr_info("L3 --- wake_unlock[%s]\n", wakelock.name);
wake_unlock(&wakelock);
}
if (wakeup_pending == false) {
gpio_set_value(data->modem.xmm.ipc_hsic_active, 0);
<API key> = 0;
pr_info("gpio host active low->\n");
}
break;
#endif
case BBXMM_PS_L2TOL0:
pr_info("L2->L0\n");
spin_lock_irqsave(&xmm_lock, flags);
system_suspending = false;
wakeup_pending = false;
<API key>(&xmm_lock, flags);
/* do this only from L2 state */
if (<API key> == BBXMM_PS_L2) {
<API key> = status;
//pr_info("BB XMM POWER STATE = %d\n", status);
<API key>();
} else
goto <API key>;
default:
break;
}
<API key> = status;
pr_info("BB XMM POWER STATE = %d\n", status);
return;
<API key>:
pr_info("BB XMM POWER STATE = %d (not change to %d)\n",
<API key>, status);
return;
}
EXPORT_SYMBOL_GPL(<API key>);
irqreturn_t <API key>(int irq, void *dev_id)
{
int value;
struct <API key> *data = <API key>;
/* pr_info("%s\n", __func__); */
value = gpio_get_value(data->modem.xmm.ipc_ap_wake);
if (ipc_ap_wake_state < <API key>) {
pr_err("%s - spurious irq\n", __func__);
} else if (ipc_ap_wake_state == <API key>) {
if (!value) {
pr_info("%s - IPC_AP_WAKE_INIT1"
" - got falling edge\n",
__func__);
if (<API key> == 0) {
pr_info("%s return because irq must get the rising event at first\n", __func__);
return IRQ_HANDLED;
}
/* go to IPC_AP_WAKE_INIT1 state */
ipc_ap_wake_state = IPC_AP_WAKE_INIT1;
/* queue work */
queue_work(workqueue, &init1_work);
} else {
pr_info("%s - IPC_AP_WAKE_INIT1"
" - wait for falling edge\n",
__func__);
<API key> = 1;
}
} else if (ipc_ap_wake_state == IPC_AP_WAKE_INIT1) {
if (!value) {
pr_info("%s - IPC_AP_WAKE_INIT2"
" - wait for rising edge\n",
__func__);
} else {
pr_info("%s - IPC_AP_WAKE_INIT2"
" - got rising edge\n",
__func__);
/* go to IPC_AP_WAKE_INIT2 state */
ipc_ap_wake_state = IPC_AP_WAKE_INIT2;
/* queue work */
queue_work(workqueue, &init2_work);
}
} else {
if (!value) {
pr_info("%s - falling\n", __func__);
/* First check it a CP ack or CP wake */
if (data->pin_state == 0) {
/* AP L2 to L0 wakeup */
pr_info("VP: received rising wakeup ap l2->l0\n");
data->pin_state = 1;
<API key>(&data->bb_wait);
}
value = gpio_get_value
(data->modem.xmm.ipc_bb_wake);
if (value) {
pr_info("cp ack for bb_wake\n");
ipc_ap_wake_state = IPC_AP_WAKE_L;
return IRQ_HANDLED;
}
spin_lock(&xmm_lock);
wakeup_pending = true;
if (system_suspending) {
spin_unlock(&xmm_lock);
pr_info("system_suspending=1, Just set wakup_pending flag=true\n");
} else {
#ifndef <API key>
if (<API key> ==
BBXMM_PS_L3) {
spin_unlock(&xmm_lock);
pr_info(" CP L3 -> L0\n");
pr_info("set wakeup_pending=true, wait for no-irq-resuem if you are not under LP0 yet !.\n");
pr_info("set wakeup_pending=true, wait for system resume if you already under LP0.\n");
} else
#endif
if (<API key> ==
BBXMM_PS_L2) {
CP_initiated_L2toL0 = true;
spin_unlock(&xmm_lock);
<API key>
(BBXMM_PS_L2TOL0);
} else {
CP_initiated_L2toL0 = true;
spin_unlock(&xmm_lock);
pr_info(" CP wakeup pending- new race condition");
}
}
/* save gpio state */
ipc_ap_wake_state = IPC_AP_WAKE_L;
} else {
pr_info("%s - rising\n", __func__);
value = gpio_get_value
(data->modem.xmm.ipc_hsic_active);
if (!value) {
pr_info("host active low: ignore request\n");
ipc_ap_wake_state = IPC_AP_WAKE_H;
return IRQ_HANDLED;
}
value = gpio_get_value
(data->modem.xmm.ipc_bb_wake);
if (value) {
/* Clear the slave wakeup request */
gpio_set_value
(data->modem.xmm.ipc_bb_wake, 0);
pr_info("set gpio slave wakeup low done ->\n");
}
if (<API key> && usbdev) {
struct usb_interface *intf;
<API key> = false;
intf = usb_ifnum_to_if(usbdev, 0);
if( NULL != intf ){
if (<API key>(intf) >= 0) {
pr_info("get_interface_async succeeded"
" - call put_interface\n");
<API key>(intf);
} else {
pr_info("get_interface_async failed"
" - do not call put_interface\n");
}
}
}
if (short_autosuspend&& (&usbdev->dev)) {
pr_info("set autosuspend delay %d ms\n", <API key>);
queue_work(workqueue_susp, &work_shortsusp);
}
modem_sleep_flag = false;
<API key>(BBXMM_PS_L0);
/* save gpio state */
ipc_ap_wake_state = IPC_AP_WAKE_H;
}
}
return IRQ_HANDLED;
}
EXPORT_SYMBOL(<API key>);
static void <API key>(struct work_struct *work)
{
/* set host_active for interrupt modem */
int value = gpio_get_value(TEGRA_GPIO_PN1);
pr_info("Oringial IPC_HSIC_ACTIVE =%d", value);
gpio_set_value(TEGRA_GPIO_PN1,!value);
msleep(100);
gpio_set_value(TEGRA_GPIO_PN1,value);
}
static void <API key>(struct work_struct *work)
{
int value;
pr_info("%s {\n", __func__);
/* check if IPC_HSIC_ACTIVE high */
value = gpio_get_value(<API key>->
modem.xmm.ipc_hsic_active);
if (value != 1) {
pr_err("%s - expected IPC_HSIC_ACTIVE high!\n", __func__);
return;
}
/* wait 100 ms */
msleep(100);
/* set IPC_HSIC_ACTIVE low */
gpio_set_value(<API key>->
modem.xmm.ipc_hsic_active, 0);
/* wait 10 ms */
msleep(10);
/* set IPC_HSIC_ACTIVE high */
gpio_set_value(<API key>->
modem.xmm.ipc_hsic_active, 1);
/* wait 20 ms */
msleep(20);
#ifdef BB_XMM_OEM1
/* set IPC_HSIC_ACTIVE low */
gpio_set_value(<API key>->
modem.xmm.ipc_hsic_active, 0);
printk(KERN_INFO"%s merge need check set IPC_HSIC_ACTIVE low\n", __func__);
#endif /* BB_XMM_OEM1 */
pr_info("%s }\n", __func__);
}
static void <API key>(struct work_struct *work)
{
struct <API key> *data = <API key>;
pr_info("%s\n", __func__);
/* check input */
if (!data)
return;
/* register usb host controller only once */
if (<API key>) {
if (data->hsic_register)
data->modem.xmm.hsic_device = data->hsic_register();
else
pr_err("%s: hsic_register is missing\n", __func__);
<API key> = false;
}
}
/* Do the work for AP/CP initiated L2->L0 */
static void <API key>(void)
{
struct <API key> *data = <API key>;
int value;
unsigned long flags;
pr_info("%s\n", __func__);
if (!<API key>)
return;
/* claim the wakelock here to avoid any system suspend */
if (!wake_lock_active(&wakelock))
#ifdef <API key>
wake_lock_timeout(&wakelock, HZ*2);
#else
wake_lock(&wakelock);
#endif
modem_sleep_flag = false;
spin_lock_irqsave(&xmm_lock, flags);
wakeup_pending = false;
<API key>(&xmm_lock, flags);
if (CP_initiated_L2toL0) {
pr_info("CP L2->L0\n");
CP_initiated_L2toL0 = false;
queue_work(workqueue, &L2_resume_work);
#if 0
if (usbdev) {
struct usb_interface *intf;
intf = usb_ifnum_to_if(usbdev, 0);
pr_info("%s: cnt %d intf=%p &intf->dev=%p kobje=%s\n",
__func__, atomic_read(&intf->dev.power.usage_count),intf,&intf->dev,kobject_name(&intf->dev.kobj));
}
#endif
} else {
/* set the slave wakeup request */
#ifdef <API key>
pr_info("AP/CP L2->L0\n");
#else
pr_info("AP L2->L0\n");
#endif
value = gpio_get_value(data->modem.xmm.ipc_ap_wake);
if (value) {
int ret=0, cptrycount=0, eresyscount=0;
const int delay=200, MAXTRY=5, eredelay=3, MAX_ERETRY=100;
unsigned long target_jiffies=0;
data->pin_state = 0;
retry_cpwake:
if(cptrycount)
{
gpio_set_value(data->modem.xmm.ipc_bb_wake, 0);
mdelay(1);
debug_gpio_dump();
}
target_jiffies = jiffies + msecs_to_jiffies(delay);
/* wake bb */
gpio_set_value(data->modem.xmm.ipc_bb_wake, 1);
retry:
/* wait for cp */
pr_info("waiting for host wakeup from CP... <%d,%d>\n", cptrycount, eresyscount);
ret = <API key>(
data->bb_wait,
data->pin_state == 1 || (gpio_get_value(data->modem.xmm.ipc_ap_wake) == 0),
MIN( (<API key>), msecs_to_jiffies(delay) ) );
if (ret == 0) {
pr_info("%s: wait for cp ack %d times\n", __func__, cptrycount);
debug_gpio_dump();
cptrycount++;
if(cptrycount == MAXTRY)
{
pr_err("!!AP L2->L0 Failed\n");
<API key>();
return;
}
goto retry_cpwake;
}
if (ret == -ERESTARTSYS ) {
eresyscount++;
pr_info("%s: caught signal, sleep and retry %d times\n", __func__, eresyscount);
if(eresyscount == MAX_ERETRY)
{
pr_err("too many ERESTARTSYS <%d>, abort\n", eresyscount);
debug_gpio_dump();
<API key>();
return;
}
msleep(eredelay);
goto retry;
}
pr_info("Get gpio host wakeup low <-\n");
} else {
pr_info("CP already ready\n");
}
}
}
static void <API key>(struct work_struct *work)
{
if (!usbdev || !&usbdev->dev)
{
pr_err("%s usbdev is invalid\n", __func__);
return;
}
<API key>(&usbdev->dev, <API key>);
pr_info("%s <API key> <%d>", __func__, <API key>);
}
static void <API key>(struct work_struct *work)
{
if (!usbdev || !&usbdev->dev)
{
pr_err("%s usbdev is invalid\n", __func__);
return;
}
<API key>(&usbdev->dev, autosuspend_delay);
//pr_info("%s <API key> <%d>", __func__, autosuspend_delay);
}
/* Do the work for CP initiated L2->L0 */
static void <API key>(struct work_struct *work)
{
struct usb_interface *intf;
pr_info("%s {\n", __func__);
if (!usbdev) {
pr_info("%s - !usbdev\n", __func__);
return;
}
usb_lock_device(usbdev);
intf = usb_ifnum_to_if(usbdev, 0);
if( NULL != intf ){
if (<API key>(intf) == 0)
<API key>(intf);
}
usb_unlock_device(usbdev);
pr_info("} %s\n", __func__);
}
static void <API key>(void)
{
/* reset / power on sequence */
msleep(40);
gpio_set_value(<API key>->modem.xmm.bb_rst, 1);
msleep(1);
gpio_set_value(<API key>->modem.xmm.bb_on, 1);
udelay(40);
gpio_set_value(<API key>->modem.xmm.bb_on, 0);
}
static struct <API key> *<API key>;
static void <API key>(struct work_struct *work)
{
struct <API key> *bbxmm_work
= (struct <API key> *) work;
pr_info("%s - work->sate=%d\n", __func__, bbxmm_work->state);
switch (bbxmm_work->state) {
case BBXMM_WORK_UNINIT:
pr_info("BBXMM_WORK_UNINIT\n");
break;
case BBXMM_WORK_INIT:
pr_info("BBXMM_WORK_INIT\n");
/* go to next state */
bbxmm_work->state = (modem_flash && !modem_pm)
? <API key>
: (modem_flash && modem_pm)
? <API key>
: (!modem_flash && modem_pm)
? <API key>
: BBXMM_WORK_UNINIT;
pr_info("Go to next state %d\n", bbxmm_work->state);
queue_work(workqueue, work);
break;
case <API key>:
//pr_info("<API key>\n");
/* register usb host controller */
pr_info("%s: register usb host controller\n", __func__);
if (<API key>->hsic_register)
<API key>->modem.xmm.hsic_device =
<API key>->hsic_register();
else
pr_err("%s: hsic_register is missing\n", __func__);
break;
case <API key>:
//pr_info("<API key>\n");
/* [modem ver >= 1130] start with IPC_HSIC_ACTIVE low */
if (modem_ver >= XMM_MODEM_VER_1130) {
pr_info("%s: ver > 1130:"
" ipc_hsic_active -> 0\n", __func__);
gpio_set_value(<API key>->
modem.xmm.ipc_hsic_active, 0);
}
/* reset / power on sequence */
<API key>();
/* set power status as on */
power_onoff = 1;
/* optional delay
* 0 = flashless
* ==> causes next step to enumerate modem boot rom
* (058b / 0041)
* some delay > boot rom timeout
* ==> causes next step to enumerate modem software
* (1519 / 0020)
* (requires modem to be flash version, not flashless
* version)
*/
if (enum_delay_ms)
msleep(enum_delay_ms);
/* register usb host controller */
pr_info("%s: register usb host controller\n", __func__);
if (<API key>->hsic_register)
<API key>->modem.xmm.hsic_device =
<API key>->hsic_register();
else
pr_err("%s: hsic_register is missing\n", __func__);
/* go to next state */
bbxmm_work->state = (modem_ver < XMM_MODEM_VER_1130)
? <API key>
: <API key>;
queue_work(workqueue, work);
pr_info("Go to next state %d\n", bbxmm_work->state);
break;
case <API key>:
pr_info("<API key>\n");
break;
case <API key>:
pr_info("<API key>\n");
break;
case <API key>:
//pr_info("<API key>\n");
/* go to next state */
bbxmm_work->state = (modem_ver < XMM_MODEM_VER_1130)
? <API key>
: <API key>;
queue_work(workqueue, work);
break;
case <API key>:
pr_info("<API key>\n");
break;
case <API key>:
//pr_info("<API key>\n");
break;
default:
break;
}
}
static void <API key>(struct usb_device *udev)
{
struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
const struct usb_device_id *id;
pr_info("%s \n",__func__);
if (intf == NULL)
return;
id = usb_match_id(intf, xmm_pm_ids);
if (id) {
pr_info("persist_enabled: %u\n", udev->persist_enabled);
pr_info("Add device %d <%s %s>\n", udev->devnum,
udev->manufacturer, udev->product);
usbdev = udev;
<API key>(&udev->dev, autosuspend_delay);//for ICS 39kernel
<API key>(udev);
// pr_info("enable autosuspend, timer <%d>", autosuspend_delay);
}
}
static void <API key>(struct usb_device *udev)
{
if (usbdev == udev) {
pr_info("Remove device %d <%s %s>\n", udev->devnum,
udev->manufacturer, udev->product);
usbdev = 0;
}
}
static int usb_xmm_notify(struct notifier_block *self, unsigned long action,
void *blob)
{
switch (action) {
case USB_DEVICE_ADD:
<API key>(blob);
break;
case USB_DEVICE_REMOVE:
<API key>(blob);
break;
}
return NOTIFY_OK;
}
static struct notifier_block usb_xmm_nb = {
.notifier_call = usb_xmm_notify,
};
static int <API key>(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct <API key> *data = <API key>;
unsigned long flags;
if (!data)
return NOTIFY_DONE;
pr_info("%s: event %ld\n", __func__, event);
switch (event) {
case PM_SUSPEND_PREPARE:
pr_info("%s : PM_SUSPEND_PREPARE\n", __func__);
if (wake_lock_active(&wakelock)) {
pr_info("%s: wakelock was active, aborting suspend\n",__func__);
return NOTIFY_STOP;
}
spin_lock_irqsave(&xmm_lock, flags);
if (wakeup_pending) {
wakeup_pending = false;
<API key>(&xmm_lock, flags);
pr_info("%s : XMM busy : Abort system suspend\n",
__func__);
return NOTIFY_STOP;
}
system_suspending = true;
<API key>(&xmm_lock, flags);
return NOTIFY_OK;
case PM_POST_SUSPEND:
pr_info("%s : PM_POST_SUSPEND\n", __func__);
spin_lock_irqsave(&xmm_lock, flags);
system_suspending = false;
if (wakeup_pending &&
(<API key> == BBXMM_PS_L2)) {
wakeup_pending = false;
<API key>(&xmm_lock, flags);
pr_info("%s : Service Pending CP wakeup\n",
__func__);
CP_initiated_L2toL0 = true;
<API key>
(BBXMM_PS_L2TOL0);
return NOTIFY_OK;
}
wakeup_pending = false;
<API key>(&xmm_lock, flags);
return NOTIFY_OK;
}
return NOTIFY_DONE;
}
static struct notifier_block <API key> = {
.notifier_call = <API key>,
};
static int <API key>(struct platform_device *device)
{
struct <API key> *data
= (struct <API key> *)
device->dev.platform_data;
struct device *dev = &device->dev;
unsigned long flags;
int err, ret=0;
pr_info(MODULE_NAME"%s 0705 - xmm_wake_pin_miss. \n", __func__);
// pr_info(MODULE_NAME"enum_delay_ms=%d\n", enum_delay_ms);
htcpcbid=htc_get_pcbid_info();
pr_info(MODULE_NAME"htcpcbid=%d\n", htcpcbid);
/* check for platform data */
if (!data)
return -ENODEV;
/* check if supported modem */
if (data->baseband_type != BASEBAND_XMM) {
pr_err("unsuppported modem\n");
return -ENODEV;
}
/* save platform data */
<API key> = data;
/* init wait queue */
data->pin_state = 1;
init_waitqueue_head(&data->bb_wait);
/* create device file */
err = device_create_file(dev, &dev_attr_xmm_onoff);
if (err < 0) {
pr_err("%s - device_create_file failed\n", __func__);
return -ENODEV;
}
err = device_create_file(dev, &<API key>);
if (err < 0) {
pr_err("%s - device_create_file failed\n", __func__);
return -ENODEV;
}
/* HTC: create device file for host debugging */
if (device_create_file(dev,&dev_attr_host_dbg))
pr_info(MODULE_NAME"Warning: host attribute can't be created\n");
/* init wake lock */
wake_lock_init(&wakelock, WAKE_LOCK_SUSPEND, "baseband_xmm_power");
/* init spin lock */
spin_lock_init(&xmm_lock);
/* request baseband gpio(s) */
<API key>[0].gpio = <API key>
->modem.xmm.bb_rst;
<API key>[1].gpio = <API key>
->modem.xmm.bb_on;
<API key>[2].gpio = <API key>
->modem.xmm.ipc_bb_wake;
<API key>[3].gpio = <API key>
->modem.xmm.ipc_ap_wake;
<API key>[4].gpio = <API key>
->modem.xmm.ipc_hsic_active;
<API key>[5].gpio = <API key>
->modem.xmm.ipc_hsic_sus_req;
<API key>[6].gpio = <API key>
->modem.xmm.bb_vdd_en;
<API key>[7].gpio = <API key>
->modem.xmm.bb_rst_pwrdn;
<API key>[8].gpio = <API key>
->modem.xmm.bb_rst2;
/*HTC request these gpio on probe only, config them when running power_on/off function*/
err = <API key>(<API key>,
ARRAY_SIZE(<API key>));
if (err < 0) {
pr_err("%s - request gpio(s) failed\n", __func__);
return -ENODEV;
}
#if 1/*HTC*/
//assing for usb
<API key>[0].gpio = <API key>
->modem.xmm.bb_rst;
<API key>[1].gpio = <API key>
->modem.xmm.bb_on;
<API key>[2].gpio = <API key>
->modem.xmm.ipc_bb_wake;
<API key>[3].gpio = <API key>
->modem.xmm.ipc_ap_wake;
<API key>[4].gpio = <API key>
->modem.xmm.ipc_hsic_active;
<API key>[5].gpio = <API key>
->modem.xmm.ipc_hsic_sus_req;
<API key>[6].gpio = <API key>
->modem.xmm.bb_vdd_en;
<API key>[7].gpio = <API key>
->modem.xmm.bb_rst_pwrdn;
<API key>[8].gpio = <API key>
->modem.xmm.bb_rst2;
//request UART
pr_info("%s request UART\n", __func__);
err =gpio_request(TEGRA_GPIO_PJ7, "IMC_UART_TX");
err =gpio_request(TEGRA_GPIO_PK7, "IMC_UART_RTS");
err =gpio_request(TEGRA_GPIO_PB0 ,"IMC_UART_RX");
err =gpio_request(TEGRA_GPIO_PB1, "IMC_UART_CTS");
pr_info("%s pull UART o d\n", __func__);
//for power consumation
//all the needed config put on power_on function
pr_info("%s <API key>\n", __func__);
err=<API key>();
if (err < 0) {
pr_err("%s - <API key> gpio(s)\n", __func__);
return -ENODEV;
}
#endif/*HTC*/
/* request baseband irq(s) */
if (modem_flash && modem_pm) {
pr_info("%s: request_irq IPC_AP_WAKE_IRQ\n", __func__);
ipc_ap_wake_state = IPC_AP_WAKE_UNINIT;
err = <API key>(
gpio_to_irq(data->modem.xmm.ipc_ap_wake),
<API key>,
NULL,
IRQF_TRIGGER_RISING | <API key>,
"IPC_AP_WAKE_IRQ",
NULL);
if (err < 0) {
pr_err("%s - request irq IPC_AP_WAKE_IRQ failed\n",
__func__);
return err;
}
ipc_ap_wake_state = <API key>;
if (modem_ver >= XMM_MODEM_VER_1130) {
pr_info("%s: ver > 1130: AP_WAKE_INIT1\n", __func__);
/* ver 1130 or later starts in INIT1 state */
ipc_ap_wake_state = IPC_AP_WAKE_INIT1;
}
}
/* init work queue */
workqueue = <API key>("<API key>");
if (!workqueue) {
pr_err("cannot create workqueue\n");
return -1;
}
workqueue_susp = alloc_workqueue("<API key>", WQ_UNBOUND | WQ_HIGHPRI | WQ_NON_REENTRANT, 1);
if (!workqueue_susp) {
pr_err("cannot create workqueue_susp\n");
return -1;
}
workqueue_debug = <API key>("<API key>");
if (!workqueue_debug) {
pr_err("cannot create workqueue_debug\n");
return -1;
}
<API key> = (struct <API key> *)
kmalloc(sizeof(struct <API key>), GFP_KERNEL);
if (!<API key>) {
pr_err("cannot allocate <API key>\n");
return -1;
}
INIT_WORK((struct work_struct *) <API key>,
<API key>);
<API key>->state = BBXMM_WORK_INIT;
queue_work(workqueue,
(struct work_struct *) <API key>);
/* init work objects */
INIT_WORK(&init1_work, <API key>);
INIT_WORK(&init2_work, <API key>);
INIT_WORK(&L2_resume_work, <API key>);
INIT_WORK(&work_shortsusp, <API key>);
INIT_WORK(&work_defaultsusp, <API key>);
INIT_WORK(&<API key>, <API key>);
/* init state variables */
<API key> = true;
CP_initiated_L2toL0 = false;
<API key> = BBXMM_PS_UNINIT;
spin_lock_irqsave(&xmm_lock, flags);
wakeup_pending = false;
system_suspending = false;
<API key>(&xmm_lock, flags);
usb_register_notify(&usb_xmm_nb);
<API key>(&<API key>);
/*HTC*/
/*set Radio fatal Pin PN2 to OutPut Low*/
ret=<API key>(TEGRA_GPIO_PN2,0);
if (ret < 0)
pr_err("%s: set Radio fatal Pin to Output error\n", __func__);
/*set BB2AP_SUSPEND_REQ Pin (TEGRA_GPIO_PV0) to OutPut Low*/
ret=<API key>(TEGRA_GPIO_PV0,0);
if (ret < 0)
pr_err("%s: set BB2AP_SUSPEND_REQ Pin to Output error\n", __func__);
//Request SIM det to wakeup Source wahtever in flight mode on/off
/*For SIM det*/
pr_info("%s: request enable irq wake SIM det to wakeup source\n", __func__);
ret = enable_irq_wake(gpio_to_irq(TEGRA_GPIO_PI5));
if (ret < 0)
pr_err("%s: enable_irq_wake error\n", __func__);
pr_info("%s: init kobj for silent reset", __func__);
silent_reset_kset = kset_create_and_add("SilentResetKset", NULL, NULL);
if(!silent_reset_kset)
{
pr_err("%s: silent_reset_kset create failure.", __func__);
}
else
{
silent_reset_kobj = <API key>("SilentResetTrigger", kobject_get(&dev->kobj));
if(!silent_reset_kobj)
{
pr_err("%s: silent_reset_kobj create failure.", __func__);
kset_unregister(silent_reset_kset);
silent_reset_kset = NULL;
}
else
silent_reset_kobj->kset = silent_reset_kset;
}
pr_info("%s }\n", __func__);
return 0;
}
static int <API key>(struct platform_device *device)
{
struct <API key> *data
= (struct <API key> *)
device->dev.platform_data;
struct device *dev = &device->dev;
pr_info("%s\n", __func__);
/* check for platform data */
if (!data)
return 0;
<API key>(&<API key>);
<API key>(&usb_xmm_nb);
/* free work structure */
kfree(<API key>);
<API key> = (struct <API key> *) 0;
/* free baseband irq(s) */
if (modem_flash && modem_pm) {
free_irq(gpio_to_irq(<API key>
->modem.xmm.ipc_ap_wake), NULL);
}
/* free baseband gpio(s) */
gpio_free_array(<API key>,
ARRAY_SIZE(<API key>));
/* destroy wake lock */
wake_lock_destroy(&wakelock);
/* delete device file */
device_remove_file(dev, &dev_attr_xmm_onoff);
device_remove_file(dev, &<API key>);
/* HTC: delete device file */
device_remove_file(dev, &dev_attr_host_dbg);
/* destroy wake lock */
destroy_workqueue(workqueue_susp);
destroy_workqueue(workqueue);
if(silent_reset_kset)
{
kset_unregister(silent_reset_kset);
silent_reset_kset = NULL;
}
if(silent_reset_kobj)
{
kobject_put(silent_reset_kobj);
kobject_put(&dev->kobj);
}
/* unregister usb host controller */
if (data->hsic_unregister && data->modem.xmm.hsic_device)
{
data->hsic_unregister(data->modem.xmm.hsic_device);
data->modem.xmm.hsic_device = NULL;
}
else
pr_err("%s: hsic_unregister is missing\n", __func__);
return 0;
}
#ifndef <API key>
static int <API key>(
struct <API key> *data)
{
int value;
unsigned long flags;
unsigned long timeout;
int delay = 10000; /* maxmum delay in msec */
//pr_info("%s\n", __func__);
/* check for platform data */
if (!data)
return 0;
/* check if modem is on */
if (power_onoff == 0) {
pr_info("%s - flight mode - nop\n", __func__);
return 0;
}
modem_sleep_flag = false;
spin_lock_irqsave(&xmm_lock, flags);
/* Clear wakeup pending flag */
wakeup_pending = false;
<API key>(&xmm_lock, flags);
/* L3->L0 */
<API key>(BBXMM_PS_L3TOL0);
value = gpio_get_value(data->modem.xmm.ipc_ap_wake);
if (value) {
pr_info("AP L3 -> L0\n");
pr_info("waiting for host wakeup...\n");
timeout = jiffies + msecs_to_jiffies(delay);
/* wake bb */
gpio_set_value(data->modem.xmm.ipc_bb_wake, 1);
pr_info("Set bb_wake high ->\n");
do {
udelay(100);
value = gpio_get_value(data->modem.xmm.ipc_ap_wake);
if (!value)
break;
} while (time_before(jiffies, timeout));
if (!value) {
pr_info("gpio host wakeup low <-\n");
pr_info("%s enable short_autosuspend\n", __func__);
short_autosuspend = true;
}
else
pr_info("!!AP L3->L0 Failed\n");
} else {
pr_info("CP L3 -> L0\n");
}
<API key> = true;
return 0;
}
#endif
#ifdef CONFIG_PM
#ifdef <API key>
static int <API key>(struct device *dev)
{
// int delay = 10000; /* maxmum delay in msec */
// struct platform_device *pdev = to_platform_device(dev);
//struct <API key> *pdata = pdev->dev.platform_data;
//pr_info("%s\n", __func__);
/* check if modem is on */
if (power_onoff == 0) {
pr_info("%s - flight mode - nop\n", __func__);
return 0;
}
/* PMC is driving hsic bus
* <API key>();
*/
return 0;
}
#else
static int <API key>(struct device *dev)
{
pr_info("%s\n", __func__);
return 0;
}
#endif /* <API key> */
static int <API key>(struct device *dev)
{
//struct platform_device *pdev = to_platform_device(dev);
//struct <API key> *data
// = (struct <API key> *)
// pdev->dev.platform_data;
pr_info("%s\n", __func__);
#ifdef <API key>
/* check if modem is on */
if (power_onoff == 0) {
pr_info("%s - flight mode - nop\n", __func__);
return 0;
}
/* PMC is driving hsic bus
* <API key>();
*/
<API key> = true;
#else
<API key>(data);
#endif
return 0;
}
static int <API key>(struct device *dev)
{
unsigned long flags;
pr_info("%s\n", __func__);
spin_lock_irqsave(&xmm_lock, flags);
system_suspending = false;
if (wakeup_pending) {
wakeup_pending = false;
<API key>(&xmm_lock, flags);
pr_info("%s:**Abort Suspend: reason CP WAKEUP**\n", __func__);
return -EBUSY;
}
<API key>(&xmm_lock, flags);
return 0;
}
static int <API key>(struct device *dev)
{
pr_info("%s\n", __func__);
return 0;
}
static const struct dev_pm_ops <API key> = {
.suspend_noirq = <API key>,
.resume_noirq = <API key>,
.suspend = <API key>,
.resume = <API key>,
};
#endif
static struct platform_driver <API key> = {
.probe = <API key>,
.remove = <API key>,
.driver = {
.name = "baseband_xmm_power",
#ifdef CONFIG_PM
.pm = &<API key>,
#endif
},
};
static int __init <API key>(void)
{
/* HTC */
int mfg_mode = board_mfg_mode();
host_dbg_flag = 0;
//pr_info("%s - host_dbg_flag<0x%x>, modem_ver<0x%x>, mfg_mode<%d>"
// , __func__, host_dbg_flag, modem_ver, mfg_mode);
if( mfg_mode )
{
autosuspend_delay = 365*86400;
<API key> = 365*86400;
//pr_info("In MFG mode, autosuspend_delay <%d>, <API key> <%d>"
// , autosuspend_delay, <API key> );
}
s_sku_id = board_get_sku_tag();
pr_info("SKU_ID is 0x%x", s_sku_id);
//printk("%s:VP adding pm qos request removed\n", __func__);
//pm_qos_add_request(&<API key>, PM_QOS_CPU_FREQ_MIN, (s32)<API key>);
return <API key>(&<API key>);
}
static void __exit <API key>(void)
{
pr_info("%s\n", __func__);
<API key>(&<API key>);
//<API key>(&<API key>);
}
module_init(<API key>)
module_exit(<API key>)
|
include ../../../Makefile.inc
CLC_ROOT = ../../../inc
all: exe_src exe_src_m2s exe_bin amd_compile m2c_compile run_m2s run_native check_result
exe_src:
@-$(CC) $(CC_FLAG) *src.c -o exe_src $(CC_INC) $(CC_LIB) > <API key>.exe_src.log 2>&1
exe_src_m2s:
@-$(CC) $(CC_FLAG) -m32 *src.c -o exe_src_m2s $(CC_INC) $(M2S_LIB) > <API key>.exe_src_m2s.log 2>&1
exe_bin:
@-$(CC) $(CC_FLAG) *bin.c -o exe_bin $(CC_INC) $(CC_LIB) > <API key>.exe_bin.log 2>&1
amd_compile:
@-$(AMD_CC) --amd --amd-dump-all --amd-device 11 <API key>.cl > <API key>.amdcc.log 2>&1
|
# coding=utf-8
# Ano: 2015
# Projeto: pagseguro_xml
# e-mail: asousas@live.com
import logging
from pagseguro_xml.notificacao import <API key>, CONST_v3
logger = logging.basicConfig(level=logging.DEBUG)
<API key> = u'sandbox'
PAGSEGURO_API_EMAIL = u'seu@email.com'
<API key> = u''
<API key> = u''
CHAVE_NOTIFICACAO = u'<API key>'
api = <API key>(ambiente=CONST_v3.AMBIENTE.SANDBOX)
PAGSEGURO_API_<API key>
ok, retorno = api.<API key>(PAGSEGURO_API_EMAIL, PAGSEGURO_API_TOKEN, CHAVE_NOTIFICACAO)
if ok:
print u'-' * 50
print retorno.xml
print u'-' * 50
for a in retorno.alertas:
print a
else:
print u'Motivo do erro:', retorno
|
<?php
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
* AWSTATS BROWSERS DATABASE
* If you want to add a Browser to extend AWStats database detection capabilities,
* you must add an entry in <API key> and in BrowsersHashIDLib.
*
*
* <API key>
* This list is used to know in which order to search Browsers IDs (Most
* frequent one are first in this list to increase detect speed).
* It contains all matching criteria to search for in log fields.
* Note: Browsers IDs are in lower case and ' ' and '+' are changed into '_'
*/
$browserSearchOrder = array (
// Most frequent standard web browsers are first in this list
"icab",
"go!zilla",
"konqueror",
"links",
"lynx",
"omniweb",
"opera",
"msie 6\.0",
"apachebench",
"wget",
// Other standard web browsers
"22acidownload",
"aol\\-iweng",
"amaya",
"amigavoyager",
"aweb",
"bpftp",
"chimera",
"cyberdog",
"dillo",
"dreamcast",
"downloadagent",
"ecatch",
"emailsiphon",
"encompass",
"friendlyspider",
"fresco",
"galeon",
"getright",
"headdump",
"hotjava",
"ibrowse",
"intergo",
"k-meleon",
"linemodebrowser",
"lotus-notes",
"macweb",
"multizilla",
"ncsa_mosaic",
"netpositive",
"nutscrape",
"msfrontpageexpress",
"phoenix",
"firebird",
"firefox",
"safari",
"tzgeturl",
"viking",
"webfetcher",
"webexplorer",
"webmirror",
"webvcr",
// Site grabbers
"teleport",
"webcapture",
"webcopier",
// Music only browsers
"real",
"winamp", // Works for winampmpeg and winamp3httprdr
"<API key>",
"audion",
"freeamp",
"itunes",
"jetaudio",
"mint_audio",
"mpg123",
"nsplayer",
"sonique",
"uplayer",
"xmms",
"xaudio",
// PDA/Phonecell browsers
"alcatel", // Alcatel
"mot-", // Motorola
"nokia", // Nokia
"panasonic", // Panasonic
"philips", // Philips
"sonyericsson", // SonyEricsson
"ericsson", // Ericsson (must be after sonyericsson
"mmef",
"mspie",
"wapalizer",
"wapsilon",
"webcollage",
"up\.", // Works for UP.Browser and UP.Link
// PDA/Phonecell I-Mode browsers
"docomo",
"portalmmm",
// Others (TV)
"webtv",
// Other kind of browsers
"csscheck",
"w3m",
"w3c_css_validator",
"w3c_validator",
"wdg_validator",
"webzip",
"staroffice",
"mozilla", // Must be at end because a lot of browsers contains mozilla in string
"libwww" // Must be at end because some browser have both "browser id" and "libwww"
);
$browsersAlias = array (
// Common web browsers text (IE and Netscape must not be in this list)
"icab"=>"iCab",
"go!zilla"=>"Go!Zilla",
"konqueror"=>"Konqueror",
"links"=>"Links",
"lynx"=>"Lynx",
"omniweb"=>"OmniWeb",
"opera"=>"Opera",
"msie 6\.0"=>"Microsoft Internet Explorer 6.0",
"apachebench"=>"ApacheBench",
"wget"=>"Wget",
"22acidownload"=>"22AciDownload",
"aol\\-iweng"=>"AOL-Iweng",
"amaya"=>"Amaya",
"amigavoyager"=>"AmigaVoyager",
"aweb"=>"AWeb",
"bpftp"=>"BPFTP",
"chimera"=>"Chimera",
"cyberdog"=>"Cyberdog",
"dillo"=>"Dillo",
"dreamcast"=>"Dreamcast",
"downloadagent"=>"DownloadAgent",
"ecatch", "eCatch",
"emailsiphon"=>"EmailSiphon",
"encompass"=>"Encompass",
"friendlyspider"=>"FriendlySpider",
"fresco"=>"ANT Fresco",
"galeon"=>"Galeon",
"getright"=>"GetRight",
"headdump"=>"HeadDump",
"hotjava"=>"Sun HotJava",
"ibrowse"=>"IBrowse",
"intergo"=>"InterGO",
"k-meleon"=>"K-Meleon",
"linemodebrowser"=>"W3C Line Mode Browser",
"lotus-notes"=>"Lotus Notes web client",
"macweb"=>"MacWeb",
"multizilla"=>"MultiZilla",
"ncsa_mosaic"=>"NCSA Mosaic",
"netpositive"=>"NetPositive",
"nutscrape", "Nutscrape",
"msfrontpageexpress"=>"MS FrontPage Express",
"phoenix"=>"Phoenix",
"firebird"=>"Mozilla Firebird",
"firefox"=>"Mozilla Firefox",
"safari"=>"Safari",
"tzgeturl"=>"TzGetURL",
"viking"=>"Viking",
"webfetcher"=>"WebFetcher",
"webexplorer"=>"IBM-WebExplorer",
"webmirror"=>"WebMirror",
"webvcr"=>"WebVCR",
// Site grabbers
"teleport"=>"TelePort Pro",
"webcapture"=>"Acrobat",
"webcopier", "WebCopier",
// Music only browsers
"real"=>"RealAudio or compatible (media player)",
"winamp"=>"WinAmp (media player)", // Works for winampmpeg and winamp3httprdr
"<API key>"=>"Windows Media Player (media player)",
"audion"=>"Audion (media player)",
"freeamp"=>"FreeAmp (media player)",
"itunes"=>"Apple iTunes (media player)",
"jetaudio"=>"JetAudio (media player)",
"mint_audio"=>"Mint Audio (media player)",
"mpg123"=>"mpg123 (media player)",
"nsplayer"=>"NetShow Player (media player)",
"sonique"=>"Sonique (media player)",
"uplayer"=>"Ultra Player (media player)",
"xmms"=>"XMMS (media player)",
"xaudio"=>"Some XAudio Engine based MPEG player (media player)",
// PDA/Phonecell browsers
"alcatel"=>"Alcatel Browser (PDA/Phone browser)",
"ericsson"=>"Ericsson Browser (PDA/Phone browser)",
"mot-"=>"Motorola Browser (PDA/Phone browser)",
"nokia"=>"Nokia Browser (PDA/Phone browser)",
"panasonic"=>"Panasonic Browser (PDA/Phone browser)",
"philips"=>"Philips Browser (PDA/Phone browser)",
"sonyericsson"=>"Sony/Ericsson Browser (PDA/Phone browser)",
"mmef"=>"Microsoft Mobile Explorer (PDA/Phone browser)",
"mspie"=>"MS Pocket Internet Explorer (PDA/Phone browser)",
"wapalizer"=>"WAPalizer (PDA/Phone browser)",
"wapsilon"=>"WAPsilon (PDA/Phone browser)",
"webcollage"=>"WebCollage (PDA/Phone browser)",
"up\."=>"UP.Browser (PDA/Phone browser)", // Works for UP.Browser and UP.Link
// PDA/Phonecell I-Mode browsers
"docomo"=>"I-Mode phone (PDA/Phone browser)",
"portalmmm"=>"I-Mode phone (PDA/Phone browser)",
// Others (TV)
"webtv"=>"WebTV browser",
// Other kind of browsers
"csscheck"=>"WDG CSS Validator",
"w3m"=>"w3m",
"w3c_css_validator"=>"W3C CSS Validator",
"w3c_validator"=>"W3C HTML Validator",
"wdg_validator"=>"WDG HTML Validator",
"webzip"=>"WebZIP",
"staroffice"=>"StarOffice",
"mozilla"=>"Mozilla",
"libwww"=>"LibWWW",
);
// <API key>
// Put here an entry for each browser in <API key> that are grabber
// browsers.
$<API key> = array (
"teleport"=>"1",
"webcapture"=>"1",
"webcopier"=>"1",
);
// BrowsersHashIcon
// Each Browsers Search ID is associated to a string that is the name of icon
// file for this browser.
$BrowsersHashIcon = array (
// Standard web browsers
"msie"=>"msie",
"netscape"=>"netscape",
"icab"=>"icab",
"go!zilla"=>"gozilla",
"konqueror"=>"konqueror",
"links"=>"notavailable",
"lynx"=>"lynx",
"omniweb"=>"omniweb",
"opera"=>"opera",
"wget"=>"notavailable",
"22acidownload"=>"notavailable",
"aol\\-iweng"=>"notavailable",
"amaya"=>"amaya",
"amigavoyager"=>"notavailable",
"aweb"=>"notavailable",
"bpftp"=>"notavailable",
"chimera"=>"chimera",
"cyberdog"=>"notavailable",
"dillo"=>"notavailable",
"dreamcast"=>"dreamcast",
"downloadagent"=>"notavailable",
"ecatch"=>"notavailable",
"emailsiphon"=>"notavailable",
"encompass"=>"notavailable",
"friendlyspider"=>"notavailable",
"fresco"=>"notavailable",
"galeon"=>"galeon",
"getright"=>"getright",
"headdump"=>"notavailable",
"hotjava"=>"notavailable",
"ibrowse"=>"ibrowse",
"intergo"=>"notavailable",
"k-meleon"=>"kmeleon",
"linemodebrowser"=>"notavailable",
"lotus-notes"=>"notavailable",
"macweb"=>"notavailable",
"multizilla"=>"multizilla",
"ncsa_mosaic"=>"notavailable",
"netpositive"=>"netpositive",
"nutscrape"=>"notavailable",
"msfrontpageexpress"=>"notavailable",
"phoenix"=>"phoenix",
"firebird"=>"firebird",
"safari"=>"safari",
"tzgeturl"=>"notavailable",
"viking"=>"notavailable",
"webfetcher"=>"notavailable",
"webexplorer"=>"notavailable",
"webmirror"=>"notavailable",
"webvcr"=>"notavailable",
// Site grabbers
"teleport"=>"teleport",
"webcapture"=>"adobe",
"webcopier"=>"webcopier",
// Music only browsers
"real"=>"mediaplayer",
"winamp"=>"mediaplayer", // Works for winampmpeg and winamp3httprdr
"<API key>"=>"mediaplayer",
"audion"=>"mediaplayer",
"freeamp"=>"mediaplayer",
"itunes"=>"mediaplayer",
"jetaudio"=>"mediaplayer",
"mint_audio"=>"mediaplayer",
"mpg123"=>"mediaplayer",
"nsplayer"=>"mediaplayer",
"sonique"=>"mediaplayer",
"uplayer"=>"mediaplayer",
"xmms"=>"mediaplayer",
"xaudio"=>"mediaplayer",
// PDA/Phonecell browsers
"alcatel"=>"pdaphone", // Alcatel
"ericsson"=>"pdaphone", // Ericsson
"mot-"=>"pdaphone", // Motorola
"nokia"=>"pdaphone", // Nokia
"panasonic"=>"pdaphone", // Panasonic
"philips"=>"pdaphone", // Philips
"sonyericsson"=>"pdaphone", // Sony/Ericsson
"mmef"=>"pdaphone",
"mspie"=>"pdaphone",
"wapalizer"=>"pdaphone",
"wapsilon"=>"pdaphone",
"webcollage"=>"pdaphone",
"up\."=>"pdaphone", // Works for UP.Browser and UP.Link
// PDA/Phonecell I-Mode browsers
"docomo"=>"pdaphone",
"portalmmm"=>"pdaphone",
// Others (TV)
"webtv"=>"webtv",
// Other kind of browsers
"csscheck"=>"notavailable",
"w3m"=>"notavailable",
"w3c_css_validator"=>"notavailable",
"w3c_validator"=>"notavailable",
"wdg_validator"=>"notavailable",
"webzip"=>"webzip",
"staroffice"=>"staroffice",
"mozilla"=>"mozilla",
"libwww"=>"notavailable"
);
// TODO
// Add Gecko category -> IE / Netscape / Gecko(except Netscape) / Other
// IE (based on Mosaic)
// Netscape family
// Gecko except Netscape (Mozilla, Firebird (was Phoenix), Galeon, AmiZilla, Dino, and few others)
// Opera (Opera 6/7)
// KHTML (Konqueror, Safari)
?>
|
<style type="text/css">
.<API key> {
width: 56%;
float: left;
}
.<API key> {
width: <?php echo (empty($this-><API key>) ? 100 : 40)?>%;
float: left;
text-align: center;
}
#ppsMainOccupancy {
box-shadow: none !important;
}
</style>
<section>
<div class="supsystic-item supsystic-panel">
<div id="containerWrapper">
<?php _e('Main page Go here!!!!', PPS_LANG_CODE)?>
</div>
<div style="clear: both;"></div>
</div>
</section>
|
#ifndef <API key>
#define <API key>
#include "ifcfg.h"
#include "zshmem.h"
#include "cfg.h"
#include "stats.h"
#endif
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc on Sat Aug 06 17:04:40 EDT 2005 -->
<TITLE>
Xalan-Java 2.7.0: Uses of Class org.apache.xml.serializer.utils.SystemIDResolver
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<A NAME="navbar_top"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/xml/serializer/utils/SystemIDResolver.html"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="SystemIDResolver.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.xml.serializer.utils.SystemIDResolver</B></H2>
</CENTER>
No usage of org.apache.xml.serializer.utils.SystemIDResolver
<P>
<HR>
<A NAME="navbar_bottom"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/xml/serializer/utils/SystemIDResolver.html"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="SystemIDResolver.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<HR>
Copyright © 2005 Apache XML Project. All Rights Reserved.
</BODY>
</HTML>
|
/* ScriptData
SDName: Npc_Taxi
SD%Complete: 0%
SDComment: To be used for taxi NPCs that are located globally.
SDCategory: NPCs
EndScriptData
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
#include "WorldSession.h"
#define GOSSIP_SUSURRUS "I am ready."
#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!"
#define GOSSIP_BRAZEN "I am ready to go to Durnholde Keep."
#define GOSSIP_IRONWING "I'd like to take a flight around Stormwind Harbor."
#define GOSSIP_DABIREE1 "Fly me to Murketh and Shaadraz Gateways"
#define GOSSIP_DABIREE2 "Fly me to Shatter Point"
#define GOSSIP_WINDBELLOW1 "Fly me to The Abyssal Shelf"
#define GOSSIP_WINDBELLOW2 "Fly me to Honor Point"
#define GOSSIP_BRACK1 "Fly me to Murketh and Shaadraz Gateways"
#define GOSSIP_BRACK2 "Fly me to The Abyssal Shelf"
#define GOSSIP_BRACK3 "Fly me to Spinebreaker Post"
#define GOSSIP_IRENA "Fly me to Skettis please"
#define <API key> "Speaking of action, I've been ordered to undertake an air strike."
#define <API key> "I need to intercept the Dawnblade reinforcements."
#define GOSSIP_DRAGONHAWK "<Ride the dragonhawk to Sun's Reach>"
#define GOSSIP_VERONIA "Fly me to Manaforge Coruu please"
#define GOSSIP_DEESAK "Fly me to Ogri'la please"
#define <API key> "I would like to take a flight to the ground, Lord Of Afrasastrasz."
#define <API key> "My Lord, I must go to the upper floor of the temple."
#define <API key> "My Lord, I must go to the upper floor of the temple."
#define <API key> "Can you spare a drake to travel to Lord Of Afrasastrasz, in the middle of the temple?"
#define GOSSIP_TORASTRASZA1 "I would like to see Lord Of Afrasastrasz, in the middle of the temple."
#define GOSSIP_TORASTRASZA2 "Yes, Please. I would like to return to the ground floor of the temple."
#define GOSSIP_CRIMSONWING "<Ride the gryphons to Survey Alcaz Island>"
#define <API key> "Take me to Northpass Tower."
#define <API key> "Take me to Eastwall Tower."
#define <API key> "Take me to Crown Guard Tower."
class npc_taxi : public CreatureScript
{
public:
npc_taxi() : CreatureScript("npc_taxi") { }
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
switch (creature->GetEntry())
{
case 17435: // Azuremyst Isle - Susurrus
if (player->HasItemCount(23843, 1, true))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, <API key>);
break;
case 20903: // Netherstorm - Protectorate Nether Drake
if (player->GetQuestStatus(10438) == <API key> && player->HasItemCount(29778))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, <API key> + 1);
break;
case 18725: // Old Hillsbrad Foothills - Brazen
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRAZEN, GOSSIP_SENDER_MAIN, <API key> + 2);
break;
case 29154: // Stormwind City - Thargold Ironwing
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRONWING, GOSSIP_SENDER_MAIN, <API key> + 3);
break;
case 19409: // Hellfire Peninsula - Wing Commander Dabir'ee
//Mission: The Murketh and Shaadraz Gateways
if (player->GetQuestStatus(10146) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE1, GOSSIP_SENDER_MAIN, <API key> + 4);
//Shatter Point
if (!player-><API key>(10340))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE2, GOSSIP_SENDER_MAIN, <API key> + 5);
break;
case 20235: // Hellfire Peninsula - Gryphoneer Windbellow
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
if (player->GetQuestStatus(10163) == <API key> || player->GetQuestStatus(10346) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW1, GOSSIP_SENDER_MAIN, <API key> + 6);
//Go to the Front
if (player->GetQuestStatus(10382) != QUEST_STATUS_NONE && !player-><API key>(10382))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW2, GOSSIP_SENDER_MAIN, <API key> + 7);
break;
case 19401: // Hellfire Peninsula - Wing Commander Brack
//Mission: The Murketh and Shaadraz Gateways
if (player->GetQuestStatus(10129) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK1, GOSSIP_SENDER_MAIN, <API key> + 8);
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
if (player->GetQuestStatus(10162) == <API key> || player->GetQuestStatus(10347) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK2, GOSSIP_SENDER_MAIN, <API key> + 9);
//Spinebreaker Post
if (player->GetQuestStatus(10242) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK3, GOSSIP_SENDER_MAIN, <API key> + 10);
break;
case 23413: // Blade's Edge Mountains - Skyguard Handler Irena
if (player->GetReputationRank(1031) >= REP_HONORED)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRENA, GOSSIP_SENDER_MAIN, <API key> + 11);
break;
case 25059: // Isle of Quel'Danas - Ayren Cloudbreaker
if (player->GetQuestStatus(11532) == <API key> || player->GetQuestStatus(11533) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 12);
if (player->GetQuestStatus(11542) == <API key> || player->GetQuestStatus(11543) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 13);
break;
case 25236: // Isle of Quel'Danas - Unrestrained Dragonhawk
if (player->GetQuestStatus(11542) == <API key> || player->GetQuestStatus(11543) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DRAGONHAWK, GOSSIP_SENDER_MAIN, <API key> + 14);
break;
case 20162: // Netherstorm - Veronia
//Behind Enemy Lines
if (player->GetQuestStatus(10652) != <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VERONIA, GOSSIP_SENDER_MAIN, <API key> + 15);
break;
case 23415: // Terokkar Forest - Skyguard Handler Deesak
if (player->GetReputationRank(1031) >= REP_HONORED)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEESAK, GOSSIP_SENDER_MAIN, <API key> + 16);
break;
case 27575: // Dragonblight - Lord Afrasastrasz
// middle -> ground
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 17);
// middle -> top
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 18);
break;
case 26443: // Dragonblight - Tariolstrasz //need to check if quests are required before gossip available (12123, 12124)
// ground -> top
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 19);
// ground -> middle
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 20);
break;
case 26949: // Dragonblight - Torastrasza
// top -> middle
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA1, GOSSIP_SENDER_MAIN, <API key> + 21);
// top -> ground
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA2, GOSSIP_SENDER_MAIN, <API key> + 22);
break;
case 23704: // Dustwallow Marsh - Cassa Crimsonwing
if (player->GetQuestStatus(11142) == <API key>)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING, GOSSIP_SENDER_MAIN, <API key>+25);
break;
case 17209:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 28);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 29);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, <API key>, GOSSIP_SENDER_MAIN, <API key> + 30);
break;
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
case <API key>:
//spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506.
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 32474, true);
break;
case <API key> + 1:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155))
break;
case <API key> + 2:
if (!player->HasItemCount(25853))
player->SEND_GOSSIP_MENU(9780, creature->GetGUID());
else
{
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(534); //TaxiPath 534
}
break;
case <API key> + 3:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 53335, true); //TaxiPath 1041 (Stormwind Harbor)
break;
case <API key> + 4:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 33768, true); //TaxiPath 585 (Gateways Murket and Shaadraz)
break;
case <API key> + 5:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 35069, true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point)
break;
case <API key> + 6:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 33899, true); //TaxiPath 589 (Aerial Assault Flight (Alliance))
break;
case <API key> + 7:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 35065, true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head)
break;
case <API key> + 8:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 33659, true); //TaxiPath 584 (Gateways Murket and Shaadraz)
break;
case <API key> + 9:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 33825, true); //TaxiPath 587 (Aerial Assault Flight (Horde))
break;
case <API key> + 10:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 34578, true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
break;
case <API key> + 11:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 41278, true); //TaxiPath 706
break;
case <API key> + 12:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 45071, true); //TaxiPath 779
break;
case <API key> + 13:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 45113, true); //TaxiPath 784
break;
case <API key> + 14:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 45353, true); //TaxiPath 788
break;
case <API key> + 15:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 34905, true); //TaxiPath 606
break;
case <API key> + 16:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 41279, true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost)
break;
case <API key> + 17:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(882);
break;
case <API key> + 18:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(881);
break;
case <API key> + 19:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(878);
break;
case <API key> + 20:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(883);
break;
case <API key> + 21:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(880);
break;
case <API key> + 22:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(879);
break;
case <API key> + 23:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 43074, true); //TaxiPath 736
break;
case <API key> + 24:
player->CLOSE_GOSSIP_MENU();
//player->ActivateTaxiPathTo(738);
player->CastSpell(player, 43136, false);
break;
case <API key> + 25:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 42295, true);
break;
case <API key> + 26:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(494);
break;
case <API key> + 27:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(495);
break;
case <API key> + 28:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(496);
break;
}
return true;
}
};
void AddSC_npc_taxi()
{
new npc_taxi;
}
|
#include "ScriptEditorWidget.h"
#include <QBoxLayout>
#include <QLineEdit>
#include <QSplitter>
#include <QTextEdit>
#include "ScriptHighlighter.h"
const char* <API key> = "script text";
namespace U2 {
ScriptEditorWidget::ScriptEditorWidget(QWidget* parent, ScriptEditorType typeOfField)
: QWidget(parent) {
scriptContainer = new QSplitter(Qt::Vertical, this);
scriptContainer->setFocusPolicy(Qt::NoFocus);
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom, this);
layout->setMargin(0);
layout->addWidget(scriptContainer);
variablesEdit = new QTextEdit(scriptContainer);
variablesEdit->setReadOnly(true);
new ScriptHighlighter(variablesEdit->document());
scriptEdit = <API key>::createInstance(scriptContainer, typeOfField);
scriptEdit-><API key>();
connect(scriptEdit, SIGNAL(si_textChanged()), SIGNAL(si_textChanged()));
connect(scriptEdit, SIGNAL(<API key>()), SIGNAL(<API key>()));
}
void ScriptEditorWidget::setVariablesText(const QString& variablesText) {
variablesEdit->setText(variablesText);
}
QString ScriptEditorWidget::variablesText() const {
return variablesEdit->toPlainText();
}
void ScriptEditorWidget::setScriptText(const QString& text) {
scriptEdit->setText(text);
}
QString ScriptEditorWidget::scriptText() const {
return scriptEdit->text();
}
int ScriptEditorWidget::<API key>() const {
return scriptEdit->cursorLineNumber();
}
} // namespace U2
|
YUI.add('dom-class', function(Y) {
var addClass, hasClass, removeClass;
Y.mix(Y.DOM, {
/**
* Determines whether a DOM element has the given className.
* @method hasClass
* @for DOM
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to search for
* @return {Boolean} Whether or not the element has the given class.
*/
hasClass: function(node, className) {
var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
return re.test(node.className);
},
/**
* Adds a class name to a given DOM element.
* @method addClass
* @for DOM
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to add to the class attribute
*/
addClass: function(node, className) {
if (!Y.DOM.hasClass(node, className)) { // skip if already present
node.className = Y.Lang.trim([node.className, className].join(' '));
}
},
/**
* Removes a class name from a given element.
* @method removeClass
* @for DOM
* @param {HTMLElement} element The DOM element.
* @param {String} className the class name to remove from the class attribute
*/
removeClass: function(node, className) {
if (className && hasClass(node, className)) {
node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\s+)' +
className + '(?:\\s+|$)'), ' '));
if ( hasClass(node, className) ) { // in case of multiple adjacent
removeClass(node, className);
}
}
},
/**
* Replace a class with another class for a given element.
* If no oldClassName is present, the newClassName is simply added.
* @method replaceClass
* @for DOM
* @param {HTMLElement} element The DOM element
* @param {String} oldClassName the class name to be replaced
* @param {String} newClassName the class name that will be replacing the old class name
*/
replaceClass: function(node, oldC, newC) {
//Y.log('replaceClass replacing ' + oldC + ' with ' + newC, 'info', 'Node');
removeClass(node, oldC);
addClass(node, newC);
},
/**
* If the className exists on the node it is removed, if it doesn't exist it is added.
* @method toggleClass
* @for DOM
* @param {HTMLElement} element The DOM element
* @param {String} className the class name to be toggled
* @param {Boolean} addClass optional boolean to indicate whether class
* should be added or removed regardless of current state
*/
toggleClass: function(node, className, force) {
var add = (force !== undefined) ? force :
!(hasClass(node, className));
if (add) {
addClass(node, className);
} else {
removeClass(node, className);
}
}
});
hasClass = Y.DOM.hasClass;
removeClass = Y.DOM.removeClass;
addClass = Y.DOM.addClass;
}, '3.7.3' ,{requires:['dom-core']});
|
import { Injectable } from '@angular/core';
import { of } from 'rxjs';
import { Resolve, <API key> } from '@angular/router';
import { catchError } from 'rxjs/operators';
import { CatalogoService } from './catalogo.service';
@Injectable()
export class <API key> implements Resolve<any> {
constructor(private catalogoService: CatalogoService) {}
resolve(snapshot: <API key>) {
const params = snapshot.queryParams;
return this.catalogoService.getModelo(params['id'])
.pipe(catchError((error) => of({error: error})));
}
}
|
package agaroyun.view;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ArrayList;
import javax.swing.JPanel;
import agaroyun.Model.GameObject;
import agaroyun.Model.Player;
/**
* draws GameObjects to panel
* @author varyok
* @version 1.0
*/
public class GamePanel extends JPanel {
private ArrayList<GameObject> gameObjects;
/**
* Keeps gameObjects ArrayList
* @param gameObjects
*/
public GamePanel(ArrayList<GameObject> gameObjects) {
this.gameObjects=gameObjects;
}
/**
* draws GameObjects to panel
*/
@Override
protected synchronized void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d=(Graphics2D)g;
for (GameObject gameObject : gameObjects) {
gameObject.draw(g2d);
}
}
}
|
package net.sf.memoranda.util;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import net.sf.memoranda.ui.AppFrame;
/* $Id: Context.java,v 1.3 2004/01/30 12:17:42 alexeya Exp $ */
public class Context {
public static LoadableProperties context = new LoadableProperties();
static {
CurrentStorage.get().restoreContext();
AppFrame.addExitListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CurrentStorage.get().storeContext();
}
});
}
public static Object get(Object key) {
return context.get(key);
}
public static void put(Object key, Object value) {
context.put(key, value);
}
}
|
## 1.8.0 (September 2015)
- New MATERIAL DESIGN theme
- Updated FILE TYPE ICONS
- Preview TXT files within the app
- COPY files & folders
- Preview the full file/folder name from the long press menu
- Set a file as FAVORITE (kept-in-sync) from the CONTEXT MENU
- Updated CONFLICT RESOLUTION dialog (wording)
- Images with TRANSPARENT background are previewed correctly
- Hidden files are not taken into account for enforcing or not the list VIEW
- Several bugs fixed
## 1.7.2 (July 2015)
- New navigation drawer
- Improved Passcode
- Automatic grid view just for folders full of images
- More characters allowed in file names
- Support for servers in same domain, different path
- Bugs fixed:
+ Frequent crashes in folder with several images
+ Sync error in servers with huge quota and external storage enable
+ Share by link error
+ Some other crashes and minor bugs
## 1.7.1 (April 2015)
- Share link even with password enforced by server
- Get the app ready for oc 8.1 servers
- Added option to create new folder in uploads from external apps
- Improved management of deleted users
- Bugs fixed
+ Fixed crash on Android 2.x devices
+ Improvements on uploads
## 1.7.0 (February 2015)
- Download full folders
- Grid view for images
- Remote thumbnails (OC Server 8.0+)
- Added number of files and folders at the end of the list
- "Open with" in contextual menu
- Downloads added to Media Provider
- Uploads:
+ Local thumbnails in section "Files"
+ Multiple selection in "Content from other apps" (Android 4.3+)
- Gallery:
+ proper handling of EXIF
+ obey sorting in the list of files
- Settings view updated
- Improved subjects in e-mails
- Bugs fixed
|
#ifndef <API key>
#define <API key>
#include <wx/string.h>
#include <wx/colour.h>
#include "utils/mixins.hh"
class Server;
const unsigned int SYNC_UNKNOWN = 0;
const unsigned int SYNC_SYNCED = 1;
const unsigned int SYNC_UNSYNCED = 2;
//! @brief Struct used to store a client's status.
struct UserStatus
{
enum RankContainer
{
RANK_1,
RANK_2,
RANK_3,
RANK_4,
RANK_5,
RANK_6,
RANK_7,
RANK_8
};
bool in_game;
bool away;
RankContainer rank;
bool moderator;
bool bot;
UserStatus(): in_game(false), away(false), rank(RANK_1), moderator(false), bot(false) {}
wxString GetDiffString ( const UserStatus& other ) const;
};
struct UserPosition
{
int x;
int y;
UserPosition(): x(-1), y(-1) {}
};
struct UserBattleStatus
{
//!!! when adding something to this struct, also modify User::UpdateBattleStatus() !!
// total 17 members here
int team;
int ally;
wxColour colour;
int color_index;
int handicap;
int side;
unsigned int sync;
bool spectator;
bool ready;
bool isfromdemo;
UserPosition pos; // for startpos = 4
// bot-only stuff
wxString owner;
wxString aishortname;
wxString airawname;
wxString aiversion;
int aitype;
// for nat holepunching
wxString ip;
unsigned int udpport;
wxString scriptPassword;
bool IsBot() const { return !aishortname.IsEmpty(); }
UserBattleStatus(): team(0),ally(0),colour(wxColour(0,0,0)),color_index(-1),handicap(0),side(0),sync(SYNC_UNKNOWN),spectator(false),ready(false), isfromdemo(false), aitype(-1), udpport(0) {}
bool operator == ( const UserBattleStatus& s ) const
{
return ( ( team == s.team ) && ( colour == s.colour ) && ( handicap == s.handicap ) && ( side == s.side ) && ( sync == s.sync ) && ( spectator == s.spectator ) && ( ready == s.ready ) && ( owner == s.owner ) && ( aishortname == s.aishortname ) && ( isfromdemo == s.isfromdemo ) && ( aitype == s.aitype ) );
}
bool operator != ( const UserBattleStatus& s ) const
{
return ( ( team != s.team ) || ( colour != s.colour ) || ( handicap != s.handicap ) || ( side != s.side ) || ( sync != s.sync ) || ( spectator != s.spectator ) || ( ready != s.ready ) || ( owner != s.owner ) || ( aishortname != s.aishortname ) || ( isfromdemo != s.isfromdemo ) || ( aitype != s.aitype ) );
}
};
class ChatPanel;
class Battle;
struct UiUserData {
UiUserData(): panel(0) {}
ChatPanel* panel;
};
//! parent class leaving out server related functionality
class CommonUser
{
public:
CommonUser(const wxString& nick, const wxString& country, const int& cpu)
: m_nick(wxString(nick)), m_country(wxString(country)), m_cpu(cpu) {}
virtual ~CommonUser(){}
const wxString& GetNick() const { return m_nick; }
virtual void SetNick( const wxString& nick ) { m_nick = nick; }
const wxString& GetCountry() const { return m_country; }
virtual void SetCountry( const wxString& country ) { m_country = country; }
int GetCpu() const { return m_cpu; }
void SetCpu( const int& cpu ) { m_cpu = cpu; }
const wxString& GetID() const { return m_id; }
void SetID( const wxString& id ) { m_id = id; }
UserStatus& Status() { return m_status; }
UserStatus GetStatus() const { return m_status; }
virtual void SetStatus( const UserStatus& status );
UserBattleStatus& BattleStatus() { return m_bstatus; }
UserBattleStatus GetBattleStatus() const { return m_bstatus; }
/** Read-only variant of BattleStatus() above.
*/
const UserBattleStatus&
BattleStatus() const {
return m_bstatus;
}
//void SetBattleStatus( const UserBattleStatus& status );/// dont use this to avoid overwriting data like ip and port, use following method.
void UpdateBattleStatus( const UserBattleStatus& status );
/* void SetUserData( void* userdata ) { m_data = userdata; }
void* GetUserData() { return m_data; }*/
bool Equals( const CommonUser& other ) const { return ( m_nick == other.GetNick() ); }
protected:
wxString m_nick;
wxString m_country;
wxString m_id;
int m_cpu;
UserStatus m_status;
UserBattleStatus m_bstatus;
//void* m_data;
};
//! Class containing all the information about a user
class User : public CommonUser
{
public:
mutable UiUserData uidata;
User( Server& serv );
User( const wxString& nick, Server& serv );
User( const wxString& nick, const wxString& country, const int& cpu, Server& serv);
User( const wxString& nick );
User( const wxString& nick, const wxString& country, const int& cpu );
User();
virtual ~User();
// User interface
Server& GetServer() const { return *m_serv; }
void Said( const wxString& message ) const;
void Say( const wxString& message ) const;
void DoAction( const wxString& message ) const;
Battle* GetBattle() const;
void SetBattle( Battle* battle );
void SendMyUserStatus() const;
void SetStatus( const UserStatus& status );
void SetCountry( const wxString& country );
bool ExecuteSayCommand( const wxString& cmd ) const;
static wxString GetRankName(UserStatus::RankContainer rank);
float GetBalanceRank();
UserStatus::RankContainer GetRank();
wxString GetClan();
int GetFlagIconIndex() const { return m_flagicon_idx; }
int GetRankIconIndex() const { return m_rankicon_idx; }
int GetStatusIconIndex() const { return m_statusicon_idx; }
//bool operator< ( const User& other ) const { return m_nick < other.GetNick() ; }
//User& operator= ( const User& other );
int GetSideiconIndex() const { return m_sideicon_idx; }
void SetSideiconIndex( const int idx ) { m_sideicon_idx = idx; }
protected:
// User variables
Server* m_serv;
Battle* m_battle;
int m_flagicon_idx;
int m_rankicon_idx;
int m_statusicon_idx;
int m_sideicon_idx;
//! copy-semantics?
};
#endif // <API key>
|
<?php
/**
* API module to allow users to watch a page
*
* @ingroup API
*/
class ApiWatch extends ApiBase {
public function __construct( $main, $action ) {
parent::__construct( $main, $action );
}
public function execute() {
$user = $this->getUser();
if ( !$user->isLoggedIn() ) {
$this->dieUsage( 'You must be logged-in to have a watchlist', 'notloggedin' );
}
$params = $this-><API key>();
$title = Title::newFromText( $params['title'] );
if ( !$title || $title->getNamespace() < 0 ) {
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
}
$res = array( 'title' => $title->getPrefixedText() );
if ( $params['unwatch'] ) {
$res['unwatched'] = '';
$res['message'] = wfMsgExt( 'removedwatchtext', array( 'parse' ), $title->getPrefixedText() );
$success = UnwatchAction::doUnwatch( $title, $user );
} else {
$res['watched'] = '';
$res['message'] = wfMsgExt( 'addedwatchtext', array( 'parse' ), $title->getPrefixedText() );
$success = WatchAction::doWatch( $title, $user );
}
if ( !$success ) {
$this->dieUsageMsg( 'hookaborted' );
}
$this->getResult()->addValue( null, $this->getModuleName(), $res );
}
public function mustBePosted() {
return true;
}
public function isWriteMode() {
return true;
}
public function needsToken() {
return true;
}
public function getTokenSalt() {
return 'watch';
}
public function getAllowedParams() {
return array(
'title' => array(
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
),
'unwatch' => false,
'token' => null,
);
}
public function getParamDescription() {
return array(
'title' => 'The page to (un)watch',
'unwatch' => 'If set the page will be unwatched rather than watched',
'token' => 'A token previously acquired via prop=info',
);
}
public function getDescription() {
return 'Add or remove a page from/to the current user\'s watchlist';
}
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
array( 'invalidtitle', 'title' ),
array( 'hookaborted' ),
) );
}
public function getExamples() {
return array(
'api.php?action=watch&title=Main_Page' => 'Watch the page "Main Page"',
'api.php?action=watch&title=Main_Page&unwatch=' => 'Unwatch the page "Main Page"',
);
}
public function getHelpUrls() {
return 'https:
}
public function getVersion() {
return __CLASS__ . ': $Id$';
}
}
|
/* $Id: sha.h 6172 2011-03-27 12:40:30Z cher $ */
#ifndef __SHA_H__
#define __SHA_H__ 1
/* This file is taken from textutils-2.1. Cher. */
#include "reuse_integral.h"
#include <stdio.h>
/* Structure to save state of computation between the single steps. */
struct sha_ctx
{
ruint32_t A;
ruint32_t B;
ruint32_t C;
ruint32_t D;
ruint32_t E;
ruint32_t total[2];
ruint32_t buflen;
char buffer[128];
};
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
void sha_process_block(const void *buffer, size_t len, struct sha_ctx *ctx);
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
void sha_process_bytes(const void *buffer, size_t len, struct sha_ctx *ctx);
/* Initialize structure containing state of computation. */
void sha_init_ctx(struct sha_ctx *ctx);
/* Process the remaining bytes in the buffer and put result from CTX
in first 20 bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *sha_finish_ctx(struct sha_ctx *ctx, void *resbuf);
/* Put result from CTX in first 20 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *sha_read_ctx(const struct sha_ctx *ctx, void *resbuf);
/* Compute SHA1 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 20 bytes
beginning at RESBLOCK. */
int sha_stream(FILE *stream, void *resblock);
/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
void *sha_buffer(const char *buffer, size_t len, void *resblock);
#endif /* __SHA_H__ */
|
#include "bvi.h"
#include "set.h"
extern struct BLOCK_ data_block[BLK_COUNT];
static int from_file = 0;
static FILE *ffp;
static char fbuf[256];
static char buf[64];
struct {
short r;
short g;
short b;
} original_colors[8];
struct {
short f;
short b;
} original_colorpairs[8];
struct param params[] = {
{"autowrite", "aw", FALSE, "", P_BOOL},
{"columns", "cm", 16, "", P_NUM},
{"errorbells", "eb", FALSE, "", P_BOOL},
{"ignorecase", "ic", FALSE, "", P_BOOL},
{"magic", "ma", TRUE, "", P_BOOL},
{"memmove", "mm", FALSE, "", P_BOOL},
{"offset", "of", 0, "", P_NUM},
{"readonly", "ro", FALSE, "", P_BOOL},
{"scroll", "scroll", 12, "", P_NUM},
{"showmode", "mo", TRUE, "", P_BOOL},
{"term", "term", 0, "", P_TEXT},
{"terse", "terse", FALSE, "", P_BOOL},
{"unixstyle", "us", FALSE, "", P_BOOL},
{"window", "window", 25, "", P_NUM},
{"wordlength", "wl", 4, "", P_NUM},
{"wrapscan", "ws", TRUE, "", P_BOOL},
{"", "", 0, "", 0,} /* end marker */
};
struct color colors[] = { /* RGB definitions and default value, if have no support of 256 colors */
{"background", "bg", 50, 50, 50, COLOR_BLACK},
{"addresses", "addr", 335, 506, 700, COLOR_BLUE},
{"hex", "hex", 600, 600, 600, COLOR_MAGENTA},
{"data", "data", 0, 800, 400, COLOR_GREEN},
{"error", "err", 999, 350, 0, COLOR_RED},
{"status", "stat", 255, 255, 255, COLOR_WHITE},
{"command", "comm", 255, 255, 255, COLOR_WHITE},
{"window", "win", 0, 800, 900, COLOR_YELLOW},
{"addrbg", "addrbg", 0, 0, 0, COLOR_CYAN},
{"", "", 0, 0, 0, 0} /* end marker */
};
int doset(arg)
char *arg; /* parameter string */
{
int i;
char *s;
int did_window = FALSE;
int state = TRUE; /* new state of boolean parms. */
char string[80];
if (arg == NULL) {
showparms(FALSE);
return 0;
}
if (!strcmp(arg, "all")) {
showparms(TRUE);
return 0;
}
if (!strncmp(arg, "no", 2)) {
state = FALSE;
arg += 2;
}
/* extract colors section */
if (!strncmp(arg, "color", 5)) {
arg = substr(arg, 6, -1);
for (i = 0; colors[i].fullname[0] != '\0'; i++) {
s = colors[i].fullname;
if (strncmp(arg, s, strlen(s)) == 0)
break;
s = colors[i].shortname;
if (strncmp(arg, s, strlen(s)) == 0)
break;
}
if (i == 0) {
emsg("Wrong color name!");
return 0;
} else {
colors[i].r = atoi(substr(arg, strlen(s) + 1, 3));
colors[i].g = atoi(substr(arg, strlen(s) + 5, 3));
colors[i].b = atoi(substr(arg, strlen(s) + 9, 3));
set_palette();
repaint();
}
return 0;
} else {
emsg(arg);
return 1;
}
for (i = 0; params[i].fullname[0] != '\0'; i++) {
s = params[i].fullname;
if (strncmp(arg, s, strlen(s)) == 0) /* matched full name */
break;
s = params[i].shortname;
if (strncmp(arg, s, strlen(s)) == 0) /* matched short name */
break;
}
if (params[i].fullname[0] != '\0') { /* found a match */
if (arg[strlen(s)] == '?') {
if (params[i].flags & P_BOOL)
sprintf(buf, " %s%s",
(params[i].nvalue ? " " : "no"),
params[i].fullname);
else if (params[i].flags & P_TEXT)
sprintf(buf, " %s=%s", params[i].fullname,
params[i].svalue);
else
sprintf(buf, " %s=%ld", params[i].fullname,
params[i].nvalue);
msg(buf);
return 0;
}
if (!strcmp(params[i].fullname, "term")) {
emsg("Can't change type of terminal from within bvi");
return 1;
}
if (params[i].flags & P_NUM) {
if ((i == P_LI) || (i == P_OF))
did_window++;
if (arg[strlen(s)] != '=' || state == FALSE) {
sprintf(string, "Option %s is not a toggle",
params[i].fullname);
emsg(string);
return 1;
} else {
s = arg + strlen(s) + 1;
if (*s == '0') {
params[i].nvalue = strtol(s, &s, 16);
} else {
params[i].nvalue = strtol(s, &s, 10);
}
params[i].flags |= P_CHANGED;
if (i == P_CM) {
if (((COLS - AnzAdd - 1) / 4) >=
P(P_CM)) {
COLUMNS_DATA = P(P_CM);
} else {
COLUMNS_DATA = P(P_CM) =
((COLS - AnzAdd - 1) / 4);
}
maxx = COLUMNS_DATA * 4 + AnzAdd + 1;
COLUMNS_HEX = COLUMNS_DATA * 3;
status = COLUMNS_HEX + COLUMNS_DATA - 17;
screen = COLUMNS_DATA * (maxy - 1);
did_window++;
stuffin("H"); /* set cursor at HOME */
}
}
} else { /* boolean */
if (arg[strlen(s)] == '=') {
emsg("Invalid set of boolean parameter");
return 1;
} else {
params[i].nvalue = state;
params[i].flags |= P_CHANGED;
}
}
} else {
emsg("No such option@- `set all' gives all option values");
return 1;
}
if (did_window) {
maxy = P(P_LI) - 1;
new_screen();
}
return 0;
}
/* show ALL parameters */
void showparms(all)
int all;
{
struct param *p;
int n;
n = 2;
msg("Parameters:\n");
for (p = ¶ms[0]; p->fullname[0] != '\0'; p++) {
if (!all && ((p->flags & P_CHANGED) == 0))
continue;
if (p->flags & P_BOOL)
sprintf(buf, " %s%s\n",
(p->nvalue ? " " : "no"), p->fullname);
else if (p->flags & P_TEXT)
sprintf(buf, " %s=%s\n", p->fullname, p->svalue);
else
sprintf(buf, " %s=%ld\n", p->fullname, p->nvalue);
msg(buf);
n++;
if (n == params[P_LI].nvalue) {
if (wait_return(FALSE))
return;
n = 1;
}
}
wait_return(TRUE);
}
void save_orig_palette()
{
int i;
for (i = 0; colors[i].fullname[0] != '\0'; i++) {
color_content(colors[i].short_value, &original_colors[i].r, &original_colors[i].g, &original_colors[i].b);
}
for (i = 1; i < 8; i++) {
pair_content(i, &original_colorpairs[i].f, &original_colorpairs[i].b);
}
}
void load_orig_palette()
{
int i;
for (i = 0; colors[i].fullname[0] != '\0'; i++) {
init_color(colors[i].short_value, original_colors[i].r, original_colors[i].g, original_colors[i].b);
}
for (i = 1; i < 8; i++) {
init_pair(i, original_colorpairs[i].f, original_colorpairs[i].b);
}
}
void set_palette()
{
int i;
if (can_change_color()) {
for (i = 0; colors[i].fullname[0] != '\0'; i++) {
if (init_color
(colors[i].short_value, C_r(i), C_g(i),
C_b(i)) == ERR)
fprintf(stderr, "Failed to set [%d] color!\n",
i);
if (C_s(i) <= 7) {
init_pair(i + 1, C_s(i), C_s(0));
} else {
colors[i].short_value = COLOR_WHITE;
init_pair(i + 1, C_s(i), C_s(0));
}
}
init_pair(C_AD + 1, C_s(C_AD), COLOR_CYAN);
} else { /* if have no support of changing colors */
for (i = 0; colors[i].fullname[0] != '\0'; i++) {
if (C_s(i) <= 7) {
init_pair(i + 1, C_s(i), C_s(0));
} else {
colors[i].short_value = COLOR_WHITE;
init_pair(i + 1, C_s(i), C_s(0));
}
}
}
}
/* reads the init file (.bvirc) */
int read_rc(fn)
char *fn;
{
if ((ffp = fopen(fn, "r")) == NULL)
return -1;
from_file = 1;
while (fgets(fbuf, 255, ffp) != NULL) {
strtok(fbuf, "\n\r");
docmdline(fbuf);
}
fclose(ffp);
from_file = 0;
return 0;
}
int do_logic(mode, str)
int mode;
char *str;
{
int a, b;
int value;
size_t n;
char *err_str = "Invalid value@for bit manipulation";
if (mode == LSHIFT || mode == RSHIFT || mode == LROTATE
|| mode == RROTATE) {
value = atoi(str);
if (value < 1 || value > 8) {
emsg(err_str);
return 1;
}
} else {
if (strlen(str) == 8) {
value = strtol(str, NULL, 2);
for (n = 0; n < 8; n++) {
if (str[n] != '0' && str[n] != '1') {
value = -1;
break;
}
}
} else if (str[0] == 'b' || str[0] == 'B') {
value = strtol(str + 1, NULL, 2);
} else if (str[0] == '0') {
value = strtol(str, NULL, 16);
for (n = 0; n < strlen(str); n++) {
if (!isxdigit(str[n])) {
value = -1;
break;
}
}
} else {
value = atoi(str);
}
if (value < 0 || value > 255) {
emsg(err_str);
return 1;
}
}
if ((undo_count =
alloc_buf((off_t) (end_addr - start_addr + 1), &undo_buf))) {
memcpy(undo_buf, start_addr, undo_count);
}
undo_start = start_addr;
edits = U_EDIT;
while (start_addr <= end_addr) {
a = *start_addr;
a &= 0xff;
switch (mode) {
case LSHIFT:
a <<= value;
break;
case RSHIFT:
a >>= value;
break;
case LROTATE:
a <<= value;
b = a >> 8;
a |= b;
break;
case RROTATE:
b = a << 8;
a |= b;
a >>= value;
/*
b = a << (8 - value);
a >>= value;
a |= b;
*/
break;
case AND:
a &= value;
break;
case OR:
a |= value;
break;
case XOR:
case NOT:
a ^= value;
break;
case NEG:
a ^= value;
a++; /* Is this true */
break;
}
*start_addr++ = (char)(a & 0xff);
}
repaint();
return (0);
}
int do_logic_block(mode, str, block_number)
int mode;
char *str;
int block_number;
{
int a, b;
int value;
size_t n;
char *err_str = "Invalid value@for bit manipulation";
if ((block_number >= BLK_COUNT) & (!(data_block[block_number].pos_start < data_block[block_number].pos_end))) {
emsg("Invalid block for bit manipulation!");
return 1;
}
if (mode == LSHIFT || mode == RSHIFT || mode == LROTATE
|| mode == RROTATE) {
value = atoi(str);
if (value < 1 || value > 8) {
emsg(err_str);
return 1;
}
} else {
if (strlen(str) == 8) {
value = strtol(str, NULL, 2);
for (n = 0; n < 8; n++) {
if (str[n] != '0' && str[n] != '1') {
value = -1;
break;
}
}
} else if (str[0] == 'b' || str[0] == 'B') {
value = strtol(str + 1, NULL, 2);
} else if (str[0] == '0') {
value = strtol(str, NULL, 16);
for (n = 0; n < strlen(str); n++) {
if (!isxdigit(str[n])) {
value = -1;
break;
}
}
} else {
value = atoi(str);
}
if (value < 0 || value > 255) {
emsg(err_str);
return 1;
}
}
if ((undo_count =
alloc_buf((off_t) (data_block[block_number].pos_end -
data_block[block_number].pos_start + 1), &undo_buf))) {
memcpy(undo_buf, start_addr + data_block[block_number].pos_start, undo_count);
}
undo_start = start_addr + data_block[block_number].pos_start;
edits = U_EDIT;
start_addr = start_addr + data_block[block_number].pos_start;
end_addr = start_addr + data_block[block_number].pos_end - data_block[block_number].pos_start;
while (start_addr <= end_addr) {
a = *start_addr;
a &= 0xff;
switch (mode) {
case LSHIFT:
a <<= value;
break;
case RSHIFT:
a >>= value;
break;
case LROTATE:
a <<= value;
b = a >> 8;
a |= b;
break;
case RROTATE:
b = a << 8;
a |= b;
a >>= value;
/*
b = a << (8 - value);
a >>= value;
a |= b;
*/
break;
case AND:
a &= value;
break;
case OR:
a |= value;
break;
case XOR:
case NOT:
a ^= value;
break;
case NEG:
a ^= value;
a++; /* Is this true */
break;
}
*start_addr++ = (char)(a & 0xff);
}
repaint();
return (0);
}
int getcmdstr(p, x)
char *p;
int x;
{
int c;
int n;
char *buff, *q;
attron(COLOR_PAIR(C_CM + 1));
if (from_file) {
if (fgets(p, 255, ffp) != NULL) {
strtok(p, "\n\r");
return 0;
} else {
return 1;
}
}
signal(SIGINT, jmpproc);
buff = p;
move(maxy, x);
do {
switch (c = vgetc()) {
case BVICTRL('H'):
case KEY_BACKSPACE:
case KEY_LEFT:
if (p > buff) {
p
move(maxy, x);
n = x;
for (q = buff; q < p; q++) {
addch(*q);
n++;
}
addch(' ');
move(maxy, n);
} else {
*buff = '\0';
msg("");
attroff(COLOR_PAIR(C_CM + 1));
signal(SIGINT, SIG_IGN);
return 1;
}
break;
case ESC: /* abandon command */
*buff = '\0';
msg("");
attroff(COLOR_PAIR(C_CM + 1));
signal(SIGINT, SIG_IGN);
return 1;
#if NL != KEY_ENTER
case NL:
#endif
#if CR != KEY_ENTER
case CR:
#endif
case KEY_ENTER:
break;
default: /* a normal character */
addch(c);
*p++ = c;
break;
}
refresh();
} while (c != NL && c != CR && c != KEY_ENTER);
attroff(COLOR_PAIR(C_CM + 1));
*p = '\0';
signal(SIGINT, SIG_IGN);
return 0;
}
|
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
local lastSound = 0
function onThink()
if lastSound < os.time() then
lastSound = (os.time() + 5)
if math.random(100) < 25 then
Npc():say("Come into my tavern and share some stories!", TALKTYPE_SAY)
end
end
npcHandler:onThink()
end
npcHandler:setMessage(MESSAGE_GREET, "Welcome to Frodo's Hut. You heard about the {news}?")
npcHandler:setMessage(MESSAGE_FAREWELL, "Please come back from time to time.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Please come back from time to time.")
npcHandler:addModule(FocusModule:new())
|
#ifndef OBJ_FORMAT_H
#define OBJ_FORMAT_H
#define OBJ_COFF 1
#include "targ-cpu.h"
/* This internal_lineno crap is to stop namespace pollution from the
bfd internal coff headerfile. */
#define internal_lineno bfd_internal_lineno
#include "coff/internal.h"
#undef internal_lineno
/* CPU-specific setup: */
#ifdef TC_ARM
#include "coff/arm.h"
#ifndef TARGET_FORMAT
#define TARGET_FORMAT "coff-arm"
#endif
#endif
#ifdef TC_PPC
#ifdef TE_PE
#include "coff/powerpc.h"
#else
#include "coff/rs6000.h"
#endif
#endif
#ifdef TC_SPARC
#include "coff/sparc.h"
#endif
#ifdef TC_I386
#ifdef TE_PEP
#include "coff/x86_64.h"
#else
#include "coff/i386.h"
#endif
#ifndef TARGET_FORMAT
#ifdef TE_PEP
#define TARGET_FORMAT "coff-x86-64"
#else
#define TARGET_FORMAT "coff-i386"
#endif
#endif
#endif
#ifdef TC_M68K
#include "coff/m68k.h"
#ifndef TARGET_FORMAT
#define TARGET_FORMAT "coff-m68k"
#endif
#endif
#ifdef TC_OR32
#include "coff/or32.h"
#define TARGET_FORMAT "coff-or32-big"
#endif
#ifdef TC_I960
#include "coff/i960.h"
#define TARGET_FORMAT "coff-Intel-little"
#endif
#ifdef TC_Z80
#include "coff/z80.h"
#define TARGET_FORMAT "coff-z80"
#endif
#ifdef TC_Z8K
#include "coff/z8k.h"
#define TARGET_FORMAT "coff-z8k"
#endif
#ifdef TC_H8300
#include "coff/h8300.h"
#define TARGET_FORMAT "coff-h8300"
#endif
#ifdef TC_H8500
#include "coff/h8500.h"
#define TARGET_FORMAT "coff-h8500"
#endif
#ifdef TC_SH
#ifdef TE_PE
#define COFF_WITH_PE
#endif
#include "coff/sh.h"
#ifdef TE_PE
#define TARGET_FORMAT "pe-shl"
#else
#define TARGET_FORMAT \
(!target_big_endian \
? (sh_small ? "coff-shl-small" : "coff-shl") \
: (sh_small ? "coff-sh-small" : "coff-sh"))
#endif
#endif
#ifdef TC_MIPS
#define COFF_WITH_PE
#include "coff/mipspe.h"
#undef TARGET_FORMAT
#define TARGET_FORMAT "pe-mips"
#endif
#ifdef TC_TIC30
#include "coff/tic30.h"
#define TARGET_FORMAT "coff-tic30"
#endif
#ifdef TC_TIC4X
#include "coff/tic4x.h"
#define TARGET_FORMAT "coff2-tic4x"
#endif
#ifdef TC_TIC54X
#include "coff/tic54x.h"
#define TARGET_FORMAT "coff1-c54x"
#endif
#ifdef TC_TIC6X
#include "coff/tic6x.h"
//#define TARGET_FORMAT "coff2-c6x"
#endif
#ifdef TC_MCORE
#include "coff/mcore.h"
#ifndef TARGET_FORMAT
#define TARGET_FORMAT "pe-mcore"
#endif
#endif
#ifdef TE_PE
#define obj_set_weak_hook <API key>
#define obj_clear_weak_hook <API key>
#endif
#ifndef <API key>
#define <API key> 1
#endif
#define obj_symbol_new_hook <API key>
#define <API key> <API key>
#define obj_read_begin_hook <API key>
#include "bfd/libcoff.h"
#define OUTPUT_FLAVOR <API key>
/* Alter the field names, for now, until we've fixed up the other
references to use the new name. */
#ifdef TC_I960
#define TC_SYMFIELD_TYPE symbolS *
#define sy_tc bal
#endif
#define OBJ_SYMFIELD_TYPE unsigned long
#define sy_obj sy_obj_flags
/* We can't use the predefined section symbols in bfd/section.c, as
COFF symbols have extra fields. See bfd/libcoff.h:coff_symbol_type. */
#ifndef <API key>
#define <API key>(SEC) ((SEC)->owner != 0)
#endif
#define SYM_AUXENT(S) \
(&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent)
#define SYM_AUXINFO(S) \
(&coffsymbol (symbol_get_bfdsym (S))->native[1])
/* The number of auxiliary entries. */
#define <API key>(s) \
(coffsymbol (symbol_get_bfdsym (s))->native->u.syment.n_numaux)
/* The number of auxiliary entries. */
#define <API key>(s, v) (<API key> (s) = (v))
/* True if a symbol name is in the string table, i.e. its length is > 8. */
#define S_IS_STRING(s) (strlen (S_GET_NAME (s)) > 8 ? 1 : 0)
/* Auxiliary entry macros. SA_ stands for symbol auxiliary. */
/* Omit the tv related fields. */
/* Accessors. */
#define SA_GET_SYM_TAGNDX(s) (SYM_AUXENT (s)->x_sym.x_tagndx.l)
#define SA_GET_SYM_LNNO(s) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_lnno)
#define SA_GET_SYM_SIZE(s) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_size)
#define SA_GET_SYM_FSIZE(s) (SYM_AUXENT (s)->x_sym.x_misc.x_fsize)
#define SA_GET_SYM_LNNOPTR(s) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_lnnoptr)
#define SA_GET_SYM_ENDNDX(s) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_endndx)
#define SA_GET_SYM_DIMEN(s,i) (SYM_AUXENT (s)->x_sym.x_fcnary.x_ary.x_dimen[(i)])
#define SA_GET_FILE_FNAME(s) (SYM_AUXENT (s)->x_file.x_fname)
#define SA_GET_SCN_SCNLEN(s) (SYM_AUXENT (s)->x_scn.x_scnlen)
#define SA_GET_SCN_NRELOC(s) (SYM_AUXENT (s)->x_scn.x_nreloc)
#define SA_GET_SCN_NLINNO(s) (SYM_AUXENT (s)->x_scn.x_nlinno)
#define SA_SET_SYM_LNNO(s,v) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_lnno = (v))
#define SA_SET_SYM_SIZE(s,v) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_size = (v))
#define SA_SET_SYM_FSIZE(s,v) (SYM_AUXENT (s)->x_sym.x_misc.x_fsize = (v))
#define SA_SET_SYM_LNNOPTR(s,v) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_lnnoptr = (v))
#define SA_SET_SYM_DIMEN(s,i,v) (SYM_AUXENT (s)->x_sym.x_fcnary.x_ary.x_dimen[(i)] = (v))
#define SA_SET_FILE_FNAME(s,v) strncpy (SYM_AUXENT (s)->x_file.x_fname, (v), FILNMLEN)
#define SA_SET_SCN_SCNLEN(s,v) (SYM_AUXENT (s)->x_scn.x_scnlen = (v))
#define SA_SET_SCN_NRELOC(s,v) (SYM_AUXENT (s)->x_scn.x_nreloc = (v))
#define SA_SET_SCN_NLINNO(s,v) (SYM_AUXENT (s)->x_scn.x_nlinno = (v))
/* Internal use only definitions. SF_ stands for symbol flags.
These values can be assigned to sy_symbol.ost_flags field of a symbolS.
You'll break i960 if you shift the SYSPROC bits anywhere else. for
more on the balname/callname hack, see tc-i960.h. b.out is done
differently. */
#define SF_I960_MASK 0x000001ff /* Bits 0-8 are used by the i960 port. */
#define SF_SYSPROC 0x0000003f /* bits 0-5 are used to store the sysproc number. */
#define SF_IS_SYSPROC 0x00000040 /* bit 6 marks symbols that are sysprocs. */
#define SF_BALNAME 0x00000080 /* bit 7 marks BALNAME symbols. */
#define SF_CALLNAME 0x00000100 /* bit 8 marks CALLNAME symbols. */
#define SF_NORMAL_MASK 0x0000ffff /* bits 12-15 are general purpose. */
#define SF_STATICS 0x00001000 /* Mark the .text & all symbols. */
#define SF_DEFINED 0x00002000 /* Symbol is defined in this file. */
#define SF_STRING 0x00004000 /* Symbol name length > 8. */
#define SF_LOCAL 0x00008000 /* Symbol must not be emitted. */
#define SF_DEBUG_MASK 0xffff0000 /* bits 16-31 are debug info. */
#define SF_FUNCTION 0x00010000 /* The symbol is a function. */
#define SF_PROCESS 0x00020000 /* Process symbol before write. */
#define SF_TAGGED 0x00040000 /* Is associated with a tag. */
#define SF_TAG 0x00080000 /* Is a tag. */
#define SF_DEBUG 0x00100000 /* Is in debug or abs section. */
#define SF_GET_SEGMENT 0x00200000 /* Get the section of the forward symbol. */
/* All other bits are unused. */
/* Accessors. */
#define SF_GET(s) (* symbol_get_obj (s))
#define SF_GET_DEBUG(s) (symbol_get_bfdsym (s)->flags & BSF_DEBUGGING)
#define SF_SET_DEBUG(s) (symbol_get_bfdsym (s)->flags |= BSF_DEBUGGING)
#define SF_GET_NORMAL_FIELD(s) (SF_GET (s) & SF_NORMAL_MASK)
#define SF_GET_DEBUG_FIELD(s) (SF_GET (s) & SF_DEBUG_MASK)
#define SF_GET_FILE(s) (SF_GET (s) & SF_FILE)
#define SF_GET_STATICS(s) (SF_GET (s) & SF_STATICS)
#define SF_GET_DEFINED(s) (SF_GET (s) & SF_DEFINED)
#define SF_GET_STRING(s) (SF_GET (s) & SF_STRING)
#define SF_GET_LOCAL(s) (SF_GET (s) & SF_LOCAL)
#define SF_GET_FUNCTION(s) (SF_GET (s) & SF_FUNCTION)
#define SF_GET_PROCESS(s) (SF_GET (s) & SF_PROCESS)
#define SF_GET_TAGGED(s) (SF_GET (s) & SF_TAGGED)
#define SF_GET_TAG(s) (SF_GET (s) & SF_TAG)
#define SF_GET_GET_SEGMENT(s) (SF_GET (s) & SF_GET_SEGMENT)
#define SF_GET_I960(s) (SF_GET (s) & SF_I960_MASK) /* Used by i960. */
#define SF_GET_BALNAME(s) (SF_GET (s) & SF_BALNAME) /* Used by i960. */
#define SF_GET_CALLNAME(s) (SF_GET (s) & SF_CALLNAME) /* Used by i960. */
#define SF_GET_IS_SYSPROC(s) (SF_GET (s) & SF_IS_SYSPROC) /* Used by i960. */
#define SF_GET_SYSPROC(s) (SF_GET (s) & SF_SYSPROC) /* Used by i960. */
/* Modifiers. */
#define SF_SET(s,v) (SF_GET (s) = (v))
#define SF_SET_NORMAL_FIELD(s,v)(SF_GET (s) |= ((v) & SF_NORMAL_MASK))
#define SF_SET_DEBUG_FIELD(s,v) (SF_GET (s) |= ((v) & SF_DEBUG_MASK))
#define SF_SET_FILE(s) (SF_GET (s) |= SF_FILE)
#define SF_SET_STATICS(s) (SF_GET (s) |= SF_STATICS)
#define SF_SET_DEFINED(s) (SF_GET (s) |= SF_DEFINED)
#define SF_SET_STRING(s) (SF_GET (s) |= SF_STRING)
#define SF_SET_LOCAL(s) (SF_GET (s) |= SF_LOCAL)
#define SF_CLEAR_LOCAL(s) (SF_GET (s) &= ~SF_LOCAL)
#define SF_SET_FUNCTION(s) (SF_GET (s) |= SF_FUNCTION)
#define SF_SET_PROCESS(s) (SF_GET (s) |= SF_PROCESS)
#define SF_SET_TAGGED(s) (SF_GET (s) |= SF_TAGGED)
#define SF_SET_TAG(s) (SF_GET (s) |= SF_TAG)
#define SF_SET_GET_SEGMENT(s) (SF_GET (s) |= SF_GET_SEGMENT)
#define SF_SET_I960(s,v) (SF_GET (s) |= ((v) & SF_I960_MASK)) /* Used by i960. */
#define SF_SET_BALNAME(s) (SF_GET (s) |= SF_BALNAME) /* Used by i960. */
#define SF_SET_CALLNAME(s) (SF_GET (s) |= SF_CALLNAME) /* Used by i960. */
#define SF_SET_IS_SYSPROC(s) (SF_GET (s) |= SF_IS_SYSPROC) /* Used by i960. */
#define SF_SET_SYSPROC(s,v) (SF_GET (s) |= ((v) & SF_SYSPROC)) /* Used by i960. */
/* Line number handling. */
extern int text_lineno_number;
extern int coff_line_base;
extern int coff_n_line_nos;
extern symbolS *coff_last_function;
#define obj_emit_lineno(WHERE, LINE, FILE_START) abort ()
#define obj_app_file(name, app) c_dot_file_symbol (name, app)
#define obj_frob_symbol(S,P) coff_frob_symbol (S, & P)
#define obj_frob_section(S) coff_frob_section (S)
#define <API key>() <API key> ()
#ifndef obj_adjust_symtab
#define obj_adjust_symtab() coff_adjust_symtab ()
#endif
/* Forward the segment of a forwarded symbol, handle assignments that
just copy symbol values, etc. */
#ifndef <API key>
#ifndef TE_I386AIX
#define <API key>(dest, src) \
(SF_GET_GET_SEGMENT (dest) \
? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \
: 0)
#else
#define <API key>(dest, src) \
(SF_GET_GET_SEGMENT (dest) && S_GET_SEGMENT (dest) == SEG_UNKNOWN \
? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \
: 0)
#endif
#endif
/* Sanity check. */
#ifdef TC_I960
#ifndef C_LEAFSTAT
hey ! Where is the C_LEAFSTAT definition ? i960 - coff support is depending on it.
#endif /* no C_LEAFSTAT */
#endif /* TC_I960 */
extern const pseudo_typeS coff_pseudo_table[];
#ifndef obj_pop_insert
#define obj_pop_insert() pop_insert (coff_pseudo_table)
#endif
/* In COFF, if a symbol is defined using .def/.val SYM/.endef, it's OK
to redefine the symbol later on. This can happen if C symbols use
a prefix, and a symbol is defined both with and without the prefix,
as in start/_start/__start in gcc/libgcc1-test.c. */
#define <API key>(sym) \
(SF_GET_GET_SEGMENT (sym) \
? (sym->sy_frag = frag_now, \
S_SET_VALUE (sym, frag_now_fix ()), \
S_SET_SEGMENT (sym, now_seg), \
0) \
: 0)
/* Stabs in a coff file go into their own section. */
#define <API key> 1
/* We need 12 bytes at the start of the section to hold some initial
information. */
#define INIT_STAB_SECTION(seg) <API key> (seg)
/* Store the number of relocations in the section aux entry. */
#define SET_SECTION_RELOCS(sec, relocs, n) \
SA_SET_SCN_NRELOC (section_symbol (sec), n)
#define obj_app_file(name, app) c_dot_file_symbol (name, app)
extern int S_SET_DATA_TYPE (symbolS *, int);
extern int S_SET_STORAGE_CLASS (symbolS *, int);
extern int S_GET_STORAGE_CLASS (symbolS *);
extern void SA_SET_SYM_ENDNDX (symbolS *, symbolS *);
extern void coff_add_linesym (symbolS *);
extern void c_dot_file_symbol (const char *, int);
extern void coff_frob_symbol (symbolS *, int *);
extern void coff_adjust_symtab (void);
extern void coff_frob_section (segT);
extern void <API key> (bfd *, asection *, void *);
extern void <API key> (void);
extern void <API key> (symbolS *);
extern void <API key> (symbolS *, symbolS *);
extern void <API key> (void);
#ifdef TE_PE
extern void <API key> (symbolS *);
extern void <API key> (symbolS *);
#endif
extern void obj_coff_section (int);
extern segT <API key> (const char *);
extern void obj_coff_section (int);
extern void c_dot_file_symbol (const char *, int);
extern segT s_get_segment (symbolS *);
#ifndef <API key>
extern void <API key> (symbolS *);
#endif
extern void <API key> (void);
extern void <API key> (segT);
extern void c_section_header (struct internal_scnhdr *,
char *, long, long, long, long,
long, long, long, long);
extern void <API key> (void);
#ifndef <API key>
#define <API key> <API key>
#endif
#endif /* OBJ_FORMAT_H */
|
/*
* sti7200 ST231 Video1
*/
#include <bsp/_bsp.h>
const char *bsp_cpu_name = "video1";
/*
* Local Variables:
* tab-width: 8
* c-indent-level: 2
* c-basic-offset: 2
* End:
*/
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_18) on Tue Nov 02 13:16:47 CET 2010 -->
<TITLE>
Filter
</TITLE>
<META NAME="date" CONTENT="2010-11-02">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Filter";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Criteria.html" title="class in com.redhat.rhn.domain.monitoring.notification"><B>PREV CLASS</B></A>
<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/FilterType.html" title="class in com.redhat.rhn.domain.monitoring.notification"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?com/redhat/rhn/domain/monitoring/notification/Filter.html" target="_top"><B>FRAMES</B></A>
<A HREF="Filter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
com.redhat.rhn.domain.monitoring.notification</FONT>
<BR>
Class Filter</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>com.redhat.rhn.domain.monitoring.notification.Filter</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Filter</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Filter - Class representation of the table rhn_redirects.
<P>
<P>
<HR>
<P>
<A NAME="constructor_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#Filter()">Filter</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="method_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Criteria.html" title="class in com.redhat.rhn.domain.monitoring.notification">Criteria</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#addCriteria(com.redhat.rhn.domain.monitoring.notification.MatchType, java.lang.String)">addCriteria</A></B>(<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/MatchType.html" title="class in com.redhat.rhn.domain.monitoring.notification">MatchType</A> matchType,
java.lang.String value)</CODE>
<BR>
Add a match criteria of the given type that matches
against <code>value</code></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Set</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getCriteria()">getCriteria</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getDescription()">getDescription</A></B>()</CODE>
<BR>
Getter for description</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Set</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getEmailAddresses()">getEmailAddresses</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getExpiration()">getExpiration</A></B>()</CODE>
<BR>
Getter for expiration</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getId()">getId</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getLastUpdateDate()">getLastUpdateDate</A></B>()</CODE>
<BR>
Getter for lastUpdateDate</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getLastUpdateUser()">getLastUpdateUser</A></B>()</CODE>
<BR>
Getter for lastUpdateUser</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../com/redhat/rhn/domain/org/Org.html" title="class in com.redhat.rhn.domain.org">Org</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getOrg()">getOrg</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getReason()">getReason</A></B>()</CODE>
<BR>
Getter for reason</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getRecurring()">getRecurring</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#<API key>()"><API key></A></B>()</CODE>
<BR>
Get the number of minutes we want the recurring filter
to run for.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#<API key>()"><API key></A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#<API key>()"><API key></A></B>()</CODE>
<BR>
How often this Filter recurrs.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getStartDate()">getStartDate</A></B>()</CODE>
<BR>
Getter for startDate</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/FilterType.html" title="class in com.redhat.rhn.domain.monitoring.notification">FilterType</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getType()">getType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../com/redhat/rhn/domain/user/User.html" title="interface in com.redhat.rhn.domain.user">User</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#getUser()">getUser</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setDescription(java.lang.String)">setDescription</A></B>(java.lang.String descriptionIn)</CODE>
<BR>
Setter for description</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setExpiration(java.util.Date)">setExpiration</A></B>(java.util.Date expirationIn)</CODE>
<BR>
Setter for expiration</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setId(java.lang.Long)">setId</A></B>(java.lang.Long idIn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setLastUpdateDate(java.util.Date)">setLastUpdateDate</A></B>(java.util.Date lastUpdateDateIn)</CODE>
<BR>
Setter for lastUpdateDate</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setLastUpdateUser(java.lang.String)">setLastUpdateUser</A></B>(java.lang.String lastUpdateUserIn)</CODE>
<BR>
Setter for lastUpdateUser</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setOrg(com.redhat.rhn.domain.org.Org)">setOrg</A></B>(<A HREF="../../../../../../com/redhat/rhn/domain/org/Org.html" title="class in com.redhat.rhn.domain.org">Org</A> orgIn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setReason(java.lang.String)">setReason</A></B>(java.lang.String reasonIn)</CODE>
<BR>
Setter for reason</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setRecurring(java.lang.Boolean)">setRecurring</A></B>(java.lang.Boolean recurringIn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#<API key>(java.lang.Long)"><API key></A></B>(java.lang.Long recurringDurationIn)</CODE>
<BR>
Set the number of minutes we want the recurring filter
to run for.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#<API key>(java.lang.Long)"><API key></A></B>(java.lang.Long <API key>)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#<API key>(java.lang.Long)"><API key></A></B>(java.lang.Long <API key>)</CODE>
<BR>
How often this Filter recurrs.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setStartDate(java.util.Date)">setStartDate</A></B>(java.util.Date startDateIn)</CODE>
<BR>
Setter for startDate</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setType(com.redhat.rhn.domain.monitoring.notification.FilterType)">setType</A></B>(<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/FilterType.html" title="class in com.redhat.rhn.domain.monitoring.notification">FilterType</A> typeIn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Filter.html#setUser(com.redhat.rhn.domain.user.User)">setUser</A></B>(<A HREF="../../../../../../com/redhat/rhn/domain/user/User.html" title="interface in com.redhat.rhn.domain.user">User</A> userIn)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="<API key>.lang.Object"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<A NAME="constructor_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Filter()"></A><H3>
Filter</H3>
<PRE>
public <B>Filter</B>()</PRE>
<DL>
</DL>
<A NAME="method_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="addCriteria(com.redhat.rhn.domain.monitoring.notification.MatchType, java.lang.String)"></A><H3>
addCriteria</H3>
<PRE>
public <A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Criteria.html" title="class in com.redhat.rhn.domain.monitoring.notification">Criteria</A> <B>addCriteria</B>(<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/MatchType.html" title="class in com.redhat.rhn.domain.monitoring.notification">MatchType</A> matchType,
java.lang.String value)</PRE>
<DL>
<DD>Add a match criteria of the given type that matches
against <code>value</code>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>matchType</CODE> - the type of match for the criteria<DD><CODE>value</CODE> - the value to match against
<DT><B>Returns:</B><DD>the new criteria that has been added to this filter</DL>
</DD>
</DL>
<HR>
<A NAME="getId()"></A><H3>
getId</H3>
<PRE>
public java.lang.Long <B>getId</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the id.</DL>
</DD>
</DL>
<HR>
<A NAME="setId(java.lang.Long)"></A><H3>
setId</H3>
<PRE>
public void <B>setId</B>(java.lang.Long idIn)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>idIn</CODE> - The id to set.</DL>
</DD>
</DL>
<HR>
<A NAME="getDescription()"></A><H3>
getDescription</H3>
<PRE>
public java.lang.String <B>getDescription</B>()</PRE>
<DL>
<DD>Getter for description
<P>
<DD><DL>
<DT><B>Returns:</B><DD>String to get</DL>
</DD>
</DL>
<HR>
<A NAME="setDescription(java.lang.String)"></A><H3>
setDescription</H3>
<PRE>
public void <B>setDescription</B>(java.lang.String descriptionIn)</PRE>
<DL>
<DD>Setter for description
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>descriptionIn</CODE> - to set</DL>
</DD>
</DL>
<HR>
<A NAME="getReason()"></A><H3>
getReason</H3>
<PRE>
public java.lang.String <B>getReason</B>()</PRE>
<DL>
<DD>Getter for reason
<P>
<DD><DL>
<DT><B>Returns:</B><DD>String to get</DL>
</DD>
</DL>
<HR>
<A NAME="setReason(java.lang.String)"></A><H3>
setReason</H3>
<PRE>
public void <B>setReason</B>(java.lang.String reasonIn)</PRE>
<DL>
<DD>Setter for reason
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>reasonIn</CODE> - to set</DL>
</DD>
</DL>
<HR>
<A NAME="getExpiration()"></A><H3>
getExpiration</H3>
<PRE>
public java.util.Date <B>getExpiration</B>()</PRE>
<DL>
<DD>Getter for expiration
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Date to get</DL>
</DD>
</DL>
<HR>
<A NAME="setExpiration(java.util.Date)"></A><H3>
setExpiration</H3>
<PRE>
public void <B>setExpiration</B>(java.util.Date expirationIn)</PRE>
<DL>
<DD>Setter for expiration
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>expirationIn</CODE> - to set</DL>
</DD>
</DL>
<HR>
<A NAME="getLastUpdateUser()"></A><H3>
getLastUpdateUser</H3>
<PRE>
public java.lang.String <B>getLastUpdateUser</B>()</PRE>
<DL>
<DD>Getter for lastUpdateUser
<P>
<DD><DL>
<DT><B>Returns:</B><DD>String to get</DL>
</DD>
</DL>
<HR>
<A NAME="setLastUpdateUser(java.lang.String)"></A><H3>
setLastUpdateUser</H3>
<PRE>
public void <B>setLastUpdateUser</B>(java.lang.String lastUpdateUserIn)</PRE>
<DL>
<DD>Setter for lastUpdateUser
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lastUpdateUserIn</CODE> - to set</DL>
</DD>
</DL>
<HR>
<A NAME="getLastUpdateDate()"></A><H3>
getLastUpdateDate</H3>
<PRE>
public java.util.Date <B>getLastUpdateDate</B>()</PRE>
<DL>
<DD>Getter for lastUpdateDate
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Date to get</DL>
</DD>
</DL>
<HR>
<A NAME="setLastUpdateDate(java.util.Date)"></A><H3>
setLastUpdateDate</H3>
<PRE>
public void <B>setLastUpdateDate</B>(java.util.Date lastUpdateDateIn)</PRE>
<DL>
<DD>Setter for lastUpdateDate
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lastUpdateDateIn</CODE> - to set</DL>
</DD>
</DL>
<HR>
<A NAME="getStartDate()"></A><H3>
getStartDate</H3>
<PRE>
public java.util.Date <B>getStartDate</B>()</PRE>
<DL>
<DD>Getter for startDate
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Date to get</DL>
</DD>
</DL>
<HR>
<A NAME="setStartDate(java.util.Date)"></A><H3>
setStartDate</H3>
<PRE>
public void <B>setStartDate</B>(java.util.Date startDateIn)</PRE>
<DL>
<DD>Setter for startDate
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>startDateIn</CODE> - to set</DL>
</DD>
</DL>
<HR>
<A NAME="getRecurring()"></A><H3>
getRecurring</H3>
<PRE>
public java.lang.Boolean <B>getRecurring</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the recurring.</DL>
</DD>
</DL>
<HR>
<A NAME="setRecurring(java.lang.Boolean)"></A><H3>
setRecurring</H3>
<PRE>
public void <B>setRecurring</B>(java.lang.Boolean recurringIn)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>recurringIn</CODE> - The recurring to set.</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>()"></A><H3>
<API key></H3>
<PRE>
public java.lang.Long <B><API key></B>()</PRE>
<DL>
<DD>Get the number of minutes we want the recurring filter
to run for. So, if we say the filter is for 30 minutes
then each time it runs, it will run for 30 minutes.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the recurringDuration.</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>(java.lang.Long)"></A><H3>
<API key></H3>
<PRE>
public void <B><API key></B>(java.lang.Long recurringDurationIn)</PRE>
<DL>
<DD>Set the number of minutes we want the recurring filter
to run for. So, if we say the filter is for 30 minutes
then each time it runs, it will run for 30 minutes.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>recurringDurationIn</CODE> - The recurringDuration to set.</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>()"></A><H3>
<API key></H3>
<PRE>
public java.lang.Long <B><API key></B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the <API key>.</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>(java.lang.Long)"></A><H3>
<API key></H3>
<PRE>
public void <B><API key></B>(java.lang.Long <API key>)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE><API key></CODE> - The <API key> to set.</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>()"></A><H3>
<API key></H3>
<PRE>
public java.lang.Long <B><API key></B>()</PRE>
<DL>
<DD>How often this Filter recurrs.
These values correspond to the constants defined in java.util.Calendar:
public final static int DAY_OF_YEAR = 6;
public final static int WEEK_OF_YEAR = 3;
public final static int MONTH = 2;
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the recurringFrequency.</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>(java.lang.Long)"></A><H3>
<API key></H3>
<PRE>
public void <B><API key></B>(java.lang.Long <API key>)</PRE>
<DL>
<DD>How often this Filter recurrs.
These values correspond to the constants defined in java.util.Calendar:
public final static int DAY_OF_YEAR = 6;
public final static int WEEK_OF_YEAR = 3;
public final static int MONTH = 2;
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE><API key></CODE> - The recurringFrequency to set.</DL>
</DD>
</DL>
<HR>
<A NAME="getOrg()"></A><H3>
getOrg</H3>
<PRE>
public <A HREF="../../../../../../com/redhat/rhn/domain/org/Org.html" title="class in com.redhat.rhn.domain.org">Org</A> <B>getOrg</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the org.</DL>
</DD>
</DL>
<HR>
<A NAME="setOrg(com.redhat.rhn.domain.org.Org)"></A><H3>
setOrg</H3>
<PRE>
public void <B>setOrg</B>(<A HREF="../../../../../../com/redhat/rhn/domain/org/Org.html" title="class in com.redhat.rhn.domain.org">Org</A> orgIn)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>orgIn</CODE> - The org to set.</DL>
</DD>
</DL>
<HR>
<A NAME="getUser()"></A><H3>
getUser</H3>
<PRE>
public <A HREF="../../../../../../com/redhat/rhn/domain/user/User.html" title="interface in com.redhat.rhn.domain.user">User</A> <B>getUser</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the user.</DL>
</DD>
</DL>
<HR>
<A NAME="setUser(com.redhat.rhn.domain.user.User)"></A><H3>
setUser</H3>
<PRE>
public void <B>setUser</B>(<A HREF="../../../../../../com/redhat/rhn/domain/user/User.html" title="interface in com.redhat.rhn.domain.user">User</A> userIn)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>userIn</CODE> - The user to set.</DL>
</DD>
</DL>
<HR>
<A NAME="getType()"></A><H3>
getType</H3>
<PRE>
public <A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/FilterType.html" title="class in com.redhat.rhn.domain.monitoring.notification">FilterType</A> <B>getType</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the type.</DL>
</DD>
</DL>
<HR>
<A NAME="setType(com.redhat.rhn.domain.monitoring.notification.FilterType)"></A><H3>
setType</H3>
<PRE>
public void <B>setType</B>(<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/FilterType.html" title="class in com.redhat.rhn.domain.monitoring.notification">FilterType</A> typeIn)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>typeIn</CODE> - The type to set.</DL>
</DD>
</DL>
<HR>
<A NAME="getCriteria()"></A><H3>
getCriteria</H3>
<PRE>
public java.util.Set <B>getCriteria</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the criteria.</DL>
</DD>
</DL>
<HR>
<A NAME="getEmailAddresses()"></A><H3>
getEmailAddresses</H3>
<PRE>
public java.util.Set <B>getEmailAddresses</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the emailAddresses.</DL>
</DD>
</DL>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/Criteria.html" title="class in com.redhat.rhn.domain.monitoring.notification"><B>PREV CLASS</B></A>
<A HREF="../../../../../../com/redhat/rhn/domain/monitoring/notification/FilterType.html" title="class in com.redhat.rhn.domain.monitoring.notification"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?com/redhat/rhn/domain/monitoring/notification/Filter.html" target="_top"><B>FRAMES</B></A>
<A HREF="Filter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
</BODY>
</HTML>
|
<?php
//--No direct access
defined('_JEXEC') or die('=;)');
// DS has removed from J 3.0
if(!defined('DS')) {
define('DS','/');
}
// Require the base controller
require_once( JPATH_COMPONENT.'/controller.php' );
jimport('joomla.application.component.model');
require_once( JPATH_COMPONENT.'/models/model.php' );
jimport('joomla.application.component.helper');
JHTML::addIncludePath(<API key>.'/helpers' );
//set the default view
$task = JRequest::getWord('task');
$config =& JComponentHelper::getParams( '<API key>' );
$controller = JRequest::getWord('view', 'kepviselojeloltek');
$ControllerConfig = array();
// Require specific controller if requested
if ($controller) {
$path = JPATH_COMPONENT.'/controllers/'.$controller.'.php';
$ControllerConfig = array('viewname'=>strtolower($controller),'mainmodel'=>strtolower($controller),'itemname'=>ucfirst(strtolower($controller)));
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}
// Create the controller
$classname = '<API key>'.$controller;
$controller = new $classname($ControllerConfig );
// Perform the Request task
$controller->execute( JRequest::getVar( 'task' ) );
// Redirect if set by the controller
$controller->redirect();
|
package org.emulinker.kaillera.controller.v086.action;
import java.util.*;
import org.apache.commons.logging.*;
import org.emulinker.kaillera.access.AccessManager;
import org.emulinker.kaillera.controller.messaging.<API key>;
import org.emulinker.kaillera.controller.v086.V086Controller;
import org.emulinker.kaillera.controller.v086.protocol.*;
import org.emulinker.kaillera.model.exception.ActionException;
import org.emulinker.kaillera.model.impl.*;
import org.emulinker.kaillera.model.*;
import org.emulinker.util.EmuLang;
import org.emulinker.util.<API key>;
public class <API key> implements V086Action
{
public static final String COMMAND_HELP = "/help"; //$NON-NLS-1$
public static final String <API key> = "/detectautofire"; //$NON-NLS-1$
private static Log log = LogFactory.getLog(<API key>.class);
private static final String desc = "<API key>"; //$NON-NLS-1$
private static <API key> singleton = new <API key>();
public static <API key> getInstance()
{
return singleton;
}
private int actionCount = 0;
private <API key>()
{
}
public int <API key>()
{
return actionCount;
}
public String toString()
{
return desc;
}
public void performAction(V086Message message, V086Controller.V086ClientHandler clientHandler) throws <API key>
{
GameChat chatMessage = (GameChat) message;
String chat = chatMessage.getMessage();
KailleraUserImpl user = (KailleraUserImpl) clientHandler.getUser();
KailleraGameImpl game = user.getGame();
if(game == null)
{
throw new <API key>("GameOwner Command Failed: Not in a game: " + chat); //$NON-NLS-1$
}
if(!user.equals(game.getOwner()))
{
log.warn("GameOwner Command Denied: Not game owner: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return;
}
try
{
if (chat.startsWith(COMMAND_HELP))
{
processHelp(chat, game, user, clientHandler);
}
else if (chat.startsWith(<API key>))
{
<API key>(chat, game, user, clientHandler);
}
else
{
log.info("Unknown GameOwner Command: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
catch (ActionException e)
{
log.info("GameOwner Command Failed: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
game.announce(EmuLang.getString("<API key>.CommandFailed", e.getMessage())); //$NON-NLS-1$
}
catch (<API key> e)
{
log.error("Failed to contruct message: " + e.getMessage(), e); //$NON-NLS-1$
}
}
private void processHelp(String message, KailleraGameImpl game, KailleraUserImpl admin, V086Controller.V086ClientHandler clientHandler) throws ActionException, <API key>
{
game.announce(EmuLang.getString("<API key>.AvailableCommands")); //$NON-NLS-1$
game.announce(EmuLang.getString("<API key>.<API key>")); //$NON-NLS-1$
}
private void autoFireHelp(KailleraGameImpl game)
{
int cur = game.getAutoFireDetector().getSensitivity();
game.announce(EmuLang.getString("<API key>.HelpSensitivity")); //$NON-NLS-1$
game.announce(EmuLang.getString("<API key>.HelpDisable")); //$NON-NLS-1$
game.announce(EmuLang.getString("<API key>.<API key>", cur) + (cur == 0 ? (EmuLang.getString("<API key>.HelpDisabled")) : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
private void <API key>(String message, KailleraGameImpl game, KailleraUserImpl admin, V086Controller.V086ClientHandler clientHandler) throws ActionException, <API key>
{
if(game.getStatus() != KailleraGame.STATUS_WAITING)
{
game.announce(EmuLang.getString("<API key>.<API key>")); //$NON-NLS-1$
return;
}
StringTokenizer st = new StringTokenizer(message, " "); //$NON-NLS-1$
if(st.countTokens() != 2)
{
autoFireHelp(game);
return;
}
String command = st.nextToken();
String sensitivityStr = st.nextToken();
int sensitivity = -1;
try
{
sensitivity = Integer.parseInt(sensitivityStr);
}
catch(<API key> e) {}
if(sensitivity > 5 || sensitivity < 0)
{
autoFireHelp(game);
return;
}
game.getAutoFireDetector().setSensitivity(sensitivity);
game.announce(EmuLang.getString("<API key>.<API key>", sensitivity) + (sensitivity == 0 ? (EmuLang.getString("<API key>.HelpDisabled")) : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
|
<?php
/**
* Handles /social endpoint, so it must be an extrovert.
*/
class SocialController extends DashboardController {
/** @var array Models to automatically instantiate. */
public $Uses = ['Form', 'Database'];
/**
* Runs before every call to this controller.
*/
public function initialize() {
parent::initialize();
Gdn_Theme::section('Settings');
}
/**
* Default method.
*/
public function index() {
redirectTo('social/manage');
}
/**
* Settings page.
*/
public function manage() {
$this->permission('Garden.Settings.Manage');
$this->title("Social Connect Addons");
$this->setHighlightRoute('/social/manage');
$connections = $this->getConnections();
$this->setData('Connections', $connections);
$this->render();
}
/**
* Find available social plugins.
*
* @return array|mixed
* @throws Exception
*/
protected function getConnections() {
$this->fireEvent('GetConnections');
$connections = [];
$addons = Gdn::addonManager()->lookupAllByType(\Vanilla\Addon::TYPE_ADDON);
foreach ($addons as $addonName => $addon) {
/* @var \Vanilla\Addon $addon */
$addonInfo = $addon->getInfo();
// Limit to designated social addons.
if (!array_key_exists('socialConnect', $addonInfo)) {
continue;
}
// See if addon is enabled.
$isEnabled = Gdn::addonManager()->isEnabled($addonName, \Vanilla\Addon::TYPE_ADDON);
setValue('enabled', $addonInfo, $isEnabled);
if (!$isEnabled && !empty($addonInfo['hidden'])) {
// Don't show hidden addons unless they are enabled.
continue;
}
// See if we can detect whether connection is configured.
$isConfigured = null;
if ($isEnabled) {
$pluginInstance = Gdn::pluginManager()->getPluginInstance($addonName, Gdn_PluginManager::ACCESS_PLUGINNAME);
if (method_exists($pluginInstance, 'isConfigured')) {
$isConfigured = $pluginInstance->isConfigured();
}
}
setValue('configured', $addonInfo, $isConfigured);
// Add the connection.
$connections[$addonName] = $addonInfo;
}
return $connections;
}
}
|
<?php
// if( isset( $_POST ) ) {
// echo '<code><pre>';
// var_dump( $_POST );
// echo '</pre></code>';
class SpeoOptions
{
/**
* Holds the values to be used in the fields callbacks
*/
private $options;
/**
* Start up
*/
public function __construct()
{
add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
add_action( 'admin_init', array( $this, 'page_init' ) );
}
/**
* Add options page
*/
public function add_plugin_page()
{
// This page will be under "Settings"
add_options_page(
'Settings Admin',
'Exiftool Options',
'manage_options',
'speo_exif_options',
array( $this, 'create_admin_page' )
);
}
/**
* Options page callback
*/
public function create_admin_page()
{
// Set class property
$this->options = get_option( 'speo_options' );
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2>Exiftools Settings</h2>
<form method="post" action="options.php">
<?php
// This prints out all hidden setting fields
settings_fields( 'speo_options_group' );
<API key>( 'speo_exif_options' );
echo '</ol>';
submit_button();
?>
</form>
</div>
<?php
}
/**
* Register and add settings
*/
public function page_init()
{
register_setting(
'speo_options_group', // Option group
'speo_options', // Option name
array( $this, 'sanitize' ) // Sanitize
);
<API key>(
'speo_options_all',
'Options', // Title
array( $this, 'print_section_info' ), // Callback
'speo_exif_options' // Page
);
//get the blog language
$this_lang = get_locale();
//get the values from the list.xml
$xmldoc = new DOMDocument();
$xmldoc->load( plugin_dir_path( __FILE__ ) . 'list.xml' );
$xpathvar = new Domxpath($xmldoc);
$queryResult = $xpathvar->query('//tag/@name');
$possible_values = array();
foreach( $queryResult as $result ){
if( substr( $result->textContent, 0, 9 ) === 'MakerNote' )
continue;
$possible_values[ $result->textContent ] = 0;
ksort( $possible_values );
}
foreach( $possible_values as $value => $bool ) {
// $xpath = new Domxpath($xmldoc);
// $descs = $xpath->query('//tag[@name="' . $value . '"]/desc[@lang="en"]');
// $titles = $xpath->query('//tag[@name="' . $value . '"]/desc[@lang="' . substr( $this_lang, 0, 2 ) . '"]');
// foreach( $descs as $desc ) {
// $opt_title = '<li>' . $value;
// foreach( $titles as $title ) {
// if( $i > 1 )
// continue;
// $opt_title .= '<br />(' . $title->textContent . ')';
// $opt_title .= '</li>';
//add the actual setting
add_settings_field(
'speo_exif_' . $value,
$value, // Title
array( $this, 'speo_callback' ), // Callback
'speo_exif_options', // Page
'speo_options_all', // Section
$value //args
);
}
}
/**
* Sanitize each setting field as needed
*
* @param array $input Contains all settings fields as array keys
*/
public function sanitize( $inputs )
{
return $inputs;
}
/**
* Print the Section text
*/
public function print_section_info()
{
print 'Check the values you want to retreive from images:<ol>';
}
/**
* Get the settings option array and print one of its values
*/
public function speo_callback( $value ) {
// echo '<code><pre>';
// var_dump($this->options);
// echo '</pre></code>';
printf(
'<input type="checkbox" id="speo_exif_' . $value . '" name="speo_options[' . $value . ']" %s />',
checked( isset( $this->options[$value] ), true, false )
// ( isset( $this->options[$value] ) ? $this->options[$value] : 'none' )
);
}
}
if( is_admin() )
$my_settings_page = new SpeoOptions();
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;
using ProductMan.Utilities;
using ProductMan.Win32;
using System.Reflection;
namespace ProductMan
{
public class WMIVendor : IDisposable
{
protected static WMIVendor instance;
protected ManagementScope scope;
protected ConnectionOptions conn;
protected ComputerSystem computer;
protected <API key> <API key>;
protected ProductMan.Win32.OperatingSystem os;
protected static volatile object syncRoot = new object();
private WMIVendor()
{
conn = new ConnectionOptions();
scope = new ManagementScope("\\\\localhost", conn);
scope.Options.Impersonation = ImpersonationLevel.Impersonate;
}
public ComputerSystem GetComputerSystem()
{
if (computer != null) return computer;
computer = new ComputerSystem();
try
{
<API key> res = Query("select * from <API key>");
FieldInfo[] fields = typeof(ComputerSystem).GetFields();
foreach (ManagementObject item in res)
{
foreach (FieldInfo info in fields)
{
try
{
info.SetValue(computer, item[info.Name]);
}
catch { }
}
break;
}
}
catch (Exception ex)
{
LoggerBase.Instance.Error(ex.ToString());
}
return computer;
}
public <API key> GetNetworkConfig()
{
if (<API key> != null) return <API key>;
<API key> = new <API key>();
try
{
<API key> res = Query("select * from <API key> WHERE IPEnabled = 'TRUE'");
FieldInfo[] fields = typeof(<API key>).GetFields();
foreach (ManagementObject item in res)
{
foreach (FieldInfo info in fields)
{
try
{
info.SetValue(<API key>, item[info.Name]);
}
catch { }
}
break;
}
}
catch (Exception ex)
{
LoggerBase.Instance.Error(ex.ToString());
}
return <API key>;
}
public ProductMan.Win32.OperatingSystem GetOS()
{
if (os != null) return os;
os = new ProductMan.Win32.OperatingSystem();
try
{
<API key> res = Query("select * from <API key>");
FieldInfo[] fields = typeof(ProductMan.Win32.OperatingSystem).GetFields();
foreach (ManagementObject item in res)
{
foreach (FieldInfo info in fields)
{
try
{
info.SetValue(os, item[info.Name]);
}
catch { }
}
break;
}
}
catch (Exception ex)
{
LoggerBase.Instance.Error(ex.ToString());
}
return os;
}
private <API key> Query(string queryString)
{
try
{
ObjectQuery query = new ObjectQuery(queryString);
<API key> searcher = new <API key>(scope, query);
return searcher.Get();
}
catch (Exception ex)
{
LoggerBase.Instance.Error(ex.ToString());
}
return null;
}
public static WMIVendor Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null) instance = new WMIVendor();
}
}
return instance;
}
}
#region IDisposable Members
public void Dispose()
{
//TODO
}
#endregion
}
}
|
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/pagemap.h>
#include <linux/err.h>
#include <linux/leds.h>
#include <linux/scatterlist.h>
#include <linux/log2.h>
#include <linux/regulator/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
#include <linux/fault-inject.h>
#include <linux/random.h>
#include <linux/wakelock.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include "core.h"
#include "bus.h"
#include "host.h"
#include "sdio_bus.h"
#include "mmc_ops.h"
#include "sd_ops.h"
#include "sdio_ops.h"
#define CREATE_TRACE_POINTS
#include <trace/events/mmc.h>
/* If the device is not responding */
#define MMC_CORE_TIMEOUT_MS (10 * 60 * 1000) /* 10 minute timeout */
static void mmc_clk_scaling(struct mmc_host *host, bool from_wq);
/*
* Background operations can take a long time, depending on the housekeeping
* operations the card has to perform.
*/
#define <API key> (30 * 1000) /* max time to wait in ms */
/* Flushing a large amount of cached data may take a long time. */
#define <API key> 30000 /* msec */
static struct workqueue_struct *workqueue;
/*
* Enabling software CRCs on the data blocks can be a significant (30%)
* performance cost, and for other reasons may not always be desired.
* So we allow it it to be disabled.
*/
bool use_spi_crc = 0;
module_param(use_spi_crc, bool, 0755);
/*
* We normally treat cards as removed during suspend if they are not
* known to be on a non-removable bus, to avoid the risk of writing
* back data to a different card after resume. Allow this to be
* overridden if necessary.
*/
#ifdef <API key>
bool <API key>;
#else
bool <API key> = 1;
#endif
EXPORT_SYMBOL(<API key>);
module_param_named(removable, <API key>, bool, 0644);
MODULE_PARM_DESC(
removable,
"MMC/SD cards are removable and may be removed during suspend");
/*
* Internal function. Schedule delayed work in the MMC work queue.
*/
static int <API key>(struct delayed_work *work,
unsigned long delay)
{
return queue_delayed_work(workqueue, work, delay);
}
/*
* Internal function. Flush all scheduled work from the MMC work queue.
*/
static void <API key>(void)
{
flush_workqueue(workqueue);
}
#ifdef <API key>
/*
* Internal function. Inject random data errors.
* If mmc_data is NULL no errors are injected.
*/
static void <API key>(struct mmc_host *host,
struct mmc_request *mrq)
{
struct mmc_command *cmd = mrq->cmd;
struct mmc_data *data = mrq->data;
static const int data_errors[] = {
-ETIMEDOUT,
-EILSEQ,
-EIO,
};
if (!data)
return;
if (cmd->error || data->error ||
!should_fail(&host->fail_mmc_request, data->blksz * data->blocks))
return;
data->error = data_errors[random32() % ARRAY_SIZE(data_errors)];
data->bytes_xfered = (random32() % (data->bytes_xfered >> 9)) << 9;
data->fault_injected = true;
}
#else /* <API key> */
static inline void <API key>(struct mmc_host *host,
struct mmc_request *mrq)
{
}
#endif /* <API key> */
/**
* mmc_request_done - finish processing an MMC request
* @host: MMC host which completed request
* @mrq: MMC request which request
*
* MMC drivers should call this function when they have completed
* their processing of a request.
*/
void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
{
struct mmc_command *cmd = mrq->cmd;
int err = cmd->error;
#ifdef <API key>
ktime_t diff;
#endif
if (host->card && host->clk_scaling.enable)
host->clk_scaling.busy_time_us +=
ktime_to_us(ktime_sub(ktime_get(),
host->clk_scaling.start_busy));
if (err && cmd->retries && mmc_host_is_spi(host)) {
if (cmd->resp[0] & <API key>)
cmd->retries = 0;
}
if (err && cmd->retries && !mmc_card_removed(host->card)) {
/*
* Request starter must handle retries - see
* <API key>().
*/
if (mrq->done)
mrq->done(mrq);
} else {
<API key>(host, mrq);
led_trigger_event(host->led, LED_OFF);
pr_debug("%s: req done (CMD%u): %d: %08x %08x %08x %08x\n",
mmc_hostname(host), cmd->opcode, err,
cmd->resp[0], cmd->resp[1],
cmd->resp[2], cmd->resp[3]);
if (mrq->data) {
#ifdef <API key>
if (host->perf_enable) {
diff = ktime_sub(ktime_get(), host->perf.start);
if (mrq->data->flags == MMC_DATA_READ) {
host->perf.rbytes_drv +=
mrq->data->bytes_xfered;
host->perf.rtime_drv =
ktime_add(host->perf.rtime_drv,
diff);
} else {
host->perf.wbytes_drv +=
mrq->data->bytes_xfered;
host->perf.wtime_drv =
ktime_add(host->perf.wtime_drv,
diff);
}
}
#endif
pr_debug("%s: %d bytes transferred: %d\n",
mmc_hostname(host),
mrq->data->bytes_xfered, mrq->data->error);
}
if (mrq->stop) {
pr_debug("%s: (CMD%u): %d: %08x %08x %08x %08x\n",
mmc_hostname(host), mrq->stop->opcode,
mrq->stop->error,
mrq->stop->resp[0], mrq->stop->resp[1],
mrq->stop->resp[2], mrq->stop->resp[3]);
}
if (mrq->done)
mrq->done(mrq);
<API key>(host);
}
}
EXPORT_SYMBOL(mmc_request_done);
static void
mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{
#ifdef CONFIG_MMC_DEBUG
unsigned int i, sz;
struct scatterlist *sg;
#endif
if (mrq->sbc) {
pr_debug("<%s: starting CMD%u arg %08x flags %08x>\n",
mmc_hostname(host), mrq->sbc->opcode,
mrq->sbc->arg, mrq->sbc->flags);
}
pr_debug("%s: starting CMD%u arg %08x flags %08x\n",
mmc_hostname(host), mrq->cmd->opcode,
mrq->cmd->arg, mrq->cmd->flags);
if (mrq->data) {
pr_debug("%s: blksz %d blocks %d flags %08x "
"tsac %d ms nsac %d\n",
mmc_hostname(host), mrq->data->blksz,
mrq->data->blocks, mrq->data->flags,
mrq->data->timeout_ns / 1000000,
mrq->data->timeout_clks);
}
if (mrq->stop) {
pr_debug("%s: CMD%u arg %08x flags %08x\n",
mmc_hostname(host), mrq->stop->opcode,
mrq->stop->arg, mrq->stop->flags);
}
WARN_ON(!host->claimed);
mrq->cmd->error = 0;
mrq->cmd->mrq = mrq;
if (mrq->data) {
BUG_ON(mrq->data->blksz > host->max_blk_size);
BUG_ON(mrq->data->blocks > host->max_blk_count);
BUG_ON(mrq->data->blocks * mrq->data->blksz >
host->max_req_size);
#ifdef CONFIG_MMC_DEBUG
sz = 0;
for_each_sg(mrq->data->sg, sg, mrq->data->sg_len, i)
sz += sg->length;
BUG_ON(sz != mrq->data->blocks * mrq->data->blksz);
#endif
mrq->cmd->data = mrq->data;
mrq->data->error = 0;
mrq->data->mrq = mrq;
if (mrq->stop) {
mrq->data->stop = mrq->stop;
mrq->stop->error = 0;
mrq->stop->mrq = mrq;
}
#ifdef <API key>
if (host->perf_enable)
host->perf.start = ktime_get();
#endif
}
mmc_host_clk_hold(host);
led_trigger_event(host->led, LED_FULL);
if (host->card && host->clk_scaling.enable) {
/*
* Check if we need to scale the clocks. Clocks
* will be scaled up immediately if necessary
* conditions are satisfied. Scaling down the
* frequency will be done after current thread
* releases host.
*/
mmc_clk_scaling(host, false);
host->clk_scaling.start_busy = ktime_get();
}
host->ops->request(host, mrq);
}
/**
* <API key>() - Start a delayed work to check for
* the need of non urgent BKOPS
*
* @card: MMC card to start BKOPS on
*/
void <API key>(struct mmc_card *card)
{
if (!card || !card->ext_csd.bkops_en || <API key>(card))
return;
if (card->bkops_info.sectors_changed <
card->bkops_info.<API key>)
return;
pr_debug("%s: %s: queueing delayed_bkops_work\n",
mmc_hostname(card->host), __func__);
/*
* <API key> will prevent a race condition between
* fetching a request by the mmcqd and the delayed work, in case
* it was removed from the queue work but not started yet
*/
card->bkops_info.cancel_delayed_work = false;
queue_delayed_work(system_nrt_wq, &card->bkops_info.dw,
msecs_to_jiffies(
card->bkops_info.delay_ms));
}
EXPORT_SYMBOL(<API key>);
/**
* mmc_start_bkops - start BKOPS for supported cards
* @card: MMC card to start BKOPS
* @from_exception: A flag to indicate if this function was
* called due to an exception raised by the card
*
* Start background operations whenever requested.
* When the urgent BKOPS bit is set in a R1 command response
* then background operations should be started immediately.
*/
void mmc_start_bkops(struct mmc_card *card, bool from_exception)
{
int err;
BUG_ON(!card);
if (!card->ext_csd.bkops_en)
return;
if ((card->bkops_info.cancel_delayed_work) && !from_exception) {
pr_debug("%s: %s: cancel_delayed_work was set, exit\n",
mmc_hostname(card->host), __func__);
card->bkops_info.cancel_delayed_work = false;
return;
}
/* In case of delayed bkops we might be in race with suspend. */
if (!mmc_try_claim_host(card->host))
return;
/*
* Since the cancel_delayed_work can be changed while we are waiting
* for the lock we will to re-check it
*/
if ((card->bkops_info.cancel_delayed_work) && !from_exception) {
pr_debug("%s: %s: cancel_delayed_work was set, exit\n",
mmc_hostname(card->host), __func__);
card->bkops_info.cancel_delayed_work = false;
goto out;
}
if (<API key>(card)) {
pr_debug("%s: %s: already doing bkops, exit\n",
mmc_hostname(card->host), __func__);
goto out;
}
if (from_exception && mmc_card_need_bkops(card))
goto out;
/*
* If the need BKOPS flag is set, there is no need to check if BKOPS
* is needed since we already know that it does
*/
if (!mmc_card_need_bkops(card)) {
err = <API key>(card);
if (err) {
pr_err("%s: %s: Failed to read bkops status: %d\n",
mmc_hostname(card->host), __func__, err);
goto out;
}
if (!card->ext_csd.raw_bkops_status)
goto out;
pr_info("%s: %s: raw_bkops_status=0x%x, from_exception=%d\n",
mmc_hostname(card->host), __func__,
card->ext_csd.raw_bkops_status,
from_exception);
}
/*
* If the function was called due to exception, BKOPS will be performed
* after handling the last pending request
*/
if (from_exception) {
pr_debug("%s: %s: Level %d from exception, exit",
mmc_hostname(card->host), __func__,
card->ext_csd.raw_bkops_status);
<API key>(card);
goto out;
}
pr_info("%s: %s: Starting bkops\n", mmc_hostname(card->host), __func__);
err = __mmc_switch(card, <API key>,
EXT_CSD_BKOPS_START, 1, 0, false, false);
if (err) {
pr_warn("%s: Error %d starting bkops\n",
mmc_hostname(card->host), err);
goto out;
}
<API key>(card);
<API key>(card);
out:
mmc_release_host(card->host);
}
EXPORT_SYMBOL(mmc_start_bkops);
/**
* <API key>() - check if a non urgent BKOPS is
* needed
* @work: The idle time BKOPS work
*/
void <API key>(struct work_struct *work)
{
struct mmc_card *card = container_of(work, struct mmc_card,
bkops_info.dw.work);
/*
* Prevent a race condition between mmc_stop_bkops and the delayed
* BKOPS work in case the delayed work is executed on another CPU
*/
if (card->bkops_info.cancel_delayed_work)
return;
mmc_start_bkops(card, false);
}
EXPORT_SYMBOL(<API key>);
static void mmc_wait_done(struct mmc_request *mrq)
{
complete(&mrq->completion);
}
static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
{
init_completion(&mrq->completion);
mrq->done = mmc_wait_done;
if (mmc_card_removed(host->card)) {
mrq->cmd->error = -ENOMEDIUM;
complete(&mrq->completion);
return -ENOMEDIUM;
}
mmc_start_request(host, mrq);
return 0;
}
static void <API key>(struct mmc_host *host,
struct mmc_request *mrq)
{
struct mmc_command *cmd;
while (1) {
<API key>(&mrq->completion);
cmd = mrq->cmd;
/*
* If host has timed out waiting for the commands which can be
* HPIed then let the caller handle the timeout error as it may
* want to send the HPI command to bring the card out of
* programming state.
*/
if (cmd->ignore_timeout && cmd->error == -ETIMEDOUT)
break;
if (!cmd->error || !cmd->retries ||
mmc_card_removed(host->card))
break;
pr_debug("%s: req failed (CMD%u): %d, retrying...\n",
mmc_hostname(host), cmd->opcode, cmd->error);
cmd->retries
cmd->error = 0;
host->ops->request(host, mrq);
}
}
/**
* mmc_pre_req - Prepare for a new request
* @host: MMC host to prepare command
* @mrq: MMC request to prepare for
* @is_first_req: true if there is no previous started request
* that may run in parellel to this call, otherwise false
*
* mmc_pre_req() is called in prior to mmc_start_req() to let
* host prepare for the new request. Preparation of a request may be
* performed while another request is running on the host.
*/
static void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq,
bool is_first_req)
{
if (host->ops->pre_req) {
mmc_host_clk_hold(host);
host->ops->pre_req(host, mrq, is_first_req);
<API key>(host);
}
}
/**
* mmc_post_req - Post process a completed request
* @host: MMC host to post process command
* @mrq: MMC request to post process for
* @err: Error, if non zero, clean up any resources made in pre_req
*
* Let the host post process a completed request. Post processing of
* a request may be performed while another reuqest is running.
*/
static void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
int err)
{
if (host->ops->post_req) {
mmc_host_clk_hold(host);
host->ops->post_req(host, mrq, err);
<API key>(host);
}
}
/**
* mmc_start_req - start a non-blocking request
* @host: MMC host to start command
* @areq: async request to start
* @error: out parameter returns 0 for success, otherwise non zero
*
* Start a new MMC custom command request for a host.
* If there is on ongoing async request wait for completion
* of that request and start the new one and return.
* Does not wait for the new request to complete.
*
* Returns the completed request, NULL in case of none completed.
* Wait for the an ongoing request (previoulsy started) to complete and
* return the completed request. If there is no ongoing request, NULL
* is returned without waiting. NULL is not an error condition.
*/
struct mmc_async_req *mmc_start_req(struct mmc_host *host,
struct mmc_async_req *areq, int *error)
{
int err = 0;
int start_err = 0;
struct mmc_async_req *data = host->areq;
/* Prepare a new request */
if (areq)
mmc_pre_req(host, areq->mrq, !host->areq);
if (host->areq) {
<API key>(host, host->areq->mrq);
err = host->areq->err_check(host->card, host->areq);
/*
* Check BKOPS urgency for each R1 response
*/
if (host->card && mmc_card_mmc(host->card) &&
((mmc_resp_type(host->areq->mrq->cmd) == MMC_RSP_R1) ||
(mmc_resp_type(host->areq->mrq->cmd) == MMC_RSP_R1B)) &&
(host->areq->mrq->cmd->resp[0] & R1_EXCEPTION_EVENT))
mmc_start_bkops(host->card, true);
}
if (!err && areq)
start_err = __mmc_start_req(host, areq->mrq);
if (host->areq)
mmc_post_req(host, host->areq->mrq, 0);
/* Cancel a prepared request if it was not started. */
if ((err || start_err) && areq)
mmc_post_req(host, areq->mrq, -EINVAL);
if (err)
host->areq = NULL;
else
host->areq = areq;
if (error)
*error = err;
return data;
}
EXPORT_SYMBOL(mmc_start_req);
/**
* mmc_wait_for_req - start a request and wait for completion
* @host: MMC host to start command
* @mrq: MMC request to start
*
* Start a new MMC custom command request for a host, and wait
* for the command to complete. Does not attempt to parse the
* response.
*/
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{
__mmc_start_req(host, mrq);
<API key>(host, mrq);
}
EXPORT_SYMBOL(mmc_wait_for_req);
bool <API key>(struct mmc_card *card)
{
bool rc;
struct mmc_command cmd;
mmc_claim_host(card->host);
memset(&cmd, 0, sizeof(struct mmc_command));
cmd.opcode = MMC_SEND_STATUS;
if (!mmc_host_is_spi(card->host))
cmd.arg = card->rca << 16;
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
rc = mmc_wait_for_cmd(card->host, &cmd, 0);
if (rc) {
pr_err("%s: Get card status fail. rc=%d\n",
mmc_hostname(card->host), rc);
rc = false;
goto out;
}
if (R1_CURRENT_STATE(cmd.resp[0]) == R1_STATE_PRG)
rc = true;
else
rc = false;
out:
mmc_release_host(card->host);
return rc;
}
EXPORT_SYMBOL(<API key>);
/**
* mmc_interrupt_hpi - Issue for High priority Interrupt
* @card: the MMC card associated with the HPI transfer
*
* Issued High Priority Interrupt, and check for card status
* until out-of prg-state.
*/
int mmc_interrupt_hpi(struct mmc_card *card)
{
int err;
u32 status;
BUG_ON(!card);
if (!card->ext_csd.hpi_en) {
pr_info("%s: HPI enable bit unset\n", mmc_hostname(card->host));
return 1;
}
mmc_claim_host(card->host);
err = mmc_send_status(card, &status);
if (err) {
pr_err("%s: Get card status fail\n", mmc_hostname(card->host));
goto out;
}
/*
* If the card status is in PRG-state, we can send the HPI command.
*/
if (R1_CURRENT_STATE(status) == R1_STATE_PRG) {
do {
/*
* We don't know when the HPI command will finish
* processing, so we need to resend HPI until out
* of prg-state, and keep checking the card status
* with SEND_STATUS. If a timeout error occurs when
* sending the HPI command, we are already out of
* prg-state.
*/
err = mmc_send_hpi_cmd(card, &status);
if (err)
pr_debug("%s: abort HPI (%d error)\n",
mmc_hostname(card->host), err);
err = mmc_send_status(card, &status);
if (err)
break;
} while (R1_CURRENT_STATE(status) == R1_STATE_PRG);
} else
pr_debug("%s: Left prg-state\n", mmc_hostname(card->host));
out:
mmc_release_host(card->host);
return err;
}
EXPORT_SYMBOL(mmc_interrupt_hpi);
/**
* mmc_wait_for_cmd - start a command and wait for completion
* @host: MMC host to start command
* @cmd: MMC command to start
* @retries: maximum number of retries
*
* Start a new MMC command for a host, and wait for the command
* to complete. Return any error that occurred while the command
* was executing. Do not attempt to parse the response.
*/
int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries)
{
struct mmc_request mrq = {NULL};
WARN_ON(!host->claimed);
memset(cmd->resp, 0, sizeof(cmd->resp));
cmd->retries = retries;
mrq.cmd = cmd;
cmd->data = NULL;
mmc_wait_for_req(host, &mrq);
return cmd->error;
}
EXPORT_SYMBOL(mmc_wait_for_cmd);
/**
* mmc_stop_bkops - stop ongoing BKOPS
* @card: MMC card to check BKOPS
*
* Send HPI command to stop ongoing background operations to
* allow rapid servicing of foreground operations, e.g. read/
* writes. Wait until the card comes out of the programming state
* to avoid errors in servicing read/write requests.
*
* The function should be called with host claimed.
*/
int mmc_stop_bkops(struct mmc_card *card)
{
int err = 0;
BUG_ON(!card);
/*
* Notify the delayed work to be cancelled, in case it was already
* removed from the queue, but was not started yet
*/
card->bkops_info.cancel_delayed_work = true;
if (<API key>(&card->bkops_info.dw))
<API key>(&card->bkops_info.dw);
if (!<API key>(card))
goto out;
/*
* If idle time bkops is running on the card, let's not get into
* suspend.
*/
if (<API key>(card)
&& (card->host->parent->power.runtime_status == RPM_SUSPENDING)
&& <API key>(card)) {
err = -EBUSY;
goto out;
}
err = mmc_interrupt_hpi(card);
/*
* If err is EINVAL, we can't issue an HPI.
* It should complete the BKOPS.
*/
if (!err || (err == -EINVAL)) {
<API key>(card);
err = 0;
}
out:
return err;
}
EXPORT_SYMBOL(mmc_stop_bkops);
int <API key>(struct mmc_card *card)
{
int err;
u8 *ext_csd;
/*
* In future work, we should consider storing the entire ext_csd.
*/
ext_csd = kmalloc(512, GFP_KERNEL);
if (!ext_csd) {
pr_err("%s: could not allocate buffer to receive the ext_csd.\n",
mmc_hostname(card->host));
return -ENOMEM;
}
mmc_claim_host(card->host);
err = mmc_send_ext_csd(card, ext_csd);
mmc_release_host(card->host);
if (err)
goto out;
card->ext_csd.raw_bkops_status = ext_csd[<API key>];
card->ext_csd.<API key> = ext_csd[<API key>];
out:
kfree(ext_csd);
return err;
}
EXPORT_SYMBOL(<API key>);
/**
* <API key> - set the timeout for a data command
* @data: data phase for command
* @card: the MMC card associated with the data transfer
*
* Computes the data timeout parameters according to the
* correct algorithm given the card type.
*/
void <API key>(struct mmc_data *data, const struct mmc_card *card)
{
unsigned int mult;
/*
* SDIO cards only define an upper 1 s limit on access.
*/
if (mmc_card_sdio(card)) {
data->timeout_ns = 1000000000;
data->timeout_clks = 0;
return;
}
/*
* SD cards use a 100 multiplier rather than 10
*/
mult = mmc_card_sd(card) ? 100 : 10;
/*
* Scale up the multiplier (and therefore the timeout) by
* the r2w factor for writes.
*/
if (data->flags & MMC_DATA_WRITE)
mult <<= card->csd.r2w_factor;
data->timeout_ns = card->csd.tacc_ns * mult;
data->timeout_clks = card->csd.tacc_clks * mult;
/*
* SD cards also have an upper limit on the timeout.
*/
if (mmc_card_sd(card)) {
unsigned int timeout_us, limit_us;
timeout_us = data->timeout_ns / 1000;
if (mmc_host_clk_rate(card->host))
timeout_us += data->timeout_clks * 1000 /
(mmc_host_clk_rate(card->host) / 1000);
if (data->flags & MMC_DATA_WRITE)
/*
* The MMC spec "It is strongly recommended
* for hosts to implement more than 500ms
* timeout value even if the card indicates
* the 250ms maximum busy length." Even the
* previous value of 300ms is known to be
* insufficient for some cards.
*/
limit_us = 3000000;
else
limit_us = 100000;
/*
* SDHC cards always use these fixed values.
*/
if (timeout_us > limit_us || mmc_card_blockaddr(card)) {
data->timeout_ns = limit_us * 1000;
data->timeout_clks = 0;
}
}
/*
* Some cards require longer data read timeout than indicated in CSD.
* Address this by setting the read timeout to a "reasonably high"
* value. For the cards tested, 300ms has proven enough. If necessary,
* this value can be increased if other problematic cards require this.
*/
if (<API key>(card) && data->flags & MMC_DATA_READ) {
data->timeout_ns = 300000000;
data->timeout_clks = 0;
}
/*
* Some cards need very high timeouts if driven in SPI mode.
* The worst observed timeout was 900ms after writing a
* continuous stream of data until the internal logic
* overflowed.
*/
if (mmc_host_is_spi(card->host)) {
if (data->flags & MMC_DATA_WRITE) {
if (data->timeout_ns < 1000000000)
data->timeout_ns = 1000000000;
} else {
if (data->timeout_ns < 100000000)
data->timeout_ns = 100000000; /* 100ms */
}
}
/* Increase the timeout values for some bad INAND MCP devices */
if (card->quirks & <API key>) {
data->timeout_ns = 4000000000u;
data->timeout_clks = 0;
}
}
EXPORT_SYMBOL(<API key>);
/**
* mmc_align_data_size - pads a transfer size to a more optimal value
* @card: the MMC card associated with the data transfer
* @sz: original transfer size
*
* Pads the original data size with a number of extra bytes in
* order to avoid controller bugs and/or performance hits
* (e.g. some controllers revert to PIO for certain sizes).
*
* Returns the improved size, which might be unmodified.
*
* Note that this function is only relevant when issuing a
* single scatter gather entry.
*/
unsigned int mmc_align_data_size(struct mmc_card *card, unsigned int sz)
{
/*
* FIXME: We don't have a system for the controller to tell
* the core about its problems yet, so for now we just 32-bit
* align the size.
*/
sz = ((sz + 3) / 4) * 4;
return sz;
}
EXPORT_SYMBOL(mmc_align_data_size);
/**
* __mmc_claim_host - exclusively claim a host
* @host: mmc host to claim
* @abort: whether or not the operation should be aborted
*
* Claim a host for a set of operations. If @abort is non null and
* dereference a non-zero value then this will return prematurely with
* that non-zero value without acquiring the lock. Returns zero
* with the lock held otherwise.
*/
int __mmc_claim_host(struct mmc_host *host, atomic_t *abort)
{
DECLARE_WAITQUEUE(wait, current);
unsigned long flags;
int stop;
might_sleep();
add_wait_queue(&host->wq, &wait);
spin_lock_irqsave(&host->lock, flags);
while (1) {
set_current_state(<API key>);
stop = abort ? atomic_read(abort) : 0;
if (stop || !host->claimed || host->claimer == current)
break;
<API key>(&host->lock, flags);
schedule();
spin_lock_irqsave(&host->lock, flags);
}
set_current_state(TASK_RUNNING);
if (!stop) {
host->claimed = 1;
host->claimer = current;
host->claim_cnt += 1;
} else
wake_up(&host->wq);
<API key>(&host->lock, flags);
remove_wait_queue(&host->wq, &wait);
if (host->ops->enable && !stop && host->claim_cnt == 1)
host->ops->enable(host);
return stop;
}
EXPORT_SYMBOL(__mmc_claim_host);
/**
* mmc_try_claim_host - try exclusively to claim a host
* @host: mmc host to claim
*
* Returns %1 if the host is claimed, %0 otherwise.
*/
int mmc_try_claim_host(struct mmc_host *host)
{
int claimed_host = 0;
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
if (!host->claimed || host->claimer == current) {
host->claimed = 1;
host->claimer = current;
host->claim_cnt += 1;
claimed_host = 1;
}
<API key>(&host->lock, flags);
if (host->ops->enable && claimed_host && host->claim_cnt == 1)
host->ops->enable(host);
return claimed_host;
}
EXPORT_SYMBOL(mmc_try_claim_host);
/**
* mmc_release_host - release a host
* @host: mmc host to release
*
* Release a MMC host, allowing others to claim the host
* for their operations.
*/
void mmc_release_host(struct mmc_host *host)
{
unsigned long flags;
WARN_ON(!host->claimed);
if (host->ops->disable && host->claim_cnt == 1)
host->ops->disable(host);
spin_lock_irqsave(&host->lock, flags);
if (--host->claim_cnt) {
/* Release for nested claim */
<API key>(&host->lock, flags);
} else {
host->claimed = 0;
host->claimer = NULL;
<API key>(&host->lock, flags);
wake_up(&host->wq);
}
}
EXPORT_SYMBOL(mmc_release_host);
/*
* Internal function that does the actual ios call to the host driver,
* optionally printing some debug output.
*/
void mmc_set_ios(struct mmc_host *host)
{
struct mmc_ios *ios = &host->ios;
pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u "
"width %u timing %u\n",
mmc_hostname(host), ios->clock, ios->bus_mode,
ios->power_mode, ios->chip_select, ios->vdd,
ios->bus_width, ios->timing);
if (ios->clock > 0)
mmc_set_ungated(host);
host->ops->set_ios(host, ios);
if (ios->old_rate != ios->clock) {
if (likely(ios->clk_ts)) {
char trace_info[80];
snprintf(trace_info, 80,
"%s: freq_KHz %d --> %d | t = %d",
mmc_hostname(host), ios->old_rate / 1000,
ios->clock / 1000, jiffies_to_msecs(
(long)jiffies - (long)ios->clk_ts));
trace_mmc_clk(trace_info);
}
ios->old_rate = ios->clock;
ios->clk_ts = jiffies;
}
}
EXPORT_SYMBOL(mmc_set_ios);
/*
* Control chip select pin on a host.
*/
void mmc_set_chip_select(struct mmc_host *host, int mode)
{
mmc_host_clk_hold(host);
host->ios.chip_select = mode;
mmc_set_ios(host);
<API key>(host);
}
/*
* Sets the host clock to the highest possible frequency that
* is below "hz".
*/
static void __mmc_set_clock(struct mmc_host *host, unsigned int hz)
{
WARN_ON(hz < host->f_min);
if (hz > host->f_max)
hz = host->f_max;
host->ios.clock = hz;
mmc_set_ios(host);
}
void mmc_set_clock(struct mmc_host *host, unsigned int hz)
{
mmc_host_clk_hold(host);
__mmc_set_clock(host, hz);
<API key>(host);
}
#ifdef CONFIG_MMC_CLKGATE
/*
* This gates the clock by setting it to 0 Hz.
*/
void mmc_gate_clock(struct mmc_host *host)
{
unsigned long flags;
WARN_ON(!host->ios.clock);
spin_lock_irqsave(&host->clk_lock, flags);
host->clk_old = host->ios.clock;
host->ios.clock = 0;
host->clk_gated = true;
<API key>(&host->clk_lock, flags);
mmc_set_ios(host);
}
/*
* This restores the clock from gating by using the cached
* clock value.
*/
void mmc_ungate_clock(struct mmc_host *host)
{
/*
* We should previously have gated the clock, so the clock shall
* be 0 here! The clock may however be 0 during initialization,
* when some request operations are performed before setting
* the frequency. When ungate is requested in that situation
* we just ignore the call.
*/
if (host->clk_old) {
WARN_ON(host->ios.clock);
/* This call will also set host->clk_gated to false */
__mmc_set_clock(host, host->clk_old);
}
}
void mmc_set_ungated(struct mmc_host *host)
{
unsigned long flags;
/*
* We've been given a new frequency while the clock is gated,
* so make sure we regard this as ungating it.
*/
spin_lock_irqsave(&host->clk_lock, flags);
host->clk_gated = false;
<API key>(&host->clk_lock, flags);
}
#else
void mmc_set_ungated(struct mmc_host *host)
{
}
#endif
/*
* Change the bus mode (open drain/push-pull) of a host.
*/
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
{
mmc_host_clk_hold(host);
host->ios.bus_mode = mode;
mmc_set_ios(host);
<API key>(host);
}
/*
* Change data bus width of a host.
*/
void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
{
mmc_host_clk_hold(host);
host->ios.bus_width = width;
mmc_set_ios(host);
<API key>(host);
}
/**
* <API key> - Convert a voltage to the OCR bit number
* @vdd: voltage (mV)
* @low_bits: prefer low bits in boundary cases
*
* This function returns the OCR bit number according to the provided @vdd
* value. If conversion is not possible a negative errno value returned.
*
* Depending on the @low_bits flag the function prefers low or high OCR bits
* on boundary voltages. For example,
* with @low_bits = true, 3300 mV translates to ilog2(MMC_VDD_32_33);
* with @low_bits = false, 3300 mV translates to ilog2(MMC_VDD_33_34);
*
* Any value in the [1951:1999] range translates to the ilog2(MMC_VDD_20_21).
*/
static int <API key>(int vdd, bool low_bits)
{
const int max_bit = ilog2(MMC_VDD_35_36);
int bit;
if (vdd < 1650 || vdd > 3600)
return -EINVAL;
if (vdd >= 1650 && vdd <= 1950)
return ilog2(MMC_VDD_165_195);
if (low_bits)
vdd -= 1;
/* Base 2000 mV, step 100 mV, bit's base 8. */
bit = (vdd - 2000) / 100 + 8;
if (bit > max_bit)
return max_bit;
return bit;
}
/**
* <API key> - Convert a voltage range to the OCR mask
* @vdd_min: minimum voltage value (mV)
* @vdd_max: maximum voltage value (mV)
*
* This function returns the OCR mask bits according to the provided @vdd_min
* and @vdd_max values. If conversion is not possible the function returns 0.
*
* Notes wrt boundary cases:
* This function sets the OCR bits for all boundary voltages, for example
* [3300:3400] range is translated to MMC_VDD_32_33 | MMC_VDD_33_34 |
* MMC_VDD_34_35 mask.
*/
u32 <API key>(int vdd_min, int vdd_max)
{
u32 mask = 0;
if (vdd_max < vdd_min)
return 0;
/* Prefer high bits for the boundary vdd_max values. */
vdd_max = <API key>(vdd_max, false);
if (vdd_max < 0)
return 0;
/* Prefer low bits for the boundary vdd_min values. */
vdd_min = <API key>(vdd_min, true);
if (vdd_min < 0)
return 0;
/* Fill the mask, from max bit to min bit. */
while (vdd_max >= vdd_min)
mask |= 1 << vdd_max
return mask;
}
EXPORT_SYMBOL(<API key>);
#ifdef CONFIG_REGULATOR
/**
* <API key> - return mask of supported voltages
* @supply: regulator to use
*
* This returns either a negative errno, or a mask of voltages that
* can be provided to MMC/SD/SDIO devices using the specified voltage
* regulator. This would normally be called before registering the
* MMC host adapter.
*/
int <API key>(struct regulator *supply)
{
int result = 0;
int count;
int i;
count = <API key>(supply);
if (count < 0)
return count;
for (i = 0; i < count; i++) {
int vdd_uV;
int vdd_mV;
vdd_uV = <API key>(supply, i);
if (vdd_uV <= 0)
continue;
vdd_mV = vdd_uV / 1000;
result |= <API key>(vdd_mV, vdd_mV);
}
return result;
}
EXPORT_SYMBOL(<API key>);
/**
* <API key> - set regulator to match host->ios voltage
* @mmc: the host to regulate
* @supply: regulator to use
* @vdd_bit: zero for power off, else a bit number (host->ios.vdd)
*
* Returns zero on success, else negative errno.
*
* MMC host drivers may use this to enable or disable a regulator using
* a particular supply voltage. This would normally be called from the
* set_ios() method.
*/
int <API key>(struct mmc_host *mmc,
struct regulator *supply,
unsigned short vdd_bit)
{
int result = 0;
int min_uV, max_uV;
if (vdd_bit) {
int tmp;
int voltage;
/* REVISIT <API key>() may have set some
* bits this regulator doesn't quite support ... don't
* be too picky, most cards and regulators are OK with
* a 0.1V range goof (it's a small error percentage).
*/
tmp = vdd_bit - ilog2(MMC_VDD_165_195);
if (tmp == 0) {
min_uV = 1650 * 1000;
max_uV = 1950 * 1000;
} else {
min_uV = 1900 * 1000 + tmp * 100 * 1000;
max_uV = min_uV + 100 * 1000;
}
/* avoid needless changes to this voltage; the regulator
* might not allow this operation
*/
voltage = <API key>(supply);
if (mmc->caps2 & <API key>)
min_uV = max_uV = voltage;
if (voltage < 0)
result = voltage;
else if (voltage < min_uV || voltage > max_uV)
result = <API key>(supply, min_uV, max_uV);
else
result = 0;
if (result == 0 && !mmc->regulator_enabled) {
result = regulator_enable(supply);
if (!result)
mmc->regulator_enabled = true;
}
} else if (mmc->regulator_enabled) {
result = regulator_disable(supply);
if (result == 0)
mmc->regulator_enabled = false;
}
if (result)
dev_err(mmc_dev(mmc),
"could not set regulator OCR (%d)\n", result);
return result;
}
EXPORT_SYMBOL(<API key>);
#endif /* CONFIG_REGULATOR */
/*
* Mask off any voltages we don't support and select
* the lowest voltage
*/
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
{
int bit;
ocr &= host->ocr_avail;
bit = ffs(ocr);
if (bit) {
bit -= 1;
ocr &= 3 << bit;
mmc_host_clk_hold(host);
host->ios.vdd = bit;
mmc_set_ios(host);
<API key>(host);
} else {
pr_warning("%s: host doesn't support card's voltages\n",
mmc_hostname(host));
ocr = 0;
}
return ocr;
}
int <API key>(struct mmc_host *host, int signal_voltage, bool cmd11)
{
struct mmc_command cmd = {0};
int err = 0;
BUG_ON(!host);
/*
* Send CMD11 only if the request is to switch the card to
* 1.8V signalling.
*/
if ((signal_voltage != <API key>) && cmd11) {
cmd.opcode = SD_SWITCH_VOLTAGE;
cmd.arg = 0;
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
err = mmc_wait_for_cmd(host, &cmd, 0);
if (err)
return err;
if (!mmc_host_is_spi(host) && (cmd.resp[0] & R1_ERROR))
return -EIO;
}
host->ios.signal_voltage = signal_voltage;
if (host->ops-><API key>) {
mmc_host_clk_hold(host);
err = host->ops-><API key>(host, &host->ios);
<API key>(host);
}
return err;
}
/*
* Select timing parameters for host.
*/
void mmc_set_timing(struct mmc_host *host, unsigned int timing)
{
mmc_host_clk_hold(host);
host->ios.timing = timing;
mmc_set_ios(host);
<API key>(host);
}
/*
* Select appropriate driver type for host.
*/
void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type)
{
mmc_host_clk_hold(host);
host->ios.drv_type = drv_type;
mmc_set_ios(host);
<API key>(host);
}
/*
* Apply power to the MMC stack. This is a two-stage process.
* First, we enable power to the card without the clock running.
* We then wait a bit for the power to stabilise. Finally,
* enable the bus drivers and clock to the card.
*
* We must _NOT_ enable the clock prior to power stablising.
*
* If a host does all the power sequencing itself, ignore the
* initial MMC_POWER_UP stage.
*/
void mmc_power_up(struct mmc_host *host)
{
int bit;
mmc_host_clk_hold(host);
/* If ocr is set, we use it */
if (host->ocr)
bit = ffs(host->ocr) - 1;
else
bit = fls(host->ocr_avail) - 1;
host->ios.vdd = bit;
if (mmc_host_is_spi(host))
host->ios.chip_select = MMC_CS_HIGH;
else {
host->ios.chip_select = MMC_CS_DONTCARE;
host->ios.bus_mode = <API key>;
}
host->ios.power_mode = MMC_POWER_UP;
host->ios.bus_width = MMC_BUS_WIDTH_1;
host->ios.timing = MMC_TIMING_LEGACY;
mmc_set_ios(host);
/*
* This delay should be sufficient to allow the power supply
* to reach the minimum voltage.
*/
mmc_delay(10);
host->ios.clock = host->f_init;
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
/*
* This delay must be at least 74 clock sizes, or 1 ms, or the
* time required to reach a stable voltage.
*/
mmc_delay(10);
<API key>(host);
}
void mmc_power_off(struct mmc_host *host)
{
mmc_host_clk_hold(host);
host->ios.clock = 0;
host->ios.vdd = 0;
/*
* Reset ocr mask to be the highest possible voltage supported for
* this mmc host. This value will be used at next power up.
*/
host->ocr = 1 << (fls(host->ocr_avail) - 1);
if (!mmc_host_is_spi(host)) {
host->ios.bus_mode = <API key>;
host->ios.chip_select = MMC_CS_DONTCARE;
}
host->ios.power_mode = MMC_POWER_OFF;
host->ios.bus_width = MMC_BUS_WIDTH_1;
host->ios.timing = MMC_TIMING_LEGACY;
mmc_set_ios(host);
/*
* Some configurations, such as the 802.11 SDIO card in the OLPC
* XO-1.5, require a short delay after poweroff before the card
* can be successfully turned on again.
*/
mmc_delay(1);
<API key>(host);
}
/*
* Cleanup when the last reference to the bus operator is dropped.
*/
static void __mmc_release_bus(struct mmc_host *host)
{
BUG_ON(!host);
BUG_ON(host->bus_refs);
BUG_ON(!host->bus_dead);
host->bus_ops = NULL;
}
/*
* Increase reference count of bus operator
*/
static inline void mmc_bus_get(struct mmc_host *host)
{
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
host->bus_refs++;
<API key>(&host->lock, flags);
}
/*
* Decrease reference count of bus operator and free it if
* it is the last reference.
*/
static inline void mmc_bus_put(struct mmc_host *host)
{
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
host->bus_refs
if ((host->bus_refs == 0) && host->bus_ops)
__mmc_release_bus(host);
<API key>(&host->lock, flags);
}
int mmc_resume_bus(struct mmc_host *host)
{
unsigned long flags;
if (!<API key>(host))
return -EINVAL;
printk("%s: Starting deferred resume\n", mmc_hostname(host));
spin_lock_irqsave(&host->lock, flags);
host->bus_resume_flags &= ~<API key>;
host->rescan_disable = 0;
<API key>(&host->lock, flags);
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
mmc_power_up(host);
BUG_ON(!host->bus_ops->resume);
host->bus_ops->resume(host);
}
if (host->bus_ops->detect && !host->bus_dead)
host->bus_ops->detect(host);
mmc_bus_put(host);
printk("%s: Deferred resume completed\n", mmc_hostname(host));
return 0;
}
EXPORT_SYMBOL(mmc_resume_bus);
/*
* Assign a mmc bus handler to a host. Only one bus handler may control a
* host at any given time.
*/
void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops)
{
unsigned long flags;
BUG_ON(!host);
BUG_ON(!ops);
WARN_ON(!host->claimed);
spin_lock_irqsave(&host->lock, flags);
BUG_ON(host->bus_ops);
BUG_ON(host->bus_refs);
host->bus_ops = ops;
host->bus_refs = 1;
host->bus_dead = 0;
<API key>(&host->lock, flags);
}
/*
* Remove the current bus handler from a host.
*/
void mmc_detach_bus(struct mmc_host *host)
{
unsigned long flags;
BUG_ON(!host);
WARN_ON(!host->claimed);
WARN_ON(!host->bus_ops);
spin_lock_irqsave(&host->lock, flags);
host->bus_dead = 1;
<API key>(&host->lock, flags);
mmc_bus_put(host);
}
/**
* mmc_detect_change - process change of state on a MMC socket
* @host: host which changed state.
* @delay: optional delay to wait before detection (jiffies)
*
* MMC drivers should call this when they detect a card has been
* inserted or removed. The MMC layer will confirm that any
* present card is still functional, and initialize any newly
* inserted.
*/
void mmc_detect_change(struct mmc_host *host, unsigned long delay)
{
#ifdef CONFIG_MMC_DEBUG
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
WARN_ON(host->removed);
<API key>(&host->lock, flags);
#endif
host->detect_change = 1;
wake_lock(&host->detect_wake_lock);
<API key>(&host->detect, delay);
}
EXPORT_SYMBOL(mmc_detect_change);
void mmc_init_erase(struct mmc_card *card)
{
unsigned int sz;
if (is_power_of_2(card->erase_size))
card->erase_shift = ffs(card->erase_size) - 1;
else
card->erase_shift = 0;
/*
* It is possible to erase an arbitrarily large area of an SD or MMC
* card. That is not desirable because it can take a long time
* (minutes) potentially delaying more important I/O, and also the
* timeout calculations become increasingly hugely over-estimated.
* Consequently, 'pref_erase' is defined as a guide to limit erases
* to that size and alignment.
*
* For SD cards that define Allocation Unit size, limit erases to one
* Allocation Unit at a time. For MMC cards that define High Capacity
* Erase Size, whether it is switched on or not, limit to that size.
* Otherwise just have a stab at a good value. For modern cards it
* will end up being 4MiB. Note that if the value is too small, it
* can end up taking longer to erase.
*/
if (mmc_card_sd(card) && card->ssr.au) {
card->pref_erase = card->ssr.au;
card->erase_shift = ffs(card->ssr.au) - 1;
} else if (card->ext_csd.hc_erase_size) {
card->pref_erase = card->ext_csd.hc_erase_size;
} else {
sz = (card->csd.capacity << (card->csd.read_blkbits - 9)) >> 11;
if (sz < 128)
card->pref_erase = 512 * 1024 / 512;
else if (sz < 512)
card->pref_erase = 1024 * 1024 / 512;
else if (sz < 1024)
card->pref_erase = 2 * 1024 * 1024 / 512;
else
card->pref_erase = 4 * 1024 * 1024 / 512;
if (card->pref_erase < card->erase_size)
card->pref_erase = card->erase_size;
else {
sz = card->pref_erase % card->erase_size;
if (sz)
card->pref_erase += card->erase_size - sz;
}
}
}
static unsigned int <API key>(struct mmc_card *card,
unsigned int arg, unsigned int qty)
{
unsigned int erase_timeout;
if (arg == MMC_DISCARD_ARG ||
(arg == MMC_TRIM_ARG && card->ext_csd.rev >= 6)) {
erase_timeout = card->ext_csd.trim_timeout;
} else if (card->ext_csd.erase_group_def & 1) {
/* High Capacity Erase Group Size uses HC timeouts */
if (arg == MMC_TRIM_ARG)
erase_timeout = card->ext_csd.trim_timeout;
else
erase_timeout = card->ext_csd.hc_erase_timeout;
} else {
/* CSD Erase Group Size uses write timeout */
unsigned int mult = (10 << card->csd.r2w_factor);
unsigned int timeout_clks = card->csd.tacc_clks * mult;
unsigned int timeout_us;
/* Avoid overflow: e.g. tacc_ns=80000000 mult=1280 */
if (card->csd.tacc_ns < 1000000)
timeout_us = (card->csd.tacc_ns * mult) / 1000;
else
timeout_us = (card->csd.tacc_ns / 1000) * mult;
/*
* ios.clock is only a target. The real clock rate might be
* less but not that much less, so fudge it by multiplying by 2.
*/
timeout_clks <<= 1;
timeout_us += (timeout_clks * 1000) /
(mmc_host_clk_rate(card->host) / 1000);
erase_timeout = timeout_us / 1000;
/*
* Theoretically, the calculation could underflow so round up
* to 1ms in that case.
*/
if (!erase_timeout)
erase_timeout = 1;
}
/* Multiplier for secure operations */
if (arg & MMC_SECURE_ARGS) {
if (arg == <API key>)
erase_timeout *= card->ext_csd.sec_erase_mult;
else
erase_timeout *= card->ext_csd.sec_trim_mult;
}
erase_timeout *= qty;
/*
* Ensure at least a 1 second timeout for SPI as per
* '<API key>()'
*/
if (mmc_host_is_spi(card->host) && erase_timeout < 1000)
erase_timeout = 1000;
return erase_timeout;
}
static unsigned int <API key>(struct mmc_card *card,
unsigned int arg,
unsigned int qty)
{
unsigned int erase_timeout;
if (card->ssr.erase_timeout) {
/* Erase timeout specified in SD Status Register (SSR) */
erase_timeout = card->ssr.erase_timeout * qty +
card->ssr.erase_offset;
} else {
/*
* Erase timeout not specified in SD Status Register (SSR) so
* use 250ms per write block.
*/
erase_timeout = 250 * qty;
}
/* Must not be less than 1 second */
if (erase_timeout < 1000)
erase_timeout = 1000;
return erase_timeout;
}
static unsigned int mmc_erase_timeout(struct mmc_card *card,
unsigned int arg,
unsigned int qty)
{
if (mmc_card_sd(card))
return <API key>(card, arg, qty);
else
return <API key>(card, arg, qty);
}
static int mmc_do_erase(struct mmc_card *card, unsigned int from,
unsigned int to, unsigned int arg)
{
struct mmc_command cmd = {0};
unsigned int qty = 0;
unsigned long timeout;
int err;
/*
* qty is used to calculate the erase timeout which depends on how many
* erase groups (or allocation units in SD terminology) are affected.
* We count erasing part of an erase group as one erase group.
* For SD, the allocation units are always a power of 2. For MMC, the
* erase group size is almost certainly also power of 2, but it does not
* seem to insist on that in the JEDEC standard, so we fall back to
* division in that case. SD may not specify an allocation unit size,
* in which case the timeout is based on the number of write blocks.
*
* Note that the timeout for secure trim 2 will only be correct if the
* number of erase groups specified is the same as the total of all
* preceding secure trim 1 commands. Since the power may have been
* lost since the secure trim 1 commands occurred, it is generally
* impossible to calculate the secure trim 2 timeout correctly.
*/
if (card->erase_shift)
qty += ((to >> card->erase_shift) -
(from >> card->erase_shift)) + 1;
else if (mmc_card_sd(card))
qty += to - from + 1;
else
qty += ((to / card->erase_size) -
(from / card->erase_size)) + 1;
if (!mmc_card_blockaddr(card)) {
from <<= 9;
to <<= 9;
}
if (mmc_card_sd(card))
cmd.opcode = <API key>;
else
cmd.opcode = <API key>;
cmd.arg = from;
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
err = mmc_wait_for_cmd(card->host, &cmd, 0);
if (err) {
pr_err("mmc_erase: group start error %d, "
"status %#x\n", err, cmd.resp[0]);
err = -EIO;
goto out;
}
memset(&cmd, 0, sizeof(struct mmc_command));
if (mmc_card_sd(card))
cmd.opcode = SD_ERASE_WR_BLK_END;
else
cmd.opcode = MMC_ERASE_GROUP_END;
cmd.arg = to;
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
err = mmc_wait_for_cmd(card->host, &cmd, 0);
if (err) {
pr_err("mmc_erase: group end error %d, status %
err, cmd.resp[0]);
err = -EIO;
goto out;
}
memset(&cmd, 0, sizeof(struct mmc_command));
cmd.opcode = MMC_ERASE;
cmd.arg = arg;
cmd.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
cmd.cmd_timeout_ms = mmc_erase_timeout(card, arg, qty);
err = mmc_wait_for_cmd(card->host, &cmd, 0);
if (err) {
pr_err("mmc_erase: erase error %d, status %
err, cmd.resp[0]);
err = -EIO;
goto out;
}
if (mmc_host_is_spi(card->host))
goto out;
timeout = jiffies + msecs_to_jiffies(MMC_CORE_TIMEOUT_MS);
do {
memset(&cmd, 0, sizeof(struct mmc_command));
cmd.opcode = MMC_SEND_STATUS;
cmd.arg = card->rca << 16;
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
/* Do not retry else we can't see errors */
err = mmc_wait_for_cmd(card->host, &cmd, 0);
if (err || (cmd.resp[0] & 0xFDF92000)) {
pr_err("error %d requesting status %
err, cmd.resp[0]);
err = -EIO;
goto out;
}
/* Timeout if the device never becomes ready for data and
* never leaves the program state.
*/
if (time_after(jiffies, timeout)) {
pr_err("%s: Card stuck in programming state! %s\n",
mmc_hostname(card->host), __func__);
err = -EIO;
goto out;
}
} while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
(R1_CURRENT_STATE(cmd.resp[0]) == R1_STATE_PRG));
out:
return err;
}
/**
* mmc_erase - erase sectors.
* @card: card to erase
* @from: first sector to erase
* @nr: number of sectors to erase
* @arg: erase command argument (SD supports only %MMC_ERASE_ARG)
*
* Caller must claim host before calling this function.
*/
int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
unsigned int arg)
{
unsigned int rem, to = from + nr;
if (!(card->host->caps & MMC_CAP_ERASE) ||
!(card->csd.cmdclass & CCC_ERASE))
return -EOPNOTSUPP;
if (!card->erase_size)
return -EOPNOTSUPP;
if (mmc_card_sd(card) && arg != MMC_ERASE_ARG)
return -EOPNOTSUPP;
if ((arg & MMC_SECURE_ARGS) &&
!(card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN))
return -EOPNOTSUPP;
if ((arg & MMC_TRIM_ARGS) &&
!(card->ext_csd.sec_feature_support & <API key>))
return -EOPNOTSUPP;
if (arg == <API key>) {
if (from % card->erase_size || nr % card->erase_size)
return -EINVAL;
}
if (arg == MMC_ERASE_ARG) {
rem = from % card->erase_size;
if (rem) {
rem = card->erase_size - rem;
from += rem;
if (nr > rem)
nr -= rem;
else
return 0;
}
rem = nr % card->erase_size;
if (rem)
nr -= rem;
}
if (nr == 0)
return 0;
to = from + nr;
if (to <= from)
return -EINVAL;
/* 'from' and 'to' are inclusive */
to -= 1;
return mmc_do_erase(card, from, to, arg);
}
EXPORT_SYMBOL(mmc_erase);
int mmc_can_erase(struct mmc_card *card)
{
if ((card->host->caps & MMC_CAP_ERASE) &&
(card->csd.cmdclass & CCC_ERASE) && card->erase_size)
return 1;
return 0;
}
EXPORT_SYMBOL(mmc_can_erase);
int mmc_can_trim(struct mmc_card *card)
{
if (card->ext_csd.sec_feature_support & <API key>)
return 1;
return 0;
}
EXPORT_SYMBOL(mmc_can_trim);
int mmc_can_discard(struct mmc_card *card)
{
/*
* As there's no way to detect the discard support bit at v4.5
* use the s/w feature support filed.
*/
if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE)
return 1;
return 0;
}
EXPORT_SYMBOL(mmc_can_discard);
int mmc_can_sanitize(struct mmc_card *card)
{
if (!mmc_can_trim(card) && !mmc_can_erase(card))
return 0;
if (card->ext_csd.sec_feature_support & <API key>)
return 1;
return 0;
}
EXPORT_SYMBOL(mmc_can_sanitize);
int <API key>(struct mmc_card *card)
{
if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN)
return 1;
return 0;
}
EXPORT_SYMBOL(<API key>);
int <API key>(struct mmc_card *card, unsigned int from,
unsigned int nr)
{
if (!card->erase_size)
return 0;
if (from % card->erase_size || nr % card->erase_size)
return 0;
return 1;
}
EXPORT_SYMBOL(<API key>);
static unsigned int <API key>(struct mmc_card *card,
unsigned int arg)
{
struct mmc_host *host = card->host;
unsigned int max_discard, x, y, qty = 0, max_qty, timeout;
unsigned int last_timeout = 0;
if (card->erase_shift)
max_qty = UINT_MAX >> card->erase_shift;
else if (mmc_card_sd(card))
max_qty = UINT_MAX;
else
max_qty = UINT_MAX / card->erase_size;
/* Find the largest qty with an OK timeout */
do {
y = 0;
for (x = 1; x && x <= max_qty && max_qty - x >= qty; x <<= 1) {
timeout = mmc_erase_timeout(card, arg, qty + x);
if (timeout > host->max_discard_to)
break;
if (timeout < last_timeout)
break;
last_timeout = timeout;
y = x;
}
qty += y;
} while (y);
if (!qty)
return 0;
if (qty == 1)
return 1;
/* Convert qty to sectors */
if (card->erase_shift)
max_discard = --qty << card->erase_shift;
else if (mmc_card_sd(card))
max_discard = qty;
else
max_discard = --qty * card->erase_size;
return max_discard;
}
unsigned int <API key>(struct mmc_card *card)
{
struct mmc_host *host = card->host;
unsigned int max_discard, max_trim;
if (!host->max_discard_to)
return UINT_MAX;
/*
* Without erase_group_def set, MMC erase timeout depends on clock
* frequence which can change. In that case, the best choice is
* just the preferred erase size.
*/
if (mmc_card_mmc(card) && !(card->ext_csd.erase_group_def & 1))
return card->pref_erase;
max_discard = <API key>(card, MMC_ERASE_ARG);
if (mmc_can_trim(card)) {
max_trim = <API key>(card, MMC_TRIM_ARG);
if (max_trim < max_discard)
max_discard = max_trim;
} else if (max_discard < card->erase_size) {
max_discard = 0;
}
pr_debug("%s: calculated max. discard sectors %u for timeout %u ms\n",
mmc_hostname(host), max_discard, host->max_discard_to);
return max_discard;
}
EXPORT_SYMBOL(<API key>);
int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
{
struct mmc_command cmd = {0};
if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
return 0;
cmd.opcode = MMC_SET_BLOCKLEN;
cmd.arg = blocklen;
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
return mmc_wait_for_cmd(card->host, &cmd, 5);
}
EXPORT_SYMBOL(mmc_set_blocklen);
static void <API key>(struct mmc_host *host)
{
if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
return;
mmc_host_clk_hold(host);
host->ops->hw_reset(host);
<API key>(host);
}
int mmc_can_reset(struct mmc_card *card)
{
u8 rst_n_function;
if (mmc_card_sdio(card))
return 0;
if (mmc_card_mmc(card)) {
rst_n_function = card->ext_csd.rst_n_function;
if ((rst_n_function & <API key>) !=
<API key>)
return 0;
}
return 1;
}
EXPORT_SYMBOL(mmc_can_reset);
static int mmc_do_hw_reset(struct mmc_host *host, int check)
{
struct mmc_card *card = host->card;
if (!host->bus_ops->power_restore)
return -EOPNOTSUPP;
if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
return -EOPNOTSUPP;
if (!card)
return -EINVAL;
if (!mmc_can_reset(card))
return -EOPNOTSUPP;
mmc_host_clk_hold(host);
mmc_set_clock(host, host->f_init);
host->ops->hw_reset(host);
/* If the reset has happened, then a status command will fail */
if (check) {
struct mmc_command cmd = {0};
int err;
cmd.opcode = MMC_SEND_STATUS;
if (!mmc_host_is_spi(card->host))
cmd.arg = card->rca << 16;
cmd.flags = MMC_RSP_SPI_R2 | MMC_RSP_R1 | MMC_CMD_AC;
err = mmc_wait_for_cmd(card->host, &cmd, 0);
if (!err) {
<API key>(host);
return -ENOSYS;
}
}
host->card->state &= ~(MMC_STATE_HIGHSPEED | <API key>);
if (mmc_host_is_spi(host)) {
host->ios.chip_select = MMC_CS_HIGH;
host->ios.bus_mode = <API key>;
} else {
host->ios.chip_select = MMC_CS_DONTCARE;
host->ios.bus_mode = <API key>;
}
host->ios.bus_width = MMC_BUS_WIDTH_1;
host->ios.timing = MMC_TIMING_LEGACY;
mmc_set_ios(host);
<API key>(host);
return host->bus_ops->power_restore(host);
}
int mmc_hw_reset(struct mmc_host *host)
{
return mmc_do_hw_reset(host, 0);
}
EXPORT_SYMBOL(mmc_hw_reset);
int mmc_hw_reset_check(struct mmc_host *host)
{
return mmc_do_hw_reset(host, 1);
}
EXPORT_SYMBOL(mmc_hw_reset_check);
/**
* <API key>() - reset clock scaling statistics
* @host: pointer to mmc host structure
*/
void <API key>(struct mmc_host *host)
{
host->clk_scaling.busy_time_us = 0;
host->clk_scaling.window_time = jiffies;
}
EXPORT_SYMBOL_GPL(<API key>);
/**
* <API key>() - get max. frequency supported
* @host: pointer to mmc host structure
*
* Returns max. frequency supported by card/host. If the
* timing mode is SDR50/SDR104/HS200/DDR50 return appropriate
* max. frequency in these modes else, use the current frequency.
* Also, allow host drivers to overwrite the frequency in case
* they support "get_max_frequency" host ops.
*/
unsigned long <API key>(struct mmc_host *host)
{
unsigned long freq;
if (host->ops && host->ops->get_max_frequency) {
freq = host->ops->get_max_frequency(host);
goto out;
}
switch (host->ios.timing) {
case <API key>:
freq = UHS_SDR50_MAX_DTR;
break;
case <API key>:
freq = UHS_SDR104_MAX_DTR;
break;
case <API key>:
freq = MMC_HS200_MAX_DTR;
break;
case <API key>:
freq = UHS_DDR50_MAX_DTR;
break;
default:
mmc_host_clk_hold(host);
freq = host->ios.clock;
<API key>(host);
break;
}
out:
return freq;
}
EXPORT_SYMBOL_GPL(<API key>);
/**
* <API key>() - get min. frequency supported
* @host: pointer to mmc host structure
*
* Returns min. frequency supported by card/host which doesn't impair
* performance for most usecases. If the timing mode is SDR50/SDR104/HS200
* return 50MHz value. If timing mode is DDR50 return 25MHz so that
* throughput would be equivalent to SDR50/SDR104 in 50MHz. Also, allow
* host drivers to overwrite the frequency in case they support
* "get_min_frequency" host ops.
*/
static unsigned long <API key>(struct mmc_host *host)
{
unsigned long freq;
if (host->ops && host->ops->get_min_frequency) {
freq = host->ops->get_min_frequency(host);
goto out;
}
switch (host->ios.timing) {
case <API key>:
case <API key>:
freq = UHS_SDR25_MAX_DTR;
break;
case <API key>:
freq = MMC_HIGH_52_MAX_DTR;
break;
case <API key>:
freq = UHS_DDR50_MAX_DTR / 2;
break;
default:
mmc_host_clk_hold(host);
freq = host->ios.clock;
<API key>(host);
break;
}
out:
return freq;
}
/*
* Scale down clocks to minimum frequency supported.
* The delayed work re-arms itself in case it cannot
* claim the host.
*/
static void mmc_clk_scale_work(struct work_struct *work)
{
struct mmc_host *host = container_of(work, struct mmc_host,
clk_scaling.work.work);
if (!host->card || !host->bus_ops ||
!host->bus_ops->change_bus_speed ||
!host->clk_scaling.enable || !host->ios.clock)
goto out;
if (!mmc_try_claim_host(host)) {
/* retry after a timer tick */
queue_delayed_work(system_nrt_wq, &host->clk_scaling.work, 1);
goto out;
}
mmc_clk_scaling(host, true);
mmc_release_host(host);
out:
return;
}
static bool <API key>(struct mmc_host *host)
{
struct mmc_card *card = host->card;
u32 status;
bool ret = false;
if (!card)
goto out;
if (mmc_send_status(card, &status)) {
pr_err("%s: Get card status fail\n", mmc_hostname(card->host));
goto out;
}
switch (R1_CURRENT_STATE(status)) {
case R1_STATE_TRAN:
ret = true;
break;
default:
break;
}
out:
return ret;
}
static int mmc_clk_update_freq(struct mmc_host *host,
unsigned long freq, enum mmc_load state)
{
int err = 0;
if (host->ops->notify_load) {
err = host->ops->notify_load(host, state);
if (err)
goto out;
}
if (freq != host->clk_scaling.curr_freq) {
if (!<API key>(host)) {
err = -EAGAIN;
goto error;
}
err = host->bus_ops->change_bus_speed(host, &freq);
if (!err)
host->clk_scaling.curr_freq = freq;
else
pr_err("%s: %s: failed (%d) at freq=%lu\n",
mmc_hostname(host), __func__, err, freq);
}
error:
if (err) {
/* restore previous state */
if (host->ops->notify_load)
host->ops->notify_load(host, host->clk_scaling.state);
}
out:
return err;
}
/**
* mmc_clk_scaling() - clock scaling decision algorithm
* @host: pointer to mmc host structure
* @from_wq: variable that specifies the context in which
* mmc_clk_scaling() is called.
*
* Calculate load percentage based on host busy time
* and total sampling interval and decide clock scaling
* based on scale up/down thresholds.
* If load is greater than up threshold increase the
* frequency to maximum as supported by host. Else,
* if load is less than down threshold, scale down the
* frequency to minimum supported by the host. Otherwise,
* retain current frequency and do nothing.
*/
static void mmc_clk_scaling(struct mmc_host *host, bool from_wq)
{
int err = 0;
struct mmc_card *card = host->card;
unsigned long total_time_ms = 0;
unsigned long busy_time_ms = 0;
unsigned long freq;
unsigned int up_threshold = host->clk_scaling.up_threshold;
unsigned int down_threshold = host->clk_scaling.down_threshold;
bool <API key> = false;
enum mmc_load state;
if (!card || !host->bus_ops || !host->bus_ops->change_bus_speed) {
pr_err("%s: %s: invalid entry\n", mmc_hostname(host), __func__);
goto out;
}
/* Check if the clocks are already gated. */
if (!host->ios.clock)
goto out;
if (<API key>(host->clk_scaling.window_time +
msecs_to_jiffies(host->clk_scaling.polling_delay_ms)))
goto out;
/* handle time wrap */
total_time_ms = jiffies_to_msecs((long)jiffies -
(long)host->clk_scaling.window_time);
/* Check if we re-enter during clock switching */
if (unlikely(host->clk_scaling.in_progress))
goto out;
host->clk_scaling.in_progress = true;
busy_time_ms = host->clk_scaling.busy_time_us / USEC_PER_MSEC;
freq = host->clk_scaling.curr_freq;
state = host->clk_scaling.state;
/*
* Note that the max. and min. frequency should be based
* on the timing modes that the card and host handshake
* during initialization.
*/
if ((busy_time_ms * 100 > total_time_ms * up_threshold)) {
freq = <API key>(host);
state = MMC_LOAD_HIGH;
} else if ((busy_time_ms * 100 < total_time_ms * down_threshold)) {
if (!from_wq)
<API key> = true;
freq = <API key>(host);
state = MMC_LOAD_LOW;
}
if (state != host->clk_scaling.state) {
if (!<API key>) {
if (!from_wq)
<API key>(
&host->clk_scaling.work);
err = mmc_clk_update_freq(host, freq, state);
if (!err)
host->clk_scaling.state = state;
else if (err == -EAGAIN)
goto no_reset_stats;
} else {
/*
* We hold claim host while queueing the scale down
* work, so delay atleast one timer tick to release
* host and re-claim while scaling down the clocks.
*/
queue_delayed_work(system_nrt_wq,
&host->clk_scaling.work, 1);
goto no_reset_stats;
}
}
<API key>(host);
no_reset_stats:
host->clk_scaling.in_progress = false;
out:
return;
}
/**
* <API key>() - Disable clock scaling
* @host: pointer to mmc host structure
*
* Disables clock scaling temporarily by setting enable
* property to false. To disable completely, one also
* need to set 'initialized' variable to false.
*/
void <API key>(struct mmc_host *host)
{
<API key>(&host->clk_scaling.work);
host->clk_scaling.enable = false;
}
EXPORT_SYMBOL_GPL(<API key>);
/**
* mmc_can_scale_clk() - Check if clock scaling is initialized
* @host: pointer to mmc host structure
*/
bool mmc_can_scale_clk(struct mmc_host *host)
{
return host->clk_scaling.initialized;
}
EXPORT_SYMBOL_GPL(mmc_can_scale_clk);
/**
* <API key>() - Initialize clock scaling
* @host: pointer to mmc host structure
*
* Initialize clock scaling for supported hosts.
* It is assumed that the caller ensure clock is
* running at maximum possible frequency before
* calling this function.
*/
void <API key>(struct mmc_host *host)
{
if (!host->card || !(host->caps2 & MMC_CAP2_CLK_SCALE))
return;
INIT_DELAYED_WORK(&host->clk_scaling.work, mmc_clk_scale_work);
host->clk_scaling.curr_freq = <API key>(host);
if (host->ops->notify_load)
host->ops->notify_load(host, MMC_LOAD_HIGH);
host->clk_scaling.state = MMC_LOAD_HIGH;
<API key>(host);
host->clk_scaling.enable = true;
host->clk_scaling.initialized = true;
pr_debug("%s: clk scaling enabled\n", mmc_hostname(host));
}
EXPORT_SYMBOL_GPL(<API key>);
/**
* <API key>() - Disable clock scaling
* @host: pointer to mmc host structure
*
* Disable clock scaling permanently.
*/
void <API key>(struct mmc_host *host)
{
<API key>(&host->clk_scaling.work);
memset(&host->clk_scaling, 0, sizeof(host->clk_scaling));
}
EXPORT_SYMBOL_GPL(<API key>);
static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
{
host->f_init = freq;
#ifdef CONFIG_MMC_DEBUG
pr_info("%s: %s: trying to init card at %u Hz\n",
mmc_hostname(host), __func__, host->f_init);
#endif
mmc_power_up(host);
/*
* Some eMMCs (with VCCQ always on) may not be reset after power up, so
* do a hardware reset if possible.
*/
<API key>(host);
/* Initialization should be done at 3.3 V I/O voltage. */
<API key>(host, <API key>, 0);
/*
* sdio_reset sends CMD52 to reset card. Since we do not know
* if the card is being re-initialized, just send it. CMD52
* should be ignored by SD/eMMC cards.
*/
sdio_reset(host);
mmc_go_idle(host);
mmc_send_if_cond(host, host->ocr_avail);
/* Order's important: probe SDIO, then SD, then MMC */
if (!mmc_attach_sdio(host))
return 0;
if (!host->ios.vdd)
mmc_power_up(host);
if (!mmc_attach_sd(host))
return 0;
if (!host->ios.vdd)
mmc_power_up(host);
if (!mmc_attach_mmc(host))
return 0;
mmc_power_off(host);
return -EIO;
}
int <API key>(struct mmc_host *host)
{
int ret;
if ((host->caps & <API key>) || !host->bus_ops->alive)
return 0;
if (!host->card || mmc_card_removed(host->card))
return 1;
ret = host->bus_ops->alive(host);
if (ret) {
<API key>(host->card);
pr_debug("%s: card remove detected\n", mmc_hostname(host));
}
return ret;
}
int <API key>(struct mmc_host *host)
{
struct mmc_card *card = host->card;
int ret;
WARN_ON(!host->claimed);
if (!card)
return 1;
ret = mmc_card_removed(card);
/*
* The card will be considered unchanged unless we have been asked to
* detect a change or host requires polling to provide card detection.
*/
if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL) &&
!(host->caps2 & <API key>))
return ret;
host->detect_change = 0;
if (!ret) {
ret = <API key>(host);
if (ret && (host->caps2 & <API key>)) {
/*
* Schedule a detect work as soon as possible to let a
* rescan handle the card removal.
*/
cancel_delayed_work(&host->detect);
mmc_detect_change(host, 0);
}
}
return ret;
}
EXPORT_SYMBOL(<API key>);
void mmc_rescan(struct work_struct *work)
{
struct mmc_host *host =
container_of(work, struct mmc_host, detect.work);
bool extend_wakelock = false;
if (host->rescan_disable)
return;
mmc_bus_get(host);
/*
* if there is a _removable_ card registered, check whether it is
* still present
*/
if (host->bus_ops && host->bus_ops->detect && !host->bus_dead
&& !(host->caps & <API key>))
host->bus_ops->detect(host);
host->detect_change = 0;
/* If the card was removed the bus will be marked
* as dead - extend the wakelock so userspace
* can respond */
if (host->bus_dead)
extend_wakelock = 1;
/* If the card was removed the bus will be marked
* as dead - extend the wakelock so userspace
* can respond */
if (host->bus_dead)
extend_wakelock = 1;
/*
* Let mmc_bus_put() free the bus/bus_ops if we've found that
* the card is no longer present.
*/
mmc_bus_put(host);
mmc_bus_get(host);
/* if there still is a card present, stop here */
if (host->bus_ops != NULL) {
mmc_bus_put(host);
goto out;
}
/*
* Only we can add a new handler, so it's safe to
* release the lock here.
*/
mmc_bus_put(host);
if (host->ops->get_cd && host->ops->get_cd(host) == 0)
goto out;
mmc_claim_host(host);
if (!mmc_rescan_try_freq(host, host->f_min))
extend_wakelock = true;
mmc_release_host(host);
out:
if (extend_wakelock)
wake_lock_timeout(&host->detect_wake_lock, HZ / 2);
else
wake_unlock(&host->detect_wake_lock);
if (host->caps & MMC_CAP_NEEDS_POLL) {
wake_lock(&host->detect_wake_lock);
<API key>(&host->detect, HZ);
}
}
void mmc_start_host(struct mmc_host *host)
{
mmc_power_off(host);
mmc_detect_change(host, 0);
}
void mmc_stop_host(struct mmc_host *host)
{
#ifdef CONFIG_MMC_DEBUG
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
host->removed = 1;
<API key>(&host->lock, flags);
#endif
if (<API key>(&host->detect))
wake_unlock(&host->detect_wake_lock);
<API key>();
/* clear pm flags now and let card drivers set them as needed */
host->pm_flags = 0;
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
/* Calling bus_ops->remove() with a claimed host can deadlock */
if (host->bus_ops->remove)
host->bus_ops->remove(host);
mmc_claim_host(host);
mmc_detach_bus(host);
mmc_power_off(host);
mmc_release_host(host);
mmc_bus_put(host);
return;
}
mmc_bus_put(host);
BUG_ON(host->card);
mmc_power_off(host);
}
int mmc_power_save_host(struct mmc_host *host)
{
int ret = 0;
#ifdef CONFIG_MMC_DEBUG
pr_info("%s: %s: powering down\n", mmc_hostname(host), __func__);
#endif
mmc_bus_get(host);
if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) {
mmc_bus_put(host);
return -EINVAL;
}
if (host->bus_ops->power_save)
ret = host->bus_ops->power_save(host);
mmc_bus_put(host);
mmc_power_off(host);
return ret;
}
EXPORT_SYMBOL(mmc_power_save_host);
int <API key>(struct mmc_host *host)
{
int ret;
#ifdef CONFIG_MMC_DEBUG
pr_info("%s: %s: powering up\n", mmc_hostname(host), __func__);
#endif
mmc_bus_get(host);
if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) {
mmc_bus_put(host);
return -EINVAL;
}
mmc_power_up(host);
ret = host->bus_ops->power_restore(host);
mmc_bus_put(host);
return ret;
}
EXPORT_SYMBOL(<API key>);
int mmc_card_awake(struct mmc_host *host)
{
int err = -ENOSYS;
if (host->caps2 & <API key>)
return 0;
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead && host->bus_ops->awake)
err = host->bus_ops->awake(host);
mmc_bus_put(host);
return err;
}
EXPORT_SYMBOL(mmc_card_awake);
int mmc_card_sleep(struct mmc_host *host)
{
int err = -ENOSYS;
if (host->caps2 & <API key>)
return 0;
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep)
err = host->bus_ops->sleep(host);
mmc_bus_put(host);
return err;
}
EXPORT_SYMBOL(mmc_card_sleep);
int mmc_card_can_sleep(struct mmc_host *host)
{
struct mmc_card *card = host->card;
if (card && mmc_card_mmc(card) && card->ext_csd.rev >= 3)
return 1;
return 0;
}
EXPORT_SYMBOL(mmc_card_can_sleep);
/*
* Flush the cache to the non-volatile storage.
*/
int mmc_flush_cache(struct mmc_card *card)
{
struct mmc_host *host = card->host;
int err = 0, rc;
if (!(host->caps2 & MMC_CAP2_CACHE_CTRL))
return err;
if (mmc_card_mmc(card) &&
(card->ext_csd.cache_size > 0) &&
(card->ext_csd.cache_ctrl & 1)) {
err = <API key>(card, <API key>,
EXT_CSD_FLUSH_CACHE, 1,
<API key>);
if (err == -ETIMEDOUT) {
pr_debug("%s: cache flush timeout\n",
mmc_hostname(card->host));
rc = mmc_interrupt_hpi(card);
if (rc)
pr_err("%s: mmc_interrupt_hpi() failed (%d)\n",
mmc_hostname(host), rc);
} else if (err) {
pr_err("%s: cache flush error %d\n",
mmc_hostname(card->host), err);
}
}
return err;
}
EXPORT_SYMBOL(mmc_flush_cache);
/*
* Turn the cache ON/OFF.
* Turning the cache OFF shall trigger flushing of the data
* to the non-volatile storage.
* This function should be called with host claimed
*/
int mmc_cache_ctrl(struct mmc_host *host, u8 enable)
{
struct mmc_card *card = host->card;
unsigned int timeout = card->ext_csd.generic_cmd6_time;
int err = 0, rc;
if (!(host->caps2 & MMC_CAP2_CACHE_CTRL) ||
<API key>(host))
return err;
if (card && mmc_card_mmc(card) &&
(card->ext_csd.cache_size > 0)) {
enable = !!enable;
if (card->ext_csd.cache_ctrl ^ enable) {
if (!enable)
timeout = <API key>;
err = <API key>(card,
<API key>,
EXT_CSD_CACHE_CTRL, enable, timeout);
if (err == -ETIMEDOUT && !enable) {
pr_debug("%s:cache disable operation timeout\n",
mmc_hostname(card->host));
rc = mmc_interrupt_hpi(card);
if (rc)
pr_err("%s: mmc_interrupt_hpi() failed (%d)\n",
mmc_hostname(host), rc);
} else if (err) {
pr_err("%s: cache %s error %d\n",
mmc_hostname(card->host),
enable ? "on" : "off",
err);
} else {
card->ext_csd.cache_ctrl = enable;
}
}
}
return err;
}
EXPORT_SYMBOL(mmc_cache_ctrl);
#ifdef CONFIG_PM
/**
* mmc_suspend_host - suspend a host
* @host: mmc host
*/
int mmc_suspend_host(struct mmc_host *host)
{
int err = 0;
if (<API key>(host))
return 0;
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
/*
* A long response time is not acceptable for device drivers
* when doing suspend. Prevent mmc_claim_host in the suspend
* sequence, to potentially wait "forever" by trying to
* pre-claim the host.
*
* Skip try claim host for SDIO cards, doing so fixes deadlock
* conditions. The function driver suspend may again call into
* SDIO driver within a different context for enabling power
* save mode in the card and hence wait in mmc_claim_host
* causing deadlock.
*/
if (!(host->card && mmc_card_sdio(host->card)))
if (!mmc_try_claim_host(host))
err = -EBUSY;
if (!err) {
if (host->bus_ops->suspend) {
err = mmc_stop_bkops(host->card);
if (err)
goto stop_bkops_err;
err = host->bus_ops->suspend(host);
}
if (!(host->card && mmc_card_sdio(host->card)))
mmc_release_host(host);
if (err == -ENOSYS || !host->bus_ops->resume) {
/*
* We simply "remove" the card in this case.
* It will be redetected on resume. (Calling
* bus_ops->remove() with a claimed host can
* deadlock.)
* It will be redetected on resume.
*/
if (host->bus_ops->remove)
host->bus_ops->remove(host);
mmc_claim_host(host);
mmc_detach_bus(host);
mmc_power_off(host);
mmc_release_host(host);
host->pm_flags = 0;
err = 0;
}
}
}
mmc_bus_put(host);
if (!err && !mmc_card_keep_power(host))
mmc_power_off(host);
return err;
stop_bkops_err:
if (!(host->card && mmc_card_sdio(host->card)))
mmc_release_host(host);
return err;
}
EXPORT_SYMBOL(mmc_suspend_host);
/**
* mmc_resume_host - resume a previously suspended host
* @host: mmc host
*/
int mmc_resume_host(struct mmc_host *host)
{
int err = 0;
mmc_bus_get(host);
if (<API key>(host)) {
host->bus_resume_flags |= <API key>;
mmc_bus_put(host);
return 0;
}
if (host->bus_ops && !host->bus_dead) {
if (!mmc_card_keep_power(host)) {
mmc_power_up(host);
mmc_select_voltage(host, host->ocr);
/*
* Tell runtime PM core we just powered up the card,
* since it still believes the card is powered off.
* Note that currently runtime PM is only enabled
* for SDIO cards that are <API key>
*/
if (mmc_card_sdio(host->card) &&
(host->caps & <API key>)) {
pm_runtime_disable(&host->card->dev);
<API key>(&host->card->dev);
pm_runtime_enable(&host->card->dev);
}
}
BUG_ON(!host->bus_ops->resume);
err = host->bus_ops->resume(host);
if (err) {
pr_warning("%s: error %d during resume "
"(card was removed?)\n",
mmc_hostname(host), err);
err = 0;
}
}
host->pm_flags &= ~MMC_PM_KEEP_POWER;
mmc_bus_put(host);
return err;
}
EXPORT_SYMBOL(mmc_resume_host);
/* Do the card removal on suspend if card is assumed removeable
* Do that in pm notifier while userspace isn't yet frozen, so we will be able
to sync the card.
*/
int mmc_pm_notify(struct notifier_block *notify_block,
unsigned long mode, void *unused)
{
struct mmc_host *host = container_of(
notify_block, struct mmc_host, pm_notify);
unsigned long flags;
int err = 0;
switch (mode) {
case <API key>:
case PM_SUSPEND_PREPARE:
if (host->card && mmc_card_mmc(host->card)) {
mmc_claim_host(host);
err = mmc_stop_bkops(host->card);
mmc_release_host(host);
if (err) {
pr_err("%s: didn't stop bkops\n",
mmc_hostname(host));
return err;
}
}
spin_lock_irqsave(&host->lock, flags);
if (<API key>(host)) {
<API key>(&host->lock, flags);
break;
}
host->rescan_disable = 1;
<API key>(&host->lock, flags);
if (<API key>(&host->detect))
wake_unlock(&host->detect_wake_lock);
if (!host->bus_ops || host->bus_ops->suspend)
break;
/* Calling bus_ops->remove() with a claimed host can deadlock */
if (host->bus_ops->remove)
host->bus_ops->remove(host);
mmc_claim_host(host);
mmc_detach_bus(host);
mmc_power_off(host);
mmc_release_host(host);
host->pm_flags = 0;
break;
case PM_POST_SUSPEND:
case PM_POST_HIBERNATION:
case PM_POST_RESTORE:
spin_lock_irqsave(&host->lock, flags);
if (<API key>(host)) {
<API key>(&host->lock, flags);
break;
}
host->rescan_disable = 0;
<API key>(&host->lock, flags);
mmc_detect_change(host, 0);
}
return 0;
}
#endif
#ifdef <API key>
void <API key>(struct mmc_host *host,
struct sdio_cis *cis,
struct sdio_cccr *cccr,
struct sdio_embedded_func *funcs,
int num_funcs)
{
host->embedded_sdio_data.cis = cis;
host->embedded_sdio_data.cccr = cccr;
host->embedded_sdio_data.funcs = funcs;
host->embedded_sdio_data.num_funcs = num_funcs;
}
EXPORT_SYMBOL(<API key>);
#endif
static int __init mmc_init(void)
{
int ret;
workqueue = <API key>("kmmcd", 0);
if (!workqueue)
return -ENOMEM;
ret = mmc_register_bus();
if (ret)
goto destroy_workqueue;
ret = <API key>();
if (ret)
goto unregister_bus;
ret = sdio_register_bus();
if (ret)
goto <API key>;
return 0;
<API key>:
<API key>();
unregister_bus:
mmc_unregister_bus();
destroy_workqueue:
destroy_workqueue(workqueue);
return ret;
}
static void __exit mmc_exit(void)
{
sdio_unregister_bus();
<API key>();
mmc_unregister_bus();
destroy_workqueue(workqueue);
}
subsys_initcall(mmc_init);
module_exit(mmc_exit);
MODULE_LICENSE("GPL");
|
var options={}; options.login=true;
<API key>.util.ready(function ()
{ $ui = <API key>.lr_login_settings;
$ui.interfacesize = Drupal.settings.lrsociallogin.interfacesize;
$ui.<API key>=Drupal.settings.lrsociallogin.<API key>;
$ui.noofcolumns= Drupal.settings.lrsociallogin.noofcolumns;
$ui.apikey = Drupal.settings.lrsociallogin.apikey;
$ui.is_access_token=true;
$ui.callback=Drupal.settings.lrsociallogin.location;
$ui.<API key> ="<API key>"; <API key>.init(options); });
LoginRadiusSDK.setLoginCallback(function () {
var token = LoginRadiusSDK.getToken();
var form = document.createElement('form');
form.action = Drupal.settings.lrsociallogin.location;
form.method = 'POST';
var hiddenToken = document.createElement('input');
hiddenToken.type = 'hidden';
hiddenToken.value = token;
hiddenToken.name = 'token';
form.appendChild(hiddenToken);
document.body.appendChild(form);
form.submit();
});
|
<?php
namespace Drupal\materialize\Plugin\Setting\General\Tables;
use Drupal\materialize\Annotation\MaterializeSetting;
use Drupal\materialize\Plugin\Setting\SettingBase;
use Drupal\Core\Annotation\Translation;
/**
* The "table_bordered" theme setting.
*
* @ingroup plugins_setting
*
* @MaterializeSetting(
* id = "table_bordered",
* type = "checkbox",
* title = @Translation("Bordered table"),
* description = @Translation("Add borders on all sides of the table and cells."),
* defaultValue = 0,
* groups = {
* "general" = @Translation("General"),
* "tables" = @Translation("Tables"),
* },
* )
*/
class TableBordered extends SettingBase {}
|
package net.senmori.customtextures.events;
import net.senmori.customtextures.util.MovementType;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerEvent;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
/**
* event that is triggered after a player entered a WorldGuard region
* @author mewin<mewin001@hotmail.de>
*/
public class RegionEnteredEvent extends RegionEvent
{
/**
* creates a new RegionEnteredEvent
* @param region the region the player entered
* @param player the player who triggered the event
* @param movement the type of movement how the player entered the region
*/
public RegionEnteredEvent(ProtectedRegion region, Player player, MovementType movement, PlayerEvent parent)
{
super(player, region, parent, movement);
}
}
|
#include "config.h"
#include <arki/tests/tests.h>
#include <arki/iotrace.h>
namespace {
using namespace std;
using namespace arki;
using namespace arki::tests;
class Tests : public TestCase
{
using TestCase::TestCase;
void register_tests() override;
} test("arki_iotrace");
void Tests::register_tests() {
add_method("empty", [] {
});
}
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>widget-locale - YUI 3</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.5.0pr4/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<script src="http://yui.yahooapis.com/3.5.0pr4/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title="YUI 3"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 3.5.0</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/Anim.html">Anim</a></li>
<li><a href="../classes/App.html">App</a></li>
<li><a href="../classes/App.Base.html">App.Base</a></li>
<li><a href="../classes/App.Transitions.html">App.Transitions</a></li>
<li><a href="../classes/App.TransitionsNative.html">App.TransitionsNative</a></li>
<li><a href="../classes/AreaSeries.html">AreaSeries</a></li>
<li><a href="../classes/AreaSplineSeries.html">AreaSplineSeries</a></li>
<li><a href="../classes/Array.html">Array</a></li>
<li><a href="../classes/ArrayList.html">ArrayList</a></li>
<li><a href="../classes/ArraySort.html">ArraySort</a></li>
<li><a href="../classes/AsyncQueue.html">AsyncQueue</a></li>
<li><a href="../classes/Attribute.html">Attribute</a></li>
<li><a href="../classes/AttributeCore.html">AttributeCore</a></li>
<li><a href="../classes/AttributeEvents.html">AttributeEvents</a></li>
<li><a href="../classes/AttributeExtras.html">AttributeExtras</a></li>
<li><a href="../classes/AttributeLite.html">AttributeLite</a></li>
<li><a href="../classes/AutoComplete.html">AutoComplete</a></li>
<li><a href="../classes/AutoCompleteBase.html">AutoCompleteBase</a></li>
<li><a href="../classes/AutoCompleteFilters.html">AutoCompleteFilters</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/AutoCompleteList.html">AutoCompleteList</a></li>
<li><a href="../classes/Axis.html">Axis</a></li>
<li><a href="../classes/AxisType.html">AxisType</a></li>
<li><a href="../classes/BarSeries.html">BarSeries</a></li>
<li><a href="../classes/Base.html">Base</a></li>
<li><a href="../classes/BaseCore.html">BaseCore</a></li>
<li><a href="../classes/BottomAxisLayout.html">BottomAxisLayout</a></li>
<li><a href="../classes/Button.html">Button</a></li>
<li><a href="../classes/ButtonCore.html">ButtonCore</a></li>
<li><a href="../classes/ButtonGroup.html">ButtonGroup</a></li>
<li><a href="../classes/ButtonPlugin.html">ButtonPlugin</a></li>
<li><a href="../classes/Cache.html">Cache</a></li>
<li><a href="../classes/CacheOffline.html">CacheOffline</a></li>
<li><a href="../classes/Calendar.html">Calendar</a></li>
<li><a href="../classes/CalendarBase.html">CalendarBase</a></li>
<li><a href="../classes/CanvasCircle.html">CanvasCircle</a></li>
<li><a href="../classes/CanvasDrawing.html">CanvasDrawing</a></li>
<li><a href="../classes/CanvasEllipse.html">CanvasEllipse</a></li>
<li><a href="../classes/CanvasGraphic.html">CanvasGraphic</a></li>
<li><a href="../classes/CanvasPath.html">CanvasPath</a></li>
<li><a href="../classes/CanvasPieSlice.html">CanvasPieSlice</a></li>
<li><a href="../classes/CanvasRect.html">CanvasRect</a></li>
<li><a href="../classes/CanvasShape.html">CanvasShape</a></li>
<li><a href="../classes/CartesianChart.html">CartesianChart</a></li>
<li><a href="../classes/CartesianSeries.html">CartesianSeries</a></li>
<li><a href="../classes/CategoryAxis.html">CategoryAxis</a></li>
<li><a href="../classes/Chart.html">Chart</a></li>
<li><a href="../classes/ChartBase.html">ChartBase</a></li>
<li><a href="../classes/ChartLegend.html">ChartLegend</a></li>
<li><a href="../classes/Circle.html">Circle</a></li>
<li><a href="../classes/ClassNameManager.html">ClassNameManager</a></li>
<li><a href="../classes/ClickableRail.html">ClickableRail</a></li>
<li><a href="../classes/ColumnSeries.html">ColumnSeries</a></li>
<li><a href="../classes/ComboSeries.html">ComboSeries</a></li>
<li><a href="../classes/ComboSplineSeries.html">ComboSplineSeries</a></li>
<li><a href="../classes/config.html">config</a></li>
<li><a href="../classes/Console.html">Console</a></li>
<li><a href="../classes/Controller.html">Controller</a></li>
<li><a href="../classes/Cookie.html">Cookie</a></li>
<li><a href="../classes/CurveUtil.html">CurveUtil</a></li>
<li><a href="../classes/CustomEvent.html">CustomEvent</a></li>
<li><a href="../classes/DataSchema.Array.html">DataSchema.Array</a></li>
<li><a href="../classes/DataSchema.Base.html">DataSchema.Base</a></li>
<li><a href="../classes/DataSchema.JSON.html">DataSchema.JSON</a></li>
<li><a href="../classes/DataSchema.Text.html">DataSchema.Text</a></li>
<li><a href="../classes/DataSchema.XML.html">DataSchema.XML</a></li>
<li><a href="../classes/DataSource.Function.html">DataSource.Function</a></li>
<li><a href="../classes/DataSource.Get.html">DataSource.Get</a></li>
<li><a href="../classes/DataSource.IO.html">DataSource.IO</a></li>
<li><a href="../classes/DataSource.Local.html">DataSource.Local</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/DataSourceCache.html">DataSourceCache</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/DataSourceXMLSchema.html">DataSourceXMLSchema</a></li>
<li><a href="../classes/DataTable.html">DataTable</a></li>
<li><a href="../classes/DataTable.Base.html">DataTable.Base</a></li>
<li><a href="../classes/DataTable.BodyView.html">DataTable.BodyView</a></li>
<li><a href="../classes/DataTable.ColumnWidths.html">DataTable.ColumnWidths</a></li>
<li><a href="../classes/DataTable.Core.html">DataTable.Core</a></li>
<li><a href="../classes/DataTable.HeaderView.html">DataTable.HeaderView</a></li>
<li><a href="../classes/DataTable.Message.html">DataTable.Message</a></li>
<li><a href="../classes/DataTable.Mutable.html">DataTable.Mutable</a></li>
<li><a href="../classes/DataTable.Scrollable.html">DataTable.Scrollable</a></li>
<li><a href="../classes/DataTable.Sortable.html">DataTable.Sortable</a></li>
<li><a href="../classes/DataType.Date.html">DataType.Date</a></li>
<li><a href="../classes/DataType.Date.Locale.html">DataType.Date.Locale</a></li>
<li><a href="../classes/DataType.Number.html">DataType.Number</a></li>
<li><a href="../classes/DataType.XML.html">DataType.XML</a></li>
<li><a href="../classes/DD.DDM.html">DD.DDM</a></li>
<li><a href="../classes/DD.Delegate.html">DD.Delegate</a></li>
<li><a href="../classes/DD.Drag.html">DD.Drag</a></li>
<li><a href="../classes/DD.Drop.html">DD.Drop</a></li>
<li><a href="../classes/DD.Plugin.DDWindowScroll.html">DD.Plugin.DDWindowScroll</a></li>
<li><a href="../classes/DD.Scroll.html">DD.Scroll</a></li>
<li><a href="../classes/Dial.html">Dial</a></li>
<li><a href="../classes/Do.html">Do</a></li>
<li><a href="../classes/Do.AlterArgs.html">Do.AlterArgs</a></li>
<li><a href="../classes/Do.AlterReturn.html">Do.AlterReturn</a></li>
<li><a href="../classes/Do.Error.html">Do.Error</a></li>
<li><a href="../classes/Do.Halt.html">Do.Halt</a></li>
<li><a href="../classes/Do.Method.html">Do.Method</a></li>
<li><a href="../classes/Do.Prevent.html">Do.Prevent</a></li>
<li><a href="../classes/DOM.html">DOM</a></li>
<li><a href="../classes/DOMEventFacade.html">DOMEventFacade</a></li>
<li><a href="../classes/Drawing.html">Drawing</a></li>
<li><a href="../classes/Easing.html">Easing</a></li>
<li><a href="../classes/EditorBase.html">EditorBase</a></li>
<li><a href="../classes/EditorSelection.html">EditorSelection</a></li>
<li><a href="../classes/Ellipse.html">Ellipse</a></li>
<li><a href="../classes/EllipseGroup.html">EllipseGroup</a></li>
<li><a href="../classes/Escape.html">Escape</a></li>
<li><a href="../classes/Event.html">Event</a></li>
<li><a href="../classes/EventFacade.html">EventFacade</a></li>
<li><a href="../classes/EventHandle.html">EventHandle</a></li>
<li><a href="../classes/EventTarget.html">EventTarget</a></li>
<li><a href="../classes/ExecCommand.html">ExecCommand</a></li>
<li><a href="../classes/Features.html">Features</a></li>
<li><a href="../classes/File.html">File</a></li>
<li><a href="../classes/FileFlash.html">FileFlash</a></li>
<li><a href="../classes/FileHTML5.html">FileHTML5</a></li>
<li><a href="../classes/Fills.html">Fills</a></li>
<li><a href="../classes/Frame.html">Frame</a></li>
<li><a href="../classes/Get.html">Get</a></li>
<li><a href="../classes/Get.Transaction.html">Get.Transaction</a></li>
<li><a href="../classes/GetNodeJS.html">GetNodeJS</a></li>
<li><a href="../classes/Graph.html">Graph</a></li>
<li><a href="../classes/Graphic.html">Graphic</a></li>
<li><a href="../classes/GraphicBase.html">GraphicBase</a></li>
<li><a href="../classes/Gridlines.html">Gridlines</a></li>
<li><a href="../classes/GroupCircle.html">GroupCircle</a></li>
<li><a href="../classes/GroupDiamond.html">GroupDiamond</a></li>
<li><a href="../classes/GroupRect.html">GroupRect</a></li>
<li><a href="../classes/Handlebars.html">Handlebars</a></li>
<li><a href="../classes/Highlight.html">Highlight</a></li>
<li><a href="../classes/Histogram.html">Histogram</a></li>
<li><a href="../classes/HistoryBase.html">HistoryBase</a></li>
<li><a href="../classes/HistoryHash.html">HistoryHash</a></li>
<li><a href="../classes/HistoryHTML5.html">HistoryHTML5</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/ImgLoadGroup.html">ImgLoadGroup</a></li>
<li><a href="../classes/ImgLoadImgObj.html">ImgLoadImgObj</a></li>
<li><a href="../classes/Intl.html">Intl</a></li>
<li><a href="../classes/IO.html">IO</a></li>
<li><a href="../classes/json.html">json</a></li>
<li><a href="../classes/JSONPRequest.html">JSONPRequest</a></li>
<li><a href="../classes/Lang.html">Lang</a></li>
<li><a href="../classes/LeftAxisLayout.html">LeftAxisLayout</a></li>
<li><a href="../classes/Lines.html">Lines</a></li>
<li><a href="../classes/LineSeries.html">LineSeries</a></li>
<li><a href="../classes/Loader.html">Loader</a></li>
<li><a href="../classes/MarkerSeries.html">MarkerSeries</a></li>
<li><a href="../classes/Matrix.html">Matrix</a></li>
<li><a href="../classes/Model.html">Model</a></li>
<li><a href="../classes/ModelList.html">ModelList</a></li>
<li><a href="../classes/Node.html">Node</a></li>
<li><a href="../classes/NodeList.html">NodeList</a></li>
<li><a href="../classes/NumericAxis.html">NumericAxis</a></li>
<li><a href="../classes/Object.html">Object</a></li>
<li><a href="../classes/Overlay.html">Overlay</a></li>
<li><a href="../classes/Panel.html">Panel</a></li>
<li><a href="../classes/Parallel.html">Parallel</a></li>
<li><a href="../classes/Path.html">Path</a></li>
<li><a href="../classes/PieChart.html">PieChart</a></li>
<li><a href="../classes/PieSeries.html">PieSeries</a></li>
<li><a href="../classes/Pjax.html">Pjax</a></li>
<li><a href="../classes/PjaxBase.html">PjaxBase</a></li>
<li><a href="../classes/Plots.html">Plots</a></li>
<li><a href="../classes/Plugin.Align.html">Plugin.Align</a></li>
<li><a href="../classes/Plugin.AutoComplete.html">Plugin.AutoComplete</a></li>
<li><a href="../classes/Plugin.Base.html">Plugin.Base</a></li>
<li><a href="../classes/Plugin.Cache.html">Plugin.Cache</a></li>
<li><a href="../classes/Plugin.CalendarNavigator.html">Plugin.CalendarNavigator</a></li>
<li><a href="../classes/Plugin.ConsoleFilters.html">Plugin.ConsoleFilters</a></li>
<li><a href="../classes/Plugin.CreateLinkBase.html">Plugin.CreateLinkBase</a></li>
<li><a href="../classes/Plugin.DataTableDataSource.html">Plugin.DataTableDataSource</a></li>
<li><a href="../classes/Plugin.DDConstrained.html">Plugin.DDConstrained</a></li>
<li><a href="../classes/Plugin.DDNodeScroll.html">Plugin.DDNodeScroll</a></li>
<li><a href="../classes/Plugin.DDProxy.html">Plugin.DDProxy</a></li>
<li><a href="../classes/Plugin.Drag.html">Plugin.Drag</a></li>
<li><a href="../classes/Plugin.Drop.html">Plugin.Drop</a></li>
<li><a href="../classes/Plugin.EditorBidi.html">Plugin.EditorBidi</a></li>
<li><a href="../classes/Plugin.EditorBR.html">Plugin.EditorBR</a></li>
<li><a href="../classes/Plugin.EditorLists.html">Plugin.EditorLists</a></li>
<li><a href="../classes/Plugin.EditorPara.html">Plugin.EditorPara</a></li>
<li><a href="../classes/Plugin.EditorParaBase.html">Plugin.EditorParaBase</a></li>
<li><a href="../classes/Plugin.EditorParaIE.html">Plugin.EditorParaIE</a></li>
<li><a href="../classes/Plugin.EditorTab.html">Plugin.EditorTab</a></li>
<li><a href="../classes/Plugin.ExecCommand.html">Plugin.ExecCommand</a></li>
<li><a href="../classes/Plugin.Flick.html">Plugin.Flick</a></li>
<li><a href="../classes/Plugin.Host.html">Plugin.Host</a></li>
<li><a href="../classes/plugin.NodeFocusManager.html">plugin.NodeFocusManager</a></li>
<li><a href="../classes/Plugin.NodeFX.html">Plugin.NodeFX</a></li>
<li><a href="../classes/plugin.NodeMenuNav.html">plugin.NodeMenuNav</a></li>
<li><a href="../classes/Plugin.Pjax.html">Plugin.Pjax</a></li>
<li><a href="../classes/Plugin.Resize.html">Plugin.Resize</a></li>
<li><a href="../classes/Plugin.ResizeConstrained.html">Plugin.ResizeConstrained</a></li>
<li><a href="../classes/Plugin.ResizeProxy.html">Plugin.ResizeProxy</a></li>
<li><a href="../classes/Plugin.ScrollViewList.html">Plugin.ScrollViewList</a></li>
<li><a href="../classes/Plugin.ScrollViewPaginator.html">Plugin.ScrollViewPaginator</a></li>
<li><a href="../classes/Plugin.<API key>.html">Plugin.<API key></a></li>
<li><a href="../classes/Plugin.Shim.html">Plugin.Shim</a></li>
<li><a href="../classes/Plugin.SortScroll.html">Plugin.SortScroll</a></li>
<li><a href="../classes/Plugin.WidgetAnim.html">Plugin.WidgetAnim</a></li>
<li><a href="../classes/Pollable.html">Pollable</a></li>
<li><a href="../classes/Profiler.html">Profiler</a></li>
<li><a href="../classes/QueryString.html">QueryString</a></li>
<li><a href="../classes/Queue.html">Queue</a></li>
<li><a href="../classes/Record.html">Record</a></li>
<li><a href="../classes/Recordset.html">Recordset</a></li>
<li><a href="../classes/RecordsetFilter.html">RecordsetFilter</a></li>
<li><a href="../classes/RecordsetIndexer.html">RecordsetIndexer</a></li>
<li><a href="../classes/RecordsetSort.html">RecordsetSort</a></li>
<li><a href="../classes/Rect.html">Rect</a></li>
<li><a href="../classes/Renderer.html">Renderer</a></li>
<li><a href="../classes/Resize.html">Resize</a></li>
<li><a href="../classes/RightAxisLayout.html">RightAxisLayout</a></li>
<li><a href="../classes/Router.html">Router</a></li>
<li><a href="../classes/ScrollView.html">ScrollView</a></li>
<li><a href="../classes/Selector.html">Selector</a></li>
<li><a href="../classes/Shape.html">Shape</a></li>
<li><a href="../classes/ShapeGroup.html">ShapeGroup</a></li>
<li><a href="../classes/Slider.html">Slider</a></li>
<li><a href="../classes/SliderBase.html">SliderBase</a></li>
<li><a href="../classes/SliderValueRange.html">SliderValueRange</a></li>
<li><a href="../classes/Sortable.html">Sortable</a></li>
<li><a href="../classes/SplineSeries.html">SplineSeries</a></li>
<li><a href="../classes/StackedAreaSeries.html">StackedAreaSeries</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/StackedAxis.html">StackedAxis</a></li>
<li><a href="../classes/StackedBarSeries.html">StackedBarSeries</a></li>
<li><a href="../classes/StackedColumnSeries.html">StackedColumnSeries</a></li>
<li><a href="../classes/StackedComboSeries.html">StackedComboSeries</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/StackedLineSeries.html">StackedLineSeries</a></li>
<li><a href="../classes/StackedMarkerSeries.html">StackedMarkerSeries</a></li>
<li><a href="../classes/StackedSplineSeries.html">StackedSplineSeries</a></li>
<li><a href="../classes/StackingUtil.html">StackingUtil</a></li>
<li><a href="../classes/State.html">State</a></li>
<li><a href="../classes/StyleSheet.html">StyleSheet</a></li>
<li><a href="../classes/Subscriber.html">Subscriber</a></li>
<li><a href="../classes/SVGCircle.html">SVGCircle</a></li>
<li><a href="../classes/SVGDrawing.html">SVGDrawing</a></li>
<li><a href="../classes/SVGEllipse.html">SVGEllipse</a></li>
<li><a href="../classes/SVGGraphic.html">SVGGraphic</a></li>
<li><a href="../classes/SVGPath.html">SVGPath</a></li>
<li><a href="../classes/SVGPieSlice.html">SVGPieSlice</a></li>
<li><a href="../classes/SVGRect.html">SVGRect</a></li>
<li><a href="../classes/SVGShape.html">SVGShape</a></li>
<li><a href="../classes/SWF.html">SWF</a></li>
<li><a href="../classes/SWFDetect.html">SWFDetect</a></li>
<li><a href="../classes/SyntheticEvent.html">SyntheticEvent</a></li>
<li><a href="../classes/SyntheticEvent.Notifier.html">SyntheticEvent.Notifier</a></li>
<li><a href="../classes/SynthRegistry.html">SynthRegistry</a></li>
<li><a href="../classes/Tab.html">Tab</a></li>
<li><a href="../classes/TabView.html">TabView</a></li>
<li><a href="../classes/Test.html">Test</a></li>
<li><a href="../classes/Test.ArrayAssert.html">Test.ArrayAssert</a></li>
<li><a href="../classes/Test.Assert.html">Test.Assert</a></li>
<li><a href="../classes/Test.AssertionError.html">Test.AssertionError</a></li>
<li><a href="../classes/Test.ComparisonFailure.html">Test.ComparisonFailure</a></li>
<li><a href="../classes/Test.Console.html">Test.Console</a></li>
<li><a href="../classes/Test.CoverageFormat.CoverageFormat.html">Test.CoverageFormat.CoverageFormat</a></li>
<li><a href="../classes/Test.DateAssert.html">Test.DateAssert</a></li>
<li><a href="../classes/Test.EventTarget.html">Test.EventTarget</a></li>
<li><a href="../classes/Test.Mock.Mock.html">Test.Mock.Mock</a></li>
<li><a href="../classes/Test.Mock.Value.html">Test.Mock.Value</a></li>
<li><a href="../classes/Test.ObjectAssert.html">Test.ObjectAssert</a></li>
<li><a href="../classes/Test.Reporter.html">Test.Reporter</a></li>
<li><a href="../classes/Test.Results.html">Test.Results</a></li>
<li><a href="../classes/Test.Runner.html">Test.Runner</a></li>
<li><a href="../classes/Test.ShouldError.html">Test.ShouldError</a></li>
<li><a href="../classes/Test.ShouldFail.html">Test.ShouldFail</a></li>
<li><a href="../classes/Test.TestCase.html">Test.TestCase</a></li>
<li><a href="../classes/Test.TestFormat.html">Test.TestFormat</a></li>
<li><a href="../classes/Test.TestNode.html">Test.TestNode</a></li>
<li><a href="../classes/Test.TestRunner.html">Test.TestRunner</a></li>
<li><a href="../classes/Test.TestSuite.html">Test.TestSuite</a></li>
<li><a href="../classes/Test.UnexpectedError.html">Test.UnexpectedError</a></li>
<li><a href="../classes/Test.UnexpectedValue.html">Test.UnexpectedValue</a></li>
<li><a href="../classes/Test.Wait.html">Test.Wait</a></li>
<li><a href="../classes/Text.AccentFold.html">Text.AccentFold</a></li>
<li><a href="../classes/Text.WordBreak.html">Text.WordBreak</a></li>
<li><a href="../classes/TimeAxis.html">TimeAxis</a></li>
<li><a href="../classes/ToggleButton.html">ToggleButton</a></li>
<li><a href="../classes/TopAxisLayout.html">TopAxisLayout</a></li>
<li><a href="../classes/Transition.html">Transition</a></li>
<li><a href="../classes/UA.html">UA</a></li>
<li><a href="../classes/Uploader.html">Uploader</a></li>
<li><a href="../classes/Uploader.Queue.html">Uploader.Queue</a></li>
<li><a href="../classes/UploaderFlash.html">UploaderFlash</a></li>
<li><a href="../classes/UploaderHTML5.html">UploaderHTML5</a></li>
<li><a href="../classes/ValueChange.html">ValueChange</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/View.html">View</a></li>
<li><a href="../classes/View.NodeMap.html">View.NodeMap</a></li>
<li><a href="../classes/VMLCircle.html">VMLCircle</a></li>
<li><a href="../classes/VMLDrawing.html">VMLDrawing</a></li>
<li><a href="../classes/VMLEllipse.html">VMLEllipse</a></li>
<li><a href="../classes/VMLGraphic.html">VMLGraphic</a></li>
<li><a href="../classes/VMLPath.html">VMLPath</a></li>
<li><a href="../classes/VMLPieSlice.html">VMLPieSlice</a></li>
<li><a href="../classes/VMLRect.html">VMLRect</a></li>
<li><a href="../classes/VMLShape.html">VMLShape</a></li>
<li><a href="../classes/Widget.html">Widget</a></li>
<li><a href="../classes/WidgetAutohide.html">WidgetAutohide</a></li>
<li><a href="../classes/WidgetButtons.html">WidgetButtons</a></li>
<li><a href="../classes/WidgetChild.html">WidgetChild</a></li>
<li><a href="../classes/WidgetModality.html">WidgetModality</a></li>
<li><a href="../classes/WidgetParent.html">WidgetParent</a></li>
<li><a href="../classes/WidgetPosition.html">WidgetPosition</a></li>
<li><a href="../classes/WidgetPositionAlign.html">WidgetPositionAlign</a></li>
<li><a href="../classes/<API key>.html"><API key></a></li>
<li><a href="../classes/WidgetStack.html">WidgetStack</a></li>
<li><a href="../classes/WidgetStdMod.html">WidgetStdMod</a></li>
<li><a href="../classes/YQL.html">YQL</a></li>
<li><a href="../classes/YQLRequest.html">YQLRequest</a></li>
<li><a href="../classes/YUI.html">YUI</a></li>
<li><a href="../classes/YUI~substitute.html">YUI~substitute</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/align-plugin.html">align-plugin</a></li>
<li><a href="../modules/anim.html">anim</a></li>
<li><a href="../modules/anim-base.html">anim-base</a></li>
<li><a href="../modules/anim-color.html">anim-color</a></li>
<li><a href="../modules/anim-curve.html">anim-curve</a></li>
<li><a href="../modules/anim-easing.html">anim-easing</a></li>
<li><a href="../modules/anim-node-plugin.html">anim-node-plugin</a></li>
<li><a href="../modules/anim-scroll.html">anim-scroll</a></li>
<li><a href="../modules/anim-xy.html">anim-xy</a></li>
<li><a href="../modules/app.html">app</a></li>
<li><a href="../modules/app-base.html">app-base</a></li>
<li><a href="../modules/app-transitions.html">app-transitions</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/array-extras.html">array-extras</a></li>
<li><a href="../modules/array-invoke.html">array-invoke</a></li>
<li><a href="../modules/arraylist.html">arraylist</a></li>
<li><a href="../modules/arraylist-add.html">arraylist-add</a></li>
<li><a href="../modules/arraylist-filter.html">arraylist-filter</a></li>
<li><a href="../modules/arraysort.html">arraysort</a></li>
<li><a href="../modules/async-queue.html">async-queue</a></li>
<li><a href="../modules/attribute.html">attribute</a></li>
<li><a href="../modules/attribute-base.html">attribute-base</a></li>
<li><a href="../modules/attribute-complex.html">attribute-complex</a></li>
<li><a href="../modules/attribute-core.html">attribute-core</a></li>
<li><a href="../modules/attribute-events.html">attribute-events</a></li>
<li><a href="../modules/attribute-extras.html">attribute-extras</a></li>
<li><a href="../modules/autocomplete.html">autocomplete</a></li>
<li><a href="../modules/autocomplete-base.html">autocomplete-base</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/autocomplete-list.html">autocomplete-list</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/autocomplete-plugin.html">autocomplete-plugin</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/base.html">base</a></li>
<li><a href="../modules/base-base.html">base-base</a></li>
<li><a href="../modules/base-build.html">base-build</a></li>
<li><a href="../modules/base-core.html">base-core</a></li>
<li><a href="../modules/base-pluginhost.html">base-pluginhost</a></li>
<li><a href="../modules/button.html">button</a></li>
<li><a href="../modules/button-core.html">button-core</a></li>
<li><a href="../modules/button-group.html">button-group</a></li>
<li><a href="../modules/button-plugin.html">button-plugin</a></li>
<li><a href="../modules/cache.html">cache</a></li>
<li><a href="../modules/cache-base.html">cache-base</a></li>
<li><a href="../modules/cache-offline.html">cache-offline</a></li>
<li><a href="../modules/cache-plugin.html">cache-plugin</a></li>
<li><a href="../modules/calendar.html">calendar</a></li>
<li><a href="../modules/calendar-base.html">calendar-base</a></li>
<li><a href="../modules/calendarnavigator.html">calendarnavigator</a></li>
<li><a href="../modules/charts.html">charts</a></li>
<li><a href="../modules/charts-legend.html">charts-legend</a></li>
<li><a href="../modules/classnamemanager.html">classnamemanager</a></li>
<li><a href="../modules/clickable-rail.html">clickable-rail</a></li>
<li><a href="../modules/collection.html">collection</a></li>
<li><a href="../modules/console.html">console</a></li>
<li><a href="../modules/console-filters.html">console-filters</a></li>
<li><a href="../modules/cookie.html">cookie</a></li>
<li><a href="../modules/createlink-base.html">createlink-base</a></li>
<li><a href="../modules/dataschema.html">dataschema</a></li>
<li><a href="../modules/dataschema-array.html">dataschema-array</a></li>
<li><a href="../modules/dataschema-base.html">dataschema-base</a></li>
<li><a href="../modules/dataschema-json.html">dataschema-json</a></li>
<li><a href="../modules/dataschema-text.html">dataschema-text</a></li>
<li><a href="../modules/dataschema-xml.html">dataschema-xml</a></li>
<li><a href="../modules/datasource.html">datasource</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datasource-cache.html">datasource-cache</a></li>
<li><a href="../modules/datasource-function.html">datasource-function</a></li>
<li><a href="../modules/datasource-get.html">datasource-get</a></li>
<li><a href="../modules/datasource-io.html">datasource-io</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datasource-local.html">datasource-local</a></li>
<li><a href="../modules/datasource-polling.html">datasource-polling</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatable.html">datatable</a></li>
<li><a href="../modules/datatable-base.html">datatable-base</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatable-body.html">datatable-body</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatable-core.html">datatable-core</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatable-head.html">datatable-head</a></li>
<li><a href="../modules/datatable-message.html">datatable-message</a></li>
<li><a href="../modules/datatable-mutable.html">datatable-mutable</a></li>
<li><a href="../modules/datatable-scroll.html">datatable-scroll</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatable-sort.html">datatable-sort</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatype.html">datatype</a></li>
<li><a href="../modules/datatype-date.html">datatype-date</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatype-date-math.html">datatype-date-math</a></li>
<li><a href="../modules/datatype-date-parse.html">datatype-date-parse</a></li>
<li><a href="../modules/datatype-number.html">datatype-number</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/datatype-xml.html">datatype-xml</a></li>
<li><a href="../modules/datatype-xml-format.html">datatype-xml-format</a></li>
<li><a href="../modules/datatype-xml-parse.html">datatype-xml-parse</a></li>
<li><a href="../modules/dd.html">dd</a></li>
<li><a href="../modules/dd-constrain.html">dd-constrain</a></li>
<li><a href="../modules/dd-ddm.html">dd-ddm</a></li>
<li><a href="../modules/dd-ddm-base.html">dd-ddm-base</a></li>
<li><a href="../modules/dd-ddm-drop.html">dd-ddm-drop</a></li>
<li><a href="../modules/dd-delegate.html">dd-delegate</a></li>
<li><a href="../modules/dd-drag.html">dd-drag</a></li>
<li><a href="../modules/dd-drop.html">dd-drop</a></li>
<li><a href="../modules/dd-drop-plugin.html">dd-drop-plugin</a></li>
<li><a href="../modules/dd-plugin.html">dd-plugin</a></li>
<li><a href="../modules/dd-proxy.html">dd-proxy</a></li>
<li><a href="../modules/dd-scroll.html">dd-scroll</a></li>
<li><a href="../modules/dial.html">dial</a></li>
<li><a href="../modules/dom.html">dom</a></li>
<li><a href="../modules/dom-base.html">dom-base</a></li>
<li><a href="../modules/dom-screen.html">dom-screen</a></li>
<li><a href="../modules/dom-style.html">dom-style</a></li>
<li><a href="../modules/dump.html">dump</a></li>
<li><a href="../modules/editor.html">editor</a></li>
<li><a href="../modules/editor-base.html">editor-base</a></li>
<li><a href="../modules/editor-bidi.html">editor-bidi</a></li>
<li><a href="../modules/editor-br.html">editor-br</a></li>
<li><a href="../modules/editor-lists.html">editor-lists</a></li>
<li><a href="../modules/editor-para.html">editor-para</a></li>
<li><a href="../modules/editor-para-base.html">editor-para-base</a></li>
<li><a href="../modules/editor-para-ie.html">editor-para-ie</a></li>
<li><a href="../modules/editor-tab.html">editor-tab</a></li>
<li><a href="../modules/escape.html">escape</a></li>
<li><a href="../modules/event.html">event</a></li>
<li><a href="../modules/event-base.html">event-base</a></li>
<li><a href="../modules/event-contextmenu.html">event-contextmenu</a></li>
<li><a href="../modules/event-custom.html">event-custom</a></li>
<li><a href="../modules/event-custom-base.html">event-custom-base</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/event-delegate.html">event-delegate</a></li>
<li><a href="../modules/event-flick.html">event-flick</a></li>
<li><a href="../modules/event-focus.html">event-focus</a></li>
<li><a href="../modules/event-gestures.html">event-gestures</a></li>
<li><a href="../modules/event-hover.html">event-hover</a></li>
<li><a href="../modules/event-key.html">event-key</a></li>
<li><a href="../modules/event-mouseenter.html">event-mouseenter</a></li>
<li><a href="../modules/event-mousewheel.html">event-mousewheel</a></li>
<li><a href="../modules/event-move.html">event-move</a></li>
<li><a href="../modules/event-outside.html">event-outside</a></li>
<li><a href="../modules/event-resize.html">event-resize</a></li>
<li><a href="../modules/event-simulate.html">event-simulate</a></li>
<li><a href="../modules/event-synthetic.html">event-synthetic</a></li>
<li><a href="../modules/event-touch.html">event-touch</a></li>
<li><a href="../modules/event-valuechange.html">event-valuechange</a></li>
<li><a href="../modules/exec-command.html">exec-command</a></li>
<li><a href="../modules/features.html">features</a></li>
<li><a href="../modules/file.html">file</a></li>
<li><a href="../modules/file-flash.html">file-flash</a></li>
<li><a href="../modules/file-html5.html">file-html5</a></li>
<li><a href="../modules/frame.html">frame</a></li>
<li><a href="../modules/get.html">get</a></li>
<li><a href="../modules/get-nodejs.html">get-nodejs</a></li>
<li><a href="../modules/graphics.html">graphics</a></li>
<li><a href="../modules/handlebars.html">handlebars</a></li>
<li><a href="../modules/handlebars-base.html">handlebars-base</a></li>
<li><a href="../modules/handlebars-compiler.html">handlebars-compiler</a></li>
<li><a href="../modules/highlight.html">highlight</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/highlight-base.html">highlight-base</a></li>
<li><a href="../modules/history.html">history</a></li>
<li><a href="../modules/history-base.html">history-base</a></li>
<li><a href="../modules/history-hash.html">history-hash</a></li>
<li><a href="../modules/history-hash-ie.html">history-hash-ie</a></li>
<li><a href="../modules/history-html5.html">history-html5</a></li>
<li><a href="../modules/imageloader.html">imageloader</a></li>
<li><a href="../modules/intl.html">intl</a></li>
<li><a href="../modules/io.html">io</a></li>
<li><a href="../modules/io-base.html">io-base</a></li>
<li><a href="../modules/io-form.html">io-form</a></li>
<li><a href="../modules/io-queue.html">io-queue</a></li>
<li><a href="../modules/io-upload-iframe.html">io-upload-iframe</a></li>
<li><a href="../modules/io-xdr.html">io-xdr</a></li>
<li><a href="../modules/json.html">json</a></li>
<li><a href="../modules/json-parse.html">json-parse</a></li>
<li><a href="../modules/json-stringify.html">json-stringify</a></li>
<li><a href="../modules/jsonp.html">jsonp</a></li>
<li><a href="../modules/jsonp-url.html">jsonp-url</a></li>
<li><a href="../modules/loader.html">loader</a></li>
<li><a href="../modules/loader-base.html">loader-base</a></li>
<li><a href="../modules/matrix.html">matrix</a></li>
<li><a href="../modules/model.html">model</a></li>
<li><a href="../modules/model-list.html">model-list</a></li>
<li><a href="../modules/node.html">node</a></li>
<li><a href="../modules/node-base.html">node-base</a></li>
<li><a href="../modules/node-core.html">node-core</a></li>
<li><a href="../modules/node-data.html">node-data</a></li>
<li><a href="../modules/node-deprecated.html">node-deprecated</a></li>
<li><a href="../modules/node-event-delegate.html">node-event-delegate</a></li>
<li><a href="../modules/node-event-html5.html">node-event-html5</a></li>
<li><a href="../modules/node-event-simulate.html">node-event-simulate</a></li>
<li><a href="../modules/node-flick.html">node-flick</a></li>
<li><a href="../modules/node-focusmanager.html">node-focusmanager</a></li>
<li><a href="../modules/node-load.html">node-load</a></li>
<li><a href="../modules/node-menunav.html">node-menunav</a></li>
<li><a href="../modules/node-pluginhost.html">node-pluginhost</a></li>
<li><a href="../modules/node-screen.html">node-screen</a></li>
<li><a href="../modules/node-style.html">node-style</a></li>
<li><a href="../modules/oop.html">oop</a></li>
<li><a href="../modules/overlay.html">overlay</a></li>
<li><a href="../modules/panel.html">panel</a></li>
<li><a href="../modules/parallel.html">parallel</a></li>
<li><a href="../modules/pjax.html">pjax</a></li>
<li><a href="../modules/pjax-base.html">pjax-base</a></li>
<li><a href="../modules/pjax-plugin.html">pjax-plugin</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/pluginhost.html">pluginhost</a></li>
<li><a href="../modules/pluginhost-base.html">pluginhost-base</a></li>
<li><a href="../modules/pluginhost-config.html">pluginhost-config</a></li>
<li><a href="../modules/profiler.html">profiler</a></li>
<li><a href="../modules/querystring.html">querystring</a></li>
<li><a href="../modules/querystring-parse.html">querystring-parse</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/queue-promote.html">queue-promote</a></li>
<li><a href="../modules/range-slider.html">range-slider</a></li>
<li><a href="../modules/recordset.html">recordset</a></li>
<li><a href="../modules/recordset-base.html">recordset-base</a></li>
<li><a href="../modules/recordset-filter.html">recordset-filter</a></li>
<li><a href="../modules/recordset-indexer.html">recordset-indexer</a></li>
<li><a href="../modules/recordset-sort.html">recordset-sort</a></li>
<li><a href="../modules/resize.html">resize</a></li>
<li><a href="../modules/resize-contrain.html">resize-contrain</a></li>
<li><a href="../modules/resize-plugin.html">resize-plugin</a></li>
<li><a href="../modules/resize-proxy.html">resize-proxy</a></li>
<li><a href="../modules/rollup.html">rollup</a></li>
<li><a href="../modules/router.html">router</a></li>
<li><a href="../modules/scrollview.html">scrollview</a></li>
<li><a href="../modules/scrollview-base.html">scrollview-base</a></li>
<li><a href="../modules/scrollview-base-ie.html">scrollview-base-ie</a></li>
<li><a href="../modules/scrollview-list.html">scrollview-list</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/selection.html">selection</a></li>
<li><a href="../modules/selector-css2.html">selector-css2</a></li>
<li><a href="../modules/selector-css3.html">selector-css3</a></li>
<li><a href="../modules/selector-native.html">selector-native</a></li>
<li><a href="../modules/shim-plugin.html">shim-plugin</a></li>
<li><a href="../modules/slider.html">slider</a></li>
<li><a href="../modules/slider-base.html">slider-base</a></li>
<li><a href="../modules/slider-value-range.html">slider-value-range</a></li>
<li><a href="../modules/sortable.html">sortable</a></li>
<li><a href="../modules/sortable-scroll.html">sortable-scroll</a></li>
<li><a href="../modules/stylesheet.html">stylesheet</a></li>
<li><a href="../modules/substitute.html">substitute</a></li>
<li><a href="../modules/swf.html">swf</a></li>
<li><a href="../modules/swfdetect.html">swfdetect</a></li>
<li><a href="../modules/tabview.html">tabview</a></li>
<li><a href="../modules/test.html">test</a></li>
<li><a href="../modules/test-console.html">test-console</a></li>
<li><a href="../modules/text.html">text</a></li>
<li><a href="../modules/text-accentfold.html">text-accentfold</a></li>
<li><a href="../modules/text-wordbreak.html">text-wordbreak</a></li>
<li><a href="../modules/transition.html">transition</a></li>
<li><a href="../modules/uploader.html">uploader</a></li>
<li><a href="../modules/uploader-deprecated.html">uploader-deprecated</a></li>
<li><a href="../modules/uploader-flash.html">uploader-flash</a></li>
<li><a href="../modules/uploader-html5.html">uploader-html5</a></li>
<li><a href="../modules/uploader-queue.html">uploader-queue</a></li>
<li><a href="../modules/view.html">view</a></li>
<li><a href="../modules/view-node-map.html">view-node-map</a></li>
<li><a href="../modules/widget.html">widget</a></li>
<li><a href="../modules/widget-anim.html">widget-anim</a></li>
<li><a href="../modules/widget-autohide.html">widget-autohide</a></li>
<li><a href="../modules/widget-base.html">widget-base</a></li>
<li><a href="../modules/widget-base-ie.html">widget-base-ie</a></li>
<li><a href="../modules/widget-buttons.html">widget-buttons</a></li>
<li><a href="../modules/widget-child.html">widget-child</a></li>
<li><a href="../modules/widget-htmlparser.html">widget-htmlparser</a></li>
<li><a href="../modules/widget-locale.html">widget-locale</a></li>
<li><a href="../modules/widget-modality.html">widget-modality</a></li>
<li><a href="../modules/widget-parent.html">widget-parent</a></li>
<li><a href="../modules/widget-position.html">widget-position</a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/<API key>.html"><API key></a></li>
<li><a href="../modules/widget-skin.html">widget-skin</a></li>
<li><a href="../modules/widget-stack.html">widget-stack</a></li>
<li><a href="../modules/widget-stdmod.html">widget-stdmod</a></li>
<li><a href="../modules/widget-uievents.html">widget-uievents</a></li>
<li><a href="../modules/yql.html">yql</a></li>
<li><a href="../modules/yui.html">yui</a></li>
<li><a href="../modules/yui-base.html">yui-base</a></li>
<li><a href="../modules/yui-later.html">yui-later</a></li>
<li><a href="../modules/yui-log.html">yui-log</a></li>
<li><a href="../modules/yui-throttle.html">yui-throttle</a></li>
<li><a href="../modules/yui3.html">yui3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>widget-locale Module</h1>
<div class="box clearfix meta">
<a class="button link-docs" href="/yui/docs/widget">User Guide & Examples</a>
<div class="foundat">
Defined in: <a href="../files/<API key>.js.html#l1"><code>widget/js/WidgetLocale.js:1</code></a>
</div>
</div>
<div class="box deprecated">
<p>
<strong>Deprecated:</strong> This module has been deprecated. It's replaced by the "intl" module which provides generic <API key> and BCP 47 language tag support with externalization.
</p>
</div>
<div class="box intro">
<p>Provides string support for widget with BCP 47 language tag lookup. This module has been deprecated. It's replaced by the "intl" module which provides generic <API key> and BCP 47 language tag support with externalization.</p>
</div>
<div class="yui3-g">
<div class="yui3-u-1-2">
</div>
<div class="yui3-u-1-2">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
|
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gtk/gtk.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <swmgr.h>
#include <swmodule.h>
#include <stringmgr.h>
#include <localemgr.h>
extern "C" {
#include "gui/bibletext.h"
#include "main/gtk_compat.h"
}
#include <ctype.h>
#include <time.h>
#include "gui/main_window.h"
#include "gui/font_dialog.h"
#include "gui/widgets.h"
#include "gui/commentary.h"
#include "gui/dialog.h"
#include "gui/parallel_dialog.h"
#include "gui/parallel_tab.h"
#include "gui/parallel_view.h"
#include "gui/tabbed_browser.h"
#include "gui/xiphos.h"
#include "gui/sidebar.h"
#include "gui/utilities.h"
#include "gui/cipher_key_dialog.h"
#include "gui/main_menu.h"
#include "main/biblesync_glue.h"
#include "main/display.hh"
#include "main/lists.h"
#include "main/navbar.h"
#include "main/navbar_book.h"
#include "main/search_sidebar.h"
#include "main/previewer.h"
#include "main/settings.h"
#include "main/sidebar.h"
#include "main/sword.h"
#include "main/url.hh"
#include "main/xml.h"
#include "main/parallel_view.h"
#include "main/modulecache.hh"
#include "backend/sword_main.hh"
#include "backend/gs_stringmgr.h"
#include "biblesync/biblesync.hh"
#include "gui/debug_glib_null.h"
#ifdef HAVE_DBUS
#include "gui/ipc.h"
#endif
extern BibleSync *biblesync;
using namespace sword;
char *sword_locale = NULL;
gboolean companion_activity = FALSE;
/* Unicode collation necessities. */
UCollator* collator;
UErrorCode collator_status;
extern gboolean valid_scripture_key;
// these track together. when one changes, so does the other.
static std::map<string, string> abbrev_name2abbrev, abbrev_abbrev2name;
typedef std::map<string, string>::iterator abbrev_iter;
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
*
* void <API key>(char *name, char *abbreviation)
*
* Description
* adds an element to each of the abbreviation maps.
*
* Return value
* void
*/
void <API key>(const char *name, const char *abbreviation)
{
// let's not be stupid about abbreviations chosen, ok?
if (!strchr(abbreviation, '(')) {
abbrev_name2abbrev[name] = abbreviation;
abbrev_abbrev2name[abbreviation] = name;
}
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
*
* const char * <API key>(const char *name)
*
* Description
* gets abbreviation from real module, if available.
*
* Return value
* const char *
*/
const char *<API key>(const char *name)
{
if (name == NULL)
return NULL;
abbrev_iter it = abbrev_name2abbrev.find(name);
if (it != abbrev_name2abbrev.end()) {
return it->second.c_str();
}
return NULL;
}
/******************************************************************************
* Name
* main_get_name
*
* Synopsis
* #include "main/sword.h"
*
* const char * main_get_name(const char *abbreviation)
*
* Description
* gets real module name from abbreviation, if available.
*
* Return value
* const char *
*/
const char *main_get_name(const char *abbreviation)
{
if (abbreviation == NULL)
return NULL;
abbrev_iter it = abbrev_abbrev2name.find(abbreviation);
if (it != abbrev_abbrev2name.end()) {
return it->second.c_str();
}
return NULL;
}
/******************************************************************************
* Name
* main_book_heading
*
* Synopsis
* #include "main/sword.h"
*
* void main_book_heading(char * mod_name)
*
* Description
*
*
* Return value
* void
*/
void main_book_heading(char *mod_name)
{
VerseKey *vkey;
SWMgr *mgr = backend->get_mgr();
backend->display_mod = mgr->Modules[mod_name];
vkey = (VerseKey *)(SWKey *)(*backend->display_mod);
vkey->setIntros(1);
vkey->setAutoNormalize(0);
vkey->setChapter(0);
vkey->setVerse(0);
backend->display_mod->display();
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/module_dialogs.h"
*
* void <API key>(char * mod_name)
*
* Description
*
*
* Return value
* void
*/
void <API key>(char *mod_name)
{
VerseKey *vkey;
SWMgr *mgr = backend->get_mgr();
backend->display_mod = mgr->Modules[mod_name];
backend->display_mod->setKey(settings.currentverse);
vkey = (VerseKey *)(SWKey *)(*backend->display_mod);
vkey->setIntros(1);
vkey->setAutoNormalize(0);
vkey->setVerse(0);
backend->display_mod->display();
}
/******************************************************************************
* Name
* main_save_note
*
* Synopsis
* #include "main/sword.h"
*
* void main_save_note(const gchar * module_name,
* const gchar * key_str ,
* const gchar * note_str )
*
* Description
*
*
* Return value
* void
*/
void main_save_note(const gchar *module_name,
const gchar *key_str,
const gchar *note_str)
{
// Massage encoded spaces ("%20") back to real spaces.
// This is a sick. unreliable hack that should be removed
// after the underlying problem is fixed in Sword.
gchar *rework;
for (rework = (char *)strstr(note_str, "%20");
rework;
rework = strstr(rework + 1, "%20")) {
*rework = ' ';
(void)strcpy(rework + 1, rework + 3);
}
XI_message(("note module %s\nnote key %s\nnote text%s",
module_name,
key_str,
note_str));
backend->save_note_entry(module_name, key_str, note_str);
<API key>(module_name, settings.currentverse);
}
/******************************************************************************
* Name
* main_delete_note
*
* Synopsis
* #include "main/sword.h"
*
* void main_delete_note(DIALOG_DATA * d)
*
* Description
*
*
* Return value
* void
*/
void main_delete_note(const gchar *module_name,
const gchar *key_str)
{
backend->set_module_key(module_name, key_str);
XI_message(("note module %s\nnote key %s\n",
module_name,
key_str));
backend->delete_entry();
if ((!strcmp(settings.CommWindowModule, module_name)) &&
(!strcmp(settings.currentverse, key_str)))
<API key>(module_name, key_str);
}
/******************************************************************************
* Name
* set_module_unlocked
*
* Synopsis
* #include "bibletext.h"
*
* void set_module_unlocked(char *mod_name, char *key)
*
* Description
* unlocks locked module -
*
* Return value
* void
*/
void <API key>(const char *mod_name, char *key)
{
SWMgr *mgr = backend->get_mgr();
mgr->setCipherKey(mod_name, key);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/configs.h"
*
* void <API key>(gchar * mod_name, gchar * key)
*
* Description
* to unlock locked modules
*
* Return value
* void
*/
void <API key>(const char *mod_name, char *key)
{
backend->save_module_key((char *)mod_name, key);
}
/******************************************************************************
* Name
* main_getText
*
* Synopsis
* #include "main/sword.h"
* void main_getText(gchar * key)
*
* Description
* get unabbreviated key
*
* Return value
* char *
*/
char *main_getText(char *key)
{
VerseKey vkey(key);
return strdup((char *)vkey.getText());
}
/******************************************************************************
* Name
* main_getShortText
*
* Synopsis
* #include "main/sword.h"
* void main_getShortText(gchar * key)
*
* Description
* get short-name key
*
* Return value
* char *
*/
char *main_getShortText(char *key)
{
VerseKey vkey(key);
return strdup((char *)vkey.getShortText());
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "toolbar_nav.h"
*
* gchar *<API key>(const gchar * key)
*
* Description
* updates the nav toolbar controls
*
* Return value
* gchar *
*/
gchar *<API key>(const char *module_name, const gchar *key)
{
char *val_key = backend->get_valid_key(module_name, key);
// we got a valid key. but was it really a valid key within v11n?
// for future use in determining whether to show normal navbar content.
navbar_versekey.valid_key = main_is_Bible_key(module_name, key);
/*
* remember verse
*/
xml_set_value("Xiphos", "keys", "verse", val_key);
settings.currentverse = xml_get_value("keys", "verse");
settings.apply_change = FALSE;
navbar_versekey.module_name = g_string_assign(navbar_versekey.module_name, settings.MainWindowModule);
navbar_versekey.key = g_string_assign(navbar_versekey.key, val_key);
<API key>(navbar_versekey, val_key);
settings.apply_change = TRUE;
#ifdef HAVE_DBUS
IpcObject *ipc = ipc_get_main_ipc();
if (ipc)
<API key>(ipc, (const gchar *)val_key, NULL);
#endif
return val_key;
}
/******************************************************************************
* Name
* get_module_key
*
* Synopsis
* #include "main/module.h"
*
* char *get_module_key(void)
*
* Description
* returns module key
*
* Return value
* char *
*/
char *<API key>(void)
{
if (settings.havebible) {
switch (settings.whichwindow) {
case MAIN_TEXT_WINDOW:
case COMMENTARY_WINDOW:
return (char *)settings.currentverse;
break;
case DICTIONARY_WINDOW:
return (char *)settings.dictkey;
break;
case parallel_WINDOW:
return (char *)settings.cvparallel;
break;
case BOOK_WINDOW:
return (char *)settings.book_key;
break;
}
}
return NULL;
}
/******************************************************************************
* Name
* get_module_name
*
* Synopsis
* #include "main/module.h"
*
* char *get_module_name(void)
*
* Description
* returns module name
*
* Return value
* char *
*/
char *<API key>(void)
{
if (settings.havebible) {
switch (settings.whichwindow) {
case MAIN_TEXT_WINDOW:
return (char *)xml_get_value("modules",
"bible");
break;
case COMMENTARY_WINDOW:
return (char *)xml_get_value("modules",
"comm");
break;
case DICTIONARY_WINDOW:
return (char *)settings.DictWindowModule;
break;
case BOOK_WINDOW:
return (char *)settings.book_mod;
break;
}
}
return NULL;
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include ".h"
*
* void <API key>(gchar *mod_name, gchar *description)
*
* Description
*
*
* Return value
* void
*/
char *<API key>(char *description)
{
return backend-><API key>(description);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "sword.h"
*
* const char *<API key>(void)
*
* Description
*
*
* Return value
* const char *
*/
const char *<API key>(void)
{
return backend->get_sword_version();
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "sword.h"
*
* char *<API key>(char * mod_name, char * key)
*
* Description
*
*
* Return value
* char *
*/
char *<API key>(char *mod_name, char *key)
{
return backend->get_render_text((char *)mod_name, (char *)key);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "sword.h"
*
* gchar *<API key>(void)
*
* Description
* returns the path to the sword modules
*
* Return value
* gchar *
*/
char *<API key>(void)
{
SWMgr *mgr = backend->get_mgr();
char *path = mgr->prefixPath;
return (path ? g_strdup(path) : NULL);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "sword.h"
*
* void <API key>(void)
*
* Description
* initializes the hard-coded abbrev->name mapping.
*
* Return value
* void
*/
typedef std::map<SWBuf, SWBuf> ModLanguageMap;
ModLanguageMap languageMap;
void <API key>()
{
gchar *language_file;
FILE *language;
gchar *s, *end, *abbrev, *name, *newline;
gchar *mapspace;
size_t length;
if ((language_file = <API key>("languages", FALSE)) == NULL) {
gui_generic_warning(_("Xiphos's file for language\nabbreviations is missing."));
return;
}
XI_message(("%s", language_file));
if ((language = g_fopen(language_file, "r")) == NULL) {
gui_generic_warning(_("Xiphos's language abbreviation\nfile cannot be opened."));
g_free(language_file);
return;
}
g_free(language_file);
(void)fseek(language, 0L, SEEK_END);
length = ftell(language);
rewind(language);
if ((length == 0) ||
(mapspace = (gchar *)g_malloc(length + 2)) == NULL) {
fclose(language);
gui_generic_warning(_("Xiphos cannot allocate space\nfor language abbreviations."));
return;
}
if (fread(mapspace, 1, length, language) != length) {
fclose(language);
g_free(mapspace);
gui_generic_warning(_("Xiphos cannot read the\nlanguage abbreviation file."));
return;
}
fclose(language);
end = length + mapspace;
*end = '\0';
for (s = mapspace; s < end; ++s) {
if ((newline = strchr(s, '\n')) == NULL) {
XI_message(("incomplete last line in languages"));
break;
}
*newline = '\0';
if ((*s == '#') || (s == newline)) {
s = newline; // comment or empty line.
continue;
}
abbrev = s;
if ((name = strchr(s, '\t')) == NULL) {
XI_message(("tab-less line in languages"));
break;
}
*(name++) = '\0'; // NUL-terminate abbrev, mark name.
languageMap[SWBuf(abbrev)] = SWBuf(name);
s = newline;
}
g_free(mapspace);
}
const char *<API key>(const char *language)
{
if (language == NULL)
return "Unknown";
return languageMap[language].c_str();
}
char **<API key>(void)
{
return backend-><API key>();
}
/******************************************************************************
* Name
* set_sword_locale
*
* Synopsis
* #include "main/sword.h"
*
* char *set_sword_locale(const char *sys_locale)
*
* Description
* set sword's idea of the locale in which the user operates
*
* Return value
* char *
*/
char *set_sword_locale(const char *sys_locale)
{
if (sys_locale) {
SWBuf locale;
StringList localelist = LocaleMgr::getSystemLocaleMgr()->getAvailableLocales();
StringList::iterator it;
int ncmp[3] = {100, 5, 2}; // fixed data
// length-limited match
for (int i = 0; i < 3; ++i) {
for (it = localelist.begin(); it != localelist.end(); ++it) {
locale = *it;
if (!strncmp(sys_locale, locale.c_str(), ncmp[i])) {
LocaleMgr::getSystemLocaleMgr()-><API key>(locale.c_str());
return g_strdup(locale.c_str());
}
}
}
}
// either we were given a null sys_locale, or it didn't match anything.
char *err = g_strdup_printf(_("No matching locale found for `%s'.\n%s"),
sys_locale,
_("Book names and menus may not be translated."));
gui_generic_warning(err);
g_free(err);
return NULL;
}
/******************************************************************************
* Name
* backend_init
*
* Synopsis
* #include "main/sword.h"
*
* void main_init_backend(void)
*
* Description
* start sword
*
* Return value
* void
*/
void main_init_backend(void)
{
StringMgr::setSystemStringMgr(new GS_StringMgr());
const char *lang = getenv("LANG");
if (!lang)
lang = "C";
sword_locale = set_sword_locale(lang);
collator = ucol_open(sword_locale, &collator_status);
lang = LocaleMgr::getSystemLocaleMgr()-><API key>();
backend = new BackEnd();
backend->init_SWORD(0);
settings.path_to_mods = <API key>();
//#ifndef DEBUG
g_chdir(settings.path_to_mods);
//#else
// XI_warning(("no chdir(SWORD_PATH) => modmgr 'archive' may not work"));
//#endif
XI_print(("%s sword-%s\n", "Starting", backend->get_sword_version()));
XI_print(("%s\n", "Initiating SWORD"));
XI_print(("%s: %s\n", "path to sword", settings.path_to_mods));
XI_print(("%s %s\n", "SWORD locale is", lang));
XI_print(("%s\n", "Checking for SWORD Modules"));
settings.spell_language = strdup(lang);
main_init_lists();
// BibleSync backend startup. identify the user by name.
biblesync = new BibleSync("Xiphos", VERSION,
#ifdef WIN32
// in win32 glib, get_real_name and get_user_name are the same.
(string)g_get_real_name()
#else
(string)g_get_real_name() + " (" + g_get_user_name() + ")"
#endif
);
}
/******************************************************************************
* Name
* shutdown_sword
*
* Synopsis
* #include "sword.h"
*
* void shutdown_sword(void)
*
* Description
* close down sword by deleting backend;
*
* Return value
* void
*/
void <API key>(void)
{
if (sword_locale)
free((char *)sword_locale);
sword_locale = NULL;
if (backend)
delete backend;
backend = NULL;
XI_print(("%s\n", "SWORD is shutdown"));
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
*
* void <API key>(char * mod_name)
*
* Description
* text in the dictionary entry has changed and the entry activated
*
* Return value
* void
*/
void <API key>(char *mod_name)
{
gchar *key = NULL;
if (!mod_name)
return;
if (strcmp(settings.DictWindowModule, mod_name)) {
xml_set_value("Xiphos", "modules", "dict", mod_name);
settings.DictWindowModule = xml_get_value("modules", "dict");
}
key = g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(widgets.entry_dict)));
backend->set_module_key(mod_name, key);
g_free(key);
key = backend->get_module_key();
xml_set_value("Xiphos", "keys", "dictionary", key);
settings.dictkey = xml_get_value("keys", "dictionary");
main_check_unlock(mod_name, TRUE);
backend->set_module_key(mod_name, key);
backend->display_mod->display();
gtk_entry_set_text(GTK_ENTRY(widgets.entry_dict), key);
g_free(key);
}
static void <API key>(GtkMenuItem *menuitem, gpointer user_data)
{
gtk_entry_set_text(GTK_ENTRY(widgets.entry_dict), (gchar *)user_data);
gtk_widget_activate(widgets.entry_dict);
}
/******************************************************************************
* Name
*
*
* Synopsis
* #include "main/sword.h"
*
*
*
* Description
* text in the dictionary entry has changed and the entry activated
*
* Return value
* void
*/
GtkWidget *<API key>(char *mod_name, char *old_key)
{
gint count = 9, i;
gchar *new_key;
gchar *key = NULL;
GtkWidget *menu;
menu = gtk_menu_new();
if (!settings.havedict || !mod_name)
return NULL;
if (strcmp(settings.DictWindowModule, mod_name)) {
xml_set_value("Xiphos", "modules", "dict",
mod_name);
settings.DictWindowModule = xml_get_value(
"modules", "dict");
}
key = g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(widgets.entry_dict)));
XI_message(("\nold_key: %s\nkey: %s", old_key, key));
backend->set_module_key(mod_name, key);
g_free(key);
key = backend->get_module_key();
xml_set_value("Xiphos", "keys", "dictionary", key);
settings.dictkey = xml_get_value("keys", "dictionary");
main_check_unlock(mod_name, TRUE);
backend->set_module_key(mod_name, key);
backend->display_mod->display();
new_key = g_strdup((char *)backend->display_mod->getKeyText());
for (i = 0; i < (count / 2) + 1; i++) {
(*backend->display_mod)
}
for (i = 0; i < count; i++) {
free(new_key);
(*backend->display_mod)++;
new_key = g_strdup((char *)backend->display_mod->getKeyText());
/* add menu item */
GtkWidget *item =
<API key>((gchar *)new_key);
gtk_widget_show(item);
g_signal_connect(G_OBJECT(item), "activate",
G_CALLBACK(<API key>),
g_strdup(new_key));
gtk_container_add(GTK_CONTAINER(menu), item);
}
free(new_key);
g_free(key);
return menu;
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
*
* void <API key>(gint direction)
*
* Description
* The back or foward dictinary key button was clicked.
* the module key is set to the current dictkey.
* then the module is incremented or decremented.
* the new key is returned from the module and the dictionary entry is set
* to the new key. The entry is then activated.
*
* Return value
* void
*/
void <API key>(gint direction)
{
gchar *key = NULL;
if (!settings.havedict || !settings.DictWindowModule)
return;
backend->set_module_key(settings.DictWindowModule,
settings.dictkey);
if (direction == 0)
(*backend->display_mod)
else
(*backend->display_mod)++;
key = g_strdup((char *)backend->display_mod->getKeyText());
gtk_entry_set_text(GTK_ENTRY(widgets.entry_dict), key);
gtk_widget_activate(widgets.entry_dict);
g_free(key);
}
void main_display_book(const char *mod_name,
const char *key)
{
if (!settings.havebook || !mod_name)
return;
if (key == NULL)
key = "0";
XI_message(("main_display_book\nmod_name: %s\nkey: %s", mod_name, key));
if (!backend->is_module(mod_name))
return;
if (!settings.book_mod)
settings.book_mod = g_strdup((char *)mod_name);
if (strcmp(settings.book_mod, mod_name)) {
xml_set_value("Xiphos", "modules", "book", mod_name);
gui_reassign_strdup(&settings.book_mod, (gchar *)mod_name);
}
if (!isdigit(key[0])) {
xml_set_value("Xiphos", "keys", "book", key);
settings.book_key = xml_get_value("keys", "book");
backend->set_module(mod_name);
backend->set_treekey(0);
settings.book_offset = backend->treekey_set_key((char *)key);
} else {
settings.book_offset = atol(key);
if (settings.book_offset < 4)
settings.book_offset = 4;
xml_set_value("Xiphos", "keys", "book", key);
settings.book_key = xml_get_value("keys", "book");
xml_set_value("Xiphos", "keys", "offset", key);
backend->set_module(mod_name);
backend->set_treekey(settings.book_offset);
}
main_check_unlock(mod_name, TRUE);
backend->display_mod->display();
<API key>(settings.book_mod, settings.book_offset);
//if (settings.browsing)
<API key>(NULL,
NULL,
NULL,
mod_name,
NULL,
key,
FALSE,
settings.showtexts,
settings.showpreview,
settings.showcomms,
settings.showdicts);
}
void <API key>(const char *mod_name,
const char *key)
{
if (!settings.havecomm || !settings.comm_showing)
return;
if (!mod_name)
mod_name = ((settings.browsing && (cur_passage_tab != NULL))
? g_strdup(cur_passage_tab->commentary_mod)
: xml_get_value("modules", "comm"));
if (!mod_name || !backend->is_module(mod_name))
return;
int modtype = backend->module_type(mod_name);
if ((modtype != COMMENTARY_TYPE) && (modtype != PERCOM_TYPE))
return; // what are we doing here?
if (!settings.CommWindowModule)
settings.CommWindowModule = g_strdup((gchar *)mod_name);
settings.comm_showing = TRUE;
settings.whichwindow = COMMENTARY_WINDOW;
if (strcmp(settings.CommWindowModule, mod_name)) {
xml_set_value("Xiphos", "modules", "comm", mod_name);
gui_reassign_strdup(&settings.CommWindowModule, (gchar *)mod_name);
// handle a conf directive "Companion=This,That,TheOther"
char *companion = <API key>(mod_name, "Companion");
gchar **name_set = (companion ? g_strsplit(companion, ",", -1) : NULL);
if (companion &&
(!companion_activity) &&
name_set[0] &&
*name_set[0] &&
backend->is_module(name_set[0]) &&
((settings.MainWindowModule == NULL) ||
strcmp(name_set[0], settings.MainWindowModule))) {
companion_activity = TRUE;
gint name_length = g_strv_length(name_set);
char *companion_question =
g_strdup_printf(_("Module %s has companion modules:\n%s.\n"
"Would you like to open these as well?%s"),
mod_name, companion,
((name_length > 1)
? _("\n\nThe first will open in the main window\n"
"and others in separate windows.")
: ""));
if (gui_yes_no_dialog(companion_question, NULL)) {
main_display_bible(name_set[0], key);
for (int i = 1; i < name_length; i++) {
main_dialogs_open(name_set[i], key, FALSE);
}
}
g_free(companion_question);
companion_activity = FALSE;
}
if (name_set)
g_strfreev(name_set);
if (companion)
g_free(companion);
}
main_check_unlock(mod_name, TRUE);
valid_scripture_key = main_is_Bible_key(mod_name, key);
backend->set_module_key(mod_name, key);
backend->display_mod->display();
valid_scripture_key = TRUE; // leave nice for future use.
//if (settings.browsing)
<API key>(NULL,
mod_name,
NULL,
NULL,
NULL,
NULL,
TRUE,
settings.showtexts,
settings.showpreview,
settings.showcomms,
settings.showdicts);
}
void <API key>(const char *mod_name,
const char *key)
{
const gchar *old_key, *feature;
// for devotional use.
gchar buf[10];
if (!settings.havedict || !mod_name)
return;
XI_message(("<API key>\nmod_name: %s\nkey: %s", mod_name, key));
if (!backend->is_module(mod_name))
return;
if (!settings.DictWindowModule)
settings.DictWindowModule = g_strdup((gchar *)mod_name);
if (key == NULL)
key = (char *)"Grace";
feature = (char *)backend->get_mgr()->getModule(mod_name)->getConfigEntry("Feature");
// turn on "all strong's" iff we have that kind of dictionary.
if (feature && (!strcmp(feature, "HebrewDef") || !strcmp(feature, "GreekDef")))
gtk_widget_show(widgets.all_strongs);
else
gtk_widget_hide(widgets.all_strongs);
if (strcmp(settings.DictWindowModule, mod_name)) {
// new dict -- is it actually a devotional?
time_t curtime;
if (feature && !strcmp(feature, "DailyDevotion")) {
if ((strlen(key) != 5) || // blunt tests.
(key[0] < '0') || (key[0] > '9') ||
(key[1] < '0') || (key[1] > '9') ||
(key[2] != '.') ||
(key[3] < '0') || (key[3] > '9') ||
(key[4] < '0') || (key[4] > '9')) { // not MM.DD
struct tm *loctime;
curtime = time(NULL);
loctime = localtime(&curtime);
strftime(buf, 10, "%m.%d", loctime);
key = buf;
}
}
xml_set_value("Xiphos", "modules", "dict", mod_name);
gui_reassign_strdup(&settings.DictWindowModule, (gchar *)mod_name);
}
// old_key is uppercase
key = g_utf8_strup(key, -1);
old_key = gtk_entry_get_text(GTK_ENTRY(widgets.entry_dict));
if (!strcmp(old_key, key))
<API key>(settings.DictWindowModule);
else {
gtk_entry_set_text(GTK_ENTRY(widgets.entry_dict), key);
gtk_widget_activate(widgets.entry_dict);
}
//if (settings.browsing)
<API key>(NULL,
NULL,
mod_name,
NULL,
key,
NULL,
settings.comm_showing,
settings.showtexts,
settings.showpreview,
settings.showcomms,
settings.showdicts);
}
void main_display_bible(const char *mod_name,
const char *key)
{
gchar *bs_key = g_strdup(key); // avoid tab data corruption problem.
/* keeps us out of a crash causing loop */
extern guint scroll_adj_signal;
extern GtkAdjustment *adjustment;
if (adjustment)
<API key>(adjustment, scroll_adj_signal);
if (!<API key>(GTK_WIDGET(widgets.html_text)))
return;
if (!mod_name)
mod_name = ((settings.browsing && (cur_passage_tab != NULL))
? g_strdup(cur_passage_tab->text_mod)
: xml_get_value("modules", "bible"));
if (!settings.havebible || !mod_name)
return;
if (!backend->is_module(mod_name))
return;
int modtype = backend->module_type(mod_name);
if (modtype != TEXT_TYPE)
return; // what are we doing here?
if (!settings.MainWindowModule)
settings.MainWindowModule = g_strdup((gchar *)mod_name);
if (strcmp(settings.currentverse, key)) {
xml_set_value("Xiphos", "keys", "verse",
key);
settings.currentverse = xml_get_value(
"keys", "verse");
}
if (strcmp(settings.MainWindowModule, mod_name)) {
xml_set_value("Xiphos", "modules", "bible", mod_name);
gui_reassign_strdup(&settings.MainWindowModule, (gchar *)mod_name);
// handle a conf directive "Companion=This,That,TheOther"
char *companion = <API key>(mod_name, "Companion");
gchar **name_set = (companion ? g_strsplit(companion, ",", -1) : NULL);
if (companion &&
(!companion_activity) &&
name_set[0] &&
*name_set[0] &&
backend->is_module(name_set[0]) &&
((settings.CommWindowModule == NULL) ||
strcmp(name_set[0], settings.CommWindowModule))) {
companion_activity = TRUE;
gint name_length = g_strv_length(name_set);
char *companion_question =
g_strdup_printf(_("Module %s has companion modules:\n%s.\n"
"Would you like to open these as well?%s"),
mod_name, companion,
((name_length > 1)
? _("\n\nThe first will open in the main window\n"
"and others in separate windows.")
: ""));
if (gui_yes_no_dialog(companion_question, NULL)) {
<API key>(name_set[0], key);
for (int i = 1; i < name_length; i++) {
main_dialogs_open(name_set[i], key, FALSE);
}
}
g_free(companion_question);
companion_activity = FALSE;
}
if (name_set)
g_strfreev(name_set);
if (companion)
g_free(companion);
navbar_versekey.module_name = g_string_assign(navbar_versekey.module_name,
settings.MainWindowModule);
navbar_versekey.key = g_string_assign(navbar_versekey.key,
settings.currentverse);
<API key>();
}
settings.whichwindow = MAIN_TEXT_WINDOW;
main_check_unlock(mod_name, TRUE);
valid_scripture_key = main_is_Bible_key(mod_name, key);
if (backend-><API key>(mod_name,
backend->get_key_testament(mod_name, key))) {
backend->set_module_key(mod_name, key);
backend->display_mod->display();
} else {
gchar *val_key = NULL;
if (backend->get_key_testament(mod_name, key) == 1)
val_key = <API key>(mod_name, "Matthew 1:1");
else
val_key = <API key>(mod_name, "Genesis 1:1");
backend->set_module_key(mod_name, val_key);
backend->display_mod->display();
g_free(val_key);
}
valid_scripture_key = TRUE; // leave nice for future use.
XI_message(("mod_name = %s", mod_name));
//if (settings.browsing) {
<API key>(mod_name,
NULL,
NULL,
NULL,
NULL,
NULL,
settings.comm_showing,
settings.showtexts,
settings.showpreview,
settings.showcomms,
settings.showdicts);
gui_set_tab_label(settings.currentverse, FALSE);
<API key>(settings.MainWindowModule);
// (called _after_ tab data updated so not overwritten with old tab)
/*
* change parallel verses
*/
if (settings.dockedInt)
<API key>();
else {
if (settings.showparatab)
<API key>();
else
<API key>();
}
// multicast now, iff user has not asked for keyboard-only xmit.
if (!settings.bs_keyboard)
<API key>(mod_name, bs_key);
g_free(bs_key);
if (adjustment)
<API key>(adjustment, scroll_adj_signal);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
*
* void <API key>(void)
*
* Description
*
*
* Return value
* void
*/
void <API key>(void)
{
gchar buf[10];
gchar *prettybuf;
time_t curtime;
struct tm *loctime;
gchar *text;
/*
* This makes sense only if you've installed & defined one.
*/
if (settings.devotionalmod == NULL) {
GList *glist = get_list(DEVOTION_LIST);
if (g_list_length(glist) != 0) {
xml_set_value("Xiphos", "modules", "devotional",
(char *)glist->data);
gui_reassign_strdup(&settings.devotionalmod, (gchar *)glist->data);
} else {
gui_generic_warning(_("Daily devotional was requested, but there are none installed."));
}
}
/*
* Get the current time, converted to local time.
*/
curtime = time(NULL);
loctime = localtime(&curtime);
strftime(buf, 10, "%m.%d", loctime);
prettybuf = g_strdup_printf("<b>%s %d</b>",
gettext(month_names[loctime->tm_mon]),
loctime->tm_mday);
text = backend->get_render_text(settings.devotionalmod, buf);
if (text) {
main_entry_display(settings.<API key>
? sidebar.html_viewer_widget
: widgets.html_previewer_text,
settings.devotionalmod, text, prettybuf, TRUE);
g_free(text);
}
g_free(prettybuf);
}
void main_setup_displays(void)
{
backend->textDisplay = new GTKChapDisp(widgets.html_text, backend);
backend->commDisplay = new GTKEntryDisp(widgets.html_comm, backend);
backend->bookDisplay = new GTKEntryDisp(widgets.html_book, backend);
backend->dictDisplay = new GTKEntryDisp(widgets.html_dict, backend);
}
const char *<API key>(const char *module_name)
{
return backend->module_get_language(module_name);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include ".h"
*
* gint <API key>(const gchar * mod_name, const gchar * key, const gchar * option)
*
* Description
* get any option for a module
*
* Return value
* gint
*/
gint <API key>(const gchar *mod_name, const gchar *key, const gchar *option)
{
return backend->has_option(mod_name, key, option);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include ".h"
*
* gint <API key>(const gchar * mod_name, const gchar * option)
*
* Description
* get global options for a module
*
* Return value
* gint
*/
gint <API key>(const gchar *mod_name, const gchar *option)
{
return backend->has_global_option(mod_name, option);
}
/******************************************************************************
* Name
* main_is_module
*
* Synopsis
* #include "main/module.h"
*
* int main_is_module(char * mod_name)
*
* Description
* check for presents of a module by name
*
* Return value
* int
*/
int main_is_module(char *mod_name)
{
return backend->is_module(mod_name);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/module.h"
*
* int <API key>(char * mod_name)
*
* Description
* tells us whether CLucene is available
*
* Return value
* int (boolean)
*/
int <API key>(char *mod_name)
{
SWMgr *mgr = backend->get_mgr();
SWModule *mod = mgr->getModule(mod_name);
return (mod && mod->hasSearchFramework());
}
/******************************************************************************
* Name
* main_optimal_search
*
* Synopsis
* #include "main/module.h"
*
* int main_optimal_search(char * mod_name)
*
* Description
* tells us whether a CLucene index exists
*
* Return value
* int (boolean)
*/
int main_optimal_search(char *mod_name)
{
SWMgr *mgr = backend->get_mgr();
SWModule *mod = mgr->Modules.find(mod_name)->second;
return mod-><API key>("God", -4, 0, 0);
}
char *<API key>(const char *module_name,
const char *entry)
{
return backend->get_config_entry((char *)module_name, (char *)entry);
}
char *<API key>(const char *module_name,
const char *moddir)
{
#ifdef <API key>
return backend->get_config_file((char *)module_name, (char *)moddir);
#else
GDir *dir;
SWBuf name;
name = moddir;
name += "/mods.d";
if ((dir = g_dir_open(name, 0, NULL))) {
const gchar *ent;
g_dir_rewind(dir);
while ((ent = g_dir_read_name(dir))) {
name = moddir;
name += "/mods.d/";
name += ent;
SWConfig *config = new SWConfig(name.c_str());
if (config->getSections().find(module_name) !=
config->getSections().end()) {
gchar *ret_name = g_strdup(ent);
g_dir_close(dir);
delete config;
return ret_name;
} else
delete config;
}
g_dir_close(dir);
}
return NULL;
#endif
}
int main_is_mod_rtol(const char *module_name)
{
char *direction = backend->get_config_entry((char *)module_name, (char *)"Direction");
return (direction && !strcmp(direction, "RtoL"));
}
/******************************************************************************
* Name
* main_has_cipher_tag
*
* Synopsis
* #include "main/.h"
*
* int main_has_cipher_tag(char *mod_name)
*
* Description
*
*
* Return value
* int
*/
int main_has_cipher_tag(char *mod_name)
{
gchar *cipherkey = backend->get_config_entry(mod_name, (char *)"CipherKey");
int retval = (cipherkey != NULL);
g_free(cipherkey);
return retval;
}
#define CIPHER_INTRO \
_("<b>Locked Module.</b>\n\n<u>You are opening a module which requires a <i>key</i>.</u>\n\nThe module is locked, meaning that the content is encrypted by its publisher, and you must enter its key in order for the content to become useful. This key should have been received by you on the web page which confirmed your purchase, or perhaps sent via email after purchase.\n\nPlease enter the key in the dialog.")
/******************************************************************************
* Name
* main_check_unlock
*
* Synopsis
* #include "main/.h"
*
* int main_check_unlock(const char *mod_name)
*
* Description
*
*
* Return value
* int
*/
void main_check_unlock(const char *mod_name, gboolean conditional)
{
gchar *cipher_old = <API key>(mod_name, "CipherKey");
/* if forced by the unlock menu item, or it's present but empty... */
if (!conditional ||
((cipher_old != NULL) && (*cipher_old == '\0'))) {
if (conditional) {
GtkWidget *dialog;
dialog = <API key>(NULL, /* no need for a parent window */
<API key>,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
CIPHER_INTRO);
<API key>(dialog, "response",
G_CALLBACK(gtk_widget_destroy),
dialog);
gtk_widget_show(dialog);
}
gchar *cipher_key = gui_add_cipher_key(mod_name, cipher_old);
if (cipher_key) {
ModuleCacheErase(mod_name);
<API key>();
g_free(cipher_key);
}
}
g_free(cipher_old);
}
/******************************************************************************
* Name
* main_get_striptext
*
* Synopsis
* #include "main/sword.h"
*
* char *main_get_striptext(char *module_name, char *key)
*
* Description
*
*
* Return value
* char *
*/
char *main_get_striptext(char *module_name, char *key)
{
return backend->get_strip_text(module_name, key);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
*
* char *<API key>(char *module_name, char *key)
*
* Description
*
*
* Return value
* char *
*/
char *<API key>(const char *module_name, const char *key)
{
return backend->get_render_text(module_name, key);
}
/******************************************************************************
* Name
* main_get_raw_text
*
* Synopsis
* #include "main/sword.h"
*
* char *main_get_raw_text(char *module_name, char *key)
*
* Description
*
*
* Return value
* char *
*/
char *main_get_raw_text(char *module_name, char *key)
{
return backend->get_raw_text(module_name, key);
}
/******************************************************************************
* Name
* main_get_mod_type
*
* Synopsis
* #include "main/module.h"
*
* int main_get_mod_type(char * mod_name)
*
* Description
*
*
* Return value
* int
*/
int main_get_mod_type(char *mod_name)
{
return backend->module_type(mod_name);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/module.h"
*
* gchar *<API key>(gchar * module_name)
*
* Description
*
*
* Return value
* gchar *
*/
const char *<API key>(const char *module_name)
{
return backend->module_description(module_name);
}
/******************************************************************************
* Name
* main_format_number
*
* Synopsis
* #include "main/sword.h"
* char *main_format_number(int x)
*
* Description
* returns a digit string in either "latinate arabic" (normal) or
* farsi characters.
* re_encode_digits is chosen at startup in settings.c.
* caller must free allocated string space when finished with it.
*
* Return value
* char *
*/
int re_encode_digits = FALSE;
char *
main_format_number(int x)
{
char *digits = g_strdup_printf("%d", x);
if (re_encode_digits) {
// "\333\260" is farsi "zero".
char *d, *f, *farsi = g_new(char, 2 * (strlen(digits) + 1));
// 2 "chars" per farsi-displayed digit + slop.
for (d = digits, f = farsi; *d; ++d) {
*(f++) = '\333';
*(f++) = '\260' + ((*d) - '0');
}
*f = '\0';
g_free(digits);
return farsi;
}
return digits;
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
* void <API key>()
*
* Description
* cleans content from all subwindow widgets.
*
* Return value
* int
*/
void <API key>(void)
{
GString *blank_html_content = g_string_new(NULL);
g_string_printf(blank_html_content,
"<html><head></head><body bgcolor=\"%s\" text=\"%s\"> </body></html>",
settings.bible_bg_color, settings.bible_text_color);
if (<API key>(GTK_WIDGET(widgets.html_text)))
HtmlOutput(blank_html_content->str, widgets.html_text, NULL, NULL);
if (<API key>(GTK_WIDGET(widgets.html_comm)))
HtmlOutput(blank_html_content->str, widgets.html_comm, NULL, NULL);
if (<API key>(GTK_WIDGET(widgets.html_dict)))
HtmlOutput(blank_html_content->str, widgets.html_dict, NULL, NULL);
if (<API key>(GTK_WIDGET(widgets.html_book)))
HtmlOutput(blank_html_content->str, widgets.html_book, NULL, NULL);
g_string_free(blank_html_content, TRUE);
}
/******************************************************************************
* Name
* main_is_Bible_key
*
* Synopsis
* #include "main/sword.h"
* void main_is_Bible_key()
*
* Description
* returns boolean status of whether input is a legit Bible key.
*
* Return value
* gboolean
*/
gboolean main_is_Bible_key(const gchar *name, const gchar *key)
{
return (gboolean)(backend->is_Bible_key(name, key, settings.currentverse) != 0);
}
/******************************************************************************
* Name
* <API key>
*
* Synopsis
* #include "main/sword.h"
* void <API key>()
*
* Description
* returns OSISRef-formatted key value.
*
* Return value
* const char *
*/
const char *
<API key>(const char *module, const char *key)
{
return backend-><API key>(module, key);
}
|
<?php
global $PPT,$PPTDesign;
PremiumPress_Header(); ?>
<div id="premiumpress_box1" class="premiumpress_box <API key>"><div class="premiumpress_boxin"><div class="header">
<h3><img src="<?php echo $GLOBALS['template_url']; ?>/images/premiumpress/h-ico/GeneralPreferences.png" align="middle"> Display Setup</h3>
<ul>
<li><a rel="premiumpress_tab1" href="#" class="active">Layout</a></li>
<li><a rel="premiumpress_tab6" href="#">Home</a></li>
<!--<li><a rel="premiumpress_tab2" href="#">Search</a></li>-->
<li><a rel="premiumpress_tab3" href="#">Sidebar</a></li>
<li><a rel="premiumpress_tab4" href="#">Coupon Page</a></li>
<li><a rel="premiumpress_tab5" href="#">Sliders</a></li>
</ul>
</div>
<style>
select { border-radius: 0px; -<API key>: 0px; -moz-border-radius: 0px; }
</style>
<form method="post" name="directorypress" target="_self" >
<input name="admin_page" type="hidden" value="<API key>" />
<input name="submitted" type="hidden" value="yes" />
<input name="setup" type="hidden" value="1" />
<input name="featured" type="hidden" value="1" />
<input name="featured1" type="hidden" value="1" />
<input name="listbox" type="hidden" value="yes" />
<input name="featuredstores" type="hidden" value="yes" />
<div id="premiumpress_tab1" class="content">
<table class="maintable" style="background:white;">
<tr class="mainrow">
<td></td>
<td class="forminp">
<p><b>Coupon Display</b></p>
<select name="adminArray[system]" class="small-input" style="width: 240px; font-size:14px;">
<option value="clicktoreveal" <?php if(get_option("system") == "clicktoreveal"){ echo "selected='selected'"; } ?>>Click To Reveal</option>
<option value="normal" <?php if(get_option("system") == "normal"){ echo "selected='selected'"; } ?>>Click To Copy</option>
<option value="link" <?php if(get_option("system") == "link"){ echo "selected='selected'"; } ?>>Link Display</option>
</select>
<br />
<small>Select which type of coupon display you wish to use.</small> </td>
<td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/c3.png">
</td>
</tr>
<tr class="mainrow"><td></td><td class="forminp">
<b>Select theme layout (2 or 3 columns)</b>
<table width="100%" border="1">
<tr>
<td style="width:150px;"><img src="<?php echo $GLOBALS['template_url']; ?>/PPT/img/layout2.gif" /><br /><center>
<input name="<API key>" type="radio" value="2" <?php if(get_option("<API key>") =="2" || get_option("<API key>") =="" ){ print "checked";} ?> /> </center></td>
<td style="width:150px;"><img src="<?php echo $GLOBALS['template_url']; ?>/PPT/img/layout3.gif" /><br /><center>
<input name="<API key>" type="radio" value="3" <?php if(get_option("<API key>") =="3"){ print "checked";} ?> /> </center>
</td>
</tr>
</table>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/c4.png"></td></tr>
<?php ?>
<tr class="mainrow"><td></td>
<td class="forminp">
<p><b>Footer Text</b></p>
<textarea name="adminArray[footer_text]" type="text" style="width:240px;height:150px;"><?php echo stripslashes(get_option("footer_text")); ?></textarea><br />
<small>This will be added to the bottom of your website.</small>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a16.png"></td></tr>
<?php ?>
<tr>
<td colspan="3"><p><input class="premiumpress_button" type="submit" value="<?php _e('Save changes','cp')?>" style="color:white;" /></p></td>
</tr>
</table>
</div>
<div id="premiumpress_tab6" class="content">
<table class="maintable" style="background:white;">
<?php ?>
<tr class="mainrow"><td></td><td class="forminp">
<p><b>Website Categories Box</b></p>
<select name="adminArray[display_homecats]" style="width: 240px; font-size:14px;">
<option value="yes" <?php if(get_option("display_homecats") =="yes"){ print "selected";} ?>>Show</option>
<option value="no" <?php if(get_option("display_homecats") =="no"){ print "selected";} ?>>Hide</option>
</select><br />
<small>Show/Hide the home page categories area.</small>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a1.png"></td></tr>
<?php ?>
<?php if(get_option("display_homecats") =="yes"){ ?>
<tr class="mainrow"><td></td><td class="forminp">
<p><b>Order Categories By </b></p>
<select name="adminArray[<API key>]" style="width: 240px; font-size:14px;">
<option value="id" <?php if(get_option("<API key>") =="id"){ print "selected";} ?>>ID (Ascending Order)</option>
<option value="id&order=desc" <?php if(get_option("<API key>") =="id&order=desc"){ print "selected";} ?>>ID (Descending Order)</option>
<option value="name" <?php if(get_option("<API key>") =="name"){ print "selected";} ?>>Name (Ascending Order)</option>
<option value="name&order=desc" <?php if(get_option("<API key>") =="name&order=desc"){ print "selected";} ?>>Name (Descending Order)</option>
<option value="slug" <?php if(get_option("<API key>") =="slug"){ print "selected";} ?>>Slug (Ascending Order)</option>
<option value="slug&order=desc" <?php if(get_option("<API key>") =="slug&order=desc"){ print "selected";} ?>>Slug (Descending Order)</option>
<option value="count" <?php if(get_option("<API key>") =="count"){ print "selected";} ?>>Count (Ascending Order)</option>
<option value="count&order=desc" <?php if(get_option("<API key>") =="count&order=desc"){ print "selected";} ?>>Count (Descending Order)</option>
<!-- <option value="group" <?php if(get_option("<API key>") =="group"){ print "selected";} ?>>Group (Ascending Order)</option>
<option value="group&order=desc" <?php if(get_option("<API key>") =="group&order=desc"){ print "selected";} ?>>Group (Descending Order)</option>
</select><br />
<small>select in what order to display the categories.</small>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a2.png"></td></tr>
<?php ?>
<tr class="mainrow">
<td></td>
<td class="forminp">
<p><b>Display Sub Categories</b></p>
<select name="adminArray[<API key>]" style="width: 240px; font-size:14px;">
<option value="yes" <?php if(get_option("<API key>") =="yes"){ print "selected";} ?>>Show</option>
<option value="no" <?php if(get_option("<API key>") =="no"){ print "selected";} ?>>Hide</option>
</select><br />
<small>Show/Hide the list of sub categories under the main category link.</small>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a3.png"></td></tr>
<?php } ?>
<tr class="mainrow"><td></td><td class="forminp">
<b>Home Page Image</b>
<p style="width: 240px;"><input type="checkbox" class="checkbox" name="<API key>" value="1" <?php if(get_option("<API key>") =="1"){ print "checked";} ?> /> Enable Featured Image</p><br />
<small>Add your own image to the front page</small>
<?php if(get_option("<API key>") =="1"){ ?>
<b>Featured Image URL</b><br />
<input name="adminArray[<API key>]" type="text" style="width: 240px; font-size:14px;" value="<?php echo get_option("<API key>"); ?>" /><br />
<small>Enter the full URL for the image you would like to display.</small>
<br /><b>Featured Image Link URL</b><br />
<input name="adminArray[<API key>]" type="text" style="width: 240px; font-size:14px;" value="<?php echo get_option("<API key>"); ?>" /><br />
<small>Enter the link you would like to have when someone clicks on the image.</small>
<?php } ?>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a0.png"></td></tr>
<tr>
<td colspan="3"><p><input class="premiumpress_button" type="submit" value="<?php _e('Save changes','cp')?>" style="color:white;" /></p></td>
</tr>
</table>
</div>
<div id="premiumpress_tab2" class="content">
<table class="maintable" style="background:white;">
<tr>
<td colspan="4"><p><input class="premiumpress_button" type="submit" value="<?php _e('Save changes','cp')?>" style="color:white;" /></p></td>
</tr>
</table>
</div>
<div id="premiumpress_tab3" class="content">
<table class="maintable" style="background:white;">
<?php ?>
<tr class="mainrow">
<td></td>
<td class="forminp">
<p><b>Display Recent Articles</b></p>
<select name="adminArray[<API key>]" style="width: 240px; font-size:14px;">
<option value="yes" <?php if(get_option("<API key>") =="yes"){ print "selected";} ?>>Show</option>
<option value="no" <?php if(get_option("<API key>") =="no"){ print "selected";} ?>>Hide</option>
</select><br /><small>Show/Hide the sidebar articles box.</small> <br />
<input name="adminArray[<API key>]" value="<?php echo get_option("<API key>"); ?>" class="txt" style="width:50px; font-size:14px;" type="text"> # Articles
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a7.png"></td></tr>
<?php ?>
<tr class="mainrow">
<td class="titledesc" valign="top">Featured Stores <br /><br />
<small>Select the stores you wish to be displayed as featured on your sidebar. </small> </td>
<td class="forminp" valign="top">
<?php
$Maincategories= get_categories('use_desc_for_title=1&hide_empty=0&hierarchical=1');
$Maincatcount = count($Maincategories);
$SAVED_DISPLAY = get_option("featured_stores");
$i=0;
foreach ($Maincategories as $Maincat) {
if($Maincat->parent !=0){
print '<div style="background:#efefef; padding:8px; border:1px solid #ddd; font-size:12px; font-weight:bold; float:left; width:270px; margin-right:10px; ">
<input name="featured_stores['.$i.'][ID]" type="checkbox"
value="'.$Maincat->cat_ID.'"';
if( isset($SAVED_DISPLAY[$i][ID]) ){ print 'checked="checked"'; }
print 'style="margin-right:10px;">' . $Maincat->cat_name.' ';
print '<br><small>Order: <input name="featured_stores['.$i.'][ORDER]" type="text" value="';
if(isset($SAVED_DISPLAY[$i][ORDER]) && is_numeric($SAVED_DISPLAY[$i][ORDER]) ){ print $SAVED_DISPLAY[$i][ORDER]; }
print '" style="width:30px;font-size:11px;"> </small>';
print ' </div> ';
$i++;
}
}
?>
</td>
</tr>
<tr class="mainrow"><td colspan="3">
<center><a href="widgets.php"><img src="<?php echo $GLOBALS['template_url']; ?>/<API key>/images/help1/a23.png"></a></center>
</td> <tr>
<tr>
<td colspan="3"><p><input class="premiumpress_button" type="submit" value="<?php _e('Save changes','cp')?>" style="color:white;" /></p></td>
</tr>
</table>
</div>
<div id="premiumpress_tab4" class="content">
<table class="maintable" style="background:white;">
<tr class="mainrow">
<td></td>
<td class="forminp">
<p><b>Member information box</b></p>
<select name="adminArray[<API key>]" style="width: 240px; font-size:14px;">
<option value="yes" <?php if(get_option("<API key>") =="yes"){ print "selected";} ?>>Show</option>
<option value="no" <?php if(get_option("<API key>") =="no"){ print "selected";} ?>>Hide</option>
</select><br /><small>Show/Hide the sidebar member information box.</small> <br />
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/c1.png"></td></tr>
<tr class="mainrow">
<td></td>
<td class="forminp">
<p><b>Related Coupons</b></p>
<select name="adminArray[<API key>]" style="width: 240px; font-size:14px;">
<option value="yes" <?php if(get_option("<API key>") =="yes"){ print "selected";} ?>>Show</option>
<option value="no" <?php if(get_option("<API key>") =="no"){ print "selected";} ?>>Hide</option>
</select><br /><small>Show/Hide the related coupons on the coupon page.</small> <br />
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/c4.png"></td></tr>
<?php ?>
<tr class="mainrow"> <td></td><td class="forminp">
<p><b> Google Maps Box</b></p>
<select name="adminArray[display_googlemaps]" style="width: 240px; font-size:14px;">
<option value="yes2" <?php if(get_option("display_googlemaps") =="yes2"){ print "selected";} ?>>Show - Interactive Map</option>
<option value="no" <?php if(get_option("display_googlemaps") =="no"){ print "selected";} ?>>Hide Google Maps</option>
</select><br />
<small><b>Remember</b>Google maps will only display for listings that have a map_location custom field value entered. The interative map requires long/Lat coordinates and isnt recommended for unexperienced users.</small>
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/c2.png"></td></tr>
<?php ?>
<tr>
<td colspan="3"><p><input class="premiumpress_button" type="submit" value="Save Changes" style="color:white;" /></p></td>
</tr>
</table>
</div>
<div id="premiumpress_tab5" class="content">
<table class="maintable" style="background:white;">
<?php ?>
<tr class="mainrow"> <td></td><td class="forminp">
<p><b> Enable Home Page Slider </b></p>
<select name="adminArray[PPT_slider]" style="width: 240px; font-size:14px;">
<option value="off" <?php if(get_option("PPT_slider") =="off"){ print "selected";} ?>>Disable All Sliders</option>
<option value="s1" <?php if(get_option("PPT_slider") =="s1"){ print "selected";} ?>>Featured Content Slider (Full Width)</option>
<option value="s2" <?php if(get_option("PPT_slider") =="s2"){ print "selected";} ?>>Half Content Slider</option>
</select>
<p><b> Slider Style</b></p>
<select name="adminArray[PPT_slider_style]" style="width: 240px; font-size:14px;">
<option value="1" <?php if(get_option("PPT_slider_style") =="1"){ print "selected";} ?>>Style 1 (image size: 650x X 265px)</option>
<option value="2" <?php if(get_option("PPT_slider_style") =="2"){ print "selected";} ?>>Style 2 (image size: 960x X 360px)</option>
<option value="3" <?php if(get_option("PPT_slider_style") =="3"){ print "selected";} ?>>Style 3 (image size: 960x X 360px)</option>
<option value="4" <?php if(get_option("PPT_slider_style") =="4"){ print "selected";} ?>>Style 4 (image size: 960x X 360px)</option>
<option value="5" <?php if(get_option("PPT_slider_style") =="5"){ print "selected";} ?>>Style 5 (image size: 960x X 360px)</option>
</select><br />
<p><b> Slider Content Source</b></p>
<select name="adminArray[PPT_slider_items]" style="width: 240px; font-size:14px;">
<option value="manual" <?php if(get_option("PPT_slider_items") =="manual"){ print "selected";} ?>>Manually Configure Slides</option>
<option value="featured" <?php if(get_option("PPT_slider_items") =="featured"){ print "selected";} ?>>Use Featured Posts</option>
</select><br />
</td><td class="forminp"><img src="<?php echo IMAGE_PATH; ?>/help1/a21.png"></td></tr>
<?php ?>
<tr>
<td colspan="3"><p><input class="premiumpress_button" type="submit" value="<?php _e('Save changes','cp')?>" style="color:white;" /></p></td>
</tr>
</table>
</form>
<div id="DisplayImages" style="display:none;"></div><input type="hidden" id="searchBox1" name="searchBox1" value="" />
<div id="PPT-sliderbox"></div>
<div id="PPT-sliderboxAdd" style="margin-left:20px;display:none">
<form method="post" target="_self" >
<input name="admin_slider" type="hidden" value="slider" />
<input type="hidden" id="ppsedit" value="0">
<table width="100%" border="0">
<tr>
<td valign="top"><b>Slider Title</b> <br /> <input type="text" name="s1" id="pps1" style="width: 200px; font-size:14px;" class="txt" /> </td>
<td><b>Title Description</b> <small>(max. 10 words)</small> <br /> <textarea name="s3" id="pps3" style="width: 200px; font-size:14px; height:70px;" class="txt"></textarea> </td>
<td><b>Main Description</b> <small>(max. 250 words)</small> <br /> <textarea name="s4" id="pps4" style="width: 200px; font-size:14px; height:70px;" class="txt"></textarea></td>
</tr>
<tr>
<td><b>Slider Image</b> <br/> <input type="text" name="s2" id="pps2" style="width: 200px; font-size:14px;" class="txt" />
<br/><br/>
<input type="hidden" value="" name="imgIdblock" id="imgIdblock" />
<script type="text/javascript">
function ChangeImgBlock(divname){
document.getElementById("imgIdblock").value = divname;
}
jQuery(document).ready(function() {
jQuery('#upload_sliderimage').click(function() {
ChangeImgBlock('pps2');
formfield = jQuery('#pps2').attr('name');
tb_show('', <?php if(defined('MULTISITE') && MULTISITE != false){ ?>'admin.php?page=images&tab=nw&TB_iframe=true'<?php }else{ ?>'media-upload.php?type=image&TB_iframe=true'<?php } ?>);
return false;
});
window.send_to_editor = function(html) {
imgurl = jQuery('img',html).attr('src');
jQuery('#'+document.getElementById("imgIdblock").value).val(imgurl);
tb_remove();
}
});
</script>
<input id="upload_sliderimage" type="button" size="36" name="upload_sliderimage" value="Upload Image" />
<input onClick="toggleLayer('DisplayImages'); add_image_next(0,'<?php echo get_option("imagestorage_path"); ?>','<?php echo get_option("imagestorage_link"); ?>','pps2');" type="button" value="View Images" />
</td>
<td valign="top"><b>Slider Clickable Link</b> <br /> <input type="text" name="s5" id="pps5" style="width: 200px; font-size:14px;" class="txt" value="http:
<td valign="top"><b>Display Order</b><br /><select id="pps6" name="s6" style="width: 100px; font-size:14px;"><?php $i=1; while($i<20){ echo '<option>'.$i.'</option>'; $i++; } ?></select></td>
</tr>
<tr>
<td colspan="3"><p><input class="premiumpress_button" type="submit" value="Create New Slide" style="color:white;" /></p></td>
</tr>
</table>
</form>
</div>
<div id="addBtn1" style="display:visible"><a href="javascript:void();" onClick="jQuery('#PPT-sliderboxAdd').show();jQuery('#addBtn1').hide();" class="premiumpress_button" style=" float:right; margin-right:10px;" >Add Slider Item</a></div>
<h2 style="margin-left:10px;">Website Slider Items</h2>
<p style="margin-left:10px;">Here you can setup and create new items for your website slider.</p>
<?php $sliderData = get_option("slider_array"); if(is_array($sliderData) && count($sliderData) > 0 ){ ?>
<table id="ct"><thead><tr id="ct_sort">
<th width="90" class="first">Title</th>
<th width="100">Short Description</th>
<th width="40"class="last">Display Order</th>
<th width="40"class="last">Actions</th>
</tr></thead><tbody>
<?php
$sortedSlider = $PPTDesign->array_sort($sliderData, 'order', SORT_ASC);
$i=-1; foreach($sortedSlider as $hh => $slide){ ?>
<tr id="srow<?php echo $i; ?>">
<td width="90" class="first"><?php echo $slide['s1']; ?></td>
<td width="80"><?php echo $slide['s3']; ?></td>
<td width="50"><?php echo $slide['order']; ?></td>
<td width="80" class="last">
<a href='#' Onclick="EditsliderItem('<?php echo $hh; ?>');jQuery('#PPT-sliderbox').show();" style="padding:5px; background:#dcffe1; border:1px solid #57b564; color:green;"><img src="<?php echo $GLOBALS['template_url']; ?>/images/premiumpress/led-ico/find.png" align="middle"> Edit </a>
- <a href='#' Onclick="DeleteSliderItem('<?php echo $hh; ?>');jQuery('#PPT-sliderbox').show();jQuery('#srow<?php echo $i; ?>').hide();" style="padding:5px; background:#ffb9ba; border:1px solid #bd2e2f; color:red;"><img src="<?php echo $GLOBALS['template_url']; ?>/images/premiumpress/led-ico/delete.png" align="middle"> Delete </a></td>
</tr>
<?php $i++; } ?>
</tbody> </table>
<br />
<form method="post" target="_self" >
<input name="admin_slider" type="hidden" value="reset" />
<input class="premiumpress_button" type="submit" value="Reset Slider (Delete All Slides)" style="color:white;" />
</form>
<?php } ?>
</div>
|
/**
* <API key>.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package it.depositolegale.www.webservice_<API key>;
public interface <API key> extends java.rmi.Remote {
public it.depositolegale.www.<API key>.<API key> <API key>(it.depositolegale.www.<API key>.<API key> <API key>) throws java.rmi.RemoteException;
}
|
<?php
namespace Modules\Admin\Models;
/**
* The layout model class.
*/
class Layout extends \Ilch\Model
{
/**
* Key of the layout.
*
* @var string
*/
protected $key;
/**
* Name of the layout.
*
* @var string
*/
protected $name;
/**
* Author of the layout.
*
* @var string
*/
protected $author;
/**
* Link of the layout.
*
* @var string
*/
protected $link;
/**
* Description of the layout.
*
* @var string
*/
protected $desc;
/**
* Module of the layout.
*
* @var string
*/
protected $modulekey;
/**
* Gets the key.
*
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* Sets the key.
*
* @param string $key
*/
public function setKey($key)
{
$this->key = (string)$key;
}
/**
* Gets the name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sets the name.
*
* @param string $key
*/
public function setName($name)
{
$this->name = (string)$name;
}
/**
* Gets the author.
*
* @return string
*/
public function getAuthor()
{
return $this->author;
}
/**
* Sets the author.
*
* @param string $author
*/
public function setAuthor($author)
{
$this->author = (string)$author;
}
/**
* Gets the link.
*
* @return string
*/
public function getLink()
{
return $this->link;
}
/**
* Sets the link.
*
* @param string $link
*/
public function setLink($link)
{
$this->link = (string)$link;
}
/**
* Gets the desc.
*
* @return string
*/
public function getDesc()
{
return $this->desc;
}
/**
* Sets the author.
*
* @param string $desc
*/
public function setDesc($desc)
{
$this->desc = (string)$desc;
}
/**
* Gets the modulekey.
*
* @return string
*/
public function getModulekey()
{
return $this->modulekey;
}
/**
* Sets the modulekey.
*
* @param string $modulekey
*/
public function setModulekey($modulekey)
{
$this->modulekey = (string)$modulekey;
}
}
|
.NoInherit {
font-style: oblique;
opacity: 0.5;
}
.AccessTableHeading {
padding-top: 0.5em;
padding-bottom: 0.25em;
font-weight: bold;
}
.AccessTable th {
white-space: nowrap;
}
.AccessTable .GroupName {
width: 40%;
}
.AccessTable .Narrow {
width: 10%;
}
|
# ACN: 082 081 472 ABN: 83 082 081 472
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# $Id: Plugins.py,v 1.5 2004/11/10 14:15:33 akm Exp $
import App, Globals, OFS
import string
import time
from Globals import ImageFile, HTMLFile, HTML, MessageDialog, package_home
from OFS.Folder import Folder
class PluginRegister:
def __init__(self, name, description, pluginClass,
pluginStartForm, pluginStartMethod,
pluginEditForm=None, pluginEditMethod=None):
self.name=name #No Spaces please...
self.description=description
self.plugin=pluginClass
self.manage_addForm=pluginStartForm
self.manage_addMethod=pluginStartMethod
self.manage_editForm=pluginEditForm
self.manage_editMethod=pluginEditMethod
class <API key>:
def __init__(self, name, crypto, description, pluginMethod):
self.name = name #No Spaces please...
self.cryptoMethod = crypto
self.description = description
self.plugin = pluginMethod
|
<!DOCTYPE html PUBLIC "-
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/js.cookie.js"></script>
<title>BenchmarkTest00199</title>
</head>
<body>
<form action="/benchmark/BenchmarkTest00199" method="POST" id="<API key>">
<div><label>Please explain your answer:</label></div>
<br/>
<div><textarea rows="4" cols="50" id="vectorArea" name="vectorArea"></textarea></div>
<div><label>Any additional note for the reviewer:</label></div>
<div><input type="text" id="answer" name="answer"></input></div>
<br/>
<div><label>An AJAX request will be sent with a header named vector and value:</label>
<input type="text" id="vector" name="vector" value="bar" class="safe"></input></div>
<div><input type="button" id="login-btn" value="Login" /></div>
</form>
<div id="ajax-form-msg1"><pre><code class="prettyprint" id="code"></code></pre></div>
<script>
$('.safe').keypress(function (e) {
if (e.which == 13) {
$('#login-btn').trigger('click');
return false;
}
});
$("#login-btn").click(function(){
var formData = $("#<API key>").serializeArray();
var URL = $("#<API key>").attr("action");
var text = $("#<API key> input[id=vector]").val();
$.ajax({
url : URL,
headers: { 'vector': text },
type: "POST",
data : formData,
success: function(data, textStatus, jqXHR){
$("#code").text(data);
},
error: function (jqXHR, textStatus, errorThrown){ console.error(errorThrown);}
});
});
</script>
</body>
</html>
|
#include <kroute.h>
#include "prefix.h"
#include "thread.h"
#include "buffer.h"
#include "stream.h"
#include "command.h"
#include "sockunion.h"
#include "network.h"
#include "memory.h"
#include "filter.h"
#include "routemap.h"
#include "str.h"
#include "log.h"
#include "plist.h"
#include "linklist.h"
#include "workqueue.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_table.h"
#include "bgpd/bgp_aspath.h"
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_dump.h"
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_community.h"
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_regex.h"
#include "bgpd/bgp_clist.h"
#include "bgpd/bgp_fsm.h"
#include "bgpd/bgp_packet.h"
#include "bgpd/bgp_kroute.h"
#include "bgpd/bgp_open.h"
#include "bgpd/bgp_filter.h"
#include "bgpd/bgp_nexthop.h"
#include "bgpd/bgp_damp.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_advertise.h"
#include "bgpd/bgp_network.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_mpath.h"
#ifdef HAVE_SNMP
#include "bgpd/bgp_snmp.h"
#endif /* HAVE_SNMP */
/* BGP process wide configuration. */
static struct bgp_master bgp_master;
extern struct in_addr router_id_kroute;
/* BGP process wide configuration pointer to export. */
struct bgp_master *bm;
/* BGP community-list. */
struct <API key> *bgp_clist;
/* BGP global flag manipulation. */
int
bgp_option_set (int flag)
{
switch (flag)
{
case BGP_OPT_NO_FIB:
case <API key>:
case <API key>:
SET_FLAG (bm->options, flag);
break;
default:
return <API key>;
}
return 0;
}
int
bgp_option_unset (int flag)
{
switch (flag)
{
case <API key>:
if (listcount (bm->bgp) > 1)
return <API key>;
/* Fall through. */
case BGP_OPT_NO_FIB:
case <API key>:
UNSET_FLAG (bm->options, flag);
break;
default:
return <API key>;
}
return 0;
}
int
bgp_option_check (int flag)
{
return CHECK_FLAG (bm->options, flag);
}
/* BGP flag manipulation. */
int
bgp_flag_set (struct bgp *bgp, int flag)
{
SET_FLAG (bgp->flags, flag);
return 0;
}
int
bgp_flag_unset (struct bgp *bgp, int flag)
{
UNSET_FLAG (bgp->flags, flag);
return 0;
}
int
bgp_flag_check (struct bgp *bgp, int flag)
{
return CHECK_FLAG (bgp->flags, flag);
}
/* Internal function to set BGP structure configureation flag. */
static void
bgp_config_set (struct bgp *bgp, int config)
{
SET_FLAG (bgp->config, config);
}
static void
bgp_config_unset (struct bgp *bgp, int config)
{
UNSET_FLAG (bgp->config, config);
}
static int
bgp_config_check (struct bgp *bgp, int config)
{
return CHECK_FLAG (bgp->config, config);
}
/* Set BGP router identifier. */
int
bgp_router_id_set (struct bgp *bgp, struct in_addr *id)
{
struct peer *peer;
struct listnode *node, *nnode;
if (bgp_config_check (bgp, <API key>)
&& IPV4_ADDR_SAME (&bgp->router_id, id))
return 0;
IPV4_ADDR_COPY (&bgp->router_id, id);
bgp_config_set (bgp, <API key>);
/* Set all peer's local identifier with this value. */
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
IPV4_ADDR_COPY (&peer->local_id, id);
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
}
return 0;
}
/* BGP's cluster-id control. */
int
bgp_cluster_id_set (struct bgp *bgp, struct in_addr *cluster_id)
{
struct peer *peer;
struct listnode *node, *nnode;
if (bgp_config_check (bgp, <API key>)
&& IPV4_ADDR_SAME (&bgp->cluster_id, cluster_id))
return 0;
IPV4_ADDR_COPY (&bgp->cluster_id, cluster_id);
bgp_config_set (bgp, <API key>);
/* Clear all IBGP peer. */
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer_sort (peer) != BGP_PEER_IBGP)
continue;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
}
return 0;
}
int
<API key> (struct bgp *bgp)
{
struct peer *peer;
struct listnode *node, *nnode;
if (! bgp_config_check (bgp, <API key>))
return 0;
bgp->cluster_id.s_addr = 0;
bgp_config_unset (bgp, <API key>);
/* Clear all IBGP peer. */
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer_sort (peer) != BGP_PEER_IBGP)
continue;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
}
return 0;
}
/* time_t value that is monotonicly increasing
* and uneffected by adjustments to system clock
*/
time_t bgp_clock (void)
{
struct timeval tv;
bane_gettime(BANE_CLK_MONOTONIC, &tv);
return tv.tv_sec;
}
/* BGP timer configuration. */
int
bgp_timers_set (struct bgp *bgp, u_int32_t keepalive, u_int32_t holdtime)
{
bgp->default_keepalive = (keepalive < holdtime / 3
? keepalive : holdtime / 3);
bgp->default_holdtime = holdtime;
return 0;
}
int
bgp_timers_unset (struct bgp *bgp)
{
bgp->default_keepalive = <API key>;
bgp->default_holdtime = <API key>;
return 0;
}
/* BGP confederation configuration. */
int
<API key> (struct bgp *bgp, as_t as)
{
struct peer *peer;
struct listnode *node, *nnode;
int already_confed;
if (as == 0)
return BGP_ERR_INVALID_AS;
/* Remember - were we doing confederation before? */
already_confed = bgp_config_check (bgp, <API key>);
bgp->confed_id = as;
bgp_config_set (bgp, <API key>);
/* If we were doing confederation already, this is just an external
AS change. Just Reset EBGP sessions, not CONFED sessions. If we
were not doing confederation before, reset all EBGP sessions. */
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
/* We're looking for peers who's AS is not local or part of our
confederation. */
if (already_confed)
{
if (peer_sort (peer) == BGP_PEER_EBGP)
{
peer->local_as = as;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
else
{
/* Not doign confederation before, so reset every non-local
session */
if (peer_sort (peer) != BGP_PEER_IBGP)
{
/* Reset the local_as to be our EBGP one */
if (peer_sort (peer) == BGP_PEER_EBGP)
peer->local_as = as;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
}
return 0;
}
int
<API key> (struct bgp *bgp)
{
struct peer *peer;
struct listnode *node, *nnode;
bgp->confed_id = 0;
bgp_config_unset (bgp, <API key>);
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
/* We're looking for peers who's AS is not local */
if (peer_sort (peer) != BGP_PEER_IBGP)
{
peer->local_as = bgp->as;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
return 0;
}
/* Is an AS part of the confed or not? */
int
<API key> (struct bgp *bgp, as_t as)
{
int i;
if (! bgp)
return 0;
for (i = 0; i < bgp->confed_peers_cnt; i++)
if (bgp->confed_peers[i] == as)
return 1;
return 0;
}
/* Add an AS to the confederation set. */
int
<API key> (struct bgp *bgp, as_t as)
{
struct peer *peer;
struct listnode *node, *nnode;
if (! bgp)
return BGP_ERR_INVALID_BGP;
if (bgp->as == as)
return BGP_ERR_INVALID_AS;
if (<API key> (bgp, as))
return -1;
if (bgp->confed_peers)
bgp->confed_peers = XREALLOC (<API key>,
bgp->confed_peers,
(bgp->confed_peers_cnt + 1) * sizeof (as_t));
else
bgp->confed_peers = XMALLOC (<API key>,
(bgp->confed_peers_cnt + 1) * sizeof (as_t));
bgp->confed_peers[bgp->confed_peers_cnt] = as;
bgp->confed_peers_cnt++;
if (bgp_config_check (bgp, <API key>))
{
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer->as == as)
{
peer->local_as = bgp->as;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
}
return 0;
}
/* Delete an AS from the confederation set. */
int
<API key> (struct bgp *bgp, as_t as)
{
int i;
int j;
struct peer *peer;
struct listnode *node, *nnode;
if (! bgp)
return -1;
if (! <API key> (bgp, as))
return -1;
for (i = 0; i < bgp->confed_peers_cnt; i++)
if (bgp->confed_peers[i] == as)
for(j = i + 1; j < bgp->confed_peers_cnt; j++)
bgp->confed_peers[j - 1] = bgp->confed_peers[j];
bgp->confed_peers_cnt
if (bgp->confed_peers_cnt == 0)
{
if (bgp->confed_peers)
XFREE (<API key>, bgp->confed_peers);
bgp->confed_peers = NULL;
}
else
bgp->confed_peers = XREALLOC (<API key>,
bgp->confed_peers,
bgp->confed_peers_cnt * sizeof (as_t));
/* Now reset any peer who's remote AS has just been removed from the
CONFED */
if (bgp_config_check (bgp, <API key>))
{
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer->as == as)
{
peer->local_as = bgp->confed_id;
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
}
return 0;
}
/* Local preference configuration. */
int
<API key> (struct bgp *bgp, u_int32_t local_pref)
{
if (! bgp)
return -1;
bgp->default_local_pref = local_pref;
return 0;
}
int
<API key> (struct bgp *bgp)
{
if (! bgp)
return -1;
bgp->default_local_pref = <API key>;
return 0;
}
/* If peer is RSERVER_CLIENT in at least one address family and is not member
of a peer_group for that family, return 1.
Used to check wether the peer is included in list bgp->rsclient. */
int
<API key> (struct peer *peer)
{
int i;
int j;
for (i=AFI_IP; i < AFI_MAX; i++)
for (j=SAFI_UNICAST; j < SAFI_MAX; j++)
if (CHECK_FLAG(peer->af_flags[i][j], <API key>)
&& ! peer->af_group[i][j])
return 1;
return 0;
}
/* Peer comparison function for sorting. */
static int
peer_cmp (struct peer *p1, struct peer *p2)
{
return sockunion_cmp (&p1->su, &p2->su);
}
int
peer_af_flag_check (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag)
{
return CHECK_FLAG (peer->af_flags[afi][safi], flag);
}
/* Reset all address family specific configuration. */
static void
peer_af_flag_reset (struct peer *peer, afi_t afi, safi_t safi)
{
int i;
struct bgp_filter *filter;
char orf_name[BUFSIZ];
filter = &peer->filter[afi][safi];
/* Clear neighbor filter and route-map */
for (i = FILTER_IN; i < FILTER_MAX; i++)
{
if (filter->dlist[i].name)
{
free (filter->dlist[i].name);
filter->dlist[i].name = NULL;
}
if (filter->plist[i].name)
{
free (filter->plist[i].name);
filter->plist[i].name = NULL;
}
if (filter->aslist[i].name)
{
free (filter->aslist[i].name);
filter->aslist[i].name = NULL;
}
}
for (i = RMAP_IN; i < RMAP_MAX; i++)
{
if (filter->map[i].name)
{
free (filter->map[i].name);
filter->map[i].name = NULL;
}
}
/* Clear unsuppress map. */
if (filter->usmap.name)
free (filter->usmap.name);
filter->usmap.name = NULL;
filter->usmap.map = NULL;
/* Clear neighbor's all address family flags. */
peer->af_flags[afi][safi] = 0;
/* Clear neighbor's all address family sflags. */
peer->af_sflags[afi][safi] = 0;
/* Clear neighbor's all address family capabilities. */
peer->af_cap[afi][safi] = 0;
/* Clear ORF info */
peer->orf_plist[afi][safi] = NULL;
sprintf (orf_name, "%s.%d.%d", peer->host, afi, safi);
<API key> (orf_name);
/* Set default neighbor send-community. */
if (! bgp_option_check (<API key>))
{
SET_FLAG (peer->af_flags[afi][safi], <API key>);
SET_FLAG (peer->af_flags[afi][safi], <API key>);
}
/* Clear neighbor <API key> */
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].name = NULL;
peer->default_rmap[afi][safi].map = NULL;
/* Clear neighbor maximum-prefix */
peer->pmax[afi][safi] = 0;
peer->pmax_threshold[afi][safi] = <API key>;
}
/* peer global config reset */
static void
<API key> (struct peer *peer)
{
peer->weight = 0;
peer->change_local_as = 0;
peer->ttl = (peer_sort (peer) == BGP_PEER_IBGP ? 255 : 1);
if (peer->update_source)
{
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
if (peer->update_if)
{
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
if (peer_sort (peer) == BGP_PEER_IBGP)
peer->v_routeadv = <API key>;
else
peer->v_routeadv = <API key>;
peer->flags = 0;
peer->config = 0;
peer->holdtime = 0;
peer->keepalive = 0;
peer->connect = 0;
peer->v_connect = <API key>;
}
/* Check peer's AS number and determin is this peer IBGP or EBGP */
int
peer_sort (struct peer *peer)
{
struct bgp *bgp;
bgp = peer->bgp;
/* Peer-group */
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->as)
return (bgp->as == peer->as ? BGP_PEER_IBGP : BGP_PEER_EBGP);
else
{
struct peer *peer1;
peer1 = listnode_head (peer->group->peer);
if (peer1)
return (peer1->local_as == peer1->as
? BGP_PEER_IBGP : BGP_PEER_EBGP);
}
return BGP_PEER_INTERNAL;
}
/* Normal peer */
if (bgp && CHECK_FLAG (bgp->config, <API key>))
{
if (peer->local_as == 0)
return BGP_PEER_INTERNAL;
if (peer->local_as == peer->as)
{
if (peer->local_as == bgp->confed_id)
return BGP_PEER_EBGP;
else
return BGP_PEER_IBGP;
}
if (<API key> (bgp, peer->as))
return BGP_PEER_CONFED;
return BGP_PEER_EBGP;
}
else
{
return (peer->local_as == 0
? BGP_PEER_INTERNAL : peer->local_as == peer->as
? BGP_PEER_IBGP : BGP_PEER_EBGP);
}
}
static void
peer_free (struct peer *peer)
{
assert (peer->status == Deleted);
bgp_unlock(peer->bgp);
/* this /ought/ to have been done already through bgp_stop earlier,
* but just to be sure..
*/
bgp_timer_set (peer);
BGP_READ_OFF (peer->t_read);
BGP_WRITE_OFF (peer->t_write);
BGP_EVENT_FLUSH (peer);
if (peer->desc)
XFREE (MTYPE_PEER_DESC, peer->desc);
/* Free allocated host character. */
if (peer->host)
XFREE (MTYPE_BGP_PEER_HOST, peer->host);
/* Update source configuration. */
if (peer->update_source)
sockunion_free (peer->update_source);
if (peer->update_if)
XFREE (<API key>, peer->update_if);
if (peer->clear_node_queue)
work_queue_free (peer->clear_node_queue);
bgp_sync_delete (peer);
memset (peer, 0, sizeof (struct peer));
XFREE (MTYPE_BGP_PEER, peer);
}
/* increase reference count on a struct peer */
struct peer *
peer_lock (struct peer *peer)
{
assert (peer && (peer->lock >= 0));
peer->lock++;
return peer;
}
/* decrease reference count on a struct peer
* struct peer is freed and NULL returned if last reference
*/
struct peer *
peer_unlock (struct peer *peer)
{
assert (peer && (peer->lock > 0));
peer->lock
if (peer->lock == 0)
{
#if 0
zlog_debug ("unlocked and freeing");
zlog_backtrace (LOG_DEBUG);
#endif
peer_free (peer);
return NULL;
}
#if 0
if (peer->lock == 1)
{
zlog_debug ("unlocked to 1");
zlog_backtrace (LOG_DEBUG);
}
#endif
return peer;
}
/* Allocate new peer object, implicitely locked. */
static struct peer *
peer_new (struct bgp *bgp)
{
afi_t afi;
safi_t safi;
struct peer *peer;
struct servent *sp;
/* bgp argument is absolutely required */
assert (bgp);
if (!bgp)
return NULL;
/* Allocate new peer. */
peer = XCALLOC (MTYPE_BGP_PEER, sizeof (struct peer));
/* Set default value. */
peer->fd = -1;
peer->v_start = <API key>;
peer->v_connect = <API key>;
peer->v_asorig = <API key>;
peer->status = Idle;
peer->ostatus = Idle;
peer->weight = 0;
peer->password = NULL;
peer->bgp = bgp;
peer = peer_lock (peer); /* initial reference */
bgp_lock (bgp);
/* Set default flags. */
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
if (! bgp_option_check (<API key>))
{
SET_FLAG (peer->af_flags[afi][safi], <API key>);
SET_FLAG (peer->af_flags[afi][safi], <API key>);
}
peer->orf_plist[afi][safi] = NULL;
}
SET_FLAG (peer->sflags, <API key>);
/* Create buffers. */
peer->ibuf = stream_new (BGP_MAX_PACKET_SIZE);
peer->obuf = stream_fifo_new ();
peer->work = stream_new (BGP_MAX_PACKET_SIZE);
bgp_sync_init (peer);
/* Get service port number. */
sp = getservbyname ("bgp", "tcp");
peer->port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs (sp->s_port);
return peer;
}
/* Create new BGP peer. */
static struct peer *
peer_create (union sockunion *su, struct bgp *bgp, as_t local_as,
as_t remote_as, afi_t afi, safi_t safi)
{
int active;
struct peer *peer;
char buf[SU_ADDRSTRLEN];
peer = peer_new (bgp);
peer->su = *su;
peer->local_as = local_as;
peer->as = remote_as;
peer->local_id = bgp->router_id;
peer->v_holdtime = bgp->default_holdtime;
peer->v_keepalive = bgp->default_keepalive;
if (peer_sort (peer) == BGP_PEER_IBGP)
peer->v_routeadv = <API key>;
else
peer->v_routeadv = <API key>;
peer = peer_lock (peer); /* bgp peer list reference */
listnode_add_sort (bgp->peer, peer);
active = peer_active (peer);
if (afi && safi)
peer->afc[afi][safi] = 1;
/* Last read and reset time set */
peer->readtime = peer->resettime = bgp_clock ();
/* Default TTL set. */
peer->ttl = (peer_sort (peer) == BGP_PEER_IBGP ? 255 : 1);
/* Make peer's address string. */
sockunion2str (su, buf, SU_ADDRSTRLEN);
peer->host = XSTRDUP (MTYPE_BGP_PEER_HOST, buf);
/* Set up peer's events and timers. */
if (! active && peer_active (peer))
bgp_timer_set (peer);
return peer;
}
/* Make accept BGP peer. Called from bgp_accept (). */
struct peer *
peer_create_accept (struct bgp *bgp)
{
struct peer *peer;
peer = peer_new (bgp);
peer = peer_lock (peer); /* bgp peer list reference */
listnode_add_sort (bgp->peer, peer);
return peer;
}
/* Change peer's AS number. */
static void
peer_as_change (struct peer *peer, as_t as)
{
int type;
/* Stop peer. */
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
type = peer_sort (peer);
peer->as = as;
if (bgp_config_check (peer->bgp, <API key>)
&& ! <API key> (peer->bgp, as)
&& peer->bgp->as != as)
peer->local_as = peer->bgp->confed_id;
else
peer->local_as = peer->bgp->as;
/* <API key> reset */
if (peer_sort (peer) == BGP_PEER_IBGP)
peer->v_routeadv = <API key>;
else
peer->v_routeadv = <API key>;
/* TTL reset */
if (peer_sort (peer) == BGP_PEER_IBGP)
peer->ttl = 255;
else if (type == BGP_PEER_IBGP)
peer->ttl = 1;
/* reflector-client reset */
if (peer_sort (peer) != BGP_PEER_IBGP)
{
UNSET_FLAG (peer->af_flags[AFI_IP][SAFI_UNICAST],
<API key>);
UNSET_FLAG (peer->af_flags[AFI_IP][SAFI_MULTICAST],
<API key>);
UNSET_FLAG (peer->af_flags[AFI_IP][SAFI_MPLS_VPN],
<API key>);
UNSET_FLAG (peer->af_flags[AFI_IP6][SAFI_UNICAST],
<API key>);
UNSET_FLAG (peer->af_flags[AFI_IP6][SAFI_MULTICAST],
<API key>);
}
/* local-as reset */
if (peer_sort (peer) != BGP_PEER_EBGP)
{
peer->change_local_as = 0;
UNSET_FLAG (peer->flags, <API key>);
}
}
/* If peer does not exist, create new one. If peer already exists,
set AS number to the peer. */
int
peer_remote_as (struct bgp *bgp, union sockunion *su, as_t *as,
afi_t afi, safi_t safi)
{
struct peer *peer;
as_t local_as;
peer = peer_lookup (bgp, su);
if (peer)
{
/* When this peer is a member of peer-group. */
if (peer->group)
{
if (peer->group->conf->as)
{
/* Return peer group's AS number. */
*as = peer->group->conf->as;
return <API key>;
}
if (peer_sort (peer->group->conf) == BGP_PEER_IBGP)
{
if (bgp->as != *as)
{
*as = peer->as;
return <API key>;
}
}
else
{
if (bgp->as == *as)
{
*as = peer->as;
return <API key>;
}
}
}
/* Existing peer's AS number change. */
if (peer->as != *as)
peer_as_change (peer, *as);
}
else
{
/* If the peer is not part of our confederation, and its not an
iBGP peer then spoof the source AS */
if (bgp_config_check (bgp, <API key>)
&& ! <API key> (bgp, *as)
&& bgp->as != *as)
local_as = bgp->confed_id;
else
local_as = bgp->as;
/* If this is IPv4 unicast configuration and "no bgp default
ipv4-unicast" is specified. */
if (bgp_flag_check (bgp, <API key>)
&& afi == AFI_IP && safi == SAFI_UNICAST)
peer = peer_create (su, bgp, local_as, *as, 0, 0);
else
peer = peer_create (su, bgp, local_as, *as, afi, safi);
}
return 0;
}
/* Activate the peer or peer group for specified AFI and SAFI. */
int
peer_activate (struct peer *peer, afi_t afi, safi_t safi)
{
int active;
if (peer->afc[afi][safi])
return 0;
/* Activate the address family configuration. */
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
peer->afc[afi][safi] = 1;
else
{
active = peer_active (peer);
peer->afc[afi][safi] = 1;
if (! active && peer_active (peer))
bgp_timer_set (peer);
else
{
if (peer->status == Established)
{
if (CHECK_FLAG (peer->cap, <API key>))
{
peer->afc_adv[afi][safi] = 1;
bgp_capability_send (peer, afi, safi,
CAPABILITY_CODE_MP,
<API key>);
if (peer->afc_recv[afi][safi])
{
peer->afc_nego[afi][safi] = 1;
bgp_announce_route (peer, afi, safi);
}
}
else
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
}
}
}
return 0;
}
int
peer_deactivate (struct peer *peer, afi_t afi, safi_t safi)
{
struct peer_group *group;
struct peer *peer1;
struct listnode *node, *nnode;
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer1))
{
if (peer1->af_group[afi][safi])
return <API key>;
}
}
else
{
if (peer->af_group[afi][safi])
return <API key>;
}
if (! peer->afc[afi][safi])
return 0;
/* De-activate the address family configuration. */
peer->afc[afi][safi] = 0;
peer_af_flag_reset (peer, afi, safi);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
if (CHECK_FLAG (peer->cap, <API key>))
{
peer->afc_adv[afi][safi] = 0;
peer->afc_nego[afi][safi] = 0;
if (peer_active_nego (peer))
{
bgp_capability_send (peer, afi, safi,
CAPABILITY_CODE_MP,
<API key>);
bgp_clear_route (peer, afi, safi, <API key>);
peer->pcount[afi][safi] = 0;
}
else
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
}
else
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
}
}
return 0;
}
static void
peer_nsf_stop (struct peer *peer)
{
afi_t afi;
safi_t safi;
UNSET_FLAG (peer->sflags, <API key>);
UNSET_FLAG (peer->sflags, <API key>);
for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
for (safi = SAFI_UNICAST ; safi < SAFI_RESERVED_3 ; safi++)
peer->nsf[afi][safi] = 0;
if (peer->t_gr_restart)
{
BGP_TIMER_OFF (peer->t_gr_restart);
if (BGP_DEBUG (events, EVENTS))
zlog_debug ("%s graceful restart timer stopped", peer->host);
}
if (peer->t_gr_stale)
{
BGP_TIMER_OFF (peer->t_gr_stale);
if (BGP_DEBUG (events, EVENTS))
zlog_debug ("%s graceful restart stalepath timer stopped", peer->host);
}
bgp_clear_route_all (peer);
}
/* Delete peer from confguration.
*
* The peer is moved to a dead-end "Deleted" neighbour-state, to allow
* it to "cool off" and refcounts to hit 0, at which state it is freed.
*
* This function /should/ take care to be idempotent, to guard against
* it being called multiple times through stray events that come in
* that happen to result in this function being called again. That
* said, getting here for a "Deleted" peer is a bug in the neighbour
* FSM.
*/
int
peer_delete (struct peer *peer)
{
int i;
afi_t afi;
safi_t safi;
struct bgp *bgp;
struct bgp_filter *filter;
struct listnode *pn;
assert (peer->status != Deleted);
bgp = peer->bgp;
if (CHECK_FLAG (peer->sflags, <API key>))
peer_nsf_stop (peer);
/* If this peer belongs to peer group, clear up the
relationship. */
if (peer->group)
{
if ((pn = listnode_lookup (peer->group->peer, peer)))
{
peer = peer_unlock (peer); /* group->peer list reference */
list_delete_node (peer->group->peer, pn);
}
peer->group = NULL;
}
/* Withdraw all information from routing table. We can not use
* BGP_EVENT_ADD (peer, BGP_Stop) at here. Because the event is
* executed after peer structure is deleted.
*/
peer->last_reset = <API key>;
bgp_stop (peer);
<API key> (peer, Deleted);
/* Password configuration */
if (peer->password)
{
XFREE (MTYPE_PEER_PASSWORD, peer->password);
peer->password = NULL;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
bgp_md5_set (peer);
}
bgp_timer_set (peer); /* stops all timers for Deleted */
/* Delete from all peer list. */
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)
&& (pn = listnode_lookup (bgp->peer, peer)))
{
peer_unlock (peer); /* bgp peer list reference */
list_delete_node (bgp->peer, pn);
}
if (<API key> (peer)
&& (pn = listnode_lookup (bgp->rsclient, peer)))
{
peer_unlock (peer); /* rsclient list reference */
list_delete_node (bgp->rsclient, pn);
/* Clear our own rsclient ribs. */
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
if (CHECK_FLAG(peer->af_flags[afi][safi],
<API key>))
bgp_clear_route (peer, afi, safi, <API key>);
}
/* Free RIB for any family in which peer is RSERVER_CLIENT, and is not
member of a peer_group. */
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
if (peer->rib[afi][safi] && ! peer->af_group[afi][safi])
bgp_table_finish (&peer->rib[afi][safi]);
/* Buffers. */
if (peer->ibuf)
stream_free (peer->ibuf);
if (peer->obuf)
stream_fifo_free (peer->obuf);
if (peer->work)
stream_free (peer->work);
peer->obuf = NULL;
peer->work = peer->ibuf = NULL;
/* Local and remote addresses. */
if (peer->su_local)
sockunion_free (peer->su_local);
if (peer->su_remote)
sockunion_free (peer->su_remote);
peer->su_local = peer->su_remote = NULL;
/* Free filter related memory. */
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &peer->filter[afi][safi];
for (i = FILTER_IN; i < FILTER_MAX; i++)
{
if (filter->dlist[i].name)
free (filter->dlist[i].name);
if (filter->plist[i].name)
free (filter->plist[i].name);
if (filter->aslist[i].name)
free (filter->aslist[i].name);
filter->dlist[i].name = NULL;
filter->plist[i].name = NULL;
filter->aslist[i].name = NULL;
}
for (i = RMAP_IN; i < RMAP_MAX; i++)
{
if (filter->map[i].name)
free (filter->map[i].name);
filter->map[i].name = NULL;
}
if (filter->usmap.name)
free (filter->usmap.name);
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
filter->usmap.name = NULL;
peer->default_rmap[afi][safi].name = NULL;
}
peer_unlock (peer); /* initial reference */
return 0;
}
static int
peer_group_cmp (struct peer_group *g1, struct peer_group *g2)
{
return strcmp (g1->name, g2->name);
}
/* If peer is configured at least one address family return 1. */
static int
peer_group_active (struct peer *peer)
{
if (peer->af_group[AFI_IP][SAFI_UNICAST]
|| peer->af_group[AFI_IP][SAFI_MULTICAST]
|| peer->af_group[AFI_IP][SAFI_MPLS_VPN]
|| peer->af_group[AFI_IP6][SAFI_UNICAST]
|| peer->af_group[AFI_IP6][SAFI_MULTICAST])
return 1;
return 0;
}
/* Peer group cofiguration. */
static struct peer_group *
peer_group_new (void)
{
return (struct peer_group *) XCALLOC (MTYPE_PEER_GROUP,
sizeof (struct peer_group));
}
static void
peer_group_free (struct peer_group *group)
{
XFREE (MTYPE_PEER_GROUP, group);
}
struct peer_group *
peer_group_lookup (struct bgp *bgp, const char *name)
{
struct peer_group *group;
struct listnode *node, *nnode;
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
if (strcmp (group->name, name) == 0)
return group;
}
return NULL;
}
struct peer_group *
peer_group_get (struct bgp *bgp, const char *name)
{
struct peer_group *group;
group = peer_group_lookup (bgp, name);
if (group)
return group;
group = peer_group_new ();
group->bgp = bgp;
group->name = strdup (name);
group->peer = list_new ();
group->conf = peer_new (bgp);
if (! bgp_flag_check (bgp, <API key>))
group->conf->afc[AFI_IP][SAFI_UNICAST] = 1;
group->conf->host = XSTRDUP (MTYPE_BGP_PEER_HOST, name);
group->conf->group = group;
group->conf->as = 0;
group->conf->ttl = 1;
group->conf->gtsm_hops = 0;
group->conf->v_routeadv = <API key>;
UNSET_FLAG (group->conf->config, PEER_CONFIG_TIMER);
UNSET_FLAG (group->conf->config, PEER_CONFIG_CONNECT);
group->conf->keepalive = 0;
group->conf->holdtime = 0;
group->conf->connect = 0;
SET_FLAG (group->conf->sflags, PEER_STATUS_GROUP);
listnode_add_sort (bgp->group, group);
return 0;
}
static void
<API key> (struct peer_group *group, struct peer *peer,
afi_t afi, safi_t safi)
{
int in = FILTER_IN;
int out = FILTER_OUT;
struct peer *conf;
struct bgp_filter *pfilter;
struct bgp_filter *gfilter;
conf = group->conf;
pfilter = &peer->filter[afi][safi];
gfilter = &conf->filter[afi][safi];
/* remote-as */
if (conf->as)
peer->as = conf->as;
/* remote-as */
if (conf->change_local_as)
peer->change_local_as = conf->change_local_as;
/* TTL */
peer->ttl = conf->ttl;
/* GTSM hops */
peer->gtsm_hops = conf->gtsm_hops;
/* Weight */
peer->weight = conf->weight;
/* peer flags apply */
peer->flags = conf->flags;
/* peer af_flags apply */
peer->af_flags[afi][safi] = conf->af_flags[afi][safi];
/* peer config apply */
peer->config = conf->config;
/* peer timers apply */
peer->holdtime = conf->holdtime;
peer->keepalive = conf->keepalive;
peer->connect = conf->connect;
if (CHECK_FLAG (conf->config, PEER_CONFIG_CONNECT))
peer->v_connect = conf->connect;
else
peer->v_connect = <API key>;
/* <API key> reset */
if (peer_sort (peer) == BGP_PEER_IBGP)
peer->v_routeadv = <API key>;
else
peer->v_routeadv = <API key>;
/* password apply */
if (peer->password)
XFREE (MTYPE_PEER_PASSWORD, peer->password);
if (conf->password)
peer->password = XSTRDUP (MTYPE_PEER_PASSWORD, conf->password);
else
peer->password = NULL;
bgp_md5_set (peer);
/* maximum-prefix */
peer->pmax[afi][safi] = conf->pmax[afi][safi];
peer->pmax_threshold[afi][safi] = conf->pmax_threshold[afi][safi];
peer->pmax_restart[afi][safi] = conf->pmax_restart[afi][safi];
/* allowas-in */
peer->allowas_in[afi][safi] = conf->allowas_in[afi][safi];
/* route-server-client */
if (CHECK_FLAG(conf->af_flags[afi][safi], <API key>))
{
/* Make peer's RIB point to group's RIB. */
peer->rib[afi][safi] = group->conf->rib[afi][safi];
/* Import policy. */
if (pfilter->map[RMAP_IMPORT].name)
free (pfilter->map[RMAP_IMPORT].name);
if (gfilter->map[RMAP_IMPORT].name)
{
pfilter->map[RMAP_IMPORT].name = strdup (gfilter->map[RMAP_IMPORT].name);
pfilter->map[RMAP_IMPORT].map = gfilter->map[RMAP_IMPORT].map;
}
else
{
pfilter->map[RMAP_IMPORT].name = NULL;
pfilter->map[RMAP_IMPORT].map = NULL;
}
/* Export policy. */
if (gfilter->map[RMAP_EXPORT].name && ! pfilter->map[RMAP_EXPORT].name)
{
pfilter->map[RMAP_EXPORT].name = strdup (gfilter->map[RMAP_EXPORT].name);
pfilter->map[RMAP_EXPORT].map = gfilter->map[RMAP_EXPORT].map;
}
}
/* default-originate route-map */
if (conf->default_rmap[afi][safi].name)
{
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].name = strdup (conf->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].map = conf->default_rmap[afi][safi].map;
}
/* update-source apply */
if (conf->update_source)
{
if (peer->update_source)
sockunion_free (peer->update_source);
if (peer->update_if)
{
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
peer->update_source = sockunion_dup (conf->update_source);
}
else if (conf->update_if)
{
if (peer->update_if)
XFREE (<API key>, peer->update_if);
if (peer->update_source)
{
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
peer->update_if = XSTRDUP (<API key>, conf->update_if);
}
/* inbound filter apply */
if (gfilter->dlist[in].name && ! pfilter->dlist[in].name)
{
if (pfilter->dlist[in].name)
free (pfilter->dlist[in].name);
pfilter->dlist[in].name = strdup (gfilter->dlist[in].name);
pfilter->dlist[in].alist = gfilter->dlist[in].alist;
}
if (gfilter->plist[in].name && ! pfilter->plist[in].name)
{
if (pfilter->plist[in].name)
free (pfilter->plist[in].name);
pfilter->plist[in].name = strdup (gfilter->plist[in].name);
pfilter->plist[in].plist = gfilter->plist[in].plist;
}
if (gfilter->aslist[in].name && ! pfilter->aslist[in].name)
{
if (pfilter->aslist[in].name)
free (pfilter->aslist[in].name);
pfilter->aslist[in].name = strdup (gfilter->aslist[in].name);
pfilter->aslist[in].aslist = gfilter->aslist[in].aslist;
}
if (gfilter->map[RMAP_IN].name && ! pfilter->map[RMAP_IN].name)
{
if (pfilter->map[RMAP_IN].name)
free (pfilter->map[RMAP_IN].name);
pfilter->map[RMAP_IN].name = strdup (gfilter->map[RMAP_IN].name);
pfilter->map[RMAP_IN].map = gfilter->map[RMAP_IN].map;
}
/* outbound filter apply */
if (gfilter->dlist[out].name)
{
if (pfilter->dlist[out].name)
free (pfilter->dlist[out].name);
pfilter->dlist[out].name = strdup (gfilter->dlist[out].name);
pfilter->dlist[out].alist = gfilter->dlist[out].alist;
}
else
{
if (pfilter->dlist[out].name)
free (pfilter->dlist[out].name);
pfilter->dlist[out].name = NULL;
pfilter->dlist[out].alist = NULL;
}
if (gfilter->plist[out].name)
{
if (pfilter->plist[out].name)
free (pfilter->plist[out].name);
pfilter->plist[out].name = strdup (gfilter->plist[out].name);
pfilter->plist[out].plist = gfilter->plist[out].plist;
}
else
{
if (pfilter->plist[out].name)
free (pfilter->plist[out].name);
pfilter->plist[out].name = NULL;
pfilter->plist[out].plist = NULL;
}
if (gfilter->aslist[out].name)
{
if (pfilter->aslist[out].name)
free (pfilter->aslist[out].name);
pfilter->aslist[out].name = strdup (gfilter->aslist[out].name);
pfilter->aslist[out].aslist = gfilter->aslist[out].aslist;
}
else
{
if (pfilter->aslist[out].name)
free (pfilter->aslist[out].name);
pfilter->aslist[out].name = NULL;
pfilter->aslist[out].aslist = NULL;
}
if (gfilter->map[RMAP_OUT].name)
{
if (pfilter->map[RMAP_OUT].name)
free (pfilter->map[RMAP_OUT].name);
pfilter->map[RMAP_OUT].name = strdup (gfilter->map[RMAP_OUT].name);
pfilter->map[RMAP_OUT].map = gfilter->map[RMAP_OUT].map;
}
else
{
if (pfilter->map[RMAP_OUT].name)
free (pfilter->map[RMAP_OUT].name);
pfilter->map[RMAP_OUT].name = NULL;
pfilter->map[RMAP_OUT].map = NULL;
}
/* RS-client's import/export route-maps. */
if (gfilter->map[RMAP_IMPORT].name)
{
if (pfilter->map[RMAP_IMPORT].name)
free (pfilter->map[RMAP_IMPORT].name);
pfilter->map[RMAP_IMPORT].name = strdup (gfilter->map[RMAP_IMPORT].name);
pfilter->map[RMAP_IMPORT].map = gfilter->map[RMAP_IMPORT].map;
}
else
{
if (pfilter->map[RMAP_IMPORT].name)
free (pfilter->map[RMAP_IMPORT].name);
pfilter->map[RMAP_IMPORT].name = NULL;
pfilter->map[RMAP_IMPORT].map = NULL;
}
if (gfilter->map[RMAP_EXPORT].name && ! pfilter->map[RMAP_EXPORT].name)
{
if (pfilter->map[RMAP_EXPORT].name)
free (pfilter->map[RMAP_EXPORT].name);
pfilter->map[RMAP_EXPORT].name = strdup (gfilter->map[RMAP_EXPORT].name);
pfilter->map[RMAP_EXPORT].map = gfilter->map[RMAP_EXPORT].map;
}
if (gfilter->usmap.name)
{
if (pfilter->usmap.name)
free (pfilter->usmap.name);
pfilter->usmap.name = strdup (gfilter->usmap.name);
pfilter->usmap.map = gfilter->usmap.map;
}
else
{
if (pfilter->usmap.name)
free (pfilter->usmap.name);
pfilter->usmap.name = NULL;
pfilter->usmap.map = NULL;
}
}
/* Peer group's remote AS configuration. */
int
<API key> (struct bgp *bgp, const char *group_name, as_t *as)
{
struct peer_group *group;
struct peer *peer;
struct listnode *node, *nnode;
group = peer_group_lookup (bgp, group_name);
if (! group)
return -1;
if (group->conf->as == *as)
return 0;
/* When we setup peer-group AS number all peer group member's AS
number must be updated to same number. */
peer_as_change (group->conf, *as);
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer->as != *as)
peer_as_change (peer, *as);
}
return 0;
}
int
peer_group_delete (struct peer_group *group)
{
struct bgp *bgp;
struct peer *peer;
struct listnode *node, *nnode;
bgp = group->bgp;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
peer->group = NULL;
peer_delete (peer);
}
list_delete (group->peer);
free (group->name);
group->name = NULL;
group->conf->group = NULL;
peer_delete (group->conf);
/* Delete from all peer_group list. */
listnode_delete (bgp->group, group);
peer_group_free (group);
return 0;
}
int
<API key> (struct peer_group *group)
{
struct peer *peer;
struct listnode *node, *nnode;
if (! group->conf->as)
return 0;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
peer->group = NULL;
peer_delete (peer);
}
<API key> (group->peer);
group->conf->as = 0;
return 0;
}
/* Bind specified peer to peer group. */
int
peer_group_bind (struct bgp *bgp, union sockunion *su,
struct peer_group *group, afi_t afi, safi_t safi, as_t *as)
{
struct peer *peer;
int first_member = 0;
/* Check peer group's address family. */
if (! group->conf->afc[afi][safi])
return <API key>;
/* Lookup the peer. */
peer = peer_lookup (bgp, su);
/* Create a new peer. */
if (! peer)
{
if (! group->conf->as)
return <API key>;
peer = peer_create (su, bgp, bgp->as, group->conf->as, afi, safi);
peer->group = group;
peer->af_group[afi][safi] = 1;
peer = peer_lock (peer); /* group->peer list reference */
listnode_add (group->peer, peer);
<API key> (group, peer, afi, safi);
return 0;
}
/* When the peer already belongs to peer group, check the consistency. */
if (peer->af_group[afi][safi])
{
if (strcmp (peer->group->name, group->name) != 0)
return <API key>;
return 0;
}
/* Check current peer group configuration. */
if (peer_group_active (peer)
&& strcmp (peer->group->name, group->name) != 0)
return <API key>;
if (! group->conf->as)
{
if (peer_sort (group->conf) != BGP_PEER_INTERNAL
&& peer_sort (group->conf) != peer_sort (peer))
{
if (as)
*as = peer->as;
return <API key>;
}
if (peer_sort (group->conf) == BGP_PEER_INTERNAL)
first_member = 1;
}
peer->af_group[afi][safi] = 1;
peer->afc[afi][safi] = 1;
if (! peer->group)
{
peer->group = group;
peer = peer_lock (peer); /* group->peer list reference */
listnode_add (group->peer, peer);
}
else
assert (group && peer->group == group);
if (first_member)
{
/* <API key> reset */
if (peer_sort (group->conf) == BGP_PEER_IBGP)
group->conf->v_routeadv = <API key>;
else
group->conf->v_routeadv = <API key>;
/* ebgp-multihop reset */
if (peer_sort (group->conf) == BGP_PEER_IBGP)
group->conf->ttl = 255;
/* local-as reset */
if (peer_sort (group->conf) != BGP_PEER_EBGP)
{
group->conf->change_local_as = 0;
UNSET_FLAG (peer->flags, <API key>);
}
}
if (CHECK_FLAG(peer->af_flags[afi][safi], <API key>))
{
struct listnode *pn;
/* If it's not configured as RSERVER_CLIENT in any other address
family, without being member of a peer_group, remove it from
list bgp->rsclient.*/
if (! <API key> (peer)
&& (pn = listnode_lookup (bgp->rsclient, peer)))
{
peer_unlock (peer); /* peer rsclient reference */
list_delete_node (bgp->rsclient, pn);
/* Clear our own rsclient rib for this afi/safi. */
bgp_clear_route (peer, afi, safi, <API key>);
}
bgp_table_finish (&peer->rib[afi][safi]);
/* Import policy. */
if (peer->filter[afi][safi].map[RMAP_IMPORT].name)
{
free (peer->filter[afi][safi].map[RMAP_IMPORT].name);
peer->filter[afi][safi].map[RMAP_IMPORT].name = NULL;
peer->filter[afi][safi].map[RMAP_IMPORT].map = NULL;
}
/* Export policy. */
if (! CHECK_FLAG(group->conf->af_flags[afi][safi], <API key>)
&& peer->filter[afi][safi].map[RMAP_EXPORT].name)
{
free (peer->filter[afi][safi].map[RMAP_EXPORT].name);
peer->filter[afi][safi].map[RMAP_EXPORT].name = NULL;
peer->filter[afi][safi].map[RMAP_EXPORT].map = NULL;
}
}
<API key> (group, peer, afi, safi);
if (peer->status == Established)
{
peer->last_reset = PEER_DOWN_RMAP_BIND;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
int
peer_group_unbind (struct bgp *bgp, struct peer *peer,
struct peer_group *group, afi_t afi, safi_t safi)
{
if (! peer->af_group[afi][safi])
return 0;
if (group != peer->group)
return <API key>;
peer->af_group[afi][safi] = 0;
peer->afc[afi][safi] = 0;
peer_af_flag_reset (peer, afi, safi);
if (peer->rib[afi][safi])
peer->rib[afi][safi] = NULL;
if (! peer_group_active (peer))
{
assert (listnode_lookup (group->peer, peer));
peer_unlock (peer); /* peer group list reference */
listnode_delete (group->peer, peer);
peer->group = NULL;
if (group->conf->as)
{
peer_delete (peer);
return 0;
}
<API key> (peer);
}
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
/* BGP instance creation by `router bgp' commands. */
static struct bgp *
bgp_create (as_t *as, const char *name)
{
struct bgp *bgp;
afi_t afi;
safi_t safi;
if ( (bgp = XCALLOC (MTYPE_BGP, sizeof (struct bgp))) == NULL)
return NULL;
bgp_lock (bgp);
bgp->peer_self = peer_new (bgp);
bgp->peer_self->host = XSTRDUP (MTYPE_BGP_PEER_HOST, "Static announcement");
bgp->peer = list_new ();
bgp->peer->cmp = (int (*)(void *, void *)) peer_cmp;
bgp->group = list_new ();
bgp->group->cmp = (int (*)(void *, void *)) peer_group_cmp;
bgp->rsclient = list_new ();
bgp->rsclient->cmp = (int (*)(void*, void*)) peer_cmp;
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
bgp->route[afi][safi] = bgp_table_init (afi, safi);
bgp->aggregate[afi][safi] = bgp_table_init (afi, safi);
bgp->rib[afi][safi] = bgp_table_init (afi, safi);
bgp->maxpaths[afi][safi].maxpaths_ebgp = <API key>;
bgp->maxpaths[afi][safi].maxpaths_ibgp = <API key>;
}
bgp->default_local_pref = <API key>;
bgp->default_holdtime = <API key>;
bgp->default_keepalive = <API key>;
bgp->restart_time = <API key>;
bgp->stalepath_time = <API key>;
bgp->as = *as;
if (name)
bgp->name = strdup (name);
return bgp;
}
/* Return first entry of BGP. */
struct bgp *
bgp_get_default (void)
{
if (bm->bgp->head)
return (listgetdata (listhead (bm->bgp)));
return NULL;
}
/* Lookup BGP entry. */
struct bgp *
bgp_lookup (as_t as, const char *name)
{
struct bgp *bgp;
struct listnode *node, *nnode;
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
if (bgp->as == as
&& ((bgp->name == NULL && name == NULL)
|| (bgp->name && name && strcmp (bgp->name, name) == 0)))
return bgp;
return NULL;
}
/* Lookup BGP structure by view name. */
struct bgp *
bgp_lookup_by_name (const char *name)
{
struct bgp *bgp;
struct listnode *node, *nnode;
for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
if ((bgp->name == NULL && name == NULL)
|| (bgp->name && name && strcmp (bgp->name, name) == 0))
return bgp;
return NULL;
}
/* Called from VTY commands. */
int
bgp_get (struct bgp **bgp_val, as_t *as, const char *name)
{
struct bgp *bgp;
/* Multiple instance check. */
if (bgp_option_check (<API key>))
{
if (name)
bgp = bgp_lookup_by_name (name);
else
bgp = bgp_get_default ();
/* Already exists. */
if (bgp)
{
if (bgp->as != *as)
{
*as = bgp->as;
return <API key>;
}
*bgp_val = bgp;
return 0;
}
}
else
{
/* BGP instance name can not be specified for single instance. */
if (name)
return <API key>;
/* Get default BGP structure if exists. */
bgp = bgp_get_default ();
if (bgp)
{
if (bgp->as != *as)
{
*as = bgp->as;
return BGP_ERR_AS_MISMATCH;
}
*bgp_val = bgp;
return 0;
}
}
bgp = bgp_create (as, name);
bgp_router_id_set(bgp, &router_id_kroute);
*bgp_val = bgp;
/* Create BGP server socket, if first instance. */
if (list_isempty(bm->bgp))
{
if (bgp_socket (bm->port, bm->address) < 0)
return <API key>;
}
listnode_add (bm->bgp, bgp);
return 0;
}
/* Delete BGP instance. */
int
bgp_delete (struct bgp *bgp)
{
struct peer *peer;
struct peer_group *group;
struct listnode *node;
struct listnode *next;
afi_t afi;
int i;
/* Delete static route. */
bgp_static_delete (bgp);
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (i = 0; i < KROUTE_ROUTE_MAX; i++)
if (i != KROUTE_ROUTE_BGP)
<API key> (bgp, afi, i);
for (ALL_LIST_ELEMENTS (bgp->peer, node, next, peer))
peer_delete (peer);
for (ALL_LIST_ELEMENTS (bgp->group, node, next, group))
peer_group_delete (group);
assert (listcount (bgp->rsclient) == 0);
if (bgp->peer_self) {
peer_delete(bgp->peer_self);
bgp->peer_self = NULL;
}
/* Remove visibility via the master list - there may however still be
* routes to be processed still referencing the struct bgp.
*/
listnode_delete (bm->bgp, bgp);
if (list_isempty(bm->bgp))
bgp_close ();
bgp_unlock(bgp); /* initial reference */
return 0;
}
static void bgp_free (struct bgp *);
void
bgp_lock (struct bgp *bgp)
{
++bgp->lock;
}
void
bgp_unlock(struct bgp *bgp)
{
assert(bgp->lock > 0);
if (--bgp->lock == 0)
bgp_free (bgp);
}
static void
bgp_free (struct bgp *bgp)
{
afi_t afi;
safi_t safi;
list_delete (bgp->group);
list_delete (bgp->peer);
list_delete (bgp->rsclient);
if (bgp->name)
free (bgp->name);
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
if (bgp->route[afi][safi])
bgp_table_finish (&bgp->route[afi][safi]);
if (bgp->aggregate[afi][safi])
bgp_table_finish (&bgp->aggregate[afi][safi]) ;
if (bgp->rib[afi][safi])
bgp_table_finish (&bgp->rib[afi][safi]);
}
XFREE (MTYPE_BGP, bgp);
}
struct peer *
peer_lookup (struct bgp *bgp, union sockunion *su)
{
struct peer *peer;
struct listnode *node, *nnode;
if (bgp != NULL)
{
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
if (sockunion_same (&peer->su, su)
&& ! CHECK_FLAG (peer->sflags, <API key>))
return peer;
}
else if (bm->bgp != NULL)
{
struct listnode *bgpnode, *nbgpnode;
for (ALL_LIST_ELEMENTS (bm->bgp, bgpnode, nbgpnode, bgp))
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
if (sockunion_same (&peer->su, su)
&& ! CHECK_FLAG (peer->sflags, <API key>))
return peer;
}
return NULL;
}
struct peer *
<API key> (union sockunion *su, as_t remote_as,
struct in_addr *remote_id, int *as)
{
struct peer *peer;
struct listnode *node;
struct listnode *bgpnode;
struct bgp *bgp;
if (! bm->bgp)
return NULL;
for (<API key> (bm->bgp, bgpnode, bgp))
{
for (<API key> (bgp->peer, node, peer))
{
if (sockunion_same (&peer->su, su)
&& ! CHECK_FLAG (peer->sflags, <API key>))
{
if (peer->as == remote_as
&& peer->remote_id.s_addr == remote_id->s_addr)
return peer;
if (peer->as == remote_as)
*as = 1;
}
}
for (<API key> (bgp->peer, node, peer))
{
if (sockunion_same (&peer->su, su)
&& ! CHECK_FLAG (peer->sflags, <API key>))
{
if (peer->as == remote_as
&& peer->remote_id.s_addr == 0)
return peer;
if (peer->as == remote_as)
*as = 1;
}
}
}
return NULL;
}
/* If peer is configured at least one address family return 1. */
int
peer_active (struct peer *peer)
{
if (peer->afc[AFI_IP][SAFI_UNICAST]
|| peer->afc[AFI_IP][SAFI_MULTICAST]
|| peer->afc[AFI_IP][SAFI_MPLS_VPN]
|| peer->afc[AFI_IP6][SAFI_UNICAST]
|| peer->afc[AFI_IP6][SAFI_MULTICAST])
return 1;
return 0;
}
/* If peer is negotiated at least one address family return 1. */
int
peer_active_nego (struct peer *peer)
{
if (peer->afc_nego[AFI_IP][SAFI_UNICAST]
|| peer->afc_nego[AFI_IP][SAFI_MULTICAST]
|| peer->afc_nego[AFI_IP][SAFI_MPLS_VPN]
|| peer->afc_nego[AFI_IP6][SAFI_UNICAST]
|| peer->afc_nego[AFI_IP6][SAFI_MULTICAST])
return 1;
return 0;
}
/* <API key>. */
enum peer_change_type
{
peer_change_none,
peer_change_reset,
<API key>,
<API key>,
};
static void
peer_change_action (struct peer *peer, afi_t afi, safi_t safi,
enum peer_change_type type)
{
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return;
if (type == peer_change_reset)
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
else if (type == <API key>)
{
if (CHECK_FLAG (peer->cap, <API key>)
|| CHECK_FLAG (peer->cap, <API key>))
<API key> (peer, afi, safi, 0, 0, 0);
else
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else if (type == <API key>)
bgp_announce_route (peer, afi, safi);
}
struct peer_flag_action
{
/* Peer's flag. */
u_int32_t flag;
/* This flag can be set for peer-group member. */
u_char not_for_member;
/* Action when the flag is changed. */
enum peer_change_type type;
/* Peer down cause */
u_char peer_down;
};
static const struct peer_flag_action <API key>[] =
{
{ PEER_FLAG_PASSIVE, 0, peer_change_reset },
{ PEER_FLAG_SHUTDOWN, 0, peer_change_reset },
{ <API key>, 0, peer_change_none },
{ <API key>, 0, peer_change_none },
{ <API key>, 0, peer_change_none },
{ <API key>, 0, peer_change_reset },
{ <API key>, 0, peer_change_reset },
{ 0, 0, 0 }
};
static const struct peer_flag_action <API key>[] =
{
{ <API key>, 1, <API key> },
{ <API key>, 1, <API key> },
{ <API key>, 1, <API key> },
{ <API key>, 0, <API key> },
{ <API key>, 1, peer_change_reset },
{ <API key>, 1, peer_change_reset },
{ <API key>, 1, <API key> },
{ <API key>, 1, <API key> },
{ <API key>, 1, <API key> },
{ <API key>, 1, <API key> },
{ <API key>, 0, <API key> },
{ <API key>, 1, peer_change_reset },
{ <API key>, 1, peer_change_reset },
{ <API key>, 0, <API key> },
{ 0, 0, 0 }
};
/* Proper action set. */
static int
<API key> (const struct peer_flag_action *action_list, int size,
struct peer_flag_action *action, u_int32_t flag)
{
int i;
int found = 0;
int reset_in = 0;
int reset_out = 0;
const struct peer_flag_action *match = NULL;
/* Check peer's frag action. */
for (i = 0; i < size; i++)
{
match = &action_list[i];
if (match->flag == 0)
break;
if (match->flag & flag)
{
found = 1;
if (match->type == <API key>)
reset_in = 1;
if (match->type == <API key>)
reset_out = 1;
if (match->type == peer_change_reset)
{
reset_in = 1;
reset_out = 1;
}
if (match->not_for_member)
action->not_for_member = 1;
}
}
/* Set peer clear type. */
if (reset_in && reset_out)
action->type = peer_change_reset;
else if (reset_in)
action->type = <API key>;
else if (reset_out)
action->type = <API key>;
else
action->type = peer_change_none;
return found;
}
static void
<API key> (struct peer *peer, u_int32_t flag)
{
if (flag == PEER_FLAG_SHUTDOWN)
{
if (CHECK_FLAG (peer->flags, flag))
{
if (CHECK_FLAG (peer->sflags, <API key>))
peer_nsf_stop (peer);
UNSET_FLAG (peer->sflags, <API key>);
if (peer->t_pmax_restart)
{
BGP_TIMER_OFF (peer->t_pmax_restart);
if (BGP_DEBUG (events, EVENTS))
zlog_debug ("%s Maximum-prefix restart timer canceled",
peer->host);
}
if (CHECK_FLAG (peer->sflags, <API key>))
peer_nsf_stop (peer);
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
else
{
peer->v_start = <API key>;
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
else if (peer->status == Established)
{
if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == PEER_FLAG_PASSIVE)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
/* Change specified peer flag. */
static int
peer_flag_modify (struct peer *peer, u_int32_t flag, int set)
{
int found;
int size;
struct peer_group *group;
struct listnode *node, *nnode;
struct peer_flag_action action;
memset (&action, 0, sizeof (struct peer_flag_action));
size = sizeof <API key> / sizeof (struct peer_flag_action);
found = <API key> (<API key>, size, &action, flag);
/* No flag action is found. */
if (! found)
return <API key>;
/* Not for peer-group member. */
if (action.not_for_member && peer_group_active (peer))
return <API key>;
/* When unset the peer-group member's flag we have to check
peer-group configuration. */
if (! set && peer_group_active (peer))
if (CHECK_FLAG (peer->group->conf->flags, flag))
{
if (flag == PEER_FLAG_SHUTDOWN)
return <API key>;
else
return <API key>;
}
/* Flag conflict check. */
if (set
&& CHECK_FLAG (peer->flags | flag, <API key>)
&& CHECK_FLAG (peer->flags | flag, <API key>))
return <API key>;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (set && CHECK_FLAG (peer->flags, flag) == flag)
return 0;
if (! set && ! CHECK_FLAG (peer->flags, flag))
return 0;
}
if (set)
SET_FLAG (peer->flags, flag);
else
UNSET_FLAG (peer->flags, flag);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (action.type == peer_change_reset)
<API key> (peer, flag);
return 0;
}
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (set && CHECK_FLAG (peer->flags, flag) == flag)
continue;
if (! set && ! CHECK_FLAG (peer->flags, flag))
continue;
if (set)
SET_FLAG (peer->flags, flag);
else
UNSET_FLAG (peer->flags, flag);
if (action.type == peer_change_reset)
<API key> (peer, flag);
}
return 0;
}
int
peer_flag_set (struct peer *peer, u_int32_t flag)
{
return peer_flag_modify (peer, flag, 1);
}
int
peer_flag_unset (struct peer *peer, u_int32_t flag)
{
return peer_flag_modify (peer, flag, 0);
}
static int
<API key> (struct peer *peer, afi_t afi, safi_t safi)
{
if (peer->af_group[afi][safi])
return 1;
return 0;
}
static int
peer_af_flag_modify (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag,
int set)
{
int found;
int size;
struct listnode *node, *nnode;
struct peer_group *group;
struct peer_flag_action action;
memset (&action, 0, sizeof (struct peer_flag_action));
size = sizeof <API key> / sizeof (struct peer_flag_action);
found = <API key> (<API key>, size, &action, flag);
/* No flag action is found. */
if (! found)
return <API key>;
/* Adress family must be activated. */
if (! peer->afc[afi][safi])
return <API key>;
/* Not for peer-group member. */
if (action.not_for_member && <API key> (peer, afi, safi))
return <API key>;
/* Spcecial check for reflector client. */
if (flag & <API key>
&& peer_sort (peer) != BGP_PEER_IBGP)
return <API key>;
/* Spcecial check for remove-private-AS. */
if (flag & <API key>
&& peer_sort (peer) == BGP_PEER_IBGP)
return <API key>;
/* When unset the peer-group member's flag we have to check
peer-group configuration. */
if (! set && peer->af_group[afi][safi])
if (CHECK_FLAG (peer->group->conf->af_flags[afi][safi], flag))
return <API key>;
/* When current flag configuration is same as requested one. */
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (set && CHECK_FLAG (peer->af_flags[afi][safi], flag) == flag)
return 0;
if (! set && ! CHECK_FLAG (peer->af_flags[afi][safi], flag))
return 0;
}
if (set)
SET_FLAG (peer->af_flags[afi][safi], flag);
else
UNSET_FLAG (peer->af_flags[afi][safi], flag);
/* Execute action when peer is established. */
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)
&& peer->status == Established)
{
if (! set && flag == <API key>)
bgp_clear_adj_in (peer, afi, safi);
else
{
if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
peer_change_action (peer, afi, safi, action.type);
}
}
/* Peer group member updates. */
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (! peer->af_group[afi][safi])
continue;
if (set && CHECK_FLAG (peer->af_flags[afi][safi], flag) == flag)
continue;
if (! set && ! CHECK_FLAG (peer->af_flags[afi][safi], flag))
continue;
if (set)
SET_FLAG (peer->af_flags[afi][safi], flag);
else
UNSET_FLAG (peer->af_flags[afi][safi], flag);
if (peer->status == Established)
{
if (! set && flag == <API key>)
bgp_clear_adj_in (peer, afi, safi);
else
{
if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
else if (flag == <API key>)
peer->last_reset = <API key>;
peer_change_action (peer, afi, safi, action.type);
}
}
}
}
return 0;
}
int
peer_af_flag_set (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag)
{
return peer_af_flag_modify (peer, afi, safi, flag, 1);
}
int
peer_af_flag_unset (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag)
{
return peer_af_flag_modify (peer, afi, safi, flag, 0);
}
/* EBGP multihop configuration. */
int
<API key> (struct peer *peer, int ttl)
{
struct peer_group *group;
struct listnode *node, *nnode;
struct peer *peer1;
if (peer_sort (peer) == BGP_PEER_IBGP)
return 0;
/* see comment in <API key>() */
if (ttl != MAXTTL)
{
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
group = peer->group;
if (group->conf->gtsm_hops != 0)
return <API key>;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer1))
{
if (peer_sort (peer1) == BGP_PEER_IBGP)
continue;
if (peer1->gtsm_hops != 0)
return <API key>;
}
}
else
{
if (peer->gtsm_hops != 0)
return <API key>;
}
}
peer->ttl = ttl;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
}
else
{
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer_sort (peer) == BGP_PEER_IBGP)
continue;
peer->ttl = group->conf->ttl;
if (peer->fd >= 0)
sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
}
}
return 0;
}
int
<API key> (struct peer *peer)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (peer_sort (peer) == BGP_PEER_IBGP)
return 0;
if (peer->gtsm_hops != 0 && peer->ttl != MAXTTL)
return <API key>;
if (peer_group_active (peer))
peer->ttl = peer->group->conf->ttl;
else
peer->ttl = 1;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
}
else
{
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer_sort (peer) == BGP_PEER_IBGP)
continue;
peer->ttl = 1;
if (peer->fd >= 0)
sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
}
}
return 0;
}
/* Neighbor description. */
int
<API key> (struct peer *peer, char *desc)
{
if (peer->desc)
XFREE (MTYPE_PEER_DESC, peer->desc);
peer->desc = XSTRDUP (MTYPE_PEER_DESC, desc);
return 0;
}
int
<API key> (struct peer *peer)
{
if (peer->desc)
XFREE (MTYPE_PEER_DESC, peer->desc);
peer->desc = NULL;
return 0;
}
/* Neighbor update-source. */
int
<API key> (struct peer *peer, const char *ifname)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (peer->update_if)
{
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)
&& strcmp (peer->update_if, ifname) == 0)
return 0;
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
if (peer->update_source)
{
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
peer->update_if = XSTRDUP (<API key>, ifname);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer->update_if)
{
if (strcmp (peer->update_if, ifname) == 0)
continue;
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
if (peer->update_source)
{
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
peer->update_if = XSTRDUP (<API key>, ifname);
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
return 0;
}
int
<API key> (struct peer *peer, union sockunion *su)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (peer->update_source)
{
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)
&& sockunion_cmp (peer->update_source, su) == 0)
return 0;
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
if (peer->update_if)
{
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
peer->update_source = sockunion_dup (su);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer->update_source)
{
if (sockunion_cmp (peer->update_source, su) == 0)
continue;
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
if (peer->update_if)
{
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
peer->update_source = sockunion_dup (su);
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
return 0;
}
int
<API key> (struct peer *peer)
{
union sockunion *su;
struct peer_group *group;
struct listnode *node, *nnode;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)
&& ! peer->update_source
&& ! peer->update_if)
return 0;
if (peer->update_source)
{
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
if (peer->update_if)
{
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
if (peer_group_active (peer))
{
group = peer->group;
if (group->conf->update_source)
{
su = sockunion_dup (group->conf->update_source);
peer->update_source = su;
}
else if (group->conf->update_if)
peer->update_if =
XSTRDUP (<API key>, group->conf->update_if);
}
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (! peer->update_source && ! peer->update_if)
continue;
if (peer->update_source)
{
sockunion_free (peer->update_source);
peer->update_source = NULL;
}
if (peer->update_if)
{
XFREE (<API key>, peer->update_if);
peer->update_if = NULL;
}
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi,
const char *rmap)
{
struct peer_group *group;
struct listnode *node, *nnode;
/* Adress family must be activated. */
if (! peer->afc[afi][safi])
return <API key>;
/* Default originate can't be used for peer group memeber. */
if (<API key> (peer, afi, safi))
return <API key>;
if (! CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
|| (rmap && ! peer->default_rmap[afi][safi].name)
|| (rmap && strcmp (rmap, peer->default_rmap[afi][safi].name) != 0))
{
SET_FLAG (peer->af_flags[afi][safi], <API key>);
if (rmap)
{
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].name = strdup (rmap);
peer->default_rmap[afi][safi].map = <API key> (rmap);
}
}
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established && peer->afc_nego[afi][safi])
<API key> (peer, afi, safi, 0);
return 0;
}
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
SET_FLAG (peer->af_flags[afi][safi], <API key>);
if (rmap)
{
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].name = strdup (rmap);
peer->default_rmap[afi][safi].map = <API key> (rmap);
}
if (peer->status == Established && peer->afc_nego[afi][safi])
<API key> (peer, afi, safi, 0);
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi)
{
struct peer_group *group;
struct listnode *node, *nnode;
/* Adress family must be activated. */
if (! peer->afc[afi][safi])
return <API key>;
/* Default originate can't be used for peer group memeber. */
if (<API key> (peer, afi, safi))
return <API key>;
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
{
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].name = NULL;
peer->default_rmap[afi][safi].map = NULL;
}
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established && peer->afc_nego[afi][safi])
<API key> (peer, afi, safi, 1);
return 0;
}
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
if (peer->default_rmap[afi][safi].name)
free (peer->default_rmap[afi][safi].name);
peer->default_rmap[afi][safi].name = NULL;
peer->default_rmap[afi][safi].map = NULL;
if (peer->status == Established && peer->afc_nego[afi][safi])
<API key> (peer, afi, safi, 1);
}
return 0;
}
int
peer_port_set (struct peer *peer, u_int16_t port)
{
peer->port = port;
return 0;
}
int
peer_port_unset (struct peer *peer)
{
peer->port = BGP_PORT_DEFAULT;
return 0;
}
/* neighbor weight. */
int
peer_weight_set (struct peer *peer, u_int16_t weight)
{
struct peer_group *group;
struct listnode *node, *nnode;
SET_FLAG (peer->config, PEER_CONFIG_WEIGHT);
peer->weight = weight;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
peer->weight = group->conf->weight;
}
return 0;
}
int
peer_weight_unset (struct peer *peer)
{
struct peer_group *group;
struct listnode *node, *nnode;
/* Set default weight. */
if (peer_group_active (peer))
peer->weight = peer->group->conf->weight;
else
peer->weight = 0;
UNSET_FLAG (peer->config, PEER_CONFIG_WEIGHT);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
peer->weight = 0;
}
return 0;
}
int
peer_timers_set (struct peer *peer, u_int32_t keepalive, u_int32_t holdtime)
{
struct peer_group *group;
struct listnode *node, *nnode;
/* Not for peer group memeber. */
if (peer_group_active (peer))
return <API key>;
/* keepalive value check. */
if (keepalive > 65535)
return <API key>;
/* Holdtime value check. */
if (holdtime > 65535)
return <API key>;
/* Holdtime value must be either 0 or greater than 3. */
if (holdtime < 3 && holdtime != 0)
return <API key>;
/* Set value to the configuration. */
SET_FLAG (peer->config, PEER_CONFIG_TIMER);
peer->holdtime = holdtime;
peer->keepalive = (keepalive < holdtime / 3 ? keepalive : holdtime / 3);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
SET_FLAG (peer->config, PEER_CONFIG_TIMER);
peer->holdtime = group->conf->holdtime;
peer->keepalive = group->conf->keepalive;
}
return 0;
}
int
peer_timers_unset (struct peer *peer)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (peer_group_active (peer))
return <API key>;
/* Clear configuration. */
UNSET_FLAG (peer->config, PEER_CONFIG_TIMER);
peer->keepalive = 0;
peer->holdtime = 0;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
/* peer-group member updates. */
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
UNSET_FLAG (peer->config, PEER_CONFIG_TIMER);
peer->holdtime = 0;
peer->keepalive = 0;
}
return 0;
}
int
<API key> (struct peer *peer, u_int32_t connect)
{
if (peer_group_active (peer))
return <API key>;
if (connect > 65535)
return <API key>;
/* Set value to the configuration. */
SET_FLAG (peer->config, PEER_CONFIG_CONNECT);
peer->connect = connect;
/* Set value to timer setting. */
peer->v_connect = connect;
return 0;
}
int
<API key> (struct peer *peer)
{
if (peer_group_active (peer))
return <API key>;
/* Clear configuration. */
UNSET_FLAG (peer->config, PEER_CONFIG_CONNECT);
peer->connect = 0;
/* Set timer setting to default value. */
peer->v_connect = <API key>;
return 0;
}
int
<API key> (struct peer *peer, u_int32_t routeadv)
{
if (peer_group_active (peer))
return <API key>;
if (routeadv > 600)
return <API key>;
SET_FLAG (peer->config, <API key>);
peer->routeadv = routeadv;
peer->v_routeadv = routeadv;
return 0;
}
int
<API key> (struct peer *peer)
{
if (peer_group_active (peer))
return <API key>;
UNSET_FLAG (peer->config, <API key>);
peer->routeadv = 0;
if (peer_sort (peer) == BGP_PEER_IBGP)
peer->v_routeadv = <API key>;
else
peer->v_routeadv = <API key>;
return 0;
}
/* neighbor interface */
int
peer_interface_set (struct peer *peer, const char *str)
{
if (peer->ifname)
free (peer->ifname);
peer->ifname = strdup (str);
return 0;
}
int
<API key> (struct peer *peer)
{
if (peer->ifname)
free (peer->ifname);
peer->ifname = NULL;
return 0;
}
/* Allow-as in. */
int
peer_allowas_in_set (struct peer *peer, afi_t afi, safi_t safi, int allow_num)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (allow_num < 1 || allow_num > 10)
return <API key>;
if (peer->allowas_in[afi][safi] != allow_num)
{
peer->allowas_in[afi][safi] = allow_num;
SET_FLAG (peer->af_flags[afi][safi], <API key>);
peer_change_action (peer, afi, safi, <API key>);
}
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer->allowas_in[afi][safi] != allow_num)
{
peer->allowas_in[afi][safi] = allow_num;
SET_FLAG (peer->af_flags[afi][safi], <API key>);
peer_change_action (peer, afi, safi, <API key>);
}
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
{
peer->allowas_in[afi][safi] = 0;
peer_af_flag_unset (peer, afi, safi, <API key>);
}
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
{
peer->allowas_in[afi][safi] = 0;
peer_af_flag_unset (peer, afi, safi, <API key>);
}
}
return 0;
}
int
peer_local_as_set (struct peer *peer, as_t as, int no_prepend)
{
struct bgp *bgp = peer->bgp;
struct peer_group *group;
struct listnode *node, *nnode;
if (peer_sort (peer) != BGP_PEER_EBGP
&& peer_sort (peer) != BGP_PEER_INTERNAL)
return <API key>;
if (bgp->as == as)
return <API key>;
if (peer_group_active (peer))
return <API key>;
if (peer->change_local_as == as &&
((CHECK_FLAG (peer->flags, <API key>) && no_prepend)
|| (! CHECK_FLAG (peer->flags, <API key>) && ! no_prepend)))
return 0;
peer->change_local_as = as;
if (no_prepend)
SET_FLAG (peer->flags, <API key>);
else
UNSET_FLAG (peer->flags, <API key>);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
peer->change_local_as = as;
if (no_prepend)
SET_FLAG (peer->flags, <API key>);
else
UNSET_FLAG (peer->flags, <API key>);
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
return 0;
}
int
peer_local_as_unset (struct peer *peer)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (peer_group_active (peer))
return <API key>;
if (! peer->change_local_as)
return 0;
peer->change_local_as = 0;
UNSET_FLAG (peer->flags, <API key>);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
return 0;
}
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
peer->change_local_as = 0;
UNSET_FLAG (peer->flags, <API key>);
if (peer->status == Established)
{
peer->last_reset = <API key>;
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
}
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
return 0;
}
/* Set password for authenticating with the peer. */
int
peer_password_set (struct peer *peer, const char *password)
{
struct listnode *nn, *nnode;
int len = password ? strlen(password) : 0;
int ret = BGP_SUCCESS;
if ((len < <API key>) || (len > <API key>))
return <API key>;
if (peer->password && strcmp (peer->password, password) == 0
&& ! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
if (peer->password)
XFREE (MTYPE_PEER_PASSWORD, peer->password);
peer->password = XSTRDUP (MTYPE_PEER_PASSWORD, password);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE, <API key>);
else
BGP_EVENT_ADD (peer, BGP_Stop);
return (bgp_md5_set (peer) >= 0) ? BGP_SUCCESS : <API key>;
}
for (ALL_LIST_ELEMENTS (peer->group->peer, nn, nnode, peer))
{
if (peer->password && strcmp (peer->password, password) == 0)
continue;
if (peer->password)
XFREE (MTYPE_PEER_PASSWORD, peer->password);
peer->password = XSTRDUP(MTYPE_PEER_PASSWORD, password);
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE, <API key>);
else
BGP_EVENT_ADD (peer, BGP_Stop);
if (bgp_md5_set (peer) < 0)
ret = <API key>;
}
return ret;
}
int
peer_password_unset (struct peer *peer)
{
struct listnode *nn, *nnode;
if (!peer->password
&& !CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
if (!CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer_group_active (peer)
&& peer->group->conf->password
&& strcmp (peer->group->conf->password, peer->password) == 0)
return <API key>;
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE, <API key>);
else
BGP_EVENT_ADD (peer, BGP_Stop);
if (peer->password)
XFREE (MTYPE_PEER_PASSWORD, peer->password);
peer->password = NULL;
bgp_md5_set (peer);
return 0;
}
XFREE (MTYPE_PEER_PASSWORD, peer->password);
peer->password = NULL;
for (ALL_LIST_ELEMENTS (peer->group->peer, nn, nnode, peer))
{
if (!peer->password)
continue;
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE, <API key>);
else
BGP_EVENT_ADD (peer, BGP_Stop);
XFREE (MTYPE_PEER_PASSWORD, peer->password);
peer->password = NULL;
bgp_md5_set (peer);
}
return 0;
}
/* Set distribute list to the peer. */
int
peer_distribute_set (struct peer *peer, afi_t afi, safi_t safi, int direct,
const char *name)
{
struct bgp_filter *filter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != FILTER_IN && direct != FILTER_OUT)
return <API key>;
if (direct == FILTER_OUT && <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
if (filter->plist[direct].name)
return <API key>;
if (filter->dlist[direct].name)
free (filter->dlist[direct].name);
filter->dlist[direct].name = strdup (name);
filter->dlist[direct].alist = access_list_lookup (afi, name);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->dlist[direct].name)
free (filter->dlist[direct].name);
filter->dlist[direct].name = strdup (name);
filter->dlist[direct].alist = access_list_lookup (afi, name);
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi, int direct)
{
struct bgp_filter *filter;
struct bgp_filter *gfilter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != FILTER_IN && direct != FILTER_OUT)
return <API key>;
if (direct == FILTER_OUT && <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
/* apply peer-group filter */
if (peer->af_group[afi][safi])
{
gfilter = &peer->group->conf->filter[afi][safi];
if (gfilter->dlist[direct].name)
{
if (filter->dlist[direct].name)
free (filter->dlist[direct].name);
filter->dlist[direct].name = strdup (gfilter->dlist[direct].name);
filter->dlist[direct].alist = gfilter->dlist[direct].alist;
return 0;
}
}
if (filter->dlist[direct].name)
free (filter->dlist[direct].name);
filter->dlist[direct].name = NULL;
filter->dlist[direct].alist = NULL;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->dlist[direct].name)
free (filter->dlist[direct].name);
filter->dlist[direct].name = NULL;
filter->dlist[direct].alist = NULL;
}
return 0;
}
/* Update distribute list. */
static void
<API key> (struct access_list *access)
{
afi_t afi;
safi_t safi;
int direct;
struct listnode *mnode, *mnnode;
struct listnode *node, *nnode;
struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
struct bgp_filter *filter;
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &peer->filter[afi][safi];
for (direct = FILTER_IN; direct < FILTER_MAX; direct++)
{
if (filter->dlist[direct].name)
filter->dlist[direct].alist =
access_list_lookup (afi, filter->dlist[direct].name);
else
filter->dlist[direct].alist = NULL;
}
}
}
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &group->conf->filter[afi][safi];
for (direct = FILTER_IN; direct < FILTER_MAX; direct++)
{
if (filter->dlist[direct].name)
filter->dlist[direct].alist =
access_list_lookup (afi, filter->dlist[direct].name);
else
filter->dlist[direct].alist = NULL;
}
}
}
}
}
/* Set prefix list to the peer. */
int
<API key> (struct peer *peer, afi_t afi, safi_t safi, int direct,
const char *name)
{
struct bgp_filter *filter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != FILTER_IN && direct != FILTER_OUT)
return <API key>;
if (direct == FILTER_OUT && <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
if (filter->dlist[direct].name)
return <API key>;
if (filter->plist[direct].name)
free (filter->plist[direct].name);
filter->plist[direct].name = strdup (name);
filter->plist[direct].plist = prefix_list_lookup (afi, name);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->plist[direct].name)
free (filter->plist[direct].name);
filter->plist[direct].name = strdup (name);
filter->plist[direct].plist = prefix_list_lookup (afi, name);
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi, int direct)
{
struct bgp_filter *filter;
struct bgp_filter *gfilter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != FILTER_IN && direct != FILTER_OUT)
return <API key>;
if (direct == FILTER_OUT && <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
/* apply peer-group filter */
if (peer->af_group[afi][safi])
{
gfilter = &peer->group->conf->filter[afi][safi];
if (gfilter->plist[direct].name)
{
if (filter->plist[direct].name)
free (filter->plist[direct].name);
filter->plist[direct].name = strdup (gfilter->plist[direct].name);
filter->plist[direct].plist = gfilter->plist[direct].plist;
return 0;
}
}
if (filter->plist[direct].name)
free (filter->plist[direct].name);
filter->plist[direct].name = NULL;
filter->plist[direct].plist = NULL;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->plist[direct].name)
free (filter->plist[direct].name);
filter->plist[direct].name = NULL;
filter->plist[direct].plist = NULL;
}
return 0;
}
/* Update prefix-list list. */
static void
<API key> (struct prefix_list *plist)
{
struct listnode *mnode, *mnnode;
struct listnode *node, *nnode;
struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
struct bgp_filter *filter;
afi_t afi;
safi_t safi;
int direct;
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &peer->filter[afi][safi];
for (direct = FILTER_IN; direct < FILTER_MAX; direct++)
{
if (filter->plist[direct].name)
filter->plist[direct].plist =
prefix_list_lookup (afi, filter->plist[direct].name);
else
filter->plist[direct].plist = NULL;
}
}
}
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &group->conf->filter[afi][safi];
for (direct = FILTER_IN; direct < FILTER_MAX; direct++)
{
if (filter->plist[direct].name)
filter->plist[direct].plist =
prefix_list_lookup (afi, filter->plist[direct].name);
else
filter->plist[direct].plist = NULL;
}
}
}
}
}
int
peer_aslist_set (struct peer *peer, afi_t afi, safi_t safi, int direct,
const char *name)
{
struct bgp_filter *filter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != FILTER_IN && direct != FILTER_OUT)
return <API key>;
if (direct == FILTER_OUT && <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
if (filter->aslist[direct].name)
free (filter->aslist[direct].name);
filter->aslist[direct].name = strdup (name);
filter->aslist[direct].aslist = as_list_lookup (name);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->aslist[direct].name)
free (filter->aslist[direct].name);
filter->aslist[direct].name = strdup (name);
filter->aslist[direct].aslist = as_list_lookup (name);
}
return 0;
}
int
peer_aslist_unset (struct peer *peer,afi_t afi, safi_t safi, int direct)
{
struct bgp_filter *filter;
struct bgp_filter *gfilter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != FILTER_IN && direct != FILTER_OUT)
return <API key>;
if (direct == FILTER_OUT && <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
/* apply peer-group filter */
if (peer->af_group[afi][safi])
{
gfilter = &peer->group->conf->filter[afi][safi];
if (gfilter->aslist[direct].name)
{
if (filter->aslist[direct].name)
free (filter->aslist[direct].name);
filter->aslist[direct].name = strdup (gfilter->aslist[direct].name);
filter->aslist[direct].aslist = gfilter->aslist[direct].aslist;
return 0;
}
}
if (filter->aslist[direct].name)
free (filter->aslist[direct].name);
filter->aslist[direct].name = NULL;
filter->aslist[direct].aslist = NULL;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->aslist[direct].name)
free (filter->aslist[direct].name);
filter->aslist[direct].name = NULL;
filter->aslist[direct].aslist = NULL;
}
return 0;
}
static void
peer_aslist_update (void)
{
afi_t afi;
safi_t safi;
int direct;
struct listnode *mnode, *mnnode;
struct listnode *node, *nnode;
struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
struct bgp_filter *filter;
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &peer->filter[afi][safi];
for (direct = FILTER_IN; direct < FILTER_MAX; direct++)
{
if (filter->aslist[direct].name)
filter->aslist[direct].aslist =
as_list_lookup (filter->aslist[direct].name);
else
filter->aslist[direct].aslist = NULL;
}
}
}
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
filter = &group->conf->filter[afi][safi];
for (direct = FILTER_IN; direct < FILTER_MAX; direct++)
{
if (filter->aslist[direct].name)
filter->aslist[direct].aslist =
as_list_lookup (filter->aslist[direct].name);
else
filter->aslist[direct].aslist = NULL;
}
}
}
}
}
/* Set route-map to the peer. */
int
peer_route_map_set (struct peer *peer, afi_t afi, safi_t safi, int direct,
const char *name)
{
struct bgp_filter *filter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != RMAP_IN && direct != RMAP_OUT &&
direct != RMAP_IMPORT && direct != RMAP_EXPORT)
return <API key>;
if ( (direct == RMAP_OUT || direct == RMAP_IMPORT)
&& <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
if (filter->map[direct].name)
free (filter->map[direct].name);
filter->map[direct].name = strdup (name);
filter->map[direct].map = <API key> (name);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->map[direct].name)
free (filter->map[direct].name);
filter->map[direct].name = strdup (name);
filter->map[direct].map = <API key> (name);
}
return 0;
}
/* Unset route-map from the peer. */
int
<API key> (struct peer *peer, afi_t afi, safi_t safi, int direct)
{
struct bgp_filter *filter;
struct bgp_filter *gfilter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (direct != RMAP_IN && direct != RMAP_OUT &&
direct != RMAP_IMPORT && direct != RMAP_EXPORT)
return <API key>;
if ( (direct == RMAP_OUT || direct == RMAP_IMPORT)
&& <API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
/* apply peer-group filter */
if (peer->af_group[afi][safi])
{
gfilter = &peer->group->conf->filter[afi][safi];
if (gfilter->map[direct].name)
{
if (filter->map[direct].name)
free (filter->map[direct].name);
filter->map[direct].name = strdup (gfilter->map[direct].name);
filter->map[direct].map = gfilter->map[direct].map;
return 0;
}
}
if (filter->map[direct].name)
free (filter->map[direct].name);
filter->map[direct].name = NULL;
filter->map[direct].map = NULL;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->map[direct].name)
free (filter->map[direct].name);
filter->map[direct].name = NULL;
filter->map[direct].map = NULL;
}
return 0;
}
/* Set unsuppress-map to the peer. */
int
<API key> (struct peer *peer, afi_t afi, safi_t safi,
const char *name)
{
struct bgp_filter *filter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (<API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
if (filter->usmap.name)
free (filter->usmap.name);
filter->usmap.name = strdup (name);
filter->usmap.map = <API key> (name);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->usmap.name)
free (filter->usmap.name);
filter->usmap.name = strdup (name);
filter->usmap.map = <API key> (name);
}
return 0;
}
/* Unset route-map from the peer. */
int
<API key> (struct peer *peer, afi_t afi, safi_t safi)
{
struct bgp_filter *filter;
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
if (<API key> (peer, afi, safi))
return <API key>;
filter = &peer->filter[afi][safi];
if (filter->usmap.name)
free (filter->usmap.name);
filter->usmap.name = NULL;
filter->usmap.map = NULL;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
filter = &peer->filter[afi][safi];
if (! peer->af_group[afi][safi])
continue;
if (filter->usmap.name)
free (filter->usmap.name);
filter->usmap.name = NULL;
filter->usmap.map = NULL;
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi,
u_int32_t max, u_char threshold,
int warning, u_int16_t restart)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
SET_FLAG (peer->af_flags[afi][safi], <API key>);
peer->pmax[afi][safi] = max;
peer->pmax_threshold[afi][safi] = threshold;
peer->pmax_restart[afi][safi] = restart;
if (warning)
SET_FLAG (peer->af_flags[afi][safi], <API key>);
else
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (! peer->af_group[afi][safi])
continue;
SET_FLAG (peer->af_flags[afi][safi], <API key>);
peer->pmax[afi][safi] = max;
peer->pmax_threshold[afi][safi] = threshold;
peer->pmax_restart[afi][safi] = restart;
if (warning)
SET_FLAG (peer->af_flags[afi][safi], <API key>);
else
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
}
return 0;
}
int
<API key> (struct peer *peer, afi_t afi, safi_t safi)
{
struct peer_group *group;
struct listnode *node, *nnode;
if (! peer->afc[afi][safi])
return <API key>;
/* apply peer-group config */
if (peer->af_group[afi][safi])
{
if (CHECK_FLAG (peer->group->conf->af_flags[afi][safi],
<API key>))
SET_FLAG (peer->af_flags[afi][safi], <API key>);
else
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
if (CHECK_FLAG (peer->group->conf->af_flags[afi][safi],
<API key>))
SET_FLAG (peer->af_flags[afi][safi], <API key>);
else
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
peer->pmax[afi][safi] = peer->group->conf->pmax[afi][safi];
peer->pmax_threshold[afi][safi] = peer->group->conf->pmax_threshold[afi][safi];
peer->pmax_restart[afi][safi] = peer->group->conf->pmax_restart[afi][safi];
return 0;
}
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
peer->pmax[afi][safi] = 0;
peer->pmax_threshold[afi][safi] = 0;
peer->pmax_restart[afi][safi] = 0;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
return 0;
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (! peer->af_group[afi][safi])
continue;
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
UNSET_FLAG (peer->af_flags[afi][safi], <API key>);
peer->pmax[afi][safi] = 0;
peer->pmax_threshold[afi][safi] = 0;
peer->pmax_restart[afi][safi] = 0;
}
return 0;
}
/* Set # of hops between us and BGP peer. */
int
<API key> (struct peer *peer, int gtsm_hops)
{
struct peer_group *group;
struct listnode *node, *nnode;
struct peer *peer1;
int ret;
zlog_debug ("<API key>: set gtsm_hops to %d for %s", gtsm_hops, peer->host);
if (peer_sort (peer) == BGP_PEER_IBGP)
return <API key>;
/* We cannot configure ttl-security hops when ebgp-multihop is already
set. For non peer-groups, the check is simple. For peer-groups, it's
slightly messy, because we need to check both the peer-group structure
and all peer-group members for any trace of ebgp-multihop configuration
before actually applying the ttl-security rules. Cisco really made a
mess of this configuration parameter, and OpenBGPD got it right.
*/
if (peer->gtsm_hops == 0) {
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
group = peer->group;
if (group->conf->ttl != 1)
return <API key>;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer1))
{
if (peer_sort (peer1) == BGP_PEER_IBGP)
continue;
if (peer1->ttl != 1)
return <API key>;
}
}
else
{
if (peer->ttl != 1)
return <API key>;
}
/* specify MAXTTL on outgoing packets */
ret = <API key> (peer, MAXTTL);
if (ret != 0)
return ret;
}
peer->gtsm_hops = gtsm_hops;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
sockopt_minttl (peer->su.sa.sa_family, peer->fd, MAXTTL + 1 - gtsm_hops);
}
else
{
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer_sort (peer) == BGP_PEER_IBGP)
continue;
peer->gtsm_hops = group->conf->gtsm_hops;
/* Change setting of existing peer
* established then change value (may break connectivity)
* not established yet (teardown session and restart)
* no session then do nothing (will get handled by next connection)
*/
if (peer->status == Established)
{
if (peer->fd >= 0 && peer->gtsm_hops != 0)
sockopt_minttl (peer->su.sa.sa_family, peer->fd,
MAXTTL + 1 - peer->gtsm_hops);
}
else if (peer->status < Established)
{
if (BGP_DEBUG (events, EVENTS))
zlog_debug ("%s Min-ttl changed", peer->host);
BGP_EVENT_ADD (peer, BGP_Stop);
}
}
}
return 0;
}
int
<API key> (struct peer *peer)
{
struct peer_group *group;
struct listnode *node, *nnode;
struct peer *opeer;
zlog_debug ("<API key>: set gtsm_hops to zero for %s", peer->host);
if (peer_sort (peer) == BGP_PEER_IBGP)
return 0;
/* if a peer-group member, then reset to peer-group default rather than 0 */
if (peer_group_active (peer))
peer->gtsm_hops = peer->group->conf->gtsm_hops;
else
peer->gtsm_hops = 0;
opeer = peer;
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
{
if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
sockopt_minttl (peer->su.sa.sa_family, peer->fd, 0);
}
else
{
group = peer->group;
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (peer_sort (peer) == BGP_PEER_IBGP)
continue;
peer->gtsm_hops = 0;
if (peer->fd >= 0)
sockopt_minttl (peer->su.sa.sa_family, peer->fd, 0);
}
}
return <API key> (opeer);
}
int
peer_clear (struct peer *peer)
{
if (! CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
{
if (CHECK_FLAG (peer->sflags, <API key>))
{
UNSET_FLAG (peer->sflags, <API key>);
if (peer->t_pmax_restart)
{
BGP_TIMER_OFF (peer->t_pmax_restart);
if (BGP_DEBUG (events, EVENTS))
zlog_debug ("%s Maximum-prefix restart timer canceled",
peer->host);
}
BGP_EVENT_ADD (peer, BGP_Start);
return 0;
}
peer->v_start = <API key>;
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
else
BGP_EVENT_ADD (peer, BGP_Stop);
}
return 0;
}
int
peer_clear_soft (struct peer *peer, afi_t afi, safi_t safi,
enum bgp_clear_type stype)
{
if (peer->status != Established)
return 0;
if (! peer->afc[afi][safi])
return <API key>;
if (stype == <API key>)
{
if (! CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
return 0;
<API key> (peer, afi, safi);
<API key> (peer, afi, safi);
}
if (stype == BGP_CLEAR_SOFT_OUT || stype == BGP_CLEAR_SOFT_BOTH)
bgp_announce_route (peer, afi, safi);
if (stype == <API key>)
{
if (CHECK_FLAG (peer->af_cap[afi][safi], <API key>)
&& (CHECK_FLAG (peer->af_cap[afi][safi], <API key>)
|| CHECK_FLAG (peer->af_cap[afi][safi], <API key>)))
{
struct bgp_filter *filter = &peer->filter[afi][safi];
u_char prefix_type;
if (CHECK_FLAG (peer->af_cap[afi][safi], <API key>))
prefix_type = ORF_TYPE_PREFIX;
else
prefix_type = ORF_TYPE_PREFIX_OLD;
if (filter->plist[FILTER_IN].plist)
{
if (CHECK_FLAG (peer->af_sflags[afi][safi], <API key>))
<API key> (peer, afi, safi,
prefix_type, REFRESH_DEFER, 1);
<API key> (peer, afi, safi, prefix_type,
REFRESH_IMMEDIATE, 0);
}
else
{
if (CHECK_FLAG (peer->af_sflags[afi][safi], <API key>))
<API key> (peer, afi, safi,
prefix_type, REFRESH_IMMEDIATE, 1);
else
<API key> (peer, afi, safi, 0, 0, 0);
}
return 0;
}
}
if (stype == BGP_CLEAR_SOFT_IN || stype == BGP_CLEAR_SOFT_BOTH
|| stype == <API key>)
{
/* If neighbor has soft reconfiguration inbound flag.
Use Adj-RIB-In database. */
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
<API key> (peer, afi, safi);
else
{
/* If neighbor has route refresh capability, send route refresh
message to the peer. */
if (CHECK_FLAG (peer->cap, <API key>)
|| CHECK_FLAG (peer->cap, <API key>))
<API key> (peer, afi, safi, 0, 0, 0);
else
return <API key>;
}
}
return 0;
}
/* Display peer uptime.*/
/* XXX: why does this function return char * when it takes buffer? */
char *
peer_uptime (time_t uptime2, char *buf, size_t len)
{
time_t uptime1;
struct tm *tm;
/* Check buffer length. */
if (len < BGP_UPTIME_LEN)
{
zlog_warn ("peer_uptime (): buffer shortage %lu", (u_long)len);
/* XXX: should return status instead of buf... */
snprintf (buf, len, "<error> ");
return buf;
}
/* If there is no connection has been done before print `never'. */
if (uptime2 == 0)
{
snprintf (buf, len, "never ");
return buf;
}
/* Get current time. */
uptime1 = bgp_clock ();
uptime1 -= uptime2;
tm = gmtime (&uptime1);
/* Making formatted timer strings. */
#define ONE_DAY_SECOND 60*60*24
#define ONE_WEEK_SECOND 60*60*24*7
if (uptime1 < ONE_DAY_SECOND)
snprintf (buf, len, "%02d:%02d:%02d",
tm->tm_hour, tm->tm_min, tm->tm_sec);
else if (uptime1 < ONE_WEEK_SECOND)
snprintf (buf, len, "%dd%02dh%02dm",
tm->tm_yday, tm->tm_hour, tm->tm_min);
else
snprintf (buf, len, "%02dw%dd%02dh",
tm->tm_yday/7, tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
return buf;
}
static void
<API key> (struct vty *vty, struct peer *peer,
afi_t afi, safi_t safi)
{
struct bgp_filter *filter;
struct bgp_filter *gfilter = NULL;
char *addr;
int in = FILTER_IN;
int out = FILTER_OUT;
addr = peer->host;
filter = &peer->filter[afi][safi];
if (peer->af_group[afi][safi])
gfilter = &peer->group->conf->filter[afi][safi];
/* distribute-list. */
if (filter->dlist[in].name)
if (! gfilter || ! gfilter->dlist[in].name
|| strcmp (filter->dlist[in].name, gfilter->dlist[in].name) != 0)
vty_out (vty, " neighbor %s distribute-list %s in%s", addr,
filter->dlist[in].name, VTY_NEWLINE);
if (filter->dlist[out].name && ! gfilter)
vty_out (vty, " neighbor %s distribute-list %s out%s", addr,
filter->dlist[out].name, VTY_NEWLINE);
/* prefix-list. */
if (filter->plist[in].name)
if (! gfilter || ! gfilter->plist[in].name
|| strcmp (filter->plist[in].name, gfilter->plist[in].name) != 0)
vty_out (vty, " neighbor %s prefix-list %s in%s", addr,
filter->plist[in].name, VTY_NEWLINE);
if (filter->plist[out].name && ! gfilter)
vty_out (vty, " neighbor %s prefix-list %s out%s", addr,
filter->plist[out].name, VTY_NEWLINE);
/* route-map. */
if (filter->map[RMAP_IN].name)
if (! gfilter || ! gfilter->map[RMAP_IN].name
|| strcmp (filter->map[RMAP_IN].name, gfilter->map[RMAP_IN].name) != 0)
vty_out (vty, " neighbor %s route-map %s in%s", addr,
filter->map[RMAP_IN].name, VTY_NEWLINE);
if (filter->map[RMAP_OUT].name && ! gfilter)
vty_out (vty, " neighbor %s route-map %s out%s", addr,
filter->map[RMAP_OUT].name, VTY_NEWLINE);
if (filter->map[RMAP_IMPORT].name && ! gfilter)
vty_out (vty, " neighbor %s route-map %s import%s", addr,
filter->map[RMAP_IMPORT].name, VTY_NEWLINE);
if (filter->map[RMAP_EXPORT].name)
if (! gfilter || ! gfilter->map[RMAP_EXPORT].name
|| strcmp (filter->map[RMAP_EXPORT].name,
gfilter->map[RMAP_EXPORT].name) != 0)
vty_out (vty, " neighbor %s route-map %s export%s", addr,
filter->map[RMAP_EXPORT].name, VTY_NEWLINE);
/* unsuppress-map */
if (filter->usmap.name && ! gfilter)
vty_out (vty, " neighbor %s unsuppress-map %s%s", addr,
filter->usmap.name, VTY_NEWLINE);
/* filter-list. */
if (filter->aslist[in].name)
if (! gfilter || ! gfilter->aslist[in].name
|| strcmp (filter->aslist[in].name, gfilter->aslist[in].name) != 0)
vty_out (vty, " neighbor %s filter-list %s in%s", addr,
filter->aslist[in].name, VTY_NEWLINE);
if (filter->aslist[out].name && ! gfilter)
vty_out (vty, " neighbor %s filter-list %s out%s", addr,
filter->aslist[out].name, VTY_NEWLINE);
}
/* BGP peer configuration display function. */
static void
<API key> (struct vty *vty, struct bgp *bgp,
struct peer *peer, afi_t afi, safi_t safi)
{
struct peer *g_peer = NULL;
char buf[SU_ADDRSTRLEN];
char *addr;
addr = peer->host;
if (peer_group_active (peer))
g_peer = peer->group->conf;
if (afi == AFI_IP && safi == SAFI_UNICAST)
{
/* remote-as. */
if (! peer_group_active (peer))
{
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
vty_out (vty, " neighbor %s peer-group%s", addr,
VTY_NEWLINE);
if (peer->as)
vty_out (vty, " neighbor %s remote-as %u%s", addr, peer->as,
VTY_NEWLINE);
}
else
{
if (! g_peer->as)
vty_out (vty, " neighbor %s remote-as %u%s", addr, peer->as,
VTY_NEWLINE);
if (peer->af_group[AFI_IP][SAFI_UNICAST])
vty_out (vty, " neighbor %s peer-group %s%s", addr,
peer->group->name, VTY_NEWLINE);
}
/* local-as. */
if (peer->change_local_as)
if (! peer_group_active (peer))
vty_out (vty, " neighbor %s local-as %u%s%s", addr,
peer->change_local_as,
CHECK_FLAG (peer->flags, <API key>) ?
" no-prepend" : "", VTY_NEWLINE);
/* Description. */
if (peer->desc)
vty_out (vty, " neighbor %s description %s%s", addr, peer->desc,
VTY_NEWLINE);
/* Shutdown. */
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_SHUTDOWN))
vty_out (vty, " neighbor %s shutdown%s", addr, VTY_NEWLINE);
/* Password. */
if (peer->password)
if (!peer_group_active (peer)
|| ! g_peer->password
|| strcmp (peer->password, g_peer->password) != 0)
vty_out (vty, " neighbor %s password %s%s", addr, peer->password,
VTY_NEWLINE);
/* BGP port. */
if (peer->port != BGP_PORT_DEFAULT)
vty_out (vty, " neighbor %s port %d%s", addr, peer->port,
VTY_NEWLINE);
/* Local interface name. */
if (peer->ifname)
vty_out (vty, " neighbor %s interface %s%s", addr, peer->ifname,
VTY_NEWLINE);
/* Passive. */
if (CHECK_FLAG (peer->flags, PEER_FLAG_PASSIVE))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_PASSIVE))
vty_out (vty, " neighbor %s passive%s", addr, VTY_NEWLINE);
/* EBGP multihop. */
if (peer_sort (peer) != BGP_PEER_IBGP && peer->ttl != 1 &&
!(peer->gtsm_hops != 0 && peer->ttl == MAXTTL))
if (! peer_group_active (peer) ||
g_peer->ttl != peer->ttl)
vty_out (vty, " neighbor %s ebgp-multihop %d%s", addr, peer->ttl,
VTY_NEWLINE);
/* ttl-security hops */
if (peer_sort (peer) != BGP_PEER_IBGP && peer->gtsm_hops != 0)
if (! peer_group_active (peer) || g_peer->gtsm_hops != peer->gtsm_hops)
vty_out (vty, " neighbor %s ttl-security hops %d%s", addr,
peer->gtsm_hops, VTY_NEWLINE);
/* <API key>. */
if (CHECK_FLAG (peer->flags, <API key>))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, <API key>))
vty_out (vty, " neighbor %s <API key>%s", addr, VTY_NEWLINE);
/* Update-source. */
if (peer->update_if)
if (! peer_group_active (peer) || ! g_peer->update_if
|| strcmp (g_peer->update_if, peer->update_if) != 0)
vty_out (vty, " neighbor %s update-source %s%s", addr,
peer->update_if, VTY_NEWLINE);
if (peer->update_source)
if (! peer_group_active (peer) || ! g_peer->update_source
|| sockunion_cmp (g_peer->update_source,
peer->update_source) != 0)
vty_out (vty, " neighbor %s update-source %s%s", addr,
sockunion2str (peer->update_source, buf, SU_ADDRSTRLEN),
VTY_NEWLINE);
/* <API key> */
if (CHECK_FLAG (peer->config, <API key>))
vty_out (vty, " neighbor %s <API key> %d%s",
addr, peer->v_routeadv, VTY_NEWLINE);
/* timers. */
if (CHECK_FLAG (peer->config, PEER_CONFIG_TIMER)
&& ! peer_group_active (peer))
vty_out (vty, " neighbor %s timers %d %d%s", addr,
peer->keepalive, peer->holdtime, VTY_NEWLINE);
if (CHECK_FLAG (peer->config, PEER_CONFIG_CONNECT))
vty_out (vty, " neighbor %s timers connect %d%s", addr,
peer->connect, VTY_NEWLINE);
/* Default weight. */
if (CHECK_FLAG (peer->config, PEER_CONFIG_WEIGHT))
if (! peer_group_active (peer) ||
g_peer->weight != peer->weight)
vty_out (vty, " neighbor %s weight %d%s", addr, peer->weight,
VTY_NEWLINE);
/* Dynamic capability. */
if (CHECK_FLAG (peer->flags, <API key>))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, <API key>))
vty_out (vty, " neighbor %s capability dynamic%s", addr,
VTY_NEWLINE);
/* dont capability negotiation. */
if (CHECK_FLAG (peer->flags, <API key>))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, <API key>))
vty_out (vty, " neighbor %s <API key>%s", addr,
VTY_NEWLINE);
/* override capability negotiation. */
if (CHECK_FLAG (peer->flags, <API key>))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, <API key>))
vty_out (vty, " neighbor %s override-capability%s", addr,
VTY_NEWLINE);
/* strict capability negotiation. */
if (CHECK_FLAG (peer->flags, <API key>))
if (! peer_group_active (peer) ||
! CHECK_FLAG (g_peer->flags, <API key>))
vty_out (vty, " neighbor %s <API key>%s", addr,
VTY_NEWLINE);
if (! peer_group_active (peer))
{
if (bgp_flag_check (bgp, <API key>))
{
if (peer->afc[AFI_IP][SAFI_UNICAST])
vty_out (vty, " neighbor %s activate%s", addr, VTY_NEWLINE);
}
else
{
if (! peer->afc[AFI_IP][SAFI_UNICAST])
vty_out (vty, " no neighbor %s activate%s", addr, VTY_NEWLINE);
}
}
}
if (! (afi == AFI_IP && safi == SAFI_UNICAST))
{
if (peer->af_group[afi][safi])
vty_out (vty, " neighbor %s peer-group %s%s", addr,
peer->group->name, VTY_NEWLINE);
else
vty_out (vty, " neighbor %s activate%s", addr, VTY_NEWLINE);
}
/* ORF capability. */
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
|| CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
if (! peer->af_group[afi][safi])
{
vty_out (vty, " neighbor %s capability orf prefix-list", addr);
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
&& CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
vty_out (vty, " both");
else if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
vty_out (vty, " send");
else
vty_out (vty, " receive");
vty_out (vty, "%s", VTY_NEWLINE);
}
/* Route reflector client. */
if (peer_af_flag_check (peer, afi, safi, <API key>)
&& ! peer->af_group[afi][safi])
vty_out (vty, " neighbor %s <API key>%s", addr,
VTY_NEWLINE);
/* Nexthop self. */
if (peer_af_flag_check (peer, afi, safi, <API key>)
&& ! peer->af_group[afi][safi])
vty_out (vty, " neighbor %s next-hop-self%s", addr, VTY_NEWLINE);
/* Remove private AS. */
if (peer_af_flag_check (peer, afi, safi, <API key>)
&& ! peer->af_group[afi][safi])
vty_out (vty, " neighbor %s remove-private-AS%s",
addr, VTY_NEWLINE);
/* send-community print. */
if (! peer->af_group[afi][safi])
{
if (bgp_option_check (<API key>))
{
if (peer_af_flag_check (peer, afi, safi, <API key>)
&& peer_af_flag_check (peer, afi, safi, <API key>))
vty_out (vty, " neighbor %s send-community both%s", addr, VTY_NEWLINE);
else if (peer_af_flag_check (peer, afi, safi, <API key>))
vty_out (vty, " neighbor %s send-community extended%s",
addr, VTY_NEWLINE);
else if (peer_af_flag_check (peer, afi, safi, <API key>))
vty_out (vty, " neighbor %s send-community%s", addr, VTY_NEWLINE);
}
else
{
if (! peer_af_flag_check (peer, afi, safi, <API key>)
&& ! peer_af_flag_check (peer, afi, safi, <API key>))
vty_out (vty, " no neighbor %s send-community both%s",
addr, VTY_NEWLINE);
else if (! peer_af_flag_check (peer, afi, safi, <API key>))
vty_out (vty, " no neighbor %s send-community extended%s",
addr, VTY_NEWLINE);
else if (! peer_af_flag_check (peer, afi, safi, <API key>))
vty_out (vty, " no neighbor %s send-community%s",
addr, VTY_NEWLINE);
}
}
/* Default information */
if (peer_af_flag_check (peer, afi, safi, <API key>)
&& ! peer->af_group[afi][safi])
{
vty_out (vty, " neighbor %s default-originate", addr);
if (peer->default_rmap[afi][safi].name)
vty_out (vty, " route-map %s", peer->default_rmap[afi][safi].name);
vty_out (vty, "%s", VTY_NEWLINE);
}
/* Soft reconfiguration inbound. */
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
if (! peer->af_group[afi][safi] ||
! CHECK_FLAG (g_peer->af_flags[afi][safi], <API key>))
vty_out (vty, " neighbor %s <API key> inbound%s", addr,
VTY_NEWLINE);
/* maximum-prefix. */
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
if (! peer->af_group[afi][safi]
|| g_peer->pmax[afi][safi] != peer->pmax[afi][safi]
|| g_peer->pmax_threshold[afi][safi] != peer->pmax_threshold[afi][safi]
|| CHECK_FLAG (g_peer->af_flags[afi][safi], <API key>)
!= CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
{
vty_out (vty, " neighbor %s maximum-prefix %ld", addr, peer->pmax[afi][safi]);
if (peer->pmax_threshold[afi][safi] != <API key>)
vty_out (vty, " %d", peer->pmax_threshold[afi][safi]);
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
vty_out (vty, " warning-only");
if (peer->pmax_restart[afi][safi])
vty_out (vty, " restart %d", peer->pmax_restart[afi][safi]);
vty_out (vty, "%s", VTY_NEWLINE);
}
/* Route server client. */
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
&& ! peer->af_group[afi][safi])
vty_out (vty, " neighbor %s route-server-client%s", addr, VTY_NEWLINE);
/* Nexthop-local unchanged. */
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
&& ! peer->af_group[afi][safi])
vty_out (vty, " neighbor %s nexthop-local unchanged%s", addr, VTY_NEWLINE);
/* Allow AS in. */
if (peer_af_flag_check (peer, afi, safi, <API key>))
if (! peer_group_active (peer)
|| ! peer_af_flag_check (g_peer, afi, safi, <API key>)
|| peer->allowas_in[afi][safi] != g_peer->allowas_in[afi][safi])
{
if (peer->allowas_in[afi][safi] == 3)
vty_out (vty, " neighbor %s allowas-in%s", addr, VTY_NEWLINE);
else
vty_out (vty, " neighbor %s allowas-in %d%s", addr,
peer->allowas_in[afi][safi], VTY_NEWLINE);
}
/* Filter. */
<API key> (vty, peer, afi, safi);
/* atribute-unchanged. */
if ((CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
|| CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
|| CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
&& ! peer->af_group[afi][safi])
{
if (CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
&& CHECK_FLAG (peer->af_flags[afi][safi], <API key>)
&& CHECK_FLAG (peer->af_flags[afi][safi], <API key>))
vty_out (vty, " neighbor %s attribute-unchanged%s", addr, VTY_NEWLINE);
else
vty_out (vty, " neighbor %s attribute-unchanged%s%s%s%s", addr,
(CHECK_FLAG (peer->af_flags[afi][safi], <API key>)) ?
" as-path" : "",
(CHECK_FLAG (peer->af_flags[afi][safi], <API key>)) ?
" next-hop" : "",
(CHECK_FLAG (peer->af_flags[afi][safi], <API key>)) ?
" med" : "", VTY_NEWLINE);
}
}
/* Display "address-family" configuration header. */
void
<API key> (struct vty *vty, afi_t afi, safi_t safi,
int *write)
{
if (*write)
return;
if (afi == AFI_IP && safi == SAFI_UNICAST)
return;
vty_out (vty, "!%s address-family ", VTY_NEWLINE);
if (afi == AFI_IP)
{
if (safi == SAFI_MULTICAST)
vty_out (vty, "ipv4 multicast");
else if (safi == SAFI_MPLS_VPN)
vty_out (vty, "vpnv4 unicast");
}
else if (afi == AFI_IP6)
{
vty_out (vty, "ipv6");
if (safi == SAFI_MULTICAST)
vty_out (vty, " multicast");
}
vty_out (vty, "%s", VTY_NEWLINE);
*write = 1;
}
/* Address family based peer configuration display. */
static int
<API key> (struct vty *vty, struct bgp *bgp, afi_t afi,
safi_t safi)
{
int write = 0;
struct peer *peer;
struct peer_group *group;
struct listnode *node, *nnode;
<API key> (vty, bgp, afi, safi, &write);
<API key> (vty, bgp, afi, safi, &write);
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
if (group->conf->afc[afi][safi])
{
<API key> (vty, afi, safi, &write);
<API key> (vty, bgp, group->conf, afi, safi);
}
}
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer->afc[afi][safi])
{
if (! CHECK_FLAG (peer->sflags, <API key>))
{
<API key> (vty, afi, safi, &write);
<API key> (vty, bgp, peer, afi, safi);
}
}
}
<API key> (vty, bgp, afi, safi, &write);
if (write)
vty_out (vty, " exit-address-family%s", VTY_NEWLINE);
return write;
}
int
bgp_config_write (struct vty *vty)
{
int write = 0;
struct bgp *bgp;
struct peer_group *group;
struct peer *peer;
struct listnode *node, *nnode;
struct listnode *mnode, *mnnode;
/* BGP Multiple instance. */
if (bgp_option_check (<API key>))
{
vty_out (vty, "bgp multiple-instance%s", VTY_NEWLINE);
write++;
}
/* BGP Config type. */
if (bgp_option_check (<API key>))
{
vty_out (vty, "bgp config-type cisco%s", VTY_NEWLINE);
write++;
}
/* BGP configuration. */
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
if (write)
vty_out (vty, "!%s", VTY_NEWLINE);
/* Router bgp ASN */
vty_out (vty, "router bgp %u", bgp->as);
if (bgp_option_check (<API key>))
{
if (bgp->name)
vty_out (vty, " view %s", bgp->name);
}
vty_out (vty, "%s", VTY_NEWLINE);
/* No Synchronization */
if (bgp_option_check (<API key>))
vty_out (vty, " no synchronization%s", VTY_NEWLINE);
/* BGP <API key>. */
if (CHECK_FLAG (bgp->flags, <API key>))
vty_out (vty, " no bgp <API key>%s", VTY_NEWLINE);
/* BGP router ID. */
if (CHECK_FLAG (bgp->config, <API key>))
vty_out (vty, " bgp router-id %s%s", inet_ntoa (bgp->router_id),
VTY_NEWLINE);
/* BGP <API key>. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp <API key>%s", VTY_NEWLINE);
/* BGP configuration. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp always-compare-med%s", VTY_NEWLINE);
/* BGP default ipv4-unicast. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " no bgp default ipv4-unicast%s", VTY_NEWLINE);
/* BGP default local-preference. */
if (bgp->default_local_pref != <API key>)
vty_out (vty, " bgp default local-preference %d%s",
bgp->default_local_pref, VTY_NEWLINE);
/* BGP client-to-client reflection. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " no bgp client-to-client reflection%s", VTY_NEWLINE);
/* BGP cluster ID. */
if (CHECK_FLAG (bgp->config, <API key>))
vty_out (vty, " bgp cluster-id %s%s", inet_ntoa (bgp->cluster_id),
VTY_NEWLINE);
/* Confederation identifier*/
if (CHECK_FLAG (bgp->config, <API key>))
vty_out (vty, " bgp confederation identifier %i%s", bgp->confed_id,
VTY_NEWLINE);
/* Confederation peer */
if (bgp->confed_peers_cnt > 0)
{
int i;
vty_out (vty, " bgp confederation peers");
for (i = 0; i < bgp->confed_peers_cnt; i++)
vty_out(vty, " %u", bgp->confed_peers[i]);
vty_out (vty, "%s", VTY_NEWLINE);
}
/* BGP enforce-first-as. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp enforce-first-as%s", VTY_NEWLINE);
/* BGP deterministic-med. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp deterministic-med%s", VTY_NEWLINE);
/* BGP graceful-restart. */
if (bgp->stalepath_time != <API key>)
vty_out (vty, " bgp graceful-restart stalepath-time %d%s",
bgp->stalepath_time, VTY_NEWLINE);
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp graceful-restart%s", VTY_NEWLINE);
/* BGP bestpath method. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp bestpath as-path ignore%s", VTY_NEWLINE);
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp bestpath as-path confed%s", VTY_NEWLINE);
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp bestpath compare-routerid%s", VTY_NEWLINE);
if (bgp_flag_check (bgp, BGP_FLAG_MED_CONFED)
|| bgp_flag_check (bgp, <API key>))
{
vty_out (vty, " bgp bestpath med");
if (bgp_flag_check (bgp, BGP_FLAG_MED_CONFED))
vty_out (vty, " confed");
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " missing-as-worst");
vty_out (vty, "%s", VTY_NEWLINE);
}
/* BGP network import check. */
if (bgp_flag_check (bgp, <API key>))
vty_out (vty, " bgp network import-check%s", VTY_NEWLINE);
/* BGP scan interval. */
<API key> (vty);
/* BGP flag dampening. */
if (CHECK_FLAG (bgp->af_flags[AFI_IP][SAFI_UNICAST],
<API key>))
<API key> (vty);
/* BGP static route configuration. */
<API key> (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
/* BGP redistribute configuration. */
<API key> (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
/* BGP timers configuration. */
if (bgp->default_keepalive != <API key>
&& bgp->default_holdtime != <API key>)
vty_out (vty, " timers bgp %d %d%s", bgp->default_keepalive,
bgp->default_holdtime, VTY_NEWLINE);
/* peer-group */
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
<API key> (vty, bgp, group->conf, AFI_IP, SAFI_UNICAST);
}
/* Normal neighbor configuration. */
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (! CHECK_FLAG (peer->sflags, <API key>))
<API key> (vty, bgp, peer, AFI_IP, SAFI_UNICAST);
}
/* maximum-paths */
<API key> (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
/* Distance configuration. */
<API key> (vty, bgp);
/* No auto-summary */
if (bgp_option_check (<API key>))
vty_out (vty, " no auto-summary%s", VTY_NEWLINE);
/* IPv4 multicast configuration. */
write += <API key> (vty, bgp, AFI_IP, SAFI_MULTICAST);
/* IPv4 VPN configuration. */
write += <API key> (vty, bgp, AFI_IP, SAFI_MPLS_VPN);
/* IPv6 unicast configuration. */
write += <API key> (vty, bgp, AFI_IP6, SAFI_UNICAST);
/* IPv6 multicast configuration. */
write += <API key> (vty, bgp, AFI_IP6, SAFI_MULTICAST);
write++;
}
return write;
}
void
bgp_master_init (void)
{
memset (&bgp_master, 0, sizeof (struct bgp_master));
bm = &bgp_master;
bm->bgp = list_new ();
bm->listen_sockets = list_new ();
bm->port = BGP_PORT_DEFAULT;
bm->master = <API key> ();
bm->start_time = bgp_clock ();
}
void
bgp_init (void)
{
/* BGP VTY commands installation. */
bgp_vty_init ();
/* Init kroute. */
bgp_kroute_init ();
/* BGP inits. */
bgp_attr_init ();
bgp_debug_init ();
bgp_dump_init ();
bgp_route_init ();
bgp_route_map_init ();
bgp_scan_init ();
bgp_mplsvpn_init ();
/* Access list initialize. */
access_list_init ();
<API key> (<API key>);
<API key> (<API key>);
/* Filter list initialize. */
bgp_filter_init ();
as_list_add_hook (peer_aslist_update);
as_list_delete_hook (peer_aslist_update);
/* Prefix list initialize.*/
prefix_list_init ();
<API key> (<API key>);
<API key> (<API key>);
/* Community list initialize. */
bgp_clist = community_list_init ();
#ifdef HAVE_SNMP
bgp_snmp_init ();
#endif /* HAVE_SNMP */
}
void
bgp_terminate (void)
{
struct bgp *bgp;
struct peer *peer;
struct listnode *node, *nnode;
struct listnode *mnode, *mnnode;
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
if (peer->status == Established)
bgp_notify_send (peer, BGP_NOTIFY_CEASE,
<API key>);
bgp_cleanup_routes ();
if (bm->process_main_queue)
{
work_queue_free (bm->process_main_queue);
bm->process_main_queue = NULL;
}
if (bm-><API key>)
{
work_queue_free (bm-><API key>);
bm-><API key> = NULL;
}
}
|
#ifndef FLOWLAYOUT_H
#define FLOWLAYOUT_H
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
class FlowLayout : public QLayout
{
public:
FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
void addItem(QLayoutItem *item);
int horizontalSpacing() const;
int verticalSpacing() const;
Qt::Orientations expandingDirections() const;
bool hasHeightForWidth() const;
int heightForWidth(int) const;
int count() const;
QLayoutItem *itemAt(int index) const;
QSize minimumSize() const;
void setGeometry(const QRect &rect);
QSize sizeHint() const;
QLayoutItem *takeAt(int index);
private:
int doLayout(const QRect &rect, bool testOnly) const;
int smartSpacing(QStyle::PixelMetric pm) const;
QList<QLayoutItem *> itemList;
int m_hSpace;
int m_vSpace;
};
#endif
|
@charset "utf-8";
/* CSS Document */
/* Dark Categories */
#<API key>{
background:url(images/categories_bg.png) !important;
border:1px solid #4e4e4e !important;
border-right:0 !important;
border-left:0 !important;
}
#categories ul li a{
color:#fff !important;
text-shadow:1px 1px #000 !important;
border-right:1px solid #2d2d2d !important;
}
#categories .home_first_line{
border-left:1px solid #2d2d2d !important;
}
#categories .home_second_line{
border-left:1px solid #000000 !important;
}
#categories ul li{
border-right:1px solid #000000 !important;
}
#categories ul li a:hover{
background:url(images/categories_bg_hover.png) !important;
color:#ccc !important;
}
#categories .current-cat a{
background:url(images/categories_bg_hover.png) !important;
}
.secondnav-menu ul{
background:#000 !important;
border:1px solid #181818 !important;
}
.secondnav-menu li li a{
border-top:1px solid #181818 !important;
}
#categories ul li ul li a:hover{
background:none !important;
}
|
using Mono.Data.Sqlite;
namespace Noised.Core.DB.Sqlite
{
<summary>
Factory for creating Sqlite connections
</summary>
public interface <API key>
{
<summary>
Creates a new, still closed connection
</summary>
SqliteConnection Create();
};
}
|
module.exports = function(grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copy: {
main: {
expand: true,
cwd: "src/",
src: ["**", "!css*.scss", "!css*.less"],
dest: "dist/"
}
},
less: {
options: {
paths: ["src/css"]
},
src: {
expand: true,
cwd: "src/css",
src: "*.less",
ext: ".css",
dest: "src/css"
}
},
sass: {
dist:{
options:{
style: 'expanded', // values: nested, expanded, compact, compressed
noCache: true
},
files:[{
expand: true,
cwd: "src/css",
src: ["*.scss"],
dest: "src/css",
ext: ".css"
}]
}
},
watch: {
options: {
nospawn: true,
livereload: true
},
less: {
files: ["src/css*.less"],
tasks: ["less"]
},
sass: {
files: ["src/css*.scss"],
tasks: ["sass"]
},
copy: {
|
<div class="toggle-region"></div>
|
<!doctype html public "-
<html>
<head>
<title>PHPXRef 0.7.1 : Unnamed Project : Variable Reference: $<API key></title>
<link rel="stylesheet" href="../sample.css" type="text/css">
<link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">
<style id="hilight" type="text/css"></style>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
<tr>
<td valign="top" class="pagetitle">
[ <a href="../index.html">Index</a> ]
</td>
<td align="right" class="pagetitle">
<h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2>
</td>
</tr>
</table>
<!-- Generated by PHPXref 0.7.1 at Sat Nov 21 22:13:19 2015 -->
<script src="../phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!
ext='.html';
relbase='../';
subdir='_variables';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logVariable('<API key>');
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="../nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
[<a href="../index.html">Top level directory</a>]<br>
<script language="JavaScript" type="text/javascript">
<!
document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');
document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h3>Variable Cross Reference</h3>
<h2><a href="index.html#<API key>">$<API key></a></h2>
<b>Defined at:</b><ul>
<li><a href="../conf/_advanced.php.html">/conf/_advanced.php</A> -> <a href="../conf/_advanced.php.source.html#l661"> line 661</A></li>
</ul>
<br><b>Referenced 6 times:</b><ul>
<li><a href="../inc/files/views/_file_settings.form.php.html">/inc/files/views/_file_settings.form.php</a> -> <a href="../inc/files/views/_file_settings.form.php.source.html#l179"> line 179</a></li>
<li><a href="../inc/files/views/_file_settings.form.php.html">/inc/files/views/_file_settings.form.php</a> -> <a href="../inc/files/views/_file_settings.form.php.source.html#l193"> line 193</a></li>
<li><a href="../inc/files/model/_file.funcs.php.html">/inc/files/model/_file.funcs.php</a> -> <a href="../inc/files/model/_file.funcs.php.source.html#l634"> line 634</a></li>
<li><a href="../inc/files/model/_file.funcs.php.html">/inc/files/model/_file.funcs.php</a> -> <a href="../inc/files/model/_file.funcs.php.source.html#l643"> line 643</a></li>
<li><a href="../inc/files/model/_file.funcs.php.html">/inc/files/model/_file.funcs.php</a> -> <a href="../inc/files/model/_file.funcs.php.source.html#l645"> line 645</a></li>
<li><a href="../conf/_advanced.php.html">/conf/_advanced.php</a> -> <a href="../conf/_advanced.php.source.html#l661"> line 661</a></li>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Sat Nov 21 22:13:19 2015</td>
<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td>
</tr>
</table>
</body></html>
|
/* vi: set sw=4 ts=4: */
#include "libbb.h"
void bb_herror_msg(const char *s, ...)
{
va_list p;
va_start(p, s);
bb_vherror_msg(s, p);
va_end(p);
}
|
#!/usr/bin/python
"feed fetcher"
from db import MySQLDatabase
from fetcher import FeedFetcher
def main():
db = MySQLDatabase()
fetcher = FeedFetcher()
feeds = db.get_feeds(offset=0, limit=10)
read_count = 10
while len(feeds) > 0:
for feed in feeds:
fid = feed[0]
url = feed[1]
title = feed[2]
print "fetching #{0}: {1}".format(fid, url)
entries = fetcher.fetch(url)
for entry in entries:
entry.feed_id = fid
try:
print "insert {0}".format(entry.url)
except UnicodeEncodeError:
print "insert {0}".format(entry.url.encode('utf-8'))
db.append_feed_content(entry)
feeds = db.get_feeds(offset=read_count, limit=10)
read_count += 10
if __name__ == '__main__':
main()
|
package sv.edu.uesocc.ingenieria.disenio2_2015.pymesell.presentacion.<API key>;
/**
*
* @author David
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hola a todos!!!");
}
}
|
<?php
global $post;
$date_format = get_option('date_format');
$author_id=$post->post_author;
$options = ST_Page_Builder::get_page_options($post->ID, array());
?>
<div <?php post_class(); ?>>
<?php
// show thumbnails
if(st_get_setting('<API key>','y')!='n'){
$thumb = <API key>($post->ID,array('force_video_size'=> false), false); ?>
<?php if($thumb!=''){ ?>
<div class="entry-thumbnail main-img">
<?php
echo $thumb;
if (isset($options['count_lessons']) && ($caption = $options['<API key>']) != '')
echo '<p class="lead">'. $caption .'</p>';
?>
</div>
<?php }
}
?>
<div class="entry-content">
<?php
// show the content
if(function_exists('<API key>')){
if(!<API key>($post->ID)){
the_content();
}
}else{
the_content();
}
?>
</div>
<?php
// pagination for single
$args = array(
'before' => '<p class="single-pagination">' . __('Pages:','smooththemes'),
'after' => '</p>',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'nextpagelink' => __('Next page','smooththemes'),
'previouspagelink' => __('Previous page','smooththemes'),
'pagelink' => '%',
'echo' => 1
);
wp_link_pages( $args );
if(st_get_setting('sc_show_post_tag','y')!='n'){
echo get_the_term_list( $post->ID, 'course_category', '<div class="entry-tags"> '.__('Categories: '), ', ', '</div>' );
}
if(st_get_setting("sc_show_author_desc",'y') != 'n'){
<API key>($author_id);
};
if(st_get_setting("sc_show_comments",'y') != 'n'){
?>
<div id="comments">
<?php comments_template('', true ); ?>
</div><!-- /#comments-->
<?php } ?>
</div><!-- /. end post_class -->
|
INTERFACE:
#include "initcalls.h"
#include "types.h"
class Jdb_symbol_info;
class Jdb_lines_info;
class Jdb_dbinfo
{
};
IMPLEMENTATION:
#include "config.h"
// We have to do this here because Jdb_symbol and Jdb_lines must not depend
// on Kmem_alloc.
PRIVATE static inline NOEXPORT
void
Jdb_dbinfo::init_symbols_lines ()
{
Mword p;
p = (sizeof(Jdb_symbol_info)*Jdb_symbol::Max_tasks) >> Config::PAGE_SHIFT;
Jdb_symbol::init(Kmem_alloc::allocator()
->unaligned_alloc(p*Config::PAGE_SIZE), p);
p = (sizeof(Jdb_lines_info) *Jdb_lines::Max_tasks) >> Config::PAGE_SHIFT;
Jdb_lines::init(Kmem_alloc::allocator()
->unaligned_alloc(p*Config::PAGE_SIZE), p);
}
IMPLEMENTATION[ia32,amd64]:
#include "cpu_lock.h"
#include "jdb_lines.h"
#include "jdb_symbol.h"
#include "kmem.h"
#include "kmem_alloc.h"
#include "mem_layout.h"
#include "mem_unit.h"
#include "paging.h"
#include "space.h"
#include "static_init.h"
const Address area_start = Mem_layout::Jdb_debug_start;
const Address area_end = Mem_layout::Jdb_debug_end;
const unsigned area_size = area_end - area_start;
const unsigned bitmap_size = (area_size / Config::PAGE_SIZE) / 8;
// We don't use the amm library here anymore since it is nearly impossible
// to debug it and I got some strange behavior. Instead of this we use a
// simple bitfield here that takes 2k for a virtual memory size of 64MB
// which is enough for the Jdb debug info. Speed for allocating/deallocating
// pages is not an issue here.
static unsigned char bitmap[bitmap_size];
STATIC_INITIALIZE(Jdb_dbinfo);
IMPLEMENTATION[ia32, amd64]:
PUBLIC static FIASCO_INIT
void
Jdb_dbinfo::init()
{
Address addr;
for (addr = area_start; addr < area_end; addr += Config::SUPERPAGE_SIZE)
Kmem::kdir->walk(Virt_addr(addr), 100, pdir_alloc(Kmem_alloc::allocator()));
init_symbols_lines();
}
PRIVATE static
Address
Jdb_dbinfo::reserve_pages(unsigned pages)
{
auto guard = lock_guard(cpu_lock);
Unsigned8 *ptr, bit;
for (ptr=bitmap, bit=0; ptr<bitmap+bitmap_size;)
{
Unsigned8 *ptr1, bit1, c;
unsigned pages1;
for (ptr1=ptr, bit1=bit, pages1=pages;;)
{
if (ptr1>=bitmap+bitmap_size)
return 0;
c = *ptr1 & (1<<bit1);
if (++bit1 >= 8)
{
bit1 = 0;
ptr1++;
}
if (c)
{
ptr = ptr1;
bit = bit1;
break;
}
if (!--pages1)
{
// found area -- make it as reserved
for (ptr1=ptr, bit1=bit, pages1=pages; pages1>0; pages1
{
*ptr1 |= (1<<bit1);
if (++bit1 >= 8)
{
bit1 = 0;
ptr1++;
}
}
return area_start + Config::PAGE_SIZE * (8*(ptr-bitmap) + bit);
}
}
}
return 0;
}
PRIVATE static
void
Jdb_dbinfo::return_pages(Address addr, unsigned pages)
{
auto guard = lock_guard(cpu_lock);
unsigned nr_page = (addr-area_start) / Config::PAGE_SIZE;
Unsigned8 *ptr = bitmap + nr_page/8, bit = nr_page % 8;
for (; pages && ptr < bitmap+bitmap_size; pages
{
assert (*ptr & (1<<bit));
*ptr &= ~(1<<bit);
if (++bit >= 8)
{
bit = 0;
ptr++;
}
}
}
IMPLEMENTATION[ia32, amd64]:
PUBLIC static
bool
Jdb_dbinfo::map(Address phys, size_t &size, Address &virt)
{
Address offs = phys & ~Config::PAGE_MASK;
size = (offs + size + Config::PAGE_SIZE - 1) & Config::PAGE_MASK;
virt = reserve_pages (size / Config::PAGE_SIZE);
if (!virt)
return false;
phys &= Config::PAGE_MASK;
Kmem::kdir->map(phys, Virt_addr(virt), Virt_size(size),
Pt_entry::Valid | Pt_entry::Writable | Pt_entry::Referenced
| Pt_entry::Dirty, 100, Ptab::Null_alloc());
virt += offs;
return true;
}
PUBLIC static
void
Jdb_dbinfo::unmap(Address virt, size_t size)
{
if (virt && size)
{
virt &= Config::PAGE_MASK;
Kmem::kdir->unmap(Virt_addr(virt), Virt_size(size), 100);
Mem_unit::tlb_flush ();
return_pages(virt, size/Config::PAGE_SIZE);
}
}
PUBLIC static
void
Jdb_dbinfo::set(Jdb_symbol_info *sym, Address phys, size_t size)
{
Address virt;
if (!sym)
return;
if (!phys)
{
sym->get (virt, size);
if (! virt)
return;
unmap (virt, size);
sym->reset ();
return;
}
if (! map (phys, size, virt))
return;
if (! sym->set (virt, size))
{
unmap (virt, size);
sym->reset ();
}
}
PUBLIC static
void
Jdb_dbinfo::set(Jdb_lines_info *lin, Address phys, size_t size)
{
Address virt;
if (!lin)
return;
if (!phys)
{
lin->get(virt, size);
if (! virt)
return;
unmap(virt, size);
lin->reset ();
}
if (!map(phys, size, virt))
return;
if (!lin->set(virt, size))
{
unmap(virt, size);
lin->reset();
}
}
IMPLEMENTATION[ux]:
// No special mapping required for UX since all physical memory is mapped
#include "jdb_lines.h"
#include "jdb_symbol.h"
#include "kmem_alloc.h"
#include "mem_layout.h"
#include "static_init.h"
STATIC_INITIALIZE(Jdb_dbinfo);
PUBLIC static
void
Jdb_dbinfo::init()
{
init_symbols_lines();
}
PUBLIC static
void
Jdb_dbinfo::set(Jdb_symbol_info *sym, Address phys, size_t size)
{
if (!sym)
return;
if (!phys)
sym->reset();
else
sym->set(Mem_layout::phys_to_pmem(phys), size);
}
PUBLIC static
void
Jdb_dbinfo::set(Jdb_lines_info *lin, Address phys, size_t size)
{
if (!lin)
return;
if (!phys)
lin->reset();
else
lin->set(Mem_layout::phys_to_pmem(phys), size);
}
|
package org.booleanfloat.traveler.links;
import org.booleanfloat.traveler.Location;
import org.booleanfloat.traveler.interfaces.Traversable;
import java.util.ArrayList;
import java.util.concurrent.Callable;
public class OneWayLink {
public OneWayLink(Location start, Location end) {
this(start, end, new ArrayList<Traversable>(), null);
}
public OneWayLink(Location start, Location end, ArrayList<Traversable> steps) {
this(start, end, steps, null);
}
public OneWayLink(Location start, Location end, ArrayList<Traversable> steps, Callable<Boolean> requirement) {
new Link(start, end, steps, requirement);
}
}
|
<?php
/**
* Template Name: Library
* @package mjv-theme
*/
if (is_home()) :
get_header();
else :
get_header('insiders');
endif;
?>
<div id="primary" class="content-area library">
<main id="main" class="site-main" role="main">
<?php
//carrega os cases, clients e content
get_template_part('template-parts/content', 'library');
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
|
public class trace {
public void mnonnullelements(int[] a) {
int i = 0;
//@ assert i == 0 && \nonnullelements(a);
return ;
}
public void mnotmodified(int i) {
//@ assert \not_modified(i);
i = 4;
//@ assert i == 4 && \not_modified(i);
return ;
}
}
|
for i in range(11):
if (i % 2 == 0):
print(i)
|
# healthydesires.com.au
A Jekyll based website for healthydesires.com.au by [Bradly Sharpe IT](http://bradlysharpe.com.au)
Build Status
[, we query the liveness
// of 'a', because we have a binding for it due to parameter passing.
int f1(int a) {
return 1;
}
void f2() {
int x;
x = f1(1);
}
|
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<?php $this->RenderAsset('Head'); ?>
<meta property="qc:admins" content="<API key>" />
</head>
<body id="<?php echo $BodyIdentifier; ?>" class="<?php echo $this->CssClass; ?>">
<div id="Frame">
<div id="Head">
<div class="Menu">
<h1><a class="Title" href="<?php echo Url('/'); ?>"><span><?php echo Gdn_Theme::Logo(); ?></span></a></h1>
<?php
$Session = Gdn::Session();
if ($this->Menu) {
$this->Menu->AddLink('Dashboard', T('Dashboard'), '/dashboard/settings', array('Garden.Settings.Manage'));
// $this->Menu->AddLink('Dashboard', T('Users'), '/user/browse', array('Garden.Users.Add', 'Garden.Users.Edit', 'Garden.Users.Delete'));
$this->Menu->AddLink('Activity', T('Activity'), '/activity');
if ($Session->IsValid()) {
$Name = $Session->User->Name;
$CountNotifications = $Session->User->CountNotifications;
if (is_numeric($CountNotifications) && $CountNotifications > 0)
$Name .= ' <span class="Alert">'.$CountNotifications.'</span>';
if (urlencode($Session->User->Name) == $Session->User->Name)
$ProfileSlug = $Session->User->Name;
else
$ProfileSlug = $Session->UserID.'/'.urlencode($Session->User->Name);
$this->Menu->AddLink('User', $Name, '/profile/'.$ProfileSlug, array('Garden.SignIn.Allow'), array('class' => 'UserNotifications'));
$this->Menu->AddLink('SignOut', T('Sign Out'), SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));
} else {
$Attribs = array();
if (SignInPopup() && strpos(Gdn::Request()->Url(), 'entry') === FALSE)
$Attribs['class'] = 'SignInPopup';
$this->Menu->AddLink('Entry', T('Sign In'), SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab'), $Attribs);
}
echo $this->Menu->ToString();
}
?>
<div class="Search"><?php
$Form = Gdn::Factory('Form');
$Form->InputPrefix = '';
echo
$Form->Open(array('action' => Url('/search'), 'method' => 'get')),
$Form->TextBox('Search'),
$Form->Button('Go', array('Name' => '')),
$Form->Close();
?></div>
</div>
</div>
<div id="Body">
<div id="Content"><?php $this->RenderAsset('Content'); ?></div>
<div id="Panel"><?php $this->RenderAsset('Panel'); ?></div>
</div>
<div id="Foot">
<?php
$this->RenderAsset('Foot');
echo Wrap(Anchor(T('Powered by Vanilla'), C('Garden.VanillaUrl')), 'div');
?>
</div>
</div>
<?php $this->FireEvent('AfterBody'); ?>
</body>
</html>
|
var ModuleManager = (function(){
//Directorio donde se encuentran los modulos
const BASE_PATH = "js/modules/";
//modules
var modules = {
"templateManager":{
"className":"TemplateManager",
"fileName":"<API key>.js",
"order":1,
"loaded":false,
"dependences":null,
"instance":null
},
"preferences":{
"className":"Preferences",
"fileName":"preferencesModule.js",
"order":1,
"loaded":false,
"dependences":["templateManager"],
"instance":null
},
"logger":{
"className":"Logger",
"fileName":"logModule.js",
"order":2,
"loaded":false,
"dependences":null,
"instance":null
},
"webSpeech":{
"className":"WebSpeech",
"fileName":"webSpeechModule.js",
"order":3,
"loaded":false,
"dependences":null,
"instance":null
},
"utils":{
"className":"Utils",
"fileName":"utils.js",
"order":4,
"loaded":false,
"dependences":null,
"instance":null
},
"serviceLocator":{
"className":"ServiceLocator",
"fileName":"<API key>.js",
"order":3,
"loaded":false,
"dependences":["logger","utils"],
"instance":null
},
"geoLocation":{
"className":"GeoLocation",
"fileName":"geolocationModule.js",
"order":4,
"loaded":false,
"dependences":["serviceLocator"],
"instance":null
},
"notificator":{
"className":"Notificator",
"fileName":"notificationsModule.js",
"order":5,
"loaded":false,
"dependences":["templateManager"],
"instance":null
},
"applicationsManager":{
"className":"ApplicationsManager",
"fileName":"applicationsModule.js",
"order":6,
"loaded":false,
"dependences":["templateManager","serviceLocator","notificator"],
"instance":null
},
"searchs":{
"className":"Searchs",
"fileName":"searchsModule.js",
"order":7,
"loaded":false,
"dependences":["templateManager","serviceLocator","webSpeech","applicationsManager","notificator"],
"instance":null
},
"contacts":{
"className":"Contacts",
"fileName":"contactsModule.js",
"order":8,
"loaded":false,
"dependences":["templateManager","serviceLocator","webSpeech","notificator","geoLocation"],
"instance":null
},
"gui":{
"className":"GUI",
"fileName":"guiModule.js",
"order":9,
"loaded":false,
"dependences":["serviceLocator","searchs","contacts","applicationsManager","notificator"],
"instance":null
}
};
/**
* Devuelve las dependencias a partir de los nombres.
*
* @param {Array} arr: names of the dependencies
* @return {Array} dependencies to bind
*/
var getDependencies = function(arr) {
return arr instanceof Array && arr.length ? arr.map(function (value) {
var o = modules[value] && modules[value].instance;
if (!o) {
throw new Error('Dependency ' + value + ' not found');
}else{
return o;
}
}) : false;
}
/**
* Extrae los nombres de las dependencias a inyectar.
*
* @param {Function} target: function to process
* @return {Array}
*/
var getArgs = function(target) {
if (!target instanceof Function) {
throw new TypeError('Target to process should be a Function');
}else{
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SPACES = /[\s|\t|\n|\r]+/mg;
var result = target.toString().match(FN_ARGS);
//Comprobamos si existe alguna dependencia a inyectar
if(result && result[1])
var args = result[1].replace(COMMENTS,'').replace(SPACES,'').split(',');
else
var args = false;
return args;
}
}
/**
* Crea el objeto con las dependencias previamente inyectadas.
*
* @param {Function} constructor: function to call as constructor
* @return {Object} object created from its constructor
*/
var create = function(constructor) {
var args = getArgs(constructor);
if (args) {
var args = [null].concat(getDependencies(args));
var o = new (Function.prototype.bind.apply(constructor, args))();
}else{
var o = new (Function.prototype.bind.apply(constructor))();
}
return o;
}
var loadScript = function(src, callback) {
var s,r,t;
r = false ;
s = document. createElement ('script' );
s.type = 'text/javascript' ;
s.src = src;
s.onload = s.onreadystatechange = function () {
if ( !r && (!this .readyState || this .readyState == 'complete' )){
r = true ;
typeof(callback) == "function" && callback();
}
};
t = document.<API key> ('script')[0];
t.parentNode.insertBefore (s, t);
}
var downloadModules = function(callback){
console.log(modules);
for(var module in modules)
(function(currentModule){
loadScript(BASE_PATH+currentModule.fileName,function(){
currentModule.loaded = true;
Object.keys(modules).map(function(key){
return modules[key].loaded;
}).indexOf(false) == -1 && typeof(callback) == "function" && callback();
});
})(modules[module]);
}
var loadModules = function(callback){
downloadModules(function(){
for(var module in modules){
console.log("Cargando Módulo : " + modules[module].className);
modules[module].instance = create(window[modules[module].className]);
delete window[modules[module].className];
}
typeof(callback) == "function" && callback();
});
}
return{
loadModules:loadModules
}
})();
|
# ionic-audioguide
An audioguide app with geolocation and media streaming support for the ionic framework
# Howto
These files will not run standalone, you have to create a new ionic app to make use of them. The interesting code is in www/js/controllers.js and www/js/app.js
# Webserver and JSON
You will need a webserver which serves the media files and handles the JSON requests.
# Cordova plugins
Listing of needed cordova plugins in cordova-plugins.txt.
Copyright (c) 2015 Felix Herrmann (github.com/hfx)
Licensed under GPL v2.
Code for the AudiostationsCtrl controller adapted from https:
This part of code is licensed under The MIT license by the original author, please see https://github.com/devgeeks/<API key>
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<title>DOM.Node</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
<link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
</head>
<body>
<div id="container">
<div id="header">
<div id="header_top">
<div>
<div>
<img alt ="" src="../common/top-kde.jpg"/>
KDE 4.9 PyKDE API Reference
</div>
</div>
</div>
<div id="header_bottom">
<div id="location">
<ul>
<li>KDE's Python API</li>
</ul>
</div>
<div id="menu">
<ul>
<li><a href="../modules.html">Overview</a></li>
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
<li><a href="http://kde.org/family/">Sitemap</a></li>
<li><a href="http://kde.org/contact/">Contact Us</a></li>
</ul>
</div>
</div>
</div>
<div id="body_wrapper">
<div id="body">
<div id="right">
<div class="content">
<div id="main">
<div class="clearer"> </div>
<h1>Node Class Reference</h1>
<code>from PyKDE4.khtml import *</code>
<p>
Subclasses: <a href="../khtml/DOM.Document.html">DOM.Document</a>, <a href="../khtml/DOM.DocumentFragment.html">DOM.DocumentFragment</a>, <a href="../khtml/DOM.DocumentType.html">DOM.DocumentType</a>, <a href="../khtml/DOM.Attr.html">DOM.Attr</a>, <a href="../khtml/DOM.Element.html">DOM.Element</a>, <a href="../khtml/DOM.CharacterData.html">DOM.CharacterData</a>, <a href="../khtml/DOM.Entity.html">DOM.Entity</a>, <a href="../khtml/DOM.EntityReference.html">DOM.EntityReference</a>, <a href="../khtml/DOM.Notation.html">DOM.Notation</a>, <a href="../khtml/DOM.<API key>.html">DOM.<API key></a><br />
Namespace: <a href="../khtml/DOM.html">DOM</a><br />
<h2>Detailed Description</h2>
<p>The Node interface is the primary datatype for the
entire Document Object Model. It represents a single node in the
document tree. While all objects implementing the Node
interface expose methods for dealing with children, not all
objects implementing the Node interface may have
children. For example, Text nodes may not have
children, and adding children to such nodes results in a
DOMException being raised.
</p>
<p>
The attributes nodeName , nodeValue
and attributes are included as a mechanism to get at
node information without casting down to the specific derived
interface. In cases where there is no obvious mapping of these
attributes for a specific nodeType (e.g.,
nodeValue for an Element or attributes for a
Comment), this returns null . Note that the
specialized interfaces may contain additional and more convenient
mechanisms to get and set the relevant information.
</p>
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#DocumentPosition">DocumentPosition</a> </td><td class="memItemRight" valign="bottom">{ <API key>, <API key>, <API key>, <API key>, <API key>, <API key> }</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#NodeType">NodeType</a> </td><td class="memItemRight" valign="bottom">{ ELEMENT_NODE, ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, <API key>, ENTITY_NODE, <API key>, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, <API key>, NOTATION_NODE, <API key> }</td></tr>
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Node">__init__</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Node">__init__</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#addEventListener">addEventListener</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> type, <a href="../khtml/DOM.EventListener.html">DOM.EventListener</a> listener, bool useCapture)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#appendChild">appendChild</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> newChild)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#applyChanges">applyChanges</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.NamedNodeMap.html">DOM.NamedNodeMap</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#attributes">attributes</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.NodeList.html">DOM.NodeList</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#childNodes">childNodes</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#cloneNode">cloneNode</a> (self, bool deep)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="#<API key>"><API key></a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#dispatchEvent">dispatchEvent</a> (self, <a href="../khtml/DOM.Event.html">DOM.Event</a> evt)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="#elementId">elementId</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#firstChild">firstChild</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int _x, int _y, int height </td><td class="memItemRight" valign="bottom"><a class="el" href="#getCursor">getCursor</a> (self, int offset)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QRect </td><td class="memItemRight" valign="bottom"><a class="el" href="#getRect">getRect</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#hasAttributes">hasAttributes</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#hasChildNodes">hasChildNodes</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="#index">index</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#insertBefore">insertBefore</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> newChild, <a href="../khtml/DOM.Node.html">DOM.Node</a> refChild)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isNull">isNull</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isSupported">isSupported</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> feature, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> version)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#lastChild">lastChild</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#localName">localName</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#namespaceURI">namespaceURI</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#nextSibling">nextSibling</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#nodeName">nodeName</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#nodeType">nodeType</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#nodeValue">nodeValue</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#normalize">normalize</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#operator !=">operator !=</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#operator ==">operator ==</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Document.html">DOM.Document</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ownerDocument">ownerDocument</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#parentNode">parentNode</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#prefix">prefix</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#previousSibling">previousSibling</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#removeChild">removeChild</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> oldChild)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#removeEventListener">removeEventListener</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> type, <a href="../khtml/DOM.EventListener.html">DOM.EventListener</a> listener, bool useCapture)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#replaceChild">replaceChild</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> newChild, <a href="../khtml/DOM.Node.html">DOM.Node</a> oldChild)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setNodeValue">setNodeValue</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> a0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setPrefix">setPrefix</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> prefix)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setTextContent">setTextContent</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> text)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#textContent">textContent</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="#toHTML">toHTML</a> (self)</td></tr>
</table>
<hr><h2>Method Documentation</h2><a class="anchor" name="Node"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="Node"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="addEventListener"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> addEventListener</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.EventListener.html">DOM.EventListener</a> </td>
<td class="paramname"><em>listener</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>useCapture</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
This method is from the EventTarget interface
</p>
<p>
This method allows the registration of event listeners on the event
target. If an EventListener is added to an EventTarget while it is
processing an event, it will not be triggered by the current actions but
may be triggered during a later stage of event flow, such as the
bubbling phase.
</p>
<p>
If multiple identical EventListeners are registered on the same
EventTarget with the same parameters the duplicate instances are
discarded. They do not cause the EventListener to be called twice and
since they are discarded they do not need to be removed with the
removeEventListener method. Parameters
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> The event type for which the user is registering
</td></tr>
<tr><td></td><td valign="top"><em>listener</em> </td><td> The listener parameter takes an interface implemented by
the user which contains the methods to be called when the event occurs.
</td></tr>
<tr><td></td><td valign="top"><em>useCapture</em> </td><td> If true, useCapture indicates that the user wishes to
initiate capture. After initiating capture, all events of the specified
type will be dispatched to the registered EventListener before being
dispatched to any EventTargets beneath them in the tree. Events which
are bubbling upward through the tree will not trigger an EventListener
designated to use capture.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="appendChild"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> appendChild</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>newChild</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Adds the node newChild to the end of the list of
children of this node. If the newChild is
already in the tree, it is first removed.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>newChild</em> </td><td> The node to add.
</td></tr>
</table></dl>
<p> If it is a DocumentFragment object, the entire
contents of the document fragment are moved into the child list
of this node
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> The node added.
</dd></dl> </p>
<p>
DOMException
<API key>: Raised if this node is of a type that
does not allow children of the type of the newChild
node, or if the node to append is one of this node's
ancestors.
</p>
<p>
WRONG_DOCUMENT_ERR: Raised if newChild was
created from a different document than the one that created
this node.
</p>
<p>
<API key>: Raised if this node is readonly.
</p></div></div><a class="anchor" name="applyChanges"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> applyChanges</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="attributes"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.NamedNodeMap.html">DOM.NamedNodeMap</a> attributes</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>A NamedNodeMap containing the attributes of this
node (if it is an Element ) or null
otherwise.
</p></div></div><a class="anchor" name="childNodes"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.NodeList.html">DOM.NodeList</a> childNodes</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>A NodeList that contains all children of this
node. If there are no children, this is a NodeList
containing no nodes. The content of the returned
NodeList is &quot;live&quot; in the sense that, for
instance, changes to the children of the node object that it
was created from are immediately reflected in the nodes
returned by the NodeList accessors; it is not a
static snapshot of the content of the node. This is true for
every NodeList , including the ones returned by
the <API key> method.
</p></div></div><a class="anchor" name="cloneNode"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> cloneNode</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>deep</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns a duplicate of this node, i.e., serves as a generic
copy constructor for nodes. The duplicate node has no parent (
parentNode returns null .).
</p>
<p>
Cloning an Element copies all attributes and
their values, including those generated by the XML processor to
represent defaulted attributes, but this method does not copy
any text it contains unless it is a deep clone, since the text
is contained in a child Text node. Cloning any
other type of node simply returns a copy of this node.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>deep</em> </td><td> If true , recursively clone the
subtree under the specified node; if false ,
clone only the node itself (and its attributes, if it is an
</td></tr> </table></dl>
<p> Element ).
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> The duplicate node.
</dd></dl>
</p></div></div><a class="anchor" name="<API key>"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">unsigned <API key></td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 3.
</p>
<p>
This method compares the current node's position with that of 'other'
and returns it as a combination of DocumentPosition bitfields.
Here <API key> means that the 'other' is
after the current.
</p>
<p>
The notion of order here is a logical one; for example attributes
are viewed as if they were children of an element inserted
right before the real children. The method will also assign
some total order even if the nodes are not connected.
</p>
<p>
<dl class="since" compact><dt><b>Since:</b></dt><dd> 4.2.4
</dd></dl>
</p></div></div><a class="anchor" name="dispatchEvent"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool dispatchEvent</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Event.html">DOM.Event</a> </td>
<td class="paramname"><em>evt</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
This method is from the EventTarget interface
</p>
<p>
This method allows the dispatch of events into the implementations event
model. Events dispatched in this manner will have the same capturing and
bubbling behavior as events dispatched directly by the implementation.
The target of the event is the EventTarget on which dispatchEvent is
called.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>evt</em> </td><td> Specifies the event type, behavior, and contextual
information to be used in processing the event.
</td></tr>
</table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The return value of dispatchEvent indicates whether any of the
listeners which handled the event called preventDefault. If
preventDefault was called the value is false, else the value is true.
</dd></dl> </p>
<p>
EventException
<API key>: Raised if the Event's type was not specified
by initializing the event before dispatchEvent was called. Specification
of the Event's type as null or an empty string will also trigger this
exception.
</p></div></div><a class="anchor" name="elementId"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">long elementId</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p><dl class="internal" compact><dt><b>Internal:</b></dt><dd>
not part of the DOM.
</dd></dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd> the element id, in case this is an element, 0 otherwise
</dd></dl>
</p></div></div><a class="anchor" name="firstChild"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> firstChild</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The first child of this node. If there is no such node, this
returns null .
</p></div></div><a class="anchor" name="getCursor"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">int _x, int _y, int height getCursor</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>offset</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p><dl class="deprecated" compact><dt><b>Deprecated:</b></dt><dd> without substitution since 3.2
</dd></dl>
</p></div></div><a class="anchor" name="getRect"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QRect getRect</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>not part of the DOM.
<dl class="return" compact><dt><b>Returns:</b></dt><dd> the exact coordinates and size of this element.
</dd></dl>
</p></div></div><a class="anchor" name="hasAttributes"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool hasAttributes</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether this node (if it is an element) has any attributes.
<dl class="return" compact><dt><b>Returns:</b></dt><dd> a boolean. True if this node has any attributes, false otherwise.
Introduced in DOM Level 2
</dd></dl>
</p></div></div><a class="anchor" name="hasChildNodes"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool hasChildNodes</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>This is a convenience method to allow easy determination of
whether a node has any children.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the node has any children,
</dd></dl> false if the node has no children.
</p></div></div><a class="anchor" name="index"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">long index</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p><dl class="internal" compact><dt><b>Internal:</b></dt><dd> returns the index of a node
</dd></dl>
</p></div></div><a class="anchor" name="insertBefore"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> insertBefore</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>newChild</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>refChild</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Inserts the node newChild before the existing
child node refChild . If refChild
is null , insert newChild at the
end of the list of children.
</p>
<p>
If newChild is a DocumentFragment
object, all of its children are inserted, in the same
order, before refChild . If the newChild
is already in the tree, it is first removed.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>newChild</em> </td><td> The node to insert.
</td></tr>
<tr><td></td><td valign="top"><em>refChild</em> </td><td> The reference node, i.e., the node before which
the new node must be inserted.
</td></tr>
</table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The node being inserted.
</dd></dl> </p>
<p>
DOMException
<API key>: Raised if this node is of a type that
does not allow children of the type of the newChild
node, or if the node to insert is one of this node's
ancestors.
</p>
<p>
WRONG_DOCUMENT_ERR: Raised if newChild was
created from a different document than the one that created
this node.
</p>
<p>
<API key>: Raised if this node is readonly.
</p>
<p>
NOT_FOUND_ERR: Raised if refChild is not a
child of this node.
</p></div></div><a class="anchor" name="isNull"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isNull</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>tests if this Node is 0. Useful especially, if casting to a derived
class:
</p>
<p>
<pre class="fragment">
Node n = .....;
// try to convert into an Element:
Element e = n;
if( e.isNull() )
kDebug() << "node isn't an element node";
</pre>
</p></div></div><a class="anchor" name="isSupported"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isSupported</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>feature</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>version</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
</p>
<p>
Tests whether the DOM implementation implements a specific feature and
that feature is supported by this node.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>feature</em> </td><td> The name of the feature to test. This is the same name
which can be passed to the method hasFeature on DOMImplementation.
</td></tr>
<tr><td></td><td valign="top"><em>version</em> </td><td> This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the method
to return true.
</td></tr>
</table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> Returns true if the specified feature is supported on this node,
false otherwise.
</dd></dl>
</p></div></div><a class="anchor" name="lastChild"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> lastChild</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The last child of this node. If there is no such node, this
returns null .
</p></div></div><a class="anchor" name="localName"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> localName</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
</p>
<p>
Returns the local part of the qualified name of this node.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and
nodes created with a DOM Level 1 method, such as createElement from the
Document interface, this is always null.
</p></div></div><a class="anchor" name="namespaceURI"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> namespaceURI</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
</p>
<p>
The namespace URI of this node, or null if it is unspecified.
This is not a computed value that is the result of a namespace lookup
based on an examination of the namespace declarations in scope. It is
merely the namespace URI given at creation time. For nodes of any type
other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM
Level 1 method, such as createElement from the Document interface, this
is always null.
</p>
<p>
Note: Per the Namespaces in XML Specification [Namespaces] an attribute
does not inherit its namespace from the element it is attached to. If an
attribute is not explicitly given a namespace, it simply has no
namespace.
</p></div></div><a class="anchor" name="nextSibling"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> nextSibling</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The node immediately following this node. If there is no such
node, this returns null .
</p></div></div><a class="anchor" name="nodeName"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> nodeName</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The name of this node, depending on its type; see the table
above.
</p></div></div><a class="anchor" name="nodeType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">int nodeType</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>A code representing the type of the underlying object, as
defined above.
</p></div></div><a class="anchor" name="nodeValue"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> nodeValue</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The value of this node, depending on its type; see the table
above.
</p>
<p>
DOMException
DOMSTRING_SIZE_ERR: Raised when it would return more characters
than fit in a DOMString variable on the
implementation platform.
</p></div></div><a class="anchor" name="normalize"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> normalize</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Modified in DOM Level 2
</p>
<p>
Puts all Text nodes in the full depth of the sub-tree underneath this
Node, including attribute nodes, into a "normal" form where only
structure (e.g., elements, comments, processing instructions, CDATA
sections, and entity references) separates Text nodes, i.e., there are
neither adjacent Text nodes nor empty Text nodes. This can be used to
ensure that the DOM view of a document is the same as if it were saved
and re-loaded, and is useful when operations (such as XPointer
[XPointer] lookups) that depend on a particular document tree structure
are to be used.
</p>
<p>
Note: In cases where the document contains CDATASections, the normalize
operation alone may not be sufficient, since XPointers do not
differentiate between Text nodes and CDATASection nodes.
</p></div></div><a class="anchor" name="operator !="></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator !=</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="operator =="></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator ==</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="ownerDocument"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Document.html">DOM.Document</a> ownerDocument</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The Document object associated with this node.
This is also the Document object used to create
new nodes. When this node is a Document this is
null .
</p></div></div><a class="anchor" name="parentNode"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> parentNode</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The parent of this node. All nodes, except Document
, DocumentFragment , and Attr
may have a parent. However, if a node has just been
created and not yet added to the tree, or if it has been
removed from the tree, this is null .
</p></div></div><a class="anchor" name="prefix"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> prefix</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
</p>
<p>
The namespace prefix of this node, or null if it is unspecified.
Note that setting this attribute, when permitted, changes the nodeName
attribute, which holds the qualified name, as well as the tagName and
name attributes of the Element and Attr interfaces, when applicable.
Note also that changing the prefix of an attribute that is known to have
a default value, does not make a new attribute with the default value
and the original prefix appear, since the namespaceURI and localName do
not change.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and
nodes created with a DOM Level 1 method, such as createElement from the
Document interface, this is always null.
</p></div></div><a class="anchor" name="previousSibling"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> previousSibling</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>The node immediately preceding this node. If there is no such
node, this returns null .
</p></div></div><a class="anchor" name="removeChild"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> removeChild</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>oldChild</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Removes the child node indicated by oldChild
from the list of children, and returns it.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>oldChild</em> </td><td> The node being removed.
</td></tr>
</table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The node removed.
</dd></dl> </p>
<p>
DOMException
<API key>: Raised if this node is readonly.
</p>
<p>
NOT_FOUND_ERR: Raised if oldChild is not a
child of this node.
</p></div></div><a class="anchor" name="removeEventListener"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> removeEventListener</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.EventListener.html">DOM.EventListener</a> </td>
<td class="paramname"><em>listener</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>useCapture</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 2
This method is from the EventTarget interface
</p>
<p>
This method allows the removal of event listeners from the event target.
If an EventListener is removed from an EventTarget while it is
processing an event, it will not be triggered by the current actions.
</p>
<p>
EventListeners can never be invoked after being removed.
</p>
<p>
Calling removeEventListener with arguments which do not identify any
currently registered EventListener on the EventTarget has no effect.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>type</em> </td><td> Specifies the event type of the EventListener being removed.
</td></tr>
<tr><td></td><td valign="top"><em>listener</em> </td><td> The EventListener parameter indicates the EventListener
to be removed.
</td></tr>
<tr><td></td><td valign="top"><em>useCapture</em> </td><td> Specifies whether the EventListener being removed was
registered as a capturing listener or not. If a listener was registered
twice, one with capture and one without, each must be removed
separately. Removal of a capturing listener does not affect a
non-capturing version of the same listener, and vice versa.
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="replaceChild"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> replaceChild</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>newChild</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td>
<td class="paramname"><em>oldChild</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Replaces the child node oldChild with
newChild in the list of children, and returns the
oldChild node. If the newChild is
already in the tree, it is first removed.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>newChild</em> </td><td> The new node to put in the child list.
</td></tr>
<tr><td></td><td valign="top"><em>oldChild</em> </td><td> The node being replaced in the list.
</td></tr>
</table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The node replaced.
</dd></dl> </p>
<p>
DOMException
<API key>: Raised if this node is of a type that
does not allow children of the type of the newChild
node, or it the node to put in is one of this node's
ancestors.
</p>
<p>
WRONG_DOCUMENT_ERR: Raised if newChild was
created from a different document than the one that created
this node.
</p>
<p>
<API key>: Raised if this node is readonly.
</p>
<p>
NOT_FOUND_ERR: Raised if oldChild is not a
child of this node.
</p></div></div><a class="anchor" name="setNodeValue"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setNodeValue</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>a0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>see nodeValue
DOMException
<API key>: Raised when the node is readonly.
</p></div></div><a class="anchor" name="setPrefix"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setPrefix</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>prefix</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>see prefix
</p>
<p>
DOMException
<API key>: Raised if the specified prefix contains an
illegal character.
</p>
<p>
<API key>: Raised if this node is readonly.
</p>
<p>
NAMESPACE_ERR: Raised if the specified prefix is malformed, if the
namespaceURI of this node is null, if the specified prefix is "xml" and
the namespaceURI of this node is different from
"http:
the specified prefix is "xmlns" and the namespaceURI of this node is
different from "http:
attribute and the qualifiedName of this node is "xmlns" [Namespaces].
</p></div></div><a class="anchor" name="setTextContent"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setTextContent</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td>
<td class="paramname"><em>text</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>see textContent()
</p>
<p>
DOMException
<API key>: Raised when the node is readonly.
</p></div></div><a class="anchor" name="textContent"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> textContent</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 3
</p>
<p>
This attribute returns the text content of this node and its
descendants. When it is defined to be null, setting it has no
effect. On setting, any possible children this node may have
are removed and, if it the new string is not empty or null,
replaced by a single Text node containing the string this
attribute is set to.
On getting, no serialization is performed, the returned string
does not contain any markup. No whitespace normalization is
performed and the returned string does not contain the white
spaces in element content (see the attribute
Text.<API key>). Similarly, on setting, no
parsing is performed either, the input string is taken as pure
textual content.
</p></div></div><a class="anchor" name="toHTML"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QString toHTML</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="DocumentPosition"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">DocumentPosition</td>
</tr>
</table>
</div>
<div class="memdoc"><p>Introduced in DOM Level 3.
</p>
<p>
These constants represent bitflags returned by the <API key>
method.
</p>
<p>
<dl class="since" compact><dt><b>Since:</b></dt><dd> 4.2.4
</dd></dl>
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em><API key></em> = 0x01</td><td><tr><td valign="top"><em><API key></em> = 0x02</td><td><tr><td valign="top"><em><API key></em> = 0x04</td><td><tr><td valign="top"><em><API key></em> = 0x08</td><td><tr><td valign="top"><em><API key></em> = 0x10</td><td><tr><td valign="top"><em><API key></em> = 0x20</td><td></table>
</dl>
</div></div><p><a class="anchor" name="NodeType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">NodeType</td>
</tr>
</table>
</div>
<div class="memdoc"><p>An integer indicating which type of node this is.
</p>
<p>
<p>The values of nodeName, nodeValue,
and attributes vary according to the node type as follows:
<table border="1">
<tr>
<td></td>
<td>nodeName</td>
<td>nodeValue</td>
<td>attributes</td>
</tr>
<tr>
<td>Element</td>
<td>tagName</td>
<td>null</td>
<td>NamedNodeMap</td>
</tr>
<tr>
<td>Attr</td>
<td>name of attribute</td>
<td>value of attribute</td>
<td>null</td>
</tr>
<tr>
<td>Text</td>
<td>#text</td>
<td>content of the text node</td>
<td>null</td>
</tr>
<tr>
<td>CDATASection</td>
<td>#cdata-section</td>
<td>content of the CDATA Section</td>
<td>null</td>
</tr>
<tr>
<td>EntityReference</td>
<td>name of entity referenced</td>
<td>null</td>
<td>null</td>
</tr>
<tr>
<td>Entity</td>
<td>entity name</td>
<td>null</td>
<td>null</td>
</tr>
<tr>
<td><API key></td>
<td>target</td>
<td>entire content excluding the target</td>
<td>null</td>
</tr>
<tr>
<td>Comment</td>
<td>#comment</td>
<td>content of the comment</td>
<td>null</td>
</tr>
<tr>
<td>Document</td>
<td>#document</td>
<td>null</td>
<td>null</td>
</tr>
<tr>
<td>DocumentType</td>
<td>document type name</td>
<td>null</td>
<td>null</td>
</tr>
<tr>
<td>DocumentFragment</td>
<td>#document-fragment</td>
<td>null</td>
<td>null</td>
</tr>
<tr>
<td>Notation</td>
<td>notation name</td>
<td>null</td>
<td>null</td>
</tr>
</table>
</p>
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>ELEMENT_NODE</em> = 1</td><td><tr><td valign="top"><em>ATTRIBUTE_NODE</em> = 2</td><td><tr><td valign="top"><em>TEXT_NODE</em> = 3</td><td><tr><td valign="top"><em>CDATA_SECTION_NODE</em> = 4</td><td><tr><td valign="top"><em><API key></em> = 5</td><td><tr><td valign="top"><em>ENTITY_NODE</em> = 6</td><td><tr><td valign="top"><em><API key></em> = 7</td><td><tr><td valign="top"><em>COMMENT_NODE</em> = 8</td><td><tr><td valign="top"><em>DOCUMENT_NODE</em> = 9</td><td><tr><td valign="top"><em>DOCUMENT_TYPE_NODE</em> = 10</td><td><tr><td valign="top"><em><API key></em> = 11</td><td><tr><td valign="top"><em>NOTATION_NODE</em> = 12</td><td><tr><td valign="top"><em><API key></em> = 13</td><td></table>
</dl>
</div></div><p>
</div>
</div>
</div>
<div id="left">
<div class="menu_box">
<div class="nav_list">
<ul>
<li><a href="../allclasses.html">Full Index</a></li>
</ul>
</div>
<a name="cp-menu" /><div class="menutitle"><div>
<h2 id="cp-menu-project">Modules</h2>
</div></div>
<div class="nav_list">
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
<li><a href="../dnssd/index.html">dnssd</a></li>
<li><a href="../kdecore/index.html">kdecore</a></li>
<li><a href="../kdeui/index.html">kdeui</a></li>
<li><a href="../khtml/index.html">khtml</a></li>
<li><a href="../kio/index.html">kio</a></li>
<li><a href="../knewstuff/index.html">knewstuff</a></li>
<li><a href="../kparts/index.html">kparts</a></li>
<li><a href="../kutils/index.html">kutils</a></li>
<li><a href="../nepomuk/index.html">nepomuk</a></li>
<li><a href="../phonon/index.html">phonon</a></li>
<li><a href="../plasma/index.html">plasma</a></li>
<li><a href="../polkitqt/index.html">polkitqt</a></li>
<li><a href="../solid/index.html">solid</a></li>
<li><a href="../soprano/index.html">soprano</a></li>
</ul></div></div>
</div>
</div>
<div class="clearer"/>
</div>
<div id="end_body"></div>
</div>
<div id="footer"><div id="footer_text">
This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br />
KDE<sup>&
<a href="http:
</div></div>
</body>
</html>
|
<?php
class Td
{
/**
* contains all setted attributes
* @var array
*/
private $attrs = array();
/**
* keeps content
* @var string
*/
private $content = null;
/**
* holds markup name
* @var string
*/
private static $markupName = 'td';
/**
* tells is this markup can handle content
* @var bool
*/
private static $isContenerable = true;
/**
* __construct() - can add content to tag
* @param null|string $content
* @return Td
*/
public function __construct($content = null)
{
$argumentsNumber = func_num_args();
for ($i = 0; $i < $argumentsNumber; $i++) {
$this->addContent(func_get_arg($i));
}
}
/**
* renders tag and it content to string
* @param null|string $content
* @return Td
*/
public static function getInstance($content = null)
{
$markupTag = new Td;
$argumentsNumber = func_num_args();
for ($i = 0; $i < $argumentsNumber; $i++) {
$markupTag->addContent(func_get_arg($i));
}
return $markupTag;
}
/**
* adds content to tag
* @param null|string $content
* @return Td
*/
public function addContent($content = null)
{
$this->content .= (string) $content;
return $this;
}
/**
* renders tag and it content to string
* @return string
*/
public function __toString()
{
$parsedAttrs = '';
foreach ($this->attrs as $attrName => $attrValue) {
$parsedAttrs .= ' '.$attrName.'=\''.$attrValue.'\'';
}
return '<'.self::$markupName.$parsedAttrs.'>'.$this->content.'</'.self::$markupName.'>';
}
/**
* sets abbr attribute
* @param null|string $value
* @return Td
*/
public function abbr($value = null)
{
$this->attrs['abbr'] = $value;
return $this;
}
/**
* sets align attribute
* @param null|string $value
* @return Td
*/
public function align($value = null)
{
$this->attrs['align'] = $value;
return $this;
}
/**
* sets axis attribute
* @param null|string $value
* @return Td
*/
public function axis($value = null)
{
$this->attrs['axis'] = $value;
return $this;
}
/**
* sets char attribute
* @param null|string $value
* @return Td
*/
public function char($value = null)
{
$this->attrs['char'] = $value;
return $this;
}
/**
* sets charoff attribute
* @param null|string $value
* @return Td
*/
public function charoff($value = null)
{
$this->attrs['charoff'] = $value;
return $this;
}
/**
* sets colspan attribute
* @param null|string $value
* @return Td
*/
public function colspan($value = null)
{
$this->attrs['colspan'] = $value;
return $this;
}
/**
* sets headers attribute
* @param null|string $value
* @return Td
*/
public function headers($value = null)
{
$this->attrs['headers'] = $value;
return $this;
}
/**
* sets rowspan attribute
* @param null|string $value
* @return Td
*/
public function rowspan($value = null)
{
$this->attrs['rowspan'] = $value;
return $this;
}
/**
* sets scope attribute
* @param null|string $value
* @return Td
*/
public function scope($value = null)
{
$this->attrs['scope'] = $value;
return $this;
}
/**
* sets valign attribute
* @param null|string $value
* @return Td
*/
public function valign($value = null)
{
$this->attrs['valign'] = $value;
return $this;
}
/**
* sets classes attribute
* @param null|string $value
* @return Td
*/
public function classes($value = null)
{
$this->attrs['class'] = $value;
return $this;
}
/**
* sets dir attribute
* @param null|string $value
* @return Td
*/
public function dir($value = null)
{
$this->attrs['dir'] = $value;
return $this;
}
/**
* sets id attribute
* @param null|string $value
* @return Td
*/
public function id($value = null)
{
$this->attrs['id'] = $value;
return $this;
}
/**
* sets lang attribute
* @param null|string $value
* @return Td
*/
public function lang($value = null)
{
$this->attrs['lang'] = $value;
return $this;
}
/**
* sets style attribute
* @param null|string $value
* @return Td
*/
public function style($value = null)
{
$this->attrs['style'] = $value;
return $this;
}
/**
* sets title attribute
* @param null|string $value
* @return Td
*/
public function title($value = null)
{
$this->attrs['title'] = $value;
return $this;
}
/**
* sets xmlLang attribute
* @param null|string $value
* @return Td
*/
public function xmlLang($value = null)
{
$this->attrs['xml:lang'] = $value;
return $this;
}
/**
* sets onclick attribute
* @param null|string $value
* @return Td
*/
public function onclick($value = null)
{
$this->attrs['onclick'] = $value;
return $this;
}
/**
* sets ondblclick attribute
* @param null|string $value
* @return Td
*/
public function ondblclick($value = null)
{
$this->attrs['ondblclick'] = $value;
return $this;
}
/**
* sets onmousedown attribute
* @param null|string $value
* @return Td
*/
public function onmousedown($value = null)
{
$this->attrs['onmousedown'] = $value;
return $this;
}
/**
* sets onmousemove attribute
* @param null|string $value
* @return Td
*/
public function onmousemove($value = null)
{
$this->attrs['onmousemove'] = $value;
return $this;
}
/**
* sets onmouseout attribute
* @param null|string $value
* @return Td
*/
public function onmouseout($value = null)
{
$this->attrs['onmouseout'] = $value;
return $this;
}
/**
* sets onmouseover attribute
* @param null|string $value
* @return Td
*/
public function onmouseover($value = null)
{
$this->attrs['onmouseover'] = $value;
return $this;
}
/**
* sets onmouseup attribute
* @param null|string $value
* @return Td
*/
public function onmouseup($value = null)
{
$this->attrs['onmouseup'] = $value;
return $this;
}
/**
* sets onkeydown attribute
* @param null|string $value
* @return Td
*/
public function onkeydown($value = null)
{
$this->attrs['onkeydown'] = $value;
return $this;
}
/**
* sets onkeypress attribute
* @param null|string $value
* @return Td
*/
public function onkeypress($value = null)
{
$this->attrs['onkeypress'] = $value;
return $this;
}
/**
* sets onkeyup attribute
* @param null|string $value
* @return Td
*/
public function onkeyup($value = null)
{
$this->attrs['onkeyup'] = $value;
return $this;
}
}
?>
|
var SPHERE = {
getSphereVertex: function (radius, res) {
var vertexData = [], alpha, beta, x, y, z, u, v;
for (var i = 0; i <= res; i++) { // Se recorren las latitudes
alpha = i * Math.PI / res;
for (var j = 0; j <= res; j++) { // Se recorren las longitudes
beta = j * 2 * Math.PI / res;
x = Math.cos(beta) * Math.sin(alpha);
y = Math.cos(alpha);
z = Math.sin(beta) * Math.sin(alpha);
u = 1 - (j / res);
v = 1 - (i / res);
vertexData.push(radius * x);
vertexData.push(radius * y);
vertexData.push(radius * z);
// Normales
vertexData.push(x);
vertexData.push(y);
vertexData.push(z);
// Coordenadas de textura
vertexData.push(u);
vertexData.push(v);
}
}
return vertexData;
},
getShereFaces: function (res) {
var indexData = [], first, second;
for (var i = 0; i < res; i++) { // Se recorren las latitudes
for (var j = 0; j < res; j++) { // Se recorren las longitudes
first = (i * (res + 1)) + j;
second = first + res + 1;
// Cara par
indexData.push(first); // Esquina superior izquierda
indexData.push(second); // Esquina inferior izquierda
indexData.push(first + 1); // Esquina superior derecha
// Cara impar
indexData.push(second); // Esquina inferior izquierda
indexData.push(second + 1); // Esquina inferior derecha
indexData.push(first + 1); // Esquina superior derecha
}
}
return indexData;
}
};
|
package org.sylvani.io.voice.http;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.emf.common.util.EList;
import org.eclipse.smarthome.model.sitemap.Sitemap;
import org.eclipse.smarthome.model.sitemap.SitemapProvider;
import org.eclipse.smarthome.model.sitemap.Widget;
import org.eclipse.smarthome.ui.items.ItemUIRegistry;
/**
* Varianten
* - Simple and Stupid HAL9000
* - Volltext
* - Tagged Analyse
*
* @author hkuhn
*
*/
public class <API key> extends HttpServlet {
private static final long serialVersionUID = 1L;
private ItemUIRegistry itemUIRegistry;
private List<SitemapProvider> sitemaps;
public <API key>(ItemUIRegistry itemUIRegistry, List<SitemapProvider> sitemaps) {
this.itemUIRegistry = itemUIRegistry;
this.sitemaps = sitemaps;
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
for (SitemapProvider sitemapProvider : sitemaps) {
for (String sitemapName : sitemapProvider.getSitemapNames()) {
System.out.println("sitemap " + sitemapName);
Sitemap sitemap = sitemapProvider.getSitemap(sitemapName);
EList<Widget> list = sitemap.getChildren();
for (Widget widget : list) {
System.out.println("#Widget " + widget.getLabel() + " " + widget.getItem());
}
}
}
}
}
|
class Class3_Sub28 extends Class3 {
static Class94[] aClass94Array2566 = new Class94[200];
static int anInt2567 = -1;
private static Class94 aClass94_2568 = Class3_Sub4.buildString("Started 3d Library");
long aLong2569;
Class3_Sub28 aClass3_Sub28_2570;
static int anInt2571;
static int anInt2572;
static Class153 aClass153_2573;
static int[] anIntArray2574 = new int[14];
static int anInt2575;
static Class94 aClass94_2576 = aClass94_2568;
static int anInt2577 = 0;
Class3_Sub28 aClass3_Sub28_2578;
static final void method518(Class140_Sub4_Sub1 var0, int var1) {
try {
Class3_Sub9 var2 = (Class3_Sub9)<API key>.aClass130_4046.method1780(var0.aClass94_3967.method1578(-121), 0);
if(var1 >= -85) {
method523(40, -17, -52, -32, 9, -51, -85, -84, -19);
}
if(var2 != null) {
var2.method134(1);
} else {
Class70.method1286(var0.anIntArray2755[0], false, (Class111)null, 0, (Class140_Sub4_Sub2)null, var0.anIntArray2767[0], Class26.anInt501, var0);
}
} catch (RuntimeException var3) {
throw Class44.method1067(var3, "rg.UA(" + (var0 != null?"{...}":"null") + ',' + var1 + ')');
}
}
static final int method519(int var0, boolean var1, int var2, int var3) {
try {
var0 &= 3;
if(!var1) {
method520((byte)-89);
}
return 0 != var0?(~var0 != -2?(~var0 == -3?-var3 + 7:-var2 + 7):var2):var3;
} catch (RuntimeException var5) {
throw Class44.method1067(var5, "rg.RA(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ')');
}
}
static final Class3_Sub28_Sub3 method520(byte var0) {
try {
int var1 = -122 % ((var0 - -48) / 33);
return Class3_Sub30.<API key>;
} catch (RuntimeException var2) {
throw Class44.method1067(var2, "rg.OA(" + var0 + ')');
}
}
public static void method521(int var0) {
try {
aClass153_2573 = null;
if(var0 == -3) {
aClass94Array2566 = null;
aClass94_2568 = null;
anIntArray2574 = null;
aClass94_2576 = null;
}
} catch (RuntimeException var2) {
throw Class44.method1067(var2, "rg.QA(" + var0 + ')');
}
}
static final Class90 method522(int var0, int var1) {
try {
Class90 var2 = (Class90)<API key>.aClass93_4043.method1526((long)var0, (byte)121);
if(null == var2) {
byte[] var3 = Class29.aClass153_557.method2133(Class38_Sub1.method1031(var0, 2), (byte)-122, Canvas_Sub1.method54(var0, false));
var2 = new Class90();
if(var1 != 27112) {
anInt2572 = -67;
}
var2.anInt1284 = var0;
if(null != var3) {
var2.method1478(new Class3_Sub30(var3), 74);
}
var2.method1481(98);
<API key>.aClass93_4043.method1515((byte)-95, var2, (long)var0);
return var2;
} else {
return var2;
}
} catch (RuntimeException var4) {
throw Class44.method1067(var4, "rg.PA(" + var0 + ',' + var1 + ')');
}
}
static final void method523(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) {
try {
int var9 = var3 - var8;
int var11 = (-var5 + var0 << 16) / var9;
int var10 = -var4 + var6;
int var12 = (var7 + -var1 << 16) / var10;
Class83.method1410(var1, 0, var6, var4, var3, var5, var8, var12, var11, var2, -12541);
} catch (RuntimeException var13) {
throw Class44.method1067(var13, "rg.SA(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ')');
}
}
final void method524(byte var1) {
try {
if(this.aClass3_Sub28_2570 != null) {
this.aClass3_Sub28_2570.aClass3_Sub28_2578 = this.aClass3_Sub28_2578;
this.aClass3_Sub28_2578.aClass3_Sub28_2570 = this.aClass3_Sub28_2570;
this.aClass3_Sub28_2578 = null;
this.aClass3_Sub28_2570 = null;
if(var1 != -107) {
this.aClass3_Sub28_2578 = (Class3_Sub28)null;
}
}
} catch (RuntimeException var3) {
throw Class44.method1067(var3, "rg.TA(" + var1 + ')');
}
}
}
|
#include <boost/assign.hpp>
#include "EncodeBufr302053.h"
EncodeBufr302053::
EncodeBufr302053()
{
}
std::string
EncodeBufr302053::
logIdentifier() const
{
return "302053";
}
std::list<int>
EncodeBufr302053::
encodeIds()const
{
std::list<int> ids;
boost::assign::push_back( ids )(302053);
return ids;
}
void
EncodeBufr302053::
encode( )
{
bufr->addValue( 7032, stationInfo->heightVisability(), "h_V, height of visibility sensor above marine deck.", false );
bufr->addValue( 7033, FLT_MAX, "h_V, height of visibility sensor above water surface.", false );
bufr->addValue( 20001, data->VV, "VV, horisental visibility" );
}
|
using System;
namespace WIC
{
public enum DXGI_FORMAT
{
DXGI_FORMAT_UNKNOWN,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
DXGI_FORMAT_R8_UINT,
<API key>,
DXGI_FORMAT_R8_SINT,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
DXGI_FORMAT_AYUV,
DXGI_FORMAT_Y410,
DXGI_FORMAT_Y416,
DXGI_FORMAT_NV12,
DXGI_FORMAT_P010,
DXGI_FORMAT_P016,
<API key>,
DXGI_FORMAT_YUY2,
DXGI_FORMAT_Y210,
DXGI_FORMAT_Y216,
DXGI_FORMAT_NV11,
DXGI_FORMAT_AI44,
DXGI_FORMAT_IA44,
DXGI_FORMAT_P8,
DXGI_FORMAT_A8P8,
<API key>,
<API key> = -1
}
}
|
//#define FMT_DEBUG
#undef FMT_DEBUG
#include "includefirst.hpp"
#include "basegdl.hpp"
#include "fmtnode.hpp"
#include "print_tree.hpp"
#include "FMTLexer.hpp"
#include "FMTParser.hpp"
#include <antlr/ASTFactory.hpp>
using namespace std;
antlr::ASTFactory FMTNodeFactory("FMTNode",FMTNode::factory);
RefFMTNode GetFMTAST( DString fmtString)
{
istringstream istr(fmtString);
RefFMTNode fmtAST;
try {
antlr::TokenStreamSelector selector;
FMTLexer lexer( istr);
lexer.SetSelector( selector);
CFMTLexer cLexer( lexer.getInputState());
cLexer.SetSelector( selector);
lexer.SetCLexer( cLexer);
selector.select( &lexer);
FMTParser parser( selector);
// because we use the standard (ANTLR generated) constructor here
// we cannot do it in the constructor
parser.<API key>( FMTNodeFactory);
parser.setASTFactory( &FMTNodeFactory );
parser.format( 1);
fmtAST=parser.getAST();
#ifdef FMT_DEBUG
antlr::print_tree pt;
pt.pr_tree(static_cast<antlr::RefAST>(fmtAST));
cout << endl;
#endif
}
catch( GDLException& ex)
{
throw GDLException("Format: "+ex.getMessage());
}
catch( antlr::ANTLRException& ex)
{
throw GDLException("Format parser: "+ex.getMessage());
}
catch( exception& ex)
{
throw GDLException("Format exception: "+string(ex.what()));
}
catch(...)
{
throw GDLException("Format: general exception.");
}
return fmtAST;
}
|
# \brief Download and unpack upstream library source codes
# \author Norman Feske
# \date 2009-10-16
# Print help information by default
help::
VERBOSE ?= @
ECHO = @echo
DOWNLOAD_DIR = download
CONTRIB_DIR = contrib
GNU_FIND = find
SHELL = bash
# Create download and contrib directory so that '<port>.mk' files
# do not need to care for them.
prepare:: $(DOWNLOAD_DIR) $(CONTRIB_DIR)
# Utility to check if a tool is installed
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
$(call check_tool,wget)
$(call check_tool,patch)
# Include information about available ports
# Each '<port>.mk' file in the 'ports/' directory extends the following
# variables:
# PORTS - list names of the available ports, e.g., 'freetype-2.3.9'
# GEN_DIRS - list of automatically generated directories
# GEN_FILES - list of automatically generated files
# Furthermore, each '<port>.mk' file extends the 'prepare' rule for
# downloading and unpacking the corresponding upstream sources.
PKG ?= *
include $(addprefix ports/,$(addsuffix .mk,$(PKG)))
help::
$(ECHO) ""
$(ECHO) "Download and unpack upstream source codes:"
@for i in $(PORTS); do echo " $$i"; done
$(ECHO) ""
$(ECHO) "Downloads will be placed into the '$(DOWNLOAD_DIR)/' directory."
$(ECHO) "Source codes will be unpacked in the '$(CONTRIB_DIR)/' directory."
$(ECHO) ""
$(ECHO) "
$(ECHO) "prepare - download and unpack upstream source codes"
$(ECHO) "clean - remove upstream source codes"
$(ECHO) "cleanall - remove upstream source codes and downloads"
$(ECHO) ""
$(ECHO) "
$(ECHO) "PKG=<package-list> - prepare only the specified packages,"
$(ECHO) " each package specified w/o version number"
# Remove download and contrib directories if empty
prepare::
$(VERBOSE)$(GNU_FIND) $(DOWNLOAD_DIR) -depth -type d -empty -delete
$(VERBOSE)$(GNU_FIND) $(CONTRIB_DIR) -depth -type d -empty -delete
$(DOWNLOAD_DIR) $(CONTRIB_DIR):
$(VERBOSE)mkdir -p $@
clean::
$(VERBOSE)rm -rf $(CONTRIB_DIR)
cleanall: clean
$(VERBOSE)rm -rf $(DOWNLOAD_DIR)
.NOTPARALLEL:
|
#ifndef PSGP_SETTINGS_H_
#define PSGP_SETTINGS_H_
// CONSTANTS AND OTHER GENERAL PARAMETERS
// Max number of parameters for PSGP (this limit is set by the R code)
#define NUM_PSGP_PARAMETERS 16
// Maximum number of observations kept for param estimation
#define MAX_OBS 1000
// Maximum number of active points
#define MAX_ACTIVE_POINTS 400
// Likelihood to nugget ratio
#define <API key> 0.01
// Number of sweeps through data with changing/fixed active set
#define NUM_SWEEPS_CHANGING 1
#define NUM_SWEEPS_FIXED 1
// Whether to use a GP instead of PSGP for parameter estimation
#define <API key> false
// Outer loops in parameter estimation for PSGP
#define <API key> 3
// Inner loop (i.e. SCG iterations in each outer loop) for PSGP
#define PSGP_SCG_ITERATIONS 5
// Define whether to use full prediction (all data at once) or
// split prediction (by chunks of data)
#define <API key> true
// Size of prediction chunk (in number of observations)
#define CHUNK_SIZE 1000
#endif /* PSGP_SETTINGS_H_ */
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="specimen_files/easytabs.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="specimen_files/specimen_stylesheet.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />
<style type="text/css">
body{
font-family: 'ralewaythin';
}
</style>
<title>Raleway Thin Specimen</title>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#container').easyTabs({defaultContent:1});
});
</script>
</head>
<body>
<div id="container">
<div id="header">
Raleway Thin </div>
<ul class="tabs">
<li><a href="#specimen">Specimen</a></li>
<li><a href="#layout">Sample Layout</a></li>
<li><a href="#glyphs">Glyphs & Languages</a></li>
<li><a href="#installing">Installing Webfonts</a></li>
</ul>
<div id="main_content">
<div id="specimen">
<div class="section">
<div class="grid12 firstcol">
<div class="huge">AaBb</div>
</div>
</div>
<div class="section">
<div class="glyph_range">A​B​C​D​E​F​G​H​I​J​K​L​M​N​O​P​Q​R​S​T​U​V​W​X​Y​Z​a​b​c​d​e​f​g​h​i​j​k​l​m​n​o​p​q​r​s​t​u​v​w​x​y​z​1​2​3​4​5​6​7​8​9​0​&​.​,​?​!​@​(​)​#​$​%​*​+​-​=​:​;</div>
</div>
<div class="section">
<div class="grid12 firstcol">
<table class="sample_table">
<tr><td>10</td><td class="size10">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>11</td><td class="size11">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>12</td><td class="size12">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>13</td><td class="size13">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>14</td><td class="size14">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>16</td><td class="size16">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>18</td><td class="size18">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>20</td><td class="size20">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>24</td><td class="size24">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>30</td><td class="size30">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>36</td><td class="size36">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>48</td><td class="size48">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>60</td><td class="size60">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>72</td><td class="size72">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
<tr><td>90</td><td class="size90">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
</table>
</div>
</div>
<div class="section" id="bodycomparison">
<div id="xheight">
<div class="fontbody">◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼body</div><div class="arialbody">body</div><div class="verdanabody">body</div><div class="georgiabody">body</div></div>
<div class="fontbody" style="z-index:1">
body<span>Raleway Thin</span>
</div>
<div class="arialbody" style="z-index:1">
body<span>Arial</span>
</div>
<div class="verdanabody" style="z-index:1">
body<span>Verdana</span>
</div>
<div class="georgiabody" style="z-index:1">
body<span>Georgia</span>
</div>
</div>
<div class="section psample psample_row1" id="">
<div class="grid2 firstcol">
<p class="size10"><span>10.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size11"><span>11.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size12"><span>12.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size13"><span>13.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row2" id="">
<div class="grid3 firstcol">
<p class="size14"><span>14.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size16"><span>16.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid5">
<p class="size18"><span>18.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row3" id="">
<div class="grid5 firstcol">
<p class="size20"><span>20.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid7">
<p class="size24"><span>24.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row4" id="">
<div class="grid12 firstcol">
<p class="size30"><span>30.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="white_blend"></div>
</div>
<div class="section psample psample_row1 fullreverse">
<div class="grid2 firstcol">
<p class="size10"><span>10.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size11"><span>11.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid3">
<p class="size12"><span>12.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size13"><span>13.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
<div class="section psample psample_row2 fullreverse">
<div class="grid3 firstcol">
<p class="size14"><span>14.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid4">
<p class="size16"><span>16.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid5">
<p class="size18"><span>18.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
<div class="section psample fullreverse psample_row3" id="">
<div class="grid5 firstcol">
<p class="size20"><span>20.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="grid7">
<p class="size24"><span>24.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
<div class="section psample fullreverse psample_row4" id="" style="border-bottom: 20px #000 solid;">
<div class="grid12 firstcol">
<p class="size30"><span>30.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
</div>
<div class="black_blend"></div>
</div>
</div>
<div id="layout">
<div class="section">
<div class="grid12 firstcol">
<h1>Lorem Ipsum Dolor</h1>
<h2>Etiam porta sem malesuada magna mollis euismod</h2>
<p class="byline">By <a href="#link">Aenean Lacinia</a></p>
</div>
</div>
<div class="section">
<div class="grid8 firstcol">
<p class="large">Donec sed odio dui. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
<h3>Pellentesque ornare sem</h3>
<p>Maecenas sed diam eget risus varius blandit sit amet non magna. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit. </p>
<p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </p>
<p>Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur. </p>
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Nullam quis risus eget urna mollis ornare vel eu leo. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. </p>
<h3>Cras mattis consectetur</h3>
<p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras mattis consectetur purus sit amet fermentum. </p>
<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam quis risus eget urna mollis ornare vel eu leo. Cras mattis consectetur purus sit amet fermentum.</p>
</div>
<div class="grid4 sidebar">
<div class="box reverse">
<p class="last">Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
</div>
<p class="caption">Maecenas sed diam eget risus varius.</p>
<p>Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Nullam quis risus eget urna mollis ornare vel eu leo. </p>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus auctor fringilla. Maecenas faucibus mollis interdum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
</div>
</div>
</div>
<div id="glyphs">
<div class="section">
<div class="grid12 firstcol">
<h1>Language Support</h1>
<p>The subset of Raleway Thin in this kit supports the following languages:<br />
Albanian, Basque, Breton, Chamorro, Danish, Dutch, English, Faroese, Finnish, French, Frisian, Galician, German, Icelandic, Italian, Malagasy, Norwegian, Portuguese, Spanish, Swedish </p>
<h1>Glyph Chart</h1>
<p>The subset of Raleway Thin in this kit includes all the glyphs listed below. Unicode entities are included above each glyph to help you insert individual characters into your layout.</p>
<div id="glyph_chart">
<div><p>&#13;</p> </div>
<div><p>&#32;</p> </div>
<div><p>&#33;</p>!</div>
<div><p>&#34;</p>"</div>
<div><p>&#35;</p>#</div>
<div><p>&#36;</p>$</div>
<div><p>&#37;</p>%</div>
<div><p>&#38;</p>&</div>
<div><p>&#39;</p>'</div>
<div><p>&#40;</p>(</div>
<div><p>&#41;</p>)</div>
<div><p>&#42;</p>*</div>
<div><p>&#43;</p>+</div>
<div><p>&#44;</p>,</div>
<div><p>&#45;</p>-</div>
<div><p>&#46;</p>.</div>
<div><p>&#47;</p>/</div>
<div><p>&#48;</p>0</div>
<div><p>&#49;</p>1</div>
<div><p>&#50;</p>2</div>
<div><p>&#51;</p>3</div>
<div><p>&#52;</p>4</div>
<div><p>&#53;</p>5</div>
<div><p>&#54;</p>6</div>
<div><p>&#55;</p>7</div>
<div><p>&#56;</p>8</div>
<div><p>&#57;</p>9</div>
<div><p>&#58;</p>:</div>
<div><p>&#59;</p>;</div>
<div><p>&#60;</p><</div>
<div><p>&#61;</p>=</div>
<div><p>&#62;</p>></div>
<div><p>&#63;</p>?</div>
<div><p>&#64;</p>@</div>
<div><p>&#65;</p>A</div>
<div><p>&#66;</p>B</div>
<div><p>&#67;</p>C</div>
<div><p>&#68;</p>D</div>
<div><p>&#69;</p>E</div>
<div><p>&#70;</p>F</div>
<div><p>&#71;</p>G</div>
<div><p>&#72;</p>H</div>
<div><p>&#73;</p>I</div>
<div><p>&#74;</p>J</div>
<div><p>&#75;</p>K</div>
<div><p>&#76;</p>L</div>
<div><p>&#77;</p>M</div>
<div><p>&#78;</p>N</div>
<div><p>&#79;</p>O</div>
<div><p>&#80;</p>P</div>
<div><p>&#81;</p>Q</div>
<div><p>&#82;</p>R</div>
<div><p>&#83;</p>S</div>
<div><p>&#84;</p>T</div>
<div><p>&#85;</p>U</div>
<div><p>&#86;</p>V</div>
<div><p>&#87;</p>W</div>
<div><p>&#88;</p>X</div>
<div><p>&#89;</p>Y</div>
<div><p>&#90;</p>Z</div>
<div><p>&#91;</p>[</div>
<div><p>&#92;</p>\</div>
<div><p>&#93;</p>]</div>
<div><p>&#94;</p>^</div>
<div><p>&#95;</p>_</div>
<div><p>&#96;</p>`</div>
<div><p>&#97;</p>a</div>
<div><p>&#98;</p>b</div>
<div><p>&#99;</p>c</div>
<div><p>&#100;</p>d</div>
<div><p>&#101;</p>e</div>
<div><p>&#102;</p>f</div>
<div><p>&#103;</p>g</div>
<div><p>&#104;</p>h</div>
<div><p>&#105;</p>i</div>
<div><p>&#106;</p>j</div>
<div><p>&#107;</p>k</div>
<div><p>&#108;</p>l</div>
<div><p>&#109;</p>m</div>
<div><p>&#110;</p>n</div>
<div><p>&#111;</p>o</div>
<div><p>&#112;</p>p</div>
<div><p>&#113;</p>q</div>
<div><p>&#114;</p>r</div>
<div><p>&#115;</p>s</div>
<div><p>&#116;</p>t</div>
<div><p>&#117;</p>u</div>
<div><p>&#118;</p>v</div>
<div><p>&#119;</p>w</div>
<div><p>&#120;</p>x</div>
<div><p>&#121;</p>y</div>
<div><p>&#122;</p>z</div>
<div><p>&#123;</p>{</div>
<div><p>&#124;</p>|</div>
<div><p>&#125;</p>}</div>
<div><p>&#126;</p>~</div>
<div><p>&#160;</p> </div>
<div><p>&#161;</p>¡</div>
<div><p>&#162;</p>¢</div>
<div><p>&#163;</p>£</div>
<div><p>&#165;</p>¥</div>
<div><p>&#166;</p>¦</div>
<div><p>&#167;</p>§</div>
<div><p>&#168;</p>¨</div>
<div><p>&#169;</p>©</div>
<div><p>&#170;</p>ª</div>
<div><p>&#171;</p>«</div>
<div><p>&#172;</p>¬</div>
<div><p>&#173;</p>­</div>
<div><p>&#174;</p>®</div>
<div><p>&#175;</p>¯</div>
<div><p>&#176;</p>°</div>
<div><p>&#177;</p>±</div>
<div><p>&#178;</p>²</div>
<div><p>&#179;</p>³</div>
<div><p>&#180;</p>´</div>
<div><p>&#181;</p>µ</div>
<div><p>&#182;</p>¶</div>
<div><p>&#183;</p>·</div>
<div><p>&#184;</p>¸</div>
<div><p>&#185;</p>¹</div>
<div><p>&#186;</p>º</div>
<div><p>&#187;</p>»</div>
<div><p>&#188;</p>¼</div>
<div><p>&#189;</p>½</div>
<div><p>&#190;</p>¾</div>
<div><p>&#191;</p>¿</div>
<div><p>&#192;</p>À</div>
<div><p>&#193;</p>Á</div>
<div><p>&#194;</p>Â</div>
<div><p>&#195;</p>Ã</div>
<div><p>&#196;</p>Ä</div>
<div><p>&#197;</p>Å</div>
<div><p>&#198;</p>Æ</div>
<div><p>&#199;</p>Ç</div>
<div><p>&#200;</p>È</div>
<div><p>&#201;</p>É</div>
<div><p>&#202;</p>Ê</div>
<div><p>&#203;</p>Ë</div>
<div><p>&#204;</p>Ì</div>
<div><p>&#205;</p>Í</div>
<div><p>&#206;</p>Î</div>
<div><p>&#207;</p>Ï</div>
<div><p>&#208;</p>Ð</div>
<div><p>&#209;</p>Ñ</div>
<div><p>&#210;</p>Ò</div>
<div><p>&#211;</p>Ó</div>
<div><p>&#212;</p>Ô</div>
<div><p>&#213;</p>Õ</div>
<div><p>&#214;</p>Ö</div>
<div><p>&#215;</p>×</div>
<div><p>&#216;</p>Ø</div>
<div><p>&#217;</p>Ù</div>
<div><p>&#218;</p>Ú</div>
<div><p>&#219;</p>Û</div>
<div><p>&#220;</p>Ü</div>
<div><p>&#221;</p>Ý</div>
<div><p>&#222;</p>Þ</div>
<div><p>&#223;</p>ß</div>
<div><p>&#224;</p>à</div>
<div><p>&#225;</p>á</div>
<div><p>&#226;</p>â</div>
<div><p>&#227;</p>ã</div>
<div><p>&#228;</p>ä</div>
<div><p>&#229;</p>å</div>
<div><p>&#230;</p>æ</div>
<div><p>&#231;</p>ç</div>
<div><p>&#232;</p>è</div>
<div><p>&#233;</p>é</div>
<div><p>&#234;</p>ê</div>
<div><p>&#235;</p>ë</div>
<div><p>&#236;</p>ì</div>
<div><p>&#237;</p>í</div>
<div><p>&#238;</p>î</div>
<div><p>&#239;</p>ï</div>
<div><p>&#240;</p>ð</div>
<div><p>&#241;</p>ñ</div>
<div><p>&#242;</p>ò</div>
<div><p>&#243;</p>ó</div>
<div><p>&#244;</p>ô</div>
<div><p>&#245;</p>õ</div>
<div><p>&#246;</p>ö</div>
<div><p>&#247;</p>÷</div>
<div><p>&#248;</p>ø</div>
<div><p>&#249;</p>ù</div>
<div><p>&#250;</p>ú</div>
<div><p>&#251;</p>û</div>
<div><p>&#252;</p>ü</div>
<div><p>&#253;</p>ý</div>
<div><p>&#254;</p>þ</div>
<div><p>&#255;</p>ÿ</div>
<div><p>&#338;</p>Œ</div>
<div><p>&#339;</p>œ</div>
<div><p>&#376;</p>Ÿ</div>
<div><p>&#710;</p>ˆ</div>
<div><p>&#732;</p>˜</div>
<div><p>&#8192;</p> </div>
<div><p>&#8193;</p> </div>
<div><p>&#8194;</p> </div>
<div><p>&#8195;</p> </div>
<div><p>&#8196;</p> </div>
<div><p>&#8197;</p> </div>
<div><p>&#8198;</p> </div>
<div><p>&#8199;</p> </div>
<div><p>&#8200;</p> </div>
<div><p>&#8201;</p> </div>
<div><p>&#8202;</p> </div>
<div><p>&#8208;</p>‐</div>
<div><p>&#8209;</p>‑</div>
<div><p>&#8210;</p>‒</div>
<div><p>&#8211;</p>–</div>
<div><p>&#8212;</p>—</div>
<div><p>&#8216;</p>‘</div>
<div><p>&#8217;</p>’</div>
<div><p>&#8218;</p>‚</div>
<div><p>&#8220;</p>“</div>
<div><p>&#8221;</p>”</div>
<div><p>&#8222;</p>„</div>
<div><p>&#8226;</p>•</div>
<div><p>&#8230;</p>…</div>
<div><p>&#8239;</p> </div>
<div><p>&#8249;</p>‹</div>
<div><p>&#8250;</p>›</div>
<div><p>&#8287;</p> </div>
<div><p>&#8364;</p>€</div>
<div><p>&#8482;</p>™</div>
<div><p>&#9724;</p>◼</div>
<div><p>&#64257;</p>fi</div>
<div><p>&#64258;</p>fl</div>
<div><p>&#64259;</p>ffi</div>
<div><p>&#64260;</p>ffl</div>
</div>
</div>
</div>
</div>
<div id="specs">
</div>
<div id="installing">
<div class="section">
<div class="grid7 firstcol">
<h1>Installing Webfonts</h1>
<p>Webfonts are supported by all major browser platforms but not all in the same way. There are currently four different font formats that must be included in order to target all browsers. This includes TTF, WOFF, EOT and SVG.</p>
<h2>1. Upload your webfonts</h2>
<p>You must upload your webfont kit to your website. They should be in or near the same directory as your CSS files.</p>
<h2>2. Include the webfont stylesheet</h2>
<p>A special CSS @font-face declaration helps the various browsers select the appropriate font it needs without causing you a bunch of headaches. Learn more about this syntax by reading the <a href="http:
<code>
@font-face{
font-family: 'MyWebFont';
src: url('WebFont.eot');
src: url('WebFont.eot?#iefix') format('embedded-opentype'),
url('WebFont.woff') format('woff'),
url('WebFont.ttf') format('truetype'),
url('WebFont.svg#webfont') format('svg');
}
</code>
<p>We've already gone ahead and generated the code for you. All you have to do is link to the stylesheet in your HTML, like this:</p>
<code><link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" /></code>
<h2>3. Modify your own stylesheet</h2>
<p>To take advantage of your new fonts, you must tell your stylesheet to use them. Look at the original @font-face declaration above and find the property called "font-family." The name linked there will be what you use to reference the font. Prepend that webfont name to the font stack in the "font-family" property, inside the selector you want to change. For example:</p>
<code>p { font-family: 'WebFont', Arial, sans-serif; }</code>
<h2>4. Test</h2>
<p>Getting webfonts to work cross-browser <em>can</em> be tricky. Use the information in the sidebar to help you if you find that fonts aren't loading in a particular browser.</p>
</div>
<div class="grid5 sidebar">
<div class="box">
<h2>Troubleshooting<br />Font-Face Problems</h2>
<p>Having trouble getting your webfonts to load in your new website? Here are some tips to sort out what might be the problem.</p>
<h3>Fonts not showing in any browser</h3>
<p>This sounds like you need to work on the plumbing. You either did not upload the fonts to the correct directory, or you did not link the fonts properly in the CSS. If you've confirmed that all this is correct and you still have a problem, take a look at your .htaccess file and see if requests are getting intercepted.</p>
<h3>Fonts not loading in iPhone or iPad</h3>
<p>The most common problem here is that you are serving the fonts from an IIS server. IIS refuses to serve files that have unknown MIME types. If that is the case, you must set the MIME type for SVG to "image/svg+xml" in the server settings. Follow these instructions from Microsoft if you need help.</p>
<h3>Fonts not loading in Firefox</h3>
<p>The primary reason for this failure? You are still using a version Firefox older than 3.5. So upgrade already! If that isn't it, then you are very likely serving fonts from a different domain. Firefox requires that all font assets be served from the same domain. Lastly it is possible that you need to add WOFF to your list of MIME types (if you are serving via IIS.)</p>
<h3>Fonts not loading in IE</h3>
<p>Are you looking at Internet Explorer on an actual Windows machine or are you cheating by using a service like Adobe BrowserLab? Many of these screenshot services do not render @font-face for IE. Best to test it on a real machine.</p>
<h3>Fonts not loading in IE9</h3>
<p>IE9, like Firefox, requires that fonts be served from the same domain as the website. Make sure that is the case.</p>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<p>©2010-2011 Font Squirrel. All rights reserved.</p>
</div>
</div>
</body>
</html>
|
.club_logo {
text-align: center;
}
.club_name {
text-align: center;
}
.club_teams {
text-align: center;
}
.club_address {
text-align: center;
}
|
#!/usr/bin/env python
import math
fin = open('figs/single-rod-in-water.dat', 'r')
fout = open('figs/<API key>.dat', 'w')
kB = 3.16681539628059e-6 # This is Boltzmann's constant in Hartree/Kelvin
first = 1
nm = 18.8972613
for line in fin:
current = str(line)
pieces = current.split('\t')
if first:
r2 = float(pieces[0])/2*nm
E2 = float(pieces[1])
first = 0
else:
if ((float(pieces[0])/2*nm - r2) > 0.25):
r1 = r2
r2 = float(pieces[0])/2*nm
E1 = E2
E2 = float(pieces[1]) # actually it's energy per unit length!
length = 1 # arbitrary
r = (r1 + r2)/2
dEdR = (E2-E1)/(r2-r1)*length
area = 2*math.pi*r*length
force = dEdR
pressure = force/area
kT = kB*298 # about this
ncontact = pressure/kT
fout.write(str(r)+'\t'+str(ncontact)+'\n')
fin.close()
fout.close()
|
#ifndef _ROM_FS_
#define _ROM_FS_
#define SECTOR_SIZE 512
#define CH10_MAGIC "FORTYtwo"
#define CH10_MAGIC_OFFSET 512
// Types used by Linux
#include "ltypes.h"
// Use 1 byte packing of on-disk structures
#include <pshpack1.h>
// The following is a subset of linux/include/linux/ch10fs_fs.h from
// version 2.2.14
/* The basic structures of the ch10fs filesystem */
#define CH10_BLOCK_SIZE 512
#define CH10_MAXFN 48
#define MAX_FILES_PER_DIR 4
#define CH10_MAX_DIR_BLOCKS 64
/*
* Ch10 Directory Entry
*/
struct ch10_dir_entry {
__u8 name[56]; // name of the directory entry
__u64 blockNum; // block number that the entry starts at
__u64 numBlocks; // length of the entry in blocks
__u64 size; // length of the entry in bytes
__u8 createDate[8]; // date entry was created
__u8 createTime[8]; // time entry was created
__u8 timeType; // time system the previous date and time were stored in
__u8 reserved[7]; // currently unused, reserved for future use
__u8 closeTime[8]; // time this entry was finished being written
};
/*
* Ch10 Directory Block
*/
struct ch10_dir_block {
__u8 magicNumAscii[8]; // Identifies this as being a directory block, always set to FORTYtwo
__u8 revNum; // revision number of the data recording standard in use
__u8 shutdown; // flag to indicate filesystem was not properly shutdown while writing to this directory
__u16 numEntries; // number of directory entries/files that are in this block
__u32 bytesPerBlock; // number of bytes per block
__u8 volName[32]; // name of this directory block
__u64 forwardLink:64; // block address of next directory block
__u64 reverseLink:64; // block address of previous directory block
struct ch10_dir_entry dirEntries[MAX_FILES_PER_DIR]; // all entries/files in the block
};
#include <poppack.h>
#endif
|
dojo.require("dijit.Dialog");
dojo.require("dijit.form.FilteringSelect");
dojo.require('dijit.form.Button');
dojo.require('dijit.TooltipDialog');
dojo.require('dijit.form.DropDownButton');
dojo.require('dijit.form.CheckBox');
dojo.require('dojox.grid.DataGrid');
dojo.require('dojo.data.ItemFileWriteStore');
dojo.require('openils.widget.<API key>');
dojo.require('openils.acq.CurrencyType');
dojo.require('openils.Event');
dojo.require('openils.Util');
dojo.require('openils.User');
dojo.require('openils.CGI');
dojo.require('openils.PermaCrud');
dojo.require('openils.widget.AutoGrid');
dojo.require('openils.widget.ProgressDialog');
dojo.require('fieldmapper.OrgUtils');
dojo.requireLocalization('openils.acq', 'acq');
var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq');
var contextOrg;
var rolloverResponses;
var rolloverMode = false;
var fundFleshFields = [
'spent_balance',
'combined_balance',
'spent_total',
'encumbrance_total',
'debit_total',
'allocation_total'
];
var adminPermOrgs = [];
var cachedFunds = [];
function initPage() {
contextOrg = openils.User.user.ws_ou();
/* Reveal controls for rollover without money if org units say ok.
* Actual ability to do the operation is controlled in the database, of
* course. */
var ouSettings = fieldmapper.aou.<API key>(
openils.User.user.ws_ou(), ["acq.fund.<API key>"]
);
if (
ouSettings["acq.fund.<API key>"] &&
ouSettings["acq.fund.<API key>"].value
) {
dojo.query(".encumb_only").forEach(
function(o) { openils.Util.show(o, "table-row"); }
);
}
var connect = function() {
dojo.connect(contextOrgSelector, 'onChange',
function() {
contextOrg = this.attr('value');
dojo.byId('<API key>').innerHTML =
fieldmapper.aou.findOrgUnit(contextOrg).shortname();
rolloverMode = false;
gridDataLoader();
}
);
};
dojo.connect(refreshButton, 'onClick',
function() { rolloverMode = false; gridDataLoader(); });
new openils.User().<API key>(
['ADMIN_ACQ_FUND', 'VIEW_FUND'],
contextOrgSelector, contextOrg, connect);
dojo.byId('<API key>').innerHTML =
fieldmapper.aou.findOrgUnit(contextOrg).shortname();
loadYearSelector();
lfGrid.onItemReceived = function(item) {cachedFunds.push(item)};
new openils.User().getPermOrgList(
'ADMIN_ACQ_FUND',
function(list) {
adminPermOrgs = list;
loadFundGrid(
new openils.CGI().param('year')
|| new Date().getFullYear().toString());
},
true, true
);
}
function gridDataLoader() {
lfGrid.resetStore();
if(rolloverMode) {
var offset = lfGrid.displayOffset;
for(var i = offset; i < (offset + lfGrid.displayLimit - 1); i++) {
var fund = rolloverResponses[i];
if(!fund) break;
lfGrid.store.newItem(fieldmapper.acqf.toStoreItem(fund));
}
} else {
loadFundGrid();
}
}
function getBalanceInfo(rowIdx, item) {
if (!item) return '';
var fundId = this.grid.store.getValue(item, 'id');
var fund = cachedFunds.filter(function(f) { return f.id() == fundId })[0];
var cb = fund.combined_balance();
return cb ? cb.amount() : '0';
}
function loadFundGrid(year) {
openils.Util.hide('<API key>');
year = year || <API key>.attr('value');
cachedFunds = [];
lfGrid.loadAll(
{
flesh : 1,
flesh_fields : {acqf : fundFleshFields},
// by default, sort funds I can edit to the front
order_by : [
{ 'class' : 'acqf',
field : 'org',
compare : {'in' : adminPermOrgs},
direction : 'desc'
},
{ 'class' : 'acqf',
field : 'name'
}
]
}, {
year : year,
org : fieldmapper.aou.descendantNodeList(contextOrg, true)
}
);
}
function loadYearSelector() {
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.fund.org.years.retrieve'],
{ async : true,
params : [openils.User.authtoken, {}, {limit_perm : 'VIEW_FUND'}],
oncomplete : function(r) {
var yearList = openils.Util.readResponse(r);
if(!yearList) return;
yearList = yearList.map(function(year){return {year:year+''};}); // dojo wants strings
var yearStore = {identifier:'year', name:'year', items:yearList};
yearStore.items = yearStore.items.sort().reverse();
<API key>.store = new dojo.data.ItemFileWriteStore({data:yearStore});
// default to this year
<API key>.setValue(new Date().getFullYear().toString());
dojo.connect(
<API key>,
'onChange',
function() {
rolloverMode = false;
gridDataLoader();
}
);
}
}
);
}
function performRollover(args) {
rolloverMode = true;
progressDialog.show(true, "Processing...");
rolloverResponses = [];
var method = 'open-ils.acq.fiscal_rollover';
if(args.rollover[0] == 'on') {
method += '.combined';
} else {
method += '.propagate';
}
var dryRun = args.dry_run[0] == 'on';
if(dryRun) method += '.dry_run';
var encumbOnly = args.encumb_only[0] == 'on';
var count = 0;
var amount_rolled = 0;
var year = <API key>.attr('value'); // TODO alternate selector?
fieldmapper.standardRequest(
['open-ils.acq', method],
{
async : true,
params : [
openils.User.authtoken,
year,
contextOrg,
(args.child_orgs[0] == 'on'),
{ encumb_only : encumbOnly }
],
onresponse : function(r) {
var resp = openils.Util.readResponse(r);
rolloverResponses.push(resp.fund);
count += 1;
amount_rolled += Number(resp.rollover_amount);
},
oncomplete : function() {
var nextYear = Number(year) + 1;
rolloverResponses = rolloverResponses.sort(
function(a, b) {
if(a.code() > b.code())
return 1;
return -1;
}
)
// add the new, rolled funds to the cache. Note that in dry-run
// mode, these are ephemeral and no longer exist on the server.
cachedFunds = cachedFunds.concat(rolloverResponses);
dojo.byId('<API key>').innerHTML =
dojo.string.substitute(
localeStrings.<API key>,
[nextYear]
);
dojo.byId('<API key>').innerHTML =
dojo.string.substitute(
localeStrings.<API key>,
[nextYear, count]
);
dojo.byId('<API key>').innerHTML =
dojo.string.substitute(
localeStrings.<API key>,
[nextYear, amount_rolled]
);
if(!dryRun) {
openils.Util.hide('<API key>');
// add the new year to the year selector if it's not already there
<API key>.store.fetch({
query : {year : nextYear},
onComplete:
function(list) {
if(list && list.length > 0) return;
<API key>.store.newItem({year : nextYear});
}
});
}
openils.Util.show('<API key>');
progressDialog.hide();
gridDataLoader();
}
}
);
}
openils.Util.addOnLoad(initPage);
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<TITLE>
Uses of Interface com.google.gwt.core.ext.soyc.HasDependencies (Google Web Toolkit Javadoc)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface com.google.gwt.core.ext.soyc.HasDependencies (Google Web Toolkit Javadoc)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/HasDependencies.html" title="interface in com.google.gwt.core.ext.soyc"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
GWT 2.6.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?com/google/gwt/core/ext/soyc//<API key>.html" target="_top"><B>FRAMES</B></A>
<A HREF="HasDependencies.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<CENTER>
<H2>
<B>Uses of Interface<br>com.google.gwt.core.ext.soyc.HasDependencies</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/HasDependencies.html" title="interface in com.google.gwt.core.ext.soyc">HasDependencies</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#com.google.gwt.core.ext.soyc"><B>com.google.gwt.core.ext.soyc</B></A></TD>
<TD>This package contains interfaces that provide access to
"Story of Your Compile" information. </TD>
</TR>
</TABLE>
<P>
<A NAME="com.google.gwt.core.ext.soyc"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/HasDependencies.html" title="interface in com.google.gwt.core.ext.soyc">HasDependencies</A> in <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/package-summary.html">com.google.gwt.core.ext.soyc</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="<API key>">
<TH ALIGN="left" COLSPAN="2">Subinterfaces of <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/HasDependencies.html" title="interface in com.google.gwt.core.ext.soyc">HasDependencies</A> in <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/package-summary.html">com.google.gwt.core.ext.soyc</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> interface</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/google/gwt/core/ext/soyc/ClassMember.html" title="interface in com.google.gwt.core.ext.soyc">ClassMember</A></B></CODE>
<BR>
Represents a reference type, such as a class or interface, in the compiled
output.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> interface</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/google/gwt/core/ext/soyc/MethodMember.html" title="interface in com.google.gwt.core.ext.soyc">MethodMember</A></B></CODE>
<BR>
Represents compiled JS code derived from a Java method.</TD>
</TR>
</TABLE>
<P>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../com/google/gwt/core/ext/soyc/HasDependencies.html" title="interface in com.google.gwt.core.ext.soyc"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
GWT 2.6.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?com/google/gwt/core/ext/soyc//<API key>.html" target="_top"><B>FRAMES</B></A>
<A HREF="HasDependencies.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
</BODY>
</HTML>
|
<!DOCTYPE html>
<!-- Website template by <API key>.com -->
<html>
<head>
<meta charset="UTF-8">
<title>Blog - Astronomy Website Template</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div id="header">
<div class="wrapper clearfix">
<div id="logo">
<a href="index.html"><img src="images/logo.png" alt="LOGO"></a>
</div>
<ul id="navigation">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="about.html">About</a>
</li>
<li class="selected">
<a href="blog.html">Blog</a>
</li>
<li>
<a href="gallery.html">Gallery</a>
</li>
<li>
<a href="contact.html">Contact Us</a>
</li>
</ul>
</div>
</div>
<div id="contents">
<div class="wrapper clearfix">
<div id="sidebar">
<ul>
<li>
<a href="blog.html"><img src="images/earth-small.jpg" alt="Img" height="154" width="213"></a>
</li>
<li>
<a href="blog.html"><img src="images/<API key>.jpg" alt="Img" height="154" width="213"></a>
</li>
</ul>
<div class="click-here">
<h1>Lorem Ipsum Dolor!</h1>
<a href="index.html" class="btn1">Click Here!</a>
</div>
</div>
<div class="main">
<h1>Blog</h1>
<ul class="list">
<li>
<span class="time">01-01-2012</span>
<h4>Blog Title One</h4>
<p>
This website template has been designed by <a href="http:
own text.This website template has been designed by <a href="http:
your own text.
</p>
<a href="blog.html" class="more">Read more>></a>
</li>
<li>
<span class="time">01-01-2012</span>
<h4>Blog Title One</h4>
<p>
This website template has been designed by <a href="http:
own text.This website template has been designed by <a href="http:
your own text.
</p>
<a href="blog.html" class="more">Read more>></a>
</li>
<li>
<span class="time">01-01-2012</span>
<h4>Blog Title One</h4>
<p>
This website template has been designed by <a href="http:
own text.This website template has been designed by <a href="http:
your own text.
</p>
<a href="blog.html" class="more">Read more>></a>
</li>
</ul>
<ul class="pagination">
<li>
<a href="blog.html"><<</a>
</li>
<li>
<a href="blog.html">First</a>
</li>
<li class="selected">
<a href="blog.html">1</a>
</li>
<li>
<a href="blog.html">2</a>
</li>
<li>
<a href="blog.html">3</a>
</li>
<li>
<a href="blog.html">4</a>
</li>
<li>
<a href="blog.html">5</a>
</li>
<li>
<a href="blog.html">6</a>
</li>
<li>
<a href="blog.html">7</a>
</li>
<li>
<a href="blog.html">8</a>
</li>
<li>
<a href="blog.html">9</a>
</li>
<li>
<a href="blog.html">10</a>
</li>
<li>
<a href="blog.html">11</a>
</li>
<li>
<a href="blog.html">12</a>
</li>
<li>
<a href="blog.html">13</a>
</li>
<li>
<a href="blog.html">14</a>
</li>
<li>
<a href="blog.html">15</a>
</li>
<li>
<a href="blog.html">16</a>
</li>
<li>
<a href="blog.html">17</a>
</li>
<li>
<a href="blog.html">18</a>
</li>
<li>
<a href="blog.html">19</a>
</li>
<li>
<a href="blog.html">20</a>
</li>
<li>
<a href="blog.html">Last</a>
</li>
<li>
<a href="blog.html">>></a>
</li>
</ul>
<!-- /.pagination -->
</div>
</div>
</div>
<div id="footer">
<ul id="featured" class="wrapper clearfix">
<li>
<img src="images/astronaut.jpg" alt="Img" height="204" width="220">
<h3><a href="blog.html">Category 1</a></h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec mi tortor. Phasellus commodo semper vehicula.
</p>
</li>
<li>
<img src="images/earth.jpg" alt="Img" height="204" width="220">
<h3><a href="blog.html">Category 2</a></h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec mi tortor. Phasellus commodo semper vehicula.
</p>
</li>
<li>
<img src="images/spacecraft-small.jpg" alt="Img" height="204" width="220">
<h3><a href="blog.html">Category 3</a></h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec mi tortor. Phasellus commodo semper vehicula.
</p>
</li>
<li>
<img src="images/space-shuttle.jpg" alt="Img" height="204" width="220">
<h3><a href="blog.html">Category 4</a></h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec mi tortor. Phasellus commodo semper vehicula.
</p>
</li>
</ul>
<div class="body">
<div class="wrapper clearfix">
<div id="links">
<div>
<h4>Social</h4>
<ul>
<li>
<a href="http://<API key>.com/go/googleplus/" target="_blank">Google +</a>
</li>
<li>
<a href="http://<API key>.com/go/facebook/" target="_blank">Facebook</a>
</li>
<li>
<a href="http://<API key>.com/go/youtube/" target="_blank">Youtube</a>
</li>
</ul>
</div>
<div>
<h4>Heading placeholder</h4>
<ul>
<li>
<a href="index.html">Link Title 1</a>
</li>
<li>
<a href="index.html">Link Title 2</a>
</li>
<li>
<a href="index.html">Link Title 3</a>
</li>
</ul>
</div>
</div>
<div id="newsletter">
<h4>Newsletter</h4>
<p>
Sign up for Our Newsletter
</p>
<form action="index.html" method="post">
<input type="text" value="">
<input type="submit" value="Sign Up!">
</form>
</div>
<p class="footnote">
© Copyright © 2023.Company name all rights reserved
</p>
</div>
</div>
</div>
</body>
</html>
|
package lionse.client.stage;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import lionse.client.Display;
import lionse.client.asset.Asset;
import lionse.client.net.Header;
import lionse.client.net.Server;
public class Character implements Renderable {
// character format constant values
public static final float RESOLUTION = 1.5f;
public static final float C_HEAD = 0 * RESOLUTION;
public static final float C_FACE = 10 * RESOLUTION;
public static final float C_BODY = 24 * RESOLUTION;
public static final float C_HAND = 29 * RESOLUTION;
public static final float C_LEG = 30 * RESOLUTION;
public static LabelStyle NAME_TAG_STYLE;
public static float[] SINE_WAVE = { 0, 0.27f, 0.52f, 0.74f, 0.89f, 0.98f, 0.99f, 0.93f, 0.79f, 0.59f, 0.35f, 0.08f, -0.19f, -0.45f, -0.67f, -0.85f, -0.96f,
-0.99f, -0.95f, -0.84f, -0.66f, -0.43f, -0.17f };
static {
NAME_TAG_STYLE = new LabelStyle();
NAME_TAG_STYLE.font = Asset.Font.get(Asset.NanumGothic);
NAME_TAG_STYLE.fontColor = Color.BLACK;
}
public boolean me = false;
// character property
public String name;
public int head;
public int face;
public int body;
public int clothes;
public int weapon;
public float speed = 200f;
// positioning property
public Point position;
public Point target;
public Point bottom;
// character graphics
public Label nameTag;
public TalkBalloon talkBalloon;
public List<Path> path;
public int pathIndex = 0;
public int direction = 0;
public boolean moving = false;
private int step = 0;
// graphics variables
private float stepTime = 0;
private int next = -1;
// graphics cache
private TextureRegion[] texture_head;
private TextureRegion[] texture_face;
private TextureRegion[] texture_body;
private TextureRegion[] texture_hand;
private TextureRegion[] texture_leg_stop;
private TextureRegion[] texture_leg_step1;
private TextureRegion[] texture_leg_step2;
private TextureRegion[] texture_leg_step3;
private TextureRegion[] texture_leg_step4;
// animated character format (sine-wave)
private float p_head;
private float p_face;
private float p_body;
private float p_hand;
// name, head, face, body, clothes, weapon
public Character(String name, int head, int face, int body, int weapon) {
this.name = name;
this.head = head;
this.face = face;
this.body = body;
this.weapon = weapon;
this.position = new Point();
this.bottom = new Point();
this.talkBalloon = new TalkBalloon(this);
this.nameTag = new Label(name, NAME_TAG_STYLE);
this.path = new ArrayList<Path>();
cache();
}
// cache values. if this method is not called when texture value is
// changed.noting happens to the graphic
public void cache() {
texture_head = Asset.Character.get("HEAD");
texture_face = Asset.Character.get("FACE");
texture_body = Asset.Character.get("BODY");
texture_hand = Asset.Character.get("HAND");
texture_leg_stop = Asset.Character.get("LEG_STAND");
texture_leg_step1 = Asset.Character.get("LEG_STEP1");
texture_leg_step2 = Asset.Character.get("LEG_STEP2");
texture_leg_step3 = Asset.Character.get("LEG_STEP3");
texture_leg_step4 = Asset.Character.get("LEG_STEP4");
}
public void talk(String message) {
talkBalloon.show(message);
}
@Override
public void draw(SpriteBatch spriteBatch, float delta) {
// Debugger.log(texture_head.length);
// draw leg
if (moving) {
switch (step) {
case 0:
spriteBatch.draw(texture_leg_step1[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
break;
case 1:
spriteBatch.draw(texture_leg_step2[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
break;
case 2:
spriteBatch.draw(texture_leg_stop[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
break;
case 3:
spriteBatch.draw(texture_leg_step3[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
break;
case 4:
spriteBatch.draw(texture_leg_step4[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
break;
case 5:
spriteBatch.draw(texture_leg_step3[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
break;
}
} else {
spriteBatch.draw(texture_leg_stop[direction], position.x, Display.HEIGHT - (position.y + C_LEG));
}
// draw body
spriteBatch.draw(texture_body[direction], position.x, Display.HEIGHT - (position.y + p_body));
// draw hands
spriteBatch.draw(texture_hand[direction], position.x, Display.HEIGHT - (position.y + p_hand));
// draw face
spriteBatch.draw(texture_face[direction], position.x, Display.HEIGHT - (position.y + p_face));
// draw head
spriteBatch.draw(texture_head[direction], position.x, Display.HEIGHT - (position.y + p_head));
// draw name tag
nameTag.draw(spriteBatch, 1);
// draw talk balloon
if (talkBalloon.talking)
talkBalloon.draw(spriteBatch, delta);
}
@Override
public void update(float delta) {
// update time values.
stepTime += delta;
next += 1;
if (next >= SINE_WAVE.length)
next = 0;
// increase step if moving.
if (stepTime > 0.05f && moving) {
step += 1;
stepTime = 0;
if (step > 5)
step = 0;
}
// if (moving) {
// updatePosition(delta);
if (me && moving) {
updatePosition(delta);
} else if (this.path.size() > 0 && !me && this.path.size() > pathIndex) {
Path path = this.path.get(pathIndex);
if (path.disabled) {
pathIndex++;
} else {
this.direction = path.direction;
if (path.target == null) {
updatePosition(delta);
} else {
// moveTo(path, delta);
updatePosition(delta);
}
if (path.check(position)) {
if (this.path.size() - 1 <= pathIndex) {
this.path.clear();
pathIndex = 0;
} else {
pathIndex++;
}
} else if (path.previousDistance > 2000 && path.target != null) {
position.x = path.target.x;
position.y = path.target.y;
}
}
}
nameTag.setPosition(position.x - (nameTag.getWidth() / 2) + 27, Display.HEIGHT - position.y + 27);
if (talkBalloon.talking)
talkBalloon.update(delta);
// animation effect. (sine wave)
p_head = C_HEAD + SINE_WAVE[next] * 2f;
p_face = C_FACE + SINE_WAVE[next] * 2f;
p_body = C_BODY + SINE_WAVE[next] * 2;
p_hand = C_HAND + SINE_WAVE[next] * 2;
}
private void updatePosition(float delta) {
switch (direction) {
case 0:
position.x -= speed * delta;
position.y += speed * delta / 2;
break;
case 1:
position.x -= speed * delta;
break;
case 2:
position.x -= speed * delta;
position.y -= speed * delta / 2;
break;
case 3:
position.y -= speed * delta / 2;
break;
case 4:
position.x += speed * delta;
position.y -= speed * delta / 2;
break;
case 5:
position.x += speed * delta;
break;
case 6:
position.x += speed * delta;
position.y += speed * delta / 2;
break;
case 7:
position.y += speed * delta / 2;
break;
}
}
@Override
public Point getPosition() {
bottom.x = position.x;
bottom.y = position.y + 150;
bottom.z = position.z;
return bottom;
}
public void move(int targetDirection) {
this.direction = targetDirection;
Server.send(Header.MOVE + Server.H_L + direction + Server.H_L + Math.round(speed) + Server.H_L + Math.round(position.x) + Server.H_L
+ Math.round(position.y) + Server.H_L + Math.round(position.z));
}
public void stop() {
Server.send(Header.STOP + Server.H_L + Math.round(position.x) + Server.H_L + Math.round(position.y) + Server.H_L + Math.round(position.z));
}
public int getDirection(Point point) {
int xdet = 0; // -1-, 0- , 1-
int ydet = 0;
if (point.x - position.x > 0) {
xdet = 1;
} else if (point.x == position.x) {
} else {
xdet = -1;
}
if (point.y - position.y > 0) {
ydet = -1;
} else if (point.y == position.y) {
} else {
ydet = 1;
}
if (xdet > 0) {
if (ydet > 0) {
return 4;
} else if (ydet == 0) {
return 5;
} else {
return 6;
}
} else if (xdet == 0) {
if (ydet > 0) {
return 3;
} else if (ydet == 0) {
return -1;
} else {
return 7;
}
} else {
if (ydet > 0) {
return 2;
} else if (ydet == 0) {
return 1;
} else {
return 0;
}
}
}
}
|
#include <linux/module.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_NFLOG.h>
#include <net/netfilter/nf_log.h>
#include <net/netfilter/nfnetlink_log.h>
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
MODULE_DESCRIPTION("Xtables: packet logging to netlink using NFLOG");
MODULE_LICENSE("GPL");
MODULE_ALIAS("ipt_NFLOG");
MODULE_ALIAS("ip6t_NFLOG");
static unsigned int
nflog_tg(struct sk_buff *skb, const struct xt_target_param *par)
{
const struct xt_nflog_info *info = par->targinfo;
struct nf_loginfo li;
li.type = NF_LOG_TYPE_ULOG;
li.u.ulog.copy_len = info->len;
li.u.ulog.group = info->group;
li.u.ulog.qthreshold = info->threshold;
nfulnl_log_packet(par->family, par->hooknum, skb, par->in,
par->out, &li, info->prefix);
return XT_CONTINUE;
}
static bool nflog_tg_check(const struct xt_tgchk_param *par)
{
const struct xt_nflog_info *info = par->targinfo;
if (info->flags & ~XT_NFLOG_MASK)
return false;
if (info->prefix[sizeof(info->prefix) - 1] != '\0')
return false;
return true;
}
static struct xt_target nflog_tg_reg __read_mostly = {
.name = "NFLOG",
.revision = 0,
.family = NFPROTO_UNSPEC,
.checkentry = nflog_tg_check,
.target = nflog_tg,
.targetsize = sizeof(struct xt_nflog_info),
.me = THIS_MODULE,
};
static int __init nflog_tg_init(void)
{
return xt_register_target(&nflog_tg_reg);
}
static void __exit nflog_tg_exit(void)
{
<API key>(&nflog_tg_reg);
}
module_init(nflog_tg_init);
module_exit(nflog_tg_exit);
|
package com.lami.tuomatuo.mq.zookeeper.server;
import com.lami.tuomatuo.mq.zookeeper.jmx.ZKMBeanInfo;
public class DataTreeBean implements DataTreeMXBean, ZKMBeanInfo{
public DataTree dataTree;
public DataTreeBean(DataTree dataTree) {
this.dataTree = dataTree;
}
@Override
public int getNodeCount() {
return dataTree.getNodeCount();
}
@Override
public long approximateDataSize() {
return dataTree.approximateDataSize();
}
@Override
public int countEphemerals() {
return dataTree.getEphemeralsCount();
}
public int getWatchCount(){
return dataTree.getWatchCount();
}
@Override
public String getName() {
return "InMemoryDataTree";
}
@Override
public boolean isHidden() {
return false;
}
@Override
public String getLastZxid() {
return "0x" + Long.toHexString(dataTree.lastProcessedZxid);
}
}
|
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/utsname.h>
#include <linux/initrd.h>
#include <linux/console.h>
#include <linux/bootmem.h>
#include <linux/seq_file.h>
#include <linux/screen_info.h>
#include <linux/init.h>
#include <linux/kexec.h>
#include <linux/of_fdt.h>
#include <linux/crash_dump.h>
#include <linux/root_dev.h>
#include <linux/cpu.h>
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/memblock.h>
#include <asm/unified.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
#include <asm/elf.h>
#include <asm/procinfo.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/smp_plat.h>
#include <asm/mach-types.h>
#include <asm/cacheflush.h>
#include <asm/cachetype.h>
#include <asm/tlbflush.h>
#include <asm/prom.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
#include <asm/traps.h>
#include <asm/unwind.h>
#if defined(<API key>)
#include "compat.h"
#endif
#include "atags.h"
#include "tcm.h"
#ifndef MEM_SIZE
#define MEM_SIZE (16*1024*1024)
#endif
#if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE)
char fpe_type[8];
static int __init fpe_setup(char *line)
{
memcpy(fpe_type, line, 8);
return 1;
}
__setup("fpe=", fpe_setup);
#endif
extern void paging_init(struct machine_desc *desc);
extern void <API key>(void);
extern void reboot_setup(char *str);
unsigned int processor_id;
EXPORT_SYMBOL(processor_id);
unsigned int __machine_arch_type __read_mostly;
EXPORT_SYMBOL(__machine_arch_type);
unsigned int cacheid __read_mostly;
EXPORT_SYMBOL(cacheid);
unsigned int __atags_pointer __initdata;
unsigned int system_rev;
EXPORT_SYMBOL(system_rev);
unsigned int system_serial_low;
EXPORT_SYMBOL(system_serial_low);
unsigned int system_serial_high;
EXPORT_SYMBOL(system_serial_high);
unsigned int elf_hwcap __read_mostly;
EXPORT_SYMBOL(elf_hwcap);
#ifdef MULTI_CPU
struct processor processor __read_mostly;
#endif
#ifdef MULTI_TLB
struct cpu_tlb_fns cpu_tlb __read_mostly;
#endif
#ifdef MULTI_USER
struct cpu_user_fns cpu_user __read_mostly;
#endif
#ifdef MULTI_CACHE
struct cpu_cache_fns cpu_cache __read_mostly;
#endif
#ifdef CONFIG_OUTER_CACHE
struct outer_cache_fns outer_cache __read_mostly;
EXPORT_SYMBOL(outer_cache);
#endif
struct stack {
u32 irq[3];
u32 abt[3];
u32 und[3];
} <API key>;
static struct stack stacks[NR_CPUS];
char elf_platform[ELF_PLATFORM_SIZE];
EXPORT_SYMBOL(elf_platform);
static const char *cpu_name;
static const char *machine_name;
static char __initdata cmd_line[COMMAND_LINE_SIZE];
struct machine_desc *machine_desc __initdata;
static char <API key>[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
#define ENDIANNESS ((char)endian_test.l)
DEFINE_PER_CPU(struct cpuinfo_arm, cpu_data);
/*
* Standard memory resources
*/
static struct resource mem_res[] = {
{
.name = "Video RAM",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
},
{
.name = "Kernel text",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
},
{
.name = "Kernel data",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
}
};
#define video_ram mem_res[0]
#define kernel_code mem_res[1]
#define kernel_data mem_res[2]
static struct resource io_res[] = {
{
.name = "reserved",
.start = 0x3bc,
.end = 0x3be,
.flags = IORESOURCE_IO | IORESOURCE_BUSY
},
{
.name = "reserved",
.start = 0x378,
.end = 0x37f,
.flags = IORESOURCE_IO | IORESOURCE_BUSY
},
{
.name = "reserved",
.start = 0x278,
.end = 0x27f,
.flags = IORESOURCE_IO | IORESOURCE_BUSY
}
};
#define lp0 io_res[0]
#define lp1 io_res[1]
#define lp2 io_res[2]
static const char *proc_arch[] = {
"undefined/unknown",
"3",
"4",
"4T",
"5",
"5T",
"5TE",
"5TEJ",
"6TEJ",
"7",
"?(11)",
"?(12)",
"?(13)",
"?(14)",
"?(15)",
"?(16)",
"?(17)",
};
int cpu_architecture(void)
{
int cpu_arch;
if ((read_cpuid_id() & 0x0008f000) == 0) {
cpu_arch = CPU_ARCH_UNKNOWN;
} else if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
cpu_arch = (read_cpuid_id() & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
} else if ((read_cpuid_id() & 0x00080000) == 0x00000000) {
cpu_arch = (read_cpuid_id() >> 16) & 7;
if (cpu_arch)
cpu_arch += CPU_ARCH_ARMv3;
} else if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) {
unsigned int mmfr0;
/* Revised CPUID format. Read the Memory Model Feature
* Register 0 and check for VMSAv7 or PMSAv7 */
asm("mrc p15, 0, %0, c0, c1, 4"
: "=r" (mmfr0));
if ((mmfr0 & 0x0000000f) >= 0x00000003 ||
(mmfr0 & 0x000000f0) >= 0x00000030)
cpu_arch = CPU_ARCH_ARMv7;
else if ((mmfr0 & 0x0000000f) == 0x00000002 ||
(mmfr0 & 0x000000f0) == 0x00000020)
cpu_arch = CPU_ARCH_ARMv6;
else
cpu_arch = CPU_ARCH_UNKNOWN;
} else
cpu_arch = CPU_ARCH_UNKNOWN;
return cpu_arch;
}
static int <API key>(unsigned int arch)
{
int aliasing_icache;
unsigned int id_reg, num_sets, line_size;
/* arch specifies the register format */
switch (arch) {
case CPU_ARCH_ARMv7:
asm("mcr p15, 2, %0, c0, c0, 0 @ set CSSELR"
: /* No output operands */
: "r" (1));
isb();
asm("mrc p15, 1, %0, c0, c0, 0 @ read CCSIDR"
: "=r" (id_reg));
line_size = 4 << ((id_reg & 0x7) + 2);
num_sets = ((id_reg >> 13) & 0x7fff) + 1;
aliasing_icache = (line_size * num_sets) > PAGE_SIZE;
break;
case CPU_ARCH_ARMv6:
aliasing_icache = <API key>() & (1 << 11);
break;
default:
/* I-cache aliases will be handled by D-cache aliasing code */
aliasing_icache = 0;
}
return aliasing_icache;
}
static void __init cacheid_init(void)
{
unsigned int cachetype = <API key>();
unsigned int arch = cpu_architecture();
if (arch >= CPU_ARCH_ARMv6) {
if ((cachetype & (7 << 29)) == 4 << 29) {
/* ARMv7 register format */
cacheid = <API key>;
if ((cachetype & (3 << 14)) == 1 << 14)
cacheid |= CACHEID_ASID_TAGGED;
else if (<API key>(CPU_ARCH_ARMv7))
cacheid |= <API key>;
} else if (cachetype & (1 << 23)) {
cacheid = <API key>;
} else {
cacheid = <API key>;
if (<API key>(CPU_ARCH_ARMv6))
cacheid |= <API key>;
}
} else {
cacheid = CACHEID_VIVT;
}
printk("CPU: %s data cache, %s instruction cache\n",
cache_is_vivt() ? "VIVT" :
<API key>() ? "VIPT aliasing" :
<API key>() ? "VIPT nonaliasing" : "unknown",
cache_is_vivt() ? "VIVT" :
<API key>() ? "VIVT ASID tagged" :
<API key>() ? "VIPT aliasing" :
<API key>() ? "VIPT nonaliasing" : "unknown");
}
/*
* These functions re-use the assembly code in head.S, which
* already provide the required functionality.
*/
extern struct proc_info_list *<API key>(unsigned int);
void __init early_print(const char *str, ...)
{
extern void printascii(const char *);
char buf[256];
va_list ap;
va_start(ap, str);
vsnprintf(buf, sizeof(buf), str, ap);
va_end(ap);
#ifdef CONFIG_DEBUG_LL
printascii(buf);
#endif
printk("%s", buf);
}
static void __init feat_v6_fixup(void)
{
int id = read_cpuid_id();
if ((id & 0xff0f0000) != 0x41070000)
return;
/*
* HWCAP_TLS is available only on 1136 r1p0 and later,
* see also kuser_get_tls_init.
*/
if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0))
elf_hwcap &= ~HWCAP_TLS;
}
static void __init setup_processor(void)
{
struct proc_info_list *list;
/*
* locate processor in the list of supported processor
* types. The linker builds this table for us from the
* entries in arch/arm/mm/proc-*.S
*/
list = <API key>(read_cpuid_id());
if (!list) {
printk("CPU configuration botched (ID %08x), unable "
"to continue.\n", read_cpuid_id());
while (1);
}
cpu_name = list->cpu_name;
#ifdef MULTI_CPU
processor = *list->proc;
#endif
#ifdef MULTI_TLB
cpu_tlb = *list->tlb;
#endif
#ifdef MULTI_USER
cpu_user = *list->user;
#endif
#ifdef MULTI_CACHE
cpu_cache = *list->cache;
#endif
printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
proc_arch[cpu_architecture()], cr_alignment);
sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS);
sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
elf_hwcap = list->elf_hwcap;
#ifndef CONFIG_ARM_THUMB
elf_hwcap &= ~HWCAP_THUMB;
#endif
feat_v6_fixup();
cacheid_init();
cpu_proc_init();
}
/*
* cpu_init - initialise one CPU.
*
* cpu_init sets up the per-CPU stacks.
*/
void cpu_init(void)
{
unsigned int cpu = smp_processor_id();
struct stack *stk = &stacks[cpu];
if (cpu >= NR_CPUS) {
printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu);
BUG();
}
/*
* Define the placement constraint for the inline asm directive below.
* In Thumb-2, msr with an immediate value is not allowed.
*/
#ifdef <API key>
#define PLC "r"
#else
#define PLC "I"
#endif
/*
* setup stacks for re-entrant exception handlers
*/
__asm__ (
"msr cpsr_c, %1\n\t"
"add r14, %0, %2\n\t"
"mov sp, r14\n\t"
"msr cpsr_c, %3\n\t"
"add r14, %0, %4\n\t"
"mov sp, r14\n\t"
"msr cpsr_c, %5\n\t"
"add r14, %0, %6\n\t"
"mov sp, r14\n\t"
"msr cpsr_c, %7"
:
: "r" (stk),
PLC (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
"I" (offsetof(struct stack, irq[0])),
PLC (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
"I" (offsetof(struct stack, abt[0])),
PLC (PSR_F_BIT | PSR_I_BIT | UND_MODE),
"I" (offsetof(struct stack, und[0])),
PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
: "r14");
}
void __init dump_machine_table(void)
{
struct machine_desc *p;
early_print("Available machine support:\n\nID (hex)\tNAME\n");
<API key>(p)
early_print("%08x\t%s\n", p->nr, p->name);
early_print("\nPlease check your kernel config and/or bootloader.\n");
while (true)
/* can't use cpu_relax() here as it may require MMU setup */;
}
int __init arm_add_memory(phys_addr_t start, unsigned long size)
{
struct membank *bank = &meminfo.bank[meminfo.nr_banks];
if (meminfo.nr_banks >= NR_BANKS) {
printk(KERN_CRIT "NR_BANKS too low, "
"ignoring memory at 0x%08llx\n", (long long)start);
return -EINVAL;
}
/*
* Ensure that start/size are aligned to a page boundary.
* Size is appropriately rounded down, start is rounded up.
*/
size -= start & ~PAGE_MASK;
bank->start = PAGE_ALIGN(start);
bank->size = size & PAGE_MASK;
/*
* Check whether this memory region has non-zero size or
* invalid node number.
*/
if (bank->size == 0)
return -EINVAL;
meminfo.nr_banks++;
return 0;
}
/*
* Pick out the memory size. We look for mem=size@start,
* where start and size are "size[KkMm]"
*/
static int __init early_mem(char *p)
{
static int usermem __initdata = 0;
unsigned long size;
phys_addr_t start;
char *endp;
/*
* If the user specifies memory size, we
* blow away any automatically generated
* size.
*/
if (usermem == 0) {
usermem = 1;
meminfo.nr_banks = 0;
}
start = PHYS_OFFSET;
size = memparse(p, &endp);
if (*endp == '@')
start = memparse(endp + 1, NULL);
arm_add_memory(start, size);
return 0;
}
early_param("mem", early_mem);
static void __init
setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
{
#ifdef CONFIG_BLK_DEV_RAM
extern int rd_size, rd_image_start, rd_prompt, rd_doload;
rd_image_start = image_start;
rd_prompt = prompt;
rd_doload = doload;
if (rd_sz)
rd_size = rd_sz;
#endif
}
static void __init <API key>(struct machine_desc *mdesc)
{
struct memblock_region *region;
struct resource *res;
kernel_code.start = virt_to_phys(_text);
kernel_code.end = virt_to_phys(_etext - 1);
kernel_data.start = virt_to_phys(_sdata);
kernel_data.end = virt_to_phys(_end - 1);
for_each_memblock(memory, region) {
res = alloc_bootmem_low(sizeof(*res));
res->name = "System RAM";
res->start = __pfn_to_phys(<API key>(region));
res->end = __pfn_to_phys(<API key>(region)) - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
request_resource(&iomem_resource, res);
if (kernel_code.start >= res->start &&
kernel_code.end <= res->end)
request_resource(res, &kernel_code);
if (kernel_data.start >= res->start &&
kernel_data.end <= res->end)
request_resource(res, &kernel_data);
}
if (mdesc->video_start) {
video_ram.start = mdesc->video_start;
video_ram.end = mdesc->video_end;
request_resource(&iomem_resource, &video_ram);
}
/*
* Some machines don't have the possibility of ever
* possessing lp0, lp1 or lp2
*/
if (mdesc->reserve_lp0)
request_resource(&ioport_resource, &lp0);
if (mdesc->reserve_lp1)
request_resource(&ioport_resource, &lp1);
if (mdesc->reserve_lp2)
request_resource(&ioport_resource, &lp2);
}
/*
* Tag parsing.
*
* This is the new way of passing data to the kernel at boot time. Rather
* than passing a fixed inflexible structure to the kernel, we pass a list
* of variable-sized tags to the kernel. The first tag must be a ATAG_CORE
* tag for the list to be recognised (to distinguish the tagged list from
* a param_struct). The list is terminated with a zero-length tag (this tag
* is not parsed in any way).
*/
static int __init parse_tag_core(const struct tag *tag)
{
if (tag->hdr.size > 2) {
if ((tag->u.core.flags & 1) == 0)
root_mountflags &= ~MS_RDONLY;
ROOT_DEV = old_decode_dev(tag->u.core.rootdev);
}
return 0;
}
__tagtable(ATAG_CORE, parse_tag_core);
static int __init parse_tag_mem32(const struct tag *tag)
{
return arm_add_memory(tag->u.mem.start, tag->u.mem.size);
}
__tagtable(ATAG_MEM, parse_tag_mem32);
#if defined(CONFIG_VGA_CONSOLE) || defined(<API key>)
struct screen_info screen_info = {
.orig_video_lines = 30,
.orig_video_cols = 80,
.orig_video_mode = 0,
.orig_video_ega_bx = 0,
.orig_video_isVGA = 1,
.orig_video_points = 8
};
static int __init parse_tag_videotext(const struct tag *tag)
{
screen_info.orig_x = tag->u.videotext.x;
screen_info.orig_y = tag->u.videotext.y;
screen_info.orig_video_page = tag->u.videotext.video_page;
screen_info.orig_video_mode = tag->u.videotext.video_mode;
screen_info.orig_video_cols = tag->u.videotext.video_cols;
screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx;
screen_info.orig_video_lines = tag->u.videotext.video_lines;
screen_info.orig_video_isVGA = tag->u.videotext.video_isvga;
screen_info.orig_video_points = tag->u.videotext.video_points;
return 0;
}
__tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
#endif
static int __init parse_tag_ramdisk(const struct tag *tag)
{
setup_ramdisk((tag->u.ramdisk.flags & 1) == 0,
(tag->u.ramdisk.flags & 2) == 0,
tag->u.ramdisk.start, tag->u.ramdisk.size);
return 0;
}
__tagtable(ATAG_RAMDISK, parse_tag_ramdisk);
static int __init parse_tag_serialnr(const struct tag *tag)
{
system_serial_low = tag->u.serialnr.low;
system_serial_high = tag->u.serialnr.high;
return 0;
}
__tagtable(ATAG_SERIAL, parse_tag_serialnr);
static int __init parse_tag_revision(const struct tag *tag)
{
system_rev = tag->u.revision.rev;
return 0;
}
__tagtable(ATAG_REVISION, parse_tag_revision);
static int __init parse_tag_cmdline(const struct tag *tag)
{
#if defined(<API key>)
strlcat(<API key>, " ", COMMAND_LINE_SIZE);
strlcat(<API key>, tag->u.cmdline.cmdline,
COMMAND_LINE_SIZE);
#elif defined(<API key>)
pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
#else
strlcpy(<API key>, tag->u.cmdline.cmdline,
COMMAND_LINE_SIZE);
#endif
return 0;
}
__tagtable(ATAG_CMDLINE, parse_tag_cmdline);
/*
* Scan the tag table for this tag, and call its parse function.
* The tag table is built by the linker from all the __tagtable
* declarations.
*/
static int __init parse_tag(const struct tag *tag)
{
extern struct tagtable __tagtable_begin, __tagtable_end;
struct tagtable *t;
for (t = &__tagtable_begin; t < &__tagtable_end; t++)
if (tag->hdr.tag == t->tag) {
t->parse(tag);
break;
}
return t < &__tagtable_end;
}
/*
* Parse all tags in the list, checking both the global and architecture
* specific tag tables.
*/
static void __init parse_tags(const struct tag *t)
{
for (; t->hdr.size; t = tag_next(t))
if (!parse_tag(t))
printk(KERN_WARNING
"Ignoring unrecognised tag 0x%08x\n",
t->hdr.tag);
}
/*
* This holds our defaults.
*/
static struct init_tags {
struct tag_header hdr1;
struct tag_core core;
struct tag_header hdr2;
struct tag_mem32 mem;
struct tag_header hdr3;
} init_tags __initdata = {
{ tag_size(tag_core), ATAG_CORE },
{ 1, PAGE_SIZE, 0xff },
{ tag_size(tag_mem32), ATAG_MEM },
{ MEM_SIZE },
{ 0, ATAG_NONE }
};
static int __init customize_machine(void)
{
/* customizes platform devices, or adds new ones */
if (machine_desc->init_machine)
machine_desc->init_machine();
return 0;
}
arch_initcall(customize_machine);
#ifdef CONFIG_KEXEC
static inline unsigned long long get_total_mem(void)
{
unsigned long total;
total = max_low_pfn - min_low_pfn;
return total << PAGE_SHIFT;
}
/**
* reserve_crashkernel() - reserves memory are for crash kernel
*
* This function reserves memory area given in "crashkernel=" kernel command
* line parameter. The memory reserved is used by a dump capture kernel when
* primary kernel is crashing.
*/
static void __init reserve_crashkernel(void)
{
unsigned long long crash_size, crash_base;
unsigned long long total_mem;
int ret;
total_mem = get_total_mem();
ret = parse_crashkernel(boot_command_line, total_mem,
&crash_size, &crash_base);
if (ret)
return;
ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE);
if (ret < 0) {
printk(KERN_WARNING "crashkernel reservation failed - "
"memory is in use (0x%lx)\n", (unsigned long)crash_base);
return;
}
printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
"for crashkernel (System RAM: %ldMB)\n",
(unsigned long)(crash_size >> 20),
(unsigned long)(crash_base >> 20),
(unsigned long)(total_mem >> 20));
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
insert_resource(&iomem_resource, &crashk_res);
}
#else
static inline void reserve_crashkernel(void) {}
#endif /* CONFIG_KEXEC */
static void __init squash_mem_tags(struct tag *tag)
{
for (; tag->hdr.size; tag = tag_next(tag))
if (tag->hdr.tag == ATAG_MEM)
tag->hdr.tag = ATAG_NONE;
}
static struct machine_desc * __init setup_machine_tags(unsigned int nr)
{
struct tag *tags = (struct tag *)&init_tags;
struct machine_desc *mdesc = NULL, *p;
char *from = <API key>;
init_tags.mem.start = PHYS_OFFSET;
/*
* locate machine in the list of supported machines.
*/
<API key>(p)
if (nr == p->nr) {
printk("Machine: %s\n", p->name);
mdesc = p;
break;
}
if (!mdesc) {
early_print("\nError: unrecognized/unsupported machine ID"
" (r1 = 0x%08x).\n\n", nr);
dump_machine_table(); /* does not return */
}
if (__atags_pointer)
tags = phys_to_virt(__atags_pointer);
else if (mdesc->boot_params) {
#ifdef CONFIG_MMU
/*
* We still are executing with a minimal MMU mapping created
* with the presumption that the machine default for this
* is located in the first MB of RAM. Anything else will
* fault and silently hang the kernel at this point.
*/
if (mdesc->boot_params < PHYS_OFFSET ||
mdesc->boot_params >= PHYS_OFFSET + SZ_1M) {
printk(KERN_WARNING
"Default boot params at physical 0x%08lx out of reach\n",
mdesc->boot_params);
} else
#endif
{
tags = phys_to_virt(mdesc->boot_params);
}
}
#if defined(<API key>)
/*
* If we have the old style parameters, convert them to
* a tag list.
*/
if (tags->hdr.tag != ATAG_CORE)
convert_to_tag_list(tags);
#endif
if (tags->hdr.tag != ATAG_CORE) {
#if defined(CONFIG_OF)
/*
* If CONFIG_OF is set, then assume this is a reasonably
* modern system that should pass boot parameters
*/
early_print("Warning: Neither atags nor dtb found\n");
#endif
tags = (struct tag *)&init_tags;
}
if (mdesc->fixup)
mdesc->fixup(mdesc, tags, &from, &meminfo);
if (tags->hdr.tag == ATAG_CORE) {
if (meminfo.nr_banks != 0)
squash_mem_tags(tags);
save_atags(tags);
parse_tags(tags);
}
/* parse_early_param needs a boot_command_line */
strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
return mdesc;
}
void __init setup_arch(char **cmdline_p)
{
struct machine_desc *mdesc;
unwind_init();
setup_processor();
mdesc = setup_machine_fdt(__atags_pointer);
if (!mdesc)
mdesc = setup_machine_tags(machine_arch_type);
machine_desc = mdesc;
machine_name = mdesc->name;
#ifdef CONFIG_ZONE_DMA
if (mdesc->dma_zone_size) {
extern unsigned long arm_dma_zone_size;
arm_dma_zone_size = mdesc->dma_zone_size;
}
#endif
if (mdesc->soft_reboot)
reboot_setup("s");
init_mm.start_code = (unsigned long) _text;
init_mm.end_code = (unsigned long) _etext;
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = (unsigned long) _end;
/* populate cmd_line too for later use, preserving boot_command_line */
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
*cmdline_p = cmd_line;
parse_early_param();
<API key>();
arm_memblock_init(&meminfo, mdesc);
paging_init(mdesc);
<API key>(mdesc);
<API key>();
#ifdef CONFIG_SMP
if (is_smp())
smp_init_cpus();
#endif
reserve_crashkernel();
cpu_init();
tcm_init();
#ifdef <API key>
handle_arch_irq = mdesc->handle_irq;
#endif
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
#elif defined(<API key>)
conswitchp = &dummy_con;
#endif
#endif
early_trap_init();
if (mdesc->init_early)
mdesc->init_early();
}
static int __init topology_init(void)
{
int cpu;
<API key>(cpu) {
struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu);
cpuinfo->cpu.hotpluggable = 1;
register_cpu(&cpuinfo->cpu, cpu);
}
return 0;
}
subsys_initcall(topology_init);
#ifdef <API key>
static int __init proc_cpu_init(void)
{
struct proc_dir_entry *res;
res = proc_mkdir("cpu", NULL);
if (!res)
return -ENOMEM;
return 0;
}
fs_initcall(proc_cpu_init);
#endif
static const char *hwcap_str[] = {
"swp",
"half",
"thumb",
"26bit",
"fastmult",
"fpa",
"vfp",
"edsp",
"java",
"iwmmxt",
"crunch",
"thumbee",
"neon",
"vfpv3",
"vfpv3d16",
"tls",
"vfpv4",
"idiva",
"idivt",
NULL
};
static int c_show(struct seq_file *m, void *v)
{
int i;
seq_printf(m, "Processor\t: %s rev %d (%s)\n",
cpu_name, read_cpuid_id() & 15, elf_platform);
#if defined(CONFIG_SMP)
for_each_online_cpu(i) {
/*
* glibc reads /proc/cpuinfo to determine the number of
* online processors, looking for lines beginning with
* "processor". Give glibc what it expects.
*/
seq_printf(m, "processor\t: %d\n", i);
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n",
per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
(per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
}
#else /* CONFIG_SMP */
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
loops_per_jiffy / (500000/HZ),
(loops_per_jiffy / (5000/HZ)) % 100);
#endif
/* dump out the processor features */
seq_puts(m, "Features\t: ");
for (i = 0; hwcap_str[i]; i++)
if (elf_hwcap & (1 << i))
seq_printf(m, "%s ", hwcap_str[i]);
seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
if ((read_cpuid_id() & 0x0008f000) == 0x00000000) {
/* pre-ARM7 */
seq_printf(m, "CPU part\t: %07x\n", read_cpuid_id() >> 4);
} else {
if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
/* ARM7 */
seq_printf(m, "CPU variant\t: 0x%02x\n",
(read_cpuid_id() >> 16) & 127);
} else {
/* post-ARM7 */
seq_printf(m, "CPU variant\t: 0x%x\n",
(read_cpuid_id() >> 20) & 15);
}
seq_printf(m, "CPU part\t: 0x%03x\n",
(read_cpuid_id() >> 4) & 0xfff);
}
seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
seq_puts(m, "\n");
seq_printf(m, "Hardware\t: %s\n", machine_name);
seq_printf(m, "Revision\t: %04x\n", system_rev);
seq_printf(m, "Serial\t\t: %08x%08x\n",
system_serial_high, system_serial_low);
return 0;
}
static void *c_start(struct seq_file *m, loff_t *pos)
{
return *pos < 1 ? (void *)1 : NULL;
}
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
{
++*pos;
return NULL;
}
static void c_stop(struct seq_file *m, void *v)
{
}
const struct seq_operations cpuinfo_op = {
.start = c_start,
.next = c_next,
.stop = c_stop,
.show = c_show
};
|
YUI.add('itemmanager.itemlist-uploader', function (Y) {
//Invoke strict mode
"use strict";
//Shortcut
var Manager = Supra.Manager,
Action = Manager.PageContent;
/*
* Editable content
*/
function ItemListUploader (config) {
ItemListUploader.superclass.constructor.apply(this, arguments);
}
ItemListUploader.NAME = '<API key>';
ItemListUploader.NS = 'uploader';
ItemListUploader.ATTRS = {};
Y.extend(ItemListUploader, Y.Plugin.Base, {
/**
* Supra.Uploader instance
* @type {Object}
* @private
*/
uploader: null,
/**
* File uploader ids to item ids
* @type {Object}
* @private
*/
ids: null,
initializer: function () {
var itemlist = this.get('host'),
container = itemlist.get('contentElement');
this.ids = {};
this.listeners = [];
this.listeners.push(itemlist.after('<API key>', this.reattachListeners, this));
if (container) {
this.reattachListeners();
}
},
destructor: function () {
this.resetAll();
// Listeners
var listeners = this.listeners,
i = 0,
ii = listeners.length;
for (; i < ii; i++) listeners[i].detach();
this.listeners = null;
},
/**
* Attach drag and drop listeners
*/
reattachListeners: function () {
var itemlist = this.get('host'),
container = itemlist.get('contentElement'),
//doc = null,
target = null;
if (this.uploader) {
this.uploader.destroy();
this.uploader = null;
}
if (!container) {
return false;
}
//Create uploader
target = itemlist.get('iframe').one('.<API key>');
this.uploader = new Supra.Uploader({
'dropTarget': target,
'allowBrowse': false,
'allowMultiple': true,
/**
* Reset all iframe content bindings, etc.
*/
resetAll: function () {
var uploader = this.uploader;
if (uploader) {
uploader.destroy(true);
this.uploader = null;
}
},
/**
* Handle file upload start
*/
onFileUploadStart: function (e) {
var data = e.details[0],
itemlist = this.get('host'),
item = null;
// Prevent item from being opened for editing
itemlist.initializing = true;
item = itemlist.addItem({'title': e.title.replace(/\..+$/, '')});
itemlist.initializing = false;
this.ids[e.id] = item.__suid;
},
/**
* Handle file upload end
*/
onFileUploadEnd: function (e) {
var data = e.details[0],
itemlist = this.get('host'),
itemdrop = itemlist.drop;
if (e.old_id in this.ids) {
itemdrop.<API key>(data, this.ids[e.old_id]);
delete(this.ids[e.old_id]);
} else {
itemdrop.addItemToCollection(data);
}
},
/**
* Handle file upload error
*/
onFileUploadError: function (e) {
var itemlist = this.get('host');
itemlist.removeItem(this.ids[e.id]);
delete(this.ids[e.id]);
}
});
Supra.<API key> = ItemListUploader;
//Since this widget has Supra namespace, it doesn't need to be bound to each YUI instance
//Make sure this constructor function is called only once
delete(this.fn); this.fn = function () {};
}, YUI.version, {requires: ['plugin', 'supra.uploader']});
|
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// | Fez - Digital Repository System |
// | Australian Partnership for Sustainable Repositories, |
// | eScholarship Project |
// | This program is free software; you can redistribute it and/or modify |
// | (at your option) any later version. |
// | This program is distributed in the hope that it will be useful, |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | along with this program; if not, write to: |
// | Free Software Foundation, Inc. |
// | 59 Temple Place - Suite 330 |
// | Boston, MA 02111-1307, USA. |
// | Authors: Christiaan Kortekaas <c.kortekaas@library.uq.edu.au>, |
// | Matthew Smith <m.smith@library.uq.edu.au> |
include_once("config.inc.php");
include_once(APP_INC_PATH . "class.lister.php");
include_once(APP_INC_PATH . "class.auth.php");
if (APP_<API key> == 'ON') {
// Send to the new eSpace search profile page when only the author_id is supplied PT: #176474178
if (count($_GET) === 2 &&
array_key_exists('browse', $_GET) &&
$_GET['browse'] === 'author_id' &&
array_key_exists('value', $_GET) &&
is_numeric($_GET['value'])
) {
Lister::<API key>($_GET['value']);
}
}
$res = Lister::getList($_GET, true);
$pids = array();
if (is_array($res['list'])) {
foreach ($res['list'] as $record) {
if (array_key_exists('rek_pid', $record)) {
$pids[] = $record['rek_pid'];
}
}
}
/*
* If this is a logged in user we want to save this data for view pages, so when can create
* 'prev' and 'next' links
*/
$username = Auth::getUsername();
if (!empty($username)) {
$_SESSION['list'] = $pids;
$_SESSION['list_params'] = $_GET;
$_SESSION['script_name'] = $_SERVER['SCRIPT_NAME'];
$_SESSION['last_page'] = $res['list_info']['last_page'];
$_SESSION['view_page'] = $res['list_info']['current_page'];
}
|
using System.Collections.Generic;
using System.Xml.Linq;
using UnityEngine;
namespace IaS.Xml
{
public class XmlTrackNode
{
public const string ElementTrackNode = "node";
private const string AttrTrackNodeId = "id";
private const string <API key> = "p";
public Vector3 Position { get; private set; }
public string Id { get; private set; }
public XmlTrackNode Previous { get; private set; }
public XmlTrackNode Next { get; private set; }
public static XmlTrackNode FromElement(XElement element, Dictionary<string, int> counts)
{
string id = XmlValueMapper.FromAttribute(element, AttrTrackNodeId).AsIdValue("t_node", counts);
Vector3 position = XmlValueMapper.FromAttribute(element, <API key>).AsVector3().MandatoryValue();
return new XmlTrackNode(id, position);
}
public XmlTrackNode(string id, Vector3 position)
{
Id = id;
Position = position;
}
}
}
|
# This file is part of WhatWeb and may be subject to
# web site for more information on licensing and terms of use.
Plugin.define do
name "Movable-Type"
authors [
"Andrew Horton",
# v0.2 # remove :certainty.
# v0.3 # Uses :version=>//.
"Brendan Coles <bcoles@gmail.com>", # v0.4 # 2011-07-07 # updated regex. added example urls, google dorks and version/path detection with mt-check.cgi.
]
version "0.4"
description "Blogging platform"
website "http:
# Google results as at 2011-07-07 #
# 122 for "Powered by Movable Type"
# 89 for inurl:/mt-check.cgi intitle:"Movable Type System Check [mt-check.cgi]"
# 26 for inurl:/mt/mt-check.cgi
# More examples:
# Dorks #
dorks [
'"Powered by Movable Type"',
'inurl:/mt-check.cgi intitle:"Movable Type System Check [mt-check.cgi]"'
]
# Matches #
matches [
# javascript with 'mt' in the filename
{:name=>"javascript with 'mt' in the name",
:certainty=>50, :regexp=>/<script type="text\/javascript" src="[^"]+mt(-site)?\.js"><\/script>/},
# mt-tags|mt-tb|mt-cp|mt-search|mt-user-login|mt-recommend cgi
{:name=>"mt-tags|mt-tb|mt-cp|mt-search|mt-user-login|mt-recommend cgi",
:certainty=>75,
:regexp=>/"[^"]+\/mt-(tags|tb|cp|search|user-login|recommend)\.[f]?cgi[^"]*"/},
# Meta Generator
{:name=>"meta generator tag", :regexp=>/<meta name="generator" content="http:\/\/www\.movabletype\.org\/" \/>/},
# mt-check.cgi # Title
{ :text=>'<title>Movable Type System Check [mt-check.cgi]</title>' },
# Version Detection # mt-check.cgi
{ :version=>/<li><strong>Movable Type version:<\/strong> <code>([^<]+)<\/code><\/li>/ },
# Local Path Detection # mt-check.cgi
{ :filepath=>/<li><strong>Current working directory:<\/strong> <code>([^<]+)<\/code><\/li>/ },
# Powered by link
{:name=>"Powered by link", :regexp=>/<a href="http:\/\/sixapart\.com">Powered by Movable Type<\/a>/},
{:name=>"Powered by link", :regexp=>/Powered by <a href="http:\/\/www\.movabletype\.com\/"[^>]*>Movable Type<\/a>/ },
# Version Detection # Meta Generator
{:version=>/<meta name="generator" content="Movable Type ([^"]*)/, :name=>"meta generator tag" }
]
end
=begin
# An aggressive plugin could check the following paths for confirmation:
# /mt or /mt/mt-check.cgi (discloses versions, paths)
# /mt/mt-tags.fcgi
# /mt-tb.fcgi
# /mt-cp.[f]?cgi
# /mt-search.cgi
# /mt-user-login.cgi
# /mt-recommend.cgi
# can't detect:
barackobama.com
blogs.oracle.com
electricartists.com/corporate
muledesign.com
www.radaronline.com
www.theatlantic.com
www.thehuffingtonpost.com
=end
|
import { apiBase, versionApi } from '../commons';
const apiMonitoringBeta = `${apiBase}/beta/monitoring`;
const apiMonitoring = `${apiBase}/${versionApi}/monitoring`;
export { apiMonitoringBeta, apiMonitoring };
|
require("map/level")
local levellist = {}
levellist[LEVELTYPE.SURVIVAL] = {}
levellist[LEVELTYPE.CAVE] = {}
levellist[LEVELTYPE.ADVENTURE] = {}
levellist[LEVELTYPE.TEST] = {}
levellist[LEVELTYPE.CUSTOM] = {}
function AddLevel(type, data)
table.insert(levellist[type], Level(data))
end
require("map/levels/adventure")
require("map/levels/caves")
require("map/levels/survival")
function GetTypeForLevelID(id)
if id == nil or id:lower() == "unknown" then
return LEVELTYPE.UNKNOWN
end
id = id:lower()
for type, levels in pairs(levellist) do
for idx, level in ipairs(levels) do
if level.id:lower() == id then
return type
end
end
end
return LEVELTYPE.UNKNOWN
end
AddLevel(LEVELTYPE.TEST, {
name="TEST_LEVEL",
id="TEST",
overrides={
{"world_size", "tiny"},
{"day", "onlynight"},
{"waves", "off"},
{"location", "cave"},
{"boons", "never"},
{"poi", "never"},
{"traps", "never"},
{"protected", "never"},
{"start_setpeice", "CaveStart"},
{"start_node", "BGSinkholeRoom"},
},
tasks={
"CavesStart",
"CavesAlternateStart",
"FungalBatCave",
"BatCaves",
"TentacledCave",
"LargeFungalComplex",
"SingleBatCaveTask",
"RabbitsAndFungs",
"FungalPlain",
"Cavern",
},
numoptionaltasks = 1,
optionaltasks = {
"CaveBase",
"MushBase",
"SinkBase",
"RabbitTown",
},
override_triggers = {
-- ["RuinsStart"] = {
-- {"SeasonColourCube", "caves"},
-- -- {"SeasonColourCube", SEASONS.CAVES},
-- ["TheLabyrinth"] = {
-- {"SeasonColourCube", "caves_ruins"},
-- -- {"SeasonColourCube", { DAY = "images/colour_cubes/ruins_light_cc.tex",
-- -- DUSK = "images/colour_cubes/ruins_dim_cc.tex",
-- -- NIGHT = "images/colour_cubes/ruins_dark_cc.tex",
-- ["CityInRuins"] = {
-- {"SeasonColourCube", "caves_ruins"},
-- -- {"SeasonColourCube", { DAY = "images/colour_cubes/ruins_light_cc.tex",
-- -- DUSK = "images/colour_cubes/ruins_dim_cc.tex",
-- -- NIGHT = "images/colour_cubes/ruins_dark_cc.tex",
},
})
return { story_levels=levellist[LEVELTYPE.ADVENTURE],
sandbox_levels=levellist[LEVELTYPE.SURVIVAL],
cave_levels = levellist[LEVELTYPE.CAVE],
--free_level=levellist[LEVELTYPE.SURVIVAL][1],
test_level=levellist[LEVELTYPE.TEST][1],
custom_levels = levellist[LEVELTYPE.CUSTOM],
CAMPAIGN_LENGTH=CAMPAIGN_LENGTH,
GetTypeForLevelID = GetTypeForLevelID
}
|
import tests.util.*;
import java.util.Map;
// Test case for Issue 134:
// Handling of generics from different enclosing classes.
// TODO: revisit with nested types in 1.3.
// @skip-test
class GenericTest4 {
public interface Foo {}
class Outer<O> {
O getOuter() { return null; }
class Inner<I> {
O getInner() { return null; }
I setter1(O p) { return null; }
O setter2(I p) { return null; }
Map<O, I> wow(Map<O, I> p) { return null; }
}
}
class OuterImpl extends Outer<Foo> {
void test() {
Foo foo = getOuter();
}
class InnerImpl extends Inner<@Odd String> {
void test() {
Foo foo = getInner();
String s = setter1(foo);
foo = setter2(s);
}
void testWow(Map<Foo, String> p) {
p = wow(p);
}
}
}
// Add uses from outside of both classes.
}
|
<?php
return array(
'title' => __('Image options', 'omega-admin-td'),
'fields' => array(
array(
'name' => __('Image Shape', 'omega-admin-td'),
'desc' => __('Choose the shape of the image', 'omega-admin-td'),
'id' => 'image_shape',
'type' => 'select',
'options' => array(
'box-round' => __('Round', 'omega-admin-td'),
'box-rect' => __('Rectangle', 'omega-admin-td'),
'box-square' => __('Square', 'omega-admin-td'),
),
'default' => 'box-round',
),
array(
'name' => __('Image Size', 'omega-admin-td'),
'desc' => __('Choose the size of the image', 'omega-admin-td'),
'id' => 'image_size',
'type' => 'select',
'options' => array(
'box-mini' => __('Mini', 'omega-admin-td'),
'no-small' => __('Small', 'omega-admin-td'),
'box-medium' => __('Medium', 'omega-admin-td'),
'box-big' => __('Big', 'omega-admin-td'),
'box-huge' => __('Huge', 'omega-admin-td'),
),
'default' => 'box-medium',
),
)
);
|
<?php
/*
Template Name: Products Template
*
*/
?>
<?php get_header(); ?>
<div class="wrap-full banner-background cf" style="<?php if( get_field('background_banner')){ echo "background-image: url('". get_field('background_banner')."')"; } ?>">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="products-container cf">
<h1><?php the_title(); ?> <span class="tagline"><?php the_field('tagline'); ?></span></h1>
<?php if($_GET['ativo'] == "tilbud") : ?>
<div class="price-table-column blue" style="display: block; margin: 0 auto 50px;">
<div class="price-table-header slim">
<span class="<API key>"><h2>Ativo Medlemstilbud</h2></span>
</div>
<div class="<API key>">
<span class="price-value price-eksl">Månedspris: 350,- <span style="color: #7f7f7f; font-size: 22px; text-decoration: line-through;">450,-</span></span>
</div>
<div class="price-table-cell">
<div class=""></div>
<span class="<API key>">Vedligeholdelse + Fuld Service</span>
<div class="<API key>">Alt fra pakken til 450,- her under, til en venlig pris :-)</div>
</div>
<div class="price-table-cell">
<div class=""></div>
<span class="<API key>">TILMELD</span>
<div class="<API key>">
<?php echo do_shortcode("[stripeform serviceid='service350']"); ?>
</div>
</div>
<div class="price-table-footer"></div>
</div>
<?php endif; ?>
<?php
// check if any products are created
if( have_rows('product') ):
// loop through products
while( have_rows('product') ): the_row(); ?>
<div class="price-table-column <?php the_sub_field('product_color'); ?>">
<div class="price-table-header slim">
<?php if(get_sub_field('product_link')) { ?><a href="<?php the_sub_field('product_link'); ?>"><?php } ?>
<span class="<API key>"><h2><?php the_sub_field('product_name'); ?></h2></span>
<?php if(get_sub_field('product_link')) { ?></a><?php } ?>
</div>
<div class="<API key>">
<?php if(get_sub_field('price_label') == 'from') { ?> <span class="price-value price-from price-eksl"><?php the_sub_field('product_price'); ?>,-</span><?php } ?>
<?php if(get_sub_field('price_label') == 'more') { ?> <span class="price-readmore"><?php the_sub_field('product_price'); ?></span><?php } ?>
<?php if(get_sub_field('price_label') == 'none') { ?> <span class="price-value price-eksl"><?php the_sub_field('product_price'); ?>,-</span><?php } ?>
</div>
<?php
if( get_sub_field('product_description') ):
?>
<div class="<API key>">
<span><?php the_sub_field('product_description'); ?></span>
</div>
<?php endif; ?>
<?php
// check if any product items exists
if( have_rows('product_items') ):
// loop through product items
while( have_rows('product_items') ): the_row(); ?>
<div class="price-table-cell">
<div class="<?php the_sub_field('class'); ?>"></div>
<span class="<API key>"><?php the_sub_field('label'); ?></span>
<div class="<API key>"><?php echo do_shortcode(get_sub_field('description')); ?></div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<div class="price-table-footer">
<?php if(get_sub_field('product_link')) { ?>
<a href="<?php the_sub_field('product_link'); ?>">
<span class="<API key>">Læs mere</span></a>
</a><?php } ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php endwhile; endif; ?>
</div>
<?php include (TEMPLATEPATH . '/contact-ribbon.php'); ?>
<div id="content">
<div id="inner-content" class="wrap cf">
<main id="main" class="m-all t-2of3 d-5of7 cf" role="main" itemscope itemprop="mainContentOfPage" itemtype="http://schema.org/Blog">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
<section class="entry-content cf" itemprop="articleBody">
<?php the_content(); ?>
</section> <?php // end article section ?>
<footer class="article-footer cf">
</footer>
</article>
<?php endwhile; endif; ?>
</main>
<!
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?>
|
#include "omp_compat.h"
#include <cmath>
#include "<API key>.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
<API key>::<API key>(LAMMPS *lmp) :
<API key>(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
cut_respa = NULL;
}
void <API key>::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag,vflag)
#endif
{
int ifrom, ito, tid;
loop_setup_thr(ifrom, ito, tid, inum, nthreads);
ThrData *thr = fix->get_thr(tid);
thr->timer(Timer::START);
ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr);
if (evflag) {
if (eflag) {
if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
else eval<1,1,0>(ifrom, ito, thr);
} else {
if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
else eval<1,0,0>(ifrom, ito, thr);
}
} else {
if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
else eval<0,0,0>(ifrom, ito, thr);
}
thr->timer(Timer::PAIR);
reduce_thr(this, eflag, vflag, thr);
} // end of omp parallel region
}
template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
void <API key>::eval(int iifrom, int iito, ThrData * const thr)
{
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const double * _noalias const q = atom->q;
const int * _noalias const type = atom->type;
const double * _noalias const special_coul = force->special_coul;
const double * _noalias const special_lj = force->special_lj;
const double qqrd2e = force->qqrd2e;
const double inv_denom_lj = 1.0/denom_lj;
const int * const ilist = list->ilist;
const int * const numneigh = list->numneigh;
const int * const * const firstneigh = list->firstneigh;
const int nlocal = atom->nlocal;
// loop over neighbors of my atoms
for (int ii = iifrom; ii < iito; ++ii) {
const int i = ilist[ii];
const int itype = type[i];
const double qtmp = q[i];
const double xtmp = x[i].x;
const double ytmp = x[i].y;
const double ztmp = x[i].z;
double fxtmp,fytmp,fztmp;
fxtmp=fytmp=fztmp=0.0;
const int * const jlist = firstneigh[i];
const int jnum = numneigh[i];
const double * _noalias const lj1i = lj1[itype];
const double * _noalias const lj2i = lj2[itype];
const double * _noalias const lj3i = lj3[itype];
const double * _noalias const lj4i = lj4[itype];
for (int jj = 0; jj < jnum; jj++) {
double forcecoul, forcelj, evdwl, ecoul;
forcecoul = forcelj = evdwl = ecoul = 0.0;
const int sbindex = sbmask(jlist[jj]);
const int j = jlist[jj] & NEIGHMASK;
const double delx = xtmp - x[j].x;
const double dely = ytmp - x[j].y;
const double delz = ztmp - x[j].z;
const double rsq = delx*delx + dely*dely + delz*delz;
const int jtype = type[j];
if (rsq < cut_bothsq) {
const double r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
const double A1 = 0.254829592;
const double A2 = -0.284496736;
const double A3 = 1.421413741;
const double A4 = -1.453152027;
const double A5 = 1.061405429;
const double EWALD_F = 1.12837917;
const double INV_EWALD_P = 1.0/0.3275911;
const double r = sqrt(rsq);
const double grij = g_ewald * r;
const double expm2 = exp(-grij*grij);
const double t = INV_EWALD_P / (INV_EWALD_P + grij);
const double erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
const double prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (EFLAG) ecoul = prefactor*erfc;
if (sbindex) {
const double adjust = (1.0-special_coul[sbindex])*prefactor;
forcecoul -= adjust;
if (EFLAG) ecoul -= adjust;
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
const double fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
const double table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
if (sbindex) {
const double table2 = ctable[itable] + fraction*dctable[itable];
const double prefactor = qtmp*q[j] * table2;
const double adjust = (1.0-special_coul[sbindex])*prefactor;
forcecoul -= adjust;
if (EFLAG) ecoul -= adjust;
}
}
}
if (rsq < cut_ljsq) {
const double r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1i[jtype]*r6inv - lj2i[jtype]);
const double philj = r6inv*(lj3i[jtype]*r6inv-lj4i[jtype]);
if (EFLAG) evdwl = philj;
if (rsq > cut_lj_innersq) {
const double drsq = cut_ljsq - rsq;
const double cut2 = (rsq - cut_lj_innersq) * drsq;
const double switch1 = drsq * (drsq*drsq + 3.0*cut2) * inv_denom_lj;
const double switch2 = 12.0*rsq * cut2 * inv_denom_lj;
forcelj = forcelj*switch1 + philj*switch2;
if (EFLAG) evdwl *= switch1;
}
if (sbindex) {
const double factor_lj = special_lj[sbindex];
forcelj *= factor_lj;
if (EFLAG) evdwl *= factor_lj;
}
}
const double fpair = (forcecoul + forcelj) * r2inv;
fxtmp += delx*fpair;
fytmp += dely*fpair;
fztmp += delz*fpair;
if (NEWTON_PAIR || j < nlocal) {
f[j].x -= delx*fpair;
f[j].y -= dely*fpair;
f[j].z -= delz*fpair;
}
if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
evdwl,ecoul,fpair,delx,dely,delz,thr);
}
}
f[i].x += fxtmp;
f[i].y += fytmp;
f[i].z += fztmp;
}
}
double <API key>::memory_usage()
{
double bytes = memory_usage_thr();
bytes += <API key>::memory_usage();
return bytes;
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Backends</title>
<link rel="stylesheet" type="text/css" media="screen" href="../general/css/style.css" />
</head>
<body>
<h1>Backends</h1>
<h2>General Information</h2>
<p>The NagVis code is separated into several layers. One of these layers is
the "data layer". The data layer is used to handle requests for
information from third party sources like the socket of MKLivestatus. We
call this layer "backend" in general. There are some components
inside NagVis to manage these backends which act as the glue between the
single backends and the other layers.</p>
<h2>Default backend</h2>
<p>At the moment there are a few backends delivered with the NagVis core
packages: the most important ones are the mklivestatus and ndomy backends. All backend
configuration parameters are described in detail on their own pages.</p>
<p>The ndomy backend has been the default backend from NagVis 1.0 to NagVis 1.5.
It fetches Nagios information from the NDO MySQL database. Since NagVis 1.5
the default backend has been switched to MKLivestatus backend.</p>
<p>In NagVis 1.9, the pgsql backend has been added to fetch the Nagios information
from a PostgreSQL database as used by e.g. Icinga 2.</p>
<h2>Backend types</h2>
<ul>
<li><a href=<API key>.html>MKLivestatus</a></li>
<li><a href=backend_ndomy.html>NDOMy</a></li>
<li><a href=backend_nagiosbp.html>NagiosBP</a></li>
<li><a href=backend_pgsql.html>PgSQL</a></li>
<li>MerlinMy</li>
</ul>
<h2>Configuring backends</h2>
<p>The backends are defined in the main configuration file. See
<a href="<API key>.html#backend">main configuration format description</a>
on how to define backends.</p>
</body>
</html>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.