text
stringlengths 2
100k
| meta
dict |
---|---|
// Copyright 2019 Google LLC
//
// 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 storage
import (
"context"
"errors"
"fmt"
"time"
"google.golang.org/api/iterator"
raw "google.golang.org/api/storage/v1"
)
// HMACState is the state of the HMAC key.
type HMACState string
const (
// Active is the status for an active key that can be used to sign
// requests.
Active HMACState = "ACTIVE"
// Inactive is the status for an inactive key thus requests signed by
// this key will be denied.
Inactive HMACState = "INACTIVE"
// Deleted is the status for a key that is deleted.
// Once in this state the key cannot key cannot be recovered
// and does not count towards key limits. Deleted keys will be cleaned
// up later.
Deleted HMACState = "DELETED"
)
// HMACKey is the representation of a Google Cloud Storage HMAC key.
//
// HMAC keys are used to authenticate signed access to objects. To enable HMAC key
// authentication, please visit https://cloud.google.com/storage/docs/migrating.
//
// This type is EXPERIMENTAL and subject to change or removal without notice.
type HMACKey struct {
// The HMAC's secret key.
Secret string
// AccessID is the ID of the HMAC key.
AccessID string
// Etag is the HTTP/1.1 Entity tag.
Etag string
// ID is the ID of the HMAC key, including the ProjectID and AccessID.
ID string
// ProjectID is the ID of the project that owns the
// service account to which the key authenticates.
ProjectID string
// ServiceAccountEmail is the email address
// of the key's associated service account.
ServiceAccountEmail string
// CreatedTime is the creation time of the HMAC key.
CreatedTime time.Time
// UpdatedTime is the last modification time of the HMAC key metadata.
UpdatedTime time.Time
// State is the state of the HMAC key.
// It can be one of StateActive, StateInactive or StateDeleted.
State HMACState
}
// HMACKeyHandle helps provide access and management for HMAC keys.
//
// This type is EXPERIMENTAL and subject to change or removal without notice.
type HMACKeyHandle struct {
projectID string
accessID string
raw *raw.ProjectsHmacKeysService
}
// HMACKeyHandle creates a handle that will be used for HMACKey operations.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (c *Client) HMACKeyHandle(projectID, accessID string) *HMACKeyHandle {
return &HMACKeyHandle{
projectID: projectID,
accessID: accessID,
raw: raw.NewProjectsHmacKeysService(c.raw),
}
}
// Get invokes an RPC to retrieve the HMAC key referenced by the
// HMACKeyHandle's accessID.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (hkh *HMACKeyHandle) Get(ctx context.Context) (*HMACKey, error) {
call := hkh.raw.Get(hkh.projectID, hkh.accessID)
setClientHeader(call.Header())
var metadata *raw.HmacKeyMetadata
var err error
err = runWithRetry(ctx, func() error {
metadata, err = call.Context(ctx).Do()
return err
})
if err != nil {
return nil, err
}
hkPb := &raw.HmacKey{
Metadata: metadata,
}
return pbHmacKeyToHMACKey(hkPb, false)
}
// Delete invokes an RPC to delete the key referenced by accessID, on Google Cloud Storage.
// Only inactive HMAC keys can be deleted.
// After deletion, a key cannot be used to authenticate requests.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (hkh *HMACKeyHandle) Delete(ctx context.Context) error {
delCall := hkh.raw.Delete(hkh.projectID, hkh.accessID)
setClientHeader(delCall.Header())
return runWithRetry(ctx, func() error {
return delCall.Context(ctx).Do()
})
}
func pbHmacKeyToHMACKey(pb *raw.HmacKey, updatedTimeCanBeNil bool) (*HMACKey, error) {
pbmd := pb.Metadata
if pbmd == nil {
return nil, errors.New("field Metadata cannot be nil")
}
createdTime, err := time.Parse(time.RFC3339, pbmd.TimeCreated)
if err != nil {
return nil, fmt.Errorf("field CreatedTime: %v", err)
}
updatedTime, err := time.Parse(time.RFC3339, pbmd.Updated)
if err != nil && !updatedTimeCanBeNil {
return nil, fmt.Errorf("field UpdatedTime: %v", err)
}
hmk := &HMACKey{
AccessID: pbmd.AccessId,
Secret: pb.Secret,
Etag: pbmd.Etag,
ID: pbmd.Id,
State: HMACState(pbmd.State),
ProjectID: pbmd.ProjectId,
CreatedTime: createdTime,
UpdatedTime: updatedTime,
ServiceAccountEmail: pbmd.ServiceAccountEmail,
}
return hmk, nil
}
// CreateHMACKey invokes an RPC for Google Cloud Storage to create a new HMACKey.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (c *Client) CreateHMACKey(ctx context.Context, projectID, serviceAccountEmail string) (*HMACKey, error) {
if projectID == "" {
return nil, errors.New("storage: expecting a non-blank projectID")
}
if serviceAccountEmail == "" {
return nil, errors.New("storage: expecting a non-blank service account email")
}
svc := raw.NewProjectsHmacKeysService(c.raw)
call := svc.Create(projectID, serviceAccountEmail)
setClientHeader(call.Header())
var hkPb *raw.HmacKey
var err error
err = runWithRetry(ctx, func() error {
hkPb, err = call.Context(ctx).Do()
return err
})
if err != nil {
return nil, err
}
return pbHmacKeyToHMACKey(hkPb, true)
}
// HMACKeyAttrsToUpdate defines the attributes of an HMACKey that will be updated.
//
// This type is EXPERIMENTAL and subject to change or removal without notice.
type HMACKeyAttrsToUpdate struct {
// State is required and must be either StateActive or StateInactive.
State HMACState
// Etag is an optional field and it is the HTTP/1.1 Entity tag.
Etag string
}
// Update mutates the HMACKey referred to by accessID.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (h *HMACKeyHandle) Update(ctx context.Context, au HMACKeyAttrsToUpdate) (*HMACKey, error) {
if au.State != Active && au.State != Inactive {
return nil, fmt.Errorf("storage: invalid state %q for update, must be either %q or %q", au.State, Active, Inactive)
}
call := h.raw.Update(h.projectID, h.accessID, &raw.HmacKeyMetadata{
Etag: au.Etag,
State: string(au.State),
})
setClientHeader(call.Header())
var metadata *raw.HmacKeyMetadata
var err error
err = runWithRetry(ctx, func() error {
metadata, err = call.Context(ctx).Do()
return err
})
if err != nil {
return nil, err
}
hkPb := &raw.HmacKey{
Metadata: metadata,
}
return pbHmacKeyToHMACKey(hkPb, false)
}
// An HMACKeysIterator is an iterator over HMACKeys.
//
// This type is EXPERIMENTAL and subject to change or removal without notice.
type HMACKeysIterator struct {
ctx context.Context
raw *raw.ProjectsHmacKeysService
projectID string
hmacKeys []*HMACKey
pageInfo *iterator.PageInfo
nextFunc func() error
index int
}
// ListHMACKeys returns an iterator for listing HMACKeys.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (c *Client) ListHMACKeys(ctx context.Context, projectID string) *HMACKeysIterator {
it := &HMACKeysIterator{
ctx: ctx,
raw: raw.NewProjectsHmacKeysService(c.raw),
projectID: projectID,
}
it.pageInfo, it.nextFunc = iterator.NewPageInfo(
it.fetch,
func() int { return len(it.hmacKeys) - it.index },
func() interface{} {
prev := it.hmacKeys
it.hmacKeys = it.hmacKeys[:0]
it.index = 0
return prev
})
return it
}
// Next returns the next result. Its second return value is iterator.Done if
// there are no more results. Once Next returns iterator.Done, all subsequent
// calls will return iterator.Done.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (it *HMACKeysIterator) Next() (*HMACKey, error) {
if err := it.nextFunc(); err != nil {
return nil, err
}
key := it.hmacKeys[it.index]
it.index++
return key, nil
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
//
// This method is EXPERIMENTAL and subject to change or removal without notice.
func (it *HMACKeysIterator) PageInfo() *iterator.PageInfo { return it.pageInfo }
func (it *HMACKeysIterator) fetch(pageSize int, pageToken string) (token string, err error) {
call := it.raw.List(it.projectID)
setClientHeader(call.Header())
call = call.PageToken(pageToken)
// By default we'll also show deleted keys and then
// let users filter on their own.
call = call.ShowDeletedKeys(true)
if pageSize > 0 {
call = call.MaxResults(int64(pageSize))
}
ctx := it.ctx
var resp *raw.HmacKeysMetadata
err = runWithRetry(it.ctx, func() error {
resp, err = call.Context(ctx).Do()
return err
})
if err != nil {
return "", err
}
for _, metadata := range resp.Items {
hkPb := &raw.HmacKey{
Metadata: metadata,
}
hkey, err := pbHmacKeyToHMACKey(hkPb, true)
if err != nil {
return "", err
}
it.hmacKeys = append(it.hmacKeys, hkey)
}
return resp.NextPageToken, nil
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.server;
import android.os.ParcelUuid;
import android.util.Log;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
class BluetoothDeviceProperties {
private static final String TAG = "BluetoothDeviceProperties";
private final HashMap<String, Map<String, String>> mPropertiesMap;
private final BluetoothService mService;
BluetoothDeviceProperties(BluetoothService service) {
mPropertiesMap = new HashMap<String, Map<String, String>>();
mService = service;
}
Map<String, String> addProperties(String address, String[] properties) {
/*
* We get a DeviceFound signal every time RSSI changes or name changes.
* Don't create a new Map object every time.
*/
Map<String, String> propertyValues;
synchronized(mPropertiesMap) {
propertyValues = mPropertiesMap.get(address);
if (propertyValues == null) {
propertyValues = new HashMap<String, String>();
}
for (int i = 0; i < properties.length; i++) {
String name = properties[i];
String newValue = null;
int len;
if (name == null) {
Log.e(TAG, "Error: Remote Device Property at index "
+ i + " is null");
continue;
}
if (name.equals("UUIDs") || name.equals("Nodes")) {
StringBuilder str = new StringBuilder();
len = Integer.valueOf(properties[++i]);
for (int j = 0; j < len; j++) {
str.append(properties[++i]);
str.append(",");
}
if (len > 0) {
newValue = str.toString();
}
} else {
newValue = properties[++i];
}
propertyValues.put(name, newValue);
}
mPropertiesMap.put(address, propertyValues);
}
// We have added a new remote device or updated its properties.
// Also update the serviceChannel cache.
mService.updateDeviceServiceChannelCache(address);
return propertyValues;
}
void setProperty(String address, String name, String value) {
synchronized(mPropertiesMap) {
Map <String, String> propVal = mPropertiesMap.get(address);
if (propVal != null) {
propVal.put(name, value);
mPropertiesMap.put(address, propVal);
} else {
Log.e(TAG, "setRemoteDeviceProperty for a device not in cache:" + address);
}
}
}
boolean isInCache(String address) {
synchronized (mPropertiesMap) {
return (mPropertiesMap.get(address) != null);
}
}
boolean isEmpty() {
synchronized (mPropertiesMap) {
return mPropertiesMap.isEmpty();
}
}
Set<String> keySet() {
synchronized (mPropertiesMap) {
return mPropertiesMap.keySet();
}
}
String getProperty(String address, String property) {
synchronized(mPropertiesMap) {
Map<String, String> properties = mPropertiesMap.get(address);
if (properties != null) {
return properties.get(property);
} else {
// Query for remote device properties, again.
// We will need to reload the cache when we switch Bluetooth on / off
// or if we crash.
properties = updateCache(address);
if (properties != null) {
return properties.get(property);
}
}
}
Log.e(TAG, "getRemoteDeviceProperty: " + property + " not present: " + address);
return null;
}
Map<String, String> updateCache(String address) {
String[] propValues = mService.getRemoteDeviceProperties(address);
if (propValues != null) {
return addProperties(address, propValues);
}
return null;
}
}
|
{
"pile_set_name": "Github"
}
|
import * as React from 'react';
import { withComponents } from '@devexpress/dx-react-core';
import { TableRowDetail as TableRowDetailBase } from '@devexpress/dx-react-grid';
import { TableDetailToggleCell as ToggleCell } from '../templates/table-detail-toggle-cell';
import { TableDetailCell as Cell } from '../templates/table-detail-cell';
import { TableRow as Row } from '../templates/table-row';
const TableRowDetailWithWidth = props => <TableRowDetailBase toggleColumnWidth={40} {...props} />;
TableRowDetailWithWidth.components = TableRowDetailBase.components;
export const TableRowDetail = withComponents({ Row, Cell, ToggleCell })(TableRowDetailWithWidth);
TableRowDetail.COLUMN_TYPE = TableRowDetailBase.COLUMN_TYPE;
TableRowDetail.ROW_TYPE = TableRowDetailBase.ROW_TYPE;
|
{
"pile_set_name": "Github"
}
|
#! /bin/sh
. ../../testenv.sh
GHDL_STD_FLAGS=--std=08
synth pkg.vhdl foo.vhdl -e > syn_foo.vhdl
analyze pkg.vhdl syn_foo.vhdl
clean
echo "Test successful"
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- index.qdoc -->
<head>
<title>Property Browser</title>
<link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
</tr></table><h1 class="title">Property Browser<br /><span class="subtitle"></span>
</h1>
<a name="description"></a>
<h2>Description</h2>
<p>A property browser framework enabling the user to edit a set of properties.</p>
<p>The framework provides a browser widget that displays the given properties with labels and corresponding editing widgets (e.g. line edits or comboboxes). The various types of editing widgets are provided by the framework's editor factories: For each property type, the framework provides a property manager (e.g. <a href="qtintpropertymanager.html">QtIntPropertyManager</a> and <a href="qtstringpropertymanager.html">QtStringPropertyManager</a>) which can be associated with the preferred editor factory (e.g. <a href="qtspinboxfactory.html">QtSpinBoxFactory</a> and <a href="qtlineeditfactory.html">QtLineEditFactory</a>). The framework also provides a variant based property type with corresponding variant manager and factory. Finally, the framework provides three ready-made implementations of the browser widget: <a href="qttreepropertybrowser.html">QtTreePropertyBrowser</a>, <a href="qtbuttonpropertybrowser.html">QtButtonPropertyBrowser</a> and <a href="qtgroupboxpropertybrowser.html">QtGroupBoxPropertyBrowser</a>.</p>
<a name="classes"></a>
<h2>Classes</h2>
<ul>
<li><a href="qtproperty.html">QtProperty</a></li>
<li><a href="qtvariantproperty.html">QtVariantProperty</a></li>
<li><a href="qtabstractpropertymanager.html">QtAbstractPropertyManager</a></li>
<li><a href="qtboolpropertymanager.html">QtBoolPropertyManager</a></li>
<li><a href="qtcolorpropertymanager.html">QtColorPropertyManager</a></li>
<li><a href="qtcursorpropertymanager.html">QtCursorPropertyManager</a></li>
<li><a href="qtdatepropertymanager.html">QtDatePropertyManager</a></li>
<li><a href="qtdatetimepropertymanager.html">QtDateTimePropertyManager</a></li>
<li><a href="qtdoublepropertymanager.html">QtDoublePropertyManager</a></li>
<li><a href="qtenumpropertymanager.html">QtEnumPropertyManager</a></li>
<li><a href="qtflagpropertymanager.html">QtFlagPropertyManager</a></li>
<li><a href="qtfontpropertymanager.html">QtFontPropertyManager</a></li>
<li><a href="qtgrouppropertymanager.html">QtGroupPropertyManager</a></li>
<li><a href="qtintpropertymanager.html">QtIntPropertyManager</a></li>
<li><a href="qtkeysequencepropertymanager.html">QtKeySequencePropertyManager</a></li>
<li><a href="qtcharpropertymanager.html">QtCharPropertyManager</a></li>
<li><a href="qtlocalepropertymanager.html">QtLocalePropertyManager</a></li>
<li><a href="qtpointpropertymanager.html">QtPointPropertyManager</a></li>
<li><a href="qtpointfpropertymanager.html">QtPointFPropertyManager</a></li>
<li><a href="qtrectpropertymanager.html">QtRectPropertyManager</a></li>
<li><a href="qtrectfpropertymanager.html">QtRectFPropertyManager</a></li>
<li><a href="qtsizepropertymanager.html">QtSizePropertyManager</a></li>
<li><a href="qtsizefpropertymanager.html">QtSizeFPropertyManager</a></li>
<li><a href="qtsizepolicypropertymanager.html">QtSizePolicyPropertyManager</a></li>
<li><a href="qtstringpropertymanager.html">QtStringPropertyManager</a></li>
<li><a href="qttimepropertymanager.html">QtTimePropertyManager</a></li>
<li><a href="qtvariantpropertymanager.html">QtVariantPropertyManager</a></li>
<li><a href="qtabstracteditorfactorybase.html">QtAbstractEditorFactoryBase</a></li>
<li><a href="qtabstracteditorfactory.html">QtAbstractEditorFactory</a></li>
<li><a href="qtcheckboxfactory.html">QtCheckBoxFactory</a></li>
<li><a href="qtdateeditfactory.html">QtDateEditFactory</a></li>
<li><a href="qtdatetimeeditfactory.html">QtDateTimeEditFactory</a></li>
<li><a href="qtdoublespinboxfactory.html">QtDoubleSpinBoxFactory</a></li>
<li><a href="qtenumeditorfactory.html">QtEnumEditorFactory</a></li>
<li><a href="qtlineeditfactory.html">QtLineEditFactory</a></li>
<li><a href="qtscrollbarfactory.html">QtScrollBarFactory</a></li>
<li><a href="qtsliderfactory.html">QtSliderFactory</a></li>
<li><a href="qtspinboxfactory.html">QtSpinBoxFactory</a></li>
<li><a href="qttimeeditfactory.html">QtTimeEditFactory</a></li>
<li><a href="qtcoloreditorfactory.html">QtColorEditorFactory</a></li>
<li><a href="qtfonteditorfactory.html">QtFontEditorFactory</a></li>
<li><a href="qtvarianteditorfactory.html">QtVariantEditorFactory</a></li>
<li><a href="qtbrowseritem.html">QtBrowserItem</a></li>
<li><a href="qtabstractpropertybrowser.html">QtAbstractPropertyBrowser</a></li>
<li><a href="qtbuttonpropertybrowser.html">QtButtonPropertyBrowser</a></li>
<li><a href="qtgroupboxpropertybrowser.html">QtGroupBoxPropertyBrowser</a></li>
<li><a href="qttreepropertybrowser.html">QtTreePropertyBrowser</a></li>
</ul>
<a name="examples"></a>
<h2>Examples</h2>
<ul>
<li><a href="qtpropertybrowser-example-simple.html">Simple</a></li>
<li><a href="qtpropertybrowser-example-demo.html">Demo</a></li>
<li><a href="qtpropertybrowser-example-canvas-typed.html">Canvas Typed</a></li>
<li><a href="qtpropertybrowser-example-canvas-variant.html">Canvas Variant</a></li>
<li><a href="qtpropertybrowser-example-extension.html">Extension</a></li>
<li><a href="qtpropertybrowser-example-decoration.html">Decoration</a></li>
<li><a href="qtpropertybrowser-example-object-controller.html">Object Controller</a></li>
</ul>
<a name="tested-platforms"></a>
<h2>Tested platforms</h2>
<ul>
<li>Qt 4.4, 4.5 / Windows XP / MSVC.NET 2008</li>
<li>Qt 4.4, 4.5 / Linux / gcc</li>
<li>Qt 4.4, 4.5 / MacOS X 10.5 / gcc</li>
</ul>
<a name="screenshots"></a>
<h2>Screenshots</h2>
<p align="center"><img src="images/qttreepropertybrowser.png" /></p><p align="center"><img src="images/qtbuttonpropertybrowser.png" /></p><p align="center"><img src="images/qtgroupboxpropertybrowser.png" /></p><p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
</tr></table></div></address></body>
</html>
|
{
"pile_set_name": "Github"
}
|
"""Provides functions to prefetch tensors to feed into models."""
import tensorflow as tf
def prefetch(tensor_dict, capacity):
"""Creates a prefetch queue for tensors.
Creates a FIFO queue to asynchronously enqueue tensor_dicts and returns a
dequeue op that evaluates to a tensor_dict. This function is useful in
prefetching preprocessed tensors so that the data is readily available for
consumers.
Example input pipeline when you don't need batching:
----------------------------------------------------
key, string_tensor = slim.parallel_reader.parallel_read(...)
tensor_dict = decoder.decode(string_tensor)
tensor_dict = preprocessor.preprocess(tensor_dict, ...)
prefetch_queue = prefetcher.prefetch(tensor_dict, capacity=20)
tensor_dict = prefetch_queue.dequeue()
outputs = Model(tensor_dict)
...
----------------------------------------------------
For input pipelines with batching, refer to core/batcher.py
Args:
tensor_dict: a dictionary of tensors to prefetch.
capacity: the size of the prefetch queue.
Returns:
a FIFO prefetcher queue
"""
names = list(tensor_dict.keys())
dtypes = [t.dtype for t in tensor_dict.values()]
shapes = [t.get_shape() for t in tensor_dict.values()]
prefetch_queue = tf.PaddingFIFOQueue(capacity, dtypes=dtypes,
shapes=shapes,
names=names,
name='prefetch_queue')
enqueue_op = prefetch_queue.enqueue(tensor_dict)
tf.train.queue_runner.add_queue_runner(tf.train.queue_runner.QueueRunner(
prefetch_queue, [enqueue_op]))
tf.summary.scalar('queue/%s/fraction_of_%d_full' % (prefetch_queue.name,
capacity),
tf.to_float(prefetch_queue.size()) * (1. / capacity))
return prefetch_queue
|
{
"pile_set_name": "Github"
}
|
# RUN: yaml2obj %s > %t
# RUN: llvm-objcopy %t %t2
# RUN: llvm-readobj --file-headers --sections %t2 | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2MSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_ALLOC ]
AddressAlign: 0x0000000000000010
Size: 64
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x0000000000000010
Content: "00000000"
# CHECK: Class: 32-bit
# CHECK: DataEncoding: BigEndian
# CHECK: Name: .bss
# CHECK: Name: .text
# CHECK: Name: .shstrtab
|
{
"pile_set_name": "Github"
}
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Protocol](./puppeteer.protocol.md) > [DOMSnapshot](./puppeteer.protocol.domsnapshot.md) > [TextBoxSnapshot](./puppeteer.protocol.domsnapshot.textboxsnapshot.md) > [bounds](./puppeteer.protocol.domsnapshot.textboxsnapshot.bounds.md)
## Protocol.DOMSnapshot.TextBoxSnapshot.bounds property
The absolute position bounding box.
<b>Signature:</b>
```typescript
bounds: Rectangle[];
```
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Autogenerated by Thrift Compiler (0.12.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Serving_getUtter_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'request',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Data',
),
);
/**
* @var \Data
*/
public $request = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['request'])) {
$this->request = $vals['request'];
}
}
}
public function getName()
{
return 'Serving_getUtter_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRUCT) {
$this->request = new \Data();
$xfer += $this->request->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Serving_getUtter_args');
if ($this->request !== null) {
if (!is_object($this->request)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('request', TType::STRUCT, 1);
$xfer += $this->request->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}
|
{
"pile_set_name": "Github"
}
|
/** @file
Support functions for UEFI protocol notification infrastructure.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "PiSmmCore.h"
/**
Signal event for every protocol in protocol entry.
@param Prot Protocol interface
**/
VOID
SmmNotifyProtocol (
IN PROTOCOL_INTERFACE *Prot
)
{
PROTOCOL_ENTRY *ProtEntry;
PROTOCOL_NOTIFY *ProtNotify;
LIST_ENTRY *Link;
ProtEntry = Prot->Protocol;
for (Link=ProtEntry->Notify.ForwardLink; Link != &ProtEntry->Notify; Link=Link->ForwardLink) {
ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE);
ProtNotify->Function (&ProtEntry->ProtocolID, Prot->Interface, Prot->Handle);
}
}
/**
Removes Protocol from the protocol list (but not the handle list).
@param Handle The handle to remove protocol on.
@param Protocol GUID of the protocol to be moved
@param Interface The interface of the protocol
@return Protocol Entry
**/
PROTOCOL_INTERFACE *
SmmRemoveInterfaceFromProtocol (
IN IHANDLE *Handle,
IN EFI_GUID *Protocol,
IN VOID *Interface
)
{
PROTOCOL_INTERFACE *Prot;
PROTOCOL_NOTIFY *ProtNotify;
PROTOCOL_ENTRY *ProtEntry;
LIST_ENTRY *Link;
Prot = SmmFindProtocolInterface (Handle, Protocol, Interface);
if (Prot != NULL) {
ProtEntry = Prot->Protocol;
//
// If there's a protocol notify location pointing to this entry, back it up one
//
for(Link = ProtEntry->Notify.ForwardLink; Link != &ProtEntry->Notify; Link=Link->ForwardLink) {
ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE);
if (ProtNotify->Position == &Prot->ByProtocol) {
ProtNotify->Position = Prot->ByProtocol.BackLink;
}
}
//
// Remove the protocol interface entry
//
RemoveEntryList (&Prot->ByProtocol);
}
return Prot;
}
/**
Add a new protocol notification record for the request protocol.
@param Protocol The requested protocol to add the notify
registration
@param Function Points to the notification function
@param Registration Returns the registration record
@retval EFI_SUCCESS Successfully returned the registration record
that has been added or unhooked
@retval EFI_INVALID_PARAMETER Protocol is NULL or Registration is NULL
@retval EFI_OUT_OF_RESOURCES Not enough memory resource to finish the request
@retval EFI_NOT_FOUND If the registration is not found when Function == NULL
**/
EFI_STATUS
EFIAPI
SmmRegisterProtocolNotify (
IN CONST EFI_GUID *Protocol,
IN EFI_SMM_NOTIFY_FN Function,
OUT VOID **Registration
)
{
PROTOCOL_ENTRY *ProtEntry;
PROTOCOL_NOTIFY *ProtNotify;
LIST_ENTRY *Link;
EFI_STATUS Status;
if (Protocol == NULL || Registration == NULL) {
return EFI_INVALID_PARAMETER;
}
if (Function == NULL) {
//
// Get the protocol entry per Protocol
//
ProtEntry = SmmFindProtocolEntry ((EFI_GUID *) Protocol, FALSE);
if (ProtEntry != NULL) {
ProtNotify = (PROTOCOL_NOTIFY * )*Registration;
for (Link = ProtEntry->Notify.ForwardLink;
Link != &ProtEntry->Notify;
Link = Link->ForwardLink) {
//
// Compare the notification record
//
if (ProtNotify == (CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE))){
//
// If Registration is an existing registration, then unhook it
//
ProtNotify->Signature = 0;
RemoveEntryList (&ProtNotify->Link);
FreePool (ProtNotify);
return EFI_SUCCESS;
}
}
}
//
// If the registration is not found
//
return EFI_NOT_FOUND;
}
ProtNotify = NULL;
//
// Get the protocol entry to add the notification too
//
ProtEntry = SmmFindProtocolEntry ((EFI_GUID *) Protocol, TRUE);
if (ProtEntry != NULL) {
//
// Find whether notification already exist
//
for (Link = ProtEntry->Notify.ForwardLink;
Link != &ProtEntry->Notify;
Link = Link->ForwardLink) {
ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE);
if (CompareGuid (&ProtNotify->Protocol->ProtocolID, Protocol) &&
(ProtNotify->Function == Function)) {
//
// Notification already exist
//
*Registration = ProtNotify;
return EFI_SUCCESS;
}
}
//
// Allocate a new notification record
//
ProtNotify = AllocatePool (sizeof(PROTOCOL_NOTIFY));
if (ProtNotify != NULL) {
ProtNotify->Signature = PROTOCOL_NOTIFY_SIGNATURE;
ProtNotify->Protocol = ProtEntry;
ProtNotify->Function = Function;
//
// Start at the ending
//
ProtNotify->Position = ProtEntry->Protocols.BackLink;
InsertTailList (&ProtEntry->Notify, &ProtNotify->Link);
}
}
//
// Done. If we have a protocol notify entry, then return it.
// Otherwise, we must have run out of resources trying to add one
//
Status = EFI_OUT_OF_RESOURCES;
if (ProtNotify != NULL) {
*Registration = ProtNotify;
Status = EFI_SUCCESS;
}
return Status;
}
|
{
"pile_set_name": "Github"
}
|
Copyright (c) 2015-2017 Valve Corporation
Copyright (c) 2015-2017 LunarG, 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.
====================
Copyright (c) 2014-2016 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and/or associated documentation files (the "Materials"), to
deal in the Materials without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Materials, and to permit persons to whom the Materials are
furnished to do so, subject to the following conditions:
The above copyright notice(s) and this permission notice shall be included in
all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
USE OR OTHER DEALINGS IN THE MATERIALS.
====================
Copyright 2015 The Android Open Source Project
Copyright (C) 2015 Valve Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the names of Kitware, Inc., the Insight Software Consortium,
nor the names of their 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.
====================
Copyright (c) 2011 Fredrik Höglund <[email protected]>
Copyright (c) 2008 Helio Chissini de Castro, <[email protected]>
Copyright (c) 2007 Matthias Kretz, <[email protected]>
Redistribution and use is allowed according to the terms of the BSD license.
====================
Copyright (c) 2015-2016 The Khronos Group Inc.
Copyright (c) 2014-2016 Valve Corporation
Copyright (c) 2015-2016 LunarG, Inc.
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
====================
Copyright Kevlin Henney, 1997, 2003, 2012. All rights reserved.
Copyright (c) 2015 The Khronos Group Inc.
Copyright (c) 2015 Valve Corporation
Copyright (c) 2015 LunarG, Inc.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that this copyright and permissions notice appear in all copies and
derivatives.
This software is supplied "as is" without express or implied warranty.
====================
Copyright (c) 2015-2016 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
====================
Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
====================
Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
Copyright (c) 2014, Valve Software. All rights reserved.
*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of NVIDIA CORPORATION nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================
Copyright 2007-2009 Kitware, Inc.
Copyright 2007-2008 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org>
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright_cmake.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
====================
RenderDoc License
RenderDoc is licensed under the MIT License:
The MIT License (MIT)
Copyright (c) 2015-2016 Baldur Karlsson
Copyright (c) 2014 Crytek
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
RenderDoc also uses several external libraries and components which include their own
licenses, linked below:
http://codefromthe70s.org/mhook23.aspx
mhook distributed under the MIT license. Copyright Marton Anka 2007-2012,
portions Copyright 2007 Matt Conover.
http://www.codeproject.com/Articles/23746/TreeView-with-Columns
http://www.codeproject.com/info/cpol10.aspx
TreeView with Columns distributed under the CPOL license.
http://dockpanelsuite.com/
Dock Panel Suite distributed under the MIT license. Copyright 2007 Weifen Luo.
http://www.famfamfam.com/lab/icons/silk/
famfamfam silk icons distributed under Creative Commons Attribution 2.5. Authored by
Mark James.
http://scintillanet.codeplex.com/
ScintillaNET (and Scintilla) distributed under the MIT license. ScintillaNET Copyright
2002-2006 Garrett Serack, Scintilla Copyright 1998-2006 Neil Hodgson.
https://code.google.com/p/google-breakpad/
Google Breakpad distributed under the New BSD License (3 Clause). Copyright 2006
Google Inc.
https://code.google.com/p/miniz/
miniz released to the Public Domain by Rich Geldreich.
https://github.com/openexr/openexr/tree/master/IlmBase/Half
ILM's half implementation distributed under BSD license. Copyright 2002 Industrial Light
& Magic, a division of Lucas Digital Ltd. LLC
https://code.google.com/p/jpeg-compressor/
jpeg-compressor released to the Public Domain by Rich Geldreich.
https://code.google.com/p/lz4/
lz4 distributed under the New BSD License (3 Clause). Copyright 2013 Yann Collet.
https://github.com/nothings/stb
released to the Public Domain by Sean Barrett.
https://github.com/adobe-fonts/source-code-pro
distributed under the SIL Open Font License 1.1. Copyright 2010, 2012 Adobe Systems
Incorporated.
http://ironpython.net/
IronPython distributed under the Apache 2.0 License. Copyright IronPython Team.
https://github.com/syoyo/tinyexr
tinyexr distributed under the New BSD License (3 Clause). Copyright 2014 Syoyo Fujita.
https://github.com/KhronosGroup/glslang
glslang distributed under the New BSD License (3 Clause). Copyright 2002-2005 3Dlabs Inc.
Ltd. 2012-2013 LunarG, Inc.
http://www.qt.io/
Qt distributed under the GNU Lesser General Public License (LGPL) version 2.1. Copyright
2015 The Qt Company Ltd.
====================
Simple DirectMedia Layer 2.0
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
====================
Qt License
GENERAL
-------
Qt is available under a commercial license with various pricing models and
packages that meet a variety of needs. Commercial Qt license keeps your
code proprietary where only you can control and monetize on your end
product's development, user experience and distribution. You also get great
perks like additional functionality, productivity enhancing tools,
world-class support and a close strategic relationship with The Qt Company
to make sure your product and development goals are met.
Qt has been created under the belief of open development and providing
freedom and choice to developers. To support that, The Qt Company also
licenses Qt under open source licenses, where most of the functionality is
available under LGPLv3 or LGPLv2.1. It should be noted that some components
are available only under LGPLv3. In order to preserve the true meaning of
open development and uphold the spirit of free software, it is imperative
that the rules and regulations of open source licenses are followed. If you
use Qt under open-source licenses, you need to make sure that you comply
with all the licenses of the components you use.
Qt also contains some 3rd party components that are available under
different open-source licenses. Please refer to the documentation for more
details on 3rd party licenses used in Qt.
GPLv3 and LGPLv3
----------------
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt.io/licensing
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 3, which supplements GNU General
Public License Version 3. Both of the licenses are displayed below.
-------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the
GNU General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort
to ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this
license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of
the Library contained in the Combined Work and reverse engineering for
debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this
license document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of
this License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with
the Library. A suitable mechanism is one that (a) uses at run
time a copy of the Library already present on the user's
computer system, and (b) will operate properly with a modified
version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would
otherwise be required to provide such information under section 6
of the GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option
4d0, the Installation Information must accompany the Minimal
Corresponding Source and Corresponding Application Code. If you
use option 4d1, you must provide the Installation Information in
the manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library
side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of
it is a work based on the Library, and explaining where to find
the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
as you received it specifies that a certain numbered version of the
GNU Lesser General Public License "or any later version" applies to
it, you have the option of following the terms and conditions either
of that published version or of any later version published by the
Free Software Foundation. If the Library as you received it does not
specify a version number of the GNU Lesser General Public License,
you may choose any version of the GNU Lesser General Public License
ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the Library.
LGPLv2.1
--------
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt.io/licensing
You may use, distribute and copy applicable parts of the Qt GUI Toolkit under
the terms of GNU Lesser General Public License version 2.1, which is displayed
below.
-------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
|
{
"pile_set_name": "Github"
}
|
<!-- ...................................................................... -->
<!-- XHTML Block Phrasal Module .......................................... -->
<!-- file: xhtml-blkphras-1.mod
This is XHTML, a reformulation of HTML as a modular XML application.
Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
Revision: $Id: xhtml-blkphras-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI
This DTD module is identified by the PUBLIC and SYSTEM identifiers:
PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod"
Revisions:
(none)
....................................................................... -->
<!-- Block Phrasal
address, blockquote, pre, h1, h2, h3, h4, h5, h6
This module declares the elements and their attributes used to
support block-level phrasal markup.
-->
<!ENTITY % address.element "INCLUDE" >
<![%address.element;[
<!ENTITY % address.content
"( #PCDATA | %Inline.mix; )*" >
<!ENTITY % address.qname "address" >
<!ELEMENT %address.qname; %address.content; >
<!-- end of address.element -->]]>
<!ENTITY % address.attlist "INCLUDE" >
<![%address.attlist;[
<!ATTLIST %address.qname;
%Common.attrib;
>
<!-- end of address.attlist -->]]>
<!ENTITY % blockquote.element "INCLUDE" >
<![%blockquote.element;[
<!ENTITY % blockquote.content
"( %Block.mix; )*"
>
<!ENTITY % blockquote.qname "blockquote" >
<!ELEMENT %blockquote.qname; %blockquote.content; >
<!-- end of blockquote.element -->]]>
<!ENTITY % blockquote.attlist "INCLUDE" >
<![%blockquote.attlist;[
<!ATTLIST %blockquote.qname;
%Common.attrib;
cite %URI.datatype; #IMPLIED
>
<!-- end of blockquote.attlist -->]]>
<!ENTITY % pre.element "INCLUDE" >
<![%pre.element;[
<!ENTITY % pre.content
"( #PCDATA
| %InlStruct.class;
%InlPhras.class;
| %tt.qname; | %i.qname; | %b.qname;
%I18n.class;
%Anchor.class;
| %map.qname;
%Misc.class;
%Inline.extra; )*"
>
<!ENTITY % pre.qname "pre" >
<!ELEMENT %pre.qname; %pre.content; >
<!-- end of pre.element -->]]>
<!ENTITY % pre.attlist "INCLUDE" >
<![%pre.attlist;[
<!ATTLIST %pre.qname;
%Common.attrib;
>
<!-- end of pre.attlist -->]]>
<!-- ................... Heading Elements ................... -->
<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" >
<!ENTITY % h1.element "INCLUDE" >
<![%h1.element;[
<!ENTITY % h1.qname "h1" >
<!ELEMENT %h1.qname; %Heading.content; >
<!-- end of h1.element -->]]>
<!ENTITY % h1.attlist "INCLUDE" >
<![%h1.attlist;[
<!ATTLIST %h1.qname;
%Common.attrib;
>
<!-- end of h1.attlist -->]]>
<!ENTITY % h2.element "INCLUDE" >
<![%h2.element;[
<!ENTITY % h2.qname "h2" >
<!ELEMENT %h2.qname; %Heading.content; >
<!-- end of h2.element -->]]>
<!ENTITY % h2.attlist "INCLUDE" >
<![%h2.attlist;[
<!ATTLIST %h2.qname;
%Common.attrib;
>
<!-- end of h2.attlist -->]]>
<!ENTITY % h3.element "INCLUDE" >
<![%h3.element;[
<!ENTITY % h3.qname "h3" >
<!ELEMENT %h3.qname; %Heading.content; >
<!-- end of h3.element -->]]>
<!ENTITY % h3.attlist "INCLUDE" >
<![%h3.attlist;[
<!ATTLIST %h3.qname;
%Common.attrib;
>
<!-- end of h3.attlist -->]]>
<!ENTITY % h4.element "INCLUDE" >
<![%h4.element;[
<!ENTITY % h4.qname "h4" >
<!ELEMENT %h4.qname; %Heading.content; >
<!-- end of h4.element -->]]>
<!ENTITY % h4.attlist "INCLUDE" >
<![%h4.attlist;[
<!ATTLIST %h4.qname;
%Common.attrib;
>
<!-- end of h4.attlist -->]]>
<!ENTITY % h5.element "INCLUDE" >
<![%h5.element;[
<!ENTITY % h5.qname "h5" >
<!ELEMENT %h5.qname; %Heading.content; >
<!-- end of h5.element -->]]>
<!ENTITY % h5.attlist "INCLUDE" >
<![%h5.attlist;[
<!ATTLIST %h5.qname;
%Common.attrib;
>
<!-- end of h5.attlist -->]]>
<!ENTITY % h6.element "INCLUDE" >
<![%h6.element;[
<!ENTITY % h6.qname "h6" >
<!ELEMENT %h6.qname; %Heading.content; >
<!-- end of h6.element -->]]>
<!ENTITY % h6.attlist "INCLUDE" >
<![%h6.attlist;[
<!ATTLIST %h6.qname;
%Common.attrib;
>
<!-- end of h6.attlist -->]]>
<!-- end of xhtml-blkphras-1.mod -->
|
{
"pile_set_name": "Github"
}
|
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql
module Hasura.Object.Online_users exposing (id, last_seen, user)
import Graphql.Internal.Builder.Argument as Argument exposing (Argument)
import Graphql.Internal.Builder.Object as Object
import Graphql.Internal.Encode as Encode exposing (Value)
import Graphql.Operation exposing (RootMutation, RootQuery, RootSubscription)
import Graphql.OptionalArgument exposing (OptionalArgument(..))
import Graphql.SelectionSet exposing (SelectionSet)
import Hasura.InputObject
import Hasura.Interface
import Hasura.Object
import Hasura.Scalar
import Hasura.ScalarCodecs
import Hasura.Union
import Json.Decode as Decode
id : SelectionSet (Maybe String) Hasura.Object.Online_users
id =
Object.selectionForField "(Maybe String)" "id" [] (Decode.string |> Decode.nullable)
last_seen : SelectionSet (Maybe Hasura.ScalarCodecs.Timestamptz) Hasura.Object.Online_users
last_seen =
Object.selectionForField "(Maybe ScalarCodecs.Timestamptz)" "last_seen" [] (Hasura.ScalarCodecs.codecs |> Hasura.Scalar.unwrapCodecs |> .codecTimestamptz |> .decoder |> Decode.nullable)
{-| An object relationship
-}
user : SelectionSet decodesTo Hasura.Object.Users -> SelectionSet (Maybe decodesTo) Hasura.Object.Online_users
user object_ =
Object.selectionForCompositeField "user" [] object_ (identity >> Decode.nullable)
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2013-2015 Apple Inc.
* All rights reserved.
*/
#ifndef __NE_INDIRECT__
#error "Please import the NetworkExtension module instead of this file directly."
#endif
NS_ASSUME_NONNULL_BEGIN
#if !defined(NEVPN_EXPORT)
#define NEVPN_EXPORT extern
#endif
@class NEVPNManager;
/*!
* @typedef NEVPNStatus
* @abstract VPN status codes
*/
typedef NS_ENUM(NSInteger, NEVPNStatus) {
/*! @const NEVPNStatusInvalid The VPN is not configured. */
NEVPNStatusInvalid = 0,
/*! @const NEVPNStatusDisconnected The VPN is disconnected. */
NEVPNStatusDisconnected = 1,
/*! @const NEVPNStatusConnecting The VPN is connecting. */
NEVPNStatusConnecting = 2,
/*! @const NEVPNStatusConnected The VPN is connected. */
NEVPNStatusConnected = 3,
/*! @const NEVPNStatusReasserting The VPN is reconnecting following loss of underlying network connectivity. */
NEVPNStatusReasserting = 4,
/*! @const NEVPNStatusDisconnecting The VPN is disconnecting. */
NEVPNStatusDisconnecting = 5,
} NS_ENUM_AVAILABLE(10_11, 8_0);
/*! @const NEVPNStatusDidChangeNotification Name of the NSNotification that is posted when the VPN status changes. */
NEVPN_EXPORT NSString * const NEVPNStatusDidChangeNotification NS_AVAILABLE(10_11, 8_0);
/*! @const NEVPNConnectionStartOptionUsername Specify this key in the options dictionary passed to startVPNTunnelWithOptions:returningError: to override the username saved in the configuration. The value is a string */
NEVPN_EXPORT NSString * const NEVPNConnectionStartOptionUsername NS_AVAILABLE(10_11, 9_0);
/*! @const NEVPNConnectionStartOptionPassword Specify this key in the options dictionary passed to startVPNTunnelWithOptions:returningError: to override the password saved in the configuration. The value is a string */
NEVPN_EXPORT NSString * const NEVPNConnectionStartOptionPassword NS_AVAILABLE(10_11, 9_0);
/*!
* @interface NEVPNConnection
* @discussion The NEVPNConnection class declares the programmatic interface for an object that manages VPN connections.
*
* Instances of this class are thread safe.
*/
NS_CLASS_AVAILABLE(10_11, 8_0)
@interface NEVPNConnection : NSObject
/*!
* @method startVPNTunnelAndReturnError:
* @discussion This function is used to start the VPN tunnel using the current VPN configuration. The VPN tunnel connection process is started and this function returns immediately.
* @param error If the VPN tunnel was started successfully, this parameter is set to nil. Otherwise this parameter is set to the error that occurred. Possible errors include:
* 1. NEVPNErrorConfigurationInvalid
* 2. NEVPNErrorConfigurationDisabled
* @return YES if the VPN tunnel was started successfully, NO if an error occurred.
*/
- (BOOL)startVPNTunnelAndReturnError:(NSError **)error NS_AVAILABLE(10_11, 8_0);
/*!
* @method startVPNTunnelWithOptions:andReturnError:
* @discussion This function is used to start the VPN tunnel using the current VPN configuration. The VPN tunnel connection process is started and this function returns immediately.
* @param options A dictionary that will be passed to the tunnel provider during the process of starting the tunnel.
* If not nil, 'options' is an NSDictionary may contain the following keys
* NEVPNConnectionStartOptionUsername
* NEVPNConnectionStartOptionPassword
* @param error If the VPN tunnel was started successfully, this parameter is set to nil. Otherwise this parameter is set to the error that occurred. Possible errors include:
* 1. NEVPNErrorConfigurationInvalid
* 2. NEVPNErrorConfigurationDisabled
* @return YES if the VPN tunnel was started successfully, NO if an error occurred.
*/
- (BOOL)startVPNTunnelWithOptions:(nullable NSDictionary<NSString *,NSObject *> *)options andReturnError:(NSError **)error NS_AVAILABLE(10_11, 9_0);
/*!
* @method stopVPNTunnel:
* @discussion This function is used to stop the VPN tunnel. The VPN tunnel disconnect process is started and this function returns immediately.
*/
- (void)stopVPNTunnel NS_AVAILABLE(10_11, 8_0);
/*!
* @property status
* @discussion The current status of the VPN.
*/
@property (readonly) NEVPNStatus status NS_AVAILABLE(10_11, 8_0);
/*!
* @property connectedDate
* @discussion The date and time when the connection status changed to NEVPNStatusConnected. This property is nil if the connection is not fully established.
*/
@property (readonly, nullable) NSDate *connectedDate NS_AVAILABLE(10_11, 9_0);
/*!
* @property manager
* @discussion The NEVPNManager associated with this NEVPNConnection.
*/
@property (readonly) NEVPNManager *manager NS_AVAILABLE(10_12, 10_0);
@end
NS_ASSUME_NONNULL_END
|
{
"pile_set_name": "Github"
}
|
DROP TABLE IF EXISTS `quest_visual_effect`;
CREATE TABLE `quest_visual_effect` (
`ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
`Index` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`VisualEffect` MEDIUMINT(8) NOT NULL DEFAULT '0',
`VerifiedBuild` SMALLINT(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`, `Index`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `quest_visual_effect` (`ID`, `VisualEffect`)
SELECT `ID`, `VisualEffect2` FROM `quest_objectives`
WHERE `VisualEffect2`!=0;
UPDATE `quest_visual_effect` SET `Index`=1 WHERE `Index`=0;
INSERT INTO `quest_visual_effect` (`ID`, `VisualEffect`)
SELECT `ID`, `VisualEffect3` FROM `quest_objectives`
WHERE `VisualEffect3`!=0;
UPDATE `quest_visual_effect` SET `Index`=2 WHERE `Index`=0;
INSERT INTO `quest_visual_effect` (`ID`, `VisualEffect`)
SELECT `ID`, `VisualEffect4` FROM `quest_objectives`
WHERE `VisualEffect4`!=0;
UPDATE `quest_visual_effect` SET `Index`=3 WHERE `Index`=0;
INSERT INTO `quest_visual_effect` (`ID`, `VisualEffect`)
SELECT `ID`, `VisualEffect5` FROM `quest_objectives`
WHERE `VisualEffect5`!=0;
UPDATE `quest_visual_effect` SET `Index`=4 WHERE `Index`=0;
INSERT INTO `quest_visual_effect` (`ID`, `VisualEffect`)
SELECT `ID`, `VisualEffect1` FROM `quest_objectives`
WHERE `VisualEffect1`!=0;
UPDATE `quest_visual_effect` SET `VerifiedBuild`=19034;
ALTER TABLE `quest_objectives`
DROP `VisualEffect1`,
DROP `VisualEffect2`,
DROP `VisualEffect3`,
DROP `VisualEffect4`,
DROP `VisualEffect5`;
DELETE FROM `quest_objectives` WHERE `Id` IN (251728, 263919, 263920, 268026, 269586, 269598);
INSERT INTO `quest_objectives` (`Id`, `QuestId`, `Type`, `StorageIndex`, `ObjectID`, `Amount`, `Flags`, `UnkFloat`, `Description`, `VerifiedBuild`) VALUES
(251728, 30187, 0, 0, 58438, 10, 0, 0, 'Checkpoints passed', 19034),
(263919, 30152, 0, 0, 58438, 10, 0, 0, 'Checkpoints passed', 19034),
(263920, 30152, 0, 1, 58530, 1, 0, 0, 'Pass underneath the Finish Line', 19034),
(268026, 31061, 0, 0, 62592, 8, 0, 0, 'Shan''ze Cloudrider saved', 19034),
(269586, 32295, 0, 0, 67944, 1, 0, 0, 'Determine the language of the tome', 19034),
(269598, 32295, 0, 1, 67945, 1, 0, 0, 'Determine the tome''s purpose', 19034);
DELETE FROM `quest_visual_effect` WHERE (`Id`=251728 AND `Index`=0) OR (`Id`=251728 AND `Index`=1) OR (`Id`=251728 AND `Index`=2) OR (`Id`=251728 AND `Index`=3) OR (`Id`=251728 AND `Index`=4) OR (`Id`=251728 AND `Index`=5) OR (`Id`=251728 AND `Index`=6) OR (`Id`=251728 AND `Index`=7) OR (`Id`=251728 AND `Index`=8) OR (`Id`=251728 AND `Index`=9) OR (`Id`=251809 AND `Index`=0) OR (`Id`=252884 AND `Index`=0) OR (`Id`=252885 AND `Index`=0) OR (`Id`=252886 AND `Index`=0) OR (`Id`=252887 AND `Index`=0) OR (`Id`=253758 AND `Index`=0) OR (`Id`=253759 AND `Index`=0) OR (`Id`=253760 AND `Index`=0) OR (`Id`=253761 AND `Index`=0) OR (`Id`=253762 AND `Index`=0) OR (`Id`=253763 AND `Index`=0) OR (`Id`=253764 AND `Index`=0) OR (`Id`=253765 AND `Index`=0) OR (`Id`=253826 AND `Index`=0) OR (`Id`=253850 AND `Index`=0) OR (`Id`=255745 AND `Index`=0) OR (`Id`=255746 AND `Index`=0) OR (`Id`=256244 AND `Index`=0) OR (`Id`=256310 AND `Index`=0) OR (`Id`=256330 AND `Index`=0) OR (`Id`=256331 AND `Index`=0) OR (`Id`=263919 AND `Index`=0) OR (`Id`=263919 AND `Index`=1) OR (`Id`=263919 AND `Index`=2) OR (`Id`=263919 AND `Index`=3) OR (`Id`=263919 AND `Index`=4) OR (`Id`=263919 AND `Index`=5) OR (`Id`=263919 AND `Index`=6) OR (`Id`=263919 AND `Index`=7) OR (`Id`=263919 AND `Index`=8) OR (`Id`=263919 AND `Index`=9) OR (`Id`=263919 AND `Index`=10) OR (`Id`=263920 AND `Index`=0) OR (`Id`=263920 AND `Index`=1) OR (`Id`=268026 AND `Index`=0) OR (`Id`=268026 AND `Index`=1) OR (`Id`=268026 AND `Index`=2) OR (`Id`=268026 AND `Index`=3) OR (`Id`=268026 AND `Index`=4) OR (`Id`=268026 AND `Index`=5) OR (`Id`=268026 AND `Index`=6) OR (`Id`=268157 AND `Index`=0) OR (`Id`=268157 AND `Index`=1) OR (`Id`=268230 AND `Index`=0) OR (`Id`=268231 AND `Index`=0) OR (`Id`=268231 AND `Index`=1) OR (`Id`=268239 AND `Index`=0) OR (`Id`=268239 AND `Index`=1) OR (`Id`=268239 AND `Index`=2) OR (`Id`=268481 AND `Index`=0) OR (`Id`=268481 AND `Index`=1) OR (`Id`=268890 AND `Index`=0) OR (`Id`=268987 AND `Index`=0) OR (`Id`=268987 AND `Index`=1) OR (`Id`=268987 AND `Index`=2) OR (`Id`=268999 AND `Index`=0) OR (`Id`=269586 AND `Index`=0) OR (`Id`=269586 AND `Index`=1) OR (`Id`=269586 AND `Index`=2) OR (`Id`=269586 AND `Index`=3) OR (`Id`=269586 AND `Index`=4) OR (`Id`=269586 AND `Index`=5) OR (`Id`=269586 AND `Index`=6) OR (`Id`=269586 AND `Index`=7) OR (`Id`=269586 AND `Index`=8) OR (`Id`=269586 AND `Index`=9) OR (`Id`=269598 AND `Index`=0) OR (`Id`=269598 AND `Index`=1) OR (`Id`=269598 AND `Index`=2) OR (`Id`=270080 AND `Index`=0) OR (`Id`=270109 AND `Index`=0) OR (`Id`=270111 AND `Index`=0) OR (`Id`=270112 AND `Index`=0) OR (`Id`=270144 AND `Index`=0) OR (`Id`=270145 AND `Index`=0) OR (`Id`=270458 AND `Index`=0) OR (`Id`=270458 AND `Index`=1) OR (`Id`=270459 AND `Index`=0) OR (`Id`=270459 AND `Index`=1) OR (`Id`=270460 AND `Index`=0) OR (`Id`=270460 AND `Index`=1) OR (`Id`=270479 AND `Index`=0) OR (`Id`=270480 AND `Index`=0) OR (`Id`=270481 AND `Index`=0) OR (`Id`=270482 AND `Index`=0) OR (`Id`=270570 AND `Index`=0) OR (`Id`=270571 AND `Index`=0) OR (`Id`=270571 AND `Index`=1) OR (`Id`=270571 AND `Index`=2);
INSERT INTO `quest_visual_effect` (`Id`, `Index`, `VisualEffect`, `VerifiedBuild`) VALUES
(251728, 0, 506, 19034),
(251728, 1, 507, 19034),
(251728, 2, 508, 19034),
(251728, 3, 509, 19034),
(251728, 4, 510, 19034),
(251728, 5, 511, 19034),
(251728, 6, 512, 19034),
(251728, 7, 513, 19034),
(251728, 8, 514, 19034),
(251728, 9, 515, 19034),
(251809, 0, 1552, 19034),
(252884, 0, 505, 19034),
(252885, 0, 505, 19034),
(252886, 0, 505, 19034),
(252887, 0, 505, 19034),
(253758, 0, 505, 19034),
(253759, 0, 505, 19034),
(253760, 0, 505, 19034),
(253761, 0, 505, 19034),
(253762, 0, 505, 19034),
(253763, 0, 505, 19034),
(253764, 0, 505, 19034),
(253765, 0, 505, 19034),
(253826, 0, 867, 19034),
(253850, 0, 658, 19034),
(255745, 0, 937, 19034),
(255746, 0, 937, 19034),
(256244, 0, 716, 19034),
(256310, 0, 937, 19034),
(256330, 0, 937, 19034),
(256331, 0, 937, 19034),
(263919, 0, 506, 19034),
(263919, 1, 507, 19034),
(263919, 2, 508, 19034),
(263919, 3, 509, 19034),
(263919, 4, 510, 19034),
(263919, 5, 511, 19034),
(263919, 6, 512, 19034),
(263919, 7, 513, 19034),
(263919, 8, 514, 19034),
(263919, 9, 515, 19034),
(263919, 10, 1551, 19034),
(263920, 0, 635, 19034),
(263920, 1, 1551, 19034),
(268026, 0, 528, 19034),
(268026, 1, 529, 19034),
(268026, 2, 530, 19034),
(268026, 3, 531, 19034),
(268026, 4, 532, 19034),
(268026, 5, 533, 19034),
(268026, 6, 534, 19034),
(268157, 0, 1117, 19034),
(268157, 1, 1118, 19034),
(268230, 0, 658, 19034),
(268231, 0, 658, 19034),
(268231, 1, 1142, 19034),
(268239, 0, 631, 19034),
(268239, 1, 632, 19034),
(268239, 2, 633, 19034),
(268481, 0, 1121, 19034),
(268481, 1, 1122, 19034),
(268890, 0, 538, 19034),
(268987, 0, 1009, 19034),
(268987, 1, 1010, 19034),
(268987, 2, 1011, 19034),
(268999, 0, 569, 19034),
(269586, 0, 1288, 19034),
(269586, 1, 1289, 19034),
(269586, 2, 1290, 19034),
(269586, 3, 1291, 19034),
(269586, 4, 1292, 19034),
(269586, 5, 1293, 19034),
(269586, 6, 1294, 19034),
(269586, 7, 1295, 19034),
(269586, 8, 1296, 19034),
(269586, 9, 1297, 19034),
(269598, 0, 1290, 19034),
(269598, 1, 1294, 19034),
(269598, 2, 1296, 19034),
(270080, 0, 658, 19034),
(270109, 0, 658, 19034),
(270111, 0, 658, 19034),
(270112, 0, 658, 19034),
(270144, 0, 658, 19034),
(270145, 0, 658, 19034),
(270458, 0, 1616, 19034),
(270458, 1, 1619, 19034),
(270459, 0, 1616, 19034),
(270459, 1, 1620, 19034),
(270460, 0, 1616, 19034),
(270460, 1, 1621, 19034),
(270479, 0, 1651, 19034),
(270480, 0, 1650, 19034),
(270481, 0, 1648, 19034),
(270482, 0, 1649, 19034),
(270570, 0, 505, 19034),
(270571, 0, 1616, 19034),
(270571, 1, 1634, 19034),
(270571, 2, 1635, 19034);
|
{
"pile_set_name": "Github"
}
|
/*
* user_wifi.h
*/
#ifndef _USER_WIFI_H_
#define _USER_WIFI_H_
#include "os_type.h"
#include "wifi_config.h"
typedef void (*WifiCallback)(uint8_t);
extern void wifi_connect(WifiCallback cb);
extern void smartconfig_connect(WifiCallback cb);
extern void wifi_check_init(u16);
extern void wifi_status_led_init(void);
extern void user_smartconfig_led_timer_init(void);
extern void user_smartconfig_led_timer_stop(void);
extern void wifi_smartconfig_timer_init(void);
extern void wifi_smartconfig_timer_stop(void);
extern u32 get_station_ip(void);
#endif /* _USER_WIFI_H_ */
|
{
"pile_set_name": "Github"
}
|
/* This is a simple example which shows how to employ the Tcl/Tk bindings of
VTK (the "visualization toolkit", http://www.vtk.org/) to render 3D
visualizations in Pure, a rotating globe in this example. You need VTK to
make this work, and the earth.ppm texture must be in the current directory
when running this program. */
// This script has been set up so that you can compile it with:
// pure -c earth.pure -o earth
using tk, system;
/* Load the GUI and the rendering pipeline which is defined in the
accompanying Tcl script, earth.tcl. NOTE: Depending on whether you have
Gnocl installed, you'll either get a GTK+ GUI or just a plain Tk GUI. The
Tcl script contains code for both. */
const earth = fget (fopen "earth.tcl" "r");
// Catch Tcl errors.
tk_error msg = throw msg;
/* The rendering callback, which rotates the representation by 3 degrees every
10 milliseconds while the Rotate checkbutton is enabled. This shows how to
work with the rendering pipeline from the Pure script. Note that most of
the user interaction in the rendering window is handled by VTK itself. In
particular, you can press the left, middle and right mouse buttons in the
rendering window to rotate, pan and zoom the image, respectively. */
#! --required render_cb
render_cb v = tk "renWin Render; [ren1 GetActiveCamera] Azimuth 3; \
after 10 {pure render_cb $rotate}" if val v;
/* Two callbacks to change the object representation and the interaction
style. Toggling the 'Wireframe' checkbutton or, equivalently, pressing
'w'/'s' in the rendering window changes between wireframe and solid
(surface) display. Similarly, toggling the 'Trackball Mode' checkbutton or
pressing 't'/'j' switches between the "trackball" and "joystick" style of
interaction. (In "trackball" mode, you need to drag the mouse to rotate/
pan/zoom the image, while in "joystick" mode just pressing the mouse is
enough.) */
#! --required wireframe_cb
wireframe_cb v = tk $ sprintf "[world GetProperty] SetRepresentationTo%s; \
renWin Render" (if val v then "Wireframe" else "Surface");
#! --required interactor_cb
interactor_cb v = tk $ sprintf "[[renWin GetInteractor] GetInteractorStyle] \
SetCurrentStyleTo%sCamera" (if val v then "Trackball" else "Joystick");
/* The main program: execute the Tcl script and enter the main loop. You can
also specify the -tk command line option to enforce a Tk GUI even if Gnocl
is present. */
main = tk earth $$ tk_main when
argc < 2 || tk (sprintf "set GTK %d" (argv!1 ~= "-tk"));
end;
main;
|
{
"pile_set_name": "Github"
}
|
'use strict';
Array.prototype.inArray = function(comparer) {
for(var i=0; i < this.length; i++) {
if(comparer(this[i])) return true;
}
return false;
};
Array.prototype.pushIfNotExist = function(element, comparer) {
if (!this.inArray(comparer)) {
this.push(element);
}
};
Array.prototype.removeElement = function(el){
var index = this.indexOf(el);
return this.splice(index, 1);
};
var selected = {};
selected.sources = [];
selected.sinks = [];
var drake = dragula([$('sources'), $('sinks'), $('dragToMe')],{
revertOnSpill: true,
invalid: function(el, target){
if(el.id === 'dragToMeInfo')
return true;
if(el.id === 'identifyFlowsButton')
return true;
},
accepts: function(el, target, source, sibling){
if(el.id === 'dragToMeInfo') return false;
if(target.id === 'dragToMe')
return true;
if((target.id === 'sinks' && el.getAttribute('data-type') === 'source') || (target.id === 'sources' && el.getAttribute('data-type') === 'sink'))
return false;
return true;
}
}
);
drake.on('drop', function(el, container, source){
if(container.id === 'dragToMe'){
selected[el.getAttribute('data-type') + 's'].pushIfNotExist(el.getAttribute('data-name'), function(e){ return e === el.getAttribute('data-name')});
}
if(source.id === 'dragToMe' && (container.id === 'sources' || container.id === 'sinks')){
selected[el.getAttribute('data-type') + 's'].removeElement(el.getAttribute('data-name'));
}
updateDragMeInfo();
});
drake.on('shadow', function(el, container){
if(container.id === 'dragToMe'){
$('dragToMeInfo').style.display = 'none';
}
});
drake.on('dragend', function(el){
updateDragMeInfo();
});
function $ (id) {
return document.getElementById(id);
}
function updateDragMeInfo(){
if(selected.sources.length + selected.sinks.length === 0){
$('dragToMeInfo').style.display = 'block';
$('identifyFlowsButton').style.display = 'none';
} else {
$('dragToMeInfo').style.display = 'none';
if(selected.sources.length >= 1 && selected.sinks.length >= 1){
$('identifyFlowsButton').style.display = 'block';
} else {
$('identifyFlowsButton').style.display = 'none';
}
}
}
document.addEventListener("DOMContentLoaded", function(event) {
$('identifyFlowsButton').onclick = function(e){
identifyDomFlows(selected.sources, selected.sinks);
};
});
|
{
"pile_set_name": "Github"
}
|
# Copyright (c) 2010-2020 The Open-Transactions developers
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set(cxx-sources BlockFilter.cpp BlockHeaders.cpp Blocks.cpp Database.cpp
Peers.cpp Wallet.cpp
)
set(cxx-headers BlockFilter.hpp BlockHeaders.hpp Blocks.hpp Database.hpp
Peers.hpp Wallet.hpp
)
add_library(
opentxs-api-client-blockchain-database OBJECT ${cxx-sources} ${cxx-headers}
)
target_link_libraries(
opentxs-api-client-blockchain-database PRIVATE opentxs::messages
unofficial-sodium::sodium lmdb
)
if(OPENTXS_BLOCK_STORAGE_ENABLED)
target_link_libraries(
opentxs-api-client-blockchain-database
PRIVATE Boost::iostreams Boost::headers Boost::filesystem
)
target_compile_definitions(
opentxs-api-client-blockchain-database
PUBLIC OPENTXS_BLOCK_STORAGE_ENABLED=1
)
else()
target_compile_definitions(
opentxs-api-client-blockchain-database
PUBLIC OPENTXS_BLOCK_STORAGE_ENABLED=0
)
endif()
set_property(
TARGET opentxs-api-client-blockchain-database
PROPERTY POSITION_INDEPENDENT_CODE 1
)
target_compile_definitions(
opentxs-api-client-blockchain-database
PRIVATE
OPENTXS_DEFAULT_BLOCK_STORAGE_POLICY=${OPENTXS_DEFAULT_BLOCK_STORAGE_POLICY}
)
|
{
"pile_set_name": "Github"
}
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build mips64le,linux
package unix
const (
SizeofPtr = 0x8
SizeofShort = 0x2
SizeofInt = 0x4
SizeofLong = 0x8
SizeofLongLong = 0x8
PathMax = 0x1000
)
type (
_C_short int16
_C_int int32
_C_long int64
_C_long_long int64
)
type Timespec struct {
Sec int64
Nsec int64
}
type Timeval struct {
Sec int64
Usec int64
}
type Timex struct {
Modes uint32
Offset int64
Freq int64
Maxerror int64
Esterror int64
Status int32
Constant int64
Precision int64
Tolerance int64
Time Timeval
Tick int64
Ppsfreq int64
Jitter int64
Shift int32
Stabil int64
Jitcnt int64
Calcnt int64
Errcnt int64
Stbcnt int64
Tai int32
_ [44]byte
}
type Time_t int64
type Tms struct {
Utime int64
Stime int64
Cutime int64
Cstime int64
}
type Utimbuf struct {
Actime int64
Modtime int64
}
type Rusage struct {
Utime Timeval
Stime Timeval
Maxrss int64
Ixrss int64
Idrss int64
Isrss int64
Minflt int64
Majflt int64
Nswap int64
Inblock int64
Oublock int64
Msgsnd int64
Msgrcv int64
Nsignals int64
Nvcsw int64
Nivcsw int64
}
type Rlimit struct {
Cur uint64
Max uint64
}
type _Gid_t uint32
type Stat_t struct {
Dev uint32
Pad1 [3]uint32
Ino uint64
Mode uint32
Nlink uint32
Uid uint32
Gid uint32
Rdev uint32
Pad2 [3]uint32
Size int64
Atim Timespec
Mtim Timespec
Ctim Timespec
Blksize uint32
Pad4 uint32
Blocks int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
_ int32
}
type Statx_t struct {
Mask uint32
Blksize uint32
Attributes uint64
Nlink uint32
Uid uint32
Gid uint32
Mode uint16
_ [1]uint16
Ino uint64
Size uint64
Blocks uint64
Attributes_mask uint64
Atime StatxTimestamp
Btime StatxTimestamp
Ctime StatxTimestamp
Mtime StatxTimestamp
Rdev_major uint32
Rdev_minor uint32
Dev_major uint32
Dev_minor uint32
_ [14]uint64
}
type Dirent struct {
Ino uint64
Off int64
Reclen uint16
Type uint8
Name [256]int8
_ [5]byte
}
type Fsid struct {
Val [2]int32
}
type Flock_t struct {
Type int16
Whence int16
Start int64
Len int64
Pid int32
_ [4]byte
}
type FscryptPolicy struct {
Version uint8
Contents_encryption_mode uint8
Filenames_encryption_mode uint8
Flags uint8
Master_key_descriptor [8]uint8
}
type FscryptKey struct {
Mode uint32
Raw [64]uint8
Size uint32
}
type KeyctlDHParams struct {
Private int32
Prime int32
Base int32
}
const (
FADV_NORMAL = 0x0
FADV_RANDOM = 0x1
FADV_SEQUENTIAL = 0x2
FADV_WILLNEED = 0x3
FADV_DONTNEED = 0x4
FADV_NOREUSE = 0x5
)
type RawSockaddrInet4 struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
Zero [8]uint8
}
type RawSockaddrInet6 struct {
Family uint16
Port uint16
Flowinfo uint32
Addr [16]byte /* in6_addr */
Scope_id uint32
}
type RawSockaddrUnix struct {
Family uint16
Path [108]int8
}
type RawSockaddrLinklayer struct {
Family uint16
Protocol uint16
Ifindex int32
Hatype uint16
Pkttype uint8
Halen uint8
Addr [8]uint8
}
type RawSockaddrNetlink struct {
Family uint16
Pad uint16
Pid uint32
Groups uint32
}
type RawSockaddrHCI struct {
Family uint16
Dev uint16
Channel uint16
}
type RawSockaddrL2 struct {
Family uint16
Psm uint16
Bdaddr [6]uint8
Cid uint16
Bdaddr_type uint8
_ [1]byte
}
type RawSockaddrRFCOMM struct {
Family uint16
Bdaddr [6]uint8
Channel uint8
_ [1]byte
}
type RawSockaddrCAN struct {
Family uint16
Ifindex int32
Addr [8]byte
}
type RawSockaddrALG struct {
Family uint16
Type [14]uint8
Feat uint32
Mask uint32
Name [64]uint8
}
type RawSockaddrVM struct {
Family uint16
Reserved1 uint16
Port uint32
Cid uint32
Zero [4]uint8
}
type RawSockaddrXDP struct {
Family uint16
Flags uint16
Ifindex uint32
Queue_id uint32
Shared_umem_fd uint32
}
type RawSockaddrPPPoX [0x1e]byte
type RawSockaddr struct {
Family uint16
Data [14]int8
}
type RawSockaddrAny struct {
Addr RawSockaddr
Pad [96]int8
}
type _Socklen uint32
type Linger struct {
Onoff int32
Linger int32
}
type Iovec struct {
Base *byte
Len uint64
}
type IPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type IPMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type IPv6Mreq struct {
Multiaddr [16]byte /* in6_addr */
Interface uint32
}
type PacketMreq struct {
Ifindex int32
Type uint16
Alen uint16
Address [8]uint8
}
type Msghdr struct {
Name *byte
Namelen uint32
Iov *Iovec
Iovlen uint64
Control *byte
Controllen uint64
Flags int32
_ [4]byte
}
type Cmsghdr struct {
Len uint64
Level int32
Type int32
}
type Inet4Pktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type Inet6Pktinfo struct {
Addr [16]byte /* in6_addr */
Ifindex uint32
}
type IPv6MTUInfo struct {
Addr RawSockaddrInet6
Mtu uint32
}
type ICMPv6Filter struct {
Data [8]uint32
}
type Ucred struct {
Pid int32
Uid uint32
Gid uint32
}
type TCPInfo struct {
State uint8
Ca_state uint8
Retransmits uint8
Probes uint8
Backoff uint8
Options uint8
Rto uint32
Ato uint32
Snd_mss uint32
Rcv_mss uint32
Unacked uint32
Sacked uint32
Lost uint32
Retrans uint32
Fackets uint32
Last_data_sent uint32
Last_ack_sent uint32
Last_data_recv uint32
Last_ack_recv uint32
Pmtu uint32
Rcv_ssthresh uint32
Rtt uint32
Rttvar uint32
Snd_ssthresh uint32
Snd_cwnd uint32
Advmss uint32
Reordering uint32
Rcv_rtt uint32
Rcv_space uint32
Total_retrans uint32
}
const (
SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c
SizeofSockaddrAny = 0x70
SizeofSockaddrUnix = 0x6e
SizeofSockaddrLinklayer = 0x14
SizeofSockaddrNetlink = 0xc
SizeofSockaddrHCI = 0x6
SizeofSockaddrL2 = 0xe
SizeofSockaddrRFCOMM = 0xa
SizeofSockaddrCAN = 0x10
SizeofSockaddrALG = 0x58
SizeofSockaddrVM = 0x10
SizeofSockaddrXDP = 0x10
SizeofSockaddrPPPoX = 0x1e
SizeofLinger = 0x8
SizeofIovec = 0x10
SizeofIPMreq = 0x8
SizeofIPMreqn = 0xc
SizeofIPv6Mreq = 0x14
SizeofPacketMreq = 0x10
SizeofMsghdr = 0x38
SizeofCmsghdr = 0x10
SizeofInet4Pktinfo = 0xc
SizeofInet6Pktinfo = 0x14
SizeofIPv6MTUInfo = 0x20
SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc
SizeofTCPInfo = 0x68
)
const (
IFA_UNSPEC = 0x0
IFA_ADDRESS = 0x1
IFA_LOCAL = 0x2
IFA_LABEL = 0x3
IFA_BROADCAST = 0x4
IFA_ANYCAST = 0x5
IFA_CACHEINFO = 0x6
IFA_MULTICAST = 0x7
IFLA_UNSPEC = 0x0
IFLA_ADDRESS = 0x1
IFLA_BROADCAST = 0x2
IFLA_IFNAME = 0x3
IFLA_INFO_KIND = 0x1
IFLA_MTU = 0x4
IFLA_LINK = 0x5
IFLA_QDISC = 0x6
IFLA_STATS = 0x7
IFLA_COST = 0x8
IFLA_PRIORITY = 0x9
IFLA_MASTER = 0xa
IFLA_WIRELESS = 0xb
IFLA_PROTINFO = 0xc
IFLA_TXQLEN = 0xd
IFLA_MAP = 0xe
IFLA_WEIGHT = 0xf
IFLA_OPERSTATE = 0x10
IFLA_LINKMODE = 0x11
IFLA_LINKINFO = 0x12
IFLA_NET_NS_PID = 0x13
IFLA_IFALIAS = 0x14
IFLA_NUM_VF = 0x15
IFLA_VFINFO_LIST = 0x16
IFLA_STATS64 = 0x17
IFLA_VF_PORTS = 0x18
IFLA_PORT_SELF = 0x19
IFLA_AF_SPEC = 0x1a
IFLA_GROUP = 0x1b
IFLA_NET_NS_FD = 0x1c
IFLA_EXT_MASK = 0x1d
IFLA_PROMISCUITY = 0x1e
IFLA_NUM_TX_QUEUES = 0x1f
IFLA_NUM_RX_QUEUES = 0x20
IFLA_CARRIER = 0x21
IFLA_PHYS_PORT_ID = 0x22
IFLA_CARRIER_CHANGES = 0x23
IFLA_PHYS_SWITCH_ID = 0x24
IFLA_LINK_NETNSID = 0x25
IFLA_PHYS_PORT_NAME = 0x26
IFLA_PROTO_DOWN = 0x27
IFLA_GSO_MAX_SEGS = 0x28
IFLA_GSO_MAX_SIZE = 0x29
IFLA_PAD = 0x2a
IFLA_XDP = 0x2b
IFLA_EVENT = 0x2c
IFLA_NEW_NETNSID = 0x2d
IFLA_IF_NETNSID = 0x2e
IFLA_MAX = 0x33
RT_SCOPE_UNIVERSE = 0x0
RT_SCOPE_SITE = 0xc8
RT_SCOPE_LINK = 0xfd
RT_SCOPE_HOST = 0xfe
RT_SCOPE_NOWHERE = 0xff
RT_TABLE_UNSPEC = 0x0
RT_TABLE_COMPAT = 0xfc
RT_TABLE_DEFAULT = 0xfd
RT_TABLE_MAIN = 0xfe
RT_TABLE_LOCAL = 0xff
RT_TABLE_MAX = 0xffffffff
RTA_UNSPEC = 0x0
RTA_DST = 0x1
RTA_SRC = 0x2
RTA_IIF = 0x3
RTA_OIF = 0x4
RTA_GATEWAY = 0x5
RTA_PRIORITY = 0x6
RTA_PREFSRC = 0x7
RTA_METRICS = 0x8
RTA_MULTIPATH = 0x9
RTA_FLOW = 0xb
RTA_CACHEINFO = 0xc
RTA_TABLE = 0xf
RTA_MARK = 0x10
RTA_MFC_STATS = 0x11
RTA_VIA = 0x12
RTA_NEWDST = 0x13
RTA_PREF = 0x14
RTA_ENCAP_TYPE = 0x15
RTA_ENCAP = 0x16
RTA_EXPIRES = 0x17
RTA_PAD = 0x18
RTA_UID = 0x19
RTA_TTL_PROPAGATE = 0x1a
RTA_IP_PROTO = 0x1b
RTA_SPORT = 0x1c
RTA_DPORT = 0x1d
RTN_UNSPEC = 0x0
RTN_UNICAST = 0x1
RTN_LOCAL = 0x2
RTN_BROADCAST = 0x3
RTN_ANYCAST = 0x4
RTN_MULTICAST = 0x5
RTN_BLACKHOLE = 0x6
RTN_UNREACHABLE = 0x7
RTN_PROHIBIT = 0x8
RTN_THROW = 0x9
RTN_NAT = 0xa
RTN_XRESOLVE = 0xb
RTNLGRP_NONE = 0x0
RTNLGRP_LINK = 0x1
RTNLGRP_NOTIFY = 0x2
RTNLGRP_NEIGH = 0x3
RTNLGRP_TC = 0x4
RTNLGRP_IPV4_IFADDR = 0x5
RTNLGRP_IPV4_MROUTE = 0x6
RTNLGRP_IPV4_ROUTE = 0x7
RTNLGRP_IPV4_RULE = 0x8
RTNLGRP_IPV6_IFADDR = 0x9
RTNLGRP_IPV6_MROUTE = 0xa
RTNLGRP_IPV6_ROUTE = 0xb
RTNLGRP_IPV6_IFINFO = 0xc
RTNLGRP_IPV6_PREFIX = 0x12
RTNLGRP_IPV6_RULE = 0x13
RTNLGRP_ND_USEROPT = 0x14
SizeofNlMsghdr = 0x10
SizeofNlMsgerr = 0x14
SizeofRtGenmsg = 0x1
SizeofNlAttr = 0x4
SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8
)
type NlMsghdr struct {
Len uint32
Type uint16
Flags uint16
Seq uint32
Pid uint32
}
type NlMsgerr struct {
Error int32
Msg NlMsghdr
}
type RtGenmsg struct {
Family uint8
}
type NlAttr struct {
Len uint16
Type uint16
}
type RtAttr struct {
Len uint16
Type uint16
}
type IfInfomsg struct {
Family uint8
_ uint8
Type uint16
Index int32
Flags uint32
Change uint32
}
type IfAddrmsg struct {
Family uint8
Prefixlen uint8
Flags uint8
Scope uint8
Index uint32
}
type RtMsg struct {
Family uint8
Dst_len uint8
Src_len uint8
Tos uint8
Table uint8
Protocol uint8
Scope uint8
Type uint8
Flags uint32
}
type RtNexthop struct {
Len uint16
Flags uint8
Hops uint8
Ifindex int32
}
const (
SizeofSockFilter = 0x8
SizeofSockFprog = 0x10
)
type SockFilter struct {
Code uint16
Jt uint8
Jf uint8
K uint32
}
type SockFprog struct {
Len uint16
Filter *SockFilter
}
type InotifyEvent struct {
Wd int32
Mask uint32
Cookie uint32
Len uint32
}
const SizeofInotifyEvent = 0x10
type PtraceRegs struct {
Regs [32]uint64
Lo uint64
Hi uint64
Epc uint64
Badvaddr uint64
Status uint64
Cause uint64
}
type FdSet struct {
Bits [16]int64
}
type Sysinfo_t struct {
Uptime int64
Loads [3]uint64
Totalram uint64
Freeram uint64
Sharedram uint64
Bufferram uint64
Totalswap uint64
Freeswap uint64
Procs uint16
Pad uint16
Totalhigh uint64
Freehigh uint64
Unit uint32
_ [0]int8
_ [4]byte
}
type Utsname struct {
Sysname [65]byte
Nodename [65]byte
Release [65]byte
Version [65]byte
Machine [65]byte
Domainname [65]byte
}
type Ustat_t struct {
Tfree int32
Tinode uint64
Fname [6]int8
Fpack [6]int8
_ [4]byte
}
type EpollEvent struct {
Events uint32
Fd int32
Pad int32
}
const (
AT_EMPTY_PATH = 0x1000
AT_FDCWD = -0x64
AT_NO_AUTOMOUNT = 0x800
AT_REMOVEDIR = 0x200
AT_STATX_SYNC_AS_STAT = 0x0
AT_STATX_FORCE_SYNC = 0x2000
AT_STATX_DONT_SYNC = 0x4000
AT_SYMLINK_FOLLOW = 0x400
AT_SYMLINK_NOFOLLOW = 0x100
AT_EACCESS = 0x200
)
type PollFd struct {
Fd int32
Events int16
Revents int16
}
const (
POLLIN = 0x1
POLLPRI = 0x2
POLLOUT = 0x4
POLLRDHUP = 0x2000
POLLERR = 0x8
POLLHUP = 0x10
POLLNVAL = 0x20
)
type Sigset_t struct {
Val [16]uint64
}
type SignalfdSiginfo struct {
Signo uint32
Errno int32
Code int32
Pid uint32
Uid uint32
Fd int32
Tid uint32
Band uint32
Overrun uint32
Trapno uint32
Status int32
Int int32
Ptr uint64
Utime uint64
Stime uint64
Addr uint64
Addr_lsb uint16
_ uint16
Syscall int32
Call_addr uint64
Arch uint32
_ [28]uint8
}
const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Line uint8
Cc [23]uint8
Ispeed uint32
Ospeed uint32
}
type Winsize struct {
Row uint16
Col uint16
Xpixel uint16
Ypixel uint16
}
type Taskstats struct {
Version uint16
Ac_exitcode uint32
Ac_flag uint8
Ac_nice uint8
Cpu_count uint64
Cpu_delay_total uint64
Blkio_count uint64
Blkio_delay_total uint64
Swapin_count uint64
Swapin_delay_total uint64
Cpu_run_real_total uint64
Cpu_run_virtual_total uint64
Ac_comm [32]int8
Ac_sched uint8
Ac_pad [3]uint8
_ [4]byte
Ac_uid uint32
Ac_gid uint32
Ac_pid uint32
Ac_ppid uint32
Ac_btime uint32
Ac_etime uint64
Ac_utime uint64
Ac_stime uint64
Ac_minflt uint64
Ac_majflt uint64
Coremem uint64
Virtmem uint64
Hiwater_rss uint64
Hiwater_vm uint64
Read_char uint64
Write_char uint64
Read_syscalls uint64
Write_syscalls uint64
Read_bytes uint64
Write_bytes uint64
Cancelled_write_bytes uint64
Nvcsw uint64
Nivcsw uint64
Ac_utimescaled uint64
Ac_stimescaled uint64
Cpu_scaled_run_real_total uint64
Freepages_count uint64
Freepages_delay_total uint64
Thrashing_count uint64
Thrashing_delay_total uint64
}
const (
TASKSTATS_CMD_UNSPEC = 0x0
TASKSTATS_CMD_GET = 0x1
TASKSTATS_CMD_NEW = 0x2
TASKSTATS_TYPE_UNSPEC = 0x0
TASKSTATS_TYPE_PID = 0x1
TASKSTATS_TYPE_TGID = 0x2
TASKSTATS_TYPE_STATS = 0x3
TASKSTATS_TYPE_AGGR_PID = 0x4
TASKSTATS_TYPE_AGGR_TGID = 0x5
TASKSTATS_TYPE_NULL = 0x6
TASKSTATS_CMD_ATTR_UNSPEC = 0x0
TASKSTATS_CMD_ATTR_PID = 0x1
TASKSTATS_CMD_ATTR_TGID = 0x2
TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3
TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4
)
type CGroupStats struct {
Sleeping uint64
Running uint64
Stopped uint64
Uninterruptible uint64
Io_wait uint64
}
const (
CGROUPSTATS_CMD_UNSPEC = 0x3
CGROUPSTATS_CMD_GET = 0x4
CGROUPSTATS_CMD_NEW = 0x5
CGROUPSTATS_TYPE_UNSPEC = 0x0
CGROUPSTATS_TYPE_CGROUP_STATS = 0x1
CGROUPSTATS_CMD_ATTR_UNSPEC = 0x0
CGROUPSTATS_CMD_ATTR_FD = 0x1
)
type Genlmsghdr struct {
Cmd uint8
Version uint8
Reserved uint16
}
const (
CTRL_CMD_UNSPEC = 0x0
CTRL_CMD_NEWFAMILY = 0x1
CTRL_CMD_DELFAMILY = 0x2
CTRL_CMD_GETFAMILY = 0x3
CTRL_CMD_NEWOPS = 0x4
CTRL_CMD_DELOPS = 0x5
CTRL_CMD_GETOPS = 0x6
CTRL_CMD_NEWMCAST_GRP = 0x7
CTRL_CMD_DELMCAST_GRP = 0x8
CTRL_CMD_GETMCAST_GRP = 0x9
CTRL_ATTR_UNSPEC = 0x0
CTRL_ATTR_FAMILY_ID = 0x1
CTRL_ATTR_FAMILY_NAME = 0x2
CTRL_ATTR_VERSION = 0x3
CTRL_ATTR_HDRSIZE = 0x4
CTRL_ATTR_MAXATTR = 0x5
CTRL_ATTR_OPS = 0x6
CTRL_ATTR_MCAST_GROUPS = 0x7
CTRL_ATTR_OP_UNSPEC = 0x0
CTRL_ATTR_OP_ID = 0x1
CTRL_ATTR_OP_FLAGS = 0x2
CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0
CTRL_ATTR_MCAST_GRP_NAME = 0x1
CTRL_ATTR_MCAST_GRP_ID = 0x2
)
type cpuMask uint64
const (
_CPU_SETSIZE = 0x400
_NCPUBITS = 0x40
)
const (
BDADDR_BREDR = 0x0
BDADDR_LE_PUBLIC = 0x1
BDADDR_LE_RANDOM = 0x2
)
type PerfEventAttr struct {
Type uint32
Size uint32
Config uint64
Sample uint64
Sample_type uint64
Read_format uint64
Bits uint64
Wakeup uint32
Bp_type uint32
Ext1 uint64
Ext2 uint64
Branch_sample_type uint64
Sample_regs_user uint64
Sample_stack_user uint32
Clockid int32
Sample_regs_intr uint64
Aux_watermark uint32
_ uint32
}
type PerfEventMmapPage struct {
Version uint32
Compat_version uint32
Lock uint32
Index uint32
Offset int64
Time_enabled uint64
Time_running uint64
Capabilities uint64
Pmc_width uint16
Time_shift uint16
Time_mult uint32
Time_offset uint64
Time_zero uint64
Size uint32
_ [948]uint8
Data_head uint64
Data_tail uint64
Data_offset uint64
Data_size uint64
Aux_head uint64
Aux_tail uint64
Aux_offset uint64
Aux_size uint64
}
const (
PerfBitDisabled uint64 = CBitFieldMaskBit0
PerfBitInherit = CBitFieldMaskBit1
PerfBitPinned = CBitFieldMaskBit2
PerfBitExclusive = CBitFieldMaskBit3
PerfBitExcludeUser = CBitFieldMaskBit4
PerfBitExcludeKernel = CBitFieldMaskBit5
PerfBitExcludeHv = CBitFieldMaskBit6
PerfBitExcludeIdle = CBitFieldMaskBit7
PerfBitMmap = CBitFieldMaskBit8
PerfBitComm = CBitFieldMaskBit9
PerfBitFreq = CBitFieldMaskBit10
PerfBitInheritStat = CBitFieldMaskBit11
PerfBitEnableOnExec = CBitFieldMaskBit12
PerfBitTask = CBitFieldMaskBit13
PerfBitWatermark = CBitFieldMaskBit14
PerfBitPreciseIPBit1 = CBitFieldMaskBit15
PerfBitPreciseIPBit2 = CBitFieldMaskBit16
PerfBitMmapData = CBitFieldMaskBit17
PerfBitSampleIDAll = CBitFieldMaskBit18
PerfBitExcludeHost = CBitFieldMaskBit19
PerfBitExcludeGuest = CBitFieldMaskBit20
PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
PerfBitExcludeCallchainUser = CBitFieldMaskBit22
PerfBitMmap2 = CBitFieldMaskBit23
PerfBitCommExec = CBitFieldMaskBit24
PerfBitUseClockID = CBitFieldMaskBit25
PerfBitContextSwitch = CBitFieldMaskBit26
)
const (
PERF_TYPE_HARDWARE = 0x0
PERF_TYPE_SOFTWARE = 0x1
PERF_TYPE_TRACEPOINT = 0x2
PERF_TYPE_HW_CACHE = 0x3
PERF_TYPE_RAW = 0x4
PERF_TYPE_BREAKPOINT = 0x5
PERF_COUNT_HW_CPU_CYCLES = 0x0
PERF_COUNT_HW_INSTRUCTIONS = 0x1
PERF_COUNT_HW_CACHE_REFERENCES = 0x2
PERF_COUNT_HW_CACHE_MISSES = 0x3
PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
PERF_COUNT_HW_BRANCH_MISSES = 0x5
PERF_COUNT_HW_BUS_CYCLES = 0x6
PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
PERF_COUNT_HW_CACHE_L1D = 0x0
PERF_COUNT_HW_CACHE_L1I = 0x1
PERF_COUNT_HW_CACHE_LL = 0x2
PERF_COUNT_HW_CACHE_DTLB = 0x3
PERF_COUNT_HW_CACHE_ITLB = 0x4
PERF_COUNT_HW_CACHE_BPU = 0x5
PERF_COUNT_HW_CACHE_NODE = 0x6
PERF_COUNT_HW_CACHE_OP_READ = 0x0
PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
PERF_COUNT_SW_CPU_CLOCK = 0x0
PERF_COUNT_SW_TASK_CLOCK = 0x1
PERF_COUNT_SW_PAGE_FAULTS = 0x2
PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
PERF_COUNT_SW_EMULATION_FAULTS = 0x8
PERF_COUNT_SW_DUMMY = 0x9
PERF_SAMPLE_IP = 0x1
PERF_SAMPLE_TID = 0x2
PERF_SAMPLE_TIME = 0x4
PERF_SAMPLE_ADDR = 0x8
PERF_SAMPLE_READ = 0x10
PERF_SAMPLE_CALLCHAIN = 0x20
PERF_SAMPLE_ID = 0x40
PERF_SAMPLE_CPU = 0x80
PERF_SAMPLE_PERIOD = 0x100
PERF_SAMPLE_STREAM_ID = 0x200
PERF_SAMPLE_RAW = 0x400
PERF_SAMPLE_BRANCH_STACK = 0x800
PERF_SAMPLE_BRANCH_USER = 0x1
PERF_SAMPLE_BRANCH_KERNEL = 0x2
PERF_SAMPLE_BRANCH_HV = 0x4
PERF_SAMPLE_BRANCH_ANY = 0x8
PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
PERF_SAMPLE_BRANCH_IND_CALL = 0x40
PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
PERF_FORMAT_ID = 0x4
PERF_FORMAT_GROUP = 0x8
PERF_RECORD_MMAP = 0x1
PERF_RECORD_LOST = 0x2
PERF_RECORD_COMM = 0x3
PERF_RECORD_EXIT = 0x4
PERF_RECORD_THROTTLE = 0x5
PERF_RECORD_UNTHROTTLE = 0x6
PERF_RECORD_FORK = 0x7
PERF_RECORD_READ = 0x8
PERF_RECORD_SAMPLE = 0x9
PERF_CONTEXT_HV = -0x20
PERF_CONTEXT_KERNEL = -0x80
PERF_CONTEXT_USER = -0x200
PERF_CONTEXT_GUEST = -0x800
PERF_CONTEXT_GUEST_KERNEL = -0x880
PERF_CONTEXT_GUEST_USER = -0xa00
PERF_FLAG_FD_NO_GROUP = 0x1
PERF_FLAG_FD_OUTPUT = 0x2
PERF_FLAG_PID_CGROUP = 0x4
)
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
CBitFieldMaskBit2 = 0x4
CBitFieldMaskBit3 = 0x8
CBitFieldMaskBit4 = 0x10
CBitFieldMaskBit5 = 0x20
CBitFieldMaskBit6 = 0x40
CBitFieldMaskBit7 = 0x80
CBitFieldMaskBit8 = 0x100
CBitFieldMaskBit9 = 0x200
CBitFieldMaskBit10 = 0x400
CBitFieldMaskBit11 = 0x800
CBitFieldMaskBit12 = 0x1000
CBitFieldMaskBit13 = 0x2000
CBitFieldMaskBit14 = 0x4000
CBitFieldMaskBit15 = 0x8000
CBitFieldMaskBit16 = 0x10000
CBitFieldMaskBit17 = 0x20000
CBitFieldMaskBit18 = 0x40000
CBitFieldMaskBit19 = 0x80000
CBitFieldMaskBit20 = 0x100000
CBitFieldMaskBit21 = 0x200000
CBitFieldMaskBit22 = 0x400000
CBitFieldMaskBit23 = 0x800000
CBitFieldMaskBit24 = 0x1000000
CBitFieldMaskBit25 = 0x2000000
CBitFieldMaskBit26 = 0x4000000
CBitFieldMaskBit27 = 0x8000000
CBitFieldMaskBit28 = 0x10000000
CBitFieldMaskBit29 = 0x20000000
CBitFieldMaskBit30 = 0x40000000
CBitFieldMaskBit31 = 0x80000000
CBitFieldMaskBit32 = 0x100000000
CBitFieldMaskBit33 = 0x200000000
CBitFieldMaskBit34 = 0x400000000
CBitFieldMaskBit35 = 0x800000000
CBitFieldMaskBit36 = 0x1000000000
CBitFieldMaskBit37 = 0x2000000000
CBitFieldMaskBit38 = 0x4000000000
CBitFieldMaskBit39 = 0x8000000000
CBitFieldMaskBit40 = 0x10000000000
CBitFieldMaskBit41 = 0x20000000000
CBitFieldMaskBit42 = 0x40000000000
CBitFieldMaskBit43 = 0x80000000000
CBitFieldMaskBit44 = 0x100000000000
CBitFieldMaskBit45 = 0x200000000000
CBitFieldMaskBit46 = 0x400000000000
CBitFieldMaskBit47 = 0x800000000000
CBitFieldMaskBit48 = 0x1000000000000
CBitFieldMaskBit49 = 0x2000000000000
CBitFieldMaskBit50 = 0x4000000000000
CBitFieldMaskBit51 = 0x8000000000000
CBitFieldMaskBit52 = 0x10000000000000
CBitFieldMaskBit53 = 0x20000000000000
CBitFieldMaskBit54 = 0x40000000000000
CBitFieldMaskBit55 = 0x80000000000000
CBitFieldMaskBit56 = 0x100000000000000
CBitFieldMaskBit57 = 0x200000000000000
CBitFieldMaskBit58 = 0x400000000000000
CBitFieldMaskBit59 = 0x800000000000000
CBitFieldMaskBit60 = 0x1000000000000000
CBitFieldMaskBit61 = 0x2000000000000000
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
type HDDriveCmdHdr struct {
Command uint8
Number uint8
Feature uint8
Count uint8
}
type HDGeometry struct {
Heads uint8
Sectors uint8
Cylinders uint16
Start uint64
}
type HDDriveID struct {
Config uint16
Cyls uint16
Reserved2 uint16
Heads uint16
Track_bytes uint16
Sector_bytes uint16
Sectors uint16
Vendor0 uint16
Vendor1 uint16
Vendor2 uint16
Serial_no [20]uint8
Buf_type uint16
Buf_size uint16
Ecc_bytes uint16
Fw_rev [8]uint8
Model [40]uint8
Max_multsect uint8
Vendor3 uint8
Dword_io uint16
Vendor4 uint8
Capability uint8
Reserved50 uint16
Vendor5 uint8
TPIO uint8
Vendor6 uint8
TDMA uint8
Field_valid uint16
Cur_cyls uint16
Cur_heads uint16
Cur_sectors uint16
Cur_capacity0 uint16
Cur_capacity1 uint16
Multsect uint8
Multsect_valid uint8
Lba_capacity uint32
Dma_1word uint16
Dma_mword uint16
Eide_pio_modes uint16
Eide_dma_min uint16
Eide_dma_time uint16
Eide_pio uint16
Eide_pio_iordy uint16
Words69_70 [2]uint16
Words71_74 [4]uint16
Queue_depth uint16
Words76_79 [4]uint16
Major_rev_num uint16
Minor_rev_num uint16
Command_set_1 uint16
Command_set_2 uint16
Cfsse uint16
Cfs_enable_1 uint16
Cfs_enable_2 uint16
Csf_default uint16
Dma_ultra uint16
Trseuc uint16
TrsEuc uint16
CurAPMvalues uint16
Mprc uint16
Hw_config uint16
Acoustic uint16
Msrqs uint16
Sxfert uint16
Sal uint16
Spg uint32
Lba_capacity_2 uint64
Words104_125 [22]uint16
Last_lun uint16
Word127 uint16
Dlf uint16
Csfo uint16
Words130_155 [26]uint16
Word156 uint16
Words157_159 [3]uint16
Cfa_power uint16
Words161_175 [15]uint16
Words176_205 [30]uint16
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Frsize int64
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int64
Flags int64
Spare [5]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
const (
NF_INET_PRE_ROUTING = 0x0
NF_INET_LOCAL_IN = 0x1
NF_INET_FORWARD = 0x2
NF_INET_LOCAL_OUT = 0x3
NF_INET_POST_ROUTING = 0x4
NF_INET_NUMHOOKS = 0x5
)
const (
NF_NETDEV_INGRESS = 0x0
NF_NETDEV_NUMHOOKS = 0x1
)
const (
NFPROTO_UNSPEC = 0x0
NFPROTO_INET = 0x1
NFPROTO_IPV4 = 0x2
NFPROTO_ARP = 0x3
NFPROTO_NETDEV = 0x5
NFPROTO_BRIDGE = 0x7
NFPROTO_IPV6 = 0xa
NFPROTO_DECNET = 0xc
NFPROTO_NUMPROTO = 0xd
)
type Nfgenmsg struct {
Nfgen_family uint8
Version uint8
Res_id uint16
}
const (
NFNL_BATCH_UNSPEC = 0x0
NFNL_BATCH_GENID = 0x1
)
const (
NFT_REG_VERDICT = 0x0
NFT_REG_1 = 0x1
NFT_REG_2 = 0x2
NFT_REG_3 = 0x3
NFT_REG_4 = 0x4
NFT_REG32_00 = 0x8
NFT_REG32_01 = 0x9
NFT_REG32_02 = 0xa
NFT_REG32_03 = 0xb
NFT_REG32_04 = 0xc
NFT_REG32_05 = 0xd
NFT_REG32_06 = 0xe
NFT_REG32_07 = 0xf
NFT_REG32_08 = 0x10
NFT_REG32_09 = 0x11
NFT_REG32_10 = 0x12
NFT_REG32_11 = 0x13
NFT_REG32_12 = 0x14
NFT_REG32_13 = 0x15
NFT_REG32_14 = 0x16
NFT_REG32_15 = 0x17
NFT_CONTINUE = -0x1
NFT_BREAK = -0x2
NFT_JUMP = -0x3
NFT_GOTO = -0x4
NFT_RETURN = -0x5
NFT_MSG_NEWTABLE = 0x0
NFT_MSG_GETTABLE = 0x1
NFT_MSG_DELTABLE = 0x2
NFT_MSG_NEWCHAIN = 0x3
NFT_MSG_GETCHAIN = 0x4
NFT_MSG_DELCHAIN = 0x5
NFT_MSG_NEWRULE = 0x6
NFT_MSG_GETRULE = 0x7
NFT_MSG_DELRULE = 0x8
NFT_MSG_NEWSET = 0x9
NFT_MSG_GETSET = 0xa
NFT_MSG_DELSET = 0xb
NFT_MSG_NEWSETELEM = 0xc
NFT_MSG_GETSETELEM = 0xd
NFT_MSG_DELSETELEM = 0xe
NFT_MSG_NEWGEN = 0xf
NFT_MSG_GETGEN = 0x10
NFT_MSG_TRACE = 0x11
NFT_MSG_NEWOBJ = 0x12
NFT_MSG_GETOBJ = 0x13
NFT_MSG_DELOBJ = 0x14
NFT_MSG_GETOBJ_RESET = 0x15
NFT_MSG_MAX = 0x19
NFTA_LIST_UNPEC = 0x0
NFTA_LIST_ELEM = 0x1
NFTA_HOOK_UNSPEC = 0x0
NFTA_HOOK_HOOKNUM = 0x1
NFTA_HOOK_PRIORITY = 0x2
NFTA_HOOK_DEV = 0x3
NFT_TABLE_F_DORMANT = 0x1
NFTA_TABLE_UNSPEC = 0x0
NFTA_TABLE_NAME = 0x1
NFTA_TABLE_FLAGS = 0x2
NFTA_TABLE_USE = 0x3
NFTA_CHAIN_UNSPEC = 0x0
NFTA_CHAIN_TABLE = 0x1
NFTA_CHAIN_HANDLE = 0x2
NFTA_CHAIN_NAME = 0x3
NFTA_CHAIN_HOOK = 0x4
NFTA_CHAIN_POLICY = 0x5
NFTA_CHAIN_USE = 0x6
NFTA_CHAIN_TYPE = 0x7
NFTA_CHAIN_COUNTERS = 0x8
NFTA_CHAIN_PAD = 0x9
NFTA_RULE_UNSPEC = 0x0
NFTA_RULE_TABLE = 0x1
NFTA_RULE_CHAIN = 0x2
NFTA_RULE_HANDLE = 0x3
NFTA_RULE_EXPRESSIONS = 0x4
NFTA_RULE_COMPAT = 0x5
NFTA_RULE_POSITION = 0x6
NFTA_RULE_USERDATA = 0x7
NFTA_RULE_PAD = 0x8
NFTA_RULE_ID = 0x9
NFT_RULE_COMPAT_F_INV = 0x2
NFT_RULE_COMPAT_F_MASK = 0x2
NFTA_RULE_COMPAT_UNSPEC = 0x0
NFTA_RULE_COMPAT_PROTO = 0x1
NFTA_RULE_COMPAT_FLAGS = 0x2
NFT_SET_ANONYMOUS = 0x1
NFT_SET_CONSTANT = 0x2
NFT_SET_INTERVAL = 0x4
NFT_SET_MAP = 0x8
NFT_SET_TIMEOUT = 0x10
NFT_SET_EVAL = 0x20
NFT_SET_OBJECT = 0x40
NFT_SET_POL_PERFORMANCE = 0x0
NFT_SET_POL_MEMORY = 0x1
NFTA_SET_DESC_UNSPEC = 0x0
NFTA_SET_DESC_SIZE = 0x1
NFTA_SET_UNSPEC = 0x0
NFTA_SET_TABLE = 0x1
NFTA_SET_NAME = 0x2
NFTA_SET_FLAGS = 0x3
NFTA_SET_KEY_TYPE = 0x4
NFTA_SET_KEY_LEN = 0x5
NFTA_SET_DATA_TYPE = 0x6
NFTA_SET_DATA_LEN = 0x7
NFTA_SET_POLICY = 0x8
NFTA_SET_DESC = 0x9
NFTA_SET_ID = 0xa
NFTA_SET_TIMEOUT = 0xb
NFTA_SET_GC_INTERVAL = 0xc
NFTA_SET_USERDATA = 0xd
NFTA_SET_PAD = 0xe
NFTA_SET_OBJ_TYPE = 0xf
NFT_SET_ELEM_INTERVAL_END = 0x1
NFTA_SET_ELEM_UNSPEC = 0x0
NFTA_SET_ELEM_KEY = 0x1
NFTA_SET_ELEM_DATA = 0x2
NFTA_SET_ELEM_FLAGS = 0x3
NFTA_SET_ELEM_TIMEOUT = 0x4
NFTA_SET_ELEM_EXPIRATION = 0x5
NFTA_SET_ELEM_USERDATA = 0x6
NFTA_SET_ELEM_EXPR = 0x7
NFTA_SET_ELEM_PAD = 0x8
NFTA_SET_ELEM_OBJREF = 0x9
NFTA_SET_ELEM_LIST_UNSPEC = 0x0
NFTA_SET_ELEM_LIST_TABLE = 0x1
NFTA_SET_ELEM_LIST_SET = 0x2
NFTA_SET_ELEM_LIST_ELEMENTS = 0x3
NFTA_SET_ELEM_LIST_SET_ID = 0x4
NFT_DATA_VALUE = 0x0
NFT_DATA_VERDICT = 0xffffff00
NFTA_DATA_UNSPEC = 0x0
NFTA_DATA_VALUE = 0x1
NFTA_DATA_VERDICT = 0x2
NFTA_VERDICT_UNSPEC = 0x0
NFTA_VERDICT_CODE = 0x1
NFTA_VERDICT_CHAIN = 0x2
NFTA_EXPR_UNSPEC = 0x0
NFTA_EXPR_NAME = 0x1
NFTA_EXPR_DATA = 0x2
NFTA_IMMEDIATE_UNSPEC = 0x0
NFTA_IMMEDIATE_DREG = 0x1
NFTA_IMMEDIATE_DATA = 0x2
NFTA_BITWISE_UNSPEC = 0x0
NFTA_BITWISE_SREG = 0x1
NFTA_BITWISE_DREG = 0x2
NFTA_BITWISE_LEN = 0x3
NFTA_BITWISE_MASK = 0x4
NFTA_BITWISE_XOR = 0x5
NFT_BYTEORDER_NTOH = 0x0
NFT_BYTEORDER_HTON = 0x1
NFTA_BYTEORDER_UNSPEC = 0x0
NFTA_BYTEORDER_SREG = 0x1
NFTA_BYTEORDER_DREG = 0x2
NFTA_BYTEORDER_OP = 0x3
NFTA_BYTEORDER_LEN = 0x4
NFTA_BYTEORDER_SIZE = 0x5
NFT_CMP_EQ = 0x0
NFT_CMP_NEQ = 0x1
NFT_CMP_LT = 0x2
NFT_CMP_LTE = 0x3
NFT_CMP_GT = 0x4
NFT_CMP_GTE = 0x5
NFTA_CMP_UNSPEC = 0x0
NFTA_CMP_SREG = 0x1
NFTA_CMP_OP = 0x2
NFTA_CMP_DATA = 0x3
NFT_RANGE_EQ = 0x0
NFT_RANGE_NEQ = 0x1
NFTA_RANGE_UNSPEC = 0x0
NFTA_RANGE_SREG = 0x1
NFTA_RANGE_OP = 0x2
NFTA_RANGE_FROM_DATA = 0x3
NFTA_RANGE_TO_DATA = 0x4
NFT_LOOKUP_F_INV = 0x1
NFTA_LOOKUP_UNSPEC = 0x0
NFTA_LOOKUP_SET = 0x1
NFTA_LOOKUP_SREG = 0x2
NFTA_LOOKUP_DREG = 0x3
NFTA_LOOKUP_SET_ID = 0x4
NFTA_LOOKUP_FLAGS = 0x5
NFT_DYNSET_OP_ADD = 0x0
NFT_DYNSET_OP_UPDATE = 0x1
NFT_DYNSET_F_INV = 0x1
NFTA_DYNSET_UNSPEC = 0x0
NFTA_DYNSET_SET_NAME = 0x1
NFTA_DYNSET_SET_ID = 0x2
NFTA_DYNSET_OP = 0x3
NFTA_DYNSET_SREG_KEY = 0x4
NFTA_DYNSET_SREG_DATA = 0x5
NFTA_DYNSET_TIMEOUT = 0x6
NFTA_DYNSET_EXPR = 0x7
NFTA_DYNSET_PAD = 0x8
NFTA_DYNSET_FLAGS = 0x9
NFT_PAYLOAD_LL_HEADER = 0x0
NFT_PAYLOAD_NETWORK_HEADER = 0x1
NFT_PAYLOAD_TRANSPORT_HEADER = 0x2
NFT_PAYLOAD_CSUM_NONE = 0x0
NFT_PAYLOAD_CSUM_INET = 0x1
NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1
NFTA_PAYLOAD_UNSPEC = 0x0
NFTA_PAYLOAD_DREG = 0x1
NFTA_PAYLOAD_BASE = 0x2
NFTA_PAYLOAD_OFFSET = 0x3
NFTA_PAYLOAD_LEN = 0x4
NFTA_PAYLOAD_SREG = 0x5
NFTA_PAYLOAD_CSUM_TYPE = 0x6
NFTA_PAYLOAD_CSUM_OFFSET = 0x7
NFTA_PAYLOAD_CSUM_FLAGS = 0x8
NFT_EXTHDR_F_PRESENT = 0x1
NFT_EXTHDR_OP_IPV6 = 0x0
NFT_EXTHDR_OP_TCPOPT = 0x1
NFTA_EXTHDR_UNSPEC = 0x0
NFTA_EXTHDR_DREG = 0x1
NFTA_EXTHDR_TYPE = 0x2
NFTA_EXTHDR_OFFSET = 0x3
NFTA_EXTHDR_LEN = 0x4
NFTA_EXTHDR_FLAGS = 0x5
NFTA_EXTHDR_OP = 0x6
NFTA_EXTHDR_SREG = 0x7
NFT_META_LEN = 0x0
NFT_META_PROTOCOL = 0x1
NFT_META_PRIORITY = 0x2
NFT_META_MARK = 0x3
NFT_META_IIF = 0x4
NFT_META_OIF = 0x5
NFT_META_IIFNAME = 0x6
NFT_META_OIFNAME = 0x7
NFT_META_IIFTYPE = 0x8
NFT_META_OIFTYPE = 0x9
NFT_META_SKUID = 0xa
NFT_META_SKGID = 0xb
NFT_META_NFTRACE = 0xc
NFT_META_RTCLASSID = 0xd
NFT_META_SECMARK = 0xe
NFT_META_NFPROTO = 0xf
NFT_META_L4PROTO = 0x10
NFT_META_BRI_IIFNAME = 0x11
NFT_META_BRI_OIFNAME = 0x12
NFT_META_PKTTYPE = 0x13
NFT_META_CPU = 0x14
NFT_META_IIFGROUP = 0x15
NFT_META_OIFGROUP = 0x16
NFT_META_CGROUP = 0x17
NFT_META_PRANDOM = 0x18
NFT_RT_CLASSID = 0x0
NFT_RT_NEXTHOP4 = 0x1
NFT_RT_NEXTHOP6 = 0x2
NFT_RT_TCPMSS = 0x3
NFT_HASH_JENKINS = 0x0
NFT_HASH_SYM = 0x1
NFTA_HASH_UNSPEC = 0x0
NFTA_HASH_SREG = 0x1
NFTA_HASH_DREG = 0x2
NFTA_HASH_LEN = 0x3
NFTA_HASH_MODULUS = 0x4
NFTA_HASH_SEED = 0x5
NFTA_HASH_OFFSET = 0x6
NFTA_HASH_TYPE = 0x7
NFTA_META_UNSPEC = 0x0
NFTA_META_DREG = 0x1
NFTA_META_KEY = 0x2
NFTA_META_SREG = 0x3
NFTA_RT_UNSPEC = 0x0
NFTA_RT_DREG = 0x1
NFTA_RT_KEY = 0x2
NFT_CT_STATE = 0x0
NFT_CT_DIRECTION = 0x1
NFT_CT_STATUS = 0x2
NFT_CT_MARK = 0x3
NFT_CT_SECMARK = 0x4
NFT_CT_EXPIRATION = 0x5
NFT_CT_HELPER = 0x6
NFT_CT_L3PROTOCOL = 0x7
NFT_CT_SRC = 0x8
NFT_CT_DST = 0x9
NFT_CT_PROTOCOL = 0xa
NFT_CT_PROTO_SRC = 0xb
NFT_CT_PROTO_DST = 0xc
NFT_CT_LABELS = 0xd
NFT_CT_PKTS = 0xe
NFT_CT_BYTES = 0xf
NFT_CT_AVGPKT = 0x10
NFT_CT_ZONE = 0x11
NFT_CT_EVENTMASK = 0x12
NFTA_CT_UNSPEC = 0x0
NFTA_CT_DREG = 0x1
NFTA_CT_KEY = 0x2
NFTA_CT_DIRECTION = 0x3
NFTA_CT_SREG = 0x4
NFT_LIMIT_PKTS = 0x0
NFT_LIMIT_PKT_BYTES = 0x1
NFT_LIMIT_F_INV = 0x1
NFTA_LIMIT_UNSPEC = 0x0
NFTA_LIMIT_RATE = 0x1
NFTA_LIMIT_UNIT = 0x2
NFTA_LIMIT_BURST = 0x3
NFTA_LIMIT_TYPE = 0x4
NFTA_LIMIT_FLAGS = 0x5
NFTA_LIMIT_PAD = 0x6
NFTA_COUNTER_UNSPEC = 0x0
NFTA_COUNTER_BYTES = 0x1
NFTA_COUNTER_PACKETS = 0x2
NFTA_COUNTER_PAD = 0x3
NFTA_LOG_UNSPEC = 0x0
NFTA_LOG_GROUP = 0x1
NFTA_LOG_PREFIX = 0x2
NFTA_LOG_SNAPLEN = 0x3
NFTA_LOG_QTHRESHOLD = 0x4
NFTA_LOG_LEVEL = 0x5
NFTA_LOG_FLAGS = 0x6
NFTA_QUEUE_UNSPEC = 0x0
NFTA_QUEUE_NUM = 0x1
NFTA_QUEUE_TOTAL = 0x2
NFTA_QUEUE_FLAGS = 0x3
NFTA_QUEUE_SREG_QNUM = 0x4
NFT_QUOTA_F_INV = 0x1
NFT_QUOTA_F_DEPLETED = 0x2
NFTA_QUOTA_UNSPEC = 0x0
NFTA_QUOTA_BYTES = 0x1
NFTA_QUOTA_FLAGS = 0x2
NFTA_QUOTA_PAD = 0x3
NFTA_QUOTA_CONSUMED = 0x4
NFT_REJECT_ICMP_UNREACH = 0x0
NFT_REJECT_TCP_RST = 0x1
NFT_REJECT_ICMPX_UNREACH = 0x2
NFT_REJECT_ICMPX_NO_ROUTE = 0x0
NFT_REJECT_ICMPX_PORT_UNREACH = 0x1
NFT_REJECT_ICMPX_HOST_UNREACH = 0x2
NFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3
NFTA_REJECT_UNSPEC = 0x0
NFTA_REJECT_TYPE = 0x1
NFTA_REJECT_ICMP_CODE = 0x2
NFT_NAT_SNAT = 0x0
NFT_NAT_DNAT = 0x1
NFTA_NAT_UNSPEC = 0x0
NFTA_NAT_TYPE = 0x1
NFTA_NAT_FAMILY = 0x2
NFTA_NAT_REG_ADDR_MIN = 0x3
NFTA_NAT_REG_ADDR_MAX = 0x4
NFTA_NAT_REG_PROTO_MIN = 0x5
NFTA_NAT_REG_PROTO_MAX = 0x6
NFTA_NAT_FLAGS = 0x7
NFTA_MASQ_UNSPEC = 0x0
NFTA_MASQ_FLAGS = 0x1
NFTA_MASQ_REG_PROTO_MIN = 0x2
NFTA_MASQ_REG_PROTO_MAX = 0x3
NFTA_REDIR_UNSPEC = 0x0
NFTA_REDIR_REG_PROTO_MIN = 0x1
NFTA_REDIR_REG_PROTO_MAX = 0x2
NFTA_REDIR_FLAGS = 0x3
NFTA_DUP_UNSPEC = 0x0
NFTA_DUP_SREG_ADDR = 0x1
NFTA_DUP_SREG_DEV = 0x2
NFTA_FWD_UNSPEC = 0x0
NFTA_FWD_SREG_DEV = 0x1
NFTA_OBJREF_UNSPEC = 0x0
NFTA_OBJREF_IMM_TYPE = 0x1
NFTA_OBJREF_IMM_NAME = 0x2
NFTA_OBJREF_SET_SREG = 0x3
NFTA_OBJREF_SET_NAME = 0x4
NFTA_OBJREF_SET_ID = 0x5
NFTA_GEN_UNSPEC = 0x0
NFTA_GEN_ID = 0x1
NFTA_GEN_PROC_PID = 0x2
NFTA_GEN_PROC_NAME = 0x3
NFTA_FIB_UNSPEC = 0x0
NFTA_FIB_DREG = 0x1
NFTA_FIB_RESULT = 0x2
NFTA_FIB_FLAGS = 0x3
NFT_FIB_RESULT_UNSPEC = 0x0
NFT_FIB_RESULT_OIF = 0x1
NFT_FIB_RESULT_OIFNAME = 0x2
NFT_FIB_RESULT_ADDRTYPE = 0x3
NFTA_FIB_F_SADDR = 0x1
NFTA_FIB_F_DADDR = 0x2
NFTA_FIB_F_MARK = 0x4
NFTA_FIB_F_IIF = 0x8
NFTA_FIB_F_OIF = 0x10
NFTA_FIB_F_PRESENT = 0x20
NFTA_CT_HELPER_UNSPEC = 0x0
NFTA_CT_HELPER_NAME = 0x1
NFTA_CT_HELPER_L3PROTO = 0x2
NFTA_CT_HELPER_L4PROTO = 0x3
NFTA_OBJ_UNSPEC = 0x0
NFTA_OBJ_TABLE = 0x1
NFTA_OBJ_NAME = 0x2
NFTA_OBJ_TYPE = 0x3
NFTA_OBJ_DATA = 0x4
NFTA_OBJ_USE = 0x5
NFTA_TRACE_UNSPEC = 0x0
NFTA_TRACE_TABLE = 0x1
NFTA_TRACE_CHAIN = 0x2
NFTA_TRACE_RULE_HANDLE = 0x3
NFTA_TRACE_TYPE = 0x4
NFTA_TRACE_VERDICT = 0x5
NFTA_TRACE_ID = 0x6
NFTA_TRACE_LL_HEADER = 0x7
NFTA_TRACE_NETWORK_HEADER = 0x8
NFTA_TRACE_TRANSPORT_HEADER = 0x9
NFTA_TRACE_IIF = 0xa
NFTA_TRACE_IIFTYPE = 0xb
NFTA_TRACE_OIF = 0xc
NFTA_TRACE_OIFTYPE = 0xd
NFTA_TRACE_MARK = 0xe
NFTA_TRACE_NFPROTO = 0xf
NFTA_TRACE_POLICY = 0x10
NFTA_TRACE_PAD = 0x11
NFT_TRACETYPE_UNSPEC = 0x0
NFT_TRACETYPE_POLICY = 0x1
NFT_TRACETYPE_RETURN = 0x2
NFT_TRACETYPE_RULE = 0x3
NFTA_NG_UNSPEC = 0x0
NFTA_NG_DREG = 0x1
NFTA_NG_MODULUS = 0x2
NFTA_NG_TYPE = 0x3
NFTA_NG_OFFSET = 0x4
NFT_NG_INCREMENTAL = 0x0
NFT_NG_RANDOM = 0x1
)
type RTCTime struct {
Sec int32
Min int32
Hour int32
Mday int32
Mon int32
Year int32
Wday int32
Yday int32
Isdst int32
}
type RTCWkAlrm struct {
Enabled uint8
Pending uint8
Time RTCTime
}
type RTCPLLInfo struct {
Ctrl int32
Value int32
Max int32
Min int32
Posmult int32
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
const (
NETNSA_NONE = 0x0
NETNSA_NSID = 0x1
NETNSA_PID = 0x2
NETNSA_FD = 0x3
)
type XDPRingOffset struct {
Producer uint64
Consumer uint64
Desc uint64
}
type XDPMmapOffsets struct {
Rx XDPRingOffset
Tx XDPRingOffset
Fr XDPRingOffset
Cr XDPRingOffset
}
type XDPUmemReg struct {
Addr uint64
Len uint64
Size uint32
Headroom uint32
}
type XDPStatistics struct {
Rx_dropped uint64
Rx_invalid_descs uint64
Tx_invalid_descs uint64
}
type XDPDesc struct {
Addr uint64
Len uint32
Options uint32
}
const (
NCSI_CMD_UNSPEC = 0x0
NCSI_CMD_PKG_INFO = 0x1
NCSI_CMD_SET_INTERFACE = 0x2
NCSI_CMD_CLEAR_INTERFACE = 0x3
NCSI_ATTR_UNSPEC = 0x0
NCSI_ATTR_IFINDEX = 0x1
NCSI_ATTR_PACKAGE_LIST = 0x2
NCSI_ATTR_PACKAGE_ID = 0x3
NCSI_ATTR_CHANNEL_ID = 0x4
NCSI_PKG_ATTR_UNSPEC = 0x0
NCSI_PKG_ATTR = 0x1
NCSI_PKG_ATTR_ID = 0x2
NCSI_PKG_ATTR_FORCED = 0x3
NCSI_PKG_ATTR_CHANNEL_LIST = 0x4
NCSI_CHANNEL_ATTR_UNSPEC = 0x0
NCSI_CHANNEL_ATTR = 0x1
NCSI_CHANNEL_ATTR_ID = 0x2
NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3
NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4
NCSI_CHANNEL_ATTR_VERSION_STR = 0x5
NCSI_CHANNEL_ATTR_LINK_STATE = 0x6
NCSI_CHANNEL_ATTR_ACTIVE = 0x7
NCSI_CHANNEL_ATTR_FORCED = 0x8
NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9
NCSI_CHANNEL_ATTR_VLAN_ID = 0xa
)
type ScmTimestamping struct {
Ts [3]Timespec
}
const (
SOF_TIMESTAMPING_TX_HARDWARE = 0x1
SOF_TIMESTAMPING_TX_SOFTWARE = 0x2
SOF_TIMESTAMPING_RX_HARDWARE = 0x4
SOF_TIMESTAMPING_RX_SOFTWARE = 0x8
SOF_TIMESTAMPING_SOFTWARE = 0x10
SOF_TIMESTAMPING_SYS_HARDWARE = 0x20
SOF_TIMESTAMPING_RAW_HARDWARE = 0x40
SOF_TIMESTAMPING_OPT_ID = 0x80
SOF_TIMESTAMPING_TX_SCHED = 0x100
SOF_TIMESTAMPING_TX_ACK = 0x200
SOF_TIMESTAMPING_OPT_CMSG = 0x400
SOF_TIMESTAMPING_OPT_TSONLY = 0x800
SOF_TIMESTAMPING_OPT_STATS = 0x1000
SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000
SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000
SOF_TIMESTAMPING_LAST = 0x4000
SOF_TIMESTAMPING_MASK = 0x7fff
SCM_TSTAMP_SND = 0x0
SCM_TSTAMP_SCHED = 0x1
SCM_TSTAMP_ACK = 0x2
)
type SockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
Code uint8
Pad uint8
Info uint32
Data uint32
}
|
{
"pile_set_name": "Github"
}
|
1
2
3
|
{
"pile_set_name": "Github"
}
|
#muuid {82181510-5dfa-49d7-b469-33871e2ae8b5}
;============================================================
; File: TrafficCounter.dll
; Plugin: Traffic counter
; Version: 0.1.1.9
; Authors: Ghost, Mironych
;============================================================
[Adding traffic and time counters.]
Лічильник трафіку.
;file \plugins\TrafficCounter\res\resource.rc
[Selected totals]
Виділено всього
[Accounts]
Облікові записи
[Units]
Одиниці
[Clear statistics]
Очистити
[Notification]
Сповіщення
[Notify me on every]
Сповіщати кожні
[kilobytes]
кілобайт
[minutes]
хвилин
[Background color:]
Колір фону:
[Text color:]
Колір тексту:
[Reset to default]
Скинути
[Popup timeout]
Тривалість вікна
[Default]
Стандартний
[Custom]
Налаштувати
[Test]
Тест
[Show now]
Показати
[Space between lines:]
Між рядками:
[Counters format string:]
Формат рядка лічильників:
[Tooltip format string:]
Формат підказки:
[Display traffic for current]
Трафік за поточний
;file \plugins\TrafficCounter\src\options.cpp
[Display]
Показувати
[Icon]
Значок
[Account name]
Обліковий запис
[Current traffic]
Поточний трафік
[Total traffic]
Загальний трафік
[Current online]
Поточний час в мережі
[Total online]
Загальний час в мережі
[General]
Загальне
[Draw frame as skin element]
Малювати фрейм як елемент скіна
[Show tooltip in traffic window]
Показувати підказку у вікні трафіку
["Toggle traffic counter" in main menu]
Перемикач лічильника трафіку в головному меню
[Visible accounts]
Видимі облікові записи
[Summary traffic for visible accounts]
Сумарний трафік для видимих облікових записів
[Overall traffic]
Загальний трафік
[Hide now]
Сховати
[Day]
День
[Week]
Тиждень
[Month]
Місяць
[Year]
Рік
[Services]
Служби
[Options]
Налаштування
[Traffic counter]
Лічильник трафіку
[Statistics]
Статистика
[Popups]
Спливаючі вікна
;file \plugins\TrafficCounter\src\statistics.cpp
[Bytes]
Байт
[KB]
КБ
[MB]
МБ
[Adaptive]
Плаваючий
[Hourly]
Щогодини
[Daily]
Щодня
[Weekly]
Щотижня
[Monthly]
Щомісяця
[Yearly]
Щорічно
[Period]
Період
[Incoming]
Вхідні
[Outgoing]
Вихідні
[Sum]
Сума
[Online]
В мережі
[Now traffic statistics for selected accounts will be cleared.\nContinue?]
Усю статистику за вибраними обліковими записами буде очищено.\nПродовжити?
[Couldn't read statistics file]
Неможливо прочитать файл статистики
[Traffic Counter]
Лічильник трафіку
;file \plugins\TrafficCounter\src\TrafficCounter.cpp
[Toggle traffic counter]
Перемкнути лічильник трафіку
[Traffic counter notification]
Сповіщення лічильника трафіку
[%d kilobytes sent]
%d Кб відправлено
[%d kilobytes received]
%d Кб отримано
[Font]
Шрифт
[Show/Hide frame]
Показати/Сховати фрейм
[Hide traffic window]
Сховати вікно трафіку
[Clear the current (Now:) value]
Скинути поточне (Now:) значення
|
{
"pile_set_name": "Github"
}
|
/*
* tw68 functions to handle video data
*
* Much of this code is derived from the cx88 and sa7134 drivers, which
* were in turn derived from the bt87x driver. The original work was by
* Gerd Knorr; more recently the code was enhanced by Mauro Carvalho Chehab,
* Hans Verkuil, Andy Walls and many others. Their work is gratefully
* acknowledged. Full credit goes to them - any problems within this code
* are mine.
*
* Copyright (C) 2009 William M. Brack
*
* Refactored and updated to the latest v4l core frameworks:
*
* Copyright (C) 2014 Hans Verkuil <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/module.h>
#include <media/v4l2-common.h>
#include <media/v4l2-event.h>
#include <media/videobuf2-dma-sg.h>
#include "tw68.h"
#include "tw68-reg.h"
/* ------------------------------------------------------------------ */
/* data structs for video */
/*
* FIXME -
* Note that the saa7134 has formats, e.g. YUV420, which are classified
* as "planar". These affect overlay mode, and are flagged with a field
* ".planar" in the format. Do we need to implement this in this driver?
*/
static const struct tw68_format formats[] = {
{
.name = "15 bpp RGB, le",
.fourcc = V4L2_PIX_FMT_RGB555,
.depth = 16,
.twformat = ColorFormatRGB15,
}, {
.name = "15 bpp RGB, be",
.fourcc = V4L2_PIX_FMT_RGB555X,
.depth = 16,
.twformat = ColorFormatRGB15 | ColorFormatBSWAP,
}, {
.name = "16 bpp RGB, le",
.fourcc = V4L2_PIX_FMT_RGB565,
.depth = 16,
.twformat = ColorFormatRGB16,
}, {
.name = "16 bpp RGB, be",
.fourcc = V4L2_PIX_FMT_RGB565X,
.depth = 16,
.twformat = ColorFormatRGB16 | ColorFormatBSWAP,
}, {
.name = "24 bpp RGB, le",
.fourcc = V4L2_PIX_FMT_BGR24,
.depth = 24,
.twformat = ColorFormatRGB24,
}, {
.name = "24 bpp RGB, be",
.fourcc = V4L2_PIX_FMT_RGB24,
.depth = 24,
.twformat = ColorFormatRGB24 | ColorFormatBSWAP,
}, {
.name = "32 bpp RGB, le",
.fourcc = V4L2_PIX_FMT_BGR32,
.depth = 32,
.twformat = ColorFormatRGB32,
}, {
.name = "32 bpp RGB, be",
.fourcc = V4L2_PIX_FMT_RGB32,
.depth = 32,
.twformat = ColorFormatRGB32 | ColorFormatBSWAP |
ColorFormatWSWAP,
}, {
.name = "4:2:2 packed, YUYV",
.fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16,
.twformat = ColorFormatYUY2,
}, {
.name = "4:2:2 packed, UYVY",
.fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16,
.twformat = ColorFormatYUY2 | ColorFormatBSWAP,
}
};
#define FORMATS ARRAY_SIZE(formats)
#define NORM_625_50 \
.h_delay = 3, \
.h_delay0 = 133, \
.h_start = 0, \
.h_stop = 719, \
.v_delay = 24, \
.vbi_v_start_0 = 7, \
.vbi_v_stop_0 = 22, \
.video_v_start = 24, \
.video_v_stop = 311, \
.vbi_v_start_1 = 319
#define NORM_525_60 \
.h_delay = 8, \
.h_delay0 = 138, \
.h_start = 0, \
.h_stop = 719, \
.v_delay = 22, \
.vbi_v_start_0 = 10, \
.vbi_v_stop_0 = 21, \
.video_v_start = 22, \
.video_v_stop = 262, \
.vbi_v_start_1 = 273
/*
* The following table is searched by tw68_s_std, first for a specific
* match, then for an entry which contains the desired id. The table
* entries should therefore be ordered in ascending order of specificity.
*/
static const struct tw68_tvnorm tvnorms[] = {
{
.name = "PAL", /* autodetect */
.id = V4L2_STD_PAL,
NORM_625_50,
.sync_control = 0x18,
.luma_control = 0x40,
.chroma_ctrl1 = 0x81,
.chroma_gain = 0x2a,
.chroma_ctrl2 = 0x06,
.vgate_misc = 0x1c,
.format = VideoFormatPALBDGHI,
}, {
.name = "NTSC",
.id = V4L2_STD_NTSC,
NORM_525_60,
.sync_control = 0x59,
.luma_control = 0x40,
.chroma_ctrl1 = 0x89,
.chroma_gain = 0x2a,
.chroma_ctrl2 = 0x0e,
.vgate_misc = 0x18,
.format = VideoFormatNTSC,
}, {
.name = "SECAM",
.id = V4L2_STD_SECAM,
NORM_625_50,
.sync_control = 0x18,
.luma_control = 0x1b,
.chroma_ctrl1 = 0xd1,
.chroma_gain = 0x80,
.chroma_ctrl2 = 0x00,
.vgate_misc = 0x1c,
.format = VideoFormatSECAM,
}, {
.name = "PAL-M",
.id = V4L2_STD_PAL_M,
NORM_525_60,
.sync_control = 0x59,
.luma_control = 0x40,
.chroma_ctrl1 = 0xb9,
.chroma_gain = 0x2a,
.chroma_ctrl2 = 0x0e,
.vgate_misc = 0x18,
.format = VideoFormatPALM,
}, {
.name = "PAL-Nc",
.id = V4L2_STD_PAL_Nc,
NORM_625_50,
.sync_control = 0x18,
.luma_control = 0x40,
.chroma_ctrl1 = 0xa1,
.chroma_gain = 0x2a,
.chroma_ctrl2 = 0x06,
.vgate_misc = 0x1c,
.format = VideoFormatPALNC,
}, {
.name = "PAL-60",
.id = V4L2_STD_PAL_60,
.h_delay = 186,
.h_start = 0,
.h_stop = 719,
.v_delay = 26,
.video_v_start = 23,
.video_v_stop = 262,
.vbi_v_start_0 = 10,
.vbi_v_stop_0 = 21,
.vbi_v_start_1 = 273,
.sync_control = 0x18,
.luma_control = 0x40,
.chroma_ctrl1 = 0x81,
.chroma_gain = 0x2a,
.chroma_ctrl2 = 0x06,
.vgate_misc = 0x1c,
.format = VideoFormatPAL60,
}
};
#define TVNORMS ARRAY_SIZE(tvnorms)
static const struct tw68_format *format_by_fourcc(unsigned int fourcc)
{
unsigned int i;
for (i = 0; i < FORMATS; i++)
if (formats[i].fourcc == fourcc)
return formats+i;
return NULL;
}
/* ------------------------------------------------------------------ */
/*
* Note that the cropping rectangles are described in terms of a single
* frame, i.e. line positions are only 1/2 the interlaced equivalent
*/
static void set_tvnorm(struct tw68_dev *dev, const struct tw68_tvnorm *norm)
{
if (norm != dev->tvnorm) {
dev->width = 720;
dev->height = (norm->id & V4L2_STD_525_60) ? 480 : 576;
dev->tvnorm = norm;
tw68_set_tvnorm_hw(dev);
}
}
/*
* tw68_set_scale
*
* Scaling and Cropping for video decoding
*
* We are working with 3 values for horizontal and vertical - scale,
* delay and active.
*
* HACTIVE represent the actual number of pixels in the "usable" image,
* before scaling. HDELAY represents the number of pixels skipped
* between the start of the horizontal sync and the start of the image.
* HSCALE is calculated using the formula
* HSCALE = (HACTIVE / (#pixels desired)) * 256
*
* The vertical registers are similar, except based upon the total number
* of lines in the image, and the first line of the image (i.e. ignoring
* vertical sync and VBI).
*
* Note that the number of bytes reaching the FIFO (and hence needing
* to be processed by the DMAP program) is completely dependent upon
* these values, especially HSCALE.
*
* Parameters:
* @dev pointer to the device structure, needed for
* getting current norm (as well as debug print)
* @width actual image width (from user buffer)
* @height actual image height
* @field indicates Top, Bottom or Interlaced
*/
static int tw68_set_scale(struct tw68_dev *dev, unsigned int width,
unsigned int height, enum v4l2_field field)
{
const struct tw68_tvnorm *norm = dev->tvnorm;
/* set individually for debugging clarity */
int hactive, hdelay, hscale;
int vactive, vdelay, vscale;
int comb;
if (V4L2_FIELD_HAS_BOTH(field)) /* if field is interlaced */
height /= 2; /* we must set for 1-frame */
pr_debug("%s: width=%d, height=%d, both=%d\n"
" tvnorm h_delay=%d, h_start=%d, h_stop=%d, "
"v_delay=%d, v_start=%d, v_stop=%d\n" , __func__,
width, height, V4L2_FIELD_HAS_BOTH(field),
norm->h_delay, norm->h_start, norm->h_stop,
norm->v_delay, norm->video_v_start,
norm->video_v_stop);
switch (dev->vdecoder) {
case TW6800:
hdelay = norm->h_delay0;
break;
default:
hdelay = norm->h_delay;
break;
}
hdelay += norm->h_start;
hactive = norm->h_stop - norm->h_start + 1;
hscale = (hactive * 256) / (width);
vdelay = norm->v_delay;
vactive = ((norm->id & V4L2_STD_525_60) ? 524 : 624) / 2 - norm->video_v_start;
vscale = (vactive * 256) / height;
pr_debug("%s: %dx%d [%s%s,%s]\n", __func__,
width, height,
V4L2_FIELD_HAS_TOP(field) ? "T" : "",
V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "",
v4l2_norm_to_name(dev->tvnorm->id));
pr_debug("%s: hactive=%d, hdelay=%d, hscale=%d; "
"vactive=%d, vdelay=%d, vscale=%d\n", __func__,
hactive, hdelay, hscale, vactive, vdelay, vscale);
comb = ((vdelay & 0x300) >> 2) |
((vactive & 0x300) >> 4) |
((hdelay & 0x300) >> 6) |
((hactive & 0x300) >> 8);
pr_debug("%s: setting CROP_HI=%02x, VDELAY_LO=%02x, "
"VACTIVE_LO=%02x, HDELAY_LO=%02x, HACTIVE_LO=%02x\n",
__func__, comb, vdelay, vactive, hdelay, hactive);
tw_writeb(TW68_CROP_HI, comb);
tw_writeb(TW68_VDELAY_LO, vdelay & 0xff);
tw_writeb(TW68_VACTIVE_LO, vactive & 0xff);
tw_writeb(TW68_HDELAY_LO, hdelay & 0xff);
tw_writeb(TW68_HACTIVE_LO, hactive & 0xff);
comb = ((vscale & 0xf00) >> 4) | ((hscale & 0xf00) >> 8);
pr_debug("%s: setting SCALE_HI=%02x, VSCALE_LO=%02x, "
"HSCALE_LO=%02x\n", __func__, comb, vscale, hscale);
tw_writeb(TW68_SCALE_HI, comb);
tw_writeb(TW68_VSCALE_LO, vscale);
tw_writeb(TW68_HSCALE_LO, hscale);
return 0;
}
/* ------------------------------------------------------------------ */
int tw68_video_start_dma(struct tw68_dev *dev, struct tw68_buf *buf)
{
/* Set cropping and scaling */
tw68_set_scale(dev, dev->width, dev->height, dev->field);
/*
* Set start address for RISC program. Note that if the DMAP
* processor is currently running, it must be stopped before
* a new address can be set.
*/
tw_clearl(TW68_DMAC, TW68_DMAP_EN);
tw_writel(TW68_DMAP_SA, buf->dma);
/* Clear any pending interrupts */
tw_writel(TW68_INTSTAT, dev->board_virqmask);
/* Enable the risc engine and the fifo */
tw_andorl(TW68_DMAC, 0xff, dev->fmt->twformat |
ColorFormatGamma | TW68_DMAP_EN | TW68_FIFO_EN);
dev->pci_irqmask |= dev->board_virqmask;
tw_setl(TW68_INTMASK, dev->pci_irqmask);
return 0;
}
/* ------------------------------------------------------------------ */
/* calc max # of buffers from size (must not exceed the 4MB virtual
* address space per DMA channel) */
static int tw68_buffer_count(unsigned int size, unsigned int count)
{
unsigned int maxcount;
maxcount = (4 * 1024 * 1024) / roundup(size, PAGE_SIZE);
if (count > maxcount)
count = maxcount;
return count;
}
/* ------------------------------------------------------------- */
/* vb2 queue operations */
static int tw68_queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[], void *alloc_ctxs[])
{
struct tw68_dev *dev = vb2_get_drv_priv(q);
unsigned tot_bufs = q->num_buffers + *num_buffers;
sizes[0] = (dev->fmt->depth * dev->width * dev->height) >> 3;
alloc_ctxs[0] = dev->alloc_ctx;
/*
* We allow create_bufs, but only if the sizeimage is the same as the
* current sizeimage. The tw68_buffer_count calculation becomes quite
* difficult otherwise.
*/
if (fmt && fmt->fmt.pix.sizeimage < sizes[0])
return -EINVAL;
*num_planes = 1;
if (tot_bufs < 2)
tot_bufs = 2;
tot_bufs = tw68_buffer_count(sizes[0], tot_bufs);
*num_buffers = tot_bufs - q->num_buffers;
return 0;
}
/*
* The risc program for each buffers works as follows: it starts with a simple
* 'JUMP to addr + 8', which is effectively a NOP. Then the program to DMA the
* buffer follows and at the end we have a JUMP back to the start + 8 (skipping
* the initial JUMP).
*
* This is the program of the first buffer to be queued if the active list is
* empty and it just keeps DMAing this buffer without generating any interrupts.
*
* If a new buffer is added then the initial JUMP in the program generates an
* interrupt as well which signals that the previous buffer has been DMAed
* successfully and that it can be returned to userspace.
*
* It also sets the final jump of the previous buffer to the start of the new
* buffer, thus chaining the new buffer into the DMA chain. This is a single
* atomic u32 write, so there is no race condition.
*
* The end-result of all this that you only get an interrupt when a buffer
* is ready, so the control flow is very easy.
*/
static void tw68_buf_queue(struct vb2_buffer *vb)
{
struct vb2_queue *vq = vb->vb2_queue;
struct tw68_dev *dev = vb2_get_drv_priv(vq);
struct tw68_buf *buf = container_of(vb, struct tw68_buf, vb);
struct tw68_buf *prev;
unsigned long flags;
spin_lock_irqsave(&dev->slock, flags);
/* append a 'JUMP to start of buffer' to the buffer risc program */
buf->jmp[0] = cpu_to_le32(RISC_JUMP);
buf->jmp[1] = cpu_to_le32(buf->dma + 8);
if (!list_empty(&dev->active)) {
prev = list_entry(dev->active.prev, struct tw68_buf, list);
buf->cpu[0] |= cpu_to_le32(RISC_INT_BIT);
prev->jmp[1] = cpu_to_le32(buf->dma);
}
list_add_tail(&buf->list, &dev->active);
spin_unlock_irqrestore(&dev->slock, flags);
}
/*
* buffer_prepare
*
* Set the ancilliary information into the buffer structure. This
* includes generating the necessary risc program if it hasn't already
* been done for the current buffer format.
* The structure fh contains the details of the format requested by the
* user - type, width, height and #fields. This is compared with the
* last format set for the current buffer. If they differ, the risc
* code (which controls the filling of the buffer) is (re-)generated.
*/
static int tw68_buf_prepare(struct vb2_buffer *vb)
{
struct vb2_queue *vq = vb->vb2_queue;
struct tw68_dev *dev = vb2_get_drv_priv(vq);
struct tw68_buf *buf = container_of(vb, struct tw68_buf, vb);
struct sg_table *dma = vb2_dma_sg_plane_desc(vb, 0);
unsigned size, bpl;
size = (dev->width * dev->height * dev->fmt->depth) >> 3;
if (vb2_plane_size(vb, 0) < size)
return -EINVAL;
vb2_set_plane_payload(vb, 0, size);
bpl = (dev->width * dev->fmt->depth) >> 3;
switch (dev->field) {
case V4L2_FIELD_TOP:
tw68_risc_buffer(dev->pci, buf, dma->sgl,
0, UNSET, bpl, 0, dev->height);
break;
case V4L2_FIELD_BOTTOM:
tw68_risc_buffer(dev->pci, buf, dma->sgl,
UNSET, 0, bpl, 0, dev->height);
break;
case V4L2_FIELD_SEQ_TB:
tw68_risc_buffer(dev->pci, buf, dma->sgl,
0, bpl * (dev->height >> 1),
bpl, 0, dev->height >> 1);
break;
case V4L2_FIELD_SEQ_BT:
tw68_risc_buffer(dev->pci, buf, dma->sgl,
bpl * (dev->height >> 1), 0,
bpl, 0, dev->height >> 1);
break;
case V4L2_FIELD_INTERLACED:
default:
tw68_risc_buffer(dev->pci, buf, dma->sgl,
0, bpl, bpl, bpl, dev->height >> 1);
break;
}
return 0;
}
static void tw68_buf_finish(struct vb2_buffer *vb)
{
struct vb2_queue *vq = vb->vb2_queue;
struct tw68_dev *dev = vb2_get_drv_priv(vq);
struct tw68_buf *buf = container_of(vb, struct tw68_buf, vb);
pci_free_consistent(dev->pci, buf->size, buf->cpu, buf->dma);
}
static int tw68_start_streaming(struct vb2_queue *q, unsigned int count)
{
struct tw68_dev *dev = vb2_get_drv_priv(q);
struct tw68_buf *buf =
container_of(dev->active.next, struct tw68_buf, list);
dev->seqnr = 0;
tw68_video_start_dma(dev, buf);
return 0;
}
static void tw68_stop_streaming(struct vb2_queue *q)
{
struct tw68_dev *dev = vb2_get_drv_priv(q);
/* Stop risc & fifo */
tw_clearl(TW68_DMAC, TW68_DMAP_EN | TW68_FIFO_EN);
while (!list_empty(&dev->active)) {
struct tw68_buf *buf =
container_of(dev->active.next, struct tw68_buf, list);
list_del(&buf->list);
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
}
}
static struct vb2_ops tw68_video_qops = {
.queue_setup = tw68_queue_setup,
.buf_queue = tw68_buf_queue,
.buf_prepare = tw68_buf_prepare,
.buf_finish = tw68_buf_finish,
.start_streaming = tw68_start_streaming,
.stop_streaming = tw68_stop_streaming,
.wait_prepare = vb2_ops_wait_prepare,
.wait_finish = vb2_ops_wait_finish,
};
/* ------------------------------------------------------------------ */
static int tw68_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct tw68_dev *dev =
container_of(ctrl->handler, struct tw68_dev, hdl);
switch (ctrl->id) {
case V4L2_CID_BRIGHTNESS:
tw_writeb(TW68_BRIGHT, ctrl->val);
break;
case V4L2_CID_HUE:
tw_writeb(TW68_HUE, ctrl->val);
break;
case V4L2_CID_CONTRAST:
tw_writeb(TW68_CONTRAST, ctrl->val);
break;
case V4L2_CID_SATURATION:
tw_writeb(TW68_SAT_U, ctrl->val);
tw_writeb(TW68_SAT_V, ctrl->val);
break;
case V4L2_CID_COLOR_KILLER:
if (ctrl->val)
tw_andorb(TW68_MISC2, 0xe0, 0xe0);
else
tw_andorb(TW68_MISC2, 0xe0, 0x00);
break;
case V4L2_CID_CHROMA_AGC:
if (ctrl->val)
tw_andorb(TW68_LOOP, 0x30, 0x20);
else
tw_andorb(TW68_LOOP, 0x30, 0x00);
break;
}
return 0;
}
/* ------------------------------------------------------------------ */
/*
* Note that this routine returns what is stored in the fh structure, and
* does not interrogate any of the device registers.
*/
static int tw68_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct tw68_dev *dev = video_drvdata(file);
f->fmt.pix.width = dev->width;
f->fmt.pix.height = dev->height;
f->fmt.pix.field = dev->field;
f->fmt.pix.pixelformat = dev->fmt->fourcc;
f->fmt.pix.bytesperline =
(f->fmt.pix.width * (dev->fmt->depth)) >> 3;
f->fmt.pix.sizeimage =
f->fmt.pix.height * f->fmt.pix.bytesperline;
f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
f->fmt.pix.priv = 0;
return 0;
}
static int tw68_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct tw68_dev *dev = video_drvdata(file);
const struct tw68_format *fmt;
enum v4l2_field field;
unsigned int maxh;
fmt = format_by_fourcc(f->fmt.pix.pixelformat);
if (NULL == fmt)
return -EINVAL;
field = f->fmt.pix.field;
maxh = (dev->tvnorm->id & V4L2_STD_525_60) ? 480 : 576;
switch (field) {
case V4L2_FIELD_TOP:
case V4L2_FIELD_BOTTOM:
break;
case V4L2_FIELD_INTERLACED:
case V4L2_FIELD_SEQ_BT:
case V4L2_FIELD_SEQ_TB:
maxh = maxh * 2;
break;
default:
field = (f->fmt.pix.height > maxh / 2)
? V4L2_FIELD_INTERLACED
: V4L2_FIELD_BOTTOM;
break;
}
f->fmt.pix.field = field;
if (f->fmt.pix.width < 48)
f->fmt.pix.width = 48;
if (f->fmt.pix.height < 32)
f->fmt.pix.height = 32;
if (f->fmt.pix.width > 720)
f->fmt.pix.width = 720;
if (f->fmt.pix.height > maxh)
f->fmt.pix.height = maxh;
f->fmt.pix.width &= ~0x03;
f->fmt.pix.bytesperline =
(f->fmt.pix.width * (fmt->depth)) >> 3;
f->fmt.pix.sizeimage =
f->fmt.pix.height * f->fmt.pix.bytesperline;
f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
return 0;
}
/*
* Note that tw68_s_fmt_vid_cap sets the information into the fh structure,
* and it will be used for all future new buffers. However, there could be
* some number of buffers on the "active" chain which will be filled before
* the change takes place.
*/
static int tw68_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct tw68_dev *dev = video_drvdata(file);
int err;
err = tw68_try_fmt_vid_cap(file, priv, f);
if (0 != err)
return err;
dev->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
dev->width = f->fmt.pix.width;
dev->height = f->fmt.pix.height;
dev->field = f->fmt.pix.field;
return 0;
}
static int tw68_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
{
struct tw68_dev *dev = video_drvdata(file);
unsigned int n;
n = i->index;
if (n >= TW68_INPUT_MAX)
return -EINVAL;
i->index = n;
i->type = V4L2_INPUT_TYPE_CAMERA;
snprintf(i->name, sizeof(i->name), "Composite %d", n);
/* If the query is for the current input, get live data */
if (n == dev->input) {
int v1 = tw_readb(TW68_STATUS1);
int v2 = tw_readb(TW68_MVSN);
if (0 != (v1 & (1 << 7)))
i->status |= V4L2_IN_ST_NO_SYNC;
if (0 != (v1 & (1 << 6)))
i->status |= V4L2_IN_ST_NO_H_LOCK;
if (0 != (v1 & (1 << 2)))
i->status |= V4L2_IN_ST_NO_SIGNAL;
if (0 != (v1 & 1 << 1))
i->status |= V4L2_IN_ST_NO_COLOR;
if (0 != (v2 & (1 << 2)))
i->status |= V4L2_IN_ST_MACROVISION;
}
i->std = video_devdata(file)->tvnorms;
return 0;
}
static int tw68_g_input(struct file *file, void *priv, unsigned int *i)
{
struct tw68_dev *dev = video_drvdata(file);
*i = dev->input;
return 0;
}
static int tw68_s_input(struct file *file, void *priv, unsigned int i)
{
struct tw68_dev *dev = video_drvdata(file);
if (i >= TW68_INPUT_MAX)
return -EINVAL;
dev->input = i;
tw_andorb(TW68_INFORM, 0x03 << 2, dev->input << 2);
return 0;
}
static int tw68_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct tw68_dev *dev = video_drvdata(file);
strcpy(cap->driver, "tw68");
strlcpy(cap->card, "Techwell Capture Card",
sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
cap->device_caps =
V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
}
static int tw68_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct tw68_dev *dev = video_drvdata(file);
unsigned int i;
if (vb2_is_busy(&dev->vidq))
return -EBUSY;
/* Look for match on complete norm id (may have mult bits) */
for (i = 0; i < TVNORMS; i++) {
if (id == tvnorms[i].id)
break;
}
/* If no exact match, look for norm which contains this one */
if (i == TVNORMS) {
for (i = 0; i < TVNORMS; i++)
if (id & tvnorms[i].id)
break;
}
/* If still not matched, give up */
if (i == TVNORMS)
return -EINVAL;
set_tvnorm(dev, &tvnorms[i]); /* do the actual setting */
return 0;
}
static int tw68_g_std(struct file *file, void *priv, v4l2_std_id *id)
{
struct tw68_dev *dev = video_drvdata(file);
*id = dev->tvnorm->id;
return 0;
}
static int tw68_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
if (f->index >= FORMATS)
return -EINVAL;
strlcpy(f->description, formats[f->index].name,
sizeof(f->description));
f->pixelformat = formats[f->index].fourcc;
return 0;
}
/*
* Used strictly for internal development and debugging, this routine
* prints out the current register contents for the tw68xx device.
*/
static void tw68_dump_regs(struct tw68_dev *dev)
{
unsigned char line[80];
int i, j, k;
unsigned char *cptr;
pr_info("Full dump of TW68 registers:\n");
/* First we do the PCI regs, 8 4-byte regs per line */
for (i = 0; i < 0x100; i += 32) {
cptr = line;
cptr += sprintf(cptr, "%03x ", i);
/* j steps through the next 4 words */
for (j = i; j < i + 16; j += 4)
cptr += sprintf(cptr, "%08x ", tw_readl(j));
*cptr++ = ' ';
for (; j < i + 32; j += 4)
cptr += sprintf(cptr, "%08x ", tw_readl(j));
*cptr++ = '\n';
*cptr = 0;
pr_info("%s", line);
}
/* Next the control regs, which are single-byte, address mod 4 */
while (i < 0x400) {
cptr = line;
cptr += sprintf(cptr, "%03x ", i);
/* Print out 4 groups of 4 bytes */
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
cptr += sprintf(cptr, "%02x ",
tw_readb(i));
i += 4;
}
*cptr++ = ' ';
}
*cptr++ = '\n';
*cptr = 0;
pr_info("%s", line);
}
}
static int vidioc_log_status(struct file *file, void *priv)
{
struct tw68_dev *dev = video_drvdata(file);
tw68_dump_regs(dev);
return v4l2_ctrl_log_status(file, priv);
}
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int vidioc_g_register(struct file *file, void *priv,
struct v4l2_dbg_register *reg)
{
struct tw68_dev *dev = video_drvdata(file);
if (reg->size == 1)
reg->val = tw_readb(reg->reg);
else
reg->val = tw_readl(reg->reg);
return 0;
}
static int vidioc_s_register(struct file *file, void *priv,
const struct v4l2_dbg_register *reg)
{
struct tw68_dev *dev = video_drvdata(file);
if (reg->size == 1)
tw_writeb(reg->reg, reg->val);
else
tw_writel(reg->reg & 0xffff, reg->val);
return 0;
}
#endif
static const struct v4l2_ctrl_ops tw68_ctrl_ops = {
.s_ctrl = tw68_s_ctrl,
};
static const struct v4l2_file_operations video_fops = {
.owner = THIS_MODULE,
.open = v4l2_fh_open,
.release = vb2_fop_release,
.read = vb2_fop_read,
.poll = vb2_fop_poll,
.mmap = vb2_fop_mmap,
.unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_querycap = tw68_querycap,
.vidioc_enum_fmt_vid_cap = tw68_enum_fmt_vid_cap,
.vidioc_reqbufs = vb2_ioctl_reqbufs,
.vidioc_create_bufs = vb2_ioctl_create_bufs,
.vidioc_querybuf = vb2_ioctl_querybuf,
.vidioc_qbuf = vb2_ioctl_qbuf,
.vidioc_dqbuf = vb2_ioctl_dqbuf,
.vidioc_s_std = tw68_s_std,
.vidioc_g_std = tw68_g_std,
.vidioc_enum_input = tw68_enum_input,
.vidioc_g_input = tw68_g_input,
.vidioc_s_input = tw68_s_input,
.vidioc_streamon = vb2_ioctl_streamon,
.vidioc_streamoff = vb2_ioctl_streamoff,
.vidioc_g_fmt_vid_cap = tw68_g_fmt_vid_cap,
.vidioc_try_fmt_vid_cap = tw68_try_fmt_vid_cap,
.vidioc_s_fmt_vid_cap = tw68_s_fmt_vid_cap,
.vidioc_log_status = vidioc_log_status,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register = vidioc_g_register,
.vidioc_s_register = vidioc_s_register,
#endif
};
static struct video_device tw68_video_template = {
.name = "tw68_video",
.fops = &video_fops,
.ioctl_ops = &video_ioctl_ops,
.release = video_device_release_empty,
.tvnorms = TW68_NORMS,
};
/* ------------------------------------------------------------------ */
/* exported stuff */
void tw68_set_tvnorm_hw(struct tw68_dev *dev)
{
tw_andorb(TW68_SDT, 0x07, dev->tvnorm->format);
}
int tw68_video_init1(struct tw68_dev *dev)
{
struct v4l2_ctrl_handler *hdl = &dev->hdl;
v4l2_ctrl_handler_init(hdl, 6);
v4l2_ctrl_new_std(hdl, &tw68_ctrl_ops,
V4L2_CID_BRIGHTNESS, -128, 127, 1, 20);
v4l2_ctrl_new_std(hdl, &tw68_ctrl_ops,
V4L2_CID_CONTRAST, 0, 255, 1, 100);
v4l2_ctrl_new_std(hdl, &tw68_ctrl_ops,
V4L2_CID_SATURATION, 0, 255, 1, 128);
/* NTSC only */
v4l2_ctrl_new_std(hdl, &tw68_ctrl_ops,
V4L2_CID_HUE, -128, 127, 1, 0);
v4l2_ctrl_new_std(hdl, &tw68_ctrl_ops,
V4L2_CID_COLOR_KILLER, 0, 1, 1, 0);
v4l2_ctrl_new_std(hdl, &tw68_ctrl_ops,
V4L2_CID_CHROMA_AGC, 0, 1, 1, 1);
if (hdl->error) {
v4l2_ctrl_handler_free(hdl);
return hdl->error;
}
dev->v4l2_dev.ctrl_handler = hdl;
v4l2_ctrl_handler_setup(hdl);
return 0;
}
int tw68_video_init2(struct tw68_dev *dev, int video_nr)
{
int ret;
set_tvnorm(dev, &tvnorms[0]);
dev->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
dev->width = 720;
dev->height = 576;
dev->field = V4L2_FIELD_INTERLACED;
INIT_LIST_HEAD(&dev->active);
dev->vidq.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
dev->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
dev->vidq.io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ | VB2_DMABUF;
dev->vidq.ops = &tw68_video_qops;
dev->vidq.mem_ops = &vb2_dma_sg_memops;
dev->vidq.drv_priv = dev;
dev->vidq.gfp_flags = __GFP_DMA32;
dev->vidq.buf_struct_size = sizeof(struct tw68_buf);
dev->vidq.lock = &dev->lock;
dev->vidq.min_buffers_needed = 2;
ret = vb2_queue_init(&dev->vidq);
if (ret)
return ret;
dev->vdev = tw68_video_template;
dev->vdev.v4l2_dev = &dev->v4l2_dev;
dev->vdev.lock = &dev->lock;
dev->vdev.queue = &dev->vidq;
video_set_drvdata(&dev->vdev, dev);
return video_register_device(&dev->vdev, VFL_TYPE_GRABBER, video_nr);
}
/*
* tw68_irq_video_done
*/
void tw68_irq_video_done(struct tw68_dev *dev, unsigned long status)
{
__u32 reg;
/* reset interrupts handled by this routine */
tw_writel(TW68_INTSTAT, status);
/*
* Check most likely first
*
* DMAPI shows we have reached the end of the risc code
* for the current buffer.
*/
if (status & TW68_DMAPI) {
struct tw68_buf *buf;
spin_lock(&dev->slock);
buf = list_entry(dev->active.next, struct tw68_buf, list);
list_del(&buf->list);
spin_unlock(&dev->slock);
v4l2_get_timestamp(&buf->vb.v4l2_buf.timestamp);
buf->vb.v4l2_buf.field = dev->field;
buf->vb.v4l2_buf.sequence = dev->seqnr++;
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_DONE);
status &= ~(TW68_DMAPI);
if (0 == status)
return;
}
if (status & (TW68_VLOCK | TW68_HLOCK))
dev_dbg(&dev->pci->dev, "Lost sync\n");
if (status & TW68_PABORT)
dev_err(&dev->pci->dev, "PABORT interrupt\n");
if (status & TW68_DMAPERR)
dev_err(&dev->pci->dev, "DMAPERR interrupt\n");
/*
* On TW6800, FDMIS is apparently generated if video input is switched
* during operation. Therefore, it is not enabled for that chip.
*/
if (status & TW68_FDMIS)
dev_dbg(&dev->pci->dev, "FDMIS interrupt\n");
if (status & TW68_FFOF) {
/* probably a logic error */
reg = tw_readl(TW68_DMAC) & TW68_FIFO_EN;
tw_clearl(TW68_DMAC, TW68_FIFO_EN);
dev_dbg(&dev->pci->dev, "FFOF interrupt\n");
tw_setl(TW68_DMAC, reg);
}
if (status & TW68_FFERR)
dev_dbg(&dev->pci->dev, "FFERR interrupt\n");
}
|
{
"pile_set_name": "Github"
}
|
a
{
color: #fff;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
|
{
"pile_set_name": "Github"
}
|
package linux
import "testing"
import "reflect"
import "fmt"
func TestNetStat(t *testing.T) {
{
var expected = NetStat{0, 0, 1764, 180, 0, 0, 0, 0, 0, 0, 28321, 0, 0, 0, 0, 243, 25089, 53, 837, 0, 0, 95994, 623148353, 640988091, 0, 92391, 81263, 594305, 590571, 35, 6501, 81, 113, 213, 1, 223, 318, 1056, 287, 218, 6619, 435, 1, 975, 264, 17298, 871, 5836, 3843, 0, 0, 2, 520, 0, 0, 833, 0, 3235, 44, 0, 571, 163, 0, 138, 0, 0, 0, 19, 1312, 677, 129, 0, 0, 27986, 27713, 40522, 837, 0, 38648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2772402103, 5189844022, 0, 0, 0, 0, 0, 0, 0, 0, 0}
read, err := ReadNetStat("proc/net_netstat_1")
if err != nil {
t.Fatal("netstat read fail", err)
}
t.Logf("%+v", expected)
t.Logf("%+v", read)
if err := compareExpectedReadFieldsNetStat(&expected, read); err != nil {
t.Error(err.Error())
}
if !reflect.DeepEqual(*read, expected) {
t.Error("not equal to expected")
}
}
{
expected := NetStat{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 427717, 0, 0, 0, 0, 370, 3111446, 59, 1825, 0, 0, 170176, 0, 507248, 0, 47385919, 0, 7377770, 29264396, 0, 410, 0, 3, 1, 0, 0, 4, 0, 18, 579, 0, 2, 0, 50, 6, 949, 50, 332, 1005, 5893, 978, 0, 8, 0, 0, 1838, 8, 764, 0, 0, 157868, 3281, 0, 35, 0, 0, 0, 0, 28, 453, 46, 0, 0, 226, 316, 2725, 0, 0, 0, 0, 0, 0, 0, 0, 11292855, 88470, 0, 8, 261, 198, 0, 0, 0, 0, 0, 0, 0, 0, 842446, 118, 118, 11490, 859, 105365136, 0, 0, 0, 0, 249, 0, 205328912480, 353370957921, 0, 0, 92394, 0, 0, 157218430, 0, 0, 0}
read, err := ReadNetStat("proc/net_netstat_2")
if err != nil {
t.Fatal("netstat read fail", err)
}
t.Logf("%+v", expected)
t.Logf("%+v", read)
if err := compareExpectedReadFieldsNetStat(&expected, read); err != nil {
t.Error(err.Error())
}
if !reflect.DeepEqual(*read, expected) {
t.Error("not equal to expected")
}
}
}
// This is a helper function which makes it easier to track down errors in expected versus read values.
func compareExpectedReadFieldsNetStat(expected *NetStat, read *NetStat) error {
elemExpected := reflect.ValueOf(*expected)
typeOfElemExpected := elemExpected.Type()
elemRead := reflect.ValueOf(*read)
for i := 0; i < elemExpected.NumField(); i++ {
fieldName := typeOfElemExpected.Field(i).Name
if elemExpected.Field(i).Uint() != elemRead.Field(i).Uint() {
return fmt.Errorf("Read value not equal to expected value for field %s. Got %d and expected %d.", fieldName, elemRead.Field(i).Uint(), elemExpected.Field(i).Uint())
}
}
return nil
}
|
{
"pile_set_name": "Github"
}
|
From adc86a463d4915cf85b4056d2762d3a107a6c6be Mon Sep 17 00:00:00 2001
From: Ioana Radulescu <[email protected]>
Date: Fri, 23 Mar 2018 08:44:05 -0500
Subject: [PATCH 255/448] staging: fsl-dpaa2/eth: Use generic irq handler
For the link state interrupt, we used a dummy non-threaded
irq handler, which had the same implementation as the generic
irq_default_primary_handler() function.
Give up on using our own irq handler and let the kernel use
the generic one instead.
Signed-off-by: Ioana Radulescu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 61992ff..c5fd1ca 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2919,11 +2919,6 @@ static int poll_link_state(void *arg)
return 0;
}
-static irqreturn_t dpni_irq0_handler(int irq_num, void *arg)
-{
- return IRQ_WAKE_THREAD;
-}
-
static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
{
u32 status = ~0;
@@ -2958,8 +2953,7 @@ static int setup_irqs(struct fsl_mc_device *ls_dev)
irq = ls_dev->irqs[0];
err = devm_request_threaded_irq(&ls_dev->dev, irq->msi_desc->irq,
- dpni_irq0_handler,
- dpni_irq0_handler_thread,
+ NULL, dpni_irq0_handler_thread,
IRQF_NO_SUSPEND | IRQF_ONESHOT,
dev_name(&ls_dev->dev), &ls_dev->dev);
if (err < 0) {
--
1.7.1
|
{
"pile_set_name": "Github"
}
|
#ifndef SRC_APP_CONTEXTBROKER_ORIONRESTSERVICES_H_
#define SRC_APP_CONTEXTBROKER_ORIONRESTSERVICES_H_
/*
*
* Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U
*
* This file is part of Orion Context Broker.
*
* Orion Context Broker 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.
*
* Orion Context Broker 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 Orion Context Broker. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by this license please contact with
* iot_support at tid dot es
*
* Author: Ken Zangelin
*/
#include "rest/rest.h"
/* ****************************************************************************
*
* ORION_REST_SERVICE_END - End marker for the Rest Service array
*/
#define ORION_REST_SERVICE_END { InvalidRequest, 0, {}, NULL }
/* ****************************************************************************
*
* orionRestServicesInit -
*/
extern void orionRestServicesInit
(
IpVersion _ipVersion,
const char* _bindAddress,
unsigned short _port,
bool _multitenant,
unsigned int _connectionMemory,
unsigned int _maxConnections,
unsigned int _mhdThreadPoolSize,
const char* _allowedOrigin,
int _corsMaxAge,
int _mhdTimeoutInSeconds,
const char* _httpsKey,
const char* _httpsCert
);
#endif // SRC_APP_CONTEXTBROKER_ORIONRESTSERVICES_H_
|
{
"pile_set_name": "Github"
}
|
package com.jnardari.opencv_androidsamples.utils.calibration;
import java.util.ArrayList;
import java.util.List;
import org.opencv.calib3d.Calib3d;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDouble;
import org.opencv.core.MatOfPoint2f;
import org.opencv.core.MatOfPoint3f;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;
import android.util.Log;
public class CameraCalibrator {
private static final String TAG = "CameraCalibrator";
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<Mat>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
private int mFlags;
private double mRms;
private double mSquareSize = 0.0181;
private Size mImageSize;
public CameraCalibrator(int width, int height) {
mImageSize = new Size(width, height);
mFlags = Calib3d.CALIB_FIX_PRINCIPAL_POINT +
Calib3d.CALIB_ZERO_TANGENT_DIST +
Calib3d.CALIB_FIX_ASPECT_RATIO +
Calib3d.CALIB_FIX_K4 +
Calib3d.CALIB_FIX_K5;
Mat.eye(3, 3, CvType.CV_64FC1).copyTo(mCameraMatrix);
mCameraMatrix.put(0, 0, 1.0);
Mat.zeros(5, 1, CvType.CV_64FC1).copyTo(mDistortionCoefficients);
Log.i(TAG, "Instantiated new " + this.getClass());
}
public void processFrame(Mat grayFrame, Mat rgbaFrame) {
findPattern(grayFrame);
renderFrame(rgbaFrame);
}
public void calibrate() {
ArrayList<Mat> rvecs = new ArrayList<Mat>();
ArrayList<Mat> tvecs = new ArrayList<Mat>();
Mat reprojectionErrors = new Mat();
ArrayList<Mat> objectPoints = new ArrayList<Mat>();
objectPoints.add(Mat.zeros(mCornersSize, 1, CvType.CV_32FC3));
calcBoardCornerPositions(objectPoints.get(0));
for (int i = 1; i < mCornersBuffer.size(); i++) {
objectPoints.add(objectPoints.get(0));
}
Calib3d.calibrateCamera(objectPoints, mCornersBuffer, mImageSize,
mCameraMatrix, mDistortionCoefficients, rvecs, tvecs, mFlags);
mIsCalibrated = Core.checkRange(mCameraMatrix)
&& Core.checkRange(mDistortionCoefficients);
mRms = computeReprojectionErrors(objectPoints, rvecs, tvecs, reprojectionErrors);
Log.i(TAG, String.format("Average re-projection error: %f", mRms));
Log.i(TAG, "Camera matrix: " + mCameraMatrix.dump());
Log.i(TAG, "Distortion coefficients: " + mDistortionCoefficients.dump());
}
public void clearCorners() {
mCornersBuffer.clear();
}
private void calcBoardCornerPositions(Mat corners) {
final int cn = 3;
float positions[] = new float[mCornersSize * cn];
for (int i = 0; i < mPatternSize.height; i++) {
for (int j = 0; j < mPatternSize.width * cn; j += cn) {
positions[(int) (i * mPatternSize.width * cn + j + 0)] =
(2 * (j / cn) + i % 2) * (float) mSquareSize;
positions[(int) (i * mPatternSize.width * cn + j + 1)] =
i * (float) mSquareSize;
positions[(int) (i * mPatternSize.width * cn + j + 2)] = 0;
}
}
corners.create(mCornersSize, 1, CvType.CV_32FC3);
corners.put(0, 0, positions);
}
private double computeReprojectionErrors(List<Mat> objectPoints,
List<Mat> rvecs, List<Mat> tvecs, Mat perViewErrors) {
MatOfPoint2f cornersProjected = new MatOfPoint2f();
double totalError = 0;
double error;
float viewErrors[] = new float[objectPoints.size()];
MatOfDouble distortionCoefficients = new MatOfDouble(mDistortionCoefficients);
int totalPoints = 0;
for (int i = 0; i < objectPoints.size(); i++) {
MatOfPoint3f points = new MatOfPoint3f(objectPoints.get(i));
Calib3d.projectPoints(points, rvecs.get(i), tvecs.get(i),
mCameraMatrix, distortionCoefficients, cornersProjected);
error = Core.norm(mCornersBuffer.get(i), cornersProjected, Core.NORM_L2);
int n = objectPoints.get(i).rows();
viewErrors[i] = (float) Math.sqrt(error * error / n);
totalError += error * error;
totalPoints += n;
}
perViewErrors.create(objectPoints.size(), 1, CvType.CV_32FC1);
perViewErrors.put(0, 0, viewErrors);
return Math.sqrt(totalError / totalPoints);
}
private void findPattern(Mat grayFrame) {
mPatternWasFound = Calib3d.findCirclesGrid(grayFrame, mPatternSize,
mCorners, Calib3d.CALIB_CB_ASYMMETRIC_GRID);
}
public void addCorners() {
if (mPatternWasFound) {
mCornersBuffer.add(mCorners.clone());
}
}
private void drawPoints(Mat rgbaFrame) {
Calib3d.drawChessboardCorners(rgbaFrame, mPatternSize, mCorners, mPatternWasFound);
}
private void renderFrame(Mat rgbaFrame) {
drawPoints(rgbaFrame);
Imgproc.putText(rgbaFrame, "Captured: " + mCornersBuffer.size(), new Point(rgbaFrame.cols() / 3 * 2, rgbaFrame.rows() * 0.1),
Core.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0));
}
public Mat getCameraMatrix() {
return mCameraMatrix;
}
public Mat getDistortionCoefficients() {
return mDistortionCoefficients;
}
public int getCornersBufferSize() {
return mCornersBuffer.size();
}
public double getAvgReprojectionError() {
return mRms;
}
public boolean isCalibrated() {
return mIsCalibrated;
}
public void setCalibrated() {
mIsCalibrated = true;
}
}
|
{
"pile_set_name": "Github"
}
|
import React, {Component} from "react";
import {Provider, connect} from "react-redux";
import ReactDOM from "react-dom";
import QueryParameters from "../utils/QueryParameters";
import store from "../store/store";
import CurrentViewActions from "../store/state/currentView"
var views = {},
configValues = {},
errorHandler = function() {
alert.apply(window, arguments);//TODO: fix ugly alert
};
export default class Application extends Component {
render() {
var viewName = this.props.currentView;
var View = views[viewName];
if (View) {
var viewProps = Object.assign({}, this.props[viewName]);
if (View.extractAdditionalProps) {
viewProps = Object.assign(viewProps, View.extractAdditionalProps(this.props));
}
return <View {...viewProps} key={viewName}/>
}
else {
return <div></div>;
}
}
static run() {
document.body.innerHTML = "";
var root = document.createElement("div");
root.setAttribute("id", "root");
document.body.appendChild(root);
window.addEventListener("popstate", Application.route);
Application.route();
ReactDOM.render(
<Provider store={store}>
<WrappedApp />
</Provider>,
document.getElementById("root"));
}
static route(event) {
var params = QueryParameters.parse(location.search, false, true);
var view = params.view || "index";
delete params.view;
store.dispatch(CurrentViewActions.showView(view, params, !!event));
}
static registerView(view) {
views[view.uri] = view;
}
static makeViewUrl(name, params) {
var query = Object.assign({view: name}, params);
return "?" + QueryParameters.stringify(query);
}
static setConfigValue(key, value) {
configValues[key] = value;
}
static getConfigValue(key) {
return configValues[key];
}
static setTitle(string) {
document.title = string;
}
static setErrorHandler(fn) {
errorHandler = fn;
}
static showError(err) {
if (err instanceof Error) {
console.log(err);
}
else {
if (errorHandler) {
errorHandler(err);
}
}
}
}
var WrappedApp = connect(function(state) {
return state;
})(Application);
|
{
"pile_set_name": "Github"
}
|
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2013 Erwin Coumans http://bulletphysics.org
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
///This file was written by Erwin Coumans
#ifndef BT_MULTIBODY_JOINT_MOTOR_H
#define BT_MULTIBODY_JOINT_MOTOR_H
#include "btMultiBodyConstraint.h"
struct btSolverInfo;
class btMultiBodyJointMotor : public btMultiBodyConstraint
{
protected:
btScalar m_desiredVelocity;
btScalar m_desiredPosition;
btScalar m_kd;
btScalar m_kp;
btScalar m_erp;
btScalar m_rhsClamp;//maximum error
public:
btMultiBodyJointMotor(btMultiBody* body, int link, btScalar desiredVelocity, btScalar maxMotorImpulse);
btMultiBodyJointMotor(btMultiBody* body, int link, int linkDoF, btScalar desiredVelocity, btScalar maxMotorImpulse);
virtual ~btMultiBodyJointMotor();
virtual void finalizeMultiDof();
virtual int getIslandIdA() const;
virtual int getIslandIdB() const;
virtual void createConstraintRows(btMultiBodyConstraintArray& constraintRows,
btMultiBodyJacobianData& data,
const btContactSolverInfo& infoGlobal);
virtual void setVelocityTarget(btScalar velTarget, btScalar kd = 1.f)
{
m_desiredVelocity = velTarget;
m_kd = kd;
}
virtual void setPositionTarget(btScalar posTarget, btScalar kp = 1.f)
{
m_desiredPosition = posTarget;
m_kp = kp;
}
virtual void setErp(btScalar erp)
{
m_erp = erp;
}
virtual btScalar getErp() const
{
return m_erp;
}
virtual void setRhsClamp(btScalar rhsClamp)
{
m_rhsClamp = rhsClamp;
}
virtual void debugDraw(class btIDebugDraw* drawer)
{
//todo(erwincoumans)
}
};
#endif //BT_MULTIBODY_JOINT_MOTOR_H
|
{
"pile_set_name": "Github"
}
|
/*
* PLUGIN RSSURLREWRITE
*
* Danish language file.
*
* Author:
*/
theUILang.rssNewRule = "New rule";
theUILang.mnu_rssurlrewrite = "URL Replacement in RSS";
theUILang.rssRulesManager = "Rules Manager";
theUILang.rssAddRule = "Add";
theUILang.rssDelRule = "Delete";
theUILang.rssCheckRule = "?";
theUILang.rssRulesLegend = "Rule Settings";
theUILang.rssSrcHref = "If URL of torrent download matches pattern";
theUILang.rssSrcGuid = "If URL of torrent description matches pattern";
theUILang.rssDstHref = "then replace URL of torrent download with";
theUILang.rssDstGuid = "then replace URL of torrent description with";
theUILang.rssRulesDebug = "Rule Debug";
theUILang.rssTestString = "Test";
theUILang.rssTestResult = "Result";
theUILang.rssURLInfo = "URL info";
theUILang.rssURLGUID = "Description URL";
theUILang.rssURLHref = "Download URL";
theUILang.rssPatternError = "Error in pattern string.";
theUILang.rssStatus = "RSS";
thePlugins.get("rssurlrewrite").langLoaded();
|
{
"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 com.google.wave.api;
import com.google.gson.Gson;
import com.google.wave.api.WaveService.ConsumerData;
import com.google.wave.api.event.AnnotatedTextChangedEvent;
import com.google.wave.api.event.BlipContributorsChangedEvent;
import com.google.wave.api.event.BlipSubmittedEvent;
import com.google.wave.api.event.DocumentChangedEvent;
import com.google.wave.api.event.Event;
import com.google.wave.api.event.EventHandler;
import com.google.wave.api.event.EventType;
import com.google.wave.api.event.FormButtonClickedEvent;
import com.google.wave.api.event.GadgetStateChangedEvent;
import com.google.wave.api.event.OperationErrorEvent;
import com.google.wave.api.event.WaveletBlipCreatedEvent;
import com.google.wave.api.event.WaveletBlipRemovedEvent;
import com.google.wave.api.event.WaveletCreatedEvent;
import com.google.wave.api.event.WaveletFetchedEvent;
import com.google.wave.api.event.WaveletParticipantsChangedEvent;
import com.google.wave.api.event.WaveletSelfAddedEvent;
import com.google.wave.api.event.WaveletSelfRemovedEvent;
import com.google.wave.api.event.WaveletTagsChangedEvent;
import com.google.wave.api.event.WaveletTitleChangedEvent;
import com.google.wave.api.impl.EventMessageBundle;
import com.google.wave.api.impl.GsonFactory;
import net.oauth.OAuthException;
import org.waveprotocol.wave.model.id.InvalidIdException;
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.id.WaveletId;
import java.io.BufferedReader;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Logger;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* A robot is an automated participant on a wave, that can read the contents
* of a wave in which it participates, modify the wave's contents, add or remove
* participants, and create new blips and new waves. In short, a robot can
* perform many of the actions that any other participant can perform.
*
* This is the abstract base class for a Google Wave Java robot, that supports:
* <ul>
* <li>Automatic events deserialization and operations serialization,
* in the event based model</li>
* <li>OAuth-secured operations submission, in the active model</li>
* <li>Callback for profile request, including proxied/custom profile</li>
* <li>Callback for capabilities.xml support</li>
* <li>Callback for verification token request, that is used during the robot
* registration process, to obtain consumer key and secret</li>
* </ul>
*
* Robot should implements the handlers of the events that it's interested in,
* and specify the context and filter (if applicable) via the
* {@link EventHandler.Capability} annotation. For example, if it is interested
* in a {@link BlipSubmittedEvent}, and would like to get the parent blip with
* the incoming event bundle, then it should implement this method:
* <pre>
* @Capability(contexts = {Context.PARENT, Context.SELF})
* public void onBlipSubmitted(BlipSubmittedEvent e) {
* ...
* }
* </pre>
* If the robot does not specify the {@link EventHandler.Capability}
* annotation, the default contexts (parent and children), and empty filter will
* be provided by default.
*/
public abstract class AbstractRobot extends HttpServlet implements EventHandler {
/** Some mime types. */
public static final String JSON_MIME_TYPE = "application/json; charset=utf-8";
public static final String TEXT_MIME_TYPE = "text/plain";
public static final String XML_MIME_TYPE = "application/xml";
/** Some constants for encoding. */
public static final String UTF_8 = "UTF-8";
/** The query parameter to specify custom profile request. */
public static final String NAME_QUERY_PARAMETER_KEY = "name";
/** The query parameter for security token. */
public static final String SECURITY_TOKEN_PARAMETER_KEY = "st";
/** Various request path constants that the robot replies to. */
public static final String RPC_PATH = "/_wave/robot/jsonrpc";
public static final String PROFILE_PATH = "/_wave/robot/profile";
public static final String CAPABILITIES_PATH = "/_wave/capabilities.xml";
public static final String VERIFY_TOKEN_PATH = "/_wave/verify_token";
public static final String DEFAULT_AVATAR =
"https://wave.google.com/a/wavesandbox.com/static/images/profiles/rusty.png";
private static final Logger LOG = Logger.getLogger(AbstractRobot.class.getName());
/** Serializer to serialize events and operations in the event-based mode. */
private static final Gson SERIALIZER = new GsonFactory().create();
/** A map of this robot's capabilities. */
private Map<String, Capability> capabilityMap;
/** A version number that is computed from this robot's capabilities. */
private String version;
/** A utility class to make Wave service calls. */
private WaveService waveService;
/** The token used to verify author during the registration process. */
private String verificationToken;
/** The token that is checked when handling verification token request. */
private String securityToken;
private boolean allowUnsignedRequests = true;
/**
* Constructor.
*/
protected AbstractRobot() {
initRobot();
}
/**
* Initializes the robot. Call it if required to re-compute robot's
* capabilities. Re-invoke {@link #setupOAuth} if needed.
*/
protected void initRobot() {
capabilityMap = computeCapabilityMap();
version = computeHash();
waveService = new WaveService(version);
}
/**
* Submits the pending operations associated with this {@link Wavelet}.
*
* @param wavelet the bundle that contains the operations to be submitted.
* @param rpcServerUrl the active gateway to send the operations to.
* @return a list of {@link JsonRpcResponse} that represents the responses
* from the server for all operations that were submitted.
*
* @throws IllegalStateException if this method is called prior to setting
* the proper consumer key, secret, and handler URL.
* @throws IOException if there is a problem submitting the operations.
*/
public List<JsonRpcResponse> submit(Wavelet wavelet, String rpcServerUrl) throws IOException {
return waveService.submit(wavelet, rpcServerUrl);
}
/**
* Returns an empty/blind stub of a wavelet with the given wave id and wavelet
* id.
*
* Call this method if you would like to apply wavelet-only operations
* without fetching the wave first.
*
* The returned wavelet has its own {@link OperationQueue}. It is the
* responsibility of the caller to make sure this wavelet gets submitted to
* the server, either by calling {@link AbstractRobot#submit(Wavelet, String)}
* or by calling {@link Wavelet#submitWith(Wavelet)} on the new wavelet, to
* join its queue with another wavelet, for example, the event wavelet.
*
* @param waveId the id of the wave.
* @param waveletId the id of the wavelet.
* @return a stub of a wavelet.
*/
public Wavelet blindWavelet(WaveId waveId, WaveletId waveletId) {
return waveService.blindWavelet(waveId, waveletId);
}
/**
* @see #blindWavelet(WaveId, WaveletId)
*
* @param proxyForId the proxying information that should be set on the
* operation queue. Please note that this parameter should be properly
* encoded to ensure that the resulting participant id is valid
* (see {@link Util#checkIsValidProxyForId(String)} for more details).
*/
public Wavelet blindWavelet(WaveId waveId, WaveletId waveletId, String proxyForId) {
return waveService.blindWavelet(waveId, waveletId, proxyForId);
}
/**
* @see #blindWavelet(WaveId, WaveletId, String)
*
* @param blips a collection of blips that belong to this wavelet.
*/
public Wavelet blindWavelet(WaveId waveId, WaveletId waveletId, String proxyForId,
Map<String, Blip> blips) {
return waveService.blindWavelet(waveId, waveletId, proxyForId, blips);
}
/**
* @see #blindWavelet(WaveId, WaveletId, String, Map)
*
* @param threads a collection of threads that belong to this wavelet.
*/
public Wavelet blindWavelet(WaveId waveId, WaveletId waveletId, String proxyForId,
Map<String, Blip> blips, Map<String, BlipThread> threads) {
return waveService.blindWavelet(waveId, waveletId, proxyForId, blips, threads);
}
/**
* Creates a new wave with a list of participants on it.
*
* The root wavelet of the new wave is returned with its own
* {@link OperationQueue}. It is the responsibility of the caller to make sure
* this wavelet gets submitted to the server, either by calling
* {@link AbstractRobot#submit(Wavelet, String)} or by calling
* {@link Wavelet#submitWith(Wavelet)} on the new wavelet.
*
* @param domain the domain to create the wavelet on. In general, this should
* correspond to the domain of the incoming event wavelet, except when
* the robot is calling this method outside of an event or when the server
* is handling multiple domains.
* @param participants the initial participants on the wave. The robot, as the
* creator of the wave, will be added by default. The order of the
* participants will be preserved.
*/
public Wavelet newWave(String domain, Set<String> participants) {
return waveService.newWave(domain, participants);
}
/**
* @see #newWave(String, Set)
*
* @param proxyForId the proxy id that should be used to create the new wave.
* If specified, the creator of the wave would be
* robotid+<proxyForId>@appspot.com. Please note that this parameter
* should be properly encoded to ensure that the resulting participant id
* is valid (see {@link Util#checkIsValidProxyForId(String)} for more
* details).
*/
public Wavelet newWave(String domain, Set<String> participants, String proxyForId) {
return waveService.newWave(domain, participants, proxyForId);
}
/**
* @see #newWave(String, Set, String)
*
* @param msg the message that will be passed back to the robot when
* WAVELET_CREATED event is fired as a result of this operation.
*/
public Wavelet newWave(String domain, Set<String> participants, String msg, String proxyForId) {
return waveService.newWave(domain, participants, msg, proxyForId);
}
/**
* @see #newWave(String, Set, String, String)
*
* @param rpcServerUrl if specified, this operation will be submitted
* immediately to this active gateway, that will return immediately the
* actual wave id, the id of the root wavelet, and id of the root blip.
*
* @throws IOException if there is a problem submitting the operation to the
* server, when {@code submit} is {@code true}.
* @throws InvalidIdException
*/
public Wavelet newWave(String domain, Set<String> participants, String msg, String proxyForId,
String rpcServerUrl) throws IOException, InvalidIdException {
return waveService.newWave(domain, participants, msg, proxyForId, rpcServerUrl);
}
/**
* Requests SearchResult for a query.
*
* @param query the query to execute.
* @param index the index from which to return results.
* @param numresults the number of results to return.
* @param rpcServerUrl the active gateway.
*
* @throws IOException if remote server returns error.
*/
public SearchResult search(String query, Integer index, Integer numResults, String rpcServerUrl)
throws IOException {
SearchResult searchResult = waveService.search(query, index, numResults, rpcServerUrl);
return searchResult;
}
/**
* Fetches a wavelet using the active API.
*
* The returned wavelet contains a snapshot of the state of the wavelet at
* that point. It can be used to modify the wavelet, but the wavelet might
* change in between, so treat carefully.
*
* Also, the returned wavelet has its own {@link OperationQueue}. It is the
* responsibility of the caller to make sure this wavelet gets submitted to
* the server, either by calling {@link AbstractRobot#submit(Wavelet, String)}
* or by calling {@link Wavelet#submitWith(Wavelet)} on the new wavelet.
*
* @param waveId the id of the wave to fetch.
* @param waveletId the id of the wavelet to fetch.
* @param rpcServerUrl the active gateway that is used to fetch the wavelet.
*
* @throws IOException if there is a problem fetching the wavelet.
*/
public Wavelet fetchWavelet(WaveId waveId, WaveletId waveletId, String rpcServerUrl)
throws IOException {
return waveService.fetchWavelet(waveId, waveletId, rpcServerUrl);
}
/**
* @see #fetchWavelet(WaveId, WaveletId, String)
*
* @param proxyForId the proxy id that should be used to fetch this wavelet.
* Please note that this parameter should be properly encoded to ensure
* that the resulting participant id is valid (see
* {@link Util#checkIsValidProxyForId(String)} for more details).
*/
public Wavelet fetchWavelet(WaveId waveId, WaveletId waveletId, String proxyForId,
String rpcServerUrl) throws IOException {
return waveService.fetchWavelet(waveId, waveletId, proxyForId, rpcServerUrl);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
if (req.getRequestURI().endsWith(RPC_PATH)) {
processRpc(req, resp);
} else {
resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
}
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
String path = req.getRequestURI();
if (path.endsWith(PROFILE_PATH)) {
processProfile(req, resp);
} else if (path.endsWith(CAPABILITIES_PATH)) {
processCapabilities(req, resp);
} else if (path.endsWith(VERIFY_TOKEN_PATH)) {
processVerifyToken(req, resp);
} else {
resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
}
}
/**
* @return a custom profile based on "name" query parameter, or {@code null}
* if this robot doesn't support custom profile.
*/
protected ParticipantProfile getCustomProfile(@SuppressWarnings("unused") String name) {
return null;
}
/**
* @return the URL of the robot's avatar image.
*/
protected String getRobotAvatarUrl() {
return DEFAULT_AVATAR;
}
/**
* Sets up the verification token that is used for the owner verification
* step during the robot registration.
*
* @param verificationToken the verification token.
* @param securityToken the security token that should be matched against when
* serving a verification token request.
*/
protected void setupVerificationToken(String verificationToken, String securityToken) {
this.verificationToken = verificationToken;
this.securityToken = securityToken;
}
/**
* Sets the OAuth related properties, including the consumer key and secret
* that are used to sign the outgoing operations in the active mode. Robot
* developer needs to visit
* {@link "http://wave.google.com/wave/robot/register"} to register and obtain
* the consumer key and secret.
*
* Should you need to make Active API calls to both our public and sandbox
* servers from the same robot, you can call this method multiple times, with
* the same consumer key and secret, but different RPC server URLs.
*
* After calling this method, the robot no longer accepts unsigned requests,
* but you can override that by calling
* {@link #setAllowUnsignedRequests(boolean)}.
*
* @param consumerKey the consumer key.
* @param consumerSecret the consumer secret.
* @param rpcServerUrl the URL of the server that serves the JSON-RPC request.
* <ul>
* <li>https://www-opensocial.googleusercontent.com/api/rpc - for wave
* preview.<li>
* <li>https://www-opensocial-sandbox.googleusercontent.com/api/rpc -
* for wave sandbox.</li>
* </ul>
*
* @throws IllegalArgumentException if any of the arguments are {@code null}.
*/
protected void setupOAuth(String consumerKey, String consumerSecret, String rpcServerUrl) {
waveService.setupOAuth(consumerKey, consumerSecret, rpcServerUrl);
setAllowUnsignedRequests(false);
}
/**
* Sets the OAuth related properties, including the consumer key and secret
* that are used to sign the outgoing operations in the active mode. This
* method sets the JSON-RPC handler URL to
* https://www-opensocial.googleusercontent.com/api/rpc, that is associated
* with wave preview instance.
*
* @param consumerKey the consumer key.
* @param consumerSecret the consumer secret.
*/
protected void setupOAuth(String consumerKey, String consumerSecret) {
setupOAuth(consumerKey, consumerSecret, WaveService.RPC_URL);
}
/**
* Sets whether or not unsigned incoming requests from robot proxy are
* allowed.
*
* @param allowUnsignedRequests whether or not unsigned requests from robot
* proxy are allowed.
*/
protected void setAllowUnsignedRequests(boolean allowUnsignedRequests) {
if (!allowUnsignedRequests && waveService.getConsumerDataMap().isEmpty()) {
throw new IllegalArgumentException("Please call AbstractRobot.setupOAuth() first to " +
"setup the consumer key and secret to validate the request.");
}
this.allowUnsignedRequests = allowUnsignedRequests;
}
/**
* @return {@code true} if unsigned incoming requests from robot proxy are
* allowed.
*/
protected boolean isUnsignedRequestsAllowed() {
return allowUnsignedRequests;
}
/**
* Processes the incoming HTTP request to obtain the verification token.
*
* @param req the HTTP request.
* @param resp the HTTP response.
*/
private void processVerifyToken(HttpServletRequest req, HttpServletResponse resp) {
if (verificationToken == null || verificationToken.isEmpty()) {
LOG.info("Please register a verification token by calling " +
"AbstractRobot.setVerificationToken().");
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
return;
}
String incomingSecurityToken = req.getParameter(SECURITY_TOKEN_PARAMETER_KEY);
if (securityToken != null && !securityToken.equals(incomingSecurityToken)) {
LOG.info("The incoming security token " + incomingSecurityToken + " does not match the " +
"expected security token " + securityToken + ".");
resp.setStatus(HttpURLConnection.HTTP_UNAUTHORIZED);
return;
}
resp.setContentType(TEXT_MIME_TYPE);
resp.setCharacterEncoding(UTF_8);
try {
resp.getWriter().write(verificationToken);
} catch (IOException e) {
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
return;
}
resp.setStatus(HttpURLConnection.HTTP_OK);
}
/**
* Processes the incoming HTTP request to obtain the capabilities.xml file.
*
* @param req the HTTP request.
* @param resp the HTTP response.
*/
private void processCapabilities(HttpServletRequest req, HttpServletResponse resp) {
StringBuilder xml = new StringBuilder();
xml.append("<?xml version=\"1.0\"?>\n");
xml.append("<w:robot xmlns:w=\"http://wave.google.com/extensions/robots/1.0\">\n");
xml.append(" <w:version>");
xml.append(version);
xml.append("</w:version>\n");
xml.append(" <w:protocolversion>");
xml.append(WaveService.PROTOCOL_VERSION.getVersionString());
xml.append("</w:protocolversion>\n");
xml.append(" <w:capabilities>\n");
for (Entry<String, Capability> entry : capabilityMap.entrySet()) {
xml.append(" <w:capability name=\"" + entry.getKey() + "\"");
Capability capability = entry.getValue();
if (capability != null) {
// Append context.
if (capability.contexts().length != 0) {
xml.append(" context=\"");
boolean first = true;
for (Context context : capability.contexts()) {
if (first) {
first = false;
} else {
xml.append(',');
}
xml.append(context.name());
}
xml.append("\"");
}
// Append filter.
if (capability.filter() != null && !capability.filter().isEmpty()) {
xml.append(" filter=\"");
xml.append(capability.filter());
xml.append("\"");
}
}
xml.append("/>\n");
}
xml.append(" </w:capabilities>\n");
if (!waveService.getConsumerDataMap().isEmpty()) {
xml.append(" <w:consumer_keys>\n");
for (ConsumerData consumerDataObj : waveService.getConsumerDataMap().values()) {
xml.append(" <w:consumer_key for=\"" + consumerDataObj.getRpcServerUrl() + "\">"
+ consumerDataObj.getConsumerKey() + "</w:consumer_key>\n");
}
xml.append(" </w:consumer_keys>\n");
}
xml.append("</w:robot>\n");
// Write the result into the output stream.
resp.setContentType(XML_MIME_TYPE);
resp.setCharacterEncoding(UTF_8);
try {
resp.getWriter().write(xml.toString());
} catch (IOException e) {
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
return;
}
resp.setStatus(HttpURLConnection.HTTP_OK);
}
/**
* Processes the incoming HTTP request to obtain robot's profile.
*
* @param req the HTTP request.
* @param resp the HTTP response.
*/
private void processProfile(HttpServletRequest req, HttpServletResponse resp) {
ParticipantProfile profile = null;
// Try to get custom profile.
String proxiedName = req.getParameter(NAME_QUERY_PARAMETER_KEY);
if (proxiedName != null) {
profile = getCustomProfile(proxiedName);
}
// Set the default profile.
if (profile == null) {
profile = new ParticipantProfile(getRobotName(), getRobotAvatarUrl(),
getRobotProfilePageUrl());
}
// Write the result into the output stream.
resp.setContentType(JSON_MIME_TYPE);
resp.setCharacterEncoding(UTF_8);
try {
resp.getWriter().write(SERIALIZER.toJson(profile));
} catch (IOException e) {
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
return;
}
resp.setStatus(HttpURLConnection.HTTP_OK);
}
/**
* Processes the incoming HTTP request that contains the event bundle.
*
* @param req the HTTP request.
* @param resp the HTTP response.
*/
private void processRpc(HttpServletRequest req, HttpServletResponse resp) {
// Deserialize and process the incoming events.
EventMessageBundle events = null;
try {
events = deserializeEvents(req);
} catch (IOException e) {
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
return;
}
// Append robot.notifyCapabilitiesHash operation before processing the
// events.
OperationQueue operationQueue = events.getWavelet().getOperationQueue();
operationQueue.notifyRobotInformation(WaveService.PROTOCOL_VERSION, version);
// Call the robot event handlers.
processEvents(events);
// Serialize the operations.
serializeOperations(operationQueue.getPendingOperations(), resp);
operationQueue.clear();
}
/**
* Processes the incoming event bundle. This method iterates over the event
* bundle and dispatch the individual event to its own handler, based on the
* event type.
*
* @param events the incoming event bundle.
*/
protected void processEvents(EventMessageBundle events) {
for (Event event : events.getEvents()) {
switch (event.getType()) {
case ANNOTATED_TEXT_CHANGED:
onAnnotatedTextChanged(AnnotatedTextChangedEvent.as(event));
break;
case BLIP_CONTRIBUTORS_CHANGED:
onBlipContributorsChanged(BlipContributorsChangedEvent.as(event));
break;
case BLIP_SUBMITTED:
onBlipSubmitted(BlipSubmittedEvent.as(event));
break;
case DOCUMENT_CHANGED:
onDocumentChanged(DocumentChangedEvent.as(event));
break;
case FORM_BUTTON_CLICKED:
onFormButtonClicked(FormButtonClickedEvent.as(event));
break;
case GADGET_STATE_CHANGED:
onGadgetStateChanged(GadgetStateChangedEvent.as(event));
break;
case WAVELET_BLIP_CREATED:
onWaveletBlipCreated(WaveletBlipCreatedEvent.as(event));
break;
case WAVELET_BLIP_REMOVED:
onWaveletBlipRemoved(WaveletBlipRemovedEvent.as(event));
break;
case WAVELET_CREATED:
onWaveletCreated(WaveletCreatedEvent.as(event));
break;
case WAVELET_FETCHED:
onWaveletFetched(WaveletFetchedEvent.as(event));
break;
case WAVELET_PARTICIPANTS_CHANGED:
onWaveletParticipantsChanged(WaveletParticipantsChangedEvent.as(event));
break;
case WAVELET_SELF_ADDED:
onWaveletSelfAdded(WaveletSelfAddedEvent.as(event));
break;
case WAVELET_SELF_REMOVED:
onWaveletSelfRemoved(WaveletSelfRemovedEvent.as(event));
break;
case WAVELET_TAGS_CHANGED:
onWaveletTagsChanged(WaveletTagsChangedEvent.as(event));
break;
case WAVELET_TITLE_CHANGED:
onWaveletTitleChanged(WaveletTitleChangedEvent.as(event));
break;
case OPERATION_ERROR:
onOperationError(OperationErrorEvent.as(event));
break;
}
}
}
/**
* Computes this robot's capabilities, based on the overriden event handler
* methods, and their {@link EventHandler.Capability} annotations.
*
* The result map does not use {@link EventType} enum as the key for stability
* between JVM runs, since the same enum may have different hashcode between
* JVM runs. This may cause two instances of the same robot that are running
* on different JVMs (for example, when App Engine scale the robot) to have
* different version number and capabilities ordering in
* {@code capabilities.xml}.
*
* @return a map of event type string to capability.
*/
protected Map<String, Capability> computeCapabilityMap() {
Map<String, Capability> map = new HashMap<String, Capability>();
for (Method baseMethod : EventHandler.class.getDeclaredMethods()) {
Method overridenMethod = null;
try {
overridenMethod = this.getClass().getMethod(baseMethod.getName(),
baseMethod.getParameterTypes());
} catch (NoSuchMethodException e) {
// Robot does not override this particular event handler. Continue.
continue;
}
// Skip the method, if it's declared in AbstractRobot.
if (AbstractRobot.class.equals(overridenMethod.getDeclaringClass())) {
continue;
}
// Get the event type.
EventType eventType = EventType.fromClass(overridenMethod.getParameterTypes()[0]);
// Get the capability annotation.
Capability capability = overridenMethod.getAnnotation(Capability.class);
map.put(eventType.toString(), capability);
}
return map;
}
/**
* Computes this robot's hash, based on the capabilities.
*
* @return a hash of this robot, computed from it's capabilities.
*/
protected String computeHash() {
long version = 0l;
for (Entry<String, Capability> entry : capabilityMap.entrySet()) {
long hash = entry.getKey().hashCode();
Capability capability = entry.getValue();
if (capability != null) {
for (Context context : capability.contexts()) {
hash = hash * 31 + context.name().hashCode();
}
hash = hash * 31 + capability.filter().hashCode();
}
version = version * 17 + hash;
}
return Long.toHexString(version);
}
/**
* Deserializes the given HTTP request's JSON body into an event message
* bundle.
*
* @param req the HTTP request to be deserialized.
* @return an event message bundle.
*
* @throws IOException if there is a problem reading the request's body.
* @throws IllegalArgumentException if the request is not signed properly.
*/
private EventMessageBundle deserializeEvents(HttpServletRequest req) throws IOException {
String json = readRequestBody(req);
LOG.info("Incoming events: " + json);
EventMessageBundle bundle = SERIALIZER.fromJson(json, EventMessageBundle.class);
if (bundle.getRpcServerUrl() == null) {
throw new IllegalArgumentException("RPC server URL is not set in the event bundle.");
}
if (!isUnsignedRequestsAllowed()) {
if (!waveService.hasConsumerData(bundle.getRpcServerUrl())) {
throw new IllegalArgumentException("No consumer key is found for the RPC server URL: " +
bundle.getRpcServerUrl());
}
// Validates the request.
try {
@SuppressWarnings("unchecked")
Map<String, String[]> parameterMap = req.getParameterMap();
waveService.validateOAuthRequest(req.getRequestURL().toString(), parameterMap,
json, bundle.getRpcServerUrl());
} catch (OAuthException e) {
throw new IllegalArgumentException("Error validating OAuth request", e);
}
}
return bundle;
}
/**
* Serializes the given outgoing operations into a JSON string, and put it in
* the given response object.
*
* @param operations the operations to be serialized.
* @param resp the response object to flush the output string into.
*/
private static void serializeOperations(List<OperationRequest> operations,
HttpServletResponse resp) {
try {
String json = SERIALIZER.toJson(operations, GsonFactory.OPERATION_REQUEST_LIST_TYPE);
LOG.info("Outgoing operations: " + json);
resp.setContentType(JSON_MIME_TYPE);
resp.setCharacterEncoding(UTF_8);
resp.getWriter().write(json);
resp.setStatus(HttpURLConnection.HTTP_OK);
} catch (IOException iox) {
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
}
}
/**
* Reads the given HTTP request's input stream into a string.
*
* @param req the HTTP request to be read.
* @return a string representation of the given HTTP request's body.
*
* @throws IOException if there is a problem reading the body.
*/
private static String readRequestBody(HttpServletRequest req) throws IOException {
StringBuilder json = new StringBuilder();
BufferedReader reader = req.getReader();
String line;
while ((line = reader.readLine()) != null) {
json.append(line);
}
return json.toString();
}
@Override
public void onAnnotatedTextChanged(AnnotatedTextChangedEvent event) {
// No-op.
}
@Override
public void onBlipContributorsChanged(BlipContributorsChangedEvent event) {
// No-op.
}
@Override
public void onBlipSubmitted(BlipSubmittedEvent event) {
// No-op.
}
@Override
public void onDocumentChanged(DocumentChangedEvent event) {
// No-op.
}
@Override
public void onFormButtonClicked(FormButtonClickedEvent event) {
// No-op.
}
@Override
public void onGadgetStateChanged(GadgetStateChangedEvent event) {
// No-op.
}
@Override
public void onWaveletBlipCreated(WaveletBlipCreatedEvent event) {
// No-op.
}
@Override
public void onWaveletBlipRemoved(WaveletBlipRemovedEvent event) {
// No-op.
}
@Override
public void onWaveletCreated(WaveletCreatedEvent event) {
// No-op.
}
@Override
public void onWaveletFetched(WaveletFetchedEvent event) {
// No-op.
}
@Override
public void onWaveletParticipantsChanged(WaveletParticipantsChangedEvent event) {
// No-op.
}
@Override
public void onWaveletSelfAdded(WaveletSelfAddedEvent event) {
// No-op.
}
@Override
public void onWaveletSelfRemoved(WaveletSelfRemovedEvent event) {
// No-op.
}
@Override
public void onWaveletTagsChanged(WaveletTagsChangedEvent event) {
// No-op.
}
@Override
public void onWaveletTitleChanged(WaveletTitleChangedEvent event) {
// No-op.
}
@Override
public void onOperationError(OperationErrorEvent event) {
// No-op.
}
/**
* @return the display name of the robot.
*/
protected abstract String getRobotName();
/**
* @return the URL of the robot's profile page.
*/
protected abstract String getRobotProfilePageUrl();
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python3
import os
import time
import ptan
import random
import argparse
import collections
from lib import game, model, mcts
from tensorboardX import SummaryWriter
import torch
import torch.optim as optim
import torch.nn.functional as F
PLAY_EPISODES = 1 #25
MCTS_SEARCHES = 10
MCTS_BATCH_SIZE = 8
REPLAY_BUFFER = 5000 # 30000
LEARNING_RATE = 0.1
BATCH_SIZE = 256
TRAIN_ROUNDS = 10
MIN_REPLAY_TO_TRAIN = 2000 #10000
BEST_NET_WIN_RATIO = 0.60
EVALUATE_EVERY_STEP = 100
EVALUATION_ROUNDS = 20
STEPS_BEFORE_TAU_0 = 10
def evaluate(net1, net2, rounds, device="cpu"):
n1_win, n2_win = 0, 0
mcts_stores = [mcts.MCTS(), mcts.MCTS()]
for r_idx in range(rounds):
r, _ = model.play_game(mcts_stores=mcts_stores, replay_buffer=None, net1=net1, net2=net2,
steps_before_tau_0=0, mcts_searches=20, mcts_batch_size=16,
device=device)
if r < -0.5:
n2_win += 1
elif r > 0.5:
n1_win += 1
return n1_win / (n1_win + n2_win)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--name", required=True, help="Name of the run")
parser.add_argument("--cuda", default=False, action="store_true", help="Enable CUDA")
args = parser.parse_args()
device = torch.device("cuda" if args.cuda else "cpu")
saves_path = os.path.join("saves", args.name)
os.makedirs(saves_path, exist_ok=True)
writer = SummaryWriter(comment="-" + args.name)
net = model.Net(input_shape=model.OBS_SHAPE, actions_n=game.GAME_COLS).to(device)
best_net = ptan.agent.TargetNet(net)
print(net)
optimizer = optim.SGD(net.parameters(), lr=LEARNING_RATE, momentum=0.9)
replay_buffer = collections.deque(maxlen=REPLAY_BUFFER)
mcts_store = mcts.MCTS()
step_idx = 0
best_idx = 0
with ptan.common.utils.TBMeanTracker(writer, batch_size=10) as tb_tracker:
while True:
t = time.time()
prev_nodes = len(mcts_store)
game_steps = 0
for _ in range(PLAY_EPISODES):
_, steps = model.play_game(mcts_store, replay_buffer, best_net.target_model, best_net.target_model,
steps_before_tau_0=STEPS_BEFORE_TAU_0, mcts_searches=MCTS_SEARCHES,
mcts_batch_size=MCTS_BATCH_SIZE, device=device)
game_steps += steps
game_nodes = len(mcts_store) - prev_nodes
dt = time.time() - t
speed_steps = game_steps / dt
speed_nodes = game_nodes / dt
tb_tracker.track("speed_steps", speed_steps, step_idx)
tb_tracker.track("speed_nodes", speed_nodes, step_idx)
print("Step %d, steps %3d, leaves %4d, steps/s %5.2f, leaves/s %6.2f, best_idx %d, replay %d" % (
step_idx, game_steps, game_nodes, speed_steps, speed_nodes, best_idx, len(replay_buffer)))
step_idx += 1
if len(replay_buffer) < MIN_REPLAY_TO_TRAIN:
continue
# train
sum_loss = 0.0
sum_value_loss = 0.0
sum_policy_loss = 0.0
for _ in range(TRAIN_ROUNDS):
batch = random.sample(replay_buffer, BATCH_SIZE)
batch_states, batch_who_moves, batch_probs, batch_values = zip(*batch)
batch_states_lists = [game.decode_binary(state) for state in batch_states]
states_v = model.state_lists_to_batch(batch_states_lists, batch_who_moves, device)
optimizer.zero_grad()
probs_v = torch.FloatTensor(batch_probs).to(device)
values_v = torch.FloatTensor(batch_values).to(device)
out_logits_v, out_values_v = net(states_v)
loss_value_v = F.mse_loss(out_values_v.squeeze(-1), values_v)
loss_policy_v = -F.log_softmax(out_logits_v, dim=1) * probs_v
loss_policy_v = loss_policy_v.sum(dim=1).mean()
loss_v = loss_policy_v + loss_value_v
loss_v.backward()
optimizer.step()
sum_loss += loss_v.item()
sum_value_loss += loss_value_v.item()
sum_policy_loss += loss_policy_v.item()
tb_tracker.track("loss_total", sum_loss / TRAIN_ROUNDS, step_idx)
tb_tracker.track("loss_value", sum_value_loss / TRAIN_ROUNDS, step_idx)
tb_tracker.track("loss_policy", sum_policy_loss / TRAIN_ROUNDS, step_idx)
# evaluate net
if step_idx % EVALUATE_EVERY_STEP == 0:
win_ratio = evaluate(net, best_net.target_model, rounds=EVALUATION_ROUNDS, device=device)
print("Net evaluated, win ratio = %.2f" % win_ratio)
writer.add_scalar("eval_win_ratio", win_ratio, step_idx)
if win_ratio > BEST_NET_WIN_RATIO:
print("Net is better than cur best, sync")
best_net.sync()
best_idx += 1
file_name = os.path.join(saves_path, "best_%03d_%05d.dat" % (best_idx, step_idx))
torch.save(net.state_dict(), file_name)
mcts_store.clear()
|
{
"pile_set_name": "Github"
}
|
#pragma hdrstop
#define INITGUID
#include <dsound.h>
#include <eax/eax.h>
/*
--- replaces following
#pragma comment(lib, "dxguid" )
*/
|
{
"pile_set_name": "Github"
}
|
require('../../modules/es6.number.constructor');
require('../../modules/es6.number.epsilon');
require('../../modules/es6.number.is-finite');
require('../../modules/es6.number.is-integer');
require('../../modules/es6.number.is-nan');
require('../../modules/es6.number.is-safe-integer');
require('../../modules/es6.number.max-safe-integer');
require('../../modules/es6.number.min-safe-integer');
require('../../modules/es6.number.parse-float');
require('../../modules/es6.number.parse-int');
require('../../modules/es6.number.to-fixed');
require('../../modules/es6.number.to-precision');
require('../../modules/core.number.iterator');
module.exports = require('../../modules/_core').Number;
|
{
"pile_set_name": "Github"
}
|
namespace SharpVk.Generator
{
public class ExtensionInfo
{
public string Name;
public int SpecVersion;
public string Extension;
public string Scope;
}
}
|
{
"pile_set_name": "Github"
}
|
// Boost.Range library
//
// Copyright Neil Groves 2010. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/range/
//
#ifndef BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
#define BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/range/detail/any_iterator_buffer.hpp>
#include <boost/range/detail/any_iterator_interface.hpp>
#include <boost/range/detail/any_iterator_wrapper.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost
{
namespace range_detail
{
// metafunction to determine if T is a const reference
template<class T>
struct is_const_reference
{
typedef typename mpl::and_<
typename is_reference<T>::type,
typename is_const<
typename remove_reference<T>::type
>::type
>::type type;
};
// metafunction to determine if T is a mutable reference
template<class T>
struct is_mutable_reference
{
typedef typename mpl::and_<
typename is_reference<T>::type,
typename mpl::not_<
typename is_const<
typename remove_reference<T>::type
>::type
>::type
>::type type;
};
// metafunction to evaluate if a source 'reference' can be
// converted to a target 'reference' as a value.
//
// This is true, when the target reference type is actually
// not a reference, and the source reference is convertible
// to the target type.
template<class SourceReference, class TargetReference>
struct is_convertible_to_value_as_reference
{
typedef typename mpl::and_<
typename mpl::not_<
typename is_reference<TargetReference>::type
>::type
, typename is_convertible<
SourceReference
, TargetReference
>::type
>::type type;
};
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer = any_iterator_default_buffer
>
class any_iterator;
// metafunction to determine if SomeIterator is an
// any_iterator.
//
// This is the general implementation which evaluates to false.
template<class SomeIterator>
struct is_any_iterator
: mpl::bool_<false>
{
};
// specialization of is_any_iterator to return true for
// any_iterator classes regardless of template parameters.
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer
>
struct is_any_iterator<
any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
>
>
: mpl::bool_<true>
{
};
} // namespace range_detail
namespace iterators
{
namespace detail
{
// Rationale:
// These are specialized since the iterator_facade versions lack
// the requisite typedefs to allow wrapping to determine the types
// if a user copy constructs from a postfix increment.
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer
>
class postfix_increment_proxy<
range_detail::any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
>
>
{
typedef range_detail::any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
> any_iterator_type;
public:
typedef Value value_type;
typedef typename std::iterator_traits<any_iterator_type>::iterator_category iterator_category;
typedef Difference difference_type;
typedef typename iterator_pointer<any_iterator_type>::type pointer;
typedef Reference reference;
explicit postfix_increment_proxy(any_iterator_type const& x)
: stored_value(*x)
{}
value_type&
operator*() const
{
return this->stored_value;
}
private:
mutable value_type stored_value;
};
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer
>
class writable_postfix_increment_proxy<
range_detail::any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
>
>
{
typedef range_detail::any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
> any_iterator_type;
public:
typedef Value value_type;
typedef typename std::iterator_traits<any_iterator_type>::iterator_category iterator_category;
typedef Difference difference_type;
typedef typename iterator_pointer<any_iterator_type>::type pointer;
typedef Reference reference;
explicit writable_postfix_increment_proxy(any_iterator_type const& x)
: stored_value(*x)
, stored_iterator(x)
{}
// Dereferencing must return a proxy so that both *r++ = o and
// value_type(*r++) can work. In this case, *r is the same as
// *r++, and the conversion operator below is used to ensure
// readability.
writable_postfix_increment_proxy const&
operator*() const
{
return *this;
}
// Provides readability of *r++
operator value_type&() const
{
return stored_value;
}
// Provides writability of *r++
template <class T>
T const& operator=(T const& x) const
{
*this->stored_iterator = x;
return x;
}
// This overload just in case only non-const objects are writable
template <class T>
T& operator=(T& x) const
{
*this->stored_iterator = x;
return x;
}
// Provides X(r++)
operator any_iterator_type const&() const
{
return stored_iterator;
}
private:
mutable value_type stored_value;
any_iterator_type stored_iterator;
};
} //namespace detail
} //namespace iterators
namespace range_detail
{
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer
>
class any_iterator
: public iterator_facade<
any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
>
, Value
, Traversal
, Reference
, Difference
>
{
template<
class OtherValue
, class OtherTraversal
, class OtherReference
, class OtherDifference
, class OtherBuffer
>
friend class any_iterator;
struct enabler {};
struct disabler {};
typedef typename any_iterator_interface_type_generator<
Traversal
, Reference
, Difference
, Buffer
>::type abstract_base_type;
typedef iterator_facade<
any_iterator<
Value
, Traversal
, Reference
, Difference
, Buffer
>
, Value
, Traversal
, Reference
, Difference
> base_type;
typedef Buffer buffer_type;
public:
typedef typename base_type::value_type value_type;
typedef typename base_type::reference reference;
typedef typename base_type::difference_type difference_type;
// Default constructor
any_iterator()
: m_impl(0) {}
// Simple copy construction without conversion
any_iterator(const any_iterator& other)
: base_type(other)
, m_impl(other.m_impl
? other.m_impl->clone(m_buffer)
: 0)
{
}
// Simple assignment operator without conversion
any_iterator& operator=(const any_iterator& other)
{
if (this != &other)
{
if (m_impl)
m_impl->~abstract_base_type();
m_buffer.deallocate();
m_impl = 0;
if (other.m_impl)
m_impl = other.m_impl->clone(m_buffer);
}
return *this;
}
// Implicit conversion from another any_iterator where the
// conversion is from a non-const reference to a const reference
template<
class OtherValue
, class OtherTraversal
, class OtherReference
, class OtherDifference
>
any_iterator(const any_iterator<
OtherValue,
OtherTraversal,
OtherReference,
OtherDifference,
Buffer
>& other,
typename ::boost::enable_if<
typename mpl::and_<
typename is_mutable_reference<OtherReference>::type,
typename is_const_reference<Reference>::type
>::type,
enabler
>::type* = 0
)
: m_impl(other.m_impl
? other.m_impl->clone_const_ref(m_buffer)
: 0
)
{
}
// Implicit conversion from another any_iterator where the
// reference types of the source and the target are references
// that are either both const, or both non-const.
template<
class OtherValue
, class OtherTraversal
, class OtherReference
, class OtherDifference
>
any_iterator(const any_iterator<
OtherValue
, OtherTraversal
, OtherReference
, OtherDifference
, Buffer
>& other,
typename ::boost::enable_if<
typename mpl::or_<
typename mpl::and_<
typename is_mutable_reference<OtherReference>::type,
typename is_mutable_reference<Reference>::type
>::type,
typename mpl::and_<
typename is_const_reference<OtherReference>::type,
typename is_const_reference<Reference>::type
>::type
>::type,
enabler
>::type* = 0
)
: m_impl(other.m_impl
? other.m_impl->clone(m_buffer)
: 0
)
{
}
// Implicit conversion to an any_iterator that uses a value for
// the reference type.
template<
class OtherValue
, class OtherTraversal
, class OtherReference
, class OtherDifference
>
any_iterator(const any_iterator<
OtherValue
, OtherTraversal
, OtherReference
, OtherDifference
, Buffer
>& other,
typename ::boost::enable_if<
typename is_convertible_to_value_as_reference<
OtherReference
, Reference
>::type,
enabler
>::type* = 0
)
: m_impl(other.m_impl
? other.m_impl->clone_reference_as_value(m_buffer)
: 0
)
{
}
any_iterator clone() const
{
any_iterator result;
if (m_impl)
result.m_impl = m_impl->clone(result.m_buffer);
return result;
}
any_iterator<
Value
, Traversal
, typename abstract_base_type::const_reference
, Difference
, Buffer
>
clone_const_ref() const
{
typedef any_iterator<
Value
, Traversal
, typename abstract_base_type::const_reference
, Difference
, Buffer
> result_type;
result_type result;
if (m_impl)
result.m_impl = m_impl->clone_const_ref(result.m_buffer);
return result;
}
// implicit conversion and construction from type-erasure-compatible
// iterators
template<class WrappedIterator>
explicit any_iterator(
const WrappedIterator& wrapped_iterator,
typename disable_if<
typename is_any_iterator<WrappedIterator>::type
, disabler
>::type* = 0
)
{
typedef typename any_iterator_wrapper_type_generator<
WrappedIterator
, Traversal
, Reference
, Difference
, Buffer
>::type wrapper_type;
void* ptr = m_buffer.allocate(sizeof(wrapper_type));
m_impl = new(ptr) wrapper_type(wrapped_iterator);
}
~any_iterator()
{
// manually run the destructor, the deallocation is automatically
// handled by the any_iterator_small_buffer base class.
if (m_impl)
m_impl->~abstract_base_type();
}
private:
friend class ::boost::iterator_core_access;
Reference dereference() const
{
BOOST_ASSERT( m_impl );
return m_impl->dereference();
}
bool equal(const any_iterator& other) const
{
return (m_impl == other.m_impl)
|| (m_impl && other.m_impl && m_impl->equal(*other.m_impl));
}
void increment()
{
BOOST_ASSERT( m_impl );
m_impl->increment();
}
void decrement()
{
BOOST_ASSERT( m_impl );
m_impl->decrement();
}
Difference distance_to(const any_iterator& other) const
{
return m_impl && other.m_impl
? m_impl->distance_to(*other.m_impl)
: 0;
}
void advance(Difference offset)
{
BOOST_ASSERT( m_impl );
m_impl->advance(offset);
}
any_iterator& swap(any_iterator& other)
{
BOOST_ASSERT( this != &other );
// grab a temporary copy of the other iterator
any_iterator tmp(other);
// deallocate the other iterator, taking care to obey the
// class-invariants in-case of exceptions later
if (other.m_impl)
{
other.m_impl->~abstract_base_type();
other.m_buffer.deallocate();
other.m_impl = 0;
}
// If this is a non-null iterator then we need to put
// a clone of this iterators implementation into the other
// iterator.
// We can't just swap because of the small buffer optimization.
if (m_impl)
{
other.m_impl = m_impl->clone(other.m_buffer);
m_impl->~abstract_base_type();
m_buffer.deallocate();
m_impl = 0;
}
// assign to this instance a clone of the temporarily held
// tmp which represents the input other parameter at the
// start of execution of this function.
if (tmp.m_impl)
m_impl = tmp.m_impl->clone(m_buffer);
return *this;
}
buffer_type m_buffer;
abstract_base_type* m_impl;
};
} // namespace range_detail
} // namespace boost
#endif // include guard
|
{
"pile_set_name": "Github"
}
|
tinymce.addI18n('km_KH',{
"Cut": "\u1780\u17b6\u178f\u17cb",
"Heading 5": "\u1780\u17d2\u1794\u17b6\u179b 5",
"Header 2": "\u1780\u17d2\u1794\u17b6\u179b 2",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u1780\u1798\u17d2\u1798\u179c\u17b7\u1792\u17b8\u200b\u17a2\u17ca\u17b8\u1793\u1792\u17ba\u178e\u17b7\u178f\u200b\u179a\u1794\u179f\u17cb\u200b\u17a2\u17d2\u1793\u1780\u200b\u1798\u17b7\u1793\u200b\u17a2\u17b6\u1785\u200b\u1785\u17bc\u179b\u200b\u1795\u17d2\u1791\u17b6\u179b\u17cb\u200b\u1791\u17c5\u200b\u1780\u17b6\u1793\u17cb\u200b\u1780\u17d2\u178a\u17b6\u179a\u200b\u178f\u1798\u17d2\u1794\u17c0\u178f\u200b\u1781\u17d2\u1791\u17b6\u179f\u17cb\u200b\u17a1\u17be\u1799\u17d4 \u179f\u17bc\u1798\u200b\u1794\u17d2\u179a\u17be Ctrl+X\/C\/V \u179b\u17be\u200b\u1780\u17d2\u178a\u17b6\u179a\u200b\u1785\u17bb\u1785\u200b\u1787\u17c6\u1793\u17bd\u179f\u200b\u179c\u17b7\u1789\u17d4",
"Heading 4": "\u1780\u17d2\u1794\u17b6\u179b 4",
"Div": "Div",
"Heading 2": "\u1780\u17d2\u1794\u17b6\u179b 2",
"Paste": "\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb",
"Close": "\u1794\u17b7\u1791",
"Font Family": "\u1796\u17bb\u1798\u17d2\u1796\u200b\u17a2\u1780\u17d2\u179f\u179a",
"Pre": "Pre",
"Align right": "\u178f\u1798\u17d2\u179a\u17b9\u1798\u200b\u1791\u17c5\u200b\u179f\u17d2\u178a\u17b6\u17c6",
"New document": "\u17af\u1780\u179f\u17b6\u179a\u200b\u17a2\u178f\u17d2\u1790\u1794\u1791\u200b\u1790\u17d2\u1798\u17b8",
"Blockquote": "\u1794\u17d2\u179b\u1780\u17cb\u200b\u1796\u17b6\u1780\u17d2\u1799\u200b\u179f\u1798\u17d2\u179a\u1784\u17cb",
"Numbered list": "\u1794\u1789\u17d2\u1787\u17b8\u200b\u1787\u17b6\u200b\u179b\u17c1\u1781",
"Heading 1": "\u1780\u17d2\u1794\u17b6\u179b 1",
"Headings": "\u1780\u17d2\u1794\u17b6\u179b",
"Increase indent": "\u1781\u17b7\u178f\u200b\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u200b\u1785\u17bc\u179b",
"Formats": "\u1791\u1798\u17d2\u179a\u1784\u17cb",
"Headers": "\u1780\u17d2\u1794\u17b6\u179b",
"Select all": "\u1787\u17d2\u179a\u17be\u179f\u200b\u1791\u17b6\u17c6\u1784\u200b\u17a2\u179f\u17cb",
"Header 3": "\u1780\u17d2\u1794\u17b6\u179b 3",
"Blocks": "\u1794\u17d2\u179b\u1780\u17cb",
"Undo": "\u1798\u17b7\u1793\u200b\u1792\u17d2\u179c\u17be\u200b\u179c\u17b7\u1789",
"Strikethrough": "\u1782\u17bc\u179f\u200b\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u200b\u1780\u178e\u17d2\u178a\u17b6\u179b",
"Bullet list": "\u1794\u1789\u17d2\u1787\u17b8\u200b\u1787\u17b6\u200b\u1785\u17c6\u178e\u17bb\u1785",
"Header 1": "\u1780\u17d2\u1794\u17b6\u179b 1",
"Superscript": "\u17a2\u1780\u17d2\u179f\u179a\u200b\u178f\u17bc\u1785\u200b\u179b\u17be",
"Clear formatting": "\u179f\u1798\u17d2\u17a2\u17b6\u178f\u200b\u1791\u1798\u17d2\u179a\u1784\u17cb",
"Font Sizes": "\u1791\u17c6\u17a0\u17c6\u200b\u17a2\u1780\u17d2\u179f\u179a",
"Subscript": "\u17a2\u1780\u17d2\u179f\u179a\u200b\u178f\u17bc\u1785\u200b\u1780\u17d2\u179a\u17c4\u1798",
"Header 6": "\u1780\u17d2\u1794\u17b6\u179b 6",
"Redo": "\u1792\u17d2\u179c\u17be\u200b\u179c\u17b7\u1789",
"Paragraph": "\u1780\u178b\u17b6\u1781\u178e\u17d2\u178c",
"Ok": "\u1796\u17d2\u179a\u1798",
"Bold": "\u178a\u17b7\u178f",
"Code": "\u1780\u17bc\u178a",
"Italic": "\u1791\u17d2\u179a\u17c1\u178f",
"Align center": "\u178f\u1798\u17d2\u179a\u17b9\u1798\u200b\u1791\u17c5\u200b\u1780\u178e\u17d2\u178a\u17b6\u179b",
"Header 5": "\u1780\u17d2\u1794\u17b6\u179b 5",
"Heading 6": "\u1780\u17d2\u1794\u17b6\u179b 6",
"Heading 3": "\u1780\u17d2\u1794\u17b6\u179b 3",
"Decrease indent": "\u1781\u17b7\u178f\u200b\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u200b\u1785\u17c1\u1789",
"Header 4": "\u1780\u17d2\u1794\u17b6\u179b 4",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u1780\u17b6\u179a\u200b\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb\u200b\u1796\u17c1\u179b\u200b\u1793\u17c1\u17c7 \u179f\u17d2\u1790\u17b7\u178f\u200b\u1780\u17d2\u1793\u17bb\u1784\u200b\u1794\u17c2\u1794\u200b\u1795\u17c2\u1793\u200b\u17a2\u1780\u17d2\u179f\u179a\u200b\u1792\u1798\u17d2\u1798\u178f\u17b6\u17d4 \u1794\u1785\u17d2\u1785\u17bb\u1794\u17d2\u1794\u1793\u17d2\u1793\u200b\u1793\u17c1\u17c7 \u1798\u17b6\u178f\u17b7\u1780\u17b6\u200b\u1791\u17b6\u17c6\u1784\u200b\u17a1\u17b6\u1799\u200b\u1793\u17b9\u1784\u200b\u178f\u17d2\u179a\u17bc\u179c\u200b\u1794\u17b6\u1793\u200b\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb\u200b\u1787\u17b6\u200b\u17a2\u1780\u17d2\u179f\u179a\u200b\u1792\u1798\u17d2\u1798\u178f\u17b6 \u179b\u17bb\u17c7\u178f\u17d2\u179a\u17b6\u200b\u178f\u17c2\u200b\u17a2\u17d2\u1793\u1780\u200b\u1794\u17b7\u1791\u200b\u1787\u1798\u17d2\u179a\u17be\u179f\u200b\u1793\u17c1\u17c7\u17d4",
"Underline": "\u1782\u17bc\u179f\u200b\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u200b\u1796\u17b8\u200b\u1780\u17d2\u179a\u17c4\u1798",
"Cancel": "\u1794\u17c4\u17c7\u200b\u1794\u1784\u17cb",
"Justify": "\u178f\u1798\u17d2\u179a\u17b9\u1798\u200b\u1796\u17c1\u1789",
"Inline": "\u1780\u17d2\u1793\u17bb\u1784\u200b\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb",
"Copy": "\u1785\u1798\u17d2\u179b\u1784",
"Align left": "\u178f\u1798\u17d2\u179a\u17b9\u1798\u200b\u1791\u17c5\u200b\u1786\u17d2\u179c\u17c1\u1784",
"Visual aids": "\u1791\u17b7\u178a\u17d2\u178b\u1797\u17b6\u1796\u200b\u1787\u17c6\u1793\u17bd\u1799",
"Lower Greek": "\u179b\u17c1\u1781\u200b\u1780\u17d2\u179a\u17b7\u1780\u200b\u178f\u17bc\u1785",
"Square": "\u1787\u17d2\u179a\u17bb\u1784",
"Default": "\u179b\u17c6\u1793\u17b6\u17c6\u200b\u178a\u17be\u1798",
"Lower Alpha": "\u17a2\u1780\u17d2\u179f\u179a\u200b\u178f\u17bc\u1785",
"Circle": "\u1798\u17bc\u179b",
"Disc": "\u1790\u17b6\u179f",
"Upper Alpha": "\u17a2\u1780\u17d2\u179f\u179a\u200b\u1792\u17c6",
"Upper Roman": "\u179b\u17c1\u1781\u200b\u179a\u17c9\u17bc\u1798\u17c9\u17b6\u17c6\u1784\u200b\u1792\u17c6",
"Lower Roman": "\u179b\u17c1\u1781\u200b\u179a\u17c9\u17bc\u1798\u17c9\u17b6\u17c6\u1784\u200b\u178f\u17bc\u1785",
"Name": "\u1788\u17d2\u1798\u17c4\u17c7",
"Anchor": "\u1799\u17bb\u1790\u17d2\u1780\u17b6",
"You have unsaved changes are you sure you want to navigate away?": "\u1798\u17b6\u1793\u200b\u1794\u1793\u17d2\u179b\u17b6\u179f\u17cb\u200b\u1794\u17d2\u178a\u17bc\u179a\u200b\u1798\u17b7\u1793\u200b\u1791\u17b6\u1793\u17cb\u200b\u1794\u17b6\u1793\u200b\u179a\u1780\u17d2\u179f\u17b6\u200b\u1791\u17bb\u1780\u17d4 \u178f\u17be\u200b\u17a2\u17d2\u1793\u1780\u200b\u1796\u17b7\u178f\u200b\u1787\u17b6\u200b\u1785\u1784\u17cb\u200b\u1785\u17b6\u1780\u200b\u1785\u17c1\u1789\u200b\u1796\u17b8\u1791\u17b8\u1793\u17c1\u17c7\u200b\u1798\u17c2\u1793\u1791\u17c1?",
"Restore last draft": "\u179f\u17d2\u178a\u17b6\u179a\u200b\u179f\u17c1\u1785\u1780\u17d2\u178a\u17b8\u200b\u1796\u17d2\u179a\u17b6\u1784\u200b\u1796\u17b8\u200b\u1798\u17bb\u1793",
"Special character": "\u178f\u17bd\u200b\u17a2\u1780\u17d2\u179f\u179a\u200b\u1796\u17b7\u179f\u17c1\u179f",
"Source code": "\u17a2\u1780\u17d2\u179f\u179a\u200b\u1780\u17bc\u178a",
"B": "B",
"R": "R",
"G": "G",
"Color": "\u1796\u178e\u17cc",
"Right to left": "\u179f\u17d2\u178a\u17b6\u17c6\u200b\u1791\u17c5\u200b\u1786\u17d2\u179c\u17c1\u1784",
"Left to right": "\u1786\u17d2\u179c\u17c1\u1784\u200b\u1791\u17c5\u200b\u179f\u17d2\u178a\u17b6\u17c6",
"Emoticons": "\u179a\u17bc\u1794\u200b\u179f\u1789\u17d2\u1789\u17b6\u178e\u200b\u17a2\u17b6\u179a\u1798\u17d2\u1798\u178e\u17cd",
"Robots": "\u179a\u17bc\u1794\u1799\u1793\u17d2\u178f",
"Document properties": "\u179b\u1780\u17d2\u1781\u178e\u17c8\u200b\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u200b\u17af\u1780\u179f\u17b6\u179a",
"Title": "\u1785\u17c6\u178e\u1784\u200b\u1787\u17be\u1784",
"Keywords": "\u1796\u17b6\u1780\u17d2\u1799\u200b\u1782\u1793\u17d2\u179b\u17b9\u17c7",
"Encoding": "\u1780\u17b6\u179a\u200b\u17a2\u17ca\u17b8\u1793\u1780\u17bc\u178a",
"Description": "\u179f\u17c1\u1785\u1780\u17d2\u178a\u17b8\u200b\u17a2\u1792\u17b7\u1794\u17d2\u1794\u17b6\u1799",
"Author": "\u17a2\u17d2\u1793\u1780\u200b\u1793\u17b7\u1796\u1793\u17d2\u1792",
"Fullscreen": "\u1796\u17c1\u1789\u200b\u17a2\u17c1\u1780\u17d2\u179a\u1784\u17cb",
"Horizontal line": "\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u200b\u178a\u17c1\u1780",
"Horizontal space": "\u179b\u17c6\u17a0\u200b\u1795\u17d2\u178a\u17c1\u1780",
"Insert\/edit image": "\u1794\u1789\u17d2\u1785\u17bc\u179b\/\u1780\u17c2 \u179a\u17bc\u1794\u200b\u1797\u17b6\u1796",
"General": "\u1791\u17bc\u1791\u17c5",
"Advanced": "\u1780\u1798\u17d2\u179a\u17b7\u178f\u200b\u1781\u17d2\u1796\u179f\u17cb",
"Source": "\u1794\u17d2\u179a\u1797\u1796",
"Border": "\u179f\u17ca\u17bb\u1798",
"Constrain proportions": " \u1794\u1784\u17d2\u1781\u17c6\u200b\u17b2\u17d2\u1799\u200b\u1798\u17b6\u1793\u200b\u179f\u1798\u17b6\u1798\u17b6\u178f\u17d2\u179a",
"Vertical space": "\u179b\u17c6\u17a0\u200b\u1794\u1789\u17d2\u1788\u179a",
"Image description": "\u179f\u17c1\u1785\u1780\u17d2\u178a\u17b8\u200b\u17a2\u1792\u17b7\u1794\u17d2\u1794\u17b6\u1799\u200b\u1796\u17b8\u200b\u179a\u17bc\u1794",
"Style": "\u179a\u1785\u1793\u17b6\u1794\u1790",
"Dimensions": "\u179c\u17b7\u1798\u17b6\u178f\u17d2\u179a",
"Insert image": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u179a\u17bc\u1794\u200b\u1797\u17b6\u1796",
"Zoom in": "\u1796\u1784\u17d2\u179a\u17b8\u1780",
"Contrast": "\u1780\u1798\u17d2\u179a\u17b7\u178f\u200b\u1796\u178e\u17cc",
"Back": "\u1790\u1799\u1780\u17d2\u179a\u17c4\u1799",
"Gamma": "\u17a0\u17d2\u1782\u17b6\u1798\u17c9\u17b6",
"Flip horizontally": "\u178f\u17d2\u179a\u17a1\u1794\u17cb\u200b\u1795\u17d2\u178a\u17c1\u1780",
"Resize": "\u1794\u17d2\u178a\u17bc\u179a\u200b\u1791\u17c6\u17a0\u17c6",
"Sharpen": "\u1785\u17d2\u1794\u17b6\u179f\u17cb",
"Zoom out": "\u1794\u1784\u17d2\u179a\u17bd\u1798",
"Image options": "\u1787\u1798\u17d2\u179a\u17be\u179f\u200b\u179a\u17bc\u1794\u1797\u17b6\u1796",
"Apply": "\u17a2\u1793\u17bb\u179c\u178f\u17d2\u178f",
"Brightness": "\u1796\u1793\u17d2\u179b\u17ba",
"Rotate clockwise": "\u1794\u1784\u17d2\u179c\u17b7\u179b\u200b\u179f\u17d2\u179a\u1794\u200b\u1791\u17d2\u179a\u1793\u17b7\u1785\u200b\u1793\u17b6\u17a1\u17b7\u1780\u17b6",
"Rotate counterclockwise": "\u1794\u1784\u17d2\u179c\u17b7\u179b\u200b\u1785\u17d2\u179a\u17b6\u179f\u200b\u1791\u17d2\u179a\u1793\u17b7\u1785\u200b\u1793\u17b6\u17a1\u17b7\u1780\u17b6",
"Edit image": "\u1780\u17c2\u179f\u1798\u17d2\u179a\u17bd\u179b\u200b\u179a\u17bc\u1794\u1797\u17b6\u1796",
"Color levels": "\u1780\u1798\u17d2\u179a\u17b7\u178f\u200b\u1796\u178e\u17cc",
"Crop": "\u1785\u17d2\u179a\u17b9\u1794",
"Orientation": "\u1791\u17b7\u179f",
"Flip vertically": "\u178f\u17d2\u179a\u17a1\u1794\u17cb\u200b\u1794\u1789\u17d2\u1788\u179a",
"Invert": "\u178a\u17b6\u1780\u17cb\u200b\u1794\u1789\u17d2\u1785\u17d2\u179a\u17b6\u179f",
"Insert date\/time": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u1780\u17b6\u179b\u200b\u1794\u179a\u17b7\u1785\u17d2\u1786\u17c1\u1791\/\u1798\u17c9\u17c4\u1784",
"Remove link": "\u178a\u1780\u200b\u178f\u17c6\u178e\u200b\u1785\u17c1\u1789",
"Url": "Url",
"Text to display": "\u17a2\u1780\u17d2\u179f\u179a\u200b\u178f\u17d2\u179a\u17bc\u179c\u200b\u1794\u1784\u17d2\u17a0\u17b6\u1789",
"Anchors": "\u1799\u17bb\u1790\u17d2\u1780\u17b6",
"Insert link": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u178f\u17c6\u178e",
"New window": "\u1795\u17d2\u1791\u17b6\u17c6\u1784\u200b\u179c\u17b8\u1793\u178a\u17bc\u200b\u1790\u17d2\u1798\u17b8",
"None": "\u1798\u17b7\u1793\u200b\u1798\u17b6\u1793",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u17a2\u17d2\u1793\u1780\u200b\u1794\u17b6\u1793\u200b\u1794\u1789\u17d2\u1785\u17bc\u179b URL \u178a\u17c2\u179b\u200b\u1787\u17b6\u200b\u178f\u17c6\u178e\u200b\u1791\u17c5\u200b\u1781\u17b6\u1784\u200b\u1780\u17d2\u179a\u17c5\u17d4 \u178f\u17be\u200b\u17a2\u17d2\u1793\u1780\u200b\u1785\u1784\u17cb\u200b\u1794\u1793\u17d2\u1790\u17c2\u1798\u200b\u1794\u17bb\u1796\u17d2\u179c\u1794\u200b\u1791 http:\/\/ \u178a\u17c2\u179a\u200b\u17ac\u1791\u17c1?",
"Target": "\u1791\u17b7\u179f\u178a\u17c5",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u17a2\u17d2\u1793\u1780\u200b\u1794\u17b6\u1793\u200b\u1794\u1789\u17d2\u1785\u17bc\u179b URL \u178a\u17c2\u179b\u200b\u1798\u17b6\u1793\u200b\u179f\u178e\u17d2\u178b\u17b6\u1793\u200b\u178a\u17bc\u1785\u200b\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u200b\u17a2\u17ca\u17b8\u1798\u17c2\u179b\u17d4 \u178f\u17be\u200b\u17a2\u17d2\u1793\u1780\u200b\u1785\u1784\u17cb\u200b\u1794\u1793\u17d2\u1790\u17c2\u1798\u200b\u1794\u17bb\u1796\u17d2\u179c\u1794\u200b\u1791 mailto: \u178a\u17c2\u179a\u200b\u17ac\u1791\u17c1?",
"Insert\/edit link": "\u1794\u1789\u17d2\u1785\u17bc\u179b\/\u1780\u17c2 \u178f\u17c6\u178e",
"Insert\/edit video": "\u1794\u1789\u17d2\u1785\u17bc\u179b\/\u1780\u17c2 \u179c\u17b8\u178a\u17c1\u17a2\u17bc",
"Poster": "\u17a2\u17d2\u1793\u1780\u200b\u1795\u17d2\u179f\u17b6\u1799",
"Alternative source": "\u1794\u17d2\u179a\u1797\u1796\u200b\u178a\u1791\u17c3\u200b\u1791\u17c0\u178f",
"Paste your embed code below:": "\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb\u200b\u1780\u17bc\u178a\u200b\u1794\u1784\u17d2\u1780\u1794\u17cb\u200b\u1793\u17c5\u200b\u1781\u17b6\u1784\u200b\u1780\u17d2\u179a\u17c4\u1798:",
"Insert video": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u179c\u17b8\u178a\u17c1\u17a2\u17bc",
"Embed": "\u1794\u1784\u17d2\u1780\u1794\u17cb",
"Nonbreaking space": "\u178a\u17c6\u178e\u1780\u200b\u1783\u17d2\u179b\u17b6\u200b\u1798\u17b7\u1793\u200b\u1794\u17c6\u1794\u17c2\u1780",
"Page break": "\u1794\u17c6\u1794\u17c2\u1780\u200b\u1791\u17c6\u1796\u17d0\u179a",
"Paste as text": "\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb\u200b\u1787\u17b6\u200b\u17a2\u1780\u17d2\u179f\u179a",
"Preview": "\u1798\u17be\u179b\u200b\u1787\u17b6\u200b\u1798\u17bb\u1793",
"Print": "\u1794\u17c4\u17c7\u200b\u1796\u17bb\u1798\u17d2\u1796",
"Save": "\u179a\u1780\u17d2\u179f\u17b6\u200b\u1791\u17bb\u1780",
"Could not find the specified string.": "\u1798\u17b7\u1793\u200b\u17a2\u17b6\u1785\u200b\u179a\u1780\u200b\u1783\u17be\u1789\u200b\u1781\u17d2\u179f\u17c2\u200b\u17a2\u1780\u17d2\u179f\u179a\u200b\u178a\u17c2\u179b\u200b\u1794\u17b6\u1793\u200b\u1780\u17c6\u178e\u178f\u17cb\u17d4",
"Replace": "\u1787\u17c6\u1793\u17bd\u179f",
"Next": "\u1798\u17bb\u1781",
"Whole words": "\u1796\u17b6\u1780\u17d2\u1799\u200b\u1791\u17b6\u17c6\u1784\u200b\u1798\u17bc\u179b",
"Find and replace": "\u179f\u17d2\u179c\u17c2\u1784\u200b\u179a\u1780\u200b\u1793\u17b7\u1784\u200b\u1787\u17c6\u1793\u17bd\u179f",
"Replace with": "\u1787\u17c6\u1793\u17bd\u179f\u200b\u178a\u17c4\u1799",
"Find": "\u179f\u17d2\u179c\u17c2\u1784\u200b\u179a\u1780",
"Replace all": "\u1787\u17c6\u1793\u17bd\u179f\u200b\u1791\u17b6\u17c6\u1784\u200b\u17a2\u179f\u17cb",
"Match case": "\u1780\u179a\u178e\u17b8\u200b\u178a\u17c6\u178e\u17bc\u1785",
"Prev": "\u1780\u17d2\u179a\u17c4\u1799",
"Spellcheck": "\u1796\u17b7\u1793\u17b7\u178f\u17d2\u1799\u200b\u17a2\u1780\u17d2\u1781\u179a\u17b6\u179c\u17b7\u179a\u17bb\u1791\u17d2\u1792",
"Finish": "\u1794\u1789\u17d2\u1785\u1794\u17cb",
"Ignore all": "\u1798\u17b7\u1793\u200b\u17a2\u17be\u1796\u17be\u200b\u1791\u17b6\u17c6\u1784\u200b\u17a2\u179f\u17cb",
"Ignore": "\u1798\u17b7\u1793\u200b\u17a2\u17be\u200b\u1796\u17be",
"Add to Dictionary": "\u1794\u1793\u17d2\u1790\u17c2\u1798\u200b\u1791\u17c5\u200b\u179c\u1785\u1793\u17b6\u1793\u17bb\u1780\u17d2\u179a\u1798",
"Insert row before": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u1788\u17bd\u179a\u200b\u178a\u17c1\u1780\u200b\u1796\u17b8\u200b\u1798\u17bb\u1781",
"Rows": "\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Height": "\u1780\u1798\u17d2\u1796\u179f\u17cb",
"Paste row after": "\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780\u200b\u1796\u17b8\u200b\u1780\u17d2\u179a\u17c4\u1799",
"Alignment": "\u1780\u17b6\u179a\u200b\u178f\u1798\u17d2\u179a\u17b9\u1798",
"Border color": "\u1796\u178e\u17cc\u200b\u179f\u17ca\u17bb\u1798",
"Column group": "\u1780\u17d2\u179a\u17bb\u1798\u200b\u1787\u17bd\u179a\u200b\u1788\u179a",
"Row": "\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Insert column before": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u1787\u17bd\u179a\u200b\u1788\u179a\u200b\u1796\u17b8\u200b\u1798\u17bb\u1781",
"Split cell": "\u1789\u17c2\u1780\u200b\u1780\u17d2\u179a\u17a1\u17b6",
"Cell padding": "\u1785\u1793\u17d2\u179b\u17c4\u17c7\u200b\u1780\u17d2\u179a\u17a1\u17b6",
"Cell spacing": "\u1782\u1798\u17d2\u179b\u17b6\u178f\u200b\u1780\u17d2\u179a\u17a1\u17b6",
"Row type": "\u1794\u17d2\u179a\u1797\u17c1\u1791\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Insert table": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u178f\u17b6\u179a\u17b6\u1784",
"Body": "\u178f\u17bd\u200b\u179f\u17c1\u1785\u1780\u17d2\u178a\u17b8",
"Caption": "\u1785\u17c6\u178e\u1784\u200b\u1787\u17be\u1784",
"Footer": "\u1794\u178b\u1798\u200b\u1780\u1790\u17b6",
"Delete row": "\u179b\u17bb\u1794\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Paste row before": "\u1794\u17b7\u1791\u200b\u1797\u17d2\u1787\u17b6\u1794\u17cb\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780\u200b\u1796\u17b8\u200b\u1798\u17bb\u1781",
"Scope": "\u179c\u17b7\u179f\u17b6\u179b\u200b\u1797\u17b6\u1796",
"Delete table": "\u179b\u17bb\u1794\u200b\u178f\u17b6\u179a\u17b6\u1784",
"H Align": "\u1780\u17b6\u179a\u200b\u178f\u1798\u17d2\u179a\u17b9\u1798\u200b\u1795\u17d2\u178a\u17c1\u1780",
"Top": "\u179b\u17be",
"Header cell": "\u1780\u17d2\u179a\u17a1\u17b6\u200b\u1785\u17c6\u178e\u1784\u200b\u1787\u17be\u1784",
"Column": "\u1787\u17bd\u179a\u200b\u1788\u179a",
"Row group": "\u1780\u17d2\u179a\u17bb\u1798\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Cell": "\u1780\u17d2\u179a\u17a1\u17b6",
"Middle": "\u1780\u178e\u17d2\u178a\u17b6\u179b",
"Cell type": "\u1794\u17d2\u179a\u1797\u17c1\u1791\u200b\u1780\u17d2\u179a\u17a1\u17b6",
"Copy row": "\u1785\u1798\u17d2\u179b\u1784\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Row properties": "\u179b\u1780\u17d2\u1781\u178e\u17c8\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Table properties": "\u179b\u1780\u17d2\u1781\u178e\u17c8\u200b\u178f\u17b6\u179a\u17b6\u1784",
"Bottom": "\u1780\u17d2\u179a\u17c4\u1798",
"V Align": "\u1780\u17b6\u179a\u200b\u178f\u1798\u17d2\u179a\u17b9\u1798\u200b\u1794\u1789\u17d2\u1788\u179a",
"Header": "\u1785\u17c6\u178e\u1784\u200b\u1787\u17be\u1784",
"Right": "\u179f\u17d2\u178a\u17b6\u17c6",
"Insert column after": "\u1794\u1789\u17d2\u1787\u17bc\u179b\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780\u200b\u1796\u17b8\u200b\u1780\u17d2\u179a\u17c4\u1799",
"Cols": "\u1787\u17bd\u179a\u200b\u1788\u179a",
"Insert row after": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780\u200b\u1796\u17b8\u200b\u1780\u17d2\u179a\u17c4\u1799",
"Width": "\u1791\u1791\u17b9\u1784",
"Cell properties": "\u179b\u1780\u17d2\u1781\u178e\u17c8\u200b\u1780\u17d2\u179a\u17a1\u17b6",
"Left": "\u1786\u17d2\u179c\u17c1\u1784",
"Cut row": "\u1780\u17b6\u178f\u17cb\u200b\u1787\u17bd\u179a\u200b\u178a\u17c1\u1780",
"Delete column": "\u179b\u17bb\u1794\u200b\u1787\u17bd\u179a\u200b\u1788\u179a",
"Center": "\u1780\u178e\u17d2\u178a\u17b6\u179b",
"Merge cells": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u1780\u17d2\u179a\u17a1\u17b6\u200b\u1785\u17bc\u179b\u200b\u1782\u17d2\u1793\u17b6",
"Insert template": "\u1794\u1789\u17d2\u1785\u17bc\u179b\u200b\u1796\u17bb\u1798\u17d2\u1796\u200b\u1782\u1798\u17d2\u179a\u17bc",
"Templates": "\u1796\u17bb\u1798\u17d2\u1796\u200b\u1782\u1798\u17d2\u179a\u17bc",
"Background color": "\u1796\u178e\u17cc\u200b\u1795\u17d2\u1791\u17c3\u200b\u1780\u17d2\u179a\u17c4\u1799",
"Custom...": "\u1795\u17d2\u1791\u17b6\u179b\u17cb\u200b\u1781\u17d2\u179b\u17bd\u1793...",
"Custom color": "\u1796\u178e\u17cc\u200b\u1795\u17d2\u1791\u17b6\u179b\u17cb\u200b\u1781\u17d2\u179b\u17bd\u1793",
"No color": "\u1782\u17d2\u1798\u17b6\u1793\u200b\u1796\u178e\u17cc",
"Text color": "\u1796\u178e\u17cc\u200b\u17a2\u1780\u17d2\u179f\u179a",
"Show blocks": "\u1794\u1784\u17d2\u17a0\u17b6\u1789\u200b\u1794\u17d2\u179b\u17bb\u1780",
"Show invisible characters": "\u1794\u1784\u17d2\u17a0\u17b6\u1789\u200b\u178f\u17bd\u200b\u17a2\u1780\u17d2\u179f\u179a\u200b\u1780\u17c6\u1794\u17b6\u17c6\u1784",
"Words: {0}": "\u1796\u17b6\u1780\u17d2\u1799: {0}",
"Insert": "\u1794\u1789\u17d2\u1785\u17bc\u179b",
"File": "\u17af\u1780\u179f\u17b6\u179a",
"Edit": "\u1780\u17c2\u1794\u17d2\u179a\u17c2",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u1791\u17b8\u178f\u17b6\u17c6\u1784\u200b\u17a2\u1780\u17d2\u179f\u179a\u200b\u179f\u17c6\u1794\u17bc\u179a\u1794\u17c2\u1794\u17d4 \u1785\u17bb\u1785 ALT-F9 \u179f\u1798\u17d2\u179a\u17b6\u1794\u17cb\u200b\u1798\u17c9\u17ba\u1793\u17bb\u1799\u17d4 \u1785\u17bb\u1785 ALT-F10 \u179f\u1798\u17d2\u179a\u17b6\u1794\u17cb\u200b\u179a\u1794\u17b6\u179a\u200b\u17a7\u1794\u1780\u179a\u178e\u17cd\u17d4 \u1785\u17bb\u1785 ALT-0 \u179f\u1798\u17d2\u179a\u17b6\u1794\u17cb\u200b\u1787\u17c6\u1793\u17bd\u1799\u17d4",
"Tools": "\u17a7\u1794\u1780\u179a\u178e\u17cd",
"View": "\u1791\u17b7\u178a\u17d2\u178b\u1797\u17b6\u1796",
"Table": "\u178f\u17b6\u179a\u17b6\u1784",
"Format": "\u1791\u1798\u17d2\u179a\u1784\u17cb"
});
|
{
"pile_set_name": "Github"
}
|
@comment $NetBSD: PLIST,v 1.1 2016/05/16 07:53:02 nils Exp $
bin/wheel-${PYVERSSUFFIX}
${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
${PYSITELIB}/${EGG_INFODIR}/not-zip-safe
${PYSITELIB}/${EGG_INFODIR}/requires.txt
${PYSITELIB}/${EGG_INFODIR}/top_level.txt
${PYSITELIB}/wheel/__init__.py
${PYSITELIB}/wheel/__init__.pyc
${PYSITELIB}/wheel/__init__.pyo
${PYSITELIB}/wheel/__main__.py
${PYSITELIB}/wheel/__main__.pyc
${PYSITELIB}/wheel/__main__.pyo
${PYSITELIB}/wheel/archive.py
${PYSITELIB}/wheel/archive.pyc
${PYSITELIB}/wheel/archive.pyo
${PYSITELIB}/wheel/bdist_wheel.py
${PYSITELIB}/wheel/bdist_wheel.pyc
${PYSITELIB}/wheel/bdist_wheel.pyo
${PYSITELIB}/wheel/decorator.py
${PYSITELIB}/wheel/decorator.pyc
${PYSITELIB}/wheel/decorator.pyo
${PYSITELIB}/wheel/egg2wheel.py
${PYSITELIB}/wheel/egg2wheel.pyc
${PYSITELIB}/wheel/egg2wheel.pyo
${PYSITELIB}/wheel/eggnames.txt
${PYSITELIB}/wheel/install.py
${PYSITELIB}/wheel/install.pyc
${PYSITELIB}/wheel/install.pyo
${PYSITELIB}/wheel/metadata.py
${PYSITELIB}/wheel/metadata.pyc
${PYSITELIB}/wheel/metadata.pyo
${PYSITELIB}/wheel/paths.py
${PYSITELIB}/wheel/paths.pyc
${PYSITELIB}/wheel/paths.pyo
${PYSITELIB}/wheel/pep425tags.py
${PYSITELIB}/wheel/pep425tags.pyc
${PYSITELIB}/wheel/pep425tags.pyo
${PYSITELIB}/wheel/pkginfo.py
${PYSITELIB}/wheel/pkginfo.pyc
${PYSITELIB}/wheel/pkginfo.pyo
${PYSITELIB}/wheel/signatures/__init__.py
${PYSITELIB}/wheel/signatures/__init__.pyc
${PYSITELIB}/wheel/signatures/__init__.pyo
${PYSITELIB}/wheel/signatures/djbec.py
${PYSITELIB}/wheel/signatures/djbec.pyc
${PYSITELIB}/wheel/signatures/djbec.pyo
${PYSITELIB}/wheel/signatures/ed25519py.py
${PYSITELIB}/wheel/signatures/ed25519py.pyc
${PYSITELIB}/wheel/signatures/ed25519py.pyo
${PYSITELIB}/wheel/signatures/keys.py
${PYSITELIB}/wheel/signatures/keys.pyc
${PYSITELIB}/wheel/signatures/keys.pyo
${PYSITELIB}/wheel/test/__init__.py
${PYSITELIB}/wheel/test/__init__.pyc
${PYSITELIB}/wheel/test/__init__.pyo
${PYSITELIB}/wheel/test/complex-dist/complexdist/__init__.py
${PYSITELIB}/wheel/test/complex-dist/complexdist/__init__.pyc
${PYSITELIB}/wheel/test/complex-dist/complexdist/__init__.pyo
${PYSITELIB}/wheel/test/complex-dist/setup.py
${PYSITELIB}/wheel/test/complex-dist/setup.pyc
${PYSITELIB}/wheel/test/complex-dist/setup.pyo
${PYSITELIB}/wheel/test/headers.dist/header.h
${PYSITELIB}/wheel/test/headers.dist/headersdist.py
${PYSITELIB}/wheel/test/headers.dist/headersdist.pyc
${PYSITELIB}/wheel/test/headers.dist/headersdist.pyo
${PYSITELIB}/wheel/test/headers.dist/setup.py
${PYSITELIB}/wheel/test/headers.dist/setup.pyc
${PYSITELIB}/wheel/test/headers.dist/setup.pyo
${PYSITELIB}/wheel/test/pydist-schema.json
${PYSITELIB}/wheel/test/simple.dist/setup.py
${PYSITELIB}/wheel/test/simple.dist/setup.pyc
${PYSITELIB}/wheel/test/simple.dist/setup.pyo
${PYSITELIB}/wheel/test/simple.dist/simpledist/__init__.py
${PYSITELIB}/wheel/test/simple.dist/simpledist/__init__.pyc
${PYSITELIB}/wheel/test/simple.dist/simpledist/__init__.pyo
${PYSITELIB}/wheel/test/test-1.0-py2.py3-none-win32.whl
${PYSITELIB}/wheel/test/test_basic.py
${PYSITELIB}/wheel/test/test_basic.pyc
${PYSITELIB}/wheel/test/test_basic.pyo
${PYSITELIB}/wheel/test/test_install.py
${PYSITELIB}/wheel/test/test_install.pyc
${PYSITELIB}/wheel/test/test_install.pyo
${PYSITELIB}/wheel/test/test_keys.py
${PYSITELIB}/wheel/test/test_keys.pyc
${PYSITELIB}/wheel/test/test_keys.pyo
${PYSITELIB}/wheel/test/test_paths.py
${PYSITELIB}/wheel/test/test_paths.pyc
${PYSITELIB}/wheel/test/test_paths.pyo
${PYSITELIB}/wheel/test/test_ranking.py
${PYSITELIB}/wheel/test/test_ranking.pyc
${PYSITELIB}/wheel/test/test_ranking.pyo
${PYSITELIB}/wheel/test/test_signatures.py
${PYSITELIB}/wheel/test/test_signatures.pyc
${PYSITELIB}/wheel/test/test_signatures.pyo
${PYSITELIB}/wheel/test/test_tagopt.py
${PYSITELIB}/wheel/test/test_tagopt.pyc
${PYSITELIB}/wheel/test/test_tagopt.pyo
${PYSITELIB}/wheel/test/test_tool.py
${PYSITELIB}/wheel/test/test_tool.pyc
${PYSITELIB}/wheel/test/test_tool.pyo
${PYSITELIB}/wheel/test/test_wheelfile.py
${PYSITELIB}/wheel/test/test_wheelfile.pyc
${PYSITELIB}/wheel/test/test_wheelfile.pyo
${PYSITELIB}/wheel/tool/__init__.py
${PYSITELIB}/wheel/tool/__init__.pyc
${PYSITELIB}/wheel/tool/__init__.pyo
${PYSITELIB}/wheel/util.py
${PYSITELIB}/wheel/util.pyc
${PYSITELIB}/wheel/util.pyo
${PYSITELIB}/wheel/wininst2wheel.py
${PYSITELIB}/wheel/wininst2wheel.pyc
${PYSITELIB}/wheel/wininst2wheel.pyo
|
{
"pile_set_name": "Github"
}
|
#define AUTOTUNE_N 16, 16
// This tests a segfault generated by an autotuned schedule.
#include "Halide.h"
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
ImageParam in_img(UInt(16), 2);
Func blur_x("blur_x"), blur_y("blur_y");
Var x("x"), y("y"), xi("xi"), yi("yi");
Func input;
input(x, y) = in_img(clamp(x, 1, in_img.width() - 1),
clamp(y, 1, in_img.height()) - 1);
// The algorithm
blur_x(x, y) = (input(x, y) + input(x + 1, y) + input(x + 2, y)) / 3;
blur_y(x, y) = (blur_x(x, y) + blur_x(x, y + 1) + blur_x(x, y + 2)) / 3;
Halide::Var _x2;
input
.reorder_storage(y, x)
.compute_root();
blur_x
.split(x, x, _x2, 4)
.compute_at(blur_y, y);
blur_y
.reorder(y, x);
blur_y.compile_jit();
blur_y.infer_input_bounds({AUTOTUNE_N});
assert(in_img.get().data());
blur_y.realize(AUTOTUNE_N);
printf("Success!\n");
return 0;
}
|
{
"pile_set_name": "Github"
}
|
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2014-2015. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP
#define BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
namespace std { //no namespace versioning in clang+libc++
struct nothrow_t;
} //namespace std {
namespace boost{ namespace interprocess {
template <int Dummy = 0>
struct nothrow
{
static const std::nothrow_t &get() { return *pnothrow; }
static std::nothrow_t *pnothrow;
};
template <int Dummy>
std::nothrow_t *nothrow<Dummy>::pnothrow =
reinterpret_cast<std::nothrow_t *>(0x1234); //Avoid sanitizer warnings on references to null
}} //namespace boost{ namespace interprocess {
#endif //#ifndef BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP
|
{
"pile_set_name": "Github"
}
|
@model CorporateEvents.SharePointWeb.Models.Registration
@{
ViewBag.Title = "Register";
}
<h2>Register</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => model.EventId, new { value = ViewBag.EventId })
<div class="form-horizontal">
<h4>Registration</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.UserId, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.UserId, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.UserId, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug_shared|SDK_AM335X_SK_WEC2013_V310">
<Configuration>debug_shared</Configuration>
<Platform>SDK_AM335X_SK_WEC2013_V310</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug_static_md|SDK_AM335X_SK_WEC2013_V310">
<Configuration>debug_static_md</Configuration>
<Platform>SDK_AM335X_SK_WEC2013_V310</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug_static_mt|SDK_AM335X_SK_WEC2013_V310">
<Configuration>debug_static_mt</Configuration>
<Platform>SDK_AM335X_SK_WEC2013_V310</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release_shared|SDK_AM335X_SK_WEC2013_V310">
<Configuration>release_shared</Configuration>
<Platform>SDK_AM335X_SK_WEC2013_V310</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release_static_md|SDK_AM335X_SK_WEC2013_V310">
<Configuration>release_static_md</Configuration>
<Platform>SDK_AM335X_SK_WEC2013_V310</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release_static_mt|SDK_AM335X_SK_WEC2013_V310">
<Configuration>release_static_mt</Configuration>
<Platform>SDK_AM335X_SK_WEC2013_V310</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>httpget</ProjectName>
<ProjectGuid>{5A299876-BF4E-37B9-922D-4E6FC1FA9520}</ProjectGuid>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<EnableRedirectPlatform>true</EnableRedirectPlatform>
<RedirectPlatformValue>SDK_AM335X_SK_WEC2013_V310</RedirectPlatformValue>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|SDK_AM335X_SK_WEC2013_V310'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|SDK_AM335X_SK_WEC2013_V310'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|SDK_AM335X_SK_WEC2013_V310'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|SDK_AM335X_SK_WEC2013_V310'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V310'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V310'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>CE800</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
<ImportGroup Label="ExtensionSettings"/>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|SDK_AM335X_SK_WEC2013_V310'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|SDK_AM335X_SK_WEC2013_V310'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|SDK_AM335X_SK_WEC2013_V310'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|SDK_AM335X_SK_WEC2013_V310'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V310'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V310'" Label="PropertySheets">
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
</ImportGroup>
<PropertyGroup Label="UserMacros"/>
<PropertyGroup>
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V310'">httpgetd</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|SDK_AM335X_SK_WEC2013_V310'">httpgetd</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|SDK_AM335X_SK_WEC2013_V310'">httpgetd</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V310'">httpget</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|SDK_AM335X_SK_WEC2013_V310'">httpget</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|SDK_AM335X_SK_WEC2013_V310'">httpget</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V310'">
<OutDir>bin\$(Platform)\shared\</OutDir>
<IntDir>obj\httpget\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V310'">
<OutDir>bin\$(Platform)\shared\</OutDir>
<IntDir>obj\httpget\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|SDK_AM335X_SK_WEC2013_V310'">
<OutDir>bin\$(Platform)\static_mt\</OutDir>
<IntDir>obj\httpget\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|SDK_AM335X_SK_WEC2013_V310'">
<OutDir>bin\$(Platform)\static_mt\</OutDir>
<IntDir>obj\httpget\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|SDK_AM335X_SK_WEC2013_V310'">
<OutDir>bin\$(Platform)\static_md\</OutDir>
<IntDir>obj\httpget\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|SDK_AM335X_SK_WEC2013_V310'">
<OutDir>bin\$(Platform)\static_md\</OutDir>
<IntDir>obj\httpget\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V310'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>ws2.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Platform)\shared\httpgetd.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>bin\$(Platform)\shared\httpgetd.pdb</ProgramDatabaseFile>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<SubSystem>WindowsCE</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V310'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;$(ProjectName)_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Platform)\shared\httpget.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile/>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<SubSystem>WindowsCE</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|SDK_AM335X_SK_WEC2013_V310'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;POCO_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;ws2.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Platform)\static_mt\httpgetd.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>bin\$(Platform)\static_mt\httpgetd.pdb</ProgramDatabaseFile>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<SubSystem>WindowsCE</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|SDK_AM335X_SK_WEC2013_V310'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;POCO_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;ws2.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Platform)\static_mt\httpget.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile/>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<SubSystem>WindowsCE</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|SDK_AM335X_SK_WEC2013_V310'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;ws2.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Platform)\static_md\httpgetd.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>bin\$(Platform)\static_md\httpgetd.pdb</ProgramDatabaseFile>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<SubSystem>WindowsCE</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|SDK_AM335X_SK_WEC2013_V310'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;POCO_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader/>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;ws2.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\$(Platform)\static_md\httpget.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile/>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<SubSystem>WindowsCE</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\httpget.cpp"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ImportGroup Label="ExtensionTargets"/>
</Project>
|
{
"pile_set_name": "Github"
}
|
package net.sourceforge.vrapper.log;
public class SystemStreamsLog implements Log {
private boolean debugEnabled = Boolean.parseBoolean(System.getProperty(DEBUGLOG_PROPERTY));
public SystemStreamsLog(boolean enableDebug) {
debugEnabled = enableDebug;
}
public void error(String msg, Throwable exception) {
System.err.println(msg);
if (exception != null) {
exception.printStackTrace();
}
}
public void info(String msg) {
System.out.println(msg);
}
public void debug(String msg) {
if (debugEnabled) {
System.out.println(msg);
}
}
@Override
public void setDebugEnabled(boolean enabled) {
debugEnabled = enabled;
}
@Override
public boolean isDebugEnabled() {
return debugEnabled;
}
}
|
{
"pile_set_name": "Github"
}
|
import Test.Tasty
import Test.Tasty.HUnit
import Control.Concurrent
import Control.Exception
import Control.Monad
import System.Environment
-- verbose versions of everything, to make it easier to debug from travis logs
verbose :: String -> IO ()
verbose msg = putStrLn ("resource-release-test.hs: " ++ msg)
verboseSleep :: Int -> IO ()
verboseSleep seconds = do
verbose ("sleep " ++ show seconds)
threadDelay (seconds * 1000000)
verboseTouchFile :: FilePath -> IO ()
verboseTouchFile filePath = do
verbose ("touch " ++ filePath)
writeFile filePath ""
main :: IO ()
main = do
dir:args <- getArgs
withArgs args $ do
defaultMain $ testCase "Test" $ do
let body = do
verboseTouchFile (dir ++ "/test-has-started")
forever $ verboseSleep 1 -- wait for resource-release-test.sh to kill us
releaseResources = do
verbose "resource-release-test.hs: releasing resources..."
verboseSleep 1 -- bug: the program terminates here, before the resources are released
verboseTouchFile (dir ++ "/resources-are-released")
body `finally` releaseResources
|
{
"pile_set_name": "Github"
}
|
#%Module1.0
#####################################################################
set modulename h5utils-serial
set version 1.12.1
set compiler gnu-4.7.2
set basepath /opt/h5utils-serial/$version/gnu-4.7.2
proc ModulesHelp { } {
puts stderr "\tLoads $modulename ($version)"
}
module-whatis "Loads $modulename ($version), compiler $compiler."
# Requirements for the module:
prereq zlib/1.2.7/gnu-4.7.2
prereq hdf5-serial/1.8.10/gnu-4.7.2
prepend-path PATH $basepath/bin
|
{
"pile_set_name": "Github"
}
|
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.book
module:
- text
id: node.book.body
field_name: body
entity_type: node
bundle: book
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: true
required_summary: false
field_type: text_with_summary
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("DeltaEngine.Input")]
[assembly: AssemblyDescription("Delta Engine Library Input")]
[assembly: AssemblyCompany("Delta Engine")]
[assembly: AssemblyCopyright("Copyright © Delta Engine 2014")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: Guid("d0142397-7855-4bcd-a0db-a541b8194251")]
[assembly: AssemblyVersion("1.1")]
[assembly: AssemblyFileVersion("1.1")]
[assembly: InternalsVisibleTo("DeltaEngine.Input.Tests")]
[assembly: InternalsVisibleTo("DeltaEngine.Editor.InputEditor")]
[assembly: InternalsVisibleTo("DeltaEngine.Editor.InputEditor.Tests")]
|
{
"pile_set_name": "Github"
}
|
// go run mksyscall.go -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build linux,amd64
package unix
import (
"syscall"
"unsafe"
)
var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fchmodat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(buf) > 0 {
_p1 = unsafe.Pointer(&buf[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unlinkat(dirfd int, path string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getcwd(buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg2)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg3)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(arg4)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
var _p0 unsafe.Pointer
if len(payload) > 0 {
_p0 = unsafe.Pointer(&payload[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(source)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(target)
if err != nil {
return
}
var _p2 *byte
_p2, err = BytePtrFromString(fstype)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Acct(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(keyType)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(description)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(payload) > 0 {
_p2 = unsafe.Pointer(&payload[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
id = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chdir(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chroot(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGetres(clockid int32, res *Timespec) (err error) {
_, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGettime(clockid int32, time *Timespec) (err error) {
_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) {
_, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func DeleteModule(name string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(name)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup3(oldfd int, newfd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollCreate1(flag int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Eventfd(initval uint, flags int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Exit(code int) {
SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func FinitModule(fd int, params string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(params)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flistxattr(fd int, dest []byte) (sz int, err error) {
var _p0 unsafe.Pointer
if len(dest) > 0 {
_p0 = unsafe.Pointer(&dest[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest)))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fremovexattr(fd int, attr string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attr)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) {
r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0)
pid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) {
r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0)
ppid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrandom(buf []byte, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettid() (tid int) {
r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0)
tid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(dest) > 0 {
_p2 = unsafe.Pointer(&dest[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InitModule(moduleImage []byte, params string) (err error) {
var _p0 unsafe.Pointer
if len(moduleImage) > 0 {
_p0 = unsafe.Pointer(&moduleImage[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
var _p1 *byte
_p1, err = BytePtrFromString(params)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(pathname)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))
watchdesc = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Kill(pid int, sig syscall.Signal) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Klogctl(typ int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(dest) > 0 {
_p2 = unsafe.Pointer(&dest[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listxattr(path string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Llistxattr(path string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lremovexattr(path string, attr string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(data) > 0 {
_p2 = unsafe.Pointer(&data[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func MemfdCreate(name string, flags int) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(name)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(putold)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {
_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Removexattr(path string, attr string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(keyType)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(description)
if err != nil {
return
}
var _p2 *byte
_p2, err = BytePtrFromString(callback)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
id = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setdomainname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sethostname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setns(fd int, nstype int) (err error) {
_, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(data) > 0 {
_p2 = unsafe.Pointer(&data[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Signalfd(fd int, mask *Sigset_t, flags int) {
SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags))
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sync() {
SyscallNoError(SYS_SYNC, 0, 0, 0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Syncfs(fd int) (err error) {
_, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
n = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(mask int) (oldmask int) {
r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
oldmask = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unmount(target string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(target)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readlen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writelen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Madvise(b []byte, advice int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mprotect(b []byte, prot int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Msync(b []byte, flags int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func faccessat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup2(oldfd int, newfd int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
_p0 = unsafe.Pointer(&events[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstatfs(fd int, buf *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) {
r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0)
egid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (euid int) {
r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0)
euid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) {
r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0)
gid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) {
r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0)
uid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func inotifyInit() (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Iopl(level int) (err error) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listen(s int, n int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seek(fd int, offset int64, whence int) (off int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
off = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Shutdown(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Statfs(path string, buf *Statfs_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func SyncFileRange(fd int, off int64, n int64, flags int) (err error) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Truncate(path string, length int64) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
xaddr = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Utime(path string, buf *Utimbuf) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimes(path string, times *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(cmdline)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
|
{
"pile_set_name": "Github"
}
|
/*
定义一个数组,输出数组名及元素。然后给数组中的元素赋值,再次输出数组名及元素。
*/
class ArrayDemo2 {
public static void main(String[] args) {
//定义数组
int[] arr = new int[3];
//输出数组名称及元素
System.out.println(arr);
System.out.println(arr[0]);
System.out.println(arr[1]);
System.out.println(arr[2]);
//给数组中的元素赋值
arr[0] = 10;
arr[1] = 20;
arr[2] = 30;
//再次输出数组名称及元素
System.out.println(arr);
System.out.println(arr[0]);
System.out.println(arr[1]);
System.out.println(arr[2]);
}
}
|
{
"pile_set_name": "Github"
}
|
Tests that Runtime.evaluate has the correct error line number for 'new Function(...)'
{
id : <messageId>
result : {
exceptionDetails : {
columnNumber : 3
exception : {
className : TypeError
description : TypeError: 0 is not a function at eval (eval at <anonymous> (:1:1), <anonymous>:1:4) at <anonymous>:1:22
objectId : <objectId>
subtype : error
type : object
}
exceptionId : <exceptionId>
lineNumber : 0
scriptId : <scriptId>
text : Uncaught
}
result : {
className : TypeError
description : TypeError: 0 is not a function at eval (eval at <anonymous> (:1:1), <anonymous>:1:4) at <anonymous>:1:22
objectId : <objectId>
subtype : error
type : object
}
}
}
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 6d4955fc55080df4d88a3d7bb57d2434
timeCreated: 1495288242
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
/**************************************************************************/
/* */
/* This file is part of Frama-C. */
/* */
/* Copyright (C) 2007-2015 */
/* CEA (Commissariat à l'énergie atomique et aux énergies */
/* alternatives) */
/* */
/* 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, version 2.1. */
/* */
/* It 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. */
/* */
/* See the GNU Lesser General Public License version 2.1 */
/* for more details (enclosed in the file licenses/LGPLv2.1). */
/* */
/**************************************************************************/
#ifndef __FC_UNISTD
#define __FC_UNISTD
#include "__fc_string_axiomatic.h"
#include "__fc_define_size_t.h"
#include "__fc_define_null.h"
#include "__fc_define_ssize_t.h"
#include "__fc_define_uid_and_gid.h"
#include "__fc_define_off_t.h"
#include "__fc_define_pid_t.h"
#include "__fc_define_useconds_t.h"
#include "__fc_define_intptr_t.h"
#include "__fc_select.h"
#include "__fc_define_getopt.h"
#include "features.h"
/* Values for the second argument to access.
These may be OR'd together. */
#define R_OK 4 /* Test for read permission. */
#define W_OK 2 /* Test for write permission. */
#define X_OK 1 /* Test for execute permission. */
#define F_OK 0 /* Test for existence. */
/* Standard file descriptors. */
#define STDIN_FILENO 0 /* Standard input. */
#define STDOUT_FILENO 1 /* Standard output. */
#define STDERR_FILENO 2 /* Standard error output. */
#include "__fc_define_seek_macros.h"
__BEGIN_DECLS
/* Values for the NAME argument to `pathconf' and `fpathconf'. */
enum
{
_PC_LINK_MAX,
#define _PC_LINK_MAX _PC_LINK_MAX
_PC_MAX_CANON,
#define _PC_MAX_CANON _PC_MAX_CANON
_PC_MAX_INPUT,
#define _PC_MAX_INPUT _PC_MAX_INPUT
_PC_NAME_MAX,
#define _PC_NAME_MAX _PC_NAME_MAX
_PC_PATH_MAX,
#define _PC_PATH_MAX _PC_PATH_MAX
_PC_PIPE_BUF,
#define _PC_PIPE_BUF _PC_PIPE_BUF
_PC_CHOWN_RESTRICTED,
#define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
_PC_NO_TRUNC,
#define _PC_NO_TRUNC _PC_NO_TRUNC
_PC_VDISABLE,
#define _PC_VDISABLE _PC_VDISABLE
_PC_SYNC_IO,
#define _PC_SYNC_IO _PC_SYNC_IO
_PC_ASYNC_IO,
#define _PC_ASYNC_IO _PC_ASYNC_IO
_PC_PRIO_IO,
#define _PC_PRIO_IO _PC_PRIO_IO
_PC_SOCK_MAXBUF,
#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
_PC_FILESIZEBITS,
#define _PC_FILESIZEBITS _PC_FILESIZEBITS
_PC_REC_INCR_XFER_SIZE,
#define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE
_PC_REC_MAX_XFER_SIZE,
#define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE
_PC_REC_MIN_XFER_SIZE,
#define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE
_PC_REC_XFER_ALIGN,
#define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN
_PC_ALLOC_SIZE_MIN,
#define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN
_PC_SYMLINK_MAX,
#define _PC_SYMLINK_MAX _PC_SYMLINK_MAX
_PC_2_SYMLINKS
#define _PC_2_SYMLINKS _PC_2_SYMLINKS
};
/* Values for the argument to `sysconf'. */
enum
{
_SC_ARG_MAX,
#define _SC_ARG_MAX _SC_ARG_MAX
_SC_CHILD_MAX,
#define _SC_CHILD_MAX _SC_CHILD_MAX
_SC_CLK_TCK,
#define _SC_CLK_TCK _SC_CLK_TCK
_SC_NGROUPS_MAX,
#define _SC_NGROUPS_MAX _SC_NGROUPS_MAX
_SC_OPEN_MAX,
#define _SC_OPEN_MAX _SC_OPEN_MAX
_SC_STREAM_MAX,
#define _SC_STREAM_MAX _SC_STREAM_MAX
_SC_TZNAME_MAX,
#define _SC_TZNAME_MAX _SC_TZNAME_MAX
_SC_JOB_CONTROL,
#define _SC_JOB_CONTROL _SC_JOB_CONTROL
_SC_SAVED_IDS,
#define _SC_SAVED_IDS _SC_SAVED_IDS
_SC_REALTIME_SIGNALS,
#define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS
_SC_PRIORITY_SCHEDULING,
#define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING
_SC_TIMERS,
#define _SC_TIMERS _SC_TIMERS
_SC_ASYNCHRONOUS_IO,
#define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO
_SC_PRIORITIZED_IO,
#define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO
_SC_SYNCHRONIZED_IO,
#define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO
_SC_FSYNC,
#define _SC_FSYNC _SC_FSYNC
_SC_MAPPED_FILES,
#define _SC_MAPPED_FILES _SC_MAPPED_FILES
_SC_MEMLOCK,
#define _SC_MEMLOCK _SC_MEMLOCK
_SC_MEMLOCK_RANGE,
#define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE
_SC_MEMORY_PROTECTION,
#define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION
_SC_MESSAGE_PASSING,
#define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING
_SC_SEMAPHORES,
#define _SC_SEMAPHORES _SC_SEMAPHORES
_SC_SHARED_MEMORY_OBJECTS,
#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
_SC_AIO_LISTIO_MAX,
#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
_SC_AIO_MAX,
#define _SC_AIO_MAX _SC_AIO_MAX
_SC_AIO_PRIO_DELTA_MAX,
#define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX
_SC_DELAYTIMER_MAX,
#define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX
_SC_MQ_OPEN_MAX,
#define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX
_SC_MQ_PRIO_MAX,
#define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX
_SC_VERSION,
#define _SC_VERSION _SC_VERSION
_SC_PAGESIZE,
#define _SC_PAGESIZE _SC_PAGESIZE
#define _SC_PAGE_SIZE _SC_PAGESIZE
_SC_RTSIG_MAX,
#define _SC_RTSIG_MAX _SC_RTSIG_MAX
_SC_SEM_NSEMS_MAX,
#define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX
_SC_SEM_VALUE_MAX,
#define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX
_SC_SIGQUEUE_MAX,
#define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX
_SC_TIMER_MAX,
#define _SC_TIMER_MAX _SC_TIMER_MAX
/* Values for the argument to `sysconf'
corresponding to _POSIX2_* symbols. */
_SC_BC_BASE_MAX,
#define _SC_BC_BASE_MAX _SC_BC_BASE_MAX
_SC_BC_DIM_MAX,
#define _SC_BC_DIM_MAX _SC_BC_DIM_MAX
_SC_BC_SCALE_MAX,
#define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX
_SC_BC_STRING_MAX,
#define _SC_BC_STRING_MAX _SC_BC_STRING_MAX
_SC_COLL_WEIGHTS_MAX,
#define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
_SC_EQUIV_CLASS_MAX,
#define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX
_SC_EXPR_NEST_MAX,
#define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
_SC_LINE_MAX,
#define _SC_LINE_MAX _SC_LINE_MAX
_SC_RE_DUP_MAX,
#define _SC_RE_DUP_MAX _SC_RE_DUP_MAX
_SC_CHARCLASS_NAME_MAX,
#define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX
_SC_2_VERSION,
#define _SC_2_VERSION _SC_2_VERSION
_SC_2_C_BIND,
#define _SC_2_C_BIND _SC_2_C_BIND
_SC_2_C_DEV,
#define _SC_2_C_DEV _SC_2_C_DEV
_SC_2_FORT_DEV,
#define _SC_2_FORT_DEV _SC_2_FORT_DEV
_SC_2_FORT_RUN,
#define _SC_2_FORT_RUN _SC_2_FORT_RUN
_SC_2_SW_DEV,
#define _SC_2_SW_DEV _SC_2_SW_DEV
_SC_2_LOCALEDEF,
#define _SC_2_LOCALEDEF _SC_2_LOCALEDEF
_SC_PII,
#define _SC_PII _SC_PII
_SC_PII_XTI,
#define _SC_PII_XTI _SC_PII_XTI
_SC_PII_SOCKET,
#define _SC_PII_SOCKET _SC_PII_SOCKET
_SC_PII_INTERNET,
#define _SC_PII_INTERNET _SC_PII_INTERNET
_SC_PII_OSI,
#define _SC_PII_OSI _SC_PII_OSI
_SC_POLL,
#define _SC_POLL _SC_POLL
_SC_SELECT,
#define _SC_SELECT _SC_SELECT
_SC_UIO_MAXIOV,
#define _SC_UIO_MAXIOV _SC_UIO_MAXIOV
_SC_IOV_MAX = _SC_UIO_MAXIOV,
#define _SC_IOV_MAX _SC_IOV_MAX
_SC_PII_INTERNET_STREAM,
#define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM
_SC_PII_INTERNET_DGRAM,
#define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM
_SC_PII_OSI_COTS,
#define _SC_PII_OSI_COTS _SC_PII_OSI_COTS
_SC_PII_OSI_CLTS,
#define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS
_SC_PII_OSI_M,
#define _SC_PII_OSI_M _SC_PII_OSI_M
_SC_T_IOV_MAX,
#define _SC_T_IOV_MAX _SC_T_IOV_MAX
/* Values according to POSIX 1003.1c (POSIX threads). */
_SC_THREADS,
#define _SC_THREADS _SC_THREADS
_SC_THREAD_SAFE_FUNCTIONS,
#define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS
_SC_GETGR_R_SIZE_MAX,
#define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX
_SC_GETPW_R_SIZE_MAX,
#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
_SC_LOGIN_NAME_MAX,
#define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX
_SC_TTY_NAME_MAX,
#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
_SC_THREAD_DESTRUCTOR_ITERATIONS,
#define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
_SC_THREAD_KEYS_MAX,
#define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX
_SC_THREAD_STACK_MIN,
#define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN
_SC_THREAD_THREADS_MAX,
#define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX
_SC_THREAD_ATTR_STACKADDR,
#define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR
_SC_THREAD_ATTR_STACKSIZE,
#define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE
_SC_THREAD_PRIORITY_SCHEDULING,
#define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
_SC_THREAD_PRIO_INHERIT,
#define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT
_SC_THREAD_PRIO_PROTECT,
#define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT
_SC_THREAD_PROCESS_SHARED,
#define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED
_SC_NPROCESSORS_CONF,
#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
_SC_NPROCESSORS_ONLN,
#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
_SC_PHYS_PAGES,
#define _SC_PHYS_PAGES _SC_PHYS_PAGES
_SC_AVPHYS_PAGES,
#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
_SC_ATEXIT_MAX,
#define _SC_ATEXIT_MAX _SC_ATEXIT_MAX
_SC_PASS_MAX,
#define _SC_PASS_MAX _SC_PASS_MAX
_SC_XOPEN_VERSION,
#define _SC_XOPEN_VERSION _SC_XOPEN_VERSION
_SC_XOPEN_XCU_VERSION,
#define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION
_SC_XOPEN_UNIX,
#define _SC_XOPEN_UNIX _SC_XOPEN_UNIX
_SC_XOPEN_CRYPT,
#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
_SC_XOPEN_ENH_I18N,
#define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N
_SC_XOPEN_SHM,
#define _SC_XOPEN_SHM _SC_XOPEN_SHM
_SC_2_CHAR_TERM,
#define _SC_2_CHAR_TERM _SC_2_CHAR_TERM
_SC_2_C_VERSION,
#define _SC_2_C_VERSION _SC_2_C_VERSION
_SC_2_UPE,
#define _SC_2_UPE _SC_2_UPE
_SC_XOPEN_XPG2,
#define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2
_SC_XOPEN_XPG3,
#define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3
_SC_XOPEN_XPG4,
#define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4
_SC_CHAR_BIT,
#define _SC_CHAR_BIT _SC_CHAR_BIT
_SC_CHAR_MAX,
#define _SC_CHAR_MAX _SC_CHAR_MAX
_SC_CHAR_MIN,
#define _SC_CHAR_MIN _SC_CHAR_MIN
_SC_INT_MAX,
#define _SC_INT_MAX _SC_INT_MAX
_SC_INT_MIN,
#define _SC_INT_MIN _SC_INT_MIN
_SC_LONG_BIT,
#define _SC_LONG_BIT _SC_LONG_BIT
_SC_WORD_BIT,
#define _SC_WORD_BIT _SC_WORD_BIT
_SC_MB_LEN_MAX,
#define _SC_MB_LEN_MAX _SC_MB_LEN_MAX
_SC_NZERO,
#define _SC_NZERO _SC_NZERO
_SC_SSIZE_MAX,
#define _SC_SSIZE_MAX _SC_SSIZE_MAX
_SC_SCHAR_MAX,
#define _SC_SCHAR_MAX _SC_SCHAR_MAX
_SC_SCHAR_MIN,
#define _SC_SCHAR_MIN _SC_SCHAR_MIN
_SC_SHRT_MAX,
#define _SC_SHRT_MAX _SC_SHRT_MAX
_SC_SHRT_MIN,
#define _SC_SHRT_MIN _SC_SHRT_MIN
_SC_UCHAR_MAX,
#define _SC_UCHAR_MAX _SC_UCHAR_MAX
_SC_UINT_MAX,
#define _SC_UINT_MAX _SC_UINT_MAX
_SC_ULONG_MAX,
#define _SC_ULONG_MAX _SC_ULONG_MAX
_SC_USHRT_MAX,
#define _SC_USHRT_MAX _SC_USHRT_MAX
_SC_NL_ARGMAX,
#define _SC_NL_ARGMAX _SC_NL_ARGMAX
_SC_NL_LANGMAX,
#define _SC_NL_LANGMAX _SC_NL_LANGMAX
_SC_NL_MSGMAX,
#define _SC_NL_MSGMAX _SC_NL_MSGMAX
_SC_NL_NMAX,
#define _SC_NL_NMAX _SC_NL_NMAX
_SC_NL_SETMAX,
#define _SC_NL_SETMAX _SC_NL_SETMAX
_SC_NL_TEXTMAX,
#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
_SC_XBS5_ILP32_OFF32,
#define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32
_SC_XBS5_ILP32_OFFBIG,
#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
_SC_XBS5_LP64_OFF64,
#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
_SC_XBS5_LPBIG_OFFBIG,
#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
_SC_XOPEN_LEGACY,
#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
_SC_XOPEN_REALTIME,
#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
_SC_XOPEN_REALTIME_THREADS,
#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
_SC_ADVISORY_INFO,
#define _SC_ADVISORY_INFO _SC_ADVISORY_INFO
_SC_BARRIERS,
#define _SC_BARRIERS _SC_BARRIERS
_SC_BASE,
#define _SC_BASE _SC_BASE
_SC_C_LANG_SUPPORT,
#define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT
_SC_C_LANG_SUPPORT_R,
#define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R
_SC_CLOCK_SELECTION,
#define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION
_SC_CPUTIME,
#define _SC_CPUTIME _SC_CPUTIME
_SC_THREAD_CPUTIME,
#define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME
_SC_DEVICE_IO,
#define _SC_DEVICE_IO _SC_DEVICE_IO
_SC_DEVICE_SPECIFIC,
#define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC
_SC_DEVICE_SPECIFIC_R,
#define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R
_SC_FD_MGMT,
#define _SC_FD_MGMT _SC_FD_MGMT
_SC_FIFO,
#define _SC_FIFO _SC_FIFO
_SC_PIPE,
#define _SC_PIPE _SC_PIPE
_SC_FILE_ATTRIBUTES,
#define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES
_SC_FILE_LOCKING,
#define _SC_FILE_LOCKING _SC_FILE_LOCKING
_SC_FILE_SYSTEM,
#define _SC_FILE_SYSTEM _SC_FILE_SYSTEM
_SC_MONOTONIC_CLOCK,
#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
_SC_MULTI_PROCESS,
#define _SC_MULTI_PROCESS _SC_MULTI_PROCESS
_SC_SINGLE_PROCESS,
#define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS
_SC_NETWORKING,
#define _SC_NETWORKING _SC_NETWORKING
_SC_READER_WRITER_LOCKS,
#define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS
_SC_SPIN_LOCKS,
#define _SC_SPIN_LOCKS _SC_SPIN_LOCKS
_SC_REGEXP,
#define _SC_REGEXP _SC_REGEXP
_SC_REGEX_VERSION,
#define _SC_REGEX_VERSION _SC_REGEX_VERSION
_SC_SHELL,
#define _SC_SHELL _SC_SHELL
_SC_SIGNALS,
#define _SC_SIGNALS _SC_SIGNALS
_SC_SPAWN,
#define _SC_SPAWN _SC_SPAWN
_SC_SPORADIC_SERVER,
#define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER
_SC_THREAD_SPORADIC_SERVER,
#define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER
_SC_SYSTEM_DATABASE,
#define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE
_SC_SYSTEM_DATABASE_R,
#define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R
_SC_TIMEOUTS,
#define _SC_TIMEOUTS _SC_TIMEOUTS
_SC_TYPED_MEMORY_OBJECTS,
#define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS
_SC_USER_GROUPS,
#define _SC_USER_GROUPS _SC_USER_GROUPS
_SC_USER_GROUPS_R,
#define _SC_USER_GROUPS_R _SC_USER_GROUPS_R
_SC_2_PBS,
#define _SC_2_PBS _SC_2_PBS
_SC_2_PBS_ACCOUNTING,
#define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING
_SC_2_PBS_LOCATE,
#define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE
_SC_2_PBS_MESSAGE,
#define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE
_SC_2_PBS_TRACK,
#define _SC_2_PBS_TRACK _SC_2_PBS_TRACK
_SC_SYMLOOP_MAX,
#define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX
_SC_STREAMS,
#define _SC_STREAMS _SC_STREAMS
_SC_2_PBS_CHECKPOINT,
#define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT
_SC_V6_ILP32_OFF32,
#define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32
_SC_V6_ILP32_OFFBIG,
#define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
_SC_V6_LP64_OFF64,
#define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64
_SC_V6_LPBIG_OFFBIG,
#define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
_SC_HOST_NAME_MAX,
#define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX
_SC_TRACE,
#define _SC_TRACE _SC_TRACE
_SC_TRACE_EVENT_FILTER,
#define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER
_SC_TRACE_INHERIT,
#define _SC_TRACE_INHERIT _SC_TRACE_INHERIT
_SC_TRACE_LOG,
#define _SC_TRACE_LOG _SC_TRACE_LOG
_SC_LEVEL1_ICACHE_SIZE,
#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE
_SC_LEVEL1_ICACHE_ASSOC,
#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC
_SC_LEVEL1_ICACHE_LINESIZE,
#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE
_SC_LEVEL1_DCACHE_SIZE,
#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE
_SC_LEVEL1_DCACHE_ASSOC,
#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC
_SC_LEVEL1_DCACHE_LINESIZE,
#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE
_SC_LEVEL2_CACHE_SIZE,
#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE
_SC_LEVEL2_CACHE_ASSOC,
#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC
_SC_LEVEL2_CACHE_LINESIZE,
#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE
_SC_LEVEL3_CACHE_SIZE,
#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE
_SC_LEVEL3_CACHE_ASSOC,
#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC
_SC_LEVEL3_CACHE_LINESIZE,
#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE
_SC_LEVEL4_CACHE_SIZE,
#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE
_SC_LEVEL4_CACHE_ASSOC,
#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC
_SC_LEVEL4_CACHE_LINESIZE,
#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE
/* Leave room here, maybe we need a few more cache levels some day. */
_SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
#define _SC_IPV6 _SC_IPV6
_SC_RAW_SOCKETS,
#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS
_SC_V7_ILP32_OFF32,
#define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32
_SC_V7_ILP32_OFFBIG,
#define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG
_SC_V7_LP64_OFF64,
#define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64
_SC_V7_LPBIG_OFFBIG,
#define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG
_SC_SS_REPL_MAX,
#define _SC_SS_REPL_MAX _SC_SS_REPL_MAX
_SC_TRACE_EVENT_NAME_MAX,
#define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX
_SC_TRACE_NAME_MAX,
#define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX
_SC_TRACE_SYS_MAX,
#define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX
_SC_TRACE_USER_EVENT_MAX,
#define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX
_SC_XOPEN_STREAMS,
#define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS
_SC_THREAD_ROBUST_PRIO_INHERIT,
#define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT
_SC_THREAD_ROBUST_PRIO_PROTECT
#define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT
};
/* Values for the NAME argument to `confstr'. */
enum
{
_CS_PATH, /* The default search path. */
#define _CS_PATH _CS_PATH
_CS_V6_WIDTH_RESTRICTED_ENVS,
#define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
_CS_GNU_LIBC_VERSION,
#define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION
_CS_GNU_LIBPTHREAD_VERSION,
#define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION
_CS_V5_WIDTH_RESTRICTED_ENVS,
#define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS
#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS
_CS_V7_WIDTH_RESTRICTED_ENVS,
#define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS
#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS
_CS_LFS_CFLAGS = 1000,
#define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
_CS_LFS_LDFLAGS,
#define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
_CS_LFS_LIBS,
#define _CS_LFS_LIBS _CS_LFS_LIBS
_CS_LFS_LINTFLAGS,
#define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
_CS_LFS64_CFLAGS,
#define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
_CS_LFS64_LDFLAGS,
#define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
_CS_LFS64_LIBS,
#define _CS_LFS64_LIBS _CS_LFS64_LIBS
_CS_LFS64_LINTFLAGS,
#define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
_CS_XBS5_ILP32_OFF32_LDFLAGS,
#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
_CS_XBS5_ILP32_OFF32_LIBS,
#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
_CS_XBS5_ILP32_OFFBIG_LIBS,
#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
_CS_XBS5_LP64_OFF64_CFLAGS,
#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
_CS_XBS5_LP64_OFF64_LDFLAGS,
#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
_CS_XBS5_LP64_OFF64_LIBS,
#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
_CS_XBS5_LP64_OFF64_LINTFLAGS,
#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
_CS_XBS5_LPBIG_OFFBIG_LIBS,
#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
_CS_POSIX_V6_ILP32_OFF32_CFLAGS,
#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
_CS_POSIX_V6_ILP32_OFF32_LIBS,
#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LIBS,
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
_CS_POSIX_V6_LP64_OFF64_CFLAGS,
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
_CS_POSIX_V6_LP64_OFF64_LDFLAGS,
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
_CS_POSIX_V6_LP64_OFF64_LIBS,
#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
_CS_POSIX_V7_ILP32_OFF32_CFLAGS,
#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
_CS_POSIX_V7_ILP32_OFF32_LIBS,
#define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_LIBS,
#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
_CS_POSIX_V7_LP64_OFF64_CFLAGS,
#define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS
_CS_POSIX_V7_LP64_OFF64_LDFLAGS,
#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS
_CS_POSIX_V7_LP64_OFF64_LIBS,
#define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
_CS_V6_ENV,
#define _CS_V6_ENV _CS_V6_ENV
_CS_V7_ENV
#define _CS_V7_ENV _CS_V7_ENV
};
// arbitrary number
#define __FC_MAX_OPEN_FILES 1024
// __fc_fds represents the state of open file descriptors.
//@ ghost int __fc_fds[__FC_MAX_OPEN_FILES];
// TODO: Model the state of some functions more precisely.
// TODO: define __fc_fds as volatile.
int access(const char *, int);
unsigned int alarm(unsigned int);
int brk(void *);
int chdir(const char *path);
int chroot(const char *path);
int chown(const char *, uid_t, gid_t);
/*@
requires 0 <= fd < __FC_MAX_OPEN_FILES;
assigns \result, __fc_fds[fd] \from fd, __fc_fds[fd];
ensures \result == 0 || \result == -1;
*/
int close(int fd);
size_t confstr(int, char *, size_t);
char *crypt(const char *, const char *);
char *ctermid(char *);
char *cuserid(char *s);
int dup(int);
int dup2(int, int);
void encrypt(char[64], int);
/*@ requires arg != \null;
requires valid_read_string(path);
requires valid_read_string(arg);
assigns \result \from path[0..], arg[0..];
*/
int execl(const char *path, const char *arg, ...);
/*@ requires arg != \null;
requires valid_read_string(path);
requires valid_read_string(arg);
assigns \result \from path[0..], arg[0..];
*/
int execle(const char *path, const char *arg, ...);
/*@ requires arg != \null;
requires valid_read_string(path);
requires valid_read_string(arg);
assigns \result \from path[0..], arg[0..];
*/
int execlp(const char *path, const char *arg, ...);
/*@ requires argv[0] != \null;
requires valid_read_string(path);
requires valid_read_string(argv[0]);
assigns \result \from path[0..], argv[0..];
*/
int execv(const char *path, char *const argv[]);
/*@ requires argv[0] != \null;
requires valid_read_string(path);
requires valid_read_string(argv[0]);
assigns \result \from path[0..], argv[0..];
*/
int execve(const char *path, char *const argv[], char *const env[]);
/*@ requires argv[0] != \null;
requires valid_read_string(path);
requires valid_read_string(argv[0]);
assigns \result \from path[0..], argv[0..];
*/
int execvp(const char *path, char *const argv[]);
void _exit(int) __attribute__ ((__noreturn__));
int fchown(int, uid_t, gid_t);
int fchdir(int);
int fdatasync(int);
pid_t fork(void);
long int fpathconf(int, int);
int fsync(int);
int ftruncate(int, off_t);
char *getcwd(char *, size_t);
int getdtablesize(void);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t []);
long gethostid(void);
int gethostname(char *, size_t);
char *getlogin(void);
int getlogin_r(char *, size_t);
int getpagesize(void);
char *getpass(const char *);
pid_t getpgid(pid_t);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
pid_t getsid(pid_t);
/*@ assigns \result \from \nothing; */
uid_t getuid(void);
char *getwd(char *);
int isatty(int);
int lchown(const char *, uid_t, gid_t);
int link(const char *, const char *);
int lockf(int, int, off_t);
off_t lseek(int, off_t, int);
int nice(int);
long int pathconf(const char *, int);
int pause(void);
int pipe(int [2]);
ssize_t pread(int, void *, size_t, off_t);
int pthread_atfork(void (*)(void), void (*)(void),
void(*)(void));
ssize_t pwrite(int, const void *, size_t, off_t);
/*@
requires 0 <= fd < __FC_MAX_OPEN_FILES;
requires \valid((char *)buf+(0..count-1));
assigns \result, *((char *)buf+(0..count-1)), __fc_fds[fd]
\from __fc_fds[fd], count;
ensures 0 <= \result <= count || \result == -1;
ensures \initialized(((char*)buf)+(0..\result-1));
*/
ssize_t read(int fd, void *buf, size_t count);
ssize_t readlink(const char *, char *, size_t);
int rmdir(const char *);
void *sbrk(intptr_t);
int setegid(gid_t gid);
int seteuid(uid_t uid);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setpgrp(void);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
pid_t setsid(void);
int setuid(uid_t uid);
unsigned int sleep(unsigned int);
void swab(const void *, void *, ssize_t);
int symlink(const char *, const char *);
void sync(void);
long int sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
int truncate(const char *, off_t);
char *ttyname(int);
int ttyname_r(int, char *, size_t);
useconds_t ualarm(useconds_t, useconds_t);
int unlink(const char *);
int usleep(useconds_t);
pid_t vfork(void);
/*@
requires 0 <= fd < __FC_MAX_OPEN_FILES;
requires \valid_read(((char *)buf)+(0..count-1));
assigns \result, __fc_fds[fd] \from fd, count, __fc_fds[fd];
ensures -1 <= \result <= count;
*/
ssize_t write(int fd, const void *buf, size_t count);
__END_DECLS
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2003-2020 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_FLAC_AUDIO_FORMAT_HXX
#define MPD_FLAC_AUDIO_FORMAT_HXX
#include "pcm/SampleFormat.hxx"
constexpr SampleFormat
FlacSampleFormat(unsigned bits_per_sample) noexcept
{
switch (bits_per_sample) {
case 8:
return SampleFormat::S8;
case 16:
return SampleFormat::S16;
case 24:
return SampleFormat::S24_P32;
case 32:
return SampleFormat::S32;
default:
return SampleFormat::UNDEFINED;
}
}
#endif
|
{
"pile_set_name": "Github"
}
|
do1 |
do1 |
sol2. |
re4 la8 sol8 fa2 |
mi2 mi2 |
la2 fa4 mi4 |
re2 si,2 |
do2 re4 re,4 |
sol,4 sol4 fa2 |
mi2 mi2 |
fa2 re2 |
sol4 do4 sol,2 |
do2. |
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Telephone" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>default_telephone</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Telephone</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>telephone_area</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>telephone_city</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>telephone_country</string> </key>
<value> <string>33</string> </value>
</item>
<item>
<key> <string>telephone_extension</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>telephone_number</string> </key>
<value> <string>0658522436</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>admin</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global id="3.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1297938699.24</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>erp5testcase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>908.22104.29923.65297</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="3.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1298302606.21</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>erp5testcase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>908.22104.29923.65297</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="3.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1298302606.26</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>erp5testcase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>908.28168.50589.6604</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="3.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1298303111.93</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>erp5testcase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>908.28177.13118.9540</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="3.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1298889309.95</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
|
{
"pile_set_name": "Github"
}
|
<?xml version='1.0' encoding='utf-8'?>
<doc><id>2214</id><url>http://www.chinanews.com/gj/2020/04-04/9147932.shtml</url><title>西班牙新冠确诊病例超12万 政府将申请延长紧急状态</title><datetime>2020-4-4 22:12:00</datetime><body> 新华社马德里4月4日电(谢宇智)西班牙卫生部4日发布的新冠疫情最新统计数据显示,西班牙累计确诊病例数已超过12万例,但单日新增死亡人数有所下降。首相桑切斯当天通过电视讲话宣布,政府将向议会申请将国家紧急状态延长至4月25日24时。
据卫生部的统计,截至当地时间3日晚21时,西班牙新增病例7026例,累计确诊病例124736例;单日新增死亡病例809例;累计死亡11744例,病亡率达到约9.4%;新增治愈3706例,累计治愈34219例。目前仍有6532人在重症监护室接受治疗,比一天前增加116人。
西班牙卫生部应急与预警协调中心副主任玛利亚·何塞·谢拉在当天的新闻发布会上说:“数据证明了我们近日来所观察到的疫情缓和趋势。”她同时指出,截至目前西班牙一直重点确诊具有基础病史的患者、重症患者以及医护人员,但全国肯定“还有许多未诊断出的轻症患者”,“这就是为什么我们有如此高的病亡率”。
谢拉还透露,目前西班牙正计划通过抗体检测来了解对新冠病毒已获免疫力的人口数量,“这将有助于我们为接下来的过渡时期制订相应措施”。
【编辑:卞磊】
</body></doc>
|
{
"pile_set_name": "Github"
}
|
//===- llvm/unittest/ADT/SmallVectorTest.cpp ------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// SmallVector unit tests.
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Compiler.h"
#include "gtest/gtest.h"
#include <list>
#include <stdarg.h>
using namespace llvm;
namespace {
/// A helper class that counts the total number of constructor and
/// destructor calls.
class Constructable {
private:
static int numConstructorCalls;
static int numMoveConstructorCalls;
static int numCopyConstructorCalls;
static int numDestructorCalls;
static int numAssignmentCalls;
static int numMoveAssignmentCalls;
static int numCopyAssignmentCalls;
bool constructed;
int value;
public:
Constructable() : constructed(true), value(0) {
++numConstructorCalls;
}
Constructable(int val) : constructed(true), value(val) {
++numConstructorCalls;
}
Constructable(const Constructable & src) : constructed(true) {
value = src.value;
++numConstructorCalls;
++numCopyConstructorCalls;
}
Constructable(Constructable && src) : constructed(true) {
value = src.value;
++numConstructorCalls;
++numMoveConstructorCalls;
}
~Constructable() {
EXPECT_TRUE(constructed);
++numDestructorCalls;
constructed = false;
}
Constructable & operator=(const Constructable & src) {
EXPECT_TRUE(constructed);
value = src.value;
++numAssignmentCalls;
++numCopyAssignmentCalls;
return *this;
}
Constructable & operator=(Constructable && src) {
EXPECT_TRUE(constructed);
value = src.value;
++numAssignmentCalls;
++numMoveAssignmentCalls;
return *this;
}
int getValue() const {
return abs(value);
}
static void reset() {
numConstructorCalls = 0;
numMoveConstructorCalls = 0;
numCopyConstructorCalls = 0;
numDestructorCalls = 0;
numAssignmentCalls = 0;
numMoveAssignmentCalls = 0;
numCopyAssignmentCalls = 0;
}
static int getNumConstructorCalls() {
return numConstructorCalls;
}
static int getNumMoveConstructorCalls() {
return numMoveConstructorCalls;
}
static int getNumCopyConstructorCalls() {
return numCopyConstructorCalls;
}
static int getNumDestructorCalls() {
return numDestructorCalls;
}
static int getNumAssignmentCalls() {
return numAssignmentCalls;
}
static int getNumMoveAssignmentCalls() {
return numMoveAssignmentCalls;
}
static int getNumCopyAssignmentCalls() {
return numCopyAssignmentCalls;
}
friend bool operator==(const Constructable & c0, const Constructable & c1) {
return c0.getValue() == c1.getValue();
}
friend bool LLVM_ATTRIBUTE_UNUSED
operator!=(const Constructable & c0, const Constructable & c1) {
return c0.getValue() != c1.getValue();
}
};
int Constructable::numConstructorCalls;
int Constructable::numCopyConstructorCalls;
int Constructable::numMoveConstructorCalls;
int Constructable::numDestructorCalls;
int Constructable::numAssignmentCalls;
int Constructable::numCopyAssignmentCalls;
int Constructable::numMoveAssignmentCalls;
struct NonCopyable {
NonCopyable() {}
NonCopyable(NonCopyable &&) {}
NonCopyable &operator=(NonCopyable &&) { return *this; }
private:
NonCopyable(const NonCopyable &) = delete;
NonCopyable &operator=(const NonCopyable &) = delete;
};
LLVM_ATTRIBUTE_USED void CompileTest() {
SmallVector<NonCopyable, 0> V;
V.resize(42);
}
class SmallVectorTestBase : public testing::Test {
protected:
void SetUp() override { Constructable::reset(); }
template <typename VectorT>
void assertEmpty(VectorT & v) {
// Size tests
EXPECT_EQ(0u, v.size());
EXPECT_TRUE(v.empty());
// Iterator tests
EXPECT_TRUE(v.begin() == v.end());
}
// Assert that v contains the specified values, in order.
template <typename VectorT>
void assertValuesInOrder(VectorT & v, size_t size, ...) {
EXPECT_EQ(size, v.size());
va_list ap;
va_start(ap, size);
for (size_t i = 0; i < size; ++i) {
int value = va_arg(ap, int);
EXPECT_EQ(value, v[i].getValue());
}
va_end(ap);
}
// Generate a sequence of values to initialize the vector.
template <typename VectorT>
void makeSequence(VectorT & v, int start, int end) {
for (int i = start; i <= end; ++i) {
v.push_back(Constructable(i));
}
}
};
// Test fixture class
template <typename VectorT>
class SmallVectorTest : public SmallVectorTestBase {
protected:
VectorT theVector;
VectorT otherVector;
};
typedef ::testing::Types<SmallVector<Constructable, 0>,
SmallVector<Constructable, 1>,
SmallVector<Constructable, 2>,
SmallVector<Constructable, 4>,
SmallVector<Constructable, 5>
> SmallVectorTestTypes;
TYPED_TEST_CASE(SmallVectorTest, SmallVectorTestTypes);
// Constructor test.
TYPED_TEST(SmallVectorTest, ConstructorNonIterTest) {
SCOPED_TRACE("ConstructorTest");
this->theVector = SmallVector<Constructable, 2>(2, 2);
this->assertValuesInOrder(this->theVector, 2u, 2, 2);
}
// Constructor test.
TYPED_TEST(SmallVectorTest, ConstructorIterTest) {
SCOPED_TRACE("ConstructorTest");
int arr[] = {1, 2, 3};
this->theVector =
SmallVector<Constructable, 4>(std::begin(arr), std::end(arr));
this->assertValuesInOrder(this->theVector, 3u, 1, 2, 3);
}
// New vector test.
TYPED_TEST(SmallVectorTest, EmptyVectorTest) {
SCOPED_TRACE("EmptyVectorTest");
this->assertEmpty(this->theVector);
EXPECT_TRUE(this->theVector.rbegin() == this->theVector.rend());
EXPECT_EQ(0, Constructable::getNumConstructorCalls());
EXPECT_EQ(0, Constructable::getNumDestructorCalls());
}
// Simple insertions and deletions.
TYPED_TEST(SmallVectorTest, PushPopTest) {
SCOPED_TRACE("PushPopTest");
// Track whether the vector will potentially have to grow.
bool RequiresGrowth = this->theVector.capacity() < 3;
// Push an element
this->theVector.push_back(Constructable(1));
// Size tests
this->assertValuesInOrder(this->theVector, 1u, 1);
EXPECT_FALSE(this->theVector.begin() == this->theVector.end());
EXPECT_FALSE(this->theVector.empty());
// Push another element
this->theVector.push_back(Constructable(2));
this->assertValuesInOrder(this->theVector, 2u, 1, 2);
// Insert at beginning
this->theVector.insert(this->theVector.begin(), this->theVector[1]);
this->assertValuesInOrder(this->theVector, 3u, 2, 1, 2);
// Pop one element
this->theVector.pop_back();
this->assertValuesInOrder(this->theVector, 2u, 2, 1);
// Pop remaining elements
this->theVector.pop_back();
this->theVector.pop_back();
this->assertEmpty(this->theVector);
// Check number of constructor calls. Should be 2 for each list element,
// one for the argument to push_back, one for the argument to insert,
// and one for the list element itself.
if (!RequiresGrowth) {
EXPECT_EQ(5, Constructable::getNumConstructorCalls());
EXPECT_EQ(5, Constructable::getNumDestructorCalls());
} else {
// If we had to grow the vector, these only have a lower bound, but should
// always be equal.
EXPECT_LE(5, Constructable::getNumConstructorCalls());
EXPECT_EQ(Constructable::getNumConstructorCalls(),
Constructable::getNumDestructorCalls());
}
}
// Clear test.
TYPED_TEST(SmallVectorTest, ClearTest) {
SCOPED_TRACE("ClearTest");
this->theVector.reserve(2);
this->makeSequence(this->theVector, 1, 2);
this->theVector.clear();
this->assertEmpty(this->theVector);
EXPECT_EQ(4, Constructable::getNumConstructorCalls());
EXPECT_EQ(4, Constructable::getNumDestructorCalls());
}
// Resize smaller test.
TYPED_TEST(SmallVectorTest, ResizeShrinkTest) {
SCOPED_TRACE("ResizeShrinkTest");
this->theVector.reserve(3);
this->makeSequence(this->theVector, 1, 3);
this->theVector.resize(1);
this->assertValuesInOrder(this->theVector, 1u, 1);
EXPECT_EQ(6, Constructable::getNumConstructorCalls());
EXPECT_EQ(5, Constructable::getNumDestructorCalls());
}
// Resize bigger test.
TYPED_TEST(SmallVectorTest, ResizeGrowTest) {
SCOPED_TRACE("ResizeGrowTest");
this->theVector.resize(2);
EXPECT_EQ(2, Constructable::getNumConstructorCalls());
EXPECT_EQ(0, Constructable::getNumDestructorCalls());
EXPECT_EQ(2u, this->theVector.size());
}
TYPED_TEST(SmallVectorTest, ResizeWithElementsTest) {
this->theVector.resize(2);
Constructable::reset();
this->theVector.resize(4);
size_t Ctors = Constructable::getNumConstructorCalls();
EXPECT_TRUE(Ctors == 2 || Ctors == 4);
size_t MoveCtors = Constructable::getNumMoveConstructorCalls();
EXPECT_TRUE(MoveCtors == 0 || MoveCtors == 2);
size_t Dtors = Constructable::getNumDestructorCalls();
EXPECT_TRUE(Dtors == 0 || Dtors == 2);
}
// Resize with fill value.
TYPED_TEST(SmallVectorTest, ResizeFillTest) {
SCOPED_TRACE("ResizeFillTest");
this->theVector.resize(3, Constructable(77));
this->assertValuesInOrder(this->theVector, 3u, 77, 77, 77);
}
// Overflow past fixed size.
TYPED_TEST(SmallVectorTest, OverflowTest) {
SCOPED_TRACE("OverflowTest");
// Push more elements than the fixed size.
this->makeSequence(this->theVector, 1, 10);
// Test size and values.
EXPECT_EQ(10u, this->theVector.size());
for (int i = 0; i < 10; ++i) {
EXPECT_EQ(i+1, this->theVector[i].getValue());
}
// Now resize back to fixed size.
this->theVector.resize(1);
this->assertValuesInOrder(this->theVector, 1u, 1);
}
// Iteration tests.
TYPED_TEST(SmallVectorTest, IterationTest) {
this->makeSequence(this->theVector, 1, 2);
// Forward Iteration
typename TypeParam::iterator it = this->theVector.begin();
EXPECT_TRUE(*it == this->theVector.front());
EXPECT_TRUE(*it == this->theVector[0]);
EXPECT_EQ(1, it->getValue());
++it;
EXPECT_TRUE(*it == this->theVector[1]);
EXPECT_TRUE(*it == this->theVector.back());
EXPECT_EQ(2, it->getValue());
++it;
EXPECT_TRUE(it == this->theVector.end());
--it;
EXPECT_TRUE(*it == this->theVector[1]);
EXPECT_EQ(2, it->getValue());
--it;
EXPECT_TRUE(*it == this->theVector[0]);
EXPECT_EQ(1, it->getValue());
// Reverse Iteration
typename TypeParam::reverse_iterator rit = this->theVector.rbegin();
EXPECT_TRUE(*rit == this->theVector[1]);
EXPECT_EQ(2, rit->getValue());
++rit;
EXPECT_TRUE(*rit == this->theVector[0]);
EXPECT_EQ(1, rit->getValue());
++rit;
EXPECT_TRUE(rit == this->theVector.rend());
--rit;
EXPECT_TRUE(*rit == this->theVector[0]);
EXPECT_EQ(1, rit->getValue());
--rit;
EXPECT_TRUE(*rit == this->theVector[1]);
EXPECT_EQ(2, rit->getValue());
}
// Swap test.
TYPED_TEST(SmallVectorTest, SwapTest) {
SCOPED_TRACE("SwapTest");
this->makeSequence(this->theVector, 1, 2);
std::swap(this->theVector, this->otherVector);
this->assertEmpty(this->theVector);
this->assertValuesInOrder(this->otherVector, 2u, 1, 2);
}
// Append test
TYPED_TEST(SmallVectorTest, AppendTest) {
SCOPED_TRACE("AppendTest");
this->makeSequence(this->otherVector, 2, 3);
this->theVector.push_back(Constructable(1));
this->theVector.append(this->otherVector.begin(), this->otherVector.end());
this->assertValuesInOrder(this->theVector, 3u, 1, 2, 3);
}
// Append repeated test
TYPED_TEST(SmallVectorTest, AppendRepeatedTest) {
SCOPED_TRACE("AppendRepeatedTest");
this->theVector.push_back(Constructable(1));
this->theVector.append(2, Constructable(77));
this->assertValuesInOrder(this->theVector, 3u, 1, 77, 77);
}
// Append test
TYPED_TEST(SmallVectorTest, AppendNonIterTest) {
SCOPED_TRACE("AppendRepeatedTest");
this->theVector.push_back(Constructable(1));
this->theVector.append(2, 7);
this->assertValuesInOrder(this->theVector, 3u, 1, 7, 7);
}
struct output_iterator {
typedef std::output_iterator_tag iterator_category;
typedef int value_type;
typedef int difference_type;
typedef value_type *pointer;
typedef value_type &reference;
operator int() { return 2; }
operator Constructable() { return 7; }
};
TYPED_TEST(SmallVectorTest, AppendRepeatedNonForwardIterator) {
SCOPED_TRACE("AppendRepeatedTest");
this->theVector.push_back(Constructable(1));
this->theVector.append(output_iterator(), output_iterator());
this->assertValuesInOrder(this->theVector, 3u, 1, 7, 7);
}
// Assign test
TYPED_TEST(SmallVectorTest, AssignTest) {
SCOPED_TRACE("AssignTest");
this->theVector.push_back(Constructable(1));
this->theVector.assign(2, Constructable(77));
this->assertValuesInOrder(this->theVector, 2u, 77, 77);
}
// Assign test
TYPED_TEST(SmallVectorTest, AssignRangeTest) {
SCOPED_TRACE("AssignTest");
this->theVector.push_back(Constructable(1));
int arr[] = {1, 2, 3};
this->theVector.assign(std::begin(arr), std::end(arr));
this->assertValuesInOrder(this->theVector, 3u, 1, 2, 3);
}
// Assign test
TYPED_TEST(SmallVectorTest, AssignNonIterTest) {
SCOPED_TRACE("AssignTest");
this->theVector.push_back(Constructable(1));
this->theVector.assign(2, 7);
this->assertValuesInOrder(this->theVector, 2u, 7, 7);
}
// Move-assign test
TYPED_TEST(SmallVectorTest, MoveAssignTest) {
SCOPED_TRACE("MoveAssignTest");
// Set up our vector with a single element, but enough capacity for 4.
this->theVector.reserve(4);
this->theVector.push_back(Constructable(1));
// Set up the other vector with 2 elements.
this->otherVector.push_back(Constructable(2));
this->otherVector.push_back(Constructable(3));
// Move-assign from the other vector.
this->theVector = std::move(this->otherVector);
// Make sure we have the right result.
this->assertValuesInOrder(this->theVector, 2u, 2, 3);
// Make sure the # of constructor/destructor calls line up. There
// are two live objects after clearing the other vector.
this->otherVector.clear();
EXPECT_EQ(Constructable::getNumConstructorCalls()-2,
Constructable::getNumDestructorCalls());
// There shouldn't be any live objects any more.
this->theVector.clear();
EXPECT_EQ(Constructable::getNumConstructorCalls(),
Constructable::getNumDestructorCalls());
}
// Erase a single element
TYPED_TEST(SmallVectorTest, EraseTest) {
SCOPED_TRACE("EraseTest");
this->makeSequence(this->theVector, 1, 3);
const auto &theConstVector = this->theVector;
this->theVector.erase(theConstVector.begin());
this->assertValuesInOrder(this->theVector, 2u, 2, 3);
}
// Erase a range of elements
TYPED_TEST(SmallVectorTest, EraseRangeTest) {
SCOPED_TRACE("EraseRangeTest");
this->makeSequence(this->theVector, 1, 3);
const auto &theConstVector = this->theVector;
this->theVector.erase(theConstVector.begin(), theConstVector.begin() + 2);
this->assertValuesInOrder(this->theVector, 1u, 3);
}
// Insert a single element.
TYPED_TEST(SmallVectorTest, InsertTest) {
SCOPED_TRACE("InsertTest");
this->makeSequence(this->theVector, 1, 3);
typename TypeParam::iterator I =
this->theVector.insert(this->theVector.begin() + 1, Constructable(77));
EXPECT_EQ(this->theVector.begin() + 1, I);
this->assertValuesInOrder(this->theVector, 4u, 1, 77, 2, 3);
}
// Insert a copy of a single element.
TYPED_TEST(SmallVectorTest, InsertCopy) {
SCOPED_TRACE("InsertTest");
this->makeSequence(this->theVector, 1, 3);
Constructable C(77);
typename TypeParam::iterator I =
this->theVector.insert(this->theVector.begin() + 1, C);
EXPECT_EQ(this->theVector.begin() + 1, I);
this->assertValuesInOrder(this->theVector, 4u, 1, 77, 2, 3);
}
// Insert repeated elements.
TYPED_TEST(SmallVectorTest, InsertRepeatedTest) {
SCOPED_TRACE("InsertRepeatedTest");
this->makeSequence(this->theVector, 1, 4);
Constructable::reset();
auto I =
this->theVector.insert(this->theVector.begin() + 1, 2, Constructable(16));
// Move construct the top element into newly allocated space, and optionally
// reallocate the whole buffer, move constructing into it.
// FIXME: This is inefficient, we shouldn't move things into newly allocated
// space, then move them up/around, there should only be 2 or 4 move
// constructions here.
EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 2 ||
Constructable::getNumMoveConstructorCalls() == 6);
// Move assign the next two to shift them up and make a gap.
EXPECT_EQ(1, Constructable::getNumMoveAssignmentCalls());
// Copy construct the two new elements from the parameter.
EXPECT_EQ(2, Constructable::getNumCopyAssignmentCalls());
// All without any copy construction.
EXPECT_EQ(0, Constructable::getNumCopyConstructorCalls());
EXPECT_EQ(this->theVector.begin() + 1, I);
this->assertValuesInOrder(this->theVector, 6u, 1, 16, 16, 2, 3, 4);
}
TYPED_TEST(SmallVectorTest, InsertRepeatedNonIterTest) {
SCOPED_TRACE("InsertRepeatedTest");
this->makeSequence(this->theVector, 1, 4);
Constructable::reset();
auto I = this->theVector.insert(this->theVector.begin() + 1, 2, 7);
EXPECT_EQ(this->theVector.begin() + 1, I);
this->assertValuesInOrder(this->theVector, 6u, 1, 7, 7, 2, 3, 4);
}
TYPED_TEST(SmallVectorTest, InsertRepeatedAtEndTest) {
SCOPED_TRACE("InsertRepeatedTest");
this->makeSequence(this->theVector, 1, 4);
Constructable::reset();
auto I = this->theVector.insert(this->theVector.end(), 2, Constructable(16));
// Just copy construct them into newly allocated space
EXPECT_EQ(2, Constructable::getNumCopyConstructorCalls());
// Move everything across if reallocation is needed.
EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 0 ||
Constructable::getNumMoveConstructorCalls() == 4);
// Without ever moving or copying anything else.
EXPECT_EQ(0, Constructable::getNumCopyAssignmentCalls());
EXPECT_EQ(0, Constructable::getNumMoveAssignmentCalls());
EXPECT_EQ(this->theVector.begin() + 4, I);
this->assertValuesInOrder(this->theVector, 6u, 1, 2, 3, 4, 16, 16);
}
TYPED_TEST(SmallVectorTest, InsertRepeatedEmptyTest) {
SCOPED_TRACE("InsertRepeatedTest");
this->makeSequence(this->theVector, 10, 15);
// Empty insert.
EXPECT_EQ(this->theVector.end(),
this->theVector.insert(this->theVector.end(),
0, Constructable(42)));
EXPECT_EQ(this->theVector.begin() + 1,
this->theVector.insert(this->theVector.begin() + 1,
0, Constructable(42)));
}
// Insert range.
TYPED_TEST(SmallVectorTest, InsertRangeTest) {
SCOPED_TRACE("InsertRangeTest");
Constructable Arr[3] =
{ Constructable(77), Constructable(77), Constructable(77) };
this->makeSequence(this->theVector, 1, 3);
Constructable::reset();
auto I = this->theVector.insert(this->theVector.begin() + 1, Arr, Arr + 3);
// Move construct the top 3 elements into newly allocated space.
// Possibly move the whole sequence into new space first.
// FIXME: This is inefficient, we shouldn't move things into newly allocated
// space, then move them up/around, there should only be 2 or 3 move
// constructions here.
EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 2 ||
Constructable::getNumMoveConstructorCalls() == 5);
// Copy assign the lower 2 new elements into existing space.
EXPECT_EQ(2, Constructable::getNumCopyAssignmentCalls());
// Copy construct the third element into newly allocated space.
EXPECT_EQ(1, Constructable::getNumCopyConstructorCalls());
EXPECT_EQ(this->theVector.begin() + 1, I);
this->assertValuesInOrder(this->theVector, 6u, 1, 77, 77, 77, 2, 3);
}
TYPED_TEST(SmallVectorTest, InsertRangeAtEndTest) {
SCOPED_TRACE("InsertRangeTest");
Constructable Arr[3] =
{ Constructable(77), Constructable(77), Constructable(77) };
this->makeSequence(this->theVector, 1, 3);
// Insert at end.
Constructable::reset();
auto I = this->theVector.insert(this->theVector.end(), Arr, Arr+3);
// Copy construct the 3 elements into new space at the top.
EXPECT_EQ(3, Constructable::getNumCopyConstructorCalls());
// Don't copy/move anything else.
EXPECT_EQ(0, Constructable::getNumCopyAssignmentCalls());
// Reallocation might occur, causing all elements to be moved into the new
// buffer.
EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 0 ||
Constructable::getNumMoveConstructorCalls() == 3);
EXPECT_EQ(0, Constructable::getNumMoveAssignmentCalls());
EXPECT_EQ(this->theVector.begin() + 3, I);
this->assertValuesInOrder(this->theVector, 6u,
1, 2, 3, 77, 77, 77);
}
TYPED_TEST(SmallVectorTest, InsertEmptyRangeTest) {
SCOPED_TRACE("InsertRangeTest");
this->makeSequence(this->theVector, 1, 3);
// Empty insert.
EXPECT_EQ(this->theVector.end(),
this->theVector.insert(this->theVector.end(),
this->theVector.begin(),
this->theVector.begin()));
EXPECT_EQ(this->theVector.begin() + 1,
this->theVector.insert(this->theVector.begin() + 1,
this->theVector.begin(),
this->theVector.begin()));
}
// Comparison tests.
TYPED_TEST(SmallVectorTest, ComparisonTest) {
SCOPED_TRACE("ComparisonTest");
this->makeSequence(this->theVector, 1, 3);
this->makeSequence(this->otherVector, 1, 3);
EXPECT_TRUE(this->theVector == this->otherVector);
EXPECT_FALSE(this->theVector != this->otherVector);
this->otherVector.clear();
this->makeSequence(this->otherVector, 2, 4);
EXPECT_FALSE(this->theVector == this->otherVector);
EXPECT_TRUE(this->theVector != this->otherVector);
}
// Constant vector tests.
TYPED_TEST(SmallVectorTest, ConstVectorTest) {
const TypeParam constVector;
EXPECT_EQ(0u, constVector.size());
EXPECT_TRUE(constVector.empty());
EXPECT_TRUE(constVector.begin() == constVector.end());
}
// Direct array access.
TYPED_TEST(SmallVectorTest, DirectVectorTest) {
EXPECT_EQ(0u, this->theVector.size());
this->theVector.reserve(4);
EXPECT_LE(4u, this->theVector.capacity());
EXPECT_EQ(0, Constructable::getNumConstructorCalls());
this->theVector.push_back(1);
this->theVector.push_back(2);
this->theVector.push_back(3);
this->theVector.push_back(4);
EXPECT_EQ(4u, this->theVector.size());
EXPECT_EQ(8, Constructable::getNumConstructorCalls());
EXPECT_EQ(1, this->theVector[0].getValue());
EXPECT_EQ(2, this->theVector[1].getValue());
EXPECT_EQ(3, this->theVector[2].getValue());
EXPECT_EQ(4, this->theVector[3].getValue());
}
TYPED_TEST(SmallVectorTest, IteratorTest) {
std::list<int> L;
this->theVector.insert(this->theVector.end(), L.begin(), L.end());
}
template <typename InvalidType> class DualSmallVectorsTest;
template <typename VectorT1, typename VectorT2>
class DualSmallVectorsTest<std::pair<VectorT1, VectorT2>> : public SmallVectorTestBase {
protected:
VectorT1 theVector;
VectorT2 otherVector;
template <typename T, unsigned N>
static unsigned NumBuiltinElts(const SmallVector<T, N>&) { return N; }
};
typedef ::testing::Types<
// Small mode -> Small mode.
std::pair<SmallVector<Constructable, 4>, SmallVector<Constructable, 4>>,
// Small mode -> Big mode.
std::pair<SmallVector<Constructable, 4>, SmallVector<Constructable, 2>>,
// Big mode -> Small mode.
std::pair<SmallVector<Constructable, 2>, SmallVector<Constructable, 4>>,
// Big mode -> Big mode.
std::pair<SmallVector<Constructable, 2>, SmallVector<Constructable, 2>>
> DualSmallVectorTestTypes;
TYPED_TEST_CASE(DualSmallVectorsTest, DualSmallVectorTestTypes);
TYPED_TEST(DualSmallVectorsTest, MoveAssignment) {
SCOPED_TRACE("MoveAssignTest-DualVectorTypes");
// Set up our vector with four elements.
for (unsigned I = 0; I < 4; ++I)
this->otherVector.push_back(Constructable(I));
const Constructable *OrigDataPtr = this->otherVector.data();
// Move-assign from the other vector.
this->theVector =
std::move(static_cast<SmallVectorImpl<Constructable>&>(this->otherVector));
// Make sure we have the right result.
this->assertValuesInOrder(this->theVector, 4u, 0, 1, 2, 3);
// Make sure the # of constructor/destructor calls line up. There
// are two live objects after clearing the other vector.
this->otherVector.clear();
EXPECT_EQ(Constructable::getNumConstructorCalls()-4,
Constructable::getNumDestructorCalls());
// If the source vector (otherVector) was in small-mode, assert that we just
// moved the data pointer over.
EXPECT_TRUE(this->NumBuiltinElts(this->otherVector) == 4 ||
this->theVector.data() == OrigDataPtr);
// There shouldn't be any live objects any more.
this->theVector.clear();
EXPECT_EQ(Constructable::getNumConstructorCalls(),
Constructable::getNumDestructorCalls());
// We shouldn't have copied anything in this whole process.
EXPECT_EQ(Constructable::getNumCopyConstructorCalls(), 0);
}
struct notassignable {
int &x;
notassignable(int &x) : x(x) {}
};
TEST(SmallVectorCustomTest, NoAssignTest) {
int x = 0;
SmallVector<notassignable, 2> vec;
vec.push_back(notassignable(x));
x = 42;
EXPECT_EQ(42, vec.pop_back_val().x);
}
struct MovedFrom {
bool hasValue;
MovedFrom() : hasValue(true) {
}
MovedFrom(MovedFrom&& m) : hasValue(m.hasValue) {
m.hasValue = false;
}
MovedFrom &operator=(MovedFrom&& m) {
hasValue = m.hasValue;
m.hasValue = false;
return *this;
}
};
TEST(SmallVectorTest, MidInsert) {
SmallVector<MovedFrom, 3> v;
v.push_back(MovedFrom());
v.insert(v.begin(), MovedFrom());
for (MovedFrom &m : v)
EXPECT_TRUE(m.hasValue);
}
enum EmplaceableArgState {
EAS_Defaulted,
EAS_Arg,
EAS_LValue,
EAS_RValue,
EAS_Failure
};
template <int I> struct EmplaceableArg {
EmplaceableArgState State;
EmplaceableArg() : State(EAS_Defaulted) {}
EmplaceableArg(EmplaceableArg &&X)
: State(X.State == EAS_Arg ? EAS_RValue : EAS_Failure) {}
EmplaceableArg(EmplaceableArg &X)
: State(X.State == EAS_Arg ? EAS_LValue : EAS_Failure) {}
explicit EmplaceableArg(bool) : State(EAS_Arg) {}
private:
EmplaceableArg &operator=(EmplaceableArg &&) = delete;
EmplaceableArg &operator=(const EmplaceableArg &) = delete;
};
enum EmplaceableState { ES_Emplaced, ES_Moved };
struct Emplaceable {
EmplaceableArg<0> A0;
EmplaceableArg<1> A1;
EmplaceableArg<2> A2;
EmplaceableArg<3> A3;
EmplaceableState State;
Emplaceable() : State(ES_Emplaced) {}
template <class A0Ty>
explicit Emplaceable(A0Ty &&A0)
: A0(std::forward<A0Ty>(A0)), State(ES_Emplaced) {}
template <class A0Ty, class A1Ty>
Emplaceable(A0Ty &&A0, A1Ty &&A1)
: A0(std::forward<A0Ty>(A0)), A1(std::forward<A1Ty>(A1)),
State(ES_Emplaced) {}
template <class A0Ty, class A1Ty, class A2Ty>
Emplaceable(A0Ty &&A0, A1Ty &&A1, A2Ty &&A2)
: A0(std::forward<A0Ty>(A0)), A1(std::forward<A1Ty>(A1)),
A2(std::forward<A2Ty>(A2)), State(ES_Emplaced) {}
template <class A0Ty, class A1Ty, class A2Ty, class A3Ty>
Emplaceable(A0Ty &&A0, A1Ty &&A1, A2Ty &&A2, A3Ty &&A3)
: A0(std::forward<A0Ty>(A0)), A1(std::forward<A1Ty>(A1)),
A2(std::forward<A2Ty>(A2)), A3(std::forward<A3Ty>(A3)),
State(ES_Emplaced) {}
Emplaceable(Emplaceable &&) : State(ES_Moved) {}
Emplaceable &operator=(Emplaceable &&) {
State = ES_Moved;
return *this;
}
private:
Emplaceable(const Emplaceable &) = delete;
Emplaceable &operator=(const Emplaceable &) = delete;
};
TEST(SmallVectorTest, EmplaceBack) {
EmplaceableArg<0> A0(true);
EmplaceableArg<1> A1(true);
EmplaceableArg<2> A2(true);
EmplaceableArg<3> A3(true);
{
SmallVector<Emplaceable, 3> V;
Emplaceable &back = V.emplace_back();
EXPECT_TRUE(&back == &V.back());
EXPECT_TRUE(V.size() == 1);
EXPECT_TRUE(back.State == ES_Emplaced);
EXPECT_TRUE(back.A0.State == EAS_Defaulted);
EXPECT_TRUE(back.A1.State == EAS_Defaulted);
EXPECT_TRUE(back.A2.State == EAS_Defaulted);
EXPECT_TRUE(back.A3.State == EAS_Defaulted);
}
{
SmallVector<Emplaceable, 3> V;
Emplaceable &back = V.emplace_back(std::move(A0));
EXPECT_TRUE(&back == &V.back());
EXPECT_TRUE(V.size() == 1);
EXPECT_TRUE(back.State == ES_Emplaced);
EXPECT_TRUE(back.A0.State == EAS_RValue);
EXPECT_TRUE(back.A1.State == EAS_Defaulted);
EXPECT_TRUE(back.A2.State == EAS_Defaulted);
EXPECT_TRUE(back.A3.State == EAS_Defaulted);
}
{
SmallVector<Emplaceable, 3> V;
Emplaceable &back = V.emplace_back(A0);
EXPECT_TRUE(&back == &V.back());
EXPECT_TRUE(V.size() == 1);
EXPECT_TRUE(back.State == ES_Emplaced);
EXPECT_TRUE(back.A0.State == EAS_LValue);
EXPECT_TRUE(back.A1.State == EAS_Defaulted);
EXPECT_TRUE(back.A2.State == EAS_Defaulted);
EXPECT_TRUE(back.A3.State == EAS_Defaulted);
}
{
SmallVector<Emplaceable, 3> V;
Emplaceable &back = V.emplace_back(A0, A1);
EXPECT_TRUE(&back == &V.back());
EXPECT_TRUE(V.size() == 1);
EXPECT_TRUE(back.State == ES_Emplaced);
EXPECT_TRUE(back.A0.State == EAS_LValue);
EXPECT_TRUE(back.A1.State == EAS_LValue);
EXPECT_TRUE(back.A2.State == EAS_Defaulted);
EXPECT_TRUE(back.A3.State == EAS_Defaulted);
}
{
SmallVector<Emplaceable, 3> V;
Emplaceable &back = V.emplace_back(std::move(A0), std::move(A1));
EXPECT_TRUE(&back == &V.back());
EXPECT_TRUE(V.size() == 1);
EXPECT_TRUE(back.State == ES_Emplaced);
EXPECT_TRUE(back.A0.State == EAS_RValue);
EXPECT_TRUE(back.A1.State == EAS_RValue);
EXPECT_TRUE(back.A2.State == EAS_Defaulted);
EXPECT_TRUE(back.A3.State == EAS_Defaulted);
}
{
SmallVector<Emplaceable, 3> V;
Emplaceable &back = V.emplace_back(std::move(A0), A1, std::move(A2), A3);
EXPECT_TRUE(&back == &V.back());
EXPECT_TRUE(V.size() == 1);
EXPECT_TRUE(back.State == ES_Emplaced);
EXPECT_TRUE(back.A0.State == EAS_RValue);
EXPECT_TRUE(back.A1.State == EAS_LValue);
EXPECT_TRUE(back.A2.State == EAS_RValue);
EXPECT_TRUE(back.A3.State == EAS_LValue);
}
{
SmallVector<int, 1> V;
V.emplace_back();
V.emplace_back(42);
EXPECT_EQ(2U, V.size());
EXPECT_EQ(0, V[0]);
EXPECT_EQ(42, V[1]);
}
}
TEST(SmallVectorTest, InitializerList) {
SmallVector<int, 2> V1 = {};
EXPECT_TRUE(V1.empty());
V1 = {0, 0};
EXPECT_TRUE(makeArrayRef(V1).equals({0, 0}));
V1 = {-1, -1};
EXPECT_TRUE(makeArrayRef(V1).equals({-1, -1}));
SmallVector<int, 2> V2 = {1, 2, 3, 4};
EXPECT_TRUE(makeArrayRef(V2).equals({1, 2, 3, 4}));
V2.assign({4});
EXPECT_TRUE(makeArrayRef(V2).equals({4}));
V2.append({3, 2});
EXPECT_TRUE(makeArrayRef(V2).equals({4, 3, 2}));
V2.insert(V2.begin() + 1, 5);
EXPECT_TRUE(makeArrayRef(V2).equals({4, 5, 3, 2}));
}
} // end namespace
|
{
"pile_set_name": "Github"
}
|
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/vector/vector10.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
namespace aux {
template<> struct v_at_impl<0>
{
template< typename V_ > struct result_
{
typedef typename V_::item0 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<0> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct size_impl< aux::vector_tag<0> >
{
template< typename Vector > struct apply
: long_<0>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<0> >
: size_impl< aux::vector_tag<0> >
{
};
template<>
struct clear_impl< aux::vector_tag<0> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0
>
struct vector1
{
typedef aux::vector_tag<1> tag;
typedef vector1 type;
typedef T0 item0;
typedef void_ item1;
typedef T0 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,1 > end;
};
template<>
struct push_front_impl< aux::vector_tag<0> >
{
template< typename Vector, typename T > struct apply
{
typedef vector1<
T
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef vector0<
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<0> >
{
template< typename Vector, typename T > struct apply
{
typedef vector1<
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef vector0<
> type;
};
};
namespace aux {
template<> struct v_at_impl<1>
{
template< typename V_ > struct result_
{
typedef typename V_::item1 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<1> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
: long_<1>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<1> >
: size_impl< aux::vector_tag<1> >
{
};
template<>
struct clear_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1
>
struct vector2
{
typedef aux::vector_tag<2> tag;
typedef vector2 type;
typedef T0 item0;
typedef T1 item1;
typedef void_ item2;
typedef T1 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,2 > end;
};
template<>
struct push_front_impl< aux::vector_tag<1> >
{
template< typename Vector, typename T > struct apply
{
typedef vector2<
T
,
typename Vector::item0
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef vector1<
typename Vector::item1
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<1> >
{
template< typename Vector, typename T > struct apply
{
typedef vector2<
typename Vector::item0
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef vector1<
typename Vector::item0
> type;
};
};
namespace aux {
template<> struct v_at_impl<2>
{
template< typename V_ > struct result_
{
typedef typename V_::item2 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<2> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
: long_<2>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<2> >
: size_impl< aux::vector_tag<2> >
{
};
template<>
struct clear_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2
>
struct vector3
{
typedef aux::vector_tag<3> tag;
typedef vector3 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef void_ item3;
typedef T2 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,3 > end;
};
template<>
struct push_front_impl< aux::vector_tag<2> >
{
template< typename Vector, typename T > struct apply
{
typedef vector3<
T
,
typename Vector::item0, typename Vector::item1
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef vector2<
typename Vector::item1, typename Vector::item2
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<2> >
{
template< typename Vector, typename T > struct apply
{
typedef vector3<
typename Vector::item0, typename Vector::item1
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef vector2<
typename Vector::item0, typename Vector::item1
> type;
};
};
namespace aux {
template<> struct v_at_impl<3>
{
template< typename V_ > struct result_
{
typedef typename V_::item3 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<3> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
: long_<3>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<3> >
: size_impl< aux::vector_tag<3> >
{
};
template<>
struct clear_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3
>
struct vector4
{
typedef aux::vector_tag<4> tag;
typedef vector4 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef void_ item4;
typedef T3 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,4 > end;
};
template<>
struct push_front_impl< aux::vector_tag<3> >
{
template< typename Vector, typename T > struct apply
{
typedef vector4<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef vector3<
typename Vector::item1, typename Vector::item2
, typename Vector::item3
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<3> >
{
template< typename Vector, typename T > struct apply
{
typedef vector4<
typename Vector::item0, typename Vector::item1
, typename Vector::item2
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef vector3<
typename Vector::item0, typename Vector::item1
, typename Vector::item2
> type;
};
};
namespace aux {
template<> struct v_at_impl<4>
{
template< typename V_ > struct result_
{
typedef typename V_::item4 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<4> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
: long_<4>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<4> >
: size_impl< aux::vector_tag<4> >
{
};
template<>
struct clear_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
>
struct vector5
{
typedef aux::vector_tag<5> tag;
typedef vector5 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef void_ item5;
typedef T4 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,5 > end;
};
template<>
struct push_front_impl< aux::vector_tag<4> >
{
template< typename Vector, typename T > struct apply
{
typedef vector5<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef vector4<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<4> >
{
template< typename Vector, typename T > struct apply
{
typedef vector5<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef vector4<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
> type;
};
};
namespace aux {
template<> struct v_at_impl<5>
{
template< typename V_ > struct result_
{
typedef typename V_::item5 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<5> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
: long_<5>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<5> >
: size_impl< aux::vector_tag<5> >
{
};
template<>
struct clear_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct vector6
{
typedef aux::vector_tag<6> tag;
typedef vector6 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef void_ item6;
typedef T5 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,6 > end;
};
template<>
struct push_front_impl< aux::vector_tag<5> >
{
template< typename Vector, typename T > struct apply
{
typedef vector6<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef vector5<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<5> >
{
template< typename Vector, typename T > struct apply
{
typedef vector6<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef vector5<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4
> type;
};
};
namespace aux {
template<> struct v_at_impl<6>
{
template< typename V_ > struct result_
{
typedef typename V_::item6 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<6> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
: long_<6>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<6> >
: size_impl< aux::vector_tag<6> >
{
};
template<>
struct clear_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6
>
struct vector7
{
typedef aux::vector_tag<7> tag;
typedef vector7 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef void_ item7;
typedef T6 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,7 > end;
};
template<>
struct push_front_impl< aux::vector_tag<6> >
{
template< typename Vector, typename T > struct apply
{
typedef vector7<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef vector6<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<6> >
{
template< typename Vector, typename T > struct apply
{
typedef vector7<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef vector6<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
> type;
};
};
namespace aux {
template<> struct v_at_impl<7>
{
template< typename V_ > struct result_
{
typedef typename V_::item7 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<7> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
: long_<7>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<7> >
: size_impl< aux::vector_tag<7> >
{
};
template<>
struct clear_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7
>
struct vector8
{
typedef aux::vector_tag<8> tag;
typedef vector8 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef T7 item7;
typedef void_ item8;
typedef T7 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,8 > end;
};
template<>
struct push_front_impl< aux::vector_tag<7> >
{
template< typename Vector, typename T > struct apply
{
typedef vector8<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef vector7<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
, typename Vector::item7
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<7> >
{
template< typename Vector, typename T > struct apply
{
typedef vector8<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef vector7<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6
> type;
};
};
namespace aux {
template<> struct v_at_impl<8>
{
template< typename V_ > struct result_
{
typedef typename V_::item8 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<8> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
: long_<8>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<8> >
: size_impl< aux::vector_tag<8> >
{
};
template<>
struct clear_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8
>
struct vector9
{
typedef aux::vector_tag<9> tag;
typedef vector9 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef T7 item7;
typedef T8 item8;
typedef void_ item9;
typedef T8 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,9 > end;
};
template<>
struct push_front_impl< aux::vector_tag<8> >
{
template< typename Vector, typename T > struct apply
{
typedef vector9<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef vector8<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
, typename Vector::item7, typename Vector::item8
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<8> >
{
template< typename Vector, typename T > struct apply
{
typedef vector9<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef vector8<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
> type;
};
};
namespace aux {
template<> struct v_at_impl<9>
{
template< typename V_ > struct result_
{
typedef typename V_::item9 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<9> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
: long_<9>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<9> >
: size_impl< aux::vector_tag<9> >
{
};
template<>
struct clear_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
>
struct vector10
{
typedef aux::vector_tag<10> tag;
typedef vector10 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef T7 item7;
typedef T8 item8;
typedef T9 item9;
typedef void_ item10;
typedef T9 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,10 > end;
};
template<>
struct push_front_impl< aux::vector_tag<9> >
{
template< typename Vector, typename T > struct apply
{
typedef vector10<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
, typename Vector::item8
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef vector9<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
, typename Vector::item7, typename Vector::item8
, typename Vector::item9
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<9> >
{
template< typename Vector, typename T > struct apply
{
typedef vector10<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
, typename Vector::item8
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef vector9<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
, typename Vector::item8
> type;
};
};
namespace aux {
template<> struct v_at_impl<10>
{
template< typename V_ > struct result_
{
typedef typename V_::item10 type;
};
};
}
template<>
struct at_impl< aux::vector_tag<10> >
{
template< typename V_, typename N > struct apply
{
typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
::template result_<V_>::type type;
};
};
template<>
struct front_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef typename Vector::item0 type;
};
};
template<>
struct back_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef typename Vector::back type;
};
};
template<>
struct empty_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
: false_
{
};
};
template<>
struct size_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
: long_<10>
{
};
};
template<>
struct O1_size_impl< aux::vector_tag<10> >
: size_impl< aux::vector_tag<10> >
{
};
template<>
struct clear_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef vector0<> type;
};
};
}}
|
{
"pile_set_name": "Github"
}
|
import fs from 'fs-extra';
import { getPagesFromPdf, getPagesTextFromPdf } from './pdf';
jest.unmock('fs-extra');
/**
* More files should be included as time passes to maintain compatability
* with previous years' pdfs.
*/
const fileData = fs.readFileSync('__mocks__/fixtures/test1.pdf');
describe('pdf', () => {
it('getPagesFromPdf gets pages from pdf', async () => {
const pages = await getPagesFromPdf(fileData);
expect(pages.length).toBe(1);
});
it("getPagesTextFromPdf gets pages' text from pdf", async () => {
const textPages = await getPagesTextFromPdf(fileData);
expect(textPages.length).toBe(1);
expect(textPages[0].length).toBe(77);
});
});
|
{
"pile_set_name": "Github"
}
|
/**
* Greek translation for bootstrap-datepicker
*/
;(function($){
$.fn.datepicker.dates['el'] = {
days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο", "Κυριακή"],
daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"],
daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"],
months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
monthsShort: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μάι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"],
today: "Σήμερα"
};
}(jQuery));
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HIWizardPasswordViewController">
<connections>
<outlet property="passwordCreationInputHandler" destination="Xeb-Il-R2U" id="GPC-TG-IYv"/>
<outlet property="passwordField" destination="fv9-Sf-l3n" id="WnA-T1-b4Y"/>
<outlet property="repeatedPasswordField" destination="tib-B4-YAa" id="H7a-bQ-5zH"/>
<outlet property="view" destination="1" id="2"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="1">
<rect key="frame" x="0.0" y="0.0" width="850" height="650"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="J19-Tc-gPi">
<rect key="frame" x="375" y="470" width="100" height="100"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="h3f-ZZ-8Lg"/>
<constraint firstAttribute="height" constant="100" id="oEG-Hc-T4Z"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="Icon" id="YoY-sh-puc"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mdk-zD-vWi">
<rect key="frame" x="220" y="379" width="410" height="51"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Criar uma senha" id="I10-iV-C0e">
<font key="font" metaFont="systemBold" size="42"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gDC-Cm-H3d">
<rect key="frame" x="381" y="59" width="89" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="smallSquare" title="Criar senha" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="j0E-b4-dgh" customClass="HIWizardButtonCell">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="nextButtonPressed:" target="-2" id="dES-jo-C6H"/>
<binding destination="-2" name="enabled" keyPath="submitButtonEnabled" id="jae-2B-UIe"/>
<outlet property="nextKeyView" destination="fv9-Sf-l3n" id="ypN-3L-Y8x"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="0Gn-sQ-ZVg">
<rect key="frame" x="123" y="276" width="604" height="95"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="600" id="Jn9-t9-FWD"/>
</constraints>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" id="AHC-MY-HDw">
<font key="font" metaFont="system" size="16"/>
<string key="title">Se seu computador for roubado ou perdido, a encriptação da carteira pode proteger seu dinheiro de roubo. Crie uma senha agora e começaremos o processo.
IMPORTANTE: Lembre-se de anotar sua senha e de guardá-la em algum lugar seguro. Se sua senha for perdida, você perderá o acesso a seu dinheiro!</string>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fv9-Sf-l3n">
<rect key="frame" x="175" y="161" width="500" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="500" id="W4i-8b-pIF"/>
<constraint firstAttribute="height" constant="40" id="cnD-lg-Fe3"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Sua senha aqui" drawsBackground="YES" id="tfJ-aZ-cpS" customClass="HIPaddedSecureTextFieldCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<outlet property="delegate" destination="-2" id="U8V-C7-9Tt"/>
<outlet property="nextKeyView" destination="tib-B4-YAa" id="jBW-gL-igG"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tib-B4-YAa">
<rect key="frame" x="175" y="101" width="500" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="6hS-1l-WA1"/>
<constraint firstAttribute="width" constant="500" id="ELZ-TO-EiD"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Repita a sua senha!" drawsBackground="YES" id="fzF-zh-yoX" customClass="HIPaddedSecureTextFieldCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<outlet property="delegate" destination="-2" id="INf-Ac-2e0"/>
<outlet property="nextKeyView" destination="gDC-Cm-H3d" id="9u4-Pe-PEw"/>
</connections>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="centerX" secondItem="mdk-zD-vWi" secondAttribute="centerX" id="2kL-8E-36b"/>
<constraint firstItem="J19-Tc-gPi" firstAttribute="top" secondItem="1" secondAttribute="top" constant="80" id="88u-ix-KK1"/>
<constraint firstItem="tib-B4-YAa" firstAttribute="top" secondItem="fv9-Sf-l3n" secondAttribute="bottom" constant="20" id="Epr-xz-Tjf"/>
<constraint firstAttribute="centerX" secondItem="fv9-Sf-l3n" secondAttribute="centerX" id="FHZ-gb-dn5"/>
<constraint firstAttribute="centerX" secondItem="gDC-Cm-H3d" secondAttribute="centerX" id="WGS-IL-M2j"/>
<constraint firstAttribute="centerX" secondItem="0Gn-sQ-ZVg" secondAttribute="centerX" id="WnZ-Wm-UYh"/>
<constraint firstItem="fv9-Sf-l3n" firstAttribute="top" relation="greaterThanOrEqual" secondItem="0Gn-sQ-ZVg" secondAttribute="bottom" constant="8" symbolic="YES" id="Y5E-3I-w0H"/>
<constraint firstItem="mdk-zD-vWi" firstAttribute="top" secondItem="J19-Tc-gPi" secondAttribute="bottom" constant="40" id="ZEk-gO-Ry9"/>
<constraint firstAttribute="bottom" secondItem="gDC-Cm-H3d" secondAttribute="bottom" constant="60" id="bNu-ow-W56"/>
<constraint firstItem="gDC-Cm-H3d" firstAttribute="top" secondItem="tib-B4-YAa" secondAttribute="bottom" constant="20" id="d9S-Wr-iMj"/>
<constraint firstAttribute="centerX" secondItem="tib-B4-YAa" secondAttribute="centerX" id="h80-lX-lN3"/>
<constraint firstItem="0Gn-sQ-ZVg" firstAttribute="top" secondItem="mdk-zD-vWi" secondAttribute="bottom" constant="8" id="ss7-rd-uia"/>
<constraint firstAttribute="centerX" secondItem="J19-Tc-gPi" secondAttribute="centerX" id="yCa-GG-u1A"/>
</constraints>
</customView>
<customObject id="Xeb-Il-R2U" customClass="HIPasswordCreationInputHandler">
<connections>
<outlet property="passwordField" destination="fv9-Sf-l3n" id="e9a-nY-Gux"/>
<outlet property="repeatedPasswordField" destination="tib-B4-YAa" id="sbf-Jo-5n0"/>
</connections>
</customObject>
</objects>
<resources>
<image name="Icon" width="512" height="512"/>
</resources>
</document>
|
{
"pile_set_name": "Github"
}
|
use itertools::Itertools;
use crate::base::{
ast::{
self, AstType, DisplayEnv, Do, Expr, MutVisitor, Pattern, SpannedAlias, SpannedExpr,
TypedIdent,
},
fnv::FnvMap,
pos::{self, ByteOffset, BytePos, Span},
scoped_map::ScopedMap,
source::Source,
symbol::{Symbol, SymbolData, SymbolModule},
types::{ArcType, Type},
};
struct Environment {
stack: ScopedMap<Symbol, (Symbol, Span<BytePos>)>,
}
pub fn rename<'s, 'ast>(
source: &'s (dyn Source + 's),
symbols: &mut SymbolModule,
ast_arena: ast::ArenaRef<'s, 'ast, Symbol>,
expr: &mut SpannedExpr<'ast, Symbol>,
) {
enum TailCall {
TailCall,
Return,
}
struct RenameVisitor<'a: 'b, 'b, 's, 'ast> {
source: &'s (dyn Source + 's),
symbols: &'b mut SymbolModule<'a>,
seen_symbols: FnvMap<Symbol, u32>,
scope: Vec<Symbol>,
env: Environment,
ast_arena: ast::ArenaRef<'s, 'ast, Symbol>,
hole: ArcType,
}
impl<'a, 'b, 's, 'ast> RenameVisitor<'a, 'b, 's, 'ast> {
fn new_pattern(&mut self, pattern: &mut ast::SpannedPattern<Symbol>) {
match pattern.value {
Pattern::Record {
ref mut fields,
ref mut implicit_import,
..
} => {
for (name, value) in ast::pattern_values_mut(fields) {
match value {
Some(pat) => self.new_pattern(pat),
None => {
let id = name.value.clone();
name.value = self.stack_var(id, pattern.span);
}
}
}
if let Some(ref mut implicit_import) = *implicit_import {
let new_name =
self.stack_var(implicit_import.value.clone(), implicit_import.span);
implicit_import.value = new_name;
}
}
Pattern::Ident(ref mut id) => {
let new_name = self.stack_var(id.name.clone(), pattern.span);
id.name = new_name;
}
Pattern::As(ref mut id, ref mut pat) => {
let new_name = self.stack_var(id.value.clone(), pattern.span);
id.value = new_name;
self.new_pattern(pat)
}
Pattern::Tuple { ref mut elems, .. } => {
for elem in &mut **elems {
self.new_pattern(elem);
}
}
Pattern::Constructor(_, ref mut args) => {
for arg in &mut **args {
self.new_pattern(arg);
}
}
Pattern::Literal(_) | Pattern::Error => (),
}
}
// Renames the symbol to be unique in this module
fn stack_var(&mut self, id: Symbol, span: Span<BytePos>) -> Symbol {
let mut location = self
.source
.location(span.start())
.map(|location| (location.line.0 + 1, location.column.0 + 1))
.unwrap_or_else(|| (span.start().0, 0));
let new_id = self.symbols.symbol(SymbolData {
global: false,
name: id.as_str(),
location: Some(location),
});
let index = self.seen_symbols.entry(new_id.clone()).or_default();
let new_id = if *index == 0 {
*index += 1;
new_id
} else {
// TODO More reliable way of generating unique symbols
*index += 1;
location.1 += *index;
self.symbols.symbol(SymbolData {
global: false,
name: id.as_str(),
location: Some(location),
})
};
debug!("Rename binding `{:?}` = `{:?}`", id, new_id);
self.env.stack.insert(id, (new_id.clone(), span));
new_id
}
fn stack_type(&mut self, span: Span<BytePos>, alias: &mut SpannedAlias<Symbol>) {
let new = self.symbols.scoped_symbol(alias.value.name.declared_name());
self.env
.stack
.insert(alias.value.name.clone(), (new.clone(), span));
alias.value.name = new;
}
/// Renames `id` to the unique identifier which have the type `expected`
/// Returns `Some(new_id)` if renaming was necessary or `None` if no renaming was necessary
/// as `id` was currently unique (#Int+, #Float*, etc)
fn rename(&self, id: &Symbol) -> Option<Symbol> {
self.env.stack.get(id).map(|t| t.0.clone())
}
fn rename_expr(&mut self, expr: &mut SpannedExpr<'ast, Symbol>) -> TailCall {
match expr.value {
Expr::Ident(ref mut id)
// FIXME Still allow renaming of variants somehow without causing resolution
// problems with types
if !id.name.declared_name().starts_with(char::is_uppercase) =>
{
if let Some(new_id) = self.rename(&id.name) {
id.name = new_id;
}
}
Expr::Record {
ref mut exprs,
ref mut base,
..
} => {
for expr_field in &mut **exprs {
match expr_field.value {
Some(ref mut expr) => self.visit_expr(expr),
None => {
if let Some(new_id) = self.rename(&expr_field.name.value) {
debug!("Rename record field {} = {}", expr_field.name, new_id);
expr_field.name.value = new_id;
}
}
}
}
if let Some(ref mut base) = *base {
self.visit_expr(base);
}
}
Expr::Infix {
ref mut lhs,
ref mut op,
ref mut rhs,
ref mut implicit_args,
} => {
if let Some(new_id) = self.rename(&op.value.name) {
debug!(
"Rename {} = {}",
self.symbols.string(&op.value.name),
self.symbols.string(&new_id)
);
op.value.name = new_id;
}
self.visit_expr(lhs);
self.visit_expr(rhs);
for arg in &mut **implicit_args {
self.visit_expr(arg);
}
}
Expr::Match(ref mut expr, ref mut alts) => {
self.visit_expr(expr);
for alt in &mut **alts {
self.env.stack.enter_scope();
self.new_pattern(&mut alt.pattern);
self.visit_expr(&mut alt.expr);
self.env.stack.exit_scope();
}
}
Expr::LetBindings(ref mut bindings, _) => {
self.env.stack.enter_scope();
let is_recursive = bindings.is_recursive();
for bind in bindings.iter_mut() {
if !is_recursive {
if let Pattern::Ident(id) = &bind.name.value {
self.scope.push(id.name.clone());
}
self.visit_expr(&mut bind.expr);
if let Pattern::Ident(_) = &bind.name.value {
self.scope.pop();
}
}
if let Some(ref mut typ) = bind.typ {
self.visit_ast_type(typ)
}
self.new_pattern(&mut bind.name);
}
if is_recursive {
for bind in bindings {
self.env.stack.enter_scope();
for arg in &mut *bind.args {
arg.name.value.name =
self.stack_var(arg.name.value.name.clone(), arg.name.span);
}
if let Pattern::Ident(id) = &bind.name.value {
self.scope.push(id.name.clone());
}
self.visit_expr(&mut bind.expr);
if let Pattern::Ident(_) = &bind.name.value {
self.scope.pop();
}
self.env.stack.exit_scope();
}
}
return TailCall::TailCall;
}
Expr::Lambda(ref mut lambda) => {
let location = self.source.location(expr.span.start()).unwrap_or_else(|| ice!("Lambda without source location"));
let name = format!(
"{}.{}",
self.symbols.module(),
self.scope.iter().map(|s| s.as_str()).format("."),
);
lambda.id.name = self.symbols.symbol(SymbolData {
global: false,
location: Some((location.line.0 + 1, location.column.0 + 1)),
name,
});
self.env.stack.enter_scope();
for arg in &mut *lambda.args {
arg.name.value.name =
self.stack_var(arg.name.value.name.clone(), expr.span);
}
self.visit_expr(&mut lambda.body);
self.env.stack.exit_scope();
}
Expr::TypeBindings(ref mut bindings, _) => {
self.env.stack.enter_scope();
for bind in &mut **bindings {
self.stack_type(expr.span, &mut bind.alias);
}
for bind in &mut **bindings {
self.visit_alias(&mut bind.alias);
}
return TailCall::TailCall;
}
Expr::Do(Do {
ref mut id,
ref mut bound,
ref mut flat_map_id,
..
}) => {
let flat_map = self.symbols.simple_symbol("flat_map");
*flat_map_id = Some(self.ast_arena.alloc(pos::spanned(
Span::new(expr.span.end(), expr.span.start() + ByteOffset::from(2)),
Expr::Ident(TypedIdent {
name: flat_map,
typ: self.hole.clone(),
}),
)));
let flat_map_id = flat_map_id
.as_mut()
.unwrap_or_else(|| ice!("flat_map_id not set before renaming"));
self.visit_expr(flat_map_id);
self.visit_expr(bound);
self.env.stack.enter_scope();
if let Some(ref mut id) = *id {
self.visit_pattern(id);
}
return TailCall::TailCall;
}
_ => ast::walk_mut_expr(self, expr),
}
TailCall::Return
}
}
impl<'a, 'b, 'c, 's, 'ast> MutVisitor<'c, 'ast> for RenameVisitor<'a, 'b, 's, 'ast> {
type Ident = Symbol;
fn visit_pattern(&mut self, pattern: &mut ast::SpannedPattern<'ast, Symbol>) {
self.new_pattern(pattern);
}
fn visit_expr(&mut self, mut expr: &mut SpannedExpr<'ast, Self::Ident>) {
let mut i = 0;
loop {
match self.rename_expr(expr) {
TailCall::Return => break,
TailCall::TailCall => {
expr = match { expr }.value {
Expr::LetBindings(_, ref mut new_expr)
| Expr::TypeBindings(_, ref mut new_expr)
| Expr::Do(Do {
body: ref mut new_expr,
..
}) => new_expr,
_ => ice!("Only Let and Type expressions can tailcall"),
};
i += 1;
}
}
}
for _ in 0..i {
self.env.stack.exit_scope();
}
}
fn visit_ast_type(&mut self, s: &'c mut AstType<'ast, Self::Ident>) {
match &mut **s {
Type::ExtendTypeRow { types, .. } => {
for field in &mut **types {
if let Some(alias) = field.typ.try_get_alias_mut() {
if let Some(new_name) = self.rename(&field.name.value) {
alias.name = new_name;
}
}
}
}
Type::Projection(ids) => {
// The first id refers to a local variable so we need to rename it
if let Some(new_id) = self.rename(&mut ids[0]) {
ids[0] = new_id;
}
}
Type::Ident(id) => {
if let Some(new_id) = self.rename(&id.name) {
id.name = new_id;
}
}
_ => (),
}
ast::walk_mut_ast_type(self, s)
}
}
let mut visitor = RenameVisitor {
source,
symbols: symbols,
seen_symbols: Default::default(),
scope: Vec::new(),
env: Environment {
stack: ScopedMap::new(),
},
ast_arena,
hole: Type::hole(),
};
visitor.visit_expr(expr);
}
|
{
"pile_set_name": "Github"
}
|
package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"bufio"
"context"
"encoding/json"
"io"
"net/http"
"strings"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/pkg/ioutils"
"github.com/sirupsen/logrus"
)
// DebugRequestMiddleware dumps the request to logger
func DebugRequestMiddleware(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
return func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
logrus.Debugf("Calling %s %s", r.Method, r.RequestURI)
if r.Method != http.MethodPost {
return handler(ctx, w, r, vars)
}
if err := httputils.CheckForJSON(r); err != nil {
return handler(ctx, w, r, vars)
}
maxBodySize := 4096 // 4KB
if r.ContentLength > int64(maxBodySize) {
return handler(ctx, w, r, vars)
}
body := r.Body
bufReader := bufio.NewReaderSize(body, maxBodySize)
r.Body = ioutils.NewReadCloserWrapper(bufReader, func() error { return body.Close() })
b, err := bufReader.Peek(maxBodySize)
if err != io.EOF {
// either there was an error reading, or the buffer is full (in which case the request is too large)
return handler(ctx, w, r, vars)
}
var postForm map[string]interface{}
if err := json.Unmarshal(b, &postForm); err == nil {
maskSecretKeys(postForm)
formStr, errMarshal := json.Marshal(postForm)
if errMarshal == nil {
logrus.Debugf("form data: %s", string(formStr))
} else {
logrus.Debugf("form data: %q", postForm)
}
}
return handler(ctx, w, r, vars)
}
}
func maskSecretKeys(inp interface{}) {
if arr, ok := inp.([]interface{}); ok {
for _, f := range arr {
maskSecretKeys(f)
}
return
}
if form, ok := inp.(map[string]interface{}); ok {
scrub := []string{
// Note: The Data field contains the base64-encoded secret in 'secret'
// and 'config' create and update requests. Currently, no other POST
// API endpoints use a data field, so we scrub this field unconditionally.
// Change this handling to be conditional if a new endpoint is added
// in future where this field should not be scrubbed.
"data",
"jointoken",
"password",
"secret",
"signingcakey",
"unlockkey",
}
loop0:
for k, v := range form {
for _, m := range scrub {
if strings.EqualFold(m, k) {
form[k] = "*****"
continue loop0
}
}
maskSecretKeys(v)
}
}
}
|
{
"pile_set_name": "Github"
}
|
#Tue Nov 19 10:57:04 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip
|
{
"pile_set_name": "Github"
}
|
// import async to make control flow simplier
var async = require('async');
// import the rest of the normal stuff
var mongoose = require('../../lib');
require('./person.js')();
var Person = mongoose.model('Person');
// define some dummy data
var data = [
{ name : 'bill', age : 25, birthday : new Date().setFullYear((new
Date().getFullYear() - 25)), gender : "Male" },
{ name : 'mary', age : 30, birthday : new Date().setFullYear((new
Date().getFullYear() - 30)), gender : "Female" },
{ name : 'bob', age : 21, birthday : new Date().setFullYear((new
Date().getFullYear() - 21)), gender : "Male" },
{ name : 'lilly', age : 26, birthday : new Date().setFullYear((new
Date().getFullYear() - 26)), gender : "Female" },
{ name : 'alucard', age : 1000, birthday : new Date().setFullYear((new
Date().getFullYear() - 1000)), gender : "Male" }
];
mongoose.connect('mongodb://localhost/persons', function(err) {
if (err) throw err;
// create all of the dummy people
async.each(data, function(item, cb) {
Person.create(item, cb);
}, function(err) {
if (err) {
// handle error
}
// alright, simple map reduce example. We will find the total ages of each
// gender
// create the options object
var o = {};
o.map = function() {
// in this function, 'this' refers to the current document being
// processed. Return the (gender, age) tuple using
/* global emit */
emit(this.gender, this.age);
};
// the reduce function receives the array of ages that are grouped by the
// id, which in this case is the gender
o.reduce = function(id, ages) {
return Array.sum(ages);
};
// other options that can be specified
// o.query = { age : { $lt : 1000 }}; // the query object
// o.limit = 3; // max number of documents
// o.keeptemp = true; // default is false, specifies whether to keep temp data
// o.finalize = someFunc; // function called after reduce
// o.scope = {}; // the scope variable exposed to map/reduce/finalize
// o.jsMode = true; // default is false, force execution to stay in JS
o.verbose = true; // default is false, provide stats on the job
// o.out = {}; // objects to specify where output goes, by default is
// returned, but can also be stored in a new collection
// see: http://mongoosejs.com/docs/api.html#model_Model.mapReduce
Person.mapReduce(o, function(err, results, stats) {
console.log("map reduce took %d ms", stats.processtime);
console.log(results);
cleanup();
});
});
});
function cleanup() {
Person.remove(function() {
mongoose.disconnect();
});
}
|
{
"pile_set_name": "Github"
}
|
Include: include/setup.vader
Execute (neomake#log#debug writes to logfile always):
Save g:neomake_verbose, g:neomake_logfile
let neomake_verbose = 0
let g:neomake_logfile = tempname()
call neomake#log#debug('msg1.')
call neomake#log#debug('msg2.')
if has('patch-7.4.503')
let logfile_msg = readfile(g:neomake_logfile)[1]
else
let logfile_msg = readfile(g:neomake_logfile)[0]
endif
" Also allow for small delay (on CI).
Assert logfile_msg =~# '\v\d\d:\d\d:\d\d \d+ \[D (\+0.0\d| )\] msg2.$', 'unexpected msg: '.logfile_msg
call neomake#log#debug('msg3.')
sleep 10m
call neomake#log#debug('msg4.', {})
let logfile_msg = readfile(g:neomake_logfile)[-1]
Assert logfile_msg =~# '\v\d\d:\d\d:\d\d \d+ \[D \+0.\d\d\] \[-.-:-:\d+\] msg4.$', 'Message does not match: '.logfile_msg
Execute (neomake#log#debug unsets logfile in case of errors):
Save g:neomake_logfile
let g:neomake_logfile = '/does/not/exist'
call neomake#log#debug('msg1.')
AssertNeomakeMessage '\vError when trying to write to logfile /does/not/exist: Vim\(call\):E.*. Unsetting g:neomake_logfile.', 0
Assert !exists('g:neomake_logfile'), 'g:neomake_logfile has been unset.'
Execute (neomake#log#debug is picky about punctuation):
call neomake#log#debug('msg1')
AssertEqual g:neomake_test_errors, ['Log msg does not end with punctuation: "msg1".']
let g:neomake_test_errors = []
Execute (neomake#log#debug throws with missing make_options in tests):
" Non-existing make_id should not make it verbose.
AssertEqual g:neomake_test_errors, []
call neomake#log#debug('msg1.', {'make_id': -42})
AssertEqual len(g:neomake_test_errors), 1
Assert g:neomake_test_errors[0] =~# '\v^GetMakeOptions failed: Vim\(let\):E716: Key not present in Dictionary: -42 \(in function .*\)$'
let g:neomake_test_errors = []
|
{
"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.openwhisk.core.connector.test
import java.time.Instant
import java.util.concurrent.TimeUnit
import org.junit.runner.RunWith
import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.junit.JUnitRunner
import spray.json._
import spray.json.DefaultJsonProtocol._
import org.apache.openwhisk.core.connector.Activation
import org.apache.openwhisk.core.entity._
import org.apache.openwhisk.core.entity.size._
import scala.concurrent.duration._
import scala.util.Success
/**
* Unit tests for the EventMessage objects.
*/
@RunWith(classOf[JUnitRunner])
class EventMessageTests extends FlatSpec with Matchers {
behavior of "Activation"
val activationId = ActivationId.generate()
val fullActivation = WhiskActivation(
namespace = EntityPath("ns"),
name = EntityName("a"),
Subject(),
activationId = activationId,
start = Instant.now(),
end = Instant.now(),
response = ActivationResponse.success(Some(JsObject("res" -> JsNumber(1))), Some(42)),
annotations = Parameters("limits", ActionLimits(TimeLimit(1.second), MemoryLimit(128.MB), LogLimit(1.MB)).toJson) ++
Parameters(WhiskActivation.waitTimeAnnotation, 5.toJson) ++
Parameters(WhiskActivation.initTimeAnnotation, 10.toJson) ++
Parameters(WhiskActivation.kindAnnotation, "testkind") ++
Parameters(WhiskActivation.pathAnnotation, "ns2/a") ++
Parameters(WhiskActivation.causedByAnnotation, "sequence"),
duration = Some(123))
it should "transform an activation into an event body" in {
Activation.from(fullActivation) shouldBe Success(
Activation(
"ns2/a",
activationId.asString,
0,
toDuration(123),
toDuration(5),
toDuration(10),
"testkind",
false,
128,
Some("sequence"),
Some(42)))
}
it should "fail transformation if needed annotations are missing" in {
Activation.from(fullActivation.copy(annotations = Parameters())) shouldBe 'failure
Activation.from(fullActivation.copy(annotations = fullActivation.annotations - WhiskActivation.kindAnnotation)) shouldBe 'failure
Activation.from(fullActivation.copy(annotations = fullActivation.annotations - WhiskActivation.pathAnnotation)) shouldBe 'failure
}
it should "provide sensible defaults for optional annotations" in {
val a =
fullActivation
.copy(
duration = None,
annotations = Parameters(WhiskActivation.kindAnnotation, "testkind") ++ Parameters(
WhiskActivation.pathAnnotation,
"ns2/a"))
Activation.from(a) shouldBe Success(
Activation(
"ns2/a",
activationId.asString,
0,
toDuration(0),
toDuration(0),
toDuration(0),
"testkind",
false,
0,
None,
Some(42)))
}
it should "Transform a activation with status code" in {
val resultWithError =
"""
|{
| "statusCode" : 404,
| "body": "Requested resource not found"
|}
|""".stripMargin.parseJson
val a =
fullActivation
.copy(response = ActivationResponse.applicationError(resultWithError, Some(42)))
Activation.from(a).map(act => act.userDefinedStatusCode) shouldBe Success(Some(404))
}
it should "Transform a activation with error status code" in {
val resultWithError =
"""
|{
| "error": {
| "statusCode" : "404",
| "body": "Requested resource not found"
| }
|}
|""".stripMargin.parseJson
Activation.userDefinedStatusCode(Some(resultWithError)) shouldBe Some(404)
}
it should "Transform a activation with error status code with invalid error code" in {
val resultWithInvalidError =
"""
|{
| "statusCode" : "i404",
| "body": "Requested resource not found"
|}
|""".stripMargin.parseJson
Activation.userDefinedStatusCode(Some(resultWithInvalidError)) shouldBe Some(400)
}
def toDuration(milliseconds: Long) = new FiniteDuration(milliseconds, TimeUnit.MILLISECONDS)
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash
CONNECT_PORT=8083
declare -a connectors=("hive")
connectorslen=${#connectors[@]}
for (( i=0; i<${connectorslen}; i++ )); do
CONNECTOR=${connectors[$i]}
echo "Running integration tests for $CONNECTOR"
CONNECTOR_PROJECT="kafka-connect-$CONNECTOR"
echo "Connector path = $CONNECTOR_PROJECT"
IT_PATH="$CONNECTOR_PROJECT/it"
echo "IT test path = $IT_PATH"
COMPOSE_FILE="$IT_PATH/docker-compose.yml"
echo "Compose file = $COMPOSE_FILE"
# if docker is present for this component, start it up, and wait for kafka connect to initialize
if [ -e "$COMPOSE_FILE" ]
then
echo "Docker compose has been detected for $CONNECTOR; starting up as daemon"
docker-compose -f $COMPOSE_FILE up -d -t 30
for (( i=0 ; i<60 ; i++ )); do
sleep 5
curl "http://localhost:$CONNECT_PORT/connector-plugins" | grep "FileStream" && break
done
fi
./gradlew -Pintegration-tests $CONNECTOR_PROJECT:it:check
# if docker is present for this component, shut it down
if [ -e "$COMPOSE_FILE" ]
then
docker-compose -f $COMPOSE_FILE stop -v
fi
echo "Completed integration tests for $CONNECTOR"
done
|
{
"pile_set_name": "Github"
}
|
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018, 2019.
// Modifications copyright (c) 2013-2019, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_WITHIN_POINT_IN_GEOMETRY_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_WITHIN_POINT_IN_GEOMETRY_HPP
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/strategies/concepts/within_concept.hpp>
#include <boost/geometry/strategies/default_strategy.hpp>
#include <boost/geometry/strategies/relate.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/views/detail/normalized_view.hpp>
namespace boost { namespace geometry {
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace within {
template <typename Point1, typename Point2, typename Strategy>
inline bool equals_point_point(Point1 const& p1, Point2 const& p2, Strategy const& strategy)
{
return equals::equals_point_point(p1, p2, strategy.get_equals_point_point_strategy());
}
// TODO: is this needed?
inline int check_result_type(int result)
{
return result;
}
template <typename T>
inline T check_result_type(T result)
{
BOOST_GEOMETRY_ASSERT(false);
return result;
}
template <typename Point, typename Range, typename Strategy> inline
int point_in_range(Point const& point, Range const& range, Strategy const& strategy)
{
boost::ignore_unused(strategy);
typedef typename boost::range_iterator<Range const>::type iterator_type;
typename Strategy::state_type state;
iterator_type it = boost::begin(range);
iterator_type end = boost::end(range);
for ( iterator_type previous = it++ ; it != end ; ++previous, ++it )
{
if ( ! strategy.apply(point, *previous, *it, state) )
{
break;
}
}
return check_result_type(strategy.result(state));
}
template <typename Geometry, typename Point, typename Range>
inline int point_in_range(Point const& point, Range const& range)
{
typedef typename strategy::point_in_geometry::services::default_strategy
<
Point, Geometry
>::type strategy_type;
return point_in_range(point, range, strategy_type());
}
}} // namespace detail::within
namespace detail_dispatch { namespace within {
// checks the relation between a point P and geometry G
// returns 1 if P is in the interior of G
// returns 0 if P is on the boundry of G
// returns -1 if P is in the exterior of G
template <typename Geometry,
typename Tag = typename geometry::tag<Geometry>::type>
struct point_in_geometry
: not_implemented<Tag>
{};
template <typename Point2>
struct point_in_geometry<Point2, point_tag>
{
template <typename Point1, typename Strategy> static inline
int apply(Point1 const& point1, Point2 const& point2, Strategy const& strategy)
{
boost::ignore_unused(strategy);
return strategy.apply(point1, point2) ? 1 : -1;
}
};
template <typename Segment>
struct point_in_geometry<Segment, segment_tag>
{
template <typename Point, typename Strategy> static inline
int apply(Point const& point, Segment const& segment, Strategy const& strategy)
{
boost::ignore_unused(strategy);
typedef typename geometry::point_type<Segment>::type point_type;
point_type p0, p1;
// TODO: don't copy points
detail::assign_point_from_index<0>(segment, p0);
detail::assign_point_from_index<1>(segment, p1);
typename Strategy::state_type state;
strategy.apply(point, p0, p1, state);
int r = detail::within::check_result_type(strategy.result(state));
if ( r != 0 )
return -1; // exterior
// if the point is equal to the one of the terminal points
if ( detail::within::equals_point_point(point, p0, strategy)
|| detail::within::equals_point_point(point, p1, strategy) )
return 0; // boundary
else
return 1; // interior
}
};
template <typename Linestring>
struct point_in_geometry<Linestring, linestring_tag>
{
template <typename Point, typename Strategy> static inline
int apply(Point const& point, Linestring const& linestring, Strategy const& strategy)
{
std::size_t count = boost::size(linestring);
if ( count > 1 )
{
if ( detail::within::point_in_range(point, linestring, strategy) != 0 )
return -1; // exterior
// if the linestring doesn't have a boundary
if (detail::within::equals_point_point(range::front(linestring), range::back(linestring), strategy))
return 1; // interior
// else if the point is equal to the one of the terminal points
else if (detail::within::equals_point_point(point, range::front(linestring), strategy)
|| detail::within::equals_point_point(point, range::back(linestring), strategy))
return 0; // boundary
else
return 1; // interior
}
// TODO: for now degenerated linestrings are ignored
// throw an exception here?
/*else if ( count == 1 )
{
if ( detail::equals::equals_point_point(point, range::front(linestring)) )
return 1;
}*/
return -1; // exterior
}
};
template <typename Ring>
struct point_in_geometry<Ring, ring_tag>
{
template <typename Point, typename Strategy> static inline
int apply(Point const& point, Ring const& ring, Strategy const& strategy)
{
if ( boost::size(ring) < core_detail::closure::minimum_ring_size
<
geometry::closure<Ring>::value
>::value )
{
return -1;
}
detail::normalized_view<Ring const> view(ring);
return detail::within::point_in_range(point, view, strategy);
}
};
// Polygon: in exterior ring, and if so, not within interior ring(s)
template <typename Polygon>
struct point_in_geometry<Polygon, polygon_tag>
{
template <typename Point, typename Strategy>
static inline int apply(Point const& point, Polygon const& polygon,
Strategy const& strategy)
{
int const code = point_in_geometry
<
typename ring_type<Polygon>::type
>::apply(point, exterior_ring(polygon), strategy);
if (code == 1)
{
typename interior_return_type<Polygon const>::type
rings = interior_rings(polygon);
for (typename detail::interior_iterator<Polygon const>::type
it = boost::begin(rings);
it != boost::end(rings);
++it)
{
int const interior_code = point_in_geometry
<
typename ring_type<Polygon>::type
>::apply(point, *it, strategy);
if (interior_code != -1)
{
// If 0, return 0 (touch)
// If 1 (inside hole) return -1 (outside polygon)
// If -1 (outside hole) check other holes if any
return -interior_code;
}
}
}
return code;
}
};
template <typename Geometry>
struct point_in_geometry<Geometry, multi_point_tag>
{
template <typename Point, typename Strategy> static inline
int apply(Point const& point, Geometry const& geometry, Strategy const& strategy)
{
typedef typename boost::range_value<Geometry>::type point_type;
typedef typename boost::range_const_iterator<Geometry>::type iterator;
for ( iterator it = boost::begin(geometry) ; it != boost::end(geometry) ; ++it )
{
int pip = point_in_geometry<point_type>::apply(point, *it, strategy);
//BOOST_GEOMETRY_ASSERT(pip != 0);
if ( pip > 0 ) // inside
return 1;
}
return -1; // outside
}
};
template <typename Geometry>
struct point_in_geometry<Geometry, multi_linestring_tag>
{
template <typename Point, typename Strategy> static inline
int apply(Point const& point, Geometry const& geometry, Strategy const& strategy)
{
int pip = -1; // outside
typedef typename boost::range_value<Geometry>::type linestring_type;
typedef typename boost::range_value<linestring_type>::type point_type;
typedef typename boost::range_iterator<Geometry const>::type iterator;
iterator it = boost::begin(geometry);
for ( ; it != boost::end(geometry) ; ++it )
{
pip = point_in_geometry<linestring_type>::apply(point, *it, strategy);
// inside or on the boundary
if ( pip >= 0 )
{
++it;
break;
}
}
// outside
if ( pip < 0 )
return -1;
// TODO: the following isn't needed for covered_by()
unsigned boundaries = pip == 0 ? 1 : 0;
for ( ; it != boost::end(geometry) ; ++it )
{
if ( boost::size(*it) < 2 )
continue;
point_type const& front = range::front(*it);
point_type const& back = range::back(*it);
// is closed_ring - no boundary
if ( detail::within::equals_point_point(front, back, strategy) )
continue;
// is point on boundary
if ( detail::within::equals_point_point(point, front, strategy)
|| detail::within::equals_point_point(point, back, strategy) )
{
++boundaries;
}
}
// if the number of boundaries is odd, the point is on the boundary
return boundaries % 2 ? 0 : 1;
}
};
template <typename Geometry>
struct point_in_geometry<Geometry, multi_polygon_tag>
{
template <typename Point, typename Strategy> static inline
int apply(Point const& point, Geometry const& geometry, Strategy const& strategy)
{
// For invalid multipolygons
//int res = -1; // outside
typedef typename boost::range_value<Geometry>::type polygon_type;
typedef typename boost::range_const_iterator<Geometry>::type iterator;
for ( iterator it = boost::begin(geometry) ; it != boost::end(geometry) ; ++it )
{
int pip = point_in_geometry<polygon_type>::apply(point, *it, strategy);
// inside or on the boundary
if ( pip >= 0 )
return pip;
// For invalid multi-polygons
//if ( 1 == pip ) // inside polygon
// return 1;
//else if ( res < pip ) // point must be inside at least one polygon
// res = pip;
}
return -1; // for valid multipolygons
//return res; // for invalid multipolygons
}
};
}} // namespace detail_dispatch::within
namespace detail { namespace within {
// 1 - in the interior
// 0 - in the boundry
// -1 - in the exterior
template <typename Point, typename Geometry, typename Strategy>
inline int point_in_geometry(Point const& point, Geometry const& geometry, Strategy const& strategy)
{
concepts::within::check<Point, Geometry, Strategy>();
return detail_dispatch::within::point_in_geometry<Geometry>::apply(point, geometry, strategy);
}
template <typename Point, typename Geometry>
inline int point_in_geometry(Point const& point, Geometry const& geometry)
{
typedef typename strategy::point_in_geometry::services::default_strategy
<
Point, Geometry
>::type strategy_type;
return point_in_geometry(point, geometry, strategy_type());
}
template <typename Point, typename Geometry, typename Strategy>
inline bool within_point_geometry(Point const& point, Geometry const& geometry, Strategy const& strategy)
{
return point_in_geometry(point, geometry, strategy) > 0;
}
template <typename Point, typename Geometry>
inline bool within_point_geometry(Point const& point, Geometry const& geometry)
{
return point_in_geometry(point, geometry) > 0;
}
template <typename Point, typename Geometry, typename Strategy>
inline bool covered_by_point_geometry(Point const& point, Geometry const& geometry, Strategy const& strategy)
{
return point_in_geometry(point, geometry, strategy) >= 0;
}
template <typename Point, typename Geometry>
inline bool covered_by_point_geometry(Point const& point, Geometry const& geometry)
{
return point_in_geometry(point, geometry) >= 0;
}
}} // namespace detail::within
#endif // DOXYGEN_NO_DETAIL
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_WITHIN_POINT_IN_GEOMETRY_HPP
|
{
"pile_set_name": "Github"
}
|
defpackage stz/test-lang :
import core
import collections
import parser
import macro-utils
import stz/core-macros
import stz/params
;<doc>=======================================================
;=================== Test Syntax ============================
;============================================================
Surface Syntax:
deftest(tag1 tag2) name :
... body ...
;============================================================
;=======================================================<doc>
public defstruct DefTestStruct :
name: DefTestName
tags: List
body
public deftype DefTestName
public defstruct LiteralName <: DefTestName : (name)
public defstruct ComputedName <: DefTestName : (exp)
;<doc>=======================================================
;=================== Assertion Syntax =======================
;============================================================
Surface Syntax:
#ASSERT(x == y)
;============================================================
;=======================================================<doc>
defsyntax tests :
import (exp4, id!, exp$, :!, exp!) from core
;----------------------------------------------------------
;---------------- DefTest Macro ---------------------------
;----------------------------------------------------------
defrule exp4 = (deftest ?tags:#tags? ?name:#name #:! ?body:#exp!) :
if flag-defined?(`TESTING) :
val compiled = compile(DefTestStruct(name, tags, body))
parse-syntax[core + current-overlays / #exp!](compiled)
else :
`($do stz/test-framework/empty-body)
defproduction tags? : List
defrule tags? = ((@do ?tags:#id! ...)) : tags
defrule tags? = () : List()
defproduction name : DefTestName
defrule name = ((?exp:#exp$)) : ComputedName(exp)
defrule name = (?name:#id!) : LiteralName(name)
;----------------------------------------------------------
;---------------- Assertion Macro -------------------------
;----------------------------------------------------------
defrule exp4 = (~ #ASSERT(?exp:#exp$)) :
val compiled = compile-assert(closest-info(), exp)
parse-syntax[core + current-overlays / #exp!](compiled)
;============================================================
;==================== DefTest Compilation ===================
;============================================================
defn compile (s:DefTestStruct) :
defn compile-name (name:DefTestName) :
match(name) :
(name:LiteralName) : to-string(/name(name))
(name:ComputedName) : exp(name)
defn compile-main () :
val template = `(
run-test $ new DefTest :
defmethod name (this) :
test-name
defmethod tags (this) :
`test-tags
defmethod run (this) :
test-body)
fill-template(template, [
`run-test => `stz/test-framework/run-test
`DefTest => `stz/test-framework/DefTest
`name => `stz/test-framework/name
`run => `stz/test-framework/run
`tags => `stz/test-framework/tags
`test-name => compile-name(name(s))
`test-tags => tags(s)
`test-body => body(s)])
compile-main()
;============================================================
;================= Assertion Compilation ====================
;============================================================
deftype AssertionExp
defstruct AssertionCall <: AssertionExp :
func: AssertionExp
targs: List
args: List<AssertionExp>
defstruct AssertionInfix <: AssertionExp :
op: Symbol
func: AssertionExp
arg1: AssertionExp
arg2: AssertionExp
defstruct AssertionVar <: AssertionExp :
name
defstruct AssertionLiteral <: AssertionExp :
value
defstruct AssertionUnknown <: AssertionExp :
exp
defstruct AssertionArg <: AssertionExp :
index: Int
defn compile-assert (info:FileInfo|False, exp) :
;Parse the expression
val aexp = parse-assertion-exp(exp)
;Extract the values
val letexp = extract-values(aexp)
;Return a Stanza expression for evaluating
;the given AssertionExp.
defn compile-exp (e:AssertionExp, values:Tuple|False) :
let loop (e:AssertionExp = e) :
match(e) :
(e:AssertionCall) :
if empty?(targs(e)) :
substitute(`(func(args)), [
`func => loop(func(e))
`args => splice(map(loop,args(e)))])
else :
substitute(`(func<targs>(args)), [
`func => loop(func(e))
`targs => splice(targs(e))
`args => splice(map(loop,args(e)))])
(e:AssertionInfix) :
substitute(`(func(arg1, arg2)), [
`func => loop(func(e))
`arg1 => loop(arg1(e))
`arg2 => loop(arg2(e))])
(e:AssertionVar) :
name(e)
(e:AssertionLiteral) :
value(e)
(e:AssertionUnknown) :
/exp(e)
(e:AssertionArg) :
(values as Tuple)[index(e)]
;Compile pulled out values
defn compile-values (tmps:Tuple<Symbol>, exps:Tuple<AssertionExp>) :
nested $ to-tuple $
for (tmp in tmps, exp in exps) seq :
val def = substitute(`(val tmp = exp), [
`tmp => tmp
`exp => compile-exp(exp,false)])
val value = tmp
val description = description-string(exp)
[`def => def
`value => value
`value-description => description]
;Compile info
defn compile-info (info:FileInfo|False) :
match(info:FileInfo) :
substitute(`(core/FileInfo(file, line, col)), [
`file => filename(info)
`line => line(info)
`col => column(info)])
;Compile main assertion
defn compile-main () :
;Form temporaries for each value
val value-tmps = map(gensym{`tmp}, values(letexp))
val template = `(
let :
let-values{def}
assert $ new Assertion :
defmethod run (this) :
assertion-body upcast-as core/True|core/False
defmethod description (this) :
assertion-description
defmethod info (this) :
assertion-info
defmethod values (this) :
[let-values{AssertionValue(value-description, value)}])
fill-template(template, [
`let-values => compile-values(value-tmps, values(letexp))
`assertion-body => compile-exp(/exp(letexp), value-tmps)
`assertion-description => description-string?(aexp)
`assertion-info => compile-info(info)
`assert => `stz/test-framework/assert
`Assertion => `stz/test-framework/Assertion
`run => `stz/test-framework/run
`description => `stz/test-framework/description
`info => `stz/test-framework/info
`values => `stz/test-framework/values
`AssertionValue => `stz/test-framework/AssertionValue])
;Launch!
compile-main()
defn parse-assertion-exp (form) :
match-syntax[core](List(form)) :
(($do ($of ?func ?targs ...) ?args ...)) :
val func* = parse-assertion-exp(func)
val args* = map(parse-assertion-exp, args)
AssertionCall(func*, targs, args*)
(($do ?func ?args ...)) :
val func* = parse-assertion-exp(func)
val args* = map(parse-assertion-exp, args)
if length(args*) == 2 :
switch(unwrap-token(func)) :
`equal? : AssertionInfix(`==, func*, args*[0], args*[1])
`not-equal? : AssertionInfix(`!=, func*, args*[0], args*[1])
`less? : AssertionInfix(`<, func*, args*[0], args*[1])
`less-eq? : AssertionInfix(`<=, func*, args*[0], args*[1])
`greater? : AssertionInfix(`>, func*, args*[0], args*[1])
`greater-eq? : AssertionInfix(`>=, func*, args*[0], args*[1])
else : AssertionCall(func*, List(), args*)
else : AssertionCall(func*, List(), args*)
(($quote ?x)) :
AssertionLiteral(form)
(?v:#id) :
AssertionVar(v)
(?v) :
if unwrap-token(v) is Char|Byte|Int|Long|Float|Double|String|True|False : AssertionLiteral(v)
else : AssertionUnknown(form)
defn any-unknown? (e:AssertionExp) :
match(e) :
(e:AssertionCall) :
any-unknown?(func(e)) or
any?(any-unknown?, args(e))
(e:AssertionInfix) :
any-unknown?(func(e)) or
any-unknown?(arg1(e)) or
any-unknown?(arg2(e))
(e:AssertionVar):
false
(e:AssertionLiteral) :
false
(e:AssertionUnknown) :
true
defn description-string? (e:AssertionExp) :
description-string(e) when not any-unknown?(e)
defn description-string (e:AssertionExp) :
defn format (e:AssertionExp) :
match(e) :
(e:AssertionCall) :
val targ-str = "" when empty?(targs(e))
else "<%,>" % [targs(e)]
"%_%_(%,)" % [format(func(e)), targ-str, seq(format,args(e))]
(e:AssertionInfix) :
"%_ %_ %_" % [format(arg1(e)), op(e), format(arg2(e))]
(e:AssertionVar) :
name(e)
(e:AssertionLiteral) :
value(e)
(e:AssertionUnknown) :
fatal("Unknown form")
to-string(format(e))
defstruct LetValues :
values: Tuple<AssertionExp>
exp: AssertionExp
defn extract-values (e:AssertionExp) :
;Accumulate all extracted expressions
val values = Vector<AssertionExp>()
;Extract expression only if it is appropriate to be
;displayed separately.
defn extract? (e:AssertionExp) :
;Do not extract if we cannot extract a string description.
if any-unknown?(e) :
e
else :
;Do not extract if it is a trivial literal.
match(e:AssertionLiteral) :
e
else :
;Otherwise extract.
add(values, e)
AssertionArg(length(values) - 1)
;Recursively extract all subexpressions.
val exp* = match(e) :
(e:AssertionCall) : AssertionCall(func(e), targs(e), map(extract?,args(e)))
(e:AssertionInfix) : AssertionInfix(op(e), func(e), extract?(arg1(e)), extract?(arg2(e)))
(e) : e
;Form extracted structure
LetValues(to-tuple(values), exp*)
|
{
"pile_set_name": "Github"
}
|
require("@fatso83/mini-mocha").install();
const sinon = require("sinon");
const referee = require("@sinonjs/referee");
const assert = referee.assert;
describe("stub", function() {
it("should add a custom behavior", function() {
sinon.addBehavior("returnsNum", function(fake, n) {
fake.returns(n);
});
const stub = sinon.stub().returnsNum(42);
assert.equals(stub(), 42);
});
});
|
{
"pile_set_name": "Github"
}
|
<root>
<styles>
<include src="s2r://panorama/styles/dotastyles.vcss_c" />
<include src="s2r://panorama/styles/tooltips/battle_pass_activities/tooltip_battle_pass_arcana_vote.vcss_c" />
</styles>
<Panel>
<Label class="Title" text="#DOTA_BattlePass_ArcanaVoteTooltip_Title" />
<Panel class="MainContents">
<Panel id="VotesLoading" class="VotingState">
<Panel class="Spinner" />
</Panel>
<Panel id="VotesFailedToLoad" class="VotingState">
<Label text="#DOTAArcanaVote_FailedToLoad" />
</Panel>
<Panel id="VotingNotStarted" class="VotingState">
<Label text="#DOTAArcanaVote_NotStarted" />
</Panel>
<Panel id="VotingActive" class="VotingState">
<Label class="MostContestedLabel" text="#DOTA_TI6_BattlePass_ArcanaVoteMostContested" />
<Panel class="MostContested">
<DOTAHeroMovie id="Hero0Movie" />
<DOTAHeroMovie id="Hero1Movie" />
</Panel>
<Label class="CurrentVotes" text="#DOTAArcanaVote_VotesRemainingFull" />
</Panel>
<Panel id="VotingFinishedHidden" class="VotingState">
<Label text="#DOTAArcanaVote_ResultsHidden" />
</Panel>
<Panel id="VotingFinishedRevealed" class="VotingState">
<Panel class="VotingStateCenter">
<DOTAHeroMovie id="HeroWinnerMovie" />
<Label text="#DOTAArcanaVote_WinnerTitle" />
</Panel>
</Panel>
</Panel>
</Panel>
</root>
|
{
"pile_set_name": "Github"
}
|
> * 原文地址:[Building A Node.js Express API To Convert Markdown To HTML](https://www.smashingmagazine.com/2019/04/nodejs-express-api-markdown-html/)
> * 原文作者:[Sameer Borate](https://www.smashingmagazine.com/author/sameer-borate)
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner)
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/TODO1/nodejs-express-api-markdown-html.md](https://github.com/xitu/gold-miner/blob/master/TODO1/nodejs-express-api-markdown-html.md)
> * 译者:[Baddyo](https://github.com/Baddyo)
> * 校对者:[fireairforce](https://github.com/fireairforce), [JackEggie](https://github.com/JackEggie)
# 化 Markdown 为 HTML:用 Node.js 和 Express 搭建接口
> 快速摘要:搭建一个把 Markdown 语法转换为 HTML 的应用,通过该实践来学习如何使用 Node.js 和 Express 框架创建接口端点。
Markdown 是一种轻量级的文本标记语言,能将带标记的文本转换为各种格式。发明 Markdown 的初衷,是为了让人们能“用易读易写的纯文本格式来书写”,并可以按需转换为有效的 XHTML(或者 HTML)。目前,随着 WordPress 的支持,Markdown 语法越来越流行了。
本文旨在向读者展示如何用 Node.js 和 Express 框架创建接口端点。我们会搭建一个将 Markdown 转换为 HTML 的应用,在搭建过程中学习 Node.js 和 Express。我们还会给接口添加验证机制,以防我们的应用被滥用。
### 一个基于 Node.js 的 Markdown 应用
我们把这个小巧玲珑的应用叫做 “Markdown 转换器”,我们把 Markdown 语法的文本上传给它,然后得到 HTML 格式的版本。该应用使用 Node.js 的框架 Express 实现,并支持对转换请求的验证。
我们会化整为零地实现这个应用 —— 先用 Express 创建一个基本框架,然后再添加验证机制等功能。那就让我们开始搭建基本框架吧!
### 第一阶段:初始化 Express
假设你已经在操作系统里安装了 Node.js,现在我们创建一个文件夹(就叫它 “`markdown-api`” 吧)来存放代码,并进入该文件夹:
```bash
$ mkdir markdown-api
$ cd markdown-api
```
使用 npm init 命令创建一个 **package.json** 文件。该命令会提示你输入诸如应用名称、版本之类的信息。
就本次实践来说,你只需按下 Enter 键使用那些默认信息就好。我把 **index.js** 做为默认入口文件,但你也可以按自己喜好设置成 **app.js** 或别的文件。
现在我们在 `markdown-api` 目录下安装 Express,并将其列入依赖包列表:
```bash
$ npm install express --save
```
在当前目录(`markdown-api`)创建一个 **index.js** 文件,把下列代码添加进去来测试 Express 框架是否安装成功:
```javascript
const express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hello World!');
});
app.listen(3000);
```
访问 `http://localhost:3000` ,看看测试文件是否成功运行起来了。如果一切顺利,我们能在浏览器中看到 “Hello World!” 字样,那接下来就可以构建 Markdown 转 HTML 的基本接口了。
### 第二阶段:构建基本接口
该接口的主要作用是把 Markdown 转为 HTML,它将有两个端点:
* `/login`
* `/convert`
`login` 端点用来验证有效请求;`convert` 端点用来进行 Markdown 到 HTML 的转换。
以下是调用两个端点的基本接口代码。调用 `login` 会返回一个 “Authenticated” 字符串,而调用 `convert` 会返回你上传的 Markdown 文本。主方法仅返回一个 “Hello World!” 字符串。
```javascript
const express = require("express");
const bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.get('/', function(req, res){
res.send('Hello World!');
});
app.post('/login', function(req, res) {
res.send("Authenticated");
},
);
app.post("/convert", function(req, res, next) {
console.log(req.body);
if(typeof req.body.content == 'undefined' || req.body.content == null) {
res.json(["error", "No data found"]);
} else {
res.json(["markdown", req.body.content]);
}
});
app.listen(3000, function() {
console.log("Server running on port 3000");
});
```
我们使用中间件 `body-parser` 来辅助解析收到的请求。该中间件将解析结果放在 `req.body` 属性中供你使用。虽说不借助中间件也能解析请求,但那样就太麻烦了。
用 npm 就可以安装 `body-parser`:
```javascript
$ npm install body-parser
```
现在万事俱备,我们得用 Postman 测试一下。先简单介绍一下 Postman 吧。
#### Postman 简介
Postman 是一种接口开发工具,使用其网页版或者桌面客户端(网页版下架了)可以极为方便地搭建、修改以及测试接口端点。它可以生成各种类型的 HTTP 请求,例如 GET、POST、PUT 和 PATCH。Postman 支持 Windows、macOS 和 Linux。
来一睹 Postman 的风采吧:
[](https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/462c5b77-18e5-498d-a06e-f59276859c4f/nodejs-express-api-markdown-html-postman-intro.png)
([高清大图](https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/462c5b77-18e5-498d-a06e-f59276859c4f/nodejs-express-api-markdown-html-postman-intro.png))
要想调用一个接口端点,你需要遵循以下步骤:
1. 在顶部的地址栏输入目标 URL;
2. 在地址栏左侧选择 HTTP 方法;
3. 点击“发送”按钮。
Postman 会把请求发送给应用,取得响应信息并显示在界面下方的窗口中。这就是 Postman 的基本用法。在我们的应用中,我们还要给请求添加其他参数,这一块内容后面会说到。
### 使用 Postman
大概熟悉了 Postman 之后,我们就要实际使用它了。
用命令行启动 `markdown-api` 应用:
```bash
$ node index.js
```
为了测试基本接口代码,我们要用 Postman 调用接口。注意,我们用 POST 方法把要转换的文本传给应用。
我们的应用通过 POST 方法的 `content` 参数接收待转换的文本。我们把它作为 URL 编码格式传递。字符串以 JSON 的格式返回 —— 第一个字段总会返回字符串 `markdown`,而第二个字段返回转换后的文本。然后,当我们添加了 Markdown 处理代码,它就会返回转换后的文本。
### 第三阶段:添加 Markdown 转换代码
应用的基本框架搭建好了,我们就来看看 `showdown` 这个 JavaScript 库,我们要用此库把 Markdown 转换为 HTML。`showdown` 是用 JavaScript语言实现的,支持 Markdown 和 HTML 之间的双向转换。
[](https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/7634b6ea-e153-48cc-8001-67c21e08e3ac/nodejs-express-api-markdown-html-base-postman-test.png)
([高清大图](https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/7634b6ea-e153-48cc-8001-67c21e08e3ac/nodejs-express-api-markdown-html-base-postman-test.png))
用 npm 安装 `showdown`:
```bash
$ npm install showdown
```
添加所需的 showdown 代码后,我们的代码应该是这样的:
```javascript
const express = require("express");
const bodyParser = require('body-parser');
const showdown = require('showdown');
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
converter = new showdown.Converter();
app.get('/', function(req, res){
res.send('Hello World!');
});
app.post('/login', function(req, res) {
res.send("Authenticated");
},
);
app.post("/convert", function(req, res, next) {
if(typeof req.body.content == 'undefined' || req.body.content == null) {
res.json(["error", "No data found"]);
} else {
text = req.body.content;
html = converter.makeHtml(text);
res.json(["markdown", html]);
}
});
app.listen(3000, function() {
console.log("Server running on port 3000");
});
```
转换格式的核心代码在 `/convert` 端点中,如下所示。这段代码会把你上传的 Markdown 文本转换为 HTML 版本,并返回 JSON 格式的结果。
```javascript
...
} else {
text = req.body.content;
html = converter.makeHtml(text);
res.json(["markdown", html]);
}
```
`converter.makeHtml(text)` 就是负责转换的方法。用 `setOption` 方法可以对转换过程进行各种配置:
```javascript
converter.setOption('optionKey', 'value');
```
例如,可以配置成自动插入特定的 URL 而不用任何标记。
```javascript
converter.setOption('simplifiedAutoLink', 'true');
```
在 Postman 的例子中,如果我们把 `simplifiedAutoLink` 的值配置为 `true`,传一个简单的字符串(例如 `Google home http://www.google.com/`)时就会返回如下结果:
```html
<p>Google home <a href="http://www.google.com/">http://www.google.com/</a></p>
```
否则,要实现相同效果,我们必须要添加标记信息才行:
```markup
Google home <http://www.google.com/>
```
还有很多配置项可以控制 Markdown 的转换过程。你可以在[这里](https://www.npmjs.com/package/showdown)找到完整的配置项列表。
现在,我们实现了一个能将 Markdown 转为 HTML 的“转换器”端点。让我们继续深入来添加验证功能吧。
### 第四阶段:用 Passport 实现接口验证功能
不给接口添加恰当的验证机制就把它扔出去给别人使用,就是在鼓励使用者无限制地使用你的接口。这会招致某些无耻之徒滥用接口,蜂拥而至的请求会拖垮你的服务器。为了避免这样的局面,我们必须给接口添加恰当的验证机制。
我们将用 Passport 包来实现验证机制。正如之前用到的 `body-parser` 中间件一样,Passport 是一个基于 Node.js 的验证中间件。使用它的原因在于,它支持各种验证机制(用户名和密码验证、Facebook 账号验证、Twitter 账号验证等等),这样我们可以灵活选择验证方式。添加 Passport 中间件很简单,无需更改过多代码。
用 npm 安装 Passport:
```bash
$ npm install passport
```
我们还要使用 `local` 策略来进行验证,稍后我会详细说明。因此要把 `passport-local` 也安装上。
```bash
$ npm install passport-local
```
你还需要编码/解码模块 JWT(JSON Web Token):
```bash
$ npm install jwt-simple
```
#### Passport 中的策略
Passport 中间件使用策略的概念来验证请求。这里所谓的策略就是一系列方法,它们帮你验证各种请求,从简单的用户名密码验证,到开放授权验证(Facebook 或 Twitter 账号验证),再到 OpenID 验证,皆可胜任。一个应用所使用的验证策略需要预先配置才能去验证请求。
在我们自己的应用中,我们会用个简单的用户名密码验证方案,这样便于理解和编码。目前,Passport 支持超过 300 种验证策略。
虽然 Passport 的设计很复杂,但实际使用却很简单。下面的例子就展示了 `/convert` 端点如何添加验证机制。如你所见,轻而易举。
```javascript
app.post("/convert",
passport.authenticate('local',{ session: false, failWithError: true }),
function(req, res, next) {
// 若此函数被调用,说明验证成功。
// 请求内容为空与否。
if(typeof req.body.content == 'undefined' || req.body.content == null) {
res.json(["error", "No data found"]);
} else {
text = req.body.content;
html = converter.makeHtml(text);
res.json(["markdown", html]);
}},
// 验证失败,返回 “Unauthorized” 字样
function(err, req, res, next) {
return res.status(401).send({ success: false, message: err })
});
```
现在,除了要转换的 Markdown 字符串,我们还要发送用户名和密码,与应用的用户名密码比对验证。因为我们使用的是本地验证策略,验证凭证就会存储在代码本身中。
可能这样的验证手段看起来太简陋了,但对于一个 demo 级别的应用来说已经足够。简单的例子也有助于我们理解验证过程。顺便说一句,有种常见的安全措施是把凭证存到环境变量中。当然,很多人对这种方式不以为然,但我觉得这是个相对安全的方法。
验证功能的完整示例如下:
```javascript
const express = require("express");
const showdown = require('showdown');
const bodyParser = require('body-parser');
const passport = require('passport');
const jwt = require('jwt-simple');
const LocalStrategy = require('passport-local').Strategy;
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
converter = new showdown.Converter();
const ADMIN = 'admin';
const ADMIN_PASSWORD = 'smagazine';
const SECRET = 'secret#4456';
passport.use(new LocalStrategy(function(username, password, done) {
if (username === ADMIN && password === ADMIN_PASSWORD) {
done(null, jwt.encode({ username }, SECRET));
return;
}
done(null, false);
}));
app.get('/', function(req, res){
res.send('Hello World!');
});
app.post('/login', passport.authenticate('local',{ session: false }),
function(req, res) {
// 若此函数被调用,说明验证成功。
// 返回 “Authenticated” 字样。
res.send("Authenticated");
});
app.post("/convert",
passport.authenticate('local',{ session: false, failWithError: true }),
function(req, res, next) {
// 若此函数被调用,说明验证成功。
// 请求内容为空与否。
if(typeof req.body.content == 'undefined' || req.body.content == null) {
res.json(["error", "No data found"]);
} else {
text = req.body.content;
html = converter.makeHtml(text);
res.json(["markdown", html]);
}},
// 验证失败,返回 “Unauthorized” 字样
function(err, req, res, next) {
return res.status(401).send({ success: false, message: err })
});
app.listen(3000, function() {
console.log("Server running on port 3000");
});
```
一个带验证的 Postman 会话如下所示:
[](https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/ae32fa60-d46d-4065-8966-b5e9ce0b32b9/nodejs-express-api-markdown-html-base-postman-auth.png)
用 Postman 测试最终应用([高清大图](https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/ae32fa60-d46d-4065-8966-b5e9ce0b32b9/nodejs-express-api-markdown-html-base-postman-auth.png))
在此可见,我们上传了一段 Markdown 语法的文本,然后得到了经过正确转换的 HTML 版本的结果。我们只是测试了一行文本,但这个接口是有转换大段文本的能力的。
这就是我们此次对 Node.js 和 Express 的浅尝 —— 搭建一个接口端点。构建接口是一个复杂的课题,在你想构建一个接口的时候,有些细节你应该清楚,但时间有限,很抱歉不能在本文中展开了,但可能会在后续文章中详细探讨。
### 在其他应用中访问我们的接口
既然已经搭建好了接口,那我们就可以写一个基于 Node.js 的小脚本来证明接口可用。在本例中,我们需要安装 `request` 包以便于发送 HTTP 请求。(很可能你已经安装过了)
```bash
$ npm install request --save
```
下面所示代码向我们的接口发送了一个请求,并得到了响应。如你所见,`request` 包大大简化了步骤。待转换的 Markdown 文本存放于 `textToConvert` 变量中。
在运行下列脚本之前,你要确保接口应用已经处于运行状态。你需要在另外的命令窗口中运行脚本。
**注意:在变量 `textToConvert` 中,我们使用了 “ ` ” 符号来包裹多行 JavaScript 代码,它不是单引号哦。**
```javascript
var Request = require("request");
// Markdown 文本的开头
var textToConvert = `Heading
=======
## Sub-heading
Paragraphs are separated
by a blank line.
Two spaces at the end of a line
produces a line break.
Text attributes _italic_,
**bold**, 'monospace'.
A [link](http://example.com).
Horizontal rule:`;
// Markdown 文本的结尾
Request.post({
"headers": { "content-type": "application/json" },
"url": "http://localhost:3000/convert",
"body": JSON.stringify({
"content": textToConvert,
"username": "admin",
"password": "smagazine"
})
}, function(error, response, body){
// 连接失败时,退出。
if(error) {
return console.log(error);
}
// 显示转换后的文本
console.dir(JSON.parse(body));
});
```
当发送 POST 请求到接口时,我们需要提供要转换的 Markdown 文本和身份凭证。如果凭证错误,我们会收到错误提示信息。
```javascript
{
success: false,
message: {
name: 'AuthenticationError',
message: 'Unauthorized',
status: 401
}
}
```
对于一个验证通过的请求,上述 Markdown 样例会被转换为如下格式:
```html
[ 'markdown',
`<h1 id="heading">Heading</h1>
<h2 id="subheading">Sub-heading</h2>
<p>Paragraphs are separated by a blank line.</p>
<p>Two spaces at the end of a line<br />
produces a line break.</p>
<p>Text attributes <em>italic</em>,
<strong>bold</strong>, 'monospace'.
A <a href="http://example.com">link</a>.
Horizontal rule:</p>` ]
```
在例子中我们刻意写了一段 Markdown 文本,实际情况中的文本可能来自文件、web 表单等多种来源。但请求过程都是一样的。
注意:当我们使用 `application/json` 格式发送请求时,我们需要用 JSON 格式解析响应体,故而要调用 `JSON.stringify` 函数。如你所见,测试或者接口应用仅需一个小例子,在此不赘述。
### 总结
在本文中,我们以学习使用 Node.js 和 Express 框架搭建接口为目的组织了一次教程。与其漫无目的地做一些没意思的应用,不如搭建一个把 Markdown 转换为 HTML 的接口,这才算是有用的实践。通过整个过程的实践,我们学会了给接口端点添加验证机制,还学会了用 Postman 测试应用的几种方式。
> 如果发现译文存在错误或其他需要改进的地方,欢迎到 [掘金翻译计划](https://github.com/xitu/gold-miner) 对译文进行修改并 PR,也可获得相应奖励积分。文章开头的 **本文永久链接** 即为本文在 GitHub 上的 MarkDown 链接。
---
> [掘金翻译计划](https://github.com/xitu/gold-miner) 是一个翻译优质互联网技术文章的社区,文章来源为 [掘金](https://juejin.im) 上的英文分享文章。内容覆盖 [Android](https://github.com/xitu/gold-miner#android)、[iOS](https://github.com/xitu/gold-miner#ios)、[前端](https://github.com/xitu/gold-miner#前端)、[后端](https://github.com/xitu/gold-miner#后端)、[区块链](https://github.com/xitu/gold-miner#区块链)、[产品](https://github.com/xitu/gold-miner#产品)、[设计](https://github.com/xitu/gold-miner#设计)、[人工智能](https://github.com/xitu/gold-miner#人工智能)等领域,想要查看更多优质译文请持续关注 [掘金翻译计划](https://github.com/xitu/gold-miner)、[官方微博](http://weibo.com/juejinfanyi)、[知乎专栏](https://zhuanlan.zhihu.com/juejinfanyi)。
|
{
"pile_set_name": "Github"
}
|
import { Component, Injectable, NgModule } from '@angular/core';
import { Shallow } from '../shallow';
////// Module Setup //////
@Component({
template: '<h1>Step</h1>',
selector: 'step',
})
class StepComponent {}
@Injectable()
class StepService {
getSteps() {
return [StepComponent];
}
}
@Component({
selector: 'step-display',
template: `
<div *ngFor="let step of stepService.getSteps()">
<ng-template *ngComponentOutlet="step"></ng-template>
</div>
`,
})
class StepDisplayComponent {
constructor(public stepService: StepService) {}
}
@NgModule({
declarations: [StepDisplayComponent, StepComponent],
providers: [StepService],
entryComponents: [StepComponent],
})
class StepModule {}
//////////////////////////
describe('component with ngComponentOutlet and entry component', () => {
let shallow: Shallow<StepDisplayComponent>;
@Component({ selector: 'dummy-step-one', template: '<i></i>' })
class DummyStepOne {}
@Component({ selector: 'dummy-step-two', template: '<i></i>' })
class DummyStepTwo {}
beforeEach(() => {
shallow = new Shallow(StepDisplayComponent, StepModule)
.declare(DummyStepOne, DummyStepTwo)
.dontMock(DummyStepOne, DummyStepTwo)
.mock(StepService, { getSteps: () => [DummyStepOne, DummyStepTwo] });
});
it('renders dynamic steps', async () => {
const { find } = await shallow.render();
expect(find(DummyStepOne)).toHaveFoundOne();
expect(find(DummyStepTwo)).toHaveFoundOne();
});
});
|
{
"pile_set_name": "Github"
}
|
4
4
4
10
6
2
8
0
2
4
37
6
2
6
2
18
6
6
8
13
13
2
10
4
6
4
2
4
15
42
2
6
6
2
27
6
6
4
28
6
17
4
8
25
23
27
4
2
4
29
41
4
13
4
6
15
4
12
12
4
2
9
60
2
4
2
4
2
19
4
4
27
4
4
2
30
4
10
2
4
4
4
4
2
6
4
34
2
4
6
2
2
8
4
4
2
8
6
2
15
10
6
6
46
8
4
4
2
6
4
10
6
2
8
0
4
4
4
4
27
4
6
4
6
10
46
8
4
2
29
2
0
8
4
2
6
2
27
4
10
2
27
2
6
6
15
2
10
2
2
24
6
0
29
4
2
6
6
4
4
4
4
14
4
4
9
8
2
6
4
6
4
2
8
10
4
8
8
6
2
35
21
27
6
8
6
4
2
6
6
8
6
2
6
47
41
8
4
50
19
0
4
10
8
6
4
4
6
2
2
8
6
8
8
2
2
45
6
11
10
14
2
2
6
8
4
8
27
4
33
6
10
4
2
2
6
8
10
2
19
4
27
4
8
2
8
2
2
2
39
15
15
2
18
4
7
13
0
19
34
2
21
12
13
32
2
30
7
2
6
6
8
6
8
10
6
4
13
8
12
2
10
6
6
12
9
17
6
|
{
"pile_set_name": "Github"
}
|
Introduction
============
.. include:: ../README.rst
:start-after: include:introduction/start
|
{
"pile_set_name": "Github"
}
|
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-20
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 35144820bcc25444bb8f0fd767d9423e
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2000 - 2007, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Produce stack trace
#include <stdint.h> // for uintptr_t
#include "utilities.h" // for OS_* macros
#if !defined(OS_WINDOWS)
#include <unistd.h>
#include <sys/mman.h>
#endif
#include <stdio.h> // for NULL
#include "stacktrace.h"
_START_GOOGLE_NAMESPACE_
// Given a pointer to a stack frame, locate and return the calling
// stackframe, or return NULL if no stackframe can be found. Perform sanity
// checks (the strictness of which is controlled by the boolean parameter
// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned.
template<bool STRICT_UNWINDING>
static void **NextStackFrame(void **old_sp) {
void **new_sp = (void **) *old_sp;
// Check that the transition from frame pointer old_sp to frame
// pointer new_sp isn't clearly bogus
if (STRICT_UNWINDING) {
// With the stack growing downwards, older stack frame must be
// at a greater address that the current one.
if (new_sp <= old_sp) return NULL;
// Assume stack frames larger than 100,000 bytes are bogus.
if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return NULL;
} else {
// In the non-strict mode, allow discontiguous stack frames.
// (alternate-signal-stacks for example).
if (new_sp == old_sp) return NULL;
// And allow frames upto about 1MB.
if ((new_sp > old_sp)
&& ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return NULL;
}
if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return NULL;
#ifdef __i386__
// On 64-bit machines, the stack pointer can be very close to
// 0xffffffff, so we explicitly check for a pointer into the
// last two pages in the address space
if ((uintptr_t)new_sp >= 0xffffe000) return NULL;
#endif
#if !defined(OS_WINDOWS)
if (!STRICT_UNWINDING) {
// Lax sanity checks cause a crash in 32-bit tcmalloc/crash_reason_test
// on AMD-based machines with VDSO-enabled kernels.
// Make an extra sanity check to insure new_sp is readable.
// Note: NextStackFrame<false>() is only called while the program
// is already on its last leg, so it's ok to be slow here.
static int page_size = getpagesize();
void *new_sp_aligned = (void *)((uintptr_t)new_sp & ~(page_size - 1));
if (msync(new_sp_aligned, page_size, MS_ASYNC) == -1)
return NULL;
}
#endif
return new_sp;
}
// If you change this function, also change GetStackFrames below.
int GetStackTrace(void** result, int max_depth, int skip_count) {
void **sp;
#ifdef __i386__
// Stack frame format:
// sp[0] pointer to previous frame
// sp[1] caller address
// sp[2] first argument
// ...
sp = (void **)&result - 2;
#endif
#ifdef __x86_64__
// __builtin_frame_address(0) can return the wrong address on gcc-4.1.0-k8
unsigned long rbp;
// Move the value of the register %rbp into the local variable rbp.
// We need 'volatile' to prevent this instruction from getting moved
// around during optimization to before function prologue is done.
// An alternative way to achieve this
// would be (before this __asm__ instruction) to call Noop() defined as
// static void Noop() __attribute__ ((noinline)); // prevent inlining
// static void Noop() { asm(""); } // prevent optimizing-away
__asm__ volatile ("mov %%rbp, %0" : "=r" (rbp));
// Arguments are passed in registers on x86-64, so we can't just
// offset from &result
sp = (void **) rbp;
#endif
int n = 0;
while (sp && n < max_depth) {
if (*(sp+1) == (void *)0) {
// In 64-bit code, we often see a frame that
// points to itself and has a return address of 0.
break;
}
if (skip_count > 0) {
skip_count--;
} else {
result[n++] = *(sp+1);
}
// Use strict unwinding rules.
sp = NextStackFrame<true>(sp);
}
return n;
}
_END_GOOGLE_NAMESPACE_
|
{
"pile_set_name": "Github"
}
|
@TestOn('browser')
import 'dart:async';
import 'package:over_react/over_react.dart';
import 'package:over_react/over_react_redux.dart';
import 'package:over_react_test/over_react_test.dart';
import 'package:test/test.dart';
import 'package:time/time.dart';
import 'package:todo_client/src/actions.dart';
import 'package:todo_client/src/components/app.dart';
import 'package:todo_client/src/components/user_list_item.dart';
import 'package:todo_client/src/models/user.dart';
import 'fixtures/utils.dart';
main() {
initializeComponentTests();
group('ConnectedUserListItem', () {
Ref<TodoAppComponent> appRef;
UserListItemComponent component;
User model;
setUp(() {
initializeTestStore();
appRef = createRef();
mount((ReduxProvider()..store = testStore)(
(TodoApp()..ref = appRef)(),
));
final appComponent = appRef.current;
model = testStore.state.users.first;
component = getComponentByTestId(appComponent, 'todo_client.UserListItem.${model.id}');
expect(component, isA<UserListItemComponent>(), reason: 'test setup sanity check');
});
tearDown(() {
appRef = null;
component = null;
model = null;
});
bool userShouldAppearSelected() => testStore.state.selectedUserIds.contains(model.id);
bool userShouldAppearHighlighted() => testStore.state.highlightedUserIds.contains(model.id);
bool userShouldBeEditable() => testStore.state.editableUserIds.contains(model.id);
group('renders a UserListItem', () {
group('with prop callbacks mapped to the expected Redux action', () {
group('involving selection:', () {
Future<Null> selectUser() async {
expect(component.props.isSelected, isFalse, reason: 'test setup sanity check');
component.props.onSelect(model.id);
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(component.props.isSelected, isTrue);
}
test('props.onSelect => SelectUserAction', selectUser);
test('props.onDeselect => DeselectUserAction', () async {
await selectUser();
component.redrawCount = 0;
component.props.onDeselect(model.id);
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(component.props.isSelected, isFalse);
});
});
group('involving editability:', () {
Future<Null> makeUserEditable() async {
expect(component.props.isEditable, isFalse, reason: 'test setup sanity check');
component.props.onBeginEdit(model.id);
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(component.props.isEditable, isTrue);
}
test('props.onBeginEdit => BeginEditUserAction', makeUserEditable);
test('props.onFinishEdit => FinishEditUserAction', () async {
await makeUserEditable();
component.redrawCount = 0;
component.props.onFinishEdit(model.id);
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(component.props.isEditable, isFalse);
});
});
group('involving model CRUD:', () {
test('props.onModelUpdate => UpdateUserAction', () async {
const newName = 'Something Else';
component.props.onModelUpdate(User.from(model)..name = newName);
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(component.props.model.name, newName);
});
test('props.onRemove => RemoveUserAction', () async {
final todoRemovedCompleter = Completer<Null>();
testStore.onChange.listen((newState) {
todoRemovedCompleter.complete();
});
component.props.onRemove(model.id);
await todoRemovedCompleter.future.timeout(10.milliseconds);
expect(getByTestId(appRef.current, 'todo_client.UserListItem.${model.id}'), isNull);
});
});
});
group('with props.isSelected mapped to AppState.selectedUserIds', () {
test('initially', () {
expect(component.props.isSelected, userShouldAppearSelected());
});
test('when AppState.selectedUserIds is updated', () async {
final wasSelected = userShouldAppearSelected();
if (!wasSelected) {
testStore.dispatch(SelectUserAction(model.id));
} else {
testStore.dispatch(DeselectUserAction(model.id));
}
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(wasSelected, !userShouldAppearSelected());
expect(component.props.isSelected, userShouldAppearSelected());
});
});
group('with props.isEditable mapped to AppState.editableUserIds', () {
test('initially', () {
expect(component.props.isEditable, userShouldBeEditable());
});
test('when AppState.selectedUserIds is updated', () async {
final wasEditable = userShouldBeEditable();
if (!wasEditable) {
testStore.dispatch(BeginEditUserAction(model.id));
} else {
testStore.dispatch(FinishEditUserAction(model.id));
}
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(wasEditable, !userShouldBeEditable());
expect(component.props.isEditable, userShouldBeEditable());
});
});
group('with props.isHighlighted mapped to AppState.editableUserIds', () {
test('initially', () {
expect(component.props.isHighlighted, userShouldAppearHighlighted());
});
test('when AppState.selectedUserIds is updated', () async {
final wasHighlighted = userShouldAppearHighlighted();
if (!wasHighlighted) {
testStore.dispatch(HighlightUsersAction([model.id]));
} else {
testStore.dispatch(UnHighlightUsersAction([model.id]));
}
final redrawCount = await component.didRedraw().future.timeout(20.milliseconds);
expect(redrawCount, 1);
expect(wasHighlighted, !userShouldAppearHighlighted());
expect(component.props.isHighlighted, userShouldAppearHighlighted());
});
});
});
});
}
|
{
"pile_set_name": "Github"
}
|
/* $Id: hisax.h,v 2.64.2.4 2004/02/11 13:21:33 keil Exp $
*
* Basic declarations, defines and prototypes
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/major.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/isdnif.h>
#include <linux/tty.h>
#include <linux/serial_reg.h>
#include <linux/netdevice.h>
#define ERROR_STATISTIC
#define REQUEST 0
#define CONFIRM 1
#define INDICATION 2
#define RESPONSE 3
#define HW_ENABLE 0x0000
#define HW_RESET 0x0004
#define HW_POWERUP 0x0008
#define HW_ACTIVATE 0x0010
#define HW_DEACTIVATE 0x0018
#define HW_INFO1 0x0010
#define HW_INFO2 0x0020
#define HW_INFO3 0x0030
#define HW_INFO4 0x0040
#define HW_INFO4_P8 0x0040
#define HW_INFO4_P10 0x0048
#define HW_RSYNC 0x0060
#define HW_TESTLOOP 0x0070
#define CARD_RESET 0x00F0
#define CARD_INIT 0x00F2
#define CARD_RELEASE 0x00F3
#define CARD_TEST 0x00F4
#define CARD_AUX_IND 0x00F5
#define PH_ACTIVATE 0x0100
#define PH_DEACTIVATE 0x0110
#define PH_DATA 0x0120
#define PH_PULL 0x0130
#define PH_TESTLOOP 0x0140
#define PH_PAUSE 0x0150
#define MPH_ACTIVATE 0x0180
#define MPH_DEACTIVATE 0x0190
#define MPH_INFORMATION 0x01A0
#define DL_ESTABLISH 0x0200
#define DL_RELEASE 0x0210
#define DL_DATA 0x0220
#define DL_FLUSH 0x0224
#define DL_UNIT_DATA 0x0230
#define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
#define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
#define MDL_ASSIGN 0x0280
#define MDL_REMOVE 0x0284
#define MDL_ERROR 0x0288
#define MDL_INFO_SETUP 0x02E0
#define MDL_INFO_CONN 0x02E4
#define MDL_INFO_REL 0x02E8
#define CC_SETUP 0x0300
#define CC_RESUME 0x0304
#define CC_MORE_INFO 0x0310
#define CC_IGNORE 0x0320
#define CC_REJECT 0x0324
#define CC_SETUP_COMPL 0x0330
#define CC_PROCEEDING 0x0340
#define CC_ALERTING 0x0344
#define CC_PROGRESS 0x0348
#define CC_CONNECT 0x0350
#define CC_CHARGE 0x0354
#define CC_NOTIFY 0x0358
#define CC_DISCONNECT 0x0360
#define CC_RELEASE 0x0368
#define CC_SUSPEND 0x0370
#define CC_PROCEED_SEND 0x0374
#define CC_REDIR 0x0378
#define CC_T302 0x0382
#define CC_T303 0x0383
#define CC_T304 0x0384
#define CC_T305 0x0385
#define CC_T308_1 0x0388
#define CC_T308_2 0x038A
#define CC_T309 0x0309
#define CC_T310 0x0390
#define CC_T313 0x0393
#define CC_T318 0x0398
#define CC_T319 0x0399
#define CC_TSPID 0x03A0
#define CC_NOSETUP_RSP 0x03E0
#define CC_SETUP_ERR 0x03E1
#define CC_SUSPEND_ERR 0x03E2
#define CC_RESUME_ERR 0x03E3
#define CC_CONNECT_ERR 0x03E4
#define CC_RELEASE_ERR 0x03E5
#define CC_RESTART 0x03F4
#define CC_TDSS1_IO 0x13F4 /* DSS1 IO user timer */
#define CC_TNI1_IO 0x13F5 /* NI1 IO user timer */
/* define maximum number of possible waiting incoming calls */
#define MAX_WAITING_CALLS 2
#ifdef __KERNEL__
extern const char *CardType[];
extern int nrcards;
extern const char *l1_revision;
extern const char *l2_revision;
extern const char *l3_revision;
extern const char *lli_revision;
extern const char *tei_revision;
/* include l3dss1 & ni1 specific process structures, but no other defines */
#ifdef CONFIG_HISAX_EURO
#define l3dss1_process
#include "l3dss1.h"
#undef l3dss1_process
#endif /* CONFIG_HISAX_EURO */
#ifdef CONFIG_HISAX_NI1
#define l3ni1_process
#include "l3ni1.h"
#undef l3ni1_process
#endif /* CONFIG_HISAX_NI1 */
#define MAX_DFRAME_LEN 260
#define MAX_DFRAME_LEN_L1 300
#define HSCX_BUFMAX 4096
#define MAX_DATA_SIZE (HSCX_BUFMAX - 4)
#define MAX_DATA_MEM (HSCX_BUFMAX + 64)
#define RAW_BUFMAX (((HSCX_BUFMAX*6)/5) + 5)
#define MAX_HEADER_LEN 4
#define MAX_WINDOW 8
#define MAX_MON_FRAME 32
#define MAX_DLOG_SPACE 2048
#define MAX_BLOG_SPACE 256
/* #define I4L_IRQ_FLAG SA_INTERRUPT */
#define I4L_IRQ_FLAG 0
/*
* Statemachine
*/
struct FsmInst;
typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);
struct Fsm {
FSMFNPTR *jumpmatrix;
int state_count, event_count;
char **strEvent, **strState;
};
struct FsmInst {
struct Fsm *fsm;
int state;
int debug;
void *userdata;
int userint;
void (*printdebug) (struct FsmInst *, char *, ...);
};
struct FsmNode {
int state, event;
void (*routine) (struct FsmInst *, int, void *);
};
struct FsmTimer {
struct FsmInst *fi;
struct timer_list tl;
int event;
void *arg;
};
struct L3Timer {
struct l3_process *pc;
struct timer_list tl;
int event;
};
#define FLG_L1_ACTIVATING 1
#define FLG_L1_ACTIVATED 2
#define FLG_L1_DEACTTIMER 3
#define FLG_L1_ACTTIMER 4
#define FLG_L1_T3RUN 5
#define FLG_L1_PULL_REQ 6
#define FLG_L1_UINT 7
struct Layer1 {
void *hardware;
struct BCState *bcs;
struct PStack **stlistp;
unsigned long Flags;
struct FsmInst l1m;
struct FsmTimer timer;
void (*l1l2) (struct PStack *, int, void *);
void (*l1hw) (struct PStack *, int, void *);
void (*l1tei) (struct PStack *, int, void *);
int mode, bc;
int delay;
};
#define GROUP_TEI 127
#define TEI_SAPI 63
#define CTRL_SAPI 0
#define PACKET_NOACK 7
/* Layer2 Flags */
#define FLG_LAPB 0
#define FLG_LAPD 1
#define FLG_ORIG 2
#define FLG_MOD128 3
#define FLG_PEND_REL 4
#define FLG_L3_INIT 5
#define FLG_T200_RUN 6
#define FLG_ACK_PEND 7
#define FLG_REJEXC 8
#define FLG_OWN_BUSY 9
#define FLG_PEER_BUSY 10
#define FLG_DCHAN_BUSY 11
#define FLG_L1_ACTIV 12
#define FLG_ESTAB_PEND 13
#define FLG_PTP 14
#define FLG_FIXED_TEI 15
#define FLG_L2BLOCK 16
struct Layer2 {
int tei;
int sap;
int maxlen;
u_long flag;
spinlock_t lock;
u_int vs, va, vr;
int rc;
unsigned int window;
unsigned int sow;
struct sk_buff *windowar[MAX_WINDOW];
struct sk_buff_head i_queue;
struct sk_buff_head ui_queue;
void (*l2l1) (struct PStack *, int, void *);
void (*l2l3) (struct PStack *, int, void *);
void (*l2tei) (struct PStack *, int, void *);
struct FsmInst l2m;
struct FsmTimer t200, t203;
int T200, N200, T203;
int debug;
char debug_id[16];
};
struct Layer3 {
void (*l3l4) (struct PStack *, int, void *);
void (*l3ml3) (struct PStack *, int, void *);
void (*l3l2) (struct PStack *, int, void *);
struct FsmInst l3m;
struct FsmTimer l3m_timer;
struct sk_buff_head squeue;
struct l3_process *proc;
struct l3_process *global;
int N303;
int debug;
char debug_id[8];
};
struct LLInterface {
void (*l4l3) (struct PStack *, int, void *);
int (*l4l3_proto) (struct PStack *, isdn_ctrl *);
void *userdata;
u_long flag;
};
#define FLG_LLI_L1WAKEUP 1
#define FLG_LLI_L2WAKEUP 2
struct Management {
int ri;
struct FsmInst tei_m;
struct FsmTimer t202;
int T202, N202, debug;
void (*layer) (struct PStack *, int, void *);
};
#define NO_CAUSE 254
struct Param {
u_char cause;
u_char loc;
u_char diag[6];
int bchannel;
int chargeinfo;
int spv; /* SPV Flag */
setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
u_char moderate; /* transfer mode and rate (bearer octet 4) */
};
struct PStack {
struct PStack *next;
struct Layer1 l1;
struct Layer2 l2;
struct Layer3 l3;
struct LLInterface lli;
struct Management ma;
int protocol; /* EDSS1, 1TR6 or NI1 */
/* protocol specific data fields */
union
{ u_char uuuu; /* only as dummy */
#ifdef CONFIG_HISAX_EURO
dss1_stk_priv dss1; /* private dss1 data */
#endif /* CONFIG_HISAX_EURO */
#ifdef CONFIG_HISAX_NI1
ni1_stk_priv ni1; /* private ni1 data */
#endif /* CONFIG_HISAX_NI1 */
} prot;
};
struct l3_process {
int callref;
int state;
struct L3Timer timer;
int N303;
int debug;
struct Param para;
struct Channel *chan;
struct PStack *st;
struct l3_process *next;
ulong redir_result;
/* protocol specific data fields */
union
{ u_char uuuu; /* only when euro not defined, avoiding empty union */
#ifdef CONFIG_HISAX_EURO
dss1_proc_priv dss1; /* private dss1 data */
#endif /* CONFIG_HISAX_EURO */
#ifdef CONFIG_HISAX_NI1
ni1_proc_priv ni1; /* private ni1 data */
#endif /* CONFIG_HISAX_NI1 */
} prot;
};
struct hscx_hw {
int hscx;
int rcvidx;
int count; /* Current skb sent count */
u_char *rcvbuf; /* B-Channel receive Buffer */
u_char tsaxr0;
u_char tsaxr1;
};
struct w6692B_hw {
int bchan;
int rcvidx;
int count; /* Current skb sent count */
u_char *rcvbuf; /* B-Channel receive Buffer */
};
struct isar_reg {
unsigned long Flags;
volatile u_char bstat;
volatile u_char iis;
volatile u_char cmsb;
volatile u_char clsb;
volatile u_char par[8];
};
struct isar_hw {
int dpath;
int rcvidx;
int txcnt;
int mml;
u_char state;
u_char cmd;
u_char mod;
u_char newcmd;
u_char newmod;
char try_mod;
struct timer_list ftimer;
u_char *rcvbuf; /* B-Channel receive Buffer */
u_char conmsg[16];
struct isar_reg *reg;
};
struct hdlc_stat_reg {
#ifdef __BIG_ENDIAN
u_char fill;
u_char mode;
u_char xml;
u_char cmd;
#else
u_char cmd;
u_char xml;
u_char mode;
u_char fill;
#endif
} __attribute__((packed));
struct hdlc_hw {
union {
u_int ctrl;
struct hdlc_stat_reg sr;
} ctrl;
u_int stat;
int rcvidx;
int count; /* Current skb sent count */
u_char *rcvbuf; /* B-Channel receive Buffer */
};
struct hfcB_hw {
unsigned int *send;
int f1;
int f2;
};
struct tiger_hw {
u_int *send;
u_int *s_irq;
u_int *s_end;
u_int *sendp;
u_int *rec;
int free;
u_char *rcvbuf;
u_char *sendbuf;
u_char *sp;
int sendcnt;
u_int s_tot;
u_int r_bitcnt;
u_int r_tot;
u_int r_err;
u_int r_fcs;
u_char r_state;
u_char r_one;
u_char r_val;
u_char s_state;
};
struct amd7930_hw {
u_char *tx_buff;
u_char *rv_buff;
int rv_buff_in;
int rv_buff_out;
struct sk_buff *rv_skb;
struct hdlc_state *hdlc_state;
struct work_struct tq_rcv;
struct work_struct tq_xmt;
};
#define BC_FLG_INIT 1
#define BC_FLG_ACTIV 2
#define BC_FLG_BUSY 3
#define BC_FLG_NOFRAME 4
#define BC_FLG_HALF 5
#define BC_FLG_EMPTY 6
#define BC_FLG_ORIG 7
#define BC_FLG_DLEETX 8
#define BC_FLG_LASTDLE 9
#define BC_FLG_FIRST 10
#define BC_FLG_LASTDATA 11
#define BC_FLG_NMD_DATA 12
#define BC_FLG_FTI_RUN 13
#define BC_FLG_LL_OK 14
#define BC_FLG_LL_CONN 15
#define BC_FLG_FTI_FTS 16
#define BC_FLG_FRH_WAIT 17
#define L1_MODE_NULL 0
#define L1_MODE_TRANS 1
#define L1_MODE_HDLC 2
#define L1_MODE_EXTRN 3
#define L1_MODE_HDLC_56K 4
#define L1_MODE_MODEM 7
#define L1_MODE_V32 8
#define L1_MODE_FAX 9
struct BCState {
int channel;
int mode;
u_long Flag;
struct IsdnCardState *cs;
int tx_cnt; /* B-Channel transmit counter */
struct sk_buff *tx_skb; /* B-Channel transmit Buffer */
struct sk_buff_head rqueue; /* B-Channel receive Queue */
struct sk_buff_head squeue; /* B-Channel send Queue */
int ackcnt;
spinlock_t aclock;
struct PStack *st;
u_char *blog;
u_char *conmsg;
struct timer_list transbusy;
struct work_struct tqueue;
u_long event;
int (*BC_SetStack) (struct PStack *, struct BCState *);
void (*BC_Close) (struct BCState *);
#ifdef ERROR_STATISTIC
int err_crc;
int err_tx;
int err_rdo;
int err_inv;
#endif
union {
struct hscx_hw hscx;
struct hdlc_hw hdlc;
struct isar_hw isar;
struct hfcB_hw hfc;
struct tiger_hw tiger;
struct amd7930_hw amd7930;
struct w6692B_hw w6692;
struct hisax_b_if *b_if;
} hw;
};
struct Channel {
struct PStack *b_st, *d_st;
struct IsdnCardState *cs;
struct BCState *bcs;
int chan;
int incoming;
struct FsmInst fi;
struct FsmTimer drel_timer, dial_timer;
int debug;
int l2_protocol, l2_active_protocol;
int l3_protocol;
int data_open;
struct l3_process *proc;
setup_parm setup; /* from isdnif.h numbers and Serviceindicator */
u_long Flags; /* for remembering action done in l4 */
int leased;
};
struct elsa_hw {
struct pci_dev *dev;
unsigned long base;
unsigned int cfg;
unsigned int ctrl;
unsigned int ale;
unsigned int isac;
unsigned int itac;
unsigned int hscx;
unsigned int trig;
unsigned int timer;
unsigned int counter;
unsigned int status;
struct timer_list tl;
unsigned int MFlag;
struct BCState *bcs;
u_char *transbuf;
u_char *rcvbuf;
unsigned int transp;
unsigned int rcvp;
unsigned int transcnt;
unsigned int rcvcnt;
u_char IER;
u_char FCR;
u_char LCR;
u_char MCR;
u_char ctrl_reg;
};
struct teles3_hw {
unsigned int cfg_reg;
signed int isac;
signed int hscx[2];
signed int isacfifo;
signed int hscxfifo[2];
};
struct teles0_hw {
unsigned int cfg_reg;
void __iomem *membase;
unsigned long phymem;
};
struct avm_hw {
unsigned int cfg_reg;
unsigned int isac;
unsigned int hscx[2];
unsigned int isacfifo;
unsigned int hscxfifo[2];
unsigned int counter;
struct pci_dev *dev;
};
struct ix1_hw {
unsigned int cfg_reg;
unsigned int isac_ale;
unsigned int isac;
unsigned int hscx_ale;
unsigned int hscx;
};
struct diva_hw {
unsigned long cfg_reg;
unsigned long pci_cfg;
unsigned int ctrl;
unsigned long isac_adr;
unsigned int isac;
unsigned long hscx_adr;
unsigned int hscx;
unsigned int status;
struct timer_list tl;
u_char ctrl_reg;
struct pci_dev *dev;
};
struct asus_hw {
unsigned int cfg_reg;
unsigned int adr;
unsigned int isac;
unsigned int hscx;
unsigned int u7;
unsigned int pots;
};
struct hfc_hw {
unsigned int addr;
unsigned int fifosize;
unsigned char cirm;
unsigned char ctmt;
unsigned char cip;
u_char isac_spcr;
struct timer_list timer;
};
struct sedl_hw {
unsigned int cfg_reg;
unsigned int adr;
unsigned int isac;
unsigned int hscx;
unsigned int reset_on;
unsigned int reset_off;
struct isar_reg isar;
unsigned int chip;
unsigned int bus;
struct pci_dev *dev;
};
struct spt_hw {
unsigned int cfg_reg;
unsigned int isac;
unsigned int hscx[2];
unsigned char res_irq;
};
struct mic_hw {
unsigned int cfg_reg;
unsigned int adr;
unsigned int isac;
unsigned int hscx;
};
struct njet_hw {
unsigned long base;
unsigned int isac;
unsigned int auxa;
unsigned char auxd;
unsigned char dmactrl;
unsigned char ctrl_reg;
unsigned char irqmask0;
unsigned char irqstat0;
unsigned char last_is0;
struct pci_dev *dev;
};
struct hfcPCI_hw {
unsigned char cirm;
unsigned char ctmt;
unsigned char conn;
unsigned char mst_m;
unsigned char int_m1;
unsigned char int_m2;
unsigned char int_s1;
unsigned char sctrl;
unsigned char sctrl_r;
unsigned char sctrl_e;
unsigned char trm;
unsigned char stat;
unsigned char fifo;
unsigned char fifo_en;
unsigned char bswapped;
unsigned char nt_mode;
int nt_timer;
struct pci_dev *dev;
unsigned char *pci_io; /* start of PCI IO memory */
dma_addr_t dma; /* dma handle for Fifos */
void *fifos; /* FIFO memory */
int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
struct timer_list timer;
};
struct hfcSX_hw {
unsigned long base;
unsigned char cirm;
unsigned char ctmt;
unsigned char conn;
unsigned char mst_m;
unsigned char int_m1;
unsigned char int_m2;
unsigned char int_s1;
unsigned char sctrl;
unsigned char sctrl_r;
unsigned char sctrl_e;
unsigned char trm;
unsigned char stat;
unsigned char fifo;
unsigned char bswapped;
unsigned char nt_mode;
unsigned char chip;
int b_fifo_size;
unsigned char last_fifo;
void *extra;
int nt_timer;
struct timer_list timer;
};
struct hfcD_hw {
unsigned int addr;
unsigned int bfifosize;
unsigned int dfifosize;
unsigned char cirm;
unsigned char ctmt;
unsigned char cip;
unsigned char conn;
unsigned char mst_m;
unsigned char int_m1;
unsigned char int_m2;
unsigned char int_s1;
unsigned char sctrl;
unsigned char stat;
unsigned char fifo;
unsigned char f1;
unsigned char f2;
unsigned int *send;
struct timer_list timer;
};
struct isurf_hw {
unsigned int reset;
unsigned long phymem;
void __iomem *isac;
void __iomem *isar;
struct isar_reg isar_r;
};
struct saphir_hw {
struct pci_dev *dev;
unsigned int cfg_reg;
unsigned int ale;
unsigned int isac;
unsigned int hscx;
struct timer_list timer;
};
struct bkm_hw {
struct pci_dev *dev;
unsigned long base;
/* A4T stuff */
unsigned long isac_adr;
unsigned int isac_ale;
unsigned long jade_adr;
unsigned int jade_ale;
/* Scitel Quadro stuff */
unsigned long plx_adr;
unsigned long data_adr;
};
struct gazel_hw {
struct pci_dev *dev;
unsigned int cfg_reg;
unsigned int pciaddr[2];
signed int ipac;
signed int isac;
signed int hscx[2];
signed int isacfifo;
signed int hscxfifo[2];
unsigned char timeslot;
unsigned char iom2;
};
struct w6692_hw {
struct pci_dev *dev;
unsigned int iobase;
struct timer_list timer;
};
struct arcofi_msg {
struct arcofi_msg *next;
u_char receive;
u_char len;
u_char msg[10];
};
struct isac_chip {
int ph_state;
u_char *mon_tx;
u_char *mon_rx;
int mon_txp;
int mon_txc;
int mon_rxp;
struct arcofi_msg *arcofi_list;
struct timer_list arcofitimer;
wait_queue_head_t arcofi_wait;
u_char arcofi_bc;
u_char arcofi_state;
u_char mocr;
u_char adf2;
};
struct hfcd_chip {
int ph_state;
};
struct hfcpci_chip {
int ph_state;
};
struct hfcsx_chip {
int ph_state;
};
struct w6692_chip {
int ph_state;
};
struct amd7930_chip {
u_char lmr1;
u_char ph_state;
u_char old_state;
u_char flg_t3;
unsigned int tx_xmtlen;
struct timer_list timer3;
void (*ph_command) (struct IsdnCardState *, u_char, char *);
void (*setIrqMask) (struct IsdnCardState *, u_char);
};
struct icc_chip {
int ph_state;
u_char *mon_tx;
u_char *mon_rx;
int mon_txp;
int mon_txc;
int mon_rxp;
struct arcofi_msg *arcofi_list;
struct timer_list arcofitimer;
wait_queue_head_t arcofi_wait;
u_char arcofi_bc;
u_char arcofi_state;
u_char mocr;
u_char adf2;
};
#define HW_IOM1 0
#define HW_IPAC 1
#define HW_ISAR 2
#define HW_ARCOFI 3
#define FLG_TWO_DCHAN 4
#define FLG_L1_DBUSY 5
#define FLG_DBUSY_TIMER 6
#define FLG_LOCK_ATOMIC 7
#define FLG_ARCOFI_TIMER 8
#define FLG_ARCOFI_ERROR 9
#define FLG_HW_L1_UINT 10
struct IsdnCardState {
spinlock_t lock;
u_char typ;
u_char subtyp;
int protocol;
u_int irq;
u_long irq_flags;
u_long HW_Flags;
int *busy_flag;
int chanlimit; /* limited number of B-chans to use */
int logecho; /* log echo if supported by card */
union {
struct elsa_hw elsa;
struct teles0_hw teles0;
struct teles3_hw teles3;
struct avm_hw avm;
struct ix1_hw ix1;
struct diva_hw diva;
struct asus_hw asus;
struct hfc_hw hfc;
struct sedl_hw sedl;
struct spt_hw spt;
struct mic_hw mic;
struct njet_hw njet;
struct hfcD_hw hfcD;
struct hfcPCI_hw hfcpci;
struct hfcSX_hw hfcsx;
struct ix1_hw niccy;
struct isurf_hw isurf;
struct saphir_hw saphir;
struct bkm_hw ax;
struct gazel_hw gazel;
struct w6692_hw w6692;
struct hisax_d_if *hisax_d_if;
} hw;
int myid;
isdn_if iif;
spinlock_t statlock;
u_char *status_buf;
u_char *status_read;
u_char *status_write;
u_char *status_end;
u_char (*readisac) (struct IsdnCardState *, u_char);
void (*writeisac) (struct IsdnCardState *, u_char, u_char);
void (*readisacfifo) (struct IsdnCardState *, u_char *, int);
void (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
void (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
void (*BC_Send_Data) (struct BCState *);
int (*cardmsg) (struct IsdnCardState *, int, void *);
void (*setstack_d) (struct PStack *, struct IsdnCardState *);
void (*DC_Close) (struct IsdnCardState *);
irq_handler_t irq_func;
int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
struct Channel channel[2+MAX_WAITING_CALLS];
struct BCState bcs[2+MAX_WAITING_CALLS];
struct PStack *stlist;
struct sk_buff_head rq, sq; /* D-channel queues */
int cardnr;
char *dlog;
int debug;
union {
struct isac_chip isac;
struct hfcd_chip hfcd;
struct hfcpci_chip hfcpci;
struct hfcsx_chip hfcsx;
struct w6692_chip w6692;
struct amd7930_chip amd7930;
struct icc_chip icc;
} dc;
u_char *rcvbuf;
int rcvidx;
struct sk_buff *tx_skb;
int tx_cnt;
u_long event;
struct work_struct tqueue;
struct timer_list dbusytimer;
unsigned int irq_cnt;
#ifdef ERROR_STATISTIC
int err_crc;
int err_tx;
int err_rx;
#endif
};
#define schedule_event(s, ev) do {test_and_set_bit(ev, &s->event);schedule_work(&s->tqueue); } while(0)
#define MON0_RX 1
#define MON1_RX 2
#define MON0_TX 4
#define MON1_TX 8
#ifdef ISDN_CHIP_ISAC
#undef ISDN_CHIP_ISAC
#endif
#ifdef CONFIG_HISAX_16_0
#define CARD_TELES0 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_TELES0 0
#endif
#ifdef CONFIG_HISAX_16_3
#define CARD_TELES3 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_TELES3 0
#endif
#ifdef CONFIG_HISAX_TELESPCI
#define CARD_TELESPCI 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_TELESPCI 0
#endif
#ifdef CONFIG_HISAX_AVM_A1
#define CARD_AVM_A1 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_AVM_A1 0
#endif
#ifdef CONFIG_HISAX_AVM_A1_PCMCIA
#define CARD_AVM_A1_PCMCIA 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_AVM_A1_PCMCIA 0
#endif
#ifdef CONFIG_HISAX_FRITZPCI
#define CARD_FRITZPCI 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_FRITZPCI 0
#endif
#ifdef CONFIG_HISAX_ELSA
#define CARD_ELSA 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_ELSA 0
#endif
#ifdef CONFIG_HISAX_IX1MICROR2
#define CARD_IX1MICROR2 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_IX1MICROR2 0
#endif
#ifdef CONFIG_HISAX_DIEHLDIVA
#define CARD_DIEHLDIVA 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_DIEHLDIVA 0
#endif
#ifdef CONFIG_HISAX_ASUSCOM
#define CARD_ASUSCOM 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_ASUSCOM 0
#endif
#ifdef CONFIG_HISAX_TELEINT
#define CARD_TELEINT 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_TELEINT 0
#endif
#ifdef CONFIG_HISAX_SEDLBAUER
#define CARD_SEDLBAUER 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_SEDLBAUER 0
#endif
#ifdef CONFIG_HISAX_SPORTSTER
#define CARD_SPORTSTER 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_SPORTSTER 0
#endif
#ifdef CONFIG_HISAX_MIC
#define CARD_MIC 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_MIC 0
#endif
#ifdef CONFIG_HISAX_NETJET
#define CARD_NETJET_S 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_NETJET_S 0
#endif
#ifdef CONFIG_HISAX_HFCS
#define CARD_HFCS 1
#else
#define CARD_HFCS 0
#endif
#ifdef CONFIG_HISAX_HFC_PCI
#define CARD_HFC_PCI 1
#else
#define CARD_HFC_PCI 0
#endif
#ifdef CONFIG_HISAX_HFC_SX
#define CARD_HFC_SX 1
#else
#define CARD_HFC_SX 0
#endif
#ifdef CONFIG_HISAX_NICCY
#define CARD_NICCY 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_NICCY 0
#endif
#ifdef CONFIG_HISAX_ISURF
#define CARD_ISURF 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_ISURF 0
#endif
#ifdef CONFIG_HISAX_S0BOX
#define CARD_S0BOX 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_S0BOX 0
#endif
#ifdef CONFIG_HISAX_HSTSAPHIR
#define CARD_HSTSAPHIR 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_HSTSAPHIR 0
#endif
#ifdef CONFIG_HISAX_BKM_A4T
#define CARD_BKM_A4T 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_BKM_A4T 0
#endif
#ifdef CONFIG_HISAX_SCT_QUADRO
#define CARD_SCT_QUADRO 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_SCT_QUADRO 0
#endif
#ifdef CONFIG_HISAX_GAZEL
#define CARD_GAZEL 1
#ifndef ISDN_CHIP_ISAC
#define ISDN_CHIP_ISAC 1
#endif
#else
#define CARD_GAZEL 0
#endif
#ifdef CONFIG_HISAX_W6692
#define CARD_W6692 1
#ifndef ISDN_CHIP_W6692
#define ISDN_CHIP_W6692 1
#endif
#else
#define CARD_W6692 0
#endif
#ifdef CONFIG_HISAX_NETJET_U
#define CARD_NETJET_U 1
#ifndef ISDN_CHIP_ICC
#define ISDN_CHIP_ICC 1
#endif
#ifndef HISAX_UINTERFACE
#define HISAX_UINTERFACE 1
#endif
#else
#define CARD_NETJET_U 0
#endif
#ifdef CONFIG_HISAX_ENTERNOW_PCI
#define CARD_FN_ENTERNOW_PCI 1
#else
#define CARD_FN_ENTERNOW_PCI 0
#endif
#define TEI_PER_CARD 1
/* L1 Debug */
#define L1_DEB_WARN 0x01
#define L1_DEB_INTSTAT 0x02
#define L1_DEB_ISAC 0x04
#define L1_DEB_ISAC_FIFO 0x08
#define L1_DEB_HSCX 0x10
#define L1_DEB_HSCX_FIFO 0x20
#define L1_DEB_LAPD 0x40
#define L1_DEB_IPAC 0x80
#define L1_DEB_RECEIVE_FRAME 0x100
#define L1_DEB_MONITOR 0x200
#define DEB_DLOG_HEX 0x400
#define DEB_DLOG_VERBOSE 0x800
#define L2FRAME_DEBUG
#ifdef L2FRAME_DEBUG
extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir);
#endif
#include "hisax_cfg.h"
void init_bcstate(struct IsdnCardState *cs, int bc);
void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs);
void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st);
void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st);
void setstack_l1_B(struct PStack *st);
void setstack_tei(struct PStack *st);
void setstack_manager(struct PStack *st);
void setstack_isdnl2(struct PStack *st, char *debug_id);
void releasestack_isdnl2(struct PStack *st);
void setstack_transl2(struct PStack *st);
void releasestack_transl2(struct PStack *st);
void lli_writewakeup(struct PStack *st, int len);
void setstack_l3dc(struct PStack *st, struct Channel *chanp);
void setstack_l3bc(struct PStack *st, struct Channel *chanp);
void releasestack_isdnl3(struct PStack *st);
u_char *findie(u_char * p, int size, u_char ie, int wanted_set);
int getcallref(u_char * p);
int newcallref(void);
int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
void FsmFree(struct Fsm *fsm);
int FsmEvent(struct FsmInst *fi, int event, void *arg);
void FsmChangeState(struct FsmInst *fi, int newstate);
void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
void *arg, int where);
void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
void *arg, int where);
void FsmDelTimer(struct FsmTimer *ft, int where);
int jiftime(char *s, long mark);
int HiSax_command(isdn_ctrl * ic);
int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
__attribute__((format(printf, 3, 4)))
void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
__attribute__((format(printf, 3, 0)))
void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
void HiSax_reportcard(int cardnr, int sel);
int QuickHex(char *txt, u_char * p, int cnt);
void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
void iecpy(u_char * dest, u_char * iestart, int ieoffset);
#endif /* __KERNEL__ */
/*
* Busywait delay for `jiffs' jiffies
*/
#define HZDELAY(jiffs) do { \
int tout = jiffs; \
\
while (tout--) { \
int loops = USEC_PER_SEC / HZ; \
while (loops--) \
udelay(1); \
} \
} while (0)
int ll_run(struct IsdnCardState *cs, int addfeatures);
int CallcNew(void);
void CallcFree(void);
int CallcNewChan(struct IsdnCardState *cs);
void CallcFreeChan(struct IsdnCardState *cs);
int Isdnl1New(void);
void Isdnl1Free(void);
int Isdnl2New(void);
void Isdnl2Free(void);
int Isdnl3New(void);
void Isdnl3Free(void);
void init_tei(struct IsdnCardState *cs, int protocol);
void release_tei(struct IsdnCardState *cs);
char *HiSax_getrev(const char *revision);
int TeiNew(void);
void TeiFree(void);
#ifdef CONFIG_PCI
#include <linux/pci.h>
/* adaptation wrapper for old usage
* WARNING! This is unfit for use in a PCI hotplug environment,
* as the returned PCI device can disappear at any moment in time.
* Callers should be converted to use pci_get_device() instead.
*/
static inline struct pci_dev *hisax_find_pci_device(unsigned int vendor,
unsigned int device,
struct pci_dev *from)
{
struct pci_dev *pdev;
pci_dev_get(from);
pdev = pci_get_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from);
pci_dev_put(pdev);
return pdev;
}
#endif
|
{
"pile_set_name": "Github"
}
|
using System;
using System.IO;
using System.Diagnostics;
using SCG = System.Collections.Generic;
using Nemerle.Assertions;
using Nemerle.Collections;
using Nemerle.Compiler;
using Nemerle.Compiler.Parsetree;
using Nemerle.Compiler.Utils.Async;
using Nemerle.Imperative;
using Nemerle.Surround;
using Nemerle.Utility;
using Nemerle.Compiler.Utils;
using Typed = Nemerle.Compiler.Typedtree;
using SR = System.Reflection;
using Nemerle.Completion2;
namespace Nemerle.Completion2
{
internal partial class Engine
{
public BeginGetInheritorsGotoInfo(source : IIdeSource, line : int, col : int) : GotoInfoAsyncRequest
{
def request = GotoInfoAsyncRequest(AsyncRequestType.GetGotoInfo, this, source, GetInheritorsGotoInfo, line, col, GotoKind.Definition);
request.GotoInfos = array(0);
AsyncWorker.AddWork(request);
request
}
public GetInheritorsGotoInfo(source : IIdeSource, line : int, col : int) : array[GotoInfo]
{
def request = BeginGetInheritorsGotoInfo(source, line, col);
_ = request.AsyncWaitHandle.WaitOne(10000);
request.GotoInfos
}
private GetInheritorsGotoInfo(request : AsyncRequest) : void
{
AsyncWorker.CheckCurrentThreadIsTheAsyncWorker();
def fileIndex = request.Source.FileIndex;
surroundwith (currentAsyncRequest)
try
{
if (IsBuildTypesTreeInProgress)
AsyncWorker.AddWork(request);
else
{
def project = this.Project;
if (project == null)
{
_ = BeginBuildTypesTree();
AsyncWorker.AddWork(request);
}
else
{
def req = request :> GotoInfoAsyncRequest;
req.GotoInfos = project.GetInheritors(fileIndex, req.Line, req.Column);
request.MarkAsCompleted();
}
}
}
catch
{ | e is CompilationAbortedException =>
def msg = $"The GetGotoInfo operation aborted at: $(e.Message)";
throw CompilationAbortedException(msg, e);
}
}
} // end class Engine
} // end namespace
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Context diff generator for PHP DiffLib.
*
* PHP version 5
*
* Copyright (c) 2009 Chris Boulton <[email protected]>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the Chris Boulton nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @package DiffLib
* @author Chris Boulton <[email protected]>
* @copyright (c) 2009 Chris Boulton
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
* @version 1.1
* @link http://github.com/chrisboulton/php-diff
*/
require_once dirname(__FILE__).'/../Abstract.php';
class Diff_Renderer_Text_Context extends Diff_Renderer_Abstract
{
/**
* @var array Array of the different opcode tags and how they map to the context diff equivalent.
*/
private $tagMap = array(
'insert' => '+',
'delete' => '-',
'replace' => '!',
'equal' => ' '
);
/**
* Render and return a context formatted (old school!) diff file.
*
* @return string The generated context diff.
*/
public function render()
{
$diff = '';
$opCodes = $this->diff->getGroupedOpcodes();
foreach($opCodes as $group) {
$diff .= "***************\n";
$lastItem = count($group)-1;
$i1 = $group[0][1];
$i2 = $group[$lastItem][2];
$j1 = $group[0][3];
$j2 = $group[$lastItem][4];
if($i2 - $i1 >= 2) {
$diff .= '*** '.($group[0][1] + 1).','.$i2." ****\n";
}
else {
$diff .= '*** '.$i2." ****\n";
}
if($j2 - $j1 >= 2) {
$separator = '--- '.($j1 + 1).','.$j2." ----\n";
}
else {
$separator = '--- '.$j2." ----\n";
}
$hasVisible = false;
foreach($group as $code) {
if($code[0] == 'replace' || $code[0] == 'delete') {
$hasVisible = true;
break;
}
}
if($hasVisible) {
foreach($group as $code) {
list($tag, $i1, $i2, $j1, $j2) = $code;
if($tag == 'insert') {
continue;
}
$diff .= $this->tagMap[$tag].' '.implode("\n".$this->tagMap[$tag].' ', $this->diff->GetA($i1, $i2))."\n";
}
}
$hasVisible = false;
foreach($group as $code) {
if($code[0] == 'replace' || $code[0] == 'insert') {
$hasVisible = true;
break;
}
}
$diff .= $separator;
if($hasVisible) {
foreach($group as $code) {
list($tag, $i1, $i2, $j1, $j2) = $code;
if($tag == 'delete') {
continue;
}
$diff .= $this->tagMap[$tag].' '.implode("\n".$this->tagMap[$tag].' ', $this->diff->GetB($j1, $j2))."\n";
}
}
}
return $diff;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* (C) 2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#include <fstream>
#include <iostream>
#include <sstream>
#include <boost/regex.hpp>
#include <botan/botan.h>
#include <botan/eax.h>
using namespace Botan;
namespace {
unsigned from_string(const std::string& s)
{
std::istringstream stream(s);
unsigned n;
stream >> n;
return n;
}
std::string seq(unsigned n)
{
std::string s;
for(unsigned i = 0; i != n; ++i)
{
unsigned char b = (i & 0xFF);
const char bin2hex[] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
s += bin2hex[(b >> 4)];
s += bin2hex[(b & 0x0f)];
}
return s;
}
void eax_test(const std::string& algo,
const std::string& key_str,
const std::string& nonce_str,
const std::string& header_str,
const std::string& tag_str,
const std::string& plaintext_str,
const std::string& ciphertext)
{
/*
printf("EAX(algo=%s key=%s nonce=%s header=%s tag=%s pt=%s ct=%s)\n",
algo.c_str(), key_str.c_str(), nonce_str.c_str(), header_str.c_str(), tag_str.c_str(),
plaintext_str.c_str(), ciphertext.c_str());
*/
SymmetricKey key(key_str);
InitializationVector iv(nonce_str);
EAX_Encryption* enc;
Pipe pipe(new Hex_Decoder,
enc = new EAX_Encryption(get_block_cipher(algo)),
new Hex_Encoder);
enc->set_key(key);
enc->set_iv(iv);
OctetString header(header_str);
enc->set_header(header.begin(), header.length());
pipe.start_msg();
pipe.write(plaintext_str);
pipe.end_msg();
std::string out = pipe.read_all_as_string();
if(out != ciphertext + tag_str)
{
printf("BAD enc %s '%s' != '%s%s'\n", algo.c_str(),
out.c_str(), ciphertext.c_str(), tag_str.c_str());
}
else
printf("OK enc %s\n", algo.c_str());
try
{
EAX_Decryption* dec;
Pipe pipe2(new Hex_Decoder,
dec = new EAX_Decryption(get_block_cipher(algo)),
new Hex_Encoder);
dec->set_key(key);
dec->set_iv(iv);
dec->set_header(header.begin(), header.length());
pipe2.start_msg();
pipe2.write(ciphertext);
pipe2.write(tag_str);
pipe2.end_msg();
std::string out2 = pipe2.read_all_as_string();
if(out2 != plaintext_str)
{
printf("BAD decrypt %s '%s'\n", algo.c_str(), out2.c_str());
}
else
printf("OK decrypt %s\n", algo.c_str());
}
catch(std::exception& e)
{
printf("%s\n", e.what());
}
}
std::pair<std::string, int> translate_algo(const std::string& in)
{
if(in == "aes (16 byte key)")
return std::make_pair("AES-128", 16);
if(in == "blowfish (8 byte key)")
return std::make_pair("Blowfish", 8);
if(in == "rc2 (8 byte key)")
return std::make_pair("RC2", 8);
if(in == "rc5 (8 byte key)")
return std::make_pair("RC5", 8);
if(in == "rc6 (16 byte key)")
return std::make_pair("RC6", 16);
if(in == "safer-sk128 (16 byte key)")
return std::make_pair("SAFER-SK(10)", 16);
if(in == "twofish (16 byte key)")
return std::make_pair("Twofish", 16);
if(in == "des (8 byte key)")
return std::make_pair("DES", 8);
if(in == "3des (24 byte key)")
return std::make_pair("TripleDES", 24);
// These 3 are disabled due to differences in base algorithm.
#if 0
// XTEA: LTC uses little endian, Botan (and Crypto++) use big-endian
// I swapped to LE in XTEA and the vectors did match
if(in == "xtea (16 byte key)")
return std::make_pair("XTEA", 16);
// Skipjack: LTC uses big-endian, Botan (and Crypto++) use
// little-endian I am not sure if that was the full difference
// though, was unable to replicate LTC's EAX vectors with Skipjack
if(in == "skipjack (10 byte key)")
return std::make_pair("Skipjack", 10);
// Noekeon: unknown cause, though LTC's lone test vector does not
// match Botan
if(in == "noekeon (16 byte key)")
return std::make_pair("Noekeon", 16);
#endif
return std::make_pair("", 0);
}
std::string rep(const std::string& s_in, unsigned n)
{
std::string s_out;
for(unsigned i = 0; i != n; ++i)
s_out += s_in[i % s_in.size()];
return s_out;
}
void run_tests(std::istream& in)
{
std::string algo;
std::string key;
while(in.good())
{
std::string line;
std::getline(in, line);
if(line == "")
continue;
if(line.size() > 5 && line.substr(0, 4) == "EAX-")
{
std::pair<std::string, int> name_and_keylen =
translate_algo(line.substr(4));
algo = name_and_keylen.first;
key = seq(name_and_keylen.second);
}
else if(algo != "")
{
boost::regex vec_regex("^([ 0-9]{3}): (.*), (.*)$");
boost::smatch what;
if(boost::regex_match(line, what, vec_regex, boost::match_extra))
{
unsigned n = from_string(what[1]);
std::string ciphertext = what[2];
std::string tag = what[3];
std::string plaintext = seq(n);
std::string header = seq(n);
std::string nonce = seq(n);
eax_test(algo, key, nonce, header, tag,
plaintext, ciphertext);
key = rep(tag, key.size()); // repeat as needed
}
}
}
}
}
int main()
{
std::ifstream in("eax.vec");
Botan::LibraryInitializer init;
if(!in)
{
std::cerr << "Couldn't read input file\n";
return 1;
}
run_tests(in);
}
|
{
"pile_set_name": "Github"
}
|
package io.scalechain.blockchain.proto.codec.messages
import io.scalechain.blockchain.proto.*
import io.scalechain.blockchain.proto.codec.*
import io.scalechain.util.HexUtil.bytes
/**
* <Bitcoin Core Packets Not Captured>
*
* 02 ......... Filter bytes: 2
* b50f ....... Filter: 1010 1101 1111 0000
* 0b000000 ... nHashFuncs: 11
* 00000000 ... nTweak: 0/none
* 00 ......... nFlags: BLOOM_UPDATE_NONE
*
*/
/*
@RunWith(KTestJUnitRunner::class)
class FilterLoadSpec : PayloadTestSuite<FilterLoad> {
val codec = FilterLoadCodec.codec
val payload = bytes(
"""
02
b50f
0b000000
00000000
00
""")
val message = null//FilterLoad()
}
*/
|
{
"pile_set_name": "Github"
}
|
-- 196406 - Back Draft Aura
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warl_back_draft_aura';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(196406, 'spell_warl_back_draft_aura');
DELETE FROM `spell_proc` WHERE `SpellId`=196406;
INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `SpellFamilyMask3`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
(196406, 4, 5, 0, 0x00820000, 0, 0x00400000, 0x00010000, 1, 1, 0, 0, 0, 100, 0, 0);
-- 205184 - Roaring Blaze
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warr_roaring_blaze';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(205184, 'spell_warr_roaring_blaze');
-- 264178 - Demonbolt
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warl_demonbolt';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(264178, 'spell_warl_demonbolt');
-- 265412 - Doom
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warl_doom';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(265412, 'spell_warl_doom');
DELETE FROM `spell_script_names` WHERE `ScriptName` IN (
'spell_warl_soul_shatter', 'spell_warl_shadow_ward', 'spell_warl_soul_swap',
'spell_warl_soul_swap_dot_marker', 'spell_warl_soul_swap_exhale',
'spell_warl_soul_swap_override', 'spell_warl_soulshatter', 'spell_mage_blazing_soul');
-- 198068 - Power Of The Dark Side
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_pri_power_of_the_dark_side';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(198068, 'spell_pri_power_of_the_dark_side');
DELETE FROM `command` WHERE `name`='reload spell_script_names';
INSERT INTO `command` (`name`, `permission`, `help`) VALUES
('reload spell_script_names', 2009, 'Syntax: .reload spell_script_names');
DELETE FROM `spell_script_names` WHERE `ScriptName` IN (
'spell_pri_penance_heal_damage', 'spell_pri_penance_triggered',
'spell_pri_penance', 'spell_pri_purge_the_wicked_selector',
'spell_pri_archangel', 'spell_pri_dark_archangel');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(47750, 'spell_pri_penance_heal_damage'),
(47666, 'spell_pri_penance_heal_damage'),
(47757, 'spell_pri_penance_triggered'),
(47758, 'spell_pri_penance_triggered'),
(47540, 'spell_pri_penance'),
(204215, 'spell_pri_purge_the_wicked_selector'),
(197862, 'spell_pri_archangel'),
(197871, 'spell_pri_dark_archangel');
|
{
"pile_set_name": "Github"
}
|
/*! TACHYONS v4.9.1 | http://tachyons.io */
/*
*
* ________ ______
* ___ __/_____ _________ /______ ______________________
* __ / _ __ `/ ___/_ __ \_ / / / __ \_ __ \_ ___/
* _ / / /_/ // /__ _ / / / /_/ // /_/ / / / /(__ )
* /_/ \__,_/ \___/ /_/ /_/_\__, / \____//_/ /_//____/
* /____/
*
* TABLE OF CONTENTS
*
* 1. External Library Includes
* - Normalize.css | http://normalize.css.github.io
* 2. Tachyons Modules
* 3. Variables
* - Media Queries
* - Colors
* 4. Debugging
* - Debug all
* - Debug children
*
*/
/* External Library Includes */
@import 'tachyons/src/_normalize';
/* Modules */
@import 'tachyons/src/_box-sizing';
@import 'tachyons/src/_aspect-ratios';
@import 'tachyons/src/_images';
@import 'tachyons/src/_background-size';
@import 'tachyons/src/_background-position';
@import 'tachyons/src/_outlines';
@import 'tachyons/src/_borders';
@import 'tachyons/src/_border-colors';
@import 'tachyons/src/_border-radius';
@import 'tachyons/src/_border-style';
@import 'tachyons/src/_border-widths';
@import 'tachyons/src/_box-shadow';
@import 'tachyons/src/_code';
@import 'tachyons/src/_coordinates';
@import 'tachyons/src/_clears';
@import 'tachyons/src/_display';
@import 'tachyons/src/_flexbox';
@import 'tachyons/src/_floats';
@import 'tachyons/src/_font-family';
@import 'tachyons/src/_font-style';
@import 'tachyons/src/_font-weight';
@import 'tachyons/src/_forms';
@import 'tachyons/src/_heights';
@import 'tachyons/src/_letter-spacing';
@import 'tachyons/src/_line-height';
@import 'tachyons/src/_links';
@import 'tachyons/src/_lists';
@import 'tachyons/src/_max-widths';
@import 'tachyons/src/_widths';
@import 'tachyons/src/_overflow';
@import 'tachyons/src/_position';
@import 'tachyons/src/_opacity';
@import 'tachyons/src/_rotations';
@import 'tachyons/src/_skins';
@import 'tachyons/src/_skins-pseudo';
@import 'tachyons/src/_spacing';
@import 'tachyons/src/_negative-margins';
@import 'tachyons/src/_tables';
@import 'tachyons/src/_text-decoration';
@import 'tachyons/src/_text-align';
@import 'tachyons/src/_text-transform';
@import 'tachyons/src/_type-scale';
@import 'tachyons/src/_typography';
@import 'tachyons/src/_utilities';
@import 'tachyons/src/_visibility';
@import 'tachyons/src/_white-space';
@import 'tachyons/src/_vertical-align';
@import 'tachyons/src/_hovers';
@import 'tachyons/src/_z-index';
@import 'tachyons/src/_nested';
@import 'tachyons/src/_styles';
/* Variables */
/* Importing here will allow you to override any variables in the modules */
@import 'tachyons/src/_colors';
@import 'tachyons/src/_media-queries';
/* Debugging */
/* @import 'tachyons/src/_debug-children';
@import 'tachyons/src/_debug-grid'; */
/* Uncomment out the line below to help debug layout issues */
/* @import 'tachyons/src/_debug'; */
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* This file is part of the Eventum (Issue Tracking System) package.
*
* @copyright (c) Eventum Team
* @license GNU General Public License, version 2 or later (GPL-2+)
*
* For the full copyright and license information,
* please see the COPYING and AUTHORS files
* that were distributed with this source code.
*/
require_once __DIR__ . '/../../init.php';
$controller = new Eventum\Controller\Manage\GeneralController();
$controller->run();
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/python
import sys
import xml.etree.ElementTree as ET
arguments = sys.argv[1:]
if len(arguments) == 0:
print 'A utility script for converting TV files from Trick 13 to Trick 15.'
print 'usage: convert_tv_file <files>'
else:
types = (
('Boolean', 'boolean'),
('Byte', 'byte'),
('Double', 'double'),
('Enumeration', 'string'),
('Float', 'float'),
('Integer', 'int'),
('Long', 'long'),
('Short', 'short'),
('String', 'string')
)
for file in arguments:
print 'Converting ' + file
tree = ET.parse(file)
root = tree.getroot()
for variable in root.findall('variable'):
for type in types:
value = variable.find('tv' + type[0])
if value is not None:
value = value.find('value')
value.set('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance')
value.set('xmlns:xs', 'http://www.w3.org/2001/XMLSchema')
value.set('xsi:type', 'xs:' + type[1])
break
if file.endswith('.tv'):
file = file[:-3]
newFile = file + '_15.tv'
tree.write(newFile)
print 'Converted to ' + newFile
|
{
"pile_set_name": "Github"
}
|
use std::f64;
use std::iter::{Skip, Zip};
use std::slice::Iter;
pub trait PairWise<T> {
fn pairwise(&self) -> Zip<Iter<T>, Skip<Iter<T>>>;
}
impl<T> PairWise<T> for [T] {
fn pairwise(&self) -> Zip<Iter<T>, Skip<Iter<T>>> {
self.iter().zip(self.iter().skip(1))
}
}
fn _mean(s: &[f64]) -> f64 {
s.iter().map(|v| v / s.len() as f64).sum()
}
pub fn median(s: &[f64]) -> f64 {
let mut s = s.to_owned();
s.sort_by(|a, b| a.partial_cmp(b).unwrap());
match s.len() % 2 {
0 => (s[(s.len() / 2) - 1] / 2.) + (s[(s.len() / 2)] / 2.),
_ => s[s.len() / 2],
}
}
pub fn quartiles(s: &[f64]) -> (f64, f64, f64) {
if s.len() == 1 {
return (s[0], s[0], s[0]);
}
let mut s = s.to_owned();
s.sort_by(|a, b| a.partial_cmp(b).unwrap());
let (a, b) = if s.len() % 2 == 0 {
s.split_at(s.len() / 2)
} else {
(&s[..(s.len() / 2)], &s[((s.len() / 2) + 1)..])
};
(median(a), median(&s), median(b))
}
/// Given a slice of numbers, return the minimum and maximum values
pub fn range(s: &[f64]) -> (f64, f64) {
let mut min = f64::INFINITY;
let mut max = f64::NEG_INFINITY;
for &v in s {
min = min.min(v);
max = max.max(v);
}
(min, max)
}
/// Floor or ceiling the min or max to zero to avoid them both having the same value
pub fn pad_range_to_zero(min: f64, max: f64) -> (f64, f64) {
if (min - max).abs() < std::f64::EPSILON {
(
if min > 0. { 0. } else { min },
if max < 0. { 0. } else { max },
)
} else {
(min, max)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_pairwise() {
let a = [1, 2, 3, 4, 5];
assert_eq!(a.pairwise().next().unwrap(), (&1, &2));
assert_eq!(a.pairwise().last().unwrap(), (&4, &5));
assert_eq!(a.pairwise().len(), a.len() - 1);
let a = [1, 2];
assert_eq!(a.pairwise().next().unwrap(), (&1, &2));
assert_eq!(a.pairwise().last().unwrap(), (&1, &2));
assert_eq!(a.pairwise().len(), a.len() - 1);
let a = [1];
assert!(a.pairwise().next().is_none());
let b: Vec<f64> = vec![0.0, 0.1, 0.2];
assert_eq!(b.pairwise().next().unwrap(), (&0.0, &0.1));
}
#[test]
fn test_mean() {
// TODO should error: mean(&[]);
assert_eq!(_mean(&[1.]), 1.);
assert_eq!(_mean(&[1., 2.]), 1.5);
assert_eq!(_mean(&[1., 2., 3.]), 2.);
}
#[test]
fn test_median() {
// TODO should error: median(&[]);
assert_eq!(median(&[1.]), 1.);
assert_eq!(median(&[1., 2.]), 1.5);
assert_eq!(median(&[1., 2., 4.]), 2.);
assert_eq!(median(&[1., 2., 3., 7.]), 2.5);
}
#[test]
fn test_quartiles() {
// TODO should error: quartiles(&[]);
assert_eq!(quartiles(&[1.]), (1., 1., 1.));
assert_eq!(quartiles(&[1., 2.]), (1., 1.5, 2.));
assert_eq!(quartiles(&[1., 2., 4.]), (1., 2., 4.));
assert_eq!(quartiles(&[1., 2., 3., 4.]), (1.5, 2.5, 3.5));
}
#[test]
fn test_pad_range_to_zero() {
assert_eq!(pad_range_to_zero(2.0, 2.0), (0.0, 2.0));
assert_eq!(pad_range_to_zero(-2.0, 2.0), (-2.0, 2.0));
assert_eq!(pad_range_to_zero(-2.0, -2.0), (-2.0, 0.0));
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
/**
* Abstract class for query formatter
*
* @author Francois Zaninotto
* @version $Revision$
* @package propel.runtime.formatter
*/
abstract class PropelFormatter
{
protected
$dbName,
$class,
$peer,
$with = array(),
$asColumns = array(),
$hasLimit = false,
$currentObjects = array();
public function __construct(ModelCriteria $criteria = null)
{
if (null !== $criteria) {
$this->init($criteria);
}
}
/**
* Define the hydration schema based on a query object.
* Fills the Formatter's properties using a Criteria as source
*
* @param ModelCriteria $criteria
*
* @return PropelFormatter The current formatter object
*/
public function init(ModelCriteria $criteria)
{
$this->dbName = $criteria->getDbName();
$this->setClass($criteria->getModelName());
$this->setWith($criteria->getWith());
$this->asColumns = $criteria->getAsColumns();
$this->hasLimit = $criteria->getLimit() != 0;
return $this;
}
// DataObject getters & setters
public function setDbName($dbName)
{
$this->dbName = $dbName;
}
public function getDbName()
{
return $this->dbName;
}
public function setClass($class)
{
$this->class = $class;
$this->peer = constant($this->class . '::PEER');
}
public function getClass()
{
return $this->class;
}
public function setPeer($peer)
{
$this->peer = $peer;
}
public function getPeer()
{
return $this->peer;
}
public function setWith($withs = array())
{
$this->with = $withs;
}
public function getWith()
{
return $this->with;
}
public function setAsColumns($asColumns = array())
{
$this->asColumns = $asColumns;
}
public function getAsColumns()
{
return $this->asColumns;
}
public function setHasLimit($hasLimit = false)
{
$this->hasLimit = $hasLimit;
}
public function hasLimit()
{
return $this->hasLimit;
}
/**
* Formats an ActiveRecord object
*
* @param BaseObject $record the object to format
*
* @return BaseObject The original record
*/
public function formatRecord($record = null)
{
return $record;
}
abstract public function format(PDOStatement $stmt);
abstract public function formatOne(PDOStatement $stmt);
abstract public function isObjectFormatter();
public function checkInit()
{
if (null === $this->peer) {
throw new PropelException('You must initialize a formatter object before calling format() or formatOne()');
}
}
public function getTableMap()
{
return Propel::getDatabaseMap($this->dbName)->getTableByPhpName($this->class);
}
protected function isWithOneToMany()
{
foreach ($this->with as $modelWith) {
if ($modelWith->isWithOneToMany()) {
return true;
}
}
return false;
}
/**
* Gets the worker object for the class.
* To save memory, we don't create a new object for each row,
* But we keep hydrating a single object per class.
* The column offset in the row is used to index the array of classes
* As there may be more than one object of the same class in the chain
*
* @param int $col Offset of the object in the list of objects to hydrate
* @param string $class Propel model object class
*
* @return BaseObject
*/
protected function getWorkerObject($col, $class)
{
if(isset($this->currentObjects[$col])) {
$this->currentObjects[$col]->clear();
} else {
$this->currentObjects[$col] = new $class();
}
return $this->currentObjects[$col];
}
/**
* Gets a Propel object hydrated from a selection of columns in statement row
*
* @param array $row associative array indexed by column number,
* as returned by PDOStatement::fetch(PDO::FETCH_NUM)
* @param string $class The classname of the object to create
* @param int $col The start column for the hydration (modified)
*
* @return BaseObject
*/
public function getSingleObjectFromRow($row, $class, &$col = 0)
{
$obj = $this->getWorkerObject($col, $class);
$col = $obj->hydrate($row, $col);
return $obj;
}
}
|
{
"pile_set_name": "Github"
}
|
>Mycoplasma_agalactiae_5632_FP671138_gi|290752420|emb|CBH40391.1|
MSAKSIELNKEKGSVVVEYEFTGEKWTNIFNKTKSNKIKKLKVDGFRPGKAPKHIVDKYVTPVTVASDSI
HEAYNVFADEIFEEVKKQHENALQNAVLLELPVLAEESSVIKIEFPLLPDLSDIKLDESIKTKVAKLKVT
EADIDSYLDELLSKNALLMPLGKKDKTKLGDVVTLKYKGFVNNEPFEGGEADQFDLKLGSKTFIDTFEDQ
LVGKSVGWKGEVNVTFPESYAVPTLKGQPAVFECEILDAKRLEKITLDEKNVKELHLPNVSTIEEAKAYA
KEILTVKKYAEIQRNVIDSLVAELVEKHQFAISDILVATGAQKRLEEIKANLKTQGIKFNDYLDLIKTSE
ADFNKLVLSEEKEVTKRLLVHEELMKQFKDKAEISEENKNLWAINIAFGQQFIPLQFVLQYMKQNPLAEG
EEQNGQFTEAIKEVAITRLILAQLDKKTSEQNDKVALELANKLIKQAEEDIKKFEEEAKKIHEEELAEEA
KKAESKEENK
>Mycoplasma_genitalium_uid97_L43967_gi|3844842|gb|AAC71459.1|
MKLYKVLNSKTTDKSLCLEVEIDPNYWQATQKKLVGEMAKSIKIKGFRPGKIPPNLASQSINKAELMQKS
AQNVMNSIYESVQQEEIVASNDNVIDDYPTIDFKTITEQNCVLLFYFDLIPNFQLPDYKKIKDLTPLTKL
TEAEFNNEIEKLAKTKSTMVDVSDKKLANGDIAIIDFTGIVDNKKLASASAQNYELTIGSNSFIKGFETG
LIAMKVNQKKTLALTFPSDYHVKELQSKPVTFEVVLKAIKKLEFTPMDETNFKSFLPEQFQSFTSLKAFK
SYFHKLMENKKQETILQENNQKIRQFLLTNTKLPFLPEALIKLEANRLLKLQQSQAEQYKIPFEKLLSAS
NITLTELQDRNIKEAKENVTFALVMKKIADIEKIKVDNNKIKAEIENVIAVEYPFASDEMKKQLFFNMEQ
QKEFVESIIINRLTTTKIVSYSTH
>Mycoplasma_hyopneumoniae_AE017243_gi|144227488|gb|AAZ44236.2|
MIKREFLPESAELKIKLTADSKKWAEFYQKAEQKQAAKVSLRGFRKGKVPLEKARAYLNPQAVFELALRM
FLPELEKQAATNIIDSDNVIESPIFNIVNMDKNNLEIEFLYPVYPEIKLPDYKNLKTKFAIKKITKEDIE
LQKQKLLEAKGRFIEVNRPVKIGDVINFNFKGFIDDEPFDGGEGENFDLRIGSNSFIAGFEEQLVGLEIK
KEADIYVTFPENYQVHTYANKKARFRVRINKIKENQPAKLTNEFVASLKIQNVETISQLEVYLENLTERE
NIERAKIDFQRNALTEIGEQVEVPLAKKLINLEIERLNEVFHSTLKQQEIPLKEYLKITKFTEKDIYDQF
EVEAKKLLKNSFIFAEIAKLEGLVPTQQEYESHVEKLAKFTGKSVQEISETVSYNEIQINITNQKVIDKL
IEFNHEAKDEEIVNKNQNDNEIEQDKEQKDNNEEKIKQENNLENK
|
{
"pile_set_name": "Github"
}
|
// +build !linux
package cgroups
|
{
"pile_set_name": "Github"
}
|
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
// See docs in ../ops/data_flow_ops.cc.
#include <deque>
#include <queue>
#include <vector>
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/kernels/priority_queue.h"
#include "tensorflow/core/kernels/queue_base.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/gtl/priority_queue_util.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/types.h"
namespace tensorflow {
PriorityQueue::PriorityQueue(int32 capacity,
const DataTypeVector& component_dtypes,
const std::vector<TensorShape>& component_shapes,
const string& name)
: TypedQueue(capacity, component_dtypes, component_shapes, name) {}
Status PriorityQueue::Initialize() {
Status s = TypedQueue::Initialize();
if (!s.ok()) return s;
mutex_lock lock(mu_);
if (component_dtypes_[0] != DT_INT64) {
return errors::InvalidArgument(
"PriorityQueue priority index component must be type int64, but "
"dtype is: ",
DataTypeString(component_dtypes_[0]));
}
if (specified_shapes() && !TensorShapeUtils::IsScalar(component_shapes_[0])) {
return errors::InvalidArgument(
"PriorityQueue priority index component must be a scalar, but shape "
"is: ",
component_shapes_[0].DebugString());
}
return Status::OK();
}
void PriorityQueue::DequeueLocked(OpKernelContext* ctx, Tuple* tuple) {
DCHECK_GT(queues_[0].size(), 0);
(*tuple).reserve(num_components());
for (int i = 0; i < num_components(); ++i) {
PersistentTensor persistent_tensor = gtl::ConsumeTop(&queues_[i]).second;
(*tuple).push_back(*persistent_tensor.AccessTensor(ctx));
}
}
void PriorityQueue::TryEnqueue(const Tuple& tuple, OpKernelContext* ctx,
DoneCallback callback) {
CancellationManager* cm = ctx->cancellation_manager();
CancellationToken token = cm->get_cancellation_token();
bool already_cancelled;
{
mutex_lock l(mu_);
already_cancelled = !cm->RegisterCallback(
token, [this, cm, token]() { Cancel(kEnqueue, cm, token); });
if (!already_cancelled) {
enqueue_attempts_.emplace_back(
1, callback, ctx, cm, token,
[tuple, this](Attempt* attempt) EXCLUSIVE_LOCKS_REQUIRED(mu_) {
if (closed_) {
attempt->context->SetStatus(
errors::Aborted("PriorityQueue '", name_, "' is closed."));
return kComplete;
}
if (queues_[0].size() < static_cast<size_t>(capacity_)) {
if (!TensorShapeUtils::IsScalar(tuple[0].shape())) {
attempt->context->SetStatus(errors::InvalidArgument(
"Expected the priority element to be a scalar, but "
"received shape: ",
tuple[0].shape().DebugString()));
return kComplete;
}
const int64 priority = tuple[0].scalar<int64>()();
for (int i = 0; i < num_components(); ++i) {
queues_[i].emplace(priority, PersistentTensor(tuple[i]));
}
return kComplete;
} else {
return kNoProgress;
}
});
}
}
if (!already_cancelled) {
FlushUnlocked();
} else {
ctx->SetStatus(errors::Cancelled("Enqueue operation was cancelled"));
callback();
}
}
/* static */
Status PriorityQueue::GetElementComponentFromBatch(
const PriorityQueue::Tuple& tuple, int index, int component,
OpKernelContext* ctx, PersistentTensor* out_tensor) {
TensorShape element_shape(tuple[component].shape());
element_shape.RemoveDim(0);
Tensor* element_access = nullptr;
TF_RETURN_IF_ERROR(ctx->allocate_persistent(
tuple[component].dtype(), element_shape, out_tensor, &element_access));
TF_RETURN_IF_ERROR(
CopySliceToElement(tuple[component], element_access, index));
return Status::OK();
}
void PriorityQueue::TryEnqueueMany(const Tuple& tuple, OpKernelContext* ctx,
DoneCallback callback) {
const int64 batch_size = tuple[0].dim_size(0);
if (batch_size == 0) {
callback();
return;
}
CancellationManager* cm = ctx->cancellation_manager();
CancellationToken token = cm->get_cancellation_token();
bool already_cancelled;
{
mutex_lock l(mu_);
already_cancelled = !cm->RegisterCallback(
token, [this, cm, token]() { Cancel(kEnqueue, cm, token); });
if (!already_cancelled) {
enqueue_attempts_.emplace_back(
batch_size, callback, ctx, cm, token,
[tuple, this, ctx](Attempt* attempt) EXCLUSIVE_LOCKS_REQUIRED(mu_) {
if (closed_) {
attempt->context->SetStatus(
errors::Aborted("PriorityQueue '", name_, "' is closed."));
return kComplete;
}
RunResult result = kNoProgress;
while (queues_[0].size() < static_cast<size_t>(capacity_)) {
result = kProgress;
const int index =
tuple[0].dim_size(0) - attempt->elements_requested;
PersistentTensor priority_element;
attempt->context->SetStatus(GetElementComponentFromBatch(
tuple, index, 0, attempt->context, &priority_element));
if (!attempt->context->status().ok()) return kComplete;
Tensor* priority_tensor = priority_element.AccessTensor(ctx);
if (!TensorShapeUtils::IsScalar(priority_tensor->shape())) {
attempt->context->SetStatus(errors::InvalidArgument(
"Expected the priority element to be a scalar, but "
"received shape: ",
priority_tensor->shape().DebugString()));
return kComplete;
}
const int64 priority = priority_tensor->scalar<int64>()();
for (int i = 0; i < num_components(); ++i) {
PersistentTensor element;
attempt->context->SetStatus(GetElementComponentFromBatch(
tuple, index, i, attempt->context, &element));
if (!attempt->context->status().ok()) return kComplete;
queues_[i].emplace(priority, element);
}
--attempt->elements_requested;
if (attempt->elements_requested == 0) {
return kComplete;
}
}
return result;
});
}
}
if (!already_cancelled) {
FlushUnlocked();
} else {
ctx->SetStatus(errors::Cancelled("Enqueue operation was cancelled"));
callback();
}
}
void PriorityQueue::TryDequeue(OpKernelContext* ctx,
CallbackWithTuple callback) {
CancellationManager* cm = ctx->cancellation_manager();
CancellationToken token = cm->get_cancellation_token();
bool already_cancelled;
{
mutex_lock l(mu_);
already_cancelled = !cm->RegisterCallback(
token, [this, cm, token]() { Cancel(kDequeue, cm, token); });
if (!already_cancelled) {
// TODO(josh11b): This makes two copies of callback, avoid this if possible.
dequeue_attempts_.emplace_back(
1, [callback]() { callback(Tuple()); }, ctx, cm, token,
[callback, this](Attempt* attempt) EXCLUSIVE_LOCKS_REQUIRED(mu_) {
const int32 s = queues_[0].size();
if (closed_ && s == 0) {
attempt->context->SetStatus(errors::OutOfRange(
"PriorityQueue '", name_, "' is closed and has ",
"insufficient elements (requested ", 1, ", current size ", s,
")"));
return kComplete;
}
if (s > 0) {
Tuple tuple;
DequeueLocked(attempt->context, &tuple);
attempt->done_callback = [callback, tuple]() { callback(tuple); };
return kComplete;
} else {
return kNoProgress;
}
});
}
}
if (!already_cancelled) {
FlushUnlocked();
} else {
ctx->SetStatus(errors::Cancelled("Dequeue operation was cancelled"));
callback(Tuple());
}
}
void PriorityQueue::TryDequeueMany(int num_elements, OpKernelContext* ctx,
bool allow_small_batch,
CallbackWithTuple callback) {
if (!specified_shapes()) {
ctx->SetStatus(
errors::InvalidArgument("PriorityQueue's DequeueMany requires the "
"components to have specified shapes."));
callback(Tuple());
return;
}
if (num_elements == 0) {
Tuple tuple;
tuple.reserve(num_components());
for (int i = 0; i < num_components(); ++i) {
// TODO(josh11b,misard): Switch to allocate_output(). Problem is
// this breaks the abstraction boundary since we don't *really*
// know if and how the Tensors in the tuple we pass to callback
// correspond to the outputs of *ctx. For example, the
// ReaderRead Op uses TryDequeue() to get a filename out of a
// queue that is used internally by the reader and is not
// associated with any output of the ReaderRead.
// mrry@ adds:
// Maybe we need to pass a std::function<Tensor*(...)> (or
// better signature) that calls the appropriate allocator
// function in addition to ctx? (Or support a shim Allocator
// that has an internal OpKernelContext*, and dispatches to the
// appropriate method?)
// misard@ adds:
// I don't see that a std::function would help. The problem is
// that at this point (allocation time) the system doesn't know
// what is going to happen to the element read out of the
// queue. As long as we keep the generality that TensorFlow Ops
// do their own dynamic allocation in arbitrary C++ code, we
// need to preserve robustness to allocating output Tensors with
// the 'wrong' attributes, and fixing up with a copy. The only
// improvement I can see here in the future would be to support
// an optimized case where the queue 'knows' what attributes to
// use, and plumbs them through here.
Tensor element;
ctx->allocate_temp(component_dtypes_[i], ManyOutShape(i, 0), &element);
tuple.emplace_back(element);
}
callback(tuple);
return;
}
CancellationManager* cm = ctx->cancellation_manager();
CancellationToken token = cm->get_cancellation_token();
bool already_cancelled;
{
mutex_lock l(mu_);
already_cancelled = !cm->RegisterCallback(
token, [this, cm, token]() { Cancel(kDequeue, cm, token); });
if (!already_cancelled) {
// TODO(josh11b): This makes two copies of callback, avoid this if possible.
dequeue_attempts_.emplace_back(
num_elements, [callback]() { callback(Tuple()); }, ctx, cm, token,
[callback, this,
allow_small_batch](Attempt* attempt) EXCLUSIVE_LOCKS_REQUIRED(mu_) {
int32 s = queues_[0].size();
// Return OutOfRange if closed and there are fewer elements
// available than requested. *Unless* allow_small_batch
// is true, in which case we return as many elements as
// possible.
if (closed_) {
if (s == 0 ||
(!allow_small_batch && s < attempt->elements_requested)) {
attempt->context->SetStatus(errors::OutOfRange(
"PriorityQueue '", name_, "' is closed and has ",
"insufficient elements (requested ",
attempt->elements_requested, ", current size ", s, ")"));
return kComplete;
}
}
// The PriorityQueue is expected to always return a
// sorted set of entries. In order to do this, the underlying
// queue must have at least this many entries already.
// Doing the dynamic thing and pulling out a portion at a
// time leads to unordered output in calls to DequeueMany.
//
// An alternative solution is to store the attempt tuple
// entries in an identical priority_queue and push onto
// this queue dynamically, then when it is full, do all
// the Tensor concatenation at the very end.
// TODO(ebrevdo): Change approach if this leads to locking issues.
if (s < attempt->elements_requested) {
// If we have no elements at all, then wait.
// Otherwise proceed if closed and allow small batch is true.
// Otherwise wait until we have more enqueued elements.
if (s == 0 || !(closed_ && allow_small_batch)) {
return kNoProgress;
}
}
RunResult result = kNoProgress;
for (; s > 0; --s) {
if (attempt->tuple.empty()) {
// Only allocate tuple when we have something to dequeue
// so we don't use exceessive memory when there are many
// blocked dequeue attempts waiting.
attempt->tuple.reserve(num_components());
for (int i = 0; i < num_components(); ++i) {
const TensorShape shape =
ManyOutShape(i, attempt->elements_requested);
Tensor element;
attempt->context->allocate_temp(component_dtypes_[i], shape,
&element);
attempt->tuple.emplace_back(element);
}
}
result = kProgress;
Tuple tuple;
DequeueLocked(attempt->context, &tuple);
const int index =
attempt->tuple[0].dim_size(0) - attempt->elements_requested;
for (int i = 0; i < num_components(); ++i) {
attempt->context->SetStatus(
CopyElementToSlice(tuple[i], &attempt->tuple[i], index));
if (!attempt->context->status().ok()) return kComplete;
}
tuple.clear();
--attempt->elements_requested;
if (attempt->elements_requested == 0) {
tuple = attempt->tuple;
attempt->done_callback = [callback, tuple]() {
callback(tuple);
};
return kComplete;
}
}
return result;
});
}
}
if (!already_cancelled) {
FlushUnlocked();
} else {
ctx->SetStatus(errors::Cancelled("Dequeue operation was cancelled"));
callback(Tuple());
}
}
Status PriorityQueue::MatchesNodeDef(const NodeDef& node_def) {
TF_RETURN_IF_ERROR(MatchesNodeDefOp(node_def, "PriorityQueue"));
TF_RETURN_IF_ERROR(MatchesNodeDefCapacity(node_def, capacity_));
TF_RETURN_IF_ERROR(MatchesPriorityNodeDefTypes(node_def));
TF_RETURN_IF_ERROR(MatchesPriorityNodeDefShapes(node_def));
return Status::OK();
}
Status PriorityQueue::MatchesPriorityNodeDefTypes(
const NodeDef& node_def) const {
DataTypeVector requested_dtypes;
TF_RETURN_IF_ERROR(
GetNodeAttr(node_def, "component_types", &requested_dtypes));
requested_dtypes.insert(requested_dtypes.begin(), DT_INT64);
if (requested_dtypes != component_dtypes_) {
return errors::InvalidArgument("Shared queue '", name_,
"' has component types ",
DataTypeSliceString(component_dtypes_),
" but requested component types were ",
DataTypeSliceString(requested_dtypes));
}
return Status::OK();
}
Status PriorityQueue::MatchesPriorityNodeDefShapes(
const NodeDef& node_def) const {
std::vector<TensorShape> requested_shapes;
TF_RETURN_IF_ERROR(GetNodeAttr(node_def, "shapes", &requested_shapes));
requested_shapes.insert(requested_shapes.begin(), TensorShape({}));
if (requested_shapes != component_shapes_) {
return errors::InvalidArgument("Shared queue '", name_,
"' has component shapes ",
ShapeListString(component_shapes_),
" but requested component shapes were ",
ShapeListString(requested_shapes));
}
return Status::OK();
}
} // namespace tensorflow
|
{
"pile_set_name": "Github"
}
|
<?php
use App\Models\City;
use App\Support\Database\CsvSeeder;
class CitiesTableSeeder extends CsvSeeder
{
protected $filename = __DIR__ . '/../csvs/cities.csv';
protected $model = City::class;
}
|
{
"pile_set_name": "Github"
}
|
activity-social-networking-summary-add-connection={0} and {1} are now connected.
add-projects=Add Projects
administrators=Administrators
are-you-sure-you-want-to-delete-x-from-your-contacts=Are you sure you want to delete {0} from your contacts?
back-to-selection=Back to Selection
blocked=Blocked
connect=Connect
connected=Connected
connection-requested=Connection Requested
connections=Connections
contacts-center=Contacts Center
contacts-center-lets-you-search-view-and-establish-social-relations-with-other-users=Contacts Center lets you search, view, and establish social relations with other users. Follow or add a user as a connection to see their social activities and microblogs.
disconnect=Disconnect
email-address-cannot-be-empty=Email address cannot be empty.
export-my-x-as-vcards=Export My {0} as vCards
filter-contacts=Filter Contacts
filter-members=Filter Members
filter-x-connections=Filter {0}'s Connections
find-people=Find People
follow=Follow
follower=Follower
following=Following
full-name-cannot-be-empty=Full name cannot be empty.
information=Information
introduction=Introduction
javax.portlet.title.1_WAR_contactsportlet=Contacts Center
javax.portlet.title.2_WAR_contactsportlet=Profile
javax.portlet.title.3_WAR_contactsportlet=My Contacts
javax.portlet.title.4_WAR_contactsportlet=Members
members-of=Members of
my-connections=My Connections
my-contacts=My Contacts
no-last-name=No Last Name
people=People
receive-a-notification-when-someone-sends-you-a-social-relationship-request=sends you a social relationship request.
recent-activity=Recent Activity
request-social-networking-summary-add-connection={0} would like to add you as a connection.
requests=Requests
send-message=Send Message
show-additional-email-addresses=Show Additional Email Addresses
show-addresses=Show Addresses
show-comments=Show Comments
show-complete-your-profile=Show Complete Your Profile
show-icon=Show Icon
show-instant-messenger=Show Instant Messenger
show-phones=Show Phones
show-recent-activity=Show Recent Activity
show-sites=Show Sites
show-sms=Show SMS
show-social-network=Show Social Network
show-users-information=Show User's Information
show-websites=Show Websites
there-is-already-a-contact-with-this-email-address=There is already a contact with this email address.
this-user-has-received-a-connection-request-from-you=This user has received a connection request from you.
to-complete-your-profile-please-add=To complete your profile, please add:
unblock=Unblock
unfollow=Unfollow
update-contact=Update Contact
users-per-section=Users per Section
vcard=vCard
view-all-x-connections=View all {0}'s connections.
view-all-x-users=View all {0} users.
view-my-x-contacts=View my {0} contacts.
view-profile=View Profile
x-does-not-belong-to-any-sites={0} does not belong to any sites.
x-does-not-have-any-tags={0} does not have any tags.
x-has-no-connections={0} has no connections.
x-has-no-contacts={0} has no contacts.
x-has-x-connections={0} has {1} connections.
you-are-following-x-people=You are following {0} people.
you-are-following-x-people-in-this-site=You are following {0} people in this site.
you-are-not-connected-to-this-user-anymore=You are not connected to this user anymore.
you-are-not-following-this-user-anymore=You are not following this user anymore.
you-are-now-connected-to-this-user=You are now connected to this user.
you-are-now-following-this-user=You are now following this user.
you-have-a-pending-request=You have a pending request.
you-have-blocked-this-user=You have blocked this user.
you-have-no-connections=You have no connections.
you-have-no-pending-requests=You have no pending request.
you-have-successfully-added-a-new-contact=You have successfully added a new contact.
you-have-successfully-updated-the-contact=You have successfully updated the contact.
you-have-unblocked-this-user=You have unblocked this user.
you-have-x-connections=You have {0} connections.
you-have-x-connections-in-this-site=You have {0} connections in this site.
you-have-x-followers=You have {0} followers.
you-have-x-pending-requests=You have {0} pending requests.
|
{
"pile_set_name": "Github"
}
|
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
( (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
for AIX Toolbox
Author: Tor Arntsen
The spec file in this directory is based on the Linux ssl and non-ssl
curl spec files, plus additions to make it AIX Toolbox compatible.
The AIX Toolbox setup (installs into /opt/freeware, with symlinks in
/usr/bin,/usr/lib,/usr/include) are based on IBM's aixtoolbox spec
file written by David Clissold <[email protected]>, see
ftp://ftp.software.ibm.com/aixtoolbox/SPECS/curl-7.9.3-2.spec
This spec file is designed to be a drop-in replacement for the
old spec file found at the above link. Thus, like the old spec file
this version is also a unified ssl/non-ssl version. To get non-ssl
RPMs just pass --define 'nossl 1' to the command line when building
the RPM, e.g.
rpm -bb --define 'nossl 1' curl.spec
Default is to build with ssl support.
Lastly, the spec file expects the Curl source distribution file to be
in .tar.bz2 format.
The nifty cURL header of this README is a ripoff of the vms/readme file.
|
{
"pile_set_name": "Github"
}
|
---
Description: The SetNotify method sets or removes a callback on the allocator. The allocator calls the callback method whenever the allocator's IMemAllocator::ReleaseBuffer method is called.
ms.assetid: ef9a6c66-d392-4130-b4fc-9eb6aecb6cbf
title: CBaseAllocator.SetNotify method (Amfilter.h)
ms.topic: reference
ms.date: 05/31/2018
topic_type:
- APIRef
- kbSyntax
api_name:
- CBaseAllocator.SetNotify
api_type:
- COM
api_location:
- Strmbase.lib
- Strmbase.dll
- Strmbasd.lib
- Strmbasd.dll
---
# CBaseAllocator.SetNotify method
\[[**SetNotify**](/previous-versions/windows/desktop/api/Dshowasf/nf-dshowasf-iamwmbufferpass-setnotify) may be altered or unavailable in subsequent versions.\]
The `SetNotify` method sets or removes a callback on the allocator. The allocator calls the callback method whenever the allocator's [**IMemAllocator::ReleaseBuffer**](/windows/desktop/api/Strmif/nf-strmif-imemallocator-releasebuffer) method is called.
## Syntax
```C++
HRESULT SetNotify(
IMemAllocatorNotifyCallbackTemp *pNotify
);
```
## Parameters
<dl> <dt>
*pNotify*
</dt> <dd>
Pointer to the [**IMemAllocatorNotifyCallbackTemp**](/windows/desktop/api/Strmif/nn-strmif-imemallocatornotifycallbacktemp) interface that will be used for the callback. The caller must implement the interface. Use the value **NULL** to remove the callback.
</dd> </dl>
## Return value
Returns S\_OK.
## Remarks
This method implements the [**IMemAllocatorCallbackTemp::SetNotify**](/windows/desktop/api/Strmif/nf-strmif-imemallocatorcallbacktemp-setnotify) method. The allocator does not expose the [**IMemAllocatorCallbackTemp**](/windows/desktop/api/Strmif/nn-strmif-imemallocatorcallbacktemp) interface unless the *fEnableReleaseCallback* flag is set to **TRUE** in the [**CBaseAllocator**](cbaseallocator.md) constructor.
This method sets the [**CBaseAllocator::m\_pNotify**](cbaseallocator-m-pnotify.md) member variable equal to *pNotify* and increments the reference count on the interface. If *m\_pNotify* is non-**NULL**, the allocator's **ReleaseBuffer** method calls [**IMemAllocatorNotifyCallbackTemp::NotifyRelease**](/windows/desktop/api/Strmif/nf-strmif-imemallocatornotifycallbacktemp-notifyrelease). See the Remarks section in that method for information about implementing the callback.
## Requirements
| | |
|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Header<br/> | <dl> <dt>Amfilter.h (include Streams.h)</dt> </dl> |
| Library<br/> | <dl> <dt>Strmbase.lib (retail builds); </dt> <dt>Strmbasd.lib (debug builds)</dt> </dl> |
## See also
<dl> <dt>
[**CBaseAllocator Class**](cbaseallocator.md)
</dt> </dl>
|
{
"pile_set_name": "Github"
}
|
{
"name": "symfony/polyfill-mbstring",
"type": "library",
"description": "Symfony polyfill for the Mbstring extension",
"keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
{
"name": "Nicolas Grekas",
"email": "[email protected]"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"require": {
"php": ">=5.3.3"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
"files": [ "bootstrap.php" ]
},
"suggest": {
"ext-mbstring": "For best performance"
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
}
}
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.