answer stringlengths 15 1.25M |
|---|
#include <linux/fs.h>
#include <linux/syscalls.h>
#include <linux/kobject.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/module.h>
#include <linux/init.h>
#include <plat/lge_nvdata_handler.h>
#define MAX_SIZE 100
static int offset;
static char <API key>[MAX_SIZE];
static char <API key>[MAX_SIZE];
static int size;
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
return sprintf(buf, "%s", <API key>);
}
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
sscanf(buf, "%d %d", &offset, &size);
<API key>(offset, <API key>, size);
return count;
}
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
return sprintf(buf, "%s", <API key>);
}
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
sscanf(buf, "%d %d", &offset, &size);
<API key>(offset, <API key>, size);
return count;
}
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
//write func doesn't allow to read.
return sprintf(buf, "%s", "-1");
}
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
char bufTmp[MAX_SIZE];
sscanf(buf, "%d %s %d", &offset, bufTmp, &size);
<API key>(offset, bufTmp, size);
return count;
}
static ssize_t <API key>(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
char bufTmp[MAX_SIZE];
sscanf(buf, "%d %s %d", &offset, bufTmp, &size);
<API key>(offset, bufTmp, size);
return count;
}
static struct kobj_attribute <API key> =
__ATTR(<API key>, 0666, <API key>, <API key>);
static struct kobj_attribute <API key> =
__ATTR(<API key>, 0666, <API key>, <API key>);
static struct kobj_attribute <API key> =
__ATTR(<API key>, 0666, <API key>, <API key>);
static struct kobj_attribute <API key> =
__ATTR(<API key>, 0666, <API key>, <API key>);
static struct attribute *attrs[] = {
&<API key>.attr,
&<API key>.attr,
&<API key>.attr,
&<API key>.attr,
NULL,
};
static struct attribute_group attr_group = {
.attrs = attrs,
};
static struct kobject *lge_nvdata_kobj;
static int __init lge_nvdata_init(void)
{
int retval;
lge_nvdata_kobj = <API key>("kobject_lge_nvdata", kernel_kobj);
if (!lge_nvdata_kobj)
return -ENOMEM;
retval = sysfs_create_group(lge_nvdata_kobj, &attr_group);
if (retval)
kobject_put(lge_nvdata_kobj);
return retval;
}
static void __exit lge_nvdata_exit(void)
{
kobject_put(lge_nvdata_kobj);
}
module_init(lge_nvdata_init);
module_exit(lge_nvdata_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("lge.com"); |
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive.
*
* Override this template by copying it to yourtheme/woocommerce/archive-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $<API key>, $<API key>, $product, $wp_query;
function excerpt($limit) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
return $excerpt;
}
get_header('shop'); ?>
<div class="container style-2 woocommerce">
<div class="block pg_category">
<?php
/**
* <API key> hook
*
* @hooked <API key> - 10 (outputs opening divs for the content)
* @hooked <API key> - 20
*/
do_action('<API key>');
?>
<div class="top-section">
<?php if ( apply_filters( '<API key>', true ) ) { ?>
<div class="title"><?php
$cat = $wp_query->get_queried_object();
$parent = "";
if($cat->parent != 0){
$parent = get_term($cat->parent, "product_cat")->name;
}
$category_count = 0;
if(isset($_GET['product_cat'])){
$explode = explode(",", $_GET['product_cat']);
$category_count += count($explode);
}
$title_test = get_the_title();
if(strlen($cat->name) > 0){
$category_count += 1;
if(strlen($parent)){
if($category_count > 1){
echo $parent . " - Refined";
}
else {
echo $parent . " - " . $cat->name;
}
}
else {
if($cat->name == "product"){
echo "Product Information";
}
else {
echo $cat->name;
}
}
}
elseif(strlen($title_test) > 0){
echo $title_test;
}
else {
<API key>();
}
?></div>
<?php }
else { ?>
<div class="title">Categories</div>
<?php } ?>
<div class="search_main">
<form method="get" class="searchform" action="/">
<input type="text" class="field s" name="s" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
<input type="image" src="/wp-content/themes/guymark/images/ico-search.png" class="search-submit" name="submit" alt="">
</form>
<div class="fix"></div>
</div>
<?php
// $this_category = get_category($cat);
// Generate dropdown of subcategories
$cat = $wp_query->get_queried_object();
$id = $cat->term_taxonomy_id;
$subcat = "";
goto <API key>;
echo "<select name=\"product_cat\" id=\"<API key>\">\n";
if (is_product_category()){
$subcat = get_categories('child_of=' . $id . '&hide_empty=0&taxonomy=product_cat');
echo " <option value=\"\" selected=\"selected\">Select a sub-category</option>\n";
}
else {
$subcat = get_categories('hide_empty=0&taxonomy=product_cat');
echo " <option value=\"\" selected=\"selected\">Select a category</option>\n";
// echo <API key>(); - previously used line
}
foreach($subcat as $cat2){
echo " <option class=\"level-0\" value=\"" . get_term_link( $cat2->slug, "product_cat" ) . "\">" . $cat2->cat_name ."</option>\n";
}
echo "</select>\n";
// do_shortcode('[product_category category="THE SLUG" per_page="3" columns="1" orderby="date" order="desc"]');
// <API key>('taxonomy=product_cat');
?>
<script type="text/javascript">
<!
<?php if(count($subcat) == 0){ ?>
jQuery( window ).load(function() {
$(".top-section .selectricWrapper").hide();
});
<?php } ?>
<?php
if($cat->count <= 1 && is_product_category()){ ?>
jQuery( window ).load(function() {
$(".top-section2").hide();
});
<?php } ?>
var dropdown = document.getElementById("<API key>");
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value != "" ) {
location.href = dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
</script>
<?php
<API key>:
?>
<div class="clearfix"></div>
</div>
<?php
function category_get($nameorslug){
$name = get_term_by('name', $nameorslug, 'product_cat');
if($name === false){
return get_term_by('slug', $nameorslug, 'product_cat');
}
return $name;
}
function category_getlist($catdata){
$extract = explode("\n", $catdata->description);
$output = "";
foreach($extract as $ex){
$ex = trim($ex);
if($ex == ""){continue;}
$output .= "<li><span>" . $ex . "</span></li>";
}
return $output;
}
function category_link($catdata){
$add_filter = "";
$qm = "";
$and = "";
if(isset($_GET['filter']) || strtolower(get_the_title()) == "shop"){
if(strtolower(get_the_title()) == "shop"){
$add_filter = "?filter=" . "shop";
}
else {
$add_filter = "?filter=" . $_GET['filter'];
}
}
$termlink = get_term_link(intval($catdata->term_id), "product_cat");
$link = $termlink . $add_filter;
return $link;
}
function category_image($catdata){
$thumbnail_id = <API key>($catdata->term_id, 'thumbnail_id', true);
return <API key>($thumbnail_id);
}
function category_item($catdata, $omitifempty = true){
//$catdata = category_get($title);
$title = $catdata->name;
if($omitifempty && ($catdata->count == 0)){
return;
}
$list = category_getlist($catdata);
$image = category_image($catdata);
$link = category_link($catdata);
if($image == ""){$image = "/wp-content/plugins/woocommerce/assets/images/placeholder.png";}
echo <<<ENDL
<div class="item">
<div class="ratio"></div>
<div class="content">
<div class="image"><img src="{$image}"></div>
<div class="category_name">{$title}</div>
<ul class="sub_categories">
{$list}
<li><span>and more</span></li>
</ul>
<a href="{$link}" class="button">View category<div></div></a>
</div>
</div>
ENDL;
}
function category_postcount($catdata){
$args = array(
'post_type' => 'product',
'product_cat' => $catdata->slug
);
if(isset($_GET['filter']) || strtolower(get_the_title()) == "shop"){
$args['meta_key'] = '<API key>';
$args['meta_value'] = 1;
}
$loop = new WP_Query( $args );
return $loop->found_posts;
}
?>
<?php if( is_product_category() ){ ?>
<div class="list-of-products">
<?php
// Previous class: product-collection
if ( have_posts() ) : ?>
<?php <API key>(); ?>
<?php while (have_posts()) : the_post(); ?>
<?php if($product2 = get_product(get_the_ID())){
show_product($product2);
?>
<div class="item" style="display: none">
<div class="pad">
<a href="<?php the_permalink(); ?>">
<div class="image">
<?php echo $product2->get_image(150, 150); ?>
</div>
<div class="name"><?php the_title(); ?></div>
<div class="description"><?php excerpt(10); ?></div>
<div class="options"><span>+</span> Options</div>
</a>
<a href="<?php echo "/shop/?add-to-cart=" . get_the_ID() . "&<API key>=" . get_the_ID(); ?>" class="button inventory">Add to inventory<div></div></a>
<a href="<?php echo $product2->add_to_cart_url(); ?>" class="button basket">Add to basket<div></div></a>
</div>
</div>
<?php } ?>
<?php endwhile; // end of the loop.?>
<?php
/**
* <API key> hook
*
* @hooked <API key> - 10
*/
do_action( '<API key>' );
?>
<?php elseif ( ! <API key>( array( 'before' => <API key>( false ), 'after' => <API key>( false ) ) ) ) : ?>
<?php <API key>( 'loop/no-products-found.php' ); ?>
<?php endif; ?>
<div class="clearfix"></div>
</div>
<?php }
else { ?>
<div class="category_list">
<?php
// Get list of root product categories to display
$args = array('hide_empty' => true, 'parent' => 0);
$listofprodcat = get_terms( 'product_cat', $args );
foreach($listofprodcat as $catdata){
$postcount = category_postcount($catdata);
if($postcount > 0){
category_item($catdata);
}
}
/*
category_item("Audiometers");
category_item("Hearing Aid Fitting");
category_item("Tympanometer");
category_item("Evoked Response");
category_item("Otoacoustic Emissions");
category_item("Sound Booths & Rooms");
category_item("Sound Level Meters");
category_item("Sound Level Indicators");
category_item("Hearing Protection");
category_item("VNG Systems");
category_item("Sound Field Systems");
category_item("Visual Reward Apparatus");
category_item("Otoscopes & ENT Equipment");
category_item("Technical Spares");
category_item("Accessories");
category_item("Consumables");
category_item("Educational Products");
category_item("Ex-Demo Equipment");
*/
?>
</div>
<?php } ?>
<!-- END OF ITEM LIST -->
<div class="col-right">
<?php if( is_product_category() ){ ?>
<div class="top-section2">
<?php <API key>(); ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
if(isset($_GET['filter']) || strtolower(get_the_title()) == "shop"){
get_sidebar("shop");
}
else {
get_sidebar("product-information");
}
// do_action('woocommerce_sidebar');
// the_widget("<API key>");
// do_shortcode('[featured_products per_page="12" columns="4"]')
?>
</div>
<?php
/**
* <API key> hook
*
* @hooked <API key> - 10 (outputs closing divs for the content)
*/
// do_action('<API key>');
/**
* woocommerce_sidebar hook
*
* @hooked <API key> - 10
*/
// do_action('woocommerce_sidebar');
// get_sidebar();
do_action('<API key>');
?>
</div>
</div>
<?php get_footer('shop'); ?> |
<a rel="nofollow" href="http:
-
## 20200727_04.md [PostgreSQL - openapi - ](20200727_04.md)
## 20200727_03.md [PostgreSQL 14 preview - - seqscan io chunk, IO , ](20200727_03.md)
## 20200727_02.md [PostgreSQL ()hook - login "trigger"](20200727_02.md)
## 20200727_01.md [PostgreSQL COPY SQLbinary](20200727_01.md)
## 20200725_01.md [PostgreSQL prefix - ](20200725_01.md)
## 20200724_01.md [PostgreSQL - pg_timeout (idle session timeout)](20200724_01.md)
## 20200723_01.md [PostgreSQL 14 preview - barrier - alter system read only|write](20200723_01.md)
## 20200720_04.md [PostgreSQL 14 hugepage huge_page_size](20200720_04.md)
## 20200720_03.md [PostgreSQL 13 slotwal - <API key>](20200720_03.md)
## 20200720_02.md [PostgreSQL 14 binary](20200720_02.md)
## 20200720_01.md [PostgreSQL 14 (prepared statements) custom_plans generic_plans ](20200720_01.md)
## 20200716_01.md [PostgreSQL plpgsql debug - |text| ](20200716_01.md)
## 20200710_02.md [PostgreSQL x, y, (N) - +](20200710_02.md)
## 20200710_01.md [PostgreSQL case - where A order by B limit x](20200710_01.md)
## 20200709_02.md [PostgreSQL - system_stats - cpu,memory,network,filesystem,block dev](20200709_02.md)
## 20200709_01.md [vacuumbackend xminvacuum.](20200709_01.md)
## 20200702_01.md [PostgreSQL zedstore ](20200702_01.md) |
(function () {
"use strict";
WinJS.UI.Pages.define("/views/torrents.html", {
// This function is called whenever a user navigates to this page. It
// populates the page elements with the app's data.
ready: function (element, options) {
var appName = 'mainApp';
angular.module(appName, ['Torrent', 'AppBar', 'Directives']);
angular.bootstrap(element, [appName]);
//settings flyout
WinJS.Application.onsettings = function (e) {
e.detail.applicationcommands = {
'settings-server': { title: 'Server Settings', href: '/views/settings-server.html' },
'<API key>': { title: 'Transmission Settings', href: '/views/<API key>.html' },
'settings-interface': { title: 'Interface Settings', href: '/views/settings-interface.html' }
};
WinJS.UI.SettingsFlyout.populateSettings(e);
};
},
unload: function () {
// TODO: Respond to navigations away from this page.
},
updateLayout: function (element) {
<param name="element" domElement="true" />
// TODO: Respond to changes in layout.
}
});
})(); |
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-h501.c */
/* ../../tools/asn2wrs.py -p h501 -c ./h501.cnf -s ./<API key> -D . -O ../../epan/dissectors H501-MESSAGES.asn */
/* Input file: <API key>.c */
#line 1 "../../asn1/h501/<API key>.c"
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/oids.h>
#include <epan/asn1.h>
#include "packet-tpkt.h"
#include "packet-per.h"
#include "packet-h225.h"
#include "packet-h235.h"
#define PNAME "H.501 Mobility"
#define PSNAME "H.501"
#define PFNAME "h501"
/* Initialize the protocol and registered fields */
static int proto_h501 = -1;
#line 1 "../../asn1/h501/packet-h501-hf.c"
static int hf_h501_Message_PDU = -1; /* Message */
static int hf_h501_body = -1; /* MessageBody */
static int hf_h501_common = -1; /* MessageCommonInfo */
static int <API key> = -1; /* ServiceRequest */
static int <API key> = -1; /* ServiceConfirmation */
static int <API key> = -1; /* ServiceRejection */
static int <API key> = -1; /* ServiceRelease */
static int <API key> = -1; /* DescriptorRequest */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* DescriptorRejection */
static int <API key> = -1; /* DescriptorIDRequest */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* DescriptorUpdate */
static int <API key> = -1; /* DescriptorUpdateAck */
static int <API key> = -1; /* AccessRequest */
static int <API key> = -1; /* AccessConfirmation */
static int <API key> = -1; /* AccessRejection */
static int <API key> = -1; /* RequestInProgress */
static int <API key> = -1; /* NonStandardRequest */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* UsageRequest */
static int <API key> = -1; /* UsageConfirmation */
static int <API key> = -1; /* UsageIndication */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* UsageRejection */
static int <API key> = -1; /* ValidationRequest */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* ValidationRejection */
static int hf_h501_<API key> = -1; /* <API key> */
static int hf_h501_<API key> = -1; /* <API key> */
static int hf_h501_<API key> = -1; /* <API key> */
static int <API key> = -1; /* INTEGER_0_65535 */
static int <API key> = -1; /* ProtocolVersion */
static int hf_h501_hopCount = -1; /* INTEGER_1_255 */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* TransportAddress */
static int <API key> = -1; /* ICV */
static int hf_h501_tokens = -1; /* <API key> */
static int hf_h501_tokens_item = -1; /* ClearToken */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* CryptoH323Token */
static int hf_h501_nonStandard = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int hf_h501_serviceID = -1; /* ServiceID */
static int hf_h501_genericData = -1; /* <API key> */
static int <API key> = -1; /* GenericData */
static int hf_h501_featureSet = -1; /* FeatureSet */
static int hf_h501_version = -1; /* ProtocolVersion */
static int <API key> = -1; /* ElementIdentifier */
static int <API key> = -1; /* AliasAddress */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* SecurityMode */
static int hf_h501_timeToLive = -1; /* <API key> */
static int hf_h501_usageSpec = -1; /* UsageSpecification */
static int <API key> = -1; /* <API key> */
static int hf_h501_integrity = -1; /* IntegrityMechanism */
static int <API key> = -1; /* T_algorithmOIDs */
static int <API key> = -1; /* OBJECT_IDENTIFIER */
static int hf_h501_alternates = -1; /* AlternatePEInfo */
static int <API key> = -1; /* SecurityMode */
static int hf_h501_reason = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int hf_h501_security = -1; /* NULL */
static int hf_h501_continue = -1; /* NULL */
static int hf_h501_undefined = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int hf_h501_reason_01 = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int hf_h501_maintenance = -1; /* NULL */
static int hf_h501_terminated = -1; /* NULL */
static int hf_h501_expired = -1; /* NULL */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* DescriptorID */
static int hf_h501_descriptor = -1; /* <API key> */
static int <API key> = -1; /* Descriptor */
static int hf_h501_reason_02 = -1; /* <API key> */
static int <API key> = -1; /* DescriptorID */
static int <API key> = -1; /* NULL */
static int hf_h501_illegalID = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* DescriptorInfo */
static int hf_h501_reason_03 = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int hf_h501_sender = -1; /* AliasAddress */
static int hf_h501_updateInfo = -1; /* <API key> */
static int <API key> = -1; /* UpdateInformation */
static int <API key> = -1; /* T_descriptorInfo */
static int <API key> = -1; /* Descriptor */
static int hf_h501_updateType = -1; /* T_updateType */
static int hf_h501_added = -1; /* NULL */
static int hf_h501_deleted = -1; /* NULL */
static int hf_h501_changed = -1; /* NULL */
static int <API key> = -1; /* PartyInformation */
static int hf_h501_sourceInfo = -1; /* PartyInformation */
static int hf_h501_callInfo = -1; /* CallInformation */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* SupportedProtocols */
static int hf_h501_templates = -1; /* <API key> */
static int <API key> = -1; /* AddressTemplate */
static int <API key> = -1; /* BOOLEAN */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* SupportedProtocols */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int hf_h501_reason_04 = -1; /* <API key> */
static int hf_h501_noMatch = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int hf_h501_reason_05 = -1; /* UsageRejectReason */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* AccessToken */
static int hf_h501_senderRole = -1; /* Role */
static int <API key> = -1; /* UsageCallStatus */
static int hf_h501_srcInfo = -1; /* PartyInformation */
static int hf_h501_destAddress = -1; /* PartyInformation */
static int hf_h501_startTime = -1; /* TimeStamp */
static int hf_h501_endTime = -1; /* TimeStamp */
static int <API key> = -1; /* TerminationCause */
static int hf_h501_usageFields = -1; /* <API key> */
static int <API key> = -1; /* UsageField */
static int hf_h501_id = -1; /* OBJECT_IDENTIFIER */
static int hf_h501_value = -1; /* OCTET_STRING */
static int hf_h501_invalidCall = -1; /* NULL */
static int hf_h501_unavailable = -1; /* NULL */
static int hf_h501_reason_06 = -1; /* <API key> */
static int hf_h501_unknownCall = -1; /* NULL */
static int hf_h501_incomplete = -1; /* NULL */
static int hf_h501_accessToken = -1; /* <API key> */
static int <API key> = -1; /* AccessToken */
static int hf_h501_reason_07 = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int hf_h501_delay = -1; /* INTEGER_1_65535 */
static int hf_h501_reason_08 = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* OCTET_STRING */
static int hf_h501_reason_09 = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* ApplicationMessage */
static int hf_h501_reason_10 = -1; /* <API key> */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int hf_h501_pattern = -1; /* SEQUENCE_OF_Pattern */
static int <API key> = -1; /* Pattern */
static int hf_h501_routeInfo = -1; /* <API key> */
static int <API key> = -1; /* RouteInformation */
static int hf_h501_specific = -1; /* AliasAddress */
static int hf_h501_wildcard = -1; /* AliasAddress */
static int hf_h501_range = -1; /* T_range */
static int <API key> = -1; /* PartyNumber */
static int hf_h501_endOfRange = -1; /* PartyNumber */
static int hf_h501_messageType = -1; /* T_messageType */
static int <API key> = -1; /* NULL */
static int hf_h501_sendSetup = -1; /* NULL */
static int hf_h501_nonExistent = -1; /* NULL */
static int <API key> = -1; /* BOOLEAN */
static int hf_h501_priceInfo = -1; /* <API key> */
static int <API key> = -1; /* PriceInfoSpec */
static int hf_h501_contacts = -1; /* <API key> */
static int <API key> = -1; /* ContactInformation */
static int hf_h501_type = -1; /* EndpointType */
static int hf_h501_circuitID = -1; /* CircuitInfo */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* CircuitIdentifier */
static int <API key> = -1; /* AliasAddress */
static int hf_h501_priority = -1; /* INTEGER_0_127 */
static int <API key> = -1; /* TransportQOS */
static int hf_h501_security_01 = -1; /* <API key> */
static int <API key> = -1; /* SecurityMode */
static int <API key> = -1; /* BOOLEAN */
static int hf_h501_currency = -1; /* IA5String_SIZE_3 */
static int <API key> = -1; /* INTEGER_M127_127 */
static int hf_h501_validFrom = -1; /* GlobalTimeStamp */
static int hf_h501_validUntil = -1; /* GlobalTimeStamp */
static int hf_h501_hoursFrom = -1; /* IA5String_SIZE_6 */
static int hf_h501_hoursUntil = -1; /* IA5String_SIZE_6 */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* PriceElement */
static int <API key> = -1; /* <API key> */
static int hf_h501_amount = -1; /* <API key> */
static int hf_h501_quantum = -1; /* <API key> */
static int hf_h501_units = -1; /* T_units */
static int hf_h501_seconds = -1; /* NULL */
static int hf_h501_packets = -1; /* NULL */
static int hf_h501_bytes = -1; /* NULL */
static int hf_h501_initial = -1; /* NULL */
static int hf_h501_minimum = -1; /* NULL */
static int hf_h501_maximum = -1; /* NULL */
static int <API key> = -1; /* DescriptorInfo */
static int <API key> = -1; /* <API key> */
static int hf_h501_lastChanged = -1; /* GlobalTimeStamp */
static int hf_h501_alternatePE = -1; /* <API key> */
static int <API key> = -1; /* AlternatePE */
static int <API key> = -1; /* BOOLEAN */
static int <API key> = -1; /* AliasAddress */
static int hf_h501_priority_01 = -1; /* INTEGER_1_127 */
static int hf_h501_token = -1; /* ClearToken */
static int hf_h501_cryptoToken = -1; /* CryptoH323Token */
static int <API key> = -1; /* GenericData */
static int <API key> = -1; /* CallIdentifier */
static int <API key> = -1; /* <API key> */
static int hf_h501_preConnect = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int hf_h501_callEnded = -1; /* NULL */
static int <API key> = -1; /* NULL */
static int <API key> = -1; /* AliasAddress */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* CryptoH323Token */
static int hf_h501_sendTo = -1; /* ElementIdentifier */
static int hf_h501_when = -1; /* T_when */
static int hf_h501_never = -1; /* NULL */
static int hf_h501_start = -1; /* NULL */
static int hf_h501_end = -1; /* NULL */
static int hf_h501_period = -1; /* INTEGER_1_65535 */
static int hf_h501_failures = -1; /* NULL */
static int hf_h501_required = -1; /* T_required */
static int <API key> = -1; /* OBJECT_IDENTIFIER */
static int hf_h501_preferred = -1; /* T_preferred */
static int <API key> = -1; /* OBJECT_IDENTIFIER */
static int <API key> = -1; /* AliasAddress */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* AliasAddress */
static int <API key> = -1; /* EndpointType */
static int hf_h501_userInfo = -1; /* UserInformation */
static int hf_h501_timeZone = -1; /* TimeZone */
static int hf_h501_originator = -1; /* NULL */
static int hf_h501_destination = -1; /* NULL */
static int <API key> = -1; /* <API key> */
static int <API key> = -1; /* <API key> */
static int hf_h501_causeIE = -1; /* INTEGER_1_65535 */
#line 46 "../../asn1/h501/<API key>.c"
/* Initialize the subtree pointers */
static int ett_h501 = -1;
#line 1 "../../asn1/h501/packet-h501-ett.c"
static gint ett_h501_Message = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint ett_h501_UsageField = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint ett_h501_<API key> = -1;
static gint ett_h501_<API key> = -1;
static gint ett_h501_<API key> = -1;
static gint ett_h501_<API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint ett_h501_Pattern = -1;
static gint ett_h501_T_range = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint ett_h501_T_units = -1;
static gint ett_h501_Descriptor = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint ett_h501_T_when = -1;
static gint ett_h501_T_required = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint <API key> = -1;
static gint ett_h501_Role = -1;
static gint <API key> = -1;
#line 50 "../../asn1/h501/<API key>.c"
/* Dissectors */
static dissector_handle_t h501_pdu_handle;
/* Preferences */
static guint h501_udp_port = 2099;
static guint h501_tcp_port = 2099;
static gboolean h501_desegment_tcp = TRUE;
void <API key>(void);
#line 1 "../../asn1/h501/packet-h501-fn.c"
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
1, 128, FALSE);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index, NULL);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h235_<API key> },
{ &hf_h501_integrity , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
1U, 4294967295U, NULL, FALSE);
return offset;
}
static int
dissect_h501_NULL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_null(tvb, offset, actx, tree, hf_index);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
1U, 65535U, NULL, FALSE);
return offset;
}
static const per_sequence_t T_when_sequence[] = {
{ &hf_h501_never , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h501_NULL },
{ &hf_h501_start , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h501_NULL },
{ &hf_h501_end , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h501_NULL },
{ &hf_h501_period , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_failures , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h501_NULL },
{ NULL, 0, 0, NULL }
};
static int
dissect_h501_T_when(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_T_when, T_when_sequence);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_T_required, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_sendTo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_when , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_h501_T_when },
{ &hf_h501_required , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_preferred , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_timeToLive , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_usageSpec , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
1U, 127U, NULL, FALSE);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_priority_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_boolean(tvb, offset, actx, tree, hf_index, NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_alternatePE , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_alternates , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_timeToLive , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_usageSpec , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "serviceUnavailable" },
{ 1, "serviceRedirected" },
{ 2, "security" },
{ 3, "continue" },
{ 4, "undefined" },
{ 5, "unknownServiceID" },
{ 6, "<API key>" },
{ 7, "neededFeature" },
{ 8, "genericDataReason" },
{ 9, "usageUnavailable" },
{ 10, "unknownUsageSendTo" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &hf_h501_continue , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key>, <API key>, dissect_h501_NULL },
{ 6, &<API key>, <API key>, dissect_h501_NULL },
{ 7, &<API key> , <API key>, dissect_h501_NULL },
{ 8, &<API key>, <API key>, dissect_h501_NULL },
{ 9, &<API key>, <API key>, dissect_h501_NULL },
{ 10, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_alternates , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "outOfService" },
{ 1, "maintenance" },
{ 2, "terminated" },
{ 3, "expired" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_maintenance , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_terminated , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &hf_h501_expired , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_alternates , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
14, 14, FALSE);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_lastChanged , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t T_range_sequence[] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_endOfRange , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_T_range, T_range_sequence);
return offset;
}
static const value_string h501_Pattern_vals[] = {
{ 0, "specific" },
{ 1, "wildcard" },
{ 2, "range" },
{ 0, NULL }
};
static const per_choice_t Pattern_choice[] = {
{ 0, &hf_h501_specific , ASN1_EXTENSION_ROOT , <API key> },
{ 1, &hf_h501_wildcard , ASN1_EXTENSION_ROOT , <API key> },
{ 2, &hf_h501_range , ASN1_EXTENSION_ROOT , <API key> },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h501_Pattern, Pattern_choice,
NULL);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "sendAccessRequest" },
{ 1, "sendSetup" },
{ 2, "nonExistent" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_sendSetup , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_nonExistent , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
3, 3, FALSE);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
-127, 127U, NULL, FALSE);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
6, 6, FALSE);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
0U, 4294967295U, NULL, FALSE);
return offset;
}
static const value_string h501_T_units_vals[] = {
{ 0, "seconds" },
{ 1, "packets" },
{ 2, "bytes" },
{ 3, "initial" },
{ 4, "minimum" },
{ 5, "maximum" },
{ 0, NULL }
};
static const per_choice_t T_units_choice[] = {
{ 0, &hf_h501_seconds , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_packets , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_bytes , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &hf_h501_initial , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &hf_h501_minimum , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &hf_h501_maximum , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h501_T_units, T_units_choice,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_amount , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_quantum , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_units , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
1, 2048, FALSE);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_currency , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_validFrom , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_validUntil , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_hoursFrom , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_hoursUntil , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
0U, 127U, NULL, FALSE);
return offset;
}
static const value_string <API key>[] = {
{ 0, "token" },
{ 1, "cryptoToken" },
{ 2, "genericData" },
{ 0, NULL }
};
static const per_choice_t AccessToken_choice[] = {
{ 0, &hf_h501_token , ASN1_EXTENSION_ROOT , <API key> },
{ 1, &hf_h501_cryptoToken , ASN1_EXTENSION_ROOT , <API key> },
{ 2, &<API key> , <API key>, <API key> },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, AccessToken_choice,
NULL);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_priority , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_security_01 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_featureSet , <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_circuitID , <API key>, ASN1_OPTIONAL , <API key> },
{ &<API key>, <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_messageType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_usageSpec , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_priceInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_contacts , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_type , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_featureSet , <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_circuitID , <API key>, ASN1_OPTIONAL , <API key> },
{ &<API key>, <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_pattern , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_routeInfo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_timeToLive , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_featureSet , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key> , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t Descriptor_sequence[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_templates , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_Descriptor, Descriptor_sequence);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_descriptor , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "packetSizeExceeded" },
{ 1, "illegalID" },
{ 2, "security" },
{ 3, "hopCountExceeded" },
{ 4, "<API key>" },
{ 5, "undefined" },
{ 6, "neededFeature" },
{ 7, "genericDataReason" },
{ 8, "unknownServiceID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_illegalID , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 6, &<API key> , <API key>, dissect_h501_NULL },
{ 7, &<API key>, <API key>, dissect_h501_NULL },
{ 8, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_02 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "noDescriptors" },
{ 1, "security" },
{ 2, "hopCountExceeded" },
{ 3, "<API key>" },
{ 4, "undefined" },
{ 5, "neededFeature" },
{ 6, "genericDataReason" },
{ 7, "unknownServiceID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key> , <API key>, dissect_h501_NULL },
{ 6, &<API key>, <API key>, dissect_h501_NULL },
{ 7, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_03 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "descriptorID" },
{ 1, "descriptor" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 1, &<API key> , ASN1_EXTENSION_ROOT , <API key> },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const value_string <API key>[] = {
{ 0, "added" },
{ 1, "deleted" },
{ 2, "changed" },
{ 0, NULL }
};
static const per_choice_t T_updateType_choice[] = {
{ 0, &hf_h501_added , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_deleted , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_changed , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, T_updateType_choice,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_updateType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_sender , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_updateInfo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
-43200, 43200U, NULL, FALSE);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_userInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_timeZone , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_circuitID , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_sourceInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_callInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_usageSpec , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_templates , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key>, <API key>, ASN1_OPTIONAL , <API key> },
{ &<API key> , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "noMatch" },
{ 1, "packetSizeExceeded" },
{ 2, "security" },
{ 3, "hopCountExceeded" },
{ 4, "needCallInformation" },
{ 5, "<API key>" },
{ 6, "undefined" },
{ 7, "neededFeature" },
{ 8, "genericDataReason" },
{ 9, "<API key>" },
{ 10, "aliasesInconsistent" },
{ 11, "resourceUnavailable" },
{ 12, "incompleteAddress" },
{ 13, "unknownServiceID" },
{ 14, "usageUnavailable" },
{ 15, "<API key>" },
{ 16, "unknownUsageSendTo" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &hf_h501_noMatch , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 6, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 7, &<API key> , <API key>, dissect_h501_NULL },
{ 8, &<API key>, <API key>, dissect_h501_NULL },
{ 9, &<API key>, <API key>, dissect_h501_NULL },
{ 10, &<API key>, <API key>, dissect_h501_NULL },
{ 11, &<API key>, <API key>, dissect_h501_NULL },
{ 12, &<API key>, <API key>, dissect_h501_NULL },
{ 13, &<API key>, <API key>, dissect_h501_NULL },
{ 14, &<API key>, <API key>, dissect_h501_NULL },
{ 15, &<API key>, <API key>, dissect_h501_NULL },
{ 16, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_04 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_delay , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , <API key>, ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "notSupported" },
{ 1, "<API key>" },
{ 2, "undefined" },
{ 3, "neededFeature" },
{ 4, "genericDataReason" },
{ 5, "unknownServiceID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key> , <API key>, dissect_h501_NULL },
{ 4, &<API key>, <API key>, dissect_h501_NULL },
{ 5, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_08 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, NULL);
return offset;
}
static const value_string <API key>[] = {
{ 0, "notUnderstood" },
{ 1, "undefined" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_reason_09 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_callInfo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_usageSpec , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string h501_Role_vals[] = {
{ 0, "originator" },
{ 1, "destination" },
{ 2, "nonStandardData" },
{ 0, NULL }
};
static const per_choice_t Role_choice[] = {
{ 0, &hf_h501_originator , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_destination , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 0, NULL, 0, NULL }
};
static int
dissect_h501_Role(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h501_Role, Role_choice,
NULL);
return offset;
}
static const value_string <API key>[] = {
{ 0, "preConnect" },
{ 1, "callInProgress" },
{ 2, "callEnded" },
{ 3, "registrationLost" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &hf_h501_preConnect , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_callEnded , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_causeIE , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t UsageField_sequence[] = {
{ &hf_h501_id , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_value , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_UsageField, UsageField_sequence);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_callInfo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_senderRole , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_h501_Role },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_srcInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_destAddress , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_startTime , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_endTime , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_usageFields , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "unknownCall" },
{ 1, "incomplete" },
{ 2, "security" },
{ 3, "<API key>" },
{ 4, "undefined" },
{ 5, "neededFeature" },
{ 6, "genericDataReason" },
{ 7, "unknownServiceID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &hf_h501_unknownCall , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_incomplete , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key> , <API key>, dissect_h501_NULL },
{ 6, &<API key>, <API key>, dissect_h501_NULL },
{ 7, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_06 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "invalidCall" },
{ 1, "unavailable" },
{ 2, "security" },
{ 3, "<API key>" },
{ 4, "undefined" },
{ 5, "neededFeature" },
{ 6, "genericDataReason" },
{ 7, "unknownServiceID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &hf_h501_invalidCall , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_unavailable , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key> , <API key>, dissect_h501_NULL },
{ 6, &<API key>, <API key>, dissect_h501_NULL },
{ 7, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_05 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_accessToken , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_sourceInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_callInfo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_usageSpec , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_usageSpec , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "tokenNotValid" },
{ 1, "security" },
{ 2, "hopCountExceeded" },
{ 3, "missingSourceInfo" },
{ 4, "missingDestInfo" },
{ 5, "<API key>" },
{ 6, "undefined" },
{ 7, "neededFeature" },
{ 8, "genericDataReason" },
{ 9, "unknownServiceID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 6, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 7, &<API key> , <API key>, dissect_h501_NULL },
{ 8, &<API key>, <API key>, dissect_h501_NULL },
{ 9, &<API key>, <API key>, dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_07 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
dissect_h501_<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ NULL, ASN1_EXTENSION_ROOT, 0, NULL }
};
static int
dissect_h501_<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_<API key>, <API key>);
return offset;
}
static const value_string h501_<API key>[] = {
{ 0, "security" },
{ 1, "hopCountExceeded" },
{ 2, "<API key>" },
{ 3, "undefined" },
{ 4, "neededFeature" },
{ 5, "genericDataReason" },
{ 6, "unknownServiceID" },
{ 7, "<API key>" },
{ 8, "securityReplay" },
{ 9, "<API key>" },
{ 10, "<API key>" },
{ 11, "<API key>" },
{ 12, "securityWrongOID" },
{ 0, NULL }
};
static const per_choice_t <API key>[] = {
{ 0, &hf_h501_security , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 1, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 2, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 3, &hf_h501_undefined , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 4, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 5, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 6, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 7, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 8, &<API key> , ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 9, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 10, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 11, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 12, &<API key>, ASN1_EXTENSION_ROOT , dissect_h501_NULL },
{ 0, NULL, 0, NULL }
};
static int
dissect_h501_<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h501_<API key>, <API key>,
NULL);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &hf_h501_reason_10 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_h501_<API key> },
{ NULL, 0, 0, NULL }
};
static int
dissect_h501_<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_<API key>, <API key>);
return offset;
}
static const value_string <API key>[] = {
{ 0, "serviceRequest" },
{ 1, "serviceConfirmation" },
{ 2, "serviceRejection" },
{ 3, "serviceRelease" },
{ 4, "descriptorRequest" },
{ 5, "<API key>" },
{ 6, "descriptorRejection" },
{ 7, "descriptorIDRequest" },
{ 8, "<API key>" },
{ 9, "<API key>" },
{ 10, "descriptorUpdate" },
{ 11, "descriptorUpdateAck" },
{ 12, "accessRequest" },
{ 13, "accessConfirmation" },
{ 14, "accessRejection" },
{ 15, "requestInProgress" },
{ 16, "nonStandardRequest" },
{ 17, "<API key>" },
{ 18, "<API key>" },
{ 19, "<API key>" },
{ 20, "usageRequest" },
{ 21, "usageConfirmation" },
{ 22, "usageIndication" },
{ 23, "<API key>" },
{ 24, "<API key>" },
{ 25, "usageRejection" },
{ 26, "validationRequest" },
{ 27, "<API key>" },
{ 28, "validationRejection" },
{ 29, "<API key> },
{ 30, "<API key> },
{ 31, "<API key> },
{ 0, NULL }
};
static const per_choice_t MessageBody_choice[] = {
{ 0, &<API key> , ASN1_EXTENSION_ROOT , <API key> },
{ 1, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 2, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 3, &<API key> , ASN1_EXTENSION_ROOT , <API key> },
{ 4, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 5, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 6, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 7, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 8, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 9, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 10, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 11, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 12, &<API key> , ASN1_EXTENSION_ROOT , <API key> },
{ 13, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 14, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 15, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 16, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 17, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 18, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 19, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 20, &<API key> , ASN1_EXTENSION_ROOT , <API key> },
{ 21, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 22, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 23, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 24, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 25, &<API key> , ASN1_EXTENSION_ROOT , <API key> },
{ 26, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 27, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 28, &<API key>, ASN1_EXTENSION_ROOT , <API key> },
{ 29, &hf_h501_<API key>, <API key>, dissect_h501_<API key> },
{ 30, &hf_h501_<API key>, <API key>, dissect_h501_<API key> },
{ 31, &hf_h501_<API key>, <API key>, dissect_h501_<API key> },
{ 0, NULL, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 22 "../../asn1/h501/h501.cnf"
gint32 msg_type = -1;
const gchar *p = NULL;
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
<API key>, MessageBody_choice,
&msg_type);
#line 25 "../../asn1/h501/h501.cnf"
p = try_val_to_str(msg_type, VALS(<API key>));
if (p )
col_set_str(actx->pinfo->cinfo, COL_INFO, p);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
0U, 65535U, NULL, FALSE);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index, NULL);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
1U, 255U, NULL, FALSE);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &hf_h501_tokens_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index);
return offset;
}
static const per_sequence_t <API key>[1] = {
{ &<API key>, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, <API key> },
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t <API key>[] = {
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_hopCount , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key>, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h225_ICV },
{ &hf_h501_tokens , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &<API key> , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_nonStandard , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , <API key> },
{ &hf_h501_serviceID , <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_genericData , <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_featureSet , <API key>, ASN1_OPTIONAL , <API key> },
{ &hf_h501_version , <API key>, ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
<API key>, <API key>);
return offset;
}
static const per_sequence_t Message_sequence[] = {
{ &hf_h501_body , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ &hf_h501_common , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, <API key> },
{ NULL, 0, 0, NULL }
};
static int
<API key>(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = <API key>(tvb, offset, actx, tree, hf_index,
ett_h501_Message, Message_sequence);
return offset;
}
static int dissect_Message_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
offset = <API key>(tvb, offset, &asn1_ctx, tree, hf_h501_Message_PDU);
offset += 7; offset >>= 3;
return offset;
}
#line 62 "../../asn1/h501/<API key>.c"
static int
dissect_h501_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
proto_item *ti = NULL;
proto_tree *h501_tree = NULL;
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
ti = proto_tree_add_item(tree, proto_h501, tvb, 0, -1, ENC_NA);
h501_tree = <API key>(ti, ett_h501);
return dissect_Message_PDU(tvb, pinfo, h501_tree, NULL);
}
static int
dissect_h501_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, FALSE, h501_pdu_handle);
return tvb_length(tvb);
}
static int
dissect_h501_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, h501_desegment_tcp, h501_pdu_handle);
return tvb_length(tvb);
}
void proto_register_h501(void) {
module_t *h501_module;
/* List of fields */
static hf_register_info hf[] = {
#line 1 "../../asn1/h501/packet-h501-hfarr.c"
{ &hf_h501_Message_PDU,
{ "Message", "h501.Message",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_body,
{ "body", "h501.body",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"MessageBody", HFILL }},
{ &hf_h501_common,
{ "common", "h501.common",
FT_NONE, BASE_NONE, NULL, 0,
"MessageCommonInfo", HFILL }},
{ &<API key>,
{ "serviceRequest", "h501.serviceRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "serviceConfirmation", "h501.serviceConfirmation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "serviceRejection", "h501.serviceRejection",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "serviceRelease", "h501.serviceRelease",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorRequest", "h501.descriptorRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorRejection", "h501.descriptorRejection",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorIDRequest", "h501.descriptorIDRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorUpdate", "h501.descriptorUpdate",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorUpdateAck", "h501.descriptorUpdateAck",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "accessRequest", "h501.accessRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "accessConfirmation", "h501.accessConfirmation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "accessRejection", "h501.accessRejection",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "requestInProgress", "h501.requestInProgress",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "nonStandardRequest", "h501.nonStandardRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "usageRequest", "h501.usageRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "usageConfirmation", "h501.usageConfirmation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "usageIndication", "h501.usageIndication",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "usageRejection", "h501.usageRejection",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "validationRequest", "h501.validationRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "validationRejection", "h501.validationRejection",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_<API key>,
{ "<API key>, "h501.<API key>,
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_<API key>,
{ "<API key>, "h501.<API key>,
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_<API key>,
{ "<API key>, "h501.<API key>,
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "sequenceNumber", "h501.sequenceNumber",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_0_65535", HFILL }},
{ &<API key>,
{ "annexGversion", "h501.annexGversion",
FT_OID, BASE_NONE, NULL, 0,
"ProtocolVersion", HFILL }},
{ &hf_h501_hopCount,
{ "hopCount", "h501.hopCount",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_1_255", HFILL }},
{ &<API key>,
{ "replyAddress", "h501.replyAddress",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "TransportAddress", "h501.TransportAddress",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &<API key>,
{ "integrityCheckValue", "h501.integrityCheckValue",
FT_NONE, BASE_NONE, NULL, 0,
"ICV", HFILL }},
{ &hf_h501_tokens,
{ "tokens", "h501.tokens",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_tokens_item,
{ "ClearToken", "h501.ClearToken",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "cryptoTokens", "h501.cryptoTokens",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "CryptoH323Token", "h501.CryptoH323Token",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_nonStandard,
{ "nonStandard", "h501.nonStandard",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_serviceID,
{ "serviceID", "h501.serviceID",
FT_GUID, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_genericData,
{ "genericData", "h501.genericData",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "GenericData", "h501.GenericData",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_featureSet,
{ "featureSet", "h501.featureSet",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_version,
{ "version", "h501.version",
FT_OID, BASE_NONE, NULL, 0,
"ProtocolVersion", HFILL }},
{ &<API key>,
{ "elementIdentifier", "h501.elementIdentifier",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "domainIdentifier", "h501.domainIdentifier",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &<API key>,
{ "securityMode", "h501.securityMode",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "SecurityMode", "h501.SecurityMode",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_timeToLive,
{ "timeToLive", "h501.timeToLive",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_usageSpec,
{ "usageSpec", "h501.usageSpec",
FT_NONE, BASE_NONE, NULL, 0,
"UsageSpecification", HFILL }},
{ &<API key>,
{ "authentication", "h501.authentication",
FT_UINT32, BASE_DEC, VALS(h235_<API key>), 0,
"<API key>, HFILL }},
{ &hf_h501_integrity,
{ "integrity", "h501.integrity",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"IntegrityMechanism", HFILL }},
{ &<API key>,
{ "algorithmOIDs", "h501.algorithmOIDs",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "algorithmOIDs item", "h501.algorithmOIDs_item",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_h501_alternates,
{ "alternates", "h501.alternates",
FT_NONE, BASE_NONE, NULL, 0,
"AlternatePEInfo", HFILL }},
{ &<API key>,
{ "securityMode", "h501.securityMode",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "serviceUnavailable", "h501.serviceUnavailable",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "serviceRedirected", "h501.serviceRedirected",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_security,
{ "security", "h501.security",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_continue,
{ "continue", "h501.continue",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_undefined,
{ "undefined", "h501.undefined",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "unknownServiceID", "h501.unknownServiceID",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "neededFeature", "h501.neededFeature",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "genericDataReason", "h501.genericDataReason",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "usageUnavailable", "h501.usageUnavailable",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "unknownUsageSendTo", "h501.unknownUsageSendTo",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_01,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "outOfService", "h501.outOfService",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_maintenance,
{ "maintenance", "h501.maintenance",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_terminated,
{ "terminated", "h501.terminated",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_expired,
{ "expired", "h501.expired",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorID", "h501.descriptorID",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "DescriptorID", "h501.DescriptorID",
FT_GUID, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_descriptor,
{ "descriptor", "h501.descriptor",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "Descriptor", "h501.Descriptor",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_02,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "descriptorID", "h501.descriptorID",
FT_GUID, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "packetSizeExceeded", "h501.packetSizeExceeded",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_illegalID,
{ "illegalID", "h501.illegalID",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "hopCountExceeded", "h501.hopCountExceeded",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorInfo", "h501.descriptorInfo",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "DescriptorInfo", "h501.DescriptorInfo",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_03,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "noDescriptors", "h501.noDescriptors",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_sender,
{ "sender", "h501.sender",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &hf_h501_updateInfo,
{ "updateInfo", "h501.updateInfo",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "UpdateInformation", "h501.UpdateInformation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorInfo", "h501.descriptorInfo",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptor", "h501.descriptor",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_updateType,
{ "updateType", "h501.updateType",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_added,
{ "added", "h501.added",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_deleted,
{ "deleted", "h501.deleted",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_changed,
{ "changed", "h501.changed",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "destinationInfo", "h501.destinationInfo",
FT_NONE, BASE_NONE, NULL, 0,
"PartyInformation", HFILL }},
{ &hf_h501_sourceInfo,
{ "sourceInfo", "h501.sourceInfo",
FT_NONE, BASE_NONE, NULL, 0,
"PartyInformation", HFILL }},
{ &hf_h501_callInfo,
{ "callInfo", "h501.callInfo",
FT_NONE, BASE_NONE, NULL, 0,
"CallInformation", HFILL }},
{ &<API key>,
{ "desiredProtocols", "h501.desiredProtocols",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "SupportedProtocols", "h501.SupportedProtocols",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_templates,
{ "templates", "h501.templates",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "AddressTemplate", "h501.AddressTemplate",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "partialResponse", "h501.partialResponse",
FT_BOOLEAN, BASE_NONE, NULL, 0,
"BOOLEAN", HFILL }},
{ &<API key>,
{ "supportedProtocols", "h501.supportedProtocols",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "SupportedProtocols", "h501.SupportedProtocols",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &<API key>,
{ "serviceControl", "h501.serviceControl",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_04,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &hf_h501_noMatch,
{ "noMatch", "h501.noMatch",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "needCallInformation", "h501.needCallInformation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "aliasesInconsistent", "h501.aliasesInconsistent",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "resourceUnavailable", "h501.resourceUnavailable",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "incompleteAddress", "h501.incompleteAddress",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_05,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"UsageRejectReason", HFILL }},
{ &<API key>,
{ "accessTokens", "h501.accessTokens",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "AccessToken", "h501.AccessToken",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_senderRole,
{ "senderRole", "h501.senderRole",
FT_UINT32, BASE_DEC, VALS(h501_Role_vals), 0,
"Role", HFILL }},
{ &<API key>,
{ "usageCallStatus", "h501.usageCallStatus",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_srcInfo,
{ "srcInfo", "h501.srcInfo",
FT_NONE, BASE_NONE, NULL, 0,
"PartyInformation", HFILL }},
{ &hf_h501_destAddress,
{ "destAddress", "h501.destAddress",
FT_NONE, BASE_NONE, NULL, 0,
"PartyInformation", HFILL }},
{ &hf_h501_startTime,
{ "startTime", "h501.startTime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
"TimeStamp", HFILL }},
{ &hf_h501_endTime,
{ "endTime", "h501.endTime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
"TimeStamp", HFILL }},
{ &<API key>,
{ "terminationCause", "h501.terminationCause",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_usageFields,
{ "usageFields", "h501.usageFields",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "UsageField", "h501.UsageField",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_id,
{ "id", "h501.id",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_h501_value,
{ "value", "h501.value",
FT_BYTES, BASE_NONE, NULL, 0,
"OCTET_STRING", HFILL }},
{ &hf_h501_invalidCall,
{ "invalidCall", "h501.invalidCall",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_unavailable,
{ "unavailable", "h501.unavailable",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_06,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &hf_h501_unknownCall,
{ "unknownCall", "h501.unknownCall",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_incomplete,
{ "incomplete", "h501.incomplete",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_accessToken,
{ "accessToken", "h501.accessToken",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "AccessToken", "h501.AccessToken",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_reason_07,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "tokenNotValid", "h501.tokenNotValid",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "missingSourceInfo", "h501.missingSourceInfo",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "missingDestInfo", "h501.missingDestInfo",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_delay,
{ "delay", "h501.delay",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_1_65535", HFILL }},
{ &hf_h501_reason_08,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "notSupported", "h501.notSupported",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "unknownMessage", "h501.unknownMessage",
FT_BYTES, BASE_NONE, NULL, 0,
"OCTET_STRING", HFILL }},
{ &hf_h501_reason_09,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"<API key>", HFILL }},
{ &<API key>,
{ "notUnderstood", "h501.notUnderstood",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "applicationMessage", "h501.applicationMessage",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_reason_10,
{ "reason", "h501.reason",
FT_UINT32, BASE_DEC, VALS(h501_<API key>), 0,
"<API key>, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "securityReplay", "h501.securityReplay",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "securityWrongOID", "h501.securityWrongOID",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_pattern,
{ "pattern", "h501.pattern",
FT_UINT32, BASE_DEC, NULL, 0,
"SEQUENCE_OF_Pattern", HFILL }},
{ &<API key>,
{ "Pattern", "h501.Pattern",
FT_UINT32, BASE_DEC, VALS(h501_Pattern_vals), 0,
NULL, HFILL }},
{ &hf_h501_routeInfo,
{ "routeInfo", "h501.routeInfo",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "RouteInformation", "h501.RouteInformation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_specific,
{ "specific", "h501.specific",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &hf_h501_wildcard,
{ "wildcard", "h501.wildcard",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &hf_h501_range,
{ "range", "h501.range",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "startOfRange", "h501.startOfRange",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"PartyNumber", HFILL }},
{ &hf_h501_endOfRange,
{ "endOfRange", "h501.endOfRange",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"PartyNumber", HFILL }},
{ &hf_h501_messageType,
{ "messageType", "h501.messageType",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &<API key>,
{ "sendAccessRequest", "h501.sendAccessRequest",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_sendSetup,
{ "sendSetup", "h501.sendSetup",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_nonExistent,
{ "nonExistent", "h501.nonExistent",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "callSpecific", "h501.callSpecific",
FT_BOOLEAN, BASE_NONE, NULL, 0,
"BOOLEAN", HFILL }},
{ &hf_h501_priceInfo,
{ "priceInfo", "h501.priceInfo",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "PriceInfoSpec", "h501.PriceInfoSpec",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_contacts,
{ "contacts", "h501.contacts",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "ContactInformation", "h501.ContactInformation",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_type,
{ "type", "h501.type",
FT_NONE, BASE_NONE, NULL, 0,
"EndpointType", HFILL }},
{ &hf_h501_circuitID,
{ "circuitID", "h501.circuitID",
FT_NONE, BASE_NONE, NULL, 0,
"CircuitInfo", HFILL }},
{ &<API key>,
{ "supportedCircuits", "h501.supportedCircuits",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "CircuitIdentifier", "h501.CircuitIdentifier",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "transportAddress", "h501.transportAddress",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &hf_h501_priority,
{ "priority", "h501.priority",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_0_127", HFILL }},
{ &<API key>,
{ "transportQoS", "h501.transportQoS",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_security_01,
{ "security", "h501.security",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "SecurityMode", "h501.SecurityMode",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "multipleCalls", "h501.multipleCalls",
FT_BOOLEAN, BASE_NONE, NULL, 0,
"BOOLEAN", HFILL }},
{ &hf_h501_currency,
{ "currency", "h501.currency",
FT_STRING, BASE_NONE, NULL, 0,
"IA5String_SIZE_3", HFILL }},
{ &<API key>,
{ "currencyScale", "h501.currencyScale",
FT_INT32, BASE_DEC, NULL, 0,
"INTEGER_M127_127", HFILL }},
{ &hf_h501_validFrom,
{ "validFrom", "h501.validFrom",
FT_STRING, BASE_NONE, NULL, 0,
"GlobalTimeStamp", HFILL }},
{ &hf_h501_validUntil,
{ "validUntil", "h501.validUntil",
FT_STRING, BASE_NONE, NULL, 0,
"GlobalTimeStamp", HFILL }},
{ &hf_h501_hoursFrom,
{ "hoursFrom", "h501.hoursFrom",
FT_STRING, BASE_NONE, NULL, 0,
"IA5String_SIZE_6", HFILL }},
{ &hf_h501_hoursUntil,
{ "hoursUntil", "h501.hoursUntil",
FT_STRING, BASE_NONE, NULL, 0,
"IA5String_SIZE_6", HFILL }},
{ &<API key>,
{ "priceElement", "h501.priceElement",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "PriceElement", "h501.PriceElement",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "priceFormula", "h501.priceFormula",
FT_STRING, BASE_NONE, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_amount,
{ "amount", "h501.amount",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_quantum,
{ "quantum", "h501.quantum",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_units,
{ "units", "h501.units",
FT_UINT32, BASE_DEC, VALS(h501_T_units_vals), 0,
NULL, HFILL }},
{ &hf_h501_seconds,
{ "seconds", "h501.seconds",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_packets,
{ "packets", "h501.packets",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_bytes,
{ "bytes", "h501.bytes",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_initial,
{ "initial", "h501.initial",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_minimum,
{ "minimum", "h501.minimum",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_maximum,
{ "maximum", "h501.maximum",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "descriptorInfo", "h501.descriptorInfo",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "gatekeeperID", "h501.gatekeeperID",
FT_STRING, BASE_NONE, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_lastChanged,
{ "lastChanged", "h501.lastChanged",
FT_STRING, BASE_NONE, NULL, 0,
"GlobalTimeStamp", HFILL }},
{ &hf_h501_alternatePE,
{ "alternatePE", "h501.alternatePE",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "AlternatePE", "h501.AlternatePE",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_BOOLEAN, BASE_NONE, NULL, 0,
"BOOLEAN", HFILL }},
{ &<API key>,
{ "contactAddress", "h501.contactAddress",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &hf_h501_priority_01,
{ "priority", "h501.priority",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_1_127", HFILL }},
{ &hf_h501_token,
{ "token", "h501.token",
FT_NONE, BASE_NONE, NULL, 0,
"ClearToken", HFILL }},
{ &hf_h501_cryptoToken,
{ "cryptoToken", "h501.cryptoToken",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
"CryptoH323Token", HFILL }},
{ &<API key>,
{ "genericData", "h501.genericData",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "callIdentifier", "h501.callIdentifier",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "conferenceID", "h501.conferenceID",
FT_GUID, BASE_NONE, NULL, 0,
"<API key>", HFILL }},
{ &hf_h501_preConnect,
{ "preConnect", "h501.preConnect",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "callInProgress", "h501.callInProgress",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_callEnded,
{ "callEnded", "h501.callEnded",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "registrationLost", "h501.registrationLost",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "userIdentifier", "h501.userIdentifier",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &<API key>,
{ "userAuthenticator", "h501.userAuthenticator",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "CryptoH323Token", "h501.CryptoH323Token",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_sendTo,
{ "sendTo", "h501.sendTo",
FT_STRING, BASE_NONE, NULL, 0,
"ElementIdentifier", HFILL }},
{ &hf_h501_when,
{ "when", "h501.when",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_never,
{ "never", "h501.never",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_start,
{ "start", "h501.start",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_end,
{ "end", "h501.end",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_period,
{ "period", "h501.period",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_1_65535", HFILL }},
{ &hf_h501_failures,
{ "failures", "h501.failures",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_required,
{ "required", "h501.required",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "required item", "h501.required_item",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_h501_preferred,
{ "preferred", "h501.preferred",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "preferred item", "h501.preferred_item",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &<API key>,
{ "sendToPEAddress", "h501.sendToPEAddress",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
"AliasAddress", HFILL }},
{ &<API key>,
{ "logicalAddresses", "h501.logicalAddresses",
FT_UINT32, BASE_DEC, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "AliasAddress", "h501.AliasAddress",
FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0,
NULL, HFILL }},
{ &<API key>,
{ "endpointType", "h501.endpointType",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_userInfo,
{ "userInfo", "h501.userInfo",
FT_NONE, BASE_NONE, NULL, 0,
"UserInformation", HFILL }},
{ &hf_h501_timeZone,
{ "timeZone", "h501.timeZone",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &hf_h501_originator,
{ "originator", "h501.originator",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_h501_destination,
{ "destination", "h501.destination",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &<API key>,
{ "nonStandardData", "h501.nonStandardData",
FT_NONE, BASE_NONE, NULL, 0,
"<API key>", HFILL }},
{ &<API key>,
{ "<API key>", "h501.<API key>",
FT_UINT32, BASE_DEC, VALS(<API key>), 0,
NULL, HFILL }},
{ &hf_h501_causeIE,
{ "causeIE", "h501.causeIE",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_1_65535", HFILL }},
#line 98 "../../asn1/h501/<API key>.c"
};
/* List of subtrees */
static gint *ett[] = {
&ett_h501,
#line 1 "../../asn1/h501/packet-h501-ettarr.c"
&ett_h501_Message,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&ett_h501_UsageField,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&ett_h501_<API key>,
&ett_h501_<API key>,
&ett_h501_<API key>,
&ett_h501_<API key>,
&<API key>,
&<API key>,
&<API key>,
&ett_h501_Pattern,
&ett_h501_T_range,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&ett_h501_T_units,
&ett_h501_Descriptor,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&<API key>,
&ett_h501_T_when,
&ett_h501_T_required,
&<API key>,
&<API key>,
&<API key>,
&ett_h501_Role,
&<API key>,
#line 104 "../../asn1/h501/<API key>.c"
};
/* Register protocol */
proto_h501 = <API key>(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
<API key>(proto_h501, hf, array_length(hf));
<API key>(ett, array_length(ett));
<API key>(PFNAME, dissect_h501_pdu, proto_h501);
h501_module = <API key>(proto_h501, <API key>);
<API key>(h501_module, "udp.port",
"UDP port",
"Port to be decoded as h501",
10, &h501_udp_port);
<API key>(h501_module, "tcp.port",
"TCP port",
"Port to be decoded as h501",
10, &h501_tcp_port);
<API key>(h501_module, "desegment",
"Desegment H.501 over TCP",
"Desegment H.501 messages that span more TCP segments",
&h501_desegment_tcp);
}
void <API key>(void)
{
static gboolean <API key> = FALSE;
static dissector_handle_t h501_udp_handle;
static dissector_handle_t h501_tcp_handle;
static guint saved_h501_udp_port;
static guint saved_h501_tcp_port;
if (!<API key>) {
h501_pdu_handle = find_dissector(PFNAME);
h501_udp_handle = <API key>(dissect_h501_udp, proto_h501);
h501_tcp_handle = <API key>(dissect_h501_tcp, proto_h501);
<API key> = TRUE;
} else {
<API key>("udp.port", saved_h501_udp_port, h501_udp_handle);
<API key>("tcp.port", saved_h501_tcp_port, h501_tcp_handle);
}
/* Set our port number for future use */
saved_h501_udp_port = h501_udp_port;
dissector_add_uint("udp.port", saved_h501_udp_port, h501_udp_handle);
saved_h501_tcp_port = h501_tcp_port;
dissector_add_uint("tcp.port", saved_h501_tcp_port, h501_tcp_handle);
} |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="es">
<head>
<!-- Generated by javadoc (version 1.7.0_60) on Mon Jan 23 13:30:44 COT 2017 -->
<title>Constant Field Values</title>
<meta name="date" content="2017-01-23">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#uniandes.unacloud">uniandes.unacloud.*</a></li>
</ul>
</div>
<div class="<API key>"><a name="uniandes.unacloud">
</a>
<h2 title="uniandes.unacloud">uniandes.unacloud.*</h2>
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>uniandes.unacloud.agent.execution.task.<a href="uniandes/unacloud/agent/execution/task/ExecutorService.html" title="class in uniandes.unacloud.agent.execution.task">ExecutorService</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.execution.task.ExecutorService.<API key>">
</a><code>public static final int</code></td>
<td><code><a href="uniandes/unacloud/agent/execution/task/ExecutorService.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.execution.task.ExecutorService.<API key>">
</a><code>public static final int</code></td>
<td><code><a href="uniandes/unacloud/agent/execution/task/ExecutorService.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>uniandes.unacloud.agent.platform.<a href="uniandes/unacloud/agent/platform/<API key>.html" title="class in uniandes.unacloud.agent.platform"><API key></a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.platform.<API key>.VMW_VMX_CPU">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/platform/<API key>.html#VMW_VMX_CPU">VMW_VMX_CPU</a></code></td>
<td class="colLast"><code>"numvcpus"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.platform.<API key>.VMW_VMX_MEMORY">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/platform/<API key>.html#VMW_VMX_MEMORY">VMW_VMX_MEMORY</a></code></td>
<td class="colLast"><code>"memsize"</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>uniandes.unacloud.agent.system.<a href="uniandes/unacloud/agent/system/LinuxOS.html" title="class in uniandes.unacloud.agent.system">LinuxOS</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.LinuxOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/LinuxOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"hostname"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.LinuxOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/LinuxOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"logoutLinux.sh "</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.LinuxOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/LinuxOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"restartLinux.sh "</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.LinuxOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/LinuxOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"turnOffLinux.sh "</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.LinuxOS.USER_FOR_OS">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/LinuxOS.html#USER_FOR_OS">USER_FOR_OS</a></code></td>
<td class="colLast"><code>"root"</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>uniandes.unacloud.agent.system.<a href="uniandes/unacloud/agent/system/MacOS.html" title="class in uniandes.unacloud.agent.system">MacOS</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.MacOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/MacOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"hostname"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.MacOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/MacOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"logoutMac.pl"</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.MacOS.MAC_PERL_COMMAND">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/MacOS.html#MAC_PERL_COMMAND">MAC_PERL_COMMAND</a></code></td>
<td class="colLast"><code>"/usr/bin/perl"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.MacOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/MacOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"restartMac.sh"</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.MacOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/MacOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"turnOffMac.sh"</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>uniandes.unacloud.agent.system.<a href="uniandes/unacloud/agent/system/OperatingSystem.html" title="class in uniandes.unacloud.agent.system">OperatingSystem</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.OperatingSystem.BIN">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/OperatingSystem.html#BIN">BIN</a></code></td>
<td class="colLast"><code>"bin"</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>uniandes.unacloud.agent.system.<a href="uniandes/unacloud/agent/system/WindowsOS.html" title="class in uniandes.unacloud.agent.system">WindowsOS</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.WindowsOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/WindowsOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"hostname"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.WindowsOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/WindowsOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"c:\\windows\\system32\\shutdown.exe -l -f"</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.WindowsOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/WindowsOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"c:\\windows\\system32\\shutdown.exe -r -t 30"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="uniandes.unacloud.agent.system.WindowsOS.<API key>">
</a><code>public static final java.lang.String</code></td>
<td><code><a href="uniandes/unacloud/agent/system/WindowsOS.html#<API key>"><API key></a></code></td>
<td class="colLast"><code>"c:\\windows\\system32\\shutdown.exe -s -t 60"</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
</body>
</html> |
<?php die("Access Denied"); ?>#x#s:4492:" 1451372503
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<script type="text/javascript">
var siteurl='/';
var tmplurl='/templates/ja_mendozite/';
var isRTL = false;
</script>
<base href="http://zon.com.tw/zh/component/mailto/" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="generator" content="" />
<title> | </title>
<link href="http://zon.com.tw/zh/component/mailto/?tmpl=component&template=ja_mendozite&link=<SHA1-like>" rel="canonical" />
<link rel="stylesheet" href="/t3-assets/css_9ce88.css" type="text/css" />
<link rel="stylesheet" href="/t3-assets/css_31cec.css" type="text/css" />
<script src="/en/?jat3action=gzip&jat3type=js&jat3file=t3-assets%2Fjs_7f13c.js" type="text/javascript"></script>
<script type="text/javascript">
function keepAlive() { var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
</script>
<script type="text/javascript">
var akoption = {
"colorTable" : true ,
"opacityEffect" : true ,
"foldContent" : true ,
"fixingElement" : true ,
"smoothScroll" : false
} ;
var akconfig = new Object();
akconfig.root = 'http://zon.com.tw/' ;
akconfig.host = 'http://'+location.host+'/' ;
AsikartEasySet.init( akoption , akconfig );
</script>
<link href="/plugins/system/jat3/jat3/base-themes/default/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', 'UA-60602086-1', 'auto');
ga('send', 'pageview');
</script>
<link rel="stylesheet" href="http://zon.com.tw/easyset/css/custom-typo.css" type="text/css" />
<link rel="stylesheet" href="http://zon.com.tw/easyset/css/custom.css" type="text/css" />
</head>
<body id="bd" class="fs3 com_mailto contentpane">
<div id="<API key>">
<div id="system-message">
</div>
</div>
<script type="text/javascript">
Joomla.submitbutton = function(pressbutton)
{
var form = document.getElementById('mailtoForm');
// do field validation
if (form.mailto.value == "" || form.from.value == "")
{
alert('');
return false;
}
form.submit();
}
</script>
<div id="mailto-window">
<h2>
</h2>
<div class="mailto-close">
<a href="javascript: void window.close()" title="">
<span> </span></a>
</div>
<form action="http://zon.com.tw/index.php" id="mailtoForm" method="post">
<div class="formelm">
<label for="mailto_field"></label>
<input type="text" id="mailto_field" name="mailto" class="inputbox" size="25" value=""/>
</div>
<div class="formelm">
<label for="sender_field">
</label>
<input type="text" id="sender_field" name="sender" class="inputbox" value="" size="25" />
</div>
<div class="formelm">
<label for="from_field">
</label>
<input type="text" id="from_field" name="from" class="inputbox" value="" size="25" />
</div>
<div class="formelm">
<label for="subject_field">
</label>
<input type="text" id="subject_field" name="subject" class="inputbox" value="" size="25" />
</div>
<p>
<button class="button" onclick="return Joomla.submitbutton('send');">
</button>
<button class="button" onclick="window.close();return false;">
</button>
</p>
<input type="hidden" name="layout" value="default" />
<input type="hidden" name="option" value="com_mailto" />
<input type="hidden" name="task" value="send" />
<input type="hidden" name="tmpl" value="component" />
<input type="hidden" name="link" value="<SHA1-like>" />
<input type="hidden" name="<API key>" value="1" />
</form>
</div>
</body>
</html>"; |
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.10.29 at 06:46:24 PM CET
package org.jvnet.ogc;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "POIInfoListType", propOrder = {
"poiInfo"
})
public class POIInfoListType {
@XmlElement(name = "POIInfo", required = true)
protected List<POIInfoType> poiInfo;
/**
* Gets the value of the poiInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the poiInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPOIInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link POIInfoType }
*
*
*/
public List<POIInfoType> getPOIInfo() {
if (poiInfo == null) {
poiInfo = new ArrayList<POIInfoType>();
}
return this.poiInfo;
}
} |
#include <windef.h>
#include <winsvc.h>
#include <wine/debug.h>
<API key>(spoolsv);
static VOID CALLBACK ServiceMain(DWORD argc, LPWSTR *argv);
static WCHAR ServiceName[] = L"Spooler";
static <API key> ServiceTable[] =
{
{ServiceName, ServiceMain},
{NULL, NULL}
};
<API key> ServiceStatusHandle;
SERVICE_STATUS ServiceStatus;
static VOID
UpdateServiceStatus(DWORD dwState)
{
ServiceStatus.dwServiceType = <API key>;
ServiceStatus.dwCurrentState = dwState;
if (dwState == SERVICE_RUNNING)
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | <API key>;
else
ServiceStatus.dwControlsAccepted = 0;
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.<API key> = 0;
ServiceStatus.dwCheckPoint = 0;
if (dwState == <API key> ||
dwState == <API key>)
ServiceStatus.dwWaitHint = 10000;
else
ServiceStatus.dwWaitHint = 0;
SetServiceStatus(ServiceStatusHandle,
&ServiceStatus);
}
static DWORD WINAPI
<API key>(DWORD dwControl,
DWORD dwEventType,
LPVOID lpEventData,
LPVOID lpContext)
{
TRACE("<API key>() called\n");
switch (dwControl)
{
case <API key>:
TRACE(" <API key> received\n");
UpdateServiceStatus(SERVICE_STOPPED);
return ERROR_SUCCESS;
case <API key>:
TRACE(" <API key> received\n");
SetServiceStatus(ServiceStatusHandle,
&ServiceStatus);
return ERROR_SUCCESS;
case <API key>:
TRACE(" <API key> received\n");
UpdateServiceStatus(SERVICE_STOPPED);
return ERROR_SUCCESS;
default :
TRACE(" Control %lu received\n");
return <API key>;
}
}
static VOID CALLBACK
ServiceMain(DWORD argc, LPWSTR *argv)
{
<API key>(argc);
<API key>(argv);
TRACE("ServiceMain() called\n");
ServiceStatusHandle = <API key>(ServiceName,
<API key>,
NULL);
TRACE("Calling SetServiceStatus()\n");
UpdateServiceStatus(SERVICE_RUNNING);
TRACE("SetServiceStatus() called\n");
TRACE("ServiceMain() done\n");
}
int
wmain(int argc, WCHAR *argv[])
{
<API key>(argc);
<API key>(argv);
TRACE("Spoolsv: main() started\n");
<API key>(ServiceTable);
TRACE("Spoolsv: main() done\n");
return 0;
}
/* EOF */ |
/**
* This class is generated by jOOQ
*/
package schema.information_schema.tables.records;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(
value = {
"http:
"jOOQ version:3.5.4"
},
comments = "This class is generated by jOOQ"
)
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class StatisticsRecord extends org.jooq.impl.TableRecordImpl<schema.information_schema.tables.records.StatisticsRecord> implements org.jooq.Record16<java.lang.String, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> {
private static final long serialVersionUID = 1031012731;
/**
* Setter for <code>information_schema.STATISTICS.TABLE_CATALOG</code>.
*/
public void setTableCatalog(java.lang.String value) {
setValue(0, value);
}
/**
* Getter for <code>information_schema.STATISTICS.TABLE_CATALOG</code>.
*/
public java.lang.String getTableCatalog() {
return (java.lang.String) getValue(0);
}
/**
* Setter for <code>information_schema.STATISTICS.TABLE_SCHEMA</code>.
*/
public void setTableSchema(java.lang.String value) {
setValue(1, value);
}
/**
* Getter for <code>information_schema.STATISTICS.TABLE_SCHEMA</code>.
*/
public java.lang.String getTableSchema() {
return (java.lang.String) getValue(1);
}
/**
* Setter for <code>information_schema.STATISTICS.TABLE_NAME</code>.
*/
public void setTableName(java.lang.String value) {
setValue(2, value);
}
/**
* Getter for <code>information_schema.STATISTICS.TABLE_NAME</code>.
*/
public java.lang.String getTableName() {
return (java.lang.String) getValue(2);
}
/**
* Setter for <code>information_schema.STATISTICS.NON_UNIQUE</code>.
*/
public void setNonUnique(java.lang.Long value) {
setValue(3, value);
}
/**
* Getter for <code>information_schema.STATISTICS.NON_UNIQUE</code>.
*/
public java.lang.Long getNonUnique() {
return (java.lang.Long) getValue(3);
}
/**
* Setter for <code>information_schema.STATISTICS.INDEX_SCHEMA</code>.
*/
public void setIndexSchema(java.lang.String value) {
setValue(4, value);
}
/**
* Getter for <code>information_schema.STATISTICS.INDEX_SCHEMA</code>.
*/
public java.lang.String getIndexSchema() {
return (java.lang.String) getValue(4);
}
/**
* Setter for <code>information_schema.STATISTICS.INDEX_NAME</code>.
*/
public void setIndexName(java.lang.String value) {
setValue(5, value);
}
/**
* Getter for <code>information_schema.STATISTICS.INDEX_NAME</code>.
*/
public java.lang.String getIndexName() {
return (java.lang.String) getValue(5);
}
/**
* Setter for <code>information_schema.STATISTICS.SEQ_IN_INDEX</code>.
*/
public void setSeqInIndex(java.lang.Long value) {
setValue(6, value);
}
/**
* Getter for <code>information_schema.STATISTICS.SEQ_IN_INDEX</code>.
*/
public java.lang.Long getSeqInIndex() {
return (java.lang.Long) getValue(6);
}
/**
* Setter for <code>information_schema.STATISTICS.COLUMN_NAME</code>.
*/
public void setColumnName(java.lang.String value) {
setValue(7, value);
}
/**
* Getter for <code>information_schema.STATISTICS.COLUMN_NAME</code>.
*/
public java.lang.String getColumnName() {
return (java.lang.String) getValue(7);
}
/**
* Setter for <code>information_schema.STATISTICS.COLLATION</code>.
*/
public void setCollation(java.lang.String value) {
setValue(8, value);
}
/**
* Getter for <code>information_schema.STATISTICS.COLLATION</code>.
*/
public java.lang.String getCollation() {
return (java.lang.String) getValue(8);
}
/**
* Setter for <code>information_schema.STATISTICS.CARDINALITY</code>.
*/
public void setCardinality(java.lang.Long value) {
setValue(9, value);
}
/**
* Getter for <code>information_schema.STATISTICS.CARDINALITY</code>.
*/
public java.lang.Long getCardinality() {
return (java.lang.Long) getValue(9);
}
/**
* Setter for <code>information_schema.STATISTICS.SUB_PART</code>.
*/
public void setSubPart(java.lang.Long value) {
setValue(10, value);
}
/**
* Getter for <code>information_schema.STATISTICS.SUB_PART</code>.
*/
public java.lang.Long getSubPart() {
return (java.lang.Long) getValue(10);
}
/**
* Setter for <code>information_schema.STATISTICS.PACKED</code>.
*/
public void setPacked(java.lang.String value) {
setValue(11, value);
}
/**
* Getter for <code>information_schema.STATISTICS.PACKED</code>.
*/
public java.lang.String getPacked() {
return (java.lang.String) getValue(11);
}
/**
* Setter for <code>information_schema.STATISTICS.NULLABLE</code>.
*/
public void setNullable(java.lang.String value) {
setValue(12, value);
}
/**
* Getter for <code>information_schema.STATISTICS.NULLABLE</code>.
*/
public java.lang.String getNullable() {
return (java.lang.String) getValue(12);
}
/**
* Setter for <code>information_schema.STATISTICS.INDEX_TYPE</code>.
*/
public void setIndexType(java.lang.String value) {
setValue(13, value);
}
/**
* Getter for <code>information_schema.STATISTICS.INDEX_TYPE</code>.
*/
public java.lang.String getIndexType() {
return (java.lang.String) getValue(13);
}
/**
* Setter for <code>information_schema.STATISTICS.COMMENT</code>.
*/
public void setComment(java.lang.String value) {
setValue(14, value);
}
/**
* Getter for <code>information_schema.STATISTICS.COMMENT</code>.
*/
public java.lang.String getComment() {
return (java.lang.String) getValue(14);
}
/**
* Setter for <code>information_schema.STATISTICS.INDEX_COMMENT</code>.
*/
public void setIndexComment(java.lang.String value) {
setValue(15, value);
}
/**
* Getter for <code>information_schema.STATISTICS.INDEX_COMMENT</code>.
*/
public java.lang.String getIndexComment() {
return (java.lang.String) getValue(15);
}
// Record16 type implementation
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row16<java.lang.String, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
return (org.jooq.Row16) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row16<java.lang.String, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
return (org.jooq.Row16) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field1() {
return schema.information_schema.tables.Statistics.STATISTICS.TABLE_CATALOG;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field2() {
return schema.information_schema.tables.Statistics.STATISTICS.TABLE_SCHEMA;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return schema.information_schema.tables.Statistics.STATISTICS.TABLE_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Long> field4() {
return schema.information_schema.tables.Statistics.STATISTICS.NON_UNIQUE;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field5() {
return schema.information_schema.tables.Statistics.STATISTICS.INDEX_SCHEMA;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field6() {
return schema.information_schema.tables.Statistics.STATISTICS.INDEX_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Long> field7() {
return schema.information_schema.tables.Statistics.STATISTICS.SEQ_IN_INDEX;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field8() {
return schema.information_schema.tables.Statistics.STATISTICS.COLUMN_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field9() {
return schema.information_schema.tables.Statistics.STATISTICS.COLLATION;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Long> field10() {
return schema.information_schema.tables.Statistics.STATISTICS.CARDINALITY;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Long> field11() {
return schema.information_schema.tables.Statistics.STATISTICS.SUB_PART;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field12() {
return schema.information_schema.tables.Statistics.STATISTICS.PACKED;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field13() {
return schema.information_schema.tables.Statistics.STATISTICS.NULLABLE;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field14() {
return schema.information_schema.tables.Statistics.STATISTICS.INDEX_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field15() {
return schema.information_schema.tables.Statistics.STATISTICS.COMMENT;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field16() {
return schema.information_schema.tables.Statistics.STATISTICS.INDEX_COMMENT;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value1() {
return getTableCatalog();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value2() {
return getTableSchema();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value3() {
return getTableName();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Long value4() {
return getNonUnique();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value5() {
return getIndexSchema();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value6() {
return getIndexName();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Long value7() {
return getSeqInIndex();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value8() {
return getColumnName();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value9() {
return getCollation();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Long value10() {
return getCardinality();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Long value11() {
return getSubPart();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value12() {
return getPacked();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value13() {
return getNullable();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value14() {
return getIndexType();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value15() {
return getComment();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value16() {
return getIndexComment();
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value1(java.lang.String value) {
setTableCatalog(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value2(java.lang.String value) {
setTableSchema(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value3(java.lang.String value) {
setTableName(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value4(java.lang.Long value) {
setNonUnique(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value5(java.lang.String value) {
setIndexSchema(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value6(java.lang.String value) {
setIndexName(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value7(java.lang.Long value) {
setSeqInIndex(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value8(java.lang.String value) {
setColumnName(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value9(java.lang.String value) {
setCollation(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value10(java.lang.Long value) {
setCardinality(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value11(java.lang.Long value) {
setSubPart(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value12(java.lang.String value) {
setPacked(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value13(java.lang.String value) {
setNullable(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value14(java.lang.String value) {
setIndexType(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value15(java.lang.String value) {
setComment(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord value16(java.lang.String value) {
setIndexComment(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public StatisticsRecord values(java.lang.String value1, java.lang.String value2, java.lang.String value3, java.lang.Long value4, java.lang.String value5, java.lang.String value6, java.lang.Long value7, java.lang.String value8, java.lang.String value9, java.lang.Long value10, java.lang.Long value11, java.lang.String value12, java.lang.String value13, java.lang.String value14, java.lang.String value15, java.lang.String value16) {
return this;
}
// Constructors
/**
* Create a detached StatisticsRecord
*/
public StatisticsRecord() {
super(schema.information_schema.tables.Statistics.STATISTICS);
}
/**
* Create a detached, initialised StatisticsRecord
*/
public StatisticsRecord(java.lang.String tableCatalog, java.lang.String tableSchema, java.lang.String tableName, java.lang.Long nonUnique, java.lang.String indexSchema, java.lang.String indexName, java.lang.Long seqInIndex, java.lang.String columnName, java.lang.String collation, java.lang.Long cardinality, java.lang.Long subPart, java.lang.String packed, java.lang.String nullable, java.lang.String indexType, java.lang.String comment, java.lang.String indexComment) {
super(schema.information_schema.tables.Statistics.STATISTICS);
setValue(0, tableCatalog);
setValue(1, tableSchema);
setValue(2, tableName);
setValue(3, nonUnique);
setValue(4, indexSchema);
setValue(5, indexName);
setValue(6, seqInIndex);
setValue(7, columnName);
setValue(8, collation);
setValue(9, cardinality);
setValue(10, subPart);
setValue(11, packed);
setValue(12, nullable);
setValue(13, indexType);
setValue(14, comment);
setValue(15, indexComment);
}
} |
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Common.h"
#include "Language.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
class vipcommands : public CommandScript
{
public:
vipcommands() : CommandScript("vipcommands") { }
ChatCommand* GetCommands() const
{
static ChatCommand vipCommandTable[] =
{
{ "Buff", SEC_VIP, false, &HandleBuffCommand, "", NULL },
{ "Sala", SEC_VIP, true, &<API key>, "", NULL },
{ "Raça", SEC_VIP, false, &<API key>, "", NULL },
{ "Facção", SEC_VIP, false, &<API key>, "", NULL },
{ "Skills", SEC_VIP, false, &<API key>, "", NULL },
{ "Visual", SEC_VIP, false, &<API key>, "", NULL },
{ "Tele", SEC_VIP, false, &HandleTeleCommand, "", NULL },
{ "Forma", SEC_VIP, false, &HandleMorphCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "Vip", SEC_VIP, true, NULL, "", vipCommandTable},
{ NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
static bool <API key>(ChatHandler * handler, const char * args)
{
Player* player = handler->GetSession()->GetPlayer();
if(player->GetSession()->GetSecurity() >= 1)
{
handler->PSendSysMessage("Você já é um Jogador VIP");
handler->SetSentErrorMessage(true);
return false;
}
if(player->HasItemCount(313370, 1, false)) // Token ID, Count.
{
PreparedStatement* stmt = LoginDatabase.<API key>(<API key>);
stmt->setUInt32(0, player->GetSession()->GetAccountId());
stmt->setUInt8(1, 1);
stmt->setInt32(2, 1);
LoginDatabase.Execute(stmt);
player->DestroyItemCount(313370, 1, true, false); // Token ID, Count.
handler->PSendSysMessage("Você agora é um Jogador VIP, para ativa-lo relogue e entre no jogo novamente");
return true;
}
return true;
}
static bool HandleTeleCommand(ChatHandler* handler, const char* args)
{
if (!*args)
return false;
Player* me = handler->GetSession()->GetPlayer();
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
GameTele const* tele = handler-><API key>((char*)args);
if (!tele)
{
handler->SendSysMessage(<API key>);
handler->SetSentErrorMessage(true);
return false;
}
if (me->IsInCombat())
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
}
MapEntry const* map = sMapStore.LookupEntry(tele->mapId);
if (!map || map-><API key>())
{
handler->SendSysMessage(<API key>);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
if (me->IsInFlight())
{
me->GetMotionMaster()->MovementExpired();
me-><API key>();
}
// save only in non-flight case
else
me->SaveRecallPosition();
me->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
return true;
}
static bool HandleBuffCommand(ChatHandler * handler, const char * args)
{
Player * pl = handler->GetSession()->GetPlayer();
if(pl->IsInCombat())
{
pl->GetSession()->SendNotification("Você não pode usar isso em combate!!");
return false;
}
if(pl->InArena())
{
pl->GetSession()->SendNotification("Você não pode usar isso em uma arena!");
return false;
}
else
pl->AddAura(15366, pl);
pl->AddAura(16609, pl);
pl->AddAura(48162, pl);
pl->AddAura(48074, pl);
pl->AddAura(48170, pl);
pl->AddAura(43223, pl);
pl->AddAura(36880, pl);
pl->AddAura(467, pl);
pl->AddAura(69994, pl);
pl->AddAura(33081, pl);
pl->AddAura(24705, pl);
pl->AddAura(26035, pl);
pl->AddAura(48469, pl);
handler->PSendSysMessage("|cffFFFFFF[|cffFFA500Buff Vip|cffFFFFFF] |cffFF0000Você está quase imortal!");
return true;
}
static bool HandlevipCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->Say("Comandos V.I.P?", LANG_UNIVERSAL);
return true;
}
static bool HandleMorphCommand(ChatHandler* handler, const char* args)
{
handler->GetSession()->GetPlayer()->SetDisplayId((uint32)atol((char*)args));
return true;
}
static bool <API key>(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(<API key>);
handler->PSendSysMessage("Relogue para mudar sua raça!");
return true;
}
static bool <API key>(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(<API key>);
handler->PSendSysMessage("Relogue para mudar sua facção!");
return true;
}
static bool <API key>(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me-><API key>();
handler->PSendSysMessage("Suas habilidades de armas agora estão no nível máximo!");
return true;
}
static bool <API key>(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
handler->PSendSysMessage("Relogue para mudar o seu visual!");
return true;
}
static bool <API key>(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
if (me->IsInCombat())
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
if (me->IsInFlight())
{
me->GetMotionMaster()->MovementExpired();
me-><API key>();
}
// save only in non-flight case
else
me->SaveRecallPosition();
me->TeleportTo(1, 4847.365234f, -2811.368408f, 1444.530029f, 6.261538f); // MapId, X, Y, Z, O
return true;
}
};
void AddSC_vipcommands()
{
new vipcommands();
} |
# seven-wonders-back
## Development prerequisites
You have to install the following tools :
* [Java 7](http:
* [Maven 3](https://maven.apache.org/download.cgi)
**NOTE** : You may have to add several paths to the PATH variable on Windows.
## Getting started
In order to run the applications, you have to follow these steps :
* Open a console (cmd or terminal or Powershell) and go into seven-wonders-back directory
* Install dependencies with Maven by running the command `mvn install` (Only for the first time or when the file pom.xml is changed)
* Start the server by running the command `mvn spring-boot:run` or by running Application.java as a java application from an IDE such as Eclipse or Netbeans |
package com.sun.javafx.css;
import com.sun.javafx.util.Logging;
import javafx.css.CssMetaData;
import javafx.css.ParsedValue;
import javafx.css.StyleConverter;
import javafx.css.Styleable;
import sun.util.logging.PlatformLogger;
import sun.util.logging.PlatformLogger.Level;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
/**
* Converter converts ParsedValueImpl<F,T> from type F to type T.
* F is the type of the parsed value, T is the converted type of
* the ParsedValueImpl. For example, a converter from String to Color would
* be declared
* <p>
* <code>public Color convert(ParsedValueImpl<String,Color> value, Font font)</code>
* </p>
*/
public class StyleConverterImpl<F, T> extends StyleConverter<F, T> {
/**
* Convert from the constituent values to the target property type.
* Implemented by Types that have Keys with subKeys.
*/
public T convert(Map<CssMetaData<? extends Styleable, ?>,Object> convertedValues) {
return null;
}
protected StyleConverterImpl() {
super();
}
public void writeBinary(DataOutputStream os, StringStore sstore)
throws IOException {
String cname = getClass().getName();
int index = sstore.addString(cname);
os.writeShort(index);
}
private static Map<ParsedValue, Object> cache;
static void clearCache() { if (cache != null) cache.clear(); }
protected T getCachedValue(ParsedValue key) {
if (cache != null) {
return (T)cache.get(key);
}
return null;
}
protected void cacheValue(ParsedValue key, Object value) {
if (cache == null) cache = new WeakHashMap<>();
cache.put(key, value);
}
// map of StyleConverter class name to StyleConverter
private static Map<String,StyleConverter<?, ?>> tmap;
@SuppressWarnings("rawtypes")
public static StyleConverter<?,?> readBinary(DataInputStream is, String[] strings)
throws IOException {
int index = is.readShort();
String cname = strings[index];
if (cname == null || cname.isEmpty()) return null;
if (cname.startsWith("com.sun.javafx.css.converters.EnumConverter")) {
return (StyleConverter)com.sun.javafx.css.converters.EnumConverter.readBinary(is, strings);
}
// Make a new entry in tmap, if necessary
if (tmap == null || !tmap.containsKey(cname)) {
StyleConverter<?,?> converter = getInstance(cname);
if (converter == null) {
final PlatformLogger logger = Logging.getCSSLogger();
if (logger.isLoggable(Level.SEVERE)) {
logger.severe("could not deserialize " + cname);
}
}
if (converter == null) {
System.err.println("could not deserialize " + cname);
}
if (tmap == null) tmap = new HashMap<String,StyleConverter<?,?>>();
tmap.put(cname, converter);
return converter;
}
return tmap.get(cname);
}
// package for unit test purposes
static StyleConverter<?,?> getInstance(final String converterClass) {
StyleConverter<?,?> styleConverter = null;
switch(converterClass) {
case "com.sun.javafx.css.converters.BooleanConverter" :
styleConverter = com.sun.javafx.css.converters.BooleanConverter.getInstance();
break;
case "com.sun.javafx.css.converters.ColorConverter" :
styleConverter = com.sun.javafx.css.converters.ColorConverter.getInstance();
break;
case "com.sun.javafx.css.converters.CursorConverter" :
styleConverter = com.sun.javafx.css.converters.CursorConverter.getInstance();
break;
case "com.sun.javafx.css.converters.EffectConverter" :
styleConverter = com.sun.javafx.css.converters.EffectConverter.getInstance();
break;
case "com.sun.javafx.css.converters.EffectConverter$DropShadowConverter" :
styleConverter = com.sun.javafx.css.converters.EffectConverter.DropShadowConverter.getInstance();
break;
case "com.sun.javafx.css.converters.EffectConverter$<API key>" :
styleConverter = com.sun.javafx.css.converters.EffectConverter.<API key>.getInstance();
break;
case "com.sun.javafx.css.converters.FontConverter" :
styleConverter = com.sun.javafx.css.converters.FontConverter.getInstance();
break;
case "com.sun.javafx.css.converters.FontConverter$FontStyleConverter" :
case "com.sun.javafx.css.converters.FontConverter$StyleConverter" :
styleConverter = com.sun.javafx.css.converters.FontConverter.FontStyleConverter.getInstance();
break;
case "com.sun.javafx.css.converters.FontConverter$FontWeightConverter" :
case "com.sun.javafx.css.converters.FontConverter$WeightConverter" :
styleConverter = com.sun.javafx.css.converters.FontConverter.FontWeightConverter.getInstance();
break;
case "com.sun.javafx.css.converters.FontConverter$FontSizeConverter" :
case "com.sun.javafx.css.converters.FontConverter$SizeConverter" :
styleConverter = com.sun.javafx.css.converters.FontConverter.FontSizeConverter.getInstance();
break;
case "com.sun.javafx.css.converters.InsetsConverter" :
styleConverter = com.sun.javafx.css.converters.InsetsConverter.getInstance();
break;
case "com.sun.javafx.css.converters.InsetsConverter$SequenceConverter" :
styleConverter = com.sun.javafx.css.converters.InsetsConverter.SequenceConverter.getInstance();
break;
case "com.sun.javafx.css.converters.PaintConverter" :
styleConverter = com.sun.javafx.css.converters.PaintConverter.getInstance();
break;
case "com.sun.javafx.css.converters.PaintConverter$SequenceConverter" :
styleConverter = com.sun.javafx.css.converters.PaintConverter.SequenceConverter.getInstance();
break;
case "com.sun.javafx.css.converters.PaintConverter$<API key>" :
styleConverter = com.sun.javafx.css.converters.PaintConverter.<API key>.getInstance();
break;
case "com.sun.javafx.css.converters.PaintConverter$<API key>" :
styleConverter = com.sun.javafx.css.converters.PaintConverter.<API key>.getInstance();
break;
case "com.sun.javafx.css.converters.SizeConverter" :
styleConverter = com.sun.javafx.css.converters.SizeConverter.getInstance();
break;
case "com.sun.javafx.css.converters.SizeConverter$SequenceConverter" :
styleConverter = com.sun.javafx.css.converters.SizeConverter.SequenceConverter.getInstance();
break;
case "com.sun.javafx.css.converters.StringConverter" :
styleConverter = com.sun.javafx.css.converters.StringConverter.getInstance();
break;
case "com.sun.javafx.css.converters.StringConverter$SequenceConverter" :
styleConverter = com.sun.javafx.css.converters.StringConverter.SequenceConverter.getInstance();
break;
case "com.sun.javafx.css.converters.URLConverter" :
styleConverter = com.sun.javafx.css.converters.URLConverter.getInstance();
break;
case "com.sun.javafx.css.converters.URLConverter$SequenceConverter" :
styleConverter = com.sun.javafx.css.converters.URLConverter.SequenceConverter.getInstance();
break;
// Region stuff - including 2.x class names
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BackgroundImage$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BackgroundImage$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BorderImage$SliceConverter" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.StrokeBorder$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.StrokeBorder$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BackgroundImage$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BackgroundImage$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.StrokeBorder$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.StrokeBorder$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BackgroundImage$<API key>" :
case "com.sun.javafx.scene.layout.region.BorderImage$RepeatConverter" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.BorderImage$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.<API key>" :
case "com.sun.javafx.scene.layout.region.StrokeBorder$<API key>" :
styleConverter = com.sun.javafx.scene.layout.region.<API key>.getInstance();
break;
case "com.sun.javafx.scene.layout.region.Margins$Converter" :
styleConverter = com.sun.javafx.scene.layout.region.Margins.Converter.getInstance();
break;
case "com.sun.javafx.scene.layout.region.Margins$SequenceConverter" :
styleConverter = com.sun.javafx.scene.layout.region.Margins.SequenceConverter.getInstance();
break;
case "javafx.scene.layout.<API key>" :
styleConverter = javafx.scene.layout.<API key>.getInstance();
break;
// parser stuff
case "com.sun.javafx.css.parser.<API key>" :
styleConverter = com.sun.javafx.css.parser.<API key>.getInstance();
break;
case "com.sun.javafx.css.parser.DeriveSizeConverter" :
styleConverter = com.sun.javafx.css.parser.DeriveSizeConverter.getInstance();
break;
case "com.sun.javafx.css.parser.LadderConverter" :
styleConverter = com.sun.javafx.css.parser.LadderConverter.getInstance();
break;
case "com.sun.javafx.css.parser.StopConverter" :
styleConverter = com.sun.javafx.css.parser.StopConverter.getInstance();
break;
default :
final PlatformLogger logger = Logging.getCSSLogger();
if (logger.isLoggable(Level.SEVERE)) {
logger.severe("StyleConverterImpl : converter Class is null for : "+converterClass);
}
break;
}
return styleConverter;
}
} |
<?php get_header(); ?>
<div class="title">
<h2><?php _e('Error 404 - File Not Found'); ?></h2>
</div>
<div <?php post_class(); ?>>
<p class="center"><?php _e('Sorry, but you are looking for something that isn\'t here.'); ?></p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?> |
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include "../iio.h"
#include "../sysfs.h"
#include "../ring_generic.h"
#include "adc.h"
#include "ad7606.h"
int ad7606_reset(struct ad7606_state *st)
{
if (st->have_reset) {
gpio_set_value(st->pdata->gpio_reset, 1);
ndelay(100); /* t_reset >= 100ns */
gpio_set_value(st->pdata->gpio_reset, 0);
return 0;
}
return -ENODEV;
}
static int ad7606_scan_direct(struct iio_dev *indio_dev, unsigned ch)
{
struct ad7606_state *st = iio_priv(indio_dev);
int ret;
st->done = false;
gpio_set_value(st->pdata->gpio_convst, 1);
ret = <API key>(st->wq_data_avail, st->done);
if (ret)
goto error_ret;
if (st->have_frstdata) {
ret = st->bops->read_block(st->dev, 1, st->data);
if (ret)
goto error_ret;
if (!gpio_get_value(st->pdata->gpio_frstdata)) {
/* This should never happen */
ad7606_reset(st);
ret = -EIO;
goto error_ret;
}
ret = st->bops->read_block(st->dev,
st->chip_info->num_channels - 1, &st->data[1]);
if (ret)
goto error_ret;
} else {
ret = st->bops->read_block(st->dev,
st->chip_info->num_channels, st->data);
if (ret)
goto error_ret;
}
ret = st->data[ch];
error_ret:
gpio_set_value(st->pdata->gpio_convst, 0);
return ret;
}
static int ad7606_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long m)
{
int ret;
struct ad7606_state *st = iio_priv(indio_dev);
unsigned int scale_uv;
switch (m) {
case 0:
mutex_lock(&indio_dev->mlock);
if (iio_ring_enabled(indio_dev))
ret = <API key>(indio_dev, chan->address);
else
ret = ad7606_scan_direct(indio_dev, chan->address);
mutex_unlock(&indio_dev->mlock);
if (ret < 0)
return ret;
*val = (short) ret;
return IIO_VAL_INT;
case (1 << <API key>):
scale_uv = (st->range * 1000 * 2)
>> st->chip_info->channels[0].scan_type.realbits;
*val = scale_uv / 1000;
*val2 = (scale_uv % 1000) * 1000;
return <API key>;
}
return -EINVAL;
}
static ssize_t ad7606_show_range(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
return sprintf(buf, "%u\n", st->range);
}
static ssize_t ad7606_store_range(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
unsigned long lval;
if (strict_strtoul(buf, 10, &lval))
return -EINVAL;
if (!(lval == 5000 || lval == 10000)) {
dev_err(dev, "range is not supported\n");
return -EINVAL;
}
mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_range, lval == 10000);
st->range = lval;
mutex_unlock(&indio_dev->mlock);
return count;
}
static IIO_DEVICE_ATTR(range, S_IRUGO | S_IWUSR, \
ad7606_show_range, ad7606_store_range, 0);
static IIO_CONST_ATTR(range_available, "5000 10000");
static ssize_t <API key>(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
return sprintf(buf, "%u\n", st->oversampling);
}
static int <API key>(unsigned val)
{
unsigned char supported[] = {0, 2, 4, 8, 16, 32, 64};
int i;
for (i = 0; i < ARRAY_SIZE(supported); i++)
if (val == supported[i])
return i;
return -EINVAL;
}
static ssize_t <API key>(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
unsigned long lval;
int ret;
if (strict_strtoul(buf, 10, &lval))
return -EINVAL;
ret = <API key>(lval);
if (ret < 0) {
dev_err(dev, "oversampling %lu is not supported\n", lval);
return ret;
}
mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_os0, (ret >> 0) & 1);
gpio_set_value(st->pdata->gpio_os1, (ret >> 1) & 1);
gpio_set_value(st->pdata->gpio_os1, (ret >> 2) & 1);
st->oversampling = lval;
mutex_unlock(&indio_dev->mlock);
return count;
}
static IIO_DEVICE_ATTR(oversampling_ratio, S_IRUGO | S_IWUSR,
<API key>,
<API key>, 0);
static IIO_CONST_ATTR(<API key>, "0 2 4 8 16 32 64");
static struct attribute *ad7606_attributes[] = {
&iio_dev_attr_range.dev_attr.attr,
&<API key>.dev_attr.attr,
&<API key>.dev_attr.attr,
&<API key>.dev_attr.attr,
NULL,
};
static umode_t <API key>(struct kobject *kobj,
struct attribute *attr, int n)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
umode_t mode = attr->mode;
if (!st->have_os &&
(attr == &<API key>.dev_attr.attr ||
attr ==
&<API key>.dev_attr.attr))
mode = 0;
else if (!st->have_range &&
(attr == &iio_dev_attr_range.dev_attr.attr ||
attr == &<API key>.dev_attr.attr))
mode = 0;
return mode;
}
static const struct attribute_group <API key> = {
.attrs = ad7606_attributes,
.is_visible = <API key>,
};
static struct iio_chan_spec ad7606_8_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0,
(1 << <API key>),
0, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0,
(1 << <API key>),
1, 1, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0,
(1 << <API key>),
2, 2, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0,
(1 << <API key>),
3, 3, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0,
(1 << <API key>),
4, 4, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0,
(1 << <API key>),
5, 5, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 6, 0,
(1 << <API key>),
6, 6, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 7, 0,
(1 << <API key>),
7, 7, IIO_ST('s', 16, 16, 0), 0),
<API key>(8),
};
static struct iio_chan_spec ad7606_6_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0,
(1 << <API key>),
0, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0,
(1 << <API key>),
1, 1, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0,
(1 << <API key>),
2, 2, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0,
(1 << <API key>),
3, 3, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 4, 0,
(1 << <API key>),
4, 4, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 5, 0,
(1 << <API key>),
5, 5, IIO_ST('s', 16, 16, 0), 0),
<API key>(6),
};
static struct iio_chan_spec ad7606_4_channels[] = {
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 0, 0,
(1 << <API key>),
0, 0, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 1, 0,
(1 << <API key>),
1, 1, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 2, 0,
(1 << <API key>),
2, 2, IIO_ST('s', 16, 16, 0), 0),
IIO_CHAN(IIO_IN, 0, 1, 0, NULL, 3, 0,
(1 << <API key>),
3, 3, IIO_ST('s', 16, 16, 0), 0),
<API key>(4),
};
static const struct ad7606_chip_info <API key>[] = {
/*
* More devices added in future
*/
[ID_AD7606_8] = {
.name = "ad7606",
.int_vref_mv = 2500,
.channels = ad7606_8_channels,
.num_channels = 8,
},
[ID_AD7606_6] = {
.name = "ad7606-6",
.int_vref_mv = 2500,
.channels = ad7606_6_channels,
.num_channels = 6,
},
[ID_AD7606_4] = {
.name = "ad7606-4",
.int_vref_mv = 2500,
.channels = ad7606_4_channels,
.num_channels = 4,
},
};
static int <API key>(struct ad7606_state *st)
{
struct gpio gpio_array[3] = {
[0] = {
.gpio = st->pdata->gpio_os0,
.flags = GPIOF_DIR_OUT | ((st->oversampling & 1) ?
GPIOF_INIT_HIGH : GPIOF_INIT_LOW),
.label = "AD7606_OS0",
},
[1] = {
.gpio = st->pdata->gpio_os1,
.flags = GPIOF_DIR_OUT | ((st->oversampling & 2) ?
GPIOF_INIT_HIGH : GPIOF_INIT_LOW),
.label = "AD7606_OS1",
},
[2] = {
.gpio = st->pdata->gpio_os2,
.flags = GPIOF_DIR_OUT | ((st->oversampling & 4) ?
GPIOF_INIT_HIGH : GPIOF_INIT_LOW),
.label = "AD7606_OS2",
},
};
int ret;
ret = gpio_request_one(st->pdata->gpio_convst, GPIOF_OUT_INIT_LOW,
"AD7606_CONVST");
if (ret) {
dev_err(st->dev, "failed to request GPIO CONVST\n");
return ret;
}
ret = gpio_request_array(gpio_array, ARRAY_SIZE(gpio_array));
if (!ret) {
st->have_os = true;
}
ret = gpio_request_one(st->pdata->gpio_reset, GPIOF_OUT_INIT_LOW,
"AD7606_RESET");
if (!ret)
st->have_reset = true;
ret = gpio_request_one(st->pdata->gpio_range, GPIOF_DIR_OUT |
((st->range == 10000) ? GPIOF_INIT_HIGH :
GPIOF_INIT_LOW), "AD7606_RANGE");
if (!ret)
st->have_range = true;
ret = gpio_request_one(st->pdata->gpio_stby, GPIOF_OUT_INIT_HIGH,
"AD7606_STBY");
if (!ret)
st->have_stby = true;
if (gpio_is_valid(st->pdata->gpio_frstdata)) {
ret = gpio_request_one(st->pdata->gpio_frstdata, GPIOF_IN,
"AD7606_FRSTDATA");
if (!ret)
st->have_frstdata = true;
}
return 0;
}
static void ad7606_free_gpios(struct ad7606_state *st)
{
if (st->have_range)
gpio_free(st->pdata->gpio_range);
if (st->have_stby)
gpio_free(st->pdata->gpio_stby);
if (st->have_os) {
gpio_free(st->pdata->gpio_os0);
gpio_free(st->pdata->gpio_os1);
gpio_free(st->pdata->gpio_os2);
}
if (st->have_reset)
gpio_free(st->pdata->gpio_reset);
if (st->have_frstdata)
gpio_free(st->pdata->gpio_frstdata);
gpio_free(st->pdata->gpio_convst);
}
/**
* Interrupt handler
*/
static irqreturn_t ad7606_interrupt(int irq, void *dev_id)
{
struct iio_dev *indio_dev = dev_id;
struct ad7606_state *st = iio_priv(indio_dev);
if (iio_ring_enabled(indio_dev)) {
if (!work_pending(&st->poll_work))
schedule_work(&st->poll_work);
} else {
st->done = true;
<API key>(&st->wq_data_avail);
}
return IRQ_HANDLED;
};
static const struct iio_info ad7606_info = {
.driver_module = THIS_MODULE,
.read_raw = &ad7606_read_raw,
.attrs = &<API key>,
};
struct iio_dev *ad7606_probe(struct device *dev, int irq,
void __iomem *base_address,
unsigned id,
const struct ad7606_bus_ops *bops)
{
struct <API key> *pdata = dev->platform_data;
struct ad7606_state *st;
int ret, regdone = 0;
struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st));
if (indio_dev == NULL) {
ret = -ENOMEM;
goto error_ret;
}
st = iio_priv(indio_dev);
st->dev = dev;
st->id = id;
st->irq = irq;
st->bops = bops;
st->base_address = base_address;
st->range = pdata->default_range == 10000 ? 10000 : 5000;
ret = <API key>(pdata->default_os);
if (ret < 0) {
dev_warn(dev, "oversampling %d is not supported\n",
pdata->default_os);
st->oversampling = 0;
} else {
st->oversampling = pdata->default_os;
}
st->reg = regulator_get(dev, "vcc");
if (!IS_ERR(st->reg)) {
ret = regulator_enable(st->reg);
if (ret)
goto error_put_reg;
}
st->pdata = pdata;
st->chip_info = &<API key>[id];
indio_dev->dev.parent = dev;
indio_dev->info = &ad7606_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->name = st->chip_info->name;
indio_dev->channels = st->chip_info->channels;
indio_dev->num_channels = st->chip_info->num_channels;
init_waitqueue_head(&st->wq_data_avail);
ret = <API key>(st);
if (ret)
goto error_disable_reg;
ret = ad7606_reset(st);
if (ret)
dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
ret = request_irq(st->irq, ad7606_interrupt,
<API key>, st->chip_info->name, indio_dev);
if (ret)
goto error_free_gpios;
ret = <API key>(indio_dev);
if (ret)
goto error_free_irq;
ret = iio_device_register(indio_dev);
if (ret)
goto error_free_irq;
regdone = 1;
ret = <API key>(indio_dev->ring, 0,
indio_dev->channels,
indio_dev->num_channels);
if (ret)
goto error_cleanup_ring;
return indio_dev;
error_cleanup_ring:
ad7606_ring_cleanup(indio_dev);
error_free_irq:
free_irq(st->irq, indio_dev);
error_free_gpios:
ad7606_free_gpios(st);
error_disable_reg:
if (!IS_ERR(st->reg))
regulator_disable(st->reg);
error_put_reg:
if (!IS_ERR(st->reg))
regulator_put(st->reg);
if (regdone)
<API key>(indio_dev);
else
iio_free_device(indio_dev);
error_ret:
return ERR_PTR(ret);
}
int ad7606_remove(struct iio_dev *indio_dev)
{
struct ad7606_state *st = iio_priv(indio_dev);
<API key>(indio_dev->ring);
ad7606_ring_cleanup(indio_dev);
free_irq(st->irq, indio_dev);
if (!IS_ERR(st->reg)) {
regulator_disable(st->reg);
regulator_put(st->reg);
}
ad7606_free_gpios(st);
<API key>(indio_dev);
return 0;
}
void ad7606_suspend(struct iio_dev *indio_dev)
{
struct ad7606_state *st = iio_priv(indio_dev);
if (st->have_stby) {
if (st->have_range)
gpio_set_value(st->pdata->gpio_range, 1);
gpio_set_value(st->pdata->gpio_stby, 0);
}
}
void ad7606_resume(struct iio_dev *indio_dev)
{
struct ad7606_state *st = iio_priv(indio_dev);
if (st->have_stby) {
if (st->have_range)
gpio_set_value(st->pdata->gpio_range,
st->range == 10000);
gpio_set_value(st->pdata->gpio_stby, 1);
ad7606_reset(st);
}
}
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("Analog Devices AD7606 ADC");
MODULE_LICENSE("GPL v2"); |
<div class="container" id="mainContent">
<div id="topOfPage">
</div>
<h1>
Submit Feedback
</h1>
<br>
<form action="/page/<API key>" method="post" name="<API key>">
<input name="fsname" type="hidden" value="First Session">
<input name="courseid" type="hidden" value="IFSubmitUiT.CS2104">
<input name="token" type="hidden" value="${sessionToken}">
<input name="user" type="hidden" value="IFSubmitUiT.instr">
<div id="<API key>" style="display: none;">
</div>
<div class="well well-plain" id="course1">
<div class="panel-body">
<div class="form-horizontal">
<div class="panel-heading">
<div class="form-group">
<label class="col-sm-2 control-label">
Course ID:
</label>
<div class="col-sm-10">
<p class="form-control-static">
IFSubmitUiT.CS2104
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Session:
</label>
<div class="col-sm-10">
<p class="form-control-static">
First Session
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Opening time:
</label>
<div class="col-sm-10">
<p class="form-control-static">
Sun, 01 Apr 2012, 11:59 PM UTC+0800
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Closing time:
</label>
<div class="col-sm-10">
<p class="form-control-static" data-end-time="2026-04-30T15:59:00Z" id="end-time">
Thu, 30 Apr 2026, 11:59 PM UTC+0800
</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Instructions:
</label>
<div class="col-sm-10">
<p class="form-control-static text-preserve-space">
Instructions for first session
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<input name="questiontype-1" type="hidden" value="TEXT">
<input name="questionid-1" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 1:
<br>
<span class="text-preserve-space">
What is the best selling point of your product?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-1-0" <API key>="0" id="responsetext-1-0" name="responsetext-1-0" spellcheck="false" style="position: relative;">
<p>
Test Self Feedback
</p>
</div>
<input name="responsetext-1-0" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-1-0" style="color: rgb(128, 128, 128);">
3
</span>
words
</div>
</div>
<input name="responseid-1-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-2" type="hidden" value="TEXT">
<input name="questionid-2" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="3">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 2:
<br>
<span class="text-preserve-space">
Rate 3 students' products
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
<li class="unordered">
The receiving students can see your response, but not your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.alice.b@gmail.tmt">
Alice Betsy</option></td></div>'"
</option>
<option value="IFSubmitUiT.benny.c@gmail.tmt">
Benny Charles
</option>
<option value="IFSubmitUiT.charlie.d@gmail.tmt">
Charlie Davis
</option>
<option value="IFSubmitUiT.danny.e@gmail.tmt">
Danny Engrid
</option>
<option value="IFSubmitUiT.emily.f@gmail.tmt">
Emily
</option>
<option style="display: none;" value="extra.guy@gmail.tmt">
Extra guy
</option>
</select>
</div>
<div class="col-sm-8">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-2-0" <API key>="0" id="responsetext-2-0" name="responsetext-2-0" spellcheck="false" style="position: relative;">
<p>
Edited response to Alice.
</p>
</div>
<input name="responsetext-2-0" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-2-0" style="color: rgb(128, 128, 128);">
4
</span>
words
</div>
</div>
<input name="responseid-2-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.alice.b@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.alice.b@gmail.tmt">
Alice Betsy</option></td></div>'"
</option>
<option value="IFSubmitUiT.benny.c@gmail.tmt">
Benny Charles
</option>
<option value="IFSubmitUiT.charlie.d@gmail.tmt">
Charlie Davis
</option>
<option value="IFSubmitUiT.danny.e@gmail.tmt">
Danny Engrid
</option>
<option value="IFSubmitUiT.emily.f@gmail.tmt">
Emily
</option>
<option selected="" value="extra.guy@gmail.tmt">
Extra guy
</option>
</select>
</div>
<div class="col-sm-8">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-2-1" <API key>="0" id="responsetext-2-1" name="responsetext-2-1" spellcheck="false" style="position: relative;">
<p>
Response to extra guy.
</p>
</div>
<input name="responsetext-2-1" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-2-1" style="color: rgb(128, 128, 128);">
4
</span>
words
</div>
</div>
<input name="responseid-2-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%extra.guy@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign newResponse form-control" name="<API key>" style="width:275px;max-width:275px">
<option selected="" value="">
</option>
<option style="display: none;" value="IFSubmitUiT.alice.b@gmail.tmt">
Alice Betsy</option></td></div>'"
</option>
<option value="IFSubmitUiT.benny.c@gmail.tmt">
Benny Charles
</option>
<option value="IFSubmitUiT.charlie.d@gmail.tmt">
Charlie Davis
</option>
<option value="IFSubmitUiT.danny.e@gmail.tmt">
Danny Engrid
</option>
<option value="IFSubmitUiT.emily.f@gmail.tmt">
Emily
</option>
<option style="display: none;" value="extra.guy@gmail.tmt">
Extra guy
</option>
</select>
</div>
<div class="col-sm-8">
<div class="panel panel-default panel-body mce-content-body content-editor empty" contenteditable="true" <API key>="true" data-length-text-id="responseLength-2-2" <API key>="0" id="responsetext-2-2" name="responsetext-2-2" spellcheck="false" style="position: relative;">
<p>
<br data-mce-bogus="1">
</p>
</div>
<input name="responsetext-2-2" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-2-2" style="color: rgb(128, 128, 128);">
0
</span>
words
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-3" type="hidden" value="TEXT">
<input name="questionid-3" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 3:
<br>
<span class="text-preserve-space">
Comments about the class
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
Instructors in this course can see your response, but not your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="%GENERAL%">
%GENERAL%
</option>
</select>
<span>
%GENERAL%
</span>
</div>
<div class="col-sm-12">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-3-0" <API key>="0" id="responsetext-3-0" name="responsetext-3-0" spellcheck="false" style="position: relative;">
<p>
Feedback to instructors
</p>
</div>
<input name="responsetext-3-0" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-3-0" style="color: rgb(128, 128, 128);">
3
</span>
words
</div>
</div>
<input name="responseid-3-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%%GENERAL%">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-4" type="hidden" value="TEXT">
<input name="questionid-4" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="4">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 4:
<br>
<span class="text-preserve-space">
Give feedback to other instructors.
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving instructors can see your response, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option style="display: none;" value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
<span>
Teammates Test2
</span>
</div>
<div class="col-sm-10">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-4-0" <API key>="0" id="responsetext-4-0" name="responsetext-4-0" spellcheck="false" style="position: relative;">
<p>
Feedback to instructor 2.
</p>
</div>
<input name="responsetext-4-0" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-4-0" style="color: rgb(128, 128, 128);">
4
</span>
words
</div>
</div>
<input name="responseid-4-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr2@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option selected="" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option style="display: none;" value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
<span>
Teammates Test3
</span>
</div>
<div class="col-sm-10">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-4-1" <API key>="0" id="responsetext-4-1" name="responsetext-4-1" spellcheck="false" style="position: relative;">
<p>
Feedback to Instructor 3
</p>
</div>
<input name="responsetext-4-1" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-4-1" style="color: rgb(128, 128, 128);">
4
</span>
words
</div>
</div>
<input name="responseid-4-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr3@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option selected="" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option style="display: none;" value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
<span>
Teammates Test4
</span>
</div>
<div class="col-sm-10">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-4-2" <API key>="0" id="responsetext-4-2" name="responsetext-4-2" spellcheck="false" style="position: relative;">
<p>
Feedback to instructor 4.
</p>
</div>
<input name="responsetext-4-2" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-4-2" style="color: rgb(128, 128, 128);">
4
</span>
words
</div>
</div>
<input name="responseid-4-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr4@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option selected="" value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
<span>
Teammates Test5
</span>
</div>
<div class="col-sm-10">
<div class="panel panel-default panel-body mce-content-body content-editor" contenteditable="true" <API key>="true" data-length-text-id="responseLength-4-3" <API key>="0" id="responsetext-4-3" name="responsetext-4-3" spellcheck="false" style="position: relative;">
<p>
Feedback to instructor 5.
</p>
</div>
<input name="responsetext-4-3" type="hidden">
<div class="margin-top-7px text-color-gray font-weight-normal">
<div class="col-md-6 padding-0" style="display:none">
Recommended length for the answer:
<span id="<API key>">
0
</span>
words
</div>
<div class="pull-right">
Response length:
<span id="responseLength-4-3" style="color: rgb(128, 128, 128);">
4
</span>
words
</div>
</div>
<input name="responseid-4-3" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr5@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-5" type="hidden" value="MCQ">
<input name="questionid-5" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 5:
<br>
<span class="text-preserve-space">
What is the best selling point of your product?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input checked="" name="responsetext-5-0" type="radio" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-5-0" type="radio" value="Algo">
Algo
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-5-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-6" type="hidden" value="MCQ">
<input name="questionid-6" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="3">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 6:
<br>
<span class="text-preserve-space">
What do you think is the other instructors' best feature?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving instructors can see your response, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input checked="" name="responsetext-6-0" type="radio" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-6-0" type="radio" value="Algo">
Algo
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-6-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr2@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option selected="" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input checked="" name="responsetext-6-1" type="radio" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-6-1" type="radio" value="Algo">
Algo
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-6-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr3@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option selected="" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input checked="" name="responsetext-6-2" type="radio" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-6-2" type="radio" value="Algo">
Algo
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-6-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr4@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-7" type="hidden" value="MSQ">
<input name="questionid-7" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 7:
<br>
<span class="text-preserve-space">
What is the best selling point of your product?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-7-0" type="checkbox" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-7-0" type="checkbox" value="Algo">
Algo
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-7-0" type="checkbox" value="Design">
Design
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-7-0" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-7-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-8" type="hidden" value="MSQ">
<input name="questionid-8" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="3">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 8:
<br>
<span class="text-preserve-space">
What do you think is the other instructors' best feature?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving instructors can see your response, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-0" type="checkbox" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-8-0" type="checkbox" value="Algo">
Algo
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-0" type="checkbox" value="Design">
Design
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-0" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-8-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr2@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option selected="" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-1" type="checkbox" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-1" type="checkbox" value="Algo">
Algo
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-8-1" type="checkbox" value="Design">
Design
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-1" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-8-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr3@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option selected="" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-8-2" type="checkbox" value="UI">
UI
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-2" type="checkbox" value="Algo">
Algo
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-2" type="checkbox" value="Design">
Design
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-8-2" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-8-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr4@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-9" type="hidden" value="MCQ">
<input name="questionid-9" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 9:
<br>
<span class="text-preserve-space">
Who is the best student?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-9-0" type="radio" value="Alice Betsy</option></td></div>'" (Team 1</td></div>'")">
Alice Betsy</option></td></div>'" (Team 1</td></div>'")
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-9-0" type="radio" value="Benny Charles (Team 1</td></div>'")">
Benny Charles (Team 1</td></div>'")
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-9-0" type="radio" value="Charlie Davis (Team 2)">
Charlie Davis (Team 2)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-9-0" type="radio" value="Danny Engrid (Team 2)">
Danny Engrid (Team 2)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-9-0" type="radio" value="Emily (Team 3)">
Emily (Team 3)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-9-0" type="radio" value="Extra guy (New Team)">
Extra guy (New Team)
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-9-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-10" type="hidden" value="MSQ">
<input name="questionid-10" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 10:
<br>
<span class="text-preserve-space">
Who are the best students?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-10-0" type="checkbox" value="Alice Betsy</option></td></div>'" (Team 1</td></div>'")">
Alice Betsy</option></td></div>'" (Team 1</td></div>'")
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-10-0" type="checkbox" value="Benny Charles (Team 1</td></div>'")">
Benny Charles (Team 1</td></div>'")
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-10-0" type="checkbox" value="Charlie Davis (Team 2)">
Charlie Davis (Team 2)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-10-0" type="checkbox" value="Danny Engrid (Team 2)">
Danny Engrid (Team 2)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-10-0" type="checkbox" value="Emily (Team 3)">
Emily (Team 3)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-10-0" type="checkbox" value="Extra guy (New Team)">
Extra guy (New Team)
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-10-0" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-10-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-11" type="hidden" value="MCQ">
<input name="questionid-11" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 11:
<br>
<span class="text-preserve-space">
Which is the best team?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-11-0" type="radio" value="New Team">
New Team
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-11-0" type="radio" value="Team 1</td></div>'"">
Team 1</td></div>'"
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input checked="" name="responsetext-11-0" type="radio" value="Team 2">
Team 2
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-11-0" type="radio" value="Team 3">
Team 3
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-11-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-12" type="hidden" value="MSQ">
<input name="questionid-12" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 12:
<br>
<span class="text-preserve-space">
Who are the best teams?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-12-0" type="checkbox" value="New Team">
New Team
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-12-0" type="checkbox" value="Team 1</td></div>'"">
Team 1</td></div>'"
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-12-0" type="checkbox" value="Team 2">
Team 2
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-12-0" type="checkbox" value="Team 3">
Team 3
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-12-0" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-12-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-13" type="hidden" value="NUMSCALE">
<input name="questionid-13" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 13:
<br>
<span class="text-preserve-space">
Rate your product
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<div class="col-sm-3 mobile-no-padding">
<input class="numScaleAnswerBox form-control col-sm-2" max="5" min="1" name="responsetext-13-0" onchange="<API key>(13, 0)" step="0.5" type="number" value="5">
<input name="numscalemin-13-0" type="hidden" value="1">
<input name="numscalemax-13-0" type="hidden" value="5">
<input name="numscalestep-13-0" type="hidden" value="0.5">
</div>
<div class="text-muted form-control-static">
[Possible values: 1, 1.5, 2, ..., 4, 4.5, 5]
</div>
<input name="responseid-13-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-14" type="hidden" value="NUMSCALE">
<input name="questionid-14" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="3">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 14:
<br>
<span class="text-preserve-space">
Rate others' product
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving instructors can see your response, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<div class="col-sm-3 mobile-no-padding">
<input class="numScaleAnswerBox form-control col-sm-2" max="5" min="1" name="responsetext-14-0" onchange="<API key>(14, 0)" step="0.5" type="number" value="1.5">
<input name="numscalemin-14-0" type="hidden" value="1">
<input name="numscalemax-14-0" type="hidden" value="5">
<input name="numscalestep-14-0" type="hidden" value="0.5">
</div>
<div class="text-muted form-control-static">
[Possible values: 1, 1.5, 2, ..., 4, 4.5, 5]
</div>
<input name="responseid-14-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr2@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option selected="" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option style="display: none;" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<div class="col-sm-3 mobile-no-padding">
<input class="numScaleAnswerBox form-control col-sm-2" max="5" min="1" name="responsetext-14-1" onchange="<API key>(14, 1)" step="0.5" type="number" value="2">
<input name="numscalemin-14-1" type="hidden" value="1">
<input name="numscalemax-14-1" type="hidden" value="5">
<input name="numscalestep-14-1" type="hidden" value="0.5">
</div>
<div class="text-muted form-control-static">
[Possible values: 1, 1.5, 2, ..., 4, 4.5, 5]
</div>
<input name="responseid-14-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr3@gmail.tmt">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-4 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="width:275px;max-width:275px">
<option value="">
</option>
<option style="display: none;" value="IFSubmitUiT.instr2@gmail.tmt">
Teammates Test2
</option>
<option style="display: none;" value="IFSubmitUiT.instr3@gmail.tmt">
Teammates Test3
</option>
<option selected="" value="IFSubmitUiT.instr4@gmail.tmt">
Teammates Test4
</option>
<option value="IFSubmitUiT.instr5@gmail.tmt">
Teammates Test5
</option>
</select>
</div>
<div class="col-sm-8">
<div class="col-sm-3 mobile-no-padding">
<input class="numScaleAnswerBox form-control col-sm-2" max="5" min="1" name="responsetext-14-2" onchange="<API key>(14, 2)" step="0.5" type="number" value="3.5">
<input name="numscalemin-14-2" type="hidden" value="1">
<input name="numscalemax-14-2" type="hidden" value="5">
<input name="numscalestep-14-2" type="hidden" value="0.5">
</div>
<div class="text-muted form-control-static">
[Possible values: 1, 1.5, 2, ..., 4, 4.5, 5]
</div>
<input name="responseid-14-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr4@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-15" type="hidden" value="MCQ">
<input name="questionid-15" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 15:
<br>
<span class="text-preserve-space">
Who is the best instructor?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<table>
<tbody>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-15-0" type="radio" value="Teammates Test">
Teammates Test
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input checked="" name="responsetext-15-0" type="radio" value="Teammates Test2">
Teammates Test2
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-15-0" type="radio" value="Teammates Test3">
Teammates Test3
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-15-0" type="radio" value="Teammates Test4">
Teammates Test4
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="radio">
<label class="bold-label">
<input name="responsetext-15-0" type="radio" value="Teammates Test5">
Teammates Test5
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input name="responseid-15-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-16" type="hidden" value="MSQ">
<input name="questionid-16" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 16:
<br>
<span class="text-preserve-space">
Who do you recommend as tutors?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-16-0" type="checkbox" value="Teammates Test">
Teammates Test
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-16-0" type="checkbox" value="Teammates Test2">
Teammates Test2
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-16-0" type="checkbox" value="Teammates Test3">
Teammates Test3
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-16-0" type="checkbox" value="Teammates Test4">
Teammates Test4
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-16-0" type="checkbox" value="Teammates Test5">
Teammates Test5
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-16-0" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-16-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-17" type="hidden" value="CONSTSUM">
<input name="questionid-17" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 17:
<br>
<span class="text-preserve-space">
How important are the following factors to you? Give points accordingly.
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Grades
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-17-0-0" min="0" name="responsetext-17-0" onchange="<API key>('17')" step="1" type="number" value="70">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Fun
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-17-0-1" min="0" name="responsetext-17-0" onchange="<API key>('17')" step="1" type="number" value="30">
</div>
</div>
<div class="form-group" id="constSumInfo-17-0">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-green" id="<API key>">
All points distributed!
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="2">
<input id="constSumPoints-17" type="hidden" value="100">
<input id="<API key>" type="hidden" value="false">
</div>
<input name="responseid-17-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-18" type="hidden" value="CONSTSUM">
<input name="questionid-18" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="4">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 18:
<br>
<span class="text-preserve-space">
Split points among the teams
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving teams can see your response, but not the name of the recipient, or your name.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option selected="" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
Team 1</td></div>'"
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-18-0-0" min="0" name="responsetext-18-0" onchange="<API key>('18')" step="1" type="number" value="90">
</div>
</div>
<div class="form-group" id="constSumInfo-18-0" style="display:none">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-18" type="hidden" value="100">
<input id="<API key>" type="hidden" value="false">
</div>
<input name="responseid-18-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 1</td></div>'"">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option selected="" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
Team 2
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-18-1-0" min="0" name="responsetext-18-1" onchange="<API key>('18')" step="1" type="number" value="110">
</div>
</div>
<div class="form-group" id="constSumInfo-18-1" style="display:none">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-18" type="hidden" value="100">
<input id="<API key>" type="hidden" value="false">
</div>
<input name="responseid-18-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 2">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option selected="" value="Team 3">
Team 3
</option>
</select>
<span>
Team 3
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-18-2-0" min="0" name="responsetext-18-2" onchange="<API key>('18')" step="1" type="number" value="100">
</div>
</div>
<div class="form-group" id="constSumInfo-18-2" style="display:none">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-18" type="hidden" value="100">
<input id="<API key>" type="hidden" value="false">
</div>
<input name="responseid-18-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 3">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign newResponse form-control" name="<API key>" style="display:none;max-width:125px">
<option selected="" value="">
</option>
<option value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
New Team
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-18-3-0" min="0" name="responsetext-18-3" onchange="<API key>('18')" step="1" type="number" value="">
</div>
</div>
<div class="form-group" id="constSumInfo-18-3" style="">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-red" id="<API key>">
100 points left to distribute.
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-18" type="hidden" value="100">
<input id="<API key>" type="hidden" value="false">
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-19" type="hidden" value="CONSTSUM">
<input name="questionid-19" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="4">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 19:
<br>
<span class="text-preserve-space">
Split points among the teams, based on how much effort you think the teams have put into the project
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving teams can see your response, but not the name of the recipient, or your name.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option selected="" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
Team 1</td></div>'"
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-19-0-0" min="0" name="responsetext-19-0" onchange="<API key>('19')" step="1" type="number" value="85">
</div>
</div>
<div class="form-group" id="constSumInfo-19-0" style="display:none">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-19" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
<input name="responseid-19-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 1</td></div>'"">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option selected="" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
Team 2
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-19-1-0" min="0" name="responsetext-19-1" onchange="<API key>('19')" step="1" type="number" value="110">
</div>
</div>
<div class="form-group" id="constSumInfo-19-1" style="display:none">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-19" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
<input name="responseid-19-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 2">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option selected="" value="Team 3">
Team 3
</option>
</select>
<span>
Team 3
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-19-2-0" min="0" name="responsetext-19-2" onchange="<API key>('19')" step="1" type="number" value="105">
</div>
</div>
<div class="form-group" id="constSumInfo-19-2" style="display:none">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-19" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
<input name="responseid-19-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 3">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign newResponse form-control" name="<API key>" style="display:none;max-width:125px">
<option selected="" value="">
</option>
<option value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
New Team
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>" style="display:none">
</label>
<div class="">
<input class="form-control pointsBox" id="responsetext-19-3-0" min="0" name="responsetext-19-3" onchange="<API key>('19')" step="1" type="number" value="">
</div>
</div>
<div class="form-group" id="constSumInfo-19-3" style="">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-red" id="<API key>">
100 points left to distribute.
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="true">
<input id="<API key>" type="hidden" value="0">
<input id="constSumPoints-19" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-20" type="hidden" value="CONSTSUM">
<input name="questionid-20" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="4">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 20:
<br>
<span class="text-preserve-space">
How much more time should the teams spend on the following, regarding their product? Give points accordingly.
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
The receiving teams can see your response, but not the name of the recipient, or your name.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option selected="" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
Team 1</td></div>'"
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Design
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-0-0" min="0" name="responsetext-20-0" onchange="<API key>('20')" step="1" type="number" value="35">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Usability
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-0-1" min="0" name="responsetext-20-0" onchange="<API key>('20')" step="1" type="number" value="40">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Algo
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-0-2" min="0" name="responsetext-20-0" onchange="<API key>('20')" step="1" type="number" value="25">
</div>
</div>
<div class="form-group" id="constSumInfo-20-0">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-green" id="<API key>">
All points distributed!
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="3">
<input id="constSumPoints-20" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
<input name="responseid-20-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 1</td></div>'"">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option selected="" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
Team 2
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Design
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-1-0" min="0" name="responsetext-20-1" onchange="<API key>('20')" step="1" type="number" value="10">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Usability
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-1-1" min="0" name="responsetext-20-1" onchange="<API key>('20')" step="1" type="number" value="50">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Algo
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-1-2" min="0" name="responsetext-20-1" onchange="<API key>('20')" step="1" type="number" value="40">
</div>
</div>
<div class="form-group" id="constSumInfo-20-1">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-green" id="<API key>">
All points distributed!
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="3">
<input id="constSumPoints-20" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
<input name="responseid-20-1" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 2">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option style="display: none;" value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option selected="" value="Team 3">
Team 3
</option>
</select>
<span>
Team 3
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Design
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-2-0" min="0" name="responsetext-20-2" onchange="<API key>('20')" step="1" type="number" value="15">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Usability
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-2-1" min="0" name="responsetext-20-2" onchange="<API key>('20')" step="1" type="number" value="35">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Algo
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-2-2" min="0" name="responsetext-20-2" onchange="<API key>('20')" step="1" type="number" value="50">
</div>
</div>
<div class="form-group" id="constSumInfo-20-2">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-green" id="<API key>">
All points distributed!
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="3">
<input id="constSumPoints-20" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
<input name="responseid-20-2" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%Team 3">
</div>
</div>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="text-align:right">
<label for="input">
To Team:
</label>
<select class="participantSelect middlealign newResponse form-control" name="<API key>" style="display:none;max-width:125px">
<option selected="" value="">
</option>
<option value="New Team">
New Team
</option>
<option style="display: none;" value="Team 1</td></div>'"">
Team 1</td></div>'"
</option>
<option style="display: none;" value="Team 2">
Team 2
</option>
<option style="display: none;" value="Team 3">
Team 3
</option>
</select>
<span>
New Team
</span>
</div>
<div class="col-sm-10 width-auto">
<div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Design
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-3-0" min="0" name="responsetext-20-3" onchange="<API key>('20')" step="1" type="number" value="">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Usability
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-3-1" min="0" name="responsetext-20-3" onchange="<API key>('20')" step="1" type="number" value="">
</div>
</div>
<div class="margin-bottom-15px flex">
<label class="<API key>">
Algo
</label>
<div class="margin-left-auto">
<input class="form-control pointsBox" id="responsetext-20-3-2" min="0" name="responsetext-20-3" onchange="<API key>('20')" step="1" type="number" value="">
</div>
</div>
<div class="form-group" id="constSumInfo-20-3">
<div class="col-sm-12">
<hr class="margin-top-0">
<p class="text-color-blue" id="<API key>">
Please distribute 100 points among the above options.
</p>
<hr>
</div>
</div>
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="false">
<input id="<API key>" type="hidden" value="3">
<input id="constSumPoints-20" type="hidden" value="100">
<input id="<API key>" type="hidden" value="true">
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<input name="questiontype-21" type="hidden" value="MSQ">
<input name="questionid-21" type="hidden" value="${question.id}">
<input name="<API key>" type="hidden" value="1">
<div class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
Question 21:
<br>
<span class="text-preserve-space">
Which teams would you like to be an instructor of again?
</span>
</div>
<div class="panel-body">
<p class="text-muted">
Only the following persons can see your responses:
</p>
<ul class="text-muted">
<li class="unordered">
You can see your own feedback in the results page later on.
</li>
<li class="unordered">
Instructors in this course can see your response, the name of the recipient, and your name.
</li>
</ul>
<br>
<div class="form-group margin-0">
<div class="col-sm-2 form-inline mobile-align-left" style="display:none">
<label for="input">
To:
</label>
<select class="participantSelect middlealign form-control" name="<API key>" style="display:none;max-width:125px">
<option value="">
</option>
<option selected="" value="IFSubmitUiT.instr@gmail.tmt">
Myself
</option>
</select>
<span>
Myself
</span>
</div>
<div class="col-sm-12">
<p class="text-muted" hidden="">
You need to choose at least -1 options.
</p>
<p class="text-muted" hidden="">
You cannot choose more than -1 options.
</p>
<table>
<tbody>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-21-0" type="checkbox" value="New Team">
New Team
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-21-0" type="checkbox" value="Team 1</td></div>'"">
Team 1</td></div>'"
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-21-0" type="checkbox" value="Team 2">
Team 2
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input name="responsetext-21-0" type="checkbox" value="Team 3">
Team 3
</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="checkbox">
<label class="bold-label">
<input checked="" name="responsetext-21-0" type="checkbox" value="">
<i>
None of the above
</i>
</label>
</div>
</td>
</tr>
</tbody>
</table>
<input disabled="" name="<API key>" type="hidden" value="-1">
<input disabled="" name="<API key>" type="hidden" value="-1">
<input name="responseid-21-0" type="hidden" value="${question.id}%IFSubmitUiT.instr@gmail.tmt%IFSubmitUiT.instr@gmail.tmt">
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<div class="bold align-center">
<input name="sendsubmissionemail" type="checkbox">
Send me a confirmation email
<button class="btn btn-primary center-block margin-top-7px" data-original-title="You can save your responses at any time and come back later to continue." data-placement="top" data-toggle="tooltip" id="<API key>" title="" type="submit">
Submit Feedback
</button>
</div>
<br>
<br>
</form>
</div> |
#include <stdio.h>
#include <string>
#include <vector>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <wcg_api.h>
void dfs(std::string &digits, std::vector<std::string> &dict, int index, char *res){
if(index == (int)digits.size()){
fprintf(stdout, "%s\n", res);
return;
}
std::string &set = dict[digits[index] - '2'];
for(unsigned int i = 0; i < set.size(); i++){
res[index] = set[i];
dfs(digits, dict, index + 1, res);
}
}
void letter_combination(std::string digits){
char *res = new char[digits.size() + 1];
res[digits.size()] = '\0';
std::vector<std::string> dict = {"abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
dfs(digits, dict, 0, res);
delete []res;
}
int main(int argc, char* argv[]){
google::InitGoogleLogging(argv[0]);
google::<API key>(&argc, &argv, true);
<API key> = true;
<API key> = true;
letter_combination("234");
google::<API key>();
return 0;
} |
<?php
namespace Drupal\feeds\Plugin\QueueWorker;
use Drupal\feeds\Event\FeedsEvents;
use Drupal\feeds\Event\InitEvent;
use Drupal\feeds\Event\ProcessEvent;
use Drupal\feeds\FeedInterface;
use Drupal\feeds\Result\<API key>;
use Drupal\feeds\StateInterface;
/**
* @QueueWorker(
* id = "feeds_feed_process",
* title = @Translation("Feed process"),
* cron = {"time" = 60},
* deriver = "Drupal\feeds\Plugin\Derivative\FeedQueueWorker"
* )
*/
class FeedProcess extends FeedQueueWorkerBase {
/**
* {@inheritdoc}
*/
public function processItem($data) {
list($feed, $item) = $data;
if ($item instanceof <API key>) {
$this->finish($feed, $item);
return;
}
try {
$this->dispatchEvent(FeedsEvents::INIT_IMPORT, new InitEvent($feed, 'process'));
$this->dispatchEvent(FeedsEvents::PROCESS, new ProcessEvent($feed, $item));
}
catch (\Exception $exception) {
return $this->handleException($feed, $exception);
}
$feed->saveStates();
}
/**
* Finalizes the import.
*/
protected function finish(FeedInterface $feed, <API key> $fetcher_result) {
if ($feed->progressParsing() !== StateInterface::BATCH_COMPLETE) {
$this->queueFactory->get('feeds_feed_import:' . $feed->bundle())->createItem($feed);
}
elseif ($feed->progressFetching() !== StateInterface::BATCH_COMPLETE) {
$this->queueFactory->get('feeds_feed_parse:' . $feed->bundle())->createItem($feed, $fetcher_result);
}
else {
$feed->finishImport();
}
}
} |
<?php
namespace PHPExiftool\Driver\Tag\XMPPlus;
use PHPExiftool\Driver\AbstractTag;
class CreditLineRequired extends AbstractTag
{
protected $Id = 'CreditLineRequired';
protected $Name = 'CreditLineRequired';
protected $FullName = 'XMP::plus';
protected $GroupName = 'XMP-plus';
protected $g0 = 'XMP';
protected $g1 = 'XMP-plus';
protected $g2 = 'Author';
protected $Type = 'string';
protected $Writable = true;
protected $Description = 'Credit Line Required';
protected $Values = array(
'CR-CAI' => array(
'Id' => 'CR-CAI',
'Label' => 'Credit Adjacent To Image',
),
'CR-CCA' => array(
'Id' => 'CR-CCA',
'Label' => 'Credit in Credits Area',
),
'CR-COI' => array(
'Id' => 'CR-COI',
'Label' => 'Credit on Image',
),
'CR-NRQ' => array(
'Id' => 'CR-NRQ',
'Label' => 'Not Required',
),
);
} |
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <errno.h>
#include <unistd.h>
#include <inttypes.h>
#include <string.h>
#include <libkmod.h>
#include <getopt.h>
static const char cmdoptions_short[] = "lh";
static const struct option cmdoptions[] = {
{"load-resources", no_argument, 0, 'l'},
{"help", no_argument, 0, 'h'},
{NULL, 0, 0, 0}
};
static void help(const char *progname)
{
const struct option *itr_opt;
const char *itr_short;
printf("Usage:\n"
"\t%s [options] <name-to-lookup>\n"
"Options:\n",
progname);
for (itr_opt = cmdoptions, itr_short = cmdoptions_short;
itr_opt->name != NULL; itr_opt++, itr_short++)
printf("\t-%c, --%s\n", *itr_short, itr_opt->name);
}
int main(int argc, char *argv[])
{
const char *alias = NULL;
struct kmod_ctx *ctx;
struct kmod_list *list = NULL, *l;
int load_resources = 0;
int err;
printf("libkmod version %s\n", VERSION);
for (;;) {
int c, idx = 0;
c = getopt_long(argc, argv, cmdoptions_short, cmdoptions, &idx);
if (c == -1)
break;
switch (c) {
case 'l':
load_resources = 1;
break;
case 'h':
help(argv[0]);
return 0;
case '?':
return -1;
default:
fprintf(stderr,
"ERR: unexpected getopt_long() value %c\n", c);
return -1;
}
}
if (optind >= argc) {
fprintf(stderr, "ERR: Provide an alias name\n");
return EXIT_FAILURE;
}
alias = argv[optind];
ctx = kmod_new(NULL, NULL);
if (ctx == NULL) {
kmod_unref(ctx);
exit(EXIT_FAILURE);
}
if (load_resources) {
err = kmod_load_resources(ctx);
if (err < 0) {
printf("Could not load resources: %s\n",
strerror(-err));
kmod_unref(ctx);
exit(EXIT_FAILURE);
}
}
err = <API key>(ctx, alias, &list);
if (err < 0)
exit(EXIT_FAILURE);
if (list == NULL)
printf("No module matches '%s'\n", alias);
else
printf("Alias: '%s'\nModules matching:\n", alias);
kmod_list_foreach(l, list) {
struct kmod_list *d, *pre = NULL, *post = NULL;
struct kmod_module *mod = <API key>(l);
const char *str;
printf("\t%s\n", <API key>(mod));
str = <API key>(mod);
if (str)
printf("\t\toptions: '%s'\n", str);
str = <API key>(mod);
if (str)
printf("\t\tinstall commands: '%s'\n", str);
str = <API key>(mod);
if (str)
printf("\t\tremove commands: '%s'\n", str);
err = <API key>(mod, &pre, &post);
if (err == 0) {
if (pre != NULL || post != NULL)
puts("\t\tsoft dependencies:");
if (pre != NULL) {
fputs("\t\t\tpre:", stdout);
kmod_list_foreach(d, pre) {
struct kmod_module *dm = <API key>(d);
printf(" %s", <API key>(dm));
kmod_module_unref(dm);
}
putchar('\n');
<API key>(pre);
}
if (post != NULL) {
fputs("\t\t\tpost:", stdout);
kmod_list_foreach(d, post) {
struct kmod_module *dm = <API key>(d);
printf(" %s", <API key>(dm));
kmod_module_unref(dm);
}
putchar('\n');
<API key>(post);
}
}
pre = NULL;
err = <API key>(mod, &pre);
if (err > 0) {
puts("\t\tmodinfo:");
kmod_list_foreach(d, pre) {
const char *key, *val;
key = <API key>(d);
val = <API key>(d);
printf("\t\t\t%s: %s\n", key, val ? val : "");
}
<API key>(pre);
}
pre = NULL;
err = <API key>(mod, &pre);
if (err > 0) {
puts("\t\tmodversions:");
kmod_list_foreach(d, pre) {
const char *symbol;
uint64_t crc;
symbol = <API key>(d);
crc = <API key>(d);
printf("\t\t\t%s: %#"PRIx64"\n", symbol, crc);
}
<API key>(pre);
}
pre = NULL;
err = <API key>(mod, &pre);
if (err > 0) {
puts("\t\tsymbols:");
kmod_list_foreach(d, pre) {
const char *symbol;
uint64_t crc;
symbol = <API key>(d);
crc = <API key>(d);
printf("\t\t\t%s: %#"PRIx64"\n", symbol, crc);
}
<API key>(pre);
}
kmod_module_unref(mod);
}
<API key>(list);
kmod_unref(ctx);
return EXIT_SUCCESS;
} |
#ifndef DRAW_POWERBUTTON_H
#define DRAW_POWERBUTTON_H
inline int <API key>()
{
return 160;
}
inline int <API key>()
{
return 64;
}
inline void <API key>(cairo_t *cr, int val)
{
cairo_pattern_t *pattern;
cairo_matrix_t matrix;
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
pattern = <API key>(91.923882, 144.12209, 91.923882, 93.393311);
<API key>(pattern, 0,0.509804,0.509804,0.509804,1);
<API key>(pattern, 0.612644,0.658824,0.658824,0.658824,1);
<API key>(pattern, 1,0.517647,0.517647,0.517647,1);
cairo_matrix_init(&matrix, 1.142857,0,0,1.142857,29.814725,91.98792);
<API key>(pattern, &matrix);
<API key>(pattern, CAIRO_EXTEND_PAD);
<API key>(pattern, CAIRO_FILTER_GOOD);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 15.011719, 1.3125);
cairo_line_to(cr, 144.921875, 1.3125);
cairo_curve_to(cr, 152.488281, 1.3125, 158.621094, 7.445312, 158.621094, 15.011719);
cairo_line_to(cr, 158.621094, 48.761719);
cairo_curve_to(cr, 158.621094, 56.328125, 152.488281, 62.460938, 144.921875, 62.460938);
cairo_line_to(cr, 15.011719, 62.460938);
cairo_curve_to(cr, 7.445312, 62.460938, 1.3125, 56.328125, 1.3125, 48.761719);
cairo_line_to(cr, 1.3125, 15.011719);
cairo_curve_to(cr, 1.3125, 7.445312, 7.445312, 1.3125, 15.011719, 1.3125);
cairo_close_path(cr);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
cairo_set_fill_rule(cr, <API key>);
cairo_fill_preserve(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
<API key>(cr, 2.625);
<API key>(cr, 4);
cairo_set_line_cap(cr, <API key>);
cairo_set_line_join(cr, <API key>);
pattern = <API key>(0.2,0.2,0.2,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 15.011719, 1.3125);
cairo_line_to(cr, 144.921875, 1.3125);
cairo_curve_to(cr, 152.488281, 1.3125, 158.621094, 7.445312, 158.621094, 15.011719);
cairo_line_to(cr, 158.621094, 48.761719);
cairo_curve_to(cr, 158.621094, 56.328125, 152.488281, 62.460938, 144.921875, 62.460938);
cairo_line_to(cr, 15.011719, 62.460938);
cairo_curve_to(cr, 7.445312, 62.460938, 1.3125, 56.328125, 1.3125, 48.761719);
cairo_line_to(cr, 1.3125, 15.011719);
cairo_curve_to(cr, 1.3125, 7.445312, 7.445312, 1.3125, 15.011719, 1.3125);
cairo_close_path(cr);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
<API key>(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
pattern = <API key>(0.501961,0,0,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 19.410156, 25.628906);
cairo_line_to(cr, 46.25, 25.628906);
cairo_curve_to(cr, 48.757812, 25.628906, 50.789062, 27.660156, 50.789062, 30.167969);
cairo_line_to(cr, 50.789062, 33.605469);
cairo_curve_to(cr, 50.789062, 36.113281, 48.757812, 38.144531, 46.25, 38.144531);
cairo_line_to(cr, 19.410156, 38.144531);
cairo_curve_to(cr, 16.90625, 38.144531, 14.871094, 36.113281, 14.871094, 33.605469);
cairo_line_to(cr, 14.871094, 30.167969);
cairo_curve_to(cr, 14.871094, 27.660156, 16.90625, 25.628906, 19.410156, 25.628906);
cairo_close_path(cr);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
cairo_set_fill_rule(cr, <API key>);
cairo_fill_preserve(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
<API key>(cr, 1.75);
<API key>(cr, 4);
cairo_set_line_cap(cr, <API key>);
cairo_set_line_join(cr, <API key>);
pattern = <API key>(0.101961,0.101961,0.101961,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 19.410156, 25.628906);
cairo_line_to(cr, 46.25, 25.628906);
cairo_curve_to(cr, 48.757812, 25.628906, 50.789062, 27.660156, 50.789062, 30.167969);
cairo_line_to(cr, 50.789062, 33.605469);
cairo_curve_to(cr, 50.789062, 36.113281, 48.757812, 38.144531, 46.25, 38.144531);
cairo_line_to(cr, 19.410156, 38.144531);
cairo_curve_to(cr, 16.90625, 38.144531, 14.871094, 36.113281, 14.871094, 33.605469);
cairo_line_to(cr, 14.871094, 30.167969);
cairo_curve_to(cr, 14.871094, 27.660156, 16.90625, 25.628906, 19.410156, 25.628906);
cairo_close_path(cr);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
<API key>(cr);
if(val)
{
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
pattern = <API key>(128.75, 337.91769, 128.75, 355.34933);
<API key>(pattern, 0,1,0,0,0);
<API key>(pattern, 0.217951,1,0,0,1);
<API key>(pattern, 0.77006,1,0,0,1);
<API key>(pattern, 1,1,0,0,0);
cairo_matrix_init(&matrix, 1.170992,0,0,0.772184,91.524863,322.013961);
<API key>(pattern, &matrix);
<API key>(pattern, CAIRO_EXTEND_PAD);
<API key>(pattern, CAIRO_FILTER_GOOD);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 11.089844, 21.214844);
cairo_line_to(cr, 54.984375, 21.214844);
cairo_line_to(cr, 53.234375, 26.550781);
cairo_curve_to(cr, 53.234375, 30.109375, 53.234375, 37.222656, 53.234375, 37.222656);
cairo_line_to(cr, 54.984375, 42.5625);
cairo_line_to(cr, 11.089844, 42.5625);
cairo_line_to(cr, 12.839844, 37.222656);
cairo_line_to(cr, 12.839844, 26.550781);
cairo_close_path(cr);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
cairo_set_fill_rule(cr, <API key>);
cairo_fill_preserve(cr);
}
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
<API key>(cr, 3);
<API key>(cr, 4);
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
cairo_set_line_join(cr, <API key>);
pattern = <API key>(0.8,0.8,0.8,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 68.914062, 13.386719);
cairo_line_to(cr, 68.914062, 50.386719);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
<API key>(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
<API key>(cr, 2);
<API key>(cr, 4);
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
cairo_set_line_join(cr, <API key>);
pattern = <API key>(0.8,0.8,0.8,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 74.914062, 53.386719);
cairo_line_to(cr, 100.914062, 10.386719);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
<API key>(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
<API key>(cr, 3.600395);
<API key>(cr, 4);
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
cairo_set_line_join(cr, <API key>);
pattern = <API key>(0.8,0.8,0.8,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 118.035156, 13.136719);
cairo_line_to(cr, 118.035156, 33.96875);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
//cairo_matrix_init(&matrix, 0.833242,0,0,0.833242,-106.58387,-421.87839);
//<API key>(pattern, &matrix);
<API key>(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
<API key>(cr, 3.600395);
<API key>(cr, 4);
cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
cairo_set_line_join(cr, <API key>);
pattern = <API key>(0.8,0.8,0.8,1);
cairo_set_source(cr, pattern);
<API key>(pattern);
cairo_new_path(cr);
cairo_move_to(cr, 123.148438, 18.960938);
cairo_curve_to(cr, 130.691406, 21.464844, 135.320312, 29.058594, 134.082031, 36.914062);
cairo_curve_to(cr, 132.84375, 44.765625, 126.105469, 50.570312, 118.15625, 50.632812);
cairo_curve_to(cr, 110.207031, 50.695312, 103.378906, 44.992188, 102.023438, 37.160156);
cairo_curve_to(cr, 100.664062, 29.324219, 105.175781, 21.660156, 112.683594, 19.042969);
cairo_set_tolerance(cr, 0.1);
cairo_set_antialias(cr, <API key>);
//cairo_matrix_init(&matrix, 0.262256,-0.790894,0.790894,0.262256,-78.825199,690.267755);
//<API key>(pattern, &matrix);
<API key>(cr);
}
inline void <API key>(cairo_t *cr, int val)
{
<API key>(cr,1-val);
}
#endif |
<?php
defined('JPATH_BASE') or die;
/**
* Transform api output
*
* @package Redcore
* @subpackage Api
* @since 1.4
*/
class <API key> extends <API key>
{
/**
* Method to transform an internal representation to an external one.
*
* @param mixed $definition Field definition.
*
* @return array Transformed value.
*/
public static function toExternal($definition)
{
// Check for defined constants
if (!defined('<API key>'))
{
define('<API key>', 64);
}
return ((is_string($definition) || is_object($definition)) && self::isJson($definition)) ?
$definition : json_encode($definition, <API key>);
}
/**
* Method to transform an external representation to an internal one.
*
* @param mixed $definition Field definition.
*
* @return array Transformed value.
*/
public static function toInternal($definition)
{
return json_decode($definition);
}
/**
* Checks string to see if it is already a json
*
* @param mixed $string String value
*
* @return boolean True if the string is already json
*/
public static function isJson($string)
{
json_decode($string);
return (json_last_error() == JSON_ERROR_NONE);
}
} |
<?php
namespace PHPixie\ORM\Relationships\Type\OneTo\Side;
abstract class Config extends \PHPixie\ORM\Relationships\Relationship\Implementation\Side\Config
{
public $ownerModel;
public $itemModel;
public $ownerKey;
public $itemOwnerProperty;
public $onDelete;
protected function processConfig($configSlice, $inflector)
{
$itemOptionName = $this->itemOptionName();
$itemPropertyName = $this->ownerPropertyName();
$this->ownerModel = $configSlice->getRequired('owner');
$this->itemModel = $configSlice->getRequired($itemOptionName);
$itemOptionsPrefix = $itemOptionName.'Options';
$this->itemOwnerProperty = $configSlice->get($itemOptionsPrefix.'.ownerProperty', $this->ownerModel);
$this->ownerKey = $configSlice->get($itemOptionsPrefix.'.ownerKey', $this->itemOwnerProperty.'_id');
$this->onDelete = $configSlice->get($itemOptionsPrefix.'.onOwnerDelete', 'update');
$itemProperty = $configSlice->get('ownerOptions.'.$itemOptionName.'Property', null);
if ($itemProperty === null)
$itemProperty = $this-><API key>($inflector);
$this->$itemPropertyName = $itemProperty;
}
public function ownerProperty()
{
$property = $this->ownerPropertyName();
return $this->$property;
}
abstract protected function itemOptionName();
abstract protected function ownerPropertyName();
abstract protected function <API key>($inflector);
} |
#include <cmath>
#include "contact_force.hh"
/*
* TODO: discuss threading VS static
*/
//using namespace BG;
using namespace Coordinates;
using namespace Geometry;
// local structure for intersection (overlapping) data.
// !members` declaration order supposed to be optimized by memory
struct CollisionData
{
vector<vec2d> loc_P1; // e1.P vertices in local 2d coor
vector<vec2d> loc_P2; // e2.P vertices in local 2d coords
vector<vec2d> interPoly; // intersection polygon
vector<PointStatus> stats; // statuses of points in interPoly
mat3d e1_to_e2; // matrix for coordinates transformation
mat3d e2_to_e1; // between e1 and e2 local systems
vec2d r1, r2, r12; // intervectors of e1, e2, interPoly centers
// (on unit sphere)
vec2d va1, va2, va12; // velocities of points located in the center
// of interPoly but belonging to e1 and e2
double area; // area of interPoly - area of overlap
ContactDetector::Contact& c; // some references
Globals& siku;
Element& e1, e2;
int inter_res; // amount of intersection points (just in case)
// ALL values are being calculated in constructor
CollisionData( ContactDetector::Contact& _c, Globals& _siku ):
siku( _siku ), c( _c ), e1( siku.es[ c.i1 ] ), e2( siku.es[ c.i2 ] )
{
VERIFY( e1.q, "CollDat");
VERIFY( e2.q, "CollDat");
// coordinates transformation matrixes (local systems of two elements)
e2_to_e1 = loc_to_loc_mat( e1.q, e2.q );
e1_to_e2 = loc_to_loc_mat( e2.q, e1.q );
// polygons in local (e1) coords
for( auto& p : e1.P ) loc_P1.push_back( vec3_TO_vec2( p ) );
for( auto& p : e2.P ) loc_P2.push_back( vec3_TO_vec2( e2_to_e1 * p ) );
// errors check
// if( errored( loc_P1 ) ) e1.flag |= Element::F_ERRORED;
// if( errored( loc_P2 ) ) e2.flag |= Element::F_ERRORED;
// call for 'geometry'->'2d'->'polygon intersection'
inter_res = intersect( loc_P1, loc_P2, interPoly, &stats, &r1, &area );
// and calc centers` interpositions
r12 = vec3_TO_vec2( e2_to_e1 * NORTH );
r2 = r1 - r12;
// IMPROVE: check order of planet.R carefully!
// e1 aim speed (coz of spin + propagation)
va1 = vec3_to_vec2( e1.V )
+ rot_90_cw( r1 ) * ( -e1.W.z * siku.planet.R );
// e2 aim speed (spin + propagation)
va2 = vec3_to_vec2( lay_on_surf( e2_to_e1 * e2.V ) )
+ rot_90_cw( r2 ) * ( -e2.W.z * siku.planet.R );
// velocity difference at aim point
va12 = va1 - va2;
}
};
void _test_springs( ContactDetector::Contact& c, Globals& siku );
void <API key>( ContactDetector::Contact& c, Globals& siku );
void <API key>( ContactDetector::Contact& c, Globals& siku );
void _err_n_land_test( Element &e1, Element &e2,
mat3d& e2_to_e1, mat3d& e1_to_e2 );
void _fasten( Element &e1, Element &e2, double area,
const vector<vec2d>& l1, const vector<vec2d>& l2 );
// calculates linear rigidity of ice with respect to material and other props
inline double _rigidity( CollisionData& cd )
{
// BUG: factors at elastic collision and dist spring should be the same!
return cd.siku.phys_consts["elasticity"] * cd.siku.planet.R_rec
/ ( abs(cd.r1) + (cd.r2) );
// reduced thickness of floes
double h1 = cd.e1.gh[0], h2 = cd.e2.gh[0];
// search for thickest layer
for( unsigned i = 1; i < MAT_LAY_AMO; ++i )
if( cd.e1.gh[i] > h1 )
h1 = cd.e1.gh[i];
for( unsigned i = 1; i < MAT_LAY_AMO; ++i )
if( cd.e1.gh[i] > h1 )
h1 = cd.e1.gh[i];
// <API key> rigidity of ice
return h1*h2 / ( h1*abs( cd.r2 ) + h2*abs( cd.r1 ) )
* cd.siku.phys_consts["sigma"] * cd.siku.planet.R_rec;
}
// viscous and elastic forces applied to e1 caused by e2.
inline vec2d _elastic_force( CollisionData& cd )
{
// return {};
vec2d norm;
// IMPROVE: try to find better solution for normal direction search
vec2d p1p2 [2]; // p1p2 = two points: p1 and p2
size_t np = 0; // amount of edge-edge intersections
// noob search for p1 and p2
for(size_t i = 0; i < cd.stats.size(); ++i )
if( cd.stats[i] == PointStatus::EDGE )
{
if( np < 2 ) p1p2[ np ] = cd.interPoly[ i ];
np++;
}
// direction of force
if( np == 2 ) // definite front
{
// normal to front
vec2d dp = p1p2[1] - p1p2[0];
vec2d tau = dp.ort() * copysign( 1., cross( p1p2[0], dp ) );
norm = rot_90_ccw( tau );
}
else // no definite front
{
// normal is being calculated by interposition of polygons` centers and
// intersection area center
norm = ort( ort( cd.r2 )*abs( cd.r1 )
- ort( cd.r1 )*abs( cd.r2 ) );
}
// moved to _regidity
// // reciprocal length of polygon
// double l_ = 1. / ( abs( dot( cd.r1, norm ) ) + abs( dot( cd.r2, norm ) ) );
// resulting force - close to linear spring
return _rigidity( cd ) * cd.area * cd.siku.planet.R2 * norm;
}
inline vec2d _viscous_force( CollisionData& cd )
{
return -cd.area * cd.siku.planet.R2 * cd.siku.phys_consts["etha"] * cd.va12;
}
void contact_forces( Globals& siku )
{
switch( siku.cont_force_model )
{
case CF_TEST_SPRINGS: //same as CF_DEFAULT
for ( auto& c : siku.ConDet.cont )
_test_springs( c, siku );
break;
case CF_HOPKINS:
for ( auto& c : siku.ConDet.cont )
<API key>( c, siku );
break;
case CF_DIST_SPRINGS:
for ( auto& c : siku.ConDet.cont )
<API key>( c, siku );
break;
}
}
void _collision( Globals& siku, ContactDetector::Contact& c )
{
CollisionData cd( c, siku );
if( cd.inter_res > 2 )
{
c.type = ContType::COLLISION; // mark contact as a 'collision'
// //TODO: clean this mess
// vec2d p1p2 [2]; // p1p2 = two points: p1 and p2
// size_t np = 0; // amount of edge-edge intersections
// // noob search for p1 and p2
// for(size_t i = 0; i < cd.stats.size(); ++i )
// if( stats[i] == PointStatus::EDGE )
// if( np < 2 ) p1p2[ np ] = interPoly[ i ];
// if( np != 2 ) // inapplicable //UNDONE: add solution for 'fencing'
// // intersections
/ _spike( e1, e2, c, siku, e1_to_e2, e2_to_e1, loc_P1, loc_P2,
/ interPoly, stats, center, area );
// c.type = ContType::NONE;
// return;
// c.generation = 0; // refreshing contact for avoiding deletion
// // directions and applying point
// vec2d dp = p1p2[1] - p1p2[0];
// vec2d tau = dp.ort() * copysign( 1., cross( p1p2[0], dp ) );
// vec2d norm { tau.y, -tau.x };
// vec2d center = ( p1p2[0] + p1p2[1] ) / 2.;
// // physical constants (from python scenario)
// double Kne = siku.phys_consts["rigidity"],
// Kni = siku.phys_consts["viscosity"],
// Kw = siku.phys_consts["rotatability"],
// Kt = siku.phys_consts["tangency"];
// double Asqrt = sqrt( area );
// // zero if dt==0, some fraction otherwise
// double da_dt = siku.time.get_dt() ?
// ( Asqrt - sqrt( c.area ) ) / siku.time.get_dt() : 0.;
// // actually the force
// vec2d F = ( Kne * Asqrt +
// Kni * da_dt ) * siku.planet.R * norm;
///////// testing tangential force
// F += tau * ( tau * v12 ) * Asqrt * Kt * siku.planet.R2;
// double torque1 =
// Kw * siku.planet.R_rec * cross( center, F );
// double torque2 =
// Kw * siku.planet.R_rec * cross( center -
// vec3_to_vec2( e2_to_e1 * NORTH ), F );
// force in Newtons applied to e1 caused by e2
vec2d F = _elastic_force( cd ) * siku.phys_consts["rigidity"]
+ _viscous_force( cd ) * siku.phys_consts["viscosity"];
VERIFY(_elastic_force( cd ), "" );
VERIFY(_viscous_force( cd ), "" );
double torque1 = cross( cd.r1, F )
* siku.planet.R_rec * siku.phys_consts["rotatability"];
double torque2 = cross( cd.r2, F)
* siku.planet.R_rec * siku.phys_consts["rotatability"];
VERIFY( F, string("in collision ")
+to_string(siku.es[c.i1].id)
+string(" ")
+to_string(siku.es[c.i2].id) );
VERIFY( torque1, "in collision" );
VERIFY( torque2, "in collision" );
// applying forces and torques
// (signs are fitted manually)
siku.es[c.i1].F += vec2_to_vec3( F );
siku.es[c.i1].N += torque1;
siku.es[c.i2].F -= lay_on_surf( cd.e1_to_e2 * vec2_to_vec3( F ) );
siku.es[c.i2].N -= torque2;
c.area = cd.area;
VERIFY( c.area, "collision" );
VERIFY( siku.es[c.i1].F, "1collision");
VERIFY( siku.es[c.i2].F, "1collision");
_fasten( cd.e1, cd.e2, cd.area, cd.loc_P1, cd.loc_P2 );
}
}
void _test_springs( ContactDetector::Contact& c, Globals& siku )
{
// TODO: such errors should be removed by removing their reason
if(
// (siku.es[c.i1].flag & Element::F_ERRORED) ||
// (siku.es[c.i2].flag & Element::F_ERRORED) ||
// No need to calculate interaction for two steady polygons
// TODO: reconsider runtime fastened ice
( (siku.es[c.i1].flag & Element::F_STEADY) &&
(siku.es[c.i2].flag & Element::F_STEADY) ) )
return;
if( c.type != ContType::JOINT )
{
_collision( siku, c ); // collision forces
}
else // <=> if( c.type == ContType::JOINT )
{
Element& e1 = siku.es[c.i1], e2 = siku.es[c.i2];
// coordinates transformation matrixes (local systems of two elements)
mat3d e2_to_e1 = loc_to_loc_mat( e1.q, e2.q );
mat3d e1_to_e2 = loc_to_loc_mat( e2.q, e1.q );
// test for polygons convexity
_err_n_land_test( e1, e2, e2_to_e1, e1_to_e2 );
// physical constants (from python scenario)
double K = siku.phys_consts["elasticity"],
Kw = siku.phys_consts["bendability"],
sigma = siku.phys_consts["solidity"],
epsilon = siku.phys_consts["tensility"];
// calculating forces and torques
vec2d p1 = c.p1;
vec2d p2 = vec3_TO_vec2( e2_to_e1 * vec2_TO_vec3( c.p2 ) );
vec2d F = ( p2 - p1 ) * siku.planet.R * K * c.durability *
c.init_len;
// * c.init_size OR c.init_len;
double torque1 =
Kw * siku.planet.R_rec * cross( p1, F );
double torque2 =
Kw * siku.planet.R_rec * cross( p2 -
vec3_to_vec2( e2_to_e1 * NORTH) , F );
// applying forces and torques
// signs are fitted manually
siku.es[c.i1].F -= vec2_to_vec3( F );
siku.es[c.i1].N -= torque1;
siku.es[c.i2].F += lay_on_surf( e1_to_e2 * vec2_to_vec3( F ) );
siku.es[c.i2].N += torque2;
// Joint destruction
double t = (p2-p1).abs() *
1. / ( vec3_to_vec2(e2_to_e1 * NORTH).abs() );
//2.0 / ( p1.abs() + (p2 - vec3_to_vec2( e2_to_e1 * NORTH)).abs() );
c.durability -= (t > epsilon) ? t * sigma : 0.;
}
}
UNDONE!
void <API key>( ContactDetector::Contact& c, Globals& siku )
{
// TODO: such errors should be removed by removing their reason
if(
// (siku.es[c.i1].flag & Element::F_ERRORED) ||
// (siku.es[c.i2].flag & Element::F_ERRORED) ||
// No need to calculate interaction for two steady polygons
// TODO: reconsider runtime fastened ice
( (siku.es[c.i1].flag & Element::F_STEADY) &&
(siku.es[c.i2].flag & Element::F_STEADY) ) )
return;
if( c.type != ContType::JOINT )
{
_collision( siku, c ); // collision forces
}
else // <=> if( c.type == ContType::JOINT ) // Hopkins` physics
{
Element& e1 = siku.es[c.i1], e2 = siku.es[c.i2];
// coordinates transformation matrixes (local systems of two elements)
mat3d e2_to_e1 = loc_to_loc_mat( e1.q, e2.q );
mat3d e1_to_e2 = loc_to_loc_mat( e2.q, e1.q );
// test for polygons convexity
_err_n_land_test( e1, e2, e2_to_e1, e1_to_e2 );
// physical constants (from python scenario)
double K = siku.phys_consts["elasticity"],
Kw = siku.phys_consts["bendability"],
sigma = siku.phys_consts["solidity"],
epsilon = siku.phys_consts["tensility"];
// calculating forces and torques (this method seems to be working wrong)
vec2d p11 = vec3_to_vec2( siku.es[c.i1].P[c.v11] );
vec2d p12 = vec3_to_vec2( siku.es[c.i1].P[c.v12] );
vec2d p21 = vec3_to_vec2( e2_to_e1 * siku.es[c.i2].P[c.v21] );
vec2d p22 = vec3_to_vec2( e2_to_e1 * siku.es[c.i2].P[c.v22] );
vec2d X;
// double sinX = cross( (p12-p11).ort(), ( p21-p22 ).ort() );
// double cosX = dot( (p12-p11).ort(), ( p21-p22 ).ort() );
double Al = 0.5 * cross( p12 - X, p21 - X );
double Ar = 0.5 * cross( p22 - X, p11 - X );
vec2d Cl = (p12 + p21 + X) / 3.;
vec2d Cr = (p22 + p11 + X) / 3.;
vec2d r12 = vec3_to_vec2( e2_to_e1 * NORTH );
vec2d Fl = Al * siku.planet.R * K * r12.ort();
vec2d Fr = Ar * siku.planet.R * K * r12.ort();
vec2d F = Fl + Fr;
double torque1 = Kw * siku.planet.R_rec *
( cross( Cl, Fl ) + cross( Cr, Fr ) );
double torque2 = Kw * siku.planet.R_rec *
( cross( r12 - Cl, Fl ) + cross( r12 - Cr, Fr ) );
c.area = Ar > 0 ? Ar : 0.
+ Al > 0 ? Al : 0.;
// applying forces and torques
// signs are fitted manually
siku.es[c.i1].F -= vec2_to_vec3( F );
siku.es[c.i1].N -= torque1;
siku.es[c.i2].F += lay_on_surf( e1_to_e2 * vec2_to_vec3( F ) );
siku.es[c.i2].N += torque2;
// Joint destruction
// double t = (abs(Al) + abs(Ar)) / ( siku.es[c.i1].A + siku.es[c.i2].A );
// c.durability -= (t > epsilon) ? t * sigma : 0.;
}
}
void <API key>( ContactDetector::Contact& c, Globals& siku )
{
// TODO: such errors should be removed by removing their reason
if(
// (siku.es[c.i1].flag & Element::F_ERRORED) ||
// (siku.es[c.i2].flag & Element::F_ERRORED) ||
// No need to calculate interaction for two steady polygons
// TODO: reconsider runtime fastened ice
( (siku.es[c.i1].flag & Element::F_STEADY) &&
(siku.es[c.i2].flag & Element::F_STEADY) ) )
return;
if( c.type != ContType::JOINT )
{
_collision( siku, c ); // collision forces
}
else if( c.durability > 0. ) // <=> if( c.type == ContType::JOINT )
{
Element &e1 = siku.es[c.i1], &e2 = siku.es[c.i2];
// coordinates transformation matrixes (local systems of two elements)
mat3d e2_to_e1 = loc_to_loc_mat( e1.q, e2.q );
mat3d e1_to_e2 = loc_to_loc_mat( e2.q, e1.q );
// test for polygons convexity
_err_n_land_test( e1, e2, e2_to_e1, e1_to_e2 );
// physical constants (from python scenario)
double K = - siku.phys_consts["elasticity"], // NOTE THE SIGN!
Kw = siku.phys_consts["bendability"],
sigma = siku.phys_consts["solidity"],
epsilon = siku.phys_consts["tensility"];
// direct and reversed planet radius shortcuts
double &R = siku.planet.R, &R_ = siku.planet.R_rec;
vec3d tv1, tv2; // just some temporals
// original contact points considering current shift of elements
vec2d p1 = c.p1, p2 = c.p2,
p3 = vec3_TO_vec2( e2_to_e1 * vec2_TO_vec3( c.p3 ) ),
p4 = vec3_TO_vec2( e2_to_e1 * vec2_TO_vec3( c.p4 ) );
// IMPROVE: make proper check
// assert( c.durability > 0. );
VERIFY( (c.durability>0.) , "in dist spring" );
// some additional variables to avoid unnecessary functions` calls
// double hardness = K * c.init_len * c.durability * R
// rotatability = K * c.init_len / c.init_size * c.durability * 1./12.;
double hardness = K * c.init_len / c.init_size * c.durability * R,
rotablty = K * c.init_len / c.init_size * c.durability * 1./12.;
vec2d dr1 = p4 - p1,
dr2 = p3 - p2;
double dl1 = abs( dr1 ), dl2 = abs( dr2 );
double mom1, mom2;
// The Force itself
vec2d F = hardness * (dr1 + dr2) * 0.5;
// combined torques
vec2d r12 = vec3_TO_vec2( e2_to_e1 * NORTH );
mom1 = Kw * ( R_ * cross( (p1 + p2) * 0.5, F ) + //traction
rotablty * cross( p1 - p2, dr1 - dr2 ) ); //couple
mom2 = Kw * ( R_ * cross( (p3 + p4) * 0.5 - r12, F ) + //traction
rotablty * cross( p3 - p4, dr2 - dr1 ) ); //couple
VERIFY( F, "in dist_spring");
VERIFY( mom1, "in dist_spring");
VERIFY( mom2, "in dist_spring");
// applying forces and torques
// signs are fitted manually
e1.F -= vec2_to_vec3( F );
e1.N -= mom1;
e2.F += lay_on_surf( e1_to_e2 * vec2_to_vec3( F ) );
e2.N += mom2;
VERIFY( e1.F, "1in dist_spring");
VERIFY( e2.F, "1in dist_spring");
// durability change - joint destruction
double r_size = 1. / c.init_size, // reversed size
dmax = max( dl1, dl2 ), // maximal stretch
dave = (dl1 + dl2) * 0.5; // average stretch
// TODO: discuss time scaling
c.durability -= siku.time.get_dt() *
( ( dmax * r_size > epsilon ) ? dave * r_size * sigma : 0. );
/ may be required in 'collision' contact type
// if( c.durability < 0.05 )
// std::vector<vec2d> loc_P1; // e1.P vertices in local 2d coords
// std::vector<vec2d> loc_P2; // e2.P vertices in local 2d coords
// // polygons in local (e1) coords
// for( auto& p : e1.P )
// loc_P1.push_back( vec3_to_vec2( p ) );
// for( auto& p : e2.P )
// loc_P2.push_back( vec3_to_vec2( e2_to_e1 * p ) );
// if( errored( loc_P1 ) ) e1.flag |= Element::F_ERRORED;
// if( errored( loc_P2 ) ) e2.flag |= Element::F_ERRORED;
// intersect( loc_P1, loc_P2, interPoly, nullptr, nullptr, &area );
// c.area = area;
}
}
void _err_n_land_test( Element &e1, Element &e2,
mat3d& e2_to_e1, mat3d& e1_to_e2 )
{
std::vector<vec2d> loc_P1; // e1.P vertices in local 2d coords
std::vector<vec2d> loc_P2; // e2.P vertices in local 2d coords
// polygons in local (e1) coords
for( auto& p : e1.P ) loc_P1.push_back( vec3_TO_vec2( p ) );
for( auto& p : e2.P ) loc_P2.push_back( vec3_TO_vec2( e2_to_e1 * p ) );
// check for errors
// if( errored( loc_P1 ) ) e1.flag |= Element::F_ERRORED;
// if( errored( loc_P2 ) ) e2.flag |= Element::F_ERRORED;
_fasten( e1, e2, 0.0, loc_P1, loc_P2 );
}
void _fasten( Element &e1, Element &e2, double area,
const vector<vec2d>& l1, const vector<vec2d>& l2 )
{
// if one element is shore (static but not fastened):
// check fastening condition
if( ( e1.flag & Element::F_STATIC && ~e1.flag & Element::F_FASTENED ) ||
( e2.flag & Element::F_STATIC && ~e2.flag & Element::F_FASTENED ) )
{
// minimal areas for comparison
double ma = min( e1.A, e2.A );
e1.OAM = min( e1.OAM, ma );
e2.OAM = min( e2.OAM, ma );
// current overlap area accumulation (optimized in case of precalculated
// area
if( area )
{
e1.OA += area;
e2.OA += area;
}
else
{
vector<vec2d> interPoly;
if( intersect( l1, l2, interPoly, nullptr, nullptr, &area ) > 2 )
{
e1.OA += area;
e2.OA += area;
}
}
}
} |
//Write a program that converts upper case or lower case to upper, depending on the name it is invoked with, as found in argv[0]
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define MAX 50
int main(int argc, char *argv[])
{
int i;
if (argc == 1)
{
printf("No string to convert. Please run again and add string as command line argument\n");
return -1;
} else {
for (i = 1; i != argc; i++) {
if (strcmp(argv[0], "./lower") == 0)
{
//convert from Upper to lower case
while (*argv[i] != '\0') {
putchar(tolower(*argv[i]++));
}
putchar(' ');
}
else if (strcmp(argv[0], "./upper") == 0)
{
//convert from ower to upper case
while (*argv[i] != '\0') {
putchar(toupper(*argv[i]++));
}
putchar(' ');
}
}
putchar('\n');
}
return 0;
} |
/**
* <API key>.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
*/
package tudu.web.ws.axis;
public class <API key> extends org.apache.axis.client.Stub implements tudu.web.ws.axis.AxisTuduLists {
private java.util.Vector cachedSerClasses = new java.util.Vector();
private java.util.Vector cachedSerQNames = new java.util.Vector();
private java.util.Vector cachedSerFactories = new java.util.Vector();
private java.util.Vector <API key> = new java.util.Vector();
static org.apache.axis.description.OperationDesc [] _operations;
static {
_operations = new org.apache.axis.description.OperationDesc[2];
_initOperationDesc1();
}
private static void _initOperationDesc1(){
org.apache.axis.description.OperationDesc oper;
org.apache.axis.description.ParameterDesc param;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("getAllTodoLists");
oper.setReturnType(new javax.xml.namespace.QName("http://axis.ws.web.tudu", "<API key>"));
oper.setReturnClass(tudu.web.ws.bean.WsTodoList[].class);
oper.setReturnQName(new javax.xml.namespace.QName("", "<API key>"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);
_operations[0] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("getTodosByTodoList");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "in0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http:
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("http://axis.ws.web.tudu", "ArrayOf_tns1_WsTodo"));
oper.setReturnClass(tudu.web.ws.bean.WsTodo[].class);
oper.setReturnQName(new javax.xml.namespace.QName("", "<API key>"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);
_operations[1] = oper;
}
public <API key>() throws org.apache.axis.AxisFault {
this(null);
}
public <API key>(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public <API key>(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).<API key>("1.2");
java.lang.Class cls;
javax.xml.namespace.QName qName;
javax.xml.namespace.QName qName2;
java.lang.Class beansf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class enumsf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class enumdf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class simplesf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class simpledf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class simplelistsf = org.apache.axis.encoding.ser.<API key>.class;
java.lang.Class simplelistdf = org.apache.axis.encoding.ser.<API key>.class;
qName = new javax.xml.namespace.QName("http://axis.ws.web.tudu", "ArrayOf_tns1_WsTodo");
cachedSerQNames.add(qName);
cls = tudu.web.ws.bean.WsTodo[].class;
cachedSerClasses.add(cls);
qName = new javax.xml.namespace.QName("http://bean.ws.web.tudu", "WsTodo");
qName2 = null;
cachedSerFactories.add(new org.apache.axis.encoding.ser.<API key>(qName, qName2));
<API key>.add(new org.apache.axis.encoding.ser.<API key>());
qName = new javax.xml.namespace.QName("http://axis.ws.web.tudu", "<API key>");
cachedSerQNames.add(qName);
cls = tudu.web.ws.bean.WsTodoList[].class;
cachedSerClasses.add(cls);
qName = new javax.xml.namespace.QName("http://bean.ws.web.tudu", "WsTodoList");
qName2 = null;
cachedSerFactories.add(new org.apache.axis.encoding.ser.<API key>(qName, qName2));
<API key>.add(new org.apache.axis.encoding.ser.<API key>());
qName = new javax.xml.namespace.QName("http://bean.ws.web.tudu", "WsTodo");
cachedSerQNames.add(qName);
cls = tudu.web.ws.bean.WsTodo.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
<API key>.add(beandf);
qName = new javax.xml.namespace.QName("http://bean.ws.web.tudu", "WsTodoList");
cachedSerQNames.add(qName);
cls = tudu.web.ws.bean.WsTodoList.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
<API key>.add(beandf);
}
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
try {
org.apache.axis.client.Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.<API key>(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
java.lang.String key = (java.lang.String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
// All the type mapping information is registered
// when the first call is made.
// The type mapping information is actually registered in
// the TypeMappingRegistry of the service, which
// is the reason why registration is only needed for the first call.
synchronized (this) {
if (firstCall()) {
// must set encoding style before registering serializers
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
for (int i = 0; i < cachedSerFactories.size(); ++i) {
java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
javax.xml.namespace.QName qName =
(javax.xml.namespace.QName) cachedSerQNames.get(i);
java.lang.Object x = cachedSerFactories.get(i);
if (x instanceof Class) {
java.lang.Class sf = (java.lang.Class)
cachedSerFactories.get(i);
java.lang.Class df = (java.lang.Class)
<API key>.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
cachedSerFactories.get(i);
org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
<API key>.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
}
catch (java.lang.Throwable _t) {
throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
}
}
public tudu.web.ws.bean.WsTodoList[] getAllTodoLists() throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://axis.ws.web.tudu", "getAllTodoLists"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (tudu.web.ws.bean.WsTodoList[]) _resp;
} catch (java.lang.Exception _exception) {
return (tudu.web.ws.bean.WsTodoList[]) org.apache.axis.utils.JavaUtils.convert(_resp, tudu.web.ws.bean.WsTodoList[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}
public tudu.web.ws.bean.WsTodo[] getTodosByTodoList(java.lang.String in0) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://axis.ws.web.tudu", "getTodosByTodoList"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {in0});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (tudu.web.ws.bean.WsTodo[]) _resp;
} catch (java.lang.Exception _exception) {
return (tudu.web.ws.bean.WsTodo[]) org.apache.axis.utils.JavaUtils.convert(_resp, tudu.web.ws.bean.WsTodo[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}
} |
<div class="container">
<?php echo form_open('admin/create', array('class' => 'form editor')); ?>
<?php echo validation_errors('<div class="alert alert-danger">', '</div>'); ?>
<div><input type="text" class="form-control" name="title" value="<?php echo set_value('title'); ?>" size="50" placeholder="Заголовок"/></div>
<div><textarea class="form-control" name="content" id="content" cols="30" rows="10" placeholder="Содержание"><?php echo set_value('content'); ?></textarea></div>
<div>
<label>Категория: </label>
<?php
foreach ($terms as $id => $name)
{
$checked = FALSE;
if(isset($terms_checked) && in_array($id, $terms_checked))
$checked = TRUE;
echo "<div>" . form_checkbox('terms[]', $id, $checked) . " <span>$name</span></div>";
}
?>
</div>
<button class="btn btn-md btn-primary" type="submit">Опубликовать</button>
</form>
</div> |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="ru">
<head>
<title>Uses of Class org.apache.poi.ss.formula.ptg.DeletedRef3DPtg (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.poi.ss.formula.ptg.DeletedRef3DPtg (POI API Documentation)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/poi/ss/formula/ptg/DeletedRef3DPtg.html" title="class in org.apache.poi.ss.formula.ptg">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/poi/ss/formula/ptg/class-use/DeletedRef3DPtg.html" target="_top">Frames</a></li>
<li><a href="DeletedRef3DPtg.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h2 title="Uses of Class org.apache.poi.ss.formula.ptg.DeletedRef3DPtg" class="title">Uses of Class<br>org.apache.poi.ss.formula.ptg.DeletedRef3DPtg</h2>
</div>
<div class="classUseContainer">No usage of org.apache.poi.ss.formula.ptg.DeletedRef3DPtg</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/poi/ss/formula/ptg/DeletedRef3DPtg.html" title="class in org.apache.poi.ss.formula.ptg">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/poi/ss/formula/ptg/class-use/DeletedRef3DPtg.html" target="_top">Frames</a></li>
<li><a href="DeletedRef3DPtg.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>
<i>Copyright 2014 The Apache Software Foundation or
its licensors, as applicable.</i>
</small></p>
</body>
</html> |
#include <test-double-vlen8.h>
#include "libm-test.c" |
/* The classes below are not exported */
#pragma GCC visibility push(hidden)
class LigthLibrairiePriv
{
public:
void HelloWorldPriv(const char *);
};
#pragma GCC visibility pop |
## -*- mode: python; coding: utf-8; -*-
## This file is part of Invenio.
## Invenio is free software; you can redistribute it and/or
## published by the Free Software Foundation; either version 2 of the
## Invenio is distributed in the hope that it will be useful, but
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""Call BibFormat engine and create HTML brief (and other) formats cache for
bibliographic records."""
__revision__ = "$Id$"
import sys
try:
from invenio.dbquery import run_sql
from invenio.config import \
CFG_SITE_URL,\
CFG_TMPDIR,\
CFG_BINDIR
from invenio.intbitset import intbitset
from invenio.search_engine import <API key>, search_pattern
from invenio.search_engine import print_record
from invenio.<API key> import get_cited_by
from invenio.<API key> import <API key>
from invenio.bibformat import format_record
from invenio.bibformat_config import <API key>
from invenio.shellutils import split_cli_ids_arg
from invenio.bibtask import task_init, write_message, task_set_option, \
task_get_option, <API key>, task_has_option, \
<API key>, <API key>, \
task_get_task_param
import os
import time
import zlib
from datetime import datetime
except ImportError, e:
print "Error: %s" % e
sys.exit(1)
def fetch_last_updated(format):
select_sql = "SELECT last_updated FROM format WHERE code = %s"
row = run_sql(select_sql, (format.lower(), ))
# Fallback in case we receive None instead of a valid date
last_date = row[0][0] or datetime(year=1900, month=1, day=1)
return last_date
def store_last_updated(format, update_date):
sql = "UPDATE format SET last_updated = %s " \
"WHERE code = %s AND (last_updated < %s or last_updated IS NULL)"
iso_date = update_date.strftime("%Y-%m-%d %H:%M:%S")
run_sql(sql, (iso_date, format.lower(), iso_date))
run the bibreformat task bibsched scheduled
def bibreformat_task(fmt, sql, sql_queries, cds_query, process_format, process, recids):
"""
BibReformat main task
@param fmt: output format to use
@param sql: dictionary with pre-created sql queries for various cases (for selecting records). Some of these queries will be picked depending on the case
@param sql_queries: a list of sql queries to be executed to select records to reformat.
@param cds_query: a search query to be executed to select records to reformat
@param process_format:
@param process:
@param recids: a list of record IDs to reformat
@return: None
"""
write_message("Processing format %s" % fmt)
t1 = os.times()[4]
start_date = datetime.now()
Query the database
<API key>('Fetching records to process')
if process_format: # '-without' parameter
write_message("Querying database for records without cache...")
without_format = without_fmt(sql)
recIDs = intbitset(recids)
if cds_query['field'] != "" or \
cds_query['collection'] != "" or \
cds_query['pattern'] != "":
write_message("Querying database (CDS query)...")
if cds_query['collection'] == "":
# use search_pattern() whenever possible, as it can search
# even in private collections
res = search_pattern(p=cds_query['pattern'],
f=cds_query['field'],
m=cds_query['matching'])
else:
# use <API key> when '-c' argument has been
# defined, as it is not supported by search_pattern()
res = intbitset(<API key>(req=None, of='id',
c=cds_query['collection'],
p=cds_query['pattern'],
f=cds_query['field']))
recIDs |= res
for sql_query in sql_queries:
write_message("Querying database (%s) ..." % sql_query, verbose=2)
recIDs |= intbitset(run_sql(sql_query))
if fmt == "HDREF" and recIDs:
# HDREF represents the references tab
# the tab needs to be recomputed not only when the record changes
# but also when one of the citations changes
latest_bibrank_run = <API key>('citation')
sql = """SELECT id, modification_date FROM bibrec
WHERE id in (%s)""" % ','.join(str(r) for r in recIDs)
def check_date(mod_date):
return mod_date < latest_bibrank_run
recIDs = intbitset([recid for recid, mod_date in run_sql(sql) \
if check_date(mod_date)])
for r in recIDs:
recIDs |= intbitset(get_cited_by(r))
list of corresponding record IDs was retrieved
now format the selected records
if process_format:
write_message("Records to be processed: %d" % (len(recIDs) \
+ len(without_format)))
write_message("Out of it records without existing cache: %d" % len(without_format))
else:
write_message("Records to be processed: %d" % (len(recIDs)))
Initialize main loop
total_rec = 0 # Total number of records
tbibformat = 0 # time taken up by external call
tbibupload = 0 # time taken up by external call
Iterate over all records prepared in lists I (option)
if process:
if <API key>: # FIXME: remove this
# when migration from php to
# python bibformat is done
(total_rec_1, tbibformat_1, tbibupload_1) = iterate_over_old(recIDs,
fmt)
else:
(total_rec_1, tbibformat_1, tbibupload_1) = iterate_over_new(recIDs,
fmt)
total_rec += total_rec_1
tbibformat += tbibformat_1
tbibupload += tbibupload_1
Iterate over all records prepared in list II (no_format)
if process_format and process:
if <API key>: # FIXME: remove this
# when migration from php to
# python bibformat is done
(total_rec_2, tbibformat_2, tbibupload_2) = iterate_over_old(without_format,
fmt)
else:
(total_rec_2, tbibformat_2, tbibupload_2) = iterate_over_new(without_format,
fmt)
total_rec += total_rec_2
tbibformat += tbibformat_2
tbibupload += tbibupload_2
Store last run time
if task_has_option("last"):
write_message("storing run date to %s" % start_date)
store_last_updated(fmt, start_date)
Final statistics
t2 = os.times()[4]
elapsed = t2 - t1
message = "total records processed: %d" % total_rec
write_message(message)
message = "total processing time: %2f sec" % elapsed
write_message(message)
message = "Time spent on external call (os.system):"
write_message(message)
message = " bibformat: %2f sec" % tbibformat
write_message(message)
message = " bibupload: %2f sec" % tbibupload
write_message(message)
def <API key>(input_formats):
"""
Checks the validity of every input format.
@param input_formats: list of given formats
@type input_formats: list
@return: if there is any invalid input format it returns this value
@rtype: string
"""
from invenio.search_engine import <API key>
valid_formats = <API key>()
# let's to extract the values of the available formats
format_values = []
for aformat in valid_formats:
format_values.append(aformat['value'])
invalid_format = ''
for aformat in input_formats:
if aformat.lower() not in format_values:
invalid_format = aformat.lower()
break
return invalid_format
Identify recIDs of records with missing format
def without_fmt(queries, chunk_size=2000):
"""
List of record IDs to be reformated, not having the specified format yet
@param sql: a dictionary with sql queries to pick from
@return: a list of record ID without pre-created format cache
"""
sql = queries['missing']
recids = intbitset()
max_id = run_sql("SELECT max(id) FROM bibrec")[0][0]
for start in xrange(1, max_id + 1, chunk_size):
end = start + chunk_size
recids += intbitset(run_sql(sql, (start, end)))
return recids
Bibreformat all selected records (using new python bibformat)
(see iterate_over_old further down)
def iterate_over_new(list, fmt):
"""
Iterate over list of IDs
@param list: the list of record IDs to format
@param fmt: the output format to use
@return: tuple (total number of records, time taken to format, time taken to insert)
"""
global total_rec
formatted_records = '' # (string-)List of formatted record of an iteration
tbibformat = 0 # time taken up by external call
tbibupload = 0 # time taken up by external call
start_date = task_get_task_param('task_starting_time') # Time at which the record was formatted
tot = len(list)
count = 0
for recID in list:
t1 = os.times()[4]
start_date = time.strftime('%Y-%m-%d %H:%M:%S')
formatted_record = zlib.compress(format_record(recID, fmt, on_the_fly=True))
run_sql('REPLACE LOW_PRIORITY INTO bibfmt (id_bibrec, format, last_updated, value) VALUES (%s, %s, %s, %s)',
(recID, fmt, start_date, formatted_record))
t2 = os.times()[4]
tbibformat += (t2 - t1)
count += 1
if (count % 100) == 0:
write_message(" ... formatted %s records out of %s" % (count, tot))
<API key>('Formatted %s out of %s' % (count, tot))
<API key>(can_stop_too=True)
if (tot % 100) != 0:
write_message(" ... formatted %s records out of %s" % (count, tot))
return (tot, tbibformat, tbibupload)
def iterate_over_old(list, fmt):
"""
Iterate over list of IDs
@param list: the list of record IDs to format
@param fmt: the output format to use
@return: tuple (total number of records, time taken to format, time taken to insert)
"""
n_rec = 0
n_max = 10000
xml_content = '' # hold the contents
tbibformat = 0 # time taken up by external call
tbibupload = 0 # time taken up by external call
total_rec = 0 # Number of formatted records
for record in list:
n_rec = n_rec + 1
total_rec = total_rec + 1
message = "Processing record: %d" % (record)
write_message(message, verbose=9)
query = "id=%d&of=xm" % (record)
count = 0
contents = print_record(record, 'xm')
while (contents == "") and (count < 10):
contents = print_record(record, 'xm')
count = count + 1
time.sleep(10)
if count == 10:
sys.stderr.write("Failed to download %s from %s after 10 attempts... terminating" % (query, CFG_SITE_URL))
sys.exit(0)
xml_content = xml_content + contents
if xml_content:
if n_rec >= n_max:
finalfilename = "%s/rec_fmt_%s.xml" % (CFG_TMPDIR, time.strftime('%Y%m%d_%H%M%S'))
filename = "%s/bibreformat.xml" % CFG_TMPDIR
filehandle = open(filename ,"w")
filehandle.write(xml_content)
filehandle.close()
bibformat external call
<API key>(can_stop_too=True)
t11 = os.times()[4]
message = "START bibformat external call"
write_message(message, verbose=9)
command = "%s/bibformat otype='%s' < %s/bibreformat.xml > %s 2> %s/bibreformat.err" % (CFG_BINDIR, fmt.upper(), CFG_TMPDIR, finalfilename, CFG_TMPDIR)
os.system(command)
t22 = os.times()[4]
message = "END bibformat external call (time elapsed:%2f)" % (t22-t11)
write_message(message, verbose=9)
<API key>(can_stop_too=True)
tbibformat = tbibformat + (t22 - t11)
bibupload external call
t11 = os.times()[4]
message = "START bibupload external call"
write_message(message, verbose=9)
task_id = <API key>('bibupload', 'bibreformat', '-f', finalfilename)
write_message("Task #%s submitted" % task_id)
t22 = os.times()[4]
message = "END bibupload external call (time elapsed:%2f)" % (t22-t11)
write_message(message, verbose=9)
tbibupload = tbibupload + (t22- t11)
n_rec = 0
xml_content = ''
Process the last re-formated chunk
if n_rec > 0:
write_message("Processing last record set (%d)" % n_rec, verbose=9)
finalfilename = "%s/rec_fmt_%s.xml" % (CFG_TMPDIR, time.strftime('%Y%m%d_%H%M%S'))
filename = "%s/bibreformat.xml" % CFG_TMPDIR
filehandle = open(filename, "w")
filehandle.write(xml_content)
filehandle.close()
bibformat external call
t11 = os.times()[4]
message = "START bibformat external call"
write_message(message, verbose=9)
command = "%s/bibformat otype='%s' < %s/bibreformat.xml > %s 2> %s/bibreformat.err" % (CFG_BINDIR, fmt.upper(), CFG_TMPDIR, finalfilename, CFG_TMPDIR)
os.system(command)
t22 = os.times()[4]
message = "END bibformat external call (time elapsed:%2f)" % (t22 - t11)
write_message(message, verbose=9)
tbibformat = tbibformat + (t22 - t11)
bibupload external call
t11 = os.times()[4]
message = "START bibupload external call"
write_message(message, verbose=9)
task_id = <API key>('bibupload', 'bibreformat', '-f', finalfilename)
write_message("Task #%s submitted" % task_id)
t22 = os.times()[4]
message = "END bibupload external call (time elapsed:%2f)" % (t22 - t11)
write_message(message, verbose=9)
tbibupload = tbibupload + (t22 - t11)
return (total_rec, tbibformat, tbibupload)
def task_run_core():
"""Runs the task by fetching arguments from the BibSched task queue. This is what BibSched will be invoking via daemon call."""
## initialize parameters
if task_get_option('format'):
fmts = task_get_option('format')
else:
fmts = 'HB' # default value if no format option given
for fmt in fmts.split(','):
last_updated = fetch_last_updated(fmt)
write_message("last stored run date is %s" % last_updated)
sql = {
"all" : """SELECT br.id FROM bibrec AS br, bibfmt AS bf
WHERE bf.id_bibrec = br.id AND bf.format = '%s'""" % fmt,
"last": """SELECT br.id FROM bibrec AS br
INNER JOIN bibfmt AS bf ON bf.id_bibrec = br.id
WHERE br.modification_date >= '%(last_updated)s'
AND bf.format='%(format)s'
AND bf.last_updated < br.modification_date""" \
% {'format': fmt,
'last_updated': last_updated.strftime('%Y-%m-%d %H:%M:%S')},
"missing" : """SELECT br.id
FROM bibrec as br
LEFT JOIN bibfmt as bf
ON bf.id_bibrec = br.id AND bf.format ='%s'
WHERE bf.id_bibrec IS NULL
AND br.id BETWEEN %%s AND %%s
""" % fmt,
}
sql_queries = []
cds_query = {}
if task_has_option("all"):
sql_queries.append(sql['all'])
if task_has_option("last"):
sql_queries.append(sql['last'])
if task_has_option("collection"):
cds_query['collection'] = task_get_option('collection')
else:
cds_query['collection'] = ""
if task_has_option("field"):
cds_query['field'] = task_get_option('field')
else:
cds_query['field'] = ""
if task_has_option("pattern"):
cds_query['pattern'] = task_get_option('pattern')
else:
cds_query['pattern'] = ""
if task_has_option("matching"):
cds_query['matching'] = task_get_option('matching')
else:
cds_query['matching'] = ""
if task_has_option("recids"):
recids = list(split_cli_ids_arg(task_get_option('recids')))
else:
recids = []
sql commands to be executed during the script run
bibreformat_task(fmt, sql, sql_queries, cds_query, task_has_option('without'), not task_has_option('noprocess'), recids)
return True
def main():
"""Main that construct all the bibtask."""
task_init(<API key>='runbibformat',
authorization_msg="BibReformat Task Submission",
description="""
BibReformat formats the records and saves the produced outputs for
later retrieval.
BibReformat is usually run periodically via BibSched in order to (1)
format new records in the database and to (2) reformat records for
which the meta data has been modified.
BibReformat has to be run manually when (3) format config files have
been modified, in order to see the changes in the web interface.
Although it is not necessary to run BibReformat to display formatted
records in the web interface, BibReformat allows to improve serving
speed by precreating the outputs. It is suggested to run
BibReformat for 'HB' output.
Option -m cannot be used at the same time as option -c.
Option -c prevents from finding records in private collections.
Examples:
bibreformat Format all new or modified records (in HB).
bibreformat -o HD Format all new or modified records in HD.
bibreformat -o HD,HB Format all new or modified records in HD and HB.
bibreformat -a Force reformatting all records (in HB).
bibreformat -c 'Photos' Force reformatting all records in 'Photos' collection (in HB).
bibreformat -c 'Photos' -o HD Force reformatting all records in 'Photos' collection in HD.
bibreformat -i 15 Force reformatting record 15 (in HB).
bibreformat -i 15:20 Force reformatting records 15 to 20 (in HB).
bibreformat -i 15,16,17 Force reformatting records 15, 16 and 17 (in HB).
bibreformat -n Show how many records are to be (re)formatted.
bibreformat -n -c 'Articles' Show how many records are to be (re)formatted in 'Articles' collection.
bibreformat -oHB -s1h Format all new and modified records every hour, in HB.
""", help_specific_usage=""" -o, --formats \t Specify output format/s (default HB)
-n, --noprocess \t Count records to be formatted (no processing done)
Reformatting options:
-a, --all \t Force reformatting all records
-c, --collection \t Force reformatting records by collection
-f, --field \t Force reformatting records by field
-p, --pattern \t Force reformatting records by pattern
-i, --id \t Force reformatting records by record id(s)
Pattern options:
-m, --matching \t Specify if pattern is exact (e), regular expression (r),
\t partial (p), any of the words (o) or all of the words (a)
""",
version=__revision__,
specific_params=("ac:f:p:lo:nm:i:",
["all",
"collection=",
"matching=",
"field=",
"pattern=",
"format=",
"noprocess",
"id="]),
<API key>=<API key>,
<API key>=<API key>,
task_run_fnc=task_run_core)
def <API key>():
"""Last checks and updating on the options..."""
if not (task_has_option('all') or task_has_option('collection') \
or task_has_option('field') or task_has_option('pattern') \
or task_has_option('matching') or task_has_option('recids')):
task_set_option('without', 1)
task_set_option('last', 1)
return True
def <API key>(key, value, opts, args):
"""
Elaborate specific CLI parameters of BibReformat.
@param key: a parameter key to check
@param value: a value associated to parameter X{Key}
@return: True for known X{Key} else False.
"""
if key in ("-a", "--all"):
task_set_option("all", 1)
task_set_option("without", 1)
elif key in ("-c", "--collection"):
task_set_option("collection", value)
elif key in ("-n", "--noprocess"):
task_set_option("noprocess", 1)
elif key in ("-f", "--field"):
task_set_option("field", value)
elif key in ("-p", "--pattern"):
task_set_option("pattern", value)
elif key in ("-m", "--matching"):
task_set_option("matching", value)
elif key in ("-o", "--format"):
input_formats = value.split(',')
## check the validity of the given output formats
invalid_format = <API key>(input_formats)
if invalid_format:
try:
raise Exception('Invalid output format.')
except Exception:
from invenio.errorlib import register_exception
register_exception(prefix="The given output format '%s' is not available or is invalid. Please try again" % invalid_format, alert_admin=True)
return
else: # every given format is available
task_set_option("format", value)
elif key in ("-i", "--id"):
task_set_option("recids", value)
else:
return False
return True
okay, here we go:
if __name__ == '__main__':
main() |
#!/bin/bash
vagrant ssh -c '/vagrant/server-scripts/headlessx.sh' |
#pragma once
#include "AbstractModule.h"
#include <assert.h>
#include <memory>
#include <shared_mutex>
#include <string>
#include <unordered_map>
namespace visor {
/**
* called from HTTP threads so must be thread safe
*/
template <typename ModuleType>
class AbstractManager
{
static_assert(std::is_base_of<AbstractModule, ModuleType>::value, "ModuleType must inherit from AbstractModule");
protected:
typedef std::unordered_map<std::string, std::unique_ptr<ModuleType>> ModuleMap;
ModuleMap _map;
mutable std::shared_mutex _map_mutex;
public:
AbstractManager()
: _map()
{
}
auto <API key>()
{
struct retVals {
ModuleMap ↦
std::unique_lock<std::shared_mutex> lock;
};
std::unique_lock lock(_map_mutex);
return retVals{_map, std::move(lock)};
}
// atomically ensure module starts before arriving in registry, if requested
virtual void module_add(std::unique_ptr<ModuleType> &&m, bool start = true)
{
std::unique_lock lock(_map_mutex);
if (_map.count(m->name())) {
throw std::runtime_error("module name already exists");
}
if (start) {
m->start();
}
_map.emplace(m->name(), std::move(m));
}
// note the module returned has separate thread safety, but the returned lock ensures
// the module will not be removed before the caller has a chance to initialize
auto module_get_locked(const std::string &name)
{
std::unique_lock lock(_map_mutex);
if (_map.count(name) == 0) {
throw std::runtime_error("module name does not exist");
}
struct retVals {
ModuleType *map;
std::unique_lock<std::shared_mutex> lock;
};
return retVals{_map[name].get(), std::move(lock)};
}
virtual void module_remove(const std::string &name)
{
std::unique_lock lock(_map_mutex);
if (_map.count(name) == 0) {
throw std::runtime_error("module name does not exist");
}
_map[name]->stop();
_map.erase(name);
}
// note, this only guarantees the name existed at the time of call, watch for race conditions!
bool module_exists(const std::string &name) const
{
std::shared_lock lock(_map_mutex);
return _map.count(name) == 1;
}
};
} |
using System;
using FluentAssertions;
using FreelanceManager.Events.Account;
using FreelanceManager.ReadModel.EventHandlers;
using FreelanceManager.ReadModel.Repositories;
using FreelanceManager.Tools;
using Xunit;
namespace FreelanceManager.ReadModel.<API key>
{
public class <API key> : Specification
{
private Guid _id = Guid.NewGuid();
private AccountPassword _account;
private <API key> _handler;
private <API key> <API key>;
protected override void Context()
{
_handler = Resolve<<API key>>();
<API key> = Resolve<<API key>>();
_handler.AsDynamic().Handle(new AccountCreated(_id, "John Doe BVBA", "John", "Doe", "john@doe.com", DateTime.UtcNow) { Version = 1 });
_handler.AsDynamic().Handle(new <API key>(_id, "hash", 20) { Version = 2 });
}
protected override void Because()
{
_handler.AsDynamic().Handle(new <API key>(_id, "newhash", 30) { Version = 3 });
_account = <API key>.GetById(_id);
}
[Fact]
public void should_have_a_id()
{
_account.Id.Should().Be(_id);
}
[Fact]
public void <API key>()
{
_account.Password.Should().Be("newhash");
}
[Fact]
public void <API key>()
{
_account.PasswordSalt.Should().Be(30);
}
}
} |
<?php
/*
* WBAvatar Config Sample
*/
define( 'IMAGEDIR', '' );
define( 'AKEY', '' );
define( 'ASEC', '' );
define( 'RURL', '' ); |
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Std Lib
import sys
import os
import threading
import pickle
import time
import struct
# Local
from base.g import *
from base.codes import *
from base.ldif import LDIFParser
from base import device, utils, vcard
from prnt import cups
from base.sixext import BytesIO
from base.sixext import to_bytes_utf8, to_long, to_unicode
try:
from . import coverpages
except ImportError:
pass
try:
import dbus
except ImportError:
log.error("dbus is required for PC send fax.")
import warnings
# Ignore: .../dbus/connection.py:242: DeprecationWarning: object.__init__() takes no parameters
# (occurring on Python 2.6/dBus 0.83/Ubuntu 9.04)
warnings.simplefilter("ignore", DeprecationWarning)
# Update queue values (Send thread ==> UI)
STATUS_IDLE = 0
<API key> = 1
<API key> = 2
STATUS_DIALING = 3
STATUS_CONNECTING = 4
STATUS_SENDING = 5
STATUS_COMPLETED = 6
<API key> = 7
STATUS_ERROR = 8
STATUS_BUSY = 9
STATUS_CLEANUP = 10
<API key> = 11
<API key> = 12
<API key> = 13
STATUS_JOB_CANCEL = 14
# Event queue values (UI ==> Send thread)
<API key> = 1
# Other values in queue are:
#<API key> = 8010
#<API key> = 8011
#<API key> = 8012
# HPLIP G3 Fax File Format (big endian)
# # File Header: Total 28 bytes #
# # Magic bytes: 8 bytes ("hplip_g3") #
# # Total pages in file(=p): 32 bits #
# # Hort DPI: 16 bits (200 or 300) #
# # Vert DPI: 16 bits (100, 200, or 300) #
# # Page Size: 8 bits (0=Unk, 1=Letter, 2=A4, #
# # Resolution: 8 bits (0=Unk, 1=Std, 2=Fine, #
# # 3=300DPI) #
# # Encoding: 8 bits (2=MH, 4=MMR, 7=JPEG) #
# # Reserved1: 32 bits (0) #
# # Reserved2: 32 bits (0) #
# # Page 1 Header: Total 24 bytes #
# # Page number: 32 bits (1 based) #
# # Pixels per row: 32 bits #
# # Rows this page: 32 bits #
# # Image bytes this page(=x): 32 bits #
# # Thumbnail bytes this page(=y): 32 bits #
# # (thumbnail not present if y == 0) #
# # (encoding?) #
# # letter: 134 px wide x 173 px high #
# # a4 : 134 px wide x 190 px high #
# # Reserved3: 32 bits (0) #
# # Image data: x bytes #
# # Thumbnail data: y bytes (if present) #
# # Page 2 Header: Total 24 bytes #
# # Image Data #
# # Thumbnail data (if present) #
# # ... Pages 3 - (p-1) ... #
# # Page p Header: Total 24 bytes #
# # Image Data #
# # Thumbnail data (if present) #
RESOLUTION_STD = 1
RESOLUTION_FINE = 2
RESOLUTION_300DPI = 3
FILE_HEADER_SIZE = 28
PAGE_HEADER_SIZE = 24
##skip_dn = ["uid=foo,ou=People,dc=example,dc=com",
## "uid=bar,ou=People,dc=example,dc=com", "dc=example,dc=com"]
class FaxLDIFParser(LDIFParser):
def __init__(self, input, db):
LDIFParser.__init__(self, input)
self.db = db
def handle(self, dn, entry):
if dn:
try:
firstname = entry['givenName'][0]
except KeyError:
try:
firstname = entry['givenname'][0]
except KeyError:
firstname = ''
try:
lastname = entry['sn'][0]
except KeyError:
lastname = ''
try:
nickname = entry['cn'][0]
except KeyError:
nickname = firstname + ' ' + lastname
try:
fax = entry['<API key>'][0] # fax
except KeyError:
try:
fax = entry['fax'][0]
except KeyError:
fax = ''
grps = []
try:
grps = entry['ou']
except KeyError:
pass
grps.append(to_unicode('All'))
groups = [g for g in grps if g]
if nickname:
log.debug("Import: name=%s, fax=%s, group(s)=%s, notes=%s" % ( nickname, fax, ','.join(groups), dn))
self.db.set(nickname, title, firstname, lastname, fax, groups, dn)
class FaxAddressBook(object): # Pickle based address book
def __init__(self):
self._data = {}
# { 'name' : {'name': u'',
# 'firstname' : u'', # NOT USED STARTING IN 2.8.9
# 'lastname': u', # NOT USED STARTING IN 2.8.9
# 'title' : u'', # NOT USED STARTING IN 2.8.9
# 'fax': u'',
# 'groups' : [u'', u'', ...],
# 'notes' : u'', } ...
self.load()
def load(self):
self._fab = "/dev/null"
if prop.user_dir != None:
self._fab = os.path.join(prop.user_dir, "fab.pickle")
#old_fab = os.path.join(prop.user_dir, "fab.db")
# Load the existing pickle if present
if os.path.exists(self._fab):
pickle_file = open(self._fab, "rb")
self._data = pickle.load(pickle_file)
pickle_file.close()
else:
self.save() # save the empty file to create the file
def set(self, name, title, firstname, lastname, fax, groups, notes):
# try:
# grps = [to_unicode(s) for s in groups]
# except UnicodeDecodeError:
# grps = [to_unicode(s.decode('utf-8')) for s in groups]
grps = [to_unicode(s) for s in groups]
self._data[to_unicode(name)] = {'name' : to_unicode(name),
'title': to_unicode(title), # NOT USED STARTING IN 2.8.9
'firstname': to_unicode(firstname), # NOT USED STARTING IN 2.8.9
'lastname': to_unicode(lastname), # NOT USED STARTING IN 2.8.9
'fax': to_unicode(fax),
'notes': to_unicode(notes),
'groups': grps}
self.save()
insert = set
def set_key_value(self, name, key, value):
self._data[to_unicode(name)][key] = value
self.save()
def get(self, name):
return self._data.get(name, None)
select = get
def rename(self, old_name, new_name):
try:
self._data[old_name]
except KeyError:
return
else:
try:
self._data[new_name]
except KeyError:
self._data[new_name] = self._data[old_name].copy()
self._data[new_name]['name'] = new_name
del self._data[old_name]
self.save()
def get_all_groups(self):
all_groups = []
for e, v in list(self._data.items()):
for g in v['groups']:
if g not in all_groups:
all_groups.append(g)
return all_groups
def get_all_records(self):
return self._data
def get_all_names(self):
return list(self._data.keys())
def save(self):
try:
pickle_file = open(self._fab, "wb")
pickle.dump(self._data, pickle_file, protocol=2)
pickle_file.close()
except IOError:
log.error("I/O error saving fab file.")
def clear(self):
self._data = {}
self.save()
def delete(self, name):
if name in self._data:
del self._data[name]
self.save()
return True
return False
def <API key>(self):
try:
return os.stat(self._fab).st_mtime
except OSError:
return 0
def update_groups(self, group, members):
for e, v in list(self._data.items()):
if v['name'] in members: # membership indicated
if not group in v['groups']:
v['groups'].append(to_unicode(group))
else:
if group in v['groups']:
v['groups'].remove(to_unicode(group))
self.save()
def delete_group(self, group):
for e, v in list(self._data.items()):
if group in v['groups']:
v['groups'].remove(to_unicode(group))
self.save()
def group_members(self, group):
members = []
for e, v in list(self._data.items()):
if group in v['groups']:
members.append(e)
return members
def add_to_group(self, group, members):
group_members = self.group_members(group)
new_group_members = []
for m in members:
if m not in group_members:
new_group_members.append(m)
self.update_groups(group, group_members + new_group_members)
def remove_from_group(self, group, remove_members):
group_members = self.group_members(group)
new_group_members = []
for m in group_members:
if m not in remove_members:
new_group_members.append(m)
self.update_groups(group, new_group_members)
def rename_group(self, old_group, new_group):
members = self.group_members(old_group)
self.update_groups(old_group, [])
self.update_groups(new_group, members)
def import_ldif(self, filename):
try:
data = open(filename, 'r').read()
log.debug_block(filename, data)
parser = FaxLDIFParser(open(filename, 'r'), self)
parser.parse()
self.save()
return True, ''
except ValueError as e:
return False, e.message
def import_vcard(self, filename):
data = open(filename, 'r').read()
log.debug_block(filename, data)
for card in vcard.VCards(vcard.VFile(vcard.opentextfile(filename))):
log.debug(card)
if card['name']:
fax = ''
for x in range(1, 9999):
if x == 1:
s = 'phone'
else:
s = 'phone%d' % x
try:
card[s]
except KeyError:
break
else:
if 'fax' in card[s]['type']:
fax = card[s]['number']
break
org = card.get('organisation', '')
if org:
org = [org]
else:
org = card.get('categories', '').split(';')
if not org:
org = []
org.append(to_unicode('All'))
groups = [o for o in org if o]
name = card['name']
notes = card.get('notes', to_unicode(''))
log.debug("Import: name=%s, fax=%s group(s)=%s notes=%s" % (name, fax, ','.join(groups), notes))
self.set(name, to_unicode(''), to_unicode(''), to_unicode(''), fax, groups, notes)
return True, ''
class FaxDevice(device.Device):
def __init__(self, device_uri=None, printer_name=None,
callback=None,
fax_type=FAX_TYPE_NONE,
disable_dbus=False):
device.Device.__init__(self, device_uri, printer_name,
None, callback, disable_dbus)
self.send_fax_thread = None
self.upload_log_thread = None
self.fax_type = fax_type
if not disable_dbus:
session_bus = dbus.SessionBus()
self.service = session_bus.get_object('com.hplip.StatusService', "/com/hplip/StatusService")
else:
self.service = None
def setPhoneNum(self, num):
raise AttributeError
def getPhoneNum(self):
raise AttributeError
phone_num = property(getPhoneNum, setPhoneNum)
def setStationName(self, name):
raise AttributeError
def getStationName(self):
raise AttributeError
station_name = property(getStationName, setStationName)
def setDateAndTime(self):
raise AttributeError
def uploadLog(self):
raise AttributeError
def isUploadLogActive(self):
raise AttributeError
def <API key>(self):
raise AttributeError
def sendFaxes(self, phone_num_list, fax_file_list, cover_message='', cover_re='',
cover_func=None, preserve_formatting=False, printer_name='',
update_queue=None, event_queue=None):
raise AttributeError
def isSendFaxActive(self):
if self.send_fax_thread is not None:
return self.send_fax_thread.isAlive()
else:
return False
def <API key>(self):
if self.send_fax_thread is not None and \
self.send_fax_thread.isAlive():
try:
self.send_fax_thread.join()
except KeyboardInterrupt:
pass
def getFaxDevice(device_uri=None, printer_name=None,
callback=None,
fax_type=FAX_TYPE_NONE,
disable_dbus=False):
if fax_type == FAX_TYPE_NONE:
if device_uri is None and printer_name is not None:
printers = cups.getPrinters()
for p in printers:
if p.name.lower() == printer_name.lower():
device_uri = p.device_uri
break
else:
raise Error(<API key>)
if device_uri is not None:
mq = device.queryModelByURI(device_uri)
fax_type = mq['fax-type']
log.debug("fax-type=%d" % fax_type)
if fax_type in (<API key>, <API key>):
from .pmlfax import PMLFaxDevice
return PMLFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
elif fax_type == FAX_TYPE_SOAP:
from .soapfax import SOAPFaxDevice
return SOAPFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
elif fax_type == FAX_TYPE_LEDMSOAP:
from .ledmsoapfax import LEDMSOAPFaxDevice
return LEDMSOAPFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
elif fax_type == FAX_TYPE_MARVELL:
from .marvellfax import MarvellFaxDevice
return MarvellFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
elif fax_type == FAX_TYPE_LEDM:
from .ledmfax import LEDMFaxDevice
return LEDMFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
else:
raise Error(<API key>)
# TODO: Define these in only 1 place!
STATE_DONE = 0
STATE_ABORTED = 10
STATE_SUCCESS = 20
STATE_BUSY = 25
<API key> = 30
STATE_PRERENDER = 40
STATE_COUNT_PAGES = 50
<API key> = 60
STATE_COVER_PAGE = 70
STATE_SINGLE_FILE = 80
STATE_MERGE_FILES = 90
STATE_SINGLE_FILE = 100
STATE_SEND_FAX = 110
STATE_CLEANUP = 120
STATE_ERROR = 130
class FaxSendThread(threading.Thread):
def __init__(self, dev, service, phone_num_list, fax_file_list,
cover_message='', cover_re='', cover_func=None, preserve_formatting=False,
printer_name='', update_queue=None, event_queue=None):
threading.Thread.__init__(self)
self.dev = dev # device.Device
self.service = service # dbus proxy to status server object
self.phone_num_list = phone_num_list
self.fax_file_list = fax_file_list
self.update_queue = update_queue
self.event_queue = event_queue
self.cover_message = cover_message
self.cover_re = cover_re
self.cover_func = cover_func
self.current_printer = printer_name
self.stream = BytesIO()
self.prev_update = ''
self.remove_temp_file = False
self.preserve_formatting = preserve_formatting
self.results = {} # {'file' : error_code,...}
self.cover_page_present = False
self.recipient_file_list = []
self.f = None # final file of fax data to send (pages merged)
self.job_hort_dpi = 0
self.job_hort_dpi = 0
self.job_vert_dpi = 0
self.job_page_size = 0
self.job_resolution = 0
self.job_encoding = 0
def pre_render(self, state):
# pre-render each page that needs rendering
# except for the cover page
self.cover_page_present = False
log.debug(self.fax_file_list)
for fax_file in self.fax_file_list: # (file, type, desc, title)
fax_file_name, fax_file_type, fax_file_desc, \
fax_file_title, fax_file_pages = fax_file
if fax_file_type == "application/hplip-fax-coverpage": # render later
self.cover_page_present = True
log.debug("Skipping coverpage")
#if fax_file_type == "application/hplip-fax": # already rendered
else:
self.rendered_file_list.append((fax_file_name, "application/hplip-fax",
"HP Fax", fax_file_title))
log.debug("Processing pre-rendered file: %s (%d pages)" %
(fax_file_name, fax_file_pages))
if self.check_for_cancel():
state = STATE_ABORTED
log.debug(self.rendered_file_list)
if self.check_for_cancel():
state = STATE_ABORTED
return state
def count_pages(self, state):
self.recipient_file_list = self.rendered_file_list[:]
log.debug("Counting total pages...")
self.job_total_pages = 0
log.debug(self.recipient_file_list)
i = 0
for fax_file in self.recipient_file_list: # (file, type, desc, title)
fax_file_name = fax_file[0]
log.debug("Processing file (counting pages): %s..." % fax_file_name)
#self.write_queue((<API key>, self.job_total_pages, ''))
if os.path.exists(fax_file_name):
self.results[fax_file_name] = ERROR_SUCCESS
fax_file_fd = open(fax_file_name, 'rb')
header = fax_file_fd.read(FILE_HEADER_SIZE)
magic, version, total_pages, hort_dpi, vert_dpi, page_size, \
resolution, encoding, reserved1, reserved2 = \
self.decode_fax_header(header)
if magic != b'hplip_g3':
log.error("Invalid file header. Bad magic.")
self.results[fax_file_name] = <API key>
state = STATE_ERROR
continue
if not i:
self.job_hort_dpi, self.job_vert_dpi, self.job_page_size, \
self.job_resolution, self.job_encoding = \
hort_dpi, vert_dpi, page_size, resolution, encoding
i += 1
else:
if self.job_hort_dpi != hort_dpi or \
self.job_vert_dpi != vert_dpi or \
self.job_page_size != page_size or \
self.job_resolution != resolution or \
self.job_encoding != encoding:
log.error("Incompatible options for file: %s" % fax_file_name)
self.results[fax_file_name] = <API key>
state = STATE_ERROR
log.debug("Magic=%s Ver=%d Pages=%d hDPI=%d vDPI=%d Size=%d Res=%d Enc=%d" %
(magic, version, total_pages, hort_dpi,
vert_dpi, page_size, resolution, encoding))
self.job_total_pages += total_pages
fax_file_fd.close()
else:
log.error("Unable to find HP Fax file: %s" % fax_file_name)
self.results[fax_file_name] = <API key>
state = STATE_ERROR
break
if self.check_for_cancel():
state = STATE_ABORTED
break
if self.cover_page_present:
self.job_total_pages += 1 # Cover pages are truncated to 1 page
log.debug("Total fax pages=%d" % self.job_total_pages)
return state
def decode_fax_header(self, header):
try:
return struct.unpack(">8sBIHHBBBII", header)
except struct.error:
return -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
def decode_page_header(self, header):
try:
return struct.unpack(">IIIIII", header)
except struct.error:
return -1, -1, -1, -1, -1, -1
def cover_page(self, recipient):
if self.job_total_pages > 1:
state = STATE_MERGE_FILES
else:
state = STATE_SINGLE_FILE
if self.cover_page_present:
log.debug("Creating cover page for recipient: %s" % recipient['name'])
fax_file, canceled = self.render_cover_page(recipient)
if canceled:
state = STATE_ABORTED
elif not fax_file:
state = STATE_ERROR # timeout
else:
self.recipient_file_list.insert(0, (fax_file, "application/hplip-fax",
"HP Fax", 'Cover Page'))
log.debug("Cover page G3 file: %s" % fax_file)
self.results[fax_file] = ERROR_SUCCESS
return state
def single_file(self, state):
state = STATE_SEND_FAX
log.debug("Processing single file...")
self.f = self.recipient_file_list[0][0]
try:
f_fd = open(self.f, 'rb')
except IOError:
log.error("Unable to open fax file: %s" % self.f)
state = STATE_ERROR
else:
header = f_fd.read(FILE_HEADER_SIZE)
magic, version, total_pages, hort_dpi, vert_dpi, page_size, \
resolution, encoding, reserved1, reserved2 = self.decode_fax_header(header)
self.results[self.f] = ERROR_SUCCESS
if magic != b'hplip_g3':
log.error("Invalid file header. Bad magic.")
self.results[self.f] = <API key>
state = STATE_ERROR
log.debug("Magic=%s Ver=%d Pages=%d hDPI=%d vDPI=%d Size=%d Res=%d Enc=%d" %
(magic, version, total_pages, hort_dpi, vert_dpi,
page_size, resolution, encoding))
f_fd.close()
return state
def merge_files(self, state):
log.debug("%s State: Merge multiple files" % ("*"*20))
log.debug(self.recipient_file_list)
log.debug("Merging g3 files...")
self.remove_temp_file = True
if self.job_total_pages:
f_fd, self.f = utils.make_temp_file()
log.debug("Temp file=%s" % self.f)
data = struct.pack(">8sBIHHBBBII", b"hplip_g3", to_long(1), self.job_total_pages,
self.job_hort_dpi, self.job_vert_dpi, self.job_page_size,
self.job_resolution, self.job_encoding,
to_long(0), to_long(0))
os.write(f_fd, data)
job_page_num = 1
for fax_file in self.recipient_file_list:
fax_file_name = fax_file[0]
log.debug("Processing file: %s..." % fax_file_name)
if self.results[fax_file_name] == ERROR_SUCCESS:
fax_file_fd = open(fax_file_name, 'rb')
header = fax_file_fd.read(FILE_HEADER_SIZE)
magic, version, total_pages, hort_dpi, vert_dpi, page_size, \
resolution, encoding, reserved1, reserved2 = self.decode_fax_header(header)
if magic != b'hplip_g3':
log.error("Invalid file header. Bad magic.")
state = STATE_ERROR
break
log.debug("Magic=%s Ver=%d Pages=%d hDPI=%d vDPI=%d Size=%d Res=%d Enc=%d" %
(magic, version, total_pages, hort_dpi, vert_dpi, page_size, resolution, encoding))
for p in range(total_pages):
header = fax_file_fd.read(PAGE_HEADER_SIZE)
page_num, ppr, rpp, bytes_to_read, thumbnail_bytes, reserved2 = \
self.decode_page_header(header)
if page_num == -1:
log.error("Page header error")
state - STATE_ERROR
break
header = struct.pack(">IIIIII", job_page_num, ppr, rpp, bytes_to_read, thumbnail_bytes, to_long(0))
os.write(f_fd, header)
self.write_queue((<API key>, job_page_num, ''))
log.debug("Page=%d PPR=%d RPP=%d BPP=%d Thumb=%s" %
(page_num, ppr, rpp, bytes_to_read, thumbnail_bytes))
os.write(f_fd, fax_file_fd.read(bytes_to_read))
job_page_num += 1
fax_file_fd.close()
if self.check_for_cancel():
state = STATE_ABORTED
break
else:
log.error("Skipping file: %s" % fax_file_name)
continue
os.close(f_fd)
log.debug("Total pages=%d" % self.job_total_pages)
return state
def next_recipient_gen(self):
for a in self.phone_num_list:
yield a
def next_file_gen(self):
for a in self.recipient_file_list:
yield a
def render_file(self, path, title, mime_type, force_single_page=False):
all_pages = True
page_range = ''
page_set = 0
nup = 1
cups.resetOptions()
if mime_type in ["application/x-cshell",
"application/x-perl",
"application/x-python",
"application/x-shell",
"application/x-sh",
"text/plain",]:
cups.addOption('prettyprint')
if nup > 1:
cups.addOption('number-up=%d' % nup)
if force_single_page:
cups.addOption('page-ranges=1') # Force coverpage to 1 page
sent_job_id = cups.printFile(self.current_printer, path, title)
cups.resetOptions()
log.debug("Job ID=%d" % sent_job_id)
job_id = 0
time.sleep(1)
fax_file = ''
complete = False
end_time = time.time() + 300.0 # wait for 5 min. max
while time.time() < end_time:
log.debug("Waiting for fax... type =%s"%type(self.dev.device_uri))
result = list(self.service.CheckForWaitingFax(self.dev.device_uri, prop.username, sent_job_id))
fax_file = str(result[7])
log.debug("Fax file=%s" % fax_file)
if fax_file:
break
if self.check_for_cancel():
log.error("Render canceled. Canceling job #%d..." % sent_job_id)
cups.cancelJob(sent_job_id)
return '', True
time.sleep(1)
else:
log.error("Timeout waiting for rendering. Canceling job #%d..." % sent_job_id)
cups.cancelJob(sent_job_id)
return '', False
return fax_file, False
def check_for_cancel(self):
canceled = False
while self.event_queue.qsize():
try:
event = self.event_queue.get(0)
if event[0] == <API key>:
canceled = True
log.debug("Cancel pressed!")
except Queue.Empty:
break
return canceled
def render_cover_page(self, a):
log.debug("Creating cover page...")
#Read file again just before creating the coverpage, so that we get updated voice_phone and email_address from /hplip.conf file
#hplip.conf file get updated, whenever user changes coverpage info from hp-faxsetup window.
user_conf.read()
pdf = self.cover_func(page_size=coverpages.PAGE_SIZE_LETTER,
total_pages=self.job_total_pages,
recipient_name=a['name'],
recipient_phone='',
recipient_fax=a['fax'],
sender_name=self.sender_name,
sender_phone=user_conf.get('fax', 'voice_phone'),
sender_fax=self.sender_fax,
sender_email=user_conf.get('fax', 'email_address'),
regarding=self.cover_re,
message=self.cover_message,
preserve_formatting=self.preserve_formatting)
log.debug("PDF File=%s" % pdf)
fax_file, canceled = self.render_file(pdf, 'Cover Page', "application/pdf",
force_single_page=True)
try:
os.remove(pdf)
except IOError:
pass
return fax_file, canceled
def write_queue(self, message):
if self.update_queue is not None and message != self.prev_update:
self.update_queue.put(message)
time.sleep(0)
self.prev_update = message
def run(self):
pass |
#!/usr/bin/perl
# Produced at the Lawrence Livermore National Laboratory.
# Written by Jeff Long <long6@llnl.gov>, et. al.
# LLNL-CODE-640252
# This file is part of Lorenz.
# This program is free software; you can redistribute it and/or modify it
# Free Software Foundation) version 2, dated June 1991.
# This program is distributed in the hope that it will be useful, but WITHOUT
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Lorenz Test Runner (interactive)
BEGIN {
require '/usr/global/tools/lorenz/lib/lorenz.pl';
}
use strict;
use URI::Escape;
use Capture::Tiny qw(capture_merged);
use POSIX qw(strftime);
use Lorenz::DependencyManager qw(:standard);
my $username = getlogin();
my $passwd;
print "Lorenz Test Runner\n";
my %apps = getLorenzApps();
my ($a, $c) = split(/-/, $ARGV[0]);
my $dir = "/usr/global/tools/lorenz/selenium/";
my $command = "java -jar $dir/<API key>.6.0.jar -userExtensions $dir/user-extensions.js -<API key> $dir/firefox-template";
$| = 1;
my $p = open(COMMAND, "$command > /dev/null 2>&1 |");
sleep(5);
print "Password: ";
system "stty -echo"; # disable echo
chomp(my $pass = <STDIN>);
system "stty echo"; # enable echo
$passwd = uri_escape($pass);
print "\n";
if(defined($a)){
if($apps{$a}){
runSuiteTests($a, $c);
}else{
die("Invalid application name! Accepted forms are 'appName' or 'appName-testName'");
}
}else{
for(keys %apps){
runSuiteTests($_);
}
}
my $pp = `pgrep -P $p`;
`kill $p`;
`kill $pp`;
close COMMAND;
sub runSuiteTests {
my $a = shift;
my $c = shift;
print "\nApplication $a:\n";
if(defined($c)){
my $s = "$main::lorenzRootDir/$a/tests/sel-$c.pl";
if(-e "$s"){
print "\n";
startTest($c, $s);
}else{
die "Could not find test suite \"$c\" in application $a, searched for script: $s";
}
}else{
my @tests = <$main::lorenzRootDir/$a/tests/sel-*.pl>;
if(!scalar @tests){
print "No tests found\n";
}
foreach(@tests){
$_ =~ m/.*\/sel-(.*).pl/;
startTest($1, $_);
}
}
}
sub startTest {
my $c = shift;
my $s = shift;
print "Running test suite $c...";
my $i;
my $out = capture_merged {
my @args = ("perl", "$s", $username, $passwd);
$i = system(@args);
};
my $status = $i ? "FAILED!" : "OK";
print "$status\n";
if($i){
my $fn = "$ENV{'HOME'}/test_$c".strftime("_%b-%e-%H:%M:%S", localtime).".log";
open(RES, ">$fn");
print RES "$out";
close(RES);
print ">>Test output: $fn\n";
}
} |
#include <inttypes.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <string.h>
#include <stdio.h>
#include "ambilight.h"
void cmdGetStatus(uint8_t argc, char** argv)
{
unsigned int status;
volatile uint8_t* address = <API key>;
status = *address;
printf_P(PSTR("status: %d\n"), status);
} |
package com.test.manager;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
class GuiMain extends JFrame {
private static final long serialVersionUID = 1L;
private ObjectStore objectStore = new ObjectStore();
private Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
private int currentQuestion = 0;
JTextArea textArea = new JTextArea();
JButton add = new JButton("Add");
JButton edit = new JButton("Edit");
JButton delete = new JButton("Delete");
JButton next = new JButton("Next");
JButton prev = new JButton("Previous");
GuiMain guimain;
GuiMain() {
guimain=this;
this.setLayout(null);
try {
objectStore.readFromStore();
System.out.println(objectStore.getTotalQuestions());
} catch (Exception e) {
e.printStackTrace();
}
setExtendedState(JFrame.MAXIMIZED_BOTH);
setTitle("Test Manager");
// when the window is close app should be tero4ated
<API key>(JFrame.EXIT_ON_CLOSE);
createUI();
}
void createUI() {
JScrollPane scrollPane = new JScrollPane(textArea);
scrollPane
.<API key>(JScrollPane.<API key>);
textArea.setEditable(false);
add.setLocation(10, 10);
edit.setLocation(110, 10);
delete.setLocation(210, 10);
prev.setLocation(dim.width / 2 - 100, 10);
next.setLocation(dim.width / 2, 10);
// initialising the text area
setQuestionDisplay(objectStore.getTotalQuestions() > 0 ? currentQuestion : -1);
textArea.setLocation(10, 50);
add.setSize(100, 30);
edit.setSize(100, 30);
delete.setSize(100, 30);
prev.setSize(100, 30);
next.setSize(100, 30);
addActionListeners();
textArea.setSize(dim.width - 90, dim.height - 110);
this.add(add);
this.add(edit);
this.add(delete);
this.add(prev);
this.add(next);
this.add(textArea);
}
void setQuestionDisplay(int index) {
if (objectStore.getTotalQuestions() == 0)
textArea.setText("NO QUESTIONS ADDED.");
else
textArea.setText(objectStore.getList().get(index).toString());
}
void addActionListeners() {
add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
new GuiAdd(280, 300, objectStore, -1,guimain).setVisible(true);
}
});
next.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
if (currentQuestion <= objectStore.getTotalQuestions() - 1) {
currentQuestion++;
if(currentQuestion == objectStore.getTotalQuestions()) {
currentQuestion
}
setQuestionDisplay(currentQuestion);
}
}
});
prev.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
if (currentQuestion > 0) {
setQuestionDisplay(--currentQuestion);
}
}
});
edit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
new GuiAdd(280, 300, objectStore, currentQuestion,guimain).setVisible(true);
}
});
delete.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
objectStore.deleteQuestion(currentQuestion);
objectStore.storeData();
textArea.setText("QUESTION DELETED.");
currentQuestion
if(objectStore.getTotalQuestions() != 0) {
if (currentQuestion <= objectStore.getTotalQuestions() - 1) {
currentQuestion++;
if(currentQuestion == objectStore.getTotalQuestions()) {
currentQuestion
}
setQuestionDisplay(currentQuestion);
}
}
}
});
}
} |
/*
Forces backgrounds to span full width,
even if there is horizontal scrolling.
Increase this if your layout is wider.
Note: IE6 works fine without this fix.
*/
.container_24 {
margin-left: auto;
margin-right: auto;
width: 960px;
}
.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12, .grid_13, .grid_14, .grid_15, .grid_16, .grid_17, .grid_18, .grid_19, .grid_20, .grid_21, .grid_22, .grid_23, .grid_24 {
display: inline;
float: left;
margin-left: 5px;
margin-right: 5px;
}
.alpha {
margin-left: 0;
}
.omega {
margin-right: 0;
}
.container_24 .grid_1 {
width: 30px;
}
.container_24 .grid_2 {
width: 70px;
}
.container_24 .grid_3 {
width: 110px;
}
.container_24 .grid_4 {
width: 150px;
}
.container_24 .grid_5 {
width: 190px;
}
.container_24 .grid_6 {
width: 230px;
}
.container_24 .grid_7 {
width: 270px;
}
.container_24 .grid_8 {
width: 310px;
}
.container_24 .grid_9 {
width: 350px;
}
.container_24 .grid_10 {
width: 390px;
}
.container_24 .grid_11 {
width: 430px;
}
.container_24 .grid_12 {
width: 470px;
}
.container_24 .grid_13 {
width: 510px;
}
.container_24 .grid_14 {
width: 550px;
}
.container_24 .grid_15 {
width: 590px;
}
.container_24 .grid_16 {
width: 630px;
}
.container_24 .grid_17 {
width: 670px;
}
.container_24 .grid_18 {
width: 710px;
}
.container_24 .grid_19 {
width: 750px;
}
.container_24 .grid_20 {
width: 790px;
}
.container_24 .grid_21 {
width: 830px;
}
.container_24 .grid_22 {
width: 870px;
}
.container_24 .grid_23 {
width: 910px;
}
.container_24 .grid_24 {
width: 950px;
}
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:before, .clearfix:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
/*
The following zoom:1 rule is specifically for IE6 + IE7.
Move to separate stylesheet if invalid CSS is a problem.
*/
.clearfix {
zoom: 1;
}
/* This query is applied for
Protait Tablet ipad
*/
@media only screen and (min-width: 768px) and (max-width: 960px) {
.container_24 {
margin-left: auto;
margin-right: auto;
width: 760px;
}
/* Each columns are measured
For their specific size.
*/
.container_24 .grid_1 {
width: 3.167%;
}
.container_24 .grid_2 {
width: 7.333%;
}
.container_24 .grid_3 {
width: 11.5%;
}
.container_24 .grid_4 {
width: 15.667%;
}
.container_24 .grid_5 {
width: 19.833%;
}
.container_24 .grid_6 {
width: 24%;
}
.container_24 .grid_7 {
width: 28.167%;
}
.container_24 .grid_8 {
width: 32.333%;
}
.container_24 .grid_9 {
width: 36.5%;
}
.container_24 .grid_10 {
width: 40.667%;
}
.container_24 .grid_11 {
width: 44.833%;
}
.container_24 .grid_12 {
width: 49%;
}
.container_24 .grid_13 {
width: 53.167%;
}
.container_24 .grid_14 {
width: 57.333%;
}
.container_24 .grid_15 {
width: 61.5%;
}
.container_24 .grid_16 {
width: 65.667%;
}
.container_24 .grid_17 {
width: 69.833%;
}
.container_24 .grid_18 {
width: 74%;
}
.container_24 .grid_19 {
width: 78.167%;
}
.container_24 .grid_20 {
width: 82.333%;
}
.container_24 .grid_21 {
width: 86.5%;
}
.container_24 .grid_22 {
width: 90.667%;
}
.container_24 .grid_23 {
width: 94.833%;
}
.container_24 .grid_24 {
width: 99%;
}
}
/* This query is applied for
landscape ipad, Mobile
*/
@media only screen and (min-width: 480px) and (max-width: 767px) {
.container_24 {
width: 480px;
}
/* `Grid 1 to 12 columns
Moved to 100% width
Acroding to container width
In landscape tablet screen
*/
.container_24 .grid_1, .container_24 .grid_2, .container_24 .grid_3, .container_24 .grid_4, .container_24 .grid_5, .container_24 .grid_6, .container_24 .grid_7, .container_24 .grid_8, .container_24 .grid_9, .container_24 .grid_10, .container_24 .grid_11, .container_24 .grid_12 {
width: 100%;
}
/* Grid 13 to 24 columns
Fixed in 470px in minimum
Width 480px to maximum 767px
Screen
*/
.container_24 .grid_13 {
width: 470px;
}
.container_24 .grid_14 {
width: 470px;
}
.container_24 .grid_15 {
width: 470px;
}
.container_24 .grid_16 {
width: 470px;
}
.container_24 .grid_17 {
width: 470px;
}
.container_24 .grid_18 {
width: 470px;
}
.container_24 .grid_19 {
width: 470px;
}
.container_24 .grid_20 {
width: 470px;
}
.container_24 .grid_21 {
width: 470px;
}
.container_24 .grid_22 {
width: 470px;
}
.container_24 .grid_23 {
width: 470px;
}
.container_24 .grid_24 {
width: 470px;
}
}
/* This query is applied for protait ipad, Mobile
*/
@media only screen and (max-width: 480px) {
.container_24 {
width: 290px;
}
/* Grid 1 to 24 columns are
Fixed in mobile layout
*/
.container_24 .grid_1, .container_24 .grid_2, .container_24 .grid_3, .container_24 .grid_4, .container_24 .grid_5, .container_24 .grid_6, .container_24 .grid_7, .container_24 .grid_8, .container_24 .grid_9, .container_24 .grid_10, .container_24 .grid_11, .container_24 .grid_12, .container_24 .grid_13, .container_24 .grid_14, .container_24 .grid_15, .container_24 .grid_16, .container_24 .grid_17, .container_24 .grid_18, .container_24 .grid_19, .container_24 .grid_20, .container_24 .grid_21, .container_24 .grid_22, .container_24 .grid_23, .container_24 .grid_24 {
width: 98%;
}
} |
package org.parallelzero.hancel.services;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import org.parallelzero.hancel.Config;
import java.util.Calendar;
public class <API key> extends BroadcastReceiver {
public static final String TAG = <API key>.class.getSimpleName();
private static final boolean DEBUG = Config.DEBUG;
@Override
public void onReceive(Context context, Intent intent) {
<API key>(context,Config.DEFAULT_INTERVAL);
}
public static void <API key>(Context context,long repeatTime){
if(DEBUG) Log.d(TAG, "<API key>:");
AlarmManager service = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, <API key>.class);
PendingIntent pending = PendingIntent.getBroadcast(context, 0, i, PendingIntent.FLAG_CANCEL_CURRENT);
Calendar cal = Calendar.getInstance();
// Start x seconds after boot completed
cal.add(Calendar.SECOND, Config.TIME_AFTER_START);
// Fetch every 30 seconds
// InexactRepeating allows Android to optimize the energy consumption
service.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), repeatTime, pending);
// service.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),
// REPEAT_TIME, pending);
}
public static void stopSheduleService(Context context){
if(DEBUG) Log.d(TAG, "stopSheduleService:");
AlarmManager service = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, <API key>.class);
PendingIntent pending = PendingIntent.getBroadcast(context, 0, i, PendingIntent.FLAG_CANCEL_CURRENT);
service.cancel(pending);
}
} |
.row { padding:15px 0 15px 0; border-bottom:1px dotted #dfdfdf; }
.row p { margin:0; padding:0; }
.row label { vertical-align:middle; }
.row p.note { font-size:11px; color:#777; clear:both; }
.row p.value { font-size:11px; color:#333; clear:both; }
.multicheckbox, .input_radio { float:left; margin:0 10px 10px 5px; width:130px; }
.element { width:245px; }
.calendar_img { margin-left:10px; width: 22px; }
.row textarea, input[type="text"] { padding:5px; width:auto; }
.row input[type="select"] { width:95%;}
.widefat td br { display:none; }
p.notes_spec { margin:0; padding:0; clear:both; display:block; }
h4 a.l_add_new { border-radius: 3px 3px 3px 3px; font-family: sans-serif; font-size: 12px; margin-left: 4px; font-weight:normal; padding: 3px 8px;
position: relative; text-decoration: none; top: -2px; background: #F1F1F1; }
h4 a.l_back { border-radius: 3px 3px 3px 3px; font-family: sans-serif; font-size: 12px; margin-left: 4px; font-weight:normal; padding: 3px 8px;
position: relative; text-decoration: none; top: 1px; background: #F1F1F1; float:right; }
.legend_section { padding:20px 0; }
.legend_section ul { margin:0; padding:0; }
.legend_section ul li { margin:0 0 8px 0; padding:0; }
.legend_section ul li img { float:left; margin-right:10px; }
#map_canvas { margin-top:20px; float: left !important; clear: both; }
#framework_wrap #content .option a { color:#21759B !important; }
#framework_wrap #content .option a:hover { color:#f60 !important; }
.cat_icon { float:left; display:inline; margin-right:5px; }
.wp-list-table .price{
color:#5CA01D !important;
font-weight:bold;
}
.form_last_days { margin:5px 0px;}
.form_daily_event { margin:5px 0px;}
#recurring_event { margin:5px 0px;}
.pt_metaboxes_table .b_submit { float:left; }
.inside p.row .seo_button { margin-left: 5px !important; }
.cal_input { width: 350px !important; }
.inside p.row .seo_button { margin-left: 0 !important; } |
#ifndef _REISER_FS_I
#define _REISER_FS_I
#include <linux/list.h>
struct <API key>;
typedef enum {
<API key> = 0x0001,
<API key> = 0x0002,
<API key> = 0x0004,
i_nopack_mask = 0x0008,
<API key> = 0x0010,
<API key> = 0x0020,
i_has_xattr_dir = 0x0040,
i_data_log = 0x0080,
i_ever_mapped = 0x0100
} <API key>;
struct reiserfs_inode_info {
__u32 i_key[4];
__u32 i_flags;
__u32 i_first_direct_byte;
__u32 i_attrs;
int i_prealloc_block;
int i_prealloc_count;
struct list_head i_prealloc_list;
unsigned <API key>:1;
unsigned int i_trans_id;
struct <API key> *i_jl;
struct mutex i_mmap;
#ifdef <API key>
struct rw_semaphore i_xattr_sem;
#endif
struct inode vfs_inode;
};
#endif |
/*
* DEFS: include file for hack programs.
*/
#include <stdinc.h>
#include <vectmath.h>
#include <assert.h>
/*
* GLOBAL: pseudo-keyword for storage class.
*/
#if !defined(global)
# define global extern
#endif
/*
* NODE: data common to BODY and CELL structures.
*/
typedef struct {
short type; /* code for node type */
real mass; /* total mass of node */
vector pos; /* position of node */
} node, *nodeptr;
#define Type(x) (((nodeptr) (x))->type)
#define Mass(x) (((nodeptr) (x))->mass)
#define Pos(x) (((nodeptr) (x))->pos)
/*
* BODY: data structure used to represent particles.
*/
#define BODY 01 /* type code for bodies */
typedef struct {
short type;
real mass; /* mass of body */
vector pos; /* position of body */
vector vel; /* velocity of body */
vector acc; /* acceleration of body */
real phi; /* potential at body */
} body, *bodyptr;
#define Body body
#define Vel(x) (((bodyptr) (x))->vel)
#define Acc(x) (((bodyptr) (x))->acc)
#define Phi(x) (((bodyptr) (x))->phi)
/*
* PHASEBODY: alternate definition introduced for I/O.
*/
typedef struct {
short type;
real mass;
vector phase[2]; /* position, velocity of body */
vector acc;
real phi;
} phasebody;
#define Phase(x) (((phasebody *) (x))->phase)
/*
* CELL: structure used to represent internal nodes of tree.
*/
#define CELL 02 /* type code for cells */
#define NSUB (1 << NDIM) /* subcells per cell */
typedef struct {
short type;
real mass; /* total mass of cell */
vector pos; /* cm. position of cell */
#ifdef QUADPOLE
matrix quad; /* quad. moment of cell */
#endif
nodeptr subp[NSUB]; /* descendents of cell */
} cell, *cellptr;
#ifdef QUADPOLE
#define Quad(x) (((cellptr) (x))->quad)
#endif
#define Subp(x) (((cellptr) (x))->subp)
/*
* int_hack
*/
typedef int int_hack;
/*
* ROOT: origin of tree; declared as nodeptr for tree with only 1 body.
*/
global nodeptr troot;
/*
* Integerized coordinates: used to mantain body-tree.
*/
global vector rmin; /* lower-left corner of coord. box */
global real rsize; /* side-length of int. coord. box */
#define IMAX (1 << (8 * sizeof(int) - 2)) /* highest bit */
/*
* Parameters and results for gravitational calculation.
*/
global real fcells; /* ratio of cells/bodies allocated */
global real tol; /* accuracy parameter: 0.0 => exact */
global real eps; /* potential softening parameter */
global int n2bterm; /* number 2-body of terms evaluated */
global int nbcterm; /* num of body-cell terms evaluated */
global bool debug; /* control debugging messages */
global bool Qdensity; /* output density or kth neighbor distance */ |
<?php
/**
* Helper functions for handling AJAX requests
*
* @since 1.0.0
* @package <API key>
* @subpackage <API key>/includes
* @author Yaron Guez <yaron@trestian.com>
*/
/**
* Ajax helper class
*/
class Um_Raf_Ajax {
/**
* Return response for WP ajax
*
* @param string $message Response message.
* @param bool $success Success type.
*/
public static function return_response( $message, $success ) {
wp_send_json(
array(
'success' => $success,
'message' => $message,
)
);
}
/**
* Return error response
*
* @param string $message Response message.
*/
public static function return_error( $message ) {
self::return_response( $message, false );
}
/**
* Return success response
*
* @param string $message Response message.
*/
public static function return_success( $message ) {
self::return_response( $message, true );
}
/**
* Internal helper function to deal with missing data
*
* @param string $field Field key.
* @param string $message Message string.
* @return mixed
*/
public static function check_missing_data( $field, $message ) {
if ( empty( $_POST[ $field ] ) ) { // @<API key>
self::return_error( $message );
} else {
return $_POST[ $field ]; // @<API key>
}
}
} |
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/cpu.h>
#include <linux/jiffies.h>
#include <linux/kernel_stat.h>
#include <linux/mutex.h>
#include <linux/hrtimer.h>
#include <linux/tick.h>
#include <linux/ktime.h>
#include <linux/sched.h>
#include <linux/input.h>
#include <linux/workqueue.h>
#include <linux/slab.h>
/*
* dbs is used in this file as a shortform for demandbased switching
* It helps to keep variable names smaller, simpler
*/
#define <API key> (10)
#define <API key> (80)
#define <API key> (1)
#define <API key> (100000)
#define <API key> (3)
#define <API key> (95)
#define <API key> (10000)
#define <API key> (11)
#define <API key> (100)
#define <API key> (1)
#define DBS_SYNC_FREQ (702000)
#define DBS_OPTIMAL_FREQ (1296000)
/*
* The polling frequency of this governor depends on the capability of
* the processor. Default polling frequency is 1000 times the transition
* latency of the processor. The governor will work on any processor with
* transition latency <= 10mS, using appropriate sampling
* rate.
* For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL)
* this governor will not work.
* All times here are in uS.
*/
#define <API key> (2)
static unsigned int min_sampling_rate;
#define LATENCY_MULTIPLIER (1000)
#define <API key> (20)
#define <API key> (10 * 1000 * 1000)
#define <API key> (1000)
#define <API key> (-1000)
static void do_dbs_timer(struct work_struct *work);
static int <API key>(struct cpufreq_policy *policy,
unsigned int event);
#ifndef <API key>
static
#endif
struct cpufreq_governor <API key> = {
.name = "ondemand",
.governor = <API key>,
.<API key> = <API key>,
.owner = THIS_MODULE,
};
/* Sampling types */
enum {DBS_NORMAL_SAMPLE, DBS_SUB_SAMPLE};
struct cpu_dbs_info_s {
cputime64_t prev_cpu_idle;
cputime64_t prev_cpu_iowait;
cputime64_t prev_cpu_wall;
cputime64_t prev_cpu_nice;
struct cpufreq_policy *cur_policy;
struct delayed_work work;
struct <API key> *freq_table;
unsigned int freq_lo;
unsigned int freq_lo_jiffies;
unsigned int freq_hi_jiffies;
unsigned int rate_mult;
unsigned int prev_load;
unsigned int max_load;
int cpu;
unsigned int sample_type:1;
/*
* percpu mutex that serializes governor limit change with
* do_dbs_timer invocation. We do not want do_dbs_timer to run
* when user is changing the governor or limits.
*/
struct mutex timer_mutex;
};
static DEFINE_PER_CPU(struct cpu_dbs_info_s, od_cpu_dbs_info);
static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info);
static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info);
static unsigned int dbs_enable; /* number of CPUs using this policy */
/*
* dbs_mutex protects dbs_enable and dbs_info during start/stop.
*/
static DEFINE_MUTEX(dbs_mutex);
static struct workqueue_struct *input_wq;
struct dbs_work_struct {
struct work_struct work;
unsigned int cpu;
};
static DEFINE_PER_CPU(struct dbs_work_struct, dbs_refresh_work);
static struct dbs_tuners {
unsigned int sampling_rate;
unsigned int up_threshold;
unsigned int <API key>;
unsigned int down_differential;
unsigned int <API key>;
unsigned int optimal_freq;
unsigned int <API key>;
unsigned int sync_freq;
unsigned int ignore_nice;
unsigned int <API key>;
int powersave_bias;
unsigned int io_is_busy;
} dbs_tuners_ins = {
.<API key> = <API key>,
.up_threshold = <API key>,
.<API key> = <API key>,
.down_differential = <API key>,
.<API key> = <API key>,
.<API key> = <API key>,
.ignore_nice = 0,
.powersave_bias = 0,
.sync_freq = DBS_SYNC_FREQ,
.optimal_freq = DBS_OPTIMAL_FREQ,
.sampling_rate = (<API key> * 5)
};
static inline u64 <API key>(unsigned int cpu, u64 *wall)
{
u64 idle_time;
u64 cur_wall_time;
u64 busy_time;
cur_wall_time = <API key>(get_jiffies_64());
busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER];
busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM];
busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_IRQ];
busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SOFTIRQ];
busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL];
busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE];
idle_time = cur_wall_time - busy_time;
if (wall)
*wall = jiffies_to_usecs(cur_wall_time);
return jiffies_to_usecs(idle_time);
}
static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
{
u64 idle_time = <API key>(cpu, NULL);
if (idle_time == -1ULL)
return <API key>(cpu, wall);
else
idle_time += <API key>(cpu, wall);
return idle_time;
}
static inline cputime64_t get_cpu_iowait_time(unsigned int cpu, cputime64_t *wall)
{
u64 iowait_time = <API key>(cpu, wall);
if (iowait_time == -1ULL)
return 0;
return iowait_time;
}
/*
* Find right freq to be set now with powersave_bias on.
* Returns the freq_hi to be used right now and will set freq_hi_jiffies,
* freq_lo, and freq_lo_jiffies in percpu area for averaging freqs.
*/
static unsigned int <API key>(struct cpufreq_policy *policy,
unsigned int freq_next,
unsigned int relation)
{
unsigned int freq_req, freq_avg;
unsigned int freq_hi, freq_lo;
unsigned int index = 0;
unsigned int jiffies_total, jiffies_hi, jiffies_lo;
int freq_reduc;
struct cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info,
policy->cpu);
if (!dbs_info->freq_table) {
dbs_info->freq_lo = 0;
dbs_info->freq_lo_jiffies = 0;
return freq_next;
}
<API key>(policy, dbs_info->freq_table, freq_next,
relation, &index);
freq_req = dbs_info->freq_table[index].frequency;
freq_reduc = freq_req * dbs_tuners_ins.powersave_bias / 1000;
freq_avg = freq_req - freq_reduc;
/* Find freq bounds for freq_avg in freq_table */
index = 0;
<API key>(policy, dbs_info->freq_table, freq_avg,
CPUFREQ_RELATION_H, &index);
freq_lo = dbs_info->freq_table[index].frequency;
index = 0;
<API key>(policy, dbs_info->freq_table, freq_avg,
CPUFREQ_RELATION_L, &index);
freq_hi = dbs_info->freq_table[index].frequency;
/* Find out how long we have to be in hi and lo freqs */
if (freq_hi == freq_lo) {
dbs_info->freq_lo = 0;
dbs_info->freq_lo_jiffies = 0;
return freq_lo;
}
jiffies_total = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
jiffies_hi = (freq_avg - freq_lo) * jiffies_total;
jiffies_hi += ((freq_hi - freq_lo) / 2);
jiffies_hi /= (freq_hi - freq_lo);
jiffies_lo = jiffies_total - jiffies_hi;
dbs_info->freq_lo = freq_lo;
dbs_info->freq_lo_jiffies = jiffies_lo;
dbs_info->freq_hi_jiffies = jiffies_hi;
return freq_hi;
}
static int <API key>(struct cpufreq_policy *policy,
struct cpufreq_policy *altpolicy,
int level)
{
if (level == <API key>) {
/* maximum powersave; set to lowest frequency */
<API key>(policy,
(altpolicy) ? altpolicy->min : policy->min,
CPUFREQ_RELATION_L);
return 1;
} else if (level == <API key>) {
/* minimum powersave; set to highest frequency */
<API key>(policy,
(altpolicy) ? altpolicy->max : policy->max,
CPUFREQ_RELATION_H);
return 1;
}
return 0;
}
static void <API key>(int cpu)
{
struct cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
dbs_info->freq_table = <API key>(cpu);
dbs_info->freq_lo = 0;
}
static void <API key>(void)
{
int i;
for_each_online_cpu(i) {
<API key>(i);
}
}
static ssize_t <API key>(struct kobject *kobj,
struct attribute *attr, char *buf)
{
return sprintf(buf, "%u\n", min_sampling_rate);
}
<API key>(sampling_rate_min);
/* cpufreq_ondemand Governor Tunables */
#define show_one(file_name, object) \
static ssize_t show_##file_name \
(struct kobject *kobj, struct attribute *attr, char *buf) \
{ \
return sprintf(buf, "%u\n", dbs_tuners_ins.object); \
}
show_one(sampling_rate, sampling_rate);
show_one(io_is_busy, io_is_busy);
show_one(up_threshold, up_threshold);
show_one(<API key>, <API key>);
show_one(down_differential, down_differential);
show_one(<API key>, <API key>);
show_one(ignore_nice_load, ignore_nice);
show_one(optimal_freq, optimal_freq);
show_one(<API key>, <API key>);
show_one(sync_freq, sync_freq);
static ssize_t show_powersave_bias
(struct kobject *kobj, struct attribute *attr, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", dbs_tuners_ins.powersave_bias);
}
/**
* <API key> - update sampling rate effective immediately if needed.
* @new_rate: new sampling rate
*
* If new rate is smaller than the old, simply updaing
* dbs_tuners_int.sampling_rate might not be appropriate. For example,
* if the original sampling_rate was 1 second and the requested new sampling
* rate is 10 ms because the user needs immediate reaction from ondemand
* governor, but not sure if higher frequency will be required or not,
* then, the governor may change the sampling rate too late; up to 1 second
* later. Thus, if we are reducing the sampling rate, we need to make the
* new value effective immediately.
*/
static void <API key>(unsigned int new_rate)
{
int cpu;
dbs_tuners_ins.sampling_rate = new_rate
= max(new_rate, min_sampling_rate);
for_each_online_cpu(cpu) {
struct cpufreq_policy *policy;
struct cpu_dbs_info_s *dbs_info;
unsigned long next_sampling, appointed_at;
policy = cpufreq_cpu_get(cpu);
if (!policy)
continue;
dbs_info = &per_cpu(od_cpu_dbs_info, policy->cpu);
cpufreq_cpu_put(policy);
mutex_lock(&dbs_info->timer_mutex);
if (!<API key>(&dbs_info->work)) {
mutex_unlock(&dbs_info->timer_mutex);
continue;
}
next_sampling = jiffies + usecs_to_jiffies(new_rate);
appointed_at = dbs_info->work.timer.expires;
if (time_before(next_sampling, appointed_at)) {
mutex_unlock(&dbs_info->timer_mutex);
<API key>(&dbs_info->work);
mutex_lock(&dbs_info->timer_mutex);
<API key>(dbs_info->cpu, &dbs_info->work,
usecs_to_jiffies(new_rate));
}
mutex_unlock(&dbs_info->timer_mutex);
}
}
static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
<API key>(input);
return count;
}
static ssize_t store_sync_freq(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
dbs_tuners_ins.sync_freq = input;
return count;
}
static ssize_t store_io_is_busy(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
dbs_tuners_ins.io_is_busy = !!input;
return count;
}
static ssize_t store_optimal_freq(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
dbs_tuners_ins.optimal_freq = input;
return count;
}
static ssize_t store_up_threshold(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1 || input > <API key> ||
input < <API key>) {
return -EINVAL;
}
dbs_tuners_ins.up_threshold = input;
return count;
}
static ssize_t <API key>(struct kobject *a,
struct attribute *b, const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1 || input > <API key> ||
input < <API key>) {
return -EINVAL;
}
dbs_tuners_ins.<API key> = input;
return count;
}
static ssize_t <API key>(struct kobject *a,
struct attribute *b, const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1 || input > <API key> ||
input < <API key>) {
return -EINVAL;
}
dbs_tuners_ins.<API key> = input;
return count;
}
static ssize_t <API key>(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1 || input >= dbs_tuners_ins.up_threshold ||
input < <API key>) {
return -EINVAL;
}
dbs_tuners_ins.down_differential = input;
return count;
}
static ssize_t <API key>(struct kobject *a,
struct attribute *b, const char *buf, size_t count)
{
unsigned int input, j;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1 || input > <API key> || input < 1)
return -EINVAL;
dbs_tuners_ins.<API key> = input;
/* Reset down sampling multiplier in case it was active */
for_each_online_cpu(j) {
struct cpu_dbs_info_s *dbs_info;
dbs_info = &per_cpu(od_cpu_dbs_info, j);
dbs_info->rate_mult = 1;
}
return count;
}
static ssize_t <API key>(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
unsigned int j;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
if (input > 1)
input = 1;
if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */
return count;
}
dbs_tuners_ins.ignore_nice = input;
/* we need to re-evaluate prev_cpu_idle */
for_each_online_cpu(j) {
struct cpu_dbs_info_s *dbs_info;
dbs_info = &per_cpu(od_cpu_dbs_info, j);
dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
&dbs_info->prev_cpu_wall);
if (dbs_tuners_ins.ignore_nice)
dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
}
return count;
}
static ssize_t <API key>(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
int input = 0;
int bypass = 0;
int ret, cpu, reenable_timer, j;
struct cpu_dbs_info_s *dbs_info;
struct cpumask cpus_timer_done;
cpumask_clear(&cpus_timer_done);
ret = sscanf(buf, "%d", &input);
if (ret != 1)
return -EINVAL;
if (input >= <API key>) {
input = <API key>;
bypass = 1;
} else if (input <= <API key>) {
input = <API key>;
bypass = 1;
}
if (input == dbs_tuners_ins.powersave_bias) {
/* no change */
return count;
}
reenable_timer = ((dbs_tuners_ins.powersave_bias ==
<API key>) ||
(dbs_tuners_ins.powersave_bias ==
<API key>));
dbs_tuners_ins.powersave_bias = input;
mutex_lock(&dbs_mutex);
get_online_cpus();
if (!bypass) {
if (reenable_timer) {
/* reinstate dbs timer */
for_each_online_cpu(cpu) {
if (<API key>(cpu) < 0)
continue;
dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
for_each_cpu(j, &cpus_timer_done) {
if (!dbs_info->cur_policy) {
pr_err("Dbs policy is NULL\n");
goto skip_this_cpu;
}
if (cpumask_test_cpu(j, dbs_info->
cur_policy->cpus))
goto skip_this_cpu;
}
cpumask_set_cpu(cpu, &cpus_timer_done);
if (dbs_info->cur_policy) {
/* restart dbs timer */
dbs_timer_init(dbs_info);
}
skip_this_cpu:
<API key>(cpu);
}
}
<API key>();
} else {
/* running at maximum or minimum frequencies; cancel
dbs timer as periodic load sampling is not necessary */
for_each_online_cpu(cpu) {
if (<API key>(cpu) < 0)
continue;
dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
for_each_cpu(j, &cpus_timer_done) {
if (!dbs_info->cur_policy) {
pr_err("Dbs policy is NULL\n");
goto <API key>;
}
if (cpumask_test_cpu(j, dbs_info->
cur_policy->cpus))
goto <API key>;
}
cpumask_set_cpu(cpu, &cpus_timer_done);
if (dbs_info->cur_policy) {
/* cpu using ondemand, cancel dbs timer */
mutex_lock(&dbs_info->timer_mutex);
dbs_timer_exit(dbs_info);
<API key>(
dbs_info->cur_policy,
NULL,
input);
mutex_unlock(&dbs_info->timer_mutex);
}
<API key>:
<API key>(cpu);
}
}
put_online_cpus();
mutex_unlock(&dbs_mutex);
return count;
}
<API key>(sampling_rate);
<API key>(io_is_busy);
<API key>(up_threshold);
<API key>(down_differential);
<API key>(<API key>);
<API key>(ignore_nice_load);
<API key>(powersave_bias);
<API key>(<API key>);
<API key>(optimal_freq);
<API key>(<API key>);
<API key>(sync_freq);
static struct attribute *dbs_attributes[] = {
&sampling_rate_min.attr,
&sampling_rate.attr,
&up_threshold.attr,
&down_differential.attr,
&<API key>.attr,
&ignore_nice_load.attr,
&powersave_bias.attr,
&io_is_busy.attr,
&<API key>.attr,
&optimal_freq.attr,
&<API key>.attr,
&sync_freq.attr,
NULL
};
static struct attribute_group dbs_attr_group = {
.attrs = dbs_attributes,
.name = "ondemand",
};
static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq)
{
if (dbs_tuners_ins.powersave_bias)
freq = <API key>(p, freq, CPUFREQ_RELATION_H);
else if (p->cur == p->max)
return;
<API key>(p, freq, dbs_tuners_ins.powersave_bias ?
CPUFREQ_RELATION_L : CPUFREQ_RELATION_H);
}
static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
{
/* Extrapolated load of this CPU */
unsigned int load_at_max_freq = 0;
unsigned int max_load_freq;
/* Current load across this CPU */
unsigned int cur_load = 0;
unsigned int max_load_other_cpu = 0;
struct cpufreq_policy *policy;
unsigned int j;
this_dbs_info->freq_lo = 0;
policy = this_dbs_info->cur_policy;
/*
* Every sampling_rate, we check, if current idle time is less
* than 20% (default), then we try to increase frequency
* Every sampling_rate, we look for a the lowest
* frequency which can sustain the load while keeping idle time over
* 30%. If such a frequency exist, we try to decrease to this frequency.
*
* Any frequency increase takes it to the maximum frequency.
* Frequency reduction happens at minimum steps of
* 5% (default) of current frequency
*/
/* Get Absolute Load - in terms of freq */
max_load_freq = 0;
for_each_cpu(j, policy->cpus) {
struct cpu_dbs_info_s *j_dbs_info;
cputime64_t cur_wall_time, cur_idle_time, cur_iowait_time;
unsigned int idle_time, wall_time, iowait_time;
unsigned int load_freq;
int freq_avg;
j_dbs_info = &per_cpu(od_cpu_dbs_info, j);
cur_idle_time = get_cpu_idle_time(j, &cur_wall_time);
cur_iowait_time = get_cpu_iowait_time(j, &cur_wall_time);
wall_time = (unsigned int)
(cur_wall_time - j_dbs_info->prev_cpu_wall);
j_dbs_info->prev_cpu_wall = cur_wall_time;
idle_time = (unsigned int)
(cur_idle_time - j_dbs_info->prev_cpu_idle);
j_dbs_info->prev_cpu_idle = cur_idle_time;
iowait_time = (unsigned int)
(cur_iowait_time - j_dbs_info->prev_cpu_iowait);
j_dbs_info->prev_cpu_iowait = cur_iowait_time;
if (dbs_tuners_ins.ignore_nice) {
u64 cur_nice;
unsigned long cur_nice_jiffies;
cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE] -
j_dbs_info->prev_cpu_nice;
/*
* Assumption: nice time between sampling periods will
* be less than 2^32 jiffies for 32 bit sys
*/
cur_nice_jiffies = (unsigned long)
<API key>(cur_nice);
j_dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
idle_time += jiffies_to_usecs(cur_nice_jiffies);
}
/*
* For the purpose of ondemand, waiting for disk IO is an
* indication that you're performance critical, and not that
* the system is actually idle. So subtract the iowait time
* from the cpu idle time.
*/
if (dbs_tuners_ins.io_is_busy && idle_time >= iowait_time)
idle_time -= iowait_time;
if (unlikely(!wall_time || wall_time < idle_time))
continue;
cur_load = 100 * (wall_time - idle_time) / wall_time;
j_dbs_info->max_load = max(cur_load, j_dbs_info->prev_load);
j_dbs_info->prev_load = cur_load;
freq_avg = <API key>(policy, j);
if (freq_avg <= 0)
freq_avg = policy->cur;
load_freq = cur_load * freq_avg;
if (load_freq > max_load_freq)
max_load_freq = load_freq;
}
for_each_online_cpu(j) {
struct cpu_dbs_info_s *j_dbs_info;
j_dbs_info = &per_cpu(od_cpu_dbs_info, j);
if (j == policy->cpu)
continue;
if (max_load_other_cpu < j_dbs_info->max_load)
max_load_other_cpu = j_dbs_info->max_load;
/*
* The other cpu could be running at higher frequency
* but may not have completed it's <API key>.
* For that case consider other cpu is loaded so that
* frequency imbalance does not occur.
*/
if ((j_dbs_info->cur_policy != NULL)
&& (j_dbs_info->cur_policy->cur ==
j_dbs_info->cur_policy->max)) {
if (policy->cur >= dbs_tuners_ins.optimal_freq)
max_load_other_cpu =
dbs_tuners_ins.<API key>;
}
}
/* calculate the scaled load across CPU */
load_at_max_freq = (cur_load * policy->cur)/policy->cpuinfo.max_freq;
<API key>(policy, load_at_max_freq);
/* Check for frequency increase */
if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) {
/* If switching to max speed, apply <API key> */
if (policy->cur < policy->max)
this_dbs_info->rate_mult =
dbs_tuners_ins.<API key>;
dbs_freq_increase(policy, policy->max);
return;
}
if (num_online_cpus() > 1) {
if (max_load_other_cpu >
dbs_tuners_ins.<API key>) {
if (policy->cur < dbs_tuners_ins.sync_freq)
dbs_freq_increase(policy,
dbs_tuners_ins.sync_freq);
return;
}
if (max_load_freq > dbs_tuners_ins.<API key> *
policy->cur) {
if (policy->cur < dbs_tuners_ins.optimal_freq)
dbs_freq_increase(policy,
dbs_tuners_ins.optimal_freq);
return;
}
}
/* Check for frequency decrease */
/* if we cannot reduce the frequency anymore, break out early */
if (policy->cur == policy->min)
return;
/*
* The optimal frequency is the frequency that is the lowest that
* can support the current CPU usage without triggering the up
* policy. To be safe, we focus 10 points under the threshold.
*/
if (max_load_freq <
(dbs_tuners_ins.up_threshold - dbs_tuners_ins.down_differential) *
policy->cur) {
unsigned int freq_next;
freq_next = max_load_freq /
(dbs_tuners_ins.up_threshold -
dbs_tuners_ins.down_differential);
/* No longer fully busy, reset rate_mult */
this_dbs_info->rate_mult = 1;
if (freq_next < policy->min)
freq_next = policy->min;
if (num_online_cpus() > 1) {
if (max_load_other_cpu >
(dbs_tuners_ins.<API key> -
dbs_tuners_ins.down_differential) &&
freq_next < dbs_tuners_ins.sync_freq)
freq_next = dbs_tuners_ins.sync_freq;
if (max_load_freq >
((dbs_tuners_ins.<API key> -
dbs_tuners_ins.<API key>) *
policy->cur) &&
freq_next < dbs_tuners_ins.optimal_freq)
freq_next = dbs_tuners_ins.optimal_freq;
}
if (!dbs_tuners_ins.powersave_bias) {
<API key>(policy, freq_next,
CPUFREQ_RELATION_L);
} else {
int freq = <API key>(policy, freq_next,
CPUFREQ_RELATION_L);
<API key>(policy, freq,
CPUFREQ_RELATION_L);
}
}
}
static void do_dbs_timer(struct work_struct *work)
{
struct cpu_dbs_info_s *dbs_info =
container_of(work, struct cpu_dbs_info_s, work.work);
unsigned int cpu = dbs_info->cpu;
int sample_type = dbs_info->sample_type;
int delay;
mutex_lock(&dbs_info->timer_mutex);
/* Common NORMAL_SAMPLE setup */
dbs_info->sample_type = DBS_NORMAL_SAMPLE;
if (!dbs_tuners_ins.powersave_bias ||
sample_type == DBS_NORMAL_SAMPLE) {
dbs_check_cpu(dbs_info);
if (dbs_info->freq_lo) {
/* Setup timer for SUB_SAMPLE */
dbs_info->sample_type = DBS_SUB_SAMPLE;
delay = dbs_info->freq_hi_jiffies;
} else {
/* We want all CPUs to do sampling nearly on
* same jiffy
*/
delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
* dbs_info->rate_mult);
if (num_online_cpus() > 1)
delay -= jiffies % delay;
}
} else {
<API key>(dbs_info->cur_policy,
dbs_info->freq_lo, CPUFREQ_RELATION_H);
delay = dbs_info->freq_lo_jiffies;
}
<API key>(cpu, &dbs_info->work, delay);
mutex_unlock(&dbs_info->timer_mutex);
}
static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
{
/* We want all CPUs to do sampling nearly on same jiffy */
int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
if (num_online_cpus() > 1)
delay -= jiffies % delay;
dbs_info->sample_type = DBS_NORMAL_SAMPLE;
<API key>(&dbs_info->work, do_dbs_timer);
<API key>(dbs_info->cpu, &dbs_info->work, delay);
}
static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
{
<API key>(&dbs_info->work);
}
/*
* Not all CPUs want IO time to be accounted as busy; this dependson how
* efficient idling at a higher frequency/voltage is.
* Pavel Machek says this is not so for various generations of AMD and old
* Intel systems.
* Mike Chan (androidlcom) calis this is also not true for ARM.
* Because of this, whitelist specific known (series) of CPUs by default, and
* leave all others up to the user.
*/
static int should_io_be_busy(void)
{
#if defined(CONFIG_X86)
/*
* For Intel, Core 2 (model 15) andl later have an efficient idle.
*/
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
boot_cpu_data.x86 == 6 &&
boot_cpu_data.x86_model >= 15)
return 1;
#endif
return 0;
}
static void <API key>(struct work_struct *work)
{
struct cpufreq_policy *policy;
struct cpu_dbs_info_s *this_dbs_info;
struct dbs_work_struct *dbs_work;
unsigned int cpu;
dbs_work = container_of(work, struct dbs_work_struct, work);
cpu = dbs_work->cpu;
get_online_cpus();
if (<API key>(cpu) < 0)
goto <API key>;
this_dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
policy = this_dbs_info->cur_policy;
if (!policy) {
/* CPU not using ondemand governor */
goto <API key>;
}
if (policy->cur < policy->max) {
/*
* Arch specific cpufreq driver may fail.
* Don't update governor frequency upon failure.
*/
if (<API key>(policy, policy->max,
CPUFREQ_RELATION_L) >= 0)
policy->cur = policy->max;
this_dbs_info->prev_cpu_idle = get_cpu_idle_time(cpu,
&this_dbs_info->prev_cpu_wall);
}
<API key>:
<API key>(cpu);
<API key>:
put_online_cpus();
return;
}
static void dbs_input_event(struct input_handle *handle, unsigned int type,
unsigned int code, int value)
{
int i;
if ((dbs_tuners_ins.powersave_bias == <API key>) ||
(dbs_tuners_ins.powersave_bias == <API key>)) {
/* nothing to do */
return;
}
for_each_online_cpu(i)
queue_work_on(i, input_wq, &per_cpu(dbs_refresh_work, i).work);
}
static int dbs_input_connect(struct input_handler *handler,
struct input_dev *dev, const struct input_device_id *id)
{
struct input_handle *handle;
int error;
handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
if (!handle)
return -ENOMEM;
handle->dev = dev;
handle->handler = handler;
handle->name = "cpufreq";
error = <API key>(handle);
if (error)
goto err2;
error = input_open_device(handle);
if (error)
goto err1;
return 0;
err1:
<API key>(handle);
err2:
kfree(handle);
return error;
}
static void <API key>(struct input_handle *handle)
{
input_close_device(handle);
<API key>(handle);
kfree(handle);
}
static const struct input_device_id dbs_ids[] = {
{ .driver_info = 1 },
{ },
};
static struct input_handler dbs_input_handler = {
.event = dbs_input_event,
.connect = dbs_input_connect,
.disconnect = <API key>,
.name = "cpufreq_ond",
.id_table = dbs_ids,
};
static int <API key>(struct cpufreq_policy *policy,
unsigned int event)
{
unsigned int cpu = policy->cpu;
struct cpu_dbs_info_s *this_dbs_info;
unsigned int j;
int rc;
this_dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
switch (event) {
case CPUFREQ_GOV_START:
if ((!cpu_online(cpu)) || (!policy->cur))
return -EINVAL;
mutex_lock(&dbs_mutex);
dbs_enable++;
for_each_cpu(j, policy->cpus) {
struct cpu_dbs_info_s *j_dbs_info;
j_dbs_info = &per_cpu(od_cpu_dbs_info, j);
j_dbs_info->cur_policy = policy;
j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
&j_dbs_info->prev_cpu_wall);
if (dbs_tuners_ins.ignore_nice)
j_dbs_info->prev_cpu_nice =
kcpustat_cpu(j).cpustat[CPUTIME_NICE];
}
this_dbs_info->cpu = cpu;
this_dbs_info->rate_mult = 1;
<API key>(cpu);
/*
* Start the timerschedule work, when this governor
* is used for first time
*/
if (dbs_enable == 1) {
unsigned int latency;
rc = sysfs_create_group(<API key>,
&dbs_attr_group);
if (rc) {
mutex_unlock(&dbs_mutex);
return rc;
}
/* policy latency is in nS. Convert it to uS first */
latency = policy->cpuinfo.transition_latency / 1000;
if (latency == 0)
latency = 1;
/* Bring kernel and HW constraints together */
min_sampling_rate = max(min_sampling_rate,
<API key> * latency);
dbs_tuners_ins.sampling_rate =
max(min_sampling_rate,
latency * LATENCY_MULTIPLIER);
dbs_tuners_ins.io_is_busy = should_io_be_busy();
if (dbs_tuners_ins.optimal_freq == 0)
dbs_tuners_ins.optimal_freq = policy->min;
if (dbs_tuners_ins.sync_freq == 0)
dbs_tuners_ins.sync_freq = policy->min;
}
if (!cpu)
rc = <API key>(&dbs_input_handler);
mutex_unlock(&dbs_mutex);
if (!<API key>(
this_dbs_info->cur_policy,
NULL,
dbs_tuners_ins.powersave_bias))
dbs_timer_init(this_dbs_info);
break;
case CPUFREQ_GOV_STOP:
dbs_timer_exit(this_dbs_info);
mutex_lock(&dbs_mutex);
dbs_enable
/* If device is being removed, policy is no longer
* valid. */
this_dbs_info->cur_policy = NULL;
if (!cpu)
<API key>(&dbs_input_handler);
if (!dbs_enable)
sysfs_remove_group(<API key>,
&dbs_attr_group);
mutex_unlock(&dbs_mutex);
break;
case CPUFREQ_GOV_LIMITS:
mutex_lock(&this_dbs_info->timer_mutex);
if (policy->max < this_dbs_info->cur_policy->cur)
<API key>(this_dbs_info->cur_policy,
policy->max, CPUFREQ_RELATION_H);
else if (policy->min > this_dbs_info->cur_policy->cur)
<API key>(this_dbs_info->cur_policy,
policy->min, CPUFREQ_RELATION_L);
else if (dbs_tuners_ins.powersave_bias != 0)
<API key>(
this_dbs_info->cur_policy,
policy,
dbs_tuners_ins.powersave_bias);
mutex_unlock(&this_dbs_info->timer_mutex);
break;
}
return 0;
}
static int __init <API key>(void)
{
u64 idle_time;
unsigned int i;
int cpu = get_cpu();
idle_time = <API key>(cpu, NULL);
put_cpu();
if (idle_time != -1ULL) {
/* Idle micro accounting is supported. Use finer thresholds */
dbs_tuners_ins.up_threshold = <API key>;
dbs_tuners_ins.down_differential =
<API key>;
/*
* In nohz/micro accounting case we set the minimum frequency
* not depending on HZ, but fixed (very low). The deferred
* timer might skip some samples if idle/sleeping as needed.
*/
min_sampling_rate = <API key>;
} else {
/* For correct statistics, we need 10 ticks for each measure */
min_sampling_rate =
<API key> * jiffies_to_usecs(10);
}
input_wq = create_workqueue("iewq");
if (!input_wq) {
printk(KERN_ERR "Failed to create iewq workqueue\n");
return -EFAULT;
}
<API key>(i) {
struct cpu_dbs_info_s *this_dbs_info =
&per_cpu(od_cpu_dbs_info, i);
struct dbs_work_struct *dbs_work =
&per_cpu(dbs_refresh_work, i);
mutex_init(&this_dbs_info->timer_mutex);
INIT_WORK(&dbs_work->work, <API key>);
dbs_work->cpu = i;
}
return <API key>(&<API key>);
}
static void __exit <API key>(void)
{
unsigned int i;
<API key>(&<API key>);
<API key>(i) {
struct cpu_dbs_info_s *this_dbs_info =
&per_cpu(od_cpu_dbs_info, i);
mutex_destroy(&this_dbs_info->timer_mutex);
}
destroy_workqueue(input_wq);
}
MODULE_AUTHOR("Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>");
MODULE_AUTHOR("Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>");
MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
"Low Latency Frequency Transition capable processors");
MODULE_LICENSE("GPL");
#ifdef <API key>
fs_initcall(<API key>);
#else
module_init(<API key>);
#endif
module_exit(<API key>); |
#!/bin/bash
set -e
IMAGES=$1
ISO=${IMAGES}/iso
mkdir -p ${ISO}/boot
cp ${IMAGES}/bzImage ${ISO}/boot/bzImage
ROOTFS=/tmp/root
mkdir -p ${ROOTFS}
tar xJf ${IMAGES}/rootfs.tar.xz -C ${ROOTFS}
cd ${ROOTFS}
find | cpio -H newc -o | xz -9 -C crc32 -c > ${ISO}/boot/initrd
mkdir -p ${ISO}/boot/isolinux
cp /usr/lib/syslinux/isolinux.bin ${ISO}/boot/isolinux/
cp /usr/lib/syslinux/linux.c32 ${ISO}/boot/isolinux/ldlinux.c32
cp /build/configs/isolinux.cfg ${ISO}/boot/isolinux/
# Make an ISO
cd ${ISO}
xorriso \
-publisher "A.I. <ailis@paw.zone>" \
-as mkisofs \
-l -J -R -V "DOCKER_ROOT" \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
-no-pad -o ${IMAGES}/docker-root.iso $(pwd)
# Make a bootable disk image
IMAGE=${IMAGES}/docker-root.img
DISK=${IMAGES}/disk
ISO=${IMAGES}/ISO
mkdir -p ${ISO}
losetup /dev/loop0 ${IMAGES}/docker-root.iso
mount /dev/loop0 ${ISO}
SIZE=$(du -s ${ISO} | awk '{print $1}')
dd if=/dev/zero of=${IMAGE} bs=1024 count=$((${SIZE}+66+${SIZE}%2))
losetup /dev/loop1 ${IMAGE}
(echo c; echo n; echo p; echo 1; echo; echo; echo t; echo 4; echo a; echo 1; echo w;) | fdisk /dev/loop1 || true
losetup -o 32256 /dev/loop2 ${IMAGE}
mkfs -t vfat -F 16 /dev/loop2
mkdir -p ${DISK}
mount -t vfat /dev/loop2 ${DISK}
mkdir -p ${DISK}/boot/syslinux
cp ${ISO}/boot/bzImage ${DISK}/boot/
cp ${ISO}/boot/initrd ${DISK}/boot/
cp ${ISO}/boot/isolinux/isolinux.cfg ${DISK}/boot/syslinux/syslinux.cfg
umount ${ISO}
umount ${DISK}
syslinux -i -d /boot/syslinux /dev/loop2
losetup -d /dev/loop2
dd if=/usr/lib/syslinux/mbr.bin of=/dev/loop1 bs=440 count=1
losetup -d /dev/loop1
losetup -d /dev/loop0 |
#include "qgsproviderregistry.h"
#include <QString>
#include <QDir>
#include <QLibrary>
#include "qgis.h"
#include "qgsdataprovider.h"
#include "qgslogger.h"
#include "qgsmessageoutput.h"
#include "qgsmessagelog.h"
#include "qgsprovidermetadata.h"
#include "qgsvectorlayer.h"
#include "qgsproject.h"
#include "providers/memory/qgsmemoryprovider.h"
// typedefs for provider plugin functions of interest
typedef QString providerkey_t();
typedef QString description_t();
typedef bool isprovider_t();
typedef QString fileVectorFilters_t();
typedef void <API key>( QString &fileFiltersString );
typedef QString databaseDrivers_t();
typedef QString directoryDrivers_t();
typedef QString protocolDrivers_t();
//typedef int dataCapabilities_t();
//typedef QgsDataItem * dataItem_t(QString);
QgsProviderRegistry *QgsProviderRegistry::instance( const QString &pluginPath )
{
static QgsProviderRegistry *sInstance( new QgsProviderRegistry( pluginPath ) );
return sInstance;
} // QgsProviderRegistry::instance
QgsProviderRegistry::QgsProviderRegistry( const QString &pluginPath )
{
// At startup, examine the libs in the qgis/lib dir and store those that
// are a provider shared lib
// check all libs in the current plugin directory and get name and descriptions
//TODO figure out how to register and identify data source plugin for a specific
//TODO layer type
#if 0
char **argv = qApp->argv();
QString appDir = argv[0];
int bin = appDir.findRev( "/bin", -1, false );
QString baseDir = appDir.left( bin );
QString mLibraryDirectory = baseDir + "/lib";
#endif
mLibraryDirectory = pluginPath;
init();
}
void QgsProviderRegistry::init()
{
// add standard providers
mProviders[ QgsMemoryProvider::providerKey() ] = new QgsProviderMetadata( QgsMemoryProvider::providerKey(), QgsMemoryProvider::providerDescription(), &QgsMemoryProvider::createProvider );
mLibraryDirectory.setSorting( QDir::Name | QDir::IgnoreCase );
mLibraryDirectory.setFilter( QDir::Files | QDir::NoSymLinks );
#if defined(Q_OS_WIN) || defined(__CYGWIN__)
mLibraryDirectory.setNameFilters( QStringList( "*.dll" ) );
#elif defined(ANDROID)
mLibraryDirectory.setNameFilters( QStringList( "*provider.so" ) );
#else
mLibraryDirectory.setNameFilters( QStringList( QStringLiteral( "*.so" ) ) );
#endif
QgsDebugMsg( QString( "Checking %1 for provider plugins" ).arg( mLibraryDirectory.path() ) );
if ( mLibraryDirectory.count() == 0 )
{
QString msg = QObject::tr( "No QGIS data provider plugins found in:\n%1\n" ).arg( mLibraryDirectory.path() );
msg += QObject::tr( "No vector layers can be loaded. Check your QGIS installation" );
QgsMessageOutput *output = QgsMessageOutput::createMessageOutput();
output->setTitle( QObject::tr( "No Data Providers" ) );
output->setMessage( msg, QgsMessageOutput::MessageText );
output->showMessage();
return;
}
// provider file regex pattern, only files matching the pattern are loaded if the variable is defined
QString filePattern = getenv( "QGIS_PROVIDER_FILE" );
QRegExp fileRegexp;
if ( !filePattern.isEmpty() )
{
fileRegexp.setPattern( filePattern );
}
Q_FOREACH ( const QFileInfo &fi, mLibraryDirectory.entryInfoList() )
{
if ( !fileRegexp.isEmpty() )
{
if ( fileRegexp.indexIn( fi.fileName() ) == -1 )
{
QgsDebugMsg( "provider " + fi.fileName() + " skipped because doesn't match pattern " + filePattern );
continue;
}
}
QLibrary myLib( fi.filePath() );
if ( !myLib.load() )
{
QgsDebugMsg( QString( "Checking %1: ...invalid (lib not loadable): %2" ).arg( myLib.fileName(), myLib.errorString() ) );
continue;
}
//MH: Added a further test to detect non-provider plugins linked to provider plugins.
//Only pure provider plugins have 'type' not defined
isprovider_t *hasType = reinterpret_cast< isprovider_t * >( cast_to_fptr( myLib.resolve( "type" ) ) );
if ( hasType )
{
QgsDebugMsg( QString( "Checking %1: ...invalid (has type method)" ).arg( myLib.fileName() ) );
continue;
}
// get the description and the key for the provider plugin
isprovider_t *isProvider = reinterpret_cast< isprovider_t * >( cast_to_fptr( myLib.resolve( "isProvider" ) ) );
if ( !isProvider )
{
QgsDebugMsg( QString( "Checking %1: ...invalid (no isProvider method)" ).arg( myLib.fileName() ) );
continue;
}
// check to see if this is a provider plugin
if ( !isProvider() )
{
QgsDebugMsg( QString( "Checking %1: ...invalid (not a provider)" ).arg( myLib.fileName() ) );
continue;
}
// looks like a provider. get the key and description
description_t *pDesc = reinterpret_cast< description_t * >( cast_to_fptr( myLib.resolve( "description" ) ) );
if ( !pDesc )
{
QgsDebugMsg( QString( "Checking %1: ...invalid (no description method)" ).arg( myLib.fileName() ) );
continue;
}
providerkey_t *pKey = reinterpret_cast< providerkey_t * >( cast_to_fptr( myLib.resolve( "providerKey" ) ) );
if ( !pKey )
{
QgsDebugMsg( QString( "Checking %1: ...invalid (no providerKey method)" ).arg( myLib.fileName() ) );
continue;
}
// add this provider to the provider map
mProviders[pKey()] = new QgsProviderMetadata( pKey(), pDesc(), myLib.fileName() );
// load database drivers
databaseDrivers_t *pDatabaseDrivers = reinterpret_cast< databaseDrivers_t * >( cast_to_fptr( myLib.resolve( "databaseDrivers" ) ) );
if ( pDatabaseDrivers )
{
mDatabaseDrivers = pDatabaseDrivers();
}
// load directory drivers
directoryDrivers_t *pDirectoryDrivers = reinterpret_cast< directoryDrivers_t * >( cast_to_fptr( myLib.resolve( "directoryDrivers" ) ) );
if ( pDirectoryDrivers )
{
mDirectoryDrivers = pDirectoryDrivers();
}
// load protocol drivers
protocolDrivers_t *pProtocolDrivers = reinterpret_cast< protocolDrivers_t * >( cast_to_fptr( myLib.resolve( "protocolDrivers" ) ) );
if ( pProtocolDrivers )
{
mProtocolDrivers = pProtocolDrivers();
}
// now get vector file filters, if any
fileVectorFilters_t *pFileVectorFilters = reinterpret_cast< fileVectorFilters_t * >( cast_to_fptr( myLib.resolve( "fileVectorFilters" ) ) );
if ( pFileVectorFilters )
{
QString fileVectorFilters = pFileVectorFilters();
if ( !fileVectorFilters.isEmpty() )
mVectorFileFilters += fileVectorFilters;
QgsDebugMsg( QString( "Checking %1: ...loaded ok (%2 file filters)" ).arg( myLib.fileName() ).arg( fileVectorFilters.split( ";;" ).count() ) );
}
// now get raster file filters, if any
// this replaces deprecated QgsRasterLayer::<API key>
<API key> *pBuild =
reinterpret_cast< <API key> * >( cast_to_fptr( myLib.resolve( "<API key>" ) ) );
if ( pBuild )
{
QString fileRasterFilters;
pBuild( fileRasterFilters );
QgsDebugMsg( "raster filters: " + fileRasterFilters );
if ( !fileRasterFilters.isEmpty() )
mRasterFileFilters += fileRasterFilters;
QgsDebugMsg( QString( "Checking %1: ...loaded ok (%2 file filters)" ).arg( myLib.fileName() ).arg( fileRasterFilters.split( ";;" ).count() ) );
}
}
} // QgsProviderRegistry ctor
// typedef for the unload dataprovider function
typedef void <API key>();
void QgsProviderRegistry::clean()
{
QgsProject::instance()->removeAllMapLayers();
Providers::const_iterator it = mProviders.begin();
while ( it != mProviders.end() )
{
QgsDebugMsg( QString( "cleanup:%1" ).arg( it->first ) );
QString lib = it->second->library();
if ( !lib.isEmpty() )
{
QLibrary myLib( lib );
if ( myLib.isLoaded() )
{
<API key> *cleanupFunc = reinterpret_cast< <API key> * >( cast_to_fptr( myLib.resolve( "cleanupProvider" ) ) );
if ( cleanupFunc )
cleanupFunc();
}
}
delete it->second;
++it;
}
mProviders.clear();
}
QgsProviderRegistry::~QgsProviderRegistry()
{
clean();
}
/** Convenience function for finding any existing data providers that match "providerKey"
Necessary because [] map operator will create a QgsProviderMetadata
instance. Also you cannot use the map [] operator in const members for that
very reason. So there needs to be a convenient way to find a data provider
without accidentally adding a null meta data item to the metadata map.
*/
static
QgsProviderMetadata *findMetadata_( QgsProviderRegistry::Providers const &metaData,
QString const &providerKey )
{
QgsProviderRegistry::Providers::const_iterator i =
metaData.find( providerKey );
if ( i != metaData.end() )
{
return i->second;
}
return nullptr;
} // findMetadata_
QString QgsProviderRegistry::library( QString const &providerKey ) const
{
QgsProviderMetadata *md = findMetadata_( mProviders, providerKey );
if ( md )
{
return md->library();
}
return QString();
}
QString QgsProviderRegistry::pluginList( bool asHTML ) const
{
Providers::const_iterator it = mProviders.begin();
if ( mProviders.empty() )
return QObject::tr( "No data provider plugins are available. No vector layers can be loaded" );
QString list;
if ( asHTML )
list += QLatin1String( "<ol>" );
while ( it != mProviders.end() )
{
if ( asHTML )
list += QLatin1String( "<li>" );
list += it->second->description();
if ( asHTML )
list += "<br></li>";
else
list += '\n';
++it;
}
if ( asHTML )
list += QLatin1String( "</ol>" );
return list;
}
void QgsProviderRegistry::setLibraryDirectory( QDir const &path )
{
mLibraryDirectory = path;
clean();
init();
}
QDir QgsProviderRegistry::libraryDirectory() const
{
return mLibraryDirectory;
}
// typedef for the QgsDataProvider class factory
typedef QgsDataProvider *<API key>( const QString * );
/* Copied from QgsVectorLayer::setDataProvider
* TODO: Make it work in the generic environment
*
* TODO: Is this class really the best place to put a data provider loader?
* It seems more sensible to provide the code in one place rather than
* in qgsrasterlayer, qgsvectorlayer, serversourceselect, etc.
*/
QgsDataProvider *QgsProviderRegistry::createProvider( QString const &providerKey, QString const &dataSource )
{
// XXX should I check for and possibly delete any pre-existing providers?
// XXX How often will that scenario occur?
const QgsProviderMetadata *metadata = providerMetadata( providerKey );
if ( !metadata )
{
QgsMessageLog::logMessage( QObject::tr( "Invalid data provider %1" ).arg( providerKey ) );
return nullptr;
}
if ( metadata->createFunction() )
{
return metadata->createFunction()( dataSource );
}
// load the plugin
QString lib = library( providerKey );
#ifdef TESTPROVIDERLIB
const char *cLib = lib.toUtf8();
// test code to help debug provider loading problems
// void *handle = dlopen(cLib, RTLD_LAZY);
void *handle = dlopen( cOgrLib, RTLD_LAZY | RTLD_GLOBAL );
if ( !handle )
{
QgsLogger::warning( "Error in dlopen" );
}
else
{
QgsDebugMsg( "dlopen succeeded" );
dlclose( handle );
}
#endif
// load the data provider
QLibrary myLib( lib );
QgsDebugMsg( "Library name is " + myLib.fileName() );
if ( !myLib.load() )
{
QgsMessageLog::logMessage( QObject::tr( "Failed to load %1: %2" ).arg( lib, myLib.errorString() ) );
return nullptr;
}
<API key> *classFactory = reinterpret_cast< <API key> * >( cast_to_fptr( myLib.resolve( "classFactory" ) ) );
if ( !classFactory )
{
QgsDebugMsg( QString( "Failed to load %1: no classFactory method" ).arg( lib ) );
return nullptr;
}
QgsDataProvider *dataProvider = classFactory( &dataSource );
if ( !dataProvider )
{
QgsMessageLog::logMessage( QObject::tr( "Unable to instantiate the data provider plugin %1" ).arg( lib ) );
myLib.unload();
return nullptr;
}
QgsDebugMsg( QString( "Instantiated the data provider plugin: %1" ).arg( dataProvider->name() ) );
return dataProvider;
} // QgsProviderRegistry::setDataProvider
int QgsProviderRegistry::<API key>( const QString &providerKey ) const
{
std::unique_ptr< QLibrary > library( <API key>( providerKey ) );
if ( !library )
{
return QgsDataProvider::NoDataCapabilities;
}
dataCapabilities_t *dataCapabilities = reinterpret_cast< dataCapabilities_t *>( cast_to_fptr( library->resolve( "dataCapabilities" ) ) );
if ( !dataCapabilities )
{
return QgsDataProvider::NoDataCapabilities;
}
return dataCapabilities();
}
// This should be QWidget, not QDialog
typedef QWidget *<API key>( QWidget *parent, Qt::WindowFlags fl );
QWidget *QgsProviderRegistry::<API key>( const QString &providerKey,
QWidget *parent, Qt::WindowFlags fl )
{
<API key> *selectFactory =
reinterpret_cast< <API key> * >( cast_to_fptr( function( providerKey, "selectWidget" ) ) );
if ( !selectFactory )
return nullptr;
return selectFactory( parent, fl );
}
QFunctionPointer QgsProviderRegistry::function( QString const &providerKey,
QString const &functionName )
{
QString lib = library( providerKey );
if ( lib.isEmpty() )
return nullptr;
QLibrary myLib( library( providerKey ) );
QgsDebugMsg( "Library name is " + myLib.fileName() );
if ( myLib.load() )
{
return myLib.resolve( functionName.toLatin1().data() );
}
else
{
QgsDebugMsg( "Cannot load library: " + myLib.errorString() );
return nullptr;
}
}
QLibrary *QgsProviderRegistry::<API key>( QString const &providerKey ) const
{
QString lib = library( providerKey );
if ( lib.isEmpty() )
return nullptr;
std::unique_ptr< QLibrary > myLib( new QLibrary( lib ) );
QgsDebugMsg( "Library name is " + myLib->fileName() );
if ( myLib->load() )
return myLib.release();
QgsDebugMsg( "Cannot load library: " + myLib->errorString() );
return nullptr;
}
void QgsProviderRegistry::registerGuis( QWidget *parent )
{
typedef void <API key>( QWidget * parent );
Q_FOREACH ( const QString &provider, providerList() )
{
<API key> *registerGui = reinterpret_cast< <API key> * >( cast_to_fptr( function( provider, "registerGui" ) ) );
if ( !registerGui )
continue;
registerGui( parent );
}
}
QString QgsProviderRegistry::fileVectorFilters() const
{
return mVectorFileFilters;
}
QString QgsProviderRegistry::fileRasterFilters() const
{
return mRasterFileFilters;
}
QString QgsProviderRegistry::databaseDrivers() const
{
return mDatabaseDrivers;
}
QString QgsProviderRegistry::directoryDrivers() const
{
return mDirectoryDrivers;
}
QString QgsProviderRegistry::protocolDrivers() const
{
return mProtocolDrivers;
}
QStringList QgsProviderRegistry::providerList() const
{
QStringList lst;
for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
{
lst.append( it->first );
}
return lst;
}
const QgsProviderMetadata *QgsProviderRegistry::providerMetadata( const QString &providerKey ) const
{
return findMetadata_( mProviders, providerKey );
} |
package org.ssanalytics.snapshotplugin.domainModel.crawlerData.contract.superInterfaces;
public interface IBaseDomain {
// public Long getTimestamp();
public String getSnapshotId();
public String getChecksum();
public String getAccountId();
} |
#include <stdio.h>
#include <stdlib.h>
#include "suma.h"
int main(int argc, const char **argv){
double op[2];
printf("Este programa suma.\n\n");
for(int i=0; i<2; i++){
printf("operando %i: ", i+1);
scanf(" %lf", &op[i]);
}
printf(" RESULTADO = %.2lf \n",
suma(op[0], op[1])
);
return EXIT_SUCCESS;
} |
/**
* A BufferedStore maintains a sparsely populated map of pages corresponding to an extremely large server-side dataset.
*
* Use a BufferedStore when the dataset size is so large that the database and network latency, and client memory requirements
* preclude caching the entire dataset in a regular {@link Ext.data.Store Store}.
*
* When using a BufferedStore *not all of the dataset is present in the client*. Only pages which have been
* requested by the UI (usually a {@link Ext.grid.Panel GridPanel}) and surrounding pages will be present. Retention
* of viewed pages in the BufferedStore after they have been scrolled out of view is configurable. See {@link #leadingBufferZone},
* {@link #trailingBufferZone} and {@link #purgePageCount}.
*
* To use a BufferedStore, initiate the loading process by loading the first page. The number of rows rendered are
* determined automatically, and the range of pages needed to keep the cache primed for scrolling is
* requested and cached.
* Example:
*
* myBufferedStore.loadPage(1); // Load page 1
*
* A {@link Ext.grid.plugin.BufferedRenderer BufferedRenderer} is instantiated which will monitor the scrolling in the grid, and
* refresh the view's rows from the page cache as needed. It will also pull new data into the page
* cache when scrolling of the view draws upon data near either end of the prefetched data.
*
* The margins which trigger view refreshing from the prefetched data are {@link Ext.grid.plugin.BufferedRenderer#numFromEdge},
* {@link Ext.grid.plugin.BufferedRenderer#leadingBufferZone} and {@link Ext.grid.plugin.BufferedRenderer#trailingBufferZone}.
*
* The margins which trigger loading more data into the page cache are, {@link #leadingBufferZone} and
* {@link #trailingBufferZone}.
*
* By default, only 5 pages of data (in addition to the pages which over the visible region) are cached in the page cache,
* with old pages being evicted from the cache as the view moves down through the dataset. This is controlled by the
* {@link #purgePageCount} setting.
*
* Setting this value to zero means that no pages are *ever* scrolled out of the page cache, and
* that eventually the whole dataset may become present in the page cache. This is sometimes desirable
* as long as datasets do not reach astronomical proportions.
*
* Selection state may be maintained across page boundaries by configuring the SelectionModel not to discard
* records from its collection when those Records cycle out of the Store's primary collection. This is done
* by configuring the SelectionModel like this:
*
* selModel: {
* pruneRemoved: false
* }
*
*/
Ext.define('Ext.data.BufferedStore', {
extend: 'Ext.data.ProxyStore',
alias: 'store.buffered',
requires: [
'Ext.data.PageMap',
'Ext.util.Filter',
'Ext.util.Sorter',
'Ext.util.Grouper'
],
uses: [
'Ext.util.SorterCollection',
'Ext.util.FilterCollection',
'Ext.util.GroupCollection'
],
/**
* @property {Boolean} isBufferedStore
* `true` in this class to identify an object as an instantiated BufferedStore, or subclass thereof.
*/
isBufferedStore: true,
// For backward compatibility with user code.
buffered: true,
config: {
data: 0,
pageSize: 25,
remoteSort: true,
remoteFilter: true,
sortOnLoad: false,
/**
* @cfg {Number} purgePageCount
*
* The number of pages *in addition to twice the required buffered range* to keep in the prefetch cache before purging least recently used records.
*
* For example, if the height of the view area and the configured {@link #trailingBufferZone} and {@link #leadingBufferZone} require that there
* are three pages in the cache, then a `purgePageCount` of 5 ensures that up to 11 pages can be in the page cache any any one time. This is enough
* to allow the user to scroll rapidly between different areas of the dataset without evicting pages which are still needed.
*
* A value of 0 indicates to never purge the prefetched data.
*/
purgePageCount: 5,
/**
* @cfg {Number} trailingBufferZone
* The number of extra records to keep cached on the trailing side of scrolling buffer
* as scrolling proceeds. A larger number means fewer replenishments from the server.
*/
trailingBufferZone: 25,
/**
* @cfg {Number} leadingBufferZone
* The number of extra rows to keep cached on the leading side of scrolling buffer
* as scrolling proceeds. A larger number means fewer replenishments from the server.
*/
leadingBufferZone: 200,
/**
* @cfg {Number} defaultViewSize The default view size to use until the {@link #viewSize} has been configured.
* @private
*/
defaultViewSize: 100,
/**
* @cfg {Number} viewSize The view size needed to fill the current view. Defaults to the {@link #defaultViewSize}.
* This will typically be set by the underlying view.
* @private
*/
viewSize: 0,
/**
* @inheritdoc
*/
trackRemoved: false
},
/**
* We are using applyData so that we can return nothing and prevent the `this.data`
* property to be overridden.
* @param {Array/Object} data
*/
applyData: function(data) {
var dataCollection = this.data || (this.data = this.<API key>());
//<debug>
if (data && data !== true) {
Ext.raise('Cannot load a buffered store with local data - the store is a map of remote data');
}
//</debug>
return dataCollection;
},
applyProxy: function(proxy) {
proxy = this.callParent([proxy]);
// This store asks for pages.
// If used with a MemoryProxy, it must work
if (proxy && proxy.setEnablePaging) {
proxy.setEnablePaging(true);
}
return proxy;
},
<API key>: function() {
return new Ext.util.FilterCollection();
},
<API key>: function() {
return new Ext.util.SorterCollection();
},
//<debug>
updateRemoteFilter: function(remoteFilter, oldRemoteFilter) {
if (remoteFilter === false) {
Ext.raise('Buffered stores are always remotely filtered.');
}
this.callParent([remoteFilter, oldRemoteFilter]);
},
updateRemoteSort: function(remoteSort, oldRemoteSort) {
if (remoteSort === false) {
Ext.raise('Buffered stores are always remotely sorted.');
}
this.callParent([remoteSort, oldRemoteSort]);
},
updateTrackRemoved: function(value) {
if (value !== false) {
Ext.raise('Cannot use trackRemoved with a buffered store.');
}
this.callParent(arguments);
},
//</debug>
updateGroupField: function(field) {
var me = this;
if (me.isInitializing) {
me.blockLoad();
}
me.group(field);
if (me.isInitializing) {
me.unblockLoad();
}
},
getGrouper: function() {
return this.grouper;
},
isGrouped: function() {
return !!this.grouper;
},
<API key>: function() {
var me = this,
result = new Ext.data.PageMap({
store: me,
rootProperty: 'data',
pageSize: me.getPageSize(),
maxSize: me.getPurgePageCount(),
listeners: {
// Whenever PageMap gets cleared, it means we re no longer interested in
// any outstanding page prefetches, so cancel tham all
clear: me.onPageMapClear,
scope: me
}
});
// Allow view to veto prune if the old page is still in use by the view
me.relayEvents(result, ['beforepageremove', 'pageadd', 'pageremove']);
me.pageRequests = {};
return result;
},
//<debug>
add: function() {
Ext.raise('add method may not be called on a buffered store - the store is a map of remote data');
},
insert: function() {
Ext.raise('insert method may not be called on a buffered store - the store is a map of remote data');
},
//</debug>
removeAll: function(silent) {
var me = this,
data = me.getData();
if (data) {
if (silent) {
me.suspendEvent('clear');
}
data.clear();
if (silent) {
me.resumeEvent('clear');
}
}
},
load: function(options) {
var me = this;
options = options || {};
// Buffered stores, a load operation means kick off a clean load from page 1
me.getData().clear();
options.page = 1;
options.start = 0;
options.limit = me.getViewSize() || me.getDefaultViewSize();
// If we're prefetching, the arguments on the callback for getting the range is different
// So we indicate that we need to fire a special "load" style callback
options.loadCallback = options.callback;
delete options.callback;
return me.loadToPrefetch(options);
},
reload: function(options) {
var me = this,
data = me.getData(),
// If we don't have a known totalCount, use a huge value
lastTotal = Number.MAX_VALUE,
startIdx, endIdx, startPage, endPage,
i, waitForReload, bufferZone, records;
if (!options) {
options = {};
}
// Prevent re-entering the load process if we are already in a wait state for a batch of pages.
if (me.loading || me.fireEvent('beforeload', me, options) === false) {
return;
}
waitForReload = function() {
var newCount = me.totalCount,
oldRequestSize = endIdx - startIdx;
// If the dataset has now shrunk leaving the calculated request zone unavailable,
// re-evaluate the request zone. Start as close to the end as possible.
if (endIdx >= newCount) {
endIdx = newCount - 1;
startIdx = Math.max(endIdx - oldRequestSize, 0);
}
if (me.rangeCached(startIdx, Math.min(endIdx, me.totalCount))) {
me.loading = false;
data.un('pageadd', waitForReload);
records = data.getRange(startIdx, endIdx + 1);
me.fireEvent('load', me, records, true);
me.fireEvent('refresh', me);
}
};
bufferZone = Math.ceil((me.<API key>() + me.<API key>()) / 2);
// Decide what reload means.
// If the View was configured <API key>, then it will
// inject that setting here. This means that reload means
// load the last requested range.
if (me.lastRequestStart && me.<API key>) {
startIdx = me.lastRequestStart;
endIdx = me.lastRequestEnd;
lastTotal = me.getTotalCount();
}
// Otherwise, reload means start from page 1
else {
startIdx = options.start || 0;
endIdx = startIdx + (options.count || me.getPageSize()) - 1;
}
// Clear page cache
data.clear(true);
// So that prefetchPage does not consider the store to be fully loaded if the local count is equal to the total count
delete me.totalCount;
// Calculate a page range which encompasses the Store's loaded range plus both buffer zones
startIdx = Math.max(startIdx - bufferZone, 0);
endIdx = Math.min(endIdx + bufferZone, lastTotal);
startPage = me.<API key>(startIdx);
endPage = me.<API key>(endIdx);
me.loading = true;
// Wait for the requested range to become available in the page map
// Load the range as soon as the whole range is available
data.on('pageadd', waitForReload);
// Recache the page range which encapsulates our visible records
for (i = startPage; i <= endPage; i++) {
me.prefetchPage(i, options);
}
},
filter: function() {
//<debug>
if (!this.getRemoteFilter()) {
Ext.raise('Local filtering may not be used on a buffered store - the store is a map of remote data');
}
//</debug>
// Remote filtering forces a load. load clears the store's contents.
this.callParent(arguments);
},
filterBy: function(fn, scope) {
//<debug>
Ext.raise('Local filtering may not be used on a buffered store - the store is a map of remote data');
//</debug>
},
loadData: function(data, append) {
//<debug>
Ext.raise('LoadData may not be used on a buffered store - the store is a map of remote data');
//</debug>
},
loadPage: function(page, options) {
var me = this;
options = options || {};
options.page = me.currentPage = page;
options.start = (page - 1) * me.getPageSize();
options.limit = me.getViewSize() || me.getDefaultViewSize();
options.loadCallback = options.callback;
delete options.callback;
return me.loadToPrefetch(options);
},
clearData: function(isLoad) {
var me = this,
data = me.getData();
if (data) {
data.clear();
}
},
/**
* @private
* @override
* A BufferedStore always reports that it contains the full dataset.
* The number of records that happen to be cached at any one time is never useful.
*/
getCount: function() {
return this.totalCount || 0;
},
getRange: function(start, end, options) {
var me = this,
maxIndex = me.totalCount - 1,
lastRequestStart = me.lastRequestStart,
result = [],
data = me.getData(),
pageAddHandler,
requiredStart, requiredEnd,
requiredStartPage, requiredEndPage;
options = Ext.apply({
prefetchStart: start,
prefetchEnd: end
}, options);
// Sanity check end point to be within dataset range
end = (end >= me.totalCount) ? maxIndex : end;
// We must wait for a slightly wider range to be cached.
// This is to allow grouping features to peek at the two surrounding records
// when rendering a *range* of records to see whether the start of the range
// really is a group start and the end of the range really is a group end.
requiredStart = start === 0 ? 0 : start - 1;
requiredEnd = end === maxIndex ? end : end + 1;
// Keep track of range we are being asked for so we can track direction of movement through the dataset
me.lastRequestStart = start;
me.lastRequestEnd = end;
// If data request can be satisfied from the page cache
if (me.rangeCached(requiredStart, requiredEnd)) {
me.onRangeAvailable(options);
result = data.getRange(start, end + 1);
}
// At least some of the requested range needs loading from server
else {
// Private event used by the LoadMask class to perform masking when the range required for rendering is not found in the cache
me.fireEvent('cachemiss', me, start, end);
requiredStartPage = me.<API key>(requiredStart);
requiredEndPage = me.<API key>(requiredEnd);
// Add a pageadd listener, and as soon as the requested range is loaded, call onRangeAvailable to call the callback.
pageAddHandler = function(pageMap, page, records) {
if (page >= requiredStartPage && page <= requiredEndPage && me.rangeCached(requiredStart, requiredEnd)) {
// Private event used by the LoadMask class to unmask when the range required for rendering has been loaded into the cache
me.fireEvent('cachefilled', me, start, end);
data.un('pageadd', pageAddHandler);
me.onRangeAvailable(options);
}
};
data.on('pageadd', pageAddHandler);
// Prioritize the request for the *exact range that the UI is asking for*.
// When a page request is in flight, it will not be requested again by checking the me.pageRequests hash,
// so the request after this will only request the *remaining* unrequested pages .
me.prefetchRange(start, end);
}
// Load the pages around the requested range required by the leadingBufferZone and trailingBufferZone.
me.primeCache(start, end, start < lastRequestStart ? -1 : 1);
return result;
},
/**
* Get the Record with the specified id.
*
* This method is not affected by filtering, lookup will be performed from all records
* inside the store, filtered or not.
*
* @param {Mixed} id The id of the Record to find.
* @return {Ext.data.Model} The Record with the passed id. Returns null if not found.
*/
getById: function(id) {
var result = this.data.findBy(function(record) {
return record.getId() === id;
});
return result;
},
/**
* @inheritdoc
*/
getAt: function(index) {
var data = this.getData();
if (data.hasRange(index, index)) {
return data.getAt(index);
}
},
/**
* @private
* Get the Record with the specified internalId.
*
* This method is not effected by filtering, lookup will be performed from all records
* inside the store, filtered or not.
*
* @param {Mixed} internalId The id of the Record to find.
* @return {Ext.data.Model} The Record with the passed internalId. Returns null if not found.
*/
getByInternalId: function(internalId) {
return this.data.getByInternalId(internalId);
},
/**
* Get the index of the record within the store.
*
* When store is filtered, records outside of filter will not be found.
*
* @param {Ext.data.Model} record The Ext.data.Model object to find.
* @return {Number} The index of the passed Record. Returns -1 if not found.
*/
indexOf: function(record) {
return this.getData().indexOf(record);
},
/**
* Get the index within the store of the Record with the passed id.
*
* Like #indexOf, this method is effected by filtering.
*
* @param {String} id The id of the Record to find.
* @return {Number} The index of the Record. Returns -1 if not found.
*/
indexOfId: function(id) {
return this.indexOf(this.getById(id));
},
group: function(grouper, direction) {
var me = this,
oldGrouper;
if (grouper && typeof grouper === 'string') {
oldGrouper = me.grouper;
if (!oldGrouper) {
me.grouper = new Ext.util.Grouper({
property : grouper,
direction: direction || 'ASC',
root: 'data'
});
} else if (direction === undefined) {
oldGrouper.toggle();
} else {
oldGrouper.setDirection(direction);
}
} else {
me.grouper = grouper ? me.getSorters().decodeSorter(grouper, 'Ext.util.Grouper') : null;
}
if (me.isLoadBlocked()) {
return;
}
me.getData().clear();
me.loadPage(1, {
callback: function() {
me.fireEvent('groupchange', me, me.getGrouper());
}
});
},
/**
* Determines the page from a record index
* @param {Number} index The record index
* @return {Number} The page the record belongs to
*/
<API key>: function(index) {
return Math.floor(index / this.getPageSize()) + 1;
},
<API key>: function(rangeSizeRequested) {
var me = this,
purgePageCount = me.getPurgePageCount();
// Calculate the number of pages that the cache will keep before purging as follows:
// TWO full rendering zones (in case of rapid teleporting by dragging the scroller) plus configured purgePageCount.
// Ensure we never reduce the count. It always uses the largest requested block as the basis for the calculated size.
return purgePageCount ? Math.max(me.getData().getMaxSize() || 0, Math.ceil((rangeSizeRequested + me.<API key>() + me.<API key>()) / me.getPageSize()) * 2 + purgePageCount) : 0;
},
loadToPrefetch: function(options) {
var me = this,
prefetchOptions = options,
i,
records,
dataSetSize,
// Get the requested record index range in the dataset
startIdx = options.start,
endIdx = options.start + options.limit - 1,
rangeSizeRequested = (me.getViewSize() || options.limit),
// The end index to load into the store's live record collection
loadEndIdx = Math.min(endIdx, options.start + rangeSizeRequested - 1),
// Calculate a page range which encompasses the requested range plus both buffer zones.
// The endPage will be adjusted to be in the dataset size range as soon as the first data block returns.
startPage = me.<API key>(Math.max(startIdx - me.<API key>(), 0)),
endPage = me.<API key>(endIdx + me.<API key>()),
data = me.getData(),
callbackFn = function () {
// See comments in load() for why we need this.
records = records || [];
if (options.loadCallback) {
options.loadCallback.call(options.scope || me, records, operation, true);
}
if (options.callback) {
options.callback.call(options.scope || me, records, startIdx || 0, endIdx || 0, options);
}
},
fireEventsFn = function () {
me.fireEvent('datachanged', me);
me.fireEvent('refresh', me);
me.fireEvent('load', me, records, true);
},
// Wait for the viewable range to be available.
<API key> = function() {
if (me.rangeCached(startIdx, loadEndIdx)) {
me.loading = false;
records = data.getRange(startIdx, loadEndIdx + 1);
data.un('pageadd', <API key>);
// If there is a listener for guaranteedrange then fire that event
if (me.hasListeners.guaranteedrange) {
me.guaranteeRange(startIdx, loadEndIdx, options.callback, options.scope);
}
callbackFn();
fireEventsFn();
}
}, operation;
//<debug>
if (isNaN(me.pageSize) || !me.pageSize) {
Ext.raise('Buffered store configured without a pageSize', me);
}
//</debug>
// Ensure that the purgePageCount allows enough pages to be kept cached to cover the
// requested range. If the pageSize is very small we might need a lot of pages.
data.setMaxSize(me.<API key>(rangeSizeRequested));
if (me.fireEvent('beforeload', me, options) !== false) {
// So that prefetchPage does not consider the store to be fully loaded if the local count is equal to the total count
delete me.totalCount;
me.loading = true;
// Any configured callback is handled in <API key> above.
// It should not be processed by onProxyPrefetch.
if (options.callback) {
prefetchOptions = Ext.apply({}, options);
delete prefetchOptions.callback;
}
// Load the first page in the range, which will give us the initial total count.
// Once it is loaded, go ahead and prefetch any subsequent pages, if necessary.
// The prefetchPage has a check to prevent us loading more than the totalCount,
// so we don't want to blindly load up <n> pages where it isn't required.
me.on('prefetch', function(store, records, successful, op) {
// Capture operation here so it can be used in the loadCallback above
operation = op;
if (successful) {
// If there is data in the dataset, we can go ahead and add the pageadd listener which waits for the visible range
// and we can also issue the requests to fill the surrounding buffer zones.
if ((dataSetSize = me.getTotalCount())) {
// Wait for the requested range to become available in the page map
data.on('pageadd', <API key>);
// As soon as we have the size of the dataset, ensure we are not waiting for more than can ever arrive,
loadEndIdx = Math.min(loadEndIdx, dataSetSize - 1);
// And make sure we never ask for pages beyond the end of the dataset.
endPage = me.<API key>(Math.min(loadEndIdx + me.<API key>(), dataSetSize - 1));
for (i = startPage + 1; i <= endPage; ++i) {
me.prefetchPage(i, prefetchOptions);
}
} else {
callbackFn();
fireEventsFn();
}
}
// Unsuccessful prefetch: fire a load event with success false.
else {
me.loading = false;
callbackFn();
me.fireEvent('load', me, records, false);
}
}, null, {single: true});
me.prefetchPage(startPage, prefetchOptions);
}
},
// Buffering
/**
* Prefetches data into the store using its configured {@link #proxy}.
* @param {Object} options (Optional) config object, passed into the Ext.data.operation.Operation object before loading.
* See {@link #method-load}
*/
prefetch: function(options) {
var me = this,
pageSize = me.getPageSize(),
data = me.getData(),
operation,
existingPageRequest;
// Check pageSize has not been tampered with. That would break page caching
if (pageSize) {
if (me.lastPageSize && pageSize != me.lastPageSize) {
Ext.raise("pageSize cannot be dynamically altered");
}
if (!data.getPageSize()) {
data.setPageSize(pageSize);
}
}
// Allow first prefetch call to imply the required page size.
else {
me.pageSize = data.setPageSize(pageSize = options.limit);
}
// So that we can check for tampering next time through
me.lastPageSize = pageSize;
// Always get whole pages.
if (!options.page) {
options.page = me.<API key>(options.start);
options.start = (options.page - 1) * pageSize;
options.limit = Math.ceil(options.limit / pageSize) * pageSize;
}
// Currently not requesting this page, or the request was for the last
// generation of the data cache (clearing it changes generations)
// then request it...
existingPageRequest = me.pageRequests[options.page];
if (!existingPageRequest || existingPageRequest.pageMapGeneration !== data.pageMapGeneration) {
// Copy options into a new object so as not to mutate passed in objects
options = Ext.apply({
action : 'read',
filters: me.getFilters().items,
sorters: me.getSorters().items,
grouper: me.getGrouper(),
internalCallback: me.onProxyPrefetch,
internalScope: me
}, options);
operation = me.createOperation('read', options);
// Generation # of the page map to which the requested records belong.
// If page map is cleared while this request is in flight, the pageMapGeneration will increment and the payload will be rejected
operation.pageMapGeneration = data.pageMapGeneration;
if (me.fireEvent('beforeprefetch', me, operation) !== false) {
me.pageRequests[options.page] = operation.execute();
if (me.getProxy().isSynchronous) {
delete me.pageRequests[options.page];
}
}
}
return me;
},
/**
* @private
* Cancels all pending prefetch requests.
*
* This is called when the page map is cleared.
*
* Any requests which still make it through will be for the previous pageMapGeneration
* (pageMapGeneration is incremented upon clear), and so will be rejected upon arrival.
*/
onPageMapClear: function() {
var me = this,
loadingFlag = me.wasLoading,
reqs = me.pageRequests,
data = me.getData(),
req, page;
// If any requests return, we no longer respond to them.
data.clearListeners();
// replace the listeners we need.
data.on('clear', me.onPageMapClear, me);
me.relayEvents(data, ['beforepageremove', 'pageadd', 'pageremove']);
// If the page cache gets cleared it's because a full reload is in progress.
// Setting the loading flag prevents linked Views from displaying the empty text
// during a load... we don't know whether ther dataset is empty or not.
me.loading = true;
me.totalCount = 0;
// Cancel all outstanding requests
for (page in reqs) {
if (reqs.hasOwnProperty(page)) {
req = reqs[page];
delete reqs[page];
delete req.callback;
}
}
// This will update any views.
me.fireEvent('clear', me);
// Restore loading flag. The beforeload event could still veto the process.
// The flag does not get set for real until we pass the beforeload event.
me.loading = loadingFlag;
},
/**
* Prefetches a page of data.
* @param {Number} page The page to prefetch
* @param {Object} options (Optional) config object, passed into the Ext.data.operation.Operation object before loading.
* See {@link #method-load}
*/
prefetchPage: function(page, options) {
var me = this,
pageSize = me.getPageSize(),
start = (page - 1) * pageSize,
total = me.totalCount;
// No more data to prefetch.
if (total !== undefined && me.data.getCount() === total) {
return;
}
// Copy options into a new object so as not to mutate passed in objects
me.prefetch(Ext.applyIf({
page : page,
start : start,
limit : pageSize
}, options));
},
/**
* Called after the configured proxy completes a prefetch operation.
* @private
* @param {Ext.data.operation.Operation} operation The operation that completed
*/
onProxyPrefetch: function(operation) {
var me = this,
resultSet = operation.getResultSet(),
records = operation.getRecords(),
successful = operation.wasSuccessful(),
page = operation.getPage(),
oldTotal = me.totalCount;
// Only cache the data if the operation was invoked for the current pageMapGeneration.
// If the pageMapGeneration has changed since the request was fired off, it will have been cancelled.
if (operation.pageMapGeneration === me.getData().pageMapGeneration) {
if (resultSet) {
me.totalCount = resultSet.getTotal();
if (me.totalCount !== oldTotal) {
me.fireEvent('totalcountchange', me.totalCount);
}
}
// Remove the loaded page from the outstanding pages hash
if (page !== undefined) {
delete me.pageRequests[page];
}
// Prefetch is broadcast before the page is cached
me.loading = false;
me.fireEvent('prefetch', me, records, successful, operation);
// Add the page into the page map.
// pageadd event may trigger the onRangeAvailable
if (successful) {
me.cachePage(records, operation.getPage());
}
//this is a callback that would have been passed to the 'read' function and is optional
Ext.callback(operation.getCallback(), operation.getScope() || me, [records, operation, successful]);
}
},
/**
* Caches the records in the prefetch and stripes them with their server-side
* index.
* @private
* @param {Ext.data.Model[]} records The records to cache
* @param {Ext.data.operation.Operation} page The associated operation
*/
cachePage: function(records, page) {
var me = this,
len = records.length, i;
if (!Ext.isDefined(me.totalCount)) {
me.totalCount = records.length;
me.fireEvent('totalcountchange', me.totalCount);
}
// Add the fetched page into the pageCache
for (i = 0; i < len; i++) {
records[i].join(me);
}
me.getData().addPage(page, records);
},
/**
* Determines if the passed range is available in the page cache.
* @private
* @param {Number} start The start index
* @param {Number} end The end index in the range
*/
rangeCached: function(start, end) {
return this.getData().hasRange(start, end);
},
/**
* Determines if the passed page is available in the page cache.
* @private
* @param {Number} page The page to find in the page cache.
*/
pageCached: function(page) {
return this.getData().hasPage(page);
},
/**
* Determines if a request for a page is currently running
* @private
* @param {Number} page The page to check for
*/
pagePending: function(page) {
return !!this.pageRequests[page];
},
/**
* Determines if the passed range is available in the page cache.
* @private
* @deprecated 4.1.0 use {@link #rangeCached} instead
* @param {Number} start The start index
* @param {Number} end The end index in the range
* @return {Boolean}
*/
rangeSatisfied: function(start, end) {
return this.rangeCached(start, end);
},
/**
* Handles the availability of a requested range that was not previously available
* @private
*/
onRangeAvailable: function(options) {
var me = this,
totalCount = me.getTotalCount(),
start = options.prefetchStart,
end = (options.prefetchEnd > totalCount - 1) ? totalCount - 1 : options.prefetchEnd,
range;
end = Math.max(0, end);
//<debug>
if (start > end) {
Ext.log({
level: 'warn',
msg: 'Start (' + start + ') was greater than end (' + end +
') for the range of records requested (' + start + '-' +
options.prefetchEnd + ')' + (this.storeId ? ' from store "' + this.storeId + '"' : '')
});
}
//</debug>
range = me.getData().getRange(start, end + 1);
if (options.fireEvent !== false) {
me.fireEvent('guaranteedrange', range, start, end, options);
}
if (options.callback) {
options.callback.call(options.scope || me, range, start, end, options);
}
},
/**
* Guarantee a specific range, this will load the store with a range (that
* must be the `pageSize` or smaller) and take care of any loading that may
* be necessary.
* @deprecated Use {@link #getRange}
*/
guaranteeRange: function(start, end, callback, scope, options) {
options = Ext.apply({
callback: callback,
scope: scope
}, options);
this.getRange(start, end + 1, options);
},
/**
* Ensures that the specified range of rows is present in the cache.
*
* Converts the row range to a page range and then only load pages which are not already
* present in the page cache.
*/
prefetchRange: function(start, end) {
var me = this,
startPage, endPage, page,
data = me.getData();
if (!me.rangeCached(start, end)) {
startPage = me.<API key>(start);
endPage = me.<API key>(end);
// Ensure that the page cache's max size is correct.
// Our purgePageCount is the number of additional pages *outside of the required range* which
// may be kept in the cache. A purgePageCount of zero means unlimited.
data.setMaxSize(me.<API key>(end - start + 1));
// We have the range, but ensure that we have a "buffer" of pages around it.
for (page = startPage; page <= endPage; page++) {
if (!me.pageCached(page)) {
me.prefetchPage(page);
}
}
}
},
primeCache: function(start, end, direction) {
var me = this,
leadingBufferZone = me.<API key>(),
trailingBufferZone = me.<API key>(),
pageSize = me.getPageSize(),
totalCount = me.totalCount;
// Scrolling up
if (direction === -1) {
start = Math.max(start - leadingBufferZone, 0);
end = Math.min(end + trailingBufferZone, totalCount - 1);
}
// Scrolling down
else if (direction === 1) {
start = Math.max(Math.min(start - trailingBufferZone, totalCount - pageSize), 0);
end = Math.min(end + leadingBufferZone, totalCount - 1);
}
// Teleporting
else {
start = Math.min(Math.max(Math.floor(start - ((leadingBufferZone + trailingBufferZone) / 2)), 0), totalCount - me.pageSize);
end = Math.min(Math.max(Math.ceil (end + ((leadingBufferZone + trailingBufferZone) / 2)), 0), totalCount - 1);
}
me.prefetchRange(start, end);
},
sort: function(field, direction, mode) {
if (arguments.length === 0) {
this.clearAndLoad();
} else {
this.getSorters().addSort(field, direction, mode);
}
},
onSorterEndUpdate: function() {
var me = this,
sorters = me.getSorters().getRange();
// Only load or sort if there are sorters
if (sorters.length) {
me.clearAndLoad({
callback: function() {
me.fireEvent('sort', me, sorters);
}
});
} else {
// Sort event must fire when sorters collection is updated to empty.
me.fireEvent('sort', me, sorters);
}
},
clearAndLoad: function (options) {
if (this.isLoadBlocked()) {
return;
}
this.getData().clear();
this.loadPage(1, options);
},
privates: {
isLast: function(record) {
return this.indexOf(record) === this.getTotalCount() - 1;
},
isMoving: function () {
return false;
}
}
}); |
//algo de tri alphabetique
void tri_alphabeticAZ(unsigned int minimun, unsigned int maximum)
{
//unsigned int longueur;
unsigned int tampon,ligne1,ligne2;
unsigned int min;
//tri des dossiers en premier
for (ligne1=minimun;ligne1<maximum-1;++ligne1){
min=ligne1;
for (ligne2=ligne1+1;ligne2<maximum;++ligne2){
if (strcmp( data.name[listing_tri[0][ligne2]] , data.name[listing_tri[0][min]] ) <0 ) {
min=ligne2;
}
}
if (min!=ligne1){
tampon=listing_tri[0][ligne1];
listing_tri[0][ligne1]=listing_tri[0][min];
listing_tri[0][min]=tampon;
}
}
} |
#ifndef OLEOH
#define OLEOH
extern void oleo_read_file (FILE *, int);
extern void oleo_write_file (FILE *, struct rng *);
extern int oleo_set_options (int, char *);
extern void oleo_show_options (void);
#endif |
<!DOCTYPE html>
<html>
<head>
<title>Intrebarea6.</title>
<link rel="stylesheet" type="text/css" href="../Css/ResponsiveDesign.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js"></script>
</head>
<body>
<div id="txt"></div>
<div class="question-nr">
Intrebarea 6/10 <br />
</div>
<div id="question">
<label id="question-label"></label>
</div>
<div class="options">
<h3>Alege raspunsul corect :</h3>
<ol type="a">
<li><input type="radio" name="rasp1" id="a"/> <label id="varianta1"></label> </li>
<li><input type="radio" name="rasp1" id="b"/> <label id="varianta2"></label> </li>
<li><input type="radio" name="rasp1" id="c" /> <label id="varianta3"></label> </li>
<li><input type="radio" name="rasp1" id="d" /> <label id="varianta4"></label> </li>
<li><input type="radio" name="rasp1" id="e" /> <label id="varianta5"></label> </li>
</ol>
</div>
<div class="butoane">
<button id="prev" >Intrebarea anterioara</button>
<button id="next">Intrebarea urmatoare</button><br />
<br />
<button id="final">Termina Testul</button><br />
</div>
<script src="../Js/Json.js"></script>
<script src="../Js/cookies.js"></script>
<script src="../Js/state.js"></script>
<script src="../Js/timer.js"></script>
<script src="../Js/Questions.js"></script>
</body>
</html> |
#ifndef QCURSORPROPERTY_H
#define QCURSORPROPERTY_H
#include "qenumproperty.h"
class XmlNode;
class KERNEL_EXPORT QCursorProperty : public QEnumProperty
{
Q_OBJECT
public:
QCursorProperty(QAbstractProperty* parent=0);
protected:
void makeValue(XmlNode *xml);
void writeValue(XmlNode *xml);
};
#endif // QCURSORPROPERTY_H |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "classes/databasemanager.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
DatabaseManager *databaseManager() const;
void setDatabaseManager(DatabaseManager *databaseManager);
private slots:
void <API key>();
void <API key>();
void <API key>();
private:
Ui::MainWindow *ui;
void initDB();
DatabaseManager *_databaseManager;
};
#endif // MAINWINDOW_H |
# IMAP repository support
# <jgoerzen@complete.org>
# This program is free software; you can redistribute it and/or modify
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from Base import BaseRepository
from offlineimap import folder, imaputil, imapserver
from offlineimap.folder.UIDMaps import MappedIMAPFolder
from offlineimap.threadutil import ExitNotifyThread
import re, types, os, netrc, errno
from threading import *
class IMAPRepository(BaseRepository):
def __init__(self, reposname, account):
"""Initialize an IMAPRepository object."""
BaseRepository.__init__(self, reposname, account)
self.imapserver = imapserver.ConfigedIMAPServer(self)
self.folders = None
self.nametrans = lambda foldername: foldername
self.folderfilter = lambda foldername: 1
self.folderincludes = []
self.foldersort = cmp
localeval = self.localeval
if self.config.has_option(self.getsection(), 'nametrans'):
self.nametrans = localeval.eval(self.getconf('nametrans'),
{'re': re})
if self.config.has_option(self.getsection(), 'folderfilter'):
self.folderfilter = localeval.eval(self.getconf('folderfilter'),
{'re': re})
if self.config.has_option(self.getsection(), 'folderincludes'):
self.folderincludes = localeval.eval(self.getconf('folderincludes'),
{'re': re})
if self.config.has_option(self.getsection(), 'foldersort'):
self.foldersort = localeval.eval(self.getconf('foldersort'),
{'re': re})
def startkeepalive(self):
keepalivetime = self.getkeepalive()
if not keepalivetime: return
self.kaevent = Event()
self.kathread = ExitNotifyThread(target = self.imapserver.keepalive,
name = "Keep alive " + self.getname(),
args = (keepalivetime, self.kaevent))
self.kathread.setDaemon(1)
self.kathread.start()
def stopkeepalive(self):
if not hasattr(self, 'kaevent'):
# Keepalive is not active.
return
self.kaevent.set()
del self.kathread
del self.kaevent
def <API key>(self):
if not self.<API key>():
self.dropconnections()
def dropconnections(self):
self.imapserver.close()
def <API key>(self):
if self.getidlefolders():
return 1
return self.getconfboolean("holdconnectionopen", 0)
def getkeepalive(self):
num = self.getconfint("keepalive", 0)
if num == 0 and self.getidlefolders():
return 29*60
else:
return num
def getsep(self):
return self.imapserver.delim
def gethost(self):
host = None
localeval = self.localeval
if self.config.has_option(self.getsection(), 'remotehosteval'):
host = self.getconf('remotehosteval')
if host != None:
return localeval.eval(host)
host = self.getconf('remotehost')
if host != None:
return host
def getuser(self):
user = None
localeval = self.localeval
if self.config.has_option(self.getsection(), 'remoteusereval'):
user = self.getconf('remoteusereval')
if user != None:
return localeval.eval(user)
user = self.getconf('remoteuser')
if user != None:
return user
try:
netrcentry = netrc.netrc().authentificator(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
raise
else:
if netrcentry:
return netrcentry[0]
try:
netrcentry = netrc.netrc('/etc/netrc').authentificator(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
raise
else:
if netrcentry:
return netrcentry[0]
def getport(self):
return self.getconfint('remoteport', None)
def getssl(self):
return self.getconfboolean('ssl', 0)
def getsslclientcert(self):
return self.getconf('sslclientcert', None)
def getsslclientkey(self):
return self.getconf('sslclientkey', None)
def getpreauthtunnel(self):
return self.getconf('preauthtunnel', None)
def getreference(self):
return self.getconf('reference', '""')
def getidlefolders(self):
localeval = self.localeval
return localeval.eval(self.getconf('idlefolders', '[]'))
def getmaxconnections(self):
num1 = len(self.getidlefolders())
num2 = self.getconfint('maxconnections', 1)
return max(num1, num2)
def getexpunge(self):
return self.getconfboolean('expunge', 1)
def getpassword(self):
passwd = None
localeval = self.localeval
if self.config.has_option(self.getsection(), 'remotepasseval'):
passwd = self.getconf('remotepasseval')
if passwd != None:
return localeval.eval(passwd)
password = self.getconf('remotepass', None)
if password != None:
return password
passfile = self.getconf('remotepassfile', None)
if passfile != None:
fd = open(os.path.expanduser(passfile))
password = fd.readline().strip()
fd.close()
return password
try:
netrcentry = netrc.netrc().authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
raise
else:
if netrcentry:
user = self.getconf('remoteuser')
if user == None or user == netrcentry[0]:
return netrcentry[2]
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
raise
else:
if netrcentry:
user = self.getconf('remoteuser')
if user == None or user == netrcentry[0]:
return netrcentry[2]
return None
def getfolder(self, foldername):
return self.getfoldertype()(self.imapserver, foldername,
self.nametrans(foldername),
self.accountname, self)
def getfoldertype(self):
return folder.IMAP.IMAPFolder
def connect(self):
imapobj = self.imapserver.acquireconnection()
self.imapserver.releaseconnection(imapobj)
def forgetfolders(self):
self.folders = None
def getfolders(self):
if self.folders != None:
return self.folders
retval = []
imapobj = self.imapserver.acquireconnection()
# check whether to list all folders, or subscribed only
listfunction = imapobj.list
if self.config.has_option(self.getsection(), 'subscribedonly'):
if self.getconf('subscribedonly') == "yes":
listfunction = imapobj.lsub
try:
listresult = listfunction(directory = self.imapserver.reference)[1]
finally:
self.imapserver.releaseconnection(imapobj)
for string in listresult:
if string == None or \
(type(string) == types.StringType and string == ''):
# Bug in imaplib: empty strings in results from
# literals.
continue
flags, delim, name = imaputil.imapsplit(string)
flaglist = [x.lower() for x in imaputil.flagsplit(flags)]
if '\\noselect' in flaglist:
continue
foldername = imaputil.dequote(name)
if not self.folderfilter(foldername):
continue
retval.append(self.getfoldertype()(self.imapserver, foldername,
self.nametrans(foldername),
self.accountname, self))
if len(self.folderincludes):
imapobj = self.imapserver.acquireconnection()
try:
for foldername in self.folderincludes:
try:
imapobj.select(foldername, readonly = 1)
except ValueError:
continue
retval.append(self.getfoldertype()(self.imapserver,
foldername,
self.nametrans(foldername),
self.accountname, self))
finally:
self.imapserver.releaseconnection(imapobj)
retval.sort(lambda x, y: self.foldersort(x.getvisiblename(), y.getvisiblename()))
self.folders = retval
return retval
def makefolder(self, foldername):
#if self.getreference() != '""':
# newname = self.getreference() + self.getsep() + foldername
#else:
# newname = foldername
newname = foldername
imapobj = self.imapserver.acquireconnection()
try:
result = imapobj.create(newname)
if result[0] != 'OK':
raise RuntimeError, "Repository %s could not create folder %s: %s" % (self.getname(), foldername, str(result))
finally:
self.imapserver.releaseconnection(imapobj)
class <API key>(IMAPRepository):
def getfoldertype(self):
return MappedIMAPFolder |
#include <linux/sched.h>
#include <linux/poll.h>
#include <linux/spinlock.h>
#include "tpm.h"
enum tpm_const {
TPM_MINOR = 224, /* officially assigned */
TPM_BUFSIZE = 2048,
TPM_NUM_DEVICES = 256,
};
enum tpm_duration {
TPM_SHORT = 0,
TPM_MEDIUM = 1,
TPM_LONG = 2,
TPM_UNDEFINED,
};
#define TPM_MAX_ORDINAL 243
#define <API key> 12
#define <API key> 0xFF
static LIST_HEAD(tpm_chip_list);
static DEFINE_SPINLOCK(driver_lock);
static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES);
/*
* Array with one entry per ordinal defining the maximum amount
* of time the chip could take to return the result. The ordinal
* designation of short, medium or long is defined in a table in
* TCG Specification TPM Main Part 2 TPM Structures Section 17. The
* values of the SHORT, MEDIUM, and LONG durations are retrieved
* from the chip during initialization with a call to tpm_get_timeouts.
*/
static const u8 <API key>[<API key>] = {
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT,
};
static const u8 <API key>[TPM_MAX_ORDINAL] = {
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_LONG,
TPM_LONG,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_LONG,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_LONG,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_MEDIUM,
TPM_LONG,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_LONG,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_LONG,
TPM_UNDEFINED,
TPM_MEDIUM,
TPM_LONG,
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_MEDIUM, /* 100 */
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 105 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 110 */
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT, /* 115 */
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_LONG, /* 120 */
TPM_LONG,
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT, /* 125 */
TPM_SHORT,
TPM_LONG,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT, /* 130 */
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_SHORT,
TPM_MEDIUM,
TPM_UNDEFINED, /* 135 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 140 */
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 145 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 150 */
TPM_MEDIUM,
TPM_MEDIUM,
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED, /* 155 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 160 */
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 165 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_LONG, /* 170 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 175 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_MEDIUM, /* 180 */
TPM_SHORT,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_MEDIUM, /* 185 */
TPM_SHORT,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 190 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 195 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 200 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT, /* 205 */
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_MEDIUM, /* 210 */
TPM_UNDEFINED,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_MEDIUM,
TPM_UNDEFINED, /* 215 */
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT,
TPM_SHORT, /* 220 */
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_SHORT,
TPM_UNDEFINED, /* 225 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 230 */
TPM_LONG,
TPM_MEDIUM,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED, /* 235 */
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_UNDEFINED,
TPM_SHORT, /* 240 */
TPM_UNDEFINED,
TPM_MEDIUM,
};
static void user_reader_timeout(unsigned long ptr)
{
struct tpm_chip *chip = (struct tpm_chip *) ptr;
schedule_work(&chip->work);
}
static void timeout_work(void *ptr)
{
struct tpm_chip *chip = ptr;
down(&chip->buffer_mutex);
atomic_set(&chip->data_pending, 0);
memset(chip->data_buffer, 0, TPM_BUFSIZE);
up(&chip->buffer_mutex);
}
/*
* Returns max number of jiffies to wait
*/
unsigned long <API key>(struct tpm_chip *chip,
u32 ordinal)
{
int duration_idx = TPM_UNDEFINED;
int duration = 0;
if (ordinal < TPM_MAX_ORDINAL)
duration_idx = <API key>[ordinal];
else if ((ordinal & <API key>) <
<API key>)
duration_idx =
<API key>[ordinal &
<API key>];
if (duration_idx != TPM_UNDEFINED)
duration = chip->vendor.duration[duration_idx];
if (duration <= 0)
return 2 * 60 * HZ;
else
return duration;
}
EXPORT_SYMBOL_GPL(<API key>);
/*
* Internal kernel interface to transmit TPM commands
*/
static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
size_t bufsiz)
{
ssize_t rc;
u32 count, ordinal;
unsigned long stop;
count = be32_to_cpu(*((__be32 *) (buf + 2)));
ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
if (count == 0)
return -ENODATA;
if (count > bufsiz) {
dev_err(chip->dev,
"invalid count value %x %zx \n", count, bufsiz);
return -E2BIG;
}
down(&chip->tpm_mutex);
if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) {
dev_err(chip->dev,
"tpm_transmit: tpm_send: error %zd\n", rc);
goto out;
}
if (chip->vendor.irq)
goto out_recv;
stop = jiffies + <API key>(chip, ordinal);
do {
u8 status = chip->vendor.status(chip);
if ((status & chip->vendor.req_complete_mask) ==
chip->vendor.req_complete_val)
goto out_recv;
if ((status == chip->vendor.req_canceled)) {
dev_err(chip->dev, "Operation Canceled\n");
rc = -ECANCELED;
goto out;
}
msleep(TPM_TIMEOUT); /* CHECK */
rmb();
} while (time_before(jiffies, stop));
chip->vendor.cancel(chip);
dev_err(chip->dev, "Operation Timed out\n");
rc = -ETIME;
goto out;
out_recv:
rc = chip->vendor.recv(chip, (u8 *) buf, bufsiz);
if (rc < 0)
dev_err(chip->dev,
"tpm_transmit: tpm_recv: error %zd\n", rc);
out:
up(&chip->tpm_mutex);
return rc;
}
#define TPM_DIGEST_SIZE 20
#define TPM_ERROR_SIZE 10
#define TPM_RET_CODE_IDX 6
#define <API key> 10
#define <API key> 14
#define <API key> 18
#define <API key> 22
#define <API key> 26
#define <API key> 16
#define <API key> 18
#define <API key> 14
#define <API key> 16
#define TPM_CAP_IDX 13
#define TPM_CAP_SUBCAP_IDX 21
enum tpm_capabilities {
TPM_CAP_FLAG = 4,
TPM_CAP_PROP = 5,
};
enum <API key> {
TPM_CAP_PROP_PCR = 0x1,
<API key> = 0x3,
TPM_CAP_FLAG_PERM = 0x8,
TPM_CAP_FLAG_VOL = 0x9,
TPM_CAP_PROP_OWNER = 0x11,
<API key> = 0x15,
<API key> = 0x20,
};
/*
* This is a semi generic GetCapability command for use
* with the capability type TPM_CAP_PROP or TPM_CAP_FLAG
* and their associated sub_capabilities.
*/
static const u8 tpm_cap[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 22, /* length */
0, 0, 0, 101, /* <API key> */
0, 0, 0, 0, /* TPM_CAP_<TYPE> */
0, 0, 0, 4, /* TPM_CAP_SUB_<TYPE> size */
0, 0, 1, 0 /* TPM_CAP_SUB_<TYPE> */
};
static ssize_t transmit_cmd(struct tpm_chip *chip, u8 *data, int len,
char *desc)
{
int err;
len = tpm_transmit(chip, data, len);
if (len < 0)
return len;
if (len == TPM_ERROR_SIZE) {
err = be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX)));
dev_dbg(chip->dev, "A TPM error (%d) occurred %s\n", err, desc);
return err;
}
return 0;
}
void tpm_gen_interrupt(struct tpm_chip *chip)
{
u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)];
ssize_t rc;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = <API key>;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the timeouts");
}
EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
void tpm_get_timeouts(struct tpm_chip *chip)
{
u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)];
ssize_t rc;
u32 timeout;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = <API key>;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the timeouts");
if (rc)
goto duration;
if (be32_to_cpu(*((__be32 *) (data + <API key>)))
!= 4 * sizeof(u32))
goto duration;
/* Don't overwrite default if value is 0 */
timeout =
be32_to_cpu(*((__be32 *) (data + <API key>)));
if (timeout)
chip->vendor.timeout_a = msecs_to_jiffies(timeout);
timeout =
be32_to_cpu(*((__be32 *) (data + <API key>)));
if (timeout)
chip->vendor.timeout_b = msecs_to_jiffies(timeout);
timeout =
be32_to_cpu(*((__be32 *) (data + <API key>)));
if (timeout)
chip->vendor.timeout_c = msecs_to_jiffies(timeout);
timeout =
be32_to_cpu(*((__be32 *) (data + <API key>)));
if (timeout)
chip->vendor.timeout_d = msecs_to_jiffies(timeout);
duration:
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = <API key>;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the durations");
if (rc)
return;
if (be32_to_cpu(*((__be32 *) (data + <API key>)))
!= 3 * sizeof(u32))
return;
chip->vendor.duration[TPM_SHORT] =
msecs_to_jiffies(be32_to_cpu
(*((__be32 *) (data +
<API key>))));
chip->vendor.duration[TPM_MEDIUM] =
msecs_to_jiffies(be32_to_cpu
(*((__be32 *) (data +
<API key>))));
chip->vendor.duration[TPM_LONG] =
msecs_to_jiffies(be32_to_cpu
(*((__be32 *) (data +
<API key>))));
}
EXPORT_SYMBOL_GPL(tpm_get_timeouts);
void <API key>(struct tpm_chip *chip)
{
u8 data[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 10, /* length */
0, 0, 0, 83, /* <API key> */
};
tpm_transmit(chip, data, sizeof(data));
}
EXPORT_SYMBOL_GPL(<API key>);
ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
char *buf)
{
u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)];
ssize_t rc;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_FLAG;
data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
rc = transmit_cmd(chip, data, sizeof(data),
"attemtping to determine the permanent state");
if (rc)
return 0;
return sprintf(buf, "%d\n", !data[<API key>]);
}
EXPORT_SYMBOL_GPL(tpm_show_enabled);
ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
char *buf)
{
u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)];
ssize_t rc;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_FLAG;
data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
rc = transmit_cmd(chip, data, sizeof(data),
"attemtping to determine the permanent state");
if (rc)
return 0;
return sprintf(buf, "%d\n", !data[<API key>]);
}
EXPORT_SYMBOL_GPL(tpm_show_active);
ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
char *buf)
{
u8 data[sizeof(tpm_cap)];
ssize_t rc;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_OWNER;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the owner state");
if (rc)
return 0;
return sprintf(buf, "%d\n", data[<API key>]);
}
EXPORT_SYMBOL_GPL(tpm_show_owned);
ssize_t <API key>(struct device * dev,
struct device_attribute * attr, char *buf)
{
u8 data[sizeof(tpm_cap)];
ssize_t rc;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_FLAG;
data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_VOL;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the temporary state");
if (rc)
return 0;
return sprintf(buf, "%d\n", data[<API key>]);
}
EXPORT_SYMBOL_GPL(<API key>);
static const u8 pcrread[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 14, /* length */
0, 0, 0, 21, /* TPM_ORD_PcrRead */
0, 0, 0, 0 /* PCR index */
};
ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
char *buf)
{
u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(pcrread)), 30)];
ssize_t rc;
int i, j, num_pcrs;
__be32 index;
char *str = buf;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_PCR;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the number of PCRS");
if (rc)
return 0;
num_pcrs = be32_to_cpu(*((__be32 *) (data + 14)));
for (i = 0; i < num_pcrs; i++) {
memcpy(data, pcrread, sizeof(pcrread));
index = cpu_to_be32(i);
memcpy(data + 10, &index, 4);
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to read a PCR");
if (rc)
goto out;
str += sprintf(str, "PCR-%02d: ", i);
for (j = 0; j < TPM_DIGEST_SIZE; j++)
str += sprintf(str, "%02X ", *(data + 10 + j));
str += sprintf(str, "\n");
}
out:
return str - buf;
}
EXPORT_SYMBOL_GPL(tpm_show_pcrs);
#define <API key> 314
static const u8 readpubek[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 30, /* length */
0, 0, 0, 124, /* TPM_ORD_ReadPubek */
};
ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
char *buf)
{
u8 *data;
ssize_t err;
int i, rc;
char *str = buf;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
data = kzalloc(<API key>, GFP_KERNEL);
if (!data)
return -ENOMEM;
memcpy(data, readpubek, sizeof(readpubek));
err = transmit_cmd(chip, data, <API key>,
"attempting to read the PUBEK");
if (err)
goto out;
/*
ignore header 10 bytes
algorithm 32 bits (1 == RSA )
encscheme 16 bits
sigscheme 16 bits
parameters (RSA 12->bytes: keybit, #primes, expbit)
keylenbytes 32 bits
256 byte modulus
ignore checksum 20 bytes
*/
str +=
sprintf(str,
"Algorithm: %02X %02X %02X %02X\nEncscheme: %02X %02X\n"
"Sigscheme: %02X %02X\nParameters: %02X %02X %02X %02X"
" %02X %02X %02X %02X %02X %02X %02X %02X\n"
"Modulus length: %d\nModulus: \n",
data[10], data[11], data[12], data[13], data[14],
data[15], data[16], data[17], data[22], data[23],
data[24], data[25], data[26], data[27], data[28],
data[29], data[30], data[31], data[32], data[33],
be32_to_cpu(*((__be32 *) (data + 34))));
for (i = 0; i < 256; i++) {
str += sprintf(str, "%02X ", data[i + 38]);
if ((i + 1) % 16 == 0)
str += sprintf(str, "\n");
}
out:
rc = str - buf;
kfree(data);
return rc;
}
EXPORT_SYMBOL_GPL(tpm_show_pubek);
#define CAP_VERSION_1_1 6
#define CAP_VERSION_1_2 0x1A
#define CAP_VERSION_IDX 13
static const u8 cap_version[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 18, /* length */
0, 0, 0, 101, /* <API key> */
0, 0, 0, 0,
0, 0, 0, 0
};
ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr,
char *buf)
{
u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)];
ssize_t rc;
char *str = buf;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = <API key>;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the manufacturer");
if (rc)
return 0;
str += sprintf(str, "Manufacturer: 0x%x\n",
be32_to_cpu(*((__be32 *) (data + <API key>))));
memcpy(data, cap_version, sizeof(cap_version));
data[CAP_VERSION_IDX] = CAP_VERSION_1_1;
rc = transmit_cmd(chip, data, sizeof(data),
"attempting to determine the 1.1 version");
if (rc)
goto out;
str += sprintf(str,
"TCG version: %d.%d\nFirmware version: %d.%d\n",
(int) data[14], (int) data[15], (int) data[16],
(int) data[17]);
out:
return str - buf;
}
EXPORT_SYMBOL_GPL(tpm_show_caps);
ssize_t tpm_show_caps_1_2(struct device * dev,
struct device_attribute * attr, char *buf)
{
u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)];
ssize_t len;
char *str = buf;
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
memcpy(data, tpm_cap, sizeof(tpm_cap));
data[TPM_CAP_IDX] = TPM_CAP_PROP;
data[TPM_CAP_SUBCAP_IDX] = <API key>;
if ((len = tpm_transmit(chip, data, sizeof(data))) <=
TPM_ERROR_SIZE) {
dev_dbg(chip->dev, "A TPM error (%d) occurred "
"attempting to determine the manufacturer\n",
be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
return 0;
}
str += sprintf(str, "Manufacturer: 0x%x\n",
be32_to_cpu(*((__be32 *) (data + <API key>))));
memcpy(data, cap_version, sizeof(cap_version));
data[CAP_VERSION_IDX] = CAP_VERSION_1_2;
if ((len = tpm_transmit(chip, data, sizeof(data))) <=
TPM_ERROR_SIZE) {
dev_err(chip->dev, "A TPM error (%d) occurred "
"attempting to determine the 1.2 version\n",
be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
goto out;
}
str += sprintf(str,
"TCG version: %d.%d\nFirmware version: %d.%d\n",
(int) data[16], (int) data[17], (int) data[18],
(int) data[19]);
out:
return str - buf;
}
EXPORT_SYMBOL_GPL(tpm_show_caps_1_2);
ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return 0;
chip->vendor.cancel(chip);
return count;
}
EXPORT_SYMBOL_GPL(tpm_store_cancel);
/*
* Device file system interface to the TPM
*/
int tpm_open(struct inode *inode, struct file *file)
{
int rc = 0, minor = iminor(inode);
struct tpm_chip *chip = NULL, *pos;
spin_lock(&driver_lock);
list_for_each_entry(pos, &tpm_chip_list, list) {
if (pos->vendor.miscdev.minor == minor) {
chip = pos;
break;
}
}
if (chip == NULL) {
rc = -ENODEV;
goto err_out;
}
if (chip->num_opens) {
dev_dbg(chip->dev, "Another process owns this TPM\n");
rc = -EBUSY;
goto err_out;
}
chip->num_opens++;
get_device(chip->dev);
spin_unlock(&driver_lock);
chip->data_buffer = kmalloc(TPM_BUFSIZE * sizeof(u8), GFP_KERNEL);
if (chip->data_buffer == NULL) {
chip->num_opens
put_device(chip->dev);
return -ENOMEM;
}
atomic_set(&chip->data_pending, 0);
file->private_data = chip;
return 0;
err_out:
spin_unlock(&driver_lock);
return rc;
}
EXPORT_SYMBOL_GPL(tpm_open);
int tpm_release(struct inode *inode, struct file *file)
{
struct tpm_chip *chip = file->private_data;
spin_lock(&driver_lock);
file->private_data = NULL;
chip->num_opens
<API key>(&chip->user_read_timer);
<API key>();
atomic_set(&chip->data_pending, 0);
put_device(chip->dev);
kfree(chip->data_buffer);
spin_unlock(&driver_lock);
return 0;
}
EXPORT_SYMBOL_GPL(tpm_release);
ssize_t tpm_write(struct file *file, const char __user *buf,
size_t size, loff_t *off)
{
struct tpm_chip *chip = file->private_data;
int in_size = size, out_size;
/* cannot perform a write until the read has cleared
either via tpm_read or a user_read_timer timeout */
while (atomic_read(&chip->data_pending) != 0)
msleep(TPM_TIMEOUT);
down(&chip->buffer_mutex);
if (in_size > TPM_BUFSIZE)
in_size = TPM_BUFSIZE;
if (copy_from_user
(chip->data_buffer, (void __user *) buf, in_size)) {
up(&chip->buffer_mutex);
return -EFAULT;
}
/* atomic tpm command send and result receive */
out_size = tpm_transmit(chip, chip->data_buffer, TPM_BUFSIZE);
atomic_set(&chip->data_pending, out_size);
up(&chip->buffer_mutex);
/* Set a timeout by which the reader must come claim the result */
mod_timer(&chip->user_read_timer, jiffies + (60 * HZ));
return in_size;
}
EXPORT_SYMBOL_GPL(tpm_write);
ssize_t tpm_read(struct file *file, char __user *buf,
size_t size, loff_t *off)
{
struct tpm_chip *chip = file->private_data;
int ret_size;
<API key>(&chip->user_read_timer);
<API key>();
ret_size = atomic_read(&chip->data_pending);
atomic_set(&chip->data_pending, 0);
if (ret_size > 0) { /* relay data */
if (size < ret_size)
ret_size = size;
down(&chip->buffer_mutex);
if (copy_to_user(buf, chip->data_buffer, ret_size))
ret_size = -EFAULT;
up(&chip->buffer_mutex);
}
return ret_size;
}
EXPORT_SYMBOL_GPL(tpm_read);
void tpm_remove_hardware(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL) {
dev_err(dev, "No device data found\n");
return;
}
spin_lock(&driver_lock);
list_del(&chip->list);
spin_unlock(&driver_lock);
dev_set_drvdata(dev, NULL);
misc_deregister(&chip->vendor.miscdev);
kfree(chip->vendor.miscdev.name);
sysfs_remove_group(&dev->kobj, chip->vendor.attr_group);
<API key>(chip->bios_dir);
clear_bit(chip->dev_num, dev_mask);
kfree(chip);
put_device(dev);
}
EXPORT_SYMBOL_GPL(tpm_remove_hardware);
static u8 savestate[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 10, /* blob length (in bytes) */
0, 0, 0, 152 /* TPM_ORD_SaveState */
};
/*
* We are about to suspend. Save the TPM state
* so that it can be restored.
*/
int tpm_pm_suspend(struct device *dev, pm_message_t pm_state)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
tpm_transmit(chip, savestate, sizeof(savestate));
return 0;
}
EXPORT_SYMBOL_GPL(tpm_pm_suspend);
/*
* Resume from a power safe. The BIOS already restored
* the TPM state.
*/
int tpm_pm_resume(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
return 0;
}
EXPORT_SYMBOL_GPL(tpm_pm_resume);
/*
* Called from tpm_<specific>.c probe function only for devices
* the driver has determined it should claim. Prior to calling
* this function the specific probe function has called pci_enable_device
* upon errant exit from this function specific probe function should call
* pci_disable_device
*/
struct tpm_chip *<API key>(struct device *dev, const struct tpm_vendor_specific
*entry)
{
#define DEVNAME_SIZE 7
char *devname;
struct tpm_chip *chip;
/* Driver specific per-device data */
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return NULL;
init_MUTEX(&chip->buffer_mutex);
init_MUTEX(&chip->tpm_mutex);
INIT_LIST_HEAD(&chip->list);
INIT_WORK(&chip->work, timeout_work, chip);
init_timer(&chip->user_read_timer);
chip->user_read_timer.function = user_reader_timeout;
chip->user_read_timer.data = (unsigned long) chip;
memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific));
chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES);
if (chip->dev_num >= TPM_NUM_DEVICES) {
dev_err(dev, "No available tpm device numbers\n");
kfree(chip);
return NULL;
} else if (chip->dev_num == 0)
chip->vendor.miscdev.minor = TPM_MINOR;
else
chip->vendor.miscdev.minor = MISC_DYNAMIC_MINOR;
set_bit(chip->dev_num, dev_mask);
devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
chip->vendor.miscdev.name = devname;
chip->vendor.miscdev.dev = dev;
chip->dev = get_device(dev);
if (misc_register(&chip->vendor.miscdev)) {
dev_err(chip->dev,
"unable to misc_register %s, minor %d\n",
chip->vendor.miscdev.name,
chip->vendor.miscdev.minor);
put_device(dev);
clear_bit(chip->dev_num, dev_mask);
kfree(chip);
kfree(devname);
return NULL;
}
spin_lock(&driver_lock);
dev_set_drvdata(dev, chip);
list_add(&chip->list, &tpm_chip_list);
spin_unlock(&driver_lock);
if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) {
list_del(&chip->list);
put_device(dev);
clear_bit(chip->dev_num, dev_mask);
kfree(chip);
kfree(devname);
return NULL;
}
chip->bios_dir = tpm_bios_log_setup(devname);
return chip;
}
EXPORT_SYMBOL_GPL(<API key>);
MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)");
MODULE_DESCRIPTION("TPM Driver");
MODULE_VERSION("2.0");
MODULE_LICENSE("GPL"); |
<?php
defined('_JEXEC') or die('Restricted access');
$align = $this->app->jbitem->getMediaAlign($item, $layout);
$tabsId = $this->app->jbstring->getId('tabs');
$bootstrap = $this->app->jbbootstrap;
$rowClass = $bootstrap->getRowClass();
?>
<?php if ($this->checkPosition('title')) : ?>
<h1 class="item-title"><?php echo $this->renderPosition('title'); ?></h1>
<?php endif; ?>
<div id="article" class="clearfix">
<div class="<?php echo $rowClass; ?>">
<div class="<?php echo $bootstrap->gridClass(12); ?>">
<?php if ($this->checkPosition('image')) : ?>
<div class="item-image">
<?php echo $this->renderPosition('image'); ?>
</div>
<?php endif; ?>
<?php if ($this->checkPosition('meta')) : ?>
<div class="<?php echo $rowClass; ?> item-metadata">
<div class="<?php echo $bootstrap->gridClass(12); ?>">
<ul class="unstyled">
<?php echo $this->renderPosition('meta', array('style' => 'list')); ?>
</ul>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php if ($this->checkPosition('related')) : ?>
<div class="<?php echo $rowClass; ?> item-related">
<div class="<?php echo $bootstrap->gridClass(12); ?>">
<?php echo $this->renderPosition('related', array(
'labelTag' => 'h4',
'style' => 'jbblock',
)); ?>
</div>
</div>
<?php endif; ?> |
package com.oracle.truffle.r.test.builtins;
import org.junit.Test;
import com.oracle.truffle.r.test.TestBase;
// Checkstyle: stop line length check
public class <API key> extends TestBase {
@Test
public void testmakeunique1() {
assertEval("argv <- list(c('A', 'B', 'C', 'D', 'E', 'F'), '.'); .Internal(make.unique(argv[[1]], argv[[2]]))");
}
@Test
public void testmakeunique2() {
assertEval("argv <- list(c('b', 'NA', 'NA'), '.'); .Internal(make.unique(argv[[1]], argv[[2]]))");
}
@Test
public void testmakeunique3() {
assertEval("argv <- list(c('1', '2', '3', '6', '7', '7', '7', '8', '8', '10', '11', '12', '12', '12', '15', '15', '16', '17', '19', '20', '21', '21', '23'), '.'); .Internal(make.unique(argv[[1]], argv[[2]]))");
}
@Test
public void testmakeunique4() {
assertEval("argv <- list(character(0), '.'); .Internal(make.unique(argv[[1]], argv[[2]]))");
}
@Test
public void testMakeUnique5() {
assertEval("{ make.unique(rep('a', 10)) }");
assertEval("{ make.unique(paste0('a', 1:10)) }");
}
@Test
public void testMakeUnique6() {
// test string sequences
assertEval("{ make.unique(paste0('a', 1:10)) }");
assertEval("{ make.unique(paste('a', 1:10, sep = '.')) }");
}
@Test
public void testMakeUnique7() {
// test clashes
assertEval("{ make.unique(c('a', 'a', 'a.2', 'a'), sep = '.') }");
assertEval("{ make.unique(c('a.1', 'a.2', 'a', 'a'), sep = '.') }");
assertEval("{ make.unique(c('a.2', 'a.2', 'a', 'a', 'a'), sep = '.') }");
assertEval("{ make.unique(c('a.2', 'a.2', 'a.3', 'a.3', 'a', 'a', 'a'), sep = '.') }");
}
@Test
public void testMakeUnique() {
assertEval("{ make.unique(\"a\") }");
assertEval("{ make.unique(character()) }");
assertEval("{ make.unique(c(\"a\", \"a\")) }");
assertEval("{ make.unique(c(\"a\", \"a\", \"a\")) }");
assertEval("{ make.unique(c(\"a\", \"a\"), \"_\") }");
assertEval("{ make.unique(1) }");
assertEval("{ make.unique(\"a\", 1) }");
assertEval("{ make.unique(\"a\", character()) }");
assertEval("{ .Internal(make.unique(c(7, 42), \".\")) }");
assertEval("{ .Internal(make.unique(NULL, \".\")) }");
assertEval("{ .Internal(make.unique(c(\"7\", \"42\"), 42)) }");
assertEval("{ .Internal(make.unique(c(\"7\", \"42\"), character())) }");
assertEval("{ .Internal(make.unique(c(\"7\", \"42\"), c(\".\", \".\"))) }");
assertEval("{ .Internal(make.unique(c(\"7\", \"42\"), NULL)) }");
}
} |
/* ScriptData
SDName: <API key>
SD%Complete: 60
SDComment: Missing Multishot, Totems, Windfury, Whirlwind
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
#include "precompiled.h"
#include "serpent_shrine.h"
enum
{
SAY_AGGRO = -1548021,
SAY_GAIN_BLESSING = -1548022,
SAY_GAIN_ABILITY1 = -1548023,
SAY_GAIN_ABILITY2 = -1548024,
SAY_GAIN_ABILITY3 = -1548025,
SAY_SLAY1 = -1548026,
SAY_SLAY2 = -1548027,
SAY_SLAY3 = -1548028,
SAY_DEATH = -1548029,
//Karathress spells
<API key> = 38441,
<API key> = 38455,
<API key> = 38452,
<API key> = 38451,
SPELL_ENRAGE = 24318,
SPELL_SEAR_NOVA = 38445,
<API key> = 38449,
//Sharkkis spells
<API key> = 29436,
<API key> = 38373,
SPELL_HURL_TRIDENT = 38374,
SPELL_MULTI_TOSS = 38366,
<API key> = 38433,
<API key> = 38431,
//Tidalvess spells
SPELL_FROST_SHOCK = 38234,
<API key> = 38236,
<API key> = 38306,
<API key> = 38304,
<API key> = 32911, // triggers spell 32912 (Windfury)
//Caribdis Spells
<API key> = 38335,
SPELL_TIDAL_SURGE = 38358, // triggers 38353 which then triggers 38357
SPELL_HEAL = 38330,
<API key> = 38337, // summons creature 22104 which uses spell 29538
MAX_ADVISORS = 3,
NPC_SEER_OLUM = 22820
};
// position for Seer Olum
const float afCoords_Olum[] = {446.78f, -542.76f, -7.54773f, 0.401581f};
static const uint32 aAdvisors[] = {NPC_SHARKKIS, NPC_TIDALVESS, NPC_CARIBDIS};
//Fathom-Lord Karathress AI
struct MANGOS_DLL_DECL <API key> : public ScriptedAI
{
<API key>(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();
}
ScriptedInstance* m_pInstance;
// timers
uint32 <API key>;
uint32 m_uiEnrageTimer;
bool <API key>;
void Reset()
{
<API key> = 10000;
m_uiEnrageTimer = 600000;
<API key> = false;
}
// TODO - unneeded workaround - the spell should be cast by adviser onto karathress; text can also be handled in their AI
// select the spell and the text based on the advisor which died
void EventAdvisorDeath(uint32 uiAdvisor)
{
if (!m_creature->isAlive())
return;
int32 iSayGainAbility = 0;
uint32 uiSpell = 0;
switch(uiAdvisor)
{
case NPC_SHARKKIS:
iSayGainAbility = SAY_GAIN_ABILITY1;
uiSpell = <API key>;
break;
case NPC_TIDALVESS:
iSayGainAbility = SAY_GAIN_ABILITY2;
uiSpell = <API key>;
break;
case NPC_CARIBDIS:
iSayGainAbility = SAY_GAIN_ABILITY3;
uiSpell = <API key>;
break;
default:
error_log("SD2: invalid advisor (id %u) for karathress!", uiAdvisor);
return;
}
DoScriptText(iSayGainAbility, m_creature);
DoCastSpellIfCan(m_creature, uiSpell);
}
void Aggro(Unit* pWho)
{
if (!m_pInstance)
return;
DoScriptText(SAY_AGGRO, m_creature);
if (Player* pPlayer = pWho-><API key>())
{
m_pInstance->SetGuid(<API key>, pPlayer->GetObjectGuid());
m_pInstance->SetData(<API key>, IN_PROGRESS);
}
}
void KilledUnit(Unit* pVictim)
{
switch(urand(0, 2))
{
case 0: DoScriptText(SAY_SLAY1, m_creature); break;
case 1: DoScriptText(SAY_SLAY2, m_creature); break;
case 2: DoScriptText(SAY_SLAY3, m_creature); break;
}
}
void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEATH, m_creature);
if (m_pInstance)
m_pInstance->SetData(<API key>, DONE);
//support for quest 10944
m_creature->SummonCreature(NPC_SEER_OLUM, afCoords_Olum[0], afCoords_Olum[1], afCoords_Olum[2], afCoords_Olum[3], <API key>, 3600000);
}
void JustReachedHome()
{
if (!m_pInstance)
return;
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
if (Creature* pAdvisor = m_pInstance-><API key>(aAdvisors[i]))
{
if (pAdvisor->getVictim())
pAdvisor->AI()->EnterEvadeMode();
else if (!pAdvisor->isAlive())
pAdvisor->Respawn();
}
}
if (m_pInstance)
m_pInstance->SetData(<API key>, FAIL);
}
void UpdateAI(const uint32 uiDiff)
{
if (!m_pInstance)
return;
//Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
//check if the event is started
if (m_pInstance->GetData(<API key>) == IN_PROGRESS)
{
if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetGuid(<API key>)))
AttackStart(pTarget);
}
return;
}
//someone evaded!
if (m_pInstance->GetData(<API key>) == FAIL)
{
EnterEvadeMode();
return;
}
//<API key>
if (<API key> < uiDiff)
{
//select a random unit other than the main tank
Unit* pTarget = m_creature-><API key>(<API key>, 1);
//if there aren't other units, cast on the tank
if (!pTarget)
pTarget = m_creature->getVictim();
if (DoCastSpellIfCan(pTarget, <API key>) == CAST_OK)
<API key> = 10000;
}
else
<API key> -= uiDiff;
//hp under 75%
if (!<API key> && m_creature->GetHealthPercent() < 75.0f)
{
for(uint8 i = 0; i < MAX_ADVISORS; ++i)
{
if (Creature* pAdvisor = m_pInstance-><API key>(aAdvisors[i]))
{
//stack max three times (one for each alive)
if (pAdvisor->isAlive())
{
pAdvisor-><API key>(false);
pAdvisor->CastSpell(m_creature, <API key>, false);
}
}
}
//yell if we now have the aura
if (m_creature->HasAura(<API key>))
DoScriptText(SAY_GAIN_BLESSING, m_creature);
<API key> = true;
}
//m_uiEnrageTimer
if (m_uiEnrageTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE) == CAST_OK)
m_uiEnrageTimer = 90000;
}
else
m_uiEnrageTimer -= uiDiff;
<API key>();
}
};
// Base AI for every advisor
struct MANGOS_DLL_DECL Advisor_Base_AI : public ScriptedAI
{
Advisor_Base_AI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
}
ScriptedInstance* m_pInstance;
void JustReachedHome()
{
if (m_pInstance && m_pInstance->GetData(<API key>) == IN_PROGRESS)
m_pInstance->SetData(<API key>, FAIL);
}
void Aggro(Unit *pWho)
{
if (!m_pInstance)
return;
if (m_pInstance->GetData(<API key>) == NOT_STARTED || m_pInstance->GetData(<API key>) == FAIL)
m_pInstance->SetData(<API key>, IN_PROGRESS);
if (Player* pPlayer = pWho-><API key>())
m_pInstance->SetGuid(<API key>, pPlayer->GetObjectGuid());
}
void JustDied(Unit* pVictim)
{
if (!m_pInstance)
return;
if (Creature* pKarathress = m_pInstance-><API key>(NPC_KARATHRESS))
{
if (<API key>* pKaraAI = dynamic_cast<<API key>*>(pKarathress->AI()))
pKaraAI->EventAdvisorDeath(m_creature->GetEntry());
}
}
};
//Fathom-Guard Sharkkis AI
struct MANGOS_DLL_DECL <API key> : public Advisor_Base_AI
{
<API key>(Creature* pCreature) : Advisor_Base_AI(pCreature) { Reset(); }
// timers
uint32 <API key>;
uint32 <API key>;
uint32 <API key>;
uint32 m_uiPetTimer;
bool m_bIsPetCheckNeeded;
void Reset()
{
<API key> = 2500;
<API key> = 20000;
<API key> = 30000;
m_uiPetTimer = 10000;
m_bIsPetCheckNeeded = true;
}
void AttackStart(Unit* pWho)
{
if (!pWho)
return;
if (m_creature->Attack(pWho, false))
{
m_creature->AddThreat(pWho);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
//using larger distance, since hunter type
m_creature->GetMotionMaster()->MoveChase(pWho, 15.0f);
}
}
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->IsPet())
{
m_uiPetTimer = 10000;
m_bIsPetCheckNeeded = false;
}
}
void <API key>(Creature* pDespawned)
{
if (pDespawned->IsPet())
m_bIsPetCheckNeeded = true;
}
void UpdateAI(const uint32 uiDiff)
{
if (!m_pInstance)
return;
//Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
//check if the event is started
if (m_pInstance->GetData(<API key>) == IN_PROGRESS)
{
if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetGuid(<API key>)))
AttackStart(pTarget);
}
return;
}
//someone evaded!
if (m_pInstance->GetData(<API key>) == FAIL)
{
EnterEvadeMode();
return;
}
//after 10 seconds: spawn pet if not exist
if (m_bIsPetCheckNeeded)
{
if (m_uiPetTimer < uiDiff)
{
if (!m_creature->GetPet())
DoCastSpellIfCan(m_creature, urand(0,1) ? <API key> : <API key>);
}
else
m_uiPetTimer -= uiDiff;
}
//<API key>
if (<API key> < uiDiff)
{
if (Unit* pTarget = m_creature-><API key>(<API key>, 0, SPELL_HURL_TRIDENT, 0))
DoCastSpellIfCan(pTarget, SPELL_HURL_TRIDENT);
<API key> = 5000;
}
else
<API key> -= uiDiff;
//<API key>
if (<API key> < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), <API key>) == CAST_OK)
<API key> = 20000;
}
else
<API key> -= uiDiff;
//<API key>
if (<API key> < uiDiff)
{
if (DoCastSpellIfCan(m_creature, <API key>) == CAST_OK)
<API key> = 30000;
}
else
<API key> -= uiDiff;
<API key>();
}
};
//Fathom-Guard Tidalvess AI
struct MANGOS_DLL_DECL <API key> : public Advisor_Base_AI
{
<API key>(Creature* pCreature) : Advisor_Base_AI(pCreature) { Reset(); }
// timers
uint32 m_uiFrostShockTimer;
void Reset()
{
m_uiFrostShockTimer = 25000;
}
void UpdateAI(const uint32 uiDiff)
{
if (!m_pInstance)
return;
//Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
//check if the event is started
if (m_pInstance->GetData(<API key>) == IN_PROGRESS)
{
if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetGuid(<API key>)))
AttackStart(pTarget);
}
return;
}
//someone evaded!
if (m_pInstance->GetData(<API key>) == FAIL)
{
EnterEvadeMode();
return;
}
//m_uiFrostShockTimer
if (m_uiFrostShockTimer < uiDiff)
{
DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_SHOCK);
m_uiFrostShockTimer = urand(25000, 30000);
}
else
m_uiFrostShockTimer -= uiDiff;
<API key>();
}
};
//Fathom-Guard Caribdis AI
struct MANGOS_DLL_DECL <API key> : public Advisor_Base_AI
{
<API key>(Creature* pCreature) : Advisor_Base_AI(pCreature) { Reset(); }
// timers
uint32 <API key>;
uint32 m_uiTidalSurgeTimer;
uint32 m_uiHealTimer;
void Reset()
{
<API key> = 35000;
m_uiTidalSurgeTimer = urand(15000, 20000);
m_uiHealTimer = 55000;
}
void UpdateAI(const uint32 uiDiff)
{
if (!m_pInstance)
return;
//Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
//check if the event is started
if (m_pInstance->GetData(<API key>) == IN_PROGRESS)
{
if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetGuid(<API key>)))
AttackStart(pTarget);
}
return;
}
//someone evaded!
if (m_pInstance->GetData(<API key>) == FAIL)
{
EnterEvadeMode();
return;
}
//<API key>
if (<API key> < uiDiff)
{
if (DoCastSpellIfCan(m_creature, <API key>) == CAST_OK)
<API key> = 30000;
}
else
<API key> -= uiDiff;
//m_uiTidalSurgeTimer
if (m_uiTidalSurgeTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_TIDAL_SURGE) == CAST_OK)
m_uiTidalSurgeTimer = urand(15000, 20000);
}
else
m_uiTidalSurgeTimer -= uiDiff;
//m_uiHealTimer
if (m_uiHealTimer < uiDiff)
{
// It can be cast on any of the mobs
Unit* pUnit = NULL;
switch (urand(0, 3))
{
case 0: pUnit = m_pInstance-><API key>(NPC_KARATHRESS); break;
case 1: pUnit = m_pInstance-><API key>(NPC_SHARKKIS); break;
case 2: pUnit = m_pInstance-><API key>(NPC_TIDALVESS); break;
case 3: pUnit = m_creature; break;
}
if (!pUnit)
pUnit = m_creature;
if (pUnit->isAlive())
{
if (DoCastSpellIfCan(pUnit, SPELL_HEAL) == CAST_OK)
m_uiHealTimer = 60000;
}
}
else
m_uiHealTimer -= uiDiff;
<API key>();
}
};
CreatureAI* <API key>(Creature* pCreature)
{
return new <API key>(pCreature);
}
CreatureAI* <API key>(Creature* pCreature)
{
return new <API key>(pCreature);
}
CreatureAI* <API key>(Creature* pCreature)
{
return new <API key>(pCreature);
}
CreatureAI* <API key>(Creature* pCreature)
{
return new <API key>(pCreature);
}
void <API key>()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "<API key>";
pNewScript->GetAI = &<API key>;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "<API key>";
pNewScript->GetAI = &<API key>;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "<API key>";
pNewScript->GetAI = &<API key>;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "<API key>";
pNewScript->GetAI = &<API key>;
pNewScript->RegisterSelf();
} |
#ifndef QGFXLINUXFB_QWS_H
#define QGFXLINUXFB_QWS_H
#ifndef QT_NO_QWS_LINUXFB
#include "qgfx_qws.h"
class QLinuxFb_Shared
{
public:
volatile int lastop;
volatile int optype;
volatile int fifocount; // Accel drivers only
volatile int fifomax;
volatile int forecol; // Foreground colour cacheing
volatile unsigned int buffer_offset; // Destination
volatile int linestep;
volatile int cliptop; // Clip rectangle
volatile int clipleft;
volatile int clipright;
volatile int clipbottom;
volatile unsigned int rop;
};
class QLinuxFbScreen : public QScreen
{
public:
QLinuxFbScreen( int display_id );
virtual ~QLinuxFbScreen();
virtual bool initDevice();
virtual bool connect( const QString &displaySpec );
virtual bool useOffscreen() { return FALSE; }
virtual void disconnect();
virtual void shutdownDevice();
virtual void setMode(int,int,int);
virtual void save();
virtual void restore();
virtual void blank(bool on);
virtual void set(unsigned int,unsigned int,unsigned int,unsigned int);
virtual uchar * cache(int,int);
virtual void uncache(uchar *);
virtual int sharedRamSize(void *);
QLinuxFb_Shared * shared;
protected:
void deleteEntry(uchar *);
bool canaccel;
int dataoffset;
int cacheStart;
static void clearCache( QScreen *instance, int );
private:
void delete_entry(int);
void insert_entry(int,int,int);
void setupOffScreen();
int fd;
int startupw;
int startuph;
int startupd;
fb_cmap *startcmap;
};
#endif
#endif // QGFXLINUXFB_QWS_H |
/* #define DEBUG */
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/clk.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <mach/at32ap700x.h>
#include <mach/portmux.h>
#include "../codecs/wm8510.h"
#include "atmel-pcm.h"
#include "atmel_ssc_dai.h"
#define MCLK_PIN GPIO_PIN_PA(30)
#define MCLK_PERIPH GPIO_PERIPH_A
/* SSC clocking data */
struct ssc_clock_data {
/* CMR div */
unsigned int cmr_div;
/* Frame period (as needed by xCMR.PERIOD) */
unsigned int period;
/* The SSC clock rate these settings where calculated for */
unsigned long ssc_rate;
};
static struct clk *_gclk0;
static struct clk *_pll0;
#define CODEC_CLK (_gclk0)
#if defined <API key>
static struct ssc_clock_data <API key>(
struct snd_pcm_hw_params *params,
struct snd_soc_dai *cpu_dai)
{
struct at32_ssc_info *ssc_p = <API key>(cpu_dai);
struct ssc_device *ssc = ssc_p->ssc;
struct ssc_clock_data cd;
unsigned int rate, width_bits, channels;
unsigned int bitrate, ssc_div;
unsigned actual_rate;
/*
* Figure out required bitrate
*/
rate = params_rate(params);
channels = params_channels(params);
width_bits = <API key>(params_format(params));
bitrate = rate * width_bits * channels;
/*
* Figure out required SSC divider and period for required bitrate
*/
cd.ssc_rate = clk_get_rate(ssc->clk);
ssc_div = cd.ssc_rate / bitrate;
cd.cmr_div = ssc_div / 2;
if (ssc_div & 1) {
/* round cmr_div up */
cd.cmr_div++;
}
cd.period = width_bits - 1;
/*
* Find actual rate, compare to requested rate
*/
actual_rate = (cd.ssc_rate / (cd.cmr_div * 2)) / (2 * (cd.period + 1));
pr_debug("playpaq_wm8510: Request rate = %u, actual rate = %u\n",
rate, actual_rate);
return cd;
}
#endif /* <API key> */
static int <API key>(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct at32_ssc_info *ssc_p = <API key>(cpu_dai);
struct ssc_device *ssc = ssc_p->ssc;
unsigned int pll_out = 0, bclk = 0, mclk_div = 0;
int ret;
/* Due to difficulties with getting the correct clocks from the AT32's
* PLL0, we're going to let the CODEC be in charge of all the clocks
*/
#if !defined <API key>
const unsigned int fmt = (SND_SOC_DAIFMT_I2S |
<API key> |
<API key>);
#else
struct ssc_clock_data cd;
const unsigned int fmt = (SND_SOC_DAIFMT_I2S |
<API key> |
<API key>);
#endif
if (ssc == NULL) {
pr_warning("<API key>: ssc is NULL!\n");
return -EINVAL;
}
/*
* Figure out PLL and BCLK dividers for WM8510
*/
switch (params_rate(params)) {
case 48000:
pll_out = 24576000;
mclk_div = WM8510_MCLKDIV_2;
bclk = WM8510_BCLKDIV_8;
break;
case 44100:
pll_out = 22579200;
mclk_div = WM8510_MCLKDIV_2;
bclk = WM8510_BCLKDIV_8;
break;
case 22050:
pll_out = 22579200;
mclk_div = WM8510_MCLKDIV_4;
bclk = WM8510_BCLKDIV_8;
break;
case 16000:
pll_out = 24576000;
mclk_div = WM8510_MCLKDIV_6;
bclk = WM8510_BCLKDIV_8;
break;
case 11025:
pll_out = 22579200;
mclk_div = WM8510_MCLKDIV_8;
bclk = WM8510_BCLKDIV_8;
break;
case 8000:
pll_out = 24576000;
mclk_div = WM8510_MCLKDIV_12;
bclk = WM8510_BCLKDIV_8;
break;
default:
pr_warning("playpaq_wm8510: Unsupported sample rate %d\n",
params_rate(params));
return -EINVAL;
}
/*
* set CPU and CODEC DAI configuration
*/
ret = snd_soc_dai_set_fmt(codec_dai, fmt);
if (ret < 0) {
pr_warning("playpaq_wm8510: "
"Failed to set CODEC DAI format (%d)\n",
ret);
return ret;
}
ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
if (ret < 0) {
pr_warning("playpaq_wm8510: "
"Failed to set CPU DAI format (%d)\n",
ret);
return ret;
}
/*
* Set CPU clock configuration
*/
#if defined <API key>
cd = <API key>(params, cpu_dai);
pr_debug("playpaq_wm8510: cmr_div = %d, period = %d\n",
cd.cmr_div, cd.period);
ret = <API key>(cpu_dai, AT32_SSC_CMR_DIV, cd.cmr_div);
if (ret < 0) {
pr_warning("playpaq_wm8510: Failed to set CPU CMR_DIV (%d)\n",
ret);
return ret;
}
ret = <API key>(cpu_dai, <API key>,
cd.period);
if (ret < 0) {
pr_warning("playpaq_wm8510: "
"Failed to set CPU transmit period (%d)\n",
ret);
return ret;
}
#endif /* <API key> */
/*
* Set CODEC clock configuration
*/
pr_debug("playpaq_wm8510: "
"pll_in = %ld, pll_out = %u, bclk = %x, mclk = %x\n",
clk_get_rate(CODEC_CLK), pll_out, bclk, mclk_div);
#if !defined <API key>
ret = <API key>(codec_dai, WM8510_BCLKDIV, bclk);
if (ret < 0) {
pr_warning
("playpaq_wm8510: Failed to set CODEC DAI BCLKDIV (%d)\n",
ret);
return ret;
}
#endif /* <API key> */
ret = snd_soc_dai_set_pll(codec_dai, 0, 0,
clk_get_rate(CODEC_CLK), pll_out);
if (ret < 0) {
pr_warning("playpaq_wm8510: Failed to set CODEC DAI PLL (%d)\n",
ret);
return ret;
}
ret = <API key>(codec_dai, WM8510_MCLKDIV, mclk_div);
if (ret < 0) {
pr_warning("playpaq_wm8510: Failed to set CODEC MCLKDIV (%d)\n",
ret);
return ret;
}
return 0;
}
static struct snd_soc_ops playpaq_wm8510_ops = {
.hw_params = <API key>,
};
static const struct snd_soc_dapm_widget <API key>[] = {
SND_SOC_DAPM_MIC("Int Mic", NULL),
SND_SOC_DAPM_SPK("Ext Spk", NULL),
};
static const struct snd_soc_dapm_route intercon[] = {
/* speaker connected to SPKOUT */
{"Ext Spk", NULL, "SPKOUTP"},
{"Ext Spk", NULL, "SPKOUTN"},
{"Mic Bias", NULL, "Int Mic"},
{"MICN", NULL, "Mic Bias"},
{"MICP", NULL, "Mic Bias"},
};
static int playpaq_wm8510_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct <API key> *dapm = &codec->dapm;
int i;
/*
* Add DAPM widgets
*/
for (i = 0; i < ARRAY_SIZE(<API key>); i++)
<API key>(dapm, &<API key>[i]);
/*
* Setup audio path interconnects
*/
<API key>(dapm, intercon, ARRAY_SIZE(intercon));
/* always connected pins */
<API key>(dapm, "Int Mic");
<API key>(dapm, "Ext Spk");
snd_soc_dapm_sync(dapm);
/* Make CSB show PLL rate */
<API key>(rtd->codec_dai, WM8510_OPCLKDIV,
WM8510_OPCLKDIV_1 | 4);
return 0;
}
static struct snd_soc_dai_link playpaq_wm8510_dai = {
.name = "WM8510",
.stream_name = "WM8510 PCM",
.cpu_dai_name= "atmel-ssc-dai.0",
.platform_name = "atmel-pcm-audio",
.codec_name = "wm8510-codec.0-0x1a",
.codec_dai_name = "wm8510-hifi",
.init = playpaq_wm8510_init,
.ops = &playpaq_wm8510_ops,
};
static struct snd_soc_card snd_soc_playpaq = {
.name = "LRS_PlayPaq_WM8510",
.dai_link = &playpaq_wm8510_dai,
.num_links = 1,
};
static struct platform_device *playpaq_snd_device;
static int __init playpaq_asoc_init(void)
{
int ret = 0;
/*
* Configure MCLK for WM8510
*/
_gclk0 = clk_get(NULL, "gclk0");
if (IS_ERR(_gclk0)) {
_gclk0 = NULL;
goto err_gclk0;
}
_pll0 = clk_get(NULL, "pll0");
if (IS_ERR(_pll0)) {
_pll0 = NULL;
goto err_pll0;
}
if (clk_set_parent(_gclk0, _pll0)) {
pr_warning("snd-soc-playpaq: "
"Failed to set PLL0 as parent for DAC clock\n");
goto err_set_clk;
}
clk_set_rate(CODEC_CLK, 12000000);
clk_enable(CODEC_CLK);
#if defined <API key>
at32_select_periph(MCLK_PIN, MCLK_PERIPH, 0);
#endif
/*
* Create and register platform device
*/
playpaq_snd_device = <API key>("soc-audio", 0);
if (playpaq_snd_device == NULL) {
ret = -ENOMEM;
goto err_device_alloc;
}
<API key>(playpaq_snd_device, &snd_soc_playpaq);
ret = platform_device_add(playpaq_snd_device);
if (ret) {
pr_warning("playpaq_wm8510: platform_device_add failed (%d)\n",
ret);
goto err_device_add;
}
return 0;
err_device_add:
if (playpaq_snd_device != NULL) {
platform_device_put(playpaq_snd_device);
playpaq_snd_device = NULL;
}
err_device_alloc:
err_set_clk:
if (_pll0 != NULL) {
clk_put(_pll0);
_pll0 = NULL;
}
err_pll0:
if (_gclk0 != NULL) {
clk_put(_gclk0);
_gclk0 = NULL;
}
return ret;
}
static void __exit playpaq_asoc_exit(void)
{
if (_gclk0 != NULL) {
clk_put(_gclk0);
_gclk0 = NULL;
}
if (_pll0 != NULL) {
clk_put(_pll0);
_pll0 = NULL;
}
#if defined <API key>
at32_free_pin(MCLK_PIN);
#endif
<API key>(playpaq_snd_device);
playpaq_snd_device = NULL;
}
module_init(playpaq_asoc_init);
module_exit(playpaq_asoc_exit);
MODULE_AUTHOR("Geoffrey Wossum <gwossum@acm.org>");
MODULE_DESCRIPTION("ASoC machine driver for LRS PlayPaq");
MODULE_LICENSE("GPL"); |
/*! \file
*
* \brief String manipulation dialplan functions
*
* \author Tilghman Lesher
* \author Anothony Minessale II
* \ingroup functions
*/
#include "asterisk.h"
<API key>(__FILE__, "$Revision$")
#include <regex.h>
#include <ctype.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/localtime.h"
#include "asterisk/test.h"
AST_THREADSTORAGE(result_buf);
AST_THREADSTORAGE(tmp_buf); |
// <API key>: GPL-2.0-or-later
#include "inputwidget.h"
#include <QLinkedList>
#include <QMessageLogContext>
#include <QRegularExpression>
#include <QSize>
#include <QString>
#include <QtGui>
#include <QtWidgets>
#include "../configuration/configuration.h"
static constexpr const int MIN_WORD_LENGTH = 3;
static const QRegularExpression s_whitespaceRx(R"(\W+)");
InputWidget::InputWidget(QWidget *const parent)
: QPlainTextEdit(parent)
{
// Size Policy
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
// Minimum Size
QFontMetrics fm(currentCharFormat().font());
setMinimumSize(
QSize(fm.averageCharWidth(),
fm.lineSpacing()
+ (static_cast<int>(document()->documentMargin()) + QFrame::frameWidth()) * 2
+ contentsMargins().top() + contentsMargins().bottom()));
setSizeIncrement(fm.averageCharWidth(), fm.lineSpacing());
// Line Wrapping
setLineWrapMode(QPlainTextEdit::NoWrap);
}
QSize InputWidget::sizeHint() const
{
return minimumSize();
}
InputWidget::~InputWidget() = default;
void InputWidget::keyPressEvent(QKeyEvent *const event)
{
const auto currentKey = event->key();
const auto currentModifiers = event->modifiers();
if (currentKey != Qt::Key_Tab) {
m_tabbing = false;
}
// REVISIT: if (<API key>) ...
if (currentModifiers == Qt::ControlModifier) {
switch (currentKey) {
case Qt::Key_H: // ^H = backspace
// REVISIT: can this be translated to backspace key?
break;
case Qt::Key_U: // ^U = delete line (clear the input)
base::clear();
return;
case Qt::Key_W: // ^W = delete word
// REVISIT: can this be translated to ctrl+shift+leftarrow + backspace?
break;
}
} else if (currentModifiers == Qt::NoModifier) {
switch (currentKey) {
/** Submit the current text */
case Qt::Key_Return:
case Qt::Key_Enter:
gotInput();
event->accept();
return;
/** Key bindings for word history and tab completion */
case Qt::Key_Up:
case Qt::Key_Down:
case Qt::Key_Tab:
if (tryHistory(currentKey)) {
event->accept();
return;
}
break;
}
} else if (currentModifiers == Qt::KeypadModifier) {
if constexpr (CURRENT_PLATFORM == PlatformEnum::Mac) {
// NOTE: MacOS does not differentiate between arrow keys and the keypad keys
// and as such we disable keypad movement functionality in favor of history
switch (currentKey) {
case Qt::Key_Up:
case Qt::Key_Down:
case Qt::Key_Tab:
if (tryHistory(currentKey)) {
event->accept();
return;
}
break;
}
} else {
switch (currentKey) {
case Qt::Key_Up:
case Qt::Key_Down:
case Qt::Key_Left:
case Qt::Key_Right:
case Qt::Key_PageUp:
case Qt::Key_PageDown:
case Qt::Key_Clear: // Numpad 5
case Qt::Key_Home:
case Qt::Key_End:
keypadMovement(currentKey);
event->accept();
return;
}
}
}
// All other input
base::keyPressEvent(event);
}
void InputWidget::keypadMovement(const int key)
{
switch (key) {
case Qt::Key_Up:
sendUserInput("north");
break;
case Qt::Key_Down:
sendUserInput("south");
break;
case Qt::Key_Left:
sendUserInput("west");
break;
case Qt::Key_Right:
sendUserInput("east");
break;
case Qt::Key_PageUp:
sendUserInput("up");
break;
case Qt::Key_PageDown:
sendUserInput("down");
break;
case Qt::Key_Clear: // Numpad 5
sendUserInput("exits");
break;
case Qt::Key_Home:
sendUserInput("open exit");
break;
case Qt::Key_End:
sendUserInput("close exit");
break;
case Qt::Key_Insert:
sendUserInput("flee");
break;
case Qt::Key_Delete:
case Qt::Key_Plus:
case Qt::Key_Minus:
case Qt::Key_Slash:
case Qt::Key_Asterisk:
default:
qDebug() << "! Unknown keypad movement" << key;
}
}
bool InputWidget::tryHistory(const int key)
{
QTextCursor cursor = textCursor();
switch (key) {
case Qt::Key_Up:
if (!cursor.movePosition(QTextCursor::Up, QTextCursor::MoveAnchor)) {
// At the top of the document
backwardHistory();
return true;
}
break;
case Qt::Key_Down:
if (!cursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor)) {
// At the end of the document
forwardHistory();
return true;
}
break;
case Qt::Key_Tab:
tabComplete();
return true;
}
return false;
}
void InputWidget::gotInput()
{
QString input = toPlainText();
if (getConfig().integratedClient.clearInputOnEnter) {
clear();
} else {
selectAll();
}
sendUserInput(input);
m_inputHistory.addInputLine(input);
m_tabHistory.addInputLine(input);
}
void InputHistory::addInputLine(const QString &string)
{
if (!string.isEmpty() && (empty() || back() != string)) {
// Add to line history if it is a new entry
push_front(string);
}
// Trim line history
if (static_cast<int>(size()) > getConfig().integratedClient.linesOfInputHistory) {
pop_back();
}
// Reset the iterator
m_iterator = begin();
}
void TabHistory::addInputLine(const QString &string)
{
QStringList list = string.split(s_whitespaceRx, QString::SkipEmptyParts);
for (const QString &word : list) {
if (word.length() > MIN_WORD_LENGTH) {
// Adding this word to the dictionary
push_back(word);
// Trim dictionary
if (static_cast<int>(size())
> getConfig().integratedClient.<API key>) {
pop_front();
}
}
}
// Reset the iterator
m_iterator = begin();
}
void InputWidget::forwardHistory()
{
clear();
if (m_inputHistory.atFront()) {
emit sig_showMessage("Reached beginning of input history", 1000);
return;
}
if (m_inputHistory.atEnd())
m_inputHistory.backward();
if (!m_inputHistory.atFront()) {
m_inputHistory.backward();
insertPlainText(m_inputHistory.value());
}
}
void InputWidget::backwardHistory()
{
if (m_inputHistory.atEnd()) {
emit sig_showMessage("Reached end of input history", 1000);
return;
}
clear();
insertPlainText(m_inputHistory.value());
if (!m_inputHistory.atEnd())
m_inputHistory.forward();
}
void InputWidget::tabComplete()
{
if (m_tabHistory.empty())
return;
QTextCursor current = textCursor();
current.select(QTextCursor::WordUnderCursor);
if (!m_tabbing) {
m_tabFragment = current.selectedText();
m_tabHistory.reset();
m_tabbing = true;
}
// If we reach the end then loop back to the beginning and clear the selected text again
if (m_tabHistory.atEnd()) {
textCursor().removeSelectedText();
m_tabHistory.reset();
return;
}
// Iterate through all previous words
while (!m_tabHistory.atEnd()) {
// TODO(nschimme): Utilize a trie and search?
const auto &word = m_tabHistory.value();
if (!word.startsWith(m_tabFragment)) {
// Try the next word
m_tabHistory.forward();
continue;
}
// Found a previous word to complete to
current.insertText(word);
if (current.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor)) {
current.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor, m_tabFragment.size());
setTextCursor(current);
}
m_tabHistory.forward();
break;
}
} |
<?php
namespace Magento\SalesRule\Test\Unit\Model\Service;
/**
* Class <API key>
*
* @SuppressWarnings(PHPMD.<API key>)
*/
class <API key> extends \PHPUnit\Framework\TestCase
{
/**
* @var \Magento\SalesRule\Model\Service\<API key>
*/
protected $model;
/**
* @var \<API key>
*/
protected $couponFactory;
/**
* @var \<API key>
*/
protected $ruleFactory;
/**
* @var \<API key>
*/
protected $collectionFactory;
/**
* @var \<API key>
*/
protected $couponGenerator;
/**
* @var \<API key>
*/
protected $resourceModel;
/**
* @var \<API key>
*/
protected $<API key>;
/**
* @var \<API key>
*/
protected $<API key>;
/**
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
*/
protected $objectManager;
/**
* Setup the test
*/
protected function setUp()
{
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$className = \Magento\SalesRule\Model\CouponFactory::class;
$this->couponFactory = $this->createMock($className);
$className = \Magento\SalesRule\Model\RuleFactory::class;
$this->ruleFactory = $this->createPartialMock($className, ['create']);
$className = \Magento\SalesRule\Model\ResourceModel\Coupon\CollectionFactory::class;
$this->collectionFactory = $this->createPartialMock($className, ['create']);
$className = \Magento\SalesRule\Model\Coupon\Massgenerator::class;
$this->couponGenerator = $this->createMock($className);
$className = \Magento\SalesRule\Model\Spi\<API key>::class;
$this->resourceModel = $this->createMock($className);
$className = \Magento\SalesRule\Api\Data\<API key>::class;
$this-><API key> = $this->createMock($className);
$className = \Magento\SalesRule\Api\Data\<API key>::class;
$this-><API key> = $this->createPartialMock($className, ['create']);
$this-><API key>
->expects($this->any())
->method('create')
->willReturn($this-><API key>);
$this->model = $this->objectManager->getObject(
\Magento\SalesRule\Model\Service\<API key>::class,
[
'couponFactory' => $this->couponFactory,
'ruleFactory' => $this->ruleFactory,
'collectionFactory' => $this->collectionFactory,
'couponGenerator' => $this->couponGenerator,
'resourceModel' => $this->resourceModel,
'<API key>' => $this-><API key>,
]
);
}
/**
* test Generate
*/
public function testGenerate()
{
$className = \Magento\SalesRule\Model\Data\<API key>::class;
/**
* @var \Magento\SalesRule\Api\Data\<API key> $couponSpec
*/
$couponSpec = $this->createPartialMock(
$className,
['getRuleId', 'getQuantity', 'getFormat', 'getLength', 'setData']
);
$couponSpec->expects($this->atLeastOnce())->method('getRuleId')->willReturn(1);
$couponSpec->expects($this->once())->method('getQuantity')->willReturn(1);
$couponSpec->expects($this->once())->method('getFormat')->willReturn('num');
$couponSpec->expects($this->once())->method('getLength')->willReturn(1);
$this->couponGenerator->expects($this->atLeastOnce())->method('setData');
$this->couponGenerator->expects($this->once())->method('validateData')->willReturn(true);
$this->couponGenerator->expects($this->once())->method('generatePool');
$this->couponGenerator->expects($this->once())->method('getGeneratedCodes')->willReturn([]);
/**
* @var \Magento\SalesRule\Model\Rule $rule
*/
$rule = $this->createPartialMock(
\Magento\SalesRule\Model\Rule::class,
['load', 'getRuleId', 'getToDate', 'getUsesPerCoupon', 'getUsesPerCustomer', '<API key>']
);
$rule->expects($this->any())->method('load')->willReturnSelf();
$rule->expects($this->any())->method('getRuleId')->willReturn(1);
$rule->expects($this->any())->method('getToDate')->willReturn('2015-07-31 00:00:00');
$rule->expects($this->any())->method('getUsesPerCoupon')->willReturn(20);
$rule->expects($this->any())->method('getUsesPerCustomer')->willReturn(5);
$rule->expects($this->any())->method('<API key>')->willReturn(true);
$this->ruleFactory->expects($this->any())->method('create')->willReturn($rule);
$result = $this->model->generate($couponSpec);
$this->assertEquals([], $result);
}
/**
* test Generate with validation Exception
* @throws \Magento\Framework\Exception\InputException
*/
public function <API key>()
{
$className = \Magento\SalesRule\Api\Data\<API key>::class;
/**
* @var \Magento\SalesRule\Api\Data\<API key> $couponSpec
*/
$couponSpec = $this->createMock($className);
/**
* @var \Magento\SalesRule\Model\Rule $rule
*/
$rule = $this->createPartialMock(\Magento\SalesRule\Model\Rule::class, ['load', 'getRuleId']);
$rule->expects($this->any())->method('load')->willReturnSelf();
$rule->expects($this->any())->method('getRuleId')->willReturn(1);
$this->ruleFactory->expects($this->any())->method('create')->willReturn($rule);
$this->couponGenerator->expects($this->once())->method('validateData')
->willThrowException(new \Magento\Framework\Exception\InputException());
$this->expectException(\Magento\Framework\Exception\InputException::class);
$this->model->generate($couponSpec);
}
/**
* test Generate with localized Exception
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function <API key>()
{
$className = \Magento\SalesRule\Api\Data\<API key>::class;
/**
* @var \Magento\SalesRule\Api\Data\<API key> $couponSpec
*/
$couponSpec = $this->createMock($className);
/**
* @var \Magento\SalesRule\Model\Rule $rule
*/
$rule = $this->createPartialMock(
\Magento\SalesRule\Model\Rule::class,
['load', 'getRuleId', '<API key>']
);
$rule->expects($this->any())->method('load')->willReturnSelf();
$rule->expects($this->any())->method('getRuleId')->willReturn(1);
$rule->expects($this->once())->method('<API key>')
->willThrowException(
new \Magento\Framework\Exception\LocalizedException(
__('Error occurred when generating coupons: %1', '1')
)
);
$this->ruleFactory->expects($this->any())->method('create')->willReturn($rule);
$this->couponGenerator->expects($this->once())->method('validateData')->willReturn(true);
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
$this->model->generate($couponSpec);
}
/**
* test Generate with localized Exception
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function <API key>()
{
$className = \Magento\SalesRule\Api\Data\<API key>::class;
/**
* @var \Magento\SalesRule\Api\Data\<API key> $couponSpec
*/
$couponSpec = $this->createMock($className);
/**
* @var \Magento\SalesRule\Model\Rule $rule
*/
$rule = $this->createPartialMock(\Magento\SalesRule\Model\Rule::class, ['load', 'getRuleId']);
$rule->expects($this->any())->method('load')->willReturnSelf();
$rule->expects($this->any())->method('getRuleId')->willReturn(false);
$this->ruleFactory->expects($this->any())->method('create')->willReturn($rule);
$this->couponGenerator->expects($this->once())->method('validateData')->willReturn(true);
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
$this->model->generate($couponSpec);
}
/**
* test DeleteByIds with Ignore non existing
*/
public function <API key>()
{
$ids = [1, 2, 3];
$className = \Magento\SalesRule\Model\Coupon::class;
/**
* @var \Magento\SalesRule\Model\Coupon $coupon
*/
$coupon = $this->createMock($className);
$coupon->expects($this->exactly(3))->method('delete');
$className = \Magento\SalesRule\Model\ResourceModel\Coupon\Collection::class;
/**
* @var \Magento\SalesRule\Model\ResourceModel\Coupon\Collection $couponCollection
*/
$couponCollection = $this->createMock($className);
$couponCollection->expects($this->once())->method('addFieldToFilter')->willReturnSelf();
$couponCollection->expects($this->once())->method('getItems')->willReturn([$coupon, $coupon, $coupon]);
$this->collectionFactory->expects($this->once())->method('create')->willReturn($couponCollection);
$this-><API key>->expects($this->once())->method('setFailedItems')->willReturnSelf();
$this-><API key>->expects($this->once())->method('setMissingItems')->willReturnSelf();
$this->model->deleteByIds($ids, true);
}
/**
* test DeleteByIds with not Ignore non existing
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function <API key>()
{
$ids = [1, 2, 3];
$className = \Magento\SalesRule\Model\ResourceModel\Coupon\Collection::class;
/**
* @var \Magento\SalesRule\Model\ResourceModel\Coupon\Collection $couponCollection
*/
$couponCollection = $this->createMock($className);
$couponCollection->expects($this->once())->method('addFieldToFilter')->willReturnSelf();
$this->collectionFactory->expects($this->once())->method('create')->willReturn($couponCollection);
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
$this->model->deleteByIds($ids, false);
}
/**
* test DeleteByIds with not Ignore non existing
*/
public function <API key>()
{
$ids = [1, 2, 3];
/**
* @var \Magento\SalesRule\Model\Coupon $coupon
*/
$className = \Magento\SalesRule\Model\Coupon::class;
$coupon = $this->createMock($className);
$coupon->expects($this->any())->method('delete')->willThrowException(new \Exception());
/**
* @var \Magento\SalesRule\Model\ResourceModel\Coupon\Collection $couponCollection
*/
$className = \Magento\SalesRule\Model\ResourceModel\Coupon\Collection::class;
$couponCollection = $this->createMock($className);
$couponCollection->expects($this->once())->method('addFieldToFilter')->willReturnSelf();
$couponCollection->expects($this->once())->method('getItems')->willReturn([$coupon, $coupon, $coupon]);
$this->collectionFactory->expects($this->once())->method('create')->willReturn($couponCollection);
$this-><API key>->expects($this->once())->method('setFailedItems')->willReturnSelf();
$this-><API key>->expects($this->once())->method('setMissingItems')->willReturnSelf();
$this->model->deleteByIds($ids, true);
}
/**
* test DeleteByCodes
*/
public function testDeleteByCodes()
{
$ids = [1, 2, 3];
$className = \Magento\SalesRule\Model\Coupon::class;
/**
* @var \Magento\SalesRule\Model\Coupon $coupon
*/
$coupon = $this->createMock($className);
$coupon->expects($this->exactly(3))->method('delete');
$className = \Magento\SalesRule\Model\ResourceModel\Coupon\Collection::class;
/**
* @var \Magento\SalesRule\Model\ResourceModel\Coupon\Collection $couponCollection
*/
$couponCollection = $this->createMock($className);
$couponCollection->expects($this->once())->method('addFieldToFilter')->willReturnSelf();
$couponCollection->expects($this->once())->method('getItems')->willReturn([$coupon, $coupon, $coupon]);
$this->collectionFactory->expects($this->once())->method('create')->willReturn($couponCollection);
$this-><API key>->expects($this->once())->method('setFailedItems')->willReturnSelf();
$this-><API key>->expects($this->once())->method('setMissingItems')->willReturnSelf();
$this->model->deleteByCodes($ids, true);
}
} |
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include "net_driver.h"
#include "bitfield.h"
#include "efx.h"
#include "nic.h"
#include "regs.h"
#include "io.h"
#include "workarounds.h"
/* This is set to 16 for a good reason. In summary, if larger than
* 16, the descriptor cache holds more than a default socket
* buffer's worth of packets (for UDP we can only have at most one
* socket buffer's worth outstanding). This combined with the fact
* that we only get 1 TX event per descriptor cache means the NIC
* goes idle.
*/
#define TX_DC_ENTRIES 16
#define TX_DC_ENTRIES_ORDER 1
#define RX_DC_ENTRIES 64
#define RX_DC_ENTRIES_ORDER 3
/* If EFX_MAX_INT_ERRORS internal errors occur within
* <API key> seconds, we consider the NIC broken and
* disable it.
*/
#define <API key> 3600
#define EFX_MAX_INT_ERRORS 5
/* We poll for events every FLUSH_INTERVAL ms, and check FLUSH_POLL_COUNT times
*/
#define EFX_FLUSH_INTERVAL 10
#define <API key> 100
/* Size and alignment of special buffers (4KB) */
#define EFX_BUF_SIZE 4096
/* Depth of RX flush request fifo */
#define EFX_RX_FLUSH_COUNT 4
/* Generated event code for <API key>() */
#define <API key>(_channel) \
(0x00010100 + (_channel)->channel)
/* Generated event code for <API key>() */
#define <API key>(_channel) \
(0x00010200 + (_channel)->channel)
static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value,
unsigned int index)
{
efx_sram_writeq(efx, efx->membase + efx->type->buf_tbl_base,
value, index);
}
/* Read the current event from the event queue */
static inline efx_qword_t *efx_event(struct efx_channel *channel,
unsigned int index)
{
return ((efx_qword_t *) (channel->eventq.addr)) +
(index & channel->eventq_mask);
}
/* See if an event is present
*
* We check both the high and low dword of the event for all ones. We
* wrote all ones when we cleared the event, and no valid event can
* have all ones in either its high or low dwords. This approach is
* robust against reordering.
*
* Note that using a single 64-bit comparison is incorrect; even
* though the CPU read will be atomic, the DMA write may not be.
*/
static inline int efx_event_present(efx_qword_t *event)
{
return !(<API key>(event->dword[0]) |
<API key>(event->dword[1]));
}
static bool <API key>(const efx_oword_t *a, const efx_oword_t *b,
const efx_oword_t *mask)
{
return ((a->u64[0] ^ b->u64[0]) & mask->u64[0]) ||
((a->u64[1] ^ b->u64[1]) & mask->u64[1]);
}
int <API key>(struct efx_nic *efx,
const struct <API key> *regs,
size_t n_regs)
{
unsigned address = 0, i, j;
efx_oword_t mask, imask, original, reg, buf;
/* Falcon should be in loopback to isolate the XMAC from the PHY */
WARN_ON(!LOOPBACK_INTERNAL(efx));
for (i = 0; i < n_regs; ++i) {
address = regs[i].address;
mask = imask = regs[i].mask;
EFX_INVERT_OWORD(imask);
efx_reado(efx, &original, address);
/* bit sweep on and off */
for (j = 0; j < 128; j++) {
if (!EFX_EXTRACT_OWORD32(mask, j, j))
continue;
/* Test this testable bit can be set in isolation */
EFX_AND_OWORD(reg, original, mask);
EFX_SET_OWORD32(reg, j, j, 1);
efx_writeo(efx, ®, address);
efx_reado(efx, &buf, address);
if (<API key>(®, &buf, &mask))
goto fail;
/* Test this testable bit can be cleared in isolation */
EFX_OR_OWORD(reg, original, mask);
EFX_SET_OWORD32(reg, j, j, 0);
efx_writeo(efx, ®, address);
efx_reado(efx, &buf, address);
if (<API key>(®, &buf, &mask))
goto fail;
}
efx_writeo(efx, &original, address);
}
return 0;
fail:
netif_err(efx, hw, efx->net_dev,
"wrote "EFX_OWORD_FMT" read "EFX_OWORD_FMT
" at address 0x%x mask "EFX_OWORD_FMT"\n", EFX_OWORD_VAL(reg),
EFX_OWORD_VAL(buf), address, EFX_OWORD_VAL(mask));
return -EIO;
}
/*
* Initialise a special buffer
*
* This will define a buffer (previously allocated via
* <API key>()) in the buffer table, allowing
* it to be used for event queues, descriptor rings etc.
*/
static void
<API key>(struct efx_nic *efx, struct efx_special_buffer *buffer)
{
efx_qword_t buf_desc;
int index;
dma_addr_t dma_addr;
int i;
EFX_BUG_ON_PARANOID(!buffer->addr);
/* Write buffer descriptors to NIC */
for (i = 0; i < buffer->entries; i++) {
index = buffer->index + i;
dma_addr = buffer->dma_addr + (i * 4096);
netif_dbg(efx, probe, efx->net_dev,
"mapping special buffer %d at %llx\n",
index, (unsigned long long)dma_addr);
<API key>(buf_desc,
<API key>, 0,
FRF_AZ_BUF_ADR_FBUF, dma_addr >> 12,
<API key>, 0);
efx_write_buf_tbl(efx, &buf_desc, index);
}
}
/* Unmaps a buffer and clears the buffer table entries */
static void
<API key>(struct efx_nic *efx, struct efx_special_buffer *buffer)
{
efx_oword_t buf_tbl_upd;
unsigned int start = buffer->index;
unsigned int end = (buffer->index + buffer->entries - 1);
if (!buffer->entries)
return;
netif_dbg(efx, hw, efx->net_dev, "unmapping special buffers %d-%d\n",
buffer->index, buffer->index + buffer->entries - 1);
<API key>(buf_tbl_upd,
FRF_AZ_BUF_UPD_CMD, 0,
FRF_AZ_BUF_CLR_CMD, 1,
<API key>, end,
<API key>, start);
efx_writeo(efx, &buf_tbl_upd, FR_AZ_BUF_TBL_UPD);
}
/*
* Allocate a new special buffer
*
* This allocates memory for a new buffer, clears it and allocates a
* new buffer ID range. It does not write into the buffer table.
*
* This call will allocate 4KB buffers, since 8KB buffers can't be
* used for event queues and descriptor rings.
*/
static int <API key>(struct efx_nic *efx,
struct efx_special_buffer *buffer,
unsigned int len)
{
len = ALIGN(len, EFX_BUF_SIZE);
buffer->addr = dma_alloc_coherent(&efx->pci_dev->dev, len,
&buffer->dma_addr, GFP_KERNEL);
if (!buffer->addr)
return -ENOMEM;
buffer->len = len;
buffer->entries = len / EFX_BUF_SIZE;
BUG_ON(buffer->dma_addr & (EFX_BUF_SIZE - 1));
/* All zeros is a potentially valid event so memset to 0xff */
memset(buffer->addr, 0xff, len);
/* Select new buffer ID */
buffer->index = efx->next_buffer_table;
efx->next_buffer_table += buffer->entries;
netif_dbg(efx, probe, efx->net_dev,
"allocating special buffers %d-%d at %llx+%x "
"(virt %p phys %llx)\n", buffer->index,
buffer->index + buffer->entries - 1,
(u64)buffer->dma_addr, len,
buffer->addr, (u64)virt_to_phys(buffer->addr));
return 0;
}
static void
<API key>(struct efx_nic *efx, struct efx_special_buffer *buffer)
{
if (!buffer->addr)
return;
netif_dbg(efx, hw, efx->net_dev,
"deallocating special buffers %d-%d at %llx+%x "
"(virt %p phys %llx)\n", buffer->index,
buffer->index + buffer->entries - 1,
(u64)buffer->dma_addr, buffer->len,
buffer->addr, (u64)virt_to_phys(buffer->addr));
dma_free_coherent(&efx->pci_dev->dev, buffer->len, buffer->addr,
buffer->dma_addr);
buffer->addr = NULL;
buffer->entries = 0;
}
int <API key>(struct efx_nic *efx, struct efx_buffer *buffer,
unsigned int len)
{
buffer->addr = <API key>(efx->pci_dev, len,
&buffer->dma_addr);
if (!buffer->addr)
return -ENOMEM;
buffer->len = len;
memset(buffer->addr, 0, len);
return 0;
}
void efx_nic_free_buffer(struct efx_nic *efx, struct efx_buffer *buffer)
{
if (buffer->addr) {
pci_free_consistent(efx->pci_dev, buffer->len,
buffer->addr, buffer->dma_addr);
buffer->addr = NULL;
}
}
/* Returns a pointer to the specified transmit descriptor in the TX
* descriptor queue belonging to the specified channel.
*/
static inline efx_qword_t *
efx_tx_desc(struct efx_tx_queue *tx_queue, unsigned int index)
{
return ((efx_qword_t *) (tx_queue->txd.addr)) + index;
}
/* This writes to the TX_DESC_WPTR; write pointer for TX descriptor ring */
static inline void efx_notify_tx_desc(struct efx_tx_queue *tx_queue)
{
unsigned write_ptr;
efx_dword_t reg;
write_ptr = tx_queue->write_count & tx_queue->ptr_mask;
<API key>(reg, <API key>, write_ptr);
efx_writed_page(tx_queue->efx, ®,
<API key>, tx_queue->queue);
}
/* Write pointer and first descriptor for TX descriptor ring */
static inline void efx_push_tx_desc(struct efx_tx_queue *tx_queue,
const efx_qword_t *txd)
{
unsigned write_ptr;
efx_oword_t reg;
BUILD_BUG_ON(FRF_AZ_TX_DESC_LBN != 0);
BUILD_BUG_ON(<API key> != <API key>);
write_ptr = tx_queue->write_count & tx_queue->ptr_mask;
<API key>(reg, <API key>, true,
FRF_AZ_TX_DESC_WPTR, write_ptr);
reg.qword[0] = *txd;
efx_writeo_page(tx_queue->efx, ®,
<API key>, tx_queue->queue);
}
static inline bool
<API key>(struct efx_tx_queue *tx_queue, unsigned int write_count)
{
unsigned empty_read_count = ACCESS_ONCE(tx_queue->empty_read_count);
if (empty_read_count == 0)
return false;
tx_queue->empty_read_count = 0;
return ((empty_read_count ^ write_count) & ~<API key>) == 0
&& tx_queue->write_count - write_count == 1;
}
/* For each entry inserted into the software descriptor ring, create a
* descriptor in the hardware TX descriptor ring (in host memory), and
* write a doorbell.
*/
void <API key>(struct efx_tx_queue *tx_queue)
{
struct efx_tx_buffer *buffer;
efx_qword_t *txd;
unsigned write_ptr;
unsigned old_write_count = tx_queue->write_count;
BUG_ON(tx_queue->write_count == tx_queue->insert_count);
do {
write_ptr = tx_queue->write_count & tx_queue->ptr_mask;
buffer = &tx_queue->buffer[write_ptr];
txd = efx_tx_desc(tx_queue, write_ptr);
++tx_queue->write_count;
/* Create TX descriptor ring entry */
<API key>(*txd,
FSF_AZ_TX_KER_CONT, buffer->continuation,
<API key>, buffer->len,
<API key>, 0,
<API key>, buffer->dma_addr);
} while (tx_queue->write_count != tx_queue->insert_count);
wmb(); /* Ensure descriptors are written before they are fetched */
if (<API key>(tx_queue, old_write_count)) {
txd = efx_tx_desc(tx_queue,
old_write_count & tx_queue->ptr_mask);
efx_push_tx_desc(tx_queue, txd);
++tx_queue->pushes;
} else {
efx_notify_tx_desc(tx_queue);
}
}
/* Allocate hardware resources for a TX queue */
int efx_nic_probe_tx(struct efx_tx_queue *tx_queue)
{
struct efx_nic *efx = tx_queue->efx;
unsigned entries;
entries = tx_queue->ptr_mask + 1;
return <API key>(efx, &tx_queue->txd,
entries * sizeof(efx_qword_t));
}
void efx_nic_init_tx(struct efx_tx_queue *tx_queue)
{
struct efx_nic *efx = tx_queue->efx;
efx_oword_t reg;
tx_queue->flushed = FLUSH_NONE;
/* Pin TX descriptor ring */
<API key>(efx, &tx_queue->txd);
/* Push TX descriptor ring to card */
<API key>(reg,
FRF_AZ_TX_DESCQ_EN, 1,
<API key>, 0,
<API key>, 0,
<API key>, tx_queue->txd.index,
<API key>,
tx_queue->channel->channel,
<API key>, 0,
<API key>, tx_queue->queue,
<API key>,
__ffs(tx_queue->txd.entries),
<API key>, 0,
<API key>, 1);
if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) {
int csum = tx_queue->queue & <API key>;
EFX_SET_OWORD_FIELD(reg, <API key>, !csum);
EFX_SET_OWORD_FIELD(reg, <API key>,
!csum);
}
efx_writeo_table(efx, ®, efx->type->txd_ptr_tbl_base,
tx_queue->queue);
if (efx_nic_rev(efx) < EFX_REV_FALCON_B0) {
/* Only 128 bits in this register */
BUILD_BUG_ON(EFX_MAX_TX_QUEUES > 128);
efx_reado(efx, ®, FR_AA_TX_CHKSM_CFG);
if (tx_queue->queue & <API key>)
clear_bit_le(tx_queue->queue, (void *)®);
else
set_bit_le(tx_queue->queue, (void *)®);
efx_writeo(efx, ®, FR_AA_TX_CHKSM_CFG);
}
if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) {
<API key>(reg,
FRF_BZ_TX_PACE,
(tx_queue->queue & <API key>) ?
FFE_BZ_TX_PACE_OFF :
<API key>);
efx_writeo_table(efx, ®, FR_BZ_TX_PACE_TBL,
tx_queue->queue);
}
}
static void efx_flush_tx_queue(struct efx_tx_queue *tx_queue)
{
struct efx_nic *efx = tx_queue->efx;
efx_oword_t tx_flush_descq;
tx_queue->flushed = FLUSH_PENDING;
/* Post a flush command */
<API key>(tx_flush_descq,
<API key>, 1,
<API key>, tx_queue->queue);
efx_writeo(efx, &tx_flush_descq, <API key>);
}
void efx_nic_fini_tx(struct efx_tx_queue *tx_queue)
{
struct efx_nic *efx = tx_queue->efx;
efx_oword_t tx_desc_ptr;
/* The queue should have been flushed */
WARN_ON(tx_queue->flushed != FLUSH_DONE);
/* Remove TX descriptor ring from card */
EFX_ZERO_OWORD(tx_desc_ptr);
efx_writeo_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base,
tx_queue->queue);
/* Unpin TX descriptor ring */
<API key>(efx, &tx_queue->txd);
}
/* Free buffers backing TX queue */
void efx_nic_remove_tx(struct efx_tx_queue *tx_queue)
{
<API key>(tx_queue->efx, &tx_queue->txd);
}
/* Returns a pointer to the specified descriptor in the RX descriptor queue */
static inline efx_qword_t *
efx_rx_desc(struct efx_rx_queue *rx_queue, unsigned int index)
{
return ((efx_qword_t *) (rx_queue->rxd.addr)) + index;
}
/* This creates an entry in the RX descriptor queue */
static inline void
efx_build_rx_desc(struct efx_rx_queue *rx_queue, unsigned index)
{
struct efx_rx_buffer *rx_buf;
efx_qword_t *rxd;
rxd = efx_rx_desc(rx_queue, index);
rx_buf = efx_rx_buffer(rx_queue, index);
<API key>(*rxd,
<API key>,
rx_buf->len -
rx_queue->efx->type->rx_buffer_padding,
<API key>, 0,
<API key>, rx_buf->dma_addr);
}
/* This writes to the RX_DESC_WPTR register for the specified receive
* descriptor ring.
*/
void <API key>(struct efx_rx_queue *rx_queue)
{
struct efx_nic *efx = rx_queue->efx;
efx_dword_t reg;
unsigned write_ptr;
while (rx_queue->notified_count != rx_queue->added_count) {
efx_build_rx_desc(
rx_queue,
rx_queue->notified_count & rx_queue->ptr_mask);
++rx_queue->notified_count;
}
wmb();
write_ptr = rx_queue->added_count & rx_queue->ptr_mask;
<API key>(reg, <API key>, write_ptr);
efx_writed_page(efx, ®, <API key>,
efx_rx_queue_index(rx_queue));
}
int efx_nic_probe_rx(struct efx_rx_queue *rx_queue)
{
struct efx_nic *efx = rx_queue->efx;
unsigned entries;
entries = rx_queue->ptr_mask + 1;
return <API key>(efx, &rx_queue->rxd,
entries * sizeof(efx_qword_t));
}
void efx_nic_init_rx(struct efx_rx_queue *rx_queue)
{
efx_oword_t rx_desc_ptr;
struct efx_nic *efx = rx_queue->efx;
bool is_b0 = efx_nic_rev(efx) >= EFX_REV_FALCON_B0;
bool iscsi_digest_en = is_b0;
netif_dbg(efx, hw, efx->net_dev,
"RX queue %d ring in special buffers %d-%d\n",
efx_rx_queue_index(rx_queue), rx_queue->rxd.index,
rx_queue->rxd.index + rx_queue->rxd.entries - 1);
rx_queue->flushed = FLUSH_NONE;
/* Pin RX descriptor ring */
<API key>(efx, &rx_queue->rxd);
/* Push RX descriptor ring to card */
<API key>(rx_desc_ptr,
<API key>, iscsi_digest_en,
<API key>, iscsi_digest_en,
<API key>, rx_queue->rxd.index,
<API key>,
<API key>(rx_queue)->channel,
<API key>, 0,
<API key>,
efx_rx_queue_index(rx_queue),
<API key>,
__ffs(rx_queue->rxd.entries),
<API key>, 0 /* kernel queue */ ,
/* For >=B0 this is scatter so disable */
<API key>, !is_b0,
FRF_AZ_RX_DESCQ_EN, 1);
efx_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base,
efx_rx_queue_index(rx_queue));
}
static void efx_flush_rx_queue(struct efx_rx_queue *rx_queue)
{
struct efx_nic *efx = rx_queue->efx;
efx_oword_t rx_flush_descq;
rx_queue->flushed = FLUSH_PENDING;
/* Post a flush command */
<API key>(rx_flush_descq,
<API key>, 1,
<API key>,
efx_rx_queue_index(rx_queue));
efx_writeo(efx, &rx_flush_descq, <API key>);
}
void efx_nic_fini_rx(struct efx_rx_queue *rx_queue)
{
efx_oword_t rx_desc_ptr;
struct efx_nic *efx = rx_queue->efx;
/* The queue should already have been flushed */
WARN_ON(rx_queue->flushed != FLUSH_DONE);
/* Remove RX descriptor ring from card */
EFX_ZERO_OWORD(rx_desc_ptr);
efx_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base,
efx_rx_queue_index(rx_queue));
/* Unpin RX descriptor ring */
<API key>(efx, &rx_queue->rxd);
}
/* Free buffers backing RX queue */
void efx_nic_remove_rx(struct efx_rx_queue *rx_queue)
{
<API key>(rx_queue->efx, &rx_queue->rxd);
}
/* Update a channel's event queue's read pointer (RPTR) register
*
* This writes the EVQ_RPTR_REG register for the specified channel's
* event queue.
*/
void <API key>(struct efx_channel *channel)
{
efx_dword_t reg;
struct efx_nic *efx = channel->efx;
<API key>(reg, FRF_AZ_EVQ_RPTR,
channel->eventq_read_ptr & channel->eventq_mask);
efx_writed_table(efx, ®, efx->type->evq_rptr_tbl_base,
channel->channel);
}
/* Use HW to insert a SW defined event */
static void efx_generate_event(struct efx_channel *channel, efx_qword_t *event)
{
efx_oword_t drv_ev_reg;
BUILD_BUG_ON(<API key> != 0 ||
<API key> != 64);
drv_ev_reg.u32[0] = event->u32[0];
drv_ev_reg.u32[1] = event->u32[1];
drv_ev_reg.u32[2] = 0;
drv_ev_reg.u32[3] = 0;
EFX_SET_OWORD_FIELD(drv_ev_reg, FRF_AZ_DRV_EV_QID, channel->channel);
efx_writeo(channel->efx, &drv_ev_reg, FR_AZ_DRV_EV);
}
/* Handle a transmit completion event
*
* The NIC batches TX completion events; the message we receive is of
* the form "complete all TX events up to this index".
*/
static int
efx_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
{
unsigned int tx_ev_desc_ptr;
unsigned int tx_ev_q_label;
struct efx_tx_queue *tx_queue;
struct efx_nic *efx = channel->efx;
int tx_packets = 0;
if (likely(EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_COMP))) {
/* Transmit completion */
tx_ev_desc_ptr = EFX_QWORD_FIELD(*event, <API key>);
tx_ev_q_label = EFX_QWORD_FIELD(*event, <API key>);
tx_queue = <API key>(
channel, tx_ev_q_label % EFX_TXQ_TYPES);
tx_packets = ((tx_ev_desc_ptr - tx_queue->read_count) &
tx_queue->ptr_mask);
channel->irq_mod_score += tx_packets;
efx_xmit_done(tx_queue, tx_ev_desc_ptr);
} else if (EFX_QWORD_FIELD(*event, <API key>)) {
/* Rewrite the FIFO write pointer */
tx_ev_q_label = EFX_QWORD_FIELD(*event, <API key>);
tx_queue = <API key>(
channel, tx_ev_q_label % EFX_TXQ_TYPES);
if (efx_dev_registered(efx))
netif_tx_lock(efx->net_dev);
efx_notify_tx_desc(tx_queue);
if (efx_dev_registered(efx))
netif_tx_unlock(efx->net_dev);
} else if (EFX_QWORD_FIELD(*event, <API key>) &&
<API key>(efx)) {
efx_schedule_reset(efx, <API key>);
} else {
netif_err(efx, tx_err, efx->net_dev,
"channel %d unexpected TX event "
EFX_QWORD_FMT"\n", channel->channel,
EFX_QWORD_VAL(*event));
}
return tx_packets;
}
/* Detect errors included in the rx_evt_pkt_ok bit. */
static void <API key>(struct efx_rx_queue *rx_queue,
const efx_qword_t *event,
bool *rx_ev_pkt_ok,
bool *discard)
{
struct efx_channel *channel = <API key>(rx_queue);
struct efx_nic *efx = rx_queue->efx;
bool <API key>, <API key>;
bool <API key>, rx_ev_eth_crc_err;
bool rx_ev_frm_trunc, rx_ev_drib_nib, rx_ev_tobe_disc;
bool rx_ev_other_err, rx_ev_pause_frm;
bool rx_ev_hdr_type, rx_ev_mcast_pkt;
unsigned rx_ev_pkt_type;
rx_ev_hdr_type = EFX_QWORD_FIELD(*event, <API key>);
rx_ev_mcast_pkt = EFX_QWORD_FIELD(*event, <API key>);
rx_ev_tobe_disc = EFX_QWORD_FIELD(*event, <API key>);
rx_ev_pkt_type = EFX_QWORD_FIELD(*event, <API key>);
<API key> = EFX_QWORD_FIELD(*event,
<API key>);
<API key> = EFX_QWORD_FIELD(*event,
<API key>);
<API key> = EFX_QWORD_FIELD(*event,
<API key>);
rx_ev_eth_crc_err = EFX_QWORD_FIELD(*event, <API key>);
rx_ev_frm_trunc = EFX_QWORD_FIELD(*event, <API key>);
rx_ev_drib_nib = ((efx_nic_rev(efx) >= EFX_REV_FALCON_B0) ?
0 : EFX_QWORD_FIELD(*event, <API key>));
rx_ev_pause_frm = EFX_QWORD_FIELD(*event, <API key>);
/* Every error apart from tobe_disc and pause_frm */
rx_ev_other_err = (rx_ev_drib_nib | <API key> |
<API key> | rx_ev_eth_crc_err |
rx_ev_frm_trunc | <API key>);
/* Count errors that are not in MAC stats. Ignore expected
* checksum errors during self-test. */
if (rx_ev_frm_trunc)
++channel->n_rx_frm_trunc;
else if (rx_ev_tobe_disc)
++channel->n_rx_tobe_disc;
else if (!efx->loopback_selftest) {
if (<API key>)
++channel-><API key>;
else if (<API key>)
++channel-><API key>;
}
/* The frame must be discarded if any of these are true. */
*discard = (rx_ev_eth_crc_err | rx_ev_frm_trunc | rx_ev_drib_nib |
rx_ev_tobe_disc | rx_ev_pause_frm);
/* TOBE_DISC is expected on unicast mismatches; don't print out an
* error message. FRM_TRUNC indicates RXDP dropped the packet due
* to a FIFO overflow.
*/
#ifdef EFX_ENABLE_DEBUG
if (rx_ev_other_err && net_ratelimit()) {
netif_dbg(efx, rx_err, efx->net_dev,
" RX queue %d unexpected RX event "
EFX_QWORD_FMT "%s%s%s%s%s%s%s%s\n",
efx_rx_queue_index(rx_queue), EFX_QWORD_VAL(*event),
<API key> ? " [OWNER_ID_ERR]" : "",
<API key> ?
" [IP_HDR_CHKSUM_ERR]" : "",
<API key> ?
" [TCP_UDP_CHKSUM_ERR]" : "",
rx_ev_eth_crc_err ? " [ETH_CRC_ERR]" : "",
rx_ev_frm_trunc ? " [FRM_TRUNC]" : "",
rx_ev_drib_nib ? " [DRIB_NIB]" : "",
rx_ev_tobe_disc ? " [TOBE_DISC]" : "",
rx_ev_pause_frm ? " [PAUSE]" : "");
}
#endif
}
/* Handle receive events that are not in-order. */
static void
<API key>(struct efx_rx_queue *rx_queue, unsigned index)
{
struct efx_nic *efx = rx_queue->efx;
unsigned expected, dropped;
expected = rx_queue->removed_count & rx_queue->ptr_mask;
dropped = (index - expected) & rx_queue->ptr_mask;
netif_info(efx, rx_err, efx->net_dev,
"dropped %d events (index=%d expected=%d)\n",
dropped, index, expected);
efx_schedule_reset(efx, EFX_WORKAROUND_5676(efx) ?
<API key> : RESET_TYPE_DISABLE);
}
/* Handle a packet received event
*
* The NIC gives a "discard" flag if it's a unicast packet with the
* wrong destination address
* Also "is multicast" and "matches multicast filter" flags can be used to
* discard non-matching multicast packets.
*/
static void
efx_handle_rx_event(struct efx_channel *channel, const efx_qword_t *event)
{
unsigned int rx_ev_desc_ptr, rx_ev_byte_cnt;
unsigned int rx_ev_hdr_type, rx_ev_mcast_pkt;
unsigned expected_ptr;
bool rx_ev_pkt_ok, discard = false, checksummed;
struct efx_rx_queue *rx_queue;
/* Basic packet information */
rx_ev_byte_cnt = EFX_QWORD_FIELD(*event, <API key>);
rx_ev_pkt_ok = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_PKT_OK);
rx_ev_hdr_type = EFX_QWORD_FIELD(*event, <API key>);
WARN_ON(EFX_QWORD_FIELD(*event, <API key>));
WARN_ON(EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_SOP) != 1);
WARN_ON(EFX_QWORD_FIELD(*event, <API key>) !=
channel->channel);
rx_queue = <API key>(channel);
rx_ev_desc_ptr = EFX_QWORD_FIELD(*event, <API key>);
expected_ptr = rx_queue->removed_count & rx_queue->ptr_mask;
if (unlikely(rx_ev_desc_ptr != expected_ptr))
<API key>(rx_queue, rx_ev_desc_ptr);
if (likely(rx_ev_pkt_ok)) {
/* If packet is marked as OK and packet type is TCP/IP or
* UDP/IP, then we can rely on the hardware checksum.
*/
checksummed =
rx_ev_hdr_type == <API key> ||
rx_ev_hdr_type == <API key>;
} else {
<API key>(rx_queue, event, &rx_ev_pkt_ok, &discard);
checksummed = false;
}
/* Detect multicast packets that didn't match the filter */
rx_ev_mcast_pkt = EFX_QWORD_FIELD(*event, <API key>);
if (rx_ev_mcast_pkt) {
unsigned int <API key> =
EFX_QWORD_FIELD(*event, <API key>);
if (unlikely(!<API key>)) {
++channel->n_rx_mcast_mismatch;
discard = true;
}
}
channel->irq_mod_score += 2;
/* Handle received packet */
efx_rx_packet(rx_queue, rx_ev_desc_ptr, rx_ev_byte_cnt,
checksummed, discard);
}
static void
<API key>(struct efx_channel *channel, efx_qword_t *event)
{
struct efx_nic *efx = channel->efx;
unsigned code;
code = EFX_QWORD_FIELD(*event, <API key>);
if (code == <API key>(channel))
; /* ignore */
else if (code == <API key>(channel))
/* The queue must be empty, so we won't receive any rx
* events, so efx_process_channel() won't refill the
* queue. Refill it here */
<API key>(<API key>(channel));
else
netif_dbg(efx, hw, efx->net_dev, "channel %d received "
"generated event "EFX_QWORD_FMT"\n",
channel->channel, EFX_QWORD_VAL(*event));
}
static void
<API key>(struct efx_channel *channel, efx_qword_t *event)
{
struct efx_nic *efx = channel->efx;
unsigned int ev_sub_code;
unsigned int ev_sub_data;
ev_sub_code = EFX_QWORD_FIELD(*event, <API key>);
ev_sub_data = EFX_QWORD_FIELD(*event, <API key>);
switch (ev_sub_code) {
case <API key>:
netif_vdbg(efx, hw, efx->net_dev, "channel %d TXQ %d flushed\n",
channel->channel, ev_sub_data);
break;
case <API key>:
netif_vdbg(efx, hw, efx->net_dev, "channel %d RXQ %d flushed\n",
channel->channel, ev_sub_data);
break;
case <API key>:
netif_dbg(efx, hw, efx->net_dev,
"channel %d EVQ %d initialised\n",
channel->channel, ev_sub_data);
break;
case <API key>:
netif_vdbg(efx, hw, efx->net_dev,
"channel %d SRAM update done\n", channel->channel);
break;
case FSE_AZ_WAKE_UP_EV:
netif_vdbg(efx, hw, efx->net_dev,
"channel %d RXQ %d wakeup event\n",
channel->channel, ev_sub_data);
break;
case FSE_AZ_TIMER_EV:
netif_vdbg(efx, hw, efx->net_dev,
"channel %d RX queue %d timer expired\n",
channel->channel, ev_sub_data);
break;
case <API key>:
netif_err(efx, rx_err, efx->net_dev,
"channel %d seen DRIVER RX_RESET event. "
"Resetting.\n", channel->channel);
atomic_inc(&efx->rx_reset);
efx_schedule_reset(efx,
EFX_WORKAROUND_6555(efx) ?
<API key> :
RESET_TYPE_DISABLE);
break;
case <API key>:
netif_err(efx, rx_err, efx->net_dev,
"RX DMA Q %d reports descriptor fetch error."
" RX Q %d is disabled.\n", ev_sub_data, ev_sub_data);
efx_schedule_reset(efx, <API key>);
break;
case <API key>:
netif_err(efx, tx_err, efx->net_dev,
"TX DMA Q %d reports descriptor fetch error."
" TX Q %d is disabled.\n", ev_sub_data, ev_sub_data);
efx_schedule_reset(efx, <API key>);
break;
default:
netif_vdbg(efx, hw, efx->net_dev,
"channel %d unknown driver event code %d "
"data %04x\n", channel->channel, ev_sub_code,
ev_sub_data);
break;
}
}
int <API key>(struct efx_channel *channel, int budget)
{
struct efx_nic *efx = channel->efx;
unsigned int read_ptr;
efx_qword_t event, *p_event;
int ev_code;
int tx_packets = 0;
int spent = 0;
read_ptr = channel->eventq_read_ptr;
for (;;) {
p_event = efx_event(channel, read_ptr);
event = *p_event;
if (!efx_event_present(&event))
/* End of events */
break;
netif_vdbg(channel->efx, intr, channel->efx->net_dev,
"channel %d event is "EFX_QWORD_FMT"\n",
channel->channel, EFX_QWORD_VAL(event));
/* Clear this event by marking it all ones */
EFX_SET_QWORD(*p_event);
++read_ptr;
ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE);
switch (ev_code) {
case <API key>:
efx_handle_rx_event(channel, &event);
if (++spent == budget)
goto out;
break;
case <API key>:
tx_packets += efx_handle_tx_event(channel, &event);
if (tx_packets > efx->txq_entries) {
spent = budget;
goto out;
}
break;
case <API key>:
<API key>(channel, &event);
break;
case <API key>:
<API key>(channel, &event);
break;
case <API key>:
<API key>(channel, &event);
break;
case <API key>:
if (efx->type->handle_global_event &&
efx->type->handle_global_event(channel, &event))
break;
/* else fall through */
default:
netif_err(channel->efx, hw, channel->efx->net_dev,
"channel %d unknown event type %d (data "
EFX_QWORD_FMT ")\n", channel->channel,
ev_code, EFX_QWORD_VAL(event));
}
}
out:
channel->eventq_read_ptr = read_ptr;
return spent;
}
/* Check whether an event is present in the eventq at the current
* read pointer. Only useful for self-test.
*/
bool <API key>(struct efx_channel *channel)
{
return efx_event_present(efx_event(channel, channel->eventq_read_ptr));
}
/* Allocate buffer table entries for event queue */
int <API key>(struct efx_channel *channel)
{
struct efx_nic *efx = channel->efx;
unsigned entries;
entries = channel->eventq_mask + 1;
return <API key>(efx, &channel->eventq,
entries * sizeof(efx_qword_t));
}
void efx_nic_init_eventq(struct efx_channel *channel)
{
efx_oword_t reg;
struct efx_nic *efx = channel->efx;
netif_dbg(efx, hw, efx->net_dev,
"channel %d event queue in special buffers %d-%d\n",
channel->channel, channel->eventq.index,
channel->eventq.index + channel->eventq.entries - 1);
if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0) {
<API key>(reg,
FRF_CZ_TIMER_Q_EN, 1,
<API key>, 0,
FRF_CZ_TIMER_MODE, <API key>);
efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, channel->channel);
}
/* Pin event queue buffer */
<API key>(efx, &channel->eventq);
/* Fill event queue with all ones (i.e. empty events) */
memset(channel->eventq.addr, 0xff, channel->eventq.len);
/* Push event queue to card */
<API key>(reg,
FRF_AZ_EVQ_EN, 1,
FRF_AZ_EVQ_SIZE, __ffs(channel->eventq.entries),
<API key>, channel->eventq.index);
efx_writeo_table(efx, ®, efx->type->evq_ptr_tbl_base,
channel->channel);
efx->type->push_irq_moderation(channel);
}
void efx_nic_fini_eventq(struct efx_channel *channel)
{
efx_oword_t reg;
struct efx_nic *efx = channel->efx;
/* Remove event queue from card */
EFX_ZERO_OWORD(reg);
efx_writeo_table(efx, ®, efx->type->evq_ptr_tbl_base,
channel->channel);
if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, channel->channel);
/* Unpin event queue */
<API key>(efx, &channel->eventq);
}
/* Free buffers backing event queue */
void <API key>(struct efx_channel *channel)
{
<API key>(channel->efx, &channel->eventq);
}
void <API key>(struct efx_channel *channel)
{
unsigned int magic = <API key>(channel);
efx_qword_t test_event;
<API key>(test_event, FSF_AZ_EV_CODE,
<API key>,
<API key>, magic);
efx_generate_event(channel, &test_event);
}
void <API key>(struct efx_channel *channel)
{
unsigned int magic = <API key>(channel);
efx_qword_t test_event;
<API key>(test_event, FSF_AZ_EV_CODE,
<API key>,
<API key>, magic);
efx_generate_event(channel, &test_event);
}
static void <API key>(struct efx_nic *efx)
{
struct efx_channel *channel = efx_get_channel(efx, 0);
struct efx_tx_queue *tx_queue;
struct efx_rx_queue *rx_queue;
unsigned int read_ptr = channel->eventq_read_ptr;
unsigned int end_ptr = read_ptr + channel->eventq_mask - 1;
do {
efx_qword_t *event = efx_event(channel, read_ptr);
int ev_code, ev_sub_code, ev_queue;
bool ev_failed;
if (!efx_event_present(event))
break;
ev_code = EFX_QWORD_FIELD(*event, FSF_AZ_EV_CODE);
ev_sub_code = EFX_QWORD_FIELD(*event,
<API key>);
if (ev_code == <API key> &&
ev_sub_code == <API key>) {
ev_queue = EFX_QWORD_FIELD(*event,
<API key>);
if (ev_queue < EFX_TXQ_TYPES * efx->n_tx_channels) {
tx_queue = efx_get_tx_queue(
efx, ev_queue / EFX_TXQ_TYPES,
ev_queue % EFX_TXQ_TYPES);
tx_queue->flushed = FLUSH_DONE;
}
} else if (ev_code == <API key> &&
ev_sub_code == <API key>) {
ev_queue = EFX_QWORD_FIELD(
*event, <API key>);
ev_failed = EFX_QWORD_FIELD(
*event, <API key>);
if (ev_queue < efx->n_rx_channels) {
rx_queue = efx_get_rx_queue(efx, ev_queue);
rx_queue->flushed =
ev_failed ? FLUSH_FAILED : FLUSH_DONE;
}
}
/* We're about to destroy the queue anyway, so
* it's ok to throw away every non-flush event */
EFX_SET_QWORD(*event);
++read_ptr;
} while (read_ptr != end_ptr);
channel->eventq_read_ptr = read_ptr;
}
/* Handle tx and rx flushes at the same time, since they run in
* parallel in the hardware and there's no reason for us to
* serialise them */
int <API key>(struct efx_nic *efx)
{
struct efx_channel *channel;
struct efx_rx_queue *rx_queue;
struct efx_tx_queue *tx_queue;
int i, tx_pending, rx_pending;
/* If necessary prepare the hardware for flushing */
efx->type->prepare_flush(efx);
/* Flush all tx queues in parallel */
<API key>(channel, efx) {
<API key>(tx_queue, channel) {
if (tx_queue->initialised)
efx_flush_tx_queue(tx_queue);
}
}
/* The hardware supports four concurrent rx flushes, each of which may
* need to be retried if there is an outstanding descriptor fetch */
for (i = 0; i < <API key>; ++i) {
rx_pending = tx_pending = 0;
<API key>(channel, efx) {
<API key>(rx_queue, channel) {
if (rx_queue->flushed == FLUSH_PENDING)
++rx_pending;
}
}
<API key>(channel, efx) {
<API key>(rx_queue, channel) {
if (rx_pending == EFX_RX_FLUSH_COUNT)
break;
if (rx_queue->flushed == FLUSH_FAILED ||
rx_queue->flushed == FLUSH_NONE) {
efx_flush_rx_queue(rx_queue);
++rx_pending;
}
}
<API key>(tx_queue, channel) {
if (tx_queue->initialised &&
tx_queue->flushed != FLUSH_DONE) {
efx_oword_t txd_ptr_tbl;
efx_reado_table(efx, &txd_ptr_tbl,
<API key>,
tx_queue->queue);
if (EFX_OWORD_FIELD(txd_ptr_tbl,
<API key>) ||
EFX_OWORD_FIELD(txd_ptr_tbl,
FRF_AZ_TX_DESCQ_EN))
++tx_pending;
else
tx_queue->flushed = FLUSH_DONE;
}
}
}
if (rx_pending == 0 && tx_pending == 0) {
efx->type->finish_flush(efx);
return 0;
}
msleep(EFX_FLUSH_INTERVAL);
<API key>(efx);
}
/* Mark the queues as all flushed. We're going to return failure
* leading to a reset, or fake up success anyway */
<API key>(channel, efx) {
<API key>(tx_queue, channel) {
if (tx_queue->initialised &&
tx_queue->flushed != FLUSH_DONE)
netif_err(efx, hw, efx->net_dev,
"tx queue %d flush command timed out\n",
tx_queue->queue);
tx_queue->flushed = FLUSH_DONE;
}
<API key>(rx_queue, channel) {
if (rx_queue->flushed != FLUSH_DONE)
netif_err(efx, hw, efx->net_dev,
"rx queue %d flush command timed out\n",
efx_rx_queue_index(rx_queue));
rx_queue->flushed = FLUSH_DONE;
}
}
efx->type->finish_flush(efx);
return -ETIMEDOUT;
}
/* Enable/disable/generate interrupts */
static inline void efx_nic_interrupts(struct efx_nic *efx,
bool enabled, bool force)
{
efx_oword_t int_en_reg_ker;
<API key>(int_en_reg_ker,
<API key>, efx->fatal_irq_level,
FRF_AZ_KER_INT_KER, force,
<API key>, enabled);
efx_writeo(efx, &int_en_reg_ker, FR_AZ_INT_EN_KER);
}
void <API key>(struct efx_nic *efx)
{
struct efx_channel *channel;
EFX_ZERO_OWORD(*((efx_oword_t *) efx->irq_status.addr));
wmb(); /* Ensure interrupt vector is clear before interrupts enabled */
/* Enable interrupts */
efx_nic_interrupts(efx, true, false);
/* Force processing of all the channels to get the EVQ RPTRs up to
date */
<API key>(channel, efx)
<API key>(channel);
}
void <API key>(struct efx_nic *efx)
{
/* Disable interrupts */
efx_nic_interrupts(efx, false, false);
}
/* Generate a test interrupt
* Interrupt must already have been enabled, otherwise nasty things
* may happen.
*/
void <API key>(struct efx_nic *efx)
{
efx_nic_interrupts(efx, true, true);
}
/* Process a fatal interrupt
* Disable bus mastering ASAP and schedule a reset
*/
irqreturn_t <API key>(struct efx_nic *efx)
{
struct falcon_nic_data *nic_data = efx->nic_data;
efx_oword_t *int_ker = efx->irq_status.addr;
efx_oword_t fatal_intr;
int error, mem_perr;
efx_reado(efx, &fatal_intr, <API key>);
error = EFX_OWORD_FIELD(fatal_intr, FRF_AZ_FATAL_INTR);
netif_err(efx, hw, efx->net_dev, "SYSTEM ERROR "EFX_OWORD_FMT" status "
EFX_OWORD_FMT ": %s\n", EFX_OWORD_VAL(*int_ker),
EFX_OWORD_VAL(fatal_intr),
error ? "disabling bus mastering" : "no recognised error");
/* If this is a memory parity error dump which blocks are offending */
mem_perr = (EFX_OWORD_FIELD(fatal_intr, <API key>) ||
EFX_OWORD_FIELD(fatal_intr, <API key>));
if (mem_perr) {
efx_oword_t reg;
efx_reado(efx, ®, FR_AZ_MEM_STAT);
netif_err(efx, hw, efx->net_dev,
"SYSTEM ERROR: memory parity error "EFX_OWORD_FMT"\n",
EFX_OWORD_VAL(reg));
}
/* Disable both devices */
pci_clear_master(efx->pci_dev);
if (<API key>(efx))
pci_clear_master(nic_data->pci_dev2);
<API key>(efx);
/* Count errors and reset or disable the NIC accordingly */
if (efx->int_error_count == 0 ||
time_after(jiffies, efx->int_error_expire)) {
efx->int_error_count = 0;
efx->int_error_expire =
jiffies + <API key> * HZ;
}
if (++efx->int_error_count < EFX_MAX_INT_ERRORS) {
netif_err(efx, hw, efx->net_dev,
"SYSTEM ERROR - reset scheduled\n");
efx_schedule_reset(efx, <API key>);
} else {
netif_err(efx, hw, efx->net_dev,
"SYSTEM ERROR - max number of errors seen."
"NIC will be disabled\n");
efx_schedule_reset(efx, RESET_TYPE_DISABLE);
}
return IRQ_HANDLED;
}
/* Handle a legacy interrupt
* Acknowledges the interrupt and schedule event queue processing.
*/
static irqreturn_t <API key>(int irq, void *dev_id)
{
struct efx_nic *efx = dev_id;
efx_oword_t *int_ker = efx->irq_status.addr;
irqreturn_t result = IRQ_NONE;
struct efx_channel *channel;
efx_dword_t reg;
u32 queues;
int syserr;
/* Could this be ours? If interrupts are disabled then the
* channel state may not be valid.
*/
if (!efx->legacy_irq_enabled)
return result;
/* Read the ISR which also ACKs the interrupts */
efx_readd(efx, ®, FR_BZ_INT_ISR0);
queues = EFX_EXTRACT_DWORD(reg, 0, 31);
/* Check to see if we have a serious error condition */
if (queues & (1U << efx->fatal_irq_level)) {
syserr = EFX_OWORD_FIELD(*int_ker, <API key>);
if (unlikely(syserr))
return <API key>(efx);
}
if (queues != 0) {
if (<API key>(efx))
efx->irq_zero_count = 0;
/* Schedule processing of any interrupting queues */
<API key>(channel, efx) {
if (queues & 1)
<API key>(channel);
queues >>= 1;
}
result = IRQ_HANDLED;
} else if (<API key>(efx)) {
efx_qword_t *event;
/* We can't return IRQ_HANDLED more than once on seeing ISR=0
* because this might be a shared interrupt. */
if (efx->irq_zero_count++ == 0)
result = IRQ_HANDLED;
/* Ensure we schedule or rearm all event queues */
<API key>(channel, efx) {
event = efx_event(channel, channel->eventq_read_ptr);
if (efx_event_present(event))
<API key>(channel);
else
<API key>(channel);
}
}
if (result == IRQ_HANDLED) {
efx->last_irq_cpu = <API key>();
netif_vdbg(efx, intr, efx->net_dev,
"IRQ %d on CPU %d status " EFX_DWORD_FMT "\n",
irq, <API key>(), EFX_DWORD_VAL(reg));
}
return result;
}
/* Handle an MSI interrupt
*
* Handle an MSI hardware interrupt. This routine schedules event
* queue processing. No interrupt acknowledgement cycle is necessary.
* Also, we never need to check that the interrupt is for us, since
* MSI interrupts cannot be shared.
*/
static irqreturn_t efx_msi_interrupt(int irq, void *dev_id)
{
struct efx_channel *channel = *(struct efx_channel **)dev_id;
struct efx_nic *efx = channel->efx;
efx_oword_t *int_ker = efx->irq_status.addr;
int syserr;
efx->last_irq_cpu = <API key>();
netif_vdbg(efx, intr, efx->net_dev,
"IRQ %d on CPU %d status " EFX_OWORD_FMT "\n",
irq, <API key>(), EFX_OWORD_VAL(*int_ker));
/* Check to see if we have a serious error condition */
if (channel->channel == efx->fatal_irq_level) {
syserr = EFX_OWORD_FIELD(*int_ker, <API key>);
if (unlikely(syserr))
return <API key>(efx);
}
/* Schedule processing of the channel */
<API key>(channel);
return IRQ_HANDLED;
}
/* Setup RSS indirection table.
* This maps from the hash value of the packet to RXQ
*/
void <API key>(struct efx_nic *efx)
{
size_t i = 0;
efx_dword_t dword;
if (efx_nic_rev(efx) < EFX_REV_FALCON_B0)
return;
BUILD_BUG_ON(ARRAY_SIZE(efx->rx_indir_table) !=
<API key>);
for (i = 0; i < <API key>; i++) {
<API key>(dword, FRF_BZ_IT_QUEUE,
efx->rx_indir_table[i]);
efx_writed_table(efx, &dword, <API key>, i);
}
}
/* Hook interrupt handler(s)
* Try MSI and then legacy interrupts.
*/
int <API key>(struct efx_nic *efx)
{
struct efx_channel *channel;
int rc;
if (!<API key>(efx)) {
irq_handler_t handler;
if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0)
handler = <API key>;
else
handler = <API key>;
rc = request_irq(efx->legacy_irq, handler, IRQF_SHARED,
efx->name, efx);
if (rc) {
netif_err(efx, drv, efx->net_dev,
"failed to hook legacy IRQ %d\n",
efx->pci_dev->irq);
goto fail1;
}
return 0;
}
/* Hook MSI or MSI-X interrupt */
<API key>(channel, efx) {
rc = request_irq(channel->irq, efx_msi_interrupt,
IRQF_PROBE_SHARED, /* Not shared */
efx->channel_name[channel->channel],
&efx->channel[channel->channel]);
if (rc) {
netif_err(efx, drv, efx->net_dev,
"failed to hook IRQ %d\n", channel->irq);
goto fail2;
}
}
return 0;
fail2:
<API key>(channel, efx)
free_irq(channel->irq, &efx->channel[channel->channel]);
fail1:
return rc;
}
void <API key>(struct efx_nic *efx)
{
struct efx_channel *channel;
efx_oword_t reg;
/* Disable MSI/MSI-X interrupts */
<API key>(channel, efx) {
if (channel->irq)
free_irq(channel->irq, &efx->channel[channel->channel]);
}
/* ACK legacy interrupt */
if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0)
efx_reado(efx, ®, FR_BZ_INT_ISR0);
else
falcon_irq_ack_a1(efx);
/* Disable legacy interrupt */
if (efx->legacy_irq)
free_irq(efx->legacy_irq, efx);
}
u32 efx_nic_fpga_ver(struct efx_nic *efx)
{
efx_oword_t altera_build;
efx_reado(efx, &altera_build, FR_AZ_ALTERA_BUILD);
return EFX_OWORD_FIELD(altera_build, <API key>);
}
void efx_nic_init_common(struct efx_nic *efx)
{
efx_oword_t temp;
/* Set positions of descriptor caches in SRAM. */
<API key>(temp, <API key>,
efx->type->tx_dc_base / 8);
efx_writeo(efx, &temp, FR_AZ_SRM_TX_DC_CFG);
<API key>(temp, <API key>,
efx->type->rx_dc_base / 8);
efx_writeo(efx, &temp, FR_AZ_SRM_RX_DC_CFG);
/* Set TX descriptor cache size. */
BUILD_BUG_ON(TX_DC_ENTRIES != (8 << TX_DC_ENTRIES_ORDER));
<API key>(temp, FRF_AZ_TX_DC_SIZE, TX_DC_ENTRIES_ORDER);
efx_writeo(efx, &temp, FR_AZ_TX_DC_CFG);
/* Set RX descriptor cache size. Set low watermark to size-8, as
* this allows most efficient prefetching.
*/
BUILD_BUG_ON(RX_DC_ENTRIES != (8 << RX_DC_ENTRIES_ORDER));
<API key>(temp, FRF_AZ_RX_DC_SIZE, RX_DC_ENTRIES_ORDER);
efx_writeo(efx, &temp, FR_AZ_RX_DC_CFG);
<API key>(temp, FRF_AZ_RX_DC_PF_LWM, RX_DC_ENTRIES - 8);
efx_writeo(efx, &temp, FR_AZ_RX_DC_PF_WM);
/* Program INT_KER address */
<API key>(temp,
<API key>,
<API key>(efx),
FRF_AZ_INT_ADR_KER, efx->irq_status.dma_addr);
efx_writeo(efx, &temp, FR_AZ_INT_ADR_KER);
if (<API key>(efx) && !<API key>(efx))
/* Use an interrupt level unused by event queues */
efx->fatal_irq_level = 0x1f;
else
/* Use a valid MSI-X vector */
efx->fatal_irq_level = 0;
/* Enable all the genuinely fatal interrupts. (They are still
* masked by the overall interrupt mask, controlled by
* falcon_interrupts()).
*
* Note: All other fatal interrupts are enabled
*/
<API key>(temp,
<API key>, 1,
<API key>, 1,
<API key>, 1);
if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
EFX_SET_OWORD_FIELD(temp, <API key>, 1);
EFX_INVERT_OWORD(temp);
efx_writeo(efx, &temp, <API key>);
<API key>(efx);
/* Disable the ugly timer-based TX DMA backoff and allow TX DMA to be
* controlled by the RX FIFO fill level. Set arbitration to one pkt/Q.
*/
efx_reado(efx, &temp, FR_AZ_TX_RESERVED);
EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_RX_SPACER, 0xfe);
EFX_SET_OWORD_FIELD(temp, <API key>, 1);
EFX_SET_OWORD_FIELD(temp, <API key>, 1);
EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_PUSH_EN, 1);
EFX_SET_OWORD_FIELD(temp, <API key>, 1);
/* Enable SW_EV to inherit in char driver - assume harmless here */
EFX_SET_OWORD_FIELD(temp, <API key>, 1);
/* Prefetch threshold 2 => fetch when descriptor cache half empty */
EFX_SET_OWORD_FIELD(temp, <API key>, 2);
/* Disable hardware watchdog which can misfire */
EFX_SET_OWORD_FIELD(temp, <API key>, 0x3fffff);
/* Squash TX of packets of 16 bytes or less */
if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0)
EFX_SET_OWORD_FIELD(temp, <API key>, 1);
efx_writeo(efx, &temp, FR_AZ_TX_RESERVED);
if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) {
<API key>(temp,
/* Default values */
<API key>, 0x15,
<API key>, 0xb,
<API key>, 0,
/* Allow large pace values in the
* fast bin. */
<API key>,
<API key>);
efx_writeo(efx, &temp, FR_BZ_TX_PACE);
}
}
/* Register dump */
#define REGISTER_REVISION_A 1
#define REGISTER_REVISION_B 2
#define REGISTER_REVISION_C 3
#define REGISTER_REVISION_Z 3 /* latest revision */
struct efx_nic_reg {
u32 offset:24;
u32 min_revision:2, max_revision:2;
};
#define REGISTER(name, min_rev, max_rev) { \
FR_ ## min_rev ## max_rev ## _ ## name, \
REGISTER_REVISION_ ## min_rev, REGISTER_REVISION_ ## max_rev \
}
#define REGISTER_AA(name) REGISTER(name, A, A)
#define REGISTER_AB(name) REGISTER(name, A, B)
#define REGISTER_AZ(name) REGISTER(name, A, Z)
#define REGISTER_BB(name) REGISTER(name, B, B)
#define REGISTER_BZ(name) REGISTER(name, B, Z)
#define REGISTER_CZ(name) REGISTER(name, C, Z)
static const struct efx_nic_reg efx_nic_regs[] = {
REGISTER_AZ(ADR_REGION),
REGISTER_AZ(INT_EN_KER),
REGISTER_BZ(INT_EN_CHAR),
REGISTER_AZ(INT_ADR_KER),
REGISTER_BZ(INT_ADR_CHAR),
/* INT_ACK_KER is WO */
/* INT_ISR0 is RC */
REGISTER_AZ(HW_INIT),
REGISTER_CZ(USR_EV_CFG),
REGISTER_AB(EE_SPI_HCMD),
REGISTER_AB(EE_SPI_HADR),
REGISTER_AB(EE_SPI_HDATA),
REGISTER_AB(EE_BASE_PAGE),
REGISTER_AB(EE_VPD_CFG0),
/* EE_VPD_SW_CNTL and EE_VPD_SW_DATA are not used */
/* PMBX_DBG_IADDR and PBMX_DBG_IDATA are indirect */
/* PCIE_CORE_INDIRECT is indirect */
REGISTER_AB(NIC_STAT),
REGISTER_AB(GPIO_CTL),
REGISTER_AB(GLB_CTL),
/* FATAL_INTR_KER and FATAL_INTR_CHAR are partly RC */
REGISTER_BZ(DP_CTRL),
REGISTER_AZ(MEM_STAT),
REGISTER_AZ(CS_DEBUG),
REGISTER_AZ(ALTERA_BUILD),
REGISTER_AZ(CSR_SPARE),
REGISTER_AB(PCIE_SD_CTL0123),
REGISTER_AB(PCIE_SD_CTL45),
REGISTER_AB(PCIE_PCS_CTL_STAT),
/* DEBUG_DATA_OUT is not used */
/* DRV_EV is WO */
REGISTER_AZ(EVQ_CTL),
REGISTER_AZ(EVQ_CNT1),
REGISTER_AZ(EVQ_CNT2),
REGISTER_AZ(BUF_TBL_CFG),
REGISTER_AZ(SRM_RX_DC_CFG),
REGISTER_AZ(SRM_TX_DC_CFG),
REGISTER_AZ(SRM_CFG),
/* BUF_TBL_UPD is WO */
REGISTER_AZ(SRM_UPD_EVQ),
REGISTER_AZ(SRAM_PARITY),
REGISTER_AZ(RX_CFG),
REGISTER_BZ(RX_FILTER_CTL),
/* RX_FLUSH_DESCQ is WO */
REGISTER_AZ(RX_DC_CFG),
REGISTER_AZ(RX_DC_PF_WM),
REGISTER_BZ(RX_RSS_TKEY),
/* RX_NODESC_DROP is RC */
REGISTER_AA(RX_SELF_RST),
/* RX_DEBUG, RX_PUSH_DROP are not used */
REGISTER_CZ(RX_RSS_IPV6_REG1),
REGISTER_CZ(RX_RSS_IPV6_REG2),
REGISTER_CZ(RX_RSS_IPV6_REG3),
/* TX_FLUSH_DESCQ is WO */
REGISTER_AZ(TX_DC_CFG),
REGISTER_AA(TX_CHKSM_CFG),
REGISTER_AZ(TX_CFG),
/* TX_PUSH_DROP is not used */
REGISTER_AZ(TX_RESERVED),
REGISTER_BZ(TX_PACE),
/* TX_PACE_DROP_QID is RC */
REGISTER_BB(TX_VLAN),
REGISTER_BZ(TX_IPFIL_PORTEN),
REGISTER_AB(MD_TXD),
REGISTER_AB(MD_RXD),
REGISTER_AB(MD_CS),
REGISTER_AB(MD_PHY_ADR),
REGISTER_AB(MD_ID),
/* MD_STAT is RC */
REGISTER_AB(MAC_STAT_DMA),
REGISTER_AB(MAC_CTRL),
REGISTER_BB(GEN_MODE),
REGISTER_AB(MAC_MC_HASH_REG0),
REGISTER_AB(MAC_MC_HASH_REG1),
REGISTER_AB(GM_CFG1),
REGISTER_AB(GM_CFG2),
/* GM_IPG and GM_HD are not used */
REGISTER_AB(GM_MAX_FLEN),
/* GM_TEST is not used */
REGISTER_AB(GM_ADR1),
REGISTER_AB(GM_ADR2),
REGISTER_AB(GMF_CFG0),
REGISTER_AB(GMF_CFG1),
REGISTER_AB(GMF_CFG2),
REGISTER_AB(GMF_CFG3),
REGISTER_AB(GMF_CFG4),
REGISTER_AB(GMF_CFG5),
REGISTER_BB(TX_SRC_MAC_CTL),
REGISTER_AB(XM_ADR_LO),
REGISTER_AB(XM_ADR_HI),
REGISTER_AB(XM_GLB_CFG),
REGISTER_AB(XM_TX_CFG),
REGISTER_AB(XM_RX_CFG),
REGISTER_AB(XM_MGT_INT_MASK),
REGISTER_AB(XM_FC),
REGISTER_AB(XM_PAUSE_TIME),
REGISTER_AB(XM_TX_PARAM),
REGISTER_AB(XM_RX_PARAM),
/* XM_MGT_INT_MSK (note no 'A') is RC */
REGISTER_AB(XX_PWR_RST),
REGISTER_AB(XX_SD_CTL),
REGISTER_AB(XX_TXDRV_CTL),
/* XX_PRBS_CTL, XX_PRBS_CHK and XX_PRBS_ERR are not used */
/* XX_CORE_STAT is partly RC */
};
struct efx_nic_reg_table {
u32 offset:24;
u32 min_revision:2, max_revision:2;
u32 step:6, rows:21;
};
#define <API key>(_, offset, min_rev, max_rev, step, rows) { \
offset, \
REGISTER_REVISION_ ## min_rev, REGISTER_REVISION_ ## max_rev, \
step, rows \
}
#define REGISTER_TABLE(name, min_rev, max_rev) \
<API key>( \
name, FR_ ## min_rev ## max_rev ## _ ## name, \
min_rev, max_rev, \
FR_ ## min_rev ## max_rev ## _ ## name ## _STEP, \
FR_ ## min_rev ## max_rev ## _ ## name ## _ROWS)
#define REGISTER_TABLE_AA(name) REGISTER_TABLE(name, A, A)
#define REGISTER_TABLE_AZ(name) REGISTER_TABLE(name, A, Z)
#define REGISTER_TABLE_BB(name) REGISTER_TABLE(name, B, B)
#define REGISTER_TABLE_BZ(name) REGISTER_TABLE(name, B, Z)
#define <API key>(name) \
<API key>(name, FR_BZ_ ## name, B, B, \
FR_BZ_ ## name ## _STEP, \
FR_BB_ ## name ## _ROWS), \
<API key>(name, FR_BZ_ ## name, C, Z, \
FR_BZ_ ## name ## _STEP, \
FR_CZ_ ## name ## _ROWS)
#define REGISTER_TABLE_CZ(name) REGISTER_TABLE(name, C, Z)
static const struct efx_nic_reg_table efx_nic_reg_tables[] = {
/* DRIVER is not used */
/* EVQ_RPTR, TIMER_COMMAND, USR_EV and {RX,TX}_DESC_UPD are WO */
REGISTER_TABLE_BB(TX_IPFIL_TBL),
REGISTER_TABLE_BB(TX_SRC_MAC_TBL),
REGISTER_TABLE_AA(RX_DESC_PTR_TBL_KER),
<API key>(RX_DESC_PTR_TBL),
REGISTER_TABLE_AA(TX_DESC_PTR_TBL_KER),
<API key>(TX_DESC_PTR_TBL),
REGISTER_TABLE_AA(EVQ_PTR_TBL_KER),
<API key>(EVQ_PTR_TBL),
/* We can't reasonably read all of the buffer table (up to 8MB!).
* However this driver will only use a few entries. Reading
* 1K entries allows for some expansion of queue count and
* size before we need to change the version. */
<API key>(BUF_FULL_TBL_KER, <API key>,
A, A, 8, 1024),
<API key>(BUF_FULL_TBL, FR_BZ_BUF_FULL_TBL,
B, Z, 8, 1024),
REGISTER_TABLE_CZ(RX_MAC_FILTER_TBL0),
<API key>(TIMER_TBL),
<API key>(TX_PACE_TBL),
REGISTER_TABLE_BZ(RX_INDIRECTION_TBL),
/* TX_FILTER_TBL0 is huge and not used by this driver */
REGISTER_TABLE_CZ(TX_MAC_FILTER_TBL0),
REGISTER_TABLE_CZ(MC_TREG_SMEM),
/* MSIX_PBA_TABLE is not mapped */
/* SRM_DBG is not mapped (and is redundant with BUF_FLL_TBL) */
REGISTER_TABLE_BZ(RX_FILTER_TBL0),
};
size_t <API key>(struct efx_nic *efx)
{
const struct efx_nic_reg *reg;
const struct efx_nic_reg_table *table;
size_t len = 0;
for (reg = efx_nic_regs;
reg < efx_nic_regs + ARRAY_SIZE(efx_nic_regs);
reg++)
if (efx->type->revision >= reg->min_revision &&
efx->type->revision <= reg->max_revision)
len += sizeof(efx_oword_t);
for (table = efx_nic_reg_tables;
table < efx_nic_reg_tables + ARRAY_SIZE(efx_nic_reg_tables);
table++)
if (efx->type->revision >= table->min_revision &&
efx->type->revision <= table->max_revision)
len += table->rows * min_t(size_t, table->step, 16);
return len;
}
void efx_nic_get_regs(struct efx_nic *efx, void *buf)
{
const struct efx_nic_reg *reg;
const struct efx_nic_reg_table *table;
for (reg = efx_nic_regs;
reg < efx_nic_regs + ARRAY_SIZE(efx_nic_regs);
reg++) {
if (efx->type->revision >= reg->min_revision &&
efx->type->revision <= reg->max_revision) {
efx_reado(efx, (efx_oword_t *)buf, reg->offset);
buf += sizeof(efx_oword_t);
}
}
for (table = efx_nic_reg_tables;
table < efx_nic_reg_tables + ARRAY_SIZE(efx_nic_reg_tables);
table++) {
size_t size, i;
if (!(efx->type->revision >= table->min_revision &&
efx->type->revision <= table->max_revision))
continue;
size = min_t(size_t, table->step, 16);
for (i = 0; i < table->rows; i++) {
switch (table->step) {
case 4: /* 32-bit register or SRAM */
efx_readd_table(efx, buf, table->offset, i);
break;
case 8: /* 64-bit SRAM */
efx_sram_readq(efx,
efx->membase + table->offset,
buf, i);
break;
case 16: /* 128-bit register */
efx_reado_table(efx, buf, table->offset, i);
break;
case 32: /* 128-bit register, interleaved */
efx_reado_table(efx, buf, table->offset, 2 * i);
break;
default:
WARN_ON(1);
return;
}
buf += size;
}
}
} |
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', '<API key>' ); ?>
<input type="text" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" value="<?php echo esc_attr( strip_tags( $instance['title'] ) ); ?>" />
</label>
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>"><?php esc_html_e( 'Number of events to show:', '<API key>' ); ?>
<input type="text" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'count' ) ); ?>"
id="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>"
value="<?php echo esc_attr( strip_tags( $instance['count'] ) ); ?>" />
</label>
</p>
<?php
$class = '';
if ( empty( $instance['filters'] ) ) {
$class = 'display:none;';
}
?>
<div class="<API key>" style="<?php echo esc_attr( $class ); ?>">
<h3 class="<API key>"><?php esc_html_e( 'Filters', '<API key>' ); ?>:</h3>
<input type="hidden" name="<?php echo esc_attr( $this->get_field_name( 'filters' ) ); ?>"
id="<?php echo esc_attr( $this->get_field_id( 'filters' ) ); ?>" class="<API key>"
value='<?php echo esc_attr( maybe_serialize( $instance['filters'] ) ); ?>' />
<ul class="<API key>">
<?php
if ( ! empty( $instance['filters'] ) ) {
foreach ( json_decode( $instance['filters'] ) as $tax => $terms ) {
$tax_obj = get_taxonomy( $tax );
foreach ( $terms as $term ) {
if ( empty( $term ) ) {
continue;
}
$term_obj = get_term( $term, $tax );
echo sprintf(
"<li><p>%s: %s <span><a href='#' class='<API key>' data-tax='%s' data-term='%s'>(" . esc_html__( 'remove', '<API key>' ) . ')</a></span></p></li>',
esc_html( $tax_obj->labels->name ),
esc_html( $term_obj->name ),
esc_attr( $tax ),
esc_attr( $term_obj->term_id )
);
}
}
}
?>
</ul>
<p class="<API key>">
<label for="<?php echo esc_attr( $this->get_field_name( 'operand' ) ); ?>">
<input <?php checked( $instance['operand'], 'AND' ); ?> type="radio" name="<?php echo esc_attr( $this->get_field_name( 'operand' ) ); ?>" value="AND">
<?php esc_html_e( 'Match all', '<API key>' ); ?></label><br />
<label for="<?php echo esc_attr( $this->get_field_name( 'operand' ) ); ?>">
<input <?php checked( $instance['operand'], 'OR' ); ?> type="radio" name="<?php echo esc_attr( $this->get_field_name( 'operand' ) ); ?>" value="OR">
<?php esc_html_e( 'Match any', '<API key>' ); ?></label>
</p>
</div>
<p>
<label><?php esc_html_e( 'Add a filter', '<API key>' ); ?>:
<select class="widefat <API key>" id="<?php echo esc_attr( $this->get_field_id( 'selector' ) ); ?>" data-storage="<?php echo esc_attr( $this->get_field_id( 'filters' ) ); ?>">
<?php
echo "<option value='0'>" . esc_html__( 'Select one...', '<API key>' ) . '</option>';
foreach ( $taxonomies as $tax ) {
echo sprintf( "<optgroup id='%s' label='%s'>", esc_attr( $tax->name ), esc_attr( $tax->labels->name ) );
$terms = get_terms( $tax->name, array( 'hide_empty' => false ) );
foreach ( $terms as $term ) {
echo sprintf( "<option value='%d'>%s</option>", esc_attr( $term->term_id ), esc_html( $term->name ) );
}
echo '</optgroup>';
}
?>
</select>
</label>
</p>
<p>
<?php $jsonld_enable = ( isset( $instance['jsonld_enable'] ) && $instance['jsonld_enable'] ) || false === $this->updated; ?>
<input class="checkbox" type="checkbox" value="1" <?php checked( $jsonld_enable, '1' ); ?>
id="<?php echo esc_attr( $this->get_field_id( 'jsonld_enable' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'jsonld_enable' ) ); ?>"/>
<label for="<?php echo esc_attr( $this->get_field_id( 'jsonld_enable' ) ); ?>"><?php esc_html_e( 'Generate JSON-LD data', '<API key>' ); ?></label>
</p> |
#include "socket.h"
#ifndef __MINGW32__
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
#include <errno.h>
#if defined(TCP_FASTOPEN) && !defined(SOL_TCP) && defined(IPPROTO_TCP)
#define SOL_TCP IPPROTO_TCP
#endif
int socket_fastopen(int s) {
#if defined(SOL_TCP) && defined(TCP_FASTOPEN)
return setsockopt(s,SOL_TCP,TCP_FASTOPEN,(int[]){ 5 }, sizeof(int));
#else
#ifdef ENOPROTOOPT
errno=ENOPROTOOPT;
#else
errno=ENOSYS;
#endif
return -1;
#endif
} |
<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-
<html lang="en" xml:lang="en" xmlns="http:
<head>
<link href="cpip.css" rel="stylesheet" type="text/css" />
<title>File: /Users/paulross/dev/Python-3.6.2/Include/floatobject.h</title>
</head>
<body>
<h1>File: /Users/paulross/dev/Python-3.6.2/Include/floatobject.h</h1>
<p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
<pre><a name="1" /><span class="True"> 1:</span>
<a name="2" /><span class="True"> 2:</span> <span class="k">/* Float object interface */</span>
<a name="3" /><span class="True"> 3:</span>
<a name="4" /><span class="True"> 4:</span> <span class="k">/*</span>
<a name="5" /><span class="True"> 5:</span> <span class="k">PyFloatObject represents a (double precision) floating point number.</span>
<a name="6" /><span class="True"> 6:</span> <span class="k">*/</span>
<a name="7" /><span class="True"> 7:</span>
<a name="8" /><span class="True"> 8:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_noref.html#<API key>"><span class="b">Py_FLOATOBJECT_H</span></a>
<a name="9" /><span class="True"> 9:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#<API key>"><span class="b">Py_FLOATOBJECT_H</span></a>
<a name="10" /><span class="False"> 10:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="11" /><span class="False"> 11:</span> <span class="m">extern</span> <span class="e">"C"</span> <span class="f">{</span>
<a name="12" /><span class="True"> 12:</span> <span class="f">#</span><span class="n">endif</span>
<a name="13" /><span class="True"> 13:</span>
<a name="14" /><span class="True"> 14:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="15" /><span class="True"> 15:</span> <span class="m">typedef</span> <span class="m">struct</span> <span class="f">{</span>
<a name="16" /><span class="True"> 16:</span> <a href="macros_ref.html#<API key>"><span class="b">PyObject_HEAD</span></a>
<a name="17" /><span class="True"> 17:</span> <span class="m">double</span> <span class="b">ob_fval</span><span class="f">;</span>
<a name="18" /><span class="True"> 18:</span> <span class="f">}</span> <span class="b">PyFloatObject</span><span class="f">;</span>
<a name="19" /><span class="True"> 19:</span> <span class="f">#</span><span class="n">endif</span>
<a name="20" /><span class="True"> 20:</span>
<a name="21" /><span class="True"> 21:</span> <a href="macros_ref.html#_UHlBUElfREFUQV8w"><span class="b">PyAPI_DATA</span></a><span class="f">(</span><span class="b">PyTypeObject</span><span class="f">)</span> <span class="b">PyFloat_Type</span><span class="f">;</span>
<a name="22" /><span class="True"> 22:</span>
<a name="23" /><span class="True"> 23:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#<API key>"><span class="b">PyFloat_Check</span></a><span class="f">(</span><span class="b">op</span><span class="f">)</span> <a href="macros_ref.html#<API key>"><span class="b">PyObject_TypeCheck</span></a><span class="f">(</span><span class="b">op</span><span class="f">,</span> <span class="f">&</span><span class="b">PyFloat_Type</span><span class="f">)</span>
<a name="24" /><span class="True"> 24:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#<API key>"><span class="b">PyFloat_CheckExact</span></a><span class="f">(</span><span class="b">op</span><span class="f">)</span> <span class="f">(</span><a href="macros_ref.html#_UHlfVFlQRV8w"><span class="b">Py_TYPE</span></a><span class="f">(</span><span class="b">op</span><span class="f">)</span> <span class="f">==</span> <span class="f">&</span><span class="b">PyFloat_Type</span><span class="f">)</span>
<a name="25" /><span class="True"> 25:</span>
<a name="26" /><span class="True"> 26:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_UHlfTkFOXzA_"><span class="b">Py_NAN</span></a>
<a name="27" /><span class="True"> 27:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#<API key>"><span class="b">Py_RETURN_NAN</span></a> <span class="m">return</span> <span class="b">PyFloat_FromDouble</span><span class="f">(</span><a href="macros_ref.html#_UHlfTkFOXzA_"><span class="b">Py_NAN</span></a><span class="f">)</span>
<a name="28" /><span class="True"> 28:</span> <span class="f">#</span><span class="n">endif</span>
<a name="29" /><span class="True"> 29:</span>
<a name="30" /><span class="True"> 30:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#<API key>"><span class="b">Py_RETURN_INF</span></a><span class="f">(</span><span class="b">sign</span><span class="f">)</span> <span class="m">do</span> \
<a name="31" /><span class="True"> 31:</span> <span class="m">if</span> <span class="f">(</span><span class="b">copysign</span><span class="f">(</span><span class="c">1.</span><span class="f">,</span> <span class="b">sign</span><span class="f">)</span> <span class="f">==</span> <span class="c">1.</span><span class="f">)</span> <span class="f">{</span> \
<a name="32" /><span class="True"> 32:</span> <span class="m">return</span> <span class="b">PyFloat_FromDouble</span><span class="f">(</span><a href="macros_noref.html#<API key>"><span class="b">Py_HUGE_VAL</span></a><span class="f">)</span><span class="f">;</span> \
<a name="33" /><span class="True"> 33:</span> <span class="f">}</span> <span class="m">else</span> <span class="f">{</span> \
<a name="34" /><span class="True"> 34:</span> <span class="m">return</span> <span class="b">PyFloat_FromDouble</span><span class="f">(</span><span class="f">-</span><a href="macros_noref.html#<API key>"><span class="b">Py_HUGE_VAL</span></a><span class="f">)</span><span class="f">;</span> \
<a name="35" /><span class="True"> 35:</span> <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="36" /><span class="True"> 36:</span>
<a name="37" /><span class="True"> 37:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">double</span><span class="f">)</span> <span class="b">PyFloat_GetMax</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="38" /><span class="True"> 38:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">double</span><span class="f">)</span> <span class="b">PyFloat_GetMin</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="39" /><span class="True"> 39:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyFloat_GetInfo</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="40" /><span class="True"> 40:</span>
<a name="41" /><span class="True"> 41:</span> <span class="k">/* Return Python float from string PyObject. */</span>
<a name="42" /><span class="True"> 42:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyFloat_FromString</span><span class="f">(</span><span class="b">PyObject</span><span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="43" /><span class="True"> 43:</span>
<a name="44" /><span class="True"> 44:</span> <span class="k">/* Return Python float from C double. */</span>
<a name="45" /><span class="True"> 45:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyFloat_FromDouble</span><span class="f">(</span><span class="m">double</span><span class="f">)</span><span class="f">;</span>
<a name="46" /><span class="True"> 46:</span>
<a name="47" /><span class="True"> 47:</span> <span class="k">/* Extract C double from Python float. The macro version trades safety for</span>
<a name="48" /><span class="True"> 48:</span> <span class="k"> speed. */</span>
<a name="49" /><span class="True"> 49:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">double</span><span class="f">)</span> <span class="b">PyFloat_AsDouble</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="50" /><span class="True"> 50:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="51" /><span class="True"> 51:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#<API key>"><span class="b">PyFloat_AS_DOUBLE</span></a><span class="f">(</span><span class="b">op</span><span class="f">)</span> <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">PyFloatObject</span> <span class="f">*</span><span class="f">)</span><span class="f">(</span><span class="b">op</span><span class="f">)</span><span class="f">)</span><span class="f">-></span><span class="b">ob_fval</span><span class="f">)</span>
<a name="52" /><span class="True"> 52:</span> <span class="f">#</span><span class="n">endif</span>
<a name="53" /><span class="True"> 53:</span>
<a name="54" /><span class="True"> 54:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="55" /><span class="True"> 55:</span> <span class="k">/* _PyFloat_{Pack,Unpack}{4,8}</span>
<a name="56" /><span class="True"> 56:</span> <span class="k"> *</span>
<a name="57" /><span class="True"> 57:</span> <span class="k"> * The struct and pickle (at least) modules need an efficient platform-</span>
<a name="58" /><span class="True"> 58:</span> <span class="k"> * independent way to store floating-point values as byte strings.</span>
<a name="59" /><span class="True"> 59:</span> <span class="k"> * The Pack routines produce a string from a C double, and the Unpack</span>
<a name="60" /><span class="True"> 60:</span> <span class="k"> * routines produce a C double from such a string. The suffix (4 or 8)</span>
<a name="61" /><span class="True"> 61:</span> <span class="k"> * specifies the number of bytes in the string.</span>
<a name="62" /><span class="True"> 62:</span> <span class="k"> *</span>
<a name="63" /><span class="True"> 63:</span> <span class="k"> * On platforms that appear to use (see _PyFloat_Init()) IEEE-754 formats</span>
<a name="64" /><span class="True"> 64:</span> <span class="k"> * these functions work by copying bits. On other platforms, the formats the</span>
<a name="65" /><span class="True"> 65:</span> <span class="k"> * 4- byte format is identical to the IEEE-754 single precision format, and</span>
<a name="66" /><span class="True"> 66:</span> <span class="k"> * the 8-byte format to the IEEE-754 double precision format, although the</span>
<a name="67" /><span class="True"> 67:</span> <span class="k"> * packing of INFs and NaNs (if such things exist on the platform) isn't</span>
<a name="68" /><span class="True"> 68:</span> <span class="k"> * handled correctly, and attempting to unpack a string containing an IEEE</span>
<a name="69" /><span class="True"> 69:</span> <span class="k"> * INF or NaN will raise an exception.</span>
<a name="70" /><span class="True"> 70:</span> <span class="k"> *</span>
<a name="71" /><span class="True"> 71:</span> <span class="k"> * On non-IEEE platforms with more precision, or larger dynamic range, than</span>
<a name="72" /><span class="True"> 72:</span> <span class="k"> * 754 supports, not all values can be packed; on non-IEEE platforms with less</span>
<a name="73" /><span class="True"> 73:</span> <span class="k"> * precision, or smaller dynamic range, not all values can be unpacked. What</span>
<a name="74" /><span class="True"> 74:</span> <span class="k"> * happens in such cases is partly accidental (alas).</span>
<a name="75" /><span class="True"> 75:</span> <span class="k"> */</span>
<a name="76" /><span class="True"> 76:</span>
<a name="77" /><span class="True"> 77:</span> <span class="k">/* The pack routines write 2, 4 or 8 bytes, starting at p. le is a bool</span>
<a name="78" /><span class="True"> 78:</span> <span class="k"> * argument, true if you want the string in little-endian format (exponent</span>
<a name="79" /><span class="True"> 79:</span> <span class="k"> * last, at p+1, p+3 or p+7), false if you want big-endian format (exponent</span>
<a name="80" /><span class="True"> 80:</span> <span class="k"> * first, at p).</span>
<a name="81" /><span class="True"> 81:</span> <span class="k"> * Return value: 0 if all is OK, -1 if error (and an exception is</span>
<a name="82" /><span class="True"> 82:</span> <span class="k"> * set, most likely OverflowError).</span>
<a name="83" /><span class="True"> 83:</span> <span class="k"> * There are two problems on non-IEEE platforms:</span>
<a name="84" /><span class="True"> 84:</span> <span class="k"> * 1): What this does is undefined if x is a NaN or infinity.</span>
<a name="85" /><span class="True"> 85:</span> <span class="k"> * 2): -0.0 and +0.0 produce the same string.</span>
<a name="86" /><span class="True"> 86:</span> <span class="k"> */</span>
<a name="87" /><span class="True"> 87:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyFloat_Pack2</span><span class="f">(</span><span class="m">double</span> <span class="b">x</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">le</span><span class="f">)</span><span class="f">;</span>
<a name="88" /><span class="True"> 88:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyFloat_Pack4</span><span class="f">(</span><span class="m">double</span> <span class="b">x</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">le</span><span class="f">)</span><span class="f">;</span>
<a name="89" /><span class="True"> 89:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyFloat_Pack8</span><span class="f">(</span><span class="m">double</span> <span class="b">x</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">le</span><span class="f">)</span><span class="f">;</span>
<a name="90" /><span class="True"> 90:</span>
<a name="91" /><span class="True"> 91:</span> <span class="k">/* Needed for the old way for marshal to store a floating point number.</span>
<a name="92" /><span class="True"> 92:</span> <span class="k"> Returns the string length copied into p, -1 on error.</span>
<a name="93" /><span class="True"> 93:</span> <span class="k"> */</span>
<a name="94" /><span class="True"> 94:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyFloat_Repr</span><span class="f">(</span><span class="m">double</span> <span class="b">x</span><span class="f">,</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="b">size_t</span> <span class="b">len</span><span class="f">)</span><span class="f">;</span>
<a name="95" /><span class="True"> 95:</span>
<a name="96" /><span class="True"> 96:</span> <span class="k">/* Used to get the important decimal digits of a double */</span>
<a name="97" /><span class="True"> 97:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyFloat_Digits</span><span class="f">(</span><span class="m">char</span> <span class="f">*</span><span class="b">buf</span><span class="f">,</span> <span class="m">double</span> <span class="b">v</span><span class="f">,</span> <span class="m">int</span> <span class="f">*</span><span class="b">signum</span><span class="f">)</span><span class="f">;</span>
<a name="98" /><span class="True"> 98:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyFloat_DigitsInit</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="99" /><span class="True"> 99:</span>
<a name="100" /><span class="True"> 100:</span> <span class="k">/* The unpack routines read 2, 4 or 8 bytes, starting at p. le is a bool</span>
<a name="101" /><span class="True"> 101:</span> <span class="k"> * argument, true if the string is in little-endian format (exponent</span>
<a name="102" /><span class="True"> 102:</span> <span class="k"> * last, at p+1, p+3 or p+7), false if big-endian (exponent first, at p).</span>
<a name="103" /><span class="True"> 103:</span> <span class="k"> * Return value: The unpacked double. On error, this is -1.0 and</span>
<a name="104" /><span class="True"> 104:</span> <span class="k"> * PyErr_Occurred() is true (and an exception is set, most likely</span>
<a name="105" /><span class="True"> 105:</span> <span class="k"> * OverflowError). Note that on a non-IEEE platform this will refuse</span>
<a name="106" /><span class="True"> 106:</span> <span class="k"> * to unpack a string that represents a NaN or infinity.</span>
<a name="107" /><span class="True"> 107:</span> <span class="k"> */</span>
<a name="108" /><span class="True"> 108:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">double</span><span class="f">)</span> <span class="b">_PyFloat_Unpack2</span><span class="f">(</span><span class="m">const</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">le</span><span class="f">)</span><span class="f">;</span>
<a name="109" /><span class="True"> 109:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">double</span><span class="f">)</span> <span class="b">_PyFloat_Unpack4</span><span class="f">(</span><span class="m">const</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">le</span><span class="f">)</span><span class="f">;</span>
<a name="110" /><span class="True"> 110:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">double</span><span class="f">)</span> <span class="b">_PyFloat_Unpack8</span><span class="f">(</span><span class="m">const</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="f">*</span><span class="b">p</span><span class="f">,</span> <span class="m">int</span> <span class="b">le</span><span class="f">)</span><span class="f">;</span>
<a name="111" /><span class="True"> 111:</span>
<a name="112" /><span class="True"> 112:</span> <span class="k">/* free list api */</span>
<a name="113" /><span class="True"> 113:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b"><API key></span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="114" /><span class="True"> 114:</span>
<a name="115" /><span class="True"> 115:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b"><API key></span><span class="f">(</span><span class="b">FILE</span><span class="f">*</span> <span class="b">out</span><span class="f">)</span><span class="f">;</span>
<a name="116" /><span class="True"> 116:</span>
<a name="117" /><span class="True"> 117:</span> <span class="k">/* Format the object based on the format_spec, as defined in PEP 3101</span>
<a name="118" /><span class="True"> 118:</span> <span class="k"> (Advanced String Formatting). */</span>
<a name="119" /><span class="True"> 119:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b"><API key></span><span class="f">(</span>
<a name="120" /><span class="True"> 120:</span> <span class="b">_PyUnicodeWriter</span> <span class="f">*</span><span class="b">writer</span><span class="f">,</span>
<a name="121" /><span class="True"> 121:</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span>
<a name="122" /><span class="True"> 122:</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">format_spec</span><span class="f">,</span>
<a name="123" /><span class="True"> 123:</span> <span class="b">Py_ssize_t</span> <span class="b">start</span><span class="f">,</span>
<a name="124" /><span class="True"> 124:</span> <span class="b">Py_ssize_t</span> <span class="b">end</span><span class="f">)</span><span class="f">;</span>
<a name="125" /><span class="True"> 125:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* Py_LIMITED_API */</span>
<a name="126" /><span class="True"> 126:</span>
<a name="127" /><span class="False"> 127:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="128" /><span class="False"> 128:</span> <span class="f">}</span>
<a name="129" /><span class="True"> 129:</span> <span class="f">#</span><span class="n">endif</span>
<a name="130" /><span class="True"> 130:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_FLOATOBJECT_H */</span>
<a name="131" /><span class="True"> 131:</span> </pre>
</body>
</html> |
<?php
if (!@include_once("./incl/auth.inc.php"))
include_once("../incl/auth.inc.php");
if ($AllowCreateFolder && isset($_GET['create']) && isset($_POST['directory_name']))
{
$umask = umask(0);
if (!is_valid_name(stripslashes($_POST['directory_name'])))
print "<font color='#CC0000'>$<API key></font>";
else if (file_exists($home_directory.$path.stripslashes($_POST['directory_name']."/")))
print "<font color='#CC0000'>$StrAlreadyExists</font>";
else if (@mkdir($home_directory.$path.stripslashes($_POST['directory_name']), 0777))
print "<font color='#009900'>$<API key></font>";
else
{
print "<font color='#CC0000'>$StrCreateFolderFail</font><br /><br />";
print $<API key>;
}
umask($umask);
}
else if ($AllowCreateFile && isset($_GET['create']) && isset($_POST['filename']))
{
if (!is_valid_name(stripslashes($_POST['filename'])))
print "<font color='#CC0000'>$StrFileInvalidName</font>";
else if (file_exists($home_directory.$path.stripslashes($_POST['filename'])))
print "<font color='#CC0000'>$StrAlreadyExists</font>";
else if (@fopen($home_directory.$path.stripslashes($_POST['filename']), "w+"))
print "<font color='#009900'>$<API key></font>";
else
{
print "<font color='#CC0000'>$StrCreateFileFail</font><br /><br />";
print $<API key>;
}
}
else if ($AllowCreateFolder || $AllowCreateFile)
{
print "<table class='index' width=90% cellpadding=0 cellspacing=0>";
print "<tr>";
print "<td class='iheadline' height=21>";
if ($_GET['type'] == "directory") print "<font class='iheadline'> $StrCreateFolder</font>";
else if ($_GET['type'] == "file") print "<font class='iheadline'> $StrCreateFile</font>";
print "</td>";
print "<td class='iheadline' align='right' height=21>";
print "<font class='iheadline'><a href='$base_url&path=".htmlentities(rawurlencode($path))."'><img src='icon/back.gif' border=0 alt='$StrBack'></a></font>";
print "</td>";
print "</tr>";
print "<tr>";
print "<td valign='top' colspan=2>";
print "<center><br />";
if ($_GET['type'] == "directory") print "$<API key><br /><br />";
else if ($_GET['type'] == "file") print "$<API key><br /><br />";
print "<form action='$base_url&output=create&create=true' method='post'>";
if ($_GET['type'] == "directory") print "<input name='directory_name' size=40> ";
else if ($_GET['type'] == "file") print "<input name='filename' size=40> ";
print "<input class='bigbutton' type='submit' value='$StrCreate'>";
print "<input type='hidden' name=path value=\"".htmlentities($path)."\">";
print "</form>";
print "<br /><br /></center>";
print "</td>";
print "</tr>";
print "</table>";
}
else
print "<font color='#CC0000'>$StrAccessDenied</font>";
?> |
<?php
if (isset($_POST['<API key>'])) {
echo "Submitted";
}
$data = $this->data;
?>
<form action="" method="post" id="grab-from-site-form" class="type-form">
<div class="<API key>">
<label for="fromSite">From Site</label>
<select name="fromSite" id="fromSite">
<option value=""></option>
<option value="imgur">Imgur</option>
<option value="sillyplace-old">SillyPlace (Old)</option>
</select>
<br />
<label for="pageURL">Page URL</label>
<input type="text" name="pageURL" id="pageURL" value="" />
<br />
<label for="grabImageTitles">Grab Image Titles?</label>
<input type="radio" name="grabImageTitles" id="grabImageTitlesYes" value="yes" checked>Yes
<input type="radio" name="grabImageTitles" id="grabImageTitlesNo" value="no">No<br />
<br />
<label for="<API key>">Grab Image Descriptions?</label>
<input type="radio" name="<API key>" id="<API key>" value="yes" checked>Yes
<input type="radio" name="<API key>" id="<API key>" value="no">No<br />
<br />
<label for="automaticCaptions">Automatic Captions?</label>
<input type="radio" name="automaticCaptions" id="<API key>" value="yes" checked>Yes
<input type="radio" name="automaticCaptions" id="automaticCaptionsNo" value="no">No<br />
<br /><br />
<input type="submit" class="button" id="<API key>" name="<API key>" value="Grab">
</div>
</form> |
# GemRB - Infinity Engine Emulator
# This program is free software; you can redistribute it and/or
# as published by the Free Software Foundation; either version 2
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#character generation, spells (GUISPL2)
import GemRB
import CharOverview
import CommonTables
import GUICommon
import LUSpellSelection
import IDLUCommon
import Spellbook
from ie_stats import IE_CLASS, IE_CLASSLEVELSUM, IE_KIT
from GUIDefines import <API key>
def OnLoad ():
SetupSpellsWindow (1)
def SetupSpellsWindow(chargen=0):
if chargen:
MyChar = GemRB.GetVar ("Slot")
Class = GemRB.GetPlayerStat (MyChar, IE_CLASS)
ClassName = GUICommon.GetClassRowName (Class, "class")
Level = 0
LevelDiff = 1
KitValue = GemRB.GetPlayerStat (MyChar, IE_KIT)
else:
MyChar = GemRB.<API key> ()
ClassIndex = GemRB.GetVar ("LUClass")
ClassName = GUICommon.GetClassRowName (ClassIndex, "index")
LevelDiff = GemRB.GetVar ("LevelDiff")
Level = GemRB.GetPlayerStat (MyChar, IE_CLASSLEVELSUM)
# this is only used for detecting specialists!
KitValue = GemRB.GetVar ("LUKit")
SpellTableName = CommonTables.ClassSkills.GetValue (ClassName, "MAGESPELL")
# charbase has domain slots reserved, so nuke them
if chargen:
Spellbook.UnsetupSpellLevels (MyChar, "MXSPLCLR", <API key>, 1)
# learn priest spells if any and setup spell levels
# but first nullify any previous spells
if chargen:
for row in range(CommonTables.ClassSkills.GetRowCount()):
rowname = CommonTables.ClassSkills.GetRowName (row)
SpellBookType = CommonTables.ClassSkills.GetValue (rowname, "SPLTYPE")
if SpellBookType != "*":
Spellbook.RemoveKnownSpells (MyChar, SpellBookType, 1,9, 0)
Spellbook.RemoveKnownSpells (MyChar, <API key>, 1,9, 0)
IDLUCommon.LearnAnySpells (MyChar, ClassName, chargen)
# make sure we have a correct table and that we're eligible
BookType = CommonTables.ClassSkills.GetValue (ClassName, "BOOKTYPE")
canLearn = chargen or Spellbook.IsSorcererBook (BookType) # bard / sorcerer
if SpellTableName == "*" or not canLearn:
if chargen:
GemRB.SetNextScript ("CharGen7")
else:
import GUIREC
GUIREC.FinishLevelUp ()
return
SpellBookType = CommonTables.ClassSkills.GetValue (ClassName, "SPLTYPE")
LUSpellSelection.OpenSpellsWindow (MyChar, SpellTableName, Level+LevelDiff, LevelDiff, KitValue, chargen, True, SpellBookType) |
#! /usr/bin/env python
import ppplot
import numpy as np
from optparse import OptionParser ### TBR by argparse
# inputs and options
parser = OptionParser()
parser.usage = \
'''
asciiplot.py [options] text file(s)
-- default is col2 for field and col1 for coord
-- this can be set with -x and -y options
(or use --swap if applicable)
-- one-column files are also supported
'''
parser.add_option('-x','--colx',action='store',dest='colx',type="int",default=1,help='column for x axis')
parser.add_option('-y','--coly',action='store',dest='coly',type="int",default=2,help='column for y axis')
parser.add_option('-s','--skip',action='store',dest='skiprows',type="int",default=0,help='skip first rows in file(s)')
parser.add_option('-u','--unique',action='store_true',dest='unique',default=False,help='case with one column only')
parser = ppplot.opt(parser) # common options for plots
parser = ppplot.opt1d(parser) # common options for plots
(opt,args) = parser.parse_args()
# plot object + options
pl = ppplot.plot1d()
# for all input files
count = 0
for fff in args:
# transfer options to plot object
pl.transopt(opt,num=count)
# load data
var = np.transpose(np.loadtxt(fff,skiprows=opt.skiprows))
# get coord
if len(var.shape) == 1:
pl.f = var
pl.x = None # important for chained plots
elif opt.unique:
pl.f = var[opt.coly-1]
pl.x = None
else:
pl.f = var[opt.coly-1]
pl.x = var[opt.colx-1]
# make plot
pl.make()
count = count + 1
# show plot
ppplot.show() |
<?php $captcha_word = 'F8HV'; ?> |
#ifndef <API key>
#define <API key>
#include <boost/ptr_container/ptr_list.hpp>
#include "mdxblock.hpp"
namespace wc3lib
{
namespace mdlx
{
/**
* Some MDX blocks are structured like:
* byte[4] MDX block name
* long32 group members count / group members bytes;
* ... group members list
* This class provides a simple abstraction layer for those MDX block classes.
* \todo Rename to GroupMdlxBlock
*/
class GroupMdxBlock : public MdxBlock
{
public:
/**
* \note We cannot use \ref boost::ptr_vector since blocks without counter can only estimate the number of members.
*/
typedef boost::ptr_list<class GroupMdxBlockMember> Members;
GroupMdxBlock(byte mdxIdentifier[mdxIdentifierSize], const string &mdlKeyword, bool usesCounter = true, bool optional = true, bool usesMdlCounter = false);
virtual ~GroupMdxBlock();
/**
* \return Returns true if members are stored by number of them. Otherwise their size in bytes is stored (exclusive byte count -> does not include its own size).
*/
bool usesCounter() const;
/**
* \return Returns true if members are stored in a separate MDL block like "Sequences <n>". Otherwise members are listed like attachments, for instance.
*/
bool usesMdlCounter() const;
Members& members();
const Members& members() const;
virtual std::streamsize readMdl(istream &istream) throw (class Exception);
virtual std::streamsize writeMdl(ostream &ostream) const throw (class Exception);
virtual std::streamsize readMdx(istream &istream) throw (class Exception);
virtual std::streamsize writeMdx(ostream &ostream) const throw (class Exception);
protected:
/**
* This method should be overwritten in child class.
* \return Returns a new allocated group member which will be added to list.
*/
virtual class GroupMdxBlockMember* createNewMember() = 0;
bool m_usesCounter;
bool m_usesMdlCounter;
/**
* Provides access to all read members for child class.
*/
Members m_members;
};
inline bool GroupMdxBlock::usesCounter() const
{
return m_usesCounter;
}
inline bool GroupMdxBlock::usesMdlCounter() const
{
return m_usesMdlCounter;
}
inline GroupMdxBlock::Members& GroupMdxBlock::members()
{
return m_members;
}
inline const GroupMdxBlock::Members& GroupMdxBlock::members() const
{
return m_members;
}
}
}
#endif |
<?php
class <API key> extends <API key>
{
function data()
{
$this->data =
'<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<dc:subject>Feed Category</dc:subject>
</channel>
</rss>';
}
function expected()
{
$this->expected = 'Feed Category';
}
}
?> |
using System.Web.Http;
using System.Web.Mvc;
namespace ProjectName.Presentation.Areas.HelpPage
{
public class <API key> : AreaRegistration
{
public override string AreaName
{
get
{
return "HelpPage";
}
}
public override void RegisterArea(<API key> context)
{
context.MapRoute(
"HelpPage_Default",
"Help/{action}/{apiId}",
new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
HelpPageConfig.Register(GlobalConfiguration.Configuration);
}
}
} |
#include <stdio.h>
#include <stdlib.h>
#define MAX 100
/*
* The pq[0] is the number of elements in the heap.
*/
int pq[MAX+1];
int N = 0; // Number of elements in the PQ
void swap(int *a, int *b)
{
int temp = *b;
*b = *a;
*a = *b;
}
/* Move the value at index k to satisfy the heap property */
void swim(int k)
{
while(k > 1 && (pq[k/2] < pq[k])) {
swap(pq[k/2], pq[k]);
k = k/2;
}
}
/* Move the parent to the correct position when it is smaller than the child.
*
*/
void sink(int k)
{
int small_child = 0;
while(2k < N ) {
if(pq[2k] < pq[2k+1]) {
small_child = 2k ;
} else {
small_child = 2k+1;
}
/* Heap property satisfied so stop */
if(! pq[k] < pq[small_child]) {
break;
}
swap(pq[k], pq[small_child]);
k = 2k;
}
}
/* Put the value in the last position of the array PQ and perform SWIM */
int insert(int value)
{
if(N < MAX) {
pq[++N] = value;
swim(N);
return 0;
}
return -1;
}
/* return the MAX of the heap and remove it form the heap structure.
* Swap the last element with the maximum element. Decrement N count.
* Do sink at the pq[1].
*/
int delete_max()
{
int max = pq[1];
swap(pq[1], pq[N]);
N
pq[N+1] = 0;
sink(1);
return max;
}
int main(int argc, char const *argv[])
{
memset(pq, 0, sizeof(pq));
N = 0;
return 0;
} |
package org.rubato.math.module;
public interface ProductFreeModule extends FreeModule {
public int getFactorCount();
public Ring[] getFactors();
public Ring getFactor(int i);
} |
<?php
ini_set("display_errors", 0);
require 'jsonwrapper.php';
list($usec, $sec) = explode(" ", microtime());
define('_SC_START', ((float) $usec + (float) $sec));
// Set flag that this is a parent file
define('_JEXEC', 1);
define(''/'', DIRECTORY_SEPARATOR);
$x = realpath(dirname(__FILE__) . '/' . ".." . '/' . ".." . '/' . ".." . '/');
if (!file_exists($x . '/' . "configuration.php") && isset($_SERVER['SCRIPT_FILENAME']))
{
$x = str_replace('/' . 'components' . '/' . 'com_jevents' . '/' . 'libraries' . '/' . 'checkconflict.php', '', $_SERVER['SCRIPT_FILENAME']);
}
define('JPATH_BASE', $x);
// create the mainframe object
$_REQUEST['tmpl'] = 'component';
// Create JSON data structure
$data = new stdClass();
$data->error = 0;
$data->result = "ERROR";
$data->user = "";
// Get JSON data
if (!array_key_exists("json", $_REQUEST))
{
throwerror("There was an error - no request data");
}
else
{
$requestData = $_REQUEST["json"];
if (isset($requestData))
{
try {
if (ini_get("magic_quotes_gpc"))
{
$requestData = stripslashes($requestData);
}
if (is_array($requestData))
{
// convert to an object
$requestObject = new stdClass();
foreach ($requestData as $key => $value)
{
if ($value == "false"){
$requestObject->$key = false;
}
else if ($value == "false"){
$requestObject->$key = true;
}
else {
$requestObject->$key = $value;
}
}
}
else
{
$requestObject = json_decode($requestData, 0);
if (!$requestObject)
{
$requestObject = json_decode(utf8_encode($requestData), 0);
}
}
}
catch (Exception $e) {
throwerror("There was an exception");
}
if (!$requestObject)
{
file_put_contents(dirname(__FILE__) . "/error.txt", var_export($requestData, true));
throwerror("There was an error - no request object ");
}
else if ($requestObject->error)
{
throwerror("There was an error - Request object error " . $requestObject->error);
}
else
{
try {
@ob_start();
$data = ProcessRequest($requestObject, $data);
// Must suppress any error messages
@ob_end_clean();
}
catch (Exception $e) {
throwerror("There was an exception " . $e->getMessage());
}
}
}
else
{
throwerror("Invalid Input");
}
}
header("Content-Type: application/x-javascript; charset=utf-8");
list ($usec, $sec) = explode(" ", microtime());
$time_end = (float) $usec + (float) $sec;
$data->timing = round($time_end - _SC_START, 4);
// Must suppress any error messages
@ob_end_clean();
echo json_encode($data);
function ProcessRequest(&$requestObject, $returnData)
{
define("REQUESTOBJECT", serialize($requestObject));
define("RETURNDATA", serialize($returnData));
// Do this ourselves to avoid Joomla 3.0 template path issues
// require_once JPATH_BASE . '/' . 'includes' . '/' . 'defines.php';
//Global definitions.
//Joomla framework path definitions.
$parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE);
//Defines.
define('JPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts));
define('JPATH_SITE', JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');
define('JPATH_LIBRARIES', JPATH_ROOT . '/libraries');
define('JPATH_PLUGINS', JPATH_ROOT . '/plugins');
define('JPATH_INSTALLATION', JPATH_ROOT . '/installation');
// IMPORTANT CHANGE!
$requestObject = unserialize(REQUESTOBJECT);
$client = "site";
if (isset($requestObject->client) && in_array($requestObject->client, array("site", "administrator")))
{
$client = $requestObject->client;
}
$patharray = array("site"=>JPATH_SITE, "administrator"=>JPATH_ADMINISTRATOR);
define('JPATH_THEMES', $patharray[$client] . '/templates');
define('JPATH_CACHE', JPATH_ROOT . '/cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . '/manifests');
require_once JPATH_BASE . '/' . 'includes' . '/' . 'framework.php';
$requestObject = unserialize(REQUESTOBJECT);
$returnData = unserialize(RETURNDATA);
$returnData->allclear = 1;
ini_set("display_errors", 0);
global $option;
$client = "site";
if (isset($requestObject->client) && in_array($requestObject->client, array("site", "administrator")))
{
$client = $requestObject->client;
}
$mainframe = JFactory::getApplication($client);
JFactory::getApplication()->initialise();
$option = "com_jevents";
// Not sure why this is needed but it is if (use use $mainframe = JFactory::getApplication($client); )!!!
// needed for Joomla 1.5 plugins
$GLOBALS['mainframe'] = $mainframe;
$lang = JFactory::getLanguage();
$lang->load("com_jevents", JPATH_SITE);
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
include_once(JPATH_SITE . "/components/com_jevents/jevents.defines.php");
$params = JComponentHelper::getParams("com_jevents");
if (!$params->get("checkconflicts", 0))
return $returnData;
// Do we ignore overlaps
if (JEVHelper::isEventDeletor(true) && isset($requestObject->formdata->overlapoverride) && $requestObject->formdata->overlapoverride==1){
return $returnData;
}
// Enforce referrer
if (!$params->get("skipreferrer", 0))
{
if (!array_key_exists("HTTP_REFERER", $_SERVER))
{
throwerror("There was an error - no referrer info available");
}
$live_site = $_SERVER['HTTP_HOST'];
$ref_parts = parse_url($_SERVER["HTTP_REFERER"]);
if (!isset($ref_parts["host"]) || ($ref_parts["host"] . (isset($ref_parts["port"]) ? ':' . $ref_parts["port"] : '')) != $live_site)
{
throwerror("There was an error - missing host in referrer");
}
}
if ($params->get("icaltimezonelive", "") != "" && is_callable("<API key>") && $params->get("icaltimezonelive", "") != "")
{
$timezone = <API key>();
$tz = $params->get("icaltimezonelive", "");
<API key>($tz);
$registry = JRegistry::getInstance("jevents");
$registry->set("jevents.timezone", $timezone);
}
$token = JSession::getFormToken();
if (!isset($requestObject->token) || strcmp($requestObject->token, $token)!==0)
{
throwerror("There was an error - bad token. Please refresh the page and try again.");
}
$user = JFactory::getUser();
if (!JEVHelper::isEventCreator())
{
throwerror("There was an error - not an event creator");
}
if (intval($requestObject->formdata->evid) > 0)
{
$db = JFactory::getDBO();
$dataModel = new JEventsDataModel("JEventsAdminDBModel");
$queryModel = new JEventsDBModel($dataModel);
$event = $queryModel->getEventById(intval($requestObject->formdata->evid), 1, "icaldb");
//$db->setQuery("SELECT * FROM #__jevents_vevent where ev_id=".intval($requestObject->formdata->evid));
// $event = $db->loadObject();
if (!$event || (!JEVHelper::canEditEvent($event) ))
{
throwerror("There was an error - cannot edit this event");
}
}
$returnData->overlaps = array();
if ($requestObject->pressbutton == "icalrepeat.apply" || $requestObject->pressbutton == "icalrepeat.save")
{
$testrepeat = simulateSaveRepeat($requestObject);
// now we have out event and its repetitions we now check to see for overlapping events
$overlaps = checkRepeatOverlaps($testrepeat, $returnData, intval($requestObject->formdata->evid), $requestObject);
}
else
{
$testevent = simulateSaveEvent($requestObject);
// now we have out event and its repetitions we now check to see for overlapping events
$overlaps = checkEventOverlaps($testevent, $returnData, intval($requestObject->formdata->evid), $requestObject);
}
if (count($overlaps) > 0)
{
$returnData->allclear = 0;
foreach ($overlaps as $olp)
{
$overlap = new stdClass();
$overlap->event_id = $olp->eventid;
$overlap->eventdetail_id = $olp->eventdetail_id;
$overlap->summary = $olp->summary;
$overlap->rp_id = $olp->rp_id;
$overlap->startrepeat = $olp->startrepeat;
$overlap->endrepeat = $olp->endrepeat;
list($y, $m, $d, $h, $m, $d) = sscanf($olp->startrepeat, "%d-%d-%d %d:%d:%d");
$tstring = JText::_("JEV_OVERLAP_MESSAGE");
$overlap->conflictMessage = sprintf($tstring, $olp->summary, JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_4"), JevDate::strtotime($olp->startrepeat)), JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_4"), JevDate::strtotime($olp->endrepeat)), $olp->conflictCause);
$overlap->conflictMessage = addslashes($overlap->conflictMessage);
$overlap->url = JURI::root() . "index.php?option=com_jevents&task=icalrepeat.detail&evid=" . $olp->rp_id . "&year=$y&month=$m&day=$d";
$overlap->url = str_replace("components/com_jevents/libraries/", "", $overlap->url);
$returnData->overlaps[] = $overlap;
}
}
if ($requestObject->error)
{
$returnData->allclear = 0;
return "Error";
}
return $returnData;
}
function throwerror($msg)
{
$data = new stdClass();
//"document.getElementById('products').innerHTML='There was an error - no valid argument'");
$data->error = "alert('" . $msg . "')";
$data->result = "ERROR";
$data->user = "";
header("Content-Type: application/x-javascript");
require 'jsonwrapper.php';
// Must suppress any error messages
@ob_end_clean();
echo json_encode($data);
exit();
}
function simulateSaveEvent($requestObject)
{
if (!JEVHelper::isEventCreator())
{
throwerror(JText::_('ALERTNOTAUTH'));
}
// Convert formdata to array
$formdata = array();
foreach (get_object_vars($requestObject->formdata) as $k => $v)
{
$k = str_replace("[]", "", $k);
$formdata[$k] = $v;
}
// If the allow HTML flag is set, apply a safe HTML filter to the variable
// $array = JRequest::_cleanVar($formdata, JREQUEST_ALLOWHTML);
$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
$array = $safeHtmlFilter->clean($formdata, null);
$dataModel = new JEventsDataModel("JEventsAdminDBModel");
$queryModel = new JEventsDBModel($dataModel);
$rrule = SaveIcalEvent::generateRRule($array);
// ensure authorised
if (isset($array["evid"]) && $array["evid"] > 0)
{
$event = $queryModel->getEventById(intval($array["evid"]), 1, "icaldb");
if (!JEVHelper::canEditEvent($event))
{
throwerror(JText::_('ALERTNOTAUTH'));
}
}
$row = false;
// do dry run of event saving!
if ($event = SaveIcalEvent::save($array, $queryModel, $rrule, true))
{
$row = new jIcalEventDB($event);
$row->repetitions = $event->_repetitions;
if (is_array($row->_catid)){
$row->_catids = $row->_catid;
$row->_catid = $row->_catid[0];
}
}
else
{
throwerror(JText::_('EVENT_NOT_SAVED'));
}
return $row;
}
function simulateSaveRepeat($requestObject)
{
include_once(JPATH_SITE . "/components/com_jevents/jevents.defines.php");
if (!JEVHelper::isEventCreator())
{
throwerror(JText::_('ALERTNOTAUTH'));
}
// Convert formdata to array
$formdata = array();
foreach (get_object_vars($requestObject->formdata) as $k => $v)
{
$k = str_replace("[]", "", $k);
$formdata[$k] = $v;
}
//$array = JRequest::_cleanVar($formdata, JREQUEST_ALLOWHTML);
$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
$array = $safeHtmlFilter->clean($formdata, null);
if (!array_key_exists("rp_id", $array) || intval($array["rp_id"]) <= 0)
{
throwerror(JText::_("Not a repeat", true));
}
$rp_id = intval($array["rp_id"]);
$dataModel = new JEventsDataModel("JEventsAdminDBModel");
$queryModel = new JEventsDBModel($dataModel);
// I should be able to do this in one operation but that can come later
$event = $queryModel->listEventsById(intval($rp_id), 1, "icaldb");
if (!JEVHelper::canEditEvent($event))
{
throwerror(JText::_('ALERTNOTAUTH'));
}
$db = JFactory::getDBO();
$rpt = new iCalRepetition($db);
$rpt->load($rp_id);
$query = "SELECT detail_id FROM #__jevents_vevent WHERE ev_id=$rpt->eventid";
$db->setQuery($query);
$eventdetailid = $db->loadResult();
$data["UID"] = valueIfExists($array, "uid", md5(uniqid(rand(), true)));
$data["X-EXTRAINFO"] = valueIfExists($array, "extra_info", "");
$data["LOCATION"] = valueIfExists($array, "location", "");
$data["allDayEvent"] = valueIfExists($array, "allDayEvent", "off");
$data["CONTACT"] = valueIfExists($array, "contact_info", "");
// allow raw HTML (mask =2)
$data["DESCRIPTION"] = valueIfExists($array, "jevcontent", "", 'request', 'html', 2);
$data["publish_down"] = valueIfExists($array, "publish_down", "2006-12-12");
$data["publish_up"] = valueIfExists($array, "publish_up", "2006-12-12");
if (isset($array["publish_down2"]) && $array["publish_down2"]){
$data["publish_down"] = $array["publish_down2"];
}
if (isset($array["publish_up2"]) && $array["publish_up2"]){
$data["publish_up"] = $array["publish_up2"];
}
$interval = valueIfExists($array, "rinterval", 1);
$data["SUMMARY"] = valueIfExists($array, "title", "");
$data["MULTIDAY"] = intval(valueIfExists($array, "multiday", "1"));
$data["NOENDTIME"] = intval(valueIfExists($array, "noendtime", 0));
$ics_id = valueIfExists($array, "ics_id", 0);
if ($data["allDayEvent"] == "on")
{
$start_time = "00:00";
}
else
$start_time = valueIfExists($array, "start_time", "08:00");
$publishstart = $data["publish_up"] . ' ' . $start_time . ':00';
$data["DTSTART"] = JevDate::strtotime($publishstart);
if ($data["allDayEvent"] == "on")
{
$end_time = "23:59";
$publishend = $data["publish_down"] . ' ' . $end_time . ':59';
}
else
{
$end_time = valueIfExists($array, "end_time", "15:00");
$publishend = $data["publish_down"] . ' ' . $end_time . ':00';
}
$data["DTEND"] = JevDate::strtotime($publishend);
// iCal for whole day uses 00:00:00 on the next day JEvents uses 23:59:59 on the same day
list ($h, $m, $s) = explode(":", $end_time . ':00');
if (($h + $m + $s) == 0 && $data["allDayEvent"] == "on" && $data["DTEND"] > $data["DTSTART"])
{
$publishend = JevDate::strftime('%Y-%m-%d 23:59:59', ($data["DTEND"] - 86400));
$data["DTEND"] = JevDate::strtotime($publishend);
}
$data["X-COLOR"] = valueIfExists($array, "color", "");
// Add any custom fields into $data array
foreach ($array as $key => $value)
{
if (strpos($key, "custom_") === 0)
{
$data[$key] = $value;
}
}
// populate rpt with data
$start = $data["DTSTART"];
$end = $data["DTEND"];
$rpt->startrepeat = JevDate::strftime('%Y-%m-%d %H:%M:%S', $start);
$rpt->endrepeat = JevDate::strftime('%Y-%m-%d %H:%M:%S', $end);
$rpt->duplicatecheck = md5($rpt->eventid . $start);
$rpt->rp_id = $rp_id;
$rpt->event = $event;
return $rpt;
}
function valueIfExists($array, $key, $default)
{
if (!array_key_exists($key, $array))
return $default;
return $array[$key];
}
function checkEventOverlaps($testevent, & $returnData, $eventid, $requestObject)
{
$params = JComponentHelper::getParams("com_jevents");
$db = JFactory::getDBO();
$overlaps = array();
if ( $params->get("checkconflicts", 0)==2 )
{
foreach ($testevent->repetitions as $repeat)
{
$sql = "SELECT *, ev.state FROM #<API key> as rpt ";
$sql .= " LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id=rpt.eventdetail_id ";
$sql .= " LEFT JOIN #__jevents_vevent as ev ON ev.ev_id=rpt.eventid ";
$sql .= " WHERE rpt.eventid<>" . intval($eventid) . " AND rpt.startrepeat<" . $db->Quote($repeat->endrepeat) . " AND rpt.endrepeat>" . $db->Quote($repeat->startrepeat);
$sql .= " AND ev.state=1";
$sql .= " LIMIT 100";
$db->setQuery($sql);
$conflicts = $db->loadObjectList();
if ($conflicts && count($conflicts) > 0)
{
foreach ($conflicts as &$conflict)
{
$conflict->conflictCause = JText::_("JEV_GENERAL_OVERLAP");
}
unset($conflict);
$overlaps = array_merge($overlaps, $conflicts);
}
}
}
else if ( ($params->get("checkconflicts", 0)==1) )
{
$dataModel = new JEventsDataModel();
$dbModel = new JEventsDBModel($dataModel);
// First of all check for Category overlaps
$catids = $testevent->catids() ? $testevent->catids() : array($testevent->catid());
$skipCatTest = false;
$catinfo = $dbModel->getCategoryInfo( $catids );
if ($catinfo && count($catinfo) >0)
{
foreach ($catids as $c => $specificCatid){
if (isset($catinfo[$catids[$c]])){
$cinfo = $catinfo[$catids[$c]];
$catparams = json_decode($cinfo->params);
if (!$catparams->overlaps)
{
unset($catids[$c]);
}
}
}
if (count($catids)==0){
$skipCatTest = true;
}
}
else {
$skipCatTest = true;
}
if (!$skipCatTest)
{
foreach ($testevent->repetitions as $repeat)
{
$sql = "SELECT *, evt.catid , evt.state";
if ($params->get("multicategory", 0))
{
$sql .= ", GROUP_CONCAT(DISTINCT catmap.catid SEPARATOR ',') as catids";
}
$sql .= " FROM #<API key> as rpt ";
$sql .= " LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id=rpt.eventdetail_id ";
$sql .= " LEFT JOIN #__jevents_vevent as evt ON evt.ev_id=rpt.eventid ";
if ($params->get("multicategory", 0))
{
$sql .= " LEFT JOIN #__jevents_catmap as catmap ON catmap.evid = rpt.eventid";
$sql .= " LEFT JOIN #__categories AS catmapcat ON catmap.catid = catmapcat.id";
}
$sql .= " WHERE rpt.eventid<>" . intval($eventid) . " AND rpt.startrepeat<" . $db->Quote($repeat->endrepeat) . " AND rpt.endrepeat>" . $db->Quote($repeat->startrepeat);
$sql .= " AND evt.state=1";
if ($params->get("multicategory", 0))
{
$sql .= " AND catmap.catid IN(" . implode(",",$catids) . ") GROUP BY rpt.rp_id";
}
else {
$sql .= " AND (evt.catid=" . $testevent->catid() . ") GROUP BY rpt.rp_id";
}
$sql .= " LIMIT 100";
$db->setQuery($sql);
$conflicts = $db->loadObjectList();
if ($conflicts && count($conflicts) > 0)
{
foreach ($conflicts as &$conflict)
{
$conflictCats = isset($conflict->catids) ? explode(",",$conflict->catids) : array($conflict->catid);
$catname = array();
foreach ($conflictCats as $cc){
if (isset($catinfo[$cc])){
$catname[] = $catinfo[$cc]->title;
}
}
$cat = count($catname)>0 ? implode(", ",$catname) : $testevent->getCategoryName();
$conflict->conflictCause = JText::sprintf("JEV_CATEGORY_CLASH", $cat);
}
unset($conflict);
$overlaps = array_merge($overlaps, $conflicts);
}
}
}
// Next check for Calendar overlaps
$db = JFactory::getDbo();
$db->setQuery("SELECT * FROM #__jevents_icsfile WHERE ics_id = ".$testevent->icsid());
$calinfo = $db->loadObject();
if ($calinfo && intval($calinfo->overlaps)==1)
{
foreach ($testevent->repetitions as $repeat)
{
$sql = "SELECT *, evt.state FROM #<API key> as rpt ";
$sql .= " LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id=rpt.eventdetail_id ";
$sql .= " LEFT JOIN #__jevents_vevent as evt ON evt.ev_id=rpt.eventid ";
$sql .= " WHERE rpt.eventid<>" . intval($eventid) . " AND rpt.startrepeat<" . $db->Quote($repeat->endrepeat) . " AND rpt.endrepeat>" . $db->Quote($repeat->startrepeat);
$sql .= " AND evt.state=1";
$sql .= " AND evt.icsid=" . $testevent->icsid() . " GROUP BY rpt.rp_id";
$sql .= " LIMIT 100";
$db->setQuery($sql);
$conflicts = $db->loadObjectList();
if ($conflicts && count($conflicts) > 0)
{
foreach ($conflicts as &$conflict)
{
$conflict->conflictCause = JText::sprintf("JEV_CALENDAR_CLASH", $calinfo->label);
}
unset($conflict);
$overlaps = array_merge($overlaps, $conflicts);
}
}
}
}
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('<API key>', array(&$testevent, &$overlaps, $eventid, $requestObject));
return $overlaps;
}
function checkRepeatOverlaps($repeat, & $returnData, $eventid, $requestObject)
{
$params = JComponentHelper::getParams("com_jevents");
$db = JFactory::getDBO();
$overlaps = array();
if ( $params->get("checkconflicts", 0) == 2 )
{
$sql = "SELECT *, ev.state FROM #<API key> as rpt ";
$sql .= " LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id=rpt.eventdetail_id ";
$sql .= " LEFT JOIN #__jevents_vevent as ev ON ev.ev_id=rpt.eventid ";
$sql .= " WHERE rpt.rp_id<>" . intval($repeat->rp_id) . " AND rpt.startrepeat<" . $db->Quote($repeat->endrepeat) . " AND rpt.endrepeat>" . $db->Quote($repeat->startrepeat);
$sql .= " AND ev.state=1";
$sql .= " LIMIT 100";
$db->setQuery($sql);
$conflicts = $db->loadObjectList();
if ($conflicts && count($conflicts) > 0)
{
foreach ($conflicts as &$conflict)
{
$conflict->conflictCause = JText::_("JEV_GENERAL_OVERLAP");
}
unset($conflict);
$overlaps = array_merge($overlaps, $conflicts);
}
}
else if ( $params->get("checkconflicts", 0) == 1 )
{
$dataModel = new JEventsDataModel();
$dbModel = new JEventsDBModel($dataModel);
$catids =$repeat->event->catids() ;
if (!$catids){
$catids = array($repeat->event->catid());
}
$skipCatTest = false;
$catinfo = $dbModel->getCategoryInfo($catids);
if ($catinfo && count($catinfo) >0)
{
for ($c=0;$c<count($catids);$c++){
if (isset($catinfo[$catids[$c]])){
$cinfo = $catinfo[$catids[$c]];
$catparams = json_decode($cinfo->params);
if (!$catparams->overlaps)
{
unset($catids[$c]);
}
}
}
if (count($catids)==0){
$skipCatTest = true;
}
}
else {
$skipCatTest = true;
}
if (!$skipCatTest)
{
$sql = "SELECT *, evt.catid, evt.state ";
if ($params->get("multicategory", 0))
{
$sql .= ", GROUP_CONCAT(DISTINCT catmap.catid SEPARATOR ',') as catids";
}
$sql .= " FROM #<API key> as rpt ";
$sql .= " LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id=rpt.eventdetail_id ";
$sql .= " LEFT JOIN #__jevents_vevent as evt ON evt.ev_id=rpt.eventid ";
if ($params->get("multicategory", 0))
{
$sql .= " LEFT JOIN #__jevents_catmap as catmap ON catmap.evid = rpt.eventid";
$sql .= " LEFT JOIN #__categories AS catmapcat ON catmap.catid = catmapcat.id";
}
$sql .= " WHERE rpt.rp_id<>" . intval($repeat->rp_id) . " AND rpt.startrepeat<" . $db->Quote($repeat->endrepeat) . " AND rpt.endrepeat>" . $db->Quote($repeat->startrepeat);
$sql .= " AND evt.state=1";
if ($params->get("multicategory", 0))
{
$sql .= " AND catmap.catid IN(" . implode(",",$catids) . ") GROUP BY rpt.rp_id";
}
else {
$sql .= " AND (evt.catid=" . $repeat->event->catid() . ") GROUP BY rpt.rp_id";
}
$sql .= " LIMIT 100";
$db->setQuery($sql);
$conflicts = $db->loadObjectList();
if ($conflicts && count($conflicts) > 0)
{
foreach ($conflicts as &$conflict)
{
$conflictCats = isset($conflict->catids) ? explode(",",$conflict->catids) : array($conflict->catid);
$catname = array();
foreach ($conflictCats as $cc){
if (isset($catinfo[$cc])){
$catname[] = $catinfo[$cc]->title;
}
}
$cat = count($catname)>0 ? implode(", ",$catname) : $testevent->getCategoryName();
$conflict->conflictCause = JText::sprintf("JEV_CATEGORY_CLASH", $cat);
}
unset($conflict);
$overlaps = array_merge($overlaps, $conflicts);
}
}
}
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('<API key>', array(&$repeat, &$overlaps, $eventid, $requestObject));
return $overlaps;
} |
// Cyphesis Online RPG Server and AI Engine
// This program is free software; you can redistribute it and/or modify
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "Quaternion.h"
#include "Vector3D.h"
#include <wfmath/quaternion.h>
// The arguments to this function have been swapped over because in
// the form provided in the example code, the result appeared to be
// a rotation in the wrong direction. This may be a bug in my apogee
// code, or it may be this code.
template<class V>
const Quaternion quaternionFromTo(const V & from, const V & to)
{
float cosT = Dot(from, to);
if (cosT > 0.99999f) {
return Quaternion(1.f, 0.f, 0.f, 0.f);
} else if (cosT < -0.99999f) {
V t(0.0, from.x(), -from.y());
if (t.sqrMag() < 1e-12) {
t = V(-from.z(), 0.0, from.x());
}
t.normalize();
return Quaternion(0.f, t.x(), t.y(), t.z());
}
V t = Cross(from, to);
t.normalize();
float ss = std::sqrt(0.5f * (1.0f - cosT));
float x = t.x() * ss;
float y = t.y() * ss;
float z = t.z() * ss;
float w = std::sqrt(0.5f * (1.0f + cosT));
return Quaternion(w, x, y, z);
}
template
const Quaternion quaternionFromTo<Vector3D>(const Vector3D &, const Vector3D&); |
#upload{
margin:30px 200px; padding:15px;
font-weight:bold; font-size:1.3em;
font-family:Arial, Helvetica, sans-serif;
text-align:center;
background:#f2f2f2;
color:#3366cc;
border:1px solid #ccc;
width:150px;
cursor:pointer !important;
-moz-border-radius:5px; -<API key>:5px;
}
.darkbg{
background:#ddd !important;
}
#status{
font-family:Arial; padding:5px;
}
ul#files{ list-style:none; padding:0; margin:0; }
ul#files li{ padding:10px; margin-bottom:2px; width:200px; float:left; margin-right:10px;}
ul#files li img{ max-width:180px; max-height:150px; }
.success{ background:#99f099; border:1px solid #339933; }
.error{ background:#f0c6c3; border:1px solid #cc6622; } |
#ifdef PAIR_CLASS
PairStyle(airebo/intel,PairAIREBOIntel)
#else
#ifndef <API key>
#define <API key>
#include "pair.h"
#include "fix_intel.h"
#include "pair_airebo.h"
namespace LAMMPS_NS {
template<class flt_t, class acc_t>
struct <API key>;
class PairAIREBOIntel : public PairAIREBO {
public:
PairAIREBOIntel(class LAMMPS *);
virtual ~PairAIREBOIntel();
virtual void compute(int, int);
virtual void init_style();
protected:
template <class flt_t, class acc_t>
void compute(int eflag, int vflag, IntelBuffers<flt_t,acc_t> *buffers);
template <int EVFLAG, int EFLAG, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(IntelBuffers<flt_t,acc_t> * buffers);
template <class flt_t, class acc_t>
<API key><flt_t,acc_t> get_param();
FixIntel * fix;
int _cop;
int * REBO_cnumneigh;
int * REBO_num_skin;
int * REBO_list_data;
};
}
#endif
#endif |
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Clovemix
*/
get_header(); ?>
<div class="content-area">
<div class="container main_content_wrap">
<div class="page_wrapper">
<section id="site-main" class="site-main content-part" >
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
//If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template();
?>
<?php endwhile; // end of the loop. ?>
</section>
<?php get_sidebar(); ?>
<div class="clear"></div>
</div><!--end .page_wrapper
</div>
</div>
<?php get_footer(); ?> |
<?php
?>
<?php
$modifer = 'none';
if ( is_404() ) {
$modifer = '404';
} elseif ( is_search() ) {
$modifer = 'search';
}
?>
<article class="article article--<?php echo esc_attr( $modifer ); ?>">
<div class="entry">
<div class="entry__content">
<?php if ( is_404() ) : ?>
<p>
<?php _e( 'Woops! Page not found.', 'habakiri' ); ?><br />
<?php _e( 'The page you are looking for may be moved or deleted.', 'habakiri' ); ?><br />
<?php _e ( 'Please search this serch box.', 'habakiri' ); ?>
</p>
<p>
<?php get_search_form(); ?>
</p>
<?php elseif ( is_search() ) : ?>
<p>
<?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'habakiri' ); ?>
</p>
<p>
<?php get_search_form(); ?>
</p>
<?php else : ?>
<p>
<?php _e( 'No posts.', 'habakiri' ); ?>
</p>
<?php endif; ?>
<!-- end .entry__content --></div>
<!-- end .entry --></div>
</article> |
<?php
// no direct access
defined('_JEXEC') or die;
?>
<ul class="menu">
<?php
require JModuleHelper::getLayoutPath('<API key>', $params->get('layout', 'default').'_items');
?></ul> |
/*
* $Id: snmp_api_util.h 17 2008-01-16 09:25:35Z slavik $
*/
#ifndef <API key>
#define <API key>
/*
* snmp_api_util.h - API management.
* Didier DESIDERIO (SINFOR) - November 26th, 1997
*/
#define PACKET_LENGTH 4500
/*
* A list of all the outstanding requests for a particular session.
*/
struct request_list {
struct request_list *next_request;
int request_id; /* request id */
int retries; /* Number of retries */
u_int timeout; /* length to wait for timeout */
struct timeval time; /* Time this request was made */
struct timeval expire; /* time this request is due to expire */
struct snmp_pdu *pdu; /* The pdu for this request (saved so it can be retransmitted */
};
/*
* The list of active/open sessions.
*/
struct session_list {
struct session_list *next;
struct snmp_session *session;
struct <API key> *internal;
};
struct <API key> {
int sd; /* socket descriptor for this connection */
ipaddr addr; /* address of connected peer */
struct request_list *requests; /* Info about outstanding requests */
};
/* Define these here, as they aren't defined normall under
* cygnus Win32 stuff.
*/
#undef timercmp
#define timercmp(tvp, uvp, cmp) \
(((tvp)->tv_sec) cmp ((uvp)->tv_sec)) || \
((((tvp)->tv_sec) == ((uvp)->tv_sec)) && \
(((tvp)->tv_usec) cmp ((uvp)->tv_usec)))
#undef timerclear
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#undef timerisset
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#ifdef HAVE_SRAND
#define random rand
#define srandom srand
#endif /* HAVE_SRAND */
#ifdef __cplusplus
extern "C" {
#endif
int <API key>(struct snmp_session *session_);
int <API key>(struct snmp_session *session_, struct timeval *timeout);
int <API key>(struct snmp_session *sp_);
#ifdef __cplusplus
}
#endif
#endif /* <API key> */ |
#!/bin/bash
source experiment/run-library.sh
manifest="${PARAM_manifest:-conf/contperf/manifest.zip}"
inventory="${PARAM_inventory:-conf/contperf/inventory.ini}"
private_key="${PARAM_private_key:-conf/contperf/id_rsa_perf}"
<API key>="${<API key>:-8}"
<API key>="${<API key>:-1200}"
<API key>="${<API key>:-https://registry-1.docker.io}"
<API key>="${<API key>:-http://repos.example.com/repo*}"
<API key>="${<API key>:-http://storage.example.com/iso-repos*}"
wait_interval=${PARAM_wait_interval:-50}
cdn_url_mirror="${<API key>:-https://cdn.redhat.com/}"
cdn_url_full="${PARAM_cdn_url_full:-https://cdn.redhat.com/}"
<API key>=${<API key>:-https://registry-1.docker.io/}
PARAM_iso_repos=${PARAM_iso_repos:-http://storage.example.com/iso-repos/}
repo_sat_tools="${<API key>:-http://mirror.example.com/<API key>/}"
do="Default Organization"
dl="Default Location"
opts="--forks 100 -i $inventory --private-key $private_key"
opts_adhoc="$opts --user root -e @conf/satperf.yaml -e @conf/satperf.local.yaml"
section "Checking environment"
<API key>
section "Sync mixed repo"
ap 10-test-sync-mixed.log playbooks/tests/<API key>.yaml -e "<API key>=$<API key> <API key>=$<API key> <API key>=$<API key> <API key>=$<API key> <API key>=$<API key>"
section "Summary"
e SyncRepositoriesYum $logs/10-test-sync-mixed.log
e <API key> $logs/10-test-sync-mixed.log
e SyncRepositoriesISO $logs/10-test-sync-mixed.log
e PublishContentViews $logs/10-test-sync-mixed.log
e PromoteContentViews $logs/10-test-sync-mixed.log
junit_upload |
import argparse
from erv import create_app
# Create the flask app.
app = create_app()
# Run the app
if __name__ == '__main__':
# Define the arguments.
parser = argparse.ArgumentParser()
parser.add_argument(
'--host',
default='0.0.0.0',
help='Host to bind to: [%(default)s].')
parser.add_argument(
'--port',
type=int,
default=app.config['SERVER_PORT'],
help='Port to listen to: [%(default)s].')
parser.add_argument(
'--debug',
action='store_true',
default=False,
help='Debug mode: [%(default)s].')
# Parse arguemnts and run the app.
args = parser.parse_args()
app.run(debug=args.debug, host=args.host, port=args.port) |
package com.flickr4java.flickr.stats;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Domain {
/**
* Logger.
*/
@SuppressWarnings("unused")
private static Logger _log = LoggerFactory.getLogger(Domain.class);
public Domain() {
}
public Domain(String name, Long views) {
super();
this.name = name;
this.views = views;
}
private String name;
private Long views;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getViews() {
return views;
}
public void setViews(Long views) {
this.views = views;
}
public void setViews(String views) {
try {
setViews(new Long(views));
} catch (<API key> e) {
// ignore and set value as null
}
}
@Override
public String toString() {
return String.format("%s (%d)", name, views);
}
} |
<!--div class="<API key> md-whiteframe-z1">
<table id="table" class="table table-hover table-bordered">
<thead>
<tr>
<th>
<th>state</th>
<th>Year</th>
<th>rate_class</th>
<th>num_oil_wells</th>
<th>oil_prod_BBL</th>
<th>ADgas_prod_MCF</th>
<th>oil_wells_dayson</th>
<th>num_gas_wells</th>
<th>NAgas_prod_MCF</th>
<th>conden_prod_BBL</th>
<th>gas_wells_dayson</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in vm.tableData track by $index">
<td data-title="ID">{{$index + 1}}</td>
<td data-title="State">{{data.state}}</td>
<td data-title="prod_year">{{data.prod_year}}</td>
<td data-title="rate_class">{{data.rate_class}}</td>
<td data-title="num_oil_wells">{{data.num_oil_wells}}</td>
<td data-title="oil_prod_BBL">{{data.oil_prod_BBL}}</td>
<td data-title="ADgas_prod_MCF">{{data.ADgas_prod_MCF}}</td>
<td data-title="oil_wells_dayson">{{data.oil_wells_dayson}}</td>
<td data-title="num_gas_wells">{{data.num_gas_wells}}</td>
<td data-title="NAgas_prod_MCF">{{data.NAgas_prod_MCF}}</td>
<td data-title="conden_prod_BBL">{{data.conden_prod_BBL}}</td>
<td data-title="gas_wells_dayson">{{data.gas_wells_dayson}}</td>
</tr>
</tbody>
</table>
</div
<<API key>>
<h2 class="md-title">Table</h2>
</<API key>>
<<API key>>
<table md-data-table md-row-select="selected">
<thead >
<tr>
<th name="state"></th>
<th numeric name="prod_year"></th>
<th numeric name="rate_class"></th>
<th numeric name="num_oil_wells"></th>
<th numeric name="oil_prod_BBL"></th>
<th numeric name="ADgas_prod_MCF"></th>
<th numeric name="oil_wells_dayson"></th>
<th numeric name="num_gas_wells"></th>
<th numeric name="NAgas_prod_MCF"></th>
<th numeric name="conden_prod_BBL"></th>
<th numeric name="gas_wells_dayson"></th>
</tr>
</thead>
<tbody>
<tr md-auto-select ng-repeat="row in data">
<td>{{row.state}}</td>
<td>{{row.prod_year}}</td>
<td>{{row.rate_class }}</td>
<td>{{row.num_oil_wells}}</td>
<td>{{row.oil_prod_BBL}}</td>
<td>{{row.ADgas_prod_MCF}}</td>
<td>{{row.oil_wells_dayson}}</td>
<td>{{row.num_gas_wells}}</td>
<td>{{row.NAgas_prod_MCF}}</td>
<td>{{row.conden_prod_BBL}}</td>
<td>{{row.gas_wells_dayson}}</td>
</tr>
</tbody>
</table>
</<API key>>
<<API key> md-limit="query.limit" md-page="query.page" md-total="{{data.length}}" md-trigger="onPaginationChange"></<API key>> |
INSERT INTO `secObjectName` (`objectName`, `description`, `orgapplicable`) VALUES ('_admin.schedule.curprovider_only','allow provider with non-admin role to create schedule templates and assign to themselves', 0); |
<?php
class <API key> extends Google_Collection
{
protected $collection_key = 'entries';
protected $<API key> = array(
);
protected $entriesType = '<API key>';
protected $entriesDataType = 'array';
public function setEntries($entries)
{
$this->entries = $entries;
}
public function getEntries()
{
return $this->entries;
}
} |
<?php
/* @DEPRECATED */
defined('_JEXEC') or die;
require_once dirname(__DIR__) . '/assignment.php';
class <API key> extends RLAssignment
{
public function passPageTypes()
{
return $this->passByPageTypes('com_easyblog', $this->selection, $this->assignment);
}
public function passCategories()
{
if ($this->request->option != 'com_easyblog')
{
return $this->pass(false);
}
$pass = (
($this->params->inc_categories && $this->request->view == 'categories')
|| ($this->params->inc_items && $this->request->view == 'entry')
);
if (!$pass)
{
return $this->pass(false);
}
$cats = $this->makeArray($this->getCategories());
$pass = $this->passSimple($cats, 'include');
if ($pass && $this->params->inc_children == 2)
{
return $this->pass(false);
}
else if (!$pass && $this->params->inc_children)
{
foreach ($cats as $cat)
{
$cats = array_merge($cats, $this->getCatParentIds($cat));
}
}
return $this->passSimple($cats);
}
private function getCategories()
{
switch ($this->request->view)
{
case 'entry' :
return $this-><API key>();
break;
case 'categories' :
return $this->request->id;
break;
default:
return '';
}
}
private function <API key>()
{
$query = $this->db->getQuery(true)
->select('i.category_id')
->from('#__easyblog_post AS i')
->where('i.id = ' . (int) $this->request->id);
$this->db->setQuery($query);
return $this->db->loadResult();
}
public function passTags()
{
if ($this->request->option != 'com_easyblog')
{
return $this->pass(false);
}
$pass = (
($this->params->inc_tags && $this->request->layout == 'tag')
|| ($this->params->inc_items && $this->request->view == 'entry')
);
if (!$pass)
{
return $this->pass(false);
}
if ($this->params->inc_tags && $this->request->layout == 'tag')
{
$query = $this->db->getQuery(true)
->select('t.alias')
->from('#__easyblog_tag AS t')
->where('t.id = ' . (int) $this->request->id)
->where('t.published = 1');
$this->db->setQuery($query);
$tags = $this->db->loadColumn();
return $this->passSimple($tags, true);
}
$query = $this->db->getQuery(true)
->select('t.alias')
->from('#__easyblog_post_tag AS x')
->join('LEFT', '#__easyblog_tag AS t ON t.id = x.tag_id')
->where('x.post_id = ' . (int) $this->request->id)
->where('t.published = 1');
$this->db->setQuery($query);
$tags = $this->db->loadColumn();
return $this->passSimple($tags, true);
}
public function passItems()
{
if (!$this->request->id || $this->request->option != 'com_easyblog' || $this->request->view != 'entry')
{
return $this->pass(false);
}
$pass = false;
// Pass Article Id
if (!$this->passItemByType($pass, 'ContentIds'))
{
return $this->pass(false);
}
// Pass Content Keywords
if (!$this->passItemByType($pass, 'ContentKeywords'))
{
return $this->pass(false);
}
// Pass Authors
if (!$this->passItemByType($pass, 'Authors'))
{
return $this->pass(false);
}
return $this->pass($pass);
}
public function passContentKeywords($fields = ['title', 'intro', 'content'], $text = '')
{
parent::passContentKeywords($fields);
}
public function getItem($fields = [])
{
$query = $this->db->getQuery(true)
->select($fields)
->from('#__easyblog_post')
->where('id = ' . (int) $this->request->id);
$this->db->setQuery($query);
return $this->db->loadObject();
}
private function getCatParentIds($id = 0)
{
return $this->getParentIds($id, 'easyblog_category', 'parent_id');
}
} |
#ifndef _VIKING_UIBUILDER_H
#define _VIKING_UIBUILDER_H
#include <gtk/gtk.h>
G_BEGIN_DECLS
/* Parameters (for I/O and Properties) */
typedef union {
gdouble d;
guint32 u;
gint32 i;
gboolean b;
const gchar *s;
GdkColor c;
GList *sl;
} VikLayerParamData;
typedef enum {
<API key>=0,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
} VikLayerWidgetType;
/* id is index */
typedef enum {
<API key>=1,
<API key>,
VIK_LAYER_PARAM_INT,
/* in my_layer_set_param, if you want to use the string, you should dup it
* in my_layer_get_param, the string returned will NOT be free'd, you are responsible for managing it (I think) */
<API key>,
<API key>,
<API key>,
/* NOTE: string list works uniquely: data.sl should NOT be free'd when
* the internals call get_param -- i.e. it should be managed w/in the layer.
* The value passed by the internals into set_param should also be managed
* by the layer -- i.e. free'd by the layer.
*/
<API key>,
} VikLayerParamType;
typedef enum {
VIK_LAYER_AGGREGATE = 0,
VIK_LAYER_TRW,
VIK_LAYER_COORD,
VIK_LAYER_GEOREF,
VIK_LAYER_GPS,
VIK_LAYER_MAPS,
VIK_LAYER_DEM,
VIK_LAYER_NUM_TYPES // Also use this value to indicate no layer association
} VikLayerTypeEnum;
// Default value has to be returned via a function
// because certain types value are can not be statically allocated
// (i.e. a string value that is dependent on other functions)
// Also easier for colours to be set via a function call rather than a static assignment
typedef VikLayerParamData (*VikLayerDefaultFunc) ( void );
typedef struct {
VikLayerTypeEnum layer;
const gchar *name;
VikLayerParamType type;
gint16 group;
const gchar *title;
VikLayerWidgetType widget_type;
gpointer widget_data;
gpointer extra_widget_data;
const gchar *tooltip;
VikLayerDefaultFunc default_value;
} VikLayerParam;
enum {
<API key>=-2,
<API key>=-1
};
typedef struct {
gdouble min;
gdouble max;
gdouble step;
guint8 digits;
} VikLayerParamScale;
/* Annoyingly 'C' cannot initialize unions properly */
/* It's dependent on the standard used or the compiler support... */
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L || __GNUC__
#define VIK_LPD_BOOLEAN(X) (VikLayerParamData) { .b = (X) }
#define VIK_LPD_INT(X) (VikLayerParamData) { .u = (X) }
#define VIK_LPD_UINT(X) (VikLayerParamData) { .i = (X) }
#define VIK_LPD_COLOR(X,Y,Z,A) (VikLayerParamData) { .c = (GdkColor){ (X), (Y), (Z), (A) } }
#define VIK_LPD_DOUBLE(X) (VikLayerParamData) { .d = (X) }
#else
#define VIK_LPD_BOOLEAN(X) (VikLayerParamData) { (X) }
#define VIK_LPD_INT(X) (VikLayerParamData) { (X) }
#define VIK_LPD_UINT(X) (VikLayerParamData) { (X) }
#define VIK_LPD_COLOR(X,Y,Z,A) (VikLayerParamData) { (X), (Y), (Z), (A) }
#define VIK_LPD_DOUBLE(X) (VikLayerParamData) { (X) }
#endif
VikLayerParamData <API key> ( void );
VikLayerParamData <API key> ( void );
GtkWidget *<API key> ( VikLayerParam *param, VikLayerParamData data );
VikLayerParamData <API key> ( GtkWidget *widget, VikLayerParam *param );
gint <API key> ( const gchar *dialog_name,
GtkWindow *parent,
VikLayerParam *params,
guint16 params_count,
gchar **groups,
guint8 groups_count,
gboolean (*setparam) (gpointer,guint16,VikLayerParamData,gpointer,gboolean),
gpointer pass_along1,
gpointer pass_along2,
VikLayerParamData (*getparam) (gpointer,guint16,gboolean),
gpointer pass_along_getparam );
/* pass_along1 and pass_along2 are for set_param first and last params */
VikLayerParamData *<API key> ( const gchar *dialog_name, GtkWindow *parent, VikLayerParam *params,
guint16 params_count, gchar **groups, guint8 groups_count,
VikLayerParamData *params_defaults );
/* frees data from last (if ness) */
void <API key> ( VikLayerParamData *paramdatas, VikLayerParam *params, guint16 params_count );
G_END_DECLS
#endif |
Object
===
Starting base to develop the JSON convertion.
The goal here is to make a codec converter for a json into any json node type. Here I began for jsons into forms, but I planed to make jsonParams able to convert jsons into everything (I am actually thinking about changing the template parameter behavior).
I planed to make it able to convert to:
- SVG shapes
- any html diplaying
- etc
- - -
I also planed to make this sandbox project having a recursive display, so we can make Object into Object for example. |
# Makefile for the touchscreen drivers.
# Each configuration option enables a list of files.
wm97xx-ts-y := wm97xx-core.o
obj-$(<API key>) += 88pm860x-ts.o
obj-$(<API key>) += ad7877.o
obj-$(<API key>) += ad7879.o
obj-$(<API key>) += ad7879-i2c.o
obj-$(<API key>) += ad7879-spi.o
obj-$(<API key>) += ads7846.o
obj-$(<API key>) += atmel_mxt_ts.o
obj-$(<API key>) += atmel_tsadcc.o
obj-$(<API key>) += auo-pixcir-ts.o
obj-$(<API key>) += h3600_ts_input.o
obj-$(<API key>) += bu21013_ts.o
obj-$(<API key>) += cy8ctmg110_ts.o
obj-$(<API key>) += cyttsp_core.o
obj-$(<API key>) += cyttsp_i2c.o
obj-$(<API key>) += cyttsp_spi.o
obj-$(<API key>) += da9034-ts.o
obj-$(<API key>) += dynapro.o
obj-$(<API key>) += hampshire.o
obj-$(<API key>) += gunze.o
obj-$(<API key>) += eeti_ts.o
obj-$(<API key>) += elo.o
obj-$(<API key>) += egalax_ts.o
obj-$(<API key>) += fujitsu_ts.o
obj-$(<API key>) += ili210x.o
obj-$(<API key>) += inexio.o
obj-$(<API key>) += intel-mid-touch.o
obj-$(<API key>) += lpc32xx_ts.o
obj-$(<API key>) += max11801_ts.o
obj-$(<API key>) += mc13783_ts.o
obj-$(<API key>) += mcs5000_ts.o
obj-$(<API key>) += migor_ts.o
obj-$(<API key>) += mtouch.o
obj-$(<API key>) += mk712.o
obj-$(<API key>) += hp680_ts_input.o
obj-$(<API key>) += jornada720_ts.o
obj-$(<API key>) += htcpen.o
obj-$(<API key>) += usbtouchscreen.o
obj-$(<API key>) += pcap_ts.o
obj-$(<API key>) += penmount.o
obj-$(<API key>) += pixcir_i2c_ts.o
obj-$(<API key>) += s3c2410_ts.o
obj-$(<API key>) += st1232.o
obj-$(<API key>) += stmpe-ts.o
obj-$(<API key>) += ti_tscadc.o
obj-$(<API key>) += tnetv107x-ts.o
obj-$(<API key>) += synaptics_i2c_rmi.o
obj-$(<API key>) += touchit213.o
obj-$(<API key>) += touchright.o
obj-$(<API key>) += touchwin.o
obj-$(<API key>) += tsc40.o
obj-$(<API key>) += tsc2005.o
obj-$(<API key>) += tsc2007.o
obj-$(<API key>) += ucb1400_ts.o
obj-$(<API key>) += wacom_w8001.o
obj-$(<API key>) += wm831x-ts.o
obj-$(<API key>) += wm97xx-ts.o
wm97xx-ts-$(<API key>) += wm9705.o
wm97xx-ts-$(<API key>) += wm9712.o
wm97xx-ts-$(<API key>) += wm9713.o
obj-$(<API key>) += atmel-wm97xx.o
obj-$(<API key>) += mainstone-wm97xx.o
obj-$(<API key>) += zylonite-wm97xx.o
obj-$(<API key>) += w90p910_ts.o
obj-$(<API key>) += tps6507x-ts.o |
#ifndef __XFS_QUOTA_H__
#define __XFS_QUOTA_H__
struct xfs_trans;
/*
* The ondisk form of a dquot structure.
*/
#define XFS_DQUOT_MAGIC 0x4451
#define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */
/*
* uid_t and gid_t are hard-coded to 32 bits in the inode.
* Hence, an 'id' in a dquot is 32 bits..
*/
typedef __uint32_t xfs_dqid_t;
/*
* Even though users may not have quota limits occupying all 64-bits,
* they may need 64-bit accounting. Hence, 64-bit quota-counters,
* and quota-limits. This is a waste in the common case, but hey ...
*/
typedef __uint64_t xfs_qcnt_t;
typedef __uint16_t xfs_qwarncnt_t;
/*
* This is the main portion of the on-disk representation of quota
* information for a user. This is the q_core of the xfs_dquot_t that
* is kept in kernel memory. We pad this with some more expansion room
* to construct the on disk structure.
*/
typedef struct xfs_disk_dquot {
__be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
__u8 d_version; /* dquot version */
__u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
__be32 d_id; /* user,project,group id */
__be64 d_blk_hardlimit;/* absolute limit on disk blks */
__be64 d_blk_softlimit;/* preferred limit on disk blks */
__be64 d_ino_hardlimit;/* maximum # allocated inodes */
__be64 d_ino_softlimit;/* preferred inode limit */
__be64 d_bcount; /* disk blocks owned by the user */
__be64 d_icount; /* inodes owned by the user */
__be32 d_itimer; /* zero if within inode limits if not,
this is when we refuse service */
__be32 d_btimer; /* similar to above; for disk blocks */
__be16 d_iwarns; /* warnings issued wrt num inodes */
__be16 d_bwarns; /* warnings issued wrt disk blocks */
__be32 d_pad0; /* 64 bit align */
__be64 d_rtb_hardlimit;/* absolute limit on realtime blks */
__be64 d_rtb_softlimit;/* preferred limit on RT disk blks */
__be64 d_rtbcount; /* realtime blocks owned */
__be32 d_rtbtimer; /* similar to above; for RT disk blocks */
__be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
__be16 d_pad;
} xfs_disk_dquot_t;
/*
* This is what goes on disk. This is separated from the xfs_disk_dquot because
* carrying the unnecessary padding would be a waste of memory.
*/
typedef struct xfs_dqblk {
xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */
char dd_fill[4]; /* filling for posterity */
/*
* These two are only present on filesystems with the CRC bits set.
*/
__be32 dd_crc; /* checksum */
__be64 dd_lsn; /* last modification in log */
uuid_t dd_uuid; /* location information */
} xfs_dqblk_t;
/*
* flags for q_flags field in the dquot.
*/
#define XFS_DQ_USER 0x0001 /* a user quota */
#define XFS_DQ_PROJ 0x0002 /* project quota */
#define XFS_DQ_GROUP 0x0004 /* a group quota */
#define XFS_DQ_DIRTY 0x0008 /* dquot is dirty */
#define XFS_DQ_FREEING 0x0010 /* dquot is beeing torn down */
#define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP)
#define XFS_DQ_FLAGS \
{ XFS_DQ_USER, "USER" }, \
{ XFS_DQ_PROJ, "PROJ" }, \
{ XFS_DQ_GROUP, "GROUP" }, \
{ XFS_DQ_DIRTY, "DIRTY" }, \
{ XFS_DQ_FREEING, "FREEING" }
/*
* In the worst case, when both user and group quotas are on,
* we can have a max of three dquots changing in a single transaction.
*/
#define XFS_DQUOT_LOGRES(mp) (sizeof(xfs_disk_dquot_t) * 3)
/*
* These are the structures used to lay out dquots and quotaoff
* records on the log. Quite similar to those of inodes.
*/
/*
* log format struct for dquots.
* The first two fields must be the type and size fitting into
* 32 bits : log_recovery code assumes that.
*/
typedef struct xfs_dq_logformat {
__uint16_t qlf_type; /* dquot log item type */
__uint16_t qlf_size; /* size of this item */
xfs_dqid_t qlf_id; /* usr/grp/proj id : 32 bits */
__int64_t qlf_blkno; /* blkno of dquot buffer */
__int32_t qlf_len; /* len of dquot buffer */
__uint32_t qlf_boffset; /* off of dquot in buffer */
} xfs_dq_logformat_t;
/*
* log format struct for QUOTAOFF records.
* The first two fields must be the type and size fitting into
* 32 bits : log_recovery code assumes that.
* We write two LI_QUOTAOFF logitems per quotaoff, the last one keeps a pointer
* to the first and ensures that the first logitem is taken out of the AIL
* only when the last one is securely committed.
*/
typedef struct xfs_qoff_logformat {
unsigned short qf_type; /* quotaoff log item type */
unsigned short qf_size; /* size of this item */
unsigned int qf_flags; /* USR and/or GRP */
char qf_pad[12]; /* padding for future */
} <API key>;
/*
* Disk quotas status in m_qflags, and also sb_qflags. 16 bits.
*/
#define XFS_UQUOTA_ACCT 0x0001 /* user quota accounting ON */
#define XFS_UQUOTA_ENFD 0x0002 /* user quota limits enforced */
#define XFS_UQUOTA_CHKD 0x0004 /* quotacheck run on usr quotas */
#define XFS_PQUOTA_ACCT 0x0008 /* project quota accounting ON */
#define XFS_OQUOTA_ENFD 0x0010 /* other (grp/prj) quota limits enforced */
#define XFS_OQUOTA_CHKD 0x0020 /* quotacheck run on other (grp/prj) quotas */
#define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */
/*
* Quota Accounting/Enforcement flags
*/
#define XFS_ALL_QUOTA_ACCT \
(XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT)
#define XFS_ALL_QUOTA_ENFD (XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD)
#define XFS_ALL_QUOTA_CHKD (XFS_UQUOTA_CHKD | XFS_OQUOTA_CHKD)
#define <API key>(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
#define <API key>(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT)
#define <API key>(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT)
#define <API key>(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT)
#define <API key>(mp) ((mp)->m_qflags & XFS_UQUOTA_ENFD)
#define <API key>(mp) ((mp)->m_qflags & XFS_OQUOTA_ENFD)
/*
* Incore only flags for quotaoff - these bits get cleared when quota(s)
* are in the process of getting turned off. These flags are in m_qflags but
* never in sb_qflags.
*/
#define XFS_UQUOTA_ACTIVE 0x0100 /* uquotas are being turned off */
#define XFS_PQUOTA_ACTIVE 0x0200 /* pquotas are being turned off */
#define XFS_GQUOTA_ACTIVE 0x0400 /* gquotas are being turned off */
#define <API key> \
(XFS_UQUOTA_ACTIVE | XFS_PQUOTA_ACTIVE | XFS_GQUOTA_ACTIVE)
/*
* Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees
* quota will be not be switched off as long as that inode lock is held.
*/
#define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & (XFS_UQUOTA_ACTIVE | \
XFS_GQUOTA_ACTIVE | \
XFS_PQUOTA_ACTIVE))
#define XFS_IS_OQUOTA_ON(mp) ((mp)->m_qflags & (XFS_GQUOTA_ACTIVE | \
XFS_PQUOTA_ACTIVE))
#define XFS_IS_UQUOTA_ON(mp) ((mp)->m_qflags & XFS_UQUOTA_ACTIVE)
#define XFS_IS_GQUOTA_ON(mp) ((mp)->m_qflags & XFS_GQUOTA_ACTIVE)
#define XFS_IS_PQUOTA_ON(mp) ((mp)->m_qflags & XFS_PQUOTA_ACTIVE)
/*
* Flags to tell various functions what to do. Not all of these are meaningful
* to a single function. None of these XFS_QMOPT_* flags are meant to have
* persistent values (ie. their values can and will change between versions)
*/
#define XFS_QMOPT_DQALLOC 0x0000002 /* alloc dquot ondisk if needed */
#define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */
#define XFS_QMOPT_PQUOTA 0x0000008 /* project dquot requested */
#define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */
#define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num */
#define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed */
#define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */
#define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */
#define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj) */
/*
* flags to xfs_trans_mod_dquot to indicate which field needs to be
* modified.
*/
#define <API key> 0x0010000
#define <API key> 0x0020000
#define XFS_QMOPT_BCOUNT 0x0040000
#define XFS_QMOPT_ICOUNT 0x0080000
#define XFS_QMOPT_RTBCOUNT 0x0100000
#define XFS_QMOPT_DELBCOUNT 0x0200000
#define <API key> 0x0400000
#define XFS_QMOPT_RES_INOS 0x0800000
/*
* flags for dqalloc.
*/
#define XFS_QMOPT_INHERIT 0x1000000
/*
* flags to xfs_trans_mod_dquot.
*/
#define <API key> <API key>
#define <API key> <API key>
#define <API key> XFS_QMOPT_RES_INOS
#define XFS_TRANS_DQ_BCOUNT XFS_QMOPT_BCOUNT
#define <API key> XFS_QMOPT_DELBCOUNT
#define XFS_TRANS_DQ_ICOUNT XFS_QMOPT_ICOUNT
#define <API key> XFS_QMOPT_RTBCOUNT
#define <API key> <API key>
#define XFS_QMOPT_QUOTALL \
(XFS_QMOPT_UQUOTA | XFS_QMOPT_PQUOTA | XFS_QMOPT_GQUOTA)
#define <API key> (<API key> | <API key>)
#ifdef __KERNEL__
/*
* This check is done typically without holding the inode lock;
* that may seem racy, but it is harmless in the context that it is used.
* The inode cannot go inactive as long a reference is kept, and
* therefore if dquot(s) were attached, they'll stay consistent.
* If, for example, the ownership of the inode changes while
* we didn't have the inode locked, the appropriate dquot(s) will be
* attached atomically.
*/
#define XFS_NOT_DQATTACHED(mp, ip) ((XFS_IS_UQUOTA_ON(mp) &&\
(ip)->i_udquot == NULL) || \
(XFS_IS_OQUOTA_ON(mp) && \
(ip)->i_gdquot == NULL))
#define <API key>(mp) \
((XFS_IS_UQUOTA_ON(mp) && \
(mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD) == 0) || \
(XFS_IS_GQUOTA_ON(mp) && \
((mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD) == 0 || \
(mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT))) || \
(XFS_IS_PQUOTA_ON(mp) && \
((mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD) == 0 || \
(mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT))))
#define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\
XFS_OQUOTA_ENFD|XFS_OQUOTA_CHKD|\
XFS_GQUOTA_ACCT)
/*
* The structure kept inside the xfs_trans_t keep track of dquot changes
* within a transaction and apply them later.
*/
typedef struct xfs_dqtrx {
struct xfs_dquot *qt_dquot; /* the dquot this refers to */
ulong qt_blk_res; /* blks reserved on a dquot */
ulong qt_blk_res_used; /* blks used from the reservation */
ulong qt_ino_res; /* inode reserved on a dquot */
ulong qt_ino_res_used; /* inodes used from the reservation */
long qt_bcount_delta; /* dquot blk count changes */
long qt_delbcnt_delta; /* delayed dquot blk count changes */
long qt_icount_delta; /* dquot inode count changes */
ulong qt_rtblk_res; /* # blks reserved on a dquot */
ulong qt_rtblk_res_used;/* # blks used from reservation */
long qt_rtbcount_delta;/* dquot realtime blk changes */
long qt_delrtb_delta; /* delayed RT blk count changes */
} xfs_dqtrx_t;
#ifdef CONFIG_XFS_QUOTA
extern void <API key>(struct xfs_trans *, struct xfs_trans *);
extern void <API key>(struct xfs_trans *);
extern void <API key>(struct xfs_trans *, struct xfs_inode *,
uint, long);
extern void <API key>(struct xfs_trans *);
extern void <API key>(struct xfs_trans *);
extern int <API key>(struct xfs_trans *,
struct xfs_inode *, long, long, uint);
extern int <API key>(struct xfs_trans *,
struct xfs_mount *, struct xfs_dquot *,
struct xfs_dquot *, long, long, uint);
extern int xfs_qm_vop_dqalloc(struct xfs_inode *, uid_t, gid_t, prid_t, uint,
struct xfs_dquot **, struct xfs_dquot **);
extern void <API key>(struct xfs_trans *, struct xfs_inode *,
struct xfs_dquot *, struct xfs_dquot *);
extern int <API key>(struct xfs_inode **);
extern struct xfs_dquot *xfs_qm_vop_chown(struct xfs_trans *,
struct xfs_inode *, struct xfs_dquot **, struct xfs_dquot *);
extern int <API key>(struct xfs_trans *, struct xfs_inode *,
struct xfs_dquot *, struct xfs_dquot *, uint);
extern int xfs_qm_dqattach(struct xfs_inode *, uint);
extern int <API key>(struct xfs_inode *, uint);
extern void xfs_qm_dqdetach(struct xfs_inode *);
extern void xfs_qm_dqrele(struct xfs_dquot *);
extern void xfs_qm_statvfs(struct xfs_inode *, struct kstatfs *);
extern int xfs_qm_newmount(struct xfs_mount *, uint *, uint *);
extern void xfs_qm_mount_quotas(struct xfs_mount *);
extern void xfs_qm_unmount(struct xfs_mount *);
extern void <API key>(struct xfs_mount *);
#else
static inline int
xfs_qm_vop_dqalloc(struct xfs_inode *ip, uid_t uid, gid_t gid, prid_t prid,
uint flags, struct xfs_dquot **udqp, struct xfs_dquot **gdqp)
{
*udqp = NULL;
*gdqp = NULL;
return 0;
}
#define <API key>(tp, tp2)
#define <API key>(tp)
#define <API key>(tp, ip, fields, delta)
#define <API key>(tp)
#define <API key>(tp)
static inline int <API key>(struct xfs_trans *tp,
struct xfs_inode *ip, long nblks, long ninos, uint flags)
{
return 0;
}
static inline int <API key>(struct xfs_trans *tp,
struct xfs_mount *mp, struct xfs_dquot *udqp,
struct xfs_dquot *gdqp, long nblks, long nions, uint flags)
{
return 0;
}
#define <API key>(tp, ip, u, g)
#define <API key>(it) (0)
#define xfs_qm_vop_chown(tp, ip, old, new) (NULL)
#define <API key>(tp, ip, u, g, fl) (0)
#define xfs_qm_dqattach(ip, fl) (0)
#define <API key>(ip, fl) (0)
#define xfs_qm_dqdetach(ip)
#define xfs_qm_dqrele(d)
#define xfs_qm_statvfs(ip, s)
#define xfs_qm_newmount(mp, a, b) (0)
#define xfs_qm_mount_quotas(mp)
#define xfs_qm_unmount(mp)
#define <API key>(mp)
#endif /* CONFIG_XFS_QUOTA */
#define <API key>(tp, ip, nblks, ninos, flags) \
<API key>(tp, ip, -(nblks), -(ninos), flags)
#define <API key>(tp, mp, ud, gd, nb, ni, f) \
<API key>(tp, mp, ud, gd, nb, ni, \
f | <API key>)
extern int xfs_qm_dqcheck(struct xfs_mount *, xfs_disk_dquot_t *,
xfs_dqid_t, uint, uint, char *);
extern int <API key>(struct xfs_mount *);
extern const struct xfs_buf_ops xfs_dquot_buf_ops;
#endif /* __KERNEL__ */
#endif /* __XFS_QUOTA_H__ */ |
#ifndef _REGS_H
#define _REGS_H
#define TBD 0
struct XENA_dev_config {
u64 general_int_status;
#define GEN_INTR_TXPIC s2BIT(0)
#define GEN_INTR_TXDMA s2BIT(1)
#define GEN_INTR_TXMAC s2BIT(2)
#define GEN_INTR_TXXGXS s2BIT(3)
#define GEN_INTR_TXTRAFFIC s2BIT(8)
#define GEN_INTR_RXPIC s2BIT(32)
#define GEN_INTR_RXDMA s2BIT(33)
#define GEN_INTR_RXMAC s2BIT(34)
#define GEN_INTR_MC s2BIT(35)
#define GEN_INTR_RXXGXS s2BIT(36)
#define GEN_INTR_RXTRAFFIC s2BIT(40)
#define GEN_ERROR_INTR GEN_INTR_TXPIC | GEN_INTR_RXPIC | \
GEN_INTR_TXDMA | GEN_INTR_RXDMA | \
GEN_INTR_TXMAC | GEN_INTR_RXMAC | \
GEN_INTR_TXXGXS| GEN_INTR_RXXGXS| \
GEN_INTR_MC
u64 general_int_mask;
u8 unused0[0x100 - 0x10];
u64 sw_reset;
#define SW_RESET_XENA vBIT(0xA5,0,8)
#define SW_RESET_FLASH vBIT(0xA5,8,8)
#define SW_RESET_EOI vBIT(0xA5,16,8)
#define SW_RESET_ALL (SW_RESET_XENA | \
SW_RESET_FLASH | \
SW_RESET_EOI)
#define SW_RESET_RAW_VAL 0xA5000000
u64 adapter_status;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
#define <API key> s2BIT(2)
#define <API key> s2BIT(3)
#define <API key> s2BIT(5)
#define <API key> s2BIT(6)
#define <API key> s2BIT(7)
#define <API key> vBIT(0xFF,8,8)
#define <API key> vBIT(0x0F,8,8)
#define <API key> vBIT(0xFF,16,8)
#define <API key> s2BIT(24)
#define <API key> s2BIT(25)
#define <API key> s2BIT(26)
#define <API key> s2BIT(30)
#define <API key> s2BIT(31)
u64 adapter_control;
#define ADAPTER_CNTL_EN s2BIT(7)
#define ADAPTER_EOI_TX_ON s2BIT(15)
#define ADAPTER_LED_ON s2BIT(23)
#define ADAPTER_UDPI(val) vBIT(val,36,4)
#define ADAPTER_WAIT_INT s2BIT(48)
#define ADAPTER_ECC_EN s2BIT(55)
u64 serr_source;
#define SERR_SOURCE_PIC s2BIT(0)
#define SERR_SOURCE_TXDMA s2BIT(1)
#define SERR_SOURCE_RXDMA s2BIT(2)
#define SERR_SOURCE_MAC s2BIT(3)
#define SERR_SOURCE_MC s2BIT(4)
#define SERR_SOURCE_XGXS s2BIT(5)
#define SERR_SOURCE_ANY (SERR_SOURCE_PIC | \
SERR_SOURCE_TXDMA | \
SERR_SOURCE_RXDMA | \
SERR_SOURCE_MAC | \
SERR_SOURCE_MC | \
SERR_SOURCE_XGXS)
u64 pci_mode;
#define GET_PCI_MODE(val) ((val & vBIT(0xF, 0, 4)) >> 60)
#define PCI_MODE_PCI_33 0
#define PCI_MODE_PCI_66 0x1
#define PCI_MODE_PCIX_M1_66 0x2
#define <API key> 0x3
#define <API key> 0x4
#define PCI_MODE_PCIX_M2_66 0x5
#define <API key> 0x6
#define <API key> 0x7
#define <API key> s2BIT(0)
#define PCI_MODE_32_BITS s2BIT(8)
#define <API key> s2BIT(9)
u8 unused_0[0x800 - 0x128];
u64 pic_int_status;
u64 pic_int_mask;
#define PIC_INT_TX s2BIT(0)
#define PIC_INT_FLSH s2BIT(1)
#define PIC_INT_MDIO s2BIT(2)
#define PIC_INT_IIC s2BIT(3)
#define PIC_INT_GPIO s2BIT(4)
#define PIC_INT_RX s2BIT(32)
u64 txpic_int_reg;
u64 txpic_int_mask;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
#define <API key> s2BIT(8)
#define <API key> s2BIT(9)
#define <API key> s2BIT(10)
#define <API key> s2BIT(11)
#define <API key> s2BIT(13)
#define <API key> s2BIT(14)
#define <API key> s2BIT(15)
#define <API key> s2BIT(21)
#define <API key> s2BIT(23)
#define <API key> s2BIT(48)
#define <API key> s2BIT(50)
u64 txpic_alarms;
u64 rxpic_int_reg;
u64 rxpic_int_mask;
u64 rxpic_alarms;
u64 flsh_int_reg;
u64 flsh_int_mask;
#define <API key> s2BIT(63)
#define <API key> s2BIT(62)
u64 flash_alarms;
u64 mdio_int_reg;
u64 mdio_int_mask;
#define <API key> s2BIT(0)
#define <API key> s2BIT(8)
#define MDIO_INT_REG_LASI s2BIT(39)
u64 mdio_alarms;
u64 iic_int_reg;
u64 iic_int_mask;
#define <API key> s2BIT(4)
#define <API key> s2BIT(5)
#define <API key> s2BIT(6)
#define <API key> s2BIT(7)
#define IIC_INT_REG_ACK_ERR s2BIT(8)
u64 iic_alarms;
u8 unused4[0x08];
u64 gpio_int_reg;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
#define <API key> s2BIT(2)
u64 gpio_int_mask;
#define <API key> s2BIT(1)
#define <API key> s2BIT(2)
u64 gpio_alarms;
u8 unused5[0x38];
u64 tx_traffic_int;
#define TX_TRAFFIC_INT_n(n) s2BIT(n)
u64 tx_traffic_mask;
u64 rx_traffic_int;
#define RX_TRAFFIC_INT_n(n) s2BIT(n)
u64 rx_traffic_mask;
u64 pic_control;
#define <API key> s2BIT(0)
#define <API key>(n) vBIT(n,11,5)
u64 swapper_ctrl;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
#define <API key> s2BIT(8)
#define <API key> s2BIT(9)
#define SWAPPER_CTRL_TXP_FE s2BIT(16)
#define SWAPPER_CTRL_TXP_SE s2BIT(17)
#define <API key> s2BIT(18)
#define <API key> s2BIT(19)
#define <API key> s2BIT(20)
#define <API key> s2BIT(21)
#define <API key> s2BIT(22)
#define <API key> s2BIT(23)
#define <API key> s2BIT(32)
#define <API key> s2BIT(33)
#define <API key> s2BIT(34)
#define <API key> s2BIT(35)
#define <API key> s2BIT(36)
#define <API key> s2BIT(37)
#define <API key> s2BIT(40)
#define <API key> s2BIT(41)
#define <API key> s2BIT(48)
#define <API key> s2BIT(49)
u64 pif_rd_swapper_fb;
#define IF_RD_SWAPPER_FB 0x0123456789ABCDEF
u64 scheduled_int_ctrl;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
#define <API key>(val) vBIT(val,10,6)
#define SCHED_INT_PERIOD TBD
u64 txreqtimeout;
#define TXREQTO_VAL(val) vBIT(val,0,32)
#define TXREQTO_EN s2BIT(63)
u64 statsreqtimeout;
#define STATREQTO_VAL(n) TBD
#define STATREQTO_EN s2BIT(63)
u64 read_retry_delay;
u64 <API key>;
u64 write_retry_delay;
u64 <API key>;
u64 xmsi_control;
u64 xmsi_access;
u64 xmsi_address;
u64 xmsi_data;
u64 rx_mat;
#define RX_MAT_SET(ring, msi) vBIT(msi, (8 * ring), 8)
u8 unused6[0x8];
u64 tx_mat0_n[0x8];
#define TX_MAT_SET(fifo, msi) vBIT(msi, (8 * fifo), 8)
u64 xmsi_mask_reg;
u64 stat_byte_cnt;
#define STAT_BC(n) vBIT(n,4,12)
u64 stat_cfg;
#define STAT_CFG_STAT_EN s2BIT(0)
#define <API key> s2BIT(1)
#define STAT_CFG_STAT_NS_EN s2BIT(8)
#define STAT_CFG_STAT_RO s2BIT(9)
#define STAT_TRSF_PER(n) TBD
#define PER_SEC 0x208d5
#define SET_UPDT_PERIOD(n) vBIT((PER_SEC*n),32,32)
#define SET_UPDT_CLICKS(val) vBIT(val, 32, 32)
u64 stat_addr;
u64 mdio_control;
#define MDIO_MMD_INDX_ADDR(val) vBIT(val, 0, 16)
#define MDIO_MMD_DEV_ADDR(val) vBIT(val, 19, 5)
#define MDIO_MMS_PRT_ADDR(val) vBIT(val, 27, 5)
#define <API key>(val) vBIT(val, 56, 4)
#define MDIO_OP(val) vBIT(val, 60, 2)
#define MDIO_OP_ADDR_TRANS 0x0
#define MDIO_OP_WRITE_TRANS 0x1
#define <API key> 0x2
#define MDIO_OP_READ_TRANS 0x3
#define MDIO_MDIO_DATA(val) vBIT(val, 32, 16)
u64 dtx_control;
u64 i2c_control;
#define I2C_CONTROL_DEV_ID(id) vBIT(id,1,3)
#define I2C_CONTROL_ADDR(addr) vBIT(addr,5,11)
#define <API key>(cnt) vBIT(cnt,22,2)
#define I2C_CONTROL_READ s2BIT(24)
#define I2C_CONTROL_NACK s2BIT(25)
#define <API key> vBIT(0xE,28,4)
#define <API key>(val) (val & vBIT(0x1,28,4))
#define <API key>(val) (u32)(val & 0xFFFFFFFF)
#define <API key>(val) vBIT(val,32,32)
u64 gpio_control;
#define GPIO_CTRL_GPIO_0 s2BIT(8)
u64 misc_control;
#define FAULT_BEHAVIOUR s2BIT(0)
#define EXT_REQ_EN s2BIT(1)
#define <API key>(val) vBIT(val,29,3)
u8 unused7_1[0x230 - 0x208];
u64 pic_control2;
u64 ini_dperr_ctrl;
u64 wreq_split_mask;
#define <API key>(val) vBIT(val, 52, 12)
u8 unused7_2[0x800 - 0x248];
u64 txdma_int_status;
u64 txdma_int_mask;
#define TXDMA_PFC_INT s2BIT(0)
#define TXDMA_TDA_INT s2BIT(1)
#define TXDMA_PCC_INT s2BIT(2)
#define TXDMA_TTI_INT s2BIT(3)
#define TXDMA_LSO_INT s2BIT(4)
#define TXDMA_TPA_INT s2BIT(5)
#define TXDMA_SM_INT s2BIT(6)
u64 pfc_err_reg;
#define PFC_ECC_SG_ERR s2BIT(7)
#define PFC_ECC_DB_ERR s2BIT(15)
#define PFC_SM_ERR_ALARM s2BIT(23)
#define PFC_MISC_0_ERR s2BIT(31)
#define PFC_MISC_1_ERR s2BIT(32)
#define PFC_PCIX_ERR s2BIT(39)
u64 pfc_err_mask;
u64 pfc_err_alarm;
u64 tda_err_reg;
#define TDA_Fn_ECC_SG_ERR vBIT(0xff,0,8)
#define TDA_Fn_ECC_DB_ERR vBIT(0xff,8,8)
#define TDA_SM0_ERR_ALARM s2BIT(22)
#define TDA_SM1_ERR_ALARM s2BIT(23)
#define TDA_PCIX_ERR s2BIT(39)
u64 tda_err_mask;
u64 tda_err_alarm;
u64 pcc_err_reg;
#define PCC_FB_ECC_SG_ERR vBIT(0xFF,0,8)
#define PCC_TXB_ECC_SG_ERR vBIT(0xFF,8,8)
#define PCC_FB_ECC_DB_ERR vBIT(0xFF,16, 8)
#define PCC_TXB_ECC_DB_ERR vBIT(0xff,24,8)
#define PCC_SM_ERR_ALARM vBIT(0xff,32,8)
#define PCC_WR_ERR_ALARM vBIT(0xff,40,8)
#define PCC_N_SERR vBIT(0xff,48,8)
#define PCC_6_COF_OV_ERR s2BIT(56)
#define PCC_7_COF_OV_ERR s2BIT(57)
#define PCC_6_LSO_OV_ERR s2BIT(58)
#define PCC_7_LSO_OV_ERR s2BIT(59)
#define PCC_ENABLE_FOUR vBIT(0x0F,0,8)
u64 pcc_err_mask;
u64 pcc_err_alarm;
u64 tti_err_reg;
#define TTI_ECC_SG_ERR s2BIT(7)
#define TTI_ECC_DB_ERR s2BIT(15)
#define TTI_SM_ERR_ALARM s2BIT(23)
u64 tti_err_mask;
u64 tti_err_alarm;
u64 lso_err_reg;
#define LSO6_SEND_OFLOW s2BIT(12)
#define LSO7_SEND_OFLOW s2BIT(13)
#define LSO6_ABORT s2BIT(14)
#define LSO7_ABORT s2BIT(15)
#define LSO6_SM_ERR_ALARM s2BIT(22)
#define LSO7_SM_ERR_ALARM s2BIT(23)
u64 lso_err_mask;
u64 lso_err_alarm;
u64 tpa_err_reg;
#define TPA_TX_FRM_DROP s2BIT(7)
#define TPA_SM_ERR_ALARM s2BIT(23)
u64 tpa_err_mask;
u64 tpa_err_alarm;
u64 sm_err_reg;
#define SM_SM_ERR_ALARM s2BIT(15)
u64 sm_err_mask;
u64 sm_err_alarm;
u8 unused8[0x100 - 0xB8];
u64 tx_dma_wrap_stat;
#define X_MAX_FIFOS 8
#define X_FIFO_MAX_LEN 0x1FFF
u64 tx_fifo_partition_0;
#define <API key> s2BIT(0)
#define <API key>(val) vBIT(val,5,3)
#define <API key>(val) vBIT(val,19,13)
#define <API key>(val) vBIT(val,37,3)
#define <API key>(val) vBIT(val,51,13 )
u64 tx_fifo_partition_1;
#define <API key>(val) vBIT(val,5,3)
#define <API key>(val) vBIT(val,19,13)
#define <API key>(val) vBIT(val,37,3)
#define <API key>(val) vBIT(val,51,13)
u64 tx_fifo_partition_2;
#define <API key>(val) vBIT(val,5,3)
#define <API key>(val) vBIT(val,19,13)
#define <API key>(val) vBIT(val,37,3)
#define <API key>(val) vBIT(val,51,13)
u64 tx_fifo_partition_3;
#define <API key>(val) vBIT(val,5,3)
#define <API key>(val) vBIT(val,19,13)
#define <API key>(val) vBIT(val,37,3)
#define <API key>(val) vBIT(val,51,13)
#define <API key> 0
#define <API key> 1
#define <API key> 2
#define <API key> 3
#define <API key> 4
#define <API key> 5
#define <API key> 6
#define <API key> 7
u64 tx_w_round_robin_0;
u64 tx_w_round_robin_1;
u64 tx_w_round_robin_2;
u64 tx_w_round_robin_3;
u64 tx_w_round_robin_4;
u64 tti_command_mem;
#define TTI_CMD_MEM_WE s2BIT(7)
#define <API key> s2BIT(15)
#define <API key> s2BIT(15)
#define TTI_CMD_MEM_OFFSET(n) vBIT(n,26,6)
u64 tti_data1_mem;
#define <API key>(n) vBIT(n,6,26)
#define <API key>(n) vBIT(n,38,2)
#define <API key> s2BIT(38)
#define <API key> s2BIT(39)
#define <API key>(n) vBIT(n,41,7)
#define <API key>(n) vBIT(n,49,7)
#define <API key>(n) vBIT(n,57,7)
u64 tti_data2_mem;
#define <API key>(n) vBIT(n,0,16)
#define <API key>(n) vBIT(n,16,16)
#define <API key>(n) vBIT(n,32,16)
#define <API key>(n) vBIT(n,48,16)
u64 tx_pa_cfg;
#define <API key> s2BIT(1)
#define <API key> s2BIT(2)
#define <API key> s2BIT(3)
#define <API key> s2BIT(6)
#define <API key> s2BIT(15)
u64 pcc_enable;
u8 unused9[0x700 - 0x178];
u64 txdma_debug_ctrl;
u8 unused10[0x1800 - 0x1708];
u64 rxdma_int_status;
u64 rxdma_int_mask;
#define RXDMA_INT_RC_INT_M s2BIT(0)
#define RXDMA_INT_RPA_INT_M s2BIT(1)
#define RXDMA_INT_RDA_INT_M s2BIT(2)
#define RXDMA_INT_RTI_INT_M s2BIT(3)
u64 rda_err_reg;
#define RDA_RXDn_ECC_SG_ERR vBIT(0xFF,0,8)
#define RDA_RXDn_ECC_DB_ERR vBIT(0xFF,8,8)
#define RDA_FRM_ECC_SG_ERR s2BIT(23)
#define <API key> s2BIT(31)
#define RDA_SM1_ERR_ALARM s2BIT(38)
#define RDA_SM0_ERR_ALARM s2BIT(39)
#define RDA_MISC_ERR s2BIT(47)
#define RDA_PCIX_ERR s2BIT(55)
#define RDA_RXD_ECC_DB_SERR s2BIT(63)
u64 rda_err_mask;
u64 rda_err_alarm;
u64 rc_err_reg;
#define RC_PRCn_ECC_SG_ERR vBIT(0xFF,0,8)
#define RC_PRCn_ECC_DB_ERR vBIT(0xFF,8,8)
#define RC_FTC_ECC_SG_ERR s2BIT(23)
#define RC_FTC_ECC_DB_ERR s2BIT(31)
#define <API key> vBIT(0xFF,32,8)
#define RC_FTC_SM_ERR_ALARM s2BIT(47)
#define RC_RDA_FAIL_WR_Rn vBIT(0xFF,48,8)
u64 rc_err_mask;
u64 rc_err_alarm;
u64 prc_pcix_err_reg;
#define PRC_PCI_AB_RD_Rn vBIT(0xFF,0,8)
#define PRC_PCI_DP_RD_Rn vBIT(0xFF,8,8)
#define PRC_PCI_AB_WR_Rn vBIT(0xFF,16,8)
#define PRC_PCI_DP_WR_Rn vBIT(0xFF,24,8)
#define PRC_PCI_AB_F_WR_Rn vBIT(0xFF,32,8)
#define PRC_PCI_DP_F_WR_Rn vBIT(0xFF,40,8)
u64 prc_pcix_err_mask;
u64 prc_pcix_err_alarm;
u64 rpa_err_reg;
#define RPA_ECC_SG_ERR s2BIT(7)
#define RPA_ECC_DB_ERR s2BIT(15)
#define RPA_FLUSH_REQUEST s2BIT(22)
#define RPA_SM_ERR_ALARM s2BIT(23)
#define RPA_CREDIT_ERR s2BIT(31)
u64 rpa_err_mask;
u64 rpa_err_alarm;
u64 rti_err_reg;
#define RTI_ECC_SG_ERR s2BIT(7)
#define RTI_ECC_DB_ERR s2BIT(15)
#define RTI_SM_ERR_ALARM s2BIT(23)
u64 rti_err_mask;
u64 rti_err_alarm;
u8 unused11[0x100 - 0x88];
u64 rx_queue_priority;
#define RX_QUEUE_0_PRIORITY(val) vBIT(val,5,3)
#define RX_QUEUE_1_PRIORITY(val) vBIT(val,13,3)
#define RX_QUEUE_2_PRIORITY(val) vBIT(val,21,3)
#define RX_QUEUE_3_PRIORITY(val) vBIT(val,29,3)
#define RX_QUEUE_4_PRIORITY(val) vBIT(val,37,3)
#define RX_QUEUE_5_PRIORITY(val) vBIT(val,45,3)
#define RX_QUEUE_6_PRIORITY(val) vBIT(val,53,3)
#define RX_QUEUE_7_PRIORITY(val) vBIT(val,61,3)
#define RX_QUEUE_PRI_0 0
#define RX_QUEUE_PRI_1 1
#define RX_QUEUE_PRI_2 2
#define RX_QUEUE_PRI_3 3
#define RX_QUEUE_PRI_4 4
#define RX_QUEUE_PRI_5 5
#define RX_QUEUE_PRI_6 6
#define RX_QUEUE_PRI_7 7
u64 rx_w_round_robin_0;
u64 rx_w_round_robin_1;
u64 rx_w_round_robin_2;
u64 rx_w_round_robin_3;
u64 rx_w_round_robin_4;
#define RX_MAX_RINGS 8
#if 0
#define RX_MAX_RINGS_SZ 0xFFFF
#define RX_MIN_RINGS_SZ 0x3F
#endif
u64 prc_rxd0_n[RX_MAX_RINGS];
u64 prc_ctrl_n[RX_MAX_RINGS];
#define PRC_CTRL_RC_ENABLED s2BIT(7)
#define PRC_CTRL_RING_MODE (s2BIT(14)|s2BIT(15))
#define <API key> vBIT(0,14,2)
#define <API key> vBIT(1,14,2)
#define <API key> vBIT(2,14,2)
#define <API key> vBIT(3,14,2)
#define PRC_CTRL_NO_SNOOP (s2BIT(22)|s2BIT(23))
#define <API key> s2BIT(22)
#define <API key> s2BIT(23)
#define <API key> s2BIT(37)
#define <API key> s2BIT(38)
#define <API key>(val) vBIT(val,40,24)
u64 prc_alarm_action;
#define <API key> s2BIT(3)
#define <API key> s2BIT(7)
#define <API key> s2BIT(11)
#define <API key> s2BIT(15)
#define <API key> s2BIT(19)
#define <API key> s2BIT(23)
#define <API key> s2BIT(27)
#define <API key> s2BIT(31)
#define <API key> s2BIT(35)
#define <API key> s2BIT(39)
#define <API key> s2BIT(43)
#define <API key> s2BIT(47)
#define <API key> s2BIT(51)
#define <API key> s2BIT(55)
#define <API key> s2BIT(59)
#define <API key> s2BIT(63)
u64 rti_command_mem;
#define RTI_CMD_MEM_WE s2BIT(7)
#define RTI_CMD_MEM_STROBE s2BIT(15)
#define <API key> s2BIT(15)
#define <API key> s2BIT(15)
#define RTI_CMD_MEM_OFFSET(n) vBIT(n,29,3)
u64 rti_data1_mem;
#define <API key>(n) vBIT(n,3,29)
#define <API key> s2BIT(38)
#define <API key> s2BIT(39)
#define <API key>(n) vBIT(n,41,7)
#define <API key>(n) vBIT(n,49,7)
#define <API key>(n) vBIT(n,57,7)
u64 rti_data2_mem;
#define <API key>(n) vBIT(n,0,16)
#define <API key>(n) vBIT(n,16,16)
#define <API key>(n) vBIT(n,32,16)
#define <API key>(n) vBIT(n,48,16)
u64 rx_pa_cfg;
#define <API key> s2BIT(1)
#define <API key> s2BIT(2)
#define <API key> s2BIT(3)
#define <API key> s2BIT(6)
u64 unused_11_1;
u64 ring_bump_counter1;
u64 ring_bump_counter2;
u8 unused12[0x700 - 0x1F0];
u64 rxdma_debug_ctrl;
u8 unused13[0x2000 - 0x1f08];
u64 mac_int_status;
u64 mac_int_mask;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
u64 mac_tmac_err_reg;
#define TMAC_ECC_SG_ERR s2BIT(7)
#define TMAC_ECC_DB_ERR s2BIT(15)
#define TMAC_TX_BUF_OVRN s2BIT(23)
#define TMAC_TX_CRI_ERR s2BIT(31)
#define TMAC_TX_SM_ERR s2BIT(39)
#define <API key> s2BIT(47)
#define <API key> s2BIT(55)
u64 mac_tmac_err_mask;
u64 mac_tmac_err_alarm;
u64 mac_rmac_err_reg;
#define RMAC_RX_BUFF_OVRN s2BIT(0)
#define RMAC_FRM_RCVD_INT s2BIT(1)
#define RMAC_UNUSED_INT s2BIT(2)
#define <API key> s2BIT(5)
#define <API key> s2BIT(6)
#define <API key> s2BIT(7)
#define <API key> s2BIT(8)
#define <API key> s2BIT(9)
#define <API key> s2BIT(10)
#define <API key> s2BIT(11)
#define <API key> s2BIT(13)
#define <API key> s2BIT(14)
#define <API key> s2BIT(15)
#define <API key> s2BIT(16)
#define <API key> s2BIT(17)
#define <API key> s2BIT(18)
#define <API key> s2BIT(19)
#define <API key> s2BIT(31)
#define RMAC_RX_SM_ERR s2BIT(39)
#define RMAC_SINGLE_ECC_ERR (s2BIT(5) | s2BIT(6) | s2BIT(7) |\
s2BIT(8) | s2BIT(9) | s2BIT(10)|\
s2BIT(11))
#define RMAC_DOUBLE_ECC_ERR (s2BIT(13) | s2BIT(14) | s2BIT(15) |\
s2BIT(16) | s2BIT(17) | s2BIT(18)|\
s2BIT(19))
u64 mac_rmac_err_mask;
u64 mac_rmac_err_alarm;
u8 unused14[0x100 - 0x40];
u64 mac_cfg;
#define MAC_CFG_TMAC_ENABLE s2BIT(0)
#define MAC_CFG_RMAC_ENABLE s2BIT(1)
#define MAC_CFG_LAN_NOT_WAN s2BIT(2)
#define <API key> s2BIT(3)
#define <API key> s2BIT(4)
#define <API key> s2BIT(5)
#define <API key> s2BIT(6)
#define <API key> s2BIT(7)
#define <API key> s2BIT(8)
#define <API key> s2BIT(9)
#define <API key> s2BIT(10)
#define <API key>(val) vBIT(val,16,8)
u64 tmac_avg_ipg;
#define TMAC_AVG_IPG(val) vBIT(val,0,8)
u64 rmac_max_pyld_len;
#define RMAC_MAX_PYLD_LEN(val) vBIT(val,2,14)
#define <API key> vBIT(1500,2,14)
#define <API key> vBIT(9600,2,14)
u64 rmac_err_cfg;
#define RMAC_ERR_FCS s2BIT(0)
#define RMAC_ERR_FCS_ACCEPT s2BIT(1)
#define RMAC_ERR_TOO_LONG s2BIT(1)
#define <API key> s2BIT(1)
#define RMAC_ERR_RUNT s2BIT(2)
#define <API key> s2BIT(2)
#define <API key> s2BIT(3)
#define <API key> s2BIT(3)
u64 rmac_cfg_key;
#define RMAC_CFG_KEY(val) vBIT(val,0,16)
#define <API key> 0
#define <API key> 64
#define <API key> 256
#define <API key> 16
#define <API key> 64
#define <API key> 16
#define <API key> 64
u64 rmac_addr_cmd_mem;
#define <API key> s2BIT(7)
#define <API key> 0
#define <API key> s2BIT(15)
#define <API key> s2BIT(15)
#define <API key>(n) vBIT(n,26,6)
u64 rmac_addr_data0_mem;
#define <API key>(n) vBIT(n,0,48)
#define <API key> s2BIT(48)
u64 rmac_addr_data1_mem;
#define <API key>(n) vBIT(n,0,48)
u8 unused15[0x8];
u64 tmac_ipg_cfg;
u64 rmac_pause_cfg;
#define RMAC_PAUSE_GEN s2BIT(0)
#define <API key> s2BIT(0)
#define RMAC_PAUSE_RX s2BIT(1)
#define <API key> s2BIT(1)
#define <API key> vBIT(0xFFFF,16,16)
#define RMAC_PAUSE_HG_PTIME(val) vBIT(val,16,16)
u64 rmac_red_cfg;
u64 rmac_red_rate_q0q3;
u64 rmac_red_rate_q4q7;
u64 mac_link_util;
#define MAC_TX_LINK_UTIL vBIT(0xFE,1,7)
#define <API key> vBIT(0xF, 8,4)
#define <API key>( n ) vBIT(n,8,4)
#define MAC_RX_LINK_UTIL vBIT(0xFE,33,7)
#define <API key> vBIT(0xF,40,4)
#define <API key>( n ) vBIT(n,40,4)
#define <API key> <API key> | \
<API key>
u64 rmac_invalid_ipg;
#define MAC_RTS_FRM_LEN_SET(len) vBIT(len,2,14)
u64 rts_frm_len_n[8];
u64 rts_qos_steering;
#define MAX_DIX_MAP 4
u64 rts_dix_map_n[MAX_DIX_MAP];
#define RTS_DIX_MAP_ETYPE(val) vBIT(val,0,16)
#define RTS_DIX_MAP_SCW(val) s2BIT(val,21)
u64 rts_q_alternates;
u64 rts_default_q;
u64 rts_ctrl;
#define <API key> s2BIT(2)
#define <API key> s2BIT(3)
u64 rts_pn_cam_ctrl;
#define RTS_PN_CAM_CTRL_WE s2BIT(7)
#define <API key> s2BIT(15)
#define <API key> s2BIT(15)
#define <API key>(n) vBIT(n,24,8)
u64 rts_pn_cam_data;
#define <API key> s2BIT(7)
#define <API key>(val) vBIT(val,8,16)
#define RTS_PN_CAM_DATA_SCW(val) vBIT(val,24,8)
u64 rts_ds_mem_ctrl;
#define RTS_DS_MEM_CTRL_WE s2BIT(7)
#define <API key> s2BIT(15)
#define <API key> s2BIT(15)
#define <API key>(n) vBIT(n,26,6)
u64 rts_ds_mem_data;
#define RTS_DS_MEM_DATA(n) vBIT(n,0,8)
u8 unused16[0x700 - 0x220];
u64 mac_debug_ctrl;
#define <API key> <API key>
u8 unused17[0x2800 - 0x2708];
u64 mc_int_status;
#define <API key> s2BIT(0)
u64 mc_int_mask;
#define MC_INT_MASK_MC_INT s2BIT(0)
u64 mc_err_reg;
#define <API key> s2BIT(14)
#define <API key> s2BIT(15)
#define <API key> s2BIT(18)
#define <API key> s2BIT(20)
#define <API key> s2BIT(22)
#define <API key> s2BIT(23)
#define MC_ERR_REG_SM_ERR s2BIT(31)
#define <API key> (s2BIT(2) | s2BIT(3) | s2BIT(4) | s2BIT(5) |\
s2BIT(17) | s2BIT(19))
#define <API key> (s2BIT(10) | s2BIT(11) | s2BIT(12) |\
s2BIT(13) | s2BIT(18) | s2BIT(20))
#define PLL_LOCK_N s2BIT(39)
u64 mc_err_mask;
u64 mc_err_alarm;
u8 unused18[0x100 - 0x28];
u64 rx_queue_cfg;
#define RX_QUEUE_CFG_Q0_SZ(n) vBIT(n,0,8)
#define RX_QUEUE_CFG_Q1_SZ(n) vBIT(n,8,8)
#define RX_QUEUE_CFG_Q2_SZ(n) vBIT(n,16,8)
#define RX_QUEUE_CFG_Q3_SZ(n) vBIT(n,24,8)
#define RX_QUEUE_CFG_Q4_SZ(n) vBIT(n,32,8)
#define RX_QUEUE_CFG_Q5_SZ(n) vBIT(n,40,8)
#define RX_QUEUE_CFG_Q6_SZ(n) vBIT(n,48,8)
#define RX_QUEUE_CFG_Q7_SZ(n) vBIT(n,56,8)
u64 mc_rldram_mrs;
#define <API key> s2BIT(39)
#define <API key> s2BIT(47)
u64 <API key>;
u64 <API key>;
u64 <API key>;
u64 mc_red_thresh_q[8];
u8 unused19[0x200 - 0x168];
u64 mc_rldram_ref_per;
u8 unused20[0x220 - 0x208];
u64 mc_rldram_test_ctrl;
#define MC_RLDRAM_TEST_MODE s2BIT(47)
#define <API key> s2BIT(7)
#define MC_RLDRAM_TEST_GO s2BIT(15)
#define MC_RLDRAM_TEST_DONE s2BIT(23)
#define MC_RLDRAM_TEST_PASS s2BIT(31)
u8 unused21[0x240 - 0x228];
u64 mc_rldram_test_add;
u8 unused22[0x260 - 0x248];
u64 mc_rldram_test_d0;
u8 unused23[0x280 - 0x268];
u64 mc_rldram_test_d1;
u8 unused24[0x300 - 0x288];
u64 mc_rldram_test_d2;
u8 unused24_1[0x360 - 0x308];
u64 mc_rldram_ctrl;
#define <API key> s2BIT(7)
u8 unused24_2[0x640 - 0x368];
u64 <API key>;
#define <API key>(val) vBIT(val, 0, 16)
u8 unused24_3[0x660 - 0x648];
u64 mc_rldram_mrs_herc;
u8 unused25[0x700 - 0x668];
u64 mc_debug_ctrl;
u8 unused26[0x3000 - 0x2f08];
u64 xgxs_int_status;
#define <API key> s2BIT(0)
#define <API key> s2BIT(1)
u64 xgxs_int_mask;
#define XGXS_INT_MASK_TXGXS s2BIT(0)
#define XGXS_INT_MASK_RXGXS s2BIT(1)
u64 xgxs_txgxs_err_reg;
#define TXGXS_ECC_SG_ERR s2BIT(7)
#define TXGXS_ECC_DB_ERR s2BIT(15)
#define TXGXS_ESTORE_UFLOW s2BIT(31)
#define TXGXS_TX_SM_ERR s2BIT(39)
u64 xgxs_txgxs_err_mask;
u64 <API key>;
u64 xgxs_rxgxs_err_reg;
#define RXGXS_ESTORE_OFLOW s2BIT(7)
#define RXGXS_RX_SM_ERR s2BIT(39)
u64 xgxs_rxgxs_err_mask;
u64 <API key>;
u8 unused27[0x100 - 0x40];
u64 xgxs_cfg;
u64 xgxs_status;
u64 xgxs_cfg_key;
u64 xgxs_efifo_cfg;
u64 rxgxs_ber_0;
u64 rxgxs_ber_1;
u64 spi_control;
#define SPI_CONTROL_KEY(key) vBIT(key,0,4)
#define SPI_CONTROL_BYTECNT(cnt) vBIT(cnt,29,3)
#define SPI_CONTROL_CMD(cmd) vBIT(cmd,32,8)
#define SPI_CONTROL_ADDR(addr) vBIT(addr,40,24)
#define SPI_CONTROL_SEL1 s2BIT(4)
#define SPI_CONTROL_REQ s2BIT(7)
#define SPI_CONTROL_NACK s2BIT(5)
#define SPI_CONTROL_DONE s2BIT(6)
u64 spi_data;
#define SPI_DATA_WRITE(data,len) vBIT(data,0,len)
};
#define XENA_REG_SPACE sizeof(struct XENA_dev_config)
#define XENA_EEPROM_SPACE (0x01 << 11)
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.