text
stringlengths 2
100k
| meta
dict |
---|---|
/***************************************************************************/
/* */
/* svpscmap.h */
/* */
/* The FreeType PostScript charmap service (specification). */
/* */
/* Copyright 2003-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef SVPSCMAP_H_
#define SVPSCMAP_H_
#include FT_INTERNAL_OBJECTS_H
FT_BEGIN_HEADER
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
/*
* Adobe glyph name to unicode value.
*/
typedef FT_UInt32
(*PS_Unicode_ValueFunc)( const char* glyph_name );
/*
* Macintosh name id to glyph name. NULL if invalid index.
*/
typedef const char*
(*PS_Macintosh_NameFunc)( FT_UInt name_index );
/*
* Adobe standard string ID to glyph name. NULL if invalid index.
*/
typedef const char*
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
/*
* Simple unicode -> glyph index charmap built from font glyph names
* table.
*/
typedef struct PS_UniMap_
{
FT_UInt32 unicode; /* bit 31 set: is glyph variant */
FT_UInt glyph_index;
} PS_UniMap;
typedef struct PS_UnicodesRec_* PS_Unicodes;
typedef struct PS_UnicodesRec_
{
FT_CMapRec cmap;
FT_UInt num_maps;
PS_UniMap* maps;
} PS_UnicodesRec;
/*
* A function which returns a glyph name for a given index. Returns
* NULL if invalid index.
*/
typedef const char*
(*PS_GetGlyphNameFunc)( FT_Pointer data,
FT_UInt string_index );
/*
* A function used to release the glyph name returned by
* PS_GetGlyphNameFunc, when needed
*/
typedef void
(*PS_FreeGlyphNameFunc)( FT_Pointer data,
const char* name );
typedef FT_Error
(*PS_Unicodes_InitFunc)( FT_Memory memory,
PS_Unicodes unicodes,
FT_UInt num_glyphs,
PS_GetGlyphNameFunc get_glyph_name,
PS_FreeGlyphNameFunc free_glyph_name,
FT_Pointer glyph_data );
typedef FT_UInt
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
FT_UInt32 unicode );
typedef FT_UInt32
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
FT_UInt32 *unicode );
FT_DEFINE_SERVICE( PsCMaps )
{
PS_Unicode_ValueFunc unicode_value;
PS_Unicodes_InitFunc unicodes_init;
PS_Unicodes_CharIndexFunc unicodes_char_index;
PS_Unicodes_CharNextFunc unicodes_char_next;
PS_Macintosh_NameFunc macintosh_name;
PS_Adobe_Std_StringsFunc adobe_std_strings;
const unsigned short* adobe_std_encoding;
const unsigned short* adobe_expert_encoding;
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
unicode_value_, \
unicodes_init_, \
unicodes_char_index_, \
unicodes_char_next_, \
macintosh_name_, \
adobe_std_strings_, \
adobe_std_encoding_, \
adobe_expert_encoding_ ) \
static const FT_Service_PsCMapsRec class_ = \
{ \
unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
unicode_value_, \
unicodes_init_, \
unicodes_char_index_, \
unicodes_char_next_, \
macintosh_name_, \
adobe_std_strings_, \
adobe_std_encoding_, \
adobe_expert_encoding_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsCMapsRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->unicode_value = unicode_value_; \
clazz->unicodes_init = unicodes_init_; \
clazz->unicodes_char_index = unicodes_char_index_; \
clazz->unicodes_char_next = unicodes_char_next_; \
clazz->macintosh_name = macintosh_name_; \
clazz->adobe_std_strings = adobe_std_strings_; \
clazz->adobe_std_encoding = adobe_std_encoding_; \
clazz->adobe_expert_encoding = adobe_expert_encoding_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* SVPSCMAP_H_ */
/* END */
| {
"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.
*/
package camelinaction;
import java.util.ArrayList;
import java.util.List;
/**
* Customer service bean
*
* @version $Revision$
*/
public class CustomerService {
/**
* Split the customer into a list of departments
*
* @param customer the customer
* @return the departments
*/
public List<Department> splitDepartments(Customer customer) {
// this is a very simple logic, but your use cases
// may very well require more complex logic
return customer.getDepartments();
}
/**
* Create a dummy customre for testing purprose
*/
public static Customer createCustomer() {
List<Department> departments = new ArrayList<Department>();
departments.add(new Department(222, "Oceanview 66", "89210", "USA"));
departments.add(new Department(333, "Lakeside 41", "22020", "USA"));
departments.add(new Department(444, "Highstreet 341", "11030", "USA"));
Customer customer = new Customer(123, "Honda", departments);
return customer;
}
}
| {
"pile_set_name": "Github"
} |
require('../../modules/esnext.reflect.get-own-metadata-keys');
var path = require('../../internals/path');
module.exports = path.Reflect.getOwnMetadataKeys;
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ADC: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">ADC
 <span id="projectnumber">8.0</span>
</div>
<div id="projectbrief">Analog to Digital Conversor library for the Teensy 3.6 microprocessor</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('functions_func.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 
<h3><a id="index_a"></a>- a -</h3><ul>
<li>ADC()
: <a class="el" href="class_a_d_c.html#a60b6e21403b1f30984f63832c0562960">ADC</a>
</li>
<li>ADC_Module()
: <a class="el" href="class_a_d_c___module.html#ac1ebe515d43edd360286c3a3a44db5b8">ADC_Module</a>
</li>
<li>analogRead()
: <a class="el" href="class_a_d_c.html#aaf6079870b115d8b029d3613d44091dd">ADC</a>
, <a class="el" href="class_a_d_c___module.html#ad492adad4a9fa728625be82602bf1672">ADC_Module</a>
</li>
<li>analogReadContinuous()
: <a class="el" href="class_a_d_c.html#a749efc928425a1eea18341ccfafd1819">ADC</a>
, <a class="el" href="class_a_d_c___module.html#a8bddd248a9d52110b923fa94438f7f0a">ADC_Module</a>
</li>
<li>analogReadDifferential()
: <a class="el" href="class_a_d_c.html#aec3464cdb697f89cf162813b00b2e965">ADC</a>
, <a class="el" href="class_a_d_c___module.html#a4a57f6a9b0e3884f3862062b33f1a447">ADC_Module</a>
</li>
<li>analogSynchronizedRead()
: <a class="el" href="class_a_d_c.html#a5abe9c44df99c4e22300f4ded2b33a3f">ADC</a>
</li>
<li>analogSynchronizedReadDifferential()
: <a class="el" href="class_a_d_c.html#aaf76f74c0fb24016bf00bb5aed8bd98c">ADC</a>
</li>
<li>analogSyncRead()
: <a class="el" href="class_a_d_c.html#a8980e0b1c619d0a39beaf98228053e3d">ADC</a>
</li>
<li>analogSyncReadDifferential()
: <a class="el" href="class_a_d_c.html#a709a33de52fa14673be6170a869be22a">ADC</a>
</li>
</ul>
<h3><a id="index_c"></a>- c -</h3><ul>
<li>calibrate()
: <a class="el" href="class_a_d_c___module.html#a037ab0589e2966cd07292c8186cad83e">ADC_Module</a>
</li>
<li>checkDifferentialPins()
: <a class="el" href="class_a_d_c___module.html#a80d29662a1a32a51fec606351685ebaf">ADC_Module</a>
</li>
<li>checkPin()
: <a class="el" href="class_a_d_c___module.html#a9fd95a61d263a9d82918b50e81aee2e9">ADC_Module</a>
</li>
<li>continuousMode()
: <a class="el" href="class_a_d_c___module.html#a8b00e0669bbc7917544d4e2e543f1a27">ADC_Module</a>
</li>
</ul>
<h3><a id="index_d"></a>- d -</h3><ul>
<li>differentialMode()
: <a class="el" href="class_a_d_c___module.html#adaba2c3f43e9c702a873da6539b3d25f">ADC_Module</a>
</li>
<li>disableCompare()
: <a class="el" href="class_a_d_c___module.html#ac635f675a9690a4db016c73c31818262">ADC_Module</a>
</li>
<li>disableDMA()
: <a class="el" href="class_a_d_c___module.html#ac1610dcab46476f287c2dd4d96465c47">ADC_Module</a>
</li>
<li>disableInterrupts()
: <a class="el" href="class_a_d_c___module.html#aa4509062644982526fee3c02e0b528fc">ADC_Module</a>
</li>
</ul>
<h3><a id="index_e"></a>- e -</h3><ul>
<li>enableCompare()
: <a class="el" href="class_a_d_c___module.html#ae7a632267f21b79c31c1dae56b5da188">ADC_Module</a>
</li>
<li>enableCompareRange()
: <a class="el" href="class_a_d_c___module.html#ab8e64bab9d4e7f1935a260629e5d71d5">ADC_Module</a>
</li>
<li>enableDMA()
: <a class="el" href="class_a_d_c___module.html#af3d14c01b1442c0c34b5dbc9a6e49f35">ADC_Module</a>
</li>
<li>enableInterrupts()
: <a class="el" href="class_a_d_c___module.html#a65395dfc2a15bc015e1ee723b22235b5">ADC_Module</a>
</li>
</ul>
<h3><a id="index_g"></a>- g -</h3><ul>
<li>getMaxValue()
: <a class="el" href="class_a_d_c___module.html#af3704819ccda64bae9c13a95a74e70a8">ADC_Module</a>
</li>
<li>getPDBFrequency()
: <a class="el" href="class_a_d_c___module.html#ae113f4168d9dd343f66ecc6e59a245f6">ADC_Module</a>
</li>
<li>getResolution()
: <a class="el" href="class_a_d_c___module.html#a58cabc09d41f6aa25319fd514b47c48f">ADC_Module</a>
</li>
<li>getTimerFrequency()
: <a class="el" href="class_a_d_c___module.html#ae3c47b374f4f68eb815812c6a373e439">ADC_Module</a>
</li>
</ul>
<h3><a id="index_i"></a>- i -</h3><ul>
<li>isComplete()
: <a class="el" href="class_a_d_c___module.html#a3aefadc245d1582d3ae97e1b9c7acac8">ADC_Module</a>
</li>
<li>isContinuous()
: <a class="el" href="class_a_d_c___module.html#a038874878778ef351e45f902fcee47df">ADC_Module</a>
</li>
<li>isConverting()
: <a class="el" href="class_a_d_c___module.html#a9facd614ff4fec667341d9109f098f0f">ADC_Module</a>
</li>
<li>isDifferential()
: <a class="el" href="class_a_d_c___module.html#a4f6124f3fee4cae59f011184525822a6">ADC_Module</a>
</li>
</ul>
<h3><a id="index_l"></a>- l -</h3><ul>
<li>loadConfig()
: <a class="el" href="class_a_d_c___module.html#a1bb50f669bbc41937fb5157abe2050ca">ADC_Module</a>
</li>
</ul>
<h3><a id="index_r"></a>- r -</h3><ul>
<li>readSingle()
: <a class="el" href="class_a_d_c.html#aee7423bfcbb03465bb0bd1e3c6474452">ADC</a>
, <a class="el" href="class_a_d_c___module.html#a60d0edc82fd1dbb2e20d090a53718ce2">ADC_Module</a>
</li>
<li>readSynchronizedContinuous()
: <a class="el" href="class_a_d_c.html#ad6aeaa4944d30a17d28b88f02cf9ba1e">ADC</a>
</li>
<li>readSynchronizedSingle()
: <a class="el" href="class_a_d_c.html#a30a02eed76155ced6b719ab01b7e899e">ADC</a>
</li>
<li>recalibrate()
: <a class="el" href="class_a_d_c___module.html#afe8ed6f2a6c811ec3ef2c4aba768982f">ADC_Module</a>
</li>
<li>resetError()
: <a class="el" href="class_a_d_c.html#aa65014de31051e06a469982ca286496b">ADC</a>
, <a class="el" href="class_a_d_c___module.html#abf980784cf468d28fc2cbb94d06be500">ADC_Module</a>
</li>
</ul>
<h3><a id="index_s"></a>- s -</h3><ul>
<li>saveConfig()
: <a class="el" href="class_a_d_c___module.html#af2ee5bc5b76647506e597c178c9691d3">ADC_Module</a>
</li>
<li>setAveraging()
: <a class="el" href="class_a_d_c___module.html#a55954618c5c27c1ffce4321e912bac52">ADC_Module</a>
</li>
<li>setConversionSpeed()
: <a class="el" href="class_a_d_c___module.html#a281b4f6ca2705f934bc86b1a25679138">ADC_Module</a>
</li>
<li>setHardwareTrigger()
: <a class="el" href="class_a_d_c___module.html#aa5f004d8433dc5968af0ec7f17b1f576">ADC_Module</a>
</li>
<li>setReference()
: <a class="el" href="class_a_d_c___module.html#a784d946712d1d0ee475822b7b8f99ace">ADC_Module</a>
</li>
<li>setResolution()
: <a class="el" href="class_a_d_c___module.html#a6bd8da02e5e9bd3b2b3db30d5faa3585">ADC_Module</a>
</li>
<li>setSamplingSpeed()
: <a class="el" href="class_a_d_c___module.html#a2aa4693c5be479f3189d31f59d212509">ADC_Module</a>
</li>
<li>setSoftwareTrigger()
: <a class="el" href="class_a_d_c___module.html#a4f8137bfcdc459b4f8767ad46f325af6">ADC_Module</a>
</li>
<li>singleEndedMode()
: <a class="el" href="class_a_d_c___module.html#a7edf0189517f42a2bcbc389c116d9f58">ADC_Module</a>
</li>
<li>singleMode()
: <a class="el" href="class_a_d_c___module.html#a0f7d83ced9a5159b1f25bd998cea2bd0">ADC_Module</a>
</li>
<li>startContinuous()
: <a class="el" href="class_a_d_c.html#ad592f87ec644457b5056ae41c645ac0a">ADC</a>
, <a class="el" href="class_a_d_c___module.html#a2b6284a613c9d3e452d2fc708bf6ce98">ADC_Module</a>
</li>
<li>startContinuousDifferential()
: <a class="el" href="class_a_d_c.html#ae6179fc2e5ca7de1b0a3eb1f36985885">ADC</a>
, <a class="el" href="class_a_d_c___module.html#a23fd4fa6b759dcc0c029b3266f6a5fb7">ADC_Module</a>
</li>
<li>startDifferentialFast()
: <a class="el" href="class_a_d_c___module.html#aa503b484e691fe31172033fc928576bd">ADC_Module</a>
</li>
<li>startPDB()
: <a class="el" href="class_a_d_c___module.html#acced2e2266868323ff2c53df96791a15">ADC_Module</a>
</li>
<li>startReadFast()
: <a class="el" href="class_a_d_c___module.html#a33cc7fbfcb158a33e8ca276cc7b309b5">ADC_Module</a>
</li>
<li>startSingleDifferential()
: <a class="el" href="class_a_d_c.html#ac1016c1d107118a0064c2b627dbd831b">ADC</a>
, <a class="el" href="class_a_d_c___module.html#abe85ed1855a09f18c5d2026cf08968a7">ADC_Module</a>
</li>
<li>startSingleRead()
: <a class="el" href="class_a_d_c.html#a113479488fae5f5407f884dd95fbec72">ADC</a>
, <a class="el" href="class_a_d_c___module.html#af8a13facb0c15ef14e527a37f2386ce5">ADC_Module</a>
</li>
<li>startSynchronizedContinuous()
: <a class="el" href="class_a_d_c.html#af50305b76bf8798da1dd26f654b4f0e3">ADC</a>
</li>
<li>startSynchronizedContinuousDifferential()
: <a class="el" href="class_a_d_c.html#a29851ff11635dcd85cff21a92271b571">ADC</a>
</li>
<li>startSynchronizedSingleDifferential()
: <a class="el" href="class_a_d_c.html#a9cebd13de5da420591c779916865824a">ADC</a>
</li>
<li>startSynchronizedSingleRead()
: <a class="el" href="class_a_d_c.html#acbdb0f3a7419e5a0cd8b2c031dc8b9d7">ADC</a>
</li>
<li>startTimer()
: <a class="el" href="class_a_d_c___module.html#aebdd7b54f91fe0834321fb632177151e">ADC_Module</a>
</li>
<li>stopContinuous()
: <a class="el" href="class_a_d_c.html#a436e52cf82ca735f636899de670a2f0c">ADC</a>
, <a class="el" href="class_a_d_c___module.html#a9af29f865bdd376d954112d36b0992f0">ADC_Module</a>
</li>
<li>stopPDB()
: <a class="el" href="class_a_d_c___module.html#ab25eb12b50ef1002100ac6cd865cc6dc">ADC_Module</a>
</li>
<li>stopSynchronizedContinuous()
: <a class="el" href="class_a_d_c.html#ac2070250dd4d557b27ec0f4f2b360f21">ADC</a>
</li>
<li>stopTimer()
: <a class="el" href="class_a_d_c___module.html#a4361eec1c9f93a99661afb1a43d15284">ADC_Module</a>
</li>
</ul>
<h3><a id="index_w"></a>- w -</h3><ul>
<li>wait_for_cal()
: <a class="el" href="class_a_d_c___module.html#a4fb69b5b2d07c3fc8f5f0bbbf05dfa2a">ADC_Module</a>
</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Sun Jan 19 2020 12:56:13 for ADC by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
include ../../../../Makefile.def
OBJS = CStdLibRandGenerator.o RandomNumberGenerator.o
# Compilation control
all: $(OBJS)
# Miscellaneous
tidy:
@$(RM) $(RMFLAGS) Makefile.bak *~ #*# core
clean: tidy
@$(RM) $(RMFLAGS) $(OBJS) *.o
spotless: clean
wipe: spotless
# DO NOT DELETE THIS LINE -- make depend depends on it.
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2014 jmrozanec
* 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.cronutils.model.field.expression.visitor;
import com.cronutils.StringValidations;
import com.cronutils.model.field.constraint.FieldConstraints;
import com.cronutils.model.field.expression.Always;
import com.cronutils.model.field.expression.And;
import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.cronutils.model.field.expression.QuestionMark;
import com.cronutils.model.field.value.FieldValue;
import com.cronutils.model.field.value.IntegerFieldValue;
import com.cronutils.model.field.value.SpecialChar;
import com.cronutils.model.field.value.SpecialCharFieldValue;
import com.cronutils.utils.VisibleForTesting;
public class ValidationFieldExpressionVisitor implements FieldExpressionVisitor {
private static final String OORANGE = "Value %s not in range [%s, %s]";
private static final String EMPTY_STRING = "";
private final FieldConstraints constraints;
private final StringValidations stringValidations;
public ValidationFieldExpressionVisitor(final FieldConstraints constraints) {
this.constraints = constraints;
stringValidations = new StringValidations(constraints);
}
protected ValidationFieldExpressionVisitor(final FieldConstraints constraints, final StringValidations stringValidation) {
this.constraints = constraints;
stringValidations = stringValidation;
}
@Override
public FieldExpression visit(final FieldExpression expression) {
final String unsupportedChars = stringValidations.removeValidChars(expression.asString());
if (EMPTY_STRING.equals(unsupportedChars)) {
if (expression instanceof Always) {
return visit((Always) expression);
}
if (expression instanceof And) {
return visit((And) expression);
}
if (expression instanceof Between) {
return visit((Between) expression);
}
if (expression instanceof Every) {
return visit((Every) expression);
}
if (expression instanceof On) {
return visit((On) expression);
}
if (expression instanceof QuestionMark) {
return visit((QuestionMark) expression);
}
}
throw new IllegalArgumentException(
String.format("Invalid chars in expression! Expression: %s Invalid chars: %s",
expression.asString(), unsupportedChars)
);
}
@Override
public Always visit(final Always always) {
return always;
}
@Override
public And visit(final And and) {
for (final FieldExpression expression : and.getExpressions()) {
visit(expression);
}
return and;
}
@Override
public Between visit(final Between between) {
preConditions(between);
if ((constraints.isStrictRange()) && between.getFrom() instanceof IntegerFieldValue && between.getTo() instanceof IntegerFieldValue) {
final int from = ((IntegerFieldValue) between.getFrom()).getValue();
final int to = ((IntegerFieldValue) between.getTo()).getValue();
if (from > to) {
throw new IllegalArgumentException(String.format("Invalid range! [%s,%s]", from, to));
}
}
return between;
}
@Override
public Every visit(final Every every) {
if (every.getExpression() instanceof Between) {
visit((Between) every.getExpression());
}
if (every.getExpression() instanceof On) {
visit((On) every.getExpression());
}
isPeriodInRange(every.getPeriod());
return every;
}
@Override
public On visit(final On on) {
if (!isDefault(on.getTime())) {
isInRange(on.getTime());
}
if (!isDefault(on.getNth())) {
isInRange(on.getNth());
}
return on;
}
@Override
public QuestionMark visit(final QuestionMark questionMark) {
return questionMark;
}
private void preConditions(final Between between) {
isInRange(between.getFrom());
isInRange(between.getTo());
if (isSpecialCharNotL(between.getFrom()) || isSpecialCharNotL(between.getTo())) {
throw new IllegalArgumentException("No special characters allowed in range, except for 'L'");
}
}
/**
* Check if given number is greater or equal to start range and minor or equal to end range.
*
* @param fieldValue - to be validated
* @throws IllegalArgumentException - if not in range
*/
@VisibleForTesting
protected void isInRange(final FieldValue<?> fieldValue) {
if (fieldValue instanceof IntegerFieldValue) {
final int value = ((IntegerFieldValue) fieldValue).getValue();
if (!constraints.isInRange(value)) {
throw new IllegalArgumentException(String.format(OORANGE, value, constraints.getStartRange(), constraints.getEndRange()));
}
}
}
/**
* Check if given period is compatible with range.
*
* @param fieldValue - to be validated
* @throws IllegalArgumentException - if not in range
*/
@VisibleForTesting
protected void isPeriodInRange(final FieldValue<?> fieldValue) {
if (fieldValue instanceof IntegerFieldValue) {
final int value = ((IntegerFieldValue) fieldValue).getValue();
if (!constraints.isPeriodInRange(value)) {
throw new IllegalArgumentException(
String.format("Period %s not in range [%s, %s]", value, constraints.getStartRange(), constraints.getEndRange()));
}
}
}
@VisibleForTesting
protected boolean isDefault(final FieldValue<?> fieldValue) {
return fieldValue instanceof IntegerFieldValue && ((IntegerFieldValue) fieldValue).getValue() == -1;
}
protected boolean isSpecialCharNotL(final FieldValue<?> fieldValue) {
return fieldValue instanceof SpecialCharFieldValue && !SpecialChar.L.equals(fieldValue.getValue());
}
}
| {
"pile_set_name": "Github"
} |
package LWP::MemberMixin;
our $VERSION = '6.44';
sub _elem {
my $self = shift;
my $elem = shift;
my $old = $self->{$elem};
$self->{$elem} = shift if @_;
return $old;
}
1;
__END__
=pod
=head1 NAME
LWP::MemberMixin - Member access mixin class
=head1 SYNOPSIS
package Foo;
use base qw(LWP::MemberMixin);
=head1 DESCRIPTION
A mixin class to get methods that provide easy access to member
variables in the C<%$self>.
Ideally there should be better Perl language support for this.
=head1 METHODS
There is only one method provided:
=head2 _elem
_elem($elem [, $val])
Internal method to get/set the value of member variable
C<$elem>. If C<$val> is present it is used as the new value
for the member variable. If it is not present the current
value is not touched. In both cases the previous value of
the member variable is returned.
=cut
| {
"pile_set_name": "Github"
} |
package apoc.export.util;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.time.temporal.TemporalAccessor;
public class TemporalSerializer extends JsonSerializer<TemporalAccessor> {
@Override
public void serialize(TemporalAccessor value, JsonGenerator jsonGenerator, SerializerProvider serializers) throws IOException {
if (value == null) {
jsonGenerator.writeNull();
}
jsonGenerator.writeString(value.toString());
}
}
| {
"pile_set_name": "Github"
} |
/**
* Knowage, Open Source Business Intelligence suite
* Copyright (C) 2016 Engineering Ingegneria Informatica S.p.A.
*
* Knowage is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Knowage is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
(function(){
angular.module('targetApp').directive('betweenmanual', function(targetAppBasePath,sbiModule_translate) {
return {
scope:{
filter:'='
},
restrict:'E',
templateUrl:targetAppBasePath +"/directives/betweenmanual/betweenmanual.html",
controller:function($scope){
$scope.translate = sbiModule_translate;
$scope.edit = function(){
$scope.filter.rightOperandDescription = [$scope.firstOperand, $scope.secondOperand].join(" ---- ")
}
var init = function(){
var temp = $scope.filter.rightOperandDescription.split(" ---- ");
$scope.firstOperand = temp[0];
$scope.secondOperand = temp[1];
$scope.filter.rightOperandType="Static Content";
}
init();
}
}
})
})()
| {
"pile_set_name": "Github"
} |
from .defs import *
from shutilwhich import which
import tempfile, shutil
from . import instrument
# from xml.dom import minidom
ARGS = get_args()
SUPPORT = set(['midi'])
SUPPORT_ALL = set(['midi', 'fluidsynth', 'soundfonts']) # gme,mpe,sonicpi,supercollider,csound
MIDI = True
SOUNDFONTS = False # TODO: make this a SupportPlugin ref
AUTO = False
AUTO_MODULE = None
SOUNDFONT_MODULE = None
auto_inited = False
SUPPORT_PLUGINS = {}
# load plugins from plugins dir
import textbeat.plugins as tbp
from textbeat.plugins import *
# search module exports for plugins
plugs = []
for p in tbp.__dict__:
try:
pattr = getattr(tbp, p)
plugs += [pattr.export(ARGS)]
except:
pass
# plugs = instrument.plugins()
for plug in plugs:
# plug.init()
ps = plug.support()
SUPPORT_ALL = SUPPORT_ALL.union(ps)
if not plug.supported():
continue
for s in ps:
SUPPORT.add(s)
SUPPORT_PLUGINS[s] = plug
if 'auto' in s:
AUTO = True
AUTO_MODULE = plug
auto_inited = True
if 'soundfonts' in s:
SOUNDFONTS = True
SOUNDFONT_MODULE = plug
def supports(dev):
global SUPPORT
return dev in SUPPORT
def supports_soundfonts():
return SOUNDFONTS
def supports_auto():
return AUTO
def supports(tech):
return tech in SUPPORT
def support_stop():
for plug in plugs:
if plug.inited():
plug.stop()
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"filename" : "tabbar_compose_camera.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, [email protected].
#
# SPDX-License-Identifier: GPL-2.0+
#
obj-y = hymod.o flash.o bsp.o eeprom.o fetch.o input.o env.o
| {
"pile_set_name": "Github"
} |
#*
* Copyright 2012 LinkedIn Corp.
*
* 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.
*#
<!-- statsPage.vm -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="Expires" content="0">
#parse("azkaban/webapp/servlet/velocity/style.vm")
#parse("azkaban/webapp/servlet/velocity/javascript.vm")
<link rel="stylesheet" type="text/css" href="${context}/css/bootstrap-datetimepicker.css?version=1.10.0"/>
<script type="text/javascript" src="${context}/js/raphael.min.js?version=1.10.0"></script>
<script type="text/javascript" src="${context}/js/morris.min.js?version=1.10.0"></script>
<script type="text/javascript" src="${context}/js/moment.min.js?version=1.10.0"></script>
<script type="text/javascript" src="${context}/js/bootstrap-datetimepicker.min.js?version=1.10.0"></script>
<script type="text/javascript">
var contextURL = "${context}";
var currentTime = ${currentTime};
var timezone = "${timezone}";
var langType = "${currentlangType}";
function refreshMetricList() {
var requestURL = '/stats';
var requestData = {
'action': 'getAllMetricNames',
'executorId': $('#executorName').val()
};
var successHandler = function (responseData) {
if (responseData.error != null) {
$('#reportedMetric').html(responseData.error);
} else {
$('#metricName').empty();
for (var index = 0; index < responseData.metricList.length; index++) {
$('#metricName').append($('<option value="' + responseData.metricList[index] + '">'
+ responseData.metricList[index] + '</option>'));
}
}
};
$.get(requestURL, requestData, successHandler, 'json');
}
function refreshMetricChart() {
var requestURL = '/stats';
var requestData = {
'action': 'getMetricHistory',
'from': new Date($('#datetimebegin').val()).toUTCString(),
'to': new Date($('#datetimeend').val()).toUTCString(),
'metricName': $('#metricName').val(),
'useStats': $("#useStats").is(':checked'),
'executorId': $('#executorName').val()
};
var successHandler = function (responseData) {
if (responseData.error != null) {
$('#reportedMetric').html(responseData.error);
} else {
var graphDiv = document.createElement('div');
$('#reportedMetric').html(graphDiv);
Morris.Line({
element: graphDiv,
data: responseData.data,
xkey: 'timestamp',
ykeys: ['value'],
labels: [$('#metricName').val()]
});
}
};
$.get(requestURL, requestData, successHandler, 'json');
}
$(document).ready(function () {
$('#datetimebegin').datetimepicker();
$('#datetimeend').datetimepicker();
$('#datetimebegin').on('change.dp', function (e) {
$('#datetimeend').data('DateTimePicker').setStartDate(e.date);
});
$('#datetimeend').on('change.dp', function (e) {
$('#datetimebegin').data('DateTimePicker').setEndDate(e.date);
});
$('#retrieve').click(refreshMetricChart);
$('#executorName').click(refreshMetricList);
});
</script>
</head>
<body>
#set ($current_page="Statistics")
#parse ("azkaban/webapp/servlet/velocity/nav.vm")
#if ($errorMsg)
#parse ("azkaban/webapp/servlet/velocity/errormsg.vm")
#else
## Page header.
<div class="az-page-header">
<div class="container-full">
<div class="row">
<div class="header-title" style="width: 17%;">
<h1><a href="${context}/stats">Statistics</a></h1>
</div>
<div class="header-control" style="width: 1300px; padding-top: 5px;">
<form id="metric-form" method="get">
<label for="executorLabel">Executor</label>
#if (!$executorList.isEmpty())
<select id="executorName" name="executorName" style="width:200px">
#foreach ($executor in $executorList)
<option value="${executor.getId()}" style="width:200px">${executor.getHost()}
:${executor.getPort()}</option>
#end
</select>
#end
<label for="metricLabel">Metric</label>
#if (!$metricList.isEmpty())
<select id="metricName" name="metricName" style="width:200px">
#foreach ($metric in $metricList)
<option value="${metric}" style="width:200px">${metric}</option>
#end
</select>
#end
<label for="datetimebegin">Between</label>
<input type="text" id="datetimebegin" value="" class="ui-datetime-container"
style="width:150px">
<label for="datetimeend">and</label>
<input type="text" id="datetimeend" value="" class="ui-datetime-container"
style="width:150px">
<input type="checkbox" name="useStats" id="useStats" value="true"> useStats
<input type="button" id="retrieve" value="Retrieve" class="btn btn-success">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container-full">
#parse ("azkaban/webapp/servlet/velocity/alerts.vm")
<div class="row">
<div id="reportedMetric" style="padding: 60px 10px 10px 10px;height: 750px;">
</div>
</div>
<!-- /row -->
#parse ("azkaban/webapp/servlet/velocity/invalidsessionmodal.vm")
</div>
<!-- /container-full -->
#end
</body>
<html>
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "右-横图片遮罩@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
# Makefile for the dss1_divert ISDN module
# Each configuration option enables a list of files.
obj-$(CONFIG_ISDN_DIVERSION) += dss1_divert.o
# Multipart objects.
dss1_divert-y := isdn_divert.o divert_procfs.o divert_init.o
| {
"pile_set_name": "Github"
} |
VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER
| {
"pile_set_name": "Github"
} |
<?php
class TestIterator2 implements Iterator
{
protected $data;
public function __construct(array $array)
{
$this->data = $array;
}
public function current()
{
return current($this->data);
}
public function next()
{
next($this->data);
}
public function key()
{
return key($this->data);
}
public function valid()
{
return key($this->data) !== null;
}
public function rewind()
{
reset($this->data);
}
}
| {
"pile_set_name": "Github"
} |
package ioutils
import (
"errors"
"io"
)
var errBufferFull = errors.New("buffer is full")
type fixedBuffer struct {
buf []byte
pos int
lastRead int
}
func (b *fixedBuffer) Write(p []byte) (int, error) {
n := copy(b.buf[b.pos:cap(b.buf)], p)
b.pos += n
if n < len(p) {
if b.pos == cap(b.buf) {
return n, errBufferFull
}
return n, io.ErrShortWrite
}
return n, nil
}
func (b *fixedBuffer) Read(p []byte) (int, error) {
n := copy(p, b.buf[b.lastRead:b.pos])
b.lastRead += n
return n, nil
}
func (b *fixedBuffer) Len() int {
return b.pos - b.lastRead
}
func (b *fixedBuffer) Cap() int {
return cap(b.buf)
}
func (b *fixedBuffer) Reset() {
b.pos = 0
b.lastRead = 0
b.buf = b.buf[:0]
}
func (b *fixedBuffer) String() string {
return string(b.buf[b.lastRead:b.pos])
}
| {
"pile_set_name": "Github"
} |
// 代码地址: https://github.com/CoderMJLee/MJRefresh
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
// UIScrollView+MJRefresh.m
// MJRefreshExample
//
// Created by MJ Lee on 15/3/4.
// Copyright (c) 2015年 小码哥. All rights reserved.
//
#import "UIScrollView+MJRefresh.h"
#import "MJRefreshHeader.h"
#import "MJRefreshFooter.h"
#import <objc/runtime.h>
@implementation UIScrollView (MJRefresh)
#pragma mark - header
static const char MJRefreshHeaderKey = '\0';
- (void)setMj_header:(MJRefreshHeader *)mj_header
{
if (mj_header != self.mj_header) {
// 删除旧的,添加新的
[self.mj_header removeFromSuperview];
[self insertSubview:mj_header atIndex:0];
// 存储新的
objc_setAssociatedObject(self, &MJRefreshHeaderKey,
mj_header, OBJC_ASSOCIATION_RETAIN);
}
}
- (MJRefreshHeader *)mj_header
{
return objc_getAssociatedObject(self, &MJRefreshHeaderKey);
}
#pragma mark - footer
static const char MJRefreshFooterKey = '\0';
- (void)setMj_footer:(MJRefreshFooter *)mj_footer
{
if (mj_footer != self.mj_footer) {
// 删除旧的,添加新的
[self.mj_footer removeFromSuperview];
[self insertSubview:mj_footer atIndex:0];
// 存储新的
objc_setAssociatedObject(self, &MJRefreshFooterKey,
mj_footer, OBJC_ASSOCIATION_RETAIN);
}
}
- (MJRefreshFooter *)mj_footer
{
return objc_getAssociatedObject(self, &MJRefreshFooterKey);
}
#pragma mark - 过期
- (void)setFooter:(MJRefreshFooter *)footer
{
self.mj_footer = footer;
}
- (MJRefreshFooter *)footer
{
return self.mj_footer;
}
- (void)setHeader:(MJRefreshHeader *)header
{
self.mj_header = header;
}
- (MJRefreshHeader *)header
{
return self.mj_header;
}
#pragma mark - other
- (NSInteger)mj_totalDataCount
{
NSInteger totalCount = 0;
if ([self isKindOfClass:[UITableView class]]) {
UITableView *tableView = (UITableView *)self;
for (NSInteger section = 0; section < tableView.numberOfSections; section++) {
totalCount += [tableView numberOfRowsInSection:section];
}
} else if ([self isKindOfClass:[UICollectionView class]]) {
UICollectionView *collectionView = (UICollectionView *)self;
for (NSInteger section = 0; section < collectionView.numberOfSections; section++) {
totalCount += [collectionView numberOfItemsInSection:section];
}
}
return totalCount;
}
@end
| {
"pile_set_name": "Github"
} |
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\bootstrap;
use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper;
/**
* Progress renders a bootstrap progress bar component.
*
* For example,
*
* ```php
* // default with label
* echo Progress::widget([
* 'percent' => 60,
* 'label' => 'test',
* ]);
*
* // styled
* echo Progress::widget([
* 'percent' => 65,
* 'barOptions' => ['class' => 'progress-bar-danger']
* ]);
*
* // striped
* echo Progress::widget([
* 'percent' => 70,
* 'barOptions' => ['class' => 'progress-bar-warning'],
* 'options' => ['class' => 'progress-striped']
* ]);
*
* // striped animated
* echo Progress::widget([
* 'percent' => 70,
* 'barOptions' => ['class' => 'progress-bar-success'],
* 'options' => ['class' => 'active progress-striped']
* ]);
*
* // stacked bars
* echo Progress::widget([
* 'bars' => [
* ['percent' => 30, 'options' => ['class' => 'progress-bar-danger']],
* ['percent' => 30, 'label' => 'test', 'options' => ['class' => 'progress-bar-success']],
* ['percent' => 35, 'options' => ['class' => 'progress-bar-warning']],
* ]
* ]);
* ```
* @see http://getbootstrap.com/components/#progress
* @author Antonio Ramirez <[email protected]>
* @author Alexander Makarov <[email protected]>
* @since 2.0
*/
class Progress extends Widget
{
/**
* @var string the button label.
*/
public $label;
/**
* @var integer the amount of progress as a percentage.
*/
public $percent = 0;
/**
* @var array the HTML attributes of the bar.
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
*/
public $barOptions = [];
/**
* @var array a set of bars that are stacked together to form a single progress bar.
* Each bar is an array of the following structure:
*
* ```php
* [
* // required, the amount of progress as a percentage.
* 'percent' => 30,
* // optional, the label to be displayed on the bar
* 'label' => '30%',
* // optional, array, additional HTML attributes for the bar tag
* 'options' => [],
* ]
* ```
*/
public $bars;
/**
* Initializes the widget.
* If you override this method, make sure you call the parent implementation first.
*/
public function init()
{
parent::init();
Html::addCssClass($this->options, ['widget' => 'progress']);
}
/**
* Renders the widget.
*/
public function run()
{
BootstrapAsset::register($this->getView());
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderProgress(),
Html::endTag('div')
]) . "\n";
}
/**
* Renders the progress.
* @return string the rendering result.
* @throws InvalidConfigException if the "percent" option is not set in a stacked progress bar.
*/
protected function renderProgress()
{
if (empty($this->bars)) {
return $this->renderBar($this->percent, $this->label, $this->barOptions);
}
$bars = [];
foreach ($this->bars as $bar) {
$label = ArrayHelper::getValue($bar, 'label', '');
if (!isset($bar['percent'])) {
throw new InvalidConfigException("The 'percent' option is required.");
}
$options = ArrayHelper::getValue($bar, 'options', []);
$bars[] = $this->renderBar($bar['percent'], $label, $options);
}
return implode("\n", $bars);
}
/**
* Generates a bar
* @param integer $percent the percentage of the bar
* @param string $label, optional, the label to display at the bar
* @param array $options the HTML attributes of the bar
* @return string the rendering result.
*/
protected function renderBar($percent, $label = '', $options = [])
{
$defaultOptions = [
'role' => 'progressbar',
'aria-valuenow' => $percent,
'aria-valuemin' => 0,
'aria-valuemax' => 100,
'style' => "width:{$percent}%",
];
$options = array_merge($defaultOptions, $options);
Html::addCssClass($options, ['widget' => 'progress-bar']);
$out = Html::beginTag('div', $options);
$out .= $label;
$out .= Html::tag('span', \Yii::t('yii', '{percent}% Complete', ['percent' => $percent]), [
'class' => 'sr-only'
]);
$out .= Html::endTag('div');
return $out;
}
}
| {
"pile_set_name": "Github"
} |
/* tbs-nec.h - Keytable for tbs_nec Remote Controller
*
* keymap imported from ir-keymaps.c
*
* Copyright (c) 2010 by Mauro Carvalho Chehab <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <media/rc-map.h>
static struct rc_map_table tbs_nec[] = {
{ 0x84, KEY_POWER2}, /* power */
{ 0x94, KEY_MUTE}, /* mute */
{ 0x87, KEY_1},
{ 0x86, KEY_2},
{ 0x85, KEY_3},
{ 0x8b, KEY_4},
{ 0x8a, KEY_5},
{ 0x89, KEY_6},
{ 0x8f, KEY_7},
{ 0x8e, KEY_8},
{ 0x8d, KEY_9},
{ 0x92, KEY_0},
{ 0xc0, KEY_10CHANNELSUP}, /* 10+ */
{ 0xd0, KEY_10CHANNELSDOWN}, /* 10- */
{ 0x96, KEY_CHANNELUP}, /* ch+ */
{ 0x91, KEY_CHANNELDOWN}, /* ch- */
{ 0x93, KEY_VOLUMEUP}, /* vol+ */
{ 0x8c, KEY_VOLUMEDOWN}, /* vol- */
{ 0x83, KEY_RECORD}, /* rec */
{ 0x98, KEY_PAUSE}, /* pause, yellow */
{ 0x99, KEY_OK}, /* ok */
{ 0x9a, KEY_CAMERA}, /* snapshot */
{ 0x81, KEY_UP},
{ 0x90, KEY_LEFT},
{ 0x82, KEY_RIGHT},
{ 0x88, KEY_DOWN},
{ 0x95, KEY_FAVORITES}, /* blue */
{ 0x97, KEY_SUBTITLE}, /* green */
{ 0x9d, KEY_ZOOM},
{ 0x9f, KEY_EXIT},
{ 0x9e, KEY_MENU},
{ 0x9c, KEY_EPG},
{ 0x80, KEY_PREVIOUS}, /* red */
{ 0x9b, KEY_MODE},
};
static struct rc_map_list tbs_nec_map = {
.map = {
.scan = tbs_nec,
.size = ARRAY_SIZE(tbs_nec),
.rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_TBS_NEC,
}
};
static int __init init_rc_map_tbs_nec(void)
{
return rc_map_register(&tbs_nec_map);
}
static void __exit exit_rc_map_tbs_nec(void)
{
rc_map_unregister(&tbs_nec_map);
}
module_init(init_rc_map_tbs_nec)
module_exit(exit_rc_map_tbs_nec)
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mauro Carvalho Chehab <[email protected]>");
| {
"pile_set_name": "Github"
} |
package com.gf.mapper;
import com.gf.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UserMapper {
@Select( "select id , username , password from user where username = #{username}" )
User loadUserByUsername(@Param("username") String username);
}
| {
"pile_set_name": "Github"
} |
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_ARM_AUDIODSP_ARM_H
#define AVCODEC_ARM_AUDIODSP_ARM_H
#include "libavcodec/audiodsp.h"
void ff_audiodsp_init_neon(AudioDSPContext *c);
#endif /* AVCODEC_ARM_AUDIODSP_ARM_H */
| {
"pile_set_name": "Github"
} |
{
"name": "mshtml-dashboard",
"headless": true,
"dependencies": [
"target-specific/edgehtml/mshtml-helpers",
"dbgobject-tree",
"object-dashboard"
],
"augments": [
"wwwroot"
],
"includes": [
"mshtml-dashboard.js"
],
"targetModules": [
"edgehtml",
"mshtml"
]
} | {
"pile_set_name": "Github"
} |
/*---
result: 64
---*/
a := {}
a.b = "6"
a.c = "4"
a.d = a.b + a.c
return a.d
| {
"pile_set_name": "Github"
} |
local US_StorageLarge = Storage:New{
name = "Large Storage Shed",
energyStorage = 3120,
buildCostMetal = 7000,
customParams = {
normaltex = "unittextures/LogisticsLarge_normals.dds",
},
}
return lowerkeys({
["USStorageLarge"] = US_StorageLarge,
})
| {
"pile_set_name": "Github"
} |
require('../../../modules/es6.array.sort');
module.exports = require('../../../modules/_entry-virtual')('Array').sort;
| {
"pile_set_name": "Github"
} |
--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: "A convenience method for obtaining the first row of a result set, and discarding all others. It is otherwise identical to #execute."
- !ruby/struct:SM::Flow::P
body: "See also #get_first_value."
full_name: SQLite3::Database#get_first_row
is_singleton: false
name: get_first_row
params: ( sql, *bind_vars )
visibility: public
| {
"pile_set_name": "Github"
} |
// @flow
// @providesModule foo
export function foo(): string { return ''; }
| {
"pile_set_name": "Github"
} |
module.exports = function CustomOperatorsPlugin(builder) {
builder.hook("build", (_, build) => {
const {
pgSql: sql,
graphql: { GraphQLInt, GraphQLBoolean },
addConnectionFilterOperator,
} = build;
// simple
addConnectionFilterOperator(
"InternetAddress",
"familyEqualTo",
"Address family equal to specified value.",
() => GraphQLInt,
(i, v) => sql.fragment`family(${i}) = ${v}`
);
// using resolveSqlIdentifier
addConnectionFilterOperator(
"InternetAddress",
"familyNotEqualTo",
"Address family equal to specified value.",
() => GraphQLInt,
(i, v) => sql.fragment`${i} <> ${v}`,
{
resolveSqlIdentifier: i => sql.fragment`family(${i})`,
}
);
// using resolveInput
addConnectionFilterOperator(
["InternetAddress"], // typeNames: string | string[]
"isV4",
"Address family equal to specified value.",
() => GraphQLBoolean,
(i, v) => sql.fragment`family(${i}) = ${v}`,
{
resolveInput: input => (input === true ? 4 : 6),
}
);
return _;
});
};
| {
"pile_set_name": "Github"
} |
// Copyright 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.
// Code generated by ack-generate. DO NOT EDIT.
package vpc_link
import (
"sync"
ackv1alpha1 "github.com/aws/aws-controllers-k8s/apis/core/v1alpha1"
acktypes "github.com/aws/aws-controllers-k8s/pkg/types"
svcresource "github.com/aws/aws-controllers-k8s/services/apigatewayv2/pkg/resource"
)
// resourceManagerFactory produces resourceManager objects. It implements the
// `types.AWSResourceManagerFactory` interface.
type resourceManagerFactory struct {
sync.RWMutex
// rmCache contains resource managers for a particular AWS account ID
rmCache map[ackv1alpha1.AWSAccountID]*resourceManager
}
// ResourcePrototype returns an AWSResource that resource managers produced by
// this factory will handle
func (f *resourceManagerFactory) ResourceDescriptor() acktypes.AWSResourceDescriptor {
return &resourceDescriptor{}
}
// ManagerFor returns a resource manager object that can manage resources for a
// supplied AWS account
func (f *resourceManagerFactory) ManagerFor(
rr acktypes.AWSResourceReconciler,
id ackv1alpha1.AWSAccountID,
region ackv1alpha1.AWSRegion,
) (acktypes.AWSResourceManager, error) {
f.RLock()
rm, found := f.rmCache[id]
f.RUnlock()
if found {
return rm, nil
}
f.Lock()
defer f.Unlock()
rm, err := newResourceManager(rr, id, region)
if err != nil {
return nil, err
}
f.rmCache[id] = rm
return rm, nil
}
func newResourceManagerFactory() *resourceManagerFactory {
return &resourceManagerFactory{
rmCache: map[ackv1alpha1.AWSAccountID]*resourceManager{},
}
}
func init() {
svcresource.RegisterManagerFactory(newResourceManagerFactory())
}
| {
"pile_set_name": "Github"
} |
// IE11 needs to wait for Polymer being loaded.
HTMLImports.whenReady(function() {
Polymer({
is: 'value-null',
properties: {
value: {
notify: true
}
},
});
});
describe('data binding', function() {
// Chrome demonstrates a loop when setting value to null/undefined and value is
// bound in other components firing change events like in iron-input#bindValue.
// In other browsers these tests do not work, and the browser could freeze.
describeIf(chrome, 'Chrome loops', function() {
var valueNull, comboBox;
beforeEach(function() {
var root = fixture('fixturenull');
valueNull = Polymer.dom(root).querySelector('value-null');
comboBox = Polymer.dom(root).querySelector('vaadin-combo-box');
});
// Setting value to null/undefined makes the component enter in a loop,
// for instance iron-localstorage sets it to null when the key does not exist.
[null, undefined].forEach(function(value) {
it('should not enter in a loop when setting value to ' + value, function(done) {
// Not using sinon.spy, so we can break the loop before overflowing the stack.
var i = 0;
comboBox.addEventListener('value-changed', function() {
expect(i++).to.be.below(30);
});
Polymer.Base.async(function() {
expect(i).to.be.at.most(2);
done();
}, 1);
valueNull.value = value;
});
});
});
});
| {
"pile_set_name": "Github"
} |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.MobileAnarchy.Android.Widgets.Joystick.DualJoystickView
android:id="@+id/dualjoystickView" android:layout_gravity="center_horizontal"
android:layout_marginTop="5dip" android:layout_width="fill_parent"
android:layout_height="175dip" />
<TableLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="center_horizontal"
android:layout_marginTop="10dip">
<TableRow>
<TextView android:text="X" android:layout_width="50dip"
android:layout_height="wrap_content"></TextView>
<TextView android:text="" android:id="@+id/TextViewX1"
android:layout_width="150dip" android:layout_height="wrap_content"></TextView>
<TextView android:text="X" android:layout_width="50dip"
android:layout_height="wrap_content"></TextView>
<TextView android:text="" android:id="@+id/TextViewX2"
android:layout_width="100dip" android:layout_height="wrap_content"></TextView>
</TableRow>
<TableRow>
<TextView android:text="Y" android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:text="" android:id="@+id/TextViewY1"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Y" android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:text="" android:id="@+id/TextViewY2"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</TableRow>
</TableLayout>
</LinearLayout> | {
"pile_set_name": "Github"
} |
{
"name" : "Hello %",
"hello" : {
"world" : "Hello world!"
},
"values" : "Hello everyone my name is % and I'm %, see you soon",
"username" : "My username is :username",
"level" : {
"one" : {
"two" : {
"three" : "This is a multilevel key"
}
}
},
"the.same.lavel" : "This is a localized in the same level",
"enlish" : "This key only exist in english file.",
"segment": {
"base": {
"one": "First",
"two": "Second"
}
},
"one": "First",
"two": "Second"
}
| {
"pile_set_name": "Github"
} |
.s-btn:hover .m-btn-line,
.s-btn-active .m-btn-line,
.s-btn-plain-active .m-btn-line {
display: inline-block;
}
.l-btn:hover .s-btn-downarrow,
.s-btn-active .s-btn-downarrow,
.s-btn-plain-active .s-btn-downarrow {
border-style: solid;
border-color: #bfbfbf;
border-width: 0 0 0 1px;
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/history/history_service_factory.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/content/browser/history_database_helper.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/prefs/pref_service.h"
// static
history::HistoryService* HistoryServiceFactory::GetForProfile(
Profile* profile,
ServiceAccessType sat) {
// If saving history is disabled, only allow explicit access.
if (sat != ServiceAccessType::EXPLICIT_ACCESS &&
profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
return nullptr;
}
return static_cast<history::HistoryService*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
// static
history::HistoryService* HistoryServiceFactory::GetForProfileIfExists(
Profile* profile,
ServiceAccessType sat) {
// If saving history is disabled, only allow explicit access.
if (sat != ServiceAccessType::EXPLICIT_ACCESS &&
profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
return nullptr;
}
return static_cast<history::HistoryService*>(
GetInstance()->GetServiceForBrowserContext(profile, false));
}
// static
history::HistoryService* HistoryServiceFactory::GetForProfileWithoutCreating(
Profile* profile) {
return static_cast<history::HistoryService*>(
GetInstance()->GetServiceForBrowserContext(profile, false));
}
// static
HistoryServiceFactory* HistoryServiceFactory::GetInstance() {
return base::Singleton<HistoryServiceFactory>::get();
}
// static
void HistoryServiceFactory::ShutdownForProfile(Profile* profile) {
HistoryServiceFactory* factory = GetInstance();
factory->BrowserContextDestroyed(profile);
}
HistoryServiceFactory::HistoryServiceFactory()
: BrowserContextKeyedServiceFactory(
"HistoryService",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(BookmarkModelFactory::GetInstance());
}
HistoryServiceFactory::~HistoryServiceFactory() {
}
KeyedService* HistoryServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
Profile* profile = Profile::FromBrowserContext(context);
std::unique_ptr<history::HistoryService> history_service(
new history::HistoryService(
base::WrapUnique(new ChromeHistoryClient(
BookmarkModelFactory::GetForProfile(profile))),
base::WrapUnique(new history::ContentVisitDelegate(profile))));
if (!history_service->Init(
history::HistoryDatabaseParamsForPath(profile->GetPath()))) {
return nullptr;
}
return history_service.release();
}
content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
return true;
}
| {
"pile_set_name": "Github"
} |
// Copyright 2018 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.
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
#include <algorithm>
#include <utility>
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_pump.h"
#include "base/threading/hang_watcher.h"
#include "base/time/tick_clock.h"
#include "base/trace_event/base_tracing.h"
#include "build/build_config.h"
#if defined(OS_IOS)
#include "base/message_loop/message_pump_mac.h"
#elif defined(OS_ANDROID)
#include "base/message_loop/message_pump_android.h"
#endif
namespace base {
namespace sequence_manager {
namespace internal {
namespace {
// Returns |next_run_time| capped at 1 day from |lazy_now|. This is used to
// mitigate https://crbug.com/850450 where some platforms are unhappy with
// delays > 100,000,000 seconds. In practice, a diagnosis metric showed that no
// sleep > 1 hour ever completes (always interrupted by an earlier MessageLoop
// event) and 99% of completed sleeps are the ones scheduled for <= 1 second.
// Details @ https://crrev.com/c/1142589.
TimeTicks CapAtOneDay(TimeTicks next_run_time, LazyNow* lazy_now) {
return std::min(next_run_time, lazy_now->Now() + TimeDelta::FromDays(1));
}
} // namespace
ThreadControllerWithMessagePumpImpl::ThreadControllerWithMessagePumpImpl(
const SequenceManager::Settings& settings)
: associated_thread_(AssociatedThreadId::CreateUnbound()),
work_deduplicator_(associated_thread_),
#if DCHECK_IS_ON()
log_runloop_quit_and_quit_when_idle_(
settings.log_runloop_quit_and_quit_when_idle),
#endif
time_source_(settings.clock) {
}
ThreadControllerWithMessagePumpImpl::ThreadControllerWithMessagePumpImpl(
std::unique_ptr<MessagePump> message_pump,
const SequenceManager::Settings& settings)
: ThreadControllerWithMessagePumpImpl(settings) {
BindToCurrentThread(std::move(message_pump));
}
ThreadControllerWithMessagePumpImpl::~ThreadControllerWithMessagePumpImpl() {
// Destructors of MessagePump::Delegate and ThreadTaskRunnerHandle
// will do all the clean-up.
// ScopedSetSequenceLocalStorageMapForCurrentThread destructor will
// de-register the current thread as a sequence.
}
// static
std::unique_ptr<ThreadControllerWithMessagePumpImpl>
ThreadControllerWithMessagePumpImpl::CreateUnbound(
const SequenceManager::Settings& settings) {
return base::WrapUnique(new ThreadControllerWithMessagePumpImpl(settings));
}
ThreadControllerWithMessagePumpImpl::MainThreadOnly::MainThreadOnly() = default;
ThreadControllerWithMessagePumpImpl::MainThreadOnly::~MainThreadOnly() =
default;
void ThreadControllerWithMessagePumpImpl::SetSequencedTaskSource(
SequencedTaskSource* task_source) {
DCHECK(task_source);
DCHECK(!main_thread_only().task_source);
main_thread_only().task_source = task_source;
}
void ThreadControllerWithMessagePumpImpl::BindToCurrentThread(
std::unique_ptr<MessagePump> message_pump) {
associated_thread_->BindToCurrentThread();
pump_ = std::move(message_pump);
work_id_provider_ = WorkIdProvider::GetForCurrentThread();
RunLoop::RegisterDelegateForCurrentThread(this);
scoped_set_sequence_local_storage_map_for_current_thread_ = std::make_unique<
base::internal::ScopedSetSequenceLocalStorageMapForCurrentThread>(
&sequence_local_storage_map_);
{
base::internal::CheckedAutoLock task_runner_lock(task_runner_lock_);
if (task_runner_)
InitializeThreadTaskRunnerHandle();
}
if (work_deduplicator_.BindToCurrentThread() ==
ShouldScheduleWork::kScheduleImmediate) {
pump_->ScheduleWork();
}
}
void ThreadControllerWithMessagePumpImpl::SetWorkBatchSize(
int work_batch_size) {
DCHECK_GE(work_batch_size, 1);
main_thread_only().work_batch_size = work_batch_size;
}
void ThreadControllerWithMessagePumpImpl::SetTimerSlack(
TimerSlack timer_slack) {
DCHECK(RunsTasksInCurrentSequence());
pump_->SetTimerSlack(timer_slack);
}
void ThreadControllerWithMessagePumpImpl::WillQueueTask(
PendingTask* pending_task,
const char* task_queue_name) {
task_annotator_.WillQueueTask("SequenceManager PostTask", pending_task,
task_queue_name);
}
void ThreadControllerWithMessagePumpImpl::ScheduleWork() {
base::internal::CheckedLock::AssertNoLockHeldOnCurrentThread();
if (work_deduplicator_.OnWorkRequested() ==
ShouldScheduleWork::kScheduleImmediate) {
pump_->ScheduleWork();
}
}
void ThreadControllerWithMessagePumpImpl::SetNextDelayedDoWork(
LazyNow* lazy_now,
TimeTicks run_time) {
DCHECK_LT(lazy_now->Now(), run_time);
if (main_thread_only().next_delayed_do_work == run_time)
return;
// Cap at one day but remember the exact time for the above equality check on
// the next round.
main_thread_only().next_delayed_do_work = run_time;
run_time = CapAtOneDay(run_time, lazy_now);
// It's very rare for PostDelayedTask to be called outside of a DoWork in
// production, so most of the time this does nothing.
if (work_deduplicator_.OnDelayedWorkRequested() ==
ShouldScheduleWork::kScheduleImmediate) {
// |pump_| can't be null as all postTasks are cross-thread before binding,
// and delayed cross-thread postTasks do the thread hop through an immediate
// task.
pump_->ScheduleDelayedWork(run_time);
}
}
const TickClock* ThreadControllerWithMessagePumpImpl::GetClock() {
return time_source_;
}
bool ThreadControllerWithMessagePumpImpl::RunsTasksInCurrentSequence() {
return associated_thread_->IsBoundToCurrentThread();
}
void ThreadControllerWithMessagePumpImpl::SetDefaultTaskRunner(
scoped_refptr<SingleThreadTaskRunner> task_runner) {
base::internal::CheckedAutoLock lock(task_runner_lock_);
task_runner_ = task_runner;
if (associated_thread_->IsBound()) {
DCHECK(associated_thread_->IsBoundToCurrentThread());
// Thread task runner handle will be created in BindToCurrentThread().
InitializeThreadTaskRunnerHandle();
}
}
void ThreadControllerWithMessagePumpImpl::InitializeThreadTaskRunnerHandle() {
// Only one ThreadTaskRunnerHandle can exist at any time,
// so reset the old one.
main_thread_only().thread_task_runner_handle.reset();
main_thread_only().thread_task_runner_handle =
std::make_unique<ThreadTaskRunnerHandle>(task_runner_);
// When the task runner is known, bind the power manager. Power notifications
// are received through that sequence.
power_monitor_.BindToCurrentThread();
}
scoped_refptr<SingleThreadTaskRunner>
ThreadControllerWithMessagePumpImpl::GetDefaultTaskRunner() {
base::internal::CheckedAutoLock lock(task_runner_lock_);
return task_runner_;
}
void ThreadControllerWithMessagePumpImpl::RestoreDefaultTaskRunner() {
// There's no default task runner unlike with the MessageLoop.
main_thread_only().thread_task_runner_handle.reset();
}
void ThreadControllerWithMessagePumpImpl::AddNestingObserver(
RunLoop::NestingObserver* observer) {
DCHECK(!main_thread_only().nesting_observer);
DCHECK(observer);
main_thread_only().nesting_observer = observer;
RunLoop::AddNestingObserverOnCurrentThread(this);
}
void ThreadControllerWithMessagePumpImpl::RemoveNestingObserver(
RunLoop::NestingObserver* observer) {
DCHECK_EQ(main_thread_only().nesting_observer, observer);
main_thread_only().nesting_observer = nullptr;
RunLoop::RemoveNestingObserverOnCurrentThread(this);
}
const scoped_refptr<AssociatedThreadId>&
ThreadControllerWithMessagePumpImpl::GetAssociatedThread() const {
return associated_thread_;
}
void ThreadControllerWithMessagePumpImpl::BeforeDoInternalWork() {
// Nested runloops are covered by the parent loop hang watch scope.
// TODO(crbug/1034046): Provide more granular scoping that reuses the parent
// scope deadline.
if (main_thread_only().runloop_count == 1) {
hang_watch_scope_.emplace(base::HangWatchScope::kDefaultHangWatchTime);
}
work_id_provider_->IncrementWorkId();
}
void ThreadControllerWithMessagePumpImpl::BeforeWait() {
// Nested runloops are covered by the parent loop hang watch scope.
// TODO(crbug/1034046): Provide more granular scoping that reuses the parent
// scope deadline.
if (main_thread_only().runloop_count == 1) {
// Waiting for work cannot be covered by a hang watch scope because that
// means the thread can be idle for unbounded time.
hang_watch_scope_.reset();
}
work_id_provider_->IncrementWorkId();
}
MessagePump::Delegate::NextWorkInfo
ThreadControllerWithMessagePumpImpl::DoWork() {
// Nested runloops are covered by the parent loop hang watch scope.
// TODO(crbug/1034046): Provide more granular scoping that reuses the parent
// scope deadline.
if (main_thread_only().runloop_count == 1) {
hang_watch_scope_.emplace(base::HangWatchScope::kDefaultHangWatchTime);
}
work_deduplicator_.OnWorkStarted();
LazyNow continuation_lazy_now(time_source_);
TimeDelta delay_till_next_task = DoWorkImpl(&continuation_lazy_now);
// Schedule a continuation.
WorkDeduplicator::NextTask next_task =
delay_till_next_task.is_zero() ? WorkDeduplicator::NextTask::kIsImmediate
: WorkDeduplicator::NextTask::kIsDelayed;
if (work_deduplicator_.DidCheckForMoreWork(next_task) ==
ShouldScheduleWork::kScheduleImmediate) {
// Need to run new work immediately, but due to the contract of DoWork
// we only need to return a null TimeTicks to ensure that happens.
return MessagePump::Delegate::NextWorkInfo();
}
// While the math below would saturate when |delay_till_next_task.is_max()|;
// special-casing here avoids unnecessarily sampling Now() when out of work.
if (delay_till_next_task.is_max()) {
main_thread_only().next_delayed_do_work = TimeTicks::Max();
return {TimeTicks::Max()};
}
// The MessagePump will schedule the delay on our behalf, so we need to update
// |main_thread_only().next_delayed_do_work|.
// TODO(gab, alexclarke): Replace DelayTillNextTask() with NextTaskTime() to
// avoid converting back-and-forth between TimeTicks and TimeDelta.
main_thread_only().next_delayed_do_work =
continuation_lazy_now.Now() + delay_till_next_task;
// Don't request a run time past |main_thread_only().quit_runloop_after|.
if (main_thread_only().next_delayed_do_work >
main_thread_only().quit_runloop_after) {
main_thread_only().next_delayed_do_work =
main_thread_only().quit_runloop_after;
// If we've passed |quit_runloop_after| there's no more work to do.
if (continuation_lazy_now.Now() >= main_thread_only().quit_runloop_after)
return {TimeTicks::Max()};
}
return {CapAtOneDay(main_thread_only().next_delayed_do_work,
&continuation_lazy_now),
continuation_lazy_now.Now()};
}
TimeDelta ThreadControllerWithMessagePumpImpl::DoWorkImpl(
LazyNow* continuation_lazy_now) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("sequence_manager"),
"ThreadControllerImpl::DoWork");
if (!main_thread_only().task_execution_allowed) {
if (main_thread_only().quit_runloop_after == TimeTicks::Max())
return TimeDelta::Max();
return main_thread_only().quit_runloop_after - continuation_lazy_now->Now();
}
DCHECK(main_thread_only().task_source);
for (int i = 0; i < main_thread_only().work_batch_size; i++) {
const SequencedTaskSource::SelectTaskOption select_task_option =
power_monitor_.IsProcessInPowerSuspendState()
? SequencedTaskSource::SelectTaskOption::kSkipDelayedTask
: SequencedTaskSource::SelectTaskOption::kDefault;
Task* task =
main_thread_only().task_source->SelectNextTask(select_task_option);
if (!task)
break;
// Execute the task and assume the worst: it is probably not reentrant.
main_thread_only().task_execution_allowed = false;
work_id_provider_->IncrementWorkId();
// Trace-parsing tools (DevTools, Lighthouse, etc) consume this event
// to determine long tasks.
// The event scope must span across DidRunTask call below to make sure
// it covers RunMicrotasks event.
// See https://crbug.com/681863 and https://crbug.com/874982
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "RunTask");
{
// Trace events should finish before we call DidRunTask to ensure that
// SequenceManager trace events do not interfere with them.
TRACE_TASK_EXECUTION("ThreadControllerImpl::RunTask", *task);
task_annotator_.RunTask("SequenceManager RunTask", task);
}
#if DCHECK_IS_ON()
if (log_runloop_quit_and_quit_when_idle_ && !quit_when_idle_requested_ &&
ShouldQuitWhenIdle()) {
DVLOG(1) << "ThreadControllerWithMessagePumpImpl::QuitWhenIdle";
quit_when_idle_requested_ = true;
}
#endif
main_thread_only().task_execution_allowed = true;
main_thread_only().task_source->DidRunTask();
// When Quit() is called we must stop running the batch because the caller
// expects per-task granularity.
if (main_thread_only().quit_pending)
break;
}
if (main_thread_only().quit_pending)
return TimeDelta::Max();
work_deduplicator_.WillCheckForMoreWork();
// Re-check the state of the power after running tasks. An executed task may
// have been a power change notification.
const SequencedTaskSource::SelectTaskOption select_task_option =
power_monitor_.IsProcessInPowerSuspendState()
? SequencedTaskSource::SelectTaskOption::kSkipDelayedTask
: SequencedTaskSource::SelectTaskOption::kDefault;
TimeDelta do_work_delay = main_thread_only().task_source->DelayTillNextTask(
continuation_lazy_now, select_task_option);
DCHECK_GE(do_work_delay, TimeDelta());
return do_work_delay;
}
bool ThreadControllerWithMessagePumpImpl::DoIdleWork() {
TRACE_EVENT0("sequence_manager", "SequenceManager::DoIdleWork");
// Nested runloops are covered by the parent loop hang watch scope.
// TODO(crbug/1034046): Provide more granular scoping that reuses the parent
// scope deadline.
if (main_thread_only().runloop_count == 1) {
hang_watch_scope_.emplace(base::HangWatchScope::kDefaultHangWatchTime);
}
work_id_provider_->IncrementWorkId();
#if defined(OS_WIN)
if (!power_monitor_.IsProcessInPowerSuspendState()) {
// Avoid calling Time::ActivateHighResolutionTimer() between
// suspend/resume as the system hangs if we do (crbug.com/1074028).
// OnResume() will generate a task on this thread per the
// ThreadControllerPowerMonitor observer and DoIdleWork() will thus get
// another chance to set the right high-resolution-timer-state before
// going to sleep after resume.
const bool need_high_res_mode =
main_thread_only().task_source->HasPendingHighResolutionTasks();
if (main_thread_only().in_high_res_mode != need_high_res_mode) {
// On Windows we activate the high resolution timer so that the wait
// _if_ triggered by the timer happens with good resolution. If we don't
// do this the default resolution is 15ms which might not be acceptable
// for some tasks.
main_thread_only().in_high_res_mode = need_high_res_mode;
Time::ActivateHighResolutionTimer(need_high_res_mode);
}
}
#endif // defined(OS_WIN)
if (main_thread_only().task_source->OnSystemIdle()) {
// The OnSystemIdle() callback resulted in more immediate work, so schedule
// a DoWork callback. For some message pumps returning true from here is
// sufficient to do that but not on mac.
pump_->ScheduleWork();
return false;
}
// Check if any runloop timeout has expired.
if (main_thread_only().quit_runloop_after != TimeTicks::Max() &&
main_thread_only().quit_runloop_after <= time_source_->NowTicks()) {
Quit();
return false;
}
// RunLoop::Delegate knows whether we called Run() or RunUntilIdle().
if (ShouldQuitWhenIdle())
Quit();
return false;
}
void ThreadControllerWithMessagePumpImpl::Run(bool application_tasks_allowed,
TimeDelta timeout) {
DCHECK(RunsTasksInCurrentSequence());
// RunLoops can be nested so we need to restore the previous value of
// |quit_runloop_after| upon exit. NB we could use saturated arithmetic here
// but don't because we have some tests which assert the number of calls to
// Now.
AutoReset<TimeTicks> quit_runloop_after(
&main_thread_only().quit_runloop_after,
(timeout == TimeDelta::Max()) ? TimeTicks::Max()
: time_source_->NowTicks() + timeout);
#if DCHECK_IS_ON()
AutoReset<bool> quit_when_idle_requested(&quit_when_idle_requested_, false);
#endif
// Quit may have been called outside of a Run(), so |quit_pending| might be
// true here. We can't use InTopLevelDoWork() in Quit() as this call may be
// outside top-level DoWork but still in Run().
main_thread_only().quit_pending = false;
main_thread_only().runloop_count++;
if (application_tasks_allowed && !main_thread_only().task_execution_allowed) {
// Allow nested task execution as explicitly requested.
DCHECK(RunLoop::IsNestedOnCurrentThread());
main_thread_only().task_execution_allowed = true;
pump_->Run(this);
main_thread_only().task_execution_allowed = false;
} else {
pump_->Run(this);
}
#if DCHECK_IS_ON()
if (log_runloop_quit_and_quit_when_idle_)
DVLOG(1) << "ThreadControllerWithMessagePumpImpl::Quit";
#endif
main_thread_only().runloop_count--;
main_thread_only().quit_pending = false;
// Reset the hang watch scope upon exiting the outermost loop since the
// execution it covers is now completely over.
if (main_thread_only().runloop_count == 0)
hang_watch_scope_.reset();
}
void ThreadControllerWithMessagePumpImpl::OnBeginNestedRunLoop() {
// We don't need to ScheduleWork here! That's because the call to pump_->Run()
// above, which is always called for RunLoop().Run(), guarantees a call to
// DoWork on all platforms.
if (main_thread_only().nesting_observer)
main_thread_only().nesting_observer->OnBeginNestedRunLoop();
}
void ThreadControllerWithMessagePumpImpl::OnExitNestedRunLoop() {
if (main_thread_only().nesting_observer)
main_thread_only().nesting_observer->OnExitNestedRunLoop();
}
void ThreadControllerWithMessagePumpImpl::Quit() {
DCHECK(RunsTasksInCurrentSequence());
// Interrupt a batch of work.
main_thread_only().quit_pending = true;
// If we're in a nested RunLoop, continuation will be posted if necessary.
pump_->Quit();
}
void ThreadControllerWithMessagePumpImpl::EnsureWorkScheduled() {
if (work_deduplicator_.OnWorkRequested() ==
ShouldScheduleWork::kScheduleImmediate)
pump_->ScheduleWork();
}
void ThreadControllerWithMessagePumpImpl::SetTaskExecutionAllowed(
bool allowed) {
if (allowed) {
// We need to schedule work unconditionally because we might be about to
// enter an OS level nested message loop. Unlike a RunLoop().Run() we don't
// get a call to DoWork on entering for free.
work_deduplicator_.OnWorkRequested(); // Set the pending DoWork flag.
pump_->ScheduleWork();
} else {
// We've (probably) just left an OS level nested message loop. Make sure a
// subsequent PostTask within the same Task doesn't ScheduleWork with the
// pump (this will be done anyway when the task exits).
work_deduplicator_.OnWorkStarted();
}
main_thread_only().task_execution_allowed = allowed;
}
bool ThreadControllerWithMessagePumpImpl::IsTaskExecutionAllowed() const {
return main_thread_only().task_execution_allowed;
}
MessagePump* ThreadControllerWithMessagePumpImpl::GetBoundMessagePump() const {
return pump_.get();
}
#if defined(OS_IOS)
void ThreadControllerWithMessagePumpImpl::AttachToMessagePump() {
static_cast<MessagePumpCFRunLoopBase*>(pump_.get())->Attach(this);
}
void ThreadControllerWithMessagePumpImpl::DetachFromMessagePump() {
static_cast<MessagePumpCFRunLoopBase*>(pump_.get())->Detach();
}
#elif defined(OS_ANDROID)
void ThreadControllerWithMessagePumpImpl::AttachToMessagePump() {
static_cast<MessagePumpForUI*>(pump_.get())->Attach(this);
}
#endif
bool ThreadControllerWithMessagePumpImpl::ShouldQuitRunLoopWhenIdle() {
if (main_thread_only().runloop_count == 0)
return false;
// It's only safe to call ShouldQuitWhenIdle() when in a RunLoop.
return ShouldQuitWhenIdle();
}
} // namespace internal
} // namespace sequence_manager
} // namespace base
| {
"pile_set_name": "Github"
} |
# Syntax:
#
# N: Firstname Lastname <email>
# F: file pattern or directory
# F: file pattern or directory
#
# The "F" entries can be:
#
# - A directory, in which case all patches touching any file in this
# directory or its subdirectories will be CC'ed to the developer.
# - A pattern, in which case the pattern will be expanded, and then
# all files/directories (and their subdirectories) will be
# considered when matching against a patch
#
# Notes:
#
# - When a developer adds an "arch/Config.in.<arch>" file to its list
# of files, he is considered a developer of this architecture. He
# will receive e-mail notifications about build failures occuring on
# this architecture. Not more than one e-mail per day is sent.
# - When a developer adds a directory that contains one or several
# packages, this developer will be notified when build failures
# occur. Not more than one e-mail per day is sent.
# - When a developer adds an "package/pkg-<infra>.mk" file to its list
# of files, he is considered interested by this package
# infrastructure, and will be CC'ed on all patches that add or
# modify packages that use this infrastructure.
N: Adam Duskett <[email protected]>
F: package/audit/
F: package/busybox/
F: package/checkpolicy/
F: package/cppdb/
F: package/gobject-introspection/
F: package/gstreamer1/gstreamer1/
F: package/gstreamer1/gstreamer1-mm/
F: package/gstreamer1/gst1-plugins-bad/
F: package/gstreamer1/gst1-plugins-base/
F: package/gstreamer1/gst1-plugins-good/
F: package/gstreamer1/gst1-plugins-ugly/
F: package/gstreamer1/gst1-python/
F: package/gstreamer1/gst1-vaapi/
F: package/imx-usb-loader/
F: package/janus-gateway/
F: package/json-for-modern-cpp/
F: package/libcpprestsdk/
F: package/libressl/
F: package/libselinux/
F: package/libsemanage/
F: package/libsepol/
F: package/libtextstyle/
F: package/libwebsockets/
F: package/mender-grubenv/
F: package/nginx-naxsi/
F: package/openjdk/
F: package/openjdk-bin/
F: package/php/
F: package/pkcs11-helper/
F: package/policycoreutils/
F: package/prelink-cross/
F: package/polkit/
F: package/python3/
F: package/python-aioredis/
F: package/python-asgiref/
F: package/python-channels/
F: package/python-channels-redis/
F: package/python-daphne/
F: package/python-django-enumfields/
F: package/python-flask-sqlalchemy/
F: package/python-gitdb2/
F: package/python-gobject/
F: package/python-lockfile/
F: package/python-mutagen/
F: package/python-nested-dict/
F: package/python-pbr/
F: package/python-pip/
F: package/python-psycopg2/
F: package/python-smmap2/
F: package/python-sqlalchemy/
F: package/python-sqlparse/
F: package/python-visitor/
F: package/restorecond/
F: package/refpolicy/
F: package/selinux-python/
F: package/semodule-utils/
F: package/setools/
F: package/sngrep/
F: package/spidermonkey/
F: package/systemd/
F: support/testing/tests/package/test_gst1_python.py
F: support/testing/tests/package/test_python_gobject.py
N: Adam Heinrich <[email protected]>
F: package/jack1/
N: Adrian Perez de Castro <[email protected]>
F: package/brotli/
F: package/bubblewrap/
F: package/cage/
F: package/cog/
F: package/libepoxy/
F: package/libwpe/
F: package/webkitgtk/
F: package/wlroots/
F: package/woff2/
F: package/wpebackend-fdo/
F: package/wpewebkit/
F: package/xdg-dbus-proxy/
N: Adrien Gallouët <[email protected]>
F: package/bird/
F: package/glorytun/
N: Aleksander Morgado <[email protected]>
F: package/libmbim/
F: package/libqmi/
F: package/modem-manager/
N: Alex Michel <[email protected]>
F: package/network-manager-openvpn/
N: Alex Suykov <[email protected]>
F: board/chromebook/snow/
F: configs/chromebook_snow_defconfig
F: package/vboot-utils/
N: Alexander Clouter <[email protected]>
F: package/odhcp6c/
N: Alexander Dahl <[email protected]>
F: package/fastd/
F: package/libuecc/
F: package/putty/
N: Alexander Kurz <[email protected]>
F: package/minimodem/
N: Alexander Lukichev <[email protected]>
F: package/openpgm/
N: Alexander Mukhin <[email protected]>
F: package/tinyproxy/
N: Alexander Sverdlin <[email protected]>
F: package/mini-snmpd/
N: Alexander Varnin <[email protected]>
F: package/liblog4c-localtime/
N: Alexandre Belloni <[email protected]>
F: package/tz/
N: Alexandre Esse <[email protected]>
F: package/kvazaar/
F: package/v4l2loopback/
N: Alexey Brodkin <[email protected]>
F: board/cubietech/cubieboard2/
F: configs/cubieboard2_defconfig
N: Alistair Francis <[email protected]>
F: board/sifive/
F: boot/opensbi/
F: configs/hifive_unleashed_defconfig
F: package/xen/
N: Alvaro G. M <[email protected]>
F: package/dcron/
F: package/libxmlrpc/
F: package/python-docopt/
N: Anders Darander <[email protected]>
F: package/ktap/
N: André Hentschel <[email protected]>
F: board/freescale/imx8qxpmek/
F: configs/freescale_imx8qxpmek_defconfig
F: package/freescale-imx/imx-sc-firmware/
F: package/libkrb5/
F: package/openal/
F: package/p7zip/
F: package/wine/
N: Andrey Smirnov <[email protected]>
F: package/python-backports-shutil-get-terminal-size/
F: package/python-decorator/
F: package/python-ipython-genutils/
F: package/python-pathlib2/
F: package/python-pickleshare/
F: package/python-scandir/
F: package/python-simplegeneric/
F: package/python-systemd/
F: package/python-traitlets/
F: package/zstd/
N: Andrey Yurovsky <[email protected]>
F: package/rauc/
N: Angelo Compagnucci <[email protected]>
F: package/apparmor/
F: package/corkscrew/
F: package/fail2ban/
F: package/i2c-tools/
F: package/libapparmor/
F: package/mender/
F: package/mender-artifact/
F: package/mono/
F: package/mono-gtksharp3/
F: package/monolite/
F: package/python-can/
F: package/python-pillow/
F: package/python-pydal/
F: package/python-spidev/
F: package/python-web2py/
F: package/sshguard/
F: package/sunwait/
F: package/sysdig/
N: Anisse Astier <[email protected]>
F: package/go/
F: package/nghttp2/
F: package/pkg-golang.mk
N: Anthony Viallard <[email protected]>
F: package/gnuplot/
N: Antoine Ténart <[email protected]>
F: package/wf111/
N: Antony Pavlov <[email protected]>
F: package/lsscsi/
N: ARC Maintainers <[email protected]>
F: arch/Config.in.arc
F: board/synopsys/
F: configs/snps_arc700_axs101_defconfig
F: configs/snps_archs38_axs103_defconfig
F: configs/snps_archs38_haps_defconfig
F: configs/snps_archs38_hsdk_defconfig
F: configs/snps_archs38_vdk_defconfig
N: Ariel D'Alessandro <[email protected]>
F: package/axfsutils/
F: package/mali-t76x/
N: Arnaud Aujon <[email protected]>
F: package/espeak/
N: Arnout Vandecappelle <[email protected]>
F: package/arp-scan/
F: package/dehydrated/
F: package/freescale-imx/firmware-imx/
F: package/freescale-imx/imx-lib/
F: package/libpagekite/
F: package/lua-bit32/
F: package/owfs/
F: package/python-bottle/
F: package/sqlcipher/
F: package/stress/
N: Arthur Courtel <[email protected]>
F: board/raspberrypi/genimage-raspberrypi4-64.cfg
F: configs/raspberrypi4_64_defconfig
N: Asaf Kahlon <[email protected]>
F: package/collectd/
F: package/libfuse3/
F: package/libuv/
F: package/python*
F: package/snmpclitools/
F: package/spdlog/
F: package/uftp/
F: package/uvw/
F: package/zeromq/
N: Ash Charles <[email protected]>
F: package/pru-software-support/
F: package/ti-cgt-pru/
N: Assaf Inbal <[email protected]>
F: package/lbase64/
F: package/luabitop/
F: package/luaexpatutils/
F: package/luaposix/
F: package/luasec/
F: package/lua-ev/
F: package/orbit/
N: Attila Wagner <[email protected]>
F: package/python-canopen/
N: Bartosz Bilas <[email protected]>
F: board/stmicroelectronics/stm32mp157a-dk1/
F: configs/stm32mp157a_dk1_defconfig
F: package/python-esptool/
F: package/python-pyaes/
F: package/qt5/qt5scxml/
F: package/qt5/qt5webview/
N: Bartosz Golaszewski <[email protected]>
F: package/autoconf-archive/
F: package/doxygen/
F: package/libgpiod/
F: package/libserialport/
F: package/libsigrok/
F: package/libsigrokdecode/
F: package/libzip/
F: package/pulseview/
F: package/sigrok-cli/
N: Baruch Siach <[email protected]>
F: board/solidrun/clearfog_gt_8k/
F: configs/solidrun_clearfog_gt_8k_defconfig
F: package/18xx-ti-utils/
F: package/cpuburn-arm/
F: package/daemon/
F: package/dropbear/
F: package/ebtables/
F: package/i2c-tools/
F: package/libcurl/
F: package/libpcap/
F: package/openipmi/
F: package/socat/
F: package/strace/
F: package/tcpdump/
F: package/ti-uim/
F: package/uhubctl/
N: Ben Boeckel <[email protected]>
F: package/taskd/
N: Benjamin Kamath <[email protected]>
F: package/lapack/
N: Bernd Kuhls <[email protected]>
F: package/alsa-lib/
F: package/alsa-utils/
F: package/apache/
F: package/apr/
F: package/apr-util/
F: package/bcg729/
F: package/bluez-tools/
F: package/boinc/
F: package/clamav/
F: package/dav1d/
F: package/dovecot/
F: package/dovecot-pigeonhole/
F: package/dtv-scan-tables/
F: package/eudev/
F: package/exim/
F: package/fetchmail/
F: package/ffmpeg/
F: package/flac/
F: package/freeswitch/
F: package/freeswitch-mod-bcg729/
F: package/freetype/
F: package/fstrcmp/
F: package/ghostscript/
F: package/giflib/
F: package/gli/
F: package/glmark2/
F: package/gpsd/
F: package/hdparm/
F: package/jsoncpp/
F: package/kodi*
F: package/lame/
F: package/leafnode2/
F: package/libaacs/
F: package/libasplib/
F: package/libass/
F: package/libbdplus/
F: package/libbluray/
F: package/libbroadvoice/
F: package/libcdio/
F: package/libcec/
F: package/libcodec2/
F: package/libcrossguid/
F: package/libdcadec/
F: package/libdrm/
F: package/libdvbcsa/
F: package/libdvdcss/
F: package/libdvdnav/
F: package/libdvdread/
F: package/libebur128/
F: package/libfreeglut/
F: package/libg7221/
F: package/libglew/
F: package/libglfw/
F: package/libglu/
F: package/libhdhomerun/
F: package/libilbc/
F: package/libldns/
F: package/libmicrohttpd/
F: package/libminiupnpc/
F: package/libmspack/
F: package/libnatpmp/
F: package/libnpth/
F: package/libogg/
F: package/libopenh264/
F: package/libpciaccess/
F: package/libplatform/
F: package/libpng/
F: package/libsidplay2/
F: package/libsilk/
F: package/libsndfile/
F: package/libsoil/
F: package/libsoundtouch/
F: package/libsquish/
F: package/libudfread/
F: package/liburiparser/
F: package/libva/
F: package/libva-intel-driver/
F: package/libva-utils/
F: package/libvorbis/
F: package/libvpx/
F: package/libyuv/
F: package/mesa3d/
F: package/minidlna/
F: package/mjpg-streamer/
F: package/perl-crypt-openssl-guess/
F: package/perl-crypt-openssl-random/
F: package/perl-crypt-openssl-rsa/
F: package/perl-digest-sha1/
F: package/perl-encode-detect/
F: package/perl-encode-locale/
F: package/perl-file-listing/
F: package/perl-html-parser/
F: package/perl-html-tagset/
F: package/perl-http-cookies/
F: package/perl-http-daemon/
F: package/perl-http-date/
F: package/perl-http-message/
F: package/perl-http-negotiate/
F: package/perl-io-html/
F: package/perl-lwp-mediatypes/
F: package/perl-mail-dkim/
F: package/perl-mailtools/
F: package/perl-net-dns/
F: package/perl-net-http/
F: package/perl-netaddr-ip/
F: package/perl-timedate/
F: package/perl-uri/
F: package/perl-www-robotrules/
F: package/pixman/
F: package/pngquant/
F: package/pound/
F: package/pulseaudio/
F: package/pure-ftpd/
F: package/python-couchdb/
F: package/python-cssutils/
F: package/python-futures/
F: package/python-mwclient/
F: package/python-mwscrape/
F: package/python-mwscrape2slob/
F: package/python-mako/
F: package/python-oauthlib/
F: package/python-pyicu/
F: package/python-pylru/
F: package/python-requests-oauthlib/
F: package/python-slob/
F: package/rtmpdump/
F: package/samba4/
F: package/softether/
F: package/spandsp/
F: package/sqlite/
F: package/stellarium/
F: package/taglib/
F: package/tinyxml2/
F: package/tor/
F: package/transmission/
F: package/tvheadend/
F: package/unixodbc/
F: package/utf8proc/
F: package/vdr/
F: package/vdr-plugin-vnsiserver/
F: package/vlc/
F: package/vnstat/
F: package/waylandpp/
F: package/x11r7/
F: package/x264/
F: package/x265/
F: package/ytree/
F: package/znc/
F: support/testing/tests/package/test_perl_html_parser.py
N: Biagio Montaruli <[email protected]>
F: board/acmesystems/
F: configs/acmesystems_*
N: Bogdan Radulescu <[email protected]>
F: package/iftop/
F: package/ncdu/
N: Brandon Maier <[email protected]>
F: package/vmtouch/
N: Brock Williams <[email protected]>
F: package/pdmenu/
N: Carlo Caione <[email protected]>
F: package/jailhouse/
F: package/sunxi-boards/
N: Carsten Schoenert <[email protected]>
F: package/dvbsnoop/
F: package/libdvbsi/
F: package/libsvg/
F: package/libsvg-cairo/
N: Cédric Chépied <[email protected]>
F: package/znc/
N: Chakra Divi <[email protected]>
F: board/friendlyarm/nanopi-m1
F: board/friendlyarm/nanopi-m1-plus
F: board/olimex/a13_olinuxino
F: board/orangepi/orangepi-plus
F: configs/nanopi_m1_defconfig
F: configs/nanopi_m1_plus_defconfig
F: configs/olimex_a13_olinuxino_defconfig
F: configs/orangepi_plus_defconfig
N: Chris Packham <[email protected]>
F: package/gstreamer1/gst1-shark/
F: package/micropython/
F: package/micropython-lib/
F: package/syslog-ng/
N: Christian Kellermann <[email protected]>
F: package/python-pylibftdi/
N: Christian Stewart <[email protected]>
F: linux/linux-ext-aufs.mk
F: package/aufs/
F: package/aufs-util/
F: package/batman-adv/
F: package/docker-cli/
F: package/docker-containerd/
F: package/docker-engine/
F: package/docker-proxy/
F: package/go/
F: package/mosh/
F: package/pkg-golang.mk
F: package/rtl8821au/
F: package/runc/
F: package/tini/
N: Christophe Priouzeau <[email protected]>
F: board/stmicroelectronics/stm32f429-disco/
F: board/stmicroelectronics/stm32f469-disco/
F: configs/stm32f429_disco_defconfig
F: configs/stm32f469_disco_defconfig
N: Christophe Vu-Brugier <[email protected]>
F: package/drbd-utils/
F: package/iotop/
F: package/python-configshell-fb/
F: package/python-rtslib-fb/
F: package/python-urwid/
F: package/targetcli-fb/
N: Christopher McCrory <[email protected]>
F: package/perl-appconfig/
F: package/perl-astro-suntime/
F: package/perl-class-load/
F: package/perl-class-std/
F: package/perl-class-std-fast/
F: package/perl-data-dump/
F: package/perl-data-optlist/
F: package/perl-data-uuid/
F: package/perl-date-manip/
F: package/perl-dbd-mysql/
F: package/perl-dbi/
F: package/perl-device-serialport/
F: package/perl-dist-checkconflicts/
F: package/perl-file-slurp/
F: package/perl-io-interface/
F: package/perl-io-socket-multicast/
F: package/perl-json-maybexs/
F: package/perl-mime-tools/
F: package/perl-module-implementation/
F: package/perl-module-runtime/
F: package/perl-number-bytes-human/
F: package/perl-package-stash/
F: package/perl-params-util/
F: package/perl-sub-install/
F: package/perl-sys-cpu/
F: package/perl-sys-meminfo/
F: package/perl-sys-mmap/
F: package/perl-time-parsedate/
F: package/perl-x10/
N: Clayton Shotwell <[email protected]>
F: package/audit/
F: package/checkpolicy/
F: package/cpio/
F: package/libcgroup/
F: package/libee/
F: package/libestr/
F: package/liblogging/
F: package/libselinux/
F: package/libsemanage/
F: package/libsepol/
F: package/policycoreutils/
N: Clément Péron <[email protected]>
F: board/beelink/gs1/
F: configs/beelink_gs1_defconfig
N: Corentin Guillevic <[email protected]>
F: package/libloki/
N: Cyril Bur <[email protected]>
F: arch/Config.in.powerpc
F: package/kvm-unit-tests
N: Daniel J. Leach <[email protected]>
F: package/dacapo/
N: Damien Lanson <[email protected]>
F: package/libvdpau/
F: package/log4cpp/
N: Daniel Nicoletti <[email protected]>
F: package/cutelyst/
N: Daniel Price <[email protected]>
F: package/nodejs/
F: package/redis/
N: Daniel Sangue <[email protected]>
F: package/libftdi1/
N: Danomi Manchego <[email protected]>
F: package/cjson/
F: package/jq/
F: package/libwebsockets/
F: package/ljsyscall/
F: package/lua-cjson/
F: package/luaexpat/
F: package/xinetd/
N: David Bachelart <[email protected]>
F: package/ccrypt/
F: package/dos2unix/
F: package/ipmiutil/
F: package/jsmn/
F: package/python-daemon/
F: package/sslh/
F: package/udpxy/
N: David Bender <[email protected]>
F: package/benejson/
F: package/cgic/
F: package/freeradius-client/
F: package/openldap/
N: David du Colombier <[email protected]>
F: package/x264/
N: David Lechner <[email protected]>
F: board/lego/ev3/
F: configs/lego_ev3_defconfig
F: linux/linux-ext-ev3dev-linux-drivers.mk
F: package/brickd/
F: package/ev3dev-linux-drivers/
N: Davide Viti <[email protected]>
F: board/friendlyarm/nanopi-r1/
F: configs/nanopi_r1_defconfig
F: package/flann/
F: package/python-paho-mqtt/
F: package/qhull/
F: package/tcllib/
N: Denis Bodor <[email protected]>
F: package/libstrophe/
N: Dimitrios Siganos <[email protected]>
F: package/wireless-regdb/
N: Dominik Faessler <[email protected]>
F: package/logsurfer/
F: package/python-id3/
N: Doug Kehn <[email protected]>
F: package/nss-pam-ldapd/
F: package/sp-oops-extract/
F: package/unscd/
N: Dushara Jayasinghe <[email protected]>
F: package/prosody/
N: Eloi Bail <[email protected]>
F: package/bayer2rgb-neon/
F: package/gstreamer1/gst1-plugins-bayer2rgb-neon/
N: Eric Le Bihan <[email protected]>
F: docs/manual/adding-packages-meson.txt
F: package/adwaita-icon-theme/
F: package/cargo-bin/
F: package/cargo/
F: package/darkhttpd/
F: package/eudev/
F: package/execline/
F: package/hicolor-icon-theme/
F: package/jemalloc/
F: package/mdevd/
F: package/meson/
F: package/ninja/
F: package/pkg-meson.mk
F: package/rust-bin/
F: package/rust/
F: package/s6/
F: package/s6-dns/
F: package/s6-linux-init/
F: package/s6-linux-utils/
F: package/s6-networking/
F: package/s6-portable-utils/
F: package/s6-rc/
F: package/skalibs/
F: package/smack/
F: package/xvisor/
N: Eric Limpens <[email protected]>
F: package/pifmrds/
F: package/ympd/
N: Erico Nunes <[email protected]>
F: board/aarch64-efi/
F: configs/aarch64_efi_defconfig
F: package/acpica/
F: package/acpitool/
F: package/efibootmgr/
F: package/efivar/
F: package/fwts/
F: package/spi-tools/
F: package/xdotool/
F: configs/pc_x86_64_*
N: Erik Larsson <[email protected]>
F: package/imx-mkimage/
N: Erik Stromdahl <[email protected]>
F: package/mxsldr/
N: Ernesto L. Williams Jr <[email protected]>
F: package/szip/
N: Esben Haabendal <[email protected]>
F: boot/gummiboot/
F: package/python-kiwisolver/
N: Etienne Carriere <[email protected]>
F: boot/optee-os/
F: package/optee-benchmark/
F: package/optee-client/
F: package/optee-examples/
F: package/optee-test/
N: Eugene Tarassov <[email protected]>
F: package/tcf-agent/
N: Evan Zelkowitz <[email protected]>
F: package/sdl_gfx/
N: Ezequiel Garcia <[email protected]>
F: board/ci20/
F: configs/ci20_defconfig
F: arch/Config.in.nios2
F: package/fio/
F: package/iptraf-ng/
F: package/jimtcl/
F: package/mimic/
F: package/nodm/
F: package/openbox/
F: package/rtl8723bs/
F: package/supertuxkart/
N: Fabio Estevam <[email protected]>
F: board/freescale/warpboard/
F: board/warp7/
F: configs/freescale_imx*
F: configs/imx23evk_defconfig
F: configs/imx6-sabre*
F: configs/imx6slevk_defconfig
F: configs/imx6sx-sdb_defconfig
F: configs/imx6ulevk_defconfig
F: configs/imx6ulpico_defconfig
F: configs/imx7d-sdb_defconfig
F: configs/imx7dpico_defconfig
F: configs/mx25pdk_defconfig
F: configs/mx51evk_defconfig
F: configs/mx53loco_defconfig
F: configs/mx6cubox_defconfig
F: configs/mx6sx_udoo_neo_defconfig
F: configs/mx6udoo_defconfig
F: configs/wandboard_defconfig
F: configs/warp7_defconfig
F: configs/warpboard_defconfig
F: package/atest/
F: package/kmscube/
N: Fabio Porcedda <[email protected]>
F: package/netsurf-buildsystem/
N: Fabio Urquiza <[email protected]>
F: package/bitcoin/
N: Fabrice Fontaine <[email protected]>
F: package/domoticz/
F: package/libmediaart/
F: package/libmaxminddb/
F: package/openzwave/
N: Fabrice Fontaine <[email protected]>
F: package/bearssl/
F: package/belle-sip/
F: package/belr/
F: package/boinc/
F: package/cairo/
F: package/duktape/
F: package/expat/
F: package/flatbuffers/
F: package/gerbera/
F: package/gtksourceview/
F: package/gssdp/
F: package/gupnp/
F: package/gupnp-dlna/
F: package/gupnp-tools/
F: package/haproxy/
F: package/hiredis/
F: package/i2pd/
F: package/igd2-for-linux/
F: package/json-c/
F: package/lcms2/
F: package/lftp/
F: package/libcap-ng/
F: package/libcdio-paranoia/
F: package/libcgicc/
F: package/libconfig/
F: package/libcue/
F: package/libebml/
F: package/libgee/
F: package/libglib2/
F: package/libgtk2/
F: package/libgtk3/
F: package/libhtp/
F: package/libidn/
F: package/libidn2/
F: package/libjpeg/
F: package/liblockfile/
F: package/libmatroska/
F: package/libmpdclient/
F: package/libnetfilter_conntrack/
F: package/libnetfilter_queue/
F: package/liboping/
F: package/libpfm4/
F: package/libraw/
F: package/libraw1394/
F: package/libroxml/
F: package/librsvg/
F: package/librsync/
F: package/libsoup/
F: package/libsoxr/
F: package/libupnp/
F: package/libupnp18/
F: package/libv4l/
F: package/libxslt/
F: package/mbedtls/
F: package/minissdpd/
F: package/minizip/
F: package/mongodb/
F: package/motion/
F: package/mutt/
F: package/ncmpc/
F: package/oniguruma/
F: package/oprofile/
F: package/pcmanfm/
F: package/python-backcall/
F: package/python-jedi/
F: package/python-parso/
F: package/rocksdb/
F: package/rygel/
F: package/safeclib/
F: package/suricata/
F: package/tinycbor/
F: package/tinydtls/
F: package/tinymembench/
F: package/whois/
N: Fabrice Goucem <[email protected]>
F: board/freescale/imx6ullevk/
F: configs/freescale_imx6ullevk_defconfig
N: Falco Hyfing <[email protected]>
F: package/python-pymodbus/
N: Floris Bos <[email protected]>
F: package/ipmitool/
F: package/odhcploc/
N: Francisco Gonzalez <[email protected]>
F: package/ser2net/
N: Francois Perrad <[email protected]>
F: board/olimex/a20_olinuxino
F: board/olimex/imx233_olinuxino/
F: configs/olimex_a20_olinuxino_*
F: configs/olimex_imx233_olinuxino_defconfig
F: package/4th/
F: package/cgilua/
F: package/chipmunk/
F: package/cog/
F: package/collectl/
F: package/copas/
F: package/coxpcall/
F: package/dado/
F: package/ficl/
F: package/libtomcrypt/
F: package/libtommath/
F: package/libwpe/
F: package/linenoise/
F: package/ljlinenoise/
F: package/lpeg/
F: package/lpty/
F: package/lrandom/
F: package/lsqlite3/
F: package/lua*
F: package/lzlib/
F: package/moarvm/
F: package/netsurf/
F: package/perl*
F: package/pkg-perl.mk
F: package/pkg-luarocks.mk
F: package/rings/
F: package/tekui/
F: package/wpebackend-fdo/
F: package/wpewebkit/
F: package/wsapi/
F: package/wsapi-fcgi/
F: package/wsapi-xavante/
F: package/xavante/
F: utils/scancpan
N: Frank Hunleth <[email protected]>
F: package/am335x-pru-package/
F: package/libconfuse/
F: package/libdmtx/
F: package/libsodium/
F: package/php-amqp/
F: package/python-cherrypy/
F: package/rabbitmq-server/
F: package/sane-backends/
F: package/ucl/
F: package/upx/
F: package/zxing-cpp/
N: Frank Vanbever <[email protected]>
F: package/elixir/
F: package/libmodsecurity/
F: package/nginx-modsecurity/
N: Gaël Portay <[email protected]>
F: package/qt5/qt5virtualkeyboard/
F: package/qt5/qt5webengine/
F: package/qt5/qt5webkit/
F: package/qt5/qt5webkit-examples/
N: Gao Xiang <[email protected]>
F: package/erofs-utils/
N: Gary Bisson <[email protected]>
F: board/boundarydevices/
F: configs/nitrogen*
F: package/freescale-imx/
F: package/gstreamer1/gst1-imx/
F: package/libimxvpuapi/
F: package/mfgtools/
F: package/sshpass/
F: package/x11r7/xdriver_xf86-video-imx-viv/
N: Geoff Levand <[email protected]>
F: package/flannel/
N: Geoffrey Ragot <[email protected]>
F: package/python-pycli/
F: package/python-pyyaml/
N: Gerome Burlats <[email protected]>
F: board/qemu/
F: configs/qemu_*
N: Gilles Talis <[email protected]>
F: board/freescale/imx8mmevk/
F: configs/freescale_imx8mmevk_defconfig
F: package/cctz/
F: package/fdk-aac/
F: package/httping/
F: package/iozone/
F: package/leptonica/
F: package/libeXosip2/
F: package/libolm/
F: package/libosip2/
F: package/ocrad/
F: package/restclient-cpp/
F: package/tesseract-ocr/
F: package/webp/
F: package/xapian/
N: Giulio Benetti <[email protected]>
F: package/at/
F: package/libnspr/
F: package/libnss/
F: package/minicom/
F: package/nfs-utils/
F: package/sunxi-mali-mainline/
F: package/sunxi-mali-mainline-driver/
N: Gregory Dymarek <[email protected]>
F: package/ding-libs/
F: package/gengetopt/
F: package/janus-gateway/
F: package/libnice/
F: package/libsrtp/
F: package/libwebsock/
F: package/sofia-sip/
N: Grzegorz Blach <[email protected]>
F: fs/f2fs/
F: package/bluez5_utils-headers/
F: package/f2fs-tools/
F: package/pigpio/
F: package/python-aioblescan/
F: package/python-bluezero/
F: package/python-crontab/
F: package/python-falcon/
F: package/python-ifaddr/
F: package/python-hiredis/
F: package/python-mimeparse/
F: package/python-pigpio/
F: package/python-pyjwt/
F: package/python-redis/
F: package/python-rpi-ws281x/
F: package/python-wtforms/
N: Guillaume Gardet <[email protected]>
F: package/c-icap/
F: package/c-icap-modules/
F: package/sdl2/
N: Guillaume William Brs <[email protected]>
F: package/liquid-dsp/
F: package/pixiewps/
F: package/reaver/
N: Guo Ren <[email protected]>
F: arch/Config.in.csky
F: board/csky/
F: board/qemu/csky
F: configs/csky_*
F: configs/qemu_csky*
N: Gustavo Pimentel <[email protected]>
F: configs/arm_juno_defconfig
F: board/arm/juno/
N: Gwenhael Goavec-Merou <[email protected]>
F: package/gnuradio/
F: package/gqrx/
F: package/gr-osmosdr/
F: package/libusbgx/
F: package/matio/
F: package/python-cheetah/
F: package/python-markdown/
F: package/python-remi/
F: package/python-sip/
N: Heiko Thiery <[email protected]>
F: package/libnetconf2/
F: package/libyang/
F: package/sysrepo/
N: Henrique Camargo <[email protected]>
F: package/json-glib/
N: Hiroshi Kawashima <[email protected]>
F: package/gauche/
F: package/gmrender-resurrect/
F: package/squeezelite/
N: Ian Haylock <[email protected]>
F: package/python-rpi-gpio/
N: Ignacy Gawędzki <[email protected]>
F: package/angularjs/
N: Ilias Apalodimas <[email protected]>
F: package/keepalived/
N: Ilya Averyanov <[email protected]>
F: package/exempi/
N: Ismael Luceno <[email protected]>
F: package/axel/
N: Jagan Teki <[email protected]>
F: board/amarula/
F: board/asus/
F: board/bananapi/
F: board/engicam/
F: board/friendlyarm/nanopi-a64/
F: board/friendlyarm/nanopi-neo2/
F: board/olimex/a33_olinuxino/
F: board/olimex/a64-olinuxino/
F: board/orangepi/orangepi-lite2/
F: board/orangepi/orangepi-one-plus
F: board/orangepi/orangepi-pc2/
F: board/orangepi/orangepi-prime/
F: board/orangepi/orangepi-win/
F: board/orangepi/orangepi-zero-plus2/
F: board/pine64/
F: configs/amarula_a64_relic_defconfig
F: configs/amarula_vyasa_rk3288_defconfig
F: configs/asus_tinker_rk3288_defconfig
F: configs/bananapi_m1_defconfig
F: configs/bananapi_m64_defconfig
F: configs/engicam_imx6qdl_icore_defconfig
F: configs/engicam_imx6qdl_icore_qt5_defconfig
F: configs/engicam_imx6qdl_icore_rqs_defconfig
F: configs/engicam_imx6ul_geam_defconfig
F: configs/engicam_imx6ul_isiot_defconfig
F: configs/friendlyarm_nanopi_a64_defconfig
F: configs/friendlyarm_nanopi_neo2_defconfig
F: configs/olimex_a33_olinuxino_defconfig
F: configs/olimex_a64_olinuxino_defconfig
F: configs/orangepi_lite2_defconfig
F: configs/orangepi_one_plus_defconfig
F: configs/orangepi_pc2_defconfig
F: configs/orangepi_prime_defconfig
F: configs/orangepi_win_defconfig
F: configs/orangepi_zero_plus2_defconfig
F: configs/pine64_defconfig
F: configs/pine64_sopine_defconfig
N: James Hilliard <[email protected]>
F: package/apcupsd/
F: package/exfatprogs/
F: package/gensio/
F: package/lua-std-debug/
F: package/lua-std-normalize/
F: package/pipewire/
F: package/python-aioconsole/
F: package/python-aiodns/
F: package/python-aiohttp/
F: package/python-aiohttp-cors/
F: package/python-aiohttp-debugtoolbar/
F: package/python-aiohttp-jinja2/
F: package/python-aiohttp-mako/
F: package/python-aiohttp-remotes/
F: package/python-aiohttp-security/
F: package/python-aiohttp-session/
F: package/python-aiohttp-sse/
F: package/python-aiologstash/
F: package/python-aiomonitor/
F: package/python-aiojobs/
F: package/python-aiorwlock/
F: package/python-aiosignal/
F: package/python-aiozipkin/
F: package/python-argon2-cffi/
F: package/python-async-lru/
F: package/python-async-timeout/
F: package/python-brotli/
F: package/python-cbor2/
F: package/python-cchardet/
F: package/python-flatbuffers/
F: package/python-frozenlist/
F: package/python-greenlet/
F: package/python-janus/
F: package/python-logstash/
F: package/python-multidict/
F: package/python-pycares/
F: package/python-snappy/
F: package/python-sockjs/
F: package/python-terminaltables/
F: package/python-yarl/
N: James Knight <[email protected]>
F: package/atkmm/
F: package/cairomm/
F: package/google-material-design-icons/
F: package/glibmm/
F: package/gtkmm3/
F: package/libpqxx/
F: package/pangomm/
F: package/rpm/
F: package/yad/
N: Jan Heylen <[email protected]>
F: package/opentracing-cpp/
N: Jan Kraval <[email protected]>
F: board/orangepi/orangepi-lite
F: configs/orangepi_lite_defconfig
N: Jan Kundrát <[email protected]>
F: configs/solidrun_clearfog_defconfig
F: board/solidrun/clearfog/
F: package/libnetconf2/
F: package/libyang/
F: package/sysrepo/
N: Jan Pedersen <[email protected]>
F: package/zip/
N: Jan Viktorin <[email protected]>
F: package/python-pexpect/
F: package/python-ptyprocess/
F: package/zynq-boot-bin/
N: Jarkko Sakkinen <[email protected]>
F: package/quota/
N: Jason Pruitt <[email protected]>
F: package/librtlsdr/
N: Jean Burgat <[email protected]>
F: package/openfpgaloader/
N: Jens Kleintje <[email protected]>
F: package/gcnano-binaries/
N: Jens Rosenboom <[email protected]>
F: package/sl/
N: Jens Zettelmeyer <[email protected]>
F: package/batctl/
N: Jeremy Rosen <[email protected]>
F: package/fxload/
N: Jérôme Oufella <[email protected]>
F: package/libdri2/
F: package/qt-webkit-kiosk/
N: Jérôme Pouiller <[email protected]>
F: package/apitrace/
F: package/freescale-imx/gpu-amd-bin-mx51/
F: package/freescale-imx/libz160/
F: package/lxc/
F: package/strongswan/
F: package/wmctrl/
F: package/x11r7/xdriver_xf86-video-imx/
F: package/x11r7/xdriver_xf86-video-imx-viv/
N: Jianhui Zhao <[email protected]>
F: package/libuhttpd/
F: package/libuwsc/
F: package/rtty/
N: Joao Pinto <[email protected]>
F: board/synopsys/vdk/
F: configs/snps_aarch64_vdk_defconfig
N: Joel Carlson <[email protected]>
F: package/c-capnproto/
F: package/capnproto/
F: package/cmocka/
F: package/flatcc/
F: package/libcorrect/
N: Joel Stanley <[email protected]>
F: package/pdbg/
F: board/qemu/ppc64le-pseries/
F: configs/qemu_ppc64le_pseries_defconfig
F: board/qemu/ppc-mac99/
F: configs/qemu_ppc_mac99_defconfig
N: Johan Derycke <[email protected]>
F: package/python-libconfig/
N: Johan Oudinet <[email protected]>
F: package/ejabberd/
F: package/erlang-base64url/
F: package/erlang-eimp/
F: package/erlang-goldrush/
F: package/erlang-idna/
F: package/erlang-jiffy/
F: package/erlang-jose/
F: package/erlang-lager/
F: package/erlang-p1-acme/
F: package/erlang-p1-cache-tab/
F: package/erlang-p1-mqtree/
F: package/erlang-p1-oauth2/
F: package/erlang-p1-pkix/
F: package/erlang-p1-sip/
F: package/erlang-p1-stringprep/
F: package/erlang-p1-stun/
F: package/erlang-p1-tls/
F: package/erlang-p1-utils/
F: package/erlang-p1-xml/
F: package/erlang-p1-xmpp/
F: package/erlang-p1-yaml/
F: package/erlang-p1-yconf/
F: package/erlang-p1-zlib/
F: package/nginx-dav-ext/
F: package/vuejs/
N: John Stile <[email protected]>
F: package/dhcpcd/
N: John Faith <[email protected]>
F: package/python-inflection/
F: package/sdbusplus/
N: Jonathan Ben Avraham <[email protected]>
F: arch/Config.in.xtensa
F: package/autofs/
F: package/dawgdic/
F: package/libphidget/
F: package/phidgetwebservice/
F: package/rapidxml/
F: package/sphinxbase/
N: Joris Offouga <[email protected]>
F: package/python-colorlog/
F: package/python-simplelogging/
N: Jörg Krause <[email protected]>
F: board/lemaker/bananapro/
F: configs/bananapro_defconfig
F: package/augeas/
F: package/bluez-alsa/
F: package/caps/
F: package/freescale-imx/imx-alsa-plugins/
F: package/libopusenc/
F: package/libupnpp/
F: package/luv/
F: package/luvi/
F: package/mpd/
F: package/shairport-sync/
F: package/swupdate/
F: package/upmpdcli/
F: package/wavemon/
N: Joris Lijssens <[email protected]>
F: package/emlog/
F: package/libcoap/
F: package/libnet/
F: package/libuio/
F: package/netsniff-ng/
F: package/rabbitmq-c/
N: Joseph Kogut <[email protected]>
F: package/at-spi2-atk/
F: package/at-spi2-core/
F: package/clang/
F: package/gconf/
F: package/libnss/
F: package/lld/
F: package/llvm/
F: package/python-cython/
F: package/python-raven/
F: package/python-schedule/
F: package/python-sentry-sdk/
F: package/python-websockets/
F: package/python-xlib/
N: Joshua Henderson <[email protected]>
F: package/qt5/qt5wayland/
N: Jugurtha BELKALEM <[email protected]>
F: package/python-cycler/
F: package/python-matplotlib/
N: Juha Rantanen <[email protected]>
F: package/acsccid/
N: Julian Scheel <[email protected]>
F: package/bitstream/
F: package/cbootimage/
F: package/cryptopp/
F: package/dvblast/
F: package/tegrarcm/
N: Julien Boibessot <[email protected]>
F: board/armadeus/
F: configs/armadeus*
F: package/abootimg/
F: package/gpm/
F: package/lbreakout2/
F: package/libcddb/
F: package/libmodbus/
F: package/ltris/
F: package/opentyrian/
F: package/python-pygame/
N: Julien Corjon <[email protected]>
F: package/qt5/
N: Julien Grossholtz <[email protected]>
F: board/technologic/ts7680/
F: configs/ts7680_defconfig
F: package/paho-mqtt-c
N: Julien Olivain <[email protected]>
F: board/qmtech/zynq/
F: board/technexion/imx8mmpico/
F: board/technexion/imx8mpico/
F: configs/imx8mmpico_defconfig
F: configs/imx8mpico_defconfig
F: configs/zynq_qmtech_defconfig
F: package/fluid-soundfont/
F: package/fluidsynth/
F: package/glslsandbox-player/
F: package/ptm2human/
F: package/python-pyalsa/
N: Julien Viard de Galbert <[email protected]>
F: package/dieharder/
F: package/easy-rsa/
N: Justin Maggard <[email protected]>
F: package/dtach/
N: Karoly Kasza <[email protected]>
F: package/irqbalance/
F: package/openvmtools/
N: Kelvin Cheung <[email protected]>
F: package/cpuload/
F: package/bwm-ng/
F: package/ramsmp/
N: Kieran Bingham <[email protected]>
F: package/libcamera/
N: Koen Martens <[email protected]>
F: package/capnproto/
F: package/linuxconsoletools/
N: Kurt Van Dijck <[email protected]>
F: package/bcusdk/
F: package/libpthsem/
F: package/nilfs-utils/
N: Laurent Cans <[email protected]>
F: package/aircrack-ng/
N: Laurent Charpentier <[email protected]>
F: package/open-lldp/
N: Lee Jones <[email protected]>
F: boot/afboot-stm32/
N: Leon Anavi <[email protected]>
F: board/olimex/a10_olinuxino
F: configs/olimex_a10_olinuxino_lime_defconfig
N: Lionel Flandrin <[email protected]>
F: package/python-babel/
F: package/python-daemonize/
F: package/python-flask/
F: package/python-flask-babel/
F: package/python-gunicorn/
N: Lionel Orry <[email protected]>
F: package/mongrel2/
N: Lothar Felten <[email protected]>
F: board/bananapi/bananapi-m2-ultra/
F: board/beaglebone/
F: configs/bananapi_m2_ultra_defconfig
F: configs/beaglebone_defconfig
F: configs/beaglebone_qt5_defconfig
F: package/ti-sgx-demos/
F: package/ti-sgx-libgbm/
F: package/ti-sgx-km/
F: package/ti-sgx-um/
N: Louis Aussedat <[email protected]>
F: board/friendlyarm/nanopi-neo-plus2/
F: configs/friendlyarm_nanopi_neo_plus2_defconfig
F: package/mfoc
F: package/libpam-nfc
F: package/python-dnspython/
F: package/python-future/
F: package/python-huepy/
F: package/python-tqdm/
N: Louis-Paul Cordier <[email protected]>
F: package/intel-gmmlib/
F: package/intel-mediadriver/
F: package/intel-mediasdk/
N: Luca Ceresoli <[email protected]>
F: board/olimex/a20_olinuxino/
F: board/zynq/
F: board/zynqmp/
F: configs/olimex_a20_olinuxino_*
F: configs/zynq_microzed_defconfig
F: configs/zynq_zed_defconfig
F: configs/zynq_zc706_defconfig
F: configs/zynqmp_zcu106_defconfig
F: package/agentpp/
F: package/exim/
F: package/libpjsip/
F: package/qpid-proton/
F: package/rtl8188eu/
F: package/snmppp/
F: package/stm32flash/
F: package/unzip/
F: support/legal-info/
N: Lucas De Marchi <[email protected]>
F: package/fswebcam/
N: Lubomir Rintel <[email protected]>
F: board/olpc/
F: configs/olpc_xo1_defconfig
F: configs/olpc_xo175_defconfig
N: Ludovic Desroches <[email protected]>
F: board/atmel/
F: configs/at91*
F: configs/atmel_*
F: package/fb-test-app/
F: package/python-json-schema-validator/
F: package/python-keyring/
F: package/python-simplejson/
F: package/python-versiontools/
F: package/wilc1000-firmware/
N: Maeva Manuel <[email protected]>
F: board/freescale/imx8qmmek/
F: configs/freescale_imx8qmmek_defconfig
F: package/freescale-imx/imx-seco/
N: Mahyar Koshkouei <[email protected]>
F: package/ffmpeg/
F: package/mpv/
F: package/rpi-firmware/
F: package/rpi-userland/
N: Mamatha Inamdar <[email protected]>
F: package/nvme/
N: Manuel Vögele <[email protected]>
F: package/python-pyqt5/
F: package/python-requests-toolbelt/
N: Marcin Bis <[email protected]>
F: package/bluez5_utils/
F: package/cc-tool/
F: package/ecryptfs-utils/
N: Marcin Niestroj <[email protected]>
F: board/grinn/
F: configs/grinn_*
F: package/argparse/
F: package/dt-utils/
F: package/easydbus/
F: package/lua-flu/
F: package/lua-stdlib/
F: package/luaossl/
F: package/murata-cyw-fw/
F: package/netdata/
F: package/rs485conf/
F: package/turbolua/
F: support/testing/tests/package/test_netdata.py
N: Marcus Folkesson <[email protected]>
F: package/libostree/
F: package/libselinux/
F: package/libsemanage/
F: package/libsepol/
F: package/selinux-python/
F: utils/config
F: utils/diffconfig
N: Marek Belisko <[email protected]>
F: board/friendlyarm/nanopi-neo4/
F: configs/nanopi_neo4_defconfig
F: package/libatasmart/
F: package/polkit/
F: package/sg3_utils/
F: package/udisks/
N: Mario Lang <[email protected]>
F: package/brltty/
F: package/lynx/
N: Mario Rugiero <[email protected]>
F: package/ratpoison/
N: Mark Corbin <[email protected]>
F: arch/arch.mk.riscv
F: arch/Config.in.riscv
F: board/qemu/riscv32-virt/
F: board/qemu/riscv64-virt/
F: configs/qemu_riscv32_virt_defconfig
F: configs/qemu_riscv64_virt_defconfig
N: Martin Bark <[email protected]>
F: board/raspberrypi/
F: configs/raspberrypi3_defconfig
F: package/ca-certificates/
F: package/connman/
F: package/nodejs/
F: package/rpi-bt-firmware/
F: package/rpi-firmware/
F: package/rpi-wifi-firmware/
F: package/tzdata/
F: package/zic/
N: Martin Hicks <[email protected]>
F: package/cryptsetup/
N: Martin Kepplinger <[email protected]>
F: package/tslib/
F: package/x11r7/xdriver_xf86-input-tslib/
F: package/x11vnc/
N: Masahiro Yamada <[email protected]>
F: board/arm/foundation-v8/
F: configs/arm_foundationv8_defconfig
N: Mathieu Audat <[email protected]>
F: board/technologic/ts4900/
F: configs/ts4900_defconfig
F: package/ts4900-fpga/
N: Matt Weber <[email protected]>
F: board/freescale/p*
F: board/freescale/t*
F: board/qemu/ppc64-e5500/
F: configs/freescale_p*
F: configs/freescale_t*
F: configs/qemu_ppc64_e5500_defconfig
F: package/argp-standalone/
F: package/aufs/
F: package/aufs-util/
F: package/bc/
F: package/bridge-utils/
F: package/checkpolicy/
F: package/checksec/
F: package/cgroupfs-mount/
F: package/crda/
F: package/cunit/
F: package/dacapo/
F: package/davici/
F: package/dnsmasq/
F: package/dosfstools/
F: package/eigen/
F: package/ethtool/
F: package/flashbench/
F: package/fmc/
F: package/fmlib/
F: package/git/
F: package/gnutls/
F: package/hostapd/
F: package/i2c-tools/
F: package/ifplugd/
F: package/igmpproxy/
F: package/iperf/
F: package/iperf3/
F: package/iputils/
F: package/iw/
F: package/jitterentropy-library/
F: package/kvm-unit-tests/
F: package/kvmtool/
F: package/libcsv/
F: package/libcurl/
F: package/libeastl/
F: package/libfcgi/
F: package/libopenssl/
F: package/libselinux/
F: package/libsemanage/
F: package/libsepol/
F: package/libssh2/
F: package/libqmi/
F: package/lighttpd/
F: package/logrotate/
F: package/makedevs/
F: package/memtester/
F: package/mii-diag/
F: package/mrouted/
F: package/mtd/
F: package/mtools/
F: package/nginx-upload/
F: package/omniorb/
F: package/openresolv/
F: package/paxtest/
F: package/picocom/
F: package/policycoreutils/
F: package/proftpd/
F: package/protobuf-c/
F: package/protobuf/
F: package/python-bunch/
F: package/python-colorama/
F: package/python-filelock/
F: package/python-flask-cors/
F: package/python-iptables/
F: package/python-ipy/
F: package/python-posix-ipc/
F: package/python-pycairo/
F: package/python-pypcap/
F: package/python-pyrex/
F: package/python-pysftp/
F: package/python-tinyrpc/
F: package/python-txdbus/
F: package/raptor/
F: package/rcw/
F: package/rng-tools/
F: package/rsyslog/
F: package/setools/
F: package/smcroute/
F: package/tclap/
F: package/tini/
F: package/uboot-tools/
F: package/unionfs/
F: package/valijson/
F: package/wpa_supplicant/
F: package/wireless_tools/
F: package/xen/
F: support/testing/tests/package/br2-external/openjdk/
F: support/testing/tests/package/test_openjdk.py
F: support/testing/tests/package/test_opkg/
F: support/testing/tests/package/test_opkg.py
N: Mauro Condarelli <[email protected]>
F: package/mc/
F: package/python-autobahn/
F: package/python-cbor/
F: package/python-characteristic/
F: package/python-click/
F: package/python-crossbar/
F: package/python-lmdb/
F: package/python-mistune/
F: package/python-netaddr/
F: package/python-pygments/
F: package/python-pynacl/
F: package/python-pytrie/
F: package/python-service-identity/
F: package/python-setproctitle/
F: package/python-shutilwhich/
F: package/python-treq/
F: package/python-txaio/
F: package/python-ujson/
F: package/python-wsaccel/
N: Max Filippov <[email protected]>
F: arch/Config.in.xtensa
N: Maxime Hadjinlian <[email protected]>
F: package/babeld/
F: package/dante/
F: package/faifa/
F: package/initscripts/
F: package/intel-microcode/
F: package/iucode-tool/
F: package/jasper/
F: package/kodi/
F: package/libass/
F: package/libbluray/
F: package/libcdio/
F: package/libcofi/
F: package/libenca/
F: package/libmodplug/
F: package/libnfs/
F: package/libplist/
F: package/libshairplay/
F: package/linux-zigbee/
F: package/netcat-openbsd/
F: package/open-plc-utils/
F: package/rpi-firmware/
F: package/rpi-userland/
F: package/rtmpdump/
F: package/skeleton/
F: package/systemd/
F: package/systemd-bootchart/
F: package/tinyalsa/
F: package/tinyxml/
N: Maxime Ripard <[email protected]>
F: package/kmsxx/
N: Michael Durrant <[email protected]>
F: board/arcturus/
F: configs/arcturus_ucp1020_defconfig
F: configs/arcturus_ucls1012a_defconfig
N: Michael Fischer <[email protected]>
F: package/gnuplot/
F: package/sdl2/
N: Michael Rommel <[email protected]>
F: package/knock/
F: package/python-crc16/
F: package/python-pyzmq/
N: Michael Trimarchi <[email protected]>
F: package/python-spidev/
N: Michael Vetter <[email protected]>
F: package/jasper/
F: package/libstrophe/
N: Michael Walle <[email protected]>
F: package/libavl/
N: Michał Łyszczek <[email protected]>
F: board/altera/socrates_cyclone5/
F: board/pine64/rock64
F: configs/rock64_defconfig
F: configs/socrates_cyclone5_defconfig
F: package/netifrc/
F: package/openrc/
F: package/skeleton-init-openrc/
N: Michel Stempin <[email protected]>
F: board/licheepi/
F: configs/licheepi_zero_defconfig
N: Mike Harmony <[email protected]>
F: board/sinovoip/m2-plus/
F: configs/bananapi_m2_plus_defconfig
N: Mikhail Boiko <[email protected]>
F: package/libfribidi/
N: Min Xu <[email protected]>
F: package/shadowsocks-libev/
N: Mircea Gliga <[email protected]>
F: package/mbuffer/
N: Mirza Krak <[email protected]>
F: package/mender/
F: package/mender-artifact/
N: Murat Demirten <[email protected]>
F: package/jpeg-turbo/
F: package/libgeotiff/
N: Mylène Josserand <[email protected]>
F: package/rtl8723bu/
N: Nathaniel Roach <[email protected]>
F: package/bandwidthd/
F: package/libgudev/
N: Naumann Andreas <[email protected]>
F: package/evemu/
F: package/libevdev/
F: package/pkg-qmake.mk
N: Nicola Di Lieto <[email protected]>
F: package/uacme/
N: Nicholas Sielicki <[email protected]>
F: board/intel/galileo/
F: configs/galileo_defconfig
N: Nicolas Cavallari <[email protected]>
F: package/libgit2/
N: Nicolas Serafini <[email protected]>
F: package/exiv2/
F: package/nvidia-tegra23/nvidia-tegra23-binaries/
F: package/nvidia-tegra23/nvidia-tegra23-codecs/
F: package/ofono/
N: Nikolay Dimitrov <[email protected]>
F: board/embest/riotboard/
F: configs/riotboard_defconfig
N: Nimai Mahajan <[email protected]>
F: package/libucl/
N: Noé Rubinstein <[email protected]>
F: package/tpm-tools/
F: package/trousers/
N: Norbert Lange <[email protected]>
F: package/tcf-agent/
N: Nylon Chen <[email protected]>
F: arch/Config.in.nds32
F: board/andes
F: configs/andes_ae3xx_defconfig
F: toolchain/toolchain-external/toolchain-external-andes-nds32/
N: Olaf Rempel <[email protected]>
F: package/ctorrent/
N: Oleksandr Zhadan <[email protected]>
F: board/arcturus/
F: configs/arcturus_ucp1020_defconfig
F: configs/arcturus_ucls1012a_defconfig
N: Oli Vogt <[email protected]>
F: package/python-django/
F: package/python-flup/
N: Olivier Matz <[email protected]>
F: package/python-pyelftools/
N: Olivier Schonken <[email protected]>
F: package/cups/
F: package/cups-filters/
F: package/ijs/
F: package/poppler/
F: package/qpdf/
F: package/openjpeg/
N: Olivier Singla <[email protected]>
F: package/shellinabox/
N: Parnell Springmeyer <[email protected]>
F: package/scrypt/
N: Pascal de Bruijn <[email protected]>
F: package/libargon2/
F: package/linux-tools/S10hyperv
F: package/linux-tools/hyperv*.service
F: package/linux-tools/linux-tool-hv.mk.in
N: Pascal Huerst <[email protected]>
F: package/google-breakpad/
N: Patrick Gerber <[email protected]>
F: package/yavta/
N: Patrick Havelange <[email protected]>
F: support/testing/tests/package/test_lxc.py
F: support/testing/tests/package/test_lxc/
N: Paul Cercueil <[email protected]>
F: package/libiio/
F: package/lightning/
F: package/umtprd/
N: Pedro Aguilar <[email protected]>
F: package/libunistring/
N: Peter Korsgaard <[email protected]>
F: board/beagleboneai/
F: board/minnowboard/
F: board/librecomputer/lafrite/
F: board/nexbox/a95x/
F: board/openblocks/a6/
F: board/orangepi/
F: board/pandaboard/
F: board/roseapplepi/
F: boot/shim/
F: configs/beagleboneai_defconfig
F: configs/lafrite_defconfig
F: configs/minnowboard_max-graphical_defconfig
F: configs/minnowboard_max_defconfig
F: configs/nexbox_a95x_defconfig
F: configs/openblocks_a6_defconfig
F: configs/orangepi_pc_defconfig
F: configs/orangepi_r1_defconfig
F: configs/pandaboard_defconfig
F: configs/roseapplepi_defconfig
F: configs/sheevaplug_defconfig
F: package/bats-core/
F: package/docker-compose/
F: package/dump1090/
F: package/fatcat/
F: package/flickcurl/
F: package/fscryptctl/
F: package/ifmetric/
F: package/jo/
F: package/jose/
F: package/libfastjson/
F: package/luksmeta/
F: package/lzop/
F: package/memtool/
F: package/mosquitto/
F: package/python-alsaaudio/
F: package/python-backports-ssl-match-hostname/
F: package/python-cached-property/
F: package/python-docker/
F: package/python-dockerpty/
F: package/python-docker-pycreds/
F: package/python-enum/
F: package/python-enum34/
F: package/python-functools32/
F: package/python-ipaddr/
F: package/python-pam/
F: package/python-psutil/
F: package/python-request-id/
F: package/python-semver/
F: package/python-texttable/
F: package/python-validators/
F: package/python-webob/
F: package/python-websocket-client/
F: package/sedutil/
F: package/tpm2-totp/
F: package/triggerhappy/
F: package/wireguard-linux-compat/
F: package/wireguard-tools/
F: support/testing/tests/package/test_docker_compose.py
N: Peter Seiderer <[email protected]>
F: board/raspberrypi/
F: configs/raspberrypi*_defconfig
F: package/assimp/
F: package/bcm2835/
F: package/ddrescue/
F: package/dejavu/
F: package/dillo/
F: package/edid-decode/
F: package/ell/
F: package/ghostscript-fonts/
F: package/gstreamer1/gst1-interpipe/
F: package/gstreamer1/gst1-validate/
F: package/gstreamer1/gstreamer1-editing-services/
F: package/iwd/
F: package/libevdev/
F: package/log4cplus/
F: package/postgresql/
F: package/qt5/
F: package/quotatool/
F: package/racehound/
N: Peter Thompson <[email protected]>
F: package/sdl2_gfx/
F: package/sdl2_image/
F: package/sdl2_ttf/
N: Petr Kulhavy <[email protected]>
F: package/linuxptp/
N: Petr Vorel <[email protected]>
F: package/ima-evm-utils/
F: package/iproute2/
F: package/iputils/
F: package/libtirpc/
F: package/linux-backports/
F: package/ltp-testsuite/
F: package/nfs-utils/
F: support/kconfig/
N: Phil Eichinger <[email protected]>
F: package/libqrencode/
F: package/psplash/
F: package/sispmctl/
F: package/zsh/
N: Philipp Richter <[email protected]>
F: package/libtorrent-rasterbar/
N: Philippe Proulx <[email protected]>
F: package/lttng-babeltrace/
F: package/lttng-libust/
F: package/lttng-modules/
F: package/lttng-tools/
F: package/python-ipython/
F: package/liburcu/
N: Philippe Reynes <[email protected]>
F: package/ibm-sw-tpm2/
N: Pierre Crokaert <[email protected]>
F: board/hardkernel/odroidxu4/
F: configs/odroidxu4_defconfig
N: Pierre Ducroquet <[email protected]>
F: package/kf5/
N: Pierre Floury <[email protected]>
F: package/trace-cmd/
N: Pierre-Jean Texier <[email protected]>
F: package/fping/
F: package/genimage/
F: package/haveged/
F: package/ipset/
F: package/libarchive/
F: package/libevent/
F: package/libubootenv/
F: package/libxml2/
F: package/mongoose/
F: package/mxml/
F: package/numactl/
F: package/python-modbus-tk/
F: package/python-periphery/
F: package/raspi-gpio/
F: package/sbc/
F: package/stunnel/
F: package/tree/
N: Pieter De Gendt <[email protected]>
F: package/libvips/
N: Pieterjan Camerlynck <[email protected]>
F: package/libdvbpsi/
F: package/mraa/
F: package/synergy/
N: Rafal Susz <[email protected]>
F: board/avnet/s6lx9_microboard/
F: configs/s6lx9_microboard_defconfig
N: Rahul Bedarkar <[email protected]>
F: package/cxxtest/
F: package/gflags/
F: package/glog/
F: package/gssdp/
F: package/gupnp/
F: package/gupnp-av/
F: package/let-me-create/
F: package/nanomsg/
N: Rahul Jain <[email protected]>
F: package/uhttpd/
F: package/ustream-ssl/
N: Refik Tuzakli <[email protected]>
F: package/freescale-imx/
F: package/paho-mqtt-cpp/
N: Raphaël Mélotte <[email protected]>
F: package/jbig2dec/
N: Rémi Rérolle <[email protected]>
F: package/libfreeimage/
N: Renaud Aubin <[email protected]>
F: package/libhttpparser/
N: Ricardo Martincoski <[email protected]>
F: package/atop/
F: package/thermald/
N: Ricardo Martincoski <[email protected]>
F: support/testing/infra/
F: support/testing/run-tests
F: support/testing/tests/core/test_file_capabilities.py
F: support/testing/tests/download/
F: support/testing/tests/package/*_python*.py
F: support/testing/tests/package/test_atop.py
F: support/testing/tests/package/test_syslog_ng.py
F: support/testing/tests/package/test_tmux.py
F: support/testing/tests/utils/test_check_package.py
F: utils/check-package
F: utils/checkpackagelib/
N: Richard Braun <[email protected]>
F: package/curlftpfs/
F: package/tzdata/
N: RJ Ascani <[email protected]>
F: package/azmq/
N: Robert Rose <[email protected]>
F: package/grpc/
N: Rodrigo Rebello <[email protected]>
F: package/chocolate-doom/
F: package/irssi/
F: package/vnstat/
N: Romain Naour <[email protected]>
F: board/qemu/
F: configs/qemu_*
F: package/alure/
F: package/aubio/
F: package/binutils/
F: package/bullet/
F: package/clang/
F: package/clinfo/
F: package/efl/
F: package/enet/
F: package/enlightenment/
F: package/flare-engine/
F: package/flare-game/
F: package/gcc/
F: package/glibc/
F: package/irrlicht/
F: package/liblinear/
F: package/lensfun/
F: package/libclc/
F: package/libgta/
F: package/libspatialindex/
F: package/linux-syscall-support/
F: package/llvm/
F: package/lugaru/
F: package/mcelog/
F: package/mesa3d/
F: package/minetest/
F: package/minetest-game/
F: package/ogre/
F: package/openpowerlink/
F: package/physfs/
F: package/piglit/
F: package/solarus/
F: package/stress-ng/
F: package/supertux/
F: package/supertuxkart/
F: package/terminology/
F: package/tk/
F: package/upower/
F: package/waffle/
F: package/xenomai/
F: package/zziplib/
F: support/testing/tests/package/test_glxinfo.py
F: toolchain/
N: Roman Gorbenkov <[email protected]>
F: package/davfs2/
N: Ryan Barnett <[email protected]>
F: package/atftp/
F: package/miraclecast/
F: package/python-pysnmp/
F: package/python-pysnmp-mibs/
F: package/python-tornado/
F: package/websocketpp/
N: Ryan Coe <[email protected]>
F: package/inadyn/
F: package/libite/
F: package/mariadb/
N: Ryan Wilkins <[email protected]>
F: package/biosdevname/
N: Sam Lancia <[email protected]>
F: package/lrzip/
N: Samuel Martin <[email protected]>
F: package/armadillo/
F: package/canfestival/
F: package/clapack/
F: package/cwiid/
F: package/flite/
F: package/nginx/
F: package/opencv/
F: package/opencv3/
F: package/openobex/
F: package/pkg-cmake.mk
F: package/python-numpy/
F: package/scrub/
F: package/urg/
F: package/ussp-push/
F: support/misc/toolchainfile.cmake.in
N: Sam Voss <[email protected]>
F: package/ripgrep/
N: Santosh Multhalli <[email protected]>
F: package/valijson/
N: Scott Fan <[email protected]>
F: package/libssh/
F: package/x11r7/xdriver_xf86-video-fbturbo/
N: Sébastien Szymanski <[email protected]>
F: package/mmc-utils/
F: package/python-flask-jsonrpc/
F: package/python-flask-login/
F: package/qt5/qt5charts/
N: Semyon Kolganov <[email protected]>
F: package/fmt/
F: package/libbson/
F: package/lua-resty-http/
F: package/mpir/
N: Sergey Matyukevich <[email protected]>
F: boot/arm-trusted-firmware/
F: boot/binaries-marvell/
F: boot/mv-ddr-marvell/
F: board/linksprite/pcduino
F: board/orangepi/orangepi-zero
F: board/orangepi/orangepi-one
F: board/orangepi/orangepi-pc-plus/
F: board/solidrun/macchiatobin
F: configs/linksprite_pcduino_defconfig
F: configs/orangepi_one_defconfig
F: configs/orangepi_pc_plus_defconfig
F: configs/orangepi_zero_defconfig
F: configs/solidrun_macchiatobin_defconfig
F: package/armbian-firmware/
F: package/hostapd/
F: package/rtl8189fs/
F: package/wpa_supplicant/
F: package/xr819-xradio/
N: Sergio Prado <[email protected]>
F: board/toradex/apalis-imx6/
F: configs/toradex_apalis_imx6_defconfig
F: package/aoetools/
F: package/curlpp/
F: package/daq/
F: package/libgdiplus/
F: package/pimd/
F: package/snort/
F: package/stella/
F: package/tio/
F: package/traceroute/
F: package/tunctl/
F: package/ubus/
F: package/wolfssl/
N: Simon Dawson <[email protected]>
F: boot/at91bootstrap3/
F: package/cppzmq/
F: package/czmq/
F: package/filemq/
F: package/googlefontdirectory/
F: package/jansson/
F: package/jquery-ui/
F: package/jquery-ui-themes/
F: package/json-javascript/
F: package/lcdapi/
F: package/libfreefare/
F: package/libjson/
F: package/libnfc/
F: package/libnfc/
F: package/libserial/
F: package/libsigsegv/
F: package/macchanger/
F: package/minicom/
F: package/minidlna/
F: package/msgpack/
F: package/nanocom/
F: package/neard/
F: package/neardal/
F: package/owl-linux/
F: package/python-nfc/
F: package/rapidjson/
F: package/sconeserver/
F: package/sound-theme-borealis/
F: package/sound-theme-freedesktop/
F: package/vlc/
F: package/xscreensaver/
F: package/zmqpp/
F: package/zyre/
N: Spenser Gilliland <[email protected]>
F: arch/Config.in.microblaze
F: package/a10disp/
F: package/glmark2/
F: package/libvpx/
F: package/mesa3d-demos/
F: package/ti-gfx/
N: Stefan Ott <[email protected]>
F: package/unbound/
N: Stefan Sørensen <[email protected]>
F: package/cracklib/
F: package/libpwquality/
F: package/libscrypt/
N: Stephan Hoffmann <[email protected]>
F: package/cache-calibrator/
F: package/gtest/
F: package/libhttpserver/
F: package/mtdev/
N: Steve Calfee <[email protected]>
F: package/python-pymysql/
F: package/python-pyratemp/
N: Steve James <[email protected]>
F: package/leveldb/
F: package/libcli/
N: Steve Kenton <[email protected]>
F: package/dvdauthor/
F: package/dvdrw-tools/
F: package/memtest86/
F: package/mjpegtools/
F: package/tovid/
F: package/udftools/
F: package/xorriso/
N: Steven Noonan <[email protected]>
F: package/hwloc/
F: package/powertop/
N: Suniel Mahesh <[email protected]>
F: board/firefly/
F: configs/roc_pc_rk3399_defconfig
F: package/arm-gnu-a-toolchain/
N: Sven Haardiek <[email protected]>
F: package/lcdproc/
F: package/python-influxdb/
N: Sven Oliver Moll <[email protected]>
F: package/most/
N: Theo Debrouwere <[email protected]>
F: board/beagleboardx15/
F: configs/beagleboardx15_defconfig
F: package/pugixml/
N: Thierry Bultel <[email protected]>
F: package/mpd-mpc/
N: Thijs Vermeir <[email protected]>
F: package/ranger/
F: package/x265/
N: Thomas Claveirole <[email protected]>
F: package/fcgiwrap/
F: package/openlayers/
N: Thomas Davis <[email protected]>
F: package/civetweb/
N: Thomas De Schampheleire <[email protected]>
F: docs/manual/
F: package/cereal/
F: package/chartjs/
F: package/libtelnet/
F: package/opkg-utils/
F: package/perl-convert-asn1/
F: package/perl-crypt-blowfish/
F: package/perl-crypt-cbc/
F: package/perl-crypt-openssl-aes/
F: package/perl-i18n/
F: package/perl-locale-maketext-lexicon/
F: package/perl-lwp-protocol-https/
F: package/perl-math-prime-util/
F: package/perl-mime-base64-urlsafe/
F: package/perl-mojolicious-plugin-authentication/
F: package/perl-mojolicious-plugin-authorization/
F: package/perl-mojolicious-plugin-cspheader/
F: package/perl-mojolicious-plugin-i18n/
F: package/perl-mojolicious-plugin-securityheader/
F: package/perl-mozilla-ca/
F: package/perl-net-snmp/
F: package/perl-net-ssh2/
F: package/perl-net-telnet/
F: package/perl-path-class/
F: package/pigz/
F: package/xenomai/
F: support/scripts/size-stats
F: support/testing/tests/package/test_perl_lwp_protocol_https.py
F: utils/size-stats-compare
F: toolchain/
N: Thomas Huth <[email protected]>
F: package/ascii-invaders/
N: Thomas Petazzoni <[email protected]>
F: arch/Config.in.arm
F: board/stmicroelectronics/stm32mp157c-dk2/
F: boot/boot-wrapper-aarch64/
F: boot/grub2/
F: boot/gummiboot/
F: configs/stm32mp157c_dk2_defconfig
F: package/android-tools/
F: package/b43-firmware/
F: package/b43-fwcutter/
F: package/c-periphery/
F: package/cdrkit/
F: package/cifs-utils/
F: package/cloop/
F: package/cmake/
F: package/cramfs/
F: package/dmidecode/
F: package/flashrom/
F: package/gcc/
F: package/genext2fs/
F: package/genromfs/
F: package/getent/
F: package/gnu-efi/
F: package/heirloom-mailx/
F: package/hiawatha/
F: package/igh-ethercat/
F: package/intltool/
F: package/libcap/
F: package/libffi/
F: package/libsha1/
F: package/libtirpc/
F: package/libxkbcommon/
F: package/libxml-parser-perl/
F: package/localedef/
F: package/log4cxx/
F: package/monit/
F: package/mpdecimal/
F: package/msmtp/
F: package/musl/
F: package/musl-fts/
F: package/ne10/
F: package/pkg-python.mk
F: package/pkg-autotools.mk
F: package/pkg-generic.mk
F: package/python/
F: package/python3/
F: package/python-mad/
F: package/python-serial/
F: package/qextserialport/
F: package/rpcbind/
F: package/rt-tests/
F: package/rtc-tools/
F: package/sam-ba/
F: package/scons/
F: package/squashfs/
F: package/wayland/
F: package/weston/
F: support/testing/tests/boot/test_syslinux.py
F: toolchain/
N: Timo Ketola <[email protected]>
F: package/fbgrab/
N: Titouan Christophe <[email protected]>
F: package/avro-c/
F: package/mosquitto/
F: package/python-avro/
F: package/redis/
F: package/waf/
F: support/testing/tests/package/test_crudini.py
N: Trent Piepho <[email protected]>
F: package/libp11/
N: Tudor Holton <[email protected]>
F: package/openjdk/
N: Tzu-Jung Lee <[email protected]>
F: package/dropwatch/
F: package/tstools/
N: Vadim Kochan <[email protected]>
F: package/brcm-patchram-plus/
F: package/gettext-tiny/
F: package/tinyssh/
N: Valentin Korenblit <[email protected]>
F: package/clang/
F: package/clinfo/
F: package/libclc/
F: package/llvm/
N: Vanya Sergeev <[email protected]>
F: package/lua-periphery/
N: Victor Huesca <[email protected]>
F: support/testing/tests/core/test_root_password.py
N: Vincent Prince <[email protected]>
F: package/nss-myhostname/
F: package/utp_com/
N: Vincent Stehlé <[email protected]>
F: package/i7z/
F: package/msr-tools/
F: package/pixz/
N: Vinicius Tinti <[email protected]>
F: package/python-thrift/
N: Vivien Didelot <[email protected]>
F: board/technologic/ts5500/
F: configs/ts5500_defconfig
N: Volkov Viacheslav <[email protected]>
F: package/v4l2grab/
F: package/zbar/
N: Wade Berrier <[email protected]>
F: package/ngrep/
N: Waldemar Brodkorb <[email protected]>
F: package/uclibc/
F: package/uclibc-ng-test/
N: Will Newton <[email protected]>
F: package/enchant/
F: package/erlang/
F: package/libmicrohttpd/
F: package/sysprof/
F: package/time/
N: Will Wagner <[email protected]>
F: package/yaffs2utils/
N: Wojciech M. Zabolotny <[email protected]>
F: package/avrdude/
F: package/jack2/
F: package/python-msgpack/
F: package/python-pyusb/
N: Wojciech Niziński <[email protected]>
F: package/fwup/
N: Yann E. MORIN <[email protected]>
F: board/friendlyarm/nanopi-neo/
F: configs/nanopi_neo_defconfig
F: fs/squashfs/
F: package/asterisk/
F: package/cegui/
F: package/dahdi-linux/
F: package/dahdi-tools/
F: package/dtc/
F: package/dtv-scan-tables/
F: package/dvb-apps/
F: package/freerdp/
F: package/keyutils/
F: package/libbsd/
F: package/libedit/
F: package/libgsm/
F: package/libiberty/
F: package/libinput/
F: package/libiscsi/
F: package/libpri/
F: package/libseccomp/
F: package/libss7/
F: package/linux-firmware/
F: package/linux-tools/
F: package/matchbox*
F: package/mesa3d-headers/
F: package/nbd/
F: package/nut/
F: package/nvidia-driver/
F: package/omxplayer/
F: package/python-pyparsing/
F: package/pkg-download.mk
F: package/pkg-waf.mk
F: package/slirp/
F: package/snappy/
F: package/spice/
F: package/spice-protocol/
F: package/systemd/
F: package/systemd-bootchart/
F: package/tmux/
F: package/tvheadend/
F: package/usbredir/
F: package/vde2/
F: package/w_scan/
F: package/wayland/
F: package/weston/
F: package/zisofs-tools/
F: support/download/
N: Yegor Yefremov <[email protected]>
F: configs/beaglebone_defconfig
F: configs/beaglebone_qt5_defconfig
F: package/acl/
F: package/attr/
F: package/boost/
F: package/bootstrap/
F: package/cannelloni/
F: package/can-utils/
F: package/circus/
F: package/dhcpcd/
F: package/feh/
F: package/giblib/
F: package/imlib2/
F: package/jquery-datetimepicker/
F: package/jquery-sidebar/
F: package/kmod/
F: package/libftdi1/
F: package/libical/
F: package/libmbim/
F: package/libndp/
F: package/libnftnl/
F: package/libsoc/
F: package/libsocketcan/
F: package/libubox/
F: package/libuci/
F: package/linux-firmware/
F: package/linux-serial-test/
F: package/modem-manager/
F: package/nftables/
F: package/nuttcp/
F: package/parted/
F: package/phytool/
F: package/poco/
F: package/python*
F: package/ser2net/
F: package/socketcand/
F: package/swig/
F: package/qt5/qt5serialbus/
F: package/sdparm/
F: package/ti-utils/
F: package/x11r7/xapp_xconsole/
F: package/x11r7/xapp_xinput-calibrator/
F: package/zlog/
F: support/testing/tests/package/test_libftdi1.py
F: support/testing/tests/package/test_python_can.py
F: utils/scanpypi
N: Zoltan Gyarmati <[email protected]>
F: package/crudini/
F: package/grantlee/
F: package/libusb/
F: package/libusb-compat/
F: package/proj/
F: package/python-configobj/
F: package/python-iniparse/
F: package/qjson/
F: package/quazip/
F: package/shapelib/
F: package/tinc/
| {
"pile_set_name": "Github"
} |
{
"type": "bundle",
"id": "bundle--3e5e574d-623b-4b19-8e27-e6dff3b4d78f",
"spec_version": "2.0",
"objects": [
{
"type": "attack-pattern",
"id": "attack-pattern--800f8095-99b6-4bb9-8bc6-8b9727201a2f",
"created_by_ref": "identity--e50ab59c-5c4f-4d40-bf6a-d58418d89bcd",
"created": "2017-04-15T00:00:00.000Z",
"modified": "2020-07-30T00:00:00.000Z",
"name": "Stored XSS",
"description": "This type of attack is a form of Cross-site Scripting (XSS) where a malicious script is persistenly \"stored\" within the data storage of a vulnerable web application. Initially presented by an adversary to the vulnerable web application, the malicious script is incorrectly considered valid input and is not properly encoded by the web application. A victim is then convinced to use the web application in a way that creates a response that includes the malicious script. This response is subsequently sent to the victim and the malicious script is executed by the victim's browser. To launch a successful Stored XSS attack, an adversary looks for places where stored input data is used in the generation of a response. This often involves elements that are not expected to host scripts such as image tags (<img>), or the addition of event attibutes such as onload and onmouseover. These elements are often not subject to the same input validation, output encoding, and other content filtering and checking routines.",
"external_references": [
{
"source_name": "capec",
"url": "https://capec.mitre.org/data/definitions/592.html",
"external_id": "CAPEC-592"
},
{
"source_name": "cwe",
"url": "http://cwe.mitre.org/data/definitions/79.html",
"external_id": "CWE-79"
}
],
"object_marking_refs": [
"marking-definition--17d82bb2-eeeb-4898-bda5-3ddbcd2b799d"
],
"x_capec_abstraction": "Detailed",
"x_capec_consequences": {
"Access_Control": [
"Gain Privileges (A successful Stored XSS attack can enable an adversary to elevate their privilege level and access functionality they should not otherwise be allowed to access.)"
],
"Authorization": [
"Gain Privileges (A successful Stored XSS attack can enable an adversary to elevate their privilege level and access functionality they should not otherwise be allowed to access.)"
],
"Availability": [
"Execute Unauthorized Commands (A successful Stored XSS attack can enable an adversary run arbitrary code of their choosing, thus enabling a complete compromise of the application.)"
],
"Confidentiality": [
"Read Data (A successful Stored XSS attack can enable an adversary to exfiltrate sensitive information from the application.)",
"Gain Privileges (A successful Stored XSS attack can enable an adversary to elevate their privilege level and access functionality they should not otherwise be allowed to access.)",
"Execute Unauthorized Commands (A successful Stored XSS attack can enable an adversary run arbitrary code of their choosing, thus enabling a complete compromise of the application.)"
],
"Integrity": [
"Execute Unauthorized Commands (A successful Stored XSS attack can enable an adversary run arbitrary code of their choosing, thus enabling a complete compromise of the application.)",
"Modify Data (A successful Stored XSS attack can allow an adversary to tamper with application data.)"
]
},
"x_capec_example_instances": [
"An adversary determines that a system uses a web based interface for administration. The adversary creates a new user record and supplies a malicious script in the user name field. The user name field is not validated by the system and a new log entry is created detailing the creation of the new user. Later, an administrator reviews the log in the administrative console. When the administrator comes across the new user entry, the browser sees a script and executes it, stealing the administrator's authentication cookie and forwarding it to the adversary. An adversary then uses the received authentication cookie to log in to the system as an administrator, provided that the administrator console can be accessed remotely.",
"An online discussion forum allows its members to post HTML-enabled messages, which can also include image tags. An adversary embeds JavaScript in the image tags of their message. The adversary then sends the victim an email advertising free goods and provides a link to the form for how to collect. When the victim visits the forum and reads the message, the malicious script is executed within the victim's browser."
],
"x_capec_likelihood_of_attack": "High",
"x_capec_prerequisites": [
"An application that leverages a client-side web browser with scripting enabled.",
"An application that fails to adequately sanitize or encode untrusted input.",
"An application that stores information provided by the user in data storage of some kind."
],
"x_capec_resources_required": [
"None: No specialized resources are required to execute this type of attack."
],
"x_capec_skills_required": {
"Medium": "Requires the ability to write scripts of varying complexity and to inject them through user controlled fields within the application."
},
"x_capec_status": "Stable",
"x_capec_typical_severity": "Very High",
"x_capec_version": "3.3"
}
]
} | {
"pile_set_name": "Github"
} |
---
title: "System.Convert Methods"
ms.date: "03/30/2017"
ms.assetid: 3ca6c5b6-ea5d-4ab0-b675-f082135b342c
---
# System.Convert Methods
[!INCLUDE[vbtecdlinq](../../../../../../includes/vbtecdlinq-md.md)] does not support the following <xref:System.Convert> methods.
- Versions with an <xref:System.IFormatProvider> parameter.
- Methods that involve char arrays or byte arrays:
- <xref:System.Convert.FromBase64CharArray%2A>
- <xref:System.Convert.ToBase64CharArray%2A>
- <xref:System.Convert.FromBase64String%2A>
- <xref:System.Convert.ToBase64String%2A>
- The following methods:
- `public static <Type2> To<Type2>(<Type1> value);` where
`Type1` and `Type2` are each one of `sbyte`, `uint`, `ulong`, or `ushort`.
- C#:
`int To<int type>(string value, int fromBase),`
`ToString(... value, int toBase)`
- Visual Basic:
`Function To(Of [Numeric])(value as String, fromBase As Integer)`
`As [Numeric], ToString( value As …, toBase As Integer)`
- <xref:System.Convert.IsDBNull%2A>
- <xref:System.Convert.GetTypeCode%2A>
- <xref:System.Convert.ChangeType%2A>
## See also
- [Data Types and Functions](data-types-and-functions.md)
| {
"pile_set_name": "Github"
} |
#
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The contents of this file are subject to the terms of either the Universal Permissive License
# v 1.0 as shown at http://oss.oracle.com/licenses/upl
#
# or the following license:
#
# 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. Neither the name of the copyright holder 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 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.
#
SECTION_SERVER_INFORMATION_TITLE=Server Information
APPLICATION_ARGUMENTS_LABEL=Application Arguments
BOOT_CLASS_PATH_LABEL=Boot Class Path
CLASS_PATH_LABEL=Class Path
# {0} is the name of the server, {1} is the name of the machine it is running on, {2} is the connected port
COLUMN_KEY_TEXT=Key
COLUMN_VALUE_TEXT=Value
CONNECTION_INFORMATION_VALUE={0} on {1}
CONNECTION_INFORMATION_LABEL=Connection
LIBRARY_PATH_LABEL=Library Path
NUMBER_OF_PROCESSORS_LABEL=Number of Processors
OPERATING_SYSTEM_ARCHITECTURE_LABEL=OS Architecture
OPERATING_SYSTEM_LABEL=Operating System
PROCESS_ID_LABEL=PID
START_TIME_LABEL=Start Time
TOTAL_PHYSICAL_MEMORY_LABEL=Total Physical Memory
VM_ARGUMENTS_LABEL=VM Arguments
VM_VENDOR_LABEL=VM Vendor
VM_VERSION_LABEL=VM Version
# {0} is an operating system name, {1} is some version number for it
VM_VERSION_VALUE={0} version {1} (Java version {2})
TABLE_CATEGORY_LABEL=Category
TABLE_CATEGORY_DESC=Category of information
TABLE_VALUE_LABEL=Value
TABLE_VALUE_DESC=Value of information category
MBeanAutomaticRefreshAction_MBEAN_STRUCTURA_REFRESH_ACTION_TEXT=Updates
MBeanAutomaticRefreshAction_MBEAN_STRUCTURA_REFRESH_ACTION_TOOLTIP=Turn automatic MBean tree updates on/off.
ConsolePlugin_DIALOG_RESET_TO_DEFAULTS_TITLE=Confirm reset to defaults
ConsolePlugin_DIALOG_RESET_TO_DEFAULTS_MESSAGE=This will reset the tab to its default state. Do you want to continue?
ConsolePlugin_TOOLTIP_RESET_TO_DEFAULT_CONTROLS_TEXT=Reset to default controls
ConsoleEditor_CONNECTION_LOST=Connection Lost
ConsoleEditor_COULD_NOT_CONNECT=Could not connect to {0} : {1}
ConsoleEditor_DIAGNOSTIC_COMMANDS_UNAVAILABLE=Diagnostic Commands MBean not available
ConsoleEditor_MANAGEMENT_CONSOLE=JMX Console
ConsoleEditor_OPENING_MANAGEMENT_CONSOLE=Opening JMX Console
ConsoleEditor_PLATFORM_MBEANS_UNAVAILABLE=Platform MBeans not available
ConsoleEditorInput_FAILED_TO_OPEN_EDITOR=Failed to open editor
CommunicationPage_DESCRIPTION=Communication settings:\n\n
CommunicationPage_CAPTION_DEFAULT_UPDATE_INTERVAL=Default update interval:
CommunicationPage_UPDATE_INTERVAL_THREAD_STACK0=Update interval for thread stacks [ms]
CommunicationPage_CAPTION_MAIL_SERVER=Mail server (SMTP):
CommunicationPage_CAPTION_MAIL_SERVER_PORT=Mail server port:
CommunicationPage_CAPTION_MAIL_SERVER_USER=Mail server user:
CommunicationPage_CAPTION_MAIL_SERVER_PASSWORD=Mail server password:
CommunicationPage_CAPTION_RETAINED_EVENT_VALUES=Retained event values
CommunicationPage_CAPTION_SECURE_MAIL_SERVER=Secure mail server (SSL)
GeneralPage_DESCRIPTION=General settings for the JMX Console.\n\n
GeneralPage_SHOW_WARNING_BEFORE_UPDATING_HEAP_HISTOGRAM=Show warning before updating heap histogram
GeneralPage_LIST_AGGREGATE_SIZE=Show tree nodes in groups of:
PersistencePage_DESCRIPTION=JMX data persistence settings:\n\n
PersistencePage_CAPTION_PERSISTENCE_DIRECTORY=Persistence directory:
PersistencePage_CAPTION_LOG_ROTATION_LIMIT_KB=Log rotation limit [kB]:
PersistencePage_ERROR_DIRECTORY_MUST_EXIST_OR_BE_CREATABLE=Directory must exist or be possible to create
MBeanBrowserPage_LABEL_MBEAN_BROWSER_PREFERENCES_TEXT=MBean Browser preferences:
MBeanBrowserPage_LABEL_PROPERTY_ASK_USER_BEFORE_MBEAN_UNREGISTER=Ask user for confirmation before unregistering non-system MBeans
MBeanBrowserPage_LABEL_PROPERTY_KEY_ORDER_OVERRIDE_TEXT=MBean property key order override:
MBeanBrowserPage_LABEL_SUFFIX_PROPERTY_KEY_ORDER_OVERRIDE_TEXT=MBean suffix property key order override:
MBeanBrowserPage_LABEL_PROPERTIES_IN_ALPHABETIC_ORDER_OVERRIDE_TEXT=Remaining properties in alphabetic order
MBeanBrowserPage_LABEL_CASE_INSENSITIVE_KEY_COMPARISON_OVERRIDE_TEXT=Case insensitive property key comparison
MBeanBrowserPage_LABEL_SHOW_COMPRESSED_PATHS_TEXT=Show compressed paths (leave out property keys)
MBeanBrowserPage_NOTE_PROPERTIES_TEXT=These properties governs how all MBeans are presented throughout the JMX console. Changing them will result in updates to attribute tool tips, restructuring of the MBean browser tree of MBeans, etc.
HeapHistogram_JVM_PERFORMANCE_WILL_BE_AFFECTED=JVM performance will be affected while the heap histogram is refreshed. Are you sure you want to do this?
HeapHistogram_SHOW_WARNING_BEFORE_UPDATING=Show warning before refreshing heap histogram
HeapHistogram_WARNING_DIALOG_TITLE=Warning
HeapHistogram_TITLE=Heap Histogram
HeapHistogram_CLASS_COLUMN_TEXT=Class
HeapHistogram_INSTANCES_COLUMN_TEXT=Instances
HeapHistogram_SIZE_COLUMN_TEXT=Size
HeapHistogram_DELTA_COLUMN_TEXT=Delta
HeapHistogram_REFRESH_ACTION_TOOLTIP=Refresh heap histogram
HeapHistogram_RESET_DELTA_ACTION_TEXT=Reset Delta
HeapHistogram_RESET_DELTA_ACTION_TOOLTOP=Reset delta calculation
HeapHistogram_RESET_DELTA_ACTION_DESCRIPTION=Set the delta calculation reference point to the current values
HeapHistogram_REFRESHING_HEAP_HISTOGRAM=Refreshing Heap Histogram
HeapHistogram_FAILED_TO_REFRESH=Failed to refresh the heap histogram
GcTableSectionPart_GC_TABLE_SECTION_TITLE=GC Tables
MemoryTab_RUN_GC_ACTION_DESCRIPTION_TEXT=Run a full garbage collection
MemoryTab_TITLE_COULD_NOT_RUN_GC=Could not run the garbage collector
PoolTableSectionPart_SECTION_TEXT=Active Memory Pools
OverviewTab_SECTION_DASHBOARD_TEXT=Dashboard
SystemTab_SECTION_SYSTEM_STATISTICS_TEXT=JVM Statistics
SystemTab_SECTION_SYSTEM_PROPERTIES_TEXT=System Properties
StackTraceLabelProvider_MESSAGE_PART_NATIVE_METHOD=[native method]
# 0 = Class name
# 1 = Method name
# 2 = Line number
# 3 = Either StackTraceLabelProvider_MESSAGE_PART_NATIVE_METHOD (or empty string if not in native)
StackTraceLabelProvider_STACK_TRACE_FORMAT_STRING={0}.{1} line: {2} {3}
StackTraceSectionPart_SECTION_DESCRIPTION_DATE=Stack traces for selected threads {0}
StackTraceSectionPart_ACTION_REFRESH_STACK_TRACE_TEXT=Refresh Stack Trace
StackTraceLabelProvider_MESSAGE_PART_LINE_NUMBER_NOT_AVAILABLE=not available
StackTraceLabelProvider_MESSAGE_PART_NAME_UNKNOWN_THREAD_NAME=(Unnamed Thread)
StackTraceSectionPart_SECTION_TEXT=Stack Traces for Selected Threads
ThreadTableSectionPart_REFRESH_STACK_TRACE=Refresh Live Threads
ThreadTableSectionPart_SECTION_TEXT=Live Threads
ThreadTableSectionPart_SECTION_DESCRIPTION_DATE=Live Threads {0}
ThreadsModel_EXCEPTION_NO_DEADLOCK_DETECTION_AVAILABLE_MESSAGE=The JVM you are connected to lacks the required dead lock detection capability.
ThreadsModel_EXCEPTION_NO_THREAD_INFO_MESSAGE=Could not find any data for the threads!
ThreadTableSectionPart_ENABLE_THREAD_CPU_PROFILING_BUTTON_TEXT=CPU Profiling
ThreadTableSectionPart_ENABLE_DEADLOCK_DETECTION_BUTTON_TEXT=Deadlock Detection
ThreadTableSectionPart_ENABLE_THREAD_ALLOCATION_BUTTON_TEXT=Allocation
ThreadTableSectionPart_USING_FIND_MONITORED_DEADLOCKED_THREADS_HEADER=Using findMonitoredDeadlockedThreads
ThreadTableSectionPart_USING_FIND_MONITORED_DEADLOCKED_THREADS_TEXT=Method findDeadlockedThreads is not present in Threads MBean. Will use findMonitoredDeadlockedThreads instead.
AllThreadsContentProvider_CPU_COUNT_NOT_SUPPORTED_TEXT=CPU Count Unsupported
NOT_ENABLED_TEXT=Not Enabled
ALLOCATED_MEMORY_NAME_TEXT=Allocated Memory
ALLOCATED_MEMORY_DESCRIPTION_TEXT=The total amount of memory allocated by the thread (including reclaimed memory)
THREAD_NAME_NAME_TEXT=Thread Name
THREAD_NAME_DESCRIPTION_TEXT=The name of the Thread
BLOCKED_COUNT_NAME_TEXT=Blocked Count
BLOCKED_COUNT_DESCRIPTION_TEXT=The total number of times that the thread was blocked while trying to enter or reenter a monitor
BLOCKED_TIME_NAME_TEXT=Blocked Time
BLOCKED_TIME_DESCRIPTION_TEXT=The approximate accumulated time that the thread has been blocked from entering or reentering a monitor since thread contention monitoring was enabled
LOCK_NAME_NAME_TEXT=Lock Name
LOCK_NAME_DESCRIPTION_TEXT=The string representation of the monitor lock that the thread is blocked from entering or is waiting to be notified on through the Object.wait method
LOCK_OWNER_ID_NAME_TEXT=Lock Owner ID
LOCK_OWNER_ID_DESCRIPTION_TEXT=The ID of the thread which holds the monitor lock of an object on which the thread is blocking
LOCK_OWNER_NAME_NAME_TEXT=Lock Owner Name
LOCK_OWNER_NAME_DESCRIPTION_TEXT=The name of the thread which holds the monitor lock of an object on which the thread is blocking
THREAD_ID_NAME_TEXT=Thread Id
THREAD_ID_DESCRIPTION_TEXT=The ID of the thread
THREAD_STATE_NAME_TEXT=Thread State
THREAD_STATE_DESCRIPTION_TEXT=The state of the thread
WAITED_COUNT_NAME_TEXT=Waited Count
WAITED_COUNT_DESCRIPTION_TEXT=The total number of times that the thread waited for notification.
WAITED_TIME_NAME_TEXT=Waited Time
WAITED_TIME_DESCRIPTION_TEXT=The approximate accumulated time that the thread has waited for notifications since thread contention monitoring was enabled
IS_NATIVE_NAME_TEXT=Native
IS_NATIVE_DESCRIPTION_TEXT=True if the thread is executing native code via the Java Native Interface (JNI)
IS_SUSPENDED_NAME_TEXT=Suspended
IS_SUSPENDED_DESCRIPTION_TEXT=True if the thread is suspended
IS_DEADLOCKED_NAME_TEXT=Deadlocked
IS_DEADLOCKED_DESCRIPTION_TEXT=True if the thread is deadlocked. Use the toolbar icon to enable or disable deadlock detection
CPU_USAGE_NAME_TEXT=Total CPU Usage
CPU_USAGE_DESCRIPTION_TEXT=The CPU usage for the thread (both in user and kernel mode) as percent of total CPU usage available on the machine
POOL_NAME_NAME_TEXT=Pool Name
POOL_TYPE_NAME_TEXT=Type
POOL_CUR_USED_NAME_TEXT=Used
POOL_CUR_MAX_NAME_TEXT=Max
POOL_CUR_USAGE_NAME_TEXT=Usage
POOL_PEAK_USED_NAME_TEXT=Peak Used
POOL_PEAK_MAX_NAME_TEXT=Peak Max
| {
"pile_set_name": "Github"
} |
var convert = require('./convert'),
func = convert('repeat', require('../repeat'));
func.placeholder = require('./placeholder');
module.exports = func;
| {
"pile_set_name": "Github"
} |
--innodb_flush_log_at_trx_commit=2
--innodb_buffer_pool_size=512M
--log_slave_updates=0
| {
"pile_set_name": "Github"
} |
//
// StateMachine.swift
// Redstone
//
// Created by nixzhu on 2017/1/6.
// Copyright © 2017年 nixWork. All rights reserved.
//
public class StateMachine<State: Hashable, Transition: Hashable> {
public typealias Operation = () -> Void
private var body = [State: Operation?]()
public private(set) var previousState: State?
public private(set) var lastTransition: Transition?
public private(set) var currentState: State? {
willSet {
previousState = currentState
}
didSet {
if let state = currentState {
body[state]??()
}
}
}
public var initialState: State? {
didSet {
if oldValue == nil, initialState != nil {
currentState = initialState
}
}
}
private var stateTransitionTable: [State: [Transition: State]] = [:]
public init() {
}
public func add(state: State, entryOperation: Operation?) {
body[state] = entryOperation
}
public func add(transition: Transition, fromState: State, toState: State) {
var bag = stateTransitionTable[fromState] ?? [:]
bag[transition] = toState
stateTransitionTable[fromState] = bag
}
public func add(transition: Transition, fromStates: Set<State>, toState: State) {
fromStates.forEach {
add(transition: transition, fromState: $0, toState: toState)
}
}
public func fire(transition: Transition) {
guard let state = currentState else { return }
guard let toState = stateTransitionTable[state]?[transition] else { return }
lastTransition = transition
currentState = toState
}
}
| {
"pile_set_name": "Github"
} |
import React from 'react'
/**
* React component for the Footer Section.
*/
export const Footer = () => {
return (
<footer className="footer">
<p>
© 2020 Amith Raravi - source code on{' '}
<a href="https://github.com/raravi/sudoku">Github</a>
</p>
</footer>
)
}
| {
"pile_set_name": "Github"
} |
## Substitute Decimals for floats in expressions
Originally published: 2005-03-29 23:59:05
Last updated: 2005-06-10 07:18:40
Author: Raymond Hettinger
Evaluate using Decimals instead of floats. | {
"pile_set_name": "Github"
} |
## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=open)
- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed)
- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost
- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing
- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties
- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object
- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option
- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects.
- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47
- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986
- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign
- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute
## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed)
- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed)
- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option
## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed)
- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57
- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader
## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed)
- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object
## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed)
- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed)
- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46
## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed)
- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer?
- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45
- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39
## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed)
- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number
## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed)
- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed)
- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31
- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed)
- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays
- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed)
- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter
## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed)
- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit?
- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed)
- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values
## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed)
- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters
- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block
## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed)
- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument
- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed)
- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted
- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null
- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README
## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed)
- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index
| {
"pile_set_name": "Github"
} |
package cmd
import (
"fmt"
"github.com/jenkins-zh/jenkins-cli/app/cmd/common"
"github.com/jenkins-zh/jenkins-cli/app/i18n"
"github.com/spf13/cobra"
)
// ConfigListOption option for config list command
type ConfigListOption struct {
common.OutputOption
Config string
}
var configListOption ConfigListOption
func init() {
configCmd.AddCommand(configListCmd)
configListCmd.Flags().StringVarP(&configListOption.Config, "config", "", "JenkinsServers",
i18n.T("The type of config items, contains PreHooks, PostHooks, Mirrors, PluginSuites"))
configListOption.SetFlagWithHeaders(configListCmd, "Name,URL,Description")
}
var configListCmd = &cobra.Command{
Use: "list",
Short: i18n.T("List all Jenkins config items"),
Long: i18n.T("List all Jenkins config items"),
RunE: func(cmd *cobra.Command, _ []string) (err error) {
configListOption.Writer = cmd.OutOrStdout()
config := getConfig()
if config == nil {
return fmt.Errorf("no config file found")
}
switch configListOption.Config {
case "JenkinsServers":
err = configListOption.OutputV2(config.JenkinsServers)
case "PreHooks":
configListOption.Columns = "Path,Command"
err = configListOption.OutputV2(config.PreHooks)
case "PostHooks":
configListOption.Columns = "Path,Command"
err = configListOption.OutputV2(config.PostHooks)
case "Mirrors":
configListOption.Columns = "Name,URL"
err = configListOption.OutputV2(config.Mirrors)
case "PluginSuites":
configListOption.Columns = "Name,Description"
err = configListOption.OutputV2(config.PluginSuites)
default:
err = fmt.Errorf("unknow config %s", configListOption.Config)
}
return
},
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2018 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 "modules/audio_processing/agc2/fixed_gain_controller.h"
#include "absl/memory/memory.h"
#include "api/array_view.h"
#include "modules/audio_processing/agc2/agc2_testing_common.h"
#include "modules/audio_processing/agc2/vector_float_frame.h"
#include "modules/audio_processing/logging/apm_data_dumper.h"
#include "rtc_base/gunit.h"
#include "system_wrappers/include/metrics.h"
namespace webrtc {
namespace {
constexpr float kInputLevelLinear = 15000.f;
constexpr float kGainToApplyDb = 15.f;
float RunFixedGainControllerWithConstantInput(FixedGainController* fixed_gc,
const float input_level,
const size_t num_frames,
const int sample_rate) {
// Give time to the level etimator to converge.
for (size_t i = 0; i < num_frames; ++i) {
VectorFloatFrame vectors_with_float_frame(
1, rtc::CheckedDivExact(sample_rate, 100), input_level);
fixed_gc->Process(vectors_with_float_frame.float_frame_view());
}
// Process the last frame with constant input level.
VectorFloatFrame vectors_with_float_frame_last(
1, rtc::CheckedDivExact(sample_rate, 100), input_level);
fixed_gc->Process(vectors_with_float_frame_last.float_frame_view());
// Return the last sample from the last processed frame.
const auto channel =
vectors_with_float_frame_last.float_frame_view().channel(0);
return channel[channel.size() - 1];
}
std::unique_ptr<ApmDataDumper> GetApmDataDumper() {
return absl::make_unique<ApmDataDumper>(0);
}
std::unique_ptr<FixedGainController> CreateFixedGainController(
float gain_to_apply,
size_t rate,
std::string histogram_name_prefix,
ApmDataDumper* test_data_dumper) {
std::unique_ptr<FixedGainController> fgc =
absl::make_unique<FixedGainController>(test_data_dumper,
histogram_name_prefix);
fgc->SetGain(gain_to_apply);
fgc->SetSampleRate(rate);
return fgc;
}
std::unique_ptr<FixedGainController> CreateFixedGainController(
float gain_to_apply,
size_t rate,
ApmDataDumper* test_data_dumper) {
return CreateFixedGainController(gain_to_apply, rate, "", test_data_dumper);
}
} // namespace
TEST(AutomaticGainController2FixedDigital, CreateUse) {
const int kSampleRate = 44000;
auto test_data_dumper = GetApmDataDumper();
std::unique_ptr<FixedGainController> fixed_gc = CreateFixedGainController(
kGainToApplyDb, kSampleRate, test_data_dumper.get());
VectorFloatFrame vectors_with_float_frame(
1, rtc::CheckedDivExact(kSampleRate, 100), kInputLevelLinear);
auto float_frame = vectors_with_float_frame.float_frame_view();
fixed_gc->Process(float_frame);
const auto channel = float_frame.channel(0);
EXPECT_LT(kInputLevelLinear, channel[0]);
}
TEST(AutomaticGainController2FixedDigital, CheckSaturationBehaviorWithLimiter) {
const float kInputLevel = 32767.f;
const size_t kNumFrames = 5;
const size_t kSampleRate = 42000;
auto test_data_dumper = GetApmDataDumper();
const auto gains_no_saturation =
test::LinSpace(0.1, test::kLimiterMaxInputLevelDbFs - 0.01, 10);
for (const auto gain_db : gains_no_saturation) {
// Since |test::kLimiterMaxInputLevelDbFs| > |gain_db|, the
// limiter will not saturate the signal.
std::unique_ptr<FixedGainController> fixed_gc_no_saturation =
CreateFixedGainController(gain_db, kSampleRate, test_data_dumper.get());
// Saturation not expected.
SCOPED_TRACE(std::to_string(gain_db));
EXPECT_LT(
RunFixedGainControllerWithConstantInput(
fixed_gc_no_saturation.get(), kInputLevel, kNumFrames, kSampleRate),
32767.f);
}
const auto gains_saturation =
test::LinSpace(test::kLimiterMaxInputLevelDbFs + 0.01, 10, 10);
for (const auto gain_db : gains_saturation) {
// Since |test::kLimiterMaxInputLevelDbFs| < |gain|, the limiter
// will saturate the signal.
std::unique_ptr<FixedGainController> fixed_gc_saturation =
CreateFixedGainController(gain_db, kSampleRate, test_data_dumper.get());
// Saturation expected.
SCOPED_TRACE(std::to_string(gain_db));
EXPECT_FLOAT_EQ(
RunFixedGainControllerWithConstantInput(
fixed_gc_saturation.get(), kInputLevel, kNumFrames, kSampleRate),
32767.f);
}
}
TEST(AutomaticGainController2FixedDigital,
CheckSaturationBehaviorWithLimiterSingleSample) {
const float kInputLevel = 32767.f;
const size_t kNumFrames = 5;
const size_t kSampleRate = 8000;
auto test_data_dumper = GetApmDataDumper();
const auto gains_no_saturation =
test::LinSpace(0.1, test::kLimiterMaxInputLevelDbFs - 0.01, 10);
for (const auto gain_db : gains_no_saturation) {
// Since |gain| > |test::kLimiterMaxInputLevelDbFs|, the limiter will
// not saturate the signal.
std::unique_ptr<FixedGainController> fixed_gc_no_saturation =
CreateFixedGainController(gain_db, kSampleRate, test_data_dumper.get());
// Saturation not expected.
SCOPED_TRACE(std::to_string(gain_db));
EXPECT_LT(
RunFixedGainControllerWithConstantInput(
fixed_gc_no_saturation.get(), kInputLevel, kNumFrames, kSampleRate),
32767.f);
}
const auto gains_saturation =
test::LinSpace(test::kLimiterMaxInputLevelDbFs + 0.01, 10, 10);
for (const auto gain_db : gains_saturation) {
// Singe |gain| < |test::kLimiterMaxInputLevelDbFs|, the limiter will
// saturate the signal.
std::unique_ptr<FixedGainController> fixed_gc_saturation =
CreateFixedGainController(gain_db, kSampleRate, test_data_dumper.get());
// Saturation expected.
SCOPED_TRACE(std::to_string(gain_db));
EXPECT_FLOAT_EQ(
RunFixedGainControllerWithConstantInput(
fixed_gc_saturation.get(), kInputLevel, kNumFrames, kSampleRate),
32767.f);
}
}
TEST(AutomaticGainController2FixedDigital, GainShouldChangeOnSetGain) {
constexpr float kInputLevel = 1000.f;
constexpr size_t kNumFrames = 5;
constexpr size_t kSampleRate = 8000;
constexpr float kGainDbNoChange = 0.f;
constexpr float kGainDbFactor10 = 20.f;
auto test_data_dumper = GetApmDataDumper();
std::unique_ptr<FixedGainController> fixed_gc_no_saturation =
CreateFixedGainController(kGainDbNoChange, kSampleRate,
test_data_dumper.get());
// Signal level is unchanged with 0 db gain.
EXPECT_FLOAT_EQ(
RunFixedGainControllerWithConstantInput(
fixed_gc_no_saturation.get(), kInputLevel, kNumFrames, kSampleRate),
kInputLevel);
fixed_gc_no_saturation->SetGain(kGainDbFactor10);
// +20db should increase signal by a factor of 10.
EXPECT_FLOAT_EQ(
RunFixedGainControllerWithConstantInput(
fixed_gc_no_saturation.get(), kInputLevel, kNumFrames, kSampleRate),
kInputLevel * 10);
}
TEST(AutomaticGainController2FixedDigital,
SetGainShouldBeFastAndTimeInvariant) {
// Number of frames required for the fixed gain controller to adapt on the
// input signal when the gain changes.
constexpr size_t kNumFrames = 5;
constexpr float kInputLevel = 1000.f;
constexpr size_t kSampleRate = 8000;
constexpr float kGainDbLow = 0.f;
constexpr float kGainDbHigh = 40.f;
static_assert(kGainDbLow < kGainDbHigh, "");
auto test_data_dumper = GetApmDataDumper();
std::unique_ptr<FixedGainController> fixed_gc = CreateFixedGainController(
kGainDbLow, kSampleRate, test_data_dumper.get());
fixed_gc->SetGain(kGainDbLow);
const float output_level_pre = RunFixedGainControllerWithConstantInput(
fixed_gc.get(), kInputLevel, kNumFrames, kSampleRate);
fixed_gc->SetGain(kGainDbHigh);
RunFixedGainControllerWithConstantInput(fixed_gc.get(), kInputLevel,
kNumFrames, kSampleRate);
fixed_gc->SetGain(kGainDbLow);
const float output_level_post = RunFixedGainControllerWithConstantInput(
fixed_gc.get(), kInputLevel, kNumFrames, kSampleRate);
EXPECT_EQ(output_level_pre, output_level_post);
}
TEST(AutomaticGainController2FixedDigital, RegionHistogramIsUpdated) {
constexpr size_t kSampleRate = 8000;
constexpr float kGainDb = 0.f;
constexpr float kInputLevel = 1000.f;
constexpr size_t kNumFrames = 5;
metrics::Reset();
auto test_data_dumper = GetApmDataDumper();
std::unique_ptr<FixedGainController> fixed_gc_no_saturation =
CreateFixedGainController(kGainDb, kSampleRate, "Test",
test_data_dumper.get());
static_cast<void>(RunFixedGainControllerWithConstantInput(
fixed_gc_no_saturation.get(), kInputLevel, kNumFrames, kSampleRate));
// Destroying FixedGainController should cause the last limiter region to be
// logged.
fixed_gc_no_saturation.reset();
EXPECT_EQ(1, metrics::NumSamples(
"WebRTC.Audio.Test.FixedDigitalGainCurveRegion.Identity"));
EXPECT_EQ(0, metrics::NumSamples(
"WebRTC.Audio.Test.FixedDigitalGainCurveRegion.Knee"));
EXPECT_EQ(0, metrics::NumSamples(
"WebRTC.Audio.Test.FixedDigitalGainCurveRegion.Limiter"));
EXPECT_EQ(0, metrics::NumSamples(
"WebRTC.Audio.Test.FixedDigitalGainCurveRegion.Saturation"));
}
} // namespace webrtc
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<tests>
<!-- test the use of text() -->
<document url="xml/test/test_text.xml">
<context select="/">
<valueOf select="normalize-space(/message)">This should work</valueOf>
</context>
</document>
<!-- test cases for the use of = with nodesets -->
<document url="xml/web.xml">
<context select="/">
<pattern match="/web-app/servlet/servlet-name = 'file'"/>
<pattern match="/web-app/servlet/servlet-name = 'snoop'"/>
</context>
</document>
<!-- test the use of 'or' -->
<document url="xml/test/sample.xml">
<context select="/">
<test select="/products/product[@id='2' or colour='green']" count="2"/>
</context>
</document>
<document url="xml/test/DavidHooker.xml">
<context select="/">
<test select="/*/oi:thing-info/@triggering-document-expression" count="1"/>
<test select="/atomic:thing/oi:thing-info/@triggering-document-expression" count="1"/>
<test select="//@triggering-document-expression" count="1"/>
</context>
</document>
<!-- test Axes -->
<document url="xml/xhtml.xml">
<context select="/">
<valueOf select="/html/body/link">http://foo.com/bar?a=123&b=456&d=d9d9d</valueOf>
</context>
</document>
<document url="xml/web.xml">
<context select="/">
<test select="/descendant-or-self::*" count="19"/>
<test select="descendant-or-self::*" count="19"/>
<test select="/descendant-or-self::servlet" count="2"/>
<test select="descendant-or-self::servlet" count="2"/>
<test select="/descendant::servlet" count="2"/>
<test select="descendant::*" count="19"/>
<test select="/descendant::*" count="19"/>
<test select="descendant::servlet" count="2"/>
<test select="/*/servlet" count="2"/>
<valueOf select="count(/*/servlet)">2</valueOf>
<test select="//servlet" count="2"/>
<valueOf select="count(//servlet)">2</valueOf>
</context>
<context select="/web-app">
<test select="/descendant-or-self::servlet" count="2"/>
<test select="descendant-or-self::servlet" count="2"/>
<test select="/descendant::servlet" count="2"/>
<test select="descendant::servlet" count="2"/>
</context>
<context select="/web-app/servlet[2]/servlet-name">
<test select="preceding::*" count="3"/>
</context>
<context select="/web-app/servlet[2]/servlet-name">
<test select="following::*" count="13"/>
</context>
</document>
<document url="xml/axis.xml">
<context select="/root">
<test select="preceding-sibling::*" count="0"/>
</context>
<context select="/root/a/a.3">
<test select="preceding::*" count="2"/>
</context>
<context select="/root/a/a.3">
<test select="preceding-sibling::*" count="2"/>
</context>
<context select="/">
<valueOf select="name(/root/a/a.3/preceding-sibling::*[1])">a.2</valueOf>
<valueOf select="name(/root/a/a.3/preceding-sibling::*[2])">a.1</valueOf>
</context>
<context select="/">
<valueOf select="name(/root/a/a.3/following-sibling::*[1])">a.4</valueOf>
<valueOf select="name(/root/a/a.3/following-sibling::*[2])">a.5</valueOf>
</context>
</document>
<!-- test predicates -->
<document url="xml/web.xml">
<context select="/">
<test select="/web-app/servlet/servlet-name[.='file']" count="1"/>
<test select="/web-app/servlet/servlet-name[text()='file']" count="1"/>
</context>
</document>
<!-- test `s -->
<!-- patterns are used in XSLT <xsl:template match="pattern"/> tags -->
<document url="xml/web.xml">
<context select="/">
<pattern match="/"/>
<test select="web-app/servlet" count="2"/>
</context>
<context select="//servlet[1]">
<pattern match="*"/>
<pattern match="servlet"/>
<pattern match="servlet[servlet-name='snoop']"/>
<pattern match="web-app/servlet"/>
<pattern match="*/servlet"/>
<pattern match="/*/servlet"/>
</context>
</document>
<document url="xml/test/sample.xml">
<context select="/products/product[@id='2']">
<pattern match=".[@id='2']"/>
<pattern match=".[colour='blue']"/>
<pattern match="@id='2'"/>
<pattern match="colour='blue'"/>
<pattern match="name()='product'"/>
<pattern match="not(id='3')"/>
</context>
</document>
<!-- test filters -->
<document url="xml/web.xml">
<context select="/">
<filter match="/"/>
</context>
<context select="//servlet[1]">
<filter match="."/>
<filter match="name()='servlet'"/>
</context>
</document>
<document url="xml/test/sample.xml">
<context select="/products/product[@id='2']">
<filter match=".[@id='2']"/>
<filter match=".[colour='blue']"/>
<filter match="@id='2'"/>
<filter match="colour='blue'"/>
<filter match="name()='product'"/>
<filter match="not(id='3')"/>
</context>
</document>
<!-- test name -->
<document url="xml/web.xml">
<context select="/">
<test select="*" count="1">
<valueOf select="name()">web-app</valueOf>
</test>
<!-- NOTE that the child::node() tests only work if the
XML document does not comments or PIs
-->
<test select="./*" count="1">
<valueOf select="name()">web-app</valueOf>
</test>
<test select="child::*" count="1">
<valueOf select="name()">web-app</valueOf>
</test>
<test select="/*" count="1">
<valueOf select="name()">web-app</valueOf>
</test>
<test select="/child::node()" count="1">
<valueOf select="name(.)">web-app</valueOf>
</test>
<test select="child::node()" count="1">
<valueOf select="name(.)">web-app</valueOf>
</test>
<!-- empty names -->
<valueOf select="name()"></valueOf>
<valueOf select="name(.)"></valueOf>
<valueOf select="name(parent::*)"></valueOf>
<valueOf select="name(/)"></valueOf>
<valueOf select="name(/.)"></valueOf>
<valueOf select="name(/self::node())"></valueOf>
<!-- name of root elemet -->
<valueOf select="name(node())">web-app</valueOf>
<valueOf select="name(/node())">web-app</valueOf>
<valueOf select="name(/*)">web-app</valueOf>
<valueOf select="name(/child::*)">web-app</valueOf>
<valueOf select="name(/child::node())">web-app</valueOf>
<valueOf select="name(/child::node())">web-app</valueOf>
<valueOf select="name(child::node())">web-app</valueOf>
<valueOf select="name(./*)">web-app</valueOf>
<valueOf select="name(*)">web-app</valueOf>
</context>
<context select="/*">
<!-- empty names -->
<valueOf select="name(..)"></valueOf>
<valueOf select="name(parent::node())"></valueOf>
<valueOf select="name(parent::*)"></valueOf>
<!-- name of root elemet -->
<valueOf select="name()">web-app</valueOf>
<valueOf select="name(.)">web-app</valueOf>
<valueOf select="name(../*)">web-app</valueOf>
<valueOf select="name(../child::node())">web-app</valueOf>
</context>
</document>
<!-- test predicates -->
<document url="xml/nitf/sample.xml">
<context select="/nitf/head/docdata">
<test select="doc-id[@regsrc='AP' and @id-string='D76UIMO80']" count="1"/>
</context>
<context select="/nitf/head">
<test select="meta[@name='ap-cycle']" count="1"/>
<test select="meta[@content='AP']" count="1"/>
<test select="meta[@name and @content]" count="8"/>
<test select="meta[@name='ap-cycle' and @content='AP']" count="1"/>
<test select="meta[@name != 'ap-cycle']" count="7"/>
</context>
<context select="/">
<test select="/nitf/head/meta[@name='ap-cycle']" count="1"/>
<test select="/nitf/head/meta[@content='AP']" count="1"/>
<test select="/nitf/head/meta[@name and @content]" count="8"/>
<test select="/nitf/head/meta[@name='ap-cycle' and @content='AP']" count="1"/>
<test select="/nitf/head/meta[@name != 'ap-cycle']" count="7"/>
</context>
</document>
<document url="xml/moreover/sample.xml">
<context select="/">
<test select="/child::node()" count="1"/>
<test select="/*" count="1"/>
<test select="/*/article" count="20"/>
<test select="//*" count="221"/>
<test select="//*[local-name()='article']" count="20"/>
<test select="//article" count="20"/>
<test select="/*/*[@id]" count="20"/>
<test select="/moreovernews/article[@id='_13563275']" count="1"/>
<test select="/moreovernews/article[@id='_13563275']">
<valueOf select="url">http://c.moreover.com/click/here.pl?x13563273</valueOf>
</test>
<test select="/*/article[@id='_13563275']">
<valueOf select="url">http://c.moreover.com/click/here.pl?x13563273</valueOf>
</test>
<test select="//article[@id='_13563275']">
<valueOf select="url">http://c.moreover.com/click/here.pl?x13563273</valueOf>
</test>
<test select="//*[@id='_13563275']">
<valueOf select="url">http://c.moreover.com/click/here.pl?x13563273</valueOf>
</test>
<test select="/child::node()/child::node()[@id='_13563275']">
<valueOf select="url">http://c.moreover.com/click/here.pl?x13563273</valueOf>
</test>
<test select="/*/*[@id='_13563275']">
<valueOf select="url">http://c.moreover.com/click/here.pl?x13563273</valueOf>
</test>
</context>
</document>
<!-- test other node types-->
<document url="xml/contents.xml">
<context select="/">
<test select="processing-instruction()" count="3"/>
<test select="/processing-instruction()" count="3"/>
<test select="/comment()" count="1"/>
<test select="comment()" count="1"/>
<test select="/child::node()/comment()" count="2"/>
<test select="/*/comment()" count="2"/>
<test select="//comment()" count="3"/>
</context>
</document>
<!-- test positioning -->
<document url="xml/fibo.xml">
<context select="/">
<test select="/*/fibonacci[position() < 10]" count="9"/>
<valueOf select="sum(//fibonacci)">196417</valueOf>
<valueOf select="sum(//fibonacci/@index)">325</valueOf>
</context>
</document>
<!-- test mumber functions -->
<document url="xml/much_ado.xml">
<context select="/">
<test select="/descendant::ACT" count="5"/>
<test select="descendant::ACT" count="5"/>
<valueOf select="/PLAY/TITLE">Much Ado about Nothing</valueOf>
<valueOf select="2+2">4</valueOf>
<valueOf select="5 * 4 + 1">21</valueOf>
<valueOf select="count(descendant::ACT)">5</valueOf>
<valueOf select="10 + count(descendant::ACT) * 5">35</valueOf>
<valueOf select="(10 + count(descendant::ACT)) * 5">75</valueOf>
</context>
<context select="/PLAY/ACT/SCENE[1]">
<test select="/descendant::ACT" count="5"/>
<test select="../../descendant::ACT" count="5"/>
<valueOf select="count(ancestor::*)">2</valueOf>
<valueOf select="count(ancestor::PLAY)">1</valueOf>
<valueOf select="5+count(ancestor::*)-1">6</valueOf>
</context>
</document>
<!-- test namespace -->
<document url="xml/test/namespaces.xml">
<context select="/">
<test select="/*" count="1"/>
<test select="/foo:a" count="1"/>
<test select="/foo:a/b" count="1"/>
<test select="/foo:a/bar:f" count="1"/>
<test select="/*[namespace-uri()='fooNamespace' and local-name()='a']" count="1"/>
<test select="/*[local-name()='a' and namespace-uri()='fooNamespace']/*[local-name()='x' and namespace-uri()='fooNamespace']" count="1"/>
<test select="/*[local-name()='a' and namespace-uri()='fooNamespace']/*[local-name()='x' and namespace-uri()='fooNamespace']/*[local-name()='y' and namespace-uri()='fooNamespace']" count="1"/>
</context>
<context select="/">
<valueOf select="/foo:a/b/c">Hello</valueOf>
<valueOf select="/foo:a/foo:d/foo:e">Hey</valueOf>
<valueOf select="/foo:a/alias:x/alias:y">Hey3</valueOf>
<valueOf select="/foo:a/foo:x/foo:y">Hey3</valueOf>
<valueOf select="/*[local-name()='a' and namespace-uri()='fooNamespace']/*[local-name()='x' and namespace-uri()='fooNamespace']/*[local-name()='y' and namespace-uri()='fooNamespace']">Hey3</valueOf>
</context>
<context select="/foo:a/b">
<valueOf select="/foo:a/b/c">Hello</valueOf>
<valueOf select="/foo:a/foo:d/foo:e">Hey</valueOf>
<valueOf select="/foo:a/alias:x/alias:y">Hey3</valueOf>
<valueOf select="/foo:a/foo:x/foo:y">Hey3</valueOf>
</context>
</document>
<document url="xml/test/defaultNamespace.xml">
<context select="/">
<test select="/a/b/c" count="0"/>
<test select="/x:a/x:b/x:c" count="0" exception="true"/>
</context>
</document>
<document url="xml/testNamespaces.xml">
<context select="/">
<test select="namespace::*" count="0" debug="off"/>
<test select="/namespace::*" count="0" debug="off"/>
<test select="/Template/Application1/namespace::*" count="3" debug="off"/>
<test select="/Template/Application2/namespace::*" count="3" debug="off"/>
<test select="/Template/Application2/namespace::*" count="3" debug="off"/>
<test select="//namespace::*" count="25" debug="off"/>
</context>
<context select="/Template/Application1">
<test select="namespace::*" count="3" debug="off"/>
<test select="/namespace::*" count="0" debug="off"/>
<test select="/Template/Application1/namespace::*" count="3" debug="off"/>
<test select="/Template/Application2/namespace::*" count="3" debug="off"/>
<test select="/Template/Application2/namespace::*" count="3" debug="off"/>
<test select="//namespace::*" count="25" debug="off"/>
</context>
</document>
</tests>
| {
"pile_set_name": "Github"
} |
package main
import . "./li_cmalloc"
func main() {
p := Malloc_int()
Free_int(p)
ok := false
func() {
defer func() {
if recover() != nil {
ok = true
}
}()
p = Calloc_int(-1)
if p == nil {
ok = true
}
Free_int(p)
}()
if !ok {
panic(0)
}
}
| {
"pile_set_name": "Github"
} |
let sketch = function(p) {
let number_of_trees = 15;
let trees = [];
let radius = 400;
let initial_boundary_size = 10;
let number_of_tries = 10;
let terminated = false;
let colors;
p.setup = function() {
p.createCanvas(950,950);
p.noStroke();
p.fill(255,100,90);
p.background("#252525");
p.stroke(0);
p.strokeWeight(2);
colors = [
p.color("#ce3830"),
p.color("#1c8b94"),
p.color("#de980f"),
p.color("#d8d8be"),
p.color("#454545")
];
for (var i = 0; i < number_of_trees; i++) {
let tree = [
{
pos: p.createVector(p.width / 2 + p.random(-200,200), p.height / 2 + p.random(-200,200)),
parent: 0,
boundary: initial_boundary_size,
exhausted: false
}
];
trees.push(tree);
}
}
p.draw = function() {
if (!terminated) {
terminated = grow_all();
trees.forEach(display);
}
}
function grow_all () {
return trees.map(grow).every((x)=>x);
}
function grow (tree) {
//Breadth first
for (var index = 0; index < tree.length; index++) {
//Depth first
//for (var index = tree.length-1; index >= 0; index--) {
let current = tree[index];
if(!current.exhausted) {
let u = create_neighbour(current.pos, current.boundary);
for (var t = 0; t < number_of_tries; t++) {
let new_node = { pos: u, parent: index, boundary: current.boundary * 0.95, exhausted: current.boundary <= 3 }
if (ok_position(new_node)) {
if (p.random() < .3) current.exhausted = true;
tree.push(new_node);
return false;
}
u = create_neighbour(current.pos, current.boundary);
}
current.exhausted = true;
}
}
return true;
}
function display (tree, col) {
let last_index = tree.length - 1;
let v = tree[last_index];
let u = tree[v.parent];
p.stroke(colors[col % colors.length]);
p.strokeWeight(.5 + v.boundary / 4);
p.line(v.pos.x, v.pos.y, u.pos.x, u.pos.y);
}
function too_close_to_vertex (v,u) {
return p5.Vector.dist(v.pos,u.pos) < p.max(v.boundary,u.boundary);
}
function too_close_to_trees (new_node) {
return trees.some(function(tree) {
return tree.some(function(t) {
return too_close_to_vertex(new_node,t)})
});
}
function outside_canvas (v) {
return p.dist(v.x, v.y, p.width / 2, p.height / 2) > radius;
}
function ok_position (node) {
return !too_close_to_trees(node) && !outside_canvas(node.pos);
}
function create_neighbour (v, dist) {
let r = p.random(p.TWO_PI);
let x = v.x + (p.cos(r) * (dist + 1));
let y = v.y + (p.sin(r) * (dist + 1));
return p.createVector(x,y);
}
p.keyPressed = function () {
if (p.keyCode === 80) {
p.saveCanvas("roses", "jpeg");
}
}
}
new p5(sketch);
| {
"pile_set_name": "Github"
} |
ifeng.com
ifengimg.com
# Phoenix Center
phoenixcenter.cn
# Phoenix Education
fengedu.com
# Phoenix Weekly
ifengweekly.com
| {
"pile_set_name": "Github"
} |
package com.tencent.mm.plugin.wallet.pay.a.a;
import com.facebook.appevents.UserDataStore;
import com.google.android.gms.common.Scopes;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.wallet_core.model.Authen;
import com.tencent.mm.plugin.wallet_core.model.Orders;
import com.tencent.mm.pluginsdk.l;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.ac.a;
import com.tencent.mm.wallet_core.c;
import com.tencent.mm.wallet_core.c.d;
import com.tencent.mm.wallet_core.c.x;
import com.tencent.mm.wallet_core.tenpay.model.n;
import com.tencent.tmassistantsdk.openSDK.TMQQDownloaderOpenSDKConst;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
public class b extends n {
private Map<String, String> oYG;
private Map<String, String> toe;
public boolean tof;
public Orders tog;
public Authen toh;
public String toi;
public String toj;
private String tok;
public String token;
public int tol;
public String tom;
public int ton;
public JSONArray too;
public b(Authen authen, Orders orders) {
this(authen, orders, false);
}
public b(Authen authen, Orders orders, boolean z) {
this(authen, orders, z, (byte) 0);
}
private b(Authen authen, Orders orders, boolean z, byte b) {
boolean z2 = true;
AppMethodBeat.i(45921);
this.tof = false;
this.tog = null;
this.token = null;
this.toi = null;
this.toj = null;
this.tok = null;
this.tol = 0;
this.ton = 0;
this.toh = authen;
this.tog = orders;
IllegalArgumentException illegalArgumentException;
if (authen == null) {
illegalArgumentException = new IllegalArgumentException("authen == null");
AppMethodBeat.o(45921);
throw illegalArgumentException;
}
a(orders, authen);
if (authen.pGr == null) {
illegalArgumentException = new IllegalArgumentException("authen.payInfo == null");
AppMethodBeat.o(45921);
throw illegalArgumentException;
}
ab.i("MicroMsg.NetSceneTenpayAuthen", "pay channel :" + authen.pGr.cIb);
this.oYG = new HashMap();
this.toe = new HashMap();
boolean z3 = (z || bo.isNullOrNil(this.toh.twc)) ? false : true;
ab.i("MicroMsg.NetSceneTenpayAuthen", "hy: has pwd: %b", Boolean.valueOf(z3));
a(authen.pGr, this.oYG, this.toe, z3);
if (z) {
this.oYG.put("brief_reg", "1");
} else {
this.oYG.put("passwd", authen.twc);
}
this.tAz = orders.tAz;
this.oYG.put("default_favorcomposedid", authen.twn);
this.oYG.put("favorcomposedid", authen.two);
this.oYG.put("arrive_type", authen.twk);
this.oYG.put("sms_flag", authen.twp);
this.oYG.put("ban_sms_bind_serial", authen.twq);
this.oYG.put("ban_sms_bank_type", authen.twr);
this.oYG.put("busi_sms_flag", authen.tws);
this.oYG.put("buttontype", authen.pGr.vwn);
this.oYG.put("mobile_area", authen.twt);
ab.i("MicroMsg.NetSceneTenpayAuthen", "buttontype %s not_support_retry %s, mobile area: %s", Integer.valueOf(authen.pGr.vwn), Integer.valueOf(this.tAz), authen.twt);
switch (authen.bJt) {
case 1:
this.oYG.put("flag", "1");
this.oYG.put("bank_type", authen.pbn);
this.oYG.put("true_name", authen.twd);
this.oYG.put("identify_card", authen.twe);
if (authen.twf > 0) {
this.oYG.put("cre_type", authen.twf);
}
this.oYG.put("mobile_no", authen.tuk);
this.oYG.put("bank_card_id", authen.twg);
if (!bo.isNullOrNil(authen.twh)) {
this.oYG.put("cvv2", authen.twh);
}
if (!bo.isNullOrNil(authen.twi)) {
this.oYG.put("valid_thru", authen.twi);
}
this.oYG.put("creid_renewal", String.valueOf(authen.twu));
this.oYG.put("birth_date", authen.twv);
this.oYG.put("cre_expire_date", authen.tww);
break;
case 2:
this.oYG.put("flag", "2");
this.oYG.put("bank_type", authen.pbn);
this.oYG.put("h_bind_serial", authen.pbo);
this.oYG.put("card_tail", authen.twj);
if (!bo.isNullOrNil(authen.twd)) {
this.oYG.put("true_name", authen.twd);
}
if (!bo.isNullOrNil(authen.twe)) {
this.oYG.put("identify_card", authen.twe);
}
this.oYG.put("cre_type", authen.twf);
this.oYG.put("mobile_no", authen.tuk);
this.oYG.put("bank_card_id", authen.twg);
if (!bo.isNullOrNil(authen.twh)) {
this.oYG.put("cvv2", authen.twh);
}
if (!bo.isNullOrNil(authen.twi)) {
this.oYG.put("valid_thru", authen.twi);
}
this.oYG.put("creid_renewal", String.valueOf(authen.twu));
this.oYG.put("birth_date", authen.twv);
this.oYG.put("cre_expire_date", authen.tww);
break;
case 3:
if (authen.twb == 1) {
this.oYG.put("reset_flag", "1");
if (!bo.isNullOrNil(authen.tuk)) {
this.oYG.put("mobile_no", authen.tuk);
}
if (!bo.isNullOrNil(authen.twh)) {
this.oYG.put("cvv2", authen.twh);
}
if (!bo.isNullOrNil(authen.twi)) {
this.oYG.put("valid_thru", authen.twi);
}
}
this.oYG.put("flag", TMQQDownloaderOpenSDKConst.VERIFYTYPE_ALL);
this.oYG.put("bank_type", authen.pbn);
this.oYG.put("bind_serial", authen.pbo);
break;
case 4:
this.oYG.put("flag", "4");
this.oYG.put("bank_type", authen.pbn);
this.oYG.put("first_name", authen.twl);
this.oYG.put("last_name", authen.twm);
this.oYG.put(UserDataStore.COUNTRY, authen.country);
this.oYG.put("area", authen.duc);
this.oYG.put("city", authen.dud);
this.oYG.put("address", authen.fBg);
this.oYG.put("phone_number", authen.nuN);
this.oYG.put("zip_code", authen.gIO);
this.oYG.put(Scopes.EMAIL, authen.dtV);
this.oYG.put("bank_card_id", authen.twg);
if (!bo.isNullOrNil(authen.twh)) {
this.oYG.put("cvv2", authen.twh);
}
if (!bo.isNullOrNil(authen.twi)) {
this.oYG.put("valid_thru", authen.twi);
break;
}
break;
case 5:
this.oYG.put("flag", "5");
this.oYG.put("bank_type", authen.pbn);
this.oYG.put("first_name", authen.twl);
this.oYG.put("last_name", authen.twm);
this.oYG.put(UserDataStore.COUNTRY, authen.country);
this.oYG.put("area", authen.duc);
this.oYG.put("city", authen.dud);
this.oYG.put("address", authen.fBg);
this.oYG.put("phone_number", authen.nuN);
this.oYG.put("zip_code", authen.gIO);
this.oYG.put(Scopes.EMAIL, authen.dtV);
this.oYG.put("bank_card_id", authen.twg);
if (!bo.isNullOrNil(authen.twh)) {
this.oYG.put("cvv2", authen.twh);
}
if (!bo.isNullOrNil(authen.twi)) {
this.oYG.put("valid_thru", authen.twi);
}
this.oYG.put("h_bind_serial", authen.pbo);
this.oYG.put("card_tail", authen.twj);
break;
case 6:
if (authen.twb == 1) {
this.oYG.put("reset_flag", "1");
if (!bo.isNullOrNil(authen.twh)) {
this.oYG.put("cvv2", authen.twh);
}
if (!bo.isNullOrNil(authen.twi)) {
this.oYG.put("valid_thru", authen.twi);
}
}
this.oYG.put("phone_number", authen.tuk);
this.oYG.put("flag", "6");
this.oYG.put("bank_type", authen.pbn);
this.oYG.put("bind_serial", authen.pbo);
break;
}
aj(this.oYG);
M(this.oYG);
Map bxy = ((l) g.K(l.class)).bxy();
if (bxy != null) {
this.toe.putAll(bxy);
}
String str = authen.pGr.vwp;
int i = authen.pGr.aPn ? 2 : 1;
if (authen.pGr.tKd != 1) {
z2 = false;
}
com.tencent.mm.plugin.wallet.pay.a.b.r(str, i, z2);
if (x.dNS()) {
this.toe.put("uuid_for_bindcard", x.dNU());
this.toe.put("bindcard_scene", x.dNT());
}
ba(this.toe);
AppMethodBeat.o(45921);
}
/* Access modifiers changed, original: protected */
public void aj(Map<String, String> map) {
}
public final boolean bXl() {
AppMethodBeat.i(45922);
super.bXl();
this.oYG.put("is_repeat_send", "1");
M(this.oYG);
AppMethodBeat.o(45922);
return true;
}
public int bgI() {
return 0;
}
public void a(int i, String str, JSONObject jSONObject) {
AppMethodBeat.i(45923);
super.a(i, str, jSONObject);
ab.i("MicroMsg.NetSceneTenpayAuthen", " errCode: " + i + " errMsg :" + str);
ab.d("MicroMsg.NetSceneTenpayAuthen", "banlance_mobile: %s", this.toi);
this.tof = "1".equals(jSONObject.optString("is_free_sms"));
this.token = jSONObject.optString("token");
this.toi = jSONObject.optString("balance_mobile");
this.toj = jSONObject.optString("balance_help_url");
this.tok = jSONObject.optString("modify_mobile_url");
String optString = jSONObject.optString("bind_serial");
if (!bo.isNullOrNil(optString)) {
ab.i("MicroMsg.NetSceneTenpayAuthen", "Pay Success! saving bind_serial:".concat(String.valueOf(optString)));
}
if ("1".equals(jSONObject.optString("pay_flag"))) {
this.tpw = true;
this.tog = Orders.a(jSONObject, this.tog);
} else {
this.tpw = false;
}
JSONObject optJSONObject = jSONObject.optJSONObject("verify_cre_tail_info");
if (optJSONObject != null) {
this.tol = optJSONObject.optInt("is_can_verify_tail", 0);
this.tom = optJSONObject.optString("verify_tail_wording");
}
this.ton = jSONObject.optInt("no_reset_mobile", 0);
ab.i("MicroMsg.NetSceneTenpayAuthen", "pay_scene:" + this.toh.pGr.cIf);
if (this.toh.pGr.cIf == 21) {
this.too = jSONObject.optJSONArray("fetch_charge_show_info");
g.RP().Ry().set(a.USERINFO_WALLET_FETCH_CHARGE_RATE_VERSION_STRING_SYNC, jSONObject.optString("charge_rate_version"));
}
if (i == 0 && this.toh.pGr.cIf == 39) {
ab.i("MicroMsg.NetSceneTenpayAuthen", "it's the sns scene, parse the sns pay data");
com.tencent.mm.plugin.wallet_core.utils.b.aK(jSONObject);
} else {
ab.i("MicroMsg.NetSceneTenpayAuthen", "it's not the sns scene or occurs error, errCode:".concat(String.valueOf(i)));
}
for (c cVar : com.tencent.mm.wallet_core.a.atm("PayProcess")) {
cVar.mqu.putInt("key_is_clear_failure", this.AgM);
}
AppMethodBeat.o(45923);
}
public final void a(d dVar, JSONObject jSONObject) {
int i = 2;
AppMethodBeat.i(45924);
super.a(dVar, jSONObject);
String str;
if (this.AfF != 0 || this.AfG != 0) {
str = this.toh.pGr.vwp;
if (!this.toh.pGr.aPn) {
i = 1;
}
com.tencent.mm.plugin.wallet.pay.a.b.dr(str, i);
com.tencent.mm.plugin.wallet.pay.a.b.bz(this.toh.pGr.vwp, this.AfM);
} else if (this.tpw) {
str = this.toh.pGr.vwp;
if (!this.toh.pGr.aPn) {
i = 1;
}
com.tencent.mm.plugin.wallet.pay.a.b.dr(str, i);
com.tencent.mm.plugin.wallet.pay.a.b.bz(this.toh.pGr.vwp, this.AfM);
AppMethodBeat.o(45924);
return;
}
AppMethodBeat.o(45924);
}
public final String getToken() {
return this.token;
}
public String getUri() {
if (this.toh.pGr.cIf == 11) {
return "/cgi-bin/mmpay-bin/tenpay/saveauthen";
}
if (this.toh.pGr.cIf == 21) {
return "/cgi-bin/mmpay-bin/tenpay/fetchauthen";
}
return "/cgi-bin/mmpay-bin/tenpay/authen";
}
public int ZU() {
if (this.toh.pGr.cIf == 11) {
return 1610;
}
if (this.toh.pGr.cIf == 21) {
return 1605;
}
return 461;
}
public final boolean cNJ() {
return this.toh.pGr.tKd == 1;
}
public final boolean cNK() {
if (this.toh.pGr.cIf == 11 || this.toh.pGr.cIf == 21) {
return true;
}
return false;
}
}
| {
"pile_set_name": "Github"
} |
#include "tsystem.h"
#include "tiio_mp4.h"
#include "trasterimage.h"
#include "timageinfo.h"
#include "tsound.h"
#include "toonz/stage.h"
#include <QStringList>
//===========================================================
//
// TImageWriterMp4
//
//===========================================================
class TImageWriterMp4 : public TImageWriter {
public:
int m_frameIndex;
TImageWriterMp4(const TFilePath &path, int frameIndex, TLevelWriterMp4 *lwg)
: TImageWriter(path), m_frameIndex(frameIndex), m_lwg(lwg) {
m_lwg->addRef();
}
~TImageWriterMp4() { m_lwg->release(); }
bool is64bitOutputSupported() override { return false; }
void save(const TImageP &img) override { m_lwg->save(img, m_frameIndex); }
private:
TLevelWriterMp4 *m_lwg;
};
//===========================================================
//
// TLevelWriterMp4;
//
//===========================================================
TLevelWriterMp4::TLevelWriterMp4(const TFilePath &path, TPropertyGroup *winfo)
: TLevelWriter(path, winfo) {
if (!m_properties) m_properties = new Tiio::Mp4WriterProperties();
if (m_properties->getPropertyCount() == 0) {
m_scale = 100;
m_vidQuality = 100;
} else {
std::string scale = m_properties->getProperty("Scale")->getValueAsString();
m_scale = QString::fromStdString(scale).toInt();
std::string quality =
m_properties->getProperty("Quality")->getValueAsString();
m_vidQuality = QString::fromStdString(quality).toInt();
}
ffmpegWriter = new Ffmpeg();
ffmpegWriter->setPath(m_path);
if (TSystem::doesExistFileOrLevel(m_path)) TSystem::deleteFile(m_path);
}
//-----------------------------------------------------------
TLevelWriterMp4::~TLevelWriterMp4() {
// QProcess createMp4;
QStringList preIArgs;
QStringList postIArgs;
int outLx = m_lx;
int outLy = m_ly;
// set scaling
if (m_scale != 0) {
outLx = m_lx * m_scale / 100;
outLy = m_ly * m_scale / 100;
}
// ffmpeg doesn't like resolutions that aren't divisible by 2.
if (outLx % 2 != 0) outLx++;
if (outLy % 2 != 0) outLy++;
// calculate quality (bitrate)
int pixelCount = m_lx * m_ly;
int bitRate = pixelCount / 150; // crude but gets decent values
double quality = m_vidQuality / 100.0;
double tempRate = (double)bitRate * quality;
int finalBitrate = (int)tempRate;
int crf = 51 - (m_vidQuality * 51 / 100);
preIArgs << "-framerate";
preIArgs << QString::number(m_frameRate);
postIArgs << "-pix_fmt";
postIArgs << "yuv420p";
postIArgs << "-s";
postIArgs << QString::number(outLx) + "x" + QString::number(outLy);
postIArgs << "-b";
postIArgs << QString::number(finalBitrate) + "k";
ffmpegWriter->runFfmpeg(preIArgs, postIArgs, false, false, true);
ffmpegWriter->cleanUpFiles();
}
//-----------------------------------------------------------
TImageWriterP TLevelWriterMp4::getFrameWriter(TFrameId fid) {
// if (IOError != 0)
// throw TImageException(m_path, buildMp4ExceptionString(IOError));
if (fid.getLetter() != 0) return TImageWriterP(0);
int index = fid.getNumber();
TImageWriterMp4 *iwg = new TImageWriterMp4(m_path, index, this);
return TImageWriterP(iwg);
}
//-----------------------------------------------------------
void TLevelWriterMp4::setFrameRate(double fps) {
m_frameRate = fps;
ffmpegWriter->setFrameRate(fps);
}
void TLevelWriterMp4::saveSoundTrack(TSoundTrack *st) {
ffmpegWriter->saveSoundTrack(st);
}
//-----------------------------------------------------------
void TLevelWriterMp4::save(const TImageP &img, int frameIndex) {
TRasterImageP image(img);
m_lx = image->getRaster()->getLx();
m_ly = image->getRaster()->getLy();
ffmpegWriter->createIntermediateImage(img, frameIndex);
}
//===========================================================
//
// TImageReaderMp4
//
//===========================================================
class TImageReaderMp4 final : public TImageReader {
public:
int m_frameIndex;
TImageReaderMp4(const TFilePath &path, int index, TLevelReaderMp4 *lra,
TImageInfo *info)
: TImageReader(path), m_lra(lra), m_frameIndex(index), m_info(info) {
m_lra->addRef();
}
~TImageReaderMp4() { m_lra->release(); }
TImageP load() override { return m_lra->load(m_frameIndex); }
TDimension getSize() const { return m_lra->getSize(); }
TRect getBBox() const { return TRect(); }
const TImageInfo *getImageInfo() const override { return m_info; }
private:
TLevelReaderMp4 *m_lra;
TImageInfo *m_info;
// not implemented
TImageReaderMp4(const TImageReaderMp4 &);
TImageReaderMp4 &operator=(const TImageReaderMp4 &src);
};
//===========================================================
//
// TLevelReaderMp4
//
//===========================================================
TLevelReaderMp4::TLevelReaderMp4(const TFilePath &path) : TLevelReader(path) {
ffmpegReader = new Ffmpeg();
ffmpegReader->setPath(m_path);
ffmpegReader->disablePrecompute();
ffmpegFileInfo tempInfo = ffmpegReader->getInfo();
double fps = tempInfo.m_frameRate;
m_frameCount = tempInfo.m_frameCount;
m_size = TDimension(tempInfo.m_lx, tempInfo.m_ly);
m_lx = m_size.lx;
m_ly = m_size.ly;
// set values
m_info = new TImageInfo();
m_info->m_frameRate = fps;
m_info->m_lx = m_lx;
m_info->m_ly = m_ly;
m_info->m_bitsPerSample = 8;
m_info->m_samplePerPixel = 4;
m_info->m_dpix = Stage::standardDpi;
m_info->m_dpiy = Stage::standardDpi;
}
//-----------------------------------------------------------
TLevelReaderMp4::~TLevelReaderMp4() {
// ffmpegReader->cleanUpFiles();
}
//-----------------------------------------------------------
TLevelP TLevelReaderMp4::loadInfo() {
if (m_frameCount == -1) return TLevelP();
TLevelP level;
for (int i = 1; i <= m_frameCount; i++) level->setFrame(i, TImageP());
return level;
}
//-----------------------------------------------------------
TImageReaderP TLevelReaderMp4::getFrameReader(TFrameId fid) {
// if (IOError != 0)
// throw TImageException(m_path, buildAVIExceptionString(IOError));
if (fid.getLetter() != 0) return TImageReaderP(0);
int index = fid.getNumber();
TImageReaderMp4 *irm = new TImageReaderMp4(m_path, index, this, m_info);
return TImageReaderP(irm);
}
//------------------------------------------------------------------------------
TDimension TLevelReaderMp4::getSize() { return m_size; }
//------------------------------------------------
TImageP TLevelReaderMp4::load(int frameIndex) {
if (!ffmpegFramesCreated) {
ffmpegReader->getFramesFromMovie();
ffmpegFramesCreated = true;
}
return ffmpegReader->getImage(frameIndex);
}
Tiio::Mp4WriterProperties::Mp4WriterProperties()
: m_vidQuality("Quality", 1, 100, 90), m_scale("Scale", 1, 100, 100) {
bind(m_vidQuality);
bind(m_scale);
}
void Tiio::Mp4WriterProperties::updateTranslation() {
m_vidQuality.setQStringName(tr("Quality"));
m_scale.setQStringName(tr("Scale"));
}
// Tiio::Reader* Tiio::makeMp4Reader(){ return nullptr; }
// Tiio::Writer* Tiio::makeMp4Writer(){ return nullptr; } | {
"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.
*/
package org.apache.camel.component.jsonata;
import java.util.HashMap;
import java.util.Map;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.IOHelper;
import org.junit.jupiter.api.Test;
/**
* Unit test based on the first sample test from the Jsonata project.
*/
public class JsonataFirstSampleTest extends CamelTestSupport {
@Test
public void testFirstSampleJsonata() throws Exception {
getMockEndpoint("mock:result").expectedBodiesReceived(
IOHelper.loadText(
ResourceHelper.resolveMandatoryResourceAsInputStream(
context, "org/apache/camel/component/jsonata/firstSample/output.json"))
.trim() // Remove the last newline added by IOHelper.loadText()
);
sendBody("direct://start",
ResourceHelper.resolveMandatoryResourceAsInputStream(
context, "org/apache/camel/component/jsonata/firstSample/input.json"));
assertMockEndpointsSatisfied();
}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
final Processor processor = new Processor() {
public void process(Exchange exchange) {
Map<String, String> contextMap = new HashMap<>();
contextMap.put("contextB", "bb");
exchange.getIn().setHeader(JsonataConstants.JSONATA_CONTEXT, contextMap);
}
};
return new RouteBuilder() {
public void configure() {
JsonataComponent jsonata = context.getComponent("jsonata", JsonataComponent.class);
from("direct://start")
.process(processor)
.to("jsonata:org/apache/camel/component/jsonata/firstSample/expressions.json?inputType=JsonString&outputType=JsonString")
.to("mock:result");
}
};
}
}
| {
"pile_set_name": "Github"
} |
PN結 PN接面
SQL注入 SQL隱碼攻擊
SQL注入攻擊 SQL隱碼攻擊
三極管 三極體
下拉列表 下拉選單
並行計算 平行計算
中間件 中介軟體
串口 串列埠
串行 序列
串行端口 串列埠
主引導記錄 主開機記錄
主板 主機板
二極管 二極體
互聯網 網際網路
交互 互動
交互式 互動式
人工智能 人工智慧
代碼 程式碼 代碼
代碼頁 內碼表
以太網 乙太網
任務欄 工作列
任務管理器 工作管理員
仿真 模擬
位圖 點陣圖
低級 低階 低級
便攜式 行動式 攜帶型
保存 儲存
信噪比 訊雜比
信息 資訊
信息安全 資訊保安
信息技術 資訊科技
信息論 資訊理論
信號 訊號 信號
信道 通道
傳感 感測
像素 畫素
僞代碼 虛擬碼
優先級 優先順序
元數據 後設資料
元編程 超程式設計
光標 游標
光盤 光碟
光驅 光碟機
免提 擴音
內存 記憶體
內核 核心
內置 內建
內聯函數 行內函數
全局 全域性
全角 全形
兼容 相容
冒泡排序 氣泡排序
函數 函式
函數式編程 函數語言程式設計
刀片服務器 刀鋒伺服器
分佈式 分散式
分區 分割槽
分辨率 解析度
刷新 重新整理
刻錄 燒錄
前綴 字首
剪切 剪下
剪貼板 剪貼簿
創建 建立
加載 載入
半角 半形
博客 部落格
卸載 解除安裝
原代碼 原始碼
參數 引數
參數表 參數列
句柄 控制代碼
可視化 視覺化
呼出 撥出
呼叫轉移 來電轉駁
命令式編程 指令式程式設計
命令行 命令列
命名空間 名稱空間
哈希 雜湊
單片機 微控制器
回調 回撥
固件 韌體
圖像 影象
圖庫 相簿
圖標 圖示
在線 線上
地址 地址 位址
地址欄 位址列
城域網 都會網路
堆棧 堆疊
場效應管 場效電晶體
壁紙 桌布 壁紙
外置 外接
外鍵 外來鍵
多任務 多工
多態 多型
多線程 多執行緒
字庫 字型檔
字段 欄位
字符 字元
字符串 字串
字符集 字符集
字節 位元組
字體 字型
存儲 儲存
存盤 存檔
宏 巨集
宏內核 單核心
寄存器 暫存器
密鑰 金鑰
實例 例項 實例
實模式 真實模式
審覈 稽覈
寫保護 防寫
寬帶 寬頻
尋址 定址
對話框 對話方塊
對象 物件 對象
導入 匯入
導出 匯出
局域網 區域網
局部 區域性
屏幕 螢幕
屏蔽 遮蔽
嵌套 巢狀
布爾 布林
帶寬 頻寬
引導程序 載入程式
彙編 彙編 組譯
彙編語言 組合語言
後綴 字尾
循環 迴圈 循環
性價比 價效比
性能 效能
截取 擷取
截屏 截圖
打印 列印
打印機 印表機
打開 開啟 打開
拋出 丟擲
持久性 永續性
指針 指標
捲積 摺積
掃描儀 掃描器
掛斷 結束通話
採樣 取樣
採樣率 取樣率
接口 介面
控件 控制元件
插件 外掛
搜索 搜尋
操作數 運算元
操作系統 作業系統
擴展 擴充套件
擴展名 副檔名
支持 支援
支持者 支持者
散列 雜湊
數字 數字 數位
數字印刷 數位印刷
數字電子 數位電子
數字電路 數位電路
數據 資料
數據倉庫 資料倉儲
數據報 資料包
數據庫 資料庫
數據挖掘 資料探勘
數據源 資料來源
數組 陣列
文件 檔案
文件名 檔名
文件夾 資料夾
文件擴展名 副檔名
文字處理 文書處理
文本 文字
文檔 文件
映射 對映
時分多址 分時多重進接
時分複用 分時多工
時鐘頻率 時脈頻率
晶閘管 閘流體
晶體管 電晶體
智能 智慧
最終用戶 終端使用者
有損壓縮 有失真壓縮
服務器 伺服器
本地代碼 原生代碼
析構函數 解構函式
枚舉 列舉
查找 查詢
查看 檢視
桌面型 桌上型
構造函數 建構函式
標識符 識別符號
模塊 模組
模擬 模擬 類比
模擬電子 類比電子
模擬電路 類比電路
權限 許可權
正則表達式 正規表示式
死機 宕機
殺毒 防毒
比特 位元
比特幣 比特幣
比特率 位元率
波分複用 波長分波多工
消息 訊息 消息
添加 新增
源代碼 原始碼
源文件 原始檔
源碼 原始碼
溢出 溢位
演示文稿 簡報
激光 鐳射
激活 啟用
無損壓縮 無失真壓縮
物理內存 實體記憶體
物理地址 實體地址
狀態欄 狀態列
用戶 使用者
用戶名 使用者名稱
界面 介面
異步 非同步
登錄 登入
發佈 釋出
發送 傳送
皮膚 面板
盤片 碟片
盤符 碟符
目標代碼 目的碼
相冊 相簿
矢量 向量
知識產權 智慧財產權
短信 簡訊
硬件 硬體
硬盤 硬碟
碼分多址 分碼多重進接
碼率 位元速率
磁盤 磁碟
磁道 磁軌
社區 社羣 社區
移動硬盤 行動硬碟
移動網絡 行動網路
移動資料 行動資料
移動通信 行動通訊
移動電話 行動電話
程序 程式
程序員 程式設計師
空分多址 分空間多重進接
空分複用 空間多工
窗口 視窗
端口 埠
筆記本電腦 膝上型電腦
算子 運算元
算法 演算法
範式 正規化
粘貼 貼上 粘貼
紅心大戰 傷心小棧
組件 元件
綁定 繫結
網上鄰居 網路上的芳鄰
網卡 網絡卡
網吧 網咖
網絡 網路
網關 閘道器
線程 執行緒
編程 程式設計
編程語言 程式語言
緩存 快取
縮略圖 縮圖
縮進 縮排
總線 匯流排
缺省 預設
聯繫 聯絡
聯繫歷史 通話記錄
聲卡 音效卡
聲明 宣告
脫機 離線
腳本 指令碼
自動轉屏 自動旋轉螢幕
臺式機 桌上型電腦
航天飛機 太空梭
芯片 晶片
菜單 選單 菜單
萬維網 全球資訊網
藍牙 藍芽
虛函數 虛擬函式
虛擬機 虛擬機器
表達式 表示式 運算式
複印 影印
複選按鈕 覈取按鈕
複選框 覈取方塊
視圖 檢視
視頻 視訊
解釋器 直譯器
觸摸 觸控
觸摸屏 觸控式螢幕
計算機安全 電腦保安
計算機科學 電腦科學
訪問 訪問 存取
設備 裝置
設置 設定
註冊機 序號產生器
註冊表 登錄檔
註銷 登出
調制 調變
調度 排程
調用 呼叫
調色板 調色盤
調製解調器 數據機
調試 除錯 偵錯
調試器 偵錯程式
變量 變數
軟件 軟體
軟驅 軟碟機
通信 通訊
通訊卡 通話卡
通配符 萬用字元
連接 連線
連接器 聯結器
進制 進位制
進程 程序 進程
運算符 運算子
運行 執行
過程式編程 程序式程式設計
遞歸 遞迴
遠程 遠端
適配器 介面卡
邏輯門 邏輯閘
重命名 重新命名
重裝 重灌
重載 過載
金屬氧化物半導體 金氧半導體
錄像 錄影
鏈接 連結
鏈表 連結串列
鏡像 映象
門戶網站 入口網站
門電路 閘電路
閃存 快閃記憶體
關係數據庫 關聯式資料庫
隊列 佇列
集成 整合
集成電路 積體電路
集羣 叢集
雲存儲 雲端儲存
雲計算 雲端計算
面向對象 物件導向
面向過程 程序導向
音頻 音訊
頁眉 頁首
頁腳 頁尾
項目 專案
預處理器 前處理器
頭文件 標頭檔案
頻分多址 分頻多重進接
頻分複用 分頻多工
類型 型別
類模板 類别範本
顯像管 映象管
顯卡 顯示卡
顯存 視訊記憶體
飛行模式 飛航模式
首席信息官 資訊長
首席執行官 執行長
首席技術官 技術長
首席運營官 營運長
高性能計算 高效能運算
高端 高階 進階
高級 高階 進階 高級
高速緩存 快取記憶體
默認 預設
默認值 預設值
點擊 點選
鼠標 滑鼠
乍得 查德
也門 葉門
仙童半導體 快捷半導體
伯利茲 貝里斯
佛得角 維德角
傅里葉 傅立葉
克羅地亞 克羅埃西亞
列支敦士登 列支敦斯登
利比里亞 賴比瑞亞
加納 迦納
加蓬 加彭
博茨瓦納 波札那
卡塔爾 卡達
危地馬拉 瓜地馬拉
厄瓜多爾 厄瓜多
厄立特里亞 厄利垂亞
吉布堤 吉布地
哈薩克斯坦 哈薩克
哥斯達黎加 哥斯大黎加
圖瓦盧 吐瓦魯
土庫曼斯坦 土庫曼
圭亞那 蓋亞那
坦桑尼亞 坦尚尼亞
埃塞俄比亞 衣索比亞
基里巴斯 吉里巴斯
塔吉克斯坦 塔吉克
塞拉利昂 獅子山
塞浦路斯 塞普勒斯
塞舌爾 塞席爾
多米尼加 多明尼加
安提瓜和巴布達 安地卡及巴布達
尼日利亞 奈及利亞
尼日爾 尼日
岡比亞 甘比亞
巴巴多斯 巴貝多
巴布亞新幾內亞 巴布亞紐幾內亞
布基納法索 布吉納法索
布隆迪 蒲隆地
帕勞 帛琉
幾內亞比紹 幾內亞比索
意大利 義大利
所羅門羣島 索羅門羣島
文萊 汶萊
斯威士蘭 史瓦濟蘭
斯洛文尼亞 斯洛維尼亞
新西蘭 紐西蘭
格林納達 格瑞那達
格魯吉亞 喬治亞
歐拉 尤拉
毛里塔尼亞 茅利塔尼亞
毛里求斯 模里西斯
沙特阿拉伯 沙烏地阿拉伯
波斯尼亞黑塞哥維那 波士尼亞赫塞哥維納
津巴布韋 辛巴威
洪都拉斯 宏都拉斯
溫納圖萬 那杜
烏茲別克斯坦 烏茲別克
特立尼達和多巴哥 千里達及托巴哥
瑙魯 諾魯
瓦努阿圖 萬那杜
盧旺達 盧安達
科摩羅 葛摩
科特迪瓦 象牙海岸
突尼斯 突尼西亞
索馬里 索馬利亞
老撾 寮國
聖基茨和尼維斯 聖克里斯多福及尼維斯
聖文森特和格林納丁斯 聖文森及格瑞那丁
聖盧西亞 聖露西亞
聖馬力諾 聖馬利諾
肯尼亞 肯亞
莫桑比克 莫三比克
萊索托 賴索托
萬象 永珍
蘇里南 蘇利南
貝寧 貝南
贊比亞 尚比亞
阿塞拜疆 亞塞拜然
阿拉伯聯合酋長國 阿拉伯聯合大公國
香農 夏農
馬爾代夫 馬爾地夫
馬里共和國 馬利共和國
元音 母音
出租車 計程車
咖喱 咖哩
奔馳 賓士
奶酪 乳酪
方便麵 速食麵
涼菜 冷盤
砹 砈
硅 矽
納米 奈米
詞組 片語
蹦極 笨豬跳
輔音 子音
酰 醯
鈁 鍅
鈈 鈽
錇 鉳
鍀 鎝
鎄 鑀
鎇 鋂
鎿 錼
鐦 鉲
鑥 鎦
| {
"pile_set_name": "Github"
} |
'use strict';
var $export = require('./_export')
, $filter = require('./_array-methods')(2);
$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: function filter(callbackfn /* , thisArg */){
return $filter(this, callbackfn, arguments[1]);
}
}); | {
"pile_set_name": "Github"
} |
#!/usr/bin/perl
#
# Tests for backward compatibility with Pod::Parser.
#
# Copyright 2006, 2008-2009, 2012, 2015, 2018 by Russ Allbery <[email protected]>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
#
# SPDX-License-Identifier: GPL-1.0-or-later OR Artistic-1.0-Perl
use 5.006;
use strict;
use warnings;
use lib 't/lib';
use File::Spec;
use Test::More tests => 7;
use Test::Podlators qw(slurp);
# Ensure the modules load properly.
BEGIN {
use_ok('Pod::Man');
use_ok('Pod::Text');
}
# Create a temporary directory to use for output, but don't fail if it already
# exists. If we failed to create it, we'll fail later on. We unfortunately
# have to create files on disk to easily create file handles for testing.
my $tmpdir = File::Spec->catdir('t', 'tmp');
if (!-d $tmpdir) {
mkdir($tmpdir, 0777);
}
# Create some test POD to use to test the -cutting option.
my $infile = File::Spec->catfile('t', 'tmp', "tmp$$.pod");
open(my $input, '>', $infile) or BAIL_OUT("cannot create $infile: $!");
print {$input} "Some random B<text>.\n"
or BAIL_OUT("cannot write to $infile: $!");
close($input) or BAIL_OUT("cannot write to $infile: $!");
# Test the -cutting option with Pod::Man.
my $parser = Pod::Man->new;
isa_ok($parser, 'Pod::Man', 'Pod::Man parser object');
my $outfile = File::Spec->catfile('t', 'tmp', "tmp$$.man");
open(my $output, '>', $outfile) or BAIL_OUT("cannot open $outfile: $!");
$parser->parse_from_file({ -cutting => 0 }, $infile, $output);
close($output) or BAIL_OUT("cannot write to $outfile: $!");
my $got = slurp($outfile, 'man');
is($got, "Some random \\fBtext\\fR.\n", 'Pod::Man -cutting output');
unlink($outfile);
# Likewise for Pod::Text.
$parser = Pod::Text->new;
isa_ok($parser, 'Pod::Text', 'Pod::Text parser object');
$outfile = File::Spec->catfile('t', 'tmp', "tmp$$.txt");
open($output, '>', $outfile) or BAIL_OUT("cannot open $outfile: $!");
$parser->parse_from_file({ -cutting => 0 }, $infile, $output);
close($output) or BAIL_OUT("cannot write to $outfile: $!");
$got = slurp($outfile);
is($got, " Some random text.\n\n", 'Pod::Text -cutting output');
unlink($outfile);
# Rewrite the input file to be fully valid POD since we won't use -cutting.
unlink($infile);
open($input, '>', $infile) or BAIL_OUT("cannot create $infile: $!");
print {$input} "=pod\n\nSome random B<text>.\n"
or BAIL_OUT("cannot write to $infile: $!");
close($input) or BAIL_OUT("cannot write to $infile: $!");
# Now test the pod2text function with a single output. This will send the
# results to standard output, so we need to redirect that to a file.
open($output, '>', $outfile) or BAIL_OUT("cannot open $outfile: $!");
open(my $save_stdout, '>&', STDOUT) or BAIL_OUT("cannot dup stdout: $!");
open(STDOUT, '>&', $output) or BAIL_OUT("cannot redirect stdout: $!");
pod2text($infile);
close($output) or BAIL_OUT("cannot write to $outfile: $!");
open(STDOUT, '>&', $save_stdout) or BAIL_OUT("cannot fix stdout: $!");
close($save_stdout) or BAIL_OUT("cannot close saved stdout: $!");
$got = slurp($outfile);
is($got, " Some random text.\n\n", 'Pod::Text pod2text function');
# Clean up.
unlink($infile, $outfile);
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2004 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.
*/
#ifndef WEBRTC_LIBJINGLE_SESSION_SESSIONSENDTASK_H_
#define WEBRTC_LIBJINGLE_SESSION_SESSIONSENDTASK_H_
#include "webrtc/libjingle/session/sessionmanager.h"
#include "webrtc/libjingle/xmpp/constants.h"
#include "webrtc/libjingle/xmpp/xmppclient.h"
#include "webrtc/libjingle/xmpp/xmppengine.h"
#include "webrtc/libjingle/xmpp/xmpptask.h"
#include "webrtc/base/common.h"
namespace cricket {
// The job of this task is to send an IQ stanza out (after stamping it with
// an ID attribute) and then wait for a response. If not response happens
// within 5 seconds, it will signal failure on a SessionManager. If an error
// happens it will also signal failure. If, however, the send succeeds this
// task will quietly go away.
class SessionSendTask : public buzz::XmppTask {
public:
SessionSendTask(buzz::XmppTaskParentInterface* parent,
SessionManager* session_manager)
: buzz::XmppTask(parent, buzz::XmppEngine::HL_SINGLE),
session_manager_(session_manager) {
set_timeout_seconds(15);
session_manager_->SignalDestroyed.connect(
this, &SessionSendTask::OnSessionManagerDestroyed);
}
virtual ~SessionSendTask() {
SignalDone(this);
}
void Send(const buzz::XmlElement* stanza) {
ASSERT(stanza_.get() == NULL);
// This should be an IQ of type set, result, or error. In the first case,
// we supply an ID. In the others, it should be present.
ASSERT(stanza->Name() == buzz::QN_IQ);
ASSERT(stanza->HasAttr(buzz::QN_TYPE));
if (stanza->Attr(buzz::QN_TYPE) == "set") {
ASSERT(!stanza->HasAttr(buzz::QN_ID));
} else {
ASSERT((stanza->Attr(buzz::QN_TYPE) == "result") ||
(stanza->Attr(buzz::QN_TYPE) == "error"));
ASSERT(stanza->HasAttr(buzz::QN_ID));
}
stanza_.reset(new buzz::XmlElement(*stanza));
if (stanza_->HasAttr(buzz::QN_ID)) {
set_task_id(stanza_->Attr(buzz::QN_ID));
} else {
stanza_->SetAttr(buzz::QN_ID, task_id());
}
}
void OnSessionManagerDestroyed() {
// If the session manager doesn't exist anymore, we should still try to
// send the message, but avoid calling back into the SessionManager.
session_manager_ = NULL;
}
sigslot::signal1<SessionSendTask *> SignalDone;
protected:
virtual int OnTimeout() {
if (session_manager_ != NULL) {
session_manager_->OnFailedSend(stanza_.get(), NULL);
}
return XmppTask::OnTimeout();
}
virtual int ProcessStart() {
SendStanza(stanza_.get());
if (stanza_->Attr(buzz::QN_TYPE) == buzz::STR_SET) {
return STATE_RESPONSE;
} else {
return STATE_DONE;
}
}
virtual int ProcessResponse() {
const buzz::XmlElement* next = NextStanza();
if (next == NULL)
return STATE_BLOCKED;
if (session_manager_ != NULL) {
if (next->Attr(buzz::QN_TYPE) == buzz::STR_RESULT) {
session_manager_->OnIncomingResponse(stanza_.get(), next);
} else {
session_manager_->OnFailedSend(stanza_.get(), next);
}
}
return STATE_DONE;
}
virtual bool HandleStanza(const buzz::XmlElement *stanza) {
if (!MatchResponseIq(stanza,
buzz::Jid(stanza_->Attr(buzz::QN_TO)), task_id()))
return false;
if (stanza->Attr(buzz::QN_TYPE) == buzz::STR_RESULT ||
stanza->Attr(buzz::QN_TYPE) == buzz::STR_ERROR) {
QueueStanza(stanza);
return true;
}
return false;
}
private:
SessionManager *session_manager_;
rtc::scoped_ptr<buzz::XmlElement> stanza_;
};
}
#endif // WEBRTC_P2P_CLIENT_SESSIONSENDTASK_H_
| {
"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.
*/
package org.apache.hadoop.hdfs.server.blockmanagement;
import com.google.common.base.Supplier;
import io.hops.common.INodeUtil;
import io.hops.exception.StorageException;
import io.hops.metadata.hdfs.entity.INodeIdentifier;
import io.hops.transaction.handler.HDFSOperationType;
import io.hops.transaction.handler.HopsTransactionalRequestHandler;
import io.hops.transaction.lock.LockFactory;
import io.hops.transaction.lock.TransactionLockTypes;
import io.hops.transaction.lock.TransactionLocks;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.DFSTestUtil;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.protocol.DatanodeID;
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils;
import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi;
import org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration;
import org.apache.hadoop.hdfs.server.protocol.StorageReport;
import org.apache.hadoop.test.GenericTestUtils;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.hadoop.hdfs.protocol.Block;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
public class TestNameNodePrunesMissingStorages {
static final Log LOG = LogFactory.getLog(TestNameNodePrunesMissingStorages.class);
private static void runTest(final String testCaseName,
final boolean createFiles,
final int numInitialStorages,
final int expectedStoragesAfterTest) throws IOException {
Configuration conf = new HdfsConfiguration();
MiniDFSCluster cluster = null;
try {
cluster = new MiniDFSCluster
.Builder(conf)
.numDataNodes(1)
.storagesPerDatanode(numInitialStorages)
.build();
cluster.waitActive();
final DataNode dn0 = cluster.getDataNodes().get(0);
// Ensure NN knows about the storage.
final DatanodeID dnId = dn0.getDatanodeId();
final DatanodeDescriptor dnDescriptor =
cluster.getNamesystem().getBlockManager().getDatanodeManager().getDatanode(dnId);
assertThat(dnDescriptor.getStorageInfos().length, is(numInitialStorages));
final String bpid = cluster.getNamesystem().getBlockPoolId();
final DatanodeRegistration dnReg = dn0.getDNRegistrationForBP(bpid);
DataNodeTestUtils.triggerBlockReport(dn0);
if (createFiles) {
final Path path = new Path("/", testCaseName);
DFSTestUtil.createFile(
cluster.getFileSystem(), path, 1024, (short) 1, 0x1BAD5EED);
DataNodeTestUtils.triggerBlockReport(dn0);
}
// Generate a fake StorageReport that is missing one storage.
final StorageReport reports[] =
dn0.getFSDataset().getStorageReports(bpid);
final StorageReport prunedReports[] = new StorageReport[numInitialStorages - 1];
System.arraycopy(reports, 0, prunedReports, 0, prunedReports.length);
// Stop the DataNode and send fake heartbeat with missing storage.
cluster.stopDataNode(0);
cluster.getNameNodeRpc().sendHeartbeat(dnReg, prunedReports, 0L, 0L, 0, 0,
0, null);
// Check that the missing storage was pruned.
assertThat(dnDescriptor.getStorageInfos().length, is(expectedStoragesAfterTest));
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}
/**
* Test that the NameNode prunes empty storage volumes that are no longer
* reported by the DataNode.
* @throws IOException
*/
@Test (timeout=300000)
public void testUnusedStorageIsPruned() throws IOException {
// Run the test with 1 storage, after the text expect 0 storages.
runTest(GenericTestUtils.getMethodName(), false, 1, 0);
}
/**
* Verify that the NameNode does not prune storages with blocks
* simply as a result of a heartbeat being sent missing that storage.
*
* @throws IOException
*/
@Test (timeout=300000)
public void testStorageWithBlocksIsNotPruned() throws IOException {
// Run the test with 1 storage, after the text still expect 1 storage.
runTest(GenericTestUtils.getMethodName(), true, 1, 1);
}
/**
* Regression test for HDFS-7960.<p/>
*
* Shutting down a datanode, removing a storage directory, and restarting
* the DataNode should not produce zombie storages.
*/
@Test(timeout=300000)
public void testRemovingStorageDoesNotProduceZombies() throws Exception {
Configuration conf = new HdfsConfiguration();
conf.setInt(DFSConfigKeys.DFS_DATANODE_FAILED_VOLUMES_TOLERATED_KEY, 1);
final int NUM_STORAGES_PER_DN = 2;
final MiniDFSCluster cluster = new MiniDFSCluster
.Builder(conf).numDataNodes(3)
.storagesPerDatanode(NUM_STORAGES_PER_DN)
.build();
try {
cluster.waitActive();
for (DataNode dn : cluster.getDataNodes()) {
assertEquals(NUM_STORAGES_PER_DN,
cluster.getNamesystem().getBlockManager().
getDatanodeManager().getDatanode(dn.getDatanodeId()).
getStorageInfos().length);
}
// Create a file which will end up on all 3 datanodes.
final Path TEST_PATH = new Path("/foo1");
DistributedFileSystem fs = cluster.getFileSystem();
DFSTestUtil.createFile(fs, TEST_PATH, 1024, (short) 3, 0xcafecafe);
for (DataNode dn : cluster.getDataNodes()) {
DataNodeTestUtils.triggerBlockReport(dn);
}
ExtendedBlock block = DFSTestUtil.getFirstBlock(fs, new Path("/foo1"));
final String storageIdToRemove;
String datanodeUuid;
// Find the first storage which this block is in.
Iterator<DatanodeStorageInfo> storageInfoIter = getStorageInfo(block.getLocalBlock(), cluster.getNamesystem().
getBlockManager()).iterator();
assertTrue(storageInfoIter.hasNext());
DatanodeStorageInfo info = storageInfoIter.next();
storageIdToRemove = info.getStorageID();
datanodeUuid = info.getDatanodeDescriptor().getDatanodeUuid();
// Find the DataNode which holds that first storage.
final DataNode datanodeToRemoveStorageFrom;
int datanodeToRemoveStorageFromIdx = 0;
while (true) {
if (datanodeToRemoveStorageFromIdx >= cluster.getDataNodes().size()) {
Assert.fail("failed to find datanode with uuid " + datanodeUuid);
datanodeToRemoveStorageFrom = null;
break;
}
DataNode dn = cluster.getDataNodes().
get(datanodeToRemoveStorageFromIdx);
if (dn.getDatanodeUuid().equals(datanodeUuid)) {
datanodeToRemoveStorageFrom = dn;
break;
}
datanodeToRemoveStorageFromIdx++;
}
// Find the volume within the datanode which holds that first storage.
List<? extends FsVolumeSpi> volumes =
datanodeToRemoveStorageFrom.getFSDataset().getVolumes();
assertEquals(NUM_STORAGES_PER_DN, volumes.size());
String volumeDirectoryToRemove = null;
for (FsVolumeSpi volume : volumes) {
if (volume.getStorageID().equals(storageIdToRemove)) {
volumeDirectoryToRemove = volume.getBasePath();
}
}
// Shut down the datanode and remove the volume.
// Replace the volume directory with a regular file, which will
// cause a volume failure. (If we merely removed the directory,
// it would be re-initialized with a new storage ID.)
assertNotNull(volumeDirectoryToRemove);
datanodeToRemoveStorageFrom.shutdown();
FileUtil.fullyDelete(new File(volumeDirectoryToRemove));
FileOutputStream fos = new FileOutputStream(volumeDirectoryToRemove);
try {
fos.write(1);
} finally {
fos.close();
}
cluster.restartDataNode(datanodeToRemoveStorageFromIdx);
// Wait for the NameNode to remove the storage.
LOG.info("waiting for the datanode to remove " + storageIdToRemove);
GenericTestUtils.waitFor(new Supplier<Boolean>() {
@Override
public Boolean get() {
final DatanodeDescriptor dnDescriptor =
cluster.getNamesystem().getBlockManager().getDatanodeManager().
getDatanode(datanodeToRemoveStorageFrom.getDatanodeUuid());
assertNotNull(dnDescriptor);
DatanodeStorageInfo[] infos = dnDescriptor.getStorageInfos();
for (DatanodeStorageInfo info : infos) {
if (info.getStorageID().equals(storageIdToRemove)) {
LOG.info("Still found storage " + storageIdToRemove + " on " +
info + ".");
return false;
}
}
assertEquals(NUM_STORAGES_PER_DN - 1, infos.length);
return true;
}
}, 10, 30000);
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}
List<DatanodeStorageInfo> getStorageInfo(final Block blk, final BlockManager bm) throws IOException {
return (List<DatanodeStorageInfo>) new HopsTransactionalRequestHandler(HDFSOperationType.TEST) {
INodeIdentifier inodeIdentifier;
@Override
public void setUp() throws StorageException {
inodeIdentifier = INodeUtil.resolveINodeFromBlock(blk);
}
@Override
public void acquireLock(TransactionLocks locks) throws IOException {
LockFactory lf = LockFactory.getInstance();
locks.add(lf.getIndividualINodeLock(TransactionLockTypes.INodeLockType.WRITE,
inodeIdentifier)).add(
lf.getIndividualBlockLock(blk.getBlockId(), inodeIdentifier))
.add(lf.getBlockRelated(LockFactory.BLK.RE,
LockFactory.BLK.IV));
}
@Override
public Object performTask() throws StorageException, IOException {
return bm.blocksMap.storageList(blk);
}
}.handle();
}
}
| {
"pile_set_name": "Github"
} |
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Analyzers Documentation
</h1>
</section>
<!-- Main content -->
<section id="used_settings" class="content">
<div class="box">
<div class="box-body">
<div class="row">
<div class="col-xs-12">
{{BLOC-ANALYZERS}}
</div>
</div>
</div>
</div>
</section> | {
"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.
*/
package org.apache.camel.component.microprofile.metrics;
import java.util.List;
import java.util.function.Function;
import org.apache.camel.Exchange;
import org.eclipse.microprofile.metrics.Metadata;
import org.eclipse.microprofile.metrics.Meter;
import org.eclipse.microprofile.metrics.MetricRegistry;
import org.eclipse.microprofile.metrics.Tag;
import static org.apache.camel.component.microprofile.metrics.MicroProfileMetricsConstants.HEADER_METER_MARK;
public class MicroProfileMetricsMeteredProducer extends AbstractMicroProfileMetricsProducer<Meter> {
public MicroProfileMetricsMeteredProducer(MicroProfileMetricsEndpoint endpoint) {
super(endpoint);
}
@Override
protected void doProcess(Exchange exchange, MicroProfileMetricsEndpoint endpoint, Meter meter) {
Long value = getLongHeader(exchange.getIn(), HEADER_METER_MARK, endpoint.getMark());
if (value != null) {
meter.mark(value);
} else {
meter.mark();
}
}
@Override
protected Function<MetricRegistry, Meter> registerMetric(Metadata metadata, List<Tag> tags) {
return metricRegistry -> metricRegistry.meter(metadata, tags.toArray(new Tag[0]));
}
}
| {
"pile_set_name": "Github"
} |
// +build integration
//Package glacier provides gucumber integration tests support.
package glacier
import (
"github.com/aws/aws-sdk-go/awstesting/integration/smoke"
"github.com/aws/aws-sdk-go/service/glacier"
"github.com/gucumber/gucumber"
)
func init() {
gucumber.Before("@glacier", func() {
gucumber.World["client"] = glacier.New(smoke.Session)
})
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2012 Manning
See the file license.txt for copying permission.
-->
<resources>
<string name="app_name">Hack009</string>
<string name="date">Date:</string>
<string name="picked_date_format">Picked date: %1$d/%2$d/%3$d</string>
</resources>
| {
"pile_set_name": "Github"
} |
==Phrack Inc.==
Volume One, Issue Nine, Phile #7 of 10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(512)-396-1120
The Shack // presents
A Multi-User Chat Program for DEC-10s
Original Program by
TTY-Man
Modified and Clarified by
+++The Mentor+++
October 6th, 1986
Intro: Unlike its more sophisticated older brother, the VAX, the DEC has no
easy-to-use communication system like the VMS PHONE utility. The following
program makes use of the MIC file type available on most DECs. Each user that
wishes to be involved in the conference needs to run the program from his area
using the .DO COM command. The program can be entered with any editor (I
recommend SED if you have VT52 emulation), and should be saved as COM.MIC. The
program does not assume any specific terminal type or emulation. You will
have to know the TTY number of any person you wish to add to the conference,
but this is available through a .SYSTAT command or .R WHO (see below.)
SYSTAT
This is an example of a SYSTAT to used to determine TTY#...
Status of Saturn 7.03.2 at 7:27:51 on 03-Oct-86
Uptime 40:41:14, 77% Null time = 77% Idle + 0% Lost, 9% Overhead
27 Jobs in use out of 128. 27 logged in (LOGMAX of 127), 16 detached.
PPN# TTY# CURR SIZE
19 [OPR] 6 OPR 56+39 HB 18
20 7,20 5 OPR 23+39 HB 24 $
21 2501,1007 56 COMPIL 8+8 ^C 1:34 $
22 66,1012 57 TECO 10+12 TI 39
23 66,1011 62 1022 16+55 TI 36 $
24 [SELF] 64 SYSTAT 23+SPY RN 0 $
26 [OPR] DET STOMPR 10+9 SL 2
27 16011,1003 DET DIRECT 17+32 ^C 30 $
36 [OPR] DET FILDAE 17 HB 1:57
The TTY# is available in the TTY column... DET means that the user is
detached and is unavailable for chatting...
Below is an example of .R WHO to obtain the same information...
/- jobs in use out of 127.
Job Who Line PPN
20 OPERATOR 20 5 7,20
21 DISPONDENT 56 2501,1007
22 ADP-TBO 57 66,1012
23 ADP-MDL 62 66,1011
24 THE MENTOR 64 XXXX,XXX
27 GEO4440103 Det 16011,1003
In each case, I am on TTY# 64...
Anyway, use the following program, it's more convenient that doing a
.SEN <tty> every time you want to send a message. Also, to shut out an
annoying sender, use .SET TTY GAG. To remove, .SET TTY NO GAG... pretty
simple, huh?
start::
!
!Now in loop: 'a 'b 'c 'd 'e 'f
!
.mic input A,"Destination Terminal 1:"
.if ($a="") .goto welcome
.mic input B,"Destination Terminal 2:"
.if ($b="") .goto welcome
.mic input C,"Destination Terminal 3:"
.if ($c="") .goto welcome
.mic input D,"Destination Terminal 4:"
.if ($d="") .goto welcome
.mic input E,"Destination Terminal 5:"
.if ($e="") .goto welcome
.mic input F,"Destination Terminal 6:"
.if ($f="") .goto welcome
welcome::
!Sending Hello Message...
sen 'a Conference Forming on TTYs 'b 'c 'd 'e 'f ... DO COM to these to join'
sen 'b Conference Forming on TTYs 'a 'c 'd 'e 'f ... DO COM to these to join'
sen 'c Conference Forming on TTYs 'a 'b 'd 'e 'f ... DO COM to these to join'
sen 'd Conference Forming on TTYs 'a 'b 'c 'e 'f ... DO COM to these to join'
sen 'e Conference Forming on TTYs 'a 'b 'c 'd 'f ... DO COM to these to join'
sen 'f Conference Forming on TTYs 'a 'b 'c 'd 'e ... DO COM to these to join'
!
!Type /h for help
com::
.mic input G,"T>"
!Checking Commands.. Wait..
.if ($g="/h") .goto help
.if ($g="/k") .goto kill
.if ($g="/l") .goto list
.if ($g="/d") .goto drop
.if ($g="/t") .goto time
.if ($g="/w") .goto who
.if ($g="/u") .goto users
.if ($g="/q") .goto quit
.if ($g="/r") .backto start
.if ($g="/ac") .goto ack
!Transmitting.. Wait..
sen 'a 'g
sen 'b 'g
sen 'c 'g
sen 'd 'g
sen 'e 'g
sen 'f 'g
.backto com
help::
!
! Internal Commands
!
! /H -> This Menu /K -> Kill
! /L -> List Terminals /U -> Users
! /W -> R who /AC-> Alert Caller
! /Q -> Quit
! /R -> Restart/Add
! /T -> Show Date/Time
! /D -> Drop Caller
!
! All Commands must be in lower case.
!
.backto com
list::
!
!Currently Connected To Terminals: 'a 'b 'c 'd 'e 'f
!
.backto com
who::
.revive
.r who
'<silence>
.backto com
users::
.revive
.r users
'<silence>
.BACKTO COM
QUIT::
!
!Call The Shack... 512-396-1120 300/1200 24 hours
!
.mic cancel
drop::
!
!Send Hangup Message:: Enter Terminal Number To Be Disconnected.
!
.mic input h,"Destination Terminal Number:"
.sen 'h <=- Communication Terminated at '<time> -=>
.backto start
ack::
.mic input h,"Destination Terminal Number:"
.sen 'h %TMRR - Timeout Error, Response Required, Please ACKNOWLEDGE!
.backto com
kill::
!
!Send Message To Specific Terminal In A Loop
.mic input n,"Are You Sure (Y/N)?"
.if ($n="y") then .goto k1
!%Function Aborted - Returning To Communication Mode.
.backto com
k1::
.mic input h,"Destination Terminal Number:"
.mic input n,"K>"
dog::
!Transmitting...CTRL-C Aborts!
.sen 'h'n
.backto dog
time::
!
!Current Date : '<date>
!Current Time : '<time>
!
.backto com
Wasn't that neat? A feature that you can implement separately to be a
pain in the ass is the recursive MIC that sends an annoying message to a
specified terminal. It is almost impossible for them to shut you out without
logging out unless they are already gagged.
Just create a small MIC file called BUG.MIC... to do it in two lines,
simply type...
.SEN <tty # goes here> Eat hot photons, Vogon slime!
.DO BUG
That's it! I hope this comes in useful to someone out there! Give us
a call at The Shack... 512-396-1120 300/1200 baud, 24 hours a day... And a
special welcome to all the feds who will doubtlessly be calling since the
number appears in here... we have nothing to hide!
+++The Mentor+++
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2014 Blender Foundation
*
* 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
*/
#ifdef _MSC_VER
# define snprintf _snprintf
# define popen _popen
# define pclose _pclose
# define _CRT_SECURE_NO_WARNINGS
#endif
#include "sdlew.h"
#include "SDL2/SDL.h"
#include "SDL2/SDL_syswm.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# include <windows.h>
/* Utility macros. */
typedef HMODULE DynamicLibrary;
# define dynamic_library_open(path) LoadLibrary(path)
# define dynamic_library_close(lib) FreeLibrary(lib)
# define dynamic_library_find(lib, symbol) GetProcAddress(lib, symbol)
#else
# include <dlfcn.h>
typedef void* DynamicLibrary;
# define dynamic_library_open(path) dlopen(path, RTLD_NOW)
# define dynamic_library_close(lib) dlclose(lib)
# define dynamic_library_find(lib, symbol) dlsym(lib, symbol)
#endif
#define SDL_LIBRARY_FIND_CHECKED(name) name = (t##name *)dynamic_library_find(lib, #name); assert(name);
#define SDL_LIBRARY_FIND(name) name = (t##name *)dynamic_library_find(lib, #name);
static DynamicLibrary lib;
tSDL_GetPlatform *SDL_GetPlatform;
tSDL_memcpy *SDL_memcpy;
#ifndef HAVE_ALLOCA
tSDL_malloc *SDL_malloc;
#endif
tSDL_calloc *SDL_calloc;
tSDL_realloc *SDL_realloc;
tSDL_free *SDL_free;
tSDL_getenv *SDL_getenv;
tSDL_setenv *SDL_setenv;
tSDL_qsort *SDL_qsort;
tSDL_abs *SDL_abs;
tSDL_isdigit *SDL_isdigit;
tSDL_isspace *SDL_isspace;
tSDL_toupper *SDL_toupper;
tSDL_tolower *SDL_tolower;
tSDL_memset *SDL_memset;
tSDL_memmove *SDL_memmove;
tSDL_memcmp *SDL_memcmp;
tSDL_wcslen *SDL_wcslen;
tSDL_wcslcpy *SDL_wcslcpy;
tSDL_wcslcat *SDL_wcslcat;
tSDL_strlen *SDL_strlen;
tSDL_strlcpy *SDL_strlcpy;
tSDL_utf8strlcpy *SDL_utf8strlcpy;
tSDL_strlcat *SDL_strlcat;
tSDL_strdup *SDL_strdup;
tSDL_strrev *SDL_strrev;
tSDL_strupr *SDL_strupr;
tSDL_strlwr *SDL_strlwr;
tSDL_strchr *SDL_strchr;
tSDL_strrchr *SDL_strrchr;
tSDL_strstr *SDL_strstr;
tSDL_itoa *SDL_itoa;
tSDL_uitoa *SDL_uitoa;
tSDL_ltoa *SDL_ltoa;
tSDL_ultoa *SDL_ultoa;
tSDL_lltoa *SDL_lltoa;
tSDL_ulltoa *SDL_ulltoa;
tSDL_atoi *SDL_atoi;
tSDL_atof *SDL_atof;
tSDL_strtol *SDL_strtol;
tSDL_strtoll *SDL_strtoll;
tSDL_strtoull *SDL_strtoull;
tSDL_strtod *SDL_strtod;
tSDL_strcmp *SDL_strcmp;
tSDL_strncmp *SDL_strncmp;
tSDL_strcasecmp *SDL_strcasecmp;
tSDL_strncasecmp *SDL_strncasecmp;
tSDL_sscanf *SDL_sscanf;
tSDL_snprintf *SDL_snprintf;
tSDL_vsnprintf *SDL_vsnprintf;
tSDL_atan *SDL_atan;
tSDL_atan2 *SDL_atan2;
tSDL_ceil *SDL_ceil;
tSDL_copysign *SDL_copysign;
tSDL_cos *SDL_cos;
tSDL_cosf *SDL_cosf;
tSDL_fabs *SDL_fabs;
tSDL_floor *SDL_floor;
tSDL_log *SDL_log;
tSDL_pow *SDL_pow;
tSDL_scalbn *SDL_scalbn;
tSDL_sin *SDL_sin;
tSDL_sinf *SDL_sinf;
tSDL_sqrt *SDL_sqrt;
tSDL_iconv_open *SDL_iconv_open;
tSDL_iconv_close *SDL_iconv_close;
tSDL_iconv *SDL_iconv;
tSDL_iconv_string *SDL_iconv_string;
tSDL_GetNumRenderDrivers *SDL_GetNumRenderDrivers;
tSDL_GetRenderDriverInfo *SDL_GetRenderDriverInfo;
tSDL_CreateWindowAndRenderer *SDL_CreateWindowAndRenderer;
tSDL_CreateRenderer *SDL_CreateRenderer;
tSDL_CreateSoftwareRenderer *SDL_CreateSoftwareRenderer;
tSDL_GetRenderer *SDL_GetRenderer;
tSDL_GetRendererInfo *SDL_GetRendererInfo;
tSDL_GetRendererOutputSize *SDL_GetRendererOutputSize;
tSDL_CreateTexture *SDL_CreateTexture;
tSDL_CreateTextureFromSurface *SDL_CreateTextureFromSurface;
tSDL_QueryTexture *SDL_QueryTexture;
tSDL_SetTextureColorMod *SDL_SetTextureColorMod;
tSDL_GetTextureColorMod *SDL_GetTextureColorMod;
tSDL_SetTextureAlphaMod *SDL_SetTextureAlphaMod;
tSDL_GetTextureAlphaMod *SDL_GetTextureAlphaMod;
tSDL_SetTextureBlendMode *SDL_SetTextureBlendMode;
tSDL_GetTextureBlendMode *SDL_GetTextureBlendMode;
tSDL_UpdateTexture *SDL_UpdateTexture;
tSDL_LockTexture *SDL_LockTexture;
tSDL_UnlockTexture *SDL_UnlockTexture;
tSDL_RenderTargetSupported *SDL_RenderTargetSupported;
tSDL_SetRenderTarget *SDL_SetRenderTarget;
tSDL_GetRenderTarget *SDL_GetRenderTarget;
tSDL_RenderSetLogicalSize *SDL_RenderSetLogicalSize;
tSDL_RenderGetLogicalSize *SDL_RenderGetLogicalSize;
tSDL_RenderSetViewport *SDL_RenderSetViewport;
tSDL_RenderGetViewport *SDL_RenderGetViewport;
tSDL_RenderSetClipRect *SDL_RenderSetClipRect;
tSDL_RenderGetClipRect *SDL_RenderGetClipRect;
tSDL_RenderSetScale *SDL_RenderSetScale;
tSDL_RenderGetScale *SDL_RenderGetScale;
tSDL_SetRenderDrawBlendMode *SDL_SetRenderDrawBlendMode;
tSDL_GetRenderDrawBlendMode *SDL_GetRenderDrawBlendMode;
tSDL_RenderClear *SDL_RenderClear;
tSDL_RenderDrawPoint *SDL_RenderDrawPoint;
tSDL_RenderDrawPoints *SDL_RenderDrawPoints;
tSDL_RenderDrawLine *SDL_RenderDrawLine;
tSDL_RenderDrawLines *SDL_RenderDrawLines;
tSDL_RenderDrawRect *SDL_RenderDrawRect;
tSDL_RenderDrawRects *SDL_RenderDrawRects;
tSDL_RenderFillRect *SDL_RenderFillRect;
tSDL_RenderFillRects *SDL_RenderFillRects;
tSDL_RenderCopy *SDL_RenderCopy;
tSDL_RenderCopyEx *SDL_RenderCopyEx;
tSDL_RenderReadPixels *SDL_RenderReadPixels;
tSDL_RenderPresent *SDL_RenderPresent;
tSDL_DestroyTexture *SDL_DestroyTexture;
tSDL_DestroyRenderer *SDL_DestroyRenderer;
tSDL_GL_BindTexture *SDL_GL_BindTexture;
tSDL_GL_UnbindTexture *SDL_GL_UnbindTexture;
tSDL_LoadObject *SDL_LoadObject;
tSDL_LoadFunction *SDL_LoadFunction;
tSDL_UnloadObject *SDL_UnloadObject;
tSDL_ReportAssertion *SDL_ReportAssertion;
tSDL_SetAssertionHandler *SDL_SetAssertionHandler;
tSDL_GetAssertionReport *SDL_GetAssertionReport;
tSDL_ResetAssertionReport *SDL_ResetAssertionReport;
tSDL_AtomicTryLock *SDL_AtomicTryLock;
tSDL_AtomicLock *SDL_AtomicLock;
tSDL_AtomicUnlock *SDL_AtomicUnlock;
tSDL_HasIntersection *SDL_HasIntersection;
tSDL_IntersectRect *SDL_IntersectRect;
tSDL_UnionRect *SDL_UnionRect;
tSDL_EnclosePoints *SDL_EnclosePoints;
tSDL_IntersectRectAndLine *SDL_IntersectRectAndLine;
tSDL_LogSetAllPriority *SDL_LogSetAllPriority;
tSDL_LogSetPriority *SDL_LogSetPriority;
tSDL_LogGetPriority *SDL_LogGetPriority;
tSDL_LogResetPriorities *SDL_LogResetPriorities;
tSDL_Log *SDL_Log;
tSDL_LogVerbose *SDL_LogVerbose;
tSDL_LogDebug *SDL_LogDebug;
tSDL_LogInfo *SDL_LogInfo;
tSDL_LogWarn *SDL_LogWarn;
tSDL_LogError *SDL_LogError;
tSDL_LogCritical *SDL_LogCritical;
tSDL_LogMessage *SDL_LogMessage;
tSDL_LogMessageV *SDL_LogMessageV;
tSDL_LogGetOutputFunction *SDL_LogGetOutputFunction;
tSDL_LogSetOutputFunction *SDL_LogSetOutputFunction;
tSDL_CreateMutex *SDL_CreateMutex;
tSDL_LockMutex *SDL_LockMutex;
tSDL_TryLockMutex *SDL_TryLockMutex;
tSDL_UnlockMutex *SDL_UnlockMutex;
tSDL_DestroyMutex *SDL_DestroyMutex;
tSDL_CreateSemaphore *SDL_CreateSemaphore;
tSDL_DestroySemaphore *SDL_DestroySemaphore;
tSDL_SemWait *SDL_SemWait;
tSDL_SemTryWait *SDL_SemTryWait;
tSDL_SemWaitTimeout *SDL_SemWaitTimeout;
tSDL_SemPost *SDL_SemPost;
tSDL_SemValue *SDL_SemValue;
tSDL_CreateCond *SDL_CreateCond;
tSDL_DestroyCond *SDL_DestroyCond;
tSDL_CondSignal *SDL_CondSignal;
tSDL_CondBroadcast *SDL_CondBroadcast;
tSDL_CondWait *SDL_CondWait;
tSDL_CondWaitTimeout *SDL_CondWaitTimeout;
tSDL_CreateRGBSurface *SDL_CreateRGBSurface;
tSDL_CreateRGBSurfaceFrom *SDL_CreateRGBSurfaceFrom;
tSDL_FreeSurface *SDL_FreeSurface;
tSDL_SetSurfacePalette *SDL_SetSurfacePalette;
tSDL_LockSurface *SDL_LockSurface;
tSDL_UnlockSurface *SDL_UnlockSurface;
tSDL_LoadBMP_RW *SDL_LoadBMP_RW;
tSDL_SaveBMP_RW *SDL_SaveBMP_RW;
tSDL_SetSurfaceRLE *SDL_SetSurfaceRLE;
tSDL_SetColorKey *SDL_SetColorKey;
tSDL_GetColorKey *SDL_GetColorKey;
tSDL_SetSurfaceColorMod *SDL_SetSurfaceColorMod;
tSDL_GetSurfaceColorMod *SDL_GetSurfaceColorMod;
tSDL_SetSurfaceAlphaMod *SDL_SetSurfaceAlphaMod;
tSDL_GetSurfaceAlphaMod *SDL_GetSurfaceAlphaMod;
tSDL_SetSurfaceBlendMode *SDL_SetSurfaceBlendMode;
tSDL_GetSurfaceBlendMode *SDL_GetSurfaceBlendMode;
tSDL_SetClipRect *SDL_SetClipRect;
tSDL_GetClipRect *SDL_GetClipRect;
tSDL_ConvertSurface *SDL_ConvertSurface;
tSDL_ConvertSurfaceFormat *SDL_ConvertSurfaceFormat;
tSDL_ConvertPixels *SDL_ConvertPixels;
tSDL_FillRect *SDL_FillRect;
tSDL_FillRects *SDL_FillRects;
tSDL_UpperBlit *SDL_UpperBlit;
tSDL_LowerBlit *SDL_LowerBlit;
tSDL_SoftStretch *SDL_SoftStretch;
tSDL_UpperBlitScaled *SDL_UpperBlitScaled;
tSDL_LowerBlitScaled *SDL_LowerBlitScaled;
tSDL_PumpEvents *SDL_PumpEvents;
tSDL_PeepEvents *SDL_PeepEvents;
tSDL_HasEvent *SDL_HasEvent;
tSDL_HasEvents *SDL_HasEvents;
tSDL_FlushEvent *SDL_FlushEvent;
tSDL_FlushEvents *SDL_FlushEvents;
tSDL_PollEvent *SDL_PollEvent;
tSDL_WaitEvent *SDL_WaitEvent;
tSDL_WaitEventTimeout *SDL_WaitEventTimeout;
tSDL_PushEvent *SDL_PushEvent;
tSDL_SetEventFilter *SDL_SetEventFilter;
tSDL_GetEventFilter *SDL_GetEventFilter;
tSDL_AddEventWatch *SDL_AddEventWatch;
tSDL_DelEventWatch *SDL_DelEventWatch;
tSDL_FilterEvents *SDL_FilterEvents;
tSDL_EventState *SDL_EventState;
tSDL_RegisterEvents *SDL_RegisterEvents;
tSDL_GetMouseFocus *SDL_GetMouseFocus;
tSDL_GetMouseState *SDL_GetMouseState;
tSDL_GetRelativeMouseState *SDL_GetRelativeMouseState;
tSDL_WarpMouseInWindow *SDL_WarpMouseInWindow;
tSDL_SetRelativeMouseMode *SDL_SetRelativeMouseMode;
tSDL_GetRelativeMouseMode *SDL_GetRelativeMouseMode;
tSDL_CreateCursor *SDL_CreateCursor;
tSDL_CreateColorCursor *SDL_CreateColorCursor;
tSDL_CreateSystemCursor *SDL_CreateSystemCursor;
tSDL_SetCursor *SDL_SetCursor;
tSDL_GetCursor *SDL_GetCursor;
tSDL_GetDefaultCursor *SDL_GetDefaultCursor;
tSDL_FreeCursor *SDL_FreeCursor;
tSDL_ShowCursor *SDL_ShowCursor;
tSDL_GetThreadName *SDL_GetThreadName;
tSDL_ThreadID *SDL_ThreadID;
tSDL_GetThreadID *SDL_GetThreadID;
tSDL_SetThreadPriority *SDL_SetThreadPriority;
tSDL_WaitThread *SDL_WaitThread;
tSDL_TLSCreate *SDL_TLSCreate;
tSDL_TLSGet *SDL_TLSGet;
tSDL_TLSSet *SDL_TLSSet;
tSDL_GetKeyboardFocus *SDL_GetKeyboardFocus;
tSDL_GetKeyboardState *SDL_GetKeyboardState;
tSDL_GetModState *SDL_GetModState;
tSDL_SetModState *SDL_SetModState;
tSDL_GetKeyFromScancode *SDL_GetKeyFromScancode;
tSDL_GetScancodeFromKey *SDL_GetScancodeFromKey;
tSDL_GetScancodeName *SDL_GetScancodeName;
tSDL_GetScancodeFromName *SDL_GetScancodeFromName;
tSDL_GetKeyName *SDL_GetKeyName;
tSDL_GetKeyFromName *SDL_GetKeyFromName;
tSDL_StartTextInput *SDL_StartTextInput;
tSDL_IsTextInputActive *SDL_IsTextInputActive;
tSDL_StopTextInput *SDL_StopTextInput;
tSDL_SetTextInputRect *SDL_SetTextInputRect;
tSDL_HasScreenKeyboardSupport *SDL_HasScreenKeyboardSupport;
tSDL_IsScreenKeyboardShown *SDL_IsScreenKeyboardShown;
tSDL_GameControllerAddMapping *SDL_GameControllerAddMapping;
tSDL_GameControllerMappingForGUID *SDL_GameControllerMappingForGUID;
tSDL_GameControllerMapping *SDL_GameControllerMapping;
tSDL_IsGameController *SDL_IsGameController;
tSDL_GameControllerNameForIndex *SDL_GameControllerNameForIndex;
tSDL_GameControllerOpen *SDL_GameControllerOpen;
tSDL_GameControllerName *SDL_GameControllerName;
tSDL_GameControllerGetAttached *SDL_GameControllerGetAttached;
tSDL_GameControllerGetJoystick *SDL_GameControllerGetJoystick;
tSDL_GameControllerEventState *SDL_GameControllerEventState;
tSDL_GameControllerUpdate *SDL_GameControllerUpdate;
tSDL_GameControllerGetAxisFromString *SDL_GameControllerGetAxisFromString;
tSDL_GameControllerGetButtonFromString *SDL_GameControllerGetButtonFromString;
tSDL_GameControllerGetButton *SDL_GameControllerGetButton;
tSDL_GameControllerClose *SDL_GameControllerClose;
tSDL_GetNumAudioDrivers *SDL_GetNumAudioDrivers;
tSDL_GetAudioDriver *SDL_GetAudioDriver;
tSDL_AudioInit *SDL_AudioInit;
tSDL_AudioQuit *SDL_AudioQuit;
tSDL_GetCurrentAudioDriver *SDL_GetCurrentAudioDriver;
tSDL_OpenAudio *SDL_OpenAudio;
tSDL_GetNumAudioDevices *SDL_GetNumAudioDevices;
tSDL_GetAudioDeviceName *SDL_GetAudioDeviceName;
tSDL_OpenAudioDevice *SDL_OpenAudioDevice;
tSDL_GetAudioStatus *SDL_GetAudioStatus;
tSDL_PauseAudio *SDL_PauseAudio;
tSDL_PauseAudioDevice *SDL_PauseAudioDevice;
tSDL_LoadWAV_RW *SDL_LoadWAV_RW;
tSDL_FreeWAV *SDL_FreeWAV;
tSDL_BuildAudioCVT *SDL_BuildAudioCVT;
tSDL_ConvertAudio *SDL_ConvertAudio;
tSDL_MixAudio *SDL_MixAudio;
tSDL_MixAudioFormat *SDL_MixAudioFormat;
tSDL_LockAudio *SDL_LockAudio;
tSDL_LockAudioDevice *SDL_LockAudioDevice;
tSDL_UnlockAudio *SDL_UnlockAudio;
tSDL_UnlockAudioDevice *SDL_UnlockAudioDevice;
tSDL_CloseAudio *SDL_CloseAudio;
tSDL_CloseAudioDevice *SDL_CloseAudioDevice;
tSDL_GetNumVideoDrivers *SDL_GetNumVideoDrivers;
tSDL_GetVideoDriver *SDL_GetVideoDriver;
tSDL_VideoInit *SDL_VideoInit;
tSDL_VideoQuit *SDL_VideoQuit;
tSDL_GetCurrentVideoDriver *SDL_GetCurrentVideoDriver;
tSDL_GetNumVideoDisplays *SDL_GetNumVideoDisplays;
tSDL_GetDisplayName *SDL_GetDisplayName;
tSDL_GetDisplayBounds *SDL_GetDisplayBounds;
tSDL_GetNumDisplayModes *SDL_GetNumDisplayModes;
tSDL_GetDisplayMode *SDL_GetDisplayMode;
tSDL_GetDesktopDisplayMode *SDL_GetDesktopDisplayMode;
tSDL_GetCurrentDisplayMode *SDL_GetCurrentDisplayMode;
tSDL_GetClosestDisplayMode *SDL_GetClosestDisplayMode;
tSDL_GetWindowDisplayIndex *SDL_GetWindowDisplayIndex;
tSDL_SetWindowDisplayMode *SDL_SetWindowDisplayMode;
tSDL_GetWindowDisplayMode *SDL_GetWindowDisplayMode;
tSDL_GetWindowPixelFormat *SDL_GetWindowPixelFormat;
tSDL_CreateWindow *SDL_CreateWindow;
tSDL_CreateWindowFrom *SDL_CreateWindowFrom;
tSDL_GetWindowID *SDL_GetWindowID;
tSDL_GetWindowFromID *SDL_GetWindowFromID;
tSDL_GetWindowFlags *SDL_GetWindowFlags;
tSDL_SetWindowTitle *SDL_SetWindowTitle;
tSDL_GetWindowTitle *SDL_GetWindowTitle;
tSDL_SetWindowIcon *SDL_SetWindowIcon;
tSDL_GetWindowData *SDL_GetWindowData;
tSDL_SetWindowPosition *SDL_SetWindowPosition;
tSDL_GetWindowPosition *SDL_GetWindowPosition;
tSDL_SetWindowSize *SDL_SetWindowSize;
tSDL_GetWindowSize *SDL_GetWindowSize;
tSDL_SetWindowMinimumSize *SDL_SetWindowMinimumSize;
tSDL_GetWindowMinimumSize *SDL_GetWindowMinimumSize;
tSDL_SetWindowMaximumSize *SDL_SetWindowMaximumSize;
tSDL_GetWindowMaximumSize *SDL_GetWindowMaximumSize;
tSDL_SetWindowBordered *SDL_SetWindowBordered;
tSDL_ShowWindow *SDL_ShowWindow;
tSDL_HideWindow *SDL_HideWindow;
tSDL_RaiseWindow *SDL_RaiseWindow;
tSDL_MaximizeWindow *SDL_MaximizeWindow;
tSDL_MinimizeWindow *SDL_MinimizeWindow;
tSDL_RestoreWindow *SDL_RestoreWindow;
tSDL_SetWindowFullscreen *SDL_SetWindowFullscreen;
tSDL_GetWindowSurface *SDL_GetWindowSurface;
tSDL_UpdateWindowSurface *SDL_UpdateWindowSurface;
tSDL_UpdateWindowSurfaceRects *SDL_UpdateWindowSurfaceRects;
tSDL_SetWindowGrab *SDL_SetWindowGrab;
tSDL_GetWindowGrab *SDL_GetWindowGrab;
tSDL_SetWindowBrightness *SDL_SetWindowBrightness;
tSDL_GetWindowBrightness *SDL_GetWindowBrightness;
tSDL_SetWindowGammaRamp *SDL_SetWindowGammaRamp;
tSDL_GetWindowGammaRamp *SDL_GetWindowGammaRamp;
tSDL_DestroyWindow *SDL_DestroyWindow;
tSDL_IsScreenSaverEnabled *SDL_IsScreenSaverEnabled;
tSDL_EnableScreenSaver *SDL_EnableScreenSaver;
tSDL_DisableScreenSaver *SDL_DisableScreenSaver;
tSDL_GL_LoadLibrary *SDL_GL_LoadLibrary;
tSDL_GL_GetProcAddress *SDL_GL_GetProcAddress;
tSDL_GL_UnloadLibrary *SDL_GL_UnloadLibrary;
tSDL_GL_ExtensionSupported *SDL_GL_ExtensionSupported;
tSDL_GL_SetAttribute *SDL_GL_SetAttribute;
tSDL_GL_GetAttribute *SDL_GL_GetAttribute;
tSDL_GL_CreateContext *SDL_GL_CreateContext;
tSDL_GL_MakeCurrent *SDL_GL_MakeCurrent;
tSDL_GL_GetCurrentContext *SDL_GL_GetCurrentContext;
tSDL_GL_SetSwapInterval *SDL_GL_SetSwapInterval;
tSDL_GL_GetSwapInterval *SDL_GL_GetSwapInterval;
tSDL_GL_SwapWindow *SDL_GL_SwapWindow;
tSDL_GL_DeleteContext *SDL_GL_DeleteContext;
tSDL_RWFromFile *SDL_RWFromFile;
tSDL_RWFromFP *SDL_RWFromFP;
tSDL_RWFromFP *SDL_RWFromFP;
tSDL_RWFromMem *SDL_RWFromMem;
tSDL_RWFromConstMem *SDL_RWFromConstMem;
tSDL_AllocRW *SDL_AllocRW;
tSDL_FreeRW *SDL_FreeRW;
tSDL_ReadU8 *SDL_ReadU8;
tSDL_ReadLE16 *SDL_ReadLE16;
tSDL_ReadBE16 *SDL_ReadBE16;
tSDL_ReadLE32 *SDL_ReadLE32;
tSDL_ReadBE32 *SDL_ReadBE32;
tSDL_ReadLE64 *SDL_ReadLE64;
tSDL_ReadBE64 *SDL_ReadBE64;
tSDL_WriteU8 *SDL_WriteU8;
tSDL_WriteLE16 *SDL_WriteLE16;
tSDL_WriteBE16 *SDL_WriteBE16;
tSDL_WriteLE32 *SDL_WriteLE32;
tSDL_WriteBE32 *SDL_WriteBE32;
tSDL_WriteLE64 *SDL_WriteLE64;
tSDL_WriteBE64 *SDL_WriteBE64;
tSDL_Init *SDL_Init;
tSDL_InitSubSystem *SDL_InitSubSystem;
tSDL_QuitSubSystem *SDL_QuitSubSystem;
tSDL_WasInit *SDL_WasInit;
tSDL_Quit *SDL_Quit;
tSDL_GetVersion *SDL_GetVersion;
tSDL_GetRevision *SDL_GetRevision;
tSDL_GetRevisionNumber *SDL_GetRevisionNumber;
tSDL_GetTicks *SDL_GetTicks;
tSDL_GetPerformanceCounter *SDL_GetPerformanceCounter;
tSDL_GetPerformanceFrequency *SDL_GetPerformanceFrequency;
tSDL_Delay *SDL_Delay;
tSDL_AddTimer *SDL_AddTimer;
tSDL_RemoveTimer *SDL_RemoveTimer;
tSDL_SetHintWithPriority *SDL_SetHintWithPriority;
tSDL_SetHint *SDL_SetHint;
tSDL_GetHint *SDL_GetHint;
tSDL_AddHintCallback *SDL_AddHintCallback;
tSDL_DelHintCallback *SDL_DelHintCallback;
tSDL_ClearHints *SDL_ClearHints;
tSDL_NumJoysticks *SDL_NumJoysticks;
tSDL_JoystickNameForIndex *SDL_JoystickNameForIndex;
tSDL_JoystickOpen *SDL_JoystickOpen;
tSDL_JoystickName *SDL_JoystickName;
tSDL_JoystickGetDeviceGUID *SDL_JoystickGetDeviceGUID;
tSDL_JoystickGetGUID *SDL_JoystickGetGUID;
tSDL_JoystickGetGUIDFromString *SDL_JoystickGetGUIDFromString;
tSDL_JoystickGetAttached *SDL_JoystickGetAttached;
tSDL_JoystickInstanceID *SDL_JoystickInstanceID;
tSDL_JoystickNumAxes *SDL_JoystickNumAxes;
tSDL_JoystickNumBalls *SDL_JoystickNumBalls;
tSDL_JoystickNumHats *SDL_JoystickNumHats;
tSDL_JoystickNumButtons *SDL_JoystickNumButtons;
tSDL_JoystickUpdate *SDL_JoystickUpdate;
tSDL_JoystickEventState *SDL_JoystickEventState;
tSDL_JoystickGetAxis *SDL_JoystickGetAxis;
tSDL_JoystickGetHat *SDL_JoystickGetHat;
tSDL_JoystickGetBall *SDL_JoystickGetBall;
tSDL_JoystickGetButton *SDL_JoystickGetButton;
tSDL_JoystickClose *SDL_JoystickClose;
tSDL_RecordGesture *SDL_RecordGesture;
tSDL_SaveAllDollarTemplates *SDL_SaveAllDollarTemplates;
tSDL_SaveDollarTemplate *SDL_SaveDollarTemplate;
tSDL_LoadDollarTemplates *SDL_LoadDollarTemplates;
tSDL_NumHaptics *SDL_NumHaptics;
tSDL_HapticName *SDL_HapticName;
tSDL_HapticOpen *SDL_HapticOpen;
tSDL_HapticOpened *SDL_HapticOpened;
tSDL_HapticIndex *SDL_HapticIndex;
tSDL_MouseIsHaptic *SDL_MouseIsHaptic;
tSDL_HapticOpenFromMouse *SDL_HapticOpenFromMouse;
tSDL_JoystickIsHaptic *SDL_JoystickIsHaptic;
tSDL_HapticOpenFromJoystick *SDL_HapticOpenFromJoystick;
tSDL_HapticClose *SDL_HapticClose;
tSDL_HapticNumEffects *SDL_HapticNumEffects;
tSDL_HapticNumEffectsPlaying *SDL_HapticNumEffectsPlaying;
tSDL_HapticNumAxes *SDL_HapticNumAxes;
tSDL_HapticEffectSupported *SDL_HapticEffectSupported;
tSDL_HapticNewEffect *SDL_HapticNewEffect;
tSDL_HapticUpdateEffect *SDL_HapticUpdateEffect;
tSDL_HapticRunEffect *SDL_HapticRunEffect;
tSDL_HapticStopEffect *SDL_HapticStopEffect;
tSDL_HapticDestroyEffect *SDL_HapticDestroyEffect;
tSDL_HapticGetEffectStatus *SDL_HapticGetEffectStatus;
tSDL_HapticSetGain *SDL_HapticSetGain;
tSDL_HapticSetAutocenter *SDL_HapticSetAutocenter;
tSDL_HapticPause *SDL_HapticPause;
tSDL_HapticUnpause *SDL_HapticUnpause;
tSDL_HapticStopAll *SDL_HapticStopAll;
tSDL_HapticRumbleSupported *SDL_HapticRumbleSupported;
tSDL_HapticRumbleInit *SDL_HapticRumbleInit;
tSDL_HapticRumblePlay *SDL_HapticRumblePlay;
tSDL_HapticRumbleStop *SDL_HapticRumbleStop;
tSDL_ShowMessageBox *SDL_ShowMessageBox;
tSDL_ShowSimpleMessageBox *SDL_ShowSimpleMessageBox;
tSDL_PixelFormatEnumToMasks *SDL_PixelFormatEnumToMasks;
tSDL_MasksToPixelFormatEnum *SDL_MasksToPixelFormatEnum;
tSDL_AllocFormat *SDL_AllocFormat;
tSDL_FreeFormat *SDL_FreeFormat;
tSDL_AllocPalette *SDL_AllocPalette;
tSDL_SetPixelFormatPalette *SDL_SetPixelFormatPalette;
tSDL_SetPaletteColors *SDL_SetPaletteColors;
tSDL_FreePalette *SDL_FreePalette;
tSDL_MapRGB *SDL_MapRGB;
tSDL_MapRGBA *SDL_MapRGBA;
tSDL_GetRGB *SDL_GetRGB;
tSDL_GetRGBA *SDL_GetRGBA;
tSDL_CalculateGammaRamp *SDL_CalculateGammaRamp;
tSDL_GetPowerInfo *SDL_GetPowerInfo;
tSDL_GetCPUCount *SDL_GetCPUCount;
tSDL_GetCPUCacheLineSize *SDL_GetCPUCacheLineSize;
tSDL_HasRDTSC *SDL_HasRDTSC;
tSDL_HasAltiVec *SDL_HasAltiVec;
tSDL_HasMMX *SDL_HasMMX;
tSDL_Has3DNow *SDL_Has3DNow;
tSDL_HasSSE *SDL_HasSSE;
tSDL_HasSSE2 *SDL_HasSSE2;
tSDL_HasSSE3 *SDL_HasSSE3;
tSDL_HasSSE41 *SDL_HasSSE41;
tSDL_HasSSE42 *SDL_HasSSE42;
tSDL_GetNumTouchDevices *SDL_GetNumTouchDevices;
tSDL_GetTouchDevice *SDL_GetTouchDevice;
tSDL_GetNumTouchFingers *SDL_GetNumTouchFingers;
tSDL_GetTouchFinger *SDL_GetTouchFinger;
tSDL_SetError *SDL_SetError;
tSDL_GetError *SDL_GetError;
tSDL_ClearError *SDL_ClearError;
tSDL_Error *SDL_Error;
tSDL_SetClipboardText *SDL_SetClipboardText;
tSDL_GetClipboardText *SDL_GetClipboardText;
tSDL_HasClipboardText *SDL_HasClipboardText;
tSDL_GetWindowWMInfo *SDL_GetWindowWMInfo;
static void sdlewExit(void) {
if(lib != NULL) {
/* Ignore errors. */
dynamic_library_close(lib);
lib = NULL;
}
}
/* Implementation function. */
int sdlewInit(void) {
/* Library paths. */
#ifdef _WIN32
/* Expected in c:/windows/system or similar, no path needed. */
const char *paths[] = {"SDL2.dll", NULL};
#elif defined(__APPLE__)
/* Default installation path. */
const char *paths[] = {"/usr/local/cuda/lib/libSDL2.dylib", NULL};
#else
const char *paths[] = {"libSDL2.so",
"libSDL2-2.0.so.0",
"libSDL.so",
NULL};
#endif
static int initialized = 0;
static int result = 0;
int a, error;
SDL_version version;
if (initialized) {
return result;
}
initialized = 1;
error = atexit(sdlewExit);
if (error) {
result = SDLEW_ERROR_ATEXIT_FAILED;
return result;
}
/* Load library. */
for (a = 0; paths[a] != NULL && lib == NULL; ++a) {
lib = dynamic_library_open(paths[a]);
}
if (lib == NULL) {
result = SDLEW_ERROR_OPEN_FAILED;
return result;
}
SDL_LIBRARY_FIND(SDL_GetPlatform);
SDL_LIBRARY_FIND(SDL_memcpy);
#ifndef HAVE_ALLOCA
SDL_LIBRARY_FIND(SDL_malloc);
#endif
SDL_LIBRARY_FIND(SDL_calloc);
SDL_LIBRARY_FIND(SDL_realloc);
SDL_LIBRARY_FIND(SDL_free);
SDL_LIBRARY_FIND(SDL_getenv);
SDL_LIBRARY_FIND(SDL_setenv);
SDL_LIBRARY_FIND(SDL_qsort);
SDL_LIBRARY_FIND(SDL_abs);
SDL_LIBRARY_FIND(SDL_isdigit);
SDL_LIBRARY_FIND(SDL_isspace);
SDL_LIBRARY_FIND(SDL_toupper);
SDL_LIBRARY_FIND(SDL_tolower);
SDL_LIBRARY_FIND(SDL_memset);
SDL_LIBRARY_FIND(SDL_memmove);
SDL_LIBRARY_FIND(SDL_memcmp);
SDL_LIBRARY_FIND(SDL_wcslen);
SDL_LIBRARY_FIND(SDL_wcslcpy);
SDL_LIBRARY_FIND(SDL_wcslcat);
SDL_LIBRARY_FIND(SDL_strlen);
SDL_LIBRARY_FIND(SDL_strlcpy);
SDL_LIBRARY_FIND(SDL_utf8strlcpy);
SDL_LIBRARY_FIND(SDL_strlcat);
SDL_LIBRARY_FIND(SDL_strdup);
SDL_LIBRARY_FIND(SDL_strrev);
SDL_LIBRARY_FIND(SDL_strupr);
SDL_LIBRARY_FIND(SDL_strlwr);
SDL_LIBRARY_FIND(SDL_strchr);
SDL_LIBRARY_FIND(SDL_strrchr);
SDL_LIBRARY_FIND(SDL_strstr);
SDL_LIBRARY_FIND(SDL_itoa);
SDL_LIBRARY_FIND(SDL_uitoa);
SDL_LIBRARY_FIND(SDL_ltoa);
SDL_LIBRARY_FIND(SDL_ultoa);
SDL_LIBRARY_FIND(SDL_lltoa);
SDL_LIBRARY_FIND(SDL_ulltoa);
SDL_LIBRARY_FIND(SDL_atoi);
SDL_LIBRARY_FIND(SDL_atof);
SDL_LIBRARY_FIND(SDL_strtol);
SDL_LIBRARY_FIND(SDL_strtoll);
SDL_LIBRARY_FIND(SDL_strtoull);
SDL_LIBRARY_FIND(SDL_strtod);
SDL_LIBRARY_FIND(SDL_strcmp);
SDL_LIBRARY_FIND(SDL_strncmp);
SDL_LIBRARY_FIND(SDL_strcasecmp);
SDL_LIBRARY_FIND(SDL_strncasecmp);
SDL_LIBRARY_FIND(SDL_sscanf);
SDL_LIBRARY_FIND(SDL_snprintf);
SDL_LIBRARY_FIND(SDL_vsnprintf);
SDL_LIBRARY_FIND(SDL_atan);
SDL_LIBRARY_FIND(SDL_atan2);
SDL_LIBRARY_FIND(SDL_ceil);
SDL_LIBRARY_FIND(SDL_copysign);
SDL_LIBRARY_FIND(SDL_cos);
SDL_LIBRARY_FIND(SDL_cosf);
SDL_LIBRARY_FIND(SDL_fabs);
SDL_LIBRARY_FIND(SDL_floor);
SDL_LIBRARY_FIND(SDL_log);
SDL_LIBRARY_FIND(SDL_pow);
SDL_LIBRARY_FIND(SDL_scalbn);
SDL_LIBRARY_FIND(SDL_sin);
SDL_LIBRARY_FIND(SDL_sinf);
SDL_LIBRARY_FIND(SDL_sqrt);
SDL_LIBRARY_FIND(SDL_iconv_open);
SDL_LIBRARY_FIND(SDL_iconv_close);
SDL_LIBRARY_FIND(SDL_iconv);
SDL_LIBRARY_FIND(SDL_iconv_string);
SDL_LIBRARY_FIND(SDL_GetNumRenderDrivers);
SDL_LIBRARY_FIND(SDL_GetRenderDriverInfo);
SDL_LIBRARY_FIND(SDL_CreateWindowAndRenderer);
SDL_LIBRARY_FIND(SDL_CreateRenderer);
SDL_LIBRARY_FIND(SDL_CreateSoftwareRenderer);
SDL_LIBRARY_FIND(SDL_GetRenderer);
SDL_LIBRARY_FIND(SDL_GetRendererInfo);
SDL_LIBRARY_FIND(SDL_GetRendererOutputSize);
SDL_LIBRARY_FIND(SDL_CreateTexture);
SDL_LIBRARY_FIND(SDL_CreateTextureFromSurface);
SDL_LIBRARY_FIND(SDL_QueryTexture);
SDL_LIBRARY_FIND(SDL_SetTextureColorMod);
SDL_LIBRARY_FIND(SDL_GetTextureColorMod);
SDL_LIBRARY_FIND(SDL_SetTextureAlphaMod);
SDL_LIBRARY_FIND(SDL_GetTextureAlphaMod);
SDL_LIBRARY_FIND(SDL_SetTextureBlendMode);
SDL_LIBRARY_FIND(SDL_GetTextureBlendMode);
SDL_LIBRARY_FIND(SDL_UpdateTexture);
SDL_LIBRARY_FIND(SDL_LockTexture);
SDL_LIBRARY_FIND(SDL_UnlockTexture);
SDL_LIBRARY_FIND(SDL_RenderTargetSupported);
SDL_LIBRARY_FIND(SDL_SetRenderTarget);
SDL_LIBRARY_FIND(SDL_GetRenderTarget);
SDL_LIBRARY_FIND(SDL_RenderSetLogicalSize);
SDL_LIBRARY_FIND(SDL_RenderGetLogicalSize);
SDL_LIBRARY_FIND(SDL_RenderSetViewport);
SDL_LIBRARY_FIND(SDL_RenderGetViewport);
SDL_LIBRARY_FIND(SDL_RenderSetClipRect);
SDL_LIBRARY_FIND(SDL_RenderGetClipRect);
SDL_LIBRARY_FIND(SDL_RenderSetScale);
SDL_LIBRARY_FIND(SDL_RenderGetScale);
SDL_LIBRARY_FIND(SDL_SetRenderDrawBlendMode);
SDL_LIBRARY_FIND(SDL_GetRenderDrawBlendMode);
SDL_LIBRARY_FIND(SDL_RenderClear);
SDL_LIBRARY_FIND(SDL_RenderDrawPoint);
SDL_LIBRARY_FIND(SDL_RenderDrawPoints);
SDL_LIBRARY_FIND(SDL_RenderDrawLine);
SDL_LIBRARY_FIND(SDL_RenderDrawLines);
SDL_LIBRARY_FIND(SDL_RenderDrawRect);
SDL_LIBRARY_FIND(SDL_RenderDrawRects);
SDL_LIBRARY_FIND(SDL_RenderFillRect);
SDL_LIBRARY_FIND(SDL_RenderFillRects);
SDL_LIBRARY_FIND(SDL_RenderCopy);
SDL_LIBRARY_FIND(SDL_RenderCopyEx);
SDL_LIBRARY_FIND(SDL_RenderReadPixels);
SDL_LIBRARY_FIND(SDL_RenderPresent);
SDL_LIBRARY_FIND(SDL_DestroyTexture);
SDL_LIBRARY_FIND(SDL_DestroyRenderer);
SDL_LIBRARY_FIND(SDL_GL_BindTexture);
SDL_LIBRARY_FIND(SDL_GL_UnbindTexture);
SDL_LIBRARY_FIND(SDL_LoadObject);
SDL_LIBRARY_FIND(SDL_LoadFunction);
SDL_LIBRARY_FIND(SDL_UnloadObject);
SDL_LIBRARY_FIND(SDL_ReportAssertion);
SDL_LIBRARY_FIND(SDL_SetAssertionHandler);
SDL_LIBRARY_FIND(SDL_GetAssertionReport);
SDL_LIBRARY_FIND(SDL_ResetAssertionReport);
SDL_LIBRARY_FIND(SDL_AtomicTryLock);
SDL_LIBRARY_FIND(SDL_AtomicLock);
SDL_LIBRARY_FIND(SDL_AtomicUnlock);
SDL_LIBRARY_FIND(SDL_HasIntersection);
SDL_LIBRARY_FIND(SDL_IntersectRect);
SDL_LIBRARY_FIND(SDL_UnionRect);
SDL_LIBRARY_FIND(SDL_EnclosePoints);
SDL_LIBRARY_FIND(SDL_IntersectRectAndLine);
SDL_LIBRARY_FIND(SDL_LogSetAllPriority);
SDL_LIBRARY_FIND(SDL_LogSetPriority);
SDL_LIBRARY_FIND(SDL_LogGetPriority);
SDL_LIBRARY_FIND(SDL_LogResetPriorities);
SDL_LIBRARY_FIND(SDL_Log);
SDL_LIBRARY_FIND(SDL_LogVerbose);
SDL_LIBRARY_FIND(SDL_LogDebug);
SDL_LIBRARY_FIND(SDL_LogInfo);
SDL_LIBRARY_FIND(SDL_LogWarn);
SDL_LIBRARY_FIND(SDL_LogError);
SDL_LIBRARY_FIND(SDL_LogCritical);
SDL_LIBRARY_FIND(SDL_LogMessage);
SDL_LIBRARY_FIND(SDL_LogMessageV);
SDL_LIBRARY_FIND(SDL_LogGetOutputFunction);
SDL_LIBRARY_FIND(SDL_LogSetOutputFunction);
SDL_LIBRARY_FIND(SDL_CreateMutex);
SDL_LIBRARY_FIND(SDL_LockMutex);
SDL_LIBRARY_FIND(SDL_TryLockMutex);
SDL_LIBRARY_FIND(SDL_UnlockMutex);
SDL_LIBRARY_FIND(SDL_DestroyMutex);
SDL_LIBRARY_FIND(SDL_CreateSemaphore);
SDL_LIBRARY_FIND(SDL_DestroySemaphore);
SDL_LIBRARY_FIND(SDL_SemWait);
SDL_LIBRARY_FIND(SDL_SemTryWait);
SDL_LIBRARY_FIND(SDL_SemWaitTimeout);
SDL_LIBRARY_FIND(SDL_SemPost);
SDL_LIBRARY_FIND(SDL_SemValue);
SDL_LIBRARY_FIND(SDL_CreateCond);
SDL_LIBRARY_FIND(SDL_DestroyCond);
SDL_LIBRARY_FIND(SDL_CondSignal);
SDL_LIBRARY_FIND(SDL_CondBroadcast);
SDL_LIBRARY_FIND(SDL_CondWait);
SDL_LIBRARY_FIND(SDL_CondWaitTimeout);
SDL_LIBRARY_FIND(SDL_CreateRGBSurface);
SDL_LIBRARY_FIND(SDL_CreateRGBSurfaceFrom);
SDL_LIBRARY_FIND(SDL_FreeSurface);
SDL_LIBRARY_FIND(SDL_SetSurfacePalette);
SDL_LIBRARY_FIND(SDL_LockSurface);
SDL_LIBRARY_FIND(SDL_UnlockSurface);
SDL_LIBRARY_FIND(SDL_LoadBMP_RW);
SDL_LIBRARY_FIND(SDL_SaveBMP_RW);
SDL_LIBRARY_FIND(SDL_SetSurfaceRLE);
SDL_LIBRARY_FIND(SDL_SetColorKey);
SDL_LIBRARY_FIND(SDL_GetColorKey);
SDL_LIBRARY_FIND(SDL_SetSurfaceColorMod);
SDL_LIBRARY_FIND(SDL_GetSurfaceColorMod);
SDL_LIBRARY_FIND(SDL_SetSurfaceAlphaMod);
SDL_LIBRARY_FIND(SDL_GetSurfaceAlphaMod);
SDL_LIBRARY_FIND(SDL_SetSurfaceBlendMode);
SDL_LIBRARY_FIND(SDL_GetSurfaceBlendMode);
SDL_LIBRARY_FIND(SDL_SetClipRect);
SDL_LIBRARY_FIND(SDL_GetClipRect);
SDL_LIBRARY_FIND(SDL_ConvertSurface);
SDL_LIBRARY_FIND(SDL_ConvertSurfaceFormat);
SDL_LIBRARY_FIND(SDL_ConvertPixels);
SDL_LIBRARY_FIND(SDL_FillRect);
SDL_LIBRARY_FIND(SDL_FillRects);
SDL_LIBRARY_FIND(SDL_UpperBlit);
SDL_LIBRARY_FIND(SDL_LowerBlit);
SDL_LIBRARY_FIND(SDL_SoftStretch);
SDL_LIBRARY_FIND(SDL_UpperBlitScaled);
SDL_LIBRARY_FIND(SDL_LowerBlitScaled);
SDL_LIBRARY_FIND(SDL_PumpEvents);
SDL_LIBRARY_FIND(SDL_PeepEvents);
SDL_LIBRARY_FIND(SDL_HasEvent);
SDL_LIBRARY_FIND(SDL_HasEvents);
SDL_LIBRARY_FIND(SDL_FlushEvent);
SDL_LIBRARY_FIND(SDL_FlushEvents);
SDL_LIBRARY_FIND(SDL_PollEvent);
SDL_LIBRARY_FIND(SDL_WaitEvent);
SDL_LIBRARY_FIND(SDL_WaitEventTimeout);
SDL_LIBRARY_FIND(SDL_PushEvent);
SDL_LIBRARY_FIND(SDL_SetEventFilter);
SDL_LIBRARY_FIND(SDL_GetEventFilter);
SDL_LIBRARY_FIND(SDL_AddEventWatch);
SDL_LIBRARY_FIND(SDL_DelEventWatch);
SDL_LIBRARY_FIND(SDL_FilterEvents);
SDL_LIBRARY_FIND(SDL_EventState);
SDL_LIBRARY_FIND(SDL_RegisterEvents);
SDL_LIBRARY_FIND(SDL_GetMouseFocus);
SDL_LIBRARY_FIND(SDL_GetMouseState);
SDL_LIBRARY_FIND(SDL_GetRelativeMouseState);
SDL_LIBRARY_FIND(SDL_WarpMouseInWindow);
SDL_LIBRARY_FIND(SDL_SetRelativeMouseMode);
SDL_LIBRARY_FIND(SDL_GetRelativeMouseMode);
SDL_LIBRARY_FIND(SDL_CreateCursor);
SDL_LIBRARY_FIND(SDL_CreateColorCursor);
SDL_LIBRARY_FIND(SDL_CreateSystemCursor);
SDL_LIBRARY_FIND(SDL_SetCursor);
SDL_LIBRARY_FIND(SDL_GetCursor);
SDL_LIBRARY_FIND(SDL_GetDefaultCursor);
SDL_LIBRARY_FIND(SDL_FreeCursor);
SDL_LIBRARY_FIND(SDL_ShowCursor);
SDL_LIBRARY_FIND(SDL_GetThreadName);
SDL_LIBRARY_FIND(SDL_ThreadID);
SDL_LIBRARY_FIND(SDL_GetThreadID);
SDL_LIBRARY_FIND(SDL_SetThreadPriority);
SDL_LIBRARY_FIND(SDL_WaitThread);
SDL_LIBRARY_FIND(SDL_TLSCreate);
SDL_LIBRARY_FIND(SDL_TLSGet);
SDL_LIBRARY_FIND(SDL_TLSSet);
SDL_LIBRARY_FIND(SDL_GetKeyboardFocus);
SDL_LIBRARY_FIND(SDL_GetKeyboardState);
SDL_LIBRARY_FIND(SDL_GetModState);
SDL_LIBRARY_FIND(SDL_SetModState);
SDL_LIBRARY_FIND(SDL_GetKeyFromScancode);
SDL_LIBRARY_FIND(SDL_GetScancodeFromKey);
SDL_LIBRARY_FIND(SDL_GetScancodeName);
SDL_LIBRARY_FIND(SDL_GetScancodeFromName);
SDL_LIBRARY_FIND(SDL_GetKeyName);
SDL_LIBRARY_FIND(SDL_GetKeyFromName);
SDL_LIBRARY_FIND(SDL_StartTextInput);
SDL_LIBRARY_FIND(SDL_IsTextInputActive);
SDL_LIBRARY_FIND(SDL_StopTextInput);
SDL_LIBRARY_FIND(SDL_SetTextInputRect);
SDL_LIBRARY_FIND(SDL_HasScreenKeyboardSupport);
SDL_LIBRARY_FIND(SDL_IsScreenKeyboardShown);
SDL_LIBRARY_FIND(SDL_GameControllerAddMapping);
SDL_LIBRARY_FIND(SDL_GameControllerMappingForGUID);
SDL_LIBRARY_FIND(SDL_GameControllerMapping);
SDL_LIBRARY_FIND(SDL_IsGameController);
SDL_LIBRARY_FIND(SDL_GameControllerNameForIndex);
SDL_LIBRARY_FIND(SDL_GameControllerOpen);
SDL_LIBRARY_FIND(SDL_GameControllerName);
SDL_LIBRARY_FIND(SDL_GameControllerGetAttached);
SDL_LIBRARY_FIND(SDL_GameControllerGetJoystick);
SDL_LIBRARY_FIND(SDL_GameControllerEventState);
SDL_LIBRARY_FIND(SDL_GameControllerUpdate);
SDL_LIBRARY_FIND(SDL_GameControllerGetAxisFromString);
SDL_LIBRARY_FIND(SDL_GameControllerGetButtonFromString);
SDL_LIBRARY_FIND(SDL_GameControllerGetButton);
SDL_LIBRARY_FIND(SDL_GameControllerClose);
SDL_LIBRARY_FIND(SDL_GetNumAudioDrivers);
SDL_LIBRARY_FIND(SDL_GetAudioDriver);
SDL_LIBRARY_FIND(SDL_AudioInit);
SDL_LIBRARY_FIND(SDL_AudioQuit);
SDL_LIBRARY_FIND(SDL_GetCurrentAudioDriver);
SDL_LIBRARY_FIND(SDL_OpenAudio);
SDL_LIBRARY_FIND(SDL_GetNumAudioDevices);
SDL_LIBRARY_FIND(SDL_GetAudioDeviceName);
SDL_LIBRARY_FIND(SDL_OpenAudioDevice);
SDL_LIBRARY_FIND(SDL_GetAudioStatus);
SDL_LIBRARY_FIND(SDL_PauseAudio);
SDL_LIBRARY_FIND(SDL_PauseAudioDevice);
SDL_LIBRARY_FIND(SDL_LoadWAV_RW);
SDL_LIBRARY_FIND(SDL_FreeWAV);
SDL_LIBRARY_FIND(SDL_BuildAudioCVT);
SDL_LIBRARY_FIND(SDL_ConvertAudio);
SDL_LIBRARY_FIND(SDL_MixAudio);
SDL_LIBRARY_FIND(SDL_MixAudioFormat);
SDL_LIBRARY_FIND(SDL_LockAudio);
SDL_LIBRARY_FIND(SDL_LockAudioDevice);
SDL_LIBRARY_FIND(SDL_UnlockAudio);
SDL_LIBRARY_FIND(SDL_UnlockAudioDevice);
SDL_LIBRARY_FIND(SDL_CloseAudio);
SDL_LIBRARY_FIND(SDL_CloseAudioDevice);
SDL_LIBRARY_FIND(SDL_GetNumVideoDrivers);
SDL_LIBRARY_FIND(SDL_GetVideoDriver);
SDL_LIBRARY_FIND(SDL_VideoInit);
SDL_LIBRARY_FIND(SDL_VideoQuit);
SDL_LIBRARY_FIND(SDL_GetCurrentVideoDriver);
SDL_LIBRARY_FIND(SDL_GetNumVideoDisplays);
SDL_LIBRARY_FIND(SDL_GetDisplayName);
SDL_LIBRARY_FIND(SDL_GetDisplayBounds);
SDL_LIBRARY_FIND(SDL_GetNumDisplayModes);
SDL_LIBRARY_FIND(SDL_GetDisplayMode);
SDL_LIBRARY_FIND(SDL_GetDesktopDisplayMode);
SDL_LIBRARY_FIND(SDL_GetCurrentDisplayMode);
SDL_LIBRARY_FIND(SDL_GetClosestDisplayMode);
SDL_LIBRARY_FIND(SDL_GetWindowDisplayIndex);
SDL_LIBRARY_FIND(SDL_SetWindowDisplayMode);
SDL_LIBRARY_FIND(SDL_GetWindowDisplayMode);
SDL_LIBRARY_FIND(SDL_GetWindowPixelFormat);
SDL_LIBRARY_FIND(SDL_CreateWindow);
SDL_LIBRARY_FIND(SDL_CreateWindowFrom);
SDL_LIBRARY_FIND(SDL_GetWindowID);
SDL_LIBRARY_FIND(SDL_GetWindowFromID);
SDL_LIBRARY_FIND(SDL_GetWindowFlags);
SDL_LIBRARY_FIND(SDL_SetWindowTitle);
SDL_LIBRARY_FIND(SDL_GetWindowTitle);
SDL_LIBRARY_FIND(SDL_SetWindowIcon);
SDL_LIBRARY_FIND(SDL_GetWindowData);
SDL_LIBRARY_FIND(SDL_SetWindowPosition);
SDL_LIBRARY_FIND(SDL_GetWindowPosition);
SDL_LIBRARY_FIND(SDL_SetWindowSize);
SDL_LIBRARY_FIND(SDL_GetWindowSize);
SDL_LIBRARY_FIND(SDL_SetWindowMinimumSize);
SDL_LIBRARY_FIND(SDL_GetWindowMinimumSize);
SDL_LIBRARY_FIND(SDL_SetWindowMaximumSize);
SDL_LIBRARY_FIND(SDL_GetWindowMaximumSize);
SDL_LIBRARY_FIND(SDL_SetWindowBordered);
SDL_LIBRARY_FIND(SDL_ShowWindow);
SDL_LIBRARY_FIND(SDL_HideWindow);
SDL_LIBRARY_FIND(SDL_RaiseWindow);
SDL_LIBRARY_FIND(SDL_MaximizeWindow);
SDL_LIBRARY_FIND(SDL_MinimizeWindow);
SDL_LIBRARY_FIND(SDL_RestoreWindow);
SDL_LIBRARY_FIND(SDL_SetWindowFullscreen);
SDL_LIBRARY_FIND(SDL_GetWindowSurface);
SDL_LIBRARY_FIND(SDL_UpdateWindowSurface);
SDL_LIBRARY_FIND(SDL_UpdateWindowSurfaceRects);
SDL_LIBRARY_FIND(SDL_SetWindowGrab);
SDL_LIBRARY_FIND(SDL_GetWindowGrab);
SDL_LIBRARY_FIND(SDL_SetWindowBrightness);
SDL_LIBRARY_FIND(SDL_GetWindowBrightness);
SDL_LIBRARY_FIND(SDL_SetWindowGammaRamp);
SDL_LIBRARY_FIND(SDL_GetWindowGammaRamp);
SDL_LIBRARY_FIND(SDL_DestroyWindow);
SDL_LIBRARY_FIND(SDL_IsScreenSaverEnabled);
SDL_LIBRARY_FIND(SDL_EnableScreenSaver);
SDL_LIBRARY_FIND(SDL_DisableScreenSaver);
SDL_LIBRARY_FIND(SDL_GL_LoadLibrary);
SDL_LIBRARY_FIND(SDL_GL_GetProcAddress);
SDL_LIBRARY_FIND(SDL_GL_UnloadLibrary);
SDL_LIBRARY_FIND(SDL_GL_ExtensionSupported);
SDL_LIBRARY_FIND(SDL_GL_SetAttribute);
SDL_LIBRARY_FIND(SDL_GL_GetAttribute);
SDL_LIBRARY_FIND(SDL_GL_CreateContext);
SDL_LIBRARY_FIND(SDL_GL_MakeCurrent);
SDL_LIBRARY_FIND(SDL_GL_GetCurrentContext);
SDL_LIBRARY_FIND(SDL_GL_SetSwapInterval);
SDL_LIBRARY_FIND(SDL_GL_GetSwapInterval);
SDL_LIBRARY_FIND(SDL_GL_SwapWindow);
SDL_LIBRARY_FIND(SDL_GL_DeleteContext);
SDL_LIBRARY_FIND(SDL_RWFromFile);
SDL_LIBRARY_FIND(SDL_RWFromFP);
SDL_LIBRARY_FIND(SDL_RWFromFP);
SDL_LIBRARY_FIND(SDL_RWFromMem);
SDL_LIBRARY_FIND(SDL_RWFromConstMem);
SDL_LIBRARY_FIND(SDL_AllocRW);
SDL_LIBRARY_FIND(SDL_FreeRW);
SDL_LIBRARY_FIND(SDL_ReadU8);
SDL_LIBRARY_FIND(SDL_ReadLE16);
SDL_LIBRARY_FIND(SDL_ReadBE16);
SDL_LIBRARY_FIND(SDL_ReadLE32);
SDL_LIBRARY_FIND(SDL_ReadBE32);
SDL_LIBRARY_FIND(SDL_ReadLE64);
SDL_LIBRARY_FIND(SDL_ReadBE64);
SDL_LIBRARY_FIND(SDL_WriteU8);
SDL_LIBRARY_FIND(SDL_WriteLE16);
SDL_LIBRARY_FIND(SDL_WriteBE16);
SDL_LIBRARY_FIND(SDL_WriteLE32);
SDL_LIBRARY_FIND(SDL_WriteBE32);
SDL_LIBRARY_FIND(SDL_WriteLE64);
SDL_LIBRARY_FIND(SDL_WriteBE64);
SDL_LIBRARY_FIND(SDL_Init);
SDL_LIBRARY_FIND(SDL_InitSubSystem);
SDL_LIBRARY_FIND(SDL_QuitSubSystem);
SDL_LIBRARY_FIND(SDL_WasInit);
SDL_LIBRARY_FIND(SDL_Quit);
SDL_LIBRARY_FIND(SDL_GetVersion);
SDL_LIBRARY_FIND(SDL_GetRevision);
SDL_LIBRARY_FIND(SDL_GetRevisionNumber);
SDL_LIBRARY_FIND(SDL_GetTicks);
SDL_LIBRARY_FIND(SDL_GetPerformanceCounter);
SDL_LIBRARY_FIND(SDL_GetPerformanceFrequency);
SDL_LIBRARY_FIND(SDL_Delay);
SDL_LIBRARY_FIND(SDL_AddTimer);
SDL_LIBRARY_FIND(SDL_RemoveTimer);
SDL_LIBRARY_FIND(SDL_SetHintWithPriority);
SDL_LIBRARY_FIND(SDL_SetHint);
SDL_LIBRARY_FIND(SDL_GetHint);
SDL_LIBRARY_FIND(SDL_AddHintCallback);
SDL_LIBRARY_FIND(SDL_DelHintCallback);
SDL_LIBRARY_FIND(SDL_ClearHints);
SDL_LIBRARY_FIND(SDL_NumJoysticks);
SDL_LIBRARY_FIND(SDL_JoystickNameForIndex);
SDL_LIBRARY_FIND(SDL_JoystickOpen);
SDL_LIBRARY_FIND(SDL_JoystickName);
SDL_LIBRARY_FIND(SDL_JoystickGetDeviceGUID);
SDL_LIBRARY_FIND(SDL_JoystickGetGUID);
SDL_LIBRARY_FIND(SDL_JoystickGetGUIDFromString);
SDL_LIBRARY_FIND(SDL_JoystickGetAttached);
SDL_LIBRARY_FIND(SDL_JoystickInstanceID);
SDL_LIBRARY_FIND(SDL_JoystickNumAxes);
SDL_LIBRARY_FIND(SDL_JoystickNumBalls);
SDL_LIBRARY_FIND(SDL_JoystickNumHats);
SDL_LIBRARY_FIND(SDL_JoystickNumButtons);
SDL_LIBRARY_FIND(SDL_JoystickUpdate);
SDL_LIBRARY_FIND(SDL_JoystickEventState);
SDL_LIBRARY_FIND(SDL_JoystickGetAxis);
SDL_LIBRARY_FIND(SDL_JoystickGetHat);
SDL_LIBRARY_FIND(SDL_JoystickGetBall);
SDL_LIBRARY_FIND(SDL_JoystickGetButton);
SDL_LIBRARY_FIND(SDL_JoystickClose);
SDL_LIBRARY_FIND(SDL_RecordGesture);
SDL_LIBRARY_FIND(SDL_SaveAllDollarTemplates);
SDL_LIBRARY_FIND(SDL_SaveDollarTemplate);
SDL_LIBRARY_FIND(SDL_LoadDollarTemplates);
SDL_LIBRARY_FIND(SDL_NumHaptics);
SDL_LIBRARY_FIND(SDL_HapticName);
SDL_LIBRARY_FIND(SDL_HapticOpen);
SDL_LIBRARY_FIND(SDL_HapticOpened);
SDL_LIBRARY_FIND(SDL_HapticIndex);
SDL_LIBRARY_FIND(SDL_MouseIsHaptic);
SDL_LIBRARY_FIND(SDL_HapticOpenFromMouse);
SDL_LIBRARY_FIND(SDL_JoystickIsHaptic);
SDL_LIBRARY_FIND(SDL_HapticOpenFromJoystick);
SDL_LIBRARY_FIND(SDL_HapticClose);
SDL_LIBRARY_FIND(SDL_HapticNumEffects);
SDL_LIBRARY_FIND(SDL_HapticNumEffectsPlaying);
SDL_LIBRARY_FIND(SDL_HapticNumAxes);
SDL_LIBRARY_FIND(SDL_HapticEffectSupported);
SDL_LIBRARY_FIND(SDL_HapticNewEffect);
SDL_LIBRARY_FIND(SDL_HapticUpdateEffect);
SDL_LIBRARY_FIND(SDL_HapticRunEffect);
SDL_LIBRARY_FIND(SDL_HapticStopEffect);
SDL_LIBRARY_FIND(SDL_HapticDestroyEffect);
SDL_LIBRARY_FIND(SDL_HapticGetEffectStatus);
SDL_LIBRARY_FIND(SDL_HapticSetGain);
SDL_LIBRARY_FIND(SDL_HapticSetAutocenter);
SDL_LIBRARY_FIND(SDL_HapticPause);
SDL_LIBRARY_FIND(SDL_HapticUnpause);
SDL_LIBRARY_FIND(SDL_HapticStopAll);
SDL_LIBRARY_FIND(SDL_HapticRumbleSupported);
SDL_LIBRARY_FIND(SDL_HapticRumbleInit);
SDL_LIBRARY_FIND(SDL_HapticRumblePlay);
SDL_LIBRARY_FIND(SDL_HapticRumbleStop);
SDL_LIBRARY_FIND(SDL_ShowMessageBox);
SDL_LIBRARY_FIND(SDL_ShowSimpleMessageBox);
SDL_LIBRARY_FIND(SDL_PixelFormatEnumToMasks);
SDL_LIBRARY_FIND(SDL_MasksToPixelFormatEnum);
SDL_LIBRARY_FIND(SDL_AllocFormat);
SDL_LIBRARY_FIND(SDL_FreeFormat);
SDL_LIBRARY_FIND(SDL_AllocPalette);
SDL_LIBRARY_FIND(SDL_SetPixelFormatPalette);
SDL_LIBRARY_FIND(SDL_SetPaletteColors);
SDL_LIBRARY_FIND(SDL_FreePalette);
SDL_LIBRARY_FIND(SDL_MapRGB);
SDL_LIBRARY_FIND(SDL_MapRGBA);
SDL_LIBRARY_FIND(SDL_GetRGB);
SDL_LIBRARY_FIND(SDL_GetRGBA);
SDL_LIBRARY_FIND(SDL_CalculateGammaRamp);
SDL_LIBRARY_FIND(SDL_GetPowerInfo);
SDL_LIBRARY_FIND(SDL_GetCPUCount);
SDL_LIBRARY_FIND(SDL_GetCPUCacheLineSize);
SDL_LIBRARY_FIND(SDL_HasRDTSC);
SDL_LIBRARY_FIND(SDL_HasAltiVec);
SDL_LIBRARY_FIND(SDL_HasMMX);
SDL_LIBRARY_FIND(SDL_Has3DNow);
SDL_LIBRARY_FIND(SDL_HasSSE);
SDL_LIBRARY_FIND(SDL_HasSSE2);
SDL_LIBRARY_FIND(SDL_HasSSE3);
SDL_LIBRARY_FIND(SDL_HasSSE41);
SDL_LIBRARY_FIND(SDL_HasSSE42);
SDL_LIBRARY_FIND(SDL_GetNumTouchDevices);
SDL_LIBRARY_FIND(SDL_GetTouchDevice);
SDL_LIBRARY_FIND(SDL_GetNumTouchFingers);
SDL_LIBRARY_FIND(SDL_GetTouchFinger);
SDL_LIBRARY_FIND(SDL_SetError);
SDL_LIBRARY_FIND(SDL_GetError);
SDL_LIBRARY_FIND(SDL_ClearError);
SDL_LIBRARY_FIND(SDL_Error);
SDL_LIBRARY_FIND(SDL_SetClipboardText);
SDL_LIBRARY_FIND(SDL_GetClipboardText);
SDL_LIBRARY_FIND(SDL_HasClipboardText);
SDL_LIBRARY_FIND(SDL_GetWindowWMInfo);
if (SDL_GetVersion == NULL) {
result = SDLEW_ERROR_VERSION;
}
else {
SDL_GetVersion(&version);
if(version.major < 2) {
result = SDLEW_ERROR_VERSION;
}
else {
result = SDLEW_SUCCESS;
}
}
return result;
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Concrete\Core\Backup\ContentImporter\Importer\Routine;
use Concrete\Core\Entity\Geolocator;
use Concrete\Core\Geolocator\GeolocatorService;
use Concrete\Core\Support\Facade\Application;
class ImportGeolocatorsRoutine extends AbstractRoutine
{
public function getHandle()
{
return 'geolocators';
}
protected function unserializeOption($value)
{
$result = @json_decode($value, true);
if ($result === null && trim(strtolower($value)) !== 'null') {
$result = $value;
}
return $result;
}
public function import(\SimpleXMLElement $sx)
{
if (isset($sx->geolocators) && !empty($sx->geolocators->geolocator)) {
$app = Application::getFacadeApplication();
$service = $app->make(GeolocatorService::class);
$em = $service->getEntityManager();
foreach ($sx->geolocators->geolocator as $xGeolocator) {
$handle = (string) $xGeolocator['handle'];
if ($service->getByHandle($handle) === null) {
$package = empty($xGeolocator['package']) ? null : static::getPackageObject($xGeolocator['package']);
$geolocator = Geolocator::create($handle, $xGeolocator['name'], $package);
if (isset($xGeolocator['description'])) {
$geolocator->setGeolocatorDescription($xGeolocator['description']);
}
if (!empty($xGeolocator->option)) {
$configuration = [];
foreach ($xGeolocator->option as $xOption) {
$configuration[(string) $xOption['name']] = $this->unserializeOption((string) $xOption);
}
$geolocator->setGeolocatorConfiguration($configuration);
}
if (!empty($xGeolocator['active'])) {
$service->setCurrent($geolocator);
}
$em->persist($geolocator);
$em->flush($geolocator);
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
//
// Copyright 2016, Sander van Harmelen
//
// 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 cloudstack
import (
"encoding/json"
"fmt"
"net/url"
"strconv"
"strings"
)
type CreateVlanIpRangeParams struct {
p map[string]interface{}
}
func (p *CreateVlanIpRangeParams) toURLValues() url.Values {
u := url.Values{}
if p.p == nil {
return u
}
if v, found := p.p["account"]; found {
u.Set("account", v.(string))
}
if v, found := p.p["domainid"]; found {
u.Set("domainid", v.(string))
}
if v, found := p.p["endip"]; found {
u.Set("endip", v.(string))
}
if v, found := p.p["endipv6"]; found {
u.Set("endipv6", v.(string))
}
if v, found := p.p["forvirtualnetwork"]; found {
vv := strconv.FormatBool(v.(bool))
u.Set("forvirtualnetwork", vv)
}
if v, found := p.p["gateway"]; found {
u.Set("gateway", v.(string))
}
if v, found := p.p["ip6cidr"]; found {
u.Set("ip6cidr", v.(string))
}
if v, found := p.p["ip6gateway"]; found {
u.Set("ip6gateway", v.(string))
}
if v, found := p.p["netmask"]; found {
u.Set("netmask", v.(string))
}
if v, found := p.p["networkid"]; found {
u.Set("networkid", v.(string))
}
if v, found := p.p["physicalnetworkid"]; found {
u.Set("physicalnetworkid", v.(string))
}
if v, found := p.p["podid"]; found {
u.Set("podid", v.(string))
}
if v, found := p.p["projectid"]; found {
u.Set("projectid", v.(string))
}
if v, found := p.p["startip"]; found {
u.Set("startip", v.(string))
}
if v, found := p.p["startipv6"]; found {
u.Set("startipv6", v.(string))
}
if v, found := p.p["vlan"]; found {
u.Set("vlan", v.(string))
}
if v, found := p.p["zoneid"]; found {
u.Set("zoneid", v.(string))
}
return u
}
func (p *CreateVlanIpRangeParams) SetAccount(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["account"] = v
return
}
func (p *CreateVlanIpRangeParams) SetDomainid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["domainid"] = v
return
}
func (p *CreateVlanIpRangeParams) SetEndip(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["endip"] = v
return
}
func (p *CreateVlanIpRangeParams) SetEndipv6(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["endipv6"] = v
return
}
func (p *CreateVlanIpRangeParams) SetForvirtualnetwork(v bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["forvirtualnetwork"] = v
return
}
func (p *CreateVlanIpRangeParams) SetGateway(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["gateway"] = v
return
}
func (p *CreateVlanIpRangeParams) SetIp6cidr(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["ip6cidr"] = v
return
}
func (p *CreateVlanIpRangeParams) SetIp6gateway(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["ip6gateway"] = v
return
}
func (p *CreateVlanIpRangeParams) SetNetmask(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["netmask"] = v
return
}
func (p *CreateVlanIpRangeParams) SetNetworkid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["networkid"] = v
return
}
func (p *CreateVlanIpRangeParams) SetPhysicalnetworkid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["physicalnetworkid"] = v
return
}
func (p *CreateVlanIpRangeParams) SetPodid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["podid"] = v
return
}
func (p *CreateVlanIpRangeParams) SetProjectid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["projectid"] = v
return
}
func (p *CreateVlanIpRangeParams) SetStartip(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["startip"] = v
return
}
func (p *CreateVlanIpRangeParams) SetStartipv6(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["startipv6"] = v
return
}
func (p *CreateVlanIpRangeParams) SetVlan(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["vlan"] = v
return
}
func (p *CreateVlanIpRangeParams) SetZoneid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["zoneid"] = v
return
}
// You should always use this function to get a new CreateVlanIpRangeParams instance,
// as then you are sure you have configured all required params
func (s *VLANService) NewCreateVlanIpRangeParams() *CreateVlanIpRangeParams {
p := &CreateVlanIpRangeParams{}
p.p = make(map[string]interface{})
return p
}
// Creates a VLAN IP range.
func (s *VLANService) CreateVlanIpRange(p *CreateVlanIpRangeParams) (*CreateVlanIpRangeResponse, error) {
resp, err := s.cs.newRequest("createVlanIpRange", p.toURLValues())
if err != nil {
return nil, err
}
var r CreateVlanIpRangeResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
}
type CreateVlanIpRangeResponse struct {
Account string `json:"account,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
Domainid string `json:"domainid,omitempty"`
Endip string `json:"endip,omitempty"`
Endipv6 string `json:"endipv6,omitempty"`
Forvirtualnetwork bool `json:"forvirtualnetwork,omitempty"`
Gateway string `json:"gateway,omitempty"`
Id string `json:"id,omitempty"`
Ip6cidr string `json:"ip6cidr,omitempty"`
Ip6gateway string `json:"ip6gateway,omitempty"`
Netmask string `json:"netmask,omitempty"`
Networkid string `json:"networkid,omitempty"`
Physicalnetworkid string `json:"physicalnetworkid,omitempty"`
Podid string `json:"podid,omitempty"`
Podname string `json:"podname,omitempty"`
Project string `json:"project,omitempty"`
Projectid string `json:"projectid,omitempty"`
Startip string `json:"startip,omitempty"`
Startipv6 string `json:"startipv6,omitempty"`
Vlan string `json:"vlan,omitempty"`
Zoneid string `json:"zoneid,omitempty"`
}
type DeleteVlanIpRangeParams struct {
p map[string]interface{}
}
func (p *DeleteVlanIpRangeParams) toURLValues() url.Values {
u := url.Values{}
if p.p == nil {
return u
}
if v, found := p.p["id"]; found {
u.Set("id", v.(string))
}
return u
}
func (p *DeleteVlanIpRangeParams) SetId(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["id"] = v
return
}
// You should always use this function to get a new DeleteVlanIpRangeParams instance,
// as then you are sure you have configured all required params
func (s *VLANService) NewDeleteVlanIpRangeParams(id string) *DeleteVlanIpRangeParams {
p := &DeleteVlanIpRangeParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
}
// Creates a VLAN IP range.
func (s *VLANService) DeleteVlanIpRange(p *DeleteVlanIpRangeParams) (*DeleteVlanIpRangeResponse, error) {
resp, err := s.cs.newRequest("deleteVlanIpRange", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteVlanIpRangeResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
}
type DeleteVlanIpRangeResponse struct {
Displaytext string `json:"displaytext,omitempty"`
Success string `json:"success,omitempty"`
}
type ListVlanIpRangesParams struct {
p map[string]interface{}
}
func (p *ListVlanIpRangesParams) toURLValues() url.Values {
u := url.Values{}
if p.p == nil {
return u
}
if v, found := p.p["account"]; found {
u.Set("account", v.(string))
}
if v, found := p.p["domainid"]; found {
u.Set("domainid", v.(string))
}
if v, found := p.p["forvirtualnetwork"]; found {
vv := strconv.FormatBool(v.(bool))
u.Set("forvirtualnetwork", vv)
}
if v, found := p.p["id"]; found {
u.Set("id", v.(string))
}
if v, found := p.p["keyword"]; found {
u.Set("keyword", v.(string))
}
if v, found := p.p["networkid"]; found {
u.Set("networkid", v.(string))
}
if v, found := p.p["page"]; found {
vv := strconv.Itoa(v.(int))
u.Set("page", vv)
}
if v, found := p.p["pagesize"]; found {
vv := strconv.Itoa(v.(int))
u.Set("pagesize", vv)
}
if v, found := p.p["physicalnetworkid"]; found {
u.Set("physicalnetworkid", v.(string))
}
if v, found := p.p["podid"]; found {
u.Set("podid", v.(string))
}
if v, found := p.p["projectid"]; found {
u.Set("projectid", v.(string))
}
if v, found := p.p["vlan"]; found {
u.Set("vlan", v.(string))
}
if v, found := p.p["zoneid"]; found {
u.Set("zoneid", v.(string))
}
return u
}
func (p *ListVlanIpRangesParams) SetAccount(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["account"] = v
return
}
func (p *ListVlanIpRangesParams) SetDomainid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["domainid"] = v
return
}
func (p *ListVlanIpRangesParams) SetForvirtualnetwork(v bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["forvirtualnetwork"] = v
return
}
func (p *ListVlanIpRangesParams) SetId(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["id"] = v
return
}
func (p *ListVlanIpRangesParams) SetKeyword(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["keyword"] = v
return
}
func (p *ListVlanIpRangesParams) SetNetworkid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["networkid"] = v
return
}
func (p *ListVlanIpRangesParams) SetPage(v int) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["page"] = v
return
}
func (p *ListVlanIpRangesParams) SetPagesize(v int) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["pagesize"] = v
return
}
func (p *ListVlanIpRangesParams) SetPhysicalnetworkid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["physicalnetworkid"] = v
return
}
func (p *ListVlanIpRangesParams) SetPodid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["podid"] = v
return
}
func (p *ListVlanIpRangesParams) SetProjectid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["projectid"] = v
return
}
func (p *ListVlanIpRangesParams) SetVlan(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["vlan"] = v
return
}
func (p *ListVlanIpRangesParams) SetZoneid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["zoneid"] = v
return
}
// You should always use this function to get a new ListVlanIpRangesParams instance,
// as then you are sure you have configured all required params
func (s *VLANService) NewListVlanIpRangesParams() *ListVlanIpRangesParams {
p := &ListVlanIpRangesParams{}
p.p = make(map[string]interface{})
return p
}
// This is a courtesy helper function, which in some cases may not work as expected!
func (s *VLANService) GetVlanIpRangeByID(id string, opts ...OptionFunc) (*VlanIpRange, int, error) {
p := &ListVlanIpRangesParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
for _, fn := range opts {
if err := fn(s.cs, p); err != nil {
return nil, -1, err
}
}
l, err := s.ListVlanIpRanges(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
if l.Count == 1 {
return l.VlanIpRanges[0], l.Count, nil
}
return nil, l.Count, fmt.Errorf("There is more then one result for VlanIpRange UUID: %s!", id)
}
// Lists all VLAN IP ranges.
func (s *VLANService) ListVlanIpRanges(p *ListVlanIpRangesParams) (*ListVlanIpRangesResponse, error) {
resp, err := s.cs.newRequest("listVlanIpRanges", p.toURLValues())
if err != nil {
return nil, err
}
var r ListVlanIpRangesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
}
type ListVlanIpRangesResponse struct {
Count int `json:"count"`
VlanIpRanges []*VlanIpRange `json:"vlaniprange"`
}
type VlanIpRange struct {
Account string `json:"account,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
Domainid string `json:"domainid,omitempty"`
Endip string `json:"endip,omitempty"`
Endipv6 string `json:"endipv6,omitempty"`
Forvirtualnetwork bool `json:"forvirtualnetwork,omitempty"`
Gateway string `json:"gateway,omitempty"`
Id string `json:"id,omitempty"`
Ip6cidr string `json:"ip6cidr,omitempty"`
Ip6gateway string `json:"ip6gateway,omitempty"`
Netmask string `json:"netmask,omitempty"`
Networkid string `json:"networkid,omitempty"`
Physicalnetworkid string `json:"physicalnetworkid,omitempty"`
Podid string `json:"podid,omitempty"`
Podname string `json:"podname,omitempty"`
Project string `json:"project,omitempty"`
Projectid string `json:"projectid,omitempty"`
Startip string `json:"startip,omitempty"`
Startipv6 string `json:"startipv6,omitempty"`
Vlan string `json:"vlan,omitempty"`
Zoneid string `json:"zoneid,omitempty"`
}
type DedicateGuestVlanRangeParams struct {
p map[string]interface{}
}
func (p *DedicateGuestVlanRangeParams) toURLValues() url.Values {
u := url.Values{}
if p.p == nil {
return u
}
if v, found := p.p["account"]; found {
u.Set("account", v.(string))
}
if v, found := p.p["domainid"]; found {
u.Set("domainid", v.(string))
}
if v, found := p.p["physicalnetworkid"]; found {
u.Set("physicalnetworkid", v.(string))
}
if v, found := p.p["projectid"]; found {
u.Set("projectid", v.(string))
}
if v, found := p.p["vlanrange"]; found {
u.Set("vlanrange", v.(string))
}
return u
}
func (p *DedicateGuestVlanRangeParams) SetAccount(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["account"] = v
return
}
func (p *DedicateGuestVlanRangeParams) SetDomainid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["domainid"] = v
return
}
func (p *DedicateGuestVlanRangeParams) SetPhysicalnetworkid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["physicalnetworkid"] = v
return
}
func (p *DedicateGuestVlanRangeParams) SetProjectid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["projectid"] = v
return
}
func (p *DedicateGuestVlanRangeParams) SetVlanrange(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["vlanrange"] = v
return
}
// You should always use this function to get a new DedicateGuestVlanRangeParams instance,
// as then you are sure you have configured all required params
func (s *VLANService) NewDedicateGuestVlanRangeParams(account string, domainid string, physicalnetworkid string, vlanrange string) *DedicateGuestVlanRangeParams {
p := &DedicateGuestVlanRangeParams{}
p.p = make(map[string]interface{})
p.p["account"] = account
p.p["domainid"] = domainid
p.p["physicalnetworkid"] = physicalnetworkid
p.p["vlanrange"] = vlanrange
return p
}
// Dedicates a guest vlan range to an account
func (s *VLANService) DedicateGuestVlanRange(p *DedicateGuestVlanRangeParams) (*DedicateGuestVlanRangeResponse, error) {
resp, err := s.cs.newRequest("dedicateGuestVlanRange", p.toURLValues())
if err != nil {
return nil, err
}
var r DedicateGuestVlanRangeResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
}
type DedicateGuestVlanRangeResponse struct {
Account string `json:"account,omitempty"`
Domain string `json:"domain,omitempty"`
Domainid string `json:"domainid,omitempty"`
Guestvlanrange string `json:"guestvlanrange,omitempty"`
Id string `json:"id,omitempty"`
Physicalnetworkid int64 `json:"physicalnetworkid,omitempty"`
Project string `json:"project,omitempty"`
Projectid string `json:"projectid,omitempty"`
Zoneid int64 `json:"zoneid,omitempty"`
}
type ReleaseDedicatedGuestVlanRangeParams struct {
p map[string]interface{}
}
func (p *ReleaseDedicatedGuestVlanRangeParams) toURLValues() url.Values {
u := url.Values{}
if p.p == nil {
return u
}
if v, found := p.p["id"]; found {
u.Set("id", v.(string))
}
return u
}
func (p *ReleaseDedicatedGuestVlanRangeParams) SetId(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["id"] = v
return
}
// You should always use this function to get a new ReleaseDedicatedGuestVlanRangeParams instance,
// as then you are sure you have configured all required params
func (s *VLANService) NewReleaseDedicatedGuestVlanRangeParams(id string) *ReleaseDedicatedGuestVlanRangeParams {
p := &ReleaseDedicatedGuestVlanRangeParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
}
// Releases a dedicated guest vlan range to the system
func (s *VLANService) ReleaseDedicatedGuestVlanRange(p *ReleaseDedicatedGuestVlanRangeParams) (*ReleaseDedicatedGuestVlanRangeResponse, error) {
resp, err := s.cs.newRequest("releaseDedicatedGuestVlanRange", p.toURLValues())
if err != nil {
return nil, err
}
var r ReleaseDedicatedGuestVlanRangeResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
// If we have a async client, we need to wait for the async result
if s.cs.async {
b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
if err != nil {
if err == AsyncTimeoutErr {
return &r, err
}
return nil, err
}
if err := json.Unmarshal(b, &r); err != nil {
return nil, err
}
}
return &r, nil
}
type ReleaseDedicatedGuestVlanRangeResponse struct {
JobID string `json:"jobid,omitempty"`
Displaytext string `json:"displaytext,omitempty"`
Success bool `json:"success,omitempty"`
}
type ListDedicatedGuestVlanRangesParams struct {
p map[string]interface{}
}
func (p *ListDedicatedGuestVlanRangesParams) toURLValues() url.Values {
u := url.Values{}
if p.p == nil {
return u
}
if v, found := p.p["account"]; found {
u.Set("account", v.(string))
}
if v, found := p.p["domainid"]; found {
u.Set("domainid", v.(string))
}
if v, found := p.p["guestvlanrange"]; found {
u.Set("guestvlanrange", v.(string))
}
if v, found := p.p["id"]; found {
u.Set("id", v.(string))
}
if v, found := p.p["keyword"]; found {
u.Set("keyword", v.(string))
}
if v, found := p.p["page"]; found {
vv := strconv.Itoa(v.(int))
u.Set("page", vv)
}
if v, found := p.p["pagesize"]; found {
vv := strconv.Itoa(v.(int))
u.Set("pagesize", vv)
}
if v, found := p.p["physicalnetworkid"]; found {
u.Set("physicalnetworkid", v.(string))
}
if v, found := p.p["projectid"]; found {
u.Set("projectid", v.(string))
}
if v, found := p.p["zoneid"]; found {
u.Set("zoneid", v.(string))
}
return u
}
func (p *ListDedicatedGuestVlanRangesParams) SetAccount(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["account"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetDomainid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["domainid"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetGuestvlanrange(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["guestvlanrange"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetId(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["id"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetKeyword(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["keyword"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetPage(v int) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["page"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetPagesize(v int) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["pagesize"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetPhysicalnetworkid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["physicalnetworkid"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetProjectid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["projectid"] = v
return
}
func (p *ListDedicatedGuestVlanRangesParams) SetZoneid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["zoneid"] = v
return
}
// You should always use this function to get a new ListDedicatedGuestVlanRangesParams instance,
// as then you are sure you have configured all required params
func (s *VLANService) NewListDedicatedGuestVlanRangesParams() *ListDedicatedGuestVlanRangesParams {
p := &ListDedicatedGuestVlanRangesParams{}
p.p = make(map[string]interface{})
return p
}
// This is a courtesy helper function, which in some cases may not work as expected!
func (s *VLANService) GetDedicatedGuestVlanRangeByID(id string, opts ...OptionFunc) (*DedicatedGuestVlanRange, int, error) {
p := &ListDedicatedGuestVlanRangesParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
for _, fn := range opts {
if err := fn(s.cs, p); err != nil {
return nil, -1, err
}
}
l, err := s.ListDedicatedGuestVlanRanges(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
if l.Count == 1 {
return l.DedicatedGuestVlanRanges[0], l.Count, nil
}
return nil, l.Count, fmt.Errorf("There is more then one result for DedicatedGuestVlanRange UUID: %s!", id)
}
// Lists dedicated guest vlan ranges
func (s *VLANService) ListDedicatedGuestVlanRanges(p *ListDedicatedGuestVlanRangesParams) (*ListDedicatedGuestVlanRangesResponse, error) {
resp, err := s.cs.newRequest("listDedicatedGuestVlanRanges", p.toURLValues())
if err != nil {
return nil, err
}
var r ListDedicatedGuestVlanRangesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
}
type ListDedicatedGuestVlanRangesResponse struct {
Count int `json:"count"`
DedicatedGuestVlanRanges []*DedicatedGuestVlanRange `json:"dedicatedguestvlanrange"`
}
type DedicatedGuestVlanRange struct {
Account string `json:"account,omitempty"`
Domain string `json:"domain,omitempty"`
Domainid string `json:"domainid,omitempty"`
Guestvlanrange string `json:"guestvlanrange,omitempty"`
Id string `json:"id,omitempty"`
Physicalnetworkid int64 `json:"physicalnetworkid,omitempty"`
Project string `json:"project,omitempty"`
Projectid string `json:"projectid,omitempty"`
Zoneid int64 `json:"zoneid,omitempty"`
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E3F19180-19F1-400E-B80E-0E495D83E714}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MvcSolution.Web.Public</RootNamespace>
<AssemblyName>MvcSolution.Web.Public</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\_libs\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ImgController.cs" />
<Compile Include="Controllers\_PublicControllerBase.cs" />
<Compile Include="PublicAreaRegistration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="ViewModels\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\MvcSolution.Data\MvcSolution.Data.csproj">
<Project>{cd0718d0-4a31-4034-8e86-1c538a2ff0ad}</Project>
<Name>MvcSolution.Data</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\MvcSolution.Infrastructure\MvcSolution.Infrastructure.csproj">
<Project>{3593818e-2b60-41a8-b5ba-de479b6a5d51}</Project>
<Name>MvcSolution.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\MvcSolution.Services\MvcSolution.Services.csproj">
<Project>{81a7247f-f729-49b4-ab99-1b0ab09fb56e}</Project>
<Name>MvcSolution.Services</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\MvcSolution.Web\MvcSolution.Web.csproj">
<Project>{c87136d6-10a1-4aea-82e6-e6a31b0362b6}</Project>
<Name>MvcSolution.Web</Name>
</ProjectReference>
<ProjectReference Include="..\MvcSolution.Services.Public\MvcSolution.Services.Public.csproj">
<Project>{e8317f20-dfc3-4990-94a7-a5f728fb04ee}</Project>
<Name>MvcSolution.Services.Public</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> | {
"pile_set_name": "Github"
} |
in vec2 Texcoord;
OUTPUT
uniform bool textured;
uniform vec4 color;
uniform sampler2D tex;
void main()
{
outColor = color;
if (textured)
outColor = outColor * texture(tex, Texcoord);
}
| {
"pile_set_name": "Github"
} |
<?xml version='1.0' encoding='utf-8'?>
<section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code">
<num>42-3405.09</num>
<heading>Judicial review.</heading>
<para>
<num>(a)</num>
<text>After the issuance of a final decision and order pursuant to this chapter, and within 15 days after the Mayor has notified the parties of the final decision and order, any party to such proceeding may seek judicial review of such decision and order by filing a petition for review in the District of Columbia Court of Appeals.</text>
</para>
<para>
<num>(b)</num>
<text>Proceedings for judicial review of Mayoral actions shall be subject to and be in accordance with <cite path="§2-510">§ 2-510</cite>.</text>
</para>
<annotations>
<annotation doc="D.C. Law 3-86" type="History" path="§509">Sept. 10, 1980, D.C. Law 3-86, § 509, 27 DCR 2975</annotation>
<annotation doc="D.C. Law 4-27" type="History">Aug. 1, 1981, D.C. Law 4-27, § 2(i), 28 DCR 2824</annotation>
<annotation type="Prior Codifications">1981 Ed., § 45-1659.</annotation>
</annotations>
</section>
| {
"pile_set_name": "Github"
} |
package libpod
import (
"context"
"strings"
"github.com/containers/podman/v2/libpod/define"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
type containerNode struct {
id string
container *Container
dependsOn []*containerNode
dependedOn []*containerNode
}
// ContainerGraph is a dependency graph based on a set of containers.
type ContainerGraph struct {
nodes map[string]*containerNode
noDepNodes []*containerNode
notDependedOnNodes map[string]*containerNode
}
// DependencyMap returns the dependency graph as map with the key being a
// container and the value being the containers the key depends on.
func (cg *ContainerGraph) DependencyMap() (dependencies map[*Container][]*Container) {
dependencies = make(map[*Container][]*Container)
for _, node := range cg.nodes {
dependsOn := make([]*Container, len(node.dependsOn))
for i, d := range node.dependsOn {
dependsOn[i] = d.container
}
dependencies[node.container] = dependsOn
}
return dependencies
}
// BuildContainerGraph builds a dependency graph based on the container slice.
func BuildContainerGraph(ctrs []*Container) (*ContainerGraph, error) {
graph := new(ContainerGraph)
graph.nodes = make(map[string]*containerNode)
graph.notDependedOnNodes = make(map[string]*containerNode)
// Start by building all nodes, with no edges
for _, ctr := range ctrs {
ctrNode := new(containerNode)
ctrNode.id = ctr.ID()
ctrNode.container = ctr
graph.nodes[ctr.ID()] = ctrNode
graph.notDependedOnNodes[ctr.ID()] = ctrNode
}
// Now add edges based on dependencies
for _, node := range graph.nodes {
deps := node.container.Dependencies()
for _, dep := range deps {
// Get the dep's node
depNode, ok := graph.nodes[dep]
if !ok {
return nil, errors.Wrapf(define.ErrNoSuchCtr, "container %s depends on container %s not found in input list", node.id, dep)
}
// Add the dependent node to the node's dependencies
// And add the node to the dependent node's dependedOn
node.dependsOn = append(node.dependsOn, depNode)
depNode.dependedOn = append(depNode.dependedOn, node)
// The dependency now has something depending on it
delete(graph.notDependedOnNodes, dep)
}
// Maintain a list of nodes with no dependencies
// (no edges coming from them)
if len(deps) == 0 {
graph.noDepNodes = append(graph.noDepNodes, node)
}
}
// Need to do cycle detection
// We cannot start or stop if there are cyclic dependencies
cycle, err := detectCycles(graph)
if err != nil {
return nil, err
} else if cycle {
return nil, errors.Wrapf(define.ErrInternal, "cycle found in container dependency graph")
}
return graph, nil
}
// Detect cycles in a container graph using Tarjan's strongly connected
// components algorithm
// Return true if a cycle is found, false otherwise
func detectCycles(graph *ContainerGraph) (bool, error) {
type nodeInfo struct {
index int
lowLink int
onStack bool
}
index := 0
nodes := make(map[string]*nodeInfo)
stack := make([]*containerNode, 0, len(graph.nodes))
var strongConnect func(*containerNode) (bool, error)
strongConnect = func(node *containerNode) (bool, error) {
logrus.Debugf("Strongconnecting node %s", node.id)
info := new(nodeInfo)
info.index = index
info.lowLink = index
index++
nodes[node.id] = info
stack = append(stack, node)
info.onStack = true
logrus.Debugf("Pushed %s onto stack", node.id)
// Work through all nodes we point to
for _, successor := range node.dependsOn {
if _, ok := nodes[successor.id]; !ok {
logrus.Debugf("Recursing to successor node %s", successor.id)
cycle, err := strongConnect(successor)
if err != nil {
return false, err
} else if cycle {
return true, nil
}
successorInfo := nodes[successor.id]
if successorInfo.lowLink < info.lowLink {
info.lowLink = successorInfo.lowLink
}
} else {
successorInfo := nodes[successor.id]
if successorInfo.index < info.lowLink && successorInfo.onStack {
info.lowLink = successorInfo.index
}
}
}
if info.lowLink == info.index {
l := len(stack)
if l == 0 {
return false, errors.Wrapf(define.ErrInternal, "empty stack in detectCycles")
}
// Pop off the stack
topOfStack := stack[l-1]
stack = stack[:l-1]
// Popped item is no longer on the stack, mark as such
topInfo, ok := nodes[topOfStack.id]
if !ok {
return false, errors.Wrapf(define.ErrInternal, "error finding node info for %s", topOfStack.id)
}
topInfo.onStack = false
logrus.Debugf("Finishing node %s. Popped %s off stack", node.id, topOfStack.id)
// If the top of the stack is not us, we have found a
// cycle
if topOfStack.id != node.id {
return true, nil
}
}
return false, nil
}
for id, node := range graph.nodes {
if _, ok := nodes[id]; !ok {
cycle, err := strongConnect(node)
if err != nil {
return false, err
} else if cycle {
return true, nil
}
}
}
return false, nil
}
// Visit a node on a container graph and start the container, or set an error if
// a dependency failed to start. if restart is true, startNode will restart the node instead of starting it.
func startNode(ctx context.Context, node *containerNode, setError bool, ctrErrors map[string]error, ctrsVisited map[string]bool, restart bool) {
// First, check if we have already visited the node
if ctrsVisited[node.id] {
return
}
// If setError is true, a dependency of us failed
// Mark us as failed and recurse
if setError {
// Mark us as visited, and set an error
ctrsVisited[node.id] = true
ctrErrors[node.id] = errors.Wrapf(define.ErrCtrStateInvalid, "a dependency of container %s failed to start", node.id)
// Hit anyone who depends on us, and set errors on them too
for _, successor := range node.dependedOn {
startNode(ctx, successor, true, ctrErrors, ctrsVisited, restart)
}
return
}
// Have all our dependencies started?
// If not, don't visit the node yet
depsVisited := true
for _, dep := range node.dependsOn {
depsVisited = depsVisited && ctrsVisited[dep.id]
}
if !depsVisited {
// Don't visit us yet, all dependencies are not up
// We'll hit the dependencies eventually, and when we do it will
// recurse here
return
}
// Going to try to start the container, mark us as visited
ctrsVisited[node.id] = true
ctrErrored := false
// Check if dependencies are running
// Graph traversal means we should have started them
// But they could have died before we got here
// Does not require that the container be locked, we only need to lock
// the dependencies
depsStopped, err := node.container.checkDependenciesRunning()
if err != nil {
ctrErrors[node.id] = err
ctrErrored = true
} else if len(depsStopped) > 0 {
// Our dependencies are not running
depsList := strings.Join(depsStopped, ",")
ctrErrors[node.id] = errors.Wrapf(define.ErrCtrStateInvalid, "the following dependencies of container %s are not running: %s", node.id, depsList)
ctrErrored = true
}
// Lock before we start
node.container.lock.Lock()
// Sync the container to pick up current state
if !ctrErrored {
if err := node.container.syncContainer(); err != nil {
ctrErrored = true
ctrErrors[node.id] = err
}
}
// Start the container (only if it is not running)
if !ctrErrored {
if !restart && node.container.state.State != define.ContainerStateRunning {
if err := node.container.initAndStart(ctx); err != nil {
ctrErrored = true
ctrErrors[node.id] = err
}
}
if restart && node.container.state.State != define.ContainerStatePaused && node.container.state.State != define.ContainerStateUnknown {
if err := node.container.restartWithTimeout(ctx, node.container.config.StopTimeout); err != nil {
ctrErrored = true
ctrErrors[node.id] = err
}
}
}
node.container.lock.Unlock()
// Recurse to anyone who depends on us and start them
for _, successor := range node.dependedOn {
startNode(ctx, successor, ctrErrored, ctrErrors, ctrsVisited, restart)
}
}
| {
"pile_set_name": "Github"
} |
using System.Text.Json.Serialization;
using Essensoft.AspNetCore.Payment.Alipay.Domain;
namespace Essensoft.AspNetCore.Payment.Alipay.Response
{
/// <summary>
/// AlipayCommerceFixAttachmentUploadResponse.
/// </summary>
public class AlipayCommerceFixAttachmentUploadResponse : AlipayResponse
{
/// <summary>
/// 上传文件的内容。
/// </summary>
[JsonPropertyName("file_info")]
public FixFileInfo FileInfo { get; set; }
}
}
| {
"pile_set_name": "Github"
} |
#include "Character.h"
#include <assert.h>
#include "util/json/json.h"
#include "util/FileUtil.h"
#include "util/JsonUtil.h"
// Json keys
const std::string cCharacter::gSkeletonKey = "Skeleton";
const std::string gPoseKey = "Pose";
const std::string gVelKey = "Vel";
cCharacter::cCharacter()
{
ResetParams();
}
cCharacter::~cCharacter()
{
}
bool cCharacter::Init(const std::string& char_file)
{
Clear();
bool succ = true;
if (char_file != "")
{
std::ifstream f_stream(char_file);
Json::Reader reader;
Json::Value root;
succ = reader.parse(f_stream, root);
f_stream.close();
if (succ)
{
if (root[gSkeletonKey].isNull())
{
succ = false;
}
else
{
succ = LoadSkeleton(root[gSkeletonKey]);
}
}
}
if (succ)
{
InitDefaultState();
}
if (!succ)
{
printf("Failed to parse character from file %s.\n", char_file.c_str());
}
return succ;
}
void cCharacter::Clear()
{
ResetParams();
mPose.resize(0);
mVel.resize(0);
mPose0.resize(0);
mVel0.resize(0);
}
void cCharacter::Update(double time_step)
{
}
void cCharacter::Reset()
{
ResetParams();
const Eigen::VectorXd& pose0 = GetPose0();
const Eigen::VectorXd& vel0 = GetVel0();
SetPose(pose0);
SetVel(vel0);
}
int cCharacter::GetNumDof() const
{
int dofs = cKinTree::GetNumDof(mJointMat);
return dofs;
}
const Eigen::MatrixXd& cCharacter::GetJointMat() const
{
return mJointMat;
}
int cCharacter::GetNumJoints() const
{
return cKinTree::GetNumJoints(mJointMat);
}
const Eigen::VectorXd& cCharacter::GetPose() const
{
return mPose;
}
void cCharacter::SetPose(const Eigen::VectorXd& pose)
{
assert(pose.size() == GetNumDof());
mPose = pose;
}
const Eigen::VectorXd& cCharacter::GetPose0() const
{
return mPose0;
}
void cCharacter::SetPose0(const Eigen::VectorXd& pose)
{
mPose0 = pose;
}
const Eigen::VectorXd& cCharacter::GetVel() const
{
return mVel;
}
void cCharacter::SetVel(const Eigen::VectorXd& vel)
{
assert(vel.size() == GetNumDof());
mVel = vel;
}
const Eigen::VectorXd& cCharacter::GetVel0() const
{
return mVel0;
}
void cCharacter::SetVel0(const Eigen::VectorXd& vel)
{
mVel0 = vel;
}
int cCharacter::GetRootID() const
{
int root_id = cKinTree::GetRoot(mJointMat);
return root_id;
}
tVector cCharacter::GetRootPos() const
{
tVector pos = cKinTree::GetRootPos(mJointMat, mPose);
return pos;
}
void cCharacter::GetRootRotation(tVector& out_axis, double& out_theta) const
{
tQuaternion quat = GetRootRotation();
cMathUtil::QuaternionToAxisAngle(quat, out_axis, out_theta);
}
tQuaternion cCharacter::GetRootRotation() const
{
return cKinTree::GetRootRot(mJointMat, mPose);
}
void cCharacter::SetRootPos(const tVector& pos)
{
cKinTree::SetRootPos(mJointMat, pos, mPose);
}
void cCharacter::SetRootPos0(const tVector& pos)
{
cKinTree::SetRootPos(mJointMat, pos, mPose0);
}
void cCharacter::SetRootRotation(const tQuaternion& q)
{
cKinTree::SetRootRot(mJointMat, q, mPose);
}
tQuaternion cCharacter::CalcHeadingRot() const
{
return cKinTree::CalcHeadingRot(mJointMat, mPose);
}
double cCharacter::CalcHeading() const
{
return cKinTree::CalcHeading(mJointMat, mPose);
}
tMatrix cCharacter::BuildOriginTrans() const
{
return cKinTree::BuildOriginTrans(mJointMat, mPose);
}
int cCharacter::GetParamOffset(int joint_id) const
{
return cKinTree::GetParamOffset(mJointMat, joint_id);
}
int cCharacter::GetParamSize(int joint_id) const
{
return cKinTree::GetParamSize(mJointMat, joint_id);
}
bool cCharacter::IsEndEffector(int joint_id) const
{
return cKinTree::IsEndEffector(mJointMat, joint_id);
}
int cCharacter::GetParentJoint(int joint_id) const
{
return cKinTree::GetParent(mJointMat, joint_id);
}
tVector cCharacter::CalcJointPos(int joint_id) const
{
tVector pos = cKinTree::CalcJointWorldPos(mJointMat, mPose, joint_id);
return pos;
}
tVector cCharacter::CalcJointVel(int joint_id) const
{
tVector pos = cKinTree::CalcJointWorldVel(mJointMat, mPose, mVel, joint_id);
return pos;
}
void cCharacter::CalcJointWorldRotation(int joint_id, tVector& out_axis, double& out_theta) const
{
cKinTree::CalcJointWorldTheta(mJointMat, mPose, joint_id, out_axis, out_theta);
}
tQuaternion cCharacter::CalcJointWorldRotation(int joint_id) const
{
tVector axis;
double theta;
CalcJointWorldRotation(joint_id, axis, theta);
return cMathUtil::AxisAngleToQuaternion(axis, theta);
}
double cCharacter::CalcJointChainLength(int joint_id)
{
auto chain = cKinTree::FindJointChain(mJointMat, GetRootID(), joint_id);
return cKinTree::CalcChainLength(mJointMat, chain);
}
tMatrix cCharacter::BuildJointWorldTrans(int joint_id) const
{
return cKinTree::JointWorldTrans(mJointMat, mPose, joint_id);
}
void cCharacter::CalcAABB(tVector& out_min, tVector& out_max) const
{
cKinTree::CalcAABB(mJointMat, mPose, out_min, out_max);
}
int cCharacter::CalcNumEndEffectors() const
{
int num_end = 0;
for (int j = 0; j < GetNumJoints(); ++j)
{
if (IsEndEffector(j))
{
++num_end;
}
}
return num_end;
}
// weights for each joint used to compute the pose error during training
double cCharacter::GetJointDiffWeight(int joint_id) const
{
return cKinTree::GetJointDiffWeight(mJointMat, joint_id);
}
bool cCharacter::WriteState(const std::string& file) const
{
return WriteState(file, tMatrix::Identity());
}
bool cCharacter::WriteState(const std::string& file, const tMatrix& root_trans) const
{
Eigen::VectorXd pose = GetPose();
Eigen::VectorXd vel = GetVel();
tQuaternion trans_q = cMathUtil::RotMatToQuaternion(root_trans);
tVector root_pos = cKinTree::GetRootPos(mJointMat, pose);
tQuaternion root_rot = cKinTree::GetRootRot(mJointMat, pose);
tVector root_vel = cKinTree::GetRootVel(mJointMat, vel);
tVector root_ang_vel = cKinTree::GetRootAngVel(mJointMat, vel);
root_pos[3] = 1;
root_pos = root_trans * root_pos;
root_pos[3] = 0;
root_rot = trans_q * root_rot;
root_vel = root_trans * root_vel;
root_ang_vel = root_trans * root_ang_vel;
cKinTree::SetRootPos(mJointMat, root_pos, pose);
cKinTree::SetRootRot(mJointMat, root_rot, pose);
cKinTree::SetRootVel(mJointMat, root_vel, vel);
cKinTree::SetRootAngVel(mJointMat, root_ang_vel, vel);
std::string json = BuildStateJson(pose, vel);
FILE* f = cFileUtil::OpenFile(file, "w");
if (f != nullptr)
{
fprintf(f, "%s", json.c_str());
cFileUtil::CloseFile(f);
return true;
}
return false;
}
bool cCharacter::ReadState(const std::string& file)
{
std::ifstream f_stream(file);
Json::Reader reader;
Json::Value root;
bool succ = reader.parse(f_stream, root);
f_stream.close();
if (succ && !root[gPoseKey].isNull())
{
Eigen::VectorXd pose;
succ &= ParseState(root[gPoseKey], pose);
cKinTree::PoseProcessPose(mJointMat, pose);
SetPose(pose);
}
if (succ && !root[gVelKey].isNull())
{
Eigen::VectorXd vel;
succ &= ParseState(root[gVelKey], vel);
SetVel(vel);
}
return succ;
}
bool cCharacter::LoadSkeleton(const Json::Value& root)
{
return cKinTree::Load(root, mJointMat);
}
void cCharacter::InitDefaultState()
{
int state_size = GetNumDof();
cKinTree::BuildDefaultPose(mJointMat, mPose0);
cKinTree::BuildDefaultVel(mJointMat, mVel0);
mPose = mPose0;
mVel = mVel0;
}
void cCharacter::ResetParams()
{
}
bool cCharacter::ParseState(const Json::Value& root, Eigen::VectorXd& out_state) const
{
bool succ = cJsonUtil::ReadVectorJson(root, out_state);
int num_dof = GetNumDof();
assert(out_state.size() == num_dof);
return succ;
}
std::string cCharacter::BuildStateJson(const Eigen::VectorXd& pose, const Eigen::VectorXd& vel) const
{
std::string json = "";
std::string pose_json = cJsonUtil::BuildVectorJson(pose);
std::string vel_json = cJsonUtil::BuildVectorJson(vel);
json = "{\n\"Pose\":" + pose_json + ",\n\"Vel\":" + vel_json + "\n}";
return json;
}
| {
"pile_set_name": "Github"
} |
/*
* TestThrift.thrift, modified to use a separate package name.
*
* Any changes to this file *MUST* be mirrored in thrifty-test-server's copy!
*/
/*
* 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.
*
* Contains some contributions under the Thrift Software License.
* Please see doc/old-thrift-license.txt in the Thrift distribution for
* details.
*/
namespace java com.microsoft.thrifty.integration.gen
namespace kt com.microsoft.thrifty.integration.kgen
/**
* Docstring!
*/
enum Numberz
{
ONE = 1,
TWO,
THREE,
FIVE = 5,
SIX,
EIGHT = 8
}
const double ActualDouble = 42
const Numberz myNumberz = Numberz.ONE;
// the following is expected to fail:
// const Numberz urNumberz = ONE;
typedef i64 UserId
struct Bonk
{
1: string message,
2: i32 type
}
typedef map<string,Bonk> MapType
struct Bools {
1: bool im_true,
2: bool im_false,
}
struct Xtruct
{
1: string string_thing,
4: byte byte_thing,
9: i32 i32_thing,
11: i64 i64_thing,
13: double double_thing,
15: bool bool_thing
}
struct Xtruct2
{
1: byte byte_thing, // used to be byte, hence the name
2: Xtruct struct_thing,
3: i32 i32_thing
}
struct Xtruct3
{
1: string string_thing,
4: i32 changed,
9: i32 i32_thing,
11: i64 i64_thing
}
struct Insanity
{
1: map<Numberz, UserId> userMap,
2: list<Xtruct> xtructs
}
struct CrazyNesting {
1: string string_field,
2: optional set<Insanity> set_field,
// Do not insert line break as test/go/Makefile.am is removing this line with pattern match
3: required list<map<set<i32>, map<i32,set<list<map<Insanity,string>>>>>> list_field,
4: binary binary_field
}
exception Xception {
1: i32 errorCode,
2: string message
}
exception Xception2 {
1: i32 errorCode,
2: Xtruct struct_thing
}
struct EmptyStruct {}
struct OneField {
1: EmptyStruct field
}
union TheEmptyUnion {}
union NonEmptyUnion {
1: i32 AnInt;
2: i64 ALong;
3: string AString;
4: Bonk ABonk;
}
struct HasUnion {
1: required NonEmptyUnion TheUnion;
}
service ThriftTest
{
/**
* Prints "testVoid()" and returns nothing.
*/
void testVoid(),
/**
* Prints 'testString("%s")' with thing as '%s'
* @param string thing - the string to print
* @return string - returns the string 'thing'
*/
string testString(1: string thing),
/**
* Prints 'testBool("%s")' where '%s' with thing as 'true' or 'false'
* @param bool thing - the bool data to print
* @return bool - returns the bool 'thing'
*/
bool testBool(1: bool thing),
/**
* Prints 'testByte("%d")' with thing as '%d'
* The types i8 and byte are synonyms, use of i8 is encouraged, byte still exists for the sake of compatibility.
* @param byte thing - the i8/byte to print
* @return i8 - returns the i8/byte 'thing'
*/
byte testByte(1: byte thing),
/**
* Prints 'testI32("%d")' with thing as '%d'
* @param i32 thing - the i32 to print
* @return i32 - returns the i32 'thing'
*/
i32 testI32(1: i32 thing),
/**
* Prints 'testI64("%d")' with thing as '%d'
* @param i64 thing - the i64 to print
* @return i64 - returns the i64 'thing'
*/
i64 testI64(1: i64 thing),
/**
* Prints 'testDouble("%f")' with thing as '%f'
* @param double thing - the double to print
* @return double - returns the double 'thing'
*/
double testDouble(1: double thing),
/**
* Prints 'testBinary("%s")' where '%s' is a hex-formatted string of thing's data
* @param binary thing - the binary data to print
* @return binary - returns the binary 'thing'
*/
binary testBinary(1: binary thing),
/**
* Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values
* @param Xtruct thing - the Xtruct to print
* @return Xtruct - returns the Xtruct 'thing'
*/
Xtruct testStruct(1: Xtruct thing),
/**
* Prints 'testNest("{%s}")' where thing has been formatted into a string of the nested struct
* @param Xtruct2 thing - the Xtruct2 to print
* @return Xtruct2 - returns the Xtruct2 'thing'
*/
Xtruct2 testNest(1: Xtruct2 thing),
/**
* Prints 'testMap("{%s")' where thing has been formatted into a string of 'key => value' pairs
* separated by commas and new lines
* @param map<i32,i32> thing - the map<i32,i32> to print
* @return map<i32,i32> - returns the map<i32,i32> 'thing'
*/
map<i32,i32> testMap(1: map<i32,i32> thing),
/**
* Prints 'testStringMap("{%s}")' where thing has been formatted into a string of 'key => value' pairs
* separated by commas and new lines
* @param map<string,string> thing - the map<string,string> to print
* @return map<string,string> - returns the map<string,string> 'thing'
*/
map<string,string> testStringMap(1: map<string,string> thing),
/**
* Prints 'testSet("{%s}")' where thing has been formatted into a string of values
* separated by commas and new lines
* @param set<i32> thing - the set<i32> to print
* @return set<i32> - returns the set<i32> 'thing'
*/
set<i32> testSet(1: set<i32> thing),
/**
* Prints 'testList("{%s}")' where thing has been formatted into a string of values
* separated by commas and new lines
* @param list<i32> thing - the list<i32> to print
* @return list<i32> - returns the list<i32> 'thing'
*/
list<i32> testList(1: list<i32> thing),
/**
* Prints 'testEnum("%d")' where thing has been formatted into it's numeric value
* @param Numberz thing - the Numberz to print
* @return Numberz - returns the Numberz 'thing'
*/
Numberz testEnum(1: Numberz thing),
/**
* Prints 'testTypedef("%d")' with thing as '%d'
* @param UserId thing - the UserId to print
* @return UserId - returns the UserId 'thing'
*/
UserId testTypedef(1: UserId thing),
/**
* Prints 'testMapMap("%d")' with hello as '%d'
* @param i32 hello - the i32 to print
* @return map<i32,map<i32,i32>> - returns a dictionary with these values:
* {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 1, 2 => 2, 3 => 3, 4 => 4, }, }
*/
map<i32,map<i32,i32>> testMapMap(1: i32 hello),
/**
* So you think you've got this all worked, out eh?
*
* Creates a the returned map with these values and prints it out:
* { 1 => { 2 => argument,
* 3 => argument,
* },
* 2 => { 6 => <empty Insanity struct>, },
* }
* @return map<UserId, map<Numberz,Insanity>> - a map with the above values
*/
map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
/**
* Prints 'testMulti()'
* @param byte arg0 -
* @param i32 arg1 -
* @param i64 arg2 -
* @param map<i16, string> arg3 -
* @param Numberz arg4 -
* @param UserId arg5 -
* @return Xtruct - returns an Xtruct with string_thing = "Hello2, byte_thing = arg0, i32_thing = arg1
* and i64_thing = arg2
*/
Xtruct testMulti(1: byte arg0, 2: i32 arg1, 3: i64 arg2, 4: map<i16, string> arg3, 5: Numberz arg4, 6: UserId arg5),
/**
* Print 'testException(%s)' with arg as '%s'
* @param string arg - a string indication what type of exception to throw
* if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
* elsen if arg == "TException" throw TException
* else do not throw anything
*/
void testException(1: string arg) throws(1: Xception err1),
/**
* Print 'testMultiException(%s, %s)' with arg0 as '%s' and arg1 as '%s'
* @param string arg - a string indication what type of exception to throw
* if arg0 == "Xception" throw Xception with errorCode = 1001 and message = "This is an Xception"
* elsen if arg0 == "Xception2" throw Xception2 with errorCode = 2002 and struct_thing.string_thing = "This is an Xception2"
* else do not throw anything
* @return Xtruct - an Xtruct with string_thing = arg1
*/
Xtruct testMultiException(1: string arg0, 2: string arg1) throws(1: Xception err1, 2: Xception2 err2)
/**
* Print 'testOneway(%d): Sleeping...' with secondsToSleep as '%d'
* sleep 'secondsToSleep'
* Print 'testOneway(%d): done sleeping!' with secondsToSleep as '%d'
* @param i32 secondsToSleep - the number of seconds to sleep
*/
oneway void testOneway(1:i32 secondsToSleep)
/**
* Prints 'testUnionArgument()' and returns the argument unmodified, wrapped in a
* HasUnion struct.
**/
HasUnion testUnionArgument(1: NonEmptyUnion arg0)
/**
* Returns the argument unaltered.
*/
UnionWithDefault testUnionWithDefault(1: UnionWithDefault theArg)
}
service SecondService
{
void blahBlah()
/**
* Prints 'testString("%s")' with thing as '%s'
* @param string thing - the string to print
* @return string - returns the string 'thing'
*/
string secondtestString(1: string thing),
}
struct VersioningTestV1 {
1: i32 begin_in_both,
3: string old_string,
12: i32 end_in_both
}
struct VersioningTestV2 {
1: i32 begin_in_both,
2: i32 newint,
3: byte newbyte,
4: i16 newshort,
5: i64 newlong,
6: double newdouble
7: Bonk newstruct,
8: list<i32> newlist,
9: set<i32> newset,
10: map<i32, i32> newmap,
11: string newstring,
12: i32 end_in_both
}
struct ListTypeVersioningV1 {
1: list<i32> myints;
2: string hello;
}
struct ListTypeVersioningV2 {
1: list<string> strings;
2: string hello;
}
struct GuessProtocolStruct {
7: map<string,string> map_field,
}
struct LargeDeltas {
1: Bools b1,
10: Bools b10,
100: Bools b100,
500: bool check_true,
1000: Bools b1000,
1500: bool check_false,
2000: VersioningTestV2 vertwo2000,
2500: set<string> a_set2500,
3000: VersioningTestV2 vertwo3000,
4000: list<i32> big_numbers
}
struct NestedListsI32x2 {
1: list<list<i32>> integerlist
}
struct NestedListsI32x3 {
1: list<list<list<i32>>> integerlist
}
struct NestedMixedx2 {
1: list<set<i32>> int_set_list
2: map<i32,set<string>> map_int_strset
3: list<map<i32,set<string>>> map_int_strset_list
}
struct ListBonks {
1: list<Bonk> bonk
}
struct NestedListsBonk {
1: list<list<list<Bonk>>> bonk
}
struct BoolTest {
1: optional bool b = true;
2: optional string s = "true";
}
struct StructA {
1: required string s;
}
struct StructB {
1: optional StructA aa;
2: required StructA ab;
}
struct CrayCray {
1: required list<list<list<i32>>> emptyList = [[]]
2: required list<set<set<i32>>> emptySet = [[]]
3: required list<list<map<i32, i32>>> emptyMap = [[]]
}
service ThirdService extends SecondService {
void bar();
}
struct HasRedaction {
1: required string one;
2: required string two (redacted = "true");
3: required string three (obfuscated);
}
struct HasCommentBasedRedaction {
/** @redacted */
1: required string foo;
}
struct ObfuscatedCollections {
1: required list<i32> numz = [1, 2, 3] (obfuscated)
2: required map<string, string> stringz = {} (obfuscated)
}
struct HasObfuscation {
1: optional string ssn (obfuscated = "true")
}
const map<string, map<string, map<i32, i32>>> HEINOUS = {
"foo": {"bar": {1: 2, 3: 4}},
"baz": {"qux": {5: 6, 7: 8}}
}
const list<set<map<string, i32>>> ALL_THE_COLLECTIONS = [[], [{"foo": 1, "bar": 2}]]
struct MapsOfEnums {
1: map<Numberz, Numberz> mapOne;
2: map<list<Numberz>, Numberz> mapTwo;
}
struct MapsOfCollections {
1: map<set<i32>, set<string>> mapOfSets;
2: map<list<double>, list<i64>> mapOfLists;
3: map<map<i32, i32>, map<i8, i8>> mapOfMaps;
}
union TestUnion {
1: i32 AnInt;
2: i64 ALong;
3: string Text;
4: Bonk aBonk;
}
union UnionWithDefault {
1: string Text;
2: i32 Int;
3: double Real = 3.14
}
union EmptyUnion {}
struct HasEmptyUnion {
1: EmptyUnion theEmptyUnion;
}
union UnionWithRedactions {
1: string text;
2: string obfuscated_text (obfuscated = "true");
3: string redacted_text (redacted = "true");
4: list<i32> nums;
5: list<i32> obfuscated_nums (obfuscated = "true");
6: list<i32> redacted_nums (redacted = "true");
7: set<double> dubs;
8: set<double> obfuscated_dubs (obfuscated = "true");
9: set<double> redacted_dubs (redacted = "true");
10: map<i8, i8> bytes;
11: map<i8, i8> obfuscated_bytes (obfuscated = "true");
12: map<i8, i8> redacted_bytes (redacted = "true");
} | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.awt.X11;
/**
* XAtom is a class that allows you to create and modify X Window properties.
* An X Atom is an identifier for a property that you can set on any X Window.
* Standard X Atom are defined by X11 and these atoms are defined in this class
* for convenience. Common X Atoms like <code>XA_WM_NAME</code> are used to communicate with the
* Window manager to let it know the Window name. The use and protocol for these
* atoms are defined in the Inter client communications converntions manual.
* User specified XAtoms are defined by specifying a name that gets Interned
* by the XServer and an <code>XAtom</code> object is returned. An <code>XAtom</code> can also be created
* by using a pre-exisiting atom like <code>XA_WM_CLASS</code>. A <code>display</code> has to be specified
* in order to create an <code>XAtom</code>. <p> <p>
*
* Once an <code>XAtom</code> instance is created, you can call get and set property methods to
* set the values for a particular window. <p> <p>
*
*
* Example usage : To set the window name for a top level: <p>
* <code>
* XAtom xa = new XAtom(display,XAtom.XA_WM_NAME); <p>
* xa.setProperty(window,"Hello World");<p></code>
*<p>
*<p>
* To get the cut buffer :<p>
* <p><code>
* XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);<p>
* String selection = xa.getProperty(root_window);<p></code>
* @author Bino George
* @since JDK1.5
*/
import sun.misc.Unsafe;
import java.util.HashMap;
public final class XAtom {
// Order of lock: XAWTLock -> XAtom.class
/* Predefined Atoms - automatically extracted from XAtom.h */
private static Unsafe unsafe = XlibWrapper.unsafe;
private static XAtom[] emptyList = new XAtom[0];
public static final long XA_PRIMARY=1;
public static final long XA_SECONDARY=2;
public static final long XA_ARC=3;
public static final long XA_ATOM=4;
public static final long XA_BITMAP=5;
public static final long XA_CARDINAL=6;
public static final long XA_COLORMAP=7;
public static final long XA_CURSOR=8;
public static final long XA_CUT_BUFFER0=9;
public static final long XA_CUT_BUFFER1=10;
public static final long XA_CUT_BUFFER2=11;
public static final long XA_CUT_BUFFER3=12;
public static final long XA_CUT_BUFFER4=13;
public static final long XA_CUT_BUFFER5=14;
public static final long XA_CUT_BUFFER6=15;
public static final long XA_CUT_BUFFER7=16;
public static final long XA_DRAWABLE=17;
public static final long XA_FONT=18;
public static final long XA_INTEGER=19;
public static final long XA_PIXMAP=20;
public static final long XA_POINT=21;
public static final long XA_RECTANGLE=22;
public static final long XA_RESOURCE_MANAGER=23;
public static final long XA_RGB_COLOR_MAP=24;
public static final long XA_RGB_BEST_MAP=25;
public static final long XA_RGB_BLUE_MAP=26;
public static final long XA_RGB_DEFAULT_MAP=27;
public static final long XA_RGB_GRAY_MAP=28;
public static final long XA_RGB_GREEN_MAP=29;
public static final long XA_RGB_RED_MAP=30;
public static final long XA_STRING=31;
public static final long XA_VISUALID=32;
public static final long XA_WINDOW=33;
public static final long XA_WM_COMMAND=34;
public static final long XA_WM_HINTS=35;
public static final long XA_WM_CLIENT_MACHINE=36;
public static final long XA_WM_ICON_NAME=37;
public static final long XA_WM_ICON_SIZE=38;
public static final long XA_WM_NAME=39;
public static final long XA_WM_NORMAL_HINTS=40;
public static final long XA_WM_SIZE_HINTS=41;
public static final long XA_WM_ZOOM_HINTS=42;
public static final long XA_MIN_SPACE=43;
public static final long XA_NORM_SPACE=44;
public static final long XA_MAX_SPACE=45;
public static final long XA_END_SPACE=46;
public static final long XA_SUPERSCRIPT_X=47;
public static final long XA_SUPERSCRIPT_Y=48;
public static final long XA_SUBSCRIPT_X=49;
public static final long XA_SUBSCRIPT_Y=50;
public static final long XA_UNDERLINE_POSITION=51;
public static final long XA_UNDERLINE_THICKNESS=52 ;
public static final long XA_STRIKEOUT_ASCENT=53;
public static final long XA_STRIKEOUT_DESCENT=54;
public static final long XA_ITALIC_ANGLE=55;
public static final long XA_X_HEIGHT=56;
public static final long XA_QUAD_WIDTH=57;
public static final long XA_WEIGHT=58;
public static final long XA_POINT_SIZE=59;
public static final long XA_RESOLUTION=60;
public static final long XA_COPYRIGHT=61;
public static final long XA_NOTICE=62;
public static final long XA_FONT_NAME=63;
public static final long XA_FAMILY_NAME=64;
public static final long XA_FULL_NAME=65;
public static final long XA_CAP_HEIGHT=66;
public static final long XA_WM_CLASS=67;
public static final long XA_WM_TRANSIENT_FOR=68;
public static final long XA_LAST_PREDEFINED=68;
static HashMap<Long, XAtom> atomToAtom = new HashMap<Long, XAtom>();
static HashMap<String, XAtom> nameToAtom = new HashMap<String, XAtom>();
static void register(XAtom at) {
if (at == null) {
return;
}
synchronized (XAtom.class) {
if (at.atom != 0) {
atomToAtom.put(Long.valueOf(at.atom), at);
}
if (at.name != null) {
nameToAtom.put(at.name, at);
}
}
}
static XAtom lookup(long atom) {
synchronized (XAtom.class) {
return atomToAtom.get(Long.valueOf(atom));
}
}
static XAtom lookup(String name) {
synchronized (XAtom.class) {
return nameToAtom.get(name);
}
}
/*
* [das]Suggestion:
* 1.Make XAtom immutable.
* 2.Replace public ctors with factory methods (e.g. get() below).
*/
static XAtom get(long atom) {
XAtom xatom = lookup(atom);
if (xatom == null) {
xatom = new XAtom(XToolkit.getDisplay(), atom);
}
return xatom;
}
public static XAtom get(String name) {
XAtom xatom = lookup(name);
if (xatom == null) {
xatom = new XAtom(XToolkit.getDisplay(), name);
}
return xatom;
}
public final String getName() {
if (name == null) {
XToolkit.awtLock();
try {
this.name = XlibWrapper.XGetAtomName(display, atom);
} finally {
XToolkit.awtUnlock();
}
register();
}
return name;
}
static String asString(long atom) {
XAtom at = lookup(atom);
if (at == null) {
return Long.toString(atom);
} else {
return at.toString();
}
}
void register() {
register(this);
}
public String toString() {
if (name != null) {
return name + ":" + atom;
} else {
return Long.toString(atom);
}
}
/* interned value of Atom */
long atom = 0;
/* name of atom */
String name;
/* display for X connection */
long display;
/** This constructor will create and intern a new XAtom that is specified
* by the supplied name.
*
* @param display X display to use
* @param name name of the XAtom to create.
* @since 1.5
*/
private XAtom(long display, String name) {
this(display, name, true);
}
public XAtom(String name, boolean autoIntern) {
this(XToolkit.getDisplay(), name, autoIntern);
}
/** This constructor will create an instance of XAtom that is specified
* by the predefined XAtom specified by u <code> latom </code>
*
* @param display X display to use.
* @param atom a predefined XAtom.
* @since 1.5
*/
public XAtom(long display, long atom) {
this.atom = atom;
this.display = display;
register();
}
/** This constructor will create the instance,
* and if <code>autoIntern</code> is true intern a new XAtom that is specified
* by the supplied name.
*
* @param display X display to use
* @param name name of the XAtom to create.
* @since 1.5
*/
private XAtom(long display, String name, boolean autoIntern) {
this.name = name;
this.display = display;
if (autoIntern) {
XToolkit.awtLock();
try {
atom = XlibWrapper.InternAtom(display,name,0);
} finally {
XToolkit.awtUnlock();
}
}
register();
}
/**
* Creates uninitialized instance of
*/
public XAtom() {
}
/** Sets the window property for the specified window
* @param window window id to use
* @param str value to set to.
* @since 1.5
*/
public void setProperty(long window, String str) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
XlibWrapper.SetProperty(display,window,atom,str);
} finally {
XToolkit.awtUnlock();
}
}
/**
* Sets UTF8_STRING type property. Explicitly converts str to UTF-8 byte sequence.
*/
public void setPropertyUTF8(long window, String str) {
XAtom XA_UTF8_STRING = XAtom.get("UTF8_STRING"); /* like STRING but encoding is UTF-8 */
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
byte[] bdata = null;
try {
bdata = str.getBytes("UTF-8");
} catch (java.io.UnsupportedEncodingException uee) {
uee.printStackTrace();
}
if (bdata != null) {
setAtomData(window, XA_UTF8_STRING.atom, bdata);
}
}
/**
* Sets STRING/8 type property. Explicitly converts str to Latin-1 byte sequence.
*/
public void setProperty8(long window, String str) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
byte[] bdata = null;
try {
bdata = str.getBytes("ISO-8859-1");
} catch (java.io.UnsupportedEncodingException uee) {
uee.printStackTrace();
}
if (bdata != null) {
setAtomData(window, XA_STRING, bdata);
}
}
/** Gets the window property for the specified window
* @param window window id to use
* @param str value to set to.
* @return string with the property.
* @since 1.5
*/
public String getProperty(long window) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
return XlibWrapper.GetProperty(display,window,atom);
} finally {
XToolkit.awtUnlock();
}
}
/*
* Auxiliary function that returns the value of 'property' of type
* 'property_type' on window 'window'. Format of the property must be 32.
*/
public long get32Property(long window, long property_type) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
WindowPropertyGetter getter =
new WindowPropertyGetter(window, this, 0, 1,
false, property_type);
try {
int status = getter.execute();
if (status != XConstants.Success || getter.getData() == 0) {
return 0;
}
if (getter.getActualType() != property_type || getter.getActualFormat() != 32) {
return 0;
}
return Native.getCard32(getter.getData());
} finally {
getter.dispose();
}
}
/**
* Returns value of property of type CARDINAL/32 of this window
*/
public long getCard32Property(XBaseWindow window) {
return get32Property(window.getWindow(), XA_CARDINAL);
}
/**
* Sets property of type CARDINAL on the window
*/
public void setCard32Property(long window, long value) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
Native.putCard32(XlibWrapper.larg1, value);
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
atom, XA_CARDINAL, 32, XConstants.PropModeReplace,
XlibWrapper.larg1, 1);
} finally {
XToolkit.awtUnlock();
}
}
/**
* Sets property of type CARDINAL/32 on the window
*/
public void setCard32Property(XBaseWindow window, long value) {
setCard32Property(window.getWindow(), value);
}
/**
* Gets uninterpreted set of data from property and stores them in data_ptr.
* Property type is the same as current atom, property is current atom.
* Property format is 32. Property 'delete' is false.
* Returns boolean if requested type, format, length match returned values
* and returned data pointer is not null.
*/
public boolean getAtomData(long window, long data_ptr, int length) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
WindowPropertyGetter getter =
new WindowPropertyGetter(window, this, 0, (long)length,
false, this);
try {
int status = getter.execute();
if (status != XConstants.Success || getter.getData() == 0) {
return false;
}
if (getter.getActualType() != atom
|| getter.getActualFormat() != 32
|| getter.getNumberOfItems() != length
)
{
return false;
}
XlibWrapper.memcpy(data_ptr, getter.getData(), length*getAtomSize());
return true;
} finally {
getter.dispose();
}
}
/**
* Gets uninterpreted set of data from property and stores them in data_ptr.
* Property type is <code>type</code>, property is current atom.
* Property format is 32. Property 'delete' is false.
* Returns boolean if requested type, format, length match returned values
* and returned data pointer is not null.
*/
public boolean getAtomData(long window, long type, long data_ptr, int length) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
WindowPropertyGetter getter =
new WindowPropertyGetter(window, this, 0, (long)length,
false, type);
try {
int status = getter.execute();
if (status != XConstants.Success || getter.getData() == 0) {
return false;
}
if (getter.getActualType() != type
|| getter.getActualFormat() != 32
|| getter.getNumberOfItems() != length
)
{
return false;
}
XlibWrapper.memcpy(data_ptr, getter.getData(), length*getAtomSize());
return true;
} finally {
getter.dispose();
}
}
/**
* Sets uninterpreted set of data into property from data_ptr.
* Property type is the same as current atom, property is current atom.
* Property format is 32. Mode is PropModeReplace. length is a number
* of items pointer by data_ptr.
*/
public void setAtomData(long window, long data_ptr, int length) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
atom, atom, 32, XConstants.PropModeReplace,
data_ptr, length);
} finally {
XToolkit.awtUnlock();
}
}
/**
* Sets uninterpreted set of data into property from data_ptr.
* Property type is <code>type</code>, property is current atom.
* Property format is 32. Mode is PropModeReplace. length is a number
* of items pointer by data_ptr.
*/
public void setAtomData(long window, long type, long data_ptr, int length) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
atom, type, 32, XConstants.PropModeReplace,
data_ptr, length);
} finally {
XToolkit.awtUnlock();
}
}
/**
* Sets uninterpreted set of data into property from data_ptr.
* Property type is <code>type</code>, property is current atom.
* Property format is 8. Mode is PropModeReplace. length is a number
* of bytes pointer by data_ptr.
*/
public void setAtomData8(long window, long type, long data_ptr, int length) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
atom, type, 8, XConstants.PropModeReplace,
data_ptr, length);
} finally {
XToolkit.awtUnlock();
}
}
/**
* Deletes property specified by this item on the window.
*/
public void DeleteProperty(long window) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
XlibWrapper.XDeleteProperty(XToolkit.getDisplay(), window, atom);
} finally {
XToolkit.awtUnlock();
}
}
/**
* Deletes property specified by this item on the window.
*/
public void DeleteProperty(XBaseWindow window) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window.getWindow());
XToolkit.awtLock();
try {
XlibWrapper.XDeleteProperty(XToolkit.getDisplay(),
window.getWindow(), atom);
} finally {
XToolkit.awtUnlock();
}
}
public void setAtomData(long window, long property_type, byte[] data) {
long bdata = Native.toData(data);
try {
setAtomData8(window, property_type, bdata, data.length);
} finally {
unsafe.freeMemory(bdata);
}
}
/*
* Auxiliary function that returns the value of 'property' of type
* 'property_type' on window 'window'. Format of the property must be 8.
*/
public byte[] getByteArrayProperty(long window, long property_type) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
WindowPropertyGetter getter =
new WindowPropertyGetter(window, this, 0, 0xFFFF,
false, property_type);
try {
int status = getter.execute();
if (status != XConstants.Success || getter.getData() == 0) {
return null;
}
if (getter.getActualType() != property_type || getter.getActualFormat() != 8) {
return null;
}
byte[] res = XlibWrapper.getStringBytes(getter.getData());
return res;
} finally {
getter.dispose();
}
}
/**
* Interns the XAtom
*/
public void intern(boolean onlyIfExists) {
XToolkit.awtLock();
try {
atom = XlibWrapper.InternAtom(display,name, onlyIfExists?1:0);
} finally {
XToolkit.awtUnlock();
}
register();
}
public boolean isInterned() {
if (atom == 0) {
XToolkit.awtLock();
try {
atom = XlibWrapper.InternAtom(display, name, 1);
} finally {
XToolkit.awtUnlock();
}
if (atom == 0) {
return false;
} else {
register();
return true;
}
} else {
return true;
}
}
public void setValues(long display, String name, long atom) {
this.display = display;
this.atom = atom;
this.name = name;
register();
}
static int getAtomSize() {
return Native.getLongSize();
}
/*
* Returns the value of property ATOM[]/32 as array of XAtom objects
* @return array of atoms, array of length 0 if the atom list is empty
* or has different format
*/
XAtom[] getAtomListProperty(long window) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
WindowPropertyGetter getter =
new WindowPropertyGetter(window, this, 0, 0xFFFF,
false, XA_ATOM);
try {
int status = getter.execute();
if (status != XConstants.Success || getter.getData() == 0) {
return emptyList;
}
if (getter.getActualType() != XA_ATOM || getter.getActualFormat() != 32) {
return emptyList;
}
int count = (int)getter.getNumberOfItems();
if (count == 0) {
return emptyList;
}
long list_atoms = getter.getData();
XAtom[] res = new XAtom[count];
for (int index = 0; index < count; index++) {
res[index] = XAtom.get(XAtom.getAtom(list_atoms+index*getAtomSize()));
}
return res;
} finally {
getter.dispose();
}
}
/*
* Returns the value of property of type ATOM[]/32 as XAtomList
* @return list of atoms, empty list if the atom list is empty
* or has different format
*/
XAtomList getAtomListPropertyList(long window) {
return new XAtomList(getAtomListProperty(window));
}
XAtomList getAtomListPropertyList(XBaseWindow window) {
return getAtomListPropertyList(window.getWindow());
}
XAtom[] getAtomListProperty(XBaseWindow window) {
return getAtomListProperty(window.getWindow());
}
/**
* Sets property value of type ATOM list to the list of atoms.
*/
void setAtomListProperty(long window, XAtom[] atoms) {
long data = toData(atoms);
setAtomData(window, XAtom.XA_ATOM, data, atoms.length);
unsafe.freeMemory(data);
}
/**
* Sets property value of type ATOM list to the list of atoms specified by XAtomList
*/
void setAtomListProperty(long window, XAtomList atoms) {
long data = atoms.getAtomsData();
setAtomData(window, XAtom.XA_ATOM, data, atoms.size());
unsafe.freeMemory(data);
}
/**
* Sets property value of type ATOM list to the list of atoms.
*/
public void setAtomListProperty(XBaseWindow window, XAtom[] atoms) {
setAtomListProperty(window.getWindow(), atoms);
}
/**
* Sets property value of type ATOM list to the list of atoms specified by XAtomList
*/
public void setAtomListProperty(XBaseWindow window, XAtomList atoms) {
setAtomListProperty(window.getWindow(), atoms);
}
long getAtom() {
return atom;
}
void putAtom(long ptr) {
Native.putLong(ptr, atom);
}
static long getAtom(long ptr) {
return Native.getLong(ptr);
}
/**
* Allocated memory to hold the list of native atom data and returns unsafe pointer to it
* Caller should free the memory by himself.
*/
static long toData(XAtom[] atoms) {
long data = unsafe.allocateMemory(getAtomSize() * atoms.length);
for (int i = 0; i < atoms.length; i++ ) {
if (atoms[i] != null) {
atoms[i].putAtom(data + i * getAtomSize());
}
}
return data;
}
void checkWindow(long window) {
if (window == 0) {
throw new IllegalArgumentException("Window must not be zero");
}
}
public boolean equals(Object o) {
if (!(o instanceof XAtom)) {
return false;
}
XAtom ot = (XAtom)o;
return (atom == ot.atom && display == ot.display);
}
public int hashCode() {
return (int)((atom ^ display)& 0xFFFFL);
}
/**
* Sets property on the <code>window</code> to the value <code>window_value</window>
* Property is assumed to be of type WINDOW/32
*/
public void setWindowProperty(long window, long window_value) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
XToolkit.awtLock();
try {
Native.putWindow(XlibWrapper.larg1, window_value);
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
atom, XA_WINDOW, 32, XConstants.PropModeReplace,
XlibWrapper.larg1, 1);
} finally {
XToolkit.awtUnlock();
}
}
public void setWindowProperty(XBaseWindow window, XBaseWindow window_value) {
setWindowProperty(window.getWindow(), window_value.getWindow());
}
/**
* Gets property on the <code>window</code>. Property is assumed to be
* of type WINDOW/32.
*/
public long getWindowProperty(long window) {
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
checkWindow(window);
WindowPropertyGetter getter =
new WindowPropertyGetter(window, this, 0, 1,
false, XA_WINDOW);
try {
int status = getter.execute();
if (status != XConstants.Success || getter.getData() == 0) {
return 0;
}
if (getter.getActualType() != XA_WINDOW || getter.getActualFormat() != 32) {
return 0;
}
return Native.getWindow(getter.getData());
} finally {
getter.dispose();
}
}
}
| {
"pile_set_name": "Github"
} |
/* global describe, it */
var requireMainFilename = require('./')
require('tap').mochaGlobals()
require('chai').should()
describe('require-main-filename', function () {
it('returns require.main.filename in normal circumstances', function () {
requireMainFilename().should.match(/test\.js/)
})
it('should use children[0].filename when running on iisnode', function () {
var main = {
filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js',
children: [ {filename: 'D:\\home\\site\\wwwroot\\server.js'} ]
}
requireMainFilename({
main: main
}).should.match(/server\.js/)
})
it('should not use children[0] if no children exist', function () {
var main = {
filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js',
children: []
}
requireMainFilename({
main: main
}).should.match(/interceptor\.js/)
})
it('should default to process.cwd() if require.main is undefined', function () {
requireMainFilename({}).should.match(/require-main-filename/)
})
})
| {
"pile_set_name": "Github"
} |
/*
* vfsv0 quota IO operations on file
*/
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/dqblk_v2.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/quotaops.h>
#include <asm/byteorder.h>
#include "quota_tree.h"
MODULE_AUTHOR("Jan Kara");
MODULE_DESCRIPTION("Quota trie support");
MODULE_LICENSE("GPL");
#define __QUOTA_QT_PARANOIA
static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth)
{
unsigned int epb = info->dqi_usable_bs >> 2;
depth = info->dqi_qtree_depth - depth - 1;
while (depth--)
id /= epb;
return id % epb;
}
static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
{
qid_t id = from_kqid(&init_user_ns, qid);
return __get_index(info, id, depth);
}
/* Number of entries in one blocks */
static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
{
return (info->dqi_usable_bs - sizeof(struct qt_disk_dqdbheader))
/ info->dqi_entry_size;
}
static char *getdqbuf(size_t size)
{
char *buf = kmalloc(size, GFP_NOFS);
if (!buf)
printk(KERN_WARNING
"VFS: Not enough memory for quota buffers.\n");
return buf;
}
static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
{
struct super_block *sb = info->dqi_sb;
memset(buf, 0, info->dqi_usable_bs);
return sb->s_op->quota_read(sb, info->dqi_type, buf,
info->dqi_usable_bs, blk << info->dqi_blocksize_bits);
}
static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
{
struct super_block *sb = info->dqi_sb;
ssize_t ret;
ret = sb->s_op->quota_write(sb, info->dqi_type, buf,
info->dqi_usable_bs, blk << info->dqi_blocksize_bits);
if (ret != info->dqi_usable_bs) {
quota_error(sb, "dquota write failed");
if (ret >= 0)
ret = -EIO;
}
return ret;
}
/* Remove empty block from list and return it */
static int get_free_dqblk(struct qtree_mem_dqinfo *info)
{
char *buf = getdqbuf(info->dqi_usable_bs);
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
int ret, blk;
if (!buf)
return -ENOMEM;
if (info->dqi_free_blk) {
blk = info->dqi_free_blk;
ret = read_blk(info, blk, buf);
if (ret < 0)
goto out_buf;
info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free);
}
else {
memset(buf, 0, info->dqi_usable_bs);
/* Assure block allocation... */
ret = write_blk(info, info->dqi_blocks, buf);
if (ret < 0)
goto out_buf;
blk = info->dqi_blocks++;
}
mark_info_dirty(info->dqi_sb, info->dqi_type);
ret = blk;
out_buf:
kfree(buf);
return ret;
}
/* Insert empty block to the list */
static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk)
{
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
int err;
dh->dqdh_next_free = cpu_to_le32(info->dqi_free_blk);
dh->dqdh_prev_free = cpu_to_le32(0);
dh->dqdh_entries = cpu_to_le16(0);
err = write_blk(info, blk, buf);
if (err < 0)
return err;
info->dqi_free_blk = blk;
mark_info_dirty(info->dqi_sb, info->dqi_type);
return 0;
}
/* Remove given block from the list of blocks with free entries */
static int remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf,
uint blk)
{
char *tmpbuf = getdqbuf(info->dqi_usable_bs);
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
uint nextblk = le32_to_cpu(dh->dqdh_next_free);
uint prevblk = le32_to_cpu(dh->dqdh_prev_free);
int err;
if (!tmpbuf)
return -ENOMEM;
if (nextblk) {
err = read_blk(info, nextblk, tmpbuf);
if (err < 0)
goto out_buf;
((struct qt_disk_dqdbheader *)tmpbuf)->dqdh_prev_free =
dh->dqdh_prev_free;
err = write_blk(info, nextblk, tmpbuf);
if (err < 0)
goto out_buf;
}
if (prevblk) {
err = read_blk(info, prevblk, tmpbuf);
if (err < 0)
goto out_buf;
((struct qt_disk_dqdbheader *)tmpbuf)->dqdh_next_free =
dh->dqdh_next_free;
err = write_blk(info, prevblk, tmpbuf);
if (err < 0)
goto out_buf;
} else {
info->dqi_free_entry = nextblk;
mark_info_dirty(info->dqi_sb, info->dqi_type);
}
kfree(tmpbuf);
dh->dqdh_next_free = dh->dqdh_prev_free = cpu_to_le32(0);
/* No matter whether write succeeds block is out of list */
if (write_blk(info, blk, buf) < 0)
quota_error(info->dqi_sb, "Can't write block (%u) "
"with free entries", blk);
return 0;
out_buf:
kfree(tmpbuf);
return err;
}
/* Insert given block to the beginning of list with free entries */
static int insert_free_dqentry(struct qtree_mem_dqinfo *info, char *buf,
uint blk)
{
char *tmpbuf = getdqbuf(info->dqi_usable_bs);
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
int err;
if (!tmpbuf)
return -ENOMEM;
dh->dqdh_next_free = cpu_to_le32(info->dqi_free_entry);
dh->dqdh_prev_free = cpu_to_le32(0);
err = write_blk(info, blk, buf);
if (err < 0)
goto out_buf;
if (info->dqi_free_entry) {
err = read_blk(info, info->dqi_free_entry, tmpbuf);
if (err < 0)
goto out_buf;
((struct qt_disk_dqdbheader *)tmpbuf)->dqdh_prev_free =
cpu_to_le32(blk);
err = write_blk(info, info->dqi_free_entry, tmpbuf);
if (err < 0)
goto out_buf;
}
kfree(tmpbuf);
info->dqi_free_entry = blk;
mark_info_dirty(info->dqi_sb, info->dqi_type);
return 0;
out_buf:
kfree(tmpbuf);
return err;
}
/* Is the entry in the block free? */
int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk)
{
int i;
for (i = 0; i < info->dqi_entry_size; i++)
if (disk[i])
return 0;
return 1;
}
EXPORT_SYMBOL(qtree_entry_unused);
/* Find space for dquot */
static uint find_free_dqentry(struct qtree_mem_dqinfo *info,
struct dquot *dquot, int *err)
{
uint blk, i;
struct qt_disk_dqdbheader *dh;
char *buf = getdqbuf(info->dqi_usable_bs);
char *ddquot;
*err = 0;
if (!buf) {
*err = -ENOMEM;
return 0;
}
dh = (struct qt_disk_dqdbheader *)buf;
if (info->dqi_free_entry) {
blk = info->dqi_free_entry;
*err = read_blk(info, blk, buf);
if (*err < 0)
goto out_buf;
} else {
blk = get_free_dqblk(info);
if ((int)blk < 0) {
*err = blk;
kfree(buf);
return 0;
}
memset(buf, 0, info->dqi_usable_bs);
/* This is enough as the block is already zeroed and the entry
* list is empty... */
info->dqi_free_entry = blk;
mark_info_dirty(dquot->dq_sb, dquot->dq_id.type);
}
/* Block will be full? */
if (le16_to_cpu(dh->dqdh_entries) + 1 >= qtree_dqstr_in_blk(info)) {
*err = remove_free_dqentry(info, buf, blk);
if (*err < 0) {
quota_error(dquot->dq_sb, "Can't remove block (%u) "
"from entry free list", blk);
goto out_buf;
}
}
le16_add_cpu(&dh->dqdh_entries, 1);
/* Find free structure in block */
ddquot = buf + sizeof(struct qt_disk_dqdbheader);
for (i = 0; i < qtree_dqstr_in_blk(info); i++) {
if (qtree_entry_unused(info, ddquot))
break;
ddquot += info->dqi_entry_size;
}
#ifdef __QUOTA_QT_PARANOIA
if (i == qtree_dqstr_in_blk(info)) {
quota_error(dquot->dq_sb, "Data block full but it shouldn't");
*err = -EIO;
goto out_buf;
}
#endif
*err = write_blk(info, blk, buf);
if (*err < 0) {
quota_error(dquot->dq_sb, "Can't write quota data block %u",
blk);
goto out_buf;
}
dquot->dq_off = (blk << info->dqi_blocksize_bits) +
sizeof(struct qt_disk_dqdbheader) +
i * info->dqi_entry_size;
kfree(buf);
return blk;
out_buf:
kfree(buf);
return 0;
}
/* Insert reference to structure into the trie */
static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot,
uint *treeblk, int depth)
{
char *buf = getdqbuf(info->dqi_usable_bs);
int ret = 0, newson = 0, newact = 0;
__le32 *ref;
uint newblk;
if (!buf)
return -ENOMEM;
if (!*treeblk) {
ret = get_free_dqblk(info);
if (ret < 0)
goto out_buf;
*treeblk = ret;
memset(buf, 0, info->dqi_usable_bs);
newact = 1;
} else {
ret = read_blk(info, *treeblk, buf);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't read tree quota "
"block %u", *treeblk);
goto out_buf;
}
}
ref = (__le32 *)buf;
newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
if (!newblk)
newson = 1;
if (depth == info->dqi_qtree_depth - 1) {
#ifdef __QUOTA_QT_PARANOIA
if (newblk) {
quota_error(dquot->dq_sb, "Inserting already present "
"quota entry (block %u)",
le32_to_cpu(ref[get_index(info,
dquot->dq_id, depth)]));
ret = -EIO;
goto out_buf;
}
#endif
newblk = find_free_dqentry(info, dquot, &ret);
} else {
ret = do_insert_tree(info, dquot, &newblk, depth+1);
}
if (newson && ret >= 0) {
ref[get_index(info, dquot->dq_id, depth)] =
cpu_to_le32(newblk);
ret = write_blk(info, *treeblk, buf);
} else if (newact && ret < 0) {
put_free_dqblk(info, buf, *treeblk);
}
out_buf:
kfree(buf);
return ret;
}
/* Wrapper for inserting quota structure into tree */
static inline int dq_insert_tree(struct qtree_mem_dqinfo *info,
struct dquot *dquot)
{
int tmp = QT_TREEOFF;
#ifdef __QUOTA_QT_PARANOIA
if (info->dqi_blocks <= QT_TREEOFF) {
quota_error(dquot->dq_sb, "Quota tree root isn't allocated!");
return -EIO;
}
#endif
return do_insert_tree(info, dquot, &tmp, 0);
}
/*
* We don't have to be afraid of deadlocks as we never have quotas on quota
* files...
*/
int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
{
int type = dquot->dq_id.type;
struct super_block *sb = dquot->dq_sb;
ssize_t ret;
char *ddquot = getdqbuf(info->dqi_entry_size);
if (!ddquot)
return -ENOMEM;
/* dq_off is guarded by dqio_sem */
if (!dquot->dq_off) {
ret = dq_insert_tree(info, dquot);
if (ret < 0) {
quota_error(sb, "Error %zd occurred while creating "
"quota", ret);
kfree(ddquot);
return ret;
}
}
spin_lock(&dquot->dq_dqb_lock);
info->dqi_ops->mem2disk_dqblk(ddquot, dquot);
spin_unlock(&dquot->dq_dqb_lock);
ret = sb->s_op->quota_write(sb, type, ddquot, info->dqi_entry_size,
dquot->dq_off);
if (ret != info->dqi_entry_size) {
quota_error(sb, "dquota write failed");
if (ret >= 0)
ret = -ENOSPC;
} else {
ret = 0;
}
dqstats_inc(DQST_WRITES);
kfree(ddquot);
return ret;
}
EXPORT_SYMBOL(qtree_write_dquot);
/* Free dquot entry in data block */
static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot,
uint blk)
{
struct qt_disk_dqdbheader *dh;
char *buf = getdqbuf(info->dqi_usable_bs);
int ret = 0;
if (!buf)
return -ENOMEM;
if (dquot->dq_off >> info->dqi_blocksize_bits != blk) {
quota_error(dquot->dq_sb, "Quota structure has offset to "
"other block (%u) than it should (%u)", blk,
(uint)(dquot->dq_off >> info->dqi_blocksize_bits));
goto out_buf;
}
ret = read_blk(info, blk, buf);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't read quota data block %u",
blk);
goto out_buf;
}
dh = (struct qt_disk_dqdbheader *)buf;
le16_add_cpu(&dh->dqdh_entries, -1);
if (!le16_to_cpu(dh->dqdh_entries)) { /* Block got free? */
ret = remove_free_dqentry(info, buf, blk);
if (ret >= 0)
ret = put_free_dqblk(info, buf, blk);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't move quota data block "
"(%u) to free list", blk);
goto out_buf;
}
} else {
memset(buf +
(dquot->dq_off & ((1 << info->dqi_blocksize_bits) - 1)),
0, info->dqi_entry_size);
if (le16_to_cpu(dh->dqdh_entries) ==
qtree_dqstr_in_blk(info) - 1) {
/* Insert will write block itself */
ret = insert_free_dqentry(info, buf, blk);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't insert quota "
"data block (%u) to free entry list", blk);
goto out_buf;
}
} else {
ret = write_blk(info, blk, buf);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't write quota "
"data block %u", blk);
goto out_buf;
}
}
}
dquot->dq_off = 0; /* Quota is now unattached */
out_buf:
kfree(buf);
return ret;
}
/* Remove reference to dquot from tree */
static int remove_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot,
uint *blk, int depth)
{
char *buf = getdqbuf(info->dqi_usable_bs);
int ret = 0;
uint newblk;
__le32 *ref = (__le32 *)buf;
if (!buf)
return -ENOMEM;
ret = read_blk(info, *blk, buf);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't read quota data block %u",
*blk);
goto out_buf;
}
newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
if (depth == info->dqi_qtree_depth - 1) {
ret = free_dqentry(info, dquot, newblk);
newblk = 0;
} else {
ret = remove_tree(info, dquot, &newblk, depth+1);
}
if (ret >= 0 && !newblk) {
int i;
ref[get_index(info, dquot->dq_id, depth)] = cpu_to_le32(0);
/* Block got empty? */
for (i = 0; i < (info->dqi_usable_bs >> 2) && !ref[i]; i++)
;
/* Don't put the root block into the free block list */
if (i == (info->dqi_usable_bs >> 2)
&& *blk != QT_TREEOFF) {
put_free_dqblk(info, buf, *blk);
*blk = 0;
} else {
ret = write_blk(info, *blk, buf);
if (ret < 0)
quota_error(dquot->dq_sb,
"Can't write quota tree block %u",
*blk);
}
}
out_buf:
kfree(buf);
return ret;
}
/* Delete dquot from tree */
int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
{
uint tmp = QT_TREEOFF;
if (!dquot->dq_off) /* Even not allocated? */
return 0;
return remove_tree(info, dquot, &tmp, 0);
}
EXPORT_SYMBOL(qtree_delete_dquot);
/* Find entry in block */
static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info,
struct dquot *dquot, uint blk)
{
char *buf = getdqbuf(info->dqi_usable_bs);
loff_t ret = 0;
int i;
char *ddquot;
if (!buf)
return -ENOMEM;
ret = read_blk(info, blk, buf);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't read quota tree "
"block %u", blk);
goto out_buf;
}
ddquot = buf + sizeof(struct qt_disk_dqdbheader);
for (i = 0; i < qtree_dqstr_in_blk(info); i++) {
if (info->dqi_ops->is_id(ddquot, dquot))
break;
ddquot += info->dqi_entry_size;
}
if (i == qtree_dqstr_in_blk(info)) {
quota_error(dquot->dq_sb,
"Quota for id %u referenced but not present",
from_kqid(&init_user_ns, dquot->dq_id));
ret = -EIO;
goto out_buf;
} else {
ret = (blk << info->dqi_blocksize_bits) + sizeof(struct
qt_disk_dqdbheader) + i * info->dqi_entry_size;
}
out_buf:
kfree(buf);
return ret;
}
/* Find entry for given id in the tree */
static loff_t find_tree_dqentry(struct qtree_mem_dqinfo *info,
struct dquot *dquot, uint blk, int depth)
{
char *buf = getdqbuf(info->dqi_usable_bs);
loff_t ret = 0;
__le32 *ref = (__le32 *)buf;
if (!buf)
return -ENOMEM;
ret = read_blk(info, blk, buf);
if (ret < 0) {
quota_error(dquot->dq_sb, "Can't read quota tree block %u",
blk);
goto out_buf;
}
ret = 0;
blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
if (!blk) /* No reference? */
goto out_buf;
if (depth < info->dqi_qtree_depth - 1)
ret = find_tree_dqentry(info, dquot, blk, depth+1);
else
ret = find_block_dqentry(info, dquot, blk);
out_buf:
kfree(buf);
return ret;
}
/* Find entry for given id in the tree - wrapper function */
static inline loff_t find_dqentry(struct qtree_mem_dqinfo *info,
struct dquot *dquot)
{
return find_tree_dqentry(info, dquot, QT_TREEOFF, 0);
}
int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
{
int type = dquot->dq_id.type;
struct super_block *sb = dquot->dq_sb;
loff_t offset;
char *ddquot;
int ret = 0;
#ifdef __QUOTA_QT_PARANOIA
/* Invalidated quota? */
if (!sb_dqopt(dquot->dq_sb)->files[type]) {
quota_error(sb, "Quota invalidated while reading!");
return -EIO;
}
#endif
/* Do we know offset of the dquot entry in the quota file? */
if (!dquot->dq_off) {
offset = find_dqentry(info, dquot);
if (offset <= 0) { /* Entry not present? */
if (offset < 0)
quota_error(sb,"Can't read quota structure "
"for id %u",
from_kqid(&init_user_ns,
dquot->dq_id));
dquot->dq_off = 0;
set_bit(DQ_FAKE_B, &dquot->dq_flags);
memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
ret = offset;
goto out;
}
dquot->dq_off = offset;
}
ddquot = getdqbuf(info->dqi_entry_size);
if (!ddquot)
return -ENOMEM;
ret = sb->s_op->quota_read(sb, type, ddquot, info->dqi_entry_size,
dquot->dq_off);
if (ret != info->dqi_entry_size) {
if (ret >= 0)
ret = -EIO;
quota_error(sb, "Error while reading quota structure for id %u",
from_kqid(&init_user_ns, dquot->dq_id));
set_bit(DQ_FAKE_B, &dquot->dq_flags);
memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
kfree(ddquot);
goto out;
}
spin_lock(&dquot->dq_dqb_lock);
info->dqi_ops->disk2mem_dqblk(dquot, ddquot);
if (!dquot->dq_dqb.dqb_bhardlimit &&
!dquot->dq_dqb.dqb_bsoftlimit &&
!dquot->dq_dqb.dqb_ihardlimit &&
!dquot->dq_dqb.dqb_isoftlimit)
set_bit(DQ_FAKE_B, &dquot->dq_flags);
spin_unlock(&dquot->dq_dqb_lock);
kfree(ddquot);
out:
dqstats_inc(DQST_READS);
return ret;
}
EXPORT_SYMBOL(qtree_read_dquot);
/* Check whether dquot should not be deleted. We know we are
* the only one operating on dquot (thanks to dq_lock) */
int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
{
if (test_bit(DQ_FAKE_B, &dquot->dq_flags) &&
!(dquot->dq_dqb.dqb_curinodes | dquot->dq_dqb.dqb_curspace))
return qtree_delete_dquot(info, dquot);
return 0;
}
EXPORT_SYMBOL(qtree_release_dquot);
static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id,
unsigned int blk, int depth)
{
char *buf = getdqbuf(info->dqi_usable_bs);
__le32 *ref = (__le32 *)buf;
ssize_t ret;
unsigned int epb = info->dqi_usable_bs >> 2;
unsigned int level_inc = 1;
int i;
if (!buf)
return -ENOMEM;
for (i = depth; i < info->dqi_qtree_depth - 1; i++)
level_inc *= epb;
ret = read_blk(info, blk, buf);
if (ret < 0) {
quota_error(info->dqi_sb,
"Can't read quota tree block %u", blk);
goto out_buf;
}
for (i = __get_index(info, *id, depth); i < epb; i++) {
if (ref[i] == cpu_to_le32(0)) {
*id += level_inc;
continue;
}
if (depth == info->dqi_qtree_depth - 1) {
ret = 0;
goto out_buf;
}
ret = find_next_id(info, id, le32_to_cpu(ref[i]), depth + 1);
if (ret != -ENOENT)
break;
}
if (i == epb) {
ret = -ENOENT;
goto out_buf;
}
out_buf:
kfree(buf);
return ret;
}
int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid)
{
qid_t id = from_kqid(&init_user_ns, *qid);
int ret;
ret = find_next_id(info, &id, QT_TREEOFF, 0);
if (ret < 0)
return ret;
*qid = make_kqid(&init_user_ns, qid->type, id);
return 0;
}
EXPORT_SYMBOL(qtree_get_next_id);
| {
"pile_set_name": "Github"
} |
[Desktop Entry]
Encoding=UTF-8
Name=VeraCrypt
GenericName=VeraCrypt
Comment=VeraCrypt
Exec=/usr/bin/veracrypt
Icon=veracrypt
Terminal=false
Type=Application
Categories=Encryption;Encryption Tools;Utility;
| {
"pile_set_name": "Github"
} |
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeJoin = arrayProto.join;
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* _.join(['a', 'b', 'c'], '~');
* // => 'a~b~c'
*/
function join(array, separator) {
return array == null ? '' : nativeJoin.call(array, separator);
}
module.exports = join;
| {
"pile_set_name": "Github"
} |
@REM Copyright (c) Microsoft. All rights reserved.
@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
setlocal
set build-root=%~dp0..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi
rmdir /s /q %build-root%\cmake
mkdir %build-root%\cmake
if errorlevel 1 goto :eof
set build-platform=Win32
:args-loop
if "%1" equ "" goto args-done
if "%1" equ "--platform" goto arg-build-platform
call :usage && exit /b 1
:arg-build-platform
shift
if "%1" equ "" call :usage && exit /b 1
set build-platform=%1
if %build-platform% == x64 (
set CMAKE_DIR=shared-util_x64
) else if %build-platform% == arm (
set CMAKE_DIR=shared-util_arm
)
goto args-continue
:args-continue
shift
goto args-loop
:args-done
cd %build-root%\cmake
if %build-platform% == Win32 (
echo ***Running CMAKE for Win32***
cmake %build-root% -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=ON
if errorlevel 1 goto :eof
) else if %build-platform% == ARM (
echo ***Running CMAKE for ARM***
cmake %build-root% -G "Visual Studio 14 ARM" -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=ON
if errorlevel 1 goto :eof
) else (
echo ***Running CMAKE for Win64***
cmake %build-root% -G "Visual Studio 14 Win64" -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=ON
if errorlevel 1 goto :eof
)
msbuild /m umock_c.sln /p:Configuration=Release
if errorlevel 1 goto :eof
msbuild /m umock_c.sln /p:Configuration=Debug
if errorlevel 1 goto :eof
ctest -C "Debug" -V
if errorlevel 1 goto :eof
cd %build-root% | {
"pile_set_name": "Github"
} |
{
"name": "cloudscribe Pwa Demo",
"short_name": "Pwa Demo",
"description": "The most awesome application in the world",
"icons": [
{
"src": "/manifest/apple-touch-icon-60x60.png",
"sizes": "60x60",
"type": "image/png"
},
{
"src": "/manifest/apple-touch-icon-76x76.png",
"sizes": "76x76",
"type": "image/png"
},
{
"src": "/manifest/apple-touch-icon-120x120.png",
"sizes": "120x120",
"type": "image/png"
},
{
"src": "/manifest/apple-touch-icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
},
{
"src": "/manifest/apple-touch-icon-167x167.png",
"sizes": "167x167",
"type": "image/png"
},
{
"src": "/manifest/apple-touch-icon-180x180.png",
"sizes": "180x180",
"type": "image/png"
},
{
"src": "/manifest/pwa-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/manifest/pwa-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"display": "minimal-ui",
"start_url": "/"
} | {
"pile_set_name": "Github"
} |
package cn.nukkit.level;
import cn.nukkit.nbt.tag.CompoundTag;
import cn.nukkit.utils.BinaryStream;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.util.EnumMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import static cn.nukkit.level.GameRule.*;
@SuppressWarnings({"unchecked"})
public class GameRules {
private final EnumMap<GameRule, Value> gameRules = new EnumMap<>(GameRule.class);
private boolean stale;
private GameRules() {
}
public static GameRules getDefault() {
GameRules gameRules = new GameRules();
gameRules.gameRules.put(COMMAND_BLOCK_OUTPUT, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_DAYLIGHT_CYCLE, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_ENTITY_DROPS, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_FIRE_TICK, new Value(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_MOB_LOOT, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_MOB_SPAWNING, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_TILE_DROPS, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DO_WEATHER_CYCLE, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(DROWNING_DAMAGE, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(FALL_DAMAGE, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(FIRE_DAMAGE, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(KEEP_INVENTORY, new Value<>(Type.BOOLEAN, false));
gameRules.gameRules.put(MOB_GRIEFING, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(NATURAL_REGENERATION, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(PVP, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(SEND_COMMAND_FEEDBACK, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(SHOW_COORDINATES, new Value<>(Type.BOOLEAN, false));
gameRules.gameRules.put(TNT_EXPLODES, new Value<>(Type.BOOLEAN, true));
gameRules.gameRules.put(SHOW_DEATH_MESSAGE, new Value<>(Type.BOOLEAN, true));
return gameRules;
}
public Map<GameRule, Value> getGameRules() {
return ImmutableMap.copyOf(gameRules);
}
public boolean isStale() {
return stale;
}
public void refresh() {
stale = false;
}
public void setGameRule(GameRule gameRule, boolean value) {
if (!gameRules.containsKey(gameRule)) {
throw new IllegalArgumentException("Gamerule does not exist");
}
gameRules.get(gameRule).setValue(value, Type.BOOLEAN);
stale = true;
}
public void setGameRule(GameRule gameRule, int value) {
if (!gameRules.containsKey(gameRule)) {
throw new IllegalArgumentException("Gamerule does not exist");
}
gameRules.get(gameRule).setValue(value, Type.INTEGER);
stale = true;
}
public void setGameRule(GameRule gameRule, float value) {
if (!gameRules.containsKey(gameRule)) {
throw new IllegalArgumentException("Gamerule does not exist");
}
gameRules.get(gameRule).setValue(value, Type.FLOAT);
stale = true;
}
public void setGameRules(GameRule gameRule, String value) throws IllegalArgumentException {
Preconditions.checkNotNull(gameRule, "gameRule");
Preconditions.checkNotNull(value, "value");
switch (getGameRuleType(gameRule)) {
case BOOLEAN:
if (value.equalsIgnoreCase("true")) {
setGameRule(gameRule, true);
} else if (value.equalsIgnoreCase("false")) {
setGameRule(gameRule, false);
} else {
throw new IllegalArgumentException("Was not a boolean");
}
break;
case INTEGER:
setGameRule(gameRule, Integer.parseInt(value));
break;
case FLOAT:
setGameRule(gameRule, Float.parseFloat(value));
}
}
public boolean getBoolean(GameRule gameRule) {
return gameRules.get(gameRule).getValueAsBoolean();
}
public int getInteger(GameRule gameRule) {
Preconditions.checkNotNull(gameRule, "gameRule");
return gameRules.get(gameRule).getValueAsInteger();
}
public float getFloat(GameRule gameRule) {
Preconditions.checkNotNull(gameRule, "gameRule");
return gameRules.get(gameRule).getValueAsFloat();
}
public String getString(GameRule gameRule) {
Preconditions.checkNotNull(gameRule, "gameRule");
return gameRules.get(gameRule).value.toString();
}
public Type getGameRuleType(GameRule gameRule) {
Preconditions.checkNotNull(gameRule, "gameRule");
return gameRules.get(gameRule).getType();
}
public boolean hasRule(GameRule gameRule) {
return gameRules.containsKey(gameRule);
}
public GameRule[] getRules() {
return gameRules.keySet().toArray(new GameRule[gameRules.size()]);
}
// TODO: This needs to be moved out since there is not a separate compound tag in the LevelDB format for Game Rules.
public CompoundTag writeNBT() {
CompoundTag nbt = new CompoundTag();
for (Entry<GameRule, Value> entry : gameRules.entrySet()) {
nbt.putString(entry.getKey().getName(), entry.getValue().value.toString());
}
return nbt;
}
public void readNBT(CompoundTag nbt) {
Preconditions.checkNotNull(nbt);
for (String key : nbt.getTags().keySet()) {
Optional<GameRule> gameRule = GameRule.parseString(key);
if (!gameRule.isPresent()) {
continue;
}
setGameRules(gameRule.get(), nbt.getString(key));
}
}
public enum Type {
UNKNOWN {
@Override
void write(BinaryStream pk, Value value) {
}
},
BOOLEAN {
@Override
void write(BinaryStream pk, Value value) {
pk.putBoolean(value.getValueAsBoolean());
}
},
INTEGER {
@Override
void write(BinaryStream pk, Value value) {
pk.putUnsignedVarInt(value.getValueAsInteger());
}
},
FLOAT {
@Override
void write(BinaryStream pk, Value value) {
pk.putLFloat(value.getValueAsFloat());
}
};
abstract void write(BinaryStream pk, Value value);
}
public static class Value<T> {
private final Type type;
private T value;
public Value(Type type, T value) {
this.type = type;
this.value = value;
}
private void setValue(T value, Type type) {
if (this.type != type) {
throw new UnsupportedOperationException("Rule not of type " + type.name().toLowerCase());
}
this.value = value;
}
public Type getType() {
return type;
}
private boolean getValueAsBoolean() {
if (type != Type.BOOLEAN) {
throw new UnsupportedOperationException("Rule not of type boolean");
}
return (Boolean) value;
}
private int getValueAsInteger() {
if (type != Type.INTEGER) {
throw new UnsupportedOperationException("Rule not of type integer");
}
return (Integer) value;
}
private float getValueAsFloat() {
if (type != Type.FLOAT) {
throw new UnsupportedOperationException("Rule not of type float");
}
return (Float) value;
}
public void write(BinaryStream pk) {
pk.putUnsignedVarInt(type.ordinal());
type.write(pk, this);
}
}
}
| {
"pile_set_name": "Github"
} |
###### Mathematical symbols
$$include '../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../support/utils'
import [designParameters] from '../../meta/aesthetics'
glyph-module
glyph-block NotGlyphFn : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-export notGlyph
define [notGlyphGeneric newid unicode oldid top bot prop shift F] : begin
local component : F
fallback top BgOpTop
fallback bot BgOpBot
mix SB RightSB [fallback prop 0.25]
mix RightSB SB [fallback prop 0.25]
adviceBlackness 4
fallback shift 0
create-glyph (newid || 'not' + oldid) unicode : glyph-proc
include : refer-glyph oldid
include component
define [notGlyph] : params [newid unicode oldid top bot prop shift] : begin
notGlyphGeneric newid unicode oldid top bot prop shift
lambda [t b l r sw sh] : begin
local slashBarName ".NotGlyphSlash{\(l)}{\(r)}{\(t)}{\(b)}{\(sw)}"
if [not : query-glyph slashBarName] : begin
create-glyph slashBarName : AsRadical : dispiro
widths.center sw
flat l b
curl r t
return : WithTransform [Translate sh 0] [refer-glyph slashBarName]
define [notGlyph.right] : params [newid unicode oldid top bot prop shift] : begin
notGlyph newid unicode oldid top bot prop (-OperatorStroke * 0.5)
define [notGlyph.left] : params [newid unicode oldid top bot prop shift] : begin
notGlyph newid unicode oldid top bot prop (OperatorStroke * 0.5)
define [notGlyph.generic] : params [newid unicode oldid top bot prop shift F] : begin
notGlyphGeneric newid unicode oldid top bot prop shift F
glyph-block Symbol-Math-Letter-Like : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Recursive-Build : Miniature
glyph-block-import Letter-Latin-Upper-A : LambdaShape AMaskShape DeltaShape
glyph-block-import Letter-Latin-Upper-E : RevEShape
create-glyph 'micro' 0xB5 : glyph-proc
include [refer-glyph 'grek/mu'] AS_BASE
if SLAB : if (!para.isItalic) : begin
include : tagged 'serifLB' : CenterBottomSerif (SB + HalfStroke * HVContrast) Descender Jut
create-glyph 'forall' 0x2200 : glyph-proc
include : LambdaShape CAP OperatorStroke true
eject-contour 'serif'
include : intersection
AMaskShape CAP OperatorStroke true
HBar 0 Width (XH / 2) OperatorStroke
include : FlipAround Middle (CAP / 2)
create-glyph 'exists' 0x2203 : glyph-proc
include : RevEShape (top -- CAP) (pyBar -- 0.51) (noSerif -- true)
create-glyph 'emptyset' 0x2205 : glyph-proc
include : OShape CAP 0 SB RightSB OperatorStroke
local fine : OperatorStroke / 2
include : dispiro
widths.center OperatorStroke
flat (SB + O + fine) [mix CAP 0 1.05]
curl (RightSB - O - fine) [mix 0 CAP 1.05]
create-glyph 'increment' 0x2206 : glyph-proc
include : MarkSet.capital
include : DeltaShape CAP OperatorStroke true
turned 'nabla' 0x2207 'increment' Middle (CAP / 2)
if [not recursive] : for-width-kinds WideWidth1 : do
local s : (RightSB - SB - O * 4 + (MosaicWidth - Width) * 0.5) / CAP
local df : Miniature
glyphs -- {'eight.lnum' 'rotetedpropto'}
crowd -- 4
scale -- s
slopeAngle -- 0
create-glyph [MangleName 'infty'] [MangleUnicode 0x221E] : glyph-proc
set-width MosaicWidth
include : df.queryByName 'eight.lnum'
include : Translate (-(Width / 2)) (-CAP / 2)
include : Rotate (Math.PI / 2)
include : Scale s
include : Translate (MosaicWidth / 2) SymbolMid
include : Italify
create-glyph [MangleName 'propto'] [MangleUnicode 0x221D] : glyph-proc
set-width MosaicWidth
include : df.queryByName 'rotetedpropto'
include : Translate (-(Width / 2)) (-CAP / 2)
include : Rotate (Math.PI / 2)
include : Scale s
include : Translate (MosaicWidth / 2) SymbolMid
include : Italify
create-glyph 'partial' 0x2202 : glyph-proc
include : MarkSet.b
include : OShape (CAP * 0.65) 0 SB RightSB OperatorStroke
include : dispiro
widths.lhs OperatorStroke
flat (RightSB - OX) SmallSmoothA
curl (RightSB - OX) (CAP - SmallSmoothB)
hookend (CAP - O)
g4 SB (CAP - Hook)
glyph-block Symbol-Math-Frame-And-Geometry : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
local sw GeometryStroke
local kBox : 2 / 3
local leftBox : SB * kBox
local rightBox : Width - SB * kBox
local radiusBox : (rightBox - leftBox) / 2
local topBox : SymbolMid + radiusBox
local bottomBox : SymbolMid - radiusBox
local kCircle : 2 / 3
local leftCircle : SB * kCircle
local rightCircle : Width - SB * kCircle
local radiusCircle : (rightCircle - leftCircle) / 2
create-glyph 'mathO' : glyph-proc
include : dispiro
widths.lhs GeometryStroke
g4 Middle (SymbolMid + radiusCircle - O)
archv nothing 2
g4 (leftCircle + O) SymbolMid
arcvh nothing 2
g4 Middle (SymbolMid - radiusCircle + O)
archv nothing 2
g4 (rightCircle - O) SymbolMid
arcvh nothing 2
close
create-glyph 'mathOOutline' : glyph-proc
include : spiro-outline
g4 Middle (SymbolMid + radiusCircle)
archv nothing 2
g4 (leftCircle) SymbolMid
arcvh nothing 2
g4 Middle (SymbolMid - radiusCircle)
archv nothing 2
g4 (rightCircle) SymbolMid
arcvh nothing 2
close
create-glyph 'mathBoxOutline' : glyph-proc
include : spiro-outline
corner leftBox topBox
corner leftBox bottomBox
corner rightBox bottomBox
corner rightBox topBox
create-glyph 'mathBox' : glyph-proc
include : intersection [refer-glyph 'mathBoxOutline'] : union
dispiro [widths.lhs sw] [flat leftBox topBox] [curl leftBox bottomBox]
dispiro [widths.lhs sw] [flat leftBox bottomBox] [curl rightBox bottomBox]
dispiro [widths.lhs sw] [flat rightBox bottomBox] [curl rightBox topBox]
dispiro [widths.lhs sw] [flat rightBox topBox] [curl leftBox topBox]
for-width-kinds WideWidth1
local radiusBig : (TackTop - TackBot) / 2 * [Math.sqrt MosaicWidthScalar]
local leftBig : MosaicMiddle - radiusBig
local rightBig : MosaicMiddle + radiusBig
create-glyph [MangleName 'mathOBig'] : glyph-proc
set-width MosaicWidth
include : dispiro
widths.lhs GeometryStroke
g4 MosaicMiddle (SymbolMid + radiusBig - O)
archv nothing 2
g4 (leftBig + O) SymbolMid
arcvh nothing 2
g4 MosaicMiddle (SymbolMid - radiusBig + O)
archv nothing 2
g4 (rightBig - O) SymbolMid
arcvh nothing 2
close
create-glyph [MangleName 'mathOOutlineBig'] : glyph-proc
set-width MosaicWidth
include : spiro-outline
g4 MosaicMiddle (SymbolMid + radiusBig)
archv nothing 2
g4 (leftBig) SymbolMid
arcvh nothing 2
g4 MosaicMiddle (SymbolMid - radiusBig)
archv nothing 2
g4 (rightBig) SymbolMid
arcvh nothing 2
close
create-glyph 'mathRightTriangle' 0x22BF : glyph-proc
include : intersection
spiro-outline
corner leftBox bottomBox
corner rightBox bottomBox
corner rightBox topBox
union
dispiro [widths.lhs sw] [flat leftBox bottomBox] [curl rightBox bottomBox]
dispiro [widths.lhs sw] [flat rightBox bottomBox] [curl rightBox topBox]
dispiro [widths.lhs sw] [flat rightBox topBox] [curl leftBox bottomBox]
create-glyph 'angle' 0x2220 : glyph-proc
include : intersection
spiro-outline
corner leftBox bottomBox
corner rightBox bottomBox
corner rightBox topBox
union
dispiro [widths.lhs sw] [flat leftBox bottomBox] [curl rightBox bottomBox]
dispiro [widths.lhs sw] [flat rightBox topBox] [curl leftBox bottomBox]
create-glyph 'rightAngle' 0x221F : glyph-proc
include : intersection
spiro-outline
corner leftBox bottomBox
corner rightBox bottomBox
corner rightBox topBox
corner leftBox topBox
union
dispiro [widths.lhs sw] [flat leftBox bottomBox] [curl rightBox bottomBox]
dispiro [widths.lhs sw] [flat leftBox topBox] [curl leftBox bottomBox]
glyph-block Symbol-Math-Arith : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-export PlusShape
define [PlusShape left right s sw] : union
HBar left right SymbolMid [fallback sw OperatorStroke]
VBar (Middle + [fallback s 0]) PlusTop PlusBot [fallback sw OperatorStroke]
create-glyph 'plus' '+' : PlusShape SB RightSB
create-glyph 'minus' 0x2212 : HBar SB RightSB SymbolMid OperatorStroke
create-glyph 'innerPlus' : PlusShape SB RightSB 0 GeometryStroke
create-glyph 'innerMinus' : HBar SB RightSB SymbolMid GeometryStroke
create-glyph 'minusDot' 0x2238 : composite-proc [refer-glyph 'minus']
DotAt Middle PlusTop DotRadius
create-glyph 'geometricProportion' 0x223A : composite-proc
refer-glyph 'minus'
DotAt (SB + DotRadius) PlusTop DotRadius
DotAt (SB + DotRadius) PlusBot DotRadius
DotAt (RightSB - DotRadius) PlusTop DotRadius
DotAt (RightSB - DotRadius) PlusBot DotRadius
create-glyph 'hermetianConjugateMatrixPlus' 0x22B9 : difference
PlusShape SB RightSB
SquareAt Middle SymbolMid DotRadius
create-glyph 'minusColon' 0x2239 : glyph-proc
include : refer-glyph "baselineDot"
include : refer-glyph "xhDot"
local sbSquash 0.5
local delta : Math.max 0 : Width / 2 - DotRadius - SB * sbSquash
include : Upright
include : Translate (+delta) (SymbolMid - XH / 2)
include : Italify
include : HBar (SB * sbSquash) (RightSB - DotSize) SymbolMid OperatorStroke
create-glyph 'plusminus' 0xB1 : glyph-proc
include : HBarBottom SB RightSB 0 OperatorStroke
include : refer-glyph "plus"
turned 'minusplus' 0x2213 'plusminus' Middle SymbolMid
create-glyph 'dotplus' 0x2214 : glyph-proc
local gap : adviceBlackness 12
include : union
DotAt Middle (SymbolMid * 2 - OperatorStroke / 2) DotRadius
difference
refer-glyph 'plus'
DotAt Middle (SymbolMid * 2 - OperatorStroke / 2) (DotRadius + gap)
define MultiplyHalfHeight : (RightSB - SB) / 2
define swBowtie : adviceBlackness 4
define [MultiplyMask p1 p2] : spiro-outline
corner (Middle - p1 * MultiplyHalfHeight) (SymbolMid - p1 * MultiplyHalfHeight)
corner (Middle + p2 * MultiplyHalfHeight) (SymbolMid + p2 * MultiplyHalfHeight)
corner (Middle + p2 * MultiplyHalfHeight) (SymbolMid - p2 * MultiplyHalfHeight)
corner (Middle - p1 * MultiplyHalfHeight) (SymbolMid + p1 * MultiplyHalfHeight)
define [MultiplyStroke1Shape s p1 p2] : dispiro
widths.center s
flat (Middle - p1 * MultiplyHalfHeight) (SymbolMid - p1 * MultiplyHalfHeight)
curl (Middle + p2 * MultiplyHalfHeight) (SymbolMid + p2 * MultiplyHalfHeight)
define [MultiplyStroke2Shape s p1 p2] : dispiro
widths.center s
flat (Middle - p1 * MultiplyHalfHeight) (SymbolMid + p1 * MultiplyHalfHeight)
curl (Middle + p2 * MultiplyHalfHeight) (SymbolMid - p2 * MultiplyHalfHeight)
create-glyph 'multiply' 0xD7 : glyph-proc
include : MultiplyStroke1Shape OperatorStroke 1 1
include : MultiplyStroke2Shape OperatorStroke 1 1
create-glyph 'bowtie' 0x22C8 : glyph-proc
include : union
intersection
MultiplyMask 1 1
union
VBarLeft SB (SymbolMid - MultiplyHalfHeight) (SymbolMid + MultiplyHalfHeight) swBowtie
VBarRight RightSB (SymbolMid - MultiplyHalfHeight) (SymbolMid + MultiplyHalfHeight) swBowtie
intersection
Rect ParenTop ParenBot SB RightSB
union
MultiplyStroke1Shape swBowtie 1 1
MultiplyStroke2Shape swBowtie 1 1
create-glyph 'bowtieLeft' 0x22C9 : glyph-proc
include : union
intersection
MultiplyMask 1 1
VBarLeft SB (SymbolMid - MultiplyHalfHeight) (SymbolMid + MultiplyHalfHeight) swBowtie
intersection
Rect ParenTop ParenBot SB [mix SB RightSB 2]
union
MultiplyStroke1Shape swBowtie 1 1
MultiplyStroke2Shape swBowtie 1 1
create-glyph 'bowtieRight' 0x22CA : glyph-proc
include : union
intersection
MultiplyMask 1 1
VBarRight RightSB (SymbolMid - MultiplyHalfHeight) (SymbolMid + MultiplyHalfHeight) swBowtie
intersection
Rect ParenTop ParenBot [mix RightSB SB 2] RightSB
union
MultiplyStroke1Shape swBowtie 1 1
MultiplyStroke2Shape swBowtie 1 1
create-glyph 'leftSemidirectProduct' 0x22CB : glyph-proc
include : MultiplyStroke1Shape OperatorStroke 1 0
include : MultiplyStroke2Shape OperatorStroke 1 1
create-glyph 'rightSemidirectProduct' 0x22CC : glyph-proc
include : MultiplyStroke1Shape OperatorStroke 1 1
include : MultiplyStroke2Shape OperatorStroke 0 1
create-glyph 'innerMultiplyStroke1' : glyph-proc
include : MultiplyStroke1Shape GeometryStroke 1 1
create-glyph 'innerMultiply' : glyph-proc
include : MultiplyStroke1Shape GeometryStroke 1 1
include : MultiplyStroke2Shape GeometryStroke 1 1
create-glyph 'divide' 0xF7 : glyph-proc
include : refer-glyph "minus"
local radius : (RightSB - SB) / 2
include : DotAt Middle (SymbolMid + radius) DotRadius
include : DotAt Middle (SymbolMid - radius) DotRadius
do
define fine : adviceBlackness 5.5
define radius : Math.max ((RightSB - SB) / 12) (fine / 2)
define barOffset radius
define dotCenterOffset : OX + fine + radius
create-glyph 'originalOf' 0x22b6 : glyph-proc
include : difference
union
HBar (SB + barOffset) (RightSB - barOffset) SymbolMid OperatorStroke
DotAt (SB + dotCenterOffset) SymbolMid (radius + fine)
DotAt (RightSB - dotCenterOffset) SymbolMid (radius + fine)
DotAt (SB + dotCenterOffset) SymbolMid radius
create-glyph 'imageOf' 0x22b7 : glyph-proc
include : difference
union
HBar (SB + barOffset) (RightSB - barOffset) SymbolMid OperatorStroke
DotAt (SB + dotCenterOffset) SymbolMid (radius + fine)
DotAt (RightSB - dotCenterOffset) SymbolMid (radius + fine)
DotAt (RightSB - dotCenterOffset) SymbolMid radius
create-glyph 'multimap' 0x22b8 : glyph-proc
include : difference
union
HBar SB (RightSB - barOffset) SymbolMid OperatorStroke
DotAt (RightSB - dotCenterOffset) SymbolMid (radius + fine)
DotAt (RightSB - dotCenterOffset) SymbolMid radius
glyph-block Symbol-Math-Dots-And-Colons : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
local radius1 PeriodRadius
local radius : Math.min PeriodRadius (0.5 * [adviceBlackness 3.5] * PeriodSize / Stroke)
local left : mix 0 Width (1 / 4)
local right : mix 0 Width (3 / 4)
create-glyph 'therefore' 0x2234 : glyph-proc
include : Ring (XH - O) (XH - radius * 2 + O) (Middle - radius + O) (Middle + radius - O) true
include : Ring (radius * 2 - O) O (left - radius + O) (left + radius - O) true
include : Ring (radius * 2 - O) O (right - radius + O) (right + radius - O) true
create-glyph 'because' 0x2235 : glyph-proc
include : Ring (XH - O) (XH - radius * 2 + O) (left - radius + O) (left + radius - O) true
include : Ring (XH - O) (XH - radius * 2 + O) (right - radius + O) (right + radius - O) true
include : Ring (radius * 2 - O) O (Middle - radius + O) (Middle + radius - O) true
create-glyph 'mathcolon' 0x2236 : glyph-proc
include : Ring (PeriodRadius * 2 - O) O (Middle - PeriodRadius + O) (Middle + PeriodRadius - O) true
include : Ring (XH - O) (XH - PeriodRadius * 2 + O) (Middle - PeriodRadius + O) (Middle + PeriodRadius - O) true
create-glyph 'coloncolon' 0x2237 : glyph-proc
include : Ring (radius * 2 - O) O (left - radius + O) (left + radius - O) true
include : Ring (radius * 2 - O) O (right - radius + O) (right + radius - O) true
include : Ring (XH - O) (XH - radius * 2 + O) (left - radius + O) (left + radius - O) true
include : Ring (XH - O) (XH - radius * 2 + O) (right - radius + O) (right + radius - O) true
create-glyph 'mathcdot' : glyph-proc
include : Ring (SymbolMid + PeriodRadius - O) (SymbolMid - PeriodRadius + O) (Middle - PeriodRadius + O) (Middle + PeriodRadius - O) true
for-width-kinds WideWidth1
create-glyph [MangleName 'mathcdotBig'] : glyph-proc
set-width MosaicWidth
include : Ring (SymbolMid + PeriodRadius - O) (SymbolMid - PeriodRadius + O) (MosaicMiddle - PeriodRadius + O) (MosaicMiddle + PeriodRadius - O) true
create-glyph [MangleName 'innerPlusBig'] : glyph-proc
set-width MosaicWidth
include : union
HBar SB (MosaicWidth - SB) SymbolMid GeometryStroke
VBar MosaicMiddle [mix SymbolMid PlusTop MosaicWidthScalar] [mix SymbolMid PlusBot MosaicWidthScalar] GeometryStroke
create-glyph [MangleName 'innerMultiplyStroke1Big'] : glyph-proc
set-width MosaicWidth
local radius : (RightSB - SB) / 2 * [Math.sqrt MosaicWidthScalar]
include : dispiro
widths.center GeometryStroke
flat (MosaicMiddle - radius) (SymbolMid - radius)
curl (MosaicMiddle + radius) (SymbolMid + radius)
create-glyph [MangleName 'innerMultiplyStroke2Big'] : glyph-proc
set-width MosaicWidth
local radius : (RightSB - SB) / 2 * [Math.sqrt MosaicWidthScalar]
include : dispiro
widths.center GeometryStroke
flat (MosaicMiddle + radius) (SymbolMid - radius)
curl (MosaicMiddle - radius) (SymbolMid + radius)
create-glyph [MangleName 'innerMultiplyBig'] : glyph-proc
set-width MosaicWidth
include : refer-glyph : MangleName "innerMultiplyStroke1Big"
include : refer-glyph : MangleName "innerMultiplyStroke2Big"
alias 'mathAsterisk' 0x2217 'opAsterisk.low'
glyph-block Symbol-Math-Circled : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
create-glyph 0x2295 : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'innerPlus']
create-glyph 0x2296 : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'innerMinus']
create-glyph 0x2297 : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'innerMultiply']
create-glyph 0x2298 : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'innerMultiplyStroke1']
create-glyph 0x2299 : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'mathcdot']
create-glyph 0x229A : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'smallWhiteCircle.NWID']
create-glyph 0x229B : composite-proc [refer-glyph 'mathO']
intersection [refer-glyph 'mathOOutline'] [refer-glyph 'mathAsterisk']
for-width-kinds WideWidth1
create-glyph [MangleName 'uni2A00'] [MangleUnicode 0x2A00] : composite-proc
refer-glyph : MangleName 'mathOBig'
intersection
refer-glyph : MangleName 'mathOOutlineBig'
refer-glyph : MangleName 'mathcdotBig'
create-glyph [MangleName 'uni2A01'] [MangleUnicode 0x2A01] : composite-proc
refer-glyph : MangleName 'mathOBig'
intersection
refer-glyph : MangleName 'mathOOutlineBig'
refer-glyph : MangleName 'innerPlusBig'
create-glyph [MangleName 'uni2A02'] [MangleUnicode 0x2A02] : composite-proc
refer-glyph : MangleName 'mathOBig'
intersection
refer-glyph : MangleName 'mathOOutlineBig'
refer-glyph : MangleName 'innerMultiplyBig'
create-glyph 0x229D : composite-proc [refer-glyph 'mathO'] : intersection
refer-glyph 'mathOOutline'
HBar (SB + GeometryStroke) (RightSB - GeometryStroke) SymbolMid GeometryStroke
local eqS : Math.min GeometryStroke ((RightSB - SB) / 8)
local eqD : Math.max eqS ((RightSB - SB) / 6)
create-glyph 0x229C : composite-proc [refer-glyph 'mathO'] : intersection
refer-glyph 'mathOOutline'
union
HBar (SB + eqS) (RightSB - eqS) (SymbolMid + eqD) eqS
HBar (SB + eqS) (RightSB - eqS) (SymbolMid - eqD) eqS
glyph-block Symbol-Math-Boxed : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
create-glyph 0x229E : composite-proc [refer-glyph 'mathBox']
intersection [refer-glyph 'mathBoxOutline'] [refer-glyph 'innerPlus']
create-glyph 0x229F : composite-proc [refer-glyph 'mathBox']
intersection [refer-glyph 'mathBoxOutline'] [refer-glyph 'innerMinus']
create-glyph 0x22A0 : composite-proc [refer-glyph 'mathBox']
intersection [refer-glyph 'mathBoxOutline'] [refer-glyph 'innerMultiply']
create-glyph 0x22A1 : composite-proc [refer-glyph 'mathBox']
intersection [refer-glyph 'mathBoxOutline'] [refer-glyph 'mathcdot']
glyph-block Symbol-Math-VAndCup : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Latin-Upper-U : UShape
glyph-block-import Letter-Greek-Pi : PiShape
glyph-block-import Symbol-Arrow : ArrowShape
create-glyph 'vee' 0x2228 : glyph-proc
include : dispiro
widths.center OperatorStroke
flat SB OperTop [heading Downward]
curl Middle OperBot [heading Downward]
include : dispiro
widths.center OperatorStroke
flat RightSB OperTop [heading Downward]
curl Middle OperBot [heading Downward]
turned 'wedge' 0x2227 'vee' Middle SymbolMid
create-glyph 'curlyVee' 0x22CE : glyph-proc
local fine : CThin * OperatorStroke
include : dispiro
g4 SB OperTop [widths.center OperatorStroke]
straight.down.end (Middle - OperatorStroke / 2 * HVContrast) OperBot [widths.heading fine 0 Downward]
include : dispiro
widths.center OperatorStroke
g4 RightSB OperTop [widths.center OperatorStroke]
straight.down.end (Middle + OperatorStroke / 2 * HVContrast) OperBot [widths.heading 0 fine Downward]
turned 'curlyWedge' 0x22CF 'curlyVee' Middle SymbolMid
create-glyph 'doubleVee' 0x2A54 : glyph-proc
define sw : adviceBlackness 6
include : dispiro
widths.center sw
flat SB OperTop [heading Downward]
curl Middle OperBot [heading Downward]
include : dispiro
widths.center sw
flat RightSB OperTop [heading Downward]
curl Middle OperBot [heading Downward]
define offsetRatio : 1 / 4
define bias : (RightSB - SB) * offsetRatio
define a : dispiro
widths.center sw
flat (SB + bias) OperTop [heading Downward]
curl (Middle + bias) OperBot [heading Downward]
define b : dispiro
widths.center sw
flat (RightSB - bias) OperTop [heading Downward]
curl (Middle - bias) OperBot [heading Downward]
include : union
intersection a b
difference
union a b
spiro-outline
corner 0 OperBot
corner Width OperBot
corner Width [mix OperBot OperTop (1 - 2 * offsetRatio)]
corner 0 [mix OperBot OperTop (1 - 2 * offsetRatio)]
turned 'doubleWedge' 0x2A53 'doubleVee' Middle SymbolMid
create-glyph 'cup' 0x222A : glyph-proc
include : UShape [DivFrame 1] OperTop OperBot
oper -- true
stroke -- OperatorStroke
create-glyph 'cupDot' 0x228D : glyph-proc
include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
include : DotAt Middle (OperBot + Smooth) [Math.min DotRadius ((RightSB - SB - OperatorStroke * HVContrast * 2) * (1 / 3))]
create-glyph 'cupArrowLeft' 0x228C : glyph-proc
include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
local mockUpscale : OperatorStroke / [adviceBlackness 6]
local arrowLength : mockUpscale * [Math.min (RightSB - SB - OperatorStroke * HVContrast * 2) (Width * 0.6)]
include : new-glyph : glyph-proc
include : ArrowShape
Middle + arrowLength / 2
OperBot + Smooth
Middle - arrowLength / 2
OperBot + Smooth
arrowLength * 0.5
include : Upright
include : Translate (-Middle) (-OperBot - Smooth)
include : Scale (1 / mockUpscale) (1 / mockUpscale)
include : Translate Middle (OperBot + Smooth)
include : Italify
create-glyph 'cupPlus' 0x228E : glyph-proc
include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
local sw : adviceBlackness 6
local size : Math.min (RightSB - SB - OperatorStroke * HVContrast * (2 + 0.5 * sw / OperatorStroke)) ((RightSB - SB) * 0.8)
include : dispiro
widths.center sw
corner (Middle - size / 2) (OperBot + Smooth)
corner (Middle + size / 2) (OperBot + Smooth)
include : dispiro
widths.center sw
corner Middle (OperBot + Smooth - size / 2)
corner Middle (OperBot + Smooth + size / 2)
create-glyph 'doubleCup' 0x22D3 : glyph-proc
local sw : adviceBlackness 6
local gap : Math.max (Width / 8) (sw / 2)
include : UShape [DivFrame 1] OperTop OperBot
oper -- true
stroke -- sw
include : UShape [DivFrame 1] OperTop OperBot
oper -- true
stroke -- sw
offset -- (sw + gap)
sma -- [SmoothAOf (Smooth - sw - gap) Width]
smb -- [SmoothBOf (Smooth - sw - gap) Width]
turned 'cap' 0x2229 'cup' Middle SymbolMid
turned 'capDot' 0x2A40 'cupDot' Middle SymbolMid
turned 'doubleCap' 0x22D2 'doubleCup' Middle SymbolMid
create-glyph 'squareCap' 0x2293 : glyph-proc
include : PiShape OperTop OperBot (shrinkrate -- 0) (_fine -- OperatorStroke) (div -- 1) (noSerif -- true)
turned 'squareCup' 0x2294 'squareCap' Middle SymbolMid
glyph-block Symbol-Math-Logicals : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
create-glyph 'negate' 0xAC : glyph-proc
include : refer-glyph "minus"
include : VBarRight RightSB (SymbolMid - (RightSB - SB) * 0.55) SymbolMid OperatorStroke
create-glyph 'revNegate' 0x2310 : glyph-proc
include : refer-glyph "minus"
include : VBarLeft SB (SymbolMid - (RightSB - SB) * 0.55) SymbolMid OperatorStroke
local top TackTop
local bot TackBot
create-glyph 'vdash' 0x22A2 : glyph-proc
include : HBar SB RightSB SymbolMid OperatorStroke
include : VBarLeft SB top bot OperatorStroke
turned 'dashv' 0x22A3 'vdash' Middle SymbolMid
create-glyph 'assert' 0x22A6 : glyph-proc
local l : mix Middle SB designParameters.logic_narrow_shrink
local r : mix Middle RightSB designParameters.logic_narrow_shrink
include : HBar l r SymbolMid OperatorStroke
include : VBarLeft l top bot OperatorStroke
create-glyph 'models' 0x22A7 : glyph-proc
local l : mix Middle SB designParameters.logic_narrow_shrink
local r : mix Middle RightSB designParameters.logic_narrow_shrink
include : HBar l r [mix SymbolMid top (1 / 3)] OperatorStroke
include : HBar l r [mix SymbolMid bot (1 / 3)] OperatorStroke
include : VBarLeft l top bot OperatorStroke
create-glyph 'tautology' 0x22A8 : glyph-proc
local l : mix Middle SB 1
local r : mix Middle RightSB 1
include : HBar l r [mix SymbolMid top (1 / 3)] OperatorStroke
include : HBar l r [mix SymbolMid bot (1 / 3)] OperatorStroke
include : VBarLeft l top bot OperatorStroke
create-glyph 'forces' 0x22A9 : glyph-proc
local l : mix Middle SB 1
local r : mix Middle RightSB 1
local vs : adviceBlackness 4
local m : mix l (r - vs) (3 / 5)
include : HBar m r SymbolMid OperatorStroke
include : VBarLeft l top bot vs
include : VBar m top bot vs
create-glyph 'tripleBarForces' 0x22AA : glyph-proc
local l : mix Middle SB 1
local r : mix Middle RightSB 1
local vs : adviceBlackness 5
local m : mix l (r - vs) (3 / 4)
include : HBar m r SymbolMid OperatorStroke
include : VBarLeft l top bot vs
include : VBar m top bot vs
include : VBar ([mix l m (1/2)] + vs / 4 * HVContrast) top bot vs
create-glyph 'doubleForces' 0x22AB : glyph-proc
local l : mix Middle SB 1
local r : mix Middle RightSB 1
local vs : adviceBlackness 4
local m : mix l (r - vs) (3 / 5)
include : HBar m r [mix SymbolMid top (1 / 3)] OperatorStroke
include : HBar m r [mix SymbolMid bot (1 / 3)] OperatorStroke
include : VBarLeft l top bot vs
include : VBar m top bot vs
create-glyph 'top' 0x22A4 : glyph-proc
include : HBarTop SB RightSB top OperatorStroke
include : VBar Middle top bot OperatorStroke
create-glyph 'topring' 0x2355 : glyph-proc
define mid : mix bot (top - OperatorStroke / 2) 0.5
define w : (RightSB - SB) * 0.4
define fine : Math.min (w / 2.5) [adviceBlackness 5]
include : HBarTop SB RightSB top OperatorStroke
include : VBar Middle top (mid + w) OperatorStroke
include : VBar Middle (mid - w) bot OperatorStroke
include : VBar Middle (mid + w) (mid - w) fine
include : OShape (mid + w) (mid - w) (Middle - w) (Middle + w) fine
turned 'bot' 0x22A5 'top' Middle SymbolMid
turned 'botring' 0x234E 'topring' Middle SymbolMid
create-glyph 'perpendicular' 0x27C2 : glyph-proc
include : HBarBottom SB RightSB 0 OperatorStroke
include : VBar Middle (SymbolMid * 2) 0 OperatorStroke
create-glyph 'endOfProof' 0x220E : glyph-proc
include : Rect TackTop TackBot SB RightSB
glyph-block Symbol-Math-Relation : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Marks : TildeShape
glyph-block-export dH LessSlope
glyph-block-export LessShape GreaterShape LigationLessShape LigationGreaterShape
glyph-block-export EqualShape EqualHole IdentShape IdentHole EqualHalfSpace
glyph-block-import Symbol-Arrow : ArrowShape
define EqualHalfSpace : (OperTop - OperBot) * 2 * designParameters.equal_wideness
define LessSlope : (4 / 13) * (OperTop - OperBot) / (RightSB - SB)
define dH : LessSlope * (RightSB - SB)
define lessEqDist : Math.max [adviceBlackness 4] (XH * 0.16)
define [EqualShape left right] : union
HBar left right (SymbolMid + EqualHalfSpace) OperatorStroke
HBar left right (SymbolMid - EqualHalfSpace) OperatorStroke
define [EqualHole x]
VBar x (SymbolMid - EqualHalfSpace) (SymbolMid + EqualHalfSpace) [adviceBlackness 6]
define [IdentShape left right] : union
HBar left right (SymbolMid + EqualHalfSpace * 1.5) OperatorStroke
HBar left right SymbolMid OperatorStroke
HBar left right (SymbolMid - EqualHalfSpace * 1.5) OperatorStroke
define [IdentHole x]
VBar x (SymbolMid - EqualHalfSpace * 1.5) (SymbolMid + EqualHalfSpace * 1.5) [adviceBlackness 6]
create-glyph 'equal' '=' : glyph-proc
include : EqualShape SB RightSB
create-glyph 'equalParallel' 0x22D5 : composite-proc
refer-glyph 'equal'
refer-glyph 'parallel.naturalSlope'
create-glyph 'oneDotApproxEq' 0x2250 : glyph-proc
include : refer-glyph 'equal'
include : DotAt Middle (SymbolMid + EqualHalfSpace * 2.5) DotRadius
create-glyph 'twoDotApproxEqCenter' 0x2251 : glyph-proc
include : refer-glyph 'equal'
include : DotAt Middle (SymbolMid + EqualHalfSpace * 2.5) DotRadius
include : DotAt Middle (SymbolMid - EqualHalfSpace * 2.5) DotRadius
create-glyph 'twoDotApproxEq' 0x2252 : glyph-proc
include : refer-glyph 'equal'
include : DotAt [mix SB RightSB (1/6)] (SymbolMid + EqualHalfSpace * 2.5) DotRadius
include : DotAt [mix SB RightSB (5/6)] (SymbolMid - EqualHalfSpace * 2.5) DotRadius
create-glyph 'twoDotApproxEqAlt' 0x2253 : glyph-proc
include : refer-glyph 'equal'
include : DotAt [mix SB RightSB (5/6)] (SymbolMid + EqualHalfSpace * 2.5) DotRadius
include : DotAt [mix SB RightSB (1/6)] (SymbolMid - EqualHalfSpace * 2.5) DotRadius
create-glyph 'ringInEqual' 0x2256 : glyph-proc
local ringSw : adviceBlackness 4
include : difference
refer-glyph 'equal'
RingAt Middle SymbolMid (EqualHalfSpace + O + ringSw / 2)
include : RingStrokeAt Middle SymbolMid (EqualHalfSpace + ringSw / 2) ringSw
create-glyph 'geometricallyEquivalentTo' 0x224E : glyph-proc
local ringSw : adviceBlackness 4
local halfGap : EqualHalfSpace - OperatorStroke / 2
local outerRad : EqualHalfSpace + ringSw / 2
include : difference
refer-glyph 'equal'
OShapeOutline.NoOvershoot
SymbolMid + EqualHalfSpace + outerRad
SymbolMid - EqualHalfSpace - outerRad
Middle - outerRad
Middle + outerRad
begin ringSw
SmoothAOf outerRad Width
SmoothBOf outerRad Width
include : difference
OShape
SymbolMid + EqualHalfSpace + outerRad
SymbolMid - EqualHalfSpace - outerRad
Middle - outerRad
Middle + outerRad
begin ringSw
SmoothAOf outerRad Width
SmoothBOf outerRad Width
Rect (SymbolMid + halfGap) (SymbolMid - halfGap) 0 Width
create-glyph 'differenceBetween' 0x224F : glyph-proc
include : intersection
Rect ParenTop SymbolMid 0 Width
refer-glyph 'geometricallyEquivalentTo'
include : intersection
Rect SymbolMid ParenBot 0 Width
refer-glyph 'equal'
define ColonEqSbSquash 0.5
create-glyph 'eqColon' 0x2255 : glyph-proc
include : refer-glyph "baselineDot"
include : refer-glyph "xhDot"
local delta : Math.max 0 : Width / 2 - DotRadius - SB * ColonEqSbSquash
include : Upright
include : Translate (+delta) (SymbolMid - XH / 2)
include : Italify
include : EqualShape (SB * ColonEqSbSquash) (RightSB - DotSize)
define [ColonEqColonShape] : new-glyph : glyph-proc
include : refer-glyph "baselineDot"
include : refer-glyph "xhDot"
local delta : Math.max 0 : Width / 2 - DotRadius - SB * ColonEqSbSquash
include : Upright
include : Translate (-delta) (SymbolMid - XH / 2)
include : Italify
create-glyph 'colonEq' 0x2254 : glyph-proc
include : ColonEqColonShape
include : EqualShape (SB + DotSize) (Width - SB * ColonEqSbSquash)
create-glyph 'colonArrow' 0x29F4 : glyph-proc
local barLeft : SB + DotSize
local barRight : Width - SB * ColonEqSbSquash
local arrowHeadSize : Math.min ((PlusTop - PlusBot) / 2) (0.75 * (barRight - barLeft))
include : ColonEqColonShape
include : HBar [mix SB barLeft 0.8] [mix barLeft barRight 0.5] SymbolMid OperatorStroke
include : ArrowShape barLeft SymbolMid barRight SymbolMid arrowHeadSize
create-glyph 'ident' 0x2261 : glyph-proc
include : IdentShape SB RightSB
create-glyph 'iiiident' 0x2263 : glyph-proc
include : HBar SB RightSB (SymbolMid + EqualHalfSpace * 2.25) OperatorStroke
include : HBar SB RightSB (SymbolMid + EqualHalfSpace * 0.75) OperatorStroke
include : HBar SB RightSB (SymbolMid - EqualHalfSpace * 0.75) OperatorStroke
include : HBar SB RightSB (SymbolMid - EqualHalfSpace * 2.25) OperatorStroke
define [LessGreaterExpansion top bot l r]
Math.sqrt : 1 + (top - bot) / (2 * (r - l)) * (top - bot) / (2 * (r - l))
define [LessMaskShape top bot l r] : spiro-outline
corner r top
corner r bot
corner l [mix bot top 0.5]
define [GreaterMaskShape top bot l r] : spiro-outline
corner l top
corner l bot
corner r [mix bot top 0.5]
define [LessShapeA top bot l r s p] : begin
define exp : LessGreaterExpansion top bot l r
define pp : fallback p 1
return : dispiro
widths.center s
flat [mix l r pp] [mix [mix top bot 0.5] top pp]
curl l [mix top bot 0.5] [widths.heading (s / 2 * exp) (s / 2 * exp) Leftward]
define [LessShapeB top bot l r s p] : begin
define exp : LessGreaterExpansion top bot l r
define pp : fallback p 1
return : dispiro
widths.center s
flat [mix l r pp] [mix [mix top bot 0.5] bot pp]
curl l [mix top bot 0.5] [widths.heading (s / 2 * exp) (s / 2 * exp) Leftward]
define [GreaterShapeA top bot l r s p] : begin
define exp : LessGreaterExpansion top bot l r
define pp : fallback p 1
return : dispiro
widths.center s
flat [mix r l pp] [mix [mix top bot 0.5] top pp]
curl r [mix top bot 0.5] [widths.heading (s / 2 * exp) (s / 2 * exp) Rightward]
define [GreaterShapeB top bot l r s p] : begin
define exp : LessGreaterExpansion top bot l r
define pp : fallback p 1
return : dispiro
widths.center s
flat [mix r l pp] [mix [mix top bot 0.5] bot pp]
curl r [mix top bot 0.5] [widths.heading (s / 2 * exp) (s / 2 * exp) Rightward]
define [LessShape top bot l r s] : union
LessShapeA top bot l r [fallback s OperatorStroke]
LessShapeB top bot l r [fallback s OperatorStroke]
define [LigationLessShape top bot l r s t gap] : union
intersection
Rect [mix bot top 2] [mix top bot 2] [mix r l 2] r
union
LessShapeA top bot l r [fallback s OperatorStroke] 2
LessShapeB top bot l r [fallback s OperatorStroke] 2
intersection
LessMaskShape top bot l r
difference
dispiro
widths.lhs [fallback t OperatorStroke]
corner r bot
corner r top
Rect ([mix top bot 0.5] + gap / 2) ([mix top bot 0.5] - gap / 2) (l + O) (r - O)
define [NormalSubsetShape top bot l r s] : LigationLessShape top bot l r s s 0
define [GreaterShape top bot l r s] : union
GreaterShapeA top bot l r [fallback s OperatorStroke]
GreaterShapeB top bot l r [fallback s OperatorStroke]
define [LigationGreaterShape top bot l r s t gap] : union
intersection
Rect [mix bot top 2] [mix top bot 2] [mix l r 2] l
union
GreaterShapeA top bot l r [fallback s OperatorStroke] 2
GreaterShapeB top bot l r [fallback s OperatorStroke] 2
intersection
GreaterMaskShape top bot l r
difference
dispiro
widths.rhs [fallback t OperatorStroke]
corner l bot
corner l top
Rect ([mix top bot 0.5] + gap / 2) ([mix top bot 0.5] - gap / 2) (l + O) (r - O)
define [NormalSupersetShape top bot l r s] : LigationGreaterShape top bot l r s s 0
# Sym parameters
local approxDist : EqualHalfSpace * 1.75
local symMag : (OperTop - SymbolMid) * 0.17
define [symWave height mul sw] : TildeShape
ttop -- height + symMag * mul
tbot -- height - symMag * mul
leftEnd -- SB
rightEnd -- RightSB
hs -- [fallback sw OperatorStroke] / 2
define [BarNegator symbolBottom dist] : begin
local swo : Math.max (OperatorStroke * 1.5) (dist * 1.5)
return : dispiro
widths.center OperatorStroke
flat (Middle + dist) (symbolBottom - dist + swo) [heading Downward]
flat (Middle - dist) (symbolBottom - dist - swo) [heading Downward]
create-glyph 'less' '<' : glyph-proc
include : LessShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
create-glyph 'lessDot' 0x22D6 : composite-proc
LessShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB [adviceBlackness 4]
DotAt (RightSB - DotRadius) SymbolMid (DotRadius * [adviceBlackness 4] / Stroke)
create-glyph 'normalSubsetOf' 0x22B2 : glyph-proc
include : NormalSubsetShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
create-glyph 'greater' '>' : glyph-proc
include : GreaterShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
create-glyph 'greaterDot' 0x22D7 : composite-proc
GreaterShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB [adviceBlackness 4]
DotAt (SB + DotRadius) SymbolMid (DotRadius * [adviceBlackness 4] / Stroke)
create-glyph 'normalSupersetOf' 0x22B3 : glyph-proc
include : NormalSupersetShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
create-glyph 'lessEqUpper' : AsRadical : LessShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) SB RightSB
create-glyph 'greaterEqUpper' : AsRadical : GreaterShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) SB RightSB
create-glyph 'normalSubsetUpper' : AsRadical : NormalSubsetShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) SB RightSB
create-glyph 'normalSupersetUpper' : AsRadical : NormalSupersetShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) SB RightSB
create-glyph 'eqLower' : AsRadical : HBar SB RightSB (SymbolMid - dH - lessEqDist) OperatorStroke
create-glyph 'eqBarNegatedLower' : AsRadical : union [refer-glyph 'eqLower'] [BarNegator (SymbolMid - dH) lessEqDist]
create-glyph 'symLower' : AsRadical : symWave (SymbolMid - dH - lessEqDist) 1
create-glyph 'symBarNegatedLower' : AsRadical : union [refer-glyph 'symLower'] [BarNegator (SymbolMid - dH) lessEqDist]
create-glyph 'less.narrow' : composite-proc [refer-glyph 'lessEqUpper'] [Upright] [Translate 0 (-lessEqDist)] [Italify]
create-glyph 'lessEq' 0x2264 : composite-proc [refer-glyph 'lessEqUpper'] [refer-glyph 'eqLower']
create-glyph 'lessEqBarNegated' 0x2A87 : composite-proc [refer-glyph 'lessEqUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'lessSym' 0x2272 : composite-proc [refer-glyph 'lessEqUpper'] [refer-glyph 'symLower']
create-glyph 'lessSymBarNegated' 0x22E6 : composite-proc [refer-glyph 'lessEqUpper'] [refer-glyph 'symBarNegatedLower']
create-glyph 'lessEqslant' 0x2A7D : composite-proc [refer-glyph 'lessEqUpper']
LessShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) SB RightSB OperatorStroke
create-glyph 'greater.narrow' : composite-proc [refer-glyph 'greaterEqUpper'] [Upright] [Translate 0 (-lessEqDist)] [Italify]
create-glyph 'greaterEq' 0x2265 : composite-proc [refer-glyph 'greaterEqUpper'] [refer-glyph 'eqLower']
create-glyph 'greaterEqBarNegated' 0x2A88 : composite-proc [refer-glyph 'greaterEqUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'greaterSym' 0x2273 : composite-proc [refer-glyph 'greaterEqUpper'] [refer-glyph 'symLower']
create-glyph 'greaterSymBarNegated' 0x22E7 : composite-proc [refer-glyph 'greaterEqUpper'] [refer-glyph 'symBarNegatedLower']
create-glyph 'greaterEqslant' 0x2A7E : composite-proc [refer-glyph 'greaterEqUpper']
GreaterShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) SB RightSB OperatorStroke
create-glyph 'normalSubsetEq' 0x22B4 : composite-proc [refer-glyph 'normalSubsetUpper'] [refer-glyph 'eqLower']
create-glyph 'normalSupersetEq' 0x22B5 : composite-proc [refer-glyph 'normalSupersetUpper'] [refer-glyph 'eqLower']
do "Ligation Glyphs"
define l : 0.3 * Width
define r : 2 * Width - l
define l2 : l - Width
define r2 : r - Width
create-glyph 'less.lig2' : glyph-proc
include : LessShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) l r
create-glyph 'greater.lig2' : glyph-proc
include : GreaterShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) l r
create-glyph 'eq.at-lteq.lig2.flat' : glyph-proc
include : HBar l2 r2 (SymbolMid - dH - lessEqDist) OperatorStroke
create-aliased-glyph 'eq.at-gteq.lig2.flat'
create-glyph 'eq.at-lteq.lig2.slanted' : glyph-proc
include : LessShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) l2 r2 OperatorStroke
create-glyph 'eq.at-gteq.lig2.slanted' : glyph-proc
include : GreaterShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) l2 r2 OperatorStroke
select-variant 'eq.at-lteq.lig2'
select-variant 'eq.at-gteq.lig2'
define lesslessSW : adviceBlackness 4
define lesslessSWO : Math.max lesslessSW lessEqDist
define llggHeight : dH * 2 + lessEqDist * 2
define [EqEqBarNegationImpl sw y1 y2] : dispiro
widths.center sw
flat (Middle + lessEqDist) (y1 + lesslessSWO) [heading Downward]
flat (Middle - lessEqDist) (y2 - lesslessSWO) [heading Downward]
define [EqEqBarNegation] : EqEqBarNegationImpl lesslessSW
SymbolMid - dH + lessEqDist * 2 / 3
SymbolMid - dH - lessEqDist
create-glyph 'lessEqEqUpper' : AsRadical : LessShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist * 1.75) SB RightSB lesslessSW
create-glyph 'greaterEqEqUpper' : AsRadical : GreaterShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist * 1.75) SB RightSB lesslessSW
create-glyph 'eqEqLower' : AsRadical : union
HBar SB RightSB (SymbolMid - dH + lessEqDist * 2 / 3) lesslessSW
HBar SB RightSB (SymbolMid - dH - lessEqDist) lesslessSW
create-glyph 'symSymLower' : AsRadical : union
symWave (SymbolMid - dH + lessEqDist * 2 / 3) 1 lesslessSW
symWave (SymbolMid - dH - lessEqDist) 1 lesslessSW
create-glyph 'eqEqBarNegatedLower' : AsRadical : union [refer-glyph 'eqEqLower'] [EqEqBarNegation]
create-glyph 'symSymBarNegatedLower' : AsRadical : union [refer-glyph 'symSymLower'] [EqEqBarNegation]
create-glyph 'lessEqEq' 0x2266 : composite-proc [refer-glyph 'lessEqEqUpper'] [refer-glyph 'eqEqLower']
create-glyph 'lessEqEqBarNegated' 0x2268 : composite-proc [refer-glyph 'lessEqEqUpper'] [refer-glyph 'eqEqBarNegatedLower']
create-glyph 'lessSymSym' 0x2A85 : composite-proc [refer-glyph 'lessEqEqUpper'] [refer-glyph 'symSymLower']
create-glyph 'lessSymSymBarNegated' 0x2A89 : composite-proc [refer-glyph 'lessEqEqUpper'] [refer-glyph 'symSymBarNegatedLower']
create-glyph 'greaterEqEq' 0x2267 : composite-proc [refer-glyph 'greaterEqEqUpper'] [refer-glyph 'eqEqLower']
create-glyph 'greaterEqEqBarNegated' 0x2269 : composite-proc [refer-glyph 'greaterEqEqUpper'] [refer-glyph 'eqEqBarNegatedLower']
create-glyph 'greaterSymSym' 0x2A86 : composite-proc [refer-glyph 'greaterEqEqUpper'] [refer-glyph 'symSymLower']
create-glyph 'greaterSymSymBarNegated' 0x2A8A : composite-proc [refer-glyph 'greaterEqEqUpper'] [refer-glyph 'symSymBarNegatedLower']
create-glyph 'lessGreater' 0x2276 : glyph-proc
include : LessShape (SymbolMid + llggHeight / 2) (SymbolMid - llggHeight / 6 + lessEqDist) SB RightSB lesslessSW
include : GreaterShape (SymbolMid + llggHeight / 6 - lessEqDist) (SymbolMid - llggHeight / 2) SB RightSB lesslessSW
create-glyph 'greaterLess' 0x2277 : glyph-proc
include : GreaterShape (SymbolMid + llggHeight / 2) (SymbolMid - llggHeight / 6 + lessEqDist) SB RightSB lesslessSW
include : LessShape (SymbolMid + llggHeight / 6 - lessEqDist) (SymbolMid - llggHeight / 2) SB RightSB lesslessSW
create-glyph 'lessEqGreater' 0x22DA : glyph-proc
include : LessShape (SymbolMid + llggHeight / 2 + lessEqDist) (SymbolMid - llggHeight / 6 + lessEqDist * 2) SB RightSB lesslessSW
include : GreaterShape (SymbolMid + llggHeight / 6 - lessEqDist * 2) (SymbolMid - llggHeight / 2 - lessEqDist) SB RightSB lesslessSW
include : HBar SB RightSB (SymbolMid) lesslessSW
create-glyph 'greaterEqLess' 0x22DB : glyph-proc
include : GreaterShape (SymbolMid + llggHeight / 2 + lessEqDist) (SymbolMid - llggHeight / 6 + lessEqDist * 2) SB RightSB lesslessSW
include : LessShape (SymbolMid + llggHeight / 6 - lessEqDist * 2) (SymbolMid - llggHeight / 2 - lessEqDist) SB RightSB lesslessSW
include : HBar SB RightSB (SymbolMid) lesslessSW
create-glyph 'lessless' 0x226A : glyph-proc
include : LessShape (SymbolMid + dH) (SymbolMid - dH) (SB - lessEqDist / 2) (RightSB - lessEqDist * 2) lesslessSW
include : LessShape (SymbolMid + dH) (SymbolMid - dH) (SB + lessEqDist * 2) (RightSB + lessEqDist / 2) lesslessSW
create-glyph 'greatergreater' 0x226B : glyph-proc
include : GreaterShape (SymbolMid + dH) (SymbolMid - dH) (SB - lessEqDist / 2) (RightSB - lessEqDist * 2) lesslessSW
include : GreaterShape (SymbolMid + dH) (SymbolMid - dH) (SB + lessEqDist * 2) (RightSB + lessEqDist / 2) lesslessSW
define [PrecedesShapeA top bot l r s cth] : begin
local fine : s * cth
return : dispiro
widths.center s
g4 r top
straight.left.end l ([mix top bot 0.5] + s / 2) [widths.heading fine 0 Leftward]
define [PrecedesShapeB top bot l r s cth] : begin
local fine : s * cth
return : dispiro
widths.center s
g4 r bot
straight.left.end l ([mix top bot 0.5] - s / 2) [widths.heading 0 fine Leftward]
define [SucceedsShapeA top bot l r s cth] : begin
local fine : s * cth
return : dispiro
widths.center s
g4 l top
straight.right.end r ([mix top bot 0.5] + s / 2) [widths.heading 0 fine Rightward]
define [SucceedsShapeB top bot l r s cth] : begin
local fine : s * cth
return : dispiro
widths.center s
g4 l bot
straight.right.end r ([mix top bot 0.5] - s / 2) [widths.heading fine 0 Rightward]
define [PrecedesShape top bot l r s] : glyph-proc
include : PrecedesShapeA top bot l r [fallback s OperatorStroke] CThin
include : PrecedesShapeB top bot l r [fallback s OperatorStroke] CThin
define [SucceedsShape top bot l r s] : glyph-proc
include : SucceedsShapeA top bot l r [fallback s OperatorStroke] CThin
include : SucceedsShapeB top bot l r [fallback s OperatorStroke] CThin
create-glyph 'precedes' 0x227a : AsRadical : PrecedesShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
create-glyph 'succeeds' 0x227b : AsRadical : SucceedsShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB
create-glyph 'precedesEqUpper' : AsRadical : PrecedesShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) SB RightSB
create-glyph 'precedesEqEqUpper' : AsRadical : PrecedesShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist * 1.75) SB RightSB lesslessSW
create-glyph 'succeedsEqUpper' : AsRadical : SucceedsShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) SB RightSB
create-glyph 'succeedsEqEqUpper' : AsRadical : SucceedsShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist * 1.75) SB RightSB lesslessSW
create-glyph 'precedes.narrow' : composite-proc [refer-glyph 'precedesEqUpper'] [Upright] [Translate 0 (-lessEqDist)] [Italify]
create-glyph 'precedesEq' 0x2AAF : composite-proc [refer-glyph 'precedesEqUpper'] [refer-glyph 'eqLower']
create-glyph 'precedesEqBarNegated' 0x2AB1 : composite-proc [refer-glyph 'precedesEqUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'precedesSym' 0x227E : composite-proc [refer-glyph 'precedesEqUpper'] [refer-glyph 'symLower']
create-glyph 'precedesSymBarNegated' 0x22E8 : composite-proc [refer-glyph 'precedesEqUpper'] [refer-glyph 'symBarNegatedLower']
create-glyph 'precedesEqSlant' 0x227C : composite-proc [refer-glyph 'precedesEqUpper']
PrecedesShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) SB RightSB OperatorStroke 1
create-glyph 'precedesEqEq' 0x2AB3 : composite-proc [refer-glyph 'precedesEqEqUpper'] [refer-glyph 'eqEqLower']
create-glyph 'precedesEqEqBarNegated' 0x2AB5 : composite-proc [refer-glyph 'precedesEqEqUpper'] [refer-glyph 'eqEqBarNegatedLower']
create-glyph 'precedesSymSym' 0x2AB7 : composite-proc [refer-glyph 'precedesEqEqUpper'] [refer-glyph 'symSymLower']
create-glyph 'precedesSymSymBarNegated' 0x2AB9 : composite-proc [refer-glyph 'precedesEqEqUpper'] [refer-glyph 'symSymBarNegatedLower']
create-glyph 'succeeds.narrow' : composite-proc [refer-glyph 'succeedsEqUpper'] [Upright] [Translate 0 (-lessEqDist)] [Italify]
create-glyph 'succeedsEq' 0x2AB0 : composite-proc [refer-glyph 'succeedsEqUpper'] [refer-glyph 'eqLower']
create-glyph 'sycceedseqBarNegated' 0x2AB2 : composite-proc [refer-glyph 'succeedsEqUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'succeedsSym' 0x227F : composite-proc [refer-glyph 'succeedsEqUpper'] [refer-glyph 'symLower']
create-glyph 'succeedsSymBarNegated' 0x22E9 : composite-proc [refer-glyph 'succeedsEqUpper'] [refer-glyph 'symBarNegatedLower']
create-glyph 'succeedsEqSlant' 0x227D : composite-proc [refer-glyph 'succeedsEqUpper']
SucceedsShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) SB RightSB OperatorStroke 1
create-glyph 'succeedsEqEq' 0x2AB4 : composite-proc [refer-glyph 'succeedsEqEqUpper'] [refer-glyph 'eqEqLower']
create-glyph 'succeedsEqEqBarNegated' 0x2AB6 : composite-proc [refer-glyph 'succeedsEqEqUpper'] [refer-glyph 'eqEqBarNegatedLower']
create-glyph 'succeedsSymSym' 0x2AB8 : composite-proc [refer-glyph 'succeedsEqEqUpper'] [refer-glyph 'symSymLower']
create-glyph 'succeedsSymSymBarNegated' 0x2ABA : composite-proc [refer-glyph 'succeedsEqEqUpper'] [refer-glyph 'symSymBarNegatedLower']
create-glyph 'sym' 0x223C : symWave SymbolMid 1
create-glyph 'flipSym' 0x223D : symWave SymbolMid (-1)
VDual 'approx' 0x2248 'sym' approxDist
create-glyph : glyph-proc
include : symWave (SymbolMid + approxDist) 1
include : symWave SymbolMid 1
create-derived 'aapprox' 0x224B : symWave (SymbolMid - approxDist) 1
create-derived 'approxBar' 0x224A : HBar SB RightSB (SymbolMid - approxDist) OperatorStroke
create-glyph 'barSym' 0x2242 : glyph-proc
include [refer-glyph 'sym'] AS_BASE
include : Upright
include : Translate 0 (-approxDist / 2)
include : Italify
include : HBar SB RightSB (SymbolMid + approxDist / 2) OperatorStroke
create-glyph 'symEq' 0x2243 : glyph-proc
include [refer-glyph 'sym'] AS_BASE
include : Upright
include : Translate 0 (approxDist / 2)
include : Italify
include : HBar SB RightSB (SymbolMid - approxDist / 2) OperatorStroke
create-glyph 'symEqEq' 0x2245 : glyph-proc
local sympShift : approxDist + EqualHalfSpace * 1.5
include [refer-glyph 'sym'] AS_BASE
include : Upright
include : Translate 0 (sympShift / 2)
include : Italify
include : HBar SB RightSB (SymbolMid - sympShift / 2 + EqualHalfSpace * 1.5) OperatorStroke
include : HBar SB RightSB (SymbolMid - sympShift / 2) OperatorStroke
create-derived 'symEqEqBarNegated' 0x2246 : EqEqBarNegationImpl OperatorStroke
SymbolMid - sympShift / 2 + EqualHalfSpace * 1.5
SymbolMid - sympShift / 2
create-glyph 'flipSymEq' 0x22CD : glyph-proc
include [refer-glyph 'flipSym'] AS_BASE
include : Upright
include : Translate 0 (approxDist / 2)
include : Italify
include : HBar SB RightSB (SymbolMid - approxDist / 2) OperatorStroke
create-glyph 'flipSymEqEq' 0x224C : glyph-proc
local sympShift : approxDist + EqualHalfSpace * 1.5
include [refer-glyph 'flipSym'] AS_BASE
include : Upright
include : Translate 0 (sympShift / 2)
include : Italify
include : HBar SB RightSB (SymbolMid - sympShift / 2 + EqualHalfSpace * 1.5) OperatorStroke
include : HBar SB RightSB (SymbolMid - sympShift / 2) OperatorStroke
define [SubsetShape] : params [top bot [sw OperatorStroke] [offset 0]] : dispiro
widths.lhs sw
flat RightSB (top - offset) [heading Leftward]
curl (SB + offset + (top - bot) / 2 - offset) (top - offset)
archv
g4 (SB + offset) [mix top bot 0.5]
arcvh
flat (SB + offset + (top - bot) / 2 - offset) (bot + offset)
curl RightSB (bot + offset) [heading Rightward]
define [PrefixShape top bot sw] : union
VBarLeft SB bot top [fallback sw OperatorStroke]
HBarTop SB RightSB top [fallback sw OperatorStroke]
HBarBottom SB RightSB bot [fallback sw OperatorStroke]
define [SupsetShape top bot sw] : glyph-proc
include : SubsetShape top bot sw
include : FlipAround Middle [mix top bot 0.5]
define [SuffixShape top bot sw] : glyph-proc
include : PrefixShape top bot sw
include : FlipAround Middle [mix top bot 0.5]
create-glyph 'subst' 0x2282 : SubsetShape (SymbolMid + dH) (SymbolMid - dH)
create-glyph 'doubleSubst' 0x22D0 : glyph-proc
local sw : adviceBlackness 6
local gap : Math.max (Width / 8) (sw / 2)
include : SubsetShape (SymbolMid + dH) (SymbolMid - dH) (sw -- sw)
include : SubsetShape (SymbolMid + dH) (SymbolMid - dH) (sw -- sw) (offset -- gap + sw)
turned 'supst' 0x2283 'subst' Middle SymbolMid
turned 'doubleSupst' 0x22D1 'doubleSubst' Middle SymbolMid
create-glyph 'substBarUpper' : AsRadical : SubsetShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist)
create-glyph 'supstBarUpper' : AsRadical : SupsetShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist)
create-glyph 'substBar' 0x2286 : composite-proc [refer-glyph 'substBarUpper'] [refer-glyph 'eqLower']
create-glyph 'substBarNegated' 0x228A : composite-proc [refer-glyph 'substBarUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'supstBar' 0x2287 : composite-proc [refer-glyph 'supstBarUpper'] [refer-glyph 'eqLower']
create-glyph 'supstBarNegated' 0x228B : composite-proc [refer-glyph 'supstBarUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'element' 0x2208 : glyph-proc
include : SubsetShape (SymbolMid + dH * 4 / 3) (SymbolMid - dH * 4 / 3)
include : HBar (SB + HalfStroke) RightSB SymbolMid
turned 'turnElement' 0x220B 'element' Middle SymbolMid
create-glyph 'smallElement' 0x220A : glyph-proc
include [refer-glyph 'subst'] AS_BASE
include : HBar (SB + HalfStroke) RightSB SymbolMid OperatorStroke
turned 'turnSmallElement' 0x220D 'smallElement' Middle SymbolMid
create-glyph 'prefix' 0x228F : PrefixShape (SymbolMid + dH) (SymbolMid - dH)
create-glyph 'suffix' 0x2290 : SuffixShape (SymbolMid + dH) (SymbolMid - dH)
create-glyph 'prefixBarUpper' : AsRadical : PrefixShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist)
create-glyph 'suffixBarUpper' : AsRadical : SuffixShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist)
create-glyph 'prefixBar' 0x2291 : composite-proc [refer-glyph 'prefixBarUpper'] [refer-glyph 'eqLower']
create-glyph 'prefixBarNegated' 0x22E4 : composite-proc [refer-glyph 'prefixBarUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'suffixBar' 0x2292 : composite-proc [refer-glyph 'suffixBarUpper'] [refer-glyph 'eqLower']
create-glyph 'suffixBarNegated' 0x22E5 : composite-proc [refer-glyph 'suffixBarUpper'] [refer-glyph 'eqBarNegatedLower']
create-glyph 'prefixElement' 0x22FF : glyph-proc
include : PrefixShape (SymbolMid + dH * 4 / 3) (SymbolMid - dH * 4 / 3)
include : HBar (SB + HalfStroke) RightSB SymbolMid
create-glyph 0x22F8 : composite-proc
refer-glyph 'element'
MarkSet.plus
refer-glyph 'underlineBelow'
clear-anchors
glyph-block Symbol-Math-Complement : begin
glyph-block-import Letter-Latin-C : CShape
create-glyph 'complement' 0x2201 : glyph-proc
include : CShape [mix SymbolMid OperTop 1.1] [mix SymbolMid OperBot 1.1] OperatorStroke
glyph-block Symbol-Math-Negation : begin
glyph-block-import NotGlyphFn : notGlyph
notGlyph null 0x2260 'equal'
notGlyph null 0x2262 'ident'
notGlyph null 0x22AC 'vdash'
notGlyph null 0x22AD 'tautology'
notGlyph null 0x22AE 'forces'
notGlyph null 0x22AF 'doubleForces'
notGlyph.left null 0x226E 'less'
notGlyph.right null 0x226F 'greater'
notGlyph.left null 0x22EA 'normalSubsetOf'
notGlyph.right null 0x22EB 'normalSupersetOf'
notGlyph.left null 0x2280 'precedes'
notGlyph.right null 0x2281 'succeeds'
notGlyph null 0x2241 'sym' [mix SymbolMid BgOpTop 0.75] [mix SymbolMid BgOpBot 0.75]
notGlyph null 0x2244 'symEq' [mix SymbolMid BgOpTop 0.75] [mix SymbolMid BgOpBot 0.75]
notGlyph null 0x2247 'symEqEq'
notGlyph null 0x2249 'approx' [mix SymbolMid BgOpTop 0.75] [mix SymbolMid BgOpBot 0.75]
notGlyph.left null 0x2284 'subst'
notGlyph.right null 0x2285 'supst'
notGlyph.left null 0x2288 'substBar'
notGlyph.right null 0x2289 'supstBar'
notGlyph.left null 0x22E2 'prefixBar'
notGlyph.right null 0x22E3 'suffixBar'
notGlyph.left null 0x2209 'element'
notGlyph.right null 0x220C 'turnElement'
notGlyph.left null 0x2270 'lessEq'
notGlyph.right null 0x2271 'greaterEq'
notGlyph.left null 0x2274 'lessSym'
notGlyph.right null 0x2275 'greaterSym'
notGlyph.left null 0x22EC 'normalSubsetEq'
notGlyph.right null 0x22ED 'normalSupersetEq'
notGlyph.left null 0x22E0 'precedesEqSlant'
notGlyph.right null 0x22E1 'succeedsEqSlant'
notGlyph null 0x2278 'lessGreater'
notGlyph null 0x2279 'greaterLess'
notGlyph.right null 0x2204 'exists' (CAP - Descender / 2) (Descender / 2) 0.4
glyph-block Symbol-Math-Large-Operators : for-width-kinds WideWidth1
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Latin-Lower-F : LongSShape
glyph-block-import Letter-Latin-Upper-U : UShape
glyph-block-import Letter-Greek-Upper-Sigma : SigmaShape
glyph-block-import Letter-Greek-Pi : PiShape
define diversityLargeOperators : Math.max para.diversityM (MosaicWidth / Width)
define df : DivFrame diversityLargeOperators 0 [if FMosaicWide diversityLargeOperators 1]
create-glyph [MangleName 'sum'] [MangleUnicode 0x2211] : glyph-proc
set-width df.width
include : SigmaShape df BgOpTop BgOpBot OperatorStroke
create-glyph [MangleName 'product'] [MangleUnicode 0x220F] : glyph-proc
set-width df.width
include : PiShape BgOpTop BgOpBot (shrinkrate -- 0) (_fine -- OperatorStroke) (df -- df)
turned [MangleName 'coproduct'] [MangleUnicode 0x2210] [MangleName 'product'] df.middle SymbolMid
create-glyph [MangleName 'Vee'] [MangleUnicode 0x22C1] : glyph-proc
set-width df.width
include : dispiro
widths.center OperatorStroke
flat df.leftSB BgOpTop
curl df.middle BgOpBot [heading Downward]
include : dispiro
widths.center OperatorStroke
flat df.rightSB BgOpTop
curl df.middle BgOpBot [heading Downward]
turned [MangleName 'Wedge'] [MangleUnicode 0x22C0] [MangleName 'Vee'] df.middle SymbolMid
create-glyph [MangleName 'Cup'] [MangleUnicode 0x22C3] : glyph-proc
set-width df.width
include : UShape df BgOpTop BgOpBot
oper -- true
stroke -- OperatorStroke
sma -- [SmoothAOf (Smooth * [Math.sqrt df.div]) (df.width)]
smb -- [SmoothBOf (Smooth * [Math.sqrt df.div]) (df.width)]
turned [MangleName 'Cap'] [MangleUnicode 0x22C2] [MangleName 'Cup'] df.middle SymbolMid
glyph-block Symbol-Math-Integrals : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Latin-Lower-F : LongSShape
define MosaicTop fontMetrics.OS_2.sTypoAscender
define MosaicBottom fontMetrics.OS_2.sTypoDescender
define MosaicHeight : MosaicTop - MosaicBottom
create-glyph 'integrate' 0x222B : glyph-proc
local hookY : Math.max (Hook * 0.75) (Stroke * 1.5)
include : LongSShape BgOpTop BgOpBot Hook hookY OperatorStroke
HDual 'doubleintegrate' 0x222C 'integrate' (0.5 * Width)
create-glyph 'integralUpper' 0x2320 : glyph-proc
include : intersection
Rect MosaicTop MosaicBottom (-Width) (2 * Width)
LongSShape BgOpTop (BgOpBot - MosaicHeight * 2) Hook (Hook * 0.75) OperatorStroke
create-glyph 'integralExtension' 0x23AE : glyph-proc
include : intersection
Rect MosaicTop MosaicBottom (-Width) (2 * Width)
LongSShape (BgOpTop + MosaicHeight) (BgOpBot - MosaicHeight) Hook (Hook * 0.75) OperatorStroke
create-glyph 'integralLower' 0x2321 : glyph-proc
include : intersection
Rect MosaicTop MosaicBottom (-Width) (2 * Width)
LongSShape (BgOpTop + MosaicHeight * 2) BgOpBot Hook (Hook * 0.75) OperatorStroke
create-glyph 'tripleintegrate' 0x222D : glyph-proc
define [shape] : LongSShape BgOpTop BgOpBot Hook (Hook * 0.75) [adviceBlackness 3.75]
include [shape]
include : Translate (-Width / 3) 0
include [shape]
include : Translate (-Width / 3) 0
include [shape]
include : Translate (Width / 3) 0
create-glyph 'ringintegrate' 0x222E : glyph-proc
include : refer-glyph "integrate"
include : OShape (SymbolMid + (RightSB - SB) / 2) (SymbolMid - (RightSB - SB) / 2) SB RightSB OperatorStroke
glyph-block Symbol-Math-APL : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Latin-Upper-U : UShape
define [Overlay fnOverlay fnBackground] : glyph-proc
define sw : [adviceBlackness 6] / 2
local candidates {}
define segs 3
define overlay : new-glyph : glyph-proc : include fnOverlay AS_BASE ALSO_METRICS
define background : new-glyph : glyph-proc : include fnBackground AS_BASE ALSO_METRICS
local corners : new-glyph : glyph-proc
set this.gizmo : Translate 0 0
foreach [c : items-of overlay.contours] : foreach [z : items-of c] : if z.on : do
define x z.x
define y z.y
include : spiro-outline
corner (x - sw) (y - sw)
corner (x + sw) (y - sw)
corner (x + sw) (y + sw)
corner (x - sw) (y + sw)
foreach [r : range (0 - segs) till (segs)] : foreach [c : range (0 - segs) till (segs)] : do
define dx : r / segs * sw
define dy : c / segs * sw
candidates.push : new-glyph : glyph-proc
include overlay
include : Translate dx dy
include : difference background corners [union.apply null candidates]
include overlay
define aplBoxInnerTop BgOpTop
define aplBoxInnerBot BgOpBot
define aplBoxSW : adviceBlackness 4.5
define aplBoxTop : mix SymbolMid aplBoxInnerTop 1.1
define aplBoxBot : mix SymbolMid aplBoxInnerBot 1.1
define aplBoxInnerScale : Math.min ((Width - aplBoxSW * 1.75) / Width) ((aplBoxInnerTop - aplBoxInnerBot) / (ParenTop - ParenBot))
create-glyph 'aplsquare' 0x2395 : glyph-proc
local l [mix 0 SB (1 / 3)]
local r [mix Width RightSB (1 / 3)]
include : HBarTop l r aplBoxTop aplBoxSW
include : HBarBottom l r aplBoxBot aplBoxSW
include : VBarLeft l aplBoxTop aplBoxBot aplBoxSW
include : VBarRight r aplBoxTop aplBoxBot aplBoxSW
create-glyph 'aplsquareShadow' : glyph-proc
local l [mix 0 SB (1 / 3)]
local r [mix Width RightSB (1 / 3)]
include : spiro-outline
corner l aplBoxTop
corner r aplBoxTop
corner r aplBoxBot
corner l aplBoxBot
create-glyph 'aplibar' 0x2336 : glyph-proc
local l [mix 0 SB (1 / 3)]
local r [mix Width RightSB (1 / 3)]
include : HBarTop l r OperTop aplBoxSW
include : HBarBottom l r OperBot aplBoxSW
include : VBar Middle OperTop OperBot aplBoxSW
create-glyph 'aplsquish' 0x2337 : glyph-proc
local l : mix SB RightSB (1 / 8)
local r : mix RightSB SB (1 / 8)
include : union
HBarTop l r aplBoxTop aplBoxSW
HBarBottom l r aplBoxBot aplBoxSW
VBarLeft l aplBoxTop aplBoxBot aplBoxSW
VBarRight r aplBoxTop aplBoxBot aplBoxSW
create-glyph 'aplbar' : glyph-proc
include : VBar Middle aplBoxTop aplBoxBot aplBoxSW
create-glyph 'aplLongBar' : glyph-proc
include : VBar Middle aplBoxTop aplBoxBot aplBoxSW
create-glyph 'aplminus' : glyph-proc
include : dispiro
widths.center aplBoxSW
flat RightSB [mix OperTop OperBot 0.5]
curl SB [mix OperTop OperBot 0.5]
create-glyph 'aplslash' : glyph-proc
include : dispiro
widths.center aplBoxSW
flat RightSB OperTop
curl SB OperBot
create-glyph 'aplbackslash' : glyph-proc
include : dispiro
widths.center aplBoxSW
flat SB OperTop
curl RightSB OperBot
define [aplBoxed shape] : Overlay [refer-glyph 'aplsquare'] : glyph-proc
include : intersection [refer-glyph 'aplsquareShadow'] shape
include : ScaleAround Middle SymbolMid aplBoxInnerScale
create-glyph 0x2338 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'equal']
create-glyph 0x2339 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'divide']
create-glyph 0x233A : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'whiteDiamond.NWID']
create-glyph 0x233B : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'smallWhiteCircle.NWID']
create-glyph 0x233C : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'whiteCircle.NWID']
create-glyph 0x233D : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'aplbar'] [refer-glyph 'whiteCircle.NWID']]
create-glyph 0x233E : composite-proc [refer-glyph 'whiteCircle.NWID'] [refer-glyph 'smallWhiteCircle.NWID']
create-glyph 0x233F : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'aplminus'] [refer-glyph 'slash']]
create-glyph 0x2340 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'aplminus'] [refer-glyph 'backslash']]
create-glyph 0x2341 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'slash']
create-glyph 0x2342 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'backslash']
create-glyph 0x2343 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'less']
create-glyph 0x2344 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'greater']
create-glyph 0x2345 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'arrowleft.NWID'] [refer-glyph 'aplbar']]
create-glyph 0x2346 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'arrowright.NWID'] [refer-glyph 'aplbar']]
create-glyph 0x2347 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'arrowleft.NWID']
create-glyph 0x2348 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'arrowright.NWID']
create-glyph 0x2349 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'aplbackslash'] [refer-glyph 'whiteCircle.NWID']]
create-glyph 0x234A : composite-proc [refer-glyph 'bot'] [MarkSet.tack] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x234B : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'increment'] [refer-glyph 'aplLongBar']]
create-glyph 0x234C : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'vee']
create-glyph 0x234D : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'increment']
create-glyph 0x234F : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'arrowup.NWID'] [refer-glyph 'minus']]
create-glyph 0x2350 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'arrowup.NWID']
create-glyph 0x2351 : composite-proc [refer-glyph 'top'] [MarkSet.tack] [refer-glyph 'sbOverlineAbove'] [clear-anchors]
create-glyph 0x2352 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'nabla'] [refer-glyph 'aplLongBar']]
create-glyph 0x2353 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'wedge']
create-glyph 0x2354 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'nabla']
create-glyph 0x2356 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'arrowdown.NWID'] [refer-glyph 'minus']]
create-glyph 0x2357 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'arrowdown.NWID']
create-glyph 0x2358 : composite-proc [refer-glyph 'asciiSingleQuote.straight'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x2359 : composite-proc [refer-glyph 'increment'] [refer-glyph 'underlineBelow']
create-glyph 0x235A : composite-proc [refer-glyph 'whiteDiamond.NWID'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x235B : composite-proc [refer-glyph 'smallWhiteCircle.NWID'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x235C : composite-proc [refer-glyph 'whiteCircle.NWID'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x235D : composite-proc
refer-glyph 'smallWhiteCircle.NWID'
ScaleAround Middle SymbolMid 0.75
Realign Middle SymbolMid Middle (OperBot + Smooth)
UShape [DivFrame 1] OperTop OperBot
oper -- true
stroke -- [adviceBlackness 5]
FlipAround Middle SymbolMid
create-glyph 0x235E : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'asciiSingleQuote.straight']
create-glyph 0x235F : composite-proc [refer-glyph 'enquad'] [intersection [refer-glyph 'mathOOutline'] [refer-glyph 'opAsterisk.low']] [refer-glyph 'mathO']
create-glyph 0x2360 : composite-proc [refer-glyph 'enquad'] [aplBoxed : composite-proc [refer-glyph 'colon'] [Realign Middle (XH/2) Middle SymbolMid]]
create-glyph 0x2361 : composite-proc [refer-glyph 'top'] [MarkSet.tack] [refer-glyph 'dieresisAbove'] [clear-anchors]
create-glyph 0x2362 : composite-proc [refer-glyph 'nabla'] [refer-glyph 'dieresisAbove']
create-glyph 0x2363 : composite-proc [refer-glyph 'asterisk.low'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors]
create-glyph 0x2364 : composite-proc [refer-glyph 'smallWhiteCircle.NWID'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors]
create-glyph 0x2365 : composite-proc [refer-glyph 'whiteCircle.NWID'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors]
create-glyph 0x2366 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'cup'] [refer-glyph 'aplbar']]
create-glyph 0x2367 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'subst'] [refer-glyph 'aplbar']]
create-glyph 0x2368 : composite-proc [refer-glyph 'asciiTilde.low'] [refer-glyph 'dieresisAbove']
create-glyph 0x2369 : composite-proc [refer-glyph 'greater.narrow'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors]
create-glyph 0x236A : composite-proc [refer-glyph 'minus'] [refer-glyph 'comma']
create-glyph 0x236B : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'overlayTildeOperator'] [refer-glyph 'nabla']]
create-glyph 0x236C : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'overlayTildeOperator'] [refer-glyph 'zero.lnum.unslashed']]
create-glyph 0x236D : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'overlayTildeOperator'] [refer-glyph 'bar']]
create-glyph 0x236E : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'semicolon'] [refer-glyph 'underscore.high']]
create-glyph 0x236F : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'notequal']
create-glyph 0x2370 : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'question']
create-glyph 0x2371 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'overlayTildeOperator'] [refer-glyph 'vee']]
create-glyph 0x2372 : composite-proc [refer-glyph 'enquad'] [Overlay [refer-glyph 'overlayTildeOperator'] [refer-glyph 'wedge']]
alias 'apliota' 0x2373 'grek/iota'
alias 'aplrho' 0x2374 'grek/rho'
alias 'aplomega' 0x2375 'grek/omega'
create-glyph 0x2376 : composite-proc [refer-glyph 'grek/alpha'] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x2377 : composite-proc [refer-glyph 'smallElement'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x2378 : composite-proc [refer-glyph 'grek/iota'] [refer-glyph 'underlineBelow'] [clear-anchors]
create-glyph 0x2379 : composite-proc [refer-glyph 'grek/omega'] [refer-glyph 'underlineBelow'] [clear-anchors]
alias 'aplalpha' 0x237A 'grek/alpha'
glyph-block Symbol-Math-Other : begin
glyph-block-import Common-Derivatives : alias turned
glyph-block-import NotGlyphFn : notGlyph
alias 'mathBullet' 0x2219 'bullet'
alias 'mathBar' 0x2223 'bar'
notGlyph null 0x2224 'mathBar' [mix SymbolMid BgOpTop 0.5] [mix SymbolMid BgOpBot 0.5] 0.1
notGlyph null 0x2226 'parallel' [mix SymbolMid BgOpTop 0.5] [mix SymbolMid BgOpBot 0.5] 0
alias 'mathSmallCircle' 0x2218 'smallWhiteCircle.NWID'
alias 'whiteDiamondOperator' 0x22C4 'whiteDiamond.NWID'
alias 'mathstar' 0x22C6 'blackStar.NWID'
turned 'amalg' 0x2A3F 'grek/Pi' Middle (CAP / 2)
turned 'turnAmpersand' 0x214B 'ampersand' Middle (CAP / 2)
turned 'turnGreaterEq' 0x22DC 'greaterEq' Middle SymbolMid
turned 'turnLessEq' 0x22DD 'lessEq' Middle SymbolMid
turned 'turnSucceedsEqSlant' 0x22DE 'succeedsEqSlant' Middle SymbolMid
turned 'turnPrecedesEqSlant' 0x22DF 'precedesEqSlant' Middle SymbolMid
create-glyph 'sqrt' 0x221A : glyph-proc
include : dispiro
widths.center OperatorStroke
flat SB [mix ParenBot ParenTop 0.45]
curl Middle ParenBot [heading Downward]
include : dispiro
widths.center OperatorStroke
flat Width ParenTop
curl Middle ParenBot [heading Downward]
| {
"pile_set_name": "Github"
} |
/*
* Phosphorus Five, copyright 2014 - 2017, Thomas Hansen, [email protected]
*
* This file is part of Phosphorus Five.
*
* Phosphorus Five is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3, as published by
* the Free Software Foundation.
*
*
* Phosphorus Five 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 Phosphorus Five. If not, see <http://www.gnu.org/licenses/>.
*
* If you cannot for some reasons use the GPL license, Phosphorus
* Five is also commercially available under Quid Pro Quo terms. Check
* out our website at http://gaiasoul.com for more details.
*/
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Collections.Generic;
namespace p5.core
{
/// <summary>
/// Utility class, contains helpers for common operations.
/// </summary>
public static class Utilities
{
/// <summary>
/// Converts the given object "value" to type T.
/// </summary>
/// <param name="value">Value to convert</param>
/// <param name="context">Application context</param>
/// <param name="defaultValue">Default value to return, if no conversion is possible, or value is null</param>
/// <typeparam name="T">Type to convert your value to</typeparam>
/// <returns>Converted value, or defaultValue if no conversion is possible</returns>
public static T Convert<T> (ApplicationContext context, object value, T defaultValue = default (T))
{
// Checking if value is null.
if (value == null)
return defaultValue;
// Checking to see if conversion is even necessary.
if (value is T)
return (T)value;
// Then checking if we're doing a "ToString" conversion.
if (typeof (T) == typeof (string))
return Convert (context, Convert2String (context, value), defaultValue);
// Then the "whatever case".
return Convert2Object (value, context, defaultValue);
}
/// <summary>
/// Converts the specified value to a string using conversion Active Events.
/// </summary>
/// <param name="value">Value to convert</param>
/// <param name="context">ApplicationContext to convert within</param>
/// <param name="defaultValue">Default string to return, if no conversion is possible, or value is null</param>
/// <returns>The converted object as a string</returns>
public static string Convert2String (ApplicationContext context, object value, string defaultValue = null)
{
// Sanity check.
if (value == null)
return defaultValue;
// Checking if conversion is even necessarily.
if (value is string)
return (string)value;
// Special handling for IEnumerable<Node>, to make sure we are able to "hit" our conversion Active Event.
// This is done to make sure we only need one event handler for array types of conversions.
if (value is IEnumerable<Node>)
value = ((IEnumerable<Node>)value).ToArray ();
// Notice, if Active Event conversion yields null, we invoke "System.Convert.ToString" as a failsafe default, which means Active Event conversions
// does not need to be implemented for types where this method yields something sane, such as integers, Guids, floats, etc ...
return context.RaiseEvent (".p5.hyperlambda.get-string-value." + value.GetType ().FullName, new Node ("", value)).Value as string
?? System.Convert.ToString (value, CultureInfo.InvariantCulture);
}
/// <summary>
/// Base64 encodes the given value.
/// </summary>
/// <returns>The encoded array</returns>
/// <param name="context">Context to perform conversion from within</param>
/// <param name="value">What to base64 encode</param>
public static string Base64Encode (ApplicationContext context, byte [] value)
{
// Sanity check.
if (value == null)
return null;
// Invoking conversion Active Event with "encode" set to true.
var node = new Node ("", value);
node.Add ("encode", true);
// Notice, if Active Event conversion yields null, we invoke "System.Convert.ToString" as a failsafe default, which means Active Event conversions
// does not need to be implemented for types where this method yields something sane, such as integers, Guids, floats, etc ...
return context.RaiseEvent (".p5.hyperlambda.get-string-value.System.Byte[]", node).Value as string;
}
/// <summary>
/// Converts the specified value to an object of type T using conversion Active Events.
/// </summary>
/// <param name="value">Value to convert</param>
/// <param name="context">Context to convert within</param>
/// <param name="defaultValue">Default value to return if no conversion is possible</param>
/// <typeparam name="T">The type to convert object to</typeparam>
/// <returns>The value converted to type T</returns>
public static T Convert2Object<T> (object value, ApplicationContext context, T defaultValue = default (T))
{
// Sanity check, before we attempt conversion.
if (value == null || value.Equals (default (T)))
return defaultValue;
// Checking if conversion is even necessary.
if (value is T)
return (T)value;
// Retrieving type name for object type, such that we can figure out which Active Event to use for conversion.
var typeName = context.RaiseEvent (".p5.hyperlambda.get-type-name." + typeof (T).FullName).Value as string;
// Checking if we have a native typename installed in context, and if not, using IConvertible if possible, resorting to defaultValue if not.
if (typeName == null)
return value is IConvertible ? (T)System.Convert.ChangeType (value, typeof (T), CultureInfo.InvariantCulture) : defaultValue;
// This is a native Phosphorus Five type, attempting to convert it to the specified type.
var retVal = context.RaiseEvent (".p5.hyperlambda.get-object-value." + typeName, new Node ("", value)).Value ?? (typeName == "node" ? new Node () : null);
// If above invocation was not successful, we try IConvertible for object.
if (retVal == null || retVal.Equals (default (T)))
return value is IConvertible ? (T)System.Convert.ChangeType (value, typeof (T), CultureInfo.InvariantCulture) : defaultValue;
return (T)retVal;
}
/// <summary>
/// Reads a single line string literal from the specified text reader.
/// </summary>
/// <returns>The single line string literal, parsed</returns>
/// <param name="reader">Reader to read from</param>
public static string ReadSingleLineStringLiteral (StringReader reader)
{
var builder = new StringBuilder ();
for (var c = reader.Read (); c != -1; c = reader.Read ()) {
switch (c) {
case '"':
return builder.ToString ();
case '\\':
builder.Append (AppendEscapeCharacter (reader));
break;
case '\n':
case '\r':
throw new ApplicationException (string.Format ("Syntax error, string literal unexpected CR/LF near '{0}'", builder));
default:
builder.Append ((char)c);
break;
}
}
throw new ApplicationException (string.Format ("Syntax error, string literal not closed before end of input near '{0}'", builder));
}
/// <summary>
/// Reads a multi line string literal from the specified text reader.
/// </summary>
/// <returns>The single line string literal, parsed</returns>
/// <param name="reader">Reader to read from</param>
public static string ReadMultiLineStringLiteral (StringReader reader)
{
var builder = new StringBuilder ();
for (var c = reader.Read (); c != -1; c = reader.Read ()) {
switch (c) {
case '"':
if ((char)reader.Peek () == '"')
builder.Append ((char)reader.Read ());
else
return builder.ToString ();
break;
case '\n':
builder.Append ("\r\n"); // Normalizing carriage return
break;
case '\r':
if ((char)reader.Read () != '\n')
throw new ArgumentException (string.Format ("Unexpected CR found without any matching LF near '{0}'", builder));
builder.Append ("\r\n");
break;
default:
builder.Append ((char)c);
break;
}
}
throw new ArgumentException (string.Format ("String literal not closed before end of input near '{0}'", builder));
}
/*
* Appends an escape character intoto StringBuilder from specified StringReader.
*/
static string AppendEscapeCharacter (StringReader reader)
{
switch (reader.Read ()) {
case -1:
throw new ArgumentException ("End of input found when looking for escape character in single line string literal");
case '"':
return "\"";
case '\'':
return "'";
case '\\':
return "\\";
case 'a':
return "\a";
case 'b':
return "\b";
case 'f':
return "\f";
case 't':
return "\t";
case 'v':
return "\v";
case 'n':
return "\r\n"; // Normalizing carriage return
case 'r':
// CR must be followed by LF.
if ((char)reader.Read () != '\\' || (char)reader.Read () != 'n')
throw new ArgumentException ("CR found, but no matching LF found");
return "\r\n";
case 'x':
return HexaCharacter (reader);
default:
throw new ArgumentException ("Invalid escape sequence found in string literal");
}
}
/*
* Returns a character represented as an octal character representation.
*/
static string HexaCharacter (StringReader reader)
{
var hexNumberString = "";
for (var idxNo = 0; idxNo < 4; idxNo++)
hexNumberString += (char)reader.Read ();
var integerNo = System.Convert.ToInt32 (hexNumberString, 16);
return Encoding.UTF8.GetString (BitConverter.GetBytes (integerNo).Reverse ().ToArray ());
}
}
}
| {
"pile_set_name": "Github"
} |
BR2_powerpc64=y
BR2_powerpc_power7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.net/toolchains/tarballs/br-powerpc64-power7-glibc-2020.02.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_8=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
| {
"pile_set_name": "Github"
} |
# Format: //devtools/kokoro/config/proto/build.proto
env_vars: {
key: "PACKAGE"
value: "google-cloud-assured_workloads-v1beta1"
}
| {
"pile_set_name": "Github"
} |
var group__group01_unionsi4735__digital__output__format =
[
[ "refined", "group__group01.html#a35ccd17683cd73a68c47e8351f8f7520", null ],
[ "raw", "group__group01.html#a0fa2c05d8877d3c680e904842993c33e", null ]
]; | {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2016 BayLibre, SAS
* Author: Neil Armstrong <[email protected]>
* Copyright (C) 2015 Amlogic, Inc. All rights reserved.
* Copyright (C) 2014 Endless Mobile
*/
#include <linux/export.h>
#include "meson_drv.h"
#include "meson_viu.h"
#include "meson_registers.h"
/**
* DOC: Video Input Unit
*
* VIU Handles the Pixel scanout and the basic Colorspace conversions
* We handle the following features :
*
* - OSD1 RGB565/RGB888/xRGB8888 scanout
* - RGB conversion to x/cb/cr
* - Progressive or Interlace buffer scanout
* - OSD1 Commit on Vsync
* - HDR OSD matrix for GXL/GXM
*
* What is missing :
*
* - BGR888/xBGR8888/BGRx8888/BGRx8888 modes
* - YUV4:2:2 Y0CbY1Cr scanout
* - Conversion to YUV 4:4:4 from 4:2:2 input
* - Colorkey Alpha matching
* - Big endian scanout
* - X/Y reverse scanout
* - Global alpha setup
* - OSD2 support, would need interlace switching on vsync
* - OSD1 full scaling to support TV overscan
*/
/* OSD csc defines */
enum viu_matrix_sel_e {
VIU_MATRIX_OSD_EOTF = 0,
VIU_MATRIX_OSD,
};
enum viu_lut_sel_e {
VIU_LUT_OSD_EOTF = 0,
VIU_LUT_OSD_OETF,
};
#define COEFF_NORM(a) ((int)((((a) * 2048.0) + 1) / 2))
#define MATRIX_5X3_COEF_SIZE 24
#define EOTF_COEFF_NORM(a) ((int)((((a) * 4096.0) + 1) / 2))
#define EOTF_COEFF_SIZE 10
#define EOTF_COEFF_RIGHTSHIFT 1
static int RGB709_to_YUV709l_coeff[MATRIX_5X3_COEF_SIZE] = {
0, 0, 0, /* pre offset */
COEFF_NORM(0.181873), COEFF_NORM(0.611831), COEFF_NORM(0.061765),
COEFF_NORM(-0.100251), COEFF_NORM(-0.337249), COEFF_NORM(0.437500),
COEFF_NORM(0.437500), COEFF_NORM(-0.397384), COEFF_NORM(-0.040116),
0, 0, 0, /* 10'/11'/12' */
0, 0, 0, /* 20'/21'/22' */
64, 512, 512, /* offset */
0, 0, 0 /* mode, right_shift, clip_en */
};
/* eotf matrix: bypass */
static int eotf_bypass_coeff[EOTF_COEFF_SIZE] = {
EOTF_COEFF_NORM(1.0), EOTF_COEFF_NORM(0.0), EOTF_COEFF_NORM(0.0),
EOTF_COEFF_NORM(0.0), EOTF_COEFF_NORM(1.0), EOTF_COEFF_NORM(0.0),
EOTF_COEFF_NORM(0.0), EOTF_COEFF_NORM(0.0), EOTF_COEFF_NORM(1.0),
EOTF_COEFF_RIGHTSHIFT /* right shift */
};
static void meson_viu_set_g12a_osd1_matrix(struct meson_drm *priv,
int *m, bool csc_on)
{
/* VPP WRAP OSD1 matrix */
writel(((m[0] & 0xfff) << 16) | (m[1] & 0xfff),
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_PRE_OFFSET0_1));
writel(m[2] & 0xfff,
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_PRE_OFFSET2));
writel(((m[3] & 0x1fff) << 16) | (m[4] & 0x1fff),
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF00_01));
writel(((m[5] & 0x1fff) << 16) | (m[6] & 0x1fff),
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF02_10));
writel(((m[7] & 0x1fff) << 16) | (m[8] & 0x1fff),
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF11_12));
writel(((m[9] & 0x1fff) << 16) | (m[10] & 0x1fff),
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF20_21));
writel((m[11] & 0x1fff) << 16,
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF22));
writel(((m[18] & 0xfff) << 16) | (m[19] & 0xfff),
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_OFFSET0_1));
writel(m[20] & 0xfff,
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_OFFSET2));
writel_bits_relaxed(BIT(0), csc_on ? BIT(0) : 0,
priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_EN_CTRL));
}
static void meson_viu_set_osd_matrix(struct meson_drm *priv,
enum viu_matrix_sel_e m_select,
int *m, bool csc_on)
{
if (m_select == VIU_MATRIX_OSD) {
/* osd matrix, VIU_MATRIX_0 */
writel(((m[0] & 0xfff) << 16) | (m[1] & 0xfff),
priv->io_base + _REG(VIU_OSD1_MATRIX_PRE_OFFSET0_1));
writel(m[2] & 0xfff,
priv->io_base + _REG(VIU_OSD1_MATRIX_PRE_OFFSET2));
writel(((m[3] & 0x1fff) << 16) | (m[4] & 0x1fff),
priv->io_base + _REG(VIU_OSD1_MATRIX_COEF00_01));
writel(((m[5] & 0x1fff) << 16) | (m[6] & 0x1fff),
priv->io_base + _REG(VIU_OSD1_MATRIX_COEF02_10));
writel(((m[7] & 0x1fff) << 16) | (m[8] & 0x1fff),
priv->io_base + _REG(VIU_OSD1_MATRIX_COEF11_12));
writel(((m[9] & 0x1fff) << 16) | (m[10] & 0x1fff),
priv->io_base + _REG(VIU_OSD1_MATRIX_COEF20_21));
if (m[21]) {
writel(((m[11] & 0x1fff) << 16) | (m[12] & 0x1fff),
priv->io_base +
_REG(VIU_OSD1_MATRIX_COEF22_30));
writel(((m[13] & 0x1fff) << 16) | (m[14] & 0x1fff),
priv->io_base +
_REG(VIU_OSD1_MATRIX_COEF31_32));
writel(((m[15] & 0x1fff) << 16) | (m[16] & 0x1fff),
priv->io_base +
_REG(VIU_OSD1_MATRIX_COEF40_41));
writel(m[17] & 0x1fff, priv->io_base +
_REG(VIU_OSD1_MATRIX_COLMOD_COEF42));
} else
writel((m[11] & 0x1fff) << 16, priv->io_base +
_REG(VIU_OSD1_MATRIX_COEF22_30));
writel(((m[18] & 0xfff) << 16) | (m[19] & 0xfff),
priv->io_base + _REG(VIU_OSD1_MATRIX_OFFSET0_1));
writel(m[20] & 0xfff,
priv->io_base + _REG(VIU_OSD1_MATRIX_OFFSET2));
writel_bits_relaxed(3 << 30, m[21] << 30,
priv->io_base + _REG(VIU_OSD1_MATRIX_COLMOD_COEF42));
writel_bits_relaxed(7 << 16, m[22] << 16,
priv->io_base + _REG(VIU_OSD1_MATRIX_COLMOD_COEF42));
/* 23 reserved for clipping control */
writel_bits_relaxed(BIT(0), csc_on ? BIT(0) : 0,
priv->io_base + _REG(VIU_OSD1_MATRIX_CTRL));
writel_bits_relaxed(BIT(1), 0,
priv->io_base + _REG(VIU_OSD1_MATRIX_CTRL));
} else if (m_select == VIU_MATRIX_OSD_EOTF) {
int i;
/* osd eotf matrix, VIU_MATRIX_OSD_EOTF */
for (i = 0; i < 5; i++)
writel(((m[i * 2] & 0x1fff) << 16) |
(m[i * 2 + 1] & 0x1fff), priv->io_base +
_REG(VIU_OSD1_EOTF_CTL + i + 1));
writel_bits_relaxed(BIT(30), csc_on ? BIT(30) : 0,
priv->io_base + _REG(VIU_OSD1_EOTF_CTL));
writel_bits_relaxed(BIT(31), csc_on ? BIT(31) : 0,
priv->io_base + _REG(VIU_OSD1_EOTF_CTL));
}
}
#define OSD_EOTF_LUT_SIZE 33
#define OSD_OETF_LUT_SIZE 41
static void
meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel,
unsigned int *r_map, unsigned int *g_map,
unsigned int *b_map, bool csc_on)
{
unsigned int addr_port;
unsigned int data_port;
unsigned int ctrl_port;
int i;
if (lut_sel == VIU_LUT_OSD_EOTF) {
addr_port = VIU_OSD1_EOTF_LUT_ADDR_PORT;
data_port = VIU_OSD1_EOTF_LUT_DATA_PORT;
ctrl_port = VIU_OSD1_EOTF_CTL;
} else if (lut_sel == VIU_LUT_OSD_OETF) {
addr_port = VIU_OSD1_OETF_LUT_ADDR_PORT;
data_port = VIU_OSD1_OETF_LUT_DATA_PORT;
ctrl_port = VIU_OSD1_OETF_CTL;
} else
return;
if (lut_sel == VIU_LUT_OSD_OETF) {
writel(0, priv->io_base + _REG(addr_port));
for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++)
writel(r_map[i * 2] | (r_map[i * 2 + 1] << 16),
priv->io_base + _REG(data_port));
writel(r_map[OSD_OETF_LUT_SIZE - 1] | (g_map[0] << 16),
priv->io_base + _REG(data_port));
for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++)
writel(g_map[i * 2 + 1] | (g_map[i * 2 + 2] << 16),
priv->io_base + _REG(data_port));
for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++)
writel(b_map[i * 2] | (b_map[i * 2 + 1] << 16),
priv->io_base + _REG(data_port));
writel(b_map[OSD_OETF_LUT_SIZE - 1],
priv->io_base + _REG(data_port));
if (csc_on)
writel_bits_relaxed(0x7 << 29, 7 << 29,
priv->io_base + _REG(ctrl_port));
else
writel_bits_relaxed(0x7 << 29, 0,
priv->io_base + _REG(ctrl_port));
} else if (lut_sel == VIU_LUT_OSD_EOTF) {
writel(0, priv->io_base + _REG(addr_port));
for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++)
writel(r_map[i * 2] | (r_map[i * 2 + 1] << 16),
priv->io_base + _REG(data_port));
writel(r_map[OSD_EOTF_LUT_SIZE - 1] | (g_map[0] << 16),
priv->io_base + _REG(data_port));
for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++)
writel(g_map[i * 2 + 1] | (g_map[i * 2 + 2] << 16),
priv->io_base + _REG(data_port));
for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++)
writel(b_map[i * 2] | (b_map[i * 2 + 1] << 16),
priv->io_base + _REG(data_port));
writel(b_map[OSD_EOTF_LUT_SIZE - 1],
priv->io_base + _REG(data_port));
if (csc_on)
writel_bits_relaxed(7 << 27, 7 << 27,
priv->io_base + _REG(ctrl_port));
else
writel_bits_relaxed(7 << 27, 0,
priv->io_base + _REG(ctrl_port));
writel_bits_relaxed(BIT(31), BIT(31),
priv->io_base + _REG(ctrl_port));
}
}
/* eotf lut: linear */
static unsigned int eotf_33_linear_mapping[OSD_EOTF_LUT_SIZE] = {
0x0000, 0x0200, 0x0400, 0x0600,
0x0800, 0x0a00, 0x0c00, 0x0e00,
0x1000, 0x1200, 0x1400, 0x1600,
0x1800, 0x1a00, 0x1c00, 0x1e00,
0x2000, 0x2200, 0x2400, 0x2600,
0x2800, 0x2a00, 0x2c00, 0x2e00,
0x3000, 0x3200, 0x3400, 0x3600,
0x3800, 0x3a00, 0x3c00, 0x3e00,
0x4000
};
/* osd oetf lut: linear */
static unsigned int oetf_41_linear_mapping[OSD_OETF_LUT_SIZE] = {
0, 0, 0, 0,
0, 32, 64, 96,
128, 160, 196, 224,
256, 288, 320, 352,
384, 416, 448, 480,
512, 544, 576, 608,
640, 672, 704, 736,
768, 800, 832, 864,
896, 928, 960, 992,
1023, 1023, 1023, 1023,
1023
};
static void meson_viu_load_matrix(struct meson_drm *priv)
{
/* eotf lut bypass */
meson_viu_set_osd_lut(priv, VIU_LUT_OSD_EOTF,
eotf_33_linear_mapping, /* R */
eotf_33_linear_mapping, /* G */
eotf_33_linear_mapping, /* B */
false);
/* eotf matrix bypass */
meson_viu_set_osd_matrix(priv, VIU_MATRIX_OSD_EOTF,
eotf_bypass_coeff,
false);
/* oetf lut bypass */
meson_viu_set_osd_lut(priv, VIU_LUT_OSD_OETF,
oetf_41_linear_mapping, /* R */
oetf_41_linear_mapping, /* G */
oetf_41_linear_mapping, /* B */
false);
/* osd matrix RGB709 to YUV709 limit */
meson_viu_set_osd_matrix(priv, VIU_MATRIX_OSD,
RGB709_to_YUV709l_coeff,
true);
}
/* VIU OSD1 Reset as workaround for GXL+ Alpha OSD Bug */
void meson_viu_osd1_reset(struct meson_drm *priv)
{
uint32_t osd1_fifo_ctrl_stat, osd1_ctrl_stat2;
/* Save these 2 registers state */
osd1_fifo_ctrl_stat = readl_relaxed(
priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT));
osd1_ctrl_stat2 = readl_relaxed(
priv->io_base + _REG(VIU_OSD1_CTRL_STAT2));
/* Reset OSD1 */
writel_bits_relaxed(VIU_SW_RESET_OSD1, VIU_SW_RESET_OSD1,
priv->io_base + _REG(VIU_SW_RESET));
writel_bits_relaxed(VIU_SW_RESET_OSD1, 0,
priv->io_base + _REG(VIU_SW_RESET));
/* Rewrite these registers state lost in the reset */
writel_relaxed(osd1_fifo_ctrl_stat,
priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT));
writel_relaxed(osd1_ctrl_stat2,
priv->io_base + _REG(VIU_OSD1_CTRL_STAT2));
/* Reload the conversion matrix */
meson_viu_load_matrix(priv);
}
static inline uint32_t meson_viu_osd_burst_length_reg(uint32_t length)
{
uint32_t val = (((length & 0x80) % 24) / 12);
return (((val & 0x3) << 10) | (((val & 0x4) >> 2) << 31));
}
void meson_viu_init(struct meson_drm *priv)
{
uint32_t reg;
/* Disable OSDs */
writel_bits_relaxed(VIU_OSD1_OSD_BLK_ENABLE | VIU_OSD1_OSD_ENABLE, 0,
priv->io_base + _REG(VIU_OSD1_CTRL_STAT));
writel_bits_relaxed(VIU_OSD1_OSD_BLK_ENABLE | VIU_OSD1_OSD_ENABLE, 0,
priv->io_base + _REG(VIU_OSD2_CTRL_STAT));
/* On GXL/GXM, Use the 10bit HDR conversion matrix */
if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_GXM) ||
meson_vpu_is_compatible(priv, VPU_COMPATIBLE_GXL))
meson_viu_load_matrix(priv);
else if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A))
meson_viu_set_g12a_osd1_matrix(priv, RGB709_to_YUV709l_coeff,
true);
/* Initialize OSD1 fifo control register */
reg = VIU_OSD_DDR_PRIORITY_URGENT |
VIU_OSD_HOLD_FIFO_LINES(4) |
VIU_OSD_FIFO_DEPTH_VAL(32) | /* fifo_depth_val: 32*8=256 */
VIU_OSD_WORDS_PER_BURST(4) | /* 4 words in 1 burst */
VIU_OSD_FIFO_LIMITS(2); /* fifo_lim: 2*16=32 */
if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A))
reg |= meson_viu_osd_burst_length_reg(32);
else
reg |= meson_viu_osd_burst_length_reg(64);
writel_relaxed(reg, priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT));
writel_relaxed(reg, priv->io_base + _REG(VIU_OSD2_FIFO_CTRL_STAT));
/* Set OSD alpha replace value */
writel_bits_relaxed(0xff << OSD_REPLACE_SHIFT,
0xff << OSD_REPLACE_SHIFT,
priv->io_base + _REG(VIU_OSD1_CTRL_STAT2));
writel_bits_relaxed(0xff << OSD_REPLACE_SHIFT,
0xff << OSD_REPLACE_SHIFT,
priv->io_base + _REG(VIU_OSD2_CTRL_STAT2));
/* Disable VD1 AFBC */
/* di_mif0_en=0 mif0_to_vpp_en=0 di_mad_en=0 and afbc vd1 set=0*/
writel_bits_relaxed(VIU_CTRL0_VD1_AFBC_MASK, 0,
priv->io_base + _REG(VIU_MISC_CTRL0));
writel_relaxed(0, priv->io_base + _REG(AFBC_ENABLE));
writel_relaxed(0x00FF00C0,
priv->io_base + _REG(VD1_IF0_LUMA_FIFO_SIZE));
writel_relaxed(0x00FF00C0,
priv->io_base + _REG(VD2_IF0_LUMA_FIFO_SIZE));
if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) {
writel_relaxed(VIU_OSD_BLEND_REORDER(0, 1) |
VIU_OSD_BLEND_REORDER(1, 0) |
VIU_OSD_BLEND_REORDER(2, 0) |
VIU_OSD_BLEND_REORDER(3, 0) |
VIU_OSD_BLEND_DIN_EN(1) |
VIU_OSD_BLEND1_DIN3_BYPASS_TO_DOUT1 |
VIU_OSD_BLEND1_DOUT_BYPASS_TO_BLEND2 |
VIU_OSD_BLEND_DIN0_BYPASS_TO_DOUT0 |
VIU_OSD_BLEND_BLEN2_PREMULT_EN(1) |
VIU_OSD_BLEND_HOLD_LINES(4),
priv->io_base + _REG(VIU_OSD_BLEND_CTRL));
writel_relaxed(OSD_BLEND_PATH_SEL_ENABLE,
priv->io_base + _REG(OSD1_BLEND_SRC_CTRL));
writel_relaxed(OSD_BLEND_PATH_SEL_ENABLE,
priv->io_base + _REG(OSD2_BLEND_SRC_CTRL));
writel_relaxed(0, priv->io_base + _REG(VD1_BLEND_SRC_CTRL));
writel_relaxed(0, priv->io_base + _REG(VD2_BLEND_SRC_CTRL));
writel_relaxed(0,
priv->io_base + _REG(VIU_OSD_BLEND_DUMMY_DATA0));
writel_relaxed(0,
priv->io_base + _REG(VIU_OSD_BLEND_DUMMY_ALPHA));
writel_bits_relaxed(DOLBY_BYPASS_EN(0xc), DOLBY_BYPASS_EN(0xc),
priv->io_base + _REG(DOLBY_PATH_CTRL));
}
priv->viu.osd1_enabled = false;
priv->viu.osd1_commit = false;
priv->viu.osd1_interlace = false;
}
| {
"pile_set_name": "Github"
} |
## `php:7-zts-alpine3.11`
```console
$ docker pull php@sha256:8e641ff356f67df8485ffeadb8d69e752f31ab4039092abc8719f900d1c21423
```
- Manifest MIME: `application/vnd.docker.distribution.manifest.list.v2+json`
- Platforms:
- linux; amd64
- linux; arm variant v6
- linux; arm variant v7
- linux; arm64 variant v8
- linux; 386
- linux; ppc64le
- linux; s390x
### `php:7-zts-alpine3.11` - linux; amd64
```console
$ docker pull php@sha256:5ae7776ee7ce3d62be8f52fd591a5378cb1735e532900e205a527f5a16a9fcce
```
- Docker Version: 18.09.7
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **25.3 MB (25292212 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:87a359011ec8ed16325dab1c88ce1d805aec9a6995ff685ff6a0979ef8f7eee3`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Fri, 24 Apr 2020 01:05:03 GMT
ADD file:b91adb67b670d3a6ff9463e48b7def903ed516be66fc4282d22c53e41512be49 in /
# Fri, 24 Apr 2020 01:05:03 GMT
CMD ["/bin/sh"]
# Fri, 24 Apr 2020 17:35:49 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Fri, 24 Apr 2020 17:35:50 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Fri, 24 Apr 2020 17:35:51 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Fri, 24 Apr 2020 17:35:51 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Fri, 24 Apr 2020 17:35:52 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Fri, 24 Apr 2020 17:46:27 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Fri, 24 Apr 2020 17:46:27 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 17:46:27 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 17:46:27 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Fri, 24 Apr 2020 17:46:28 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 20:30:57 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 20:30:57 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 20:30:57 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 20:31:01 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 20:31:01 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 20:40:46 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 20:40:47 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 20:40:48 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 20:40:48 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 20:40:48 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:cbdbe7a5bc2a134ca8ec91be58565ec07d037386d1f1d8385412d224deafca08`
Last Modified: Thu, 23 Apr 2020 14:07:19 GMT
Size: 2.8 MB (2813316 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:1bc86e4cff5f320d778d7412cab415d31e8e986659b5e453545b0a7afe86d472`
Last Modified: Fri, 24 Apr 2020 19:16:17 GMT
Size: 1.4 MB (1355296 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:7be142bd33f5003d85a3e056208af127ac6c5f627f263469134baafdd011ad59`
Last Modified: Fri, 24 Apr 2020 19:16:16 GMT
Size: 1.2 KB (1232 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:8132c9e52be363f64724649f370635dd54cac7b8696c6365dd2011290afbc7c0`
Last Modified: Fri, 24 Apr 2020 19:16:16 GMT
Size: 221.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:0c8affac112896ad76a3010e93de8ea691754615b4644e7f217c1e7b31c3f365`
Last Modified: Thu, 03 Sep 2020 22:52:24 GMT
Size: 10.3 MB (10317576 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:c7512d80f9ebdb44642c3bc662f3e97d2464a44f73f6ef3dae72bbe5f3e581bb`
Last Modified: Thu, 03 Sep 2020 22:52:22 GMT
Size: 497.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:268cf0801c71be7a317b811421260121c31d24e7c84d61c743365e64fb339055`
Last Modified: Thu, 03 Sep 2020 22:52:26 GMT
Size: 10.8 MB (10784694 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:c40b4440a245bd9839110a38189ff5f9e58fd2cacaecc083ae8e173a69a417af`
Last Modified: Thu, 03 Sep 2020 22:52:22 GMT
Size: 2.3 KB (2271 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:dfeac0a4d783098439fd45ac46730a74150de4304c5c3f1948268ce9b17b598b`
Last Modified: Thu, 03 Sep 2020 22:52:22 GMT
Size: 17.1 KB (17109 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
### `php:7-zts-alpine3.11` - linux; arm variant v6
```console
$ docker pull php@sha256:971adcbc12c938d77c498ffd08f9c7780adc95d8b7224c326e0387133fa4064d
```
- Docker Version: 19.03.12
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **24.4 MB (24443467 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:2221756c49028cbe56774a88f541431fd3d13a558db5f98fcbcd69426eb56830`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Thu, 23 Apr 2020 15:51:24 GMT
ADD file:cc0770cddff6b50d5e31f39886420eb8a0b4af55664d6f7599207c9aeaf6a501 in /
# Thu, 23 Apr 2020 15:51:25 GMT
CMD ["/bin/sh"]
# Thu, 23 Apr 2020 22:40:29 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Thu, 23 Apr 2020 22:40:31 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Thu, 23 Apr 2020 22:40:34 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Thu, 23 Apr 2020 22:40:35 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Thu, 23 Apr 2020 22:40:37 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Thu, 23 Apr 2020 22:49:14 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Thu, 23 Apr 2020 22:49:15 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Thu, 23 Apr 2020 22:49:16 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Thu, 23 Apr 2020 22:49:17 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Thu, 23 Apr 2020 22:49:18 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 19:51:35 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 19:51:48 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 19:52:00 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 19:53:00 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 19:53:16 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 19:57:45 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 19:58:23 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 19:59:07 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 19:59:23 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 19:59:35 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:b9e3228833e92f0688e0f87234e75965e62e47cfbb9ca8cc5fa19c2e7cd13f80`
Last Modified: Thu, 23 Apr 2020 15:52:05 GMT
Size: 2.6 MB (2619936 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:19e4a0b35ae612f97f86d2cb9a5c35d9974c53c9693ed9c503293a2ed4d1f5eb`
Last Modified: Thu, 23 Apr 2020 23:53:32 GMT
Size: 1.3 MB (1321299 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:744673dda954515280697917b25c13df9ff57231c28643848fc80b349d6b246b`
Last Modified: Thu, 23 Apr 2020 23:53:31 GMT
Size: 1.3 KB (1258 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:6829673d00afbe39285f6e4d9977770c99d7bf841436086efa137773c99fd188`
Last Modified: Thu, 23 Apr 2020 23:53:31 GMT
Size: 268.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:ae0026783f78f2a67c4c903a8e1b60fa34d844163c1202a111fe8f985ae1290f`
Last Modified: Thu, 03 Sep 2020 20:59:54 GMT
Size: 10.3 MB (10317601 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:5348764a6c3bdd574f7b7a9bd26e981e35cc68920edf32b3ea8aaa6c58397463`
Last Modified: Thu, 03 Sep 2020 20:59:54 GMT
Size: 499.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:44e306693e33a1cbd27b8217b033de4e905356e4dff8f5d8f2d10d3e47379b4c`
Last Modified: Thu, 03 Sep 2020 20:59:57 GMT
Size: 10.2 MB (10163234 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:fffe3b67b2e37431c30ad17f9ac22bdf7f2314a92a65fcb46a384978ad3195ec`
Last Modified: Thu, 03 Sep 2020 20:59:54 GMT
Size: 2.3 KB (2275 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:8efc62c1ceea2a262b703e0602f385cb47f202c094c1abbf4c05d4d89817f48c`
Last Modified: Thu, 03 Sep 2020 20:59:54 GMT
Size: 17.1 KB (17097 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
### `php:7-zts-alpine3.11` - linux; arm variant v7
```console
$ docker pull php@sha256:11efc61c6579b56eeebfa6a9fe83889ea605d44a38422acd16e4186b0f0cad5c
```
- Docker Version: 19.03.12
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **23.5 MB (23493976 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:5b063406b743bd6e55f717ac9d363a9ae8f8d415fbbdcd1730d621c9d613ada6`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Thu, 23 Apr 2020 22:04:19 GMT
ADD file:33578d3cacfab86c195d99396dd012ec511796a1d2d8d6f0a02b8a055673c294 in /
# Thu, 23 Apr 2020 22:04:22 GMT
CMD ["/bin/sh"]
# Fri, 24 Apr 2020 09:12:29 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Fri, 24 Apr 2020 09:12:32 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Fri, 24 Apr 2020 09:12:34 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Fri, 24 Apr 2020 09:12:35 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Fri, 24 Apr 2020 09:12:36 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Fri, 24 Apr 2020 09:18:11 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Fri, 24 Apr 2020 09:18:12 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 09:18:13 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 09:18:13 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Fri, 24 Apr 2020 09:18:14 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 21:24:47 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 21:24:59 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 21:25:10 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 21:25:51 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 21:26:05 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 21:29:17 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 21:29:55 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 21:30:46 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 21:31:02 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 21:31:18 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:3cfb62949d9d8613854db4d5fe502a9219c2b55a153043500078a64e880ae234`
Last Modified: Thu, 23 Apr 2020 22:05:12 GMT
Size: 2.4 MB (2422063 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:39281f57fe7d3f99c4fe23af0e5eb45caa0646180d5ff71304d26ff35a0b9856`
Last Modified: Fri, 24 Apr 2020 11:16:34 GMT
Size: 1.2 MB (1227897 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:8df36ec4ede8343ef6e75d1f33f8dbbe0ccdfa6522152dda7801db48b8a06b85`
Last Modified: Fri, 24 Apr 2020 11:16:33 GMT
Size: 1.3 KB (1258 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:d2e16ed34ef7f3b453ef768e1198de2318c7d1cdd60f43223f1c53df2e82119e`
Last Modified: Fri, 24 Apr 2020 11:16:33 GMT
Size: 269.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:18176c16def93b50eeb13410657fe4e73417a089f776317a8f4d994712bf3858`
Last Modified: Thu, 03 Sep 2020 23:31:22 GMT
Size: 10.3 MB (10317601 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:6141d05842025ccb6aeb4ddceafa40873018c16c445ddfa75f489d0ce8294c8e`
Last Modified: Thu, 03 Sep 2020 23:31:21 GMT
Size: 500.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:95e96aeb175e291c90acacfd04a47f54ea36c504c60b2fc16c658609197b7be1`
Last Modified: Thu, 03 Sep 2020 23:31:24 GMT
Size: 9.5 MB (9505024 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:541ccf227fab4b0972c2e4110f31414f37894236991d66dba85b518feeb9eb8e`
Last Modified: Thu, 03 Sep 2020 23:31:21 GMT
Size: 2.3 KB (2275 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:59ce26c979afbd2c61a9e7c947b2bf9ef51077e1d7e0f073794657505addc994`
Last Modified: Thu, 03 Sep 2020 23:31:21 GMT
Size: 17.1 KB (17089 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
### `php:7-zts-alpine3.11` - linux; arm64 variant v8
```console
$ docker pull php@sha256:6b1df72a47b646d88915a3057d9de177501f7a92a82fe021c735305490607280
```
- Docker Version: 18.09.7
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **25.1 MB (25128295 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:3ccc3a9ffbf36d51924df4b93c3a317d0c62766e288ad0f80e3d5553abe82e78`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Fri, 24 Apr 2020 00:14:18 GMT
ADD file:85ae77bc1e43353ff14e6fe1658be1ed4ecbf4330212ac3d7ab7462add32dd39 in /
# Fri, 24 Apr 2020 00:14:21 GMT
CMD ["/bin/sh"]
# Fri, 24 Apr 2020 12:51:29 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Fri, 24 Apr 2020 12:51:32 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Fri, 24 Apr 2020 12:51:35 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Fri, 24 Apr 2020 12:51:36 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Fri, 24 Apr 2020 12:51:38 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Fri, 24 Apr 2020 13:00:13 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Fri, 24 Apr 2020 13:00:14 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 13:00:15 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 13:00:15 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Fri, 24 Apr 2020 13:00:16 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 20:19:12 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 20:19:15 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 20:19:23 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 20:19:57 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 20:20:04 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 20:24:10 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 20:24:13 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 20:24:17 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 20:24:19 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 20:24:20 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:29e5d40040c18c692ed73df24511071725b74956ca1a61fe6056a651d86a13bd`
Last Modified: Fri, 24 Apr 2020 00:15:41 GMT
Size: 2.7 MB (2724424 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:9f8614da4aa8d46e10af7f7788136931561b8f1d1efe1a78311b26f5cf57506f`
Last Modified: Fri, 24 Apr 2020 14:02:47 GMT
Size: 1.4 MB (1359714 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:ececdba1264fbd4760d671f21f71713e4038fc665ad77ae891d54cc1d8db0cc3`
Last Modified: Fri, 24 Apr 2020 14:02:46 GMT
Size: 1.3 KB (1259 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:eab4eb699b8d1e5be3d1e82202067c943b8869558f71be0d2557563912b0f942`
Last Modified: Fri, 24 Apr 2020 14:02:47 GMT
Size: 269.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:8541d4502639d775a3c473bef49557829297bb50c0fd6102e629fa5e614540bd`
Last Modified: Thu, 03 Sep 2020 21:50:20 GMT
Size: 10.3 MB (10317601 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:f0d7e174489fbd29ec995ab0b5aef0ef0a0830654a08979b78cdb739de0a7ac1`
Last Modified: Thu, 03 Sep 2020 21:50:20 GMT
Size: 499.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:cd261e87cacf7a721278e19ca4e5fb7765df4c1be349aae06c95a2b02c8cdd26`
Last Modified: Thu, 03 Sep 2020 21:50:21 GMT
Size: 10.7 MB (10705158 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:4fe681bb0a34172c9715640b0779c96a063bcbf8ad70da7ee77196ae4402a220`
Last Modified: Thu, 03 Sep 2020 21:50:20 GMT
Size: 2.3 KB (2276 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:8f21de0549433129a5fe6c8b5e76c32f6ceeb07da797ef70179be3a95c1f7bc8`
Last Modified: Thu, 03 Sep 2020 21:50:20 GMT
Size: 17.1 KB (17095 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
### `php:7-zts-alpine3.11` - linux; 386
```console
$ docker pull php@sha256:80139d5caac2f8e4fb0a65264cae64cd68126b1ce3b232bbf24356c1a70b93c0
```
- Docker Version: 19.03.12
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **25.7 MB (25704439 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:3ab14a3824726f959a1f1298f55a7619c0bcfc1a2431d6832e394df86cef6d1b`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Thu, 23 Apr 2020 21:16:04 GMT
ADD file:63bd8a316cba8c404cc2e32a5120406c24aee8db3224c469a6077b941d900863 in /
# Thu, 23 Apr 2020 21:16:04 GMT
CMD ["/bin/sh"]
# Fri, 24 Apr 2020 06:05:44 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Fri, 24 Apr 2020 06:05:46 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Fri, 24 Apr 2020 06:05:47 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Fri, 24 Apr 2020 06:05:47 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Fri, 24 Apr 2020 06:05:48 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Fri, 24 Apr 2020 06:17:25 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Fri, 24 Apr 2020 06:17:25 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 06:17:25 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 06:17:25 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Fri, 24 Apr 2020 06:17:25 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 21:11:17 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 21:11:17 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 21:11:18 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 21:11:23 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 21:11:23 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 21:20:48 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 21:20:49 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 21:20:51 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 21:20:52 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 21:20:52 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:2826c1e79865da7e0da0a993a2a38db61c3911e05b5df617439a86d4deac90fb`
Last Modified: Thu, 23 Apr 2020 21:16:32 GMT
Size: 2.8 MB (2808418 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:990138137e85533c48403b0cd1aee9ac6c5f3fc3be67a74a44a22f1a30e39af6`
Last Modified: Fri, 24 Apr 2020 07:59:39 GMT
Size: 1.5 MB (1453100 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:9d973cd3524efeb6727b2144c33f96c71896f4ee22b1a55cc0c5aa5756f9b758`
Last Modified: Fri, 24 Apr 2020 07:59:37 GMT
Size: 1.2 KB (1231 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:f386ab173ce6081c15380f99f906f8ea531e5748425804a21ebb0b5c433e6782`
Last Modified: Fri, 24 Apr 2020 07:59:38 GMT
Size: 223.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:4e4cc1649efeee9075afd4a3f2933521ed6c0809f50d78aa9465060b632972e5`
Last Modified: Thu, 03 Sep 2020 23:24:12 GMT
Size: 10.3 MB (10317593 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:a197e3eee3a7dbfdc9ca47361867dcfe976efb27598c24d1df78ca14d9eca956`
Last Modified: Thu, 03 Sep 2020 23:24:11 GMT
Size: 499.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:a7ecdfbf9af9e48680cba962f46c105f84b3dca69ff6e450ebecfdedd2d8810c`
Last Modified: Thu, 03 Sep 2020 23:24:14 GMT
Size: 11.1 MB (11103993 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:88a04ed06f3b55f64dcece1d5e5dcee16de7c3a9ec5f3c0bfe5eb11f62d2f337`
Last Modified: Thu, 03 Sep 2020 23:24:11 GMT
Size: 2.3 KB (2270 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:82c530cc6ec1227ada4196e66cdaa63146a1d48635ca5a6e3d417b5ed5111fca`
Last Modified: Thu, 03 Sep 2020 23:24:11 GMT
Size: 17.1 KB (17112 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
### `php:7-zts-alpine3.11` - linux; ppc64le
```console
$ docker pull php@sha256:b4b78f75df764cfe7fe6b0d77957654f1576c4c9ace41b5a2502bbe9df6beccd
```
- Docker Version: 18.09.7
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **26.0 MB (26043408 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:d0f6b4ac6b84d5c31f9cf55775836e05e5d404179086472eb2d4a56dd909c871`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Thu, 23 Apr 2020 20:39:04 GMT
ADD file:1aaebe252dfb1885e066fcbc84aaa915bae149c3608f19600855ad1d4f7450c1 in /
# Thu, 23 Apr 2020 20:39:06 GMT
CMD ["/bin/sh"]
# Fri, 24 Apr 2020 07:11:31 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Fri, 24 Apr 2020 07:11:47 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Fri, 24 Apr 2020 07:12:07 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Fri, 24 Apr 2020 07:12:12 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Fri, 24 Apr 2020 07:12:28 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Fri, 24 Apr 2020 07:24:30 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Fri, 24 Apr 2020 07:24:33 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 07:24:36 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Fri, 24 Apr 2020 07:24:42 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Fri, 24 Apr 2020 07:24:46 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 20:40:35 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 20:40:41 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 20:40:53 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 20:41:13 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 20:41:16 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 20:45:24 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 20:45:34 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 20:46:03 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 20:46:12 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 20:46:19 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:9a8fdc5b698322331ee7eba7dd6f66f3a4e956554db22dd1e834d519415b4f8e`
Last Modified: Thu, 23 Apr 2020 20:41:33 GMT
Size: 2.8 MB (2821843 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:1d52f33021895c8254527a626bd23b02f5ffb7cf7d498663099bfb52bc36cb4f`
Last Modified: Fri, 24 Apr 2020 08:53:41 GMT
Size: 1.4 MB (1398496 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:2ca0df5facaec815af37eabcf3f16b8d84fbf49322219c06e6d19e7067b54f86`
Last Modified: Fri, 24 Apr 2020 08:53:38 GMT
Size: 1.3 KB (1266 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:5eafa9bf45f1a09b417cf061af38e982c6a4e2c77a1f1f3c59b8587f215c9208`
Last Modified: Fri, 24 Apr 2020 08:53:37 GMT
Size: 269.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:e2c6d9bbd156d4ca1ce0d1f2d2853f57f3c3d97bdff0c59c5de23871d11e65c8`
Last Modified: Thu, 03 Sep 2020 22:23:29 GMT
Size: 10.3 MB (10317615 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:07f1cefc81d3166b0055b6f103d8dc79537052b5b8a7636606485d6b66135a7b`
Last Modified: Thu, 03 Sep 2020 22:23:27 GMT
Size: 499.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:bfd802934d554df302d77473f50276845dc1d09f7e360b8b4a469e7333563525`
Last Modified: Thu, 03 Sep 2020 22:23:40 GMT
Size: 11.5 MB (11484055 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:c6c116b4e6abfcab9a37108859a4666a100f0df105637ef96beb730fdc4ff1ea`
Last Modified: Thu, 03 Sep 2020 22:23:27 GMT
Size: 2.3 KB (2270 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:3c320778f090d94e07118d26f67a4ab49973f6627c9d2feea1753b5edadc8ec7`
Last Modified: Thu, 03 Sep 2020 22:23:27 GMT
Size: 17.1 KB (17095 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
### `php:7-zts-alpine3.11` - linux; s390x
```console
$ docker pull php@sha256:5004f62d4a19f4e5f6438ac1a9b53174493ccf76682c8b4d8e937e8482d51127
```
- Docker Version: 18.09.7
- Manifest MIME: `application/vnd.docker.distribution.manifest.v2+json`
- Total Size: **24.8 MB (24756078 bytes)**
(compressed transfer size, not on-disk size)
- Image ID: `sha256:de65fde55390a47815144ac7c01a133f97eb8565c773d91cab7cf22f2dd4aeaa`
- Entrypoint: `["docker-php-entrypoint"]`
- Default Command: `["php","-a"]`
```dockerfile
# Thu, 23 Apr 2020 17:50:57 GMT
ADD file:a59a30c2fd43c9f3b820751a6f5a54688c14440a1ddace1ab255475f46e6ba2d in /
# Thu, 23 Apr 2020 17:50:58 GMT
CMD ["/bin/sh"]
# Thu, 23 Apr 2020 23:04:48 GMT
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
# Thu, 23 Apr 2020 23:04:49 GMT
RUN apk add --no-cache ca-certificates curl tar xz openssl
# Thu, 23 Apr 2020 23:04:50 GMT
RUN set -eux; addgroup -g 82 -S www-data; adduser -u 82 -D -S -G www-data www-data
# Thu, 23 Apr 2020 23:04:50 GMT
ENV PHP_INI_DIR=/usr/local/etc/php
# Thu, 23 Apr 2020 23:04:51 GMT
RUN set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 777 /var/www/html
# Thu, 23 Apr 2020 23:09:56 GMT
ENV PHP_EXTRA_CONFIGURE_ARGS=--enable-maintainer-zts --disable-cgi
# Thu, 23 Apr 2020 23:09:56 GMT
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Thu, 23 Apr 2020 23:09:56 GMT
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# Thu, 23 Apr 2020 23:09:56 GMT
ENV PHP_LDFLAGS=-Wl,-O1 -pie
# Thu, 23 Apr 2020 23:09:57 GMT
ENV GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
# Thu, 03 Sep 2020 19:28:35 GMT
ENV PHP_VERSION=7.4.10
# Thu, 03 Sep 2020 19:28:35 GMT
ENV PHP_URL=https://www.php.net/distributions/php-7.4.10.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-7.4.10.tar.xz.asc
# Thu, 03 Sep 2020 19:28:35 GMT
ENV PHP_SHA256=c2d90b00b14284588a787b100dee54c2400e7db995b457864d66f00ad64fb010 PHP_MD5=
# Thu, 03 Sep 2020 19:28:39 GMT
RUN set -eux; apk add --no-cache --virtual .fetch-deps gnupg; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_MD5" ]; then echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apk del --no-network .fetch-deps
# Thu, 03 Sep 2020 19:28:40 GMT
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/
# Thu, 03 Sep 2020 19:31:27 GMT
RUN set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev libedit-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev sqlite-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-libedit --with-openssl --with-zlib --with-pear $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') ${PHP_EXTRA_CONFIGURE_ARGS:-} ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version
# Thu, 03 Sep 2020 19:31:28 GMT
COPY multi:cfe027e655535d9b3eb4b44f84eafb2e1d257620ca628247fe5c1c4fb008a78a in /usr/local/bin/
# Thu, 03 Sep 2020 19:31:29 GMT
RUN docker-php-ext-enable sodium
# Thu, 03 Sep 2020 19:31:29 GMT
ENTRYPOINT ["docker-php-entrypoint"]
# Thu, 03 Sep 2020 19:31:30 GMT
CMD ["php" "-a"]
```
- Layers:
- `sha256:7184c046fdf17da4c16ca482e5ede36e1f2d41ac8cea9c036e488fd149d6e8e7`
Last Modified: Thu, 23 Apr 2020 17:51:38 GMT
Size: 2.6 MB (2582859 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:ce9311aad926b3cb7924b7f1bbfda3972f2b64dca32e8decf8257ba49353a285`
Last Modified: Thu, 23 Apr 2020 23:53:51 GMT
Size: 1.4 MB (1397092 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:c77861eec55084cb75eb6742ba23b02781c9311acbf6d27f56e08d1323565fe2`
Last Modified: Thu, 23 Apr 2020 23:53:50 GMT
Size: 1.3 KB (1261 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:628ed6ecb36cf955a18714674b47d5822ae7eb0372cd31f3c2edd4a3c38fce32`
Last Modified: Thu, 23 Apr 2020 23:53:48 GMT
Size: 269.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:50eb2d49d536eb9aee63923be5e989c50cc8a9591536aae2b8fb0b561d1571c7`
Last Modified: Thu, 03 Sep 2020 20:18:04 GMT
Size: 10.3 MB (10317607 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:8cd5c35d1da6cdaa32da92e4fd06bb8ab90c7b5021744f034d24b99956ee7bf4`
Last Modified: Thu, 03 Sep 2020 20:18:04 GMT
Size: 496.0 B
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:f76c0f82d86bbfeb8153933b11a01584467b78ad105fe463eaeb52c063ff732f`
Last Modified: Thu, 03 Sep 2020 20:18:06 GMT
Size: 10.4 MB (10437123 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:49a11c4f0cc448ebe0327fbfeeb0dad310ccc18f5af5b585e5f682963e4d3879`
Last Modified: Thu, 03 Sep 2020 20:18:03 GMT
Size: 2.3 KB (2275 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
- `sha256:b4099f7f65526416e98374dee5ae9dec0a8b22d6a113203f054a158c5d98c198`
Last Modified: Thu, 03 Sep 2020 20:18:03 GMT
Size: 17.1 KB (17096 bytes)
MIME: application/vnd.docker.image.rootfs.diff.tar.gzip
| {
"pile_set_name": "Github"
} |
// +build linux
package namespaces
import (
"io"
"os"
"os/exec"
"syscall"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer/cgroups"
"github.com/docker/libcontainer/cgroups/fs"
"github.com/docker/libcontainer/cgroups/systemd"
"github.com/docker/libcontainer/network"
"github.com/docker/libcontainer/syncpipe"
"github.com/docker/libcontainer/system"
)
// TODO(vishh): This is part of the libcontainer API and it does much more than just namespaces related work.
// Move this to libcontainer package.
// Exec performs setup outside of a namespace so that a container can be
// executed. Exec is a high level function for working with container namespaces.
func Exec(container *libcontainer.Config, stdin io.Reader, stdout, stderr io.Writer, console string, rootfs, dataPath string, args []string, createCommand CreateCommand, startCallback func()) (int, error) {
var (
err error
)
// create a pipe so that we can syncronize with the namespaced process and
// pass the veth name to the child
syncPipe, err := syncpipe.NewSyncPipe()
if err != nil {
return -1, err
}
defer syncPipe.Close()
command := createCommand(container, console, rootfs, dataPath, os.Args[0], syncPipe.Child(), args)
// Note: these are only used in non-tty mode
// if there is a tty for the container it will be opened within the namespace and the
// fds will be duped to stdin, stdiout, and stderr
command.Stdin = stdin
command.Stdout = stdout
command.Stderr = stderr
if err := command.Start(); err != nil {
return -1, err
}
// Now we passed the pipe to the child, close our side
syncPipe.CloseChild()
started, err := system.GetProcessStartTime(command.Process.Pid)
if err != nil {
return -1, err
}
// Do this before syncing with child so that no children
// can escape the cgroup
cleaner, err := SetupCgroups(container, command.Process.Pid)
if err != nil {
command.Process.Kill()
command.Wait()
return -1, err
}
if cleaner != nil {
defer cleaner.Cleanup()
}
var networkState network.NetworkState
if err := InitializeNetworking(container, command.Process.Pid, syncPipe, &networkState); err != nil {
command.Process.Kill()
command.Wait()
return -1, err
}
state := &libcontainer.State{
InitPid: command.Process.Pid,
InitStartTime: started,
NetworkState: networkState,
}
if err := libcontainer.SaveState(dataPath, state); err != nil {
command.Process.Kill()
command.Wait()
return -1, err
}
defer libcontainer.DeleteState(dataPath)
// Sync with child
if err := syncPipe.ReadFromChild(); err != nil {
command.Process.Kill()
command.Wait()
return -1, err
}
if startCallback != nil {
startCallback()
}
if err := command.Wait(); err != nil {
if _, ok := err.(*exec.ExitError); !ok {
return -1, err
}
}
return command.ProcessState.Sys().(syscall.WaitStatus).ExitStatus(), nil
}
// DefaultCreateCommand will return an exec.Cmd with the Cloneflags set to the proper namespaces
// defined on the container's configuration and use the current binary as the init with the
// args provided
//
// console: the /dev/console to setup inside the container
// init: the program executed inside the namespaces
// root: the path to the container json file and information
// pipe: sync pipe to synchronize the parent and child processes
// args: the arguments to pass to the container to run as the user's program
func DefaultCreateCommand(container *libcontainer.Config, console, rootfs, dataPath, init string, pipe *os.File, args []string) *exec.Cmd {
// get our binary name from arg0 so we can always reexec ourself
env := []string{
"console=" + console,
"pipe=3",
"data_path=" + dataPath,
}
/*
TODO: move user and wd into env
if user != "" {
env = append(env, "user="+user)
}
if workingDir != "" {
env = append(env, "wd="+workingDir)
}
*/
command := exec.Command(init, append([]string{"init", "--"}, args...)...)
// make sure the process is executed inside the context of the rootfs
command.Dir = rootfs
command.Env = append(os.Environ(), env...)
if command.SysProcAttr == nil {
command.SysProcAttr = &syscall.SysProcAttr{}
}
command.SysProcAttr.Cloneflags = uintptr(GetNamespaceFlags(container.Namespaces))
command.SysProcAttr.Pdeathsig = syscall.SIGKILL
command.ExtraFiles = []*os.File{pipe}
return command
}
// SetupCgroups applies the cgroup restrictions to the process running in the container based
// on the container's configuration
func SetupCgroups(container *libcontainer.Config, nspid int) (cgroups.ActiveCgroup, error) {
if container.Cgroups != nil {
c := container.Cgroups
if systemd.UseSystemd() {
return systemd.Apply(c, nspid)
}
return fs.Apply(c, nspid)
}
return nil, nil
}
// InitializeNetworking creates the container's network stack outside of the namespace and moves
// interfaces into the container's net namespaces if necessary
func InitializeNetworking(container *libcontainer.Config, nspid int, pipe *syncpipe.SyncPipe, networkState *network.NetworkState) error {
for _, config := range container.Networks {
strategy, err := network.GetStrategy(config.Type)
if err != nil {
return err
}
if err := strategy.Create((*network.Network)(config), nspid, networkState); err != nil {
return err
}
}
return pipe.SendToChild(networkState)
}
// GetNamespaceFlags parses the container's Namespaces options to set the correct
// flags on clone, unshare, and setns
func GetNamespaceFlags(namespaces map[string]bool) (flag int) {
for key, enabled := range namespaces {
if enabled {
if ns := GetNamespace(key); ns != nil {
flag |= ns.Value
}
}
}
return flag
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_OSS|x64">
<Configuration>Release_OSS</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F563E3DE-39BA-4A9D-A6C2-9E9222E8F518}</ProjectGuid>
<RootNamespace>mysqlparser</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_OSS|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\vsprops\wb_boost.props" />
<Import Project="..\..\vsprops\wb_glib.props" />
<Import Project="..\..\vsprops\wb_antlr4.props" />
<Import Project="..\..\vsprops\wb_cpp_std.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\vsprops\wb_boost.props" />
<Import Project="..\..\vsprops\wb_glib.props" />
<Import Project="..\..\vsprops\wb_antlr4.props" />
<Import Project="..\..\vsprops\wb_cpp_std.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_OSS|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\vsprops\wb_boost.props" />
<Import Project="..\..\vsprops\wb_glib.props" />
<Import Project="..\..\vsprops\wb_antlr4.props" />
<Import Project="..\..\vsprops\wb_cpp_std.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetExt>.dll</TargetExt>
<OutDir>$(SolutionDir)bin\$(PlatformTarget)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>
</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetExt>.dll</TargetExt>
<OutDir>$(SolutionDir)bin\$(PlatformTarget)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_OSS|x64'">
<TargetExt>.dll</TargetExt>
<OutDir>$(SolutionDir)bin\$(PlatformTarget)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<PreprocessorDefinitions>PARSERS_EXPORTS;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\base;$(WB_3DPARTY_PATH)\include;$(WB_3DPARTY_PATH)\include\antlr4-runtime;$(WB_3DPARTY_PATH)\include\glib-2.0;$(WB_3DPARTY_PATH)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BrowseInformation>false</BrowseInformation>
<AdditionalOptions>/w34296 %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>glib-2.0.lib;antlr4-runtime.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(WB_3DPARTY_PATH)\Debug\lib</AdditionalLibraryDirectories>
</Link>
<Bscmake>
<PreserveSbr>true</PreserveSbr>
</Bscmake>
<CustomBuildStep>
<Command>
</Command>
<Message>
</Message>
<Outputs>
</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>PARSERS_EXPORTS;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\base;$(WB_3DPARTY_PATH)\include;$(WB_3DPARTY_PATH)\include\antlr4-runtime;$(WB_3DPARTY_PATH)\include\glib-2.0;$(WB_3DPARTY_PATH)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/w34296 %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>glib-2.0.lib;antlr4-runtime.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(WB_3DPARTY_PATH)\lib</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>cd grammars
call build-parsers.cmd mysql
cd ..</Command>
<Message>Generate MySQL parser</Message>
<Outputs>$(ProjectDir)mysql\MySQLParserListener.cpp;$(ProjectDir)mysql\MySQLParser.cpp;$(ProjectDir)mysql\MySQLParserListener.h;$(ProjectDir)mysql\MySQLBaseLexer.cpp;$(ProjectDir)mysql\MySQLParser.h;$(ProjectDir)mysql\MySQLParserVisitor.cpp;$(ProjectDir)mysql\MySQLBaseLexer.h;$(ProjectDir)mysql\MySQLParserVisitor.h;$(ProjectDir)mysql\MySQLBaseRecognizer.cpp;$(ProjectDir)mysql\MySQLParserBaseListener.cpp;$(ProjectDir)mysql\MySQLBaseRecognizer.h;$(ProjectDir)mysql\MySQLParserBaseListener.h;$(ProjectDir)mysql\MySQLLexer.cpp;$(ProjectDir)mysql\MySQLParserBaseVisitor.cpp;$(ProjectDir)mysql\MySQLLexer.h;$(ProjectDir)mysql\MySQLParserBaseVisitor.h;%(Outputs)</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_OSS|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>PARSERS_EXPORTS;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\base;$(WB_3DPARTY_PATH)\include;$(WB_3DPARTY_PATH)\include\antlr4-runtime;$(WB_3DPARTY_PATH)\include\glib-2.0;$(WB_3DPARTY_PATH)\lib\glib-2.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/w34296 %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>glib-2.0.lib;antlr4-runtime.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(WB_3DPARTY_PATH)\lib</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>cd grammars
call build-parsers.cmd mysql
cd ..</Command>
<Message>Generate MySQL parser</Message>
<Outputs>$(ProjectDir)mysql\MySQLParserListener.cpp;$(ProjectDir)mysql\MySQLParser.cpp;$(ProjectDir)mysql\MySQLParserListener.h;$(ProjectDir)mysql\MySQLBaseLexer.cpp;$(ProjectDir)mysql\MySQLParser.h;$(ProjectDir)mysql\MySQLParserVisitor.cpp;$(ProjectDir)mysql\MySQLBaseLexer.h;$(ProjectDir)mysql\MySQLParserVisitor.h;$(ProjectDir)mysql\MySQLBaseRecognizer.cpp;$(ProjectDir)mysql\MySQLParserBaseListener.cpp;$(ProjectDir)mysql\MySQLBaseRecognizer.h;$(ProjectDir)mysql\MySQLParserBaseListener.h;$(ProjectDir)mysql\MySQLLexer.cpp;$(ProjectDir)mysql\MySQLParserBaseVisitor.cpp;$(ProjectDir)mysql\MySQLLexer.h;$(ProjectDir)mysql\MySQLParserBaseVisitor.h;%(Outputs)</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="code-completion\CodeCompletionCore.h" />
<ClInclude Include="code-completion\mysql-code-completion.h" />
<ClInclude Include="mysql\mysql-recognition-types.h" />
<ClInclude Include="mysql\MySQLBaseLexer.h" />
<ClInclude Include="mysql\MySQLBaseRecognizer.h" />
<ClInclude Include="mysql\MySQLLexer.h" />
<ClInclude Include="mysql\MySQLParser.h" />
<ClInclude Include="mysql\MySQLParserBaseListener.h" />
<ClInclude Include="mysql\MySQLParserBaseVisitor.h" />
<ClInclude Include="mysql\MySQLParserListener.h" />
<ClInclude Include="mysql\MySQLParserVisitor.h" />
<ClInclude Include="mysql\MySQLRecognizerCommon.h" />
<ClInclude Include="parsers-common.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="SymbolTable.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="code-completion\CodeCompletionCore.cpp" />
<ClCompile Include="code-completion\mysql-code-completion.cpp" />
<ClCompile Include="mysql\MySQLBaseLexer.cpp" />
<ClCompile Include="mysql\MySQLBaseRecognizer.cpp" />
<ClCompile Include="mysql\MySQLLexer.cpp" />
<ClCompile Include="mysql\MySQLParser.cpp">
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release_OSS|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<ClCompile Include="mysql\MySQLParserBaseListener.cpp" />
<ClCompile Include="mysql\MySQLParserBaseVisitor.cpp" />
<ClCompile Include="mysql\MySQLParserListener.cpp" />
<ClCompile Include="mysql\MySQLParserVisitor.cpp" />
<ClCompile Include="mysql\MySQLRecognizerCommon.cpp" />
<ClCompile Include="parsers-common.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_OSS|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="SymbolTable.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\base\base.vcxproj">
<Project>{c3b85913-b106-40c6-8dde-a7cf52a4ec80}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="grammars\MySQLParser.g4">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cd grammars
call build-parsers.cmd mysql
cd ..</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating parser</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)mysql\MySQLParser.h;$(ProjectDir)mysql\MySQLLexer.h</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="grammars\MySQLLexer.g4">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cd grammars
call build-parsers.cmd mysql
cd ..</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating parser</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)mysql\MySQLParser.h;$(ProjectDir)mysql\MySQLLexer.h</Outputs>
</None>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project> | {
"pile_set_name": "Github"
} |
using System;
using System.Linq;
namespace ArduinoUploader.BootloaderProgrammers.Protocols.STK500v2.Messages
{
internal class ExecuteSpiCommandRequest : Request
{
internal ExecuteSpiCommandRequest(byte numTx, byte numRx, byte rxStartAddr, byte[] txData)
{
var data = new byte[numTx];
Buffer.BlockCopy(txData, 0, data, 0, numTx);
var header = new[]
{
Constants.CmdSpiMulti,
numTx,
numRx,
rxStartAddr
};
Bytes = header.Concat(data).ToArray();
}
}
}
| {
"pile_set_name": "Github"
} |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Jekyll v3.8.6">
<meta name="docsearch:language" content="en">
<meta name="docsearch:version" content="4.4">
<title>Navbar · Bootstrap</title>
<link rel="canonical" href="../../components/navbar/">
<!-- Bootstrap core CSS -->
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet" >
<!-- Documentation extras -->
<link href="../../assets/css/docs.min.css" rel="stylesheet"><!-- Favicons -->
<link rel="apple-touch-icon" href="../../assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="../../assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="../../assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="../../assets/img/favicons/manifest.json">
<link rel="mask-icon" href="../../assets/img/favicons/safari-pinned-tab.svg" color="#563d7c">
<link rel="icon" href="../../assets/img/favicons/favicon.ico">
<meta name="msapplication-config" content="../../assets/img/favicons/browserconfig.xml">
<meta name="theme-color" content="#563d7c">
<!-- Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@getbootstrap">
<meta name="twitter:creator" content="@getbootstrap">
<meta name="twitter:title" content="Navbar">
<meta name="twitter:description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta name="twitter:image" content="../../assets/brand/bootstrap-social-logo.png">
<!-- Facebook -->
<meta property="og:url" content="../../components/navbar/">
<meta property="og:title" content="Navbar">
<meta property="og:description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta property="og:type" content="website">
<meta property="og:image" content="http://getbootstrap.com../../assets/brand/bootstrap-social.png">
<meta property="og:image:secure_url" content="../../assets/brand/bootstrap-social.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
</head>
<body>
<a class="skippy sr-only sr-only-focusable" href="#content">
<span class="skippy-text">Skip to main content</span>
</a>
<header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
<a class="navbar-brand mr-0 mr-md-2" href="../../index.html" aria-label="Bootstrap"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" class="d-block" viewBox="0 0 612 612" role="img" focusable="false"><title>Bootstrap</title><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"/><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"/></svg></a>
<div class="navbar-nav-scroll">
<ul class="navbar-nav bd-navbar-nav flex-row">
<li class="nav-item">
<a class="nav-link " href="../../index.html" >Home</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="../../getting-started/introduction/index.html" >Documentation</a>
</li>
<li class="nav-item">
<a class="nav-link " href="../../examples/index.html" >Examples</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://icons.getbootstrap.com/">Icons</a>
</li>
</ul>
</div>
<ul class="navbar-nav ml-md-auto">
<li class="nav-item">
<a class="nav-link btn-outline-warning text-warning namelink" id="namelink">
<strong onclick="window.open('https://www.buymeacoffee.com/libracoder');
"> Your support is my biggest encouragement! - Libracoder</strong> </a>
<style type="text/css">
.namelink,#namelink {
color: #ffc107 !important;
cursor: pointer;
}
</style>
</li><li class="nav-item dropdown">
<a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
v4.4
</a>
<div class="dropdown-menu dropdown-menu-md-right" aria-labelledby="bd-versions">
<a class="dropdown-item active" href="../../">Latest (4.4.x)</a>
<a class="dropdown-item" href="/docs/4.3/">v4.3.1</a>
<a class="dropdown-item" href="/docs/4.2/">v4.2.1</a>
<a class="dropdown-item" href="/docs/4.0/">v4.0.0</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://v4-alpha.getbootstrap.com/">v4 Alpha 6</a>
<a class="dropdown-item" href="/docs/3.4/">v3.4.1</a>
<a class="dropdown-item" href="/docs/3.3/">v3.3.7</a>
<a class="dropdown-item" href="/2.3.2/">v2.3.2</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/docs/versions/">All versions</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="https://github.com/twbs/bootstrap" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="https://twitter.com/getbootstrap" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 416.32" role="img" focusable="false"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg></a>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="https://bootstrap-slack.herokuapp.com/" target="_blank" rel="noopener" aria-label="Slack"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 512" role="img" focusable="false"><title>Slack</title><path fill="currentColor" d="M210.787 234.832l68.31-22.883 22.1 65.977-68.309 22.882z"/><path fill="currentColor" d="M490.54 185.6C437.7 9.59 361.6-31.34 185.6 21.46S-31.3 150.4 21.46 326.4 150.4 543.3 326.4 490.54 543.34 361.6 490.54 185.6zM401.7 299.8l-33.15 11.05 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.38-68.36 22.92 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.43-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.5-13.92 2.87-29.06 16.78-33.56l33.12-11.03-22.1-65.9-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.48-13.93 2.89-29.07 16.81-33.58l33.15-11.05-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.46 34.38 68.36-22.92-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.47 34.42 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.87 29.06-16.78 33.56L329.7 194.6l22.1 65.9 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.88 29.07-16.81 33.57z"/></svg></a>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="https://opencollective.com/bootstrap/" target="_blank" rel="noopener" aria-label="Open Collective"><svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" fill-rule="evenodd" class="navbar-nav-svg" viewBox="0 0 40 41" role="img" focusable="false"><title>Open Collective</title><path fill-opacity=".4" d="M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z"/><path d="M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z"/></svg></a>
</li>
</ul>
<a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3" href="../../getting-started/download/index.html">Download</a>
</header>
<div class="container-fluid">
<div class="row flex-xl-nowrap">
<div class="col-md-3 col-xl-2 bd-sidebar">
<form role="search" class="bd-search d-flex align-items-center">
<input type="search" class="form-control" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off" data-docs-version="4.4">
<button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3" type="button" data-toggle="collapse" data-target="#bd-docs-nav" aria-controls="bd-docs-nav" aria-expanded="false" aria-label="Toggle docs navigation"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"/></svg></button>
</form>
<nav class="collapse bd-links" id="bd-docs-nav" aria-label="Main navigation"><div class="bd-toc-item">
<a class="bd-toc-link" href="../../getting-started/introduction/index.html">
Getting started
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../getting-started/introduction/index.html">
Introduction
</a>
</li><li>
<a href="../../getting-started/download/index.html">
Download
</a>
</li><li>
<a href="../../getting-started/contents/index.html">
Contents
</a>
</li><li>
<a href="../../getting-started/browsers-devices/index.html">
Browsers & devices
</a>
</li><li>
<a href="../../getting-started/javascript/index.html">
JavaScript
</a>
</li><li>
<a href="../../getting-started/theming/index.html">
Theming
</a>
</li><li>
<a href="../../getting-started/build-tools/index.html">
Build tools
</a>
</li><li>
<a href="../../getting-started/webpack/index.html">
Webpack
</a>
</li><li>
<a href="../../getting-started/accessibility/index.html">
Accessibility
</a>
</li></ul>
</div><div class="bd-toc-item">
<a class="bd-toc-link" href="../../layout/overview/index.html">
Layout
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../layout/overview/index.html">
Overview
</a>
</li><li>
<a href="../../layout/grid/index.html">
Grid
</a>
</li><li>
<a href="../../layout/utilities-for-layout/index.html">
Utilities for layout
</a>
</li></ul>
</div><div class="bd-toc-item">
<a class="bd-toc-link" href="../../content/reboot/index.html">
Content
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../content/reboot/index.html">
Reboot
</a>
</li><li>
<a href="../../content/typography/index.html">
Typography
</a>
</li><li>
<a href="../../content/code/index.html">
Code
</a>
</li><li>
<a href="../../content/images/index.html">
Images
</a>
</li><li>
<a href="../../content/tables/index.html">
Tables
</a>
</li><li>
<a href="../../content/figures/index.html">
Figures
</a>
</li></ul>
</div><div class="bd-toc-item active">
<a class="bd-toc-link" href="../../components/alerts/index.html">
Components
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../components/alerts/index.html">
Alerts
</a>
</li><li>
<a href="../../components/badge/index.html">
Badge
</a>
</li><li>
<a href="../../components/breadcrumb/index.html">
Breadcrumb
</a>
</li><li>
<a href="../../components/buttons/index.html">
Buttons
</a>
</li><li>
<a href="../../components/button-group/index.html">
Button group
</a>
</li><li>
<a href="../../components/card/index.html">
Card
</a>
</li><li>
<a href="../../components/carousel/index.html">
Carousel
</a>
</li><li>
<a href="../../components/collapse/index.html">
Collapse
</a>
</li><li>
<a href="../../components/dropdowns/index.html">
Dropdowns
</a>
</li><li>
<a href="../../components/forms/index.html">
Forms
</a>
</li><li>
<a href="../../components/input-group/index.html">
Input group
</a>
</li><li>
<a href="../../components/jumbotron/index.html">
Jumbotron
</a>
</li><li>
<a href="../../components/list-group/index.html">
List group
</a>
</li><li>
<a href="../../components/media-object/index.html">
Media object
</a>
</li><li>
<a href="../../components/modal/index.html">
Modal
</a>
</li><li>
<a href="../../components/navs/index.html">
Navs
</a>
</li><li class="active bd-sidenav-active">
<a href="../../components/navbar/index.html">
Navbar
</a>
</li><li>
<a href="../../components/pagination/index.html">
Pagination
</a>
</li><li>
<a href="../../components/popovers/index.html">
Popovers
</a>
</li><li>
<a href="../../components/progress/index.html">
Progress
</a>
</li><li>
<a href="../../components/scrollspy/index.html">
Scrollspy
</a>
</li><li>
<a href="../../components/spinners/index.html">
Spinners
</a>
</li><li>
<a href="../../components/toasts/index.html">
Toasts
</a>
</li><li>
<a href="../../components/tooltips/index.html">
Tooltips
</a>
</li></ul>
</div><div class="bd-toc-item">
<a class="bd-toc-link" href="../../utilities/borders/index.html">
Utilities
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../utilities/borders/index.html">
Borders
</a>
</li><li>
<a href="../../utilities/clearfix/index.html">
Clearfix
</a>
</li><li>
<a href="../../utilities/close-icon/index.html">
Close icon
</a>
</li><li>
<a href="../../utilities/colors/index.html">
Colors
</a>
</li><li>
<a href="../../utilities/display/index.html">
Display
</a>
</li><li>
<a href="../../utilities/embed/index.html">
Embed
</a>
</li><li>
<a href="../../utilities/flex/index.html">
Flex
</a>
</li><li>
<a href="../../utilities/float/index.html">
Float
</a>
</li><li>
<a href="../../utilities/image-replacement/index.html">
Image replacement
</a>
</li><li>
<a href="../../utilities/overflow/index.html">
Overflow
</a>
</li><li>
<a href="../../utilities/position/index.html">
Position
</a>
</li><li>
<a href="../../utilities/screen-readers/index.html">
Screen readers
</a>
</li><li>
<a href="../../utilities/shadows/index.html">
Shadows
</a>
</li><li>
<a href="../../utilities/sizing/index.html">
Sizing
</a>
</li><li>
<a href="../../utilities/spacing/index.html">
Spacing
</a>
</li><li>
<a href="../../utilities/stretched-link/index.html">
Stretched link
</a>
</li><li>
<a href="../../utilities/text/index.html">
Text
</a>
</li><li>
<a href="../../utilities/vertical-align/index.html">
Vertical align
</a>
</li><li>
<a href="../../utilities/visibility/index.html">
Visibility
</a>
</li></ul>
</div><div class="bd-toc-item">
<a class="bd-toc-link" href="../../extend/approach/index.html">
Extend
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../extend/approach/index.html">
Approach
</a>
</li><li>
<a href="../../extend/icons/index.html">
Icons
</a>
</li></ul>
</div><div class="bd-toc-item">
<a class="bd-toc-link" href="../../migration/index.html">
Migration
</a>
<ul class="nav bd-sidenav"></ul>
</div><div class="bd-toc-item">
<a class="bd-toc-link" href="../../about/overview/index.html">
About
</a>
<ul class="nav bd-sidenav"><li>
<a href="../../about/overview/index.html">
Overview
</a>
</li><li>
<a href="../../about/team/index.html">
Team
</a>
</li><li>
<a href="../../about/brand/index.html">
Brand
</a>
</li><li>
<a href="../../about/license/index.html">
License
</a>
</li><li>
<a href="../../about/translations/index.html">
Translations
</a>
</li></ul>
</div></nav>
</div>
<nav class="d-none d-xl-block col-xl-2 bd-toc" aria-label="Secondary navigation">
<ul class="section-nav">
<li class="toc-entry toc-h2"><a href="#how-it-works">How it works</a></li>
<li class="toc-entry toc-h2"><a href="#supported-content">Supported content</a>
<ul>
<li class="toc-entry toc-h3"><a href="#brand">Brand</a></li>
<li class="toc-entry toc-h3"><a href="#nav">Nav</a></li>
<li class="toc-entry toc-h3"><a href="#forms">Forms</a></li>
<li class="toc-entry toc-h3"><a href="#text">Text</a></li>
</ul>
</li>
<li class="toc-entry toc-h2"><a href="#color-schemes">Color schemes</a></li>
<li class="toc-entry toc-h2"><a href="#containers">Containers</a></li>
<li class="toc-entry toc-h2"><a href="#placement">Placement</a></li>
<li class="toc-entry toc-h2"><a href="#responsive-behaviors">Responsive behaviors</a>
<ul>
<li class="toc-entry toc-h3"><a href="#toggler">Toggler</a></li>
<li class="toc-entry toc-h3"><a href="#external-content">External content</a></li>
</ul>
</li>
</ul>
</nav>
<main class="col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main"> <p class="text-center"> If you <span><img src="../../assets/img/heart-icon.png" style="height: 2rem" alt=""></span> this project, you can buy us a
<a href="https://www.buymeacoffee.com/libracoder" target="_blank"><span><img src="../../assets/img/orange+buy+me+a+coffee.jpg" style="height: 2rem" alt=""></span></a> to support us.</p>
<h1 class="bd-title" id="content">Navbar</h1>
<p class="bd-lead">Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.</p>
<script async src="https://cdn.carbonads.com/carbon.js?serve=CKYIKKJL&placement=getbootstrapcom" id="_carbonads_js"></script>
<h2 id="how-it-works">How it works</h2>
<p>Here’s what you need to know before getting started with the navbar:</p>
<ul>
<li>Navbars require a wrapping <code class="highlighter-rouge">.navbar</code> with <code class="highlighter-rouge">.navbar-expand{-sm|-md|-lg|-xl}</code> for responsive collapsing and <a href="#color-schemes">color scheme</a> classes.</li>
<li>Navbars and their contents are fluid by default. Use <a href="#containers">optional containers</a> to limit their horizontal width.</li>
<li>Use our <a href="../../utilities/spacing/">spacing</a> and <a href="../../utilities/flex/index.html">flex</a> utility classes for controlling spacing and alignment within navbars.</li>
<li>Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.</li>
<li>Navbars are hidden by default when printing. Force them to be printed by adding <code class="highlighter-rouge">.d-print</code> to the <code class="highlighter-rouge">.navbar</code>. See the <a href="../../utilities/display/index.html">display</a> utility class.</li>
<li>Ensure accessibility by using a <code class="highlighter-rouge"><nav></code> element or, if using a more generic element such as a <code class="highlighter-rouge"><div></code>, add a <code class="highlighter-rouge">role="navigation"</code> to every navbar to explicitly identify it as a landmark region for users of assistive technologies.</li>
</ul>
<div class="bd-callout bd-callout-info">
<p>The animation effect of this component is dependent on the <code class="highlighter-rouge">prefers-reduced-motion</code> media query. See the <a href="../../getting-started/accessibility/#reduced-motion">reduced motion section of our accessibility documentation</a>.</p>
</div>
<p>Read on for an example and list of supported sub-components.</p>
<h2 id="supported-content">Supported content</h2>
<p>Navbars come with built-in support for a handful of sub-components. Choose from the following as needed:</p>
<ul>
<li><code class="highlighter-rouge">.navbar-brand</code> for your company, product, or project name.</li>
<li><code class="highlighter-rouge">.navbar-nav</code> for a full-height and lightweight navigation (including support for dropdowns).</li>
<li><code class="highlighter-rouge">.navbar-toggler</code> for use with our collapse plugin and other <a href="#responsive-behaviors">navigation toggling</a> behaviors.</li>
<li><code class="highlighter-rouge">.form-inline</code> for any form controls and actions.</li>
<li><code class="highlighter-rouge">.navbar-text</code> for adding vertically centered strings of text.</li>
<li><code class="highlighter-rouge">.collapse.navbar-collapse</code> for grouping and hiding navbar contents by a parent breakpoint.</li>
</ul>
<p>Here’s an example of all the sub-components included in a responsive light-themed navbar that automatically collapses at the <code class="highlighter-rouge">lg</code> (large) breakpoint.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarSupportedContent"</span> <span class="na">aria-controls=</span><span class="s">"navbarSupportedContent"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarSupportedContent"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav mr-auto"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Link<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item dropdown"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link dropdown-toggle"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">id=</span><span class="s">"navbarDropdown"</span> <span class="na">role=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"dropdown"</span> <span class="na">aria-haspopup=</span><span class="s">"true"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span><span class="nt">></span>
Dropdown
<span class="nt"></a></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"dropdown-menu"</span> <span class="na">aria-labelledby=</span><span class="s">"navbarDropdown"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"dropdown-item"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Action<span class="nt"></a></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"dropdown-item"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Another action<span class="nt"></a></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"dropdown-divider"</span><span class="nt">></div></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"dropdown-item"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Something else here<span class="nt"></a></span>
<span class="nt"></div></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link disabled"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">tabindex=</span><span class="s">"-1"</span> <span class="na">aria-disabled=</span><span class="s">"true"</span><span class="nt">></span>Disabled<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline my-2 my-lg-0"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">class=</span><span class="s">"form-control mr-sm-2"</span> <span class="na">type=</span><span class="s">"search"</span> <span class="na">placeholder=</span><span class="s">"Search"</span> <span class="na">aria-label=</span><span class="s">"Search"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success my-2 my-sm-0"</span> <span class="na">type=</span><span class="s">"submit"</span><span class="nt">></span>Search<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<p>This example uses <a href="../../utilities/colors/">color</a> (<code class="highlighter-rouge">bg-light</code>) and <a href="../../utilities/spacing/index.html">spacing</a> (<code class="highlighter-rouge">my-2</code>, <code class="highlighter-rouge">my-lg-0</code>, <code class="highlighter-rouge">mr-sm-0</code>, <code class="highlighter-rouge">my-sm-0</code>) utility classes.</p>
<h3 id="brand">Brand</h3>
<p>The <code class="highlighter-rouge">.navbar-brand</code> can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles.</p>
<div class="bd-example">
<!-- As a link -->
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
</nav>
<!-- As a heading -->
<nav class="navbar navbar-light bg-light">
<span class="navbar-brand mb-0 h1">Navbar</span>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="c"><!-- As a link --></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"></nav></span>
<span class="c"><!-- As a heading --></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-brand mb-0 h1"</span><span class="nt">></span>Navbar<span class="nt"></span></span>
<span class="nt"></nav></span></code></pre></figure>
<p>Adding images to the <code class="highlighter-rouge">.navbar-brand</code> will likely always require custom styles or utilities to properly size. Here are some examples to demonstrate.</p>
<div class="bd-example">
<!-- Just an image -->
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">
<img src="../../assets/brand/bootstrap-solid.svg" width="30" height="30" alt="" />
</a>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="c"><!-- Just an image --></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"../../assets/brand/bootstrap-solid.svg"</span> <span class="na">width=</span><span class="s">"30"</span> <span class="na">height=</span><span class="s">"30"</span> <span class="na">alt=</span><span class="s">""</span><span class="nt">></span>
<span class="nt"></a></span>
<span class="nt"></nav></span></code></pre></figure>
<div class="bd-example">
<!-- Image and text -->
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">
<img src="../../assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="" />
Bootstrap
</a>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="c"><!-- Image and text --></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"../../assets/brand/bootstrap-solid.svg"</span> <span class="na">width=</span><span class="s">"30"</span> <span class="na">height=</span><span class="s">"30"</span> <span class="na">class=</span><span class="s">"d-inline-block align-top"</span> <span class="na">alt=</span><span class="s">""</span><span class="nt">></span>
Bootstrap
<span class="nt"></a></span>
<span class="nt"></nav></span></code></pre></figure>
<h3 id="nav">Nav</h3>
<p>Navbar navigation links build on our <code class="highlighter-rouge">.nav</code> options with their own modifier class and require the use of <a href="#toggler">toggler classes</a> for proper responsive styling. <strong>Navigation in navbars will also grow to occupy as much horizontal space as possible</strong> to keep your navbar contents securely aligned.</p>
<p>Active states—with <code class="highlighter-rouge">.active</code>—to indicate the current page can be applied directly to <code class="highlighter-rouge">.nav-link</code>s or their immediate parent <code class="highlighter-rouge">.nav-item</code>s.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarNav"</span> <span class="na">aria-controls=</span><span class="s">"navbarNav"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarNav"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Features<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Pricing<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link disabled"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">tabindex=</span><span class="s">"-1"</span> <span class="na">aria-disabled=</span><span class="s">"true"</span><span class="nt">></span>Disabled<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<p>And because we use classes for our navs, you can avoid the list-based approach entirely if you like.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="#">Features</a>
<a class="nav-item nav-link" href="#">Pricing</a>
<a class="nav-item nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</div>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarNavAltMarkup"</span> <span class="na">aria-controls=</span><span class="s">"navbarNavAltMarkup"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarNavAltMarkup"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"navbar-nav"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-item nav-link active"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-item nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Features<span class="nt"></a></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-item nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Pricing<span class="nt"></a></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-item nav-link disabled"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">tabindex=</span><span class="s">"-1"</span> <span class="na">aria-disabled=</span><span class="s">"true"</span><span class="nt">></span>Disabled<span class="nt"></a></span>
<span class="nt"></div></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<p>You may also utilize dropdowns in your navbar nav. Dropdown menus require a wrapping element for positioning, so be sure to use separate and nested elements for <code class="highlighter-rouge">.nav-item</code> and <code class="highlighter-rouge">.nav-link</code> as shown below.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarNavDropdown"</span> <span class="na">aria-controls=</span><span class="s">"navbarNavDropdown"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarNavDropdown"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Features<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Pricing<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item dropdown"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link dropdown-toggle"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">id=</span><span class="s">"navbarDropdownMenuLink"</span> <span class="na">role=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"dropdown"</span> <span class="na">aria-haspopup=</span><span class="s">"true"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span><span class="nt">></span>
Dropdown link
<span class="nt"></a></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"dropdown-menu"</span> <span class="na">aria-labelledby=</span><span class="s">"navbarDropdownMenuLink"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"dropdown-item"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Action<span class="nt"></a></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"dropdown-item"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Another action<span class="nt"></a></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"dropdown-item"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Something else here<span class="nt"></a></span>
<span class="nt"></div></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<h3 id="forms">Forms</h3>
<p>Place various form controls and components within a navbar with <code class="highlighter-rouge">.form-inline</code>.</p>
<div class="bd-example">
<nav class="navbar navbar-light bg-light">
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">class=</span><span class="s">"form-control mr-sm-2"</span> <span class="na">type=</span><span class="s">"search"</span> <span class="na">placeholder=</span><span class="s">"Search"</span> <span class="na">aria-label=</span><span class="s">"Search"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success my-2 my-sm-0"</span> <span class="na">type=</span><span class="s">"submit"</span><span class="nt">></span>Search<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></nav></span></code></pre></figure>
<p>Immediate children elements in <code class="highlighter-rouge">.navbar</code> use flex layout and will default to <code class="highlighter-rouge">justify-content: space-between</code>. Use additional <a href="../../utilities/flex/index.html">flex utilities</a> as needed to adjust this behavior.</p>
<div class="bd-example">
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand">Navbar</a>
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">class=</span><span class="s">"form-control mr-sm-2"</span> <span class="na">type=</span><span class="s">"search"</span> <span class="na">placeholder=</span><span class="s">"Search"</span> <span class="na">aria-label=</span><span class="s">"Search"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success my-2 my-sm-0"</span> <span class="na">type=</span><span class="s">"submit"</span><span class="nt">></span>Search<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></nav></span></code></pre></figure>
<p>Input groups work, too:</p>
<div class="bd-example">
<nav class="navbar navbar-light bg-light">
<form class="form-inline">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">@</span>
</div>
<input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1" />
</div>
</form>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"input-group"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"input-group-prepend"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"input-group-text"</span> <span class="na">id=</span><span class="s">"basic-addon1"</span><span class="nt">></span>@<span class="nt"></span></span>
<span class="nt"></div></span>
<span class="nt"><input</span> <span class="na">type=</span><span class="s">"text"</span> <span class="na">class=</span><span class="s">"form-control"</span> <span class="na">placeholder=</span><span class="s">"Username"</span> <span class="na">aria-label=</span><span class="s">"Username"</span> <span class="na">aria-describedby=</span><span class="s">"basic-addon1"</span><span class="nt">></span>
<span class="nt"></div></span>
<span class="nt"></form></span>
<span class="nt"></nav></span></code></pre></figure>
<p>Various buttons are supported as part of these navbar forms, too. This is also a great reminder that vertical alignment utilities can be used to align different sized elements.</p>
<div class="bd-example">
<nav class="navbar navbar-light bg-light">
<form class="form-inline">
<button class="btn btn-outline-success" type="button">Main button</button>
<button class="btn btn-sm btn-outline-secondary" type="button">Smaller button</button>
</form>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success"</span> <span class="na">type=</span><span class="s">"button"</span><span class="nt">></span>Main button<span class="nt"></button></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-sm btn-outline-secondary"</span> <span class="na">type=</span><span class="s">"button"</span><span class="nt">></span>Smaller button<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></nav></span></code></pre></figure>
<h3 id="text">Text</h3>
<p>Navbars may contain bits of text with the help of <code class="highlighter-rouge">.navbar-text</code>. This class adjusts vertical alignment and horizontal spacing for strings of text.</p>
<div class="bd-example">
<nav class="navbar navbar-light bg-light">
<span class="navbar-text">
Navbar text with an inline element
</span>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-text"</span><span class="nt">></span>
Navbar text with an inline element
<span class="nt"></span></span>
<span class="nt"></nav></span></code></pre></figure>
<p>Mix and match with other components and utilities as needed.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar w/ text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
</ul>
<span class="navbar-text">
Navbar text with an inline element
</span>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar w/ text<span class="nt"></a></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarText"</span> <span class="na">aria-controls=</span><span class="s">"navbarText"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarText"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav mr-auto"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Features<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Pricing<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-text"</span><span class="nt">></span>
Navbar text with an inline element
<span class="nt"></span></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<h2 id="color-schemes">Color schemes</h2>
<p>Theming the navbar has never been easier thanks to the combination of theming classes and <code class="highlighter-rouge">background-color</code> utilities. Choose from <code class="highlighter-rouge">.navbar-light</code> for use with light background colors, or <code class="highlighter-rouge">.navbar-dark</code> for dark background colors. Then, customize with <code class="highlighter-rouge">.bg-*</code> utilities.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor01">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
</ul>
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor02">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
</ul>
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-light my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<nav class="navbar navbar-expand-lg navbar-light" style="background-color: #e3f2fd;">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor03">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
</ul>
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-dark bg-dark"</span><span class="nt">></span>
<span class="c"><!-- Navbar content --></span>
<span class="nt"></nav></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-dark bg-primary"</span><span class="nt">></span>
<span class="c"><!-- Navbar content --></span>
<span class="nt"></nav></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light"</span> <span class="na">style=</span><span class="s">"background-color: #e3f2fd;"</span><span class="nt">></span>
<span class="c"><!-- Navbar content --></span>
<span class="nt"></nav></span></code></pre></figure>
<h2 id="containers">Containers</h2>
<p>Although it’s not required, you can wrap a navbar in a <code class="highlighter-rouge">.container</code> to center it on a page or add one within to only center the contents of a <a href="#placement">fixed or static top navbar</a>.</p>
<div class="bd-example">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
</nav>
</div>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><div</span> <span class="na">class=</span><span class="s">"container"</span><span class="nt">></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"></nav></span>
<span class="nt"></div></span></code></pre></figure>
<p>When the container is within your navbar, its horizontal padding is removed at breakpoints lower than your specified <code class="highlighter-rouge">.navbar-expand{-sm|-md|-lg|-xl}</code> class. This ensures we’re not doubling up on padding unnecessarily on lower viewports when your navbar is collapsed.</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">Navbar</a>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"container"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<h2 id="placement">Placement</h2>
<p>Use our <a href="../../utilities/position/index.html">position utilities</a> to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use <code class="highlighter-rouge">position: fixed</code>, meaning they’re pulled from the normal flow of the DOM and may require custom CSS (e.g., <code class="highlighter-rouge">padding-top</code> on the <code class="highlighter-rouge"><body></code>) to prevent overlap with other elements.</p>
<p>Also note that <strong><code class="highlighter-rouge">.sticky-top</code> uses <code class="highlighter-rouge">position: sticky</code>, which <a href="https://caniuse.com/#feat=css-sticky">isn’t fully supported in every browser</a></strong>.</p>
<div class="bd-example">
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">Default</a>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Default<span class="nt"></a></span>
<span class="nt"></nav></span></code></pre></figure>
<div class="bd-example">
<nav class="navbar fixed-top navbar-light bg-light">
<a class="navbar-brand" href="#">Fixed top</a>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar fixed-top navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Fixed top<span class="nt"></a></span>
<span class="nt"></nav></span></code></pre></figure>
<div class="bd-example">
<nav class="navbar fixed-bottom navbar-light bg-light">
<a class="navbar-brand" href="#">Fixed bottom</a>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar fixed-bottom navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Fixed bottom<span class="nt"></a></span>
<span class="nt"></nav></span></code></pre></figure>
<div class="bd-example">
<nav class="navbar sticky-top navbar-light bg-light">
<a class="navbar-brand" href="#">Sticky top</a>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar sticky-top navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Sticky top<span class="nt"></a></span>
<span class="nt"></nav></span></code></pre></figure>
<h2 id="responsive-behaviors">Responsive behaviors</h2>
<p>Navbars can utilize <code class="highlighter-rouge">.navbar-toggler</code>, <code class="highlighter-rouge">.navbar-collapse</code>, and <code class="highlighter-rouge">.navbar-expand{-sm|-md|-lg|-xl}</code> classes to change when their content collapses behind a button. In combination with other utilities, you can easily choose when to show or hide particular elements.</p>
<p>For navbars that never collapse, add the <code class="highlighter-rouge">.navbar-expand</code> class on the navbar. For navbars that always collapse, don’t add any <code class="highlighter-rouge">.navbar-expand</code> class.</p>
<h3 id="toggler">Toggler</h3>
<p>Navbar togglers are left-aligned by default, but should they follow a sibling element like a <code class="highlighter-rouge">.navbar-brand</code>, they’ll automatically be aligned to the far right. Reversing your markup will reverse the placement of the toggler. Below are examples of different toggle styles.</p>
<p>With no <code class="highlighter-rouge">.navbar-brand</code> shown in lowest breakpoint:</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<a class="navbar-brand" href="#">Hidden brand</a>
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarTogglerDemo01"</span> <span class="na">aria-controls=</span><span class="s">"navbarTogglerDemo01"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarTogglerDemo01"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Hidden brand<span class="nt"></a></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav mr-auto mt-2 mt-lg-0"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Link<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link disabled"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">tabindex=</span><span class="s">"-1"</span> <span class="na">aria-disabled=</span><span class="s">"true"</span><span class="nt">></span>Disabled<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline my-2 my-lg-0"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">class=</span><span class="s">"form-control mr-sm-2"</span> <span class="na">type=</span><span class="s">"search"</span> <span class="na">placeholder=</span><span class="s">"Search"</span> <span class="na">aria-label=</span><span class="s">"Search"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success my-2 my-sm-0"</span> <span class="na">type=</span><span class="s">"submit"</span><span class="nt">></span>Search<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<p>With a brand name shown on the left and toggler on the right:</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarTogglerDemo02"</span> <span class="na">aria-controls=</span><span class="s">"navbarTogglerDemo02"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarTogglerDemo02"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav mr-auto mt-2 mt-lg-0"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Link<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link disabled"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">tabindex=</span><span class="s">"-1"</span> <span class="na">aria-disabled=</span><span class="s">"true"</span><span class="nt">></span>Disabled<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline my-2 my-lg-0"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">class=</span><span class="s">"form-control mr-sm-2"</span> <span class="na">type=</span><span class="s">"search"</span> <span class="na">placeholder=</span><span class="s">"Search"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success my-2 my-sm-0"</span> <span class="na">type=</span><span class="s">"submit"</span><span class="nt">></span>Search<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<p>With a toggler on the left and brand name on the right:</p>
<div class="bd-example">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-expand-lg navbar-light bg-light"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarTogglerDemo03"</span> <span class="na">aria-controls=</span><span class="s">"navbarTogglerDemo03"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"navbar-brand"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Navbar<span class="nt"></a></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse navbar-collapse"</span> <span class="na">id=</span><span class="s">"navbarTogglerDemo03"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"navbar-nav mr-auto mt-2 mt-lg-0"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item active"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Home <span class="nt"><span</span> <span class="na">class=</span><span class="s">"sr-only"</span><span class="nt">></span>(current)<span class="nt"></span></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link"</span> <span class="na">href=</span><span class="s">"#"</span><span class="nt">></span>Link<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"nav-item"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"nav-link disabled"</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">tabindex=</span><span class="s">"-1"</span> <span class="na">aria-disabled=</span><span class="s">"true"</span><span class="nt">></span>Disabled<span class="nt"></a></span>
<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"><form</span> <span class="na">class=</span><span class="s">"form-inline my-2 my-lg-0"</span><span class="nt">></span>
<span class="nt"><input</span> <span class="na">class=</span><span class="s">"form-control mr-sm-2"</span> <span class="na">type=</span><span class="s">"search"</span> <span class="na">placeholder=</span><span class="s">"Search"</span> <span class="na">aria-label=</span><span class="s">"Search"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"btn btn-outline-success my-2 my-sm-0"</span> <span class="na">type=</span><span class="s">"submit"</span><span class="nt">></span>Search<span class="nt"></button></span>
<span class="nt"></form></span>
<span class="nt"></div></span>
<span class="nt"></nav></span></code></pre></figure>
<h3 id="external-content">External content</h3>
<p>Sometimes you want to use the collapse plugin to trigger hidden content elsewhere on the page. Because our plugin works on the <code class="highlighter-rouge">id</code> and <code class="highlighter-rouge">data-target</code> matching, that’s easily done!</p>
<div class="bd-example">
<div class="pos-f-t">
<div class="collapse" id="navbarToggleExternalContent">
<div class="bg-dark p-4">
<h5 class="text-white h4">Collapsed content</h5>
<span class="text-muted">Toggleable via the navbar brand.</span>
</div>
</div>
<nav class="navbar navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
</div>
</div>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><div</span> <span class="na">class=</span><span class="s">"pos-f-t"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"collapse"</span> <span class="na">id=</span><span class="s">"navbarToggleExternalContent"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"bg-dark p-4"</span><span class="nt">></span>
<span class="nt"><h5</span> <span class="na">class=</span><span class="s">"text-white h4"</span><span class="nt">></span>Collapsed content<span class="nt"></h5></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"text-muted"</span><span class="nt">></span>Toggleable via the navbar brand.<span class="nt"></span></span>
<span class="nt"></div></span>
<span class="nt"></div></span>
<span class="nt"><nav</span> <span class="na">class=</span><span class="s">"navbar navbar-dark bg-dark"</span><span class="nt">></span>
<span class="nt"><button</span> <span class="na">class=</span><span class="s">"navbar-toggler"</span> <span class="na">type=</span><span class="s">"button"</span> <span class="na">data-toggle=</span><span class="s">"collapse"</span> <span class="na">data-target=</span><span class="s">"#navbarToggleExternalContent"</span> <span class="na">aria-controls=</span><span class="s">"navbarToggleExternalContent"</span> <span class="na">aria-expanded=</span><span class="s">"false"</span> <span class="na">aria-label=</span><span class="s">"Toggle navigation"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"navbar-toggler-icon"</span><span class="nt">></span></span>
<span class="nt"></button></span>
<span class="nt"></nav></span>
<span class="nt"></div></span></code></pre></figure>
</main>
</div>
</div>
<script src="../../assets/js/vendor/jquery.slim.min.js" ></script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "buffer.h"
#include "posix.h"
#include "git2/buffer.h"
#include "buf_text.h"
#include <ctype.h>
/* Used as default value for git_buf->ptr so that people can always
* assume ptr is non-NULL and zero terminated even for new git_bufs.
*/
char git_buf__initbuf[1];
char git_buf__oom[1];
#define ENSURE_SIZE(b, d) \
if ((d) > (b)->asize && git_buf_grow((b), (d)) < 0)\
return -1;
int git_buf_init(git_buf *buf, size_t initial_size)
{
buf->asize = 0;
buf->size = 0;
buf->ptr = git_buf__initbuf;
ENSURE_SIZE(buf, initial_size);
return 0;
}
int git_buf_try_grow(
git_buf *buf, size_t target_size, bool mark_oom)
{
char *new_ptr;
size_t new_size;
if (buf->ptr == git_buf__oom)
return -1;
if (buf->asize == 0 && buf->size != 0) {
giterr_set(GITERR_INVALID, "cannot grow a borrowed buffer");
return GIT_EINVALID;
}
if (!target_size)
target_size = buf->size;
if (target_size <= buf->asize)
return 0;
if (buf->asize == 0) {
new_size = target_size;
new_ptr = NULL;
} else {
new_size = buf->asize;
new_ptr = buf->ptr;
}
/* grow the buffer size by 1.5, until it's big enough
* to fit our target size */
while (new_size < target_size)
new_size = (new_size << 1) - (new_size >> 1);
/* round allocation up to multiple of 8 */
new_size = (new_size + 7) & ~7;
if (new_size < buf->size) {
if (mark_oom)
buf->ptr = git_buf__oom;
giterr_set_oom();
return -1;
}
new_ptr = git__realloc(new_ptr, new_size);
if (!new_ptr) {
if (mark_oom) {
if (buf->ptr && (buf->ptr != git_buf__initbuf))
git__free(buf->ptr);
buf->ptr = git_buf__oom;
}
return -1;
}
buf->asize = new_size;
buf->ptr = new_ptr;
/* truncate the existing buffer size if necessary */
if (buf->size >= buf->asize)
buf->size = buf->asize - 1;
buf->ptr[buf->size] = '\0';
return 0;
}
int git_buf_grow(git_buf *buffer, size_t target_size)
{
return git_buf_try_grow(buffer, target_size, true);
}
int git_buf_grow_by(git_buf *buffer, size_t additional_size)
{
size_t newsize;
if (GIT_ADD_SIZET_OVERFLOW(&newsize, buffer->size, additional_size)) {
buffer->ptr = git_buf__oom;
return -1;
}
return git_buf_try_grow(buffer, newsize, true);
}
void git_buf_free(git_buf *buf)
{
if (!buf) return;
if (buf->asize > 0 && buf->ptr != NULL && buf->ptr != git_buf__oom)
git__free(buf->ptr);
git_buf_init(buf, 0);
}
void git_buf_sanitize(git_buf *buf)
{
if (buf->ptr == NULL) {
assert(buf->size == 0 && buf->asize == 0);
buf->ptr = git_buf__initbuf;
} else if (buf->asize > buf->size)
buf->ptr[buf->size] = '\0';
}
void git_buf_clear(git_buf *buf)
{
buf->size = 0;
if (!buf->ptr) {
buf->ptr = git_buf__initbuf;
buf->asize = 0;
}
if (buf->asize > 0)
buf->ptr[0] = '\0';
}
int git_buf_set(git_buf *buf, const void *data, size_t len)
{
size_t alloclen;
if (len == 0 || data == NULL) {
git_buf_clear(buf);
} else {
if (data != buf->ptr) {
GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1);
ENSURE_SIZE(buf, alloclen);
memmove(buf->ptr, data, len);
}
buf->size = len;
if (buf->asize > buf->size)
buf->ptr[buf->size] = '\0';
}
return 0;
}
int git_buf_is_binary(const git_buf *buf)
{
return git_buf_text_is_binary(buf);
}
int git_buf_contains_nul(const git_buf *buf)
{
return git_buf_text_contains_nul(buf);
}
int git_buf_sets(git_buf *buf, const char *string)
{
return git_buf_set(buf, string, string ? strlen(string) : 0);
}
int git_buf_putc(git_buf *buf, char c)
{
size_t new_size;
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, 2);
ENSURE_SIZE(buf, new_size);
buf->ptr[buf->size++] = c;
buf->ptr[buf->size] = '\0';
return 0;
}
int git_buf_putcn(git_buf *buf, char c, size_t len)
{
size_t new_size;
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len);
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
ENSURE_SIZE(buf, new_size);
memset(buf->ptr + buf->size, c, len);
buf->size += len;
buf->ptr[buf->size] = '\0';
return 0;
}
int git_buf_put(git_buf *buf, const char *data, size_t len)
{
if (len) {
size_t new_size;
assert(data);
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len);
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
ENSURE_SIZE(buf, new_size);
memmove(buf->ptr + buf->size, data, len);
buf->size += len;
buf->ptr[buf->size] = '\0';
}
return 0;
}
int git_buf_puts(git_buf *buf, const char *string)
{
assert(string);
return git_buf_put(buf, string, strlen(string));
}
static const char base64_encode[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int git_buf_encode_base64(git_buf *buf, const char *data, size_t len)
{
size_t extra = len % 3;
uint8_t *write, a, b, c;
const uint8_t *read = (const uint8_t *)data;
size_t blocks = (len / 3) + !!extra, alloclen;
GITERR_CHECK_ALLOC_ADD(&blocks, blocks, 1);
GITERR_CHECK_ALLOC_MULTIPLY(&alloclen, blocks, 4);
GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, buf->size);
ENSURE_SIZE(buf, alloclen);
write = (uint8_t *)&buf->ptr[buf->size];
/* convert each run of 3 bytes into 4 output bytes */
for (len -= extra; len > 0; len -= 3) {
a = *read++;
b = *read++;
c = *read++;
*write++ = base64_encode[a >> 2];
*write++ = base64_encode[(a & 0x03) << 4 | b >> 4];
*write++ = base64_encode[(b & 0x0f) << 2 | c >> 6];
*write++ = base64_encode[c & 0x3f];
}
if (extra > 0) {
a = *read++;
b = (extra > 1) ? *read++ : 0;
*write++ = base64_encode[a >> 2];
*write++ = base64_encode[(a & 0x03) << 4 | b >> 4];
*write++ = (extra > 1) ? base64_encode[(b & 0x0f) << 2] : '=';
*write++ = '=';
}
buf->size = ((char *)write) - buf->ptr;
buf->ptr[buf->size] = '\0';
return 0;
}
/* The inverse of base64_encode */
static const int8_t base64_decode[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
int git_buf_decode_base64(git_buf *buf, const char *base64, size_t len)
{
size_t i;
int8_t a, b, c, d;
size_t orig_size = buf->size, new_size;
if (len % 4) {
giterr_set(GITERR_INVALID, "invalid base64 input");
return -1;
}
assert(len % 4 == 0);
GITERR_CHECK_ALLOC_ADD(&new_size, (len / 4 * 3), buf->size);
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
ENSURE_SIZE(buf, new_size);
for (i = 0; i < len; i += 4) {
if ((a = base64_decode[(unsigned char)base64[i]]) < 0 ||
(b = base64_decode[(unsigned char)base64[i+1]]) < 0 ||
(c = base64_decode[(unsigned char)base64[i+2]]) < 0 ||
(d = base64_decode[(unsigned char)base64[i+3]]) < 0) {
buf->size = orig_size;
buf->ptr[buf->size] = '\0';
giterr_set(GITERR_INVALID, "invalid base64 input");
return -1;
}
buf->ptr[buf->size++] = ((a << 2) | (b & 0x30) >> 4);
buf->ptr[buf->size++] = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2);
buf->ptr[buf->size++] = (c & 0x03) << 6 | (d & 0x3f);
}
buf->ptr[buf->size] = '\0';
return 0;
}
static const char base85_encode[] =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~";
int git_buf_encode_base85(git_buf *buf, const char *data, size_t len)
{
size_t blocks = (len / 4) + !!(len % 4), alloclen;
GITERR_CHECK_ALLOC_MULTIPLY(&alloclen, blocks, 5);
GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, buf->size);
GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1);
ENSURE_SIZE(buf, alloclen);
while (len) {
uint32_t acc = 0;
char b85[5];
int i;
for (i = 24; i >= 0; i -= 8) {
uint8_t ch = *data++;
acc |= ch << i;
if (--len == 0)
break;
}
for (i = 4; i >= 0; i--) {
int val = acc % 85;
acc /= 85;
b85[i] = base85_encode[val];
}
for (i = 0; i < 5; i++)
buf->ptr[buf->size++] = b85[i];
}
buf->ptr[buf->size] = '\0';
return 0;
}
/* The inverse of base85_encode */
static const int8_t base85_decode[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 63, -1, 64, 65, 66, 67, -1, 68, 69, 70, 71, -1, 72, -1, -1,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 73, 74, 75, 76, 77,
78, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, -1, -1, -1, 79, 80,
81, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 82, 83, 84, 85, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
int git_buf_decode_base85(
git_buf *buf,
const char *base85,
size_t base85_len,
size_t output_len)
{
size_t orig_size = buf->size, new_size;
if (base85_len % 5 ||
output_len > base85_len * 4 / 5) {
giterr_set(GITERR_INVALID, "invalid base85 input");
return -1;
}
GITERR_CHECK_ALLOC_ADD(&new_size, output_len, buf->size);
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
ENSURE_SIZE(buf, new_size);
while (output_len) {
unsigned acc = 0;
int de, cnt = 4;
unsigned char ch;
do {
ch = *base85++;
de = base85_decode[ch];
if (--de < 0)
goto on_error;
acc = acc * 85 + de;
} while (--cnt);
ch = *base85++;
de = base85_decode[ch];
if (--de < 0)
goto on_error;
/* Detect overflow. */
if (0xffffffff / 85 < acc ||
0xffffffff - de < (acc *= 85))
goto on_error;
acc += de;
cnt = (output_len < 4) ? output_len : 4;
output_len -= cnt;
do {
acc = (acc << 8) | (acc >> 24);
buf->ptr[buf->size++] = acc;
} while (--cnt);
}
buf->ptr[buf->size] = 0;
return 0;
on_error:
buf->size = orig_size;
buf->ptr[buf->size] = '\0';
giterr_set(GITERR_INVALID, "invalid base85 input");
return -1;
}
#define HEX_DECODE(c) ((c | 32) % 39 - 9)
int git_buf_decode_percent(
git_buf *buf,
const char *str,
size_t str_len)
{
size_t str_pos, new_size;
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, str_len);
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
ENSURE_SIZE(buf, new_size);
for (str_pos = 0; str_pos < str_len; buf->size++, str_pos++) {
if (str[str_pos] == '%' &&
str_len > str_pos + 2 &&
isxdigit(str[str_pos + 1]) &&
isxdigit(str[str_pos + 2])) {
buf->ptr[buf->size] = (HEX_DECODE(str[str_pos + 1]) << 4) +
HEX_DECODE(str[str_pos + 2]);
str_pos += 2;
} else {
buf->ptr[buf->size] = str[str_pos];
}
}
buf->ptr[buf->size] = '\0';
return 0;
}
int git_buf_vprintf(git_buf *buf, const char *format, va_list ap)
{
size_t expected_size, new_size;
int len;
GITERR_CHECK_ALLOC_MULTIPLY(&expected_size, strlen(format), 2);
GITERR_CHECK_ALLOC_ADD(&expected_size, expected_size, buf->size);
ENSURE_SIZE(buf, expected_size);
while (1) {
va_list args;
va_copy(args, ap);
len = p_vsnprintf(
buf->ptr + buf->size,
buf->asize - buf->size,
format, args
);
va_end(args);
if (len < 0) {
git__free(buf->ptr);
buf->ptr = git_buf__oom;
return -1;
}
if ((size_t)len + 1 <= buf->asize - buf->size) {
buf->size += len;
break;
}
GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len);
GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1);
ENSURE_SIZE(buf, new_size);
}
return 0;
}
int git_buf_printf(git_buf *buf, const char *format, ...)
{
int r;
va_list ap;
va_start(ap, format);
r = git_buf_vprintf(buf, format, ap);
va_end(ap);
return r;
}
void git_buf_copy_cstr(char *data, size_t datasize, const git_buf *buf)
{
size_t copylen;
assert(data && datasize && buf);
data[0] = '\0';
if (buf->size == 0 || buf->asize <= 0)
return;
copylen = buf->size;
if (copylen > datasize - 1)
copylen = datasize - 1;
memmove(data, buf->ptr, copylen);
data[copylen] = '\0';
}
void git_buf_consume(git_buf *buf, const char *end)
{
if (end > buf->ptr && end <= buf->ptr + buf->size) {
size_t consumed = end - buf->ptr;
memmove(buf->ptr, end, buf->size - consumed);
buf->size -= consumed;
buf->ptr[buf->size] = '\0';
}
}
void git_buf_truncate(git_buf *buf, size_t len)
{
if (len >= buf->size)
return;
buf->size = len;
if (buf->size < buf->asize)
buf->ptr[buf->size] = '\0';
}
void git_buf_shorten(git_buf *buf, size_t amount)
{
if (buf->size > amount)
git_buf_truncate(buf, buf->size - amount);
else
git_buf_clear(buf);
}
void git_buf_rtruncate_at_char(git_buf *buf, char separator)
{
ssize_t idx = git_buf_rfind_next(buf, separator);
git_buf_truncate(buf, idx < 0 ? 0 : (size_t)idx);
}
void git_buf_swap(git_buf *buf_a, git_buf *buf_b)
{
git_buf t = *buf_a;
*buf_a = *buf_b;
*buf_b = t;
}
char *git_buf_detach(git_buf *buf)
{
char *data = buf->ptr;
if (buf->asize == 0 || buf->ptr == git_buf__oom)
return NULL;
git_buf_init(buf, 0);
return data;
}
int git_buf_attach(git_buf *buf, char *ptr, size_t asize)
{
git_buf_free(buf);
if (ptr) {
buf->ptr = ptr;
buf->size = strlen(ptr);
if (asize)
buf->asize = (asize < buf->size) ? buf->size + 1 : asize;
else /* pass 0 to fall back on strlen + 1 */
buf->asize = buf->size + 1;
}
ENSURE_SIZE(buf, asize);
return 0;
}
void git_buf_attach_notowned(git_buf *buf, const char *ptr, size_t size)
{
if (git_buf_is_allocated(buf))
git_buf_free(buf);
if (!size) {
git_buf_init(buf, 0);
} else {
buf->ptr = (char *)ptr;
buf->asize = 0;
buf->size = size;
}
}
int git_buf_join_n(git_buf *buf, char separator, int nbuf, ...)
{
va_list ap;
int i;
size_t total_size = 0, original_size = buf->size;
char *out, *original = buf->ptr;
if (buf->size > 0 && buf->ptr[buf->size - 1] != separator)
++total_size; /* space for initial separator */
/* Make two passes to avoid multiple reallocation */
va_start(ap, nbuf);
for (i = 0; i < nbuf; ++i) {
const char* segment;
size_t segment_len;
segment = va_arg(ap, const char *);
if (!segment)
continue;
segment_len = strlen(segment);
GITERR_CHECK_ALLOC_ADD(&total_size, total_size, segment_len);
if (segment_len == 0 || segment[segment_len - 1] != separator)
GITERR_CHECK_ALLOC_ADD(&total_size, total_size, 1);
}
va_end(ap);
/* expand buffer if needed */
if (total_size == 0)
return 0;
GITERR_CHECK_ALLOC_ADD(&total_size, total_size, 1);
if (git_buf_grow_by(buf, total_size) < 0)
return -1;
out = buf->ptr + buf->size;
/* append separator to existing buf if needed */
if (buf->size > 0 && out[-1] != separator)
*out++ = separator;
va_start(ap, nbuf);
for (i = 0; i < nbuf; ++i) {
const char* segment;
size_t segment_len;
segment = va_arg(ap, const char *);
if (!segment)
continue;
/* deal with join that references buffer's original content */
if (segment >= original && segment < original + original_size) {
size_t offset = (segment - original);
segment = buf->ptr + offset;
segment_len = original_size - offset;
} else {
segment_len = strlen(segment);
}
/* skip leading separators */
if (out > buf->ptr && out[-1] == separator)
while (segment_len > 0 && *segment == separator) {
segment++;
segment_len--;
}
/* copy over next buffer */
if (segment_len > 0) {
memmove(out, segment, segment_len);
out += segment_len;
}
/* append trailing separator (except for last item) */
if (i < nbuf - 1 && out > buf->ptr && out[-1] != separator)
*out++ = separator;
}
va_end(ap);
/* set size based on num characters actually written */
buf->size = out - buf->ptr;
buf->ptr[buf->size] = '\0';
return 0;
}
int git_buf_join(
git_buf *buf,
char separator,
const char *str_a,
const char *str_b)
{
size_t strlen_a = str_a ? strlen(str_a) : 0;
size_t strlen_b = strlen(str_b);
size_t alloc_len;
int need_sep = 0;
ssize_t offset_a = -1;
/* not safe to have str_b point internally to the buffer */
assert(str_b < buf->ptr || str_b >= buf->ptr + buf->size);
/* figure out if we need to insert a separator */
if (separator && strlen_a) {
while (*str_b == separator) { str_b++; strlen_b--; }
if (str_a[strlen_a - 1] != separator)
need_sep = 1;
}
/* str_a could be part of the buffer */
if (str_a >= buf->ptr && str_a < buf->ptr + buf->size)
offset_a = str_a - buf->ptr;
GITERR_CHECK_ALLOC_ADD(&alloc_len, strlen_a, strlen_b);
GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, need_sep);
GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 1);
ENSURE_SIZE(buf, alloc_len);
/* fix up internal pointers */
if (offset_a >= 0)
str_a = buf->ptr + offset_a;
/* do the actual copying */
if (offset_a != 0 && str_a)
memmove(buf->ptr, str_a, strlen_a);
if (need_sep)
buf->ptr[strlen_a] = separator;
memcpy(buf->ptr + strlen_a + need_sep, str_b, strlen_b);
buf->size = strlen_a + strlen_b + need_sep;
buf->ptr[buf->size] = '\0';
return 0;
}
int git_buf_join3(
git_buf *buf,
char separator,
const char *str_a,
const char *str_b,
const char *str_c)
{
size_t len_a = strlen(str_a),
len_b = strlen(str_b),
len_c = strlen(str_c),
len_total;
int sep_a = 0, sep_b = 0;
char *tgt;
/* for this function, disallow pointers into the existing buffer */
assert(str_a < buf->ptr || str_a >= buf->ptr + buf->size);
assert(str_b < buf->ptr || str_b >= buf->ptr + buf->size);
assert(str_c < buf->ptr || str_c >= buf->ptr + buf->size);
if (separator) {
if (len_a > 0) {
while (*str_b == separator) { str_b++; len_b--; }
sep_a = (str_a[len_a - 1] != separator);
}
if (len_a > 0 || len_b > 0)
while (*str_c == separator) { str_c++; len_c--; }
if (len_b > 0)
sep_b = (str_b[len_b - 1] != separator);
}
GITERR_CHECK_ALLOC_ADD(&len_total, len_a, sep_a);
GITERR_CHECK_ALLOC_ADD(&len_total, len_total, len_b);
GITERR_CHECK_ALLOC_ADD(&len_total, len_total, sep_b);
GITERR_CHECK_ALLOC_ADD(&len_total, len_total, len_c);
GITERR_CHECK_ALLOC_ADD(&len_total, len_total, 1);
ENSURE_SIZE(buf, len_total);
tgt = buf->ptr;
if (len_a) {
memcpy(tgt, str_a, len_a);
tgt += len_a;
}
if (sep_a)
*tgt++ = separator;
if (len_b) {
memcpy(tgt, str_b, len_b);
tgt += len_b;
}
if (sep_b)
*tgt++ = separator;
if (len_c)
memcpy(tgt, str_c, len_c);
buf->size = len_a + sep_a + len_b + sep_b + len_c;
buf->ptr[buf->size] = '\0';
return 0;
}
void git_buf_rtrim(git_buf *buf)
{
while (buf->size > 0) {
if (!git__isspace(buf->ptr[buf->size - 1]))
break;
buf->size--;
}
if (buf->asize > buf->size)
buf->ptr[buf->size] = '\0';
}
int git_buf_cmp(const git_buf *a, const git_buf *b)
{
int result = memcmp(a->ptr, b->ptr, min(a->size, b->size));
return (result != 0) ? result :
(a->size < b->size) ? -1 : (a->size > b->size) ? 1 : 0;
}
int git_buf_splice(
git_buf *buf,
size_t where,
size_t nb_to_remove,
const char *data,
size_t nb_to_insert)
{
char *splice_loc;
size_t new_size, alloc_size;
assert(buf && where <= buf->size && nb_to_remove <= buf->size - where);
splice_loc = buf->ptr + where;
/* Ported from git.git
* https://github.com/git/git/blob/16eed7c/strbuf.c#L159-176
*/
GITERR_CHECK_ALLOC_ADD(&new_size, (buf->size - nb_to_remove), nb_to_insert);
GITERR_CHECK_ALLOC_ADD(&alloc_size, new_size, 1);
ENSURE_SIZE(buf, alloc_size);
memmove(splice_loc + nb_to_insert,
splice_loc + nb_to_remove,
buf->size - where - nb_to_remove);
memcpy(splice_loc, data, nb_to_insert);
buf->size = new_size;
buf->ptr[buf->size] = '\0';
return 0;
}
/* Quote per http://marc.info/?l=git&m=112927316408690&w=2 */
int git_buf_quote(git_buf *buf)
{
const char whitespace[] = { 'a', 'b', 't', 'n', 'v', 'f', 'r' };
git_buf quoted = GIT_BUF_INIT;
size_t i = 0;
bool quote = false;
int error = 0;
/* walk to the first char that needs quoting */
if (buf->size && buf->ptr[0] == '!')
quote = true;
for (i = 0; !quote && i < buf->size; i++) {
if (buf->ptr[i] == '"' || buf->ptr[i] == '\\' ||
buf->ptr[i] < ' ' || buf->ptr[i] > '~') {
quote = true;
break;
}
}
if (!quote)
goto done;
git_buf_putc("ed, '"');
git_buf_put("ed, buf->ptr, i);
for (; i < buf->size; i++) {
/* whitespace - use the map above, which is ordered by ascii value */
if (buf->ptr[i] >= '\a' && buf->ptr[i] <= '\r') {
git_buf_putc("ed, '\\');
git_buf_putc("ed, whitespace[buf->ptr[i] - '\a']);
}
/* double quote and backslash must be escaped */
else if (buf->ptr[i] == '"' || buf->ptr[i] == '\\') {
git_buf_putc("ed, '\\');
git_buf_putc("ed, buf->ptr[i]);
}
/* escape anything unprintable as octal */
else if (buf->ptr[i] != ' ' &&
(buf->ptr[i] < '!' || buf->ptr[i] > '~')) {
git_buf_printf("ed, "\\%03o", (unsigned char)buf->ptr[i]);
}
/* yay, printable! */
else {
git_buf_putc("ed, buf->ptr[i]);
}
}
git_buf_putc("ed, '"');
if (git_buf_oom("ed)) {
error = -1;
goto done;
}
git_buf_swap("ed, buf);
done:
git_buf_free("ed);
return error;
}
/* Unquote per http://marc.info/?l=git&m=112927316408690&w=2 */
int git_buf_unquote(git_buf *buf)
{
size_t i, j;
char ch;
git_buf_rtrim(buf);
if (buf->size < 2 || buf->ptr[0] != '"' || buf->ptr[buf->size-1] != '"')
goto invalid;
for (i = 0, j = 1; j < buf->size-1; i++, j++) {
ch = buf->ptr[j];
if (ch == '\\') {
if (j == buf->size-2)
goto invalid;
ch = buf->ptr[++j];
switch (ch) {
/* \" or \\ simply copy the char in */
case '"': case '\\':
break;
/* add the appropriate escaped char */
case 'a': ch = '\a'; break;
case 'b': ch = '\b'; break;
case 'f': ch = '\f'; break;
case 'n': ch = '\n'; break;
case 'r': ch = '\r'; break;
case 't': ch = '\t'; break;
case 'v': ch = '\v'; break;
/* \xyz digits convert to the char*/
case '0': case '1': case '2': case '3':
if (j == buf->size-3) {
giterr_set(GITERR_INVALID,
"truncated quoted character \\%c", ch);
return -1;
}
if (buf->ptr[j+1] < '0' || buf->ptr[j+1] > '7' ||
buf->ptr[j+2] < '0' || buf->ptr[j+2] > '7') {
giterr_set(GITERR_INVALID,
"truncated quoted character \\%c%c%c",
buf->ptr[j], buf->ptr[j+1], buf->ptr[j+2]);
return -1;
}
ch = ((buf->ptr[j] - '0') << 6) |
((buf->ptr[j+1] - '0') << 3) |
(buf->ptr[j+2] - '0');
j += 2;
break;
default:
giterr_set(GITERR_INVALID, "invalid quoted character \\%c", ch);
return -1;
}
}
buf->ptr[i] = ch;
}
buf->ptr[i] = '\0';
buf->size = i;
return 0;
invalid:
giterr_set(GITERR_INVALID, "invalid quoted line");
return -1;
}
| {
"pile_set_name": "Github"
} |
name: Run tests
on: [push]
jobs:
build:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Install dependencies
run: npm install
- name: Build TS
run: npm build
- name: Check Prettier
run: npm run prettier:check
- name: Run tests
run: npm run test
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2020 OmniSci, 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.
*/
/**
* @file CreateAndDropTableDdlTest.cpp
* @brief Test suite for CREATE and DROP DDL commands for tables and foreign tables
*/
#include <gtest/gtest.h>
#include "Catalog/ForeignTable.h"
#include "Catalog/TableDescriptor.h"
#include "DBHandlerTestHelpers.h"
#include "Fragmenter/FragmentDefaultValues.h"
#include "TestHelpers.h"
#include "Utils/DdlUtils.h"
#ifndef BASE_PATH
#define BASE_PATH "./tmp"
#endif
extern bool g_enable_fsi;
namespace {
struct ColumnAttributes {
std::string column_name;
bool not_null{false};
int size{-1};
SQLTypes type;
SQLTypes sub_type{SQLTypes::kNULLT};
int precision{0};
int scale{0};
EncodingType encoding_type{EncodingType::kENCODING_NONE};
int encoding_size{0};
};
} // namespace
class CreateAndDropTableDdlTest : public DBHandlerTestFixture {
protected:
void SetUp() override {
g_enable_fsi = true;
DBHandlerTestFixture::SetUp();
}
std::string getCreateTableQuery(const ddl_utils::TableType table_type,
const std::string& table_name,
const std::string& columns,
bool if_not_exists = false) {
return getCreateTableQuery(table_type, table_name, columns, {}, if_not_exists);
}
std::string getCreateTableQuery(const ddl_utils::TableType table_type,
const std::string& table_name,
const std::string& columns,
std::map<std::string, std::string> options,
bool if_not_exists = false) {
std::string query{"CREATE "};
if (table_type == ddl_utils::TableType::FOREIGN_TABLE) {
query += "FOREIGN TABLE ";
} else {
query += "TABLE ";
}
if (if_not_exists) {
query += "IF NOT EXISTS ";
}
query += table_name + columns;
if (table_type == ddl_utils::TableType::FOREIGN_TABLE) {
query += " SERVER omnisci_local_csv";
options["file_path"] = "'" + getTestFilePath() + "'";
}
if (!options.empty()) {
query += " WITH (";
bool is_first = true;
for (auto& [key, value] : options) {
if (is_first) {
is_first = false;
} else {
query += ", ";
}
query += key + " = " + value;
}
query += ")";
}
query += ";";
return query;
}
std::string getDropTableQuery(const ddl_utils::TableType table_type,
const std::string& table_name,
bool if_exists = false) {
std::string query{"DROP "};
if (table_type == ddl_utils::TableType::FOREIGN_TABLE) {
query += "FOREIGN TABLE ";
} else {
query += "TABLE ";
}
if (if_exists) {
query += "IF EXISTS ";
}
query += table_name + ";";
return query;
}
std::string getTestFilePath() {
return boost::filesystem::canonical("../../Tests/FsiDataFiles/example_1.csv")
.string();
}
void createTestUser() {
sql("CREATE USER test_user (password = 'test_pass');");
sql("GRANT ACCESS ON DATABASE omnisci TO test_user;");
}
void dropTestUser() {
loginAdmin();
try {
sql("DROP USER test_user;");
} catch (const std::exception& e) {
// Swallow and log exceptions that may occur, since there is no "IF EXISTS" option.
LOG(WARNING) << e.what();
}
}
};
class CreateTableTest : public CreateAndDropTableDdlTest,
public testing::WithParamInterface<ddl_utils::TableType> {
protected:
void SetUp() override {
CreateAndDropTableDdlTest::SetUp();
sql(getDropTableQuery(GetParam(), "test_table", true));
dropTestUser();
}
void TearDown() override {
g_enable_fsi = true;
sql(getDropTableQuery(GetParam(), "test_table", true));
dropTestUser();
CreateAndDropTableDdlTest::TearDown();
}
/**
*
* @param td - table details returned from the catalog
* @param table_type - table type
* @param table_name - expected table name
* @param column_count - expected number of columns in the table
* @param user_id - id of user who owns the table. Default value is 0 (admin user id)
* @param max_fragment_size - expected maximum table fragment size
* used
*/
void assertTableDetails(const TableDescriptor* td,
const ddl_utils::TableType table_type,
const std::string& table_name,
const int column_count,
const int user_id = 0,
const int max_fragment_size = DEFAULT_FRAGMENT_ROWS) {
EXPECT_EQ(table_name, td->tableName);
EXPECT_EQ(Fragmenter_Namespace::FragmenterType::INSERT_ORDER, td->fragType);
EXPECT_EQ(max_fragment_size, td->maxFragRows);
EXPECT_EQ(DEFAULT_MAX_CHUNK_SIZE, td->maxChunkSize);
EXPECT_EQ(DEFAULT_PAGE_SIZE, td->fragPageSize);
EXPECT_EQ(DEFAULT_MAX_ROWS, td->maxRows);
EXPECT_EQ(user_id, td->userId);
EXPECT_EQ(Data_Namespace::MemoryLevel::DISK_LEVEL, td->persistenceLevel);
EXPECT_FALSE(td->isView);
EXPECT_EQ(0, td->nShards);
EXPECT_EQ(0, td->shardedColumnId);
EXPECT_EQ("[]", td->keyMetainfo);
EXPECT_EQ("", td->fragments);
EXPECT_EQ("", td->partitions);
if (table_type == ddl_utils::TableType::FOREIGN_TABLE) {
auto foreign_table = dynamic_cast<const foreign_storage::ForeignTable*>(td);
ASSERT_NE(nullptr, foreign_table);
EXPECT_EQ(column_count + 1, td->nColumns); // +1 for rowid column
EXPECT_FALSE(td->hasDeletedCol);
EXPECT_EQ(StorageType::FOREIGN_TABLE, foreign_table->storageType);
ASSERT_TRUE(foreign_table->options.find("FILE_PATH") !=
foreign_table->options.end());
EXPECT_EQ(getTestFilePath(), foreign_table->options.find("FILE_PATH")->second);
EXPECT_EQ("omnisci_local_csv", foreign_table->foreign_server->name);
} else {
EXPECT_EQ(column_count + 2, td->nColumns); // +2 for rowid and $deleted$ columns
EXPECT_TRUE(td->hasDeletedCol);
EXPECT_TRUE(td->storageType.empty());
}
}
void assertColumnDetails(const ColumnAttributes expected,
const ColumnDescriptor* column) {
EXPECT_EQ(expected.column_name, column->columnName);
EXPECT_TRUE(column->sourceName.empty());
EXPECT_TRUE(column->chunks.empty());
EXPECT_FALSE(column->isSystemCol);
EXPECT_FALSE(column->isVirtualCol);
EXPECT_TRUE(column->virtualExpr.empty());
EXPECT_FALSE(column->isDeletedCol);
auto& type_info = column->columnType;
EXPECT_EQ(expected.not_null, type_info.get_notnull());
EXPECT_EQ(expected.encoding_type, type_info.get_compression());
EXPECT_EQ(expected.precision, type_info.get_dimension());
EXPECT_EQ(expected.precision, type_info.get_precision());
EXPECT_EQ(expected.precision, type_info.get_input_srid());
EXPECT_EQ(expected.scale, type_info.get_scale());
EXPECT_EQ(expected.scale, type_info.get_output_srid());
EXPECT_EQ(expected.size, type_info.get_size());
EXPECT_EQ(expected.type, type_info.get_type());
EXPECT_EQ(expected.sub_type, type_info.get_subtype());
// Comp param contains dictionary id for encoded strings
if (type_info.get_compression() != kENCODING_DICT) {
EXPECT_EQ(expected.encoding_size, type_info.get_comp_param());
}
}
};
TEST_P(CreateTableTest, BooleanAndNumberTypes) {
std::string query =
getCreateTableQuery(GetParam(),
"test_table",
"(bl BOOLEAN, bint BIGINT, bint8 BIGINT ENCODING FIXED(8), "
"bint16 BIGINT ENCODING FIXED(16), "
"bint32 BIGINT ENCODING FIXED(32), dc DECIMAL(5, 2), dc1 "
"DECIMAL(3), db DOUBLE, fl FLOAT, i INTEGER, "
"i8 INTEGER ENCODING FIXED(8), i16 INTEGER ENCODING FIXED(16), "
"si SMALLINT, si8 SMALLINT ENCODING FIXED(8), "
"ti TINYINT)");
sql(query);
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 15);
auto columns = catalog.getAllColumnMetadataForTable(table->tableId, true, true, true);
auto it = columns.begin();
auto column = *it;
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "bl";
expected_attributes.size = 1;
expected_attributes.type = kBOOLEAN;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "bint";
expected_attributes.size = 8;
expected_attributes.type = SQLTypes::kBIGINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "bint8";
expected_attributes.size = 1;
expected_attributes.type = kBIGINT;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 8;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "bint16";
expected_attributes.size = 2;
expected_attributes.type = kBIGINT;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 16;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "bint32";
expected_attributes.size = 4;
expected_attributes.type = kBIGINT;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dc";
expected_attributes.size = 4;
expected_attributes.type = kDECIMAL;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 32;
expected_attributes.precision = 5;
expected_attributes.scale = 2;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dc1";
expected_attributes.size = 2;
expected_attributes.type = kDECIMAL;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 16;
expected_attributes.precision = 3;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "db";
expected_attributes.size = 8;
expected_attributes.type = kDOUBLE;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "fl";
expected_attributes.size = 4;
expected_attributes.type = kFLOAT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "i";
expected_attributes.size = 4;
expected_attributes.type = kINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "i8";
expected_attributes.size = 1;
expected_attributes.type = kINT;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 8;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "i16";
expected_attributes.size = 2;
expected_attributes.type = kINT;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 16;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "si";
expected_attributes.size = 2;
expected_attributes.type = kSMALLINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "si8";
expected_attributes.size = 1;
expected_attributes.type = kSMALLINT;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 8;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "ti";
expected_attributes.size = 1;
expected_attributes.type = kTINYINT;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, DateAndTimestampTypes) {
std::string query = getCreateTableQuery(
GetParam(),
"test_table",
"(dt DATE, dt16 DATE ENCODING FIXED(16), dt16_days DATE ENCODING DAYS(16), t TIME, "
"t32 TIME ENCODING FIXED(32), tp0 TIMESTAMP(0), tp3 TIMESTAMP(3), tp6 "
"TIMESTAMP(6), "
"tp9 TIMESTAMP(9), tp32 TIMESTAMP ENCODING FIXED(32))");
sql(query);
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 10);
auto columns = catalog.getAllColumnMetadataForTable(table->tableId, true, true, true);
auto it = columns.begin();
auto column = *it;
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "dt";
expected_attributes.size = 4;
expected_attributes.type = kDATE;
expected_attributes.encoding_type = kENCODING_DATE_IN_DAYS;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dt16";
expected_attributes.size = 2;
expected_attributes.type = kDATE;
expected_attributes.encoding_type = kENCODING_DATE_IN_DAYS;
expected_attributes.encoding_size = 16;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dt16_days";
expected_attributes.size = 2;
expected_attributes.type = kDATE;
expected_attributes.encoding_type = kENCODING_DATE_IN_DAYS;
expected_attributes.encoding_size = 16;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t";
expected_attributes.size = 8;
expected_attributes.type = kTIME;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t32";
expected_attributes.size = 4;
expected_attributes.type = kTIME;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp0";
expected_attributes.size = 8;
expected_attributes.type = kTIMESTAMP;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp3";
expected_attributes.size = 8;
expected_attributes.type = kTIMESTAMP;
expected_attributes.precision = 3;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp6";
expected_attributes.size = 8;
expected_attributes.type = kTIMESTAMP;
expected_attributes.precision = 6;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp9";
expected_attributes.size = 8;
expected_attributes.type = kTIMESTAMP;
expected_attributes.precision = 9;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp32";
expected_attributes.size = 4;
expected_attributes.type = kTIMESTAMP;
expected_attributes.encoding_type = kENCODING_FIXED;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, TextTypes) {
std::string query = getCreateTableQuery(
GetParam(),
"test_table",
"(t TEXT ENCODING DICT, t8 TEXT ENCODING DICT(8), t16 TEXT ENCODING DICT(16), "
"t32 TEXT ENCODING DICT(32), t_non_encoded TEXT ENCODING NONE)");
sql(query);
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 5);
auto columns = catalog.getAllColumnMetadataForTable(table->tableId, true, true, true);
auto it = columns.begin();
auto column = *it;
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "t";
expected_attributes.size = 4;
expected_attributes.type = kTEXT;
expected_attributes.encoding_type = kENCODING_DICT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t8";
expected_attributes.size = 1;
expected_attributes.type = kTEXT;
expected_attributes.encoding_type = kENCODING_DICT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t16";
expected_attributes.size = 2;
expected_attributes.type = kTEXT;
expected_attributes.encoding_type = kENCODING_DICT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t32";
expected_attributes.size = 4;
expected_attributes.type = kTEXT;
expected_attributes.encoding_type = kENCODING_DICT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t_non_encoded";
expected_attributes.type = kTEXT;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, GeoTypes) {
std::string query = getCreateTableQuery(
GetParam(),
"test_table",
"(ls LINESTRING, mpoly MULTIPOLYGON, p POINT, poly POLYGON, p1 GEOMETRY(POINT), "
"p2 GEOMETRY(POINT, 4326), p3 GEOMETRY(POINT, 4326) ENCODING NONE, p4 "
"GEOMETRY(POINT, 900913), "
"ls1 GEOMETRY(LINESTRING, 4326) ENCODING COMPRESSED(32), ls2 GEOMETRY(LINESTRING, "
"4326) ENCODING NONE, "
"poly1 GEOMETRY(POLYGON, 4326) ENCODING COMPRESSED(32), mpoly1 "
"GEOMETRY(MULTIPOLYGON, 4326))");
sql(query);
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
/**
* LINESTRING adds 2 additional columns, MULTIPOLYGON adds 5 additional columns,
* POLYGON adds 1 additional column, and POLYGON adds 4 additional columns when
* expanded.
*/
assertTableDetails(table, GetParam(), "test_table", 41);
auto columns = catalog.getAllColumnMetadataForTable(table->tableId, true, true, true);
auto it = columns.begin();
auto column = *it;
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "ls";
expected_attributes.type = kLINESTRING;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 3);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "mpoly";
expected_attributes.type = kMULTIPOLYGON;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 6);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "p";
expected_attributes.type = kPOINT;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 2);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "poly";
expected_attributes.type = kPOLYGON;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 5);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "p1";
expected_attributes.type = kPOINT;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 2);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "p2";
expected_attributes.type = kPOINT;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 4326;
expected_attributes.scale = 4326;
expected_attributes.encoding_type = kENCODING_GEOINT;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
std::advance(it, 2);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "p3";
expected_attributes.type = kPOINT;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 4326;
expected_attributes.scale = 4326;
expected_attributes.encoding_type = kENCODING_NONE;
expected_attributes.encoding_size = 0;
assertColumnDetails(expected_attributes, column);
std::advance(it, 2);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "p4";
expected_attributes.type = kPOINT;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 900913;
expected_attributes.scale = 900913;
expected_attributes.encoding_type = kENCODING_NONE;
expected_attributes.encoding_size = 0;
assertColumnDetails(expected_attributes, column);
std::advance(it, 2);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "ls1";
expected_attributes.type = kLINESTRING;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 4326;
expected_attributes.scale = 4326;
expected_attributes.encoding_type = kENCODING_GEOINT;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
std::advance(it, 3);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "ls2";
expected_attributes.type = kLINESTRING;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 4326;
expected_attributes.scale = 4326;
expected_attributes.encoding_type = kENCODING_NONE;
expected_attributes.encoding_size = 0;
assertColumnDetails(expected_attributes, column);
std::advance(it, 3);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "poly1";
expected_attributes.type = kPOLYGON;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 4326;
expected_attributes.scale = 4326;
expected_attributes.encoding_type = kENCODING_GEOINT;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
std::advance(it, 5);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "mpoly1";
expected_attributes.type = kMULTIPOLYGON;
expected_attributes.sub_type = kGEOMETRY;
expected_attributes.precision = 4326;
expected_attributes.scale = 4326;
expected_attributes.encoding_type = kENCODING_GEOINT;
expected_attributes.encoding_size = 32;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, ArrayTypes) {
std::string query =
getCreateTableQuery(GetParam(),
"test_table",
"(t TINYINT[], t2 TINYINT[1], i INTEGER[], i2 INTEGER[1], bint "
"BIGINT[], bint2 BIGINT[1], "
"txt TEXT[] ENCODING DICT(32), txt2 TEXT[1] ENCODING DICT(32), "
"f FLOAT[], f2 FLOAT[1], "
"d DOUBLE[], d2 DOUBLE[1], dc DECIMAL(18,6)[], dc2 "
"DECIMAL(18,6)[1], b BOOLEAN[], b2 BOOLEAN[1],"
"dt DATE[], dt2 DATE[1], tm TIME[], tm2 TIME[1], tp "
"TIMESTAMP[], tp2 TIMESTAMP[1], p POINT[],"
"ls LINESTRING[], poly POLYGON[], mpoly MULTIPOLYGON[])");
sql(query);
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 26);
auto columns = catalog.getAllColumnMetadataForTable(table->tableId, true, true, true);
auto it = columns.begin();
auto column = *it;
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "t";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTINYINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "t2";
expected_attributes.size = 1;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTINYINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "i";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "i2";
expected_attributes.size = 4;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "bint";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kBIGINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "bint2";
expected_attributes.size = 8;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kBIGINT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "txt";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTEXT;
expected_attributes.encoding_type = kENCODING_DICT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "txt2";
expected_attributes.size = 4;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTEXT;
expected_attributes.encoding_type = kENCODING_DICT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "f";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kFLOAT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "f2";
expected_attributes.size = 4;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kFLOAT;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "d";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kDOUBLE;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "d2";
expected_attributes.size = 8;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kDOUBLE;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dc";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kDECIMAL;
expected_attributes.precision = 18;
expected_attributes.scale = 6;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dc2";
expected_attributes.size = 8;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kDECIMAL;
expected_attributes.precision = 18;
expected_attributes.scale = 6;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "b";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kBOOLEAN;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "b2";
expected_attributes.size = 1;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kBOOLEAN;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dt";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kDATE;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "dt2";
expected_attributes.size = 8;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kDATE;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tm";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTIME;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tm2";
expected_attributes.size = 8;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTIME;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTIMESTAMP;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "tp2";
expected_attributes.size = 8;
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kTIMESTAMP;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "p";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "ls";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "poly";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
std::advance(it, 1);
column = *it;
expected_attributes = {};
expected_attributes.column_name = "mpoly";
expected_attributes.type = kARRAY;
expected_attributes.sub_type = kGEOMETRY;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, FixedEncodingForNonNumberOrTimeType) {
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 POINT ENCODING FIXED(8))");
queryAndAssertException(
query,
"Exception: col1: Fixed encoding is only supported for integer or time columns.");
}
TEST_P(CreateTableTest, DictEncodingNonTextType) {
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER ENCODING DICT)");
queryAndAssertException(query,
"Exception: col1: Dictionary encoding is only supported on "
"string or string array columns.");
}
TEST_P(CreateTableTest, CompressedEncodingNonWGS84GeoType) {
std::string query = getCreateTableQuery(
GetParam(), "test_table", "(col1 GEOMETRY(POINT, 900913) ENCODING COMPRESSED(32))");
queryAndAssertException(
query,
"Exception: col1: COMPRESSED encoding is only supported on WGS84 geo columns.");
}
TEST_P(CreateTableTest, CompressedEncodingNon32Bit) {
std::string query = getCreateTableQuery(
GetParam(), "test_table", "(col1 GEOMETRY(POINT, 4326) ENCODING COMPRESSED(16))");
queryAndAssertException(
query, "Exception: col1: only 32-bit COMPRESSED geo encoding is supported");
}
TEST_P(CreateTableTest, DaysEncodingNonDateType) { // Param for DECIMAL and NUMERIC
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 TIME ENCODING DAYS(16))");
queryAndAssertException(
query, "Exception: col1: Days encoding is only supported for DATE columns.");
}
TEST_P(CreateTableTest, NonEncodedDictArray) {
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 TEXT[] ENCODING NONE)");
queryAndAssertException(query,
"Exception: col1: Array of strings must be dictionary encoded. "
"Specify ENCODING DICT");
}
TEST_P(CreateTableTest, FixedLengthArrayOfVarLengthType) {
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 LINESTRING[5])");
queryAndAssertException(query, "Exception: col1: Unexpected fixed length array size");
}
TEST_P(CreateTableTest, UnsupportedTimestampPrecision) {
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 TIMESTAMP(10))");
queryAndAssertException(
query, "Exception: Only TIMESTAMP(n) where n = (0,3,6,9) are supported now.");
}
TEST_P(CreateTableTest, UnsupportedTimePrecision) {
std::string query = getCreateTableQuery(GetParam(), "test_table", "(col1 TIME(1))");
queryAndAssertException(query, "Exception: Only TIME(0) is supported now.");
}
TEST_P(CreateTableTest, NotNullColumnConstraint) {
sql(getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER NOT NULL)"));
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
auto column = catalog.getMetadataForColumn(table->tableId, "col1");
ASSERT_TRUE(column->columnType.get_notnull());
}
TEST_P(CreateTableTest, DuplicateColumnNames) {
std::string query =
getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER, col1 INTEGER)");
queryAndAssertException(query, "Exception: Column 'col1' defined more than once");
}
TEST_P(CreateTableTest, ExistingTableWithIfNotExists) {
sql(getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER)"));
sql(getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER)", true));
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 1);
auto column = catalog.getMetadataForColumn(table->tableId, "col1");
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "col1";
expected_attributes.size = 4;
expected_attributes.type = kINT;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, ExistingTableWithoutIfNotExists) {
std::string query = getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER)");
sql(query);
queryAndAssertException(
query, "Exception: Table or View with name \"test_table\" already exists.");
}
TEST_P(CreateTableTest, UnauthorizedUser) {
createTestUser();
login("test_user", "test_pass");
std::string query = getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER)");
if (GetParam() == ddl_utils::TableType::FOREIGN_TABLE) {
queryAndAssertException(query,
"Exception: Foreign table \"test_table\" will not be "
"created. User has no CREATE TABLE privileges.");
} else {
queryAndAssertException(query,
"Exception: Table test_table will not be created. User has "
"no create privileges.");
}
}
TEST_P(CreateTableTest, AuthorizedUser) {
createTestUser();
sql("GRANT CREATE TABLE ON DATABASE omnisci TO test_user;");
login("test_user", "test_pass");
sql(getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER)"));
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 1, 1);
auto column = catalog.getMetadataForColumn(table->tableId, "col1");
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "col1";
expected_attributes.size = 4;
expected_attributes.type = kINT;
assertColumnDetails(expected_attributes, column);
}
TEST_P(CreateTableTest, WithFragmentSizeOption) {
sql(getCreateTableQuery(
GetParam(), "test_table", "(col1 INTEGER)", {{"fragment_size", "10"}}));
auto& catalog = getCatalog();
auto table = catalog.getMetadataForTable("test_table", false);
assertTableDetails(table, GetParam(), "test_table", 1, 0, 10);
auto column = catalog.getMetadataForColumn(table->tableId, "col1");
ColumnAttributes expected_attributes{};
expected_attributes.column_name = "col1";
expected_attributes.size = 4;
expected_attributes.type = kINT;
assertColumnDetails(expected_attributes, column);
}
INSTANTIATE_TEST_SUITE_P(CreateAndDropTableDdlTest,
CreateTableTest,
testing::Values(ddl_utils::TableType::TABLE,
ddl_utils::TableType::FOREIGN_TABLE),
[](const auto& param_info) {
return ddl_utils::table_type_enum_to_string(param_info.param);
});
class NegativePrecisionOrDimensionTest
: public CreateAndDropTableDdlTest,
public testing::WithParamInterface<std::tuple<ddl_utils::TableType, std::string>> {
};
TEST_P(NegativePrecisionOrDimensionTest, NegativePrecisionOrDimension) {
const auto& [table_type, data_type] = GetParam();
try {
sql(getCreateTableQuery(table_type, "test_table", "(col1 " + data_type + "(-1))"));
FAIL() << "An exception should have been thrown for this test case.";
} catch (const TOmniSciException& e) {
if (table_type == ddl_utils::TableType::FOREIGN_TABLE) {
ASSERT_TRUE(e.error_msg.find("Exception: Parse failed") != std::string::npos);
} else {
ASSERT_EQ("Exception: No negative number in type definition.", e.error_msg);
}
}
}
INSTANTIATE_TEST_SUITE_P(
CreateTableTest,
NegativePrecisionOrDimensionTest,
testing::Combine(testing::Values(ddl_utils::TableType::TABLE,
ddl_utils::TableType::FOREIGN_TABLE),
testing::Values("CHAR", "VARCHAR", "DECIMAL", "NUMERIC")),
[](const auto& param_info) {
return ddl_utils::table_type_enum_to_string(std::get<0>(param_info.param)) + "_" +
std::get<1>(param_info.param);
});
class PrecisionAndScaleTest
: public CreateAndDropTableDdlTest,
public testing::WithParamInterface<std::tuple<ddl_utils::TableType, std::string>> {
};
TEST_P(PrecisionAndScaleTest, MaxPrecisionExceeded) {
const auto& [table_type, data_type] = GetParam();
std::string query =
getCreateTableQuery(table_type, "test_table", "(col1 " + data_type + "(20))");
queryAndAssertException(
query, "Exception: DECIMAL and NUMERIC precision cannot be larger than 19.");
}
TEST_P(PrecisionAndScaleTest, ScaleNotLessThanPrecision) {
const auto& [table_type, data_type] = GetParam();
std::string query =
getCreateTableQuery(table_type, "test_table", "(col1 " + data_type + "(10, 10))");
queryAndAssertException(
query, "Exception: DECIMAL and NUMERIC must have precision larger than scale.");
}
INSTANTIATE_TEST_SUITE_P(
CreateTableTest,
PrecisionAndScaleTest,
testing::Combine(testing::Values(ddl_utils::TableType::TABLE,
ddl_utils::TableType::FOREIGN_TABLE),
testing::Values("DECIMAL", "NUMERIC")),
[](const auto& param_info) {
return ddl_utils::table_type_enum_to_string(std::get<0>(param_info.param)) + "_" +
std::get<1>(param_info.param);
});
class CreateForeignTableTest : public CreateAndDropTableDdlTest {
void SetUp() override {
CreateAndDropTableDdlTest::SetUp();
sql("DROP FOREIGN TABLE IF EXISTS test_foreign_table;");
}
void TearDown() override {
g_enable_fsi = true;
sql("DROP FOREIGN TABLE IF EXISTS test_foreign_table;");
CreateAndDropTableDdlTest::TearDown();
}
};
TEST_F(CreateForeignTableTest, NonExistentServer) {
std::string query{
"CREATE FOREIGN TABLE test_foreign_table(col1 INTEGER) SERVER "
"non_existent_server;"};
queryAndAssertException(
query,
"Exception: Foreign server with name \"non_existent_server\" does not exist.");
}
TEST_F(CreateForeignTableTest, DefaultCsvFileServerName) {
sql("CREATE FOREIGN TABLE test_foreign_table(col1 INTEGER) "
"SERVER omnisci_local_csv WITH (file_path = '" +
getTestFilePath() + "');");
ASSERT_NE(nullptr, getCatalog().getMetadataForTable("test_foreign_table", false));
}
TEST_F(CreateForeignTableTest, DefaultParquetFileServerName) {
sql("CREATE FOREIGN TABLE test_foreign_table(col1 INTEGER) "
"SERVER omnisci_local_parquet WITH (file_path = '" +
getTestFilePath() + "');");
ASSERT_NE(nullptr, getCatalog().getMetadataForTable("test_foreign_table", false));
}
TEST_F(CreateForeignTableTest, InvalidTableOption) {
std::string query{
"CREATE FOREIGN TABLE test_foreign_table(col1 INTEGER) "
"SERVER omnisci_local_csv WITH (invalid_option = 'value');"};
queryAndAssertException(query,
"Exception: Invalid foreign table option \"INVALID_OPTION\".");
}
TEST_F(CreateForeignTableTest, WrongTableOptionCharacterSize) {
std::string query{
"CREATE FOREIGN TABLE test_foreign_table(col1 INTEGER) "
"SERVER omnisci_local_csv WITH (delimiter = ',,');"};
queryAndAssertException(query,
"Exception: Value of \"DELIMITER\" foreign table option has "
"the wrong number of characters. "
"Expected 1 character(s).");
}
TEST_F(CreateForeignTableTest, InvalidTableOptionBooleanValue) {
std::string query{
"CREATE FOREIGN TABLE test_foreign_table(col1 INTEGER) "
"SERVER omnisci_local_csv WITH (header = 'value');"};
queryAndAssertException(
query,
"Exception: Invalid boolean value specified for \"HEADER\" foreign table option. "
"Value must be either 'true' or 'false'.");
}
TEST_F(CreateForeignTableTest, FsiDisabled) {
g_enable_fsi = false;
std::string query = getCreateTableQuery(
ddl_utils::TableType::FOREIGN_TABLE, "test_foreign_table", "(col1 INTEGER)");
queryAndAssertException(query, "Exception: Syntax error at: FOREIGN");
}
class DropTableTest : public CreateAndDropTableDdlTest,
public testing::WithParamInterface<ddl_utils::TableType> {
protected:
void SetUp() override {
CreateAndDropTableDdlTest::SetUp();
sql(getCreateTableQuery(GetParam(), "test_table", "(col1 INTEGER)", true));
dropTestUser();
}
void TearDown() override {
dropTestUser();
CreateAndDropTableDdlTest::TearDown();
}
};
TEST_P(DropTableTest, ExistingTable) {
sql(getDropTableQuery(GetParam(), "test_table"));
ASSERT_EQ(nullptr, getCatalog().getMetadataForTable("test_table", false));
}
TEST_P(DropTableTest, NonExistingTableWithIfExists) {
sql(getDropTableQuery(GetParam(), "test_table"));
sql(getDropTableQuery(GetParam(), "test_table", true));
ASSERT_EQ(nullptr, getCatalog().getMetadataForTable("test_table", false));
}
TEST_P(DropTableTest, NonExistentTableWithoutIfExists) {
std::string query = getDropTableQuery(GetParam(), "test_table_2");
queryAndAssertException(query, "Exception: Table/View test_table_2 does not exist.");
}
TEST_P(DropTableTest, UnauthorizedUser) {
createTestUser();
login("test_user", "test_pass");
std::string query = getDropTableQuery(GetParam(), "test_table");
if (GetParam() == ddl_utils::TableType::FOREIGN_TABLE) {
queryAndAssertException(query,
"Exception: Foreign table \"test_table\" will not be "
"dropped. User has no DROP TABLE privileges.");
} else {
queryAndAssertException(query,
"Exception: Table test_table will not be dropped. User has "
"no proper privileges.");
}
loginAdmin();
sql(getDropTableQuery(GetParam(), "test_table"));
}
TEST_P(DropTableTest, AuthorizedUser) {
createTestUser();
sql("GRANT DROP ON TABLE test_table TO test_user;");
login("test_user", "test_pass");
sql(getDropTableQuery(GetParam(), "test_table"));
ASSERT_EQ(nullptr, getCatalog().getMetadataForTable("test_table", false));
}
TEST_P(CreateTableTest, InvalidSyntax) {
std::string query = getCreateTableQuery(
GetParam(), "test_table", "(str TEXT ENCODING DICT(8), f FLOAT i INTEGER)");
try {
sql(query);
FAIL() << "An exception should have been thrown for this test case.";
} catch (const TOmniSciException& e) {
if (GetParam() == ddl_utils::TableType::FOREIGN_TABLE) {
ASSERT_TRUE(e.error_msg.find("Exception: Parse failed") != std::string::npos);
} else {
ASSERT_EQ("Exception: Syntax error at: INTEGER", e.error_msg);
}
}
}
INSTANTIATE_TEST_SUITE_P(CreateAndDropTableDdlTest,
DropTableTest,
testing::Values(ddl_utils::TableType::TABLE,
ddl_utils::TableType::FOREIGN_TABLE),
[](const auto& param_info) {
if (param_info.param == ddl_utils::TableType::TABLE) {
return "Table";
}
if (param_info.param == ddl_utils::TableType::FOREIGN_TABLE) {
return "ForeignTable";
}
throw std::runtime_error{"Unexpected parameter type"};
});
class DropTableTypeMismatchTest : public CreateAndDropTableDdlTest {};
TEST_F(DropTableTypeMismatchTest, Table_DropCommandForOtherTableTypes) {
sql(getCreateTableQuery(ddl_utils::TableType::TABLE, "test_table", "(col1 INTEGER)"));
queryAndAssertException("DROP VIEW test_table;",
"Exception: test_table is a table. Use DROP TABLE.");
queryAndAssertException("DROP FOREIGN TABLE test_table;",
"Exception: test_table is a table. Use DROP TABLE.");
sql("DROP table test_table;");
ASSERT_EQ(nullptr, getCatalog().getMetadataForTable("test_table", false));
}
TEST_F(DropTableTypeMismatchTest, View_DropCommandForOtherTableTypes) {
sql(getCreateTableQuery(ddl_utils::TableType::TABLE, "test_table", "(col1 INTEGER)"));
sql("CREATE VIEW test_view AS SELECT * FROM test_table;");
queryAndAssertException("DROP table test_view;",
"Exception: test_view is a view. Use DROP VIEW.");
queryAndAssertException("DROP FOREIGN TABLE test_view;",
"Exception: test_view is a view. Use DROP VIEW.");
sql("DROP VIEW test_view;");
ASSERT_EQ(nullptr, getCatalog().getMetadataForTable("test_view", false));
}
TEST_F(DropTableTypeMismatchTest, ForeignTable_DropCommandForOtherTableTypes) {
sql(getCreateTableQuery(
ddl_utils::TableType::FOREIGN_TABLE, "test_foreign_table", "(col1 INTEGER)"));
queryAndAssertException(
"DROP table test_foreign_table;",
"Exception: test_foreign_table is a foreign table. Use DROP FOREIGN TABLE.");
queryAndAssertException(
"DROP VIEW test_foreign_table;",
"Exception: test_foreign_table is a foreign table. Use DROP FOREIGN TABLE.");
sql("DROP FOREIGN TABLE test_foreign_table;");
ASSERT_EQ(nullptr, getCatalog().getMetadataForTable("test_foreign_table", false));
}
class DropForeignTableTest : public CreateAndDropTableDdlTest {
protected:
void SetUp() override {
CreateAndDropTableDdlTest::SetUp();
sql("DROP FOREIGN TABLE IF EXISTS test_foreign_table;");
}
void TearDown() override {
g_enable_fsi = true;
sql("DROP FOREIGN TABLE IF EXISTS test_foreign_table;");
CreateAndDropTableDdlTest::TearDown();
}
};
TEST_F(DropForeignTableTest, FsiDisabled) {
sql(getCreateTableQuery(
ddl_utils::TableType::FOREIGN_TABLE, "test_foreign_table", "(col1 INTEGER)"));
g_enable_fsi = false;
queryAndAssertException(
"DROP table test_foreign_table;",
"Exception: test_foreign_table is a foreign table. Use DROP FOREIGN TABLE.");
}
int main(int argc, char** argv) {
g_enable_fsi = true;
TestHelpers::init_logger_stderr_only(argc, argv);
testing::InitGoogleTest(&argc, argv);
int err{0};
try {
err = RUN_ALL_TESTS();
} catch (const std::exception& e) {
LOG(ERROR) << e.what();
}
g_enable_fsi = false;
return err;
}
| {
"pile_set_name": "Github"
} |
<div class="page-header">
<h2><?= t('Add group member to "%s"', $group['name']) ?></h2>
</div>
<?php if (empty($users)): ?>
<p class="alert"><?= t('There is no user available.') ?></p>
<div class="form-actions">
<?= $this->url->link(t('Close this window'), 'GroupListController', 'index', array(), false, 'btn js-modal-close') ?>
</div>
<?php else: ?>
<form method="post" action="<?= $this->url->href('GroupListController', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('group_id', $values) ?>
<?= $this->form->label(t('User'), 'user_id') ?>
<?= $this->app->component('select-dropdown-autocomplete', array(
'name' => 'user_id',
'items' => $users,
'defaultValue' => isset($values['user_id']) ? $values['user_id'] : key($users),
)) ?>
<?= $this->modal->submitButtons() ?>
</form>
<?php endif ?>
| {
"pile_set_name": "Github"
} |
using Ooui.Forms.Extensions;
using System;
using System.ComponentModel;
using Xamarin.Forms;
namespace Ooui.Forms.Renderers
{
public class SearchBarRenderer : ViewRenderer<SearchBar, Div>
{
Input _searchBar;
Button _searchButton;
bool _disposed;
IElementController ElementController => Element as IElementController;
public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
{
var text = Element.Text;
if (text == null || text.Length == 0)
{
text = Element.Placeholder;
}
Size size;
if (text == null || text.Length == 0)
{
size = new Size(Element.FontSize * 0.25, Element.FontSize);
}
else
{
size = text.MeasureSize(Element.FontFamily, Element.FontSize, Element.FontAttributes, widthConstraint, heightConstraint);
}
size = new Size(size.Width, size.Height + Element.FontSize);
return new SizeRequest(size, size);
}
protected override void Dispose(bool disposing)
{
if (_disposed)
return;
_disposed = true;
if (disposing)
{
if (Control != null && _searchBar != null && _searchButton != null)
{
_searchBar.Change -= OnChange;
_searchButton.Click -= OnClick;
}
}
base.Dispose(disposing);
}
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
{
base.OnElementChanged(e);
if (e.NewElement == null)
return;
if (Control == null)
{
var p = new Div { ClassName = "input-group" };
var pb = new Span { ClassName = "input-group-btn" };
_searchButton = new Button { ClassName = "btn btn-secondary", Text = "Search" };
pb.AppendChild(_searchButton);
_searchBar = new Input
{
ClassName = "form-control",
Type = InputType.Text
};
p.AppendChild(_searchBar);
p.AppendChild(pb);
_searchBar.Change += OnChange;
_searchButton.Click += OnClick;
SetNativeControl(p);
}
UpdateText();
UpdateTextColor();
UpdatePlaceholder();
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == SearchBar.TextProperty.PropertyName)
UpdateText();
else if (e.PropertyName == SearchBar.PlaceholderProperty.PropertyName)
UpdatePlaceholder();
else if (e.PropertyName == SearchBar.PlaceholderColorProperty.PropertyName)
UpdatePlaceholder();
else if(e.PropertyName == SearchBar.TextColorProperty.PropertyName)
UpdateTextColor();
}
void UpdateText()
{
_searchBar.Value = Element.Text;
}
void UpdateTextColor()
{
var textColor = (Xamarin.Forms.Color)Element.GetValue(TimePicker.TextColorProperty);
Control.Style.Color = textColor.ToOouiColor(Xamarin.Forms.Color.Black);
}
void UpdatePlaceholder()
{
_searchBar.Placeholder = Element.Placeholder ?? string.Empty;
}
void OnChange(object sender, EventArgs eventArgs)
{
if (_searchBar.Value != Element.Text)
ElementController.SetValueFromRenderer(SearchBar.TextProperty, _searchBar.Value);
}
void OnClick(object sender, TargetEventArgs e)
{
Element.OnSearchButtonPressed();
}
}
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.