code
stringlengths
4
1.01M
# Hello, World Tout framework digne de ce nom possède un exemple d'application "Hello World", alors ne dérogeons pas à la régle! On commencera donc par décrire un "hello word" très très basique puis on détaillera les principes MVC appliqués à l'exemple. ## Au commencement il n'y avait rien... La première chose à faire est de créer un controleur de telle sorte que Kohana puisse traiter une requête. Créér le fichier `application/classes/controller/hello.php` dans votre répertoire application et ajoutez-y le code suivant: <?php defined('SYSPATH') OR die('No Direct Script Access'); Class Controller_Hello extends Controller { function action_index() { echo 'hello, world!'; } } Voyons ce que signifient ces quelques lignes: `<?php defined('SYSPATH') OR die('No Direct Script Access');` : Vous devez sûrement reconnâitre le tag d'ouverture php (si ce n'est pas le cas alors il vous faut d'abord probablement vous [familiariser avec php](http://php.net)). Ce qui suit est un test permettant de s'assurer que le fichier est bien inclus par Kohana et lui seul. Cela permet d'interdire tout accès au fichier directement depuis une URL. `Class Controller_Hello extends Controller` : Cette ligne déclare notre controleur, chaque controleur doit être préfixé de `Controller_` et exprime un chemin vers le fichier ci-dessus où les répertoires sont séparés par des underscores (voir [Conventions et styles](about.conventions) pour plus d'informations). Chaque contrôleur doit hériter du controleur de base `Controller` qui fournit la structure standard de tout controleur. `function action_index()` : Cette ligne définit l'action "index" de notre controleur. Kohana essaiera d'appeler cette méthode si l'utilisateur n'en a spécifié aucune. (Voir [Routes, URLs et Liens](tutorials.urls)) `echo 'hello, world!';` : Enfin cette dernière ligne magique affichera sous vos yeux ébahis le message souhaité! Une fois le controleur créé, ouvrez voter navigateur préféré et rendez-vous à l'adresse `http://loaclhost/kohana/index.php/hello` et constatez le résultat: ![Hello, World!](img/hello_world_1.png "Hello, World!") ## C'était pas mal, mais on peut faire mieux Le chapitre précédent présente à quel point il est facile de créer une application extrêmement basique avec Kohana. Jusque-là tout va bien. Si vous avez déjà entendu parler du concept MVC alors vous vous disez sans doute qu'afficher du contenu dans un controleur va à l'encontre du principe MVC. La manière appropriée de coder avec un framework MVC est d'utiliser des _vues_ pour tout ce qui est lié à la présentation/forme de votre application et de laisser au controleur l'enchainement logique du traitement des requêtes. Changeons donc le controleur: <?php defined('SYSPATH') OR die('No Direct Script Access'); Class Controller_Hello extends Controller_Template { public $template = 'site'; function action_index() { $this->template->message = 'hello, world!'; } } `extends Controller_Template` : nous héritons désormais du controleur template qui rend plus facile l'utilisation de vues au sein d'un controleur. `public $template = 'site';` : le controleur template doit connaitre le template que vous souhaitez utiliser. Il chargera alors automatiquement la vue en question et lui assignera l'objet Vue créé. `$this->template->message = 'hello, world!';` : `$this->template` est une référence vers l'objet Vue du template de notre site. Ce que l'on fait ici est assigner à la vue la variable "message" dont la valeur est "hello, world!". Maintenant actualisez votre navigateur... <div>{{userguide/examples/hello_world_error}}</div> Kohana vous affiche une erreur au lieu du message fascinant qu'il devrait afficher. En regardant de plus près le message d'erreur on peut voir que la librairie View n'a pas été capable de trouver notre template, probablement parceque nous ne l'avons pas encore créé! Créons donc notre vue en créant le fichier `application/views/site.php` avec le texte suivant: <html> <head> <title>We've got a message for you!</title> <style type="text/css"> body {font-family: Georgia;} h1 {font-style: italic;} </style> </head> <body> <h1><?php echo $message; ?></h1> <p>We just wanted to say it! :)</p> </body> </html> Maintenant si vous ré-actualisez, vous devriez voir apparaitre ce qu'il faut: ![hello, world! We just wanted to say it!](img/hello_world_2.png "hello, world! We just wanted to say it!") ## A moi la gloire et l'argent! Dans ce tutorial on a abordé comment créer un controleur et utiliser une vue pour séparer la logique de la présentation. Evidemment l'exemple choisi est une introduction basique à Kohana et n'effleure même pas les possibilités infinies de Kohana ;).
<meta charset="UTF-8"> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <style> #test1 { --camelCase: blue; color: var(--camelCase); } #test2 { --Aå: 100px; width: var(--Aå); } #test3 { --colour: green; background: var(--colour); color: var(--color); } </style> <script> test(function() { var cssRules = document.styleSheets[0].cssRules; assert_equals(cssRules[0].cssText, "#test1 { --camelCase: blue; color: var(--camelCase); }"); assert_equals(cssRules[1].cssText, "#test2 { --Aå: 100px; width: var(--Aå); }"); assert_equals(cssRules[0].style.getPropertyValue("--camelCase"), " blue"); assert_equals(cssRules[0].style.getPropertyValue("color"), "var(--camelCase)"); assert_equals(cssRules[1].style.getPropertyValue("--Aå"), " 100px"); assert_equals(cssRules[1].style.getPropertyValue("width"), "var(--Aå)"); assert_equals(cssRules[2].style.getPropertyValue("background"), "var(--colour)"); assert_equals(cssRules[2].style.getPropertyValue("color"), "var(--color)"); }, "Custom properties serialization"); </script>
<!DOCTYPE HTML> <!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> <html><head> <meta charset="utf-8"> <title>Reference: Masonry layout with multiple `align-tracks` values</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <style> html,body { color:black; background-color:white; font:15px/1 "Courier New", monospace; padding:0; margin:0; } grid { display: inline-grid; grid-template-rows: auto; grid-template-columns: repeat(8,50px); /*intentionally one more than align-tracks values*/ gap: 3px 5px; padding: 10px 3px 1px 7px; border: solid; border-width: 1px 7px 3px 5px; background: lightgrey content-box; height: 500px; vertical-align: top; } .fallback { grid-template-columns:3px; padding:0; border:0; } item { background: grey; height: 2em; position: relative; border: 1px solid; } .purple { background:purple; height:auto; border-top:3px solid; } z { display: block; background: yellow; height: 0; width:80%; } a { position: absolute; inset: 0; top: auto; border: 2px solid lime; } masonry-track { display: grid; gap: 3px 5px; } masonry-track:nth-child(1) { align-content:start } masonry-track:nth-child(2) { align-content:end } masonry-track:nth-child(3) { align-content:center } masonry-track:nth-child(4) { align-content:stretch; grid-template-rows: auto auto repeat(3,max-content) } masonry-track:nth-child(5) { align-content:space-between } masonry-track:nth-child(6) { align-content:space-around } masonry-track:nth-child(7) { align-content:space-evenly } masonry-track:nth-child(8) { align-content:space-evenly } </style> </head> <body> <grid> <masonry-track> <item style="width:25px">1</item> <item>11</item> <item class="purple">20</item> <item class="purple">24</item> <item>29</item> </masonry-track> <masonry-track> <item class="purple" style="height:50px">2</item> <item class="purple" style="writing-mode:vertical-rl">16 vertical-rl</item> </masonry-track> <masonry-track> <item style="margin-left:5px">3</item> <item class="purple">12<z></z></item> <item>17</item> <item>25</item> <item>33</item> </masonry-track> <masonry-track> <item class="purple" style="margin-top:5px">4</item> <item class="purple">10</item> <item>15</item> <item>23</item> <item>31</item> </masonry-track> <masonry-track> <item>5</item> <item>13</item> <item>21</item> <item class="purple">28</item> </masonry-track> <masonry-track> <item class="purple">6<a></a></item> <item>9<a></a></item> <item class="purple">18</item> <item class="purple">22</item> <item>27</item> </masonry-track> <masonry-track> <item>7</item> <item class="purple">14<z></z><a></a></item> <item>19</item> <item class="purple">26</item> <item class="purple">30</item> </masonry-track> <masonry-track> <item class="purple" style="writing-mode:vertical-lr">8 vertical-lr</item> <item class="purple">32</item> </masonry-track> </grid> <grid class="fallback" style="align-content:start"> <item></item> </grid> <grid class="fallback" style="align-content:center"> <item></item> </grid> <grid class="fallback" style="align-content:center"> <item></item> </grid> </body></html>
<!doctype html> <meta charset="utf-8"> <title>Container Queries - Style Change Event for transitions</title> <link rel="help" href="https://drafts.csswg.org/css-transitions/#starting"> <link rel="help" href="https://drafts.csswg.org/css-contain-3/#animated-containers"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="support/cq-testcommon.js"></script> <style> .container { container-type: size } #outer { width: 100px; color: green; } @container (min-width: 200px) { #inner { color: red } } @container (min-width: 400px) { #target { color: green; transition: color 1s step-start; } } </style> <div id="outer" class="container"> <div id="inner" class="container"> <div id="target">Green</div> </div> </div> </div> <script> setup(() => assert_implements_container_queries()); const t = async_test(""); const event_handler = t.step_func_done((e) => { assert_unreached("Transition event incorrectly triggered: " + e.type); }); for (let event_name of ["transitionrun", "transitionstart", "transitionend", "transitioncancel"]) { target.addEventListener(event_name, event_handler); } outer.offsetTop; // #target is green. Making the #outer container 200px will turn #inner and // #target red through inheritance. outer.style.width = "200px"; // Making #inner 400px will make #target green. inner.style.width = "400px"; // Both changes above should happen in one style change event and should not // trigger any transition events. Run two rAFs to make sure any events have // time to trigger. requestAnimationFrame(() => requestAnimationFrame(t.step_func_done(() => { assert_equals(getComputedStyle(inner).color, "rgb(255, 0, 0)", "@container queries supported"); }))); </script>
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.content.browser; import android.content.Context; import android.util.Log; import android.util.SparseIntArray; import android.view.Surface; import java.util.ArrayList; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.chromium.base.CalledByNative; import org.chromium.base.JNINamespace; import org.chromium.base.SysUtils; import org.chromium.base.ThreadUtils; import org.chromium.content.app.ChildProcessService; import org.chromium.content.app.Linker; import org.chromium.content.app.LinkerParams; import org.chromium.content.app.PrivilegedProcessService; import org.chromium.content.app.SandboxedProcessService; import org.chromium.content.common.IChildProcessCallback; import org.chromium.content.common.IChildProcessService; /** * This class provides the method to start/stop ChildProcess called by native. */ @JNINamespace("content") public class ChildProcessLauncher { private static String TAG = "ChildProcessLauncher"; private static final int CALLBACK_FOR_UNKNOWN_PROCESS = 0; private static final int CALLBACK_FOR_GPU_PROCESS = 1; private static final int CALLBACK_FOR_RENDERER_PROCESS = 2; private static final String SWITCH_PROCESS_TYPE = "type"; private static final String SWITCH_PPAPI_BROKER_PROCESS = "ppapi-broker"; private static final String SWITCH_RENDERER_PROCESS = "renderer"; private static final String SWITCH_GPU_PROCESS = "gpu-process"; // The upper limit on the number of simultaneous sandboxed and privileged child service process // instances supported. Each limit must not exceed total number of SandboxedProcessServiceX // classes and PrivilegedProcessServiceX classes declared in this package and defined as // services in the embedding application's manifest file. // (See {@link ChildProcessService} for more details on defining the services.) /* package */ static final int MAX_REGISTERED_SANDBOXED_SERVICES = 13; /* package */ static final int MAX_REGISTERED_PRIVILEGED_SERVICES = 3; private static class ChildConnectionAllocator { // Connections to services. Indices of the array correspond to the service numbers. private ChildProcessConnection[] mChildProcessConnections; // The list of free (not bound) service indices. When looking for a free service, the first // index in that list should be used. When a service is unbound, its index is added to the // end of the list. This is so that we avoid immediately reusing the freed service (see // http://crbug.com/164069): the framework might keep a service process alive when it's been // unbound for a short time. If a new connection to the same service is bound at that point, // the process is reused and bad things happen (mostly static variables are set when we // don't expect them to). // SHOULD BE ACCESSED WITH mConnectionLock. private ArrayList<Integer> mFreeConnectionIndices; private final Object mConnectionLock = new Object(); private Class<? extends ChildProcessService> mChildClass; private final boolean mInSandbox; public ChildConnectionAllocator(boolean inSandbox) { int numChildServices = inSandbox ? MAX_REGISTERED_SANDBOXED_SERVICES : MAX_REGISTERED_PRIVILEGED_SERVICES; mChildProcessConnections = new ChildProcessConnection[numChildServices]; mFreeConnectionIndices = new ArrayList<Integer>(numChildServices); for (int i = 0; i < numChildServices; i++) { mFreeConnectionIndices.add(i); } setServiceClass(inSandbox ? SandboxedProcessService.class : PrivilegedProcessService.class); mInSandbox = inSandbox; } public void setServiceClass(Class<? extends ChildProcessService> childClass) { mChildClass = childClass; } public ChildProcessConnection allocate( Context context, ChildProcessConnection.DeathCallback deathCallback, LinkerParams linkerParams) { synchronized(mConnectionLock) { if (mFreeConnectionIndices.isEmpty()) { Log.w(TAG, "Ran out of service." ); return null; } int slot = mFreeConnectionIndices.remove(0); assert mChildProcessConnections[slot] == null; mChildProcessConnections[slot] = new ChildProcessConnection(context, slot, mInSandbox, deathCallback, mChildClass, linkerParams); return mChildProcessConnections[slot]; } } public void free(ChildProcessConnection connection) { synchronized(mConnectionLock) { int slot = connection.getServiceNumber(); if (mChildProcessConnections[slot] != connection) { int occupier = mChildProcessConnections[slot] == null ? -1 : mChildProcessConnections[slot].getServiceNumber(); Log.e(TAG, "Unable to find connection to free in slot: " + slot + " already occupied by service: " + occupier); assert false; } else { mChildProcessConnections[slot] = null; assert !mFreeConnectionIndices.contains(slot); mFreeConnectionIndices.add(slot); } } } } // Service class for child process. As the default value it uses SandboxedProcessService0 and // PrivilegedProcessService0. private static final ChildConnectionAllocator sSandboxedChildConnectionAllocator = new ChildConnectionAllocator(true); private static final ChildConnectionAllocator sPrivilegedChildConnectionAllocator = new ChildConnectionAllocator(false); private static boolean sConnectionAllocated = false; // Sets service class for sandboxed service and privileged service. public static void setChildProcessClass( Class<? extends SandboxedProcessService> sandboxedServiceClass, Class<? extends PrivilegedProcessService> privilegedServiceClass) { // We should guarantee this is called before allocating connection. assert !sConnectionAllocated; sSandboxedChildConnectionAllocator.setServiceClass(sandboxedServiceClass); sPrivilegedChildConnectionAllocator.setServiceClass(privilegedServiceClass); } private static ChildConnectionAllocator getConnectionAllocator(boolean inSandbox) { return inSandbox ? sSandboxedChildConnectionAllocator : sPrivilegedChildConnectionAllocator; } private static ChildProcessConnection allocateConnection(Context context, boolean inSandbox, LinkerParams linkerParams) { ChildProcessConnection.DeathCallback deathCallback = new ChildProcessConnection.DeathCallback() { @Override public void onChildProcessDied(int pid) { stop(pid); } }; sConnectionAllocated = true; return getConnectionAllocator(inSandbox).allocate(context, deathCallback, linkerParams); } private static boolean sLinkerInitialized = false; private static long sLinkerLoadAddress = 0; private static LinkerParams getLinkerParamsForNewConnection() { if (!sLinkerInitialized) { if (Linker.isUsed()) { sLinkerLoadAddress = Linker.getBaseLoadAddress(); if (sLinkerLoadAddress == 0) { Log.i(TAG, "Shared RELRO support disabled!"); } } sLinkerInitialized = true; } if (sLinkerLoadAddress == 0) return null; // Always wait for the shared RELROs in service processes. final boolean waitForSharedRelros = true; return new LinkerParams(sLinkerLoadAddress, waitForSharedRelros, Linker.getTestRunnerClassName()); } private static ChildProcessConnection allocateBoundConnection(Context context, String[] commandLine, boolean inSandbox) { LinkerParams linkerParams = getLinkerParamsForNewConnection(); ChildProcessConnection connection = allocateConnection(context, inSandbox, linkerParams); if (connection != null) { connection.start(commandLine); } return connection; } private static void freeConnection(ChildProcessConnection connection) { if (connection == null) { return; } getConnectionAllocator(connection.isInSandbox()).free(connection); return; } // Represents an invalid process handle; same as base/process/process.h kNullProcessHandle. private static final int NULL_PROCESS_HANDLE = 0; // Map from pid to ChildService connection. private static Map<Integer, ChildProcessConnection> sServiceMap = new ConcurrentHashMap<Integer, ChildProcessConnection>(); // A pre-allocated and pre-bound connection ready for connection setup, or null. private static ChildProcessConnection sSpareSandboxedConnection = null; /** * Manages oom bindings used to bound child services. "Oom binding" is a binding that raises the * process oom priority so that it shouldn't be killed by the OS out-of-memory killer under * normal conditions (it can still be killed under drastic memory pressure). * * This class serves a proxy between external calls that manipulate the bindings and the * connections, allowing to enforce policies such as delayed removal of the bindings. */ static class BindingManager { // Delay of 1 second used when removing the initial oom binding of a process. private static final long REMOVE_INITIAL_BINDING_DELAY_MILLIS = 1 * 1000; // Delay of 5 second used when removing temporary strong binding of a process (only on // non-low-memory devices). private static final long DETACH_AS_ACTIVE_HIGH_END_DELAY_MILLIS = 5 * 1000; // Map from pid to the count of oom bindings bound for the service. Should be accessed with // mCountLock. private final SparseIntArray mOomBindingCount = new SparseIntArray(); // Pid of the renderer that was most recently oom bound. This is used on low-memory devices // to drop oom bindings of a process when another one acquires them, making sure that only // one renderer process at a time is oom bound. Should be accessed with mCountLock. private int mLastOomPid = -1; // Should be acquired before binding or unbinding the connections and modifying state // variables: mOomBindingCount and mLastOomPid. private final Object mCountLock = new Object(); /** * Registers an oom binding bound for a child process. Should be called with mCountLock. * @param pid handle of the process. */ private void incrementOomCount(int pid) { mOomBindingCount.put(pid, mOomBindingCount.get(pid) + 1); mLastOomPid = pid; } /** * Registers an oom binding unbound for a child process. Should be called with mCountLock. * @param pid handle of the process. */ private void decrementOomCount(int pid) { int count = mOomBindingCount.get(pid, -1); assert count > 0; count--; if (count > 0) { mOomBindingCount.put(pid, count); } else { mOomBindingCount.delete(pid); } } /** * Drops all oom bindings for the given renderer. * @param pid handle of the process. */ private void dropOomBindings(int pid) { ChildProcessConnection connection = sServiceMap.get(pid); if (connection == null) { LogPidWarning(pid, "Tried to drop oom bindings for a non-existent connection"); return; } synchronized (mCountLock) { connection.dropOomBindings(); mOomBindingCount.delete(pid); } } /** * Registers a freshly started child process. On low-memory devices this will also drop the * oom bindings of the last process that was oom-bound. We can do that, because every time a * connection is created on the low-end, it is used in foreground (no prerendering, no * loading of tabs opened in background). * @param pid handle of the process. */ void addNewConnection(int pid) { synchronized (mCountLock) { if (SysUtils.isLowEndDevice() && mLastOomPid >= 0) { dropOomBindings(mLastOomPid); } // This will reset the previous entry for the pid in the unlikely event of the OS // reusing renderer pids. mOomBindingCount.put(pid, 0); // Every new connection is bound with initial oom binding. incrementOomCount(pid); } } /** * Remove the initial binding of the child process. Child processes are bound with initial * binding to protect them from getting killed before they are put to use. This method * allows to remove the binding once it is no longer needed. The binding is removed after a * fixed delay period so that the renderer will not be killed immediately after the call. */ void removeInitialBinding(final int pid) { final ChildProcessConnection connection = sServiceMap.get(pid); if (connection == null) { LogPidWarning(pid, "Tried to remove a binding for a non-existent connection"); return; } if (!connection.isInitialBindingBound()) return; ThreadUtils.postOnUiThreadDelayed(new Runnable() { @Override public void run() { synchronized (mCountLock) { if (connection.isInitialBindingBound()) { decrementOomCount(pid); connection.removeInitialBinding(); } } } }, REMOVE_INITIAL_BINDING_DELAY_MILLIS); } /** * Bind a child process as a high priority process so that it has the same priority as the * main process. This can be used for the foreground renderer process to distinguish it from * the background renderer process. * @param pid The process handle of the service connection. */ void bindAsHighPriority(final int pid) { ChildProcessConnection connection = sServiceMap.get(pid); if (connection == null) { LogPidWarning(pid, "Tried to bind a non-existent connection"); return; } synchronized (mCountLock) { connection.attachAsActive(); incrementOomCount(pid); } } /** * Unbind a high priority process which was previous bound with bindAsHighPriority. * @param pid The process handle of the service. */ void unbindAsHighPriority(final int pid) { final ChildProcessConnection connection = sServiceMap.get(pid); if (connection == null) { LogPidWarning(pid, "Tried to unbind non-existent connection"); return; } if (!connection.isStrongBindingBound()) return; // This runnable performs the actual unbinding. It will be executed synchronously when // on low-end devices and posted with a delay otherwise. Runnable doUnbind = new Runnable() { @Override public void run() { synchronized (mCountLock) { if (connection.isStrongBindingBound()) { decrementOomCount(pid); connection.detachAsActive(); } } } }; if (SysUtils.isLowEndDevice()) { doUnbind.run(); } else { ThreadUtils.postOnUiThreadDelayed(doUnbind, DETACH_AS_ACTIVE_HIGH_END_DELAY_MILLIS); } } /** * @return True iff the given service process is protected from the out-of-memory killing, * or it was protected when it died (either crashed or was closed). This can be used to * decide if a disconnection of a renderer was a crash or a probable out-of-memory kill. In * the unlikely event of the OS reusing renderer pid, the call will refer to the most recent * renderer of the given pid. The binding count is being reset in addNewConnection(). */ boolean isOomProtected(int pid) { synchronized (mCountLock) { return mOomBindingCount.get(pid) > 0; } } } private static BindingManager sBindingManager = new BindingManager(); static BindingManager getBindingManager() { return sBindingManager; } @CalledByNative private static boolean isOomProtected(int pid) { return sBindingManager.isOomProtected(pid); } /** * Returns the child process service interface for the given pid. This may be called on * any thread, but the caller must assume that the service can disconnect at any time. All * service calls should catch and handle android.os.RemoteException. * * @param pid The pid (process handle) of the service obtained from {@link #start}. * @return The IChildProcessService or null if the service no longer exists. */ public static IChildProcessService getChildService(int pid) { ChildProcessConnection connection = sServiceMap.get(pid); if (connection != null) { return connection.getService(); } return null; } /** * Should be called early in startup so the work needed to spawn the child process can be done * in parallel to other startup work. Must not be called on the UI thread. Spare connection is * created in sandboxed child process. * @param context the application context used for the connection. */ public static void warmUp(Context context) { synchronized (ChildProcessLauncher.class) { assert !ThreadUtils.runningOnUiThread(); if (sSpareSandboxedConnection == null) { sSpareSandboxedConnection = allocateBoundConnection(context, null, true); } } } private static String getSwitchValue(final String[] commandLine, String switchKey) { if (commandLine == null || switchKey == null) { return null; } // This format should be matched with the one defined in command_line.h. final String switchKeyPrefix = "--" + switchKey + "="; for (String command : commandLine) { if (command != null && command.startsWith(switchKeyPrefix)) { return command.substring(switchKeyPrefix.length()); } } return null; } /** * Spawns and connects to a child process. May be called on any thread. It will not block, but * will instead callback to {@link #nativeOnChildProcessStarted} when the connection is * established. Note this callback will not necessarily be from the same thread (currently it * always comes from the main thread). * * @param context Context used to obtain the application context. * @param commandLine The child process command line argv. * @param file_ids The ID that should be used when mapping files in the created process. * @param file_fds The file descriptors that should be mapped in the created process. * @param file_auto_close Whether the file descriptors should be closed once they were passed to * the created process. * @param clientContext Arbitrary parameter used by the client to distinguish this connection. */ @CalledByNative static void start( Context context, final String[] commandLine, int[] fileIds, int[] fileFds, boolean[] fileAutoClose, final int clientContext) { assert fileIds.length == fileFds.length && fileFds.length == fileAutoClose.length; FileDescriptorInfo[] filesToBeMapped = new FileDescriptorInfo[fileFds.length]; for (int i = 0; i < fileFds.length; i++) { filesToBeMapped[i] = new FileDescriptorInfo(fileIds[i], fileFds[i], fileAutoClose[i]); } assert clientContext != 0; int callbackType = CALLBACK_FOR_UNKNOWN_PROCESS; boolean inSandbox = true; String processType = getSwitchValue(commandLine, SWITCH_PROCESS_TYPE); if (SWITCH_RENDERER_PROCESS.equals(processType)) { callbackType = CALLBACK_FOR_RENDERER_PROCESS; } else if (SWITCH_GPU_PROCESS.equals(processType)) { callbackType = CALLBACK_FOR_GPU_PROCESS; } else if (SWITCH_PPAPI_BROKER_PROCESS.equals(processType)) { inSandbox = false; } ChildProcessConnection allocatedConnection = null; synchronized (ChildProcessLauncher.class) { if (inSandbox) { allocatedConnection = sSpareSandboxedConnection; sSpareSandboxedConnection = null; } } if (allocatedConnection == null) { allocatedConnection = allocateBoundConnection(context, commandLine, inSandbox); if (allocatedConnection == null) { // Notify the native code so it can free the heap allocated callback. nativeOnChildProcessStarted(clientContext, 0); return; } } final ChildProcessConnection connection = allocatedConnection; Log.d(TAG, "Setting up connection to process: slot=" + connection.getServiceNumber()); ChildProcessConnection.ConnectionCallback connectionCallback = new ChildProcessConnection.ConnectionCallback() { public void onConnected(int pid) { Log.d(TAG, "on connect callback, pid=" + pid + " context=" + clientContext); if (pid != NULL_PROCESS_HANDLE) { sBindingManager.addNewConnection(pid); sServiceMap.put(pid, connection); } else { freeConnection(connection); } nativeOnChildProcessStarted(clientContext, pid); } }; // TODO(sievers): Revisit this as it doesn't correctly handle the utility process // assert callbackType != CALLBACK_FOR_UNKNOWN_PROCESS; connection.setupConnection(commandLine, filesToBeMapped, createCallback(callbackType), connectionCallback, Linker.getSharedRelros()); } /** * Terminates a child process. This may be called from any thread. * * @param pid The pid (process handle) of the service connection obtained from {@link #start}. */ @CalledByNative static void stop(int pid) { Log.d(TAG, "stopping child connection: pid=" + pid); ChildProcessConnection connection = sServiceMap.remove(pid); if (connection == null) { LogPidWarning(pid, "Tried to stop non-existent connection"); return; } connection.stop(); freeConnection(connection); } /** * This implementation is used to receive callbacks from the remote service. */ private static IChildProcessCallback createCallback(final int callbackType) { return new IChildProcessCallback.Stub() { /** * This is called by the remote service regularly to tell us about new values. Note that * IPC calls are dispatched through a thread pool running in each process, so the code * executing here will NOT be running in our main thread -- so, to update the UI, we * need to use a Handler. */ @Override public void establishSurfacePeer( int pid, Surface surface, int primaryID, int secondaryID) { // Do not allow a malicious renderer to connect to a producer. This is only used // from stream textures managed by the GPU process. if (callbackType != CALLBACK_FOR_GPU_PROCESS) { Log.e(TAG, "Illegal callback for non-GPU process."); return; } nativeEstablishSurfacePeer(pid, surface, primaryID, secondaryID); } @Override public Surface getViewSurface(int surfaceId) { // Do not allow a malicious renderer to get to our view surface. if (callbackType != CALLBACK_FOR_GPU_PROCESS) { Log.e(TAG, "Illegal callback for non-GPU process."); return null; } return nativeGetViewSurface(surfaceId); } }; }; private static void LogPidWarning(int pid, String message) { // This class is effectively a no-op in single process mode, so don't log warnings there. if (pid > 0 && !nativeIsSingleProcess()) { Log.w(TAG, message + ", pid=" + pid); } } private static native void nativeOnChildProcessStarted(int clientContext, int pid); private static native Surface nativeGetViewSurface(int surfaceId); private static native void nativeEstablishSurfacePeer( int pid, Surface surface, int primaryID, int secondaryID); private static native boolean nativeIsSingleProcess(); }
class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Get FileServers', # list of one or more authors for the module 'Author': ['@424f424f'], # more verbose multi-line description of the module 'Description': 'This module will list file servers', # True if the module needs to run in the background 'Background' : False, # File extension to save the file as 'OutputExtension' : "", # if the module needs administrative privileges 'NeedsAdmin' : False, # True if the method doesn't touch disk/is reasonably opsec safe 'OpsecSafe' : True, # the module language 'Language' : 'python', # the minimum language version needed 'MinLanguageVersion' : '2.6', # list of any references/other comments 'Comments': [''] } # any options needed by the module, settable during runtime self.options = { # format: # value_name : {description, required, default_value} 'Agent' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : 'Agent to run on.', 'Required' : True, 'Value' : '' }, 'LDAPAddress' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : 'LDAP IP/Hostname', 'Required' : True, 'Value' : '' }, 'BindDN' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : 'user@penlab.local', 'Required' : True, 'Value' : '' }, 'Password' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : 'Password to connect to LDAP', 'Required' : False, 'Value' : '' } } # save off a copy of the mainMenu object to access external functionality # like listeners/agent handlers/etc. self.mainMenu = mainMenu # During instantiation, any settable option parameters # are passed as an object set to the module and the # options dictionary is automatically set. This is mostly # in case options are passed on the command line if params: for param in params: # parameter format is [Name, Value] option, value = param if option in self.options: self.options[option]['Value'] = value def generate(self, obfuscate=False, obfuscationCommand=""): LDAPAddress = self.options['LDAPAddress']['Value'] BindDN = self.options['BindDN']['Value'] password = self.options['Password']['Value'] # the Python script itself, with the command to invoke # for execution appended to the end. Scripts should output # everything to the pipeline for proper parsing. # # the script should be stripped of comments, with a link to any # original reference script included in the comments. script = """ import sys, os, subprocess, re BindDN = "%s" LDAPAddress = "%s" password = "%s" regex = re.compile('.+@([^.]+)\..+') global tld match = re.match(regex, BindDN) tld = match.group(1) global ext ext = BindDN.split('.')[1] cmd = \"""ldapsearch -x -h {} -b "dc={},dc={}" -D {} -w {} "(&(samAccountType=805306368))" ""\".format(LDAPAddress, tld, ext, BindDN, password) output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, bufsize=1) with output.stdout: print "" for line in iter(output.stdout.readline, b''): if ("homeDirectory" or "scriptPath" or "profilePath") in line: print "Results:" print "" m = re.search(r'([^\]*)', line) if m: print m.group(1) output.wait() print "" """ % (BindDN, LDAPAddress, password) return script
// ========================================================================== // SeqAn - The Library for Sequence Analysis // ========================================================================== // Copyright (c) 2006-2015, Knut Reinert, FU Berlin // 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 Knut Reinert or the FU Berlin 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 KNUT REINERT OR THE FU BERLIN BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. // // ========================================================================== #include <iostream> #include <sstream> #include <seqan/index.h> #include <seqan/stream.h> SEQAN_DEFINE_TEST(test_index_drawing_esa_dot) { seqan::CharString myString = "banana"; seqan::Index<seqan::CharString> stree(myString); std::stringstream sstream; writeRecords(sstream, stree, seqan::DotDrawing()); std::stringstream expected; expected << "digraph G {\n" << "\n" << "/* Graph Attributes */\n" << "graph [rankdir = LR];\n" << "\n" << "/* Node Attributes */\n" << "node [shape = ellipse, fillcolor = lightgrey, style = filled, fontname = \"Times-Italic\"];\n" << "\n" << "/* Edge Attributes */\n" << "edge [fontname = \"Times-Italic\", arrowsize = 0.75, fontsize = 16];\n" << "\n" << "/* Edges */\n" << "\"[0:6)\" [style = dashed];\n" << "\"[0:3)\";\n" << "\"[0:6)\" -> \"[0:3)\" [label = \"a\"];\n" << "\"[1:3)\";\n" << "\"[0:3)\" -> \"[1:3)\" [label = \"na\"];\n" << "\"[2:3)\";\n" << "\"[1:3)\" -> \"[2:3)\" [label = \"na\"];\n" << "\"[3:4)\";\n" << "\"[0:6)\" -> \"[3:4)\" [label = \"banana\"];\n" << "\"[4:6)\";\n" << "\"[0:6)\" -> \"[4:6)\" [label = \"na\"];\n" << "\"[5:6)\";\n" << "\"[4:6)\" -> \"[5:6)\" [label = \"na\"];\n" << "\n" << "}\n"; SEQAN_ASSERT_EQ(expected.str(), sstream.str()); } SEQAN_BEGIN_TESTSUITE(test_index_drawing) { SEQAN_CALL_TEST(test_index_drawing_esa_dot); } SEQAN_END_TESTSUITE
#!/bin/bash # fix automake sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/aclocal sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/automake # fix autoconf sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/autom4te sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/autoheader sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/autoreconf sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/ifnames sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/autoscan sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' $PREFIX/bin/autoupdate export CFLAGS="-I$PREFIX/include" export LDFLAGS="-L$PREFIX/lib" export CPATH=${PREFIX}/include mkdir -p $PREFIX/bin autoreconf -i -f ./configure --prefix=$PREFIX make make install
using System; using System.Configuration; using System.DirectoryServices.AccountManagement; using System.Threading.Tasks; using Umbraco.Core.Models.Identity; namespace Umbraco.Core.Security { public class ActiveDirectoryBackOfficeUserPasswordChecker : IBackOfficeUserPasswordChecker { public virtual string ActiveDirectoryDomain { get { return ConfigurationManager.AppSettings["ActiveDirectoryDomain"]; } } public Task<BackOfficeUserPasswordCheckerResult> CheckPasswordAsync(BackOfficeIdentityUser user, string password) { bool isValid; using (var pc = new PrincipalContext(ContextType.Domain, ActiveDirectoryDomain)) { isValid = pc.ValidateCredentials(user.UserName, password); } if (isValid && user.HasIdentity == false) { //TODO: the user will need to be created locally (i.e. auto-linked) throw new NotImplementedException("The user " + user.UserName + " does not exist locally and currently the " + typeof(ActiveDirectoryBackOfficeUserPasswordChecker) + " doesn't support auto-linking, see http://issues.umbraco.org/issue/U4-10181"); } var result = isValid ? BackOfficeUserPasswordCheckerResult.ValidCredentials : BackOfficeUserPasswordCheckerResult.InvalidCredentials; return Task.FromResult(result); } } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; using Umbraco.Core.Models; using Umbraco.Core.Models.Validation; using Umbraco.Web.WebApi; namespace Umbraco.Web.Models.ContentEditing { /// <summary> /// A model representing a basic content item /// </summary> [DataContract(Name = "content", Namespace = "")] public class ContentItemBasic : EntityBasic { [DataMember(Name = "updateDate")] public DateTime UpdateDate { get; set; } [DataMember(Name = "createDate")] public DateTime CreateDate { get; set; } [DataMember(Name = "published")] public bool Published { get; set; } [DataMember(Name = "hasPublishedVersion")] public bool HasPublishedVersion { get; set; } [DataMember(Name = "owner")] public UserProfile Owner { get; set; } [DataMember(Name = "updater")] public UserProfile Updater { get; set; } [DataMember(Name = "contentTypeAlias", IsRequired = true)] [Required(AllowEmptyStrings = false)] public string ContentTypeAlias { get; set; } [DataMember(Name = "sortOrder")] public int SortOrder { get; set; } protected bool Equals(ContentItemBasic other) { return Id == other.Id; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; var other = obj as ContentItemBasic; return other != null && Equals(other); } public override int GetHashCode() { return Id.GetHashCode(); } } /// <summary> /// A model representing a basic content item with properties /// </summary> [DataContract(Name = "content", Namespace = "")] public class ContentItemBasic<T, TPersisted> : ContentItemBasic where T : ContentPropertyBasic where TPersisted : IContentBase { public ContentItemBasic() { //ensure its not null _properties = new List<T>(); } private IEnumerable<T> _properties; [DataMember(Name = "properties")] public virtual IEnumerable<T> Properties { get { return _properties; } set { _properties = value; } } /// <summary> /// The real persisted content object - used during inbound model binding /// </summary> /// <remarks> /// This is not used for outgoing model information. /// </remarks> [IgnoreDataMember] internal TPersisted PersistedContent { get; set; } /// <summary> /// The DTO object used to gather all required content data including data type information etc... for use with validation - used during inbound model binding /// </summary> /// <remarks> /// We basically use this object to hydrate all required data from the database into one object so we can validate everything we need /// instead of having to look up all the data individually. /// This is not used for outgoing model information. /// </remarks> [IgnoreDataMember] internal ContentItemDto<TPersisted> ContentDto { get; set; } } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="robots" content="index, follow, all" /> <title>Index | Imagine API</title> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body id="overview"> <div class="header"> <ul> <li><a href="classes.html">Classes</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="interfaces.html">Interfaces</a></li> <li><a href="doc-index.html">Index</a></li> </ul> <div id="title">Imagine API</div> <div class="type">Index</div> <a href="#letterA">A</a> <a href="#letterB">B</a> <a href="#letterC">C</a> <a href="#letterD">D</a> <a href="#letterE">E</a> <a href="#letterF">F</a> <a href="#letterG">G</a> <a href="#letterH">H</a> <a href="#letterI">I</a> J K <a href="#letterL">L</a> <a href="#letterM">M</a> <a href="#letterN">N</a> <a href="#letterO">O</a> <a href="#letterP">P</a> Q <a href="#letterR">R</a> <a href="#letterS">S</a> <a href="#letterT">T</a> U V <a href="#letterW">W</a> X Y Z </div> <div class="content"> <h2 id="letterA">A</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html#method_arc"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::arc</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Draws an arc on a starting at a given x, y coordinates under a given start and end angles</dd><dt><a href="Imagine/Filter/Advanced/Border.html#method_apply"><abbr title="Imagine\Filter\Advanced\Border">Border</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/Border.html"><abbr title="Imagine\Filter\Advanced\Border">Border</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Advanced/Canvas.html#method_apply"><abbr title="Imagine\Filter\Advanced\Canvas">Canvas</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/Canvas.html"><abbr title="Imagine\Filter\Advanced\Canvas">Canvas</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Advanced/OnPixelBased.html#method_apply"><abbr title="Imagine\Filter\Advanced\OnPixelBased">OnPixelBased</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/OnPixelBased.html"><abbr title="Imagine\Filter\Advanced\OnPixelBased">OnPixelBased</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/ApplyMask.html"><abbr title="Imagine\Filter\Basic\ApplyMask">ApplyMask</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/ApplyMask.html#method_apply"><abbr title="Imagine\Filter\Basic\ApplyMask">ApplyMask</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/ApplyMask.html"><abbr title="Imagine\Filter\Basic\ApplyMask">ApplyMask</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Copy.html#method_apply"><abbr title="Imagine\Filter\Basic\Copy">Copy</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Copy.html"><abbr title="Imagine\Filter\Basic\Copy">Copy</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Crop.html#method_apply"><abbr title="Imagine\Filter\Basic\Crop">Crop</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Crop.html"><abbr title="Imagine\Filter\Basic\Crop">Crop</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Fill.html#method_apply"><abbr title="Imagine\Filter\Basic\Fill">Fill</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Fill.html"><abbr title="Imagine\Filter\Basic\Fill">Fill</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/FlipHorizontally.html#method_apply"><abbr title="Imagine\Filter\Basic\FlipHorizontally">FlipHorizontally</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/FlipHorizontally.html"><abbr title="Imagine\Filter\Basic\FlipHorizontally">FlipHorizontally</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/FlipVertically.html#method_apply"><abbr title="Imagine\Filter\Basic\FlipVertically">FlipVertically</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/FlipVertically.html"><abbr title="Imagine\Filter\Basic\FlipVertically">FlipVertically</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Paste.html#method_apply"><abbr title="Imagine\Filter\Basic\Paste">Paste</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Paste.html"><abbr title="Imagine\Filter\Basic\Paste">Paste</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Resize.html#method_apply"><abbr title="Imagine\Filter\Basic\Resize">Resize</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Resize.html"><abbr title="Imagine\Filter\Basic\Resize">Resize</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Rotate.html#method_apply"><abbr title="Imagine\Filter\Basic\Rotate">Rotate</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Rotate.html"><abbr title="Imagine\Filter\Basic\Rotate">Rotate</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Save.html#method_apply"><abbr title="Imagine\Filter\Basic\Save">Save</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Save.html"><abbr title="Imagine\Filter\Basic\Save">Save</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Show.html#method_apply"><abbr title="Imagine\Filter\Basic\Show">Show</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Show.html"><abbr title="Imagine\Filter\Basic\Show">Show</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Strip.html#method_apply"><abbr title="Imagine\Filter\Basic\Strip">Strip</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Strip.html"><abbr title="Imagine\Filter\Basic\Strip">Strip</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Basic/Thumbnail.html#method_apply"><abbr title="Imagine\Filter\Basic\Thumbnail">Thumbnail</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Thumbnail.html"><abbr title="Imagine\Filter\Basic\Thumbnail">Thumbnail</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/FilterInterface.html#method_apply"><abbr title="Imagine\Filter\FilterInterface">FilterInterface</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/FilterInterface.html"><abbr title="Imagine\Filter\FilterInterface">FilterInterface</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Transformation.html#method_applyFilter"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::applyFilter</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Applies a given FilterInterface onto given ImageInterface and returns modified ImageInterface</dd><dt><a href="Imagine/Filter/Transformation.html#method_apply"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::apply</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance</dd><dt><a href="Imagine/Filter/Transformation.html#method_applyMask"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::applyMask</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Applies a given mask to current image&#039;s alpha channel</dd><dt><a href="Imagine/Filter/Transformation.html#method_add"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::add</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface</dd><dt><a href="Imagine/Gd/Drawer.html#method_arc"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::arc</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Draws an arc on a starting at a given x, y coordinates under a given start and end angles</dd><dt><a href="Imagine/Gd/Image.html#method_applyMask"><abbr title="Imagine\Gd\Image">Image</abbr>::applyMask</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Applies a given mask to current image&#039;s alpha channel</dd><dt><a href="Imagine/Gmagick/Drawer.html#method_arc"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::arc</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws an arc on a starting at a given x, y coordinates under a given start and end angles</dd><dt><a href="Imagine/Gmagick/Image.html#method_applyMask"><abbr title="Imagine\Gmagick\Image">Image</abbr>::applyMask</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Applies a given mask to current image&#039;s alpha channel</dd><dt><a href="Imagine/Image/AbstractFont.html"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/Histogram/Bucket.html#method_add"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr>::add</a>() &mdash; <em>Method in class <a href="Imagine/Image/Histogram/Bucket.html"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_applyMask"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::applyMask</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Applies a given mask to current image&#039;s alpha channel</dd><dt><a href="Imagine/Imagick/Drawer.html#method_arc"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::arc</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws an arc on a starting at a given x, y coordinates under a given start and end angles</dd><dt><a href="Imagine/Imagick/Image.html#method_applyMask"><abbr title="Imagine\Imagick\Image">Image</abbr>::applyMask</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Applies a given mask to current image&#039;s alpha channel</dd><dt><a href="Imagine/Test/ImagineTestCase.html#method_assertImageEquals"><abbr title="Imagine\Test\ImagineTestCase">ImagineTestCase</abbr>::assertImageEquals</a>() &mdash; <em>Method in class <a href="Imagine/Test/ImagineTestCase.html"><abbr title="Imagine\Test\ImagineTestCase">ImagineTestCase</abbr></a></em></dt> <dd>Asserts that two images are equal using color histogram comparison method</dd> </dl><h2 id="letterB">B</h2> <dl id="index"><dt><a href="Imagine/Filter/Advanced/Border.html"><abbr title="Imagine\Filter\Advanced\Border">Border</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Advanced.html">Imagine\Filter\Advanced</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Font.html#method_box"><abbr title="Imagine\Gd\Font">Font</abbr>::box</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Font.html"><abbr title="Imagine\Gd\Font">Font</abbr></a></em></dt> <dd>Gets BoxInterface of font size on the image based on string and angle</dd><dt><a href="Imagine/Gmagick/Font.html#method_box"><abbr title="Imagine\Gmagick\Font">Font</abbr>::box</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Font.html"><abbr title="Imagine\Gmagick\Font">Font</abbr></a></em></dt> <dd>Gets BoxInterface of font size on the image based on string and angle</dd><dt><a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/FontInterface.html#method_box"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr>::box</a>() &mdash; <em>Method in class <a href="Imagine/Image/FontInterface.html"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr></a></em></dt> <dd>Gets BoxInterface of font size on the image based on string and angle</dd><dt><a href="Imagine/Image/Histogram/Bucket.html"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Histogram.html">Imagine\Image\Histogram</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Font.html#method_box"><abbr title="Imagine\Imagick\Font">Font</abbr>::box</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Font.html"><abbr title="Imagine\Imagick\Font">Font</abbr></a></em></dt> <dd>Gets BoxInterface of font size on the image based on string and angle</dd> </dl><h2 id="letterC">C</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html#method_chord"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::chord</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Same as arc, but also connects end points with a straight line</dd><dt><a href="Imagine/Filter/Advanced/Canvas.html"><abbr title="Imagine\Filter\Advanced\Canvas">Canvas</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Advanced.html">Imagine\Filter\Advanced</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Copy.html"><abbr title="Imagine\Filter\Basic\Copy">Copy</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Crop.html"><abbr title="Imagine\Filter\Basic\Crop">Crop</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Transformation.html#method_copy"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::copy</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Copies current source image into a new ImageInterface instance</dd><dt><a href="Imagine/Filter/Transformation.html#method_crop"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::crop</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Crops a specified box out of the source image (modifies the source image) Returns cropped self</dd><dt><a href="Imagine/Gd/Drawer.html#method_chord"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::chord</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Same as arc, but also connects end points with a straight line</dd><dt><a href="Imagine/Gd/Image.html#method_copy"><abbr title="Imagine\Gd\Image">Image</abbr>::copy</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Copies current source image into a new ImageInterface instance</dd><dt><a href="Imagine/Gd/Image.html#method_crop"><abbr title="Imagine\Gd\Image">Image</abbr>::crop</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Crops a specified box out of the source image (modifies the source image) Returns cropped self</dd><dt><a href="Imagine/Gd/Imagine.html#method_create"><abbr title="Imagine\Gd\Imagine">Imagine</abbr>::create</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a></em></dt> <dd>Creates a new empty image with an optional background color</dd><dt><a href="Imagine/Gmagick/Drawer.html#method_chord"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::chord</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Same as arc, but also connects end points with a straight line</dd><dt><a href="Imagine/Gmagick/Image.html#method_copy"><abbr title="Imagine\Gmagick\Image">Image</abbr>::copy</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Copies current source image into a new ImageInterface instance</dd><dt><a href="Imagine/Gmagick/Image.html#method_crop"><abbr title="Imagine\Gmagick\Image">Image</abbr>::crop</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Crops a specified box out of the source image (modifies the source image) Returns cropped self</dd><dt><a href="Imagine/Gmagick/Imagine.html#method_create"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr>::create</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a></em></dt> <dd>Creates a new empty image with an optional background color</dd><dt><a href="Imagine/Image/Box.html#method_contains"><abbr title="Imagine\Image\Box">Box</abbr>::contains</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0)</dd><dt><a href="Imagine/Image/BoxInterface.html#method_contains"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::contains</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0)</dd><dt><a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/Histogram/Bucket.html#method_count"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr>::count</a>() &mdash; <em>Method in class <a href="Imagine/Image/Histogram/Bucket.html"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/Histogram/Range.html#method_contains"><abbr title="Imagine\Image\Histogram\Range">Range</abbr>::contains</a>() &mdash; <em>Method in class <a href="Imagine/Image/Histogram/Range.html"><abbr title="Imagine\Image\Histogram\Range">Range</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImagineInterface.html#method_create"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr>::create</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImagineInterface.html"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr></a></em></dt> <dd>Creates a new empty image with an optional background color</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_copy"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::copy</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Copies current source image into a new ImageInterface instance</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_crop"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::crop</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Crops a specified box out of the source image (modifies the source image) Returns cropped self</dd><dt><a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Point.html">Imagine\Image\Point</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Drawer.html#method_chord"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::chord</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Same as arc, but also connects end points with a straight line</dd><dt><a href="Imagine/Imagick/Image.html#method_copy"><abbr title="Imagine\Imagick\Image">Image</abbr>::copy</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Copies current source image into a new ImageInterface instance</dd><dt><a href="Imagine/Imagick/Image.html#method_crop"><abbr title="Imagine\Imagick\Image">Image</abbr>::crop</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Crops a specified box out of the source image (modifies the source image) Returns cropped self</dd><dt><a href="Imagine/Imagick/Imagine.html#method_create"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr>::create</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a></em></dt> <dd>Creates a new empty image with an optional background color</dd> </dl><h2 id="letterD">D</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Draw.html">Imagine\Draw</a></em></dt> <dd></dd><dt><a href="Imagine/Draw/DrawerInterface.html#method_dot"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::dot</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Places a one pixel point at specific coordinates and fills it with specified color</dd><dt><a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gd.html">Imagine\Gd</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Drawer.html#method_dot"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::dot</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Places a one pixel point at specific coordinates and fills it with specified color</dd><dt><a href="Imagine/Gd/Image.html#method_draw"><abbr title="Imagine\Gd\Image">Image</abbr>::draw</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Instantiates and returns a DrawerInterface instance for image drawing</dd><dt><a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gmagick.html">Imagine\Gmagick</a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Drawer.html#method_dot"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::dot</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Places a one pixel point at specific coordinates and fills it with specified color</dd><dt><a href="Imagine/Gmagick/Image.html#method_draw"><abbr title="Imagine\Gmagick\Image">Image</abbr>::draw</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Instantiates and returns a DrawerInterface instance for image drawing</dd><dt><a href="Imagine/Image/Color.html#method_dissolve"><abbr title="Imagine\Image\Color">Color</abbr>::dissolve</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns a copy of current color, incrementing the alpha channel by the given amount</dd><dt><a href="Imagine/Image/Color.html#method_darken"><abbr title="Imagine\Image\Color">Color</abbr>::darken</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns a copy of the current color, darkened by the specified number of shades</dd><dt><a href="Imagine/Image/ImageInterface.html#method_draw"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::draw</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Instantiates and returns a DrawerInterface instance for image drawing</dd><dt><a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Imagick.html">Imagine\Imagick</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Drawer.html#method_dot"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::dot</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Places a one pixel point at specific coordinates and fills it with specified color</dd><dt><a href="Imagine/Imagick/Image.html#method_draw"><abbr title="Imagine\Imagick\Image">Image</abbr>::draw</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Instantiates and returns a DrawerInterface instance for image drawing</dd> </dl><h2 id="letterE">E</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html#method_ellipse"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::ellipse</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Draws and ellipse with center at the given x, y coordinates, and given width and height</dd><dt><a href="Imagine/Effects/EffectsInterface.html"><abbr title="Imagine\Effects\EffectsInterface">EffectsInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Effects.html">Imagine\Effects</a></em></dt> <dd></dd><dt><a href="Imagine/Exception/Exception.html"><abbr title="Imagine\Exception\Exception">Exception</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Exception.html">Imagine\Exception</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Drawer.html#method_ellipse"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::ellipse</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Draws and ellipse with center at the given x, y coordinates, and given width and height</dd><dt><a href="Imagine/Gd/Effects.html"><abbr title="Imagine\Gd\Effects">Effects</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gd.html">Imagine\Gd</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Image.html#method_effects"><abbr title="Imagine\Gd\Image">Image</abbr>::effects</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Drawer.html#method_ellipse"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::ellipse</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws and ellipse with center at the given x, y coordinates, and given width and height</dd><dt><a href="Imagine/Gmagick/Effects.html"><abbr title="Imagine\Gmagick\Effects">Effects</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gmagick.html">Imagine\Gmagick</a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Image.html#method_effects"><abbr title="Imagine\Gmagick\Image">Image</abbr>::effects</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImageInterface.html#method_effects"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::effects</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Drawer.html#method_ellipse"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::ellipse</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws and ellipse with center at the given x, y coordinates, and given width and height</dd><dt><a href="Imagine/Imagick/Effects.html"><abbr title="Imagine\Imagick\Effects">Effects</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Imagick.html">Imagine\Imagick</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Image.html#method_effects"><abbr title="Imagine\Imagick\Image">Image</abbr>::effects</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Test/Constraint/IsImageEqual.html#method_evaluate"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr>::evaluate</a>() &mdash; <em>Method in class <a href="Imagine/Test/Constraint/IsImageEqual.html"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr></a></em></dt> <dd>{@inheritdoc}</dd> </dl><h2 id="letterF">F</h2> <dl id="index"><dt><a href="Imagine/Filter/Basic/Fill.html"><abbr title="Imagine\Filter\Basic\Fill">Fill</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/FlipHorizontally.html"><abbr title="Imagine\Filter\Basic\FlipHorizontally">FlipHorizontally</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/FlipVertically.html"><abbr title="Imagine\Filter\Basic\FlipVertically">FlipVertically</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/FilterInterface.html"><abbr title="Imagine\Filter\FilterInterface">FilterInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter.html">Imagine\Filter</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Transformation.html#method_flipHorizontally"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::flipHorizontally</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Flips current image using horizontal axis</dd><dt><a href="Imagine/Filter/Transformation.html#method_flipVertically"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::flipVertically</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Flips current image using vertical axis</dd><dt><a href="Imagine/Filter/Transformation.html#method_fill"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::fill</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Fills image with provided filling, by replacing each pixel&#039;s color in the current image with corresponding color from FillInterface, and returns modified image</dd><dt><a href="Imagine/Gd/Font.html"><abbr title="Imagine\Gd\Font">Font</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gd.html">Imagine\Gd</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Image.html#method_flipHorizontally"><abbr title="Imagine\Gd\Image">Image</abbr>::flipHorizontally</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Flips current image using horizontal axis</dd><dt><a href="Imagine/Gd/Image.html#method_flipVertically"><abbr title="Imagine\Gd\Image">Image</abbr>::flipVertically</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Flips current image using vertical axis</dd><dt><a href="Imagine/Gd/Image.html#method_fill"><abbr title="Imagine\Gd\Image">Image</abbr>::fill</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Fills image with provided filling, by replacing each pixel&#039;s color in the current image with corresponding color from FillInterface, and returns modified image</dd><dt><a href="Imagine/Gd/Imagine.html#method_font"><abbr title="Imagine\Gd\Imagine">Imagine</abbr>::font</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd><dt><a href="Imagine/Gmagick/Font.html"><abbr title="Imagine\Gmagick\Font">Font</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gmagick.html">Imagine\Gmagick</a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Image.html#method_flipHorizontally"><abbr title="Imagine\Gmagick\Image">Image</abbr>::flipHorizontally</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Flips current image using horizontal axis</dd><dt><a href="Imagine/Gmagick/Image.html#method_flipVertically"><abbr title="Imagine\Gmagick\Image">Image</abbr>::flipVertically</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Flips current image using vertical axis</dd><dt><a href="Imagine/Gmagick/Image.html#method_fill"><abbr title="Imagine\Gmagick\Image">Image</abbr>::fill</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Fills image with provided filling, by replacing each pixel&#039;s color in the current image with corresponding color from FillInterface, and returns modified image</dd><dt><a href="Imagine/Gmagick/Imagine.html#method_font"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr>::font</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd><dt><a href="Imagine/Image/Fill/FillInterface.html"><abbr title="Imagine\Image\Fill\FillInterface">FillInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Fill.html">Imagine\Image\Fill</a></em></dt> <dd></dd><dt><a href="Imagine/Image/FontInterface.html"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImagineInterface.html#method_font"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr>::font</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImagineInterface.html"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_flipHorizontally"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::flipHorizontally</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Flips current image using horizontal axis</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_flipVertically"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::flipVertically</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Flips current image using vertical axis</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_fill"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::fill</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Fills image with provided filling, by replacing each pixel&#039;s color in the current image with corresponding color from FillInterface, and returns modified image</dd><dt><a href="Imagine/Imagick/Font.html"><abbr title="Imagine\Imagick\Font">Font</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Imagick.html">Imagine\Imagick</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Image.html#method_flipHorizontally"><abbr title="Imagine\Imagick\Image">Image</abbr>::flipHorizontally</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Flips current image using horizontal axis</dd><dt><a href="Imagine/Imagick/Image.html#method_flipVertically"><abbr title="Imagine\Imagick\Image">Image</abbr>::flipVertically</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Flips current image using vertical axis</dd><dt><a href="Imagine/Imagick/Image.html#method_fill"><abbr title="Imagine\Imagick\Image">Image</abbr>::fill</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Fills image with provided filling, by replacing each pixel&#039;s color in the current image with corresponding color from FillInterface, and returns modified image</dd><dt><a href="Imagine/Imagick/Imagine.html#method_font"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr>::font</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd> </dl><h2 id="letterG">G</h2> <dl id="index"><dt><a href="Imagine/Effects/EffectsInterface.html#method_gamma"><abbr title="Imagine\Effects\EffectsInterface">EffectsInterface</abbr>::gamma</a>() &mdash; <em>Method in class <a href="Imagine/Effects/EffectsInterface.html"><abbr title="Imagine\Effects\EffectsInterface">EffectsInterface</abbr></a></em></dt> <dd>Apply gamma correction</dd><dt><a href="Imagine/Filter/Advanced/Grayscale.html"><abbr title="Imagine\Filter\Advanced\Grayscale">Grayscale</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Advanced.html">Imagine\Filter\Advanced</a></em></dt> <dd>The Grayscale filter calculates the gray-value based on RGB.</dd><dt><a href="Imagine/Filter/ImagineAware.html#method_getImagine"><abbr title="Imagine\Filter\ImagineAware">ImagineAware</abbr>::getImagine</a>() &mdash; <em>Method in class <a href="Imagine/Filter/ImagineAware.html"><abbr title="Imagine\Filter\ImagineAware">ImagineAware</abbr></a></em></dt> <dd>Get ImagineInterface instance.</dd><dt><a href="Imagine/Gd/Effects.html#method_gamma"><abbr title="Imagine\Gd\Effects">Effects</abbr>::gamma</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Effects.html"><abbr title="Imagine\Gd\Effects">Effects</abbr></a></em></dt> <dd>Apply gamma correction</dd><dt><a href="Imagine/Gd/Image.html#method_get"><abbr title="Imagine\Gd\Image">Image</abbr>::get</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Returns the image content as a binary string</dd><dt><a href="Imagine/Gd/Image.html#method_getSize"><abbr title="Imagine\Gd\Image">Image</abbr>::getSize</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Returns current image size</dd><dt><a href="Imagine/Gd/Image.html#method_getColorAt"><abbr title="Imagine\Gd\Image">Image</abbr>::getColorAt</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Returns color at specified positions of current image</dd><dt><a href="Imagine/Gmagick/Effects.html#method_gamma"><abbr title="Imagine\Gmagick\Effects">Effects</abbr>::gamma</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Effects.html"><abbr title="Imagine\Gmagick\Effects">Effects</abbr></a></em></dt> <dd>Apply gamma correction</dd><dt><a href="Imagine/Gmagick/Image.html#method_get"><abbr title="Imagine\Gmagick\Image">Image</abbr>::get</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Returns the image content as a binary string</dd><dt><a href="Imagine/Gmagick/Image.html#method_getSize"><abbr title="Imagine\Gmagick\Image">Image</abbr>::getSize</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Returns current image size</dd><dt><a href="Imagine/Gmagick/Image.html#method_getColorAt"><abbr title="Imagine\Gmagick\Image">Image</abbr>::getColorAt</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Returns color at specified positions of current image</dd><dt><a href="Imagine/Image/AbstractFont.html#method_getFile"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr>::getFile</a>() &mdash; <em>Method in class <a href="Imagine/Image/AbstractFont.html"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr></a></em></dt> <dd>Gets the fontfile for current font</dd><dt><a href="Imagine/Image/AbstractFont.html#method_getSize"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr>::getSize</a>() &mdash; <em>Method in class <a href="Imagine/Image/AbstractFont.html"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr></a></em></dt> <dd>Gets font&#039;s integer point size</dd><dt><a href="Imagine/Image/AbstractFont.html#method_getColor"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr>::getColor</a>() &mdash; <em>Method in class <a href="Imagine/Image/AbstractFont.html"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr></a></em></dt> <dd>Gets font&#039;s color</dd><dt><a href="Imagine/Image/Box.html#method_getWidth"><abbr title="Imagine\Image\Box">Box</abbr>::getWidth</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Gets current image width</dd><dt><a href="Imagine/Image/Box.html#method_getHeight"><abbr title="Imagine\Image\Box">Box</abbr>::getHeight</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Gets current image height</dd><dt><a href="Imagine/Image/BoxInterface.html#method_getHeight"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::getHeight</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Gets current image height</dd><dt><a href="Imagine/Image/BoxInterface.html#method_getWidth"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::getWidth</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Gets current image width</dd><dt><a href="Imagine/Image/Color.html#method_getRed"><abbr title="Imagine\Image\Color">Color</abbr>::getRed</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns RED value of the color</dd><dt><a href="Imagine/Image/Color.html#method_getGreen"><abbr title="Imagine\Image\Color">Color</abbr>::getGreen</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns GREEN value of the color</dd><dt><a href="Imagine/Image/Color.html#method_getBlue"><abbr title="Imagine\Image\Color">Color</abbr>::getBlue</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns BLUE value of the color</dd><dt><a href="Imagine/Image/Color.html#method_getAlpha"><abbr title="Imagine\Image\Color">Color</abbr>::getAlpha</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns percentage of transparency of the color</dd><dt><a href="Imagine/Image/Fill/FillInterface.html#method_getColor"><abbr title="Imagine\Image\Fill\FillInterface">FillInterface</abbr>::getColor</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/FillInterface.html"><abbr title="Imagine\Image\Fill\FillInterface">FillInterface</abbr></a></em></dt> <dd>Gets color of the fill for the given position</dd><dt><a href="Imagine/Image/Fill/Gradient/Horizontal.html#method_getDistance"><abbr title="Imagine\Image\Fill\Gradient\Horizontal">Horizontal</abbr>::getDistance</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/Gradient/Horizontal.html"><abbr title="Imagine\Image\Fill\Gradient\Horizontal">Horizontal</abbr></a></em></dt> <dd>{@inheritdoc}</dd><dt><a href="Imagine/Image/Fill/Gradient/Linear.html#method_getColor"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr>::getColor</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/Gradient/Linear.html"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr></a></em></dt> <dd>Gets color of the fill for the given position</dd><dt><a href="Imagine/Image/Fill/Gradient/Linear.html#method_getStart"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr>::getStart</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/Gradient/Linear.html"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/Fill/Gradient/Linear.html#method_getEnd"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr>::getEnd</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/Gradient/Linear.html"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/Fill/Gradient/Vertical.html#method_getDistance"><abbr title="Imagine\Image\Fill\Gradient\Vertical">Vertical</abbr>::getDistance</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/Gradient/Vertical.html"><abbr title="Imagine\Image\Fill\Gradient\Vertical">Vertical</abbr></a></em></dt> <dd>{@inheritdoc}</dd><dt><a href="Imagine/Image/FontInterface.html#method_getFile"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr>::getFile</a>() &mdash; <em>Method in class <a href="Imagine/Image/FontInterface.html"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr></a></em></dt> <dd>Gets the fontfile for current font</dd><dt><a href="Imagine/Image/FontInterface.html#method_getSize"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr>::getSize</a>() &mdash; <em>Method in class <a href="Imagine/Image/FontInterface.html"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr></a></em></dt> <dd>Gets font&#039;s integer point size</dd><dt><a href="Imagine/Image/FontInterface.html#method_getColor"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr>::getColor</a>() &mdash; <em>Method in class <a href="Imagine/Image/FontInterface.html"><abbr title="Imagine\Image\FontInterface">FontInterface</abbr></a></em></dt> <dd>Gets font&#039;s color</dd><dt><a href="Imagine/Image/ImageInterface.html#method_get"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::get</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Returns the image content as a binary string</dd><dt><a href="Imagine/Image/ImageInterface.html#method_getSize"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::getSize</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Returns current image size</dd><dt><a href="Imagine/Image/ImageInterface.html#method_getColorAt"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::getColorAt</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Returns color at specified positions of current image</dd><dt><a href="Imagine/Image/Point.html#method_getX"><abbr title="Imagine\Image\Point">Point</abbr>::getX</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a></em></dt> <dd>Gets points x coordinate</dd><dt><a href="Imagine/Image/Point.html#method_getY"><abbr title="Imagine\Image\Point">Point</abbr>::getY</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a></em></dt> <dd>Gets points y coordinate</dd><dt><a href="Imagine/Image/PointInterface.html#method_getX"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr>::getX</a>() &mdash; <em>Method in class <a href="Imagine/Image/PointInterface.html"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr></a></em></dt> <dd>Gets points x coordinate</dd><dt><a href="Imagine/Image/PointInterface.html#method_getY"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr>::getY</a>() &mdash; <em>Method in class <a href="Imagine/Image/PointInterface.html"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr></a></em></dt> <dd>Gets points y coordinate</dd><dt><a href="Imagine/Image/Point/Center.html#method_getX"><abbr title="Imagine\Image\Point\Center">Center</abbr>::getX</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a></em></dt> <dd>Gets points x coordinate</dd><dt><a href="Imagine/Image/Point/Center.html#method_getY"><abbr title="Imagine\Image\Point\Center">Center</abbr>::getY</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a></em></dt> <dd>Gets points y coordinate</dd><dt><a href="Imagine/Imagick/Effects.html#method_gamma"><abbr title="Imagine\Imagick\Effects">Effects</abbr>::gamma</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Effects.html"><abbr title="Imagine\Imagick\Effects">Effects</abbr></a></em></dt> <dd>Apply gamma correction</dd><dt><a href="Imagine/Imagick/Image.html#method_get"><abbr title="Imagine\Imagick\Image">Image</abbr>::get</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Returns the image content as a binary string</dd><dt><a href="Imagine/Imagick/Image.html#method_getSize"><abbr title="Imagine\Imagick\Image">Image</abbr>::getSize</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Returns current image size</dd><dt><a href="Imagine/Imagick/Image.html#method_getColorAt"><abbr title="Imagine\Imagick\Image">Image</abbr>::getColorAt</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Returns color at specified positions of current image</dd> </dl><h2 id="letterH">H</h2> <dl id="index"><dt><a href="Imagine/Gd/Image.html#method_histogram"><abbr title="Imagine\Gd\Image">Image</abbr>::histogram</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Returns array of image colors as Imagine\Image\Color instances</dd><dt><a href="Imagine/Gmagick/Image.html#method_histogram"><abbr title="Imagine\Gmagick\Image">Image</abbr>::histogram</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Returns array of image colors as Imagine\Image\Color instances</dd><dt><a href="Imagine/Image/Box.html#method_heighten"><abbr title="Imagine\Image\Box">Box</abbr>::heighten</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Resizes box to given height, constraining proportions and returns the new box</dd><dt><a href="Imagine/Image/BoxInterface.html#method_heighten"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::heighten</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Resizes box to given height, constraining proportions and returns the new box</dd><dt><a href="Imagine/Image/Fill/Gradient/Horizontal.html"><abbr title="Imagine\Image\Fill\Gradient\Horizontal">Horizontal</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Fill/Gradient.html">Imagine\Image\Fill\Gradient</a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImageInterface.html#method_histogram"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::histogram</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Returns array of image colors as Imagine\Image\Color instances</dd><dt><a href="Imagine/Imagick/Image.html#method_histogram"><abbr title="Imagine\Imagick\Image">Image</abbr>::histogram</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Returns array of image colors as Imagine\Image\Color instances</dd> </dl><h2 id="letterI">I</h2> <dl id="index"><dt><a href="Imagine/Exception/InvalidArgumentException.html"><abbr title="Imagine\Exception\InvalidArgumentException">InvalidArgumentException</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Exception.html">Imagine\Exception</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/ImagineAware.html"><abbr title="Imagine\Filter\ImagineAware">ImagineAware</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter.html">Imagine\Filter</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gd.html">Imagine\Gd</a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gd.html">Imagine\Gd</a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gmagick.html">Imagine\Gmagick</a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Gmagick.html">Imagine\Gmagick</a></em></dt> <dd></dd><dt><a href="Imagine/Image/Box.html#method_increase"><abbr title="Imagine\Image\Box">Box</abbr>::increase</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Creates new BoxInterface, adding given size to both sides</dd><dt><a href="Imagine/Image/BoxInterface.html#method_increase"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::increase</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Creates new BoxInterface, adding given size to both sides</dd><dt><a href="Imagine/Image/Color.html#method_isOpaque"><abbr title="Imagine\Image\Color">Color</abbr>::isOpaque</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Checks if the current color is opaque</dd><dt><a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImagineInterface.html"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/Point.html#method_in"><abbr title="Imagine\Image\Point">Point</abbr>::in</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a></em></dt> <dd>Checks if current coordinate is inside a given bo</dd><dt><a href="Imagine/Image/PointInterface.html#method_in"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr>::in</a>() &mdash; <em>Method in class <a href="Imagine/Image/PointInterface.html"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr></a></em></dt> <dd>Checks if current coordinate is inside a given bo</dd><dt><a href="Imagine/Image/Point/Center.html#method_in"><abbr title="Imagine\Image\Point\Center">Center</abbr>::in</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a></em></dt> <dd>Checks if current coordinate is inside a given bo</dd><dt><a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Imagick.html">Imagine\Imagick</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Imagick.html">Imagine\Imagick</a></em></dt> <dd></dd><dt><a href="Imagine/Test/Constraint/IsImageEqual.html"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Test/Constraint.html">Imagine\Test\Constraint</a></em></dt> <dd></dd><dt><a href="Imagine/Test/ImagineTestCase.html"><abbr title="Imagine\Test\ImagineTestCase">ImagineTestCase</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Test.html">Imagine\Test</a></em></dt> <dd></dd> </dl><h2 id="letterL">L</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html#method_line"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::line</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Draws a line from start(x, y) to end(x, y) coordinates</dd><dt><a href="Imagine/Gd/Drawer.html#method_line"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::line</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Draws a line from start(x, y) to end(x, y) coordinates</dd><dt><a href="Imagine/Gd/Imagine.html#method_load"><abbr title="Imagine\Gd\Imagine">Imagine</abbr>::load</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a></em></dt> <dd>Loads an image from a binary $string</dd><dt><a href="Imagine/Gmagick/Drawer.html#method_line"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::line</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws a line from start(x, y) to end(x, y) coordinates</dd><dt><a href="Imagine/Gmagick/Imagine.html#method_load"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr>::load</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a></em></dt> <dd>Loads an image from a binary $string</dd><dt><a href="Imagine/Image/Color.html#method_lighten"><abbr title="Imagine\Image\Color">Color</abbr>::lighten</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns a copy of the current color, lightened by the specified number of shades</dd><dt><a href="Imagine/Image/Fill/Gradient/Linear.html"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Fill/Gradient.html">Imagine\Image\Fill\Gradient</a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImagineInterface.html#method_load"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr>::load</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImagineInterface.html"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr></a></em></dt> <dd>Loads an image from a binary $string</dd><dt><a href="Imagine/Imagick/Drawer.html#method_line"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::line</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws a line from start(x, y) to end(x, y) coordinates</dd><dt><a href="Imagine/Imagick/Imagine.html#method_load"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr>::load</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a></em></dt> <dd>Loads an image from a binary $string</dd> </dl><h2 id="letterM">M</h2> <dl id="index"><dt><a href="Imagine/Gd/Image.html#method_mask"><abbr title="Imagine\Gd\Image">Image</abbr>::mask</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified</dd><dt><a href="Imagine/Gmagick/Image.html#method_mask"><abbr title="Imagine\Gmagick\Image">Image</abbr>::mask</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified</dd><dt><a href="Imagine/Image/ImageInterface.html#method_mask"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::mask</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified</dd><dt><a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/Point.html#method_move"><abbr title="Imagine\Image\Point">Point</abbr>::move</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a></em></dt> <dd>Returns another point, moved by a given amount from current coordinates</dd><dt><a href="Imagine/Image/PointInterface.html#method_move"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr>::move</a>() &mdash; <em>Method in class <a href="Imagine/Image/PointInterface.html"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr></a></em></dt> <dd>Returns another point, moved by a given amount from current coordinates</dd><dt><a href="Imagine/Image/Point/Center.html#method_move"><abbr title="Imagine\Image\Point\Center">Center</abbr>::move</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a></em></dt> <dd>Returns another point, moved by a given amount from current coordinates</dd><dt><a href="Imagine/Imagick/Image.html#method_mask"><abbr title="Imagine\Imagick\Image">Image</abbr>::mask</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified</dd> </dl><h2 id="letterN">N</h2> <dl id="index"><dt><a href="Imagine/Effects/EffectsInterface.html#method_negative"><abbr title="Imagine\Effects\EffectsInterface">EffectsInterface</abbr>::negative</a>() &mdash; <em>Method in class <a href="Imagine/Effects/EffectsInterface.html"><abbr title="Imagine\Effects\EffectsInterface">EffectsInterface</abbr></a></em></dt> <dd>Invert the colors of the image</dd><dt><a href="Imagine/Gd/Effects.html#method_negative"><abbr title="Imagine\Gd\Effects">Effects</abbr>::negative</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Effects.html"><abbr title="Imagine\Gd\Effects">Effects</abbr></a></em></dt> <dd>Invert the colors of the image</dd><dt><a href="Imagine/Gmagick/Effects.html#method_negative"><abbr title="Imagine\Gmagick\Effects">Effects</abbr>::negative</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Effects.html"><abbr title="Imagine\Gmagick\Effects">Effects</abbr></a></em></dt> <dd>Invert the colors of the image</dd><dt><a href="Imagine/Imagick/Effects.html#method_negative"><abbr title="Imagine\Imagick\Effects">Effects</abbr>::negative</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Effects.html"><abbr title="Imagine\Imagick\Effects">Effects</abbr></a></em></dt> <dd>Invert the colors of the image</dd> </dl><h2 id="letterO">O</h2> <dl id="index"><dt><a href="Imagine/Exception/OutOfBoundsException.html"><abbr title="Imagine\Exception\OutOfBoundsException">OutOfBoundsException</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Exception.html">Imagine\Exception</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Advanced/OnPixelBased.html"><abbr title="Imagine\Filter\Advanced\OnPixelBased">OnPixelBased</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Advanced.html">Imagine\Filter\Advanced</a></em></dt> <dd>The OnPixelBased takes a callable, and for each pixel, this callable is called with the image (\Imagine\Image\ImageInterface) and the current point (\Imagine\Image\Point)</dd><dt><a href="Imagine/Gd/Imagine.html#method_open"><abbr title="Imagine\Gd\Imagine">Imagine</abbr>::open</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a></em></dt> <dd>Opens an existing image from $path</dd><dt><a href="Imagine/Gmagick/Imagine.html#method_open"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr>::open</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a></em></dt> <dd>Opens an existing image from $path</dd><dt><a href="Imagine/Image/ImagineInterface.html#method_open"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr>::open</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImagineInterface.html"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr></a></em></dt> <dd>Opens an existing image from $path</dd><dt><a href="Imagine/Imagick/Imagine.html#method_open"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr>::open</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a></em></dt> <dd>Opens an existing image from $path</dd> </dl><h2 id="letterP">P</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html#method_pieSlice"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::pieSlice</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Same as arc, but connects end points and the center</dd><dt><a href="Imagine/Draw/DrawerInterface.html#method_polygon"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::polygon</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Draws a polygon using array of x, y coordinates.</dd><dt><a href="Imagine/Filter/Basic/Paste.html"><abbr title="Imagine\Filter\Basic\Paste">Paste</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Transformation.html#method_paste"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::paste</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails</dd><dt><a href="Imagine/Gd/Drawer.html#method_pieSlice"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::pieSlice</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Same as arc, but connects end points and the center</dd><dt><a href="Imagine/Gd/Drawer.html#method_polygon"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::polygon</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Draws a polygon using array of x, y coordinates.</dd><dt><a href="Imagine/Gd/Image.html#method_paste"><abbr title="Imagine\Gd\Image">Image</abbr>::paste</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails</dd><dt><a href="Imagine/Gmagick/Drawer.html#method_pieSlice"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::pieSlice</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Same as arc, but connects end points and the center</dd><dt><a href="Imagine/Gmagick/Drawer.html#method_polygon"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::polygon</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws a polygon using array of x, y coordinates.</dd><dt><a href="Imagine/Gmagick/Image.html#method_paste"><abbr title="Imagine\Gmagick\Image">Image</abbr>::paste</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_paste"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::paste</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails</dd><dt><a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Image/PointInterface.html"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image.html">Imagine\Image</a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Drawer.html#method_pieSlice"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::pieSlice</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Same as arc, but connects end points and the center</dd><dt><a href="Imagine/Imagick/Drawer.html#method_polygon"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::polygon</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Draws a polygon using array of x, y coordinates.</dd><dt><a href="Imagine/Imagick/Image.html#method_paste"><abbr title="Imagine\Imagick\Image">Image</abbr>::paste</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails</dd> </dl><h2 id="letterR">R</h2> <dl id="index"><dt><a href="Imagine/Exception/RuntimeException.html"><abbr title="Imagine\Exception\RuntimeException">RuntimeException</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Exception.html">Imagine\Exception</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Resize.html"><abbr title="Imagine\Filter\Basic\Resize">Resize</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Rotate.html"><abbr title="Imagine\Filter\Basic\Rotate">Rotate</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Transformation.html#method_resize"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::resize</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Resizes current image and returns self</dd><dt><a href="Imagine/Filter/Transformation.html#method_rotate"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::rotate</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Rotates an image at the given angle.</dd><dt><a href="Imagine/Gd/Image.html#method_resize"><abbr title="Imagine\Gd\Image">Image</abbr>::resize</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Resizes current image and returns self</dd><dt><a href="Imagine/Gd/Image.html#method_rotate"><abbr title="Imagine\Gd\Image">Image</abbr>::rotate</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Rotates an image at the given angle.</dd><dt><a href="Imagine/Gd/Imagine.html#method_read"><abbr title="Imagine\Gd\Imagine">Imagine</abbr>::read</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a></em></dt> <dd>Loads an image from a resource $resource</dd><dt><a href="Imagine/Gmagick/Image.html#method_resize"><abbr title="Imagine\Gmagick\Image">Image</abbr>::resize</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Resizes current image and returns self</dd><dt><a href="Imagine/Gmagick/Image.html#method_rotate"><abbr title="Imagine\Gmagick\Image">Image</abbr>::rotate</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Rotates an image at the given angle.</dd><dt><a href="Imagine/Gmagick/Imagine.html#method_read"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr>::read</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a></em></dt> <dd>Loads an image from a resource $resource</dd><dt><a href="Imagine/Image/Histogram/Range.html"><abbr title="Imagine\Image\Histogram\Range">Range</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Histogram.html">Imagine\Image\Histogram</a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImagineInterface.html#method_read"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr>::read</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImagineInterface.html"><abbr title="Imagine\Image\ImagineInterface">ImagineInterface</abbr></a></em></dt> <dd>Loads an image from a resource $resource</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_resize"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::resize</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Resizes current image and returns self</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_rotate"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::rotate</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Rotates an image at the given angle.</dd><dt><a href="Imagine/Imagick/Image.html#method_resize"><abbr title="Imagine\Imagick\Image">Image</abbr>::resize</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Resizes current image and returns self</dd><dt><a href="Imagine/Imagick/Image.html#method_rotate"><abbr title="Imagine\Imagick\Image">Image</abbr>::rotate</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Rotates an image at the given angle.</dd><dt><a href="Imagine/Imagick/Imagine.html#method_read"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr>::read</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a></em></dt> <dd>Loads an image from a resource $resource</dd> </dl><h2 id="letterS">S</h2> <dl id="index"><dt><a href="Imagine/Filter/Basic/Save.html"><abbr title="Imagine\Filter\Basic\Save">Save</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Show.html"><abbr title="Imagine\Filter\Basic\Show">Show</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Strip.html"><abbr title="Imagine\Filter\Basic\Strip">Strip</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/ImagineAware.html#method_setImagine"><abbr title="Imagine\Filter\ImagineAware">ImagineAware</abbr>::setImagine</a>() &mdash; <em>Method in class <a href="Imagine/Filter/ImagineAware.html"><abbr title="Imagine\Filter\ImagineAware">ImagineAware</abbr></a></em></dt> <dd>Set ImagineInterface instance.</dd><dt><a href="Imagine/Filter/Transformation.html#method_strip"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::strip</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Remove all profiles and comments</dd><dt><a href="Imagine/Filter/Transformation.html#method_save"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::save</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported</dd><dt><a href="Imagine/Filter/Transformation.html#method_show"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::show</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Outputs the image content</dd><dt><a href="Imagine/Gd/Image.html#method_save"><abbr title="Imagine\Gd\Image">Image</abbr>::save</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported</dd><dt><a href="Imagine/Gd/Image.html#method_show"><abbr title="Imagine\Gd\Image">Image</abbr>::show</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Outputs the image content</dd><dt><a href="Imagine/Gd/Image.html#method_strip"><abbr title="Imagine\Gd\Image">Image</abbr>::strip</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Remove all profiles and comments</dd><dt><a href="Imagine/Gmagick/Image.html#method_strip"><abbr title="Imagine\Gmagick\Image">Image</abbr>::strip</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Remove all profiles and comments</dd><dt><a href="Imagine/Gmagick/Image.html#method_save"><abbr title="Imagine\Gmagick\Image">Image</abbr>::save</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported</dd><dt><a href="Imagine/Gmagick/Image.html#method_show"><abbr title="Imagine\Gmagick\Image">Image</abbr>::show</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Outputs the image content</dd><dt><a href="Imagine/Image/Box.html#method_scale"><abbr title="Imagine\Image\Box">Box</abbr>::scale</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Creates new BoxInterface instance with ratios applied to both sides</dd><dt><a href="Imagine/Image/Box.html#method_square"><abbr title="Imagine\Image\Box">Box</abbr>::square</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Gets current box square, useful for getting total number of pixels in a given box</dd><dt><a href="Imagine/Image/BoxInterface.html#method_scale"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::scale</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Creates new BoxInterface instance with ratios applied to both sides</dd><dt><a href="Imagine/Image/BoxInterface.html#method_square"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::square</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Gets current box square, useful for getting total number of pixels in a given box</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_save"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::save</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_show"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::show</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Outputs the image content</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_strip"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::strip</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Remove all profiles and comments</dd><dt><a href="Imagine/Imagick/Image.html#method_strip"><abbr title="Imagine\Imagick\Image">Image</abbr>::strip</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Remove all profiles and comments</dd><dt><a href="Imagine/Imagick/Image.html#method_save"><abbr title="Imagine\Imagick\Image">Image</abbr>::save</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported</dd><dt><a href="Imagine/Imagick/Image.html#method_show"><abbr title="Imagine\Imagick\Image">Image</abbr>::show</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Outputs the image content</dd> </dl><h2 id="letterT">T</h2> <dl id="index"><dt><a href="Imagine/Draw/DrawerInterface.html#method_text"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr>::text</a>() &mdash; <em>Method in class <a href="Imagine/Draw/DrawerInterface.html"><abbr title="Imagine\Draw\DrawerInterface">DrawerInterface</abbr></a></em></dt> <dd>Annotates image with specified text at a given position starting on the top left of the final text box</dd><dt><a href="Imagine/Filter/Basic/Thumbnail.html"><abbr title="Imagine\Filter\Basic\Thumbnail">Thumbnail</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter/Basic.html">Imagine\Filter\Basic</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Filter.html">Imagine\Filter</a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Transformation.html#method_thumbnail"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::thumbnail</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Generates a thumbnail from a current image Returns it as a new image, doesn&#039;t modify the current image</dd><dt><a href="Imagine/Gd/Drawer.html#method_text"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::text</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Annotates image with specified text at a given position starting on the top left of the final text box</dd><dt><a href="Imagine/Gd/Image.html#method_thumbnail"><abbr title="Imagine\Gd\Image">Image</abbr>::thumbnail</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Generates a thumbnail from a current image Returns it as a new image, doesn&#039;t modify the current image</dd><dt><a href="Imagine/Gmagick/Drawer.html#method_text"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::text</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd>Annotates image with specified text at a given position starting on the top left of the final text box</dd><dt><a href="Imagine/Gmagick/Image.html#method_thumbnail"><abbr title="Imagine\Gmagick\Image">Image</abbr>::thumbnail</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Generates a thumbnail from a current image Returns it as a new image, doesn&#039;t modify the current image</dd><dt><a href="Imagine/Image/ManipulatorInterface.html#method_thumbnail"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr>::thumbnail</a>() &mdash; <em>Method in class <a href="Imagine/Image/ManipulatorInterface.html"><abbr title="Imagine\Image\ManipulatorInterface">ManipulatorInterface</abbr></a></em></dt> <dd>Generates a thumbnail from a current image Returns it as a new image, doesn&#039;t modify the current image</dd><dt><a href="Imagine/Imagick/Drawer.html#method_text"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::text</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd>Annotates image with specified text at a given position starting on the top left of the final text box</dd><dt><a href="Imagine/Imagick/Image.html#method_thumbnail"><abbr title="Imagine\Imagick\Image">Image</abbr>::thumbnail</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Generates a thumbnail from a current image Returns it as a new image, doesn&#039;t modify the current image</dd><dt><a href="Imagine/Test/Constraint/IsImageEqual.html#method_toString"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr>::toString</a>() &mdash; <em>Method in class <a href="Imagine/Test/Constraint/IsImageEqual.html"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr></a></em></dt> <dd>{@inheritdoc}</dd> </dl><h2 id="letterV">V</h2> <dl id="index"><dt><a href="Imagine/Image/Fill/Gradient/Vertical.html"><abbr title="Imagine\Image\Fill\Gradient\Vertical">Vertical</abbr></a> &mdash; <em>Class in namespace <a href="Imagine/Image/Fill/Gradient.html">Imagine\Image\Fill\Gradient</a></em></dt> <dd></dd> </dl><h2 id="letterW">W</h2> <dl id="index"><dt><a href="Imagine/Image/Box.html#method_widen"><abbr title="Imagine\Image\Box">Box</abbr>::widen</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Resizes box to given width, constraining proportions and returns the new box</dd><dt><a href="Imagine/Image/BoxInterface.html#method_widen"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::widen</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Resizes box to given width, constraining proportions and returns the new box</dd> </dl><h2 id="letter_">_</h2> <dl id="index"><dt><a href="Imagine/Filter/Advanced/Border.html#method___construct"><abbr title="Imagine\Filter\Advanced\Border">Border</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/Border.html"><abbr title="Imagine\Filter\Advanced\Border">Border</abbr></a></em></dt> <dd>Constructs Border filter with given color, width and height</dd><dt><a href="Imagine/Filter/Advanced/Canvas.html#method___construct"><abbr title="Imagine\Filter\Advanced\Canvas">Canvas</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/Canvas.html"><abbr title="Imagine\Filter\Advanced\Canvas">Canvas</abbr></a></em></dt> <dd>Constructs Canvas filter with given width and height and the placement of the current image inside the new canvas</dd><dt><a href="Imagine/Filter/Advanced/Grayscale.html#method___construct"><abbr title="Imagine\Filter\Advanced\Grayscale">Grayscale</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/Grayscale.html"><abbr title="Imagine\Filter\Advanced\Grayscale">Grayscale</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Advanced/OnPixelBased.html#method___construct"><abbr title="Imagine\Filter\Advanced\OnPixelBased">OnPixelBased</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Advanced/OnPixelBased.html"><abbr title="Imagine\Filter\Advanced\OnPixelBased">OnPixelBased</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/ApplyMask.html#method___construct"><abbr title="Imagine\Filter\Basic\ApplyMask">ApplyMask</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/ApplyMask.html"><abbr title="Imagine\Filter\Basic\ApplyMask">ApplyMask</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Crop.html#method___construct"><abbr title="Imagine\Filter\Basic\Crop">Crop</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Crop.html"><abbr title="Imagine\Filter\Basic\Crop">Crop</abbr></a></em></dt> <dd>Constructs a Crop filter with given x, y, coordinates and crop width and height values</dd><dt><a href="Imagine/Filter/Basic/Fill.html#method___construct"><abbr title="Imagine\Filter\Basic\Fill">Fill</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Fill.html"><abbr title="Imagine\Filter\Basic\Fill">Fill</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Filter/Basic/Paste.html#method___construct"><abbr title="Imagine\Filter\Basic\Paste">Paste</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Paste.html"><abbr title="Imagine\Filter\Basic\Paste">Paste</abbr></a></em></dt> <dd>Constructs a Paste filter with given ImageInterface to paste and x, y coordinates of target position</dd><dt><a href="Imagine/Filter/Basic/Resize.html#method___construct"><abbr title="Imagine\Filter\Basic\Resize">Resize</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Resize.html"><abbr title="Imagine\Filter\Basic\Resize">Resize</abbr></a></em></dt> <dd>Constructs Resize filter with given width and height</dd><dt><a href="Imagine/Filter/Basic/Rotate.html#method___construct"><abbr title="Imagine\Filter\Basic\Rotate">Rotate</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Rotate.html"><abbr title="Imagine\Filter\Basic\Rotate">Rotate</abbr></a></em></dt> <dd>Constructs Rotate filter with given angle and background color</dd><dt><a href="Imagine/Filter/Basic/Save.html#method___construct"><abbr title="Imagine\Filter\Basic\Save">Save</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Save.html"><abbr title="Imagine\Filter\Basic\Save">Save</abbr></a></em></dt> <dd>Constructs Save filter with given path and options</dd><dt><a href="Imagine/Filter/Basic/Show.html#method___construct"><abbr title="Imagine\Filter\Basic\Show">Show</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Show.html"><abbr title="Imagine\Filter\Basic\Show">Show</abbr></a></em></dt> <dd>Constructs the Show filter with given format and options</dd><dt><a href="Imagine/Filter/Basic/Thumbnail.html#method___construct"><abbr title="Imagine\Filter\Basic\Thumbnail">Thumbnail</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Basic/Thumbnail.html"><abbr title="Imagine\Filter\Basic\Thumbnail">Thumbnail</abbr></a></em></dt> <dd>Constructs the Thumbnail filter with given width, height and mode</dd><dt><a href="Imagine/Filter/Transformation.html#method___construct"><abbr title="Imagine\Filter\Transformation">Transformation</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Filter/Transformation.html"><abbr title="Imagine\Filter\Transformation">Transformation</abbr></a></em></dt> <dd>Class constructor.</dd><dt><a href="Imagine/Gd/Drawer.html#method___construct"><abbr title="Imagine\Gd\Drawer">Drawer</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Drawer.html"><abbr title="Imagine\Gd\Drawer">Drawer</abbr></a></em></dt> <dd>Constructs Drawer with a given gd image resource</dd><dt><a href="Imagine/Gd/Effects.html#method___construct"><abbr title="Imagine\Gd\Effects">Effects</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Effects.html"><abbr title="Imagine\Gd\Effects">Effects</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Gd/Image.html#method___construct"><abbr title="Imagine\Gd\Image">Image</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Constructs a new Image instance using the result of imagecreatetruecolor()</dd><dt><a href="Imagine/Gd/Image.html#method___destruct"><abbr title="Imagine\Gd\Image">Image</abbr>::__destruct</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Makes sure the current image resource is destroyed</dd><dt><a href="Imagine/Gd/Image.html#method___toString"><abbr title="Imagine\Gd\Image">Image</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Image.html"><abbr title="Imagine\Gd\Image">Image</abbr></a></em></dt> <dd>Returns the image content as a PNG binary string</dd><dt><a href="Imagine/Gd/Imagine.html#method___construct"><abbr title="Imagine\Gd\Imagine">Imagine</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gd/Imagine.html"><abbr title="Imagine\Gd\Imagine">Imagine</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Drawer.html#method___construct"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Drawer.html"><abbr title="Imagine\Gmagick\Drawer">Drawer</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Effects.html#method___construct"><abbr title="Imagine\Gmagick\Effects">Effects</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Effects.html"><abbr title="Imagine\Gmagick\Effects">Effects</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Gmagick/Font.html#method___construct"><abbr title="Imagine\Gmagick\Font">Font</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Font.html"><abbr title="Imagine\Gmagick\Font">Font</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd><dt><a href="Imagine/Gmagick/Image.html#method___construct"><abbr title="Imagine\Gmagick\Image">Image</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Constructs Image with Gmagick and Imagine instances</dd><dt><a href="Imagine/Gmagick/Image.html#method___destruct"><abbr title="Imagine\Gmagick\Image">Image</abbr>::__destruct</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Destroys allocated gmagick resources</dd><dt><a href="Imagine/Gmagick/Image.html#method___toString"><abbr title="Imagine\Gmagick\Image">Image</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Image.html"><abbr title="Imagine\Gmagick\Image">Image</abbr></a></em></dt> <dd>Returns the image content as a PNG binary string</dd><dt><a href="Imagine/Gmagick/Imagine.html#method___construct"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Gmagick/Imagine.html"><abbr title="Imagine\Gmagick\Imagine">Imagine</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/AbstractFont.html#method___construct"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/AbstractFont.html"><abbr title="Imagine\Image\AbstractFont">AbstractFont</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd><dt><a href="Imagine/Image/Box.html#method___construct"><abbr title="Imagine\Image\Box">Box</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Constructs the Size with given width and height</dd><dt><a href="Imagine/Image/Box.html#method___toString"><abbr title="Imagine\Image\Box">Box</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/Box.html"><abbr title="Imagine\Image\Box">Box</abbr></a></em></dt> <dd>Returns a string representation of the current box</dd><dt><a href="Imagine/Image/BoxInterface.html#method___toString"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/BoxInterface.html"><abbr title="Imagine\Image\BoxInterface">BoxInterface</abbr></a></em></dt> <dd>Returns a string representation of the current box</dd><dt><a href="Imagine/Image/Color.html#method___construct"><abbr title="Imagine\Image\Color">Color</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Constructs image color, e.g.: - new Color(&#039;fff&#039;) - will produce non-transparent white color - new Color(&#039;ffffff&#039;, 50) - will product 50% transparent white - new Color(array(255, 255, 255)) - another way of getting white - new Color(0x00FF00) - hexadecimal notation for green</dd><dt><a href="Imagine/Image/Color.html#method___toString"><abbr title="Imagine\Image\Color">Color</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/Color.html"><abbr title="Imagine\Image\Color">Color</abbr></a></em></dt> <dd>Returns hex representation of the color</dd><dt><a href="Imagine/Image/Fill/Gradient/Linear.html#method___construct"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Fill/Gradient/Linear.html"><abbr title="Imagine\Image\Fill\Gradient\Linear">Linear</abbr></a></em></dt> <dd>Constructs a linear gradient with overall gradient length, and start and end shades, which default to 0 and 255 accordingly</dd><dt><a href="Imagine/Image/Histogram/Bucket.html#method___construct"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Histogram/Bucket.html"><abbr title="Imagine\Image\Histogram\Bucket">Bucket</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/Histogram/Range.html#method___construct"><abbr title="Imagine\Image\Histogram\Range">Range</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Histogram/Range.html"><abbr title="Imagine\Image\Histogram\Range">Range</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Image/ImageInterface.html#method___toString"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/ImageInterface.html"><abbr title="Imagine\Image\ImageInterface">ImageInterface</abbr></a></em></dt> <dd>Returns the image content as a PNG binary string</dd><dt><a href="Imagine/Image/Point.html#method___construct"><abbr title="Imagine\Image\Point">Point</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a></em></dt> <dd>Constructs a point of coordinates</dd><dt><a href="Imagine/Image/Point.html#method___toString"><abbr title="Imagine\Image\Point">Point</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point.html"><abbr title="Imagine\Image\Point">Point</abbr></a></em></dt> <dd>Gets a string representation for the current point</dd><dt><a href="Imagine/Image/PointInterface.html#method___toString"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/PointInterface.html"><abbr title="Imagine\Image\PointInterface">PointInterface</abbr></a></em></dt> <dd>Gets a string representation for the current point</dd><dt><a href="Imagine/Image/Point/Center.html#method___construct"><abbr title="Imagine\Image\Point\Center">Center</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a></em></dt> <dd>Constructs coordinate with size instance, it needs to be relative to</dd><dt><a href="Imagine/Image/Point/Center.html#method___toString"><abbr title="Imagine\Image\Point\Center">Center</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Image/Point/Center.html"><abbr title="Imagine\Image\Point\Center">Center</abbr></a></em></dt> <dd>Gets a string representation for the current point</dd><dt><a href="Imagine/Imagick/Drawer.html#method___construct"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Drawer.html"><abbr title="Imagine\Imagick\Drawer">Drawer</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Effects.html#method___construct"><abbr title="Imagine\Imagick\Effects">Effects</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Effects.html"><abbr title="Imagine\Imagick\Effects">Effects</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Imagick/Font.html#method___construct"><abbr title="Imagine\Imagick\Font">Font</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Font.html"><abbr title="Imagine\Imagick\Font">Font</abbr></a></em></dt> <dd>Constructs a font with specified $file, $size and $color</dd><dt><a href="Imagine/Imagick/Image.html#method___construct"><abbr title="Imagine\Imagick\Image">Image</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Constructs Image with Imagick and Imagine instances</dd><dt><a href="Imagine/Imagick/Image.html#method___destruct"><abbr title="Imagine\Imagick\Image">Image</abbr>::__destruct</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Destroys allocated imagick resources</dd><dt><a href="Imagine/Imagick/Image.html#method___toString"><abbr title="Imagine\Imagick\Image">Image</abbr>::__toString</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Image.html"><abbr title="Imagine\Imagick\Image">Image</abbr></a></em></dt> <dd>Returns the image content as a PNG binary string</dd><dt><a href="Imagine/Imagick/Imagine.html#method___construct"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Imagick/Imagine.html"><abbr title="Imagine\Imagick\Imagine">Imagine</abbr></a></em></dt> <dd></dd><dt><a href="Imagine/Test/Constraint/IsImageEqual.html#method___construct"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr>::__construct</a>() &mdash; <em>Method in class <a href="Imagine/Test/Constraint/IsImageEqual.html"><abbr title="Imagine\Test\Constraint\IsImageEqual">IsImageEqual</abbr></a></em></dt> <dd></dd> </dl> </div> <div id="footer"> Generated by <a href="http://sami.sensiolabs.org/" target="_top">Sami, the API Documentation Generator</a>. </div> </body> </html>
package levigo // #cgo LDFLAGS: -lleveldb // #include "leveldb/c.h" import "C" // CompressionOpt is a value for Options.SetCompression. type CompressionOpt int // Known compression arguments for Options.SetCompression. const ( NoCompression = CompressionOpt(0) SnappyCompression = CompressionOpt(1) ) // Options represent all of the available options when opening a database with // Open. Options should be created with NewOptions. // // It is usually with to call SetCache with a cache object. Otherwise, all // data will be read off disk. // // To prevent memory leaks, Close must be called on an Options when the // program no longer needs it. type Options struct { Opt *C.leveldb_options_t } // ReadOptions represent all of the available options when reading from a // database. // // To prevent memory leaks, Close must called on a ReadOptions when the // program no longer needs it. type ReadOptions struct { Opt *C.leveldb_readoptions_t } // WriteOptions represent all of the available options when writeing from a // database. // // To prevent memory leaks, Close must called on a WriteOptions when the // program no longer needs it. type WriteOptions struct { Opt *C.leveldb_writeoptions_t } // NewOptions allocates a new Options object. func NewOptions() *Options { opt := C.leveldb_options_create() return &Options{opt} } // NewReadOptions allocates a new ReadOptions object. func NewReadOptions() *ReadOptions { opt := C.leveldb_readoptions_create() return &ReadOptions{opt} } // NewWriteOptions allocates a new WriteOptions object. func NewWriteOptions() *WriteOptions { opt := C.leveldb_writeoptions_create() return &WriteOptions{opt} } // Close deallocates the Options, freeing its underlying C struct. func (o *Options) Close() { C.leveldb_options_destroy(o.Opt) } // SetComparator sets the comparator to be used for all read and write // operations. // // The comparator that created a database must be the same one (technically, // one with the same name string) that is used to perform read and write // operations. // // The default comparator is usually sufficient. func (o *Options) SetComparator(cmp *C.leveldb_comparator_t) { C.leveldb_options_set_comparator(o.Opt, cmp) } // SetErrorIfExists, if passed true, will cause the opening of a database that // already exists to throw an error. func (o *Options) SetErrorIfExists(error_if_exists bool) { eie := boolToUchar(error_if_exists) C.leveldb_options_set_error_if_exists(o.Opt, eie) } // SetCache places a cache object in the database when a database is opened. // // This is usually wise to use. See also ReadOptions.SetFillCache. func (o *Options) SetCache(cache *Cache) { C.leveldb_options_set_cache(o.Opt, cache.Cache) } // SetEnv sets the Env object for the new database handle. func (o *Options) SetEnv(env *Env) { C.leveldb_options_set_env(o.Opt, env.Env) } // SetInfoLog sets a *C.leveldb_logger_t object as the informational logger // for the database. func (o *Options) SetInfoLog(log *C.leveldb_logger_t) { C.leveldb_options_set_info_log(o.Opt, log) } // SetWriteBufferSize sets the number of bytes the database will build up in // memory (backed by an unsorted log on disk) before converting to a sorted // on-disk file. func (o *Options) SetWriteBufferSize(s int) { C.leveldb_options_set_write_buffer_size(o.Opt, C.size_t(s)) } // SetParanoidChecks, when called with true, will cause the database to do // aggressive checking of the data it is processing and will stop early if it // detects errors. // // See the LevelDB documentation docs for details. func (o *Options) SetParanoidChecks(pc bool) { C.leveldb_options_set_paranoid_checks(o.Opt, boolToUchar(pc)) } // SetMaxOpenFiles sets the number of files than can be used at once by the // database. // // See the LevelDB documentation for details. func (o *Options) SetMaxOpenFiles(n int) { C.leveldb_options_set_max_open_files(o.Opt, C.int(n)) } // SetBlockSize sets the approximate size of user data packed per block. // // The default is roughly 4096 uncompressed bytes. A better setting depends on // your use case. See the LevelDB documentation for details. func (o *Options) SetBlockSize(s int) { C.leveldb_options_set_block_size(o.Opt, C.size_t(s)) } // SetBlockRestartInterval is the number of keys between restarts points for // delta encoding keys. // // Most clients should leave this parameter alone. See the LevelDB // documentation for details. func (o *Options) SetBlockRestartInterval(n int) { C.leveldb_options_set_block_restart_interval(o.Opt, C.int(n)) } // SetCompression sets whether to compress blocks using the specified // compresssion algorithm. // // The default value is SnappyCompression and it is fast enough that it is // unlikely you want to turn it off. The other option is NoCompression. // // If the LevelDB library was built without Snappy compression enabled, the // SnappyCompression setting will be ignored. func (o *Options) SetCompression(t CompressionOpt) { C.leveldb_options_set_compression(o.Opt, C.int(t)) } // SetCreateIfMissing causes Open to create a new database on disk if it does // not already exist. func (o *Options) SetCreateIfMissing(b bool) { C.leveldb_options_set_create_if_missing(o.Opt, boolToUchar(b)) } // SetFilterPolicy causes Open to create a new database that will uses filter // created from the filter policy passed in. func (o *Options) SetFilterPolicy(fp *FilterPolicy) { var policy *C.leveldb_filterpolicy_t if fp != nil { policy = fp.Policy } C.leveldb_options_set_filter_policy(o.Opt, policy) } // Close deallocates the ReadOptions, freeing its underlying C struct. func (ro *ReadOptions) Close() { C.leveldb_readoptions_destroy(ro.Opt) } // SetVerifyChecksums controls whether all data read with this ReadOptions // will be verified against corresponding checksums. // // It defaults to false. See the LevelDB documentation for details. func (ro *ReadOptions) SetVerifyChecksums(b bool) { C.leveldb_readoptions_set_verify_checksums(ro.Opt, boolToUchar(b)) } // SetFillCache controls whether reads performed with this ReadOptions will // fill the Cache of the server. It defaults to true. // // It is useful to turn this off on ReadOptions for DB.Iterator (and DB.Get) // calls used in offline threads to prevent bulk scans from flushing out live // user data in the cache. // // See also Options.SetCache func (ro *ReadOptions) SetFillCache(b bool) { C.leveldb_readoptions_set_fill_cache(ro.Opt, boolToUchar(b)) } // SetSnapshot causes reads to provided as they were when the passed in // Snapshot was created by DB.NewSnapshot. This is useful for getting // consistent reads during a bulk operation. // // See the LevelDB documentation for details. func (ro *ReadOptions) SetSnapshot(snap *Snapshot) { var s *C.leveldb_snapshot_t if snap != nil { s = snap.snap } C.leveldb_readoptions_set_snapshot(ro.Opt, s) } // Close deallocates the WriteOptions, freeing its underlying C struct. func (wo *WriteOptions) Close() { C.leveldb_writeoptions_destroy(wo.Opt) } // SetSync controls whether each write performed with this WriteOptions will // be flushed from the operating system buffer cache before the write is // considered complete. // // If called with true, this will signficantly slow down writes. If called // with false, and the host machine crashes, some recent writes may be // lost. The default is false. // // See the LevelDB documentation for details. func (wo *WriteOptions) SetSync(b bool) { C.leveldb_writeoptions_set_sync(wo.Opt, boolToUchar(b)) }
version https://git-lfs.github.com/spec/v1 oid sha256:ac03974d85317d75edc2dc62eb1c40e9514aae0dcfe5e69e3a62c6d419484632 size 887
echo " " >> "${PREFIX}"/.messages.txt echo " " >> "${PREFIX}"/.messages.txt echo " #######################################################################" >> "${PREFIX}"/.messages.txt echo " # #" >> "${PREFIX}"/.messages.txt echo " # ###### ## ## #### ######## #" >> "${PREFIX}"/.messages.txt echo " # ## ## ### ### ## ## ## #" >> "${PREFIX}"/.messages.txt echo " # ## #### #### ## ## ## #" >> "${PREFIX}"/.messages.txt echo " # ## ## ### ## ## ######## #" >> "${PREFIX}"/.messages.txt echo " # ## ## ## ## ## #" >> "${PREFIX}"/.messages.txt echo " # ## ## ## ## ## ## #" >> "${PREFIX}"/.messages.txt echo " # ###### ## ## #### ## #" >> "${PREFIX}"/.messages.txt echo " # #" >> "${PREFIX}"/.messages.txt echo " # Classical Molecular Interaction Potential #" >> "${PREFIX}"/.messages.txt echo " # J. Ll. Gelpi 1999 - 2021 #" >> "${PREFIX}"/.messages.txt echo " # #" >> "${PREFIX}"/.messages.txt echo " # For help/usage options execute: #" >> "${PREFIX}"/.messages.txt echo " # cmip -h #" >> "${PREFIX}"/.messages.txt echo " # titration -h #" >> "${PREFIX}"/.messages.txt echo " # watden -h #" >> "${PREFIX}"/.messages.txt echo " # canal -h #" >> "${PREFIX}"/.messages.txt echo " # avgEpsGrid -h #" >> "${PREFIX}"/.messages.txt echo " # surfnet2binaryGrid -h #" >> "${PREFIX}"/.messages.txt echo " # grd2cube -h #" >> "${PREFIX}"/.messages.txt echo " # getPatch -h #" >> "${PREFIX}"/.messages.txt echo " # #" >> "${PREFIX}"/.messages.txt echo " # To run the test set execute: #" >> "${PREFIX}"/.messages.txt echo " # \$CONDA_PREFIX/share/cmip/tests/tests.sh #" >> "${PREFIX}"/.messages.txt echo " # #" >> "${PREFIX}"/.messages.txt echo " # To run some predefined scripts check this folder: #" >> "${PREFIX}"/.messages.txt echo " # \$CONDA_PREFIX/share/cmip/scripts #" >> "${PREFIX}"/.messages.txt echo " # #" >> "${PREFIX}"/.messages.txt echo " #######################################################################" >> "${PREFIX}"/.messages.txt
version https://git-lfs.github.com/spec/v1 oid sha256:98117aa63db915fed8f72d5c0c414049013e63982817c75864b5e01bb3997090 size 17927
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { using Azure; using Management; using Network; using Rest; using Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// <summary> /// Public IP address resource. /// </summary> [JsonTransformation] public partial class PublicIPAddress : Resource { /// <summary> /// Initializes a new instance of the PublicIPAddress class. /// </summary> public PublicIPAddress() { } /// <summary> /// Initializes a new instance of the PublicIPAddress class. /// </summary> /// <param name="id">Resource ID.</param> /// <param name="name">Resource name.</param> /// <param name="type">Resource type.</param> /// <param name="location">Resource location.</param> /// <param name="tags">Resource tags.</param> /// <param name="publicIPAllocationMethod">The public IP allocation /// method. Possible values are: 'Static' and 'Dynamic'. Possible /// values include: 'Static', 'Dynamic'</param> /// <param name="publicIPAddressVersion">The public IP address version. /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: /// 'IPv4', 'IPv6'</param> /// <param name="dnsSettings">The FQDN of the DNS record associated /// with the public IP address.</param> /// <param name="idleTimeoutInMinutes">The idle timeout of the public /// IP address.</param> /// <param name="resourceGuid">The resource GUID property of the public /// IP resource.</param> /// <param name="provisioningState">The provisioning state of the /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'.</param> /// <param name="etag">A unique read-only string that changes whenever /// the resource is updated.</param> public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { PublicIPAllocationMethod = publicIPAllocationMethod; PublicIPAddressVersion = publicIPAddressVersion; IpConfiguration = ipConfiguration; DnsSettings = dnsSettings; IpAddress = ipAddress; IdleTimeoutInMinutes = idleTimeoutInMinutes; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; Etag = etag; } /// <summary> /// Gets or sets the public IP allocation method. Possible values are: /// 'Static' and 'Dynamic'. Possible values include: 'Static', /// 'Dynamic' /// </summary> [JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] public string PublicIPAllocationMethod { get; set; } /// <summary> /// Gets or sets the public IP address version. Possible values are: /// 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// </summary> [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] public string PublicIPAddressVersion { get; set; } /// <summary> /// </summary> [JsonProperty(PropertyName = "properties.ipConfiguration")] public IPConfiguration IpConfiguration { get; protected set; } /// <summary> /// Gets or sets the FQDN of the DNS record associated with the public /// IP address. /// </summary> [JsonProperty(PropertyName = "properties.dnsSettings")] public PublicIPAddressDnsSettings DnsSettings { get; set; } /// <summary> /// </summary> [JsonProperty(PropertyName = "properties.ipAddress")] public string IpAddress { get; set; } /// <summary> /// Gets or sets the idle timeout of the public IP address. /// </summary> [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// <summary> /// Gets or sets the resource GUID property of the public IP resource. /// </summary> [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// <summary> /// Gets or sets the provisioning state of the PublicIP resource. /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// </summary> [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// <summary> /// Gets or sets a unique read-only string that changes whenever the /// resource is updated. /// </summary> [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } }
/* * Copyright (c) 2002-2008 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * 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 'LWJGL' 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. */ package org.lwjgl.opengl; public interface ATI_texture_float { /** * Accepted by the &lt;internalFormat&gt; parameter of TexImage1D, * TexImage2D, and TexImage3D: */ int GL_RGBA_FLOAT32_ATI = 0x8814; int GL_RGB_FLOAT32_ATI = 0x8815; int GL_ALPHA_FLOAT32_ATI = 0x8816; int GL_INTENSITY_FLOAT32_ATI = 0x8817; int GL_LUMINANCE_FLOAT32_ATI = 0x8818; int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; int GL_RGBA_FLOAT16_ATI = 0x881A; int GL_RGB_FLOAT16_ATI = 0x881B; int GL_ALPHA_FLOAT16_ATI = 0x881C; int GL_INTENSITY_FLOAT16_ATI = 0x881D; int GL_LUMINANCE_FLOAT16_ATI = 0x881E; int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Xunit; namespace NetCoreXunitTestLibrary { public class UnitTest1 { [Fact] public void Test1() { Assert.Equal("Hello", NetCoreLibrary.Class1.SayHello()); } } }
<?php namespace Kunstmaan\AdminListBundle\AdminList\FilterType\DBAL; use DateTime; use Symfony\Component\HttpFoundation\Request; /** * DateTimeFilterType */ class DateTimeFilterType extends AbstractDBALFilterType { /** * @param Request $request The request * @param array &$data The data * @param string $uniqueId The unique identifier */ public function bindRequest(Request $request, array &$data, $uniqueId) { $data['comparator'] = $request->query->get('filter_comparator_' . $uniqueId); $data['value'] = $request->query->get('filter_value_' . $uniqueId); } /** * @param array $data The data * @param string $uniqueId The unique identifier */ public function apply(array $data, $uniqueId) { if (isset($data['value']) && isset($data['comparator'])) { /** @var DateTime $datetime */ $date = empty($data['value']['date']) ? date('d/m/Y') : $data['value']['date']; $time = empty($data['value']['time']) ? date('H:i') : $data['value']['time']; $dateTime = DateTime::createFromFormat('d/m/Y H:i', $date . ' ' . $time); if (false === $dateTime) { // Failed to create DateTime object. return; } switch ($data['comparator']) { case 'before': $this->queryBuilder->andWhere($this->queryBuilder->expr()->lte($this->getAlias() . $this->columnName, ':var_' . $uniqueId)); break; case 'after': $this->queryBuilder->andWhere($this->queryBuilder->expr()->gt($this->getAlias() . $this->columnName, ':var_' . $uniqueId)); break; } $this->queryBuilder->setParameter('var_' . $uniqueId, $dateTime->format('Y-m-d H:i')); } } /** * @return string */ public function getTemplate() { return 'KunstmaanAdminListBundle:FilterType:dateTimeFilter.html.twig'; } }
module Fog module Radosgw VERSION = "0.0.4" end end
# Angular service worker introduction Service workers augment the traditional web deployment model and empower applications to deliver a user experience with the reliability and performance on par with natively-installed code. Adding a service worker to an Angular application is one of the steps for turning an application into a [Progressive Web App](https://developers.google.com/web/progressive-web-apps/) (also known as a PWA). At its simplest, a service worker is a script that runs in the web browser and manages caching for an application. Service workers function as a network proxy. They intercept all outgoing HTTP requests made by the application and can choose how to respond to them. For example, they can query a local cache and deliver a cached response if one is available. Proxying isn't limited to requests made through programmatic APIs, such as `fetch`; it also includes resources referenced in HTML and even the initial request to `index.html`. Service worker-based caching is thus completely programmable and doesn't rely on server-specified caching headers. Unlike the other scripts that make up an application, such as the Angular app bundle, the service worker is preserved after the user closes the tab. The next time that browser loads the application, the service worker loads first, and can intercept every request for resources to load the application. If the service worker is designed to do so, it can *completely satisfy the loading of the application, without the need for the network*. Even across a fast reliable network, round-trip delays can introduce significant latency when loading the application. Using a service worker to reduce dependency on the network can significantly improve the user experience. ## Service workers in Angular Angular applications, as single-page applications, are in a prime position to benefit from the advantages of service workers. Starting with version 5.0.0, Angular ships with a service worker implementation. Angular developers can take advantage of this service worker and benefit from the increased reliability and performance it provides, without needing to code against low-level APIs. Angular's service worker is designed to optimize the end user experience of using an application over a slow or unreliable network connection, while also minimizing the risks of serving outdated content. The Angular service worker's behavior follows that design goal: * Caching an application is like installing a native application. The application is cached as one unit, and all files update together. * A running application continues to run with the same version of all files. It does not suddenly start receiving cached files from a newer version, which are likely incompatible. * When users refresh the application, they see the latest fully cached version. New tabs load the latest cached code. * Updates happen in the background, relatively quickly after changes are published. The previous version of the application is served until an update is installed and ready. * The service worker conserves bandwidth when possible. Resources are only downloaded if they've changed. To support these behaviors, the Angular service worker loads a *manifest* file from the server. The manifest describes the resources to cache and includes hashes of every file's contents. When an update to the application is deployed, the contents of the manifest change, informing the service worker that a new version of the application should be downloaded and cached. This manifest is generated from a CLI-generated configuration file called `ngsw-config.json`. Installing the Angular service worker is as simple as including an `NgModule`. In addition to registering the Angular service worker with the browser, this also makes a few services available for injection which interact with the service worker and can be used to control it. For example, an application can ask to be notified when a new update becomes available, or an application can ask the service worker to check the server for available updates. ## Prerequisites To make use of all the features of Angular service worker, use the latest versions of Angular and the Angular CLI. In order for service workers to be registered, the app must be accessed over HTTPS, not HTTP. Browsers ignore service workers on pages that are served over an insecure connection. The reason is that service workers are quite powerful, so extra care needs to be taken to ensure the service worker script has not been tampered with. There is one exception to this rule: to make local development easier, browsers do _not_ require a secure connection when accessing an app on `localhost`. ### Browser support To benefit from the Angular service worker, your app must run in a web browser that supports service workers in general. Currently, service workers are supported in the latest versions of Chrome, Firefox, Edge, Safari, Opera, UC Browser (Android version) and Samsung Internet. Browsers like IE and Opera Mini do not support service workers. If the user is accessing your app via a browser that does not support service workers, the service worker is not registered and related behavior such as offline cache management and push notifications does not happen. More specifically: * The browser does not download the service worker script and `ngsw.json` manifest file. * Active attempts to interact with the service worker, such as calling `SwUpdate.checkForUpdate()`, return rejected promises. * The observable events of related services, such as `SwUpdate.available`, are not triggered. It is highly recommended that you ensure that your app works even without service worker support in the browser. Although an unsupported browser ignores service worker caching, it will still report errors if the app attempts to interact with the service worker. For example, calling `SwUpdate.checkForUpdate()` will return rejected promises. To avoid such an error, you can check whether the Angular service worker is enabled using `SwUpdate.isEnabled()`. To learn more about other browsers that are service worker ready, see the [Can I Use](https://caniuse.com/#feat=serviceworkers) page and [MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API). ## Related resources The rest of the articles in this section specifically address the Angular implementation of service workers. * [App Shell](guide/app-shell) * [Service Worker Communication](guide/service-worker-communications) * [Service Worker in Production](guide/service-worker-devops) * [Service Worker Configuration](guide/service-worker-config) For more information about service workers in general, see [Service Workers: an Introduction](https://developers.google.com/web/fundamentals/primers/service-workers/). For more information about browser support, see the [browser support](https://developers.google.com/web/fundamentals/primers/service-workers/#browser_support) section of [Service Workers: an Introduction](https://developers.google.com/web/fundamentals/primers/service-workers/), Jake Archibald's [Is Serviceworker ready?](https://jakearchibald.github.io/isserviceworkerready/), and [Can I Use](http://caniuse.com/#feat=serviceworkers). For additional recommendations and examples, see: * [Precaching with Angular Service Worker](https://web.dev/precaching-with-the-angular-service-worker/) * [Creating a PWA with Angular CLI](https://web.dev/creating-pwa-with-angular-cli/) ## Next steps To begin using Angular service workers, see [Getting Started with service workers](guide/service-worker-getting-started).
// Type definitions for bufferstream v0.6.2 // Project: https://github.com/dodo/node-bufferstream // Definitions by: Bart van der Schoor <https://github.com/Bartvds> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// <reference path="../node/node.d.ts" /> declare module 'bufferstream' { import stream = require('stream'); export = BufferStream; class BufferStream extends stream.Duplex { constructor(options?: BufferStream.Opts); /* different buffer behaviors can be triggered by size: none when output drains, bufferstream drains too flexible buffers everthing that it gets and not piping out <number> TODO buffer has given size. buffers everthing until buffer is full. when buffer is full then the stream will drain */ setSize(size: string): void; // can be one of ['none', 'flexible', <number>] setSize(size: number): void; // can be one of ['none', 'flexible', <number>] /* enables stream buffering default */ enable(): void; /* flushes buffer and disables stream buffering. BufferStream now pipes all data as long as the output accepting data. when the output is draining BufferStream will buffer all input temporary. token[s] buffer splitters (should be String or Buffer) disables given tokens. wont flush until no splitter tokens are left. */ disable(): void; disable(token: string, ...tokens: string[]): void; disable(tokens: string[]): void; // Array disable(token: Buffer, ...tokens: Buffer[]): void; disable(tokens: Buffer[]): void; // Array /* each time BufferStream finds a splitter token in the input data it will emit a split event. this also works for binary data. token[s] buffer splitters (should be String or Buffer) */ split(token: string, ...tokens: string[]): void; split(tokens: string[]): void; // Array split(token: Buffer, ...tokens: Buffer[]): void; split(tokens: Buffer[]): void; // Array /* returns Buffer. */ getBuffer(): Buffer; /* returns Buffer. */ buffer: Buffer; /* shortcut for buffer.toString() */ toString(): string; /* shortcut for buffer.length */ length: number; } namespace BufferStream { export interface Opts { /* default encoding for writing strings */ encoding?: string; /* if true and the source is a child_process the stream will block the entire process (timeouts wont work anymore, but splitting and listening on data still works, because they work sync) */ blocking?: boolean; /* defines buffer level or sets buffer to given size (see ↓setSize for more) */ size?: any; /* immediately call disable */ disabled?: boolean; /* short form for: split(token, function (chunk) {emit('data', chunk)}) */ // String or Buffer split?: any; } export var fn: {warn: boolean}; } } declare module 'bufferstream/postbuffer' { import http = require('http'); import BufferStream = require('bufferstream'); class PostBuffer extends BufferStream { /* for if you want to get all the post data from a http server request and do some db reqeust before. http client buffer */ constructor(req: http.IncomingMessage); /* set a callback to get all post data from a http server request */ onEnd(callback: (data: any) => void): void; /* pumps data into another stream to allow incoming streams given options will be passed to Stream.pipe */ pipe(stream: NodeJS.WritableStream, options?: BufferStream.Opts): NodeJS.ReadableStream; } export = PostBuffer; }
<p>This is the partial for view 1.</p>
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example - example-ngrepeat-select-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.6/angular.min.js"></script> <script src="app.js"></script> </head> <body ng-app="ngrepeatSelect"> <div ng-controller="ExampleController"> <form name="myForm"> <label for="repeatSelect"> Repeat select: </label> <select name="repeatSelect" id="repeatSelect" ng-model="data.repeatSelect"> <option ng-repeat="option in data.availableOptions" value="{{option.id}}">{{option.name}}</option> </select> </form> <hr> <tt>repeatSelect = {{data.repeatSelect}}</tt><br/> </div> </body> </html>
"use strict";import"../../Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js";
/** * Copyright (c) 2010-2015, openHAB.org 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.openhab.binding.ihc.ws; import java.util.List; import org.openhab.binding.ihc.ws.datatypes.WSBaseDataType; import org.openhab.binding.ihc.ws.datatypes.WSControllerState; import org.openhab.binding.ihc.ws.datatypes.WSFile; import org.openhab.binding.ihc.ws.datatypes.WSProjectInfo; /** * Class to handle IHC / ELKO LS Controller's controller service. * * Controller service is used to fetch information from the controller. * E.g. Project file or controller status. * * @author Pauli Anttila * @since 1.5.0 */ public class IhcControllerService extends IhcHttpsClient { private static String emptyQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soapenv:Body>" + "</soapenv:Body>" + "</soapenv:Envelope>"; private String url; List<String> cookies; IhcControllerService(String host) { url = "https://" + host + "/ws/ControllerService"; } public void setCookies(List<String> cookies) { this.cookies = cookies; } /** * Query project information from the controller. * * @return project information. * @throws IhcExecption */ public synchronized WSProjectInfo getProjectInfo() throws IhcExecption { openConnection(url); super.setCookies(cookies); setRequestProperty("SOAPAction", "getProjectInfo"); String response = sendQuery(emptyQuery); closeConnection(); WSProjectInfo projectInfo = new WSProjectInfo(); projectInfo.encodeData(response); return projectInfo; } /** * Query number of segments project contains. * * @return number of segments. */ public synchronized int getProjectNumberOfSegments() throws IhcExecption { openConnection(url); super.setCookies(cookies); setRequestProperty("SOAPAction", "getIHCProjectNumberOfSegments"); String response = sendQuery(emptyQuery); String numberOfSegments = WSBaseDataType.parseValue(response, "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:getIHCProjectNumberOfSegments1"); closeConnection(); return Integer.parseInt(numberOfSegments); } /** * Query segmentation size. * * @return segmentation size in bytes. */ public synchronized int getProjectSegmentationSize() throws IhcExecption { openConnection(url); super.setCookies(cookies); setRequestProperty("SOAPAction", "getIHCProjectSegmentationSize"); String response = sendQuery(emptyQuery); String segmentationSize = WSBaseDataType.parseValue(response, "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:getIHCProjectSegmentationSize1"); closeConnection(); return Integer.parseInt(segmentationSize); } /** * Query project segment data. * * @param index * segments index. * @param major * project major revision number. * @param minor * project minor revision number. * @return segments data. */ public synchronized WSFile getProjectSegment(int index, int major, int minor) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <ns1:getIHCProjectSegment1 xmlns:ns1=\"utcs\" xsi:type=\"xsd:int\">%s</ns1:getIHCProjectSegment1>" + " <ns2:getIHCProjectSegment2 xmlns:ns2=\"utcs\" xsi:type=\"xsd:int\">%s</ns2:getIHCProjectSegment2>" + " <ns3:getIHCProjectSegment3 xmlns:ns3=\"utcs\" xsi:type=\"xsd:int\">%s</ns3:getIHCProjectSegment3>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, index, major, minor); openConnection(url); super.setCookies(cookies); setRequestProperty("SOAPAction", "getIHCProjectSegment"); String response = sendQuery(query); closeConnection(); WSFile file = new WSFile(); file.encodeData(response); return file; } /** * Query controller current state. * * @return controller's current state. */ public synchronized WSControllerState getControllerState() throws IhcExecption { openConnection(url); super.setCookies(cookies); setRequestProperty("SOAPAction", "getState"); String response = sendQuery(emptyQuery); WSControllerState controllerState = new WSControllerState(); controllerState.encodeData(response); return controllerState; } /** * Wait controller state change notification. * * @param previousState * Previous controller state. * @param timeoutInSeconds * How many seconds to wait notifications. * @return current controller state. */ public synchronized WSControllerState waitStateChangeNotifications( WSControllerState previousState, int timeoutInSeconds) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soapenv:Header/>" + "<soapenv:Body>" + " <ns1:waitForControllerStateChange1 xmlns:ns1=\"utcs\" xsi:type=\"ns1:WSControllerState\">" + " <ns1:state xsi:type=\"xsd:string\">%s</ns1:state>" + " </ns1:waitForControllerStateChange1>" + " <ns2:waitForControllerStateChange2 xmlns:ns2=\"utcs\" xsi:type=\"xsd:int\">%s</ns2:waitForControllerStateChange2>" + "</soapenv:Body>" + "</soapenv:Envelope>"; String query = String.format(soapQuery, previousState.getState(), timeoutInSeconds); openConnection(url); super.setCookies(cookies); setRequestProperty("SOAPAction", "waitForControllerStateChange"); setTimeout(getTimeout() + timeoutInSeconds * 1000); String response = sendQuery(query); closeConnection(); WSControllerState controllerState = new WSControllerState(); controllerState.encodeData(response); return controllerState; } }
/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2016 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". 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 "Protocol.hpp" #include "Util/CRC.hpp" #include "Device/Port/Port.hpp" #include "Operation/Operation.hpp" #include "Time/TimeoutClock.hpp" #include <string.h> bool Volkslogger::Reset(Port &port, OperationEnvironment &env, unsigned n) { static constexpr unsigned delay = 2; while (n-- > 0) { if (!port.Write(CAN)) return false; env.Sleep(delay); } return true; } bool Volkslogger::Handshake(Port &port, OperationEnvironment &env, unsigned timeout_ms) { TimeoutClock timeout(timeout_ms); while (true) { // Solange R's aussenden, bis ein L zurückkommt if (!port.Write('R')) return false; int remaining = timeout.GetRemainingSigned(); if (remaining < 0) return false; if (remaining > 500) remaining = 500; Port::WaitResult result = port.WaitForChar('L', env, remaining); if (result == Port::WaitResult::READY) break; if (result != Port::WaitResult::TIMEOUT) return false; /* timeout, try again */ } unsigned count = 1; while (true) { // Auf 4 hintereinanderfolgende L's warten int remaining = timeout.GetRemainingSigned(); if (remaining < 0) return false; if (port.WaitForChar('L', env, remaining) != Port::WaitResult::READY) return false; count++; if (count >= 4) return true; } } bool Volkslogger::Connect(Port &port, OperationEnvironment &env, unsigned timeout_ms) { return Reset(port, env, 10) && Handshake(port, env, timeout_ms); } bool Volkslogger::ConnectAndFlush(Port &port, OperationEnvironment &env, unsigned timeout_ms) { port.Flush(); return Connect(port, env, timeout_ms) && port.FullFlush(env, 50, 300); } static bool SendWithCRC(Port &port, const void *data, size_t length, OperationEnvironment &env) { if (!port.FullWrite(data, length, env, 2000)) return false; uint16_t crc16 = UpdateCRC16CCITT(data, length, 0); return port.Write(crc16 >> 8) && port.Write(crc16 & 0xff); } bool Volkslogger::SendCommand(Port &port, OperationEnvironment &env, Command cmd, uint8_t param1, uint8_t param2) { static constexpr unsigned delay = 2; /* flush buffers */ if (!port.FullFlush(env, 20, 100)) return false; /* reset command interpreter */ if (!Reset(port, env, 6)) return false; /* send command packet */ const uint8_t cmdarray[8] = { (uint8_t)cmd, param1, param2, 0, 0, 0, 0, 0, }; if (!port.Write(ENQ)) return false; env.Sleep(delay); if (!SendWithCRC(port, cmdarray, sizeof(cmdarray), env)) return false; /* wait for confirmation */ return port.WaitRead(env, 4000) == Port::WaitResult::READY && port.GetChar() == 0; } gcc_const static int GetBaudRateIndex(unsigned baud_rate) { switch(baud_rate) { case 9600: return 1; case 19200: return 2; case 38400: return 3; case 57600: return 4; case 115200: return 5; default: return -1; } } bool Volkslogger::SendCommandSwitchBaudRate(Port &port, OperationEnvironment &env, Command cmd, uint8_t param1, unsigned baud_rate) { int baud_rate_index = GetBaudRateIndex(baud_rate); if (baud_rate_index < 0) return false; if (!SendCommand(port, env, cmd, param1, baud_rate_index)) return false; return port.SetBaudrate(baud_rate); } bool Volkslogger::WaitForACK(Port &port, OperationEnvironment &env) { return port.WaitForChar(ACK, env, 30000) == Port::WaitResult::READY; } int Volkslogger::ReadBulk(Port &port, OperationEnvironment &env, void *buffer, size_t max_length, unsigned timeout_firstchar_ms) { unsigned nbytes = 0; bool dle_r = false; uint16_t crc16 = 0; bool start = false, ende = false; memset(buffer, 0xff, max_length); uint8_t *p = (uint8_t *)buffer; constexpr unsigned TIMEOUT_NORMAL_MS = 2000; /** * We need to wait longer for the first char to * give the logger time to calculate security * when downloading a log-file. * Therefore timeout_firstchar is configurable. * If the timeout parameter is not specified or 0, * set standard timeout */ if (timeout_firstchar_ms == 0) timeout_firstchar_ms = TIMEOUT_NORMAL_MS; while (!ende) { // Zeichen anfordern und darauf warten if (!port.Write(ACK)) return -1; // Set longer timeout on first char unsigned timeout = start ? TIMEOUT_NORMAL_MS : timeout_firstchar_ms; if (port.WaitRead(env, timeout) != Port::WaitResult::READY) return -1; int ch = port.GetChar(); if (ch < 0) return -1; // dabei ist Benutzerabbruch jederzeit möglich if (env.IsCancelled()) { env.Sleep(10); port.Write(CAN); port.Write(CAN); port.Write(CAN); return -1; } // oder aber das empfangene Zeichen wird ausgewertet switch (ch) { case DLE: if (!dle_r) { //!DLE, DLE -> Achtung! dle_r = true; } else { // DLE, DLE -> DLE-Zeichen dle_r = false; if (start) { if(nbytes < max_length) *p++ = ch; nbytes++; crc16 = UpdateCRC16CCITT(ch, crc16); } } break; case ETX: if (!dle_r) { //!DLE, ETX -> Zeichen if (start) { if(nbytes < max_length) { *p++ = ch; } nbytes++; crc16 = UpdateCRC16CCITT(ch, crc16); }; } else { if (start) { ende = true; // DLE, ETX -> Blockende dle_r = false; } } break; case STX: if (!dle_r) { //!DLE, STX -> Zeichen if (start) { if(nbytes < max_length) *p++ = ch; nbytes++; crc16 = UpdateCRC16CCITT(ch, crc16); } } else { start = true; // DLE, STX -> Blockstart dle_r = false; crc16 = 0; } break; default: if (start) { if(nbytes < max_length) *p++ = ch; nbytes++; crc16 = UpdateCRC16CCITT(ch, crc16); } break; } } env.Sleep(100); if (crc16 != 0) return -1; if (nbytes < 2) return 0; // CRC am Ende abschneiden return nbytes - 2; } bool Volkslogger::WriteBulk(Port &port, OperationEnvironment &env, const void *buffer, unsigned length) { const unsigned delay = 1; env.SetProgressRange(length); uint16_t crc16 = 0; const uint8_t *p = (const uint8_t *)buffer, *end = p + length; while (p < end) { unsigned n = end - p; if (n > 400) n = 400; n = port.Write(p, n); if (n == 0) return false; crc16 = UpdateCRC16CCITT(p, n, crc16); p += n; env.SetProgressPosition(p - (const uint8_t *)buffer); /* throttle sending a bit, or the Volkslogger's receive buffer will overrun */ env.Sleep(delay * 100); } return port.Write(crc16 >> 8) && port.Write(crc16 & 0xff); } int Volkslogger::SendCommandReadBulk(Port &port, OperationEnvironment &env, Command cmd, void *buffer, size_t max_length, const unsigned timeout_firstchar_ms) { return SendCommand(port, env, cmd) ? ReadBulk(port, env, buffer, max_length, timeout_firstchar_ms) : -1; } int Volkslogger::SendCommandReadBulk(Port &port, unsigned baud_rate, OperationEnvironment &env, Command cmd, uint8_t param1, void *buffer, size_t max_length, const unsigned timeout_firstchar_ms) { unsigned old_baud_rate = port.GetBaudrate(); if (old_baud_rate != 0) { if (!SendCommandSwitchBaudRate(port, env, cmd, param1, baud_rate)) return -1; /* after switching baud rates, this sleep time is necessary; it has been verified experimentally */ env.Sleep(300); } else { /* port does not support baud rate switching, use plain SendCommand() without new baud rate */ if (!SendCommand(port, env, cmd, param1)) return -1; } int nbytes = ReadBulk(port, env, buffer, max_length, timeout_firstchar_ms); if (old_baud_rate != 0) port.SetBaudrate(old_baud_rate); return nbytes; } bool Volkslogger::SendCommandWriteBulk(Port &port, OperationEnvironment &env, Command cmd, const void *data, size_t size) { if (!SendCommand(port, env, cmd, 0, 0) || !WaitForACK(port, env)) return false; env.Sleep(100); return WriteBulk(port, env, data, size) && WaitForACK(port, env); } size_t Volkslogger::ReadFlight(Port &port, unsigned databaud, OperationEnvironment &env, unsigned flightnr, bool secmode, void *buffer, size_t buffersize) { const Volkslogger::Command cmd = secmode ? Volkslogger::cmd_GFS : Volkslogger::cmd_GFL; /* * It is necessary to wait long for the first reply from * the Logger in ReadBulk. * Since the VL needs time to calculate the Security of * the log before it responds. */ const unsigned timeout_firstchar_ms = 600000; // Download binary log data supports BulkBaudrate int groesse = SendCommandReadBulk(port, databaud, env, cmd, flightnr, buffer, buffersize, timeout_firstchar_ms); if (groesse <= 0) return 0; // read signature env.Sleep(300); /* * Testing has shown that downloading the Signature does not support * BulkRate. It has to be done with standard IO Rate (9600) */ int sgr = SendCommandReadBulk(port, env, Volkslogger::cmd_SIG, (uint8_t *)buffer + groesse, buffersize - groesse); if (sgr <= 0) return 0; return groesse + sgr; }
/* * @(#)UnsupportedPhysicalMemoryException.java 1.2 05/10/20 * * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.sun.squawk.realtime; /** * Thrown when the underlying hardware does not support the type of * physical memory requested from an instance of * one of the physical memory or raw memory access classes. * * @see RawMemoryAccess * @see RawMemoryFloatAccess * * * @since 1.0.1 Becomes unchecked */ public class UnsupportedPhysicalMemoryException extends RuntimeException { /** * A constructor for <code>UnsupportedPhysicalMemoryException</code>. */ public UnsupportedPhysicalMemoryException(){ super(); } /** * A descriptive constructor for * <code>UnsupportedPhysicalMemoryException</code>. * * @param description The description of the exception. */ public UnsupportedPhysicalMemoryException(String description) { super(description); } }
var class_mix_e_r_p_1_1_net_1_1_core_1_1_modules_1_1_sales_1_1_setup_1_1_bonus_slabs = [ [ "OnControlLoad", "class_mix_e_r_p_1_1_net_1_1_core_1_1_modules_1_1_sales_1_1_setup_1_1_bonus_slabs.html#ab16b782e4c9f10ebbbc47fd52dbc6ae1", null ], [ "ScrudPlaceholder", "class_mix_e_r_p_1_1_net_1_1_core_1_1_modules_1_1_sales_1_1_setup_1_1_bonus_slabs.html#a3402588f607d9920f295a38336e9ca8d", null ] ];
/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2015 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". 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 "Dialogs/ComboPicker.hpp" bool ComboPicker(const TCHAR *caption, DataField &df, const TCHAR *help_text) { return false; }
/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. * Copyright (C) 2010 Sony Ericsson Mobile Communications AB. * * 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. * * 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. * */ //FIXME: most allocations need not be GFP_ATOMIC /* FIXME: management of mutexes */ /* FIXME: msm_pmem_region_lookup return values */ /* FIXME: way too many copy to/from user */ /* FIXME: does region->active mean free */ /* FIXME: check limits on command lenghts passed from userspace */ /* FIXME: __msm_release: which queues should we flush when opencnt != 0 */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <mach/board.h> #include <linux/uaccess.h> #include <linux/fs.h> #include <linux/list.h> #include <linux/uaccess.h> #include <linux/android_pmem.h> #include <linux/poll.h> #include <media/msm_camera.h> #include <mach/camera.h> DEFINE_MUTEX(hlist_mut); DEFINE_MUTEX(pp_prev_lock); DEFINE_MUTEX(pp_snap_lock); #define MSM_MAX_CAMERA_SENSORS 5 #define CAMERA_STOP_SNAPSHOT 42 #define ERR_USER_COPY(to) pr_err("%s(%d): copy %s user\n", \ __func__, __LINE__, ((to) ? "to" : "from")) #define ERR_COPY_FROM_USER() ERR_USER_COPY(0) #define ERR_COPY_TO_USER() ERR_USER_COPY(1) static struct class *msm_class; static dev_t msm_devno; static LIST_HEAD(msm_sensors); struct msm_control_device *g_v4l2_control_device; int g_v4l2_opencnt; #define __CONTAINS(r, v, l, field) ({ \ typeof(r) __r = r; \ typeof(v) __v = v; \ typeof(v) __e = __v + l; \ int res = __v >= __r->field && \ __e <= __r->field + __r->len; \ res; \ }) #define CONTAINS(r1, r2, field) ({ \ typeof(r2) __r2 = r2; \ __CONTAINS(r1, __r2->field, __r2->len, field); \ }) #define IN_RANGE(r, v, field) ({ \ typeof(r) __r = r; \ typeof(v) __vv = v; \ int res = ((__vv >= __r->field) && \ (__vv < (__r->field + __r->len))); \ res; \ }) #define OVERLAPS(r1, r2, field) ({ \ typeof(r1) __r1 = r1; \ typeof(r2) __r2 = r2; \ typeof(__r2->field) __v = __r2->field; \ typeof(__v) __e = __v + __r2->len - 1; \ int res = (IN_RANGE(__r1, __v, field) || \ IN_RANGE(__r1, __e, field)); \ res; \ }) static inline void free_qcmd(struct msm_queue_cmd *qcmd) { if (!qcmd || !qcmd->on_heap) return; if (!--qcmd->on_heap) kfree(qcmd); } static void msm_region_init(struct msm_sync *sync) { INIT_HLIST_HEAD(&sync->pmem_frames); INIT_HLIST_HEAD(&sync->pmem_stats); spin_lock_init(&sync->pmem_frame_spinlock); spin_lock_init(&sync->pmem_stats_spinlock); } static void msm_queue_init(struct msm_device_queue *queue, const char *name) { spin_lock_init(&queue->lock); queue->len = 0; queue->max = 0; queue->name = name; INIT_LIST_HEAD(&queue->list); init_waitqueue_head(&queue->wait); } static void msm_enqueue(struct msm_device_queue *queue, struct list_head *entry) { unsigned long flags; spin_lock_irqsave(&queue->lock, flags); queue->len++; if (queue->len > queue->max) { queue->max = queue->len; pr_info("%s: queue %s new max is %d\n", __func__, queue->name, queue->max); } list_add_tail(entry, &queue->list); wake_up(&queue->wait); CDBG("%s: woke up %s\n", __func__, queue->name); spin_unlock_irqrestore(&queue->lock, flags); } #define msm_dequeue(queue, member) ({ \ unsigned long flags; \ struct msm_device_queue *__q = (queue); \ struct msm_queue_cmd *qcmd = 0; \ spin_lock_irqsave(&__q->lock, flags); \ if (!list_empty(&__q->list)) { \ __q->len--; \ qcmd = list_first_entry(&__q->list, \ struct msm_queue_cmd, member); \ list_del_init(&qcmd->member); \ } \ spin_unlock_irqrestore(&__q->lock, flags); \ qcmd; \ }) #define msm_queue_drain(queue, member) do { \ unsigned long flags; \ struct msm_device_queue *__q = (queue); \ struct msm_queue_cmd *qcmd; \ spin_lock_irqsave(&__q->lock, flags); \ CDBG("%s: draining queue %s\n", __func__, __q->name); \ while (!list_empty(&__q->list)) { \ qcmd = list_first_entry(&__q->list, \ struct msm_queue_cmd, member); \ list_del_init(&qcmd->member); \ free_qcmd(qcmd); \ }; \ spin_unlock_irqrestore(&__q->lock, flags); \ } while (0) static int check_overlap(struct hlist_head *ptype, unsigned long paddr, unsigned long len) { struct msm_pmem_region *region; struct msm_pmem_region t = { .paddr = paddr, .len = len }; struct hlist_node *node; hlist_for_each_entry(region, node, ptype, list) { if (CONTAINS(region, &t, paddr) || CONTAINS(&t, region, paddr) || OVERLAPS(region, &t, paddr)) { CDBG(" region (PHYS %p len %ld)" " clashes with registered region" " (paddr %p len %ld)\n", (void *)t.paddr, t.len, (void *)region->paddr, region->len); return -1; } } return 0; } static int check_pmem_info(struct msm_pmem_info *info, int len) { if (info->offset < len && info->offset + info->len <= len && info->y_off < len && info->cbcr_off < len) return 0; pr_err("%s: check failed: off %d len %d y %d cbcr %d (total len %d)\n", __func__, info->offset, info->len, info->y_off, info->cbcr_off, len); return -EINVAL; } static int msm_pmem_table_add(struct hlist_head *ptype, struct msm_pmem_info *info, spinlock_t* pmem_spinlock) { struct file *file; unsigned long paddr; unsigned long kvstart; unsigned long len; int rc; struct msm_pmem_region *region; unsigned long flags; rc = get_pmem_file(info->fd, &paddr, &kvstart, &len, &file); if (rc < 0) { pr_err("%s: get_pmem_file fd %d error %d\n", __func__, info->fd, rc); return rc; } if (!info->len) info->len = len; rc = check_pmem_info(info, len); if (rc < 0) return rc; paddr += info->offset; len = info->len; spin_lock_irqsave(pmem_spinlock, flags); if (check_overlap(ptype, paddr, len) < 0) { spin_unlock_irqrestore(pmem_spinlock, flags); return -EINVAL; } spin_unlock_irqrestore(pmem_spinlock, flags); CDBG("%s: type %d, paddr 0x%lx, vaddr 0x%lx\n", __func__, info->type, paddr, (unsigned long)info->vaddr); region = kmalloc(sizeof(struct msm_pmem_region), GFP_KERNEL); if (!region) return -ENOMEM; spin_lock_irqsave(pmem_spinlock, flags); INIT_HLIST_NODE(&region->list); region->paddr = paddr; region->len = len; region->file = file; memcpy(&region->info, info, sizeof(region->info)); hlist_add_head(&(region->list), ptype); spin_unlock_irqrestore(pmem_spinlock, flags); return 0; } /* return of 0 means failure */ static uint8_t msm_pmem_region_lookup(struct hlist_head *ptype, int pmem_type, struct msm_pmem_region *reg, uint8_t maxcount, spinlock_t *pmem_spinlock) { struct msm_pmem_region *region; struct msm_pmem_region *regptr; struct hlist_node *node, *n; unsigned long flags = 0; uint8_t rc = 0; regptr = reg; spin_lock_irqsave(pmem_spinlock, flags); hlist_for_each_entry_safe(region, node, n, ptype, list) { if (region->info.type == pmem_type && region->info.active) { *regptr = *region; rc += 1; if (rc >= maxcount) break; regptr++; } } spin_unlock_irqrestore(pmem_spinlock, flags); return rc; } static int msm_pmem_frame_ptov_lookup(struct msm_sync *sync, unsigned long pyaddr, unsigned long pcbcraddr, struct msm_pmem_info *pmem_info, int clear_active) { struct msm_pmem_region *region; struct hlist_node *node, *n; unsigned long flags = 0; spin_lock_irqsave(&sync->pmem_frame_spinlock, flags); hlist_for_each_entry_safe(region, node, n, &sync->pmem_frames, list) { if (pyaddr == (region->paddr + region->info.y_off) && pcbcraddr == (region->paddr + region->info.cbcr_off) && region->info.active) { /* offset since we could pass vaddr inside * a registerd pmem buffer */ memcpy(pmem_info, &region->info, sizeof(*pmem_info)); if (clear_active) region->info.active = 0; spin_unlock_irqrestore(&sync->pmem_frame_spinlock, flags); return 0; } } spin_unlock_irqrestore(&sync->pmem_frame_spinlock, flags); return -EINVAL; } static unsigned long msm_pmem_stats_ptov_lookup(struct msm_sync *sync, unsigned long addr, int *fd) { struct msm_pmem_region *region; struct hlist_node *node, *n; unsigned long flags = 0; spin_lock_irqsave(&sync->pmem_stats_spinlock, flags); hlist_for_each_entry_safe(region, node, n, &sync->pmem_stats, list) { if (addr == region->paddr && region->info.active) { /* offset since we could pass vaddr inside a * registered pmem buffer */ *fd = region->info.fd; region->info.active = 0; spin_unlock_irqrestore(&sync->pmem_stats_spinlock, flags); return (unsigned long)(region->info.vaddr); } } spin_unlock_irqrestore(&sync->pmem_stats_spinlock, flags); return 0; } static unsigned long msm_pmem_frame_vtop_lookup(struct msm_sync *sync, unsigned long buffer, uint32_t yoff, uint32_t cbcroff, int fd) { struct msm_pmem_region *region; struct hlist_node *node, *n; unsigned long flags = 0; spin_lock_irqsave(&sync->pmem_frame_spinlock, flags); hlist_for_each_entry_safe(region, node, n, &sync->pmem_frames, list) { if (((unsigned long)(region->info.vaddr) == buffer) && (region->info.y_off == yoff) && (region->info.cbcr_off == cbcroff) && (region->info.fd == fd) && (region->info.active == 0)) { region->info.active = 1; spin_unlock_irqrestore(&sync->pmem_frame_spinlock, flags); return region->paddr; } } spin_unlock_irqrestore(&sync->pmem_frame_spinlock, flags); return 0; } static unsigned long msm_pmem_stats_vtop_lookup( struct msm_sync *sync, unsigned long buffer, int fd) { struct msm_pmem_region *region; struct hlist_node *node, *n; unsigned long flags = 0; spin_lock_irqsave(&sync->pmem_stats_spinlock, flags); hlist_for_each_entry_safe(region, node, n, &sync->pmem_stats, list) { if (((unsigned long)(region->info.vaddr) == buffer) && (region->info.fd == fd) && region->info.active == 0) { region->info.active = 1; spin_unlock_irqrestore(&sync->pmem_stats_spinlock, flags); return region->paddr; } } spin_unlock_irqrestore(&sync->pmem_stats_spinlock, flags); return 0; } static int __msm_pmem_table_del(struct msm_sync *sync, struct msm_pmem_info *pinfo) { int rc = 0; struct msm_pmem_region *region; struct hlist_node *node, *n; unsigned long flags = 0; switch (pinfo->type) { case MSM_PMEM_VIDEO: case MSM_PMEM_PREVIEW: case MSM_PMEM_THUMBNAIL: case MSM_PMEM_MAINIMG: case MSM_PMEM_RAW_MAINIMG: spin_lock_irqsave(&sync->pmem_frame_spinlock, flags); hlist_for_each_entry_safe(region, node, n, &sync->pmem_frames, list) { if (pinfo->type == region->info.type && pinfo->vaddr == region->info.vaddr && pinfo->fd == region->info.fd) { hlist_del(node); put_pmem_file(region->file); kfree(region); } } spin_unlock_irqrestore(&sync->pmem_frame_spinlock, flags); break; case MSM_PMEM_AEC_AWB: case MSM_PMEM_AF: spin_lock_irqsave(&sync->pmem_stats_spinlock, flags); hlist_for_each_entry_safe(region, node, n, &sync->pmem_stats, list) { if (pinfo->type == region->info.type && pinfo->vaddr == region->info.vaddr && pinfo->fd == region->info.fd) { hlist_del(node); put_pmem_file(region->file); kfree(region); } } spin_unlock_irqrestore(&sync->pmem_stats_spinlock, flags); break; default: rc = -EINVAL; break; } return rc; } static int msm_pmem_table_del(struct msm_sync *sync, void __user *arg) { struct msm_pmem_info info; if (copy_from_user(&info, arg, sizeof(info))) { ERR_COPY_FROM_USER(); return -EFAULT; } return __msm_pmem_table_del(sync, &info); } static int __msm_get_frame(struct msm_sync *sync, struct msm_frame *frame) { int rc = 0; struct msm_pmem_info pmem_info; struct msm_queue_cmd *qcmd = NULL; struct msm_vfe_resp *vdata; struct msm_vfe_phy_info *pphy; qcmd = msm_dequeue(&sync->frame_q, list_frame); if (!qcmd) { pr_err("%s: no preview frame.\n", __func__); return -EAGAIN; } vdata = (struct msm_vfe_resp *)(qcmd->command); pphy = &vdata->phy; rc = msm_pmem_frame_ptov_lookup(sync, pphy->y_phy, pphy->cbcr_phy, &pmem_info, 1); /* mark frame in use */ if (rc < 0) { pr_err("%s: cannot get frame, invalid lookup address " "y %x cbcr %x\n", __func__, pphy->y_phy, pphy->cbcr_phy); goto err; } frame->buffer = (unsigned long)pmem_info.vaddr; frame->y_off = pmem_info.y_off; frame->cbcr_off = pmem_info.cbcr_off; frame->fd = pmem_info.fd; frame->path = vdata->phy.output_id; CDBG("%s: y %x, cbcr %x, qcmd %x, virt_addr %x\n", __func__, pphy->y_phy, pphy->cbcr_phy, (int) qcmd, (int) frame->buffer); err: free_qcmd(qcmd); return rc; } static int msm_get_frame(struct msm_sync *sync, void __user *arg) { int rc = 0; struct msm_frame frame; if (copy_from_user(&frame, arg, sizeof(struct msm_frame))) { ERR_COPY_FROM_USER(); return -EFAULT; } rc = __msm_get_frame(sync, &frame); if (rc < 0) return rc; /* read the frame after the status has been read */ rmb(); if (sync->croplen) { if (frame.croplen != sync->croplen) { pr_err("%s: invalid frame croplen %d," "expecting %d\n", __func__, frame.croplen, sync->croplen); return -EINVAL; } if (copy_to_user((void *)frame.cropinfo, sync->cropinfo, sync->croplen)) { ERR_COPY_TO_USER(); return -EFAULT; } } if (copy_to_user((void *)arg, &frame, sizeof(struct msm_frame))) { ERR_COPY_TO_USER(); rc = -EFAULT; } CDBG("%s: got frame\n", __func__); return rc; } static int msm_enable_vfe(struct msm_sync *sync, void __user *arg) { int rc = -EIO; struct camera_enable_cmd cfg; if (copy_from_user(&cfg, arg, sizeof(struct camera_enable_cmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } if (sync->vfefn.vfe_enable) rc = sync->vfefn.vfe_enable(&cfg); CDBG("%s: rc %d\n", __func__, rc); return rc; } static int msm_disable_vfe(struct msm_sync *sync, void __user *arg) { int rc = -EIO; struct camera_enable_cmd cfg; if (copy_from_user(&cfg, arg, sizeof(struct camera_enable_cmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } if (sync->vfefn.vfe_disable) rc = sync->vfefn.vfe_disable(&cfg, NULL); CDBG("%s: rc %d\n", __func__, rc); return rc; } static struct msm_queue_cmd *__msm_control(struct msm_sync *sync, struct msm_device_queue *queue, struct msm_queue_cmd *qcmd, int timeout) { unsigned long flags; int rc; CDBG("Inside __msm_control\n"); msm_enqueue(&sync->event_q, &qcmd->list_config); /* wake up config thread */ if (!queue) return NULL; /* wait for config status */ CDBG("Waiting for config status \n"); rc = wait_event_interruptible_timeout( queue->wait, !list_empty_careful(&queue->list), timeout); CDBG("Waiting over for config status \n"); if (list_empty_careful(&queue->list)) { if (!rc) rc = -ETIMEDOUT; if (rc < 0) { pr_err("%s: wait_event error %d\n", __func__, rc); spin_lock_irqsave(&(sync->event_q.lock), flags); list_del_init(&qcmd->list_config); spin_unlock_irqrestore(&(sync->event_q.lock), flags); return ERR_PTR(rc); } } qcmd = msm_dequeue(queue, list_control); BUG_ON(!qcmd); CDBG("__msm_control done \n"); return qcmd; } static struct msm_queue_cmd *__msm_control_nb(struct msm_sync *sync, struct msm_queue_cmd *qcmd_to_copy) { /* Since this is a non-blocking command, we cannot use qcmd_to_copy and * its data, since they are on the stack. We replicate them on the heap * and mark them on_heap so that they get freed when the config thread * dequeues them. */ struct msm_ctrl_cmd *udata; struct msm_ctrl_cmd *udata_to_copy = qcmd_to_copy->command; struct msm_queue_cmd *qcmd = kmalloc(sizeof(*qcmd_to_copy) + sizeof(*udata_to_copy) + udata_to_copy->length, GFP_KERNEL); if (!qcmd) { pr_err("%s: out of memory\n", __func__); return ERR_PTR(-ENOMEM); } *qcmd = *qcmd_to_copy; udata = qcmd->command = qcmd + 1; memcpy(udata, udata_to_copy, sizeof(*udata)); udata->value = udata + 1; memcpy(udata->value, udata_to_copy->value, udata_to_copy->length); qcmd->on_heap = 1; /* qcmd_resp will be set to NULL */ return __msm_control(sync, NULL, qcmd, 0); } static int msm_control(struct msm_control_device *ctrl_pmsm, int block, void __user *arg) { int rc = 0; struct msm_sync *sync = ctrl_pmsm->pmsm->sync; void __user *uptr; struct msm_ctrl_cmd udata; struct msm_queue_cmd qcmd; struct msm_queue_cmd *qcmd_resp = NULL; uint8_t data[50]; CDBG("Inside msm_control\n"); if (copy_from_user(&udata, arg, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_FROM_USER(); rc = -EFAULT; goto end; } uptr = udata.value; udata.value = data; if (udata.type == CAMERA_STOP_SNAPSHOT) sync->get_pic_abort = 1; qcmd.on_heap = 0; qcmd.type = MSM_CAM_Q_CTRL; qcmd.command = &udata; if (udata.length) { if (udata.length > sizeof(data)) { pr_err("%s: user data too large (%d, max is %d)\n", __func__, udata.length, sizeof(data)); rc = -EIO; goto end; } if (copy_from_user(udata.value, uptr, udata.length)) { ERR_COPY_FROM_USER(); rc = -EFAULT; goto end; } } if (unlikely(!block)) { qcmd_resp = __msm_control_nb(sync, &qcmd); if (!qcmd_resp || IS_ERR(qcmd_resp)) { rc = PTR_ERR(qcmd_resp); qcmd_resp = NULL; } goto end; } qcmd_resp = __msm_control(sync, &ctrl_pmsm->ctrl_q, &qcmd, MAX_SCHEDULE_TIMEOUT); if (!qcmd_resp || IS_ERR(qcmd_resp)) { /* Do not free qcmd_resp here. If the config thread read it, * then it has already been freed, and we timed out because * we did not receive a MSM_CAM_IOCTL_CTRL_CMD_DONE. If the * config thread itself is blocked and not dequeueing commands, * then it will either eventually unblock and process them, * or when it is killed, qcmd will be freed in * msm_release_config. */ rc = PTR_ERR(qcmd_resp); qcmd_resp = NULL; goto end; } if (qcmd_resp->command) { udata = *(struct msm_ctrl_cmd *)qcmd_resp->command; if (udata.length > 0) { if (copy_to_user(uptr, udata.value, udata.length)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto end; } } udata.value = uptr; if (copy_to_user((void *)arg, &udata, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_TO_USER(); rc = -EFAULT; goto end; } } end: free_qcmd(qcmd_resp); CDBG(" msm_control done\n"); CDBG("%s: rc %d\n", __func__, rc); return rc; } /* Divert frames for post-processing by delivering them to the config thread; * when post-processing is done, it will return the frame to the frame thread. */ static int msm_divert_frame(struct msm_sync *sync, struct msm_vfe_resp *data, struct msm_stats_event_ctrl *se) { struct msm_pmem_info pinfo; struct msm_postproc buf; int rc; pr_info("%s: preview PP sync->pp_mask %d\n", __func__, sync->pp_mask); if (!(sync->pp_mask & PP_PREV)) { pr_err("%s: diverting preview frame but not in PP_PREV!\n", __func__); return -EINVAL; } rc = msm_pmem_frame_ptov_lookup(sync, data->phy.y_phy, data->phy.cbcr_phy, &pinfo, 0); /* do clear the active flag */ if (rc < 0) { CDBG("%s: msm_pmem_frame_ptov_lookup failed\n", __func__); return rc; } buf.fmain.buffer = (unsigned long)pinfo.vaddr; buf.fmain.y_off = pinfo.y_off; buf.fmain.cbcr_off = pinfo.cbcr_off; buf.fmain.fd = pinfo.fd; CDBG("%s: buf %ld fd %d\n", __func__, buf.fmain.buffer, buf.fmain.fd); if (copy_to_user((void *)(se->stats_event.data), &(buf.fmain), sizeof(struct msm_frame))) { ERR_COPY_TO_USER(); return -EFAULT; } return 0; } static int msm_divert_snapshot(struct msm_sync *sync, struct msm_vfe_resp *data, struct msm_stats_event_ctrl *se) { struct msm_postproc buf; struct msm_pmem_region region; CDBG("%s: preview PP sync->pp_mask %d\n", __func__, sync->pp_mask); if (!(sync->pp_mask & (PP_SNAP|PP_RAW_SNAP))) { pr_err("%s: diverting snapshot but not in PP_SNAP!\n", __func__); return -EINVAL; } memset(&region, 0, sizeof(region)); buf.fmnum = msm_pmem_region_lookup(&sync->pmem_frames, MSM_PMEM_MAINIMG, &region, 1, &sync->pmem_frame_spinlock); if (buf.fmnum == 1) { buf.fmain.buffer = (uint32_t)region.info.vaddr; buf.fmain.y_off = region.info.y_off; buf.fmain.cbcr_off = region.info.cbcr_off; buf.fmain.fd = region.info.fd; } else { if (buf.fmnum > 1) pr_err("%s: MSM_PMEM_MAINIMG lookup found %d\n", __func__, buf.fmnum); } buf.fmnum = msm_pmem_region_lookup(&sync->pmem_frames, MSM_PMEM_RAW_MAINIMG, &region, 1, &sync->pmem_frame_spinlock); if (buf.fmnum == 1) { buf.fmain.path = MSM_FRAME_PREV_2; buf.fmain.buffer = (uint32_t)region.info.vaddr; buf.fmain.fd = region.info.fd; } else { pr_err("%s: pmem lookup fail (found %d)\n", __func__, buf.fmnum); return -EIO; } CDBG("%s: snapshot copy_to_user!\n", __func__); if (copy_to_user((void *)(se->stats_event.data), &buf, sizeof(buf))) { ERR_COPY_TO_USER(); return -EFAULT; } return 0; } static int msm_get_stats(struct msm_sync *sync, void __user *arg) { int timeout; int rc = 0; struct msm_stats_event_ctrl se; struct msm_queue_cmd *qcmd = NULL; struct msm_ctrl_cmd *ctrl = NULL; struct msm_vfe_resp *data = NULL; struct msm_stats_buf stats; struct msm_sensor_resp_t *sdata = NULL; if (copy_from_user(&se, arg, sizeof(struct msm_stats_event_ctrl))) { ERR_COPY_FROM_USER(); return -EFAULT; } timeout = (int)se.timeout_ms; CDBG("%s: timeout %d\n", __func__, timeout); rc = wait_event_interruptible_timeout( sync->event_q.wait, !list_empty_careful(&sync->event_q.list), msecs_to_jiffies(timeout)); if (list_empty_careful(&sync->event_q.list)) { if (rc == 0) rc = -ETIMEDOUT; if (rc < 0) { pr_err("%s: error %d\n", __func__, rc); return rc; } } CDBG("%s: returned from wait: %d\n", __func__, rc); rc = 0; qcmd = msm_dequeue(&sync->event_q, list_config); BUG_ON(!qcmd); CDBG("%s: received from DSP %d\n", __func__, qcmd->type); /* order the reads of stat/snapshot buffers */ rmb(); switch (qcmd->type) { case MSM_CAM_Q_VFE_EVT: case MSM_CAM_Q_VFE_MSG: data = (struct msm_vfe_resp *)(qcmd->command); /* adsp event and message */ se.resptype = MSM_CAM_RESP_STAT_EVT_MSG; /* 0 - msg from aDSP, 1 - event from mARM */ se.stats_event.type = data->evt_msg.type; se.stats_event.msg_id = data->evt_msg.msg_id; se.stats_event.len = data->evt_msg.len; CDBG("%s: qcmd->type %d length %d msd_id %d\n", __func__, qcmd->type, se.stats_event.len, se.stats_event.msg_id); if ((data->type >= VFE_MSG_STATS_AEC) && (data->type <= VFE_MSG_STATS_WE)) { /* the check above includes all stats type. */ stats.buffer = msm_pmem_stats_ptov_lookup(sync, data->phy.sbuf_phy, &(stats.fd)); if (!stats.buffer) { pr_err("%s: msm_pmem_stats_ptov_lookup error\n", __func__); rc = -EINVAL; goto failure; } if (copy_to_user((void *)(se.stats_event.data), &stats, sizeof(struct msm_stats_buf))) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } else if ((data->evt_msg.len > 0) && (data->type == VFE_MSG_GENERAL)) { if (copy_to_user((void *)(se.stats_event.data), data->evt_msg.data, data->evt_msg.len)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } else { if ((sync->pp_mask & PP_PREV) && (data->type == VFE_MSG_OUTPUT_P)) rc = msm_divert_frame(sync, data, &se); else if ((sync->pp_mask & (PP_SNAP|PP_RAW_SNAP)) && (data->type == VFE_MSG_SNAPSHOT || data->type == VFE_MSG_OUTPUT_S)) rc = msm_divert_snapshot(sync, data, &se); } break; case MSM_CAM_Q_CTRL: /* control command from control thread */ ctrl = (struct msm_ctrl_cmd *)(qcmd->command); CDBG("%s: qcmd->type %d length %d\n", __func__, qcmd->type, ctrl->length); if (ctrl->length > 0) { if (copy_to_user((void *)(se.ctrl_cmd.value), ctrl->value, ctrl->length)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } se.resptype = MSM_CAM_RESP_CTRL; /* what to control */ se.ctrl_cmd.type = ctrl->type; se.ctrl_cmd.length = ctrl->length; se.ctrl_cmd.resp_fd = ctrl->resp_fd; break; case MSM_CAM_Q_V4L2_REQ: /* control command from v4l2 client */ ctrl = (struct msm_ctrl_cmd *)(qcmd->command); if (ctrl->length > 0) { if (copy_to_user((void *)(se.ctrl_cmd.value), ctrl->value, ctrl->length)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } /* 2 tells config thread this is v4l2 request */ se.resptype = MSM_CAM_RESP_V4L2; /* what to control */ se.ctrl_cmd.type = ctrl->type; se.ctrl_cmd.length = ctrl->length; break; case MSM_CAM_Q_SENSOR_MSG: sdata = (struct msm_sensor_resp_t *)(qcmd->command); CDBG("msm_get_stats, qcmd->type = %d\n", qcmd->type); CDBG("type = %d\n", sdata->type); CDBG("extlen = %d\n", sdata->extlen); se.resptype = MSM_CAM_RESP_SENSOR_MSG; se.sensor_msg.type = sdata->type; se.sensor_msg.extlen = 0; if (sdata->extlen > 0) { if (copy_to_user((void *)(se.sensor_msg.extdata), sdata->extdata, sdata->extlen)) { ERR_COPY_TO_USER(); rc = -EFAULT; } se.sensor_msg.extlen = sdata->extlen; } break; default: rc = -EFAULT; goto failure; } /* switch qcmd->type */ if (copy_to_user((void *)arg, &se, sizeof(se))) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } failure: free_qcmd(qcmd); CDBG("%s: %d\n", __func__, rc); return rc; } static int msm_ctrl_cmd_done(struct msm_control_device *ctrl_pmsm, void __user *arg) { void __user *uptr; struct msm_queue_cmd *qcmd = &ctrl_pmsm->qcmd; struct msm_ctrl_cmd *command = &ctrl_pmsm->ctrl; if (copy_from_user(command, arg, sizeof(*command))) { ERR_COPY_FROM_USER(); return -EFAULT; } qcmd->on_heap = 0; qcmd->command = command; uptr = command->value; if (command->length > 0) { command->value = ctrl_pmsm->ctrl_data; if (command->length > sizeof(ctrl_pmsm->ctrl_data)) { pr_err("%s: user data %d is too big (max %d)\n", __func__, command->length, sizeof(ctrl_pmsm->ctrl_data)); return -EINVAL; } if (copy_from_user(command->value, uptr, command->length)) { ERR_COPY_FROM_USER(); return -EFAULT; } } else command->value = NULL; /* wake up control thread */ msm_enqueue(&ctrl_pmsm->ctrl_q, &qcmd->list_control); return 0; } static int msm_config_vfe(struct msm_sync *sync, void __user *arg) { struct msm_vfe_cfg_cmd cfgcmd; struct msm_pmem_region region[8]; struct axidata axi_data; if (!sync->vfefn.vfe_config) { pr_err("%s: no vfe_config!\n", __func__); return -EIO; } if (copy_from_user(&cfgcmd, arg, sizeof(cfgcmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } memset(&axi_data, 0, sizeof(axi_data)); CDBG("%s: cmd_type %d\n", __func__, cfgcmd.cmd_type); switch (cfgcmd.cmd_type) { case CMD_STATS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AEC_AWB, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AF, &region[axi_data.bufnum1], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1 || !axi_data.bufnum2) { pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AF_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AF, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AEC_AWB_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AEC_AWB, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AEC_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AEC, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AWB_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AWB, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_IHIST_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_IHIST, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_RS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_RS, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_CS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_CS, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_GENERAL: case CMD_STATS_DISABLE: return sync->vfefn.vfe_config(&cfgcmd, NULL); default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd.cmd_type); } return -EINVAL; } static int msm_frame_axi_cfg(struct msm_sync *sync, struct msm_vfe_cfg_cmd *cfgcmd) { int rc = -EIO; struct axidata axi_data; void *data = &axi_data; struct msm_pmem_region region[8]; int pmem_type; memset(&axi_data, 0, sizeof(axi_data)); switch (cfgcmd->cmd_type) { case CMD_AXI_CFG_PREVIEW: pmem_type = MSM_PMEM_PREVIEW; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8, &sync->pmem_frame_spinlock); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error (empty %d)\n", __func__, __LINE__, hlist_empty(&sync->pmem_frames)); return -EINVAL; } break; case CMD_AXI_CFG_VIDEO: pmem_type = MSM_PMEM_PREVIEW; axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8, &sync->pmem_frame_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } pmem_type = MSM_PMEM_VIDEO; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[axi_data.bufnum1], (8-(axi_data.bufnum1)), &sync->pmem_frame_spinlock); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } break; case CMD_AXI_CFG_SNAP: pmem_type = MSM_PMEM_THUMBNAIL; axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8, &sync->pmem_frame_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } pmem_type = MSM_PMEM_MAINIMG; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[axi_data.bufnum1], (8-(axi_data.bufnum1)), &sync->pmem_frame_spinlock); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } break; case CMD_RAW_PICT_AXI_CFG: pmem_type = MSM_PMEM_RAW_MAINIMG; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8, &sync->pmem_frame_spinlock); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } break; case CMD_GENERAL: data = NULL; break; default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd->cmd_type); return -EINVAL; } axi_data.region = &region[0]; /* send the AXI configuration command to driver */ if (sync->vfefn.vfe_config) rc = sync->vfefn.vfe_config(cfgcmd, data); return rc; } static int msm_get_sensor_info(struct msm_sync *sync, void __user *arg) { int rc = 0; struct msm_camsensor_info info; struct msm_camera_sensor_info *sdata; if (copy_from_user(&info, arg, sizeof(struct msm_camsensor_info))) { ERR_COPY_FROM_USER(); return -EFAULT; } sdata = sync->pdev->dev.platform_data; CDBG("%s: sensor_name %s\n", __func__, sdata->sensor_name); memcpy(&info.name[0], sdata->sensor_name, MAX_SENSOR_NAME); info.flash_enabled = sdata->flash_data->flash_type != MSM_CAMERA_FLASH_NONE; /* copy back to user space */ if (copy_to_user((void *)arg, &info, sizeof(struct msm_camsensor_info))) { ERR_COPY_TO_USER(); rc = -EFAULT; } return rc; } static int __msm_put_frame_buf(struct msm_sync *sync, struct msm_frame *pb) { unsigned long pphy; struct msm_vfe_cfg_cmd cfgcmd; int rc = -EIO; pphy = msm_pmem_frame_vtop_lookup(sync, pb->buffer, pb->y_off, pb->cbcr_off, pb->fd); if (pphy != 0) { CDBG("%s: rel: vaddr %lx, paddr %lx\n", __func__, pb->buffer, pphy); cfgcmd.cmd_type = CMD_FRAME_BUF_RELEASE; cfgcmd.value = (void *)pb; if (sync->vfefn.vfe_config) rc = sync->vfefn.vfe_config(&cfgcmd, &pphy); } else { pr_err("%s: msm_pmem_frame_vtop_lookup failed\n", __func__); rc = -EINVAL; } return rc; } static int msm_put_frame_buffer(struct msm_sync *sync, void __user *arg) { struct msm_frame buf_t; if (copy_from_user(&buf_t, arg, sizeof(struct msm_frame))) { ERR_COPY_FROM_USER(); return -EFAULT; } return __msm_put_frame_buf(sync, &buf_t); } static int __msm_register_pmem(struct msm_sync *sync, struct msm_pmem_info *pinfo) { int rc = 0; switch (pinfo->type) { case MSM_PMEM_VIDEO: case MSM_PMEM_PREVIEW: case MSM_PMEM_THUMBNAIL: case MSM_PMEM_MAINIMG: case MSM_PMEM_RAW_MAINIMG: rc = msm_pmem_table_add(&sync->pmem_frames, pinfo, &sync->pmem_frame_spinlock); break; case MSM_PMEM_AEC_AWB: case MSM_PMEM_AF: case MSM_PMEM_AEC: case MSM_PMEM_AWB: case MSM_PMEM_RS: case MSM_PMEM_CS: case MSM_PMEM_IHIST: case MSM_PMEM_SKIN: rc = msm_pmem_table_add(&sync->pmem_stats, pinfo, &sync->pmem_stats_spinlock); break; default: rc = -EINVAL; break; } return rc; } static int msm_register_pmem(struct msm_sync *sync, void __user *arg) { struct msm_pmem_info info; if (copy_from_user(&info, arg, sizeof(info))) { ERR_COPY_FROM_USER(); return -EFAULT; } return __msm_register_pmem(sync, &info); } static int msm_stats_axi_cfg(struct msm_sync *sync, struct msm_vfe_cfg_cmd *cfgcmd) { int rc = -EIO; struct axidata axi_data; void *data = &axi_data; struct msm_pmem_region region[3]; int pmem_type = MSM_PMEM_MAX; memset(&axi_data, 0, sizeof(axi_data)); switch (cfgcmd->cmd_type) { case CMD_STATS_AXI_CFG: pmem_type = MSM_PMEM_AEC_AWB; break; case CMD_STATS_AF_AXI_CFG: pmem_type = MSM_PMEM_AF; break; case CMD_GENERAL: data = NULL; break; default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd->cmd_type); return -EINVAL; } if (cfgcmd->cmd_type != CMD_GENERAL) { axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, pmem_type, &region[0], NUM_STAT_OUTPUT_BUFFERS, &sync->pmem_stats_spinlock); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; } /* send the AEC/AWB STATS configuration command to driver */ if (sync->vfefn.vfe_config) rc = sync->vfefn.vfe_config(cfgcmd, &axi_data); return rc; } static int msm_put_stats_buffer(struct msm_sync *sync, void __user *arg) { int rc = -EIO; struct msm_stats_buf buf; unsigned long pphy; struct msm_vfe_cfg_cmd cfgcmd; if (copy_from_user(&buf, arg, sizeof(struct msm_stats_buf))) { ERR_COPY_FROM_USER(); return -EFAULT; } CDBG("%s\n", __func__); pphy = msm_pmem_stats_vtop_lookup(sync, buf.buffer, buf.fd); if (pphy != 0) { if (buf.type == STAT_AEAW) cfgcmd.cmd_type = CMD_STATS_BUF_RELEASE; else if (buf.type == STAT_AF) cfgcmd.cmd_type = CMD_STATS_AF_BUF_RELEASE; else if (buf.type == STAT_AEC) cfgcmd.cmd_type = CMD_STATS_AEC_BUF_RELEASE; else if (buf.type == STAT_AWB) cfgcmd.cmd_type = CMD_STATS_AWB_BUF_RELEASE; else if (buf.type == STAT_IHIST) cfgcmd.cmd_type = CMD_STATS_IHIST_BUF_RELEASE; else if (buf.type == STAT_RS) cfgcmd.cmd_type = CMD_STATS_RS_BUF_RELEASE; else if (buf.type == STAT_CS) cfgcmd.cmd_type = CMD_STATS_CS_BUF_RELEASE; else { pr_err("%s: invalid buf type %d\n", __func__, buf.type); rc = -EINVAL; goto put_done; } cfgcmd.value = (void *)&buf; if (sync->vfefn.vfe_config) { rc = sync->vfefn.vfe_config(&cfgcmd, &pphy); if (rc < 0) pr_err("%s: vfe_config error %d\n", __func__, rc); } else pr_err("%s: vfe_config is NULL\n", __func__); } else { pr_err("%s: NULL physical address\n", __func__); rc = -EINVAL; } put_done: return rc; } static int msm_axi_config(struct msm_sync *sync, void __user *arg) { struct msm_vfe_cfg_cmd cfgcmd; if (copy_from_user(&cfgcmd, arg, sizeof(cfgcmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } switch (cfgcmd.cmd_type) { case CMD_AXI_CFG_VIDEO: case CMD_AXI_CFG_PREVIEW: case CMD_AXI_CFG_SNAP: case CMD_RAW_PICT_AXI_CFG: return msm_frame_axi_cfg(sync, &cfgcmd); case CMD_STATS_AXI_CFG: case CMD_STATS_AF_AXI_CFG: return msm_stats_axi_cfg(sync, &cfgcmd); default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd.cmd_type); return -EINVAL; } return 0; } static int __msm_get_pic(struct msm_sync *sync, struct msm_ctrl_cmd *ctrl) { int rc = 0; int tm; struct msm_queue_cmd *qcmd = NULL; tm = (int)ctrl->timeout_ms; rc = wait_event_interruptible_timeout( sync->pict_q.wait, !list_empty_careful( &sync->pict_q.list) || sync->get_pic_abort, msecs_to_jiffies(tm)); if (sync->get_pic_abort == 1) { sync->get_pic_abort = 0; return -ENODATA; } if (list_empty_careful(&sync->pict_q.list)) { if (rc == 0) return -ETIMEDOUT; if (rc < 0) { pr_err("%s: rc %d\n", __func__, rc); return rc; } } rc = 0; qcmd = msm_dequeue(&sync->pict_q, list_pict); BUG_ON(!qcmd); if (qcmd->command != NULL) { struct msm_ctrl_cmd *q = (struct msm_ctrl_cmd *)qcmd->command; ctrl->type = q->type; ctrl->status = q->status; } else { ctrl->type = -1; ctrl->status = -1; } free_qcmd(qcmd); return rc; } static int msm_get_pic(struct msm_sync *sync, void __user *arg) { struct msm_ctrl_cmd ctrlcmd_t; int rc; if (copy_from_user(&ctrlcmd_t, arg, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } rc = __msm_get_pic(sync, &ctrlcmd_t); if (rc < 0) return rc; if (sync->croplen) { if (ctrlcmd_t.length != sync->croplen) { pr_err("%s: invalid len %d < %d\n", __func__, ctrlcmd_t.length, sync->croplen); return -EINVAL; } if (copy_to_user(ctrlcmd_t.value, sync->cropinfo, sync->croplen)) { ERR_COPY_TO_USER(); return -EFAULT; } } CDBG("%s: copy snapshot frame to user\n", __func__); if (copy_to_user((void *)arg, &ctrlcmd_t, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_TO_USER(); return -EFAULT; } return 0; } static int msm_set_crop(struct msm_sync *sync, void __user *arg) { struct crop_info crop; if (copy_from_user(&crop, arg, sizeof(struct crop_info))) { ERR_COPY_FROM_USER(); return -EFAULT; } if (!sync->croplen) { sync->cropinfo = kmalloc(crop.len, GFP_KERNEL); if (!sync->cropinfo) return -ENOMEM; } else if (sync->croplen < crop.len) return -EINVAL; if (copy_from_user(sync->cropinfo, crop.info, crop.len)) { ERR_COPY_FROM_USER(); kfree(sync->cropinfo); return -EFAULT; } sync->croplen = crop.len; return 0; } static int msm_pp_grab(struct msm_sync *sync, void __user *arg) { uint32_t enable; if (copy_from_user(&enable, arg, sizeof(enable))) { ERR_COPY_FROM_USER(); return -EFAULT; } else { enable &= PP_MASK; if (enable & (enable - 1)) { pr_err("%s: error: more than one PP request!\n", __func__); return -EINVAL; } if (sync->pp_mask) { pr_err("%s: postproc %x is already enabled\n", __func__, sync->pp_mask & enable); return -EINVAL; } CDBG("%s: sync->pp_mask %d enable %d\n", __func__, sync->pp_mask, enable); sync->pp_mask |= enable; } return 0; } static int msm_pp_release(struct msm_sync *sync, void __user *arg) { uint32_t mask; if (copy_from_user(&mask, arg, sizeof(uint32_t))) { ERR_COPY_FROM_USER(); return -EFAULT; } mask &= PP_MASK; if (!sync->pp_mask) { pr_warning("%s: pp not in progress for %x\n", __func__, mask); return -EINVAL; } if (sync->pp_mask & PP_PREV) { if (mask & PP_PREV) { mutex_lock(&pp_prev_lock); if (!sync->pp_prev) { pr_err("%s: no preview frame to deliver!\n", __func__); mutex_unlock(&pp_prev_lock); return -EINVAL; } pr_info("%s: delivering pp_prev\n", __func__); msm_enqueue(&sync->frame_q, &sync->pp_prev->list_frame); sync->pp_prev = NULL; mutex_unlock(&pp_prev_lock); } else if (!(mask & PP_PREV)) { sync->pp_mask &= ~PP_PREV; } goto done; } if (((mask & PP_SNAP) && (sync->pp_mask & PP_SNAP)) || ((mask & PP_RAW_SNAP) && (sync->pp_mask & PP_RAW_SNAP))) { mutex_lock(&pp_snap_lock); if (!sync->pp_snap) { pr_err("%s: no snapshot to deliver!\n", __func__); mutex_unlock(&pp_snap_lock); return -EINVAL; } pr_info("%s: delivering pp_snap\n", __func__); msm_enqueue(&sync->pict_q, &sync->pp_snap->list_pict); sync->pp_snap = NULL; mutex_unlock(&pp_snap_lock); sync->pp_mask &= (mask & PP_SNAP) ? ~PP_SNAP : ~PP_RAW_SNAP; } done: return 0; } static long msm_ioctl_common(struct msm_device *pmsm, unsigned int cmd, void __user *argp) { CDBG("%s\n", __func__); switch (cmd) { case MSM_CAM_IOCTL_REGISTER_PMEM: return msm_register_pmem(pmsm->sync, argp); case MSM_CAM_IOCTL_UNREGISTER_PMEM: return msm_pmem_table_del(pmsm->sync, argp); default: return -EINVAL; } } static long msm_ioctl_config(struct file *filep, unsigned int cmd, unsigned long arg) { int rc = -EINVAL; void __user *argp = (void __user *)arg; struct msm_device *pmsm = filep->private_data; CDBG("%s: cmd %d\n", __func__, _IOC_NR(cmd)); switch (cmd) { case MSM_CAM_IOCTL_GET_SENSOR_INFO: rc = msm_get_sensor_info(pmsm->sync, argp); break; case MSM_CAM_IOCTL_CONFIG_VFE: /* Coming from config thread for update */ rc = msm_config_vfe(pmsm->sync, argp); break; case MSM_CAM_IOCTL_GET_STATS: /* Coming from config thread wait * for vfe statistics and control requests */ rc = msm_get_stats(pmsm->sync, argp); break; case MSM_CAM_IOCTL_ENABLE_VFE: /* This request comes from control thread: * enable either QCAMTASK or VFETASK */ rc = msm_enable_vfe(pmsm->sync, argp); break; case MSM_CAM_IOCTL_DISABLE_VFE: /* This request comes from control thread: * disable either QCAMTASK or VFETASK */ rc = msm_disable_vfe(pmsm->sync, argp); break; case MSM_CAM_IOCTL_VFE_APPS_RESET: msm_camio_vfe_blk_reset(); rc = 0; break; case MSM_CAM_IOCTL_RELEASE_STATS_BUFFER: rc = msm_put_stats_buffer(pmsm->sync, argp); break; case MSM_CAM_IOCTL_AXI_CONFIG: rc = msm_axi_config(pmsm->sync, argp); break; case MSM_CAM_IOCTL_SET_CROP: rc = msm_set_crop(pmsm->sync, argp); break; case MSM_CAM_IOCTL_PICT_PP: /* Grab one preview frame or one snapshot * frame. */ rc = msm_pp_grab(pmsm->sync, argp); break; case MSM_CAM_IOCTL_PICT_PP_DONE: /* Release the preview of snapshot frame * that was grabbed. */ rc = msm_pp_release(pmsm->sync, argp); break; case MSM_CAM_IOCTL_SENSOR_IO_CFG: rc = pmsm->sync->sctrl.s_config(argp); break; case MSM_CAM_IOCTL_FLASH_LED_CFG: { uint32_t led_state; if (copy_from_user(&led_state, argp, sizeof(led_state))) { ERR_COPY_FROM_USER(); rc = -EFAULT; } else rc = msm_camera_flash_set_led_state(pmsm->sync-> sdata->flash_data, led_state); break; } default: rc = msm_ioctl_common(pmsm, cmd, argp); break; } CDBG("%s: cmd %d DONE\n", __func__, _IOC_NR(cmd)); return rc; } static int msm_unblock_poll_frame(struct msm_sync *); static long msm_ioctl_frame(struct file *filep, unsigned int cmd, unsigned long arg) { int rc = -EINVAL; void __user *argp = (void __user *)arg; struct msm_device *pmsm = filep->private_data; switch (cmd) { case MSM_CAM_IOCTL_GETFRAME: /* Coming from frame thread to get frame * after SELECT is done */ rc = msm_get_frame(pmsm->sync, argp); break; case MSM_CAM_IOCTL_RELEASE_FRAME_BUFFER: rc = msm_put_frame_buffer(pmsm->sync, argp); break; case MSM_CAM_IOCTL_UNBLOCK_POLL_FRAME: rc = msm_unblock_poll_frame(pmsm->sync); break; default: break; } return rc; } static long msm_ioctl_control(struct file *filep, unsigned int cmd, unsigned long arg) { int rc = -EINVAL; void __user *argp = (void __user *)arg; struct msm_control_device *ctrl_pmsm = filep->private_data; struct msm_device *pmsm = ctrl_pmsm->pmsm; switch (cmd) { case MSM_CAM_IOCTL_CTRL_COMMAND: /* Coming from control thread, may need to wait for * command status */ CDBG("calling msm_control kernel msm_ioctl_control\n"); rc = msm_control(ctrl_pmsm, 1, argp); break; case MSM_CAM_IOCTL_CTRL_COMMAND_2: /* Sends a message, returns immediately */ rc = msm_control(ctrl_pmsm, 0, argp); break; case MSM_CAM_IOCTL_CTRL_CMD_DONE: /* Config thread calls the control thread to notify it * of the result of a MSM_CAM_IOCTL_CTRL_COMMAND. */ rc = msm_ctrl_cmd_done(ctrl_pmsm, argp); break; case MSM_CAM_IOCTL_GET_PICTURE: rc = msm_get_pic(pmsm->sync, argp); break; case MSM_CAM_IOCTL_GET_SENSOR_INFO: rc = msm_get_sensor_info(pmsm->sync, argp); break; default: rc = msm_ioctl_common(pmsm, cmd, argp); break; } return rc; } static int __msm_release(struct msm_sync *sync) { struct msm_pmem_region *region; struct hlist_node *hnode; struct hlist_node *n; mutex_lock(&sync->lock); if (sync->opencnt) sync->opencnt--; if (!sync->opencnt) { /*sensor release*/ sync->sctrl.s_release(); /* need to clean up system resource */ if (sync->vfefn.vfe_release) sync->vfefn.vfe_release(sync->pdev); kfree(sync->cropinfo); sync->cropinfo = NULL; sync->croplen = 0; hlist_for_each_entry_safe(region, hnode, n, &sync->pmem_frames, list) { hlist_del(hnode); put_pmem_file(region->file); kfree(region); } hlist_for_each_entry_safe(region, hnode, n, &sync->pmem_stats, list) { hlist_del(hnode); put_pmem_file(region->file); kfree(region); } msm_queue_drain(&sync->pict_q, list_pict); #ifdef CONFIG_SEMC_IMX046_CAMERA wake_unlock(&sync->suspend_lock); #endif /* CONFIG_SEMC_IMX046_CAMERA */ wake_unlock(&sync->wake_lock); sync->apps_id = NULL; CDBG("%s: completed\n", __func__); } mutex_unlock(&sync->lock); return 0; } static int msm_release_config(struct inode *node, struct file *filep) { int rc; struct msm_device *pmsm = filep->private_data; CDBG("%s: %s\n", __func__, filep->f_path.dentry->d_name.name); rc = __msm_release(pmsm->sync); if (!rc) { msm_queue_drain(&pmsm->sync->event_q, list_config); atomic_set(&pmsm->opened, 0); } return rc; } static int msm_release_control(struct inode *node, struct file *filep) { int rc; struct msm_control_device *ctrl_pmsm = filep->private_data; struct msm_device *pmsm = ctrl_pmsm->pmsm; CDBG("%s: %s\n", __func__, filep->f_path.dentry->d_name.name); g_v4l2_opencnt--; rc = __msm_release(pmsm->sync); if (!rc) { msm_queue_drain(&ctrl_pmsm->ctrl_q, list_control); kfree(ctrl_pmsm); } return rc; } static int msm_release_frame(struct inode *node, struct file *filep) { int rc; struct msm_device *pmsm = filep->private_data; CDBG("%s: %s\n", __func__, filep->f_path.dentry->d_name.name); rc = __msm_release(pmsm->sync); if (!rc) { msm_queue_drain(&pmsm->sync->frame_q, list_frame); atomic_set(&pmsm->opened, 0); } return rc; } static int msm_unblock_poll_frame(struct msm_sync *sync) { unsigned long flags; CDBG("%s\n", __func__); spin_lock_irqsave(&sync->frame_q.lock, flags); sync->unblock_poll_frame = 1; wake_up(&sync->frame_q.wait); spin_unlock_irqrestore(&sync->frame_q.lock, flags); return 0; } static unsigned int __msm_poll_frame(struct msm_sync *sync, struct file *filep, struct poll_table_struct *pll_table) { int rc = 0; unsigned long flags; poll_wait(filep, &sync->frame_q.wait, pll_table); spin_lock_irqsave(&sync->frame_q.lock, flags); if (!list_empty_careful(&sync->frame_q.list)) /* frame ready */ rc = POLLIN | POLLRDNORM; if (sync->unblock_poll_frame) { CDBG("%s: sync->unblock_poll_frame is true\n", __func__); rc |= POLLPRI; sync->unblock_poll_frame = 0; } spin_unlock_irqrestore(&sync->frame_q.lock, flags); return rc; } static unsigned int msm_poll_frame(struct file *filep, struct poll_table_struct *pll_table) { struct msm_device *pmsm = filep->private_data; return __msm_poll_frame(pmsm->sync, filep, pll_table); } /* * This function executes in interrupt context. */ static void *msm_vfe_sync_alloc(int size, void *syncdata __attribute__((unused)), gfp_t gfp) { struct msm_queue_cmd *qcmd = kmalloc(sizeof(struct msm_queue_cmd) + size, gfp); if (qcmd) { qcmd->on_heap = 1; return qcmd + 1; } return NULL; } static void msm_vfe_sync_free(void *ptr) { if (ptr) { struct msm_queue_cmd *qcmd = (struct msm_queue_cmd *)ptr; qcmd--; if (qcmd->on_heap) kfree(qcmd); } } /* * This function executes in interrupt context. */ static void msm_vfe_sync(struct msm_vfe_resp *vdata, enum msm_queue qtype, void *syncdata, gfp_t gfp) { struct msm_queue_cmd *qcmd = NULL; struct msm_sync *sync = (struct msm_sync *)syncdata; if (!sync) { pr_err("%s: no context in dsp callback.\n", __func__); return; } qcmd = ((struct msm_queue_cmd *)vdata) - 1; qcmd->type = qtype; qcmd->command = vdata; if (qtype != MSM_CAM_Q_VFE_MSG) goto for_config; CDBG("%s: vdata->type %d\n", __func__, vdata->type); switch (vdata->type) { case VFE_MSG_OUTPUT_P: if (sync->pp_mask & PP_PREV) { CDBG("%s: PP_PREV in progress: phy_y %x phy_cbcr %x\n", __func__, vdata->phy.y_phy, vdata->phy.cbcr_phy); mutex_lock(&pp_prev_lock); if (sync->pp_prev) pr_warning("%s: overwriting pp_prev!\n", __func__); pr_info("%s: sending preview to config\n", __func__); sync->pp_prev = qcmd; mutex_unlock(&pp_prev_lock); break; } CDBG("%s: msm_enqueue frame_q\n", __func__); msm_enqueue(&sync->frame_q, &qcmd->list_frame); if (qcmd->on_heap) qcmd->on_heap++; break; case VFE_MSG_OUTPUT_V: CDBG("%s: msm_enqueue video frame_q\n", __func__); msm_enqueue(&sync->frame_q, &qcmd->list_frame); if (qcmd->on_heap) qcmd->on_heap++; break; case VFE_MSG_SNAPSHOT: if (sync->pp_mask & (PP_SNAP | PP_RAW_SNAP)) { CDBG("%s: PP_SNAP in progress: pp_mask %x\n", __func__, sync->pp_mask); mutex_lock(&pp_snap_lock); if (sync->pp_snap) pr_warning("%s: overwriting pp_snap!\n", __func__); pr_info("%s: sending snapshot to config\n", __func__); sync->pp_snap = qcmd; mutex_unlock(&pp_snap_lock); break; } msm_enqueue(&sync->pict_q, &qcmd->list_pict); if (qcmd->on_heap) qcmd->on_heap++; break; case VFE_MSG_STATS_AWB: CDBG("%s: qtype %d, AWB stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_AEC: CDBG("%s: qtype %d, AEC stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_IHIST: CDBG("%s: qtype %d, ihist stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_RS: CDBG("%s: qtype %d, rs stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_CS: CDBG("%s: qtype %d, cs stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_GENERAL: CDBG("%s: qtype %d, general msg, enqueue event_q.\n", __func__, vdata->type); break; default: CDBG("%s: qtype %d not handled\n", __func__, vdata->type); /* fall through, send to config. */ } for_config: CDBG("%s: msm_enqueue event_q\n", __func__); msm_enqueue(&sync->event_q, &qcmd->list_config); } static struct msm_vfe_callback msm_vfe_s = { .vfe_resp = msm_vfe_sync, .vfe_alloc = msm_vfe_sync_alloc, .vfe_free = msm_vfe_sync_free, }; void msm_sensor_sync(struct msm_sensor_resp_t *vdata, enum msm_queue qtype, void *syncdata) { struct msm_queue_cmd *qcmd = NULL; struct msm_sensor_resp_t *sensorcmd; struct msm_sync *sync = (struct msm_sync *)syncdata; if (!sync) return; sensorcmd = kmalloc(sizeof(struct msm_sensor_resp_t), GFP_ATOMIC); if (!sensorcmd) { CDBG("msm_sensor_sync: sensorcmd can't allocate buffer\n"); goto end; } qcmd = kmalloc(sizeof(struct msm_queue_cmd), GFP_ATOMIC); if (!qcmd) { CDBG("evt_msg: cannot allocate buffer\n"); goto mem_fail1; } sensorcmd->type = vdata->type; sensorcmd->extdata = NULL; sensorcmd->extlen = 0; if (vdata->extlen > 0) { sensorcmd->extdata = kmalloc(vdata->extlen, GFP_ATOMIC); if(!sensorcmd->extdata) { goto mem_fail2; } memcpy(sensorcmd->extdata, vdata->extdata, vdata->extlen); sensorcmd->extlen = vdata->extlen; } if (MSM_CAM_Q_SENSOR_MSG == qtype) { switch (sensorcmd->type) { case SENSOR_RESP_MSG_EVENT: case SENSOR_RESP_MSG_INT_EVENT: case SENSOR_RESP_MSG_MSG_GENERAL: break; default: goto mem_fail3; break; } qcmd->type = MSM_CAM_Q_SENSOR_MSG; } else { goto mem_fail3; } qcmd->command = (void *)sensorcmd; CDBG("sensorcmd->type = %d\n", sensorcmd->type); CDBG("%s: msm_enqueue event_q\n", __func__); msm_enqueue(&sync->event_q, &qcmd->list_config); return; mem_fail3: if (sensorcmd->extdata) { kfree(sensorcmd->extdata); } mem_fail2: kfree(qcmd); mem_fail1: kfree(sensorcmd); end: return; } static struct msm_sensor_resp msm_sensor_s = { .sensor_resp = msm_sensor_sync, }; static int __msm_open(struct msm_sync *sync, const char *const apps_id) { int rc = 0; mutex_lock(&sync->lock); if (sync->apps_id && strcmp(sync->apps_id, apps_id) && (!strcmp(MSM_APPS_ID_V4L2, apps_id))) { pr_err("%s(%s): sensor %s is already opened for %s\n", __func__, apps_id, sync->sdata->sensor_name, sync->apps_id); rc = -EBUSY; goto msm_open_done; } sync->apps_id = apps_id; if (!sync->opencnt) { #ifdef CONFIG_SEMC_IMX046_CAMERA wake_lock(&sync->suspend_lock); #endif /* CONFIG_SEMC_IMX046_CAMERA */ wake_lock(&sync->wake_lock); msm_camvfe_fn_init(&sync->vfefn, sync); if (sync->vfefn.vfe_init) { sync->get_pic_abort = 0; rc = sync->vfefn.vfe_init(&msm_vfe_s, sync->pdev); if (rc < 0) { pr_err("%s: vfe_init failed at %d\n", __func__, rc); goto msm_open_done; } if (sync->sctrl.s_check) { rc = sync->sctrl.s_check(sync, &msm_sensor_s); if (rc < 0) { pr_err("%s: sensor check failed at %d\n", __func__, rc); goto msm_open_done; } } rc = sync->sctrl.s_init(sync->sdata); if (rc < 0) { pr_err("%s: sensor init failed: %d\n", __func__, rc); goto msm_open_done; } } else { pr_err("%s: no sensor init func\n", __func__); rc = -ENODEV; goto msm_open_done; } if (rc >= 0) { msm_region_init(sync); sync->unblock_poll_frame = 0; } } sync->opencnt++; msm_open_done: mutex_unlock(&sync->lock); return rc; } static int msm_open_common(struct inode *inode, struct file *filep, int once) { int rc; struct msm_device *pmsm = container_of(inode->i_cdev, struct msm_device, cdev); CDBG("%s: open %s\n", __func__, filep->f_path.dentry->d_name.name); if (atomic_cmpxchg(&pmsm->opened, 0, 1) && once) { pr_err("%s: %s is already opened.\n", __func__, filep->f_path.dentry->d_name.name); return -EBUSY; } rc = nonseekable_open(inode, filep); if (rc < 0) { pr_err("%s: nonseekable_open error %d\n", __func__, rc); return rc; } rc = __msm_open(pmsm->sync, MSM_APPS_ID_PROP); if (rc < 0) return rc; filep->private_data = pmsm; CDBG("%s: rc %d\n", __func__, rc); return rc; } static int msm_open(struct inode *inode, struct file *filep) { return msm_open_common(inode, filep, 1); } static int msm_open_control(struct inode *inode, struct file *filep) { int rc; struct msm_control_device *ctrl_pmsm = kmalloc(sizeof(struct msm_control_device), GFP_KERNEL); if (!ctrl_pmsm) return -ENOMEM; rc = msm_open_common(inode, filep, 0); if (rc < 0) return rc; ctrl_pmsm->pmsm = filep->private_data; filep->private_data = ctrl_pmsm; msm_queue_init(&ctrl_pmsm->ctrl_q, "control"); if (!g_v4l2_opencnt) g_v4l2_control_device = ctrl_pmsm; g_v4l2_opencnt++; CDBG("%s: rc %d\n", __func__, rc); return rc; } static int __msm_v4l2_control(struct msm_sync *sync, struct msm_ctrl_cmd *out) { int rc = 0; struct msm_queue_cmd *qcmd = NULL, *rcmd = NULL; struct msm_ctrl_cmd *ctrl; struct msm_device_queue *v4l2_ctrl_q = &g_v4l2_control_device->ctrl_q; /* wake up config thread, 4 is for V4L2 application */ qcmd = kmalloc(sizeof(struct msm_queue_cmd), GFP_KERNEL); if (!qcmd) { pr_err("%s: cannot allocate buffer\n", __func__); rc = -ENOMEM; goto end; } qcmd->type = MSM_CAM_Q_V4L2_REQ; qcmd->command = out; qcmd->on_heap = 1; if (out->type == V4L2_CAMERA_EXIT) { rcmd = __msm_control(sync, NULL, qcmd, out->timeout_ms); if (rcmd == NULL) { rc = PTR_ERR(rcmd); goto end; } } rcmd = __msm_control(sync, v4l2_ctrl_q, qcmd, out->timeout_ms); if (IS_ERR(rcmd)) { rc = PTR_ERR(rcmd); goto end; } ctrl = (struct msm_ctrl_cmd *)(rcmd->command); /* FIXME: we should just set out->length = ctrl->length; */ BUG_ON(out->length < ctrl->length); memcpy(out->value, ctrl->value, ctrl->length); end: free_qcmd(rcmd); CDBG("%s: rc %d\n", __func__, rc); return rc; } static const struct file_operations msm_fops_config = { .owner = THIS_MODULE, .open = msm_open, .unlocked_ioctl = msm_ioctl_config, .release = msm_release_config, }; static const struct file_operations msm_fops_control = { .owner = THIS_MODULE, .open = msm_open_control, .unlocked_ioctl = msm_ioctl_control, .release = msm_release_control, }; static const struct file_operations msm_fops_frame = { .owner = THIS_MODULE, .open = msm_open, .unlocked_ioctl = msm_ioctl_frame, .release = msm_release_frame, .poll = msm_poll_frame, }; static int msm_setup_cdev(struct msm_device *msm, int node, dev_t devno, const char *suffix, const struct file_operations *fops) { int rc = -ENODEV; struct device *device = device_create(msm_class, NULL, devno, NULL, "%s%d", suffix, node); if (IS_ERR(device)) { rc = PTR_ERR(device); pr_err("%s: error creating device: %d\n", __func__, rc); return rc; } cdev_init(&msm->cdev, fops); msm->cdev.owner = THIS_MODULE; rc = cdev_add(&msm->cdev, devno, 1); if (rc < 0) { pr_err("%s: error adding cdev: %d\n", __func__, rc); device_destroy(msm_class, devno); return rc; } return rc; } static int msm_tear_down_cdev(struct msm_device *msm, dev_t devno) { cdev_del(&msm->cdev); device_destroy(msm_class, devno); return 0; } int msm_v4l2_register(struct msm_v4l2_driver *drv) { /* FIXME: support multiple sensors */ if (list_empty(&msm_sensors)) return -ENODEV; drv->sync = list_first_entry(&msm_sensors, struct msm_sync, list); drv->open = __msm_open; drv->release = __msm_release; drv->ctrl = __msm_v4l2_control; drv->reg_pmem = __msm_register_pmem; drv->get_frame = __msm_get_frame; drv->put_frame = __msm_put_frame_buf; drv->get_pict = __msm_get_pic; drv->drv_poll = __msm_poll_frame; return 0; } EXPORT_SYMBOL(msm_v4l2_register); int msm_v4l2_unregister(struct msm_v4l2_driver *drv) { drv->sync = NULL; return 0; } EXPORT_SYMBOL(msm_v4l2_unregister); static int msm_sync_init(struct msm_sync *sync, struct platform_device *pdev, int (*sensor_probe)(const struct msm_camera_sensor_info *, struct msm_sensor_ctrl *)) { int rc = 0; struct msm_sensor_ctrl sctrl; sync->sdata = pdev->dev.platform_data; memset(&sctrl, 0, sizeof(struct msm_sensor_ctrl)); msm_queue_init(&sync->event_q, "event"); msm_queue_init(&sync->frame_q, "frame"); msm_queue_init(&sync->pict_q, "pict"); #ifdef CONFIG_SEMC_IMX046_CAMERA wake_lock_init(&sync->suspend_lock, WAKE_LOCK_SUSPEND, "msm_camera_suspend"); #endif /* CONFIG_SEMC_IMX046_CAMERA */ wake_lock_init(&sync->wake_lock, WAKE_LOCK_IDLE, "msm_camera"); rc = msm_camio_probe_on(pdev); if (rc < 0) return rc; rc = sensor_probe(sync->sdata, &sctrl); if (rc >= 0) { sync->pdev = pdev; sync->sctrl = sctrl; } msm_camio_probe_off(pdev); if (rc < 0) { pr_err("%s: failed to initialize %s\n", __func__, sync->sdata->sensor_name); #ifdef CONFIG_SEMC_IMX046_CAMERA wake_lock_destroy(&sync->suspend_lock); #endif /* CONFIG_SEMC_IMX046_CAMERA */ wake_lock_destroy(&sync->wake_lock); return rc; } sync->opencnt = 0; mutex_init(&sync->lock); CDBG("%s: initialized %s\n", __func__, sync->sdata->sensor_name); return rc; } static int msm_sync_destroy(struct msm_sync *sync) { #ifdef CONFIG_SEMC_IMX046_CAMERA wake_lock_destroy(&sync->suspend_lock); #endif /* CONFIG_SEMC_IMX046_CAMERA */ wake_lock_destroy(&sync->wake_lock); return 0; } static int msm_device_init(struct msm_device *pmsm, struct msm_sync *sync, int node) { int dev_num = 3 * node; int rc = msm_setup_cdev(pmsm, node, MKDEV(MAJOR(msm_devno), dev_num), "control", &msm_fops_control); if (rc < 0) { pr_err("%s: error creating control node: %d\n", __func__, rc); return rc; } rc = msm_setup_cdev(pmsm + 1, node, MKDEV(MAJOR(msm_devno), dev_num + 1), "config", &msm_fops_config); if (rc < 0) { pr_err("%s: error creating config node: %d\n", __func__, rc); msm_tear_down_cdev(pmsm, MKDEV(MAJOR(msm_devno), dev_num)); return rc; } rc = msm_setup_cdev(pmsm + 2, node, MKDEV(MAJOR(msm_devno), dev_num + 2), "frame", &msm_fops_frame); if (rc < 0) { pr_err("%s: error creating frame node: %d\n", __func__, rc); msm_tear_down_cdev(pmsm, MKDEV(MAJOR(msm_devno), dev_num)); msm_tear_down_cdev(pmsm + 1, MKDEV(MAJOR(msm_devno), dev_num + 1)); return rc; } atomic_set(&pmsm[0].opened, 0); atomic_set(&pmsm[1].opened, 0); atomic_set(&pmsm[2].opened, 0); pmsm[0].sync = sync; pmsm[1].sync = sync; pmsm[2].sync = sync; return rc; } int msm_camera_drv_start(struct platform_device *dev, int (*sensor_probe)(const struct msm_camera_sensor_info *, struct msm_sensor_ctrl *)) { struct msm_device *pmsm = NULL; struct msm_sync *sync; int rc = -ENODEV; static int camera_node; if (camera_node >= MSM_MAX_CAMERA_SENSORS) { pr_err("%s: too many camera sensors\n", __func__); return rc; } if (!msm_class) { /* There are three device nodes per sensor */ rc = alloc_chrdev_region(&msm_devno, 0, 3 * MSM_MAX_CAMERA_SENSORS, "msm_camera"); if (rc < 0) { pr_err("%s: failed to allocate chrdev: %d\n", __func__, rc); return rc; } msm_class = class_create(THIS_MODULE, "msm_camera"); if (IS_ERR(msm_class)) { rc = PTR_ERR(msm_class); pr_err("%s: create device class failed: %d\n", __func__, rc); return rc; } } pmsm = kzalloc(sizeof(struct msm_device) * 3 + sizeof(struct msm_sync), GFP_ATOMIC); if (!pmsm) return -ENOMEM; sync = (struct msm_sync *)(pmsm + 3); rc = msm_sync_init(sync, dev, sensor_probe); if (rc < 0) { kfree(pmsm); return rc; } CDBG("%s: setting camera node %d\n", __func__, camera_node); rc = msm_device_init(pmsm, sync, camera_node); if (rc < 0) { msm_sync_destroy(sync); kfree(pmsm); return rc; } camera_node++; list_add(&sync->list, &msm_sensors); return rc; } EXPORT_SYMBOL(msm_camera_drv_start);
var class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee = [ [ "AccountId", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#aa5f13daf52f6212580695248d62ed83d", null ], [ "AuditTs", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#a95210c8ea60bb4107cb1a76b0617e58a", null ], [ "AuditUserId", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#ad3b75c8f461c7ebc2756c1fddca8991d", null ], [ "IsFlatAmount", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#a7f09ea80a18909ebaeb1f2c561a63e77", null ], [ "LateFeeCode", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#af38567944abc8be98c7ac91c30d4f1f5", null ], [ "LateFeeId", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#a95fd529069d0e5705260329f8d895e5c", null ], [ "LateFeeName", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#a770c2823bf447fb41c54062fef2334ba", null ], [ "Rate", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#ab6a4512cbe1dcde39c2ec00be539acbf", null ] ];
<html> <head> <title>Event Render</title> <script type="text/javascript" src="../../protovis.js"></script> <link rel="stylesheet" type="text/css" href="../style.css"/> </head> <body> <script type="text/javascript+protovis"> var vis = new pv.Panel() .width(200) .height(200) .strokeStyle("black") .lineWidth(10); var bar = vis.add(pv.Bar) .fillStyle("green") .event("mouseover", function() { this.fillStyle("lightgreen").render(); label.text(this.fillStyle().color); vis.render(); }) .event("mouseout", function() { this.fillStyle("green"); label.text("*** rgb(144,238,144) ***"); vis.render(); }); var label = bar.anchor("center").add(pv.Label) .text("MOUSEOVER ME"); vis.render(); </script><p> This test verifies that <tt>render</tt> does not lose scene context.<p> This test works by redefining the <tt>fillStyle</tt> on the bar on mouseover. The bar is immediately rendered, and then the label's text property is set to the evaluated <tt>fillStyle</tt>. This property value can be queried because rendering does not blindly erase the <tt>scene</tt> and <tt>index</tt> attributes associated with bar after rendering. </body> </html>
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\EnvParameterException; /** * This class is used to remove circular dependencies between individual passes. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class Compiler { private $passConfig; private $log = []; private $loggingFormatter; private $serviceReferenceGraph; public function __construct() { $this->passConfig = new PassConfig(); $this->serviceReferenceGraph = new ServiceReferenceGraph(); } /** * Returns the PassConfig. * * @return PassConfig The PassConfig instance */ public function getPassConfig() { return $this->passConfig; } /** * Returns the ServiceReferenceGraph. * * @return ServiceReferenceGraph The ServiceReferenceGraph instance */ public function getServiceReferenceGraph() { return $this->serviceReferenceGraph; } /** * Returns the logging formatter which can be used by compilation passes. * * @return LoggingFormatter * * @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead. */ public function getLoggingFormatter() { if (null === $this->loggingFormatter) { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), E_USER_DEPRECATED); $this->loggingFormatter = new LoggingFormatter(); } return $this->loggingFormatter; } /** * Adds a pass to the PassConfig. * * @param CompilerPassInterface $pass A compiler pass * @param string $type The type of the pass * @param int $priority Used to sort the passes */ public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/) { if (\func_num_args() >= 3) { $priority = func_get_arg(2); } else { if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); if (__CLASS__ !== $r->getDeclaringClass()->getName()) { @trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since Symfony 3.2.', __METHOD__), E_USER_DEPRECATED); } } $priority = 0; } $this->passConfig->addPass($pass, $type, $priority); } /** * Adds a log message. * * @param string $string The log message * * @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead. */ public function addLogMessage($string) { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), E_USER_DEPRECATED); $this->log[] = $string; } /** * @final */ public function log(CompilerPassInterface $pass, $message) { if (false !== strpos($message, "\n")) { $message = str_replace("\n", "\n".\get_class($pass).': ', trim($message)); } $this->log[] = \get_class($pass).': '.$message; } /** * Returns the log. * * @return array Log array */ public function getLog() { return $this->log; } /** * Run the Compiler and process all Passes. */ public function compile(ContainerBuilder $container) { try { foreach ($this->passConfig->getPasses() as $pass) { $pass->process($container); } } catch (\Exception $e) { $usedEnvs = []; $prev = $e; do { $msg = $prev->getMessage(); if ($msg !== $resolvedMsg = $container->resolveEnvPlaceholders($msg, null, $usedEnvs)) { $r = new \ReflectionProperty($prev, 'message'); $r->setAccessible(true); $r->setValue($prev, $resolvedMsg); } } while ($prev = $prev->getPrevious()); if ($usedEnvs) { $e = new EnvParameterException($usedEnvs, $e); } throw $e; } finally { $this->getServiceReferenceGraph()->clear(); } } }
# Volatility # Copyright (c) 2008-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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. # # Volatility 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 Volatility. If not, see <http://www.gnu.org/licenses/>. # """ @author: MHL @license: GNU General Public License 2.0 @contact: michael.ligh@mnin.org This file provides support for Vista SP1 and SP2 x64 """ syscalls = [ [ 'NtMapUserPhysicalPagesScatter', # 0x0 'NtWaitForSingleObject', # 0x1 'NtCallbackReturn', # 0x2 'NtReadFile', # 0x3 'NtDeviceIoControlFile', # 0x4 'NtWriteFile', # 0x5 'NtRemoveIoCompletion', # 0x6 'NtReleaseSemaphore', # 0x7 'NtReplyWaitReceivePort', # 0x8 'NtReplyPort', # 0x9 'NtSetInformationThread', # 0xa 'NtSetEvent', # 0xb 'NtClose', # 0xc 'NtQueryObject', # 0xd 'NtQueryInformationFile', # 0xe 'NtOpenKey', # 0xf 'NtEnumerateValueKey', # 0x10 'NtFindAtom', # 0x11 'NtQueryDefaultLocale', # 0x12 'NtQueryKey', # 0x13 'NtQueryValueKey', # 0x14 'NtAllocateVirtualMemory', # 0x15 'NtQueryInformationProcess', # 0x16 'NtWaitForMultipleObjects32', # 0x17 'NtWriteFileGather', # 0x18 'NtSetInformationProcess', # 0x19 'NtCreateKey', # 0x1a 'NtFreeVirtualMemory', # 0x1b 'NtImpersonateClientOfPort', # 0x1c 'NtReleaseMutant', # 0x1d 'NtQueryInformationToken', # 0x1e 'NtRequestWaitReplyPort', # 0x1f 'NtQueryVirtualMemory', # 0x20 'NtOpenThreadToken', # 0x21 'NtQueryInformationThread', # 0x22 'NtOpenProcess', # 0x23 'NtSetInformationFile', # 0x24 'NtMapViewOfSection', # 0x25 'NtAccessCheckAndAuditAlarm', # 0x26 'NtUnmapViewOfSection', # 0x27 'NtReplyWaitReceivePortEx', # 0x28 'NtTerminateProcess', # 0x29 'NtSetEventBoostPriority', # 0x2a 'NtReadFileScatter', # 0x2b 'NtOpenThreadTokenEx', # 0x2c 'NtOpenProcessTokenEx', # 0x2d 'NtQueryPerformanceCounter', # 0x2e 'NtEnumerateKey', # 0x2f 'NtOpenFile', # 0x30 'NtDelayExecution', # 0x31 'NtQueryDirectoryFile', # 0x32 'NtQuerySystemInformation', # 0x33 'NtOpenSection', # 0x34 'NtQueryTimer', # 0x35 'NtFsControlFile', # 0x36 'NtWriteVirtualMemory', # 0x37 'NtCloseObjectAuditAlarm', # 0x38 'NtDuplicateObject', # 0x39 'NtQueryAttributesFile', # 0x3a 'NtClearEvent', # 0x3b 'NtReadVirtualMemory', # 0x3c 'NtOpenEvent', # 0x3d 'NtAdjustPrivilegesToken', # 0x3e 'NtDuplicateToken', # 0x3f 'NtContinue', # 0x40 'NtQueryDefaultUILanguage', # 0x41 'NtQueueApcThread', # 0x42 'NtYieldExecution', # 0x43 'NtAddAtom', # 0x44 'NtCreateEvent', # 0x45 'NtQueryVolumeInformationFile', # 0x46 'NtCreateSection', # 0x47 'NtFlushBuffersFile', # 0x48 'NtApphelpCacheControl', # 0x49 'NtCreateProcessEx', # 0x4a 'NtCreateThread', # 0x4b 'NtIsProcessInJob', # 0x4c 'NtProtectVirtualMemory', # 0x4d 'NtQuerySection', # 0x4e 'NtResumeThread', # 0x4f 'NtTerminateThread', # 0x50 'NtReadRequestData', # 0x51 'NtCreateFile', # 0x52 'NtQueryEvent', # 0x53 'NtWriteRequestData', # 0x54 'NtOpenDirectoryObject', # 0x55 'NtAccessCheckByTypeAndAuditAlarm', # 0x56 'NtQuerySystemTime', # 0x57 'NtWaitForMultipleObjects', # 0x58 'NtSetInformationObject', # 0x59 'NtCancelIoFile', # 0x5a 'NtTraceEvent', # 0x5b 'NtPowerInformation', # 0x5c 'NtSetValueKey', # 0x5d 'NtCancelTimer', # 0x5e 'NtSetTimer', # 0x5f 'NtAcceptConnectPort', # 0x60 'NtAccessCheck', # 0x61 'NtAccessCheckByType', # 0x62 'NtAccessCheckByTypeResultList', # 0x63 'NtAccessCheckByTypeResultListAndAuditAlarm', # 0x64 'NtAccessCheckByTypeResultListAndAuditAlarmByHandle', # 0x65 'NtAcquireCMFViewOwnership', # 0x66 'NtAddBootEntry', # 0x67 'NtAddDriverEntry', # 0x68 'NtAdjustGroupsToken', # 0x69 'NtAlertResumeThread', # 0x6a 'NtAlertThread', # 0x6b 'NtAllocateLocallyUniqueId', # 0x6c 'NtAllocateUserPhysicalPages', # 0x6d 'NtAllocateUuids', # 0x6e 'NtAlpcAcceptConnectPort', # 0x6f 'NtAlpcCancelMessage', # 0x70 'NtAlpcConnectPort', # 0x71 'NtAlpcCreatePort', # 0x72 'NtAlpcCreatePortSection', # 0x73 'NtAlpcCreateResourceReserve', # 0x74 'NtAlpcCreateSectionView', # 0x75 'NtAlpcCreateSecurityContext', # 0x76 'NtAlpcDeletePortSection', # 0x77 'NtAlpcDeleteResourceReserve', # 0x78 'NtAlpcDeleteSectionView', # 0x79 'NtAlpcDeleteSecurityContext', # 0x7a 'NtAlpcDisconnectPort', # 0x7b 'NtAlpcImpersonateClientOfPort', # 0x7c 'NtAlpcOpenSenderProcess', # 0x7d 'NtAlpcOpenSenderThread', # 0x7e 'NtAlpcQueryInformation', # 0x7f 'NtAlpcQueryInformationMessage', # 0x80 'NtAlpcRevokeSecurityContext', # 0x81 'NtAlpcSendWaitReceivePort', # 0x82 'NtAlpcSetInformation', # 0x83 'NtAreMappedFilesTheSame', # 0x84 'NtAssignProcessToJobObject', # 0x85 'NtCancelDeviceWakeupRequest', # 0x86 'NtCancelIoFileEx', # 0x87 'NtCancelSynchronousIoFile', # 0x88 'NtCommitComplete', # 0x89 'NtCommitEnlistment', # 0x8a 'NtCommitTransaction', # 0x8b 'NtCompactKeys', # 0x8c 'NtCompareTokens', # 0x8d 'NtCompleteConnectPort', # 0x8e 'NtCompressKey', # 0x8f 'NtConnectPort', # 0x90 'NtCreateDebugObject', # 0x91 'NtCreateDirectoryObject', # 0x92 'NtCreateEnlistment', # 0x93 'NtCreateEventPair', # 0x94 'NtCreateIoCompletion', # 0x95 'NtCreateJobObject', # 0x96 'NtCreateJobSet', # 0x97 'NtCreateKeyTransacted', # 0x98 'NtCreateKeyedEvent', # 0x99 'NtCreateMailslotFile', # 0x9a 'NtCreateMutant', # 0x9b 'NtCreateNamedPipeFile', # 0x9c 'NtCreatePagingFile', # 0x9d 'NtCreatePort', # 0x9e 'NtCreatePrivateNamespace', # 0x9f 'NtCreateProcess', # 0xa0 'NtCreateProfile', # 0xa1 'NtCreateResourceManager', # 0xa2 'NtCreateSemaphore', # 0xa3 'NtCreateSymbolicLinkObject', # 0xa4 'NtCreateThreadEx', # 0xa5 'NtCreateTimer', # 0xa6 'NtCreateToken', # 0xa7 'NtCreateTransaction', # 0xa8 'NtCreateTransactionManager', # 0xa9 'NtCreateUserProcess', # 0xaa 'NtCreateWaitablePort', # 0xab 'NtCreateWorkerFactory', # 0xac 'NtDebugActiveProcess', # 0xad 'NtDebugContinue', # 0xae 'NtDeleteAtom', # 0xaf 'NtDeleteBootEntry', # 0xb0 'NtDeleteDriverEntry', # 0xb1 'NtDeleteFile', # 0xb2 'NtDeleteKey', # 0xb3 'NtDeleteObjectAuditAlarm', # 0xb4 'NtDeletePrivateNamespace', # 0xb5 'NtDeleteValueKey', # 0xb6 'NtDisplayString', # 0xb7 'NtEnumerateBootEntries', # 0xb8 'NtEnumerateDriverEntries', # 0xb9 'NtEnumerateSystemEnvironmentValuesEx', # 0xba 'NtEnumerateTransactionObject', # 0xbb 'NtExtendSection', # 0xbc 'NtFilterToken', # 0xbd 'NtFlushInstallUILanguage', # 0xbe 'NtFlushInstructionCache', # 0xbf 'NtFlushKey', # 0xc0 'NtFlushProcessWriteBuffers', # 0xc1 'NtFlushVirtualMemory', # 0xc2 'NtFlushWriteBuffer', # 0xc3 'NtFreeUserPhysicalPages', # 0xc4 'NtFreezeRegistry', # 0xc5 'NtFreezeTransactions', # 0xc6 'NtGetContextThread', # 0xc7 'NtGetCurrentProcessorNumber', # 0xc8 'NtGetDevicePowerState', # 0xc9 'NtGetMUIRegistryInfo', # 0xca 'NtGetNextProcess', # 0xcb 'NtGetNextThread', # 0xcc 'NtGetNlsSectionPtr', # 0xcd 'NtGetNotificationResourceManager', # 0xce 'NtGetPlugPlayEvent', # 0xcf 'NtGetWriteWatch', # 0xd0 'NtImpersonateAnonymousToken', # 0xd1 'NtImpersonateThread', # 0xd2 'NtInitializeNlsFiles', # 0xd3 'NtInitializeRegistry', # 0xd4 'NtInitiatePowerAction', # 0xd5 'NtIsSystemResumeAutomatic', # 0xd6 'NtIsUILanguageComitted', # 0xd7 'NtListenPort', # 0xd8 'NtLoadDriver', # 0xd9 'NtLoadKey', # 0xda 'NtLoadKey2', # 0xdb 'NtLoadKeyEx', # 0xdc 'NtLockFile', # 0xdd 'NtLockProductActivationKeys', # 0xde 'NtLockRegistryKey', # 0xdf 'NtLockVirtualMemory', # 0xe0 'NtMakePermanentObject', # 0xe1 'NtMakeTemporaryObject', # 0xe2 'NtMapCMFModule', # 0xe3 'NtMapUserPhysicalPages', # 0xe4 'NtModifyBootEntry', # 0xe5 'NtModifyDriverEntry', # 0xe6 'NtNotifyChangeDirectoryFile', # 0xe7 'NtNotifyChangeKey', # 0xe8 'NtNotifyChangeMultipleKeys', # 0xe9 'NtOpenEnlistment', # 0xea 'NtOpenEventPair', # 0xeb 'NtOpenIoCompletion', # 0xec 'NtOpenJobObject', # 0xed 'NtOpenKeyTransacted', # 0xee 'NtOpenKeyedEvent', # 0xef 'NtOpenMutant', # 0xf0 'NtOpenObjectAuditAlarm', # 0xf1 'NtOpenPrivateNamespace', # 0xf2 'NtOpenProcessToken', # 0xf3 'NtOpenResourceManager', # 0xf4 'NtOpenSemaphore', # 0xf5 'NtOpenSession', # 0xf6 'NtOpenSymbolicLinkObject', # 0xf7 'NtOpenThread', # 0xf8 'NtOpenTimer', # 0xf9 'NtOpenTransaction', # 0xfa 'NtOpenTransactionManager', # 0xfb 'NtPlugPlayControl', # 0xfc 'NtPrePrepareComplete', # 0xfd 'NtPrePrepareEnlistment', # 0xfe 'NtPrepareComplete', # 0xff 'NtPrepareEnlistment', # 0x100 'NtPrivilegeCheck', # 0x101 'NtPrivilegeObjectAuditAlarm', # 0x102 'NtPrivilegedServiceAuditAlarm', # 0x103 'NtPropagationComplete', # 0x104 'NtPropagationFailed', # 0x105 'NtPulseEvent', # 0x106 'NtQueryBootEntryOrder', # 0x107 'NtQueryBootOptions', # 0x108 'NtQueryDebugFilterState', # 0x109 'NtQueryDirectoryObject', # 0x10a 'NtQueryDriverEntryOrder', # 0x10b 'NtQueryEaFile', # 0x10c 'NtQueryFullAttributesFile', # 0x10d 'NtQueryInformationAtom', # 0x10e 'NtQueryInformationEnlistment', # 0x10f 'NtQueryInformationJobObject', # 0x110 'NtQueryInformationPort', # 0x111 'NtQueryInformationResourceManager', # 0x112 'NtQueryInformationTransaction', # 0x113 'NtQueryInformationTransactionManager', # 0x114 'NtQueryInformationWorkerFactory', # 0x115 'NtQueryInstallUILanguage', # 0x116 'NtQueryIntervalProfile', # 0x117 'NtQueryIoCompletion', # 0x118 'NtQueryLicenseValue', # 0x119 'NtQueryMultipleValueKey', # 0x11a 'NtQueryMutant', # 0x11b 'NtQueryOpenSubKeys', # 0x11c 'NtQueryOpenSubKeysEx', # 0x11d 'NtQueryPortInformationProcess', # 0x11e 'NtQueryQuotaInformationFile', # 0x11f 'NtQuerySecurityObject', # 0x120 'NtQuerySemaphore', # 0x121 'NtQuerySymbolicLinkObject', # 0x122 'NtQuerySystemEnvironmentValue', # 0x123 'NtQuerySystemEnvironmentValueEx', # 0x124 'NtQueryTimerResolution', # 0x125 'NtRaiseException', # 0x126 'NtRaiseHardError', # 0x127 'NtReadOnlyEnlistment', # 0x128 'NtRecoverEnlistment', # 0x129 'NtRecoverResourceManager', # 0x12a 'NtRecoverTransactionManager', # 0x12b 'NtRegisterProtocolAddressInformation', # 0x12c 'NtRegisterThreadTerminatePort', # 0x12d 'NtReleaseCMFViewOwnership', # 0x12e 'NtReleaseKeyedEvent', # 0x12f 'NtReleaseWorkerFactoryWorker', # 0x130 'NtRemoveIoCompletionEx', # 0x131 'NtRemoveProcessDebug', # 0x132 'NtRenameKey', # 0x133 'NtRenameTransactionManager', # 0x134 'NtReplaceKey', # 0x135 'NtReplacePartitionUnit', # 0x136 'NtReplyWaitReplyPort', # 0x137 'NtRequestDeviceWakeup', # 0x138 'NtRequestPort', # 0x139 'NtRequestWakeupLatency', # 0x13a 'NtResetEvent', # 0x13b 'NtResetWriteWatch', # 0x13c 'NtRestoreKey', # 0x13d 'NtResumeProcess', # 0x13e 'NtRollbackComplete', # 0x13f 'NtRollbackEnlistment', # 0x140 'NtRollbackTransaction', # 0x141 'NtRollforwardTransactionManager', # 0x142 'NtSaveKey', # 0x143 'NtSaveKeyEx', # 0x144 'NtSaveMergedKeys', # 0x145 'NtSecureConnectPort', # 0x146 'NtSetBootEntryOrder', # 0x147 'NtSetBootOptions', # 0x148 'NtSetContextThread', # 0x149 'NtSetDebugFilterState', # 0x14a 'NtSetDefaultHardErrorPort', # 0x14b 'NtSetDefaultLocale', # 0x14c 'NtSetDefaultUILanguage', # 0x14d 'NtSetDriverEntryOrder', # 0x14e 'NtSetEaFile', # 0x14f 'NtSetHighEventPair', # 0x150 'NtSetHighWaitLowEventPair', # 0x151 'NtSetInformationDebugObject', # 0x152 'NtSetInformationEnlistment', # 0x153 'NtSetInformationJobObject', # 0x154 'NtSetInformationKey', # 0x155 'NtSetInformationResourceManager', # 0x156 'NtSetInformationToken', # 0x157 'NtSetInformationTransaction', # 0x158 'NtSetInformationTransactionManager', # 0x159 'NtSetInformationWorkerFactory', # 0x15a 'NtSetIntervalProfile', # 0x15b 'NtSetIoCompletion', # 0x15c 'NtSetLdtEntries', # 0x15d 'NtSetLowEventPair', # 0x15e 'NtSetLowWaitHighEventPair', # 0x15f 'NtSetQuotaInformationFile', # 0x160 'NtSetSecurityObject', # 0x161 'NtSetSystemEnvironmentValue', # 0x162 'NtSetSystemEnvironmentValueEx', # 0x163 'NtSetSystemInformation', # 0x164 'NtSetSystemPowerState', # 0x165 'NtSetSystemTime', # 0x166 'NtSetThreadExecutionState', # 0x167 'NtSetTimerResolution', # 0x168 'NtSetUuidSeed', # 0x169 'NtSetVolumeInformationFile', # 0x16a 'NtShutdownSystem', # 0x16b 'NtShutdownWorkerFactory', # 0x16c 'NtSignalAndWaitForSingleObject', # 0x16d 'NtSinglePhaseReject', # 0x16e 'NtStartProfile', # 0x16f 'NtStopProfile', # 0x170 'NtSuspendProcess', # 0x171 'NtSuspendThread', # 0x172 'NtSystemDebugControl', # 0x173 'NtTerminateJobObject', # 0x174 'NtTestAlert', # 0x175 'NtThawRegistry', # 0x176 'NtThawTransactions', # 0x177 'NtTraceControl', # 0x178 'NtTranslateFilePath', # 0x179 'NtUnloadDriver', # 0x17a 'NtUnloadKey', # 0x17b 'NtUnloadKey2', # 0x17c 'NtUnloadKeyEx', # 0x17d 'NtUnlockFile', # 0x17e 'NtUnlockVirtualMemory', # 0x17f 'NtVdmControl', # 0x180 'NtWaitForDebugEvent', # 0x181 'NtWaitForKeyedEvent', # 0x182 'NtWaitForWorkViaWorkerFactory', # 0x183 'NtWaitHighEventPair', # 0x184 'NtWaitLowEventPair', # 0x185 'NtWorkerFactoryWorkerReady', # 0x186 ], [ 'NtUserGetThreadState', # 0x0 'NtUserPeekMessage', # 0x1 'NtUserCallOneParam', # 0x2 'NtUserGetKeyState', # 0x3 'NtUserInvalidateRect', # 0x4 'NtUserCallNoParam', # 0x5 'NtUserGetMessage', # 0x6 'NtUserMessageCall', # 0x7 'NtGdiBitBlt', # 0x8 'NtGdiGetCharSet', # 0x9 'NtUserGetDC', # 0xa 'NtGdiSelectBitmap', # 0xb 'NtUserWaitMessage', # 0xc 'NtUserTranslateMessage', # 0xd 'NtUserGetProp', # 0xe 'NtUserPostMessage', # 0xf 'NtUserQueryWindow', # 0x10 'NtUserTranslateAccelerator', # 0x11 'NtGdiFlush', # 0x12 'NtUserRedrawWindow', # 0x13 'NtUserWindowFromPoint', # 0x14 'NtUserCallMsgFilter', # 0x15 'NtUserValidateTimerCallback', # 0x16 'NtUserBeginPaint', # 0x17 'NtUserSetTimer', # 0x18 'NtUserEndPaint', # 0x19 'NtUserSetCursor', # 0x1a 'NtUserKillTimer', # 0x1b 'NtUserBuildHwndList', # 0x1c 'NtUserSelectPalette', # 0x1d 'NtUserCallNextHookEx', # 0x1e 'NtUserHideCaret', # 0x1f 'NtGdiIntersectClipRect', # 0x20 'NtUserCallHwndLock', # 0x21 'NtUserGetProcessWindowStation', # 0x22 'NtGdiDeleteObjectApp', # 0x23 'NtUserSetWindowPos', # 0x24 'NtUserShowCaret', # 0x25 'NtUserEndDeferWindowPosEx', # 0x26 'NtUserCallHwndParamLock', # 0x27 'NtUserVkKeyScanEx', # 0x28 'NtGdiSetDIBitsToDeviceInternal', # 0x29 'NtUserCallTwoParam', # 0x2a 'NtGdiGetRandomRgn', # 0x2b 'NtUserCopyAcceleratorTable', # 0x2c 'NtUserNotifyWinEvent', # 0x2d 'NtGdiExtSelectClipRgn', # 0x2e 'NtUserIsClipboardFormatAvailable', # 0x2f 'NtUserSetScrollInfo', # 0x30 'NtGdiStretchBlt', # 0x31 'NtUserCreateCaret', # 0x32 'NtGdiRectVisible', # 0x33 'NtGdiCombineRgn', # 0x34 'NtGdiGetDCObject', # 0x35 'NtUserDispatchMessage', # 0x36 'NtUserRegisterWindowMessage', # 0x37 'NtGdiExtTextOutW', # 0x38 'NtGdiSelectFont', # 0x39 'NtGdiRestoreDC', # 0x3a 'NtGdiSaveDC', # 0x3b 'NtUserGetForegroundWindow', # 0x3c 'NtUserShowScrollBar', # 0x3d 'NtUserFindExistingCursorIcon', # 0x3e 'NtGdiGetDCDword', # 0x3f 'NtGdiGetRegionData', # 0x40 'NtGdiLineTo', # 0x41 'NtUserSystemParametersInfo', # 0x42 'NtGdiGetAppClipBox', # 0x43 'NtUserGetAsyncKeyState', # 0x44 'NtUserGetCPD', # 0x45 'NtUserRemoveProp', # 0x46 'NtGdiDoPalette', # 0x47 'NtGdiPolyPolyDraw', # 0x48 'NtUserSetCapture', # 0x49 'NtUserEnumDisplayMonitors', # 0x4a 'NtGdiCreateCompatibleBitmap', # 0x4b 'NtUserSetProp', # 0x4c 'NtGdiGetTextCharsetInfo', # 0x4d 'NtUserSBGetParms', # 0x4e 'NtUserGetIconInfo', # 0x4f 'NtUserExcludeUpdateRgn', # 0x50 'NtUserSetFocus', # 0x51 'NtGdiExtGetObjectW', # 0x52 'NtUserDeferWindowPos', # 0x53 'NtUserGetUpdateRect', # 0x54 'NtGdiCreateCompatibleDC', # 0x55 'NtUserGetClipboardSequenceNumber', # 0x56 'NtGdiCreatePen', # 0x57 'NtUserShowWindow', # 0x58 'NtUserGetKeyboardLayoutList', # 0x59 'NtGdiPatBlt', # 0x5a 'NtUserMapVirtualKeyEx', # 0x5b 'NtUserSetWindowLong', # 0x5c 'NtGdiHfontCreate', # 0x5d 'NtUserMoveWindow', # 0x5e 'NtUserPostThreadMessage', # 0x5f 'NtUserDrawIconEx', # 0x60 'NtUserGetSystemMenu', # 0x61 'NtGdiDrawStream', # 0x62 'NtUserInternalGetWindowText', # 0x63 'NtUserGetWindowDC', # 0x64 'NtGdiD3dDrawPrimitives2', # 0x65 'NtGdiInvertRgn', # 0x66 'NtGdiGetRgnBox', # 0x67 'NtGdiGetAndSetDCDword', # 0x68 'NtGdiMaskBlt', # 0x69 'NtGdiGetWidthTable', # 0x6a 'NtUserScrollDC', # 0x6b 'NtUserGetObjectInformation', # 0x6c 'NtGdiCreateBitmap', # 0x6d 'NtGdiConsoleTextOut', # 0x6e 'NtUserFindWindowEx', # 0x6f 'NtGdiPolyPatBlt', # 0x70 'NtUserUnhookWindowsHookEx', # 0x71 'NtGdiGetNearestColor', # 0x72 'NtGdiTransformPoints', # 0x73 'NtGdiGetDCPoint', # 0x74 'NtUserCheckImeHotKey', # 0x75 'NtGdiCreateDIBBrush', # 0x76 'NtGdiGetTextMetricsW', # 0x77 'NtUserCreateWindowEx', # 0x78 'NtUserSetParent', # 0x79 'NtUserGetKeyboardState', # 0x7a 'NtUserToUnicodeEx', # 0x7b 'NtUserGetControlBrush', # 0x7c 'NtUserGetClassName', # 0x7d 'NtGdiAlphaBlend', # 0x7e 'NtGdiDdBlt', # 0x7f 'NtGdiOffsetRgn', # 0x80 'NtUserDefSetText', # 0x81 'NtGdiGetTextFaceW', # 0x82 'NtGdiStretchDIBitsInternal', # 0x83 'NtUserSendInput', # 0x84 'NtUserGetThreadDesktop', # 0x85 'NtGdiCreateRectRgn', # 0x86 'NtGdiGetDIBitsInternal', # 0x87 'NtUserGetUpdateRgn', # 0x88 'NtGdiDeleteClientObj', # 0x89 'NtUserGetIconSize', # 0x8a 'NtUserFillWindow', # 0x8b 'NtGdiExtCreateRegion', # 0x8c 'NtGdiComputeXformCoefficients', # 0x8d 'NtUserSetWindowsHookEx', # 0x8e 'NtUserNotifyProcessCreate', # 0x8f 'NtGdiUnrealizeObject', # 0x90 'NtUserGetTitleBarInfo', # 0x91 'NtGdiRectangle', # 0x92 'NtUserSetThreadDesktop', # 0x93 'NtUserGetDCEx', # 0x94 'NtUserGetScrollBarInfo', # 0x95 'NtGdiGetTextExtent', # 0x96 'NtUserSetWindowFNID', # 0x97 'NtGdiSetLayout', # 0x98 'NtUserCalcMenuBar', # 0x99 'NtUserThunkedMenuItemInfo', # 0x9a 'NtGdiExcludeClipRect', # 0x9b 'NtGdiCreateDIBSection', # 0x9c 'NtGdiGetDCforBitmap', # 0x9d 'NtUserDestroyCursor', # 0x9e 'NtUserDestroyWindow', # 0x9f 'NtUserCallHwndParam', # 0xa0 'NtGdiCreateDIBitmapInternal', # 0xa1 'NtUserOpenWindowStation', # 0xa2 'NtGdiDdDeleteSurfaceObject', # 0xa3 'NtGdiEnumFontClose', # 0xa4 'NtGdiEnumFontOpen', # 0xa5 'NtGdiEnumFontChunk', # 0xa6 'NtGdiDdCanCreateSurface', # 0xa7 'NtGdiDdCreateSurface', # 0xa8 'NtUserSetCursorIconData', # 0xa9 'NtGdiDdDestroySurface', # 0xaa 'NtUserCloseDesktop', # 0xab 'NtUserOpenDesktop', # 0xac 'NtUserSetProcessWindowStation', # 0xad 'NtUserGetAtomName', # 0xae 'NtGdiDdResetVisrgn', # 0xaf 'NtGdiExtCreatePen', # 0xb0 'NtGdiCreatePaletteInternal', # 0xb1 'NtGdiSetBrushOrg', # 0xb2 'NtUserBuildNameList', # 0xb3 'NtGdiSetPixel', # 0xb4 'NtUserRegisterClassExWOW', # 0xb5 'NtGdiCreatePatternBrushInternal', # 0xb6 'NtUserGetAncestor', # 0xb7 'NtGdiGetOutlineTextMetricsInternalW', # 0xb8 'NtGdiSetBitmapBits', # 0xb9 'NtUserCloseWindowStation', # 0xba 'NtUserGetDoubleClickTime', # 0xbb 'NtUserEnableScrollBar', # 0xbc 'NtGdiCreateSolidBrush', # 0xbd 'NtUserGetClassInfoEx', # 0xbe 'NtGdiCreateClientObj', # 0xbf 'NtUserUnregisterClass', # 0xc0 'NtUserDeleteMenu', # 0xc1 'NtGdiRectInRegion', # 0xc2 'NtUserScrollWindowEx', # 0xc3 'NtGdiGetPixel', # 0xc4 'NtUserSetClassLong', # 0xc5 'NtUserGetMenuBarInfo', # 0xc6 'NtGdiDdCreateSurfaceEx', # 0xc7 'NtGdiDdCreateSurfaceObject', # 0xc8 'NtGdiGetNearestPaletteIndex', # 0xc9 'NtGdiDdLockD3D', # 0xca 'NtGdiDdUnlockD3D', # 0xcb 'NtGdiGetCharWidthW', # 0xcc 'NtUserInvalidateRgn', # 0xcd 'NtUserGetClipboardOwner', # 0xce 'NtUserSetWindowRgn', # 0xcf 'NtUserBitBltSysBmp', # 0xd0 'NtGdiGetCharWidthInfo', # 0xd1 'NtUserValidateRect', # 0xd2 'NtUserCloseClipboard', # 0xd3 'NtUserOpenClipboard', # 0xd4 'NtGdiGetStockObject', # 0xd5 'NtUserSetClipboardData', # 0xd6 'NtUserEnableMenuItem', # 0xd7 'NtUserAlterWindowStyle', # 0xd8 'NtGdiFillRgn', # 0xd9 'NtUserGetWindowPlacement', # 0xda 'NtGdiModifyWorldTransform', # 0xdb 'NtGdiGetFontData', # 0xdc 'NtUserGetOpenClipboardWindow', # 0xdd 'NtUserSetThreadState', # 0xde 'NtGdiOpenDCW', # 0xdf 'NtUserTrackMouseEvent', # 0xe0 'NtGdiGetTransform', # 0xe1 'NtUserDestroyMenu', # 0xe2 'NtGdiGetBitmapBits', # 0xe3 'NtUserConsoleControl', # 0xe4 'NtUserSetActiveWindow', # 0xe5 'NtUserSetInformationThread', # 0xe6 'NtUserSetWindowPlacement', # 0xe7 'NtUserGetControlColor', # 0xe8 'NtGdiSetMetaRgn', # 0xe9 'NtGdiSetMiterLimit', # 0xea 'NtGdiSetVirtualResolution', # 0xeb 'NtGdiGetRasterizerCaps', # 0xec 'NtUserSetWindowWord', # 0xed 'NtUserGetClipboardFormatName', # 0xee 'NtUserRealInternalGetMessage', # 0xef 'NtUserCreateLocalMemHandle', # 0xf0 'NtUserAttachThreadInput', # 0xf1 'NtGdiCreateHalftonePalette', # 0xf2 'NtUserPaintMenuBar', # 0xf3 'NtUserSetKeyboardState', # 0xf4 'NtGdiCombineTransform', # 0xf5 'NtUserCreateAcceleratorTable', # 0xf6 'NtUserGetCursorFrameInfo', # 0xf7 'NtUserGetAltTabInfo', # 0xf8 'NtUserGetCaretBlinkTime', # 0xf9 'NtGdiQueryFontAssocInfo', # 0xfa 'NtUserProcessConnect', # 0xfb 'NtUserEnumDisplayDevices', # 0xfc 'NtUserEmptyClipboard', # 0xfd 'NtUserGetClipboardData', # 0xfe 'NtUserRemoveMenu', # 0xff 'NtGdiSetBoundsRect', # 0x100 'NtUserSetInformationProcess', # 0x101 'NtGdiGetBitmapDimension', # 0x102 'NtUserConvertMemHandle', # 0x103 'NtUserDestroyAcceleratorTable', # 0x104 'NtUserGetGUIThreadInfo', # 0x105 'NtGdiCloseFigure', # 0x106 'NtUserSetWindowsHookAW', # 0x107 'NtUserSetMenuDefaultItem', # 0x108 'NtUserCheckMenuItem', # 0x109 'NtUserSetWinEventHook', # 0x10a 'NtUserUnhookWinEvent', # 0x10b 'NtGdiSetupPublicCFONT', # 0x10c 'NtUserLockWindowUpdate', # 0x10d 'NtUserSetSystemMenu', # 0x10e 'NtUserThunkedMenuInfo', # 0x10f 'NtGdiBeginPath', # 0x110 'NtGdiEndPath', # 0x111 'NtGdiFillPath', # 0x112 'NtUserCallHwnd', # 0x113 'NtUserDdeInitialize', # 0x114 'NtUserModifyUserStartupInfoFlags', # 0x115 'NtUserCountClipboardFormats', # 0x116 'NtGdiAddFontMemResourceEx', # 0x117 'NtGdiEqualRgn', # 0x118 'NtGdiGetSystemPaletteUse', # 0x119 'NtGdiRemoveFontMemResourceEx', # 0x11a 'NtUserEnumDisplaySettings', # 0x11b 'NtUserPaintDesktop', # 0x11c 'NtGdiExtEscape', # 0x11d 'NtGdiSetBitmapDimension', # 0x11e 'NtGdiSetFontEnumeration', # 0x11f 'NtUserChangeClipboardChain', # 0x120 'NtUserResolveDesktop', # 0x121 'NtUserSetClipboardViewer', # 0x122 'NtUserShowWindowAsync', # 0x123 'NtUserSetConsoleReserveKeys', # 0x124 'NtGdiCreateColorSpace', # 0x125 'NtGdiDeleteColorSpace', # 0x126 'NtUserActivateKeyboardLayout', # 0x127 'NtGdiAbortDoc', # 0x128 'NtGdiAbortPath', # 0x129 'NtGdiAddEmbFontToDC', # 0x12a 'NtGdiAddFontResourceW', # 0x12b 'NtGdiAddRemoteFontToDC', # 0x12c 'NtGdiAddRemoteMMInstanceToDC', # 0x12d 'NtGdiAngleArc', # 0x12e 'NtGdiAnyLinkedFonts', # 0x12f 'NtGdiArcInternal', # 0x130 'NtGdiBRUSHOBJ_DeleteRbrush', # 0x131 'NtGdiBRUSHOBJ_hGetColorTransform', # 0x132 'NtGdiBRUSHOBJ_pvAllocRbrush', # 0x133 'NtGdiBRUSHOBJ_pvGetRbrush', # 0x134 'NtGdiBRUSHOBJ_ulGetBrushColor', # 0x135 'NtGdiCLIPOBJ_bEnum', # 0x136 'NtGdiCLIPOBJ_cEnumStart', # 0x137 'NtGdiCLIPOBJ_ppoGetPath', # 0x138 'NtGdiCancelDC', # 0x139 'NtGdiChangeGhostFont', # 0x13a 'NtGdiCheckBitmapBits', # 0x13b 'NtGdiClearBitmapAttributes', # 0x13c 'NtGdiClearBrushAttributes', # 0x13d 'NtGdiColorCorrectPalette', # 0x13e 'NtGdiConfigureOPMProtectedOutput', # 0x13f 'NtGdiConvertMetafileRect', # 0x140 'NtGdiCreateColorTransform', # 0x141 'NtGdiCreateEllipticRgn', # 0x142 'NtGdiCreateHatchBrushInternal', # 0x143 'NtGdiCreateMetafileDC', # 0x144 'NtGdiCreateOPMProtectedOutputs', # 0x145 'NtGdiCreateRoundRectRgn', # 0x146 'NtGdiCreateServerMetaFile', # 0x147 'NtGdiD3dContextCreate', # 0x148 'NtGdiD3dContextDestroy', # 0x149 'NtGdiD3dContextDestroyAll', # 0x14a 'NtGdiD3dValidateTextureStageState', # 0x14b 'NtGdiDDCCIGetCapabilitiesString', # 0x14c 'NtGdiDDCCIGetCapabilitiesStringLength', # 0x14d 'NtGdiDDCCIGetTimingReport', # 0x14e 'NtGdiDDCCIGetVCPFeature', # 0x14f 'NtGdiDDCCISaveCurrentSettings', # 0x150 'NtGdiDDCCISetVCPFeature', # 0x151 'NtGdiDdAddAttachedSurface', # 0x152 'NtGdiDdAlphaBlt', # 0x153 'NtGdiDdAttachSurface', # 0x154 'NtGdiDdBeginMoCompFrame', # 0x155 'NtGdiDdCanCreateD3DBuffer', # 0x156 'NtGdiDdColorControl', # 0x157 'NtGdiDdCreateD3DBuffer', # 0x158 'NtGdiDdCreateDirectDrawObject', # 0x159 'NtGdiDdCreateMoComp', # 0x15a 'NtGdiDdDDICheckExclusiveOwnership', # 0x15b 'NtGdiDdDDICheckMonitorPowerState', # 0x15c 'NtGdiDdDDICheckOcclusion', # 0x15d 'NtGdiDdDDICloseAdapter', # 0x15e 'NtGdiDdDDICreateAllocation', # 0x15f 'NtGdiDdDDICreateContext', # 0x160 'NtGdiDdDDICreateDCFromMemory', # 0x161 'NtGdiDdDDICreateDevice', # 0x162 'NtGdiDdDDICreateOverlay', # 0x163 'NtGdiDdDDICreateSynchronizationObject', # 0x164 'NtGdiDdDDIDestroyAllocation', # 0x165 'NtGdiDdDDIDestroyContext', # 0x166 'NtGdiDdDDIDestroyDCFromMemory', # 0x167 'NtGdiDdDDIDestroyDevice', # 0x168 'NtGdiDdDDIDestroyOverlay', # 0x169 'NtGdiDdDDIDestroySynchronizationObject', # 0x16a 'NtGdiDdDDIEscape', # 0x16b 'NtGdiDdDDIFlipOverlay', # 0x16c 'NtGdiDdDDIGetContextSchedulingPriority', # 0x16d 'NtGdiDdDDIGetDeviceState', # 0x16e 'NtGdiDdDDIGetDisplayModeList', # 0x16f 'NtGdiDdDDIGetMultisampleMethodList', # 0x170 'NtGdiDdDDIGetPresentHistory', # 0x171 'NtGdiDdDDIGetProcessSchedulingPriorityClass', # 0x172 'NtGdiDdDDIGetRuntimeData', # 0x173 'NtGdiDdDDIGetScanLine', # 0x174 'NtGdiDdDDIGetSharedPrimaryHandle', # 0x175 'NtGdiDdDDIInvalidateActiveVidPn', # 0x176 'NtGdiDdDDILock', # 0x177 'NtGdiDdDDIOpenAdapterFromDeviceName', # 0x178 'NtGdiDdDDIOpenAdapterFromHdc', # 0x179 'NtGdiDdDDIOpenResource', # 0x17a 'NtGdiDdDDIPollDisplayChildren', # 0x17b 'NtGdiDdDDIPresent', # 0x17c 'NtGdiDdDDIQueryAdapterInfo', # 0x17d 'NtGdiDdDDIQueryAllocationResidency', # 0x17e 'NtGdiDdDDIQueryResourceInfo', # 0x17f 'NtGdiDdDDIQueryStatistics', # 0x180 'NtGdiDdDDIReleaseProcessVidPnSourceOwners', # 0x181 'NtGdiDdDDIRender', # 0x182 'NtGdiDdDDISetAllocationPriority', # 0x183 'NtGdiDdDDISetContextSchedulingPriority', # 0x184 'NtGdiDdDDISetDisplayMode', # 0x185 'NtGdiDdDDISetDisplayPrivateDriverFormat', # 0x186 'NtGdiDdDDISetGammaRamp', # 0x187 'NtGdiDdDDISetProcessSchedulingPriorityClass', # 0x188 'NtGdiDdDDISetQueuedLimit', # 0x189 'NtGdiDdDDISetVidPnSourceOwner', # 0x18a 'NtGdiDdDDISharedPrimaryLockNotification', # 0x18b 'NtGdiDdDDISharedPrimaryUnLockNotification', # 0x18c 'NtGdiDdDDISignalSynchronizationObject', # 0x18d 'NtGdiDdDDIUnlock', # 0x18e 'NtGdiDdDDIUpdateOverlay', # 0x18f 'NtGdiDdDDIWaitForIdle', # 0x190 'NtGdiDdDDIWaitForSynchronizationObject', # 0x191 'NtGdiDdDDIWaitForVerticalBlankEvent', # 0x192 'NtGdiDdDeleteDirectDrawObject', # 0x193 'NtGdiDdDestroyD3DBuffer', # 0x194 'NtGdiDdDestroyMoComp', # 0x195 'NtGdiDdEndMoCompFrame', # 0x196 'NtGdiDdFlip', # 0x197 'NtGdiDdFlipToGDISurface', # 0x198 'NtGdiDdGetAvailDriverMemory', # 0x199 'NtGdiDdGetBltStatus', # 0x19a 'NtGdiDdGetDC', # 0x19b 'NtGdiDdGetDriverInfo', # 0x19c 'NtGdiDdGetDriverState', # 0x19d 'NtGdiDdGetDxHandle', # 0x19e 'NtGdiDdGetFlipStatus', # 0x19f 'NtGdiDdGetInternalMoCompInfo', # 0x1a0 'NtGdiDdGetMoCompBuffInfo', # 0x1a1 'NtGdiDdGetMoCompFormats', # 0x1a2 'NtGdiDdGetMoCompGuids', # 0x1a3 'NtGdiDdGetScanLine', # 0x1a4 'NtGdiDdLock', # 0x1a5 'NtGdiDdQueryDirectDrawObject', # 0x1a6 'NtGdiDdQueryMoCompStatus', # 0x1a7 'NtGdiDdReenableDirectDrawObject', # 0x1a8 'NtGdiDdReleaseDC', # 0x1a9 'NtGdiDdRenderMoComp', # 0x1aa 'NtGdiDdSetColorKey', # 0x1ab 'NtGdiDdSetExclusiveMode', # 0x1ac 'NtGdiDdSetGammaRamp', # 0x1ad 'NtGdiDdSetOverlayPosition', # 0x1ae 'NtGdiDdUnattachSurface', # 0x1af 'NtGdiDdUnlock', # 0x1b0 'NtGdiDdUpdateOverlay', # 0x1b1 'NtGdiDdWaitForVerticalBlank', # 0x1b2 'NtGdiDeleteColorTransform', # 0x1b3 'NtGdiDescribePixelFormat', # 0x1b4 'NtGdiDestroyOPMProtectedOutput', # 0x1b5 'NtGdiDestroyPhysicalMonitor', # 0x1b6 'NtGdiDoBanding', # 0x1b7 'NtGdiDrawEscape', # 0x1b8 'NtGdiDvpAcquireNotification', # 0x1b9 'NtGdiDvpCanCreateVideoPort', # 0x1ba 'NtGdiDvpColorControl', # 0x1bb 'NtGdiDvpCreateVideoPort', # 0x1bc 'NtGdiDvpDestroyVideoPort', # 0x1bd 'NtGdiDvpFlipVideoPort', # 0x1be 'NtGdiDvpGetVideoPortBandwidth', # 0x1bf 'NtGdiDvpGetVideoPortConnectInfo', # 0x1c0 'NtGdiDvpGetVideoPortField', # 0x1c1 'NtGdiDvpGetVideoPortFlipStatus', # 0x1c2 'NtGdiDvpGetVideoPortInputFormats', # 0x1c3 'NtGdiDvpGetVideoPortLine', # 0x1c4 'NtGdiDvpGetVideoPortOutputFormats', # 0x1c5 'NtGdiDvpGetVideoSignalStatus', # 0x1c6 'NtGdiDvpReleaseNotification', # 0x1c7 'NtGdiDvpUpdateVideoPort', # 0x1c8 'NtGdiDvpWaitForVideoPortSync', # 0x1c9 'NtGdiDwmGetDirtyRgn', # 0x1ca 'NtGdiDwmGetSurfaceData', # 0x1cb 'NtGdiDxgGenericThunk', # 0x1cc 'NtGdiEllipse', # 0x1cd 'NtGdiEnableEudc', # 0x1ce 'NtGdiEndDoc', # 0x1cf 'NtGdiEndPage', # 0x1d0 'NtGdiEngAlphaBlend', # 0x1d1 'NtGdiEngAssociateSurface', # 0x1d2 'NtGdiEngBitBlt', # 0x1d3 'NtGdiEngCheckAbort', # 0x1d4 'NtGdiEngComputeGlyphSet', # 0x1d5 'NtGdiEngCopyBits', # 0x1d6 'NtGdiEngCreateBitmap', # 0x1d7 'NtGdiEngCreateClip', # 0x1d8 'NtGdiEngCreateDeviceBitmap', # 0x1d9 'NtGdiEngCreateDeviceSurface', # 0x1da 'NtGdiEngCreatePalette', # 0x1db 'NtGdiEngDeleteClip', # 0x1dc 'NtGdiEngDeletePalette', # 0x1dd 'NtGdiEngDeletePath', # 0x1de 'NtGdiEngDeleteSurface', # 0x1df 'NtGdiEngEraseSurface', # 0x1e0 'NtGdiEngFillPath', # 0x1e1 'NtGdiEngGradientFill', # 0x1e2 'NtGdiEngLineTo', # 0x1e3 'NtGdiEngLockSurface', # 0x1e4 'NtGdiEngMarkBandingSurface', # 0x1e5 'NtGdiEngPaint', # 0x1e6 'NtGdiEngPlgBlt', # 0x1e7 'NtGdiEngStretchBlt', # 0x1e8 'NtGdiEngStretchBltROP', # 0x1e9 'NtGdiEngStrokeAndFillPath', # 0x1ea 'NtGdiEngStrokePath', # 0x1eb 'NtGdiEngTextOut', # 0x1ec 'NtGdiEngTransparentBlt', # 0x1ed 'NtGdiEngUnlockSurface', # 0x1ee 'NtGdiEnumObjects', # 0x1ef 'NtGdiEudcLoadUnloadLink', # 0x1f0 'NtGdiExtFloodFill', # 0x1f1 'NtGdiFONTOBJ_cGetAllGlyphHandles', # 0x1f2 'NtGdiFONTOBJ_cGetGlyphs', # 0x1f3 'NtGdiFONTOBJ_pQueryGlyphAttrs', # 0x1f4 'NtGdiFONTOBJ_pfdg', # 0x1f5 'NtGdiFONTOBJ_pifi', # 0x1f6 'NtGdiFONTOBJ_pvTrueTypeFontFile', # 0x1f7 'NtGdiFONTOBJ_pxoGetXform', # 0x1f8 'NtGdiFONTOBJ_vGetInfo', # 0x1f9 'NtGdiFlattenPath', # 0x1fa 'NtGdiFontIsLinked', # 0x1fb 'NtGdiForceUFIMapping', # 0x1fc 'NtGdiFrameRgn', # 0x1fd 'NtGdiFullscreenControl', # 0x1fe 'NtGdiGetBoundsRect', # 0x1ff 'NtGdiGetCOPPCompatibleOPMInformation', # 0x200 'NtGdiGetCertificate', # 0x201 'NtGdiGetCertificateSize', # 0x202 'NtGdiGetCharABCWidthsW', # 0x203 'NtGdiGetCharacterPlacementW', # 0x204 'NtGdiGetColorAdjustment', # 0x205 'NtGdiGetColorSpaceforBitmap', # 0x206 'NtGdiGetDeviceCaps', # 0x207 'NtGdiGetDeviceCapsAll', # 0x208 'NtGdiGetDeviceGammaRamp', # 0x209 'NtGdiGetDeviceWidth', # 0x20a 'NtGdiGetDhpdev', # 0x20b 'NtGdiGetETM', # 0x20c 'NtGdiGetEmbUFI', # 0x20d 'NtGdiGetEmbedFonts', # 0x20e 'NtGdiGetEudcTimeStampEx', # 0x20f 'NtGdiGetFontResourceInfoInternalW', # 0x210 'NtGdiGetFontUnicodeRanges', # 0x211 'NtGdiGetGlyphIndicesW', # 0x212 'NtGdiGetGlyphIndicesWInternal', # 0x213 'NtGdiGetGlyphOutline', # 0x214 'NtGdiGetKerningPairs', # 0x215 'NtGdiGetLinkedUFIs', # 0x216 'NtGdiGetMiterLimit', # 0x217 'NtGdiGetMonitorID', # 0x218 'NtGdiGetNumberOfPhysicalMonitors', # 0x219 'NtGdiGetOPMInformation', # 0x21a 'NtGdiGetOPMRandomNumber', # 0x21b 'NtGdiGetObjectBitmapHandle', # 0x21c 'NtGdiGetPath', # 0x21d 'NtGdiGetPerBandInfo', # 0x21e 'NtGdiGetPhysicalMonitorDescription', # 0x21f 'NtGdiGetPhysicalMonitors', # 0x220 'NtGdiGetRealizationInfo', # 0x221 'NtGdiGetServerMetaFileBits', # 0x222 'NtGdiGetSpoolMessage', # 0x223 'NtGdiGetStats', # 0x224 'NtGdiGetStringBitmapW', # 0x225 'NtGdiGetSuggestedOPMProtectedOutputArraySize', # 0x226 'NtGdiGetTextExtentExW', # 0x227 'NtGdiGetUFI', # 0x228 'NtGdiGetUFIPathname', # 0x229 'NtGdiGradientFill', # 0x22a 'NtGdiHT_Get8BPPFormatPalette', # 0x22b 'NtGdiHT_Get8BPPMaskPalette', # 0x22c 'NtGdiIcmBrushInfo', # 0x22d 'NtGdiInit', # 0x22e 'NtGdiInitSpool', # 0x22f 'NtGdiMakeFontDir', # 0x230 'NtGdiMakeInfoDC', # 0x231 'NtGdiMakeObjectUnXferable', # 0x232 'NtGdiMakeObjectXferable', # 0x233 'NtGdiMirrorWindowOrg', # 0x234 'NtGdiMonoBitmap', # 0x235 'NtGdiMoveTo', # 0x236 'NtGdiOffsetClipRgn', # 0x237 'NtGdiPATHOBJ_bEnum', # 0x238 'NtGdiPATHOBJ_bEnumClipLines', # 0x239 'NtGdiPATHOBJ_vEnumStart', # 0x23a 'NtGdiPATHOBJ_vEnumStartClipLines', # 0x23b 'NtGdiPATHOBJ_vGetBounds', # 0x23c 'NtGdiPathToRegion', # 0x23d 'NtGdiPlgBlt', # 0x23e 'NtGdiPolyDraw', # 0x23f 'NtGdiPolyTextOutW', # 0x240 'NtGdiPtInRegion', # 0x241 'NtGdiPtVisible', # 0x242 'NtGdiQueryFonts', # 0x243 'NtGdiRemoveFontResourceW', # 0x244 'NtGdiRemoveMergeFont', # 0x245 'NtGdiResetDC', # 0x246 'NtGdiResizePalette', # 0x247 'NtGdiRoundRect', # 0x248 'NtGdiSTROBJ_bEnum', # 0x249 'NtGdiSTROBJ_bEnumPositionsOnly', # 0x24a 'NtGdiSTROBJ_bGetAdvanceWidths', # 0x24b 'NtGdiSTROBJ_dwGetCodePage', # 0x24c 'NtGdiSTROBJ_vEnumStart', # 0x24d 'NtGdiScaleViewportExtEx', # 0x24e 'NtGdiScaleWindowExtEx', # 0x24f 'NtGdiSelectBrush', # 0x250 'NtGdiSelectClipPath', # 0x251 'NtGdiSelectPen', # 0x252 'NtGdiSetBitmapAttributes', # 0x253 'NtGdiSetBrushAttributes', # 0x254 'NtGdiSetColorAdjustment', # 0x255 'NtGdiSetColorSpace', # 0x256 'NtGdiSetDeviceGammaRamp', # 0x257 'NtGdiSetFontXform', # 0x258 'NtGdiSetIcmMode', # 0x259 'NtGdiSetLinkedUFIs', # 0x25a 'NtGdiSetMagicColors', # 0x25b 'NtGdiSetOPMSigningKeyAndSequenceNumbers', # 0x25c 'NtGdiSetPUMPDOBJ', # 0x25d 'NtGdiSetPixelFormat', # 0x25e 'NtGdiSetRectRgn', # 0x25f 'NtGdiSetSizeDevice', # 0x260 'NtGdiSetSystemPaletteUse', # 0x261 'NtGdiSetTextJustification', # 0x262 'NtGdiStartDoc', # 0x263 'NtGdiStartPage', # 0x264 'NtGdiStrokeAndFillPath', # 0x265 'NtGdiStrokePath', # 0x266 'NtGdiSwapBuffers', # 0x267 'NtGdiTransparentBlt', # 0x268 'NtGdiUMPDEngFreeUserMem', # 0x269 'NtGdiUnloadPrinterDriver', # 0x26a 'NtGdiUnmapMemFont', # 0x26b 'NtGdiUpdateColors', # 0x26c 'NtGdiUpdateTransform', # 0x26d 'NtGdiWidenPath', # 0x26e 'NtGdiXFORMOBJ_bApplyXform', # 0x26f 'NtGdiXFORMOBJ_iGetXform', # 0x270 'NtGdiXLATEOBJ_cGetPalette', # 0x271 'NtGdiXLATEOBJ_hGetColorTransform', # 0x272 'NtGdiXLATEOBJ_iXlate', # 0x273 'NtUserAddClipboardFormatListener', # 0x274 'NtUserAssociateInputContext', # 0x275 'NtUserBlockInput', # 0x276 'NtUserBuildHimcList', # 0x277 'NtUserBuildPropList', # 0x278 'NtUserCallHwndOpt', # 0x279 'NtUserChangeDisplaySettings', # 0x27a 'NtUserCheckAccessForIntegrityLevel', # 0x27b 'NtUserCheckDesktopByThreadId', # 0x27c 'NtUserCheckWindowThreadDesktop', # 0x27d 'NtUserChildWindowFromPointEx', # 0x27e 'NtUserClipCursor', # 0x27f 'NtUserCreateDesktopEx', # 0x280 'NtUserCreateInputContext', # 0x281 'NtUserCreateWindowStation', # 0x282 'NtUserCtxDisplayIOCtl', # 0x283 'NtUserDestroyInputContext', # 0x284 'NtUserDisableThreadIme', # 0x285 'NtUserDoSoundConnect', # 0x286 'NtUserDoSoundDisconnect', # 0x287 'NtUserDragDetect', # 0x288 'NtUserDragObject', # 0x289 'NtUserDrawAnimatedRects', # 0x28a 'NtUserDrawCaption', # 0x28b 'NtUserDrawCaptionTemp', # 0x28c 'NtUserDrawMenuBarTemp', # 0x28d 'NtUserDwmGetDxRgn', # 0x28e 'NtUserDwmHintDxUpdate', # 0x28f 'NtUserDwmStartRedirection', # 0x290 'NtUserDwmStopRedirection', # 0x291 'NtUserEndMenu', # 0x292 'NtUserEvent', # 0x293 'NtUserFlashWindowEx', # 0x294 'NtUserFrostCrashedWindow', # 0x295 'NtUserGetAppImeLevel', # 0x296 'NtUserGetCaretPos', # 0x297 'NtUserGetClipCursor', # 0x298 'NtUserGetClipboardViewer', # 0x299 'NtUserGetComboBoxInfo', # 0x29a 'NtUserGetCursorInfo', # 0x29b 'NtUserGetGuiResources', # 0x29c 'NtUserGetImeHotKey', # 0x29d 'NtUserGetImeInfoEx', # 0x29e 'NtUserGetInternalWindowPos', # 0x29f 'NtUserGetKeyNameText', # 0x2a0 'NtUserGetKeyboardLayoutName', # 0x2a1 'NtUserGetLayeredWindowAttributes', # 0x2a2 'NtUserGetListBoxInfo', # 0x2a3 'NtUserGetMenuIndex', # 0x2a4 'NtUserGetMenuItemRect', # 0x2a5 'NtUserGetMouseMovePointsEx', # 0x2a6 'NtUserGetPriorityClipboardFormat', # 0x2a7 'NtUserGetRawInputBuffer', # 0x2a8 'NtUserGetRawInputData', # 0x2a9 'NtUserGetRawInputDeviceInfo', # 0x2aa 'NtUserGetRawInputDeviceList', # 0x2ab 'NtUserGetRegisteredRawInputDevices', # 0x2ac 'NtUserGetUpdatedClipboardFormats', # 0x2ad 'NtUserGetWOWClass', # 0x2ae 'NtUserGetWindowMinimizeRect', # 0x2af 'NtUserGetWindowRgnEx', # 0x2b0 'NtUserGhostWindowFromHungWindow', # 0x2b1 'NtUserHardErrorControl', # 0x2b2 'NtUserHiliteMenuItem', # 0x2b3 'NtUserHungWindowFromGhostWindow', # 0x2b4 'NtUserImpersonateDdeClientWindow', # 0x2b5 'NtUserInitTask', # 0x2b6 'NtUserInitialize', # 0x2b7 'NtUserInitializeClientPfnArrays', # 0x2b8 'NtUserInternalGetWindowIcon', # 0x2b9 'NtUserLoadKeyboardLayoutEx', # 0x2ba 'NtUserLockWindowStation', # 0x2bb 'NtUserLockWorkStation', # 0x2bc 'NtUserLogicalToPhysicalPoint', # 0x2bd 'NtUserMNDragLeave', # 0x2be 'NtUserMNDragOver', # 0x2bf 'NtUserMenuItemFromPoint', # 0x2c0 'NtUserMinMaximize', # 0x2c1 'NtUserNotifyIMEStatus', # 0x2c2 'NtUserOpenInputDesktop', # 0x2c3 'NtUserOpenThreadDesktop', # 0x2c4 'NtUserPaintMonitor', # 0x2c5 'NtUserPhysicalToLogicalPoint', # 0x2c6 'NtUserPrintWindow', # 0x2c7 'NtUserQueryInformationThread', # 0x2c8 'NtUserQueryInputContext', # 0x2c9 'NtUserQuerySendMessage', # 0x2ca 'NtUserRealChildWindowFromPoint', # 0x2cb 'NtUserRealWaitMessageEx', # 0x2cc 'NtUserRegisterErrorReportingDialog', # 0x2cd 'NtUserRegisterHotKey', # 0x2ce 'NtUserRegisterRawInputDevices', # 0x2cf 'NtUserRegisterSessionPort', # 0x2d0 'NtUserRegisterTasklist', # 0x2d1 'NtUserRegisterUserApiHook', # 0x2d2 'NtUserRemoteConnect', # 0x2d3 'NtUserRemoteRedrawRectangle', # 0x2d4 'NtUserRemoteRedrawScreen', # 0x2d5 'NtUserRemoteStopScreenUpdates', # 0x2d6 'NtUserRemoveClipboardFormatListener', # 0x2d7 'NtUserResolveDesktopForWOW', # 0x2d8 'NtUserSetAppImeLevel', # 0x2d9 'NtUserSetClassWord', # 0x2da 'NtUserSetCursorContents', # 0x2db 'NtUserSetImeHotKey', # 0x2dc 'NtUserSetImeInfoEx', # 0x2dd 'NtUserSetImeOwnerWindow', # 0x2de 'NtUserSetInternalWindowPos', # 0x2df 'NtUserSetLayeredWindowAttributes', # 0x2e0 'NtUserSetMenu', # 0x2e1 'NtUserSetMenuContextHelpId', # 0x2e2 'NtUserSetMenuFlagRtoL', # 0x2e3 'NtUserSetMirrorRendering', # 0x2e4 'NtUserSetObjectInformation', # 0x2e5 'NtUserSetProcessDPIAware', # 0x2e6 'NtUserSetShellWindowEx', # 0x2e7 'NtUserSetSysColors', # 0x2e8 'NtUserSetSystemCursor', # 0x2e9 'NtUserSetSystemTimer', # 0x2ea 'NtUserSetThreadLayoutHandles', # 0x2eb 'NtUserSetWindowRgnEx', # 0x2ec 'NtUserSetWindowStationUser', # 0x2ed 'NtUserShowSystemCursor', # 0x2ee 'NtUserSoundSentry', # 0x2ef 'NtUserSwitchDesktop', # 0x2f0 'NtUserTestForInteractiveUser', # 0x2f1 'NtUserTrackPopupMenuEx', # 0x2f2 'NtUserUnloadKeyboardLayout', # 0x2f3 'NtUserUnlockWindowStation', # 0x2f4 'NtUserUnregisterHotKey', # 0x2f5 'NtUserUnregisterSessionPort', # 0x2f6 'NtUserUnregisterUserApiHook', # 0x2f7 'NtUserUpdateInputContext', # 0x2f8 'NtUserUpdateInstance', # 0x2f9 'NtUserUpdateLayeredWindow', # 0x2fa 'NtUserUpdatePerUserSystemParameters', # 0x2fb 'NtUserUpdateWindowTransform', # 0x2fc 'NtUserUserHandleGrantAccess', # 0x2fd 'NtUserValidateHandleSecure', # 0x2fe 'NtUserWaitForInputIdle', # 0x2ff 'NtUserWaitForMsgAndEvent', # 0x300 'NtUserWin32PoolAllocationStats', # 0x301 'NtUserWindowFromPhysicalPoint', # 0x302 'NtUserYieldTask', # 0x303 'NtUserSetClassLongPtr', # 0x304 'NtUserSetWindowLongPtr', # 0x305 ], ]
// license:BSD-3-Clause // copyright-holders:Aaron Giles /*************************************************************************** RIOT 6532 emulation The timer seems to follow these rules: - When the timer flag changes from 0 to 1 the timer continues to count down at a 1 cycle rate. - When the timer is being read or written the timer flag is reset. - When the timer flag is set and the timer contents are 0, the counting stops. ***************************************************************************/ #include "emu.h" #include "6532riot.h" //************************************************************************** // CONSTANTS //************************************************************************** // device type definition DEFINE_DEVICE_TYPE(RIOT6532, riot6532_device, "riot6532", "6532 RIOT") enum { TIMER_IDLE, TIMER_COUNTING, TIMER_FINISHING }; #define TIMER_FLAG 0x80 #define PA7_FLAG 0x40 /*************************************************************************** INTERNAL FUNCTIONS ***************************************************************************/ /*------------------------------------------------- update_irqstate - update the IRQ state based on interrupt enables -------------------------------------------------*/ void riot6532_device::update_irqstate() { int irq = (m_irqstate & m_irqenable) ? ASSERT_LINE : CLEAR_LINE; if (m_irq != irq) { m_irq_cb(irq); m_irq = irq; } } /*------------------------------------------------- apply_ddr - combine inputs and outputs according to the DDR -------------------------------------------------*/ uint8_t riot6532_device::apply_ddr(const riot6532_port *port) { return (port->m_out & port->m_ddr) | (port->m_in & ~port->m_ddr); } /*------------------------------------------------- update_pa7_state - see if PA7 has changed and signal appropriately -------------------------------------------------*/ void riot6532_device::update_pa7_state() { uint8_t data = apply_ddr(&m_port[0]) & 0x80; /* if the state changed in the correct direction, set the PA7 flag and update IRQs */ if ((m_pa7prev ^ data) && (m_pa7dir ^ data) == 0) { m_irqstate |= PA7_FLAG; update_irqstate(); } m_pa7prev = data; } /*------------------------------------------------- get_timer - return the current timer value -------------------------------------------------*/ uint8_t riot6532_device::get_timer() { /* if idle, return 0 */ if (m_timerstate == TIMER_IDLE) { return 0; } /* if counting, return the number of ticks remaining */ else if (m_timerstate == TIMER_COUNTING) { return m_timer->remaining().as_ticks(clock()) >> m_timershift; } /* if finishing, return the number of ticks without the shift */ else { return m_timer->remaining().as_ticks(clock()); } } void riot6532_device::timer_end() { assert(m_timerstate != TIMER_IDLE); /* if we finished counting, switch to the finishing state */ if(m_timerstate == TIMER_COUNTING) { m_timerstate = TIMER_FINISHING; m_timer->adjust(attotime::from_ticks(256, clock())); /* signal timer IRQ as well */ m_irqstate |= TIMER_FLAG; update_irqstate(); } /* if we finished finishing, keep spinning */ else if (m_timerstate == TIMER_FINISHING) { m_timer->adjust(attotime::from_ticks(256, clock())); } } /*************************************************************************** I/O ACCESS ***************************************************************************/ /*------------------------------------------------- riot6532_w - master I/O write access -------------------------------------------------*/ void riot6532_device::write(offs_t offset, uint8_t data) { reg_w(offset, data); } void riot6532_device::reg_w(uint8_t offset, uint8_t data) { /* if A4 == 1 and A2 == 1, we are writing to the timer */ if ((offset & 0x14) == 0x14) { static const uint8_t timershift[4] = { 0, 3, 6, 10 }; attotime curtime = machine().time(); int64_t target; /* A0-A1 contain the timer divisor */ m_timershift = timershift[offset & 3]; /* A3 contains the timer IRQ enable */ if (offset & 8) m_irqenable |= TIMER_FLAG; else m_irqenable &= ~TIMER_FLAG; /* writes here clear the timer flag */ if (m_timerstate != TIMER_FINISHING || get_timer() != 0xff) { m_irqstate &= ~TIMER_FLAG; } update_irqstate(); /* update the timer */ m_timerstate = TIMER_COUNTING; target = curtime.as_ticks(clock()) + 1 + (data << m_timershift); m_timer->adjust(attotime::from_ticks(target, clock()) - curtime); } /* if A4 == 0 and A2 == 1, we are writing to the edge detect control */ else if ((offset & 0x14) == 0x04) { /* A1 contains the A7 IRQ enable */ if (offset & 2) { m_irqenable |= PA7_FLAG; } else { m_irqenable &= ~PA7_FLAG; } /* A0 specifies the edge detect direction: 0=negative, 1=positive */ m_pa7dir = (offset & 1) << 7; } /* if A4 == anything and A2 == 0, we are writing to the I/O section */ else { /* A1 selects the port */ riot6532_port *port = &m_port[BIT(offset, 1)]; /* if A0 == 1, we are writing to the port's DDR */ if (offset & 1) { port->m_ddr = data; } /* if A0 == 0, we are writing to the port's output */ else { port->m_out = data; (*port->m_out_cb)((offs_t)0, data); } /* writes to port A need to update the PA7 state */ if (port == &m_port[0]) { update_pa7_state(); } } } /*------------------------------------------------- riot6532_r - master I/O read access -------------------------------------------------*/ uint8_t riot6532_device::read(offs_t offset) { return reg_r(offset, machine().side_effects_disabled()); } uint8_t riot6532_device::reg_r(uint8_t offset, bool debugger_access) { uint8_t val; /* if A2 == 1 and A0 == 1, we are reading interrupt flags */ if ((offset & 0x05) == 0x05) { val = m_irqstate; if ( ! debugger_access ) { /* implicitly clears the PA7 flag */ m_irqstate &= ~PA7_FLAG; update_irqstate(); } } /* if A2 == 1 and A0 == 0, we are reading the timer */ else if ((offset & 0x05) == 0x04) { val = get_timer(); if ( ! debugger_access ) { /* A3 contains the timer IRQ enable */ if (offset & 8) { m_irqenable |= TIMER_FLAG; } else { m_irqenable &= ~TIMER_FLAG; } /* implicitly clears the timer flag */ if (m_timerstate != TIMER_FINISHING || val != 0xff) { m_irqstate &= ~TIMER_FLAG; } update_irqstate(); } } /* if A2 == 0 and A0 == anything, we are reading from ports */ else { /* A1 selects the port */ riot6532_port *port = &m_port[BIT(offset, 1)]; /* if A0 == 1, we are reading the port's DDR */ if (offset & 1) { val = port->m_ddr; } /* if A0 == 0, we are reading the port as an input */ else { /* call the input callback if it exists */ if (!(*port->m_in_cb).isnull()) { port->m_in = (*port->m_in_cb)(0); /* changes to port A need to update the PA7 state */ if (port == &m_port[0]) { if (!debugger_access) { update_pa7_state(); } } } /* apply the DDR to the result */ val = apply_ddr(port); } } return val; } /*------------------------------------------------- porta_in_set - set port A input value -------------------------------------------------*/ void riot6532_device::porta_in_set(uint8_t data, uint8_t mask) { m_port[0].m_in = (m_port[0].m_in & ~mask) | (data & mask); update_pa7_state(); } /*------------------------------------------------- portb_in_set - set port B input value -------------------------------------------------*/ void riot6532_device::portb_in_set(uint8_t data, uint8_t mask) { m_port[1].m_in = (m_port[1].m_in & ~mask) | (data & mask); } /*------------------------------------------------- porta_in_get - return port A input value -------------------------------------------------*/ uint8_t riot6532_device::porta_in_get() { return m_port[0].m_in; } /*------------------------------------------------- portb_in_get - return port B input value -------------------------------------------------*/ uint8_t riot6532_device::portb_in_get() { return m_port[1].m_in; } /*------------------------------------------------- porta_in_get - return port A output value -------------------------------------------------*/ uint8_t riot6532_device::porta_out_get() { return m_port[0].m_out; } /*------------------------------------------------- portb_in_get - return port B output value -------------------------------------------------*/ uint8_t riot6532_device::portb_out_get() { return m_port[1].m_out; } //------------------------------------------------- // paN_w - write Port A lines individually //------------------------------------------------- WRITE_LINE_MEMBER(riot6532_device::pa0_w) { porta_in_set(state ? 0x01 : 0x00, 0x01); } WRITE_LINE_MEMBER(riot6532_device::pa1_w) { porta_in_set(state ? 0x02 : 0x00, 0x02); } WRITE_LINE_MEMBER(riot6532_device::pa2_w) { porta_in_set(state ? 0x04 : 0x00, 0x04); } WRITE_LINE_MEMBER(riot6532_device::pa3_w) { porta_in_set(state ? 0x08 : 0x00, 0x08); } WRITE_LINE_MEMBER(riot6532_device::pa4_w) { porta_in_set(state ? 0x10 : 0x00, 0x10); } WRITE_LINE_MEMBER(riot6532_device::pa5_w) { porta_in_set(state ? 0x20 : 0x00, 0x20); } WRITE_LINE_MEMBER(riot6532_device::pa6_w) { porta_in_set(state ? 0x40 : 0x00, 0x40); } WRITE_LINE_MEMBER(riot6532_device::pa7_w) { porta_in_set(state ? 0x80 : 0x00, 0x80); } //------------------------------------------------- // pbN_w - write Port B lines individually //------------------------------------------------- WRITE_LINE_MEMBER(riot6532_device::pb0_w) { portb_in_set(state ? 0x01 : 0x00, 0x01); } WRITE_LINE_MEMBER(riot6532_device::pb1_w) { portb_in_set(state ? 0x02 : 0x00, 0x02); } WRITE_LINE_MEMBER(riot6532_device::pb2_w) { portb_in_set(state ? 0x04 : 0x00, 0x04); } WRITE_LINE_MEMBER(riot6532_device::pb3_w) { portb_in_set(state ? 0x08 : 0x00, 0x08); } WRITE_LINE_MEMBER(riot6532_device::pb4_w) { portb_in_set(state ? 0x10 : 0x00, 0x10); } WRITE_LINE_MEMBER(riot6532_device::pb5_w) { portb_in_set(state ? 0x20 : 0x00, 0x20); } WRITE_LINE_MEMBER(riot6532_device::pb6_w) { portb_in_set(state ? 0x40 : 0x00, 0x40); } WRITE_LINE_MEMBER(riot6532_device::pb7_w) { portb_in_set(state ? 0x80 : 0x00, 0x80); } //************************************************************************** // LIVE DEVICE //************************************************************************** //------------------------------------------------- // riot6532_device - constructor //------------------------------------------------- riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RIOT6532, tag, owner, clock), m_in_pa_cb(*this), m_out_pa_cb(*this), m_in_pb_cb(*this), m_out_pb_cb(*this), m_irq_cb(*this), m_irqstate(0), m_irqenable(0), m_irq(CLEAR_LINE), m_pa7dir(0), m_pa7prev(0), m_timershift(0), m_timerstate(0), m_timer(nullptr) { memset(m_port, 0x00, sizeof(m_port)); } /*------------------------------------------------- device_start - device-specific startup -------------------------------------------------*/ void riot6532_device::device_start() { /* resolve callbacks */ m_in_pa_cb.resolve(); m_port[0].m_in_cb = &m_in_pa_cb; m_out_pa_cb.resolve_safe(); m_port[0].m_out_cb = &m_out_pa_cb; m_in_pb_cb.resolve(); m_port[1].m_in_cb = &m_in_pb_cb; m_out_pb_cb.resolve_safe(); m_port[1].m_out_cb = &m_out_pb_cb; m_irq_cb.resolve_safe(); /* allocate timers */ m_timer = timer_alloc(TIMER_END_CB); /* register for save states */ save_item(NAME(m_port[0].m_in)); save_item(NAME(m_port[0].m_out)); save_item(NAME(m_port[0].m_ddr)); save_item(NAME(m_port[1].m_in)); save_item(NAME(m_port[1].m_out)); save_item(NAME(m_port[1].m_ddr)); save_item(NAME(m_irqstate)); save_item(NAME(m_irqenable)); save_item(NAME(m_irq)); save_item(NAME(m_pa7dir)); save_item(NAME(m_pa7prev)); save_item(NAME(m_timershift)); save_item(NAME(m_timerstate)); } /*------------------------------------------------- device_reset - device-specific reset -------------------------------------------------*/ void riot6532_device::device_reset() { /* reset I/O states */ m_port[0].m_in = 0; m_port[0].m_out = 0; m_port[0].m_ddr = 0; m_port[1].m_in = 0; m_port[1].m_out = 0; m_port[1].m_ddr = 0; /* reset IRQ states */ m_irqenable = 0; m_irqstate = 0; update_irqstate(); /* reset PA7 states */ m_pa7dir = 0; m_pa7prev = 0; /* reset timer states */ m_timershift = 10; m_timerstate = TIMER_COUNTING; m_timer->adjust(attotime::from_ticks(256 << m_timershift, clock())); } void riot6532_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch (id) { case TIMER_END_CB: timer_end(); break; default: throw emu_fatalerror("Unknown id in riot6532_device::device_timer"); } }
/* Unix SMB/Netbios implementation. Version 1.9. uid/user handling Copyright (C) Andrew Tridgell 1992-1998 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. */ #include "includes.h" extern int DEBUGLEVEL; /* what user is current? */ extern struct current_user current_user; pstring OriginalDir; /**************************************************************************** Initialise the uid routines. ****************************************************************************/ void init_uid(void) { current_user.uid = geteuid(); current_user.gid = getegid(); if (current_user.gid != 0 && current_user.uid == 0) { gain_root_group_privilege(); } current_user.conn = NULL; current_user.vuid = UID_FIELD_INVALID; dos_ChDir(OriginalDir); } /**************************************************************************** Become the specified uid. ****************************************************************************/ static BOOL become_uid(uid_t uid) { if (uid == (uid_t)-1 || ((sizeof(uid_t) == 2) && (uid == (uid_t)65535))) { static int done; if (!done) { DEBUG(1,("WARNING: using uid %d is a security risk\n",(int)uid)); done=1; } } set_effective_uid(uid); current_user.uid = uid; #ifdef WITH_PROFILE profile_p->uid_changes++; #endif return(True); } /**************************************************************************** Become the specified gid. ****************************************************************************/ static BOOL become_gid(gid_t gid) { if (gid == (gid_t)-1 || ((sizeof(gid_t) == 2) && (gid == (gid_t)65535))) { DEBUG(1,("WARNING: using gid %d is a security risk\n",(int)gid)); } set_effective_gid(gid); current_user.gid = gid; return(True); } /**************************************************************************** Become the specified uid and gid. ****************************************************************************/ static BOOL become_id(uid_t uid,gid_t gid) { return(become_gid(gid) && become_uid(uid)); } /**************************************************************************** Become the guest user. ****************************************************************************/ BOOL become_guest(void) { BOOL ret; static struct passwd *pass=NULL; if (!pass) pass = Get_Pwnam(lp_guestaccount(-1),True); if (!pass) return(False); #ifdef AIX /* MWW: From AIX FAQ patch to WU-ftpd: call initgroups before setting IDs */ initgroups(pass->pw_name, (gid_t)pass->pw_gid); #endif ret = become_id(pass->pw_uid,pass->pw_gid); if (!ret) { DEBUG(1,("Failed to become guest. Invalid guest account?\n")); } current_user.conn = NULL; current_user.vuid = UID_FIELD_INVALID; return(ret); } /******************************************************************* Check if a username is OK. ********************************************************************/ static BOOL check_user_ok(connection_struct *conn, user_struct *vuser,int snum) { int i; for (i=0;i<conn->uid_cache.entries;i++) if (conn->uid_cache.list[i] == vuser->uid) return(True); if (!user_ok(vuser->name,snum)) return(False); i = conn->uid_cache.entries % UID_CACHE_SIZE; conn->uid_cache.list[i] = vuser->uid; if (conn->uid_cache.entries < UID_CACHE_SIZE) conn->uid_cache.entries++; return(True); } /**************************************************************************** Become the user of a connection number. ****************************************************************************/ BOOL become_user(connection_struct *conn, uint16 vuid) { user_struct *vuser = get_valid_user_struct(vuid); int snum; gid_t gid; uid_t uid; char group_c; if (!conn) { DEBUG(2,("Connection not open\n")); return(False); } /* * We need a separate check in security=share mode due to vuid * always being UID_FIELD_INVALID. If we don't do this then * in share mode security we are *always* changing uid's between * SMB's - this hurts performance - Badly. */ if((lp_security() == SEC_SHARE) && (current_user.conn == conn) && (current_user.uid == conn->uid)) { DEBUG(4,("Skipping become_user - already user\n")); return(True); } else if ((current_user.conn == conn) && (vuser != 0) && (current_user.vuid == vuid) && (current_user.uid == vuser->uid)) { DEBUG(4,("Skipping become_user - already user\n")); return(True); } unbecome_user(); snum = SNUM(conn); if((vuser != NULL) && !check_user_ok(conn, vuser, snum)) return False; if (conn->force_user || lp_security() == SEC_SHARE || !(vuser) || (vuser->guest)) { uid = conn->uid; gid = conn->gid; current_user.groups = conn->groups; current_user.ngroups = conn->ngroups; } else { if (!vuser) { DEBUG(2,("Invalid vuid used %d\n",vuid)); return(False); } uid = vuser->uid; gid = vuser->gid; current_user.ngroups = vuser->n_groups; current_user.groups = vuser->groups; } /* * See if we should force group for this service. * If so this overrides any group set in the force * user code. */ if((group_c = *lp_force_group(snum))) { if(group_c == '+') { /* * Only force group if the user is a member of * the service group. Check the group memberships for * this user (we already have this) to * see if we should force the group. */ int i; for (i = 0; i < current_user.ngroups; i++) { if (current_user.groups[i] == conn->gid) { gid = conn->gid; break; } } } else { gid = conn->gid; } } if (!become_gid(gid)) return(False); #ifdef HAVE_SETGROUPS if (!(conn && conn->ipc)) { /* groups stuff added by ih/wreu */ if (current_user.ngroups > 0) if (sys_setgroups(current_user.ngroups, current_user.groups)<0) { DEBUG(0,("sys_setgroups call failed!\n")); } } #endif if (!conn->admin_user && !become_uid(uid)) return(False); current_user.conn = conn; current_user.vuid = vuid; DEBUG(5,("become_user uid=(%d,%d) gid=(%d,%d)\n", (int)getuid(),(int)geteuid(),(int)getgid(),(int)getegid())); return(True); } /**************************************************************************** Unbecome the user of a connection number. ****************************************************************************/ BOOL unbecome_user(void ) { if (!current_user.conn) return(False); dos_ChDir(OriginalDir); set_effective_uid(0); set_effective_gid(0); if (geteuid() != 0) { DEBUG(0,("Warning: You appear to have a trapdoor uid system\n")); } if (getegid() != 0) { DEBUG(0,("Warning: You appear to have a trapdoor gid system\n")); } current_user.uid = 0; current_user.gid = 0; if (dos_ChDir(OriginalDir) != 0) DEBUG( 0, ( "chdir(%s) failed in unbecome_user\n", OriginalDir ) ); DEBUG(5,("unbecome_user now uid=(%d,%d) gid=(%d,%d)\n", (int)getuid(),(int)geteuid(),(int)getgid(),(int)getegid())); current_user.conn = NULL; current_user.vuid = UID_FIELD_INVALID; return(True); } /**************************************************************************** Become the user of an authenticated connected named pipe. When this is called we are currently running as the connection user. ****************************************************************************/ BOOL become_authenticated_pipe_user(pipes_struct *p) { /* * Go back to root. */ if(!unbecome_user()) return False; /* * Now become the authenticated user stored in the pipe struct. */ if(!become_id(p->uid, p->gid)) { /* Go back to the connection user. */ become_user(p->conn, p->vuid); return False; } return True; } /**************************************************************************** Unbecome the user of an authenticated connected named pipe. When this is called we are running as the authenticated pipe user and need to go back to being the connection user. ****************************************************************************/ BOOL unbecome_authenticated_pipe_user(pipes_struct *p) { if(!become_id(0,0)) { DEBUG(0,("unbecome_authenticated_pipe_user: Unable to go back to root.\n")); return False; } return become_user(p->conn, p->vuid); } static struct current_user current_user_saved; static int become_root_depth; static pstring become_root_dir; /**************************************************************************** This is used when we need to do a privileged operation (such as mucking with share mode files) and temporarily need root access to do it. This call should always be paired with an unbecome_root() call immediately after the operation Set save_dir if you also need to save/restore the CWD ****************************************************************************/ void become_root(BOOL save_dir) { if (become_root_depth) { DEBUG(0,("ERROR: become root depth is non zero\n")); } if (save_dir) dos_GetWd(become_root_dir); current_user_saved = current_user; become_root_depth = 1; become_uid(0); become_gid(0); } /**************************************************************************** When the privileged operation is over call this Set save_dir if you also need to save/restore the CWD ****************************************************************************/ void unbecome_root(BOOL restore_dir) { if (become_root_depth != 1) { DEBUG(0,("ERROR: unbecome root depth is %d\n", become_root_depth)); } /* we might have done a become_user() while running as root, if we have then become root again in order to become non root! */ if (current_user.uid != 0) { become_uid(0); } /* restore our gid first */ if (!become_gid(current_user_saved.gid)) { DEBUG(0,("ERROR: Failed to restore gid\n")); exit_server("Failed to restore gid"); } #ifdef HAVE_SETGROUPS if (current_user_saved.ngroups > 0) { if (sys_setgroups(current_user_saved.ngroups, current_user_saved.groups)<0) DEBUG(0,("ERROR: sys_setgroups call failed!\n")); } #endif /* now restore our uid */ if (!become_uid(current_user_saved.uid)) { DEBUG(0,("ERROR: Failed to restore uid\n")); exit_server("Failed to restore uid"); } if (restore_dir) dos_ChDir(become_root_dir); current_user = current_user_saved; become_root_depth = 0; }
package net.oschina.app.ui; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import net.oschina.app.AppContext; import net.oschina.app.AppException; import net.oschina.app.R; import net.oschina.app.bean.FriendList; import net.oschina.app.bean.MyInformation; import net.oschina.app.bean.Result; import net.oschina.app.common.FileUtils; import net.oschina.app.common.ImageUtils; import net.oschina.app.common.StringUtils; import net.oschina.app.common.UIHelper; import net.oschina.app.widget.LoadingDialog; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Message; import android.provider.MediaStore; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; /** * 用户资料 * @author liux (http://my.oschina.net/liux) * @version 1.0 * @created 2012-3-21 */ public class UserInfo extends BaseActivity{ private ImageView back; private ImageView refresh; private ImageView face; private ImageView gender; private Button editer; private TextView name; private TextView jointime; private TextView from; private TextView devplatform; private TextView expertise; private TextView followers; private TextView fans; private TextView favorites; private LinearLayout favorites_ll; private LinearLayout followers_ll; private LinearLayout fans_ll; private LoadingDialog loading; private MyInformation user; private Handler mHandler; private final static int CROP = 200; private final static String FILE_SAVEPATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/OSChina/Portrait/"; private Uri origUri; private Uri cropUri; private File protraitFile; private Bitmap protraitBitmap; private String protraitPath; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_info); //初始化视图控件 this.initView(); //初始化视图数据 this.initData(); } private void initView(){ back = (ImageView)findViewById(R.id.user_info_back); refresh = (ImageView)findViewById(R.id.user_info_refresh); editer = (Button)findViewById(R.id.user_info_editer); back.setOnClickListener(UIHelper.finish(this)); refresh.setOnClickListener(refreshClickListener); editer.setOnClickListener(editerClickListener); face = (ImageView)findViewById(R.id.user_info_userface); gender = (ImageView)findViewById(R.id.user_info_gender); name = (TextView)findViewById(R.id.user_info_username); jointime = (TextView)findViewById(R.id.user_info_jointime); from = (TextView)findViewById(R.id.user_info_from); devplatform = (TextView)findViewById(R.id.user_info_devplatform); expertise = (TextView)findViewById(R.id.user_info_expertise); followers = (TextView)findViewById(R.id.user_info_followers); fans = (TextView)findViewById(R.id.user_info_fans); favorites = (TextView)findViewById(R.id.user_info_favorites); favorites_ll = (LinearLayout)findViewById(R.id.user_info_favorites_ll); followers_ll = (LinearLayout)findViewById(R.id.user_info_followers_ll); fans_ll = (LinearLayout)findViewById(R.id.user_info_fans_ll); } private void initData(){ mHandler = new Handler(){ public void handleMessage(Message msg) { if(loading != null) loading.dismiss(); if(msg.what == 1 && msg.obj != null){ user = (MyInformation)msg.obj; //加载用户头像 UIHelper.showUserFace(face, user.getFace()); //用户性别 if(user.getGender() == 1) gender.setImageResource(R.drawable.widget_gender_man); else gender.setImageResource(R.drawable.widget_gender_woman); //其他资料 name.setText(user.getName()); jointime.setText(StringUtils.friendly_time(user.getJointime())); from.setText(user.getFrom()); devplatform.setText(user.getDevplatform()); expertise.setText(user.getExpertise()); followers.setText(user.getFollowerscount()+""); fans.setText(user.getFanscount()+""); favorites.setText(user.getFavoritecount()+""); favorites_ll.setOnClickListener(favoritesClickListener); fans_ll.setOnClickListener(fansClickListener); followers_ll.setOnClickListener(followersClickListener); }else if(msg.obj != null){ ((AppException)msg.obj).makeToast(UserInfo.this); } } }; this.loadUserInfoThread(false); } private void loadUserInfoThread(final boolean isRefresh){ loading = new LoadingDialog(this); loading.show(); new Thread(){ public void run() { Message msg = new Message(); try { MyInformation user = ((AppContext)getApplication()).getMyInformation(isRefresh); msg.what = 1; msg.obj = user; } catch (AppException e) { e.printStackTrace(); msg.what = -1; msg.obj = e; } mHandler.sendMessage(msg); } }.start(); } private View.OnClickListener editerClickListener = new View.OnClickListener(){ public void onClick(View v) { CharSequence[] items = { getString(R.string.img_from_album), getString(R.string.img_from_camera) }; imageChooseItem(items); } }; private View.OnClickListener refreshClickListener = new View.OnClickListener(){ public void onClick(View v) { loadUserInfoThread(true); } }; private View.OnClickListener favoritesClickListener = new View.OnClickListener(){ public void onClick(View v) { UIHelper.showUserFavorite(v.getContext()); } }; private View.OnClickListener fansClickListener = new View.OnClickListener(){ public void onClick(View v) { int followers = user!=null ? user.getFollowerscount() : 0; int fans = user!=null ? user.getFanscount() : 0; UIHelper.showUserFriend(v.getContext(), FriendList.TYPE_FANS, followers, fans); } }; private View.OnClickListener followersClickListener = new View.OnClickListener(){ public void onClick(View v) { int followers = user!=null ? user.getFollowerscount() : 0; int fans = user!=null ? user.getFanscount() : 0; UIHelper.showUserFriend(v.getContext(), FriendList.TYPE_FOLLOWER, followers, fans); } }; /** * 操作选择 * @param items */ public void imageChooseItem(CharSequence[] items ) { AlertDialog imageDialog = new AlertDialog.Builder(this).setTitle("上传头像").setIcon(android.R.drawable.btn_star).setItems(items, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int item) { //判断是否挂载了SD卡 String storageState = Environment.getExternalStorageState(); if(storageState.equals(Environment.MEDIA_MOUNTED)){ File savedir = new File(FILE_SAVEPATH); if (!savedir.exists()) { savedir.mkdirs(); } } else{ UIHelper.ToastMessage(UserInfo.this, "无法保存上传的头像,请检查SD卡是否挂载"); return; } //输出裁剪的临时文件 String timeStamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); //照片命名 String origFileName = "osc_" + timeStamp + ".jpg"; String cropFileName = "osc_crop_" + timeStamp + ".jpg"; //裁剪头像的绝对路径 protraitPath = FILE_SAVEPATH + cropFileName; protraitFile = new File(protraitPath); origUri = Uri.fromFile(new File(FILE_SAVEPATH, origFileName)); cropUri = Uri.fromFile(protraitFile); //相册选图 if(item == 0) { startActionPickCrop(cropUri); } //手机拍照 else if(item == 1){ startActionCamera(origUri); } }}).create(); imageDialog.show(); } /** * 选择图片裁剪 * @param output */ private void startActionPickCrop(Uri output) { Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("image/*"); intent.putExtra("output", output); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 1);// 裁剪框比例 intent.putExtra("aspectY", 1); intent.putExtra("outputX", CROP);// 输出图片大小 intent.putExtra("outputY", CROP); startActivityForResult(Intent.createChooser(intent, "选择图片"),ImageUtils.REQUEST_CODE_GETIMAGE_BYSDCARD); } /** * 相机拍照 * @param output */ private void startActionCamera(Uri output) { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, output); startActivityForResult(intent, ImageUtils.REQUEST_CODE_GETIMAGE_BYCAMERA); } /** * 拍照后裁剪 * @param data 原始图片 * @param output 裁剪后图片 */ private void startActionCrop(Uri data, Uri output) { Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(data, "image/*"); intent.putExtra("output", output); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 1);// 裁剪框比例 intent.putExtra("aspectY", 1); intent.putExtra("outputX", CROP);// 输出图片大小 intent.putExtra("outputY", CROP); startActivityForResult(intent, ImageUtils.REQUEST_CODE_GETIMAGE_BYCROP); } /** * 上传新照片 */ private void uploadNewPhoto() { final Handler handler = new Handler(){ public void handleMessage(Message msg) { if(loading != null) loading.dismiss(); if(msg.what == 1 && msg.obj != null){ Result res = (Result)msg.obj; //提示信息 UIHelper.ToastMessage(UserInfo.this, res.getErrorMessage()); if(res.OK()){ //显示新头像 face.setImageBitmap(protraitBitmap); } }else if(msg.what == -1 && msg.obj != null){ ((AppException)msg.obj).makeToast(UserInfo.this); } } }; if(loading != null){ loading.setLoadText("正在上传头像···"); loading.show(); } new Thread(){ public void run() { //获取头像缩略图 if(!StringUtils.isEmpty(protraitPath) && protraitFile.exists()) { protraitBitmap = ImageUtils.loadImgThumbnail(protraitPath, 200, 200); } if(protraitBitmap != null) { Message msg = new Message(); try { Result res = ((AppContext)getApplication()).updatePortrait(protraitFile); if(res!=null && res.OK()){ //保存新头像到缓存 String filename = FileUtils.getFileName(user.getFace()); ImageUtils.saveImage(UserInfo.this, filename, protraitBitmap); } msg.what = 1; msg.obj = res; } catch (AppException e) { e.printStackTrace(); msg.what = -1; msg.obj = e; } catch(IOException e) { e.printStackTrace(); } handler.sendMessage(msg); } }; }.start(); } @Override protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) { if(resultCode != RESULT_OK) return; switch(requestCode){ case ImageUtils.REQUEST_CODE_GETIMAGE_BYCAMERA: startActionCrop(origUri, cropUri);//拍照后裁剪 break; case ImageUtils.REQUEST_CODE_GETIMAGE_BYSDCARD: case ImageUtils.REQUEST_CODE_GETIMAGE_BYCROP: uploadNewPhoto();//上传新照片 break; } } }
<html lang="en"> <head> <title>isdigit - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Ctype.html#Ctype" title="Ctype"> <link rel="prev" href="iscntrl.html#iscntrl" title="iscntrl"> <link rel="next" href="islower.html#islower" title="islower"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> <link rel="stylesheet" type="text/css" href="../cs.css"> </head> <body> <div class="node"> <a name="isdigit"></a> <p> Next:&nbsp;<a rel="next" accesskey="n" href="islower.html#islower">islower</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="iscntrl.html#iscntrl">iscntrl</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Ctype.html#Ctype">Ctype</a> <hr> </div> <h3 class="section">3.5 <code>isdigit</code>&mdash;decimal digit predicate</h3> <p><a name="index-isdigit-114"></a><strong>Synopsis</strong> <pre class="example"> #include &lt;ctype.h&gt; int isdigit(int <var>c</var>); </pre> <p><strong>Description</strong><br> <code>isdigit</code> is a macro which classifies ASCII integer values by table lookup. It is a predicate returning non-zero for decimal digits, and 0 for other characters. It is defined only when <code>isascii</code>(<var>c</var>) is true or <var>c</var> is EOF. <p>You can use a compiled subroutine instead of the macro definition by undefining the macro using `<code>#undef isdigit</code>'. <p><br> <strong>Returns</strong><br> <code>isdigit</code> returns non-zero if <var>c</var> is a decimal digit (<code>0</code>&ndash;<code>9</code>). <p><br> <strong>Portability</strong><br> <code>isdigit</code> is ANSI C. <p>No supporting OS subroutines are required. <p><br> </body></html>
/* * Copyright (c) 2009 by Xuggle Incorporated. All rights reserved. * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <libavcodec/avcodec.h> #include <speex/speex.h> #include <speex/speex_header.h> #include <speex/speex_stereo.h> typedef struct { SpeexBits bits; void *enc_state; SpeexHeader header; } LibSpeexEncContext; static av_cold int libspeex_encode_init(AVCodecContext *avctx) { LibSpeexEncContext *s = (LibSpeexEncContext*)avctx->priv_data; const SpeexMode *mode; if ((avctx->sample_fmt != SAMPLE_FMT_S16 && avctx->sample_fmt != SAMPLE_FMT_FLT) || avctx->sample_rate <= 0 || avctx->channels <= 0 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Unsupported sample format, rate, or channels for speex"); return -1; } if (avctx->sample_rate <= 8000) mode = &speex_nb_mode; else if (avctx->sample_rate <= 16000) mode = &speex_wb_mode; else mode = &speex_uwb_mode; speex_bits_init(&s->bits); s->enc_state = speex_encoder_init(mode); if (!s->enc_state) { av_log(avctx, AV_LOG_ERROR, "could not initialize speex encoder"); return -1; } // initialize the header speex_init_header(&s->header, avctx->sample_rate, avctx->channels, mode); // TODO: It'd be nice to support VBR here, but // I'm uncertain what AVCodecContext options to use // to signal whether to turn it on. if (avctx->flags & CODEC_FLAG_QSCALE) { spx_int32_t quality = 0; // Map global_quality's mpeg 1/2/4 scale into Speex's 0-10 scale if (avctx->global_quality > FF_LAMBDA_MAX) quality = 0; // lowest possible quality else quality = (spx_int32_t)((FF_LAMBDA_MAX-avctx->global_quality)*10.0/FF_LAMBDA_MAX); speex_encoder_ctl(s->enc_state, SPEEX_SET_QUALITY, &quality); } else { // default to CBR if (avctx->bit_rate > 0) speex_encoder_ctl(s->enc_state, SPEEX_SET_BITRATE, &avctx->bit_rate); // otherwise just take the default quality setting } // reset the bit-rate to the actual bit rate speex will use speex_encoder_ctl(s->enc_state, SPEEX_GET_BITRATE, &s->header.bitrate); avctx->bit_rate = s->header.bitrate; // get the actual sample rate speex_encoder_ctl(s->enc_state, SPEEX_GET_SAMPLING_RATE, &s->header.rate); avctx->sample_rate = s->header.rate; // get the frame-size. To align with FLV, we're going to put 2 frames // per packet. If someone can tell me how to make this configurable // from the avcodec contents, I'll mod this so it's not hard-coded. // but without this, FLV files with speex data won't play correctly // in flash player 10. speex_encoder_ctl(s->enc_state, SPEEX_GET_FRAME_SIZE, &s->header.frame_size); s->header.frames_per_packet = 2; // Need for FLV container support avctx->frame_size = s->header.frame_size*s->header.frames_per_packet; // and we'll put a speex header packet into extradata so that muxers // can use it. avctx->extradata = speex_header_to_packet(&s->header, &avctx->extradata_size); return 0; } static av_cold int libspeex_encode_frame( AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data) { LibSpeexEncContext *s = (LibSpeexEncContext*)avctx->priv_data; int i = 0; if (!data) // nothing to flush return 0; speex_bits_reset(&s->bits); for(i = 0; i < s->header.frames_per_packet; i++) { if (avctx->sample_fmt == SAMPLE_FMT_FLT) { if (avctx->channels == 2) { speex_encode_stereo( (float*)data+i*s->header.frame_size, s->header.frame_size, &s->bits); } speex_encode(s->enc_state, (float*)data+i*s->header.frame_size, &s->bits); } else { if (avctx->channels == 2) { speex_encode_stereo_int( (spx_int16_t*)data+i*s->header.frame_size, s->header.frame_size, &s->bits); } speex_encode_int(s->enc_state, (spx_int16_t*)data+i*s->header.frame_size, &s->bits); } } // put in a terminator so this will fit in a OGG or FLV packet speex_bits_insert_terminator(&s->bits); if (buf_size >= speex_bits_nbytes(&s->bits)) { return speex_bits_write(&s->bits, frame, buf_size); } else { av_log(avctx, AV_LOG_ERROR, "output buffer too small"); return -1; } } static av_cold int libspeex_encode_close(AVCodecContext *avctx) { LibSpeexEncContext *s = (LibSpeexEncContext*)avctx->priv_data; speex_bits_destroy(&s->bits); speex_encoder_destroy(s->enc_state); s->enc_state = 0; if (avctx->extradata) speex_header_free(avctx->extradata); avctx->extradata = 0; avctx->extradata_size = 0; return 0; } AVCodec ff_libspeex_encoder = { "libspeex", AVMEDIA_TYPE_AUDIO, CODEC_ID_SPEEX, sizeof(LibSpeexEncContext), libspeex_encode_init, libspeex_encode_frame, libspeex_encode_close, 0, .capabilities = CODEC_CAP_DELAY, .supported_samplerates = (const int[]){8000, 16000, 32000, 0}, .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_FLT,SAMPLE_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("libspeex Speex Encoder"), };
/* * pru_ins.h * * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /*=========================================================================== * Copyright (c) Texas Instruments Inc 2010-12 * * Use of this software is controlled by the terms and conditions found in the * license agreement under which this software has been supplied or provided. * ============================================================================ */ /*=========================================================================== // PASM - PRU Assembler //--------------------------------------------------------------------------- // // File : pru_ins.h // // Description: // Defines a data structre PRU_INST that can completely describe a // PRU opcode. // //--------------------------------------------------------------------------- // Revision: // 21-Jun-13: 0.84 - Open source version ============================================================================*/ typedef struct _PRU_ARG { uint Type; uint Flags; /* Flags for RegisterBit type */ #define PA_FLG_REGPOINTER 0x0001 #define PA_FLG_POSTINC 0x0002 #define PA_FLG_PREDEC 0x0004 uint Value; /* Reg #, Imm Val, Count Val */ uint Field; /* Field for Registers */ uint Bit; /* Bit # for RegisterBit type */ } PRU_ARG; #define ARGTYPE_REGISTER 1 /* Standard register and field */ #define ARGTYPE_IMMEDIATE 2 /* Immediate value */ #define ARGTYPE_COUNT 3 /* Count for burst */ #define ARGTYPE_R0BYTE 4 /* Byte from R0 */ #define ARGTYPE_CONSTANT 5 /* Constant Table Index */ #define ARGTYPE_OFFSET 6 /* 10 bit offset for jumps */ #define ARGTYPE_REGISTERBIT 7 /* Register in Rxx.Txx format Field=bitno */ #define FIELDTYPE_7_0 0 /* Bits 7:0 */ #define FIELDTYPE_15_8 1 /* Bits 15:8 */ #define FIELDTYPE_23_16 2 /* Bits 23:16 */ #define FIELDTYPE_31_24 3 /* Bits 31:24 */ #define FIELDTYPE_15_0 4 /* Bits 15:0 */ #define FIELDTYPE_23_8 5 /* Bits 23:8 */ #define FIELDTYPE_31_16 6 /* Bits 31:16 */ #define FIELDTYPE_31_0 7 /* Bits 31:0 */ #define FIELDTYPE_OFF_0 0 /* Offset bit 0 */ #define FIELDTYPE_OFF_8 1 /* Offset bit 8 */ #define FIELDTYPE_OFF_16 2 /* Offset bit 16 */ #define FIELDTYPE_OFF_24 3 /* Offset bit 24 */ extern char *FieldText[]; typedef struct _PRU_INST { uint Op; /* Operation */ uint ArgCnt; /* Argument Count */ PRU_ARG Arg[4]; /* Arguments */ } PRU_INST; #define OP_ADD 1 #define OP_ADC 2 #define OP_SUB 3 #define OP_SUC 4 #define OP_LSL 5 #define OP_LSR 6 #define OP_RSB 7 #define OP_RSC 8 #define OP_AND 9 #define OP_OR 10 #define OP_XOR 11 #define OP_NOT 12 #define OP_MIN 13 #define OP_MAX 14 #define OP_CLR 15 #define OP_SET 16 #define OP_LDI 17 #define OP_LBBO 18 #define OP_LBCO 19 #define OP_SBBO 20 #define OP_SBCO 21 #define OP_LFC 22 #define OP_STC 23 #define OP_JAL 24 #define OP_JMP 25 #define OP_QBGT 26 #define OP_QBLT 27 #define OP_QBEQ 28 #define OP_QBGE 29 #define OP_QBLE 30 #define OP_QBNE 31 #define OP_QBA 32 #define OP_QBBS 33 #define OP_QBBC 34 #define OP_LMBD 35 #define OP_CALL 36 #define OP_WBC 37 #define OP_WBS 38 #define OP_MOV 39 #define OP_MVIB 40 #define OP_MVIW 41 #define OP_MVID 42 #define OP_SCAN 43 #define OP_HALT 44 #define OP_SLP 45 #define OP_RET 46 #define OP_ZERO 47 #define OP_FILL 48 #define OP_XIN 49 #define OP_XOUT 50 #define OP_XCHG 51 #define OP_SXIN 52 #define OP_SXOUT 53 #define OP_SXCHG 54 #define OP_LOOP 55 #define OP_ILOOP 56 #define OP_NOP0 57 #define OP_NOP1 58 #define OP_NOP2 59 #define OP_NOP3 60 #define OP_NOP4 61 #define OP_NOP5 62 #define OP_NOP6 63 #define OP_NOP7 64 #define OP_NOP8 65 #define OP_NOP9 66 #define OP_NOPA 67 #define OP_NOPB 68 #define OP_NOPC 69 #define OP_NOPD 70 #define OP_NOPE 71 #define OP_NOPF 72 #define OP_MAXIDX 72 extern char *OpText[];
var class_peta_poco_1_1_factory = [ [ "ProviderName", "class_peta_poco_1_1_factory.html#ab3fd0d733879b1a810f8d5e3731c721b", null ] ];
/****************************************************************************** * * Copyright (C) 2010 - 2014 Xilinx, Inc. All rights reserved. * * 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. * * Use of the Software is limited solely to applications: * (a) running on a Xilinx device, or * (b) that interact with a Xilinx device through a bus or interconnect. * * 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 * XILINX CONSORTIUM 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. * * Except as contained in this notice, the name of the Xilinx shall not be used * in advertising or otherwise to promote the sale, use or other dealings in * this Software without prior written authorization from Xilinx. * ******************************************************************************/ /*****************************************************************************/ /** * * @file xscugic_hw.c * * This file contains low-level driver functions that can be used to access the * device. The user should refer to the hardware device specification for more * details of the device operation. * These routines are used when the user does not want to create an instance of * XScuGic structure but still wants to use the ScuGic device. Hence the * routines provided here take device id or scugic base address as arguments. * Separate static versions of DistInit and CPUInit are provided to implement * the low level driver routines. * * <pre> * MODIFICATION HISTORY: * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- * 1.01a sdm 07/18/11 First release * 1.03a srt 02/27/13 Moved Offset calculation macros from *_hw.c (CR * 702687). * Added support to direct interrupts to the appropriate CPU. * Earlier interrupts were directed to CPU1 (hard coded). Now * depending upon the CPU selected by the user (xparameters.h), * interrupts will be directed to the relevant CPU. * This fixes CR 699688. * 1.04a hk 05/04/13 Fix for CR#705621. Moved functions * XScuGic_SetPriTrigTypeByDistAddr and * XScuGic_GetPriTrigTypeByDistAddr here from xscugic.c * * </pre> * ******************************************************************************/ /***************************** Include Files *********************************/ #include "xparameters.h" #include "xil_types.h" #include "xil_assert.h" #include "xscugic.h" /************************** Constant Definitions *****************************/ /**************************** Type Definitions *******************************/ /***************** Macros (Inline Functions) Definitions *********************/ /************************** Function Prototypes ******************************/ static void DistInit(XScuGic_Config *Config, u32 CpuID); static void CPUInit(XScuGic_Config *Config); static XScuGic_Config *LookupConfigByBaseAddress(u32 BaseAddress); /************************** Variable Definitions *****************************/ extern XScuGic_Config XScuGic_ConfigTable[]; /*****************************************************************************/ /** * * DistInit initializes the distributor of the GIC. The * initialization entails: * * - Write the trigger mode, priority and target CPU * - All interrupt sources are disabled * - Enable the distributor * * @param InstancePtr is a pointer to the XScuGic instance. * @param CpuID is the Cpu ID to be initialized. * * @return None * * @note None. * ******************************************************************************/ static void DistInit(XScuGic_Config *Config, u32 CpuID) { u32 Int_Id; #if USE_AMP==1 #warning "Building GIC for AMP" /* * The distrubutor should not be initialized by FreeRTOS in the case of * AMP -- it is assumed that Linux is the master of this device in that * case. */ return; #endif XScuGic_WriteReg(Config->DistBaseAddress, XSCUGIC_DIST_EN_OFFSET, 0UL); /* * Set the security domains in the int_security registers for non-secure * interrupts. All are secure, so leave at the default. Set to 1 for * non-secure interrupts. */ /* * For the Shared Peripheral Interrupts INT_ID[MAX..32], set: */ /* * 1. The trigger mode in the int_config register * Only write to the SPI interrupts, so start at 32 */ for (Int_Id = 32; Int_Id<XSCUGIC_MAX_NUM_INTR_INPUTS;Int_Id+=16) { /* * Each INT_ID uses two bits, or 16 INT_ID per register * Set them all to be level sensitive, active HIGH. */ XScuGic_WriteReg(Config->DistBaseAddress, XSCUGIC_INT_CFG_OFFSET_CALC(Int_Id), 0UL); } #define DEFAULT_PRIORITY 0xa0a0a0a0UL for (Int_Id = 0; Int_Id<XSCUGIC_MAX_NUM_INTR_INPUTS;Int_Id+=4) { /* * 2. The priority using int the priority_level register * The priority_level and spi_target registers use one byte per * INT_ID. * Write a default value that can be changed elsewhere. */ XScuGic_WriteReg(Config->DistBaseAddress, XSCUGIC_PRIORITY_OFFSET_CALC(Int_Id), DEFAULT_PRIORITY); } for (Int_Id = 32; Int_Id<XSCUGIC_MAX_NUM_INTR_INPUTS;Int_Id+=4) { /* * 3. The CPU interface in the spi_target register * Only write to the SPI interrupts, so start at 32 */ CpuID |= CpuID << 8; CpuID |= CpuID << 16; XScuGic_WriteReg(Config->DistBaseAddress, XSCUGIC_SPI_TARGET_OFFSET_CALC(Int_Id), CpuID); } for (Int_Id = 0; Int_Id<XSCUGIC_MAX_NUM_INTR_INPUTS;Int_Id+=32) { /* * 4. Enable the SPI using the enable_set register. Leave all disabled * for now. */ XScuGic_WriteReg(Config->DistBaseAddress, XSCUGIC_ENABLE_DISABLE_OFFSET_CALC(XSCUGIC_DISABLE_OFFSET, Int_Id), 0xFFFFFFFFUL); } XScuGic_WriteReg(Config->DistBaseAddress, XSCUGIC_DIST_EN_OFFSET, XSCUGIC_EN_INT_MASK); } /*****************************************************************************/ /** * * CPUInit initializes the CPU Interface of the GIC. The initialization entails: * * - Set the priority of the CPU. * - Enable the CPU interface * * @param ConfigPtr is a pointer to a config table for the particular * device this driver is associated with. * * @return None * * @note None. * ******************************************************************************/ static void CPUInit(XScuGic_Config *Config) { /* * Program the priority mask of the CPU using the Priority mask * register */ XScuGic_WriteReg(Config->CpuBaseAddress, XSCUGIC_CPU_PRIOR_OFFSET, 0xF0); /* * If the CPU operates in both security domains, set parameters in the * control_s register. * 1. Set FIQen=1 to use FIQ for secure interrupts, * 2. Program the AckCtl bit * 3. Program the SBPR bit to select the binary pointer behavior * 4. Set EnableS = 1 to enable secure interrupts * 5. Set EnbleNS = 1 to enable non secure interrupts */ /* * If the CPU operates only in the secure domain, setup the * control_s register. * 1. Set FIQen=1, * 2. Set EnableS=1, to enable the CPU interface to signal secure . * interrupts Only enable the IRQ output unless secure interrupts * are needed. */ XScuGic_WriteReg(Config->CpuBaseAddress, XSCUGIC_CONTROL_OFFSET, 0x07); } /*****************************************************************************/ /** * * CfgInitialize a specific interrupt controller instance/driver. The * initialization entails: * * - Initialize fields of the XScuGic structure * - Initial vector table with stub function calls * - All interrupt sources are disabled * * @param InstancePtr is a pointer to the XScuGic instance to be worked on. * @param ConfigPtr is a pointer to a config table for the particular device * this driver is associated with. * @param EffectiveAddr is the device base address in the virtual memory address * space. The caller is responsible for keeping the address mapping * from EffectiveAddr to the device physical base address unchanged * once this function is invoked. Unexpected errors may occur if the * address mapping changes after this function is called. If address * translation is not used, use Config->BaseAddress for this parameters, * passing the physical address instead. * * @return * * - XST_SUCCESS if initialization was successful * * @note * * None. * ******************************************************************************/ int XScuGic_DeviceInitialize(u32 DeviceId) { XScuGic_Config *Config; u8 Cpu_Id = XPAR_CPU_ID + 1; Config = &XScuGic_ConfigTable[(u32 )DeviceId]; DistInit(Config, Cpu_Id); CPUInit(Config); return XST_SUCCESS; } /*****************************************************************************/ /** * This function is the primary interrupt handler for the driver. It must be * connected to the interrupt source such that it is called when an interrupt of * the interrupt controller is active. It will resolve which interrupts are * active and enabled and call the appropriate interrupt handler. It uses * the Interrupt Type information to determine when to acknowledge the * interrupt.Highest priority interrupts are serviced first. * * This function assumes that an interrupt vector table has been previously * initialized. It does not verify that entries in the table are valid before * calling an interrupt handler. * * @param DeviceId is the unique identifier for the ScuGic device. * * @return None. * * @note None. * ******************************************************************************/ void XScuGic_DeviceInterruptHandler(void *DeviceId) { u32 IntID; XScuGic_VectorTableEntry *TablePtr; XScuGic_Config *CfgPtr; CfgPtr = &XScuGic_ConfigTable[(u32 )DeviceId]; /* * Read the int_ack register to identify the highest priority * interrupt ID and make sure it is valid. Reading Int_Ack will * clear the interrupt in the GIC. */ IntID = XScuGic_ReadReg(CfgPtr->CpuBaseAddress, XSCUGIC_INT_ACK_OFFSET) & XSCUGIC_ACK_INTID_MASK; if(XSCUGIC_MAX_NUM_INTR_INPUTS < IntID){ goto IntrExit; } /* * If the interrupt is shared, do some locking here if there are * multiple processors. */ /* * If pre-eption is required: * Re-enable pre-emption by setting the CPSR I bit for non-secure , * interrupts or the F bit for secure interrupts */ /* * If we need to change security domains, issue a SMC instruction here. */ /* * Execute the ISR. Jump into the Interrupt service routine based on * the IRQSource. A software trigger is cleared by the ACK. */ TablePtr = &(CfgPtr->HandlerTable[IntID]); TablePtr->Handler(TablePtr->CallBackRef); IntrExit: /* * Write to the EOI register, we are all done here. * Let this function return, the boot code will restore the stack. */ XScuGic_WriteReg(CfgPtr->CpuBaseAddress, XSCUGIC_EOI_OFFSET, IntID); /* * Return from the interrupt. Change security domains could happen * here. */ } /*****************************************************************************/ /** * * Register a handler function for a specific interrupt ID. The vector table * of the interrupt controller is updated, overwriting any previous handler. * The handler function will be called when an interrupt occurs for the given * interrupt ID. * * @param BaseAddress is the CPU Interface Register base address of the * interrupt controller whose vector table will be modified. * @param InterruptId is the interrupt ID to be associated with the input * handler. * @param Handler is the function pointer that will be added to * the vector table for the given interrupt ID. * @param CallBackRef is the argument that will be passed to the new * handler function when it is called. This is user-specific. * * @return None. * * @note * * Note that this function has no effect if the input base address is invalid. * ******************************************************************************/ void XScuGic_RegisterHandler(u32 BaseAddress, int InterruptId, Xil_InterruptHandler Handler, void *CallBackRef) { XScuGic_Config *CfgPtr; CfgPtr = LookupConfigByBaseAddress(BaseAddress); if (CfgPtr != NULL) { CfgPtr->HandlerTable[InterruptId].Handler = Handler; CfgPtr->HandlerTable[InterruptId].CallBackRef = CallBackRef; } } /*****************************************************************************/ /** * * Looks up the device configuration based on the CPU interface base address of * the device. A table contains the configuration info for each device in the * system. * * @param CpuBaseAddress is the CPU Interface Register base address. * * @return A pointer to the configuration structure for the specified * device, or NULL if the device was not found. * * @note None. * ******************************************************************************/ static XScuGic_Config *LookupConfigByBaseAddress(u32 CpuBaseAddress) { XScuGic_Config *CfgPtr = NULL; int Index; for (Index = 0; Index < XPAR_SCUGIC_NUM_INSTANCES; Index++) { if (XScuGic_ConfigTable[Index].CpuBaseAddress == CpuBaseAddress) { CfgPtr = &XScuGic_ConfigTable[Index]; break; } } return CfgPtr; } /****************************************************************************/ /** * Sets the interrupt priority and trigger type for the specificd IRQ source. * * @param BaseAddr is the device base address * @param Int_Id is the IRQ source number to modify * @param Priority is the new priority for the IRQ source. 0 is highest * priority, 0xF8 (248) is lowest. There are 32 priority levels * supported with a step of 8. Hence the supported priorities are * 0, 8, 16, 32, 40 ..., 248. * @param Trigger is the new trigger type for the IRQ source. * Each bit pair describes the configuration for an INT_ID. * SFI Read Only b10 always * PPI Read Only depending on how the PPIs are configured. * b01 Active HIGH level sensitive * b11 Rising edge sensitive * SPI LSB is read only. * b01 Active HIGH level sensitive * b11 Rising edge sensitive/ * * @return None. * * @note This API has the similar functionality of XScuGic_SetPriority * TriggerType() and should be used when there is no InstancePtr. * *****************************************************************************/ void XScuGic_SetPriTrigTypeByDistAddr(u32 DistBaseAddress, u32 Int_Id, u8 Priority, u8 Trigger) { u32 RegValue; Xil_AssertVoid(Int_Id < XSCUGIC_MAX_NUM_INTR_INPUTS); Xil_AssertVoid(Trigger <= XSCUGIC_INT_CFG_MASK); Xil_AssertVoid(Priority <= XSCUGIC_MAX_INTR_PRIO_VAL); /* * Determine the register to write to using the Int_Id. */ RegValue = XScuGic_ReadReg(DistBaseAddress, XSCUGIC_PRIORITY_OFFSET_CALC(Int_Id)); /* * The priority bits are Bits 7 to 3 in GIC Priority Register. This * means the number of priority levels supported are 32 and they are * in steps of 8. The priorities can be 0, 8, 16, 32, 48, ... etc. * The lower order 3 bits are masked before putting it in the register. */ Priority = Priority & XSCUGIC_INTR_PRIO_MASK; /* * Shift and Mask the correct bits for the priority and trigger in the * register */ RegValue &= ~(XSCUGIC_PRIORITY_MASK << ((Int_Id%4)*8)); RegValue |= Priority << ((Int_Id%4)*8); /* * Write the value back to the register. */ XScuGic_WriteReg(DistBaseAddress, XSCUGIC_PRIORITY_OFFSET_CALC(Int_Id), RegValue); /* * Determine the register to write to using the Int_Id. */ RegValue = XScuGic_ReadReg(DistBaseAddress, XSCUGIC_INT_CFG_OFFSET_CALC (Int_Id)); /* * Shift and Mask the correct bits for the priority and trigger in the * register */ RegValue &= ~(XSCUGIC_INT_CFG_MASK << ((Int_Id%16)*2)); RegValue |= Trigger << ((Int_Id%16)*2); /* * Write the value back to the register. */ XScuGic_WriteReg(DistBaseAddress, XSCUGIC_INT_CFG_OFFSET_CALC(Int_Id), RegValue); } /****************************************************************************/ /** * Gets the interrupt priority and trigger type for the specificd IRQ source. * * @param BaseAddr is the device base address * @param Int_Id is the IRQ source number to modify * @param Priority is a pointer to the value of the priority of the IRQ * source. This is a return value. * @param Trigger is pointer to the value of the trigger of the IRQ * source. This is a return value. * * @return None. * * @note This API has the similar functionality of XScuGic_GetPriority * TriggerType() and should be used when there is no InstancePtr. * *****************************************************************************/ void XScuGic_GetPriTrigTypeByDistAddr(u32 DistBaseAddress, u32 Int_Id, u8 *Priority, u8 *Trigger) { u32 RegValue; Xil_AssertVoid(Int_Id < XSCUGIC_MAX_NUM_INTR_INPUTS); Xil_AssertVoid(Priority != NULL); Xil_AssertVoid(Trigger != NULL); /* * Determine the register to read to using the Int_Id. */ RegValue = XScuGic_ReadReg(DistBaseAddress, XSCUGIC_PRIORITY_OFFSET_CALC(Int_Id)); /* * Shift and Mask the correct bits for the priority and trigger in the * register */ RegValue = RegValue >> ((Int_Id%4)*8); *Priority = RegValue & XSCUGIC_PRIORITY_MASK; /* * Determine the register to read to using the Int_Id. */ RegValue = XScuGic_ReadReg(DistBaseAddress, XSCUGIC_INT_CFG_OFFSET_CALC (Int_Id)); /* * Shift and Mask the correct bits for the priority and trigger in the * register */ RegValue = RegValue >> ((Int_Id%16)*2); *Trigger = RegValue & XSCUGIC_INT_CFG_MASK; }
package com.objogate.wl.swing.driver; import javax.swing.JProgressBar; import java.awt.Component; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import com.objogate.wl.Prober; import com.objogate.wl.swing.ComponentSelector; import com.objogate.wl.swing.gesture.GesturePerformer; public class JProgressBarDriver extends JComponentDriver<JProgressBar> { public JProgressBarDriver(GesturePerformer gesturePerformer, ComponentSelector<JProgressBar> jProgressBarComponentSelector, Prober prober) { super(gesturePerformer, jProgressBarComponentSelector, prober); } public JProgressBarDriver(ComponentDriver<? extends Component> parentOrOwner, ComponentSelector<JProgressBar> jProgressBarComponentSelector) { super(parentOrOwner, jProgressBarComponentSelector); } public JProgressBarDriver(ComponentDriver<? extends Component> parentOrOwner, Class<JProgressBar> componentType, Matcher<? super JProgressBar>... matchers) { super(parentOrOwner, componentType, matchers); } public void hasMinimum(final Matcher<Integer> matcher) { is(new TypeSafeMatcher<JProgressBar>() { @Override public boolean matchesSafely(JProgressBar jProgressBar) { return matcher.matches(jProgressBar.getMinimum()); } public void describeTo(Description description) { description.appendText("minimumvalue matches"); description.appendDescriptionOf(matcher); } }); } public void hasMaximum(final Matcher<Integer> matcher) { is(new TypeSafeMatcher<JProgressBar>() { @Override public boolean matchesSafely(JProgressBar jProgressBar) { return matcher.matches(jProgressBar.getMaximum()); } public void describeTo(Description description) { description.appendText("maximumvalue matches"); description.appendDescriptionOf(matcher); } }); } public void hasValue(final Matcher<Integer> matcher) { is(new TypeSafeMatcher<JProgressBar>() { @Override public boolean matchesSafely(JProgressBar jProgressBar) { return matcher.matches(jProgressBar.getValue()); } public void describeTo(Description description) { description.appendText("value matches"); description.appendDescriptionOf(matcher); } }); } public void hasString(final Matcher<String> matcher) { is(new TypeSafeMatcher<JProgressBar>() { @Override public boolean matchesSafely(JProgressBar jProgressBar) { return matcher.matches(jProgressBar.getString()); } public void describeTo(Description description) { description.appendText("string matches"); description.appendDescriptionOf(matcher); } }); } public void hasPercentComplete(final Matcher<Double> matcher) { is(new TypeSafeMatcher<JProgressBar>() { @Override public boolean matchesSafely(JProgressBar jProgressBar) { return matcher.matches(jProgressBar.getPercentComplete()); } public void describeTo(Description description) { description.appendText("percentage matches"); description.appendDescriptionOf(matcher); } }); } }
/* Arduino Sd2Card Library * Copyright (C) 2012 by William Greiman * * This file is part of the Arduino Sd2Card 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with the Arduino Sd2Card Library. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef SdInfo_h #define SdInfo_h #include <stdint.h> // Based on the document: // // SD Specifications // Part 1 // Physical Layer // Simplified Specification // Version 3.01 // May 18, 2010 // // http://www.sdcard.org/developers/tech/sdcard/pls/simplified_specs //------------------------------------------------------------------------------ // SD card commands /** GO_IDLE_STATE - init card in spi mode if CS low */ uint8_t const CMD0 = 0X00; /** SEND_IF_COND - verify SD Memory Card interface operating condition.*/ uint8_t const CMD8 = 0X08; /** SEND_CSD - read the Card Specific Data (CSD register) */ uint8_t const CMD9 = 0X09; /** SEND_CID - read the card identification information (CID register) */ uint8_t const CMD10 = 0X0A; /** STOP_TRANSMISSION - end multiple block read sequence */ uint8_t const CMD12 = 0X0C; /** SEND_STATUS - read the card status register */ uint8_t const CMD13 = 0X0D; /** READ_SINGLE_BLOCK - read a single data block from the card */ uint8_t const CMD17 = 0X11; /** READ_MULTIPLE_BLOCK - read a multiple data blocks from the card */ uint8_t const CMD18 = 0X12; /** WRITE_BLOCK - write a single data block to the card */ uint8_t const CMD24 = 0X18; /** WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION */ uint8_t const CMD25 = 0X19; /** ERASE_WR_BLK_START - sets the address of the first block to be erased */ uint8_t const CMD32 = 0X20; /** ERASE_WR_BLK_END - sets the address of the last block of the continuous range to be erased*/ uint8_t const CMD33 = 0X21; /** ERASE - erase all previously selected blocks */ uint8_t const CMD38 = 0X26; /** APP_CMD - escape for application specific command */ uint8_t const CMD55 = 0X37; /** READ_OCR - read the OCR register of a card */ uint8_t const CMD58 = 0X3A; /** CRC_ON_OFF - enable or disable CRC checking */ uint8_t const CMD59 = 0X3B; /** SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be pre-erased before writing */ uint8_t const ACMD23 = 0X17; /** SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process */ uint8_t const ACMD41 = 0X29; //------------------------------------------------------------------------------ /** status for card in the ready state */ uint8_t const R1_READY_STATE = 0X00; /** status for card in the idle state */ uint8_t const R1_IDLE_STATE = 0X01; /** status bit for illegal command */ uint8_t const R1_ILLEGAL_COMMAND = 0X04; /** start data token for read or write single block*/ uint8_t const DATA_START_BLOCK = 0XFE; /** stop token for write multiple blocks*/ uint8_t const STOP_TRAN_TOKEN = 0XFD; /** start data token for write multiple blocks*/ uint8_t const WRITE_MULTIPLE_TOKEN = 0XFC; /** mask for data response tokens after a write block operation */ uint8_t const DATA_RES_MASK = 0X1F; /** write data accepted token */ uint8_t const DATA_RES_ACCEPTED = 0X05; //------------------------------------------------------------------------------ /** Card IDentification (CID) register */ typedef struct CID { // byte 0 /** Manufacturer ID */ unsigned char mid; // byte 1-2 /** OEM/Application ID */ char oid[2]; // byte 3-7 /** Product name */ char pnm[5]; // byte 8 /** Product revision least significant digit */ unsigned char prv_m : 4; /** Product revision most significant digit */ unsigned char prv_n : 4; // byte 9-12 /** Product serial number */ uint32_t psn; // byte 13 /** Manufacturing date year low digit */ unsigned char mdt_year_high : 4; /** not used */ unsigned char reserved : 4; // byte 14 /** Manufacturing date month */ unsigned char mdt_month : 4; /** Manufacturing date year low digit */ unsigned char mdt_year_low :4; // byte 15 /** not used always 1 */ unsigned char always1 : 1; /** CRC7 checksum */ unsigned char crc : 7; }__attribute__((packed)) cid_t; //------------------------------------------------------------------------------ /** CSD for version 1.00 cards */ typedef struct CSDV1 { // byte 0 unsigned char reserved1 : 6; unsigned char csd_ver : 2; // byte 1 unsigned char taac; // byte 2 unsigned char nsac; // byte 3 unsigned char tran_speed; // byte 4 unsigned char ccc_high; // byte 5 unsigned char read_bl_len : 4; unsigned char ccc_low : 4; // byte 6 unsigned char c_size_high : 2; unsigned char reserved2 : 2; unsigned char dsr_imp : 1; unsigned char read_blk_misalign :1; unsigned char write_blk_misalign : 1; unsigned char read_bl_partial : 1; // byte 7 unsigned char c_size_mid; // byte 8 unsigned char vdd_r_curr_max : 3; unsigned char vdd_r_curr_min : 3; unsigned char c_size_low :2; // byte 9 unsigned char c_size_mult_high : 2; unsigned char vdd_w_cur_max : 3; unsigned char vdd_w_curr_min : 3; // byte 10 unsigned char sector_size_high : 6; unsigned char erase_blk_en : 1; unsigned char c_size_mult_low : 1; // byte 11 unsigned char wp_grp_size : 7; unsigned char sector_size_low : 1; // byte 12 unsigned char write_bl_len_high : 2; unsigned char r2w_factor : 3; unsigned char reserved3 : 2; unsigned char wp_grp_enable : 1; // byte 13 unsigned char reserved4 : 5; unsigned char write_partial : 1; unsigned char write_bl_len_low : 2; // byte 14 unsigned char reserved5: 2; unsigned char file_format : 2; unsigned char tmp_write_protect : 1; unsigned char perm_write_protect : 1; unsigned char copy : 1; /** Indicates the file format on the card */ unsigned char file_format_grp : 1; // byte 15 unsigned char always1 : 1; unsigned char crc : 7; }__attribute__((packed)) csd1_t; //------------------------------------------------------------------------------ /** CSD for version 2.00 cards */ typedef struct CSDV2 { // byte 0 unsigned char reserved1 : 6; unsigned char csd_ver : 2; // byte 1 /** fixed to 0X0E */ unsigned char taac; // byte 2 /** fixed to 0 */ unsigned char nsac; // byte 3 unsigned char tran_speed; // byte 4 unsigned char ccc_high; // byte 5 /** This field is fixed to 9h, which indicates READ_BL_LEN=512 Byte */ unsigned char read_bl_len : 4; unsigned char ccc_low : 4; // byte 6 /** not used */ unsigned char reserved2 : 4; unsigned char dsr_imp : 1; /** fixed to 0 */ unsigned char read_blk_misalign :1; /** fixed to 0 */ unsigned char write_blk_misalign : 1; /** fixed to 0 - no partial read */ unsigned char read_bl_partial : 1; // byte 7 /** high part of card size */ unsigned char c_size_high : 6; /** not used */ unsigned char reserved3 : 2; // byte 8 /** middle part of card size */ unsigned char c_size_mid; // byte 9 /** low part of card size */ unsigned char c_size_low; // byte 10 /** sector size is fixed at 64 KB */ unsigned char sector_size_high : 6; /** fixed to 1 - erase single is supported */ unsigned char erase_blk_en : 1; /** not used */ unsigned char reserved4 : 1; // byte 11 unsigned char wp_grp_size : 7; /** sector size is fixed at 64 KB */ unsigned char sector_size_low : 1; // byte 12 /** write_bl_len fixed for 512 byte blocks */ unsigned char write_bl_len_high : 2; /** fixed value of 2 */ unsigned char r2w_factor : 3; /** not used */ unsigned char reserved5 : 2; /** fixed value of 0 - no write protect groups */ unsigned char wp_grp_enable : 1; // byte 13 unsigned char reserved6 : 5; /** always zero - no partial block read*/ unsigned char write_partial : 1; /** write_bl_len fixed for 512 byte blocks */ unsigned char write_bl_len_low : 2; // byte 14 unsigned char reserved7: 2; /** Do not use always 0 */ unsigned char file_format : 2; unsigned char tmp_write_protect : 1; unsigned char perm_write_protect : 1; unsigned char copy : 1; /** Do not use always 0 */ unsigned char file_format_grp : 1; // byte 15 /** not used always 1 */ unsigned char always1 : 1; /** checksum */ unsigned char crc : 7; }__attribute__((packed)) csd2_t; //------------------------------------------------------------------------------ /** union of old and new style CSD register */ union csd_t { csd1_t v1; csd2_t v2; }; #endif // SdInfo_h
/* -*- c++ -*- */ /* * Copyright 2010-2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_DIGITAL_CONSTELLATION_H #define INCLUDED_DIGITAL_CONSTELLATION_H #include <gnuradio/digital/api.h> #include <gnuradio/digital/metric_type.h> #include <boost/enable_shared_from_this.hpp> #include <boost/any.hpp> #include <gnuradio/gr_complex.h> #include <pmt/pmt.h> #include <vector> namespace gr { namespace digital { /************************************************************/ /* constellation */ /* */ /* Base class defining interface. */ /************************************************************/ class constellation; typedef boost::shared_ptr<constellation> constellation_sptr; /*! * \brief An abstracted constellation object * \ingroup symbol_coding_blk * * \details * The constellation objects hold the necessary information to pass * around constellation information for modulators and * demodulators. These objects contain the mapping between the bits * and the constellation points used to represent them as well as * methods for slicing the symbol space. Various implementations are * possible for efficiency and ease of use. * * Standard constellations (BPSK, QPSK, QAM, etc) can be inherited * from this class and overloaded to perform optimized slicing and * constellation mappings. */ class DIGITAL_API constellation : public boost::enable_shared_from_this<constellation> { public: constellation(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality); constellation(); virtual ~constellation(); //! Returns the constellation points for a symbol value void map_to_points(unsigned int value, gr_complex *points); std::vector<gr_complex> map_to_points_v(unsigned int value); //! Returns the constellation point that matches best. virtual unsigned int decision_maker(const gr_complex *sample) = 0; //! Takes a vector rather than a pointer. Better for SWIG wrapping. unsigned int decision_maker_v(std::vector<gr_complex> sample); //! Also calculates the phase error. unsigned int decision_maker_pe(const gr_complex *sample, float *phase_error); //! Calculates distance. //unsigned int decision_maker_e(const gr_complex *sample, float *error); //! Calculates metrics for all points in the constellation. //! For use with the viterbi algorithm. virtual void calc_metric(const gr_complex *sample, float *metric, gr::digital::trellis_metric_type_t type); virtual void calc_euclidean_metric(const gr_complex *sample, float *metric); virtual void calc_hard_symbol_metric(const gr_complex *sample, float *metric); //! Returns the set of points in this constellation. std::vector<gr_complex> points() { return d_constellation;} //! Returns the vector of points in this constellation. //! Raise error if dimensionality is not one. std::vector<gr_complex> s_points(); //! Returns a vector of vectors of points. std::vector<std::vector<gr_complex> > v_points(); //! Whether to apply an encoding before doing differential encoding. (e.g. gray coding) bool apply_pre_diff_code() { return d_apply_pre_diff_code;} //! Whether to apply an encoding before doing differential encoding. (e.g. gray coding) void set_pre_diff_code(bool a) { d_apply_pre_diff_code = a;} //! Returns the encoding to apply before differential encoding. std::vector<int> pre_diff_code() { return d_pre_diff_code;} //! Returns the order of rotational symmetry. unsigned int rotational_symmetry() { return d_rotational_symmetry;} //! Returns the number of complex numbers in a single symbol. unsigned int dimensionality() {return d_dimensionality;} unsigned int bits_per_symbol() { return floor(log(double(d_constellation.size()))/d_dimensionality/log(2.0)); } unsigned int arity() { return d_arity; } constellation_sptr base() { return shared_from_this(); } pmt::pmt_t as_pmt() { return pmt::make_any(boost::any(base())); } /*! \brief Generates the soft decision LUT based on * constellation and symbol map. * * \details Generates the soft decision LUT based on * constellation and symbol map. It can be given a estimate of * the noise power in the channel as \p npwr. * * \param precision Number of bits of precision on each axis. * \param npwr Estimate of the noise power (if known). * * This is expensive to compute. */ void gen_soft_dec_lut(int precision, float npwr=1.0); /*! \brief Calculate soft decisions for the given \p sample. * * \details Calculate the soft decisions from the given \p sample * at the given noise power \p npwr. * * This is a very costly algorithm (especially for higher order * modulations) and should be used sparingly. It uses the * #gen_soft_dec_lut function to generate the LUT, which * should be done once or if a large change in the noise floor * is detected. * * Instead of using this function, generate the LUT using the * #gen_soft_dec_lut after creating the constellation object * and then use the #soft_decision_maker function to return the * answer from the LUT. * * \param sample The complex sample to get the soft decisions. * \param npwr Estimate of the noise power (if known). */ virtual std::vector<float> calc_soft_dec(gr_complex sample, float npwr=1.0); /*! \brief Define a soft decision look-up table. * * \details Define a soft decision look-up table (LUT). Because * soft decisions can be calculated in various ways with various * levels of accuracy and complexity, this function allows * users to create a LUT in their own way. * * Setting the LUT here means that #has_soft_dec_lut will return * true. Decision vectors returned by #soft_decision_maker will * be calculated using this LUT. * * \param soft_dec_lut The soft decision LUT as a vector of * tuples (vectors in C++) of soft decisions. Each * element of the LUT is a vector of k-bit floats (where * there are k bits/sample in the constellation). * \param precision The number of bits of precision used when * generating the LUT. */ void set_soft_dec_lut(const std::vector< std::vector<float> > &soft_dec_lut, int precision); //! Returns True if the soft decision LUT has been defined, False otherwise. bool has_soft_dec_lut(); /*! \brief Returns the soft decisions for the given \p sample. * * \details Returns the soft decisions for the given \p * sample. If a LUT is defined for the object, the decisions * will be calculated from there. Otherwise, this function will * call calc_soft_dec directly to calculate the soft decisions. * * \param sample The complex sample to get the soft decisions. */ std::vector<float> soft_decision_maker(gr_complex sample); protected: std::vector<gr_complex> d_constellation; std::vector<int> d_pre_diff_code; bool d_apply_pre_diff_code; unsigned int d_rotational_symmetry; unsigned int d_dimensionality; unsigned int d_arity; //! The factor by which the user given constellation points were //! scaled by to achieve an average amplitude of 1. float d_scalefactor; float d_re_min, d_re_max, d_im_min, d_im_max; std::vector< std::vector<float> > d_soft_dec_lut; int d_lut_precision; float d_lut_scale; float get_distance(unsigned int index, const gr_complex *sample); unsigned int get_closest_point(const gr_complex *sample); void calc_arity(); void max_min_axes(); }; /************************************************************/ /* constellation_calcdist */ /* */ /************************************************************/ /*! \brief Calculate Euclidian distance for any constellation * \ingroup digital * * \details * Constellation which calculates the distance to each point in the * constellation for decision making. Inefficient for large * constellations. */ class DIGITAL_API constellation_calcdist : public constellation { public: typedef boost::shared_ptr<constellation_calcdist> sptr; /*! * Make a general constellation object that calculates the Euclidean distance for hard decisions. * * \param constell List of constellation points (order of list matches pre_diff_code) * \param pre_diff_code List of alphabet symbols (before applying any differential * coding) (order of list matches constell) * \param rotational_symmetry Number of rotations around unit circle that have the same representation. * \param dimensionality Number of dimensions to the constellation. */ static sptr make(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality); unsigned int decision_maker(const gr_complex *sample); // void calc_metric(gr_complex *sample, float *metric, trellis_metric_type_t type); // void calc_euclidean_metric(gr_complex *sample, float *metric); // void calc_hard_symbol_metric(gr_complex *sample, float *metric); protected: constellation_calcdist(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality); }; /************************************************************/ /*! constellation_sector */ /************************************************************/ /*! * \brief Sectorized digital constellation * \ingroup digital * * \details * Constellation space is divided into sectors. Each sector is * associated with the nearest constellation point. */ class DIGITAL_API constellation_sector : public constellation { public: /*! * Make a sectorized constellation object. * * \param constell List of constellation points (order of list matches pre_diff_code) * \param pre_diff_code List of alphabet symbols (before applying any differential * coding) (order of list matches constell) * \param rotational_symmetry Number of rotations around unit circle that have the same representation. * \param dimensionality Number of z-axis dimensions to the constellation * \param n_sectors Number of sectors in the constellation. */ constellation_sector(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality, unsigned int n_sectors); ~constellation_sector(); unsigned int decision_maker(const gr_complex *sample); protected: virtual unsigned int get_sector(const gr_complex *sample) = 0; virtual unsigned int calc_sector_value(unsigned int sector) = 0; void find_sector_values(); unsigned int n_sectors; private: std::vector<int> sector_values; }; /************************************************************/ /* constellation_rect */ /************************************************************/ /*! * \brief Rectangular digital constellation * \ingroup digital * * Only implemented for 1-(complex)dimensional constellation. * * Constellation space is divided into rectangular sectors. Each * sector is associated with the nearest constellation point. * * Works well for square QAM. * * Works for any generic constellation provided sectors are not * too large. */ class DIGITAL_API constellation_rect : public constellation_sector { public: typedef boost::shared_ptr<constellation_rect> sptr; /*! * Make a rectangular constellation object. * * \param constell List of constellation points (order of list matches pre_diff_code) * \param pre_diff_code List of alphabet symbols (before applying any differential * coding) (order of list matches constell) * \param rotational_symmetry Number of rotations around unit circle that have the same representation. * \param real_sectors Number of sectors the real axis is split in to. * \param imag_sectors Number of sectors the imag axis is split in to. * \param width_real_sectors width of each real sector to calculate decision boundaries. * \param width_imag_sectors width of each imag sector to calculate decision boundaries. */ static constellation_rect::sptr make(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors); ~constellation_rect(); protected: constellation_rect(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors); unsigned int get_sector(const gr_complex *sample); gr_complex calc_sector_center(unsigned int sector); unsigned int calc_sector_value(unsigned int sector); private: unsigned int n_real_sectors; unsigned int n_imag_sectors; float d_width_real_sectors; float d_width_imag_sectors; }; /************************************************************/ /* constellation_expl_rect */ /************************************************************/ /*! * \brief Rectangular digital constellation. * \ingroup digital * * \details * Only implemented for 1-(complex)dimensional constellation. * * Constellation space is divided into rectangular sectors. Each * sector is associated with the nearest constellation point. * * This class is different from constellation_rect in that the * mapping from sector to constellation point is explicitly passed * into the constructor as sector_values. Usually we do not need * this, since we want each sector to be automatically mapped to * the closest constellation point, however sometimes it's nice to * have the flexibility. */ class DIGITAL_API constellation_expl_rect : public constellation_rect { public: typedef boost::shared_ptr<constellation_expl_rect> sptr; static sptr make(std::vector<gr_complex> constellation, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors, std::vector<unsigned int> sector_values); ~constellation_expl_rect(); protected: constellation_expl_rect(std::vector<gr_complex> constellation, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors, std::vector<unsigned int> sector_values); unsigned int calc_sector_value (unsigned int sector) { return d_sector_values[sector]; } private: std::vector<unsigned int> d_sector_values; }; /************************************************************/ /* constellation_psk */ /************************************************************/ /*! * \brief constellation_psk * \ingroup digital * * Constellation space is divided into pie slices sectors. * * Each slice is associated with the nearest constellation point. * * Works well for PSK but nothing else. * * Assumes that there is a constellation point at 1.x */ class DIGITAL_API constellation_psk : public constellation_sector { public: typedef boost::shared_ptr<constellation_psk> sptr; // public constructor static sptr make(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int n_sectors); ~constellation_psk(); protected: unsigned int get_sector(const gr_complex *sample); unsigned int calc_sector_value(unsigned int sector); constellation_psk(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int n_sectors); }; /************************************************************/ /* constellation_bpsk */ /* */ /* Only works for BPSK. */ /* */ /************************************************************/ /*! * \brief Digital constellation for BPSK . * \ingroup digital * * \details * \verbatim 0 | 1 \endverbatim */ class DIGITAL_API constellation_bpsk : public constellation { public: typedef boost::shared_ptr<constellation_bpsk> sptr; // public constructor static sptr make(); ~constellation_bpsk(); unsigned int decision_maker(const gr_complex *sample); protected: constellation_bpsk(); }; /************************************************************/ /* constellation_qpsk */ /* */ /* Only works for QPSK. */ /* */ /************************************************************/ /*! * \brief Digital constellation for QPSK * \ingroup digital * * \details * \verbatim 01 | 11 ------- 00 | 10 \endverbatim */ class DIGITAL_API constellation_qpsk : public constellation { public: typedef boost::shared_ptr<constellation_qpsk> sptr; // public constructor static sptr make(); ~constellation_qpsk(); unsigned int decision_maker(const gr_complex *sample); protected: constellation_qpsk(); }; /************************************************************/ /* constellation_dqpsk */ /* */ /* Works with differential encoding; slower decisions. */ /* */ /************************************************************/ /*! * \brief Digital constellation for DQPSK. * \ingroup digital * * \details * \verbatim 01 | 00 ------- 11 | 10 \endverbatim */ class DIGITAL_API constellation_dqpsk : public constellation { public: typedef boost::shared_ptr<constellation_dqpsk> sptr; // public constructor static sptr make(); ~constellation_dqpsk(); unsigned int decision_maker(const gr_complex *sample); protected: constellation_dqpsk(); }; /************************************************************/ /* constellation_8psk */ /* */ /* Only works for 8PSK. */ /* */ /************************************************************/ /*! * \brief Digital constellation for 8PSK. * \ingroup digital * * \details * \verbatim 101 | 100 001 | 000 ----------------- 011 | 010 111 | 110 \endverbatim */ class DIGITAL_API constellation_8psk : public constellation { public: typedef boost::shared_ptr<constellation_8psk> sptr; // public constructor static sptr make(); ~constellation_8psk(); unsigned int decision_maker(const gr_complex *sample); protected: constellation_8psk(); }; } /* namespace digital */ } /* namespace gr */ #endif /* INCLUDED_DIGITAL_CONSTELLATION_H */
{% if data %} <h5 style="margin-top: 20px;"> {{ __("Allocated Leaves") }} </h5> <table class="table table-bordered small"> <thead> <tr> <th style="width: 20%">{{ __("Leave Type") }}</th> <th style="width: 20%" class="text-right">{{ __("Total Allocated Leaves") }}</th> <th style="width: 20%" class="text-right">{{ __("Used Leaves") }}</th> <th style="width: 20%" class="text-right">{{ __("Pending Leaves") }}</th> <th style="width: 20%" class="text-right">{{ __("Available Leaves") }}</th> </tr> </thead> <tbody> {% for(const [key, value] of Object.entries(data)) { %} <tr> <td> {%= key %} </td> <td class="text-right"> {%= value["total_leaves"] %} </td> <td class="text-right"> {%= value["leaves_taken"] %} </td> <td class="text-right"> {%= value["pending_leaves"] %} </td> <td class="text-right"> {%= value["remaining_leaves"] %} </td> </tr> {% } %} </tbody> </table> {% } else { %} <p style="margin-top: 30px;"> No Leaves have been allocated. </p> {% } %}
----------------------------------- -- Area: Ordelles Caves -- NPC: Ruillont -- Involved in Mission: The Rescue Drill -- @pos -70 1 607 193 ----------------------------------- package.loaded["scripts/zones/Ordelles_Caves/TextIDs"] = nil; ----------------------------------- require("scripts/globals/missions"); require("scripts/zones/Ordelles_Caves/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (player:getCurrentMission(SANDORIA) == THE_RESCUE_DRILL and player:getVar("MissionStatus") == 9) then if (trade:hasItemQty(16535,1) and trade:getItemCount() == 1) then -- Trade Bronze Sword player:startEvent(0x0002); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (player:getCurrentMission(SANDORIA) == THE_RESCUE_DRILL) then local MissionStatus = player:getVar("MissionStatus"); if (MissionStatus == 7) then player:startEvent(0x0001); elseif (MissionStatus >= 10 or player:hasCompletedMission(SANDORIA,THE_RESCUE_DRILL)) then player:showText(npc, RUILLONT_INITIAL_DIALOG + 9); elseif (MissionStatus >= 8) then player:showText(npc, RUILLONT_INITIAL_DIALOG); elseif (player:getNation() == SANDORIA) then player:showText(npc, RUILLONT_INITIAL_DIALOG + 2); else player:showText(npc, RUILLONT_INITIAL_DIALOG + 1); end end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish Action ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x0001) then local rand = math.random(1,3); player:setVar("theRescueDrillRandomNPC",rand); player:setVar("MissionStatus",8); elseif (csid == 0x0002) then player:tradeComplete(); player:setVar("MissionStatus",10); end end;
<!doctype html> <meta charset=utf-8> <title>RTCDTMFSender.prototype.insertDTMF</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="RTCPeerConnection-helper.js"></script> <script src="RTCDTMFSender-helper.js"></script> <script> 'use strict'; // Test is based on the following editor draft: // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html // The following helper functions are called from RTCPeerConnection-helper.js // generateAnswer // The following helper functions are called from RTCDTMFSender-helper.js // createDtmfSender // test_tone_change_events // getTransceiver /* 7. Peer-to-peer DTMF partial interface RTCRtpSender { readonly attribute RTCDTMFSender? dtmf; }; interface RTCDTMFSender : EventTarget { void insertDTMF(DOMString tones, optional unsigned long duration = 100, optional unsigned long interToneGap = 70); attribute EventHandler ontonechange; readonly attribute DOMString toneBuffer; }; */ /* 7.2. insertDTMF The tones parameter is treated as a series of characters. The characters 0 through 9, A through D, #, and * generate the associated DTMF tones. The characters a to d MUST be normalized to uppercase on entry and are equivalent to A to D. As noted in [RTCWEB-AUDIO] Section 3, support for the characters 0 through 9, A through D, #, and * are required. The character ',' MUST be supported, and indicates a delay of 2 seconds before processing the next character in the tones parameter. All other characters (and only those other characters) MUST be considered unrecognized. */ promise_test(t => { return createDtmfSender() .then(dtmfSender => { dtmfSender.insertDTMF(''); dtmfSender.insertDTMF('012345689'); dtmfSender.insertDTMF('ABCD'); dtmfSender.insertDTMF('abcd'); dtmfSender.insertDTMF('#*'); dtmfSender.insertDTMF(','); dtmfSender.insertDTMF('0123456789ABCDabcd#*,'); }); }, 'insertDTMF() should succeed if tones contains valid DTMF characters'); /* 7.2. insertDTMF 6. If tones contains any unrecognized characters, throw an InvalidCharacterError. */ promise_test(t => { return createDtmfSender() .then(dtmfSender => { assert_throws('InvalidCharacterError', () => // 'F' is invalid dtmfSender.insertDTMF('123FFABC')); assert_throws('InvalidCharacterError', () => // 'E' is invalid dtmfSender.insertDTMF('E')); assert_throws('InvalidCharacterError', () => // ' ' is invalid dtmfSender.insertDTMF('# *')); }); }, 'insertDTMF() should throw InvalidCharacterError if tones contains invalid DTMF characters'); /* 7.2. insertDTMF 3. If transceiver.stopped is true, throw an InvalidStateError. */ test(t => { const pc = new RTCPeerConnection(); const transceiver = pc.addTransceiver('audio'); const dtmfSender = transceiver.sender.dtmf; transceiver.stop(); assert_throws('InvalidStateError', () => dtmfSender.insertDTMF('')); }, 'insertDTMF() should throw InvalidStateError if transceiver is stopped'); /* 7.2. insertDTMF 4. If transceiver.currentDirection is recvonly or inactive, throw an InvalidStateError. */ promise_test(async t => { const caller = new RTCPeerConnection(); t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); t.add_cleanup(() => callee.close()); const transceiver = caller.addTransceiver('audio', { direction: 'recvonly' }); const dtmfSender = transceiver.sender.dtmf; const offer = await caller.createOffer(); await caller.setLocalDescription(offer); await callee.setRemoteDescription(offer); const stream = await navigator.mediaDevices.getUserMedia({audio: true}); t.add_cleanup(() => stream.getTracks().forEach(track => track.stop())); const [track] = stream.getTracks(); callee.addTrack(track, stream); const answer = await callee.createAnswer(); await callee.setLocalDescription(answer); await caller.setRemoteDescription(answer); assert_equals(transceiver.currentDirection, 'recvonly'); assert_throws('InvalidStateError', () => dtmfSender.insertDTMF('')); }, 'insertDTMF() should throw InvalidStateError if transceiver.currentDirection is recvonly'); promise_test(async t => { const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio', { direction: 'inactive' }); const dtmfSender = transceiver.sender.dtmf; const offer = await pc.createOffer(); await pc.setLocalDescription(offer); const answer = await generateAnswer(offer); await pc.setRemoteDescription(answer); assert_equals(transceiver.currentDirection, 'inactive'); assert_throws('InvalidStateError', () => dtmfSender.insertDTMF('')); }, 'insertDTMF() should throw InvalidStateError if transceiver.currentDirection is inactive'); /* 7.2. insertDTMF The characters a to d MUST be normalized to uppercase on entry and are equivalent to A to D. 7. Set the object's toneBuffer attribute to tones. */ promise_test(t => { return createDtmfSender() .then(dtmfSender => { dtmfSender.insertDTMF('123'); assert_equals(dtmfSender.toneBuffer, '123'); dtmfSender.insertDTMF('ABC'); assert_equals(dtmfSender.toneBuffer, 'ABC'); dtmfSender.insertDTMF('bcd'); assert_equals(dtmfSender.toneBuffer, 'BCD'); }); }, 'insertDTMF() should set toneBuffer to provided tones normalized, with old tones overridden'); promise_test(t => { let dtmfSender; let sender; let pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { sender = pc.addTrack(track, mediaStream); return pc.createOffer(); }).then(offer => { pc.setLocalDescription(offer); dtmfSender = sender.dtmf; pc.removeTrack(sender); pc.close(); assert_throws('InvalidStateError', () => dtmfSender.insertDTMF('123')); }); }, 'insertDTMF() after remove and close should reject'); </script>
#!/usr/bin/env sh set -ex SCRIPT_DIR=$(dirname $(readlink -f "$0")) WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..) cd $WPT_ROOT main() { cd css if [ -z $VENV ]; then VENV=tools/_virtualenv fi # Create the virtualenv if [ ! -d $VENV ]; then if [ -z $PYTHON ]; then command -v python if [ $? -eq 0 ]; then if [ `python -c 'import sys; print(sys.version[0:3])'` == "2.7" ]; then PYTHON=python fi fi fi if [ -z $PYTHON ]; then command -v python2 if [ $? -eq 0 ]; then PYTHON=python2 fi fi if [ -z $PYTHON ]; then echo "Please ensure Python 2.7 is installed" exit 1 fi virtualenv -p $PYTHON $VENV || { echo "Please ensure virtualenv is installed"; exit 2; } fi # Install dependencies $VENV/bin/pip install -r requirements.txt # Fetch hg submodules if they're not there if [ ! -d tools/apiclient ]; then $VENV/bin/hg clone https://hg.csswg.org/dev/apiclient tools/apiclient fi if [ ! -d tools/w3ctestlib ]; then $VENV/bin/hg clone https://hg.csswg.org/dev/w3ctestlib tools/w3ctestlib fi # Run the build script $VENV/bin/python tools/build.py "$@" } main
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::ErrorEventBinding; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::{MutHeapJSVal, Root}; use dom::bindings::reflector::reflect_dom_object; use dom::bindings::trace::JSTraceable; use dom::event::{Event, EventBubbles, EventCancelable}; use js::jsapi::{RootedValue, HandleValue, JSContext}; use js::jsval::JSVal; use std::cell::Cell; use string_cache::Atom; use util::str::DOMString; #[dom_struct] pub struct ErrorEvent { event: Event, message: DOMRefCell<DOMString>, filename: DOMRefCell<DOMString>, lineno: Cell<u32>, colno: Cell<u32>, #[ignore_heap_size_of = "Defined in rust-mozjs"] error: MutHeapJSVal, } impl ErrorEvent { fn new_inherited() -> ErrorEvent { ErrorEvent { event: Event::new_inherited(), message: DOMRefCell::new(DOMString::new()), filename: DOMRefCell::new(DOMString::new()), lineno: Cell::new(0), colno: Cell::new(0), error: MutHeapJSVal::new() } } pub fn new_uninitialized(global: GlobalRef) -> Root<ErrorEvent> { reflect_dom_object(box ErrorEvent::new_inherited(), global, ErrorEventBinding::Wrap) } pub fn new(global: GlobalRef, type_: Atom, bubbles: EventBubbles, cancelable: EventCancelable, message: DOMString, filename: DOMString, lineno: u32, colno: u32, error: HandleValue) -> Root<ErrorEvent> { let ev = ErrorEvent::new_uninitialized(global); { let event = ev.upcast::<Event>(); event.init_event(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable); *ev.message.borrow_mut() = message; *ev.filename.borrow_mut() = filename; ev.lineno.set(lineno); ev.colno.set(colno); } ev.error.set(error.get()); ev } pub fn Constructor(global: GlobalRef, type_: DOMString, init: &ErrorEventBinding::ErrorEventInit) -> Fallible<Root<ErrorEvent>>{ let msg = match init.message.as_ref() { Some(message) => message.clone(), None => DOMString::new(), }; let file_name = match init.filename.as_ref() { Some(filename) => filename.clone(), None => DOMString::new(), }; let line_num = init.lineno.unwrap_or(0); let col_num = init.colno.unwrap_or(0); let bubbles = if init.parent.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble }; let cancelable = if init.parent.cancelable { EventCancelable::Cancelable } else { EventCancelable::NotCancelable }; // Dictionaries need to be rooted // https://github.com/servo/servo/issues/6381 let error = RootedValue::new(global.get_cx(), init.error); let event = ErrorEvent::new(global, Atom::from(&*type_), bubbles, cancelable, msg, file_name, line_num, col_num, error.handle()); Ok(event) } } impl ErrorEventMethods for ErrorEvent { // https://html.spec.whatwg.org/multipage/#dom-errorevent-lineno fn Lineno(&self) -> u32 { self.lineno.get() } // https://html.spec.whatwg.org/multipage/#dom-errorevent-colno fn Colno(&self) -> u32 { self.colno.get() } // https://html.spec.whatwg.org/multipage/#dom-errorevent-message fn Message(&self) -> DOMString { self.message.borrow().clone() } // https://html.spec.whatwg.org/multipage/#dom-errorevent-filename fn Filename(&self) -> DOMString { self.filename.borrow().clone() } // https://html.spec.whatwg.org/multipage/#dom-errorevent-error fn Error(&self, _cx: *mut JSContext) -> JSVal { self.error.get() } // https://dom.spec.whatwg.org/#dom-event-istrusted fn IsTrusted(&self) -> bool { self.event.IsTrusted() } }
# Bundler and rubygems maintain a set of directories from which to # load gems. If Bundler is loaded, let it determine what can be # loaded. If it's not loaded, then use rubygems. But do this before # loading any puppet code, so that our gem loading system is sane. if not defined? ::Bundler begin require 'rubygems' rescue LoadError end end require 'puppet' require 'puppet/util' require "puppet/util/plugins" require "puppet/util/rubygems" require "puppet/util/limits" require 'puppet/util/colors' module Puppet module Util # This is the main entry point for all puppet applications / faces; it # is basically where the bootstrapping process / lifecycle of an app # begins. class CommandLine include Puppet::Util::Limits OPTION_OR_MANIFEST_FILE = /^-|\.pp$|\.rb$/ # @param zero [String] the name of the executable # @param argv [Array<String>] the arguments passed on the command line # @param stdin [IO] (unused) def initialize(zero = $0, argv = ARGV, stdin = STDIN) @command = File.basename(zero, '.rb') @argv = argv Puppet::Plugins.on_commandline_initialization(:command_line_object => self) end # @return [String] name of the subcommand is being executed # @api public def subcommand_name return @command if @command != 'puppet' if @argv.first =~ OPTION_OR_MANIFEST_FILE nil else @argv.first end end # @return [Array<String>] the command line arguments being passed to the subcommand # @api public def args return @argv if @command != 'puppet' if subcommand_name.nil? @argv else @argv[1..-1] end end # @api private # @deprecated def self.available_subcommands Puppet.deprecation_warning('Puppet::Util::CommandLine.available_subcommands is deprecated; please use Puppet::Application.available_application_names instead.') Puppet::Application.available_application_names end # available_subcommands was previously an instance method, not a class # method, and we have an unknown number of user-implemented applications # that depend on that behaviour. Forwarding allows us to preserve a # backward compatible API. --daniel 2011-04-11 # @api private # @deprecated def available_subcommands Puppet.deprecation_warning('Puppet::Util::CommandLine#available_subcommands is deprecated; please use Puppet::Application.available_application_names instead.') Puppet::Application.available_application_names end # Run the puppet subcommand. If the subcommand is determined to be an # external executable, this method will never return and the current # process will be replaced via {Kernel#exec}. # # @return [void] def execute Puppet::Util.exit_on_fail("initialize global default settings") do Puppet.initialize_settings(args) end setpriority(Puppet[:priority]) find_subcommand.run end # @api private def external_subcommand Puppet::Util.which("puppet-#{subcommand_name}") end private def find_subcommand if subcommand_name.nil? NilSubcommand.new(self) elsif Puppet::Application.available_application_names.include?(subcommand_name) ApplicationSubcommand.new(subcommand_name, self) elsif path_to_subcommand = external_subcommand ExternalSubcommand.new(path_to_subcommand, self) else UnknownSubcommand.new(subcommand_name, self) end end # @api private class ApplicationSubcommand def initialize(subcommand_name, command_line) @subcommand_name = subcommand_name @command_line = command_line end def run # For most applications, we want to be able to load code from the modulepath, # such as apply, describe, resource, and faces. # For agent, we only want to load pluginsync'ed code from libdir. # For master, we shouldn't ever be loading per-enviroment code into the master's # ruby process, but that requires fixing (#17210, #12173, #8750). So for now # we try to restrict to only code that can be autoloaded from the node's # environment. # PUP-2114 - at this point in the bootstrapping process we do not # have an appropriate application-wide current_environment set. # If we cannot find the configured environment, which may not exist, # we do not attempt to add plugin directories to the load path. # if @subcommand_name != 'master' and @subcommand_name != 'agent' if configured_environment = Puppet.lookup(:environments).get(Puppet[:environment]) configured_environment.each_plugin_directory do |dir| $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) end end end app = Puppet::Application.find(@subcommand_name).new(@command_line) Puppet::Plugins.on_application_initialization(:application_object => @command_line) app.run end end # @api private class ExternalSubcommand def initialize(path_to_subcommand, command_line) @path_to_subcommand = path_to_subcommand @command_line = command_line end def run Kernel.exec(@path_to_subcommand, *@command_line.args) end end # @api private class NilSubcommand include Puppet::Util::Colors def initialize(command_line) @command_line = command_line end def run args = @command_line.args if args.include? "--version" or args.include? "-V" puts Puppet.version elsif @command_line.subcommand_name.nil? && args.count > 0 # If the subcommand is truly nil and there is an arg, it's an option; print out the invalid option message puts colorize(:hred, "Error: Could not parse application options: invalid option: #{args[0]}") exit 1 else puts "See 'puppet help' for help on available puppet subcommands" end end end # @api private class UnknownSubcommand < NilSubcommand def initialize(subcommand_name, command_line) @subcommand_name = subcommand_name super(command_line) end def run puts colorize(:hred, "Error: Unknown Puppet subcommand '#{@subcommand_name}'") super exit 1 end end end end end
/* * ProActive Parallel Suite(TM): * The Open Source library for parallel and distributed * Workflows & Scheduling, Orchestration, Cloud Automation * and Big Data Analysis on Enterprise Grids & Clouds. * * Copyright (c) 2007 - 2017 ActiveEon * Contact: contact@activeeon.com * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation: version 3 of * the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * If needed, contact us to obtain a release under GPL Version 2 or 3 * or a different license than the AGPL. */ package org.ow2.proactive.scheduler.rest.ds; import static com.google.common.base.Preconditions.checkNotNull; import java.util.List; import org.ow2.proactive.scheduler.rest.ds.IDataSpaceClient.Dataspace; import org.ow2.proactive.scheduler.rest.ds.IDataSpaceClient.IRemoteSource; import org.ow2.proactive_grid_cloud_portal.common.FileType; import com.google.common.collect.Lists; public class RemoteSource implements IRemoteSource { private Dataspace dataspace; private String path; private List<String> includes; private List<String> excludes; private FileType pathType = FileType.UNKNOWN; public RemoteSource() { } public RemoteSource(Dataspace dataspace) { this.dataspace = dataspace; } public RemoteSource(Dataspace dataspace, String pathname) { this.dataspace = dataspace; this.path = pathname; } @Override public Dataspace getDataspace() { return dataspace; } public void setPath(String path) { this.path = path; } @Override public String getPath() { return path; } public void setIncludes(List<String> includes) { checkNotNull(includes); this.includes = Lists.newArrayList(includes); } public void setIncludes(String... includes) { checkNotNull(includes); this.includes = Lists.newArrayList(includes); } @Override public List<String> getIncludes() { return includes; } public void setExcludes(List<String> excludes) { checkNotNull(excludes); this.excludes = Lists.newArrayList(excludes); } public void setExcludes(String... excludes) { checkNotNull(excludes); this.excludes = Lists.newArrayList(excludes); } @Override public List<String> getExcludes() { return excludes; } public FileType getType() { return pathType; } public void setType(FileType pathType) { this.pathType = pathType; } @Override public String toString() { return "RemoteSource{" + "dataspace=" + dataspace + ", path='" + path + '\'' + ", includes=" + includes + ", excludes=" + excludes + ", pathType=" + pathType + '}'; } }
class Timezones < ActiveRecord::Migration def self.up add_column :users, :timezone, :string, :default => 'UTC' end def self.down remove_column :users, :timezone end end
/** src/utils.c Set of utility functions for debugging purposes Copyright (C) 2007-2009 STMicroelectronics Copyright (C) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "utils.h" char *stateName(OMX_STATETYPE state) { char *nameString; switch(state) { case 0: nameString = "OMX_StateInvalid"; break; case 1: nameString = "OMX_StateLoaded"; break; case 2: nameString = "OMX_StateIdle"; break; case 3: nameString = "OMX_StateExecuting"; break; case 4: nameString = "OMX_StatePause"; break; case 5: nameString = "OMX_StateWaitForResources"; break; default: nameString = '\0'; } return nameString; } char *transientStateName(int state) { char *nameString; switch(state) { case 0: nameString = "OMX_StateInvalid"; break; case 1: nameString = "OMX_TransStateLoadedToIdle"; break; case 2: nameString = "OMX_TransStateIdleToPause"; break; case 3: nameString = "OMX_TransStatePauseToExecuting"; break; case 4: nameString = "OMX_TransStateIdleToExecuting"; break; case 5: nameString = "OMX_TransStateExecutingToIdle"; break; case 6: nameString = "OMX_TransStateExecutingToPause"; break; case 7: nameString = "OMX_TransStatePauseToIdle"; break; case 8: nameString = "OMX_TransStateIdleToLoaded"; break; default: nameString = '\0'; } return nameString; } char *errorName(OMX_ERRORTYPE error) { char *nameString; switch(error) { case 0: nameString = "OMX_ErrorNone"; break; case 0x80001000: nameString = "OMX_ErrorInsufficientResources"; break; case 0x80001001: nameString = "OMX_ErrorUndefined"; break; case 0x80001002: nameString = "OMX_ErrorInvalidComponentName"; break; case 0x80001003: nameString = "OMX_ErrorComponentNotFound"; break; case 0x80001004: nameString = "OMX_ErrorInvalidComponent"; break; case 0x80001005: nameString = "OMX_ErrorBadParameter"; break; case 0x80001006: nameString = "OMX_ErrorNotImplemented"; break; case 0x80001007: nameString = "OMX_ErrorUnderflow"; break; case 0x80001008: nameString = "OMX_ErrorOverflow"; break; case 0x80001009: nameString = "OMX_ErrorHardware"; break; case 0x8000100A: nameString = "OMX_ErrorInvalidState"; break; case 0x8000100B: nameString = "OMX_ErrorStreamCorrupt"; break; case 0x8000100C: nameString = "OMX_ErrorPortsNotCompatible"; break; case 0x8000100D: nameString = "OMX_ErrorResourcesLost"; break; case 0x8000100E: nameString = "OMX_ErrorNoMore"; break; case 0x8000100F: nameString = "OMX_ErrorVersionMismatch"; break; case 0x80001010: nameString = "OMX_ErrorNotReady"; break; case 0x80001011: nameString = "OMX_ErrorTimeout"; break; case 0x80001012: nameString = "OMX_ErrorSameState"; break; case 0x80001013: nameString = "OMX_ErrorResourcesPreempted"; break; case 0x80001014: nameString = "OMX_ErrorPortUnresponsiveDuringAllocation"; break; case 0x80001015: nameString = "OMX_ErrorPortUnresponsiveDuringDeallocation"; break; case 0x80001016: nameString = "OMX_ErrorPortUnresponsiveDuringStop"; break; case 0x80001017: nameString = "OMX_ErrorIncorrectStateTransition"; break; case 0x80001018: nameString = "OMX_ErrorIncorrectStateOperation"; break; case 0x80001019: nameString = "OMX_ErrorUnsupportedSetting"; break; case 0x8000101A: nameString = "OMX_ErrorUnsupportedIndex"; break; case 0x8000101B: nameString = "OMX_ErrorBadPortIndex"; break; case 0x8000101C: nameString = "OMX_ErrorPortUnpopulated"; break; case 0x8000101D: nameString = "OMX_ErrorComponentSuspended"; break; case 0x8000101E: nameString = "OMX_ErrorDynamicResourcesUnavailable"; break; case 0x8000101F: nameString = "OMX_ErrorMbErrorsInFrame"; break; case 0x80001020: nameString = "OMX_ErrorFormatNotDetected"; break; case 0x80001021: nameString = "OMX_ErrorContentPipeOpenFailed"; break; case 0x80001022: nameString = "OMX_ErrorContentPipeCreationFailed"; break; case 0x80001023: nameString = "OMX_ErrorSeperateTablesUsed"; break; case 0x80001024: nameString = "OMX_ErrorTunnelingUnsupported"; break; default: nameString = '\0'; } return nameString; }
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. 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 <pthread.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/mman.h> #include <sys/wait.h> static int do_test (void) { size_t ps = sysconf (_SC_PAGESIZE); char tmpfname[] = "/tmp/tst-mutex4.XXXXXX"; char data[ps]; void *mem; int fd; pthread_mutex_t *m; pthread_mutexattr_t a; pid_t pid; char *p; int err; int s; fd = mkstemp (tmpfname); if (fd == -1) { printf ("cannot open temporary file: %m\n"); return 1; } /* Make sure it is always removed. */ unlink (tmpfname); /* Create one page of data. */ memset (data, '\0', ps); /* Write the data to the file. */ if (write (fd, data, ps) != (ssize_t) ps) { puts ("short write"); return 1; } mem = mmap (NULL, ps, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (mem == MAP_FAILED) { printf ("mmap failed: %m\n"); return 1; } m = (pthread_mutex_t *) (((uintptr_t) mem + __alignof (pthread_mutex_t)) & ~(__alignof (pthread_mutex_t) - 1)); p = (char *) (m + 1); if (pthread_mutexattr_init (&a) != 0) { puts ("mutexattr_init failed"); return 1; } if (pthread_mutexattr_getpshared (&a, &s) != 0) { puts ("1st mutexattr_getpshared failed"); return 1; } if (s != PTHREAD_PROCESS_PRIVATE) { puts ("default pshared value wrong"); return 1; } if (pthread_mutexattr_setpshared (&a, PTHREAD_PROCESS_SHARED) != 0) { puts ("mutexattr_setpshared failed"); return 1; } if (pthread_mutexattr_getpshared (&a, &s) != 0) { puts ("2nd mutexattr_getpshared failed"); return 1; } if (s != PTHREAD_PROCESS_SHARED) { puts ("pshared value after setpshared call wrong"); return 1; } if (pthread_mutex_init (m, &a) != 0) { puts ("mutex_init failed"); return 1; } if (pthread_mutex_lock (m) != 0) { puts ("mutex_lock failed"); return 1; } if (pthread_mutexattr_destroy (&a) != 0) { puts ("mutexattr_destroy failed"); return 1; } err = pthread_mutex_trylock (m); if (err == 0) { puts ("mutex_trylock succeeded"); return 1; } else if (err != EBUSY) { puts ("mutex_trylock didn't return EBUSY"); return 1; } *p = 0; puts ("going to fork now"); pid = fork (); if (pid == -1) { puts ("fork failed"); return 1; } else if (pid == 0) { /* Play some lock ping-pong. It's our turn to unlock first. */ if ((*p)++ != 0) { puts ("child: *p != 0"); return 1; } if (pthread_mutex_unlock (m) != 0) { puts ("child: 1st mutex_unlock failed"); return 1; } puts ("child done"); } else { if (pthread_mutex_lock (m) != 0) { puts ("parent: 2nd mutex_lock failed"); return 1; } if (*p != 1) { puts ("*p != 1"); return 1; } puts ("parent done"); } return 0; } #define TIMEOUT 4 #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * @category Phoenix * @package Phoenix_Moneybookers * @copyright Copyright (c) 2013 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /* @var $installer Mage_Core_Model_Resource_Setup */ $installer = $this; $installer->startSetup(); $conn = $installer->getConnection(); $select = $conn ->select() ->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value')) ->where(new Zend_Db_Expr("path LIKE 'moneybookers/moneybookers%'")); $data = $conn->fetchAll($select); if (!empty($data)) { foreach ($data as $key => $value) { $data[$key]['path'] = preg_replace('/^moneybookers\/moneybookers/', 'payment/moneybookers', $value['path']); } $conn->insertOnDuplicate($this->getTable('core/config_data'), $data, array('path')); $conn->delete($this->getTable('core/config_data'), new Zend_Db_Expr("path LIKE 'moneybookers/moneybookers%'")); } $installer->endSetup();
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.wordpress.api.service; import org.apache.camel.component.wordpress.api.model.Tag; import org.apache.camel.component.wordpress.api.model.TagSearchCriteria; public interface WordpressServiceTags extends WordpressCrudService<Tag, TagSearchCriteria> { }
namespace Messages { public enum ErrorCodes { None, Fail } }
// @declaration: true // @module: amd // @out: dist.js // @filename: Class.ts import { Configurable } from "./Configurable" export class HiddenClass {} export class ActualClass extends Configurable(HiddenClass) {} // @filename: Configurable.ts export type Constructor<T> = { new(...args: any[]): T; } export function Configurable<T extends Constructor<{}>>(base: T): T { return class extends base { constructor(...args: any[]) { super(...args); } }; }
// @allowJs: true // @noEmit: true // @checkJs: true // @Filename: bug27341.js if (false) { /** * @param {string} s */ const x = function (s) { }; }
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. enum t1 { a(int), b(uint), } struct T2 {x: t1, y: int} enum t3 { c(T2, uint), } fn m(input: t3) -> int { match input { t3::c(T2 {x: t1::a(m), ..}, _) => { return m; } t3::c(T2 {x: t1::b(m), y: y}, z) => { return ((m + z) as int) + y; } } } pub fn main() { assert_eq!(m(t3::c(T2 {x: t1::a(10), y: 5}, 4u)), 10); assert_eq!(m(t3::c(T2 {x: t1::b(10u), y: 5}, 4u)), 19); }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.aws2.athena; import org.apache.camel.test.junit5.CamelTestSupport; import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.Protocol; import software.amazon.awssdk.regions.Region; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; public class AthenaComponentConfigurationTest extends CamelTestSupport { @Test public void createEndpointWithAccessAndSecretKey() throws Exception { Athena2Component component = context.getComponent("aws2-athena", Athena2Component.class); Athena2Endpoint endpoint = (Athena2Endpoint) component.createEndpoint("aws2-athena://label?accessKey=xxxxx&secretKey=yyyyy"); assertEquals("xxxxx", endpoint.getConfiguration().getAccessKey()); assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey()); assertNull(endpoint.getConfiguration().getAmazonAthenaClient()); } @Test public void createEndpointWithComponentElements() throws Exception { Athena2Component component = context.getComponent("aws2-athena", Athena2Component.class); component.getConfiguration().setAccessKey("XXX"); component.getConfiguration().setSecretKey("YYY"); Athena2Endpoint endpoint = (Athena2Endpoint) component.createEndpoint("aws2-athena://label"); assertEquals("XXX", endpoint.getConfiguration().getAccessKey()); assertEquals("YYY", endpoint.getConfiguration().getSecretKey()); } @Test public void createEndpointWithComponentAndEndpointElements() throws Exception { Athena2Component component = context.getComponent("aws2-athena", Athena2Component.class); component.getConfiguration().setAccessKey("XXX"); component.getConfiguration().setSecretKey("YYY"); component.getConfiguration().setRegion(Region.US_WEST_1.toString()); Athena2Endpoint endpoint = (Athena2Endpoint) component .createEndpoint("aws2-athena://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1"); assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey()); assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey()); assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion()); } @Test public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception { Athena2Component component = context.getComponent("aws2-athena", Athena2Component.class); component.getConfiguration().setAccessKey("XXX"); component.getConfiguration().setSecretKey("YYY"); component.getConfiguration().setRegion(Region.US_WEST_1.toString()); Athena2Endpoint endpoint = (Athena2Endpoint) component.createEndpoint( "aws2-athena://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP"); assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey()); assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey()); assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion()); assertEquals(Protocol.HTTP, endpoint.getConfiguration().getProxyProtocol()); assertEquals("localhost", endpoint.getConfiguration().getProxyHost()); assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort()); } }
package org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.provider; import org.eclipse.emf.common.ui.celleditor.ExtendedDialogCellEditor; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.ui.provider.PropertyDescriptor; import org.eclipse.jface.viewers.CellEditor; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.wso2.developerstudio.eclipse.gmf.esb.FilterMediator; import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.configure.ui.NamespacedPropertyEditorDialog; public class FilterSourcePropertyDescriptor extends PropertyDescriptor { public FilterSourcePropertyDescriptor(Object object, IItemPropertyDescriptor itemPropertyDescriptor) { super(object, itemPropertyDescriptor); } public CellEditor createPropertyEditor(Composite parent) { return new ExtendedDialogCellEditor(parent, getLabelProvider()) { protected Object openDialogBox(Control cellEditorWindow) { Display display = Display.getDefault(); Shell shell = new Shell(display); FilterMediator filterMediator = (FilterMediator) object; NamespacedPropertyEditorDialog filterMediatorConfigurationDialog = new NamespacedPropertyEditorDialog(shell, filterMediator.getSource()); filterMediatorConfigurationDialog.open(); return null; } }; } }
package org.bouncycastle.crypto.tls; /** * RFC 4492 5.1.1 * <p> * The named curves defined here are those specified in SEC 2 [13]. Note that many of these curves * are also recommended in ANSI X9.62 [7] and FIPS 186-2 [11]. Values 0xFE00 through 0xFEFF are * reserved for private use. Values 0xFF01 and 0xFF02 indicate that the client supports arbitrary * prime and characteristic-2 curves, respectively (the curve parameters must be encoded explicitly * in ECParameters). */ public class NamedCurve { public static final int sect163k1 = 1; public static final int sect163r1 = 2; public static final int sect163r2 = 3; public static final int sect193r1 = 4; public static final int sect193r2 = 5; public static final int sect233k1 = 6; public static final int sect233r1 = 7; public static final int sect239k1 = 8; public static final int sect283k1 = 9; public static final int sect283r1 = 10; public static final int sect409k1 = 11; public static final int sect409r1 = 12; public static final int sect571k1 = 13; public static final int sect571r1 = 14; public static final int secp160k1 = 15; public static final int secp160r1 = 16; public static final int secp160r2 = 17; public static final int secp192k1 = 18; public static final int secp192r1 = 19; public static final int secp224k1 = 20; public static final int secp224r1 = 21; public static final int secp256k1 = 22; public static final int secp256r1 = 23; public static final int secp384r1 = 24; public static final int secp521r1 = 25; /* * RFC 7027 */ public static final int brainpoolP256r1 = 26; public static final int brainpoolP384r1 = 27; public static final int brainpoolP512r1 = 28; /* * reserved (0xFE00..0xFEFF) */ public static final int arbitrary_explicit_prime_curves = 0xFF01; public static final int arbitrary_explicit_char2_curves = 0xFF02; public static boolean isValid(int namedCurve) { return (namedCurve >= sect163k1 && namedCurve <= brainpoolP512r1) || (namedCurve >= arbitrary_explicit_prime_curves && namedCurve <= arbitrary_explicit_char2_curves); } public static boolean refersToASpecificNamedCurve(int namedCurve) { switch (namedCurve) { case arbitrary_explicit_prime_curves: case arbitrary_explicit_char2_curves: return false; default: return true; } } }
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <title>Mobilebone.js API文档-data-reload</title> <link rel="stylesheet" href="../src/mobilebone.css"> <link rel="stylesheet" href="docs.css"> </head> <body> <aside></aside> <div class="page out"> <div class="content"> <h2>data-reload</h2> <p><strong>(v2.4.4+)</strong>主要针对Ajax请求。默认情况下,Mobilebone会缓存所有的Ajax请求(内存中),也就是第二次点击同样地址的时候,不是去重新拉数据,而是直接显示之前已经加载的页面。但是,如果你希望请求的页面不被缓存(每次都重新加载页面),则就需要使用这里的<code>data-reload</code>参数。</p> <p>你可以当作布尔属性使用,例如:<code>data-reload</code>或者跟随不为<code>"false"</code>的属性值,例如:<code>data-reload="true"</code>.</p> <p>Mobilebone会对Ajax请求的url地址做智能判断,页面上,永远只会有一个同根页面。例如,页面上有两个请求:</p> <pre>&lt;a href="detail.php?id=1">请求详情页1&lt;/a></pre> <pre>&lt;a href="detail.php?id=2">请求详情页2&lt;/a></pre> <p>当点击“请求详情页1”的时候,Mobilebone会Ajax请求该页面内容,并载入;此时我们返回,再次点击该页面,则不会有请求,页面直接载入(因为没有没有设置<code>data-reload</code>);此时,或者之前,我们我们返回,点击“请求详情页2”,由于这两个页面的查询字符串之前的根地址是一样的,都是<code>detail.php</code>,因此,Mobilebone会删除第一个页面,Ajax请求第2个页面;此时,再点击第1个页面,注意,Mobilebone会从内存中载入第1个页面,不会有额外的请求。</p> <p>有多位同行提出关于内存的问题。如果是一般的偏展示的页面,所占用内存非常有限,因此,可以尽量不使用<code>data-reload</code>, 以获得更流畅的体验。但是,如果是功能性比较强的页面,比方说商品列表,50条,每条都指向一个动态页面,则由于Mobilebone默认会把页面HTML存在内存中,虽然每个页面占用内存很小(纯字符串),但如果也页面很多,一定的累积还是会有影响的,此时,可以添加<code>data-reload</code>,每次都动态载入,Mobilebone会及时清理上一个页面在内存中的存储,有效降低资源占用。总而言之,言而总之,还是要根据实际项目和个人喜好做判断,实际上,一般内存占用的瓶颈肯定不是字符串占用,更多的是糟糕脚本带来的巨大开销。</p> <p>另外,所有的form表单提交都不会缓存页面内容,天生外挂<code>data-reload</code>。</p> <p>最后,v2.3.2新增的<code>data-reload="root"</code>已经没有存在价值,是个有些多余的设计,之前有这么使用的朋友不要担心,不会有影响,无需改动。</p> <p>&nbsp;</p> <div><strong>(以下v2.4.4移除,向前兼容)</strong></div> <del datetime="2015-04-09 23:37"> <p>主要针对Ajax请求。默认情况下,Mobilebone会缓存所有的Ajax请求,也就是第二次点击同样地址的时候,不是去重新拉数据,而是直接显示之前已经加载的页面。但是,如果你希望请求的页面不被缓存(每次都重新加载页面),则就需要使用这里的<code>data-reload</code>参数。</p> <p>目前有两种使用场景:</p> <ol> <li><strong>url完整地址重加载</strong>:<code>data-reload</code>/<code>data-reload="true"</code>.</li> <li><strong>url根地址重新加载</strong>:<code>data-reload="root"</code> (v2.3.2+)</li> </ol> <p>分别表示什么意思呢?</p> <h4>url完整地址重加载</h4> <p>如下两个请求:</p> <pre>&lt;a href="detail.php?id=112" data-reload="true">请求详情页&lt;/a></pre> <pre>&lt;a href="detail.php?id=113" data-reload="true">请求详情页&lt;/a></pre> <p>可以看到查询<code>id</code>是不一样的。所谓“完整地址重加载”是指,只有在第二次请求的页面<code>url</code>(包括查询字符串)完全匹配的时候,才移除缓存,重新加载!</p> <p>比方说上面的两个请求,最后页面HTML会有两个独立的页面。</p> <h4>url根地址重加载</h4> <p>请求地址还是一样,但<code>data-reload</code>值为<code>root</code>:</p> <pre>&lt;a href="detail.php?id=112" data-reload="root">请求详情页&lt;/a></pre> <pre>&lt;a href="detail.php?id=113" data-reload="root">请求详情页&lt;/a></pre> <p>这里的就是“根地址重加载”,指只要Ajax请求的url的根地址是一样的,就不会缓存,直接清除之前同源页面。</p> <p>所以,这里,页面上永远最多就一个详情页对应HTML. 很多小伙伴喜欢使用全局<code>id</code>绑定事件,此时,就务必需要设置<code>data-reload="root"</code>, 以免<code>id</code>冲突,事件重复绑定等问题。</p> </del> </div> </div> <script src="../src/mobilebone.js"></script> <script> Mobilebone.captureLink = false; window.navKey = "data-reload"; </script> <script src="nav.js"></script> <script src="docs.js"></script> </body> </html>
/* * #%L * ACS AEM Commons Twitter Support Bundle * %% * Copyright (C) 2013 - 2014 Adobe * %% * 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. * #L% */ package com.adobe.acs.commons.twitter.impl; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.ConfigurationPolicy; import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.Service; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ResourceResolverFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.adobe.acs.commons.util.RunnableOnMaster; @Component(immediate = true, metatype = true, label = "ACS AEM Commons - Twitter Feed Refresh Scheduler", description = "Schedule job which refreshes Twitter Feed components on a recurring basis", policy = ConfigurationPolicy.REQUIRE) @Service @Properties(value = { @Property(name = "scheduler.expression", value = "0 0/15 * * * ?", label = "Refresh Interval", description = "Twitter Feed Refresh interval (Quartz Cron Expression)"), @Property(name = "scheduler.concurrent", boolValue = false, propertyPrivate = true) }) public final class TwitterFeedScheduler extends RunnableOnMaster { private static final Logger log = LoggerFactory.getLogger(TwitterFeedScheduler.class); @Reference private ResourceResolverFactory resourceResolverFactory; @Reference private TwitterFeedUpdater twitterFeedService; @Override public void runOnMaster() { ResourceResolver resourceResolver = null; try { log.debug("Master Instance, Running ACS AEM Commons Twitter Feed Scheduler"); resourceResolver = resourceResolverFactory .getAdministrativeResourceResolver(null); twitterFeedService.updateTwitterFeedComponents(resourceResolver); } catch (Exception e) { log.error( "Exception while running TwitterFeedScheduler.", e); } finally { if (resourceResolver != null) { resourceResolver.close(); resourceResolver = null; } } } }
/* * Copyright (c) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package com.google.api.client.util; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Use this annotation to specify that an enum constant is the "null" data value to use for * {@link Data#nullOf(Class)}. * <p> * See {@link Value} for an example. * </p> * * @since 1.4 * @author Yaniv Inbar */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface NullValue { }
import { InputNode } from '../core/InputNode'; export class PropertyNode extends InputNode { constructor( object: object, property: string, type: string ); object: object; property: string; nodeType: string; value: any; }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.eagle.storage.operation; import org.apache.eagle.log.entity.meta.EntityDefinition; import org.apache.eagle.log.entity.meta.EntityDefinitionManager; import org.apache.eagle.log.entity.test.TestTimeSeriesAPIEntity; import org.apache.eagle.storage.DataStorage; import org.junit.Test; import java.util.ArrayList; import java.util.List; import static org.mockito.Mockito.*; /** * @Since 11/7/16. */ public class TestRowkeyQueryStatement { private DataStorage mockDataStorage = mock(DataStorage.class); @Test public void testRowkeyExecute() throws Exception { String rowkey = "rowkey"; List<String> rowkeys = new ArrayList<>(); rowkeys.add(rowkey); EntityDefinition entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(TestTimeSeriesAPIEntity.class); RowkeyQueryStatement rowkeyQueryStatement1 = new RowkeyQueryStatement(rowkey, entityDefinition); RowkeyQueryStatement rowkeyQueryStatement2 = new RowkeyQueryStatement(rowkey, TestTimeSeriesAPIEntity.class.getSimpleName()); RowkeyQueryStatement rowkeyQueryStatement3 = new RowkeyQueryStatement(rowkeys, entityDefinition); RowkeyQueryStatement rowkeyQueryStatement4 = new RowkeyQueryStatement(rowkeys, TestTimeSeriesAPIEntity.class.getSimpleName()); rowkeyQueryStatement1.execute(mockDataStorage); rowkeyQueryStatement2.execute(mockDataStorage); rowkeyQueryStatement3.execute(mockDataStorage); rowkeyQueryStatement4.execute(mockDataStorage); verify(mockDataStorage, times(4)).queryById(any(), any()); } }
/* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ var CryptoJS=CryptoJS||function(s,l){var e={},n=e.lib={},p=function(){},b=n.Base={extend:function(c){p.prototype=this;var a=new p;c&&a.mixIn(c);a.hasOwnProperty("init")||(a.init=function(){a.$super.init.apply(this,arguments)});a.init.prototype=a;a.$super=this;return a},create:function(){var c=this.extend();c.init.apply(c,arguments);return c},init:function(){},mixIn:function(c){for(var a in c)c.hasOwnProperty(a)&&(this[a]=c[a]);c.hasOwnProperty("toString")&&(this.toString=c.toString)},clone:function(){return this.init.prototype.extend(this)}}, d=n.WordArray=b.extend({init:function(c,a){c=this.words=c||[];this.sigBytes=a!=l?a:4*c.length},toString:function(c){return(c||q).stringify(this)},concat:function(c){var a=this.words,m=c.words,f=this.sigBytes;c=c.sigBytes;this.clamp();if(f%4)for(var r=0;r<c;r++)a[f+r>>>2]|=(m[r>>>2]>>>24-8*(r%4)&255)<<24-8*((f+r)%4);else if(65535<m.length)for(r=0;r<c;r+=4)a[f+r>>>2]=m[r>>>2];else a.push.apply(a,m);this.sigBytes+=c;return this},clamp:function(){var c=this.words,a=this.sigBytes;c[a>>>2]&=4294967295<< 32-8*(a%4);c.length=s.ceil(a/4)},clone:function(){var c=b.clone.call(this);c.words=this.words.slice(0);return c},random:function(c){for(var a=[],m=0;m<c;m+=4)a.push(4294967296*s.random()|0);return new d.init(a,c)}}),t=e.enc={},q=t.Hex={stringify:function(c){var a=c.words;c=c.sigBytes;for(var m=[],f=0;f<c;f++){var r=a[f>>>2]>>>24-8*(f%4)&255;m.push((r>>>4).toString(16));m.push((r&15).toString(16))}return m.join("")},parse:function(c){for(var a=c.length,m=[],f=0;f<a;f+=2)m[f>>>3]|=parseInt(c.substr(f, 2),16)<<24-4*(f%8);return new d.init(m,a/2)}},a=t.Latin1={stringify:function(c){var a=c.words;c=c.sigBytes;for(var m=[],f=0;f<c;f++)m.push(String.fromCharCode(a[f>>>2]>>>24-8*(f%4)&255));return m.join("")},parse:function(c){for(var a=c.length,m=[],f=0;f<a;f++)m[f>>>2]|=(c.charCodeAt(f)&255)<<24-8*(f%4);return new d.init(m,a)}},v=t.Utf8={stringify:function(c){try{return decodeURIComponent(escape(a.stringify(c)))}catch(u){throw Error("Malformed UTF-8 data");}},parse:function(c){return a.parse(unescape(encodeURIComponent(c)))}}, u=n.BufferedBlockAlgorithm=b.extend({reset:function(){this._data=new d.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=v.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var u=this._data,m=u.words,f=u.sigBytes,r=this.blockSize,e=f/(4*r),e=a?s.ceil(e):s.max((e|0)-this._minBufferSize,0);a=e*r;f=s.min(4*a,f);if(a){for(var b=0;b<a;b+=r)this._doProcessBlock(m,b);b=m.splice(0,a);u.sigBytes-=f}return new d.init(b,f)},clone:function(){var a=b.clone.call(this); a._data=this._data.clone();return a},_minBufferSize:0});n.Hasher=u.extend({cfg:b.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){u.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(u,m){return(new a.init(m)).finalize(u)}},_createHmacHelper:function(a){return function(u,m){return(new w.HMAC.init(a, m)).finalize(u)}}});var w=e.algo={};return e}(Math); (function(){var s=CryptoJS,l=s.lib.WordArray;s.enc.Base64={stringify:function(e){var n=e.words,l=e.sigBytes,b=this._map;e.clamp();e=[];for(var d=0;d<l;d+=3)for(var t=(n[d>>>2]>>>24-8*(d%4)&255)<<16|(n[d+1>>>2]>>>24-8*((d+1)%4)&255)<<8|n[d+2>>>2]>>>24-8*((d+2)%4)&255,q=0;4>q&&d+0.75*q<l;q++)e.push(b.charAt(t>>>6*(3-q)&63));if(n=b.charAt(64))for(;e.length%4;)e.push(n);return e.join("")},parse:function(e){var n=e.length,p=this._map,b=p.charAt(64);b&&(b=e.indexOf(b),-1!=b&&(n=b));for(var b=[],d=0,t=0;t< n;t++)if(t%4){var q=p.indexOf(e.charAt(t-1))<<2*(t%4),a=p.indexOf(e.charAt(t))>>>6-2*(t%4);b[d>>>2]|=(q|a)<<24-8*(d%4);d++}return l.create(b,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); (function(s){function l(a,b,c,e,m,f,r){a=a+(b&c|~b&e)+m+r;return(a<<f|a>>>32-f)+b}function e(a,b,c,e,m,f,r){a=a+(b&e|c&~e)+m+r;return(a<<f|a>>>32-f)+b}function n(a,b,c,e,m,f,r){a=a+(b^c^e)+m+r;return(a<<f|a>>>32-f)+b}function p(a,b,c,e,m,f,r){a=a+(c^(b|~e))+m+r;return(a<<f|a>>>32-f)+b}for(var b=CryptoJS,d=b.lib,t=d.WordArray,q=d.Hasher,d=b.algo,a=[],v=0;64>v;v++)a[v]=4294967296*s.abs(s.sin(v+1))|0;d=d.MD5=q.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878])}, _doProcessBlock:function(b,d){for(var c=0;16>c;c++){var q=d+c,m=b[q];b[q]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360}var c=this._hash.words,q=b[d+0],m=b[d+1],f=b[d+2],r=b[d+3],x=b[d+4],t=b[d+5],s=b[d+6],v=b[d+7],y=b[d+8],z=b[d+9],A=b[d+10],B=b[d+11],C=b[d+12],D=b[d+13],E=b[d+14],F=b[d+15],g=c[0],h=c[1],j=c[2],k=c[3],g=l(g,h,j,k,q,7,a[0]),k=l(k,g,h,j,m,12,a[1]),j=l(j,k,g,h,f,17,a[2]),h=l(h,j,k,g,r,22,a[3]),g=l(g,h,j,k,x,7,a[4]),k=l(k,g,h,j,t,12,a[5]),j=l(j,k,g,h,s,17,a[6]),h=l(h,j,k,g,v,22,a[7]), g=l(g,h,j,k,y,7,a[8]),k=l(k,g,h,j,z,12,a[9]),j=l(j,k,g,h,A,17,a[10]),h=l(h,j,k,g,B,22,a[11]),g=l(g,h,j,k,C,7,a[12]),k=l(k,g,h,j,D,12,a[13]),j=l(j,k,g,h,E,17,a[14]),h=l(h,j,k,g,F,22,a[15]),g=e(g,h,j,k,m,5,a[16]),k=e(k,g,h,j,s,9,a[17]),j=e(j,k,g,h,B,14,a[18]),h=e(h,j,k,g,q,20,a[19]),g=e(g,h,j,k,t,5,a[20]),k=e(k,g,h,j,A,9,a[21]),j=e(j,k,g,h,F,14,a[22]),h=e(h,j,k,g,x,20,a[23]),g=e(g,h,j,k,z,5,a[24]),k=e(k,g,h,j,E,9,a[25]),j=e(j,k,g,h,r,14,a[26]),h=e(h,j,k,g,y,20,a[27]),g=e(g,h,j,k,D,5,a[28]),k=e(k,g, h,j,f,9,a[29]),j=e(j,k,g,h,v,14,a[30]),h=e(h,j,k,g,C,20,a[31]),g=n(g,h,j,k,t,4,a[32]),k=n(k,g,h,j,y,11,a[33]),j=n(j,k,g,h,B,16,a[34]),h=n(h,j,k,g,E,23,a[35]),g=n(g,h,j,k,m,4,a[36]),k=n(k,g,h,j,x,11,a[37]),j=n(j,k,g,h,v,16,a[38]),h=n(h,j,k,g,A,23,a[39]),g=n(g,h,j,k,D,4,a[40]),k=n(k,g,h,j,q,11,a[41]),j=n(j,k,g,h,r,16,a[42]),h=n(h,j,k,g,s,23,a[43]),g=n(g,h,j,k,z,4,a[44]),k=n(k,g,h,j,C,11,a[45]),j=n(j,k,g,h,F,16,a[46]),h=n(h,j,k,g,f,23,a[47]),g=p(g,h,j,k,q,6,a[48]),k=p(k,g,h,j,v,10,a[49]),j=p(j,k,g,h, E,15,a[50]),h=p(h,j,k,g,t,21,a[51]),g=p(g,h,j,k,C,6,a[52]),k=p(k,g,h,j,r,10,a[53]),j=p(j,k,g,h,A,15,a[54]),h=p(h,j,k,g,m,21,a[55]),g=p(g,h,j,k,y,6,a[56]),k=p(k,g,h,j,F,10,a[57]),j=p(j,k,g,h,s,15,a[58]),h=p(h,j,k,g,D,21,a[59]),g=p(g,h,j,k,x,6,a[60]),k=p(k,g,h,j,B,10,a[61]),j=p(j,k,g,h,f,15,a[62]),h=p(h,j,k,g,z,21,a[63]);c[0]=c[0]+g|0;c[1]=c[1]+h|0;c[2]=c[2]+j|0;c[3]=c[3]+k|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32;var m=s.floor(c/ 4294967296);b[(d+64>>>9<<4)+15]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360;b[(d+64>>>9<<4)+14]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;a.sigBytes=4*(b.length+1);this._process();a=this._hash;b=a.words;for(c=0;4>c;c++)d=b[c],b[c]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;return a},clone:function(){var a=q.clone.call(this);a._hash=this._hash.clone();return a}});b.MD5=q._createHelper(d);b.HmacMD5=q._createHmacHelper(d)})(Math); (function(){var s=CryptoJS,l=s.lib,e=l.Base,n=l.WordArray,l=s.algo,p=l.EvpKDF=e.extend({cfg:e.extend({keySize:4,hasher:l.MD5,iterations:1}),init:function(b){this.cfg=this.cfg.extend(b)},compute:function(b,d){for(var e=this.cfg,q=e.hasher.create(),a=n.create(),l=a.words,p=e.keySize,e=e.iterations;l.length<p;){s&&q.update(s);var s=q.update(b).finalize(d);q.reset();for(var c=1;c<e;c++)s=q.finalize(s),q.reset();a.concat(s)}a.sigBytes=4*p;return a}});s.EvpKDF=function(b,d,e){return p.create(e).compute(b, d)}})(); CryptoJS.lib.Cipher||function(s){var l=CryptoJS,e=l.lib,n=e.Base,p=e.WordArray,b=e.BufferedBlockAlgorithm,d=l.enc.Base64,t=l.algo.EvpKDF,q=e.Cipher=b.extend({cfg:n.extend(),createEncryptor:function(a,f){return this.create(this._ENC_XFORM_MODE,a,f)},createDecryptor:function(a,f){return this.create(this._DEC_XFORM_MODE,a,f)},init:function(a,f,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=f;this.reset()},reset:function(){b.reset.call(this);this._doReset()},process:function(a){this._append(a);return this._process()}, finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(f,b,d){return("string"==typeof b?G:c).encrypt(a,f,b,d)},decrypt:function(f,b,d){return("string"==typeof b?G:c).decrypt(a,f,b,d)}}}});e.StreamCipher=q.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var a=l.mode={},v=function(a,f,b){var c=this._iv;c?this._iv=s:c=this._prevBlock;for(var d=0;d<b;d++)a[f+d]^= c[d]},u=(e.BlockCipherMode=n.extend({createEncryptor:function(a,f){return this.Encryptor.create(a,f)},createDecryptor:function(a,f){return this.Decryptor.create(a,f)},init:function(a,f){this._cipher=a;this._iv=f}})).extend();u.Encryptor=u.extend({processBlock:function(a,f){var b=this._cipher,c=b.blockSize;v.call(this,a,f,c);b.encryptBlock(a,f);this._prevBlock=a.slice(f,f+c)}});u.Decryptor=u.extend({processBlock:function(a,f){var b=this._cipher,c=b.blockSize,d=a.slice(f,f+c);b.decryptBlock(a,f);v.call(this, a,f,c);this._prevBlock=d}});a=a.CBC=u;u=(l.pad={}).Pkcs7={pad:function(a,f){for(var b=4*f,b=b-a.sigBytes%b,c=b<<24|b<<16|b<<8|b,d=[],e=0;e<b;e+=4)d.push(c);b=p.create(d,b);a.concat(b)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};e.BlockCipher=q.extend({cfg:q.cfg.extend({mode:a,padding:u}),reset:function(){q.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a, this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var w=e.CipherParams=n.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),a=(l.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?p.create([1398893684, 1701076831]).concat(a).concat(b):b).toString(d)},parse:function(a){a=d.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=p.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return w.create({ciphertext:a,salt:c})}},c=e.SerializableCipher=n.extend({cfg:n.extend({format:a}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d);b=e.finalize(b);e=e.cfg;return w.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:d.format})}, decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),l=(l.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=p.random(8));a=t.create({keySize:b+c}).compute(a,d);c=p.create(a.words.slice(b),4*c);a.sigBytes=4*b;return w.create({key:a,iv:c,salt:d})}},G=e.PasswordBasedCipher=c.extend({cfg:c.cfg.extend({kdf:l}),encrypt:function(a,b,d,e){e=this.cfg.extend(e);d=e.kdf.execute(d, a.keySize,a.ivSize);e.iv=d.iv;a=c.encrypt.call(this,a,b,d.key,e);a.mixIn(d);return a},decrypt:function(a,b,d,e){e=this.cfg.extend(e);b=this._parse(b,e.format);d=e.kdf.execute(d,a.keySize,a.ivSize,b.salt);e.iv=d.iv;return c.decrypt.call(this,a,b,d.key,e)}})}(); (function(){function s(){for(var b=this._S,d=this._i,e=this._j,q=0,a=0;4>a;a++){var d=(d+1)%256,e=(e+b[d])%256,l=b[d];b[d]=b[e];b[e]=l;q|=b[(b[d]+b[e])%256]<<24-8*a}this._i=d;this._j=e;return q}var l=CryptoJS,e=l.lib.StreamCipher,n=l.algo,p=n.RC4=e.extend({_doReset:function(){for(var b=this._key,d=b.words,b=b.sigBytes,e=this._S=[],l=0;256>l;l++)e[l]=l;for(var a=l=0;256>l;l++){var n=l%b,a=(a+e[l]+(d[n>>>2]>>>24-8*(n%4)&255))%256,n=e[l];e[l]=e[a];e[a]=n}this._i=this._j=0},_doProcessBlock:function(b, d){b[d]^=s.call(this)},keySize:8,ivSize:0});l.RC4=e._createHelper(p);n=n.RC4Drop=p.extend({cfg:p.cfg.extend({drop:192}),_doReset:function(){p._doReset.call(this);for(var b=this.cfg.drop;0<b;b--)s.call(this)}});l.RC4Drop=e._createHelper(n)})();
// Copyright (C) 2015 Google, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using GoogleMobileAds.Api; namespace GoogleMobileAds.Common { internal interface IRewardBasedVideoAdClient { // Ad event fired when the reward based video ad has been received. event EventHandler<EventArgs> OnAdLoaded; // Ad event fired when the reward based video ad has failed to load. event EventHandler<AdFailedToLoadEventArgs> OnAdFailedToLoad; // Ad event fired when the reward based video ad is opened. event EventHandler<EventArgs> OnAdOpening; // Ad event fired when the reward based video ad has started playing. event EventHandler<EventArgs> OnAdStarted; // Ad event fired when the reward based video ad has rewarded the user. event EventHandler<Reward> OnAdRewarded; // Ad event fired when the reward based video ad is closed. event EventHandler<EventArgs> OnAdClosed; // Ad event fired when the reward based video ad is leaving the application. event EventHandler<EventArgs> OnAdLeavingApplication; // Creates a reward based video ad and adds it to the view hierarchy. void CreateRewardBasedVideoAd(); // Requests a new ad for the reward based video ad. void LoadAd(AdRequest request, string adUnitId); // Determines whether the reward based video has loaded. bool IsLoaded(); // Shows the reward based video ad on the screen. void ShowRewardBasedVideoAd(); } }
#include <winpr/crt.h> #include <winpr/error.h> #include <winpr/wtsapi.h> int TestWtsApiExtraDynamicVirtualChannel(int argc, char* argv[]) { BOOL bSuccess; ULONG length; ULONG bytesRead; ULONG bytesWritten; BYTE buffer[1024]; HANDLE hVirtualChannel; length = sizeof(buffer); hVirtualChannel = WTSVirtualChannelOpenEx( WTS_CURRENT_SESSION, "ECHO",WTS_CHANNEL_OPTION_DYNAMIC); if (hVirtualChannel == INVALID_HANDLE_VALUE) { printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelOpen opend"); bytesWritten = 0; bSuccess = WTSVirtualChannelWrite(hVirtualChannel, (PCHAR) buffer, length, &bytesWritten); if (!bSuccess) { printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelWrite written"); bytesRead = 0; bSuccess = WTSVirtualChannelRead(hVirtualChannel, 5000, (PCHAR) buffer, length, &bytesRead); if (!bSuccess) { printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelRead read"); if (!WTSVirtualChannelClose(hVirtualChannel)) { printf("WTSVirtualChannelClose failed\n"); return -1; } return 0; }
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 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. ==============================================================================*/ #include "tensorflow/compiler/xla/reference_util.h" #include <array> #include <utility> #include "absl/container/flat_hash_set.h" #include "absl/memory/memory.h" #include "tensorflow/compiler/xla/client/xla_builder.h" #include "tensorflow/compiler/xla/literal_util.h" #include "tensorflow/compiler/xla/service/hlo_evaluator.h" #include "tensorflow/compiler/xla/service/hlo_instruction.h" #include "tensorflow/compiler/xla/service/shape_inference.h" #include "tensorflow/compiler/xla/window_util.h" #include "tensorflow/compiler/xla/xla_data.pb.h" #include "tensorflow/core/lib/math/math_util.h" #include "tensorflow/core/platform/logging.h" namespace xla { /* static */ std::unique_ptr<Array2D<double>> ReferenceUtil::Array2DF32ToF64( const Array2D<float>& input) { auto result = absl::make_unique<Array2D<double>>(input.height(), input.width()); for (int64 rowno = 0; rowno < input.height(); ++rowno) { for (int64 colno = 0; colno < input.height(); ++colno) { (*result)(rowno, colno) = input(rowno, colno); } } return result; } /* static */ std::unique_ptr<Array3D<float>> ReferenceUtil::ConvArray3D( const Array3D<float>& lhs, const Array3D<float>& rhs, int64 kernel_stride, Padding padding) { return ConvArray3DGeneralDimensionsDilated( lhs, rhs, kernel_stride, padding, 1, 1, XlaBuilder::CreateDefaultConvDimensionNumbers(1)); } /*static*/ std::unique_ptr<Array3D<float>> ReferenceUtil::ConvArray3DGeneralDimensionsDilated( const Array3D<float>& lhs, const Array3D<float>& rhs, int64 kernel_stride, Padding padding, int64 lhs_dilation, int64 rhs_dilation, const ConvolutionDimensionNumbers& dnums) { CHECK_EQ(dnums.input_spatial_dimensions_size(), 1); CHECK_EQ(dnums.kernel_spatial_dimensions_size(), 1); CHECK_EQ(dnums.output_spatial_dimensions_size(), 1); // Reuse the code for Array4D-convolution by extending the 3D input into a 4D // array by adding a fourth dummy dimension of size 1 without stride, padding // and dilation. Array4D<float> a4dlhs(lhs.n1(), lhs.n2(), lhs.n3(), 1); a4dlhs.Each([&](absl::Span<const int64> indices, float* value_ptr) { CHECK_EQ(indices[3], 0); *value_ptr = lhs.operator()(indices[0], indices[1], indices[2]); }); Array4D<float> a4drhs(rhs.n1(), rhs.n2(), rhs.n3(), 1); a4drhs.Each([&](absl::Span<const int64> indices, float* value_ptr) { CHECK_EQ(indices[3], 0); *value_ptr = rhs.operator()(indices[0], indices[1], indices[2]); }); // Add a second dummy spatial dimensions. ConvolutionDimensionNumbers dnums2d = dnums; dnums2d.add_input_spatial_dimensions(3); dnums2d.add_kernel_spatial_dimensions(3); dnums2d.add_output_spatial_dimensions(3); std::unique_ptr<Array4D<float>> convr4 = ConvArray4DGeneralDimensionsDilated( a4dlhs, a4drhs, {kernel_stride, 1}, padding, {lhs_dilation, 1}, {rhs_dilation, 1}, dnums2d); auto convr3 = absl::make_unique<Array3D<float>>( convr4->planes(), convr4->depth(), convr4->height()); convr4->Each([&](absl::Span<const int64> indices, float* value_ptr) { CHECK_EQ(indices[3], 0); convr3->operator()(indices[0], indices[1], indices[2]) = *value_ptr; }); return convr3; } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::ConvArray4D( const Array4D<float>& lhs, const Array4D<float>& rhs, std::pair<int64, int64> kernel_stride, Padding padding) { return ConvArray4DGeneralDimensions( lhs, rhs, kernel_stride, padding, XlaBuilder::CreateDefaultConvDimensionNumbers()); } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::SeparableConvArray4D(const Array4D<float>& input, const Array4D<float>& depthwise_weights, const Array4D<float>& pointwise_weights, std::pair<int64, int64> kernel_stride, Padding padding) { const int64 depth_multiplier = depthwise_weights.planes(); CHECK_EQ(pointwise_weights.depth(), input.depth() * depth_multiplier); // Combine the two weights by reducing the depth_multiplier, so that we can // apply a single convolution on the combined weights. Array4D<float> weights(pointwise_weights.planes(), input.depth(), depthwise_weights.height(), depthwise_weights.width()); for (int64 kx = 0; kx < depthwise_weights.width(); ++kx) { for (int64 ky = 0; ky < depthwise_weights.height(); ++ky) { for (int64 kz = 0; kz < input.depth(); ++kz) { for (int64 out = 0; out < pointwise_weights.planes(); ++out) { float weight = 0.0; for (int64 depth = 0; depth < depth_multiplier; ++depth) { weight += depthwise_weights(depth, kz, ky, kx) * pointwise_weights(out, depth + kz * depth_multiplier, 0, 0); } weights(out, kz, ky, kx) = weight; } } } } return ConvArray4D(input, weights, kernel_stride, padding); } /* static */ int64 ReferenceUtil::WindowCount(int64 unpadded_width, int64 window_len, int64 stride, Padding padding) { if (padding == Padding::kValid) { return window_util::StridedBound(unpadded_width, window_len, stride); } return tensorflow::MathUtil::CeilOfRatio(unpadded_width, stride); } /* static */ std::unique_ptr<std::vector<float>> ReferenceUtil::ReduceWindow1DGeneric( absl::Span<const float> operand, float init, const std::function<float(float, float)>& reduce_func, absl::Span<const int64> window, absl::Span<const int64> stride, absl::Span<const std::pair<int64, int64>> padding) { CHECK_EQ(window.size(), 1); CHECK_EQ(stride.size(), 1); CHECK_EQ(padding.size(), 1); int64 padded_width = padding[0].first + operand.size() + padding[0].second; int64 stride_amount = stride[0]; int64 window_size = window[0]; int64 result_size = window_util::StridedBound(padded_width, window_size, stride_amount); int64 pad_low = padding[0].first; auto result = absl::make_unique<std::vector<float>>(result_size); // Do a full 1D reduce window. for (int64 i0 = 0; i0 < result_size; ++i0) { int64 i0_base = i0 * stride_amount - pad_low; float val = init; for (int64 i0_win = 0; i0_win < window_size; ++i0_win) { if (i0_base + i0_win >= 0 && i0_base + i0_win < operand.size()) { val = reduce_func(val, operand[i0_base + i0_win]); } } (*result)[i0] = val; } return result; } /* static */ std::unique_ptr<std::vector<float>> ReferenceUtil::ReduceWindow1DAdd(absl::Span<const float> operand, float init, absl::Span<const int64> window, absl::Span<const int64> stride, Padding padding) { const auto add_reduce = [](float arg1, float arg2) { return arg1 + arg2; }; std::vector<int64> dim_lengths{static_cast<int64>(operand.size())}; return ReduceWindow1DGeneric( operand, init, add_reduce, window, stride, xla::MakePadding(dim_lengths, window, stride, padding)); } /* static */ std::unique_ptr<Array3D<float>> ReferenceUtil::ReduceWindow3DAdd( const Array3D<float>& operand, float init, absl::Span<const int64> window, absl::Span<const int64> stride, Padding padding) { std::vector<int64> dim_lengths{operand.n1(), operand.n2(), operand.n3()}; auto padding_both = xla::MakePadding(dim_lengths, window, stride, padding); std::vector<int64> window_counts(window.size(), 0); std::vector<int64> pad_low(window.size(), 0); for (int64 i = 0; i < window.size(); ++i) { window_counts[i] = WindowCount(dim_lengths[i], window[i], stride[i], padding); pad_low[i] = padding_both[i].first; } auto result = absl::make_unique<Array3D<float>>( window_counts[0], window_counts[1], window_counts[2]); for (int64 i0 = 0; i0 < window_counts[0]; ++i0) { for (int64 i1 = 0; i1 < window_counts[1]; ++i1) { for (int64 i2 = 0; i2 < window_counts[2]; ++i2) { int64 i0_base = i0 * stride[0] - pad_low[0]; int64 i1_base = i1 * stride[1] - pad_low[1]; int64 i2_base = i2 * stride[2] - pad_low[2]; float val = init; for (int64 i0_win = 0; i0_win < window[0]; ++i0_win) { for (int64 i1_win = 0; i1_win < window[1]; ++i1_win) { for (int64 i2_win = 0; i2_win < window[2]; ++i2_win) { if (i0_base + i0_win >= 0 && i1_base + i1_win >= 0 && i2_base + i2_win >= 0 && i0_base + i0_win < operand.n1() && i1_base + i1_win < operand.n2() && i2_base + i2_win < operand.n3()) { val += operand(i0_base + i0_win, i1_base + i1_win, i2_base + i2_win); } } } } (*result)(i0, i1, i2) = val; } } } return result; } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::ReduceWindow4DGeneric( const Array4D<float>& operand, float init, const std::function<float(float, float)>& reduce_func, absl::Span<const int64> window, absl::Span<const int64> stride, Padding padding) { std::vector<int64> dim_lengths{operand.n1(), operand.n2(), operand.n3(), operand.n4()}; return ReduceWindow4DGeneric( operand, init, reduce_func, window, stride, xla::MakePadding(dim_lengths, window, stride, padding)); } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::ReduceWindow4DGeneric( const Array4D<float>& operand, float init, const std::function<float(float, float)>& reduce_func, absl::Span<const int64> window, absl::Span<const int64> stride, absl::Span<const std::pair<int64, int64>> padding) { std::vector<int64> dim_lengths{operand.n1(), operand.n2(), operand.n3(), operand.n4()}; std::vector<int64> window_counts(window.size(), 0); std::vector<int64> pad_low(window.size(), 0); for (int64 i = 0; i < window.size(); ++i) { int64 padded_width = padding[i].first + dim_lengths[i] + padding[i].second; window_counts[i] = window_util::StridedBound(padded_width, window[i], stride[i]); pad_low[i] = padding[i].first; } auto result = absl::make_unique<Array4D<float>>( window_counts[0], window_counts[1], window_counts[2], window_counts[3]); // Do a full 4D reduce window. for (int64 i0 = 0; i0 < window_counts[0]; ++i0) { for (int64 i1 = 0; i1 < window_counts[1]; ++i1) { for (int64 i2 = 0; i2 < window_counts[2]; ++i2) { for (int64 i3 = 0; i3 < window_counts[3]; ++i3) { int64 i0_base = i0 * stride[0] - pad_low[0]; int64 i1_base = i1 * stride[1] - pad_low[1]; int64 i2_base = i2 * stride[2] - pad_low[2]; int64 i3_base = i3 * stride[3] - pad_low[3]; float val = init; for (int64 i0_win = 0; i0_win < window[0]; ++i0_win) { for (int64 i1_win = 0; i1_win < window[1]; ++i1_win) { for (int64 i2_win = 0; i2_win < window[2]; ++i2_win) { for (int64 i3_win = 0; i3_win < window[3]; ++i3_win) { if (i0_base + i0_win >= 0 && i1_base + i1_win >= 0 && i2_base + i2_win >= 0 && i3_base + i3_win >= 0 && i0_base + i0_win < operand.n1() && i1_base + i1_win < operand.n2() && i2_base + i2_win < operand.n3() && i3_base + i3_win < operand.n4()) { val = reduce_func( val, operand(i0_base + i0_win, i1_base + i1_win, i2_base + i2_win, i3_base + i3_win)); } } } } } (*result)(i0, i1, i2, i3) = val; } } } } return result; } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::ReduceWindow4DAdd( const Array4D<float>& operand, float init, absl::Span<const int64> window, absl::Span<const int64> stride, Padding padding) { const auto add_reduce = [](float arg1, float arg2) { return arg1 + arg2; }; return ReduceWindow4DGeneric(operand, init, add_reduce, window, stride, padding); } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::BatchNorm4D( const Array4D<float>& input, const Array4D<float>& mean, const Array4D<float>& var, const Array4D<float>& scale, const Array4D<float>& offset, float epsilon) { auto normalized = *MapArray4D(input, mean, [](float a, float b) { return a - b; }); normalized = *MapArray4D(normalized, var, [&](float a, float b) { return a / std::sqrt(b + epsilon); }); normalized = *MapArray4D(normalized, scale, [](float a, float b) { return a * b; }); return MapArray4D(normalized, offset, [](float a, float b) { return a + b; }); } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::SelectAndScatter4DGePlus(const Array4D<float>& operand, const Array4D<float>& source, float init, absl::Span<const int64> window, absl::Span<const int64> stride, bool same_padding) { Padding padding = same_padding ? Padding::kSame : Padding::kValid; auto result = absl::make_unique<Array4D<float>>(operand.n1(), operand.n2(), operand.n3(), operand.n4()); std::vector<int64> dim_lengths{operand.n1(), operand.n2(), operand.n3(), operand.n4()}; auto padding_both = xla::MakePadding(dim_lengths, window, stride, padding); // Fill the output, with the initial value. result->Fill(init); std::vector<int64> window_counts(window.size(), 0); std::vector<int64> pad_low(window.size(), 0); for (int64 i = 0; i < window.size(); ++i) { window_counts[i] = WindowCount(dim_lengths[i], window[i], stride[i], padding); pad_low[i] = padding_both[i].first; } CHECK_EQ(window_counts[0], source.n1()); CHECK_EQ(window_counts[1], source.n2()); CHECK_EQ(window_counts[2], source.n3()); CHECK_EQ(window_counts[3], source.n4()); // Do a full 4D select and Scatter. for (int64 i0 = 0; i0 < window_counts[0]; ++i0) { for (int64 i1 = 0; i1 < window_counts[1]; ++i1) { for (int64 i2 = 0; i2 < window_counts[2]; ++i2) { for (int64 i3 = 0; i3 < window_counts[3]; ++i3) { // Now we are inside a window and need to find the max and the argmax. int64 i0_base = i0 * stride[0] - pad_low[0]; int64 i1_base = i1 * stride[1] - pad_low[1]; int64 i2_base = i2 * stride[2] - pad_low[2]; int64 i3_base = i3 * stride[3] - pad_low[3]; int64 scatter_0 = (i0_base >= 0) ? i0_base : 0; int64 scatter_1 = (i1_base >= 0) ? i1_base : 0; int64 scatter_2 = (i2_base >= 0) ? i2_base : 0; int64 scatter_3 = (i3_base >= 0) ? i3_base : 0; float val = operand(scatter_0, scatter_1, scatter_2, scatter_3); for (int64 i0_win = 0; i0_win < window[0]; ++i0_win) { for (int64 i1_win = 0; i1_win < window[1]; ++i1_win) { for (int64 i2_win = 0; i2_win < window[2]; ++i2_win) { for (int64 i3_win = 0; i3_win < window[3]; ++i3_win) { if (i0_base + i0_win >= 0 && i1_base + i1_win >= 0 && i2_base + i2_win >= 0 && i3_base + i3_win >= 0 && i0_base + i0_win < operand.n1() && i1_base + i1_win < operand.n2() && i2_base + i2_win < operand.n3() && i3_base + i3_win < operand.n4()) { float tmp = operand(i0_base + i0_win, i1_base + i1_win, i2_base + i2_win, i3_base + i3_win); if (tmp > val) { val = tmp; scatter_0 = i0_base + i0_win; scatter_1 = i1_base + i1_win; scatter_2 = i2_base + i2_win; scatter_3 = i3_base + i3_win; } } } } } } (*result)(scatter_0, scatter_1, scatter_2, scatter_3) += source(i0, i1, i2, i3); } } } } return result; } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::ConvArray4DGeneralDimensions( const Array4D<float>& lhs, const Array4D<float>& rhs, std::pair<int64, int64> kernel_stride, Padding padding, ConvolutionDimensionNumbers dimension_numbers) { return ConvArray4DGeneralDimensionsDilated(lhs, rhs, kernel_stride, padding, {1, 1}, {1, 1}, std::move(dimension_numbers)); } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::ConvArray4DGeneralDimensionsDilated( const Array4D<float>& lhs, const Array4D<float>& rhs, std::pair<int64, int64> kernel_stride, Padding padding, std::pair<int64, int64> lhs_dilation, std::pair<int64, int64> rhs_dilation, ConvolutionDimensionNumbers dnums) { HloComputation::Builder b("ConvArray4DGeneralDimensionDilated"); auto lhs_literal = LiteralUtil::CreateR4FromArray4D<float>(lhs); auto rhs_literal = LiteralUtil::CreateR4FromArray4D<float>(rhs); std::array<int64, 2> ordered_kernel_strides; std::array<int64, 2> ordered_input_dimensions; std::array<int64, 2> ordered_kernel_dimensions; if (dnums.kernel_spatial_dimensions(0) > dnums.kernel_spatial_dimensions(1)) { ordered_kernel_strides[0] = kernel_stride.second; ordered_kernel_strides[1] = kernel_stride.first; } else { ordered_kernel_strides[0] = kernel_stride.first; ordered_kernel_strides[1] = kernel_stride.second; } ordered_input_dimensions[0] = lhs_literal.shape().dimensions(dnums.input_spatial_dimensions(0)); ordered_input_dimensions[1] = lhs_literal.shape().dimensions(dnums.input_spatial_dimensions(1)); ordered_kernel_dimensions[0] = rhs_literal.shape().dimensions(dnums.kernel_spatial_dimensions(0)); ordered_kernel_dimensions[1] = rhs_literal.shape().dimensions(dnums.kernel_spatial_dimensions(1)); std::vector<std::pair<int64, int64>> paddings = MakePadding(ordered_input_dimensions, ordered_kernel_dimensions, ordered_kernel_strides, padding); CHECK_EQ(paddings.size(), 2); Window window; WindowDimension dim; dim.set_size( rhs_literal.shape().dimensions(dnums.kernel_spatial_dimensions(0))); dim.set_stride(kernel_stride.first); dim.set_padding_low(paddings[0].first); dim.set_padding_high(paddings[0].second); dim.set_window_dilation(rhs_dilation.first); dim.set_base_dilation(lhs_dilation.first); *window.add_dimensions() = dim; WindowDimension dim2; dim2.set_size( rhs_literal.shape().dimensions(dnums.kernel_spatial_dimensions(1))); dim2.set_stride(kernel_stride.second); dim2.set_padding_low(paddings[1].first); dim2.set_padding_high(paddings[1].second); dim2.set_window_dilation(rhs_dilation.second); dim2.set_base_dilation(lhs_dilation.second); *window.add_dimensions() = dim2; const Shape& shape = ShapeInference::InferConvolveShape( lhs_literal.shape(), rhs_literal.shape(), /*feature_group_count=*/1, /*batch_group_count=*/1, window, dnums) .ConsumeValueOrDie(); HloInstruction* lhs_instruction = b.AddInstruction(HloInstruction::CreateConstant(std::move(lhs_literal))); HloInstruction* rhs_instruction = b.AddInstruction(HloInstruction::CreateConstant(std::move(rhs_literal))); PrecisionConfig precision_config; precision_config.mutable_operand_precision()->Resize( /*new_size=*/2, PrecisionConfig::DEFAULT); b.AddInstruction(HloInstruction::CreateConvolve( shape, lhs_instruction, rhs_instruction, /*feature_group_count=*/1, /*batch_group_count=*/1, window, dnums, precision_config)); HloModuleConfig config; HloModule module("ReferenceUtil", config); auto computation = module.AddEntryComputation(b.Build()); HloEvaluator evaluator; Literal result_literal = evaluator.Evaluate(*computation, {}).ConsumeValueOrDie(); CHECK_EQ(result_literal.shape().rank(), 4); auto result = absl::make_unique<Array4D<float>>(result_literal.shape().dimensions(0), result_literal.shape().dimensions(1), result_literal.shape().dimensions(2), result_literal.shape().dimensions(3)); result->Each([&](absl::Span<const int64> indices, float* value) { *value = result_literal.Get<float>(indices); }); return result; } /* static */ std::unique_ptr<std::vector<float>> ReferenceUtil::ReduceToColArray2D( const Array2D<float>& matrix, float init, const std::function<float(float, float)>& reduce_function) { int64 rows = matrix.height(); int64 cols = matrix.width(); auto result = absl::make_unique<std::vector<float>>(); for (int64 i = 0; i < rows; ++i) { float acc = init; for (int64 j = 0; j < cols; ++j) { acc = reduce_function(acc, matrix(i, j)); } result->push_back(acc); } return result; } /* static */ std::unique_ptr<std::vector<float>> ReferenceUtil::ReduceToRowArray2D( const Array2D<float>& matrix, float init, const std::function<float(float, float)>& reduce_function) { int64 rows = matrix.height(); int64 cols = matrix.width(); auto result = absl::make_unique<std::vector<float>>(); for (int64 i = 0; i < cols; ++i) { float acc = init; for (int64 j = 0; j < rows; ++j) { acc = reduce_function(acc, matrix(j, i)); } result->push_back(acc); } return result; } /*static*/ std::vector<float> ReferenceUtil::Reduce4DTo1D( const Array4D<float>& array, float init, absl::Span<const int64> dims, const std::function<float(float, float)>& reduce_function) { std::vector<float> result; CHECK_EQ(dims.size(), 3); const absl::flat_hash_set<int64> dim_set(dims.begin(), dims.end()); CHECK_EQ(dim_set.size(), 3); for (int64 a0 = 0; a0 == 0 || (!dim_set.contains(0) && a0 < array.n1()); ++a0) { for (int64 a1 = 0; a1 == 0 || (!dim_set.contains(1) && a1 < array.n2()); ++a1) { for (int64 a2 = 0; a2 == 0 || (!dim_set.contains(2) && a2 < array.n3()); ++a2) { for (int64 a3 = 0; a3 == 0 || (!dim_set.contains(3) && a3 < array.n4()); ++a3) { float accumulator = init; for (int64 i0 = 0; i0 == 0 || (dim_set.contains(0) && i0 < array.n1()); ++i0) { for (int64 i1 = 0; i1 == 0 || (dim_set.contains(1) && i1 < array.n2()); ++i1) { for (int64 i2 = 0; i2 == 0 || (dim_set.contains(2) && i2 < array.n3()); ++i2) { for (int64 i3 = 0; i3 == 0 || (dim_set.contains(3) && i3 < array.n4()); ++i3) { // Handle zero-sized arrays. if (array.n1() > 0 && array.n2() > 0 && array.n3() > 0 && array.n4() > 0) { accumulator = reduce_function( accumulator, array(a0 + i0, a1 + i1, a2 + i2, a3 + i3)); } } } } } result.push_back(accumulator); } } } } return result; } /* static */ std::unique_ptr<Array4D<float>> ReferenceUtil::Broadcast1DTo4D( const std::vector<float>& array, const std::vector<int64>& bounds, int64 broadcast_from_dim) { auto result = absl::make_unique<Array4D<float>>(bounds[0], bounds[1], bounds[2], bounds[3]); for (int64 i = 0; i < result->n1(); ++i) { for (int64 j = 0; j < result->n2(); ++j) { for (int64 k = 0; k < result->n3(); ++k) { for (int64 l = 0; l < result->n4(); ++l) { switch (broadcast_from_dim) { case 0: (*result)(i, j, k, l) = array[i]; break; case 1: (*result)(i, j, k, l) = array[j]; break; case 2: (*result)(i, j, k, l) = array[k]; break; case 3: (*result)(i, j, k, l) = array[l]; break; default: break; } } } } } return result; } /* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::Reduce3DTo2D( const Array3D<float>& array, float init, absl::Span<const int64> dims, const std::function<float(float, float)>& reduce_function) { CHECK_EQ(dims.size(), 1); int64 rows = dims[0] == 0 ? array.n2() : array.n1(); int64 cols = dims[0] == 2 ? array.n2() : array.n3(); auto result = absl::make_unique<Array2D<float>>(rows, cols); result->Fill(init); for (int i0 = 0; i0 < array.n1(); ++i0) { for (int i1 = 0; i1 < array.n2(); ++i1) { for (int i2 = 0; i2 < array.n3(); ++i2) { int64 row = dims[0] == 0 ? i1 : i0; int64 col = dims[0] == 2 ? i1 : i2; (*result)(row, col) = reduce_function((*result)(row, col), array(i0, i1, i2)); } } } return result; } /* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::MapArray2D( const Array2D<float>& matrix, const std::function<float(float)>& map_function) { int64 rows = matrix.height(); int64 cols = matrix.width(); auto result = absl::make_unique<Array2D<float>>(rows, cols); for (int64 i = 0; i < rows; ++i) { for (int64 j = 0; j < cols; ++j) { (*result)(i, j) = map_function(matrix(i, j)); } } return result; } /* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::MapArray2D( const Array2D<float>& lhs, const Array2D<float>& rhs, const std::function<float(float, float)>& map_function) { CHECK_EQ(lhs.height(), rhs.height()); CHECK_EQ(lhs.width(), rhs.width()); int64 rows = lhs.height(); int64 cols = rhs.width(); auto result = absl::make_unique<Array2D<float>>(rows, cols); for (int64 i = 0; i < rows; ++i) { for (int64 j = 0; j < cols; ++j) { (*result)(i, j) = map_function(lhs(i, j), rhs(i, j)); } } return result; } /* static */ std::unique_ptr<Array2D<float>> ReferenceUtil::MapWithIndexArray2D( const Array2D<float>& matrix, const std::function<float(float, int64, int64)>& map_function) { int64 rows = matrix.height(); int64 cols = matrix.width(); auto result = absl::make_unique<Array2D<float>>(rows, cols); for (int64 i = 0; i < rows; ++i) { for (int64 j = 0; j < cols; ++j) { (*result)(i, j) = map_function(matrix(i, j), i, j); } } return result; } } // namespace xla
/*========================================================================= * * Copyright Insight Software Consortium * * 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.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkGaussianTransferFunction_h #define itkGaussianTransferFunction_h #include "itkTransferFunctionBase.h" namespace itk { namespace Statistics { /** \class GaussianTransferFunction * \brief This is the itkGaussianTransferFunction class. * * \ingroup ITKNeuralNetworks */ template<typename ScalarType> class GaussianTransferFunction : public TransferFunctionBase<ScalarType> { public: /** Standard class typedefs. */ typedef GaussianTransferFunction Self; typedef TransferFunctionBase<ScalarType> Superclass; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; /** Run-time type information (and related methods). */ itkTypeMacro(GaussianTransferFunction, TransferFunctionBase); /** Method for creation through the object factory. */ itkNewMacro(Self); /** Evaluate at the specified input position */ virtual ScalarType Evaluate(const ScalarType& input) const; /** Evaluate the derivative at the specified input position */ virtual ScalarType EvaluateDerivative(const ScalarType& input) const; protected: GaussianTransferFunction(); virtual ~GaussianTransferFunction(); /** Method to print the object. */ virtual void PrintSelf( std::ostream& os, Indent indent ) const; };//class } // end namespace Statistics } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkGaussianTransferFunction.hxx" #endif #endif
<?php final class DiffusionSubversionCommandEngine extends DiffusionCommandEngine { protected function canBuildForRepository( PhabricatorRepository $repository) { return $repository->isSVN(); } protected function newFormattedCommand($pattern, array $argv) { $flags = array(); $args = array(); $flags[] = '--non-interactive'; if ($this->isAnyHTTPProtocol() || $this->isSVNProtocol()) { $flags[] = '--no-auth-cache'; if ($this->isAnyHTTPProtocol()) { $flags[] = '--trust-server-cert'; } $credential_phid = $this->getCredentialPHID(); if ($credential_phid) { $key = PassphrasePasswordKey::loadFromPHID( $credential_phid, PhabricatorUser::getOmnipotentUser()); $flags[] = '--username %P'; $args[] = $key->getUsernameEnvelope(); $flags[] = '--password %P'; $args[] = $key->getPasswordEnvelope(); } } $flags = implode(' ', $flags); $pattern = "svn {$flags} {$pattern}"; return array($pattern, array_merge($args, $argv)); } protected function newCustomEnvironment() { $env = array(); $env['SVN_SSH'] = $this->getSSHWrapper(); return $env; } }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.qpid.proton.engine.impl; import static java.util.Arrays.copyOfRange; import static org.apache.qpid.proton.engine.impl.TransportTestHelper.assertByteArrayContentEquals; import static org.apache.qpid.proton.engine.impl.TransportTestHelper.assertByteBufferContentEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.apache.qpid.proton.engine.TransportException; import java.nio.ByteBuffer; import org.junit.Test; public class TransportOutputAdaptorTest { private final CannedTransportOutputWriter _transportOutputWriter = new CannedTransportOutputWriter(); private final TransportOutput _transportOutput = new TransportOutputAdaptor(_transportOutputWriter, 1024); @Test public void testThatOutputBufferIsReadOnly() { assertTrue(_transportOutput.head().isReadOnly()); } @Test public void testGetOutputBuffer_containsCorrectBytes() { byte[] testBytes = "testbytes".getBytes(); _transportOutputWriter.setNextCannedOutput(testBytes); assertEquals(testBytes.length, _transportOutput.pending()); final ByteBuffer outputBuffer = _transportOutput.head(); assertEquals(testBytes.length, outputBuffer.remaining()); byte[] outputBytes = new byte[testBytes.length]; outputBuffer.get(outputBytes); assertByteArrayContentEquals(testBytes, outputBytes); _transportOutput.pop(outputBuffer.position()); final ByteBuffer outputBuffer2 = _transportOutput.head(); assertEquals(0, outputBuffer2.remaining()); } @Test public void testClientConsumesOutputInMultipleChunks() { byte[] testBytes = "testbytes".getBytes(); _transportOutputWriter.setNextCannedOutput(testBytes); // sip the first two bytes into a small byte array int chunk1Size = 2; int chunk2Size = testBytes.length - chunk1Size; { final ByteBuffer outputBuffer1 = _transportOutput.head(); byte[] byteArray1 = new byte[chunk1Size]; outputBuffer1.get(byteArray1); assertEquals(chunk2Size, outputBuffer1.remaining()); assertByteArrayContentEquals(copyOfRange(testBytes, 0, chunk1Size), byteArray1); _transportOutput.pop(outputBuffer1.position()); } { final ByteBuffer outputBuffer2 = _transportOutput.head(); int chunk2Offset = chunk1Size; assertByteBufferContentEquals(copyOfRange(testBytes, chunk2Offset, testBytes.length), outputBuffer2); } } @Test public void testClientConsumesOutputInMultipleChunksWithAdditionalTransportWriterOutput() { byte[] initialBytes = "abcd".getBytes(); _transportOutputWriter.setNextCannedOutput(initialBytes); // sip the first two bytes into a small byte array int chunk1Size = 2; int initialRemaining = initialBytes.length - chunk1Size; { final ByteBuffer outputBuffer1 = _transportOutput.head(); byte[] byteArray1 = new byte[chunk1Size]; outputBuffer1.get(byteArray1); assertEquals(initialRemaining, outputBuffer1.remaining()); assertByteArrayContentEquals(copyOfRange(initialBytes, 0, chunk1Size), byteArray1); _transportOutput.pop(outputBuffer1.position()); } byte[] additionalBytes = "wxyz".getBytes(); _transportOutputWriter.setNextCannedOutput(additionalBytes); { final ByteBuffer outputBuffer2 = _transportOutput.head(); byte[] expectedBytes = "cdwxyz".getBytes(); assertByteBufferContentEquals(expectedBytes, outputBuffer2); } } private static final class CannedTransportOutputWriter implements TransportOutputWriter { byte[] _cannedOutput = new byte[0]; @Override public boolean writeInto(ByteBuffer outputBuffer) { int bytesWritten = ByteBufferUtils.pourArrayToBuffer(_cannedOutput, 0, _cannedOutput.length, outputBuffer); if(bytesWritten < _cannedOutput.length) { fail("Unable to write all " + _cannedOutput.length + " bytes of my canned output to the provided output buffer: " + outputBuffer); } _cannedOutput = new byte[0]; return false; } void setNextCannedOutput(byte[] cannedOutput) { _cannedOutput = cannedOutput; } public void closed(TransportException error) { // do nothing } } }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Struct relative</title> <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../../accumulators/reference.html#header.boost.accumulators.statistics_fwd_hpp" title="Header &lt;boost/accumulators/statistics_fwd.hpp&gt;"> <link rel="prev" href="absolute.html" title="Struct absolute"> <link rel="next" href="with_density.html" title="Struct with_density"> </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="absolute.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../accumulators/reference.html#header.boost.accumulators.statistics_fwd_hpp"><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="with_density.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.accumulators.relative"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Struct relative</span></h2> <p>boost::accumulators::relative</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../accumulators/reference.html#header.boost.accumulators.statistics_fwd_hpp" title="Header &lt;boost/accumulators/statistics_fwd.hpp&gt;">boost/accumulators/statistics_fwd.hpp</a>&gt; </span> <span class="keyword">struct</span> <a class="link" href="relative.html" title="Struct relative">relative</a> <span class="special">{</span> <span class="special">}</span><span class="special">;</span></pre></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 &#169; 2005, 2006 Eric Niebler<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="absolute.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../accumulators/reference.html#header.boost.accumulators.statistics_fwd_hpp"><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="with_density.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
/** * Copyright The Apache Software Foundation * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with this * work for additional information regarding copyright ownership. The ASF * licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package org.apache.hadoop.hbase.io.hfile.bucket; import org.apache.hadoop.hbase.testclassification.IOTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.io.hfile.BlockCacheKey; import org.apache.hadoop.hbase.io.hfile.Cacheable; import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.BucketEntry; import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; import org.mockito.Mockito; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.atomic.AtomicLong; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @Category({IOTests.class, SmallTests.class}) public class TestBucketWriterThread { private BucketCache bc; private BucketCache.WriterThread wt; private BlockingQueue<RAMQueueEntry> q; private Cacheable plainCacheable; private BlockCacheKey plainKey; /** A BucketCache that does not start its writer threads. */ private static class MockBucketCache extends BucketCache { public MockBucketCache(String ioEngineName, long capacity, int blockSize, int[] bucketSizes, int writerThreadNum, int writerQLen, String persistencePath, int ioErrorsTolerationDuration) throws FileNotFoundException, IOException { super(ioEngineName, capacity, blockSize, bucketSizes, writerThreadNum, writerQLen, persistencePath, ioErrorsTolerationDuration); } @Override protected void startWriterThreads() { // intentional noop } } /** * Set up variables and get BucketCache and WriterThread into state where tests can manually * control the running of WriterThread and BucketCache is empty. * @throws Exception */ @Before public void setUp() throws Exception { // Arbitrary capacity. final int capacity = 16; // Run with one writer thread only. Means there will be one writer queue only too. We depend // on this in below. final int writerThreadsCount = 1; this.bc = new MockBucketCache("heap", capacity, 1, new int [] {1}, writerThreadsCount, capacity, null, 100/*Tolerate ioerrors for 100ms*/); assertEquals(writerThreadsCount, bc.writerThreads.length); assertEquals(writerThreadsCount, bc.writerQueues.size()); // Get reference to our single WriterThread instance. this.wt = bc.writerThreads[0]; this.q = bc.writerQueues.get(0); wt.disableWriter(); this.plainKey = new BlockCacheKey("f", 0); this.plainCacheable = Mockito.mock(Cacheable.class); assertThat(bc.ramCache.isEmpty(), is(true)); assertTrue(q.isEmpty()); } @After public void tearDown() throws Exception { if (this.bc != null) this.bc.shutdown(); } /** * Test non-error case just works. * @throws FileNotFoundException * @throws IOException * @throws InterruptedException */ @Test (timeout=30000) public void testNonErrorCase() throws IOException, InterruptedException { bc.cacheBlock(this.plainKey, this.plainCacheable); doDrainOfOneEntry(this.bc, this.wt, this.q); } /** * Pass through a too big entry and ensure it is cleared from queues and ramCache. * Manually run the WriterThread. * @throws InterruptedException */ @Test public void testTooBigEntry() throws InterruptedException { Cacheable tooBigCacheable = Mockito.mock(Cacheable.class); Mockito.when(tooBigCacheable.getSerializedLength()).thenReturn(Integer.MAX_VALUE); this.bc.cacheBlock(this.plainKey, tooBigCacheable); doDrainOfOneEntry(this.bc, this.wt, this.q); } /** * Do IOE. Take the RAMQueueEntry that was on the queue, doctor it to throw exception, then * put it back and process it. * @throws IOException * @throws InterruptedException */ @SuppressWarnings("unchecked") @Test (timeout=30000) public void testIOE() throws IOException, InterruptedException { this.bc.cacheBlock(this.plainKey, plainCacheable); RAMQueueEntry rqe = q.remove(); RAMQueueEntry spiedRqe = Mockito.spy(rqe); Mockito.doThrow(new IOException("Mocked!")).when(spiedRqe). writeToCache((IOEngine)Mockito.any(), (BucketAllocator)Mockito.any(), (UniqueIndexMap<Integer>)Mockito.any(), (AtomicLong)Mockito.any()); this.q.add(spiedRqe); doDrainOfOneEntry(bc, wt, q); // Cache disabled when ioes w/o ever healing. assertTrue(!bc.isCacheEnabled()); } /** * Do Cache full exception * @throws IOException * @throws InterruptedException */ @Test (timeout=30000) public void testCacheFullException() throws IOException, InterruptedException { this.bc.cacheBlock(this.plainKey, plainCacheable); RAMQueueEntry rqe = q.remove(); RAMQueueEntry spiedRqe = Mockito.spy(rqe); final CacheFullException cfe = new CacheFullException(0, 0); BucketEntry mockedBucketEntry = Mockito.mock(BucketEntry.class); Mockito.doThrow(cfe). doReturn(mockedBucketEntry). when(spiedRqe).writeToCache((IOEngine)Mockito.any(), (BucketAllocator)Mockito.any(), (UniqueIndexMap<Integer>)Mockito.any(), (AtomicLong)Mockito.any()); this.q.add(spiedRqe); doDrainOfOneEntry(bc, wt, q); } private static void doDrainOfOneEntry(final BucketCache bc, final BucketCache.WriterThread wt, final BlockingQueue<RAMQueueEntry> q) throws InterruptedException { List<RAMQueueEntry> rqes = BucketCache.getRAMQueueEntries(q, new ArrayList<RAMQueueEntry>(1)); wt.doDrain(rqes); assertTrue(q.isEmpty()); assertTrue(bc.ramCache.isEmpty()); assertEquals(0, bc.heapSize()); } }
/* * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.jdbc.metadata; import java.util.Arrays; import javax.sql.DataSource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; /** * Tests for {@link CompositeDataSourcePoolMetadataProvider}. * * @author Stephane Nicoll */ @ExtendWith(MockitoExtension.class) class CompositeDataSourcePoolMetadataProviderTests { @Mock private DataSourcePoolMetadataProvider firstProvider; @Mock private DataSourcePoolMetadata first; @Mock private DataSource firstDataSource; @Mock private DataSourcePoolMetadataProvider secondProvider; @Mock private DataSourcePoolMetadata second; @Mock private DataSource secondDataSource; @Mock private DataSource unknownDataSource; @BeforeEach void setup() { given(this.firstProvider.getDataSourcePoolMetadata(this.firstDataSource)).willReturn(this.first); given(this.firstProvider.getDataSourcePoolMetadata(this.secondDataSource)).willReturn(this.second); } @Test void createWithProviders() { CompositeDataSourcePoolMetadataProvider provider = new CompositeDataSourcePoolMetadataProvider( Arrays.asList(this.firstProvider, this.secondProvider)); assertThat(provider.getDataSourcePoolMetadata(this.firstDataSource)).isSameAs(this.first); assertThat(provider.getDataSourcePoolMetadata(this.secondDataSource)).isSameAs(this.second); assertThat(provider.getDataSourcePoolMetadata(this.unknownDataSource)).isNull(); } }
// Author: mszal@google.com (Michael Szal) package com.google.libwebm.mkvmuxer; import com.google.libwebm.Common; public class Segment extends Common { public enum Mode { None, kLive, kFile }; public static final long kDefaultMaxClusterDuration = 30000000000L; public Segment() { nativePointer = newSegment(); } public long addAudioTrack(int sampleRate, int channels, int number) { return AddAudioTrack(nativePointer, sampleRate, channels, number); } public Chapter addChapter() { long pointer = AddChapter(nativePointer); return new Chapter(pointer); } public boolean addCuePoint(long timestamp, long track) { return AddCuePoint(nativePointer, timestamp, track); } public boolean addFrame(byte[] frame, long trackNumber, long timestampNs, boolean isKey) { return AddFrame(nativePointer, frame, frame.length, trackNumber, timestampNs, isKey); } public boolean addMetadata(byte[] frame, long trackNumber, long timestampNs, long durationNs) { return AddMetadata(nativePointer, frame, frame.length, trackNumber, timestampNs, durationNs); } public Track addTrack(int number) { long pointer = AddTrack(nativePointer, number); return Track.newTrack(pointer); } public long addVideoTrack(int width, int height, int number) { return AddVideoTrack(nativePointer, width, height, number); } public boolean chunking() { return chunking(nativePointer); } public long cuesTrack() { return getCuesTrack(nativePointer); } public boolean cuesTrack(long trackNumber) { return setCuesTrack(nativePointer, trackNumber); } public boolean finalizeSegment() { return Finalize(nativePointer); } public void forceNewClusterOnNextFrame() { ForceNewClusterOnNextFrame(nativePointer); } public Cues getCues() { long pointer = GetCues(nativePointer); return new Cues(pointer); } public SegmentInfo getSegmentInfo() { long pointer = GetSegmentInfo(nativePointer); return new SegmentInfo(pointer); } public Track getTrackByNumber(long trackNumber) { long pointer = GetTrackByNumber(nativePointer, trackNumber); return Track.newTrack(pointer); } public boolean init(IMkvWriter writer) { return Init(nativePointer, writer.getNativePointer()); } public long maxClusterDuration() { return maxClusterDuration(nativePointer); } public long maxClusterSize() { return maxClusterSize(nativePointer); } public Mode mode() { int ordinal = mode(nativePointer); return Mode.values()[ordinal]; } public boolean outputCues() { return outputCues(nativePointer); } public void outputCues(boolean outputCues) { OutputCues(nativePointer, outputCues); } public SegmentInfo segmentInfo() { long pointer = segmentInfo(nativePointer); return new SegmentInfo(pointer); } public void setMaxClusterDuration(long maxClusterDuration) { setMaxClusterDuration(nativePointer, maxClusterDuration); } public void setMaxClusterSize(long maxClusterSize) { setMaxClusterSize(nativePointer, maxClusterSize); } public void setMode(Mode mode) { setMode(nativePointer, mode.ordinal()); } public boolean setChunking(boolean chunking, String filename) { return SetChunking(nativePointer, chunking, filename); } protected Segment(long nativePointer) { super(nativePointer); } @Override protected void deleteObject() { deleteSegment(nativePointer); } private static native long AddAudioTrack(long jSegment, int sample_rate, int channels, int number); private static native long AddChapter(long jSegment); private static native boolean AddCuePoint(long jSegment, long timestamp, long track); private static native boolean AddFrame(long jSegment, byte[] jFrame, long length, long track_number, long timestamp_ns, boolean is_key); private static native boolean AddMetadata(long jSegment, byte[] jFrame, long length, long track_number, long timestamp_ns, long duration_ns); private static native long AddTrack(long jSegment, int number); private static native long AddVideoTrack(long jSegment, int width, int height, int number); private static native boolean chunking(long jSegment); private static native void deleteSegment(long jSegment); private static native boolean Finalize(long jSegment); private static native void ForceNewClusterOnNextFrame(long jSegment); private static native long GetCues(long jSegment); private static native long getCuesTrack(long jSegment); private static native long GetSegmentInfo(long jSegment); private static native long GetTrackByNumber(long jSegment, long track_number); private static native boolean Init(long jSegment, long jWriter); private static native long maxClusterDuration(long jSegment); private static native long maxClusterSize(long jSegment); private static native int mode(long jSegment); private static native long newSegment(); private static native boolean outputCues(long jSegment); private static native void OutputCues(long jSegment, boolean output_cues); private static native long segmentInfo(long jSegment); private static native boolean setCuesTrack(long jSegment, long track_number); private static native void setMaxClusterDuration(long jSegment, long max_cluster_duration); private static native void setMaxClusterSize(long jSegment, long max_cluster_size); private static native void setMode(long jSegment, int mode); private static native boolean SetChunking(long jSegment, boolean chunking, String jFilename); }
class C { String s = "\u00C1\u00EE"; }
// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it. import { lastDayOfISOWeekYear } from 'date-fns' export default lastDayOfISOWeekYear
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # 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. # ============================================================================== """Tests for rmsprop optimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import math from absl.testing import parameterized import numpy as np from tensorflow.contrib.optimizer_v2 import rmsprop from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import test_util from tensorflow.python.ops import embedding_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import resource_variable_ops from tensorflow.python.ops import variables from tensorflow.python.platform import test _DATA_TYPES = [dtypes.half, dtypes.float32] _TEST_PARAM_VALUES = [ # learning_rate, decay, momentum, epsilon, centered, use_resource [0.5, 0.9, 0.0, 1.0, True, False], [0.5, 0.9, 0.0, 1.0, False, False], [0.5, 0.9, 0.0, 1.0, True, True], [0.5, 0.9, 0.0, 1.0, False, True], [0.1, 0.9, 0.0, 1.0, True, False], [0.5, 0.95, 0.0, 1.0, False, False], [0.5, 0.8, 0.0, 1e-3, True, False], [0.5, 0.8, 0.9, 1e-3, True, False], ] class RMSPropOptimizerTest(test.TestCase, parameterized.TestCase): def _rmsprop_update_numpy(self, var, g, mg, rms, mom, lr, decay, momentum, centered): rms_t = rms * decay + (1 - decay) * g * g if centered: mg_t = mg * decay + (1 - decay) * g denom_t = rms_t - mg_t * mg_t else: mg_t = mg denom_t = rms_t mom_t = momentum * mom + lr * g / np.sqrt(denom_t, dtype=denom_t.dtype) var_t = var - mom_t return var_t, mg_t, rms_t, mom_t def _sparse_rmsprop_update_numpy(self, var, gindexs, gvalues, mg, rms, mom, lr, decay, momentum, centered): mg_t = copy.deepcopy(mg) rms_t = copy.deepcopy(rms) mom_t = copy.deepcopy(mom) var_t = copy.deepcopy(var) for i in range(len(gindexs)): gindex = gindexs[i] gvalue = gvalues[i] rms_t[gindex] = rms[gindex] * decay + (1 - decay) * gvalue * gvalue denom_t = rms_t[gindex] if centered: mg_t[gindex] = mg_t[gindex] * decay + (1 - decay) * gvalue denom_t -= mg_t[gindex] * mg_t[gindex] mom_t[gindex] = momentum * mom[gindex] + lr * gvalue / np.sqrt(denom_t) var_t[gindex] = var[gindex] - mom_t[gindex] return var_t, mg_t, rms_t, mom_t @parameterized.named_parameters( *test_util.generate_combinations_with_testcase_name( dtype=_DATA_TYPES, param_value=_TEST_PARAM_VALUES)) def testDense(self, dtype, param_value): (learning_rate, decay, momentum, epsilon, centered, use_resource) = tuple( param_value) with self.session(use_gpu=True): # Initialize variables for numpy implementation. var0_np = np.array([1.0, 2.0], dtype=dtype.as_numpy_dtype) grads0_np = np.array([0.1, 0.2], dtype=dtype.as_numpy_dtype) var1_np = np.array([3.0, 4.0], dtype=dtype.as_numpy_dtype) grads1_np = np.array([0.01, 0.2], dtype=dtype.as_numpy_dtype) if use_resource: var0 = resource_variable_ops.ResourceVariable(var0_np) var1 = resource_variable_ops.ResourceVariable(var1_np) else: var0 = variables.Variable(var0_np) var1 = variables.Variable(var1_np) grads0 = constant_op.constant(grads0_np) grads1 = constant_op.constant(grads1_np) opt = rmsprop.RMSPropOptimizer( learning_rate=learning_rate, decay=decay, momentum=momentum, epsilon=epsilon, centered=centered) update = opt.apply_gradients(zip([grads0, grads1], [var0, var1])) variables.global_variables_initializer().run() mg0 = opt.get_slot(var0, "mg") self.assertEqual(mg0 is not None, centered) mg1 = opt.get_slot(var1, "mg") self.assertEqual(mg1 is not None, centered) rms0 = opt.get_slot(var0, "rms") self.assertIsNotNone(rms0) rms1 = opt.get_slot(var1, "rms") self.assertIsNotNone(rms1) mom0 = opt.get_slot(var0, "momentum") self.assertIsNotNone(mom0) mom1 = opt.get_slot(var1, "momentum") self.assertIsNotNone(mom1) mg0_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) mg1_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) rms0_np = np.array([epsilon, epsilon], dtype=dtype.as_numpy_dtype) rms1_np = np.array([epsilon, epsilon], dtype=dtype.as_numpy_dtype) mom0_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) mom1_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) # Fetch params to validate initial values self.assertAllClose([1.0, 2.0], var0.eval()) self.assertAllClose([3.0, 4.0], var1.eval()) # Run 4 steps of RMSProp for _ in range(4): update.run() var0_np, mg0_np, rms0_np, mom0_np = self._rmsprop_update_numpy( var0_np, grads0_np, mg0_np, rms0_np, mom0_np, learning_rate, decay, momentum, centered) var1_np, mg1_np, rms1_np, mom1_np = self._rmsprop_update_numpy( var1_np, grads1_np, mg1_np, rms1_np, mom1_np, learning_rate, decay, momentum, centered) # Validate updated params if centered: self.assertAllCloseAccordingToType(mg0_np, mg0.eval()) self.assertAllCloseAccordingToType(mg1_np, mg1.eval()) self.assertAllCloseAccordingToType(rms0_np, rms0.eval()) self.assertAllCloseAccordingToType(rms1_np, rms1.eval()) self.assertAllCloseAccordingToType(mom0_np, mom0.eval()) self.assertAllCloseAccordingToType(mom1_np, mom1.eval()) # TODO(b/117393988): Reduce tolerances for float16. self.assertAllCloseAccordingToType( var0_np, var0.eval(), half_rtol=3e-3, half_atol=3e-3) self.assertAllCloseAccordingToType( var1_np, var1.eval(), half_rtol=3e-3, half_atol=3e-3) @parameterized.parameters([dtypes.float32, dtypes.float64]) def testMinimizeSparseResourceVariable(self, dtype): with self.cached_session(): var0 = resource_variable_ops.ResourceVariable([[1.0, 2.0]], dtype=dtype) x = constant_op.constant([[4.0], [5.0]], dtype=dtype) pred = math_ops.matmul(embedding_ops.embedding_lookup([var0], [0]), x) loss = pred * pred sgd_op = rmsprop.RMSPropOptimizer( learning_rate=1.0, decay=0.0, momentum=0.0, epsilon=0.0, centered=False).minimize(loss) variables.global_variables_initializer().run() # Fetch params to validate initial values self.assertAllCloseAccordingToType([[1.0, 2.0]], var0.eval()) # Run 1 step of sgd sgd_op.run() # Validate updated params self.assertAllCloseAccordingToType( [[0., 1.]], var0.eval(), atol=0.01) @parameterized.parameters([dtypes.float32, dtypes.float64]) def testMinimizeSparseResourceVariableCentered(self, dtype): with self.cached_session(): var0 = resource_variable_ops.ResourceVariable([[1.0, 2.0]], dtype=dtype) x = constant_op.constant([[4.0], [5.0]], dtype=dtype) pred = math_ops.matmul(embedding_ops.embedding_lookup([var0], [0]), x) loss = pred * pred sgd_op = rmsprop.RMSPropOptimizer( learning_rate=1.0, decay=0.1, momentum=0.0, epsilon=1.0, centered=True).minimize(loss) variables.global_variables_initializer().run() # Fetch params to validate initial values self.assertAllCloseAccordingToType([[1.0, 2.0]], var0.eval()) # Run 1 step of sgd sgd_op.run() # Validate updated params self.assertAllCloseAccordingToType( [[-7/3.0, -4/3.0]], var0.eval(), atol=0.01) @parameterized.named_parameters( *test_util.generate_combinations_with_testcase_name( dtype=_DATA_TYPES, param_value=_TEST_PARAM_VALUES)) def testSparse(self, dtype, param_value): (learning_rate, decay, momentum, epsilon, centered, _) = tuple( param_value) with self.session(use_gpu=True): # Initialize variables for numpy implementation. var0_np = np.array([1.0, 2.0], dtype=dtype.as_numpy_dtype) grads0_np = np.array([0.1], dtype=dtype.as_numpy_dtype) var1_np = np.array([3.0, 4.0], dtype=dtype.as_numpy_dtype) grads1_np = np.array([0.01], dtype=dtype.as_numpy_dtype) var0 = variables.Variable(var0_np) var1 = variables.Variable(var1_np) grads0_np_indices = np.array([0], dtype=np.int32) grads0 = ops.IndexedSlices( constant_op.constant(grads0_np), constant_op.constant(grads0_np_indices), constant_op.constant([1])) grads1_np_indices = np.array([1], dtype=np.int32) grads1 = ops.IndexedSlices( constant_op.constant(grads1_np), constant_op.constant(grads1_np_indices), constant_op.constant([1])) opt = rmsprop.RMSPropOptimizer( learning_rate=learning_rate, decay=decay, momentum=momentum, epsilon=epsilon, centered=centered) update = opt.apply_gradients(zip([grads0, grads1], [var0, var1])) variables.global_variables_initializer().run() mg0 = opt.get_slot(var0, "mg") self.assertEqual(mg0 is not None, centered) mg1 = opt.get_slot(var1, "mg") self.assertEqual(mg1 is not None, centered) rms0 = opt.get_slot(var0, "rms") self.assertIsNotNone(rms0) rms1 = opt.get_slot(var1, "rms") self.assertIsNotNone(rms1) mom0 = opt.get_slot(var0, "momentum") self.assertIsNotNone(mom0) mom1 = opt.get_slot(var1, "momentum") self.assertIsNotNone(mom1) mg0_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) mg1_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) rms0_np = np.array([epsilon, epsilon], dtype=dtype.as_numpy_dtype) rms1_np = np.array([epsilon, epsilon], dtype=dtype.as_numpy_dtype) mom0_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) mom1_np = np.array([0.0, 0.0], dtype=dtype.as_numpy_dtype) # Fetch params to validate initial values self.assertAllClose([1.0, 2.0], var0.eval()) self.assertAllClose([3.0, 4.0], var1.eval()) # Run 4 steps of RMSProp for _ in range(4): update.run() var0_np, mg0_np, rms0_np, mom0_np = self._sparse_rmsprop_update_numpy( var0_np, grads0_np_indices, grads0_np, mg0_np, rms0_np, mom0_np, learning_rate, decay, momentum, centered) var1_np, mg1_np, rms1_np, mom1_np = self._sparse_rmsprop_update_numpy( var1_np, grads1_np_indices, grads1_np, mg1_np, rms1_np, mom1_np, learning_rate, decay, momentum, centered) # Validate updated params if centered: self.assertAllCloseAccordingToType(mg0_np, mg0.eval()) self.assertAllCloseAccordingToType(mg1_np, mg1.eval()) self.assertAllCloseAccordingToType(rms0_np, rms0.eval()) self.assertAllCloseAccordingToType(rms1_np, rms1.eval()) self.assertAllCloseAccordingToType(mom0_np, mom0.eval()) self.assertAllCloseAccordingToType(mom1_np, mom1.eval()) self.assertAllCloseAccordingToType(var0_np, var0.eval()) self.assertAllCloseAccordingToType(var1_np, var1.eval()) @parameterized.parameters(_DATA_TYPES) def testWithoutMomentum(self, dtype): with self.session(use_gpu=True): var0 = variables.Variable([1.0, 2.0], dtype=dtype) var1 = variables.Variable([3.0, 4.0], dtype=dtype) grads0 = constant_op.constant([0.1, 0.1], dtype=dtype) grads1 = constant_op.constant([0.01, 0.01], dtype=dtype) opt = rmsprop.RMSPropOptimizer( learning_rate=2.0, decay=0.9, momentum=0.0, epsilon=1.0) update = opt.apply_gradients(zip([grads0, grads1], [var0, var1])) variables.global_variables_initializer().run() rms0 = opt.get_slot(var0, "rms") self.assertIsNotNone(rms0) rms1 = opt.get_slot(var1, "rms") self.assertIsNotNone(rms1) mom0 = opt.get_slot(var0, "momentum") self.assertIsNotNone(mom0) mom1 = opt.get_slot(var1, "momentum") self.assertIsNotNone(mom1) # Fetch params to validate initial values self.assertAllClose([1.0, 2.0], var0.eval()) self.assertAllClose([3.0, 4.0], var1.eval()) # Step 1: the rms accumulators where 1. So we should see a normal # update: v -= grad * learning_rate update.run() # Check the root mean square accumulators. self.assertAllCloseAccordingToType( np.array([0.901, 0.901]), rms0.eval()) self.assertAllCloseAccordingToType( np.array([0.90001, 0.90001]), rms1.eval()) # Check the parameters. self.assertAllCloseAccordingToType( np.array([ 1.0 - (0.1 * 2.0 / math.sqrt(0.901)), 2.0 - (0.1 * 2.0 / math.sqrt(0.901)) ]), var0.eval()) self.assertAllCloseAccordingToType( np.array([ 3.0 - (0.01 * 2.0 / math.sqrt(0.90001)), 4.0 - (0.01 * 2.0 / math.sqrt(0.90001)) ]), var1.eval()) # Step 2: the root mean square accumulators contain the previous update. update.run() # Check the rms accumulators. self.assertAllCloseAccordingToType( np.array([0.901 * 0.9 + 0.001, 0.901 * 0.9 + 0.001]), rms0.eval()) self.assertAllCloseAccordingToType( np.array([0.90001 * 0.9 + 1e-5, 0.90001 * 0.9 + 1e-5]), rms1.eval()) # Check the parameters. self.assertAllCloseAccordingToType( np.array([ 1.0 - (0.1 * 2.0 / math.sqrt(0.901)) - (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001)), 2.0 - (0.1 * 2.0 / math.sqrt(0.901)) - (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001)) ]), var0.eval()) self.assertAllCloseAccordingToType( np.array([ 3.0 - (0.01 * 2.0 / math.sqrt(0.90001)) - (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5)), 4.0 - (0.01 * 2.0 / math.sqrt(0.90001)) - (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5)) ]), var1.eval()) @parameterized.parameters(_DATA_TYPES) def testWithMomentum(self, dtype): with self.session(use_gpu=True): var0 = variables.Variable([1.0, 2.0], dtype=dtype) var1 = variables.Variable([3.0, 4.0], dtype=dtype) grads0 = constant_op.constant([0.1, 0.1], dtype=dtype) grads1 = constant_op.constant([0.01, 0.01], dtype=dtype) opt = rmsprop.RMSPropOptimizer( learning_rate=2.0, decay=0.9, momentum=0.5, epsilon=1.0) update = opt.apply_gradients(zip([grads0, grads1], [var0, var1])) variables.global_variables_initializer().run() rms0 = opt.get_slot(var0, "rms") self.assertIsNotNone(rms0) rms1 = opt.get_slot(var1, "rms") self.assertIsNotNone(rms1) mom0 = opt.get_slot(var0, "momentum") self.assertIsNotNone(mom0) mom1 = opt.get_slot(var1, "momentum") self.assertIsNotNone(mom1) # Fetch params to validate initial values self.assertAllClose([1.0, 2.0], var0.eval()) self.assertAllClose([3.0, 4.0], var1.eval()) # Step 1: rms = 1, mom = 0. So we should see a normal # update: v -= grad * learning_rate update.run() # Check the root mean square accumulators. self.assertAllCloseAccordingToType( np.array([0.901, 0.901]), rms0.eval()) self.assertAllCloseAccordingToType( np.array([0.90001, 0.90001]), rms1.eval()) # Check the momentum accumulators self.assertAllCloseAccordingToType( np.array([(0.1 * 2.0 / math.sqrt(0.901)), (0.1 * 2.0 / math.sqrt(0.901))]), mom0.eval()) self.assertAllCloseAccordingToType( np.array([(0.01 * 2.0 / math.sqrt(0.90001)), (0.01 * 2.0 / math.sqrt(0.90001))]), mom1.eval()) # Check that the parameters. self.assertAllCloseAccordingToType( np.array([ 1.0 - (0.1 * 2.0 / math.sqrt(0.901)), 2.0 - (0.1 * 2.0 / math.sqrt(0.901)) ]), var0.eval()) self.assertAllCloseAccordingToType( np.array([ 3.0 - (0.01 * 2.0 / math.sqrt(0.90001)), 4.0 - (0.01 * 2.0 / math.sqrt(0.90001)) ]), var1.eval()) # Step 2: the root mean square accumulators contain the previous update. update.run() # Check the rms accumulators. self.assertAllCloseAccordingToType( np.array([0.901 * 0.9 + 0.001, 0.901 * 0.9 + 0.001]), rms0.eval()) self.assertAllCloseAccordingToType( np.array([0.90001 * 0.9 + 1e-5, 0.90001 * 0.9 + 1e-5]), rms1.eval()) self.assertAllCloseAccordingToType( np.array([ 0.5 * (0.1 * 2.0 / math.sqrt(0.901)) + (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001)), 0.5 * (0.1 * 2.0 / math.sqrt(0.901)) + (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001)) ]), mom0.eval()) self.assertAllCloseAccordingToType( np.array([ 0.5 * (0.01 * 2.0 / math.sqrt(0.90001)) + (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5)), 0.5 * (0.01 * 2.0 / math.sqrt(0.90001)) + (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5)) ]), mom1.eval()) # Check the parameters. self.assertAllCloseAccordingToType( np.array([ 1.0 - (0.1 * 2.0 / math.sqrt(0.901)) - (0.5 * (0.1 * 2.0 / math.sqrt(0.901)) + (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001))), 2.0 - (0.1 * 2.0 / math.sqrt(0.901)) - (0.5 * (0.1 * 2.0 / math.sqrt(0.901)) + (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001))) ]), var0.eval()) self.assertAllCloseAccordingToType( np.array([ 3.0 - (0.01 * 2.0 / math.sqrt(0.90001)) - (0.5 * (0.01 * 2.0 / math.sqrt(0.90001)) + (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5))), 4.0 - (0.01 * 2.0 / math.sqrt(0.90001)) - (0.5 * (0.01 * 2.0 / math.sqrt(0.90001)) + (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5))) ]), var1.eval()) if __name__ == "__main__": test.main()
cask 'routebuddy' do version '4.2.1' sha256 '95d979d775ebfbd5c835150d50c809fdb8f5e29823b54a13deec73b6df21c643' # objects-us-west-1.dream.io/routebuddy was verified as official when first introduced to the cask url "https://objects-us-west-1.dream.io/routebuddy/download/apps2/RouteBuddy_#{version}.dmg" name 'RouteBuddy' homepage 'https://routebuddy.com/' app 'RouteBuddy.app' end
//===-- AMDGPUISelLowering.h - AMDGPU Lowering Interface --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the interface defintiion of the TargetLowering class // that is common to all AMD GPUs. // //===----------------------------------------------------------------------===// #ifndef AMDGPUISELLOWERING_H #define AMDGPUISELLOWERING_H #include "llvm/Target/TargetLowering.h" namespace llvm { class MachineRegisterInfo; class AMDGPUTargetLowering : public TargetLowering { private: SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const; SDValue LowerUDIVREM(SDValue Op, SelectionDAG &DAG) const; protected: /// CreateLiveInRegister - Helper function that adds Reg to the LiveIn list /// of the DAG's MachineFunction. This returns a Register SDNode representing /// Reg. SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC, unsigned Reg, EVT VT) const; bool isHWTrueValue(SDValue Op) const; bool isHWFalseValue(SDValue Op) const; public: AMDGPUTargetLowering(TargetMachine &TM); virtual SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, DebugLoc DL, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const; virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, DebugLoc DL, SelectionDAG &DAG) const; virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const; SDValue LowerIntrinsicIABS(SDValue Op, SelectionDAG &DAG) const; SDValue LowerIntrinsicLRP(SDValue Op, SelectionDAG &DAG) const; virtual const char* getTargetNodeName(unsigned Opcode) const; // Functions defined in AMDILISelLowering.cpp public: /// computeMaskedBitsForTargetNode - Determine which of the bits specified /// in Mask are known to be either zero or one and return them in the /// KnownZero/KnownOne bitsets. virtual void computeMaskedBitsForTargetNode(const SDValue Op, APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth = 0) const; virtual bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, unsigned Intrinsic) const; /// isFPImmLegal - We want to mark f32/f64 floating point values as legal. bool isFPImmLegal(const APFloat &Imm, EVT VT) const; /// ShouldShrinkFPConstant - We don't want to shrink f64/f32 constants. bool ShouldShrinkFPConstant(EVT VT) const; private: void InitAMDILLowering(); SDValue LowerSREM(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSREM8(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSREM16(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSREM32(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSREM64(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSDIV(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSDIV24(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSDIV32(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSDIV64(SDValue Op, SelectionDAG &DAG) const; SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const; EVT genIntType(uint32_t size = 32, uint32_t numEle = 1) const; SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const; }; namespace AMDGPUISD { enum { // AMDIL ISD Opcodes FIRST_NUMBER = ISD::BUILTIN_OP_END, MAD, // 32bit Fused Multiply Add instruction VBUILD, // scalar to vector mov instruction CALL, // Function call based on a single integer UMUL, // 32bit unsigned multiplication DIV_INF, // Divide with infinity returned on zero divisor RET_FLAG, BRANCH_COND, // End AMDIL ISD Opcodes BITALIGN, FRACT, FMAX, SMAX, UMAX, FMIN, SMIN, UMIN, URECIP, LAST_AMDGPU_ISD_NUMBER }; } // End namespace AMDGPUISD namespace SIISD { enum { SI_FIRST = AMDGPUISD::LAST_AMDGPU_ISD_NUMBER, VCC_AND, VCC_BITCAST }; } // End namespace SIISD } // End namespace llvm #endif // AMDGPUISELLOWERING_H
/* Definitions of target machine for GCC for IA-32. Copyright (C) 1988-2013 Free Software Foundation, Inc. This file is part of GCC. GCC 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. GCC 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ /* The purpose of this file is to define the characteristics of the i386, independent of assembler syntax or operating system. Three other files build on this one to describe a specific assembler syntax: bsd386.h, att386.h, and sun386.h. The actual tm.h file for a particular system should include this file, and then the file for the appropriate assembler syntax. Many macros that specify assembler syntax are omitted entirely from this file because they really belong in the files for particular assemblers. These include RP, IP, LPREFIX, PUT_OP_SIZE, USE_STAR, ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many that start with ASM_ or end in ASM_OP. */ /* Redefines for option macros. */ #define TARGET_64BIT TARGET_ISA_64BIT #define TARGET_MMX TARGET_ISA_MMX #define TARGET_3DNOW TARGET_ISA_3DNOW #define TARGET_3DNOW_A TARGET_ISA_3DNOW_A #define TARGET_SSE TARGET_ISA_SSE #define TARGET_SSE2 TARGET_ISA_SSE2 #define TARGET_SSE3 TARGET_ISA_SSE3 #define TARGET_SSSE3 TARGET_ISA_SSSE3 #define TARGET_SSE4_1 TARGET_ISA_SSE4_1 #define TARGET_SSE4_2 TARGET_ISA_SSE4_2 #define TARGET_AVX TARGET_ISA_AVX #define TARGET_AVX2 TARGET_ISA_AVX2 #define TARGET_FMA TARGET_ISA_FMA #define TARGET_SSE4A TARGET_ISA_SSE4A #define TARGET_FMA4 TARGET_ISA_FMA4 #define TARGET_XOP TARGET_ISA_XOP #define TARGET_LWP TARGET_ISA_LWP #define TARGET_ROUND TARGET_ISA_ROUND #define TARGET_ABM TARGET_ISA_ABM #define TARGET_BMI TARGET_ISA_BMI #define TARGET_BMI2 TARGET_ISA_BMI2 #define TARGET_LZCNT TARGET_ISA_LZCNT #define TARGET_TBM TARGET_ISA_TBM #define TARGET_POPCNT TARGET_ISA_POPCNT #define TARGET_SAHF TARGET_ISA_SAHF #define TARGET_MOVBE TARGET_ISA_MOVBE #define TARGET_CRC32 TARGET_ISA_CRC32 #define TARGET_AES TARGET_ISA_AES #define TARGET_PCLMUL TARGET_ISA_PCLMUL #define TARGET_CMPXCHG16B TARGET_ISA_CX16 #define TARGET_FSGSBASE TARGET_ISA_FSGSBASE #define TARGET_RDRND TARGET_ISA_RDRND #define TARGET_F16C TARGET_ISA_F16C #define TARGET_RTM TARGET_ISA_RTM #define TARGET_HLE TARGET_ISA_HLE #define TARGET_RDSEED TARGET_ISA_RDSEED #define TARGET_PRFCHW TARGET_ISA_PRFCHW #define TARGET_ADX TARGET_ISA_ADX #define TARGET_FXSR TARGET_ISA_FXSR #define TARGET_XSAVE TARGET_ISA_XSAVE #define TARGET_XSAVEOPT TARGET_ISA_XSAVEOPT #define TARGET_LP64 TARGET_ABI_64 #define TARGET_X32 TARGET_ABI_X32 /* SSE4.1 defines round instructions */ #define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1 #define TARGET_ISA_ROUND ((ix86_isa_flags & OPTION_MASK_ISA_ROUND) != 0) #include "config/vxworks-dummy.h" #include "config/i386/i386-opts.h" #define MAX_STRINGOP_ALGS 4 /* Specify what algorithm to use for stringops on known size. When size is unknown, the UNKNOWN_SIZE alg is used. When size is known at compile time or estimated via feedback, the SIZE array is walked in order until MAX is greater then the estimate (or -1 means infinity). Corresponding ALG is used then. When NOALIGN is true the code guaranting the alignment of the memory block is skipped. For example initializer: {{256, loop}, {-1, rep_prefix_4_byte}} will use loop for blocks smaller or equal to 256 bytes, rep prefix will be used otherwise. */ struct stringop_algs { const enum stringop_alg unknown_size; const struct stringop_strategy { const int max; const enum stringop_alg alg; int noalign; } size [MAX_STRINGOP_ALGS]; }; /* Define the specific costs for a given cpu */ struct processor_costs { const int add; /* cost of an add instruction */ const int lea; /* cost of a lea instruction */ const int shift_var; /* variable shift costs */ const int shift_const; /* constant shift costs */ const int mult_init[5]; /* cost of starting a multiply in QImode, HImode, SImode, DImode, TImode*/ const int mult_bit; /* cost of multiply per each bit set */ const int divide[5]; /* cost of a divide/mod in QImode, HImode, SImode, DImode, TImode*/ int movsx; /* The cost of movsx operation. */ int movzx; /* The cost of movzx operation. */ const int large_insn; /* insns larger than this cost more */ const int move_ratio; /* The threshold of number of scalar memory-to-memory move insns. */ const int movzbl_load; /* cost of loading using movzbl */ const int int_load[3]; /* cost of loading integer registers in QImode, HImode and SImode relative to reg-reg move (2). */ const int int_store[3]; /* cost of storing integer register in QImode, HImode and SImode */ const int fp_move; /* cost of reg,reg fld/fst */ const int fp_load[3]; /* cost of loading FP register in SFmode, DFmode and XFmode */ const int fp_store[3]; /* cost of storing FP register in SFmode, DFmode and XFmode */ const int mmx_move; /* cost of moving MMX register. */ const int mmx_load[2]; /* cost of loading MMX register in SImode and DImode */ const int mmx_store[2]; /* cost of storing MMX register in SImode and DImode */ const int sse_move; /* cost of moving SSE register. */ const int sse_load[3]; /* cost of loading SSE register in SImode, DImode and TImode*/ const int sse_store[3]; /* cost of storing SSE register in SImode, DImode and TImode*/ const int mmxsse_to_integer; /* cost of moving mmxsse register to integer and vice versa. */ const int l1_cache_size; /* size of l1 cache, in kilobytes. */ const int l2_cache_size; /* size of l2 cache, in kilobytes. */ const int prefetch_block; /* bytes moved to cache for prefetch. */ const int simultaneous_prefetches; /* number of parallel prefetch operations. */ const int branch_cost; /* Default value for BRANCH_COST. */ const int fadd; /* cost of FADD and FSUB instructions. */ const int fmul; /* cost of FMUL instruction. */ const int fdiv; /* cost of FDIV instruction. */ const int fabs; /* cost of FABS instruction. */ const int fchs; /* cost of FCHS instruction. */ const int fsqrt; /* cost of FSQRT instruction. */ /* Specify what algorithm to use for stringops on unknown size. */ struct stringop_algs memcpy[2], memset[2]; const int scalar_stmt_cost; /* Cost of any scalar operation, excluding load and store. */ const int scalar_load_cost; /* Cost of scalar load. */ const int scalar_store_cost; /* Cost of scalar store. */ const int vec_stmt_cost; /* Cost of any vector operation, excluding load, store, vector-to-scalar and scalar-to-vector operation. */ const int vec_to_scalar_cost; /* Cost of vect-to-scalar operation. */ const int scalar_to_vec_cost; /* Cost of scalar-to-vector operation. */ const int vec_align_load_cost; /* Cost of aligned vector load. */ const int vec_unalign_load_cost; /* Cost of unaligned vector load. */ const int vec_store_cost; /* Cost of vector store. */ const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer cost model. */ const int cond_not_taken_branch_cost;/* Cost of not taken branch for vectorizer cost model. */ }; extern const struct processor_costs *ix86_cost; extern const struct processor_costs ix86_size_cost; #define ix86_cur_cost() \ (optimize_insn_for_size_p () ? &ix86_size_cost: ix86_cost) /* Macros used in the machine description to test the flags. */ /* configure can arrange to make this 2, to force a 486. */ #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_generic #endif #ifndef TARGET_FPMATH_DEFAULT #define TARGET_FPMATH_DEFAULT \ (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387) #endif #define TARGET_FLOAT_RETURNS_IN_80387 TARGET_FLOAT_RETURNS /* 64bit Sledgehammer mode. For libgcc2 we make sure this is a compile-time constant. */ #ifdef IN_LIBGCC2 #undef TARGET_64BIT #ifdef __x86_64__ #define TARGET_64BIT 1 #else #define TARGET_64BIT 0 #endif #else #ifndef TARGET_BI_ARCH #undef TARGET_64BIT #if TARGET_64BIT_DEFAULT #define TARGET_64BIT 1 #else #define TARGET_64BIT 0 #endif #endif #endif #define HAS_LONG_COND_BRANCH 1 #define HAS_LONG_UNCOND_BRANCH 1 #define TARGET_386 (ix86_tune == PROCESSOR_I386) #define TARGET_486 (ix86_tune == PROCESSOR_I486) #define TARGET_PENTIUM (ix86_tune == PROCESSOR_PENTIUM) #define TARGET_PENTIUMPRO (ix86_tune == PROCESSOR_PENTIUMPRO) #define TARGET_GEODE (ix86_tune == PROCESSOR_GEODE) #define TARGET_K6 (ix86_tune == PROCESSOR_K6) #define TARGET_ATHLON (ix86_tune == PROCESSOR_ATHLON) #define TARGET_PENTIUM4 (ix86_tune == PROCESSOR_PENTIUM4) #define TARGET_K8 (ix86_tune == PROCESSOR_K8) #define TARGET_ATHLON_K8 (TARGET_K8 || TARGET_ATHLON) #define TARGET_NOCONA (ix86_tune == PROCESSOR_NOCONA) #define TARGET_CORE2 (ix86_tune == PROCESSOR_CORE2) #define TARGET_COREI7 (ix86_tune == PROCESSOR_COREI7) #define TARGET_HASWELL (ix86_tune == PROCESSOR_HASWELL) #define TARGET_GENERIC32 (ix86_tune == PROCESSOR_GENERIC32) #define TARGET_GENERIC64 (ix86_tune == PROCESSOR_GENERIC64) #define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64) #define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10) #define TARGET_BDVER1 (ix86_tune == PROCESSOR_BDVER1) #define TARGET_BDVER2 (ix86_tune == PROCESSOR_BDVER2) #define TARGET_BDVER3 (ix86_tune == PROCESSOR_BDVER3) #define TARGET_BTVER1 (ix86_tune == PROCESSOR_BTVER1) #define TARGET_BTVER2 (ix86_tune == PROCESSOR_BTVER2) #define TARGET_ATOM (ix86_tune == PROCESSOR_ATOM) /* Feature tests against the various tunings. */ enum ix86_tune_indices { X86_TUNE_USE_LEAVE, X86_TUNE_PUSH_MEMORY, X86_TUNE_ZERO_EXTEND_WITH_AND, X86_TUNE_UNROLL_STRLEN, X86_TUNE_BRANCH_PREDICTION_HINTS, X86_TUNE_DOUBLE_WITH_ADD, X86_TUNE_USE_SAHF, X86_TUNE_MOVX, X86_TUNE_PARTIAL_REG_STALL, X86_TUNE_PARTIAL_FLAG_REG_STALL, X86_TUNE_LCP_STALL, X86_TUNE_USE_HIMODE_FIOP, X86_TUNE_USE_SIMODE_FIOP, X86_TUNE_USE_MOV0, X86_TUNE_USE_CLTD, X86_TUNE_USE_XCHGB, X86_TUNE_SPLIT_LONG_MOVES, X86_TUNE_READ_MODIFY_WRITE, X86_TUNE_READ_MODIFY, X86_TUNE_PROMOTE_QIMODE, X86_TUNE_FAST_PREFIX, X86_TUNE_SINGLE_STRINGOP, X86_TUNE_QIMODE_MATH, X86_TUNE_HIMODE_MATH, X86_TUNE_PROMOTE_QI_REGS, X86_TUNE_PROMOTE_HI_REGS, X86_TUNE_SINGLE_POP, X86_TUNE_DOUBLE_POP, X86_TUNE_SINGLE_PUSH, X86_TUNE_DOUBLE_PUSH, X86_TUNE_INTEGER_DFMODE_MOVES, X86_TUNE_PARTIAL_REG_DEPENDENCY, X86_TUNE_SSE_PARTIAL_REG_DEPENDENCY, X86_TUNE_SSE_UNALIGNED_LOAD_OPTIMAL, X86_TUNE_SSE_UNALIGNED_STORE_OPTIMAL, X86_TUNE_SSE_PACKED_SINGLE_INSN_OPTIMAL, X86_TUNE_SSE_SPLIT_REGS, X86_TUNE_SSE_TYPELESS_STORES, X86_TUNE_SSE_LOAD0_BY_PXOR, X86_TUNE_MEMORY_MISMATCH_STALL, X86_TUNE_PROLOGUE_USING_MOVE, X86_TUNE_EPILOGUE_USING_MOVE, X86_TUNE_SHIFT1, X86_TUNE_USE_FFREEP, X86_TUNE_INTER_UNIT_MOVES, X86_TUNE_INTER_UNIT_CONVERSIONS, X86_TUNE_FOUR_JUMP_LIMIT, X86_TUNE_SCHEDULE, X86_TUNE_USE_BT, X86_TUNE_USE_INCDEC, X86_TUNE_PAD_RETURNS, X86_TUNE_PAD_SHORT_FUNCTION, X86_TUNE_EXT_80387_CONSTANTS, X86_TUNE_AVOID_VECTOR_DECODE, X86_TUNE_PROMOTE_HIMODE_IMUL, X86_TUNE_SLOW_IMUL_IMM32_MEM, X86_TUNE_SLOW_IMUL_IMM8, X86_TUNE_MOVE_M1_VIA_OR, X86_TUNE_NOT_UNPAIRABLE, X86_TUNE_NOT_VECTORMODE, X86_TUNE_USE_VECTOR_FP_CONVERTS, X86_TUNE_USE_VECTOR_CONVERTS, X86_TUNE_FUSE_CMP_AND_BRANCH, X86_TUNE_OPT_AGU, X86_TUNE_VECTORIZE_DOUBLE, X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL, X86_TUNE_AVX128_OPTIMAL, X86_TUNE_REASSOC_INT_TO_PARALLEL, X86_TUNE_REASSOC_FP_TO_PARALLEL, X86_TUNE_GENERAL_REGS_SSE_SPILL, X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE, X86_TUNE_LAST }; extern unsigned char ix86_tune_features[X86_TUNE_LAST]; #define TARGET_USE_LEAVE ix86_tune_features[X86_TUNE_USE_LEAVE] #define TARGET_PUSH_MEMORY ix86_tune_features[X86_TUNE_PUSH_MEMORY] #define TARGET_ZERO_EXTEND_WITH_AND \ ix86_tune_features[X86_TUNE_ZERO_EXTEND_WITH_AND] #define TARGET_UNROLL_STRLEN ix86_tune_features[X86_TUNE_UNROLL_STRLEN] #define TARGET_BRANCH_PREDICTION_HINTS \ ix86_tune_features[X86_TUNE_BRANCH_PREDICTION_HINTS] #define TARGET_DOUBLE_WITH_ADD ix86_tune_features[X86_TUNE_DOUBLE_WITH_ADD] #define TARGET_USE_SAHF ix86_tune_features[X86_TUNE_USE_SAHF] #define TARGET_MOVX ix86_tune_features[X86_TUNE_MOVX] #define TARGET_PARTIAL_REG_STALL ix86_tune_features[X86_TUNE_PARTIAL_REG_STALL] #define TARGET_PARTIAL_FLAG_REG_STALL \ ix86_tune_features[X86_TUNE_PARTIAL_FLAG_REG_STALL] #define TARGET_LCP_STALL \ ix86_tune_features[X86_TUNE_LCP_STALL] #define TARGET_USE_HIMODE_FIOP ix86_tune_features[X86_TUNE_USE_HIMODE_FIOP] #define TARGET_USE_SIMODE_FIOP ix86_tune_features[X86_TUNE_USE_SIMODE_FIOP] #define TARGET_USE_MOV0 ix86_tune_features[X86_TUNE_USE_MOV0] #define TARGET_USE_CLTD ix86_tune_features[X86_TUNE_USE_CLTD] #define TARGET_USE_XCHGB ix86_tune_features[X86_TUNE_USE_XCHGB] #define TARGET_SPLIT_LONG_MOVES ix86_tune_features[X86_TUNE_SPLIT_LONG_MOVES] #define TARGET_READ_MODIFY_WRITE ix86_tune_features[X86_TUNE_READ_MODIFY_WRITE] #define TARGET_READ_MODIFY ix86_tune_features[X86_TUNE_READ_MODIFY] #define TARGET_PROMOTE_QImode ix86_tune_features[X86_TUNE_PROMOTE_QIMODE] #define TARGET_FAST_PREFIX ix86_tune_features[X86_TUNE_FAST_PREFIX] #define TARGET_SINGLE_STRINGOP ix86_tune_features[X86_TUNE_SINGLE_STRINGOP] #define TARGET_QIMODE_MATH ix86_tune_features[X86_TUNE_QIMODE_MATH] #define TARGET_HIMODE_MATH ix86_tune_features[X86_TUNE_HIMODE_MATH] #define TARGET_PROMOTE_QI_REGS ix86_tune_features[X86_TUNE_PROMOTE_QI_REGS] #define TARGET_PROMOTE_HI_REGS ix86_tune_features[X86_TUNE_PROMOTE_HI_REGS] #define TARGET_SINGLE_POP ix86_tune_features[X86_TUNE_SINGLE_POP] #define TARGET_DOUBLE_POP ix86_tune_features[X86_TUNE_DOUBLE_POP] #define TARGET_SINGLE_PUSH ix86_tune_features[X86_TUNE_SINGLE_PUSH] #define TARGET_DOUBLE_PUSH ix86_tune_features[X86_TUNE_DOUBLE_PUSH] #define TARGET_INTEGER_DFMODE_MOVES \ ix86_tune_features[X86_TUNE_INTEGER_DFMODE_MOVES] #define TARGET_PARTIAL_REG_DEPENDENCY \ ix86_tune_features[X86_TUNE_PARTIAL_REG_DEPENDENCY] #define TARGET_SSE_PARTIAL_REG_DEPENDENCY \ ix86_tune_features[X86_TUNE_SSE_PARTIAL_REG_DEPENDENCY] #define TARGET_SSE_UNALIGNED_LOAD_OPTIMAL \ ix86_tune_features[X86_TUNE_SSE_UNALIGNED_LOAD_OPTIMAL] #define TARGET_SSE_UNALIGNED_STORE_OPTIMAL \ ix86_tune_features[X86_TUNE_SSE_UNALIGNED_STORE_OPTIMAL] #define TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL \ ix86_tune_features[X86_TUNE_SSE_PACKED_SINGLE_INSN_OPTIMAL] #define TARGET_SSE_SPLIT_REGS ix86_tune_features[X86_TUNE_SSE_SPLIT_REGS] #define TARGET_SSE_TYPELESS_STORES \ ix86_tune_features[X86_TUNE_SSE_TYPELESS_STORES] #define TARGET_SSE_LOAD0_BY_PXOR ix86_tune_features[X86_TUNE_SSE_LOAD0_BY_PXOR] #define TARGET_MEMORY_MISMATCH_STALL \ ix86_tune_features[X86_TUNE_MEMORY_MISMATCH_STALL] #define TARGET_PROLOGUE_USING_MOVE \ ix86_tune_features[X86_TUNE_PROLOGUE_USING_MOVE] #define TARGET_EPILOGUE_USING_MOVE \ ix86_tune_features[X86_TUNE_EPILOGUE_USING_MOVE] #define TARGET_SHIFT1 ix86_tune_features[X86_TUNE_SHIFT1] #define TARGET_USE_FFREEP ix86_tune_features[X86_TUNE_USE_FFREEP] #define TARGET_INTER_UNIT_MOVES ix86_tune_features[X86_TUNE_INTER_UNIT_MOVES] #define TARGET_INTER_UNIT_CONVERSIONS\ ix86_tune_features[X86_TUNE_INTER_UNIT_CONVERSIONS] #define TARGET_FOUR_JUMP_LIMIT ix86_tune_features[X86_TUNE_FOUR_JUMP_LIMIT] #define TARGET_SCHEDULE ix86_tune_features[X86_TUNE_SCHEDULE] #define TARGET_USE_BT ix86_tune_features[X86_TUNE_USE_BT] #define TARGET_USE_INCDEC ix86_tune_features[X86_TUNE_USE_INCDEC] #define TARGET_PAD_RETURNS ix86_tune_features[X86_TUNE_PAD_RETURNS] #define TARGET_PAD_SHORT_FUNCTION \ ix86_tune_features[X86_TUNE_PAD_SHORT_FUNCTION] #define TARGET_EXT_80387_CONSTANTS \ ix86_tune_features[X86_TUNE_EXT_80387_CONSTANTS] #define TARGET_AVOID_VECTOR_DECODE \ ix86_tune_features[X86_TUNE_AVOID_VECTOR_DECODE] #define TARGET_TUNE_PROMOTE_HIMODE_IMUL \ ix86_tune_features[X86_TUNE_PROMOTE_HIMODE_IMUL] #define TARGET_SLOW_IMUL_IMM32_MEM \ ix86_tune_features[X86_TUNE_SLOW_IMUL_IMM32_MEM] #define TARGET_SLOW_IMUL_IMM8 ix86_tune_features[X86_TUNE_SLOW_IMUL_IMM8] #define TARGET_MOVE_M1_VIA_OR ix86_tune_features[X86_TUNE_MOVE_M1_VIA_OR] #define TARGET_NOT_UNPAIRABLE ix86_tune_features[X86_TUNE_NOT_UNPAIRABLE] #define TARGET_NOT_VECTORMODE ix86_tune_features[X86_TUNE_NOT_VECTORMODE] #define TARGET_USE_VECTOR_FP_CONVERTS \ ix86_tune_features[X86_TUNE_USE_VECTOR_FP_CONVERTS] #define TARGET_USE_VECTOR_CONVERTS \ ix86_tune_features[X86_TUNE_USE_VECTOR_CONVERTS] #define TARGET_FUSE_CMP_AND_BRANCH \ ix86_tune_features[X86_TUNE_FUSE_CMP_AND_BRANCH] #define TARGET_OPT_AGU ix86_tune_features[X86_TUNE_OPT_AGU] #define TARGET_VECTORIZE_DOUBLE \ ix86_tune_features[X86_TUNE_VECTORIZE_DOUBLE] #define TARGET_SOFTWARE_PREFETCHING_BENEFICIAL \ ix86_tune_features[X86_TUNE_SOFTWARE_PREFETCHING_BENEFICIAL] #define TARGET_AVX128_OPTIMAL \ ix86_tune_features[X86_TUNE_AVX128_OPTIMAL] #define TARGET_REASSOC_INT_TO_PARALLEL \ ix86_tune_features[X86_TUNE_REASSOC_INT_TO_PARALLEL] #define TARGET_REASSOC_FP_TO_PARALLEL \ ix86_tune_features[X86_TUNE_REASSOC_FP_TO_PARALLEL] #define TARGET_GENERAL_REGS_SSE_SPILL \ ix86_tune_features[X86_TUNE_GENERAL_REGS_SSE_SPILL] #define TARGET_AVOID_MEM_OPND_FOR_CMOVE \ ix86_tune_features[X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE] /* Feature tests against the various architecture variations. */ enum ix86_arch_indices { X86_ARCH_CMOV, X86_ARCH_CMPXCHG, X86_ARCH_CMPXCHG8B, X86_ARCH_XADD, X86_ARCH_BSWAP, X86_ARCH_LAST }; extern unsigned char ix86_arch_features[X86_ARCH_LAST]; #define TARGET_CMOV ix86_arch_features[X86_ARCH_CMOV] #define TARGET_CMPXCHG ix86_arch_features[X86_ARCH_CMPXCHG] #define TARGET_CMPXCHG8B ix86_arch_features[X86_ARCH_CMPXCHG8B] #define TARGET_XADD ix86_arch_features[X86_ARCH_XADD] #define TARGET_BSWAP ix86_arch_features[X86_ARCH_BSWAP] /* For sane SSE instruction set generation we need fcomi instruction. It is safe to enable all CMOVE instructions. Also, RDRAND intrinsic expands to a sequence that includes conditional move. */ #define TARGET_CMOVE (TARGET_CMOV || TARGET_SSE || TARGET_RDRND) #define TARGET_FISTTP (TARGET_SSE3 && TARGET_80387) extern unsigned char x86_prefetch_sse; #define TARGET_PREFETCH_SSE x86_prefetch_sse #define ASSEMBLER_DIALECT (ix86_asm_dialect) #define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0) #define TARGET_MIX_SSE_I387 \ ((ix86_fpmath & (FPMATH_SSE | FPMATH_387)) == (FPMATH_SSE | FPMATH_387)) #define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU) #define TARGET_GNU2_TLS (ix86_tls_dialect == TLS_DIALECT_GNU2) #define TARGET_ANY_GNU_TLS (TARGET_GNU_TLS || TARGET_GNU2_TLS) #define TARGET_SUN_TLS 0 #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 #endif #ifndef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0 #endif /* Fence to use after loop using storent. */ extern tree x86_mfence; #define FENCE_FOLLOWING_MOVNT x86_mfence /* Once GDB has been enhanced to deal with functions without frame pointers, we can change this to allow for elimination of the frame pointer in leaf functions. */ #define TARGET_DEFAULT 0 /* Extra bits to force. */ #define TARGET_SUBTARGET_DEFAULT 0 #define TARGET_SUBTARGET_ISA_DEFAULT 0 /* Extra bits to force on w/ 32-bit mode. */ #define TARGET_SUBTARGET32_DEFAULT 0 #define TARGET_SUBTARGET32_ISA_DEFAULT 0 /* Extra bits to force on w/ 64-bit mode. */ #define TARGET_SUBTARGET64_DEFAULT 0 #define TARGET_SUBTARGET64_ISA_DEFAULT 0 /* Replace MACH-O, ifdefs by in-line tests, where possible. (a) Macros defined in config/i386/darwin.h */ #define TARGET_MACHO 0 #define TARGET_MACHO_BRANCH_ISLANDS 0 #define MACHOPIC_ATT_STUB 0 /* (b) Macros defined in config/darwin.h */ #define MACHO_DYNAMIC_NO_PIC_P 0 #define MACHOPIC_INDIRECT 0 #define MACHOPIC_PURE 0 /* For the RDOS */ #define TARGET_RDOS 0 /* For the Windows 64-bit ABI. */ #define TARGET_64BIT_MS_ABI (TARGET_64BIT && ix86_cfun_abi () == MS_ABI) /* For the Windows 32-bit ABI. */ #define TARGET_32BIT_MS_ABI (!TARGET_64BIT && ix86_cfun_abi () == MS_ABI) /* This is re-defined by cygming.h. */ #define TARGET_SEH 0 /* The default abi used by target. */ #define DEFAULT_ABI SYSV_ABI /* Subtargets may reset this to 1 in order to enable 96-bit long double with the rounding mode forced to 53 bits. */ #define TARGET_96_ROUND_53_LONG_DOUBLE 0 /* -march=native handling only makes sense with compiler running on an x86 or x86_64 chip. If changing this condition, also change the condition in driver-i386.c. */ #if defined(__i386__) || defined(__x86_64__) /* In driver-i386.c. */ extern const char *host_detect_local_cpu (int argc, const char **argv); #define EXTRA_SPEC_FUNCTIONS \ { "local_cpu_detect", host_detect_local_cpu }, #define HAVE_LOCAL_CPU_DETECT #endif #if TARGET_64BIT_DEFAULT #define OPT_ARCH64 "!m32" #define OPT_ARCH32 "m32" #else #define OPT_ARCH64 "m64|mx32" #define OPT_ARCH32 "m64|mx32:;" #endif /* Support for configure-time defaults of some command line options. The order here is important so that -march doesn't squash the tune or cpu values. */ #define OPTION_DEFAULT_SPECS \ {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \ {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \ {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ {"cpu_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \ {"cpu_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}}" }, \ {"arch", "%{!march=*:-march=%(VALUE)}"}, \ {"arch_32", "%{" OPT_ARCH32 ":%{!march=*:-march=%(VALUE)}}"}, \ {"arch_64", "%{" OPT_ARCH64 ":%{!march=*:-march=%(VALUE)}}"}, /* Specs for the compiler proper */ #ifndef CC1_CPU_SPEC #define CC1_CPU_SPEC_1 "" #ifndef HAVE_LOCAL_CPU_DETECT #define CC1_CPU_SPEC CC1_CPU_SPEC_1 #else #define CC1_CPU_SPEC CC1_CPU_SPEC_1 \ "%{march=native:%>march=native %:local_cpu_detect(arch) \ %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)}} \ %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}" #endif #endif /* Target CPU builtins. */ #define TARGET_CPU_CPP_BUILTINS() ix86_target_macros () /* Target Pragmas. */ #define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas () enum target_cpu_default { TARGET_CPU_DEFAULT_generic = 0, TARGET_CPU_DEFAULT_i386, TARGET_CPU_DEFAULT_i486, TARGET_CPU_DEFAULT_pentium, TARGET_CPU_DEFAULT_pentium_mmx, TARGET_CPU_DEFAULT_pentiumpro, TARGET_CPU_DEFAULT_pentium2, TARGET_CPU_DEFAULT_pentium3, TARGET_CPU_DEFAULT_pentium4, TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_prescott, TARGET_CPU_DEFAULT_nocona, TARGET_CPU_DEFAULT_core2, TARGET_CPU_DEFAULT_corei7, TARGET_CPU_DEFAULT_haswell, TARGET_CPU_DEFAULT_atom, TARGET_CPU_DEFAULT_geode, TARGET_CPU_DEFAULT_k6, TARGET_CPU_DEFAULT_k6_2, TARGET_CPU_DEFAULT_k6_3, TARGET_CPU_DEFAULT_athlon, TARGET_CPU_DEFAULT_athlon_sse, TARGET_CPU_DEFAULT_k8, TARGET_CPU_DEFAULT_amdfam10, TARGET_CPU_DEFAULT_bdver1, TARGET_CPU_DEFAULT_bdver2, TARGET_CPU_DEFAULT_bdver3, TARGET_CPU_DEFAULT_btver1, TARGET_CPU_DEFAULT_btver2, TARGET_CPU_DEFAULT_max }; #ifndef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) " #endif /* This macro defines names of additional specifications to put in the specs that can be used in various specifications like CC1_SPEC. Its definition is an initializer with a subgrouping for each command option. Each subgrouping contains a string constant, that defines the specification name, and a string constant that used by the GCC driver program. Do not define this macro if it does not need to do anything. */ #ifndef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS #endif #define EXTRA_SPECS \ { "cc1_cpu", CC1_CPU_SPEC }, \ SUBTARGET_EXTRA_SPECS /* Set the value of FLT_EVAL_METHOD in float.h. When using only the FPU, assume that the fpcw is set to extended precision; when using only SSE, rounding is correct; when using both SSE and the FPU, the rounding precision is indeterminate, since either may be chosen apparently at random. */ #define TARGET_FLT_EVAL_METHOD \ (TARGET_MIX_SSE_I387 ? -1 : TARGET_SSE_MATH ? 0 : 2) /* Whether to allow x87 floating-point arithmetic on MODE (one of SFmode, DFmode and XFmode) in the current excess precision configuration. */ #define X87_ENABLE_ARITH(MODE) \ (flag_excess_precision == EXCESS_PRECISION_FAST || (MODE) == XFmode) /* Likewise, whether to allow direct conversions from integer mode IMODE (HImode, SImode or DImode) to MODE. */ #define X87_ENABLE_FLOAT(MODE, IMODE) \ (flag_excess_precision == EXCESS_PRECISION_FAST \ || (MODE) == XFmode \ || ((MODE) == DFmode && (IMODE) == SImode) \ || (IMODE) == HImode) /* target machine storage layout */ #define SHORT_TYPE_SIZE 16 #define INT_TYPE_SIZE 32 #define LONG_TYPE_SIZE (TARGET_X32 ? 32 : BITS_PER_WORD) #define POINTER_SIZE (TARGET_X32 ? 32 : BITS_PER_WORD) #define LONG_LONG_TYPE_SIZE 64 #define FLOAT_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 64 #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_64 ? 64 : 80) /* Define this to set long double type size to use in libgcc2.c, which can not depend on target_flags. */ #ifdef __LONG_DOUBLE_64__ #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 #else #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80 #endif #define WIDEST_HARDWARE_FP_SIZE 80 #if defined (TARGET_BI_ARCH) || TARGET_64BIT_DEFAULT #define MAX_BITS_PER_WORD 64 #else #define MAX_BITS_PER_WORD 32 #endif /* Define this if most significant byte of a word is the lowest numbered. */ /* That is true on the 80386. */ #define BITS_BIG_ENDIAN 0 /* Define this if most significant byte of a word is the lowest numbered. */ /* That is not true on the 80386. */ #define BYTES_BIG_ENDIAN 0 /* Define this if most significant word of a multiword number is the lowest numbered. */ /* Not true for 80386 */ #define WORDS_BIG_ENDIAN 0 /* Width of a word, in units (bytes). */ #define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4) #ifndef IN_LIBGCC2 #define MIN_UNITS_PER_WORD 4 #endif /* Allocation boundary (in *bits*) for storing arguments in argument list. */ #define PARM_BOUNDARY BITS_PER_WORD /* Boundary (in *bits*) on which stack pointer should be aligned. */ #define STACK_BOUNDARY \ (TARGET_64BIT && ix86_abi == MS_ABI ? 128 : BITS_PER_WORD) /* Stack boundary of the main function guaranteed by OS. */ #define MAIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32) /* Minimum stack boundary. */ #define MIN_STACK_BOUNDARY (TARGET_64BIT ? (TARGET_SSE ? 128 : 64) : 32) /* Boundary (in *bits*) on which the stack pointer prefers to be aligned; the compiler cannot rely on having this alignment. */ #define PREFERRED_STACK_BOUNDARY ix86_preferred_stack_boundary /* It should be MIN_STACK_BOUNDARY. But we set it to 128 bits for both 32bit and 64bit, to support codes that need 128 bit stack alignment for SSE instructions, but can't realign the stack. */ #define PREFERRED_STACK_BOUNDARY_DEFAULT 128 /* 1 if -mstackrealign should be turned on by default. It will generate an alternate prologue and epilogue that realigns the runtime stack if nessary. This supports mixing codes that keep a 4-byte aligned stack, as specified by i386 psABI, with codes that need a 16-byte aligned stack, as required by SSE instructions. */ #define STACK_REALIGN_DEFAULT 0 /* Boundary (in *bits*) on which the incoming stack is aligned. */ #define INCOMING_STACK_BOUNDARY ix86_incoming_stack_boundary /* According to Windows x64 software convention, the maximum stack allocatable in the prologue is 4G - 8 bytes. Furthermore, there is a limited set of instructions allowed to adjust the stack pointer in the epilog, forcing the use of frame pointer for frames larger than 2 GB. This theorical limit is reduced by 256, an over-estimated upper bound for the stack use by the prologue. We define only one threshold for both the prolog and the epilog. When the frame size is larger than this threshold, we allocate the area to save SSE regs, then save them, and then allocate the remaining. There is no SEH unwind info for this later allocation. */ #define SEH_MAX_FRAME_SIZE ((2U << 30) - 256) /* Target OS keeps a vector-aligned (128-bit, 16-byte) stack. This is mandatory for the 64-bit ABI, and may or may not be true for other operating systems. */ #define TARGET_KEEPS_VECTOR_ALIGNED_STACK TARGET_64BIT /* Minimum allocation boundary for the code of a function. */ #define FUNCTION_BOUNDARY 8 /* C++ stores the virtual bit in the lowest bit of function pointers. */ #define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_pfn /* Minimum size in bits of the largest boundary to which any and all fundamental data types supported by the hardware might need to be aligned. No data type wants to be aligned rounder than this. Pentium+ prefers DFmode values to be aligned to 64 bit boundary and Pentium Pro XFmode values at 128 bit boundaries. */ #define BIGGEST_ALIGNMENT (TARGET_AVX ? 256 : 128) /* Maximum stack alignment. */ #define MAX_STACK_ALIGNMENT MAX_OFILE_ALIGNMENT /* Alignment value for attribute ((aligned)). It is a constant since it is the part of the ABI. We shouldn't change it with -mavx. */ #define ATTRIBUTE_ALIGNED_VALUE 128 /* Decide whether a variable of mode MODE should be 128 bit aligned. */ #define ALIGN_MODE_128(MODE) \ ((MODE) == XFmode || SSE_REG_MODE_P (MODE)) /* The published ABIs say that doubles should be aligned on word boundaries, so lower the alignment for structure fields unless -malign-double is set. */ /* ??? Blah -- this macro is used directly by libobjc. Since it supports no vector modes, cut out the complexity and fall back on BIGGEST_FIELD_ALIGNMENT. */ #ifdef IN_TARGET_LIBS #ifdef __x86_64__ #define BIGGEST_FIELD_ALIGNMENT 128 #else #define BIGGEST_FIELD_ALIGNMENT 32 #endif #else #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ x86_field_alignment (FIELD, COMPUTED) #endif /* If defined, a C expression to compute the alignment given to a constant that is being placed in memory. EXP is the constant and ALIGN is the alignment that the object would ordinarily have. The value of this macro is used instead of that alignment to align the object. If this macro is not defined, then ALIGN is used. The typical use of this macro is to increase alignment for string constants to be word aligned so that `strcpy' calls that copy constants can be done inline. */ #define CONSTANT_ALIGNMENT(EXP, ALIGN) ix86_constant_alignment ((EXP), (ALIGN)) /* If defined, a C expression to compute the alignment for a static variable. TYPE is the data type, and ALIGN is the alignment that the object would ordinarily have. The value of this macro is used instead of that alignment to align the object. If this macro is not defined, then ALIGN is used. One use of this macro is to increase alignment of medium-size data to make it all fit in fewer cache lines. Another is to cause character arrays to be word-aligned so that `strcpy' calls that copy constants to character arrays can be done inline. */ #define DATA_ALIGNMENT(TYPE, ALIGN) ix86_data_alignment ((TYPE), (ALIGN)) /* If defined, a C expression to compute the alignment for a local variable. TYPE is the data type, and ALIGN is the alignment that the object would ordinarily have. The value of this macro is used instead of that alignment to align the object. If this macro is not defined, then ALIGN is used. One use of this macro is to increase alignment of medium-size data to make it all fit in fewer cache lines. */ #define LOCAL_ALIGNMENT(TYPE, ALIGN) \ ix86_local_alignment ((TYPE), VOIDmode, (ALIGN)) /* If defined, a C expression to compute the alignment for stack slot. TYPE is the data type, MODE is the widest mode available, and ALIGN is the alignment that the slot would ordinarily have. The value of this macro is used instead of that alignment to align the slot. If this macro is not defined, then ALIGN is used when TYPE is NULL, Otherwise, LOCAL_ALIGNMENT will be used. One use of this macro is to set alignment of stack slot to the maximum alignment of all possible modes which the slot may have. */ #define STACK_SLOT_ALIGNMENT(TYPE, MODE, ALIGN) \ ix86_local_alignment ((TYPE), (MODE), (ALIGN)) /* If defined, a C expression to compute the alignment for a local variable DECL. If this macro is not defined, then LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL)) will be used. One use of this macro is to increase alignment of medium-size data to make it all fit in fewer cache lines. */ #define LOCAL_DECL_ALIGNMENT(DECL) \ ix86_local_alignment ((DECL), VOIDmode, DECL_ALIGN (DECL)) /* If defined, a C expression to compute the minimum required alignment for dynamic stack realignment purposes for EXP (a TYPE or DECL), MODE, assuming normal alignment ALIGN. If this macro is not defined, then (ALIGN) will be used. */ #define MINIMUM_ALIGNMENT(EXP, MODE, ALIGN) \ ix86_minimum_alignment (EXP, MODE, ALIGN) /* Set this nonzero if move instructions will actually fail to work when given unaligned data. */ #define STRICT_ALIGNMENT 0 /* If bit field type is int, don't let it cross an int, and give entire struct the alignment of an int. */ /* Required on the 386 since it doesn't have bit-field insns. */ #define PCC_BITFIELD_TYPE_MATTERS 1 /* Standard register usage. */ /* This processor has special stack-like registers. See reg-stack.c for details. */ #define STACK_REGS #define IS_STACK_MODE(MODE) \ (((MODE) == SFmode && !(TARGET_SSE && TARGET_SSE_MATH)) \ || ((MODE) == DFmode && !(TARGET_SSE2 && TARGET_SSE_MATH)) \ || (MODE) == XFmode) /* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler from 0 to just below FIRST_PSEUDO_REGISTER. All registers that the compiler knows about must be given numbers, even those that are not normally considered general registers. In the 80386 we give the 8 general purpose registers the numbers 0-7. We number the floating point registers 8-15. Note that registers 0-7 can be accessed as a short or int, while only 0-3 may be used with byte `mov' instructions. Reg 16 does not correspond to any hardware register, but instead appears in the RTL as an argument pointer prior to reload, and is eliminated during reloading in favor of either the stack or frame pointer. */ #define FIRST_PSEUDO_REGISTER 53 /* Number of hardware registers that go into the DWARF-2 unwind info. If not defined, equals FIRST_PSEUDO_REGISTER. */ #define DWARF_FRAME_REGISTERS 17 /* 1 for registers that have pervasive standard uses and are not available for the register allocator. On the 80386, the stack pointer is such, as is the arg pointer. REX registers are disabled for 32bit targets in TARGET_CONDITIONAL_REGISTER_USAGE. */ #define FIXED_REGISTERS \ /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, \ /*arg,flags,fpsr,fpcr,frame*/ \ 1, 1, 1, 1, 1, \ /*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \ 0, 0, 0, 0, 0, 0, 0, 0, \ /* mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7*/ \ 0, 0, 0, 0, 0, 0, 0, 0, \ /* r8, r9, r10, r11, r12, r13, r14, r15*/ \ 0, 0, 0, 0, 0, 0, 0, 0, \ /*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/ \ 0, 0, 0, 0, 0, 0, 0, 0 } /* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. The latter must include the registers where values are returned and the register where structure-value addresses are passed. Aside from that, you can include as many other registers as you like. Value is set to 1 if the register is call used unconditionally. Bit one is set if the register is call used on TARGET_32BIT ABI. Bit two is set if the register is call used on TARGET_64BIT ABI. Bit three is set if the register is call used on TARGET_64BIT_MS_ABI. Proper values are computed in TARGET_CONDITIONAL_REGISTER_USAGE. */ #define CALL_USED_REGISTERS \ /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \ { 1, 1, 1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ /*arg,flags,fpsr,fpcr,frame*/ \ 1, 1, 1, 1, 1, \ /*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \ 1, 1, 1, 1, 1, 1, 6, 6, \ /* mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7*/ \ 1, 1, 1, 1, 1, 1, 1, 1, \ /* r8, r9, r10, r11, r12, r13, r14, r15*/ \ 1, 1, 1, 1, 2, 2, 2, 2, \ /*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/ \ 6, 6, 6, 6, 6, 6, 6, 6 } /* Order in which to allocate registers. Each register must be listed once, even those in FIXED_REGISTERS. List frame pointer late and fixed registers last. Note that, in general, we prefer registers listed in CALL_USED_REGISTERS, keeping the others available for storage of persistent values. The ADJUST_REG_ALLOC_ORDER actually overwrite the order, so this is just empty initializer for array. */ #define REG_ALLOC_ORDER \ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ 48, 49, 50, 51, 52 } /* ADJUST_REG_ALLOC_ORDER is a macro which permits reg_alloc_order to be rearranged based on a particular function. When using sse math, we want to allocate SSE before x87 registers and vice versa. */ #define ADJUST_REG_ALLOC_ORDER x86_order_regs_for_local_alloc () #define OVERRIDE_ABI_FORMAT(FNDECL) ix86_call_abi_override (FNDECL) /* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. This is ordinarily the length in words of a value of mode MODE but can be less for certain modes in special long registers. Actually there are no two word move instructions for consecutive registers. And only registers 0-3 may have mov byte instructions applied to them. */ #define HARD_REGNO_NREGS(REGNO, MODE) \ (STACK_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO) \ ? (COMPLEX_MODE_P (MODE) ? 2 : 1) \ : ((MODE) == XFmode \ ? (TARGET_64BIT ? 2 : 3) \ : (MODE) == XCmode \ ? (TARGET_64BIT ? 4 : 6) \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))) #define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) \ ((TARGET_128BIT_LONG_DOUBLE && !TARGET_64BIT) \ ? (STACK_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO) \ ? 0 \ : ((MODE) == XFmode || (MODE) == XCmode)) \ : 0) #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) ((MODE) == XFmode ? 4 : 8) #define VALID_AVX256_REG_MODE(MODE) \ ((MODE) == V32QImode || (MODE) == V16HImode || (MODE) == V8SImode \ || (MODE) == V4DImode || (MODE) == V2TImode || (MODE) == V8SFmode \ || (MODE) == V4DFmode) #define VALID_AVX256_REG_OR_OI_MODE(MODE) \ (VALID_AVX256_REG_MODE (MODE) || (MODE) == OImode) #define VALID_SSE2_REG_MODE(MODE) \ ((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \ || (MODE) == V2DImode || (MODE) == DFmode) #define VALID_SSE_REG_MODE(MODE) \ ((MODE) == V1TImode || (MODE) == TImode \ || (MODE) == V4SFmode || (MODE) == V4SImode \ || (MODE) == SFmode || (MODE) == TFmode) #define VALID_MMX_REG_MODE_3DNOW(MODE) \ ((MODE) == V2SFmode || (MODE) == SFmode) #define VALID_MMX_REG_MODE(MODE) \ ((MODE == V1DImode) || (MODE) == DImode \ || (MODE) == V2SImode || (MODE) == SImode \ || (MODE) == V4HImode || (MODE) == V8QImode) #define VALID_DFP_MODE_P(MODE) \ ((MODE) == SDmode || (MODE) == DDmode || (MODE) == TDmode) #define VALID_FP_MODE_P(MODE) \ ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \ || (MODE) == SCmode || (MODE) == DCmode || (MODE) == XCmode) \ #define VALID_INT_MODE_P(MODE) \ ((MODE) == QImode || (MODE) == HImode || (MODE) == SImode \ || (MODE) == DImode \ || (MODE) == CQImode || (MODE) == CHImode || (MODE) == CSImode \ || (MODE) == CDImode \ || (TARGET_64BIT && ((MODE) == TImode || (MODE) == CTImode \ || (MODE) == TFmode || (MODE) == TCmode))) /* Return true for modes passed in SSE registers. */ #define SSE_REG_MODE_P(MODE) \ ((MODE) == V1TImode || (MODE) == TImode || (MODE) == V16QImode \ || (MODE) == TFmode || (MODE) == V8HImode || (MODE) == V2DFmode \ || (MODE) == V2DImode || (MODE) == V4SFmode || (MODE) == V4SImode \ || (MODE) == V32QImode || (MODE) == V16HImode || (MODE) == V8SImode \ || (MODE) == V4DImode || (MODE) == V8SFmode || (MODE) == V4DFmode \ || (MODE) == V2TImode) /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ ix86_hard_regno_mode_ok ((REGNO), (MODE)) /* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */ #define MODES_TIEABLE_P(MODE1, MODE2) ix86_modes_tieable_p (MODE1, MODE2) /* It is possible to write patterns to move flags; but until someone does it, */ #define AVOID_CCMODE_COPIES /* Specify the modes required to caller save a given hard regno. We do this on i386 to prevent flags from being saved at all. Kill any attempts to combine saving of modes. */ #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ (CC_REGNO_P (REGNO) ? VOIDmode \ : (MODE) == VOIDmode && (NREGS) != 1 ? VOIDmode \ : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), false) \ : (MODE) == HImode && !TARGET_PARTIAL_REG_STALL ? SImode \ : (MODE) == QImode && !(TARGET_64BIT || QI_REGNO_P (REGNO)) ? SImode \ : (MODE)) /* The only ABI that saves SSE registers across calls is Win64 (thus no need to check the current ABI here), and with AVX enabled Win64 only guarantees that the low 16 bytes are saved. */ #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ (SSE_REGNO_P (REGNO) && GET_MODE_SIZE (MODE) > 16) /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */ /* on the 386 the pc register is %eip, and is not usable as a general register. The ordinary mov instructions won't work */ /* #define PC_REGNUM */ /* Register to use for pushing function arguments. */ #define STACK_POINTER_REGNUM 7 /* Base register for access to local variables of the function. */ #define HARD_FRAME_POINTER_REGNUM 6 /* Base register for access to local variables of the function. */ #define FRAME_POINTER_REGNUM 20 /* First floating point reg */ #define FIRST_FLOAT_REG 8 /* First & last stack-like regs */ #define FIRST_STACK_REG FIRST_FLOAT_REG #define LAST_STACK_REG (FIRST_FLOAT_REG + 7) #define FIRST_SSE_REG (FRAME_POINTER_REGNUM + 1) #define LAST_SSE_REG (FIRST_SSE_REG + 7) #define FIRST_MMX_REG (LAST_SSE_REG + 1) #define LAST_MMX_REG (FIRST_MMX_REG + 7) #define FIRST_REX_INT_REG (LAST_MMX_REG + 1) #define LAST_REX_INT_REG (FIRST_REX_INT_REG + 7) #define FIRST_REX_SSE_REG (LAST_REX_INT_REG + 1) #define LAST_REX_SSE_REG (FIRST_REX_SSE_REG + 7) /* Override this in other tm.h files to cope with various OS lossage requiring a frame pointer. */ #ifndef SUBTARGET_FRAME_POINTER_REQUIRED #define SUBTARGET_FRAME_POINTER_REQUIRED 0 #endif /* Make sure we can access arbitrary call frames. */ #define SETUP_FRAME_ADDRESSES() ix86_setup_frame_addresses () /* Base register for access to arguments of the function. */ #define ARG_POINTER_REGNUM 16 /* Register to hold the addressing base for position independent code access to data items. We don't use PIC pointer for 64bit mode. Define the regnum to dummy value to prevent gcc from pessimizing code dealing with EBX. To avoid clobbering a call-saved register unnecessarily, we renumber the pic register when possible. The change is visible after the prologue has been emitted. */ #define REAL_PIC_OFFSET_TABLE_REGNUM BX_REG #define PIC_OFFSET_TABLE_REGNUM \ ((TARGET_64BIT && ix86_cmodel == CM_SMALL_PIC) \ || !flag_pic ? INVALID_REGNUM \ : reload_completed ? REGNO (pic_offset_table_rtx) \ : REAL_PIC_OFFSET_TABLE_REGNUM) #define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_" /* This is overridden by <cygwin.h>. */ #define MS_AGGREGATE_RETURN 0 #define KEEP_AGGREGATE_RETURN_POINTER 0 /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. One of the classes must always be named ALL_REGS and include all hard regs. If there is more than one class, another class must be named NO_REGS and contain no registers. The name GENERAL_REGS must be the name of a class (or an alias for another name such as ALL_REGS). This is the class of registers that is allowed by "g" or "r" in a register constraint. Also, registers outside this class are allocated only when instructions express preferences for them. The classes must be numbered in nondecreasing order; that is, a larger-numbered class must never be contained completely in a smaller-numbered class. For any two classes, it is very desirable that there be another class that represents their union. It might seem that class BREG is unnecessary, since no useful 386 opcode needs reg %ebx. But some systems pass args to the OS in ebx, and the "b" register constraint is useful in asms for syscalls. The flags, fpsr and fpcr registers are in no class. */ enum reg_class { NO_REGS, AREG, DREG, CREG, BREG, SIREG, DIREG, AD_REGS, /* %eax/%edx for DImode */ Q_REGS, /* %eax %ebx %ecx %edx */ NON_Q_REGS, /* %esi %edi %ebp %esp */ INDEX_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp */ LEGACY_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp */ CLOBBERED_REGS, /* call-clobbered integer registers */ GENERAL_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15 */ FP_TOP_REG, FP_SECOND_REG, /* %st(0) %st(1) */ FLOAT_REGS, SSE_FIRST_REG, SSE_REGS, MMX_REGS, FP_TOP_SSE_REGS, FP_SECOND_SSE_REGS, FLOAT_SSE_REGS, FLOAT_INT_REGS, INT_SSE_REGS, FLOAT_INT_SSE_REGS, ALL_REGS, LIM_REG_CLASSES }; #define N_REG_CLASSES ((int) LIM_REG_CLASSES) #define INTEGER_CLASS_P(CLASS) \ reg_class_subset_p ((CLASS), GENERAL_REGS) #define FLOAT_CLASS_P(CLASS) \ reg_class_subset_p ((CLASS), FLOAT_REGS) #define SSE_CLASS_P(CLASS) \ reg_class_subset_p ((CLASS), SSE_REGS) #define MMX_CLASS_P(CLASS) \ ((CLASS) == MMX_REGS) #define MAYBE_INTEGER_CLASS_P(CLASS) \ reg_classes_intersect_p ((CLASS), GENERAL_REGS) #define MAYBE_FLOAT_CLASS_P(CLASS) \ reg_classes_intersect_p ((CLASS), FLOAT_REGS) #define MAYBE_SSE_CLASS_P(CLASS) \ reg_classes_intersect_p (SSE_REGS, (CLASS)) #define MAYBE_MMX_CLASS_P(CLASS) \ reg_classes_intersect_p (MMX_REGS, (CLASS)) #define Q_CLASS_P(CLASS) \ reg_class_subset_p ((CLASS), Q_REGS) /* Give names of register classes as strings for dump file. */ #define REG_CLASS_NAMES \ { "NO_REGS", \ "AREG", "DREG", "CREG", "BREG", \ "SIREG", "DIREG", \ "AD_REGS", \ "Q_REGS", "NON_Q_REGS", \ "INDEX_REGS", \ "LEGACY_REGS", \ "CLOBBERED_REGS", \ "GENERAL_REGS", \ "FP_TOP_REG", "FP_SECOND_REG", \ "FLOAT_REGS", \ "SSE_FIRST_REG", \ "SSE_REGS", \ "MMX_REGS", \ "FP_TOP_SSE_REGS", \ "FP_SECOND_SSE_REGS", \ "FLOAT_SSE_REGS", \ "FLOAT_INT_REGS", \ "INT_SSE_REGS", \ "FLOAT_INT_SSE_REGS", \ "ALL_REGS" } /* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. Note that CLOBBERED_REGS are calculated by TARGET_CONDITIONAL_REGISTER_USAGE. */ #define REG_CLASS_CONTENTS \ { { 0x00, 0x0 }, \ { 0x01, 0x0 }, { 0x02, 0x0 }, /* AREG, DREG */ \ { 0x04, 0x0 }, { 0x08, 0x0 }, /* CREG, BREG */ \ { 0x10, 0x0 }, { 0x20, 0x0 }, /* SIREG, DIREG */ \ { 0x03, 0x0 }, /* AD_REGS */ \ { 0x0f, 0x0 }, /* Q_REGS */ \ { 0x1100f0, 0x1fe0 }, /* NON_Q_REGS */ \ { 0x7f, 0x1fe0 }, /* INDEX_REGS */ \ { 0x1100ff, 0x0 }, /* LEGACY_REGS */ \ { 0x00, 0x0 }, /* CLOBBERED_REGS */ \ { 0x1100ff, 0x1fe0 }, /* GENERAL_REGS */ \ { 0x100, 0x0 }, { 0x0200, 0x0 },/* FP_TOP_REG, FP_SECOND_REG */\ { 0xff00, 0x0 }, /* FLOAT_REGS */ \ { 0x200000, 0x0 }, /* SSE_FIRST_REG */ \ { 0x1fe00000,0x1fe000 }, /* SSE_REGS */ \ { 0xe0000000, 0x1f }, /* MMX_REGS */ \ { 0x1fe00100,0x1fe000 }, /* FP_TOP_SSE_REG */ \ { 0x1fe00200,0x1fe000 }, /* FP_SECOND_SSE_REG */ \ { 0x1fe0ff00,0x1fe000 }, /* FLOAT_SSE_REGS */ \ { 0x11ffff, 0x1fe0 }, /* FLOAT_INT_REGS */ \ { 0x1ff100ff,0x1fffe0 }, /* INT_SSE_REGS */ \ { 0x1ff1ffff,0x1fffe0 }, /* FLOAT_INT_SSE_REGS */ \ { 0xffffffff,0x1fffff } \ } /* The same information, inverted: Return the class number of the smallest class containing reg number REGNO. This could be a conditional expression or could index an array. */ #define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO]) /* When this hook returns true for MODE, the compiler allows registers explicitly used in the rtl to be used as spill registers but prevents the compiler from extending the lifetime of these registers. */ #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true #define QI_REG_P(X) (REG_P (X) && QI_REGNO_P (REGNO (X))) #define QI_REGNO_P(N) IN_RANGE ((N), AX_REG, BX_REG) #define GENERAL_REG_P(X) \ (REG_P (X) && GENERAL_REGNO_P (REGNO (X))) #define GENERAL_REGNO_P(N) \ (IN_RANGE ((N), AX_REG, SP_REG) || REX_INT_REGNO_P (N)) #define ANY_QI_REG_P(X) (REG_P (X) && ANY_QI_REGNO_P (REGNO (X))) #define ANY_QI_REGNO_P(N) \ (TARGET_64BIT ? GENERAL_REGNO_P (N) : QI_REGNO_P (N)) #define REX_INT_REG_P(X) (REG_P (X) && REX_INT_REGNO_P (REGNO (X))) #define REX_INT_REGNO_P(N) \ IN_RANGE ((N), FIRST_REX_INT_REG, LAST_REX_INT_REG) #define STACK_REG_P(X) (REG_P (X) && STACK_REGNO_P (REGNO (X))) #define STACK_REGNO_P(N) IN_RANGE ((N), FIRST_STACK_REG, LAST_STACK_REG) #define ANY_FP_REG_P(X) (REG_P (X) && ANY_FP_REGNO_P (REGNO (X))) #define ANY_FP_REGNO_P(N) (STACK_REGNO_P (N) || SSE_REGNO_P (N)) #define X87_FLOAT_MODE_P(MODE) \ (TARGET_80387 && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) #define SSE_REG_P(X) (REG_P (X) && SSE_REGNO_P (REGNO (X))) #define SSE_REGNO_P(N) \ (IN_RANGE ((N), FIRST_SSE_REG, LAST_SSE_REG) \ || REX_SSE_REGNO_P (N)) #define REX_SSE_REGNO_P(N) \ IN_RANGE ((N), FIRST_REX_SSE_REG, LAST_REX_SSE_REG) #define SSE_REGNO(N) \ ((N) < 8 ? FIRST_SSE_REG + (N) : FIRST_REX_SSE_REG + (N) - 8) #define SSE_FLOAT_MODE_P(MODE) \ ((TARGET_SSE && (MODE) == SFmode) || (TARGET_SSE2 && (MODE) == DFmode)) #define FMA4_VEC_FLOAT_MODE_P(MODE) \ (TARGET_FMA4 && ((MODE) == V4SFmode || (MODE) == V2DFmode \ || (MODE) == V8SFmode || (MODE) == V4DFmode)) #define MMX_REG_P(X) (REG_P (X) && MMX_REGNO_P (REGNO (X))) #define MMX_REGNO_P(N) IN_RANGE ((N), FIRST_MMX_REG, LAST_MMX_REG) #define STACK_TOP_P(X) (REG_P (X) && REGNO (X) == FIRST_STACK_REG) #define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X))) #define CC_REGNO_P(X) ((X) == FLAGS_REG || (X) == FPSR_REG) /* The class value for index registers, and the one for base regs. */ #define INDEX_REG_CLASS INDEX_REGS #define BASE_REG_CLASS GENERAL_REGS /* Place additional restrictions on the register class to use when it is necessary to be able to hold a value of mode MODE in a reload register for which class CLASS would ordinarily be used. We avoid classes containing registers from multiple units due to the limitation in ix86_secondary_memory_needed. We limit these classes to their "natural mode" single unit register class, depending on the unit availability. Please note that reg_class_subset_p is not commutative, so these conditions mean "... if (CLASS) includes ALL registers from the register set." */ #define LIMIT_RELOAD_CLASS(MODE, CLASS) \ (((MODE) == QImode && !TARGET_64BIT \ && reg_class_subset_p (Q_REGS, (CLASS))) ? Q_REGS \ : (((MODE) == SImode || (MODE) == DImode) \ && reg_class_subset_p (GENERAL_REGS, (CLASS))) ? GENERAL_REGS \ : (SSE_FLOAT_MODE_P (MODE) && TARGET_SSE_MATH \ && reg_class_subset_p (SSE_REGS, (CLASS))) ? SSE_REGS \ : (X87_FLOAT_MODE_P (MODE) \ && reg_class_subset_p (FLOAT_REGS, (CLASS))) ? FLOAT_REGS \ : (CLASS)) /* If we are copying between general and FP registers, we need a memory location. The same is true for SSE and MMX registers. */ #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ ix86_secondary_memory_needed ((CLASS1), (CLASS2), (MODE), 1) /* Get_secondary_mem widens integral modes to BITS_PER_WORD. There is no need to emit full 64 bit move on 64 bit targets for integral modes that can be moved using 32 bit move. */ #define SECONDARY_MEMORY_NEEDED_MODE(MODE) \ (GET_MODE_BITSIZE (MODE) < 32 && INTEGRAL_MODE_P (MODE) \ ? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \ : MODE) /* Return a class of registers that cannot change FROM mode to TO mode. */ #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ ix86_cannot_change_mode_class (FROM, TO, CLASS) /* Stack layout; function entry, exit and calling. */ /* Define this if pushing a word on the stack makes the stack pointer a smaller address. */ #define STACK_GROWS_DOWNWARD /* Define this to nonzero if the nominal address of the stack frame is at the high-address end of the local variables; that is, each additional local variable allocated goes at a more negative offset in the frame. */ #define FRAME_GROWS_DOWNWARD 1 /* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the first local allocated. Otherwise, it is the offset to the BEGINNING of the first local allocated. */ #define STARTING_FRAME_OFFSET 0 /* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. On 386, we have pushw instruction that decrements by exactly 2 no matter what the position was, there is no pushb. But as CIE data alignment factor on this arch is -4 for 32bit targets and -8 for 64bit targets, we need to make sure all stack pointer adjustments are in multiple of 4 for 32bit targets and 8 for 64bit targets. */ #define PUSH_ROUNDING(BYTES) \ (((BYTES) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD) /* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable `crtl->outgoing_args_size'. No space will be pushed onto the stack for each call; instead, the function prologue should increase the stack frame size by this amount. 64-bit MS ABI seem to require 16 byte alignment everywhere except for function prologue and apilogue. This is not possible without ACCUMULATE_OUTGOING_ARGS. */ #define ACCUMULATE_OUTGOING_ARGS \ (TARGET_ACCUMULATE_OUTGOING_ARGS || TARGET_64BIT_MS_ABI) /* If defined, a C expression whose value is nonzero when we want to use PUSH instructions to pass outgoing arguments. */ #define PUSH_ARGS (TARGET_PUSH_ARGS && !ACCUMULATE_OUTGOING_ARGS) /* We want the stack and args grow in opposite directions, even if PUSH_ARGS is 0. */ #define PUSH_ARGS_REVERSED 1 /* Offset of first parameter from the argument pointer register value. */ #define FIRST_PARM_OFFSET(FNDECL) 0 /* Define this macro if functions should assume that stack space has been allocated for arguments even when their values are passed in registers. The value of this macro is the size, in bytes, of the area reserved for arguments passed in registers for the function represented by FNDECL. This space can be allocated by the caller, or be a part of the machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says which. */ #define REG_PARM_STACK_SPACE(FNDECL) ix86_reg_parm_stack_space (FNDECL) #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) \ (TARGET_64BIT && ix86_function_type_abi (FNTYPE) == MS_ABI) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) ix86_libcall_value (MODE) /* Define the size of the result block used for communication between untyped_call and untyped_return. The block contains a DImode value followed by the block used by fnsave and frstor. */ #define APPLY_RESULT_SIZE (8+108) /* 1 if N is a possible register number for function argument passing. */ #define FUNCTION_ARG_REGNO_P(N) ix86_function_arg_regno_p (N) /* Define a data type for recording info about an argument list during the scan of that argument list. This data type should hold all necessary information about the function itself and about the args processed so far, enough to enable macros such as FUNCTION_ARG to determine where the next arg should go. */ typedef struct ix86_args { int words; /* # words passed so far */ int nregs; /* # registers available for passing */ int regno; /* next available register number */ int fastcall; /* fastcall or thiscall calling convention is used */ int sse_words; /* # sse words passed so far */ int sse_nregs; /* # sse registers available for passing */ int warn_avx; /* True when we want to warn about AVX ABI. */ int warn_sse; /* True when we want to warn about SSE ABI. */ int warn_mmx; /* True when we want to warn about MMX ABI. */ int sse_regno; /* next available sse register number */ int mmx_words; /* # mmx words passed so far */ int mmx_nregs; /* # mmx registers available for passing */ int mmx_regno; /* next available mmx register number */ int maybe_vaarg; /* true for calls to possibly vardic fncts. */ int caller; /* true if it is caller. */ int float_in_sse; /* Set to 1 or 2 for 32bit targets if SFmode/DFmode arguments should be passed in SSE registers. Otherwise 0. */ enum calling_abi call_abi; /* Set to SYSV_ABI for sysv abi. Otherwise MS_ABI for ms abi. */ } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \ init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL), \ (N_NAMED_ARGS) != -1) /* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */ #define FUNCTION_PROFILER(FILE, LABELNO) x86_function_profiler (FILE, LABELNO) #define MCOUNT_NAME "_mcount" #define MCOUNT_NAME_BEFORE_PROLOGUE "__fentry__" #define PROFILE_COUNT_REGISTER "edx" /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in functions that have frame pointers. No definition is equivalent to always zero. */ /* Note on the 386 it might be more efficient not to define this since we have to restore it ourselves from the frame pointer, in order to use pop */ #define EXIT_IGNORE_STACK 1 /* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. */ /* On the 386, the trampoline contains two instructions: mov #STATIC,ecx jmp FUNCTION The trampoline is generated entirely at runtime. The operand of JMP is the address of FUNCTION relative to the instruction following the JMP (which is 5 bytes long). */ /* Length in units of the trampoline for entering a nested function. */ #define TRAMPOLINE_SIZE (TARGET_64BIT ? 24 : 10) /* Definitions for register eliminations. This is an array of structures. Each structure initializes one pair of eliminable registers. The "from" register number is given first, followed by "to". Eliminations of the same "from" register are listed in order of preference. There are two registers that can always be eliminated on the i386. The frame pointer and the arg pointer can be replaced by either the hard frame pointer or to the stack pointer, depending upon the circumstances. The hard frame pointer is not used before reload and so it is not eligible for elimination. */ #define ELIMINABLE_REGS \ {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} \ /* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */ #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ ((OFFSET) = ix86_initial_elimination_offset ((FROM), (TO))) /* Addressing modes, and classification of registers for them. */ /* Macros to check register numbers against specific register classes. */ /* These assume that REGNO is a hard or pseudo reg number. They give nonzero only if REGNO is a hard reg of the suitable class or a pseudo reg currently allocated to a suitable hard reg. Since they use reg_renumber, they are safe only once reg_renumber has been allocated, which happens in reginfo.c during register allocation. */ #define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) < STACK_POINTER_REGNUM \ || REX_INT_REGNO_P (REGNO) \ || (unsigned) reg_renumber[(REGNO)] < STACK_POINTER_REGNUM \ || REX_INT_REGNO_P ((unsigned) reg_renumber[(REGNO)])) #define REGNO_OK_FOR_BASE_P(REGNO) \ (GENERAL_REGNO_P (REGNO) \ || (REGNO) == ARG_POINTER_REGNUM \ || (REGNO) == FRAME_POINTER_REGNUM \ || GENERAL_REGNO_P ((unsigned) reg_renumber[(REGNO)])) /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. We have two alternate definitions for each of them. The usual definition accepts all pseudo regs; the other rejects them unless they have been allocated suitable hard regs. The symbol REG_OK_STRICT causes the latter definition to be used. Most source files want to accept pseudo regs in the hope that they will get allocated to the class that the insn wants them to be in. Source files for reload pass need to be strict. After reload, it makes no difference, since pseudo regs have been eliminated by then. */ /* Non strict versions, pseudos are ok. */ #define REG_OK_FOR_INDEX_NONSTRICT_P(X) \ (REGNO (X) < STACK_POINTER_REGNUM \ || REX_INT_REGNO_P (REGNO (X)) \ || REGNO (X) >= FIRST_PSEUDO_REGISTER) #define REG_OK_FOR_BASE_NONSTRICT_P(X) \ (GENERAL_REGNO_P (REGNO (X)) \ || REGNO (X) == ARG_POINTER_REGNUM \ || REGNO (X) == FRAME_POINTER_REGNUM \ || REGNO (X) >= FIRST_PSEUDO_REGISTER) /* Strict versions, hard registers only */ #define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X)) #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) #ifndef REG_OK_STRICT #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X) #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P (X) #else #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X) #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X) #endif /* TARGET_LEGITIMATE_ADDRESS_P recognizes an RTL expression that is a valid memory address for an instruction. The MODE argument is the machine mode for the MEM expression that wants to use this address. The other macros defined here are used only in TARGET_LEGITIMATE_ADDRESS_P, except for CONSTANT_ADDRESS_P which is usually machine-independent. See legitimize_pic_address in i386.c for details as to what constitutes a legitimate address when -fpic is used. */ #define MAX_REGS_PER_ADDRESS 2 #define CONSTANT_ADDRESS_P(X) constant_address_p (X) /* Try a machine-dependent way of reloading an illegitimate address operand. If we find one, push the reload and jump to WIN. This macro is used in only one place: `find_reloads_address' in reload.c. */ #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, INDL, WIN) \ do { \ if (ix86_legitimize_reload_address ((X), (MODE), (OPNUM), \ (int)(TYPE), (INDL))) \ goto WIN; \ } while (0) /* If defined, a C expression to determine the base term of address X. This macro is used in only one place: `find_base_term' in alias.c. It is always safe for this macro to not be defined. It exists so that alias analysis can understand machine-dependent addresses. The typical use of this macro is to handle addresses containing a label_ref or symbol_ref within an UNSPEC. */ #define FIND_BASE_TERM(X) ix86_find_base_term (X) /* Nonzero if the constant value X is a legitimate general operand when generating PIC code. It is given that flag_pic is on and that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ #define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X) #define SYMBOLIC_CONST(X) \ (GET_CODE (X) == SYMBOL_REF \ || GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X))) /* Max number of args passed in registers. If this is more than 3, we will have problems with ebx (register #4), since it is a caller save register and is also used as the pic register in ELF. So for now, don't allow more than 3 registers to be passed in registers. */ /* Abi specific values for REGPARM_MAX and SSE_REGPARM_MAX */ #define X86_64_REGPARM_MAX 6 #define X86_64_MS_REGPARM_MAX 4 #define X86_32_REGPARM_MAX 3 #define REGPARM_MAX \ (TARGET_64BIT \ ? (TARGET_64BIT_MS_ABI \ ? X86_64_MS_REGPARM_MAX \ : X86_64_REGPARM_MAX) \ : X86_32_REGPARM_MAX) #define X86_64_SSE_REGPARM_MAX 8 #define X86_64_MS_SSE_REGPARM_MAX 4 #define X86_32_SSE_REGPARM_MAX (TARGET_SSE ? (TARGET_MACHO ? 4 : 3) : 0) #define SSE_REGPARM_MAX \ (TARGET_64BIT \ ? (TARGET_64BIT_MS_ABI \ ? X86_64_MS_SSE_REGPARM_MAX \ : X86_64_SSE_REGPARM_MAX) \ : X86_32_SSE_REGPARM_MAX) #define MMX_REGPARM_MAX (TARGET_64BIT ? 0 : (TARGET_MMX ? 3 : 0)) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE \ (!TARGET_LP64 || (flag_pic && ix86_cmodel != CM_LARGE_PIC) ? SImode : DImode) /* Define this as 1 if `char' should by default be signed; else as 0. */ #define DEFAULT_SIGNED_CHAR 1 /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX 16 /* MOVE_MAX_PIECES is the number of bytes at a time which we can move efficiently, as opposed to MOVE_MAX which is the maximum number of bytes we can move with a single instruction. */ #define MOVE_MAX_PIECES UNITS_PER_WORD /* If a memory-to-memory move would take MOVE_RATIO or more simple move-instruction pairs, we will do a movmem or libcall instead. Increasing the value will always make code faster, but eventually incurs high cost in increased code size. If you don't define this, a reasonable default is used. */ #define MOVE_RATIO(speed) ((speed) ? ix86_cost->move_ratio : 3) /* If a clear memory operation would take CLEAR_RATIO or more simple move-instruction sequences, we will do a clrmem or libcall instead. */ #define CLEAR_RATIO(speed) ((speed) ? MIN (6, ix86_cost->move_ratio) : 2) /* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension of a shift count. On i386, shifts do truncate the count. But bit test instructions take the modulo of the bit offset operand. */ /* #define SHIFT_COUNT_TRUNCATED */ /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits is done just by pretending it is already truncated. */ #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 /* A macro to update M and UNSIGNEDP when an object whose type is TYPE and which has the specified mode and signedness is to be stored in a register. This macro is only called when TYPE is a scalar type. On i386 it is sometimes useful to promote HImode and QImode quantities to SImode. The choice depends on target type. */ #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ do { \ if (((MODE) == HImode && TARGET_PROMOTE_HI_REGS) \ || ((MODE) == QImode && TARGET_PROMOTE_QI_REGS)) \ (MODE) = SImode; \ } while (0) /* Specify the machine mode that pointers have. After generation of rtl, the compiler makes no further distinction between pointers and any other objects of this machine mode. */ #define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode) /* A C expression whose value is zero if pointers that need to be extended from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and greater then zero if they are zero-extended and less then zero if the ptr_extend instruction should be used. */ #define POINTERS_EXTEND_UNSIGNED 1 /* A function address in a call instruction is a byte address (for indexing purposes) so give the MEM rtx a byte's mode. */ #define FUNCTION_MODE QImode /* A C expression for the cost of a branch instruction. A value of 1 is the default; other values are interpreted relative to that. */ #define BRANCH_COST(speed_p, predictable_p) \ (!(speed_p) ? 2 : (predictable_p) ? 0 : ix86_branch_cost) /* An integer expression for the size in bits of the largest integer machine mode that should actually be used. We allow pairs of registers. */ #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode) /* Define this macro as a C expression which is nonzero if accessing less than a word of memory (i.e. a `char' or a `short') is no faster than accessing a word of memory, i.e., if such access require more than one instruction or if there is no difference in cost between byte and (aligned) word loads. When this macro is not defined, the compiler will access a field by finding the smallest containing object; when it is defined, a fullword load will be used if alignment permits. Unless bytes accesses are faster than word accesses, using word accesses is preferable since it may eliminate subsequent memory access if subsequent accesses occur to other fields in the same word of the structure, but to different bytes. */ #define SLOW_BYTE_ACCESS 0 /* Nonzero if access to memory by shorts is slow and undesirable. */ #define SLOW_SHORT_ACCESS 0 /* Define this macro to be the value 1 if unaligned accesses have a cost many times greater than aligned accesses, for example if they are emulated in a trap handler. When this macro is nonzero, the compiler will act as if `STRICT_ALIGNMENT' were nonzero when generating code for block moves. This can cause significantly more instructions to be produced. Therefore, do not set this macro nonzero if unaligned accesses only add a cycle or two to the time for a memory access. If the value of this macro is always zero, it need not be defined. */ /* #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 0 */ /* Define this macro if it is as good or better to call a constant function address than to call an address kept in a register. Desirable on the 386 because a CALL with a constant address is faster than one with a register address. */ #define NO_FUNCTION_CSE /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. For floating-point equality comparisons, CCFPEQmode should be used. VOIDmode should be used in all other cases. For integer comparisons against zero, reduce to CCNOmode or CCZmode if possible, to allow for more combinations. */ #define SELECT_CC_MODE(OP, X, Y) ix86_cc_mode ((OP), (X), (Y)) /* Return nonzero if MODE implies a floating point inequality can be reversed. */ #define REVERSIBLE_CC_MODE(MODE) 1 /* A C expression whose value is reversed condition code of the CODE for comparison done in CC_MODE mode. */ #define REVERSE_CONDITION(CODE, MODE) ix86_reverse_condition ((CODE), (MODE)) /* Control the assembler format that we output, to the extent this does not vary between assemblers. */ /* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */ /* In order to refer to the first 8 regs as 32-bit regs, prefix an "e". For non floating point regs, the following are the HImode names. For float regs, the stack top is sometimes referred to as "%st(0)" instead of just "%st". TARGET_PRINT_OPERAND handles this with the "y" code. */ #define HI_REGISTER_NAMES \ {"ax","dx","cx","bx","si","di","bp","sp", \ "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)", \ "argp", "flags", "fpsr", "fpcr", "frame", \ "xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7", \ "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"} #define REGISTER_NAMES HI_REGISTER_NAMES /* Table of additional register names to use in user input. */ #define ADDITIONAL_REGISTER_NAMES \ { { "eax", 0 }, { "edx", 1 }, { "ecx", 2 }, { "ebx", 3 }, \ { "esi", 4 }, { "edi", 5 }, { "ebp", 6 }, { "esp", 7 }, \ { "rax", 0 }, { "rdx", 1 }, { "rcx", 2 }, { "rbx", 3 }, \ { "rsi", 4 }, { "rdi", 5 }, { "rbp", 6 }, { "rsp", 7 }, \ { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, \ { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 } } /* Note we are omitting these since currently I don't know how to get gcc to use these, since they want the same but different number as al, and ax. */ #define QI_REGISTER_NAMES \ {"al", "dl", "cl", "bl", "sil", "dil", "bpl", "spl",} /* These parallel the array above, and can be used to access bits 8:15 of regs 0 through 3. */ #define QI_HIGH_REGISTER_NAMES \ {"ah", "dh", "ch", "bh", } /* How to renumber registers for dbx and gdb. */ #define DBX_REGISTER_NUMBER(N) \ (TARGET_64BIT ? dbx64_register_map[(N)] : dbx_register_map[(N)]) extern int const dbx_register_map[FIRST_PSEUDO_REGISTER]; extern int const dbx64_register_map[FIRST_PSEUDO_REGISTER]; extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; /* Before the prologue, RA is at 0(%esp). */ #define INCOMING_RETURN_ADDR_RTX \ gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM)) /* After the prologue, RA is at -4(AP) in the current frame. */ #define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT) == 0 \ ? gen_rtx_MEM (Pmode, plus_constant (Pmode, arg_pointer_rtx, \ -UNITS_PER_WORD)) \ : gen_rtx_MEM (Pmode, plus_constant (Pmode, FRAME, UNITS_PER_WORD))) /* PC is dbx register 8; let's use that column for RA. */ #define DWARF_FRAME_RETURN_COLUMN (TARGET_64BIT ? 16 : 8) /* Before the prologue, the top of the frame is at 4(%esp). */ #define INCOMING_FRAME_SP_OFFSET UNITS_PER_WORD /* Describe how we implement __builtin_eh_return. */ #define EH_RETURN_DATA_REGNO(N) ((N) <= DX_REG ? (N) : INVALID_REGNUM) #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, CX_REG) /* Select a format to encode pointers in exception handling data. CODE is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is true if the symbol may be affected by dynamic relocations. ??? All x86 object file formats are capable of representing this. After all, the relocation needed is the same as for the call insn. Whether or not a particular assembler allows us to enter such, I guess we'll have to see. */ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ asm_preferred_eh_data_format ((CODE), (GLOBAL)) /* This is how to output an insn to push a register on the stack. It need not be very fast code. */ #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \ do { \ if (TARGET_64BIT) \ asm_fprintf ((FILE), "\tpush{q}\t%%r%s\n", \ reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0)); \ else \ asm_fprintf ((FILE), "\tpush{l}\t%%e%s\n", reg_names[(REGNO)]); \ } while (0) /* This is how to output an insn to pop a register from the stack. It need not be very fast code. */ #define ASM_OUTPUT_REG_POP(FILE, REGNO) \ do { \ if (TARGET_64BIT) \ asm_fprintf ((FILE), "\tpop{q}\t%%r%s\n", \ reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0)); \ else \ asm_fprintf ((FILE), "\tpop{l}\t%%e%s\n", reg_names[(REGNO)]); \ } while (0) /* This is how to output an element of a case-vector that is absolute. */ #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ ix86_output_addr_vec_elt ((FILE), (VALUE)) /* This is how to output an element of a case-vector that is relative. */ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ ix86_output_addr_diff_elt ((FILE), (VALUE), (REL)) /* When we see %v, we will print the 'v' prefix if TARGET_AVX is true. */ #define ASM_OUTPUT_AVX_PREFIX(STREAM, PTR) \ { \ if ((PTR)[0] == '%' && (PTR)[1] == 'v') \ (PTR) += TARGET_AVX ? 1 : 2; \ } /* A C statement or statements which output an assembler instruction opcode to the stdio stream STREAM. The macro-operand PTR is a variable of type `char *' which points to the opcode name in its "internal" form--the form that is written in the machine description. */ #define ASM_OUTPUT_OPCODE(STREAM, PTR) \ ASM_OUTPUT_AVX_PREFIX ((STREAM), (PTR)) /* A C statement to output to the stdio stream FILE an assembler command to pad the location counter to a multiple of 1<<LOG bytes if it is within MAX_SKIP bytes. */ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN #undef ASM_OUTPUT_MAX_SKIP_PAD #define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ if ((LOG) != 0) \ { \ if ((MAX_SKIP) == 0) \ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ else \ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ } #endif /* Write the extra assembler code needed to declare a function properly. */ #undef ASM_OUTPUT_FUNCTION_LABEL #define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \ ix86_asm_output_function_label (FILE, NAME, DECL) /* Under some conditions we need jump tables in the text section, because the assembler cannot handle label differences between sections. This is the case for x86_64 on Mach-O for example. */ #define JUMP_TABLES_IN_TEXT_SECTION \ (flag_pic && ((TARGET_MACHO && TARGET_64BIT) \ || (!TARGET_64BIT && !HAVE_AS_GOTOFF_IN_DATA))) /* Switch to init or fini section via SECTION_OP, emit a call to FUNC, and switch back. For x86 we do this only to save a few bytes that would otherwise be unused in the text section. */ #define CRT_MKSTR2(VAL) #VAL #define CRT_MKSTR(x) CRT_MKSTR2(x) #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ asm (SECTION_OP "\n\t" \ "call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \ TEXT_SECTION_ASM_OP); /* Default threshold for putting data in large sections with x86-64 medium memory model */ #define DEFAULT_LARGE_SECTION_THRESHOLD 65536 /* Which processor to tune code generation for. */ enum processor_type { PROCESSOR_I386 = 0, /* 80386 */ PROCESSOR_I486, /* 80486DX, 80486SX, 80486DX[24] */ PROCESSOR_PENTIUM, PROCESSOR_PENTIUMPRO, PROCESSOR_GEODE, PROCESSOR_K6, PROCESSOR_ATHLON, PROCESSOR_PENTIUM4, PROCESSOR_K8, PROCESSOR_NOCONA, PROCESSOR_CORE2, PROCESSOR_COREI7, PROCESSOR_HASWELL, PROCESSOR_GENERIC32, PROCESSOR_GENERIC64, PROCESSOR_AMDFAM10, PROCESSOR_BDVER1, PROCESSOR_BDVER2, PROCESSOR_BDVER3, PROCESSOR_BTVER1, PROCESSOR_BTVER2, PROCESSOR_ATOM, PROCESSOR_max }; extern enum processor_type ix86_tune; extern enum processor_type ix86_arch; /* Size of the RED_ZONE area. */ #define RED_ZONE_SIZE 128 /* Reserved area of the red zone for temporaries. */ #define RED_ZONE_RESERVE 8 extern unsigned int ix86_preferred_stack_boundary; extern unsigned int ix86_incoming_stack_boundary; /* Smallest class containing REGNO. */ extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER]; enum ix86_fpcmp_strategy { IX86_FPCMP_SAHF, IX86_FPCMP_COMI, IX86_FPCMP_ARITH }; /* To properly truncate FP values into integers, we need to set i387 control word. We can't emit proper mode switching code before reload, as spills generated by reload may truncate values incorrectly, but we still can avoid redundant computation of new control word by the mode switching pass. The fldcw instructions are still emitted redundantly, but this is probably not going to be noticeable problem, as most CPUs do have fast path for the sequence. The machinery is to emit simple truncation instructions and split them before reload to instructions having USEs of two memory locations that are filled by this code to old and new control word. Post-reload pass may be later used to eliminate the redundant fildcw if needed. */ enum ix86_entity { AVX_U128 = 0, I387_TRUNC, I387_FLOOR, I387_CEIL, I387_MASK_PM, MAX_386_ENTITIES }; enum ix86_stack_slot { SLOT_TEMP = 0, SLOT_CW_STORED, SLOT_CW_TRUNC, SLOT_CW_FLOOR, SLOT_CW_CEIL, SLOT_CW_MASK_PM, MAX_386_STACK_LOCALS }; enum avx_u128_state { AVX_U128_CLEAN, AVX_U128_DIRTY, AVX_U128_ANY }; /* Define this macro if the port needs extra instructions inserted for mode switching in an optimizing compilation. */ #define OPTIMIZE_MODE_SWITCHING(ENTITY) \ ix86_optimize_mode_switching[(ENTITY)] /* If you define `OPTIMIZE_MODE_SWITCHING', you have to define this as initializer for an array of integers. Each initializer element N refers to an entity that needs mode switching, and specifies the number of different modes that might need to be set for this entity. The position of the initializer in the initializer - starting counting at zero - determines the integer that is used to refer to the mode-switched entity in question. */ #define NUM_MODES_FOR_MODE_SWITCHING \ { AVX_U128_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY } /* ENTITY is an integer specifying a mode-switched entity. If `OPTIMIZE_MODE_SWITCHING' is defined, you must define this macro to return an integer value not larger than the corresponding element in `NUM_MODES_FOR_MODE_SWITCHING', to denote the mode that ENTITY must be switched into prior to the execution of INSN. */ #define MODE_NEEDED(ENTITY, I) ix86_mode_needed ((ENTITY), (I)) /* If this macro is defined, it is evaluated for every INSN during mode switching. It determines the mode that an insn results in (if different from the incoming mode). */ #define MODE_AFTER(ENTITY, MODE, I) ix86_mode_after ((ENTITY), (MODE), (I)) /* If this macro is defined, it is evaluated for every ENTITY that needs mode switching. It should evaluate to an integer, which is a mode that ENTITY is assumed to be switched to at function entry. */ #define MODE_ENTRY(ENTITY) ix86_mode_entry (ENTITY) /* If this macro is defined, it is evaluated for every ENTITY that needs mode switching. It should evaluate to an integer, which is a mode that ENTITY is assumed to be switched to at function exit. */ #define MODE_EXIT(ENTITY) ix86_mode_exit (ENTITY) /* This macro specifies the order in which modes for ENTITY are processed. 0 is the highest priority. */ #define MODE_PRIORITY_TO_MODE(ENTITY, N) (N) /* Generate one or more insns to set ENTITY to MODE. HARD_REG_LIVE is the set of hard registers live at the point where the insn(s) are to be inserted. */ #define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \ ix86_emit_mode_set ((ENTITY), (MODE), (HARD_REGS_LIVE)) /* Avoid renaming of stack registers, as doing so in combination with scheduling just increases amount of live registers at time and in the turn amount of fxch instructions needed. ??? Maybe Pentium chips benefits from renaming, someone can try.... */ #define HARD_REGNO_RENAME_OK(SRC, TARGET) !STACK_REGNO_P (SRC) #define FASTCALL_PREFIX '@' /* Machine specific frame tracking during prologue/epilogue generation. */ #ifndef USED_FOR_TARGET struct GTY(()) machine_frame_state { /* This pair tracks the currently active CFA as reg+offset. When reg is drap_reg, we don't bother trying to record here the real CFA when it might really be a DW_CFA_def_cfa_expression. */ rtx cfa_reg; HOST_WIDE_INT cfa_offset; /* The current offset (canonically from the CFA) of ESP and EBP. When stack frame re-alignment is active, these may not be relative to the CFA. However, in all cases they are relative to the offsets of the saved registers stored in ix86_frame. */ HOST_WIDE_INT sp_offset; HOST_WIDE_INT fp_offset; /* The size of the red-zone that may be assumed for the purposes of eliding register restore notes in the epilogue. This may be zero if no red-zone is in effect, or may be reduced from the real red-zone value by a maximum runtime stack re-alignment value. */ int red_zone_offset; /* Indicate whether each of ESP, EBP or DRAP currently holds a valid value within the frame. If false then the offset above should be ignored. Note that DRAP, if valid, *always* points to the CFA and thus has an offset of zero. */ BOOL_BITFIELD sp_valid : 1; BOOL_BITFIELD fp_valid : 1; BOOL_BITFIELD drap_valid : 1; /* Indicate whether the local stack frame has been re-aligned. When set, the SP/FP offsets above are relative to the aligned frame and not the CFA. */ BOOL_BITFIELD realigned : 1; }; /* Private to winnt.c. */ struct seh_frame_state; struct GTY(()) machine_function { struct stack_local_entry *stack_locals; const char *some_ld_name; int varargs_gpr_size; int varargs_fpr_size; int optimize_mode_switching[MAX_386_ENTITIES]; /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed for. */ int use_fast_prologue_epilogue_nregs; /* For -fsplit-stack support: A stack local which holds a pointer to the stack arguments for a function with a variable number of arguments. This is set at the start of the function and is used to initialize the overflow_arg_area field of the va_list structure. */ rtx split_stack_varargs_pointer; /* This value is used for amd64 targets and specifies the current abi to be used. MS_ABI means ms abi. Otherwise SYSV_ABI means sysv abi. */ ENUM_BITFIELD(calling_abi) call_abi : 8; /* Nonzero if the function accesses a previous frame. */ BOOL_BITFIELD accesses_prev_frame : 1; /* Nonzero if the function requires a CLD in the prologue. */ BOOL_BITFIELD needs_cld : 1; /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to determine the style used. */ BOOL_BITFIELD use_fast_prologue_epilogue : 1; /* If true, the current function needs the default PIC register, not an alternate register (on x86) and must not use the red zone (on x86_64), even if it's a leaf function. We don't want the function to be regarded as non-leaf because TLS calls need not affect register allocation. This flag is set when a TLS call instruction is expanded within a function, and never reset, even if all such instructions are optimized away. Use the ix86_current_function_calls_tls_descriptor macro for a better approximation. */ BOOL_BITFIELD tls_descriptor_call_expanded_p : 1; /* If true, the current function has a STATIC_CHAIN is placed on the stack below the return address. */ BOOL_BITFIELD static_chain_on_stack : 1; /* During prologue/epilogue generation, the current frame state. Otherwise, the frame state at the end of the prologue. */ struct machine_frame_state fs; /* During SEH output, this is non-null. */ struct seh_frame_state * GTY((skip(""))) seh; }; #endif #define ix86_stack_locals (cfun->machine->stack_locals) #define ix86_varargs_gpr_size (cfun->machine->varargs_gpr_size) #define ix86_varargs_fpr_size (cfun->machine->varargs_fpr_size) #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching) #define ix86_current_function_needs_cld (cfun->machine->needs_cld) #define ix86_tls_descriptor_calls_expanded_in_cfun \ (cfun->machine->tls_descriptor_call_expanded_p) /* Since tls_descriptor_call_expanded is not cleared, even if all TLS calls are optimized away, we try to detect cases in which it was optimized away. Since such instructions (use (reg REG_SP)), we can verify whether there's any such instruction live by testing that REG_SP is live. */ #define ix86_current_function_calls_tls_descriptor \ (ix86_tls_descriptor_calls_expanded_in_cfun && df_regs_ever_live_p (SP_REG)) #define ix86_static_chain_on_stack (cfun->machine->static_chain_on_stack) /* Control behavior of x86_file_start. */ #define X86_FILE_START_VERSION_DIRECTIVE false #define X86_FILE_START_FLTUSED false /* Flag to mark data that is in the large address area. */ #define SYMBOL_FLAG_FAR_ADDR (SYMBOL_FLAG_MACH_DEP << 0) #define SYMBOL_REF_FAR_ADDR_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_FAR_ADDR) != 0) /* Flags to mark dllimport/dllexport. Used by PE ports, but handy to have defined always, to avoid ifdefing. */ #define SYMBOL_FLAG_DLLIMPORT (SYMBOL_FLAG_MACH_DEP << 1) #define SYMBOL_REF_DLLIMPORT_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLIMPORT) != 0) #define SYMBOL_FLAG_DLLEXPORT (SYMBOL_FLAG_MACH_DEP << 2) #define SYMBOL_REF_DLLEXPORT_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLEXPORT) != 0) extern void debug_ready_dispatch (void); extern void debug_dispatch_window (int); /* The value at zero is only defined for the BMI instructions LZCNT and TZCNT, not the BSR/BSF insns in the original isa. */ #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ ((VALUE) = GET_MODE_BITSIZE (MODE), TARGET_BMI) #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ ((VALUE) = GET_MODE_BITSIZE (MODE), TARGET_LZCNT) /* Flags returned by ix86_get_callcvt (). */ #define IX86_CALLCVT_CDECL 0x1 #define IX86_CALLCVT_STDCALL 0x2 #define IX86_CALLCVT_FASTCALL 0x4 #define IX86_CALLCVT_THISCALL 0x8 #define IX86_CALLCVT_REGPARM 0x10 #define IX86_CALLCVT_SSEREGPARM 0x20 #define IX86_BASE_CALLCVT(FLAGS) \ ((FLAGS) & (IX86_CALLCVT_CDECL | IX86_CALLCVT_STDCALL \ | IX86_CALLCVT_FASTCALL | IX86_CALLCVT_THISCALL)) #define RECIP_MASK_NONE 0x00 #define RECIP_MASK_DIV 0x01 #define RECIP_MASK_SQRT 0x02 #define RECIP_MASK_VEC_DIV 0x04 #define RECIP_MASK_VEC_SQRT 0x08 #define RECIP_MASK_ALL (RECIP_MASK_DIV | RECIP_MASK_SQRT \ | RECIP_MASK_VEC_DIV | RECIP_MASK_VEC_SQRT) #define RECIP_MASK_DEFAULT (RECIP_MASK_VEC_DIV | RECIP_MASK_VEC_SQRT) #define TARGET_RECIP_DIV ((recip_mask & RECIP_MASK_DIV) != 0) #define TARGET_RECIP_SQRT ((recip_mask & RECIP_MASK_SQRT) != 0) #define TARGET_RECIP_VEC_DIV ((recip_mask & RECIP_MASK_VEC_DIV) != 0) #define TARGET_RECIP_VEC_SQRT ((recip_mask & RECIP_MASK_VEC_SQRT) != 0) #define IX86_HLE_ACQUIRE (1 << 16) #define IX86_HLE_RELEASE (1 << 17) /* Local variables: version-control: t End: */
########################################################################## # # Copyright (c) 2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above # copyright notice, this list of conditions and the following # disclaimer. # # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided with # the distribution. # # * Neither the name of John Haddon nor the names of # any other contributors to this software may be used to endorse or # promote products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ########################################################################## import Gaffer import GafferScene ########################################################################## # Metadata ########################################################################## Gaffer.Metadata.registerNode( GafferScene.DeleteOptions, "description", """ A node which removes options from the globals. """, plugs = { "names" : [ "description", """ The names of options to be removed. Names should be separated by spaces and can use Gaffer's standard wildcards. """, ], "invertNames" : [ "description", """ When on, matching names are kept, and non-matching names are removed. """, ], } )
// Generated by delombok at Wed Oct 02 19:12:43 GMT 2019 import java.util.Set; public class SingularSet<T> { private Set rawTypes; private Set<Integer> integers; private Set<T> generics; private Set<? extends Number> extendsGenerics; @java.lang.SuppressWarnings("all") SingularSet(final Set rawTypes, final Set<Integer> integers, final Set<T> generics, final Set<? extends Number> extendsGenerics) { this.rawTypes = rawTypes; this.integers = integers; this.generics = generics; this.extendsGenerics = extendsGenerics; } @java.lang.SuppressWarnings("all") public static class SingularSetBuilder<T> { @java.lang.SuppressWarnings("all") private java.util.ArrayList<java.lang.Object> rawTypes; @java.lang.SuppressWarnings("all") private java.util.ArrayList<Integer> integers; @java.lang.SuppressWarnings("all") private java.util.ArrayList<T> generics; @java.lang.SuppressWarnings("all") private java.util.ArrayList<Number> extendsGenerics; @java.lang.SuppressWarnings("all") SingularSetBuilder() { } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> rawType(final java.lang.Object rawType) { if (this.rawTypes == null) this.rawTypes = new java.util.ArrayList<java.lang.Object>(); this.rawTypes.add(rawType); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> rawTypes(final java.util.Collection<?> rawTypes) { if (this.rawTypes == null) this.rawTypes = new java.util.ArrayList<java.lang.Object>(); this.rawTypes.addAll(rawTypes); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> clearRawTypes() { if (this.rawTypes != null) this.rawTypes.clear(); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> integer(final Integer integer) { if (this.integers == null) this.integers = new java.util.ArrayList<Integer>(); this.integers.add(integer); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> integers(final java.util.Collection<? extends Integer> integers) { if (this.integers == null) this.integers = new java.util.ArrayList<Integer>(); this.integers.addAll(integers); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> clearIntegers() { if (this.integers != null) this.integers.clear(); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> generic(final T generic) { if (this.generics == null) this.generics = new java.util.ArrayList<T>(); this.generics.add(generic); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> generics(final java.util.Collection<? extends T> generics) { if (this.generics == null) this.generics = new java.util.ArrayList<T>(); this.generics.addAll(generics); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> clearGenerics() { if (this.generics != null) this.generics.clear(); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> extendsGeneric(final Number extendsGeneric) { if (this.extendsGenerics == null) this.extendsGenerics = new java.util.ArrayList<Number>(); this.extendsGenerics.add(extendsGeneric); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> extendsGenerics(final java.util.Collection<? extends Number> extendsGenerics) { if (this.extendsGenerics == null) this.extendsGenerics = new java.util.ArrayList<Number>(); this.extendsGenerics.addAll(extendsGenerics); return this; } @java.lang.SuppressWarnings("all") public SingularSetBuilder<T> clearExtendsGenerics() { if (this.extendsGenerics != null) this.extendsGenerics.clear(); return this; } @java.lang.SuppressWarnings("all") public SingularSet<T> build() { java.util.Set<java.lang.Object> rawTypes; switch (this.rawTypes == null ? 0 : this.rawTypes.size()) { case 0: rawTypes = java.util.Collections.emptySet(); break; case 1: rawTypes = java.util.Collections.singleton(this.rawTypes.get(0)); break; default: rawTypes = new java.util.LinkedHashSet<java.lang.Object>(this.rawTypes.size() < 1073741824 ? 1 + this.rawTypes.size() + (this.rawTypes.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); rawTypes.addAll(this.rawTypes); rawTypes = java.util.Collections.unmodifiableSet(rawTypes); } java.util.Set<Integer> integers; switch (this.integers == null ? 0 : this.integers.size()) { case 0: integers = java.util.Collections.emptySet(); break; case 1: integers = java.util.Collections.singleton(this.integers.get(0)); break; default: integers = new java.util.LinkedHashSet<Integer>(this.integers.size() < 1073741824 ? 1 + this.integers.size() + (this.integers.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); integers.addAll(this.integers); integers = java.util.Collections.unmodifiableSet(integers); } java.util.Set<T> generics; switch (this.generics == null ? 0 : this.generics.size()) { case 0: generics = java.util.Collections.emptySet(); break; case 1: generics = java.util.Collections.singleton(this.generics.get(0)); break; default: generics = new java.util.LinkedHashSet<T>(this.generics.size() < 1073741824 ? 1 + this.generics.size() + (this.generics.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); generics.addAll(this.generics); generics = java.util.Collections.unmodifiableSet(generics); } java.util.Set<Number> extendsGenerics; switch (this.extendsGenerics == null ? 0 : this.extendsGenerics.size()) { case 0: extendsGenerics = java.util.Collections.emptySet(); break; case 1: extendsGenerics = java.util.Collections.singleton(this.extendsGenerics.get(0)); break; default: extendsGenerics = new java.util.LinkedHashSet<Number>(this.extendsGenerics.size() < 1073741824 ? 1 + this.extendsGenerics.size() + (this.extendsGenerics.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); extendsGenerics.addAll(this.extendsGenerics); extendsGenerics = java.util.Collections.unmodifiableSet(extendsGenerics); } return new SingularSet<T>(rawTypes, integers, generics, extendsGenerics); } @java.lang.Override @java.lang.SuppressWarnings("all") public java.lang.String toString() { return "SingularSet.SingularSetBuilder(rawTypes=" + this.rawTypes + ", integers=" + this.integers + ", generics=" + this.generics + ", extendsGenerics=" + this.extendsGenerics + ")"; } } @java.lang.SuppressWarnings("all") public static <T> SingularSetBuilder<T> builder() { return new SingularSetBuilder<T>(); } }
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=DEFAULT // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fwrapv | FileCheck %s --check-prefix=WRAPV // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv | FileCheck %s --check-prefix=TRAPV // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=signed-integer-overflow | FileCheck %s --check-prefix=CATCH_UB // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv -ftrapv-handler foo | FileCheck %s --check-prefix=TRAPV_HANDLER // Tests for signed integer overflow stuff. // rdar://7432000 rdar://7221421 void test1() { // DEFAULT-LABEL: define void @test1 // WRAPV-LABEL: define void @test1 // TRAPV-LABEL: define void @test1 extern volatile int f11G, a, b; // DEFAULT: add nsw i32 // WRAPV: add i32 // TRAPV: llvm.sadd.with.overflow.i32 // CATCH_UB: llvm.sadd.with.overflow.i32 // TRAPV_HANDLER: foo( f11G = a + b; // DEFAULT: sub nsw i32 // WRAPV: sub i32 // TRAPV: llvm.ssub.with.overflow.i32 // CATCH_UB: llvm.ssub.with.overflow.i32 // TRAPV_HANDLER: foo( f11G = a - b; // DEFAULT: mul nsw i32 // WRAPV: mul i32 // TRAPV: llvm.smul.with.overflow.i32 // CATCH_UB: llvm.smul.with.overflow.i32 // TRAPV_HANDLER: foo( f11G = a * b; // DEFAULT: sub nsw i32 0, // WRAPV: sub i32 0, // TRAPV: llvm.ssub.with.overflow.i32(i32 0 // CATCH_UB: llvm.ssub.with.overflow.i32(i32 0 // TRAPV_HANDLER: foo( f11G = -a; // PR7426 - Overflow checking for increments. // DEFAULT: add nsw i32 {{.*}}, 1 // WRAPV: add i32 {{.*}}, 1 // TRAPV: llvm.sadd.with.overflow.i32({{.*}}, i32 1) // CATCH_UB: llvm.sadd.with.overflow.i32({{.*}}, i32 1) // TRAPV_HANDLER: foo( ++a; // DEFAULT: add nsw i32 {{.*}}, -1 // WRAPV: add i32 {{.*}}, -1 // TRAPV: llvm.ssub.with.overflow.i32({{.*}}, i32 1) // CATCH_UB: llvm.ssub.with.overflow.i32({{.*}}, i32 1) // TRAPV_HANDLER: foo( --a; // -fwrapv should turn off inbounds for GEP's, PR9256 extern int* P; ++P; // DEFAULT: getelementptr inbounds i32, i32* // WRAPV: getelementptr i32, i32* // TRAPV: getelementptr inbounds i32, i32* // CATCH_UB: getelementptr inbounds i32, i32* // PR9350: char pre-increment never overflows. extern volatile signed char PR9350_char_inc; // DEFAULT: add i8 {{.*}}, 1 // WRAPV: add i8 {{.*}}, 1 // TRAPV: add i8 {{.*}}, 1 // CATCH_UB: add i8 {{.*}}, 1 ++PR9350_char_inc; // PR9350: char pre-decrement never overflows. extern volatile signed char PR9350_char_dec; // DEFAULT: add i8 {{.*}}, -1 // WRAPV: add i8 {{.*}}, -1 // TRAPV: add i8 {{.*}}, -1 // CATCH_UB: add i8 {{.*}}, -1 --PR9350_char_dec; // PR9350: short pre-increment never overflows. extern volatile signed short PR9350_short_inc; // DEFAULT: add i16 {{.*}}, 1 // WRAPV: add i16 {{.*}}, 1 // TRAPV: add i16 {{.*}}, 1 // CATCH_UB: add i16 {{.*}}, 1 ++PR9350_short_inc; // PR9350: short pre-decrement never overflows. extern volatile signed short PR9350_short_dec; // DEFAULT: add i16 {{.*}}, -1 // WRAPV: add i16 {{.*}}, -1 // TRAPV: add i16 {{.*}}, -1 // CATCH_UB: add i16 {{.*}}, -1 --PR9350_short_dec; // PR24256: don't instrument __builtin_frame_address. __builtin_frame_address(0 + 0); // DEFAULT: call i8* @llvm.frameaddress(i32 0) // WRAPV: call i8* @llvm.frameaddress(i32 0) // TRAPV: call i8* @llvm.frameaddress(i32 0) // CATCH_UB: call i8* @llvm.frameaddress(i32 0) }
/** * Usage for accepting signatures: * $('.sigPad').signaturePad() * * Usage for displaying previous signatures: * $('.sigPad').signaturePad({displayOnly:true}).regenerate(sig) * or * var api = $('.sigPad').signaturePad({displayOnly:true}) * api.regenerate(sig) */ (function ($) { function SignaturePad (selector, options) { /** * Reference to the object for use in public methods * * @private * * @type {Object} */ var self = this /** * Holds the merged default settings and user passed settings * * @private * * @type {Object} */ , settings = $.extend({}, $.fn.signaturePad.defaults, options) /** * The current context, as passed by jQuery, of selected items * * @private * * @type {Object} */ , context = $(selector) /** * jQuery reference to the canvas element inside the signature pad * * @private * * @type {Object} */ , canvas = $(settings.canvas, context) /** * Dom reference to the canvas element inside the signature pad * * @private * * @type {Object} */ , element = canvas.get(0) /** * The drawing context for the signature canvas * * @private * * @type {Object} */ , canvasContext = null /** * Holds the previous point of drawing * Disallows drawing over the same location to make lines more delicate * * @private * * @type {Object} */ , previous = {'x': null, 'y': null} /** * An array holding all the points and lines to generate the signature * Each item is an object like: * { * mx: moveTo x coordinate * my: moveTo y coordinate * lx: lineTo x coordinate * lx: lineTo y coordinate * } * * @private * * @type {Array} */ , output = [] /** * Stores a timeout for when the mouse leaves the canvas * If the mouse has left the canvas for a specific amount of time * Stops drawing on the canvas * * @private * * @type {Object} */ , mouseLeaveTimeout = false /** * Whether the mouse button is currently pressed down or not * * @private * * @type {Boolean} */ , mouseButtonDown = false /** * Whether the browser is a touch event browser or not * * @private * * @type {Boolean} */ , touchable = false /** * Whether events have already been bound to the canvas or not * * @private * * @type {Boolean} */ , eventsBound = false /** * Remembers the default font-size when typing, and will allow it to be scaled for bigger/smaller names * * @private * * @type {Number} */ , typeItDefaultFontSize = 30 /** * Remembers the current font-size when typing * * @private * * @type {Number} */ , typeItCurrentFontSize = typeItDefaultFontSize /** * Remembers how many characters are in the name field, to help with the scaling feature * * @private * * @type {Number} */ , typeItNumChars = 0 /** * Clears the mouseLeaveTimeout * Resets some other variables that may be active * * @private */ function clearMouseLeaveTimeout () { clearTimeout(mouseLeaveTimeout) mouseLeaveTimeout = false mouseButtonDown = false } /** * Draws a line on canvas using the mouse position * Checks previous position to not draw over top of previous drawing * (makes the line really thick and poorly anti-aliased) * * @private * * @param {Object} e The event object * @param {Number} newYOffset A pixel value for drawing the newY, used for drawing a single dot on click */ function drawLine (e, newYOffset) { var offset, newX, newY e.preventDefault() offset = $(e.target).offset() clearTimeout(mouseLeaveTimeout) mouseLeaveTimeout = false if (typeof e.targetTouches !== 'undefined') { newX = Math.floor(e.targetTouches[0].pageX - offset.left) newY = Math.floor(e.targetTouches[0].pageY - offset.top) } else { newX = Math.floor(e.pageX - offset.left) newY = Math.floor(e.pageY - offset.top) } if (previous.x === newX && previous.y === newY) return true if (previous.x === null) previous.x = newX if (previous.y === null) previous.y = newY if (newYOffset) newY += newYOffset canvasContext.beginPath() canvasContext.moveTo(previous.x, previous.y) canvasContext.lineTo(newX, newY) canvasContext.lineCap = settings.penCap canvasContext.stroke() canvasContext.closePath() output.push({ 'lx' : newX , 'ly' : newY , 'mx' : previous.x , 'my' : previous.y }) previous.x = newX previous.y = newY if (settings.onDraw && typeof settings.onDraw === 'function') settings.onDraw.apply(self) } /** * Callback wrapper for executing stopDrawing without the event * Put up here so that it can be removed at a later time * * @private */ function stopDrawingWrapper () { stopDrawing() } /** * Callback registered to mouse/touch events of the canvas * Stops the drawing abilities * * @private * * @param {Object} e The event object */ function stopDrawing (e) { if (!!e) { drawLine(e, 1) } else { if (touchable) { canvas.each(function () { this.removeEventListener('touchmove', drawLine) // this.removeEventListener('MSPointerMove', drawLine) }) } else { canvas.unbind('mousemove.signaturepad') } if (output.length > 0 && settings.onDrawEnd && typeof settings.onDrawEnd === 'function') settings.onDrawEnd.apply(self) } previous.x = null previous.y = null if (settings.output && output.length > 0) $(settings.output, context).val(JSON.stringify(output)) } /** * Draws the signature line * * @private */ function drawSigLine () { if (!settings.lineWidth) return false canvasContext.beginPath() canvasContext.lineWidth = settings.lineWidth canvasContext.strokeStyle = settings.lineColour canvasContext.moveTo(settings.lineMargin, settings.lineTop) canvasContext.lineTo(element.width - settings.lineMargin, settings.lineTop) canvasContext.stroke() canvasContext.closePath() } /** * Clears all drawings off the canvas and redraws the signature line * * @private */ function clearCanvas () { canvasContext.clearRect(0, 0, element.width, element.height) canvasContext.fillStyle = settings.bgColour canvasContext.fillRect(0, 0, element.width, element.height) if (!settings.displayOnly) drawSigLine() canvasContext.lineWidth = settings.penWidth canvasContext.strokeStyle = settings.penColour $(settings.output, context).val('') output = [] stopDrawing() } /** * Callback registered to mouse/touch events of the canvas * Draws a line at the mouse cursor location, starting a new line if necessary * * @private * * @param {Object} e The event object * @param {Object} o The object context registered to the event; canvas */ function onMouseMove(e, o) { if (previous.x == null) { drawLine(e, 1) } else { drawLine(e, o) } } /** * Callback registered to mouse/touch events of canvas * Triggers the drawLine function * * @private * * @param {Object} e The event object * @param {Object} touchObject The object context registered to the event; canvas */ function startDrawing (e, touchObject) { if (touchable) { touchObject.addEventListener('touchmove', onMouseMove, false) // touchObject.addEventListener('MSPointerMove', onMouseMove, false) } else { canvas.bind('mousemove.signaturepad', onMouseMove) } // Draws a single point on initial mouse down, for people with periods in their name drawLine(e, 1) } /** * Removes all the mouse events from the canvas * * @private */ function disableCanvas () { eventsBound = false canvas.each(function () { if (this.removeEventListener) { this.removeEventListener('touchend', stopDrawingWrapper) this.removeEventListener('touchcancel', stopDrawingWrapper) this.removeEventListener('touchmove', drawLine) // this.removeEventListener('MSPointerUp', stopDrawingWrapper) // this.removeEventListener('MSPointerCancel', stopDrawingWrapper) // this.removeEventListener('MSPointerMove', drawLine) } if (this.ontouchstart) this.ontouchstart = null; }) $(document).unbind('mouseup.signaturepad') canvas.unbind('mousedown.signaturepad') canvas.unbind('mousemove.signaturepad') canvas.unbind('mouseleave.signaturepad') $(settings.clear, context).unbind('click.signaturepad') } /** * Lazy touch event detection * Uses the first press on the canvas to detect either touch or mouse reliably * Will then bind other events as needed * * @private * * @param {Object} e The event object */ function initDrawEvents (e) { if (eventsBound) return false eventsBound = true // Closes open keyboards to free up space $('input').blur(); if (typeof e.targetTouches !== 'undefined') touchable = true if (touchable) { canvas.each(function () { this.addEventListener('touchend', stopDrawingWrapper, false) this.addEventListener('touchcancel', stopDrawingWrapper, false) // this.addEventListener('MSPointerUp', stopDrawingWrapper, false) // this.addEventListener('MSPointerCancel', stopDrawingWrapper, false) }) canvas.unbind('mousedown.signaturepad') } else { $(document).bind('mouseup.signaturepad', function () { if (mouseButtonDown) { stopDrawing() clearMouseLeaveTimeout() } }) canvas.bind('mouseleave.signaturepad', function (e) { if (mouseButtonDown) stopDrawing(e) if (mouseButtonDown && !mouseLeaveTimeout) { mouseLeaveTimeout = setTimeout(function () { stopDrawing() clearMouseLeaveTimeout() }, 500) } }) canvas.each(function () { this.ontouchstart = null }) } } /** * Triggers the abilities to draw on the canvas * Sets up mouse/touch events, hides and shows descriptions and sets current classes * * @private */ function drawIt () { $(settings.typed, context).hide() clearCanvas() canvas.each(function () { this.ontouchstart = function (e) { e.preventDefault() mouseButtonDown = true initDrawEvents(e) startDrawing(e, this) } }) canvas.bind('mousedown.signaturepad', function (e) { e.preventDefault() // Only allow left mouse clicks to trigger signature drawing if (e.which > 1) return false mouseButtonDown = true initDrawEvents(e) startDrawing(e) }) $(settings.clear, context).bind('click.signaturepad', function (e) { e.preventDefault(); clearCanvas() }) $(settings.typeIt, context).bind('click.signaturepad', function (e) { e.preventDefault(); typeIt() }) $(settings.drawIt, context).unbind('click.signaturepad') $(settings.drawIt, context).bind('click.signaturepad', function (e) { e.preventDefault() }) $(settings.typeIt, context).removeClass(settings.currentClass) $(settings.drawIt, context).addClass(settings.currentClass) $(settings.sig, context).addClass(settings.currentClass) $(settings.typeItDesc, context).hide() $(settings.drawItDesc, context).show() $(settings.clear, context).show() } /** * Triggers the abilities to type in the input for generating a signature * Sets up mouse events, hides and shows descriptions and sets current classes * * @private */ function typeIt () { clearCanvas() disableCanvas() $(settings.typed, context).show() $(settings.drawIt, context).bind('click.signaturepad', function (e) { e.preventDefault(); drawIt() }) $(settings.typeIt, context).unbind('click.signaturepad') $(settings.typeIt, context).bind('click.signaturepad', function (e) { e.preventDefault() }) $(settings.output, context).val('') $(settings.drawIt, context).removeClass(settings.currentClass) $(settings.typeIt, context).addClass(settings.currentClass) $(settings.sig, context).removeClass(settings.currentClass) $(settings.drawItDesc, context).hide() $(settings.clear, context).hide() $(settings.typeItDesc, context).show() typeItCurrentFontSize = typeItDefaultFontSize = $(settings.typed, context).css('font-size').replace(/px/, '') } /** * Callback registered on key up and blur events for input field * Writes the text fields value as Html into an element * * @private * * @param {String} val The value of the input field */ function type (val) { var typed = $(settings.typed, context) , cleanedVal = val.replace(/>/g, '&gt;').replace(/</g, '&lt;').trim() , oldLength = typeItNumChars , edgeOffset = typeItCurrentFontSize * 0.5 typeItNumChars = cleanedVal.length typed.html(cleanedVal) if (!cleanedVal) { typed.css('font-size', typeItDefaultFontSize + 'px') return } if (typeItNumChars > oldLength && typed.outerWidth() > element.width) { while (typed.outerWidth() > element.width) { typeItCurrentFontSize-- typed.css('font-size', typeItCurrentFontSize + 'px') } } if (typeItNumChars < oldLength && typed.outerWidth() + edgeOffset < element.width && typeItCurrentFontSize < typeItDefaultFontSize) { while (typed.outerWidth() + edgeOffset < element.width && typeItCurrentFontSize < typeItDefaultFontSize) { typeItCurrentFontSize++ typed.css('font-size', typeItCurrentFontSize + 'px') } } } /** * Default onBeforeValidate function to clear errors * * @private * * @param {Object} context current context object * @param {Object} settings provided settings */ function onBeforeValidate (context, settings) { $('p.' + settings.errorClass, context).remove() context.removeClass(settings.errorClass) $('input, label', context).removeClass(settings.errorClass) } /** * Default onFormError function to show errors * * @private * * @param {Object} errors object contains validation errors (e.g. nameInvalid=true) * @param {Object} context current context object * @param {Object} settings provided settings */ function onFormError (errors, context, settings) { if (errors.nameInvalid) { context.prepend(['<p class="', settings.errorClass, '">', settings.errorMessage, '</p>'].join('')) $(settings.name, context).focus() $(settings.name, context).addClass(settings.errorClass) $('label[for=' + $(settings.name).attr('id') + ']', context).addClass(settings.errorClass) } if (errors.drawInvalid) context.prepend(['<p class="', settings.errorClass, '">', settings.errorMessageDraw, '</p>'].join('')) } /** * Validates the form to confirm a name was typed in the field * If drawOnly also confirms that the user drew a signature * * @private * * @return {Boolean} */ function validateForm () { var valid = true , errors = {drawInvalid: false, nameInvalid: false} , onBeforeArguments = [context, settings] , onErrorArguments = [errors, context, settings] if (settings.onBeforeValidate && typeof settings.onBeforeValidate === 'function') { settings.onBeforeValidate.apply(self,onBeforeArguments) } else { onBeforeValidate.apply(self, onBeforeArguments) } if (settings.drawOnly && output.length < 1) { errors.drawInvalid = true valid = false } if ($(settings.name, context).val() === '') { errors.nameInvalid = true valid = false } if (settings.onFormError && typeof settings.onFormError === 'function') { settings.onFormError.apply(self,onErrorArguments) } else { onFormError.apply(self, onErrorArguments) } return valid } /** * Redraws the signature on a specific canvas * * @private * * @param {Array} paths the signature JSON * @param {Object} context the canvas context to draw on * @param {Boolean} saveOutput whether to write the path to the output array or not */ function drawSignature (paths, context, saveOutput) { for(var i in paths) { if (typeof paths[i] === 'object') { context.beginPath() context.moveTo(paths[i].mx, paths[i].my) context.lineTo(paths[i].lx, paths[i].ly) context.lineCap = settings.penCap context.stroke() context.closePath() if (saveOutput) { output.push({ 'lx' : paths[i].lx , 'ly' : paths[i].ly , 'mx' : paths[i].mx , 'my' : paths[i].my }) } } } } /** * Initialisation function, called immediately after all declarations * Technically public, but only should be used internally * * @private */ function init () { // Fixes the jQuery.fn.offset() function for Mobile Safari Browsers i.e. iPod Touch, iPad and iPhone // https://gist.github.com/661844 // http://bugs.jquery.com/ticket/6446 if (parseFloat(((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)) || [0,'4_2'])[1].replace('_','.')) < 4.1) { $.fn.Oldoffset = $.fn.offset; $.fn.offset = function () { var result = $(this).Oldoffset() result.top -= window.scrollY result.left -= window.scrollX return result } } // Disable selection on the typed div and canvas $(settings.typed, context).bind('selectstart.signaturepad', function (e) { return $(e.target).is(':input') }) canvas.bind('selectstart.signaturepad', function (e) { return $(e.target).is(':input') }) if (!element.getContext && FlashCanvas) FlashCanvas.initElement(element) if (element.getContext) { canvasContext = element.getContext('2d') $(settings.sig, context).show() if (!settings.displayOnly) { if (!settings.drawOnly) { $(settings.name, context).bind('keyup.signaturepad', function () { type($(this).val()) }) $(settings.name, context).bind('blur.signaturepad', function () { type($(this).val()) }) $(settings.drawIt, context).bind('click.signaturepad', function (e) { e.preventDefault() drawIt() }) } if (settings.drawOnly || settings.defaultAction === 'drawIt') { drawIt() } else { typeIt() } if (settings.validateFields) { if ($(selector).is('form')) { $(selector).bind('submit.signaturepad', function () { return validateForm() }) } else { $(selector).parents('form').bind('submit.signaturepad', function () { return validateForm() }) } } $(settings.sigNav, context).show() } } } $.extend(self, { /** * A property to store the current version of Signature Pad */ signaturePad : '{{version}}' /** * Initializes SignaturePad */ , init : function () { init() } /** * Allows options to be updated after initialization * * @param {Object} options An object containing the options to be changed */ , updateOptions : function (options) { $.extend(settings, options) } /** * Regenerates a signature on the canvas using an array of objects * Follows same format as object property * @see var object * * @param {Array} paths An array of the lines and points */ , regenerate : function (paths) { self.clearCanvas() $(settings.typed, context).hide() if (typeof paths === 'string') paths = JSON.parse(paths) drawSignature(paths, canvasContext, true) if (settings.output && $(settings.output, context).length > 0) $(settings.output, context).val(JSON.stringify(output)) } /** * Clears the canvas * Redraws the background colour and the signature line */ , clearCanvas : function () { clearCanvas() } /** * Returns the signature as a Js array * * @return {Array} */ , getSignature : function () { return output } /** * Returns the signature as a Json string * * @return {String} */ , getSignatureString : function () { return JSON.stringify(output) } /** * Returns the signature as an image * Re-draws the signature in a shadow canvas to create a clean version * * @return {String} */ , getSignatureImage : function () { var tmpCanvas = document.createElement('canvas') , tmpContext = null , data = null tmpCanvas.style.position = 'absolute' tmpCanvas.style.top = '-999em' tmpCanvas.width = element.width tmpCanvas.height = element.height document.body.appendChild(tmpCanvas) if (!tmpCanvas.getContext && FlashCanvas) FlashCanvas.initElement(tmpCanvas) tmpContext = tmpCanvas.getContext('2d') tmpContext.fillStyle = settings.bgColour tmpContext.fillRect(0, 0, element.width, element.height) tmpContext.lineWidth = settings.penWidth tmpContext.strokeStyle = settings.penColour drawSignature(output, tmpContext) data = tmpCanvas.toDataURL.apply(tmpCanvas, arguments) document.body.removeChild(tmpCanvas) tmpCanvas = null return data } /** * The form validation function * Validates that the signature has been filled in properly * Allows it to be hooked into another validation function and called at a different time * * @return {Boolean} */ , validateForm : function () { return validateForm() } }) } /** * Create the plugin * Returns an Api which can be used to call specific methods * * @param {Object} options The options array * * @return {Object} The Api for controlling the instance */ $.fn.signaturePad = function (options) { var api = null this.each(function () { if (!$.data(this, 'plugin-signaturePad')) { api = new SignaturePad(this, options) api.init() $.data(this, 'plugin-signaturePad', api) } else { api = $.data(this, 'plugin-signaturePad') api.updateOptions(options) } }) return api } /** * Expose the defaults so they can be overwritten for multiple instances * * @type {Object} */ $.fn.signaturePad.defaults = { defaultAction : 'typeIt' // What action should be highlighted first: typeIt or drawIt , displayOnly : false // Initialize canvas for signature display only; ignore buttons and inputs , drawOnly : false // Whether the to allow a typed signature or not , canvas : 'canvas' // Selector for selecting the canvas element , sig : '.sig' // Parts of the signature form that require Javascript (hidden by default) , sigNav : '.sigNav' // The TypeIt/DrawIt navigation (hidden by default) , bgColour : '#ffffff' // The colour fill for the background of the canvas; or transparent , penColour : '#145394' // Colour of the drawing ink , penWidth : 2 // Thickness of the pen , penCap : 'round' // Determines how the end points of each line are drawn (values: 'butt', 'round', 'square') , lineColour : '#ccc' // Colour of the signature line , lineWidth : 2 // Thickness of the signature line , lineMargin : 5 // Margin on right and left of signature line , lineTop : 35 // Distance to draw the line from the top , name : '.name' // The input field for typing a name , typed : '.typed' // The Html element to accept the printed name , clear : '.clearButton' // Button for clearing the canvas , typeIt : '.typeIt a' // Button to trigger name typing actions (current by default) , drawIt : '.drawIt a' // Button to trigger name drawing actions , typeItDesc : '.typeItDesc' // The description for TypeIt actions , drawItDesc : '.drawItDesc' // The description for DrawIt actions (hidden by default) , output : '.output' // The hidden input field for remembering line coordinates , currentClass : 'current' // The class used to mark items as being currently active , validateFields : true // Whether the name, draw fields should be validated , errorClass : 'error' // The class applied to the new error Html element , errorMessage : 'Please enter your name' // The error message displayed on invalid submission , errorMessageDraw : 'Please sign the document' // The error message displayed when drawOnly and no signature is drawn , onBeforeValidate : null // Pass a callback to be used instead of the built-in function , onFormError : null // Pass a callback to be used instead of the built-in function , onDraw : null // Pass a callback to be used to capture the drawing process , onDrawEnd : null // Pass a callback to be exectued after the drawing process } }(jQuery))
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CHROME_INTERNAL_LOG_SOURCE_H_ #define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CHROME_INTERNAL_LOG_SOURCE_H_ #include "base/macros.h" #include "build/build_config.h" #include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" namespace system_logs { // Fetches internal Chrome logs. class ChromeInternalLogSource : public SystemLogsSource { public: ChromeInternalLogSource(); ~ChromeInternalLogSource() override; // SystemLogsSource override. void Fetch(const SysLogsSourceCallback& request) override; private: void PopulateSyncLogs(SystemLogsResponse* response); void PopulateExtensionInfoLogs(SystemLogsResponse* response); void PopulateDataReductionProxyLogs(SystemLogsResponse* response); #if defined(OS_WIN) void PopulateUsbKeyboardDetected(SystemLogsResponse* response); #endif DISALLOW_COPY_AND_ASSIGN(ChromeInternalLogSource); }; } // namespace system_logs #endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CHROME_INTERNAL_LOG_SOURCE_H_
# encoding: UTF-8 require 'pathname' base = Pathname(__FILE__).dirname.expand_path Dir.glob(base + '*.rb').each do |file| require file end
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime import ( "runtime/internal/sys" "unsafe" ) type sigctxt struct { info *siginfo ctxt unsafe.Pointer } func (c *sigctxt) regs() *sigcontext { return &(*ucontext)(c.ctxt).uc_mcontext } func (c *sigctxt) r0() uint32 { return c.regs().r0 } func (c *sigctxt) r1() uint32 { return c.regs().r1 } func (c *sigctxt) r2() uint32 { return c.regs().r2 } func (c *sigctxt) r3() uint32 { return c.regs().r3 } func (c *sigctxt) r4() uint32 { return c.regs().r4 } func (c *sigctxt) r5() uint32 { return c.regs().r5 } func (c *sigctxt) r6() uint32 { return c.regs().r6 } func (c *sigctxt) r7() uint32 { return c.regs().r7 } func (c *sigctxt) r8() uint32 { return c.regs().r8 } func (c *sigctxt) r9() uint32 { return c.regs().r9 } func (c *sigctxt) r10() uint32 { return c.regs().r10 } func (c *sigctxt) fp() uint32 { return c.regs().fp } func (c *sigctxt) ip() uint32 { return c.regs().ip } func (c *sigctxt) sp() uint32 { return c.regs().sp } func (c *sigctxt) lr() uint32 { return c.regs().lr } func (c *sigctxt) pc() uint32 { return c.regs().pc } func (c *sigctxt) cpsr() uint32 { return c.regs().cpsr } func (c *sigctxt) fault() uint32 { return c.regs().fault_address } func (c *sigctxt) trap() uint32 { return c.regs().trap_no } func (c *sigctxt) error() uint32 { return c.regs().error_code } func (c *sigctxt) oldmask() uint32 { return c.regs().oldmask } func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) } func (c *sigctxt) sigaddr() uint32 { return c.info.si_addr } func (c *sigctxt) set_pc(x uint32) { c.regs().pc = x } func (c *sigctxt) set_sp(x uint32) { c.regs().sp = x } func (c *sigctxt) set_lr(x uint32) { c.regs().lr = x } func (c *sigctxt) set_r10(x uint32) { c.regs().r10 = x } func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) } func (c *sigctxt) set_sigaddr(x uint32) { *(*uintptr)(add(unsafe.Pointer(c.info), 2*sys.PtrSize)) = uintptr(x) }
<html> <body> I am a 404 page! </body> </html>
// 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. // Copyright 2006 Google Inc. All Rights Reserved. /** * @fileoverview Anchored viewport positioning class with both adjust and * resize options for the popup. * */ goog.provide('goog.positioning.MenuAnchoredPosition'); goog.require('goog.math.Box'); goog.require('goog.math.Coordinate'); goog.require('goog.math.Size'); goog.require('goog.positioning'); goog.require('goog.positioning.AnchoredViewportPosition'); goog.require('goog.positioning.Corner'); goog.require('goog.positioning.CornerBit'); goog.require('goog.positioning.Overflow'); goog.require('goog.positioning.OverflowStatus'); /** * Encapsulates a popup position where the popup is anchored at a corner of * an element. The positioning behavior changes based on the values of * opt_adjust and opt_resize. * * When using this positioning object it's recommended that the movable element * be absolutely positioned. * * @param {Element} anchorElement Element the movable element should be * anchored against. * @param {goog.positioning.Corner} corner Corner of anchored element the * movable element should be positioned at. * @param {boolean} opt_adjust Whether the positioning should be adjusted until * the element fits inside the viewport even if that means that the anchored * corners are ignored. * @param {boolean} opt_resize Whether the positioning should be adjusted until * the element fits inside the viewport on the X axis and it's heigh is * resized so if fits in the viewport. This take precedence over * opt_adjust. * @constructor * @extends {goog.positioning.AnchoredViewportPosition} */ goog.positioning.MenuAnchoredPosition = function(anchorElement, corner, opt_adjust, opt_resize) { goog.positioning.AnchoredViewportPosition.call(this, anchorElement, corner, opt_adjust); /** * Whether the positioning should be adjusted until the element fits inside * the viewport even if that means that the anchored corners are ignored. * @type {boolean|undefined} * @private */ this.resize_ = opt_resize; }; goog.inherits(goog.positioning.MenuAnchoredPosition, goog.positioning.AnchoredViewportPosition); /** * Repositions the movable element. * * @param {Element} movableElement Element to position. * @param {goog.positioning.Corner} movableCorner Corner of the movable element * that should be positioned adjacent to the anchored element. * @param {goog.math.Box} opt_margin A margin specifin pixels. * @param {goog.math.Size} opt_preferredSize Preferred size of the * moveableElement. */ goog.positioning.MenuAnchoredPosition.prototype.reposition = function(movableElement, movableCorner, opt_margin, opt_preferredSize) { if (this.resize_) { goog.positioning.positionAtAnchor(this.element, this.corner, movableElement, movableCorner, null, opt_margin, goog.positioning.Overflow.ADJUST_X | goog.positioning.Overflow.RESIZE_HEIGHT, opt_preferredSize); } else { goog.positioning.MenuAnchoredPosition.superClass_.reposition.call( this, movableElement, movableCorner, opt_margin, opt_preferredSize); } };
// // PodcastEpisodePage.cs // // Author: // Gabriel Burt <gburt@novell.com> // // Copyright (C) 2008 Novell, Inc. // // 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. // using System; using System.Collections.Generic; using Mono.Unix; using Gtk; using Hyena.Widgets; using Banshee.Gui.TrackEditor; using Banshee.Podcasting.Data; namespace Banshee.Podcasting.Gui { public class PodcastEpisodePage : Gtk.ScrolledWindow, ITrackEditorPage { private VBox box; private WrapLabel podcast = new WrapLabel (); private WrapLabel author = new WrapLabel (); private WrapLabel published = new WrapLabel (); private WrapLabel description = new WrapLabel (); public PodcastEpisodePage () { BorderWidth = 2; ShadowType = ShadowType.None; HscrollbarPolicy = PolicyType.Never; VscrollbarPolicy = PolicyType.Automatic; box = new VBox (); box.BorderWidth = 6; box.Spacing = 12; box.PackStart (podcast, false, false, 0); box.PackStart (author, false, false, 0); box.PackStart (published, false, false, 0); box.PackStart (description, true, true, 0); AddWithViewport (box); ShowAll (); } public void Initialize (TrackEditorDialog dialog) { } public void LoadTrack (EditorTrackInfo track) { BorderWidth = 2; PodcastTrackInfo info = PodcastTrackInfo.From (track.SourceTrack); if (info == null) { Hide (); return; } podcast.Markup = SetInfo (Catalog.GetString ("Podcast"), track.SourceTrack.AlbumTitle); author.Markup = SetInfo (Catalog.GetString ("Author"), track.SourceTrack.ArtistName); published.Markup = SetInfo (Catalog.GetString ("Published"), info.PublishedDate.ToLongDateString ()); description.Markup = SetInfo (Catalog.GetString ("Description"), info.Description); // IsDownloaded // IsNew Show (); } private static string info_str = "<b>{0}</b>\n{1}"; private static string SetInfo (string title, string info) { return String.Format (info_str, GLib.Markup.EscapeText (title), GLib.Markup.EscapeText (info) ); } public int Order { get { return 40; } } public string Title { get { return Catalog.GetString ("Episode Details"); } } public PageType PageType { get { return PageType.View; } } public Gtk.Widget TabWidget { get { return null; } } public Gtk.Widget Widget { get { return this; } } } }
<?php return [ 'Names' => [ 'AE' => 'Dei sameinte arabiske emirata', 'AT' => 'Austerrike', 'BL' => 'Saint Barthélemy', 'BY' => 'Kviterussland', 'CC' => 'Kokosøyane', 'CD' => 'Kongo-Kinshasa', 'CF' => 'Den sentralafrikanske republikken', 'CI' => 'Elfenbeinskysten', 'CK' => 'Cookøyane', 'DO' => 'Den dominikanske republikken', 'FK' => 'Falklandsøyane', 'FO' => 'Færøyane', 'GS' => 'Sør-Georgia og Sør-Sandwichøyane', 'HM' => 'Heardøya og McDonaldøyane', 'KM' => 'Komorane', 'KY' => 'Caymanøyane', 'LU' => 'Luxembourg', 'MH' => 'Marshalløyane', 'MP' => 'Nord-Marianane', 'MV' => 'Maldivane', 'NO' => 'Noreg', 'PH' => 'Filippinane', 'PN' => 'Pitcairn', 'SB' => 'Salomonøyane', 'SC' => 'Seychellane', 'SH' => 'Saint Helena', 'TC' => 'Turks- og Caicosøyane', 'TF' => 'Dei franske sørterritoria', 'TL' => 'Aust-Timor', 'UM' => 'USAs ytre småøyar', 'VC' => 'St. Vincent og Grenadinane', 'VG' => 'Dei britiske Jomfruøyane', 'VI' => 'Dei amerikanske Jomfruøyane', ], ];
/*****************************/ /* General.scss */ /* Main styles for DataStory */ /*****************************/ /***************/ /* General / /***************/ /* line 68, ../sass/general.scss */ html { height: 100%; } /* line 72, ../sass/general.scss */ body { padding: 0; margin: 0; background-color: #f2f2f2; text-align: center; height: 100%; } /* line 80, ../sass/general.scss */ #black_veil { display: none; width: 100%; min-height: 100%; background-color: #000; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); opacity: 0.8; position: fixed; z-index: 4; top: 0; left: 0; } /* line 95, ../sass/general.scss */ #loader { position: fixed; z-index: 5; display: none; top: 45%; left: 45%; } /* line 103, ../sass/general.scss */ .clear { clear: both; } /***************/ /* Container / /***************/ /* line 113, ../sass/general.scss */ #container { width: 960px; margin: 0 auto; text-align: left; min-height: 100%; position: relative; font-family: Arial, Helvetica, Garuda, sans-serif; background-color: white; color: #555555; -moz-box-shadow: #7f7f7f 0px 0px 10px; -webkit-box-shadow: #7f7f7f 0px 0px 10px; -o-box-shadow: #7f7f7f 0px 0px 10px; box-shadow: #7f7f7f 0px 0px 10px; } /* line 128, ../sass/general.scss */ #container a { text-decoration: underline; color: black; } /* line 131, ../sass/general.scss */ #container a:hover { text-decoration: underline; } /* line 135, ../sass/general.scss */ #screen_container { min-height: 330px; position: relative; top: 0; left: 0; padding: 0; margin: 0 60px; } /***************/ /* Header / /***************/ /* line 152, ../sass/general.scss */ #header { width: 960px; position: relative; top: 0; left: 0; height: 90px; } /* line 160, ../sass/general.scss */ #logo { position: absolute; z-index: 0; width: 360px; margin-left: 60px; margin-top: -5px; background-image: url("../../images/logo_header.png"); width: 404px; height: 75px; cursor: pointer; } /* line 172, ../sass/general.scss */ #navbar { width: 900px; margin-right: 60px; background-color: transparent; position: absolute; z-index: 3; top: 45px; left: 0; height: 30px; text-transform: uppercase; font-size: 0.6em; } /* line 184, ../sass/general.scss */ #navbar #promo { width: 264px; float: right; text-align: right; margin-top: 15px; } /* line 191, ../sass/general.scss */ #navbar #languages { width: 180px; float: right; margin-top: 15px; text-align: right; } /* line 197, ../sass/general.scss */ #navbar #languages .language { margin: 0; display: inline; color: #606060; cursor: pointer; } /* line 202, ../sass/general.scss */ #navbar #languages .language:hover { text-decoration: underline; } /* line 206, ../sass/general.scss */ #navbar #loggedin { float: left; margin: 0px 0 0 60px; font-size: 0.9em; } /* line 212, ../sass/general.scss */ #navbar #loggedin #my_vis { margin: 15px 5px 0 0; float: right; } /* line 217, ../sass/general.scss */ #navbar #loggedin #my_vis a { cursor: pointer; color: white; text-decoration: none; background-color: #5e9dcd; -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; -khtml-border-radius: 2px; border-radius: 2px; padding: 0 3px; } /* line 224, ../sass/general.scss */ #navbar #loggedin #my_vis a:hover { color: #5e9dcd; background-color: white; } /* line 227, ../sass/general.scss */ #navbar #loggedin #loggedas { float: right; margin: 15px 5px 0 0; color: #555555; } /* line 233, ../sass/general.scss */ #navbar #loggedin #logout { margin: 15px 5px 0 0; float: right; cursor: pointer; color: #5e9dcd; } /* line 238, ../sass/general.scss */ #navbar #loggedin #logout:hover { color: #555555; } /***************/ /* Buttons */ /***************/ /* line 250, ../sass/general.scss */ .button { cursor: pointer; height: 30px; background: white; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #cccccc)); background-image: -webkit-linear-gradient(#ffffff, #cccccc); background-image: -moz-linear-gradient(#ffffff, #cccccc); background-image: -o-linear-gradient(#ffffff, #cccccc); background-image: -ms-linear-gradient(#ffffff, #cccccc); background-image: linear-gradient(#ffffff, #cccccc); -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; -khtml-border-radius: 2px; border-radius: 2px; border-color: #E3E3E3 #DBDBDB #DBDBDB #E3E3E3; border-right: 1px solid #DBDBDB; border-style: solid; border-width: 1px; color: #444444; text-shadow: rgba(255, 255, 255, 0.2) 1px 1px 0, rgba(255, 255, 255, 0.2) 1px 1px 0, rgba(255, 255, 255, 0.2) 1px 1px 0; } /* line 269, ../sass/general.scss */ .nav { font-size: 1.2em; width: 108px; } /* line 275, ../sass/general.scss */ #button_next, #button_prev { cursor: pointer; position: absolute; top: 240px; width: 120px; text-align: center; } /* line 283, ../sass/general.scss */ #button_next { right: -95px; } /* line 286, ../sass/general.scss */ #button_next #next, #button_next #new_chart { -moz-border-radius-topright: 25px; -webkit-border-top-right-radius: 25px; -o-border-top-right-radius: 25px; -ms-border-top-right-radius: 25px; -khtml-border-top-right-radius: 25px; border-top-right-radius: 25px; -moz-border-radius-bottomright: 25px; -webkit-border-bottom-right-radius: 25px; -o-border-bottom-right-radius: 25px; -ms-border-bottom-right-radius: 25px; -khtml-border-bottom-right-radius: 25px; border-bottom-right-radius: 25px; height: 100px; width: 70px; border-left: none; } /* line 294, ../sass/general.scss */ #button_prev { left: -95px; } /* line 296, ../sass/general.scss */ #button_prev #prev { -moz-border-radius-topleft: 25px; -webkit-border-top-left-radius: 25px; -o-border-top-left-radius: 25px; -ms-border-top-left-radius: 25px; -khtml-border-top-left-radius: 25px; border-top-left-radius: 25px; -moz-border-radius-bottomleft: 25px; -webkit-border-bottom-left-radius: 25px; -o-border-bottom-left-radius: 25px; -ms-border-bottom-left-radius: 25px; -khtml-border-bottom-left-radius: 25px; border-bottom-left-radius: 25px; height: 100px; width: 70px; border-right: none; } /***************/ /* Breadcrumbs */ /***************/ /* line 323, ../sass/general.scss */ #breadcrumbs { height: 30px; text-align: center; margin: 0 60px 15px 60px; width: 840px; } /* line 330, ../sass/general.scss */ #breadcrumbs .on { background-color: #5e9dcd; color: white; float: left; width: 202px; margin: 0 5px; padding: 5px 0; text-align: center; -moz-border-radius: 6px; -webkit-border-radius: 6px; -o-border-radius: 6px; -ms-border-radius: 6px; -khtml-border-radius: 6px; border-radius: 6px; letter-spacing: -1px; font-stretch: 90%; text-transform: uppercase; font-weight: bold; } /* line 336, ../sass/general.scss */ #breadcrumbs .off { background-color: #606060; color: #555555; float: left; width: 202px; margin: 0 5px; padding: 5px 0; text-align: center; -moz-border-radius: 6px; -webkit-border-radius: 6px; -o-border-radius: 6px; -ms-border-radius: 6px; -khtml-border-radius: 6px; border-radius: 6px; letter-spacing: -1px; font-stretch: 90%; text-transform: uppercase; font-weight: bold; } /***************/ /* Error box */ /***************/ /* line 346, ../sass/general.scss */ #error { display: none; color: #000; font-weight: bold; cursor: pointer; background: #ffff88; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffff88), color-stop(100%, #ffff3a)); background-image: -webkit-linear-gradient(#ffff88, #ffff3a); background-image: -moz-linear-gradient(#ffff88, #ffff3a); background-image: -o-linear-gradient(#ffff88, #ffff3a); background-image: -ms-linear-gradient(#ffff88, #ffff3a); background-image: linear-gradient(#ffff88, #ffff3a); font-size: 12px; padding: 5px 10px; margin: 5px; width: 240px; z-index: 5; position: absolute; top: 10px; right: 10px; -moz-box-shadow: 0px 0px 5px #333333; -webkit-box-shadow: 0px 0px 5px #333333; -o-box-shadow: 0px 0px 5px #333333; box-shadow: 0px 0px 5px #333333; -moz-border-radius: 6px; -webkit-border-radius: 6px; -o-border-radius: 6px; -ms-border-radius: 6px; -khtml-border-radius: 6px; border-radius: 6px; } /******************/ /* Warning edit */ /******************/ #warning_edit { color: #000; font-weight: normal; background: #ab2b2e; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ab2b2e), color-stop(100%, #892225)); background-image: -webkit-linear-gradient(#ab2b2e, #892225); background-image: -moz-linear-gradient(#ab2b2e, #892225); background-image: -o-linear-gradient(#ab2b2e, #892225); background-image: -ms-linear-gradient(#ab2b2e, #892225); background-image: linear-gradient(#ab2b2e, #892225); font-size: 12px; padding: 5px 10px; margin: 10px 60px 20px 60px; width: 821px; z-index: 2; position: relative; top: 0px; left: 0px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; -ms-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; } /****************/ /* Input screen */ /****************/ #input { position: relative; z-index: 3; } /* line 411, ../sass/general.scss */ #input #explainer { font-size: 1.2em; } /* line 414, ../sass/general.scss */ #input #input_data { width: 818px; color: #555555; background-color: #f2f2f2; -moz-box-shadow: inset 0 0 10px 5px "#999"; -webkit-box-shadow: inset 0 0 10px 5px "#999"; -o-box-shadow: inset 0 0 10px 5px "#999"; box-shadow: inset 0 0 10px 5px "#999"; border: 1px solid #7f7f7f; height: 150px; padding: 10px; } #sample_data { font-size: 0.8em; width: 70%; } #sample_data ul { margin: 0; padding: 0; } #sample_data li { list-style: none; cursor: pointer; text-decoration: underline; margin: 0 1%; text-indent: -1%; } #sample_data li:hover { text-decoration: none; } /****************/ /* Check screen */ /****************/ /* line 450, ../sass/general.scss */ #check #explainer { font-size: 1.2em; } /* line 454, ../sass/general.scss */ #check #explainer #sub_explainer { font-size: 0.8em; } /* line 458, ../sass/general.scss */ #check #explainer #sub_explainer p { margin: 5px 10px; } /* line 462, ../sass/general.scss */ #check #explainer #sub_explainer .transpose { font-size: 0.8em; width: 240px; } #check table { margin-top: 10px; width: 840px; padding: 10px; font-size: 0.8em; } #check td { background-color: #f2f2f2; text-align: center; width: 120px; } #check .header_cell { font-weight: bold; background-color: #5e9dcd; } #check .empty_cell { background-color: white; } /********************/ /* Visualize screen */ /********************/ #visualize #chart { width: 840px; height: 300px; margin: 30px 0; padding: 0; overflow: hidden; } /* line 508, ../sass/general.scss */ #visualize #explainer { font-size: 1.2em; } /* line 512, ../sass/general.scss */ #visualize #chart_customization { width: 840px; height: 90px; padding: 0; } #visualize #chart_customization input, #visualize #chart_customization select { width: 240px; font-size: 1em; color: #555555; background-color: #f2f2f2; -moz-box-shadow: inset 0 0 1px 0.5px "#999"; -webkit-box-shadow: inset 0 0 1px 0.5px "#999"; -o-box-shadow: inset 0 0 1px 0.5px "#999"; box-shadow: inset 0 0 1px 0.5px "#999"; border: 1px solid #7f7f7f; height: 25px; } /* line 524, ../sass/general.scss */ #visualize #chart_customization input { padding: 0 10px; } /* line 527, ../sass/general.scss */ #visualize #chart_customization select { width: 260px; padding: 4px 0 0 4px; } /* line 532, ../sass/general.scss */ #visualize #chart_customization .desc { width: 529px; } /* line 536, ../sass/general.scss */ #visualize #chart_customization .inactive { background-color: #f2f2f2; color: white; border: #7f7f7f; } #visualize #chart_info { position: absolute; right: -25px; top: 25px; width: 25px; height: 21px; background-image: url("../../images/question_mark.png"); cursor: pointer; } #visualize #chart_desc_box { position: absolute; top: 58px; left: 600px; z-index: 2; font-size: 0.75em; width: 240px; border: #7f7f7f 1px solid; background: white; -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; -khtml-border-radius: 2px; border-radius: 2px; -moz-box-shadow: #7f7f7f 0px 0px 5px; -webkit-box-shadow: #7f7f7f 0px 0px 5px; -o-box-shadow: #7f7f7f 0px 0px 5px; box-shadow: #7f7f7f 0px 0px 5px; padding: 5px; display: none; } #visualize #chart_desc_box img { width: 15px; height: 15px; } #visualize .chart_customizator { float: left; font-size: 0.9em; height: 30px; margin: 0 61px 5px 0; width: 228px; } /********************/ /* Publish screen */ /********************/ /* line 597, ../sass/general.scss */ #publish #explainer { font-size: 1.2em; } /* line 601, ../sass/general.scss */ #publish p { margin: 8px 0 2px 0; } /* line 605, ../sass/general.scss */ #publish #direct_link_url { width: 480px; margin: 5px auto; padding: 2px; font-size: 1em; color: #555555; background-color: #f2f2f2; -moz-box-shadow: inset 0 0 1px 0.5px "#999"; -webkit-box-shadow: inset 0 0 1px 0.5px "#999"; -o-box-shadow: inset 0 0 1px 0.5px "#999"; box-shadow: inset 0 0 1px 0.5px "#999"; border: 1px solid #7f7f7f; margin-bottom: 5px; } #publish #iframe_code { position: relative; z-index: 3; width: 480px; height: 60px; margin: 5px auto; display: block; font-size: 1em; color: #555555; background-color: #f2f2f2; -moz-box-shadow: inset 0 0 1px 0.5px "#999"; -webkit-box-shadow: inset 0 0 1px 0.5px "#999"; -o-box-shadow: inset 0 0 1px 0.5px "#999"; box-shadow: inset 0 0 1px 0.5px "#999"; border: 1px solid #7f7f7f; } #publish .embed_customization { font-size: 0.9em; margin-bottom: 5px; } #publish .embed_customizator { position: relative; z-index: 3; width: 40px; color: #555555; background-color: #f2f2f2; -moz-box-shadow: inset 0 0 1px 0.5px "#999"; -webkit-box-shadow: inset 0 0 1px 0.5px "#999"; -o-box-shadow: inset 0 0 1px 0.5px "#999"; box-shadow: inset 0 0 1px 0.5px "#999"; border: 1px solid #7f7f7f; } #publish #embed { margin: 0 auto; background-color: #fff; } /************************************/ /* Popups */ /************************************/ .popup { padding: 20px; margin: 0; background-color: #f2f2f2; max-height: 576px; width: 720px; text-align: left; font-family: Arial, Helvetica, Garuda, sans-serif; color: #444444; font-size: 0.8em; } /* line 660, ../sass/general.scss */ .popup li { margin-top: 1.1em; } /* line 664, ../sass/general.scss */ .popup a { color: #444444; text-decoration: underline; } .popup a:hover { text-decoration: none; } #quickstart_noshow { -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; -ms-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; padding: 5px; background-color: white; border: 1px solid #e5e5e5; font-family: Arial, Helvetica, Garuda, sans-serif; font-size: 0.9em; } /************************************/ /* Footer */ /************************************/ #footer { padding: 20px 60px; height: 50px; margin: 200px 0 0 0; text-transform: uppercase; color: #444444; font-size: 0.7em; clear: both; } /* line 697, ../sass/general.scss */ #footer .separator, #promo .separator { color: #555555; } /* line 701, ../sass/general.scss */ #footer a, #promo a { color: #555555; font-size: 0.9em; } #footer a:hover, #promo a:hover { text-decoration: none; } /**** Tutorial ****/ .button_tutorial { margin-left: 360px; cursor: pointer; background: white; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #cccccc)); background-image: -webkit-linear-gradient(#ffffff, #cccccc); background-image: -moz-linear-gradient(#ffffff, #cccccc); background-image: -o-linear-gradient(#ffffff, #cccccc); background-image: -ms-linear-gradient(#ffffff, #cccccc); background-image: linear-gradient(#ffffff, #cccccc); -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; -khtml-border-radius: 2px; border-radius: 2px; border-color: #E3E3E3 #DBDBDB #DBDBDB #E3E3E3; border-right: 1px solid #DBDBDB; border-style: solid; border-width: 1px; color: #444444; text-shadow: rgba(255, 255, 255, 0.2) 1px 1px 0, rgba(255, 255, 255, 0.2) 1px 1px 0, rgba(255, 255, 255, 0.2) 1px 1px 0; } /* line 727, ../sass/general.scss */ #tutorial { min-height: 450px; } /* line 731, ../sass/general.scss */ #tutorial h1 { font-size: 1.5em; } /* line 735, ../sass/general.scss */ #tutorial a { text-decoration: underline; color: black; } /* line 738, ../sass/general.scss */ #tutorial a:hover { text-decoration: underline; } /* line 742, ../sass/general.scss */ #tutorial img { -moz-box-shadow: #7f7f7f 0px 0px 10px; -webkit-box-shadow: #7f7f7f 0px 0px 10px; -o-box-shadow: #7f7f7f 0px 0px 10px; box-shadow: #7f7f7f 0px 0px 10px; margin-left: 60px; } .tutorial_class { display: none; } /**** Login ****/ /* line 754, ../sass/general.scss */ #login, #signup, #reminder, #new_pwd { float: left; } /* line 758, ../sass/general.scss */ #login .login, #signup .login, #reminder .login, #new_pwd .login { -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; -khtml-border-radius: 2px; border-radius: 2px; border: 1px #000 solid; float: left; margin: 2px 0; font-size: 1em; height: 1.3em; width: 96%; padding: 2px 7px; } #login #password_forgotten, #signup #password_forgotten, #reminder #password_forgotten, #new_pwd #password_forgotten { font-size: 0.7em; width: 100%; text-align: right; cursor: pointer; text-decoration: underline; } #login #password_forgotten:hover, #signup #password_forgotten:hover, #reminder #password_forgotten:hover, #new_pwd #password_forgotten:hover { text-decoration: none; } #login, #about, #signup, #reminder, #new_pwd { width: 390px; height: 234px; padding: 10px; float: left; position: relative; background-color: #335ea9; color: #fff; } #login_submit, #signup_submit, #show_login, #show_signup, #reminder_submit, #pwd_change_submit { font-size: 0.9em; line-height: 1.7em; font-weight: bold; margin: 10px 0; } #login_submit { margin-top: -5px; margin-left: 0; } #show_signup { position: relative; margin: 2px 0; right: 0px; width: 100%; background-color: #fff; border: 1px #000 solid; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; -ms-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; font-size: 1em; padding: 7px; cursor: pointer; text-decoration: underline; } #login, #signup { background-color: #335ea9; color: #fff; } /* line 824, ../sass/general.scss */ #login a, #signup a { color: #fff; } /* line 826, ../sass/general.scss */ #login a:hover, #signup a:hover { text-decoration: none; } /* line 829, ../sass/general.scss */ #login h2, #signup h2 { font-size: 1.1em; font-weight: normal; } #additional_ressources { font-size: 0.9em; position: absolute; bottom: -167px; margin: 0; background-color: #fff; color: #000; width: 390px; height: 78px; padding: 10px; right: 0; } #additional_ressources a { color: #000; } #about { color: #fff; margin-right: 20px; background-color: #335ea9; font-weight: bold; } #about h2 { font-weight: normal; font-size: 1.1em; padding-right: 115px; } #about p, #about li { margin: 0 0 10px 0; padding: 0; font-size: 0.8em; } #about a { color: #fff; } .beta_logo { position: absolute; z-index: 1; left: 300px; top: 0px; text-align: center; font-size: 1.4em; color: #fff; -moz-border-radius: 100px; -webkit-border-radius: 100px; -o-border-radius: 100px; -ms-border-radius: 100px; -khtml-border-radius: 100px; border-radius: 100px; -moz-transform: rotate(6deg); -webkit-transform: rotate(6deg); -o-transform: rotate(6deg); -ms-transform: rotate(6deg); transform: rotate(6deg); text-shadow: #222222 1px 0px 1px; -moz-box-shadow: #222222 0px 0px 4px; -webkit-box-shadow: #222222 0px 0px 4px; -o-box-shadow: #222222 0px 0px 4px; box-shadow: #222222 0px 0px 4px; width: 70px; height: 48px; padding-top: 22px; text-transform: uppercase; background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #a3160d), color-stop(100%, #b94e63)); background-image: -webkit-radial-gradient(#a3160d, #b94e63); background-image: -moz-radial-gradient(#a3160d, #b94e63); background-image: -o-radial-gradient(#a3160d, #b94e63); background-image: -ms-radial-gradient(#a3160d, #b94e63); background-image: radial-gradient(#a3160d, #b94e63); } .close_signup { font-size: 0.6em; width: 100%; text-align: right; color: #7f7f7f; cursor: pointer; } .close_signup:hover { text-decoration: underline; } #login, #reminder { display: none; } #verify, #reset_confirmation, #pwd_change_confirmation { width: 92%; display: none; position: relative; z-index: 4; padding: 15px; margin-right: 20px; background-color: #fff; color: #000; border: 1px solid #e5e5e5; -moz-border-radius: 8px; -webkit-border-radius: 8px; -o-border-radius: 8px; -ms-border-radius: 8px; -khtml-border-radius: 8px; border-radius: 8px; font-size: 0.8em; } .login_bigtitle { color: #335ea9; font-weight: bolder; font-size: 3em; margin-top: 10px; display: inline; } h1.login_title { color: black; margin: -4px 0 40px; font-weight: normal; display: block; clear: both; font-size: 1.5em; } #login_abzv { color: #333; float: right; font-weight: bold; font-size: 1em; margin-bottom: 0; } /* line 949, ../sass/general.scss */ #login_abzv a { color: #333; } /* line 951, ../sass/general.scss */ #login_abzv a:hover { text-decoration: none; } .divider { width: 100%; height: 20px; }
let x = { a: (b ? 1 : 2)};