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
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>serializer::read (1 of 2 overloads)</title> <link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../../../index.html" title="Chapter 1. Boost.JSON"> <link rel="up" href="../read.html" title="serializer::read"> <link rel="prev" href="../read.html" title="serializer::read"> <link rel="next" href="overload2.html" title="serializer::read (2 of 2 overloads)"> </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="../read.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../read.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h6 class="title"> <a name="json.ref.boost__json__serializer.read.overload1"></a><a class="link" href="overload1.html" title="serializer::read (1 of 2 overloads)">serializer::read (1 of 2 overloads)</a> </h6></div></div></div> <p> Read the next buffer of serialized JSON. </p> <h7><a name="json.ref.boost__json__serializer.read.overload1.h0"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.synopsis"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.synopsis">Synopsis</a> </h7><pre class="programlisting"><span class="identifier">string_view</span> <span class="identifier">read</span><span class="special">(</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">dest</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">);</span> </pre> <h7><a name="json.ref.boost__json__serializer.read.overload1.h1"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.description"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.description">Description</a> </h7><p> This function attempts to fill the caller provided buffer starting at <code class="computeroutput"><span class="identifier">dest</span></code> with up to <code class="computeroutput"><span class="identifier">size</span></code> characters of the serialized JSON that represents the value. If the buffer is not large enough, multiple calls may be required. </p> <p> If serialization completes during this call; that is, that all of the characters belonging to the serialized value have been written to caller-provided buffers, the function <a class="link" href="../done.html" title="serializer::done"><code class="computeroutput"><span class="identifier">done</span></code></a> will return <code class="computeroutput"><span class="keyword">true</span></code>. </p> <h7><a name="json.ref.boost__json__serializer.read.overload1.h2"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.preconditions"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.preconditions">Preconditions</a> </h7><p> <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">done</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">true</span></code> </p> <h7><a name="json.ref.boost__json__serializer.read.overload1.h3"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.complexity"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.complexity">Complexity</a> </h7><p> Linear in <code class="computeroutput"><span class="identifier">size</span></code>. </p> <h7><a name="json.ref.boost__json__serializer.read.overload1.h4"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.exception_safety"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.exception_safety">Exception Safety</a> </h7><p> Basic guarantee. Calls to <code class="computeroutput"><span class="identifier">memory_resource</span><span class="special">::</span><span class="identifier">allocate</span></code> may throw. </p> <h7><a name="json.ref.boost__json__serializer.read.overload1.h5"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.return_value"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.return_value">Return Value</a> </h7><p> A <a class="link" href="../../boost__json__string_view.html" title="string_view"><code class="computeroutput"><span class="identifier">string_view</span></code></a> containing the characters written, which may be less than <code class="computeroutput"><span class="identifier">size</span></code>. </p> <h7><a name="json.ref.boost__json__serializer.read.overload1.h6"></a> <span class="phrase"><a name="json.ref.boost__json__serializer.read.overload1.parameters"></a></span><a class="link" href="overload1.html#json.ref.boost__json__serializer.read.overload1.parameters">Parameters</a> </h7><div class="informaltable"><table class="table"> <colgroup> <col> <col> </colgroup> <thead><tr> <th> <p> Name </p> </th> <th> <p> Description </p> </th> </tr></thead> <tbody> <tr> <td> <p> <code class="computeroutput"><span class="identifier">dest</span></code> </p> </td> <td> <p> A pointer to valid memory of at least <code class="computeroutput"><span class="identifier">size</span></code> bytes. </p> </td> </tr> <tr> <td> <p> <code class="computeroutput"><span class="identifier">size</span></code> </p> </td> <td> <p> The maximum number of characters to write to the memory pointed to by <code class="computeroutput"><span class="identifier">dest</span></code>. </p> </td> </tr> </tbody> </table></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 © 2019, 2020 Vinnie Falco<br>Copyright © 2020 Krystian Stasiowski<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="../read.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../read.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
davehorton/drachtio-server
deps/boost_1_77_0/libs/json/doc/html/json/ref/boost__json__serializer/read/overload1.html
HTML
mit
8,878
/* * Copyright 2006 Sony Computer Entertainment Inc. * * Licensed under the MIT Open Source License, for details please see license.txt or the website * http://www.opensource.org/licenses/mit-license.php * */ #include <dae.h> #include <dae/daeDom.h> #include <1.4/dom/domGlsl_setparam_simple.h> #include <dae/daeMetaCMPolicy.h> #include <dae/daeMetaSequence.h> #include <dae/daeMetaChoice.h> #include <dae/daeMetaGroup.h> #include <dae/daeMetaAny.h> #include <dae/daeMetaElementAttribute.h> namespace ColladaDOM141 { daeElementRef domGlsl_setparam_simple::create(DAE& dae) { domGlsl_setparam_simpleRef ref = new domGlsl_setparam_simple(dae); return ref; } daeMetaElement * domGlsl_setparam_simple::registerElement(DAE& dae) { daeMetaElement* meta = dae.getMeta(ID()); if ( meta != NULL ) return meta; meta = new daeMetaElement(dae); dae.setMeta(ID(), *meta); meta->setName( "glsl_setparam_simple" ); meta->registerClass(domGlsl_setparam_simple::create); daeMetaCMPolicy *cm = NULL; daeMetaElementAttribute *mea = NULL; cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); mea = new daeMetaElementArrayAttribute( meta, cm, 0, 0, -1 ); mea->setName( "annotate" ); mea->setOffset( daeOffsetOf(domGlsl_setparam_simple,elemAnnotate_array) ); mea->setElementType( domFx_annotate_common::registerElement(dae) ); cm->appendChild( mea ); mea = new daeMetaElementAttribute( meta, cm, 1, 1, 1 ); mea->setName( "glsl_param_type" ); mea->setOffset( daeOffsetOf(domGlsl_setparam_simple,elemGlsl_param_type) ); mea->setElementType( domGlsl_param_type::registerElement(dae) ); cm->appendChild( new daeMetaGroup( mea, meta, cm, 1, 1, 1 ) ); cm->setMaxOrdinal( 1 ); meta->setCMRoot( cm ); // Add attribute: ref { daeMetaAttribute *ma = new daeMetaAttribute; ma->setName( "ref" ); ma->setType( dae.getAtomicTypes().get("Glsl_identifier")); ma->setOffset( daeOffsetOf( domGlsl_setparam_simple , attrRef )); ma->setContainer( meta ); ma->setIsRequired( true ); meta->appendAttribute(ma); } meta->setElementSize(sizeof(domGlsl_setparam_simple)); meta->validate(); return meta; } } // ColladaDOM141
jdsika/TUM_HOly
openrave/3rdparty/collada-2.4.0/src/1.4/dom/domGlsl_setparam_simple.cpp
C++
mit
2,137
<?php namespace App\Providers; use View; use Illuminate\Support\ServiceProvider; use App\Http\ViewComposers\SiteComposer; class ComposerServiceProvider extends ServiceProvider { /** * Register bindings in the container. * * @return void */ public function boot() { View::composer('*', 'App\Http\ViewComposers\SiteComposer'); } /** * Register * * @return void */ public function register() { // } }
lube8uy/laravel5-quickadmin
app/Providers/ComposerServiceProvider.php
PHP
mit
490
--- section: appliance description: Overview of the Appliance Dashboard Rate Limiting page --- # Auth0 Appliance Dashboard: Rate Limiting ::: panel-info Appliance Dashboard Navigation For additional information on navigating to and using the Appliance Dashboard, please see the section on [Appliance Controls](/appliance/dashboard#appliance-controls). ::: While the Auth0-managed cloud instances automatically includes rate limiting to ensure quality service, you must manually enable rate limiting if you are using Auth0 Appliance instances. ![](/media/articles/appliance/dashboard/rate-limiting.png) ## Settings * **Enabled**: to enable rate limiting, check this box. Auth0 will then limit requests to services like API and logins to help mitigate malicious attacks; * **Configuration of Buckets**: if you have enabled rate limiting, you will be presented with the various "buckets" that set the limits on calls to the API and logins. You may adjust these as necessary.
hamzawi06/docs
articles/appliance/dashboard/rate-limiting.md
Markdown
mit
980
/*! * OOUI v0.29.6 * https://www.mediawiki.org/wiki/OOUI * * Copyright 2011–2018 OOUI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * * Date: 2018-12-05T00:16:02Z */.oo-ui-icon-indent{background-image:url(themes/wikimediaui/images/icons/indent-rtl.png);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/indent-rtl.svg)}.oo-ui-icon-listBullet{background-image:url(themes/wikimediaui/images/icons/listBullet-rtl.png);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/listBullet-rtl.svg)}.oo-ui-icon-listNumbered{background-image:url(themes/wikimediaui/images/icons/listNumbered-rtl.png);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/listNumbered-rtl.svg)}.oo-ui-icon-outdent{background-image:url(themes/wikimediaui/images/icons/outdent-rtl.png);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/outdent-rtl.svg)}
sufuf3/cdnjs
ajax/libs/oojs-ui/0.29.6/oojs-ui-apex-icons-editing-list.rtl.min.css
CSS
mit
1,047
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* Tabulator v4.3.0 (c) Oliver Folkerd */ var Sort = function Sort(table) { this.table = table; //hold Tabulator object this.sortList = []; //holder current sort this.changed = false; //has the sort changed since last render }; //initialize column header for sorting Sort.prototype.initializeColumn = function (column, content) { var self = this, sorter = false, colEl, arrowEl; switch (_typeof(column.definition.sorter)) { case "string": if (self.sorters[column.definition.sorter]) { sorter = self.sorters[column.definition.sorter]; } else { console.warn("Sort Error - No such sorter found: ", column.definition.sorter); } break; case "function": sorter = column.definition.sorter; break; } column.modules.sort = { sorter: sorter, dir: "none", params: column.definition.sorterParams || {}, startingDir: column.definition.headerSortStartingDir || "asc", tristate: column.definition.headerSortTristate }; if (column.definition.headerSort !== false) { colEl = column.getElement(); colEl.classList.add("tabulator-sortable"); arrowEl = document.createElement("div"); arrowEl.classList.add("tabulator-arrow"); //create sorter arrow content.appendChild(arrowEl); //sort on click colEl.addEventListener("click", function (e) { var dir = "", sorters = [], match = false; if (column.modules.sort) { if (column.modules.sort.tristate) { if (column.modules.sort.dir == "none") { dir = column.modules.sort.startingDir; } else { if (column.modules.sort.dir == column.modules.sort.startingDir) { dir = column.modules.sort.dir == "asc" ? "desc" : "asc"; } else { dir = "none"; } } } else { switch (column.modules.sort.dir) { case "asc": dir = "desc"; break; case "desc": dir = "asc"; break; default: dir = column.modules.sort.startingDir; } } if (self.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) { sorters = self.getSort(); match = sorters.findIndex(function (sorter) { return sorter.field === column.getField(); }); if (match > -1) { sorters[match].dir = dir; if (match != sorters.length - 1) { match = sorters.splice(match, 1)[0]; if (dir != "none") { sorters.push(match); } } } else { if (dir != "none") { sorters.push({ column: column, dir: dir }); } } //add to existing sort self.setSort(sorters); } else { if (dir == "none") { self.clear(); } else { //sort by column only self.setSort(column, dir); } } self.table.rowManager.sorterRefresh(!self.sortList.length); } }); } }; //check if the sorters have changed since last use Sort.prototype.hasChanged = function () { var changed = this.changed; this.changed = false; return changed; }; //return current sorters Sort.prototype.getSort = function () { var self = this, sorters = []; self.sortList.forEach(function (item) { if (item.column) { sorters.push({ column: item.column.getComponent(), field: item.column.getField(), dir: item.dir }); } }); return sorters; }; //change sort list and trigger sort Sort.prototype.setSort = function (sortList, dir) { var self = this, newSortList = []; if (!Array.isArray(sortList)) { sortList = [{ column: sortList, dir: dir }]; } sortList.forEach(function (item) { var column; column = self.table.columnManager.findColumn(item.column); if (column) { item.column = column; newSortList.push(item); self.changed = true; } else { console.warn("Sort Warning - Sort field does not exist and is being ignored: ", item.column); } }); self.sortList = newSortList; if (this.table.options.persistentSort && this.table.modExists("persistence", true)) { this.table.modules.persistence.save("sort"); } }; //clear sorters Sort.prototype.clear = function () { this.setSort([]); }; //find appropriate sorter for column Sort.prototype.findSorter = function (column) { var row = this.table.rowManager.activeRows[0], sorter = "string", field, value; if (row) { row = row.getData(); field = column.getField(); if (field) { value = column.getFieldValue(row); switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { case "undefined": sorter = "string"; break; case "boolean": sorter = "boolean"; break; default: if (!isNaN(value) && value !== "") { sorter = "number"; } else { if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { sorter = "alphanum"; } } break; } } } return this.sorters[sorter]; }; //work through sort list sorting data Sort.prototype.sort = function (data) { var self = this, lastSort, sortList; sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList; if (self.table.options.dataSorting) { self.table.options.dataSorting.call(self.table, self.getSort()); } self.clearColumnHeaders(); if (!self.table.options.ajaxSorting) { sortList.forEach(function (item, i) { if (item.column && item.column.modules.sort) { //if no sorter has been defined, take a guess if (!item.column.modules.sort.sorter) { item.column.modules.sort.sorter = self.findSorter(item.column); } self._sortItem(data, item.column, item.dir, sortList, i); } self.setColumnHeader(item.column, item.dir); }); } else { sortList.forEach(function (item, i) { self.setColumnHeader(item.column, item.dir); }); } if (self.table.options.dataSorted) { self.table.options.dataSorted.call(self.table, self.getSort(), self.table.rowManager.getComponents(true)); } }; //clear sort arrows on columns Sort.prototype.clearColumnHeaders = function () { this.table.columnManager.getRealColumns().forEach(function (column) { if (column.modules.sort) { column.modules.sort.dir = "none"; column.getElement().setAttribute("aria-sort", "none"); } }); }; //set the column header sort direction Sort.prototype.setColumnHeader = function (column, dir) { column.modules.sort.dir = dir; column.getElement().setAttribute("aria-sort", dir); }; //sort each item in sort list Sort.prototype._sortItem = function (data, column, dir, sortList, i) { var self = this; var params = typeof column.modules.sort.params === "function" ? column.modules.sort.params(column.getComponent(), dir) : column.modules.sort.params; data.sort(function (a, b) { var result = self._sortRow(a, b, column, dir, params); //if results match recurse through previous searchs to be sure if (result === 0 && i) { for (var j = i - 1; j >= 0; j--) { result = self._sortRow(a, b, sortList[j].column, sortList[j].dir, params); if (result !== 0) { break; } } } return result; }); }; //process individual rows for a sort function on active data Sort.prototype._sortRow = function (a, b, column, dir, params) { var el1Comp, el2Comp, colComp; //switch elements depending on search direction var el1 = dir == "asc" ? a : b; var el2 = dir == "asc" ? b : a; a = column.getFieldValue(el1.getData()); b = column.getFieldValue(el2.getData()); a = typeof a !== "undefined" ? a : ""; b = typeof b !== "undefined" ? b : ""; el1Comp = el1.getComponent(); el2Comp = el2.getComponent(); return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params); }; //default data sorters Sort.prototype.sorters = { //sort numbers number: function number(a, b, aRow, bRow, column, dir, params) { var alignEmptyValues = params.alignEmptyValues; var decimal = params.decimalSeparator || "."; var thousand = params.thousandSeparator || ","; var emptyAlign = 0; a = parseFloat(String(a).split(thousand).join("").split(decimal).join(".")); b = parseFloat(String(b).split(thousand).join("").split(decimal).join(".")); //handle non numeric values if (isNaN(a)) { emptyAlign = isNaN(b) ? 0 : -1; } else if (isNaN(b)) { emptyAlign = 1; } else { //compare valid values return a - b; } //fix empty values in position if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { emptyAlign *= -1; } return emptyAlign; }, //sort strings string: function string(a, b, aRow, bRow, column, dir, params) { var alignEmptyValues = params.alignEmptyValues; var emptyAlign = 0; var locale; //handle empty values if (!a) { emptyAlign = !b ? 0 : -1; } else if (!b) { emptyAlign = 1; } else { //compare valid values switch (_typeof(params.locale)) { case "boolean": if (params.locale) { locale = this.table.modules.localize.getLocale(); } break; case "string": locale = params.locale; break; } return String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale); } //fix empty values in position if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { emptyAlign *= -1; } return emptyAlign; }, //sort date date: function date(a, b, aRow, bRow, column, dir, params) { if (!params.format) { params.format = "DD/MM/YYYY"; } return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); }, //sort hh:mm formatted times time: function time(a, b, aRow, bRow, column, dir, params) { if (!params.format) { params.format = "hh:mm"; } return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); }, //sort datetime datetime: function datetime(a, b, aRow, bRow, column, dir, params) { var format = params.format || "DD/MM/YYYY hh:mm:ss", alignEmptyValues = params.alignEmptyValues, emptyAlign = 0; if (typeof moment != "undefined") { a = moment(a, format); b = moment(b, format); if (!a.isValid()) { emptyAlign = !b.isValid() ? 0 : -1; } else if (!b.isValid()) { emptyAlign = 1; } else { //compare valid values return a - b; } //fix empty values in position if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { emptyAlign *= -1; } return emptyAlign; } else { console.error("Sort Error - 'datetime' sorter is dependant on moment.js"); } }, //sort booleans boolean: function boolean(a, b, aRow, bRow, column, dir, params) { var el1 = a === true || a === "true" || a === "True" || a === 1 ? 1 : 0; var el2 = b === true || b === "true" || b === "True" || b === 1 ? 1 : 0; return el1 - el2; }, //sort if element contains any data array: function array(a, b, aRow, bRow, column, dir, params) { var el1 = 0; var el2 = 0; var type = params.type || "length"; var alignEmptyValues = params.alignEmptyValues; var emptyAlign = 0; function calc(value) { switch (type) { case "length": return value.length; break; case "sum": return value.reduce(function (c, d) { return c + d; }); break; case "max": return Math.max.apply(null, value); break; case "min": return Math.min.apply(null, value); break; case "avg": return value.reduce(function (c, d) { return c + d; }) / value.length; break; } } //handle non array values if (!Array.isArray(a)) { alignEmptyValues = !Array.isArray(b) ? 0 : -1; } else if (!Array.isArray(b)) { alignEmptyValues = 1; } else { //compare valid values el1 = a ? calc(a) : 0; el2 = b ? calc(b) : 0; return el1 - el2; } //fix empty values in position if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { emptyAlign *= -1; } return emptyAlign; }, //sort if element contains any data exists: function exists(a, b, aRow, bRow, column, dir, params) { var el1 = typeof a == "undefined" ? 0 : 1; var el2 = typeof b == "undefined" ? 0 : 1; return el1 - el2; }, //sort alpha numeric strings alphanum: function alphanum(as, bs, aRow, bRow, column, dir, params) { var a, b, a1, b1, i = 0, L, rx = /(\d+)|(\D+)/g, rd = /\d/; var alignEmptyValues = params.alignEmptyValues; var emptyAlign = 0; //handle empty values if (!as && as !== 0) { emptyAlign = !bs && bs !== 0 ? 0 : -1; } else if (!bs && bs !== 0) { emptyAlign = 1; } else { if (isFinite(as) && isFinite(bs)) return as - bs; a = String(as).toLowerCase(); b = String(bs).toLowerCase(); if (a === b) return 0; if (!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1; a = a.match(rx); b = b.match(rx); L = a.length > b.length ? b.length : a.length; while (i < L) { a1 = a[i]; b1 = b[i++]; if (a1 !== b1) { if (isFinite(a1) && isFinite(b1)) { if (a1.charAt(0) === "0") a1 = "." + a1; if (b1.charAt(0) === "0") b1 = "." + b1; return a1 - b1; } else return a1 > b1 ? 1 : -1; } } return a.length > b.length; } //fix empty values in position if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { emptyAlign *= -1; } return emptyAlign; } }; Tabulator.prototype.registerModule("sort", Sort);
sufuf3/cdnjs
ajax/libs/tabulator/4.3.0/js/modules/sort.js
JavaScript
mit
13,681
/** * @license Highcharts JS v7.1.3 (2019-08-14) * * (c) 2016-2019 Highsoft AS * Authors: Jon Arild Nygard * * License: www.highcharts.com/license */ 'use strict'; (function (factory) { if (typeof module === 'object' && module.exports) { factory['default'] = factory; module.exports = factory; } else if (typeof define === 'function' && define.amd) { define('highcharts/modules/wordcloud', ['highcharts'], function (Highcharts) { factory(Highcharts); factory.Highcharts = Highcharts; return factory; }); } else { factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined); } }(function (Highcharts) { var _modules = Highcharts ? Highcharts._modules : {}; function _registerModule(obj, path, args, fn) { if (!obj.hasOwnProperty(path)) { obj[path] = fn.apply(null, args); } } _registerModule(_modules, 'mixins/draw-point.js', [], function () { /* * * * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! * * */ var isFn = function (x) { return typeof x === 'function'; }; /* eslint-disable no-invalid-this, valid-jsdoc */ /** * Handles the drawing of a component. * Can be used for any type of component that reserves the graphic property, and * provides a shouldDraw on its context. * * @private * @function draw * @param {DrawPointParams} params * Parameters. * * @todo add type checking. * @todo export this function to enable usage */ var draw = function draw(params) { var component = this, graphic = component.graphic, animatableAttribs = params.animatableAttribs, onComplete = params.onComplete, css = params.css, renderer = params.renderer; if (component.shouldDraw()) { if (!graphic) { component.graphic = graphic = renderer[params.shapeType](params.shapeArgs) .add(params.group); } graphic .css(css) .attr(params.attribs) .animate(animatableAttribs, params.isNew ? false : undefined, onComplete); } else if (graphic) { var destroy = function () { component.graphic = graphic = graphic.destroy(); if (isFn(onComplete)) { onComplete(); } }; // animate only runs complete callback if something was animated. if (Object.keys(animatableAttribs).length) { graphic.animate(animatableAttribs, undefined, function () { destroy(); }); } else { destroy(); } } }; /** * An extended version of draw customized for points. * It calls additional methods that is expected when rendering a point. * * @param {Highcharts.Dictionary<any>} params Parameters */ var drawPoint = function drawPoint(params) { var point = this, attribs = params.attribs = params.attribs || {}; // Assigning class in dot notation does go well in IE8 // eslint-disable-next-line dot-notation attribs['class'] = point.getClassName(); // Call draw to render component draw.call(point, params); }; return drawPoint; }); _registerModule(_modules, 'mixins/polygon.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js']], function (H, U) { /* * * * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! * * */ /** * @private * @interface Highcharts.PolygonPointObject */ /** * @name Highcharts.PolygonPointObject#0 * @type {number} */ /** * @name Highcharts.PolygonPointObject#1 * @type {number} */ /** * @private * @interface Highcharts.PolygonObject * @extends Array<Highcharts.PolygonPointObject> */ /** * @name Highcharts.PolygonObject#axes * @type {Array<PolygonPointObject>} */ var isArray = U.isArray, isNumber = U.isNumber; var deg2rad = H.deg2rad, find = H.find; /* eslint-disable no-invalid-this, valid-jsdoc */ /** * Alternative solution to correctFloat. * E.g H.correctFloat(123, 2) returns 120, when it should be 123. * * @private * @function correctFloat * @param {number} number * @param {number} [precision] * @return {number} */ var correctFloat = function (number, precision) { var p = isNumber(precision) ? precision : 14, magnitude = Math.pow(10, p); return Math.round(number * magnitude) / magnitude; }; /** * Calculates the normals to a line between two points. * * @private * @function getNormals * @param {Highcharts.PolygonPointObject} p1 * Start point for the line. Array of x and y value. * @param {Highcharts.PolygonPointObject} p2 * End point for the line. Array of x and y value. * @return {Highcharts.PolygonObject} * Returns the two normals in an array. */ var getNormals = function getNormal(p1, p2) { var dx = p2[0] - p1[0], // x2 - x1 dy = p2[1] - p1[1]; // y2 - y1 return [ [-dy, dx], [dy, -dx] ]; }; /** * Calculates the dot product of two coordinates. The result is a scalar value. * * @private * @function dotProduct * @param {Highcharts.PolygonPointObject} a * The x and y coordinates of the first point. * * @param {Highcharts.PolygonPointObject} b * The x and y coordinates of the second point. * * @return {number} * Returns the dot product of a and b. */ var dotProduct = function dotProduct(a, b) { var ax = a[0], ay = a[1], bx = b[0], by = b[1]; return ax * bx + ay * by; }; /** * Projects a polygon onto a coordinate. * * @private * @function project * @param {Highcharts.PolygonObject} polygon * Array of points in a polygon. * @param {Highcharts.PolygonPointObject} target * The coordinate of pr * @return {Highcharts.RangeObject} */ var project = function project(polygon, target) { var products = polygon.map(function (point) { return dotProduct(point, target); }); return { min: Math.min.apply(this, products), max: Math.max.apply(this, products) }; }; /** * Rotates a point clockwise around the origin. * * @private * @function rotate2DToOrigin * @param {Highcharts.PolygonPointObject} point * The x and y coordinates for the point. * @param {number} angle * The angle of rotation. * @return {Highcharts.PolygonPointObject} * The x and y coordinate for the rotated point. */ var rotate2DToOrigin = function (point, angle) { var x = point[0], y = point[1], rad = deg2rad * -angle, cosAngle = Math.cos(rad), sinAngle = Math.sin(rad); return [ correctFloat(x * cosAngle - y * sinAngle), correctFloat(x * sinAngle + y * cosAngle) ]; }; /** * Rotate a point clockwise around another point. * * @private * @function rotate2DToPoint * @param {Highcharts.PolygonPointObject} point * The x and y coordinates for the point. * @param {Highcharts.PolygonPointObject} origin * The point to rotate around. * @param {number} angle * The angle of rotation. * @return {Highcharts.PolygonPointObject} * The x and y coordinate for the rotated point. */ var rotate2DToPoint = function (point, origin, angle) { var x = point[0] - origin[0], y = point[1] - origin[1], rotated = rotate2DToOrigin([x, y], angle); return [ rotated[0] + origin[0], rotated[1] + origin[1] ]; }; /** * @private */ var isAxesEqual = function (axis1, axis2) { return (axis1[0] === axis2[0] && axis1[1] === axis2[1]); }; /** * @private */ var getAxesFromPolygon = function (polygon) { var points, axes = polygon.axes; if (!isArray(axes)) { axes = []; points = points = polygon.concat([polygon[0]]); points.reduce(function findAxis(p1, p2) { var normals = getNormals(p1, p2), axis = normals[0]; // Use the left normal as axis. // Check that the axis is unique. if (!find(axes, function (existing) { return isAxesEqual(existing, axis); })) { axes.push(axis); } // Return p2 to be used as p1 in next iteration. return p2; }); polygon.axes = axes; } return axes; }; /** * @private */ var getAxes = function (polygon1, polygon2) { // Get the axis from both polygons. var axes1 = getAxesFromPolygon(polygon1), axes2 = getAxesFromPolygon(polygon2); return axes1.concat(axes2); }; /** * @private */ var getPolygon = function (x, y, width, height, rotation) { var origin = [x, y], left = x - (width / 2), right = x + (width / 2), top = y - (height / 2), bottom = y + (height / 2), polygon = [ [left, top], [right, top], [right, bottom], [left, bottom] ]; return polygon.map(function (point) { return rotate2DToPoint(point, origin, -rotation); }); }; /** * @private */ var getBoundingBoxFromPolygon = function (points) { return points.reduce(function (obj, point) { var x = point[0], y = point[1]; obj.left = Math.min(x, obj.left); obj.right = Math.max(x, obj.right); obj.bottom = Math.max(y, obj.bottom); obj.top = Math.min(y, obj.top); return obj; }, { left: Number.MAX_VALUE, right: -Number.MAX_VALUE, bottom: -Number.MAX_VALUE, top: Number.MAX_VALUE }); }; /** * @private */ var isPolygonsOverlappingOnAxis = function (axis, polygon1, polygon2) { var projection1 = project(polygon1, axis), projection2 = project(polygon2, axis), isOverlapping = !(projection2.min > projection1.max || projection2.max < projection1.min); return !isOverlapping; }; /** * Checks wether two convex polygons are colliding by using the Separating Axis * Theorem. * * @private * @function isPolygonsColliding * @param {Highcharts.PolygonObject} polygon1 * First polygon. * * @param {Highcharts.PolygonObject} polygon2 * Second polygon. * * @return {boolean} * Returns true if they are colliding, otherwise false. */ var isPolygonsColliding = function isPolygonsColliding(polygon1, polygon2) { var axes = getAxes(polygon1, polygon2), overlappingOnAllAxes = !find(axes, function (axis) { return isPolygonsOverlappingOnAxis(axis, polygon1, polygon2); }); return overlappingOnAllAxes; }; /** * @private */ var movePolygon = function (deltaX, deltaY, polygon) { return polygon.map(function (point) { return [ point[0] + deltaX, point[1] + deltaY ]; }); }; var collision = { getBoundingBoxFromPolygon: getBoundingBoxFromPolygon, getPolygon: getPolygon, isPolygonsColliding: isPolygonsColliding, movePolygon: movePolygon, rotate2DToOrigin: rotate2DToOrigin, rotate2DToPoint: rotate2DToPoint }; return collision; }); _registerModule(_modules, 'modules/wordcloud.src.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js'], _modules['mixins/draw-point.js'], _modules['mixins/polygon.js']], function (H, U, drawPoint, polygon) { /* * * Experimental Highcharts module which enables visualization of a word cloud. * * (c) 2016-2019 Highsoft AS * * Authors: Jon Arild Nygard * * License: www.highcharts.com/license */ var isArray = U.isArray, isNumber = U.isNumber, isObject = U.isObject; var extend = H.extend, merge = H.merge, noop = H.noop, find = H.find, getBoundingBoxFromPolygon = polygon.getBoundingBoxFromPolygon, getPolygon = polygon.getPolygon, isPolygonsColliding = polygon.isPolygonsColliding, movePolygon = polygon.movePolygon, Series = H.Series; /** * Detects if there is a collision between two rectangles. * * @private * @function isRectanglesIntersecting * * @param {object} r1 * First rectangle. * * @param {object} r2 * Second rectangle. * * @return {boolean} * Returns true if the rectangles overlap. */ function isRectanglesIntersecting(r1, r2) { return !( r2.left > r1.right || r2.right < r1.left || r2.top > r1.bottom || r2.bottom < r1.top ); } /** * Detects if a word collides with any previously placed words. * * @private * @function intersectsAnyWord * * @param {Highcharts.Point} point * Point which the word is connected to. * * @param {Array<Highcharts.Point>} points * Previously placed points to check against. * * @return {boolean} * Returns true if there is collision. */ function intersectsAnyWord(point, points) { var intersects = false, rect = point.rect, polygon = point.polygon, lastCollidedWith = point.lastCollidedWith, isIntersecting = function (p) { var result = isRectanglesIntersecting(rect, p.rect); if (result && (point.rotation % 90 || p.roation % 90)) { result = isPolygonsColliding( polygon, p.polygon ); } return result; }; // If the point has already intersected a different point, chances are they // are still intersecting. So as an enhancement we check this first. if (lastCollidedWith) { intersects = isIntersecting(lastCollidedWith); // If they no longer intersects, remove the cache from the point. if (!intersects) { delete point.lastCollidedWith; } } // If not already found, then check if we can find a point that is // intersecting. if (!intersects) { intersects = !!find(points, function (p) { var result = isIntersecting(p); if (result) { point.lastCollidedWith = p; } return result; }); } return intersects; } /** * Gives a set of cordinates for an Archimedian Spiral. * * @private * @function archimedeanSpiral * * @param {number} attempt * How far along the spiral we have traversed. * * @param {object} params * Additional parameters. * * @param {object} params.field * Size of field. * * @return {boolean|object} * Resulting coordinates, x and y. False if the word should be dropped * from the visualization. */ function archimedeanSpiral(attempt, params) { var field = params.field, result = false, maxDelta = (field.width * field.width) + (field.height * field.height), t = attempt * 0.8; // 0.2 * 4 = 0.8. Enlarging the spiral. // Emergency brake. TODO make spiralling logic more foolproof. if (attempt <= 10000) { result = { x: t * Math.cos(t), y: t * Math.sin(t) }; if (!(Math.min(Math.abs(result.x), Math.abs(result.y)) < maxDelta)) { result = false; } } return result; } /** * Gives a set of cordinates for an rectangular spiral. * * @private * @function squareSpiral * * @param {number} attempt * How far along the spiral we have traversed. * * @param {object} params * Additional parameters. * * @return {boolean|object} * Resulting coordinates, x and y. False if the word should be dropped * from the visualization. */ function squareSpiral(attempt) { var a = attempt * 4, k = Math.ceil((Math.sqrt(a) - 1) / 2), t = 2 * k + 1, m = Math.pow(t, 2), isBoolean = function (x) { return typeof x === 'boolean'; }, result = false; t -= 1; if (attempt <= 10000) { if (isBoolean(result) && a >= m - t) { result = { x: k - (m - a), y: -k }; } m -= t; if (isBoolean(result) && a >= m - t) { result = { x: -k, y: -k + (m - a) }; } m -= t; if (isBoolean(result)) { if (a >= m - t) { result = { x: -k + (m - a), y: k }; } else { result = { x: k, y: k - (m - a - t) }; } } result.x *= 5; result.y *= 5; } return result; } /** * Gives a set of cordinates for an rectangular spiral. * * @private * @function rectangularSpiral * * @param {number} attempt * How far along the spiral we have traversed. * * @param {object} params * Additional parameters. * * @return {boolean|object} * Resulting coordinates, x and y. False if the word should be dropped * from the visualization. */ function rectangularSpiral(attempt, params) { var result = squareSpiral(attempt, params), field = params.field; if (result) { result.x *= field.ratioX; result.y *= field.ratioY; } return result; } /** * @private * @function getRandomPosition * * @param {number} size * * @return {number} */ function getRandomPosition(size) { return Math.round((size * (Math.random() + 0.5)) / 2); } /** * Calculates the proper scale to fit the cloud inside the plotting area. * * @private * @function getScale * * @param {number} targetWidth * Width of target area. * * @param {number} targetHeight * Height of target area. * * @param {object} field * The playing field. * * @param {Highcharts.Series} series * Series object. * * @return {number} * Returns the value to scale the playing field up to the size of the * target area. */ function getScale(targetWidth, targetHeight, field) { var height = Math.max(Math.abs(field.top), Math.abs(field.bottom)) * 2, width = Math.max(Math.abs(field.left), Math.abs(field.right)) * 2, scaleX = width > 0 ? 1 / width * targetWidth : 1, scaleY = height > 0 ? 1 / height * targetHeight : 1; return Math.min(scaleX, scaleY); } /** * Calculates what is called the playing field. The field is the area which all * the words are allowed to be positioned within. The area is proportioned to * match the target aspect ratio. * * @private * @function getPlayingField * * @param {number} targetWidth * Width of the target area. * * @param {number} targetHeight * Height of the target area. * * @param {Array<Highcharts.Point>} data * Array of points. * * @param {object} data.dimensions * The height and width of the word. * * @return {object} * The width and height of the playing field. */ function getPlayingField( targetWidth, targetHeight, data ) { var info = data.reduce(function (obj, point) { var dimensions = point.dimensions, x = Math.max(dimensions.width, dimensions.height); // Find largest height. obj.maxHeight = Math.max(obj.maxHeight, dimensions.height); // Find largest width. obj.maxWidth = Math.max(obj.maxWidth, dimensions.width); // Sum up the total maximum area of all the words. obj.area += x * x; return obj; }, { maxHeight: 0, maxWidth: 0, area: 0 }), /** * Use largest width, largest height, or root of total area to give size * to the playing field. */ x = Math.max( info.maxHeight, // Have enough space for the tallest word info.maxWidth, // Have enough space for the broadest word // Adjust 15% to account for close packing of words Math.sqrt(info.area) * 0.85 ), ratioX = targetWidth > targetHeight ? targetWidth / targetHeight : 1, ratioY = targetHeight > targetWidth ? targetHeight / targetWidth : 1; return { width: x * ratioX, height: x * ratioY, ratioX: ratioX, ratioY: ratioY }; } /** * Calculates a number of degrees to rotate, based upon a number of orientations * within a range from-to. * * @private * @function getRotation * * @param {number} orientations * Number of orientations. * * @param {number} index * Index of point, used to decide orientation. * * @param {number} from * The smallest degree of rotation. * * @param {number} to * The largest degree of rotation. * * @return {boolean|number} * Returns the resulting rotation for the word. Returns false if invalid * input parameters. */ function getRotation(orientations, index, from, to) { var result = false, // Default to false range, intervals, orientation; // Check if we have valid input parameters. if ( isNumber(orientations) && isNumber(index) && isNumber(from) && isNumber(to) && orientations > 0 && index > -1 && to > from ) { range = to - from; intervals = range / (orientations - 1 || 1); orientation = index % orientations; result = from + (orientation * intervals); } return result; } /** * Calculates the spiral positions and store them in scope for quick access. * * @private * @function getSpiral * * @param {Function} fn * The spiral function. * * @param {object} params * Additional parameters for the spiral. * * @return {Function} * Function with access to spiral positions. */ function getSpiral(fn, params) { var length = 10000, i, arr = []; for (i = 1; i < length; i++) { arr.push(fn(i, params)); } return function (attempt) { return attempt <= length ? arr[attempt - 1] : false; }; } /** * Detects if a word is placed outside the playing field. * * @private * @function outsidePlayingField * * @param {Highcharts.Point} point * Point which the word is connected to. * * @param {object} field * The width and height of the playing field. * * @return {boolean} * Returns true if the word is placed outside the field. */ function outsidePlayingField(rect, field) { var playingField = { left: -(field.width / 2), right: field.width / 2, top: -(field.height / 2), bottom: field.height / 2 }; return !( playingField.left < rect.left && playingField.right > rect.right && playingField.top < rect.top && playingField.bottom > rect.bottom ); } /** * Check if a point intersects with previously placed words, or if it goes * outside the field boundaries. If a collision, then try to adjusts the * position. * * @private * @function intersectionTesting * * @param {Highcharts.Point} point * Point to test for intersections. * * @param {object} options * Options object. * * @return {boolean|object} * Returns an object with how much to correct the positions. Returns * false if the word should not be placed at all. */ function intersectionTesting(point, options) { var placed = options.placed, field = options.field, rectangle = options.rectangle, polygon = options.polygon, spiral = options.spiral, attempt = 1, delta = { x: 0, y: 0 }, // Make a copy to update values during intersection testing. rect = point.rect = extend({}, rectangle); point.polygon = polygon; point.rotation = options.rotation; /* while w intersects any previously placed words: do { move w a little bit along a spiral path } while any part of w is outside the playing field and the spiral radius is still smallish */ while ( delta !== false && ( intersectsAnyWord(point, placed) || outsidePlayingField(rect, field) ) ) { delta = spiral(attempt); if (isObject(delta)) { // Update the DOMRect with new positions. rect.left = rectangle.left + delta.x; rect.right = rectangle.right + delta.x; rect.top = rectangle.top + delta.y; rect.bottom = rectangle.bottom + delta.y; point.polygon = movePolygon(delta.x, delta.y, polygon); } attempt++; } return delta; } /** * Extends the playing field to have enough space to fit a given word. * * @private * @function extendPlayingField * * @param {object} field * The width, height and ratios of a playing field. * * @param {object} rectangle * The bounding box of the word to add space for. * * @return {object} * Returns the extended playing field with updated height and width. */ function extendPlayingField(field, rectangle) { var height, width, ratioX, ratioY, x, extendWidth, extendHeight, result; if (isObject(field) && isObject(rectangle)) { height = (rectangle.bottom - rectangle.top); width = (rectangle.right - rectangle.left); ratioX = field.ratioX; ratioY = field.ratioY; // Use the same variable to extend both the height and width. x = ((width * ratioX) > (height * ratioY)) ? width : height; // Multiply variable with ratios to preserve aspect ratio. extendWidth = x * ratioX; extendHeight = x * ratioY; // Calculate the size of the new field after adding space for the word. result = merge(field, { // Add space on the left and right. width: field.width + (extendWidth * 2), // Add space on the top and bottom. height: field.height + (extendHeight * 2) }); } else { result = field; } // Return the new extended field. return result; } /** * If a rectangle is outside a give field, then the boundaries of the field is * adjusted accordingly. Modifies the field object which is passed as the first * parameter. * * @private * @function updateFieldBoundaries * * @param {object} field * The bounding box of a playing field. * * @param {object} placement * The bounding box for a placed point. * * @return {object} * Returns a modified field object. */ function updateFieldBoundaries(field, rectangle) { // TODO improve type checking. if (!isNumber(field.left) || field.left > rectangle.left) { field.left = rectangle.left; } if (!isNumber(field.right) || field.right < rectangle.right) { field.right = rectangle.right; } if (!isNumber(field.top) || field.top > rectangle.top) { field.top = rectangle.top; } if (!isNumber(field.bottom) || field.bottom < rectangle.bottom) { field.bottom = rectangle.bottom; } return field; } /** * A word cloud is a visualization of a set of words, where the size and * placement of a word is determined by how it is weighted. * * @sample highcharts/demo/wordcloud * Word Cloud chart * * @extends plotOptions.column * @excluding allAreas, boostThreshold, clip, colorAxis, compare, * compareBase, crisp, cropTreshold, dataGrouping, dataLabels, * depth, edgeColor, findNearestPointBy, getExtremesFromAll, * grouping, groupPadding, groupZPadding, joinBy, maxPointWidth, * minPointLength, navigatorOptions, negativeColor, pointInterval, * pointIntervalUnit, pointPadding, pointPlacement, pointRange, * pointStart, pointWidth, pointStart, pointWidth, shadow, * showCheckbox, showInNavigator, softThreshold, stacking, * threshold, zoneAxis, zones * @product highcharts * @since 6.0.0 * @optionparent plotOptions.wordcloud */ var wordCloudOptions = { /** * If there is no space for a word on the playing field, then this option * will allow the playing field to be extended to fit the word. If false * then the word will be dropped from the visualization. * * NB! This option is currently not decided to be published in the API, and * is therefore marked as private. * * @private */ allowExtendPlayingField: true, animation: { duration: 500 }, borderWidth: 0, clip: false, // Something goes wrong with clip. // @todo fix this colorByPoint: true, /** * A threshold determining the minimum font size that can be applied to a * word. */ minFontSize: 1, /** * The word with the largest weight will have a font size equal to this * value. The font size of a word is the ratio between its weight and the * largest occuring weight, multiplied with the value of maxFontSize. */ maxFontSize: 25, /** * This option decides which algorithm is used for placement, and rotation * of a word. The choice of algorith is therefore a crucial part of the * resulting layout of the wordcloud. It is possible for users to add their * own custom placement strategies for use in word cloud. Read more about it * in our * [documentation](https://www.highcharts.com/docs/chart-and-series-types/word-cloud-series#custom-placement-strategies) * * @validvalue: ["center", "random"] */ placementStrategy: 'center', /** * Rotation options for the words in the wordcloud. * * @sample highcharts/plotoptions/wordcloud-rotation * Word cloud with rotation */ rotation: { /** * The smallest degree of rotation for a word. */ from: 0, /** * The number of possible orientations for a word, within the range of * `rotation.from` and `rotation.to`. Must be a number larger than 0. */ orientations: 2, /** * The largest degree of rotation for a word. */ to: 90 }, showInLegend: false, /** * Spiral used for placing a word after the initial position experienced a * collision with either another word or the borders. * It is possible for users to add their own custom spiralling algorithms * for use in word cloud. Read more about it in our * [documentation](https://www.highcharts.com/docs/chart-and-series-types/word-cloud-series#custom-spiralling-algorithm) * * @validvalue: ["archimedean", "rectangular", "square"] */ spiral: 'rectangular', /** * CSS styles for the words. * * @type {Highcharts.CSSObject} * @default {"fontFamily":"sans-serif", "fontWeight": "900"} */ style: { /** @ignore-option */ fontFamily: 'sans-serif', /** @ignore-option */ fontWeight: '900', /** @ignore-option */ whiteSpace: 'nowrap' }, tooltip: { followPointer: true, pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.weight}</b><br/>' } }; // Properties of the WordCloud series. var wordCloudSeries = { animate: Series.prototype.animate, animateDrilldown: noop, animateDrillupFrom: noop, setClip: noop, bindAxes: function () { var wordcloudAxis = { endOnTick: false, gridLineWidth: 0, lineWidth: 0, maxPadding: 0, startOnTick: false, title: null, tickPositions: [] }; Series.prototype.bindAxes.call(this); extend(this.yAxis.options, wordcloudAxis); extend(this.xAxis.options, wordcloudAxis); }, pointAttribs: function (point, state) { var attribs = H.seriesTypes.column.prototype .pointAttribs.call(this, point, state); delete attribs.stroke; delete attribs['stroke-width']; return attribs; }, /** * Calculates the fontSize of a word based on its weight. * * @private * @function Highcharts.Series#deriveFontSize * * @param {number} [relativeWeight=0] * The weight of the word, on a scale 0-1. * * @param {number} [maxFontSize=1] * The maximum font size of a word. * * @param {number} [minFontSize=1] * The minimum font size of a word. * * @return {number} * Returns the resulting fontSize of a word. If minFontSize is * larger then maxFontSize the result will equal minFontSize. */ deriveFontSize: function deriveFontSize( relativeWeight, maxFontSize, minFontSize ) { var weight = isNumber(relativeWeight) ? relativeWeight : 0, max = isNumber(maxFontSize) ? maxFontSize : 1, min = isNumber(minFontSize) ? minFontSize : 1; return Math.floor(Math.max(min, weight * max)); }, drawPoints: function () { var series = this, hasRendered = series.hasRendered, xAxis = series.xAxis, yAxis = series.yAxis, chart = series.chart, group = series.group, options = series.options, animation = options.animation, allowExtendPlayingField = options.allowExtendPlayingField, renderer = chart.renderer, testElement = renderer.text().add(group), placed = [], placementStrategy = series.placementStrategy[ options.placementStrategy ], spiral, rotation = options.rotation, scale, weights = series.points .map(function (p) { return p.weight; }), maxWeight = Math.max.apply(null, weights), data = series.points .sort(function (a, b) { return b.weight - a.weight; // Sort descending }), field; // Get the dimensions for each word. // Used in calculating the playing field. data.forEach(function (point) { var relativeWeight = 1 / maxWeight * point.weight, fontSize = series.deriveFontSize( relativeWeight, options.maxFontSize, options.minFontSize ), css = extend({ fontSize: fontSize + 'px' }, options.style), bBox; testElement.css(css).attr({ x: 0, y: 0, text: point.name }); bBox = testElement.getBBox(true); point.dimensions = { height: bBox.height, width: bBox.width }; }); // Calculate the playing field. field = getPlayingField(xAxis.len, yAxis.len, data); spiral = getSpiral(series.spirals[options.spiral], { field: field }); // Draw all the points. data.forEach(function (point) { var relativeWeight = 1 / maxWeight * point.weight, fontSize = series.deriveFontSize( relativeWeight, options.maxFontSize, options.minFontSize ), css = extend({ fontSize: fontSize + 'px' }, options.style), placement = placementStrategy(point, { data: data, field: field, placed: placed, rotation: rotation }), attr = extend( series.pointAttribs(point, point.selected && 'select'), { align: 'center', 'alignment-baseline': 'middle', x: placement.x, y: placement.y, text: point.name, rotation: placement.rotation } ), polygon = getPolygon( placement.x, placement.y, point.dimensions.width, point.dimensions.height, placement.rotation ), rectangle = getBoundingBoxFromPolygon(polygon), delta = intersectionTesting(point, { rectangle: rectangle, polygon: polygon, field: field, placed: placed, spiral: spiral, rotation: placement.rotation }), animate; // If there is no space for the word, extend the playing field. if (!delta && allowExtendPlayingField) { // Extend the playing field to fit the word. field = extendPlayingField(field, rectangle); // Run intersection testing one more time to place the word. delta = intersectionTesting(point, { rectangle: rectangle, polygon: polygon, field: field, placed: placed, spiral: spiral, rotation: placement.rotation }); } // Check if point was placed, if so delete it, otherwise place it on // the correct positions. if (isObject(delta)) { attr.x += delta.x; attr.y += delta.y; rectangle.left += delta.x; rectangle.right += delta.x; rectangle.top += delta.y; rectangle.bottom += delta.y; field = updateFieldBoundaries(field, rectangle); placed.push(point); point.isNull = false; } else { point.isNull = true; } if (animation) { // Animate to new positions animate = { x: attr.x, y: attr.y }; // Animate from center of chart if (!hasRendered) { attr.x = 0; attr.y = 0; // or animate from previous position } else { delete attr.x; delete attr.y; } } point.draw({ animatableAttribs: animate, attribs: attr, css: css, group: group, renderer: renderer, shapeArgs: undefined, shapeType: 'text' }); }); // Destroy the element after use. testElement = testElement.destroy(); // Scale the series group to fit within the plotArea. scale = getScale(xAxis.len, yAxis.len, field); series.group.attr({ scaleX: scale, scaleY: scale }); }, hasData: function () { var series = this; return ( isObject(series) && series.visible === true && isArray(series.points) && series.points.length > 0 ); }, // Strategies used for deciding rotation and initial position of a word. To // implement a custom strategy, have a look at the function random for // example. placementStrategy: { random: function (point, options) { var field = options.field, r = options.rotation; return { x: getRandomPosition(field.width) - (field.width / 2), y: getRandomPosition(field.height) - (field.height / 2), rotation: getRotation(r.orientations, point.index, r.from, r.to) }; }, center: function (point, options) { var r = options.rotation; return { x: 0, y: 0, rotation: getRotation(r.orientations, point.index, r.from, r.to) }; } }, pointArrayMap: ['weight'], // Spirals used for placing a word after the initial position experienced a // collision with either another word or the borders. To implement a custom // spiral, look at the function archimedeanSpiral for example. spirals: { 'archimedean': archimedeanSpiral, 'rectangular': rectangularSpiral, 'square': squareSpiral }, utils: { extendPlayingField: extendPlayingField, getRotation: getRotation, isPolygonsColliding: isPolygonsColliding, rotate2DToOrigin: polygon.rotate2DToOrigin, rotate2DToPoint: polygon.rotate2DToPoint }, getPlotBox: function () { var series = this, chart = series.chart, inverted = chart.inverted, // Swap axes for inverted (#2339) xAxis = series[(inverted ? 'yAxis' : 'xAxis')], yAxis = series[(inverted ? 'xAxis' : 'yAxis')], width = xAxis ? xAxis.len : chart.plotWidth, height = yAxis ? yAxis.len : chart.plotHeight, x = xAxis ? xAxis.left : chart.plotLeft, y = yAxis ? yAxis.top : chart.plotTop; return { translateX: x + (width / 2), translateY: y + (height / 2), scaleX: 1, // #1623 scaleY: 1 }; } }; // Properties of the Sunburst series. var wordCloudPoint = { draw: drawPoint, shouldDraw: function shouldDraw() { var point = this; return !point.isNull; }, isValid: function isValid() { return true; }, weight: 1 }; /** * A `wordcloud` series. If the [type](#series.wordcloud.type) option is not * specified, it is inherited from [chart.type](#chart.type). * * @extends series,plotOptions.wordcloud * @product highcharts * @apioption series.wordcloud */ /** * An array of data points for the series. For the `wordcloud` series type, * points can be given in the following ways: * * 1. An array of arrays with 2 values. In this case, the values correspond to * `name,weight`. * ```js * data: [ * ['Lorem', 4], * ['Ipsum', 1] * ] * ``` * * 2. An array of objects with named values. The following snippet shows only a * few settings, see the complete options set below. If the total number of * data points exceeds the series' * [turboThreshold](#series.arearange.turboThreshold), this option is not * available. * ```js * data: [{ * name: "Lorem", * weight: 4 * }, { * name: "Ipsum", * weight: 1 * }] * ``` * * @type {Array<Array<string,number>|*>} * @extends series.line.data * @excluding drilldown, marker, x, y * @product highcharts * @apioption series.wordcloud.data */ /** * The name decides the text for a word. * * @type {string} * @since 6.0.0 * @product highcharts * @apioption series.sunburst.data.name */ /** * The weighting of a word. The weight decides the relative size of a word * compared to the rest of the collection. * * @type {number} * @since 6.0.0 * @product highcharts * @apioption series.sunburst.data.weight */ /** * @private * @class * @name Highcharts.seriesTypes.wordcloud * * @augments Highcharts.Series */ H.seriesType( 'wordcloud', 'column', wordCloudOptions, wordCloudSeries, wordCloudPoint ); }); _registerModule(_modules, 'masters/modules/wordcloud.src.js', [], function () { }); }));
joeyparrish/cdnjs
ajax/libs/highcharts/7.1.3/modules/wordcloud.src.js
JavaScript
mit
54,565
/* * Copyright (C) 2011-2015 Anton Burdinuk * [email protected] * https://tsdemuxer.googlecode.com/svn/trunk/xupnpd */ #include "luajson.h" #include "luacompat.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> namespace libjson { int no_unicode_escape=1; int lua_json_no_unicode_escape(lua_State* L); int lua_json_encode(lua_State* L); int lua_json_decode(lua_State* L); int lua_json_encode_value(lua_State* L,luaL_Buffer* buf,int index); int luaL_pack_utf8_to_unicode(luaL_Buffer* buf,const unsigned char* p,int len); int luaL_pack_unicode_to_utf8(luaL_Buffer* buf,const unsigned char* p); void luaL_addjsonlstring(luaL_Buffer* buf,const char* p,size_t l); void luaL_addjson_unesc_lstring(luaL_Buffer* buf,const unsigned char* p,size_t l); int lua_json_parse(lua_State* L,const unsigned char* p,size_t l); static const unsigned char utf8_tab[256]= { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x74,0x6e,0x00,0x66,0x72,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2f, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81, 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81, 0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82, 0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x84,0x84,0x84,0x84,0x85,0x85,0x80,0x80 }; static const unsigned char unicode_tab[256]= { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2f, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0x00,0x00,0x00, 0x00,0x00,0x08,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00, 0x00,0x00,0x0d,0x00,0x09,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; } int luaopen_luajson(lua_State* L) { static const luaL_Reg lib[]= { {"no_unicode_escape",libjson::lua_json_no_unicode_escape}, {"encode",libjson::lua_json_encode}, {"decode",libjson::lua_json_decode}, {0,0} }; luaL_register(L,"json",lib); return 0; } int libjson::lua_json_no_unicode_escape(lua_State* L) { no_unicode_escape=luaL_checkint(L,1); return 0; } int libjson::luaL_pack_utf8_to_unicode(luaL_Buffer* buf,const unsigned char* p,int len) { char tmp[32]; int n=0; switch(len) { case 2: n=sprintf(tmp,"\\u%.4x",((((u_int16_t)p[0])<<6)&0x07c0)|(((u_int16_t)p[1])&0x003f)); break; case 3: n=sprintf(tmp,"\\u%.4x",((((u_int16_t)p[0])<<12)&0xf000)|((((u_int16_t)p[1])<<6)&0x0fc0)|(((u_int16_t)p[2])&0x003f)); break; default: tmp[n++]='?'; break; } luaL_addlstring(buf,tmp,n); return 0; } int libjson::luaL_pack_unicode_to_utf8(luaL_Buffer* buf,const unsigned char* p) { unsigned int ch=0; char tmp[32]; int n=0; { memcpy(tmp,p,4); tmp[4]=0; sscanf(tmp,"%x",&ch); } if(ch>=0x00000000 && ch<=0x0000007F) n=sprintf(tmp,"%c",(char)(ch&0x7f)); else if(ch>=0x00000080 && ch<=0x000007FF) n=sprintf(tmp,"%c%c",(char)(((ch>>6)&0x1f)|0xc0),(char)((ch&0x3f)|0x80)); else if(ch>=0x00000800 && ch<=0x0000FFFF) n=sprintf(tmp,"%c%c%c",(char)(((ch>>12)&0x0f)|0xe0),(char)(((ch>>6)&0x3f)|0x80),(char)((ch&0x3f)|0x80)); else tmp[n++]='?'; luaL_addlstring(buf,tmp,n); return 0; } void libjson::luaL_addjsonlstring(luaL_Buffer* buf,const char* p,size_t l) { for(size_t i=0;i<l;++i) { unsigned char ch=p[i]; unsigned char type=utf8_tab[ch]; if(!type) luaL_addchar(buf,ch); else { if(type&0x80) { if(no_unicode_escape) { luaL_addchar(buf,ch); }else { int n=type&0x0f; if(!n) break; else { if(l-i>n) { if(luaL_pack_utf8_to_unicode(buf,(unsigned char*)(p+i),n+1)) break; i+=n; }else break; } } }else { luaL_addchar(buf,'\\'); luaL_addchar(buf,type); } } } } void libjson::luaL_addjson_unesc_lstring(luaL_Buffer* buf,const unsigned char* p,size_t l) { for(size_t i=0;i<l;++i) { unsigned char ch=p[i]; if(ch=='\\') { unsigned char type=unicode_tab[p[++i]]; if(type==0xff) { if(l-i>3) { if(luaL_pack_unicode_to_utf8(buf,p+i+1)) break; i+=4; } }else if(type!=0) luaL_addchar(buf,type); }else luaL_addchar(buf,ch); } } int libjson::lua_json_encode_value(lua_State* L,luaL_Buffer* buf,int index) { static const char l_null[]="null"; static const char l_true[]="true"; static const char l_false[]="false"; size_t l; const char* p; int type=lua_type(L,index); switch(type) { case LUA_TNUMBER: p=lua_tolstring(L,index,&l); if(p) luaL_addlstring(buf,p,l); else luaL_addlstring(buf,l_null,sizeof(l_null)-1); break; case LUA_TBOOLEAN: if(lua_toboolean(L,index)>0) luaL_addlstring(buf,l_true,sizeof(l_true)-1); else luaL_addlstring(buf,l_false,sizeof(l_false)-1); break; case LUA_TSTRING: luaL_addchar(buf,'\"'); p=lua_tolstring(L,index,&l); if(p) luaL_addjsonlstring(buf,p,l); luaL_addchar(buf,'\"'); break; case LUA_TTABLE: { int ind=index>0?index:lua_gettop(L)+index+1; lua_pushnil(L); int is_array=0; int i=0; while(lua_next(L,ind)) { if(!i) { if(lua_type(L,-2)==LUA_TNUMBER) { is_array++; luaL_addchar(buf,'['); }else luaL_addchar(buf,'{'); } if(is_array) { if(i) luaL_addchar(buf,','); lua_json_encode_value(L,buf,-1); }else { if(lua_type(L,-2)==LUA_TSTRING) { if(i) luaL_addchar(buf,','); luaL_addchar(buf,'\"'); size_t l=0; const char* p=lua_tolstring(L,-2,&l); luaL_addlstring(buf,p,l); luaL_addchar(buf,'\"'); luaL_addchar(buf,':'); lua_json_encode_value(L,buf,-1); } } lua_pop(L,1); i++; } if(i>0) { if(is_array) luaL_addchar(buf,']'); else luaL_addchar(buf,'}'); }else luaL_addlstring(buf,l_null,sizeof(l_null)-1); } break; default: luaL_addlstring(buf,l_null,sizeof(l_null)-1); break; } return 0; } int libjson::lua_json_encode(lua_State* L) { int n=lua_gettop(L); luaL_Buffer buf; luaL_buffinit(L,&buf); for(int i=1;i<=n;++i) { if(i>1) luaL_addchar(&buf,','); lua_json_encode_value(L,&buf,i); } luaL_pushresult(&buf); return 1; } int libjson::lua_json_decode(lua_State* L) { size_t l=0; const unsigned char* p=(unsigned char*)luaL_checklstring(L,1,&l); return lua_json_parse(L,p,l); }
rollokb/tsdemuxer
xupnpd/src/luajson.cpp
C++
mit
8,732
/*! * tui-editor * @version 1.0.4 * @author NHN Ent. FE Development Lab <[email protected]> (https://nhnent.github.io/tui.editor/) * @license MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("jquery"), require("tui-code-snippet"), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor"); } catch(e) {} }()), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor/dist/tui-editor-Viewer"); } catch(e) {} }())); else if(typeof define === 'function' && define.amd) define(["jquery", "tui-code-snippet", "tui-editor", "tui-editor/dist/tui-editor-Viewer"], factory); else { var a = typeof exports === 'object' ? factory(require("jquery"), require("tui-code-snippet"), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor"); } catch(e) {} }()), (function webpackLoadOptionalExternalModule() { try { return require("tui-editor/dist/tui-editor-Viewer"); } catch(e) {} }())) : factory(root["$"], (root["tui"] && root["tui"]["util"]), (root["tui"] && root["tui"]["Editor"]), (root["tui"] && root["tui"]["Editor"])); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_5__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "dist/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 46); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 1: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @fileoverview Editor/Viewer proxy for extensions * @author NHN Ent. FE Development Lab <[email protected]> */ /* eslint global-require: 0 no-empty: 0 */ var Editor = void 0; try { Editor = __webpack_require__(4); } catch (e) {} if (!Editor) { try { Editor = __webpack_require__(5); } catch (e) {} } exports.default = Editor; /***/ }), /***/ 2: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }), /***/ 4: /***/ (function(module, exports) { if(typeof __WEBPACK_EXTERNAL_MODULE_4__ === 'undefined') {var e = new Error("Cannot find module \"undefined\""); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_4__; /***/ }), /***/ 46: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); var _editorProxy = __webpack_require__(1); var _editorProxy2 = _interopRequireDefault(_editorProxy); var _scrollManager = __webpack_require__(47); var _scrollManager2 = _interopRequireDefault(_scrollManager); var _sectionManager = __webpack_require__(48); var _sectionManager2 = _interopRequireDefault(_sectionManager); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @fileoverview Implements Scroll Sync Extension * @author NHN Ent. FE Development Lab <[email protected]> */ var Button = _editorProxy2.default.Button; /** * scrollSync plugin * @param {Editor} editor - editor * @ignore */ function scrollSyncExtension(editor) { var className = 'tui-scrollsync'; var i18n = editor.i18n; var TOOL_TIP = { active: i18n.get('Auto scroll enabled'), inActive: i18n.get('Auto scroll disabled') }; if (editor.isViewer()) { return; } var cm = editor.getCodeMirror(); var sectionManager = new _sectionManager2.default(cm, editor.preview); var scrollManager = new _scrollManager2.default(sectionManager, cm, editor.preview.$el); var isScrollable = false; var isActive = true; var button = void 0; var $divider = void 0; // UI if (editor.getUI().name === 'default') { // init button button = new Button({ className: className, command: 'scrollSyncToggle', tooltip: TOOL_TIP.active, $el: (0, _jquery2.default)('<button class="active ' + className + '" type="button"></button>') }); $divider = editor.getUI().toolbar.addDivider(); editor.getUI().toolbar.addButton(button); changeButtonVisiblityStateIfNeed(); // hide scroll follow button in wysiwyg editor.on('changeMode', changeButtonVisiblityStateIfNeed); editor.on('changePreviewStyle', changeButtonVisiblityStateIfNeed); // Commands editor.addCommand('markdown', { name: 'scrollSyncToggle', exec: function exec() { isActive = !isActive; button._onOut(); if (isActive) { button.$el.addClass('active'); button.tooltip = TOOL_TIP.active; } else { button.$el.removeClass('active'); button.tooltip = TOOL_TIP.inActive; } button._onOver(); } }); } // Events cm.on('change', function () { isScrollable = false; sectionManager.makeSectionList(); }); /** * change button visiblity state */ function changeButtonVisiblityStateIfNeed() { if (editor.mdPreviewStyle === 'vertical' && editor.currentMode === 'markdown') { button.$el.show(); $divider.show(); } else { button.$el.hide(); $divider.hide(); } } editor.on('previewRenderAfter', function () { sectionManager.sectionMatch(); scrollManager.syncPreviewScrollTopToMarkdown(); isScrollable = true; }); editor.eventManager.listen('scroll', function (event) { if (!isActive) { return; } if (isScrollable && editor.preview.isVisible()) { if (event.source === 'markdown' && !scrollManager.isMarkdownScrollEventBlocked) { scrollManager.syncPreviewScrollTopToMarkdown(); } else if (event.source === 'preview' && !scrollManager.isPreviewScrollEventBlocked) { scrollManager.syncMarkdownScrollTopToPreview(); } } else { scrollManager.saveScrollInfo(); } }); } _editorProxy2.default.defineExtension('scrollSync', scrollSyncExtension); exports.default = scrollSyncExtension; /***/ }), /***/ 47: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** * @fileoverview Implements Scroll Sync Extension ScrollManager Module * @author NHN Ent. FE Development Lab <[email protected]> */ var _tuiCodeSnippet = __webpack_require__(2); var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var PREVIEW_MARGIN_TOP = 57; var SCROLL_TOP_PADDING = 20; var SCROLL_BOCKING_RESET_DELAY = 15; /** * Class ScrollManager * manage scroll sync between markdown editor and preview */ var ScrollManager = function () { /** * Creates an instance of ScrollManager. * @param {SectionManager} sectionManager - sectionManager * @param {CodeMirror} cm - CodeMirror * @param {jQuery} $previewContainerEl - preview container * @memberof ScrollManager */ function ScrollManager(sectionManager, cm, $previewContainerEl) { _classCallCheck(this, ScrollManager); this.sectionManager = sectionManager; this.cm = cm; this.$previewContainerEl = $previewContainerEl; this.$contents = this.$previewContainerEl.find('.tui-editor-contents'); this.releaseTimer = null; /** * current timeout id needs animation * @type {number} */ this._currentTimeoutId = null; /** * Saved scrollInfo object of CodeMirror * @type {object} */ this._savedScrollInfo = null; } /** * _getEditorSectionHeight * Return section height of editor * @param {object} section section be calculated height * @returns {number} height * @private */ _createClass(ScrollManager, [{ key: '_getEditorSectionHeight', value: function _getEditorSectionHeight(section) { var height = this.cm.heightAtLine(section.end, 'local'); height -= this.cm.heightAtLine(section.start > 0 ? section.start - 1 : 0, 'local'); return height; } /** * _getLineHeightGapInSection * Return height gap between passed line in passed section * @param {object} section section be calculated * @param {number} line line number * @returns {number} gap * @private */ }, { key: '_getEditorLineHeightGapInSection', value: function _getEditorLineHeightGapInSection(section, line) { var gap = this.cm.heightAtLine(line, 'local'); gap -= this.cm.heightAtLine(section.start > 0 ? section.start - 1 : 0, 'local'); return Math.max(gap, 0); } /** * _getSectionScrollRatio * Return ratio of height between scrollTop line and scrollTop section * @param {object} section section be calculated * @param {number} line line number * @returns {number} ratio * @private */ }, { key: '_getEditorSectionScrollRatio', value: function _getEditorSectionScrollRatio(section, line) { var isOneLine = section.end === section.start; var ratio = void 0; if (isOneLine) { ratio = 0; } else { ratio = this._getEditorLineHeightGapInSection(section, line) / this._getEditorSectionHeight(section); } return ratio; } /** * _getScrollFactorsOfEditor * Return Scroll Information of editor for preview scroll sync * @returns {object} scroll factors * @private */ }, { key: '_getScrollFactorsOfEditor', value: function _getScrollFactorsOfEditor() { var cm = this.cm; var scrollInfo = cm.getScrollInfo(); var topLine = void 0, topSection = void 0, ratio = void 0, factors = void 0; // if codemirror has not visible scrollInfo have incorrect value // so we use saved scroll info for alternative scrollInfo = this._fallbackScrollInfoIfIncorrect(scrollInfo); var isEditorBottom = scrollInfo.height - scrollInfo.top <= scrollInfo.clientHeight; if (isEditorBottom) { factors = { isEditorBottom: isEditorBottom }; } else { topLine = cm.coordsChar({ left: scrollInfo.left, top: scrollInfo.top }, 'local').line; topSection = this.sectionManager.sectionByLine(topLine); ratio = this._getEditorSectionScrollRatio(topSection, topLine); factors = { section: topSection, sectionRatio: ratio }; } return factors; } /** * Return Scroll Information of editor for Markdown scroll sync * @returns {object} scroll factors * @private */ }, { key: '_getScrollInfoForMarkdown', value: function _getScrollInfoForMarkdown() { var _this = this; var sectionList = this.sectionManager.getSectionList(); var factors = void 0; _tuiCodeSnippet2.default.forEachArray(sectionList, function (section) { var $div = section.$previewSectionEl; var $preview = $div.parent().parent(); var isPreviewBottom = $preview[0].clientHeight - $preview.scrollTop() <= $preview[0].height; var needNext = true; if (isPreviewBottom) { factors = { isPreviewBottom: isPreviewBottom }; needNext = false; } else if (_this._isTopSection($preview, $div)) { factors = { section: section, sectionRatio: _this._getMarkdownEditorScrollRatio($preview, $div) }; needNext = false; } return needNext; }); return factors; } /** * Return ScrollRatio for Markdown scroll value * @param {jQuery} $preview jQuery wrapped preview container * @param {jQuery} $div jQuery wrapped section div element * @returns {number} * @private */ }, { key: '_getMarkdownEditorScrollRatio', value: function _getMarkdownEditorScrollRatio($preview, $div) { return ($preview.scrollTop() - $div[0].offsetTop) / $div.height(); } /** * _getScrollTopForPreview * Return scrollTop value for preview * @returns {number|undefined} scrollTop value, when something wrong then return undefined * @private */ }, { key: '_getScrollTopForPreview', value: function _getScrollTopForPreview() { var scrollTop = void 0; var scrollFactors = this._getScrollFactorsOfEditor(); var section = scrollFactors.section, sectionRatio = scrollFactors.sectionRatio; if (scrollFactors.isEditorBottom) { scrollTop = this.$contents.height(); } else if (section.$previewSectionEl) { scrollTop = section.$previewSectionEl[0].offsetTop; scrollTop += section.$previewSectionEl.height() * sectionRatio - SCROLL_TOP_PADDING; } scrollTop = scrollTop && Math.max(scrollTop, 0); return scrollTop; } /** * Return scrollTop value for Markdown editor * @returns {number} * @private */ }, { key: '_getScrollTopForMarkdown', value: function _getScrollTopForMarkdown() { var scrollTop = void 0; var scrollFactors = this._getScrollInfoForMarkdown(); var ratio = scrollFactors.sectionRatio; if (scrollFactors.isPreviewBottom) { scrollTop = this.cm.getScrollInfo().height; } else if (scrollFactors.section) { var section = scrollFactors.section; var coordsAtStart = this.cm.charCoords({ line: section.start, char: 0 }, 'local'); var coordsAtEnd = this.cm.charCoords({ line: section.end, char: 0 }, 'local'); scrollTop = coordsAtStart.top; scrollTop += (coordsAtEnd.top - coordsAtStart.top) * ratio; } scrollTop = scrollTop && Math.max(scrollTop, 0); return scrollTop; } /** * syncPreviewScrollTopToMarkdown * sync preview scroll to markdown */ }, { key: 'syncPreviewScrollTopToMarkdown', value: function syncPreviewScrollTopToMarkdown() { var _this2 = this; var $previewContainerEl = this.$previewContainerEl; var sourceScrollTop = $previewContainerEl.scrollTop(); var targetScrollTop = this._getScrollTopForPreview(); this.isPreviewScrollEventBlocked = true; this._animateRun(sourceScrollTop, targetScrollTop, function (deltaScrollTop) { clearTimeout(_this2.releaseTimer); $previewContainerEl.scrollTop(deltaScrollTop); _this2.releaseTimer = setTimeout(function () { _this2.isPreviewScrollEventBlocked = false; }, SCROLL_BOCKING_RESET_DELAY); }); } /** * syncMarkdownScrollTopToPreview * sync markdown scroll to preview */ }, { key: 'syncMarkdownScrollTopToPreview', value: function syncMarkdownScrollTopToPreview() { var _this3 = this; var codeMirror = this.cm; var codeMirrorScrollInfo = codeMirror.getScrollInfo(); var sourceScrollTop = codeMirrorScrollInfo.top; var targetScrollTop = this._getScrollTopForMarkdown(); this.isMarkdownScrollEventBlocked = true; this._animateRun(sourceScrollTop, targetScrollTop, function (deltaScrollTop) { clearTimeout(_this3.releaseTimer); codeMirror.scrollTo(0, deltaScrollTop); _this3.releaseTimer = setTimeout(function () { _this3.isMarkdownScrollEventBlocked = false; }, SCROLL_BOCKING_RESET_DELAY); }); } /** * _animateRun * animate with passed Callback * @param {number} originValue original value * @param {number} targetValue target value * @param {function} stepCB callback function * @private */ }, { key: '_animateRun', value: function _animateRun(originValue, targetValue, stepCB) { var valueDiff = targetValue - originValue, startTime = Date.now(), self = this; // if already doing animation if (this._currentTimeoutId) { clearTimeout(this._currentTimeoutId); } /** * Each animation step */ function step() { var stepTime = Date.now(); var progress = (stepTime - startTime) / 200; // 200 is animation time var deltaValue = void 0; if (progress < 1) { deltaValue = originValue + valueDiff * Math.cos((1 - progress) * Math.PI / 2); stepCB(Math.ceil(deltaValue)); self._currentTimeoutId = setTimeout(step, 1); } else { stepCB(targetValue); self._currentTimeoutId = null; } } step(); } /** * Fallback to saved scrolInfo if incorrect scrollInfo passed * this because incorrect CodeMirror returns scrollInfo if CodeMirror is invisible * @param {object} scrollInfo scrollInfo * @returns {object} scrollInfo * @private */ }, { key: '_fallbackScrollInfoIfIncorrect', value: function _fallbackScrollInfoIfIncorrect(scrollInfo) { return scrollInfo.height < 0 && this._savedScrollInfo ? this._savedScrollInfo : scrollInfo; } /** * Save Codemirror's scrollInfo for alternative use * memberOf ScrollManager */ }, { key: 'saveScrollInfo', value: function saveScrollInfo() { this._savedScrollInfo = this.cm.getScrollInfo(); } /** * Return whether given range is top section of preview contents or not * @param {jQuery} $preview jQuery wrapped preview container * @param {jQuery} $div jQuery wrapped section div element * @returns {boolean} * @private */ }, { key: '_isTopSection', value: function _isTopSection($preview, $div) { var previewScrollTop = $preview.scrollTop(); var divOffsetTop = $div[0].offsetTop; var divHeight = $div.height(); var isSectionBegin = previewScrollTop >= divOffsetTop - PREVIEW_MARGIN_TOP; var isSectionEnd = previewScrollTop > divOffsetTop + divHeight; return isSectionBegin && !isSectionEnd; } }]); return ScrollManager; }(); exports.default = ScrollManager; /***/ }), /***/ 48: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** * @fileoverview Implements Scroll Sync Extension SectionManager Module * @author NHN Ent. FE Development Lab <[email protected]> */ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var FIND_HEADER_RX = /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/; var FIND_LIST_RX = /^ *(\*|-|\d+\.|[*-] \[[ xX]])\s/; var FIND_QUOTE_RX = /^ {0,3}(> ?)+\s/; var FIND_IMAGE_RX = /^ {0,3}!\[([^[\]]*)]\(([^)]*)\)/; var FIND_SETEXT_HEADER_RX = /^ *(?:={1,}|-{1,})\s*$/; var FIND_CODEBLOCK_END_RX = /^ *(`{3,}|~{3,})[ ]*$/; var FIND_CODEBLOCK_START_RX = /^ *(`{3,}|~{3,})[ .]*(\S+)? */; var FIND_SPACE = /\s/g; /** * Class SectionManager * manage logical markdown content sections */ var SectionManager = function () { /** * Creates an instance of SectionManager. * @param {CodeMirror} cm - codemirror * @param {Preview} preview - preview * @memberof SectionManager */ function SectionManager(cm, preview) { _classCallCheck(this, SectionManager); this.cm = cm; this.preview = preview; this.$previewContent = preview.$el.find('.tui-editor-contents'); /** * section list * @type {object[]} */ this._sectionList = null; /** * current working section needs making section list * @type {object} */ this._currentSection = null; } /** * _addNewSection * add new section * @param {number} start initial start line number * @param {number} end initial end line number * @private */ _createClass(SectionManager, [{ key: '_addNewSection', value: function _addNewSection(start, end) { var newSection = this._makeSectionData(start, end); this._sectionList.push(newSection); this._currentSection = newSection; } /** * getSectionList * return section list * @returns {object[]} section object list */ }, { key: 'getSectionList', value: function getSectionList() { if (!this._sectionList) { this.makeSectionList(); } return this._sectionList; } /** * _makeSectionData * make default section object * @param {number} start initial start line number * @param {number} end initial end line number * @returns {object} section object * @private */ }, { key: '_makeSectionData', value: function _makeSectionData(start, end) { return { start: start, end: end, $previewSectionEl: null }; } /** * _updateCurrentSectionEnd * update current section's end line number * @param {number} end end value to update * @private */ }, { key: '_updateCurrentSectionEnd', value: function _updateCurrentSectionEnd(end) { this._currentSection.end = end; } /** * _eachLineState * iterate codemiror lines, callback function parameter pass line type and line number * @param {function} iteratee callback function * @private */ }, { key: '_eachLineState', value: function _eachLineState(iteratee) { var isSection = void 0, i = void 0, lineString = void 0, nextLineString = void 0, prevLineString = void 0, isTrimming = true, onTable = false, onCodeBlock = false, trimCapture = ''; var isRightAfterImageSection = false; var isEnsuredSection = false; var codeblockStartLineIndex = void 0; var lineLength = this.cm.getDoc().lineCount(); for (i = 0; i < lineLength; i += 1) { isSection = false; lineString = this.cm.getLine(i); nextLineString = this.cm.getLine(i + 1) || ''; prevLineString = this.cm.getLine(i - 1) || ''; var isCodeBlockEnded = this._isCodeBlockEnd(prevLineString) && codeblockStartLineIndex !== i - 1; if (onTable && (!lineString || !this._isTableCode(lineString))) { onTable = false; } else if (!onTable && this._isTable(lineString, nextLineString)) { onTable = true; } if (onCodeBlock && isCodeBlockEnded) { onCodeBlock = false; } if (!onCodeBlock && this._isCodeBlockStart(lineString)) { onCodeBlock = this._doFollowedLinesHaveCodeBlockEnd(i, lineLength); codeblockStartLineIndex = i; } if (isEnsuredSection && lineString.length !== 0) { if (this._isIndependentImage(onCodeBlock, onTable, lineString, prevLineString)) { isRightAfterImageSection = true; isEnsuredSection = true; } else { isRightAfterImageSection = false; isEnsuredSection = false; } isSection = true; } else if (this._isAtxHeader(lineString)) { isRightAfterImageSection = false; isSection = true; isEnsuredSection = false; // setext header } else if (!this._isCodeBlockEnd(lineString) && !onTable && this._isSeTextHeader(lineString, nextLineString)) { isRightAfterImageSection = false; isSection = true; isEnsuredSection = false; } else if (this._isIndependentImage(onCodeBlock, onTable, lineString, prevLineString)) { isRightAfterImageSection = true; isSection = true; isEnsuredSection = false; } else if (isRightAfterImageSection && lineString.length === 0) { isRightAfterImageSection = false; isEnsuredSection = true; } // resolve wrong number of sections mismatch compare to preview if (isTrimming) { trimCapture += lineString.trim(); if (trimCapture) { isTrimming = false; } else { continue; } } iteratee(isSection, i); } } /** * Return whether is independent image line with padding lines top and bottom * @param {boolean} onCodeBlock Is on codeblock * @param {boolean} onTable Is on table * @param {string} lineString Current line string * @param {string} prevLineString Previous line string * @returns {boolean} * @private */ }, { key: '_isIndependentImage', value: function _isIndependentImage(onCodeBlock, onTable, lineString, prevLineString) { return !onCodeBlock && !onTable && this._isImage(lineString) && !this._isList(lineString) && !this._isQuote(lineString) && prevLineString.length === 0; } /** * _doFollowedLinesHaveCodeBlockEnd * Check if follow lines have codeblock end * @param {number} lineIndex current index * @param {number} lineLength line length * @returns {boolean} result * @private */ }, { key: '_doFollowedLinesHaveCodeBlockEnd', value: function _doFollowedLinesHaveCodeBlockEnd(lineIndex, lineLength) { var doLineHaveCodeBlockEnd = false; for (var i = lineIndex + 1; i < lineLength; i += 1) { if (this._isCodeBlockEnd(this.cm.getLine(i))) { doLineHaveCodeBlockEnd = true; break; } } return doLineHaveCodeBlockEnd; } /** * _isCodeBlockStart * Check if passed string have code block start * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isCodeBlockStart', value: function _isCodeBlockStart(string) { return FIND_CODEBLOCK_START_RX.test(string); } /** * _isCodeBlockEnd * Check if passed string have code block end * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isCodeBlockEnd', value: function _isCodeBlockEnd(string) { return FIND_CODEBLOCK_END_RX.test(string); } /** * _isTable * Check if passed string have table * @param {string} lineString current line string * @param {string} nextLineString next line string * @returns {boolean} result * @private */ }, { key: '_isTable', value: function _isTable(lineString, nextLineString) { return this._isTableCode(lineString) && this._isTableAligner(nextLineString); } /** * _isTableCode * Check if passed string have table code * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isTableCode', value: function _isTableCode(string) { return (/(^\S?.*\|.*)/.test(string) ); } /** * _isTableAligner * Check if passed string have table align code * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isTableAligner', value: function _isTableAligner(string) { return (/(\s*[-:]+\s*\|)+/.test(string) ); } /** * _isAtxHeader * Check if passed string have atx header * @param {string} string string to check * @returns {boolean} result * @private */ }, { key: '_isAtxHeader', value: function _isAtxHeader(string) { return FIND_HEADER_RX.test(string); } /** * _isSeTextHeader * @param {string} lineString current line string * @param {string} nextLineString next line string * @returns {boolean} result * @private */ }, { key: '_isSeTextHeader', value: function _isSeTextHeader(lineString, nextLineString) { return lineString.replace(FIND_SPACE, '') !== '' && nextLineString && FIND_SETEXT_HEADER_RX.test(nextLineString); } }, { key: '_isImage', value: function _isImage(lineString) { return FIND_IMAGE_RX.test(lineString); } }, { key: '_isList', value: function _isList(lineString) { return FIND_LIST_RX.test(lineString); } }, { key: '_isQuote', value: function _isQuote(lineString) { return FIND_QUOTE_RX.test(lineString); } /** * makeSectionList * make section list */ }, { key: 'makeSectionList', value: function makeSectionList() { var _this = this; this._sectionList = []; this._eachLineState(function (isSection, lineNumber) { if (isSection || !_this._sectionList.length) { _this._addNewSection(lineNumber, lineNumber); } else { _this._updateCurrentSectionEnd(lineNumber); } }); } /** * sectionMatch * make preview sections then match section list with preview section element */ }, { key: 'sectionMatch', value: function sectionMatch() { if (this.getSectionList()) { var sections = this._getPreviewSections(); this._matchPreviewSectionsWithSectionlist(sections); } } /** * _matchPreviewSectionsWithSectionlist * match section list with preview section element * @param {HTMLNode[]} sections section nodes * @private */ }, { key: '_matchPreviewSectionsWithSectionlist', value: function _matchPreviewSectionsWithSectionlist(sections) { var sectionList = this.getSectionList(); sections.forEach(function (childs, index) { var section = sectionList[index]; if (section) { var $sectionDiv = (0, _jquery2.default)('<div class=\'content-id-' + index + '\'></div>'); section.$previewSectionEl = (0, _jquery2.default)(childs).wrapAll($sectionDiv).parent(); } }); } /** * _getPreviewSections * get preview html section group to make section * @returns {array[]} element node array * @private */ }, { key: '_getPreviewSections', value: function _getPreviewSections() { var sections = []; var lastSection = 0; var isRightAfterImageSection = false; sections[0] = []; this.$previewContent.contents().filter(findElementNodeFilter).each(function (index, el) { var isParagraph = el.tagName === 'P'; var isHeading = el.tagName.match(/^(H1|H2|H3|H4|H5|H6)$/); var isImage = isParagraph && el.childNodes[0].nodeName === 'IMG'; if ((isHeading || isImage || isRightAfterImageSection) && sections[lastSection].length) { sections.push([]); lastSection += 1; isRightAfterImageSection = false; } if (isImage) { isRightAfterImageSection = true; } sections[lastSection].push(el); }); return sections; } /** * _sectionByLine * get section by markdown line * @param {number} line markdown editor line number * @returns {object} section */ }, { key: 'sectionByLine', value: function sectionByLine(line) { var sectionIndex = void 0; var sectionList = this.getSectionList(); var sectionLength = sectionList.length; for (sectionIndex = 0; sectionIndex < sectionLength; sectionIndex += 1) { if (line <= sectionList[sectionIndex].end) { break; } } if (sectionIndex === sectionLength) { sectionIndex = sectionLength - 1; } return sectionList[sectionIndex]; } }]); return SectionManager; }(); /** * findElementNodeFilter * @this Node * @returns {boolean} true or not * @ignore */ function findElementNodeFilter() { return this.nodeType === Node.ELEMENT_NODE; } exports.default = SectionManager; /***/ }), /***/ 5: /***/ (function(module, exports) { if(typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') {var e = new Error("Cannot find module \"undefined\""); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_5__; /***/ }) /******/ }); });
sufuf3/cdnjs
ajax/libs/tui-editor/1.0.4/tui-editor-extScrollSync.js
JavaScript
mit
39,460
@font-face { font-family: "Gotham"; src: local("Gotham"), url("../../lib/font/Gotham-Medium.otf") format("opentype"); font-weight: normal; font-style: normal; } @font-face { font-family: "Gotham-Book"; src: local("Gotham-Book"), url("../../lib/font/Gotham-Book.otf") format("opentype"); font-weight: normal; font-style: normal; } @font-face { font-family: "Gotham-Italic"; src: local("Gotham-Italic"), url("../../lib/font/Gotham-MediumItalic.otf") format("opentype"); font-weight: normal; font-style: italic; } @font-face { font-family: "Gotham-Bold"; src: local("Gotham-Bold"), url("../../lib/font/Gotham-Bold.otf") format("opentype"); font-weight: bold; font-style: bold; } /********************************************* * GLOBAL STYLES *********************************************/ body { background: #fcf3e0; background: -moz-radial-gradient(center, circle cover, #f7fbfc 0%, #fcf3e0 100%); background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #f7fbfc), color-stop(100%, #fcf3e0)); background: -webkit-radial-gradient(center, circle cover, #f7fbfc 0%, #fcf3e0 100%); background: -o-radial-gradient(center, circle cover, #f7fbfc 0%, #fcf3e0 100%); background: -ms-radial-gradient(center, circle cover, #f7fbfc 0%, #fcf3e0 100%); background: radial-gradient(center, circle cover, #f7fbfc 0%, #fcf3e0 100%); background-color: #f7fbfc; } .reveal { font-family: "Gotham-Book", "Helvetica", Arial, sans-serif; font-size: 36px; font-weight: 200; letter-spacing: -0.02em; color: #333333; } ::selection { color: white; background: #134674; text-shadow: none; } /********************************************* * HEADERS *********************************************/ .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { margin: 0 0 20px 0; color: #f05b62; font-family: "Gotham-Bold", Impact, sans-serif; line-height: 0.9em; letter-spacing: -0.08em; text-transform: uppercase; text-shadow: none; } .reveal h1 { text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } /********************************************* * LINKS *********************************************/ .reveal a:not(.image) { color: #92bb44; text-decoration: none; -webkit-transition: color .15s ease; -moz-transition: color .15s ease; -ms-transition: color .15s ease; -o-transition: color .15s ease; transition: color .15s ease; } .reveal a:not(.image):hover { color: #f9b8bb; text-shadow: none; border: none; } .reveal .roll span:after { color: #fff; background: #92bb44; } /********************************************* * IMAGES *********************************************/ .reveal section img { margin: 15px; background: rgba(255, 255, 255, 0.12); border: 4px solid #333333; box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); -webkit-transition: all .2s linear; -moz-transition: all .2s linear; -ms-transition: all .2s linear; -o-transition: all .2s linear; transition: all .2s linear; } .reveal a:hover img { background: rgba(255, 255, 255, 0.2); border-color: #92bb44; box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } /********************************************* * NAVIGATION CONTROLS *********************************************/ .reveal .controls div.left, .reveal .controls div.left.enabled { border-right-color: #92bb44; } .reveal .controls div.right, .reveal .controls div.right.enabled { border-left-color: #92bb44; } .reveal .controls div.up, .reveal .controls div.up.enabled { border-bottom-color: #92bb44; } .reveal .controls div.down, .reveal .controls div.down.enabled { border-top-color: #92bb44; } .reveal .controls div.left.enabled:hover { border-right-color: #f9b8bb; } .reveal .controls div.right.enabled:hover { border-left-color: #f9b8bb; } .reveal .controls div.up.enabled:hover { border-bottom-color: #f9b8bb; } .reveal .controls div.down.enabled:hover { border-top-color: #f9b8bb; } /********************************************* * PROGRESS BAR *********************************************/ .reveal .progress { background: rgba(0, 0, 0, 0.2); } .reveal .progress span { background: #92bb44; -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
girldevelopit/reveal.js
reveal-gdi-theme-sample/css/theme/gdisunny.css
CSS
mit
4,551
//-***************************************************************************** // // Copyright (c) 2009-2015, // Sony Pictures Imageworks Inc. and // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. // // 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 Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // //-***************************************************************************** // MurmurHash3 was written by Austin Appleby, and is placed in the public // domain. The author hereby disclaims copyright to this source code. #ifndef _Alembic_Util_Murmur3_h_ #define _Alembic_Util_Murmur3_h_ #include <Alembic/Util/Export.h> #include <Alembic/Util/Foundation.h> namespace Alembic { namespace Util { namespace ALEMBIC_VERSION_NS { ALEMBIC_EXPORT void MurmurHash3_x64_128 ( const void * key, const size_t len, const size_t podSize, void * out ); } // End namespace ALEMBIC_VERSION_NS using namespace ALEMBIC_VERSION_NS; } // End namespace Util } // End namespace Alembic #endif
perfume-dev/ofxAlembic
libs/alembic/include/Alembic/Util/Murmur3.h
C
mit
2,485
package vm_test import ( "os" "path/filepath" . "github.com/grubby/grubby/interpreter/vm" . "github.com/grubby/grubby/interpreter/vm/builtins" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Hashes", func() { var vm VM BeforeEach(func() { pathToExecutable, err := filepath.Abs(filepath.Dir(filepath.Dir(filepath.Dir(os.Args[0])))) if err != nil { panic(err) } vm = NewVM(pathToExecutable, "fake-irb-under-test") }) It("can be constructed as a hash literal", func() { hash, err := vm.Run("{:key => :value}") Expect(err).ToNot(HaveOccurred()) keysMethod := hash.Method("keys") Expect(keysMethod).ToNot(BeNil()) keys, err := keysMethod.Execute(hash, nil) Expect(err).ToNot(HaveOccurred()) keyArray, ok := keys.(*Array) Expect(ok).To(BeTrue()) Expect(keyArray.Members()).To(ContainElement(vm.Symbols()["key"])) valuesMethod := hash.Method("values") Expect(valuesMethod).ToNot(BeNil()) values, err := valuesMethod.Execute(hash, nil) Expect(err).ToNot(HaveOccurred()) valueArray, ok := values.(*Array) Expect(ok).To(BeTrue()) Expect(valueArray.Members()).To(ContainElement(vm.Symbols()["value"])) method := hash.Method("[]=") Expect(method).ToNot(BeNil()) fooSymbol := NewSymbol("foo", vm) barSymbol := NewSymbol("bar", vm) _, err = method.Execute(hash, nil, fooSymbol, barSymbol) Expect(err).ToNot(HaveOccurred()) keys, err = keysMethod.Execute(hash, nil) Expect(err).ToNot(HaveOccurred()) keyArray, ok = keys.(*Array) Expect(ok).To(BeTrue()) Expect(keyArray.Members()).To(ContainElement(fooSymbol)) values, err = valuesMethod.Execute(hash, nil) Expect(err).ToNot(HaveOccurred()) valueArray, ok = values.(*Array) Expect(ok).To(BeTrue()) Expect(valueArray.Members()).To(ContainElement(barSymbol)) }) It("has a reasonable String() method", func() { val, err := vm.Run("{:hello => 'world'}") Expect(err).ToNot(HaveOccurred()) Expect(val.String()).To(Equal("{:hello => \"world\"}")) }) It("can yield the value for keys with the [] operator", func() { value, err := vm.Run(` hash = {:hello => :world} hash[:hello] `) Expect(err).ToNot(HaveOccurred()) Expect(value).To(Equal(vm.Symbols()["world"])) }) Describe("iterating over the keys and items", func() { var err error BeforeEach(func() { _, err = vm.Run(` keys = [] values = [] {:foo => 1, :bar => 2}.each do |key, value| keys.unshift(key) values.unshift(value) end `) }) It("calls the provided block once with each item in the hash", func() { Expect(err).ToNot(HaveOccurred()) keysObj := vm.MustGet("keys") keysArray, ok := keysObj.(*Array) Expect(ok).To(BeTrue()) keys := keysArray.Members() Expect(len(keys)).To(Equal(2)) Expect(keys).To(ContainElement(vm.Symbols()["foo"])) Expect(keys).To(ContainElement(vm.Symbols()["bar"])) valuesObj := vm.MustGet("values") valuesArray, ok := valuesObj.(*Array) Expect(ok).To(BeTrue()) values := valuesArray.Members() Expect(len(values)).To(Equal(2)) Expect(values).To(ContainElement(NewFixnum(1, vm))) Expect(values).To(ContainElement(NewFixnum(2, vm))) }) }) })
kachick/grubby
interpreter/vm/hash_test.go
GO
mit
3,170
var oauthModule = require('./oauth2') , querystring= require('querystring'); var smarterer = module.exports = oauthModule.submodule('smarterer') .oauthHost('https://smarterer.com') .apiHost('https://smarterer.com') .entryPath('/auth/smarterer') .callbackPath('/auth/smarterer/callback') .authQueryParam('callback_url', function() { return this._myHostname + this._callbackPath; }) .accessTokenParam('grant_type', 'authorization_code') .fetchOAuthUser( function (accessToken) { var p = this.Promise(); this.oauth.get(this.apiHost() + '/api/badges', accessToken, function (err, data) { if (err) return p.fail(err.error_message); var oauthUser = JSON.parse(data); p.fulfill(oauthUser); }) return p; }) .convertErr( function (data) { return new Error(data.error_message); });
fjytzh/pomeframe
web-server/node_modules/everyauth/lib/modules/smarterer.js
JavaScript
mit
844
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Elemental - The force of nature</title> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.useso.com/css?family=Pacifico' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/960_12_col.css"> <link rel="stylesheet" href="css/jquery.fancybox.css"> <link rel="stylesheet" href="css/style.css"> </head> <body> <div class="wrapper"> <header> <div id="logo"> <img class="aligncenter" src="images/logo.png" alt="" title=""> <span>AWESOME PORTFOLIO</span> </div> <nav> <ul> <li class="content active"><a href="#">Home</a></li> <li class="portfolio"><a href="#">Portfolio</a></li> <li class="author"><a href="#">About</a></li> <li id="logo_placeholder"></li> <li class="skins"><a href="#">Skins</a></li> <li class="services"><a href="#">Services</a></li> <li class="contact"><a href="#">Contact</a></li> <li id="selector"></li> </ul> </nav> </header> </div> <div id="content"> <div class="wrapper"> <div id="latestProjects"> <div class="leftArrow"></div> <div class="rightArrow"></div> <div id="gallery"> <ul> <li> <a href="images/large_img.jpg" rel="gallery" class="fancybox" title="Description goes here"><img src="images/header_img1.png" width="220" height="375" alt="" title=""></a> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><span class="zoom"></span></a> <div class="details"> <h2>Scorching Flower</h2> <p> CLIENT<br> <a href="#">Hanabi Inc.</a><br> SERVICES<br> <span>3D Graphics, Branding</span> </p> </div> <a href="#" class="button">Project <strong>Details</strong></a> </li> <li> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><img src="images/header_img2.png" width="220" height="375" alt="" title=""></a> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><span class="zoom"></span></a> <div class="details"> <h2>Scorching Flower</h2> <p> CLIENT<br> <a href="#">Hanabi Inc.</a><br> SERVICES<br> <span>3D Graphics, Branding</span> </p> </div> <a href="#" class="button">Project <strong>Details</strong></a> </li> <li> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><img src="images/header_img3.png" width="220" height="375" alt="" title=""></a> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><span class="zoom"></span></a> <div class="details"> <h2>Scorching Flower</h2> <p> CLIENT<br> <a href="#">Hanabi Inc.</a><br> SERVICES<br> <span>3D Graphics, Branding</span> </p> </div> <a href="#" class="button">Project <strong>Details</strong></a> </li> <li> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><img src="images/header_img4.png" width="220" height="375" alt="" title=""></a> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><span class="zoom"></span></a> <div class="details"> <h2>Scorching Flower</h2> <p> CLIENT<br> <a href="#">Hanabi Inc.</a><br> SERVICES<br> <span>3D Graphics, Branding</span> </p> </div> <a href="#" class="button">Project <strong>Details</strong></a> </li> <li> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><img src="images/header_img5.png" width="220" height="375" alt="" title=""></a> <a href="images/large_img.jpg" rel="gallery" class="fancybox"><span class="zoom"></span></a> <div class="details"> <h2>Scorching Flower</h2> <p> CLIENT<br> <a href="#">Hanabi Inc.</a><br> SERVICES<br> <span>3D Graphics, Branding</span> </p> </div> <a href="#" class="button">Project <strong>Details</strong></a> </li> </ul> </div> </div><!-- end latestProjects --> </div> <div class="slider"> <div class="wrapper"> <div class="sliderBar"></div> </div> </div> </div> <!-- end content --> <div id="portfolio"> <div id="category"> <form action="#" method="post"> <h2>Category</h2> <select id="category_select"> <option value="mixed">Mixed</option> <option value="design">Design</option> <option value="coding">Coding</option> <option value="photo">Photo</option> </select> </form> </div> <div class="leftArrow"></div> <div class="rightArrow"></div> <div class="slider"> <ul class="container clearfix" > <li class="slide"> <ul class="clearfix"> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb1.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb2.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb3.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb4.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb5.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb6.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb7.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb8.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb9.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb10.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb11.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb12.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb13.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb14.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb15.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb16.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb17.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb18.png" alt="" title=""> <div class="zoom"></div> </a> </li> </ul> </li> <li class="slide"> <ul class="clearfix"> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb1.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb2.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb3.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb4.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb5.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb6.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb7.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb8.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb9.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb10.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb11.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb12.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb13.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb14.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb15.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb16.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb17.png" alt="" title=""> <div class="zoom"></div> </a> </li> <li> <a href="images/large_img.jpg" class="fancybox" rel="portfolio_gallery"> <img src="images/portfolio/thumb18.png" alt="" title=""> <div class="zoom"></div> </a> </li> </ul> </li> </ul> </div> </div><!-- end portfolio --> <div id="author"> <div class="name alignleft"> <div class="img"> <img src="images/author_img.png" alt="" title=""> </div> <h1>John Doe</h1> </div> <div class="desc"> <h2>Hey There!</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate elit ut justo commodo scelerisque. Aliquam et vehicula sem. Quisque vestibulum condimentum mi, nec eleifend enim tincidunt eget. Integer mollis tincidunt ve it, vitae luctus magna euismod eu. Ut sed turpis magna. Proin fringilla lacus id libero vehicula cursus. Aliquam nulla eque, venenatis quis adipiscing ac, euismod at mauris. Curabitur a lacus diam. Donec aliquam ullamcorper congue. </p> <div class="socialMedia"> <img src="images/facebook_icon.png" alt="" title=""> <img src="images/twitter_icon.png" alt="" title=""> </div> </div> <h3>OUR AWESOME TEAM</h3> <ul id="team" class="clearfix"> <li> <div class="member_img"> <img src="images/team_img1.png" alt="" title=""> </div> <h2>Jane Doe</h2> <span>MARKETING</span> <p> Fusce facilisis bibendum accumsan. Nunc aliquam condimentum lectus non aliquet. </p> </li> <li> <div class="member_img"> <img src="images/team_img1.png" alt="" title=""> </div> <h2>Jane Doe</h2> <span>MARKETING</span> <p> Fusce facilisis bibendum accumsan. Nunc aliquam condimentum lectus non aliquet. </p> </li> <li> <div class="member_img"> <img src="images/team_img1.png" alt="" title=""> </div> <h2>Jane Doe</h2> <span>MARKETING</span> <p> Fusce facilisis bibendum accumsan. Nunc aliquam condimentum lectus non aliquet. </p> </li> <li> <div class="member_img"> <img src="images/team_img1.png" alt="" title=""> </div> <h2>Jane Doe</h2> <span>MARKETING</span> <p> Fusce facilisis bibendum accumsan. Nunc aliquam condimentum lectus non aliquet. </p> </li> </ul> </div><!-- end author --> <div id="skins"> <div class="skin"> <a href="index-2.html"><img src="images/skin_water.png" alt="" title=""></a> <span class="selected"></span> </div> <div class="skin"> <a href="../fire_skin/index.html"><img src="images/skin_fire.png" alt="" title=""></a> </div> <div class="skin"> <a href="../earth_skin/index.html"><img src="images/skin_earth.png" alt="" title=""></a> </div> </div> <div id="services" class="clearfix"> <div class="serv alignleft first"> <div class="img"> <img src="http://lorempixel.com/300/180/" alt="" title=""> </div> <h2>Website</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent fermentum mi a eros adipiscing is. Quisque et odio metus. </p> </div> <div class="serv alignleft middle"> <div class="img"> <img src="http://lorempixel.com/300/180/" alt="" title=""> </div> <h2>Photography</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent fermentum mi a eros adipiscing is. Quisque et odio metus. </p> </div> <div class="serv alignleft last"> <div class="img"> <img src="http://lorempixel.com/300/180/" alt="" title=""> </div> <h2>Design</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent fermentum mi a eros adipiscing is. Quisque et odio metus. </p> </div> </div><!-- end services --> <div id="quote"> <div class="free"> GET YOUR <strong>FREE</strong> <h3>Quote</h3> </div> <img src="http://lorempixel.com/944/184/" alt="" title=""> <h2>Branding Package</h2> </div> <div id="contact"> <div class="clearfix"> <div id="map"> <a class="fancybox fancybox.iframe" href="https://maps.google.ro/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=tower+Effeil+Paris,+France&amp;aq=&amp;sll=48.854198,2.317659&amp;sspn=0.038685,0.104628&amp;ie=UTF8&amp;hq=tower+Effeil&amp;hnear=Paris,+%C3%8Ele-de-France,+France&amp;ll=48.858278,2.294254&amp;spn=0.006295,0.127529&amp;t=m&amp;output=embed"><img class="alignleft" src="images/map.png" alt="" title=""> <span class="zoom"></span></a> <h2>Find Us Here</h2> <p> 335 <br> Kendra Caruth <br> 9435 NE 27th St <br> Ankeny, IA(Iowa) 50021-9732 <br> </p> </div> <div class="sep"> Or </div> <div id="callnow"> <span>CALL NOW</span> (631) 477-3878 </div> </div> </div><!-- end contact --> <footer> <div class="wrapper"> <div class="clearfix"> <div class="alignleft"> <div id="flickr"> <h2>Flickr Photos</h2> <ul class="clearfix"> <li><img src="http://lorempixel.com/59/59/people/1/" alt="" title=""></li> <li><img src="http://lorempixel.com/59/59/people/2/" alt="" title=""></li> <li><img src="http://lorempixel.com/59/59/people/3/" alt="" title=""></li> <li><img src="http://lorempixel.com/59/59/people/4/" alt="" title=""></li> <li><img src="http://lorempixel.com/59/59/people/5/" alt="" title=""></li> <li><img src="http://lorempixel.com/59/59/people/6/" alt="" title=""></li> </ul> </div><!-- flickr --> <div id="social_media"> <h2>Follow Us</h2> <img src="images/social_media/facebook.png" alt="" title=""> <img src="images/social_media/twitter.png" alt="" title=""> <img src="images/social_media/rss.png" alt="" title=""> <img src="images/social_media/youtube.png" alt="" title=""> <img src="images/social_media/google.png" alt="" title=""> <img src="images/social_media/vimeo.png" alt="" title=""> </div> </div> <div class="alignleft"> <div id="quickQuote" class="clearfix"> <h2>Quick Quote</h2> <form action="#" method="POST"> <div class="clearfix"> <p class="alignleft"> <input type="text" onfocus="if(this.value == 'Name') { this.value = ''; }" name="name" value="Name"> <input type="text" onfocus="if(this.value == 'E-mail') { this.value = ''; }" name="email" value="E-mail"> <select name="project_type" id="project_type"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> </p> <p class="alignleft"> <textarea>Aditional Comments</textarea> </p> </div> <a href="#" class="button"> Request <strong>Quote</strong></a> </form> </div><!-- end quickQuote --> </div> </div> <div id="copyright"> <h2>Elemental</h2> <p> PORTFOLIO.More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a> <span>Terms & Conditions - <a href="#">Privacy Policy</a> - About Us - Contact</span> </p> </div> </div> </footer> <script src="js/jquery.latest.min.js"></script> <script src="js/grayScaleImg.js"></script> <script src="js/jquery.fancybox.pack.js"></script> <script src="js/bgpos.js"></script> <script src="js/ddslick.js"></script> <script src="js/scripts.js"></script> </body> </html>
Encore777/DaiJiale-ProfessionalNotes
DaiJiale-Front-End/人物展位/Light/Scroll/water_skin/index.html
HTML
mit
21,148
<?php return unserialize('a:1:{i:0;O:30:"Doctrine\\ORM\\Mapping\\ManyToOne":4:{s:12:"targetEntity";s:31:"Jaxxes\\TestICEBundle\\Entity\\ICE";s:7:"cascade";N;s:5:"fetch";s:4:"LAZY";s:10:"inversedBy";N;}}');
martintito/desaeka
app/cache/prod/annotations/e7915cf9d6f225211fcfb0e30742bd133d5f3119$ice.cache.php
PHP
mit
205
/* acfcalculate.c ============== Author: R.J.Barnes */ /* LICENSE AND DISCLAIMER Copyright (c) 2012 The Johns Hopkins University/Applied Physics Laboratory This file is part of the Radar Software Toolkit (RST). RST is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. RST is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with RST. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <time.h> #include "rtypes.h" #include "tsg.h" #include "acf.h" /* For an analogue receiver, samples are multiplexed, * eg. sample 1 & 2 are the I & Q for the main array, * end sample 3 & 4 are the I & Q for the interferometer array. * For a digital receiver samples are not multiplexed, * so for the APL and Saskatoon implmentation the first X * samples are the I & Q samples from the main array, * followed by the I & Q samples from the secondary array. * The Alaskan implementation is slightly different again * using two halves of the total DMA buffer. * * The differences in implementation are handled by a combination * of the rngoff and xcfoff arguments. * * Analogue receiver: rngoff xcfoff * * No XCFs 2 0 * With XCFs 4 2 * * Digital Receiver rngoff xcfoff * (APL & Saskatoon) * No XCFs 2 0 * With XCFs 2 nsamp * * Digital Receiver rngoff xcfoff * (Alaska) * No XCFs 2 0 * With XCFs 2 8192 (half DMA buffer size) * * */ int ACFCalculate(struct TSGprm *prm, int16 *inbuf,int rngoff,int dflg, int roffset,int ioffset, int mplgs,int *lagtable[2], float *acfbuf, int xcf,int xcfoff, int badrange,float atten,float *dco) { int sdelay=0; int range; int sampleunit; int offset1; float real; float imag; int lag; int sample1; int sample2; int nrang; float temp1; float temp2; int offset2; float dcor1=0; float dcor2=0; float dcoi1=0; float dcoi2=0; if (dco !=NULL) { if (xcf==ACF_PART) { dcor1=dco[0]; dcor2=dco[0]; dcoi1=dco[1]; dcoi2=dco[1]; } else { dcor1=dco[0]; dcor2=dco[2]; dcoi1=dco[1]; dcoi2=dco[3]; } } nrang = prm->nrang; if (dflg) sdelay=prm->smdelay; /* digital receiver delay term */ sampleunit = (prm->mpinc / prm->smsep) * rngoff; for(range=0;range < nrang ; range++) { offset1 = (range+sdelay) * rngoff; if (xcf == ACF_PART) offset2 = offset1; else offset2 = ((range+sdelay) * rngoff) + xcfoff; for(lag=0;lag < mplgs; lag++) { /* if the range is bad use the lag given lagtable[mplgs] */ if ((range >= badrange) && (lag == 0)) { sample1 =lagtable[0][mplgs]*sampleunit + offset1; sample2 =lagtable[1][mplgs]*sampleunit + offset2; } else { sample1 =lagtable[0][lag]*sampleunit + offset1; sample2 =lagtable[1][lag]*sampleunit + offset2; } temp1 = (float) (inbuf[sample1+ roffset]-dcor1) * (float) (inbuf[sample2+ roffset]-dcor2); temp2 = (float) (inbuf[sample1 + ioffset]-dcoi1) * (float) (inbuf[sample2 + ioffset]-dcoi2); real = temp1 + temp2; temp1 = (float) (inbuf[sample1 + roffset]-dcor1) * (float) (inbuf[sample2 + ioffset]-dcoi2); temp2 = (float) (inbuf[sample2 + roffset]-dcor2) * (float) (inbuf[sample1 + ioffset]-dcoi1); imag = temp1 - temp2; /* sum the real and imaginary acfs */ if (atten !=0) { real=real/atten; imag=imag/atten; } acfbuf[range*(2*mplgs)+2*lag]=real+acfbuf[range*(2*mplgs)+2*lag]; acfbuf[range*(2*mplgs)+2*lag+1]=imag+ acfbuf[range*(2*mplgs)+2*lag+1]; } } return 0; }
jspaleta/SuperDARN_MSI_ROS
linux/home/radar/ros.3.6/codebase/superdarn/src.lib/tk/acf.1.16/src/acfcalculate.c
C
mit
4,560
#import <Foundation/Foundation.h> #import "BTCardPaymentMethod.h" #import "BTPayPalPaymentMethod.h" #import "BTApplePayPaymentMethod.h" #import "BTCoinbasePaymentMethod.h" #import "BTErrors.h" #import "BTClientCardRequest.h" NS_ASSUME_NONNULL_BEGIN @class BTClient, BTCoinbasePaymentMethod; #pragma mark Types /// Block type that takes an `NSArray` of `BTPaymentMethod`s #if (defined(__clang__) && __has_feature(objc_generics)) typedef void (^BTClientPaymentMethodListSuccessBlock)(NSArray<BTPaymentMethod *> *paymentMethods); #else typedef void (^BTClientPaymentMethodListSuccessBlock)(NSArray *paymentMethods); #endif /// Block type that takes a single `BTPaymentMethod` typedef void (^BTClientPaymentMethodSuccessBlock)(BTPaymentMethod *paymentMethod); /// Block type that takes a `BTCardPaymentMethod` typedef void (^BTClientCardSuccessBlock)(BTCardPaymentMethod *card); #if BT_ENABLE_APPLE_PAY /// Success Block type for the Save Apple Pay call typedef void (^BTClientApplePaySuccessBlock)(BTApplePayPaymentMethod *applePayPaymentMethod); #endif /// Success Block type for the Save Paypal call typedef void (^BTClientPaypalSuccessBlock)(BTPayPalPaymentMethod *paypalPaymentMethod); /// Success Block type for the Save Coinbase call typedef void (^BTClientCoinbaseSuccessBlock)(BTCoinbasePaymentMethod *coinbasePaymentMethod); /// Success Block type for analytics events typedef void (^BTClientAnalyticsSuccessBlock)(void); /// Block type for handling `BTClient` errors typedef void (^BTClientFailureBlock)(NSError *error); /// A `BTClient` performs Braintree API operations and returns /// resulting responses or errors. It is the entry-point for all /// communication with Braintree. @interface BTClient : NSObject <NSCoding, NSCopying> /// Initialize and configure a `BTClient` with a client token. /// The client token dictates the behavior of subsequent operations. /// /// @param clientTokenString Braintree client token - (nullable instancetype)initWithClientToken:(NSString *)clientTokenString; /// The set of challenges that need to be provided to `saveCardWithNumber` /// in order to save a card. This is dependent upon on your Gateway settings /// (potentially among other factors). @property (nonatomic, nullable, readonly) NSSet *challenges; /// The public Braintree Merchant ID for which this client /// was initialized. @property (nonatomic, nullable, copy, readonly) NSString *merchantId; /// A set of strings denoting additional scopes to use when authorizing a PayPal account. /// See PayPalOAuthScopes.h for a list of available scopes. #if (defined(__clang__) && __has_feature(objc_generics)) @property (nonatomic, nullable, copy) NSSet<NSString *> *additionalPayPalScopes; #else @property (nonatomic, nullable, copy) NSSet *additionalPayPalScopes; #endif #pragma mark - Fetch a Payment Method /// Obtain a list of payment methods saved to Braintree /// /// @param successBlock success callback for handling the returned list of payment methods /// @param failureBlock failure callback for handling errors - (void)fetchPaymentMethodsWithSuccess:(nullable BTClientPaymentMethodListSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; /// Obtain information about a payment method based on a nonce /// /// @param successBlock success callback for handling the retrieved payment methods /// @param failureBlock failure callback for handling errors - (void)fetchPaymentMethodWithNonce:(NSString *)nonce success:(nullable BTClientPaymentMethodSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; #pragma mark Save a New Payment Method /// Save a card to Braintree /// /// @param request an object that includes the raw card details /// @param successBlock success callback for handling the resulting new card /// @param failureBlock failure callback for handling errors /// /// @see challenges - (void)saveCardWithRequest:(BTClientCardRequest *)request success:(nullable BTClientCardSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; #if BT_ENABLE_APPLE_PAY /// Save a payment method created via Apple Pay /// /// @param applePayRequest A BTClientApplePayRequest /// @param successBlock success callback for handling the resulting payment method /// @param failureBlock failure callback for handling errors - (void)saveApplePayPayment:(PKPayment *)payment success:(nullable BTClientApplePaySuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; #endif /// Save a paypal payment method to Braintree /// /// @param authCode Authorization Code /// @param applicationCorrelationID PayPal App Correlation Id (See `-[BTClient btPayPal_applicationCorrelationId]` and https://github.com/paypal/PayPal-iOS-SDK/blob/master/docs/future_payments_mobile.md#obtain-an-application-correlation-id.) /// @param successBlock success callback for handling the resulting new PayPal account payment method /// @param failureBlock failure callback for handling errors - (void)savePaypalPaymentMethodWithAuthCode:(NSString *)authCode applicationCorrelationID:(NSString *)applicationCorrelationId success:(nullable BTClientPaypalSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; /// Save a paypal payment method to Braintree without a PayPal App Correlation ID /// /// @note This signature has been deprecated in favor of /// savePaypalPaymentMethodWithAuthCode:applicationCorrelationID:success:failure: to encourage the submission /// of PayPal app correlation ids. /// /// @param authCode Authorization Code /// @param successBlock success callback for handling the resulting new PayPal account payment method /// @param failureBlock failure callback for handling errors - (void)savePaypalPaymentMethodWithAuthCode:(NSString *)authCode success:(nullable BTClientPaypalSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock DEPRECATED_ATTRIBUTE; /// Save a paypal payment method to Braintree /// /// @note This signature has been deprecated in favor of /// savePaypalPaymentMethodWithAuthCode:applicationCorrelationID:success:failure: for clarity /// /// @param authCode Authorization Code /// @param correlationId PayPal App Correlation ID (See `-[BTClient btPayPal_applicationCorrelationId]` and https://github.com/paypal/PayPal-iOS-SDK/blob/master/docs/future_payments_mobile.md#obtain-an-application-correlation-id.) /// @param successBlock success callback for handling the resulting new PayPal account payment method /// @param failureBlock failure callback for handling errors - (void)savePaypalPaymentMethodWithAuthCode:(NSString *)authCode correlationId:(NSString *)correlationId success:(nullable BTClientPaypalSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock DEPRECATED_ATTRIBUTE; #pragma mark - Coinbase /// Save a Coinbase payment method to Braintree (beta) /// /// @param coinbaseAuthResponse A Coinbase authorization response of type NSDictionary /// @param successBlock success callback for handling the resulting new Coinbase account payment method /// @param failureBlock failure callback for handling errors - (void)saveCoinbaseAccount:(id)coinbaseAuthResponse storeInVault:(BOOL)storeInVault success:(nullable BTClientCoinbaseSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; #pragma mark Create a Braintree Analytics Event /// "Fire and forget analytics" - transmits an analytics event to the Braintree analytics service /// /// @param eventKind The analytics event name - (void)postAnalyticsEvent:(NSString *)eventKind success:(nullable BTClientAnalyticsSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock; - (void)postAnalyticsEvent:(NSString *)eventKind; #pragma mark - Library Metadata /// Retrieve the current library version. /// /// @return A string representation of this library's current semver.org version. + (NSString *)libraryVersion; @end @interface BTClient (Deprecated) /// Save a card to Braintree /// /// You have two options for validation when saving a card to Braintree. You can specify /// that only valid options should be saved. /// /// @param cardNumber card number (PAN) /// @param expirationMonth card expiration month (e.g. @"01") /// @param expirationYear card expiration year (e.g. @"2018")` /// @param cvv card's cvv three or four digit verification code (optional, depending on your Gateway settings) /// @param postalCode card's postal code for address verification (optional, depending on your Gateway settings) /// @param validate whether details should be validated before creating a nonce for them /// @param successBlock success callback for handling the resulting new card /// @param failureBlock failure callback for handling errors /// /// @see challenges - (void)saveCardWithNumber:(NSString *)creditCardNumber expirationMonth:(NSString *)expirationMonth expirationYear:(NSString *)expirationYear cvv:(nullable NSString *)cvv postalCode:(nullable NSString *)postalCode validate:(BOOL)shouldValidate success:(nullable BTClientCardSuccessBlock)successBlock failure:(nullable BTClientFailureBlock)failureBlock DEPRECATED_MSG_ATTRIBUTE("Please use BTClientCardRequest and saveCardWithRequest:validate:success:failure:"); @end NS_ASSUME_NONNULL_END
EverettQuebral/braintree_ios
Braintree/API/@Public/BTClient.h
C
mit
9,925
package com.clarifai.api; import java.io.BufferedOutputStream; import java.io.IOException; import java.net.HttpURLConnection; import com.clarifai.api.exception.ClarifaiBadRequestException; import com.clarifai.api.exception.ClarifaiException; import com.clarifai.api.exception.ClarifaiNotAuthorizedException; import com.clarifai.api.exception.ClarifaiThrottledException; import com.google.gson.JsonParseException; /** Manages a single request to the Clarifai API. */ class ClarifaiRequester<T> { static enum Method { GET, POST } private final ConnectionFactory connectionFactory; private final CredentialManager credentialManager; private final Method method; private final String path; private final Class<T> resultClass; private final int maxAttempts; ClarifaiRequester(ConnectionFactory connectionFactory, CredentialManager credentialManager, Method method, String path, Class<T> resultClass, int maxAttempts) { this.connectionFactory = connectionFactory; this.credentialManager = credentialManager; this.method = method; this.path = path; this.resultClass = resultClass; this.maxAttempts = maxAttempts; } T execute(ClarifaiRequest request) throws ClarifaiException { for (int i = maxAttempts - 1; i >= 0; i--) { try { return executeOnce(request); } catch (ClarifaiNotAuthorizedException e) { credentialManager.invalidateCredential(); if (i == 0) throw e; } catch (ClarifaiThrottledException e) { if (i == 0) throw e; waitForSeconds(e.getWaitSeconds()); } catch (ClarifaiBadRequestException e) { throw e; // Retrying will not help. } catch (ClarifaiException e) { if (i == 0) throw e; } } throw new IllegalStateException(); } T executeOnce(ClarifaiRequest request) throws ClarifaiException { try { // Send request: HttpURLConnection conn; if (method == Method.POST) { conn = connectionFactory.newPost(path, credentialManager.getCredential()); } else { conn = connectionFactory.newGet(path, credentialManager.getCredential()); } if (request != null) { conn.setRequestProperty("Content-Type", request.getContentType()); BufferedOutputStream out = new BufferedOutputStream(conn.getOutputStream()); try { request.writeContent(out); } finally { out.close(); } } // Parse result: boolean isSuccess = (conn.getResponseCode() >= 200 && conn.getResponseCode() < 300); BaseResponse response; if (isSuccess) { response = ResponseUtil.parseJsonAndClose(conn.getInputStream(), BaseResponse.class); } else { response = ResponseUtil.parseJsonAndClose(conn.getErrorStream(), BaseResponse.class); // The API returns a 400 when all images in a recognition request are bad. However, we // want to communicate this back in the RecognitionResults rather than throwing an // exception for consistency with the partial error and non-error cases. if (conn.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST && resultClass == RecognitionResult[].class && response.results != null && response.results.isJsonArray()) { isSuccess = true; } else { ResponseUtil.throwExceptionForErrorResponse(conn, response); } } if (resultClass == Void.class) { return null; } else { return ResponseUtil.GSON.fromJson(response.results, resultClass); } } catch (IOException e) { throw new ClarifaiException("IOException", e); } catch (JsonParseException e) { throw new ClarifaiException("Server returned an unparsable response", e); } } private static void waitForSeconds(int seconds) { try { Thread.sleep(seconds * 1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new ClarifaiException("Interrupted", e); } } }
mbchang/clarifai-java
src/main/java/com/clarifai/api/ClarifaiRequester.java
Java
mit
4,044
@REM Copyright (c) Microsoft. All rights reserved. @REM Licensed under the MIT license. See LICENSE file in the project root for full license information. @setlocal EnableExtensions EnableDelayedExpansion @echo off set build-root=%~dp0..\.. cd %build-root%\build\docs rem ----------------------------------------------------------------------------- rem -- Generate C API docs rem ----------------------------------------------------------------------------- doxygen rem ----------------------------------------------------------------------------- rem -- Fix up the line feeds in the generated C docs so that just line rem -- feed changes aren't flagged as changes by git. We don't care if this rem -- fails though. rem ----------------------------------------------------------------------------- echo Fixing line feeds in generated docs... node fix-crlf.js
tisb-vikram/azure-iot-sdks
build/docs/gen_cdocs.cmd
Batchfile
mit
864
/* * The MIT License (MIT) * * Copyright (c) 2007-2015 Broad Institute * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.broad.igv.cli_plugin; import org.apache.log4j.Logger; import org.broad.igv.sam.AlignmentTrack; import org.broad.igv.session.SubtlyImportant; import org.broad.igv.track.FeatureTrack; import org.broad.igv.variant.VariantTrack; import javax.xml.bind.annotation.*; import java.util.List; @XmlAccessorType(XmlAccessType.NONE) public class Argument{ public static final String CMD_ARG = "cmd_arg"; public static final String LIBS = "libs"; private static final Logger log = Logger.getLogger(Argument.class); @XmlAttribute private String name; @XmlAttribute private InputType type; /** * Text which goes before Argument value on command line */ @XmlAttribute(name = CMD_ARG) private String cmdArg; @XmlAttribute private String defaultValue; /** * Whether the argument gets written to the command line * This is true by default (usually it will be). Some only exist * to take user input, and feed the result to another argument */ @XmlAttribute private boolean output = false; /** * Whether this argument is displayed to the user. * If we just want to have a value in the XML spec * that the user can't change, set this to false */ @XmlAttribute private boolean visible = true; /** * id used by spec by which this argument can be referred. * Does not need to be human readable, must be unique * within a command */ @XmlAttribute private String id; /** * Full class name of encoding codec to be used * In addition to default classpath, will * also search {@link #libPaths} */ @XmlAttribute private String encodingCodec; /** * URLs to search for encoding codec class, in addition * to current classpath */ @XmlElement(name = LIBS) private String[] libPaths; /** * Key used in paths to indicate same directory as tool */ public static final CharSequence TOOL_DIR_KEY = "$toolDir"; @XmlAttribute private boolean remembered; public boolean isRemembered() { return remembered; } @XmlEnum public enum InputType { BOOL, TEXT, LONGTEXT, FEATURE_TRACK, DATA_TRACK, MULTI_FEATURE_TRACK, ALIGNMENT_TRACK, VARIANT_TRACK, LOCUS } /** * Used reading/writing to session files */ @XmlElement List<String> value; boolean isValidValue(Object value) { switch (this.type) { case BOOL: return value instanceof Boolean; case TEXT: case LONGTEXT: return value instanceof String || value == null; case VARIANT_TRACK: return value instanceof VariantTrack; case ALIGNMENT_TRACK: return value instanceof AlignmentTrack; case FEATURE_TRACK: return value instanceof FeatureTrack; case MULTI_FEATURE_TRACK: if (!(value instanceof List)) return false; try { List<FeatureTrack> lVal = (List<FeatureTrack>) value; FeatureTrack fVal = lVal.get(0); return true; } catch (Exception e) { return false; } default: return false; } } public String getName() { return name; } public String getCmdArg() { return cmdArg; } public InputType getType() { return type; } public String getDefaultValue() { return defaultValue; } public void setDefaultValue(String defaultValue){ this.defaultValue = defaultValue; } public String[] getLibPaths(){ return this.libPaths; } public boolean isOutput() { return output; } public void setOutput(boolean output){ this.output = output; } public String getId() { return id; } public String getEncodingCodec() { return encodingCodec; } public boolean isVisible() { return visible; } @SubtlyImportant private Argument(){} //This constructor is here largely for testing, should consider getting rid of it Argument(String name, InputType type, String cmdArg, String defaultValue, String encodingCodec, String[] libPaths, boolean isOutput, String id) { this.name = name; this.type = type; this.cmdArg = cmdArg != null ? cmdArg : ""; this.defaultValue = defaultValue; this.encodingCodec = encodingCodec; this.libPaths = libPaths; this.output = isOutput; this.id = id; if (!output && id == null) { log.info(String.format("Argument %s is not output but it also has no id. This argument" + " will have no effect", (name))); } } }
godotgildor/igv
src/org/broad/igv/cli_plugin/Argument.java
Java
mit
6,148
// Copyright: 2015 AlignAlytics // License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt" // Source: /src/objects/plot/area.js dimple.plot.area = { // By default the values are stacked stacked: true, // This is a grouped plot meaning many points are treated as one series value grouped: true, // The axis positions affecting the area series supportedAxes: ["x", "y", "c"], // Draw the axis draw: function (chart, series, duration) { // Get the position data var data = series._positionData, areaData = [], theseShapes = null, className = "dimple-series-" + chart.series.indexOf(series), firstAgg = (series.x._hasCategories() || series.y._hasCategories() ? 0 : 1), interpolation, graded = false, i, j, k, key, keyString, rowIndex, updated, removed, orderedSeriesArray, catPoints = {}, allPoints = [], points, finalPointArray = [], basePoints, basePoint, cat, catVal, group, p, b, l, lastAngle, catCoord, valCoord, onEnter = function () { return function (e, shape, chart, series) { d3.select(shape).style("opacity", 1); dimple._showPointTooltip(e, shape, chart, series); }; }, onLeave = function (lineData) { return function (e, shape, chart, series) { d3.select(shape).style("opacity", (series.lineMarkers || lineData.data.length < 2 ? dimple._helpers.opacity(e, chart, series) : 0)); dimple._removeTooltip(e, shape, chart, series); }; }, drawMarkers = function (d, context) { dimple._drawMarkers(d, chart, series, duration, className, graded, onEnter(d), onLeave(d), context); }, coord = function (position, datum) { var val; if (series.interpolation === "step" && series[position]._hasCategories()) { val = dimple._helpers[position](datum, chart, series) + (position === "y" ? dimple._helpers.height(datum, chart, series) : 0); if (series[position].categoryFields.length < 2) { val += (position === "y" ? 1 : -1) * dimple._helpers[position + "Gap"](chart, series); } } else { val = dimple._helpers["c" + position](datum, chart, series); } // Remove long decimals from the coordinates as this fills the dom up with noise and makes matching below less likely to work. It // shouldn't really matter but positioning to < 0.1 pixel is pretty pointless anyway. UPDATE: Turns out it isn't, see Issue #79. points > pixels // causes multiple points to fall on the same co-ordinate which results in drawing problems. return parseFloat(val); }, getArea = function (inter, originProperty) { return d3.svg.line() .x(function (d) { return (series.x._hasCategories() || !originProperty ? d.x : series.x[originProperty]); }) .y(function (d) { return (series.y._hasCategories() || !originProperty ? d.y : series.y[originProperty]); }) .interpolate(inter); }, sortByVal = function (a, b) { return parseFloat(a) - parseFloat(b); }, sortByX = function (a, b) { return parseFloat(a.x) - parseFloat(b.x); }, addNextPoint = function (source, target, startAngle) { // Given a point we need to find the next point clockwise from the start angle var i, point = target[target.length - 1], thisAngle, bestAngleSoFar = 9999, returnPoint = point; for (i = 0; i < source.length; i += 1) { if (source[i].x !== point.x || source[i].y !== point.y) { // get the angle in degrees since start angle thisAngle = 180 - (Math.atan2(source[i].x - point.x, source[i].y - point.y) * (180 / Math.PI)); if (thisAngle > startAngle && thisAngle < bestAngleSoFar) { returnPoint = source[i]; bestAngleSoFar = thisAngle; } } } target.push(returnPoint); return bestAngleSoFar; }; // Handle the special interpolation handling for step interpolation = (series.interpolation === "step" ? "step-after" : series.interpolation); // Get the array of ordered values orderedSeriesArray = dimple._getSeriesOrder(series.data || chart.data, series); if (series.c && ((series.x._hasCategories() && series.y._hasMeasure()) || (series.y._hasCategories() && series.x._hasMeasure()))) { graded = true; } // If there is a coordinate with categories get it here so we don't have to keep checking if (series.x._hasCategories()) { catCoord = "x"; valCoord = "y"; } else if (series.y._hasCategories()) { catCoord = "y"; valCoord = "x"; } // Create a set of area data grouped by the aggregation field for (i = 0; i < data.length; i += 1) { key = []; rowIndex = -1; // Skip the first category unless there is a category axis on x or y for (k = firstAgg; k < data[i].aggField.length; k += 1) { key.push(data[i].aggField[k]); } // Find the corresponding row in the areaData keyString = dimple._createClass(key); for (k = 0; k < areaData.length; k += 1) { if (areaData[k].keyString === keyString) { rowIndex = k; break; } } // Add a row to the area data if none was found if (rowIndex === -1) { rowIndex = areaData.length; areaData.push({ key: key, keyString: keyString, color: "white", data: [], points: [], area: {}, entry: {}, exit: {}, // Group refers to groupings along the category axis. If there are groupings it will be recorded, otherwise all is used as a default group: (catCoord && data[i][catCoord + "Field"] && data[i][catCoord + "Field"].length >= 2 ? data[i][catCoord + "Field"][0] : "All") }); } // Add this row to the relevant data areaData[rowIndex].data.push(data[i]); } // Sort the area data itself based on the order series array - this matters for stacked areas and default color // consistency with colors usually awarded in terms of prominence if (orderedSeriesArray) { areaData.sort(function (a, b) { return dimple._arrayIndexCompare(orderedSeriesArray, a.key, b.key); }); } // Create a set of area data grouped by the aggregation field for (i = 0; i < areaData.length; i += 1) { // Sort the points so that areas are connected in the correct order areaData[i].data.sort(dimple._getSeriesSortPredicate(chart, series, orderedSeriesArray)); // Get points here, this is so that as well as drawing the line with them, we can also // use them for the baseline for (j = 0; j < areaData[i].data.length; j += 1) { areaData[i].points.push({ x: coord("x", areaData[i].data[j]), y: coord("y", areaData[i].data[j]) }); // if there is a category axis, add the points to a distinct set. Set these to use the origin value // this will be updated with the last value in each case as we build the areas if (catCoord) { if (!catPoints[areaData[i].group]) { catPoints[areaData[i].group] = {}; } catPoints[areaData[i].group][areaData[i].points[areaData[i].points.length - 1][catCoord]] = series[valCoord]._origin; } } points = areaData[i].points; // If this is a step interpolation we need to add in some extra points to the category axis // This is a little tricky but we need to add a new point duplicating the last category value. In order // to place the point we need to calculate the gap between the last x and the penultimate x and apply that // gap again. if (series.interpolation === "step" && points.length > 1 && catCoord) { if (series.x._hasCategories()) { points.push({ x : 2 * points[points.length - 1].x - points[points.length - 2].x, y : points[points.length - 1].y }); catPoints[areaData[i].group][points[points.length - 1][catCoord]] = series[valCoord]._origin; } else if (series.y._hasCategories()) { points = [{ x : points[0].x, y : 2 * points[0].y - points[1].y }].concat(points); catPoints[areaData[i].group][points[0][catCoord]] = series[valCoord]._origin; // The prepend above breaks the reference so it needs to be reapplied here. areaData[i].points = points; } } } // catPoints needs to be lookup, but also accessed sequentially so we need to create an array of keys for (cat in catPoints) { if (catPoints.hasOwnProperty(cat)) { allPoints[cat] = []; for (catVal in catPoints[cat]) { if (catPoints[cat].hasOwnProperty(catVal)) { allPoints[cat].push(parseFloat(catVal)); } } // Sort the points as integers allPoints[cat].sort(sortByVal); } } // Create the areas for (i = 0; i < areaData.length; i += 1) { points = areaData[i].points; group = areaData[i].group; basePoints = []; finalPointArray = []; // If this should have colour gradients, add them if (graded) { dimple._addGradient(areaData[i].key, "fill-area-gradient-" + areaData[i].keyString, (series.x._hasCategories() ? series.x : series.y), data, chart, duration, "fill"); } // All points will only be populated if there is a category axis if (allPoints[group] && allPoints[group].length > 0) { // Iterate the point array because we need to fill in zero points for missing ones, otherwise the areas // will cross where an upper area has no value and a lower value has a spike Issue #7 for (j = 0, k = 0; j < allPoints[group].length; j += 1) { // We are only interested in points between the first and last point of this areas data (i.e. don't fill ends - important // for grouped area charts). We have to use a strange criteria here. If there are no group gaps on a grouped area // chart the end point of one series will clash with the start point of another, therefore we have to ignore fill-in's within // a couple of pixels of the start and end points if (allPoints[group][j] >= points[0][catCoord] && allPoints[group][j] <= points[points.length - 1][catCoord]) { // Get a base point, this needs to go on the base points array as well as filling in gaps in the point array. // Create a point using the coordinate on the category axis and the last recorded value // position from the dictionary basePoint = {}; basePoint[catCoord] = allPoints[group][j]; basePoint[valCoord] = catPoints[group][allPoints[group][j]]; // add the base point basePoints.push(basePoint); // handle missing points if (points[k][catCoord] > allPoints[group][j]) { // If there is a missing point we need to in fill finalPointArray.push(basePoint); } else { // They must be the same finalPointArray.push(points[k]); // Use this to update the dictionary to the new value coordinate catPoints[areaData[i].group][allPoints[group][j]] = points[k][valCoord]; k += 1; } } } } else { // If there is no category axis we need to apply some custom logic. In order to avoid // really jagged areas the default behaviour will be to draw from the left most point then rotate a line // clockwise until it hits another point and continue from each point until back to where we started. This // means it will not connect every point, but it will contain every point: // E.g. // D // C // A B E // F G // H // // Would draw A -> C -> D -> E -> G -> H -> A // // This may not be what everyone wants so if there is a series order specified we will just join // the points in that order instead. This will not allow users to skip points and therefore not achieve // the default behaviour explicitly. if (series._orderRules && series._orderRules.length > 0) { finalPointArray = points.concat(points[0]); } else { // Find the leftmost point points = points.sort(sortByX); finalPointArray.push(points[0]); lastAngle = 0; // Iterate until the first and last points match do { lastAngle = addNextPoint(points, finalPointArray, lastAngle); } while (finalPointArray.length <= points.length && (finalPointArray[0].x !== finalPointArray[finalPointArray.length - 1].x || finalPointArray[0].y !== finalPointArray[finalPointArray.length - 1].y)); } } // Reverse the base points so that they are in the correct order for the path basePoints = basePoints.reverse(); // Get the points that this area will appear p = getArea(interpolation, "_previousOrigin")(finalPointArray); b = getArea((interpolation === "step-after" ? "step-before" : (interpolation === "step-before" ? "step-after" : interpolation)), "_previousOrigin")(basePoints); l = getArea("linear", "_previousOrigin")(finalPointArray); areaData[i].entry = p + (b && b.length > 0 ? "L" + b.substring(1) : "") + (l && l.length > 0 ? "L" + l.substring(1, l.indexOf("L")) : 0); p = getArea(interpolation)(finalPointArray); b = getArea(interpolation === "step-after" ? "step-before" : (interpolation === "step-before" ? "step-after" : interpolation))(basePoints); l = getArea("linear")(finalPointArray); areaData[i].update = p + (b && b.length > 0 ? "L" + b.substring(1) : "") + (l && l.length > 0 ? "L" + l.substring(1, l.indexOf("L")) : 0); p = getArea(interpolation, "_origin")(finalPointArray); b = getArea((interpolation === "step-after" ? "step-before" : (interpolation === "step-before" ? "step-after" : interpolation)), "_origin")(basePoints); l = getArea("linear", "_origin")(finalPointArray); areaData[i].exit = p + (b && b.length > 0 ? "L" + b.substring(1) : "") + (l && l.length > 0 ? "L" + l.substring(1, l.indexOf("L")) : 0); // Add the color in this loop, it can't be done during initialisation of the row because // the areas should be ordered first (to ensure standard distribution of colors areaData[i].color = chart.getColor(areaData[i].key.length > 0 ? areaData[i].key[areaData[i].key.length - 1] : "All"); areaData[i].css = chart.getClass(areaData[i].key.length > 0 ? areaData[i].key[areaData[i].key.length - 1] : "All"); } if (chart._tooltipGroup !== null && chart._tooltipGroup !== undefined) { chart._tooltipGroup.remove(); } if (series.shapes === null || series.shapes === undefined) { theseShapes = chart._group.selectAll("." + className).data(areaData); } else { theseShapes = series.shapes.data(areaData, function (d) { return d.key; }); } // Add theseShapes .enter() .append("path") .attr("id", function (d) { return dimple._createClass([d.key]); }) .attr("class", function (d) { return className + " dimple-line " + d.keyString + " " + chart.customClassList.areaSeries + " " + d.css; }) .attr("d", function (d) { return d.entry; }) .call(function () { // Apply formats optionally if (!chart.noFormats) { this.attr("opacity", function (d) { return (graded ? 1 : d.color.opacity); }) .style("fill", function (d) { return (graded ? "url(#" + dimple._createClass(["fill-area-gradient-" + d.keyString]) + ")" : d.color.fill); }) .style("stroke", function (d) { return (graded ? "url(#" + dimple._createClass(["stroke-area-gradient-" + d.keyString]) + ")" : d.color.stroke); }) .style("stroke-width", series.lineWeight); } }) .each(function (d) { // Pass line data to markers d.markerData = d.data; drawMarkers(d, this); }); // Update updated = chart._handleTransition(theseShapes, duration, chart) .attr("d", function (d) { return d.update; }) .each(function (d) { // Pass line data to markers d.markerData = d.data; drawMarkers(d, this); }); // Remove removed = chart._handleTransition(theseShapes.exit(), duration, chart) .attr("d", function (d) { return d.exit; }) .each(function (d) { // Using all data for the markers fails because there are no exits in the markers // only the whole line, therefore we need to clear the points here d.markerData = []; drawMarkers(d, this); }); dimple._postDrawHandling(series, updated, removed, duration); // Save the shapes to the series array series.shapes = theseShapes; } };
boneyao/dimple
src/objects/plot/area.js
JavaScript
mit
21,510
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var React = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _reactTransitionGroup = require("react-transition-group"); var _utils = require("@material-ui/utils"); var _transitions = require("../styles/transitions"); var _useTheme = _interopRequireDefault(require("../styles/useTheme")); var _utils2 = require("../transitions/utils"); var _useForkRef = _interopRequireDefault(require("../utils/useForkRef")); var styles = { entering: { opacity: 1 }, entered: { opacity: 1 } }; var defaultTimeout = { enter: _transitions.duration.enteringScreen, exit: _transitions.duration.leavingScreen }; /** * The Fade transition is used by the [Modal](/components/modal/) component. * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally. */ var Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) { var children = props.children, inProp = props.in, onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, style = props.style, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? _reactTransitionGroup.Transition : _props$TransitionComp, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout, other = (0, _objectWithoutProperties2.default)(props, ["children", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "TransitionComponent", "timeout"]); var theme = (0, _useTheme.default)(); var enableStrictModeCompat = true; var nodeRef = React.useRef(null); var foreignRef = (0, _useForkRef.default)(children.ref, ref); var handleRef = (0, _useForkRef.default)(nodeRef, foreignRef); var normalizedTransitionCallback = function normalizedTransitionCallback(callback) { return function (maybeIsAppearing) { if (callback) { var node = nodeRef.current; // onEnterXxx and onExitXxx callbacks have a different arguments.length value. if (maybeIsAppearing === undefined) { callback(node); } else { callback(node, maybeIsAppearing); } } }; }; var handleEntering = normalizedTransitionCallback(onEntering); var handleEnter = normalizedTransitionCallback(function (node, isAppearing) { (0, _utils2.reflow)(node); // So the animation always start from the start. var transitionProps = (0, _utils2.getTransitionProps)({ style: style, timeout: timeout }, { mode: 'enter' }); node.style.webkitTransition = theme.transitions.create('opacity', transitionProps); node.style.transition = theme.transitions.create('opacity', transitionProps); if (onEnter) { onEnter(node, isAppearing); } }); var handleEntered = normalizedTransitionCallback(onEntered); var handleExiting = normalizedTransitionCallback(onExiting); var handleExit = normalizedTransitionCallback(function (node) { var transitionProps = (0, _utils2.getTransitionProps)({ style: style, timeout: timeout }, { mode: 'exit' }); node.style.webkitTransition = theme.transitions.create('opacity', transitionProps); node.style.transition = theme.transitions.create('opacity', transitionProps); if (onExit) { onExit(node); } }); var handleExited = normalizedTransitionCallback(onExited); return /*#__PURE__*/React.createElement(TransitionComponent, (0, _extends2.default)({ appear: true, in: inProp, nodeRef: enableStrictModeCompat ? nodeRef : undefined, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, timeout: timeout }, other), function (state, childProps) { return /*#__PURE__*/React.cloneElement(children, (0, _extends2.default)({ style: (0, _extends2.default)({ opacity: 0, visibility: state === 'exited' && !inProp ? 'hidden' : undefined }, styles[state], style, children.props.style), ref: handleRef }, childProps)); }); }); process.env.NODE_ENV !== "production" ? Fade.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * A single child content element. */ children: _utils.elementAcceptingRef, /** * If `true`, the component will transition in. */ in: _propTypes.default.bool, /** * @ignore */ onEnter: _propTypes.default.func, /** * @ignore */ onEntered: _propTypes.default.func, /** * @ignore */ onEntering: _propTypes.default.func, /** * @ignore */ onExit: _propTypes.default.func, /** * @ignore */ onExited: _propTypes.default.func, /** * @ignore */ onExiting: _propTypes.default.func, /** * @ignore */ style: _propTypes.default.object, /** * The duration for the transition, in milliseconds. * You may specify a single timeout for all transitions, or individually with an object. */ timeout: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({ appear: _propTypes.default.number, enter: _propTypes.default.number, exit: _propTypes.default.number })]) } : void 0; var _default = Fade; exports.default = _default;
cdnjs/cdnjs
ajax/libs/material-ui/5.0.0-alpha.8/Fade/Fade.js
JavaScript
mit
6,233
"use strict";import U from"./Utilities.js";var pick=U.pick,seriesType=U.seriesType;import"./Options.js";import"./Series.js";seriesType("spline","line",{},{getPointSpline:function(t,i,o){var p,r,e,n,l,s=i.plotX,h=i.plotY,a=t[o-1],c=t[o+1];function C(t){return t&&!t.isNull&&!1!==t.doCurve&&!i.isCliff}if(C(a)&&C(c)){var m=a.plotX,u=a.plotY,g=c.plotX,X=c.plotY,Y=0;r=(1.5*h+u)/2.5,n=(1.5*h+X)/2.5,(e=(1.5*s+g)/2.5)!==(p=(1.5*s+m)/2.5)&&(Y=(n-r)*(e-s)/(e-p)+h-n),n+=Y,(r+=Y)>u&&r>h?n=2*h-(r=Math.max(u,h)):r<u&&r<h&&(n=2*h-(r=Math.min(u,h))),n>X&&n>h?r=2*h-(n=Math.max(X,h)):n<X&&n<h&&(r=2*h-(n=Math.min(X,h))),i.rightContX=e,i.rightContY=n}return l=["C",pick(a.rightContX,a.plotX),pick(a.rightContY,a.plotY),pick(p,s),pick(r,h),s,h],a.rightContX=a.rightContY=null,l}});
cdnjs/cdnjs
ajax/libs/highcharts/8.0.4/es-modules/parts/SplineSeries.min.js
JavaScript
mit
767
# 监管与监控 这一节将简述监管背后的概念、原语及语义。要了解这些如何转换成真实代码,请参阅相关的Scala和Java API章节。 ###<a name="supervision-directives"></a>监管的意思 在 [Actor 系统](02_actor_systems.md) 中说过,监管描述的是actor之间的依赖关系:监管者将任务委托给下属,并相应地对下属的失败状况进行响应。当一个下属出现了失败(即抛出一个异常),它自己会将自己和自己所有的下属挂起,然后向自己的监管者发送一个提示失败的消息。基于所监管的工作的性质和失败的性质,监管者可以有4种基本选择: 1. 恢复下属,保持下属当前积累的内部状态 1. 重启下属,清除下属的内部状态 1. 永久地停止下属 1. 升级失败(沿监管树向上传递失败),由此失败自己 始终要把一个actor视为整个监管树形体系的一部分是很重要的,这解释了第4种选择存在的意义(因为一个监管者同时也是其上方监管者的下属),并且隐含在前3种选择中:恢复actor会恢复其所有下属,重启一个actor也必须重启其所有下属(不过需要看下面的详述获取更多细节),类似地终止一个actor会终止其所有下属。需要强调`Actor`类的`preRestart`钩子(hook)缺省行为是在重启前终止它的所有下属,但这个钩子可以被重写;对所有子actor的递归重启操作在这个钩子之后执行。 每个监管者都配置了一个函数,它将所有可能的失败原因(即异常)翻译成以上四种选择之一;注意,这个函数并不将失败actor的标识作为输入。我们很快会发现在有些结构中这种方式可能看起来不够灵活,例如会希望对不同的下属应用不同的策略。在这一点上我们一定要理解监管是为了组建一个递归的失败处理结构。如果你试图在某一个层次做太多事情,这个层次会变得复杂并难以理解,因此这时我们推荐的方法是增加一个监管层次。 Akka实现的是一种叫“父监管”的形式。Actor只能被其它的actor创建——顶部的actor由库来提供——每一个被创建的actor都由其父亲所监管。这种限制使得actor的监管结构隐式符合其树形层次,并提倡合理的设计方法。需要强调的是这也保证了actor不会成为孤儿或者拥有在系统外界的监管者(被外界意外捕获)。另外,这形成了对actor应用(或其子树)一种自然又干净的关闭过程。 > 警告 > 监管相关的父-子沟通,使用了特殊的系统消息及其固有的邮箱,从而和用户消息隔离开来。这意味着,监管相关的事件相对于普通的消息没有确定的顺序关系。在一般情况下,用户不能影响正常消息和失败通知的顺序。相关详细信息和示例,请参见讨论:[消息排序](08_message_delivery_reliability.md#message-ordering)。 ###顶级监管者 ![](guardians.png) 一个actor系统在其创建过程中至少要启动三个actor,如上图所示。有关actor路径及相关信息请参见[Actor路径的顶级作用域](05_actor_references_paths_and_addresses.md#toplevel-paths)。 #####<a name="user-guardian"></a> `/user`: 守护Actor 这个名为`"/user"`的守护者,作为所有用户创建actor的父actor,可能是需要打交道最多的。使用`system.actorOf()`创建的actor都是其子actor。这意味着,当该守护者终止时,系统中所有的普通actor都将被关闭。同时也意味着,该守护者的监管策略决定了普通顶级actor是如何被监督的。自Akka 2.1起就可以使用这个设定`akka.actor.guardian-supervisor-strategy`,以一个`SupervisorStrategyConfigurator`的完整类名进行配置。当这个守护者上升一个失败,根守护者的响应是终止该守护者,从而关闭整个actor系统。 #####`/system`: 系统守护者 这个特殊的守护者被引入,是为了实现正确的关闭顺序,即日志(logging)要保持可用直到所有普通actor终止,即使日志本身也是用actor实现的。其实现方法是:系统守护者观察user守护者,并在收到`Terminated`消息初始化其自己的关闭过程。顶级的系统actor被监管的策略是,对收到的除`ActorInitializationException`和`ActorKilledException`之外的所有`Exception`无限地执行重启,这也将终止其所有子actor。所有其他`Throwable`被上升,然后将导致整个actor系统的关闭。 #####`/`: 根守护者 根守护者所谓“顶级”actor的祖父,它监督所有在[Actor路径的顶级作用域](05_actor_references_paths_and_addresses.md#toplevel-paths)中定义的特殊actor,使用发现任何`Exception`就终止子actor的`SupervisorStrategy.stoppingStrategy`策略。其他所有Throwable都会被上升……但是上升给谁?所有的真实actor都有一个监管者,但是根守护者没有父actor,因为它就是整个树结构的根。因此这里使用一个虚拟的`ActorRef`,在发现问题后立即停掉其子actor,并在根守护者完全终止之后(所有子actor递归停止),立即把actor系统的`isTerminated`置为`true`。 ###<a name="supervision-restart"></a>重启的含义 当actor在处理某条消息时失败时,失败的原因可以分成以下三类: * 对收到的特定消息的系统错误(即程序错误) * 处理消息时一些外部资源的(临时性)失败 * actor内部状态崩溃了 除非故障能被专门识别,否则所述的第三个原因不能被排除,从而引出内部状态需要被清除的结论。如果监管者确定它的其他子actor或本身不会受到崩溃的影响——例如使用了错误内核模式的自恢复应用——因此最好只重启这个孩子。具体实现是通过建立底层`Actor`类的新实例,并用新的`ActorRef`更换故障实例;能做到这一点是因为将actor都封装载了特殊的引用中。然后新actor恢复处理其邮箱,这意味着该启动在actor外部是不可见的,显著的异常是在发生失败期间的消息不会被重新处理。 重启过程中所发生事件的精确次序是: 1. actor被挂起(意味着它不会处理正常消息直到被恢复),并递归挂起其所有子actor 1. 调用旧实例的 `preRestart` hook (缺省实现是向所有子actor发送终止请求并调用 `postStop`) 1. 等待所有子actor终止(使用`context.stop()`)直到 `preRestart` 最终结束;这里所有的actor操作都是非阻塞的,最后被杀掉的子actor的终止通知会影响下一步的执行 1. 再次调用原来提供的工厂生成actor的新实例 1. 调用新实例的`postRestart`方法(其默认实现是调用`preStart`方法) 1. 对步骤3中没有被杀死的所有子actor发送重启请求;重启的actor会遵循相同的过程,从步骤2开始 1. 恢复这个actor ###生命周期监控的含义 > 注意 > 生命周期监控在Akka中经常被引作`DeathWatch` 与上面所描述的特殊父子关系相对的,每一个actor都可以监控其他任意actor。由于actor从创建到完全可用和重启都是除了监管者之外都不可见的,所以唯一可用于监视的状态变化是可用到失效的转变。监视因此被用于绑定两个actor,使监控者能对另一个actor的终止做出响应,而相应的,监督者是对失败做出响应。 生命周期监控是通过监管actor收到`Terminated`消息实现的,其默认行为是抛出一个`DeathPactException`。要开始监听`Terminated`消息,需要调用`ActorContext.watch(targetActorRef)`。要停止监听,需要调用`ActorContext.unwatch(targetActorRef)`。一个重要的特性是,消息将不考虑监控请求和目标终止发生的顺序,也就是说,即使在登记的时候目标已经死了,你仍然会得到消息。 如果一个监管者不能简单地重启其子actor,而必须终止它们,这时监控就特别有用,例如在actor初始化时发生错误。在这种情况下,它应该监控这些子actor并重新创建它们,或安排自己在稍后的时间重试。 另一个常见的应用情况是,一个actor需要在没有外部资源时失败,该资源也可能是它的子actor之一。如果第三方通过`system.stop(child)`或发送`PoisonPill`的方式终止子actor,其监管者很可能会受到影响。 ###一对一策略 vs. 多对一策略 Akka中有两种类型的监管策略:`OneForOneStrategy` 和`AllForOneStrategy`。两者都配置有从异常类型监管指令间的映射(见[上文](04_supervision_and_monitoring.md#supervision-directives)),并限制了一个孩子被终止之前允许失败的次数。它们之间的区别在于,前者只将所获得的指令应用在发生故障的子actor上,而后者则是应用在所有孩子上。通常情况下,你应该使用`OneForOneStrategy`,这也是默认的策略。 `AllForOneStrategy`适用的情况是,子actor之间有很紧密的依赖,以至于一个actor的失败会影响其他孩子,即他们是不可分开的。由于重启不清除邮箱,所以往往最好是失败时终止孩子并在监管者显式地重建它们(通过观察孩子们的生命周期);否则你必须确保重启前入队的消息在重启后处理是没有问题的。 通常停止一个孩子(即对失败不再响应)不会自动终止多对一策略中其他的孩子;可以很容易地通过观察它们的生命周期来做到这点:如果`Terminated`的消息不能被监管者处理,它会抛出一个`DeathPactException`,并(这取决于其监管者)将重新启动,默认`preRestart`操作会终止所有的孩子。当然这也可以被显式地处理。 请注意,在多对一监管者下创建一个临时的actor会导致一个问题:临时actor的失败上升会使所有永久actor受到影响。如果这不是所期望的,安装一个中间监管者;这可以很容易地通过为工作者声明大小为1的路由器来完成,请参阅路由[routing-scala](../chapter3/06_routing.md)或[routing-java`](#TODO)。
xjpz/akka-doc-cn
2.3.6/scala/chapter2/04_supervision_and_monitoring.md
Markdown
cc0-1.0
10,255
/** * ***************************************************************************** Copyright (c) 2000, * 2011 IBM Corporation and others. All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 which accompanies this * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html * * <p>Contributors: IBM Corporation - initial API and implementation * ***************************************************************************** */ package org.eclipse.jdt.internal.corext.refactoring.typeconstraints; import org.eclipse.core.runtime.Assert; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.ISourceRange; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.NodeFinder; import org.eclipse.jdt.internal.corext.SourceRangeFactory; public final class CompilationUnitRange { private final ICompilationUnit fCompilationUnit; private final ISourceRange fSourceRange; public CompilationUnitRange(ICompilationUnit unit, ISourceRange range) { Assert.isNotNull(unit); Assert.isNotNull(range); fCompilationUnit = unit; fSourceRange = range; } public CompilationUnitRange(ICompilationUnit unit, ASTNode node) { this(unit, SourceRangeFactory.create(node)); } public ICompilationUnit getCompilationUnit() { return fCompilationUnit; } public ISourceRange getSourceRange() { return fSourceRange; } //rootNode must be the ast root for fCompilationUnit public ASTNode getNode(CompilationUnit rootNode) { NodeFinder finder = new NodeFinder(rootNode, fSourceRange.getOffset(), fSourceRange.getLength()); ASTNode result = finder.getCoveringNode(); if (result != null) return result; return finder.getCoveredNode(); } /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { return "(" + fSourceRange.toString() + " in " + fCompilationUnit.getElementName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof CompilationUnitRange)) return false; CompilationUnitRange other = (CompilationUnitRange) obj; return fCompilationUnit.equals(other.fCompilationUnit) && fSourceRange.equals(other.fSourceRange); } @Override public int hashCode() { return (37 * fCompilationUnit.hashCode()) ^ fSourceRange.hashCode(); } }
TypeFox/che
plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/CompilationUnitRange.java
Java
epl-1.0
2,598
package org.jboss.windup.graph; import org.apache.tinkerpop.gremlin.structure.Property; import org.apache.tinkerpop.gremlin.structure.Vertex; /** * This is used to get a callback whenever changes occur to the graph. * * @author <a href="mailto:[email protected]">Jesse Sightler</a> */ public interface GraphListener { /** * Called when a {@link Vertex} is added to the graph. * * @param vertex */ void vertexAdded(Vertex vertex); /** * This should be called whenever a vertex property is updated. */ void vertexPropertyChanged(Vertex element, Property oldValue, Object setValue, Object... vertexPropertyKeyValues); }
johnsteele/windup
graph/api/src/main/java/org/jboss/windup/graph/GraphListener.java
Java
epl-1.0
678
/** * <copyright> * </copyright> * * $Id$ */ package org.openhealthtools.mdht.uml.cda.emspcr.tests; import java.util.Collection; import java.util.Map; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.ecore.EObject; import org.junit.Test; import org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch; import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; import org.openhealthtools.mdht.uml.cda.emspcr.operations.ComplaintReportedByDispatchOperations; import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; import org.openhealthtools.mdht.uml.hl7.datatypes.CD; import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; /** * <!-- begin-user-doc --> * A static utility class that provides operations related to '<em><b>Complaint Reported By Dispatch</b></em>' model objects. * <!-- end-user-doc --> * * <p> * The following operations are supported: * <ul> * <li>{@link org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch#validateComplaintReportedByDispatchTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Complaint Reported By Dispatch Template Id</em>}</li> * <li>{@link org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch#validateComplaintReportedByDispatchMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Complaint Reported By Dispatch Mood Code</em>}</li> * <li>{@link org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch#validateComplaintReportedByDispatchCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Complaint Reported By Dispatch Code P</em>}</li> * <li>{@link org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch#validateComplaintReportedByDispatchCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Complaint Reported By Dispatch Code</em>}</li> * <li>{@link org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch#validateComplaintReportedByDispatchValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Complaint Reported By Dispatch Value</em>}</li> * <li>{@link org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatch#validateComplaintReportedByDispatchValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Complaint Reported By Dispatch Value P</em>}</li> * </ul> * </p> * * @generated */ public class ComplaintReportedByDispatchTest extends CDAValidationTest { /** * * @generated */ @Test public void testValidateComplaintReportedByDispatchTemplateId() { OperationsTestCase<ComplaintReportedByDispatch> validateComplaintReportedByDispatchTemplateIdTestCase = new OperationsTestCase<ComplaintReportedByDispatch>( "validateComplaintReportedByDispatchTemplateId", operationsForOCL.getOCLValue("VALIDATE_COMPLAINT_REPORTED_BY_DISPATCH_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { @Override protected void updateToFail(ComplaintReportedByDispatch target) { } @Override protected void updateToPass(ComplaintReportedByDispatch target) { target.init(); } @Override protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) { return ComplaintReportedByDispatchOperations.validateComplaintReportedByDispatchTemplateId( (ComplaintReportedByDispatch) objectToTest, diagnostician, map); } }; validateComplaintReportedByDispatchTemplateIdTestCase.doValidationTest(); } /** * * @generated */ @Test public void testValidateComplaintReportedByDispatchMoodCode() { OperationsTestCase<ComplaintReportedByDispatch> validateComplaintReportedByDispatchMoodCodeTestCase = new OperationsTestCase<ComplaintReportedByDispatch>( "validateComplaintReportedByDispatchMoodCode", operationsForOCL.getOCLValue("VALIDATE_COMPLAINT_REPORTED_BY_DISPATCH_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { @Override protected void updateToFail(ComplaintReportedByDispatch target) { } @Override protected void updateToPass(ComplaintReportedByDispatch target) { target.init(); } @Override protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) { return ComplaintReportedByDispatchOperations.validateComplaintReportedByDispatchMoodCode( (ComplaintReportedByDispatch) objectToTest, diagnostician, map); } }; validateComplaintReportedByDispatchMoodCodeTestCase.doValidationTest(); } /** * * @generated */ @Test public void testValidateComplaintReportedByDispatchCodeP() { OperationsTestCase<ComplaintReportedByDispatch> validateComplaintReportedByDispatchCodePTestCase = new OperationsTestCase<ComplaintReportedByDispatch>( "validateComplaintReportedByDispatchCodeP", operationsForOCL.getOCLValue("VALIDATE_COMPLAINT_REPORTED_BY_DISPATCH_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { @Override protected void updateToFail(ComplaintReportedByDispatch target) { } @Override protected void updateToPass(ComplaintReportedByDispatch target) { target.init(); } @Override protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) { return ComplaintReportedByDispatchOperations.validateComplaintReportedByDispatchCodeP( (ComplaintReportedByDispatch) objectToTest, diagnostician, map); } }; validateComplaintReportedByDispatchCodePTestCase.doValidationTest(); } /** * * @generated */ @Test public void testValidateComplaintReportedByDispatchCode() { OperationsTestCase<ComplaintReportedByDispatch> validateComplaintReportedByDispatchCodeTestCase = new OperationsTestCase<ComplaintReportedByDispatch>( "validateComplaintReportedByDispatchCode", operationsForOCL.getOCLValue("VALIDATE_COMPLAINT_REPORTED_BY_DISPATCH_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { @Override protected void updateToFail(ComplaintReportedByDispatch target) { } @Override protected void updateToPass(ComplaintReportedByDispatch target) { target.init(); } @Override protected void setDependency(ComplaintReportedByDispatch target) { Collection<Object> passToken = new java.util.ArrayList<Object>(3); passToken.add(target); map.put("org.openhealthtools.mdht.uml.cda.emspcr.ComplaintReportedByDispatchCodeP", passToken); } @Override protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) { return ComplaintReportedByDispatchOperations.validateComplaintReportedByDispatchCode( (ComplaintReportedByDispatch) objectToTest, diagnostician, map); } }; validateComplaintReportedByDispatchCodeTestCase.doValidationTest(); } /** * * @generated */ @Test public void testValidateComplaintReportedByDispatchValue() { OperationsTestCase<ComplaintReportedByDispatch> validateComplaintReportedByDispatchValueTestCase = new OperationsTestCase<ComplaintReportedByDispatch>( "validateComplaintReportedByDispatchValue", operationsForOCL.getOCLValue("VALIDATE_COMPLAINT_REPORTED_BY_DISPATCH_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { @Override protected void updateToFail(ComplaintReportedByDispatch target) { } @Override protected void updateToPass(ComplaintReportedByDispatch target) { target.init(); CD value = DatatypesFactory.eINSTANCE.createCD(); target.getValues().add(value); } @Override protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) { return ComplaintReportedByDispatchOperations.validateComplaintReportedByDispatchValue( (ComplaintReportedByDispatch) objectToTest, diagnostician, map); } }; validateComplaintReportedByDispatchValueTestCase.doValidationTest(); } /** * * @generated */ @Test public void testValidateComplaintReportedByDispatchValueP() { OperationsTestCase<ComplaintReportedByDispatch> validateComplaintReportedByDispatchValuePTestCase = new OperationsTestCase<ComplaintReportedByDispatch>( "validateComplaintReportedByDispatchValueP", operationsForOCL.getOCLValue("VALIDATE_COMPLAINT_REPORTED_BY_DISPATCH_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { @Override protected void updateToFail(ComplaintReportedByDispatch target) { } @Override protected void updateToPass(ComplaintReportedByDispatch target) { target.init(); } @Override protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) { return ComplaintReportedByDispatchOperations.validateComplaintReportedByDispatchValueP( (ComplaintReportedByDispatch) objectToTest, diagnostician, map); } }; validateComplaintReportedByDispatchValuePTestCase.doValidationTest(); } /** * * @generated */ private static class OperationsForOCL extends ComplaintReportedByDispatchOperations { public String getOCLValue(String fieldName) { String oclValue = null; try { oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); } catch (Exception e) { oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; } return oclValue; } } /** * * @generated */ private static class ObjectFactory implements TestObjectFactory<ComplaintReportedByDispatch> { public ComplaintReportedByDispatch create() { return EmspcrFactory.eINSTANCE.createComplaintReportedByDispatch(); } } /** * * @generated */ private static OperationsForOCL operationsForOCL = new OperationsForOCL(); /** * * @generated */ private static ObjectFactory objectFactory = new ObjectFactory(); /** * Tests Operations Constructor for 100% coverage * @generated */ private static class ConstructorTestClass extends ComplaintReportedByDispatchOperations { }; /** * Tests Operations Constructor for 100% coverage * @generated */ @Test public void testConstructor() { @SuppressWarnings("unused") ConstructorTestClass constructorTestClass = new ConstructorTestClass(); } // testConstructor /** * * @generated */ @Override protected EObject getObjectToTest() { return null; } } // ComplaintReportedByDispatchOperations
drbgfc/mdht
cda/tests/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/ComplaintReportedByDispatchTest.java
Java
epl-1.0
10,384
/******************************************************************************* * Copyright (c) 2010 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.opibuilder.palette; import org.csstudio.opibuilder.model.AbstractWidgetModel; import org.csstudio.opibuilder.util.WidgetDescriptor; import org.eclipse.gef.requests.CreationFactory; /**The CreationFactory to create the widget. * @author Xihui Chen * */ public class WidgetCreationFactory implements CreationFactory { private final WidgetDescriptor widgetDescriptor; private AbstractWidgetModel widgetModel = null; public WidgetCreationFactory(WidgetDescriptor widgetDescriptor) { this.widgetDescriptor = widgetDescriptor; } @Override public Object getNewObject() { widgetModel = widgetDescriptor.getWidgetModel(); return widgetModel; } @Override public Object getObjectType() { if(widgetModel == null) widgetModel = widgetDescriptor.getWidgetModel(); Object widgetClass = widgetModel.getClass(); return widgetClass; } }
fqqb/yamcs-studio
bundles/org.csstudio.opibuilder/src/org/csstudio/opibuilder/palette/WidgetCreationFactory.java
Java
epl-1.0
1,412
/** * Copyright (c) 2015-2017 Simon Merschjohann and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.eclipse.smarthome.automation.module.script.rulesupport.shared.factories; import org.eclipse.smarthome.automation.Action; import org.eclipse.smarthome.automation.handler.ActionHandler; import org.eclipse.smarthome.automation.module.script.rulesupport.shared.ScriptedHandler; /** * * @author Simon Merschjohann - Initial contribution */ public interface ScriptedActionHandlerFactory extends ScriptedHandler { public ActionHandler get(Action action); }
plamen-peev/smarthome
bundles/automation/org.eclipse.smarthome.automation.module.script.rulesupport/src/main/java/org/eclipse/smarthome/automation/module/script/rulesupport/shared/factories/ScriptedActionHandlerFactory.java
Java
epl-1.0
783
/******************************************************************************* * Copyright (c) 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package com.ibm.ws.microprofile.metrics.writer; import java.io.IOException; import com.ibm.ws.microprofile.metrics.exceptions.EmptyRegistryException; import com.ibm.ws.microprofile.metrics.exceptions.NoSuchMetricException; import com.ibm.ws.microprofile.metrics.exceptions.NoSuchRegistryException; /** * */ public interface OutputWriter { /** * * @param registryName * @param metricName * @throws NoSuchRegistryException * @throws NoSuchMetricException * @throws IOException * @throws EmptyRegistryException */ public void write(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException, IOException, EmptyRegistryException; /** * * @param registryName * @throws NoSuchRegistryException * @throws EmptyRegistryException * @throws IOException */ public void write(String registryName) throws NoSuchRegistryException, EmptyRegistryException, IOException; /** * * @throws IOException */ public void write() throws IOException; }
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/writer/OutputWriter.java
Java
epl-1.0
1,614
#!/bin/bash -e # PWD = source dir # BASE_DIR = build dir # BUILD_DIR = base dir/build # HOST_DIR = base dir/host # BINARIES_DIR = images dir # TARGET_DIR = target dir RECALBOX_BINARIES_DIR="${BINARIES_DIR}/recalbox" RECALBOX_TARGET_DIR="${TARGET_DIR}/recalbox" sed -i "s|root:x:0:0:root:/root:/bin/sh|root:x:0:0:root:/recalbox/share/system:/bin/sh|g" "${TARGET_DIR}/etc/passwd" || exit 1 rm -rf "${TARGET_DIR}/etc/dropbear" || exit 1 ln -sf "/recalbox/share/system/ssh" "${TARGET_DIR}/etc/dropbear" || exit 1 mkdir -p ${TARGET_DIR}/etc/emulationstation || exit 1 ln -sf "/recalbox/share_init/system/.emulationstation/es_systems.cfg" "${TARGET_DIR}/etc/emulationstation/es_systems.cfg" || exit 1 ln -sf "/recalbox/share_init/system/.emulationstation/themes" "${TARGET_DIR}/etc/emulationstation/themes" || exit 1 ln -sf "/recalbox/share/cheats" "${TARGET_DIR}/recalbox/share_init/cheats/custom" || exit 1 # we don't want the kodi startup script rm -f "${TARGET_DIR}/etc/init.d/S50kodi" || exit 1 # acpid requires /var/run, so, requires S03populate if test -e "${TARGET_DIR}/etc/init.d/S02acpid" then mv "${TARGET_DIR}/etc/init.d/S02acpid" "${TARGET_DIR}/etc/init.d/S05acpid" || exit 1 fi # we don't want default xorg files rm -f "${TARGET_DIR}/etc/X11/xorg.conf" || exit 1 # we want an empty boot directory (grub installation copy some files in the target boot directory) rm -rf "${TARGET_DIR}/boot/grub" || exit 1 # reorder the boot scripts for the network boot if test -e "${TARGET_DIR}/etc/init.d/S10udev" then mv "${TARGET_DIR}/etc/init.d/S10udev" "${TARGET_DIR}/etc/init.d/S05udev" || exit 1 # move to make number spaces fi if test -e "${TARGET_DIR}/etc/init.d/S30dbus" then mv "${TARGET_DIR}/etc/init.d/S30dbus" "${TARGET_DIR}/etc/init.d/S06dbus" || exit 1 # move really before for network (connman prerequisite) fi if test -e "${TARGET_DIR}/etc/init.d/S40network" then mv "${TARGET_DIR}/etc/init.d/S40network" "${TARGET_DIR}/etc/init.d/S07network" || exit 1 # move to make ifaces up sooner, mainly mountable/unmountable before/after share fi if test -e "${TARGET_DIR}/etc/init.d/S45connman" then mv "${TARGET_DIR}/etc/init.d/S45connman" "${TARGET_DIR}/etc/init.d/S08connman" || exit 1 # move to make before share fi # remove kodi default joystick configuration files # while as a minimum, the file joystick.Sony.PLAYSTATION(R)3.Controller.xml makes references to PS4 controllers with axes which doesn't exist (making kodi crashing) # i prefer to put it here than in packages/kodi while there are already a lot a lot of things rm -rf "${TARGET_DIR}/usr/share/kodi/system/keymaps/joystick."*.xml || exit 1 # tmpfs or sysfs is mounted over theses directories # clear these directories is required for the upgrade (otherwise, tar xf fails) rm -rf "${TARGET_DIR}/"{var,run,sys,tmp} || exit 1 mkdir "${TARGET_DIR}/"{var,run,sys,tmp} || exit 1 # make /etc/shadow a file generated from /boot/recalbox-boot.conf for security rm -f "${TARGET_DIR}/etc/shadow" || exit 1 ln -sf "/run/recalbox.shadow" "${TARGET_DIR}/etc/shadow" || exit 1 # Add the date while the version can be nightly or unstable RVERSION=$(cat "${TARGET_DIR}/recalbox/recalbox.version") # bootsplash TGVERSION="${RVERSION} $(date "+%Y/%m/%d %H:%M")" convert "${TARGET_DIR}/recalbox/system/resources/splash/logo.png" -fill white -pointsize 30 -annotate +50+1020 "${TGVERSION}" "${TARGET_DIR}/recalbox/system/resources/splash/logo-version.png" || exit 1 convert "${TARGET_DIR}/recalbox/system/resources/splash/logo.png" -fill white -pointsize 60 -gravity center -annotate +0+0 "Upgrading the system\nPlease wait..." "${TARGET_DIR}/recalbox/system/resources/splash/logo-upgrade.png" || exit 1 # Splash video subtitle echo -e "1\n00:00:00,000 --> 00:00:02,000\n${TGVERSION}" > "${TARGET_DIR}/recalbox/system/resources/splash/recalboxintro.srt" omx_fnt="/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf" if [[ -f ${TARGET_DIR}$omx_fnt ]] ; then sed -i "s|omx_fnt=\"\"|omx_fnt=\"--font=$omx_fnt\"|g" "${TARGET_DIR}/etc/init.d/S02splash" fi # Changelog cp "CHANGELOG.md" "${TARGET_DIR}/recalbox/recalbox.changelog"
Laddyacris/recalbox-buildroot
board/recalbox/recalbox-patch-target.sh
Shell
gpl-2.0
4,201
/* $OpenBSD: connection.c,v 1.37 2014/01/22 03:09:31 deraadt Exp $ */ /* $EOM: connection.c,v 1.28 2000/11/23 12:21:18 niklas Exp $ */ /* * Copyright (c) 1999, 2000, 2001 Niklas Hallqvist. All rights reserved. * Copyright (c) 1999 Hakan Olsson. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * This code was written under funding by Ericsson Radio Systems. */ #include <sys/queue.h> #include <sys/time.h> #include <sys/socket.h> #include <stdlib.h> #include <string.h> #include "conf.h" #include "connection.h" #include "doi.h" #include "ipsec.h" #include "pf_key_v2.h" /* XXX isakmp.h only required for compare_ids(). */ #include "isakmp.h" #include "log.h" #include "timer.h" #include "ui.h" #include "util.h" /* How often should we check that connections we require to be up, are up? */ #define CHECK_INTERVAL 60 static void connection_passive_teardown(char *); struct connection { TAILQ_ENTRY(connection) link; char *name; struct event *ev; }; struct connection_passive { TAILQ_ENTRY(connection_passive) link; char *name; u_int8_t *local_id, *remote_id; size_t local_sz, remote_sz; #if 0 /* XXX Potential additions to 'connection_passive'. */ char *isakmp_peer; struct sa *sa; /* XXX "Soft" ref to active sa? */ struct timeval sa_expiration; /* XXX *sa may expire. */ #endif }; TAILQ_HEAD(connection_head, connection) connections; TAILQ_HEAD(passive_head, connection_passive) connections_passive; /* * This is where we setup all the connections we want there right from the * start. */ void connection_init(void) { struct conf_list *conns, *attrs; struct conf_list_node *conn, *attr = NULL; /* * Passive connections normally include: all "active" connections that * are not flagged "Active-Only", plus all connections listed in * the 'Passive-Connections' list. */ TAILQ_INIT(&connections); TAILQ_INIT(&connections_passive); conns = conf_get_list("Phase 2", "Connections"); if (conns) { for (conn = TAILQ_FIRST(&conns->fields); conn; conn = TAILQ_NEXT(conn, link)) { if (connection_setup(conn->field)) log_print("connection_init: could not setup " "\"%s\"", conn->field); /* XXX Break/abort here if connection_setup failed? */ /* * XXX This code (i.e. the attribute lookup) seems * like a likely candidate for factoring out into a * function of its own. */ attrs = conf_get_list(conn->field, "Flags"); if (attrs) for (attr = TAILQ_FIRST(&attrs->fields); attr; attr = TAILQ_NEXT(attr, link)) if (strcasecmp("active-only", attr->field) == 0) break; if (!attrs || (attrs && !attr)) if (connection_record_passive(conn->field)) log_print("connection_init: could not " "record connection \"%s\"", conn->field); if (attrs) conf_free_list(attrs); } conf_free_list(conns); } conns = conf_get_list("Phase 2", "Passive-Connections"); if (conns) { for (conn = TAILQ_FIRST(&conns->fields); conn; conn = TAILQ_NEXT(conn, link)) if (connection_record_passive(conn->field)) log_print("connection_init: could not record " "passive connection \"%s\"", conn->field); conf_free_list(conns); } } /* Check the connection in VCONN and schedule another check later. */ static void connection_checker(void *vconn) { struct timeval now; struct connection *conn = vconn; gettimeofday(&now, 0); now.tv_sec += conf_get_num("General", "check-interval", CHECK_INTERVAL); conn->ev = timer_add_event("connection_checker", connection_checker, conn, &now); if (!conn->ev) log_print("connection_checker: could not add timer event"); if (!ui_daemon_passive) pf_key_v2_connection_check(conn->name); } /* Find the connection named NAME. */ static struct connection * connection_lookup(char *name) { struct connection *conn; for (conn = TAILQ_FIRST(&connections); conn; conn = TAILQ_NEXT(conn, link)) if (strcasecmp(conn->name, name) == 0) return conn; return 0; } /* Does the connection named NAME exist? */ int connection_exist(char *name) { return (connection_lookup(name) != 0); } /* Find the passive connection named NAME. */ static struct connection_passive * connection_passive_lookup_by_name(char *name) { struct connection_passive *conn; for (conn = TAILQ_FIRST(&connections_passive); conn; conn = TAILQ_NEXT(conn, link)) if (strcasecmp(conn->name, name) == 0) return conn; return 0; } /* * IDs of different types cannot be the same. * XXX Rename to ipsec_compare_id, and move to ipsec.c ? */ static int compare_ids(u_int8_t *id1, u_int8_t *id2, size_t idlen) { int id1_type, id2_type; id1_type = GET_ISAKMP_ID_TYPE(id1); id2_type = GET_ISAKMP_ID_TYPE(id2); return id1_type == id2_type ? memcmp(id1 + ISAKMP_ID_DATA_OFF, id2 + ISAKMP_ID_DATA_OFF, idlen - ISAKMP_ID_DATA_OFF) : -1; } /* Find the connection named with matching IDs. */ char * connection_passive_lookup_by_ids(u_int8_t *id1, u_int8_t *id2) { struct connection_passive *conn; for (conn = TAILQ_FIRST(&connections_passive); conn; conn = TAILQ_NEXT(conn, link)) { if (!conn->remote_id) continue; /* * If both IDs match what we have saved, return the name. * Don't bother in which order they are. */ if ((compare_ids(id1, conn->local_id, conn->local_sz) == 0 && compare_ids(id2, conn->remote_id, conn->remote_sz) == 0) || (compare_ids(id1, conn->remote_id, conn->remote_sz) == 0 && compare_ids(id2, conn->local_id, conn->local_sz) == 0)) { LOG_DBG((LOG_MISC, 60, "connection_passive_lookup_by_ids: " "returned \"%s\"", conn->name)); return conn->name; } } /* * In the road warrior case, we do not know the remote ID. In that * case we will just match against the local ID. */ for (conn = TAILQ_FIRST(&connections_passive); conn; conn = TAILQ_NEXT(conn, link)) { if (!conn->remote_id) continue; if (compare_ids(id1, conn->local_id, conn->local_sz) == 0 || compare_ids(id2, conn->local_id, conn->local_sz) == 0) { LOG_DBG((LOG_MISC, 60, "connection_passive_lookup_by_ids: returned \"%s\"" " only matched local id", conn->name)); return conn->name; } } LOG_DBG((LOG_MISC, 60, "connection_passive_lookup_by_ids: no match")); return 0; } /* * Setup NAME to be a connection that should be up "always", i.e. if it dies, * for whatever reason, it should be tried to be brought up, over and over * again. */ int connection_setup(char *name) { struct connection *conn = 0; struct timeval now; /* Check for trials to add duplicate connections. */ if (connection_lookup(name)) { LOG_DBG((LOG_MISC, 10, "connection_setup: cannot add \"%s\" twice", name)); return 0; } conn = calloc(1, sizeof *conn); if (!conn) { log_error("connection_setup: calloc (1, %lu) failed", (unsigned long)sizeof *conn); goto fail; } conn->name = strdup(name); if (!conn->name) { log_error("connection_setup: strdup (\"%s\") failed", name); goto fail; } gettimeofday(&now, 0); conn->ev = timer_add_event("connection_checker", connection_checker, conn, &now); if (!conn->ev) { log_print("connection_setup: could not add timer event"); goto fail; } TAILQ_INSERT_TAIL(&connections, conn, link); return 0; fail: if (conn) { free(conn->name); free(conn); } return -1; } int connection_record_passive(char *name) { struct connection_passive *conn; char *local_id, *remote_id; if (connection_passive_lookup_by_name(name)) { LOG_DBG((LOG_MISC, 10, "connection_record_passive: cannot add \"%s\" twice", name)); return 0; } local_id = conf_get_str(name, "Local-ID"); if (!local_id) { log_print("connection_record_passive: " "\"Local-ID\" is missing from section [%s]", name); return -1; } /* If the remote id lookup fails we defer it to later */ remote_id = conf_get_str(name, "Remote-ID"); conn = calloc(1, sizeof *conn); if (!conn) { log_error("connection_record_passive: calloc (1, %lu) failed", (unsigned long)sizeof *conn); return -1; } conn->name = strdup(name); if (!conn->name) { log_error("connection_record_passive: strdup (\"%s\") failed", name); goto fail; } /* XXX IPsec DOI-specific. */ conn->local_id = ipsec_build_id(local_id, &conn->local_sz); if (!conn->local_id) goto fail; if (remote_id) { conn->remote_id = ipsec_build_id(remote_id, &conn->remote_sz); if (!conn->remote_id) goto fail; } else conn->remote_id = 0; TAILQ_INSERT_TAIL(&connections_passive, conn, link); LOG_DBG((LOG_MISC, 60, "connection_record_passive: passive connection \"%s\" added", conn->name)); return 0; fail: free(conn->local_id); free(conn->name); free(conn); return -1; } /* Remove the connection named NAME. */ void connection_teardown(char *name) { struct connection *conn; conn = connection_lookup(name); if (!conn) return; TAILQ_REMOVE(&connections, conn, link); timer_remove_event(conn->ev); free(conn->name); free(conn); } /* Remove the passive connection named NAME. */ static void connection_passive_teardown(char *name) { struct connection_passive *conn; conn = connection_passive_lookup_by_name(name); if (!conn) return; TAILQ_REMOVE(&connections_passive, conn, link); free(conn->name); free(conn->local_id); free(conn->remote_id); free(conn); } void connection_report(void) { struct connection *conn; struct timeval now; struct connection_passive *pconn; struct doi *doi = doi_lookup(ISAKMP_DOI_ISAKMP); gettimeofday(&now, 0); for (conn = TAILQ_FIRST(&connections); conn; conn = TAILQ_NEXT(conn, link)) LOG_DBG((LOG_REPORT, 0, "connection_report: connection %s next check %lld seconds", (conn->name ? conn->name : "<unnamed>"), (long long)(conn->ev->expiration.tv_sec - now.tv_sec))); for (pconn = TAILQ_FIRST(&connections_passive); pconn; pconn = TAILQ_NEXT(pconn, link)) LOG_DBG((LOG_REPORT, 0, "connection_report: passive connection %s %s", pconn->name, doi->decode_ids("local_id: %s, remote_id: %s", pconn->local_id, pconn->local_sz, pconn->remote_id, pconn->remote_sz, 1))); } /* Reinitialize all connections (SIGHUP handling). */ void connection_reinit(void) { struct connection *conn, *next; struct connection_passive *pconn, *pnext; LOG_DBG((LOG_MISC, 30, "connection_reinit: reinitializing connection list")); /* Remove all present connections. */ for (conn = TAILQ_FIRST(&connections); conn; conn = next) { next = TAILQ_NEXT(conn, link); connection_teardown(conn->name); } for (pconn = TAILQ_FIRST(&connections_passive); pconn; pconn = pnext) { pnext = TAILQ_NEXT(pconn, link); connection_passive_teardown(pconn->name); } /* Setup new connections, as the (new) config directs. */ connection_init(); }
mohammadhamad/mhhgen
repos/libports/src/test/isakmp_rpc_lwip/connection.c
C
gpl-2.0
12,121
{- Copyright (C) 2006-8 John MacFarlane <[email protected]> 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 -} {- | Module : Text.Pandoc.Writers.LaTeX Copyright : Copyright (C) 2006-8 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <[email protected]> Stability : alpha Portability : portable Conversion of 'Pandoc' format into LaTeX. -} module Text.Pandoc.Writers.LaTeX ( writeLaTeX ) where import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.Pandoc.Templates import Text.Printf ( printf ) import Data.List ( (\\), isSuffixOf, isPrefixOf, intersperse ) import Data.Char ( toLower ) import Control.Monad.State import Text.PrettyPrint.HughesPJ hiding ( Str ) data WriterState = WriterState { stInNote :: Bool -- @True@ if we're in a note , stOLLevel :: Int -- level of ordered list nesting , stOptions :: WriterOptions -- writer options, so they don't have to be parameter , stVerbInNote :: Bool -- true if document has verbatim text in note , stEnumerate :: Bool -- true if document needs fancy enumerated lists , stTable :: Bool -- true if document has a table , stStrikeout :: Bool -- true if document has strikeout , stSubscript :: Bool -- true if document has subscript , stUrl :: Bool -- true if document has visible URL link , stGraphics :: Bool -- true if document contains images , stLHS :: Bool -- true if document has literate haskell code , stBook :: Bool -- true if document uses book or memoir class } -- | Convert Pandoc to LaTeX. writeLaTeX :: WriterOptions -> Pandoc -> String writeLaTeX options document = evalState (pandocToLaTeX options document) $ WriterState { stInNote = False, stOLLevel = 1, stOptions = options, stVerbInNote = False, stEnumerate = False, stTable = False, stStrikeout = False, stSubscript = False, stUrl = False, stGraphics = False, stLHS = False, stBook = False } pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do let template = writerTemplate options let usesBookClass x = "\\documentclass" `isPrefixOf` x && ("{memoir}" `isSuffixOf` x || "{book}" `isSuffixOf` x || "{report}" `isSuffixOf` x) when (any usesBookClass (lines template)) $ modify $ \s -> s{stBook = True} titletext <- liftM render $ inlineListToLaTeX title authorsText <- mapM (liftM render . inlineListToLaTeX) authors dateText <- liftM render $ inlineListToLaTeX date body <- blockListToLaTeX blocks let main = render body st <- get let context = writerVariables options ++ [ ("toc", if writerTableOfContents options then "yes" else "") , ("body", main) , ("title", titletext) , ("date", dateText) ] ++ [ ("author", a) | a <- authorsText ] ++ [ ("xetex", "yes") | writerXeTeX options ] ++ [ ("verbatim-in-note", "yes") | stVerbInNote st ] ++ [ ("fancy-enums", "yes") | stEnumerate st ] ++ [ ("tables", "yes") | stTable st ] ++ [ ("strikeout", "yes") | stStrikeout st ] ++ [ ("subscript", "yes") | stSubscript st ] ++ [ ("url", "yes") | stUrl st ] ++ [ ("numbersections", "yes") | writerNumberSections options ] ++ [ ("lhs", "yes") | stLHS st ] ++ [ ("graphics", "yes") | stGraphics st ] return $ if writerStandalone options then renderTemplate context template else main -- escape things as needed for LaTeX stringToLaTeX :: String -> String stringToLaTeX = escapeStringUsing latexEscapes where latexEscapes = backslashEscapes "{}$%&_#" ++ [ ('^', "\\^{}") , ('\\', "\\textbackslash{}") , ('~', "\\ensuremath{\\sim}") , ('|', "\\textbar{}") , ('<', "\\textless{}") , ('>', "\\textgreater{}") , ('\160', "~") ] -- | Puts contents into LaTeX command. inCmd :: String -> Doc -> Doc inCmd cmd contents = char '\\' <> text cmd <> braces contents -- | Remove all code elements from list of inline elements -- (because it's illegal to have verbatim inside some command arguments) deVerb :: [Inline] -> [Inline] deVerb [] = [] deVerb ((Code str):rest) = (TeX $ "\\texttt{" ++ stringToLaTeX str ++ "}"):(deVerb rest) deVerb (other:rest) = other:(deVerb rest) -- | Convert Pandoc block element to LaTeX. blockToLaTeX :: Block -- ^ Block to convert -> State WriterState Doc blockToLaTeX Null = return empty blockToLaTeX (Plain lst) = do st <- get let opts = stOptions st wrapTeXIfNeeded opts True inlineListToLaTeX lst blockToLaTeX (Para [Image txt (src,tit)]) = do capt <- inlineListToLaTeX txt img <- inlineToLaTeX (Image txt (src,tit)) return $ text "\\begin{figure}[htb]" $$ text "\\centering" $$ img $$ (text "\\caption{" <> capt <> char '}') $$ text "\\end{figure}\n" blockToLaTeX (Para lst) = do st <- get let opts = stOptions st result <- wrapTeXIfNeeded opts True inlineListToLaTeX lst return $ result <> char '\n' blockToLaTeX (BlockQuote lst) = do contents <- blockListToLaTeX lst return $ text "\\begin{quote}" $$ contents $$ text "\\end{quote}" blockToLaTeX (CodeBlock (_,classes,_) str) = do st <- get env <- if writerLiterateHaskell (stOptions st) && "haskell" `elem` classes && "literate" `elem` classes then do modify $ \s -> s{ stLHS = True } return "code" else if stInNote st then do modify $ \s -> s{ stVerbInNote = True } return "Verbatim" else return "verbatim" return $ text ("\\begin{" ++ env ++ "}\n") <> text str <> text ("\n\\end{" ++ env ++ "}") blockToLaTeX (RawHtml _) = return empty blockToLaTeX (BulletList lst) = do items <- mapM listItemToLaTeX lst return $ text "\\begin{itemize}" $$ vcat items $$ text "\\end{itemize}" blockToLaTeX (OrderedList (start, numstyle, numdelim) lst) = do st <- get let oldlevel = stOLLevel st put $ st {stOLLevel = oldlevel + 1} items <- mapM listItemToLaTeX lst modify (\s -> s {stOLLevel = oldlevel}) exemplar <- if numstyle /= DefaultStyle || numdelim /= DefaultDelim then do modify $ \s -> s{ stEnumerate = True } return $ char '[' <> text (head (orderedListMarkers (1, numstyle, numdelim))) <> char ']' else return empty let resetcounter = if start /= 1 && oldlevel <= 4 then text $ "\\setcounter{enum" ++ map toLower (toRomanNumeral oldlevel) ++ "}{" ++ show (start - 1) ++ "}" else empty return $ text "\\begin{enumerate}" <> exemplar $$ resetcounter $$ vcat items $$ text "\\end{enumerate}" blockToLaTeX (DefinitionList lst) = do items <- mapM defListItemToLaTeX lst return $ text "\\begin{description}" $$ vcat items $$ text "\\end{description}" blockToLaTeX HorizontalRule = return $ text $ "\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n" blockToLaTeX (Header level lst) = do let lst' = deVerb lst txt <- inlineListToLaTeX lst' let noNote (Note _) = Str "" noNote x = x let lstNoNotes = processWith noNote lst' -- footnotes in sections don't work unless you specify an optional -- argument: \section[mysec]{mysec\footnote{blah}} optional <- if lstNoNotes == lst' then return empty else do res <- inlineListToLaTeX lstNoNotes return $ char '[' <> res <> char ']' let stuffing = optional <> char '{' <> txt <> char '}' book <- liftM stBook get return $ case (book, level) of (True, 1) -> text "\\chapter" <> stuffing <> char '\n' (True, 2) -> text "\\section" <> stuffing <> char '\n' (True, 3) -> text "\\subsection" <> stuffing <> char '\n' (True, 4) -> text "\\subsubsection" <> stuffing <> char '\n' (False, 1) -> text "\\section" <> stuffing <> char '\n' (False, 2) -> text "\\subsection" <> stuffing <> char '\n' (False, 3) -> text "\\subsubsection" <> stuffing <> char '\n' _ -> txt <> char '\n' blockToLaTeX (Table caption aligns widths heads rows) = do headers <- if all null heads then return empty else liftM ($$ text "\\hline") $ tableRowToLaTeX heads captionText <- inlineListToLaTeX caption rows' <- mapM tableRowToLaTeX rows let colDescriptors = concat $ zipWith toColDescriptor widths aligns let tableBody = text ("\\begin{tabular}{" ++ colDescriptors ++ "}") $$ headers $$ vcat rows' $$ text "\\end{tabular}" let centered txt = text "\\begin{center}" $$ txt $$ text "\\end{center}" modify $ \s -> s{ stTable = True } return $ if isEmpty captionText then centered tableBody <> char '\n' else text "\\begin{table}[h]" $$ centered tableBody $$ inCmd "caption" captionText $$ text "\\end{table}\n" toColDescriptor :: Double -> Alignment -> String toColDescriptor 0 align = case align of AlignLeft -> "l" AlignRight -> "r" AlignCenter -> "c" AlignDefault -> "l" toColDescriptor width align = ">{\\PBS" ++ (case align of AlignLeft -> "\\raggedright" AlignRight -> "\\raggedleft" AlignCenter -> "\\centering" AlignDefault -> "\\raggedright") ++ "\\hspace{0pt}}p{" ++ printf "%.2f" width ++ "\\columnwidth}" blockListToLaTeX :: [Block] -> State WriterState Doc blockListToLaTeX lst = mapM blockToLaTeX lst >>= return . vcat tableRowToLaTeX :: [[Block]] -> State WriterState Doc tableRowToLaTeX cols = mapM blockListToLaTeX cols >>= return . ($$ text "\\\\") . foldl (\row item -> row $$ (if isEmpty row then text "" else text " & ") <> item) empty listItemToLaTeX :: [Block] -> State WriterState Doc listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) . (nest 2) defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc defListItemToLaTeX (term, defs) = do term' <- inlineListToLaTeX $ deVerb term def' <- liftM (vcat . intersperse (text "")) $ mapM blockListToLaTeX defs return $ text "\\item[" <> term' <> text "]" $$ def' -- | Convert list of inline elements to LaTeX. inlineListToLaTeX :: [Inline] -- ^ Inlines to convert -> State WriterState Doc inlineListToLaTeX lst = mapM inlineToLaTeX lst >>= return . hcat isQuoted :: Inline -> Bool isQuoted (Quoted _ _) = True isQuoted Apostrophe = True isQuoted _ = False -- | Convert inline element to LaTeX inlineToLaTeX :: Inline -- ^ Inline to convert -> State WriterState Doc inlineToLaTeX (Emph lst) = inlineListToLaTeX (deVerb lst) >>= return . inCmd "emph" inlineToLaTeX (Strong lst) = inlineListToLaTeX (deVerb lst) >>= return . inCmd "textbf" inlineToLaTeX (Strikeout lst) = do contents <- inlineListToLaTeX $ deVerb lst modify $ \s -> s{ stStrikeout = True } return $ inCmd "sout" contents inlineToLaTeX (Superscript lst) = inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsuperscript" inlineToLaTeX (Subscript lst) = do modify $ \s -> s{ stSubscript = True } contents <- inlineListToLaTeX $ deVerb lst -- oddly, latex includes \textsuperscript but not \textsubscript -- so we have to define it (using a different name so as not to conflict with memoir class): return $ inCmd "textsubscr" contents inlineToLaTeX (SmallCaps lst) = inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsc" inlineToLaTeX (Cite _ lst) = inlineListToLaTeX lst inlineToLaTeX (Code str) = do st <- get when (stInNote st) $ modify $ \s -> s{ stVerbInNote = True } let chr = ((enumFromTo '!' '~') \\ str) !! 0 return $ text $ "\\verb" ++ [chr] ++ str ++ [chr] inlineToLaTeX (Quoted SingleQuote lst) = do contents <- inlineListToLaTeX lst let s1 = if (not (null lst)) && (isQuoted (head lst)) then text "\\," else empty let s2 = if (not (null lst)) && (isQuoted (last lst)) then text "\\," else empty return $ char '`' <> s1 <> contents <> s2 <> char '\'' inlineToLaTeX (Quoted DoubleQuote lst) = do contents <- inlineListToLaTeX lst let s1 = if (not (null lst)) && (isQuoted (head lst)) then text "\\," else empty let s2 = if (not (null lst)) && (isQuoted (last lst)) then text "\\," else empty return $ text "``" <> s1 <> contents <> s2 <> text "''" inlineToLaTeX Apostrophe = return $ char '\'' inlineToLaTeX EmDash = return $ text "---" inlineToLaTeX EnDash = return $ text "--" inlineToLaTeX Ellipses = return $ text "\\ldots{}" inlineToLaTeX (Str str) = return $ text $ stringToLaTeX str inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$' inlineToLaTeX (Math DisplayMath str) = return $ text "\\[" <> text str <> text "\\]" inlineToLaTeX (TeX str) = return $ text str inlineToLaTeX (HtmlInline _) = return empty inlineToLaTeX (LineBreak) = return $ text "\\\\" inlineToLaTeX Space = return $ char ' ' inlineToLaTeX (Link txt (src, _)) = case txt of [Code x] | x == src -> -- autolink do modify $ \s -> s{ stUrl = True } return $ text $ "\\url{" ++ x ++ "}" _ -> do contents <- inlineListToLaTeX $ deVerb txt return $ text ("\\href{" ++ src ++ "}{") <> contents <> char '}' inlineToLaTeX (Image _ (source, _)) = do modify $ \s -> s{ stGraphics = True } return $ text $ "\\includegraphics{" ++ source ++ "}" inlineToLaTeX (Note contents) = do st <- get put (st {stInNote = True}) contents' <- blockListToLaTeX contents modify (\s -> s {stInNote = False}) let rawnote = stripTrailingNewlines $ render contents' -- note: a \n before } is needed when note ends with a Verbatim environment let optNewline = "\\end{Verbatim}" `isSuffixOf` rawnote return $ text "\\footnote{" <> text rawnote <> (if optNewline then char '\n' else empty) <> char '}'
khajavi/pandoc
src/Text/Pandoc/Writers/LaTeX.hs
Haskell
gpl-2.0
15,592
<?php /** * Joomla! Content Management System * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\MVC\Controller; use Joomla\CMS\MVC\Factory\LegacyFactory; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; defined('JPATH_PLATFORM') or die; /** * Base class for a Joomla Controller * * Controller (Controllers are where you put all the actual code.) Provides basic * functionality, such as rendering views (aka displaying templates). * * @since 2.5.5 */ class BaseController extends \JObject { /** * The base path of the controller * * @var string * @since 3.0 */ protected $basePath; /** * The default view for the display method. * * @var string * @since 3.0 */ protected $default_view; /** * The mapped task that was performed. * * @var string * @since 3.0 */ protected $doTask; /** * Redirect message. * * @var string * @since 3.0 */ protected $message; /** * Redirect message type. * * @var string * @since 3.0 */ protected $messageType; /** * Array of class methods * * @var array * @since 3.0 */ protected $methods; /** * The name of the controller * * @var array * @since 3.0 */ protected $name; /** * The prefix of the models * * @var string * @since 3.0 */ protected $model_prefix; /** * The set of search directories for resources (views). * * @var array * @since 3.0 */ protected $paths; /** * URL for redirection. * * @var string * @since 3.0 */ protected $redirect; /** * Current or most recently performed task. * * @var string * @since 3.0 */ protected $task; /** * Array of class methods to call for a given task. * * @var array * @since 3.0 */ protected $taskMap; /** * Hold a JInput object for easier access to the input variables. * * @var \JInput * @since 3.0 */ protected $input; /** * The factory. * * @var MVCFactoryInterface * @since 3.10.0 */ protected $factory; /** * Instance container. * * @var \JControllerLegacy * @since 3.0 */ protected static $instance; /** * Instance container containing the views. * * @var \JViewLegacy[] * @since 3.4 */ protected static $views; /** * Adds to the stack of model paths in LIFO order. * * @param mixed $path The directory (string), or list of directories (array) to add. * @param string $prefix A prefix for models * * @return void * * @since 3.0 */ public static function addModelPath($path, $prefix = '') { \JModelLegacy::addIncludePath($path, $prefix); } /** * Create the filename for a resource. * * @param string $type The resource type to create the filename for. * @param array $parts An associative array of filename information. Optional. * * @return string The filename. * * @since 3.0 */ public static function createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'controller': if (!empty($parts['format'])) { if ($parts['format'] === 'html') { $parts['format'] = ''; } else { $parts['format'] = '.' . $parts['format']; } } else { $parts['format'] = ''; } $filename = strtolower($parts['name'] . $parts['format'] . '.php'); break; case 'view': if (!empty($parts['type'])) { $parts['type'] = '.' . $parts['type']; } else { $parts['type'] = ''; } $filename = strtolower($parts['name'] . '/view' . $parts['type'] . '.php'); break; } return $filename; } /** * Method to get a singleton controller instance. * * @param string $prefix The prefix for the controller. * @param array $config An array of optional constructor options. * * @return \JControllerLegacy * * @since 3.0 * @throws \Exception if the controller cannot be loaded. */ public static function getInstance($prefix, $config = array()) { if (is_object(self::$instance)) { return self::$instance; } $input = \JFactory::getApplication()->input; // Get the environment configuration. $basePath = array_key_exists('base_path', $config) ? $config['base_path'] : JPATH_COMPONENT; $format = $input->getWord('format'); $command = $input->get('task', 'display'); // Check for array format. $filter = \JFilterInput::getInstance(); if (is_array($command)) { $command = $filter->clean(array_pop(array_keys($command)), 'cmd'); } else { $command = $filter->clean($command, 'cmd'); } // Check for a controller.task command. if (strpos($command, '.') !== false) { // Explode the controller.task command. list ($type, $task) = explode('.', $command); // Define the controller filename and path. $file = self::createFileName('controller', array('name' => $type, 'format' => $format)); $path = $basePath . '/controllers/' . $file; $backuppath = $basePath . '/controller/' . $file; // Reset the task without the controller context. $input->set('task', $task); } else { // Base controller. $type = null; // Define the controller filename and path. $file = self::createFileName('controller', array('name' => 'controller', 'format' => $format)); $path = $basePath . '/' . $file; $backupfile = self::createFileName('controller', array('name' => 'controller')); $backuppath = $basePath . '/' . $backupfile; } // Get the controller class name. $class = ucfirst($prefix) . 'Controller' . ucfirst($type); // Include the class if not present. if (!class_exists($class)) { // If the controller file path exists, include it. if (file_exists($path)) { require_once $path; } elseif (isset($backuppath) && file_exists($backuppath)) { require_once $backuppath; } else { throw new \InvalidArgumentException(\JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $type, $format)); } } // Instantiate the class. if (!class_exists($class)) { throw new \InvalidArgumentException(\JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER_CLASS', $class)); } // Instantiate the class, store it to the static container, and return it return self::$instance = new $class($config); } /** * Constructor. * * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'default_task', 'model_path', and * 'view_path' (this list is not meant to be comprehensive). * @param MVCFactoryInterface $factory The factory. * * @since 3.0 */ public function __construct($config = array(), MVCFactoryInterface $factory = null) { $this->methods = array(); $this->message = null; $this->messageType = 'message'; $this->paths = array(); $this->redirect = null; $this->taskMap = array(); if (defined('JDEBUG') && JDEBUG) { \JLog::addLogger(array('text_file' => 'jcontroller.log.php'), \JLog::ALL, array('controller')); } $this->input = \JFactory::getApplication()->input; // Determine the methods to exclude from the base class. $xMethods = get_class_methods('\JControllerLegacy'); // Get the public methods in this class using reflection. $r = new \ReflectionClass($this); $rMethods = $r->getMethods(\ReflectionMethod::IS_PUBLIC); foreach ($rMethods as $rMethod) { $mName = $rMethod->getName(); // Add default display method if not explicitly declared. if ($mName === 'display' || !in_array($mName, $xMethods)) { $this->methods[] = strtolower($mName); // Auto register the methods as tasks. $this->taskMap[strtolower($mName)] = $mName; } } // Set the view name if (empty($this->name)) { if (array_key_exists('name', $config)) { $this->name = $config['name']; } else { $this->name = $this->getName(); } } // Set a base path for use by the controller if (array_key_exists('base_path', $config)) { $this->basePath = $config['base_path']; } else { $this->basePath = JPATH_COMPONENT; } // If the default task is set, register it as such if (array_key_exists('default_task', $config)) { $this->registerDefaultTask($config['default_task']); } else { $this->registerDefaultTask('display'); } // Set the models prefix if (empty($this->model_prefix)) { if (array_key_exists('model_prefix', $config)) { // User-defined prefix $this->model_prefix = $config['model_prefix']; } else { $this->model_prefix = ucfirst($this->name) . 'Model'; } } // Set the default model search path if (array_key_exists('model_path', $config)) { // User-defined dirs $this->addModelPath($config['model_path'], $this->model_prefix); } else { $this->addModelPath($this->basePath . '/models', $this->model_prefix); } // Set the default view search path if (array_key_exists('view_path', $config)) { // User-defined dirs $this->setPath('view', $config['view_path']); } else { $this->setPath('view', $this->basePath . '/views'); } // Set the default view. if (array_key_exists('default_view', $config)) { $this->default_view = $config['default_view']; } elseif (empty($this->default_view)) { $this->default_view = $this->getName(); } $this->factory = $factory ? : new LegacyFactory; } /** * Adds to the search path for templates and resources. * * @param string $type The path type (e.g. 'model', 'view'). * @param mixed $path The directory string or stream array to search. * * @return \JControllerLegacy A \JControllerLegacy object to support chaining. * * @since 3.0 */ protected function addPath($type, $path) { if (!isset($this->paths[$type])) { $this->paths[$type] = array(); } // Loop through the path directories foreach ((array) $path as $dir) { // No surrounding spaces allowed! $dir = rtrim(\JPath::check($dir), '/') . '/'; // Add to the top of the search dirs array_unshift($this->paths[$type], $dir); } return $this; } /** * Add one or more view paths to the controller's stack, in LIFO order. * * @param mixed $path The directory (string) or list of directories (array) to add. * * @return \JControllerLegacy This object to support chaining. * * @since 3.0 */ public function addViewPath($path) { return $this->addPath('view', $path); } /** * Authorisation check * * @param string $task The ACO Section Value to check access on. * * @return boolean True if authorised * * @since 3.0 * @deprecated 3.0 Use \JAccess instead. */ public function authorise($task) { \JLog::add(__METHOD__ . ' is deprecated. Use \JAccess instead.', \JLog::WARNING, 'deprecated'); return true; } /** * Method to check whether an ID is in the edit list. * * @param string $context The context for the session storage. * @param integer $id The ID of the record to add to the edit list. * * @return boolean True if the ID is in the edit list. * * @since 3.0 */ protected function checkEditId($context, $id) { if ($id) { $values = (array) \JFactory::getApplication()->getUserState($context . '.id'); $result = in_array((int) $id, $values); if (defined('JDEBUG') && JDEBUG) { \JLog::add( sprintf( 'Checking edit ID %s.%s: %d %s', $context, $id, (int) $result, str_replace("\n", ' ', print_r($values, 1)) ), \JLog::INFO, 'controller' ); } return $result; } // No id for a new item. return true; } /** * Method to load and return a model object. * * @param string $name The name of the model. * @param string $prefix Optional model prefix. * @param array $config Configuration array for the model. Optional. * * @return \JModelLegacy|boolean Model object on success; otherwise false on failure. * * @since 3.0 */ protected function createModel($name, $prefix = '', $config = array()) { $model = $this->factory->createModel($name, $prefix, $config); if ($model === null) { return false; } return $model; } /** * Method to load and return a view object. This method first looks in the * current template directory for a match and, failing that, uses a default * set path to load the view class file. * * Note the "name, prefix, type" order of parameters, which differs from the * "name, type, prefix" order used in related public methods. * * @param string $name The name of the view. * @param string $prefix Optional prefix for the view class name. * @param string $type The type of view. * @param array $config Configuration array for the view. Optional. * * @return \JViewLegacy|null View object on success; null or error result on failure. * * @since 3.0 * @throws \Exception */ protected function createView($name, $prefix = '', $type = '', $config = array()) { $config['paths'] = $this->paths['view']; return $this->factory->createView($name, $prefix, $type, $config); } /** * Typical view method for MVC based architecture * * This function is provide as a default implementation, in most cases * you will need to override it in your own controllers. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}. * * @return \JControllerLegacy A \JControllerLegacy object to support chaining. * * @since 3.0 */ public function display($cachable = false, $urlparams = array()) { $document = \JFactory::getDocument(); $viewType = $document->getType(); $viewName = $this->input->get('view', $this->default_view); $viewLayout = $this->input->get('layout', 'default', 'string'); $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout)); // Get/Create the model if ($model = $this->getModel($viewName)) { // Push the model into the view (as default) $view->setModel($model, true); } $view->document = $document; // Display the view if ($cachable && $viewType !== 'feed' && \JFactory::getConfig()->get('caching') >= 1) { $option = $this->input->get('option'); if (is_array($urlparams)) { $app = \JFactory::getApplication(); if (!empty($app->registeredurlparams)) { $registeredurlparams = $app->registeredurlparams; } else { $registeredurlparams = new \stdClass; } foreach ($urlparams as $key => $value) { // Add your safe URL parameters with variable type as value {@see \JFilterInput::clean()}. $registeredurlparams->$key = $value; } $app->registeredurlparams = $registeredurlparams; } try { /** @var \JCacheControllerView $cache */ $cache = \JFactory::getCache($option, 'view'); $cache->get($view, 'display'); } catch (\JCacheException $exception) { $view->display(); } } else { $view->display(); } return $this; } /** * Execute a task by triggering a method in the derived class. * * @param string $task The task to perform. If no matching task is found, the '__default' task is executed, if defined. * * @return mixed The value returned by the called method. * * @since 3.0 * @throws \Exception */ public function execute($task) { $this->task = $task; $task = strtolower($task); if (isset($this->taskMap[$task])) { $doTask = $this->taskMap[$task]; } elseif (isset($this->taskMap['__default'])) { $doTask = $this->taskMap['__default']; } else { throw new \Exception(\JText::sprintf('JLIB_APPLICATION_ERROR_TASK_NOT_FOUND', $task), 404); } // Record the actual task being fired $this->doTask = $doTask; return $this->$doTask(); } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return \JModelLegacy|boolean Model object on success; otherwise false on failure. * * @since 3.0 */ public function getModel($name = '', $prefix = '', $config = array()) { if (empty($name)) { $name = $this->getName(); } if (empty($prefix)) { $prefix = $this->model_prefix; } if ($model = $this->createModel($name, $prefix, $config)) { // Task is a reserved state $model->setState('task', $this->task); // Let's get the application object and set menu information if it's available $menu = \JFactory::getApplication()->getMenu(); if (is_object($menu) && $item = $menu->getActive()) { $params = $menu->getParams($item->id); // Set default state data $model->setState('parameters.menu', $params); } } return $model; } /** * Method to get the controller name * * The dispatcher name is set by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the dispatcher * * @since 3.0 * @throws \Exception */ public function getName() { if (empty($this->name)) { $r = null; if (!preg_match('/(.*)Controller/i', get_class($this), $r)) { throw new \Exception(\JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->name = strtolower($r[1]); } return $this->name; } /** * Get the last task that is being performed or was most recently performed. * * @return string The task that is being performed or was most recently performed. * * @since 3.0 */ public function getTask() { return $this->task; } /** * Gets the available tasks in the controller. * * @return array Array[i] of task names. * * @since 3.0 */ public function getTasks() { return $this->methods; } /** * Method to get a reference to the current view and load it if necessary. * * @param string $name The view name. Optional, defaults to the controller name. * @param string $type The view type. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for view. Optional. * * @return \JViewLegacy Reference to the view or an error. * * @since 3.0 * @throws \Exception */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { // @note We use self so we only access stuff in this class rather than in all classes. if (!isset(self::$views)) { self::$views = array(); } if (empty($name)) { $name = $this->getName(); } if (empty($prefix)) { $prefix = $this->getName() . 'View'; } if (empty(self::$views[$name][$type][$prefix])) { if ($view = $this->createView($name, $prefix, $type, $config)) { self::$views[$name][$type][$prefix] = & $view; } else { throw new \Exception(\JText::sprintf('JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND', $name, $type, $prefix), 404); } } return self::$views[$name][$type][$prefix]; } /** * Method to add a record ID to the edit list. * * @param string $context The context for the session storage. * @param integer $id The ID of the record to add to the edit list. * * @return void * * @since 3.0 */ protected function holdEditId($context, $id) { $app = \JFactory::getApplication(); $values = (array) $app->getUserState($context . '.id'); // Add the id to the list if non-zero. if (!empty($id)) { $values[] = (int) $id; $values = array_unique($values); $app->setUserState($context . '.id', $values); if (defined('JDEBUG') && JDEBUG) { \JLog::add( sprintf( 'Holding edit ID %s.%s %s', $context, $id, str_replace("\n", ' ', print_r($values, 1)) ), \JLog::INFO, 'controller' ); } } } /** * Redirects the browser or returns false if no redirect is set. * * @return boolean False if no redirect exists. * * @since 3.0 */ public function redirect() { if ($this->redirect) { $app = \JFactory::getApplication(); // Enqueue the redirect message $app->enqueueMessage($this->message, $this->messageType); // Execute the redirect $app->redirect($this->redirect); } return false; } /** * Register the default task to perform if a mapping is not found. * * @param string $method The name of the method in the derived class to perform if a named task is not found. * * @return \JControllerLegacy A \JControllerLegacy object to support chaining. * * @since 3.0 */ public function registerDefaultTask($method) { $this->registerTask('__default', $method); return $this; } /** * Register (map) a task to a method in the class. * * @param string $task The task. * @param string $method The name of the method in the derived class to perform for this task. * * @return \JControllerLegacy A \JControllerLegacy object to support chaining. * * @since 3.0 */ public function registerTask($task, $method) { if (in_array(strtolower($method), $this->methods)) { $this->taskMap[strtolower($task)] = $method; } return $this; } /** * Unregister (unmap) a task in the class. * * @param string $task The task. * * @return \JControllerLegacy This object to support chaining. * * @since 3.0 */ public function unregisterTask($task) { unset($this->taskMap[strtolower($task)]); return $this; } /** * Method to check whether an ID is in the edit list. * * @param string $context The context for the session storage. * @param integer $id The ID of the record to add to the edit list. * * @return void * * @since 3.0 */ protected function releaseEditId($context, $id) { $app = \JFactory::getApplication(); $values = (array) $app->getUserState($context . '.id'); // Do a strict search of the edit list values. $index = array_search((int) $id, $values, true); if (is_int($index)) { unset($values[$index]); $app->setUserState($context . '.id', $values); if (defined('JDEBUG') && JDEBUG) { \JLog::add( sprintf( 'Releasing edit ID %s.%s %s', $context, $id, str_replace("\n", ' ', print_r($values, 1)) ), \JLog::INFO, 'controller' ); } } } /** * Sets the internal message that is passed with a redirect * * @param string $text Message to display on redirect. * @param string $type Message type. Optional, defaults to 'message'. * * @return string Previous message * * @since 3.0 */ public function setMessage($text, $type = 'message') { $previous = $this->message; $this->message = $text; $this->messageType = $type; return $previous; } /** * Sets an entire array of search paths for resources. * * @param string $type The type of path to set, typically 'view' or 'model'. * @param string $path The new set of search paths. If null or false, resets to the current directory only. * * @return void * * @since 3.0 */ protected function setPath($type, $path) { // Clear out the prior search dirs $this->paths[$type] = array(); // Actually add the user-specified directories $this->addPath($type, $path); } /** * Checks for a form token in the request. * * Use in conjunction with \JHtml::_('form.token') or \JSession::getFormToken. * * @param string $method The request method in which to look for the token key. * @param boolean $redirect Whether to implicitly redirect user to the referrer page on failure or simply return false. * * @return boolean True if found and valid, otherwise return false or redirect to referrer page. * * @since 3.7.0 * @see \JSession::checkToken() */ public function checkToken($method = 'post', $redirect = true) { $valid = \JSession::checkToken($method); if (!$valid && $redirect) { $referrer = $this->input->server->getString('HTTP_REFERER'); if (!\JUri::isInternal($referrer)) { $referrer = 'index.php'; } $app = \JFactory::getApplication(); $app->enqueueMessage(\JText::_('JINVALID_TOKEN_NOTICE'), 'warning'); $app->redirect($referrer); } return $valid; } /** * Set a URL for browser redirection. * * @param string $url URL to redirect to. * @param string $msg Message to display on redirect. Optional, defaults to value set internally by controller, if any. * @param string $type Message type. Optional, defaults to 'message' or the type set by a previous call to setMessage. * * @return \JControllerLegacy This object to support chaining. * * @since 3.0 */ public function setRedirect($url, $msg = null, $type = null) { $this->redirect = $url; if ($msg !== null) { // Controller may have set this directly $this->message = $msg; } // Ensure the type is not overwritten by a previous call to setMessage. if (empty($type)) { if (empty($this->messageType)) { $this->messageType = 'message'; } } // If the type is explicitly set, set it. else { $this->messageType = $type; } return $this; } }
zero-24/joomla-cms
libraries/src/MVC/Controller/BaseController.php
PHP
gpl-2.0
25,672
#include "sysconfig.h" #include <stdlib.h> #include <stdarg.h> #include "sysdeps.h" #include "uaeipc.h" #include "options.h" #include "zfile.h" #include "inputdevice.h" #include <windows.h> #define IPC_BUFFER_SIZE 16384 #define MAX_OUTMESSAGES 30 #define MAX_BINMESSAGE 32 struct uaeipc { HANDLE hipc, olevent; OVERLAPPED ol; uae_u8 buffer[IPC_BUFFER_SIZE], outbuf[IPC_BUFFER_SIZE]; int connected, readpending, writepending; int binary; TCHAR *outmsg[MAX_OUTMESSAGES]; int outmessages; uae_u8 outbin[MAX_OUTMESSAGES][MAX_BINMESSAGE]; int outbinlen[MAX_OUTMESSAGES]; }; static void parsemessage(TCHAR *in, struct uae_prefs *p, TCHAR *out, int outsize) { out[0] = 0; if (!_tcsncmp (in, _T("CFG "), 4) || !_tcsncmp (in, _T("EVT "), 4)) { TCHAR tmpout[256]; int index = -1; int cnt = 0; in += 4; for (;;) { int ret; tmpout[0] = 0; ret = cfgfile_modify (index, in, _tcslen (in), tmpout, sizeof (tmpout) * sizeof (TCHAR)); index++; if (_tcslen (tmpout) > 0) { if (_tcslen (out) == 0) _tcscat (out, _T("200 ")); _tcsncat (out, _T("\n"), outsize); _tcsncat (out, tmpout, outsize); } cnt++; if (ret >= 0) break; } if (_tcslen (out) == 0) _tcscat (out, _T("404")); } else { _tcscpy (out, _T("501")); } } static int listenIPC (void *vipc) { struct uaeipc *ipc = (struct uaeipc*)vipc; DWORD err; memset(&ipc->ol, 0, sizeof (OVERLAPPED)); ipc->ol.hEvent = ipc->olevent; if (ConnectNamedPipe(ipc->hipc, &ipc->ol)) { write_log (_T("IPC: ConnectNamedPipe init failed, err=%d\n"), GetLastError()); closeIPC(ipc); return 0; } err = GetLastError(); if (err == ERROR_PIPE_CONNECTED) { if (SetEvent(ipc->olevent)) { write_log (_T("IPC: ConnectNamedPipe SetEvent failed, err=%d\n"), GetLastError()); closeIPC(ipc); return 0; } } else if (err != ERROR_IO_PENDING) { write_log (_T("IPC: ConnectNamedPipe failed, err=%d\n"), err); closeIPC(ipc); return 0; } return 1; } static void disconnectIPC (void *vipc) { struct uaeipc *ipc = (struct uaeipc*)vipc; ipc->readpending = ipc->writepending = FALSE; if (ipc->connected) { if (!DisconnectNamedPipe(ipc->hipc)) write_log (_T("IPC: DisconnectNamedPipe failed, err=%d\n"), GetLastError()); ipc->connected = FALSE; } } static void resetIPC (void *vipc) { struct uaeipc *ipc = (struct uaeipc*)vipc; disconnectIPC (ipc); listenIPC (ipc); } void closeIPC (void *vipc) { struct uaeipc *ipc = (struct uaeipc*)vipc; if (!ipc) return; disconnectIPC (ipc); if (ipc->hipc == INVALID_HANDLE_VALUE) return; CloseHandle (ipc->hipc); ipc->hipc = INVALID_HANDLE_VALUE; if (ipc->olevent != INVALID_HANDLE_VALUE) CloseHandle (ipc->olevent); ipc->olevent = INVALID_HANDLE_VALUE; xfree (ipc); } void *createIPC (const TCHAR *name, int binary) { TCHAR tmpname[100]; int cnt = 0; struct uaeipc *ipc; ipc = xcalloc (struct uaeipc, 1); ipc->connected = FALSE; ipc->readpending = FALSE; ipc->writepending = FALSE; ipc->olevent = INVALID_HANDLE_VALUE; ipc->binary = 1; while (cnt < 10) { _stprintf (tmpname, _T("\\\\.\\pipe\\%s"), name); if (cnt > 0) { TCHAR *p = tmpname + _tcslen (tmpname); _stprintf (p, _T("_%d"), cnt); } ipc->hipc = CreateNamedPipe (tmpname, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, 1, IPC_BUFFER_SIZE, IPC_BUFFER_SIZE, NMPWAIT_USE_DEFAULT_WAIT, NULL); if (ipc->hipc == INVALID_HANDLE_VALUE) { DWORD err = GetLastError (); if (err == ERROR_ALREADY_EXISTS || err == ERROR_PIPE_BUSY) { cnt++; continue; } return 0; } break; } write_log (_T("IPC: Named Pipe '%s' open\n"), tmpname); ipc->olevent = CreateEvent(NULL, TRUE, TRUE, NULL); if (listenIPC(ipc)) return ipc; closeIPC(ipc); return NULL; } void *geteventhandleIPC (void *vipc) { struct uaeipc *ipc = (struct uaeipc*)vipc; if (!ipc) return INVALID_HANDLE_VALUE; return ipc->olevent; } int sendIPC (void *vipc, TCHAR *msg) { struct uaeipc *ipc = (struct uaeipc*)vipc; if (ipc->hipc == INVALID_HANDLE_VALUE) return 0; if (ipc->outmessages >= MAX_OUTMESSAGES) return 0; ipc->outmsg[ipc->outmessages++] = my_strdup (msg); if (!ipc->readpending && !ipc->writepending) SetEvent (ipc->olevent); return 1; } int sendBinIPC (void *vipc, uae_u8 *msg, int len) { struct uaeipc *ipc = (struct uaeipc*)vipc; if (ipc->hipc == INVALID_HANDLE_VALUE) return 0; if (ipc->outmessages >= MAX_OUTMESSAGES) return 0; ipc->outbinlen[ipc->outmessages] = len; memcpy (&ipc->outbin[ipc->outmessages++][0], msg, len); if (!ipc->readpending && !ipc->writepending) SetEvent (ipc->olevent); return 1; } int checkIPC (void *vipc, struct uae_prefs *p) { struct uaeipc *ipc = (struct uaeipc*)vipc; BOOL ok; DWORD ret, err; if (!ipc) return 0; if (ipc->hipc == INVALID_HANDLE_VALUE) return 0; if (WaitForSingleObject(ipc->olevent, 0) != WAIT_OBJECT_0) return 0; if (!ipc->readpending && !ipc->writepending && ipc->outmessages > 0) { memset (&ipc->ol, 0, sizeof (OVERLAPPED)); ipc->ol.hEvent = ipc->olevent; if (ipc->binary) { ok = WriteFile (ipc->hipc, &ipc->outbin[ipc->outmessages][0], ipc->outbinlen[ipc->outmessages], &ret, &ipc->ol); } else { ok = WriteFile (ipc->hipc, ipc->outmsg[ipc->outmessages], (_tcslen (ipc->outmsg[ipc->outmessages]) + 1) * sizeof (TCHAR), &ret, &ipc->ol); } xfree (ipc->outmsg[ipc->outmessages--]); err = GetLastError (); if (!ok && err != ERROR_IO_PENDING) { write_log (_T("IPC: WriteFile() err=%d\n"), err); resetIPC (ipc); return 0; } ipc->writepending = TRUE; return 1; } if (ipc->readpending || ipc->writepending) { ok = GetOverlappedResult (ipc->hipc, &ipc->ol, &ret, FALSE); if (!ok) { err = GetLastError (); if (err == ERROR_IO_INCOMPLETE) return 0; write_log (_T("IPC: GetOverlappedResult error %d\n"), err); resetIPC (ipc); return 0; } if (!ipc->connected) { write_log (_T("IPC: Pipe connected\n")); ipc->connected = TRUE; return 0; } if (ipc->writepending) { ipc->writepending = FALSE; SetEvent (ipc->ol.hEvent); memset (&ipc->ol, 0, sizeof (OVERLAPPED)); ipc->ol.hEvent = ipc->olevent; return 0; } } if (!ipc->readpending) { ok = ReadFile (ipc->hipc, ipc->buffer, IPC_BUFFER_SIZE, &ret, &ipc->ol); err = GetLastError (); if (!ok) { if (err == ERROR_IO_PENDING) { ipc->readpending = TRUE; return 0; } else if (err == ERROR_BROKEN_PIPE) { write_log (_T("IPC: IPC client disconnected\n")); } else { write_log (_T("IPC: ReadFile() err=%d\n"), err); } resetIPC (ipc); return 0; } } ipc->readpending = FALSE; if (ipc->binary) { } else { write_log (_T("IPC: got message '%s'\n"), ipc->buffer); parsemessage ((TCHAR*)ipc->buffer, p, (TCHAR*)ipc->outbuf, sizeof ipc->outbuf); memset (&ipc->ol, 0, sizeof (OVERLAPPED)); ipc->ol.hEvent = ipc->olevent; ok = WriteFile (ipc->hipc, ipc->outbuf, strlen ((char*)ipc->outbuf) + 1, &ret, &ipc->ol); err = GetLastError (); if (!ok && err != ERROR_IO_PENDING) { write_log (_T("IPC: WriteFile() err=%d\n"), err); resetIPC (ipc); return 0; } ipc->writepending = TRUE; } return 1; } int isIPC (const TCHAR *pipename) { HANDLE p; p = CreateFile( pipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (p == INVALID_HANDLE_VALUE) return 0; CloseHandle (p); return 1; }
samuelbernardo/AVExe-FSUAE
src/uaeipc.cpp
C++
gpl-2.0
7,443
/* * sound\soc\sunxi\spdif\sunxi_spdma.c * (C) Copyright 2010-2016 * Reuuimlla Technology Co., Ltd. <www.reuuimllatech.com> * chenpailin <[email protected]> * * some simple description for this code * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * */ #include <linux/module.h> #include <linux/init.h> #include <linux/io.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/dma-mapping.h> #include <linux/dma/sunxi-dma.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> #include <asm/dma.h> #include <mach/hardware.h> #include <sound/dmaengine_pcm.h> #include "sunxi_spdif.h" #include "sunxi_spdma.h" static const struct snd_pcm_hardware sunxi_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, .formats = SNDRV_PCM_FMTBIT_S16_LE, .rates = SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATE_KNOT, .rate_min = 8000, .rate_max = 192000, .channels_min = 1, .channels_max = 4, .buffer_bytes_max = 128*1024, /* value must be (2^n)Kbyte size */ .period_bytes_min = 1024, .period_bytes_max = 1024*32, .periods_min = 1, .periods_max = 8, .fifo_size = 32, }; static int sunxi_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct device *dev = rtd->platform->dev; struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); struct sunxi_dma_params *dmap; struct dma_slave_config slave_config; int ret; dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); ret = snd_hwparams_to_dma_slave_config(substream, params, &slave_config); if (ret) { dev_err(dev, "hw params config failed with err %d\n", ret); return ret; } if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; slave_config.dst_addr = dmap->dma_addr; slave_config.src_maxburst = 2; slave_config.dst_maxburst = 2; slave_config.slave_id = sunxi_slave_id(DRQDST_SPDIFRX, DRQSRC_SDRAM); } else { slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; slave_config.src_addr = dmap->dma_addr; slave_config.src_maxburst = 2; slave_config.dst_maxburst = 2; slave_config.slave_id = sunxi_slave_id(DRQDST_SDRAM, DRQSRC_SPDIFRX); } ret = dmaengine_slave_config(chan, &slave_config); if (ret < 0) { dev_err(dev, "dma slave config failed with err %d\n", ret); return ret; } snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); return 0; } static int sunxi_pcm_hw_free(struct snd_pcm_substream *substream) { snd_pcm_set_runtime_buffer(substream, NULL); return 0; } static int sunxi_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: return snd_dmaengine_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START); case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: return snd_dmaengine_pcm_trigger(substream, SNDRV_PCM_TRIGGER_STOP); default: return -EINVAL; } } static int sunxi_pcm_open(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct device *dev = rtd->platform->dev; int ret = 0; /* Set HW params now that initialization is complete */ snd_soc_set_runtime_hwparams(substream, &sunxi_pcm_hardware); ret = snd_dmaengine_pcm_open(substream, NULL, NULL); if (ret) { dev_err(dev, "dmaengine pcm open failed with err %d\n", ret); return ret; } return 0; } static int sunxi_pcm_close(struct snd_pcm_substream *substream) { snd_dmaengine_pcm_close(substream); return 0; } static int sunxi_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma) { struct snd_pcm_runtime *play_runtime = NULL; struct snd_pcm_runtime *capture_runtime = NULL; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { play_runtime = substream->runtime; return dma_mmap_writecombine(substream->pcm->card->dev, vma, play_runtime->dma_area, play_runtime->dma_addr, play_runtime->dma_bytes); } else { capture_runtime = substream->runtime; return dma_mmap_writecombine(substream->pcm->card->dev, vma, play_runtime->dma_area, play_runtime->dma_addr, play_runtime->dma_bytes); } } static struct snd_pcm_ops sunxi_pcm_ops = { .open = sunxi_pcm_open, .close = sunxi_pcm_close, .ioctl = snd_pcm_lib_ioctl, .hw_params = sunxi_pcm_hw_params, .hw_free = sunxi_pcm_hw_free, .trigger = sunxi_pcm_trigger, .pointer = snd_dmaengine_pcm_pointer, .mmap = sunxi_pcm_mmap, }; static int sunxi_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) { struct snd_pcm_substream *substream = pcm->streams[stream].substream; struct snd_dma_buffer *buf = &substream->dma_buffer; size_t size = 0; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { size = sunxi_pcm_hardware.buffer_bytes_max; } else { size = sunxi_pcm_hardware.buffer_bytes_max; } buf->dev.type = SNDRV_DMA_TYPE_DEV; buf->dev.dev = pcm->card->dev; buf->private_data = NULL; buf->area = dma_alloc_writecombine(pcm->card->dev, size, &buf->addr, GFP_KERNEL); if (!buf->area) return -ENOMEM; buf->bytes = size; return 0; } static void sunxi_pcm_free_dma_buffers(struct snd_pcm *pcm) { struct snd_pcm_substream *substream; struct snd_dma_buffer *buf; int stream; for (stream = 0; stream < 2; stream++) { substream = pcm->streams[stream].substream; if (!substream) continue; buf = &substream->dma_buffer; if (!buf->area) continue; dma_free_writecombine(pcm->card->dev, buf->bytes, buf->area, buf->addr); buf->area = NULL; } } static u64 sunxi_pcm_mask = DMA_BIT_MASK(32); static int sunxi_pcm_new(struct snd_soc_pcm_runtime *rtd) { struct snd_card *card = rtd->card->snd_card; struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) card->dev->dma_mask = &sunxi_pcm_mask; if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask = 0xffffffff; if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { ret = sunxi_pcm_preallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_PLAYBACK); if (ret) goto out; } if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { ret = sunxi_pcm_preallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_CAPTURE); if (ret) goto out; } out: return ret; } static struct snd_soc_platform_driver sunxi_soc_platform = { .ops = &sunxi_pcm_ops, .pcm_new = sunxi_pcm_new, .pcm_free = sunxi_pcm_free_dma_buffers, }; static int __init sunxi_spdif_pcm_probe(struct platform_device *pdev) { return snd_soc_register_platform(&pdev->dev, &sunxi_soc_platform); } static int __exit sunxi_spdif_pcm_remove(struct platform_device *pdev) { snd_soc_unregister_platform(&pdev->dev); return 0; } /*data relating*/ static struct platform_device sunxi_spdif_pcm_device = { .name = "sunxi-spdif-pcm-audio", }; /*method relating*/ static struct platform_driver sunxi_spdif_pcm_driver = { .probe = sunxi_spdif_pcm_probe, .remove = __exit_p(sunxi_spdif_pcm_remove), .driver = { .name = "sunxi-spdif-pcm-audio", .owner = THIS_MODULE, }, }; static int __init sunxi_soc_platform_spdif_init(void) { int err = 0; if((err = platform_device_register(&sunxi_spdif_pcm_device)) < 0) return err; if ((err = platform_driver_register(&sunxi_spdif_pcm_driver)) < 0) return err; return 0; } module_init(sunxi_soc_platform_spdif_init); static void __exit sunxi_soc_platform_spdif_exit(void) { return platform_driver_unregister(&sunxi_spdif_pcm_driver); } module_exit(sunxi_soc_platform_spdif_exit); MODULE_AUTHOR("All winner"); MODULE_DESCRIPTION("SUNXI SPDIF DMA module"); MODULE_LICENSE("GPL");
EPDCenter/android_kernel_allwinner_a33
sound/soc/sunxi/spdif/sunxi_spdma.c
C
gpl-2.0
8,180
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include <sys/types.h> #include "macro.h" #include "stdio-util.h" #include "string-util.h" #define SYS_BLOCK_PATH_MAX(suffix) \ (STRLEN("/sys/dev/block/") + DECIMAL_STR_MAX(dev_t) + 1 + DECIMAL_STR_MAX(dev_t) + strlen_ptr(suffix)) #define xsprintf_sys_block_path(buf, suffix, devno) \ xsprintf(buf, "/sys/dev/block/%u:%u%s", major(devno), minor(devno), strempty(suffix)) int block_get_whole_disk(dev_t d, dev_t *ret); int block_get_originating(dev_t d, dev_t *ret); int get_block_device(const char *path, dev_t *dev); int get_block_device_harder(const char *path, dev_t *dev); int lock_whole_block_device(dev_t devt, int operation); int blockdev_partscan_enabled(int fd);
phomes/systemd
src/basic/blockdev-util.h
C
gpl-2.0
815
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 Reko.WindowsItp { public partial class ByteMapDialog : Form { public ByteMapDialog() { InitializeComponent(); } } }
nemerle/reko
src/WindowsItp/ByteMapDialog.cs
C#
gpl-2.0
362
PM.Views.Root = Backbone.View.extend({ el: $('.main-container'), initialize: function() { this.template = $('#wpvpm-menu-root').html(); _.bindAll(this, 'render'); this.listenTo( this.model, 'change', this.render ); this.render(); }, render: function() { var content = new PM.Views.Item({ model: new PM.Models.Item(this.model.toJSON()) }).render(); var scroller = $('<div></div>').addClass('mp-scroller').attr('id', 'mp-scroller'), pusher = $('<div></div>').addClass('mp-pusher').attr('id', 'mp-pusher'); $(this.el) .wrap(pusher) .before( _.template(this.template)({ content: content }) ); $(this.el).wrap(scroller); } }); PM.Views.Item = Backbone.View.extend({ initialize: function() { this.template = $('#wpvpm-menu-item').html(); _.bindAll(this, 'render'); }, render: function() { var content = ''; _(this.model.get('children')).each(function(child) { var child_view = new PM.Views.Item({ model: new PM.Models.Item(child) }); content += child_view.render(); }); return _.template(this.template)( _.extend(this.model.toJSON(), { content: content }) ); } }); $(function() { if('WpvPushMenu' in window && WpvPushMenu.items) { new PM.Views.Root({ model: new PM.Models.Root(WpvPushMenu.items) }); var trigger = $( '#mp-menu-trigger' ); if(trigger) { new MlPushMenu( document.getElementById( 'mp-menu' ), trigger, {} ); if('WPVQuickTap' in window) { // new WPVQuickTap( $('#mp-menu .mp-back, #mp-menu .has-children, #mp-menu-trigger') ); } } } });
haidenmcgrath/zoo-sport
wp-content/plugins/vamtam-push-menu/js/views.js
JavaScript
gpl-2.0
1,562
#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "B0A22A9650B993B08951D2E9E1FAA8ED" //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Diagnostics; using System.Windows; using System.Windows.Automation; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Effects; using System.Windows.Media.Imaging; using System.Windows.Media.Media3D; using System.Windows.Media.TextFormatting; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Shell; using WpfModernFlatSampleApp; namespace WpfModernFlatSampleApp { /// <summary> /// App /// </summary> public partial class App : System.Windows.Application { private bool _contentLoaded; /// <summary> /// InitializeComponent /// </summary> [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; #line 5 "..\..\..\App.xaml" this.StartupUri = new System.Uri("FlatBrowserPOC.xaml", System.UriKind.Relative); #line default #line hidden System.Uri resourceLocater = new System.Uri("/WpfModernFlatSampleApp;component/app.xaml", System.UriKind.Relative); #line 1 "..\..\..\App.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); #line default #line hidden } /// <summary> /// Application Entry Point. /// </summary> [System.STAThreadAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public static void Main() { WpfModernFlatSampleApp.App app = new WpfModernFlatSampleApp.App(); app.InitializeComponent(); app.Run(); } } }
UniversalFuture/wpf-modern-flat
WpfModernFlat/WpfModernFlatSampleApp/obj/x86/x64/App.g.i.cs
C#
gpl-2.0
2,775
int arch_hack(const char *cmd) { /* TODO */ }
halfbro/radare
src/dbg/arch/powerpc-hack.c
C
gpl-2.0
47
; ( -- usersize ) ; Environment ; size of the USER area in bytes VE_ENVUSERSIZE: .dw $ff05 .db "/user",0 .dw VE_ENVHEAD .set VE_ENVHEAD = VE_ENVUSERSIZE XT_ENVUSERSIZE: .dw DO_COLON PFA_ENVUSERSIZE: .dw XT_DOLITERAL .dw SYSUSERSIZE + APPUSERSIZE .dw XT_EXIT
hickey/amforth
core/words/env-usersize.asm
Assembly
gpl-2.0
291
/* * Copyright (C) 2004 Matthew Wilcox <[email protected]> * Copyright (C) 2004 Intel Corp. * * This code is released under the GNU General Public License version 2. */ /* * mmconfig.c - Low-level direct PCI config space access via MMCONFIG */ #include <linux/pci.h> #include <linux/init.h> #include <linux/acpi.h> #include "pci.h" #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) /* The base address of the last MMCONFIG device accessed */ static u32 mmcfg_last_accessed_device; /* * Functions for accessing PCI configuration space with MMCONFIG accesses */ static u32 get_base_addr(unsigned int seg, int bus) { int cfg_num = -1; struct acpi_table_mcfg_config *cfg; while (1) { ++cfg_num; if (cfg_num >= pci_mmcfg_config_num) { /* something bad is going on, no cfg table is found. */ /* so we fall back to the old way we used to do this */ /* and just rely on the first entry to be correct. */ return pci_mmcfg_config[0].base_address; } cfg = &pci_mmcfg_config[cfg_num]; if (cfg->pci_segment_group_number != seg) continue; if ((cfg->start_bus_number <= bus) && (cfg->end_bus_number >= bus)) return cfg->base_address; } } static inline void pci_exp_set_dev_base(unsigned int seg, int bus, int devfn) { u32 dev_base = get_base_addr(seg, bus) | (bus << 20) | (devfn << 12); if (dev_base != mmcfg_last_accessed_device) { mmcfg_last_accessed_device = dev_base; set_fixmap_nocache(FIX_PCIE_MCFG, dev_base); } } static int pci_mmcfg_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { unsigned long flags; if (!value || (bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; spin_lock_irqsave(&pci_config_lock, flags); pci_exp_set_dev_base(seg, bus, devfn); switch (len) { case 1: *value = readb(mmcfg_virt_addr + reg); break; case 2: *value = readw(mmcfg_virt_addr + reg); break; case 4: *value = readl(mmcfg_virt_addr + reg); break; } spin_unlock_irqrestore(&pci_config_lock, flags); return 0; } static int pci_mmcfg_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { unsigned long flags; if ((bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; spin_lock_irqsave(&pci_config_lock, flags); pci_exp_set_dev_base(seg, bus, devfn); switch (len) { case 1: writeb(value, mmcfg_virt_addr + reg); break; case 2: writew(value, mmcfg_virt_addr + reg); break; case 4: writel(value, mmcfg_virt_addr + reg); break; } spin_unlock_irqrestore(&pci_config_lock, flags); return 0; } static struct pci_raw_ops pci_mmcfg = { .read = pci_mmcfg_read, .write = pci_mmcfg_write, }; static int __init pci_mmcfg_init(void) { if ((pci_probe & PCI_PROBE_MMCONF) == 0) goto out; acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); if ((pci_mmcfg_config_num == 0) || (pci_mmcfg_config == NULL) || (pci_mmcfg_config[0].base_address == 0)) goto out; printk(KERN_INFO "PCI: Using MMCONFIG\n"); raw_pci_ops = &pci_mmcfg; pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; out: return 0; } arch_initcall(pci_mmcfg_init);
ipwndev/DSLinux-Mirror
linux-2.6.x/arch/i386/pci/mmconfig.c
C
gpl-2.0
3,175
<?php namespace Phalcon\Mvc\Dispatcher; /** * Phalcon\Mvc\Dispatcher\Exception * Exceptions thrown in Phalcon\Mvc\Dispatcher will use this class */ class Exception extends \Phalcon\Exception { }
mattm479/mafiakingz
vendor/phalcon/src/Phalcon/mvc/dispatcher/Exception.php
PHP
gpl-2.0
201
#ifndef __ASM_GENERIC_SOCKET_H #define __ASM_GENERIC_SOCKET_H #include <asm/sockios.h> /* For setsockopt(2) */ #define SOL_SOCKET 1 #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_SNDBUFFORCE 32 #define SO_RCVBUFFORCE 33 #define SO_KEEPALIVE 9 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_BSDCOMPAT 14 #define SO_REUSEPORT 15 #ifndef SO_PASSCRED /* powerpc only differs in these */ #define SO_PASSCRED 16 #define SO_PEERCRED 17 #define SO_RCVLOWAT 18 #define SO_SNDLOWAT 19 #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #endif /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 #define SO_BINDTODEVICE 25 /* Socket filtering */ #define SO_ATTACH_FILTER 26 #define SO_DETACH_FILTER 27 #define SO_GET_FILTER SO_ATTACH_FILTER #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_PASSSEC 34 #define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #define SO_MARK 36 #define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING #define SO_PROTOCOL 38 #define SO_DOMAIN 39 #define SO_RXQ_OVFL 40 #define SO_WIFI_STATUS 41 #define SCM_WIFI_STATUS SO_WIFI_STATUS #define SO_PEEK_OFF 42 /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define SO_NOFCS 43 #define SO_LOCK_FILTER 44 #define SO_SELECT_ERR_QUEUE 45 #define SO_BUSY_POLL 46 #define SO_BPF_EXTENSIONS 48 #endif /* __ASM_GENERIC_SOCKET_H */
cybernet/rhel7-kernel
kernel/include/uapi/asm-generic/socket.h
C
gpl-2.0
1,795
DROP FUNCTION IF EXISTS report.umsatzreport_report (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric); DROP FUNCTION IF EXISTS report.umsatzreport_report (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric, IN AD_Org_ID numeric); DROP TABLE IF EXISTS report.umsatzreport_report; DROP FUNCTION IF EXISTS report.Umsatzreport_Report_Sub (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric); DROP FUNCTION IF EXISTS report.Umsatzreport_Report_Sub (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric, IN AD_Org_ID numeric); DROP TABLE IF EXISTS report.Umsatzreport_Report_Sub; CREATE TABLE report.Umsatzreport_Report_Sub ( name character varying(60), periodend date, lastyearperiodend date, year character varying(10), lastyear character varying(10), sameperiodsum numeric, sameperiodlastyearsum numeric, perioddifference numeric, perioddiffpercentage numeric, sameyearsum numeric, lastyearsum numeric, yeardifference numeric, yeardiffpercentage numeric, attributesetinstance character varying(60), ad_org_id numeric ) WITH ( OIDS=FALSE ); CREATE FUNCTION report.Umsatzreport_Report_Sub(IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric, IN AD_Org_ID numeric) RETURNS SETOF report.Umsatzreport_Report_Sub AS $BODY$ SELECT CASE WHEN Length(name) <= 45 THEN name ELSE substring(name FOR 43 ) || '...' END AS name, PeriodEnd, LastYearPeriodEnd, Year, LastYear, SamePeriodSum AS SamePeriodSum, SamePeriodLastYearSum, SamePeriodSum - SamePeriodLastYearSum AS PeriodDifference, CASE WHEN SamePeriodSum - SamePeriodLastYearSum != 0 AND SamePeriodLastYearSum != 0 THEN (SamePeriodSum - SamePeriodLastYearSum) / SamePeriodLastYearSum * 100 ELSE NULL END AS PeriodDiffPercentage, SameYearSum AS SameYearSum, LastYearSum AS LastYearSum, SameYearSum - LastYearSum AS YearDifference, CASE WHEN SameYearSum - LastYearSum != 0 AND LastYearSum != 0 THEN (SameYearSum - LastYearSum) / LastYearSum * 100 ELSE NULL END AS YearDiffPercentage, Attributes as attributesetinstance, ad_org_id FROM ( SELECT bp.name, p.EndDate::Date AS PeriodEnd, pp.EndDate::Date AS LastYearPeriodEnd, y.fiscalYear AS Year, py.fiscalYear AS LastYear, SUM( CASE WHEN fa.C_Period_ID = p.C_Period_ID THEN AmtAcct ELSE 0 END ) AS SamePeriodSum, SUM( CASE WHEN fap.C_Year_ID = p.C_Year_ID AND fap.periodNo <= p.PeriodNo THEN AmtAcct ELSE 0 END ) AS SameYearSum, SUM( CASE WHEN fa.C_Period_ID = pp.C_Period_ID THEN AmtAcct ELSE 0 END ) AS SamePeriodLastYearSum, SUM( CASE WHEN fap.C_Year_ID = pp.C_Year_ID AND fap.periodNo <= pp.PeriodNo THEN AmtAcct ELSE 0 END ) AS LastYearSum, att.Attributes, fa.ad_org_id FROM C_Period p INNER JOIN C_Year y ON p.C_Year_ID = y.C_Year_ID AND y.isActive = 'Y' -- Get same Period from previous year LEFT OUTER JOIN C_Period pp ON pp.C_Period_ID = report.Get_Predecessor_Period_Recursive ( p.C_Period_ID, ( SELECT count(0) FROM C_Period sp WHERE sp.C_Year_ID = p.C_Year_ID and isActive = 'Y' )::int ) AND pp.isActive = 'Y' LEFT OUTER JOIN C_Year py ON pp.C_Year_ID = py.C_Year_ID AND py.isActive = 'Y' -- Get data from fact account INNER JOIN ( SELECT fa.M_Product_ID, fa.C_Period_ID, fa.C_BPartner_ID, CASE WHEN isSOTrx = 'Y' THEN AmtAcctCr - AmtAcctDr ELSE AmtAcctDr - AmtAcctCr END AS AmtAcct, il.M_AttributeSetInstance_ID, fa.ad_org_id FROM Fact_Acct fa JOIN C_Invoice i ON fa.Record_ID = i.C_Invoice_ID AND i.isActive = 'Y' JOIN C_InvoiceLine il ON fa.Line_ID = il.C_InvoiceLine_ID AND il.isActive = 'Y' WHERE AD_Table_ID = (SELECT Get_Table_ID('C_Invoice')) AND IsSOtrx = $2 AND fa.isActive = 'Y' AND ( -- If the given attribute set instance has values set... CASE WHEN EXISTS ( SELECT ai_value FROM report.fresh_Attributes WHERE M_AttributeSetInstance_ID = $3 ) -- ... then apply following filter: THEN ( -- Take lines where the attributes of the current InvoiceLine's asi are in the parameter asi and their Values Match EXISTS ( SELECT 0 FROM report.fresh_Attributes a -- a = Attributes from invoice line, pa = Parameter Attributes INNER JOIN report.fresh_Attributes pa ON pa.M_AttributeSetInstance_ID = $3 AND a.at_value = pa.at_value -- same attribute AND a.ai_value = pa.ai_value -- same value WHERE a.M_AttributeSetInstance_ID = il.M_AttributeSetInstance_ID ) -- Dismiss lines where the Attributes in the Parameter are not in the InvoiceLine's asi AND NOT EXISTS ( SELECT 0 FROM report.fresh_Attributes pa LEFT OUTER JOIN report.fresh_Attributes a ON a.at_value = pa.at_value AND a.ai_value = pa.ai_value AND a.M_AttributeSetInstance_ID = il.M_AttributeSetInstance_ID WHERE pa.M_AttributeSetInstance_ID = $3 AND a.M_AttributeSetInstance_ID IS null ) ) -- ... else deactivate the filter ELSE TRUE END ) ) fa ON true INNER JOIN C_Period fap ON fa.C_Period_ID = fap.C_Period_ID AND fap.isActive = 'Y' /* Please note: This is an important implicit filter. Inner Joining the Product * filters Fact Acct records for e.g. Taxes */ INNER JOIN M_Product pr ON fa.M_Product_ID = pr.M_Product_ID AND pr.M_Product_Category_ID != (SELECT value::numeric FROM AD_SysConfig WHERE name = 'PackingMaterialProductCategoryID' AND isActive = 'Y') AND pr.isActive = 'Y' INNER JOIN C_BPartner bp ON fa.C_BPartner_ID = bp.C_BPartner_ID AND bp.isActive = 'Y' LEFT OUTER JOIN ( SELECT String_agg ( ai_value, ', ' ORDER BY Length(ai_value), ai_value ) AS Attributes, M_AttributeSetInstance_ID FROM Report.fresh_Attributes GROUP BY M_AttributeSetInstance_ID ) att ON $3 = att.M_AttributeSetInstance_ID WHERE p.C_Period_ID = $1 AND p.isActive = 'Y' AND fa.ad_org_id = $4 GROUP BY bp.name, p.EndDate, pp.EndDate, y.fiscalYear, py.fiscalYear, att.Attributes, fa.ad_org_id ) a ORDER BY SameYearSum DESC$BODY$ LANGUAGE sql STABLE; DROP FUNCTION IF EXISTS report.umsatzreport_report (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric); DROP FUNCTION IF EXISTS report.umsatzreport_report (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric, IN AD_Org_ID numeric); DROP TABLE IF EXISTS report.umsatzreport_report; CREATE TABLE report.umsatzreport_report ( name character varying(60), periodend date, lastyearperiodend date, year character varying(10), lastyear character varying(10), sameperiodsum numeric, sameperiodlastyearsum numeric, perioddifference numeric, perioddiffpercentage numeric, sameyearsum numeric, lastyearsum numeric, yeardifference numeric, yeardiffpercentage numeric, attributesetinstance character varying(60), ad_org_id numeric, unionorder integer ) WITH ( OIDS=FALSE ); CREATE FUNCTION report.umsatzreport_report (IN c_period_id numeric, IN issotrx character varying, IN M_AttributeSetInstance_ID numeric, IN AD_Org_ID numeric) RETURNS SETOF report.umsatzreport_report AS $BODY$ SELECT *, 1 AS UnionOrder FROM report.Umsatzreport_Report_Sub ($1, $2, $3, $4) UNION ALL SELECT null as name, PeriodEnd, LastYearPeriodEnd, Year, LastYear, SUM( SamePeriodSum ) AS SamePeriodSum, SUM( SamePeriodLastYearSum ) AS SamePeriodLastYearSum, SUM( SamePeriodSum ) - SUM( SamePeriodLastYearSum ) AS PeriodDifference, CASE WHEN SUM( SamePeriodSum ) - SUM( SamePeriodLastYearSum ) != 0 AND SUM( SamePeriodLastYearSum ) != 0 THEN (SUM( SamePeriodSum ) - SUM( SamePeriodLastYearSum ) ) / SUM( SamePeriodLastYearSum ) * 100 ELSE NULL END AS PeriodDiffPercentage, SUM( SameYearSum ) AS SameYearSum, SUM( LastYearSum ) AS LastYearSum, SUM( SameYearSum ) - SUM( LastYearSum ) AS YearDifference, CASE WHEN SUM( SameYearSum ) - SUM( LastYearSum ) != 0 AND SUM( LastYearSum ) != 0 THEN (SUM( SameYearSum ) - SUM( LastYearSum ) ) / SUM( LastYearSum ) * 100 ELSE NULL END AS YearDiffPercentage, attributesetinstance, ad_org_id, 2 AS UnionOrder FROM report.Umsatzreport_Report_Sub ($1, $2, $3, $4) GROUP BY PeriodEnd, LastYearPeriodEnd, Year, LastYear, attributesetinstance, ad_org_id ORDER BY UnionOrder, SameYearSum DESC $BODY$ LANGUAGE sql STABLE;
klst-com/metasfresh
de.metas.fresh/de.metas.fresh.base/src/main/sql/postgresql/system/75-de.metas.fresh.reports/5454394_sys_FRESH-668_update_umsatzliste_report.sql
SQL
gpl-2.0
8,493
<?php /** * --------------------------------------------------------------------- * GLPI - Gestionnaire Libre de Parc Informatique * Copyright (C) 2015-2017 Teclib' and contributors. * * http://glpi-project.org * * based on GLPI - Gestionnaire Libre de Parc Informatique * Copyright (C) 2003-2014 by the INDEPNET Development Team. * * --------------------------------------------------------------------- * * LICENSE * * This file is part of GLPI. * * GLPI 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. * * GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>. * --------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST["projects_id"])) { $condition = ['glpi_projecttasks.projectstates_id' => ['<>', 3]]; if ($_POST["projects_id"] > 0) { $condition['glpi_projecttasks.projects_id'] = $_POST['projects_id']; } $p = ['itemtype' => ProjectTask::getType(), 'entity_restrict' => $_POST['entity_restrict'], 'myname' => $_POST["myname"], 'condition' => $condition, 'rand' => $_POST["rand"]]; if (isset($_POST["used"]) && !empty($_POST["used"])) { if (isset($_POST["used"])) { $p["used"] = $_POST["used"]; } } ProjectTask::dropdown($p); }
edgardmessias/glpi
ajax/dropdownProjectTaskTicket.php
PHP
gpl-2.0
1,972
<?php /** * Copyright 2006 - 2012 Eric D. Hough (http://ehough.com) * * This file is part of TubePress (http://tubepress.org) * * TubePress 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. * * TubePress 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 TubePress. If not, see <http://www.gnu.org/licenses/>. * */ class_exists('org_tubepress_impl_classloader_ClassLoader') || require dirname(__FILE__) . '/../../../impl/classloader/ClassLoader.class.php'; org_tubepress_impl_classloader_ClassLoader::loadClasses(array( 'org_tubepress_impl_http_transports_AbstractHttpTransport', 'org_tubepress_impl_http_HttpClientChain', )); /** * Lifted from http://core.trac.wordpress.org/browser/tags/3.0.4/wp-includes/class-http.php * * HTTP request method uses Streams to retrieve the url. * * Requires PHP 5.0+ and uses fopen with stream context. Requires that 'allow_url_fopen' PHP setting * to be enabled. * * Second preferred method for getting the URL, for PHP 5. */ class org_tubepress_impl_http_transports_StreamsTransport extends org_tubepress_impl_http_transports_AbstractHttpTransport { private static $_stream_http_transport = 'http'; private static $_stream_metadata_timedout = 'timed_out'; private static $_stream_metadata_data_wrapper = 'wrapper_data'; private static $_stream_metadata_data_headers = 'headers'; private static $_http_context_option_method = 'method'; private static $_http_context_option_header = 'header'; private static $_http_context_option_useragent = 'user_agent'; private static $_http_context_option_ignoreerrors = 'ignore_errors'; private static $_http_context_option_timeout = 'timeout'; private static $_http_context_option_content = 'content'; private static $_http_context_option_protocol = 'protocol_version'; private static $_fopen_mode_readonly = 'r'; private $_streamContext; private $_streamResultMeta; private $_httpMessageParser; private $_statusLine; /** * Perform optional setup to handle a new HTTP request. * * @param org_tubepress_api_http_HttpRequest $request The HTTP request to handle. * * @return void */ protected function prepareToHandleNewRequest(org_tubepress_api_http_HttpRequest $request) { org_tubepress_impl_log_Log::log($this->logPrefix(), 'Creating stream context...'); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $this->_httpMessageParser = $ioc->get(org_tubepress_spi_http_HttpMessageParser::_); $streamParams = array(self::$_stream_http_transport => array( self::$_http_context_option_header => $this->_httpMessageParser->getHeaderArrayAsString($request), self::$_http_context_option_method => $request->getMethod(), self::$_http_context_option_useragent => $request->getHeaderValue(org_tubepress_api_http_HttpRequest::HTTP_HEADER_USER_AGENT), self::$_http_context_option_ignoreerrors => true, self::$_http_context_option_content => $request->getEntity() === null ? null : $request->getEntity()->getContent(), self::$_http_context_option_protocol => '1.0' //use HTTP 1.0 unless you want to make this SLOW )); $this->_streamContext = stream_context_create($streamParams); } /** * Perform handling of the given request. * * @param org_tubepress_api_http_HttpRequest $request The HTTP request. * * @return void */ protected function handleRequest(org_tubepress_api_http_HttpRequest $request) { org_tubepress_impl_log_Log::log($this->logPrefix(), 'Calling fopen()...'); $handle = @fopen($request->getUrl()->toString(), self::$_fopen_mode_readonly, false, $this->_streamContext); if (! $handle) { throw new Exception(sprintf('Could not open handle for fopen() to %s'), $url); } org_tubepress_impl_log_Log::log($this->logPrefix(), 'Successfully used fopen() to get a handle to %s', $request->getUrl()); /* set the timeout to 5 seconds */ stream_set_timeout($handle, 5); /* read stream contents */ org_tubepress_impl_log_Log::log($this->logPrefix(), 'Reading stream contents...'); $strResponse = stream_get_contents($handle); /* read stream metadata */ org_tubepress_impl_log_Log::log($this->logPrefix(), 'Reading stream metadata...'); $this->_streamResultMeta = stream_get_meta_data($handle); /* close the stream... */ org_tubepress_impl_log_Log::log($this->logPrefix(), 'Closing stream...'); @fclose($handle); if ($this->_streamResultMeta[self::$_stream_metadata_timedout]) { throw new Exception('Timed out while waiting for %s', $request); } return $this->_buildRawResponse($strResponse); } /** * Get the name of this transport. * * @return string The name of this transport. */ protected function getTransportName() { return 'Streams'; } /** * Get the response code. * * @return int the HTTP response code. */ protected function getResponseCode() { $pieces = explode(' ', $this->_statusLine); if (count($pieces) < 2) { throw new Exception('Invalid status line: ' . $this->_statusLine); } $code = $pieces[1]; return intval($code); } /** * Perform optional tear down after handling a request. * * @return void */ protected function tearDown() { unset($this->_streamContext); unset($this->_streamResultMeta); unset($this->_httpMessageParser); } /** * Determines whether or not this transport is available on the system. * * @return bool True if this transport is available on the system. False otherwise. */ function isAvailable() { if (! function_exists('fopen')) { org_tubepress_impl_log_Log::log($this->logPrefix(), 'fopen() is not available.'); return false; } if (function_exists('ini_get') && ini_get('allow_url_fopen') != true) { org_tubepress_impl_log_Log::log($this->logPrefix(), 'allow_url_fopen is set to false.'); return false; } return true; } /** * Determines if this transport can handle the given request. * * @param org_tubepress_api_http_HttpRequest $request The request to handle. * * @return bool True if this transport can handle the given request. False otherwise. */ function canHandle(org_tubepress_api_http_HttpRequest $request) { $scheme = $request->getUrl()->getScheme(); return preg_match_all('/https?/', $scheme, $matches) === 1; } private function _buildRawResponse($body) { $headerArray = $this->_streamResultMeta[self::$_stream_metadata_data_wrapper]; if (! is_array($headerArray)) { throw new Exception('HTTP response is missing header array'); } $this->_statusLine = $headerArray[0]; $headerString = ''; for ($x = 1; $x < count($headerArray); $x++) { $headerString .= $headerArray[$x] . "\r\n"; } return $headerString . "\r\n" . $body; } }
diogo25/newibmo
wp-content/plugins/tubepress/sys/classes/org/tubepress/impl/http/transports/StreamsTransport.class.php
PHP
gpl-2.0
7,880
/* Copyright (c) 2013, The Linux Foundation. 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 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _ARCH_ARM_MACH_MSM_SMEM_PRIVATE_H_ #define _ARCH_ARM_MACH_MSM_SMEM_PRIVATE_H_ #include <linux/remote_spinlock.h> #include <mach/ramdump.h> #define SMD_HEAP_SIZE 512 struct smem_heap_info { unsigned initialized; unsigned free_offset; unsigned heap_remaining; unsigned reserved; }; struct smem_heap_entry { unsigned allocated; unsigned offset; unsigned size; unsigned reserved; /* */ }; #define BASE_ADDR_MASK 0xfffffffc struct smem_proc_comm { unsigned command; unsigned status; unsigned data1; unsigned data2; }; struct smem_shared { struct smem_proc_comm proc_comm[4]; unsigned version[32]; struct smem_heap_info heap_info; struct smem_heap_entry heap_toc[SMD_HEAP_SIZE]; }; struct smem_area { phys_addr_t phys_addr; resource_size_t size; void __iomem *virt_addr; }; /* */ remote_spinlock_t *smem_get_remote_spinlock(void); bool smem_initialized_check(void); /* */ int smem_module_init_notifier_register(struct notifier_block *nb); /* */ int smem_module_init_notifier_unregister(struct notifier_block *nb); /* */ unsigned smem_get_free_space(unsigned to_proc); #endif /* */
holyangel/LGE_G3
arch/arm/mach-msm/smem_private.h
C
gpl-2.0
3,040
/***************************************************************************** * ttml.c : TTML subtitles demux ***************************************************************************** * Copyright (C) 2015 VLC authors and VideoLAN * * Authors: Hugo Beauzée-Luyssen <[email protected]> * Sushma Reddy <[email protected]> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <vlc_common.h> #include <vlc_plugin.h> #include <vlc_demux.h> #include <vlc_xml.h> #include <vlc_strings.h> #include <vlc_memory.h> #include <vlc_es_out.h> static int Open( vlc_object_t* p_this ); static void Close( demux_t* p_demux ); vlc_module_begin () set_shortname( N_("TTML") ) set_description( N_("TTML demuxer") ) set_capability( "demux", 2 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_DEMUX ) set_callbacks( Open, Close ) add_shortcut( "ttml", "subtitle" ) vlc_module_end (); typedef struct { int64_t i_start; int64_t i_stop; char *psz_text; } subtitle_t; struct demux_sys_t { xml_t* p_xml; xml_reader_t* p_reader; subtitle_t* subtitle; es_out_id_t* p_es; int64_t i_length; int64_t i_next_demux_time; int i_subtitle; int i_subtitles; char* psz_head; size_t i_head_len; bool b_has_head; }; static int Control( demux_t* p_demux, int i_query, va_list args ) { demux_sys_t *p_sys = p_demux->p_sys; int64_t *pi64, i64; double *pf, f; switch( i_query ) { case DEMUX_GET_TIME: pi64 = (int64_t*)va_arg( args, int64_t * ); if( p_sys->i_subtitle < p_sys->i_subtitles ) *pi64 = p_sys->subtitle[p_sys->i_subtitle].i_start; else *pi64 = p_sys->i_length; return VLC_SUCCESS; case DEMUX_SET_TIME: i64 = (int64_t)va_arg( args, int64_t ); p_sys->i_subtitle = 0; while( p_sys->i_subtitle < p_sys->i_subtitles ) { const subtitle_t *p_subtitle = &p_sys->subtitle[p_sys->i_subtitle]; if( p_subtitle->i_start > i64 ) break; if( p_subtitle->i_stop > p_subtitle->i_start && p_subtitle->i_stop > i64 ) break; p_sys->i_subtitle++; } if( p_sys->i_subtitle >= p_sys->i_subtitles ) return VLC_EGENERIC; return VLC_SUCCESS; case DEMUX_SET_NEXT_DEMUX_TIME: i64 = (int64_t)va_arg( args, int64_t ); p_sys->i_next_demux_time = i64; return VLC_SUCCESS; case DEMUX_GET_LENGTH: pi64 = (int64_t*)va_arg( args, int64_t * ); *pi64 = p_sys->i_length; return VLC_SUCCESS; case DEMUX_GET_POSITION: pf = (double*)va_arg( args, double * ); if( p_sys->i_subtitle >= p_sys->i_subtitles ) { *pf = 1.0; } else if( p_sys->i_subtitles > 0 ) { *pf = (double)p_sys->subtitle[p_sys->i_subtitle].i_start / (double)p_sys->i_length; } else { *pf = 0.0; } return VLC_SUCCESS; case DEMUX_SET_POSITION: f = (double)va_arg( args, double ); i64 = f * p_sys->i_length; p_sys->i_subtitle = 0; while( p_sys->i_subtitle < p_sys->i_subtitles && p_sys->subtitle[p_sys->i_subtitle].i_start < i64 ) { p_sys->i_subtitle++; } if( p_sys->i_subtitle >= p_sys->i_subtitles ) return VLC_EGENERIC; return VLC_SUCCESS; case DEMUX_GET_PTS_DELAY: case DEMUX_GET_FPS: case DEMUX_GET_META: case DEMUX_GET_ATTACHMENTS: case DEMUX_GET_TITLE_INFO: case DEMUX_HAS_UNSUPPORTED_META: case DEMUX_CAN_RECORD: return VLC_EGENERIC; default: msg_Err( p_demux, "unknown query %d in subtitle control", i_query ); return VLC_EGENERIC; } return VLC_EGENERIC; } static int Convert_time( int64_t *timing_value, const char *s ) { int h1, m1, s1, d1 = 0; //char *sec = ""; if ( sscanf( s, "%d:%d:%d,%d", &h1, &m1, &s1, &d1 ) == 4 || sscanf( s, "%d:%d:%d.%d", &h1, &m1, &s1, &d1 ) == 4 || sscanf( s, "%d:%d:%d", &h1, &m1, &s1) == 3 ) { (*timing_value) = ( (int64_t)h1 * 3600 * 1000 + (int64_t)m1 * 60 * 1000 + (int64_t)s1 * 1000 + (int64_t)d1 ) * 1000; return VLC_SUCCESS; } return VLC_EGENERIC; } static char* Append( char* psz_old, const char* psz_format, ... ) { va_list ap; char* psz_new; va_start (ap, psz_format); int ret = vasprintf( &psz_new, psz_format, ap ); va_end (ap); if ( ret < 0 ) { free( psz_old ); return NULL; } char* psz_concat; ret = asprintf( &psz_concat, "%s%s", psz_old, psz_new ); free( psz_old ); free( psz_new ); if ( ret < 0 ) return NULL; return psz_concat; } static int ReadTTML( demux_t* p_demux ) { demux_sys_t* p_sys = p_demux->p_sys; const char* psz_name; int i_max_sub = 0; int i_type; do { i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name ); if ( i_type == XML_READER_STARTELEM && ( !strcasecmp( psz_name, "head" ) || !strcasecmp( psz_name, "tt:head" ) ) ) { p_sys->b_has_head = true; } else if ( i_type == XML_READER_STARTELEM && ( !strcasecmp( psz_name, "p" ) || !strcasecmp( psz_name, "tt:p" ) ) ) { char* psz_text = NULL; char* psz_begin = NULL; char* psz_end = NULL; if( asprintf ( &psz_text, "<%s", psz_name ) < 0 ) return VLC_ENOMEM; const char* psz_attr_value = NULL; const char* psz_attr_name = xml_ReaderNextAttr( p_sys->p_reader, &psz_attr_value ); while ( psz_attr_name && psz_attr_value ) { if ( !strcasecmp( psz_attr_name, "begin" ) ) psz_begin = strdup( psz_attr_value ); else if ( !strcasecmp( psz_attr_name, "end" ) ) psz_end = strdup( psz_attr_value ); else if ( !strcasecmp( psz_attr_name, psz_attr_name ) ) { psz_text = Append( psz_text, " %s = \"%s\"", psz_attr_name, psz_attr_value ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; } psz_attr_name = xml_ReaderNextAttr( p_sys->p_reader, &psz_attr_value ); } psz_text = Append( psz_text, ">" ); if ( unlikely( psz_text == NULL ) ) { free( psz_begin ); free( psz_end ); return VLC_ENOMEM; } if ( psz_begin && psz_end ) { if ( p_sys->i_subtitles >= i_max_sub ) { i_max_sub += 500; p_sys->subtitle = realloc_or_free( p_sys->subtitle, sizeof( *p_sys->subtitle ) * i_max_sub ); if ( unlikely( p_sys->subtitle == NULL ) ) { free( psz_text ); free( psz_begin ); free( psz_end ); return VLC_ENOMEM; } } subtitle_t *p_subtitle = &p_sys->subtitle[p_sys->i_subtitles]; Convert_time( &p_subtitle->i_start, psz_begin ); Convert_time( &p_subtitle->i_stop, psz_end ); free( psz_begin ); free( psz_end ); i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name ); while ( i_type != XML_READER_ENDELEM || ( strcmp( psz_name, "p" ) && strcmp( psz_name, "tt:p" ) ) ) { if ( i_type == XML_READER_TEXT && psz_name != NULL ) { psz_text = Append( psz_text, "%s", psz_name ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; } else if ( i_type == XML_READER_STARTELEM ) { psz_text = Append( psz_text, " <%s", psz_name ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; psz_attr_name = xml_ReaderNextAttr( p_sys->p_reader, &psz_attr_value ); while ( psz_attr_name && psz_attr_value ) { psz_text = Append( psz_text, " %s=\"%s\"", psz_attr_name, psz_attr_value ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; psz_attr_name = xml_ReaderNextAttr( p_sys->p_reader, &psz_attr_value ); } if ( !strcasecmp( psz_name, "tt:br" ) || !strcasecmp( psz_name, "br" ) ) { psz_text = Append( psz_text, "/>" ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; } else { psz_text = Append( psz_text, ">" ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; } } else if ( i_type == XML_READER_ENDELEM ) { psz_text = Append( psz_text, " </%s>", psz_name ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; } i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name ); } psz_text = Append( psz_text, "</p>" ); if ( unlikely( psz_text == NULL ) ) return VLC_ENOMEM; p_subtitle->psz_text = psz_text; p_sys->i_subtitles++; } else { free( psz_text ); free( psz_begin ); free( psz_end ); } } } while ( i_type != XML_READER_ENDELEM || ( strcasecmp( psz_name, "tt" ) && strcasecmp( psz_name, "tt:tt" ) ) ); return VLC_SUCCESS; } static int Demux( demux_t* p_demux ) { demux_sys_t* p_sys = p_demux->p_sys; if( p_sys->i_subtitle >= p_sys->i_subtitles ) return 0; while ( p_sys->i_subtitle < p_sys->i_subtitles && p_sys->subtitle[p_sys->i_subtitle].i_start < p_sys->i_next_demux_time ) { const subtitle_t* p_subtitle = &p_sys->subtitle[p_sys->i_subtitle]; block_t* p_block = block_Alloc( strlen( p_subtitle->psz_text ) + 1 ); if ( unlikely( p_block == NULL ) ) return -1; p_block->i_dts = p_block->i_pts = VLC_TS_0 + p_subtitle->i_start; if( p_subtitle->i_stop >= 0 && p_subtitle->i_stop >= p_subtitle->i_start ) p_block->i_length = p_subtitle->i_stop - p_subtitle->i_start; memcpy( p_block->p_buffer, p_subtitle->psz_text, p_block->i_buffer ); es_out_Send( p_demux->out, p_sys->p_es, p_block ); p_sys->i_subtitle++; } p_sys->i_next_demux_time = 0; return 1; } static void ParseHead( demux_t* p_demux ) { demux_sys_t* p_sys = p_demux->p_sys; char buff[1025]; char* psz_head = NULL; size_t i_head_len = 0; // head tags size, in bytes size_t i_size; // allocated buffer size size_t i_read; // Rewind since the XML parser will have consumed the entire file. stream_Seek( p_demux->s, 0 ); while ( ( i_read = stream_Read( p_demux->s, (void*)buff, 1024 ) ) > 0 ) { ssize_t i_offset = -1; // Ensure we can use strstr buff[i_read] = 0; if ( psz_head == NULL ) { // Seek to the opening <head> tag if we haven't seen it already const char* psz_head_begin = strstr( buff, "<head>" ); if ( psz_head_begin == NULL ) psz_head_begin = strstr( buff, "<tt:head>" ); if ( psz_head_begin == NULL ) continue; i_head_len = i_read - ( psz_head_begin - buff ); i_size = i_head_len; psz_head = malloc( i_size * sizeof( *psz_head ) ); if ( unlikely( psz_head == NULL ) ) return; memcpy( psz_head, psz_head_begin, i_head_len ); // Avoid copying the head tag again once we search for the end tag. i_offset = psz_head_begin - buff; } if ( psz_head != NULL ) { size_t i_end_tag_len = strlen( "</head>" ); // Or copy until the end of the head tag once we've seen the opening one const char* psz_end_head = strstr( buff, "</head>" ); if ( psz_end_head == NULL ) { psz_end_head = strstr( buff, "</tt:head>" ); i_end_tag_len = strlen( "</tt:head>" ); } // Check if we need to extend the buffer first size_t i_to_copy = i_read; if ( psz_end_head != NULL ) i_to_copy = psz_end_head - buff + i_end_tag_len; if ( i_size < i_head_len + i_to_copy ) { i_size = __MAX(i_size * 2, i_head_len + i_to_copy); psz_head = realloc_or_free( psz_head, i_size ); if ( unlikely( psz_head == NULL ) ) return; } if ( psz_end_head == NULL ) { // If we already copied the begin tag, we don't need to append this again. if ( i_offset != -1 ) continue; // Otherwise, simply append the entire buffer memcpy( psz_head + i_head_len, buff, i_to_copy ); i_head_len += i_to_copy; } else { if ( i_offset == -1 ) { memcpy( psz_head + i_head_len, buff, i_to_copy ); i_head_len += i_to_copy; } else { // If the buffer we originally copied already contains the end tag, no need to copy again // Though if we already have the </head> in our buffer, we need to adjust the total size i_head_len = psz_end_head - buff + i_end_tag_len + i_offset; } p_sys->psz_head = psz_head; p_sys->i_head_len = i_head_len; break; } } } } static int Open( vlc_object_t* p_this ) { demux_t *p_demux = (demux_t*)p_this; demux_sys_t *p_sys; p_demux->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) ); if ( unlikely( p_sys == NULL ) ) return VLC_ENOMEM; p_sys->p_xml = xml_Create( p_demux ); if ( !p_sys->p_xml ) { Close( p_demux ); return VLC_EGENERIC; } p_sys->p_reader = xml_ReaderCreate( p_sys->p_xml, p_demux->s ); if ( !p_sys->p_reader ) { Close( p_demux ); return VLC_EGENERIC; } const char* psz_name; int i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name ); if ( i_type != XML_READER_STARTELEM || ( strcmp( psz_name, "tt" ) && strcmp( psz_name, "tt:tt" ) ) ) { Close( p_demux ); return VLC_EGENERIC; } if ( ReadTTML( p_demux ) != VLC_SUCCESS ) { Close( p_demux ); return VLC_EGENERIC; } if ( p_sys->b_has_head ) ParseHead( p_demux ); p_demux->pf_demux = Demux; p_demux->pf_control = Control; es_format_t fmt; es_format_Init( &fmt, SPU_ES, VLC_CODEC_TTML ); if ( p_sys->i_head_len > 0 ) { fmt.p_extra = p_sys->psz_head; fmt.i_extra = p_sys->i_head_len; } p_sys->p_es = es_out_Add( p_demux->out, &fmt ); es_format_Clean( &fmt ); if ( p_sys->i_subtitles > 0 ) p_sys->i_length = p_sys->subtitle[ p_sys->i_subtitles - 1 ].i_stop; else p_sys->i_length = 0; return VLC_SUCCESS; } static void Close( demux_t* p_demux ) { demux_sys_t* p_sys = p_demux->p_sys; if ( p_sys->p_es ) es_out_Del( p_demux->out, p_sys->p_es ); if ( p_sys->p_reader ) xml_ReaderDelete( p_sys->p_reader ); if ( p_sys->p_xml ) xml_Delete( p_sys->p_xml ); for ( int i = 0; i < p_sys->i_subtitles; ++i ) { free( p_sys->subtitle[i].psz_text ); } free( p_sys->subtitle ); free( p_sys ); }
youfearm3/vlc
modules/demux/ttml.c
C
gpl-2.0
18,066
/* linux/drivers/i2c/busses/i2c-s3c2410.c * * Copyright (C) 2004,2005,2009 Simtec Electronics * Ben Dooks <[email protected]> * * S3C2410 I2C Controller * * 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 <linux/kernel.h> #include <linux/module.h> #include <linux/i2c.h> #include <linux/init.h> #include <linux/time.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/clk.h> #include <linux/cpufreq.h> #include <linux/slab.h> #include <linux/io.h> #include <asm/irq.h> #include <plat/regs-iic.h> #include <plat/iic.h> /* i2c controller state */ enum s3c24xx_i2c_state { STATE_IDLE, STATE_START, STATE_READ, STATE_WRITE, STATE_STOP }; enum s3c24xx_i2c_type { TYPE_S3C2410, TYPE_S3C2440, }; struct s3c24xx_i2c { spinlock_t lock; wait_queue_head_t wait; unsigned int suspended:1; struct i2c_msg *msg; unsigned int msg_num; unsigned int msg_idx; unsigned int msg_ptr; unsigned int tx_setup; unsigned int irq; enum s3c24xx_i2c_state state; unsigned long clkrate; void __iomem *regs; struct clk *clk; struct device *dev; struct resource *ioarea; struct i2c_adapter adap; #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; #endif }; /* default platform data removed, dev should always carry data. */ /* s3c24xx_i2c_is2440() * * return true is this is an s3c2440 */ static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c *i2c) { struct platform_device *pdev = to_platform_device(i2c->dev); enum s3c24xx_i2c_type type; type = platform_get_device_id(pdev)->driver_data; return type == TYPE_S3C2440; } /* s3c24xx_i2c_master_complete * * complete the message and wake up the caller, using the given return code, * or zero to mean ok. */ static inline void s3c24xx_i2c_master_complete(struct s3c24xx_i2c *i2c, int ret) { dev_dbg(i2c->dev, "master_complete %d\n", ret); i2c->msg_ptr = 0; i2c->msg = NULL; i2c->msg_idx++; i2c->msg_num = 0; if (ret) i2c->msg_idx = ret; wake_up(&i2c->wait); } static inline void s3c24xx_i2c_disable_ack(struct s3c24xx_i2c *i2c) { unsigned long tmp; tmp = readl(i2c->regs + S3C2410_IICCON); writel(tmp & ~S3C2410_IICCON_ACKEN, i2c->regs + S3C2410_IICCON); } static inline void s3c24xx_i2c_enable_ack(struct s3c24xx_i2c *i2c) { unsigned long tmp; tmp = readl(i2c->regs + S3C2410_IICCON); writel(tmp | S3C2410_IICCON_ACKEN, i2c->regs + S3C2410_IICCON); } /* irq enable/disable functions */ static inline void s3c24xx_i2c_disable_irq(struct s3c24xx_i2c *i2c) { unsigned long tmp; tmp = readl(i2c->regs + S3C2410_IICCON); writel(tmp & ~S3C2410_IICCON_IRQEN, i2c->regs + S3C2410_IICCON); } static inline void s3c24xx_i2c_enable_irq(struct s3c24xx_i2c *i2c) { unsigned long tmp; tmp = readl(i2c->regs + S3C2410_IICCON); writel(tmp | S3C2410_IICCON_IRQEN, i2c->regs + S3C2410_IICCON); } /* s3c24xx_i2c_message_start * * put the start of a message onto the bus */ static void s3c24xx_i2c_message_start(struct s3c24xx_i2c *i2c, struct i2c_msg *msg) { unsigned int addr = (msg->addr & 0x7f) << 1; unsigned long stat; unsigned long iiccon; stat = 0; stat |= S3C2410_IICSTAT_TXRXEN; if (msg->flags & I2C_M_RD) { stat |= S3C2410_IICSTAT_MASTER_RX; addr |= 1; } else stat |= S3C2410_IICSTAT_MASTER_TX; if (msg->flags & I2C_M_REV_DIR_ADDR) addr ^= 1; /* todo - check for wether ack wanted or not */ s3c24xx_i2c_enable_ack(i2c); iiccon = readl(i2c->regs + S3C2410_IICCON); writel(stat, i2c->regs + S3C2410_IICSTAT); dev_dbg(i2c->dev, "START: %08lx to IICSTAT, %02x to DS\n", stat, addr); writeb(addr, i2c->regs + S3C2410_IICDS); /* delay here to ensure the data byte has gotten onto the bus * before the transaction is started */ ndelay(i2c->tx_setup); dev_dbg(i2c->dev, "iiccon, %08lx\n", iiccon); writel(iiccon, i2c->regs + S3C2410_IICCON); stat |= S3C2410_IICSTAT_START; writel(stat, i2c->regs + S3C2410_IICSTAT); } static inline void s3c24xx_i2c_stop(struct s3c24xx_i2c *i2c, int ret) { unsigned long iicstat = readl(i2c->regs + S3C2410_IICSTAT); dev_dbg(i2c->dev, "STOP\n"); /* stop the transfer */ iicstat &= ~S3C2410_IICSTAT_START; writel(iicstat, i2c->regs + S3C2410_IICSTAT); i2c->state = STATE_STOP; s3c24xx_i2c_master_complete(i2c, ret); s3c24xx_i2c_disable_irq(i2c); } /* helper functions to determine the current state in the set of * messages we are sending */ /* is_lastmsg() * * returns TRUE if the current message is the last in the set */ static inline int is_lastmsg(struct s3c24xx_i2c *i2c) { return i2c->msg_idx >= (i2c->msg_num - 1); } /* is_msglast * * returns TRUE if we this is the last byte in the current message */ static inline int is_msglast(struct s3c24xx_i2c *i2c) { return i2c->msg_ptr == i2c->msg->len-1; } /* is_msgend * * returns TRUE if we reached the end of the current message */ static inline int is_msgend(struct s3c24xx_i2c *i2c) { return i2c->msg_ptr >= i2c->msg->len; } /* i2s_s3c_irq_nextbyte * * process an interrupt and work out what to do */ static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat) { unsigned long tmp; unsigned char byte; int ret = 0; switch (i2c->state) { case STATE_IDLE: dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__); goto out; break; case STATE_STOP: dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__); s3c24xx_i2c_disable_irq(i2c); goto out_ack; case STATE_START: /* last thing we did was send a start condition on the * bus, or started a new i2c message */ if (iicstat & S3C2410_IICSTAT_LASTBIT && !(i2c->msg->flags & I2C_M_IGNORE_NAK)) { /* ack was not received... */ dev_dbg(i2c->dev, "ack was not received\n"); s3c24xx_i2c_stop(i2c, -ENXIO); goto out_ack; } if (i2c->msg->flags & I2C_M_RD) i2c->state = STATE_READ; else i2c->state = STATE_WRITE; /* terminate the transfer if there is nothing to do * as this is used by the i2c probe to find devices. */ if (is_lastmsg(i2c) && i2c->msg->len == 0) { s3c24xx_i2c_stop(i2c, 0); goto out_ack; } if (i2c->state == STATE_READ) goto prepare_read; /* fall through to the write state, as we will need to * send a byte as well */ case STATE_WRITE: /* we are writing data to the device... check for the * end of the message, and if so, work out what to do */ if (!(i2c->msg->flags & I2C_M_IGNORE_NAK)) { if (iicstat & S3C2410_IICSTAT_LASTBIT) { dev_dbg(i2c->dev, "WRITE: No Ack\n"); s3c24xx_i2c_stop(i2c, -ECONNREFUSED); goto out_ack; } } retry_write: if (!is_msgend(i2c)) { byte = i2c->msg->buf[i2c->msg_ptr++]; writeb(byte, i2c->regs + S3C2410_IICDS); /* delay after writing the byte to allow the * data setup time on the bus, as writing the * data to the register causes the first bit * to appear on SDA, and SCL will change as * soon as the interrupt is acknowledged */ ndelay(i2c->tx_setup); } else if (!is_lastmsg(i2c)) { /* we need to go to the next i2c message */ dev_dbg(i2c->dev, "WRITE: Next Message\n"); i2c->msg_ptr = 0; i2c->msg_idx++; i2c->msg++; /* check to see if we need to do another message */ if (i2c->msg->flags & I2C_M_NOSTART) { if (i2c->msg->flags & I2C_M_RD) { /* cannot do this, the controller * forces us to send a new START * when we change direction */ s3c24xx_i2c_stop(i2c, -EINVAL); } goto retry_write; } else { /* send the new start */ s3c24xx_i2c_message_start(i2c, i2c->msg); i2c->state = STATE_START; } } else { /* send stop */ s3c24xx_i2c_stop(i2c, 0); } break; case STATE_READ: /* we have a byte of data in the data register, do * something with it, and then work out wether we are * going to do any more read/write */ byte = readb(i2c->regs + S3C2410_IICDS); i2c->msg->buf[i2c->msg_ptr++] = byte; prepare_read: if (is_msglast(i2c)) { /* last byte of buffer */ if (is_lastmsg(i2c)) s3c24xx_i2c_disable_ack(i2c); } else if (is_msgend(i2c)) { /* ok, we've read the entire buffer, see if there * is anything else we need to do */ if (is_lastmsg(i2c)) { /* last message, send stop and complete */ dev_dbg(i2c->dev, "READ: Send Stop\n"); s3c24xx_i2c_stop(i2c, 0); } else { /* go to the next transfer */ dev_dbg(i2c->dev, "READ: Next Transfer\n"); i2c->msg_ptr = 0; i2c->msg_idx++; i2c->msg++; } } break; } /* acknowlegde the IRQ and get back on with the work */ out_ack: tmp = readl(i2c->regs + S3C2410_IICCON); tmp &= ~S3C2410_IICCON_IRQPEND; writel(tmp, i2c->regs + S3C2410_IICCON); out: return ret; } /* s3c24xx_i2c_irq * * top level IRQ servicing routine */ static irqreturn_t s3c24xx_i2c_irq(int irqno, void *dev_id) { struct s3c24xx_i2c *i2c = dev_id; unsigned long status; unsigned long tmp; status = readl(i2c->regs + S3C2410_IICSTAT); if (status & S3C2410_IICSTAT_ARBITR) { /* deal with arbitration loss */ dev_err(i2c->dev, "deal with arbitration loss\n"); } if (i2c->state == STATE_IDLE) { dev_dbg(i2c->dev, "IRQ: error i2c->state == IDLE\n"); tmp = readl(i2c->regs + S3C2410_IICCON); tmp &= ~S3C2410_IICCON_IRQPEND; writel(tmp, i2c->regs + S3C2410_IICCON); goto out; } /* pretty much this leaves us with the fact that we've * transmitted or received whatever byte we last sent */ i2s_s3c_irq_nextbyte(i2c, status); out: return IRQ_HANDLED; } /* s3c24xx_i2c_set_master * * get the i2c bus for a master transaction */ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c) { unsigned long iicstat; int timeout = 400; while (timeout-- > 0) { iicstat = readl(i2c->regs + S3C2410_IICSTAT); if (!(iicstat & S3C2410_IICSTAT_BUSBUSY)) return 0; msleep(1); } return -ETIMEDOUT; } /* s3c24xx_i2c_doxfer * * this starts an i2c transfer */ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num) { unsigned long iicstat, timeout; int spins = 20; int ret; if (i2c->suspended) return -EIO; ret = s3c24xx_i2c_set_master(i2c); if (ret != 0) { dev_err(i2c->dev, "cannot get bus (error %d)\n", ret); ret = -EAGAIN; goto out; } spin_lock_irq(&i2c->lock); i2c->msg = msgs; i2c->msg_num = num; i2c->msg_ptr = 0; i2c->msg_idx = 0; i2c->state = STATE_START; s3c24xx_i2c_enable_irq(i2c); s3c24xx_i2c_message_start(i2c, msgs); spin_unlock_irq(&i2c->lock); timeout = wait_event_timeout(i2c->wait, i2c->msg_num == 0, HZ * 5); ret = i2c->msg_idx; /* having these next two as dev_err() makes life very * noisy when doing an i2cdetect */ if (timeout == 0) dev_dbg(i2c->dev, "timeout\n"); else if (ret != num) dev_dbg(i2c->dev, "incomplete xfer (%d)\n", ret); /* ensure the stop has been through the bus */ dev_dbg(i2c->dev, "waiting for bus idle\n"); /* first, try busy waiting briefly */ do { iicstat = readl(i2c->regs + S3C2410_IICSTAT); } while ((iicstat & S3C2410_IICSTAT_START) && --spins); /* if that timed out sleep */ if (!spins) { msleep(1); iicstat = readl(i2c->regs + S3C2410_IICSTAT); } if (iicstat & S3C2410_IICSTAT_START) dev_warn(i2c->dev, "timeout waiting for bus idle\n"); out: return ret; } /* s3c24xx_i2c_xfer * * first port of call from the i2c bus code when an message needs * transferring across the i2c bus. */ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct s3c24xx_i2c *i2c = (struct s3c24xx_i2c *)adap->algo_data; int retry; int ret; for (retry = 0; retry < adap->retries; retry++) { ret = s3c24xx_i2c_doxfer(i2c, msgs, num); if (ret != -EAGAIN) return ret; dev_dbg(i2c->dev, "Retrying transmission (%d)\n", retry); udelay(100); } return -EREMOTEIO; } /* declare our i2c functionality */ static u32 s3c24xx_i2c_func(struct i2c_adapter *adap) { return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_PROTOCOL_MANGLING; } /* i2c bus registration info */ static const struct i2c_algorithm s3c24xx_i2c_algorithm = { .master_xfer = s3c24xx_i2c_xfer, .functionality = s3c24xx_i2c_func, }; /* s3c24xx_i2c_calcdivisor * * return the divisor settings for a given frequency */ static int s3c24xx_i2c_calcdivisor(unsigned long clkin, unsigned int wanted, unsigned int *div1, unsigned int *divs) { unsigned int calc_divs = clkin / wanted; unsigned int calc_div1; if (calc_divs > (16*16)) calc_div1 = 512; else calc_div1 = 16; calc_divs += calc_div1-1; calc_divs /= calc_div1; if (calc_divs == 0) calc_divs = 1; if (calc_divs > 17) calc_divs = 17; *divs = calc_divs; *div1 = calc_div1; return clkin / (calc_divs * calc_div1); } /* s3c24xx_i2c_clockrate * * work out a divisor for the user requested frequency setting, * either by the requested frequency, or scanning the acceptable * range of frequencies until something is found */ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) { struct s3c2410_platform_i2c *pdata = i2c->dev->platform_data; unsigned long clkin = clk_get_rate(i2c->clk); unsigned int divs, div1; unsigned long target_frequency; u32 iiccon; int freq; i2c->clkrate = clkin; clkin /= 1000; /* clkin now in KHz */ dev_dbg(i2c->dev, "pdata desired frequency %lu\n", pdata->frequency); target_frequency = pdata->frequency ? pdata->frequency : 100000; target_frequency /= 1000; /* Target frequency now in KHz */ freq = s3c24xx_i2c_calcdivisor(clkin, target_frequency, &div1, &divs); if (freq > target_frequency) { dev_err(i2c->dev, "Unable to achieve desired frequency %luKHz." \ " Lowest achievable %dKHz\n", target_frequency, freq); return -EINVAL; } *got = freq; iiccon = readl(i2c->regs + S3C2410_IICCON); iiccon &= ~(S3C2410_IICCON_SCALEMASK | S3C2410_IICCON_TXDIV_512); iiccon |= (divs-1); if (div1 == 512) iiccon |= S3C2410_IICCON_TXDIV_512; writel(iiccon, i2c->regs + S3C2410_IICCON); if (s3c24xx_i2c_is2440(i2c)) { unsigned long sda_delay; if (pdata->sda_delay) { sda_delay = clkin * pdata->sda_delay; sda_delay = DIV_ROUND_UP(sda_delay, 1000000); sda_delay = DIV_ROUND_UP(sda_delay, 5); if (sda_delay > 3) sda_delay = 3; sda_delay |= S3C2410_IICLC_FILTER_ON; } else sda_delay = 0; dev_dbg(i2c->dev, "IICLC=%08lx\n", sda_delay); writel(sda_delay, i2c->regs + S3C2440_IICLC); } return 0; } #ifdef CONFIG_CPU_FREQ #define freq_to_i2c(_n) container_of(_n, struct s3c24xx_i2c, freq_transition) static int s3c24xx_i2c_cpufreq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct s3c24xx_i2c *i2c = freq_to_i2c(nb); unsigned long flags; unsigned int got; int delta_f; int ret; delta_f = clk_get_rate(i2c->clk) - i2c->clkrate; /* if we're post-change and the input clock has slowed down * or at pre-change and the clock is about to speed up, then * adjust our clock rate. <0 is slow, >0 speedup. */ if ((val == CPUFREQ_POSTCHANGE && delta_f < 0) || (val == CPUFREQ_PRECHANGE && delta_f > 0)) { spin_lock_irqsave(&i2c->lock, flags); ret = s3c24xx_i2c_clockrate(i2c, &got); spin_unlock_irqrestore(&i2c->lock, flags); if (ret < 0) dev_err(i2c->dev, "cannot find frequency\n"); else dev_info(i2c->dev, "setting freq %d\n", got); } return 0; } static inline int s3c24xx_i2c_register_cpufreq(struct s3c24xx_i2c *i2c) { i2c->freq_transition.notifier_call = s3c24xx_i2c_cpufreq_transition; return cpufreq_register_notifier(&i2c->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); } static inline void s3c24xx_i2c_deregister_cpufreq(struct s3c24xx_i2c *i2c) { cpufreq_unregister_notifier(&i2c->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); } #else static inline int s3c24xx_i2c_register_cpufreq(struct s3c24xx_i2c *i2c) { return 0; } static inline void s3c24xx_i2c_deregister_cpufreq(struct s3c24xx_i2c *i2c) { } #endif /* s3c24xx_i2c_init * * initialise the controller, set the IO lines and frequency */ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c) { unsigned long iicon = S3C2410_IICCON_IRQEN | S3C2410_IICCON_ACKEN; struct s3c2410_platform_i2c *pdata; unsigned int freq; /* get the plafrom data */ pdata = i2c->dev->platform_data; /* inititalise the gpio */ if (pdata->cfg_gpio) pdata->cfg_gpio(to_platform_device(i2c->dev)); /* write slave address */ writeb(pdata->slave_addr, i2c->regs + S3C2410_IICADD); dev_info(i2c->dev, "slave address 0x%02x\n", pdata->slave_addr); writel(iicon, i2c->regs + S3C2410_IICCON); /* we need to work out the divisors for the clock... */ if (s3c24xx_i2c_clockrate(i2c, &freq) != 0) { writel(0, i2c->regs + S3C2410_IICCON); dev_err(i2c->dev, "cannot meet bus frequency required\n"); return -EINVAL; } /* todo - check that the i2c lines aren't being dragged anywhere */ dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq); dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon); return 0; } /* s3c24xx_i2c_probe * * called by the bus driver when a suitable device is found */ static int s3c24xx_i2c_probe(struct platform_device *pdev) { struct s3c24xx_i2c *i2c; struct s3c2410_platform_i2c *pdata; struct resource *res; int ret; pdata = pdev->dev.platform_data; if (!pdata) { dev_err(&pdev->dev, "no platform data\n"); return -EINVAL; } i2c = kzalloc(sizeof(struct s3c24xx_i2c), GFP_KERNEL); if (!i2c) { dev_err(&pdev->dev, "no memory for state\n"); return -ENOMEM; } strlcpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name)); i2c->adap.owner = THIS_MODULE; i2c->adap.algo = &s3c24xx_i2c_algorithm; i2c->adap.retries = 2; i2c->adap.class = I2C_CLASS_HWMON | I2C_CLASS_SPD; i2c->tx_setup = 50; spin_lock_init(&i2c->lock); init_waitqueue_head(&i2c->wait); /* find the clock and enable it */ i2c->dev = &pdev->dev; i2c->clk = clk_get(&pdev->dev, "i2c"); if (IS_ERR(i2c->clk)) { dev_err(&pdev->dev, "cannot get clock\n"); ret = -ENOENT; goto err_noclk; } dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk); clk_enable(i2c->clk); /* map the registers */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) { dev_err(&pdev->dev, "cannot find IO resource\n"); ret = -ENOENT; goto err_clk; } i2c->ioarea = request_mem_region(res->start, resource_size(res), pdev->name); if (i2c->ioarea == NULL) { dev_err(&pdev->dev, "cannot request IO\n"); ret = -ENXIO; goto err_clk; } i2c->regs = ioremap(res->start, resource_size(res)); if (i2c->regs == NULL) { dev_err(&pdev->dev, "cannot map IO\n"); ret = -ENXIO; goto err_ioarea; } dev_dbg(&pdev->dev, "registers %p (%p, %p)\n", i2c->regs, i2c->ioarea, res); /* setup info block for the i2c core */ i2c->adap.algo_data = i2c; i2c->adap.dev.parent = &pdev->dev; /* initialise the i2c controller */ ret = s3c24xx_i2c_init(i2c); if (ret != 0) goto err_iomap; /* find the IRQ for this unit (note, this relies on the init call to * ensure no current IRQs pending */ i2c->irq = ret = platform_get_irq(pdev, 0); if (ret <= 0) { dev_err(&pdev->dev, "cannot find IRQ\n"); goto err_iomap; } ret = request_irq(i2c->irq, s3c24xx_i2c_irq, IRQF_DISABLED, dev_name(&pdev->dev), i2c); if (ret != 0) { dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq); goto err_iomap; } ret = s3c24xx_i2c_register_cpufreq(i2c); if (ret < 0) { dev_err(&pdev->dev, "failed to register cpufreq notifier\n"); goto err_irq; } /* Note, previous versions of the driver used i2c_add_adapter() * to add the bus at any number. We now pass the bus number via * the platform data, so if unset it will now default to always * being bus 0. */ i2c->adap.nr = pdata->bus_num; ret = i2c_add_numbered_adapter(&i2c->adap); if (ret < 0) { dev_err(&pdev->dev, "failed to add bus to i2c core\n"); goto err_cpufreq; } platform_set_drvdata(pdev, i2c); dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev)); return 0; err_cpufreq: s3c24xx_i2c_deregister_cpufreq(i2c); err_irq: free_irq(i2c->irq, i2c); err_iomap: iounmap(i2c->regs); err_ioarea: release_resource(i2c->ioarea); kfree(i2c->ioarea); err_clk: clk_disable(i2c->clk); clk_put(i2c->clk); err_noclk: kfree(i2c); return ret; } /* s3c24xx_i2c_remove * * called when device is removed from the bus */ static int s3c24xx_i2c_remove(struct platform_device *pdev) { struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); s3c24xx_i2c_deregister_cpufreq(i2c); i2c_del_adapter(&i2c->adap); free_irq(i2c->irq, i2c); clk_disable(i2c->clk); clk_put(i2c->clk); iounmap(i2c->regs); release_resource(i2c->ioarea); kfree(i2c->ioarea); kfree(i2c); return 0; } #ifdef CONFIG_PM static int s3c24xx_i2c_suspend_noirq(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); i2c->suspended = 1; return 0; } static int s3c24xx_i2c_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); i2c->suspended = 0; s3c24xx_i2c_init(i2c); return 0; } static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { .suspend_noirq = s3c24xx_i2c_suspend_noirq, .resume = s3c24xx_i2c_resume, }; #define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops) #else #define S3C24XX_DEV_PM_OPS NULL #endif /* device driver for platform bus bits */ static struct platform_device_id s3c24xx_driver_ids[] = { { .name = "s3c2410-i2c", .driver_data = TYPE_S3C2410, }, { .name = "s3c2440-i2c", .driver_data = TYPE_S3C2440, }, { }, }; MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids); static struct platform_driver s3c24xx_i2c_driver = { .probe = s3c24xx_i2c_probe, .remove = s3c24xx_i2c_remove, .id_table = s3c24xx_driver_ids, .driver = { .owner = THIS_MODULE, .name = "s3c-i2c", .pm = S3C24XX_DEV_PM_OPS, }, }; static int __init i2c_adap_s3c_init(void) { return platform_driver_register(&s3c24xx_i2c_driver); } subsys_initcall(i2c_adap_s3c_init); static void __exit i2c_adap_s3c_exit(void) { platform_driver_unregister(&s3c24xx_i2c_driver); } module_exit(i2c_adap_s3c_exit); MODULE_DESCRIPTION("S3C24XX I2C Bus driver"); MODULE_AUTHOR("Ben Dooks, <[email protected]>"); MODULE_LICENSE("GPL");
dengbiao/tc_kernel_linux
drivers/i2c/busses/i2c-s3c2410.c
C
gpl-2.0
23,087
# Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz.org # 2010-2011 Large Blue # Fergus Doyle: [email protected] # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version 2 as published # by the Free Software Foundation. You may not use, modify or distribute # this program under any other version of the GNU General Public License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. from zope.interface import implements from repoze.folder import Folder from opencore.models.interfaces import ICommunity from opencore.models.interfaces import ICommunities from opencore.models.members import Members from opencore.utils import find_users class Community(Folder): implements(ICommunity) _members_group = 'group.community:%s:members' _moderators_group = 'group.community:%s:moderators' default_tool = '' # means default tab (overview) content_modified = None # will be set by subscriber modified_by = None def __init__(self, title, description, text=u'', creator=u''): super(Community, self).__init__() self.title = unicode(title) self.description = unicode(description) if text is None: self.text = u'' else: self.text = unicode(text) self.creator = self.modified_by = creator self['members'] = members = Members() @property def members_group_name(self): return self._members_group % self.__name__ @property def moderators_group_name(self): return self._moderators_group % self.__name__ @property def number_of_members(self): return len(self.member_names) @property def member_names(self): name = self._members_group % self.__name__ return self._get_group_names(name) @property def moderator_names(self): name = self._moderators_group % self.__name__ return self._get_group_names(name) def _get_group_names(self, group): users = find_users(self) names = users.users_in_group(group) return set(names) class CommunitiesFolder(Folder): implements(ICommunities) title = 'Communities'
damilare/opencore
opencore/models/community.py
Python
gpl-2.0
2,706
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.alter_column('todolists', 'date_added', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True)) def backwards(self, orm): db.alter_column('todolists', 'date_added', self.gf('django.db.models.fields.DateField')(auto_now_add=True)) models = { 'auth.group': { 'Meta': {'object_name': 'Group'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, 'auth.permission': { 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, 'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, 'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, 'main.arch': { 'Meta': {'ordering': "['name']", 'object_name': 'Arch', 'db_table': "'arches'"}, 'agnostic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) }, 'main.donor': { 'Meta': {'ordering': "['name']", 'object_name': 'Donor', 'db_table': "'donors'"}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) }, 'main.package': { 'Meta': {'ordering': "('pkgname',)", 'object_name': 'Package', 'db_table': "'packages'"}, 'arch': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Arch']"}), 'build_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'compressed_size': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}), 'epoch': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'files_last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'flag_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'installed_size': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}), 'last_update': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), 'packager_str': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'pkgbase': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), 'pkgdesc': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), 'pkgname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'repo': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'packages'", 'to': "orm['main.Repo']"}), 'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) }, 'main.packagedepend': { 'Meta': {'object_name': 'PackageDepend', 'db_table': "'package_depends'"}, 'depname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), 'depvcmp': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'optional': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}) }, 'main.packagefile': { 'Meta': {'object_name': 'PackageFile', 'db_table': "'package_files'"}, 'directory': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_directory': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}) }, 'main.repo': { 'Meta': {'ordering': "['name']", 'object_name': 'Repo', 'db_table': "'repos'"}, 'bugs_project': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), 'svn_root': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) }, 'main.signoff': { 'Meta': {'object_name': 'Signoff'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'packager': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}), 'pkgrel': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'pkgver': ('django.db.models.fields.CharField', [], {'max_length': '255'}) }, 'main.todolist': { 'Meta': {'object_name': 'Todolist', 'db_table': "'todolists'"}, 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}) }, 'main.todolistpkg': { 'Meta': {'unique_together': "(('list', 'pkg'),)", 'object_name': 'TodolistPkg', 'db_table': "'todolist_pkgs'"}, 'complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'list': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Todolist']"}), 'pkg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['main.Package']"}) }, 'main.userprofile': { 'Meta': {'object_name': 'UserProfile', 'db_table': "'user_profiles'"}, 'alias': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'allowed_repos': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['main.Repo']", 'symmetrical': 'False', 'blank': 'True'}), 'favorite_distros': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'interests': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'languages': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), 'location': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), 'notify': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), 'other_contact': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'picture': ('django.db.models.fields.files.FileField', [], {'default': "'devs/silhouette.png'", 'max_length': '100'}), 'public_email': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'roles': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'time_zone': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '100'}), 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'userprofile'", 'unique': 'True', 'to': "orm['auth.User']"}), 'website': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'yob': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) } } complete_apps = ['main']
archhurd/archweb
main/migrations/0044_auto__chg_field_todolist_date_added.py
Python
gpl-2.0
12,236
/* Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'image2', 'el', { alt: 'Εναλλακτικό Κείμενο', btnUpload: 'Αποστολή στον Διακομιστή', captioned: 'Εικόνα με λεζάντα', captionPlaceholder: 'Λεζάντα', infoTab: 'Πληροφορίες Εικόνας', lockRatio: 'Κλείδωμα Αναλογίας', menu: 'Ιδιότητες Εικόνας', pathName: 'εικόνα', pathNameCaption: 'λεζάντα', resetSize: 'Επαναφορά Αρχικού Μεγέθους', resizer: 'Κάνετε κλικ και σύρετε το ποντίκι για να αλλάξετε το μέγεθος', title: 'Ιδιότητες Εικόνας', uploadTab: 'Αποστολή', urlMissing: 'Λείπει το πηγαίο URL της εικόνας.', altMissing: 'Alternative text is missing.' // MISSING } );
zyz963272311/testGitHub
test-spring-boot/xyz.zyzhu.test-spring-boot/src/main/resources/static/js/ckeditor/plugins/image2/lang/el.js
JavaScript
gpl-2.0
1,013
/* Copyright 2017 Balz Guenat 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 "fc660c.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_INS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(1), KC_LEFT,KC_DOWN,KC_RGHT ), [1] = KEYMAP( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGUP,_______,_______, _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_END, KC_PGDN,_______,_______, _______, _______,_______,_______, _______, _______,_______,MO(1), _______,_______,_______ ) }; const uint16_t PROGMEM fn_actions[] = { };
Ungolianth/qmk_firmware
keyboards/fc660c/keymaps/default/keymap.c
C
gpl-2.0
2,074
#include "../../../src/phonon/../3rdparty/kdelibs/phonon/videowidget_p.h"
liuyanghejerry/qtextended
qtopiacore/qt/include/phonon/private/videowidget_p.h
C
gpl-2.0
74
/* * PuTTY miscellaneous Unix stuff */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <unistd.h> #include <sys/time.h> #include <sys/types.h> #include <pwd.h> #include "putty.h" long tickcount_offset = 0; unsigned long getticks(void) { struct timeval tv; gettimeofday(&tv, NULL); /* * We want to use milliseconds rather than microseconds, * because we need a decent number of them to fit into a 32-bit * word so it can be used for keepalives. */ return tv.tv_sec * 1000 + tv.tv_usec / 1000 + tickcount_offset; } Filename filename_from_str(const char *str) { Filename ret; strncpy(ret.path, str, sizeof(ret.path)); ret.path[sizeof(ret.path)-1] = '\0'; return ret; } const char *filename_to_str(const Filename *fn) { return fn->path; } int filename_equal(Filename f1, Filename f2) { return !strcmp(f1.path, f2.path); } int filename_is_null(Filename fn) { return !*fn.path; } #ifdef DEBUG static FILE *debug_fp = NULL; void dputs(char *buf) { if (!debug_fp) { debug_fp = fopen("debug.log", "w"); } write(1, buf, strlen(buf)); fputs(buf, debug_fp); fflush(debug_fp); } #endif char *get_username(void) { struct passwd *p; uid_t uid = getuid(); char *user, *ret = NULL; /* * First, find who we think we are using getlogin. If this * agrees with our uid, we'll go along with it. This should * allow sharing of uids between several login names whilst * coping correctly with people who have su'ed. */ user = getlogin(); setpwent(); if (user) p = getpwnam(user); else p = NULL; if (p && p->pw_uid == uid) { /* * The result of getlogin() really does correspond to * our uid. Fine. */ ret = user; } else { /* * If that didn't work, for whatever reason, we'll do * the simpler version: look up our uid in the password * file and map it straight to a name. */ p = getpwuid(uid); if (!p) return NULL; ret = p->pw_name; } endpwent(); return dupstr(ret); } /* * Display the fingerprints of the PGP Master Keys to the user. * (This is here rather than in uxcons because it's appropriate even for * Unix GUI apps.) */ void pgp_fingerprints(void) { fputs("These are the fingerprints of the PuTTY PGP Master Keys. They can\n" "be used to establish a trust path from this executable to another\n" "one. See the manual for more information.\n" "(Note: these fingerprints have nothing to do with SSH!)\n" "\n" "PuTTY Master Key (RSA), 1024-bit:\n" " " PGP_RSA_MASTER_KEY_FP "\n" "PuTTY Master Key (DSA), 1024-bit:\n" " " PGP_DSA_MASTER_KEY_FP "\n", stdout); } /* * Set FD_CLOEXEC on a file descriptor */ int cloexec(int fd) { int fdflags; fdflags = fcntl(fd, F_GETFD); if (fdflags == -1) return -1; return fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); } FILE *f_open(struct Filename filename, char const *mode, int is_private) { if (!is_private) { return fopen(filename.path, mode); } else { int fd; assert(mode[0] == 'w'); /* is_private is meaningless for read */ fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, 0700); if (fd < 0) return NULL; return fdopen(fd, mode); } }
hackpascal/line-is-not-emulator
src/puttyline/putty-0.60/unix/uxmisc.c
C
gpl-2.0
3,294
<?php /** * @package RedSHOP.Backend * @subpackage Model * * @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die; jimport('joomla.application.component.model'); require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/xmlhelper.php'; class xmlexport_detailModelxmlexport_detail extends JModel { public $_id = null; public $_data = null; public $_table_prefix = null; public function __construct() { parent::__construct(); $this->_table_prefix = '#__redshop_'; $array = JRequest::getVar('cid', 0, '', 'array'); $this->setId((int) $array[0]); } public function setId($id) { $this->_id = $id; $this->_data = null; } public function &getData() { if ($this->_loadData()) { } else { $this->_initData(); } return $this->_data; } public function _loadData() { $query = "SELECT x.* FROM " . $this->_table_prefix . "xml_export AS x " . "WHERE x.xmlexport_id=" . $this->_id; $this->_db->setQuery($query); $this->_data = $this->_db->loadObject(); return (boolean) $this->_data; } public function _initData() { if (empty($this->_data)) { $detail = new stdClass; $detail->xmlexport_id = 0; $detail->filename = null; $detail->display_filename = null; $detail->parent_name = null; $detail->element_name = null; $detail->section_type = null; $detail->auto_sync = 0; $detail->sync_on_request = 0; $detail->auto_sync_interval = null; $detail->xmlexport_filetag = null; $detail->stock_element_name = null; $detail->xmlexport_stocktag = null; $detail->xmlexport_billingtag = null; $detail->billing_element_name = null; $detail->xmlexport_shippingtag = null; $detail->shipping_element_name = null; $detail->xmlexport_orderitemtag = null; $detail->orderitem_element_name = null; $detail->xmlexport_prdextrafieldtag = null; $detail->prdextrafield_element_name = null; $detail->published = 0; $detail->use_to_all_users = 1; $detail->xmlexport_on_category = null; $this->_data = $detail; return (boolean) $this->_data; } return true; } /** * Method to store the information * * @access public * @return boolean */ public function store($data, $export = 0) { $resarray = array(); $xmlhelper = new xmlHelper; $data['xmlexport_on_category'] = @ implode(',', $data['xmlexport_on_category']); $row =& $this->getTable(); if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } if (!$row->xmlexport_on_category) { $row->xmlexport_on_category = ''; } $row->published = $data['xmlpublished']; if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); return false; } $xmlexport_ip_id = $data['xmlexport_ip_id']; $access_ipaddress = $data['access_ipaddress']; for ($i = 0; $i < count($xmlexport_ip_id); $i++) { if ($access_ipaddress[$i] != "") { if ($xmlexport_ip_id[$i] != 0) { $query = "UPDATE " . $this->_table_prefix . "xml_export_ipaddress " . "SET access_ipaddress='" . $access_ipaddress[$i] . "' " . "WHERE xmlexport_ip_id='" . $xmlexport_ip_id[$i] . "' "; } else { $query = "INSERT INTO " . $this->_table_prefix . "xml_export_ipaddress " . "(xmlexport_id, access_ipaddress) " . "VALUES " . "('" . $row->xmlexport_id . "', '" . $access_ipaddress[$i] . "') "; } $this->_db->setQuery($query); $this->_db->query(); } } if ($export == 1) { $filename = $xmlhelper->writeXMLExportFile($row->xmlexport_id); } return $row; } /** * Method to delete the records * * @access public * @return boolean */ public function delete($cid = array()) { $xmlhelper = new xmlHelper; if (count($cid)) { $cids = implode(',', $cid); for ($i = 0; $i < count($cid); $i++) { $result = $xmlhelper->getXMLExportInfo($cid[$i]); $rootpath = JPATH_COMPONENT_SITE . "/assets/xmlfile/export/" .$result->filename; if (is_file($rootpath)) { unlink($rootpath); } } $query = 'DELETE FROM ' . $this->_table_prefix . 'xml_export_log ' . 'WHERE xmlexport_id IN (' . $cids . ')'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } $query = 'DELETE FROM ' . $this->_table_prefix . 'xml_export_ipaddress ' . 'WHERE xmlexport_id IN (' . $cids . ')'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } $query = 'DELETE FROM ' . $this->_table_prefix . 'xml_export ' . 'WHERE xmlexport_id IN (' . $cids . ')'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } public function deleteIpAddress($xmlexport_ip_id = 0) { $query = 'DELETE FROM ' . $this->_table_prefix . 'xml_export_ipaddress ' . 'WHERE xmlexport_ip_id IN (' . $xmlexport_ip_id . ')'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } public function auto_syncpublish($cid = array(), $publish = 1) { if (count($cid)) { $cids = implode(',', $cid); $query = 'UPDATE ' . $this->_table_prefix . 'xml_export ' . ' SET auto_sync = ' . intval($publish) . ' WHERE xmlexport_id IN ( ' . $cids . ' )'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } public function usetoallpublish($cid = array(), $publish = 1) { if (count($cid)) { $cids = implode(',', $cid); $query = 'UPDATE ' . $this->_table_prefix . 'xml_export ' . ' SET use_to_all_users = ' . intval($publish) . ' WHERE xmlexport_id IN ( ' . $cids . ' )'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } /** * Method to publish the records * * @access public * @return boolean */ public function publish($cid = array(), $publish = 1) { if (count($cid)) { $cids = implode(',', $cid); $query = ' UPDATE ' . $this->_table_prefix . 'xml_export ' . ' SET published = ' . intval($publish) . ' WHERE xmlexport_id IN ( ' . $cids . ' )'; $this->_db->setQuery($query); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } public function getCategoryList() { $query = 'SELECT category_name AS text,category_id AS value FROM ' . $this->_table_prefix . 'category ' . 'WHERE published=1 '; $this->_db->setQuery($query); $list = $this->_db->loadObjectList(); return $list; } }
h1111586/Test
tmp/component/admin/models/xmlexport_detail.php
PHP
gpl-2.0
7,002
// ext3grep -- An ext3 file system investigation and undelete tool // //! @file location.cc Implementation of heuristic functions parent_directory and path_exists that use an (old) locate database output file. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC <[email protected]> // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef USE_PCH #include "sys.h" #include <sys/types.h> #include <regex.h> #include <iostream> #include <fstream> #include <string> #include <set> #include <vector> #include <map> #include <cassert> #endif #include "locate.h" class LocatePath { private: std::string M_path; mutable bool M_is_certainly_directory; public: LocatePath(void) : M_is_certainly_directory(false) { } LocatePath(std::string const& path, bool is_certainly_directory = false) : M_path(path), M_is_certainly_directory(is_certainly_directory) { } std::string const& path(void) const { return M_path; } bool is_certainly_directory(void) const { return M_is_certainly_directory; } void set_certainly_directory(void) const { M_is_certainly_directory = true; } }; struct LocatePathPred { bool operator()(LocatePath const& lp1, LocatePath const& lp2) const { return lp1.path() < lp2.path(); } }; typedef std::set<LocatePath, LocatePathPred> locatepaths_type; typedef std::vector<locatepaths_type::iterator> filename_to_locatepath_map_info_type; typedef std::map<std::string, filename_to_locatepath_map_info_type> filename_to_locatepath_map_type; locatepaths_type locatepaths; filename_to_locatepath_map_type filename_to_locatepath_map; static bool initialized = false; void load_locate_data(void) { std::ifstream infile; infile.open("locate_output"); if (!infile) std::cerr << "WARNING: Failed to open file 'locate_output'. See locate.cc\n"; std::string line; while (std::getline(infile, line)) { std::pair<locatepaths_type::iterator, bool> res = locatepaths.insert(LocatePath(line)); std::string::size_type pos = line.find_last_of('/'); if (pos != std::string::npos) { std::string dirname = line.substr(0, pos); // Use insert, in case the parent directory wasn't seen first. // Since it's a set, it will only be inserted if it isn't already there. locatepaths_type::iterator locatepath_iter = locatepaths.insert(LocatePath(dirname)).first; locatepath_iter->set_certainly_directory(); std::string filename = line.substr(pos + 1); filename_to_locatepath_map_type::iterator iter = filename_to_locatepath_map.find(filename); if (iter == filename_to_locatepath_map.end()) filename_to_locatepath_map[filename] = filename_to_locatepath_map_type::mapped_type(1, locatepath_iter); else iter->second.push_back(locatepath_iter); } } infile.close(); initialized = true; } #if 0 int const test_blocknr = 1418523; #endif std::string parent_directory(int #if 0 blocknr #endif , std::set<std::string> const& filenames) { if (!initialized) load_locate_data(); //#ifdef CARLO_WOODS_CASE This should be automatic now. // if (blocknr == 1016319 || blocknr == 1640008 || blocknr == 1640009) // return "lost+found"; // Google Earth junk. //#endif typedef std::map<std::string, std::pair<int, bool> > possible_directories_type; possible_directories_type possible_directories; for (std::set<std::string>::const_iterator filename_iter = filenames.begin(); filename_iter != filenames.end(); ++filename_iter) { filename_to_locatepath_map_type::iterator directories_iter = filename_to_locatepath_map.find(*filename_iter); if (directories_iter != filename_to_locatepath_map.end()) { int count = 0; possible_directories_type::iterator possible_directory_iter; for (filename_to_locatepath_map_type::mapped_type::iterator directory_iter = directories_iter->second.begin(); directory_iter != directories_iter->second.end(); ++directory_iter) { std::string const& path = (*directory_iter)->path(); std::string fullpath = path + '/' + *filename_iter; locatepaths_type::iterator iter = locatepaths.find(LocatePath(fullpath)); assert(iter != locatepaths.end()); if (iter->is_certainly_directory()) continue; ++count; possible_directory_iter = possible_directories.find(path); if (possible_directory_iter == possible_directories.end()) possible_directory_iter = possible_directories.insert(possible_directories_type::value_type(path, std::pair<int, bool>(1, false))).first; else ++(possible_directories[path].first); } if (count == 1) possible_directory_iter->second.second = true; } } int maxhits = 0; int total = filenames.size(); std::string result; for (possible_directories_type::iterator possible_directory_iter = possible_directories.begin(); possible_directory_iter != possible_directories.end(); ++possible_directory_iter) { int hits = possible_directory_iter->second.first + (possible_directory_iter->second.second ? 1 : 0); double percentage = 100.0 * hits / total; double threshold = possible_directory_iter->second.second ? 10 : 70; #if 0 if (blocknr == test_blocknr) std::cout << hits << " (" << percentage << "% of the files) match " << possible_directory_iter->first << '\n'; #endif if (hits >= maxhits && percentage >= threshold) { if (hits > maxhits || possible_directory_iter->first.size() < result.size()) { maxhits = hits; result = possible_directory_iter->first; } } } if (maxhits == 0) { // EDIT THIS TO SUITE YOUR NEEDS! // The format is: "regular expression of files", "parent directory" // You can set test_blocknr and uncomment the #if 0'd code below to debug your regular expressions. static struct { char const* regexp; char const* path; } table[] = { //#ifdef CARLO_WOODS_CASE This should be automatic now. // { "^([0-9]{10}-[0-9]{3,5}-[0-9]+|11c0a8020[0-9]{28})\\.ms$", "carlo/k3b/temp" }, // { "^1[12][0-9]{11}_(AutoSpeedSearchHistory|SpeedMan|seltrace|thread|alerts|debug)_[12]\\.log$", "carlo/.azureus/logs/save" }, // { "^opr0[0-9][0-9A-Z]{3}\\.(js|ico|htm|gif|png|html|jpeg|xml|flv|css|swf|jpg)$", "lost+found" }, // { "\\.(md5|eps|tex)$", "lost+found" } //#endif }; regex_t preg; int re_end = sizeof(table) / sizeof(table[0]); for (int re = 0; re < re_end; ++re) { int hits = 0; regcomp(&preg, table[re].regexp, REG_EXTENDED|REG_NOSUB); for (std::set<std::string>::const_iterator filename_iter = filenames.begin(); filename_iter != filenames.end(); ++filename_iter) { #if 0 if (blocknr == test_blocknr) std::cout << "Matching \"" << filename_iter->c_str() << "\" against \"" << table[re].regexp << "\": "; #endif if (regexec(&preg, filename_iter->c_str(), 0, NULL, 0) == 0) { #if 0 if (blocknr == test_blocknr) std::cout << "match!\n"; #endif ++hits; } #if 0 else if (blocknr == test_blocknr) std::cout << " no match.\n"; #endif } regfree(&preg); #if 0 if (blocknr == test_blocknr) std::cout << (100.0 * hits / total) << "% matched regular expression #" << re << ".\n"; #endif if (100.0 * hits / total > 90) return table[re].path; } } return result; } bool path_exists(std::string const& path) { if (!initialized) load_locate_data(); locatepaths_type::iterator iter = locatepaths.find(LocatePath(path)); return iter != locatepaths.end(); }
gcode-mirror/ext3grep
src/locate.cc
C++
gpl-2.0
8,252
/* arch/arm/mach-msm/htc_mnemosyne.h * Copyright (C) 2013 HTC Corporation. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __MACH_MNEMOSYNE_H #define __MACH_MNEMOSYNE_H #define MNEMOSYNE_ELEMENT_TYPE uint32_t #define MNEMOSYNE_ELEMENT_SIZE 4 #define MNEMOSYNE_ELEMENT_SIZE_BIT_SHIFT 2 #ifdef __ASSEMBLY__ #include <linux/linkage.h> #include <linux/threads.h> #include <mach/msm_iomap.h> #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define DECLARE_MNEMOSYNE_START() #define DECLARE_MNEMOSYNE(name) ASM_ENUM mnemosyne_##name #define DECLARE_MNEMOSYNE_ARRAY(name, number) ASM_ENUM_ARRAY mnemosyne_##name, number .SET LAST_ENUM_VALUE, 0 .MACRO ASM_ENUM_ARRAY name, number .EQUIV \name, LAST_ENUM_VALUE * MNEMOSYNE_ELEMENT_SIZE .SET LAST_ENUM_VALUE, LAST_ENUM_VALUE + \number .ENDM .MACRO ASM_ENUM name ASM_ENUM_ARRAY \name, 1 .ENDM #define DECLARE_MNEMOSYNE_END() #else #include <linux/kernel.h> #include <linux/module.h> #include <asm/uaccess.h> #define DECLARE_MNEMOSYNE_START() struct mnemosyne_data { #define DECLARE_MNEMOSYNE(name) MNEMOSYNE_ELEMENT_TYPE name; #define DECLARE_MNEMOSYNE_ARRAY(name, number) MNEMOSYNE_ELEMENT_TYPE name[number]; #define DECLARE_MNEMOSYNE_END() }; #endif #include <mach/htc_mnemosyne_footprint.inc> #ifndef __ASSEMBLY__ #define MNEMOSYNE_SET(f, v) do { \ if (mnemosyne_get_base()) {mnemosyne_get_base()->f = (MNEMOSYNE_ELEMENT_TYPE )(v);} \ } while(0); #define MNEMOSYNE_SET_I(f, i, v) do { \ if (mnemosyne_get_base()) {mnemosyne_get_base()->f[i] = (MNEMOSYNE_ELEMENT_TYPE)(v);} \ } while(0); #define MNEMOSYNE_GET(f) ((mnemosyne_get_base())?mnemosyne_get_base()->f:0) #define MNEMOSYNE_GET_ADDR(f) ((mnemosyne_get_base())?&mnemosyne_get_base()->f:NULL) #define MNEMOSYNE_GET_I(f, i) ((mnemosyne_get_base())?mnemosyne_get_base()->f[i]:0) #define MNEMOSYNE_GET_ADDR_I(f, i) ((mnemosyne_get_base())?&mnemosyne_get_base()->f[i]:NULL) struct mnemosyne_platform_data { u32 phys; u32 base; }; struct mnemosyne_data *mnemosyne_get_base(void); int mnemosyne_early_init(unsigned int phys, unsigned base); #endif #endif
qtekfun/htcDesire820Kernel
kernel/arch/arm/mach-msm/include/mach/htc_mnemosyne.h
C
gpl-2.0
2,553
<?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\Product\Attribute\Source; /** * Catalog product landing page attribute source * * @author Magento Core Team <[email protected]> */ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** * @var \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface */ protected $pageLayoutBuilder; /** * @param \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder */ public function __construct(\Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder) { $this->pageLayoutBuilder = $pageLayoutBuilder; } /** * @return array */ public function getAllOptions() { if (!$this->_options) { $this->_options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray(); array_unshift($this->_options, ['value' => '', 'label' => __('No layout updates')]); } return $this->_options; } }
FPLD/project0
vendor/magento/module-catalog/Model/Product/Attribute/Source/Layout.php
PHP
gpl-2.0
1,147
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, [email protected] This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ #include <cmath> #include "pair_buck_coul_cut_omp.h" #include "atom.h" #include "comm.h" #include "force.h" #include "neighbor.h" #include "neigh_list.h" #include "suffix.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairBuckCoulCutOMP::PairBuckCoulCutOMP(LAMMPS *lmp) : PairBuckCoulCut(lmp), ThrOMP(lmp, THR_PAIR) { suffix_flag |= Suffix::OMP; respa_enable = 0; } /* ---------------------------------------------------------------------- */ void PairBuckCoulCutOMP::compute(int eflag, int vflag) { if (eflag || vflag) { ev_setup(eflag,vflag); } else evflag = vflag_fdotr = 0; const int nall = atom->nlocal + atom->nghost; const int nthreads = comm->nthreads; const int inum = list->inum; #if defined(_OPENMP) #pragma omp parallel default(none) shared(eflag,vflag) #endif { int ifrom, ito, tid; loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr); if (evflag) { if (eflag) { if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr); else eval<1,1,0>(ifrom, ito, thr); } else { if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr); else eval<1,0,0>(ifrom, ito, thr); } } else { if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr); else eval<0,0,0>(ifrom, ito, thr); } thr->timer(Timer::PAIR); reduce_thr(this, eflag, vflag, thr); } // end of omp parallel region } /* ---------------------------------------------------------------------- */ template <int EVFLAG, int EFLAG, int NEWTON_PAIR> void PairBuckCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr) { int i,j,ii,jj,jnum,itype,jtype; double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair; double rsq,r2inv,r6inv,r,rexp,forcecoul,forcebuck,factor_coul,factor_lj; int *ilist,*jlist,*numneigh,**firstneigh; evdwl = ecoul = 0.0; const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; int *type = atom->type; int nlocal = atom->nlocal; double *special_coul = force->special_coul; double *special_lj = force->special_lj; double qqrd2e = force->qqrd2e; double fxtmp,fytmp,fztmp; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; // loop over neighbors of my atoms for (ii = iifrom; ii < iito; ++ii) { i = ilist[ii]; qtmp = q[i]; xtmp = x[i].x; ytmp = x[i].y; ztmp = x[i].z; itype = type[i]; jlist = firstneigh[i]; jnum = numneigh[i]; fxtmp=fytmp=fztmp=0.0; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_lj = special_lj[sbmask(j)]; factor_coul = special_coul[sbmask(j)]; j &= NEIGHMASK; delx = xtmp - x[j].x; dely = ytmp - x[j].y; delz = ztmp - x[j].z; rsq = delx*delx + dely*dely + delz*delz; jtype = type[j]; if (rsq < cutsq[itype][jtype]) { r2inv = 1.0/rsq; r = sqrt(rsq); if (rsq < cut_coulsq[itype][jtype]) forcecoul = qqrd2e * qtmp*q[j]/r; else forcecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { r6inv = r2inv*r2inv*r2inv; rexp = exp(-r*rhoinv[itype][jtype]); forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv; } else forcebuck = 0.0; fpair = (forcecoul + factor_lj*forcebuck)*r2inv; fxtmp += delx*fpair; fytmp += dely*fpair; fztmp += delz*fpair; if (NEWTON_PAIR || j < nlocal) { f[j].x -= delx*fpair; f[j].y -= dely*fpair; f[j].z -= delz*fpair; } if (EFLAG) { if (rsq < cut_coulsq[itype][jtype]) ecoul = factor_coul * qqrd2e * qtmp*q[j]/r; else ecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv - offset[itype][jtype]; evdwl *= factor_lj; } else evdwl = 0.0; } if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR, evdwl,ecoul,fpair,delx,dely,delz,thr); } } f[i].x += fxtmp; f[i].y += fytmp; f[i].z += fztmp; } } /* ---------------------------------------------------------------------- */ double PairBuckCoulCutOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairBuckCoulCut::memory_usage(); return bytes; }
ibethune/lammps
src/USER-OMP/pair_buck_coul_cut_omp.cpp
C++
gpl-2.0
5,258
<?php if( !class_exists( 'CD_FBSP_Recommends_Widget' ) ) { class CD_FBSP_Recommends_Widget extends WP_Widget { function CD_FBSP_Recommends_Widget() { $widget_ops = array( 'classname' => 'cd-fb-recommendation-widget', 'description' => __( 'Displays a Facebook Recommendations Box', 'cd-fbspw' ) ); $this->WP_Widget( 'CD_FBSP_Recommends_Widget', __( 'Facebook Recommendations', 'cd-fbspw' ), $widget_ops ); } function form( $instance ) { $defaults = array( 'title' => 'Top Articles', 'url' => get_bloginfo('url'), 'width' => 300, 'height' => 300, 'border_color' => '', 'color_scheme' => 'light', 'show_header' => 'off', 'font' => '', ); $instance = wp_parse_args( (array) $instance, $defaults ); extract( $instance ); ?> <p> <label for="cd-fbr-title"><?php _e( 'Title:', 'cd-fbspw' ); ?></label> <input id="cd-fbr-title" class="widefat" name="<?php echo $this-> get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> </p> <p> <label for="cd-fbr-url"><?php _e( 'Domain:', 'cd-fbspw' ); ?></label> <input id="cd-fbr-url" class="widefat" name="<?php echo $this-> get_field_name( 'url' ); ?>" type="text" value="<?php echo esc_attr( $url ); ?>" /> </p> <p> <label for="cd-fbr-width"><?php _e( 'Width:', 'cd-fbspw' ); ?></label> <input id="cd-fbr-width" class="widefat" name="<?php echo $this->get_field_name( 'width' ); ?>" type="text" value="<?php echo esc_attr( $width ); ?>" /> </p> <p> <label for="cd-fbr-height"><?php _e( 'Height:', 'cd-fbspw' ); ?></label> <input id="cd-fbr-height" class="widefat" name="<?php echo $this->get_field_name( 'height' ); ?>" type="text" value="<?php echo esc_attr( $height ); ?>" /> </p> <p> <label for="cd-fbr-border"><?php _e( 'Border Color:', 'cd-fbspw' ); ?></label> <input id="cd-fbr-border" class="widefat" name="<?php echo $this->get_field_name( 'border_color' ); ?>" type="text" value="<?php echo esc_attr( $border_color ); ?>" /> </p> <p> <label for="cd-fbr-color"><?php _e( 'Color Scheme:', 'cd-fbspw' ); ?></label> <select id="cd-fbr-color" name="<?php echo $this->get_field_name( 'color_scheme' ); ?>"> <option value="light" <?php selected( $color_scheme, 'light' ); ?>><?php _e( 'Light', 'cd-fbspw'); ?></option> <option value="dark" <?php selected( $color_scheme, 'dark' ); ?>><?php _e( 'Dark', 'cd-fbspw' ); ?></option> </select> </p> <p> <label for="cd-fbr-font"><?php _e( 'Font:', 'cd-fbspw' ); ?></label> <select id="cd-fbr-font" name="<?php echo $this->get_field_name( 'font' ); ?>"> <option value="" <?php selected( $font, '' ); ?>>&nbsp;</option> <option value="arial" <?php selected( $font, 'arial' ); ?>>Arial</option> <option value="lucida grande" <?php selected( $font, 'lucida grande' ); ?>>Lucida Grande</option> <option value="segoe ui" <?php selected( $font, 'segoe ui' ); ?>>Segoe ui</option> <option value="tahoma" <?php selected( $font, 'tahoma' ); ?>>Tahoma</option> <option value="trebuchet ms" <?php selected( $font, 'trebuchet ms' ); ?>>Trebuchet ms</option> <option value="verdana" <?php selected( $font, 'verdana' ); ?>>Verdana</option> </select> </p> <p> <input id="cd-fbr-header" name="<?php echo $this->get_field_name( 'show_header' ); ?>" type="checkbox" <?php checked( $show_header, 'on' ); ?> /> <label for="cd-fbr-header"><?php _e( 'Check to show the facebook header', 'cd-fbspw' ); ?></label> </p> <?php } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = isset( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; $instance['url'] = isset( $new_instance['url'] ) ? esc_url( $new_instance['url'], array( 'http', 'https' ) ) : ''; $instance['width'] = isset( $new_instance['width'] ) ? absint( $new_instance['width'] ) : 300; $instance['height'] = isset( $new_instance['height'] ) ? absint( $new_instance['height'] ) : 400; $instance['border_color'] = isset( $new_instance['border_color'] ) ? strip_tags( $new_instance['border_color'] ) : ''; $instance['color_scheme'] = strip_tags( $new_instance['color_scheme'] ); $instance['font'] = isset( $new_instance['font'] ) ? strip_tags( $new_instance['font'] ) : ''; $instance['show_header'] = isset( $new_instance['show_header'] ) && $new_instance['show_header'] ? 'on' : 'off'; return $instance; } function widget( $args, $instance ) { extract( $args ); // Get our widget variables $title = apply_filters( 'widget_title', $instance['title'] ); $width = empty( $instance['width'] ) ? ' width="300"' : ' width="' . $instance['width'] . '"'; $height = empty( $instance['height'] ) ? ' height="300"' : ' height="' . $instance['height'] . '"'; $url = empty( $instance['url'] ) ? ' site="http://wordpress.org/"' : ' site="' . $instance['url'] . '"'; $border = empty( $instance['border_color'] ) ? ' border_color=""' : ' border_color="' . $instance['border_color'] . '"'; $color = $instance['color_scheme'] == 'light' ? '' : ' colorscheme="dark"'; $font = empty( $instance['font'] ) ? '' : ' font="'. $instance['font'] . '"'; $header = $instance['show_header'] == 'on' ? ' header="true"' : ' header="false"'; // Render the widget echo $before_widget; if( !empty( $title ) ) { echo $before_title . $title . $after_title; } echo '<fb:recommendations' . $url . $width . $height . $border . $color . $font . $header . '></fb:recommendations>'; echo $after_widget; } } // end class /** * Register the widget here to make sure we get the right class... */ add_action( 'widgets_init', 'cd_fbsp_recommends_register' ); function cd_fbsp_recommends_register() { register_widget( 'CD_FBSP_Recommends_Widget' ); } } // end class_exists
mgenev/hannastables
wp-content/plugins/facebook-social-plugin-widgets/includes/class-fb-recommends.php
PHP
gpl-2.0
5,948
// { dg-do compile { target c++11 } } // Copyright (C) 2011-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. // NB: This file is for testing type_traits with NO OTHER INCLUDES. #include <type_traits> namespace std { typedef short test_type; template struct is_nothrow_move_constructible<test_type>; }
Gurgel100/gcc
libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/explicit_instantiation.cc
C++
gpl-2.0
1,001
/* Copyright (C) 1991,1992,1995,1996,1997,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <stddef.h> #include <unistd.h> #include <sys/types.h> #include <limits.h> /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ int __getgroups (size, list) int size; gid_t *list; { #if defined (NGROUPS_MAX) && NGROUPS_MAX == 0 /* The system has no supplementary groups. */ return 0; #endif __set_errno (ENOSYS); return -1; } #if !(defined (NGROUPS_MAX) && NGROUPS_MAX == 0) stub_warning (getgroups); #endif weak_alias (__getgroups, getgroups)
pirix/glibc-pirix
posix/getgroups.c
C
gpl-2.0
1,451
<?php namespace TYPO3\CMS\Extbase\Mvc\Web; /* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ /** * Represents a web request. * * @api */ class Request extends \TYPO3\CMS\Extbase\Mvc\Request { /** * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService */ protected $hashService; /** * @var string The requested representation format */ protected $format = 'html'; /** * @var string Contains the request method */ protected $method = 'GET'; /** * @var string */ protected $requestUri; /** * @var string The base URI for this request - ie. the host and path leading to the index.php */ protected $baseUri; /** * @var bool TRUE if the current request is cached, false otherwise. */ protected $isCached = false; /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface */ protected $configurationManager; /** * @var \TYPO3\CMS\Extbase\Service\EnvironmentService */ protected $environmentService; /** * @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService */ public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService) { $this->hashService = $hashService; } /** * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager */ public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) { $this->configurationManager = $configurationManager; } /** * @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService */ public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) { $this->environmentService = $environmentService; } /** * Sets the request method * * @param string $method Name of the request method * @return void * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidRequestMethodException if the request method is not supported */ public function setMethod($method) { if ($method === '' || strtoupper($method) !== $method) { throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidRequestMethodException('The request method "' . $method . '" is not supported.', 1217778382); } $this->method = $method; } /** * Returns the name of the request method * * @return string Name of the request method * @api */ public function getMethod() { return $this->method; } /** * Sets the request URI * * @param string $requestUri URI of this web request * @return void */ public function setRequestUri($requestUri) { $this->requestUri = $requestUri; } /** * Returns the request URI * * @return string URI of this web request * @api */ public function getRequestUri() { return $this->requestUri; } /** * Sets the base URI for this request. * * @param string $baseUri New base URI * @return void */ public function setBaseUri($baseUri) { $this->baseUri = $baseUri; } /** * Returns the base URI * * @return string Base URI of this web request * @api */ public function getBaseUri() { if ($this->environmentService->isEnvironmentInBackendMode()) { return $this->baseUri . TYPO3_mainDir; } else { return $this->baseUri; } } /** * Set if the current request is cached. * * @param bool $isCached */ public function setIsCached($isCached) { $this->isCached = (bool)$isCached; } /** * Return whether the current request is a cached request or not. * * @api (v4 only) * @return bool the caching status. */ public function isCached() { return $this->isCached; } /** * Get a freshly built request object pointing to the Referrer. * * @return ReferringRequest the referring request, or null if no referrer found */ public function getReferringRequest() { if (isset($this->internalArguments['__referrer']['@request'])) { $referrerArray = unserialize($this->hashService->validateAndStripHmac($this->internalArguments['__referrer']['@request'])); $arguments = []; if (isset($this->internalArguments['__referrer']['arguments'])) { // This case is kept for compatibility in 7.6 and 6.2, but will be removed in 8 $arguments = unserialize(base64_decode($this->hashService->validateAndStripHmac($this->internalArguments['__referrer']['arguments']))); } $referringRequest = new ReferringRequest(); $referringRequest->setArguments(\TYPO3\CMS\Extbase\Utility\ArrayUtility::arrayMergeRecursiveOverrule($arguments, $referrerArray)); return $referringRequest; } return null; } }
ahmedRguei/job
typo3/sysext/extbase/Classes/Mvc/Web/Request.php
PHP
gpl-2.0
5,557
/* * This handles recursive filename detection with exclude * files, index knowledge etc.. * * Copyright (C) Linus Torvalds, 2005-2006 * Junio Hamano, 2005-2006 */ #include "cache.h" #include "dir.h" #include "refs.h" struct path_simplify { int len; const char *path; }; static int read_directory_recursive(struct dir_struct *dir, const char *path, int len, int check_only, const struct path_simplify *simplify); static int get_dtype(struct dirent *de, const char *path, int len); static int common_prefix(const char **pathspec) { const char *path, *slash, *next; int prefix; if (!pathspec) return 0; path = *pathspec; slash = strrchr(path, '/'); if (!slash) return 0; /* * The first 'prefix' characters of 'path' are common leading * path components among the pathspecs we have seen so far, * including the trailing slash. */ prefix = slash - path + 1; while ((next = *++pathspec) != NULL) { int len, last_matching_slash = -1; for (len = 0; len < prefix && next[len] == path[len]; len++) if (next[len] == '/') last_matching_slash = len; if (len == prefix) continue; if (last_matching_slash < 0) return 0; prefix = last_matching_slash + 1; } return prefix; } int fill_directory(struct dir_struct *dir, const char **pathspec) { const char *path; int len; /* * Calculate common prefix for the pathspec, and * use that to optimize the directory walk */ len = common_prefix(pathspec); path = ""; if (len) path = xmemdupz(*pathspec, len); /* Read the directory and prune it */ read_directory(dir, path, len, pathspec); return len; } /* * Does 'match' match the given name? * A match is found if * * (1) the 'match' string is leading directory of 'name', or * (2) the 'match' string is a wildcard and matches 'name', or * (3) the 'match' string is exactly the same as 'name'. * * and the return value tells which case it was. * * It returns 0 when there is no match. */ static int match_one(const char *match, const char *name, int namelen) { int matchlen; /* If the match was just the prefix, we matched */ if (!*match) return MATCHED_RECURSIVELY; for (;;) { unsigned char c1 = *match; unsigned char c2 = *name; if (c1 == '\0' || is_glob_special(c1)) break; if (c1 != c2) return 0; match++; name++; namelen--; } /* * If we don't match the matchstring exactly, * we need to match by fnmatch */ matchlen = strlen(match); if (strncmp(match, name, matchlen)) return !fnmatch(match, name, 0) ? MATCHED_FNMATCH : 0; if (namelen == matchlen) return MATCHED_EXACTLY; if (match[matchlen-1] == '/' || name[matchlen] == '/') return MATCHED_RECURSIVELY; return 0; } /* * Given a name and a list of pathspecs, see if the name matches * any of the pathspecs. The caller is also interested in seeing * all pathspec matches some names it calls this function with * (otherwise the user could have mistyped the unmatched pathspec), * and a mark is left in seen[] array for pathspec element that * actually matched anything. */ int match_pathspec(const char **pathspec, const char *name, int namelen, int prefix, char *seen) { int i, retval = 0; if (!pathspec) return 1; name += prefix; namelen -= prefix; for (i = 0; pathspec[i] != NULL; i++) { int how; const char *match = pathspec[i] + prefix; if (seen && seen[i] == MATCHED_EXACTLY) continue; how = match_one(match, name, namelen); if (how) { if (retval < how) retval = how; if (seen && seen[i] < how) seen[i] = how; } } return retval; } static int no_wildcard(const char *string) { return string[strcspn(string, "*?[{\\")] == '\0'; } void add_exclude(const char *string, const char *base, int baselen, struct exclude_list *which) { struct exclude *x; size_t len; int to_exclude = 1; int flags = 0; if (*string == '!') { to_exclude = 0; string++; } len = strlen(string); if (len && string[len - 1] == '/') { char *s; x = xmalloc(sizeof(*x) + len); s = (char *)(x+1); memcpy(s, string, len - 1); s[len - 1] = '\0'; string = s; x->pattern = s; flags = EXC_FLAG_MUSTBEDIR; } else { x = xmalloc(sizeof(*x)); x->pattern = string; } x->to_exclude = to_exclude; x->patternlen = strlen(string); x->base = base; x->baselen = baselen; x->flags = flags; if (!strchr(string, '/')) x->flags |= EXC_FLAG_NODIR; if (no_wildcard(string)) x->flags |= EXC_FLAG_NOWILDCARD; if (*string == '*' && no_wildcard(string+1)) x->flags |= EXC_FLAG_ENDSWITH; ALLOC_GROW(which->excludes, which->nr + 1, which->alloc); which->excludes[which->nr++] = x; } static void *read_skip_worktree_file_from_index(const char *path, size_t *size) { int pos, len; unsigned long sz; enum object_type type; void *data; struct index_state *istate = &the_index; len = strlen(path); pos = index_name_pos(istate, path, len); if (pos < 0) return NULL; if (!ce_skip_worktree(istate->cache[pos])) return NULL; data = read_sha1_file(istate->cache[pos]->sha1, &type, &sz); if (!data || type != OBJ_BLOB) { free(data); return NULL; } *size = xsize_t(sz); return data; } int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen, char **buf_p, struct exclude_list *which, int check_index) { struct stat st; int fd, i; size_t size; char *buf, *entry; fd = open(fname, O_RDONLY); if (fd < 0 || fstat(fd, &st) < 0) { if (0 <= fd) close(fd); if (!check_index || (buf = read_skip_worktree_file_from_index(fname, &size)) == NULL) return -1; if (size == 0) { free(buf); return 0; } if (buf[size-1] != '\n') { buf = xrealloc(buf, size+1); buf[size++] = '\n'; } } else { size = xsize_t(st.st_size); if (size == 0) { close(fd); return 0; } buf = xmalloc(size+1); if (read_in_full(fd, buf, size) != size) { free(buf); close(fd); return -1; } buf[size++] = '\n'; close(fd); } if (buf_p) *buf_p = buf; entry = buf; for (i = 0; i < size; i++) { if (buf[i] == '\n') { if (entry != buf + i && entry[0] != '#') { buf[i - (i && buf[i-1] == '\r')] = 0; add_exclude(entry, base, baselen, which); } entry = buf + i + 1; } } return 0; } void add_excludes_from_file(struct dir_struct *dir, const char *fname) { if (add_excludes_from_file_to_list(fname, "", 0, NULL, &dir->exclude_list[EXC_FILE], 0) < 0) die("cannot use %s as an exclude file", fname); } static void prep_exclude(struct dir_struct *dir, const char *base, int baselen) { struct exclude_list *el; struct exclude_stack *stk = NULL; int current; if ((!dir->exclude_per_dir) || (baselen + strlen(dir->exclude_per_dir) >= PATH_MAX)) return; /* too long a path -- ignore */ /* Pop the ones that are not the prefix of the path being checked. */ el = &dir->exclude_list[EXC_DIRS]; while ((stk = dir->exclude_stack) != NULL) { if (stk->baselen <= baselen && !strncmp(dir->basebuf, base, stk->baselen)) break; dir->exclude_stack = stk->prev; while (stk->exclude_ix < el->nr) free(el->excludes[--el->nr]); free(stk->filebuf); free(stk); } /* Read from the parent directories and push them down. */ current = stk ? stk->baselen : -1; while (current < baselen) { struct exclude_stack *stk = xcalloc(1, sizeof(*stk)); const char *cp; if (current < 0) { cp = base; current = 0; } else { cp = strchr(base + current + 1, '/'); if (!cp) die("oops in prep_exclude"); cp++; } stk->prev = dir->exclude_stack; stk->baselen = cp - base; stk->exclude_ix = el->nr; memcpy(dir->basebuf + current, base + current, stk->baselen - current); strcpy(dir->basebuf + stk->baselen, dir->exclude_per_dir); add_excludes_from_file_to_list(dir->basebuf, dir->basebuf, stk->baselen, &stk->filebuf, el, 1); dir->exclude_stack = stk; current = stk->baselen; } dir->basebuf[baselen] = '\0'; } /* Scan the list and let the last match determine the fate. * Return 1 for exclude, 0 for include and -1 for undecided. */ int excluded_from_list(const char *pathname, int pathlen, const char *basename, int *dtype, struct exclude_list *el) { int i; if (el->nr) { for (i = el->nr - 1; 0 <= i; i--) { struct exclude *x = el->excludes[i]; const char *exclude = x->pattern; int to_exclude = x->to_exclude; if (x->flags & EXC_FLAG_MUSTBEDIR) { if (!dtype) { if (!prefixcmp(pathname, exclude)) return to_exclude; else continue; } if (*dtype == DT_UNKNOWN) *dtype = get_dtype(NULL, pathname, pathlen); if (*dtype != DT_DIR) continue; } if (x->flags & EXC_FLAG_NODIR) { /* match basename */ if (x->flags & EXC_FLAG_NOWILDCARD) { if (!strcmp(exclude, basename)) return to_exclude; } else if (x->flags & EXC_FLAG_ENDSWITH) { if (x->patternlen - 1 <= pathlen && !strcmp(exclude + 1, pathname + pathlen - x->patternlen + 1)) return to_exclude; } else { if (fnmatch(exclude, basename, 0) == 0) return to_exclude; } } else { /* match with FNM_PATHNAME: * exclude has base (baselen long) implicitly * in front of it. */ int baselen = x->baselen; if (*exclude == '/') exclude++; if (pathlen < baselen || (baselen && pathname[baselen-1] != '/') || strncmp(pathname, x->base, baselen)) continue; if (x->flags & EXC_FLAG_NOWILDCARD) { if (!strcmp(exclude, pathname + baselen)) return to_exclude; } else { if (fnmatch(exclude, pathname+baselen, FNM_PATHNAME) == 0) return to_exclude; } } } } return -1; /* undecided */ } int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p) { int pathlen = strlen(pathname); int st; const char *basename = strrchr(pathname, '/'); basename = (basename) ? basename+1 : pathname; prep_exclude(dir, pathname, basename-pathname); for (st = EXC_CMDL; st <= EXC_FILE; st++) { switch (excluded_from_list(pathname, pathlen, basename, dtype_p, &dir->exclude_list[st])) { case 0: return 0; case 1: return 1; } } return 0; } static struct dir_entry *dir_entry_new(const char *pathname, int len) { struct dir_entry *ent; ent = xmalloc(sizeof(*ent) + len + 1); ent->len = len; memcpy(ent->name, pathname, len); ent->name[len] = 0; return ent; } static struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len) { if (cache_name_exists(pathname, len, ignore_case)) return NULL; ALLOC_GROW(dir->entries, dir->nr+1, dir->alloc); return dir->entries[dir->nr++] = dir_entry_new(pathname, len); } struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len) { if (!cache_name_is_other(pathname, len)) return NULL; ALLOC_GROW(dir->ignored, dir->ignored_nr+1, dir->ignored_alloc); return dir->ignored[dir->ignored_nr++] = dir_entry_new(pathname, len); } enum exist_status { index_nonexistent = 0, index_directory, index_gitdir }; /* * The index sorts alphabetically by entry name, which * means that a gitlink sorts as '\0' at the end, while * a directory (which is defined not as an entry, but as * the files it contains) will sort with the '/' at the * end. */ static enum exist_status directory_exists_in_index(const char *dirname, int len) { int pos = cache_name_pos(dirname, len); if (pos < 0) pos = -pos-1; while (pos < active_nr) { struct cache_entry *ce = active_cache[pos++]; unsigned char endchar; if (strncmp(ce->name, dirname, len)) break; endchar = ce->name[len]; if (endchar > '/') break; if (endchar == '/') return index_directory; if (!endchar && S_ISGITLINK(ce->ce_mode)) return index_gitdir; } return index_nonexistent; } /* * When we find a directory when traversing the filesystem, we * have three distinct cases: * * - ignore it * - see it as a directory * - recurse into it * * and which one we choose depends on a combination of existing * git index contents and the flags passed into the directory * traversal routine. * * Case 1: If we *already* have entries in the index under that * directory name, we always recurse into the directory to see * all the files. * * Case 2: If we *already* have that directory name as a gitlink, * we always continue to see it as a gitlink, regardless of whether * there is an actual git directory there or not (it might not * be checked out as a subproject!) * * Case 3: if we didn't have it in the index previously, we * have a few sub-cases: * * (a) if "show_other_directories" is true, we show it as * just a directory, unless "hide_empty_directories" is * also true and the directory is empty, in which case * we just ignore it entirely. * (b) if it looks like a git directory, and we don't have * 'no_gitlinks' set we treat it as a gitlink, and show it * as a directory. * (c) otherwise, we recurse into it. */ enum directory_treatment { show_directory, ignore_directory, recurse_into_directory }; static enum directory_treatment treat_directory(struct dir_struct *dir, const char *dirname, int len, const struct path_simplify *simplify) { /* The "len-1" is to strip the final '/' */ switch (directory_exists_in_index(dirname, len-1)) { case index_directory: return recurse_into_directory; case index_gitdir: if (dir->flags & DIR_SHOW_OTHER_DIRECTORIES) return ignore_directory; return show_directory; case index_nonexistent: if (dir->flags & DIR_SHOW_OTHER_DIRECTORIES) break; if (!(dir->flags & DIR_NO_GITLINKS)) { unsigned char sha1[20]; if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0) return show_directory; } return recurse_into_directory; } /* This is the "show_other_directories" case */ if (!(dir->flags & DIR_HIDE_EMPTY_DIRECTORIES)) return show_directory; if (!read_directory_recursive(dir, dirname, len, 1, simplify)) return ignore_directory; return show_directory; } /* * This is an inexact early pruning of any recursive directory * reading - if the path cannot possibly be in the pathspec, * return true, and we'll skip it early. */ static int simplify_away(const char *path, int pathlen, const struct path_simplify *simplify) { if (simplify) { for (;;) { const char *match = simplify->path; int len = simplify->len; if (!match) break; if (len > pathlen) len = pathlen; if (!memcmp(path, match, len)) return 0; simplify++; } return 1; } return 0; } /* * This function tells us whether an excluded path matches a * list of "interesting" pathspecs. That is, whether a path matched * by any of the pathspecs could possibly be ignored by excluding * the specified path. This can happen if: * * 1. the path is mentioned explicitly in the pathspec * * 2. the path is a directory prefix of some element in the * pathspec */ static int exclude_matches_pathspec(const char *path, int len, const struct path_simplify *simplify) { if (simplify) { for (; simplify->path; simplify++) { if (len == simplify->len && !memcmp(path, simplify->path, len)) return 1; if (len < simplify->len && simplify->path[len] == '/' && !memcmp(path, simplify->path, len)) return 1; } } return 0; } static int get_index_dtype(const char *path, int len) { int pos; struct cache_entry *ce; ce = cache_name_exists(path, len, 0); if (ce) { if (!ce_uptodate(ce)) return DT_UNKNOWN; if (S_ISGITLINK(ce->ce_mode)) return DT_DIR; /* * Nobody actually cares about the * difference between DT_LNK and DT_REG */ return DT_REG; } /* Try to look it up as a directory */ pos = cache_name_pos(path, len); if (pos >= 0) return DT_UNKNOWN; pos = -pos-1; while (pos < active_nr) { ce = active_cache[pos++]; if (strncmp(ce->name, path, len)) break; if (ce->name[len] > '/') break; if (ce->name[len] < '/') continue; if (!ce_uptodate(ce)) break; /* continue? */ return DT_DIR; } return DT_UNKNOWN; } static int get_dtype(struct dirent *de, const char *path, int len) { int dtype = de ? DTYPE(de) : DT_UNKNOWN; struct stat st; if (dtype != DT_UNKNOWN) return dtype; dtype = get_index_dtype(path, len); if (dtype != DT_UNKNOWN) return dtype; if (lstat(path, &st)) return dtype; if (S_ISREG(st.st_mode)) return DT_REG; if (S_ISDIR(st.st_mode)) return DT_DIR; if (S_ISLNK(st.st_mode)) return DT_LNK; return dtype; } enum path_treatment { path_ignored, path_handled, path_recurse }; static enum path_treatment treat_one_path(struct dir_struct *dir, char *path, int *len, const struct path_simplify *simplify, int dtype, struct dirent *de) { int exclude = excluded(dir, path, &dtype); if (exclude && (dir->flags & DIR_COLLECT_IGNORED) && exclude_matches_pathspec(path, *len, simplify)) dir_add_ignored(dir, path, *len); /* * Excluded? If we don't explicitly want to show * ignored files, ignore it */ if (exclude && !(dir->flags & DIR_SHOW_IGNORED)) return path_ignored; if (dtype == DT_UNKNOWN) dtype = get_dtype(de, path, *len); /* * Do we want to see just the ignored files? * We still need to recurse into directories, * even if we don't ignore them, since the * directory may contain files that we do.. */ if (!exclude && (dir->flags & DIR_SHOW_IGNORED)) { if (dtype != DT_DIR) return path_ignored; } switch (dtype) { default: return path_ignored; case DT_DIR: memcpy(path + *len, "/", 2); (*len)++; switch (treat_directory(dir, path, *len, simplify)) { case show_directory: if (exclude != !!(dir->flags & DIR_SHOW_IGNORED)) return path_ignored; break; case recurse_into_directory: return path_recurse; case ignore_directory: return path_ignored; } break; case DT_REG: case DT_LNK: break; } return path_handled; } static enum path_treatment treat_path(struct dir_struct *dir, struct dirent *de, char *path, int path_max, int baselen, const struct path_simplify *simplify, int *len) { int dtype; if (is_dot_or_dotdot(de->d_name) || !strcmp(de->d_name, ".git")) return path_ignored; *len = strlen(de->d_name); /* Ignore overly long pathnames! */ if (*len + baselen + 8 > path_max) return path_ignored; memcpy(path + baselen, de->d_name, *len + 1); *len += baselen; if (simplify_away(path, *len, simplify)) return path_ignored; dtype = DTYPE(de); return treat_one_path(dir, path, len, simplify, dtype, de); } /* * Read a directory tree. We currently ignore anything but * directories, regular files and symlinks. That's because git * doesn't handle them at all yet. Maybe that will change some * day. * * Also, we ignore the name ".git" (even if it is not a directory). * That likely will not change. */ static int read_directory_recursive(struct dir_struct *dir, const char *base, int baselen, int check_only, const struct path_simplify *simplify) { DIR *fdir = opendir(*base ? base : "."); int contents = 0; if (fdir) { struct dirent *de; char path[PATH_MAX + 1]; memcpy(path, base, baselen); while ((de = readdir(fdir)) != NULL) { int len; switch (treat_path(dir, de, path, sizeof(path), baselen, simplify, &len)) { case path_recurse: contents += read_directory_recursive (dir, path, len, 0, simplify); continue; case path_ignored: continue; case path_handled: break; } contents++; if (check_only) goto exit_early; else dir_add_name(dir, path, len); } exit_early: closedir(fdir); } return contents; } static int cmp_name(const void *p1, const void *p2) { const struct dir_entry *e1 = *(const struct dir_entry **)p1; const struct dir_entry *e2 = *(const struct dir_entry **)p2; return cache_name_compare(e1->name, e1->len, e2->name, e2->len); } /* * Return the length of the "simple" part of a path match limiter. */ static int simple_length(const char *match) { int len = -1; for (;;) { unsigned char c = *match++; len++; if (c == '\0' || is_glob_special(c)) return len; } } static struct path_simplify *create_simplify(const char **pathspec) { int nr, alloc = 0; struct path_simplify *simplify = NULL; if (!pathspec) return NULL; for (nr = 0 ; ; nr++) { const char *match; if (nr >= alloc) { alloc = alloc_nr(alloc); simplify = xrealloc(simplify, alloc * sizeof(*simplify)); } match = *pathspec++; if (!match) break; simplify[nr].path = match; simplify[nr].len = simple_length(match); } simplify[nr].path = NULL; simplify[nr].len = 0; return simplify; } static void free_simplify(struct path_simplify *simplify) { free(simplify); } static int treat_leading_path(struct dir_struct *dir, const char *path, int len, const struct path_simplify *simplify) { char pathbuf[PATH_MAX]; int baselen, blen; const char *cp; while (len && path[len - 1] == '/') len--; if (!len) return 1; baselen = 0; while (1) { cp = path + baselen + !!baselen; cp = memchr(cp, '/', path + len - cp); if (!cp) baselen = len; else baselen = cp - path; memcpy(pathbuf, path, baselen); pathbuf[baselen] = '\0'; if (!is_directory(pathbuf)) return 0; if (simplify_away(pathbuf, baselen, simplify)) return 0; blen = baselen; if (treat_one_path(dir, pathbuf, &blen, simplify, DT_DIR, NULL) == path_ignored) return 0; /* do not recurse into it */ if (len <= baselen) return 1; /* finished checking */ } } int read_directory(struct dir_struct *dir, const char *path, int len, const char **pathspec) { struct path_simplify *simplify; if (has_symlink_leading_path(path, len)) return dir->nr; simplify = create_simplify(pathspec); if (!len || treat_leading_path(dir, path, len, simplify)) read_directory_recursive(dir, path, len, 0, simplify); free_simplify(simplify); qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name); qsort(dir->ignored, dir->ignored_nr, sizeof(struct dir_entry *), cmp_name); return dir->nr; } int file_exists(const char *f) { struct stat sb; return lstat(f, &sb) == 0; } /* * get_relative_cwd() gets the prefix of the current working directory * relative to 'dir'. If we are not inside 'dir', it returns NULL. * * As a convenience, it also returns NULL if 'dir' is already NULL. The * reason for this behaviour is that it is natural for functions returning * directory names to return NULL to say "this directory does not exist" * or "this directory is invalid". These cases are usually handled the * same as if the cwd is not inside 'dir' at all, so get_relative_cwd() * returns NULL for both of them. * * Most notably, get_relative_cwd(buffer, size, get_git_work_tree()) * unifies the handling of "outside work tree" with "no work tree at all". */ char *get_relative_cwd(char *buffer, int size, const char *dir) { char *cwd = buffer; if (!dir) return NULL; if (!getcwd(buffer, size)) die_errno("can't find the current directory"); if (!is_absolute_path(dir)) dir = make_absolute_path(dir); while (*dir && *dir == *cwd) { dir++; cwd++; } if (*dir) return NULL; switch (*cwd) { case '\0': return cwd; case '/': return cwd + 1; default: return NULL; } } int is_inside_dir(const char *dir) { char buffer[PATH_MAX]; return get_relative_cwd(buffer, sizeof(buffer), dir) != NULL; } int is_empty_dir(const char *path) { DIR *dir = opendir(path); struct dirent *e; int ret = 1; if (!dir) return 0; while ((e = readdir(dir)) != NULL) if (!is_dot_or_dotdot(e->d_name)) { ret = 0; break; } closedir(dir); return ret; } int remove_dir_recursively(struct strbuf *path, int flag) { DIR *dir; struct dirent *e; int ret = 0, original_len = path->len, len; int only_empty = (flag & REMOVE_DIR_EMPTY_ONLY); unsigned char submodule_head[20]; if ((flag & REMOVE_DIR_KEEP_NESTED_GIT) && !resolve_gitlink_ref(path->buf, "HEAD", submodule_head)) /* Do not descend and nuke a nested git work tree. */ return 0; dir = opendir(path->buf); if (!dir) return -1; if (path->buf[original_len - 1] != '/') strbuf_addch(path, '/'); len = path->len; while ((e = readdir(dir)) != NULL) { struct stat st; if (is_dot_or_dotdot(e->d_name)) continue; strbuf_setlen(path, len); strbuf_addstr(path, e->d_name); if (lstat(path->buf, &st)) ; /* fall thru */ else if (S_ISDIR(st.st_mode)) { if (!remove_dir_recursively(path, only_empty)) continue; /* happy */ } else if (!only_empty && !unlink(path->buf)) continue; /* happy, too */ /* path too long, stat fails, or non-directory still exists */ ret = -1; break; } closedir(dir); strbuf_setlen(path, original_len); if (!ret) ret = rmdir(path->buf); return ret; } void setup_standard_excludes(struct dir_struct *dir) { const char *path; dir->exclude_per_dir = ".gitignore"; path = git_path("info/exclude"); if (!access(path, R_OK)) add_excludes_from_file(dir, path); if (excludes_file && !access(excludes_file, R_OK)) add_excludes_from_file(dir, excludes_file); } int remove_path(const char *name) { char *slash; if (unlink(name) && errno != ENOENT) return -1; slash = strrchr(name, '/'); if (slash) { char *dirs = xstrdup(name); slash = dirs + (slash - name); do { *slash = '\0'; } while (rmdir(dirs) == 0 && (slash = strrchr(dirs, '/'))); free(dirs); } return 0; }
vidarh/Git
dir.c
C
gpl-2.0
25,564
<?php // // phpCAS proxy client // // import phpCAS lib include_once('CAS.php'); // set debug mode phpCAS::setDebug(); // initialize phpCAS phpCAS::proxy(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,''); // no SSL validation for the CAS server phpCAS::setNoCasServerValidation(); // force CAS authentication phpCAS::forceAuthentication(); // at this step, the user has been authenticated by the CAS server // and the user's login name can be read with phpCAS::getUser(). // moreover, a PGT was retrieved from the CAS server that will // permit to gain accesses to new services. ?> <html> <head> <title>phpCAS proxy example</title> </head> <body> <h1>phpCAS proxy example</h1> <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p> <?php // access to external services $services = array('http://phpcas-test.ifsic.univ-rennes1.fr/examples/example_service.php', 'http://phpcas-test.ifsic.univ-rennes1.fr/examples/example_proxy2.php', 'http://www.ifsic.univ-rennes1.fr/xxx'); foreach ( $services as $service ) { echo '<h2>Response from service '.$service.'</h2><ul><hr>'; flush(); // call the service and change the color depending on the result if ( phpCAS::serviceWeb($service,$err_code,$output) ) { echo '<font color="#00FF00">'; } else { echo '<font color="#FF0000">'; } echo $output; echo '</font><hr></ul>'; } ?> </body> </html>
pawohl/studip
vendor/phpCAS/docs/examples/example_proxy.php
PHP
gpl-2.0
1,485
/** * Kunena Component * @package Kunena.Template.Crypsis * * @copyright (C) 2008 - 2016 Kunena Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link https://www.kunena.org **/ jQuery(document).ready(function() { /** * Get the number of field options inserted in form */ function getOptionsNumber() { var myoptions = jQuery('#kbbcode-poll-options').children('div.polloption'); return myoptions.length; } /** * This function will insert directly in DOM the new field for poll with attibutes */ function createNewOptionField() { var options = getOptionsNumber(); options++; var polldiv = jQuery('<div></div>').attr('class','polloption').appendTo('#kbbcode-poll-options'); var label = jQuery('<label>').text(Joomla.JText._('COM_KUNENA_POLL_OPTION_NAME')+' '+options+' '); polldiv.append(label); newInput = document.createElement('input'); newInput.setAttribute('name', 'polloptionsID[new'+options+']'); newInput.setAttribute('id', 'field_option'+options); newInput.setAttribute('class', 'inputbox'); newInput.setAttribute('maxlength', '100'); newInput.setAttribute('type', 'text'); polldiv.append(newInput); } if( jQuery('#kbutton-poll-add') != undefined ) { jQuery('#kbutton-poll-add').click(function() { var nboptionsmax = jQuery('#nb_options_allowed').val(); var koptions = getOptionsNumber(); if(!nboptionsmax || (koptions < nboptionsmax && koptions >= 2) ){ createNewOptionField(); } else if (!nboptionsmax || koptions < 2) { createNewOptionField(); createNewOptionField(); } else { // Set error message with alert bootstrap way jQuery('#kpoll-alert-error').show(); jQuery('#kbutton-poll-add').hide(); } }); } if( jQuery('#kbutton-poll-rem') != undefined ) { jQuery('#kbutton-poll-rem').click(function() { var koption = jQuery ('div.polloption:last'); if(koption) { var isvisible = jQuery('#kpoll-alert-error').is(":visible"); if (isvisible){ jQuery('#kpoll-alert-error').hide(); jQuery('#kbutton-poll-add').show(); } koption.remove(); } }); } if( jQuery('#postcatid') != undefined ) { jQuery('#postcatid').change(function() { var catid = jQuery('select#postcatid option').filter(':selected').val(); if ( pollcategoriesid[catid] !== undefined ) { jQuery('.pollbutton').show(); } else { jQuery('.pollbutton').hide(); } }); } if ( typeof pollcategoriesid != 'undefined' && jQuery('#poll_exist_edit').length == 0 ) { var catid = jQuery('#kcategory_poll').val(); if ( pollcategoriesid[catid] !== undefined ) { jQuery('.pollbutton').show(); } else { jQuery('.pollbutton').hide(); } } else if ( jQuery('#poll_exist_edit').length > 0 ) { jQuery('.pollbutton').show(); } else { jQuery('.pollbutton').hide(); } jQuery('#kpoll_go_results').click(function() { if(jQuery('#poll-results').is(':visible')==true) { jQuery('#poll-results').hide(); jQuery('#kpoll_hide_results').hide(); } else { jQuery('#poll-results').show(); jQuery('#kpoll_hide_results').show(); jQuery('#kpoll_go_results').hide(); } }); jQuery('#kpoll_hide_results').click(function() { if(jQuery('#poll-results').is(':visible')==true) { jQuery('#poll-results').hide(); jQuery('#kpoll_go_results').show(); jQuery('#kpoll_hide_results').hide(); } else { jQuery('#poll-results').show(); jQuery('#kpoll_hide_results').show(); jQuery('#kpoll_go_results').hide(); } }); jQuery('#kpoll-moreusers').click(function() { jQuery('#kpoll-moreusers-div').show(); }); });
kartach/netaktiv
components/com_kunena/template/crypsis/media/js/poll.js
JavaScript
gpl-2.0
3,615
/* * LICENSE: GPL - See COPYING in the top level directory * PROJECT: ReactOS Console Server DLL * FILE: consrv/alias.h * PURPOSE: Alias support functions * PROGRAMMERS: Christoph Wittich * Johannes Anderwald */ #pragma once VOID IntDeleteAllAliases(PCONSRV_CONSOLE Console);
zefklop/reactos-playground
win32ss/user/winsrv/consrv/alias.h
C
gpl-2.0
341
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "startrek/room.h" namespace StarTrek { extern const RoomAction demon1ActionList[] = { { {ACTION_TICK, 1, 0, 0}, &Room::demon1Tick1 }, { {ACTION_WALK, 0x25, 0, 0}, &Room::demon1WalkToCave }, { {ACTION_FINISHED_WALKING, 2, 0, 0}, &Room::demon1TouchedTopWarp }, { {ACTION_TOUCHED_WARP, 0, 0, 0}, &Room::demon1TouchedTopWarp }, { {ACTION_TOUCHED_WARP, 1, 0, 0}, &Room::demon1TouchedBottomWarp }, { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::demon1Timer2Expired }, { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::demon1Timer0Expired }, { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::demon1Timer3Expired }, { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::demon1Timer1Expired }, { {ACTION_FINISHED_ANIMATION, 2, 0, 0}, &Room::demon1KlingonFinishedAimingWeapon }, { {ACTION_FINISHED_ANIMATION, 1, 0, 0}, &Room::demon1KirkShot }, { {ACTION_USE, OBJECT_IPHASERK, 0xff, 0}, &Room::demon1UsePhaserOnAnything }, { {ACTION_USE, OBJECT_IPHASERS, 0xff, 0}, &Room::demon1UsePhaserOnAnything }, { {ACTION_USE, OBJECT_IPHASERK, 8, 0}, &Room::demon1UsePhaserOnKlingon1 }, { {ACTION_USE, OBJECT_IPHASERS, 8, 0}, &Room::demon1UsePhaserOnKlingon1 }, { {ACTION_FINISHED_ANIMATION, 3, 0, 0}, &Room::demon1ShootKlingon1 }, { {ACTION_FINISHED_ANIMATION, 7, 0, 0}, &Room::demon1KlingonDropsHand }, { {ACTION_USE, OBJECT_IPHASERK, 9, 0}, &Room::demon1UsePhaserOnKlingon2 }, { {ACTION_USE, OBJECT_IPHASERS, 9, 0}, &Room::demon1UsePhaserOnKlingon2 }, { {ACTION_FINISHED_ANIMATION, 4, 0, 0}, &Room::demon1ShootKlingon2 }, { {ACTION_USE, OBJECT_IPHASERK, 10, 0}, &Room::demon1UsePhaserOnKlingon3 }, { {ACTION_USE, OBJECT_IPHASERS, 10, 0}, &Room::demon1UsePhaserOnKlingon3 }, { {ACTION_FINISHED_ANIMATION, 5, 0, 0}, &Room::demon1ShootKlingon3 }, { {ACTION_TIMER_EXPIRED, 6, 0, 0}, &Room::demon1AllKlingonsDead }, { {ACTION_TIMER_EXPIRED, 5, 0, 0}, &Room::demon1Timer5Expired }, { {ACTION_USE, OBJECT_IMTRICOR, 13, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_ISTRICOR, 0x21, 0}, &Room::demon1UseSTricorderOnTulips }, { {ACTION_USE, OBJECT_ISTRICOR, 0x22, 0}, &Room::demon1UseSTricorderOnPods }, { {ACTION_USE, OBJECT_ISTRICOR, 0x20, 0}, &Room::demon1UseSTricorderOnCattails }, { {ACTION_USE, OBJECT_ISTRICOR, 0x23, 0}, &Room::demon1UseSTricorderOnFerns }, { {ACTION_USE, OBJECT_ISTRICOR, 13, 0}, &Room::demon1UseSTricorderOnHand }, { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::demon1UseSTricorderOnKlingon1 }, { {ACTION_USE, OBJECT_ISTRICOR, 10, 0}, &Room::demon1UseSTricorderOnKlingon2Or3 }, { {ACTION_USE, OBJECT_ISTRICOR, 9, 0}, &Room::demon1UseSTricorderOnKlingon2Or3 }, { {ACTION_USE, OBJECT_IMEDKIT, 8, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_IMTRICOR, 8, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_IMEDKIT, 10, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_IMEDKIT, 9, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_IMTRICOR, 10, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_IMTRICOR, 9, 0}, &Room::demon1UseMTricorderOnKlingon }, { {ACTION_USE, OBJECT_ISTRICOR, 8, 0}, &Room::demon1UseSTricorderOnKlingon2Or3 }, // This is redundant { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::demon1UseMTricorderOnKirk }, { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::demon1UseMTricorderOnSpock }, { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::demon1UseMTricorderOnRedshirt }, { {ACTION_GET, 13, 0, 0}, &Room::demon1GetHand }, { {ACTION_FINISHED_WALKING, 1, 0, 0}, &Room::demon1ReachedHand }, { {ACTION_FINISHED_ANIMATION, 6, 0, 0}, &Room::demon1PickedUpHand }, { {ACTION_TIMER_EXPIRED, 4, 0, 0}, &Room::demon1FinishedGettingHand }, { {ACTION_LOOK, 8, 0, 0}, &Room::demon1LookAtKlingon }, { {ACTION_LOOK, 9, 0, 0}, &Room::demon1LookAtKlingon }, { {ACTION_LOOK, 10, 0, 0}, &Room::demon1LookAtKlingon }, { {ACTION_LOOK, 0x20, 0, 0}, &Room::demon1LookAtCattails }, { {ACTION_LOOK, 0x21, 0, 0}, &Room::demon1LookAtTulips }, { {ACTION_LOOK, 0x22, 0, 0}, &Room::demon1LookAtPods }, { {ACTION_LOOK, 0x23, 0, 0}, &Room::demon1LookAtFerns }, { {ACTION_LOOK, 0x24, 0, 0}, &Room::demon1LookAtStream }, { {ACTION_LOOK, 0x25, 0, 0}, &Room::demon1LookAtMine }, { {ACTION_LOOK, 0x26, 0, 0}, &Room::demon1LookAtMountain }, { {ACTION_LOOK, 13, 0, 0}, &Room::demon1LookAtHand }, { {ACTION_LOOK, 0xff, 0, 0}, &Room::demon1LookAnywhere }, { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::demon1LookAtKirk }, { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::demon1LookAtSpock }, { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::demon1LookAtMcCoy }, { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::demon1LookAtRedshirt }, { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::demon1TalkToKirk }, { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::demon1TalkToSpock }, { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::demon1TalkToMcCoy }, { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::demon1TalkToRedshirt }, { {ACTION_LIST_END, 0, 0, 0}, nullptr } }; enum demon1TextIds { TX_SPEAKER_KIRK, TX_SPEAKER_SPOCK, TX_SPEAKER_MCCOY, TX_SPEAKER_EVERTS, TX_SPEAKER_UHURA, TX_SPEAKER_KLINGON, TX_DEM1_001, TX_DEM1_002, TX_DEM1_003, TX_DEM1_004, TX_DEM1_005, TX_DEM1_006, TX_DEM1_007, TX_DEM1_008, TX_DEM1_009, TX_DEM1_011, TX_DEM1_012, TX_DEM1_013, TX_DEM1_014, TX_DEM1_015, TX_DEM1_016, TX_DEM1_017, TX_DEM1_018, TX_DEM1_019, TX_DEM1_020, TX_DEM1_021, TX_DEM1_022, TX_DEM1_023, TX_DEM1_024, TX_DEM1_025, TX_DEM1_026, TX_DEM1_F23, TX_DEM1N000, TX_DEM1N001, TX_DEM1N002, TX_DEM1N003, TX_DEM1N004, TX_DEM1N005, TX_DEM1N006, TX_DEM1N007, TX_DEM1N008, TX_DEM1N009, TX_DEM1N010, TX_DEM1N011, TX_DEM1N012, TX_DEM1N013, TX_DEM1N014, TX_DEM1N015, TX_DEM1N016, TX_DEM1N017, TX_DEM1N018, TX_DEM1N019, TX_DEM1N020, TX_DEM1N021, TX_DEM1N023, TX_DEM1U077, TX_DEM1U078 }; // TODO: Finish floppy offsets extern const RoomTextOffsets demon1TextOffsets[] = { { TX_SPEAKER_KIRK, 5869, 0, 6162, 0 }, { TX_SPEAKER_SPOCK, 5880, 0, 6173, 0 }, { TX_SPEAKER_MCCOY, 5890, 0, 6183, 0 }, { TX_SPEAKER_EVERTS, 5900, 0, 6193, 0 }, { TX_SPEAKER_UHURA, 5914, 0, 6207, 0 }, { TX_SPEAKER_KLINGON, 5924, 0, 6217, 0 }, { TX_DEM1_001, 7374, 0, 7761, 0 }, { TX_DEM1_002, 2710, 0, 2790, 0 }, { TX_DEM1_003, 2566, 0, 2633, 0 }, { TX_DEM1_004, 2906, 0, 2999, 0 }, { TX_DEM1_005, 3458, 0, 3627, 0 }, { TX_DEM1_006, 3669, 0, 3866, 0 }, { TX_DEM1_007, 3142, 0, 3276, 0 }, { TX_DEM1_008, 3285, 0, 3440, 0 }, { TX_DEM1_009, 4222, 0, 4454, 0 }, { TX_DEM1_011, 1492, 0, 1492, 0 }, { TX_DEM1_012, 6779, 0, 0, 0 }, { TX_DEM1_013, 7645, 0, 0, 0 }, { TX_DEM1_014, 7779, 0, 0, 0 }, { TX_DEM1_015, 7904, 0, 0, 0 }, { TX_DEM1_016, 7111, 0, 0, 0 }, { TX_DEM1_017, 6837, 0, 0, 0 }, { TX_DEM1_018, 6358, 0, 0, 0 }, { TX_DEM1_019, 6926, 0, 0, 0 }, { TX_DEM1_020, 2764, 0, 2853, 0 }, { TX_DEM1_021, 2951, 0, 3053, 0 }, { TX_DEM1_022, 7478, 0, 0, 0 }, { TX_DEM1_023, 7983, 0, 0, 0 }, { TX_DEM1_024, 7735, 0, 0, 0 }, { TX_DEM1_025, 1937, 0, 1949, 0 }, { TX_DEM1_026, 8115, 0, 0, 0 }, { TX_DEM1_F23, 2028, 0, 2062, 0 }, { TX_DEM1N000, 6289, 0, 0, 0 }, { TX_DEM1N001, 6015, 0, 0, 0 }, { TX_DEM1N002, 6209, 0, 0, 0 }, { TX_DEM1N003, 5933, 0, 0, 0 }, { TX_DEM1N004, 7334, 0, 0, 0 }, { TX_DEM1N005, 7222, 0, 0, 0 }, { TX_DEM1N006, 6742, 0, 0, 0 }, { TX_DEM1N007, 7281, 0, 0, 0 }, { TX_DEM1N008, 6118, 0, 0, 0 }, { TX_DEM1N009, 4721, 0, 4988, 0 }, { TX_DEM1N010, 4561, 0, 4811, 0 }, { TX_DEM1N011, 4772, 0, 5046, 0 }, { TX_DEM1N012, 5145, 0, 5423, 0 }, { TX_DEM1N013, 5298, 0, 5582, 0 }, { TX_DEM1N014, 5373, 0, 5661, 0 }, { TX_DEM1N015, 5223, 0, 5507, 0 }, { TX_DEM1N016, 4917, 0, 5195, 0 }, { TX_DEM1N017, 5044, 0, 5330, 0 }, { TX_DEM1N018, 4486, 0, 4738, 0 }, { TX_DEM1N019, 4630, 0, 4888, 0 }, { TX_DEM1N020, 1814, 0, 1825, 0 }, { TX_DEM1N021, 4851, 0, 5118, 0 }, { TX_DEM1N023, 4977, 0, 5262, 0 }, { TX_DEM1U077, 2462, 0, 2504, 0 }, { TX_DEM1U078, 2641, 0, 2708, 0 }, { -1, 0, 0, 0, 0 } }; extern const RoomText demon1Texts[] = { { -1, Common::UNK_LANG, "" } }; // BUG: under certain circumstances, the klingons just stop firing? void Room::demon1Tick1() { playVoc("DEM1LOOP"); if (!_awayMission->demon.beatKlingons) playMidiMusicTracks(1, -1); if (_awayMission->demon.enteredFrom == 1) { // Entered from south _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N; _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N; _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N; } else if (_awayMission->demon.enteredFrom == 2) { // Entered from north? _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S; _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S; _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S; _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S; } if (!_awayMission->demon.beatKlingons) { _awayMission->disableWalking = true; _awayMission->timers[2] = 50; } else { loadActorAnim(8, "klg1d2", 0x120, 0x82, 0); if (!_awayMission->demon.tookKlingonHand) loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0); loadActorAnim(9, "klg2d2", 0xaa, 0x7c, 0); loadActorAnim(10, "klg3d2", 0, 0, 0); _roomVar.demon.klingonShot[0] = true; _roomVar.demon.klingonShot[1] = true; _roomVar.demon.klingonShot[2] = true; _roomVar.demon.numKlingonsKilled = 3; } } void Room::demon1WalkToCave() { if (_roomVar.demon.numKlingonsKilled != 3) return; walkCrewman(OBJECT_KIRK, 0xa3, 0x56, 2); } void Room::demon1TouchedTopWarp() { if (_awayMission->demon.warpsDisabled) return; loadRoomIndex(2, 1); } void Room::demon1TouchedBottomWarp() { if (_awayMission->demon.warpsDisabled) return; loadRoomIndex(0, 0); } void Room::demon1Timer2Expired() { if (_awayMission->demon.beatKlingons) return; _awayMission->demon.field37 = 1; _awayMission->demon.beatKlingons = true; _awayMission->demon.warpsDisabled = true; _awayMission->timers[0] = 5; _awayMission->timers[3] = 2; _awayMission->timers[1] = 100; loadActorAnim(8, "klg1u", 0x120, 0x82, 0); } void Room::demon1Timer0Expired() { loadActorAnim(9, "klg2u", 0xaa, 0x7c, 0); } void Room::demon1Timer3Expired() { loadActorAnim(10, "klg3u", 0xdb, 0x6d, 0); } void Room::demon1Timer1Expired() { int shooter; Common::String anim; if (!_roomVar.demon.klingonShot[0]) { anim = "klg1f"; shooter = 8; switch (_roomVar.demon.attackIndex) { case 0: strcpy(_roomVar.demon.d6, "klg1fr"); break; case 1: strcpy(_roomVar.demon.d6, "klg1fm"); break; case 2: strcpy(_roomVar.demon.d6, "klg1fs"); break; case 3: strcpy(_roomVar.demon.d6, "klg1fk"); break; default: return; } } else if (!_roomVar.demon.klingonShot[1]) { anim = "klg2f"; shooter = 9; switch (_roomVar.demon.attackIndex) { case 0: strcpy(_roomVar.demon.d6, "klg2fr"); break; case 1: strcpy(_roomVar.demon.d6, "klg2fm"); break; case 2: strcpy(_roomVar.demon.d6, "klg2fs"); break; case 3: strcpy(_roomVar.demon.d6, "klg2fk"); break; default: return; } } else { anim = "klg3f"; shooter = 10; switch (_roomVar.demon.attackIndex) { case 0: strcpy(_roomVar.demon.d6, "klg3fr"); break; case 1: strcpy(_roomVar.demon.d6, "klg3fm"); break; case 2: strcpy(_roomVar.demon.d6, "klg3fs"); break; case 3: strcpy(_roomVar.demon.d6, "klg3fk"); break; default: return; } } loadActorAnim2(shooter, anim, -1, -1, 2); } void Room::demon1KlingonFinishedAimingWeapon() { loadActorAnim(11, _roomVar.demon.d6, 0, 0, 0); playSoundEffectIndex(0x06); _roomVar.demon.attackIndex++; int crewman = OBJECT_REDSHIRT; if (_roomVar.demon.attackIndex == 1) { loadActorAnim2(OBJECT_REDSHIRT, "rstunn", -1, -1, 0); crewman = OBJECT_REDSHIRT; } else if (_roomVar.demon.attackIndex == 2) { loadActorAnim2(OBJECT_SPOCK, "sstunn", -1, -1, 0); crewman = OBJECT_SPOCK; } else if (_roomVar.demon.attackIndex == 3) { loadActorAnim2(OBJECT_MCCOY, "mstune", -1, -1, 0); crewman = OBJECT_MCCOY; } else if (_roomVar.demon.attackIndex == 4) { loadActorAnim2(OBJECT_KIRK, "kstunn", -1, -1, 1); crewman = OBJECT_KIRK; } _awayMission->crewDirectionsAfterWalk[crewman] = DIR_N; _awayMission->crewGetupTimers[crewman] = 650; _awayMission->crewDownBitset |= (1 << crewman); _awayMission->timers[1] = 100; } void Room::demon1KirkShot() { showDescription(TX_DEM1N000); showGameOverMenu(); } void Room::demon1UsePhaserOnAnything() { if (_roomVar.demon.numKlingonsKilled == 3) showText(TX_SPEAKER_MCCOY, TX_DEM1_011); } void Room::demon1UsePhaserOnKlingon1() { if (_roomVar.demon.klingonShot[0]) return; _awayMission->disableInput = 1; _roomVar.demon.klingonShot[0] = true; if (_roomVar.demon.kirkShooting) { demon1ShootKlingon1(); } else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 3); _roomVar.demon.kirkShooting = true; } } void Room::demon1ShootKlingon1() { _roomVar.demon.numKlingonsKilled++; if (_roomVar.demon.numKlingonsKilled == 3) { _awayMission->timers[1] = 0; _awayMission->timers[5] = 180; _awayMission->timers[6] = 1; _awayMission->demon.warpsDisabled = false; _awayMission->disableWalking = false; } loadActorAnim(12, "s0ks1", 0, 0, 0); playSoundEffectIndex(0x06); playVoc("EFX19"); loadActorAnim2(8, "klg1d", 0x120, 0x84, 7); } void Room::demon1KlingonDropsHand() { loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0); _awayMission->disableInput = 0; _awayMission->timers[1] = 0; showDescription(TX_DEM1N020); if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT)) return; showText(TX_SPEAKER_EVERTS, TX_DEM1_025); if (_roomVar.demon.numKlingonsKilled == 3) return; showText(TX_SPEAKER_KLINGON, TX_DEM1_F23); _awayMission->timers[1] = 1; } void Room::demon1UsePhaserOnKlingon2() { if (_roomVar.demon.klingonShot[1]) return; _awayMission->disableInput = 1; _roomVar.demon.klingonShot[1] = true; if (_roomVar.demon.kirkShooting) { demon1ShootKlingon2(); } else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 4); _roomVar.demon.kirkShooting = true; } } void Room::demon1ShootKlingon2() { _roomVar.demon.numKlingonsKilled++; if (_roomVar.demon.numKlingonsKilled == 3) { _awayMission->timers[1] = 0; _awayMission->timers[5] = 180; _awayMission->timers[6] = 1; _awayMission->demon.warpsDisabled = false; _awayMission->disableWalking = false; } loadActorAnim(12, "s0ks2", 0, 0, 0); playSoundEffectIndex(0x06); loadActorAnim2(9, "klg2d", 0xaa, 0x7c, 0); _awayMission->disableInput = 0; } void Room::demon1UsePhaserOnKlingon3() { if (_roomVar.demon.klingonShot[2]) return; _awayMission->disableInput = 1; _roomVar.demon.klingonShot[2] = true; if (_roomVar.demon.kirkShooting) { demon1ShootKlingon3(); } else { loadActorAnim2(OBJECT_KIRK, "kfiren", -1, -1, 5); _roomVar.demon.kirkShooting = true; } } void Room::demon1ShootKlingon3() { _roomVar.demon.numKlingonsKilled++; if (_roomVar.demon.numKlingonsKilled == 3) { _awayMission->timers[1] = 0; _awayMission->timers[5] = 180; _awayMission->timers[6] = 1; _awayMission->demon.warpsDisabled = false; _awayMission->disableWalking = false; } loadActorAnim(12, "s0ks3", 0, 0, 0); playSoundEffectIndex(0x06); loadActorAnim2(10, "klg3d", 0, 0, 0); _awayMission->disableInput = 0; } // Timer 6 expired void Room::demon1AllKlingonsDead() { _awayMission->crewGetupTimers[OBJECT_KIRK] = 45; _awayMission->crewGetupTimers[OBJECT_SPOCK] = 45; _awayMission->crewGetupTimers[OBJECT_MCCOY] = 45; _awayMission->crewGetupTimers[OBJECT_REDSHIRT] = 45; } void Room::demon1Timer5Expired() { if (_awayMission->crewDownBitset != 0) return; showText(TX_SPEAKER_UHURA, TX_DEM1U077); showText(TX_SPEAKER_KIRK, TX_DEM1_003); showText(TX_SPEAKER_UHURA, TX_DEM1U078); showText(TX_SPEAKER_KIRK, TX_DEM1_002); showText(TX_SPEAKER_SPOCK, TX_DEM1_020); showText(TX_SPEAKER_KIRK, TX_DEM1_004); showText(TX_SPEAKER_SPOCK, TX_DEM1_021); } void Room::demon1UseMTricorderOnKlingon() { loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_MCCOY, TX_DEM1_012); } void Room::demon1UseSTricorderOnTulips() { loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_SPOCK, TX_DEM1_007); } void Room::demon1UseSTricorderOnPods() { loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_SPOCK, TX_DEM1_008); } void Room::demon1UseSTricorderOnCattails() { loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_SPOCK, TX_DEM1_005); } void Room::demon1UseSTricorderOnFerns() { loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_SPOCK, TX_DEM1_006); } void Room::demon1UseSTricorderOnHand() { loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_SPOCK, TX_DEM1_017); } void Room::demon1UseSTricorderOnKlingon1() { // BUGFIX: Original game sets up the stack for this function call, but doesn't // actually call the function... loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); if (_roomVar.demon.numKlingonsKilled == 3 && !_awayMission->demon.tookKlingonHand && _rdfData[0xcf] != 1) { showText(TX_SPEAKER_SPOCK, TX_DEM1_018); _rdfData[0xcf] = 1; } else { showText(TX_SPEAKER_SPOCK, TX_DEM1_019); } } void Room::demon1UseSTricorderOnKlingon2Or3() { loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_SPOCK, TX_DEM1_019); } void Room::demon1UseMTricorderOnKirk() { if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK)) demon1UseMTricorderOnCrewman(); } void Room::demon1UseMTricorderOnSpock() { if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK)) demon1UseMTricorderOnCrewman(); } void Room::demon1UseMTricorderOnRedshirt() { if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT)) demon1UseMTricorderOnCrewman(); } void Room::demon1UseMTricorderOnCrewman() { loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0); playSoundEffectIndex(0x04); showText(TX_SPEAKER_MCCOY, TX_DEM1_009); } void Room::demon1GetHand() { if (_roomVar.demon.numKlingonsKilled != 3) return; walkCrewman(OBJECT_KIRK, 0x104, 0x8e, 1); } void Room::demon1ReachedHand() { loadActorAnim2(OBJECT_KIRK, "s5r1kg", -1, -1, 6); } void Room::demon1PickedUpHand() { loadActorStandAnim(13); _awayMission->demon.missionScore += 3; loadActorStandAnim(OBJECT_KIRK); _awayMission->timers[4] = 2; } // Timer 4 expired void Room::demon1FinishedGettingHand() { if (_awayMission->demon.tookKlingonHand) showDescription(TX_DEM1N005); else { _awayMission->demon.tookKlingonHand = true; giveItem(OBJECT_IHAND); showDescription(TX_DEM1N007); } } void Room::demon1LookAtKlingon() { showDescription(TX_DEM1N004); } void Room::demon1LookAtCattails() { showDescription(TX_DEM1N018); } void Room::demon1LookAtTulips() { showDescription(TX_DEM1N010); } void Room::demon1LookAtPods() { showDescription(TX_DEM1N019); } void Room::demon1LookAtFerns() { showDescription(TX_DEM1N009); } void Room::demon1LookAtStream() { showDescription(TX_DEM1N011); } void Room::demon1LookAtMine() { showDescription(TX_DEM1N021); } void Room::demon1LookAtMountain() { showDescription(TX_DEM1N016); } void Room::demon1LookAtHand() { showDescription(TX_DEM1N023); } void Room::demon1LookAnywhere() { showDescription(TX_DEM1N017); } void Room::demon1LookAtKirk() { if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK)) showDescription(TX_DEM1N012); else showDescription(TX_DEM1N003); } void Room::demon1LookAtSpock() { if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK)) showDescription(TX_DEM1N015); else showDescription(TX_DEM1N008); } void Room::demon1LookAtMcCoy() { if (_awayMission->crewDownBitset & (1 << OBJECT_MCCOY)) showDescription(TX_DEM1N013); else showDescription(TX_DEM1N001); } void Room::demon1LookAtRedshirt() { if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT)) showDescription(TX_DEM1N014); else showDescription(TX_DEM1N002); } void Room::demon1TalkToKirk() { if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK)) demon1TalkToUnconsciousCrewman(); else if (_roomVar.demon.numKlingonsKilled == 3) showText(TX_SPEAKER_KIRK, TX_DEM1_001); } void Room::demon1TalkToSpock() { if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK)) demon1TalkToUnconsciousCrewman(); else { showText(TX_SPEAKER_SPOCK, TX_DEM1_022); showText(TX_SPEAKER_MCCOY, TX_DEM1_013); showText(TX_SPEAKER_SPOCK, TX_DEM1_024); showText(TX_SPEAKER_MCCOY, TX_DEM1_014); } } void Room::demon1TalkToMcCoy() { if (_awayMission->crewDownBitset & (1 << OBJECT_MCCOY)) demon1TalkToUnconsciousCrewman(); else { showText(TX_SPEAKER_MCCOY, TX_DEM1_015); showText(TX_SPEAKER_SPOCK, TX_DEM1_023); } } void Room::demon1TalkToRedshirt() { if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT)) demon1TalkToUnconsciousCrewman(); else showText(TX_SPEAKER_EVERTS, TX_DEM1_026); } // FIXME: this doesn't happen in actual game? (does the event get blocked from higher up?) void Room::demon1TalkToUnconsciousCrewman() { const char *text[] = { nullptr, "Zzzzz....", ""}; showRoomSpecificText(text); } }
vanfanel/scummvm
engines/startrek/rooms/demon1.cpp
C++
gpl-2.0
22,279
<?php defined('_JEXEC') or die; class LinkrControllerExport extends JController { function LinkrControllerExport() { parent::__construct(); } function import() { JRequest::checkToken() or jexit('invalid token'); $source = JRequest::getWord('source', 'file'); $model = & $this->getModel('export'); if ($new = $model->import($source)) { $msg = JText::sprintf('X_BMS', $new); } else { $msg = $model->getError(); } $this->setRedirect(index .'&view=export', $msg); } }
aktfrikshun/GreenDominion
test/administrator/components/com_linkr/controllers/export.php
PHP
gpl-2.0
500
<?php /** * AJAX handler to look up DOI data. * * PHP version 7 * * Copyright (C) Villanova University 2018. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package AJAX * @author Demian Katz <[email protected]> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development Wiki */ namespace VuFind\AjaxHandler; use VuFind\DoiLinker\PluginManager; use Zend\Mvc\Controller\Plugin\Params; /** * AJAX handler to look up DOI data. * * @category VuFind * @package AJAX * @author Demian Katz <[email protected]> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development Wiki */ class DoiLookup extends AbstractBase { /** * DOI Linker Plugin Manager * * @var PluginManager */ protected $pluginManager; /** * DOI resolver configuration value * * @var string */ protected $resolver; /** * Constructor * * @param PluginManager $pluginManager DOI Linker Plugin Manager * @param string $resolver DOI resolver configuration value */ public function __construct(PluginManager $pluginManager, $resolver) { $this->pluginManager = $pluginManager; $this->resolver = $resolver; } /** * Handle a request. * * @param Params $params Parameter helper from controller * * @return array [response data, HTTP status code] */ public function handleRequest(Params $params) { $response = []; if ($this->pluginManager->has($this->resolver)) { $dois = (array)$params->fromQuery('doi', []); $response = $this->pluginManager->get($this->resolver)->getLinks($dois); } return $this->formatResponse($response); } }
arto70/NDL-VuFind2
module/VuFind/src/VuFind/AjaxHandler/DoiLookup.php
PHP
gpl-2.0
2,526
<?php /** Nedersaksisch (Nedersaksisch) * * See MessagesQqq.php for message documentation incl. usage of parameters * To improve a translation please visit http://translatewiki.net * * @ingroup Language * @file * * @author Erwin * @author Erwin85 * @author Jens Frank * @author Kaganer * @author Purodha * @author Servien * @author Slomox * @author Urhixidur * @author Ævar Arnfjörð Bjarmason <[email protected]> * @author לערי ריינהארט */ $fallback = 'nl'; $namespaceNames = array( NS_MEDIA => 'Media', NS_SPECIAL => 'Speciaal', NS_TALK => 'Overleg', NS_USER => 'Gebruker', NS_USER_TALK => 'Overleg_gebruker', NS_PROJECT_TALK => 'Overleg_$1', NS_FILE => 'Ofbeelding', NS_FILE_TALK => 'Overleg_ofbeelding', NS_MEDIAWIKI => 'MediaWiki', NS_MEDIAWIKI_TALK => 'Overleg_MediaWiki', NS_TEMPLATE => 'Mal', NS_TEMPLATE_TALK => 'Overleg_mal', NS_HELP => 'Hulpe', NS_HELP_TALK => 'Overleg_hulpe', NS_CATEGORY => 'Kattegerie', NS_CATEGORY_TALK => 'Overleg_kattegerie', ); $namespaceAliases = array( 'Speciaol' => NS_SPECIAL, 'Sjabloon' => NS_TEMPLATE, 'Overleg_sjabloon' => NS_TEMPLATE_TALK, 'Categorie' => NS_CATEGORY, 'Overleg_categorie' => NS_CATEGORY_TALK, 'Overleg_help' => NS_HELP_TALK, ); $dateFormats = array( 'mdy time' => 'H:i', 'mdy date' => 'M j, Y', 'mdy both' => 'H:i, M j, Y', 'dmy time' => 'H:i', 'dmy date' => 'j M Y', 'dmy both' => 'H:i, j M Y', 'ymd time' => 'H:i', 'ymd date' => 'Y M j', 'ymd both' => 'H:i, Y M j', ); $bookstoreList = array( 'Koninklijke Bibliotheek' => 'http://opc4.kb.nl/DB=1/SET=5/TTL=1/CMD?ACT=SRCH&IKT=1007&SRT=RLV&TRM=$1' ); #!!# Translation <b>HLEERSTE:</b> is used more than once for <a href="#mw-sp-magic-lcfirst">lcfirst</a> and <a href="#mw-sp-magic-ucfirst">ucfirst</a>. $magicWords = array( 'redirect' => array( '0', '#DEURVERWIEZING', '#DOORVERWIJZING', '#REDIRECT' ), 'notoc' => array( '0', '__GIENONDERWARPEN__', '__GEENINHOUD__', '__NOTOC__' ), 'nogallery' => array( '0', '__GIENGALLERIEJE__', '__GEEN_GALERIJ__', '__NOGALLERY__' ), 'forcetoc' => array( '0', '__FORCEERONDERWARPEN__', '__INHOUD_DWINGEN__', '__FORCEERINHOUD__', '__FORCETOC__' ), 'toc' => array( '0', '__ONDERWARPEN__', '__INHOUD__', '__TOC__' ), 'noeditsection' => array( '0', '__GIENBEWARKSECTIE__', '__NIETBEWERKBARESECTIE__', '__NOEDITSECTION__' ), 'noheader' => array( '0', '__GIENKOPJEN__', '__GEENKOP__', '__NOHEADER__' ), 'currentmonth' => array( '1', 'DISSEMAOND', 'HUIDIGEMAAND', 'HUIDIGEMAAND2', 'CURRENTMONTH', 'CURRENTMONTH2' ), 'currentmonthname' => array( '1', 'DISSEMAONDNAAM', 'HUIDIGEMAANDNAAM', 'CURRENTMONTHNAME' ), 'currentmonthnamegen' => array( '1', 'DISSEMAONDGEN', 'HUIDIGEMAANDGEN', 'CURRENTMONTHNAMEGEN' ), 'currentmonthabbrev' => array( '1', 'DISSEMAONDOFK', 'HUIDIGEMAANDAFK', 'CURRENTMONTHABBREV' ), 'currentday' => array( '1', 'DISSEDAG', 'HUIDIGEDAG', 'CURRENTDAY' ), 'currentday2' => array( '1', 'DISSEDAG2', 'HUIDIGEDAG2', 'CURRENTDAY2' ), 'currentdayname' => array( '1', 'DISSEDAGNAAM', 'HUIDIGEDAGNAAM', 'CURRENTDAYNAME' ), 'currentyear' => array( '1', 'DITJAOR', 'HUIDIGJAAR', 'CURRENTYEAR' ), 'currenttime' => array( '1', 'DISSETIED', 'HUIDIGETIJD', 'CURRENTTIME' ), 'currenthour' => array( '1', 'DITURE', 'HUIDIGUUR', 'CURRENTHOUR' ), 'localmonth' => array( '1', 'LOKALEMAOND', 'PLAATSELIJKEMAAND', 'LOKALEMAAND', 'LOKALEMAAND2', 'LOCALMONTH', 'LOCALMONTH2' ), 'localmonth1' => array( '1', 'LOKALEMAOND1', 'LOKALEMAAND1', 'LOCALMONTH1' ), 'localmonthname' => array( '1', 'LOKALEMAONDNAAM', 'PLAATSELIJKEMAANDNAAM', 'LOKALEMAANDNAAM', 'LOCALMONTHNAME' ), 'localmonthnamegen' => array( '1', 'LOKALEMAONDNAAMGEN', 'PLAATSELIJKEMAANDNAAMGEN', 'LOKALEMAANDNAAMGEN', 'LOCALMONTHNAMEGEN' ), 'localmonthabbrev' => array( '1', 'LOKALEMAONDOFK', 'PLAATSELIJKEMAANDAFK', 'LOKALEMAANDAFK', 'LOCALMONTHABBREV' ), 'localday' => array( '1', 'LOKALEDAG', 'PLAATSELIJKEDAG', 'LOCALDAY' ), 'localday2' => array( '1', 'LOKALEDAG2', 'PLAATSELIJKEDAG2', 'LOCALDAY2' ), 'localdayname' => array( '1', 'LOKALEDAGNAAM', 'PLAATSELIJKEDAGNAAM', 'LOCALDAYNAME' ), 'localyear' => array( '1', 'LOKAALJAOR', 'PLAATSELIJKJAAR', 'LOKAALJAAR', 'LOCALYEAR' ), 'localtime' => array( '1', 'LOKALETIED', 'PLAATSELIJKETIJD', 'LOKALETIJD', 'LOCALTIME' ), 'localhour' => array( '1', 'LOKAALURE', 'PLAATSELIJKUUR', 'LOKAALUUR', 'LOCALHOUR' ), 'numberofpages' => array( '1', 'ANTALPAGINAS', 'ANTALPAGINA\'S', 'ANTALPAGINA’S', 'AANTALPAGINAS', 'AANTALPAGINA\'S', 'AANTALPAGINA’S', 'NUMBEROFPAGES' ), 'numberofarticles' => array( '1', 'ANTALARTIKELS', 'AANTALARTIKELEN', 'NUMBEROFARTICLES' ), 'numberoffiles' => array( '1', 'ANTALBESTANDEN', 'AANTALBESTANDEN', 'NUMBEROFFILES' ), 'numberofusers' => array( '1', 'ANTALGEBRUKERS', 'AANTALGEBRUIKERS', 'NUMBEROFUSERS' ), 'numberofactiveusers' => array( '1', 'ANTALACTIEVEGEBRUKERS', 'AANTALACTIEVEGEBRUIKERS', 'ACTIEVEGEBRUIKERS', 'NUMBEROFACTIVEUSERS' ), 'numberofedits' => array( '1', 'ANTALBEWARKINGEN', 'AANTALBEWERKINGEN', 'NUMBEROFEDITS' ), 'numberofviews' => array( '1', 'ANTALKERENBEKEKEN', 'AANTALKERENBEKEKEN', 'NUMBEROFVIEWS' ), 'pagename' => array( '1', 'PAGINANAAM', 'PAGENAME' ), 'pagenamee' => array( '1', 'PAGINANAAME', 'PAGENAMEE' ), 'namespace' => array( '1', 'NAAMRUUMTE', 'NAAMRUIMTE', 'NAMESPACE' ), 'namespacee' => array( '1', 'NAAMRUUMTEE', 'NAAMRUIMTEE', 'NAMESPACEE' ), 'talkspace' => array( '1', 'OVERLEGRUUMTE', 'OVERLEGRUIMTE', 'TALKSPACE' ), 'talkspacee' => array( '1', 'OVERLEGRUUMTEE', 'OVERLEGRUIMTEE', 'TALKSPACEE' ), 'subjectspace' => array( '1', 'ONDERWARPRUUMTE', 'ARTIKELRUUMTE', 'ONDERWERPRUIMTE', 'ARTIKELRUIMTE', 'SUBJECTSPACE', 'ARTICLESPACE' ), 'subjectspacee' => array( '1', 'ONDERWARPRUUMTEE', 'ARTIKELRUUMTEE', 'ONDERWERPRUIMTEE', 'ARTIKELRUIMTEE', 'SUBJECTSPACEE', 'ARTICLESPACEE' ), 'fullpagename' => array( '1', 'HELEPAGINANAAM', 'VOLLEDIGEPAGINANAAM', 'FULLPAGENAME' ), 'fullpagenamee' => array( '1', 'HELEPAGINANAAME', 'VOLLEDIGEPAGINANAAME', 'FULLPAGENAMEE' ), 'subpagename' => array( '1', 'DEELPAGINANAAM', 'SUBPAGENAME' ), 'subpagenamee' => array( '1', 'DEELPAGINANAAME', 'SUBPAGENAMEE' ), 'basepagename' => array( '1', 'BAOSISPAGINANAAM', 'BASISPAGINANAAM', 'BASEPAGENAME' ), 'basepagenamee' => array( '1', 'BAOSISPAGINANAAME', 'BASISPAGINANAAME', 'BASEPAGENAMEE' ), 'talkpagename' => array( '1', 'OVERLEGPAGINANAAM', 'TALKPAGENAME' ), 'talkpagenamee' => array( '1', 'OVERLEGPAGINANAAME', 'TALKPAGENAMEE' ), 'subjectpagename' => array( '1', 'ONDERWARPPAGINANAAM', 'ARTIKELPAGINANAAM', 'ONDERWERPPAGINANAAM', 'SUBJECTPAGENAME', 'ARTICLEPAGENAME' ), 'subjectpagenamee' => array( '1', 'ONDERWARPPAGINANAAME', 'ARTIKELPAGINANAAME', 'ONDERWERPPAGINANAAME', 'SUBJECTPAGENAMEE', 'ARTICLEPAGENAMEE' ), 'msg' => array( '0', 'BERICH:', 'BERICHT:', 'MSG:' ), 'subst' => array( '0', 'VERVANG:', 'VERV:', 'SUBST:' ), 'msgnw' => array( '0', 'BERICHNW', 'BERICHTNW', 'MSGNW:' ), 'img_thumbnail' => array( '1', 'duumnegel', 'doemnaegel', 'miniatuur', 'thumbnail', 'thumb' ), 'img_manualthumb' => array( '1', 'duumnegel=$1', 'doemnegel=$1', 'miniatuur=$1', 'thumbnail=$1', 'thumb=$1' ), 'img_right' => array( '1', 'rechs', 'rechts', 'right' ), 'img_left' => array( '1', 'links', 'left' ), 'img_none' => array( '1', 'gien', 'geen', 'none' ), 'img_center' => array( '1', 'ecentreerd', 'gecentreerd', 'center', 'centre' ), 'img_framed' => array( '1', 'umraand', 'omkaderd', 'framed', 'enframed', 'frame' ), 'img_frameless' => array( '1', 'kaoderloos', 'kaderloos', 'frameless' ), 'img_page' => array( '1', 'pagina=$1', 'pagina $1', 'page=$1', 'page $1' ), 'img_upright' => array( '1', 'rechop', 'rechop=$1', 'rechop $1', 'rechtop', 'rechtop=$1', 'rechtop$1', 'upright', 'upright=$1', 'upright $1' ), 'img_border' => array( '1', 'raand', 'rand', 'border' ), 'img_baseline' => array( '1', 'grondliende', 'grondlijn', 'baseline' ), 'img_top' => array( '1', 'boven', 'top' ), 'img_text_top' => array( '1', 'tekse-boven', 'tekst-boven', 'text-top' ), 'img_middle' => array( '1', 'midden', 'middle' ), 'img_bottom' => array( '1', 'benejen', 'beneden', 'bottom' ), 'img_text_bottom' => array( '1', 'tekse-benejen', 'tekst-beneden', 'text-bottom' ), 'img_link' => array( '1', 'verwiezing=$', 'verwijzing=$1', 'link=$1' ), 'sitename' => array( '1', 'WEBSTEENAAM', 'SITENAAM', 'SITENAME' ), 'ns' => array( '0', 'NR:', 'NS:' ), 'localurl' => array( '0', 'LOKALEURL', 'LOCALURL:' ), 'localurle' => array( '0', 'LOKALEURLE', 'LOCALURLE:' ), 'servername' => array( '0', 'SERVERNAAM', 'SERVERNAME' ), 'scriptpath' => array( '0', 'SCRIPTPAD', 'SCRIPTPATH' ), 'grammar' => array( '0', 'GRAMMATICA:', 'GRAMMAR:' ), 'gender' => array( '0', 'GESLACH:', 'GESLACHT:', 'GENDER:' ), 'notitleconvert' => array( '0', '__GIENTITELCONVERSIE__', '__GIENTC__', '__GEENTITELCONVERSIE__', '__GEENTC__', '__GEENPAGINANAAMCONVERSIE__', '__NOTITLECONVERT__', '__NOTC__' ), 'nocontentconvert' => array( '0', '__GIENINHOUDCONVERSIE__', '__GIENIC__', '__GEENINHOUDCONVERSIE__', '__GEENIC__', '__NOCONTENTCONVERT__', '__NOCC__' ), 'currentweek' => array( '1', 'DISSEWEKE', 'HUIDIGEWEEK', 'CURRENTWEEK' ), 'currentdow' => array( '1', 'DISSEDVDW', 'HUIDIGEDVDW', 'CURRENTDOW' ), 'localweek' => array( '1', 'LOKALEWEKE', 'PLAATSELIJKEWEEK', 'LOKALEWEEK', 'LOCALWEEK' ), 'localdow' => array( '1', 'LOKALEDVDW', 'PLAATSELIJKEDVDW', 'LOCALDOW' ), 'revisionid' => array( '1', 'REVISIEID', 'REVISIE-ID', 'VERSIEID', 'REVISIONID' ), 'revisionday' => array( '1', 'REVISIEDAG', 'VERSIEDAG', 'REVISIONDAY' ), 'revisionday2' => array( '1', 'REVISIEDAG2', 'VERSIEDAG2', 'REVISIONDAY2' ), 'revisionmonth' => array( '1', 'REVISIEMAOND', 'VERSIEMAAND', 'REVISIONMONTH' ), 'revisionyear' => array( '1', 'REVISIEJAOR', 'VERSIEJAAR', 'REVISIONYEAR' ), 'revisiontimestamp' => array( '1', 'REVISIETIEDSTEMPEL', 'VERSIETIJD', 'REVISIONTIMESTAMP' ), 'revisionuser' => array( '1', 'VERSIEGEBRUKER', 'VERSIEGEBRUIKER', 'REVISIONUSER' ), 'plural' => array( '0', 'MEERVOUD:', 'PLURAL:' ), 'fullurl' => array( '0', 'HELEURL', 'VOLLEDIGEURL', 'FULLURL:' ), 'fullurle' => array( '0', 'HELEURLE', 'VOLLEDIGEURLE', 'FULLURLE:' ), 'lcfirst' => array( '0', 'HLEERSTE:', 'KLEERSTE:', 'LCFIRST:' ), 'ucfirst' => array( '0', 'GLEERSTE:', 'HLEERSTE:', 'UCFIRST:' ), 'lc' => array( '0', 'KL:', 'LC:' ), 'uc' => array( '0', 'HL:', 'UC:' ), 'raw' => array( '0', 'RAUW:', 'RUW:', 'RAW:' ), 'displaytitle' => array( '1', 'TEUNTITEL', 'TOONTITEL', 'TITELTONEN', 'DISPLAYTITLE' ), 'newsectionlink' => array( '1', '__NIEJESECTIEVERWIEZING__', '__NIEUWESECTIELINK__', '__NIEUWESECTIEKOPPELING__', '__NEWSECTIONLINK__' ), 'nonewsectionlink' => array( '1', '__GIENNIEJKOPJENVERWIEZING__', '__GEENNIEUWKOPJEVERWIJZING__', '__GEENNIEUWESECTIELINK__', '__NONEWSECTIONLINK__' ), 'currentversion' => array( '1', 'DISSEVERSIE', 'HUIDIGEVERSIE', 'CURRENTVERSION' ), 'urlencode' => array( '0', 'CODEERURL', 'URLCODEREN', 'URLENCODE:' ), 'anchorencode' => array( '0', 'CODEERANKER', 'ANKERCODEREN', 'ANCHORENCODE' ), 'currenttimestamp' => array( '1', 'DISSETIEDSTEMPEL', 'HUIDIGETIJDSTEMPEL', 'CURRENTTIMESTAMP' ), 'localtimestamp' => array( '1', 'LOKALETIEDSTEMPEL', 'PLAATSELIJKETIJDSTEMPEL', 'LOKALETIJDSTEMPEL', 'LOCALTIMESTAMP' ), 'directionmark' => array( '1', 'RICHTINGMARKERING', 'RICHTINGSMARKERING', 'DIRECTIONMARK', 'DIRMARK' ), 'language' => array( '0', '#TAAL:', '#LANGUAGE:' ), 'contentlanguage' => array( '1', 'INHOUDSTAAL', 'INHOUDTAAL', 'CONTENTLANGUAGE', 'CONTENTLANG' ), 'pagesinnamespace' => array( '1', 'PAGINASINNAAMRUUMTE', 'PAGINA’SINNAAMRUUMTE', 'PAGINA\'SINNAAMRUUMTE', 'PAGINASINNAAMRUIMTE', 'PAGINA’SINNAAMRUIMTE', 'PAGINA\'SINNAAMRUIMTE', 'PAGESINNAMESPACE:', 'PAGESINNS:' ), 'numberofadmins' => array( '1', 'ANTALBEHEERDERS', 'AANTALBEHEERDERS', 'AANTALADMINS', 'NUMBEROFADMINS' ), 'formatnum' => array( '0', 'FORMATTEERNUM', 'NUMFORMATTEREN', 'FORMATNUM' ), 'padleft' => array( '0', 'LINKSOPVULLEN', 'PADLEFT' ), 'padright' => array( '0', 'RECHSOPVULLEN', 'RECHTSOPVULLEN', 'PADRIGHT' ), 'special' => array( '0', 'speciaal', 'special' ), 'defaultsort' => array( '1', 'STANDARDSORTERING:', 'STANDAARDSORTERING:', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ), 'filepath' => array( '0', 'BESTANSPAD:', 'BESTANDSPAD:', 'FILEPATH:' ), 'tag' => array( '0', 'etiket', 'label', 'tag' ), 'hiddencat' => array( '1', '__VERBÖRGENKAT__', '__VERBORGENCAT__', '__HIDDENCAT__' ), 'pagesincategory' => array( '1', 'PAGINASINKATTEGERIE', 'PAGINASINKAT', 'PAGINASINCATEGORIE', 'PAGINASINCAT', 'PAGESINCATEGORY', 'PAGESINCAT' ), 'pagesize' => array( '1', 'PAGINAGROOTTE', 'PAGESIZE' ), 'noindex' => array( '1', '__GIENINDEX__', '__GEENINDEX__', '__NOINDEX__' ), 'numberingroup' => array( '1', 'ANTALINGROEP', 'AANTALINGROEP', 'NUMBERINGROUP', 'NUMINGROUP' ), 'staticredirect' => array( '1', '__STAOTISCHEDEURVERWIEZING__', '__STATISCHEDOORVERWIJZING__', '__STATISCHEREDIRECT__', '__STATICREDIRECT__' ), 'protectionlevel' => array( '1', 'BEVEILIGINGSNIVO', 'BEVEILIGINGSNIVEAU', 'PROTECTIONLEVEL' ), 'formatdate' => array( '0', 'daotumopmaak', 'datumopmaak', 'formatdate', 'dateformat' ), ); $specialPageAliases = array( 'Activeusers' => array( 'Actieve_gebrukers' ), 'Allmessages' => array( 'Alle_systeemteksen' ), 'Allpages' => array( 'Alle_pagina\'s' ), 'Ancientpages' => array( 'Oudste_pagina\'s' ), 'Blankpage' => array( 'Lege_pagina' ), 'Block' => array( 'Blokkeer_IP' ), 'Blockme' => array( 'Blokkeer_mien' ), 'Booksources' => array( 'Boekinfermasie' ), 'BrokenRedirects' => array( 'Ebreuken_deurverwiezingen' ), 'Categories' => array( 'Kattegerieën' ), 'ChangePassword' => array( 'Wachwoord_wiezigen' ), 'Confirmemail' => array( 'Netpos_bevestigen' ), 'Contributions' => array( 'Biedragen' ), 'CreateAccount' => array( 'Gebruker_anmaken' ), 'Deadendpages' => array( 'Gien_verwiezingen' ), 'DeletedContributions' => array( 'Vort-ehaolen_gebrukersbiedragen' ), 'Disambiguations' => array( 'Deurverwiespagina\'s' ), 'DoubleRedirects' => array( 'Dubbele_deurverwiezingen' ), 'Emailuser' => array( 'Berich_sturen' ), 'Export' => array( 'Uutvoeren' ), 'Fewestrevisions' => array( 'Minste_bewarkingen' ), 'FileDuplicateSearch' => array( 'Dubbele_bestanen_zeuken' ), 'Filepath' => array( 'Bestaanslokasie' ), 'Import' => array( 'Invoeren' ), 'Invalidateemail' => array( 'Netpos_ongeldig' ), 'BlockList' => array( 'IP-blokkeerlieste' ), 'LinkSearch' => array( 'Verwiezingen_zeuken' ), 'Listadmins' => array( 'Beheerderslieste' ), 'Listbots' => array( 'Botlieste' ), 'Listfiles' => array( 'Ofbeeldingenlieste' ), 'Listgrouprights' => array( 'Groepsrechen_bekieken' ), 'Listredirects' => array( 'Deurverwiezingslieste' ), 'Listusers' => array( 'Gebrukerslieste' ), 'Lockdb' => array( 'Databanke_blokkeren' ), 'Log' => array( 'Logboeken' ), 'Lonelypages' => array( 'Weespagina\'s' ), 'Longpages' => array( 'Lange_artikels' ), 'MergeHistory' => array( 'Geschiedenisse_bie_mekaar_doon' ), 'MIMEsearch' => array( 'MIME-zeuken' ), 'Mostcategories' => array( 'Meeste_kattegerieën' ), 'Mostimages' => array( 'Meeste_ofbeeldingen' ), 'Mostlinked' => array( 'Meest_naor_verwezen_pagina\'s' ), 'Mostlinkedcategories' => array( 'Meestgebruken_kattegerieën' ), 'Mostlinkedtemplates' => array( 'Meest_naor_verwezen_mallen' ), 'Mostrevisions' => array( 'Meeste_bewarkingen' ), 'Movepage' => array( 'Herneum_pagina' ), 'Mycontributions' => array( 'Mien_biedragen' ), 'Mypage' => array( 'Mien_gebrukerspagina' ), 'Mytalk' => array( 'Mien_overleg' ), 'Myuploads' => array( 'Mien_in-elaojen_bestanen' ), 'Newimages' => array( 'Nieje_ofbeeldingen' ), 'Newpages' => array( 'Nieje_pagina\'s' ), 'PasswordReset' => array( 'Wachwoord_opniej_instellen' ), 'PermanentLink' => array( 'Vaste_verwiezing' ), 'Popularpages' => array( 'Populaire_artikels' ), 'Preferences' => array( 'Veurkeuren' ), 'Prefixindex' => array( 'Veurvoegselindex' ), 'Protectedpages' => array( 'Beveiligen_pagina\'s' ), 'Protectedtitles' => array( 'Beveiligen_titels' ), 'Randompage' => array( 'Zomer_een_artikel' ), 'Randomredirect' => array( 'Willekeurige_deurverwiezing' ), 'Recentchanges' => array( 'Leste_wiezigingen' ), 'Recentchangeslinked' => array( 'Volg_verwiezingen' ), 'Revisiondelete' => array( 'Versie_vortdoon' ), 'RevisionMove' => array( 'Versie_verplaosen' ), 'Search' => array( 'Zeuken' ), 'Shortpages' => array( 'Korte_artikels' ), 'Specialpages' => array( 'Speciale_pagina\'s' ), 'Statistics' => array( 'Staotestieken' ), 'Tags' => array( 'Etiketten' ), 'Uncategorizedcategories' => array( 'Kattergieën_zonder_kattegerie' ), 'Uncategorizedimages' => array( 'Ofbeeldingen_zonder_kattegerie' ), 'Uncategorizedpages' => array( 'Pagina\'s_zonder_kattegerie' ), 'Uncategorizedtemplates' => array( 'Mallen_zonder_kattegerie' ), 'Undelete' => array( 'Weerummeplaosen' ), 'Unlockdb' => array( 'Databanke_vriegeven' ), 'Unusedcategories' => array( 'Ongebruken_kattegerieën' ), 'Unusedimages' => array( 'Ongebruken_ofbeeldingen' ), 'Unusedtemplates' => array( 'Ongebruken_mallen' ), 'Unwatchedpages' => array( 'Neet-evolgen_pagina\'s' ), 'Upload' => array( 'Bestanen_opsturen' ), 'UploadStash' => array( 'Bestanenstallige' ), 'Userlogin' => array( 'Anmelden' ), 'Userlogout' => array( 'Ofmelden' ), 'Userrights' => array( 'Gebrukersrechen' ), 'Version' => array( 'Versie' ), 'Wantedcategories' => array( 'Gewunste_kattegerieën' ), 'Wantedfiles' => array( 'Gewunste_bestanen' ), 'Wantedpages' => array( 'Gewunste_pagina\'s' ), 'Wantedtemplates' => array( 'Gewunste_mallen' ), 'Watchlist' => array( 'Volglieste' ), 'Whatlinkshere' => array( 'Verwiezingen_naor_disse_pagina' ), 'Withoutinterwiki' => array( 'Gien_interwiki' ), ); $linkTrail = '/^([a-zäöüïëéèà]+)(.*)$/sDu'; $messages = array( # User preference toggles 'tog-underline' => 'Verwiezingen onderstrepen', 'tog-highlightbroken' => "Verwiezingen naor lege pagina's op laoten lochten", 'tog-justify' => "Alinea's uutvullen", 'tog-hideminor' => 'Kleine wiezigingen verbargen in leste wiezigingen', 'tog-hidepatrolled' => 'Wiezigingen die emarkeerd bin verbargen in leste wiezigingen', 'tog-newpageshidepatrolled' => "Pagina's die emarkeerd bin, verbargen in de lieste mit nieje artikels", 'tog-extendwatchlist' => 'Volglieste uutbreien, zodat alle wiezigingen zichtbaor bin, en niet allinnig de leste wieziging', 'tog-usenewrc' => "Gebruuk de pagina uutebreiden leste wiezigingen (hierveur he'j JavaScript neudig)", 'tog-numberheadings' => 'Koppen vanzelf nummeren', 'tog-showtoolbar' => 'Laot de warkbalke zien', 'tog-editondblclick' => 'Mit dubbelklik bewarken (JavaScript)', 'tog-editsection' => 'Mit bewarkgedeeltes', 'tog-editsectiononrightclick' => 'Bewarkgedeelte mit rechtermuusknoppe bewarken (JavaScript)', 'tog-showtoc' => 'Samenvatting van de onderwarpen laoten zien (mit meer as dree onderwarpen)', 'tog-rememberpassword' => 'Vanzelf anmelden (hooguut $1 {{PLURAL:$1|dag|dagen}})', 'tog-watchcreations' => "Pagina's die'k anmake op mien volglieste zetten", 'tog-watchdefault' => "Pagina's die'k wiezige op mien volglieste zetten", 'tog-watchmoves' => "Pagina's die'k herneume op mien volglieste zetten", 'tog-watchdeletion' => "Pagina's die'k vortdo op mien volglieste zetten", 'tog-minordefault' => "Markeer alle veraanderingen as 'kleine wieziging'", 'tog-previewontop' => 'De naokiekpagina boven t bewarkingsveld zetten', 'tog-previewonfirst' => 'Naokieken bie eerste wieziging', 'tog-nocache' => 'De tussenopslag van de webkieker uutzetten', 'tog-enotifwatchlistpages' => 'Stuur mien n berichjen over paginawiezigingen.', 'tog-enotifusertalkpages' => 'Stuur mien n berichjen as mien overlegpagina ewiezigd is.', 'tog-enotifminoredits' => 'Stuur mien oek n berichjen bie kleine bewarkingen', 'tog-enotifrevealaddr' => 'Mien netpostadres laoten zien in netposttiejigen', 'tog-shownumberswatching' => 't Antal gebrukers bekieken die disse pagina volgt', 'tog-oldsig' => 'Bestaonde haandtekening:', 'tog-fancysig' => 'Ondertekening zien as wikitekste (zonder automatiese verwiezing)', 'tog-externaleditor' => 'Standard n externe tekstbewarker gebruken (allinnig veur gevorderden - veur disse funksie bin spesiale instellingen neudig. [//www.mediawiki.org/wiki/Manual:External_editors Meer informasie]).', 'tog-externaldiff' => 'Standard n extern vergeliekingsprogramma gebruken (allinnig veur gevorderden - veur disse funksie bin spesiale instellingen neudig. [//www.mediawiki.org/wiki/Manual:External_editors Meer informasie]).', 'tog-showjumplinks' => '"Gao naor"-verwiezingen toelaoten', 'tog-uselivepreview' => 'Gebruuk "rechtstreeks naokieken" (mö\'j JavaScript veur hebben - experimenteel)', 'tog-forceeditsummary' => 'Geef n melding bie n lege samenvatting', 'tog-watchlisthideown' => 'Verbarg mien eigen bewarkingen', 'tog-watchlisthidebots' => 'Verbarg botgebrukers', 'tog-watchlisthideminor' => 'Verbarg kleine wiezigingen in mien volglieste', 'tog-watchlisthideliu' => 'Bewarkingen van an-emelde gebrukers op mien volglieste verbargen', 'tog-watchlisthideanons' => 'Bewarkingen van anonieme gebrukers op mien volglieste verbargen', 'tog-watchlisthidepatrolled' => 'Wiezigingen die emarkeerd bin op volglieste verbargen', 'tog-nolangconversion' => 't Ummezetten van variaanten uutschakelen', 'tog-ccmeonemails' => 'Stuur mien kopieën van berichten an aandere gebrukers', 'tog-diffonly' => 'Laot de pagina-inhoud niet onder de an-egeven wiezigingen zien.', 'tog-showhiddencats' => 'Laot verbörgen kategorieën zien', 'tog-noconvertlink' => 'Paginanaamkonversie uutschakelen', 'tog-norollbackdiff' => 'Wiezigingen vortlaoten nao t weerummedreien', 'underline-always' => 'Altied', 'underline-never' => 'Nooit', 'underline-default' => 'Standardinstelling', # Font style option in Special:Preferences 'editfont-style' => 'Lettertype veur de tekste t bewarkingsveld:', 'editfont-default' => 'Standardwebkieker', 'editfont-monospace' => 'Lettertype waorvan t tekenbreedte vaste steet', 'editfont-sansserif' => 'Sans-seriflettertype', 'editfont-serif' => 'Seriflettertype', # Dates 'sunday' => 'zundag', 'monday' => 'maondag', 'tuesday' => 'diensdag', 'wednesday' => 'woonsdag', 'thursday' => 'donderdag', 'friday' => 'vriedag', 'saturday' => 'zaoterdag', 'sun' => 'zun', 'mon' => 'mao', 'tue' => 'die', 'wed' => 'woo', 'thu' => 'don', 'fri' => 'vrie', 'sat' => 'zao', 'january' => 'jannewaori', 'february' => 'febrewaori', 'march' => 'meert', 'april' => 'april', 'may_long' => 'mei', 'june' => 'juni', 'july' => 'juli', 'august' => 'augustus', 'september' => 'september', 'october' => 'oktober', 'november' => 'november', 'december' => 'desember', 'january-gen' => 'jannewaori', 'february-gen' => 'febrewaori', 'march-gen' => 'meert', 'april-gen' => 'april', 'may-gen' => 'mei', 'june-gen' => 'juni', 'july-gen' => 'juli', 'august-gen' => 'augustus', 'september-gen' => 'september', 'october-gen' => 'oktober', 'november-gen' => 'november', 'december-gen' => 'desember', 'jan' => 'jan', 'feb' => 'feb', 'mar' => 'mrt', 'apr' => 'apr', 'may' => 'mei', 'jun' => 'jun', 'jul' => 'jul', 'aug' => 'aug', 'sep' => 'sep', 'oct' => 'okt', 'nov' => 'nov', 'dec' => 'des', # Categories related messages 'pagecategories' => '{{PLURAL:$1|Kategorie|Kategorieën}}', 'category_header' => 'Artikels in kategorie $1', 'subcategories' => 'Subkategorieën', 'category-media-header' => 'Media in kategorie "$1"', 'category-empty' => "''In disse kategoria staon op t moment nog gien artikels of media.''", 'hidden-categories' => 'Verbörgen {{PLURAL:$1|kategorie|kategorieën}}', 'hidden-category-category' => 'Verbörgen kategorieën', 'category-subcat-count' => '{{PLURAL:$2|Disse kategorie hef de volgende subkategorie.|Disse kategorie hef de volgende {{PLURAL:$1|subkategorie|$1 subkategorieën}}, van in totaal $2.}}', 'category-subcat-count-limited' => 'Disse kategorie hef de volgende {{PLURAL:$1|subkategorie|$1 subkategorieën}}.', 'category-article-count' => "{{PLURAL:$2|In disse kategorie steet allinnig de volgende pagina.|De volgende {{PLURAL:$1|pagina steet|$1 pagina's staon}} in disse kategorie, van in totaal $2.}}", 'category-article-count-limited' => "In disse kategorie {{PLURAL:$1|steet de volgende pagina|staon de volgende $1 pagina's}}.", 'category-file-count' => 'In disse kategorie {{PLURAL:$2|steet t volgende bestaand|staon de volgende $1 bestaanden, van in totaal $2}}.', 'category-file-count-limited' => 'In disse kategorie {{PLURAL:$1|steet t volgende bestaand|staon de volgende $1 bestaanden}}.', 'listingcontinuesabbrev' => '(vervolg)', 'index-category' => "Pagina's die indexeerd bin", 'noindex-category' => "Pagina's die niet indexeerd bin", 'broken-file-category' => "Pagina's mit verkeerde bestaandsverwiezingen", 'about' => 'Informasie', 'article' => 'Artikel', 'newwindow' => '(niej vienster)', 'cancel' => 'Aofbreken', 'moredotdotdot' => 'Meer...', 'mypage' => 'Mien gebrukerspagina', 'mytalk' => 'Mien overleg', 'anontalk' => 'Overlegpagina veur dit IP-adres', 'navigation' => 'Navigasie', 'and' => '&#32;en', # Cologne Blue skin 'qbfind' => 'Zeuken', 'qbbrowse' => 'Blaojen', 'qbedit' => 'Bewark', 'qbpageoptions' => 'Pagina-opsies', 'qbpageinfo' => 'Pagina-informasie', 'qbmyoptions' => 'Veurkeuren', 'qbspecialpages' => "Spesiale pagina's", 'faq' => 'Vragen die vake esteld wörden', 'faqpage' => 'Project:Vragen die vake esteld wörden', # Vector skin 'vector-action-addsection' => 'Niej onderwarp', 'vector-action-delete' => 'Vortdoon', 'vector-action-move' => 'Herneumen', 'vector-action-protect' => 'Beveiligen', 'vector-action-undelete' => 'Weerummeplaotsen', 'vector-action-unprotect' => 'Beveiliging wiezigen', 'vector-simplesearch-preference' => 'Verbeterde zeuksuggesties anzetten (allinnig mit Vector-vormgeving)', 'vector-view-create' => 'Anmaken', 'vector-view-edit' => 'Bewarken', 'vector-view-history' => 'Geschiedenisse bekieken', 'vector-view-view' => 'Lezen', 'vector-view-viewsource' => 'Brontekste bekieken', 'actions' => 'Haandeling', 'namespaces' => 'Naamruumtes', 'variants' => 'Variaanten', 'errorpagetitle' => 'Foutmelding', 'returnto' => 'Weerumme naor $1.', 'tagline' => 'Van {{SITENAME}}', 'help' => 'Hulpe en kontakt', 'search' => 'Zeuken', 'searchbutton' => 'Zeuken', 'go' => 'Artikel', 'searcharticle' => 'Artikel', 'history' => 'Geschiedenisse', 'history_short' => 'Geschiedenisse', 'updatedmarker' => 'bie-ewörken sinds mien leste bezeuk', 'printableversion' => 'Aofdrokbaore versie', 'permalink' => 'Vaste verwiezing', 'print' => 'Aofdrokken', 'view' => 'Lezen', 'edit' => 'Bewarken', 'create' => 'Anmaken', 'editthispage' => 'Pagina bewarken', 'create-this-page' => 'Disse pagina anmaken', 'delete' => 'Vortdoon', 'deletethispage' => 'Disse pagina vortdoon', 'undelete_short' => '$1 {{PLURAL:$1|versie|versies}} weerummeplaotsen', 'viewdeleted_short' => '{{PLURAL:$1|Eén versie die vortedaon is|$1 versies die vortedaon bin}} bekieken', 'protect' => 'Beveiligen', 'protect_change' => 'wiezigen', 'protectthispage' => 'Beveiligen', 'unprotect' => 'Beveiliging wiezigen', 'unprotectthispage' => 'Beveiliging van disse pagina wiezigen', 'newpage' => 'Nieje pagina', 'talkpage' => 'Overlegpagina', 'talkpagelinktext' => 'Overleg', 'specialpage' => 'Spesiale pagina', 'personaltools' => 'Persoonlike instellingen', 'postcomment' => 'Niej onderwarp', 'articlepage' => 'Artikel', 'talk' => 'Overleg', 'views' => 'Aspekten/aksies', 'toolbox' => 'Hulpmiddels', 'userpage' => 'gebrukerspagina', 'projectpage' => 'Bekiek projektpagina', 'imagepage' => 'Bestaandspagina bekieken', 'mediawikipage' => 'Tiejige bekieken', 'templatepage' => 'Mal bekieken', 'viewhelppage' => 'Hulppagina bekieken', 'categorypage' => 'Kategoriepagina bekieken', 'viewtalkpage' => 'Bekiek overlegpagina', 'otherlanguages' => 'Aandere talen', 'redirectedfrom' => '(deurestuurd vanaof "$1")', 'redirectpagesub' => 'Deurstuurpagina', 'lastmodifiedat' => 'Disse pagina is t lest ewiezigd op $1 um $2.', 'viewcount' => 'Disse pagina is $1 {{PLURAL:$1|keer|keer}} bekeken.', 'protectedpage' => 'Beveiligden pagina', 'jumpto' => 'Gao naor:', 'jumptonavigation' => 'navigasie', 'jumptosearch' => 'zeuk', 'view-pool-error' => "De servers bin noen overbelast. Te veule meensen proberen disse pagina te bekieken. Wacht even veurda'j opniej toegang proberen te kriegen tot disse pagina. $1", 'pool-timeout' => 'Wachttied tiejens t wachten op vergrendeling', 'pool-queuefull' => 'De wachtrie van de poel is vol', 'pool-errorunknown' => 'Onbekende fout', # 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) and the disambiguation template definition (see disambiguations). 'aboutsite' => 'Over {{SITENAME}}', 'aboutpage' => 'Project:Info', 'copyright' => 'De inhoud is beschikbaor onder de $1.', 'copyrightpage' => '{{ns:project}}:Auteursrechten', 'currentevents' => 'In t niejs', 'currentevents-url' => 'Project:In t niejs', 'disclaimers' => 'Veurbehold', 'disclaimerpage' => 'Project:Veurbehoud', 'edithelp' => 'Hulpe mit bewarken', 'edithelppage' => 'Help:Uutleg', 'helppage' => 'Help:Inhoud', 'mainpage' => 'Veurblad', 'mainpage-description' => 'Veurblad', 'policy-url' => 'Project:Beleid', 'portal' => 'Gebrukersportaol', 'portal-url' => 'Project:Gebrukersportaol', 'privacy' => 'Gegevensbeleid', 'privacypage' => 'Project:Gegevensbeleid', 'badaccess' => 'Gien toestemming', 'badaccess-group0' => 'Je hebben gien toestemming um disse aksie uut te voeren.', 'badaccess-groups' => 'Disse aksie kan allinnig uutevoerd wörden deur gebrukers uut {{PLURAL:$2|de groep|één van de groepen}}: $1.', 'versionrequired' => 'Versie $1 van MediaWiki is neudig', 'versionrequiredtext' => 'Versie $1 van MediaWiki is neudig um disse pagina te gebruken. Zie [[Special:Version|Versie]].', 'ok' => 'Oké', 'retrievedfrom' => 'Van "$1"', 'youhavenewmessages' => 'Je hebben $1 ($2).', 'newmessageslink' => 'nieje berichten', 'newmessagesdifflink' => 'verschil mit de veurige versie', 'youhavenewmessagesmulti' => 'Je hebben nieje berichten op $1', 'editsection' => 'bewark', 'editold' => 'bewark', 'viewsourceold' => 'brontekste bekieken', 'editlink' => 'bewark', 'viewsourcelink' => 'brontekste bekieken', 'editsectionhint' => 'Bewarkingsveld: $1', 'toc' => 'Onderwarpen', 'showtoc' => 'Bekieken', 'hidetoc' => 'Verbarg', 'collapsible-collapse' => 'Inklappen', 'collapsible-expand' => 'Uutklappen', 'thisisdeleted' => 'Bekieken of herstellen van $1?', 'viewdeleted' => 'Bekiek $1?', 'restorelink' => '{{PLURAL:$1|versie die vortedaon is|versies die vortedaon bin}}', 'feedlinks' => 'Voer:', 'feed-invalid' => 'Voertype wörden niet ondersteunt.', 'feed-unavailable' => 'Syndicakievoer is niet beschikbaor', 'site-rss-feed' => '$1 RSS-voer', 'site-atom-feed' => '$1 Atom-voer', 'page-rss-feed' => '"$1" RSS-voer', 'page-atom-feed' => '"$1" Atom-voer', 'red-link-title' => '$1 (pagina besteet nog niet)', 'sort-descending' => 'Aoflopend sorteren', 'sort-ascending' => 'Oplopend sorteren', # Short words for each namespace, by default used in the namespace tab in monobook 'nstab-main' => 'Artikel', 'nstab-user' => 'Gebruker', 'nstab-media' => 'Media', 'nstab-special' => 'Spesiale pagina', 'nstab-project' => 'Projektpagina', 'nstab-image' => 'Bestaand', 'nstab-mediawiki' => 'Tiejige', 'nstab-template' => 'Mal', 'nstab-help' => 'Hulpe', 'nstab-category' => 'Kategorie', # Main script and global functions 'nosuchaction' => 'De op-egeven haandeling besteet niet', 'nosuchactiontext' => 'De opdrachte in t webadres in ongeldig. Je hebben t webadres misschien verkeerd in-etikt of de verkeerde verwiezing evolgd. Dit kan oek dujen op n fout in de programmatuur van {{SITENAME}}.', 'nosuchspecialpage' => 'Der besteet gien spesiale pagina mit disse naam', 'nospecialpagetext' => "<strong>Disse spesiale pagina wörden niet herkend deur de programmatuur.</strong> n Lieste mit bestaonde spesiale pagina ku'j vienen op [[Special:SpecialPages|{{int:specialpages}}]].", # General errors 'error' => 'Foutmelding', 'databaseerror' => 'Fout in de databanke', 'dberrortext' => 'Bie t zeuken is n syntaxisfout in de databanke op-etrejen. De oorzake hiervan kan dujen op n fout in de programmatuur. Der is n syntaxisfout in t databankeverzeuk op-etrejen. t Kan ween dat der n fout in de programmatuur zit. De leste zeukpoging in de databanke was: <blockquote><tt>$1</tt></blockquote> vanuut de funksie "<tt>$2</tt>". De databanke gaf de volgende foutmelding "<tt>$3: $4</tt>".', 'dberrortextcl' => 'Der is n syntaxisfout in t databankeverzeuk op-etrejen. t Leste veurzeuk an de databanke was: "$1" vanuut de funksie "$2" De databanke gaf de volgende foutmelding: "$3: $4"', 'laggedslavemode' => '<strong>Waorschuwing:</strong> t is meugelik dat leste wiezigingen in de tekste van dit artikel nog niet verwarkt bin.', 'readonly' => 'De databanke is beveilig', 'enterlockreason' => 'Waorumme en veur hoe lange is e eblokkeerd?', 'readonlytext' => "De databanke van {{SITENAME}} is noen esleuten veur nieje bewarkingen en wiezigingen, warschienlik veur bestaandsonderhoud. De verantwoordelike systeembeheerder gaf hierveur de volgende reden op: '''$1'''", 'missing-article' => 'In de databanke steet gien tekste veur de pagina "$1" die der wel in zol mutten staon ($2). Dit kan koemen deurda\'j n ouwe verwiezing naor t verschil tussen twee versies van n pagina volgen of n versie opvragen die vortedaon is. As dat niet zo is, dan he\'j misschien n fout in de programmatuur evunnen. Meld t dan effen bie n [[Special:ListUsers/sysop|systeembeheerder]] van {{SITENAME}} en vermeld derbie de internetverwiezing van disse pagina.', 'missingarticle-rev' => '(versienummer: $1)', 'missingarticle-diff' => '(Wieziging: $1, $2)', 'readonly_lag' => 'De databanke is automaties beveilig, zodat de ondergeschikten servers zich kunnen synchroniseren mit de sentrale server.', 'internalerror' => 'Interne fout', 'internalerror_info' => 'Interne fout: $1', 'fileappenderrorread' => '"$1" kon niet elezen wörden tiejens t inlaojen.', 'fileappenderror' => 'Kon "$1" niet bie "$2" doon.', 'filecopyerror' => 'Kon bestaand "$1" niet naor "$2" kopiëren.', 'filerenameerror' => 'Bestaandsnaamwieziging "$1" naor "$2" niet meugelik.', 'filedeleteerror' => 'Kon bestaand "$1" niet vortdoon.', 'directorycreateerror' => 'Map "$1" kon niet an-emaakt wörden.', 'filenotfound' => 'Kon bestaand "$1" niet vienen.', 'fileexistserror' => 'Kon niet schrieven naor t bestaand "$1": t bestaand besteet al', 'unexpected' => 'Onverwachten weerde: "$1"="$2".', 'formerror' => 'Fout: kon formulier niet versturen', 'badarticleerror' => 'Disse haandeling kan op disse pagina niet uutevoerd wörden.', 'cannotdelete' => 'De pagina of t bestaand "$1" kon niet vortedaon wörden. t Kan ween dat n aander t al vortedaon hef.', 'badtitle' => 'Ongeldige naam', 'badtitletext' => 'De naam van de op-evreugen pagina is niet geldig, leeg, of n interwiki-verwiezing naor n onbekende of ongeldige wiki.', 'perfcached' => 'Disse gegevens kwammen uut t tussengeheugen en bin warschienlik niet aktueel:', 'perfcachedts' => 'De informasie die hieronder steet, is op-esleugen, en is van $1.', 'querypage-no-updates' => "'''Disse pagina wörden niet meer bie-ewörken.'''", 'wrong_wfQuery_params' => 'Parameters veur wfQuery() waren verkeerd<br /> Funksie: $1<br /> Zeukopdrachte: $2', 'viewsource' => 'Brontekste bekieken', 'viewsourcefor' => 'veur "$1"', 'actionthrottled' => 'Haandeling tegen-ehuilen', 'actionthrottledtext' => "As maotregel tegen t plaotsen van ongewunste verwiezingen, is t antal keren da'j disse haandeling in n korte tied uutvoeren kunnen beteund. Je hebben de limiet overschrejen. Probeer t over n antal minuten weer.", 'protectedpagetext' => 'Disse pagina is beveiligd um bewarkingen te veurkoemen.', 'viewsourcetext' => 'Je kunnen de brontekste van disse pagina bewarken en bekieken:', 'protectedinterface' => 'Op disse pagina steet n tekste die gebruukt wörden veur systeemteksten van de wiki. Allinnig beheerders kunnen disse pagina bewarken.', 'editinginterface' => "'''Waorschuwing:''' je bewarken n pagina die gebruukt wörden deur de programmatuur. Wa'j hier wiezigen, is van invleud op de hele wiki. Overweeg veur vertalingen um [//translatewiki.net/wiki/Main_Page?setlang=nds-nl translatewiki.net] te gebruken, t vertalingsprojekt veur MediaWiki.", 'sqlhidden' => '(SQL-zeukopdrachte verbörgen)', 'cascadeprotected' => 'Disse pagina is beveiligd umdat t veurkump in de volgende {{PLURAL:$1|pagina|pagina\'s}}, die beveiligd {{PLURAL:$1|is|bin}} mit de "kaskade"-opsie: $2', 'namespaceprotected' => "Je maggen gien pagina's in de '''$1'''-naamruumte bewarken.", 'customcssprotected' => 'Je kunnen disse CSS-pagina niet bewarken, umdat der persoonlike instellingen van n aandere gebruker in staon.', 'customjsprotected' => 'Je kunnen disse JavaScript-pagina niet bewarken, umdat der persoonlike instellingen van n aandere gebruker in staon.', 'ns-specialprotected' => "Spesiale pagina's kunnen niet bewarkt wörden.", 'titleprotected' => "t Anmaken van disse pagina is beveiligd deur [[User:$1|$1]]. De op-egeven reden is ''$2''.", # Virus scanner 'virus-badscanner' => "Slichte konfigurasie: onbekend antivirusprogramma: ''$1''", 'virus-scanfailed' => 'inlezen is mislokt (kode $1)', 'virus-unknownscanner' => 'onbekend antivirusprogramma:', # Login and logout pages 'logouttext' => "'''Je bin noen aofemeld.''' Je kunnen {{SITENAME}} noen anoniem gebruken of je eigen [[Special:UserLogin|opniej anmelden]] onder disse of n aandere gebrukersnaam. t Kan ween dat der wat pagina's bin die weeregeven wörden asof je an-emeld bin totda'j t tussengeheugen van joew webkieker leegmaken.", 'welcomecreation' => '== Welkom, $1! == Joew gebrukersnaam is an-emaakt. Vergeet niet joew [[Special:Preferences|veurkeuren veur {{SITENAME}}]] in te stellen.', 'yourname' => 'Gebrukersnaam', 'yourpassword' => 'Wachtwoord', 'yourpasswordagain' => 'Opniej invoeren', 'remembermypassword' => 'Vanzelf anmelden (hooguut $1 {{PLURAL:$1|dag|dagen}})', 'securelogin-stick-https' => "Verbunnen blieven via HTTPS naoda'j an-emeld bin", 'yourdomainname' => 'Joew domein', 'externaldberror' => 'Der gung iets fout bie de externe authentisering, of je maggen je gebrukersprofiel niet bewarken.', 'login' => 'Anmelden', 'nav-login-createaccount' => 'Anmelden', 'loginprompt' => 'Je mutten scheumbestaanden (cookies) an hebben staon um an te kunnen melden bie {{SITENAME}}.', 'userlogin' => 'Anmelden / inschrieven', 'userloginnocreate' => 'Anmelden', 'logout' => 'Aofmelden', 'userlogout' => 'Aofmelden', 'notloggedin' => 'Niet an-emeld', 'nologin' => "He'j nog gien gebrukersnaam? '''$1'''.", 'nologinlink' => 'Maak n gebrukersprofiel an', 'createaccount' => 'Niej gebrukersprofiel anmaken', 'gotaccount' => "Stao'j al in-eschreven? '''$1'''.", 'gotaccountlink' => 'Anmelden', 'userlogin-resetlink' => "Bi'j de anmeldgegevens kwiet?", 'createaccountmail' => 'per netpost', 'createaccountreason' => 'Reden:', 'badretype' => "De wachtwoorden die'j in-etikt hebben bin niet liek alleens.", 'userexists' => 'Disse gebrukersnaam is al gebruuk. Kies n aandere naam.', 'loginerror' => 'Anmeldingsfout', 'createaccounterror' => 'Kon de gebrukersnaam niet anmaken: $1', 'nocookiesnew' => 'De gebrukersnaam is an-emaakt, mer je bin niet an-emeld. {{SITENAME}} gebruuk scheumbestaanden (cookies) um gebrukers an te melden. Je hebben disse scheumbestaanden uutezet. Zet ze an, en meld daornao an mit de nieje gegevens.', 'nocookieslogin' => 't Anmelden is mislokt umdat de webkieker gien scheumbestaanden (cookies) an hef staon. Probeer t aksepteren van scheumbestaanden an te zetten en daornao opniej an te melden.', 'nocookiesfornew' => "De gebruker is niet an-emaakt, umdat de bron niet bevestigd kon wörden. Zörg derveur da'j scheumbestaanden (cookies) an hebben staon, herlaot disse pagina en probeer t opniej.", 'noname' => 'Je mutten n gebrukersnaam opgeven.', 'loginsuccesstitle' => 'Suksesvol an-emeld', 'loginsuccess' => 'Je bin noen an-emeld bie {{SITENAME}} as "$1".', 'nosuchuser' => 'Der is gien gebruker mit de naam "$1". Gebrukersnamen bin heufdlettergeveulig. Kiek de schriefwieze effen nao of [[Special:UserLogin/signup|maak n nieje gebruker an]].', 'nosuchusershort' => 'Der is gien gebruker mit de naam "$1". Kiek de spelling nao.', 'nouserspecified' => 'Vul n naam in', 'login-userblocked' => 'Disse gebruker is eblokkeerd. Je kunnen niet anmelden.', 'wrongpassword' => 'verkeerd wachtwoord, probeer t opniej.', 'wrongpasswordempty' => 'Gien wachtwoord in-evoerd. Probeer t opniej.', 'passwordtooshort' => 'Wachtwoorden mutten uut tenminsten {{PLURAL:$1|$1 teken|$1 tekens}} bestaon.', 'password-name-match' => 'Joew wachtwoord en gebrukersnaam maggen niet liek alleens ween.', 'password-login-forbidden' => 't Gebruuk van disse gebrukersnaam mit dit wachtwoord is niet toe-estaon.', 'mailmypassword' => 'Niej wachtwoord opsturen', 'passwordremindertitle' => 'Niej tiedelik wachtwoord veur {{SITENAME}}', 'passwordremindertext' => 'Der hef der ene evreugen, vanaof t IP-adres $1 (warschienlik jie zelf), um n niej wachtwoord veur {{SITENAME}} ($4) op te sturen. Der is n tiedelik wachtwoord an-emaakt veur gebruker "$2": "$3". As dit niet de bedoeling was, meld dan effen an en kies n niej wachtwoord. Joew tiedelike wachtwoord zal verlopen over {{PLURAL:$5|één dag|$5 dagen}}. A\'j dit verzeuk niet zelf edaon hebben of a\'j t wachtwoord weer weten en t niet meer wiezigen willen, negeer dit bericht dan en blief joew bestaonde wachtwoord gebruken.', 'noemail' => 'Gien netpostadres eregistreerd veur "$1".', 'noemailcreate' => 'Je mutten n geldig netpostadres opgeven', 'passwordsent' => 'Der is n niej wachtwoord verstuurd naor t netpostadres van gebruker "$1". Meld an, a\'j t wachtwoord ontvangen.', 'blocked-mailpassword' => "Dit IP-adres is eblokkeerd. Dit betekent da'j niet bewarken kunnen en dat {{SITENAME}} joew wachtwoord niet weerummehaolen kan, dit wörden edaon um misbruuk tegen te gaon.", 'eauthentsent' => "Der is n bevestigingsberich naor t op-egeven netpostadres verstuurd. Veurdat der veerdere berichten naor dit netpostadres verstuurd kunnen wörden, mö'j de instruksies volgen in t toe-esturen berich, um te bevestigen da'j joe eigen daodwarkelik an-emeld hebben.", 'throttled-mailpassword' => 'In {{PLURAL:$1|t leste ure|de leste $1 uren}} is der al n wachtwoordherinnering estuurd. Um misbruuk te veurkoemen wörden der mer één wachtwoordherinnering per {{PLURAL:$1|ure|$1 uren}} verstuurd.', 'mailerror' => 'Fout bie t versturen van bericht: $1', 'acct_creation_throttle_hit' => 'Onder dit IP-adres hebben luui de veurbieje dag al {{PLURAL:$1|1 gebruker|$1 gebrukers}} an-emaakt. Meer is niet toe-estaon in disse periode. Daorumme kunnen gebrukers mit dit IP-adres noen effen gien gebrukers meer anmaken.', 'emailauthenticated' => 'Joew netpostadres is bevestigd op $2 um $3.', 'emailnotauthenticated' => 'Netpostadres is <strong>nog niet bevestigd</strong>. Je kriegen gien berichten veur de onstaonde opsies.', 'noemailprefs' => 'Gien netpostadres in-evoerd, waordeur de onderstaonde funksies niet warken.', 'emailconfirmlink' => 'Bevestig netpostadres', 'invalidemailaddress' => 't Netpostadres kon niet aksepteerd wörden umdat de opmaak ongeldig is. Voer de juuste opmaak van t adres in of laot t veld leeg.', 'accountcreated' => 'Gebrukersprofiel is an-emaakt', 'accountcreatedtext' => 'De gebrukersnaam veur $1 is an-emaakt.', 'createaccount-title' => 'Gebrukers anmaken veur {{SITENAME}}', 'createaccount-text' => 'Der hef der ene n gebruker veur $2 an-emaakt op {{SITENAME}} ($4). t Wachtwoord veur "$2" is "$3". Meld je noen an en wiezig t wachtwoord. Negeer dit bericht as disse gebruker zonder joew toestemming an-emaakt is.', 'usernamehasherror' => "In n gebrukersnaam ma'j gien hekjen gebruken.", 'login-throttled' => "Je hebben lestens te vake eprobeerd um an te melden mit n verkeerd wachtwoord. Je mutten effen wachten veurda'j t opniej proberen kunnen.", 'login-abort-generic' => 'Je bin niet an-emeld. De procedure is aofebreuken.', 'loginlanguagelabel' => 'Taal: $1', 'suspicious-userlogout' => 'Joew verzeuk um of te melden is aofewezen umdat t dernaor uutziet dat t verstuurd is deur n kepotte webkieker of tussenopslagbuffer', # E-mail sending 'php-mail-error-unknown' => 'Der was n onbekende fout mit de mail()-funksie van PHP', # Change password dialog 'resetpass' => 'Wachtwoord wiezigen', 'resetpass_announce' => "Je bin an-emeld mit n veurlopige kode die mit de netpost toe-estuurd wörden. Um t anmelden te voltooien, mö'j n niej wachtwoord invoeren:", 'resetpass_text' => '<!-- Tekste hier invoegen -->', 'resetpass_header' => 'Wachtwoord wiezigen', 'oldpassword' => "Wachtwoord da'j noen hebben", 'newpassword' => 'Niej wachtwoord', 'retypenew' => 'Niej wachtwoord (opniej)', 'resetpass_submit' => 'Voer t wachtwoord in en meld je an', 'resetpass_success' => 'Joew wachtwoord is suksesvol ewiezigd Je wörden noen an-emeld...', 'resetpass_forbidden' => 'Wachtwoorden kunnen niet ewiezigd wörden', 'resetpass-no-info' => "Je mutten an-emeld ween veurda'j disse pagina gebruken kunnen.", 'resetpass-submit-loggedin' => 'Wachtwoord wiezigen', 'resetpass-submit-cancel' => 'Aofbreken', 'resetpass-wrong-oldpass' => "t Veurlopige wachtwoord of t wachtwoord da'j noen hebben is ongeldig. Misschien he'j t wachtwoord al ewiezigd of n niej veurlopig wachtwoord an-evreugen.", 'resetpass-temp-password' => 'Veurlopig wachtwoord:', # Special:PasswordReset 'passwordreset' => 'Wachtwoord opniej instellen', 'passwordreset-text' => 'Vul dit formulier in zoda-w joe netpost kunnen sturen mit de gebrukersgegevens.', 'passwordreset-legend' => 'Wachtwoord opniej instellen', 'passwordreset-disabled' => 'Je kunnen op disse wiki joew wachtwoord niet opniej instellen.', 'passwordreset-pretext' => '{{PLURAL:$1||Voer één van de onderstaonde velden in}}', 'passwordreset-username' => 'Gebruker:', 'passwordreset-domain' => 'Domein:', 'passwordreset-email' => 'Netpostadres:', 'passwordreset-emailtitle' => 'Gebrukersgegevens op {{SITENAME}}', 'passwordreset-emailtext-ip' => "Der hef der ene, warschienlik jie zelf, gebrukersgegevens veur {{SITENAME}} ($4) op-evreugen vanaof t IP-adres $1. De volgende {{PLURAL:$3|gebruker is|gebrukers bin}} ekoppeld an dit netpostadres: $2 {{PLURAL:$3|Dit tiedelike wachtwoord vervuilt|Disse tiedelike wachtwoorden vervallen}} over {{PLURAL:$5|één dag|$5 dagen}}. Meld je eigen noen an en wiezig t wachtwoord. A'j dit verzeuk niet zelf edaon hebben, of a'j t oorspronkelike wachtwoord nog kennen en t niet wiezigen willen, negeer dit bericht dan en blief joew ouwe wachtwoord gebruken.", 'passwordreset-emailtext-user' => "De gebruker $1 van {{SITENAME}} hef joew gebrukersgegevens veur {{SITENAME}} ($4) op-evreugen vanaof t IP-adres $1. De volgende {{PLURAL:$3|gebruker is|gebrukers bin}} ekoppeld an dit netpostadres: $2 {{PLURAL:$3|Dit tiedelike wachtwoord vervuilt|Disse tiedelike wachtwoorden vervallen}} over {{PLURAL:$5|één dag|$5 dagen}}. Meld je eigen noen an en wiezig t wachtwoord. A'j dit verzeuk niet zelf edaon hebben, of a'j t oorspronkelike wachtwoord nog kennen en t niet wiezigen willen, negeer dit bericht dan en blief joew ouwe wachtwoord gebruken.", 'passwordreset-emailelement' => 'Gebrukersnaam: $1 Tiedelik wachtwoord: $2', 'passwordreset-emailsent' => 'Der is per netpost n herinnering verstuurd.', # Edit page toolbar 'bold_sample' => 'Vet-edrokten tekste', 'bold_tip' => 'Vet-edrokten tekste', 'italic_sample' => 'Schunedrokken tekste', 'italic_tip' => 'Schunedrok', 'link_sample' => 'Onderwarp', 'link_tip' => 'Interne verwiezing', 'extlink_sample' => 'http://www.example.com verwiezingstekste', 'extlink_tip' => 'Uutgaonde verwiezing', 'headline_sample' => 'Deelonderwarp', 'headline_tip' => 'Deelonderwarp', 'nowiki_sample' => 'Tekste zonder wiki-opmaak.', 'nowiki_tip' => 'Gien wiki-opmaak toepassen', 'image_sample' => 'Veurbeeld.jpg', 'image_tip' => 'Mediabestaand', 'media_sample' => 'Veurbeeld.ogg', 'media_tip' => 'Verwiezing naor bestaand', 'sig_tip' => 'Joew ondertekening (mit daotum en tied)', 'hr_tip' => 'Horizontale liende', # Edit pages 'summary' => 'Samenvatting:', 'subject' => 'Onderwarp:', 'minoredit' => 'kleine wieziging', 'watchthis' => 'volg disse pagina', 'savearticle' => 'Pagina opslaon', 'preview' => 'Naokieken', 'showpreview' => 'Bewarking naokieken', 'showlivepreview' => 'Drekte weergave', 'showdiff' => 'Verschil bekieken', 'anoneditwarning' => "'''Waorschuwing:''' je bin niet an-emeld. Joew IP-adres zal op-esleugen wörden a'j wiezigingen op disse pagina anbrengen.", 'anonpreviewwarning' => "''Je bin niet an-emeld.'' ''Deur de bewarking op te slaon wörden joew IP-adres op-esleugen in de paginageschiedenisse.''", 'missingsummary' => "'''Herinnering:''' je hebben gien samenvatting op-egeven veur de bewarking. A'j noen weer op ''Opslaon'' klikken wörden de bewarking zonder samenvatting op-esleugen.", 'missingcommenttext' => 'Plaots joew opmarking hieronder.', 'missingcommentheader' => "'''Waorschuwing:''' je hebben der gien onderwarptitel bie ezet. A'j noen weer op \"{{int:savearticle}}\" klikken, dan wörden de bewarking op-esleugen zonder onderwarptitel.", 'summary-preview' => 'Samenvatting naokieken:', 'subject-preview' => 'Onderwarp/kop naokieken:', 'blockedtitle' => 'Gebruker is eblokkeerd', 'blockedtext' => "'''Joew gebrukersnaam of IP-adres is eblokkeerd.''' Je bin eblokkeerd deur: $1. De op-egeven reden is: ''$2''. * Eblokkeerd vanaof: $8 * Eblokkeerd tot: $6 * Bedoeld um te blokkeren: $7 Je kunnen kontakt opnemen mit $1 of n aandere [[{{MediaWiki:Grouppage-sysop}}|beheerder]] um de blokkering te bepraoten. Je kunnen gien gebruukmaken van de funksie 'een bericht sturen', behalven a'j n geldig netpostadres op-egeven hebben in joew [[Special:Preferences|veurkeuren]] en t gebruuk van disse funksie niet eblokkeerd is. t IP-adres da'j noen gebruken is $3 en t blokkeringsnummer is #$5. Vermeld t allebeie a'j argens op disse blokkering reageren.", 'autoblockedtext' => 'Joew IP-adres is automaties eblokkeerd umdat t gebruukt wörden deur n aandere gebruker, die eblokkeerd wörden deur $1. De reden hierveur was: :\'\'$2\'\' * Begint: $8 * Löp of nao: $6 * Wee eblokkeerd wörden: $7 Je kunnen kontakt opnemen mit $1 of n van de aandere [[{{MediaWiki:Grouppage-sysop}}|beheerders]] um de blokkering te bepraoten. NB: je kunnen de opsie "n bericht sturen" niet gebruken, behalven a\'j n geldig netpostadres op-egeven hebben in de [[Special:Preferences|gebrukersveurkeuren]] en je niet eblokkeerd bin. Joew IP-adres is $3 en joew blokkeernummer is $5. Geef disse nummers deur a\'j kontakt mit ene opnemen over de blokkering.', 'blockednoreason' => 'gien reden op-egeven', 'blockedoriginalsource' => "De brontekste van '''$1''' steet hieronder:", 'blockededitsource' => "De tekste van '''joew eigen bewarkingen''' an '''$1''' steet hieronder:", 'whitelistedittitle' => "Um disse pagina te bewarken, mö'j je anmelden", 'whitelistedittext' => "Um pagina's te kunnen wiezigen, mö'j $1 ween", 'confirmedittext' => "Je mutten je netpostadres bevestigen veurda'j bewarken kunnen. Vul je adres in en bevestig t via [[Special:Preferences|mien veurkeuren]].", 'nosuchsectiontitle' => 'Disse seksie besteet niet', 'nosuchsectiontext' => 'Je proberen n seksie te bewarken dat niet besteet. t Kan ween dat t herneumd is of dat t vortedaon is to jie t an t bekieken waren.', 'loginreqtitle' => 'Anmelden verplicht', 'loginreqlink' => 'Anmelden', 'loginreqpagetext' => 'Je mutten $1 um disse pagina te bekieken.', 'accmailtitle' => 'Wachtwoord is verstuurd.', 'accmailtext' => "Der is n willekeurig wachtwoord veur [[User talk:$1|$1]] verstuurd naor $2. t Wachtwoord veur disse gebruker kan ewiezigd wörden deur de pagina ''[[Special:ChangePassword|wachtwoord wiezigen]]'' te gebruken.", 'newarticle' => '(Niej)', 'newarticletext' => "Disse pagina besteet nog niet. In t veld hieronder ku'j wat schrieven um disse pagina an te maken (meer informasie vie'j op de [[{{MediaWiki:Helppage}}|hulppagina]]). A'j hier per ongelok terechtekeumen bin gebruuk dan de knoppe '''veurige''' um weerumme te gaon.", 'anontalkpagetext' => "---- ''Disse overlegpagina heurt bie n anonieme gebruker die nog gien gebrukersnaam hef, of t niet gebruuk. We gebruken daorumme t IP-adres um hum of heur te herkennen, mer t kan oek ween dat meerdere personen t zelfde IP-adres gebruken, en da'j hiermee berichten ontvangen die niet veur joe bedoeld bin. A'j dit veurkoemen willen, dan ku'j t bes [[Special:UserLogin/signup|n gebrukersnaam anmaken]] of [[Special:UserLogin|anmelden]].''", 'noarticletext' => 'Der steet noen gien tekste op disse pagina. Je kunnen [[Special:Search/{{PAGENAME}}|de titel opzeuken]] in aandere pagina\'s, <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} zeuken in de logboeken], of [{{fullurl:{{FULLPAGENAME}}|action=edit}} disse pagina bewarken]</span>.', 'noarticletext-nopermission' => 'Op disse pagina steet gien tekste. Je kunnen [[Special:Search/{{PAGENAME}}|zeuken naor disse term]] in aandere pagina\'s of <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} de logboeken deurzeuken]</span>.', 'userpage-userdoesnotexist' => 'Je bewarken n gebrukerspagina van n gebruker die niet besteet (gebruker "<nowiki>$1</nowiki>"). Kiek effen nao o\'j disse pagina wel anmaken/bewarken willen.', 'userpage-userdoesnotexist-view' => 'Gebruker "$1" steet hier niet in-eschreven', 'blocked-notice-logextract' => 'Disse gebruker is op t moment eblokkeerd. De leste regel uut t blokkeerlogboek steet hieronder as referensie:', 'clearyourcache' => "'''Waort je:''' naodat de wiezigingen op-esleugen bin, mut t tussengeheugen van de webkieker nog eleegd wörden um t te kunnen zien. *'''Firefox / Safari:''' drok op ''Shift'' terwiel je op ''verniejen'' klikken, of gebruuk ''Ctrl-F5'' of ''Ctrl-R'' (''⌘-R'' op n knipperkiste van Mac) * '''Google Chrome:''' drok op ''Ctrl-Shift-R'' (''⌘-Shift-R'' op n knipperkiste van Mac) *'''Internet Explorer:''' drok op ''Ctrl'' terwiel je op ''verniejen'' klikken of drok op ''Ctrl-F5'' *'''Konqueror: '''klik op ''verniejen'' of drok op ''F5'' *'''Opera:''' leeg t tussengeheugen in ''Extra → Voorkeuren\"", 'usercssyoucanpreview' => "'''Tip:''' gebruuk de knoppe \"{{int:showpreview}}\" um joew nieje css/js nao te kieken veurda'j t opslaon.", 'userjsyoucanpreview' => "'''Tip:''' gebruuk de knoppe \"{{int:showpreview}}\" um joew nieje css/js nao te kieken veurda'j t opslaon.", 'usercsspreview' => "'''Dit is allinnig n kontrole van joew persoonlike CSS.''' '''t Is nog niet op-esleugen!'''", 'userjspreview' => "'''Denk deran da'j joew persoonlike JavaScript allinnig nog mer an t bekieken bin, t is nog niet op-esleugen!'''", 'sitecsspreview' => "'''Je bin allinnig mer de CSS an t naokieken.''' '''t Is nog niet op-esleugen!'''", 'sitejspreview' => "'''Je bin allinnig mer de JavaScript-kode an t naokieken.''' '''t Is nog niet op-esleugen!'''", 'userinvalidcssjstitle' => "'''Waorschuwing:''' der is gien uutvoering mit de naam \"\$1\". Vergeet niet dat joew eigen .css- en .js-pagina's beginnen mit n kleine letter, bv. \"{{ns:user}}:Naam/'''v'''ector\" in plaotse van \"{{ns:user}}:Naam/'''V'''ector.css\".", 'updated' => '(Bewark)', 'note' => "'''Opmarking:'''", 'previewnote' => "'''NB: je bin de pagina allinnig nog mer an t naokieken; de tekste is nog niet op-esleugen!'''", 'previewconflict' => "Disse versie laot zien hoe de tekste in t bovenste veld deruut kump te zien a'j de tekste opslaon.", 'session_fail_preview' => "'''De bewarking kan niet verwarkt wörden wegens n verlies an data.''' Probeer t laoter weer. As t probleem dan nog steeds veurkump, probeer dan [[Special:UserLogout|opniej an te melden]].", 'session_fail_preview_html' => "'''De bewarking kan niet verwarkt wörden wegens n verlies an data.''' ''Umdat in {{SITENAME}} roewe HTML in-eschakeld is, is de weergave dervan verbörgen um te veurkoemen dat t JavaScript an-evuilen wörden.'' '''As dit n legitieme wieziging is, probeer t dan opniej.''' As t dan nog problemen geef, probeer dan um [[Special:UserLogout|opniej an te melden]].", 'token_suffix_mismatch' => "'''De bewarking is eweigerd umdat de webkieker de leestekens in t bewarkingstoken verkeerd behaandeld hef. De bewarking is eweigerd um verminking van de paginatekste te veurkoemen. Dit gebeurt soms as der n web-ebaseerden proxydienst gebruukt wörden waor fouten in zitten.'''", 'edit_form_incomplete' => "'''Partie delen van t bewarkingsformulier hebben de server niet bereikt. Kiek eers nao of de bewarkingen kloppen en probeer t opniej.'''", 'editing' => 'Bewark: $1', 'editingsection' => 'Bewark: $1 (deelpagina)', 'editingcomment' => 'Bewark: $1 (niej onderwarp)', 'editconflict' => 'Bewarkingskonflikt: $1', 'explainconflict' => "'''NB:''' n aander hef disse pagina ewiezigd naoda'j an disse bewarking begunnen bin. t Bovenste bewarkingsveld laot de pagina zien zo as t noen is. Daoronder (bie \"Wiezigingen\") staon de verschillen tussen joew versie en de op-esleugen pagina. Helemaole onderan (bie \"Joew tekste\") steet nog n bewarkingsveld mit joew versie. Je zullen je eigen wiezigingen in de nieje tekste in mutten passen. '''Allinnig''' de tekste in t bovenste veld wörden beweerd a'j noen kiezen veur \"{{int:savearticle}}\".", 'yourtext' => 'Joew tekste', 'storedversion' => 'Op-esleugen versie', 'nonunicodebrowser' => "'''Waorschuwing: de webkieker kan niet goed overweg mit unikode, schakel over op n aandere webkieker um de wiezigingen an te brengen!'''", 'editingold' => "'''Waorschuwing: je bewarken noen n ouwe versie van disse pagina. A'j de wiezigingen opslaon, gaon alle niejere versies verleuren.'''", 'yourdiff' => 'Wiezigingen', 'copyrightwarning' => "Waort je dat alle biedragen an {{SITENAME}} vrie-egeven mutten wörden onder de \$2 (zie \$1 veur meer informasie). A'j niet willen dat joew tekste deur aander volk bewarkt en verspreid kan wörden, slao de tekste dan niet op.<br /> Deur op \"Pagina opslaon\" te klikken beleuf je ons da'j disse tekste zelf eschreven hebben, of over-eneumen hebben uut n vrieje, openbaore bron.<br /> '''Gebruuk gien spul mit auteursrechten, a'j daor gien toestemming veur hebben!'''", 'copyrightwarning2' => "Waort je dat alle biedragen an {{SITENAME}} deur aander volk bewarkt of vortedaon kan wörden. A'j niet willen dat joew tekste deur aander volk bewarkt wörden, slao de tekste dan niet op.<br /> Deur op \"Pagina opslaon\" te klikken beleuf je ons da'j disse tekste zelf eschreven hebben, of over-eneumen hebben uut n vrieje, openbaore bron (zie \$1 veur meer informasie). '''Gebruuk gien spul mit auteursrechten, a'j daor gien toestemming veur hebben!'''", 'longpageerror' => "'''Foutmelding: de tekste die'j opslaon willen is $1 kilobytes. Dit is groter as t toe-estaone maximum van $2 kilobytes. Joew tekste kan niet op-esleugen wörden.'''", 'readonlywarning' => "'''Waorschuwing: De databanke is op dit moment in onderhoud; t is daorumme niet meugelik um pagina's te wiezigen. Je kunnen de tekste t beste bie joew eigen systeem opslaon en laoter opniej proberen de pagina te bewarken.''' As grund is angeven: $1", 'protectedpagewarning' => "'''Waorschuwing: disse pagina is beveiligd, zodat allinnig beheerders t kunnen wiezigen.''' De leste logboekregel steet hieronder:", 'semiprotectedpagewarning' => "'''Let op:''' disse pagina is beveiligd en ku'j allinnig bewarken a'j n eregistreerden gebruker bin. De leste logboekregel steet hieronder:", 'cascadeprotectedwarning' => "'''Waorschuwing:''' disse pagina is beveiligd, zodat allinnig beheerders disse pagina kunnen bewarken, dit wörden edaon umdat disse pagina veurkump in de volgende {{PLURAL:$1|kaskade-beveiligden pagina|kaskade-beveiligden pagina's}}:", 'titleprotectedwarning' => "'''Waorschuwing: disse pagina is beveilig. Je hebben [[Special:ListGroupRights|bepaolde rechten]] neudig um t an te kunnen maken.''' De leste logboekregel steet hieronder:", 'templatesused' => '{{PLURAL:$1|Mal|Mallen}} die op disse pagina gebruukt wörden:', 'templatesusedpreview' => '{{PLURAL:$1|Mal|Mallen}} die in disse bewarking gebruukt wörden:', 'templatesusedsection' => '{{PLURAL:$1|Mal|Mallen}} die in dit subkopjen gebruukt wörden:', 'template-protected' => '(beveilig)', 'template-semiprotected' => '(semibeveilig)', 'hiddencategories' => 'Disse pagina vuilt in de volgende verbörgen {{PLURAL:$1|kategorie|kategorieën}}:', 'edittools' => '<!-- Disse tekste steet onder de bewarkings- en bestaandinlaodformulieren. -->', 'nocreatetitle' => "t Anmaken van pagina's is beteund", 'nocreatetext' => "Disse webstee hef de meugelikheid um nieje pagina's an te maken beteund. Je kunnen pagina's die al bestaon wiezigen of je kunnen je [[Special:UserLogin|anmelden of n gebrukerspagina anmaken]].", 'nocreate-loggedin' => "Je hebben gien toestemming um nieje pagina's an te maken.", 'sectioneditnotsupported-title' => 't Bewarken van seksies wörden niet ondersteund', 'sectioneditnotsupported-text' => 'Je kunnen op disse pagina gien seksies bewarken.', 'permissionserrors' => 'Fouten mit de rechten', 'permissionserrorstext' => 'Je maggen of kunnen dit niet doon. De {{PLURAL:$1|reden|redens}} daorveur {{PLURAL:$1|is|bin}}:', 'permissionserrorstext-withaction' => 'Je hebben gien rech um $2, mit de volgende {{PLURAL:$1|reden|redens}}:', 'recreate-moveddeleted-warn' => "'''Waorschuwing: je maken n pagina an die eerder al vortedaon is.''' Bedenk eers of t neudig is um disse pagina veerder te bewarken. Veur de dudelikheid steet hieronder t vortdologboek en t herneumlogboek veur disse pagina:", 'moveddeleted-notice' => 'Disse pagina is vortedaon. Hieronder steet de informasie uut t vortdologboek en t herneumlogboek.', 'log-fulllog' => 't Hele logboek bekieken', 'edit-hook-aborted' => 'De bewarking is aofebreuken deur n hook. Der is gien reden op-egeven.', 'edit-gone-missing' => 'De pagina kon niet bie-ewörken wörden. t Schient dat t vortedaon is.', 'edit-conflict' => 'Bewarkingskonflikt.', 'edit-no-change' => 'Joew bewarking is enegeerd, umdat der gien wieziging an de tekste edaon is.', 'edit-already-exists' => 'De pagina kon niet an-emaakt wörden. t Besteet al.', # Parser/template warnings 'expensive-parserfunction-warning' => 'Waorschuwing: disse pagina gebruukt te veule kostbaore parserfunksies. Noen {{PLURAL:$1|is|bin}} t der $1, terwiel t der minder as $2 {{PLURAL:$2|mut|mutten}} ween.', 'expensive-parserfunction-category' => "Pagina's die te veule kostbaore parserfunksies gebruken", 'post-expand-template-inclusion-warning' => 'Waorschuwing: de grootte van de in-evoegden mal is te groot. Sommigen mallen wörden niet in-evoegd.', 'post-expand-template-inclusion-category' => "Pagina's die over de maximumgrootte veur in-evoegden mallen hinne gaon", 'post-expand-template-argument-warning' => 'Waorschuwing: disse pagina gebruuk tenminsten één parameter in n mal, die te groot is as t uuteklap wörden. Disse parameters wörden vorteleuten.', 'post-expand-template-argument-category' => "Pagina's mit ontbrekende malelementen", 'parser-template-loop-warning' => 'Der is n kringloop in mallen waoreneumen: [[$1]]', 'parser-template-recursion-depth-warning' => 'Der is over de rekursiediepte veur mallen is hinne gaon ($1)', 'language-converter-depth-warning' => 'Je hebben t dieptelimiet veur de taalumzetter bereikt ($1)', # "Undo" feature 'undo-success' => 'De bewarking kan weerummedreid wörden. Kiek de vergelieking hieronder nao um der wisse van de ween dat alles goed is, en slao de de pagina op um de bewarking weerumme te dreien.', 'undo-failure' => 'De wieziging kon niet weerummedreid wörden umdat t ondertussen awweer ewiezigd is.', 'undo-norev' => 'De bewarking kon niet weerummedreid wörden, umdat t niet besteet of vortedaon is.', 'undo-summary' => 'Versie $1 van [[Special:Contributions/$2|$2]] ([[User talk:$2|overleg]]) weerummedreid.', # Account creation failure 'cantcreateaccounttitle' => 'Anmaken van n gebrukersprofiel is niet meugelik', 'cantcreateaccount-text' => "t Anmaken van gebrukers van dit IP-adres (<b>$1</b>) is eblokkeerd deur [[User:$3|$3]]. De deur $3 op-egeven reden is ''$2''", # History pages 'viewpagelogs' => 'Bekiek logboeken veur disse pagina', 'nohistory' => 'Der bin gien eerdere versies van disse pagina.', 'currentrev' => 'Leste versie', 'currentrev-asof' => 'Leste versie van $1', 'revisionasof' => 'Versie op $1', 'revision-info' => 'Versie op $1 van $2', 'previousrevision' => '&larr; eerdere versie', 'nextrevision' => 'niejere versie &rarr;', 'currentrevisionlink' => 'versie zo as t noen is', 'cur' => 'noen', 'next' => 'Volgende', 'last' => 'leste', 'page_first' => 'eerste', 'page_last' => 'leste', 'histlegend' => 'Verklaoring aofkortingen: (noen) = verschil mit de op-esleugen versie, (veurige) = verschil mit de veurige versie, K = kleine wieziging', 'history-fieldset-title' => 'Deur de geschiedenisse blaojen', 'history-show-deleted' => 'Allinnig vortedaon', 'histfirst' => 'Eerste', 'histlast' => 'Leste', 'historysize' => '({{PLURAL:$1|1 byte|$1 bytes}})', 'historyempty' => '(leeg)', # Revision feed 'history-feed-title' => 'Wiezigingsoverzichte', 'history-feed-description' => 'Wiezigingsoverzichte veur disse pagina op de wiki', 'history-feed-item-nocomment' => '$1 op $2', 'history-feed-empty' => "De op-evreugen pagina besteet niet. t Kan ween dat disse pagina vortedaon is of dat t herneumd is. Probeer te [[Special:Search|zeuken]] naor soortgelieke nieje pagina's.", # Revision deletion 'rev-deleted-comment' => '(bewarkingsopmarking vortedaon)', 'rev-deleted-user' => '(gebrukersnaam vortedaon)', 'rev-deleted-event' => '(antekening vortedaon)', 'rev-deleted-user-contribs' => '[gebrukersnaam of IP-adres vortedaon - bewarking verbörgen in biedragen]', 'rev-deleted-text-permission' => "Disse bewarking is '''vortedaon'''. As der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{PAGENAMEE}}}} vortdologboek].", 'rev-deleted-text-unhide' => "Disse bewarking is '''vortedaon'''. As der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{PAGENAMEE}}}} vortdologboek]. Je kunnen [$1 disse versie bekieken] a'j willen.", 'rev-suppressed-text-unhide' => "Disse bewarking is '''onderdrokt'''. As der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/suppress|page={{PAGENAMEE}}}} logboek mit onderdrokten informasie]. Je kunnen [$1 disse versie bekieken] a'j willen.", 'rev-deleted-text-view' => "Disse bewarking is '''vortedaon'''. Je kunnnen t bekieken; as der meer informasie is, ku'j dat vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} vortdologboek].", 'rev-suppressed-text-view' => "Disse bewarking is '''onderdrok'''. Je kunnen t bekieken; as der meer informasie is, ku'j dat vienen in t [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} logboek mit onderdrokten versies].", 'rev-deleted-no-diff' => "Je kunnen de verschillen niet bekieken umdat één van de versies '''vortedaon''' is. As der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{PAGENAMEE}}}} vortdologboek].", 'rev-suppressed-no-diff' => "Je kunnen de verschillen niet bekieken umdat één van de versies '''vortedaon''' is.", 'rev-deleted-unhide-diff' => "Eén van de bewarkingen in disse vergeliekingen is '''vortedaon'''. As der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{PAGENAMEE}}}} vortdologboek]. Je kunnen [$1 de verschillen bekieken] a'j willen.", 'rev-suppressed-unhide-diff' => "Eén van de bewarkingen in disse vergeliekingen is '''vortedaon'''. As der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/suppress|page={{PAGENAMEE}}}} logboek mit onderdrokten informasie]. Je kunnen [$1 de verschillen bekieken] a'j willen.", 'rev-deleted-diff-view' => "Eén van de bewarkingen veur de verschillen die'j op-evreugen hebben, is '''vortedaon'''. Je kunnen disse verschillen bekieken. Misschien steet der meer over in t [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} vortdologboek].", 'rev-suppressed-diff-view' => "Eén van de bewarkingen veur de verschillen die'j op-evreugen hebben, is '''onderdrokt'''. Je kunnen disse verschillen bekieken. Misschien steet der over in t [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} logboek mit onderdrokten versies].", 'rev-delundel' => 'bekiek/verbarg', 'rev-showdeleted' => 'bekiek', 'revisiondelete' => 'Wiezigingen vortdoon/herstellen', 'revdelete-nooldid-title' => 'Gien doelversie', 'revdelete-nooldid-text' => 'Je hebben gien versie an-egeven waor disse aksie op uutevoerd mut wörden.', 'revdelete-nologtype-title' => 'Der is gien logboektype op-egeven', 'revdelete-nologtype-text' => 'Je hebben gien logboektype op-egeven um disse haandeling op uut te voeren.', 'revdelete-nologid-title' => 'Ongeldige logboekregel', 'revdelete-nologid-text' => 'Of je hebben gien doellogboekregel op-egeven of de an-egeven logboekregel besteet niet.', 'revdelete-no-file' => 't Op-egeven bestaand besteet niet.', 'revdelete-show-file-confirm' => 'Bi\'j der wisse van da\'j de vortedaone versie van t bestaand "<nowiki>$1</nowiki>" van $2 um $3 bekieken willen?', 'revdelete-show-file-submit' => 'Ja', 'revdelete-selected' => "'''{{PLURAL:$2|Ekeuzen bewarking|Ekeuzen bewarkingen}} van '''[[:$1]]''':'''", 'logdelete-selected' => "'''{{PLURAL:$1|Ekeuzen logboekboekaksie|Ekeuzen logboekaksies}}:'''", 'revdelete-text' => "'''Vortedaone bewarkingen staon nog altied in de geschiedenisse en in logboeken, mer niet iederene kan de inhoud zo mer bekieken.''' Beheerders van {{SITENAME}} kunnen de verbörgen inhoud bekieken en t weerummeplaotsen deur dit scharm te gebruken, behalven as der aandere beparkingen in-esteld bin.", 'revdelete-confirm' => "Bevestig da'j dit doon wollen, da'j de gevolgen dervan begriepen en da'j t doon in overeenstemming mit t geldende [[{{MediaWiki:Policy-url}}|beleid]].", 'revdelete-suppress-text' => "Onderdrokken ma'j '''allinnig''' gebruken in de volgende gevallen: * Ongepassen persoonlike informasie *: ''adressen en tillefoonnummers, burgerservicenummers, en gao zo mer deur.''", 'revdelete-legend' => 'Stel versiebeparkingen in:', 'revdelete-hide-text' => 'Verbarg de bewarken tekste', 'revdelete-hide-image' => 'Verbarg bestaandsinhoud', 'revdelete-hide-name' => 'Verbarg logboekaksie', 'revdelete-hide-comment' => 'Verbarg bewarkingssamenvatting', 'revdelete-hide-user' => 'Verbarg gebrukersnamen en IP-adressen van aandere luui.', 'revdelete-hide-restricted' => 'Gegevens veur beheerders en aander volk onderdrokken', 'revdelete-radio-same' => '(niet wiezigen)', 'revdelete-radio-set' => 'Ja', 'revdelete-radio-unset' => 'Nee', 'revdelete-suppress' => 'Gegevens veur beheerders en aander volk onderdrokken', 'revdelete-unsuppress' => 'Beparkingen veur weerummezetten versies vortdoon', 'revdelete-log' => 'Reden:', 'revdelete-submit' => 'Toepassen op de ekeuzen {{PLURAL:$1|bewarking|bewarkingen}}', 'revdelete-logentry' => 'zichtbaorheid van bewarkingen is ewiezigd veur [[$1]]', 'logdelete-logentry' => 'wiezigen zichtbaorheid van gebeurtenisse [[$1]]', 'revdelete-success' => "'''De zichtbaorheid van de wieziging is bie-ewörken.'''", 'revdelete-failure' => "'''De zichtbaorheid veur de wieziging kon niet bie-ewörken wörden:''' $1", 'logdelete-success' => "'''Zichtbaorheid van de gebeurtenisse is suksesvol in-esteld.'''", 'logdelete-failure' => "'''De zichtbaorheid van de logboekregel kon niet in-esteld wörden:''' $1", 'revdel-restore' => 'Zichtbaorheid wiezigen', 'revdel-restore-deleted' => 'vortedaone versies', 'revdel-restore-visible' => 'zichtbaore versies', 'pagehist' => 'Paginageschiedenisse', 'deletedhist' => 'Geschiedenisse die vortehaold is', 'revdelete-content' => 'inhoud', 'revdelete-summary' => 'samenvatting bewarken', 'revdelete-uname' => 'gebrukersnaam', 'revdelete-restricted' => 'hef beparkingen an beheerders op-eleg', 'revdelete-unrestricted' => 'hef beparkingen veur beheerders deraof ehaold', 'revdelete-hid' => 'hef $1 verbörgen', 'revdelete-unhid' => 'hef $1 zichtbaor emaak', 'revdelete-log-message' => '$1 veur $2 {{PLURAL:$2|versie|versies}}', 'logdelete-log-message' => '$1 veur $2 {{PLURAL:$2|logboekregel|logboekregels}}', 'revdelete-hide-current' => 'Fout bie t verbargen van t objekt van $1 um $2 uur: dit is de versie van noen. Disse versie kan niet verbörgen wörden.', 'revdelete-show-no-access' => 'Fout bie t weergeven van t objekt van $1 um $2 uur: dit objekt is emarkeerd as "beveilig". Je hebben gien toegang tot dit objekt.', 'revdelete-modify-no-access' => 'Fout bie t wiezigen van t objekt van $1 um $2 uur: dit objekt is emarkeerd as "beveilig". Je hebben gien toegang tot dit objekt.', 'revdelete-modify-missing' => 'Fout bie t wiezigen van versienummer $1: t kump niet veur in de databanke!', 'revdelete-no-change' => "'''Waorschuwing:''' t objekt van $1 um $2 uur had al de an-egeven zichtbaorheidsinstellingen.", 'revdelete-concurrent-change' => 'Fout bie t wiezigen van t objekt van $1 um $2 uur: de staotus is inmiddels ewiezigd deur n aander. Kiek de logboeken nao.', 'revdelete-only-restricted' => 'Der is n fout op-etrejen bie t verbargen van t objekt van $1, $2: je kunnen gien objekten onderdrokken uut t zich van beheerders zonder oek n van de aandere zichtbaorheidsopsies te selekteren.', 'revdelete-reason-dropdown' => '*Veulveurkoemde redens veur t vortdoon ** Schenden van de auteursrechten ** Ongeschikte persoonlike informasie ** Meugelik lasterlike informasie', 'revdelete-otherreason' => 'Aandere reden:', 'revdelete-reasonotherlist' => 'Aandere reden', 'revdelete-edit-reasonlist' => 'Redens veur t vortdoon bewarken', 'revdelete-offender' => 'Auteur versie:', # Suppression log 'suppressionlog' => 'Verbargingslogboek', 'suppressionlogtext' => "In de onderstaande lieste staon de vortedaone pagina's en blokkeringen die veur beheerders verbörgen bin. In de [[Special:BlockList|IP-blokkeerlieste]] bin de blokkeringen, die noen van toepassing bin, te bekieken.", # History merging 'mergehistory' => "Geschiedenisse van pagina's bie mekaar doon", 'mergehistory-header' => "Via disse pagina ku'j versies uut de geschiedenisse van n bronpagina mit n niejere pagina samenvoegen. Zörg derveur dat disse versies uut de geschiedenisse histories juus bin.", 'mergehistory-box' => "Geschiedenisse van twee pagina's bie mekaar doon:", 'mergehistory-from' => 'Bronpagina:', 'mergehistory-into' => 'Bestemmingspagina:', 'mergehistory-list' => 'Bewarkingsgeschiedenisse die bie mekaar edaon kan wörden', 'mergehistory-merge' => 'De volgende versies van [[:$1]] kunnen samenevoegd wörden naor [[:$2]]. Gebruuk de kolom mit keuzerondjes um allinnig de versies die emaak bin op en veur de an-egeven tied samen te voegen. Let op dat t gebruken van de navigasieverwiezingen disse kolom zal herinstellen.', 'mergehistory-go' => 'Bekiek bewarkingen die bie mekaar edaon kunnen wörden', 'mergehistory-submit' => 'Versies bie mekaar doon', 'mergehistory-empty' => 'Der bin gien versies die samenevoegd kunnen wörden.', 'mergehistory-success' => '$3 {{PLURAL:$3|versie|versies}} van [[:$1]] bin suksesvol samenevoegd naor [[:$2]].', 'mergehistory-fail' => 'Kan gien geschiedenisse samenvoegen, kiek opniej de pagina- en tiedparameters nao.', 'mergehistory-no-source' => 'Bronpagina $1 besteet niet.', 'mergehistory-no-destination' => 'Bestemmingspagina $1 besteet niet.', 'mergehistory-invalid-source' => 'De bronpagina mut n geldige titel ween.', 'mergehistory-invalid-destination' => 'De bestemmingspagina mut n geldige titel ween.', 'mergehistory-autocomment' => '[[:$1]] samenevoegd naor [[:$2]]', 'mergehistory-comment' => '[[:$1]] samenevoegd naor [[:$2]]: $3', 'mergehistory-same-destination' => 'De bronpagina en doelpagina kunnen niet t zelfde ween', 'mergehistory-reason' => 'Reden:', # Merge log 'mergelog' => 'Samenvoegingslogboek', 'pagemerge-logentry' => 'voegen [[$1]] naor [[$2]] samen (versies tot en mit $3)', 'revertmerge' => 'Samenvoeging weerummedreien', 'mergelogpagetext' => "Hieronder zie'j n lieste van de leste samenvoegingen van n paginageschiedenisse naor n aandere.", # Diffs 'history-title' => 'Geschiedenisse van "$1"', 'difference' => '(Verschil tussen bewarkingen)', 'difference-multipage' => "(Verschil tussen pagina's)", 'lineno' => 'Regel $1:', 'compareselectedversions' => 'Vergeliek de ekeuzen versies', 'showhideselectedversions' => 'Ekeuzen versies bekieken/verbargen', 'editundo' => 'weerummedreien', 'diff-multi' => '(Hier {{PLURAL:$1|zit nog 1 versie|zitten nog $1 versies}} van {{PLURAL:$2|1 gebruker|$2 gebrukers}} tussen die der niet bie staon.)', 'diff-multi-manyusers' => '($1 tussenliggende {{PLURAL:$1|versie|versies}} deur meer as $2 {{PLURAL:$2|gebruker|gebrukers}} niet weeregeven)', # Search results 'searchresults' => 'Zeukresultaoten', 'searchresults-title' => 'Zeukresultaoten veur "$1"', 'searchresulttext' => 'Veur meer informasie over zeuken op {{SITENAME}}, zie [[{{MediaWiki:Helppage}}|{{int:help}}]].', 'searchsubtitle' => 'Je zöchten naor \'\'\'[[:$1]]\'\'\' ([[Special:Prefixindex/$1|alle pagina\'s die beginnen mit "$1"]]{{int:pipe-separator}}[[Special:WhatLinksHere/$1|alle pagina\'s die verwiezen naor "$1"]])', 'searchsubtitleinvalid' => 'Veur zeukopdrachte "$1"', 'toomanymatches' => 'Der waren te veule resultaoten. Probeer n aandere zeukopdrachte.', 'titlematches' => 'Overeenkomst mit t onderwarp', 'notitlematches' => 'Gien overeenstemming', 'textmatches' => 'Overeenkomst mit teksten', 'notextmatches' => 'Gien overeenstemming', 'prevn' => 'veurige {{PLURAL:$1|$1}}', 'nextn' => 'volgende {{PLURAL:$1|$1}}', 'prevn-title' => '{{PLURAL:$1|Veurig resultaot|Veurige $1 resultaoten}}', 'nextn-title' => '{{PLURAL:$1|Volgend resultaot|Volgende $1 resultaoten}}', 'shown-title' => 'Laot $1 {{PLURAL:$1|resultaot|resultaoten}} per pagina zien', 'viewprevnext' => '($1 {{int:pipe-separator}} $2) ($3)', 'searchmenu-legend' => 'Zeukopsies', 'searchmenu-exists' => "* Pagina '''[[$1]]'''", 'searchmenu-new' => "'''De pagina \"[[:\$1]]\" op disse wiki anmaken!'''", 'searchhelp-url' => 'Help:Inhold', 'searchmenu-prefix' => '[[Special:PrefixIndex/$1|Paginanamen mit dit veurvoegsel laoten zien]]', 'searchprofile-articles' => 'Artikels', 'searchprofile-project' => "Hulp- en projektpagina's", 'searchprofile-images' => 'Multimedia', 'searchprofile-everything' => 'Alles', 'searchprofile-advanced' => 'Uutebreid', 'searchprofile-articles-tooltip' => 'Zeuken in $1', 'searchprofile-project-tooltip' => 'Zeuken in $1', 'searchprofile-images-tooltip' => 'Zeuken naor bestaanden', 'searchprofile-everything-tooltip' => "Alle inhoud deurzeuken (oek overlegpagina's)", 'searchprofile-advanced-tooltip' => 'Zeuken in de an-egeven naamruumtes', 'search-result-size' => '$1 ({{PLURAL:$2|1 woord|$2 woorden}})', 'search-result-category-size' => '{{PLURAL:$1|1 kategorielid|$1 kategorielejen}} ({{PLURAL:$2|1 onderkategorie|$2 onderkategorieën}}, {{PLURAL:$3|1 bestaand|$3 bestaanden}})', 'search-result-score' => 'Relevansie: $1%', 'search-redirect' => '(deurverwiezing $1)', 'search-section' => '(onderwarp $1)', 'search-suggest' => 'Bedoelden je: $1', 'search-interwiki-caption' => 'Zusterprojekten', 'search-interwiki-default' => '$1 resultaoten:', 'search-interwiki-more' => '(meer)', 'search-mwsuggest-enabled' => 'mit anbevelingen', 'search-mwsuggest-disabled' => 'gien anbevelingen', 'search-relatedarticle' => 'Verwaant', 'mwsuggest-disable' => 'Anbevelingen via AJAX uutschakelen', 'searcheverything-enable' => 'In alle naamruumten zeuken', 'searchrelated' => 'verwaant', 'searchall' => 'alles', 'showingresults' => "Hieronder {{PLURAL:$1|steet '''1''' resultaot|staon '''$1''' resultaoten}} <b>$1</b> vanaof nummer <b>$2</b>.", 'showingresultsnum' => "Hieronder {{PLURAL:$3|steet '''1''' resultaot|staon '''$3''' resultaoten}} vanaof nummer '''$2'''.", 'showingresultsheader' => "{{PLURAL:$5|Resultaot '''$1''' van '''$3'''|Resultaoten '''$1 - $2''' van '''$3'''}} veur '''$4'''", 'nonefound' => "<strong>Let wel:</strong> standard wörden niet alle naamruumtes deurzöcht. A'j in zeukopdrachte as veurvoegsel \"''all:'' gebruken wörden alle pagina's deurzöcht (oek overlegpagina's, mallen en gao zo mer deur). Je kunnen oek n naamruumte as veurvoegsel gebruken.", 'search-nonefound' => 'Der bin gien resultaoten veur de zeukopdrachte.', 'powersearch' => 'Zeuk', 'powersearch-legend' => 'Uutebreid zeuken', 'powersearch-ns' => 'Zeuken in naamruumten:', 'powersearch-redir' => 'Deurverwiezingen bekieken', 'powersearch-field' => 'Zeuken naor', 'powersearch-togglelabel' => 'Selekteren:', 'powersearch-toggleall' => 'Alle', 'powersearch-togglenone' => 'Gien', 'search-external' => 'Extern zeuken', 'searchdisabled' => 'Zeuken in {{SITENAME}} is niet meugelik. Je kunnen gebruukmaken van Google. De gegevens over {{SITENAME}} bin misschien niet bie-ewörken.', # Quickbar 'qbsettings' => 'Paginalieste', 'qbsettings-none' => 'Gien', 'qbsettings-fixedleft' => 'Links, vaste', 'qbsettings-fixedright' => 'Rechts, vaste', 'qbsettings-floatingleft' => 'Links, zweven', 'qbsettings-floatingright' => 'Rechts, zweven', 'qbsettings-directionality' => 'Vaste, aofhankelik van de schriefrichtige van joew taal', # Preferences page 'preferences' => 'Veurkeuren', 'mypreferences' => 'Mien veurkeuren', 'prefs-edits' => 'Antal bewarkingen:', 'prefsnologin' => 'Niet an-meld', 'prefsnologintext' => 'Je mutten <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} an-emeld]</span> ween um joew veurkeuren in te kunnen stellen.', 'changepassword' => 'Wachtwoord wiezigen', 'prefs-skin' => '{{SITENAME}}-uterlik', 'skin-preview' => 'bekieken', 'datedefault' => 'Gien veurkeur', 'prefs-beta' => 'Bètafunksies', 'prefs-datetime' => 'Daotum en tied', 'prefs-labs' => 'Alphafunksies', 'prefs-personal' => 'Gebrukersgegevens', 'prefs-rc' => 'Leste wiezigingen', 'prefs-watchlist' => 'Volglieste', 'prefs-watchlist-days' => 'Antal dagen in de volglieste bekieken:', 'prefs-watchlist-days-max' => 'Maximaal 7 dagen', 'prefs-watchlist-edits' => 'Antal wiezigingen in de uutebreiden volglieste:', 'prefs-watchlist-edits-max' => 'Maximale antal: 1.000', 'prefs-watchlist-token' => 'Volgliestesleutel', 'prefs-misc' => 'Overig', 'prefs-resetpass' => 'Wachtwoord wiezigen', 'prefs-email' => 'Instellingen veur netpost', 'prefs-rendering' => 'Paginaweergave', 'saveprefs' => 'Veurkeuren opslaon', 'resetprefs' => 'Standardveurkeuren herstellen', 'restoreprefs' => 'Alle standardinstellingen weerummezetten', 'prefs-editing' => 'Bewarkingsveld', 'prefs-edit-boxsize' => 'Aofmetingen van t bewarkingsvienster.', 'rows' => 'Regels', 'columns' => 'Kolommen', 'searchresultshead' => 'Zeukresultaoten', 'resultsperpage' => 'Antal zeukresultaoten per pagina', 'stub-threshold' => 'Verwiezingsformattering van <a href="#" class="stub">beginnetjes</a>:', 'stub-threshold-disabled' => 'uuteschakeld', 'recentchangesdays' => 'Antal dagen die de lieste "leste wiezigingen" laot zien:', 'recentchangesdays-max' => '(maximaal $1 {{PLURAL:$1|dag|dagen}})', 'recentchangescount' => 'Standard antal bewarkingen um te laoten zien:', 'prefs-help-recentchangescount' => "Dit geldt veur leste wiezigingen, paginageschiedenisse en logboekpagina's", 'prefs-help-watchlist-token' => "A'j in dit veld n geheime kode invullen, dan maakt t RSS-voer an veur joew volglieste. Iederene die disse kode weet kan joew volglieste bekieken, kies dus n veilige kode. Je kunnen oek disse egenereren standardkode gebruken: $1", 'savedprefs' => 'Veurkeuren bin op-esleugen.', 'timezonelegend' => 'Tiedzone:', 'localtime' => 'Plaotselike tied:', 'timezoneuseserverdefault' => 'Wikistandard gebruken ($1)', 'timezoneuseoffset' => 'Aanders (tiedverschil angeven)', 'timezoneoffset' => 'Tiedverschil¹:', 'servertime' => 'Tied op de server:', 'guesstimezone' => 'Vanuut webkieker overnemen', 'timezoneregion-africa' => 'Afrika', 'timezoneregion-america' => 'Amerika', 'timezoneregion-antarctica' => 'Antarktika', 'timezoneregion-arctic' => 'Arktis', 'timezoneregion-asia' => 'Azië', 'timezoneregion-atlantic' => 'Atlantiese Oseaan', 'timezoneregion-australia' => 'Australië', 'timezoneregion-europe' => 'Europa', 'timezoneregion-indian' => 'Indiese Oseaan', 'timezoneregion-pacific' => 'Stille Oseaan', 'allowemail' => 'Berichten van aandere gebrukers toestaon', 'prefs-searchoptions' => 'Zeukinstellingen', 'prefs-namespaces' => 'Naamruumtes', 'defaultns' => 'Aanders in de volgende naamruumten zeuken:', 'default' => 'standard', 'prefs-files' => 'Bestaanden', 'prefs-custom-css' => 'Persoonlike CSS', 'prefs-custom-js' => 'Persoonlike JS', 'prefs-common-css-js' => 'Edeelden CSS/JS veur elke vormgeving:', 'prefs-reset-intro' => 'Je kunnen disse pagina gebruken um joew veurkeuren naor de standardinstellingen weerumme te zetten. Disse haandeling kan niet ongedaonemaakt wörden.', 'prefs-emailconfirm-label' => 'Netpostbevestiging:', 'prefs-textboxsize' => 'Aofmetingen bewarkingsscharm', 'youremail' => 'Netpostadres (niet verplicht) *', 'username' => 'Gebrukersnaam:', 'uid' => 'Gebrukersnummer:', 'prefs-memberingroups' => 'Lid van {{PLURAL:$1|groep|groepen}}:', 'prefs-registration' => 'Registrasiedaotum:', 'yourrealname' => 'Echte naam (niet verplicht)', 'yourlanguage' => 'Taal veur systeemteksten', 'yourvariant' => 'Taalvariaant veur inhoud:', 'yournick' => 'Alias veur ondertekeningen', 'prefs-help-signature' => 'Reaksies op de overlegpagina\'s mutten ondertekend wörden mit "<nowiki>~~~~</nowiki>", dit wörden dan ummezet in joew ondertekening mit daorbie de daotum en tied van de bewarking.', 'badsig' => 'Ongeldige haandtekening; HTML naokieken.', 'badsiglength' => 'Joew haandtekening is te lang. t Mut minder as {{PLURAL:$1|letter|letters}} hebben.', 'yourgender' => 'Geslachte:', 'gender-unknown' => 'Niet an-egeven', 'gender-male' => 'Keerl', 'gender-female' => 'Deerne', 'prefs-help-gender' => 'Opsioneel: dit gebruken wie um gebrukers op n juuste maniere an te spreken in de programmatuur. Disse informasie is zichtbaor veur aandere gebrukers.', 'email' => 'Privéberichten', 'prefs-help-realname' => "* Echte naam (niet verplicht): a'j disse opsie invullen zu'w joew echte naam gebruken um erkenning te geven veur joew warkzaamheen.", 'prefs-help-email' => "n Netpostadres is niet verplicht, mer zo ku'w wel joew wachtwoord toesturen veur a'j t vergeten bin.", 'prefs-help-email-others' => "Je kunnen oek aandere meensen de meugelikheid geven um kontakt mit joe op te nemen mit n verwiezing op joew gebrukers- en overlegpagina zonder da'j de identiteit pries hoeven te geven.", 'prefs-help-email-required' => "Hier he'w n netpostadres veur neudig.", 'prefs-info' => 'Baosisinformasie', 'prefs-i18n' => 'Taalinstellingen', 'prefs-signature' => 'Ondertekening', 'prefs-dateformat' => 'Daotumopmaak:', 'prefs-timeoffset' => 'Tiedsverschil', 'prefs-advancedediting' => 'Aandere instellingen', 'prefs-advancedrc' => 'Aandere instellingen', 'prefs-advancedrendering' => 'Aandere instellingen', 'prefs-advancedsearchoptions' => 'Aandere instellingen', 'prefs-advancedwatchlist' => 'Aandere instellingen', 'prefs-displayrc' => 'Weergave-instellingen', 'prefs-displaysearchoptions' => 'Weergave-instellingen', 'prefs-displaywatchlist' => 'Weergave-instellingen', 'prefs-diffs' => 'Verschillen', # User preference: e-mail validation using jQuery 'email-address-validity-valid' => 'Geldig netpostadres', 'email-address-validity-invalid' => 'Geef n geldig netpostadres op', # User rights 'userrights' => 'Gebrukersrechtenbeheer', 'userrights-lookup-user' => 'Beheer gebrukersgroepen', 'userrights-user-editname' => 'Vul n gebrukersnaam in:', 'editusergroup' => 'Bewark gebrukersgroepen', 'editinguser' => "Doonde mit t wiezigen van de gebrukersrechten van '''[[User:$1|$1]]''' ([[User talk:$1|{{int:talkpagelinktext}}]]{{int:pipe-separator}}[[Special:Contributions/$1|{{int:contribslink}}]])", 'userrights-editusergroup' => 'Bewark gebrukersgroep', 'saveusergroups' => 'Gebrukergroepen opslaon', 'userrights-groupsmember' => 'Lid van:', 'userrights-groupsmember-auto' => 'Lid van:', 'userrights-groups-help' => 'Je kunnen de groepen wiezigen waor as de gebruker lid van is. * n An-evinkt vakjen betekent dat de gebruker lid is van de groep. * n Niet an-evinkt vakjen betekent dat de gebruker gien lid is van de groep. * n "*" betekent da\'j n gebruker niet uut n groep vort kunnen haolen naodat e derbie ezet is, of aandersumme.', 'userrights-reason' => 'Reden:', 'userrights-no-interwiki' => "Je hebben gien rechten um gebrukersrechten op aandere wiki's te wiezigen.", 'userrights-nodatabase' => 'Databanke $1 besteet niet of is gien plaotselike databanke.', 'userrights-nologin' => 'Je mutten [[Special:UserLogin|an-emeld]] ween en as gebruker de juuste rechten hebben um gebrukersrechten toe te kunnen wiezen.', 'userrights-notallowed' => 'Je hebben gien rechten um gebrukersrechten toe te kunnen wiezen of in te trekken.', 'userrights-changeable-col' => "Groepen die'j beheren kunnen", 'userrights-unchangeable-col' => "Groepen die'j niet beheren kunnen", # Groups 'group' => 'Groep:', 'group-user' => 'gebrukers', 'group-autoconfirmed' => 'an-emelde gebrukers', 'group-bot' => 'bots', 'group-sysop' => 'beheerders', 'group-bureaucrat' => 'burokraoten', 'group-suppress' => 'toezichthouwers', 'group-all' => '(alles)', 'group-user-member' => '{{GENDER:$1|gebruker}}', 'group-autoconfirmed-member' => '{{GENDER:$1|autobevestigden gebruker}}', 'group-bot-member' => '{{GENDER:$1|bot}}', 'group-sysop-member' => '{{GENDER:$1|beheerder}}', 'group-bureaucrat-member' => '{{GENDER:$1|burokraot}}', 'group-suppress-member' => '{{GENDER:$1|toezichthouwer}}', 'grouppage-user' => '{{ns:project}}:Gebrukers', 'grouppage-autoconfirmed' => '{{ns:project}}:An-emelde gebrukers', 'grouppage-bot' => '{{ns:project}}:Bots', 'grouppage-sysop' => '{{ns:project}}:Beheerder', 'grouppage-bureaucrat' => '{{ns:project}}:Beheerder', 'grouppage-suppress' => '{{ns:project}}:Toezichte', # Rights 'right-read' => "Pagina's bekieken", 'right-edit' => "Pagina's bewarken", 'right-createpage' => "Pagina's anmaken", 'right-createtalk' => "Overlegpagina's anmaken", 'right-createaccount' => 'Nieje gebrukers anmaken', 'right-minoredit' => 'Bewarkingen markeren as klein', 'right-move' => "Pagina's herneumen", 'right-move-subpages' => "Pagina's samen mit subpagina's verplaotsen", 'right-move-rootuserpages' => "Gebrukerspagina's van t hoogste nivo herneumen", 'right-movefile' => 'Bestaanden herneumen', 'right-suppressredirect' => 'Gien deurverwiezing anmaken op de ouwe naam as n pagina herneumd wörden', 'right-upload' => 'Bestaanden opsturen', 'right-reupload' => 'n Bestaond bestaand overschrieven', 'right-reupload-own' => "Bestaanden overschrieven die'j der zelf bie ezet hebben", 'right-reupload-shared' => 'Media uut de edeelden mediadatabanke plaotselik overschrieven', 'right-upload_by_url' => 'Bestaanden inlaojen via n webadres', 'right-purge' => 't Tussengeheugen van n pagina legen', 'right-autoconfirmed' => 'Behaandeld wörden as n an-emelde gebruker', 'right-bot' => 'Behaandeld wörden as n eautomatiseerd preces', 'right-nominornewtalk' => "Kleine bewarkingen an n overlegpagina leien niet tot n melding 'nieje berichten'", 'right-apihighlimits' => 'Hoge API-limieten gebruken', 'right-writeapi' => 'Bewarken via de API', 'right-delete' => "Pagina's vortdoon", 'right-bigdelete' => "Pagina's mit n grote geschiedenisse vortdoon", 'right-deleterevision' => "Versies van pagina's verbargen", 'right-deletedhistory' => 'Vortedaone versies bekieken, zonder te kunnen zien wat der vortedaon is', 'right-deletedtext' => 'Bekiek vortedaone tekste en wiezigingen tussen vortedaone versies', 'right-browsearchive' => "Vortedaone pagina's bekieken", 'right-undelete' => "Vortedaone pagina's weerummeplaotsen", 'right-suppressrevision' => 'Verbörgen versies bekieken en weerummeplaotsen', 'right-suppressionlog' => 'Niet-publieke logboeken bekieken', 'right-block' => 'Aandere gebrukers de meugelikheid ontnemen um te bewarken', 'right-blockemail' => 'n Gebruker t recht ontnemen um berichjes te versturen', 'right-hideuser' => 'n Gebruker veur de overige gebrukers verbargen', 'right-ipblock-exempt' => 'IP-blokkeringen ummezeilen', 'right-proxyunbannable' => "Blokkeringen veur proxy's gelden niet", 'right-unblockself' => 'Eigen gebruker deblokkeren', 'right-protect' => "Beveiligingsnivo's wiezigen", 'right-editprotected' => "Beveiligden pagina's bewarken", 'right-editinterface' => 't {{SITENAME}}-uterlik bewarken', 'right-editusercssjs' => 'De CSS- en JS-bestaanden van aandere gebrukers bewarken', 'right-editusercss' => 'De CSS-bestaanden van aandere gebrukers bewarken', 'right-edituserjs' => 'De JS-bestaanden van aandere gebrukers bewarken', 'right-rollback' => 'Gauw de leste bewarking(en) van n gebruker an n pagina weerummedreien', 'right-markbotedits' => 'Weerummedreien bewarkingen markeren as botbewarkingen', 'right-noratelimit' => 'Hef gien tiedsaofhankelike beparkingen', 'right-import' => "Pagina's uut aandere wiki's invoeren", 'right-importupload' => "Pagina's vanuut n bestaand invoeren", 'right-patrol' => 'Bewarkingen as ekontroleerd markeren', 'right-autopatrol' => 'Bewarkingen wörden automaties as ekontroleerd emarkeerd', 'right-patrolmarks' => 'Kontroletekens in leste wiezigingen bekieken', 'right-unwatchedpages' => "Bekiek n lieste mit pagina's die niet op n volglieste staon", 'right-trackback' => 'n Trackback opgeven', 'right-mergehistory' => "De geschiedenisse van pagina's bie mekaar doon", 'right-userrights' => 'Alle gebrukersrechten bewarken', 'right-userrights-interwiki' => "Gebrukersrechten van gebrukers in aandere wiki's wiezigen", 'right-siteadmin' => 'De databanke blokkeren en weer vriegeven', 'right-override-export-depth' => "Pagina's uutvoeren, oek de pagina's waor naor verwezen wörden, tot n diepte van 5", 'right-sendemail' => 'Bericht versturen naor aandere gebrukers', # User rights log 'rightslog' => 'Gebrukersrechtenlogboek', 'rightslogtext' => 'Dit is n logboek mit veraanderingen van gebrukersrechten', 'rightslogentry' => 'Gebrukersrechten veur $1 ewiezigd van $2 naor $3', 'rightslogentry-autopromote' => 'was automaties umhoge egaon van $2 naor $3', 'rightsnone' => '(gien)', # Associated actions - in the sentence "You do not have permission to X" 'action-read' => 'disse pagina lezen', 'action-edit' => 'disse pagina bewarken', 'action-createpage' => "pagina's schrieven", 'action-createtalk' => "overlegpagina's anmaken", 'action-createaccount' => 'disse gebruker anmaken', 'action-minoredit' => 'disse bewarking as klein markeren', 'action-move' => 'disse pagina herneumen', 'action-move-subpages' => "disse pagina en de biebeheurende subpagina's herneumen", 'action-move-rootuserpages' => "gebrukerspagina's van t hoogste nivo herneumen", 'action-movefile' => 'dit bestaand herneumen', 'action-upload' => 'dit bestaand opsturen', 'action-reupload' => 'dit bestaonde bestaand overschrieven', 'action-reupload-shared' => 'n aander bestaand over dit bestaand uut de edeelden mediadatabanke hinne zetten.', 'action-upload_by_url' => 'dit bestaand vanaof n webadres inlaojen', 'action-writeapi' => 'de schrief-API bewarken', 'action-delete' => 'disse pagina vortdoon', 'action-deleterevision' => 'disse versie vortdoon', 'action-deletedhistory' => 'de vortedaone versies van disse pagina bekieken', 'action-browsearchive' => "vortedaone pagina's zeuken", 'action-undelete' => 'disse pagina weerummeplaotsen', 'action-suppressrevision' => 'disse verbörgen versie bekieken en weerummeplaotsen', 'action-suppressionlog' => 'dit bescharmde logboek bekieken', 'action-block' => 'disse gebruker blokkeren', 'action-protect' => 't beveiligingsnivo van disse pagina anpassen', 'action-import' => 'disse pagina van n aandere wiki invoeren', 'action-importupload' => 'disse pagina invoeren vanaof n op-estuurd bestaand', 'action-patrol' => 'bewarkingen van aander volk as ekontroleerd markeren', 'action-autopatrol' => 'eigen bewarkingen as ekontroleerd markeren', 'action-unwatchedpages' => "bekiek de liest mit pagina's die niet evolgd wörden", 'action-trackback' => 'n trackback opgeven', 'action-mergehistory' => 'de geschiedenisse van disse pagina samenvoegen', 'action-userrights' => 'alle gebrukersrechten bewarken', 'action-userrights-interwiki' => "de rechten van gebrukers op aandere wiki's bewarken", 'action-siteadmin' => 'de databanke blokkeren of vriegeven', # Recent changes 'nchanges' => '$1 {{PLURAL:$1|wieziging|wiezigingen}}', 'recentchanges' => 'Leste wiezigingen', 'recentchanges-legend' => 'Opsies veur leste wiezigingen', 'recentchangestext' => "Op disse pagina ku'j de leste wiezigingen van disse wiki bekieken.", 'recentchanges-feed-description' => 'Zeuk naor de alderleste wiezingen op disse wiki in disse voer.', 'recentchanges-label-newpage' => 'Mit disse bewarking is n nieje pagina an-emaakt', 'recentchanges-label-minor' => 'Dit is n kleine wieziging', 'recentchanges-label-bot' => 'Disse bewarking is uutevoerd deur n bot', 'recentchanges-label-unpatrolled' => 'Disse bewarking is nog niet nao-ekeken', 'rcnote' => "Hieronder {{PLURAL:$1|steet de leste bewarking|staon de leste '''$1''' bewarkingen}} van de aofeleupen {{PLURAL:$2|dag|'''$2''' dagen}} (stand: $5, $4).", 'rcnotefrom' => 'Dit bin de wiezigingen sinds <b>$2</b> (maximum van <b>$1</b> wiezigingen).', 'rclistfrom' => 'Bekiek wiezigingen vanaof $1', 'rcshowhideminor' => '$1 kleine wiezigingen', 'rcshowhidebots' => '$1 botgebrukers', 'rcshowhideliu' => '$1 an-emelde gebrukers', 'rcshowhideanons' => '$1 anonieme gebrukers', 'rcshowhidepatr' => '$1 nao-ekeken bewarkingen', 'rcshowhidemine' => '$1 mien bewarkingen', 'rclinks' => 'Bekiek de leste $1 wiezigingen van de aofeleupen $2 dagen<br />$3', 'diff' => 'wiezig', 'hist' => 'gesch', 'hide' => 'verbarg', 'show' => 'bekiek', 'minoreditletter' => 'K', 'newpageletter' => 'N', 'boteditletter' => 'B', 'unpatrolledletter' => '!', 'number_of_watching_users_pageview' => '[$1 {{PLURAL:$1|keer|keer}} op n volglieste]', 'rc_categories' => 'Beparking tot kategorieën (scheien mit "|")', 'rc_categories_any' => 'alles', 'newsectionsummary' => 'Niej onderwarp: /* $1 */', 'rc-enhanced-expand' => "Details bekieken (hier he'j JavaScript veur neudig)", 'rc-enhanced-hide' => 'Details verbargen', # Recent changes linked 'recentchangeslinked' => 'Volg verwiezigingen', 'recentchangeslinked-feed' => 'Volg verwiezigingen', 'recentchangeslinked-toolbox' => 'Volg verwiezigingen', 'recentchangeslinked-title' => 'Wiezigingen verwaant an $1', 'recentchangeslinked-noresult' => 'Gien wiezigingen of pagina waornaor verwezen wörden in disse periode.', 'recentchangeslinked-summary' => "Op disse spesiale pagina steet n lieste mit de leste wieziginen op pagina's waornaor verwezen wörden. Pagina's op [[Special:Watchlist|joew volglieste]] staon '''vet-edrokt'''.", 'recentchangeslinked-page' => 'Paginanaam:', 'recentchangeslinked-to' => "Bekiek wiezigingen op pagina's mit verwiezingen naor disse pagina", # Upload 'upload' => 'Bestaand opsturen', 'uploadbtn' => 'Bestaand opsturen', 'reuploaddesc' => 'Weerumme naor t bestaandinlaodformulier.', 'upload-tryagain' => 'Bestaandsbeschrieving biewarken', 'uploadnologin' => 'Niet an-emeld', 'uploadnologintext' => 'Je mutten [[Special:UserLogin|an-emeld]] ween um bestaanden toe te kunnen voegen.', 'upload_directory_missing' => 'De bestaandinlaodmap ($1) is vort en kon niet an-emaakt wörden deur de webserver.', 'upload_directory_read_only' => "Op t moment ku'j gien bestaanden opsturen vanwegen techniese problemen ($1).", 'uploaderror' => 'Fout bie t inlaojen van t bestaand', 'upload-recreate-warning' => "'''Waorschuwing: der is n bestaand mit disse naam vortedaon of herneumd.''' Hieronder steet t vortdologboek en t herneumlogboek veur disse pagina:", 'uploadtext' => "Gebruuk t formulier hieronder um bestaanden op te sturen. Um bestaanden te bekieken of te zeuken die eerder al op-estuurd bin, ku'j naor de [[Special:FileList|bestaandslieste]] gaon. Bestaanden en media die nao t vortdoon opniej op-estuurd wörden ku'j in de smiezen houwen in t [[Special:Log/upload|logboek mit nieje bestaanden]] en t [[Special:Log/delete|vortdologboek]]. Um t bestaand in te voegen in n pagina ku'j één van de volgende kodes gebruken: * '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Bestaand.jpg]]</nowiki>''' * '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Bestaand.png|alternetieve tekste]]</nowiki>''' * '''<nowiki>[[</nowiki>{{ns:media}}<nowiki>:Bestaand.ogg]]</nowiki>''' drekte verwiezing naor n bestaand.", 'upload-permitted' => 'Toe-estaone bestaandstypes: $1.', 'upload-preferred' => 'An-ewezen bestaandstypes: $1.', 'upload-prohibited' => 'Verbeujen bestaandstypes: $1.', 'uploadlog' => 'logboek mit nieje bestaanden', 'uploadlogpage' => 'Logboek mit nieje bestaanden', 'uploadlogpagetext' => 'Hieronder steet n lieste mit bestaanden die net niej bin. Zie de [[Special:NewFiles|uutstalling mit media]] veur n overzichte.', 'filename' => 'Bestaandsnaam', 'filedesc' => 'Beschrieving', 'fileuploadsummary' => 'Beschrieving:', 'filereuploadsummary' => 'Bestaandswiezigingen:', 'filestatus' => 'Auteursrechtstaotus', 'filesource' => 'Bron', 'uploadedfiles' => 'Nieje bestaanden', 'ignorewarning' => 'Negeer alle waorschuwingen', 'ignorewarnings' => 'Negeer waorschuwingen', 'minlength1' => 'Bestaandsnamen mutten uut tenminsten één letter bestaon.', 'illegalfilename' => 'Der staon karakters in bestaandsnaam "$1" die niet in namen van artikels veur maggen koemen. Geef t bestaand n aandere naam, en probeer t dan opniej toe te voegen.', 'badfilename' => 'De naam van t bestaand is ewiezigd naor "$1".', 'filetype-mime-mismatch' => 'De bestaandsextensie ".$1" heurt niet bie t MIME-type van t bestaand ($2).', 'filetype-badmime' => 'Bestaanden mit t MIME-type "$1" ma\'j hier niet opsturen.', 'filetype-bad-ie-mime' => 'Dit bestaand kan niet op-estuurd wörden umdat Internet Explorer t zol herkennen as "$1", n niet toe-estaone bestaandstype die schao an kan richten.', 'filetype-unwanted-type' => "'''\".\$1\"''' is n ongewunst bestaandstype. An-ewezen {{PLURAL:\$3|bestaandstype is|bestaandstypes bin}} \$2.", 'filetype-banned-type' => "{{PLURAL:\$4|t Bestaandstype '''\".\$1\"''' wordt|De bestandstypes '''\".\$1\"''' worden}} niet toegelaten. {{PLURAL:\$3|t Toe-estaone bestaandstype is|De toe-estaone bestaandstypen bin}} \$2.", 'filetype-missing' => 'Dit bestaand hef gien extensie (bv. ".jpg").', 'empty-file' => "t Bestaand da'j op-egeven hebben was leeg.", 'file-too-large' => "t Bestaand da'j op-egeven hebben was te groot.", 'filename-tooshort' => "t Bestaand da'j op-egeven hebben was te klein.", 'filetype-banned' => 'Dit bestaandstype is niet toe-estaon.', 'verification-error' => 'Dit bestaand is t bestaandsonderzeuk niet deurekeumen.', 'hookaborted' => "De wieziging die'j proberen deur te voeren bin aofebreuken deur n extra uutbreiding.", 'illegal-filename' => 'Disse bestaandsnaam is niet toe-estaon.', 'overwrite' => 't Overschrieven van n bestaand is niet toe-estaon.', 'unknown-error' => 'Der is n onbekende fout op-etrejen.', 'tmp-create-error' => 'Kon gien tiedelik bestaand anmaken.', 'tmp-write-error' => 'Der is n fout op-etrejen bie t anmaken van n tiedelik bestaand.', 'large-file' => 'Bestaanden mutten niet groter ween as $1, dit bestaand is $2.', 'largefileserver' => 't Bestaand is groter as dat de server toesteet.', 'emptyfile' => "t Bestaand da'j op-estuurd hebben is leeg. Dit kan koemen deur n tikfout in de bestaandsnaam. Kiek effen nao o'j dit bestaand wel bedoelden.", 'windows-nonascii-filename' => 'Disse wiki ondersteunt gien bestaandsnamen mit spesiale tekens.', 'fileexists' => "n Bestaand mit disse naam besteet al; voeg t bestaand onder n aandere naam toe. '''<tt>[[:$1]]</tt>''' [[$1|thumb]]", 'filepageexists' => "De beschrievingspagina veur dit bestaand bestung al op '''<tt>[[:$1]]</tt>''', mer der besteet nog gien bestaand mit disse naam. De samenvatting die'j op-egeven hebben zal niet op de beschrievingspagina koemen. Bewark de pagina haandmaotig um joew beschrieving daor weer te geven. [[$1|thumb]]", 'fileexists-extension' => "n Bestaand mit n soortgelieke naam besteet al: [[$2|thumb]] * Naam van t bestaand da'j derbie zetten wollen: '''<tt>[[:$1]]</tt>''' * Naam van t bestaonde bestaand: '''<tt>[[:$2]]</tt>''' Kies n aandere naam.", 'fileexists-thumbnail-yes' => "Dit bestaand is n aofbeelding waorvan de grootte verkleind is ''(miniatuuraofbeelding)''. [[$1|thumb]] Kiek t bestaand nao <strong><tt>[[:$1]]</tt></strong>. As de aofbeelding die'j krek nao-ekeken hebben de zelfde grootte hef, dan is t niet neudig um t opniej toe te voegen.", 'file-thumbnail-no' => "De bestaandsnaam begint mit '''<tt>$1</tt>'''. Dit is warschienlik n verkleinde aofbeelding ''(overzichsaofbeelding)''. A'j disse aofbeelding in volle grootte hebben voeg t dan toe, wiezig aanders de bestaandsnaam.", 'fileexists-forbidden' => 'n Bestaand mit disse naam besteet al, en kan niet overschreven wörden. Voeg t bestaand toe onder n aandere naam. [[File:$1|thumb|center|$1]]', 'fileexists-shared-forbidden' => "Der besteet al n bestaand mit disse naam in de gezamenlike bestaandslokasie. A'j t bestaand evengoed op willen sturen, gao dan weerumme en kies n aandere naam. [[File:$1|thumb|center|$1]]", 'file-exists-duplicate' => 'Dit bestaand is liek alleens as {{PLURAL:$1|t volgende bestaand|de volgende bestaanden}}:', 'file-deleted-duplicate' => "n Bestaand dat liek alleens is an dit bestaand ([[:$1]]) is eerder al vortedaon. Bekiek t vortdologboek veurda'j veurdan gaon.", 'uploadwarning' => 'Waorschuwing', 'uploadwarning-text' => 'Pas de bestaandsbeschrieving hieronder an en probeer t opniej', 'savefile' => 'Bestaand opslaon', 'uploadedimage' => 'Op-estuurd: [[$1]]', 'overwroteimage' => 'Nieje versie van "[[$1]]" op-estuurd', 'uploaddisabled' => 't Opsturen van bestaanden is uuteschakeld.', 'copyuploaddisabled' => 't Opsturen van bestaanden via n webadres is uuteschakeld.', 'uploadfromurl-queued' => 'Joew bestaand is in de wachtrie ezet.', 'uploaddisabledtext' => 't Opsturen van bestaanden is uuteschakeld.', 'php-uploaddisabledtext' => 't Opsturen van PHP-bestaanden is uuteschakeld. Kiek de instellingen veur t opsturen van bestaanden effen nao.', 'uploadscripted' => 'In dit bestaand steet HTML- of skriptkode die verkeerd elezen kan wörden deur de webkieker.', 'uploadvirus' => 'In dit bestaand zit n virus! Gegevens: $1', 'uploadjava' => 't Bestaand is n ZIP-bestaand waor n Java .class-bestaand in zit. t Inlaojen van Java-bestaanden is niet toe-estaon umdat hiermee beveiligingsinstellingen ummezeild kunnen wörden.', 'upload-source' => 'Bronbestaand', 'sourcefilename' => 'Bestaandsnaam op de hardeschieve:', 'sourceurl' => 'Bronwebadres:', 'destfilename' => 'Opslaon as (optioneel)', 'upload-maxfilesize' => 'Maximale bestaandsgrootte: $1', 'upload-description' => 'Bestaandsbeschrieving', 'upload-options' => 'Instellingen veur t opsturen van bestaanden', 'watchthisupload' => 'Volg dit bestaand', 'filewasdeleted' => "n Bestaand mit disse naam is al eerder vortedaon. Kiek t $1 nao veurda'j t opniej opsturen.", 'filename-bad-prefix' => "De naam van t bestaand da'j opsturen, begint mit '''\"\$1\"''', dit is n niet-beschrievende naam die meestentieds automaties deur n digitale kamera egeven wörden. Kies n dudelike naam veur t bestaand.", 'upload-success-subj' => 't Bestaand is op-estuurd', 'upload-success-msg' => 't Bestaand [$2] steet derop. Je kunnen t hier vienen: [[:{{ns:file}}:$1]]', 'upload-failure-subj' => 'Probleem bie t inlaojen van t bestaand', 'upload-failure-msg' => 'Der was n probleem bie t inlaojen van [$2]: $1', 'upload-warning-subj' => 'Waorschuwing veur t opsturen van bestaanden', 'upload-warning-msg' => 'Der was n probleem mit t inlaojen van t bestaand [$2]. Gao weerumme naor t [[Special:Upload/stash/$1|bestaandinlaodformulier]] um dit probleem te verhelpen.', 'upload-proto-error' => 'Verkeerd protokol', 'upload-proto-error-text' => 'Um op disse maniere bestaanden toe te voegen mutten webadressen beginnen mit <code>http://</code> of <code>ftp://</code>.', 'upload-file-error' => 'Interne fout', 'upload-file-error-text' => 'Bie ons gung der effen wat fout to n tiedelik bestaand op de server an-emaakt wörden. Neem kontakt op mit n [[Special:ListUsers/sysop|systeembeheerder]].', 'upload-misc-error' => 'Onbekende fout bie t inlaojen van joew bestaand', 'upload-misc-error-text' => 'Der is bie t inlaojen van t bestaand n onbekende fout op-etrejen. Kiek effen nao of de verwiezing t wel döt en probeer t opniej. As t probleem zo blif, neem dan kontakt op mit één van de [[Special:ListUsers/sysop|systeembeheerders]].', 'upload-too-many-redirects' => 'Der zatten te veule deurverwiezingen in de URL.', 'upload-unknown-size' => 'Onbekende grootte', 'upload-http-error' => 'Der is n HTTP-fout op-etrejen: $1', # ZipDirectoryReader 'zip-file-open-error' => 'Der is wat fout egaon bie t los doon van t bestaand veur de ZIP-kontrole.', 'zip-wrong-format' => 't Op-egeven bestaand was gien ZIP-bestaand.', 'zip-bad' => 't Bestaand is beschaodig of is n onleesbaor ZIP-bestaand. De veiligheid kan niet ekontroleerd wörden.', 'zip-unsupported' => 't Bestaand is n ZIP-bestaand dat gebruukmaak van ZIP-meugelikheen die MediaWiki niet ondersteunt. De veiligheid kan niet ekontroleerd wörden.', # Special:UploadStash 'uploadstash' => 'Verbörgen bestaanden', 'uploadstash-summary' => 'Disse pagina geef toegang tot bestaanden die op-estuurd bin of nog op-estuurd wörden mer nog niet beschikbaor emaakt bin op de wiki. Disse bestaanden bin allinnig zichtbaor veur de gebruker die ze opstuurt.', 'uploadstash-clear' => 'Verbörgen bestaanden vortdoon', 'uploadstash-nofiles' => 'Der bin gien verbörgen bestaanden.', 'uploadstash-badtoken' => 't Uutvoeren van de haandeling is mislokt. Dit kump warschienlik deurdat joew bewarkingsreferensies verleupen bin. Probeer t opniej.', 'uploadstash-errclear' => 't Vortdoon van de bestaanden is mislokt.', 'uploadstash-refresh' => 'Lieste mit bestaanden biewarken', # img_auth script messages 'img-auth-accessdenied' => 'Toegang eweigerd', 'img-auth-nopathinfo' => 'PATH_INFO ontbrik. Joew server is niet in-esteld um disse informasie deur te geven. Misschien gebruukt t CGI, en dan wörden img_auth niet ondersteund. Zie https://www.mediawiki.org/wiki/Manual:Image_Authorization rechten veur aofbeeldingen veur meer informasie.', 'img-auth-notindir' => 't Op-evreugen pad is niet de in-estelde bestaandinlaodmap', 'img-auth-badtitle' => 'Kon gien geldige paginanaam maken van "$1".', 'img-auth-nologinnWL' => 'Je bin niet an-emeld en "$1" steet niet op de witte lieste.', 'img-auth-nofile' => 'Bestaand "$1" besteet niet.', 'img-auth-isdir' => 'Je proberen de map "$1" binnen te koemen. Allinnig toegang tot bestaanden is toe-estaon.', 'img-auth-streaming' => 'Bezig mit t streumen van "$1".', 'img-auth-public' => 't Doel van img_auth.php is de uutvoer van bestaanden van n besleuten wiki. Disse wiki is in-esteld as publieke wiki. Um beveiligingsredens is img_auth.php uuteschakeld.', 'img-auth-noread' => 'De gebruker hef gien leestoegang tot "$1".', 'img-auth-bad-query-string' => 'In t webadres steet n ongeldige zeukopdrachte.', # HTTP errors 'http-invalid-url' => 'Ongeldig webadres: $1', 'http-invalid-scheme' => 'Webadressen mit de opmaak "$1" wörden niet ondersteund.', 'http-request-error' => 'Fout bie t verzenden van t verzeuk.', 'http-read-error' => 'Fout bie t lezen van HTTP', 'http-timed-out' => 'Wachttied bie t HTTP verzeuk', 'http-curl-error' => 'Fout bie t ophaolen van t webadres: $1', 'http-host-unreachable' => 'Kon webadres niet bereiken.', 'http-bad-status' => 'Der is n probleem mit t HTTP-verzeuk: $1 $2', # Some likely curl errors. More could be added from <http://curl.haxx.se/libcurl/c/libcurl-errors.html> 'upload-curl-error6' => 'Kon webadres niet bereiken', 'upload-curl-error6-text' => "t Webadres kon niet bereikt wörden. Kiek effen nao o'j t goeie adres in-evoerd hebben en of de webstee bereikbaor is.", 'upload-curl-error28' => 'Wachttied veur t versturen van t bestaand', 'upload-curl-error28-text' => 't Duren te lange veurdat de webstee reageren. Kiek effen nao of de webstee bereikbaor is, wacht effen en probeer t daornao weer. Probeer t aanders as t wat rustiger is.', 'license' => 'Lisensie', 'license-header' => 'Lisensie', 'nolicense' => 'Gien lisensie ekeuzen', 'license-nopreview' => '(Naokieken is niet meugelik)', 'upload_source_url' => ' (een geldig, publiek toegankelik webadres)', 'upload_source_file' => ' (een bestaand op de hardeschieve)', # Special:ListFiles 'listfiles-summary' => "Op disse spesiale pagina ku'j alle bestaanden bekieken die lestens op-estuurd bin. As disse pagina efilterd wörden op gebruker, zie'j allinnig bestaanden waor de gebruker de leste versie van hef op-estuurd.", 'listfiles_search_for' => 'Zeuk naor bestaand:', 'imgfile' => 'bestaand', 'listfiles' => 'Bestaandslieste', 'listfiles_thumb' => 'Miniatuuraofbeelding', 'listfiles_date' => 'Daotum', 'listfiles_name' => 'Naam', 'listfiles_user' => 'Gebruker', 'listfiles_size' => 'Grootte (bytes)', 'listfiles_description' => 'Beschrieving', 'listfiles_count' => 'Versies', # File description page 'file-anchor-link' => 'Bestaand', 'filehist' => 'Bestaandsgeschiedenisse', 'filehist-help' => 'Klik op n daotum/tied um t bestaand te zien zo as t to was.', 'filehist-deleteall' => 'alles vortdoon', 'filehist-deleteone' => 'disse vortdoon', 'filehist-revert' => 'weerummedreien', 'filehist-current' => 'zo as t noen is', 'filehist-datetime' => 'Daotum/tied', 'filehist-thumb' => 'Miniatuuraofbeelding', 'filehist-thumbtext' => 'Miniatuuraofbeelding veur versie van $1', 'filehist-nothumb' => 'Gien miniatuuraofbeelding', 'filehist-user' => 'Gebruker', 'filehist-dimensions' => 'Grootte', 'filehist-filesize' => 'Bestaandsgrootte', 'filehist-comment' => 'Opmarkingen', 'filehist-missing' => 'Bestaand ontbreekt', 'imagelinks' => 'Bestaandsgebruuk', 'linkstoimage' => "Dit bestaand wörden gebruukt op de volgende {{PLURAL:$1|pagina|$1 pagina's}}:", 'linkstoimage-more' => 'Der {{PLURAL:$2|is|bin}} meer as $1 {{PLURAL:$1|verwiezing|verwiezingen}} naor dit bestaand. De volgende lieste geef allinnig de eerste {{PLURAL:$1|verwiezing|$1 verwiezingen}} naor dit bestaand weer. De [[Special:WhatLinksHere/$2|hele lieste]] is oek beschikbaor.', 'nolinkstoimage' => 'Bestaand is niet in gebruuk.', 'morelinkstoimage' => '[[Special:WhatLinksHere/$1|Meer verwiezingen]] naor dit bestaand bekieken.', 'linkstoimage-redirect' => '$1 (bestaandsdeurverwiezing) $2', 'duplicatesoffile' => '{{PLURAL:$1|t Volgende bestaand is|De volgende $1 bestaanden bin}} liek alleens as dit bestaand ([[Special:FileDuplicateSearch/$2|meer informasie]]):', 'sharedupload' => "Dit is n edeeld bestaand op $1 en ku'j oek gebruken veur aandere projekten.", 'sharedupload-desc-there' => "Dit is n edeeld bestaand op $1 en ku'j oek gebruken veur aandere projekten. Bekiek de [$2 beschrieving van t bestaand] veur meer informasie.", 'sharedupload-desc-here' => "Dit is n edeeld bestaand op $1 en ku'j oek gebruken veur aandere projekten. De [$2 beschrieving van t bestaand] dergindse, steet hieronder.", 'filepage-nofile' => 'Der besteet gien bestaand mit disse naam.', 'filepage-nofile-link' => 'Der besteet gien bestaand mit disse naam, mer je kunnen t [$1 opsturen].', 'uploadnewversion-linktext' => 'n Niejere versie van dit bestaand opsturen.', 'shared-repo-from' => 'uut $1', 'shared-repo' => 'n edeelden mediadatabanke', # File reversion 'filerevert' => '$1 weerummedreien', 'filerevert-legend' => 'Bestaand weerummezetten', 'filerevert-intro' => "Je bin '''[[Media:$1|$1]]''' an t weerummedreien tot de [$4 versie van $2, $3]", 'filerevert-comment' => 'Reden:', 'filerevert-defaultcomment' => 'Weerummedreid tot de versie van $1, $2', 'filerevert-submit' => 'Weerummedreien', 'filerevert-success' => '<span class="plainlinks">\'\'\'[[Media:$1|$1]]\'\'\' is weerummedreid naor de [$4 versie op $2, $3]</span>.', 'filerevert-badversion' => 'Der is gien veurige lokale versie van dit bestaand mit de op-egeven tied.', # File deletion 'filedelete' => '$1 vortdoon', 'filedelete-legend' => 'Bestaand vortdoon', 'filedelete-intro' => "Je doon t bestaand '''[[Media:$1|$1]]''' noen vort samen mit de geschiedenisse dervan.", 'filedelete-intro-old' => "Je bin de versie van '''[[Media:$1|$1]]''' van [$4 $3, $2] vort an t doon.", 'filedelete-comment' => 'Reden:', 'filedelete-submit' => 'Vortdoon', 'filedelete-success' => "'''$1''' is vortedaon.", 'filedelete-success-old' => "De versie van '''[[Media:$1|$1]]''' van $3, $2 is vortedaon.", 'filedelete-nofile' => "'''$1''' besteet niet.", 'filedelete-nofile-old' => "Der is gien versie van '''$1''' in t archief mit de an-egeven eigenschappen.", 'filedelete-otherreason' => 'Aandere reden:', 'filedelete-reason-otherlist' => 'Aandere reden', 'filedelete-reason-dropdown' => "*Veulveurkoemende redens veur t vortdoon van pagina's ** Auteursrechtenschending ** Dit bestaand he'w dubbel", 'filedelete-edit-reasonlist' => 'Reden veur t vortdoon bewarken', 'filedelete-maintenance' => 't Vortdoon en weerummeplaotsen kan noen effen niet umda-w bezig bin mit onderhoud.', # MIME search 'mimesearch' => 'Zeuken op MIME-type', 'mimesearch-summary' => 'Op disse spesiale pagina kunnen de bestaanden naor t MIME-type efiltreerd wörden. In de invoer mut altied t media- en subtype staon, bieveurbeeld: <tt>aofbeelding/jpeg</tt>.', 'mimetype' => 'MIME-type:', 'download' => 'binnenhaolen', # Unwatched pages 'unwatchedpages' => "Pagina's die niet evolgd wörden", # List redirects 'listredirects' => 'Lieste van deurverwiezingen', # Unused templates 'unusedtemplates' => 'Ongebruukten mallen', 'unusedtemplatestext' => 'Hieronder staon alle pagina\'s in de naamruumte "{{ns:template}}" die nargens gebruukt wörden. Vergeet niet de verwiezingen nao te kieken veurda\'j de mal vortdoon.', 'unusedtemplateswlh' => 'aandere verwiezingen', # Random page 'randompage' => 'Zo mer n artikel', 'randompage-nopages' => "Der staon gien pagina's in de {{PLURAL:$2|naamruumte|naamruumtes}}: $1.", # Random redirect 'randomredirect' => 'Zo mer n deurverwiezing', 'randomredirect-nopages' => 'Der staon gien deurverwiezingen in de naamruumte "$1".', # Statistics 'statistics' => 'Staotistieken', 'statistics-header-pages' => 'Paginastaotistieken', 'statistics-header-edits' => 'Bewarkingsstaotistieken', 'statistics-header-views' => 'Staotistieken bekieken', 'statistics-header-users' => 'Gebrukerstaotistieken', 'statistics-header-hooks' => 'Overige staotistieken', 'statistics-articles' => "Inhouwelike pagina's", 'statistics-pages' => "Pagina's", 'statistics-pages-desc' => "Alle pagina's in de wiki, oek overlegpagina's, deurverwiezingen, en gao zo mer deur.", 'statistics-files' => 'Bestaanden', 'statistics-edits' => 'Paginabewarkingen vanaof t begin van {{SITENAME}}', 'statistics-edits-average' => 'Gemiddeld antal bewarkingen per pagina', 'statistics-views-total' => "Totaal antal weeregeven pagina's", 'statistics-views-total-desc' => "t Bekieken van niet-bestaonde pagina's en spesiale pagina's zitten der niet bie in", 'statistics-views-peredit' => "Weeregeven pagina's per bewarking", 'statistics-users' => 'In-eschreven [[Special:ListUsers|gebrukers]]', 'statistics-users-active' => 'Aktieve gebrukers', 'statistics-users-active-desc' => 'Gebrukers die de veurbieje {{PLURAL:$1|dag|$1 dagen}} n haandeling uutevoerd hebben', 'statistics-mostpopular' => "Meestbekeken pagina's", 'disambiguations' => "Pagina's die verwiezen naor deurverwiespagina's", 'disambiguationspage' => 'Template:Dv', 'disambiguations-text' => "De onderstaonde pagina's verwiezen naor n '''deurverwiespagina'''. Disse verwiezingen mutten eigenliks rechtstreeks verwiezen naor t juuste onderwarp. Pagina's wörden ezien as n deurverwiespagina, as de mal gebruukt wörden die vermeld steet op [[MediaWiki:Disambiguationspage]]", 'doubleredirects' => 'Dubbele deurverwiezingen', 'doubleredirectstext' => "Op disse lieste staon alle pagina's die deurverwiezen naor aandere deurverwiezingen. Op elke regel steet de eerste en de tweede deurverwiezing, daorachter steet de doelpagina van de tweede deurverwiezing. Meestentieds is leste pagina de gewunste doelpagina, waor oek de eerste pagina heer zol mutten liejen.", 'double-redirect-fixed-move' => '[[$1]] is herneumd en is noen n deurverwiezing naor [[$2]]', 'double-redirect-fixed-maintenance' => 'Verbeteren van dubbele deurverwiezing van [[$1]] naor [[$2]].', 'double-redirect-fixer' => 'Deurverwiezingsverbeteraar', 'brokenredirects' => 'Ebreuken deurverwiezingen', 'brokenredirectstext' => 'Disse deurverwiezingen verwiezen naor n niet-bestaonde pagina.', 'brokenredirects-edit' => 'bewark', 'brokenredirects-delete' => 'vortdoon', 'withoutinterwiki' => "Pagina's zonder verwiezingen naor aandere talen", 'withoutinterwiki-summary' => "De volgende pagina's verwiezen niet naor versies in n aandere taal.", 'withoutinterwiki-legend' => 'Veurvoegsel', 'withoutinterwiki-submit' => 'Bekieken', 'fewestrevisions' => 'Artikels mit de minste bewarkingen', # Miscellaneous special pages 'nbytes' => '$1 {{PLURAL:$1|byte|bytes}}', 'ncategories' => '$1 {{PLURAL:$1|kategorie|kategorieën}}', 'nlinks' => '$1 {{PLURAL:$1|verwiezing|verwiezingen}}', 'nmembers' => '$1 {{PLURAL:$1|onderwarp|onderwarpen}}', 'nrevisions' => '$1 {{PLURAL:$1|versie|versies}}', 'nviews' => '{{PLURAL:$1|1 keer|$1 keer}} bekeken', 'nimagelinks' => "Wörden op {{PLURAL:$1|één pagina|$1 pagina's}} gebruukt", 'ntransclusions' => "wörden op {{PLURAL:$1|één pagina|$1 pagina's}} gebruukt", 'specialpage-empty' => 'Disse pagina is leeg.', 'lonelypages' => "Weespagina's", 'lonelypagestext' => "Naor disse pagina's wörden niet verwezen vanuut {{SITENAME}} en ze bin oek nargens in-evoegd.", 'uncategorizedpages' => "Pagina's zonder kategorie", 'uncategorizedcategories' => 'Kategorieën zonder kategorie', 'uncategorizedimages' => 'Bestaanden zonder kategorie', 'uncategorizedtemplates' => 'Mallen zonder kategorie', 'unusedcategories' => 'Ongebruukten kategorieën', 'unusedimages' => 'Ongebruukten bestaanden', 'popularpages' => 'Populaire artikels', 'wantedcategories' => 'Gewunste kategorieën', 'wantedpages' => "Gewunste pagina's", 'wantedpages-badtitle' => 'Ongeldige paginanaam in resultaot: $1', 'wantedfiles' => 'Gewunste bestaanden', 'wantedtemplates' => 'Gewunste mallen', 'mostlinked' => "Pagina's waor t meest naor verwezen wörden", 'mostlinkedcategories' => 'Meestgebruukten kategorieën', 'mostlinkedtemplates' => 'Meestgebruukten mallen', 'mostcategories' => 'Artikels mit de meeste kategorieën', 'mostimages' => 'Meestgebruukten bestaanden', 'mostrevisions' => 'Artikels mit de meeste bewarkingen', 'prefixindex' => "Alle pagina's op veurvoegsel", 'shortpages' => 'Korte artikels', 'longpages' => 'Lange artikels', 'deadendpages' => "Pagina's zonder verwiezingen", 'deadendpagestext' => "De onderstaonde pagina's verwiezen niet naor aandere pagina's in disse wiki.", 'protectedpages' => "Pagina's die beveiligd bin", 'protectedpages-indef' => 'Allinnig blokkeringen zonder verloopdaotum', 'protectedpages-cascade' => 'Allinnig beveiligingen mit de kaskadeopsie', 'protectedpagestext' => "De volgende pagina's bin beveiligd en kunnen niet herneumd of bewarkt wörden.", 'protectedpagesempty' => "Der bin op t moment gien beveiligden pagina's", 'protectedtitles' => 'Paginanamen die beveiligd bin', 'protectedtitlestext' => "De volgende pagina's bin beveiligd, zodat ze niet opniej an-emaakt kunnen wörden", 'protectedtitlesempty' => 'Der bin noen gien titels beveiligd die an disse veurweerden voldoon.', 'listusers' => 'Gebrukerslieste', 'listusers-editsonly' => 'Allinnig gebrukers mit bewarkingen laoten zien', 'listusers-creationsort' => 'Sorteren op inschriefdaotum', 'usereditcount' => '$1 {{PLURAL:$1|bewarking|bewarkingen}}', 'usercreated' => 'An-emaakt op $1 um $2', 'newpages' => 'Nieje artikels', 'newpages-username' => 'Gebrukersnaam:', 'ancientpages' => 'Oudste artikels', 'move' => 'Herneumen', 'movethispage' => 'Herneum', 'unusedimagestext' => "Vergeet niet dat aandere wiki's misschien oek n antal van disse bestaanden gebruken. De volgende bestaanden bin op-estuurd mer niet in gebruuk. t Kan ween dat der drekt verwezen wörden naor n bestaand. n Bestaand kan hier dus verkeerd op-eneumen ween.", 'unusedcategoriestext' => 'De onderstaonde kategorieën bin an-emaakt mer bin niet in gebruuk.', 'notargettitle' => 'Gien pagina op-egeven', 'notargettext' => 'Je hebben niet op-egeven veur welke pagina je disse funksie bekieken willen.', 'nopagetitle' => 'Doelpagina besteet niet', 'nopagetext' => "De pagina die'j herneumen willen besteet niet.", 'pager-newer-n' => '{{PLURAL:$1|1 niejere|$1 niejere}}', 'pager-older-n' => '{{PLURAL:$1|1 ouwere|$1 ouwere}}', 'suppress' => 'Toezichte', 'querypage-disabled' => 'Disse spesiale pagina is uuteschakeld um prestasieredens.', # Book sources 'booksources' => 'Boekinformasie', 'booksources-search-legend' => 'Zeuk informasie over n boek', 'booksources-go' => 'Zeuk', 'booksources-text' => "Hieronder steet n lieste mit verwiezingen naor aandere websteeën die nieje of wat ouwere boeken verkopen, en daor hebben ze warschienlik meer informasie over t boek da'j zeuken:", 'booksources-invalid-isbn' => "De op-egeven ISBN klop niet; kiek effen nao o'j gien fout emaakt hebben bie de invoer.", # Special:Log 'specialloguserlabel' => 'Uutvoerende gebruker:', 'speciallogtitlelabel' => 'Doel (paginanaam of gebruker):', 'log' => 'Logboeken', 'all-logs-page' => 'Alle publieke logboeken', 'alllogstext' => 'Dit is t kombinasielogboek van {{SITENAME}}. Je kunnen oek kiezen veur bepaolde logboeken en filteren op gebruker (heufdlettergeveulig) en titel (heufdlettergeveulig).', 'logempty' => 'Der steet gien passende informasie in t logboek.', 'log-title-wildcard' => 'Zeuk naor titels die beginnen mit disse tekste:', # Special:AllPages 'allpages' => "Alle pagina's", 'alphaindexline' => '$1 tot $2', 'nextpage' => 'Volgende pagina ($1)', 'prevpage' => 'Veurige pagina ($1)', 'allpagesfrom' => "Laot pagina's zien vanaof:", 'allpagesto' => "Laot pagina's zien tot:", 'allarticles' => 'Alle artikels', 'allinnamespace' => "Alle pagina's (naamruumte $1)", 'allnotinnamespace' => "Alle pagina's (niet in naamruumte $1)", 'allpagesprev' => 'veurige', 'allpagesnext' => 'volgende', 'allpagessubmit' => 'Zeuk', 'allpagesprefix' => "Pagina's bekieken die beginnen mit:", 'allpagesbadtitle' => 'De op-egeven paginanaam is ongeldig of der steet n interwikiveurvoegsel in. Meugelikerwieze staon der karakters in de naam die niet gebruukt maggen wörden in paginanamen.', 'allpages-bad-ns' => '{{SITENAME}} hef gien "$1"-naamruumte.', # Special:Categories 'categories' => 'Kategorieën', 'categoriespagetext' => "De de volgende {{PLURAL:$1|kategorie steet|kategorieën staon}} pagina's of mediabestaanden. [[Special:UnusedCategories|ongebruukten kategorieën]] zie'j hier niet. Zie oek [[Special:WantedCategories|gewunste kategorieën]].", 'categoriesfrom' => 'Laot kategorieën zien vanaof:', 'special-categories-sort-count' => 'op antal sorteren', 'special-categories-sort-abc' => 'alfebeties sorteren', # Special:DeletedContributions 'deletedcontributions' => 'Vortedaone gebrukersbiedragen', 'deletedcontributions-title' => 'Vortedaone gebrukersbiedragen', 'sp-deletedcontributions-contribs' => 'biedragen', # Special:LinkSearch 'linksearch' => 'Uutgaonde verwiezingen zeuken', 'linksearch-pat' => 'Zeukpetroon:', 'linksearch-ns' => 'Naamruumte:', 'linksearch-ok' => 'Zeuken', 'linksearch-text' => 'Jokers zo as "*.wikipedia.org" of "*.org" bin toe-estaon. Hef tenminsten n topdomein, zo as "*.org".<br /> Ondersteunde protokollen: <tt>$1</tt> (zet t niet in joew zeukopdrachte).', 'linksearch-line' => '$1 hef n verwiezing in $2', 'linksearch-error' => 'Jokers bin allinnig toe-estaon an t begin van n webadres.', # Special:ListUsers 'listusersfrom' => 'Laot gebrukers zien vanaof:', 'listusers-submit' => 'Bekiek', 'listusers-noresult' => 'Gien gebrukers evunnen. Zeuk oek naor variaanten mit kleine letters of heufdletters.', 'listusers-blocked' => '(eblokkeerd)', # Special:ActiveUsers 'activeusers' => 'Aktieve gebrukers', 'activeusers-intro' => 'Dit is n lieste van gebrukers die de aofeleupen $1 {{PLURAL:$1|dag|dagen}} enigszins aktief ewes bin.', 'activeusers-count' => '$1 leste {{PLURAL:$1|bewarking|bewarkingen}} in de aofeleupen {{PLURAL:$3|dag|$3 dagen}}', 'activeusers-from' => 'Laot gebrukers zien vanaof:', 'activeusers-hidebots' => 'Bots verbargen', 'activeusers-hidesysops' => 'Beheerders verbargen', 'activeusers-noresult' => 'Gien aktieve gebrukers evunnen.', # Special:Log/newusers 'newuserlogpage' => 'Logboek mit anwas', 'newuserlogpagetext' => 'Hieronder staon de niej in-eschreven gebrukers', 'newuserlog-byemail' => 'wachtwoord is verstuurd via de netpost', 'newuserlog-create-entry' => 'Nieje gebruker', 'newuserlog-create2-entry' => 'hef nieje gebruker $1 eregistreerd', 'newuserlog-autocreate-entry' => 'Gebruker automaties an-emaakt', # Special:ListGroupRights 'listgrouprights' => 'Rechten van gebrukersgroepen', 'listgrouprights-summary' => "Op disse pagina staon de gebrukersgroepen van disse wiki beschreven, mit de biebeheurende rechten. Meer informasie over de rechten ku'j [[{{MediaWiki:Listgrouprights-helppage}}|hier vienen]].", 'listgrouprights-key' => '* <span class="listgrouprights-granted">Rech toe-ewezen</span> * <span class="listgrouprights-revoked">Rech in-etrökken</span>', 'listgrouprights-group' => 'Groep', 'listgrouprights-rights' => 'Rechten', 'listgrouprights-helppage' => 'Help:Gebrukersrechten', 'listgrouprights-members' => '(lejenlieste)', 'listgrouprights-addgroup' => 'Kan gebrukers bie disse {{PLURAL:$2|groep|groepen}} zetten: $1', 'listgrouprights-removegroup' => 'Kan gebrukers uut disse {{PLURAL:$2|groep|groepen}} haolen: $1', 'listgrouprights-addgroup-all' => 'Kan gebrukers bie alle groepen zetten', 'listgrouprights-removegroup-all' => 'Kan gebrukers uut alle groepen haolen', 'listgrouprights-addgroup-self' => 'Kan {{PLURAL:$2|groep|groepen}} bie de eigen gebruker doon: $1', 'listgrouprights-removegroup-self' => 'Kan {{PLURAL:$2|groep|groepen}} vortdoon van eigen gebruker: $1', 'listgrouprights-addgroup-self-all' => 'Kan alle groepen bie de eigen gebruker doon', 'listgrouprights-removegroup-self-all' => 'Kan alle groepen vortdoon van eigen gebruker', # E-mail user 'mailnologin' => 'Niet an-emeld.', 'mailnologintext' => 'Je mutten [[Special:UserLogin|an-emeld]] ween en n geldig e-mailadres in "[[Special:Preferences|mien veurkeuren]]" invoeren um disse funksie te kunnen gebruken.', 'emailuser' => 'n Bericht sturen', 'emailpage' => 'Gebruker n bericht sturen', 'emailpagetext' => "Deur middel van dit formulier ku'j n bericht sturen naor disse gebruker. t Adres da'j op-egeven hebben bie [[Special:Preferences|joew veurkeuren]] zal as aofzender gebruukt wörden. De ontvanger kan dus drek beantwoorden.", 'usermailererror' => 'Foutmelding bie t versturen:', 'defemailsubject' => 'Bericht van {{SITENAME}}', 'usermaildisabled' => 'n Persoonlik berichjen sturen geet niet.', 'usermaildisabledtext' => 'Je kunnen gien berichjes sturen naor aandere gebrukers van disse wiki', 'noemailtitle' => 'Gebruker hef gien netpostadres op-egeven', 'noemailtext' => 'Disse gebruker hef gien geldig e-mailadres in-evoerd.', 'nowikiemailtitle' => 'Netpost is niet toe-estaon', 'nowikiemailtext' => 'Disse gebruker wil gien netpost toe-estuurd kriegen van aandere gebrukers.', 'emailnotarget' => 'Niet-bestaonde of ongeldige ontvanger.', 'emailtarget' => 'Voer de gebrukersnaam of ontvanger in', 'emailusername' => 'Gebrukersnaam:', 'emailusernamesubmit' => 'Opslaon', 'email-legend' => 'n Bericht sturen naor n aandere gebruker van {{SITENAME}}', 'emailfrom' => 'Van:', 'emailto' => 'An:', 'emailsubject' => 'Onderwarp:', 'emailmessage' => 'Bericht:', 'emailsend' => 'Versturen', 'emailccme' => 'Stuur mien n kopie van dit bericht.', 'emailccsubject' => 'Kopie van joew bericht an $1: $2', 'emailsent' => 'Bericht verstuurd', 'emailsenttext' => 'Bericht is verstuurd.', 'emailuserfooter' => 'Dit bericht is verstuurd deur $1 an $2 deur de funksie "n Bericht sturen" van {{SITENAME}} te gebruken.', # User Messenger 'usermessage-summary' => 'Systeemteksten achter-eleuten', 'usermessage-editor' => 'Systeemtekste', # Watchlist 'watchlist' => 'Volglieste', 'mywatchlist' => 'Mien volglieste', 'watchlistfor2' => 'Veur $1 ($2)', 'nowatchlist' => 'Gien artikels in volglieste.', 'watchlistanontext' => '$1 is verplicht um joew volglieste te bekieken of te wiezigen.', 'watchnologin' => 'Niet an-emeld', 'watchnologintext' => "Um je volglieste an te passen mö'j eers [[Special:UserLogin|an-emeld]] ween.", 'addwatch' => 'Op mien volglieste zetten', 'addedwatchtext' => "De pagina \"[[:\$1]]\" steet noen op joew [[Special:Watchlist|volglieste]]. Toekomstige wiezigingen op disse pagina en de overlegpagina zullen hier vermeld wörden, oek zullen disse pagina's '''vet-edrokt''' ween in de lieste mit de [[Special:RecentChanges|leste wiezigingen]] zoda'j t makkeliker zien kunnen.", 'removewatch' => 'Van mien volglieste aofhaolen', 'removedwatchtext' => 'De pagina "[[:$1]]" is van [[Special:Watchlist|joew volglieste]] aofehaold.', 'watch' => 'Volgen', 'watchthispage' => 'Volg disse pagina', 'unwatch' => 'Niet volgen', 'unwatchthispage' => 'Niet volgen', 'notanarticle' => 'Gien artikel', 'notvisiblerev' => 'Bewarking is vortedaon', 'watchnochange' => "Gien van de pagina's op joew volglieste is in disse periode ewiezigd", 'watchlist-details' => "Der {{PLURAL:$1|steet één pagina|staon $1 pagina's}} op joew volglieste, zonder de overlegpagina's mee-erekend.", 'wlheader-enotif' => 'Je kriegen bericht per netpost', 'wlheader-showupdated' => "* Pagina's die sinds joew leste bezeuk bie-ewörken bin, staon '''vet-edrokt'''.", 'watchmethod-recent' => "leste wiezigingen an t naokieken op pagina's die'j volgen", 'watchmethod-list' => 'Kik joew nao volglieste veur de leste wiezigingen', 'watchlistcontains' => "Der {{PLURAL:$1|steet 1 pagina|staon $1 pagina's}} op joew volglieste.", 'iteminvalidname' => "Verkeerde naam '$1'", 'wlnote' => 'Hieronder {{PLURAL:$1|steet de leste wieziging|staon de leste $1 wiezigingen}} in {{PLURAL:$2|t aofeleupen ure|de leste $2 uren}}.', 'wlshowlast' => 'Laot de aofeleupen $1 ure $2 dagen $3 zien', 'watchlist-options' => 'Opsies veur de volglieste', # Displayed when you click the "watch" button and it is in the process of watching 'watching' => 'Volg...', 'unwatching' => 'Niet volgen...', 'watcherrortext' => 'Der is n fout op-etrejen tiejens t wiezigen van joew volgliesinstellingen veur "$1".', 'enotif_mailer' => '{{SITENAME}}-berichgevingssysteem', 'enotif_reset' => "Markeer alle pagina's as bezöcht.", 'enotif_newpagetext' => 'Dit is n nieje pagina.', 'enotif_impersonal_salutation' => '{{SITENAME}}-gebruker', 'changed' => 'ewiezigd', 'created' => 'an-emaakt', 'enotif_subject' => '{{SITENAME}}-pagina $PAGETITLE is $CHANGEDORCREATED deur $PAGEEDITOR', 'enotif_lastvisited' => 'Zie $1 veur alle wiezigingen sinds joew leste bezeuk.', 'enotif_lastdiff' => 'Zie $1 um disse wieziging te bekieken.', 'enotif_anon_editor' => 'anonieme gebruker $1', 'enotif_body' => 'Huj $WATCHINGUSERNAME, De pagina $PAGETITLE op {{SITENAME}} is $CHANGEDORCREATED op $PAGEEDITDATE deur $PAGEEDITOR, zie $PAGETITLE_URL veur de leste versie. $NEWPAGE Samenvatting van de wieziging: $PAGESUMMARY $PAGEMINOREDIT Kontaktgevevens van de auteur: Netpost: $PAGEEDITOR_EMAIL Wiki: $PAGEEDITOR_WIKI Je kriegen veerder gien berichten, behalven a\'j disse pagina bezeuken. Op joew volglieste ku\'j veur alle pagina\'s die\'j volgen de waorschuwingsinstellingen deraof haolen. Groeten van t {{SITENAME}}-waorschuwingssysteem. -- Je kunnen joew netpostinstellingen wiezigen op: {{canonicalurl:{{#special:Preferences}}}} Je kunnen de volgliestinstellingen wiezigen op: {{canonicalurl:{{#special:EditWatchlist}}}} Je kunnen de pagina van joew volglieste aofhaolen deur op de volgende verwiezing te klikken: $UNWATCHURL Opmarkingen en veerdere hulpe: {{canonicalurl:{{MediaWiki:Helppage}}}}', # Delete 'deletepage' => 'Vortdoon', 'confirm' => 'Bevestigen', 'excontent' => "De tekste was: '$1'", 'excontentauthor' => "De tekste was: '$1' (pagina an-emaakt deur: [[Special:Contributions/$2|$2]])", 'exbeforeblank' => "veurdat disse pagina leegemaakt wörden stung hier: '$1'", 'exblank' => 'Pagina was leeg', 'delete-confirm' => '"$1" vortdoon', 'delete-legend' => 'Vortdoon', 'historywarning' => "'''Waorschuwing''': de pagina die'j vortdoon, hef $1 {{PLURAL:$1|versie|versies}}:", 'confirmdeletetext' => "Je staon op t punt n pagina en de geschiedenisse dervan vort te doon. Bevestig hieronder dat dit inderdaod de bedoeling is, da'j de gevolgen begriepen en dat t akkedeert mit t [[{{MediaWiki:Policy-url}}|beleid]].", 'actioncomplete' => 'Uutevoerd', 'actionfailed' => 'De haandeling is mislokt.', 'deletedtext' => 't Artikel "$1" is vortedaon. Zie de "$2" veur n lieste van pagina\'s die as lest vortedaon bin.', 'deletedarticle' => '"[[$1]]" vortedaon', 'suppressedarticle' => 'hef "[[$1]]" verbörgen', 'dellogpage' => 'Vortdologboek', 'dellogpagetext' => "Hieronder steet n lieste van pagina's en bestaanden die as lest vortedaon bin.", 'deletionlog' => 'Vortdologboek', 'reverted' => 'Eerdere versie hersteld', 'deletecomment' => 'Reden:', 'deleteotherreason' => 'Aandere/extra reden:', 'deletereasonotherlist' => 'Aandere reden', 'deletereason-dropdown' => "*Redens veur t vortdoon van pagina's ** Op vrage van de auteur ** Schending van de auteursrechten ** Vandelisme", 'delete-edit-reasonlist' => 'Redens veur t vortdoon bewarken', 'delete-toobig' => "Disse pagina hef n lange bewarkingsgeschiedenisse, meer as $1 {{PLURAL:$1|versie|versies}}. t Vortdoon van dit soort pagina's is mit rechten bepark um t per ongelok versteuren van de warking van {{SITENAME}} te veurkoemen.", 'delete-warning-toobig' => 'Disse pagina hef n lange bewarkingsgeschiedenisse, meer as $1 {{PLURAL:$1|versie|versies}}. Woart je: t vortdoon van disse pagina kan de warking van de databanke van {{SITENAME}} versteuren. Wees veurzichtig', # Rollback 'rollback' => 'Wiezigingen herstellen', 'rollback_short' => 'Weerummedreien', 'rollbacklink' => 'Weerummedreien', 'rollbackfailed' => 'Wieziging herstellen is mislokt', 'cantrollback' => 'De wiezigingen konnen niet hersteld wörden; der is mer 1 auteur.', 'alreadyrolled' => 'Kan de leste wieziging van de pagina [[:$1]] deur [[User:$2|$2]] ([[User talk:$2|Overleg]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]); niet weerummedreien. n Aander hef disse pagina al bewarkt of hersteld naor n eerdere versie. De leste bewarking op disse pagina is edaon deur [[User:$3|$3]] ([[User talk:$3|Overleg]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).', 'editcomment' => "De bewarkingssamenvatting was: ''$1''.", 'revertpage' => 'Wiezigingen deur [[Special:Contributions/$2|$2]] hersteld tot de versie nao de leste wieziging deur $1', 'revertpage-nouser' => 'Wiezigingen deur (gebrukersnaam vortedaon) weerummedreid naor de leste versie deur [[User:$1|$1]]', 'rollback-success' => 'Wiezigingen van $1; weerummedreid naor de leste versie van $2.', # Edit tokens 'sessionfailure-title' => 'Sessiefout', 'sessionfailure' => 'Der is n probleem mit joew anmeldsessie. De aksie is stop-ezet uut veurzörg tegen n beveiligingsrisico (dat besteet uut t meugelike "kraken" van disse sessie). Gao weerumme naor de veurige pagina, laoj disse pagina opniej en probeer t nog es.', # Protect 'protectlogpage' => 'Beveiligingslogboek', 'protectlogtext' => "Hieronder staon de leste wiezigingen veur t blokkeren en vriegeven van artikels en pagina's. Zie de [[Special:ProtectedPages|lieste mit pagina's die beveiligd bin]] veur t hele overzichte.", 'protectedarticle' => '[[$1]] is beveiligd', 'modifiedarticleprotection' => 'beveiligingsnivo van "[[$1]]" ewiezigd', 'unprotectedarticle' => 'hef de beveiliging van "[[$1]]" deraof ehaold', 'movedarticleprotection' => 'hef de beveiligingsinstellingen over-ezet van "[[$2]]" naor "[[$1]]"', 'protect-title' => 'Instellen van beveiligingsnivo veur "$1"', 'prot_1movedto2' => '[[$1]] is ewiezigd naor [[$2]]', 'protect-legend' => 'Beveiliging bevestigen', 'protectcomment' => 'Reden:', 'protectexpiry' => 'Duur', 'protect_expiry_invalid' => 'Verlooptied is ongeldig.', 'protect_expiry_old' => 'De verlooptied is al veurbie.', 'protect-unchain-permissions' => 'Overige beveiligingsinstellingen beschikbaor maken', 'protect-text' => "Hier ku'j t beveiligingsnivo veur de pagina '''$1''' instellen.", 'protect-locked-blocked' => "Je kunnen beveiligingsnivo's niet wiezigen terwiel je eblokkeerd bin. Hier bin de instellingen zo as ze noen bin veur de pagina '''$1''':", 'protect-locked-dblock' => "Beveiligingsnivo's kunnen effen niet ewiezigd wörden umdat de databanke noen beveiligd is. Hier staon de instellingen zo as ze noen bin veur de pagina '''$1''':", 'protect-locked-access' => "Je hebben gien rechten um t beveilingsnivo van pagina's te wiezigen. Hier staon de instellingen zo as ze noen bin veur de pagina '''$1''':", 'protect-cascadeon' => "Disse pagina wörden beveiligd, umdat t op-eneumen is in de volgende {{PLURAL:$1|pagina|pagina's}} die beveiligd {{PLURAL:$1|is|bin}} mit de kaskadeopsie. Je kunnen t beveiligingsnivo van disse pagina anpassen, mer dat hef gien invleud op de kaskadebeveiliging.", 'protect-default' => 'Veur alle gebrukers', 'protect-fallback' => 'Hierveur is t rech "$1" neudig', 'protect-level-autoconfirmed' => 'Blokkeer nieje en anonieme gebrukers', 'protect-level-sysop' => 'Allinnig beheerders', 'protect-summary-cascade' => 'kaskade', 'protect-expiring' => 'löp aof op $1 (UTC)', 'protect-expiry-indefinite' => 'onbepark', 'protect-cascade' => "Kaskadebeveiliging (beveilig alle pagina's en mallen die in disse pagina op-eneumen bin)", 'protect-cantedit' => "Je kunnen t beveiligingsnivo van disse pagina niet wiezigen, umda'j gien rechten hebben um t te bewarken.", 'protect-othertime' => 'Aandere tiedsduur:', 'protect-othertime-op' => 'aandere tiedsduur', 'protect-existing-expiry' => 'Bestaonde verloopdaotum: $2 $3', 'protect-otherreason' => 'Aandere reden:', 'protect-otherreason-op' => 'aandere reden', 'protect-dropdown' => '*Veulveurkomende redens veur beveiliging ** Vandelisme ** Ongewunste verwiezingen plaotsen ** Bewarkingsoorlog ** Pagina mit veul bezeukers', 'protect-edit-reasonlist' => 'Redens veur beveiliging bewarken', 'protect-expiry-options' => '1 uur:1 hour,1 dag:1 day,1 weke:1 week,2 weken:2 weeks,1 maond:1 month,3 maonden:3 months,6 maonden:6 months,1 jaor:1 year,onbeparkt:infinite', 'restriction-type' => 'Toegang', 'restriction-level' => 'Beveiligingsnivo', 'minimum-size' => 'Minimumgrootte (bytes)', 'maximum-size' => 'Maximumgrootte', 'pagesize' => '(byte)', # Restrictions (nouns) 'restriction-edit' => 'Bewark', 'restriction-move' => 'Herneum', 'restriction-create' => 'Anmaken', 'restriction-upload' => 'Bestaand opsturen', # Restriction levels 'restriction-level-sysop' => 'helemaole beveiligd', 'restriction-level-autoconfirmed' => 'semibeveiligd', 'restriction-level-all' => 'alles', # Undelete 'undelete' => "Vortedaone pagina's bekieken", 'undeletepage' => "Vortedaone pagina's bekieken en weerummeplaotsen", 'undeletepagetitle' => "'''Hieronder staon de vortedaone bewarkingen van [[:$1]]'''.", 'viewdeletedpage' => "Bekiek vortedaone pagina's", 'undeletepagetext' => "Hieronder {{PLURAL:$1|steet de pagina die vortedaon is|staon de pagina's die vortedaon bin}} en vanuut t archief weerummeplaots {{PLURAL:$1|kan|kunnen}} wörden.", 'undelete-fieldset-title' => 'Versies weerummeplaotsen', 'undeleteextrahelp' => "Laot alle vakjes leeg en klik op '''''{{int:undeletebtn}}''''' um de hele pagina mit alle veurgeschiedenisse weerumme te plaotsen. Vink de versies die weerummeplaotsen willen an en klik op '''''{{int:undeletebtn}}''''' um bepaolde versies weerumme te zetten.", 'undeleterevisions' => '$1 {{PLURAL:$1|versie|versies}} earchiveerd', 'undeletehistory' => "A'j n pagina weerummeplaotsen, wörden alle versies as ouwe versies weerummeplaots. As der al n nieje pagina mit de zelfde naam an-emaakt is, zullen disse versies as ouwe versies weerummeplaotst wörden, mer de op-esleugen versie zal niet ewiezigd wörden.", 'undeleterevdel' => "Herstellen kan niet as daor de leste versie van de pagina of t bestaand gedeeltelik mee vortedaon wörden. In dat geval mö'j de leste versie as zichtbaor instellen.", 'undeletehistorynoadmin' => 'Disse pagina is vortedaon. De reden hierveur steet hieronder, samen mit de informasie van de gebrukers die dit artikel ewiezigd hebben veurdat t vortedaon is. De tekste van t artikel is allinnig zichtbaor veur beheerders.', 'undelete-revision' => 'Vortedaone versies van $1 (per $4 um $5) deur $3:', 'undeleterevision-missing' => "Ongeldige of ontbrekende versie. t Is meugelik da'j n verkeerde verwiezing gebruken of dat disse pagina weerummeplaotst is of dat t uut t archief ewist is.", 'undelete-nodiff' => 'Gien eerdere versie evunnen.', 'undeletebtn' => 'Weerummeplaotsen', 'undeletelink' => 'bekiek/weerummeplaotsen', 'undeleteviewlink' => 'bekieken', 'undeletereset' => 'Herstel', 'undeleteinvert' => 'Seleksie ummekeren', 'undeletecomment' => 'Reden:', 'undeletedarticle' => '"[[$1]]" is weerummeplaotst', 'undeletedrevisions' => '$1 {{PLURAL:$1|versie|versies}} weerummeplaotst', 'undeletedrevisions-files' => '{{PLURAL:$1|1 versie|$1 versies}} en {{PLURAL:$2|1 bestaand|$2 bestaanden}} bin weerummeplaotst', 'undeletedfiles' => '{{PLURAL:$1|1 bestaand|$1 bestaanden}} weerummeplaotst', 'cannotundelete' => 'Weerummeplaotsen van t bestaand is mislokt; n aander hef disse pagina misschien al weerummeplaotst.', 'undeletedpage' => "'''$1 is weerummeplaotst''' Bekiek t [[Special:Log/delete|vortdologboek]] veur n overzichte van pagina's die kortens vortedaon en weerummeplaotst bin.", 'undelete-header' => 'Zie t [[Special:Log/delete|vortdologboek ]] veur spul dat krek vortedaon is.', 'undelete-search-box' => "Deurzeuk vortedaone pagina's", 'undelete-search-prefix' => "Bekiek pagina's vanaof:", 'undelete-search-submit' => 'Zeuk', 'undelete-no-results' => "Gien pagina's evunnen in t archief mit vortedaone pagina's.", 'undelete-filename-mismatch' => 'Bestaandsversie van t tiedstip $1 kon niet hersteld wörden: bestaandsnaam kloppen niet', 'undelete-bad-store-key' => 'Bestaandsversie van t tiedstip $1 kon niet hersteld wörden: t bestaand was der al niet meer veurdat t vortedaon wörden.', 'undelete-cleanup-error' => 'Fout bie t herstellen van t ongebruukten archiefbestaand "$1".', 'undelete-missing-filearchive' => 't Lokten niet um ID $1 weerumme te plaotsen umdat t niet in de databanke is. Misschien is t al weerummeplaotst.', 'undelete-error-short' => 'Fout bie t herstellen van t bestaand: $1', 'undelete-error-long' => 'Fouten bie t herstellen van t bestaand: $1', 'undelete-show-file-confirm' => 'Bi\'j der wisse van da\'j n vortedaone versie van t bestaand "<nowiki>$1</nowiki>" van $2 um $3 bekieken willen?', 'undelete-show-file-submit' => 'Ja', # Namespace form on various pages 'namespace' => 'Naamruumte:', 'invert' => 'seleksie ummekeren', 'tooltip-invert' => "Vink dit vakjen an um wiezigingen an pagina's binnen de ekeuzen naamruumte te verbargen (en de biebeheurende naamruumte as dat an-evinkt is)", 'namespace_association' => 'Naamruumte die hieran ekoppeld is', 'tooltip-namespace_association' => 'Vink dit vakjen an um oek de overlegnaamruumte, of in t ummekeren geval de naamruumte zelf, derbie te doon die bie disse naamruumte heurt.', 'blanknamespace' => '(Heufdnaamruumte)', # Contributions 'contributions' => 'Biedragen van disse gebruker', 'contributions-title' => 'Biedragen van $1', 'mycontris' => 'Mien biedragen', 'contribsub2' => 'Veur $1 ($2)', 'nocontribs' => 'Gien wiezigingen evunnen die an de estelde criteria voldoon.', 'uctop' => '(leste wieziging)', 'month' => 'Maond:', 'year' => 'Jaor:', 'sp-contributions-newbies' => 'Allinnig biedragen van anwas bekieken', 'sp-contributions-newbies-sub' => 'Veur anwas', 'sp-contributions-newbies-title' => 'Biedragen van anwas', 'sp-contributions-blocklog' => 'blokkeerlogboek', 'sp-contributions-deleted' => 'vortedaone gebrukersbiedragen', 'sp-contributions-uploads' => 'nieje bestaanden', 'sp-contributions-logs' => 'logboeken', 'sp-contributions-talk' => 'overleg', 'sp-contributions-userrights' => 'gebrukersrechtenbeheer', 'sp-contributions-blocked-notice' => 'Disse gebruker is op t moment eblokkeerd. De leste regel uut t blokkeerlogboek steet hieronder as referensie:', 'sp-contributions-blocked-notice-anon' => 'Dit IP-adres is eblokkeerd. De leste regel uut t blokkeerlogboek steet as referensie', 'sp-contributions-search' => 'Zeuken naor biedragen', 'sp-contributions-username' => 'IP-adres of gebrukersnaam:', 'sp-contributions-toponly' => 'Allinnig de niejste versie laoten zien', 'sp-contributions-submit' => 'Zeuk', # What links here 'whatlinkshere' => 'Verwiezingen naor disse pagina', 'whatlinkshere-title' => 'Pagina\'s die verwiezen naor "$1"', 'whatlinkshere-page' => 'Pagina:', 'linkshere' => "Disse pagina's verwiezen naor '''[[:$1]]''':", 'nolinkshere' => "Gien enkele pagina verwies naor '''[[:$1]]'''.", 'nolinkshere-ns' => "Gien enkele pagina verwiest naor '''[[:$1]]''' in de ekeuzen naamruumte.", 'isredirect' => 'deurverwiezing', 'istemplate' => 'in-evoegd as mal', 'isimage' => 'bestaandsverwiezing', 'whatlinkshere-prev' => '{{PLURAL:$1|veurige|veurige $1}}', 'whatlinkshere-next' => '{{PLURAL:$1|volgende|volgende $1}}', 'whatlinkshere-links' => '← verwiezingen', 'whatlinkshere-hideredirs' => '$1 deurverwiezingen', 'whatlinkshere-hidetrans' => '$1 in-evoegden mallen', 'whatlinkshere-hidelinks' => '$1 verwiezingen', 'whatlinkshere-hideimages' => '$1 bestaandsverwiezingen', 'whatlinkshere-filters' => 'Filters', # Block/unblock 'autoblockid' => 'Automatiese blokkering #$1', 'block' => 'Gebruker blokkeren', 'unblock' => 'Gebruker deblokkeren', 'blockip' => 'Gebruker blokkeren', 'blockip-title' => 'Gebruker blokkeren', 'blockip-legend' => 'n Gebruker of IP-adres blokkeren', 'blockiptext' => "Gebruuk dit formulier um n IP-adres of gebrukersnaam te blokkeren. t Is bedoeld um vandelisme te veurkoemen en mit in akkerderen mit t [[{{MediaWiki:Policy-url}}|beleid]]. Geef hieronder n reden op (bieveurbeeld op welke pagina's de vandelisme epleeg is)", 'ipadressorusername' => 'IP-adres of gebrukersnaam', 'ipbexpiry' => 'Verlöp nao', 'ipbreason' => 'Reden:', 'ipbreasonotherlist' => 'aandere reden', 'ipbreason-dropdown' => "*Algemene redens veur t blokkeren ** valse informasie invoeren ** pagina's leegmaken ** ongewunste verwiezingen plaotsen ** onzinteksten schrieven ** targerieje of naor gedrag ** misbruuk vanaof meerdere profielen ** ongewunste gebrukersnaam", 'ipb-hardblock' => 'Veurkoemen dat an-emelde gebrukers vanaof dit IP-adres kunnen bewarken', 'ipbcreateaccount' => 'Veurkom t anmaken van gebrukersprofielen', 'ipbemailban' => 'Veurkom dat bepaolde gebrukers berichten versturen', 'ipbenableautoblock' => 'De IP-adressen van disse gebruker vanzelf blokkeren', 'ipbsubmit' => 'adres blokkeren', 'ipbother' => 'Aandere tied', 'ipboptions' => '2 uren:2 hours,1 dag:1 day,3 dagen:3 days,1 weke:1 week,2 weken:2 weeks,1 maond:1 month,3 maonden:3 months,6 maonden:6 months,1 jaor:1 year,onbeparkt:infinite', 'ipbotheroption' => 'aanders', 'ipbotherreason' => 'Aandere/extra reden:', 'ipbhidename' => 'Verbarg de gebrukersnaam in bewarkingen en liesten', 'ipbwatchuser' => 'Gebrukerspagina en overlegpagina op volglieste zetten', 'ipb-disableusertalk' => 'Veurkoemen dat disse gebruker tiejens de blokkering de eigen overlegpagina kan bewarken', 'ipb-change-block' => 'De gebruker opniej blokkeren mit disse instellingen', 'ipb-confirm' => 'Blokkering bevestigen', 'badipaddress' => 'Ongeldig IP-adres of onbestaonde gebrukersnaam', 'blockipsuccesssub' => 'Suksesvol eblokkeerd', 'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] is noen eblokkeerd.<br /> Op de [[Special:BlockList|IP-blokkeerlieste]] steet n lieste mit alle blokkeringen.', 'ipb-blockingself' => "Hiermee blokkeer je je eigen. Wi'j dat?", 'ipb-confirmhideuser' => "Hiermee blokkeer je n verbörgen gebruker. Hierveur wörden gebrukersnamen in alle liesten en logboekregels verbörgen. Wi'j dat?", 'ipb-edit-dropdown' => 'Blokkeerredens bewarken', 'ipb-unblock-addr' => 'Deblokkeer $1', 'ipb-unblock' => 'Deblokkeer n gebruker of IP-adres', 'ipb-blocklist' => 'Bekiek bestaonde blokkeringen', 'ipb-blocklist-contribs' => 'Biedragen van $1', 'unblockip' => 'Deblokkeer gebruker', 'unblockiptext' => 'Gebruuk t onderstaonde formulier um weerumme schrieftoegang te geven an n eblokkeerden gebruker of IP-adres.', 'ipusubmit' => 'Blokkering deraof haolen', 'unblocked' => '[[User:$1|$1]] is edeblokeerd', 'unblocked-range' => '$1 is edeblokkeerd', 'unblocked-id' => 'Blokkering $1 is op-eheven', 'blocklist' => 'Gebrukers die eblokkeerd bin', 'ipblocklist' => 'Gebrukers die eblokkeerd bin', 'ipblocklist-legend' => 'n Eblokkeerden gebruker zeuken', 'blocklist-userblocks' => 'Verbarg gebrukers die eblokkeerd bin', 'blocklist-tempblocks' => 'Tiedelike blokkeringen verbargen', 'blocklist-addressblocks' => 'Blokkering van één IP-adres verbargen', 'blocklist-timestamp' => 'Tiedstip', 'blocklist-target' => 'Doel', 'blocklist-expiry' => 'Vervuilt', 'blocklist-by' => 'Eblokkeerd deur', 'blocklist-params' => 'Blokkeringsparameters', 'blocklist-reason' => 'Reden', 'ipblocklist-submit' => 'Zeuk', 'ipblocklist-localblock' => 'Lokale blokkering', 'ipblocklist-otherblocks' => 'Aandere {{PLURAL:$1|blokkering|blokkeringen}}', 'infiniteblock' => 'onbeparkt', 'expiringblock' => 'löp aof op $1 um $2', 'anononlyblock' => 'allinnig anoniemen', 'noautoblockblock' => 'autoblok niet aktief', 'createaccountblock' => 'anmaken van n gebrukersprofiel is eblokkeerd', 'emailblock' => 't versturen van berichten is eblokkeerd', 'blocklist-nousertalk' => 'kan zien eigen overlegpagina niet bewarken', 'ipblocklist-empty' => 'De blokkeerlieste is leeg.', 'ipblocklist-no-results' => 't Op-evreugen IP-adres of de gebrukersnaam is niet eblokkeerd.', 'blocklink' => 'blokkeren', 'unblocklink' => 'deblokkeer', 'change-blocklink' => 'blokkering wiezigen', 'contribslink' => 'biedragen', 'autoblocker' => 'Vanzelf eblokkeerd umdat t IP-adres overenekump mit t IP-adres van [[User:$1|$1]], die eblokkeerd is mit as reden: "$2"', 'blocklogpage' => 'Blokkeerlogboek', 'blocklog-showlog' => 'Disse gebruker is al eerder eblokkeerd. t Blokkeerlogboek steet hieronder as referensie:', 'blocklog-showsuppresslog' => 'Disse gebruker is al eerder eblokkeerd en wele bewarkingen van disse gebruker bin verbörgen. t Logboek mit onderdrokten versies steet hieronder as referensie:', 'blocklogentry' => 'blokkeren "[[$1]]" veur $2 $3', 'reblock-logentry' => 'hef de instellingen veur de blokkering van [[$1]] ewiezigd t Löp noen of over $2 $3', 'blocklogtext' => "Hier zie'j n lieste van de leste blokkeringen en deblokkeringen. Automatiese blokkeringen en deblokkeringen koemen niet in t logboek te staon. Zie de [[Special:BlockList|IP-blokkeerlieste]] veur de lieste van adressen die noen eblokkeerd bin.", 'unblocklogentry' => 'blokkering van $1 is op-eheven', 'block-log-flags-anononly' => 'allinnig anoniemen', 'block-log-flags-nocreate' => 'anmaken van gebrukersprofielen uuteschakeld', 'block-log-flags-noautoblock' => 'autoblokkeren uuteschakeld', 'block-log-flags-noemail' => 't versturen van berichten is eblokkeerd', 'block-log-flags-nousertalk' => 'kan zien eigen overlegpagina niet bewarken', 'block-log-flags-angry-autoblock' => 'uutebreide automatiese blokkering in-eschakeld', 'block-log-flags-hiddenname' => 'gebrukersnaam verbörgen', 'range_block_disabled' => 'De meugelikheid veur beheerders um n groep adressen te blokkeren is uuteschakeld.', 'ipb_expiry_invalid' => 'De op-egeven verlooptied is ongeldig.', 'ipb_expiry_temp' => 'Blokkeringen veur verbörgen gebrukers mutten permanent ween.', 'ipb_hide_invalid' => 'Kan disse gebruker niet verbargen; warschienlik hef e al te veule bewarkingen emaakt.', 'ipb_already_blocked' => '"$1" is al eblokkeerd', 'ipb-needreblock' => "$1 is al eblokkeerd. Wi'j de instellingen wiezigen?", 'ipb-otherblocks-header' => 'Aandere {{PLURAL:$1|blokkering|blokkeringen}}', 'unblock-hideuser' => 'Je kunnen disse gebruker niet deblokkeeren, umdat de gebrukersnaam verbörgen is.', 'ipb_cant_unblock' => 'Foutmelding: blokkerings-ID $1 niet evunnen, t is misschien al edeblokkeerd.', 'ipb_blocked_as_range' => 'Fout: t IP-adres $1 is niet drek eblokkeerd en de blokkering kan niet op-eheven wörden. De blokkering is onderdeel van de reeks $2, waorvan de blokkering wel op-eheven kan wörden.', 'ip_range_invalid' => 'Ongeldige IP-reeks', 'ip_range_toolarge' => 'Groeps-IP-adressen die groter bin as /$1, bin niet toe-estaon.', 'blockme' => 'Mien blokkeren', 'proxyblocker' => 'Proxyblokker', 'proxyblocker-disabled' => 'Disse funksie is uuteschakeld.', 'proxyblockreason' => "Dit is n automatiese preventieve blokkering umda'j gebruuk maken van n open proxyserver.", 'proxyblocksuccess' => 'Suksesvol.', 'sorbsreason' => "Joew IP-adres is op-eneumen as open proxyserver in de zwarte lieste van DNS die'w veur {{SITENAME}} gebruken.", 'sorbs_create_account_reason' => "Joew IP-adres is op-eneumen as open proxyserver in de zwarte lieste van DNS, die'w veur {{SITENAME}} gebruken. Je kunnen gien gebrukerspagina anmaken.", 'cant-block-while-blocked' => "Je kunnen aandere gebrukers niet blokkeren a'j zelf oek eblokkeerd bin.", 'cant-see-hidden-user' => "De gebruker die'j proberen te blokkeren is al eblokkeerd en verbörgen. Umda'j gien rech hebben um gebrukers te verbargen, ku'j de blokkering van de gebruker niet bekieken of bewarken.", 'ipbblocked' => "Je kunnen gien aandere gebrukers (de)blokkeren, umda'j zelf eblokkeerd bin", 'ipbnounblockself' => 'Je maggen je eigen niet deblokkeren', # Developer tools 'lockdb' => 'Databanke blokkeren', 'unlockdb' => 'Databanke vriegeven', 'lockdbtext' => "Waorschuwing: a'j de databanke blokkeren dan kan der gienene meer pagina's bewarken, zien veurkeuren wiezingen of wat aanders doon waorveur der wiezigingen in de databanke neudig bin.", 'unlockdbtext' => 'Vriegeven van de databanke maak alle bewarkingen weer meugelik. Mut de databanke vrie-egeven wörden?', 'lockconfirm' => 'Ja, ik wille de databanke blokkeren.', 'unlockconfirm' => 'Ja, ik wille de databanke vriegeven.', 'lockbtn' => 'Databanke blokkeren', 'unlockbtn' => 'Databanke vriegeven', 'locknoconfirm' => 'Je hebben t vakjen niet ekeuzen um joew keuze te bevestigen.', 'lockdbsuccesssub' => 'Databanke suksesvol eblokkeerd', 'unlockdbsuccesssub' => 'Blokkering van de databanke is op-eheven.', 'lockdbsuccesstext' => "De databanke is eblokkeerd.<br /> Vergeet niet de [[Special:UnlockDB|databanke vrie te geven]] a'j klaor bin mit t onderhoud.", 'unlockdbsuccesstext' => 'De databanke is weer vrie-egeven.', 'lockfilenotwritable' => 'Gien schriefrechten op t beveiligingsbestaand van de databanke. Um de databanke te blokkeren of de blokkering op te heffen, mut der eschreven kunnen wörden deur de webserver.', 'databasenotlocked' => 'De databanke is niet eblokkeerd.', 'lockedbyandtime' => '(deur $1 um $3 op $2)', # Move page 'move-page' => 'Herneum "$1"', 'move-page-legend' => 'Pagina herneumen', 'movepagetext' => "Mit dit formulier ku'j de pagina n nieje naam geven, de geschiedenisse geet dan vanzelf mee. De ouwe naam zal automaties n deurverwiezing wörden naor de nieje pagina. Deurverwiezingen naor de ouwe naam kunnen automaties ewiezigd wörden. A'j derveur kiezen um dat niet te doon, kiek t dan effen nao of der [[Special:DoubleRedirects|dubbele]] en [[Special:BrokenRedirects|ebreuken deurverwiezingen]] bin ontstaon. t Is an joe um derveur te zörgen dat de deurverwiezingen naor de goeie naam gaon. n Pagina kan '''allinnig''' herneumd wörden as de nieje naam niet besteet of t n deurverwiezing is zonder veerdere geschiedenisse. Dit betekent da'j n pagina weer naor de ouwe naam kunnen herneumen, a'j bieveurbeeld n fout emaakt hebben, zonder da'j de bestaonde pagina overschrieven. '''WAORSCHUWING!''' Veur populaire pagina's kan t herneumen drastiese en onveurziene gevolgen hebben. Zörg derveur da'j de gevolgen overzien veurda'j veerder gaon.", 'movepagetext-noredirectfixer' => "Mit dit formulier ku'j de pagina n nieje naam geven, de geschiedenisse geet dan vanzelf mee. De ouwe naam zal automaties n deurverwiezing wörden naor de nieje pagina. Kiek oek effen nao of der gien [[Special:DoubleRedirects|dubbele]] of [[Special:BrokenRedirects|ebreuken deurverwiezingen]] bin ontstaon. t Is an joe um derveur te zörgen dat de deurverwiezingen naor de goeie naam gaon. n Pagina kan '''allinnig''' herneumd wörden as de nieje naam niet besteet of t n deurverwiezing is zonder veerdere geschiedenisse. Dit betekent da'j n pagina weer naor de ouwe naam kunnen herneumen, a'j bieveurbeeld n fout emaakt hebben, zonder da'j de bestaonde pagina overschrieven. '''WAORSCHUWING!''' Veur popelaire pagina's kan t herneumen drastiese en onveurziene gevolgen hebben. Zörg derveur da'j de gevolgen overzien veurda'j veerder gaon.", 'movepagetalktext' => "De overlegpagina die derbie heurt krig oek n nieje titel, mer '''niet''' in de volgende gevallen: * As de pagina in n aandere naamruumte eplaots wörden * As der al n niet-lege overlegpagina besteet onder de aandere naam * a'j t onderstaonde vinkjen vorthaolen", 'movearticle' => 'Herneum', 'moveuserpage-warning' => "'''Waorschuwing:''' Je staon op t punt um n gebrukerspagina te herneumen. Allinnig disse pagina zal herneumd wörden, '''niet''' de gebruker.", 'movenologin' => 'Niet an-emeld.', 'movenologintext' => 'Je mutten [[Special:UserLogin|an-emeld]] ween um de naam van n pagina te wiezigen.', 'movenotallowed' => "Je hebben gien rechten um pagina's te herneumen.", 'movenotallowedfile' => 'Je hebben gien rechten um bestaanden te herneumen.', 'cant-move-user-page' => "Je hebben gien rechten um gebrukerspagina's te herneumen.", 'cant-move-to-user-page' => "Je hebben gien rechten um n pagina naor n gebrukerspagina te herneumen. Herneumen naor n subpagina ma'j wel doon.", 'newtitle' => 'Nieje naam', 'move-watch' => 'volg disse pagina', 'movepagebtn' => 'Herneum', 'pagemovedsub' => 'Naamwieziging suksesvol', 'movepage-moved' => '\'\'\'"$1" is ewiezigd naor "$2"\'\'\'', 'movepage-moved-redirect' => 'Der is n deurverwiezing an-emaakt.', 'movepage-moved-noredirect' => 'Der is gien deurverwiezing an-emaakt.', 'articleexists' => 'Onder disse naam besteet al n pagina. Kies n aandere naam.', 'cantmove-titleprotected' => 'Je kunnen gien pagina naor disse titel herneumen, umdat de nieje titel beveiligd is tegen t anmaken dervan.', 'talkexists' => "De pagina zelf is herneumd, mer de overlegpagina kon niet verherneumd wörden, umdat de doelnaam al n niet-lege overlegpagina had. Kombineer de overlegpagina's mit de haand.", 'movedto' => 'wiezigen naor', 'movetalk' => 'De overlegpagina oek wiezigen, as t meuglik is.', 'move-subpages' => "Herneum subpagina's (tot en mit $1)", 'move-talk-subpages' => "Herneum subpagina's van overlegpagina's (tot en mit $1)", 'movepage-page-exists' => 'De pagina $1 besteet al en kan niet automaties vortedaon wörden.', 'movepage-page-moved' => 'De pagina $1 is herneumd naor $2.', 'movepage-page-unmoved' => 'De pagina $1 kon niet herneumd wörden naor $2.', 'movepage-max-pages' => "t Maximale antal automaties te herneumen pagina's is bereikt ({{PLURAL:$1|$1|$1}}). De overige pagina's wörden niet automaties herneumd.", '1movedto2' => '[[$1]] is ewiezigd naor [[$2]]', '1movedto2_redir' => '[[$1]] is ewiezigd over de deurverwiezing [[$2]] hinne', 'move-redirect-suppressed' => 'deurverwiezing onderdrokken', 'movelogpage' => 'Herneumlogboek', 'movelogpagetext' => "Hieronder steet n lieste mit pagina's die herneumd bin.", 'movesubpage' => "{{PLURAL:$1|Subpagina|Subpagina's}}", 'movesubpagetext' => "De {{PLURAL:$1|subpagina|$1 subpagina's}} van disse pagina vie'j hieronder.", 'movenosubpage' => "Disse pagina hef gien subpagina's.", 'movereason' => 'Reden:', 'revertmove' => 'Weerummedreien', 'delete_and_move' => 'Vortdoon en herneumen', 'delete_and_move_text' => '==Mut vortedaon wörden== <div style="color: red"> Onder de nieje naam "[[:$1]]" besteet al n artikel. Wi\'j t vortdoon um plaotse te maken veur t herneumen?</div>', 'delete_and_move_confirm' => 'Ja, disse pagina vortdoon', 'delete_and_move_reason' => 'Vortedaon vanwegen naamwieziging', 'selfmove' => 'De naam kan niet ewiezigd wörden naor de naam die t al hef.', 'immobile-source-namespace' => 'Pagina\'s in de naamruumte "$1" kunnen niet herneumd wörden', 'immobile-target-namespace' => 'Pagina\'s kunnen niet herneumd wörden naor de naamruumte "$1"', 'immobile-target-namespace-iw' => 'n Interwikiverwiezing is gien geldige bestemming veur t herneumen van n pagina.', 'immobile-source-page' => 'Disse pagina kan niet herneumd wörden.', 'immobile-target-page' => 'Kan niet herneumd wörden naor disse paginanaam.', 'imagenocrossnamespace' => 'n Mediabestaand kan niet naor n aandere naamruumte verplaots wörden', 'nonfile-cannot-move-to-file' => 'Je kunnen niet herneumen van en naor de bestaandsnaamruumte', 'imagetypemismatch' => 'De nieje bestaandsextensie is niet gelieke an t bestaandstype', 'imageinvalidfilename' => 'De nieje bestaandsnaam is ongeldig', 'fix-double-redirects' => 'Alle deurverwiezingen die naor de ouwe titel verwiezen, herneumen naor de nieje titel', 'move-leave-redirect' => 'n Deurverwiezing achterlaoten', 'protectedpagemovewarning' => "'''Waorschuwing:''' disse pagina kan allinnig deur beheerders herneumd wörden.", 'semiprotectedpagemovewarning' => "'''Waorschuwing:''' disse pagina kan allinnig deur eregistreerden gebrukers herneumd wörden. De leste logboekregel steet hieronder:", 'move-over-sharedrepo' => "== t Bestaand besteet al == [[:$1]] besteet al in de edeelden mediadatabanke. A'j n bestaand naor disse titel herneumen, dan ku'j t edeelden bestaand niet gebruken.", 'file-exists-sharedrepo' => 'Disse bestaandsnaam besteet al in de edeelden mediadatabanke. Kies n aandere bestaandsnaam.', # Export 'export' => "Pagina's uutvoeren", 'exporttext' => "De tekste en geschiedenisse van n pagina of n antal pagina's kunnen in XML-formaot uutevoerd wörden. Dit bestaand ku'j daornao uutvoeren naor n aandere MediaWiki deur de [[Special:Import|invoerpagina]] te gebruken. Zet in t onderstaonde veld de namen van de pagina's die'j uutvoeren willen, één pagina per regel, en geef an o'j alle versies mit de bewarkingssamenvatting uutvoeren willen of allinnig de leste versies mit de bewarkingssamenvatting. A'j dat leste doon willen dan ku'j oek n verwiezing gebruken, bieveurbeeld [[{{#Special:Export}}/{{MediaWiki:Mainpage}}]] veur de pagina \"[[{{MediaWiki:Mainpage}}]]\".", 'exportcuronly' => 'Allinnig de actuele versie, niet de veurgeschiedenisse', 'exportnohistory' => "---- '''NB:''' t uutvoeren van de hele geschiedenisse is uuteschakeld vanwegen prestasieredens.", 'export-submit' => 'Uutvoeren', 'export-addcattext' => "Pagina's derbie doon uut de kategorie:", 'export-addcat' => 'Derbie doon', 'export-addnstext' => "Pagina's uut de volgende naamruumte derbie doon:", 'export-addns' => 'Derbie doon', 'export-download' => 'As bestaand opslaon', 'export-templates' => 'Mit mallen derbie', 'export-pagelinks' => "Pagina's waor naor verwezen wörden opnemen tot:", # Namespace 8 related 'allmessages' => 'Alle systeemteksten', 'allmessagesname' => 'Naam', 'allmessagesdefault' => 'Standardtekste', 'allmessagescurrent' => 'De leste versie', 'allmessagestext' => "Hieronder steet n lieste mit alle systeemteksten in de MediaWiki-naamruumte. Kiek oek effen bie [//www.mediawiki.org/wiki/Localisation MediaWiki-lokalisasie] en [//translatewiki.net translatewiki.net] a'j biedragen willen an de algemene vertaling veur MediaWiki.", 'allmessagesnotsupportedDB' => "Disse pagina kan niet gebruukt wörden umdat '''\$wgUseDatabaseMessages''' uuteschakeld is.", 'allmessages-filter-legend' => 'Filter', 'allmessages-filter' => 'Filtreer op wiezigingen:', 'allmessages-filter-unmodified' => 'niet ewiezigd', 'allmessages-filter-all' => 'alles', 'allmessages-filter-modified' => 'ewiezigd', 'allmessages-prefix' => 'Filtreer op veurvoegsel:', 'allmessages-language' => 'Taal:', 'allmessages-filter-submit' => 'zeuk', # Thumbnails 'thumbnail-more' => 'vergroten', 'filemissing' => 'Bestaand ontbreekt', 'thumbnail_error' => 'Fout bie t laojen van de miniatuuraofbeelding: $1', 'djvu_page_error' => 'DjVu-pagina buten bereik', 'djvu_no_xml' => 'Kon de XML-gegevens veur t DjVu-bestaand niet oproepen', 'thumbnail_invalid_params' => 'Ongeldige parameters veur de miniatuuraofbeelding', 'thumbnail_dest_directory' => 'De bestemmingsmap kon niet an-emaakt wörden.', 'thumbnail_image-type' => 'Dit bestaandstype wörden niet ondersteund', 'thumbnail_gd-library' => 'De instellingen veur de GD-biebeltheek bin niet compleet. De funksie $1 ontbreekt', 'thumbnail_image-missing' => 't Lik derop dat t bestaand vort is: $1', # Special:Import 'import' => "Pagina's invoeren", 'importinterwiki' => 'Transwiki-invoer', 'import-interwiki-text' => 'Kies n wiki en paginanaam um in te voeren. Versie- en auteursgegevens blieven hierbie beweerd. Alle transwiki-invoerhaandelingen wörden op-esleugen in t [[Special:Log/import|invoerlogboek]].', 'import-interwiki-source' => 'Bronwiki/pagina:', 'import-interwiki-history' => 'Kopieer de hele geschiedenisse veur disse pagina', 'import-interwiki-templates' => 'Alle mallen opnemen', 'import-interwiki-submit' => 'Invoeren', 'import-interwiki-namespace' => 'Doelnaamruumte:', 'import-upload-filename' => 'Bestaandsnaam:', 'import-comment' => 'Opmarkingen:', 'importtext' => 'Gebruuk de [[Special:Export|uutvoerfunksie]] in de wiki waor de informasie vandaon kump. Slao t op joew eigen systeem op, en stuur t daornao hier op.', 'importstart' => "Pagina's an t invoeren...", 'import-revision-count' => '$1 {{PLURAL:$1|versie|versies}}', 'importnopages' => "Der bin gien pagina's um in te voeren.", 'imported-log-entries' => '$1 {{PLURAL:$1|logboekregel|logboekregels}} in-evoerd.', 'importfailed' => 'Invoeren is mislokt: $1', 'importunknownsource' => 'Onbekend invoerbrontype', 'importcantopen' => 'Kon t invoerbestaand niet los doon', 'importbadinterwiki' => 'Foute interwikiverwiezing', 'importnotext' => 'Leeg of gien tekste', 'importsuccess' => 'Invoeren suksesvol!', 'importhistoryconflict' => 'Der bin konflikten in de geschiedenisse van de pagina (is misschien eerder al in-evoerd)', 'importnosources' => 'Gien transwiki-invoerbronnen vastesteld en t drek inlaojen van versies is eblokkeerd.', 'importnofile' => 'Der is gien invoerbestaand op-estuurd.', 'importuploaderrorsize' => 't Opsturen van t invoerbestaand is mislokt. t Bestaand is groter as de in-estelde limiet.', 'importuploaderrorpartial' => 't Opsturen van t invoerbestaand is mislokt. t Bestaand is mer gedeeltelik an-ekeumen.', 'importuploaderrortemp' => 't Opsturen van t invoerbestaand is mislokt. De tiedelike map is niet anwezig.', 'import-parse-failure' => 'Fout bie t verwarken van de XML-invoer', 'import-noarticle' => "Der bin gien pagina's um in te voeren!", 'import-nonewrevisions' => 'Alle versies bin al eerder in-evoerd.', 'xml-error-string' => '$1 op regel $2, kolom $3 (byte $4): $5', 'import-upload' => 'XML-gegevens derbie doon', 'import-token-mismatch' => 'De sessiegegevens bin verleuren egaon. Probeer t opniej.', 'import-invalid-interwiki' => 't Is niet meugelik um van de an-egeven wiki in te voeren.', # Import log 'importlogpage' => 'Invoerlogboek', 'importlogpagetext' => "Administratieve invoer van pagina's mit geschiedenisse van aandere wiki's.", 'import-logentry-upload' => 'hef [[$1]] in-evoerd', 'import-logentry-upload-detail' => '$1 {{PLURAL:$1|versie|versies}}', 'import-logentry-interwiki' => 'transwiki $1', 'import-logentry-interwiki-detail' => '$1 {{PLURAL:$1|versie|versies}} van $2', # Tooltip help for the actions 'tooltip-pt-userpage' => 'Oew gebroekersbladziede', 'tooltip-pt-anonuserpage' => "Gebroekersbladziede vuur t IP-adres da'j broekt", 'tooltip-pt-mytalk' => 'Oew oaverlegbladziede', 'tooltip-pt-anontalk' => 'Oaverlegbladziede van n naamlozen gebroeker van dit IP-adres', 'tooltip-pt-preferences' => 'Miene vuurkeuren', 'tooltip-pt-watchlist' => 'Lieste van bladzieden die op miene volglieste stoan', 'tooltip-pt-mycontris' => 'Liest van oew biejdraegen', 'tooltip-pt-login' => 'Iej wördt van harte oetneugd um oe an te melden as gebroeker, mer t is nich verplicht', 'tooltip-pt-anonlogin' => 'Iej wördt van harte oetneugd um oe an te maelden as gebroeker, mer t is nich verplicht', 'tooltip-pt-logout' => 'Ofmaelden', 'tooltip-ca-talk' => 'Loat n oaverlegtekst oaver disse bladziede zeen', 'tooltip-ca-edit' => 'Bewaerk disse bladziede', 'tooltip-ca-addsection' => 'Niej oonderwaerp tovogen', 'tooltip-ca-viewsource' => 'Disse bladziede is beveiligd taegen veraanderen. Iej könt wal kieken noar de bladziede', 'tooltip-ca-history' => 'Oaldere versies van disse bladziede', 'tooltip-ca-protect' => 'Beveilig disse bladziede taegen veraanderen', 'tooltip-ca-unprotect' => 'De beveiliging vuur disse bladziede wiezigen', 'tooltip-ca-delete' => 'Smiet disse bladziede vort', 'tooltip-ca-undelete' => 'Haal n inhoald van disse bladziede oet n emmer', 'tooltip-ca-move' => 'Gef disse bladziede nen aanderen titel', 'tooltip-ca-watch' => 'Voog disse bladziede to an oewe volglieste', 'tooltip-ca-unwatch' => 'Smiet disse bladziede van oewe voalglieste', 'tooltip-search' => '{{SITENAME}} duurzeukn', 'tooltip-search-go' => 'Noar n bladziede mit disse naam goan as t besteet', 'tooltip-search-fulltext' => "De pagina's vuur disse tekst zeuken", 'tooltip-p-logo' => 'Goa noar t vuurblad', 'tooltip-n-mainpage' => 'Goa noar t vuurblad', 'tooltip-n-mainpage-description' => 'Goa noar t vuurblad', 'tooltip-n-portal' => 'Informoasie oaver t projekt: wel, wat, ho en woarum', 'tooltip-n-currentevents' => 'Achtergroondinformoasie oaver dinge in t niejs', 'tooltip-n-recentchanges' => 'Lieste van pas verrichte veraanderingen', 'tooltip-n-randompage' => 'Loat ne willekeurige bladziede zeen', 'tooltip-n-help' => 'Hölpinformoasie oaver {{SITENAME}}', 'tooltip-t-whatlinkshere' => 'Lieste van alle bladzieden die hiernoar verwiezen', 'tooltip-t-recentchangeslinked' => 'Pas verrichte veraanderingen die noar disse bladziede verwiezen', 'tooltip-feed-rss' => 'RSS-voer vuur disse bladziede', 'tooltip-feed-atom' => 'Atom-voer vuur disse bladziede', 'tooltip-t-contributions' => 'Lieste met biejdraegen van disse gebroeker', 'tooltip-t-emailuser' => 'Stuur disse gebroeker n netpostbericht', 'tooltip-t-upload' => 'Laad ofbeeldingen en/of geluudsmateriaal', 'tooltip-t-specialpages' => 'Lieste van alle biejzeundere bladzieden', 'tooltip-t-print' => 'De ofdrukboare versie van disse bladziede', 'tooltip-t-permalink' => 'Verbeending vuur altied noar de versie van disse bladziede van vandaag-an-n-dag', 'tooltip-ca-nstab-main' => 'Loat n tekst van t artikel zeen', 'tooltip-ca-nstab-user' => 'Loat de gebroekersbladziede zeen', 'tooltip-ca-nstab-media' => 'Loat n mediatekst zeen', 'tooltip-ca-nstab-special' => "Dit is ne biejzeundere bladziede die'j nich könt veraanderen", 'tooltip-ca-nstab-project' => 'Loat de projektbladziede zeen', 'tooltip-ca-nstab-image' => 'Loat de bestaandsbladziede zeen', 'tooltip-ca-nstab-mediawiki' => 'Loat de systeemtekstbladziede zeen', 'tooltip-ca-nstab-template' => 'Loat de malbladziede zeen', 'tooltip-ca-nstab-help' => 'Loat de hölpbladziede zeen', 'tooltip-ca-nstab-category' => 'Loat de rubriekbladziede zeen', 'tooltip-minoredit' => 'Markeer as n klaene wieziging', 'tooltip-save' => 'Wiezigingen opsloan', 'tooltip-preview' => "Bekiek oew versie vuurda'j t opsloan (anbeveulen)!", 'tooltip-diff' => 'Bekiek oew aegen wiezigingen', 'tooltip-compareselectedversions' => 'Bekiek de verschillen tussen de ekeuzen versies.', 'tooltip-watch' => 'Voog disse bladziede to an oew volglieste', 'tooltip-recreate' => 'Disse bladziede opniej anmaken, ondanks t feit dat t vortdoan is.', 'tooltip-upload' => 'Bestaanden tovogen', 'tooltip-rollback' => 'Mit "weerummedreien" kö\'j mit één klik de bewaerking(en) van n leste gebroeker dee disse bladziede bewaerkt hef terugdraeien.', 'tooltip-undo' => 'A\'j op "weerummedreien" klikken geet t bewaerkingsvaenster lös en kö\'j ne vurige versie terugzetten. Iej könt in de bewearkingssamenvatting n reden opgeven.', 'tooltip-preferences-save' => 'Vuurkeuren opsloan', 'tooltip-summary' => 'Voer ne korte samenvatting in', # Metadata 'notacceptable' => 'De wikiserver kan de gegevens niet leveren in n vorm die joew kliënt kan lezen.', # Attribution 'anonymous' => 'Anonieme {{PLURAL:$1|gebruker|gebrukers}} van {{SITENAME}}', 'siteuser' => '{{SITENAME}}-gebruker $1', 'anonuser' => 'Anonieme {{SITENAME}}-gebruker $1', 'lastmodifiedatby' => 'Disse pagina is t lest ewiezigd op $2, $1 deur $3.', 'othercontribs' => 'Ebaseerd op wark van $1.', 'others' => 'aandere', 'siteusers' => '{{SITENAME}}-{{PLURAL:$2|gebruker|gebrukers}} $1', 'anonusers' => 'Anonieme {{SITENAME}}-{{PLURAL:$2|gebruker|gebrukers}} $1', 'creditspage' => 'Pagina-auteurs', 'nocredits' => 'Der is gien auteursinformasie beschikbaor veur disse pagina.', # Spam protection 'spamprotectiontitle' => 'Moekfilter', 'spamprotectiontext' => "De pagina die'j opslaon wollen is eblokkeerd deur de moekfilter. Meestentieds kump dit deur n uutgaonde verwiezing die op de zwarte lieste steet.", 'spamprotectionmatch' => 'Disse tekste zörgen derveur dat onze moekfilter alarmsleug: $1', 'spambot_username' => 'MediaWiki ongewunste zooi oprumen', 'spam_reverting' => 'Bezig mit t weerummezetten naor de leste versie die gien verwiezing hef naor $1', 'spam_blanking' => 'Alle wiezigingen mit n verwiezing naor $1 wörden vortehaold', # Info page 'pageinfo-title' => 'Informasie over "$1"', 'pageinfo-header-edits' => 'Bewarkingen', 'pageinfo-header-watchlist' => 'Volglieste', 'pageinfo-header-views' => 'Bekeken', 'pageinfo-subjectpage' => 'Pagina:', 'pageinfo-talkpage' => 'Overlegpagina', 'pageinfo-watchers' => 'Antal volgers', 'pageinfo-edits' => 'Antal bewarkingen', 'pageinfo-authors' => 'Antal verschillende auteurs', 'pageinfo-views' => 'Antal keer bekeken', 'pageinfo-viewsperedit' => 'Antal keer bekeken per bewarking', # Skin names 'skinname-standard' => 'Klassiek', 'skinname-nostalgia' => 'Nostalgie', 'skinname-cologneblue' => 'Keuls blauw', 'skinname-monobook' => 'Monobook', 'skinname-myskin' => 'MienSkin', 'skinname-chick' => 'Deftig', 'skinname-simple' => 'Eenvoudig', 'skinname-modern' => 'Niejmoeds', # Patrolling 'markaspatrolleddiff' => 'Markeer as ekontroleerd', 'markaspatrolledtext' => 'Disse pagina is emarkeerd as ekontroleerd', 'markedaspatrolled' => 'Emarkeerd as ekontroleerd', 'markedaspatrolledtext' => 'De ekeuzen versie van [[:$1]] is emarkeerd as ekontroleerd.', 'rcpatroldisabled' => 'De kontrolemeugelikheid op leste wiezigingen is uuteschakeld.', 'rcpatroldisabledtext' => 'De meugelikheid um de leste wiezigingen as ekontroleerd te markeren is noen uuteschakeld.', 'markedaspatrollederror' => 'De bewarking kon niet aofevinkt wörden.', 'markedaspatrollederrortext' => 'Je mutten n wieziging selekteren um t as nao-ekeken te markeren.', 'markedaspatrollederror-noautopatrol' => 'Je maggen joew eigen bewarkingen niet as ekontroleerd markeren.', # Patrol log 'patrol-log-page' => 'Markeerlogboek', 'patrol-log-header' => 'In dit logboek staon de versies die emarkeerd bin as ekontroleerd.', 'patrol-log-line' => '$1 van $2 emarkeerd as ekontroleerd $3', 'patrol-log-auto' => '(automaties)', 'patrol-log-diff' => 'versie $1', 'log-show-hide-patrol' => 'Markeerlogboek $1', # Image deletion 'deletedrevision' => 'Vortedaone ouwe versie $1.', 'filedeleteerror-short' => 'Fout bie t vortdoon van bestaand: $1', 'filedeleteerror-long' => 'Der waren fouten bie t vortdoon van t bestaand: $1', 'filedelete-missing' => 't Bestaand "$1" kan niet vortedaon wörden, umdat t niet besteet.', 'filedelete-old-unregistered' => 'De an-egeven bestaandsversie "$1" steet niet in de databanke.', 'filedelete-current-unregistered' => 't An-egeven bestaand "$1" steet niet in de databanke.', 'filedelete-archive-read-only' => 'De webserver kan niet in de archiefmap "$1" schrieven.', # Browsing diffs 'previousdiff' => '← veurige wieziging', 'nextdiff' => 'volgende wieziging →', # Media information 'mediawarning' => "'''Waorschuwing:''' in dit bestaand zit misschien kodering die slicht is veur t systeem.", 'imagemaxsize' => "Maximale aofmetingen van aofbeeldingen:<br /> ''(veur op de beschrievingspagina)''", 'thumbsize' => 'Grootte van de miniatuuraofbeelding:', 'widthheightpage' => "$1 × $2, $3 {{PLURAL:$3|pagina|pagina's}}", 'file-info' => 'Bestaandsgrootte: $1, MIME-type: $2', 'file-info-size' => '$1 × $2 beeldpunten, bestaandsgrootte: $3, MIME-type: $4', 'file-info-size-pages' => "$1 × $2 beeldpunten, bestaandsgrootte: $3, MIME-type: $4, $5 {{PLURAL:$5|pagina|pagina's}}", 'file-nohires' => '<small>Gien hogere resolusie beschikbaor.</small>', 'svg-long-desc' => 'SVG-bestaand, uutgangsgrootte $1 × $2 beeldpunten, bestaandsgrootte: $3', 'show-big-image' => 'Volle resolusie', 'show-big-image-preview' => '<small>Grootte van disse weergave: $1.</small>', 'show-big-image-other' => '<small>Aandere resolusies: $1.</small>', 'show-big-image-size' => '$1 × $2 beeldpunten', 'file-info-gif-looped' => 'herhaolend', 'file-info-gif-frames' => '$1 {{PLURAL:$1|beeld|beelden}}', 'file-info-png-looped' => 'herhaolend', 'file-info-png-repeat' => '$1 {{PLURAL:$1|keer|keer}} aofespeuld', 'file-info-png-frames' => '$1 {{PLURAL:$1|beeld|beelden}}', # Special:NewFiles 'newimages' => 'Nieje bestaanden', 'imagelisttext' => "Hier volgt n lieste mit '''$1''' {{PLURAL:$1|bestaand|bestaanden}} esorteerd $2.", 'newimages-summary' => 'Op disse spesiale pagina staon de bestaanden die der as lest bie-ekeumen bin.', 'newimages-legend' => 'Bestaandsnaam', 'newimages-label' => 'Bestaandsnaam (of deel dervan):', 'showhidebots' => '(Bots $1)', 'noimages' => 'Niks te zien.', 'ilsubmit' => 'Zeuk', 'bydate' => 'op daotum', 'sp-newimages-showfrom' => 'Bekiek nieje bestaanden vanaof $1, $2', # Bad image list 'bad_image_list' => "De opmaak is as volgt: Allinnig regels in n lieste (regels die beginnen mit *) wörden verwarkt. De eerste verwiezing op n regel mut n verwiezing ween naor n ongewunst bestaand. Alle volgende verwiezingen die op de zelfde regel staon, wörden behaandeld as uutzundering, zo as pagina's waorop t bestaand in te tekste op-eneumen is.", # Metadata 'metadata' => 'Metadata', 'metadata-help' => 'In dit bestaand zit metadata mit EXIF-informasie, die deur n fotokamera, inleesapparaot of fotobewarkingsprogramma op-estuurd kan ween.', 'metadata-expand' => 'Bekiek uutebreiden gegevens', 'metadata-collapse' => 'Verbarg uutebreiden gegevens', 'metadata-fields' => 'De aofbeeldingsmetadatavelden in dit bericht staon oek op n aofbeeldingspagina as de metadatatabel in-eklapt is. Aandere velden wörden verbörgen. * make * model * datetimeoriginal * exposuretime * fnumber * isospeedratings * focallength * artist * copyright * imagedescription * gpslatitude * gpslongitude * gpsaltitude', # EXIF tags 'exif-imagewidth' => 'Wiedte', 'exif-imagelength' => 'Heugte', 'exif-bitspersample' => 'Bits per komponent', 'exif-compression' => 'Kompressiemethode', 'exif-photometricinterpretation' => 'Beeldpuntsamenstelling', 'exif-orientation' => 'Oriëntasie', 'exif-samplesperpixel' => 'Antal compenenten', 'exif-planarconfiguration' => 'Gegevensstructuur', 'exif-ycbcrsubsampling' => 'Subsamplingsverhouwige van Y tot C', 'exif-ycbcrpositioning' => 'Y- en C-posisionering', 'exif-xresolution' => 'Horizontale resolusie', 'exif-yresolution' => 'Verticale resolusie', 'exif-stripoffsets' => 'Lokasie aofbeeldingsgegevens', 'exif-rowsperstrip' => 'Riejen per strip', 'exif-stripbytecounts' => 'Bytes per ekomprimeerden strip', 'exif-jpeginterchangeformat' => 'Aofstaand tot JPEG SOI', 'exif-jpeginterchangeformatlength' => 'Bytes van JPEG-gegevens', 'exif-whitepoint' => 'Witpuntchromaticiteit', 'exif-primarychromaticities' => 'Chromaciteit van primaire kleuren', 'exif-ycbcrcoefficients' => 'Transformasiematrixkoëfficiënten veur de kleurruumte', 'exif-referenceblackwhite' => 'Referensieweerden veur zwart/wit', 'exif-datetime' => 'Tiedstip van digitalisasie', 'exif-imagedescription' => 'Aofbeeldingnaam', 'exif-make' => 'Kameramark', 'exif-model' => 'Kameramodel', 'exif-software' => 'Programmatuur die gebruukt wörden', 'exif-artist' => 'Eschreven deur', 'exif-copyright' => 'Auteursrechtenhouwer', 'exif-exifversion' => 'Exif-versie', 'exif-flashpixversion' => 'Ondersteunden Flashpix-versie', 'exif-colorspace' => 'Kleurruumte', 'exif-componentsconfiguration' => 'Betekenisse van elk compenent', 'exif-compressedbitsperpixel' => 'Beeldkompressiemethode', 'exif-pixelydimension' => 'Aofbeeldingsbreedte', 'exif-pixelxdimension' => 'Aofbeeldingsheugte', 'exif-usercomment' => 'Opmarkingen', 'exif-relatedsoundfile' => 'Biebeheurend geluudsbestaand', 'exif-datetimeoriginal' => 'Tiedstip van datagenerasie', 'exif-datetimedigitized' => 'Tiedstip van digitalisasie', 'exif-subsectime' => 'Subseconden tiedstip bestaandswieziging', 'exif-subsectimeoriginal' => 'Subseconden tiedstip datagenerasie', 'exif-subsectimedigitized' => 'Subseconden tiedstip digitalisasie', 'exif-exposuretime' => 'Belochtingstied', 'exif-exposuretime-format' => '$1 sek ($2)', 'exif-fnumber' => 'F-getal', 'exif-exposureprogram' => 'Belochtingsprogramma', 'exif-spectralsensitivity' => 'Spektrale geveuligheid', 'exif-isospeedratings' => 'ISO-weerde.', 'exif-shutterspeedvalue' => 'Slutersnelheid in APEX', 'exif-aperturevalue' => 'Diafragma in APEX', 'exif-brightnessvalue' => 'Helderheid in APEX', 'exif-exposurebiasvalue' => 'Belochtingscompensasie', 'exif-maxaperturevalue' => 'Maximale diafragmaweerde van de lenze', 'exif-subjectdistance' => 'Aofstaand tot onderwarp', 'exif-meteringmode' => 'Methode lochmeting', 'exif-lightsource' => 'Lochbron', 'exif-flash' => 'Flitser', 'exif-focallength' => 'Braandpuntofstand', 'exif-subjectarea' => 'Objektruumte', 'exif-flashenergy' => 'Flitserstarkte', 'exif-focalplanexresolution' => 'X-resolusie van CDD', 'exif-focalplaneyresolution' => 'Y-resolusie van CCD', 'exif-focalplaneresolutionunit' => 'Eenheid CCD-resolusie', 'exif-subjectlocation' => 'Objeklokasie', 'exif-exposureindex' => 'Belochtingsindex', 'exif-sensingmethod' => 'Meetmethode', 'exif-filesource' => 'Bestaandsnaam op de hardeschieve', 'exif-scenetype' => 'Scènetype', 'exif-customrendered' => 'An-epassen beeldbewarking', 'exif-exposuremode' => 'Belochtingsinstelling', 'exif-whitebalance' => 'Witbalans', 'exif-digitalzoomratio' => 'Digitale zoomfactor', 'exif-focallengthin35mmfilm' => 'Braandpuntaofstaand (35mm-equivalent)', 'exif-scenecapturetype' => 'Soort opname', 'exif-gaincontrol' => 'Piekbeheersing', 'exif-contrast' => 'Kontrast', 'exif-saturation' => 'Verzaojiging', 'exif-sharpness' => 'Scharpte', 'exif-devicesettingdescription' => 'Umschrieving apperaotinstellingen', 'exif-subjectdistancerange' => 'Aofstaandskategorie', 'exif-imageuniqueid' => 'Unieke ID-aofbeelding', 'exif-gpsversionid' => 'GPS-versienummer', 'exif-gpslatituderef' => 'Noorder- of zujerbreedte', 'exif-gpslatitude' => 'Breedte', 'exif-gpslongituderef' => 'Ooster- of westerlengte', 'exif-gpslongitude' => 'Lengtegraod', 'exif-gpsaltituderef' => 'Heugtereferensie', 'exif-gpsaltitude' => 'Heugte', 'exif-gpstimestamp' => 'GPS-tied (atoomklokke)', 'exif-gpssatellites' => 'Satellieten die gebruuk bin veur de meting', 'exif-gpsstatus' => 'Ontvangerstaotus', 'exif-gpsmeasuremode' => 'Meetmodus', 'exif-gpsdop' => 'Meetpresisie', 'exif-gpsspeedref' => 'Snelheidseenheid', 'exif-gpsspeed' => 'Snelheid van GPS-ontvanger', 'exif-gpstrackref' => 'Referensie veur bewegingsrichting', 'exif-gpstrack' => 'Bewegingsrichting', 'exif-gpsimgdirectionref' => 'Referensie veur aofbeeldingsrichting', 'exif-gpsimgdirection' => 'Aofbeeldingsrichtige', 'exif-gpsmapdatum' => 'Geodetiese onderzeuksgegevens die gebruukt bin', 'exif-gpsdestlatituderef' => 'Referensie veur breedtegraod tot bestemming', 'exif-gpsdestlatitude' => 'Breedtegraod bestemming', 'exif-gpsdestlongituderef' => 'Referensie veur lengtegraod bestemming', 'exif-gpsdestlongitude' => 'Lengtegraod bestemming', 'exif-gpsdestbearingref' => 'Referensie veur richting naor bestemming', 'exif-gpsdestbearing' => 'Richting naor bestemming', 'exif-gpsdestdistanceref' => 'Referensie veur aofstaand tot bestemming', 'exif-gpsdestdistance' => 'Aofstaand tot bestemming', 'exif-gpsprocessingmethod' => 'Naam van de GPS-verwarkingsmethode', 'exif-gpsareainformation' => 'Naam van t GPS-gebied', 'exif-gpsdatestamp' => 'GPS-daotum', 'exif-gpsdifferential' => 'Differensiële GPS-korreksie', 'exif-jpegfilecomment' => 'Opmarking bie JPEG-bestaand', 'exif-keywords' => 'Trefwoorden', 'exif-worldregioncreated' => 'Regio in de wereld waor de aofbeelding emaakt is', 'exif-countrycreated' => 'Laand waor de aofbeelding emaakt is', 'exif-countrycodecreated' => 'Kode veur t laand waor de aofbeelding emaakt is', 'exif-provinceorstatecreated' => 'Provinsie of staot waor de aofbeelding emaakt is', 'exif-citycreated' => 'Plaotse waor de aofbeelding emaakt is', 'exif-sublocationcreated' => 'Wiek van de plaotse waor de aofbeelding emaakt is', 'exif-worldregiondest' => 'Weeregeven wereldregio', 'exif-countrydest' => 'Weeregeven laand', 'exif-countrycodedest' => 'Kode veur t weeregeven laand', 'exif-provinceorstatedest' => 'Weeregeven provinsie of staot', 'exif-citydest' => 'Weeregeven plaotse', 'exif-sublocationdest' => 'Weeregeven wiek in plaotse', 'exif-objectname' => 'Korte naam', 'exif-specialinstructions' => 'Spesiale instruksies', 'exif-headline' => 'Kopjen', 'exif-credit' => 'Krediet/leverancier', 'exif-source' => 'Bron', 'exif-editstatus' => 'Bewarkingsstaotus van de aofbeelding', 'exif-urgency' => 'Urgensie', 'exif-fixtureidentifier' => 'Groepsnaam', 'exif-locationdest' => 'Weeregeven lokasie', 'exif-locationdestcode' => 'Kode veur de weeregeven lokasie', 'exif-objectcycle' => 'Tied van de dag waor de media veur bedoeld is', 'exif-contact' => 'Kontaktgegevens', 'exif-writer' => 'Schriever', 'exif-languagecode' => 'Taal', 'exif-iimversion' => 'IIM-versie', 'exif-iimcategory' => 'Kategorie', 'exif-iimsupplementalcategory' => 'Anvullende kategorieën', 'exif-datetimeexpires' => 'Niet te gebruken nao', 'exif-datetimereleased' => 'Uutebröcht op', 'exif-originaltransmissionref' => 'Oorspronkelike taaklokasiekode', 'exif-identifier' => 'ID', 'exif-lens' => 'Lenze die gebruukt wörden', 'exif-serialnumber' => 'Serienummer van de camera', 'exif-cameraownername' => 'Eigenaar van camera', 'exif-label' => 'Etiket', 'exif-datetimemetadata' => 'Daotum waorop de metadata veur t lest bie-ewörken bin', 'exif-nickname' => 'Informele naam van de aofbeelding', 'exif-rating' => 'Werdering (op n schaole van 5)', 'exif-rightscertificate' => 'Rechtenbeheercertificaot', 'exif-copyrighted' => 'Auteursrechtstaotus', 'exif-copyrightowner' => 'Auteursrechthouwer', 'exif-usageterms' => 'Gebruuksveurweerden', 'exif-webstatement' => 'Internetauteursrechverklaoring', 'exif-originaldocumentid' => 'Uniek ID van t originele dokument', 'exif-licenseurl' => 'Webadres veur auteursrechlisensie', 'exif-morepermissionsurl' => 'Alternatieve lisensiegegevens', 'exif-attributionurl' => 'Gebruuk de volgende verwiezing bie hergebruuk van dit wark', 'exif-preferredattributionname' => 'Gebruuk de volgende makersvermelding bie hergebruuk van dit wark', 'exif-pngfilecomment' => 'Opmarking bie PNG-bestaand', 'exif-disclaimer' => 'Veurbehoud', 'exif-contentwarning' => 'Waorschuwing over inhoud', 'exif-giffilecomment' => 'Opmarking bie GIF-bestaand', 'exif-intellectualgenre' => 'Soort onderwarp', 'exif-subjectnewscode' => 'Onderwarpcode', 'exif-scenecode' => 'IPTC-scènecode', 'exif-event' => 'Aofebeelden gebeurtenisse', 'exif-organisationinimage' => 'Aofebeelden organisasie', 'exif-personinimage' => 'Aofebeeld persoon', 'exif-originalimageheight' => 'Heugte van de aofbeelding veur biesniejen', 'exif-originalimagewidth' => 'Breedte van de aofbeelding veur biesniejen', # EXIF attributes 'exif-compression-1' => 'Niet ekomprimeerd', 'exif-compression-2' => 'CCITT-groep 3 1-dimensionale an-epasten "Huffman run length"-kodering', 'exif-compression-3' => 'CCITT-groep 3 faxcodering', 'exif-compression-4' => 'CCITT-groep 4 faxcodering', 'exif-copyrighted-true' => 'Auteursrechtelik bescharmp', 'exif-copyrighted-false' => 'Publiek domein', 'exif-unknowndate' => 'Onbekende daotum', 'exif-orientation-1' => 'Normaal', 'exif-orientation-2' => 'horizontaal espegeld', 'exif-orientation-3' => '180° edreid', 'exif-orientation-4' => 'verticaal edreid', 'exif-orientation-5' => 'espegeld um as linksboven-rechtsonder', 'exif-orientation-6' => '90° linksummedreid', 'exif-orientation-7' => '90° linksummedreid', 'exif-orientation-8' => '90° rechtsummedreid', 'exif-planarconfiguration-1' => 'Grof gegevensformaot', 'exif-planarconfiguration-2' => 'planar gegevensformaot', 'exif-colorspace-65535' => 'Niet-ekalibreerd', 'exif-componentsconfiguration-0' => 'besteet niet', 'exif-exposureprogram-0' => 'Niet umschreven', 'exif-exposureprogram-1' => 'Haandmaotig', 'exif-exposureprogram-2' => 'Normaal', 'exif-exposureprogram-3' => 'Diafragmaprioriteit', 'exif-exposureprogram-4' => 'Sluterprioriteit', 'exif-exposureprogram-5' => 'Kreatief (veurkeur veur grote scharptediepte)', 'exif-exposureprogram-6' => 'Aksie (veurkeur veur hoge slutersnelheid)', 'exif-exposureprogram-7' => 'Portret (detailopname mit onscharpe achtergrond)', 'exif-exposureprogram-8' => 'Laandschap (scharpe achtergrond)', 'exif-subjectdistance-value' => '$1 m', 'exif-meteringmode-0' => 'Onbekend', 'exif-meteringmode-1' => 'Gemiddeld', 'exif-meteringmode-2' => 'Gemiddeld, naodrok op midden', 'exif-meteringmode-3' => 'Spot', 'exif-meteringmode-4' => 'MultiSpot', 'exif-meteringmode-5' => 'Multi-segment (patrone)', 'exif-meteringmode-6' => 'Deelmeting', 'exif-meteringmode-255' => 'Aanders', 'exif-lightsource-0' => 'Onbekend', 'exif-lightsource-1' => 'Daglocht', 'exif-lightsource-2' => 'Tl-locht', 'exif-lightsource-3' => 'Tungsten (lamplocht)', 'exif-lightsource-4' => 'Flitser', 'exif-lightsource-9' => 'Mooi weer', 'exif-lightsource-10' => 'Bewolk', 'exif-lightsource-11' => 'Schaoduw', 'exif-lightsource-12' => 'Fluorescerend daglocht (D 5700 – 7100K)', 'exif-lightsource-13' => 'Witfluorescerend daglocht (N 4600 – 5400K)', 'exif-lightsource-14' => 'Koel witfluorescerend (W 3900 – 4500K)', 'exif-lightsource-15' => 'Witfluorescerend (WW 3200 – 3700K)', 'exif-lightsource-17' => 'Standardlocht A', 'exif-lightsource-18' => 'Standardlocht B', 'exif-lightsource-19' => 'Standardlocht C', 'exif-lightsource-24' => 'ISO-studiokunstlocht', 'exif-lightsource-255' => 'Aanders', # Flash modes 'exif-flash-fired-0' => 'Flits is niet aofegaon', 'exif-flash-fired-1' => 'Mit flitser', 'exif-flash-return-0' => 'flits stuurt gien gegevens', 'exif-flash-return-2' => 'gien weerkaotsing van de flits vastesteld', 'exif-flash-return-3' => 'weerkaotsing van de flits vastesteld', 'exif-flash-mode-1' => 'verplicht mit flitser', 'exif-flash-mode-2' => 'flitser verplicht onderdrokt', 'exif-flash-mode-3' => 'automatiese modus', 'exif-flash-function-1' => 'Gien flitserfunksie', 'exif-flash-redeye-1' => 'rooie ogen-filter', 'exif-focalplaneresolutionunit-2' => 'duum', 'exif-sensingmethod-1' => 'Niet vastesteld', 'exif-sensingmethod-2' => 'Eén-chip-kleursensor', 'exif-sensingmethod-3' => 'Twee-chips-kleursensor', 'exif-sensingmethod-4' => 'Dree-chips-kleurensensor', 'exif-sensingmethod-5' => 'Kleurvolgende gebiedssensor', 'exif-sensingmethod-7' => 'Dreeliendige sensor', 'exif-sensingmethod-8' => 'Kleurvolgende gebiedssensor', 'exif-filesource-3' => 'Digitale fotokamera', 'exif-scenetype-1' => 'n Drekt efotografeerden aofbeelding', 'exif-customrendered-0' => 'Normaal', 'exif-customrendered-1' => 'An-epas', 'exif-exposuremode-0' => 'Automaties', 'exif-exposuremode-1' => 'Haandmaotig', 'exif-exposuremode-2' => 'Belochtingsrie', 'exif-whitebalance-0' => 'Automaties', 'exif-whitebalance-1' => 'Haandmaotig', 'exif-scenecapturetype-0' => 'standard', 'exif-scenecapturetype-1' => 'laandschap', 'exif-scenecapturetype-2' => 'pertret', 'exif-scenecapturetype-3' => 'Nachtscène', 'exif-gaincontrol-0' => 'Gien', 'exif-gaincontrol-1' => 'Lege pieken umhoge', 'exif-gaincontrol-2' => 'Hoge pieken umhoge', 'exif-gaincontrol-3' => 'Lege pieken ummeneer', 'exif-gaincontrol-4' => 'Hoge pieken ummeneer', 'exif-contrast-0' => 'Normaal', 'exif-contrast-1' => 'Zachte', 'exif-contrast-2' => 'Hard', 'exif-saturation-0' => 'Normaal', 'exif-saturation-1' => 'Leeg', 'exif-saturation-2' => 'Hoge', 'exif-sharpness-0' => 'Normaal', 'exif-sharpness-1' => 'Zachte', 'exif-sharpness-2' => 'Hard', 'exif-subjectdistancerange-0' => 'Onbekend', 'exif-subjectdistancerange-1' => 'Macro', 'exif-subjectdistancerange-2' => 'Kortbie', 'exif-subjectdistancerange-3' => 'Veeraof', # Pseudotags used for GPSLatitudeRef and GPSDestLatitudeRef 'exif-gpslatitude-n' => 'Noorderbreedte', 'exif-gpslatitude-s' => 'Zujerbreedte', # Pseudotags used for GPSLongitudeRef and GPSDestLongitudeRef 'exif-gpslongitude-e' => 'Oosterlengte', 'exif-gpslongitude-w' => 'Westerlengte', # Pseudotags used for GPSAltitudeRef 'exif-gpsaltitude-above-sealevel' => '$1 {{PLURAL:$1|meter|meter}} boven de zeespegel', 'exif-gpsaltitude-below-sealevel' => '$1 {{PLURAL:$1|meter|meter}} onder de zeespegel', 'exif-gpsstatus-a' => 'Bezig mit meten', 'exif-gpsstatus-v' => 'Meetinteroperebiliteit', 'exif-gpsmeasuremode-2' => '2-dimensionale meting', 'exif-gpsmeasuremode-3' => '3-dimensionale meting', # Pseudotags used for GPSSpeedRef 'exif-gpsspeed-k' => 'Kilometer per uur', 'exif-gpsspeed-m' => 'Miel per ure', 'exif-gpsspeed-n' => 'Kneupen', # Pseudotags used for GPSDestDistanceRef 'exif-gpsdestdistance-k' => 'Kilometer', 'exif-gpsdestdistance-m' => 'Miel', 'exif-gpsdestdistance-n' => 'Zeemielen', 'exif-gpsdop-excellent' => 'Uutstekend ($1)', 'exif-gpsdop-good' => 'Goed ($1)', 'exif-gpsdop-moderate' => 'Gemiddeld ($1)', 'exif-gpsdop-fair' => 'Redelik ($1)', 'exif-gpsdop-poor' => 'Slicht ($1)', 'exif-objectcycle-a' => 'Allinnig smarnens', 'exif-objectcycle-p' => 'Allinnig savends', 'exif-objectcycle-b' => "'s Mannen én 's avens", # Pseudotags used for GPSTrackRef, GPSImgDirectionRef and GPSDestBearingRef 'exif-gpsdirection-t' => 'Waore richting', 'exif-gpsdirection-m' => 'Magnetiese richting', 'exif-ycbcrpositioning-1' => 'In t midden', 'exif-ycbcrpositioning-2' => 'E-kositueerd', 'exif-dc-contributor' => 'Luui die bie-edreugen hebben', 'exif-dc-coverage' => 'Ruumtelike of temporele reikwiedte van media', 'exif-dc-date' => 'Daotum(s)', 'exif-dc-publisher' => 'Uutgever', 'exif-dc-relation' => 'Verwaante media', 'exif-dc-rights' => 'Rechten', 'exif-dc-source' => 'Bronmedia', 'exif-dc-type' => 'Soort media', 'exif-rating-rejected' => 'Aofewezen', 'exif-isospeedratings-overflow' => 'Groter as 65535', 'exif-iimcategory-ace' => 'Kunst, kultuur en vermaak', 'exif-iimcategory-clj' => 'Misdaod en recht', 'exif-iimcategory-dis' => 'Rampen en ongevallen', 'exif-iimcategory-fin' => 'Ekonomie en bedriefsleven', 'exif-iimcategory-edu' => 'Onderwies', 'exif-iimcategory-evn' => 'Milieu', 'exif-iimcategory-hth' => 'Gezondheid', 'exif-iimcategory-hum' => 'Meenselike interesse', 'exif-iimcategory-lab' => 'Arbeid', 'exif-iimcategory-lif' => 'Levensstiel en vrieje tied', 'exif-iimcategory-pol' => 'Politiek', 'exif-iimcategory-rel' => 'Godsdienst en overtuging', 'exif-iimcategory-sci' => 'Wetenschap en technologie', 'exif-iimcategory-soi' => 'Sosiale kwesties', 'exif-iimcategory-spo' => 'Sport', 'exif-iimcategory-war' => 'Oorlog, armoe en onrust', 'exif-iimcategory-wea' => 'Weer', 'exif-urgency-normal' => 'Normaal ($1)', 'exif-urgency-low' => 'Leeg ($1)', 'exif-urgency-high' => 'Hoog ($1)', 'exif-urgency-other' => 'Deur gebruker in-estelde prioriteit ($1)', # External editor support 'edit-externally' => 'Wiezig dit bestaand mit n extern programma', 'edit-externally-help' => '(Zie de [//www.mediawiki.org/wiki/Manual:External_editors installasie-instruksies] veur meer informasie)', # 'all' in various places, this might be different for inflected languages 'watchlistall2' => 'alles', 'namespacesall' => 'alles', 'monthsall' => 'alles', 'limitall' => 'alles', # E-mail address confirmation 'confirmemail' => 'Bevestig netpostadres', 'confirmemail_noemail' => 'Je hebben gien geldig netpostadres in-evoerd in joew [[Special:Preferences|veurkeuren]].', 'confirmemail_text' => "Bie disse wiki mö'j je netpostadres bevestigen veurda'j de berichtopsies gebruken kunnen. Klik op de onderstaonde knoppe um n bevestigingsbericht te ontvangen. In dit bericht zit n kode mit n verwiezing; um je netpostadres te bevestigen mö'j disse verwiezing los doon.", 'confirmemail_pending' => "Der is al n bevestigingskode op-estuurd; a'j net n gebrukersnaam an-emaakt hebben, wacht dan eerst n paor minuten tot da'j dit bericht ontvöngen hebben veurda'j n nieje kode anvragen.", 'confirmemail_send' => 'Stuur n bevestigingskode', 'confirmemail_sent' => 'Bevestigingsbericht verstuurd.', 'confirmemail_oncreate' => "n Bevestigingskode is naor joew netpostadres verstuurd. Disse kode is niet neudig um an te melden, mer je mutten t wel bevestigen veurda'j de netpostmeugelikheen van disse wiki gebruken kunnen.", 'confirmemail_sendfailed' => '{{SITENAME}} kon joe gien bevestigingskode toesturen. Kontroleer joew netpostadres op ongeldige tekens. Fout bie t versturen: $1', 'confirmemail_invalid' => 'Ongeldige bevestigingskode. De kode kan verlopen ween.', 'confirmemail_needlogin' => 'Je mutten $1 um joew netpostadres te bevestigen.', 'confirmemail_success' => 'Joew netpostadres is bevestigd. Je kunnen noen [[Special:UserLogin|anmelden]] en {{SITENAME}} gebruken.', 'confirmemail_loggedin' => 'Joew netpostadres is noen bevestig.', 'confirmemail_error' => 'Der is iets fout egaon bie t opslaon van joew bevestiging.', 'confirmemail_subject' => 'Bevestiging netpostadres veur {{SITENAME}}', 'confirmemail_body' => 'Ene mit IP-adres $1, warschienlik jie zelf, hef zien eigen mit dit netpostadres eregistreerd as de gebruker "$2" op {{SITENAME}}. Klik op de volgende verwiezing um te bevestigen da\'jie disse gebruker bin en um de netpostmeugelikheen op {{SITENAME}} te aktiveren: $3 A\'j joe eigen *niet* an-emeld hebben, klik dan niet op disse verwiezing um de bevestiging van joew netpostadres aof te breken: $5 De bevestigingskode zal verlopen op $4.', 'confirmemail_body_changed' => 'Ene mit IP-adres $1, warschienlik jie zelf, hef zien eigen mit dit netpostadres eregistreerd as de gebruker "$2" op {{SITENAME}}. Klik op de volgende verwiezing um te bevestigen da\'jie disse gebruker bin en um de netpostmeugelikheen op {{SITENAME}} te aktiveren: $3 A\'j joe eigen *niet* an-emeld hebben, klik dan niet op disse verwiezing um de bevestiging van joew netpostadres aof te breken: $5 De bevestigingskode zal verlopen op $4.', 'confirmemail_body_set' => 'Ene mit IP-adres $1, warschienlik jie zelf, hef zien eigen mit dit netpostadres eregistreerd as de gebruker "$2" op {{SITENAME}}. Klik op de volgende verwiezing um te bevestigen da\'jie disse gebruker bin en um de netpostmeugelikheen op {{SITENAME}} te aktiveren: $3 A\'j joe eigen *niet* an-emeld hebben, klik dan niet op disse verwiezing um de bevestiging van joew netpostadres of te zegen: $5 De bevestigingskode zal verlopen op $4.', 'confirmemail_invalidated' => 'De netpostbevestiging is aofebreuken', 'invalidateemail' => 'Netpostbevestiging ofbreken', # Scary transclusion 'scarytranscludedisabled' => '[Interwiki-intergrasie is uuteschakeld]', 'scarytranscludefailed' => '[De mal $1 kon niet op-ehaold wörden]', 'scarytranscludetoolong' => '[URL is te lang]', # Trackbacks 'trackbackbox' => 'Trackbacks veur disse pagina:<br /> $1', 'trackbackremove' => '([$1 vortdoon])', 'trackbacklink' => 'Trackback', 'trackbackdeleteok' => 'De trackback is vortedaon.', # Delete conflict 'deletedwhileediting' => "'''Waorschuwing''': disse pagina is vortedaon terwiel jie t an t bewarken waren!", 'confirmrecreate' => "Gebruker [[User:$1|$1]] ([[User talk:$1|Overleg]]) hef disse pagina vortedaon naoda'j begunnen bin mit joew wieziging, mit opgave van de volgende reden: ''$2''. Bevestig da'j t artikel herschrieven willen.", 'confirmrecreate-noreason' => "Gebruker [[User:$1|$1]] ([[User talk:$1|overleg]]) hef disse pagina vortedaon naoda'j begunnen bin mit joew wieziging. Bevestig da'j t artikel herschrieven willen.", 'recreate' => 'Herschrieven', # action=purge 'confirm_purge_button' => 'Bevestig', 'confirm-purge-top' => "Klik op 'bevestig' um t tussengeheugen van disse pagina te legen.", 'confirm-purge-bottom' => "t leegmaken van t tussengeheugen zörgt derveur da'j de leste versie van n pagina zien.", # action=watch/unwatch 'confirm-watch-button' => 'Oké', 'confirm-watch-top' => 'Disse pagina op joew volglieste zetten?', 'confirm-unwatch-button' => 'Oké', 'confirm-unwatch-top' => 'Disse pagina van joew volglieste aofhaolen?', # Multipage image navigation 'imgmultipageprev' => '&larr; veurige', 'imgmultipagenext' => 'volgende &rarr;', 'imgmultigo' => 'Oké', 'imgmultigoto' => 'Gao naor de pagina $1', # Table pager 'ascending_abbrev' => 'aofl.', 'descending_abbrev' => 'opl.', 'table_pager_next' => 'Volgende', 'table_pager_prev' => 'Veurige', 'table_pager_first' => 'Eerste pagina', 'table_pager_last' => 'Leste pagina', 'table_pager_limit' => 'Laot $1 onderwarpen per pagina zien', 'table_pager_limit_label' => 'Onderwarpen per pagina:', 'table_pager_limit_submit' => 'Zeuk', 'table_pager_empty' => 'Gien resultaoten', # Auto-summaries 'autosumm-blank' => 'Pagina leegemaakt', 'autosumm-replace' => "Tekste vervöngen deur '$1'", 'autoredircomment' => 'deurverwiezing naor [[$1]]', 'autosumm-new' => "Nieje pagina: '$1'", # Live preview 'livepreview-loading' => 'An t laojen…', 'livepreview-ready' => 'An t laojen… ree!', 'livepreview-failed' => 'Rechtstreeks naokieken is niet meugelik! Kiek de pagina op de normale maniere nao.', 'livepreview-error' => 'Verbiending niet meugelik: $1 "$2" Kiek de pagina op de normale maniere nao.', # Friendlier slave lag warnings 'lag-warn-normal' => 'Wiezigingen die niejer bin as $1 {{PLURAL:$1|seconde|seconden}} staon misschien nog niet in de lieste.', 'lag-warn-high' => 'De databanke is aorig zwaor belast. Wiezigingen die niejer bin as $1 {{PLURAL:$1|sekonde|sekonden}} staon daorumme misschien nog niet in de lieste.', # Watchlist editor 'watchlistedit-numitems' => "Der {{PLURAL:$1|steet 1 pagina|staon $1 pagina's}} op joew volglieste, zonder overlegpagina's.", 'watchlistedit-noitems' => 'Joew volglieste is leeg.', 'watchlistedit-normal-title' => 'Volglieste bewarken', 'watchlistedit-normal-legend' => "Disse pagina's van mien volglieste aofhaolen.", 'watchlistedit-normal-explain' => "Pagina's die op joew volglieste staon, zie'j hieronder. Um n pagina van joew volglieste aof te haolen mö'j t vakjen dernaost anklikken, en klik dan op \"{{int:Watchlistedit-normal-submit}}\". Je kunnen oek [[Special:EditWatchlist/raw|de roewe lieste bewarken]].", 'watchlistedit-normal-submit' => "Pagina's deraof haolen", 'watchlistedit-normal-done' => "Der {{PLURAL:$1|is 1 pagina|bin $1 pagina's}} vortedaon uut joew volglieste:", 'watchlistedit-raw-title' => 'Roewe volglieste bewarken', 'watchlistedit-raw-legend' => 'Roewe volglieste bewarken', 'watchlistedit-raw-explain' => "Pagina's die op joew volglieste staon, zie'j hieronder. Je kunnen de lieste bewarken deur pagina's deruut vort te haolen en derbie te te zetten. Eén pagina per regel. A'j klaor bin, klik dan op \"{{int:Watchlistedit-raw-submit}}\". Je kunnen oek [[Special:EditWatchlist|t standardbewarkingsscharm gebruken]].", 'watchlistedit-raw-titles' => 'Titels:', 'watchlistedit-raw-submit' => 'Volglieste biewarken', 'watchlistedit-raw-done' => 'Joew volglieste is bie-ewörken.', 'watchlistedit-raw-added' => "Der {{PLURAL:$1|is 1 pagina|bin $1 pagina's}} bie edaon:", 'watchlistedit-raw-removed' => "Der {{PLURAL:$1|is 1 pagina|bin $1 pagina's}} vortedaon:", # Watchlist editing tools 'watchlisttools-view' => 'Wiezigingen bekieken', 'watchlisttools-edit' => 'Volglieste bekieken en bewarken', 'watchlisttools-raw' => 'Roewe volglieste bewarken', # Core parser functions 'unknown_extension_tag' => 'Onbekende tag "$1"', 'duplicate-defaultsort' => 'Waorschuwing: de standardsortering "$2" krig veurrang veur de sortering "$1".', # Special:Version 'version' => 'Versie', 'version-extensions' => 'Uutbreidingen die installeerd bin', 'version-specialpages' => "Spesiale pagina's", 'version-parserhooks' => 'Parserhoeken', 'version-variables' => 'Variabels', 'version-antispam' => 'Veurkoemen van ongewunste bewarkingen', 'version-skins' => 'Vormgevingen', 'version-api' => 'Api', 'version-other' => 'Overige', 'version-mediahandlers' => 'Mediaverwarkers', 'version-hooks' => 'Hoeken', 'version-extension-functions' => 'Uutbreidingsfunksies', 'version-parser-extensiontags' => 'Parseruutbreidingsplaotjes', 'version-parser-function-hooks' => 'Parserfunksiehoeken', 'version-hook-name' => 'Hooknaam', 'version-hook-subscribedby' => 'In-eschreven deur', 'version-version' => '(Versie $1)', 'version-license' => 'Lisensie', 'version-poweredby-credits' => "Disse wiki wörden an-estuurd deur '''[//www.mediawiki.org/ MediaWiki]''', auteursrecht © 2001-$1 $2.", 'version-poweredby-others' => 'aanderen', 'version-license-info' => 'MediaWiki is vrieje programmatuur; je kunnen MediaWiki verspreien en/of anpassen onder de veurweerden van de GNU General Public License zo as epubliceerd deur de Free Software Foundation; of versie 2 van de Lisensie, of - naor eigen wuns - n laotere versie. MediaWiki wörden verspreid in de hoop dat t nuttig is, mer ZONDER ENIGE GARANSIE; zonder zelfs de daoronder begrepen garansie van VERKOOPBAORHEID of GESCHIKTHEID VEUR ENIG DOEL IN T BIEZUNDER. Zie de GNU General Public License veur meer informasie. Samen mit dit programma heur je n [{{SERVER}}{{SCRIPTPATH}}/COPYING kopie van de GNU General Public License] te hebben ekregen; as dat niet zo is, schrief dan naor de Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA of [//www.gnu.org/licenses/old-licenses/gpl-2.0.html lees de lisensie op t internet].', 'version-software' => 'Programmatuur die installeerd is', 'version-software-product' => 'Produkt', 'version-software-version' => 'Versie', # Special:FilePath 'filepath' => 'Bestaandslokasie', 'filepath-page' => 'Bestaand:', 'filepath-submit' => 'Zeuken', 'filepath-summary' => 'Disse spesiale pagina geef t hele pad veur n bestaand. Aofbeeldingen wörden in resolusie helemaole weeregeven. Aandere bestaandstypen wörden gelieke in t mit t MIME-type verbunnen programma opend.', # Special:FileDuplicateSearch 'fileduplicatesearch' => 'Dubbele bestaanden zeuken', 'fileduplicatesearch-summary' => 'Dubbele bestaanden zeuken op baosis van de hashweerde.', 'fileduplicatesearch-legend' => 'Dubbele bestaanden zeuken', 'fileduplicatesearch-filename' => 'Bestaandsnaam:', 'fileduplicatesearch-submit' => 'Zeuken', 'fileduplicatesearch-info' => '$1 × $2 beeldpunten<br />Bestaandsgrootte: $3<br />MIME-type: $4', 'fileduplicatesearch-result-1' => 'Der bin gien bestaanden die liek alleens bin as "$1".', 'fileduplicatesearch-result-n' => 'Der {{PLURAL:$2|is één bestaand|bin $2 bestaanden}} die liek alleens bin as "$1".', 'fileduplicatesearch-noresults' => 'Der is gien bestaand mit de naam "$1" evunnen.', # Special:SpecialPages 'specialpages' => "Spesiale pagina's", 'specialpages-note' => '---- * Normale spesiale pagina\'s. * <strong class="mw-specialpagerestricted">Beparkt toegankelike spesiale pagina\'s.</strong> * <span class="mw-specialpagecached">Spesiale pagina\'s mit allinnig gegevens uut t tussengeheugen (kunnen verouwerd ween).</span>', 'specialpages-group-maintenance' => 'Onderhoudsliesten', 'specialpages-group-other' => "Overige spesiale pagina's", 'specialpages-group-login' => 'Anmelden / inschrieven', 'specialpages-group-changes' => 'Leste wiezigingen en logboeken', 'specialpages-group-media' => 'Media-overzichten en nieje bestaanden', 'specialpages-group-users' => 'Gebrukers en rechten', 'specialpages-group-highuse' => "Veulgebruukten pagina's", 'specialpages-group-pages' => 'Paginaliesten', 'specialpages-group-pagetools' => 'Paginahulpmiddels', 'specialpages-group-wiki' => 'Wikigegevens en -hulpmiddels', 'specialpages-group-redirects' => "Deurverwiezende spesiale pagina's", 'specialpages-group-spam' => 'Hulpmiddels tegen ongewunste bewarkingen', # Special:BlankPage 'blankpage' => 'Lege pagina', 'intentionallyblankpage' => 'Disse pagina is bewust leeg eleuten.', # External image whitelist 'external_image_whitelist' => ' #Laot disse regel onveraanderd<pre> #Hieronder kunnen delen van reguliere uutdrokkingen (t deel tussen //) an-egeven wörden. #t Wörden mit de webadressen van aofbeeldingen uut bronnen van butenof vergeleken #n Positief vergeliekingsresultaot zörgt derveur dat de aofbeelding weeregeven wörden, aanders wörden de aofbeelding allinnig as verwiezing weeregeven #Regels die mit n # beginnen, wörden as kommentaar behaandeld #De regels in de lieste bin niet heufdlettergeveulig #Delen van reguliere uutdrokkingen boven disse regel plaotsen. Laot disse regel onveraanderd</pre>', # Special:Tags 'tags' => 'Geldige wiezigingsetiketten', 'tag-filter' => '[[Special:Tags|Etiketfilter]]:', 'tag-filter-submit' => 'Filtreren', 'tags-title' => 'Etiket', 'tags-intro' => 'Op disse pagina staon de etiketten waormee de programmatuur elke bewarking kan markeren, en de betekenisse dervan.', 'tags-tag' => 'Etiketnaam', 'tags-display-header' => 'Weergave in wiezigingsliesten', 'tags-description-header' => 'Beschrieving van de betekenisse', 'tags-hitcount-header' => 'Bewarkingen mit etiket', 'tags-edit' => 'bewarking', 'tags-hitcount' => '$1 {{PLURAL:$1|wieziging|wiezigingen}}', # Special:ComparePages 'comparepages' => "Pagina's vergelieken", 'compare-selector' => 'Paginaversies vergelieken', 'compare-page1' => 'Pagina 1', 'compare-page2' => 'Pagina 2', 'compare-rev1' => 'Versie 1', 'compare-rev2' => 'Versie 2', 'compare-submit' => 'Vergelieken', # Database error messages 'dberr-header' => 'Disse wiki hef n probleem', 'dberr-problems' => 't Spiet ons, mer disse webstee hef op t moment wat techniese problemen.', 'dberr-again' => 'Wach n paor minuten en probeer t daornao opniej.', 'dberr-info' => '(Kan gien verbiending maken mit de databankeserver: $1)', 'dberr-usegoogle' => "Misschien ku'j ondertussen zeuken via Google.", 'dberr-outofdate' => "Let op: indexen die zee hebben van onze pagina's bin misschien niet aktueel.", 'dberr-cachederror' => 'Disse pagina is n kopie uut t tussengeheugen en is misschien niet aktueel.', # HTML forms 'htmlform-invalid-input' => 'Der bin problemen mit n paor in-egeven weerden', 'htmlform-select-badoption' => 'De in-egeven weerde is ongeldig.', 'htmlform-int-invalid' => 'De in-egeven weerde is gien geheel getal.', 'htmlform-float-invalid' => "De weerde die'j op-egeven hebben is gien getal.", 'htmlform-int-toolow' => 'De in-egeven weerde lig onder de minimumweerde van $1', 'htmlform-int-toohigh' => 'De in-egeven weerde lig boven de maximumweerde van $1', 'htmlform-required' => 'Disse weerde is verplicht', 'htmlform-submit' => 'Opslaon', 'htmlform-reset' => 'Wiezigingen ongedaonmaken', 'htmlform-selectorother-other' => 'Aanders', # SQLite database support 'sqlite-has-fts' => 'Versie $1 mit ondersteuning veur "full-text" zeuken', 'sqlite-no-fts' => 'Versie $1 zonder ondersteuning veur "full-text" zeuken', );
b00027304/Wiki
languages/messages/MessagesNds_nl.php
PHP
gpl-2.0
242,204
<?php $LDHeadlines='Headlines'; $LDCafeNews='Cafeteria News'; $LDManagement='Management'; $LDHealthTips='Health Tips'; $LDEducation='Education'; $LDStudies='Studies'; $LDExhibitions='Exhibitions'; $LDHeadline='Headline'; $LDAdmission='Admission'; /* 2003-08-20 DH */ $LDAllDoctors='List of all doctors'; $LDAnesthesiology='Anesthesiology'; $LDCafeteria='Cafeteria News'; $LDGeneralSurgery='General Surgery'; $LDEmergencySurgery='Emergency Surgery'; $LDPlasticSurgery='Plastic Surgery'; $LDEarNoseThroath='Ear-Nose-Throat'; $LDOpthalmology='Ophthalmology'; $LDPathology='Pathology'; $LDObGynecology='Ob-Gynecology'; $LDPhysicalTherapy='Physical Therapy'; $LDInternalMedicine='Internal Medicine'; $LDIntermediateCareUnit='Intermediate Care Unit'; $LDIntensiveCareUnit='Intensive Care Unit'; $LDEmergencyAmbulatory='Emergency Ambulatory'; $LDInternalMedicineAmbulatory='Internal Medicine Ambulatory'; $LDSonography='Sonography'; $LDNuclearDiagnostics='Nuclear Diagnostics'; $LDPediatric='Pediatric clinic'; $LDOncology='Oncology'; $LDNeonatal='Neonatal'; $LDCentralLaboratory='Central Laboratory'; $LDSerologicalLaboratory='Serological Laboratory'; $LDChemicalLaboratory='Chemical Laboratory'; $LDBacteriologicalLaboratory='Bacteriological Laboratory'; $LDTechnicalMaintenance='Technical Maintenance'; $LDITDepartment='IT Department'; $LDGeneralAmbulatory='General Ambulatory'; $LDBloodBank='Blood Bank'; $LDNursing='Nursing'; /* 2003-04-27 EL */ $LDMedical='Medical'; $LDSupport='Non-medical'; $LDNews='News'; $LDDepartment='Department'; $LDPressRelations='Press'; /* 2003-05-19 EL */ $LDSelectDept='Select department'; /*2003-06-15 EL*/ $LDPlsSelectDept='Please select a department'; $LD_AllMedicalDept='____All medical departments_____'; $LDClinic='Clinic'; #2003-10-23 EL $LDPlsNameFormal='Please enter the formal name'; $LDPlsDeptID='Please enter the department\'s ID'; $LDPlsSelectType='Please select the type'; #2006-09-13 d.r. from merotech $LDARVClinic='ARV Clinic'; $LDDentalClinic='Dental Clinic'; $LDGeneralOutpatientClinic='General Outpatient Clinic'; $LDAAR = 'AAR'; ?>
timschofield/care2x
language/en/lang_en_departments.php
PHP
gpl-2.0
2,086
/* * log.c * * This file is part of libnetmd, a library for accessing Sony NetMD devices. * * Copyright (C) 2004 Bertrik Sikken * Copyright (C) 2011 Alexander Sulfrian * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include <stdio.h> #include <stdarg.h> #include "log.h" static netmd_loglevel trace_level = 0; void netmd_set_log_level(netmd_loglevel level) { trace_level = level; } void netmd_log_hex(netmd_loglevel level, const unsigned char* const buf, const size_t len) { size_t i; size_t j = 0; int breakpoint = 0; if (level > trace_level) { return; } for (i = 0; i < len; i++) { printf("%02x ", buf[i] & 0xff); breakpoint++; if(!((i + 1)%16) && i) { printf("\t\t"); for(j = ((i+1) - 16); j < ((i+1)/16) * 16; j++) { if(buf[j] < 30) printf("."); else printf("%c", buf[j]); } printf("\n"); breakpoint = 0; } } if(breakpoint == 16) { printf("\n"); return; } for(; breakpoint < 16; breakpoint++) { printf(" "); } printf("\t\t"); for(j = len - (len%16); j < len; j++) { if(buf[j] < 30) printf("."); else printf("%c", buf[j]); } printf("\n"); } void netmd_log(netmd_loglevel level, const char* const fmt, ...) { va_list arg; if (level > trace_level) { return; } va_start(arg, fmt); vprintf(fmt, arg); va_end(arg); }
glaubitz/linux-minidisc-debian
libnetmd/log.c
C
gpl-2.0
2,310
<a href='https://github.com/angular/angular.js/edit/v1.4.x/src/ng/directive/ngShowHide.js?message=docs(ngHide)%3A%20describe%20your%20change...#L179' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a> <a href='https://github.com/angular/angular.js/tree/v1.4.5/src/ng/directive/ngShowHide.js#L179' class='view-source pull-right btn btn-primary'> <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source </a> <header class="api-profile-header"> <h1 class="api-profile-header-heading">ngHide</h1> <ol class="api-profile-header-structure naked-list step-list"> <li> - directive in module <a href="api/ng">ng</a> </li> </ol> </header> <div class="api-profile-description"> <p>The <code>ngHide</code> directive shows or hides the given HTML element based on the expression provided to the <code>ngHide</code> attribute. The element is shown or hidden by removing or adding the <code>ng-hide</code> CSS class onto the element. The <code>.ng-hide</code> CSS class is predefined in AngularJS and sets the display style to none (using an !important flag). For CSP mode please add <code>angular-csp.css</code> to your html file (see <a href="api/ng/directive/ngCsp">ngCsp</a>).</p> <pre><code class="lang-html">&lt;!-- when $scope.myValue is truthy (element is hidden) --&gt; &lt;div ng-hide=&quot;myValue&quot; class=&quot;ng-hide&quot;&gt;&lt;/div&gt; &lt;!-- when $scope.myValue is falsy (element is visible) --&gt; &lt;div ng-hide=&quot;myValue&quot;&gt;&lt;/div&gt; </code></pre> <p>When the <code>ngHide</code> expression evaluates to a truthy value then the <code>.ng-hide</code> CSS class is added to the class attribute on the element causing it to become hidden. When falsy, the <code>.ng-hide</code> CSS class is removed from the element causing the element not to appear hidden.</p> <h2 id="why-is-important-used-">Why is !important used?</h2> <p>You may be wondering why !important is used for the <code>.ng-hide</code> CSS class. This is because the <code>.ng-hide</code> selector can be easily overridden by heavier selectors. For example, something as simple as changing the display style on a HTML list item would make hidden elements appear visible. This also becomes a bigger issue when dealing with CSS frameworks.</p> <p>By using !important, the show and hide behavior will work as expected despite any clash between CSS selector specificity (when !important isn&#39;t used with any conflicting styles). If a developer chooses to override the styling to change how to hide an element then it is just a matter of using !important in their own CSS code.</p> <h3 id="overriding-ng-hide-">Overriding <code>.ng-hide</code></h3> <p>By default, the <code>.ng-hide</code> class will style the element with <code>display: none!important</code>. If you wish to change the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the <code>.ng-hide</code> class in CSS:</p> <pre><code class="lang-css">.ng-hide { /* this is just another form of hiding an element */ display: block!important; position: absolute; top: -9999px; left: -9999px; } </code></pre> <p>By default you don&#39;t need to override in CSS anything and the animations will work around the display style.</p> <h2 id="a-note-about-animations-with-nghide-">A note about animations with <code>ngHide</code></h2> <p>Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression is true and false. This system works like the animation system present with ngClass, except that the <code>.ng-hide</code> CSS class is added and removed for you instead of your own CSS class.</p> <pre><code class="lang-css">// //a working example can be found at the bottom of this page // .my-element.ng-hide-add, .my-element.ng-hide-remove { transition: 0.5s linear all; } .my-element.ng-hide-add { ... } .my-element.ng-hide-add.ng-hide-add-active { ... } .my-element.ng-hide-remove { ... } .my-element.ng-hide-remove.ng-hide-remove-active { ... } </code></pre> <p>Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display property to block during animation states--ngAnimate will handle the style toggling automatically for you.</p> </div> <div> <h2>Directive Info</h2> <ul> <li>This directive executes at priority level 0.</li> <li>This directive can be used as <a href="api/ng/service/$compile#-multielement-">multiElement</a></li> </ul> <h2 id="usage">Usage</h2> <div class="usage"> <ul> <li>as attribute: <pre><code>&lt;ANY&#10; ng-hide=&quot;expression&quot;&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre> </li> </div> <h2 id="animations">Animations</h2> <p>removeClass: <code>.ng-hide</code> - happens after the <code>ngHide</code> expression evaluates to a truthy value and just before the contents are set to hidden addClass: <code>.ng-hide</code> - happens after the <code>ngHide</code> expression evaluates to a non truthy value and just before the contents are set to visible</p> <a href="api/ngAnimate/service/$animate">Click here</a> to learn more about the steps involved in the animation. <section class="api-section"> <h3>Arguments</h3> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> ngHide </td> <td> <a href="" class="label type-hint type-hint-expression">expression</a> </td> <td> <p>If the <a href="guide/expression">expression</a> is truthy then the element is shown or hidden respectively.</p> </td> </tr> </tbody> </table> </section> <h2 id="example">Example</h2><p> <div> <a ng-click="openPlunkr('examples/example-example92', $event)" class="btn pull-right"> <i class="glyphicon glyphicon-edit">&nbsp;</i> Edit in Plunker</a> <div class="runnable-example" path="examples/example-example92" module="ngAnimate" deps="angular-animate.js" animations="true"> <div class="runnable-example-file" name="index.html" language="html" type="html"> <pre><code>Click me: &lt;input type=&quot;checkbox&quot; ng-model=&quot;checked&quot; aria-label=&quot;Toggle ngShow&quot;&gt;&lt;br/&gt;&#10;&lt;div&gt;&#10; Show:&#10; &lt;div class=&quot;check-element animate-hide&quot; ng-show=&quot;checked&quot;&gt;&#10; &lt;span class=&quot;glyphicon glyphicon-thumbs-up&quot;&gt;&lt;/span&gt; I show up when your checkbox is checked.&#10; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div&gt;&#10; Hide:&#10; &lt;div class=&quot;check-element animate-hide&quot; ng-hide=&quot;checked&quot;&gt;&#10; &lt;span class=&quot;glyphicon glyphicon-thumbs-down&quot;&gt;&lt;/span&gt; I hide when your checkbox is checked.&#10; &lt;/div&gt;&#10;&lt;/div&gt;</code></pre> </div> <div class="runnable-example-file" name="glyphicons.css" language="css" type="css"> <pre><code>@import url(../../components/bootstrap-3.1.1/css/bootstrap.css);</code></pre> </div> <div class="runnable-example-file" name="animations.css" language="css" type="css"> <pre><code>.animate-hide {&#10; transition: all linear 0.5s;&#10; line-height: 20px;&#10; opacity: 1;&#10; padding: 10px;&#10; border: 1px solid black;&#10; background: white;&#10;}&#10;&#10;.animate-hide.ng-hide {&#10; line-height: 0;&#10; opacity: 0;&#10; padding: 0 10px;&#10;}&#10;&#10;.check-element {&#10; padding: 10px;&#10; border: 1px solid black;&#10; background: white;&#10;}</code></pre> </div> <div class="runnable-example-file" name="protractor.js" type="protractor" language="js"> <pre><code>var thumbsUp = element(by.css(&#39;span.glyphicon-thumbs-up&#39;));&#10;var thumbsDown = element(by.css(&#39;span.glyphicon-thumbs-down&#39;));&#10;&#10;it(&#39;should check ng-show / ng-hide&#39;, function() {&#10; expect(thumbsUp.isDisplayed()).toBeFalsy();&#10; expect(thumbsDown.isDisplayed()).toBeTruthy();&#10;&#10; element(by.model(&#39;checked&#39;)).click();&#10;&#10; expect(thumbsUp.isDisplayed()).toBeTruthy();&#10; expect(thumbsDown.isDisplayed()).toBeFalsy();&#10;});</code></pre> </div> <iframe class="runnable-example-frame" src="examples/example-example92/index.html" name="example-example92"></iframe> </div> </div> </p> </div>
coboye/dashboard
src/libs/angular/docs/partials/api/ng/directive/ngHide.html
HTML
gpl-2.0
8,606
/* * arch/arm/mach-tegra/dma.c * * System DMA driver for NVIDIA Tegra SoCs * * Copyright (c) 2008-2009, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <linux/io.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/spinlock.h> #include <linux/err.h> #include <linux/irq.h> #include <linux/delay.h> #include <linux/clk.h> #include <mach/dma.h> #include <mach/irqs.h> #include <mach/iomap.h> #include <mach/suspend.h> #define APB_DMA_GEN 0x000 #define GEN_ENABLE (1<<31) #define APB_DMA_CNTRL 0x010 #define APB_DMA_IRQ_MASK 0x01c #define APB_DMA_IRQ_MASK_SET 0x020 #define APB_DMA_CHAN_CSR 0x000 #define CSR_ENB (1<<31) #define CSR_IE_EOC (1<<30) #define CSR_HOLD (1<<29) #define CSR_DIR (1<<28) #define CSR_ONCE (1<<27) #define CSR_FLOW (1<<21) #define CSR_REQ_SEL_SHIFT 16 #define CSR_REQ_SEL_MASK (0x1F<<CSR_REQ_SEL_SHIFT) #define CSR_WCOUNT_SHIFT 2 #define CSR_WCOUNT_MASK 0xFFFC #define APB_DMA_CHAN_STA 0x004 #define STA_BUSY (1<<31) #define STA_ISE_EOC (1<<30) #define STA_HALT (1<<29) #define STA_PING_PONG (1<<28) #define STA_COUNT_SHIFT 2 #define STA_COUNT_MASK 0xFFFC #define APB_DMA_CHAN_AHB_PTR 0x010 #define APB_DMA_CHAN_AHB_SEQ 0x014 #define AHB_SEQ_INTR_ENB (1<<31) #define AHB_SEQ_BUS_WIDTH_SHIFT 28 #define AHB_SEQ_BUS_WIDTH_MASK (0x7<<AHB_SEQ_BUS_WIDTH_SHIFT) #define AHB_SEQ_BUS_WIDTH_8 (0<<AHB_SEQ_BUS_WIDTH_SHIFT) #define AHB_SEQ_BUS_WIDTH_16 (1<<AHB_SEQ_BUS_WIDTH_SHIFT) #define AHB_SEQ_BUS_WIDTH_32 (2<<AHB_SEQ_BUS_WIDTH_SHIFT) #define AHB_SEQ_BUS_WIDTH_64 (3<<AHB_SEQ_BUS_WIDTH_SHIFT) #define AHB_SEQ_BUS_WIDTH_128 (4<<AHB_SEQ_BUS_WIDTH_SHIFT) #define AHB_SEQ_DATA_SWAP (1<<27) #define AHB_SEQ_BURST_MASK (0x7<<24) #define AHB_SEQ_BURST_1 (4<<24) #define AHB_SEQ_BURST_4 (5<<24) #define AHB_SEQ_BURST_8 (6<<24) #define AHB_SEQ_DBL_BUF (1<<19) #define AHB_SEQ_WRAP_SHIFT 16 #define AHB_SEQ_WRAP_MASK (0x7<<AHB_SEQ_WRAP_SHIFT) #define APB_DMA_CHAN_APB_PTR 0x018 #define APB_DMA_CHAN_APB_SEQ 0x01c #define APB_SEQ_BUS_WIDTH_SHIFT 28 #define APB_SEQ_BUS_WIDTH_MASK (0x7<<APB_SEQ_BUS_WIDTH_SHIFT) #define APB_SEQ_BUS_WIDTH_8 (0<<APB_SEQ_BUS_WIDTH_SHIFT) #define APB_SEQ_BUS_WIDTH_16 (1<<APB_SEQ_BUS_WIDTH_SHIFT) #define APB_SEQ_BUS_WIDTH_32 (2<<APB_SEQ_BUS_WIDTH_SHIFT) #define APB_SEQ_BUS_WIDTH_64 (3<<APB_SEQ_BUS_WIDTH_SHIFT) #define APB_SEQ_BUS_WIDTH_128 (4<<APB_SEQ_BUS_WIDTH_SHIFT) #define APB_SEQ_DATA_SWAP (1<<27) #define APB_SEQ_WRAP_SHIFT 16 #define APB_SEQ_WRAP_MASK (0x7<<APB_SEQ_WRAP_SHIFT) #define TEGRA_SYSTEM_DMA_CH_NR 16 #define TEGRA_SYSTEM_DMA_AVP_CH_NUM 4 #define TEGRA_SYSTEM_DMA_CH_MIN 0 #define TEGRA_SYSTEM_DMA_CH_MAX \ (TEGRA_SYSTEM_DMA_CH_NR - TEGRA_SYSTEM_DMA_AVP_CH_NUM - 1) const unsigned int ahb_addr_wrap_table[8] = { 0, 32, 64, 128, 256, 512, 1024, 2048 }; const unsigned int apb_addr_wrap_table[8] = {0, 1, 2, 4, 8, 16, 32, 64}; const unsigned int bus_width_table[5] = {8, 16, 32, 64, 128}; #define TEGRA_DMA_NAME_SIZE 16 struct tegra_dma_channel { struct list_head list; int id; spinlock_t lock; char name[TEGRA_DMA_NAME_SIZE]; void __iomem *addr; int mode; int irq; int req_transfer_count; }; #define NV_DMA_MAX_CHANNELS 32 static bool tegra_dma_initialized; static DEFINE_MUTEX(tegra_dma_lock); static DEFINE_SPINLOCK(enable_lock); static DECLARE_BITMAP(channel_usage, NV_DMA_MAX_CHANNELS); static struct tegra_dma_channel dma_channels[NV_DMA_MAX_CHANNELS]; static void tegra_dma_update_hw(struct tegra_dma_channel *ch, struct tegra_dma_req *req); static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, struct tegra_dma_req *req); static void tegra_dma_stop(struct tegra_dma_channel *ch); void tegra_dma_flush(struct tegra_dma_channel *ch) { } EXPORT_SYMBOL(tegra_dma_flush); void tegra_dma_dequeue(struct tegra_dma_channel *ch) { struct tegra_dma_req *req; if (tegra_dma_is_empty(ch)) return; req = list_entry(ch->list.next, typeof(*req), node); tegra_dma_dequeue_req(ch, req); return; } void tegra_dma_stop(struct tegra_dma_channel *ch) { u32 csr; u32 status; csr = readl(ch->addr + APB_DMA_CHAN_CSR); csr &= ~CSR_IE_EOC; writel(csr, ch->addr + APB_DMA_CHAN_CSR); csr &= ~CSR_ENB; writel(csr, ch->addr + APB_DMA_CHAN_CSR); status = readl(ch->addr + APB_DMA_CHAN_STA); if (status & STA_ISE_EOC) writel(status, ch->addr + APB_DMA_CHAN_STA); } bool tegra_dma_is_stopped(struct tegra_dma_channel *ch) { return !!(readl(ch->addr + APB_DMA_CHAN_STA) & CSR_ENB); } int tegra_dma_cancel(struct tegra_dma_channel *ch) { unsigned long irq_flags; spin_lock_irqsave(&ch->lock, irq_flags); while (!list_empty(&ch->list)) list_del(ch->list.next); tegra_dma_stop(ch); spin_unlock_irqrestore(&ch->lock, irq_flags); return 0; } /* should be called with the channel lock held */ static unsigned int dma_active_count(struct tegra_dma_channel *ch, struct tegra_dma_req *req, unsigned int status) { unsigned int to_transfer; unsigned int req_transfer_count; unsigned int bytes_transferred; to_transfer = (status & STA_COUNT_MASK) >> STA_COUNT_SHIFT; req_transfer_count = ch->req_transfer_count; req_transfer_count += 1; to_transfer += 1; bytes_transferred = req_transfer_count; if (status & STA_BUSY) bytes_transferred -= to_transfer; /* In continuous transfer mode, DMA only tracks the count of the * half DMA buffer. So, if the DMA already finished half the DMA * then add the half buffer to the completed count. */ if (ch->mode & TEGRA_DMA_MODE_CONTINUOUS_DOUBLE) if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL) bytes_transferred += req_transfer_count; if (status & STA_ISE_EOC) bytes_transferred += req_transfer_count; bytes_transferred *= 4; return bytes_transferred; } int tegra_dma_dequeue_req(struct tegra_dma_channel *ch, struct tegra_dma_req *_req) { struct tegra_dma_req *req = NULL; int found = 0; unsigned int status; unsigned long irq_flags; int stop = 0; void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); spin_lock_irqsave(&ch->lock, irq_flags); if (list_entry(ch->list.next, struct tegra_dma_req, node) == _req) stop = 1; list_for_each_entry(req, &ch->list, node) { if (req == _req) { list_del(&req->node); found = 1; break; } } if (!found) { spin_unlock_irqrestore(&ch->lock, irq_flags); return 0; } if (!stop) goto skip_status; /* STOP the DMA and get the transfer count. * Getting the transfer count is tricky. * - Globally disable DMA on all channels * - Read the channel's status register to know the number of pending * bytes to be transfered. * - Stop the dma channel * - Globally re-enable DMA to resume other transfers */ spin_lock(&enable_lock); writel(0, addr + APB_DMA_GEN); udelay(20); status = readl(ch->addr + APB_DMA_CHAN_STA); tegra_dma_stop(ch); writel(GEN_ENABLE, addr + APB_DMA_GEN); spin_unlock(&enable_lock); req->bytes_transferred = dma_active_count(ch, req, status); if (!list_empty(&ch->list)) { /* if the list is not empty, queue the next request */ struct tegra_dma_req *next_req; next_req = list_entry(ch->list.next, typeof(*next_req), node); tegra_dma_update_hw(ch, next_req); } skip_status: req->status = -TEGRA_DMA_REQ_ERROR_ABORTED; spin_unlock_irqrestore(&ch->lock, irq_flags); /* Callback should be called without any lock */ req->complete(req); return 0; } EXPORT_SYMBOL(tegra_dma_dequeue_req); bool tegra_dma_is_empty(struct tegra_dma_channel *ch) { unsigned long irq_flags; bool is_empty; spin_lock_irqsave(&ch->lock, irq_flags); if (list_empty(&ch->list)) is_empty = true; else is_empty = false; spin_unlock_irqrestore(&ch->lock, irq_flags); return is_empty; } EXPORT_SYMBOL(tegra_dma_is_empty); bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch, struct tegra_dma_req *_req) { unsigned long irq_flags; struct tegra_dma_req *req; spin_lock_irqsave(&ch->lock, irq_flags); list_for_each_entry(req, &ch->list, node) { if (req == _req) { spin_unlock_irqrestore(&ch->lock, irq_flags); return true; } } spin_unlock_irqrestore(&ch->lock, irq_flags); return false; } EXPORT_SYMBOL(tegra_dma_is_req_inflight); int tegra_dma_enqueue_req(struct tegra_dma_channel *ch, struct tegra_dma_req *req) { unsigned long irq_flags; struct tegra_dma_req *_req; int start_dma = 0; if (req->size > TEGRA_DMA_MAX_TRANSFER_SIZE || req->source_addr & 0x3 || req->dest_addr & 0x3) { pr_err("Invalid DMA request for channel %d\n", ch->id); return -EINVAL; } spin_lock_irqsave(&ch->lock, irq_flags); list_for_each_entry(_req, &ch->list, node) { if (req == _req) { spin_unlock_irqrestore(&ch->lock, irq_flags); return -EEXIST; } } req->bytes_transferred = 0; req->status = 0; /* STATUS_EMPTY just means the DMA hasn't processed the buf yet. */ req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_EMPTY; if (list_empty(&ch->list)) start_dma = 1; list_add_tail(&req->node, &ch->list); if (start_dma) tegra_dma_update_hw(ch, req); /* Check to see if this request needs to be pushed immediately. * For continuous single-buffer DMA: * The first buffer is always in-flight. The 2nd buffer should * also be in-flight. The 3rd buffer becomes in-flight when the * first is completed in the interrupt. */ else if (ch->mode & TEGRA_DMA_MODE_CONTINUOUS_SINGLE) { struct tegra_dma_req *first_req, *second_req; first_req = list_entry(ch->list.next, typeof(*first_req), node); second_req = list_entry(first_req->node.next, typeof(*second_req), node); if (second_req == req) { unsigned long status = readl(ch->addr + APB_DMA_CHAN_STA); if (!(status & STA_ISE_EOC)) tegra_dma_update_hw_partial(ch, req); /* Handle the case where the IRQ fired while we're * writing the interrupts. */ if (status & STA_ISE_EOC) { /* Interrupt fired, let the IRQ stop/restart * the DMA with this buffer in a clean way. */ req->status = TEGRA_DMA_REQ_SUCCESS; } } } spin_unlock_irqrestore(&ch->lock, irq_flags); return 0; } EXPORT_SYMBOL(tegra_dma_enqueue_req); struct tegra_dma_channel *tegra_dma_allocate_channel(int mode) { int channel; struct tegra_dma_channel *ch = NULL; if (WARN_ON(!tegra_dma_initialized)) return NULL; mutex_lock(&tegra_dma_lock); /* first channel is the shared channel */ if (mode & TEGRA_DMA_SHARED) { channel = TEGRA_SYSTEM_DMA_CH_MIN; } else { channel = find_first_zero_bit(channel_usage, ARRAY_SIZE(dma_channels)); if (channel >= ARRAY_SIZE(dma_channels)) goto out; } __set_bit(channel, channel_usage); ch = &dma_channels[channel]; ch->mode = mode; out: mutex_unlock(&tegra_dma_lock); return ch; } EXPORT_SYMBOL(tegra_dma_allocate_channel); void tegra_dma_free_channel(struct tegra_dma_channel *ch) { if (ch->mode & TEGRA_DMA_SHARED) return; tegra_dma_cancel(ch); mutex_lock(&tegra_dma_lock); __clear_bit(ch->id, channel_usage); mutex_unlock(&tegra_dma_lock); } EXPORT_SYMBOL(tegra_dma_free_channel); static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, struct tegra_dma_req *req) { u32 apb_ptr; u32 ahb_ptr; u32 csr; if (req->to_memory) { apb_ptr = req->source_addr; ahb_ptr = req->dest_addr; } else { apb_ptr = req->dest_addr; ahb_ptr = req->source_addr; } writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR); writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR); if (ch->mode & TEGRA_DMA_MODE_CONTINUOUS_DOUBLE) ch->req_transfer_count = (req->size >> 3) - 1; else ch->req_transfer_count = (req->size >> 2) - 1; csr = readl(ch->addr + APB_DMA_CHAN_CSR); csr &= ~CSR_WCOUNT_MASK; csr |= ch->req_transfer_count << CSR_WCOUNT_SHIFT; writel(csr, ch->addr + APB_DMA_CHAN_CSR); req->status = TEGRA_DMA_REQ_INFLIGHT; return; } static void tegra_dma_update_hw(struct tegra_dma_channel *ch, struct tegra_dma_req *req) { int ahb_addr_wrap; int apb_addr_wrap; int ahb_bus_width; int apb_bus_width; int index; u32 ahb_seq; u32 apb_seq; u32 ahb_ptr; u32 apb_ptr; u32 csr; csr = CSR_IE_EOC | CSR_FLOW; ahb_seq = AHB_SEQ_INTR_ENB | AHB_SEQ_BURST_1; apb_seq = 0; csr |= req->req_sel << CSR_REQ_SEL_SHIFT; ch->req_transfer_count = (req->size >> 2) - 1; /* One shot mode is always single buffered. Continuous mode could * support either. */ if (ch->mode & TEGRA_DMA_MODE_ONESHOT) { csr |= CSR_ONCE; } else if (ch->mode & TEGRA_DMA_MODE_CONTINUOUS_DOUBLE) { ahb_seq |= AHB_SEQ_DBL_BUF; /* We want an interrupt halfway through, then on the * completion. The double buffer means 2 interrupts * pass before the DMA HW latches a new AHB_PTR etc. */ ch->req_transfer_count = (req->size >> 3) - 1; } csr |= ch->req_transfer_count << CSR_WCOUNT_SHIFT; if (req->to_memory) { apb_ptr = req->source_addr; ahb_ptr = req->dest_addr; apb_addr_wrap = req->source_wrap; ahb_addr_wrap = req->dest_wrap; apb_bus_width = req->source_bus_width; ahb_bus_width = req->dest_bus_width; } else { csr |= CSR_DIR; apb_ptr = req->dest_addr; ahb_ptr = req->source_addr; apb_addr_wrap = req->dest_wrap; ahb_addr_wrap = req->source_wrap; apb_bus_width = req->dest_bus_width; ahb_bus_width = req->source_bus_width; } apb_addr_wrap >>= 2; ahb_addr_wrap >>= 2; /* set address wrap for APB size */ index = 0; do { if (apb_addr_wrap_table[index] == apb_addr_wrap) break; index++; } while (index < ARRAY_SIZE(apb_addr_wrap_table)); BUG_ON(index == ARRAY_SIZE(apb_addr_wrap_table)); apb_seq |= index << APB_SEQ_WRAP_SHIFT; /* set address wrap for AHB size */ index = 0; do { if (ahb_addr_wrap_table[index] == ahb_addr_wrap) break; index++; } while (index < ARRAY_SIZE(ahb_addr_wrap_table)); BUG_ON(index == ARRAY_SIZE(ahb_addr_wrap_table)); ahb_seq |= index << AHB_SEQ_WRAP_SHIFT; for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) { if (bus_width_table[index] == ahb_bus_width) break; } BUG_ON(index == ARRAY_SIZE(bus_width_table)); ahb_seq |= index << AHB_SEQ_BUS_WIDTH_SHIFT; for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) { if (bus_width_table[index] == apb_bus_width) break; } BUG_ON(index == ARRAY_SIZE(bus_width_table)); apb_seq |= index << APB_SEQ_BUS_WIDTH_SHIFT; writel(csr, ch->addr + APB_DMA_CHAN_CSR); writel(apb_seq, ch->addr + APB_DMA_CHAN_APB_SEQ); writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR); writel(ahb_seq, ch->addr + APB_DMA_CHAN_AHB_SEQ); writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR); csr |= CSR_ENB; writel(csr, ch->addr + APB_DMA_CHAN_CSR); req->status = TEGRA_DMA_REQ_INFLIGHT; } static void handle_oneshot_dma(struct tegra_dma_channel *ch) { struct tegra_dma_req *req; unsigned long irq_flags; spin_lock_irqsave(&ch->lock, irq_flags); if (list_empty(&ch->list)) { spin_unlock_irqrestore(&ch->lock, irq_flags); return; } req = list_entry(ch->list.next, typeof(*req), node); if (req) { list_del(&req->node); req->bytes_transferred = req->size; req->status = TEGRA_DMA_REQ_SUCCESS; spin_unlock_irqrestore(&ch->lock, irq_flags); /* Callback should be called without any lock */ pr_debug("%s: transferred %d bytes\n", __func__, req->bytes_transferred); req->complete(req); spin_lock_irqsave(&ch->lock, irq_flags); } if (!list_empty(&ch->list)) { req = list_entry(ch->list.next, typeof(*req), node); /* the complete function we just called may have enqueued another req, in which case dma has already started */ if (req->status != TEGRA_DMA_REQ_INFLIGHT) tegra_dma_update_hw(ch, req); } spin_unlock_irqrestore(&ch->lock, irq_flags); } static void handle_continuous_dbl_dma(struct tegra_dma_channel *ch) { struct tegra_dma_req *req; struct tegra_dma_req *next_req; unsigned long irq_flags; spin_lock_irqsave(&ch->lock, irq_flags); if (list_empty(&ch->list)) { spin_unlock_irqrestore(&ch->lock, irq_flags); return; } req = list_entry(ch->list.next, typeof(*req), node); if (req) { if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_EMPTY) { bool is_dma_ping_complete; is_dma_ping_complete = (readl(ch->addr + APB_DMA_CHAN_STA) & STA_PING_PONG) ? true : false; if (req->to_memory) is_dma_ping_complete = !is_dma_ping_complete; /* Out of sync - Release current buffer */ if (!is_dma_ping_complete) { req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL; req->bytes_transferred = req->size; req->status = TEGRA_DMA_REQ_SUCCESS; tegra_dma_stop(ch); if (!list_is_last(&req->node, &ch->list)) { next_req = list_entry(req->node.next, typeof(*next_req), node); tegra_dma_update_hw(ch, next_req); } list_del(&req->node); /* DMA lock is NOT held when callbak is called */ spin_unlock_irqrestore(&ch->lock, irq_flags); req->complete(req); return; } /* Load the next request into the hardware, if available * */ if (!list_is_last(&req->node, &ch->list)) { next_req = list_entry(req->node.next, typeof(*next_req), node); tegra_dma_update_hw_partial(ch, next_req); } req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL; req->status = TEGRA_DMA_REQ_SUCCESS; /* DMA lock is NOT held when callback is called */ spin_unlock_irqrestore(&ch->lock, irq_flags); if (likely(req->threshold)) req->threshold(req); return; } else if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL) { /* Callback when the buffer is completely full (i.e on * the second interrupt */ req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL; req->bytes_transferred = req->size; req->status = TEGRA_DMA_REQ_SUCCESS; if (list_is_last(&req->node, &ch->list)) tegra_dma_stop(ch); else { /* It may be possible that req came after * half dma complete so it need to start * immediately */ next_req = list_entry(req->node.next, typeof(*next_req), node); if (next_req->status != TEGRA_DMA_REQ_INFLIGHT) { tegra_dma_stop(ch); tegra_dma_update_hw(ch, next_req); } } list_del(&req->node); /* DMA lock is NOT held when callbak is called */ spin_unlock_irqrestore(&ch->lock, irq_flags); req->complete(req); return; } else { tegra_dma_stop(ch); /* Dma should be stop much earlier */ BUG(); } } spin_unlock_irqrestore(&ch->lock, irq_flags); } static void handle_continuous_sngl_dma(struct tegra_dma_channel *ch) { struct tegra_dma_req *req; struct tegra_dma_req *next_req; struct tegra_dma_req *next_next_req; unsigned long irq_flags; spin_lock_irqsave(&ch->lock, irq_flags); if (list_empty(&ch->list)) { tegra_dma_stop(ch); spin_unlock_irqrestore(&ch->lock, irq_flags); pr_err("%s: No requests in the list.\n", __func__); return; } req = list_entry(ch->list.next, typeof(*req), node); if (!req || (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_FULL)) { tegra_dma_stop(ch); spin_unlock_irqrestore(&ch->lock, irq_flags); pr_err("%s: DMA complete irq without corresponding req\n", __func__); return; } /* Handle the case when buffer is completely full */ req->bytes_transferred = req->size; req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL; req->status = TEGRA_DMA_REQ_SUCCESS; if (list_is_last(&req->node, &ch->list)) { pr_debug("%s: stop\n", __func__); tegra_dma_stop(ch); } else { /* The next entry should have already been queued and is now * in the middle of xfer. We can then write the next->next one * if it exists. */ next_req = list_entry(req->node.next, typeof(*next_req), node); if (next_req->status != TEGRA_DMA_REQ_INFLIGHT) { pr_debug("%s: interrupt during enqueue\n", __func__); tegra_dma_stop(ch); tegra_dma_update_hw(ch, next_req); } else if (!list_is_last(&next_req->node, &ch->list)) { next_next_req = list_entry(next_req->node.next, typeof(*next_next_req), node); tegra_dma_update_hw_partial(ch, next_next_req); } } list_del(&req->node); spin_unlock_irqrestore(&ch->lock, irq_flags); req->complete(req); } static irqreturn_t dma_isr(int irq, void *data) { struct tegra_dma_channel *ch = data; unsigned long status; status = readl(ch->addr + APB_DMA_CHAN_STA); if (status & STA_ISE_EOC) writel(status, ch->addr + APB_DMA_CHAN_STA); else { pr_warning("Got a spurious ISR for DMA channel %d\n", ch->id); return IRQ_HANDLED; } if (ch->mode & TEGRA_DMA_MODE_ONESHOT) handle_oneshot_dma(ch); else if (ch->mode & TEGRA_DMA_MODE_CONTINUOUS_DOUBLE) handle_continuous_dbl_dma(ch); else if (ch->mode & TEGRA_DMA_MODE_CONTINUOUS_SINGLE) handle_continuous_sngl_dma(ch); else pr_err("Bad channel mode for DMA ISR to handle\n"); return IRQ_HANDLED; } int __init tegra_dma_init(void) { int ret = 0; int i; unsigned int irq; void __iomem *addr; struct clk *c; bitmap_fill(channel_usage, NV_DMA_MAX_CHANNELS); c = clk_get_sys("tegra-dma", NULL); if (IS_ERR(c)) { pr_err("Unable to get clock for APB DMA\n"); ret = PTR_ERR(c); goto fail; } ret = clk_enable(c); if (ret != 0) { pr_err("Unable to enable clock for APB DMA\n"); goto fail; } addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); writel(GEN_ENABLE, addr + APB_DMA_GEN); writel(0, addr + APB_DMA_CNTRL); writel(0xFFFFFFFFul >> (31 - TEGRA_SYSTEM_DMA_CH_MAX), addr + APB_DMA_IRQ_MASK_SET); for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) { struct tegra_dma_channel *ch = &dma_channels[i]; ch->id = i; snprintf(ch->name, TEGRA_DMA_NAME_SIZE, "dma_channel_%d", i); ch->addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE + TEGRA_APB_DMA_CH0_SIZE * i); spin_lock_init(&ch->lock); INIT_LIST_HEAD(&ch->list); irq = INT_APB_DMA_CH0 + i; ret = request_irq(irq, dma_isr, 0, dma_channels[i].name, ch); if (ret) { pr_err("Failed to register IRQ %d for DMA %d\n", irq, i); goto fail; } ch->irq = irq; __clear_bit(i, channel_usage); } /* mark the shared channel allocated */ __set_bit(TEGRA_SYSTEM_DMA_CH_MIN, channel_usage); tegra_dma_initialized = true; return 0; fail: writel(0, addr + APB_DMA_GEN); for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) { struct tegra_dma_channel *ch = &dma_channels[i]; if (ch->irq) free_irq(ch->irq, ch); } return ret; } #ifdef CONFIG_PM static u32 apb_dma[5*TEGRA_SYSTEM_DMA_CH_NR + 3]; void tegra_dma_suspend(void) { void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); u32 *ctx = apb_dma; int i; *ctx++ = readl(addr + APB_DMA_GEN); *ctx++ = readl(addr + APB_DMA_CNTRL); *ctx++ = readl(addr + APB_DMA_IRQ_MASK); for (i = 0; i < TEGRA_SYSTEM_DMA_CH_NR; i++) { addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE + TEGRA_APB_DMA_CH0_SIZE * i); *ctx++ = readl(addr + APB_DMA_CHAN_CSR); *ctx++ = readl(addr + APB_DMA_CHAN_AHB_PTR); *ctx++ = readl(addr + APB_DMA_CHAN_AHB_SEQ); *ctx++ = readl(addr + APB_DMA_CHAN_APB_PTR); *ctx++ = readl(addr + APB_DMA_CHAN_APB_SEQ); } } void tegra_dma_resume(void) { void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); u32 *ctx = apb_dma; int i; writel(*ctx++, addr + APB_DMA_GEN); writel(*ctx++, addr + APB_DMA_CNTRL); writel(*ctx++, addr + APB_DMA_IRQ_MASK); for (i = 0; i < TEGRA_SYSTEM_DMA_CH_NR; i++) { addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE + TEGRA_APB_DMA_CH0_SIZE * i); writel(*ctx++, addr + APB_DMA_CHAN_CSR); writel(*ctx++, addr + APB_DMA_CHAN_AHB_PTR); writel(*ctx++, addr + APB_DMA_CHAN_AHB_SEQ); writel(*ctx++, addr + APB_DMA_CHAN_APB_PTR); writel(*ctx++, addr + APB_DMA_CHAN_APB_SEQ); } } #endif
joshfire/chromiumos-third_party-kernel
arch/arm/mach-tegra/dma.c
C
gpl-2.0
24,246
<?php /** * @package Joomla.Administrator * @subpackage com_installer * * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Installer\Administrator\View\Database; \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\Pagination\Pagination; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\Component\Installer\Administrator\Model\DatabaseModel; use Joomla\Component\Installer\Administrator\View\Installer\HtmlView as InstallerViewDefault; /** * Extension Manager Database View * * @since 1.6 */ class HtmlView extends InstallerViewDefault { /** * List of change sets * * @var array * @since 4.0.0 */ protected $changeSet = array(); /** * The number of errors found * * @var integer * @since 4.0.0 */ protected $errorCount = 0; /** * List pagination. * * @var Pagination * @since 4.0.0 */ protected $pagination; /** * The filter form * * @var Form * @since 4.0.0 */ public $filterForm; /** * A list of form filters * * @var array * @since 4.0.0 */ public $activeFilters = array(); /** * Display the view. * * @param string $tpl Template * * @return void * * @throws \Exception * * @since 1.6 */ public function display($tpl = null) { // Get the application $app = Factory::getApplication(); // Get data from the model. /** @var DatabaseModel $model */ $model = $this->getModel(); try { $this->changeSet = $model->getItems(); } catch (\Exception $exception) { $app->enqueueMessage($exception->getMessage(), 'error'); } $this->errorCount = $model->getErrorCount(); $this->pagination = $model->getPagination(); $this->filterForm = $model->getFilterForm(); $this->activeFilters = $model->getActiveFilters(); if ($this->changeSet) { ($this->errorCount === 0) ? $app->enqueueMessage(Text::_('COM_INSTALLER_MSG_DATABASE_CORE_OK'), 'info') : $app->enqueueMessage(Text::_('COM_INSTALLER_MSG_DATABASE_CORE_ERRORS'), 'warning'); } parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { /* * Set toolbar items for the page. */ ToolbarHelper::custom('database.fix', 'refresh', '', 'COM_INSTALLER_TOOLBAR_DATABASE_FIX', true); ToolbarHelper::divider(); parent::addToolbar(); ToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DATABASE'); } }
Llewellynvdm/joomla-cms
administrator/components/com_installer/src/View/Database/HtmlView.php
PHP
gpl-2.0
2,647
/* * Copyright (C) 2013 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 com.doomonafireball.betterpickers.calendardatepicker; import com.doomonafireball.betterpickers.R; import android.content.Context; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Paint.Align; import android.graphics.Paint.Style; import android.util.AttributeSet; import android.widget.TextView; /** * A text view which, when pressed or activated, displays a blue circle around the text. */ public class TextViewWithCircularIndicator extends TextView { private static final int SELECTED_CIRCLE_ALPHA = 60; Paint mCirclePaint = new Paint(); private final int mRadius; private final int mCircleColor; private final String mItemIsSelectedText; private boolean mDrawCircle; public TextViewWithCircularIndicator(Context context, AttributeSet attrs) { super(context, attrs); Resources res = context.getResources(); mCircleColor = res.getColor(R.color.blue); mRadius = res.getDimensionPixelOffset(R.dimen.month_select_circle_radius); mItemIsSelectedText = context.getResources().getString(R.string.item_is_selected); init(); } private void init() { mCirclePaint.setFakeBoldText(true); mCirclePaint.setAntiAlias(true); mCirclePaint.setColor(mCircleColor); mCirclePaint.setTextAlign(Align.CENTER); mCirclePaint.setStyle(Style.FILL); mCirclePaint.setAlpha(SELECTED_CIRCLE_ALPHA); } public void drawIndicator(boolean drawCircle) { mDrawCircle = drawCircle; } @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); if (mDrawCircle) { final int width = getWidth(); final int height = getHeight(); int radius = Math.min(width, height) / 2; canvas.drawCircle(width / 2, height / 2, radius, mCirclePaint); } } @Override public CharSequence getContentDescription() { CharSequence itemText = getText(); if (mDrawCircle) { return String.format(mItemIsSelectedText, itemText); } else { return itemText; } } }
NoNoid/IntSys
libs/better-Pickers/src/com/doomonafireball/betterpickers/calendardatepicker/TextViewWithCircularIndicator.java
Java
gpl-2.0
2,825
! Test erroneous cases of nested 'reduction' clauses. ! See also 'c-c++-common/goacc/nested-reductions-2-parallel.c'. subroutine acc_parallel () implicit none (type, external) integer :: i, j, k, l, sum, diff !$acc parallel !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop reduction(-:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) reduction(-:diff) do i = 1, 10 !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." } do j = 1, 10 !$acc loop reduction(-:diff) do k = 1, 10 diff = 1 end do end do end do !$acc end parallel end subroutine acc_parallel ! The same tests as above, but using a combined parallel loop construct. subroutine acc_parallel_loop () implicit none (type, external) integer :: h, i, j, k, l, sum, diff !$acc parallel loop do h = 1, 10 !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(-:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(+:sum) reduction(-:diff) do i = 1, 10 !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(-:diff) do k = 1, 10 diff = 1 end do end do end do end do end subroutine acc_parallel_loop ! The same tests as above, but now the outermost reduction clause is on ! the parallel region, not the outermost loop. subroutine acc_parallel_reduction () implicit none (type, external) integer :: i, j, k, l, sum, diff !$acc parallel reduction(+:sum) !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } do k = 1, 10 sum = 1 end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop reduction(-:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." } do j = 1, 10 !$acc loop reduction(-:diff) do k = 1, 10 diff = 1 end do end do end do !$acc end parallel end subroutine acc_parallel_reduction ! The same tests as above, but using a combined parallel loop construct, and ! the outermost reduction clause is on that one, not the outermost loop. */ subroutine acc_parallel_loop_reduction () implicit none (type, external) integer :: h, i, j, k, l, sum, diff !$acc parallel loop reduction(+:sum) do h = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(+:sum) do l = 1, 10 sum = 1 end do end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } do k = 1, 10 sum = 1 end do end do end do !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(-:sum) do k = 1, 10 sum = 1 end do end do end do !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." } do i = 1, 10 !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do k = 1, 10 !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." } do l = 1, 10 sum = 1 end do end do end do end do !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } do i = 1, 10 !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(+:sum) do k = 1, 10 sum = 1 end do end do !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." } ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, 10 !$acc loop reduction(-:diff) do k = 1, 10 diff = 1 end do end do end do end do end subroutine acc_parallel_loop_reduction
Gurgel100/gcc
gcc/testsuite/gfortran.dg/goacc/nested-reductions-2-parallel.f90
FORTRAN
gpl-2.0
18,102
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "scumm/scumm.h" #include "scumm/actor.h" #include "scumm/akos.h" #include "scumm/bomp.h" #include "scumm/imuse/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/he/intern_he.h" #include "scumm/resource.h" #include "scumm/scumm_v7.h" #include "scumm/sound.h" #include "scumm/util.h" #include "scumm/he/wiz_he.h" namespace Scumm { #include "common/pack-start.h" // START STRUCT PACKING struct AkosHeader { byte unk_1[2]; byte flags; byte unk_2; uint16 num_anims; uint16 unk_3; uint16 codec; } PACKED_STRUCT; struct AkosOffset { uint32 akcd; // offset into the akcd data uint16 akci; // offset into the akci data } PACKED_STRUCT; #include "common/pack-end.h" // END STRUCT PACKING enum AkosOpcodes { AKC_Return = 0xC001, AKC_SetVar = 0xC010, AKC_CmdQue3 = 0xC015, AKC_C016 = 0xC016, AKC_C017 = 0xC017, AKC_C018 = 0xC018, AKC_C019 = 0xC019, AKC_ComplexChan = 0xC020, AKC_C021 = 0xC021, AKC_C022 = 0xC022, AKC_ComplexChan2 = 0xC025, AKC_Jump = 0xC030, AKC_JumpIfSet = 0xC031, AKC_AddVar = 0xC040, AKC_C042 = 0xC042, AKC_C044 = 0xC044, AKC_C045 = 0xC045, AKC_C046 = 0xC046, AKC_C047 = 0xC047, AKC_C048 = 0xC048, AKC_Ignore = 0xC050, AKC_IncVar = 0xC060, AKC_CmdQue3Quick = 0xC061, AKC_JumpStart = 0xC070, AKC_JumpE = 0xC070, AKC_JumpNE = 0xC071, AKC_JumpL = 0xC072, AKC_JumpLE = 0xC073, AKC_JumpG = 0xC074, AKC_JumpGE = 0xC075, AKC_StartAnim = 0xC080, AKC_StartVarAnim = 0xC081, AKC_Random = 0xC082, AKC_SetActorClip = 0xC083, AKC_StartAnimInActor = 0xC084, AKC_SetVarInActor = 0xC085, AKC_HideActor = 0xC086, AKC_SetDrawOffs = 0xC087, AKC_JumpTable = 0xC088, AKC_SoundStuff = 0xC089, AKC_Flip = 0xC08A, AKC_Cmd3 = 0xC08B, AKC_Ignore3 = 0xC08C, AKC_Ignore2 = 0xC08D, AKC_C08E = 0xC08E, AKC_SkipStart = 0xC090, AKC_SkipE = 0xC090, AKC_SkipNE = 0xC091, AKC_SkipL = 0xC092, AKC_SkipLE = 0xC093, AKC_SkipG = 0xC094, AKC_SkipGE = 0xC095, AKC_ClearFlag = 0xC09F, AKC_C0A0 = 0xC0A0, AKC_C0A1 = 0xC0A1, AKC_C0A2 = 0xC0A2, AKC_C0A3 = 0xC0A3, AKC_C0A4 = 0xC0A4, AKC_C0A5 = 0xC0A5, AKC_C0A6 = 0xC0A6, AKC_C0A7 = 0xC0A7, AKC_EndSeq = 0xC0FF }; static bool akos_compare(int a, int b, byte cmd) { switch (cmd) { case 0: return a == b; case 1: return a != b; case 2: return a < b; case 3: return a <= b; case 4: return a > b; default: return a >= b; } } void AkosCostumeLoader::loadCostume(int id) { _akos = _vm->getResourceAddress(rtCostume, id); assert(_akos); } bool AkosCostumeLoader::hasManyDirections() { const AkosHeader *akhd; akhd = (const AkosHeader *)_vm->findResourceData(MKTAG('A','K','H','D'), _akos); return (akhd->flags & 2) != 0; } void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { uint anim; const byte *r; const AkosHeader *akhd; uint offs; int i; byte code; uint16 start, len; uint16 mask; if (a->_costume == 0) return; loadCostume(a->_costume); if (_vm->_game.version >= 7 && hasManyDirections()) anim = toSimpleDir(1, a->getFacing()) + frame * 8; else anim = newDirToOldDir(a->getFacing()) + frame * 4; akhd = (const AkosHeader *)_vm->findResourceData(MKTAG('A','K','H','D'), _akos); if (anim >= READ_LE_UINT16(&akhd->num_anims)) return; r = _vm->findResourceData(MKTAG('A','K','C','H'), _akos); assert(r); offs = READ_LE_UINT16(r + anim * sizeof(uint16)); if (offs == 0) return; r += offs; const uint8 *akstPtr = _vm->findResourceData(MKTAG('A','K','S','T'), _akos); const uint8 *aksfPtr = _vm->findResourceData(MKTAG('A','K','S','F'), _akos); i = 0; mask = READ_LE_UINT16(r); r += 2; do { if (mask & 0x8000) { const uint8 *akst = akstPtr; const uint8 *aksf = aksfPtr; code = *r++; if (usemask & 0x8000) { switch (code) { case 1: a->_cost.active[i] = 0; a->_cost.frame[i] = frame; a->_cost.end[i] = 0; a->_cost.start[i] = 0; a->_cost.curpos[i] = 0; a->_cost.heCondMaskTable[i] = 0; if (akst) { int size = _vm->getResourceDataSize(akst) / 8; if (size > 0) { bool found = false; while (size--) { if (READ_LE_UINT32(akst) == 0) { a->_cost.heCondMaskTable[i] = READ_LE_UINT32(akst + 4); found = true; break; } akst += 8; } if (!found) { error("Sequence not found in actor %p costume %d", (void *)a, a->_costume); } } } break; case 4: a->_cost.stopped |= 1 << i; break; case 5: a->_cost.stopped &= ~(1 << i); break; default: start = READ_LE_UINT16(r); r += 2; len = READ_LE_UINT16(r); r += 2; a->_cost.heJumpOffsetTable[i] = 0; a->_cost.heJumpCountTable[i] = 0; if (aksf) { int size = _vm->getResourceDataSize(aksf) / 6; if (size > 0) { bool found = false; while (size--) { if (READ_LE_UINT16(aksf) == start) { a->_cost.heJumpOffsetTable[i] = READ_LE_UINT16(aksf + 2); a->_cost.heJumpCountTable[i] = READ_LE_UINT16(aksf + 4); found = true; break; } aksf += 6; } if (!found) { error("Sequence not found in actor %p costume %d", (void *)a, a->_costume); } } } a->_cost.active[i] = code; a->_cost.frame[i] = frame; a->_cost.end[i] = start + len; a->_cost.start[i] = start; a->_cost.curpos[i] = start; a->_cost.heCondMaskTable[i] = 0; if (akst) { int size = _vm->getResourceDataSize(akst) / 8; if (size > 0) { bool found = false; while (size--) { if (READ_LE_UINT32(akst) == start) { a->_cost.heCondMaskTable[i] = READ_LE_UINT32(akst + 4); found = true; break; } akst += 8; } if (!found) { error("Sequence not found in actor %p costume %d", (void *)a, a->_costume); } } } break; } } else { if (code != 1 && code != 4 && code != 5) r += sizeof(uint16) * 2; } } i++; mask <<= 1; usemask <<= 1; } while ((uint16)mask); } void AkosRenderer::setPalette(uint16 *new_palette) { uint size, i; size = _vm->getResourceDataSize(akpl); if (size == 0) return; if (size > 256) error("akos_setPalette: %d is too many colors", size); if (_vm->_game.features & GF_16BIT_COLOR) { if (_paletteNum) { for (i = 0; i < size; i++) _palette[i] = READ_LE_UINT16(_vm->_hePalettes + _paletteNum * _vm->_hePaletteSlot + 768 + akpl[i] * 2); } else if (rgbs) { for (i = 0; i < size; i++) { if (new_palette[i] == 0xFF) { uint8 col = akpl[i]; _palette[i] = _vm->get16BitColor(rgbs[col * 3 + 0], rgbs[col * 3 + 1], rgbs[col * 3 + 2]); } else { _palette[i] = new_palette[i]; } } } } else if (_vm->_game.heversion >= 99 && _paletteNum) { for (i = 0; i < size; i++) _palette[i] = (byte)_vm->_hePalettes[_paletteNum * _vm->_hePaletteSlot + 768 + akpl[i]]; } else { for (i = 0; i < size; i++) { _palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i]; } } if (_vm->_game.heversion == 70) { for (i = 0; i < size; i++) _palette[i] = _vm->_HEV7ActorPalette[_palette[i]]; } if (size == 256) { byte color = new_palette[0]; if (color == 255) { _palette[0] = color; } else { _useBompPalette = true; } } } void AkosRenderer::setCostume(int costume, int shadow) { const byte *akos = _vm->getResourceAddress(rtCostume, costume); assert(akos); akhd = (const AkosHeader *) _vm->findResourceData(MKTAG('A','K','H','D'), akos); akof = (const AkosOffset *) _vm->findResourceData(MKTAG('A','K','O','F'), akos); akci = _vm->findResourceData(MKTAG('A','K','C','I'), akos); aksq = _vm->findResourceData(MKTAG('A','K','S','Q'), akos); akcd = _vm->findResourceData(MKTAG('A','K','C','D'), akos); akpl = _vm->findResourceData(MKTAG('A','K','P','L'), akos); _codec = READ_LE_UINT16(&akhd->codec); akct = _vm->findResourceData(MKTAG('A','K','C','T'), akos); rgbs = _vm->findResourceData(MKTAG('R','G','B','S'), akos); xmap = 0; if (shadow) { const uint8 *xmapPtr = _vm->getResourceAddress(rtImage, shadow); assert(xmapPtr); xmap = _vm->findResourceData(MKTAG('X','M','A','P'), xmapPtr); assert(xmap); } } void AkosRenderer::setFacing(const Actor *a) { _mirror = (newDirToOldDir(a->getFacing()) != 0 || akhd->flags & 1); if (a->_flip) _mirror = !_mirror; } byte AkosRenderer::drawLimb(const Actor *a, int limb) { uint code; const byte *p; const AkosOffset *off; const CostumeData &cost = a->_cost; const CostumeInfo *costumeInfo; uint i, extra; byte result = 0; int xmoveCur, ymoveCur; uint32 heCondMaskIndex[32]; bool useCondMask; int lastDx, lastDy; lastDx = lastDy = 0; for (i = 0; i < 32; ++i) { heCondMaskIndex[i] = i; } if (_skipLimbs) return 0; if (_vm->_game.heversion >= 70 && cost.active[limb] == 8) return 0; if (!cost.active[limb] || cost.stopped & (1 << limb)) return 0; useCondMask = false; p = aksq + cost.curpos[limb]; code = p[0]; if (code & 0x80) code = READ_BE_UINT16(p); if (_vm->_game.heversion >= 90) _shadow_mode = 0; if (code == AKC_C021 || code == AKC_C022) { uint16 s = cost.curpos[limb] + 4; uint j = 0; extra = p[3]; uint8 n = extra; assert(n <= ARRAYSIZE(heCondMaskIndex)); while (n--) { heCondMaskIndex[j++] = aksq[s++]; } useCondMask = true; p += extra + 2; code = (code == AKC_C021) ? AKC_ComplexChan : AKC_ComplexChan2; } if (code == AKC_Return || code == AKC_EndSeq) return 0; if (code != AKC_ComplexChan && code != AKC_ComplexChan2) { off = akof + (code & 0xFFF); assert((code & 0xFFF) * 6 < READ_BE_UINT32((const byte *)akof - 4) - 8); assert((code & 0x7000) == 0); _srcptr = akcd + READ_LE_UINT32(&off->akcd); costumeInfo = (const CostumeInfo *) (akci + READ_LE_UINT16(&off->akci)); _width = READ_LE_UINT16(&costumeInfo->width); _height = READ_LE_UINT16(&costumeInfo->height); xmoveCur = _xmove + (int16)READ_LE_UINT16(&costumeInfo->rel_x); ymoveCur = _ymove + (int16)READ_LE_UINT16(&costumeInfo->rel_y); _xmove += (int16)READ_LE_UINT16(&costumeInfo->move_x); _ymove -= (int16)READ_LE_UINT16(&costumeInfo->move_y); switch (_codec) { case 1: result |= codec1(xmoveCur, ymoveCur); break; case 5: result |= codec5(xmoveCur, ymoveCur); break; case 16: result |= codec16(xmoveCur, ymoveCur); break; default: error("akos_drawLimb: invalid _codec %d", _codec); } } else { if (code == AKC_ComplexChan2) { lastDx = (int16)READ_LE_UINT16(p + 2); lastDy = (int16)READ_LE_UINT16(p + 4); p += 4; } extra = p[2]; p += 3; uint32 decflag = heCondMaskIndex[0]; for (i = 0; i != extra; i++) { code = p[4]; if (code & 0x80) code = READ_BE_UINT16(p + 4); off = akof + (code & 0xFFF); _srcptr = akcd + READ_LE_UINT32(&off->akcd); costumeInfo = (const CostumeInfo *) (akci + READ_LE_UINT16(&off->akci)); _width = READ_LE_UINT16(&costumeInfo->width); _height = READ_LE_UINT16(&costumeInfo->height); xmoveCur = _xmove + (int16)READ_LE_UINT16(p + 0); ymoveCur = _ymove + (int16)READ_LE_UINT16(p + 2); if (i == extra - 1) { _xmove += lastDx; _ymove -= lastDy; } uint16 shadowMask = 0; if (!useCondMask || !akct) { decflag = 1; } else { uint32 cond = READ_LE_UINT32(akct + cost.heCondMaskTable[limb] + heCondMaskIndex[i] * 4); if (cond == 0) { decflag = 1; } else { uint32 type = cond & ~0x3FFFFFFF; cond &= 0x3FFFFFFF; if (_vm->_game.heversion >= 90) { shadowMask = cond & 0xE000; cond &= ~0xE000; } if (_vm->_game.heversion >= 90 && cond == 0) { decflag = 1; } else if (type == 0x40000000) { // restored_bit decflag = (a->_heCondMask & cond) == cond ? 1 : 0; } else if (type == 0x80000000) { // dirty_bit decflag = (a->_heCondMask & cond) ? 0 : 1; } else { decflag = (a->_heCondMask & cond) ? 1 : 0; } } } p += (p[4] & 0x80) ? 6 : 5; if (decflag == 0) continue; if (_vm->_game.heversion >= 90) { if (_vm->_game.heversion >= 99) _shadow_mode = 0; if (xmap && (shadowMask & 0x8000)) _shadow_mode = 3; } switch (_codec) { case 1: result |= codec1(xmoveCur, ymoveCur); break; case 5: result |= codec5(xmoveCur, ymoveCur); break; case 16: result |= codec16(xmoveCur, ymoveCur); break; case 32: result |= codec32(xmoveCur, ymoveCur); break; default: error("akos_drawLimb: invalid _codec %d", _codec); } } } return result; } void AkosRenderer::codec1_genericDecode(Codec1 &v1) { const byte *mask, *src; byte *dst; byte len, maskbit; int lastColumnX, y; uint16 color, height, pcolor; const byte *scaleytab; bool masked; lastColumnX = -1; y = v1.y; src = _srcptr; dst = v1.destptr; len = v1.replen; color = v1.repcolor; height = _height; scaleytab = &v1.scaletable[v1.scaleYindex]; maskbit = revBitMask(v1.x & 7); mask = _vm->getMaskBuffer(v1.x - (_vm->_virtscr[kMainVirtScreen].xstart & 7), v1.y, _zbuf); if (len) goto StartPos; do { len = *src++; color = len >> v1.shr; len &= v1.mask; if (!len) len = *src++; do { if (_scaleY == 255 || *scaleytab++ < _scaleY) { if (_actorHitMode) { if (color && y == _actorHitY && v1.x == _actorHitX) { _actorHitResult = true; return; } } else { masked = (y < v1.boundsRect.top || y >= v1.boundsRect.bottom) || (v1.x < 0 || v1.x >= v1.boundsRect.right) || (*mask & maskbit); bool skipColumn = false; if (color && !masked) { pcolor = _palette[color]; if (_shadow_mode == 1) { if (pcolor == 13) { // In shadow mode 1 skipColumn works more or less the same way as in shadow // mode 3. It is only ever checked and applied if pcolor is 13. skipColumn = (lastColumnX == v1.x); pcolor = _shadow_table[*dst]; } } else if (_shadow_mode == 2) { error("codec1_spec2"); // TODO } else if (_shadow_mode == 3) { if (_vm->_game.features & GF_16BIT_COLOR) { // I add the column skip here, too, although I don't know whether it always // applies. But this is the only way to prevent recursive shading of pixels. // This might need more fine tuning... skipColumn = (lastColumnX == v1.x); uint16 srcColor = (pcolor >> 1) & 0x7DEF; uint16 dstColor = (READ_UINT16(dst) >> 1) & 0x7DEF; pcolor = srcColor + dstColor; } else if (_vm->_game.heversion >= 90) { // I add the column skip here, too, although I don't know whether it always // applies. But this is the only way to prevent recursive shading of pixels. // This might need more fine tuning... skipColumn = (lastColumnX == v1.x); pcolor = (pcolor << 8) + *dst; pcolor = xmap[pcolor]; } else if (pcolor < 8 ) { // This mode is used in COMI. The column skip only takes place when the shading // is actually applied (for pcolor < 8). The skip avoids shading of pixels that // already have been shaded. skipColumn = (lastColumnX == v1.x); pcolor = (pcolor << 8) + *dst; pcolor = _shadow_table[pcolor]; } } if (!skipColumn) { if (_vm->_bytesPerPixel == 2) { WRITE_UINT16(dst, pcolor); } else { *dst = pcolor; } } } } dst += _out.pitch; mask += _numStrips; y++; } if (!--height) { if (!--v1.skip_width) return; height = _height; y = v1.y; scaleytab = &v1.scaletable[v1.scaleYindex]; lastColumnX = v1.x; if (_scaleX == 255 || v1.scaletable[v1.scaleXindex] < _scaleX) { v1.x += v1.scaleXstep; if (v1.x < 0 || v1.x >= v1.boundsRect.right) return; maskbit = revBitMask(v1.x & 7); v1.destptr += v1.scaleXstep * _vm->_bytesPerPixel; } v1.scaleXindex += v1.scaleXstep; dst = v1.destptr; mask = _vm->getMaskBuffer(v1.x - (_vm->_virtscr[kMainVirtScreen].xstart & 7), v1.y, _zbuf); } StartPos:; } while (--len); } while (1); } // This is exact duplicate of smallCostumeScaleTable[] in costume.cpp // See FIXME below for explanation const byte smallCostumeScaleTableAKOS[256] = { 0xFF, 0xFD, 0x7D, 0xBD, 0x3D, 0xDD, 0x5D, 0x9D, 0x1D, 0xED, 0x6D, 0xAD, 0x2D, 0xCD, 0x4D, 0x8D, 0x0D, 0xF5, 0x75, 0xB5, 0x35, 0xD5, 0x55, 0x95, 0x15, 0xE5, 0x65, 0xA5, 0x25, 0xC5, 0x45, 0x85, 0x05, 0xF9, 0x79, 0xB9, 0x39, 0xD9, 0x59, 0x99, 0x19, 0xE9, 0x69, 0xA9, 0x29, 0xC9, 0x49, 0x89, 0x09, 0xF1, 0x71, 0xB1, 0x31, 0xD1, 0x51, 0x91, 0x11, 0xE1, 0x61, 0xA1, 0x21, 0xC1, 0x41, 0x81, 0x01, 0xFB, 0x7B, 0xBB, 0x3B, 0xDB, 0x5B, 0x9B, 0x1B, 0xEB, 0x6B, 0xAB, 0x2B, 0xCB, 0x4B, 0x8B, 0x0B, 0xF3, 0x73, 0xB3, 0x33, 0xD3, 0x53, 0x93, 0x13, 0xE3, 0x63, 0xA3, 0x23, 0xC3, 0x43, 0x83, 0x03, 0xF7, 0x77, 0xB7, 0x37, 0xD7, 0x57, 0x97, 0x17, 0xE7, 0x67, 0xA7, 0x27, 0xC7, 0x47, 0x87, 0x07, 0xEF, 0x6F, 0xAF, 0x2F, 0xCF, 0x4F, 0x8F, 0x0F, 0xDF, 0x5F, 0x9F, 0x1F, 0xBF, 0x3F, 0x7F, 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE }; const byte bigCostumeScaleTable[768] = { 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, }; byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { int num_colors; bool use_scaling; int i, j; int skip = 0, startScaleIndexX, startScaleIndexY; Common::Rect rect; int step; byte drawFlag = 1; Codec1 v1; const int scaletableSize = (_vm->_game.heversion >= 61) ? 128 : 384; /* implement custom scale table */ // FIXME. HACK // For some illogical reason gcc 3.4.x produces wrong code if // smallCostumeScaleTable from costume.cpp is used here // So I had to put copy of it back here as it was before 1.227 revision // of this file. v1.scaletable = (_vm->_game.heversion >= 61) ? smallCostumeScaleTableAKOS : bigCostumeScaleTable; if (_vm->VAR_CUSTOMSCALETABLE != 0xFF && _vm->_res->isResourceLoaded(rtString, _vm->VAR(_vm->VAR_CUSTOMSCALETABLE))) { v1.scaletable = _vm->getStringAddressVar(_vm->VAR_CUSTOMSCALETABLE); } // Setup color decoding variables num_colors = _vm->getResourceDataSize(akpl); if (num_colors == 32) { v1.mask = 7; v1.shr = 3; } else if (num_colors == 64) { v1.mask = 3; v1.shr = 2; } else { v1.mask = 15; v1.shr = 4; } use_scaling = (_scaleX != 0xFF) || (_scaleY != 0xFF); v1.x = _actorX; v1.y = _actorY; v1.boundsRect.left = 0; v1.boundsRect.top = 0; v1.boundsRect.right = _out.w; v1.boundsRect.bottom = _out.h; if (use_scaling) { /* Scale direction */ v1.scaleXstep = -1; if (xmoveCur < 0) { xmoveCur = -xmoveCur; v1.scaleXstep = 1; } if (_mirror) { /* Adjust X position */ startScaleIndexX = j = scaletableSize - xmoveCur; for (i = 0; i < xmoveCur; i++) { if (v1.scaletable[j++] < _scaleX) v1.x -= v1.scaleXstep; } rect.left = rect.right = v1.x; j = startScaleIndexX; for (i = 0, skip = 0; i < _width; i++) { if (rect.right < 0) { skip++; startScaleIndexX = j; } if (v1.scaletable[j++] < _scaleX) rect.right++; } } else { /* No mirror */ /* Adjust X position */ startScaleIndexX = j = scaletableSize + xmoveCur; for (i = 0; i < xmoveCur; i++) { if (v1.scaletable[j--] < _scaleX) v1.x += v1.scaleXstep; } rect.left = rect.right = v1.x; j = startScaleIndexX; for (i = 0; i < _width; i++) { if (rect.left >= v1.boundsRect.right) { startScaleIndexX = j; skip++; } if (v1.scaletable[j--] < _scaleX) rect.left--; } } if (skip) skip--; step = -1; if (ymoveCur < 0) { ymoveCur = -ymoveCur; step = -step; } startScaleIndexY = scaletableSize - ymoveCur; for (i = 0; i < ymoveCur; i++) { if (v1.scaletable[startScaleIndexY++] < _scaleY) v1.y -= step; } rect.top = rect.bottom = v1.y; startScaleIndexY = scaletableSize - ymoveCur; for (i = 0; i < _height; i++) { if (v1.scaletable[startScaleIndexY++] < _scaleY) rect.bottom++; } startScaleIndexY = scaletableSize - ymoveCur; } else { if (!_mirror) xmoveCur = -xmoveCur; v1.x += xmoveCur; v1.y += ymoveCur; if (_mirror) { rect.left = v1.x; rect.right = v1.x + _width; } else { rect.left = v1.x - _width; rect.right = v1.x; } rect.top = v1.y; rect.bottom = rect.top + _height; startScaleIndexX = scaletableSize; startScaleIndexY = scaletableSize; } v1.scaleXindex = startScaleIndexX; v1.scaleYindex = startScaleIndexY; v1.skip_width = _width; v1.scaleXstep = _mirror ? 1 : -1; if (_vm->_game.heversion >= 71 && !use_scaling) { if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) { v1.boundsRect = _clipOverride; } } if (_actorHitMode) { if (_actorHitX < rect.left || _actorHitX >= rect.right || _actorHitY < rect.top || _actorHitY >= rect.bottom) return 0; } else markRectAsDirty(rect); if (rect.top >= v1.boundsRect.bottom || rect.bottom <= v1.boundsRect.top) return 0; if (rect.left >= v1.boundsRect.right || rect.right <= v1.boundsRect.left) return 0; v1.replen = 0; if (_mirror) { if (!use_scaling) skip = v1.boundsRect.left - v1.x; if (skip > 0) { v1.skip_width -= skip; codec1_ignorePakCols(v1, skip); v1.x = v1.boundsRect.left; } else { skip = rect.right - v1.boundsRect.right; if (skip <= 0) { drawFlag = 2; } else { v1.skip_width -= skip; } } } else { if (!use_scaling) skip = rect.right - v1.boundsRect.right + 1; if (skip > 0) { v1.skip_width -= skip; codec1_ignorePakCols(v1, skip) ; v1.x = v1.boundsRect.right - 1; } else { skip = (v1.boundsRect.left -1) - rect.left; if (skip <= 0) drawFlag = 2; else v1.skip_width -= skip; } } if (v1.skip_width <= 0 || _height <= 0) return 0; if (rect.left < v1.boundsRect.left) rect.left = v1.boundsRect.left; if (rect.top < v1.boundsRect.top) rect.top = v1.boundsRect.top; if (rect.top > v1.boundsRect.bottom) rect.top = v1.boundsRect.bottom; if (rect.bottom > v1.boundsRect.bottom) rect.bottom = v1.boundsRect.bottom; if (_draw_top > rect.top) _draw_top = rect.top; if (_draw_bottom < rect.bottom) _draw_bottom = rect.bottom; v1.width = _out.w; v1.height = _out.h; v1.destptr = (byte *)_out.getBasePtr(v1.x, v1.y); codec1_genericDecode(v1); return drawFlag; } void AkosRenderer::markRectAsDirty(Common::Rect rect) { rect.left -= _vm->_virtscr[kMainVirtScreen].xstart & 7; rect.right -= _vm->_virtscr[kMainVirtScreen].xstart & 7; _vm->markRectAsDirty(kMainVirtScreen, rect, _actorID); } byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) { Common::Rect clip; int32 maxw, maxh; if (_actorHitMode) { error("codec5: _actorHitMode not yet implemented"); return 0; } if (!_mirror) { clip.left = (_actorX - xmoveCur - _width) + 1; } else { clip.left = _actorX + xmoveCur - 1; } clip.top = _actorY + ymoveCur; clip.right = clip.left + _width; clip.bottom = clip.top + _height; maxw = _out.w; maxh = _out.h; markRectAsDirty(clip); clip.clip(maxw, maxh); if ((clip.left >= clip.right) || (clip.top >= clip.bottom)) return 0; if (_draw_top > clip.top) _draw_top = clip.top; if (_draw_bottom < clip.bottom) _draw_bottom = clip.bottom; BompDrawData bdd; bdd.dst = _out; if (!_mirror) { bdd.x = (_actorX - xmoveCur - _width) + 1; } else { bdd.x = _actorX + xmoveCur; } bdd.y = _actorY + ymoveCur; bdd.src = _srcptr; bdd.srcwidth = _width; bdd.srcheight = _height; bdd.scale_x = 255; bdd.scale_y = 255; bdd.maskPtr = _vm->getMaskBuffer(0, 0, _zbuf); bdd.numStrips = _numStrips; bdd.shadowMode = _shadow_mode; bdd.shadowPalette = _vm->_shadowPalette; bdd.actorPalette = _useBompPalette ? _palette : 0; bdd.mirror = !_mirror; drawBomp(bdd); _useBompPalette = false; return 0; } void AkosRenderer::akos16SetupBitReader(const byte *src) { _akos16.repeatMode = false; _akos16.numbits = 16; _akos16.mask = (1 << *src) - 1; _akos16.shift = *(src); _akos16.color = *(src + 1); _akos16.bits = (*(src + 2) | *(src + 3) << 8); _akos16.dataptr = src + 4; } #define AKOS16_FILL_BITS() \ if (_akos16.numbits <= 8) { \ _akos16.bits |= (*_akos16.dataptr++) << _akos16.numbits; \ _akos16.numbits += 8; \ } #define AKOS16_EAT_BITS(n) \ _akos16.numbits -= (n); \ _akos16.bits >>= (n); void AkosRenderer::akos16SkipData(int32 numbytes) { akos16DecodeLine(0, numbytes, 0); } void AkosRenderer::akos16DecodeLine(byte *buf, int32 numbytes, int32 dir) { uint16 bits, tmp_bits; while (numbytes != 0) { if (buf) { *buf = _akos16.color; buf += dir; } if (!_akos16.repeatMode) { AKOS16_FILL_BITS() bits = _akos16.bits & 3; if (bits & 1) { AKOS16_EAT_BITS(2) if (bits & 2) { tmp_bits = _akos16.bits & 7; AKOS16_EAT_BITS(3) if (tmp_bits != 4) { // A color change _akos16.color += (tmp_bits - 4); } else { // Color does not change, but rather identical pixels get repeated _akos16.repeatMode = true; AKOS16_FILL_BITS() _akos16.repeatCount = (_akos16.bits & 0xff) - 1; AKOS16_EAT_BITS(8) AKOS16_FILL_BITS() } } else { AKOS16_FILL_BITS() _akos16.color = ((byte)_akos16.bits) & _akos16.mask; AKOS16_EAT_BITS(_akos16.shift) AKOS16_FILL_BITS() } } else { AKOS16_EAT_BITS(1); } } else { if (--_akos16.repeatCount == 0) { _akos16.repeatMode = false; } } numbytes--; } } void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf) { byte *tmp_buf = _akos16.buffer; int maskpitch; byte *maskptr; const byte maskbit = revBitMask(maskLeft & 7); if (dir < 0) { dest -= (t_width - 1); tmp_buf += (t_width - 1); } akos16SetupBitReader(src); if (numskip_before != 0) { akos16SkipData(numskip_before); } maskpitch = _numStrips; maskptr = _vm->getMaskBuffer(maskLeft, maskTop, zBuf); assert(t_height > 0); assert(t_width > 0); while (t_height--) { akos16DecodeLine(tmp_buf, t_width, dir); bompApplyMask(_akos16.buffer, maskptr, maskbit, t_width, transparency); bool HE7Check = (_vm->_game.heversion == 70); bompApplyShadow(_shadow_mode, _shadow_table, _akos16.buffer, dest, t_width, transparency, HE7Check); if (numskip_after != 0) { akos16SkipData(numskip_after); } dest += pitch; maskptr += maskpitch; } } byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { assert(_vm->_bytesPerPixel == 1); Common::Rect clip; int32 minx, miny, maxw, maxh; int32 skip_x, skip_y, cur_x, cur_y; byte transparency = (_vm->_game.heversion >= 61) ? _palette[0] : 255; if (_actorHitMode) { error("codec16: _actorHitMode not yet implemented"); return 0; } if (!_mirror) { clip.left = (_actorX - xmoveCur - _width) + 1; } else { clip.left = _actorX + xmoveCur; } clip.top = _actorY + ymoveCur; clip.right = clip.left + _width; clip.bottom = clip.top + _height; minx = miny = 0; maxw = _out.w; maxh = _out.h; if (_vm->_game.heversion >= 71) { if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) { minx = _clipOverride.left; miny = _clipOverride.top; maxw = _clipOverride.right; maxh = _clipOverride.bottom; } } markRectAsDirty(clip); skip_x = 0; skip_y = 0; cur_x = _width - 1; cur_y = _height - 1; if (clip.left < minx) { skip_x = -clip.left; clip.left = 0; } if (clip.right > maxw) { cur_x -= clip.right - maxw; clip.right = maxw; } if (clip.top < miny) { skip_y -= clip.top; clip.top = 0; } if (clip.bottom > maxh) { cur_y -= clip.bottom - maxh; clip.bottom = maxh; } if ((clip.left >= clip.right) || (clip.top >= clip.bottom)) return 0; if (_draw_top > clip.top) _draw_top = clip.top; if (_draw_bottom < clip.bottom) _draw_bottom = clip.bottom; int32 width_unk, height_unk; height_unk = clip.top; int32 dir; if (!_mirror) { dir = -1; int tmp_skip_x = skip_x; skip_x = _width - 1 - cur_x; cur_x = _width - 1 - tmp_skip_x; width_unk = clip.right - 1; } else { dir = 1; width_unk = clip.left; } int32 out_height; out_height = cur_y - skip_y; if (out_height < 0) { out_height = -out_height; } out_height++; cur_x -= skip_x; if (cur_x < 0) { cur_x = -cur_x; } cur_x++; int32 numskip_before = skip_x + (skip_y * _width); int32 numskip_after = _width - cur_x; byte *dst = (byte *)_out.getBasePtr(width_unk, height_unk); akos16Decompress(dst, _out.pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, clip.left, clip.top, _zbuf); return 0; } byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) { #ifdef ENABLE_HE Common::Rect src, dst; if (!_mirror) { dst.left = (_actorX - xmoveCur - _width) + 1; } else { dst.left = _actorX + xmoveCur; } src.top = src.left = 0; src.right = _width; src.bottom = _height; dst.top = _actorY + ymoveCur; dst.right = dst.left + _width; dst.bottom = dst.top + _height; int diff; diff = dst.left - _clipOverride.left; if (diff < 0) { src.left -= diff; dst.left -= diff; } diff = dst.right - _clipOverride.right; if (diff > 0) { src.right -= diff; dst.right -= diff; } diff = dst.top - _clipOverride.top; if (diff < 0) { src.top -= diff; dst.top -= diff; } diff = dst.bottom - _clipOverride.bottom; if (diff > 0) { src.bottom -= diff; dst.bottom -= diff; } if (dst.isValidRect() == false) return 0; markRectAsDirty(dst); if (_draw_top > dst.top) _draw_top = dst.top; if (_draw_bottom < dst.bottom) _draw_bottom = dst.bottom; const uint8 *palPtr = NULL; if (_vm->_game.features & GF_16BIT_COLOR) { palPtr = _vm->_hePalettes + _vm->_hePaletteSlot + 768; if (_paletteNum) { palPtr = _vm->_hePalettes + _paletteNum * _vm->_hePaletteSlot + 768; } else if (rgbs) { for (uint i = 0; i < 256; i++) WRITE_LE_UINT16(_palette + i, _vm->get16BitColor(rgbs[i * 3 + 0], rgbs[i * 3 + 1], rgbs[i * 3 + 2])); palPtr = (uint8 *)_palette; } } else if (_vm->_game.heversion >= 99) { palPtr = _vm->_hePalettes + _vm->_hePaletteSlot + 768; } byte *dstPtr = (byte *)_out.getBasePtr(dst.left, dst.top); if (_shadow_mode == 3) { Wiz::decompressWizImage<kWizXMap>(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, xmap, _vm->_bytesPerPixel); } else { if (palPtr != NULL) { Wiz::decompressWizImage<kWizRMap>(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, palPtr, NULL, _vm->_bytesPerPixel); } else { Wiz::decompressWizImage<kWizCopy>(dstPtr, _out.pitch, kDstScreen, _srcptr, src, 0, NULL, NULL, _vm->_bytesPerPixel); } } #endif return 0; } byte AkosCostumeLoader::increaseAnims(Actor *a) { return ((ScummEngine_v6 *)_vm)->akos_increaseAnims(_akos, a); } bool ScummEngine_v6::akos_increaseAnims(const byte *akos, Actor *a) { const byte *aksq, *akfo; int i; uint size; bool result; aksq = findResourceData(MKTAG('A','K','S','Q'), akos); akfo = findResourceData(MKTAG('A','K','F','O'), akos); size = getResourceDataSize(akfo) / 2; result = false; for (i = 0; i < 16; i++) { if (a->_cost.active[i] != 0) result |= akos_increaseAnim(a, i, aksq, (const uint16 *)akfo, size); } return result; } #define GW(o) ((int16)READ_LE_UINT16(aksq+curpos+(o))) #define GUW(o) READ_LE_UINT16(aksq+curpos+(o)) #define GB(o) aksq[curpos+(o)] bool ScummEngine_v6::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const uint16 *akfo, int numakfo) { byte active; uint old_curpos, curpos, end; uint code; bool flag_value, needRedraw; int tmp, tmp2; active = a->_cost.active[chan]; end = a->_cost.end[chan]; old_curpos = curpos = a->_cost.curpos[chan]; flag_value = false; needRedraw = false; do { code = aksq[curpos]; if (code & 0x80) code = READ_BE_UINT16(aksq + curpos); switch (active) { case 6: case 8: switch (code) { case AKC_JumpIfSet: case AKC_AddVar: case AKC_SetVar: case AKC_SkipGE: case AKC_SkipG: case AKC_SkipLE: case AKC_SkipL: case AKC_SkipNE: case AKC_SkipE: case AKC_C016: case AKC_C017: case AKC_C018: case AKC_C019: curpos += 5; break; case AKC_JumpTable: case AKC_SetActorClip: case AKC_Ignore3: case AKC_Ignore2: case AKC_Ignore: case AKC_StartAnim: case AKC_StartVarAnim: case AKC_CmdQue3: case AKC_C042: case AKC_C044: case AKC_C0A3: curpos += 3; break; case AKC_SoundStuff: if (_game.heversion >= 61) curpos += 6; else curpos += 8; break; case AKC_Cmd3: case AKC_SetVarInActor: case AKC_SetDrawOffs: curpos += 6; break; case AKC_ClearFlag: case AKC_HideActor: case AKC_IncVar: case AKC_CmdQue3Quick: case AKC_Return: case AKC_EndSeq: curpos += 2; break; case AKC_JumpGE: case AKC_JumpG: case AKC_JumpLE: case AKC_JumpL: case AKC_JumpNE: case AKC_JumpE: case AKC_Random: curpos += 7; break; case AKC_Flip: case AKC_Jump: case AKC_StartAnimInActor: case AKC_C0A0: case AKC_C0A1: case AKC_C0A2: curpos += 4; break; case AKC_ComplexChan2: curpos += 4; // Fall through case AKC_ComplexChan: curpos += 3; tmp = aksq[curpos - 1]; while (--tmp >= 0) { curpos += 4; curpos += (aksq[curpos] & 0x80) ? 2 : 1; } break; case AKC_C021: case AKC_C022: case AKC_C045: case AKC_C046: case AKC_C047: case AKC_C048: needRedraw = 1; curpos += aksq[curpos + 2]; break; case AKC_C08E: akos_queCommand(7, a, GW(2), 0); curpos += 4; break; default: curpos += (code & 0x8000) ? 2 : 1; break; } break; case 2: curpos += (code & 0x8000) ? 2 : 1; if (curpos > end) curpos = a->_cost.start[chan]; break; case 3: if (curpos != end) curpos += (code & 0x8000) ? 2 : 1; break; default: break; } code = aksq[curpos]; if (code & 0x80) code = READ_BE_UINT16(aksq + curpos); if (flag_value && code != AKC_ClearFlag) continue; switch (code) { case AKC_StartAnimInActor: akos_queCommand(4, derefActor(a->getAnimVar(GB(2)), "akos_increaseAnim:29"), a->getAnimVar(GB(3)), 0); continue; case AKC_Random: a->setAnimVar(GB(6), _rnd.getRandomNumberRng(GW(2), GW(4))); continue; case AKC_JumpGE: case AKC_JumpG: case AKC_JumpLE: case AKC_JumpL: case AKC_JumpNE: case AKC_JumpE: if (akos_compare(a->getAnimVar(GB(4)), GW(5), code - AKC_JumpStart) != 0) { curpos = GUW(2); break; } continue; case AKC_IncVar: a->setAnimVar(0, a->getAnimVar(0) + 1); continue; case AKC_SetVar: a->setAnimVar(GB(4), GW(2)); continue; case AKC_AddVar: a->setAnimVar(GB(4), a->getAnimVar(GB(4)) + GW(2)); continue; case AKC_Flip: a->_flip = GW(2) != 0; continue; case AKC_CmdQue3: if (_game.heversion >= 61) tmp = GB(2); else tmp = GB(2) - 1; if ((uint) tmp < 24) akos_queCommand(3, a, a->_sound[tmp], 0); continue; case AKC_CmdQue3Quick: akos_queCommand(3, a, a->_sound[0], 0); continue; case AKC_StartAnim: akos_queCommand(4, a, GB(2), 0); continue; case AKC_StartVarAnim: akos_queCommand(4, a, a->getAnimVar(GB(2)), 0); continue; case AKC_SetVarInActor: derefActor(a->getAnimVar(GB(2)), "akos_increaseAnim:9")->setAnimVar(GB(3), GW(4)); continue; case AKC_HideActor: akos_queCommand(1, a, 0, 0); continue; case AKC_SetActorClip: akos_queCommand(5, a, GB(2), 0); continue; case AKC_SoundStuff: if (_game.heversion >= 61) continue; tmp = GB(2) - 1; if (tmp >= 8) continue; tmp2 = GB(4); if (tmp2 < 1 || tmp2 > 3) error("akos_increaseAnim:8 invalid code %d", tmp2); akos_queCommand(tmp2 + 6, a, a->_sound[tmp], GB(6)); continue; case AKC_SetDrawOffs: akos_queCommand(6, a, GW(2), GW(4)); continue; case AKC_JumpTable: if (akfo == NULL) error("akos_increaseAnim: no AKFO table"); tmp = a->getAnimVar(GB(2)) - 1; if (_game.heversion >= 80) { if (tmp < 0 || tmp > a->_cost.heJumpCountTable[chan] - 1) error("akos_increaseAnim: invalid jump value %d", tmp); curpos = READ_LE_UINT16(akfo + a->_cost.heJumpOffsetTable[chan] + tmp * 2); } else { if (tmp < 0 || tmp > numakfo - 1) error("akos_increaseAnim: invalid jump value %d", tmp); curpos = READ_LE_UINT16(&akfo[tmp]); } break; case AKC_JumpIfSet: if (!a->getAnimVar(GB(4))) continue; a->setAnimVar(GB(4), 0); curpos = GUW(2); break; case AKC_ClearFlag: flag_value = false; continue; case AKC_Jump: curpos = GUW(2); // WORKAROUND bug #3813: In the German version of SPY Fox 3: Operation Ozone // the wig maker room 21 contains a costume animation 352 of an LED ticker // with a jump to an erroneous position 846. // To prevent an undefined 'uSweat token' the animation is reset to its start. if (_game.id == GID_HEGAME && _language == Common::DE_DEU && \ _currentRoom == 21 && a->_costume == 352 && curpos == 846) { curpos = a->_cost.start[chan]; } break; case AKC_Return: case AKC_EndSeq: case AKC_ComplexChan: case AKC_C08E: case AKC_ComplexChan2: break; case AKC_C021: case AKC_C022: needRedraw = 1; break; case AKC_Cmd3: case AKC_Ignore: case AKC_Ignore3: continue; case AKC_Ignore2: if (_game.heversion >= 71) akos_queCommand(3, a, a->_sound[a->getAnimVar(GB(2))], 0); continue; case AKC_SkipE: case AKC_SkipNE: case AKC_SkipL: case AKC_SkipLE: case AKC_SkipG: case AKC_SkipGE: if (akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_SkipStart) == 0) flag_value = true; continue; case AKC_C016: if (_sound->isSoundRunning( a->_sound[a->getAnimVar(GB(4))])) { curpos = GUW(2); break; } continue; case AKC_C017: if (!_sound->isSoundRunning(a->_sound[a->getAnimVar(GB(4))])) { curpos = GUW(2); break; } continue; case AKC_C018: if (_sound->isSoundRunning(a->_sound[GB(4)])) { curpos = GUW(2); break; } continue; case AKC_C019: if (!_sound->isSoundRunning(a->_sound[GB(4)])) { curpos = GUW(2); break; } continue; case AKC_C042: akos_queCommand(9, a, a->_sound[GB(2)], 0); continue; case AKC_C044: akos_queCommand(9, a, a->_sound[a->getAnimVar(GB(2))], 0); continue; case AKC_C045: ((ActorHE *)a)->setUserCondition(GB(3), a->getAnimVar(GB(4))); continue; case AKC_C046: a->setAnimVar(GB(4), ((ActorHE *)a)->isUserConditionSet(GB(3))); continue; case AKC_C047: ((ActorHE *)a)->setTalkCondition(GB(3)); continue; case AKC_C048: a->setAnimVar(GB(4), ((ActorHE *)a)->isTalkConditionSet(GB(3))); continue; case AKC_C0A0: akos_queCommand(8, a, GB(2), 0); continue; case AKC_C0A1: if (((ActorHE *)a)->_heTalking != 0) { curpos = GUW(2); break; } continue; case AKC_C0A2: if (((ActorHE *)a)->_heTalking == 0) { curpos = GUW(2); break; } continue; case AKC_C0A3: akos_queCommand(8, a, a->getAnimVar(GB(2)), 0); continue; case AKC_C0A4: if (VAR(VAR_TALK_ACTOR) != 0) { curpos = GUW(2); break; } continue; case AKC_C0A5: if (VAR(VAR_TALK_ACTOR) == 0) { curpos = GUW(2); break; } continue; default: if ((code & 0xC000) == 0xC000) error("Undefined uSweat token %X", code); } break; } while (1); int code2 = aksq[curpos]; if (code2 & 0x80) code2 = READ_BE_UINT16(aksq + curpos); if ((code2 & 0xC000) == 0xC000 && code2 != AKC_ComplexChan && code2 != AKC_Return && code2 != AKC_EndSeq && code2 != AKC_C08E && code2 != AKC_ComplexChan2 && code2 != AKC_C021 && code2 != AKC_C022) error("Ending with undefined uSweat token %X", code2); a->_cost.curpos[chan] = curpos; if (needRedraw) return 1; else return curpos != old_curpos; } void ScummEngine_v6::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) { _akosQueuePos++; assertRange(0, _akosQueuePos, 31, "akos_queCommand: _akosQueuePos"); _akosQueue[_akosQueuePos].cmd = cmd; _akosQueue[_akosQueuePos].actor = a->_number; _akosQueue[_akosQueuePos].param1 = param_1; _akosQueue[_akosQueuePos].param2 = param_2; } void ScummEngine_v6::akos_processQueue() { byte cmd; int actor, param_1, param_2; while (_akosQueuePos) { cmd = _akosQueue[_akosQueuePos].cmd; actor = _akosQueue[_akosQueuePos].actor; param_1 = _akosQueue[_akosQueuePos].param1; param_2 = _akosQueue[_akosQueuePos].param2; _akosQueuePos--; Actor *a = derefActor(actor, "akos_processQueue"); switch (cmd) { case 1: a->putActor(0, 0, 0); break; case 3: _sound->addSoundToQueue(param_1, 0, -1, 0); break; case 4: a->startAnimActor(param_1); break; case 5: a->_forceClip = param_1; break; case 6: a->_heOffsX = param_1; a->_heOffsY = param_2; break; case 7: #ifdef ENABLE_HE assert(_game.heversion >= 71); ((ScummEngine_v71he *)this)->queueAuxEntry(a->_number, param_1); #endif break; case 8: _actorToPrintStrFor = a->_number; a->_talkPosX = ((ActorHE *)a)->_heTalkQueue[param_1].posX; a->_talkPosY = ((ActorHE *)a)->_heTalkQueue[param_1].posY; a->_talkColor = ((ActorHE *)a)->_heTalkQueue[param_1].color; _string[0].loadDefault(); _string[0].color = a->_talkColor; actorTalk(((ActorHE *)a)->_heTalkQueue[param_1].sentence); break; case 9: _sound->addSoundToQueue(param_1, 0, -1, 4); break; default: error("akos_queCommand(%d,%d,%d,%d)", cmd, a->_number, param_1, param_2); } } } #ifdef ENABLE_SCUMM_7_8 void ScummEngine_v7::akos_processQueue() { byte cmd; int actor, param_1, param_2; while (_akosQueuePos) { cmd = _akosQueue[_akosQueuePos].cmd; actor = _akosQueue[_akosQueuePos].actor; param_1 = _akosQueue[_akosQueuePos].param1; param_2 = _akosQueue[_akosQueuePos].param2; _akosQueuePos--; Actor *a = derefActor(actor, "akos_processQueue"); switch (cmd) { case 1: a->putActor(0, 0, 0); break; case 3: if (param_1 != 0) { if (_imuseDigital) { _imuseDigital->startSfx(param_1, 63); } } break; case 4: a->startAnimActor(param_1); break; case 5: a->_forceClip = param_1; break; case 6: a->_heOffsX = param_1; a->_heOffsY = param_2; break; case 7: if (param_1 != 0) { if (_imuseDigital) { _imuseDigital->setVolume(param_1, param_2); } } break; case 8: if (param_1 != 0) { if (_imuseDigital) { _imuseDigital->setPan(param_1, param_2); } } break; case 9: if (param_1 != 0) { if (_imuseDigital) { _imuseDigital->setPriority(param_1, param_2); } } break; default: error("akos_queCommand(%d,%d,%d,%d)", cmd, a->_number, param_1, param_2); } } } #endif } // End of namespace Scumm
vanfanel/scummvm
engines/scumm/akos.cpp
C++
gpl-2.0
49,481
<?php namespace Drupal\charts_highcharts\Settings\Highcharts; class DataLabels implements \JsonSerializable { private $dataLabels; /** * @return mixed */ public function getDataLabels() { return $this->dataLabels; } /** * @param mixed $dataLabels */ public function setDataLabels($dataLabels) { $this->dataLabels = $dataLabels; } /** * @return array */ public function jsonSerialize() { $vars = get_object_vars($this); return $vars; } }
jagnoha/website
profiles/varbase/profiles/varbase/modules/contrib/charts/modules/charts_highcharts/src/Settings/Highcharts/DataLabels.php
PHP
gpl-2.0
498
/* * Copyright (C) 2012 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef DVAPNodeThreadHelper_H #define DVAPNodeThreadHelper_H #include "DVAPNodeStatusData.h" #include "DVAPNodeThread.h" #include <wx/wx.h> class CDVAPNodeThreadHelper : public wxThread { public: CDVAPNodeThreadHelper(IDVAPNodeThread* thread); virtual ~CDVAPNodeThreadHelper(); virtual void start(); virtual void* Entry(); virtual void kill(); virtual void setLogging(bool logging, const wxString& dir); virtual CDVAPNodeStatusData* getStatus(); private: IDVAPNodeThread* m_thread; }; #endif
remcovz/OpenDV
Repeater/DVAPNode/DVAPNodeThreadHelper.h
C
gpl-2.0
1,338
/* * IBM Accurate Mathematical Library * written by International Business Machines Corp. * Copyright (C) 2001, 2011 Free Software Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /****************************************************************/ /* MODULE_NAME: sincos32.c */ /* */ /* FUNCTIONS: ss32 */ /* cc32 */ /* c32 */ /* sin32 */ /* cos32 */ /* mpsin */ /* mpcos */ /* mpranred */ /* mpsin1 */ /* mpcos1 */ /* */ /* FILES NEEDED: endian.h mpa.h sincos32.h */ /* mpa.c */ /* */ /* Multi Precision sin() and cos() function with p=32 for sin()*/ /* cos() arcsin() and arccos() routines */ /* In addition mpranred() routine performs range reduction of */ /* a double number x into multi precision number y, */ /* such that y=x-n*pi/2, abs(y)<pi/4, n=0,+-1,+-2,.... */ /****************************************************************/ #include "endian.h" #include "mpa.h" #include "sincos32.h" #include "math_private.h" #ifndef SECTION # define SECTION #endif /****************************************************************/ /* Compute Multi-Precision sin() function for given p. Receive */ /* Multi Precision number x and result stored at y */ /****************************************************************/ static void SECTION ss32(mp_no *x, mp_no *y, int p) { int i; double a; #if 0 double b; static const mp_no mpone = {1,{1.0,1.0}}; #endif mp_no mpt1,x2,gor,sum ,mpk={1,{1.0}}; #if 0 mp_no mpt2; #endif for (i=1;i<=p;i++) mpk.d[i]=0; __mul(x,x,&x2,p); __cpy(&oofac27,&gor,p); __cpy(&gor,&sum,p); for (a=27.0;a>1.0;a-=2.0) { mpk.d[1]=a*(a-1.0); __mul(&gor,&mpk,&mpt1,p); __cpy(&mpt1,&gor,p); __mul(&x2,&sum,&mpt1,p); __sub(&gor,&mpt1,&sum,p); } __mul(x,&sum,y,p); } /**********************************************************************/ /* Compute Multi-Precision cos() function for given p. Receive Multi */ /* Precision number x and result stored at y */ /**********************************************************************/ static void SECTION cc32(mp_no *x, mp_no *y, int p) { int i; double a; #if 0 double b; static const mp_no mpone = {1,{1.0,1.0}}; #endif mp_no mpt1,x2,gor,sum ,mpk={1,{1.0}}; #if 0 mp_no mpt2; #endif for (i=1;i<=p;i++) mpk.d[i]=0; __mul(x,x,&x2,p); mpk.d[1]=27.0; __mul(&oofac27,&mpk,&gor,p); __cpy(&gor,&sum,p); for (a=26.0;a>2.0;a-=2.0) { mpk.d[1]=a*(a-1.0); __mul(&gor,&mpk,&mpt1,p); __cpy(&mpt1,&gor,p); __mul(&x2,&sum,&mpt1,p); __sub(&gor,&mpt1,&sum,p); } __mul(&x2,&sum,y,p); } /***************************************************************************/ /* c32() computes both sin(x), cos(x) as Multi precision numbers */ /***************************************************************************/ void SECTION __c32(mp_no *x, mp_no *y, mp_no *z, int p) { static const mp_no mpt={1,{1.0,2.0}}, one={1,{1.0,1.0}}; mp_no u,t,t1,t2,c,s; int i; __cpy(x,&u,p); u.e=u.e-1; cc32(&u,&c,p); ss32(&u,&s,p); for (i=0;i<24;i++) { __mul(&c,&s,&t,p); __sub(&s,&t,&t1,p); __add(&t1,&t1,&s,p); __sub(&mpt,&c,&t1,p); __mul(&t1,&c,&t2,p); __add(&t2,&t2,&c,p); } __sub(&one,&c,y,p); __cpy(&s,z,p); } /************************************************************************/ /*Routine receive double x and two double results of sin(x) and return */ /*result which is more accurate */ /*Computing sin(x) with multi precision routine c32 */ /************************************************************************/ double SECTION __sin32(double x, double res, double res1) { int p; mp_no a,b,c; p=32; __dbl_mp(res,&a,p); __dbl_mp(0.5*(res1-res),&b,p); __add(&a,&b,&c,p); if (x>0.8) { __sub(&hp,&c,&a,p); __c32(&a,&b,&c,p); } else __c32(&c,&a,&b,p); /* b=sin(0.5*(res+res1)) */ __dbl_mp(x,&c,p); /* c = x */ __sub(&b,&c,&a,p); /* if a>0 return min(res,res1), otherwise return max(res,res1) */ if (a.d[0]>0) return (res<res1)?res:res1; else return (res>res1)?res:res1; } /************************************************************************/ /*Routine receive double x and two double results of cos(x) and return */ /*result which is more accurate */ /*Computing cos(x) with multi precision routine c32 */ /************************************************************************/ double SECTION __cos32(double x, double res, double res1) { int p; mp_no a,b,c; p=32; __dbl_mp(res,&a,p); __dbl_mp(0.5*(res1-res),&b,p); __add(&a,&b,&c,p); if (x>2.4) { __sub(&pi,&c,&a,p); __c32(&a,&b,&c,p); b.d[0]=-b.d[0]; } else if (x>0.8) { __sub(&hp,&c,&a,p); __c32(&a,&c,&b,p); } else __c32(&c,&b,&a,p); /* b=cos(0.5*(res+res1)) */ __dbl_mp(x,&c,p); /* c = x */ __sub(&b,&c,&a,p); /* if a>0 return max(res,res1), otherwise return min(res,res1) */ if (a.d[0]>0) return (res>res1)?res:res1; else return (res<res1)?res:res1; } /*******************************************************************/ /*Compute sin(x+dx) as Multi Precision number and return result as */ /* double */ /*******************************************************************/ double SECTION __mpsin(double x, double dx) { int p; double y; mp_no a,b,c; p=32; __dbl_mp(x,&a,p); __dbl_mp(dx,&b,p); __add(&a,&b,&c,p); if (x>0.8) { __sub(&hp,&c,&a,p); __c32(&a,&b,&c,p); } else __c32(&c,&a,&b,p); /* b = sin(x+dx) */ __mp_dbl(&b,&y,p); return y; } /*******************************************************************/ /* Compute cos()of double-length number (x+dx) as Multi Precision */ /* number and return result as double */ /*******************************************************************/ double SECTION __mpcos(double x, double dx) { int p; double y; mp_no a,b,c; p=32; __dbl_mp(x,&a,p); __dbl_mp(dx,&b,p); __add(&a,&b,&c,p); if (x>0.8) { __sub(&hp,&c,&b,p); __c32(&b,&c,&a,p); } else __c32(&c,&a,&b,p); /* a = cos(x+dx) */ __mp_dbl(&a,&y,p); return y; } /******************************************************************/ /* mpranred() performs range reduction of a double number x into */ /* multi precision number y, such that y=x-n*pi/2, abs(y)<pi/4, */ /* n=0,+-1,+-2,.... */ /* Return int which indicates in which quarter of circle x is */ /******************************************************************/ int SECTION __mpranred(double x, mp_no *y, int p) { number v; double t,xn; int i,k,n; static const mp_no one = {1,{1.0,1.0}}; mp_no a,b,c; if (ABS(x) < 2.8e14) { t = (x*hpinv.d + toint.d); xn = t - toint.d; v.d = t; n =v.i[LOW_HALF]&3; __dbl_mp(xn,&a,p); __mul(&a,&hp,&b,p); __dbl_mp(x,&c,p); __sub(&c,&b,y,p); return n; } else { /* if x is very big more precision required */ __dbl_mp(x,&a,p); a.d[0]=1.0; k = a.e-5; if (k < 0) k=0; b.e = -k; b.d[0] = 1.0; for (i=0;i<p;i++) b.d[i+1] = toverp[i+k]; __mul(&a,&b,&c,p); t = c.d[c.e]; for (i=1;i<=p-c.e;i++) c.d[i]=c.d[i+c.e]; for (i=p+1-c.e;i<=p;i++) c.d[i]=0; c.e=0; if (c.d[1] >= 8388608.0) { t +=1.0; __sub(&c,&one,&b,p); __mul(&b,&hp,y,p); } else __mul(&c,&hp,y,p); n = (int) t; if (x < 0) { y->d[0] = - y->d[0]; n = -n; } return (n&3); } } /*******************************************************************/ /* Multi-Precision sin() function subroutine, for p=32. It is */ /* based on the routines mpranred() and c32(). */ /*******************************************************************/ double SECTION __mpsin1(double x) { int p; int n; mp_no u,s,c; double y; p=32; n=__mpranred(x,&u,p); /* n is 0, 1, 2 or 3 */ __c32(&u,&c,&s,p); switch (n) { /* in which quarter of unit circle y is*/ case 0: __mp_dbl(&s,&y,p); return y; break; case 2: __mp_dbl(&s,&y,p); return -y; break; case 1: __mp_dbl(&c,&y,p); return y; break; case 3: __mp_dbl(&c,&y,p); return -y; break; } return 0; /* unreachable, to make the compiler happy */ } /*****************************************************************/ /* Multi-Precision cos() function subroutine, for p=32. It is */ /* based on the routines mpranred() and c32(). */ /*****************************************************************/ double SECTION __mpcos1(double x) { int p; int n; mp_no u,s,c; double y; p=32; n=__mpranred(x,&u,p); /* n is 0, 1, 2 or 3 */ __c32(&u,&c,&s,p); switch (n) { /* in what quarter of unit circle y is*/ case 0: __mp_dbl(&c,&y,p); return y; break; case 2: __mp_dbl(&c,&y,p); return -y; break; case 1: __mp_dbl(&s,&y,p); return -y; break; case 3: __mp_dbl(&s,&y,p); return y; break; } return 0; /* unreachable, to make the compiler happy */ } /******************************************************************/
pexip/os-eglibc
sysdeps/ieee754/dbl-64/sincos32.c
C
gpl-2.0
11,017
// Compiler options: -t:library public class A { public class N<T> { public static N<T> Method () { return default (N<T>); } } }
xen2/mcs
tests/gtest-556-lib.cs
C#
gpl-2.0
142
/* Copyright (c) 2013-2015, The Linux Foundation. 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 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/kernel.h> #include <linux/pm_runtime.h> #include "mdss_mdp.h" #include "mdss_panel.h" #include "mdss_debug.h" #include "mdss_mdp_trace.h" #define VSYNC_EXPIRE_TICK 6 #define MAX_SESSIONS 2 #define SPLIT_MIXER_OFFSET 0x800 #define KOFF_TIMEOUT msecs_to_jiffies(84) #define STOP_TIMEOUT(hz) msecs_to_jiffies((1000 / hz) * (VSYNC_EXPIRE_TICK + 2)) #define POWER_COLLAPSE_TIME msecs_to_jiffies(100) static DEFINE_MUTEX(cmd_clk_mtx); struct mdss_mdp_cmd_ctx { struct mdss_mdp_ctl *ctl; u32 pp_num; u8 ref_cnt; struct completion stop_comp; struct completion readptr_done; wait_queue_head_t pp_waitq; struct list_head vsync_handlers; int panel_power_state; atomic_t koff_cnt; u32 intf_stopped; int clk_enabled; int vsync_enabled; int rdptr_enabled; struct mutex clk_mtx; spinlock_t clk_lock; spinlock_t koff_lock; struct work_struct clk_work; struct work_struct pp_done_work; struct mutex autorefresh_mtx; atomic_t pp_done_cnt; int autorefresh_pending_frame_cnt; bool autorefresh_off_pending; bool autorefresh_init; struct mdss_intf_recovery intf_recovery; struct mdss_mdp_cmd_ctx *sync_ctx; u32 pp_timeout_report_cnt; int pingpong_split_slave; bool pending_mode_switch; }; struct mdss_mdp_cmd_ctx mdss_mdp_cmd_ctx_list[MAX_SESSIONS]; static int mdss_mdp_cmd_do_notifier(struct mdss_mdp_cmd_ctx *ctx); static bool __mdss_mdp_cmd_is_panel_power_off(struct mdss_mdp_cmd_ctx *ctx) { return mdss_panel_is_power_off(ctx->panel_power_state); } static bool __mdss_mdp_cmd_is_panel_power_on_interactive( struct mdss_mdp_cmd_ctx *ctx) { return mdss_panel_is_power_on_interactive(ctx->panel_power_state); } static inline u32 mdss_mdp_cmd_line_count(struct mdss_mdp_ctl *ctl) { struct mdss_mdp_mixer *mixer; u32 cnt = 0xffff; u32 init; u32 height; mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); mixer = mdss_mdp_mixer_get(ctl, MDSS_MDP_MIXER_MUX_LEFT); if (!mixer) { mixer = mdss_mdp_mixer_get(ctl, MDSS_MDP_MIXER_MUX_RIGHT); if (!mixer) { mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); goto exit; } } init = mdss_mdp_pingpong_read(mixer->pingpong_base, MDSS_MDP_REG_PP_VSYNC_INIT_VAL) & 0xffff; height = mdss_mdp_pingpong_read(mixer->pingpong_base, MDSS_MDP_REG_PP_SYNC_CONFIG_HEIGHT) & 0xffff; if (height < init) { mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); goto exit; } cnt = mdss_mdp_pingpong_read(mixer->pingpong_base, MDSS_MDP_REG_PP_INT_COUNT_VAL) & 0xffff; if (cnt < init) cnt += (height - init); else cnt -= init; mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); pr_debug("cnt=%d init=%d height=%d\n", cnt, init, height); exit: return cnt; } static int mdss_mdp_cmd_tearcheck_cfg(struct mdss_mdp_mixer *mixer, struct mdss_mdp_cmd_ctx *ctx, bool enable) { struct mdss_mdp_pp_tear_check *te = NULL; struct mdss_panel_info *pinfo; u32 vsync_clk_speed_hz, total_lines, vclks_line, cfg = 0; char __iomem *pingpong_base; struct mdss_mdp_ctl *ctl = ctx->ctl; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (IS_ERR_OR_NULL(ctl->panel_data)) { pr_err("no panel data\n"); return -ENODEV; } if (enable) { pinfo = &ctl->panel_data->panel_info; te = &ctl->panel_data->panel_info.te; mdss_mdp_vsync_clk_enable(1); vsync_clk_speed_hz = mdss_mdp_get_clk_rate(MDSS_CLK_MDP_VSYNC); total_lines = mdss_panel_get_vtotal(pinfo); total_lines *= pinfo->mipi.frame_rate; vclks_line = (total_lines) ? vsync_clk_speed_hz/total_lines : 0; cfg = BIT(19); if (pinfo->mipi.hw_vsync_mode) cfg |= BIT(20); if (te->refx100) vclks_line = vclks_line * pinfo->mipi.frame_rate * 100 / te->refx100; else { pr_warn("refx100 cannot be zero! Use 6000 as default\n"); vclks_line = vclks_line * pinfo->mipi.frame_rate * 100 / 6000; } cfg |= vclks_line; pr_debug("%s: yres=%d vclks=%x height=%d init=%d rd=%d start=%d\n", __func__, pinfo->yres, vclks_line, te->sync_cfg_height, te->vsync_init_val, te->rd_ptr_irq, te->start_pos); pr_debug("thrd_start =%d thrd_cont=%d\n", te->sync_threshold_start, te->sync_threshold_continue); } pingpong_base = mixer->pingpong_base; if (ctx->pingpong_split_slave) pingpong_base = mdata->slave_pingpong_base; mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_SYNC_CONFIG_VSYNC, cfg); mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_SYNC_CONFIG_HEIGHT, te ? te->sync_cfg_height : 0); mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_VSYNC_INIT_VAL, te ? te->vsync_init_val : 0); mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_RD_PTR_IRQ, te ? te->rd_ptr_irq : 0); mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_START_POS, te ? te->start_pos : 0); mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_SYNC_THRESH, te ? ((te->sync_threshold_continue << 16) | te->sync_threshold_start) : 0); mdss_mdp_pingpong_write(pingpong_base, MDSS_MDP_REG_PP_TEAR_CHECK_EN, te ? te->tear_check_en : 0); return 0; } static int mdss_mdp_cmd_tearcheck_setup(struct mdss_mdp_cmd_ctx *ctx, bool enable) { int rc = 0; struct mdss_mdp_mixer *mixer; struct mdss_mdp_ctl *ctl = ctx->ctl; mixer = mdss_mdp_mixer_get(ctl, MDSS_MDP_MIXER_MUX_LEFT); if (mixer) { rc = mdss_mdp_cmd_tearcheck_cfg(mixer, ctx, enable); if (rc) goto err; } if (!(ctl->opmode & MDSS_MDP_CTL_OP_PACK_3D_ENABLE)) { mixer = mdss_mdp_mixer_get(ctl, MDSS_MDP_MIXER_MUX_RIGHT); if (mixer) rc = mdss_mdp_cmd_tearcheck_cfg(mixer, ctx, enable); } err: return rc; } static inline void mdss_mdp_cmd_clk_on(struct mdss_mdp_cmd_ctx *ctx) { unsigned long flags; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int irq_en, rc; if (__mdss_mdp_cmd_is_panel_power_off(ctx)) return; mutex_lock(&ctx->clk_mtx); MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); if (!ctx->clk_enabled) { mdss_bus_bandwidth_ctrl(true); ctx->clk_enabled = 1; rc = mdss_iommu_ctrl(1); if (IS_ERR_VALUE(rc)) pr_err("IOMMU attach failed\n"); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); mdss_mdp_ctl_intf_event (ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, (void *)1); mdss_mdp_hist_intr_setup(&mdata->hist_intr, MDSS_IRQ_RESUME); } spin_lock_irqsave(&ctx->clk_lock, flags); irq_en = !ctx->rdptr_enabled; ctx->rdptr_enabled = VSYNC_EXPIRE_TICK; spin_unlock_irqrestore(&ctx->clk_lock, flags); if (irq_en) mdss_mdp_irq_enable(MDSS_MDP_IRQ_PING_PONG_RD_PTR, ctx->pp_num); mutex_unlock(&ctx->clk_mtx); } static inline void mdss_mdp_cmd_clk_off(struct mdss_mdp_cmd_ctx *ctx) { unsigned long flags; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int set_clk_off = 0; if (ctx->autorefresh_init) { return; } mutex_lock(&ctx->clk_mtx); MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); spin_lock_irqsave(&ctx->clk_lock, flags); if (!ctx->rdptr_enabled) set_clk_off = 1; spin_unlock_irqrestore(&ctx->clk_lock, flags); pr_debug("clk_enabled =%d set_clk_off=%d\n", ctx->clk_enabled, set_clk_off); if (ctx->clk_enabled && set_clk_off) { ctx->clk_enabled = 0; mdss_mdp_hist_intr_setup(&mdata->hist_intr, MDSS_IRQ_SUSPEND); mdss_mdp_ctl_intf_event (ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, (void *)0); mdss_iommu_ctrl(0); mdss_bus_bandwidth_ctrl(false); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); } mutex_unlock(&ctx->clk_mtx); } static void mdss_mdp_cmd_readptr_done(void *arg) { struct mdss_mdp_ctl *ctl = arg; struct mdss_mdp_cmd_ctx *ctx = ctl->intf_ctx[MASTER_CTX]; struct mdss_mdp_vsync_handler *tmp; ktime_t vsync_time; if (!ctx) { pr_err("invalid ctx\n"); return; } if (ctx->autorefresh_init) { pr_debug("Completing read pointer done\n"); complete_all(&ctx->readptr_done); } if (ctx->autorefresh_off_pending) ctx->autorefresh_off_pending = false; vsync_time = ktime_get(); ctl->vsync_cnt++; MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); spin_lock(&ctx->clk_lock); list_for_each_entry(tmp, &ctx->vsync_handlers, list) { if (tmp->enabled && !tmp->cmd_post_flush) tmp->vsync_handler(ctl, vsync_time); } if (!ctx->vsync_enabled) { if (ctx->rdptr_enabled && !ctx->autorefresh_init) ctx->rdptr_enabled--; if (ctx->rdptr_enabled == 0 && atomic_read(&ctx->koff_cnt)) ctx->rdptr_enabled++; } if (ctx->rdptr_enabled == 0) { mdss_mdp_irq_disable_nosync (MDSS_MDP_IRQ_PING_PONG_RD_PTR, ctx->pp_num); complete(&ctx->stop_comp); schedule_work(&ctx->clk_work); } spin_unlock(&ctx->clk_lock); } static void mdss_mdp_cmd_intf_recovery(void *data, int event) { struct mdss_mdp_cmd_ctx *ctx = data; unsigned long flags; if (!data) { pr_err("%s: invalid ctx\n", __func__); return; } if (!ctx->ctl) return; if (event != MDP_INTF_DSI_CMD_FIFO_UNDERFLOW) { pr_warn("%s: unsupported recovery event:%d\n", __func__, event); return; } spin_lock_irqsave(&ctx->koff_lock, flags); if (atomic_read(&ctx->koff_cnt)) { mdss_mdp_ctl_reset(ctx->ctl); pr_debug("%s: intf_num=%d\n", __func__, ctx->ctl->intf_num); atomic_dec(&ctx->koff_cnt); mdss_mdp_irq_disable_nosync(MDSS_MDP_IRQ_PING_PONG_COMP, ctx->pp_num); } spin_unlock_irqrestore(&ctx->koff_lock, flags); } static void mdss_mdp_cmd_pingpong_done(void *arg) { struct mdss_mdp_ctl *ctl = arg; struct mdss_mdp_cmd_ctx *ctx = ctl->intf_ctx[MASTER_CTX]; struct mdss_mdp_vsync_handler *tmp; ktime_t vsync_time; u32 status; if (!ctx) { pr_err("%s: invalid ctx\n", __func__); return; } mdss_mdp_ctl_perf_set_transaction_status(ctl, PERF_HW_MDP_STATE, PERF_STATUS_DONE); spin_lock(&ctx->clk_lock); list_for_each_entry(tmp, &ctx->vsync_handlers, list) { if (tmp->enabled && tmp->cmd_post_flush) tmp->vsync_handler(ctl, vsync_time); } spin_unlock(&ctx->clk_lock); spin_lock(&ctx->koff_lock); mdss_mdp_irq_disable_nosync(MDSS_MDP_IRQ_PING_PONG_COMP, ctx->pp_num); MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); if (atomic_add_unless(&ctx->koff_cnt, -1, 0)) { if (atomic_read(&ctx->koff_cnt)) pr_err("%s: too many kickoffs=%d!\n", __func__, atomic_read(&ctx->koff_cnt)); if (mdss_mdp_cmd_do_notifier(ctx)) { atomic_inc(&ctx->pp_done_cnt); status = mdss_mdp_ctl_perf_get_transaction_status(ctl); if (status == 0) schedule_work(&ctx->pp_done_work); } wake_up_all(&ctx->pp_waitq); } else if (!ctl->cmd_autorefresh_en) { pr_err("%s: should not have pingpong interrupt!\n", __func__); } trace_mdp_cmd_pingpong_done(ctl, ctx->pp_num, atomic_read(&ctx->koff_cnt)); pr_debug("%s: ctl_num=%d intf_num=%d ctx=%d kcnt=%d\n", __func__, ctl->num, ctl->intf_num, ctx->pp_num, atomic_read(&ctx->koff_cnt)); spin_unlock(&ctx->koff_lock); } static void pingpong_done_work(struct work_struct *work) { struct mdss_mdp_cmd_ctx *ctx = container_of(work, typeof(*ctx), pp_done_work); if (ctx->ctl) { while (atomic_add_unless(&ctx->pp_done_cnt, -1, 0)) mdss_mdp_ctl_notify(ctx->ctl, MDP_NOTIFY_FRAME_DONE); mdss_mdp_ctl_perf_release_bw(ctx->ctl); } } static void clk_ctrl_work(struct work_struct *work) { struct mdss_mdp_cmd_ctx *ctx = container_of(work, typeof(*ctx), clk_work); struct mdss_mdp_ctl *ctl, *sctl; struct mdss_mdp_cmd_ctx *sctx = NULL; if (!ctx) { pr_err("%s: invalid ctx\n", __func__); return; } ctl = ctx->ctl; if (ctl->panel_data->panel_info.is_split_display) { mutex_lock(&cmd_clk_mtx); sctl = mdss_mdp_get_split_ctl(ctl); if (sctl) { sctx = (struct mdss_mdp_cmd_ctx *)sctl->intf_ctx[MASTER_CTX]; } else { mutex_unlock(&cmd_clk_mtx); return; } } mdss_mdp_cmd_clk_off(ctx); if (ctl->panel_data->panel_info.is_split_display) { if (sctx) mdss_mdp_cmd_clk_off(sctx); mutex_unlock(&cmd_clk_mtx); } } static int mdss_mdp_cmd_add_vsync_handler(struct mdss_mdp_ctl *ctl, struct mdss_mdp_vsync_handler *handle) { struct mdss_mdp_ctl *sctl = NULL; struct mdss_mdp_cmd_ctx *ctx, *sctx = NULL; unsigned long flags; bool enable_rdptr = false; ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("%s: invalid ctx\n", __func__); return -ENODEV; } MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); sctl = mdss_mdp_get_split_ctl(ctl); if (sctl) sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; spin_lock_irqsave(&ctx->clk_lock, flags); if (!handle->enabled) { handle->enabled = true; list_add(&handle->list, &ctx->vsync_handlers); enable_rdptr = !handle->cmd_post_flush; if (enable_rdptr) { ctx->vsync_enabled++; if (sctx) sctx->vsync_enabled++; } } spin_unlock_irqrestore(&ctx->clk_lock, flags); if (enable_rdptr) { if (ctl->panel_data->panel_info.is_split_display) mutex_lock(&cmd_clk_mtx); mdss_mdp_cmd_clk_on(ctx); if (sctx) mdss_mdp_cmd_clk_on(sctx); if (ctl->panel_data->panel_info.is_split_display) mutex_unlock(&cmd_clk_mtx); } return 0; } static int mdss_mdp_cmd_remove_vsync_handler(struct mdss_mdp_ctl *ctl, struct mdss_mdp_vsync_handler *handle) { struct mdss_mdp_ctl *sctl; struct mdss_mdp_cmd_ctx *ctx, *sctx = NULL; unsigned long flags; ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("%s: invalid ctx\n", __func__); return -ENODEV; } MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled, 0x88888); sctl = mdss_mdp_get_split_ctl(ctl); if (sctl) sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; spin_lock_irqsave(&ctx->clk_lock, flags); if (handle->enabled) { handle->enabled = false; list_del_init(&handle->list); if (!handle->cmd_post_flush) { if (ctx->vsync_enabled) { ctx->vsync_enabled--; if (sctx) sctx->vsync_enabled--; } else WARN(1, "unbalanced vsync disable"); } } spin_unlock_irqrestore(&ctx->clk_lock, flags); return 0; } int mdss_mdp_cmd_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, bool handoff) { struct mdss_panel_data *pdata; struct mdss_mdp_ctl *sctl = mdss_mdp_get_split_ctl(ctl); int ret = 0; pdata = ctl->panel_data; mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL, (void *)0); pdata->panel_info.cont_splash_enabled = 0; if (sctl) sctl->panel_data->panel_info.cont_splash_enabled = 0; else if (pdata->next && is_pingpong_split(ctl->mfd)) pdata->next->panel_info.cont_splash_enabled = 0; return ret; } static int mdss_mdp_cmd_wait4pingpong(struct mdss_mdp_ctl *ctl, void *arg) { struct mdss_mdp_cmd_ctx *ctx; struct mdss_panel_data *pdata; unsigned long flags; int rc = 0; ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("invalid ctx\n"); return -ENODEV; } pdata = ctl->panel_data; MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled, ctl->roi_bkup.w, ctl->roi_bkup.h); pr_debug("%s: intf_num=%d ctx=%p koff_cnt=%d\n", __func__, ctl->intf_num, ctx, atomic_read(&ctx->koff_cnt)); rc = wait_event_timeout(ctx->pp_waitq, atomic_read(&ctx->koff_cnt) == 0, KOFF_TIMEOUT); trace_mdp_cmd_wait_pingpong(ctl->num, atomic_read(&ctx->koff_cnt)); if (rc <= 0) { u32 status, mask; mask = BIT(MDSS_MDP_IRQ_PING_PONG_COMP + ctx->pp_num); status = mask & readl_relaxed(ctl->mdata->mdp_base + MDSS_MDP_REG_INTR_STATUS); if (status) { WARN(1, "pp done but irq not triggered\n"); mdss_mdp_irq_clear(ctl->mdata, MDSS_MDP_IRQ_PING_PONG_COMP, ctx->pp_num); local_irq_save(flags); mdss_mdp_cmd_pingpong_done(ctl); local_irq_restore(flags); rc = 1; } rc = atomic_read(&ctx->koff_cnt) == 0; } if (rc <= 0) { if (!ctx->pp_timeout_report_cnt) { WARN(1, "cmd kickoff timed out (%d) ctl=%d\n", rc, ctl->num); MDSS_XLOG_TOUT_HANDLER("mdp", "dsi0_ctrl", "dsi0_phy", "dsi1_ctrl", "dsi1_phy", "panic"); } ctx->pp_timeout_report_cnt++; rc = -EPERM; mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_TIMEOUT); atomic_add_unless(&ctx->koff_cnt, -1, 0); } else { rc = 0; ctx->pp_timeout_report_cnt = 0; } cancel_work_sync(&ctx->pp_done_work); while (atomic_add_unless(&ctx->pp_done_cnt, -1, 0)) mdss_mdp_ctl_notify(ctx->ctl, MDP_NOTIFY_FRAME_DONE); MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled, rc); return rc; } static int mdss_mdp_cmd_do_notifier(struct mdss_mdp_cmd_ctx *ctx) { struct mdss_mdp_cmd_ctx *sctx; sctx = ctx->sync_ctx; if (!sctx || atomic_read(&sctx->koff_cnt) == 0) return 1; return 0; } static void mdss_mdp_cmd_set_sync_ctx( struct mdss_mdp_ctl *ctl, struct mdss_mdp_ctl *sctl) { struct mdss_mdp_cmd_ctx *ctx, *sctx; ctx = (struct mdss_mdp_cmd_ctx *)ctl->intf_ctx[MASTER_CTX]; if (!sctl) { ctx->sync_ctx = NULL; return; } sctx = (struct mdss_mdp_cmd_ctx *)sctl->intf_ctx[MASTER_CTX]; if (!sctl->roi.w && !sctl->roi.h) { ctx->sync_ctx = NULL; sctx->sync_ctx = NULL; } else { ctx->sync_ctx = sctx; sctx->sync_ctx = ctx; } } static int mdss_mdp_cmd_set_partial_roi(struct mdss_mdp_ctl *ctl) { int rc = 0; if (!ctl->panel_data->panel_info.partial_update_supported) return rc; rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_ENABLE_PARTIAL_ROI, NULL); return rc; } static int mdss_mdp_cmd_set_stream_size(struct mdss_mdp_ctl *ctl) { int rc = 0; if (!ctl->panel_data->panel_info.partial_update_supported) return rc; rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_STREAM_SIZE, NULL); return rc; } static int mdss_mdp_cmd_panel_on(struct mdss_mdp_ctl *ctl, struct mdss_mdp_ctl *sctl) { struct mdss_mdp_cmd_ctx *ctx, *sctx = NULL; int rc = 0; ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("invalid ctx\n"); return -ENODEV; } if (sctl) sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; if (!__mdss_mdp_cmd_is_panel_power_on_interactive(ctx)) { rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL); WARN(rc, "intf %d link ready error (%d)\n", ctl->intf_num, rc); rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK, NULL); WARN(rc, "intf %d unblank error (%d)\n", ctl->intf_num, rc); rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, NULL); WARN(rc, "intf %d panel on error (%d)\n", ctl->intf_num, rc); ctx->panel_power_state = MDSS_PANEL_POWER_ON; if (sctx) sctx->panel_power_state = MDSS_PANEL_POWER_ON; mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_REGISTER_RECOVERY_HANDLER, (void *)&ctx->intf_recovery); ctx->intf_stopped = 0; } else { pr_err("%s: Panel already on\n", __func__); } return rc; } static int __mdss_mdp_cmd_configure_autorefresh(struct mdss_mdp_ctl *ctl, int frame_cnt, bool delayed) { struct mdss_mdp_cmd_ctx *ctx; bool enable = frame_cnt ? true : false; if (!ctl || !ctl->mixer_left) { pr_err("invalid ctl structure\n"); return -ENODEV; } ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("invalid ctx\n"); return -ENODEV; } if (frame_cnt == ctl->autorefresh_frame_cnt) { pr_debug("No change to the refresh count\n"); return 0; } pr_debug("%s enable = %d frame_cnt = %d init=%d\n", __func__, enable, frame_cnt, ctx->autorefresh_init); mutex_lock(&ctx->autorefresh_mtx); if (enable) { if (delayed) { ctx->autorefresh_pending_frame_cnt = frame_cnt; } else { if (!ctx->autorefresh_init) { ctx->autorefresh_init = true; mdss_mdp_cmd_clk_on(ctx); } mdss_mdp_pingpong_write(ctl->mixer_left->pingpong_base, MDSS_MDP_REG_PP_AUTOREFRESH_CONFIG, BIT(31) | frame_cnt); mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_START, 1); ctl->autorefresh_frame_cnt = frame_cnt; ctl->cmd_autorefresh_en = true; } } else { if (ctx->autorefresh_init) { mdss_mdp_pingpong_write(ctl->mixer_left->pingpong_base, MDSS_MDP_REG_PP_AUTOREFRESH_CONFIG, 0); } ctx->autorefresh_init = false; ctx->autorefresh_pending_frame_cnt = 0; ctx->autorefresh_off_pending = true; ctl->autorefresh_frame_cnt = 0; ctl->cmd_autorefresh_en = false; } mutex_unlock(&ctx->autorefresh_mtx); return 0; } int mdss_mdp_cmd_set_autorefresh_mode(struct mdss_mdp_ctl *ctl, int frame_cnt) { return __mdss_mdp_cmd_configure_autorefresh(ctl, frame_cnt, true); } static int mdss_mdp_cmd_enable_cmd_autorefresh(struct mdss_mdp_ctl *ctl, int frame_cnt) { return __mdss_mdp_cmd_configure_autorefresh(ctl, frame_cnt, false); } int mdss_mdp_cmd_kickoff(struct mdss_mdp_ctl *ctl, void *arg) { struct mdss_mdp_ctl *sctl = NULL; struct mdss_mdp_cmd_ctx *ctx, *sctx = NULL; ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("invalid ctx\n"); return -ENODEV; } if (ctx->intf_stopped) { pr_err("ctx=%d stopped already\n", ctx->pp_num); return -EPERM; } INIT_COMPLETION(ctx->readptr_done); sctl = mdss_mdp_get_split_ctl(ctl); if (sctl && (sctl->roi.w == 0 || sctl->roi.h == 0)) { sctl = NULL; } mdss_mdp_ctl_perf_set_transaction_status(ctl, PERF_HW_MDP_STATE, PERF_STATUS_BUSY); if (sctl) { sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; mdss_mdp_ctl_perf_set_transaction_status(sctl, PERF_HW_MDP_STATE, PERF_STATUS_BUSY); } if (__mdss_mdp_cmd_is_panel_power_off(ctx)) mdss_mdp_cmd_panel_on(ctl, sctl); MDSS_XLOG(ctl->num, ctl->roi.x, ctl->roi.y, ctl->roi.w, ctl->roi.h); atomic_inc(&ctx->koff_cnt); if (sctx) atomic_inc(&sctx->koff_cnt); trace_mdp_cmd_kickoff(ctl->num, atomic_read(&ctx->koff_cnt)); mdss_mdp_cmd_clk_on(ctx); mdss_mdp_cmd_set_partial_roi(ctl); mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_CMDLIST_KOFF, NULL); mdss_mdp_cmd_set_stream_size(ctl); mdss_mdp_cmd_set_sync_ctx(ctl, sctl); if (ctx->autorefresh_init || ctx->autorefresh_off_pending) { pr_debug("Wait for read pointer done before enabling PP irq\n"); wait_for_completion(&ctx->readptr_done); mdss_mdp_cmd_clk_on(ctx); } mdss_mdp_irq_enable(MDSS_MDP_IRQ_PING_PONG_COMP, ctx->pp_num); if (sctx) mdss_mdp_irq_enable(MDSS_MDP_IRQ_PING_PONG_COMP, sctx->pp_num); if (!ctx->autorefresh_pending_frame_cnt && !ctl->cmd_autorefresh_en) { mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_START, 1); } else { pr_debug("Enabling autorefresh in hardware.\n"); mdss_mdp_cmd_enable_cmd_autorefresh(ctl, ctx->autorefresh_pending_frame_cnt); } mdss_mdp_ctl_perf_set_transaction_status(ctl, PERF_SW_COMMIT_STATE, PERF_STATUS_DONE); if (sctl) { mdss_mdp_ctl_perf_set_transaction_status(sctl, PERF_SW_COMMIT_STATE, PERF_STATUS_DONE); } mb(); MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); return 0; } int mdss_mdp_cmd_restore(struct mdss_mdp_ctl *ctl) { pr_debug("%s: called for ctl%d\n", __func__, ctl->num); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); if (mdss_mdp_cmd_tearcheck_setup(ctl->intf_ctx[MASTER_CTX], true)) pr_warn("%s: tearcheck setup failed\n", __func__); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); return 0; } int mdss_mdp_cmd_ctx_stop(struct mdss_mdp_ctl *ctl, struct mdss_mdp_cmd_ctx *ctx, int panel_power_state, bool pend_switch) { struct mdss_mdp_cmd_ctx *sctx = NULL; struct mdss_mdp_ctl *sctl = NULL; unsigned long flags; unsigned long sflags; int need_wait = 0; int hz; sctl = mdss_mdp_get_split_ctl(ctl); if (sctl) sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; ctx->intf_stopped = 1; spin_lock_irqsave(&ctx->clk_lock, flags); if (ctx->rdptr_enabled) { INIT_COMPLETION(ctx->stop_comp); need_wait = 1; ctx->rdptr_enabled = 1; if (sctx) { spin_lock_irqsave(&sctx->clk_lock, sflags); if (sctx->rdptr_enabled) sctx->rdptr_enabled = 1; spin_unlock_irqrestore(&sctx->clk_lock, sflags); } } spin_unlock_irqrestore(&ctx->clk_lock, flags); if (need_wait) { hz = mdss_panel_get_framerate(&ctl->panel_data->panel_info); if (wait_for_completion_timeout(&ctx->stop_comp, STOP_TIMEOUT(hz)) <= 0) { WARN(1, "stop cmd time out\n"); mdss_mdp_irq_disable(MDSS_MDP_IRQ_PING_PONG_RD_PTR, ctx->pp_num); ctx->rdptr_enabled = 0; atomic_set(&ctx->koff_cnt, 0); } } if (cancel_work_sync(&ctx->clk_work)) pr_debug("no pending clk work\n"); if (!pend_switch) { mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_REGISTER_RECOVERY_HANDLER, NULL); } mdss_mdp_cmd_clk_off(ctx); flush_work(&ctx->pp_done_work); mdss_mdp_cmd_tearcheck_setup(ctx, false); if (mdss_panel_is_power_on(panel_power_state)) { pr_debug("%s: intf stopped with panel on\n", __func__); return 0; } mdss_mdp_set_intr_callback(MDSS_MDP_IRQ_PING_PONG_RD_PTR, ctx->pp_num, NULL, NULL); mdss_mdp_set_intr_callback(MDSS_MDP_IRQ_PING_PONG_COMP, ctx->pp_num, NULL, NULL); memset(ctx, 0, sizeof(*ctx)); return 0; } int mdss_mdp_cmd_intfs_stop(struct mdss_mdp_ctl *ctl, int session, int panel_power_state, bool pend_switch) { struct mdss_mdp_cmd_ctx *ctx; if (session >= MAX_SESSIONS) return 0; ctx = ctl->intf_ctx[MASTER_CTX]; if (!ctx->ref_cnt) { pr_err("invalid ctx session: %d\n", session); return -ENODEV; } mdss_mdp_cmd_ctx_stop(ctl, ctx, panel_power_state, pend_switch); if (is_pingpong_split(ctl->mfd)) { session += 1; if (session >= MAX_SESSIONS) return 0; ctx = ctl->intf_ctx[SLAVE_CTX]; if (!ctx->ref_cnt) { pr_err("invalid ctx session: %d\n", session); return -ENODEV; } mdss_mdp_cmd_ctx_stop(ctl, ctx, panel_power_state, pend_switch); } pr_debug("%s:-\n", __func__); return 0; } static int mdss_mdp_cmd_stop_sub(struct mdss_mdp_ctl *ctl, int panel_power_state, bool pend_switch) { struct mdss_mdp_cmd_ctx *ctx; struct mdss_mdp_vsync_handler *tmp, *handle; int session; ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX]; if (!ctx) { pr_err("invalid ctx\n"); return -ENODEV; } list_for_each_entry_safe(handle, tmp, &ctx->vsync_handlers, list) mdss_mdp_cmd_remove_vsync_handler(ctl, handle); MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled, XLOG_FUNC_ENTRY); session = ctl->intf_num - MDSS_MDP_INTF1; return mdss_mdp_cmd_intfs_stop(ctl, session, panel_power_state, pend_switch); } int mdss_mdp_cmd_stop(struct mdss_mdp_ctl *ctl, int panel_power_state) { struct mdss_mdp_cmd_ctx *ctx = ctl->intf_ctx[MASTER_CTX]; struct mdss_mdp_ctl *sctl = mdss_mdp_get_split_ctl(ctl); bool panel_off = false; bool turn_off_clocks = false; bool send_panel_events = false; bool pend_switch = false; int ret = 0; if (!ctx) { pr_err("invalid ctx\n"); return -ENODEV; } if (__mdss_mdp_cmd_is_panel_power_off(ctx)) { pr_debug("%s: panel already off\n", __func__); return 0; } if (ctx->panel_power_state == panel_power_state) { pr_debug("%s: no transition needed %d --> %d\n", __func__, ctx->panel_power_state, panel_power_state); return 0; } pr_debug("%s: transition from %d --> %d\n", __func__, ctx->panel_power_state, panel_power_state); if (ctl->cmd_autorefresh_en) { int pre_suspend = ctx->autorefresh_pending_frame_cnt; mdss_mdp_cmd_enable_cmd_autorefresh(ctl, 0); ctx->autorefresh_pending_frame_cnt = pre_suspend; } mutex_lock(&ctl->offlock); if (__mdss_mdp_cmd_is_panel_power_on_interactive(ctx)) { if (mdss_panel_is_power_on_lp(panel_power_state)) { send_panel_events = true; if (mdss_panel_is_power_on_ulp(panel_power_state)) turn_off_clocks = true; } else if (mdss_panel_is_power_off(panel_power_state)) { send_panel_events = true; turn_off_clocks = true; panel_off = true; } } else { if (mdss_panel_is_power_on_ulp(panel_power_state)) { pr_debug("%s: turn off clocks\n", __func__); turn_off_clocks = true; } else { pr_debug("%s: reset intf_stopped flag.\n", __func__); ctx->intf_stopped = 0; goto end; } } if (!turn_off_clocks) goto panel_events; if (ctx->pending_mode_switch) { pend_switch = true; send_panel_events = false; ctx->pending_mode_switch = 0; } pr_debug("%s: turn off interface clocks\n", __func__); ret = mdss_mdp_cmd_stop_sub(ctl, panel_power_state, pend_switch); if (IS_ERR_VALUE(ret)) { pr_err("%s: unable to stop interface: %d\n", __func__, ret); goto end; } if (sctl) { mdss_mdp_cmd_stop_sub(sctl, panel_power_state, pend_switch); if (IS_ERR_VALUE(ret)) { pr_err("%s: unable to stop slave intf: %d\n", __func__, ret); goto end; } } panel_events: if ((ctl->num == 0) && send_panel_events) { pr_debug("%s: send panel events\n", __func__); ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, (void *) (long int) panel_power_state); WARN(ret, "intf %d unblank error (%d)\n", ctl->intf_num, ret); ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF, (void *) (long int) panel_power_state); WARN(ret, "intf %d unblank error (%d)\n", ctl->intf_num, ret); } if (!panel_off) { pr_debug("%s: cmd_stop with panel always on\n", __func__); goto end; } pr_debug("%s: turn off panel\n", __func__); ctl->intf_ctx[MASTER_CTX] = NULL; ctl->intf_ctx[SLAVE_CTX] = NULL; ctl->ops.stop_fnc = NULL; ctl->ops.display_fnc = NULL; ctl->ops.wait_pingpong = NULL; ctl->ops.add_vsync_handler = NULL; ctl->ops.remove_vsync_handler = NULL; end: if (!IS_ERR_VALUE(ret)) ctx->panel_power_state = panel_power_state; MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled, XLOG_FUNC_EXIT); mutex_unlock(&ctl->offlock); pr_debug("%s:-\n", __func__); return ret; } static int mdss_mdp_cmd_ctx_setup(struct mdss_mdp_ctl *ctl, struct mdss_mdp_cmd_ctx *ctx, int pp_num, int pingpong_split_slave) { int ret = 0; ctx->ctl = ctl; ctx->pp_num = pp_num; ctx->pingpong_split_slave = pingpong_split_slave; ctx->pp_timeout_report_cnt = 0; init_waitqueue_head(&ctx->pp_waitq); init_completion(&ctx->stop_comp); init_completion(&ctx->readptr_done); spin_lock_init(&ctx->clk_lock); spin_lock_init(&ctx->koff_lock); mutex_init(&ctx->clk_mtx); mutex_init(&ctx->autorefresh_mtx); INIT_WORK(&ctx->clk_work, clk_ctrl_work); INIT_WORK(&ctx->pp_done_work, pingpong_done_work); atomic_set(&ctx->pp_done_cnt, 0); ctx->autorefresh_off_pending = false; ctx->autorefresh_init = false; INIT_LIST_HEAD(&ctx->vsync_handlers); ctx->intf_recovery.fxn = mdss_mdp_cmd_intf_recovery; ctx->intf_recovery.data = ctx; ctx->intf_stopped = 0; pr_debug("%s: ctx=%p num=%d\n", __func__, ctx, ctx->pp_num); MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), ctx->clk_enabled, ctx->rdptr_enabled); mdss_mdp_set_intr_callback(MDSS_MDP_IRQ_PING_PONG_RD_PTR, ctx->pp_num, mdss_mdp_cmd_readptr_done, ctl); mdss_mdp_set_intr_callback(MDSS_MDP_IRQ_PING_PONG_COMP, ctx->pp_num, mdss_mdp_cmd_pingpong_done, ctl); ret = mdss_mdp_cmd_tearcheck_setup(ctx, true); if (ret) pr_err("tearcheck setup failed\n"); return ret; } static int mdss_mdp_cmd_intfs_setup(struct mdss_mdp_ctl *ctl, int session) { struct mdss_mdp_cmd_ctx *ctx; struct mdss_mdp_ctl *sctl = NULL; struct mdss_mdp_mixer *mixer; int ret; if (session >= MAX_SESSIONS) return 0; sctl = mdss_mdp_get_split_ctl(ctl); ctx = &mdss_mdp_cmd_ctx_list[session]; if (ctx->ref_cnt) { if (mdss_panel_is_power_on(ctx->panel_power_state)) { pr_debug("%s: cmd_start with panel always on\n", __func__); mdss_mdp_cmd_restore(ctl); return mdss_mdp_cmd_panel_on(ctl, sctl); } else { pr_err("Intf %d already in use\n", session); return -EBUSY; } } ctx->ref_cnt++; mixer = mdss_mdp_mixer_get(ctl, MDSS_MDP_MIXER_MUX_LEFT); if (!mixer) { pr_err("mixer not setup correctly\n"); return -ENODEV; } ctl->intf_ctx[MASTER_CTX] = ctx; ret = mdss_mdp_cmd_ctx_setup(ctl, ctx, session, false); if (ret) { pr_err("mdss_mdp_cmd_ctx_setup failed for ping ping: %d\n", mixer->num); ctx->ref_cnt--; return -ENODEV; } if (is_pingpong_split(ctl->mfd)) { session += 1; if (session >= MAX_SESSIONS) return 0; ctx = &mdss_mdp_cmd_ctx_list[session]; if (ctx->ref_cnt) { if (mdss_panel_is_power_on(ctx->panel_power_state)) { pr_debug("%s: cmd_start with panel always on\n", __func__); mdss_mdp_cmd_restore(ctl); return mdss_mdp_cmd_panel_on(ctl, sctl); } else { pr_err("Intf %d already in use\n", session); return -EBUSY; } } ctx->ref_cnt++; ctl->intf_ctx[SLAVE_CTX] = ctx; ret = mdss_mdp_cmd_ctx_setup(ctl, ctx, session, true); if (ret) { pr_err("mdss_mdp_cmd_ctx_setup failed for slave ping pong block"); ctx->ref_cnt--; return -EPERM; } } return 0; } void mdss_mdp_switch_roi_reset(struct mdss_mdp_ctl *ctl) { struct mdss_mdp_ctl *sctl = mdss_mdp_get_split_ctl(ctl); if (!ctl->panel_data || !ctl->panel_data->panel_info.partial_update_supported) return; ctl->panel_data->panel_info.roi = ctl->roi; if (sctl && sctl->panel_data) sctl->panel_data->panel_info.roi = sctl->roi; mdss_mdp_cmd_set_partial_roi(ctl); } void mdss_mdp_switch_to_vid_mode(struct mdss_mdp_ctl *ctl, int prep) { struct mdss_mdp_cmd_ctx *ctx = ctl->intf_ctx[MASTER_CTX]; long int mode = MIPI_VIDEO_PANEL; int rc = 0; pr_debug("%s start, prep = %d\n", __func__, prep); if (prep) { rc = mdss_mdp_ctl_intf_event (ctl, MDSS_EVENT_PANEL_CLK_CTRL, (void *)1); ctx->pending_mode_switch = 1; return; } mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RECONFIG_CMD, (void *) mode); } int mdss_mdp_cmd_start(struct mdss_mdp_ctl *ctl) { int ret, session = 0; pr_debug("%s:+\n", __func__); session = ctl->intf_num - MDSS_MDP_INTF1; ret = mdss_mdp_cmd_intfs_setup(ctl, session); if (IS_ERR_VALUE(ret)) { pr_err("unable to set cmd interface: %d\n", ret); return ret; } ctl->ops.stop_fnc = mdss_mdp_cmd_stop; ctl->ops.display_fnc = mdss_mdp_cmd_kickoff; ctl->ops.wait_pingpong = mdss_mdp_cmd_wait4pingpong; ctl->ops.add_vsync_handler = mdss_mdp_cmd_add_vsync_handler; ctl->ops.remove_vsync_handler = mdss_mdp_cmd_remove_vsync_handler; ctl->ops.read_line_cnt_fnc = mdss_mdp_cmd_line_count; ctl->ops.restore_fnc = mdss_mdp_cmd_restore; pr_debug("%s:-\n", __func__); return 0; }
javelinanddart/ElementalX-m9
drivers/video/msm/mdss/mdss_mdp_intf_cmd.c
C
gpl-2.0
34,621
/* * Copyright (c) 2005, 2013, Oracle and/or its affiliates. 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. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.openjdk.jmh.it.fails; import org.junit.Assert; import org.junit.Test; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Threads; import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.it.Fixtures; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; /** * Baseline test: * Checks if assertions are propagated back to integration tests. */ @BenchmarkMode(Mode.All) @State(Scope.Benchmark) public class FailingBenchmarkBenchSetupTest { @Setup public void setup() { Assert.fail(); } @Benchmark @Warmup(iterations = 0) @Measurement(iterations = 1, time = 1) @Fork(1) @Threads(4) public void test() { Fixtures.work(); } @Test public void invokeAPI() throws RunnerException { try { Options opt = new OptionsBuilder() .include(Fixtures.getTestMask(this.getClass())) .shouldFailOnError(true) .build(); new Runner(opt).run(); Assert.fail("Should have failed"); } catch (Throwable t) { // expected } } }
tauprojects/mpp
jmh/jmh-core-it/src/test/java/org/openjdk/jmh/it/fails/FailingBenchmarkBenchSetupTest.java
Java
gpl-2.0
2,810
//Anything above this #include will be ignored by the compiler #include "../qcommon/exe_headers.h" // tr_models.c -- model loading and caching #include "tr_local.h" #include "../qcommon/disablewarnings.h" #pragma warning (push, 3) //go back down to 3 for the stl include #include "../qcommon/sstring.h" // #include <string> #include <vector> #include <map> #pragma warning (pop) using namespace std; #ifdef _XBOX #include "../cgame/cg_local.h" #include "modelmem.h" ModelMemoryManager ModelMem; #include "../zlib/zlib.h" #endif #define LL(x) x=LittleLong(x) static qboolean R_LoadMD3 (model_t *mod, int lod, void *buffer, const char *name, qboolean &bAlreadyCached ); /* Ghoul2 Insert Start */ //typedef struct modelHash_s //{ // char name[MAX_QPATH]; // qhandle_t handle; // struct modelHash_s *next; // //}modelHash_t; // //#define FILE_HASH_SIZE 2048 //static modelHash_t *mhHashTable[FILE_HASH_SIZE]; typedef map<unsigned long, qhandle_t> HashTable; typedef HashTable::iterator HashTableIterator; HashTable *mhHashTable = NULL; /* Ghoul2 Insert End */ // This stuff looks a bit messy, but it's kept here as black box, and nothing appears in any .H files for other // modules to worry about. I may make another module for this sometime. // typedef pair<int,int> StringOffsetAndShaderIndexDest_t; typedef vector <StringOffsetAndShaderIndexDest_t> ShaderRegisterData_t; struct CachedEndianedModelBinary_s { void *pModelDiskImage; int iAllocSize; // may be useful for mem-query, but I don't actually need it ShaderRegisterData_t ShaderRegisterData; int iLastLevelUsedOn; int iPAKFileCheckSum; // else -1 if not from PAK #ifdef _XBOX int ID; #endif CachedEndianedModelBinary_s() { pModelDiskImage = 0; iAllocSize = 0; ShaderRegisterData.clear(); iLastLevelUsedOn = -1; iPAKFileCheckSum = -1; #ifdef _XBOX ID = -1; #endif } }; typedef struct CachedEndianedModelBinary_s CachedEndianedModelBinary_t; typedef map <sstring_t,CachedEndianedModelBinary_t> CachedModels_t; CachedModels_t *CachedModels = NULL; // the important cache item. void RE_RegisterModels_StoreShaderRequest(const char *psModelFileName, const char *psShaderName, int *piShaderIndexPoke) { char sModelName[MAX_QPATH]; assert(CachedModels); Q_strncpyz(sModelName,psModelFileName,sizeof(sModelName)); Q_strlwr (sModelName); CachedEndianedModelBinary_t &ModelBin = (*CachedModels)[sModelName]; if (ModelBin.pModelDiskImage == NULL) { assert(0); // should never happen, means that we're being called on a model that wasn't loaded } else { int iNameOffset = psShaderName - (char *)ModelBin.pModelDiskImage; int iPokeOffset = (char*) piShaderIndexPoke - (char *)ModelBin.pModelDiskImage; ModelBin.ShaderRegisterData.push_back( StringOffsetAndShaderIndexDest_t( iNameOffset,iPokeOffset) ); } } static const byte FakeGLAFile[] = { 0x32, 0x4C, 0x47, 0x41, 0x06, 0x00, 0x00, 0x00, 0x2A, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x01, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x4D, 0x6F, 0x64, 0x56, 0x69, 0x65, 0x77, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x6E, 0x61, 0x6C, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x00, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xBF, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80 }; void RE_LoadWorldMap_Actual( const char *name, world_t &worldData, int index ); // returns qtrue if loaded, and sets the supplied qbool to true if it was from cache (instead of disk) // (which we need to know to avoid LittleLong()ing everything again (well, the Mac needs to know anyway)... // // don't use ri.xxx functions in case running on dedicated... // qboolean RE_RegisterModels_GetDiskFile( const char *psModelFileName, void **ppvBuffer, qboolean *pqbAlreadyCached) { char sModelName[MAX_QPATH]; assert(CachedModels); Q_strncpyz(sModelName,psModelFileName,sizeof(sModelName)); Q_strlwr (sModelName); CachedEndianedModelBinary_t &ModelBin = (*CachedModels)[sModelName]; if (ModelBin.pModelDiskImage == NULL) { // didn't have it cached, so try the disk... // // special case intercept first... // if (!strcmp(sDEFAULT_GLA_NAME ".gla" , psModelFileName)) { // return fake params as though it was found on disk... // void *pvFakeGLAFile = Z_Malloc( sizeof(FakeGLAFile), TAG_FILESYS, qfalse ); memcpy(pvFakeGLAFile, &FakeGLAFile[0], sizeof(FakeGLAFile)); *ppvBuffer = pvFakeGLAFile; *pqbAlreadyCached = qfalse; // faking it like this should mean that it works fine on the Mac as well return qtrue; } FS_ReadFile( sModelName, ppvBuffer ); *pqbAlreadyCached = qfalse; qboolean bSuccess = !!(*ppvBuffer)?qtrue:qfalse; if (bSuccess) { Com_DPrintf( "RE_RegisterModels_GetDiskFile(): Disk-loading \"%s\"\n",psModelFileName); } return bSuccess; } else { *ppvBuffer = ModelBin.pModelDiskImage; *pqbAlreadyCached = qtrue; return qtrue; } } // if return == true, no further action needed by the caller... // // don't use ri.xxx functions in case running on dedicated // extern cvar_t *sv_pure; #ifdef _XBOX void *RE_RegisterModels_Malloc(int iSize, void *pvDiskBufferIfJustLoaded, const char *psModelFileName, qboolean *pqbAlreadyFound, memtag_t eTag, int modindex, bool useModelMem) #else void *RE_RegisterModels_Malloc(int iSize, void *pvDiskBufferIfJustLoaded, const char *psModelFileName, qboolean *pqbAlreadyFound, memtag_t eTag) #endif { char sModelName[MAX_QPATH]; assert(CachedModels); #ifdef _XBOX static int modelCount = 0; #endif Q_strncpyz(sModelName,psModelFileName,sizeof(sModelName)); Q_strlwr (sModelName); CachedEndianedModelBinary_t &ModelBin = (*CachedModels)[sModelName]; if (ModelBin.pModelDiskImage == NULL) { // ... then this entry has only just been created, ie we need to load it fully... // // new, instead of doing a Z_Malloc and assigning that we just morph the disk buffer alloc // then don't thrown it away on return - cuts down on mem overhead // // ... groan, but not if doing a limb hierarchy creation (some VV stuff?), in which case it's NULL // #ifndef _XBOX // Can't re-tag allocated memory! if ( pvDiskBufferIfJustLoaded ) { Z_MorphMallocTag( pvDiskBufferIfJustLoaded, eTag ); } else #endif { #ifdef _XBOX // if(strstr(sModelName, "players") && eTag == TAG_MODEL_GLM && ModelMem.IsNPCMode() == false) { if(useModelMem) { pvDiskBufferIfJustLoaded = ModelMem.GetModelMemory(iSize, modindex, sModelName); ModelBin.ID = modindex; } else #endif pvDiskBufferIfJustLoaded = Z_Malloc(iSize,eTag, qfalse ); } ModelBin.pModelDiskImage = pvDiskBufferIfJustLoaded; ModelBin.iAllocSize = iSize; int iCheckSum; if (FS_FileIsInPAK(sModelName, &iCheckSum) == 1) { ModelBin.iPAKFileCheckSum = iCheckSum; // else ModelBin's constructor will leave it as -1 } *pqbAlreadyFound = qfalse; } else { #ifndef DEDICATED // if we already had this model entry, then re-register all the shaders it wanted... // int iEntries = ModelBin.ShaderRegisterData.size(); for (int i=0; i<iEntries; i++) { int iShaderNameOffset = ModelBin.ShaderRegisterData[i].first; int iShaderPokeOffset = ModelBin.ShaderRegisterData[i].second; char *psShaderName = &((char*)ModelBin.pModelDiskImage)[iShaderNameOffset]; int *piShaderPokePtr = (int *) &((char*)ModelBin.pModelDiskImage)[iShaderPokeOffset]; shader_t *sh = R_FindShader( psShaderName, lightmapsNone, stylesDefault, qtrue ); if ( sh->defaultShader ) { *piShaderPokePtr = 0; } else { *piShaderPokePtr = sh->index; } } #endif //!DEDICATED *pqbAlreadyFound = qtrue; // tell caller not to re-Endian or re-Shader this binary } ModelBin.iLastLevelUsedOn = RE_RegisterMedia_GetLevel(); return ModelBin.pModelDiskImage; } // Unfortunately the dedicated server also hates shader loading. So we need an alternate of this func. // void *RE_RegisterServerModels_Malloc(int iSize, void *pvDiskBufferIfJustLoaded, const char *psModelFileName, qboolean *pqbAlreadyFound, memtag_t eTag, int modindex) { char sModelName[MAX_QPATH]; assert(CachedModels); Q_strncpyz(sModelName,psModelFileName,sizeof(sModelName)); Q_strlwr (sModelName); CachedEndianedModelBinary_t &ModelBin = (*CachedModels)[sModelName]; if (ModelBin.pModelDiskImage == NULL) { // new, instead of doing a Z_Malloc and assigning that we just morph the disk buffer alloc // then don't thrown it away on return - cuts down on mem overhead // // ... groan, but not if doing a limb hierarchy creation (some VV stuff?), in which case it's NULL // #ifndef _XBOX // Can't re-tag allocated memory! if ( pvDiskBufferIfJustLoaded ) { Z_MorphMallocTag( pvDiskBufferIfJustLoaded, eTag ); } else #endif { if(strstr(sModelName, "players") && eTag == TAG_MODEL_GLM && ModelMem.IsNPCMode() == false) { pvDiskBufferIfJustLoaded = ModelMem.GetModelMemory(iSize, modindex, sModelName); ModelBin.ID = modindex; } else pvDiskBufferIfJustLoaded = Z_Malloc(iSize,eTag, qfalse ); } ModelBin.pModelDiskImage = pvDiskBufferIfJustLoaded; ModelBin.iAllocSize = iSize; int iCheckSum; if (FS_FileIsInPAK(sModelName, &iCheckSum) == 1) { ModelBin.iPAKFileCheckSum = iCheckSum; // else ModelBin's constructor will leave it as -1 } *pqbAlreadyFound = qfalse; } else { // if we already had this model entry, then re-register all the shaders it wanted... // /* int iEntries = ModelBin.ShaderRegisterData.size(); for (int i=0; i<iEntries; i++) { int iShaderNameOffset = ModelBin.ShaderRegisterData[i].first; int iShaderPokeOffset = ModelBin.ShaderRegisterData[i].second; char *psShaderName = &((char*)ModelBin.pModelDiskImage)[iShaderNameOffset]; int *piShaderPokePtr = (int *) &((char*)ModelBin.pModelDiskImage)[iShaderPokeOffset]; shader_t *sh = R_FindShader( psShaderName, lightmapsNone, stylesDefault, qtrue ); if ( sh->defaultShader ) { *piShaderPokePtr = 0; } else { *piShaderPokePtr = sh->index; } } */ //No. Bad. *pqbAlreadyFound = qtrue; // tell caller not to re-Endian or re-Shader this binary } ModelBin.iLastLevelUsedOn = RE_RegisterMedia_GetLevel(); return ModelBin.pModelDiskImage; } // dump any models not being used by this level if we're running low on memory... // static int GetModelDataAllocSize(void) { return Z_MemSize( TAG_MODEL_MD3) + Z_MemSize( TAG_MODEL_GLM) + Z_MemSize( TAG_MODEL_GLA); } extern cvar_t *r_modelpoolmegs; // // return qtrue if at least one cached model was freed (which tells z_malloc()-fail recoveryt code to try again) // extern qboolean gbInsideRegisterModel; qboolean RE_RegisterModels_LevelLoadEnd(qboolean bDeleteEverythingNotUsedThisLevel /* = qfalse */) { qboolean bAtLeastoneModelFreed = qfalse; assert(CachedModels); Com_DPrintf (S_COLOR_RED "RE_RegisterModels_LevelLoadEnd():\n"); if (gbInsideRegisterModel) { Com_DPrintf( "(Inside RE_RegisterModel (z_malloc recovery?), exiting...\n"); } else { int iLoadedModelBytes = GetModelDataAllocSize(); const int iMaxModelBytes= r_modelpoolmegs->integer * 1024 * 1024; qboolean bEraseOccured = qfalse; for (CachedModels_t::iterator itModel = CachedModels->begin(); itModel != CachedModels->end() && ( bDeleteEverythingNotUsedThisLevel || iLoadedModelBytes > iMaxModelBytes ); bEraseOccured?itModel:++itModel) { bEraseOccured = qfalse; CachedEndianedModelBinary_t &CachedModel = (*itModel).second; qboolean bDeleteThis = qfalse; if (bDeleteEverythingNotUsedThisLevel) { bDeleteThis = (CachedModel.iLastLevelUsedOn != RE_RegisterMedia_GetLevel()) ? qtrue : qfalse; } else { bDeleteThis = (CachedModel.iLastLevelUsedOn < RE_RegisterMedia_GetLevel()) ? qtrue : qfalse; } // if it wasn't used on this level, dump it... // if (bDeleteThis) { Com_Error( ERR_DROP, "Trying to delete from CachedModels in LevelLoadEnd" ); #if 0 LPCSTR psModelName = (*itModel).first.c_str(); Com_DPrintf (S_COLOR_RED "Dumping \"%s\"", psModelName); #ifdef _DEBUG Com_DPrintf (S_COLOR_RED ", used on lvl %d\n",CachedModel.iLastLevelUsedOn); #endif if (CachedModel.pModelDiskImage) { #ifdef _XBOX if(CachedModel.ID != -1) { ModelMem.FreeModelMemory(CachedModel.ID); } else #endif Z_Free(CachedModel.pModelDiskImage); //CachedModel.pModelDiskImage = NULL; // REM for reference, erase() call below negates the need for it. bAtLeastoneModelFreed = qtrue; } #ifndef __linux__ itModel = CachedModels->erase(itModel); bEraseOccured = qtrue; #else // Both MS and Dinkumware got the map::erase wrong // The STL has the return type as a void CachedModels_t::iterator itTemp; itTemp = itModel; itModel++; CachedModels->erase(itTemp); #endif iLoadedModelBytes = GetModelDataAllocSize(); #endif } } } Com_DPrintf (S_COLOR_RED "RE_RegisterModels_LevelLoadEnd(): Ok\n"); return bAtLeastoneModelFreed; } // scan through all loaded models and see if their PAK checksums are still valid with the current pure PAK lists, // dump any that aren't (so people can't cheat by using models with huge spikes that show through walls etc) // // (avoid using ri.xxxx stuff here in case running on dedicated) // #if 0 static void RE_RegisterModels_DumpNonPure(void) { Com_DPrintf( "RE_RegisterModels_DumpNonPure():\n"); if(!CachedModels) { return; } qboolean bEraseOccured = qfalse; for (CachedModels_t::iterator itModel = CachedModels->begin(); itModel != CachedModels->end(); bEraseOccured?itModel:++itModel) { bEraseOccured = qfalse; LPCSTR psModelName = (*itModel).first.c_str(); CachedEndianedModelBinary_t &CachedModel = (*itModel).second; int iCheckSum = -1; int iInPak = FS_FileIsInPAK(psModelName, &iCheckSum); if (iInPak == -1 || iCheckSum != CachedModel.iPAKFileCheckSum) { if (stricmp(sDEFAULT_GLA_NAME ".gla" , psModelName)) // don't dump "*default.gla", that's program internal anyway { // either this is not from a PAK, or it's from a non-pure one, so ditch it... // Com_DPrintf( "Dumping none pure model \"%s\"", psModelName); if (CachedModel.pModelDiskImage) { #ifdef _XBOX if(CachedModel.ID != -1) { ModelMem.FreeModelMemory(CachedModel.ID); } else #endif Z_Free(CachedModel.pModelDiskImage); //CachedModel.pModelDiskImage = NULL; // REM for reference, erase() call below negates the need for it. } #ifndef __linux__ itModel = CachedModels->erase(itModel); bEraseOccured = qtrue; #else // Both MS and Dinkumware got the map::erase wrong // The STL has the return type as a void CachedModels_t::iterator itTemp; itTemp = itModel; itModel++; CachedModels->erase(itTemp); #endif } } } Com_DPrintf( "RE_RegisterModels_DumpNonPure(): Ok\n"); } #endif void RE_RegisterModels_Info_f( void ) { int iTotalBytes = 0; if(!CachedModels) { Com_Printf ("%d bytes total (%.2fMB)\n",iTotalBytes, (float)iTotalBytes / 1024.0f / 1024.0f); return; } int iModels = CachedModels->size(); int iModel = 0; for (CachedModels_t::iterator itModel = CachedModels->begin(); itModel != CachedModels->end(); ++itModel,iModel++) { CachedEndianedModelBinary_t &CachedModel = (*itModel).second; Com_Printf ("%d/%d: \"%s\" (%d bytes)",iModel,iModels,(*itModel).first.c_str(),CachedModel.iAllocSize ); #ifdef _DEBUG Com_Printf (", lvl %d\n",CachedModel.iLastLevelUsedOn); #endif iTotalBytes += CachedModel.iAllocSize; } Com_Printf ("%d bytes total (%.2fMB)\n",iTotalBytes, (float)iTotalBytes / 1024.0f / 1024.0f); } // (don't use ri.xxx functions since the renderer may not be running here)... // static void RE_RegisterModels_DeleteAll(void) { if(!CachedModels) { return; //argh! } #ifndef __linux__ for (CachedModels_t::iterator itModel = CachedModels->begin(); itModel != CachedModels->end(); ) { CachedEndianedModelBinary_t &CachedModel = (*itModel).second; if (CachedModel.pModelDiskImage) { if(CachedModel.ID != -1) { // This already removes the entry from CachedModels! if( ModelMem.ClearModelMemory(CachedModel.ID) ) itModel = CachedModels->begin(); else itModel = CachedModels->erase(itModel); } else { Z_Free(CachedModel.pModelDiskImage); itModel = CachedModels->erase(itModel); } } else { itModel = CachedModels->erase(itModel); } } #else CachedModels->erase(CachedModels->begin(),CachedModels->end()); #endif #ifdef _XBOX // Just in case, clear all model memory slots that might have been missed above... ModelMem.ClearAll(); #endif } // do not use ri.xxx functions in here, the renderer may not be running (ie. if on a dedicated server)... // static int giRegisterMedia_CurrentLevel=0; void RE_RegisterMedia_LevelLoadBegin(const char *psMapName, ForceReload_e eForceReload) { // for development purposes we may want to ditch certain media just before loading a map... // bool bDeleteModels = eForceReload == eForceReload_MODELS || eForceReload == eForceReload_ALL; // bool bDeleteBSP = eForceReload == eForceReload_BSP || eForceReload == eForceReload_ALL; if (bDeleteModels) { RE_RegisterModels_DeleteAll(); } else { /* if (sv_pure->integer) { RE_RegisterModels_DumpNonPure(); } */ } /* tr.numBSPModels = 0; */ #ifndef DEDICATED // not used in MP codebase... // // if (bDeleteBSP) // { // CM_DeleteCachedMap(); // R_Images_DeleteLightMaps(); // always do this now, makes no real load time difference, and lets designers work ok // } #endif // at some stage I'll probably want to put some special logic here, like not incrementing the level number // when going into a map like "brig" or something, so returning to the previous level doesn't require an // asset reload etc, but for now... // // only bump level number if we're not on the same level. // Note that this will hide uncached models, which is perhaps a bad thing?... // static char sPrevMapName[MAX_QPATH]={0}; if (Q_stricmp( psMapName,sPrevMapName )) { Q_strncpyz( sPrevMapName, psMapName, sizeof(sPrevMapName) ); giRegisterMedia_CurrentLevel++; } } int RE_RegisterMedia_GetLevel(void) { return giRegisterMedia_CurrentLevel; } // this is now only called by the client, so should be ok to dump media... // extern qboolean SND_RegisterAudio_LevelLoadEnd(qboolean bDeleteEverythingNotUsedThisLevel /* 99% qfalse */); extern void S_RestartMusic(void); void RE_RegisterMedia_LevelLoadEnd(void) { RE_RegisterModels_LevelLoadEnd(qfalse); #ifndef DEDICATED RE_RegisterImages_LevelLoadEnd(); SND_RegisterAudio_LevelLoadEnd(qfalse); // RE_InitDissolve(); S_RestartMusic(); #endif } /* ** R_GetModelByHandle */ model_t *R_GetModelByHandle( qhandle_t index ) { // invalid gets the defualt model if( index < 1 || index >= MAX_MOD_KNOWN || !tr.models[index] ) return tr.models[0]; return tr.models[index]; } //=============================================================================== /* ** R_AllocModel */ model_t *R_AllocModel( void ) { model_t *mod; if ( tr.numModels == MAX_MOD_KNOWN ) { return NULL; } mod = (struct model_s *)Hunk_Alloc( sizeof( *tr.models[0] ), h_low ); int index = 0; for( index = 0; index < MAX_MOD_KNOWN; ++index ) if( !tr.models[index] ) break; if( index == MAX_MOD_KNOWN ) return NULL; mod->index = index; tr.models[index] = mod; tr.numModels++; return mod; } /* Ghoul2 Insert Start */ /* ================ return a hash value for the filename ================ */ static long generateHashValue( const char *fname, const int size ) { int i; long hash; char letter; hash = 0; i = 0; while (fname[i] != '\0') { letter = tolower((unsigned char)fname[i]); if (letter =='.') break; // don't include extension if (letter =='\\') letter = '/'; // damn path names hash+=(long)(letter)*(i+119); i++; } hash &= (size-1); return hash; } void RE_InsertModelIntoHash(const char *name, model_t *mod) { //int hash; //modelHash_t *mh; //hash = generateHashValue(name, FILE_HASH_SIZE); //// insert this file into the hash table so we can look it up faster later //mh = (modelHash_t*)Hunk_Alloc( sizeof( modelHash_t ), h_low ); //mh->next = mhHashTable[hash]; //mh->handle = mod->index; //strcpy(mh->name, name); //mhHashTable[hash] = mh; unsigned long crc = crc32(0, (const byte*)name, strlen(name)); (*mhHashTable)[crc] = mod->index; } #ifdef _XBOX void RE_RemoveModelFromHash(const char *name) { /*int hash; modelHash_t *mh; hash = generateHashValue(name, FILE_HASH_SIZE); mh = mhHashTable[hash]; if(Q_stricmp(mh->name, name) == 0) { Z_Free( mh ); mhHashTable[hash] = NULL; }*/ unsigned long crc = crc32(0, (const byte*)name, strlen(name)); mhHashTable->erase(crc); // Yank this model out of the CachedModels list also if(!CachedModels) { return; } qboolean bEraseOccured = qfalse; for (CachedModels_t::iterator itModel = CachedModels->begin(); itModel != CachedModels->end(); bEraseOccured?itModel:++itModel) { bEraseOccured = qfalse; LPCSTR psModelName = (*itModel).first.c_str(); CachedEndianedModelBinary_t &CachedModel = (*itModel).second; if (stricmp(name, psModelName) == 0) { if (CachedModel.pModelDiskImage) { if(CachedModel.ID != -1) { int ID = CachedModel.ID; itModel = CachedModels->erase(itModel); if(tr.models[ID]) Z_Free(tr.models[ID]); tr.models[ID] = NULL; tr.numModels--; bEraseOccured = qtrue; break; } } } } } #endif /* Ghoul2 Insert End */ //rww - Please forgive me for all of the below. Feel free to destroy it and replace it with something better. //You obviously can't touch anything relating to shaders or ri. functions here in case a dedicated //server is running, which is the entire point of having these seperate functions. If anything major //is changed in the non-server-only versions of these functions it would be wise to incorporate it //here as well. /* ================= ServerLoadMDXA - load a Ghoul 2 animation file ================= */ qboolean ServerLoadMDXA( model_t *mod, void *buffer, const char *mod_name, qboolean &bAlreadyCached ) { mdxaHeader_t *pinmodel, *mdxa; int version; int size; #ifndef _M_IX86 int j, k, i; int frameSize; mdxaFrame_t *cframe; mdxaSkel_t *boneInfo; #endif pinmodel = (mdxaHeader_t *)buffer; // // read some fields from the binary, but only LittleLong() them when we know this wasn't an already-cached model... // version = (pinmodel->version); size = (pinmodel->ofsEnd); if (!bAlreadyCached) { version = LittleLong(version); size = LittleLong(size); } if (version != MDXA_VERSION) { return qfalse; } mod->type = MOD_MDXA; mod->dataSize += size; qboolean bAlreadyFound = qfalse; mdxa = mod->mdxa = (mdxaHeader_t*) //Hunk_Alloc( size ); RE_RegisterServerModels_Malloc(size, buffer, mod_name, &bAlreadyFound, TAG_MODEL_GLA, mod->index); assert(bAlreadyCached == bAlreadyFound); // I should probably eliminate 'bAlreadyFound', but wtf? if (!bAlreadyFound) { // horrible new hackery, if !bAlreadyFound then we've just done a tag-morph, so we need to set the // bool reference passed into this function to true, to tell the caller NOT to do an FS_Freefile since // we've hijacked that memory block... // // Aaaargh. Kill me now... // #ifdef _XBOX // Can't re-tag allocated memory! memcpy( mdxa, buffer, size ); // and don't do this now, since it's the same thing #else bAlreadyCached = qtrue; assert( mdxa == buffer ); #endif LL(mdxa->ident); LL(mdxa->version); LL(mdxa->numFrames); LL(mdxa->numBones); LL(mdxa->ofsFrames); LL(mdxa->ofsEnd); } if ( mdxa->numFrames < 1 ) { return qfalse; } if (bAlreadyFound) { return qtrue; // All done, stop here, do not LittleLong() etc. Do not pass go... } #ifndef _M_IX86 // // optimisation, we don't bother doing this for standard intel case since our data's already in that format... // // swap all the skeletal info boneInfo = (mdxaSkel_t *)( (byte *)mdxa + mdxa->ofsSkel); for ( i = 0 ; i < mdxa->numBones ; i++) { LL(boneInfo->numChildren); LL(boneInfo->parent); for (k=0; k<boneInfo->numChildren; k++) { LL(boneInfo->children[k]); } // get next bone boneInfo += (int)( &((mdxaSkel_t *)0)->children[ boneInfo->numChildren ] ); } // swap all the frames frameSize = (int)( &((mdxaFrame_t *)0)->bones[ mdxa->numBones ] ); for ( i = 0 ; i < mdxa->numFrames ; i++) { cframe = (mdxaFrame_t *) ( (byte *)mdxa + mdxa->ofsFrames + i * frameSize ); cframe->radius = LittleFloat( cframe->radius ); for ( j = 0 ; j < 3 ; j++ ) { cframe->bounds[0][j] = LittleFloat( cframe->bounds[0][j] ); cframe->bounds[1][j] = LittleFloat( cframe->bounds[1][j] ); cframe->localOrigin[j] = LittleFloat( cframe->localOrigin[j] ); } for ( j = 0 ; j < mdxa->numBones * sizeof( mdxaBone_t ) / 2 ; j++ ) { ((short *)cframe->bones)[j] = LittleShort( ((short *)cframe->bones)[j] ); } } #endif return qtrue; } /* ================= ServerLoadMDXM - load a Ghoul 2 Mesh file ================= */ qboolean ServerLoadMDXM( model_t *mod, void *buffer, const char *mod_name, qboolean &bAlreadyCached ) { int i,l, j; mdxmHeader_t *pinmodel, *mdxm; mdxmLOD_t *lod; mdxmSurface_t *surf; int version; int size; shader_t *sh; mdxmSurfHierarchy_t *surfInfo; #ifndef _M_IX86 int k; int frameSize; mdxmTag_t *tag; mdxmTriangle_t *tri; mdxmVertex_t *v; mdxmFrame_t *cframe; int *boneRef; #endif pinmodel= (mdxmHeader_t *)buffer; // // read some fields from the binary, but only LittleLong() them when we know this wasn't an already-cached model... // version = (pinmodel->version); size = (pinmodel->ofsEnd); if (!bAlreadyCached) { version = LittleLong(version); size = LittleLong(size); } if (version != MDXM_VERSION) { return qfalse; } mod->type = MOD_MDXM; mod->dataSize += size; qboolean bAlreadyFound = qfalse; mdxm = mod->mdxm = (mdxmHeader_t*) //Hunk_Alloc( size ); RE_RegisterServerModels_Malloc(size, buffer, mod_name, &bAlreadyFound, TAG_MODEL_GLM, mod->index); assert(bAlreadyCached == bAlreadyFound); // I should probably eliminate 'bAlreadyFound', but wtf? if (!bAlreadyFound) { // horrible new hackery, if !bAlreadyFound then we've just done a tag-morph, so we need to set the // bool reference passed into this function to true, to tell the caller NOT to do an FS_Freefile since // we've hijacked that memory block... // // Aaaargh. Kill me now... // #ifdef _XBOX // Can't re-tag allocated memory! memcpy( mdxm, buffer, size ); // and don't do this now, since it's the same thing #else bAlreadyCached = qtrue; assert( mdxm == buffer ); #endif LL(mdxm->ident); LL(mdxm->version); LL(mdxm->numLODs); LL(mdxm->ofsLODs); LL(mdxm->numSurfaces); LL(mdxm->ofsSurfHierarchy); LL(mdxm->ofsEnd); } // first up, go load in the animation file we need that has the skeletal animation info for this model mdxm->animIndex = RE_RegisterServerModel(va ("%s.gla",mdxm->animName)); if (!mdxm->animIndex) { return qfalse; } mod->numLods = mdxm->numLODs -1 ; //copy this up to the model for ease of use - it wil get inced after this. if (bAlreadyFound) { return qtrue; // All done. Stop, go no further, do not LittleLong(), do not pass Go... } surfInfo = (mdxmSurfHierarchy_t *)( (byte *)mdxm + mdxm->ofsSurfHierarchy); for ( i = 0 ; i < mdxm->numSurfaces ; i++) { LL(surfInfo->numChildren); LL(surfInfo->parentIndex); // do all the children indexs for (j=0; j<surfInfo->numChildren; j++) { LL(surfInfo->childIndexes[j]); } // We will not be using shaders on the server. sh = 0; // insert it in the surface list surfInfo->shaderIndex = 0; RE_RegisterModels_StoreShaderRequest(mod_name, &surfInfo->shader[0], &surfInfo->shaderIndex); // find the next surface surfInfo = (mdxmSurfHierarchy_t *)( (byte *)surfInfo + (int)( &((mdxmSurfHierarchy_t *)0)->childIndexes[ surfInfo->numChildren ] )); } // swap all the LOD's (we need to do the middle part of this even for intel, because of shader reg and err-check) lod = (mdxmLOD_t *) ( (byte *)mdxm + mdxm->ofsLODs ); for ( l = 0 ; l < mdxm->numLODs ; l++) { int triCount = 0; LL(lod->ofsEnd); // swap all the surfaces surf = (mdxmSurface_t *) ( (byte *)lod + sizeof (mdxmLOD_t) + (mdxm->numSurfaces * sizeof(mdxmLODSurfOffset_t)) ); for ( i = 0 ; i < mdxm->numSurfaces ; i++) { LL(surf->numTriangles); LL(surf->ofsTriangles); LL(surf->numVerts); LL(surf->ofsVerts); LL(surf->ofsEnd); LL(surf->ofsHeader); LL(surf->numBoneReferences); LL(surf->ofsBoneReferences); // LL(surf->maxVertBoneWeights); triCount += surf->numTriangles; if ( surf->numVerts > SHADER_MAX_VERTEXES ) { return qfalse; } if ( surf->numTriangles*3 > SHADER_MAX_INDEXES ) { return qfalse; } // change to surface identifier surf->ident = SF_MDX; // register the shaders #ifndef _M_IX86 // // optimisation, we don't bother doing this for standard intel case since our data's already in that format... // // FIXME - is this correct? // do all the bone reference data boneRef = (int *) ( (byte *)surf + surf->ofsBoneReferences ); for ( j = 0 ; j < surf->numBoneReferences ; j++ ) { LL(boneRef[j]); } // swap all the triangles tri = (mdxmTriangle_t *) ( (byte *)surf + surf->ofsTriangles ); for ( j = 0 ; j < surf->numTriangles ; j++, tri++ ) { LL(tri->indexes[0]); LL(tri->indexes[1]); LL(tri->indexes[2]); } // swap all the vertexes v = (mdxmVertex_t *) ( (byte *)surf + surf->ofsVerts ); for ( j = 0 ; j < surf->numVerts ; j++ ) { v->normal[0] = LittleFloat( v->normal[0] ); v->normal[1] = LittleFloat( v->normal[1] ); v->normal[2] = LittleFloat( v->normal[2] ); v->texCoords[0] = LittleFloat( v->texCoords[0] ); v->texCoords[1] = LittleFloat( v->texCoords[1] ); v->numWeights = LittleLong( v->numWeights ); v->offset[0] = LittleFloat( v->offset[0] ); v->offset[1] = LittleFloat( v->offset[1] ); v->offset[2] = LittleFloat( v->offset[2] ); for ( k = 0 ; k < /*v->numWeights*/surf->maxVertBoneWeights ; k++ ) { v->weights[k].boneIndex = LittleLong( v->weights[k].boneIndex ); v->weights[k].boneWeight = LittleFloat( v->weights[k].boneWeight ); } v = (mdxmVertex_t *)&v->weights[/*v->numWeights*/surf->maxVertBoneWeights]; } #endif // find the next surface surf = (mdxmSurface_t *)( (byte *)surf + surf->ofsEnd ); } // find the next LOD lod = (mdxmLOD_t *)( (byte *)lod + lod->ofsEnd ); } return qtrue; } /* ==================== RE_RegisterServerModel Same as RE_RegisterModel, except used by the server to handle ghoul2 instance models. ==================== */ qhandle_t RE_RegisterServerModel( const char *name ) { model_t *mod; unsigned *buf; int lod; int ident; qboolean loaded; // qhandle_t hModel; int numLoaded; /* Ghoul2 Insert Start */ /*int hash; modelHash_t *mh;*/ /* Ghoul2 Insert End */ if (!r_noServerGhoul2) { //keep it from choking when it gets to these checks in the g2 code. Registering all r_ cvars for the server would be a Bad Thing though. r_noServerGhoul2 = Cvar_Get( "r_noserverghoul2", "0", 0); } if ( !name || !name[0] ) { return 0; } if ( strlen( name ) >= MAX_QPATH ) { return 0; } //hash = generateHashValue(name, FILE_HASH_SIZE); //// //// see if the model is already loaded //// //for (mh=mhHashTable[hash]; mh; mh=mh->next) { // if (Q_stricmp(mh->name, name) == 0) { // return mh->handle; // } //} unsigned long crc = crc32(0, (const byte*)name, strlen(name)); HashTableIterator iter = mhHashTable->find(crc); if (iter != mhHashTable->end()) return (*iter).second; if ( ( mod = R_AllocModel() ) == NULL ) { return 0; } // only set the name after the model has been successfully loaded Q_strncpyz( mod->name, name, sizeof( mod->name ) ); #ifndef DEDICATED // make sure the render thread is stopped R_SyncRenderThread(); #endif int iLODStart = 0; if (strstr (name, ".md3")) { iLODStart = MD3_MAX_LODS-1; // this loads the md3s in reverse so they can be biased } mod->numLods = 0; // // load the files // numLoaded = 0; for ( lod = iLODStart; lod >= 0 ; lod-- ) { char filename[1024]; strcpy( filename, name ); if ( lod != 0 ) { char namebuf[80]; if ( strrchr( filename, '.' ) ) { *strrchr( filename, '.' ) = 0; } sprintf( namebuf, "_%d.md3", lod ); strcat( filename, namebuf ); } qboolean bAlreadyCached = qfalse; if (!RE_RegisterModels_GetDiskFile(filename, (void **)&buf, &bAlreadyCached)) { continue; } //loadmodel = mod; // this seems to be fairly pointless // important that from now on we pass 'filename' instead of 'name' to all model load functions, // because 'filename' accounts for any LOD mangling etc so guarantees unique lookups for yet more // internal caching... // ident = *(unsigned *)buf; if (!bAlreadyCached) { ident = LittleLong(ident); } switch (ident) { //if you're trying to register anything else as a model type on the server, you are out of luck case MDXA_IDENT: loaded = ServerLoadMDXA( mod, buf, filename, bAlreadyCached ); break; case MDXM_IDENT: loaded = ServerLoadMDXM( mod, buf, filename, bAlreadyCached ); break; default: goto fail; } if (!bAlreadyCached){ // important to check!! FS_FreeFile (buf); } if ( !loaded ) { if ( lod == 0 ) { goto fail; } else { break; } } else { mod->numLods++; numLoaded++; } } if ( numLoaded ) { // duplicate into higher lod spots that weren't // loaded, in case the user changes r_lodbias on the fly for ( lod-- ; lod >= 0 ; lod-- ) { mod->numLods++; mod->md3[lod] = mod->md3[lod+1]; } /* Ghoul2 Insert Start */ RE_InsertModelIntoHash(name, mod); return mod->index; /* Ghoul2 Insert End */ } fail: // we still keep the model_t around, so if the model name is asked for // again, we won't bother scanning the filesystem mod->type = MOD_BAD; RE_InsertModelIntoHash(name, mod); return 0; } extern void FS_CancelLargeRead( void ); /* ==================== RE_RegisterModel Loads in a model for the given name Zero will be returned if the model fails to load. An entry will be retained for failed models as an optimization to prevent disk rescanning if they are asked for again. ==================== */ static qhandle_t RE_RegisterModel_Actual( const char *name ) { model_t *mod; unsigned *buf; int lod; int ident; qboolean loaded; // qhandle_t hModel; int numLoaded; /* Ghoul2 Insert Start */ /*int hash; modelHash_t *mh;*/ /* Ghoul2 Insert End */ if ( !name || !name[0] ) { Com_Printf ("RE_RegisterModel: NULL name\n" ); return 0; } if ( strlen( name ) >= MAX_QPATH ) { Com_DPrintf (S_COLOR_RED "Model name exceeds MAX_QPATH\n" ); return 0; } /* Ghoul2 Insert Start */ // if (!tr.registered) { // Com_Printf (S_COLOR_YELLOW "RE_RegisterModel (%s) called before ready!\n",name ); // return 0; // } // // search the currently loaded models // //hash = generateHashValue(name, FILE_HASH_SIZE); // // see if the model is already loaded // /*for (mh=mhHashTable[hash]; mh; mh=mh->next) { if (Q_stricmp(mh->name, name) == 0) { return mh->handle; } }*/ unsigned long crc = crc32(0, (const byte*)name, strlen(name)); HashTableIterator iter = mhHashTable->find(crc); if (iter != mhHashTable->end()) return (*iter).second; // for ( hModel = 1 ; hModel < tr.numModels; hModel++ ) { // mod = tr.models[hModel]; // if ( !strcmp( mod->name, name ) ) { // if( mod->type == MOD_BAD ) { // return 0; // } // return hModel; // } // } /* if (name[0] == '#') { char temp[MAX_QPATH]; tr.numBSPModels++; #ifndef DEDICATED RE_LoadWorldMap_Actual(va("maps/%s.bsp", name + 1), tr.bspModels[tr.numBSPModels - 1], tr.numBSPModels); #endif Com_sprintf(temp, MAX_QPATH, "*%d-0", tr.numBSPModels); hash = generateHashValue(temp, FILE_HASH_SIZE); for (mh=mhHashTable[hash]; mh; mh=mh->next) { if (Q_stricmp(mh->name, temp) == 0) { return mh->handle; } } return 0; } */ if (name[0] == '*') { // don't create a bad model for a bsp model if (Q_stricmp(name, "*default.gla")) { return 0; } } /* Ghoul2 Insert End */ // allocate a new model_t if ( ( mod = R_AllocModel() ) == NULL ) { Com_Printf (S_COLOR_YELLOW "RE_RegisterModel: R_AllocModel() failed for '%s'\n", name); return 0; } // only set the name after the model has been successfully loaded Q_strncpyz( mod->name, name, sizeof( mod->name ) ); #ifndef DEDICATED // make sure the render thread is stopped R_SyncRenderThread(); #endif int iLODStart = 0; if (strstr (name, ".md3")) { iLODStart = MD3_MAX_LODS-1; // this loads the md3s in reverse so they can be biased } mod->numLods = 0; // // load the files // numLoaded = 0; for ( lod = iLODStart; lod >= 0 ; lod-- ) { char filename[1024]; strcpy( filename, name ); if ( lod != 0 ) { char namebuf[80]; if ( strrchr( filename, '.' ) ) { *strrchr( filename, '.' ) = 0; } sprintf( namebuf, "_%d.md3", lod ); strcat( filename, namebuf ); } // Warn the filesystem that a big GLM is about to be read: extern void FS_LargeRead( void ); if( strstr(filename, "players") && strstr(filename, "glm") ) FS_LargeRead(); else FS_CancelLargeRead(); // Because of recursive calls GLM->GLA qboolean bAlreadyCached = qfalse; if (!RE_RegisterModels_GetDiskFile(filename, (void **)&buf, &bAlreadyCached)) { continue; } //loadmodel = mod; // this seems to be fairly pointless // important that from now on we pass 'filename' instead of 'name' to all model load functions, // because 'filename' accounts for any LOD mangling etc so guarantees unique lookups for yet more // internal caching... // ident = *(unsigned *)buf; if (!bAlreadyCached) { ident = LittleLong(ident); } switch (ident) { // if you add any new types of model load in this switch-case, tell me, // or copy what I've done with the cache scheme (-ste). // case MDXA_IDENT: loaded = R_LoadMDXA( mod, buf, filename, bAlreadyCached ); break; case MDXM_IDENT: loaded = R_LoadMDXM( mod, buf, filename, bAlreadyCached ); break; case MD3_IDENT: loaded = R_LoadMD3( mod, lod, buf, filename, bAlreadyCached ); break; default: Com_Printf (S_COLOR_YELLOW"RE_RegisterModel: unknown fileid for %s\n", filename); goto fail; } if (!bAlreadyCached){ // important to check!! FS_FreeFile (buf); } if ( !loaded ) { if ( lod == 0 ) { goto fail; } else { break; } } else { mod->numLods++; numLoaded++; // if we have a valid model and are biased // so that we won't see any higher detail ones, // stop loading them if ( lod <= r_lodbias->integer ) { break; } } } // Stop using the GLA space for GLM reads FS_CancelLargeRead(); if ( numLoaded ) { // duplicate into higher lod spots that weren't // loaded, in case the user changes r_lodbias on the fly for ( lod-- ; lod >= 0 ; lod-- ) { mod->numLods++; mod->md3[lod] = mod->md3[lod+1]; } /* Ghoul2 Insert Start */ #ifdef _DEBUG if (r_noPrecacheGLA && r_noPrecacheGLA->integer && ident == MDXA_IDENT) { //I expect this will cause leaks, but I don't care because it's a debugging utility. return mod->index; } #endif RE_InsertModelIntoHash(name, mod); return mod->index; /* Ghoul2 Insert End */ } #ifdef _DEBUG else { Com_Printf (S_COLOR_YELLOW"RE_RegisterModel: couldn't load %s\n", name); } #endif fail: // we still keep the model_t around, so if the model name is asked for // again, we won't bother scanning the filesystem mod->type = MOD_BAD; RE_InsertModelIntoHash(name, mod); return 0; } // wrapper function needed to avoid problems with mid-function returns so I can safely use this bool to tell the // z_malloc-fail recovery code whether it's safe to ditch any model caches... // qboolean gbInsideRegisterModel = qfalse; qhandle_t RE_RegisterModel( const char *name ) { const qboolean bWhatitwas = gbInsideRegisterModel; gbInsideRegisterModel = qtrue; // !!!!!!!!!!!!!! qhandle_t q = RE_RegisterModel_Actual( name ); gbInsideRegisterModel = bWhatitwas; return q; } /* ================= R_LoadMD3 ================= */ static qboolean R_LoadMD3 (model_t *mod, int lod, void *buffer, const char *mod_name, qboolean &bAlreadyCached ) { int i, j; md3Header_t *pinmodel; md3Surface_t *surf; int version; int size; #ifndef _M_IX86 md3Frame_t *frame; md3Triangle_t *tri; md3St_t *st; md3XyzNormal_t *xyz; md3Tag_t *tag; #endif pinmodel= (md3Header_t *)buffer; // // read some fields from the binary, but only LittleLong() them when we know this wasn't an already-cached model... // version = pinmodel->version; size = pinmodel->ofsEnd; if (!bAlreadyCached) { version = LittleLong(version); size = LittleLong(size); } if (version != MD3_VERSION) { Com_Printf (S_COLOR_YELLOW "R_LoadMD3: %s has wrong version (%i should be %i)\n", mod_name, version, MD3_VERSION); return qfalse; } mod->type = MOD_MESH; mod->dataSize += size; qboolean bAlreadyFound = qfalse; #ifdef _XBOX mod->md3[lod] = (md3Header_t *) //Hunk_Alloc( size ); RE_RegisterModels_Malloc(size, buffer, mod_name, &bAlreadyFound, TAG_MODEL_MD3, 0, false); #else mod->md3[lod] = (md3Header_t *) //Hunk_Alloc( size ); RE_RegisterModels_Malloc(size, buffer, mod_name, &bAlreadyFound, TAG_MODEL_MD3); #endif assert(bAlreadyCached == bAlreadyFound); // I should probably eliminate 'bAlreadyFound', but wtf? if (!bAlreadyFound) { // horrible new hackery, if !bAlreadyFound then we've just done a tag-morph, so we need to set the // bool reference passed into this function to true, to tell the caller NOT to do an FS_Freefile since // we've hijacked that memory block... // // Aaaargh. Kill me now... // #ifdef _XBOX // Can't re-tag allocated memory! memcpy( mod->md3[lod], buffer, size ); // and don't do this now, since it's the same thing #else bAlreadyCached = qtrue; assert( mod->md3[lod] == buffer ); #endif LL(mod->md3[lod]->ident); LL(mod->md3[lod]->version); LL(mod->md3[lod]->numFrames); LL(mod->md3[lod]->numTags); LL(mod->md3[lod]->numSurfaces); LL(mod->md3[lod]->ofsFrames); LL(mod->md3[lod]->ofsTags); LL(mod->md3[lod]->ofsSurfaces); LL(mod->md3[lod]->ofsEnd); } if ( mod->md3[lod]->numFrames < 1 ) { Com_Printf (S_COLOR_YELLOW "R_LoadMD3: %s has no frames\n", mod_name ); return qfalse; } if (bAlreadyFound) { return qtrue; // All done. Stop, go no further, do not pass Go... } #ifndef _M_IX86 // // optimisation, we don't bother doing this for standard intel case since our data's already in that format... // // swap all the frames frame = (md3Frame_t *) ( (byte *)mod->md3[lod] + mod->md3[lod]->ofsFrames ); for ( i = 0 ; i < mod->md3[lod]->numFrames ; i++, frame++) { frame->radius = LittleFloat( frame->radius ); for ( j = 0 ; j < 3 ; j++ ) { frame->bounds[0][j] = LittleFloat( frame->bounds[0][j] ); frame->bounds[1][j] = LittleFloat( frame->bounds[1][j] ); frame->localOrigin[j] = LittleFloat( frame->localOrigin[j] ); } } // swap all the tags tag = (md3Tag_t *) ( (byte *)mod->md3[lod] + mod->md3[lod]->ofsTags ); for ( i = 0 ; i < mod->md3[lod]->numTags * mod->md3[lod]->numFrames ; i++, tag++) { for ( j = 0 ; j < 3 ; j++ ) { tag->origin[j] = LittleFloat( tag->origin[j] ); tag->axis[0][j] = LittleFloat( tag->axis[0][j] ); tag->axis[1][j] = LittleFloat( tag->axis[1][j] ); tag->axis[2][j] = LittleFloat( tag->axis[2][j] ); } } #endif // swap all the surfaces surf = (md3Surface_t *) ( (byte *)mod->md3[lod] + mod->md3[lod]->ofsSurfaces ); for ( i = 0 ; i < mod->md3[lod]->numSurfaces ; i++) { LL(surf->flags); LL(surf->numFrames); LL(surf->numShaders); LL(surf->numTriangles); LL(surf->ofsTriangles); LL(surf->numVerts); LL(surf->ofsShaders); LL(surf->ofsSt); LL(surf->ofsXyzNormals); LL(surf->ofsEnd); if ( surf->numVerts > SHADER_MAX_VERTEXES ) { Com_Error (ERR_DROP, "R_LoadMD3: %s has more than %i verts on a surface (%i)", mod_name, SHADER_MAX_VERTEXES, surf->numVerts ); } if ( surf->numTriangles*3 > SHADER_MAX_INDEXES ) { Com_Error (ERR_DROP, "R_LoadMD3: %s has more than %i triangles on a surface (%i)", mod_name, SHADER_MAX_INDEXES / 3, surf->numTriangles ); } // change to surface identifier surf->ident = SF_MD3; // lowercase the surface name so skin compares are faster Q_strlwr( surf->name ); // strip off a trailing _1 or _2 // this is a crutch for q3data being a mess j = strlen( surf->name ); if ( j > 2 && surf->name[j-2] == '_' ) { surf->name[j-2] = 0; } #ifndef DEDICATED // register the shaders md3Shader_t *shader; shader = (md3Shader_t *) ( (byte *)surf + surf->ofsShaders ); for ( j = 0 ; j < surf->numShaders ; j++, shader++ ) { shader_t *sh; sh = R_FindShader( shader->name, lightmapsNone, stylesDefault, qtrue ); if ( sh->defaultShader ) { shader->shaderIndex = 0; } else { shader->shaderIndex = sh->index; } RE_RegisterModels_StoreShaderRequest(mod_name, &shader->name[0], &shader->shaderIndex); } #endif #ifndef _M_IX86 // // optimisation, we don't bother doing this for standard intel case since our data's already in that format... // // swap all the triangles tri = (md3Triangle_t *) ( (byte *)surf + surf->ofsTriangles ); for ( j = 0 ; j < surf->numTriangles ; j++, tri++ ) { LL(tri->indexes[0]); LL(tri->indexes[1]); LL(tri->indexes[2]); } // swap all the ST st = (md3St_t *) ( (byte *)surf + surf->ofsSt ); for ( j = 0 ; j < surf->numVerts ; j++, st++ ) { st->st[0] = LittleFloat( st->st[0] ); st->st[1] = LittleFloat( st->st[1] ); } // swap all the XyzNormals xyz = (md3XyzNormal_t *) ( (byte *)surf + surf->ofsXyzNormals ); for ( j = 0 ; j < surf->numVerts * surf->numFrames ; j++, xyz++ ) { xyz->xyz[0] = LittleShort( xyz->xyz[0] ); xyz->xyz[1] = LittleShort( xyz->xyz[1] ); xyz->xyz[2] = LittleShort( xyz->xyz[2] ); xyz->normal = LittleShort( xyz->normal ); } #endif // find the next surface surf = (md3Surface_t *)( (byte *)surf + surf->ofsEnd ); } return qtrue; } //============================================================================= #ifndef DEDICATED /* ** RE_BeginRegistration */ void RE_BeginRegistration( glconfig_t *glconfigOut ) { R_Init(); *glconfigOut = glConfig; R_SyncRenderThread(); tr.viewCluster = -1; // force markleafs to regenerate // rww - 9-13-01 [1-26-01-sof2] //R_ClearFlares(); RE_ClearScene(); tr.registered = qtrue; // NOTE: this sucks, for some reason the first stretch pic is never drawn // without this we'd see a white flash on a level load because the very // first time the level shot would not be drawn RE_StretchPic(0, 0, 0, 0, 0, 0, 1, 1, 0); } //============================================================================= #endif // !DEDICATED void R_SVModelInit() { R_ModelInit(); } /* =============== R_ModelInit =============== */ void R_ModelInit( void ) { model_t *mod; if(!CachedModels) { CachedModels = new CachedModels_t; } // leave a space for NULL model tr.numModels = 0; // Need to clear this now, because they're not in consecutive slots: memset( tr.models, 0, sizeof(tr.models) ); // memset(mhHashTable, 0, sizeof(mhHashTable)); if(mhHashTable) { mhHashTable->clear(); delete mhHashTable; } mhHashTable = new HashTable; mod = R_AllocModel(); mod->type = MOD_BAD; } extern void KillTheShaderHashTable(void); void R_HunkClearCrap(void) { //get your dirty sticky assets off me, you damn dirty hunk! KillTheShaderHashTable(); tr.numModels = 0; memset(tr.models, 0, sizeof(tr.models)); // memset(mhHashTable, 0, sizeof(mhHashTable)); if(mhHashTable) { mhHashTable->clear(); } tr.numShaders = 0; tr.numSkins = 0; } void R_ModelFree(void) { if(CachedModels) { RE_RegisterModels_DeleteAll(); delete CachedModels; CachedModels = NULL; } if(mhHashTable) { mhHashTable->clear(); delete mhHashTable; mhHashTable = NULL; } } /* ================ R_Modellist_f ================ */ void R_Modellist_f( void ) { int i, j; model_t *mod; int total; int lods; total = 0; for ( i = 1 ; i < MAX_MOD_KNOWN; i++ ) { if( !tr.models[i] ) continue; mod = tr.models[i]; lods = 1; for ( j = 1 ; j < MD3_MAX_LODS ; j++ ) { if ( mod->md3[j] && mod->md3[j] != mod->md3[j-1] ) { lods++; } } Com_Printf ("%8i : (%i) %s\n",mod->dataSize, lods, mod->name ); total += mod->dataSize; } Com_Printf ("%8i : Total models\n", total ); #if 0 // not working right with new hunk if ( tr.world ) { Com_Printf ("\n%8i : %s\n", tr.world->dataSize, tr.world->name ); } #endif } //============================================================================= /* ================ R_GetTag ================ */ static md3Tag_t *R_GetTag( md3Header_t *mod, int frame, const char *tagName ) { md3Tag_t *tag; int i; if ( frame >= mod->numFrames ) { // it is possible to have a bad frame while changing models, so don't error frame = mod->numFrames - 1; } tag = (md3Tag_t *)((byte *)mod + mod->ofsTags) + frame * mod->numTags; for ( i = 0 ; i < mod->numTags ; i++, tag++ ) { if ( !strcmp( tag->name, tagName ) ) { return tag; // found it } } return NULL; } /* ================ R_LerpTag ================ */ int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFrame, float frac, const char *tagName ) { md3Tag_t *start, *end; int i; float frontLerp, backLerp; model_t *model; model = R_GetModelByHandle( handle ); if ( !model->md3[0] ) { AxisClear( tag->axis ); VectorClear( tag->origin ); return qfalse; } start = R_GetTag( model->md3[0], startFrame, tagName ); end = R_GetTag( model->md3[0], endFrame, tagName ); if ( !start || !end ) { AxisClear( tag->axis ); VectorClear( tag->origin ); return qfalse; } frontLerp = frac; backLerp = 1.0f - frac; for ( i = 0 ; i < 3 ; i++ ) { tag->origin[i] = start->origin[i] * backLerp + end->origin[i] * frontLerp; tag->axis[0][i] = start->axis[0][i] * backLerp + end->axis[0][i] * frontLerp; tag->axis[1][i] = start->axis[1][i] * backLerp + end->axis[1][i] * frontLerp; tag->axis[2][i] = start->axis[2][i] * backLerp + end->axis[2][i] * frontLerp; } VectorNormalize( tag->axis[0] ); VectorNormalize( tag->axis[1] ); VectorNormalize( tag->axis[2] ); return qtrue; } /* ==================== R_ModelBounds ==================== */ void R_ModelBounds( qhandle_t handle, vec3_t mins, vec3_t maxs ) { model_t *model; md3Header_t *header; md3Frame_t *frame; model = R_GetModelByHandle( handle ); if ( model->bmodel ) { VectorCopy( model->bmodel->bounds[0], mins ); VectorCopy( model->bmodel->bounds[1], maxs ); return; } if ( !model->md3[0] ) { VectorClear( mins ); VectorClear( maxs ); return; } header = model->md3[0]; frame = (md3Frame_t *)( (byte *)header + header->ofsFrames ); VectorCopy( frame->bounds[0], mins ); VectorCopy( frame->bounds[1], maxs ); }
dpiers/Jedi-Academy
codemp/renderer/tr_model.cpp
C++
gpl-2.0
53,419
<?php /** * This file is part of Rakuten Web Service SDK * * (c) Rakuten, Inc * * For the full copyright and license information, please view the LICENSE * file that was distributed with source code. */ require_once 'HTTP/Client.php'; /** * Http Client that use PEAR Http_Client * * @package RakutenRws * @subpackage HttpClient */ class RakutenRws_HttpClient_PearHttpClient extends RakutenRws_HttpClient { protected $client = null; protected function getHttpClient() { if ($this->client === null) { $this->client = new Http_Client(); } if ($this->proxy !== null) { $parsedUrl = parse_url($this->proxy); $this->client->setRequestParameter('proxy_host', $parsedUrl['host']); if (isset($parsedUrl['port'])) { $this->client->setRequestParameter('proxy_port', $parsedUrl['port']); } if (isset($parsedUrl['user'])) { $this->client->setRequestParameter('proxy_user', $parsedUrl['user']); } if (isset($parsedUrl['pass'])) { $this->client->setRequestParameter('proxy_pass', $parsedUrl['pass']); } } $this->client->setRequestParameter('timeout', $this->timeout); $this->client->setDefaultHeader('User-Agent', 'RakutenWebService SDK for PHP-'.RakutenRws_Client::VERSION); return $this->client; } public function get($url, $params = array()) { $client = $this->getHttpClient(); $client->get($url, $params); $response = $client->currentResponse(); return new RakutenRws_HttpResponse( $url, $params, $response['code'], $response['headers'], $response['body'] ); } public function post($url, $params = array()) { $client = $this->getHttpClient(); $client->post($url, $params); $response = $client->currentResponse(); return new RakutenRws_HttpResponse( $url, $params, $response['code'], $response['headers'], $response['body'] ); } }
s-shirayama/GiftPlanner
wp-content/lib/rws-php-sdk-master/lib/RakutenRws/HttpClient/PearHttpClient.php
PHP
gpl-2.0
2,211
LOGICAL FUNCTION LSAMEN( N, CA, CB ) * * -- LAPACK auxiliary routine (version 3.0) -- * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., * Courant Institute, Argonne National Lab, and Rice University * September 30, 1994 * * .. Scalar Arguments .. CHARACTER*( * ) CA, CB INTEGER N * .. * * Purpose * ======= * * LSAMEN tests if the first N letters of CA are the same as the * first N letters of CB, regardless of case. * LSAMEN returns .TRUE. if CA and CB are equivalent except for case * and .FALSE. otherwise. LSAMEN also returns .FALSE. if LEN( CA ) * or LEN( CB ) is less than N. * * Arguments * ========= * * N (input) INTEGER * The number of characters in CA and CB to be compared. * * CA (input) CHARACTER*(*) * CB (input) CHARACTER*(*) * CA and CB specify two character strings of length at least N. * Only the first N characters of each string will be accessed. * * ===================================================================== * * .. Local Scalars .. INTEGER I * .. * .. External Functions .. LOGICAL LSAME EXTERNAL LSAME * .. * .. Intrinsic Functions .. INTRINSIC LEN * .. * .. Executable Statements .. * LSAMEN = .FALSE. IF( LEN( CA ).LT.N .OR. LEN( CB ).LT.N ) $ GO TO 20 * * Do for each character in the two strings. * DO 10 I = 1, N * * Test if the characters are equal using LSAME. * IF( .NOT.LSAME( CA( I: I ), CB( I: I ) ) ) $ GO TO 20 * 10 CONTINUE LSAMEN = .TRUE. * 20 CONTINUE RETURN * * End of LSAMEN * END
ycZhou/GMIN
src/LAPACK/lsamen.f
FORTRAN
gpl-2.0
1,743
<?php $num_columns = 5; ?> <div class="admin-box"> <p class="intro"><?php e(lang('permissions_intro')); ?></p> <?php if (isset($results) && is_array($results) && count($results)) : echo form_open($this->uri->uri_string()); ?> <table class="table table-striped"> <thead> <tr> <th class="column-check"><input class="check-all" type="checkbox" /></th> <th><?php echo lang('permissions_id'); ?></th> <th><?php echo lang('permissions_name'); ?></th> <th><?php echo lang('permissions_description'); ?></th> <th><?php echo lang('permissions_status'); ?></th> </tr> </thead> <tfoot> <tr> <td colspan="<?php echo $num_columns; ?>"> <?php echo lang('bf_with_selected') ?> <input type="submit" name="delete" class="btn btn-danger" id="delete-me" value="<?php echo lang('bf_action_delete') ?>" onclick="return confirm('<?php e(js_escape(lang('permissions_delete_confirm'))); ?>')"> </td> </tr> </tfoot> <tbody> <?php foreach ($results as $record) : ?> <tr> <td class="column-check"><input type="checkbox" name="checked[]" value="<?php echo $record->permission_id; ?>" /></td> <td><?php echo $record->permission_id; ?></td> <td><a href='<?php echo site_url(SITE_AREA . "/settings/permissions/edit/{$record->permission_id}"); ?>'><?php e($record->name); ?></a></td> <td><?php e($record->description); ?></td> <td><?php e(ucfirst($record->status)); ?></td> </tr> <?php endforeach; ?> </tbody> </table> <?php echo form_close(); else : ?> <p><?php echo lang('permissions_no_records'); ?></p> <?php endif; echo $this->pagination->create_links(); ?> </div>
brkrishna/freelance
oicp/bonfire/modules/permissions/views/settings/index.php
PHP
gpl-2.0
1,717
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## Plugin.define "Eserv" do author "Brendan Coles <[email protected]>" # 2012-10-22 version "0.1" description "Eserv - Mail Server - SMTP/POP3/IMAP/HTTP" website "http://www.eserv.ru/" # ShodanHQ results as at 2012-10-22 # # 14 for 404 Path not found (E4 WIKI) # Matches # matches [ # Version Detection # HTTP Server Header { :search=>"headers[server]", :version=>/^Eserv\/([^\s]+)/ }, # Meta Generator # Version Detection { :version=>/<meta name="generator" content="Eserv\/([^\s^"]+)" \/>/ }, # Powered by footer # Version Detection { :version=>/<span id='powered_by'>[^<]+<a href="http:\/\/www\.eserv\.ru\/"><span itemprop="name">Eserv<\/span><\/a>\/([^\s]+)/ }, ] end
guikcd/WhatWeb
plugins/eserv.rb
Ruby
gpl-2.0
923
<?php class WpProQuiz_Controller_ImportExport extends WpProQuiz_Controller_Controller { public function route() { @set_time_limit(0); @ini_set('memory_limit', '128M'); if(!isset($_GET['action']) || $_GET['action'] != 'import' && $_GET['action'] != 'export') { wp_die("Error"); } if($_GET['action'] == 'export') { $this->handleExport(); } else { $this->handleImport(); } } private function handleExport() { if(!current_user_can('wpProQuiz_export')) { wp_die(__('You do not have sufficient permissions to access this page.')); } if(isset($this->_post ['exportType']) && $this->_post ['exportType'] == 'xml') { $export = new WpProQuiz_Helper_ExportXml(); $filename = 'WpProQuiz_export_'.time().'.xml'; } else { $export = new WpProQuiz_Helper_Export(); $filename = 'WpProQuiz_export_'.time().'.wpq'; } $a = $export->export($this->_post['exportIds']); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$filename.'"'); echo $a; exit; } private function handleImport() { if(!current_user_can('wpProQuiz_import')) { wp_die(__('You do not have sufficient permissions to access this page.')); } $this->view = new WpProQuiz_View_Import(); $this->view->error = false; if(isset($_FILES, $_FILES['import']) && substr($_FILES['import']['name'], -3) == 'xml' || isset($this->_post['importType']) && $this->_post['importType'] == 'xml') { $import = new WpProQuiz_Helper_ImportXml(); $importType = 'xml'; } else { $import = new WpProQuiz_Helper_Import(); $importType = 'wpq'; } $this->view->importType = $importType; if(isset($_FILES, $_FILES['import']) && $_FILES['import']['error'] == 0) { if($import->setImportFileUpload($_FILES['import']) === false) { $this->view->error = $import->getError(); } else { $data = $import->getImportData(); if($data === false) { $this->view->error = $import->getError(); } $this->view->import = $data; $this->view->importData = $import->getContent(); unset($data); } } else if(isset($this->_post, $this->_post['importSave'])) { if($import->setImportString($this->_post['importData']) === false) { $this->view->error = $import->getError(); } else { $ids = isset($this->_post['importItems']) ? $this->_post['importItems'] : false; if($ids !== false && $import->saveImport($ids) === false) { $this->view->error = $import->getError(); } else { $this->view->finish = true; } } } else { $this->view->error = __('File cannot be processed', 'wp-pro-quiz'); } $this->view->show(); } }
oniiru/html
wp-content/plugins/wp-pro-quiz/lib/controller/WpProQuiz_Controller_ImportExport.php
PHP
gpl-2.0
2,804
<?php /** * Themes administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { wp_die( '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>', 403 ); } if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { if ( 'activate' == $_GET['action'] ) { check_admin_referer('switch-theme_' . $_GET['stylesheet']); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! $theme->exists() || ! $theme->is_allowed() ) { wp_die( '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<p>' . __( 'The requested theme does not exist.' ) . '</p>', 403 ); } switch_theme( $theme->get_stylesheet() ); wp_redirect( admin_url('themes.php?activated=true') ); exit; } elseif ( 'delete' == $_GET['action'] ) { check_admin_referer('delete-theme_' . $_GET['stylesheet']); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! current_user_can( 'delete_themes' ) ) { wp_die( '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<p>' . __( 'You are not allowed to delete this item.' ) . '</p>', 403 ); } if ( ! $theme->exists() ) { wp_die( '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<p>' . __( 'The requested theme does not exist.' ) . '</p>', 403 ); } $active = wp_get_theme(); if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) { wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) ); } else { delete_theme( $_GET['stylesheet'] ); wp_redirect( admin_url( 'themes.php?deleted=true' ) ); } exit; } } $title = __('Manage Themes'); $parent_file = 'themes.php'; // Help tab: Overview if ( current_user_can( 'switch_themes' ) ) { $help_overview = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' . '<p>' . __( 'From this screen you can:' ) . '</p>' . '<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' . '<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' . '<li>' . __( 'Click Customize for the current theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' . '<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>' . '<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help_overview ) ); } // switch_themes // Help tab: Adding Themes if ( current_user_can( 'install_themes' ) ) { if ( is_multisite() ) { $help_install = '<p>' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '</p>'; } else { $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!'), 'https://wordpress.org/themes/' ) . '</p>'; } get_current_screen()->add_help_tab( array( 'id' => 'adding-themes', 'title' => __('Adding Themes'), 'content' => $help_install ) ); } // install_themes // Help tab: Previewing and Customizing if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { $help_customize = '<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>'. '<p>' . __( 'The theme being previewed is fully interactive &mdash; navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Save &amp; Activate button above the menu.' ) . '</p>' . '<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'customize-preview-themes', 'title' => __( 'Previewing and Customizing' ), 'content' => $help_customize ) ); } // edit_theme_options && customize get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' ); if ( current_user_can( 'switch_themes' ) ) { $themes = wp_prepare_themes_for_js(); } else { $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) ); } wp_reset_vars( array( 'theme', 'search' ) ); wp_localize_script( 'theme', '_wpThemeSettings', array( 'themes' => $themes, 'settings' => array( 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), ), 'l10n' => array( 'addNew' => __( 'Add New Theme' ), 'search' => __( 'Search Installed Themes' ), 'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis) 'themesFound' => __( 'Number of Themes found: %d' ), 'noThemesFound' => __( 'No themes found. Try a different search.' ), ), ) ); add_thickbox(); wp_enqueue_script( 'theme' ); wp_enqueue_script( 'customize-loader' ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?> <div class="wrap"> <h1><?php esc_html_e( 'Themes' ); ?> <span class="title-count theme-count"><?php echo count( $themes ); ?></span> <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?> <a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a> <?php endif; ?> </h1> <?php if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?> <div id="message1" class="updated notice is-dismissible"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> <?php elseif ( isset($_GET['activated']) ) : if ( isset( $_GET['previewed'] ) ) { ?> <div id="message2" class="updated notice is-dismissible"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div> <?php } else { ?> <div id="message2" class="updated notice is-dismissible"><p><?php printf( __( 'New theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div><?php } elseif ( isset($_GET['deleted']) ) : ?> <div id="message3" class="updated notice is-dismissible"><p><?php _e('Theme deleted.') ?></p></div> <?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?> <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div> <?php endif; $ct = wp_get_theme(); if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { echo '<div class="error"><p>' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '</p></div>'; } /* // Certain error codes are less fatal than others. We can still display theme information in most cases. if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() ) && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?> */ // Pretend you didn't see this. $current_theme_actions = array(); if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { foreach ( (array) $submenu['themes.php'] as $item) { $class = ''; if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) continue; // 0 = name, 1 = capability, 2 = file if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) $class = ' current'; if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) $current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; else $current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_file = $item[2]; if ( current_user_can( 'customize' ) ) { if ( 'custom-header' === $menu_file ) { $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>"; } elseif ( 'custom-background' === $menu_file ) { $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>"; } } if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { $current_theme_actions[] = "<a class='button button-secondary$class' href='{$item[2]}'>{$item[0]}</a>"; } else { $current_theme_actions[] = "<a class='button button-secondary$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>"; } } } } ?> <div class="theme-browser"> <div class="themes wp-clearfix"> <?php /* * This PHP is synchronized with the tmpl-theme template below! */ foreach ( $themes as $theme ) : $aria_action = esc_attr( $theme['id'] . '-action' ); $aria_name = esc_attr( $theme['id'] . '-name' ); ?> <div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>"> <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?> <div class="theme-screenshot"> <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" /> </div> <?php } else { ?> <div class="theme-screenshot blank"></div> <?php } ?> <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span> <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div> <?php if ( $theme['active'] ) { ?> <h2 class="theme-name" id="<?php echo $aria_name; ?>"> <?php /* translators: %s: theme name */ printf( __( '<span>Active:</span> %s' ), $theme['name'] ); ?> </h2> <?php } else { ?> <h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $theme['name']; ?></h2> <?php } ?> <div class="theme-actions"> <?php if ( $theme['active'] ) { ?> <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a> <?php } ?> <?php } else { ?> <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate' ); ?></a> <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> <?php } ?> <?php } ?> </div> <?php if ( $theme['hasUpdate'] ) { ?> <div class="theme-update"><?php _e( 'Update Available' ); ?></div> <?php } ?> </div> <?php endforeach; ?> </div> </div> <div class="theme-overlay"></div> <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> <?php // List broken themes, if any. if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) { ?> <div class="broken-themes"> <h3><?php _e('Broken Themes'); ?></h3> <p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p> <?php $can_delete = current_user_can( 'delete_themes' ); $can_install = current_user_can( 'install_themes' ); ?> <table> <tr> <th><?php _ex('Name', 'theme name'); ?></th> <th><?php _e('Description'); ?></th> <?php if ( $can_delete ) { ?> <td></td> <?php } ?> <?php if ( $can_install ) { ?> <td></td> <?php } ?> </tr> <?php foreach ( $broken_themes as $broken_theme ) : ?> <tr> <td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td> <td><?php echo $broken_theme->errors()->get_error_message(); ?></td> <?php if ( $can_delete ) { $stylesheet = $broken_theme->get_stylesheet(); $delete_url = add_query_arg( array( 'action' => 'delete', 'stylesheet' => urlencode( $stylesheet ), ), admin_url( 'themes.php' ) ); $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet ); ?> <td><a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a></td> <?php } if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) { $parent_theme_name = $broken_theme->get( 'Template' ); $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) ); if ( ! is_wp_error( $parent_theme ) ) { $install_url = add_query_arg( array( 'action' => 'install-theme', 'theme' => urlencode( $parent_theme_name ), ), admin_url( 'update.php' ) ); $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name ); ?> <td><a href="<?php echo esc_url( $install_url ); ?>" class="button button-secondary install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td> <?php } } ?> </tr> <?php endforeach; ?> </table> </div> <?php } ?> </div><!-- .wrap --> <?php /* * The tmpl-theme template is synchronized with PHP above! */ ?> <script id="tmpl-theme" type="text/template"> <# if ( data.screenshot[0] ) { #> <div class="theme-screenshot"> <img src="{{ data.screenshot[0] }}" alt="" /> </div> <# } else { #> <div class="theme-screenshot blank"></div> <# } #> <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span> <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div> <# if ( data.active ) { #> <h2 class="theme-name" id="{{ data.id }}-name"> <?php /* translators: %s: theme name */ printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' ); ?> </h2> <# } else { #> <h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2> <# } #> <div class="theme-actions"> <# if ( data.active ) { #> <# if ( data.actions.customize ) { #> <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a> <# } #> <# } else { #> <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e( 'Activate' ); ?></a> <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a> <# } #> </div> <# if ( data.hasUpdate ) { #> <div class="theme-update"><?php _e( 'Update Available' ); ?></div> <# } #> </script> <script id="tmpl-theme-single" type="text/template"> <div class="theme-backdrop"></div> <div class="theme-wrap"> <div class="theme-header"> <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button> <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button> <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button> </div> <div class="theme-about"> <div class="theme-screenshots"> <# if ( data.screenshot[0] ) { #> <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div> <# } else { #> <div class="screenshot blank"></div> <# } #> </div> <div class="theme-info"> <# if ( data.active ) { #> <span class="current-label"><?php _e( 'Current Theme' ); ?></span> <# } #> <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2> <p class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></p> <# if ( data.hasUpdate ) { #> <div class="notice notice-warning notice-alt notice-large"> <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3> {{{ data.update }}} </div> <# } #> <p class="theme-description">{{{ data.description }}}</p> <# if ( data.parent ) { #> <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p> <# } #> <# if ( data.tags ) { #> <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p> <# } #> </div> </div> <div class="theme-actions"> <div class="active-theme"> <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a> <?php echo implode( ' ', $current_theme_actions ); ?> </div> <div class="inactive-theme"> <# if ( data.actions.activate ) { #> <a href="{{{ data.actions.activate }}}" class="button button-secondary activate"><?php _e( 'Activate' ); ?></a> <# } #> <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> </div> <# if ( ! data.active && data.actions['delete'] ) { #> <a href="{{{ data.actions['delete'] }}}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a> <# } #> </div> </div> </script> <?php require( ABSPATH . 'wp-admin/admin-footer.php' );
SIB-Colombia/biodiversidad_wp
wp-admin/themes.php
PHP
gpl-2.0
19,644
<?php /** * XOOPS mailer * * You may not change or alter any portion of this comment or credits * of supporting developers from this source code or any supporting source code * which is considered copyrighted (c) material of the original comment or credit authors. * 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. * * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) * @package kernel * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @deprecated use {@link XoopsMultiMailer} instead. */ defined('XOOPS_ROOT_PATH') || exit('Restricted access'); xoops_loadLanguage('mail'); /** * The new Multimailer class that will carry out the actual sending and will later replace this class. * If you're writing new code, please use that class instead. */ include_once $GLOBALS['xoops']->path('class/mail/xoopsmultimailer.php'); /** * Class for sending mail. * * Changed to use the facilities of {@link XoopsMultiMailer} * * @package class * @subpackage mail * @author Kazumi Ono <[email protected]> */ class XoopsMailer { /** * reference to a {@link XoopsMultiMailer} * * @var XoopsMultiMailer * @access private * @since 21.02.2003 14:14:13 */ public $multimailer; // sender email address // private public $fromEmail; // sender name // private public $fromName; // RMV-NOTIFY // sender UID // private public $fromUser; // array of user class objects // private public $toUsers; // array of email addresses // private public $toEmails; // custom headers // private public $headers; // subject of mail // private public $subject; // body of mail // private public $body; // error messages // private public $errors; // messages upon success // private public $success; // private public $isMail; // private public $isPM; // private public $assignedTags; // private public $template; // private public $templatedir; // protected public $charSet = 'iso-8859-1'; // protected public $encoding = '8bit'; /** * Constructor * * @return XoopsMailer */ public function __construct() { $this->multimailer = new XoopsMultiMailer(); $this->reset(); } /** * PHP 4 style constructor compatibility shim * * @deprecated all callers should be using parent::__construct() */ public function XoopsMailer() { $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); trigger_error("Should call parent::__construct in {$trace[0]['file']} line {$trace[0]['line']},"); self::__construct(); } /** * @param bool $value */ public function setHTML($value = true) { $this->multimailer->isHTML($value); } // public // reset all properties to default public function reset() { $this->fromEmail = ''; $this->fromName = ''; $this->fromUser = null; // RMV-NOTIFY $this->priority = ''; $this->toUsers = array(); $this->toEmails = array(); $this->headers = array(); $this->subject = ''; $this->body = ''; $this->errors = array(); $this->success = array(); $this->isMail = false; $this->isPM = false; $this->assignedTags = array(); $this->template = ''; $this->templatedir = ''; // Change below to \r\n if you have problem sending mail $this->LE = "\n"; } // public /** * @param null $value */ public function setTemplateDir($value = null) { if ($value === null && is_object($GLOBALS['xoopsModule'])) { $value = $GLOBALS['xoopsModule']->getVar('dirname', 'n'); } else { $value = str_replace(DIRECTORY_SEPARATOR, '/', $value); } $this->templatedir = $value; } // private /** * @return bool|string */ public function getTemplatePath() { if (!$path = $this->templatedir) { $path = XOOPS_ROOT_PATH . '/language/'; } elseif (false === strpos($path, '/')) { $path = XOOPS_ROOT_PATH . '/modules/' . $path . '/language/'; } elseif (substr($path, -1, 1) !== '/') { $path .= '/'; } if (file_exists($path . $GLOBALS['xoopsConfig']['language'] . '/mail_template/' . $this->template)) { return $path . $GLOBALS['xoopsConfig']['language'] . '/mail_template/' . $this->template; } elseif (file_exists($path . 'english/mail_template/' . $this->template)) { return $path . 'english/mail_template/' . $this->template; } elseif (file_exists($path . $this->template)) { return $path . $this->template; } else { return false; } } // public /** * @param $value */ public function setTemplate($value) { $this->template = $value; } // pupblic /** * @param $value */ public function setFromEmail($value) { $this->fromEmail = trim($value); } // public /** * @param $value */ public function setFromName($value) { $this->fromName = trim($value); } // RMV-NOTIFY // public /** * @param $user */ public function setFromUser($user) { if (strtolower(get_class($user)) === 'xoopsuser') { $this->fromUser = &$user; } } // public /** * @param $value */ public function setPriority($value) { $this->priority = trim($value); } // public /** * @param $value */ public function setSubject($value) { $this->subject = trim($value); } // public /** * @param $value */ public function setBody($value) { $this->body = trim($value); } // public public function useMail() { $this->isMail = true; } // public public function usePM() { $this->isPM = true; } // public /** * @param bool $debug * * @return bool */ public function send($debug = false) { global $xoopsConfig; if ($this->body == '' && $this->template == '') { if ($debug) { $this->errors[] = _MAIL_MSGBODY; } return false; } elseif ($this->template != '') { $path = $this->getTemplatePath(); if (!($fd = @fopen($path, 'r'))) { if ($debug) { $this->errors[] = _MAIL_FAILOPTPL; } return false; } $this->setBody(fread($fd, filesize($path))); } // for sending mail only if ($this->isMail || !empty($this->toEmails)) { if (!empty($this->priority)) { $this->headers[] = 'X-Priority: ' . $this->priority; } // $this->headers[] = "X-Mailer: PHP/".phpversion(); // $this->headers[] = "Return-Path: ".$this->fromEmail; $headers = implode($this->LE, $this->headers); } // TODO: we should have an option of no-reply for private messages and emails // to which we do not accept replies. e.g. the site admin doesn't want a // a lot of message from people trying to unsubscribe. Just make sure to // give good instructions in the message. // add some standard tags (user-dependent tags are included later) global $xoopsConfig; $this->assign('X_ADMINMAIL', $xoopsConfig['adminmail']); $this->assign('X_SITENAME', $xoopsConfig['sitename']); $this->assign('X_SITEURL', XOOPS_URL . '/'); // TODO: also X_ADMINNAME?? // TODO: X_SIGNATURE, X_DISCLAIMER ?? - these are probably best // done as includes if mail templates ever get this sophisticated // replace tags with actual values foreach ($this->assignedTags as $k => $v) { $this->body = str_replace('{' . $k . '}', $v, $this->body); $this->subject = str_replace('{' . $k . '}', $v, $this->subject); } $this->body = str_replace("\r\n", "\n", $this->body); $this->body = str_replace("\r", "\n", $this->body); $this->body = str_replace("\n", $this->LE, $this->body); // send mail to specified mail addresses, if any foreach ($this->toEmails as $mailaddr) { if (!$this->sendMail($mailaddr, $this->subject, $this->body, $headers)) { if ($debug) { $this->errors[] = sprintf(_MAIL_SENDMAILNG, $mailaddr); } } else { if ($debug) { $this->success[] = sprintf(_MAIL_MAILGOOD, $mailaddr); } } } // send message to specified users, if any // NOTE: we don't send to LIST of recipients, because the tags // below are dependent on the user identity; i.e. each user // receives (potentially) a different message foreach ($this->toUsers as $user) { // set some user specific variables $subject = str_replace('{X_UNAME}', $user->getVar('uname'), $this->subject); $text = str_replace('{X_UID}', $user->getVar('uid'), $this->body); $text = str_replace('{X_UEMAIL}', $user->getVar('email'), $text); $text = str_replace('{X_UNAME}', $user->getVar('uname'), $text); if ($user->getVar('name') == ''){ $x_name = $user->getVar('uname'); } else { $x_name = $user->getVar('name'); } $text = str_replace('{X_NAME}', $x_name, $text); $text = str_replace('{X_UACTLINK}', XOOPS_URL . '/register.php?op=actv&id=' . $user->getVar('uid') . '&actkey=' . $user->getVar('actkey'), $text); // send mail if ($this->isMail) { if (!$this->sendMail($user->getVar('email'), $subject, $text, $headers)) { if ($debug) { $this->errors[] = sprintf(_MAIL_SENDMAILNG, $user->getVar('uname')); } } else { if ($debug) { $this->success[] = sprintf(_MAIL_MAILGOOD, $user->getVar('uname')); } } } // send private message if ($this->isPM) { if (!$this->sendPM($user->getVar('uid'), $subject, $text)) { if ($debug) { $this->errors[] = sprintf(_MAIL_SENDPMNG, $user->getVar('uname')); } } else { if ($debug) { $this->success[] = sprintf(_MAIL_PMGOOD, $user->getVar('uname')); } } } flush(); } return !(count($this->errors) > 0); } // private /** * @param $uid * @param $subject * @param $body * * @return bool */ public function sendPM($uid, $subject, $body) { global $xoopsUser; $pm_handler = xoops_getHandler('privmessage'); $pm = $pm_handler->create(); $pm->setVar('subject', $subject); // RMV-NOTIFY $pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') : (empty($xoopsUser) ? 1 : $xoopsUser->getVar('uid'))); $pm->setVar('msg_text', $body); $pm->setVar('to_userid', $uid); if (!$pm_handler->insert($pm)) { return false; } return true; } /** * Send email * * Uses the new XoopsMultiMailer * * @param $email * @param $subject * @param $body * @param $headers * * @return bool */ public function sendMail($email, $subject, $body, $headers) { $subject = $this->encodeSubject($subject); $this->encodeBody($body); $this->multimailer->clearAllRecipients(); $this->multimailer->addAddress($email); $this->multimailer->Subject = $subject; $this->multimailer->Body = $body; $this->multimailer->CharSet = $this->charSet; $this->multimailer->Encoding = $this->encoding; if (!empty($this->fromName)) { $this->multimailer->FromName = $this->encodeFromName($this->fromName); } if (!empty($this->fromEmail)) { $this->multimailer->Sender = $this->multimailer->From = $this->fromEmail; } $this->multimailer->clearCustomHeaders(); foreach ($this->headers as $header) { $this->multimailer->addCustomHeader($header); } if (!$this->multimailer->send()) { $this->errors[] = $this->multimailer->ErrorInfo; return false; } return true; } // public /** * @param bool $ashtml * * @return string */ public function getErrors($ashtml = true) { if (!$ashtml) { return $this->errors; } else { if (!empty($this->errors)) { $ret = '<h4>' . _ERRORS . '</h4>'; foreach ($this->errors as $error) { $ret .= $error . '<br>'; } } else { $ret = ''; } return $ret; } } // public /** * @param bool $ashtml * * @return string */ public function getSuccess($ashtml = true) { if (!$ashtml) { return $this->success; } else { $ret = ''; if (!empty($this->success)) { foreach ($this->success as $suc) { $ret .= $suc . '<br>'; } } return $ret; } } // public /** * @param $tag * @param null $value */ public function assign($tag, $value = null) { if (is_array($tag)) { foreach ($tag as $k => $v) { $this->assign($k, $v); } } else { if (!empty($tag) && isset($value)) { $tag = strtoupper(trim($tag)); // RMV-NOTIFY // TEMPORARY FIXME: until the X_tags are all in here // if ( substr($tag, 0, 2) != "X_" ) { $this->assignedTags[$tag] = $value; // } } } } // public /** * @param $value */ public function addHeaders($value) { $this->headers[] = trim($value) . $this->LE; } // public /** * @param $email */ public function setToEmails($email) { if (!is_array($email)) { if (preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i", $email)) { array_push($this->toEmails, $email); } } else { foreach ($email as $e) { $this->setToEmails($e); } } } // public /** * @param $user */ public function setToUsers($user) { if (!is_array($user)) { if (strtolower(get_class($user)) === 'xoopsuser') { array_push($this->toUsers, $user); } } else { foreach ($user as $u) { $this->setToUsers($u); } } } // public /** * @param $group */ public function setToGroups($group) { if (!is_array($group)) { if (strtolower(get_class($group)) === 'xoopsgroup') { /* @var XoopsMemberHandler $member_handler */ $member_handler = xoops_getHandler('member'); $this->setToUsers($member_handler->getUsersByGroup($group->getVar('groupid'), true)); } } else { foreach ($group as $g) { $this->setToGroups($g); } } } // abstract // to be overridden by lang specific mail class, if needed /** * @param $text * * @return mixed */ public function encodeFromName($text) { return $text; } // abstract // to be overridden by lang specific mail class, if needed /** * @param $text * * @return mixed */ public function encodeSubject($text) { return $text; } // abstract // to be overridden by lang specific mail class, if needed /** * @param $text */ public function encodeBody(&$text) { } }
mambax7/x258
htdocs/class/xoopsmailer.php
PHP
gpl-2.0
17,142
/* * linux/fs/vfat/namei.c * * Written 1992,1993 by Werner Almesberger * * Windows95/Windows NT compatible extended MSDOS filesystem * by Gordon Chaffee Copyright (C) 1995. Send bug reports for the * VFAT filesystem to <[email protected]>. Specify * what file operation caused you trouble and if you can duplicate * the problem, send a script that demonstrates it. * * Short name translation 1999, 2001 by Wolfram Pienkoss <[email protected]> * * Support Multibyte characters and cleanup by * OGAWA Hirofumi <[email protected]> */ #include <linux/module.h> #include <linux/jiffies.h> #include <linux/ctype.h> #include <linux/slab.h> #include <linux/buffer_head.h> #include <linux/random.h> #include <linux/namei.h> #include "fat.h" /* * If new entry was created in the parent, it could create the 8.3 * alias (the shortname of logname). So, the parent may have the * negative-dentry which matches the created 8.3 alias. * * If it happened, the negative dentry isn't actually negative * anymore. So, drop it. */ static int vfat_revalidate_shortname(struct dentry *dentry) { int ret = 1; spin_lock(&dentry->d_lock); if (dentry->d_time != dentry->d_parent->d_inode->i_version) ret = 0; spin_unlock(&dentry->d_lock); return ret; } static int vfat_revalidate(struct dentry *dentry, struct nameidata *nd) { if (nd && nd->flags & LOOKUP_RCU) return -ECHILD; /* This is not negative dentry. Always valid. */ if (dentry->d_inode) return 1; return vfat_revalidate_shortname(dentry); } static int vfat_revalidate_ci(struct dentry *dentry, struct nameidata *nd) { if (nd && nd->flags & LOOKUP_RCU) return -ECHILD; /* * This is not negative dentry. Always valid. * * Note, rename() to existing directory entry will have ->d_inode, * and will use existing name which isn't specified name by user. * * We may be able to drop this positive dentry here. But dropping * positive dentry isn't good idea. So it's unsupported like * rename("filename", "FILENAME") for now. */ if (dentry->d_inode) return 1; /* * This may be nfsd (or something), anyway, we can't see the * intent of this. So, since this can be for creation, drop it. */ if (!nd) return 0; /* * Drop the negative dentry, in order to make sure to use the * case sensitive name which is specified by user if this is * for creation. */ if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET)) return 0; return vfat_revalidate_shortname(dentry); } /* returns the length of a struct qstr, ignoring trailing dots */ static unsigned int __vfat_striptail_len(unsigned int len, const char *name) { while (len && name[len - 1] == '.') len--; return len; } static unsigned int vfat_striptail_len(const struct qstr *qstr) { return __vfat_striptail_len(qstr->len, qstr->name); } /* * Compute the hash for the vfat name corresponding to the dentry. * Note: if the name is invalid, we leave the hash code unchanged so * that the existing dentry can be used. The vfat fs routines will * return ENOENT or EINVAL as appropriate. */ static int vfat_hash(const struct dentry *dentry, const struct inode *inode, struct qstr *qstr) { qstr->hash = full_name_hash(qstr->name, vfat_striptail_len(qstr)); return 0; } /* * Compute the hash for the vfat name corresponding to the dentry. * Note: if the name is invalid, we leave the hash code unchanged so * that the existing dentry can be used. The vfat fs routines will * return ENOENT or EINVAL as appropriate. */ static int vfat_hashi(const struct dentry *dentry, const struct inode *inode, struct qstr *qstr) { struct nls_table *t = MSDOS_SB(dentry->d_sb)->nls_io; const unsigned char *name; unsigned int len; unsigned long hash; name = qstr->name; len = vfat_striptail_len(qstr); hash = init_name_hash(); while (len--) hash = partial_name_hash(nls_tolower(t, *name++), hash); qstr->hash = end_name_hash(hash); return 0; } /* * Case insensitive compare of two vfat names. */ static int vfat_cmpi(const struct dentry *parent, const struct inode *pinode, const struct dentry *dentry, const struct inode *inode, unsigned int len, const char *str, const struct qstr *name) { struct nls_table *t = MSDOS_SB(parent->d_sb)->nls_io; unsigned int alen, blen; /* A filename cannot end in '.' or we treat it like it has none */ alen = vfat_striptail_len(name); blen = __vfat_striptail_len(len, str); if (alen == blen) { if (nls_strnicmp(t, name->name, str, alen) == 0) return 0; } return 1; } /* * Case sensitive compare of two vfat names. */ static int vfat_cmp(const struct dentry *parent, const struct inode *pinode, const struct dentry *dentry, const struct inode *inode, unsigned int len, const char *str, const struct qstr *name) { unsigned int alen, blen; /* A filename cannot end in '.' or we treat it like it has none */ alen = vfat_striptail_len(name); blen = __vfat_striptail_len(len, str); if (alen == blen) { if (strncmp(name->name, str, alen) == 0) return 0; } return 1; } static const struct dentry_operations vfat_ci_dentry_ops = { .d_revalidate = vfat_revalidate_ci, .d_hash = vfat_hashi, .d_compare = vfat_cmpi, }; static const struct dentry_operations vfat_dentry_ops = { .d_revalidate = vfat_revalidate, .d_hash = vfat_hash, .d_compare = vfat_cmp, }; /* Characters that are undesirable in an MS-DOS file name */ static inline wchar_t vfat_bad_char(wchar_t w) { return (w < 0x0020) || (w == '*') || (w == '?') || (w == '<') || (w == '>') || (w == '|') || (w == '"') || (w == ':') || (w == '/') || (w == '\\'); } static inline wchar_t vfat_replace_char(wchar_t w) { return (w == '[') || (w == ']') || (w == ';') || (w == ',') || (w == '+') || (w == '='); } static wchar_t vfat_skip_char(wchar_t w) { return (w == '.') || (w == ' '); } static inline int vfat_is_used_badchars(const wchar_t *s, int len) { int i; for (i = 0; i < len; i++) if (vfat_bad_char(s[i])) return -EINVAL; if (s[i - 1] == ' ') /* last character cannot be space */ return -EINVAL; return 0; } static int vfat_find_form(struct inode *dir, unsigned char *name) { struct fat_slot_info sinfo; int err = fat_scan(dir, name, &sinfo); if (err) return -ENOENT; brelse(sinfo.bh); return 0; } /* * 1) Valid characters for the 8.3 format alias are any combination of * letters, uppercase alphabets, digits, any of the * following special characters: * $ % ' ` - @ { } ~ ! # ( ) & _ ^ * In this case Longfilename is not stored in disk. * * WinNT's Extension: * File name and extension name is contain uppercase/lowercase * only. And it is expressed by CASE_LOWER_BASE and CASE_LOWER_EXT. * * 2) File name is 8.3 format, but it contain the uppercase and * lowercase char, muliti bytes char, etc. In this case numtail is not * added, but Longfilename is stored. * * 3) When the one except for the above, or the following special * character are contained: * . [ ] ; , + = * numtail is added, and Longfilename must be stored in disk . */ struct shortname_info { unsigned char lower:1, upper:1, valid:1; }; #define INIT_SHORTNAME_INFO(x) do { \ (x)->lower = 1; \ (x)->upper = 1; \ (x)->valid = 1; \ } while (0) static inline int to_shortname_char(struct nls_table *nls, unsigned char *buf, int buf_size, wchar_t *src, struct shortname_info *info) { int len; if (vfat_skip_char(*src)) { info->valid = 0; return 0; } if (vfat_replace_char(*src)) { info->valid = 0; buf[0] = '_'; return 1; } len = nls->uni2char(*src, buf, buf_size); if (len <= 0) { info->valid = 0; buf[0] = '_'; len = 1; } else if (len == 1) { unsigned char prev = buf[0]; if (buf[0] >= 0x7F) { info->lower = 0; info->upper = 0; } buf[0] = nls_toupper(nls, buf[0]); if (isalpha(buf[0])) { if (buf[0] == prev) info->lower = 0; else info->upper = 0; } } else { info->lower = 0; info->upper = 0; } return len; } /* * Given a valid longname, create a unique shortname. Make sure the * shortname does not exist * Returns negative number on error, 0 for a normal * return, and 1 for valid shortname */ static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, wchar_t *uname, int ulen, unsigned char *name_res, unsigned char *lcase) { struct fat_mount_options *opts = &MSDOS_SB(dir->i_sb)->options; wchar_t *ip, *ext_start, *end, *name_start; unsigned char base[9], ext[4], buf[5], *p; unsigned char charbuf[NLS_MAX_CHARSET_SIZE]; int chl, chi; int sz = 0, extlen, baselen, i, numtail_baselen, numtail2_baselen; int is_shortname; struct shortname_info base_info, ext_info; is_shortname = 1; INIT_SHORTNAME_INFO(&base_info); INIT_SHORTNAME_INFO(&ext_info); /* Now, we need to create a shortname from the long name */ ext_start = end = &uname[ulen]; while (--ext_start >= uname) { if (*ext_start == 0x002E) { /* is `.' */ if (ext_start == end - 1) { sz = ulen; ext_start = NULL; } break; } } if (ext_start == uname - 1) { sz = ulen; ext_start = NULL; } else if (ext_start) { /* * Names which start with a dot could be just * an extension eg. "...test". In this case Win95 * uses the extension as the name and sets no extension. */ name_start = &uname[0]; while (name_start < ext_start) { if (!vfat_skip_char(*name_start)) break; name_start++; } if (name_start != ext_start) { sz = ext_start - uname; ext_start++; } else { sz = ulen; ext_start = NULL; } } numtail_baselen = 6; numtail2_baselen = 2; for (baselen = i = 0, p = base, ip = uname; i < sz; i++, ip++) { chl = to_shortname_char(nls, charbuf, sizeof(charbuf), ip, &base_info); if (chl == 0) continue; if (baselen < 2 && (baselen + chl) > 2) numtail2_baselen = baselen; if (baselen < 6 && (baselen + chl) > 6) numtail_baselen = baselen; for (chi = 0; chi < chl; chi++) { *p++ = charbuf[chi]; baselen++; if (baselen >= 8) break; } if (baselen >= 8) { if ((chi < chl - 1) || (ip + 1) - uname < sz) is_shortname = 0; break; } } if (baselen == 0) { return -EINVAL; } extlen = 0; if (ext_start) { for (p = ext, ip = ext_start; extlen < 3 && ip < end; ip++) { chl = to_shortname_char(nls, charbuf, sizeof(charbuf), ip, &ext_info); if (chl == 0) continue; if ((extlen + chl) > 3) { is_shortname = 0; break; } for (chi = 0; chi < chl; chi++) { *p++ = charbuf[chi]; extlen++; } if (extlen >= 3) { if (ip + 1 != end) is_shortname = 0; break; } } } ext[extlen] = '\0'; base[baselen] = '\0'; /* Yes, it can happen. ".\xe5" would do it. */ if (base[0] == DELETED_FLAG) base[0] = 0x05; /* OK, at this point we know that base is not longer than 8 symbols, * ext is not longer than 3, base is nonempty, both don't contain * any bad symbols (lowercase transformed to uppercase). */ memset(name_res, ' ', MSDOS_NAME); memcpy(name_res, base, baselen); memcpy(name_res + 8, ext, extlen); *lcase = 0; if (is_shortname && base_info.valid && ext_info.valid) { if (vfat_find_form(dir, name_res) == 0) return -EEXIST; if (opts->shortname & VFAT_SFN_CREATE_WIN95) { return (base_info.upper && ext_info.upper); } else if (opts->shortname & VFAT_SFN_CREATE_WINNT) { if ((base_info.upper || base_info.lower) && (ext_info.upper || ext_info.lower)) { if (!base_info.upper && base_info.lower) *lcase |= CASE_LOWER_BASE; if (!ext_info.upper && ext_info.lower) *lcase |= CASE_LOWER_EXT; return 1; } return 0; } else { BUG(); } } if (opts->numtail == 0) if (vfat_find_form(dir, name_res) < 0) return 0; /* * Try to find a unique extension. This used to * iterate through all possibilities sequentially, * but that gave extremely bad performance. Windows * only tries a few cases before using random * values for part of the base. */ if (baselen > 6) { baselen = numtail_baselen; name_res[7] = ' '; } name_res[baselen] = '~'; for (i = 1; i < 10; i++) { name_res[baselen + 1] = i + '0'; if (vfat_find_form(dir, name_res) < 0) return 0; } i = jiffies; sz = (jiffies >> 16) & 0x7; if (baselen > 2) { baselen = numtail2_baselen; name_res[7] = ' '; } name_res[baselen + 4] = '~'; name_res[baselen + 5] = '1' + sz; while (1) { snprintf(buf, sizeof(buf), "%04X", i & 0xffff); memcpy(&name_res[baselen], buf, 4); if (vfat_find_form(dir, name_res) < 0) break; i -= 11; } return 0; } /* Translate a string, including coded sequences into Unicode */ static int xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, int *longlen, int *outlen, int escape, int utf8, struct nls_table *nls) { const unsigned char *ip; unsigned char nc; unsigned char *op; unsigned int ec; int i, k, fill; int charlen; if (utf8) { *outlen = utf8s_to_utf16s(name, len, UTF16_HOST_ENDIAN, (wchar_t *) outname, FAT_LFN_LEN + 2); if (*outlen < 0) return *outlen; else if (*outlen > FAT_LFN_LEN) return -ENAMETOOLONG; op = &outname[*outlen * sizeof(wchar_t)]; } else { for (i = 0, ip = name, op = outname, *outlen = 0; i < len && *outlen < FAT_LFN_LEN; *outlen += 1) { if (escape && (*ip == ':')) { if (i > len - 5) return -EINVAL; ec = 0; for (k = 1; k < 5; k++) { nc = ip[k]; ec <<= 4; if (nc >= '0' && nc <= '9') { ec |= nc - '0'; continue; } if (nc >= 'a' && nc <= 'f') { ec |= nc - ('a' - 10); continue; } if (nc >= 'A' && nc <= 'F') { ec |= nc - ('A' - 10); continue; } return -EINVAL; } *op++ = ec & 0xFF; *op++ = ec >> 8; ip += 5; i += 5; } else { charlen = nls->char2uni(ip, len - i, (wchar_t *)op); if (charlen < 0) return -EINVAL; ip += charlen; i += charlen; op += 2; } } if (i < len) return -ENAMETOOLONG; } *longlen = *outlen; if (*outlen % 13) { *op++ = 0; *op++ = 0; *outlen += 1; if (*outlen % 13) { fill = 13 - (*outlen % 13); for (i = 0; i < fill; i++) { *op++ = 0xff; *op++ = 0xff; } *outlen += fill; } } return 0; } #ifndef CONFIG_VFAT_FS_DUALNAMES /* * build a 11 byte 8.3 buffer which is not a short filename. We want 11 * bytes which: * - will be seen as a constant string to all APIs on Linux and Windows * - cannot be matched with wildcard patterns * - cannot be used to access the file * - has a low probability of collision within a directory * - has an invalid 3 byte extension * - contains at least one non-space and non-nul byte */ static void vfat_build_dummy_83_buffer(struct inode *dir, char *msdos_name) { u32 rand_num = random32() & 0x3FFFFFFF; int i; /* a value of zero would leave us with only nul and spaces, * which would not work with older linux systems */ if (rand_num == 0) rand_num = 1; /* we start with a space followed by nul as spaces at the * start of an entry are trimmed in FAT, which means that * starting the 11 bytes with 0x20 0x00 gives us a value which * cannot be used to access the file. It also means that the * value as seen from all Windows and Linux APIs is a constant */ msdos_name[0] = ' '; msdos_name[1] = 0; /* we use / and 2 nul bytes for the extension. These are * invalid in FAT and mean that utilities that show the * directory show no extension, but still work via the long * name for old Linux kernels */ msdos_name[8] = '/'; msdos_name[9] = 0; msdos_name[10] = 0; /* * fill the remaining 6 bytes with random invalid values * This gives us a low collision rate, which means a low * chance of problems with chkdsk.exe and WindowsXP */ for (i = 2; i < 8; i++) { msdos_name[i] = rand_num & 0x1F; rand_num >>= 5; } } #endif static int vfat_build_slots(struct inode *dir, const unsigned char *name, int len, int is_dir, int cluster, struct timespec *ts, struct msdos_dir_slot *slots, int *nr_slots) { struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); struct fat_mount_options *opts = &sbi->options; struct msdos_dir_slot *ps; struct msdos_dir_entry *de; unsigned char cksum, lcase; unsigned char msdos_name[MSDOS_NAME]; wchar_t *uname; __le16 time, date; u8 time_cs; int err, ulen, usize, i; loff_t offset; *nr_slots = 0; uname = __getname(); if (!uname) return -ENOMEM; err = xlate_to_uni(name, len, (unsigned char *)uname, &ulen, &usize, opts->unicode_xlate, opts->utf8, sbi->nls_io); if (err) goto out_free; err = vfat_is_used_badchars(uname, ulen); if (err) goto out_free; err = vfat_create_shortname(dir, sbi->nls_disk, uname, ulen, msdos_name, &lcase); if (err < 0) goto out_free; else if (err == 1) { de = (struct msdos_dir_entry *)slots; err = 0; goto shortname; } #ifndef CONFIG_VFAT_FS_DUALNAMES vfat_build_dummy_83_buffer(dir, msdos_name); lcase = 0; #endif /* build the entry of long file name */ cksum = fat_checksum(msdos_name); *nr_slots = usize / 13; for (ps = slots, i = *nr_slots; i > 0; i--, ps++) { ps->id = i; ps->attr = ATTR_EXT; ps->reserved = 0; ps->alias_checksum = cksum; ps->start = 0; offset = (i - 1) * 13; fatwchar_to16(ps->name0_4, uname + offset, 5); fatwchar_to16(ps->name5_10, uname + offset + 5, 6); fatwchar_to16(ps->name11_12, uname + offset + 11, 2); } slots[0].id |= 0x40; de = (struct msdos_dir_entry *)ps; shortname: /* build the entry of 8.3 alias name */ (*nr_slots)++; memcpy(de->name, msdos_name, MSDOS_NAME); de->attr = is_dir ? ATTR_DIR : ATTR_ARCH; de->lcase = lcase; fat_time_unix2fat(sbi, ts, &time, &date, &time_cs); de->time = de->ctime = time; de->date = de->cdate = de->adate = date; de->ctime_cs = time_cs; de->start = cpu_to_le16(cluster); de->starthi = cpu_to_le16(cluster >> 16); de->size = 0; out_free: __putname(uname); return err; } static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir, int cluster, struct timespec *ts, struct fat_slot_info *sinfo) { struct msdos_dir_slot *slots; unsigned int len; int err, nr_slots; len = vfat_striptail_len(qname); if (len == 0) return -ENOENT; slots = kmalloc(sizeof(*slots) * MSDOS_SLOTS, GFP_NOFS); if (slots == NULL) return -ENOMEM; err = vfat_build_slots(dir, qname->name, len, is_dir, cluster, ts, slots, &nr_slots); if (err) goto cleanup; err = fat_add_entries(dir, slots, nr_slots, sinfo); if (err) goto cleanup; /* update timestamp */ dir->i_ctime = dir->i_mtime = dir->i_atime = *ts; if (IS_DIRSYNC(dir)) (void)fat_sync_inode(dir); else mark_inode_dirty(dir); cleanup: kfree(slots); return err; } static int vfat_find(struct inode *dir, struct qstr *qname, struct fat_slot_info *sinfo) { unsigned int len = vfat_striptail_len(qname); if (len == 0) return -ENOENT; return fat_search_long(dir, qname->name, len, sinfo); } /* * (nfsd's) anonymous disconnected dentry? * NOTE: !IS_ROOT() is not anonymous (I.e. d_splice_alias() did the job). */ static int vfat_d_anon_disconn(struct dentry *dentry) { return IS_ROOT(dentry) && (dentry->d_flags & DCACHE_DISCONNECTED); } static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) { struct super_block *sb = dir->i_sb; struct fat_slot_info sinfo; struct inode *inode; struct dentry *alias; int err; lock_super(sb); err = vfat_find(dir, &dentry->d_name, &sinfo); if (err) { if (err == -ENOENT) { inode = NULL; goto out; } goto error; } inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); brelse(sinfo.bh); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; } alias = d_find_alias(inode); if (alias && !vfat_d_anon_disconn(alias)) { /* * This inode has non anonymous-DCACHE_DISCONNECTED * dentry. This means, the user did ->lookup() by an * another name (longname vs 8.3 alias of it) in past. * * Switch to new one for reason of locality if possible. */ BUG_ON(d_unhashed(alias)); if (!S_ISDIR(inode->i_mode)) d_move(alias, dentry); iput(inode); unlock_super(sb); return alias; } else dput(alias); out: unlock_super(sb); dentry->d_time = dentry->d_parent->d_inode->i_version; dentry = d_splice_alias(inode, dentry); if (dentry) dentry->d_time = dentry->d_parent->d_inode->i_version; return dentry; error: unlock_super(sb); return ERR_PTR(err); } static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd) { struct super_block *sb = dir->i_sb; struct inode *inode; struct fat_slot_info sinfo; struct timespec ts; int err; lock_super(sb); ts = CURRENT_TIME_SEC; err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); if (err) goto out; dir->i_version++; inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); brelse(sinfo.bh); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto out; } inode->i_version++; inode->i_mtime = inode->i_atime = inode->i_ctime = ts; /* timestamp is already written, so mark_inode_dirty() is unneeded. */ dentry->d_time = dentry->d_parent->d_inode->i_version; d_instantiate(dentry, inode); out: unlock_super(sb); return err; } static int vfat_rmdir(struct inode *dir, struct dentry *dentry) { struct inode *inode = dentry->d_inode; struct super_block *sb = dir->i_sb; struct fat_slot_info sinfo; int err; lock_super(sb); err = fat_dir_empty(inode); if (err) goto out; err = vfat_find(dir, &dentry->d_name, &sinfo); if (err) goto out; err = fat_remove_entries(dir, &sinfo); /* and releases bh */ if (err) goto out; drop_nlink(dir); clear_nlink(inode); inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; fat_detach(inode); out: unlock_super(sb); return err; } static int vfat_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = dentry->d_inode; struct super_block *sb = dir->i_sb; struct fat_slot_info sinfo; int err; lock_super(sb); err = vfat_find(dir, &dentry->d_name, &sinfo); if (err) goto out; err = fat_remove_entries(dir, &sinfo); /* and releases bh */ if (err) goto out; clear_nlink(inode); inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; fat_detach(inode); out: unlock_super(sb); return err; } static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { struct super_block *sb = dir->i_sb; struct inode *inode; struct fat_slot_info sinfo; struct timespec ts; int err, cluster; lock_super(sb); ts = CURRENT_TIME_SEC; cluster = fat_alloc_new_dir(dir, &ts); if (cluster < 0) { err = cluster; goto out; } err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); if (err) goto out_free; dir->i_version++; inc_nlink(dir); inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); brelse(sinfo.bh); if (IS_ERR(inode)) { err = PTR_ERR(inode); /* the directory was completed, just return a error */ goto out; } inode->i_version++; set_nlink(inode, 2); inode->i_mtime = inode->i_atime = inode->i_ctime = ts; /* timestamp is already written, so mark_inode_dirty() is unneeded. */ dentry->d_time = dentry->d_parent->d_inode->i_version; d_instantiate(dentry, inode); unlock_super(sb); return 0; out_free: fat_free_clusters(dir, cluster); out: unlock_super(sb); return err; } static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { struct buffer_head *dotdot_bh; struct msdos_dir_entry *dotdot_de; struct inode *old_inode, *new_inode; struct fat_slot_info old_sinfo, sinfo; struct timespec ts; loff_t dotdot_i_pos, new_i_pos; int err, is_dir, update_dotdot, corrupt = 0; struct super_block *sb = old_dir->i_sb; old_sinfo.bh = sinfo.bh = dotdot_bh = NULL; old_inode = old_dentry->d_inode; new_inode = new_dentry->d_inode; lock_super(sb); err = vfat_find(old_dir, &old_dentry->d_name, &old_sinfo); if (err) goto out; is_dir = S_ISDIR(old_inode->i_mode); update_dotdot = (is_dir && old_dir != new_dir); if (update_dotdot) { if (fat_get_dotdot_entry(old_inode, &dotdot_bh, &dotdot_de, &dotdot_i_pos) < 0) { err = -EIO; goto out; } } ts = CURRENT_TIME_SEC; if (new_inode) { if (is_dir) { err = fat_dir_empty(new_inode); if (err) goto out; } new_i_pos = MSDOS_I(new_inode)->i_pos; fat_detach(new_inode); } else { err = vfat_add_entry(new_dir, &new_dentry->d_name, is_dir, 0, &ts, &sinfo); if (err) goto out; new_i_pos = sinfo.i_pos; } new_dir->i_version++; fat_detach(old_inode); fat_attach(old_inode, new_i_pos); if (IS_DIRSYNC(new_dir)) { err = fat_sync_inode(old_inode); if (err) goto error_inode; } else mark_inode_dirty(old_inode); if (update_dotdot) { int start = MSDOS_I(new_dir)->i_logstart; dotdot_de->start = cpu_to_le16(start); dotdot_de->starthi = cpu_to_le16(start >> 16); mark_buffer_dirty_inode(dotdot_bh, old_inode); if (IS_DIRSYNC(new_dir)) { err = sync_dirty_buffer(dotdot_bh); if (err) goto error_dotdot; } drop_nlink(old_dir); if (!new_inode) inc_nlink(new_dir); } err = fat_remove_entries(old_dir, &old_sinfo); /* and releases bh */ old_sinfo.bh = NULL; if (err) goto error_dotdot; old_dir->i_version++; old_dir->i_ctime = old_dir->i_mtime = ts; if (IS_DIRSYNC(old_dir)) (void)fat_sync_inode(old_dir); else mark_inode_dirty(old_dir); if (new_inode) { drop_nlink(new_inode); if (is_dir) drop_nlink(new_inode); new_inode->i_ctime = ts; } out: brelse(sinfo.bh); brelse(dotdot_bh); brelse(old_sinfo.bh); unlock_super(sb); return err; error_dotdot: /* data cluster is shared, serious corruption */ corrupt = 1; if (update_dotdot) { int start = MSDOS_I(old_dir)->i_logstart; dotdot_de->start = cpu_to_le16(start); dotdot_de->starthi = cpu_to_le16(start >> 16); mark_buffer_dirty_inode(dotdot_bh, old_inode); corrupt |= sync_dirty_buffer(dotdot_bh); } error_inode: fat_detach(old_inode); fat_attach(old_inode, old_sinfo.i_pos); if (new_inode) { fat_attach(new_inode, new_i_pos); if (corrupt) corrupt |= fat_sync_inode(new_inode); } else { /* * If new entry was not sharing the data cluster, it * shouldn't be serious corruption. */ int err2 = fat_remove_entries(new_dir, &sinfo); if (corrupt) corrupt |= err2; sinfo.bh = NULL; } if (corrupt < 0) { fat_fs_error(new_dir->i_sb, "%s: Filesystem corrupted (i_pos %lld)", __func__, sinfo.i_pos); } goto out; } static const struct inode_operations vfat_dir_inode_operations = { .create = vfat_create, .lookup = vfat_lookup, .unlink = vfat_unlink, .mkdir = vfat_mkdir, .rmdir = vfat_rmdir, .rename = vfat_rename, .setattr = fat_setattr, .getattr = fat_getattr, }; static void setup(struct super_block *sb) { MSDOS_SB(sb)->dir_ops = &vfat_dir_inode_operations; if (MSDOS_SB(sb)->options.name_check != 's') sb->s_d_op = &vfat_ci_dentry_ops; else sb->s_d_op = &vfat_dentry_ops; } static int vfat_fill_super(struct super_block *sb, void *data, int silent) { return fat_fill_super(sb, data, silent, 1, setup); } static struct dentry *vfat_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { return mount_bdev(fs_type, flags, dev_name, data, vfat_fill_super); } static struct file_system_type vfat_fs_type = { .owner = THIS_MODULE, .name = "vfat", .mount = vfat_mount, .kill_sb = kill_block_super, .fs_flags = FS_REQUIRES_DEV, }; static int __init init_vfat_fs(void) { return register_filesystem(&vfat_fs_type); } static void __exit exit_vfat_fs(void) { unregister_filesystem(&vfat_fs_type); } MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("VFAT filesystem support"); MODULE_AUTHOR("Gordon Chaffee"); module_init(init_vfat_fs) module_exit(exit_vfat_fs)
sbdags/tf701t_kernel_source
fs/fat/namei_vfat.c
C
gpl-2.0
28,225
/** * ext2_internal.c - Internal support routines for EXT2-based devices. * * Copyright (c) 2006 Michael "Chishm" Chisholm * Copyright (c) 2009 Rhys "Shareese" Koedijk * Copyright (c) 2010 Dimok * * This program/include file 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/include file 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 <stdlib.h> #include <errno.h> #include <string.h> #include "ext2_internal.h" #include "ext2dir.h" #include "ext2file.h" #include "gekko_io2.h" #include "ext2fs.h" // EXT2 device driver devoptab static const devoptab_t devops_ext2 = { NULL, /* Device name */ sizeof(ext2_file_state), ext2_open_r, ext2_close_r, ext2_write_r, ext2_read_r, ext2_seek_r, ext2_seek64_r, ext2_fstat_r, ext2_stat_r, ext2_link_r, ext2_unlink_r, ext2_chdir_r, ext2_rename_r, ext2_mkdir_r, sizeof(ext2_dir_state), ext2_diropen_r, ext2_dirreset_r, ext2_dirnext_r, ext2_dirclose_r, ext2_statvfs_r, ext2_ftruncate_r, ext2_fsync_r, ext2_file_to_sectors, NULL /* Device data */ }; const devoptab_t *ext2GetDevOpTab() { return &devops_ext2; } int ext2AddDevice (const char *name, void *deviceData) { const devoptab_t *devoptab_ext2 = ext2GetDevOpTab(); devoptab_t *dev = NULL; char *devname = NULL; int i; // Sanity check if (!name || !deviceData || !devoptab_ext2) { errno = EINVAL; return -1; } // Allocate a devoptab for this device dev = (devoptab_t *) mem_alloc(sizeof(devoptab_t) + strlen(name) + 1); if (!dev) { errno = ENOMEM; return -1; } // Use the space allocated at the end of the devoptab for storing the device name devname = (char*)(dev + 1); strcpy(devname, name); // Setup the devoptab memcpy(dev, devoptab_ext2, sizeof(devoptab_t)); dev->name = devname; dev->deviceData = deviceData; // Add the device to the devoptab table (if there is a free slot) for (i = 0; i < STD_MAX; i++) { if (devoptab_list[i] == devoptab_list[0] && i != 0) { devoptab_list[i] = dev; return 0; } } // If we reach here then there are no free slots in the devoptab table for this device errno = EADDRNOTAVAIL; return -1; } void ext2RemoveDevice (const char *path) { const devoptab_t *devoptab = NULL; char name[128] = {0}; int i; // Get the device name from the path strncpy(name, path, 127); strtok(name, ":/"); // Find and remove the specified device from the devoptab table // NOTE: We do this manually due to a 'bug' in RemoveDevice // which ignores names with suffixes for (i = 0; i < STD_MAX; i++) { devoptab = devoptab_list[i]; if (devoptab && devoptab->name) { if (strcmp(name, devoptab->name) == 0) { devoptab_list[i] = devoptab_list[0]; mem_free((devoptab_t*)devoptab); break; } } } return; } const devoptab_t *ext2GetDevice (const char *path) { const devoptab_t *devoptab = NULL; char name[128] = {0}; int i; // Get the device name from the path strncpy(name, path, 127); strtok(name, ":/"); // Search the devoptab table for the specified device name // NOTE: We do this manually due to a 'bug' in GetDeviceOpTab // which ignores names with suffixes for (i = 0; i < STD_MAX; i++) { devoptab = devoptab_list[i]; if (devoptab && devoptab->name) { if (strcmp(name, devoptab->name) == 0) { return devoptab; } } } errno = ENXIO; return NULL; } ext2_vd *ext2GetVolume (const char *path) { // Get the volume descriptor from the paths associated devoptab (if found) const devoptab_t *devoptab_ext2 = ext2GetDevOpTab(); const devoptab_t *devoptab = ext2GetDevice(path); if (devoptab && devoptab_ext2 && (devoptab->open_r == devoptab_ext2->open_r)) return (ext2_vd*)devoptab->deviceData; return NULL; } int ext2InitVolume (ext2_vd *vd) { // Sanity check if (!vd) { errno = ENODEV; return -1; } // Reset the volumes data memset(vd, 0, sizeof(ext2_vd)); // Initialise the volume lock // LWP_MutexInit(&vd->lock, false); static const sys_lwmutex_attr_t attr = { SYS_LWMUTEX_ATTR_PROTOCOL,SYS_LWMUTEX_ATTR_RECURSIVE,"" }; sysLwMutexCreate(&vd->lock, &attr); return 0; } void ext2DeinitVolume (ext2_vd *vd) { // Sanity check if (!vd) { errno = ENODEV; return; } // Lock ext2Lock(vd); // Close any directories which are still open (lazy programmers!) ext2_dir_state *nextDir = vd->firstOpenDir; while (nextDir) { ext2CloseDir(nextDir); nextDir = nextDir->nextOpenDir; } // Close any files which are still open (lazy programmers!) ext2_file_state *nextFile = vd->firstOpenFile; while (nextFile) { ext2CloseFile(nextFile); nextFile = nextFile->nextOpenFile; } // Reset open directory and file stats vd->openDirCount = 0; vd->openFileCount = 0; vd->firstOpenDir = NULL; vd->firstOpenFile = NULL; // Force the underlying device to sync ext2Sync(vd, NULL); // Unlock ext2Unlock(vd); // Deinitialise the volume lock //LWP_MutexDestroy(vd->lock); sysLwMutexDestroy(&vd->lock); } static ext2_ino_t ext2PathToInode(ext2_vd *vd, const char * path) { //Sanity check if(!vd || !path) return 0; char filename[EXT2_NAME_LEN]; errcode_t errorcode = 0; ext2_ino_t ino = 0, parent = vd->cwd_ni && *path != '/' && *path != '\0' ? vd->cwd_ni->ino : vd->root; const char * ptr = path; int i; while(*ptr == '/') ++ptr; if(*ptr == '\0') return parent; while(*ptr != '\0') { for(i = 0; *ptr != '\0' && *ptr != '/' && (i < EXT2_NAME_LEN-1); ++ptr, ++i) filename[i] = *ptr; filename[i] = '\0'; errorcode = ext2fs_namei_follow(vd->fs, vd->root, parent, filename, &ino); if(errorcode != EXT2_ET_OK) return 0; parent = ino; while(*ptr == '/') ++ptr; } return ino; } ext2_inode_t *ext2OpenEntry (ext2_vd *vd, const char *path) { errcode_t errorcode = 0; ext2_inode_t * ni = 0; // Sanity check if (!vd) { errno = ENODEV; return NULL; } // Get the actual path of the entry path = ext2RealPath(path); if (!path) return NULL; ni = mem_alloc(sizeof(ext2_inode_t)); if(!ni) { errno = ENOMEM; return NULL; } memset(ni, 0, sizeof(ext2_inode_t)); // Find the entry, taking into account our current directory (if any) ni->ino = ext2PathToInode(vd, path); if(ni->ino == 0) { errno = ENOENT; mem_free(ni); return NULL; } errorcode = ext2fs_read_inode(vd->fs, ni->ino, &ni->ni); if(errorcode) { errno = EFAULT; mem_free(ni); return NULL; } return ni; } void ext2CloseEntry(ext2_vd *vd, ext2_inode_t * ni) { // Sanity check if (!vd || !ni) { errno = ENODEV; return; } // Lock ext2Lock(vd); // Sync the entry (if it is dirty) if(ni && ni->dirty) ext2fs_write_inode(vd->fs, ni->ino, &ni->ni); // Close the entry if(ni) mem_free(ni); // Unlock ext2Unlock(vd); return; } static ext2_ino_t ext2CreateSymlink(ext2_vd *vd, const char *path, const char * targetdir, const char * name, mode_t type) { ext2_inode_t *target_ni = NULL; ext2_ino_t newentry = 0; ext2_ino_t ino = 0; // Check if it does exist target_ni = ext2OpenEntry(vd, targetdir); if (!target_ni) goto cleanup; int err = ext2fs_new_inode(vd->fs, target_ni->ino, type, 0, &ino); if (err) { errno = EFAULT; goto cleanup; } while((err = ext2fs_link(vd->fs, target_ni->ino, name, ino, EXT2_FT_SYMLINK)) == EXT2_ET_DIR_NO_SPACE) { if (ext2fs_expand_dir(vd->fs, target_ni->ino) != EXT2_ET_OK) { errno = EMLINK; goto cleanup; } } if(err != EXT2_ET_OK) { errno = EMLINK; return 0; } ext2fs_inode_alloc_stats2(vd->fs, ino, +1, 0); struct ext2_inode inode; memset(&inode, 0, sizeof(inode)); inode.i_mode = type; inode.i_atime = inode.i_ctime = inode.i_mtime = time(NULL); inode.i_links_count = 1; inode.i_size = strlen(path); //initial size of file inode.i_uid = target_ni->ni.i_uid; inode.i_gid = target_ni->ni.i_gid; if (strlen(path) <= sizeof(inode.i_block)) { /* fast symlink */ strncpy((char *)&(inode.i_block[0]),path,sizeof(inode.i_blocks)); } else { /* slow symlink */ char * buffer = mem_alloc(vd->fs->blocksize); if (buffer) { blk_t blk; strncpy(buffer, path, vd->fs->blocksize); err = ext2fs_new_block(vd->fs, 0, 0, &blk); if (!err) { inode.i_block[0] = blk; inode.i_blocks = vd->fs->blocksize / 512; vd->fs->io->manager->write_blk(vd->fs->io, blk, 1, buffer); ext2fs_block_alloc_stats(vd->fs, blk, +1); } mem_free(buffer); } } if(ext2fs_write_new_inode(vd->fs, ino, &inode) != 0) newentry = ino; cleanup: if(target_ni) ext2CloseEntry(vd, target_ni); return newentry; } static ext2_ino_t ext2CreateMkDir(ext2_vd *vd, ext2_inode_t * parent, int type, const char * name) { ext2_ino_t newentry = 0; ext2_ino_t existing; if(ext2fs_namei_follow(vd->fs, vd->root, parent->ino, name, &existing) == 0){ errno = EEXIST; return 0; } errcode_t err = ext2fs_new_inode(vd->fs, parent->ino, type, 0, &newentry); if(err != EXT2_ET_OK) { errno = EFAULT; return 0; } while((err = ext2fs_mkdir(vd->fs, parent->ino, newentry, name)) == EXT2_ET_DIR_NO_SPACE) { if(ext2fs_expand_dir(vd->fs, parent->ino) != EXT2_ET_OK) { errno = EMLINK; return 0; } } if(err != EXT2_ET_OK) { errno = EMLINK; return 0; } struct ext2_inode inode; if(ext2fs_read_inode(vd->fs, newentry, &inode) == EXT2_ET_OK) { inode.i_mode = type; inode.i_uid = parent->ni.i_uid; inode.i_gid = parent->ni.i_gid; ext2fs_write_new_inode(vd->fs, newentry, &inode); } return newentry; } static ext2_ino_t ext2CreateFile(ext2_vd *vd, ext2_inode_t * parent, int type, const char * name) { errcode_t retval = -1; ext2_ino_t newfile = 0; ext2_ino_t existing; if(ext2fs_namei_follow(vd->fs, vd->root, parent->ino, name, &existing) == 0) { errno = EEXIST; return 0; } retval = ext2fs_new_inode(vd->fs, parent->ino, type, 0, &newfile); if (retval) { errno = EFAULT; return 0; } while((retval = ext2fs_link(vd->fs, parent->ino, name, newfile, EXT2_FT_REG_FILE)) == EXT2_ET_DIR_NO_SPACE) { if (ext2fs_expand_dir(vd->fs, parent->ino) != EXT2_ET_OK) { errno = EMLINK; return 0; } } if (retval != EXT2_ET_OK) { errno = EMLINK; return 0; } ext2fs_inode_alloc_stats2(vd->fs, newfile, +1, 0); struct ext2_inode inode; memset(&inode, 0, sizeof(inode)); inode.i_mode = type; inode.i_atime = inode.i_ctime = inode.i_mtime = time(0); inode.i_links_count = 1; inode.i_size = 0; inode.i_uid = parent->ni.i_uid; inode.i_gid = parent->ni.i_gid; if (ext2fs_write_new_inode(vd->fs, newfile, &inode) != 0) return 0; return newfile; } ext2_inode_t *ext2Create(ext2_vd *vd, const char *path, mode_t type, const char *target) { ext2_inode_t *dir_ni = NULL, *ni = NULL; char *dir = NULL; char *targetdir = NULL; char *name = NULL; ext2_ino_t newentry = 0; // Sanity check if (!vd || !vd->fs) { errno = ENODEV; return NULL; } if(!(vd->fs->flags & EXT2_FLAG_RW)) { errno = EACCES; return NULL; } // You cannot link between devices if(target) { if(vd != ext2GetVolume(target)) { errno = EXDEV; return NULL; } // Check if existing dir_ni = ext2OpenEntry(vd, target); if (dir_ni) { errno = EEXIST; goto cleanup; } targetdir = strdup(target); if (!targetdir) { errno = ENOMEM; goto cleanup; } target = ext2RealPath(target); } // Get the actual paths of the entry path = ext2RealPath(path); if (!path) goto cleanup; // Lock ext2Lock(vd); // Clean me // NOTE: this looks horrible right now and need a cleanup dir = strdup(path); if (!dir) { errno = ENOMEM; goto cleanup; } char * tmp_path = (targetdir && (type == S_IFLNK)) ? targetdir : dir; if (strrchr(tmp_path, '/') != NULL) { char * ptr = strrchr(tmp_path, '/'); name = strdup(ptr+1); *ptr = '\0'; } else name = strdup(tmp_path); // Open the entries parent directory dir_ni = ext2OpenEntry(vd, dir); if (!dir_ni) goto cleanup; // If not yet read, read the inode and block bitmap if((!vd->fs->inode_map || !vd->fs->block_map)) ext2fs_read_bitmaps(vd->fs); // Symbolic link if(type == S_IFLNK) { if (!target) { errno = EINVAL; goto cleanup; } newentry = ext2CreateSymlink(vd, path, targetdir, name, type); } // Directory else if(type == S_IFDIR) { newentry = ext2CreateMkDir(vd, dir_ni, LINUX_S_IFDIR | (0755 & ~vd->fs->umask), name); } // File else if(type == S_IFREG) { newentry = ext2CreateFile(vd, dir_ni, LINUX_S_IFREG | (0755 & ~vd->fs->umask), name); } // If the entry was created if (newentry != 0) { // Sync the entry to disc ext2Sync(vd, NULL); ni = ext2OpenEntry(vd, target ? target : path); } cleanup: if(dir_ni) ext2CloseEntry(vd, dir_ni); if(name) mem_free(name); if(dir) mem_free(dir); if(targetdir) mem_free(targetdir); // Unlock ext2Unlock(vd); return ni; } /* * Given a mode, return the ext2 file type */ static int ext2_file_type(unsigned int mode) { if (LINUX_S_ISREG(mode)) return EXT2_FT_REG_FILE; if (LINUX_S_ISDIR(mode)) return EXT2_FT_DIR; if (LINUX_S_ISCHR(mode)) return EXT2_FT_CHRDEV; if (LINUX_S_ISBLK(mode)) return EXT2_FT_BLKDEV; if (LINUX_S_ISLNK(mode)) return EXT2_FT_SYMLINK; if (LINUX_S_ISFIFO(mode)) return EXT2_FT_FIFO; if (LINUX_S_ISSOCK(mode)) return EXT2_FT_SOCK; return 0; } int ext2Link(ext2_vd *vd, const char *old_path, const char *new_path) { ext2_inode_t *dir_ni = NULL, *ni = NULL; char *dir = NULL; char *name = NULL; errcode_t err = 0; // Sanity check if (!vd || !vd->fs) { errno = ENODEV; return -1; } if(!(vd->fs->flags & EXT2_FLAG_RW)) { errno = EACCES; return -1; } // You cannot link between devices if(vd != ext2GetVolume(new_path)) { errno = EXDEV; return -1; } // Get the actual paths of the entry old_path = ext2RealPath(old_path); new_path = ext2RealPath(new_path); if (!old_path || !new_path) return -1; // Lock ext2Lock(vd); //check for existing in new path ni = ext2OpenEntry(vd, new_path); if (ni) { errno = EEXIST; goto cleanup; } dir = strdup(new_path); if (!dir) { errno = ENOMEM; err = -1; goto cleanup; } char * ptr = strrchr(dir, '/'); if (ptr) { name = strdup(ptr+1); *ptr = 0; } else name = strdup(dir); // Find the entry ni = ext2OpenEntry(vd, old_path); if (!ni) { err = -1; goto cleanup; } // Open the entries new parent directory dir_ni = ext2OpenEntry(vd, dir); if (!dir_ni) { err = -1; goto cleanup; } do { // Link the entry to its new parent err = ext2fs_link(vd->fs, dir_ni->ino, name, ni->ino, ext2_file_type(ni->ni.i_mode)); if (err == EXT2_ET_DIR_NO_SPACE) { if (ext2fs_expand_dir(vd->fs, dir_ni->ino) != 0) goto cleanup; } else if(err != EXT2_ET_OK) { errno = EMLINK; goto cleanup; } } while(err == EXT2_ET_DIR_NO_SPACE); ni->ni.i_links_count++; // Update entry times ext2UpdateTimes(vd, ni, EXT2_UPDATE_MCTIME); // Sync the entry to disc ext2Sync(vd, ni); cleanup: if(dir_ni) ext2CloseEntry(vd, dir_ni); if(ni) ext2CloseEntry(vd, ni); if(dir) mem_free(dir); if(name) mem_free(name); // Unlock ext2Unlock(vd); return err; } typedef struct _rd_struct { ext2_ino_t parent; int empty; } rd_struct; static int release_blocks_proc(ext2_filsys fs, blk_t *blocknr, int blockcnt EXT2FS_ATTR((unused)), void *private EXT2FS_ATTR((unused))) { blk_t block; block = *blocknr; ext2fs_block_alloc_stats(fs, block, -1); *blocknr = 0; return 0; } static int unlink_proc(ext2_ino_t dir EXT2FS_ATTR((unused)), int entry EXT2FS_ATTR((unused)), struct ext2_dir_entry *dirent, int offset EXT2FS_ATTR((unused)), int blocksize EXT2FS_ATTR((unused)), char *buf EXT2FS_ATTR((unused)), void *private_data) { rd_struct *rds = (rd_struct *) private_data; if (dirent->inode == 0) return 0; if (((dirent->name_len & 0xFF) == 1) && (dirent->name[0] == '.')) return 0; if (((dirent->name_len & 0xFF) == 2) && (dirent->name[0] == '.') && (dirent->name[1] == '.')) { rds->parent = dirent->inode; return 0; } rds->empty = 0; return 0; } int ext2Unlink (ext2_vd *vd, const char *path) { ext2_inode_t *dir_ni = NULL, *ni = NULL; char *dir = NULL; char *name = NULL; errcode_t err = -1; // Sanity check if (!vd || !vd->fs) { errno = ENODEV; return -1; } if(!(vd->fs->flags & EXT2_FLAG_RW)) return -1; // Get the actual path of the entry path = ext2RealPath(path); if (!path) return -1; // Lock ext2Lock(vd); dir = strdup(path); if (!dir) { errno = EINVAL; goto cleanup; } char * ptr = strrchr(dir, '/'); if (ptr) { name = strdup(ptr+1); *ptr = 0; } else name = dir; // Find the entry ni = ext2OpenEntry(vd, path); if (!ni) goto cleanup; // Open the entries parent directory dir_ni = ext2OpenEntry(vd, dir); if (!dir_ni) goto cleanup; // Directory if(LINUX_S_ISDIR(ni->ni.i_mode)) { rd_struct rds; rds.parent = 0; rds.empty = 1; if (ext2fs_dir_iterate2(vd->fs, ni->ino, 0, 0, unlink_proc, &rds) != 0) goto cleanup; if(!rds.empty) goto cleanup; if (rds.parent) { struct ext2_inode inode; if (ext2fs_read_inode(vd->fs, rds.parent, &inode) == 0) { if(inode.i_links_count > 1) inode.i_links_count--; ext2fs_write_inode(vd->fs, rds.parent, &inode); } } // set link count 0 ni->ni.i_links_count = 0; } // File else { ni->ni.i_links_count--; } if(ni->ni.i_links_count <= 0) { ni->ni.i_size = 0; ni->ni.i_size_high = 0; ni->ni.i_links_count = 0; ni->ni.i_dtime = (u32) time(0); } ext2fs_write_inode(vd->fs, ni->ino, &ni->ni); // Unlink the entry from its parent if(ext2fs_unlink(vd->fs, dir_ni->ino, name, 0, 0) != 0) goto cleanup; if (ext2fs_inode_has_valid_blocks(&ni->ni)) { ext2fs_block_iterate(vd->fs, ni->ino, 0, NULL, release_blocks_proc, NULL); ext2fs_inode_alloc_stats2(vd->fs, ni->ino, -1, LINUX_S_ISDIR(ni->ni.i_mode)); } if(ni->ni.i_links_count == 0) { // It's odd that i have to do this on my own and the lib is not doing that for me blk64_t truncate_block = ((vd->fs->blocksize - 1) >> EXT2_BLOCK_SIZE_BITS(vd->fs->super)) + 1; ext2fs_punch(vd->fs, ni->ino, &ni->ni, 0, truncate_block, ~0ULL); } // Sync the entry to disc ext2Sync(vd, NULL); err = 0; cleanup: if(dir_ni) ext2CloseEntry(vd, dir_ni); if(ni) ext2CloseEntry(vd, ni); if(name) mem_free(name); if(dir) mem_free(dir); // Unlock ext2Unlock(vd); return err; } int ext2Sync(ext2_vd *vd, ext2_inode_t *ni) { errcode_t res = 0; // Sanity check if (!vd || !vd->fs) { errno = ENODEV; return -1; } if(!(vd->fs->flags & EXT2_FLAG_RW)) return -1; // Lock ext2Lock(vd); if(ni && ni->dirty) { ext2fs_write_inode(vd->fs, ni->ino, &ni->ni); ni->dirty = false; } // Sync the entry res = ext2fs_flush(vd->fs); // Force the underlying device to sync vd->io->manager->flush(vd->io); // Unlock ext2Unlock(vd); return res; } int ext2Stat (ext2_vd *vd, ext2_inode_t *ni_main, struct stat *st) { int res = 0; // Sanity check if (!vd) { errno = ENODEV; return -1; } struct ext2_inode * ni = ni_main ? &ni_main->ni : 0; // Sanity check if (!ni) { errno = EINVAL; return -1; } // Short circuit cases were we don't actually have to do anything if (!st) return 0; // Lock ext2Lock(vd); // Zero out the stat buffer memset(st, 0, sizeof(struct stat)); if(LINUX_S_ISDIR(ni->i_mode)) { st->st_nlink = 1; st->st_size = ni->i_size; } else { st->st_nlink = ni->i_links_count; st->st_size = EXT2_I_SIZE(ni); } st->st_mode = ni->i_mode; st->st_blocks = ni->i_blocks; st->st_blksize = vd->fs->blocksize; // Fill in the generic entry stats st->st_dev = (dev_t) ((long) vd->fs); st->st_uid = ni->i_uid | (((u32) ni->osd2.linux2.l_i_uid_high) << 16); st->st_gid = ni->i_gid | (((u32) ni->osd2.linux2.l_i_gid_high) << 16); st->st_ino = ni_main->ino; st->st_atime = ni->i_atime; st->st_ctime = ni->i_ctime; st->st_mtime = ni->i_mtime; // Update entry times ext2UpdateTimes(vd, ni_main, EXT2_UPDATE_ATIME); // Unlock ext2Unlock(vd); return res; } void ext2UpdateTimes(ext2_vd *vd, ext2_inode_t *ni, ext2_time_update_flags mask) { // Sanity check if(!ni || !mask) return; if(!(vd->fs->flags & EXT2_FLAG_RW)) return; u32 now = (u32) time(0); if(mask & EXT2_UPDATE_ATIME) ni->ni.i_atime = now; if(mask & EXT2_UPDATE_MTIME) ni->ni.i_mtime = now; if(mask & EXT2_UPDATE_CTIME) ni->ni.i_ctime = now; ni->dirty = true; } const char *ext2RealPath (const char *path) { // Sanity check if (!path) { errno = EINVAL; return NULL; } // Move the path pointer to the start of the actual path if (strchr(path, ':') != NULL) { path = strchr(path, ':')+1; } if (strchr(path, ':') != NULL) { errno = EINVAL; return NULL; } return path; }
Estwald/libntfs_ext
source/libext2fs/ext2_internal.c
C
gpl-2.0
24,453
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head > <title> GhostWriter Unit Test: Synchronized Script Execution </title> <style type="text/css" > .yui3-skin-sam #log .yui3-separate-console {position:static; } </style> <script charset="utf-8" src="http://yui.yahooapis.com/3.1.1/build/yui/yui-min.js"></script> <!-- <script src="../../src/ghostwriter.js" ></script> <script src="../../src/loadhandlers.js" ></script> <script src="../../src/domtree.js" ></script> <script src="../../src/domelement.js" ></script> <script src="../../src/htmlstreamparser.js" ></script> <script src="../../src/scriptloader.js" ></script> <script src="../../src/capabilities.js" ></script> --> <script src="../../lib/gw.min.js" ></script> </head> <body class="yui3-skin-sam"> <h1> GhostWriter Unit Test: Parallel Loading</h1> <div id=test-1></div> <script type=text/deferscript> document.write( new Date() ) </script> <div style="margin: 3.0em"> <div id=p3-c></div> </div> <div style="position: " id="log"></div> <script src=t0.js></script> <script> YUI({ logInclude: { TestRunner: true } }) .use("console", "test", tester); function tester(Y){ window.Y= Y; var yc= new Y.Console({ newestOnTop: false, width: "95%", height: "600px" }) ; yc.render("#log"); test(); } </script> </body> </html>
SuriyaaKudoIsc/wikia-app-test
extensions/wikia/AdEngine/ghost/gw-12.4.4/t/synchronous-exec/index.html
HTML
gpl-2.0
1,375
# # Makefile for the kernel character device drivers. # # # This file contains the font map for the default (hardware) font # FONTMAPFILE = cp437.uni obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o tty_buffer.o tty_port.o davinci_vdce_driver-objs := davinci_vdce_hw.o davinci_vdce.o obj-$(CONFIG_VDCE) += davinci_vdce_driver.o obj-$(CONFIG_CIR) += cir.o obj-$(CONFIG_LEGACY_PTYS) += pty.o obj-$(CONFIG_UNIX98_PTYS) += pty.o obj-y += misc.o obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o selection.o keyboard.o obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o obj-$(CONFIG_CONSOLE_TRANSLATIONS) += consolemap.o consolemap_deftbl.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o obj-$(CONFIG_AUDIT) += tty_audit.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ESPSERIAL) += esp.o obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_ROCKETPORT) += rocket.o obj-$(CONFIG_SERIAL167) += serial167.o obj-$(CONFIG_CYCLADES) += cyclades.o obj-$(CONFIG_STALLION) += stallion.o obj-$(CONFIG_ISTALLION) += istallion.o obj-$(CONFIG_NOZOMI) += nozomi.o obj-$(CONFIG_DIGIEPCA) += epca.o obj-$(CONFIG_SPECIALIX) += specialix.o obj-$(CONFIG_MOXA_INTELLIO) += moxa.o obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o obj-$(CONFIG_MOXA_SMARTIO) += mxser.o obj-$(CONFIG_COMPUTONE) += ip2/ obj-$(CONFIG_RISCOM8) += riscom8.o obj-$(CONFIG_ISI) += isicom.o obj-$(CONFIG_SYNCLINK) += synclink.o obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o obj-$(CONFIG_N_HDLC) += n_hdlc.o obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o obj-$(CONFIG_SX) += sx.o generic_serial.o obj-$(CONFIG_RIO) += rio/ generic_serial.o obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o obj-$(CONFIG_HVC_ISERIES) += hvc_iseries.o obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o obj-$(CONFIG_HVC_BEAT) += hvc_beat.o obj-$(CONFIG_HVC_DRIVER) += hvc_console.o obj-$(CONFIG_HVC_IRQ) += hvc_irq.o obj-$(CONFIG_HVC_XEN) += hvc_xen.o obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o obj-$(CONFIG_RAW_DRIVER) += raw.o obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o obj-$(CONFIG_MSPEC) += mspec.o obj-$(CONFIG_MMTIMER) += mmtimer.o obj-$(CONFIG_UV_MMTIMER) += uv_mmtimer.o obj-$(CONFIG_VIOTAPE) += viotape.o obj-$(CONFIG_HVCS) += hvcs.o obj-$(CONFIG_IBM_BSR) += bsr.o obj-$(CONFIG_SGI_MBCS) += mbcs.o obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o obj-$(CONFIG_BFIN_OTP) += bfin-otp.o obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_APM_EMULATION) += apm-emulation.o obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_R3964) += n_r3964.o obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_SONYPI) += sonypi.o obj-$(CONFIG_RTC) += rtc.o obj-$(CONFIG_HPET) += hpet.o obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_DS1302) += ds1302.o obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap/ ifeq ($(CONFIG_GENERIC_NVRAM),y) obj-$(CONFIG_NVRAM) += generic_nvram.o else obj-$(CONFIG_NVRAM) += nvram.o endif obj-$(CONFIG_TOSHIBA) += toshiba.o obj-$(CONFIG_I8K) += i8k.o obj-$(CONFIG_DS1620) += ds1620.o obj-$(CONFIG_HW_RANDOM) += hw_random/ obj-$(CONFIG_PPDEV) += ppdev.o obj-$(CONFIG_NWBUTTON) += nwbutton.o obj-$(CONFIG_NWFLASH) += nwflash.o obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o obj-$(CONFIG_CS5535_GPIO) += cs5535_gpio.o obj-$(CONFIG_GPIO_TB0219) += tb0219.o obj-$(CONFIG_TELCLOCK) += tlclk.o obj-$(CONFIG_MWAVE) += mwave/ obj-$(CONFIG_AGP) += agp/ obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_IPMI_HANDLER) += ipmi/ obj-$(CONFIG_DM646x_PCI_TARGET_DRV) += dm646x_pci_targetdrv.o obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o obj-$(CONFIG_TCG_TPM) += tpm/ obj-$(CONFIG_PS3_FLASH) += ps3flash.o obj-$(CONFIG_JS_RTC) += js-rtc.o js-rtc-y = rtc.o obj-$(CONFIG_ARCH_DAVINCI_DM644x) += dm6446_imp.o davinci_rsz_driver-objs := davinci_resizer_hw.o davinci_resizer.o obj-$(CONFIG_RESIZER) += davinci_rsz_driver.o dm355_imp-objs := dm355_ipipe.o dm355_def_para.o \ dm355_ipipe_hw.o obj-$(CONFIG_DM355_IPIPE) += dm355_imp.o dm365_imp-objs := dm365_ipipe.o dm365_def_para.o \ dm365_ipipe_hw.o dm3xx_ipipe.o obj-$(CONFIG_DM365_IPIPE) += dm365_imp.o imp_prev_driver-objs := imp_previewer.o imp_rsz_driver-objs := imp_resizer.o obj-$(CONFIG_DM355_IPIPE) += imp_common.o obj-$(CONFIG_DM365_IPIPE) += imp_common.o obj-$(CONFIG_IMP_PREVIEWER) += imp_prev_driver.o obj-$(CONFIG_IMP_RESIZER) += imp_rsz_driver.o # Files generated that shall be removed upon make clean clean-files := consolemap_deftbl.c defkeymap.c quiet_cmd_conmk = CONMK $@ cmd_conmk = scripts/conmakehash $< > $@ $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(call cmd,conmk) $(obj)/defkeymap.o: $(obj)/defkeymap.c # Uncomment if you're changing the keymap and have an appropriate # loadkeys version for the map. By default, we'll use the shipped # versions. # GENERATE_KEYMAP := 1 ifdef GENERATE_KEYMAP $(obj)/defkeymap.c: $(obj)/%.c: $(src)/%.map loadkeys --mktable $< > [email protected] sed -e 's/^static *//' [email protected] > $@ rm [email protected] endif
merlinholland/kernel
drivers/char/Makefile
Makefile
gpl-2.0
5,319