code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
''' Dialogs and widgets Responsible for creation, restoration of accounts are defined here. Namely: CreateAccountDialog, CreateRestoreDialog, RestoreSeedDialog ''' from functools import partial from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from electrum_gui.kivy.uix.dialogs import EventsDialog from electrum.i18n import _ Builder.load_string(''' #:import Window kivy.core.window.Window #:import _ electrum.i18n._ <WizardTextInput@TextInput> border: 4, 4, 4, 4 font_size: '15sp' padding: '15dp', '15dp' background_color: (1, 1, 1, 1) if self.focus else (0.454, 0.698, 0.909, 1) foreground_color: (0.31, 0.31, 0.31, 1) if self.focus else (0.835, 0.909, 0.972, 1) hint_text_color: self.foreground_color background_active: 'atlas://gui/kivy/theming/light/create_act_text_active' background_normal: 'atlas://gui/kivy/theming/light/create_act_text_active' size_hint_y: None height: '48sp' <WizardButton@Button>: root: None size_hint: 1, None height: '48sp' on_press: if self.root: self.root.dispatch('on_press', self) on_release: if self.root: self.root.dispatch('on_release', self) <-WizardDialog> text_color: .854, .925, .984, 1 #auto_dismiss: False size_hint: None, None canvas.before: Color: rgba: 0, 0, 0, .9 Rectangle: size: Window.size Color: rgba: .239, .588, .882, 1 Rectangle: size: Window.size crcontent: crcontent # add electrum icon BoxLayout: orientation: 'vertical' if self.width < self.height else 'horizontal' padding: min(dp(42), self.width/8), min(dp(60), self.height/9.7),\ min(dp(42), self.width/8), min(dp(72), self.height/8) spacing: '27dp' GridLayout: id: grid_logo cols: 1 pos_hint: {'center_y': .5} size_hint: 1, .42 #height: self.minimum_height Image: id: logo_img mipmap: True allow_stretch: True size_hint: 1, None height: '110dp' source: 'atlas://gui/kivy/theming/light/electrum_icon640' Widget: size_hint: 1, None height: 0 if stepper.opacity else dp(15) Label: color: root.text_color opacity: 0 if stepper.opacity else 1 text: 'ELECTRUM' size_hint: 1, None height: self.texture_size[1] if self.opacity else 0 font_size: '33sp' font_name: 'data/fonts/tron/Tr2n.ttf' Image: id: stepper allow_stretch: True opacity: 0 source: 'atlas://gui/kivy/theming/light/stepper_left' size_hint: 1, None height: grid_logo.height/2.5 if self.opacity else 0 Widget: size_hint: None, None size: '5dp', '5dp' GridLayout: cols: 1 id: crcontent spacing: '13dp' <CreateRestoreDialog> Label: color: root.text_color size_hint: 1, None text_size: self.width, None height: self.texture_size[1] text: _("Wallet file not found!!")+"\\n\\n" +\ _("Do you want to create a new wallet ")+\ _("or restore an existing one?") Widget size_hint: 1, None height: dp(15) GridLayout: id: grid orientation: 'vertical' cols: 1 spacing: '14dp' size_hint: 1, None height: self.minimum_height WizardButton: id: create text: _('Create a new seed') root: root WizardButton: id: restore text: _('I already have a seed') root: root <RestoreSeedDialog> Label: color: root.text_color size_hint: 1, None text_size: self.width, None height: self.texture_size[1] text: "[b]ENTER YOUR SEED PHRASE[/b]" GridLayout cols: 1 padding: 0, '12dp' orientation: 'vertical' spacing: '12dp' size_hint: 1, None height: self.minimum_height WizardTextInput: id: text_input_seed size_hint: 1, None height: '110dp' hint_text: _('Enter your seedphrase') on_text: root._trigger_check_seed() Label: font_size: '12sp' text_size: self.width, None size_hint: 1, None height: self.texture_size[1] halign: 'justify' valign: 'middle' text: root.message on_ref_press: import webbrowser webbrowser.open('https://electrum.org/faq.html#seed') GridLayout: rows: 1 spacing: '12dp' size_hint: 1, None height: self.minimum_height WizardButton: id: back text: _('Back') root: root Button: id: scan text: _('QR') on_release: root.scan_seed() WizardButton: id: next text: _('Next') root: root <ShowSeedDialog> spacing: '12dp' Label: color: root.text_color size_hint: 1, None text_size: self.width, None height: self.texture_size[1] text: "[b]PLEASE WRITE DOWN YOUR SEED PHRASE[/b]" GridLayout: id: grid cols: 1 pos_hint: {'center_y': .5} size_hint_y: None height: dp(180) orientation: 'vertical' Button: border: 4, 4, 4, 4 halign: 'justify' valign: 'middle' font_size: self.width/15 text_size: self.width - dp(24), self.height - dp(12) #size_hint: 1, None #height: self.texture_size[1] + dp(24) color: .1, .1, .1, 1 background_normal: 'atlas://gui/kivy/theming/light/white_bg_round_top' background_down: self.background_normal text: root.seed_text Label: rows: 1 size_hint: 1, .7 id: but_seed border: 4, 4, 4, 4 halign: 'justify' valign: 'middle' font_size: self.width/21 text: root.message text_size: self.width - dp(24), self.height - dp(12) GridLayout: rows: 1 spacing: '12dp' size_hint: 1, None height: self.minimum_height WizardButton: id: back text: _('Back') root: root WizardButton: id: confirm text: _('Confirm') root: root ''') class WizardDialog(EventsDialog): ''' Abstract dialog to be used as the base for all Create Account Dialogs ''' crcontent = ObjectProperty(None) def __init__(self, **kwargs): super(WizardDialog, self).__init__(**kwargs) self.action = kwargs.get('action') _trigger_size_dialog = Clock.create_trigger(self._size_dialog) Window.bind(size=_trigger_size_dialog, rotation=_trigger_size_dialog) _trigger_size_dialog() Window.softinput_mode = 'pan' def _size_dialog(self, dt): app = App.get_running_app() if app.ui_mode[0] == 'p': self.size = Window.size else: #tablet if app.orientation[0] == 'p': #portrait self.size = Window.size[0]/1.67, Window.size[1]/1.4 else: self.size = Window.size[0]/2.5, Window.size[1] def add_widget(self, widget, index=0): if not self.crcontent: super(WizardDialog, self).add_widget(widget) else: self.crcontent.add_widget(widget, index=index) def on_dismiss(self): app = App.get_running_app() if app.wallet is None and self._on_release is not None: print "on dismiss: stopping app" app.stop() else: Window.softinput_mode = 'below_target' class CreateRestoreDialog(WizardDialog): ''' Initial Dialog for creating or restoring seed''' def on_parent(self, instance, value): if value: app = App.get_running_app() self._back = _back = partial(app.dispatch, 'on_back') class ShowSeedDialog(WizardDialog): seed_text = StringProperty('') message = StringProperty('') def on_parent(self, instance, value): if value: app = App.get_running_app() stepper = self.ids.stepper stepper.opacity = 1 stepper.source = 'atlas://gui/kivy/theming/light/stepper_full' self._back = _back = partial(self.ids.back.dispatch, 'on_release') class RestoreSeedDialog(WizardDialog): message = StringProperty('') def __init__(self, **kwargs): super(RestoreSeedDialog, self).__init__(**kwargs) self._test = kwargs['test'] self._trigger_check_seed = Clock.create_trigger(self.check_seed) def check_seed(self, dt): self.ids.next.disabled = not bool(self._test(self.get_seed_text())) def get_seed_text(self): ti = self.ids.text_input_seed text = unicode(ti.text).strip() text = ' '.join(text.split()) return text def scan_seed(self): def on_complete(text): self.ids.text_input_seed.text = text app = App.get_running_app() app.scan_qr(on_complete) def on_parent(self, instance, value): if value: tis = self.ids.text_input_seed tis.focus = True tis._keyboard.bind(on_key_down=self.on_key_down) stepper = self.ids.stepper stepper.opacity = 1 stepper.source = ('atlas://gui/kivy/theming' '/light/stepper_restore_seed') self._back = _back = partial(self.ids.back.dispatch, 'on_release') app = App.get_running_app() #app.navigation_higherarchy.append(_back) def on_key_down(self, keyboard, keycode, key, modifiers): if keycode[0] in (13, 271): self.on_enter() return True def on_enter(self): #self._remove_keyboard() # press next next = self.ids.next if not next.disabled: next.dispatch('on_release') def _remove_keyboard(self): tis = self.ids.text_input_seed if tis._keyboard: tis._keyboard.unbind(on_key_down=self.on_key_down) tis.focus = False def close(self): self._remove_keyboard() app = App.get_running_app() #if self._back in app.navigation_higherarchy: # app.navigation_higherarchy.pop() # self._back = None super(RestoreSeedDialog, self).close()
valesi/electrum
gui/kivy/uix/dialogs/create_restore.py
Python
gpl-3.0
11,183
<?php /** * Theme Setup Functionality * * @link https://github.com/brainscousin/twentyseventeen-child * @since 1.3.0 * * @package Attentive_Media * @subpackage Twenty_Seventeen_Child */ /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. * * @since 1.3.1 */ add_action( 'after_setup_theme', 'twentyseventeen_child_setup', 11 ); function twentyseventeen_child_setup() { /** * Ditch Main Theme Elements */ unregister_nav_menu( 'social' ); /** * Add new menus */ register_nav_menu( 'footer', __( 'Footer Menu', TSC_TEXT_DOMAIN ) ); /** * This theme styles the visual editor to resemble the theme style, * specifically font, colors, and column width. */ add_editor_style( array( 'assets/css/editor-style.css' ) ); /** * Add SVG Support for logos */ add_theme_support( 'custom-logo', array( 'flex-width' => true, 'flex-height' => true, 'height' => 100, 'width' => 200, ) ); } /** * Enqueue scripts and styles. * * @since 1.2.0 */ add_action( 'wp_enqueue_scripts', 'twentyseventeen_child_styles' ); function twentyseventeen_child_styles() { // parent styles wp_enqueue_style( TSC_STYLE_DOMAIN, get_template_directory_uri() . '/style.css' ); // child styles wp_enqueue_style( 'twentyseventeeen-child-style', get_stylesheet_directory_uri() . '/style.css', array( TSC_STYLE_DOMAIN ), wp_get_theme()->get('Version') ); } /** * Output Social Navigation * * @see /functions.php For adding available social links * * @since 1.5.0 */ function twentyseventeen_child_social_links() { $output = ''; // Got links? $tsc_social_links = array(); $link_providers = explode( ',', TSC_SOCIAL_LINKS ); $social_style = get_theme_mod( TSC_FIELD_PREFIX . 'social_style', '' ); foreach ( $link_providers as $provider ) { $url = get_theme_mod( sprintf( '%ssocial_%s', TSC_FIELD_PREFIX, $provider ) ); if ( ! empty( $url ) ) { switch($social_style) { case "custom": $provider_icon = wp_get_attachment_image( get_theme_mod( TSC_FIELD_PREFIX . 'social_icon_' . $provider ) ); if ( ! empty( $provider_icon ) ) { $tsc_social_links[] = sprintf( '<li class="page_item tsc-icon-%s"><a href="%s" target="_blank"><span class="screen-reader-text">%s</span>%s</a></li>', $provider, esc_url( $url ), twentyseventeen_child_social_link_title( $provider ), $provider_icon ); } break; case "icon-only": case "fancy": default: $tsc_social_links[] = sprintf( '<li class="page_item tsc-icon-%s"><a href="%s" target="_blank"><span class="screen-reader-text">%s</span>%s</a></li>', $provider, esc_url( $url ), twentyseventeen_child_social_link_title( $provider ), twentyseventeen_get_svg( array( 'icon' => $provider ) ) ); break; } } } // Ok, but really, do you have any links? if ( ! empty( $tsc_social_links ) ) { ob_start(); $tsc_social_links = implode( "\n", $tsc_social_links ); include( get_stylesheet_directory() . '/template-parts/footer/site-social.php' ); $output = ob_get_clean(); } // Hey if not, that's cool... but it would be a lot cooler if you did... echo $output; } /** * Format Social Link Title * * @since 1.3.0 * * @param string $provider * @return string */ function twentyseventeen_child_social_link_title( $provider ) { $title_value = ''; if ( ! empty( $provider ) ) { // Cleanup $title_value = str_replace( '-alien', ' ', $provider ); $title_value = str_replace( '-', ' ', $title_value ); $title_value = ucwords( $title_value ); // Internationalize $title_value = __( $title_value, TSC_TEXT_DOMAIN ); } return $title_value; } /** * Function to check if the featured image should be displayed * elsewhere than the header. * * Suppresses output elsewhere. * * @return string */ function twentyseventeen_child_display_featured_image() { $location = get_theme_mod( TSC_FIELD_PREFIX . 'featured_image_location' ); if ( ! empty( $location ) ) { return $location; } return 'top'; }
brainscousin/twentyseventeen-child-ndgc
inc/theme-setup.php
PHP
gpl-3.0
4,560
/* * This file is part of the Raster Storage Archive (RSA). * * The RSA is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * The RSA is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * the RSA. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2013 CRCSI - Cooperative Research Centre for Spatial Information * http://www.crcsi.com.au/ */ package org.vpac.web.view; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.view.feed.AbstractAtomFeedView; import org.vpac.web.model.response.DatasetCollectionResponse; import org.vpac.web.model.response.DatasetResponse; import org.vpac.web.util.ControllerHelper; import com.rometools.rome.feed.atom.Content; import com.rometools.rome.feed.atom.Entry; import com.rometools.rome.feed.atom.Feed; public class AtomFeedView extends AbstractAtomFeedView { private String feedId = "tag:http://web.vpac.org/Atom"; private String title = "http://web.vpac.org/Atom:news"; // private String newsAbsoluteUrl = "http://web.vpac.org/Atom/news/"; @Override protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) { feed.setId(feedId); feed.setTitle(title); setUpdatedIfNeeded(model, feed); super.buildFeedMetadata(model, feed, request); } private void setUpdatedIfNeeded(Map<String, Object> model, Feed feed) { Date lastUpdate = (Date) model.get("News"); if(lastUpdate != null) { if (feed.getUpdated() == null || lastUpdate.compareTo(feed.getUpdated()) > 0) { feed.setUpdated(lastUpdate); } } } @Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { DatasetCollectionResponse list = (DatasetCollectionResponse) model .get(ControllerHelper.RESPONSE_ROOT); List<Entry> items = new ArrayList<Entry>(1); for (DatasetResponse dr : list.getItems()) { Entry item = new Entry(); item.setTitle(dr.getName()); Content content = new Content(); content.setValue("ID:" + dr.getId() + "\n" + "ABSTACT:" + dr.getDataAbstract() + "\n" + "NAME:" + dr.getName() + "\n"); ArrayList<Content> contents = new ArrayList<Content>(); contents.add(content); item.setContents(contents); items.add(item); } return items; } }
vpac-innovations/rsa
src/spatialcubeservice/src/main/java/org/vpac/web/view/AtomFeedView.java
Java
gpl-3.0
2,981
python -u test.py waves
peterlzhang/gerris
test/waves.sh
Shell
gpl-3.0
24
/* * Copyright (C) 2017 Naoghuman * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.github.naoghuman.abclist.configuration; /** * * @author Naoghuman */ public interface IPreferencesConfiguration { public static final String PREF__TESTDATA__IS_SELECTED_DELETE_DATABASE = "PREF__TESTDATA__IS_SELECTED_DELETE_DATABASE"; // NOI18N public static final Boolean PREF__TESTDATA__IS_SELECTED_DELETE_DATABASE__DEFAULT_VALUE = Boolean.FALSE; public static final String PREF__TESTDATA__QUANTITY_ENTITIES__EXERCISE = "PREF__TESTDATA__QUANTITY_ENTITIES__EXERCISE"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_ENTITIES__EXERCISE_DEFAULT_VALUE = 100; public static final String PREF__TESTDATA__QUANTITY_ENTITIES__EXERCISE_TERM = "PREF__TESTDATA__QUANTITY_ENTITIES__EXERCISE_TERM"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_ENTITIES__EXERCISE_TERM_DEFAULT_VALUE = 100; public static final String PREF__TESTDATA__QUANTITY_ENTITIES__LINK = "PREF__TESTDATA__QUANTITY_ENTITIES__LINK"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_ENTITIES__LINK_DEFAULT_VALUE = 100; public static final String PREF__TESTDATA__QUANTITY_ENTITIES__LINK_MAPPING = "PREF__TESTDATA__QUANTITY_ENTITIES__LINK_MAPPING"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_ENTITIES__LINK_MAPPING_DEFAULT_VALUE = 100; public static final String PREF__TESTDATA__QUANTITY_ENTITIES__TERM = "PREF__TESTDATA__QUANTITY_ENTITIES__TERM"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_ENTITIES__TERM_DEFAULT_VALUE = 100; public static final String PREF__TESTDATA__QUANTITY_ENTITIES__TOPIC = "PREF__TESTDATA__QUANTITY_ENTITIES__TOPIC"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_ENTITIES__TOPIC_DEFAULT_VALUE = 100; public static final String PREF__TESTDATA__QUANTITY_TIMEPERIOD__EXERCISE = "PREF__TESTDATA__QUANTITY_TIMEPERIOD__EXERCISE"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_TIMEPERIOD__EXERCISE_DEFAULT_VALUE = 1; public static final String PREF__TESTDATA__QUANTITY_TIMEPERIOD__LINK = "PREF__TESTDATA__QUANTITY_TIMEPERIOD__LINK"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_TIMEPERIOD__LINK_DEFAULT_VALUE = 1; public static final String PREF__TESTDATA__QUANTITY_TIMEPERIOD__LINK_MAPPING = "PREF__TESTDATA__QUANTITY_TIMEPERIOD__LINK_MAPPING"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_TIMEPERIOD__LINK_MAPPING_DEFAULT_VALUE = 1; public static final String PREF__TESTDATA__QUANTITY_TIMEPERIOD__TERM = "PREF__TESTDATA__QUANTITY_TIMEPERIOD__TERM"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_TIMEPERIOD__TERM_DEFAULT_VALUE = 1; public static final String PREF__TESTDATA__QUANTITY_TIMEPERIOD__TOPIC = "PREF__TESTDATA__QUANTITY_TIMEPERIOD__TOPIC"; // NOI18N public static final Integer PREF__TESTDATA__QUANTITY_TIMEPERIOD__TOPIC_DEFAULT_VALUE = 1; }
Naoghuman/ABC-List
src/main/java/com/github/naoghuman/abclist/configuration/IPreferencesConfiguration.java
Java
gpl-3.0
3,668
/* Copyright (C) 2002-2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it is applied to this software. View the full text of the exception in file EXCEPTIONS-CONNECTOR-J in the directory of this software distribution. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package com.mysql.jdbc; import java.sql.SQLException; /** * Thrown when a result sate is not updatable * * @author Mark Matthews */ public class NotUpdatable extends SQLException { // ~ Static fields/initializers // --------------------------------------------- /** * The message to use when result set is not updatable. * * The same message is used in the warnings generated by Updatabale result * set. */ public static final String NOT_UPDATEABLE_MESSAGE = Messages .getString("NotUpdatable.0") //$NON-NLS-1$ + Messages.getString("NotUpdatable.1") //$NON-NLS-1$ + Messages.getString("NotUpdatable.2") //$NON-NLS-1$ + Messages.getString("NotUpdatable.3") //$NON-NLS-1$ + Messages.getString("NotUpdatable.4") //$NON-NLS-1$ + Messages.getString("NotUpdatable.5"); //$NON-NLS-1$ // ~ Constructors // ----------------------------------------------------------- /** * Creates a new NotUpdatable exception. */ public NotUpdatable() { super(NOT_UPDATEABLE_MESSAGE, SQLError.SQL_STATE_GENERAL_ERROR); } }
BasicOperations/vids
sql/mysql-connector-java-3.1.14/src/com/mysql/jdbc/NotUpdatable.java
Java
gpl-3.0
1,951
/** * Implementa el método fecha() que devuelva una fecha válida. Lanzará una excepción en caso contrario. * @author Jesús Mejías Leiva */ { function init() { try { date(); } catch (e) { console.log(e.message); } } // creo mi exception personalizada let dateNotValid = function(msg, name) { this.message = msg; this.name = name; }; let date = function() { let date = new Date("Diciembre 17, 1995 03:24:00"); if (date == "Invalid Date") { // creo mi un objeto con mi exception personalizada let dNotValid = new dateNotValid( "Fecha introducida, no válida", "Fecha no válida" ); // lanzo la exception throw dNotValid; } else { return date; } }; window.addEventListener("load", init); }
susomejias/susomejias.github.io
ejercicios/tema3/listadoDate/ejercicio5/js/main.js
JavaScript
gpl-3.0
815
/* * uart.h * * Created on: Oct 3, 2015 * Author: lorenzo */ #ifndef _UART_H_ #define _UART_H_ void uart_putchar(char c, FILE *stream); char uart_getchar(FILE *stream); void uart_init(void); /* http://www.ermicro.com/blog/?p=325 */ FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ); #endif /* _UART_H_ */
lmiori92/audio-monitor-avr
src/uart.h
C
gpl-3.0
424
/* This file is part of LS² - the Localization Simulation Engine of FU Berlin. Copyright 2011-2013 Heiko Will, Marcel Kyas, Thomas Hillebrandt, Stefan Adler, Malte Rohde, Jonathan Gunthermann LS² is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. LS² is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LS². If not, see <http://www.gnu.org/licenses/>. */ #ifndef INCLUDED_EQ_NOISE_H #define INCLUDED_EQ_NOISE_H extern void eq_noise_setup(const vector2 *, size_t); #if HAVE_POPT_H extern struct poptOption eq_arguments[]; #endif #if defined(STAND_ALONE) # define ERROR_MODEL_NAME "Uniform noise" # define ERROR_MODEL_ARGUMENTS eq_arguments #endif #endif
wi77/LS2
src/error_model/eq_noise_em.h
C
gpl-3.0
1,122
using System; namespace zComp.Core { /// <summary>Elément possédant une propriété readonly</summary> public interface IReadOnlyElement { /// <summary>Peux-t-on réaliser des modifications ?</summary> /// <returns>True si l'on peut modifier l'élément</returns> bool CanModify(); /// <summary>Etat de lecture seule</summary> zReadOnlyMode ReadOnly { get; set; } } /// <summary>Etat de lecture seule</summary> public enum zReadOnlyMode { ParentReadOnly, ReadOnly, ReadAndWrite } }
dzediar/aria-nt
zComp/Trunc/zComp.Core/Controls/IReadOnlyElement.cs
C#
gpl-3.0
609
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var gTestfile = 'regress-435345-01.js'; //----------------------------------------------------------------------------- var BUGNUMBER = 435345; var summary = 'Watch the length property of arrays'; var actual = ''; var expect = ''; // see http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Object:watch //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); var arr; try { expect = 'watcher: propname=length, oldval=0, newval=1; '; actual = ''; arr = []; arr.watch('length', watcher); arr[0] = '0'; } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 1'); try { expect = 'watcher: propname=length, oldval=1, newval=2; ' + 'watcher: propname=length, oldval=2, newval=2; '; actual = ''; arr.push(5); } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 2'); try { expect = 'watcher: propname=length, oldval=2, newval=1; '; actual = ''; arr.pop(); } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 3'); try { expect = 'watcher: propname=length, oldval=1, newval=2; '; actual = ''; arr.length++; } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 4'); try { expect = 'watcher: propname=length, oldval=2, newval=5; '; actual = ''; arr.length = 5; } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 5'); exitFunc ('test'); } function watcher(propname, oldval, newval) { actual += 'watcher: propname=' + propname + ', oldval=' + oldval + ', newval=' + newval + '; '; return newval; }
mozilla/rhino
testsrc/tests/js1_5/extensions/regress-435345-01.js
JavaScript
mpl-2.0
2,222
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package loadbalancer import ( "github.com/oracle/oci-go-sdk/v46/common" "net/http" ) // CreateListenerRequest wrapper for the CreateListener operation // // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loadbalancer/CreateListener.go.html to see an example of how to use CreateListenerRequest. type CreateListenerRequest struct { // Details to add a listener. CreateListenerDetails `contributesTo:"body"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a listener. LoadBalancerId *string `mandatory:"true" contributesTo:"path" name:"loadBalancerId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (e.g., if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateListenerRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateListenerRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) } // BinaryRequestBody implements the OCIRequest interface func (request CreateListenerRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { return nil, false } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateListenerRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateListenerResponse wrapper for the CreateListener operation type CreateListenerResponse struct { // The underlying http response RawResponse *http.Response // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about // a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateListenerResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateListenerResponse) HTTPResponse() *http.Response { return response.RawResponse }
oracle/terraform-provider-baremetal
vendor/github.com/oracle/oci-go-sdk/v46/loadbalancer/create_listener_request_response.go
GO
mpl-2.0
3,638
dojo.provide("dojox.layout.ContentPane"); dojo.require("dijit.layout.ContentPane"); dojo.require("dojox.html._base"); dojo.declare("dojox.layout.ContentPane", dijit.layout.ContentPane, { // summary: // An extended version of dijit.layout.ContentPane. // Supports infile scripts and external ones declared by <script src='' // relative path adjustments (content fetched from a different folder) // <style> and <link rel='stylesheet' href='..'> tags, // css paths inside cssText is adjusted (if you set adjustPaths = true) // // NOTE that dojo.require in script in the fetched file isn't recommended // Many widgets need to be required at page load to work properly // adjustPaths: Boolean // Adjust relative paths in html string content to point to this page. // Only useful if you grab content from a another folder then the current one adjustPaths: false, // cleanContent: Boolean // summary: // cleans content to make it less likely to generate DOM/JS errors. // description: // useful if you send ContentPane a complete page, instead of a html fragment // scans for // // * title Node, remove // * DOCTYPE tag, remove cleanContent: false, // renderStyles: Boolean // trigger/load styles in the content renderStyles: false, // executeScripts: Boolean // Execute (eval) scripts that is found in the content executeScripts: true, // scriptHasHooks: Boolean // replace keyword '_container_' in scripts with 'dijit.byId(this.id)' // NOTE this name might change in the near future scriptHasHooks: false, /*====== // ioMethod: dojo.xhrGet|dojo.xhrPost // reference to the method that should grab the content ioMethod: dojo.xhrGet, // ioArgs: Object // makes it possible to add custom args to xhrGet, like ioArgs.headers['X-myHeader'] = 'true' ioArgs: {}, ======*/ constructor: function(){ // init per instance properties, initializer doesn't work here because how things is hooked up in dijit._Widget this.ioArgs = {}; this.ioMethod = dojo.xhrGet; }, onExecError: function(e){ // summary: // event callback, called on script error or on java handler error // overide and return your own html string if you want a some text // displayed within the ContentPane }, _setContent: function(cont){ // override dijit.layout.ContentPane._setContent, to enable path adjustments var setter = this._contentSetter; if(! (setter && setter instanceof dojox.html._ContentSetter)) { setter = this._contentSetter = new dojox.html._ContentSetter({ node: this.containerNode, _onError: dojo.hitch(this, this._onError), onContentError: dojo.hitch(this, function(e){ // fires if a domfault occurs when we are appending this.errorMessage // like for instance if domNode is a UL and we try append a DIV var errMess = this.onContentError(e); try{ this.containerNode.innerHTML = errMess; }catch(e){ console.error('Fatal '+this.id+' could not change content due to '+e.message, e); } })/*, _onError */ }); }; // stash the params for the contentSetter to allow inheritance to work for _setContent this._contentSetterParams = { adjustPaths: Boolean(this.adjustPaths && (this.href||this.referencePath)), referencePath: this.href || this.referencePath, renderStyles: this.renderStyles, executeScripts: this.executeScripts, scriptHasHooks: this.scriptHasHooks, scriptHookReplacement: "dijit.byId('"+this.id+"')" }; this.inherited("_setContent", arguments); } // could put back _renderStyles by wrapping/aliasing dojox.html._ContentSetter.prototype._renderStyles });
ThesisPlanet/EducationPlatform
src/public/js/libs/dojox/layout/ContentPane.js
JavaScript
mpl-2.0
3,743
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `ACCUM_GREEN_SIZE` constant in crate `offscreen_gl_context`."> <meta name="keywords" content="rust, rustlang, rust-lang, ACCUM_GREEN_SIZE"> <title>offscreen_gl_context::glx::ACCUM_GREEN_SIZE - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>offscreen_gl_context</a>::<wbr><a href='index.html'>glx</a></p><script>window.sidebarCurrent = {name: 'ACCUM_GREEN_SIZE', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>offscreen_gl_context</a>::<wbr><a href='index.html'>glx</a>::<wbr><a class='constant' href=''>ACCUM_GREEN_SIZE</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-4751' class='srclink' href='../../src/offscreen_gl_context///home/servo/buildbot/slave/doc/build/target/debug/build/offscreen_gl_context-cc3be91171f9cf84/out/glx_bindings.rs.html#315' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const ACCUM_GREEN_SIZE: <a class='type' href='../../offscreen_gl_context/glx/types/type.GLenum.html' title='offscreen_gl_context::glx::types::GLenum'>GLenum</a><code> = </code><code>15</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "offscreen_gl_context"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
offscreen_gl_context/glx/constant.ACCUM_GREEN_SIZE.html
HTML
mpl-2.0
4,217
# HASH/SHA512-224 {% method -%} Puts the SHA-512/224 hash of the top item on the stack back to the top of the stack Input stack: `a` Output stack: `b` {% common -%} ``` PumpkinDB> "The quick brown fox jumps over the lazy dog" HASH/SHA512-224 0x944cd2847fb54558d4775db0485a50003111c8e5daa63fe722c6aa37 ``` {% endmethod %} ## Allocation Allocates for the result of the hashing ## Errors [EmptyStack](../errors/EmptyStack.md) error if there are no items on the stack ## Tests ```test works : "" HASH/SHA512-224 0x6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4 EQUAL?. empty_stack : [HASH/SHA512-224] TRY UNWRAP 0x04 EQUAL?. ```
PumpkinDB/PumpkinDB
doc/script/HASH/SHA512-224.md
Markdown
mpl-2.0
648
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `TIOCINQ` constant in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, TIOCINQ"> <title>libc::notbsd::other::TIOCINQ - Rust</title> <link rel="stylesheet" type="text/css" href="../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../../../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='../../index.html'>libc</a>::<wbr><a href='../index.html'>notbsd</a>::<wbr><a href='index.html'>other</a></p><script>window.sidebarCurrent = {name: 'TIOCINQ', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../../index.html'>libc</a>::<wbr><a href='../index.html'>notbsd</a>::<wbr><a href='index.html'>other</a>::<wbr><a class='constant' href=''>TIOCINQ</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-3092' class='srclink' href='../../../src/libc/unix/notbsd/linux/other/mod.rs.html#454' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const TIOCINQ: <a class='type' href='../../../libc/unix/notbsd/linux/other/b64/type.c_ulong.html' title='libc::unix::notbsd::linux::other::b64::c_ulong'>c_ulong</a><code> = </code><code>21531</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script defer src="../../../search-index.js"></script> </body> </html>
servo/doc.servo.org
libc/notbsd/other/constant.TIOCINQ.html
HTML
mpl-2.0
4,581
const path = require('path'); const webpack = require('webpack'); const fs = require('fs'); const merge = require('webpack-merge'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const base = require('./base.config'); module.exports = merge(base, { cache: true, entry: { index: ['whatwg-fetch'], }, module: { rules: [ { test: /\.jsx?$/, use: [ { loader: 'babel-loader', options: { cacheDirectory: true, }, }, 'if-loader', ], include: [path.join(__dirname, 'app')], }, ], }, plugins: [ new webpack.LoaderOptionsPlugin({ options: { 'if-loader': 'prod', // TODO: deprecated option, https://webpack.js.org/guides/migrating/#uglifyjsplugin-minimize-loadersminimize: true, minimize: true, }, }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production'), TESTING_FONT: false, }, }), new UglifyJsPlugin({ sourceMap: true, include: __dirname, extractComments: true, }), /* new webpack.DllReferencePlugin({ context: __dirname, manifest: require('./dist/dll/libs-manifest'), sourceType: 'this', }), */ ], output: merge(base.output, { filename: '[name].bundle.js', chunkFilename: '[name].bundle.js', path: path.resolve(__dirname, 'dist'), }), });
byte-foundry/prototypo
prod.config.js
JavaScript
mpl-2.0
1,324
bem-naming ========== Tool for working with [BEM entity](https://en.bem.info/methodology/key-concepts/#bem-entity) representations: allows you to parse [string representation](#string-representation) and stringify [object representation](#object-representation). Supports various [naming conventions](#naming-conventions): [origin](#origin-naming-convention), [two dashes](#two-dashes-style), [react]((#react-naming-convention)) and allows to create your convention. [![NPM Status][npm-img]][npm] [![Travis Status][test-img]][travis] [![Coverage Status][coverage-img]][coveralls] [![Dependency Status][dependency-img]][david] [npm]: https://www.npmjs.org/package/@bem/naming [npm-img]: https://img.shields.io/npm/v/@bem/naming.svg [travis]: https://travis-ci.org/bem-sdk/bem-naming [test-img]: https://img.shields.io/travis/bem-sdk/bem-naming.svg?label=tests [coveralls]: https://coveralls.io/r/bem-sdk/bem-naming [coverage-img]: https://img.shields.io/coveralls/bem-sdk/bem-naming.svg [david]: https://david-dm.org/bem-sdk/bem-naming [dependency-img]: http://img.shields.io/david/bem-sdk/bem-naming.svg Install ------- ``` $ npm install --save @bem/naming ``` Usage ----- ```js const bemNaming = require('@bem/naming'); bemNaming.parse('button__text'); // BemEntityName { block: 'button', elem: 'text' } bemNaming.stringify({ block: 'button', mod: 'checked' }); // String 'button_checked' ``` Table of Contents ----------------- * [BEM Entity representation](#bem-entity-representation) * [Object representation](#object-representation) * [String representation](#string-representation) * [Common misconceptions](#common-misconceptions) * [Naming conventions](#naming-conventions) * [Origin naming convention](#origin-naming-convention) * [Two Dashes style](#two-dashes-style) * [React naming convention](#react-naming-convention) * [Custom naming convention](#custom-naming-convention) * [API](#api) * [bemNaming({ delims: {elem, mod}, wordPattern })](#bemnaming-delims-elem-mod-wordpattern-) * [parse(str)](#parsestr) * [stringify(entityName)](#stringifyentityname) * [delims](#delims) BEM Entity representation ------------------------- With [BEM entity](https://en.bem.info/methodology/key-concepts/#bem-entity) representation you can define block, element, block modifier and element modifier. The representation can include name of block, name of element, name of modifier and value of modifier. BEM entity can be represented using `Object` or `String`. ### Object representation The [BemEntityName](https://github.com/bem-sdk/bem-entity-name) class describes the representation of a BEM entity name. ### String representation To define BEM entities, we often use a special string format that allows us to define exactly which entity is represented. According to the original BEM naming convention, it looks like this: ```js 'block[_block-mod-name[_block-mod-val]][__elem-name[_elem-mod-name[_elem-mod-val]]]' ``` *(Parameters within square brackets are optional)* #### Delimiters The names are separated from each other by means of special delimiters. The original naming uses the following delimiters: * `__` — to separate an element from a block * `_` — to separate a modifier name from a block or element and to separate a modifier value from a modifier name #### Examples | BEM Entity Type | String Representation | |------------------|--------------------------------------------| | Block | `block-name` | | Block modifier | `block-scope_mod-name_mod-val` | | Element | `block-scope__elem-name` | | Element modifier | `block-scope__elem-scope_mod-name_mod-val` | The simple modifier doesn't have value. Therefore, in the string representation the value should be omitted. | BEM Entity Type | String Representation | |------------------|------------------------------------| | Block modifier | `block-scope_mod-name` | | Element modifier | `block-scope__elem-scope_mod-name` | Common misconceptions --------------------- The BEM methodology uses a flat structure inside blocks. This means that a BEM entity can't be represented as an element of another element, and the following string representation will be invalid: ```js 'block__some-elem__sub-elem' ``` For more information, see the [FAQ](https://en.bem.info/methodology/faq/): > [Why doesn't BEM recommend using elements within elements (block__elem1__elem2)?](https://en.bem.info/methodology/faq/#why-does-bem-not-recommend-using-elements-within-elements-block__elem1__elem2) Also, a BEM entity can't be a block modifier and an element modifier simultaneously, so the following string representation will be invalid: ```js 'block_block-mod-name_block-mod-val__elem-name_elem-mod-name_elem-mod-val' ``` Naming conventions ------------------ The main idea of the naming convention is to make names of [BEM entities](https://en.bem.info/methodology/key-concepts/#bem-entity) as informative and clear as possible. > Read more in the section [naming convention](https://en.bem.info/methodology/naming-convention/) of the [BEM methodology](https://en.bem.info/methodology/). The BEM methodology provides an idea for creating naming rules and implements that idea in its canonical naming convention: [origin naming convention](#origin-naming-convention). However, a number of alternative schemes based on the BEM principles also exist in the world of web development: * [Two Dashes style](#two-dashes-style) * [React naming convention](#react-naming-convention) In addition, you can invent your naming convention. How to do this, see the [Custom naming convention](#custom-naming-convention) section. ### Origin naming convention According to this convention elements are delimited with two underscores (`__`), modifiers and values of modifiers are delimited by one underscore (`_`). > Read more in the section [naming convention](https://en.bem.info/methodology/naming-convention/) of the [BEM methodology](https://en.bem.info/methodology/). Example: ```js const originNaming = require('@bem/naming')('origin'); originNaming.parse('block__elem'); // BemEntityName { block: 'block', elem: 'elem' } originNaming.parse('block_mod_val'); // BemEntityName { block: 'block', // mod: { name: 'mod', val: 'val' } } originNaming.stringify({ block: 'block', elem: 'elem', mod: 'mod' }); // ➜ block__elem_mod ``` ### Two Dashes style According to this convention elements are delimited with two underscores (`__`), modifiers are delimited by two hyphens (`--`), and values of modifiers are delimited by one underscore (`_`). > Read more in the [Guidelines](http://cssguidelin.es/#bem-like-naming). Example: ```js const twoDashesNaming = require('@bem/naming')('two-dashes'); twoDashesNaming.parse('block__elem'); // { block: 'block', elem: 'elem' } twoDashesNaming.parse('block--mod_val'); // { block: 'block', // mod: { name: 'mod', val: 'val' } } twoDashesNaming.stringify({ block: 'block', elem: 'elem', mod: 'mod' }); // ➜ block__elem--mod ``` ### React naming convention According to this convention elements are delimited with one hyphen (`-`), modifiers are delimited by one underscore (`_`), and values of modifiers are delimited by one underscore (`_`). > You can explore this convention at [bem-react-components](https://github.com/bem/bem-react-components). Example: ```js const reactNaming = require('@bem/naming')('react'); reactNaming.parse('Block-Elem'); // BemEntityName { block: 'Block', elem: 'Elem' } reactNaming.parse('Block_Mod_Val'); // BemEntityName { block: 'Block', // mod: { name: 'Mod', val: 'Val' } } reactNaming.stringify({ block: 'Block', elem: 'Elem', mod: 'Mod' }); // ➜ Block-Elem_Mod ``` ### Custom naming convention To create an instance where you can manage your own naming convention use the [bemNaming](#bemnaming-elem-mod-wordpattern-) function. Example: ```js const createBemNaming = require('@bem/naming'); const myNaming = createBemNaming({ delims: { elem: '-', mod: { name: '--', val: '_' } }, wordPattern: '[a-zA-Z0-9]+' // because element and modifier's separators include }); // hyphen in it, we need to exclude it from block, // element and modifier's name myNaming.parse('block--mod_val'); // BemEntityName // { block: 'block', // mod: { name: 'mod', val: 'val' } } const BemEntityName = require('@bem/entity-name'); myNaming.stringify(new BemEntityName({ block: 'blockName', elem: 'elemName', mod: 'simpleElemMod' }); // ➜ blockName-elemName--simpleElemMod ``` API --- * [bemNaming({ delims: {elem, mod}, wordPattern })](#bemnaming-delims-elem-mod-wordpattern-) * [parse(str)](#parsestr) * [stringify(entityName)](#stringifyentityname) * [delims](#delims) ### bemNaming({ delims: {elem, mod}, wordPattern }) Parameter | Type | Description | Default ------------------|----------|-----------------------------------------------------------------------------------|---------------------------------------- `delims` | `object` | Defines delimeters for elem and/or mods | `delims.elem` | `string` | Separates element's name from block. | `__` `delims.mod` | `string`, `{ name: string, val: string }` | Separates modifier from block or element. | `_` `delims.mod.name` | `string` | Separates a modifier name from a block or an element. | `_` `delims.mod.val` | `string` | Separates the value of a modifier from the modifier name. | `_` `wordPattern` | `string` | Defines which characters can be used in names of blocks, elements, and modifiers. | `[a-z0-9]+(?:-[a-z0-9]+)*` ### parse(str) Parameter | Type | Description ----------|----------|-------------------------------- `str` | `string` | BEM entity name representation. Parses the string into an instance of `BemEntityName`. Example: ```js const bemNaming = require('@bem/naming'); bemNaming.parse('block__elem_mod_val'); // ➜ BemEntityName { // block: 'block', // elem: 'elem', // mod: { name: 'mod', val: 'val' } // } ``` ### stringify(entityName) Parameter | Type | Description -------------|---------------------------|-------------------------------- `entityName` | `BemEntityName`, `object` | BEM entity name representation. Forms a string from the instance of `BemEntityName`. Example: ```js const bemNaming = require('@bem/naming'); const BemEntityName = require('@bem/entity-name'); bemNaming.stringify(new BemEntityName({ block: 'block', elem: 'elem', mod: { name: 'mod', val: 'val' } }); // ➜ block__elem_mod_val ``` ### delims Strings to separate names of bem entities. Type: `Object` #### delims.elem String to separate an element from a block. Type: `String` Default: `__` #### delims.mod.name String to separate a modifier name from a block or element. Type: `String` Default: `_` #### delims.mod.val String to separate a modifier value from the name of the modifier. Type: `String` Default: `_` License ------- Code and documentation copyright 2014 YANDEX LLC. Code released under the [Mozilla Public License 2.0](LICENSE.txt).
bem-sdk/bem-naming
README.md
Markdown
mpl-2.0
11,805
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `_Z20JS_RestoreFrameChainP9JSContext` fn in crate `js`."> <meta name="keywords" content="rust, rustlang, rust-lang, _Z20JS_RestoreFrameChainP9JSContext"> <title>js::jsapi::_Z20JS_RestoreFrameChainP9JSContext - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>js</a>::<wbr><a href='index.html'>jsapi</a></p><script>window.sidebarCurrent = {name: '_Z20JS_RestoreFrameChainP9JSContext', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>js</a>::<wbr><a href='index.html'>jsapi</a>::<wbr><a class='fn' href=''>_Z20JS_RestoreFrameChainP9JSContext</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-20219' class='srclink' href='../../src/js/jsapi.rs.html#4890' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>unsafe extern fn _Z20JS_RestoreFrameChainP9JSContext(cx: <a href='../../std/primitive.pointer.html'>*mut <a class='enum' href='../../js/jsapi/enum.JSContext.html' title='js::jsapi::JSContext'>JSContext</a></a>)</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "js"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
js/jsapi/fn._Z20JS_RestoreFrameChainP9JSContext.html
HTML
mpl-2.0
4,094
package terraform import ( "bytes" "fmt" "os" "reflect" "sort" "strings" "sync" "sync/atomic" "testing" "time" "github.com/hashicorp/terraform/config/module" ) func TestContext2Apply(t *testing.T) { m := testModule(t, "apply-good") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) < 2 { t.Fatalf("bad: %#v", mod.Resources) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_providerAlias(t *testing.T) { m := testModule(t, "apply-provider-alias") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) < 2 { t.Fatalf("bad: %#v", mod.Resources) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProviderAliasStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } // GH-2870 func TestContext2Apply_providerWarning(t *testing.T) { m := testModule(t, "apply-provider-warning") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn p.ValidateFn = func(c *ResourceConfig) (ws []string, es []error) { ws = append(ws, "Just a warning") return } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(` aws_instance.foo: ID = foo `) if actual != expected { t.Fatalf("got: \n%s\n\nexpected:\n%s", actual, expected) } if !p.ConfigureCalled { t.Fatalf("provider Configure() was never called!") } } func TestContext2Apply_emptyModule(t *testing.T) { m := testModule(t, "apply-empty-module") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) actual = strings.Replace(actual, " ", "", -1) expected := strings.TrimSpace(testTerraformApplyEmptyModuleStr) if actual != expected { t.Fatalf("bad: \n%s\nexpect:\n%s", actual, expected) } } func TestContext2Apply_createBeforeDestroy(t *testing.T) { m := testModule(t, "apply-good-create-before") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "require_new": "abc", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf(p.String()) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) != 1 { t.Fatalf("bad: %s", state) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCreateBeforeStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_createBeforeDestroyUpdate(t *testing.T) { m := testModule(t, "apply-good-create-before-update") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "bar", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf(p.String()) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) != 1 { t.Fatalf("bad: %s", state) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCreateBeforeUpdateStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_destroyComputed(t *testing.T) { m := testModule(t, "apply-destroy-computed") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "foo", Attributes: map[string]string{ "output": "value", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, Destroy: true, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf(p.String()) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } // https://github.com/hashicorp/terraform/pull/5096 func TestContext2Apply_destroySkipsCBD(t *testing.T) { // Config contains CBD resource depending on non-CBD resource, which triggers // a cycle if they are both replaced, but should _not_ trigger a cycle when // just doing a `terraform destroy`. m := testModule(t, "apply-destroy-cbd") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "foo", }, }, "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "foo", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, Destroy: true, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf(p.String()) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } // https://github.com/hashicorp/terraform/issues/2892 func TestContext2Apply_destroyCrossProviders(t *testing.T) { m := testModule(t, "apply-destroy-cross-providers") p_aws := testProvider("aws") p_aws.ApplyFn = testApplyFn p_aws.DiffFn = testDiffFn p_tf := testProvider("terraform") p_tf.ApplyFn = testApplyFn p_tf.DiffFn = testDiffFn providers := map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p_aws), "terraform": testProviderFuncFixed(p_tf), } // Bug only appears from time to time, // so we run this test multiple times // to check for the race-condition for i := 0; i <= 10; i++ { ctx := getContextForApply_destroyCrossProviders( t, m, providers) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf(p.String()) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } } func getContextForApply_destroyCrossProviders( t *testing.T, m *module.Tree, providers map[string]ResourceProviderFactory) *Context { state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "terraform_remote_state.shared": &ResourceState{ Type: "terraform_remote_state", Primary: &InstanceState{ ID: "remote-2652591293", Attributes: map[string]string{ "output.env_name": "test", }, }, }, }, }, &ModuleState{ Path: []string{"root", "example"}, Resources: map[string]*ResourceState{ "aws_vpc.bar": &ResourceState{ Type: "aws_vpc", Primary: &InstanceState{ ID: "vpc-aaabbb12", Attributes: map[string]string{ "value": "test", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: providers, State: state, Destroy: true, }) return ctx } func TestContext2Apply_minimal(t *testing.T) { m := testModule(t, "apply-minimal") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyMinimalStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_badDiff(t *testing.T) { m := testModule(t, "apply-good") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "newp": nil, }, }, nil } if _, err := ctx.Apply(); err == nil { t.Fatal("should error") } } func TestContext2Apply_cancel(t *testing.T) { stopped := false m := testModule(t, "apply-cancel") p := testProvider("aws") ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) p.ApplyFn = func(*InstanceInfo, *InstanceState, *InstanceDiff) (*InstanceState, error) { if !stopped { stopped = true go ctx.Stop() for { if ctx.sh.Stopped() { break } } } return &InstanceState{ ID: "foo", Attributes: map[string]string{ "num": "2", }, }, nil } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "num": &ResourceAttrDiff{ New: "bar", }, }, }, nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } // Start the Apply in a goroutine stateCh := make(chan *State) go func() { state, err := ctx.Apply() if err != nil { panic(err) } stateCh <- state }() state := <-stateCh mod := state.RootModule() if len(mod.Resources) != 1 { t.Fatalf("bad: %s", state.String()) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCancelStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_compute(t *testing.T) { m := testModule(t, "apply-compute") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } ctx.variables = map[string]string{"value": "1"} state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyComputeStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_countDecrease(t *testing.T) { m := testModule(t, "apply-count-dec") p := testProvider("aws") p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo.0": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "foo", "type": "aws_instance", }, }, }, "aws_instance.foo.1": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "foo", "type": "aws_instance", }, }, }, "aws_instance.foo.2": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "foo", "type": "aws_instance", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCountDecStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_countDecreaseToOne(t *testing.T) { m := testModule(t, "apply-count-dec-one") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo.0": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "foo", "type": "aws_instance", }, }, }, "aws_instance.foo.1": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, "aws_instance.foo.2": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCountDecToOneStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } // https://github.com/PeoplePerHour/terraform/pull/11 // // This tests a case where both a "resource" and "resource.0" are in // the state file, which apparently is a reasonable backwards compatibility // concern found in the above 3rd party repo. func TestContext2Apply_countDecreaseToOneCorrupted(t *testing.T) { m := testModule(t, "apply-count-dec-one") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "foo", "type": "aws_instance", }, }, }, "aws_instance.foo.0": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "baz", Attributes: map[string]string{ "type": "aws_instance", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { testStringMatch(t, p, testTerraformApplyCountDecToOneCorruptedPlanStr) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCountDecToOneCorruptedStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_countTainted(t *testing.T) { m := testModule(t, "apply-count-tainted") p := testProvider("aws") p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo.0": &ResourceState{ Type: "aws_instance", Tainted: []*InstanceState{ &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "foo", "type": "aws_instance", }, }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCountTaintedStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_countVariable(t *testing.T) { m := testModule(t, "apply-count-variable") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyCountVariableStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_mapVariableOverride(t *testing.T) { m := testModule(t, "apply-map-var-override") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Variables: map[string]string{ "images.us-west-2": "overridden", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(` aws_instance.bar: ID = foo ami = overridden type = aws_instance aws_instance.foo: ID = foo ami = image-1234 type = aws_instance `) if actual != expected { t.Fatalf("got: \n%s\nexpected: \n%s", actual, expected) } } func TestContext2Apply_module(t *testing.T) { m := testModule(t, "apply-module") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyModuleStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_moduleDestroyOrder(t *testing.T) { m := testModule(t, "apply-module-destroy-order") p := testProvider("aws") p.DiffFn = testDiffFn // Create a custom apply function to track the order they were destroyed var order []string var orderLock sync.Mutex p.ApplyFn = func( info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { orderLock.Lock() defer orderLock.Unlock() order = append(order, is.ID) return nil, nil } state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.b": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "b", }, }, }, }, &ModuleState{ Path: []string{"root", "child"}, Resources: map[string]*ResourceState{ "aws_instance.a": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "a", }, }, }, Outputs: map[string]string{ "a_output": "a", }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } expected := []string{"b", "a"} if !reflect.DeepEqual(order, expected) { t.Fatalf("bad: %#v", order) } { actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyModuleDestroyOrderStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } } func TestContext2Apply_moduleOrphanProvider(t *testing.T) { m := testModule(t, "apply-module-orphan-provider-inherit") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn p.ConfigureFn = func(c *ResourceConfig) error { if _, ok := c.Get("value"); !ok { return fmt.Errorf("value is not found") } return nil } // Create a state with an orphan module state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: []string{"root", "child"}, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, State: state, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } // This tests an issue where all the providers in a module but not // in the root weren't being added to the root properly. In this test // case: aws is explicitly added to root, but "test" should be added to. // With the bug, it wasn't. func TestContext2Apply_moduleOnlyProvider(t *testing.T) { m := testModule(t, "apply-module-only-provider") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pTest := testProvider("test") pTest.ApplyFn = testApplyFn pTest.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), "test": testProviderFuncFixed(pTest), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyModuleOnlyProviderStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_moduleProviderAlias(t *testing.T) { m := testModule(t, "apply-module-provider-alias") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyModuleProviderAliasStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_moduleProviderAliasTargets(t *testing.T) { m := testModule(t, "apply-module-provider-alias") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"no.thing"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(` <no state> `) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_moduleProviderCloseNested(t *testing.T) { m := testModule(t, "apply-module-provider-close-nested") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: &State{ Modules: []*ModuleState{ &ModuleState{ Path: []string{"root", "child", "subchild"}, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, }, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } func TestContext2Apply_moduleVarResourceCount(t *testing.T) { m := testModule(t, "apply-module-var-resource-count") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Variables: map[string]string{ "count": "2", }, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } ctx = testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Variables: map[string]string{ "count": "5", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } // GH-819 func TestContext2Apply_moduleBool(t *testing.T) { m := testModule(t, "apply-module-bool") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyModuleBoolStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_multiProvider(t *testing.T) { m := testModule(t, "apply-multi-provider") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pDO := testProvider("do") pDO.ApplyFn = testApplyFn pDO.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), "do": testProviderFuncFixed(pDO), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) < 2 { t.Fatalf("bad: %#v", mod.Resources) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyMultiProviderStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_multiVar(t *testing.T) { m := testModule(t, "apply-multi-var") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn // First, apply with a count of 3 ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Variables: map[string]string{ "count": "3", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := state.RootModule().Outputs["output"] expected := "bar0,bar1,bar2" if actual != expected { t.Fatalf("bad: \n%s", actual) } // Apply again, reduce the count to 1 { ctx := testContext2(t, &ContextOpts{ Module: m, State: state, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Variables: map[string]string{ "count": "1", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := state.RootModule().Outputs["output"] expected := "bar0" if actual != expected { t.Fatalf("bad: \n%s", actual) } } } func TestContext2Apply_nilDiff(t *testing.T) { m := testModule(t, "apply-good") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return nil, nil } if _, err := ctx.Apply(); err == nil { t.Fatal("should error") } } func TestContext2Apply_outputOrphan(t *testing.T) { m := testModule(t, "apply-output-orphan") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Outputs: map[string]string{ "foo": "bar", "bar": "baz", }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyOutputOrphanStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_providerComputedVar(t *testing.T) { m := testModule(t, "apply-provider-computed") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pTest := testProvider("test") pTest.ApplyFn = testApplyFn pTest.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), "test": testProviderFuncFixed(pTest), }, }) p.ConfigureFn = func(c *ResourceConfig) error { if c.IsComputed("value") { return fmt.Errorf("value is computed") } v, ok := c.Get("value") if !ok { return fmt.Errorf("value is not found") } if v != "yes" { return fmt.Errorf("value is not 'yes': %v", v) } return nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } func TestContext2Apply_Provisioner_compute(t *testing.T) { m := testModule(t, "apply-provisioner-compute") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { val, ok := c.Config["foo"] if !ok || val != "computed_dynamical" { t.Fatalf("bad value for foo: %v %#v", val, c) } return nil } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, Variables: map[string]string{ "value": "1", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was invoked if !pr.ApplyCalled { t.Fatalf("provisioner not invoked") } } func TestContext2Apply_provisionerCreateFail(t *testing.T) { m := testModule(t, "apply-provisioner-fail-create") p := testProvider("aws") pr := testProvisioner() p.DiffFn = testDiffFn p.ApplyFn = func( info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { is.ID = "foo" return is, fmt.Errorf("error") } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerFailCreateStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_provisionerCreateFailNoId(t *testing.T) { m := testModule(t, "apply-provisioner-fail-create") p := testProvider("aws") pr := testProvisioner() p.DiffFn = testDiffFn p.ApplyFn = func( info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { return nil, fmt.Errorf("error") } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerFailCreateNoIdStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_provisionerFail(t *testing.T) { m := testModule(t, "apply-provisioner-fail") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(*InstanceState, *ResourceConfig) error { return fmt.Errorf("EXPLOSION") } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, Variables: map[string]string{ "value": "1", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerFailStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_provisionerFail_createBeforeDestroy(t *testing.T) { m := testModule(t, "apply-provisioner-fail-create-before") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(*InstanceState, *ResourceConfig) error { return fmt.Errorf("EXPLOSION") } state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "require_new": "abc", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, State: state, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerFailCreateBeforeDestroyStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_error_createBeforeDestroy(t *testing.T) { m := testModule(t, "apply-error-create-before") p := testProvider("aws") state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "require_new": "abc", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) p.ApplyFn = func(info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { return nil, fmt.Errorf("error") } p.DiffFn = testDiffFn if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should have error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyErrorCreateBeforeDestroyStr) if actual != expected { t.Fatalf("bad: \n%s\n\nExpected:\n\n%s", actual, expected) } } func TestContext2Apply_errorDestroy_createBeforeDestroy(t *testing.T) { m := testModule(t, "apply-error-create-before") p := testProvider("aws") state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "require_new": "abc", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) p.ApplyFn = func(info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { // Fail the destroy! if id.Destroy { return is, fmt.Errorf("error") } // Create should work is = &InstanceState{ ID: "foo", } return is, nil } p.DiffFn = testDiffFn if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should have error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyErrorDestroyCreateBeforeDestroyStr) if actual != expected { t.Fatalf("bad: actual:\n%s\n\nexpected:\n%s", actual, expected) } } func TestContext2Apply_multiDepose_createBeforeDestroy(t *testing.T) { m := testModule(t, "apply-multi-depose-create-before-destroy") p := testProvider("aws") p.DiffFn = testDiffFn ps := map[string]ResourceProviderFactory{"aws": testProviderFuncFixed(p)} state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.web": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ID: "foo"}, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: ps, State: state, }) createdInstanceId := "bar" // Create works createFunc := func(is *InstanceState) (*InstanceState, error) { return &InstanceState{ID: createdInstanceId}, nil } // Destroy starts broken destroyFunc := func(is *InstanceState) (*InstanceState, error) { return is, fmt.Errorf("destroy failed") } p.ApplyFn = func(info *InstanceInfo, is *InstanceState, id *InstanceDiff) (*InstanceState, error) { if id.Destroy { return destroyFunc(is) } else { return createFunc(is) } } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } // Destroy is broken, so even though CBD successfully replaces the instance, // we'll have to save the Deposed instance to destroy later state, err := ctx.Apply() if err == nil { t.Fatal("should have error") } checkStateString(t, state, ` aws_instance.web: (1 deposed) ID = bar Deposed ID 1 = foo `) createdInstanceId = "baz" ctx = testContext2(t, &ContextOpts{ Module: m, Providers: ps, State: state, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } // We're replacing the primary instance once again. Destroy is _still_ // broken, so the Deposed list gets longer state, err = ctx.Apply() if err == nil { t.Fatal("should have error") } checkStateString(t, state, ` aws_instance.web: (2 deposed) ID = baz Deposed ID 1 = foo Deposed ID 2 = bar `) // Destroy partially fixed! destroyFunc = func(is *InstanceState) (*InstanceState, error) { if is.ID == "foo" || is.ID == "baz" { return nil, nil } else { return is, fmt.Errorf("destroy partially failed") } } createdInstanceId = "qux" if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err = ctx.Apply() // Expect error because 1/2 of Deposed destroys failed if err == nil { t.Fatal("should have error") } // foo and baz are now gone, bar sticks around checkStateString(t, state, ` aws_instance.web: (1 deposed) ID = qux Deposed ID 1 = bar `) // Destroy working fully! destroyFunc = func(is *InstanceState) (*InstanceState, error) { return nil, nil } createdInstanceId = "quux" if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err = ctx.Apply() if err != nil { t.Fatal("should not have error:", err) } // And finally the state is clean checkStateString(t, state, ` aws_instance.web: ID = quux `) } func TestContext2Apply_provisionerResourceRef(t *testing.T) { m := testModule(t, "apply-provisioner-resource-ref") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { val, ok := c.Config["foo"] if !ok || val != "2" { t.Fatalf("bad value for foo: %v %#v", val, c) } return nil } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerResourceRefStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was invoked if !pr.ApplyCalled { t.Fatalf("provisioner not invoked") } } func TestContext2Apply_provisionerSelfRef(t *testing.T) { m := testModule(t, "apply-provisioner-self-ref") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { val, ok := c.Config["command"] if !ok || val != "bar" { t.Fatalf("bad value for command: %v %#v", val, c) } return nil } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerSelfRefStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was invoked if !pr.ApplyCalled { t.Fatalf("provisioner not invoked") } } func TestContext2Apply_provisionerMultiSelfRef(t *testing.T) { var lock sync.Mutex commands := make([]string, 0, 5) m := testModule(t, "apply-provisioner-multi-self-ref") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { lock.Lock() defer lock.Unlock() val, ok := c.Config["command"] if !ok { t.Fatalf("bad value for command: %v %#v", val, c) } commands = append(commands, val.(string)) return nil } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerMultiSelfRefStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was invoked if !pr.ApplyCalled { t.Fatalf("provisioner not invoked") } // Verify our result sort.Strings(commands) expectedCommands := []string{"number 0", "number 1", "number 2"} if !reflect.DeepEqual(commands, expectedCommands) { t.Fatalf("bad: %#v", commands) } } // Provisioner should NOT run on a diff, only create func TestContext2Apply_Provisioner_Diff(t *testing.T) { m := testModule(t, "apply-provisioner-diff") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { return nil } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerDiffStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was invoked if !pr.ApplyCalled { t.Fatalf("provisioner not invoked") } pr.ApplyCalled = false // Change the state to force a diff mod := state.RootModule() mod.Resources["aws_instance.bar"].Primary.Attributes["foo"] = "baz" // Re-create context with state ctx = testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, State: state, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state2, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual = strings.TrimSpace(state2.String()) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was NOT invoked if pr.ApplyCalled { t.Fatalf("provisioner invoked") } } func TestContext2Apply_outputDiffVars(t *testing.T) { m := testModule(t, "apply-good") p := testProvider("aws") s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.baz": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { for k, ad := range d.Attributes { if ad.NewComputed { return nil, fmt.Errorf("%s: computed", k) } } result := s.MergeDiff(d) result.ID = "foo" return result, nil } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "foo": &ResourceAttrDiff{ NewComputed: true, Type: DiffAttrOutput, }, "bar": &ResourceAttrDiff{ New: "baz", }, }, }, nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } } func TestContext2Apply_Provisioner_ConnInfo(t *testing.T) { m := testModule(t, "apply-provisioner-conninfo") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { if s.Ephemeral.ConnInfo == nil { t.Fatalf("ConnInfo not initialized") } result, _ := testApplyFn(info, s, d) result.Ephemeral.ConnInfo = map[string]string{ "type": "ssh", "host": "127.0.0.1", "port": "22", } return result, nil } p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { conn := rs.Ephemeral.ConnInfo if conn["type"] != "telnet" { t.Fatalf("Bad: %#v", conn) } if conn["host"] != "127.0.0.1" { t.Fatalf("Bad: %#v", conn) } if conn["port"] != "2222" { t.Fatalf("Bad: %#v", conn) } if conn["user"] != "superuser" { t.Fatalf("Bad: %#v", conn) } if conn["pass"] != "test" { t.Fatalf("Bad: %#v", conn) } return nil } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, Variables: map[string]string{ "value": "1", "pass": "test", }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyProvisionerStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Verify apply was invoked if !pr.ApplyCalled { t.Fatalf("provisioner not invoked") } } func TestContext2Apply_destroy(t *testing.T) { m := testModule(t, "apply-destroy") h := new(HookRecordApplyOrder) p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) // First plan and apply a create operation if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } // Next, plan and apply a destroy operation h.Active = true ctx = testContext2(t, &ContextOpts{ Destroy: true, State: state, Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err = ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } // Test that things were destroyed actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyDestroyStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } // Test that things were destroyed _in the right order_ expected2 := []string{"aws_instance.bar", "aws_instance.foo"} actual2 := h.IDs if !reflect.DeepEqual(actual2, expected2) { t.Fatalf("expected: %#v\n\ngot:%#v", expected2, actual2) } } func TestContext2Apply_destroyNestedModule(t *testing.T) { m := testModule(t, "apply-destroy-nested-module") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: []string{"root", "child", "subchild"}, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) // First plan and apply a create operation if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } // Test that things were destroyed actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyDestroyNestedModuleStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_destroyDeeplyNestedModule(t *testing.T) { m := testModule(t, "apply-destroy-deeply-nested-module") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: []string{"root", "child", "subchild", "subsubchild"}, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) // First plan and apply a create operation if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } // Test that things were destroyed actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(` module.child.subchild.subsubchild: <no state> `) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_destroyOutputs(t *testing.T) { m := testModule(t, "apply-destroy-outputs") h := new(HookRecordApplyOrder) p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) // First plan and apply a create operation if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } // Next, plan and apply a destroy operation h.Active = true ctx = testContext2(t, &ContextOpts{ Destroy: true, State: state, Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err = ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) > 0 { t.Fatalf("bad: %#v", mod) } } func TestContext2Apply_destroyOrphan(t *testing.T) { m := testModule(t, "apply-error") p := testProvider("aws") s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.baz": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { if d.Destroy { return nil, nil } result := s.MergeDiff(d) result.ID = "foo" return result, nil } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "num": &ResourceAttrDiff{ New: "bar", }, }, }, nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if _, ok := mod.Resources["aws_instance.baz"]; ok { t.Fatalf("bad: %#v", mod.Resources) } } func TestContext2Apply_destroyTaintedProvisioner(t *testing.T) { m := testModule(t, "apply-destroy-provisioner") p := testProvider("aws") pr := testProvisioner() p.ApplyFn = testApplyFn p.DiffFn = testDiffFn called := false pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { called = true return nil } s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Tainted: []*InstanceState{ &InstanceState{ ID: "bar", Attributes: map[string]string{ "id": "bar", }, }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Provisioners: map[string]ResourceProvisionerFactory{ "shell": testProvisionerFuncFixed(pr), }, State: s, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } if called { t.Fatal("provisioner should not be called") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace("<no state>") if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_error(t *testing.T) { errored := false m := testModule(t, "apply-error") p := testProvider("aws") ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) p.ApplyFn = func(*InstanceInfo, *InstanceState, *InstanceDiff) (*InstanceState, error) { if errored { state := &InstanceState{ ID: "bar", } return state, fmt.Errorf("error") } errored = true return &InstanceState{ ID: "foo", Attributes: map[string]string{ "num": "2", }, }, nil } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "num": &ResourceAttrDiff{ New: "bar", }, }, }, nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should have error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyErrorStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_errorPartial(t *testing.T) { errored := false m := testModule(t, "apply-error") p := testProvider("aws") s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { if errored { return s, fmt.Errorf("error") } errored = true return &InstanceState{ ID: "foo", Attributes: map[string]string{ "num": "2", }, }, nil } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "num": &ResourceAttrDiff{ New: "bar", }, }, }, nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should have error") } mod := state.RootModule() if len(mod.Resources) != 2 { t.Fatalf("bad: %#v", mod.Resources) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyErrorPartialStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_hook(t *testing.T) { m := testModule(t, "apply-good") h := new(MockHook) p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } if !h.PreApplyCalled { t.Fatal("should be called") } if !h.PostApplyCalled { t.Fatal("should be called") } if !h.PostStateUpdateCalled { t.Fatalf("should call post state update") } } func TestContext2Apply_hookOrphan(t *testing.T) { m := testModule(t, "apply-blank") h := new(MockHook) p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, State: state, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } if _, err := ctx.Apply(); err != nil { t.Fatalf("err: %s", err) } if !h.PreApplyCalled { t.Fatal("should be called") } if !h.PostApplyCalled { t.Fatal("should be called") } if !h.PostStateUpdateCalled { t.Fatalf("should call post state update") } } func TestContext2Apply_idAttr(t *testing.T) { m := testModule(t, "apply-idattr") p := testProvider("aws") ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { result := s.MergeDiff(d) result.ID = "foo" result.Attributes = map[string]string{ "id": "bar", } return result, nil } p.DiffFn = func(*InstanceInfo, *InstanceState, *ResourceConfig) (*InstanceDiff, error) { return &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{ "num": &ResourceAttrDiff{ New: "bar", }, }, }, nil } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() rs, ok := mod.Resources["aws_instance.foo"] if !ok { t.Fatal("not in state") } if rs.Primary.ID != "foo" { t.Fatalf("bad: %#v", rs.Primary.ID) } if rs.Primary.Attributes["id"] != "foo" { t.Fatalf("bad: %#v", rs.Primary.Attributes) } } func TestContext2Apply_output(t *testing.T) { m := testModule(t, "apply-output") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyOutputStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_outputInvalid(t *testing.T) { m := testModule(t, "apply-output-invalid") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) _, err := ctx.Plan() if err == nil { t.Fatalf("err: %s", err) } if !strings.Contains(err.Error(), "is not a string") { t.Fatalf("err: %s", err) } } func TestContext2Apply_outputAdd(t *testing.T) { m1 := testModule(t, "apply-output-add-before") p1 := testProvider("aws") p1.ApplyFn = testApplyFn p1.DiffFn = testDiffFn ctx1 := testContext2(t, &ContextOpts{ Module: m1, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p1), }, }) if _, err := ctx1.Plan(); err != nil { t.Fatalf("err: %s", err) } state1, err := ctx1.Apply() if err != nil { t.Fatalf("err: %s", err) } m2 := testModule(t, "apply-output-add-after") p2 := testProvider("aws") p2.ApplyFn = testApplyFn p2.DiffFn = testDiffFn ctx2 := testContext2(t, &ContextOpts{ Module: m2, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p2), }, State: state1, }) if _, err := ctx2.Plan(); err != nil { t.Fatalf("err: %s", err) } state2, err := ctx2.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state2.String()) expected := strings.TrimSpace(testTerraformApplyOutputAddStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_outputList(t *testing.T) { m := testModule(t, "apply-output-list") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyOutputListStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_outputMulti(t *testing.T) { m := testModule(t, "apply-output-multi") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyOutputMultiStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_outputMultiIndex(t *testing.T) { m := testModule(t, "apply-output-multi-index") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyOutputMultiIndexStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_taint(t *testing.T) { m := testModule(t, "apply-taint") p := testProvider("aws") // destroyCount tests against regression of // https://github.com/hashicorp/terraform/issues/1056 var destroyCount = int32(0) var once sync.Once simulateProviderDelay := func() { time.Sleep(10 * time.Millisecond) } p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { once.Do(simulateProviderDelay) if d.Destroy { atomic.AddInt32(&destroyCount, 1) } return testApplyFn(info, s, d) } p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.bar": &ResourceState{ Type: "aws_instance", Tainted: []*InstanceState{ &InstanceState{ ID: "baz", Attributes: map[string]string{ "num": "2", "type": "aws_instance", }, }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyTaintStr) if actual != expected { t.Fatalf("bad:\n%s", actual) } if destroyCount != 1 { t.Fatalf("Expected 1 destroy, got %d", destroyCount) } } func TestContext2Apply_taintDep(t *testing.T) { m := testModule(t, "apply-taint-dep") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Tainted: []*InstanceState{ &InstanceState{ ID: "baz", Attributes: map[string]string{ "num": "2", "type": "aws_instance", }, }, }, }, "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "baz", "num": "2", "type": "aws_instance", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf("plan: %s", p) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyTaintDepStr) if actual != expected { t.Fatalf("bad:\n%s", actual) } } func TestContext2Apply_taintDepRequiresNew(t *testing.T) { m := testModule(t, "apply-taint-dep-requires-new") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn s := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": &ResourceState{ Type: "aws_instance", Tainted: []*InstanceState{ &InstanceState{ ID: "baz", Attributes: map[string]string{ "num": "2", "type": "aws_instance", }, }, }, }, "aws_instance.bar": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "foo": "baz", "num": "2", "type": "aws_instance", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: s, }) if p, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } else { t.Logf("plan: %s", p) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyTaintDepRequireNewStr) if actual != expected { t.Fatalf("bad:\n%s", actual) } } func TestContext2Apply_targeted(t *testing.T) { m := testModule(t, "apply-targeted") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"aws_instance.foo"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) != 1 { t.Fatalf("expected 1 resource, got: %#v", mod.Resources) } checkStateString(t, state, ` aws_instance.foo: ID = foo num = 2 type = aws_instance `) } func TestContext2Apply_targetedCount(t *testing.T) { m := testModule(t, "apply-targeted-count") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"aws_instance.foo"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } checkStateString(t, state, ` aws_instance.foo.0: ID = foo aws_instance.foo.1: ID = foo aws_instance.foo.2: ID = foo `) } func TestContext2Apply_targetedCountIndex(t *testing.T) { m := testModule(t, "apply-targeted-count") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"aws_instance.foo[1]"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } checkStateString(t, state, ` aws_instance.foo.1: ID = foo `) } func TestContext2Apply_targetedDestroy(t *testing.T) { m := testModule(t, "apply-targeted") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": resourceState("aws_instance", "i-bcd345"), "aws_instance.bar": resourceState("aws_instance", "i-abc123"), }, }, }, }, Targets: []string{"aws_instance.foo"}, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) != 1 { t.Fatalf("expected 1 resource, got: %#v", mod.Resources) } checkStateString(t, state, ` aws_instance.bar: ID = i-abc123 `) } // https://github.com/hashicorp/terraform/issues/4462 func TestContext2Apply_targetedDestroyModule(t *testing.T) { m := testModule(t, "apply-targeted-module") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo": resourceState("aws_instance", "i-bcd345"), "aws_instance.bar": resourceState("aws_instance", "i-abc123"), }, }, &ModuleState{ Path: []string{"root", "child"}, Resources: map[string]*ResourceState{ "aws_instance.foo": resourceState("aws_instance", "i-bcd345"), "aws_instance.bar": resourceState("aws_instance", "i-abc123"), }, }, }, }, Targets: []string{"module.child.aws_instance.foo"}, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } checkStateString(t, state, ` aws_instance.bar: ID = i-abc123 aws_instance.foo: ID = i-bcd345 module.child: aws_instance.bar: ID = i-abc123 `) } func TestContext2Apply_targetedDestroyCountIndex(t *testing.T) { m := testModule(t, "apply-targeted-count") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.foo.0": resourceState("aws_instance", "i-bcd345"), "aws_instance.foo.1": resourceState("aws_instance", "i-bcd345"), "aws_instance.foo.2": resourceState("aws_instance", "i-bcd345"), "aws_instance.bar.0": resourceState("aws_instance", "i-abc123"), "aws_instance.bar.1": resourceState("aws_instance", "i-abc123"), "aws_instance.bar.2": resourceState("aws_instance", "i-abc123"), }, }, }, }, Targets: []string{ "aws_instance.foo[2]", "aws_instance.bar[1]", }, Destroy: true, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } checkStateString(t, state, ` aws_instance.bar.0: ID = i-abc123 aws_instance.bar.2: ID = i-abc123 aws_instance.foo.0: ID = i-bcd345 aws_instance.foo.1: ID = i-bcd345 `) } func TestContext2Apply_targetedModule(t *testing.T) { m := testModule(t, "apply-targeted-module") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"module.child"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.ModuleByPath([]string{"root", "child"}) if mod == nil { t.Fatalf("no child module found in the state!\n\n%#v", state) } if len(mod.Resources) != 2 { t.Fatalf("expected 2 resources, got: %#v", mod.Resources) } checkStateString(t, state, ` <no state> module.child: aws_instance.bar: ID = foo num = 2 type = aws_instance aws_instance.foo: ID = foo num = 2 type = aws_instance `) } // GH-1858 func TestContext2Apply_targetedModuleDep(t *testing.T) { m := testModule(t, "apply-targeted-module-dep") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"aws_instance.foo"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } checkStateString(t, state, ` aws_instance.foo: ID = foo foo = foo type = aws_instance Dependencies: module.child module.child: aws_instance.mod: ID = foo Outputs: output = foo `) } func TestContext2Apply_targetedModuleResource(t *testing.T) { m := testModule(t, "apply-targeted-module-resource") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Targets: []string{"module.child.aws_instance.foo"}, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.ModuleByPath([]string{"root", "child"}) if len(mod.Resources) != 1 { t.Fatalf("expected 1 resource, got: %#v", mod.Resources) } checkStateString(t, state, ` <no state> module.child: aws_instance.foo: ID = foo num = 2 type = aws_instance `) } func TestContext2Apply_unknownAttribute(t *testing.T) { m := testModule(t, "apply-unknown") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err == nil { t.Fatal("should error") } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyUnknownAttrStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_unknownAttributeInterpolate(t *testing.T) { m := testModule(t, "apply-unknown-interpolate") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) if _, err := ctx.Plan(); err == nil { t.Fatal("should error") } } func TestContext2Apply_vars(t *testing.T) { m := testModule(t, "apply-vars") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, Variables: map[string]string{ "foo": "us-west-2", "amis.us-east-1": "override", }, }) w, e := ctx.Validate() if len(w) > 0 { t.Fatalf("bad: %#v", w) } if len(e) > 0 { t.Fatalf("bad: %s", e) } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyVarsStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_varsEnv(t *testing.T) { // Set the env var old := tempEnv(t, "TF_VAR_ami", "baz") defer os.Setenv("TF_VAR_ami", old) m := testModule(t, "apply-vars-env") p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Module: m, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, }) w, e := ctx.Validate() if len(w) > 0 { t.Fatalf("bad: %#v", w) } if len(e) > 0 { t.Fatalf("bad: %s", e) } if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyVarsEnvStr) if actual != expected { t.Fatalf("bad: \n%s", actual) } } func TestContext2Apply_createBefore_depends(t *testing.T) { m := testModule(t, "apply-depends-create-before") h := new(HookRecordApplyOrder) p := testProvider("aws") p.ApplyFn = testApplyFn p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.web": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "require_new": "ami-old", }, }, }, "aws_instance.lb": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "baz", Attributes: map[string]string{ "instance": "bar", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } h.Active = true state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } mod := state.RootModule() if len(mod.Resources) < 2 { t.Fatalf("bad: %#v", mod.Resources) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyDependsCreateBeforeStr) if actual != expected { t.Fatalf("bad: \n%s\n%s", actual, expected) } // Test that things were managed _in the right order_ order := h.States diffs := h.Diffs if order[0].ID != "" || diffs[0].Destroy { t.Fatalf("should create new instance first: %#v", order) } if order[1].ID != "baz" { t.Fatalf("update must happen after create: %#v", order) } if order[2].ID != "bar" || !diffs[2].Destroy { t.Fatalf("destroy must happen after update: %#v", order) } } func TestContext2Apply_singleDestroy(t *testing.T) { m := testModule(t, "apply-depends-create-before") h := new(HookRecordApplyOrder) p := testProvider("aws") invokeCount := 0 p.ApplyFn = func(info *InstanceInfo, s *InstanceState, d *InstanceDiff) (*InstanceState, error) { invokeCount++ switch invokeCount { case 1: if d.Destroy { t.Fatalf("should not destroy") } if s.ID != "" { t.Fatalf("should not have ID") } case 2: if d.Destroy { t.Fatalf("should not destroy") } if s.ID != "baz" { t.Fatalf("should have id") } case 3: if !d.Destroy { t.Fatalf("should destroy") } if s.ID == "" { t.Fatalf("should have ID") } default: t.Fatalf("bad invoke count %d", invokeCount) } return testApplyFn(info, s, d) } p.DiffFn = testDiffFn state := &State{ Modules: []*ModuleState{ &ModuleState{ Path: rootModulePath, Resources: map[string]*ResourceState{ "aws_instance.web": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ "require_new": "ami-old", }, }, }, "aws_instance.lb": &ResourceState{ Type: "aws_instance", Primary: &InstanceState{ ID: "baz", Attributes: map[string]string{ "instance": "bar", }, }, }, }, }, }, } ctx := testContext2(t, &ContextOpts{ Module: m, Hooks: []Hook{h}, Providers: map[string]ResourceProviderFactory{ "aws": testProviderFuncFixed(p), }, State: state, }) if _, err := ctx.Plan(); err != nil { t.Fatalf("err: %s", err) } h.Active = true state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } if invokeCount != 3 { t.Fatalf("bad: %d", invokeCount) } } // GH-5254 func TestContext2Apply_issue5254(t *testing.T) { // Create a provider. We use "template" here just to match the repro // we got from the issue itself. p := testProvider("template") p.ResourcesReturn = append(p.ResourcesReturn, ResourceType{ Name: "template_file", }) p.ApplyFn = testApplyFn p.DiffFn = testDiffFn // Apply cleanly step 0 ctx := testContext2(t, &ContextOpts{ Module: testModule(t, "issue-5254/step-0"), Providers: map[string]ResourceProviderFactory{ "template": testProviderFuncFixed(p), }, }) plan, err := ctx.Plan() if err != nil { t.Fatalf("err: %s", err) } state, err := ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } // Application success. Now make the modification and store a plan ctx = testContext2(t, &ContextOpts{ Module: testModule(t, "issue-5254/step-1"), State: state, Providers: map[string]ResourceProviderFactory{ "template": testProviderFuncFixed(p), }, }) plan, err = ctx.Plan() if err != nil { t.Fatalf("err: %s", err) } // Write / Read plan to simulate running it through a Plan file var buf bytes.Buffer if err := WritePlan(plan, &buf); err != nil { t.Fatalf("err: %s", err) } planFromFile, err := ReadPlan(&buf) if err != nil { t.Fatalf("err: %s", err) } ctx = planFromFile.Context(&ContextOpts{ Providers: map[string]ResourceProviderFactory{ "template": testProviderFuncFixed(p), }, }) state, err = ctx.Apply() if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(` template_file.child: ID = foo template = Hi type = template_file Dependencies: template_file.parent template_file.parent: ID = foo template = Hi type = template_file `) if actual != expected { t.Fatalf("expected state: \n%s\ngot: \n%s", expected, actual) } }
ephemeralsnow/terraform
terraform/context_apply_test.go
GO
mpl-2.0
88,455
initSidebarItems({"mod":[["jar","A cookie jar implementation for storing a set of cookies."]],"struct":[["AttrVal",""],["Cookie",""],["CookieJar","A jar of cookies for managing a session"]]});
susaing/doc.servo.org
cookie/sidebar-items.js
JavaScript
mpl-2.0
192
/*--------------------------------------------------------------------------- * Copyright (C) 1999,2000 Dallas Semiconductor Corporation, All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of Dallas Semiconductor * shall not be used except as stated in the Dallas Semiconductor * Branding Policy. *--------------------------------------------------------------------------- */ namespace com.dalsemi.onewire.utils { /// <summary> /// Utility methods for performing SHA calculations. /// </summary> public class SHA { // SHA constants private static readonly int[] KTN = new int[] { 0x5a827999, 0x6ed9eba1, unchecked((int)0x8f1bbcdc), unchecked((int)0xca62c1d6) }; private const int H0 = 0x67452301; private const int H1 = unchecked((int)0xEFCDAB89); private const int H2 = unchecked((int)0x98BADCFE); private const int H3 = 0x10325476; private const int H4 = unchecked((int)0xC3D2E1F0); // some local variables in the compute SHA function. // can't 'static final' methods with no locals be // inlined easier? I think so, but I need to remember // to look into that. private static int word, i, j; private static int ShftTmp, Temp; private static readonly int[] MTword; private static readonly int[] H; static SHA() //initializer block { H = new int[5]; MTword = new int[80]; } private SHA() { // you can't instantiate this class } /// <summary> /// Does Dallas SHA, as specified in DS1963S datasheet. /// result is in intel Endian format, starting with the /// LSB of E to the MSB of E followed by the LSB of D. /// result array should be at least 20 bytes long, after /// the offset. /// </summary> /// <param name="MT"> The message block (padded if necessary). </param> /// <param name="result"> The byte[] into which the result will be copied. </param> /// <param name="offset"> The starting location in 'result' to start copying. </param> public static byte[] ComputeSHA(byte[] MT, byte[] result, int offset) { lock (typeof(SHA)) { ComputeSHA(MT, H); //split up the result into a byte array, LSB first for (i = 0; i < 5; i++) { word = H[4 - i]; j = (i << 2) + offset; result[j + 0] = (byte)((word) & 0x00FF); result[j + 1] = (byte)(((int)((uint)word >> 8)) & 0x00FF); result[j + 2] = (byte)(((int)((uint)word >> 16)) & 0x00FF); result[j + 3] = (byte)(((int)((uint)word >> 24)) & 0x00FF); } return result; } } /// <summary> /// Does Dallas SHA, as specified in DS1963S datasheet. /// result is in intel Endian format, starting with the /// LSB of E to the MSB of E followed by the LSB of D. /// </summary> /// <param name="MT"> The message block (padded if necessary). </param> /// <param name="ABCDE"> The result will be copied into this 5-int array. </param> public static void ComputeSHA(byte[] MT, int[] ABCDE) { lock (typeof(SHA)) { for (i = 0; i < 16; i++) { MTword[i] = ((MT[i * 4] & 0x00FF) << 24) | ((MT[i * 4 + 1] & 0x00FF) << 16) | ((MT[i * 4 + 2] & 0x00FF) << 8) | (MT[i * 4 + 3] & 0x00FF); } for (i = 16; i < 80; i++) { ShftTmp = MTword[i - 3] ^ MTword[i - 8] ^ MTword[i - 14] ^ MTword[i - 16]; MTword[i] = ((ShftTmp << 1) & unchecked((int)0xFFFFFFFE)) | (((int)((uint)ShftTmp >> 31)) & 0x00000001); } ABCDE[0] = H0; //A ABCDE[1] = H1; //B ABCDE[2] = H2; //C ABCDE[3] = H3; //D ABCDE[4] = H4; //E for (i = 0; i < 80; i++) { ShftTmp = ((ABCDE[0] << 5) & unchecked((int)0xFFFFFFE0)) | (((int)((uint)ABCDE[0] >> 27)) & 0x0000001F); Temp = NLF(ABCDE[1], ABCDE[2], ABCDE[3], i) + ABCDE[4] + KTN[i / 20] + MTword[i] + ShftTmp; ABCDE[4] = ABCDE[3]; ABCDE[3] = ABCDE[2]; ABCDE[2] = ((ABCDE[1] << 30) & unchecked((int)0xC0000000)) | (((int)((uint)ABCDE[1] >> 2)) & 0x3FFFFFFF); ABCDE[1] = ABCDE[0]; ABCDE[0] = Temp; } } } // calculation used for SHA. // static final methods with no locals should definitely be inlined // by the compiler. private static int NLF(int B, int C, int D, int n) { if (n < 20) { return ((B & C) | ((~B) & D)); } else if (n < 40) { return (B ^ C ^ D); } else if (n < 60) { return ((B & C) | (B & D) | (C & D)); } else { return (B ^ C ^ D); } } } }
jwinarske/winrt-onewire
OneWireAPI/com/dalsemi/onewire/utils/SHA.cs
C#
mpl-2.0
6,615
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Windows; namespace Wpfdraganddrop { /// <summary> /// App.xaml 的交互逻辑 /// </summary> public partial class App : Application { } }
liangsenzhi/WPF
1.19WPF拼图游戏/Wpfdraganddrop/App.xaml.cs
C#
mpl-2.0
256
/* @flow */ import {Writable as WritableStream} from 'stream'; import bunyan from 'bunyan'; import sinon from 'sinon'; import {it, describe} from 'mocha'; import {assert} from 'chai'; import {createLogger, ConsoleStream} from '../../../src/util/logger'; describe('logger', () => { describe('createLogger', () => { it('makes file names less redundant', () => { const createBunyanLog = sinon.spy(() => {}); createLogger('src/some-file.js', {createBunyanLog}); sinon.assert.calledWithMatch( createBunyanLog, {name: 'some-file.js'} ); }); }); describe('ConsoleStream', () => { function packet(overrides) { return { name: 'some name', msg: 'some messge', level: bunyan.INFO, ...overrides, }; } // NOTE: create a fake process that makes flow happy. function fakeProcess() { class FakeWritableStream extends WritableStream { write(): boolean { return true; } } const fakeWritableStream = new FakeWritableStream(); sinon.spy(fakeWritableStream, 'write'); return { stdout: fakeWritableStream, }; } it('lets you turn on verbose logging', () => { const log = new ConsoleStream({verbose: false}); log.makeVerbose(); assert.equal(log.verbose, true); }); it('logs names in verbose mode', () => { const log = new ConsoleStream({verbose: true}); assert.equal( log.format(packet({ name: 'foo', msg: 'some message', level: bunyan.DEBUG, })), '[foo][debug] some message\n'); }); it('does not log names in non-verbose mode', () => { const log = new ConsoleStream({verbose: false}); assert.equal( log.format(packet({name: 'foo', msg: 'some message'})), 'some message\n'); }); it('does not log debug packets unless verbose', () => { const log = new ConsoleStream({verbose: false}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.DEBUG}), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); }); it('does not log trace packets unless verbose', () => { const log = new ConsoleStream({verbose: false}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.TRACE}), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); }); it('logs debug packets when verbose', () => { const log = new ConsoleStream({verbose: true}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.DEBUG}), {localProcess}); sinon.assert.called(localProcess.stdout.write); }); it('logs trace packets when verbose', () => { const log = new ConsoleStream({verbose: true}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.TRACE}), {localProcess}); sinon.assert.called(localProcess.stdout.write); }); it('logs info packets when verbose or not', () => { const log = new ConsoleStream({verbose: false}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.INFO}), {localProcess}); log.makeVerbose(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.INFO}), {localProcess}); sinon.assert.callCount(localProcess.stdout.write, 2); }); it('lets you capture logging', () => { const log = new ConsoleStream(); const localProcess = fakeProcess(); log.startCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet({msg: 'message'}), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); sinon.assert.calledWith(localProcess.stdout.write, 'message\n'); }); it('only flushes captured messages once', () => { const log = new ConsoleStream(); let localProcess = fakeProcess(); log.startCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet(), {localProcess}); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); // Make sure there is nothing more to flush. localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); sinon.assert.notCalled(localProcess.stdout.write); }); it('lets you start and stop capturing', () => { const log = new ConsoleStream(); let localProcess = fakeProcess(); log.startCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet(), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); log.stopCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet(), {localProcess}); sinon.assert.callCount(localProcess.stdout.write, 1); // Make sure that when we start capturing again, // the queue gets reset. log.startCapturing(); log.write(packet()); localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); sinon.assert.callCount(localProcess.stdout.write, 1); }); }); });
rpl/web-ext
tests/unit/test-util/test.logger.js
JavaScript
mpl-2.0
5,702
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Search &#8212; aioorm documentation</title> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/javascript" src="_static/searchtools.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="#" /> <script type="text/javascript"> jQuery(function() { Search.loadIndex("searchindex.js"); }); </script> <script type="text/javascript" id="searchindexloader"></script> <link rel="stylesheet" href="_static/custom.css" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> </head> <body> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <h1 id="search-documentation">Search</h1> <div id="fallback" class="admonition warning"> <script type="text/javascript">$('#fallback').hide();</script> <p> Please activate JavaScript to enable the search functionality. </p> </div> <p> From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list. </p> <form action="" method="get"> <input type="text" name="q" value="" /> <input type="submit" value="search" /> <span id="search-progress" style="padding-left: 10px"></span> </form> <div id="search-results"> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"><div class="relations"> <h3>Related Topics</h3> <ul> <li><a href="index.html">Documentation overview</a><ul> </ul></li> </ul> </div> </div> </div> <div class="clearer"></div> </div> <div class="footer"> &copy;2017, hsz. | Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.5</a> &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a> </div> </body> </html>
Python-Tools/aioorm
docs/search.html
HTML
mpl-2.0
3,212
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `RUST_hb_blob_get_user_data` fn in crate `harfbuzz`."> <meta name="keywords" content="rust, rustlang, rust-lang, RUST_hb_blob_get_user_data"> <title>harfbuzz::RUST_hb_blob_get_user_data - Rust</title> <link rel="stylesheet" type="text/css" href="../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='index.html'>harfbuzz</a></p><script>window.sidebarCurrent = {name: 'RUST_hb_blob_get_user_data', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='index.html'>harfbuzz</a>::<wbr><a class='fn' href=''>RUST_hb_blob_get_user_data</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-976' class='srclink' href='../src/harfbuzz/lib.rs.html#379' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn RUST_hb_blob_get_user_data(blob: <a href='../std/primitive.pointer.html'>*mut <a class='type' href='../harfbuzz/type.hb_blob_t.html' title='harfbuzz::hb_blob_t'>hb_blob_t</a></a>, key: <a href='../std/primitive.pointer.html'>*mut <a class='type' href='../harfbuzz/type.hb_user_data_key_t.html' title='harfbuzz::hb_user_data_key_t'>hb_user_data_key_t</a></a>) -&gt; <a href='../std/primitive.pointer.html'>*mut <a class='enum' href='../libc/types/common/c95/enum.c_void.html' title='libc::types::common::c95::c_void'>c_void</a></a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../"; window.currentCrate = "harfbuzz"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script async src="../search-index.js"></script> </body> </html>
susaing/doc.servo.org
harfbuzz/fn.RUST_hb_blob_get_user_data.html
HTML
mpl-2.0
4,316
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Secure Storage Admin - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="19.11.5" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_API_Guides.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a href="concepts.html">Concepts</a><a class="link-selected" href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">Secure Storage Admin </h1> </div> </div><div class="contents"> <div class="textblock"><p><a class="el" href="secStoreAdmin__interface_8h.html">API Reference</a> <br/> <a class="el" href="c_secStore.html">Secure Storage</a> API</p> <hr/> <p>This API provides administrative control for secure storage. It gives the rights to read, write and delete files recorded in the SFS Legato tree. This API should be used with extreme caution.</p> <p>The full API should only be used by privileged users</p> <p>Secure storage allows privileged users (e.g: administrators) to provision secure storage data by storing sensitive info like passwords, keys, certificates, etc. All data in the secure storage is in an encrypted format. It also allows privileged users to debug stored data issues.</p> <dl class="section note"><dt>Note</dt><dd>This API is mostly disabled by default in Legato Framework for security concerns. Only few functions remains to get non sensitive information about secure storage. In order to enable the secure storage admin API, Legato must be compiled using the <code>SECSTOREADMIN</code> flag. <pre class="fragment">make distclean SECSTOREADMIN=1 make wp76xx </pre> Alternatively, you can enable the Secure Storage Admin API from within the kconfig menu system. <pre class="fragment">make menuconfig_wp76xx </pre> In the displayed configuration menu, enable SecStore Admin API flag by following the following menu path and enabling <code>Enable Secure Storage Administration API</code> Services &gt; Secure Storage &gt; Enable Secure Storage Administration API</dd></dl> <p>Even if the Secure Storage Admin API is disabled the following two functions are always available:</p><ul> <li><a class="el" href="secStoreAdmin__interface_8h.html#ac8eb38a1cdd75ff734a222bb129456f9">secStoreAdmin_GetTotalSpace()</a>: gets total space and available free space in secure storage.</li> <li><a class="el" href="secStoreAdmin__interface_8h.html#af3f66ecdc38046bd1adf824b4374d7e3">secStoreAdmin_GetSize()</a>: gets the size, in bytes, of all items under the specified path</li> </ul> <hr/> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
legatoproject/legato-docs
19_11_5/c_secStoreAdmin.html
HTML
mpl-2.0
5,587
package command import ( "bytes" "os" "testing" "github.com/hashicorp/consul/testutil" "github.com/mitchellh/cli" ) func TestPutCommand(t *testing.T) { srv := testutil.NewTestServer(t) defer srv.Stop() ui := new(cli.MockUi) c := &PutCommand{UI: ui} os.Setenv("CONSUL_HTTP_ADDR", srv.HTTPAddr) args := []string{"foo", "bar"} code := c.Run(args) if code != 0 { t.Fatalf("Unexpected code: %d err: %s", code, ui.ErrorWriter.String()) } val := srv.GetKV("foo") if string(val) != "bar" { t.Fatalf("Invalid value %s", val) } } func TestPutCommandStdin(t *testing.T) { srv := testutil.NewTestServer(t) defer srv.Stop() ui := new(cli.MockUi) input := bytes.NewBufferString("bar") c := &PutCommand{UI: ui, Input: input} os.Setenv("CONSUL_HTTP_ADDR", srv.HTTPAddr) args := []string{"foo"} code := c.Run(args) if code != 0 { t.Fatalf("Unexpected code: %d err: %s", code, ui.ErrorWriter.String()) } val := srv.GetKV("foo") if string(val) != "bar" { t.Fatalf("Invalid value %s", val) } }
spiritloose/consulkv
command/put_test.go
GO
mpl-2.0
1,020
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/SVGFEDistantLightElement.h" #include "mozilla/dom/SVGFEDistantLightElementBinding.h" #include "nsSVGFilterInstance.h" NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEDistantLight) using namespace mozilla::gfx; namespace mozilla { namespace dom { JSObject* SVGFEDistantLightElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return SVGFEDistantLightElementBinding::Wrap(aCx, this, aGivenProto); } nsSVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] = { { &nsGkAtoms::azimuth, 0, false }, { &nsGkAtoms::elevation, 0, false } }; //---------------------------------------------------------------------- //---------------------------------------------------------------------- // nsIDOMNode methods NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDistantLightElement) // nsFEUnstyledElement methods bool SVGFEDistantLightElement::AttributeAffectsRendering(int32_t aNameSpaceID, nsIAtom* aAttribute) const { return aNameSpaceID == kNameSpaceID_None && (aAttribute == nsGkAtoms::azimuth || aAttribute == nsGkAtoms::elevation); } AttributeMap SVGFEDistantLightElement::ComputeLightAttributes(nsSVGFilterInstance* aInstance) { float azimuth, elevation; GetAnimatedNumberValues(&azimuth, &elevation, nullptr); AttributeMap map; map.Set(eLightType, (uint32_t)eLightTypeDistant); map.Set(eDistantLightAzimuth, azimuth); map.Set(eDistantLightElevation, elevation); return map; } already_AddRefed<SVGAnimatedNumber> SVGFEDistantLightElement::Azimuth() { return mNumberAttributes[AZIMUTH].ToDOMAnimatedNumber(this); } already_AddRefed<SVGAnimatedNumber> SVGFEDistantLightElement::Elevation() { return mNumberAttributes[ELEVATION].ToDOMAnimatedNumber(this); } //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::NumberAttributesInfo SVGFEDistantLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } } // namespace dom } // namespace mozilla
Yukarumya/Yukarum-Redfoxes
dom/svg/SVGFEDistantLightElement.cpp
C++
mpl-2.0
2,462
// Code generated by go-swagger; DO NOT EDIT. package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // WebsiteGroup website group // // swagger:model WebsiteGroup type WebsiteGroup struct { // The description of the group // Example: Amazon web and ping checks Description string `json:"description,omitempty"` // true: alerting is disabled for the websites in the group // false: alerting is enabled for the websites in the group // If stopMonitoring=true, then alerting will also by default be disabled for the websites in the group // Example: false DisableAlerting bool `json:"disableAlerting,omitempty"` // The full path of the group // Read Only: true FullPath string `json:"fullPath,omitempty"` // has websites disabled // Read Only: true HasWebsitesDisabled *bool `json:"hasWebsitesDisabled,omitempty"` // The Id of the group // Read Only: true ID int32 `json:"id,omitempty"` // The name of the group // Example: Amazon Website Checks // Required: true Name *string `json:"name"` // The number of direct website groups in this group (exlcuding those in subgroups) // Read Only: true NumOfDirectSubGroups int32 `json:"numOfDirectSubGroups,omitempty"` // num of direct websites // Read Only: true NumOfDirectWebsites int32 `json:"numOfDirectWebsites,omitempty"` // num of websites // Read Only: true NumOfWebsites int32 `json:"numOfWebsites,omitempty"` // The Id of the parent group. If parentId=1 then the group exists under the root group // Example: 1 ParentID int32 `json:"parentId,omitempty"` // properties Properties []*NameAndValue `json:"properties,omitempty"` // true: monitoring is disabled for the websites in the group // false: monitoring is enabled for the websites in the group // If stopMonitoring=true, then alerting will also by default be disabled for the websites in the group StopMonitoring bool `json:"stopMonitoring,omitempty"` // test location TestLocation *WebsiteLocation `json:"testLocation,omitempty"` // The permission level of the user that made the API request. Acceptable values are: write, read, ack // Read Only: true UserPermission string `json:"userPermission,omitempty"` } // Validate validates this website group func (m *WebsiteGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { res = append(res, err) } if err := m.validateProperties(formats); err != nil { res = append(res, err) } if err := m.validateTestLocation(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *WebsiteGroup) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } return nil } func (m *WebsiteGroup) validateProperties(formats strfmt.Registry) error { if swag.IsZero(m.Properties) { // not required return nil } for i := 0; i < len(m.Properties); i++ { if swag.IsZero(m.Properties[i]) { // not required continue } if m.Properties[i] != nil { if err := m.Properties[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("properties" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *WebsiteGroup) validateTestLocation(formats strfmt.Registry) error { if swag.IsZero(m.TestLocation) { // not required return nil } if m.TestLocation != nil { if err := m.TestLocation.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("testLocation") } return err } } return nil } // ContextValidate validate this website group based on the context it is used func (m *WebsiteGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateFullPath(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateHasWebsitesDisabled(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateNumOfDirectSubGroups(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateNumOfDirectWebsites(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateNumOfWebsites(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateProperties(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateTestLocation(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateUserPermission(ctx, formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *WebsiteGroup) contextValidateFullPath(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "fullPath", "body", string(m.FullPath)); err != nil { return err } return nil } func (m *WebsiteGroup) contextValidateHasWebsitesDisabled(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "hasWebsitesDisabled", "body", m.HasWebsitesDisabled); err != nil { return err } return nil } func (m *WebsiteGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "id", "body", int32(m.ID)); err != nil { return err } return nil } func (m *WebsiteGroup) contextValidateNumOfDirectSubGroups(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "numOfDirectSubGroups", "body", int32(m.NumOfDirectSubGroups)); err != nil { return err } return nil } func (m *WebsiteGroup) contextValidateNumOfDirectWebsites(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "numOfDirectWebsites", "body", int32(m.NumOfDirectWebsites)); err != nil { return err } return nil } func (m *WebsiteGroup) contextValidateNumOfWebsites(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "numOfWebsites", "body", int32(m.NumOfWebsites)); err != nil { return err } return nil } func (m *WebsiteGroup) contextValidateProperties(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Properties); i++ { if m.Properties[i] != nil { if err := m.Properties[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("properties" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *WebsiteGroup) contextValidateTestLocation(ctx context.Context, formats strfmt.Registry) error { if m.TestLocation != nil { if err := m.TestLocation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("testLocation") } return err } } return nil } func (m *WebsiteGroup) contextValidateUserPermission(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "userPermission", "body", string(m.UserPermission)); err != nil { return err } return nil } // MarshalBinary interface implementation func (m *WebsiteGroup) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *WebsiteGroup) UnmarshalBinary(b []byte) error { var res WebsiteGroup if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }
logicmonitor/k8s-argus
vendor/github.com/logicmonitor/lm-sdk-go/models/website_group.go
GO
mpl-2.0
7,884
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>tty API - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="20.04.0" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_API_Guides.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a href="concepts.html">Concepts</a><a class="link-selected" href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">tty API </h1> </div> </div><div class="contents"> <div class="textblock"><p><a class="el" href="le__tty_8h.html">API Reference</a></p> <hr/> <p>This API provides routines to configure serial ports.</p> <h1><a class="anchor" id="c_tty_open_close"></a> Open/Close serial ports</h1> <ul> <li><code><a class="el" href="le__tty_8h.html#a93c3ad951903478014a91c721319951b">le_tty_Open()</a></code> opens a serial port device and locks it for exclusive use.</li> </ul> <pre class="fragment"><div class="line">fd = <a class="code" href="le__tty_8h.html#a93c3ad951903478014a91c721319951b">le_tty_Open</a>(<span class="stringliteral">"/dev/ttyS0"</span>, O_RDWR | O_NOCTTY | O_NDELAY);</div></pre><!-- fragment --><ul> <li><code><a class="el" href="le__tty_8h.html#a8e888c890956de70c594d26405133b98">le_tty_Close()</a></code> closes and unlocks a serial port file descriptor.</li> </ul> <h1><a class="anchor" id="c_tty_settings"></a> Settings serial ports</h1> <ul> <li>Setting baud rate is done with <code><a class="el" href="le__tty_8h.html#a5ade4aa1b77c8cd69016695adca64f3c">le_tty_SetBaudRate()</a></code>, value available are listed by #tty_Speed_t</li> <li>Getting baud rate is done with <code><a class="el" href="le__tty_8h.html#a786626ed11391263f89e120b1b4de18c">le_tty_GetBaudRate()</a></code>. when <a class="el" href="le__tty_8h.html#a5ade4aa1b77c8cd69016695adca64f3c">le_tty_SetBaudRate()</a> failed with LE_UNSUPPORTED, use <code><a class="el" href="le__tty_8h.html#a786626ed11391263f89e120b1b4de18c">le_tty_GetBaudRate()</a></code> to retrieve the real value sets by the driver.</li> <li>Setting framing on serial port is done with <code><a class="el" href="le__tty_8h.html#af33173f45f89a5a17b47add063a2ad46">le_tty_SetFraming()</a></code>. Parity value can be :<ul> <li>"N" for No parity</li> <li>"O" for Odd parity</li> <li>"E" for Even parity</li> </ul> </li> <li>Setting flow control on serial port is done with <code><a class="el" href="le__tty_8h.html#a331cdf5d19135a4c4fc1ba8b3c3acf2a">le_tty_SetFlowControl()</a></code>. Flow control options are:<ul> <li>LE_TTY_FLOW_CONTROL_NONE - flow control disabled</li> <li>LE_TTY_FLOW_CONTROL_XON_XOFF - software flow control (XON/XOFF)</li> <li>LE_TTY_FLOW_CONTROL_HARDWARE - hardware flow control (RTS/CTS)</li> </ul> </li> <li>Setting serial port into terminal mode is done with <code><a class="el" href="le__tty_8h.html#a78cfc2ae600bca28eb48e8b40ccee358">le_tty_SetCanonical()</a></code>. it converts EOL characters to unix format, enables local echo, line mode.</li> <li><p class="startli">Setting serial port into raw (non-canonical) mode is done with <code><a class="el" href="le__tty_8h.html#a7eae0319f1c4a064c8667f38610e059a">le_tty_SetRaw()</a></code>. it disables conversion of EOL characters, disables local echo, sets character mode, read timeouts.</p> <p class="startli">Different use cases for numChars and timeout parameters in <code><a class="el" href="le__tty_8h.html#a7eae0319f1c4a064c8667f38610e059a">le_tty_SetRaw(int fd,int numChars,int timeout)</a></code> </p><ul> <li>numChars = 0 and timeout = 0: Read will be completetly non-blocking.</li> <li>numChars = 0 and timeout &gt; 0: Read will be a pure timed read. If the timer expires without data, zero is returned.</li> <li>numChars &gt; 0 and timeout &gt; 0: Read will return when numChar have been transferred to the caller's buffer or when timeout expire between characters.</li> <li>numChars &gt; 0 and timeout = 0: Read will return only when exactly numChars have been transferred to the caller's buffer. This can wait and block indefinitely, when read(fd,buffer,nbytes) is performed and that nbytes is smaller than the numChars setted.</li> </ul> </li> </ul> <p>To switch between 'cannonical' and 'raw' mode, just call <code><a class="el" href="le__tty_8h.html#a78cfc2ae600bca28eb48e8b40ccee358">le_tty_SetCanonical()</a></code> and <code><a class="el" href="le__tty_8h.html#a7eae0319f1c4a064c8667f38610e059a">le_tty_SetRaw()</a></code> respectively</p> <hr/> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
legatoproject/legato-docs
20_04/c_tty.html
HTML
mpl-2.0
7,492
/* Copyright (c) 2013, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <string.h> #include <odp/api/schedule.h> #include <odp_schedule_internal.h> #include <odp/api/align.h> #include <odp/api/queue.h> #include <odp/api/shared_memory.h> #include <odp/api/buffer.h> #include <odp/api/pool.h> #include <odp_internal.h> #include <odp/api/config.h> #include <odp_debug_internal.h> #include <odp/api/thread.h> #include <odp/api/time.h> #include <odp/api/spinlock.h> #include <odp/api/hints.h> #include <odp/api/cpu.h> #include <odp_queue_internal.h> #include <odp_packet_io_internal.h> odp_thrmask_t sched_mask_all; /* Number of schedule commands. * One per scheduled queue and packet interface */ #define NUM_SCHED_CMD (ODP_CONFIG_QUEUES + ODP_CONFIG_PKTIO_ENTRIES) /* Priority queues per priority */ #define QUEUES_PER_PRIO 4 /* Packet input poll cmd queues */ #define POLL_CMD_QUEUES 4 /* Maximum number of dequeues */ #define MAX_DEQ 4 /* Maximum number of packet input queues per command */ #define MAX_PKTIN 8 /* Mask of queues per priority */ typedef uint8_t pri_mask_t; _ODP_STATIC_ASSERT((8*sizeof(pri_mask_t)) >= QUEUES_PER_PRIO, "pri_mask_t_is_too_small"); /* Internal: Start of named groups in group mask arrays */ #define _ODP_SCHED_GROUP_NAMED (ODP_SCHED_GROUP_CONTROL + 1) typedef struct { odp_queue_t pri_queue[ODP_CONFIG_SCHED_PRIOS][QUEUES_PER_PRIO]; pri_mask_t pri_mask[ODP_CONFIG_SCHED_PRIOS]; odp_spinlock_t mask_lock; odp_spinlock_t poll_cmd_lock; struct { odp_queue_t queue; uint16_t num; } poll_cmd[POLL_CMD_QUEUES]; odp_pool_t pool; odp_shm_t shm; uint32_t pri_count[ODP_CONFIG_SCHED_PRIOS][QUEUES_PER_PRIO]; odp_spinlock_t grp_lock; struct { char name[ODP_SCHED_GROUP_NAME_LEN]; odp_thrmask_t *mask; } sched_grp[ODP_CONFIG_SCHED_GRPS]; } sched_t; /* Schedule command */ typedef struct { int cmd; union { queue_entry_t *qe; struct { odp_pktio_t pktio; int num; int index[MAX_PKTIN]; pktio_entry_t *pe; }; }; } sched_cmd_t; #define SCHED_CMD_DEQUEUE 0 #define SCHED_CMD_POLL_PKTIN 1 typedef struct { int thr; int num; int index; int pause; uint32_t pktin_polls; odp_queue_t pri_queue; odp_event_t cmd_ev; queue_entry_t *qe; queue_entry_t *origin_qe; odp_buffer_hdr_t *buf_hdr[MAX_DEQ]; uint64_t order; uint64_t sync[ODP_CONFIG_MAX_ORDERED_LOCKS_PER_QUEUE]; odp_pool_t pool; int enq_called; int ignore_ordered_context; } sched_local_t; /* Global scheduler context */ static sched_t *sched; /* Thread local scheduler context */ static __thread sched_local_t sched_local; /* Internal routine to get scheduler thread mask addrs */ odp_thrmask_t *thread_sched_grp_mask(int index); static void sched_local_init(void) { memset(&sched_local, 0, sizeof(sched_local_t)); sched_local.thr = odp_thread_id(); sched_local.pri_queue = ODP_QUEUE_INVALID; sched_local.cmd_ev = ODP_EVENT_INVALID; } int odp_schedule_init_global(void) { odp_shm_t shm; odp_pool_t pool; int i, j; odp_pool_param_t params; ODP_DBG("Schedule init ... "); shm = odp_shm_reserve("odp_scheduler", sizeof(sched_t), ODP_CACHE_LINE_SIZE, 0); sched = odp_shm_addr(shm); if (sched == NULL) { ODP_ERR("Schedule init: Shm reserve failed.\n"); return -1; } memset(sched, 0, sizeof(sched_t)); odp_pool_param_init(&params); params.buf.size = sizeof(sched_cmd_t); params.buf.align = 0; params.buf.num = NUM_SCHED_CMD; params.type = ODP_POOL_BUFFER; pool = odp_pool_create("odp_sched_pool", &params); if (pool == ODP_POOL_INVALID) { ODP_ERR("Schedule init: Pool create failed.\n"); return -1; } sched->pool = pool; sched->shm = shm; odp_spinlock_init(&sched->mask_lock); for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { odp_queue_t queue; char name[] = "odp_priXX_YY"; name[7] = '0' + i / 10; name[8] = '0' + i - 10*(i / 10); for (j = 0; j < QUEUES_PER_PRIO; j++) { name[10] = '0' + j / 10; name[11] = '0' + j - 10*(j / 10); queue = odp_queue_create(name, NULL); if (queue == ODP_QUEUE_INVALID) { ODP_ERR("Sched init: Queue create failed.\n"); return -1; } sched->pri_queue[i][j] = queue; sched->pri_mask[i] = 0; } } odp_spinlock_init(&sched->poll_cmd_lock); for (i = 0; i < POLL_CMD_QUEUES; i++) { odp_queue_t queue; char name[] = "odp_poll_cmd_YY"; name[13] = '0' + i / 10; name[14] = '0' + i - 10 * (i / 10); queue = odp_queue_create(name, NULL); if (queue == ODP_QUEUE_INVALID) { ODP_ERR("Sched init: Queue create failed.\n"); return -1; } sched->poll_cmd[i].queue = queue; } odp_spinlock_init(&sched->grp_lock); for (i = 0; i < ODP_CONFIG_SCHED_GRPS; i++) { memset(sched->sched_grp[i].name, 0, ODP_SCHED_GROUP_NAME_LEN); sched->sched_grp[i].mask = thread_sched_grp_mask(i); } odp_thrmask_setall(&sched_mask_all); ODP_DBG("done\n"); return 0; } int odp_schedule_term_global(void) { int ret = 0; int rc = 0; int i, j; odp_event_t ev; for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { for (j = 0; j < QUEUES_PER_PRIO; j++) { odp_queue_t pri_q; pri_q = sched->pri_queue[i][j]; while ((ev = odp_queue_deq(pri_q)) != ODP_EVENT_INVALID) { odp_buffer_t buf; sched_cmd_t *sched_cmd; queue_entry_t *qe; odp_buffer_hdr_t *buf_hdr[1]; int num; buf = odp_buffer_from_event(ev); sched_cmd = odp_buffer_addr(buf); qe = sched_cmd->qe; num = queue_deq_multi(qe, buf_hdr, 1); if (num < 0) queue_destroy_finalize(qe); if (num > 0) ODP_ERR("Queue not empty\n"); } if (odp_queue_destroy(pri_q)) { ODP_ERR("Pri queue destroy fail.\n"); rc = -1; } } } for (i = 0; i < POLL_CMD_QUEUES; i++) { odp_queue_t queue = sched->poll_cmd[i].queue; while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) odp_event_free(ev); if (odp_queue_destroy(queue)) { ODP_ERR("Poll cmd queue destroy failed\n"); rc = -1; } } if (odp_pool_destroy(sched->pool) != 0) { ODP_ERR("Pool destroy fail.\n"); rc = -1; } ret = odp_shm_free(sched->shm); if (ret < 0) { ODP_ERR("Shm free failed for odp_scheduler"); rc = -1; } return rc; } int odp_schedule_init_local(void) { sched_local_init(); return 0; } int odp_schedule_term_local(void) { if (sched_local.num) { ODP_ERR("Locally pre-scheduled events exist.\n"); return -1; } odp_schedule_release_context(); sched_local_init(); return 0; } static int pri_id_queue(odp_queue_t queue) { return (QUEUES_PER_PRIO-1) & (queue_to_id(queue)); } static odp_queue_t pri_set(int id, int prio) { odp_spinlock_lock(&sched->mask_lock); sched->pri_mask[prio] |= 1 << id; sched->pri_count[prio][id]++; odp_spinlock_unlock(&sched->mask_lock); return sched->pri_queue[prio][id]; } static void pri_clr(int id, int prio) { odp_spinlock_lock(&sched->mask_lock); /* Clear mask bit when last queue is removed*/ sched->pri_count[prio][id]--; if (sched->pri_count[prio][id] == 0) sched->pri_mask[prio] &= (uint8_t)(~(1 << id)); odp_spinlock_unlock(&sched->mask_lock); } static odp_queue_t pri_set_queue(odp_queue_t queue, int prio) { int id = pri_id_queue(queue); return pri_set(id, prio); } static void pri_clr_queue(odp_queue_t queue, int prio) { int id = pri_id_queue(queue); pri_clr(id, prio); } int schedule_queue_init(queue_entry_t *qe) { odp_buffer_t buf; sched_cmd_t *sched_cmd; buf = odp_buffer_alloc(sched->pool); if (buf == ODP_BUFFER_INVALID) return -1; sched_cmd = odp_buffer_addr(buf); sched_cmd->cmd = SCHED_CMD_DEQUEUE; sched_cmd->qe = qe; qe->s.cmd_ev = odp_buffer_to_event(buf); qe->s.pri_queue = pri_set_queue(queue_handle(qe), queue_prio(qe)); return 0; } void schedule_queue_destroy(queue_entry_t *qe) { odp_event_free(qe->s.cmd_ev); pri_clr_queue(queue_handle(qe), queue_prio(qe)); qe->s.cmd_ev = ODP_EVENT_INVALID; qe->s.pri_queue = ODP_QUEUE_INVALID; } static int poll_cmd_queue_idx(odp_pktio_t pktio, int in_queue_idx) { return (POLL_CMD_QUEUES - 1) & (pktio_to_id(pktio) ^ in_queue_idx); } void schedule_pktio_start(odp_pktio_t pktio, int num_in_queue, int in_queue_idx[]) { odp_buffer_t buf; sched_cmd_t *sched_cmd; odp_queue_t queue; int i, idx; buf = odp_buffer_alloc(sched->pool); if (buf == ODP_BUFFER_INVALID) ODP_ABORT("Sched pool empty\n"); sched_cmd = odp_buffer_addr(buf); sched_cmd->cmd = SCHED_CMD_POLL_PKTIN; sched_cmd->pktio = pktio; sched_cmd->num = num_in_queue; sched_cmd->pe = get_pktio_entry(pktio); if (num_in_queue > MAX_PKTIN) ODP_ABORT("Too many input queues for scheduler\n"); for (i = 0; i < num_in_queue; i++) sched_cmd->index[i] = in_queue_idx[i]; idx = poll_cmd_queue_idx(pktio, in_queue_idx[0]); odp_spinlock_lock(&sched->poll_cmd_lock); sched->poll_cmd[idx].num++; odp_spinlock_unlock(&sched->poll_cmd_lock); queue = sched->poll_cmd[idx].queue; if (odp_queue_enq(queue, odp_buffer_to_event(buf))) ODP_ABORT("schedule_pktio_start failed\n"); } static void schedule_pktio_stop(sched_cmd_t *sched_cmd) { int idx = poll_cmd_queue_idx(sched_cmd->pktio, sched_cmd->index[0]); odp_spinlock_lock(&sched->poll_cmd_lock); sched->poll_cmd[idx].num--; odp_spinlock_unlock(&sched->poll_cmd_lock); } void odp_schedule_release_atomic(void) { if (sched_local.pri_queue != ODP_QUEUE_INVALID && sched_local.num == 0) { /* Release current atomic queue */ if (odp_queue_enq(sched_local.pri_queue, sched_local.cmd_ev)) ODP_ABORT("odp_schedule_release_atomic failed\n"); sched_local.pri_queue = ODP_QUEUE_INVALID; } } void odp_schedule_release_ordered(void) { if (sched_local.origin_qe) { int rc = release_order(sched_local.origin_qe, sched_local.order, sched_local.pool, sched_local.enq_called); if (rc == 0) sched_local.origin_qe = NULL; } } void odp_schedule_release_context(void) { if (sched_local.origin_qe) { release_order(sched_local.origin_qe, sched_local.order, sched_local.pool, sched_local.enq_called); sched_local.origin_qe = NULL; } else odp_schedule_release_atomic(); } static inline int copy_events(odp_event_t out_ev[], unsigned int max) { int i = 0; while (sched_local.num && max) { odp_buffer_hdr_t *hdr = sched_local.buf_hdr[sched_local.index]; out_ev[i] = odp_buffer_to_event(hdr->handle.handle); sched_local.index++; sched_local.num--; max--; i++; } return i; } /* * Schedule queues */ static int schedule(odp_queue_t *out_queue, odp_event_t out_ev[], unsigned int max_num, unsigned int max_deq) { int i, j; int ret; uint32_t k; int id; odp_event_t ev; odp_buffer_t buf; sched_cmd_t *sched_cmd; if (sched_local.num) { ret = copy_events(out_ev, max_num); if (out_queue) *out_queue = queue_handle(sched_local.qe); return ret; } odp_schedule_release_context(); if (odp_unlikely(sched_local.pause)) return 0; /* Schedule events */ for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { if (sched->pri_mask[i] == 0) continue; id = sched_local.thr & (QUEUES_PER_PRIO - 1); for (j = 0; j < QUEUES_PER_PRIO; j++, id++) { odp_queue_t pri_q; queue_entry_t *qe; int num; int qe_grp; if (id >= QUEUES_PER_PRIO) id = 0; if (odp_unlikely((sched->pri_mask[i] & (1 << id)) == 0)) continue; pri_q = sched->pri_queue[i][id]; ev = odp_queue_deq(pri_q); if (ev == ODP_EVENT_INVALID) continue; buf = odp_buffer_from_event(ev); sched_cmd = odp_buffer_addr(buf); qe = sched_cmd->qe; qe_grp = qe->s.param.sched.group; if (qe_grp > ODP_SCHED_GROUP_ALL && !odp_thrmask_isset(sched->sched_grp[qe_grp].mask, sched_local.thr)) { /* This thread is not eligible for work from * this queue, so continue scheduling it. */ if (odp_queue_enq(pri_q, ev)) ODP_ABORT("schedule failed\n"); continue; } /* For ordered queues we want consecutive events to * be dispatched to separate threads, so do not cache * them locally. */ if (queue_is_ordered(qe)) max_deq = 1; num = queue_deq_multi(qe, sched_local.buf_hdr, max_deq); if (num < 0) { /* Destroyed queue */ queue_destroy_finalize(qe); continue; } if (num == 0) { /* Remove empty queue from scheduling */ continue; } sched_local.num = num; sched_local.index = 0; sched_local.qe = qe; ret = copy_events(out_ev, max_num); if (queue_is_ordered(qe)) { /* Continue scheduling ordered queues */ if (odp_queue_enq(pri_q, ev)) ODP_ABORT("schedule failed\n"); /* Cache order info about this event */ sched_local.origin_qe = qe; sched_local.order = sched_local.buf_hdr[0]->order; sched_local.pool = sched_local.buf_hdr[0]->pool_hdl; for (k = 0; k < qe->s.param.sched.lock_count; k++) { sched_local.sync[k] = sched_local.buf_hdr[0]->sync[k]; } sched_local.enq_called = 0; } else if (queue_is_atomic(qe)) { /* Hold queue during atomic access */ sched_local.pri_queue = pri_q; sched_local.cmd_ev = ev; } else { /* Continue scheduling the queue */ if (odp_queue_enq(pri_q, ev)) ODP_ABORT("schedule failed\n"); } /* Output the source queue handle */ if (out_queue) *out_queue = queue_handle(qe); return ret; } } /* * Poll packet input when there are no events * * Each thread starts the search for a poll command from its * preferred command queue. If the queue is empty, it moves to other * queues. * * Most of the times, the search stops on the first command found to * optimize multi-threaded performance. A small portion of polls * have to do full iteration to avoid packet input starvation when * there are less threads than command queues. */ id = sched_local.thr & (POLL_CMD_QUEUES - 1); for (i = 0; i < POLL_CMD_QUEUES; i++, id++) { odp_queue_t cmd_queue; if (id == POLL_CMD_QUEUES) id = 0; if (sched->poll_cmd[id].num == 0) continue; cmd_queue = sched->poll_cmd[id].queue; ev = odp_queue_deq(cmd_queue); if (ev == ODP_EVENT_INVALID) continue; buf = odp_buffer_from_event(ev); sched_cmd = odp_buffer_addr(buf); if (sched_cmd->cmd != SCHED_CMD_POLL_PKTIN) ODP_ABORT("Bad poll command\n"); /* Poll packet input */ if (pktin_poll(sched_cmd->pe, sched_cmd->num, sched_cmd->index)) { /* Stop scheduling the pktio */ schedule_pktio_stop(sched_cmd); odp_buffer_free(buf); } else { /* Continue scheduling the pktio */ if (odp_queue_enq(cmd_queue, ev)) ODP_ABORT("Poll command enqueue failed\n"); /* Do not iterate through all pktin poll command queues * every time. */ if (odp_likely(sched_local.pktin_polls & 0xf)) break; } } sched_local.pktin_polls++; return 0; } static int schedule_loop(odp_queue_t *out_queue, uint64_t wait, odp_event_t out_ev[], unsigned int max_num, unsigned int max_deq) { odp_time_t next, wtime; int first = 1; int ret; while (1) { ret = schedule(out_queue, out_ev, max_num, max_deq); if (ret) break; if (wait == ODP_SCHED_WAIT) continue; if (wait == ODP_SCHED_NO_WAIT) break; if (first) { wtime = odp_time_local_from_ns(wait); next = odp_time_sum(odp_time_local(), wtime); first = 0; continue; } if (odp_time_cmp(next, odp_time_local()) < 0) break; } return ret; } odp_event_t odp_schedule(odp_queue_t *out_queue, uint64_t wait) { odp_event_t ev; ev = ODP_EVENT_INVALID; schedule_loop(out_queue, wait, &ev, 1, MAX_DEQ); return ev; } int odp_schedule_multi(odp_queue_t *out_queue, uint64_t wait, odp_event_t events[], int num) { return schedule_loop(out_queue, wait, events, num, MAX_DEQ); } void odp_schedule_pause(void) { sched_local.pause = 1; } void odp_schedule_resume(void) { sched_local.pause = 0; } uint64_t odp_schedule_wait_time(uint64_t ns) { return ns; } int odp_schedule_num_prio(void) { return ODP_CONFIG_SCHED_PRIOS; } odp_schedule_group_t odp_schedule_group_create(const char *name, const odp_thrmask_t *mask) { odp_schedule_group_t group = ODP_SCHED_GROUP_INVALID; int i; odp_spinlock_lock(&sched->grp_lock); for (i = _ODP_SCHED_GROUP_NAMED; i < ODP_CONFIG_SCHED_GRPS; i++) { if (sched->sched_grp[i].name[0] == 0) { strncpy(sched->sched_grp[i].name, name, ODP_SCHED_GROUP_NAME_LEN - 1); odp_thrmask_copy(sched->sched_grp[i].mask, mask); group = (odp_schedule_group_t)i; break; } } odp_spinlock_unlock(&sched->grp_lock); return group; } int odp_schedule_group_destroy(odp_schedule_group_t group) { int ret; odp_spinlock_lock(&sched->grp_lock); if (group < ODP_CONFIG_SCHED_GRPS && group >= _ODP_SCHED_GROUP_NAMED && sched->sched_grp[group].name[0] != 0) { odp_thrmask_zero(sched->sched_grp[group].mask); memset(sched->sched_grp[group].name, 0, ODP_SCHED_GROUP_NAME_LEN); ret = 0; } else { ret = -1; } odp_spinlock_unlock(&sched->grp_lock); return ret; } odp_schedule_group_t odp_schedule_group_lookup(const char *name) { odp_schedule_group_t group = ODP_SCHED_GROUP_INVALID; int i; odp_spinlock_lock(&sched->grp_lock); for (i = _ODP_SCHED_GROUP_NAMED; i < ODP_CONFIG_SCHED_GRPS; i++) { if (strcmp(name, sched->sched_grp[i].name) == 0) { group = (odp_schedule_group_t)i; break; } } odp_spinlock_unlock(&sched->grp_lock); return group; } int odp_schedule_group_join(odp_schedule_group_t group, const odp_thrmask_t *mask) { int ret; odp_spinlock_lock(&sched->grp_lock); if (group < ODP_CONFIG_SCHED_GRPS && group >= _ODP_SCHED_GROUP_NAMED && sched->sched_grp[group].name[0] != 0) { odp_thrmask_or(sched->sched_grp[group].mask, sched->sched_grp[group].mask, mask); ret = 0; } else { ret = -1; } odp_spinlock_unlock(&sched->grp_lock); return ret; } int odp_schedule_group_leave(odp_schedule_group_t group, const odp_thrmask_t *mask) { int ret; odp_spinlock_lock(&sched->grp_lock); if (group < ODP_CONFIG_SCHED_GRPS && group >= _ODP_SCHED_GROUP_NAMED && sched->sched_grp[group].name[0] != 0) { odp_thrmask_t leavemask; odp_thrmask_xor(&leavemask, mask, &sched_mask_all); odp_thrmask_and(sched->sched_grp[group].mask, sched->sched_grp[group].mask, &leavemask); ret = 0; } else { ret = -1; } odp_spinlock_unlock(&sched->grp_lock); return ret; } int odp_schedule_group_thrmask(odp_schedule_group_t group, odp_thrmask_t *thrmask) { int ret; odp_spinlock_lock(&sched->grp_lock); if (group < ODP_CONFIG_SCHED_GRPS && group >= _ODP_SCHED_GROUP_NAMED && sched->sched_grp[group].name[0] != 0) { *thrmask = *sched->sched_grp[group].mask; ret = 0; } else { ret = -1; } odp_spinlock_unlock(&sched->grp_lock); return ret; } /* This function is a no-op in linux-generic */ void odp_schedule_prefetch(int num ODP_UNUSED) { } void odp_schedule_order_lock(unsigned lock_index) { queue_entry_t *origin_qe; uint64_t sync, sync_out; origin_qe = sched_local.origin_qe; if (!origin_qe || lock_index >= origin_qe->s.param.sched.lock_count) return; sync = sched_local.sync[lock_index]; sync_out = odp_atomic_load_u64(&origin_qe->s.sync_out[lock_index]); ODP_ASSERT(sync >= sync_out); /* Wait until we are in order. Note that sync_out will be incremented * both by unlocks as well as order resolution, so we're OK if only * some events in the ordered flow need to lock. */ while (sync != sync_out) { odp_cpu_pause(); sync_out = odp_atomic_load_u64(&origin_qe->s.sync_out[lock_index]); } } void odp_schedule_order_unlock(unsigned lock_index) { queue_entry_t *origin_qe; origin_qe = sched_local.origin_qe; if (!origin_qe || lock_index >= origin_qe->s.param.sched.lock_count) return; ODP_ASSERT(sched_local.sync[lock_index] == odp_atomic_load_u64(&origin_qe->s.sync_out[lock_index])); /* Release the ordered lock */ odp_atomic_fetch_inc_u64(&origin_qe->s.sync_out[lock_index]); } void sched_enq_called(void) { sched_local.enq_called = 1; } void get_sched_order(queue_entry_t **origin_qe, uint64_t *order) { if (sched_local.ignore_ordered_context) { sched_local.ignore_ordered_context = 0; *origin_qe = NULL; } else { *origin_qe = sched_local.origin_qe; *order = sched_local.order; } } void sched_order_resolved(odp_buffer_hdr_t *buf_hdr) { if (buf_hdr) buf_hdr->origin_qe = NULL; sched_local.origin_qe = NULL; } int schedule_queue(const queue_entry_t *qe) { sched_local.ignore_ordered_context = 1; return odp_queue_enq(qe->s.pri_queue, qe->s.cmd_ev); }
Jet-Streaming/framework
deps/odp/platform/linux-generic/odp_schedule.c
C
mpl-2.0
20,781
# gogol-dns * [Version](#version) * [Description](#description) * [Contribute](#contribute) * [Licence](#licence) ## Version `0.5.0` ## Description A client library for the Google Cloud DNS. ## Contribute For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/gogol/issues). > _Note:_ this library is an auto-generated Haskell package. Please see `gogol-gen` for more information. ## Licence `gogol-dns` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
brendanhay/gogol
gogol-dns/README.md
Markdown
mpl-2.0
562
package opc import ( "bytes" "encoding/json" "fmt" "log" "strconv" "strings" "github.com/hashicorp/go-oracle-terraform/compute" "github.com/r3labs/terraform/helper/hashcode" "github.com/r3labs/terraform/helper/schema" "github.com/r3labs/terraform/helper/validation" ) func resourceInstance() *schema.Resource { return &schema.Resource{ Create: resourceInstanceCreate, Read: resourceInstanceRead, Delete: resourceInstanceDelete, Importer: &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { combined := strings.Split(d.Id(), "/") if len(combined) != 2 { return nil, fmt.Errorf("Invalid ID specified. Must be in the form of instance_name/instance_id. Got: %s", d.Id()) } d.Set("name", combined[0]) d.SetId(combined[1]) return []*schema.ResourceData{d}, nil }, }, Schema: map[string]*schema.Schema{ ///////////////////////// // Required Attributes // ///////////////////////// "name": { Type: schema.TypeString, Required: true, ForceNew: true, }, "shape": { Type: schema.TypeString, Required: true, ForceNew: true, }, ///////////////////////// // Optional Attributes // ///////////////////////// "instance_attributes": { Type: schema.TypeString, Optional: true, ForceNew: true, ValidateFunc: validation.ValidateJsonString, }, "boot_order": { Type: schema.TypeList, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeInt}, }, "hostname": { Type: schema.TypeString, Optional: true, Computed: true, ForceNew: true, }, "image_list": { Type: schema.TypeString, Optional: true, ForceNew: true, }, "label": { Type: schema.TypeString, Optional: true, Computed: true, ForceNew: true, }, "networking_info": { Type: schema.TypeSet, Optional: true, Computed: true, ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "dns": { // Required for Shared Network Interface, will default if unspecified, however // Optional for IP Network Interface Type: schema.TypeList, Optional: true, Computed: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "index": { Type: schema.TypeInt, ForceNew: true, Required: true, }, "ip_address": { // Optional, IP Network only Type: schema.TypeString, ForceNew: true, Optional: true, }, "ip_network": { // Required for an IP Network Interface Type: schema.TypeString, ForceNew: true, Optional: true, }, "mac_address": { // Optional, IP Network Only Type: schema.TypeString, ForceNew: true, Computed: true, Optional: true, }, "name_servers": { // Optional, IP Network + Shared Network Type: schema.TypeList, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "nat": { // Optional for IP Network // Required for Shared Network Type: schema.TypeList, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "search_domains": { // Optional, IP Network + Shared Network Type: schema.TypeList, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "sec_lists": { // Required, Shared Network only. Will default if unspecified however Type: schema.TypeList, Optional: true, Computed: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "shared_network": { Type: schema.TypeBool, Optional: true, ForceNew: true, Default: false, }, "vnic": { // Optional, IP Network only. Type: schema.TypeString, ForceNew: true, Optional: true, }, "vnic_sets": { // Optional, IP Network only. Type: schema.TypeList, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, }, }, Set: func(v interface{}) int { var buf bytes.Buffer m := v.(map[string]interface{}) buf.WriteString(fmt.Sprintf("%d-", m["index"].(int))) buf.WriteString(fmt.Sprintf("%s-", m["vnic"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["nat"])) return hashcode.String(buf.String()) }, }, "reverse_dns": { Type: schema.TypeBool, Optional: true, Default: true, ForceNew: true, }, "ssh_keys": { Type: schema.TypeList, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "storage": { Type: schema.TypeSet, Optional: true, ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "index": { Type: schema.TypeInt, Required: true, ForceNew: true, ValidateFunc: validation.IntBetween(1, 10), }, "volume": { Type: schema.TypeString, Required: true, ForceNew: true, }, "name": { Type: schema.TypeString, Computed: true, }, }, }, }, "tags": tagsForceNewSchema(), ///////////////////////// // Computed Attributes // ///////////////////////// "attributes": { Type: schema.TypeString, Computed: true, }, "availability_domain": { Type: schema.TypeString, Computed: true, }, "domain": { Type: schema.TypeString, Computed: true, }, "entry": { Type: schema.TypeInt, Computed: true, }, "fingerprint": { Type: schema.TypeString, Computed: true, }, "image_format": { Type: schema.TypeString, Computed: true, }, "ip_address": { Type: schema.TypeString, Computed: true, }, "placement_requirements": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "platform": { Type: schema.TypeString, Computed: true, }, "priority": { Type: schema.TypeString, Computed: true, }, "quota_reservation": { Type: schema.TypeString, Computed: true, }, "relationships": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "resolvers": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "site": { Type: schema.TypeString, Computed: true, }, "start_time": { Type: schema.TypeString, Computed: true, }, "state": { Type: schema.TypeString, Computed: true, }, "vcable": { Type: schema.TypeString, Computed: true, }, "virtio": { Type: schema.TypeBool, Computed: true, }, "vnc_address": { Type: schema.TypeString, Computed: true, }, }, } } func resourceInstanceCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*compute.Client).Instances() // Get Required Attributes input := &compute.CreateInstanceInput{ Name: d.Get("name").(string), Shape: d.Get("shape").(string), } // Get optional instance attributes attributes, attrErr := getInstanceAttributes(d) if attrErr != nil { return attrErr } if attributes != nil { input.Attributes = attributes } if bootOrder := getIntList(d, "boot_order"); len(bootOrder) > 0 { input.BootOrder = bootOrder } if v, ok := d.GetOk("hostname"); ok { input.Hostname = v.(string) } if v, ok := d.GetOk("image_list"); ok { input.ImageList = v.(string) } if v, ok := d.GetOk("label"); ok { input.Label = v.(string) } interfaces, err := readNetworkInterfacesFromConfig(d) if err != nil { return err } if interfaces != nil { input.Networking = interfaces } if v, ok := d.GetOk("reverse_dns"); ok { input.ReverseDNS = v.(bool) } if sshKeys := getStringList(d, "ssh_keys"); len(sshKeys) > 0 { input.SSHKeys = sshKeys } storage := getStorageAttachments(d) if len(storage) > 0 { input.Storage = storage } if tags := getStringList(d, "tags"); len(tags) > 0 { input.Tags = tags } result, err := client.CreateInstance(input) if err != nil { return fmt.Errorf("Error creating instance %s: %s", input.Name, err) } log.Printf("[DEBUG] Created instance %s: %#v", input.Name, result.ID) d.SetId(result.ID) return resourceInstanceRead(d, meta) } func resourceInstanceRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*compute.Client).Instances() name := d.Get("name").(string) input := &compute.GetInstanceInput{ ID: d.Id(), Name: name, } log.Printf("[DEBUG] Reading state of instance %s", name) result, err := client.GetInstance(input) if err != nil { // Instance doesn't exist if compute.WasNotFoundError(err) { log.Printf("[DEBUG] Instance %s not found", name) d.SetId("") return nil } return fmt.Errorf("Error reading instance %s: %s", name, err) } log.Printf("[DEBUG] Instance '%s' found", name) // Update attributes return updateInstanceAttributes(d, result) } func updateInstanceAttributes(d *schema.ResourceData, instance *compute.InstanceInfo) error { d.Set("name", instance.Name) d.Set("shape", instance.Shape) if err := setInstanceAttributes(d, instance.Attributes); err != nil { return err } if attrs, ok := d.GetOk("instance_attributes"); ok && attrs != nil { d.Set("instance_attributes", attrs.(string)) } if err := setIntList(d, "boot_order", instance.BootOrder); err != nil { return err } d.Set("hostname", instance.Hostname) d.Set("image_list", instance.ImageList) d.Set("label", instance.Label) if err := readNetworkInterfaces(d, instance.Networking); err != nil { return err } d.Set("reverse_dns", instance.ReverseDNS) if err := setStringList(d, "ssh_keys", instance.SSHKeys); err != nil { return err } if err := readStorageAttachments(d, instance.Storage); err != nil { return err } if err := setStringList(d, "tags", instance.Tags); err != nil { return err } d.Set("availability_domain", instance.AvailabilityDomain) d.Set("domain", instance.Domain) d.Set("entry", instance.Entry) d.Set("fingerprint", instance.Fingerprint) d.Set("image_format", instance.ImageFormat) d.Set("ip_address", instance.IPAddress) if err := setStringList(d, "placement_requirements", instance.PlacementRequirements); err != nil { return err } d.Set("platform", instance.Platform) d.Set("priority", instance.Priority) d.Set("quota_reservation", instance.QuotaReservation) if err := setStringList(d, "relationships", instance.Relationships); err != nil { return err } if err := setStringList(d, "resolvers", instance.Resolvers); err != nil { return err } d.Set("site", instance.Site) d.Set("start_time", instance.StartTime) d.Set("state", instance.State) if err := setStringList(d, "tags", instance.Tags); err != nil { return err } d.Set("vcable", instance.VCableID) d.Set("virtio", instance.Virtio) d.Set("vnc_address", instance.VNC) return nil } func resourceInstanceDelete(d *schema.ResourceData, meta interface{}) error { client := meta.(*compute.Client).Instances() name := d.Get("name").(string) input := &compute.DeleteInstanceInput{ ID: d.Id(), Name: name, } log.Printf("[DEBUG] Deleting instance %s", name) if err := client.DeleteInstance(input); err != nil { return fmt.Errorf("Error deleting instance %s: %s", name, err) } return nil } func getStorageAttachments(d *schema.ResourceData) []compute.StorageAttachmentInput { storageAttachments := []compute.StorageAttachmentInput{} storage := d.Get("storage").(*schema.Set) for _, i := range storage.List() { attrs := i.(map[string]interface{}) storageAttachments = append(storageAttachments, compute.StorageAttachmentInput{ Index: attrs["index"].(int), Volume: attrs["volume"].(string), }) } return storageAttachments } // Parses instance_attributes from a string to a map[string]interface and returns any errors. func getInstanceAttributes(d *schema.ResourceData) (map[string]interface{}, error) { var attrs map[string]interface{} // Empty instance attributes attributes, ok := d.GetOk("instance_attributes") if !ok { return attrs, nil } if err := json.Unmarshal([]byte(attributes.(string)), &attrs); err != nil { return attrs, fmt.Errorf("Cannot parse attributes as json: %s", err) } return attrs, nil } // Reads attributes from the returned instance object, and sets the computed attributes string // as JSON func setInstanceAttributes(d *schema.ResourceData, attributes map[string]interface{}) error { // Shouldn't ever get nil attributes on an instance, but protect against the case either way if attributes == nil { return nil } b, err := json.Marshal(attributes) if err != nil { return fmt.Errorf("Error marshalling returned attributes: %s", err) } return d.Set("attributes", string(b)) } // Populates and validates shared network and ip network interfaces to return the of map // objects needed to create/update an instance's networking_info func readNetworkInterfacesFromConfig(d *schema.ResourceData) (map[string]compute.NetworkingInfo, error) { interfaces := make(map[string]compute.NetworkingInfo) if v, ok := d.GetOk("networking_info"); ok { vL := v.(*schema.Set).List() for _, v := range vL { ni := v.(map[string]interface{}) index, ok := ni["index"].(int) if !ok { return nil, fmt.Errorf("Index not specified for network interface: %v", ni) } deviceIndex := fmt.Sprintf("eth%d", index) // Verify that the network interface doesn't already exist if _, ok := interfaces[deviceIndex]; ok { return nil, fmt.Errorf("Duplicate Network interface at eth%d already specified", index) } // Determine if we're creating a shared network interface or an IP Network interface info := compute.NetworkingInfo{} var err error if ni["shared_network"].(bool) { // Populate shared network parameters info, err = readSharedNetworkFromConfig(ni) // Set 'model' since we're configuring a shared network interface info.Model = compute.NICDefaultModel } else { // Populate IP Network Parameters info, err = readIPNetworkFromConfig(ni) } if err != nil { return nil, err } // And you may find yourself in a beautiful house, with a beautiful wife // And you may ask yourself, well, how did I get here? interfaces[deviceIndex] = info } } return interfaces, nil } // Reads a networking_info config block as a shared network interface func readSharedNetworkFromConfig(ni map[string]interface{}) (compute.NetworkingInfo, error) { info := compute.NetworkingInfo{} // Validate the shared network if err := validateSharedNetwork(ni); err != nil { return info, err } // Populate shared network fields; checking type casting dns := []string{} if v, ok := ni["dns"]; ok && v != nil { for _, d := range v.([]interface{}) { dns = append(dns, d.(string)) } if len(dns) > 0 { info.DNS = dns } } if v, ok := ni["model"].(string); ok && v != "" { info.Model = compute.NICModel(v) } nats := []string{} if v, ok := ni["nat"]; ok && v != nil { for _, nat := range v.([]interface{}) { nats = append(nats, nat.(string)) } if len(nats) > 0 { info.Nat = nats } } slists := []string{} if v, ok := ni["sec_lists"]; ok && v != nil { for _, slist := range v.([]interface{}) { slists = append(slists, slist.(string)) } if len(slists) > 0 { info.SecLists = slists } } nservers := []string{} if v, ok := ni["name_servers"]; ok && v != nil { for _, nserver := range v.([]interface{}) { nservers = append(nservers, nserver.(string)) } if len(nservers) > 0 { info.NameServers = nservers } } sdomains := []string{} if v, ok := ni["search_domains"]; ok && v != nil { for _, sdomain := range v.([]interface{}) { sdomains = append(sdomains, sdomain.(string)) } if len(sdomains) > 0 { info.SearchDomains = sdomains } } return info, nil } // Unfortunately this cannot take place during plan-phase, because we currently cannot have a validation // function based off of multiple fields in the supplied schema. func validateSharedNetwork(ni map[string]interface{}) error { // A Shared Networking Interface MUST have the following attributes set: // - "nat" // The following attributes _cannot_ be set for a shared network: // - "ip_address" // - "ip_network" // - "mac_address" // - "vnic" // - "vnic_sets" if _, ok := ni["nat"]; !ok { return fmt.Errorf("'nat' field needs to be set for a Shared Networking Interface") } // Strings only nilAttrs := []string{ "ip_address", "ip_network", "mac_address", "vnic", } for _, v := range nilAttrs { if d, ok := ni[v]; ok && d.(string) != "" { return fmt.Errorf("%q field cannot be set in a Shared Networking Interface", v) } } if _, ok := ni["vnic_sets"].([]string); ok { return fmt.Errorf("%q field cannot be set in a Shared Networking Interface", "vnic_sets") } return nil } // Populates fields for an IP Network func readIPNetworkFromConfig(ni map[string]interface{}) (compute.NetworkingInfo, error) { info := compute.NetworkingInfo{} // Validate the IP Network if err := validateIPNetwork(ni); err != nil { return info, err } // Populate fields if v, ok := ni["ip_network"].(string); ok && v != "" { info.IPNetwork = v } dns := []string{} if v, ok := ni["dns"]; ok && v != nil { for _, d := range v.([]interface{}) { dns = append(dns, d.(string)) } if len(dns) > 0 { info.DNS = dns } } if v, ok := ni["ip_address"].(string); ok && v != "" { info.IPAddress = v } if v, ok := ni["mac_address"].(string); ok && v != "" { info.MACAddress = v } nservers := []string{} if v, ok := ni["name_servers"]; ok && v != nil { for _, nserver := range v.([]interface{}) { nservers = append(nservers, nserver.(string)) } if len(nservers) > 0 { info.NameServers = nservers } } nats := []string{} if v, ok := ni["nat"]; ok && v != nil { for _, nat := range v.([]interface{}) { nats = append(nats, nat.(string)) } if len(nats) > 0 { info.Nat = nats } } sdomains := []string{} if v, ok := ni["search_domains"]; ok && v != nil { for _, sdomain := range v.([]interface{}) { sdomains = append(sdomains, sdomain.(string)) } if len(sdomains) > 0 { info.SearchDomains = sdomains } } if v, ok := ni["vnic"].(string); ok && v != "" { info.Vnic = v } vnicSets := []string{} if v, ok := ni["vnic_sets"]; ok && v != nil { for _, vnic := range v.([]interface{}) { vnicSets = append(vnicSets, vnic.(string)) } if len(vnicSets) > 0 { info.VnicSets = vnicSets } } return info, nil } // Validates an IP Network config block func validateIPNetwork(ni map[string]interface{}) error { // An IP Networking Interface MUST have the following attributes set: // - "ip_network" // Required to be set if d, ok := ni["ip_network"]; !ok || d.(string) == "" { return fmt.Errorf("'ip_network' field is required for an IP Network interface") } return nil } // Reads network interfaces from the config func readNetworkInterfaces(d *schema.ResourceData, ifaces map[string]compute.NetworkingInfo) error { result := make([]map[string]interface{}, 0) // Nil check for import case if ifaces == nil { return d.Set("networking_info", result) } for index, iface := range ifaces { res := make(map[string]interface{}) // The index returned from the SDK holds the full device_index from the instance. // For users convenience, we simply allow them to specify the integer equivalent of the device_index // so a user could implement several network interfaces via `count`. // Convert the full device_index `ethN` to `N` as an integer. index := strings.TrimPrefix(index, "eth") indexInt, err := strconv.Atoi(index) if err != nil { return err } res["index"] = indexInt // Set the proper attributes for this specific network interface if iface.DNS != nil { res["dns"] = iface.DNS } if iface.IPAddress != "" { res["ip_address"] = iface.IPAddress } if iface.IPNetwork != "" { res["ip_network"] = iface.IPNetwork } if iface.MACAddress != "" { res["mac_address"] = iface.MACAddress } if iface.Model != "" { // Model can only be set on Shared networks res["shared_network"] = true } if iface.NameServers != nil { res["name_servers"] = iface.NameServers } if iface.Nat != nil { res["nat"] = iface.Nat } if iface.SearchDomains != nil { res["search_domains"] = iface.SearchDomains } if iface.SecLists != nil { res["sec_lists"] = iface.SecLists } if iface.Vnic != "" { res["vnic"] = iface.Vnic // VNIC can only be set on an IP Network res["shared_network"] = false } if iface.VnicSets != nil { res["vnic_sets"] = iface.VnicSets } result = append(result, res) } return d.Set("networking_info", result) } // Flattens the returned slice of storage attachments to a map func readStorageAttachments(d *schema.ResourceData, attachments []compute.StorageAttachment) error { result := make([]map[string]interface{}, 0) if attachments == nil || len(attachments) == 0 { return d.Set("storage", nil) } for _, attachment := range attachments { res := make(map[string]interface{}) res["index"] = attachment.Index res["volume"] = attachment.StorageVolumeName res["name"] = attachment.Name result = append(result, res) } return d.Set("storage", result) }
r3labs/terraform
vendor/github.com/hashicorp/terraform-provider-opc/opc/resource_instance.go
GO
mpl-2.0
22,024
<!DOCTYPE html> <!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` --> <html> <head> <title>Referrer-Policy: Referrer Policy is set to 'strict-origin-when-cross-origin'</title> <meta charset='utf-8'> <meta name="description" content="Check that a priori insecure subresource gets no referrer information. Otherwise, cross-origin subresources get the origin portion of the referrer URL and same-origin get the stripped referrer URL."> <link rel="author" title="Kristijan Burnik" href="burnik@chromium.org"> <link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin-when-cross-origin"> <meta name="assert" content="Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/security-features/resources/common.sub.js"></script> <script src="../../../../generic/test-case.sub.js"></script> </head> <body> <script> TestCase( { "expectation": "origin", "origin": "same-https", "redirection": "swap-origin", "source_context_list": [ { "policyDeliveries": [], "sourceContextType": "srcdoc" } ], "source_scheme": "http", "subresource": "fetch", "subresource_policy_deliveries": [] }, document.querySelector("meta[name=assert]").content, new SanityChecker() ).start(); </script> <div id="log"></div> </body> </html>
UK992/servo
tests/wpt/web-platform-tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch/same-https.swap-origin.http.html
HTML
mpl-2.0
1,717
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace DeliveryApp.Models { using System; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Data.Objects; using System.Data.Objects.DataClasses; using System.Linq; public partial class AppDTEntities : DbContext { public AppDTEntities() : base("name=AppDTEntities") { } protected override void OnModelCreating(DbModelBuilder modelBuilder) { throw new UnintentionalCodeFirstException(); } public DbSet<CUSTOMER> CUSTOMER { get; set; } public DbSet<GETSURVEY> GETSURVEY { get; set; } public DbSet<INSTALLER> INSTALLER { get; set; } public DbSet<NOTVISIT> NOTVISIT { get; set; } public DbSet<PAQUETE> PAQUETE { get; set; } public DbSet<PAQUETE_DETALLE> PAQUETE_DETALLE { get; set; } public DbSet<PRODUCTO> PRODUCTO { get; set; } public DbSet<RETURN> RETURN { get; set; } public DbSet<SURVEY> SURVEY { get; set; } public DbSet<SURVEY_CUESTION> SURVEY_CUESTION { get; set; } public DbSet<SURVEY_CUESTION_ANSWARE> SURVEY_CUESTION_ANSWARE { get; set; } public DbSet<SURVEY_CUESTION_OP> SURVEY_CUESTION_OP { get; set; } public DbSet<USUARIO> USUARIO { get; set; } public DbSet<VISITA_ASSIGN> VISITA_ASSIGN { get; set; } public DbSet<VISITA_IMAGE_NEW> VISITA_IMAGE_NEW { get; set; } public DbSet<VISITA_REGISTRO> VISITA_REGISTRO { get; set; } public DbSet<vis_Assigned_Visit> vis_Assigned_Visit { get; set; } public DbSet<vis_survey> vis_survey { get; set; } public DbSet<vis_Survey_Data> vis_Survey_Data { get; set; } public DbSet<vis_VISITA_CUSTOMER> vis_VISITA_CUSTOMER { get; set; } public DbSet<vis_VISITA_NOTVISIT> vis_VISITA_NOTVISIT { get; set; } public DbSet<vis_VISITA_REGISTRO> vis_VISITA_REGISTRO { get; set; } public DbSet<vis_PAQUETE_DETALLE> vis_PAQUETE_DETALLE { get; set; } public virtual ObjectResult<sp_Busqueda_Visitas_Assign_Result> sp_Busqueda_Visitas_Assign(string dateIni, string dateEnd) { var dateIniParameter = dateIni != null ? new ObjectParameter("dateIni", dateIni) : new ObjectParameter("dateIni", typeof(string)); var dateEndParameter = dateEnd != null ? new ObjectParameter("dateEnd", dateEnd) : new ObjectParameter("dateEnd", typeof(string)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sp_Busqueda_Visitas_Assign_Result>("sp_Busqueda_Visitas_Assign", dateIniParameter, dateEndParameter); } public virtual ObjectResult<sp_Login_Device_Result> sp_Login_Device(string inst_name, string phone) { var inst_nameParameter = inst_name != null ? new ObjectParameter("inst_name", inst_name) : new ObjectParameter("inst_name", typeof(string)); var phoneParameter = phone != null ? new ObjectParameter("phone", phone) : new ObjectParameter("phone", typeof(string)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sp_Login_Device_Result>("sp_Login_Device", inst_nameParameter, phoneParameter); } public virtual ObjectResult<sp_Visitas_Assign_Result> sp_Visitas_Assign(Nullable<int> inst_id, string dateIni, string dateEnd) { var inst_idParameter = inst_id.HasValue ? new ObjectParameter("inst_id", inst_id) : new ObjectParameter("inst_id", typeof(int)); var dateIniParameter = dateIni != null ? new ObjectParameter("dateIni", dateIni) : new ObjectParameter("dateIni", typeof(string)); var dateEndParameter = dateEnd != null ? new ObjectParameter("dateEnd", dateEnd) : new ObjectParameter("dateEnd", typeof(string)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sp_Visitas_Assign_Result>("sp_Visitas_Assign", inst_idParameter, dateIniParameter, dateEndParameter); } public virtual ObjectResult<sp_Visitas_Assign_Grid_Result> sp_Visitas_Assign_Grid(string dateIni) { var dateIniParameter = dateIni != null ? new ObjectParameter("dateIni", dateIni) : new ObjectParameter("dateIni", typeof(string)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sp_Visitas_Assign_Grid_Result>("sp_Visitas_Assign_Grid", dateIniParameter); } } }
appdt28-6/deliveryApp
DeliveryApp/Models/AppDTModel.Context.cs
C#
mpl-2.0
5,249
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `uselocale` fn in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, uselocale"> <title>libc::unix::uselocale - Rust</title> <link rel="stylesheet" type="text/css" href="../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='../index.html'>libc</a>::<wbr><a href='index.html'>unix</a></p><script>window.sidebarCurrent = {name: 'uselocale', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>libc</a>::<wbr><a href='index.html'>unix</a>::<wbr><a class='fn' href=''>uselocale</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1857' class='srclink' href='../../src/libc/unix/notbsd/mod.rs.html#807' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn uselocale(loc: <a class='enum' href='../../libc/enum.locale_t.html' title='libc::locale_t'>locale_t</a>) -&gt; <a class='enum' href='../../libc/enum.locale_t.html' title='libc::locale_t'>locale_t</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>
servo/doc.servo.org
libc/unix/fn.uselocale.html
HTML
mpl-2.0
4,447
/* * Copyright (c) The Trustees of Indiana University, Moi University * and Vanderbilt University Medical Center. All Rights Reserved. * * This version of the code is licensed under the MPL 2.0 Open Source license * with additional health care disclaimer. * If the user is an entity intending to commercialize any application that uses * this code in a for-profit venture, please contact the copyright holder. */ package com.muzima.model; public class IncompleteForm extends FormWithData { }
sthaiya/muzima-android
app/src/main/java/com/muzima/model/IncompleteForm.java
Java
mpl-2.0
503
/*hdr ** ** Copyright Mox Products, Australia ** ** FILE NAME: FileConfigure.c ** ** AUTHOR: Jeff Wang ** ** DATE: 09 - May - 2009 ** ** FILE DESCRIPTION: ** ** ** FUNCTIONS: ** ** NOTES: ** */ #ifndef FILECONFIGURE_H #define FILECONFIGURE_H /************** SYSTEM INCLUDE FILES **************************************************************************/ /************** USER INCLUDE FILES ****************************************************************************/ #include "MXCommon.h" #include "MXTypes.h" #include "AccessCommon.h" /************** DEFINES ***************************************************************************************/ #define PKTFLAG_FIRST 1 #define PKTFLAG_MIDDLE 2 #define PKTFLAG_LAST 3 #define DWNLDFILE_PKTFLAG_OFFSET 0 #define DWNLDFILE_PKTFLAG_LEN 1 #define DWNLDFILE_PKTINDEX_OFFSET (DWNLDFILE_PKTFLAG_OFFSET + DWNLDFILE_PKTFLAG_LEN) #define DWNLDFILE_PKTINDEX_LEN 2 #define DWNLDFILE_FILELEN_OFFSET (DWNLDFILE_PKTINDEX_OFFSET + DWNLDFILE_PKTINDEX_LEN) #define DWNLDFILE_FILELEN_LEN 4 #define DWNLDFILE_FILEDATA_OFFSET (DWNLDFILE_FILELEN_OFFSET + DWNLDFILE_FILELEN_LEN) #define UPLDFILE_INDEX_OFFSET 0 #define UPLDFILE_INDEX_LEN 2 #define UPLDFILE_STAPOS_OFFSET (UPLDFILE_INDEX_OFFSET + UPLDFILE_INDEX_LEN) #define UPLDFILE_STAPOS_LEN 4 #define UPLDFILE_FILENAMELEN_OFFSET (UPLDFILE_STAPOS_OFFSET + UPLDFILE_STAPOS_LEN) #define UPLDFILE_FILENAMELEN_LEN 2 #define UPLDFILE_FILENAME_OFFSET (UPLDFILE_FILENAMELEN_OFFSET + UPLDFILE_FILENAMELEN_LEN) #define UPLDFILE_FILELEN_OFFSET (UPLDFILE_INDEX_OFFSET + UPLDFILE_INDEX_LEN) #define UPLDFILE_FILELEN_LEN 4 #define UPLDFILE_RESULT_OFFSET (UPLDFILE_FILELEN_OFFSET + UPLDFILE_FILELEN_LEN) #define UPLDFILE_RESULT_LEN 1 #define UPLDFILE_PKTLEN_OFFSET (UPLDFILE_RESULT_OFFSET + UPLDFILE_RESULT_LEN) #define UPLDFILE_PKTLEN_LEN 2 #define UPLDFILE_FILEDATA_OFFSET (UPLDFILE_PKTLEN_OFFSET + UPLDFILE_PKTLEN_LEN) #define PKT_PER_LEN 1024 /////////////////Add one Card Define/////// #define DWNLDOREDITONECARD_VERSION_OFFSET 0 #define DWNLDOREDITONECARD_VERSION_LEN 1 #define DWNLDOREDITONECARD_CSN_OFFSET (DWNLDOREDITONECARD_VERSION_OFFSET+DWNLDOREDITONECARD_VERSION_LEN) #define DWNLDOREDITONECARD_CSN_LEN 5 #define DWNLDOREDITONECARD_RESIDENTCODE_OFFSET (DWNLDOREDITONECARD_CSN_OFFSET+DWNLDOREDITONECARD_CSN_LEN) #define DWNLDOREDITONECARD_RESIDENTCODE_LEN 20 //#define DWNLDOREDITONECARD_CARDTYPE_OFFSET (DWNLDOREDITONECARD_RESIDENTCODE_OFFSET+DWNLDOREDITONECARD_RESIDENTCODE_LEN) #define DWNLDOREDITONECARD_CARDTYPE_LEN 1 #define DWNLDOREDITONECARD_CARDSTATUS_OFFSET (DWNLDOREDITONECARD_RESIDENTCODE_OFFSET+DWNLDOREDITONECARD_RESIDENTCODE_LEN) #define DWNLDOREDITONECARD_CARDSTATUS_LEN 1 #define DWNLDOREDITONECARD_CARDMODE_OFFSET (DWNLDOREDITONECARD_CARDSTATUS_OFFSET+DWNLDOREDITONECARD_CARDSTATUS_LEN) #define DWNLDOREDITONECARD_CARDMODE_LEN 1 #define DWNLDOREDITONECARD_GATENUMBER_OFFSET (DWNLDOREDITONECARD_CARDMODE_OFFSET+DWNLDOREDITONECARD_CARDMODE_LEN) #define DWNLDOREDITONECARD_GATENUMBER_LEN 2 #define DWNLDOREDITONECARD_UNLOCKTIMESLICEID_OFFSET (DWNLDOREDITONECARD_GATENUMBER_OFFSET+DWNLDOREDITONECARD_GATENUMBER_LEN) #define DWNLDOREDITONECARD_UNLOCKTIMESLICEID_LEN 1 #define DWNLDOREDITONECARD_VALIDSTARTTIME_OFFSET (DWNLDOREDITONECARD_UNLOCKTIMESLICEID_OFFSET+DWNLDOREDITONECARD_UNLOCKTIMESLICEID_LEN) #define DWNLDOREDITONECARD_VALIDSTARTTIME_LEN 8 #define DWNLDOREDITONECARD_VALIDENDTIME_OFFSET (DWNLDOREDITONECARD_VALIDSTARTTIME_OFFSET+DWNLDOREDITONECARD_VALIDSTARTTIME_LEN) #define DWNLDOREDITONECARD_VALIDENDTIME_LEN 8 #define DWNLDOREDITONECARD_ISADMIN_OFFSET (DWNLDOREDITONECARD_VALIDENDTIME_OFFSET+DWNLDOREDITONECARD_VALIDENDTIME_LEN) #define DWNLDOREDITONECARD_ISADMIN_LEN 1 ///////////////////////////////////////////////////////////// #define DELETEONECARD_VERSION_OFFSET 0 #define DELETEONECARD_VERSION_LEN 1 #define DELETEONECARD_CSN_OFFSET (DELETEONECARD_VERSION_OFFSET+DELETEONECARD_VERSION_LEN) #define DELETEONECARD_CSN_LEN 5 #define FILE_OK 0 #define FILE_NOT_EXIST 1 #define FILE_OPEN_ERROR 2 /************** TYPEDEFS *************************************************************/ /************** STRUCTURES ***********************************************************/ /************** EXTERNAL DECLARATIONS ************************************************/ extern BOOL DwnldFileProc(BYTE* pIn, UINT nInLen); extern UINT UpldFileProc(BYTE* pInOut); extern BOOL RemoveFileProc(BYTE* pIn); extern BOOL DwnldOneCardProc(BYTE* pIn, UINT nInLen ,unsigned short nFunCode); extern BOOL EditOneCardProc(BYTE* pIn, UINT nInLen,unsigned short nFunCode); extern UINT UpldOneCardProc(BYTE* pInOut,unsigned short nFunCode); extern BOOL DeleteOneCardProc(BYTE* pIn, UINT nInLen,unsigned short nFunCode); /*****************************************************************************/ #endif //FILECONFIGURE_H
SkyChen2012/GMApp
ParaSetting/FileConfigure.h
C
mpl-2.0
5,128
# Copyright (c) 2013-2016 Jeffrey Pfau # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from ._pylib import ffi, lib from . import tile from cached_property import cached_property def find(path): core = lib.mCoreFind(path.encode('UTF-8')) if core == ffi.NULL: return None return Core._init(core) def findVF(vf): core = lib.mCoreFindVF(vf.handle) if core == ffi.NULL: return None return Core._init(core) def loadPath(path): core = find(path) if not core or not core.loadFile(path): return None return core def loadVF(vf): core = findVF(vf) if not core or not core.loadROM(vf): return None return core def needsReset(f): def wrapper(self, *args, **kwargs): if not self._wasReset: raise RuntimeError("Core must be reset first") return f(self, *args, **kwargs) return wrapper class Core(object): if hasattr(lib, 'PLATFORM_GBA'): PLATFORM_GBA = lib.PLATFORM_GBA if hasattr(lib, 'PLATFORM_GB'): PLATFORM_GB = lib.PLATFORM_GB def __init__(self, native): self._core = native self._wasReset = False @cached_property def tiles(self): return tile.TileView(self) @classmethod def _init(cls, native): core = ffi.gc(native, native.deinit) success = bool(core.init(core)) if not success: raise RuntimeError("Failed to initialize core") if hasattr(cls, 'PLATFORM_GBA') and core.platform(core) == cls.PLATFORM_GBA: from .gba import GBA return GBA(core) if hasattr(cls, 'PLATFORM_GB') and core.platform(core) == cls.PLATFORM_GB: from .gb import GB return GB(core) return Core(core) def _deinit(self): self._core.deinit(self._core) def loadFile(self, path): return bool(lib.mCoreLoadFile(self._core, path.encode('UTF-8'))) def isROM(self, vf): return bool(self._core.isROM(vf.handle)) def loadROM(self, vf): return bool(self._core.loadROM(self._core, vf.handle)) def loadSave(self, vf): return bool(self._core.loadSave(self._core, vf.handle)) def loadTemporarySave(self, vf): return bool(self._core.loadTemporarySave(self._core, vf.handle)) def loadPatch(self, vf): return bool(self._core.loadPatch(self._core, vf.handle)) def autoloadSave(self): return bool(lib.mCoreAutoloadSave(self._core)) def autoloadPatch(self): return bool(lib.mCoreAutoloadPatch(self._core)) def platform(self): return self._core.platform(self._core) def desiredVideoDimensions(self): width = ffi.new("unsigned*") height = ffi.new("unsigned*") self._core.desiredVideoDimensions(self._core, width, height) return width[0], height[0] def setVideoBuffer(self, image): self._core.setVideoBuffer(self._core, image.buffer, image.stride) def reset(self): self._core.reset(self._core) self._wasReset = True @needsReset def runFrame(self): self._core.runFrame(self._core) @needsReset def runLoop(self): self._core.runLoop(self._core) @needsReset def step(self): self._core.step(self._core) @staticmethod def _keysToInt(*args, **kwargs): keys = 0 if 'raw' in kwargs: keys = kwargs['raw'] for key in args: keys |= 1 << key return keys def setKeys(self, *args, **kwargs): self._core.setKeys(self._core, self._keysToInt(*args, **kwargs)) def addKeys(self, *args, **kwargs): self._core.addKeys(self._core, self._keysToInt(*args, **kwargs)) def clearKeys(self, *args, **kwargs): self._core.clearKeys(self._core, self._keysToInt(*args, **kwargs)) @needsReset def frameCounter(self): return self._core.frameCounter(self._core) def frameCycles(self): return self._core.frameCycles(self._core) def frequency(self): return self._core.frequency(self._core) def getGameTitle(self): title = ffi.new("char[16]") self._core.getGameTitle(self._core, title) return ffi.string(title, 16).decode("ascii") def getGameCode(self): code = ffi.new("char[12]") self._core.getGameCode(self._core, code) return ffi.string(code, 12).decode("ascii")
fr500/mgba
src/platform/python/mgba/core.py
Python
mpl-2.0
4,578
# jsonproc [![Build Status](https://travis-ci.org/hfinucane/jsonproc.svg?branch=master)](https://travis-ci.org/hfinucane/jsonproc) A read-only `/proc` to json bridge. In general, the URL scheme looks like: / # Everything in /proc /loadavg # The contents of /proc/loadavg /proc/1 # All About Init When hitting a directory, you should expect a blob that looks like this: { "path": "/proc/sys/", "files": [], "dirs": ["abi", "debug", "dev", "fs", "kernel", "net", "vm"] } When hitting a file, you should expect a blob that looks like this: { "path": "/proc/loadavg", "contents": "0.09 0.12 0.17 1/613 4319\n" } Errors are signaled both by the appearance of the "err" field, and with a 500 code: $ curl -v localhost:9234/x; echo * Connected to localhost (127.0.0.1) port 9234 (#0) > GET /x HTTP/1.1 > Host: localhost:9234 > Accept: */* > < HTTP/1.1 500 Internal Server Error < Date: Sun, 05 Jul 2015 06:27:06 GMT < Content-Length: 66 < Content-Type: text/plain; charset=utf-8 {"path":"/proc/x","err":"stat /proc/x: no such file or directory"} The contents of "err" are not guaranteed to be stable. # Installing Checking out the source code and running 'go build' should be sufficient to get you a binary. There should also be a linux/amd64 binary courtesy of Travis CI attached to each [release on Github](https://github.com/hfinucane/jsonproc/releases). # Usage ./jsonproc -listen 10.9.8.7:9234 will get you a /proc-to-json gateway running on port 9234, listening on a local address. In general, you should prefer to explicitly bind `jsonproc` to a non-routable address- `/proc` leaks all sorts of information. # Notes around the design The goal is to quit writing one-off exfiltrations for things in `/proc`. So `jsonproc` needs to be lightweight, safe, and reasonably performant. By default, you can only read the first 4MB of files, and the first 1024 entries of a directory. These limitations are designed to make it more difficult to DOS yourself. `jsonproc` does nothing special around permissions. If you would like to read files that are `root`-readable only, running this as `root` should work. Because it's written in a memory-safe language, and never calls anything other that `stat`, `open`, `read`, and `readdir`, it's possible this isn't even that terrible an idea, but, uh, this should not be taken as an endorsement. Run it as an unprivileged user if possible. Relative paths- `../` & company- are unsupported. You should be limited to `/proc`.
hfinucane/jsonproc
README.md
Markdown
mpl-2.0
2,604
<!DOCTYPE HTML> <html> <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 --> <head> <title>Test for Bug 1276240</title> <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> </head> <body> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1276240">Mozilla Bug 1276240</a> <p id="display"></p> <div id="content" style="display: none"> </div> <pre id="test"> <script class="testbody" type="text/javascript"> /** Test for Bug 1276240 **/ // when passing null for the second argument, it would be ignored function test() { var e = document.createElement("p", null); is(e.getAttribute("is"), null); e = document.createElement("p", undefined); is(e.getAttribute("is"), null); e = document.createElementNS("http://www.w3.org/1999/xhtml", "p", null); is(e.getAttribute("is"), null); e = document.createElementNS("http://www.w3.org/1999/xhtml", "p", undefined); is(e.getAttribute("is"), null); } function runTest() { test(); SimpleTest.finish(); } // test with webcomponents enabled test(); // test with webcomponents disabled SimpleTest.waitForExplicitFinish(); SpecialPowers.pushPrefEnv( { 'set': [["dom.webcomponents.enabled", false]]}, runTest); </script> </pre> </body> </html>
Yukarumya/Yukarum-Redfoxes
dom/tests/mochitest/webcomponents/test_bug1276240.html
HTML
mpl-2.0
1,413
/* * !++ * QDS - Quick Data Signalling Library * !- * Copyright (C) 2002 - 2021 Devexperts LLC * !- * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at * http://mozilla.org/MPL/2.0/. * !__ */ package com.dxfeed.api.impl; import com.devexperts.qd.DataRecord; import com.devexperts.qd.QDContract; import com.devexperts.qd.SymbolCodec; import com.devexperts.qd.ng.RecordBuffer; import com.devexperts.qd.ng.RecordCursor; import com.devexperts.qd.ng.RecordMapping; import com.devexperts.qd.util.TimeSequenceUtil; import com.devexperts.util.Timing; import com.dxfeed.api.osub.TimeSeriesSubscriptionSymbol; import com.dxfeed.event.EventType; import com.dxfeed.event.LastingEvent; import com.dxfeed.event.TimeSeriesEvent; import java.util.EnumSet; public abstract class EventDelegate<T extends EventType<?>> { protected final DataRecord record; protected final QDContract contract; protected final boolean sub; protected final boolean pub; protected final boolean timeSeries; protected final boolean wildcard; protected final SymbolCodec codec; protected final Class<T> eventType; protected final boolean lastingEvent; @SuppressWarnings("unchecked") protected EventDelegate(DataRecord record, QDContract contract, EnumSet<EventDelegateFlags> flags) { this.record = record; this.contract = contract; this.sub = flags.contains(EventDelegateFlags.SUB); this.pub = flags.contains(EventDelegateFlags.PUB); this.timeSeries = flags.contains(EventDelegateFlags.TIME_SERIES); this.wildcard = flags.contains(EventDelegateFlags.WILDCARD); this.codec = record.getScheme().getCodec(); this.eventType = (Class<T>) createEvent().getClass(); boolean timeSeriesEvent = TimeSeriesEvent.class.isAssignableFrom(eventType); if (timeSeries && !timeSeriesEvent) throw new IllegalArgumentException("Cannot create time series delegate for non time series event " + eventType); this.lastingEvent = LastingEvent.class.isAssignableFrom(eventType); } public final Class<T> getEventType() { return eventType; } public final DataRecord getRecord() { return record; } public final QDContract getContract() { return contract; } public final boolean isSub() { return sub; } public boolean isPub() { return pub; } public final boolean isTimeSeries() { return timeSeries; } public boolean isWildcard() { return wildcard; } public final boolean isLastingEvent() { return lastingEvent; } public EventDelegateSet<T, ? extends EventDelegate<T>> createDelegateSet() { return new EventDelegateSet<>(eventType); } // Works on string symbols, too, so DelegateSet.convertSymbol call is optional public String getQDSymbolByEventSymbol(Object symbol) { return getMapping().getQDSymbolByEventSymbol(symbol); } public Object getEventSymbolByQDSymbol(String qdSymbol) { return getMapping().getEventSymbolByQDSymbol(qdSymbol); } public long getQDTimeByEventTime(long time) { return time == Long.MAX_VALUE ? Long.MAX_VALUE : TimeSequenceUtil.getTimeSequenceFromTimeMillis(time); } public long getEventTimeByQDTime(long time) { return time == Long.MAX_VALUE ? Long.MAX_VALUE : TimeSequenceUtil.getTimeMillisFromTimeSequence(time); } public long getFetchTimeHeuristicByEventSymbolAndFromTime(Object eventSymbol, long fromTime) { Timing.Day day = Timing.EST.getByTime(fromTime); do { day = Timing.EST.getById(day.day_id - 1); // prev day } while (!day.isTrading()); return day.day_start; // start of previous trading day } public String getQDSymbolByEvent(T event) { return getQDSymbolByEventSymbol(event.getEventSymbol()); } public Object getSubscriptionSymbolByQDSymbolAndTime(String qdSymbol, long time) { Object eventSymbol = getEventSymbolByQDSymbol(qdSymbol); return timeSeries ? new TimeSeriesSubscriptionSymbol<>( eventSymbol, getEventTimeByQDTime(time)) : eventSymbol; } @SuppressWarnings({"unchecked", "rawtypes"}) public T createEvent(Object symbol, RecordCursor cursor) { EventType event = createEvent(); event.setEventSymbol(symbol); return getEvent((T) event, cursor); } public T createEvent(RecordCursor cursor) { return createEvent(getEventSymbolByQDSymbol(codec.decode(cursor.getCipher(), cursor.getSymbol())), cursor); } //----------------------- must be implemented in subclasses ----------------------- public abstract RecordMapping getMapping(); public abstract T createEvent(); // subclasses override public T getEvent(T event, RecordCursor cursor) { event.setEventTime(TimeSequenceUtil.getTimeMillisFromTimeSequence(cursor.getEventTimeSequence())); return event; } //----------------------- must be overridden in publishable subclasses ----------------------- // subclasses override public RecordCursor putEvent(T event, RecordBuffer buf) { String symbol = getQDSymbolByEvent(event); RecordCursor cursor = buf.add(record, codec.encode(symbol), symbol); if (cursor.hasEventTimeSequence()) cursor.setEventTimeSequence(TimeSequenceUtil.getTimeSequenceFromTimeMillis(event.getEventTime())); return cursor; } @Override public String toString() { return "EventDelegate{" + "eventType=" + eventType.getName() + ", record=" + record + ", contract=" + contract + ", sub=" + sub + ", pub=" + pub + ", timeSeries=" + timeSeries + ", wildcard=" + wildcard + '}'; } }
Devexperts/QD
dxfeed-impl/src/main/java/com/dxfeed/api/impl/EventDelegate.java
Java
mpl-2.0
6,003
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `blksize_t` type in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, blksize_t"> <title>libc::b64::blksize_t - Rust</title> <link rel="stylesheet" type="text/css" href="../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='../index.html'>libc</a>::<wbr><a href='index.html'>b64</a></p><script>window.sidebarCurrent = {name: 'blksize_t', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content type"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>libc</a>::<wbr><a href='index.html'>b64</a>::<wbr><a class='type' href=''>blksize_t</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-3206' class='srclink' href='../../src/libc/unix/notbsd/linux/other/b64/x86_64.rs.html#6' title='goto source code'>[src]</a></span></h1> <pre class='rust typedef'>type blksize_t = <a class='primitive' href='../../std/primitive.i64.html'>i64</a>;</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>
servo/doc.servo.org
libc/b64/type.blksize_t.html
HTML
mpl-2.0
4,336
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `JS_NewSharedFloat32Array` fn in crate `js`."> <meta name="keywords" content="rust, rustlang, rust-lang, JS_NewSharedFloat32Array"> <title>js::jsapi::JS_NewSharedFloat32Array - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>js</a>::<wbr><a href='index.html'>jsapi</a></p><script>window.sidebarCurrent = {name: 'JS_NewSharedFloat32Array', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>js</a>::<wbr><a href='index.html'>jsapi</a>::<wbr><a class='fn' href=''>JS_NewSharedFloat32Array</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-36840' class='srclink' href='../../src/js/jsapi.rs.html#10746-10750' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn JS_NewSharedFloat32Array(cx: <a href='../../std/primitive.pointer.html'>*mut <a class='enum' href='../../js/jsapi/enum.JSContext.html' title='js::jsapi::JSContext'>JSContext</a></a>, nelements: <a href='../../std/primitive.u32.html'>u32</a>) -&gt; <a href='../../std/primitive.pointer.html'>*mut <a class='enum' href='../../js/jsapi/enum.JSObject.html' title='js::jsapi::JSObject'>JSObject</a></a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "js"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
js/jsapi/fn.JS_NewSharedFloat32Array.html
HTML
mpl-2.0
4,263
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `XtAppGetSelectionTimeout` fn in crate `x11`."> <meta name="keywords" content="rust, rustlang, rust-lang, XtAppGetSelectionTimeout"> <title>x11::xt::XtAppGetSelectionTimeout - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>xt</a></p><script>window.sidebarCurrent = {name: 'XtAppGetSelectionTimeout', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>xt</a>::<wbr><a class='fn' href=''>XtAppGetSelectionTimeout</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-57810' class='srclink' href='../../src/x11/link.rs.html#14' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn XtAppGetSelectionTimeout(_1: <a class='type' href='../../x11/xt/type.XtAppContext.html' title='x11::xt::XtAppContext'>XtAppContext</a>) -&gt; <a class='type' href='../../libc/types/os/arch/c95/type.c_ulong.html' title='libc::types::os::arch::c95::c_ulong'>c_ulong</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "x11"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
x11/xt/fn.XtAppGetSelectionTimeout.html
HTML
mpl-2.0
4,111
package autoconf import ( "context" "crypto/x509" "net" "sync" "testing" "github.com/stretchr/testify/mock" "github.com/hashicorp/consul/agent/cache" cachetype "github.com/hashicorp/consul/agent/cache-types" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/metadata" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/proto/pbautoconf" "github.com/hashicorp/consul/sdk/testutil" ) type mockDirectRPC struct { mock.Mock } func newMockDirectRPC(t *testing.T) *mockDirectRPC { m := mockDirectRPC{} m.Test(t) return &m } func (m *mockDirectRPC) RPC(dc string, node string, addr net.Addr, method string, args interface{}, reply interface{}) error { var retValues mock.Arguments if method == "AutoConfig.InitialConfiguration" { req := args.(*pbautoconf.AutoConfigRequest) csr := req.CSR req.CSR = "" retValues = m.Called(dc, node, addr, method, args, reply) req.CSR = csr } else if method == "AutoEncrypt.Sign" { req := args.(*structs.CASignRequest) csr := req.CSR req.CSR = "" retValues = m.Called(dc, node, addr, method, args, reply) req.CSR = csr } else { retValues = m.Called(dc, node, addr, method, args, reply) } return retValues.Error(0) } type mockTLSConfigurator struct { mock.Mock } func newMockTLSConfigurator(t *testing.T) *mockTLSConfigurator { m := mockTLSConfigurator{} m.Test(t) return &m } func (m *mockTLSConfigurator) UpdateAutoTLS(manualCAPEMs, connectCAPEMs []string, pub, priv string, verifyServerHostname bool) error { if priv != "" { priv = "redacted" } ret := m.Called(manualCAPEMs, connectCAPEMs, pub, priv, verifyServerHostname) return ret.Error(0) } func (m *mockTLSConfigurator) UpdateAutoTLSCA(pems []string) error { ret := m.Called(pems) return ret.Error(0) } func (m *mockTLSConfigurator) UpdateAutoTLSCert(pub, priv string) error { if priv != "" { priv = "redacted" } ret := m.Called(pub, priv) return ret.Error(0) } func (m *mockTLSConfigurator) AutoEncryptCert() *x509.Certificate { ret := m.Called() cert, _ := ret.Get(0).(*x509.Certificate) return cert } type mockServerProvider struct { mock.Mock } func newMockServerProvider(t *testing.T) *mockServerProvider { m := mockServerProvider{} m.Test(t) return &m } func (m *mockServerProvider) FindLANServer() *metadata.Server { ret := m.Called() srv, _ := ret.Get(0).(*metadata.Server) return srv } type mockWatcher struct { ch chan<- cache.UpdateEvent done <-chan struct{} } type mockCache struct { mock.Mock lock sync.Mutex watchers map[string][]mockWatcher } func newMockCache(t *testing.T) *mockCache { m := mockCache{ watchers: make(map[string][]mockWatcher), } m.Test(t) return &m } func (m *mockCache) Notify(ctx context.Context, t string, r cache.Request, correlationID string, ch chan<- cache.UpdateEvent) error { ret := m.Called(ctx, t, r, correlationID, ch) err := ret.Error(0) if err == nil { m.lock.Lock() key := r.CacheInfo().Key m.watchers[key] = append(m.watchers[key], mockWatcher{ch: ch, done: ctx.Done()}) m.lock.Unlock() } return err } func (m *mockCache) Prepopulate(t string, result cache.FetchResult, dc string, token string, key string) error { var restore string cert, ok := result.Value.(*structs.IssuedCert) if ok { // we cannot know what the private key is prior to it being injected into the cache. // therefore redact it here and all mock expectations should take that into account restore = cert.PrivateKeyPEM cert.PrivateKeyPEM = "redacted" } ret := m.Called(t, result, dc, token, key) if ok && restore != "" { cert.PrivateKeyPEM = restore } return ret.Error(0) } func (m *mockCache) sendNotification(ctx context.Context, key string, u cache.UpdateEvent) bool { m.lock.Lock() defer m.lock.Unlock() watchers, ok := m.watchers[key] if !ok || len(m.watchers) < 1 { return false } var newWatchers []mockWatcher for _, watcher := range watchers { select { case watcher.ch <- u: newWatchers = append(newWatchers, watcher) case <-watcher.done: // do nothing, this watcher will be removed from the list case <-ctx.Done(): // return doesn't matter here really, the test is being cancelled return true } } // this removes any already cancelled watches from being sent to m.watchers[key] = newWatchers return true } type mockTokenStore struct { mock.Mock } func newMockTokenStore(t *testing.T) *mockTokenStore { m := mockTokenStore{} m.Test(t) return &m } func (m *mockTokenStore) AgentToken() string { ret := m.Called() return ret.String(0) } func (m *mockTokenStore) UpdateAgentToken(secret string, source token.TokenSource) bool { return m.Called(secret, source).Bool(0) } func (m *mockTokenStore) Notify(kind token.TokenKind) token.Notifier { ret := m.Called(kind) n, _ := ret.Get(0).(token.Notifier) return n } func (m *mockTokenStore) StopNotify(notifier token.Notifier) { m.Called(notifier) } type mockedConfig struct { Config loader *configLoader directRPC *mockDirectRPC serverProvider *mockServerProvider cache *mockCache tokens *mockTokenStore tlsCfg *mockTLSConfigurator enterpriseConfig *mockedEnterpriseConfig } func newMockedConfig(t *testing.T) *mockedConfig { loader := setupRuntimeConfig(t) directRPC := newMockDirectRPC(t) serverProvider := newMockServerProvider(t) mcache := newMockCache(t) tokens := newMockTokenStore(t) tlsCfg := newMockTLSConfigurator(t) entConfig := newMockedEnterpriseConfig(t) // I am not sure it is well defined behavior but in testing it // out it does appear like Cleanup functions can fail tests // Adding in the mock expectations assertions here saves us // a bunch of code in the other test functions. t.Cleanup(func() { if !t.Failed() { directRPC.AssertExpectations(t) serverProvider.AssertExpectations(t) mcache.AssertExpectations(t) tokens.AssertExpectations(t) tlsCfg.AssertExpectations(t) } }) return &mockedConfig{ Config: Config{ Loader: loader.Load, DirectRPC: directRPC, ServerProvider: serverProvider, Cache: mcache, Tokens: tokens, TLSConfigurator: tlsCfg, Logger: testutil.Logger(t), EnterpriseConfig: entConfig.EnterpriseConfig, }, loader: loader, directRPC: directRPC, serverProvider: serverProvider, cache: mcache, tokens: tokens, tlsCfg: tlsCfg, enterpriseConfig: entConfig, } } func (m *mockedConfig) expectInitialTLS(t *testing.T, agentName, datacenter, token string, ca *structs.CARoot, indexedRoots *structs.IndexedCARoots, cert *structs.IssuedCert, extraCerts []string) { var pems []string for _, root := range indexedRoots.Roots { pems = append(pems, root.RootCert) } // we should update the TLS configurator with the proper certs m.tlsCfg.On("UpdateAutoTLS", extraCerts, pems, cert.CertPEM, // auto-config handles the CSR and Key so our tests don't have // a way to know that the key is correct or not. We do replace // a non empty PEM with "redacted" so we can ensure that some // certificate is being sent "redacted", true, ).Return(nil).Once() rootRes := cache.FetchResult{Value: indexedRoots, Index: indexedRoots.QueryMeta.Index} rootsReq := structs.DCSpecificRequest{Datacenter: datacenter} // we should prepopulate the cache with the CA roots m.cache.On("Prepopulate", cachetype.ConnectCARootName, rootRes, datacenter, "", rootsReq.CacheInfo().Key, ).Return(nil).Once() leafReq := cachetype.ConnectCALeafRequest{ Token: token, Agent: agentName, Datacenter: datacenter, } // copy the cert and redact the private key for the mock expectation // the actual private key will not correspond to the cert but thats // because AutoConfig is generated a key/csr internally and sending that // on up with the request. copy := *cert copy.PrivateKeyPEM = "redacted" leafRes := cache.FetchResult{ Value: &copy, Index: copy.RaftIndex.ModifyIndex, State: cachetype.ConnectCALeafSuccess(ca.SigningKeyID), } // we should prepopulate the cache with the agents cert m.cache.On("Prepopulate", cachetype.ConnectCALeafName, leafRes, datacenter, token, leafReq.Key(), ).Return(nil).Once() // when prepopulating the cert in the cache we grab the token so // we should expec that here m.tokens.On("AgentToken").Return(token).Once() } func (m *mockedConfig) setupInitialTLS(t *testing.T, agentName, datacenter, token string) (*structs.IndexedCARoots, *structs.IssuedCert, []string) { ca, indexedRoots, cert := testCerts(t, agentName, datacenter) ca2 := connect.TestCA(t, nil) extraCerts := []string{ca2.RootCert} m.expectInitialTLS(t, agentName, datacenter, token, ca, indexedRoots, cert, extraCerts) return indexedRoots, cert, extraCerts }
hashicorp/consul
agent/auto-config/mock_test.go
GO
mpl-2.0
8,927
// // ImageSlicing.h // ImageSlicing // // Created by Jeremy on 2016-02-13. // Copyright © 2016 Jeremy W. Sherman. Released with NO WARRANTY. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #import <Cocoa/Cocoa.h> //! Project version number for ImageSlicing. FOUNDATION_EXPORT double ImageSlicingVersionNumber; //! Project version string for ImageSlicing. FOUNDATION_EXPORT const unsigned char ImageSlicingVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <ImageSlicing/PublicHeader.h>
jeremy-w/ImageSlicer
ImageSlicing/ImageSlicing.h
C
mpl-2.0
729
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Internationalization - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="19.07.0" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_Concepts.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a class="link-selected" href="concepts.html">Concepts</a><a href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">Internationalization </h1> </div> </div><div class="contents"> <div class="textblock"><p>Legato provides string manipulation functions that support UTF-8 encoding.</p> <p>Other internationalization and localization features are left up to app developers.</p> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
legatoproject/legato-docs
19_07/conceptsInternationalization.html
HTML
mpl-2.0
3,772
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `XkbAllocGeomSections` fn in crate `x11`."> <meta name="keywords" content="rust, rustlang, rust-lang, XkbAllocGeomSections"> <title>x11::xlib::XkbAllocGeomSections - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>xlib</a></p><script>window.sidebarCurrent = {name: 'XkbAllocGeomSections', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>xlib</a>::<wbr><a class='fn' href=''>XkbAllocGeomSections</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-18019' class='srclink' href='../../src/x11/link.rs.html#14' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn XkbAllocGeomSections(_2: <a class='type' href='../../x11/xlib/type.XkbGeometryPtr.html' title='x11::xlib::XkbGeometryPtr'>XkbGeometryPtr</a>, _1: <a class='type' href='../../libc/types/os/arch/c95/type.c_int.html' title='libc::types::os::arch::c95::c_int'>c_int</a>) -&gt; <a class='type' href='../../libc/types/os/arch/c95/type.c_int.html' title='libc::types::os::arch::c95::c_int'>c_int</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "x11"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
x11/xlib/fn.XkbAllocGeomSections.html
HTML
mpl-2.0
4,222
/* Tables : table_name (always singular) Keys : column_name Foreign keys : table_name_column_ame */ CREATE TABLE `user` ( /* GENERAL INFO */ `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(64) NOT NULL, `password` VARCHAR(255) NOT NULL, `email` VARCHAR(64) NOT NULL, `xp` INT NOT NULL DEFAULT 0, `create_date` DATETIME NOT NULL DEFAULT NOW(), `api_token` VARCHAR(60), /* FIRST-ORDER INFO */ `fullname` VARCHAR(64), `gender` CHAR(1), /* SECOND-ORDER INFO */ `country` VARCHAR(64), `city` VARCHAR(64), /* THIRD-ORDER INFO */ `profession` VARCHAR(64), /* TODO: ADD ADDITIONAL INFO */ PRIMARY KEY (`id`), UNIQUE (`api_token`) ); CREATE TABLE `poll` ( `user_id` INT NOT NULL, `category_id` INT NOT NULL, `id` INT NOT NULL AUTO_INCREMENT, `question` VARCHAR(255) NOT NULL, `poll_type` VARCHAR(7) NOT NULL, # local or global `option_type` VARCHAR(7) NOT NULL, # multi-option or single-option `stat` VARCHAR(7) NOT NULL DEFAULT 'open', # open or closed `duration` INT NOT NULL DEFAULT 20, /* LOCATION */ `latitude` FLOAT(10,6) NOT NULL, `longitude` FLOAT(10,6) NOT NULL, `diameter` INT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`user_id`) REFERENCES `user`(id), FOREIGN KEY (`category_id`) REFERENCES `category`(id) ); CREATE TABLE `poll_option` ( `poll_id` INT NOT NULL, `id` INT NOT NULL AUTO_INCREMENT, `content` VARCHAR(255) NOT NULL, `vote` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), FOREIGN KEY (`poll_id`) REFERENCES `poll`(`id`) ON DELETE CASCADE ); CREATE TABLE `category` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `comment` ( `user_id` INT NOT NULL, `id` INT NOT NULL AUTO_INCREMENT, `create_date` DATETIME NOT NULL DEFAULT NOW(), `content` VARCHAR(255) NOT NULL, `up_vote` INT NOT NULL DEFAULT 0, `down_vote` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ); CREATE TABLE `poll_comment` ( `id` INT NOT NULL AUTO_INCREMENT, `comment_id` INT NOT NULL, `poll_id` INT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`comment_id`) REFERENCES `comment`(`id`), FOREIGN KEY (`poll_id`) REFERENCES `poll`(`id`) ON DELETE CASCADE ); CREATE TABLE `poll_option_comment` ( `id` INT NOT NULL AUTO_INCREMENT, `poll_option_id` INT NOT NULL, `comment_id` INT NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`poll_option_id`) REFERENCES `poll_option`(`id`) ON DELETE CASCADE, FOREIGN KEY (`comment_id`) REFERENCES `comment`(`id`) ON DELETE CASCADE ); CREATE TABLE `user_poll` ( `user_id` INT NOT NULL, `poll_id` INT NOT NULL, `id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE, FOREIGN KEY (`poll_id`) REFERENCES `poll`(`id`) ON DELETE CASCADE ); CREATE TABLE `user_poll_option` ( `user_poll_id` INT NOT NULL, `poll_option_id` INT NOT NULL, `id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), FOREIGN KEY (`user_poll_id`) REFERENCES `user_poll`(`id`) ON DELETE CASCADE, FOREIGN KEY (`poll_option_id`) REFERENCES `poll_option`(`id`) ON DELETE CASCADE ); /* TESTS */ /* users */ INSERT INTO `user` (`id`, `name`, `password`, `email`, `xp`, `create_date`, `fullname`, `gender`, `country`, `city`, `profession`) VALUES (NULL, 'user1', 'user1passwd', 'user1mail', '0', CURRENT_TIMESTAMP, 'user1fullname', 'e', 'user1country', 'user1city', 'user1profession'); INSERT INTO `user` (`id`, `name`, `password`, `email`, `xp`, `create_date`, `fullname`, `gender`, `country`, `city`, `profession`) VALUES (NULL, 'user2', 'user2passwd', 'user2mail', '0', CURRENT_TIMESTAMP, 'user2fullname', 'e', 'user2country', 'user2city', 'user2profession'); INSERT INTO `user` (`id`, `name`, `password`, `email`, `xp`, `create_date`, `fullname`, `gender`, `country`, `city`, `profession`) VALUES (NULL, 'user3', 'user3passwd', 'user3mail', '0', CURRENT_TIMESTAMP, 'user3fullname', 'e', 'user3country', 'user3city', 'user3profession'); INSERT INTO `user` (`id`, `name`, `password`, `email`, `xp`, `create_date`, `fullname`, `gender`, `country`, `city`, `profession`) VALUES (NULL, 'user4', 'user4passwd', 'user4mail', '0', CURRENT_TIMESTAMP, 'user4fullname', 'e', 'user4country', 'user4city', 'user4profession'); /* polls */ INSERT INTO `poll` (`user_id`, `id`, `question`, `poll_type`, `option_type`, `stat`, `duration`, `latitude`, `longitude`, `diameter`) VALUES ('1', 1, 'poll1question', 'local', 'single', 'open', '20', '53.293982', '-6.166417', '100'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('1', NULL, 'poll1option1', '15'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('1', NULL, 'poll1option2', '33'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('1', NULL, 'poll1option3', '323'); INSERT INTO `poll` (`user_id`, `id`, `question`, `poll_type`, `option_type`, `stat`, `duration`, `latitude`, `longitude`, `diameter`) VALUES ('2', 2, 'poll2question', 'local', 'single', 'open', '20', '14.293982', '-22.166417', '130'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('2', NULL, 'poll2option1', '15'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('2', NULL, 'poll2option2', '33'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('2', NULL, 'poll2option3', '323'); INSERT INTO `poll` (`user_id`, `id`, `question`, `poll_type`, `option_type`, `stat`, `duration`, `latitude`, `longitude`, `diameter`) VALUES ('2', 3, 'poll3question', 'local', 'single', 'open', '20', '23.293982', '-4.166417', '100'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('3', NULL, 'poll1option1', '15'); INSERT INTO `poll_option` (`poll_id`, `id`, `content`, `vote`) VALUES ('3', NULL, 'poll1option2', '33'); INSERT INTO `comment` (`user_id`, `id`, `create_date`, `content`, `up_vote`, `down_vote`) VALUES ('1', '1', CURRENT_TIMESTAMP, 'comment1', '22', '12'); INSERT INTO `comment` (`user_id`, `id`, `create_date`, `content`, `up_vote`, `down_vote`) VALUES ('1', '2', CURRENT_TIMESTAMP, 'comment2', '22', '12'); INSERT INTO `comment` (`user_id`, `id`, `create_date`, `content`, `up_vote`, `down_vote`) VALUES ('1', '3', CURRENT_TIMESTAMP, 'comment3', '22', '12'); INSERT INTO `comment` (`user_id`, `id`, `create_date`, `content`, `up_vote`, `down_vote`) VALUES ('2', '4', CURRENT_TIMESTAMP, 'comment4', '22', '12'); INSERT INTO `comment` (`user_id`, `id`, `create_date`, `content`, `up_vote`, `down_vote`) VALUES ('2', '5', CURRENT_TIMESTAMP, 'comment5', '22', '12'); INSERT INTO `poll_comment` (`id`, `comment_id`, `poll_id`) VALUES ('1', '1', '1'); INSERT INTO `poll_comment` (`id`, `comment_id`, `poll_id`) VALUES ('2', '2', '2'); INSERT INTO `poll_comment` (`id`, `comment_id`, `poll_id`) VALUES ('3', '3', '2'); INSERT INTO `poll_option_comment` (`id`, `poll_option_id`, `comment_id`) VALUES ('2', '1', '4'); INSERT INTO `poll_option_comment` (`id`, `poll_option_id`, `comment_id`) VALUES ('3', '1', '5'); /* Add default categories */ INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'General'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Animals'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Art'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Cars and motorcycles'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Celebrities'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Education'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Films'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Music'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Books'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Food and Drink'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Gardening'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Geek'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Beauty'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'History'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Holidays and Events'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Fashion'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Parenting'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Hobbies'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Science'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Nature'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Sports'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Technology'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Travel'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Relationship'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Literature'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'TV'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Economy'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Gaming'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Health'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Personal Care and Style'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Philosophy'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Religion'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Politics'); INSERT INTO `category` (`id`, `name`) VALUES (NULL, 'Harambe Software');
HarambeSoft/plus-one-server
build/CreateDB.sql
SQL
mpl-2.0
9,564
var searchData= [ ['initialise_2eh',['initialise.h',['../initialise_8h.html',1,'']]], ['items',['items',['../structsxbp__co__ord__array__t.html#a32095c91b499cfcbaacdb250f45862b1',1,'sxbp_co_ord_array_t']]] ];
saxbophone/libsxbp
docs/search/all_4.js
JavaScript
mpl-2.0
213
describe('aria.requiredOwned', function() { 'use strict'; afterEach(function() { axe.reset(); }); it('should returned the context property for the proper role', function() { axe.configure({ standards: { ariaRoles: { cats: { requiredOwned: ['yes'] } } } }); assert.deepEqual(axe.commons.aria.requiredOwned('cats'), ['yes']); }); it('should returned null if the required context is not an array', function() { axe.configure({ standards: { ariaRoles: { cats: { requiredOwned: 'yes' } } } }); assert.isNull(axe.commons.aria.requiredOwned('cats')); }); it('should return null if there are no required context nodes', function() { var result = axe.commons.aria.requiredOwned('cats'); assert.isNull(result); }); it('should return a unique copy of the context', function() { var context = ['yes', 'no']; axe.configure({ standards: { ariaRoles: { cats: { requiredOwned: context } } } }); var result = axe.commons.aria.requiredOwned('cats'); assert.notEqual(result, context); }); });
dequelabs/axe-core
test/commons/aria/required-owned.js
JavaScript
mpl-2.0
1,240
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Define the Expansion Valve component. """ from scr.logic.components.component import Component as Cmp from scr.logic.components.component import ComponentInfo as CmpInfo from scr.logic.components.component import component, fundamental_equation def update_saved_data_to_last_version(orig_data, orig_version): return orig_data @component('theoretical_expansion_valve', CmpInfo.EXPANSION_VALVE, 1, update_saved_data_to_last_version) class Theoretical(Cmp): def __init__(self, id_, inlet_nodes_id, outlet_nodes_id, component_data): super().__init__(id_, inlet_nodes_id, outlet_nodes_id, component_data) """ Fundamental properties equations """ @fundamental_equation() # function name can be arbitrary. Return a single vector with each side of the equation evaluated. def _eval_intrinsic_equations(self): id_inlet_node = self.get_id_inlet_nodes()[0] inlet_node = self.get_inlet_node(id_inlet_node) id_outlet_node = self.get_id_outlet_nodes()[0] outlet_node = self.get_outlet_node(id_outlet_node) h_in = inlet_node.enthalpy() h_out = outlet_node.enthalpy() return [h_in / 1000.0, h_out / 1000.0]
arkharin/OpenCool
scr/logic/components/expansion_valve/theoretical.py
Python
mpl-2.0
1,392
# Design Patterns [Design patterns](https://en.wikipedia.org/wiki/Software_design_pattern) are "general reusable solutions to a commonly occurring problem within a given context in software design". Design patterns are a great way to describe the culture of a programming language. Design patterns are very language-specific - what is a pattern in one language may be unnecessary in another due to a language feature, or impossible to express due to a missing feature. If overused, design patterns can add unnecessary complexity to programs. However, they are a great way to share intermediate and advanced level knowledge about a programming language. ## Design patterns in Rust Rust has many unique features. These features give us great benefit by removing whole classes of problems. Some of them are also patterns that are _unique_ to Rust. ## YAGNI If you're not familiar with it, YAGNI is an acronym that stands for `You Aren't Going to Need It`. It's an important software design principle to apply as you write code. > The best code I ever wrote was code I never wrote. If we apply YAGNI to design patterns, we see that the features of Rust allow us to throw out many patterns. For instance, there is no need for the [strategy pattern](https://en.wikipedia.org/wiki/Strategy_pattern) in Rust because we can just use [traits](https://doc.rust-lang.org/book/traits.html). TODO: Maybe include some code to illustrate the traits.
rust-unofficial/patterns
patterns/index.md
Markdown
mpl-2.0
1,443
#pragma once #include "iobuffer.h" // // ioÏÂËùÓжÔÏóµÄÄÚ´æ¹ÜÀí»úÖÆ ¶¼»á¼ÆÊý·½Ê½ // namespace xhnet { typedef std::function<void()> postio; // // run Ö»ÄÜÔÚÒ»¸öÏß³ÌÖÐÔËÐÐ one thread one run // class IIOServer : virtual public CPPRef { public: // ³õʼ»¯½øÐжþ¶Îʽ³õʼ»¯ static IIOServer* Create(void); static std::vector<std::string> Resolve_DNS(const std::string& hostname); public: virtual ~IIOServer(void) { } virtual bool Init(void) = 0; virtual void Fini(void) = 0; virtual void Run(void) = 0; virtual bool IsFinshed(void) = 0; virtual void Post(postio io) = 0; virtual unsigned int GetIOServerID(void) = 0; }; };
mybestcool/xhnet
include/net/ioserver.h
C
mpl-2.0
660
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // NetworkSecurityGroupVnic Information about a VNIC that belongs to a network security group. type NetworkSecurityGroupVnic struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC. VnicId *string `mandatory:"true" json:"vnicId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the parent resource that the VNIC // is attached to (for example, a Compute instance). ResourceId *string `mandatory:"false" json:"resourceId"` // The date and time the VNIC was added to the network security group, in the format // defined by RFC3339 (https://tools.ietf.org/html/rfc3339). // Example: `2016-08-25T21:10:29.600Z` TimeAssociated *common.SDKTime `mandatory:"false" json:"timeAssociated"` } func (m NetworkSecurityGroupVnic) String() string { return common.PointerString(m) }
ricardclau/packer
vendor/github.com/oracle/oci-go-sdk/core/network_security_group_vnic.go
GO
mpl-2.0
1,759
package org.ow2.choreos.ee.nodes; import org.ow2.choreos.ee.config.CloudConfiguration; import org.ow2.choreos.nodes.NodePoolManager; public class NPMFactory { public static NodePoolManager npmForTest; public static boolean testing = false; public static NodePoolManager getNewNPMInstance(String cloudAccount) { if (testing) { return npmForTest; } else { CloudConfiguration cloudConfiguration = getCloudConfiguration(cloudAccount); return new NPMImpl(cloudConfiguration); } } private static CloudConfiguration getCloudConfiguration(String cloudAccount) { CloudConfiguration cloudConfiguration = null; if (cloudAccount == null || cloudAccount.isEmpty()) { cloudConfiguration = CloudConfiguration.getCloudConfigurationInstance(); } else { cloudConfiguration = CloudConfiguration.getCloudConfigurationInstance(cloudAccount); } return cloudConfiguration; } public static NodePoolManager getNewNPMInstance(String cloudAccount, Reservoir idlePool) { if (testing) { return npmForTest; } else { CloudConfiguration cloudConfiguration = getCloudConfiguration(cloudAccount); return new NPMImpl(cloudConfiguration, idlePool); } } }
choreos/enactment_engine
EnactmentEngine/src/main/java/org/ow2/choreos/ee/nodes/NPMFactory.java
Java
mpl-2.0
1,208
sttrings ========
emmanuelbaiden/sttrings
README.md
Markdown
mpl-2.0
18
/* Copyright (C) 2011-2012 iPOV.net Author: Robert Sanders (robert.sanders@ipov.net) This program is free software; you can redistribute it and/or modify it under the terms of the Mozilla Public License v2 or higher. */ /* * This is the main site-wide menu, in this case a drop-down style, although for Siemens it does not automatically close, you have to click a small 'x' icon in the menu. * See also ../tmpl/site_menu.html. */ #site-menu { position: absolute; float: left; display: block; z-index: 1000; height: 19px; border-left: 0px solid transparent; border-right: 0px solid transparent; } #site-menu-title { padding: 3px 4px 0 2px; cursor: pointer; } .menu-closed #site-menu-title.hover { color: #333333; } #site-menu-container { position: absolute; visibility: hidden; width: 440px; /* Not super great, but if its not set it just collapses down. :( */ height: 0; overflow: hidden; top: 20px; left: 0px; z-index: -16; } #site-menu.menu-open #site-menu-container { position: absolute; z-index: 16000; visibility: visible; height: auto; display: block; overflow: visible; background-color: #252525; color: #ffffff; padding: 0 8px 4px 8px; border-bottom: 1px solid #FFFFFF; border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF; } #site-menu.menu-closed #site-menu-container { visibility: hidden; /* display: none; */ } .menu-close-bar { height: 26px; } .menu-close-bar .menu-close-button { position: absolute; right: -8px; /* the padding of the menu container element */ top: 0; z-index: 100; width: 20px; height: 20px; border-left: 2px solid #3E3E3E; border-bottom: 2px solid #3E3E3E; background: #252525 url("../imgs/close-x.gif") no-repeat 50% 50%; cursor: pointer; } /** This is typically an <li> element. */ #site-menu .menu-item { position: relative; width: 100%; display: block; font-size: 12px; white-space: nowrap; word-wrap: break-word; } /* This is the base level */ #site-menu ul.menu-items, #site-menu ul.menu-items li.menu-item { list-style: none; padding: 0; margin: 0; border: 0 none; } #site-menu ul.menu-items li.menu-item { border-top: 1px solid #889ea7; } #site-menu ul.menu-items li.menu-item:first-child { border-top: 0 none transparent; } #site-menu li.menu-item .menu-entry-container { line-height: 24px; cursor: pointer; display: block; position: relative; padding-right: 40px; vertical-align: middle; } #site-menu li.menu-item .menu-entry-wrapper { text-aligh: left; } #site-menu .menu-item > ul.menu-items { padding-left: 16px; display: none; /* Default to closed. */ } #site-menu .menu-item.menu-open > ul.menu-items { display: block; } /** These are the triangular style icons used indicate active menus or links. */ .menu-item-icon { display: inline-block; height: 9px; width: 9px; margin: 0 4px 0 0; border: 0 none; padding: 0; background-image: url("../imgs/menu_icons_sprite_01.gif"); /* top row is closed, bottom row is open */ background-repeat: 0; overflow: hidden; font-size: 2px; } /** gray menu item, This is the default position for the main menu. */ .menu-item-icon.mi-icon-root, #site-menu-title .menu-item-icon, .menu-closed #site-menu-title.hover .menu-item-icon { background-position: 0 0; } .menu-item-icon.mi-icon-root.icon-open, .menu-open #site-menu-title .menu-item-icon { background-position: 0 -9px; } /** A topic that has child items */ .menu-item-icon.mi-icon-branch { background-position: -9px 0; } .menu-item-icon.mi-icon-branch.icon-open { background-position: -9px -9px; } /** A topic that has no children */ .menu-item-icon.mi-icon-leaf { background-position: -36px 0; } /** Define the positioning within the main site menu */ .menu-item .menu-item-icon { margin: 7px 4px 0 0; float:left; } .menu-entry-title { white-space: normal; display: inline-block; }
rrsIPOV/ipov-wbt
src/scripts/themes/bbf/css/site-menu.css
CSS
mpl-2.0
4,102
--- layout: master include: person name: Kalle Happonen home: <a href="http://www.csc.fi">CSC</a> country: FI photo: assets/images/people/Kalle_Happonen.jpg email: kalle.happonen@csc.fi phone: on_contract: no has_been_on_contract: yes groups: glenna: puhuri-sg: nicest2-rg: ---
neicnordic/neic.no
_people/kalle-happonen.md
Markdown
mpl-2.0
284
var searchData= [ ['le_5farg_5fgetarg',['le_arg_GetArg',['../le__args_8h.html#a89b9e1ffd1401e17ceb818f3293db335',1,'le_args.h']]], ['le_5farg_5fgetprogramname',['le_arg_GetProgramName',['../le__args_8h.html#a17fbb5b46697adea82b4dd1e51d35ada',1,'le_args.h']]], ['le_5farg_5fnumargs',['le_arg_NumArgs',['../le__args_8h.html#a6fbbeb423104e6eb92fe47ef42b7310a',1,'le_args.h']]], ['le_5faudio_5fclose',['le_audio_Close',['../le__audio_8h.html#abafeb411da7b1a14b2d5777fc1d3e394',1,'le_audio_Close(le_audio_StreamRef_t streamRef):&#160;le_audio.h'],['../le__audio__interface_8h.html#abafeb411da7b1a14b2d5777fc1d3e394',1,'le_audio_Close(le_audio_StreamRef_t streamRef):&#160;le_audio_interface.h']]], ['le_5faudio_5fconnect',['le_audio_Connect',['../le__audio_8h.html#a338df65b2fb1ae0140d86880adbcf0de',1,'le_audio_Connect(le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef):&#160;le_audio.h'],['../le__audio__interface_8h.html#a338df65b2fb1ae0140d86880adbcf0de',1,'le_audio_Connect(le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef):&#160;le_audio_interface.h']]], ['le_5faudio_5fcreateconnector',['le_audio_CreateConnector',['../le__audio_8h.html#a570aaf85086f00aca592acfbaaa237be',1,'le_audio_CreateConnector(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#a570aaf85086f00aca592acfbaaa237be',1,'le_audio_CreateConnector(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fdeleteconnector',['le_audio_DeleteConnector',['../le__audio_8h.html#a3f40b13ff980040503927f59bb3e86a9',1,'le_audio_DeleteConnector(le_audio_ConnectorRef_t connectorRef):&#160;le_audio.h'],['../le__audio__interface_8h.html#a3f40b13ff980040503927f59bb3e86a9',1,'le_audio_DeleteConnector(le_audio_ConnectorRef_t connectorRef):&#160;le_audio_interface.h']]], ['le_5faudio_5fdisconnect',['le_audio_Disconnect',['../le__audio_8h.html#a6b88df9301038375701e4c15a4c8aaf0',1,'le_audio_Disconnect(le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef):&#160;le_audio.h'],['../le__audio__interface_8h.html#a6b88df9301038375701e4c15a4c8aaf0',1,'le_audio_Disconnect(le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef):&#160;le_audio_interface.h']]], ['le_5faudio_5fgetformat',['le_audio_GetFormat',['../le__audio_8h.html#adcb75fe810f57c09c3c77d97949cc6d5',1,'le_audio_GetFormat(le_audio_StreamRef_t streamRef, char *formatPtr, size_t len):&#160;le_audio.h'],['../le__audio__interface_8h.html#a7e50add53e328c1dc6b680188990ebbb',1,'le_audio_GetFormat(le_audio_StreamRef_t streamRef, char *formatPtr, size_t formatPtrNumElements):&#160;le_audio_interface.h']]], ['le_5faudio_5fgetgain',['le_audio_GetGain',['../le__audio_8h.html#a51a86829cdd6f27234f482e5dbb6c933',1,'le_audio_GetGain(le_audio_StreamRef_t streamRef, uint32_t *gainPtr):&#160;le_audio.h'],['../le__audio__interface_8h.html#a51a86829cdd6f27234f482e5dbb6c933',1,'le_audio_GetGain(le_audio_StreamRef_t streamRef, uint32_t *gainPtr):&#160;le_audio_interface.h']]], ['le_5faudio_5fmute',['le_audio_Mute',['../le__audio_8h.html#a147e97c49dbc003f63df78f97d5fca32',1,'le_audio_Mute(le_audio_StreamRef_t streamRef):&#160;le_audio.h'],['../le__audio__interface_8h.html#a147e97c49dbc003f63df78f97d5fca32',1,'le_audio_Mute(le_audio_StreamRef_t streamRef):&#160;le_audio_interface.h']]], ['le_5faudio_5fopeni2srx',['le_audio_OpenI2sRx',['../le__audio_8h.html#a9e7d0042c4f422554eb10d64535608e5',1,'le_audio_OpenI2sRx(le_audio_I2SChannel_t mode):&#160;le_audio.h'],['../le__audio__interface_8h.html#a9e7d0042c4f422554eb10d64535608e5',1,'le_audio_OpenI2sRx(le_audio_I2SChannel_t mode):&#160;le_audio_interface.h']]], ['le_5faudio_5fopeni2stx',['le_audio_OpenI2sTx',['../le__audio_8h.html#a2633c1368adf60e342d7cadbbfa6278b',1,'le_audio_OpenI2sTx(le_audio_I2SChannel_t mode):&#160;le_audio.h'],['../le__audio__interface_8h.html#a2633c1368adf60e342d7cadbbfa6278b',1,'le_audio_OpenI2sTx(le_audio_I2SChannel_t mode):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenmic',['le_audio_OpenMic',['../le__audio_8h.html#a74f1ef979329f6c2bd56ea622f4d05b2',1,'le_audio_OpenMic(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#a74f1ef979329f6c2bd56ea622f4d05b2',1,'le_audio_OpenMic(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenmodemvoicerx',['le_audio_OpenModemVoiceRx',['../le__audio_8h.html#ae3ed568ba4d2763ea77e17e77b20ff02',1,'le_audio_OpenModemVoiceRx(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#ae3ed568ba4d2763ea77e17e77b20ff02',1,'le_audio_OpenModemVoiceRx(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenmodemvoicetx',['le_audio_OpenModemVoiceTx',['../le__audio_8h.html#ad745f008bb04873c817da7af3daf783d',1,'le_audio_OpenModemVoiceTx(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#ad745f008bb04873c817da7af3daf783d',1,'le_audio_OpenModemVoiceTx(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenpcmrx',['le_audio_OpenPcmRx',['../le__audio_8h.html#aa0f0b5fcab8844c67a936d88fa050cf5',1,'le_audio_OpenPcmRx(uint32_t timeslot):&#160;le_audio.h'],['../le__audio__interface_8h.html#aa0f0b5fcab8844c67a936d88fa050cf5',1,'le_audio_OpenPcmRx(uint32_t timeslot):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenpcmtx',['le_audio_OpenPcmTx',['../le__audio_8h.html#a5e112543e8525775aa670dc71b320766',1,'le_audio_OpenPcmTx(uint32_t timeslot):&#160;le_audio.h'],['../le__audio__interface_8h.html#a5e112543e8525775aa670dc71b320766',1,'le_audio_OpenPcmTx(uint32_t timeslot):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenspeaker',['le_audio_OpenSpeaker',['../le__audio_8h.html#a5c19afce44021c4abf6193707317f8de',1,'le_audio_OpenSpeaker(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#a5c19afce44021c4abf6193707317f8de',1,'le_audio_OpenSpeaker(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenusbrx',['le_audio_OpenUsbRx',['../le__audio_8h.html#acd8be89289067cef9441a8ed1d891146',1,'le_audio_OpenUsbRx(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#acd8be89289067cef9441a8ed1d891146',1,'le_audio_OpenUsbRx(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fopenusbtx',['le_audio_OpenUsbTx',['../le__audio_8h.html#adb38f11ac78cf99160c19f69b4db0eb8',1,'le_audio_OpenUsbTx(void):&#160;le_audio.h'],['../le__audio__interface_8h.html#adb38f11ac78cf99160c19f69b4db0eb8',1,'le_audio_OpenUsbTx(void):&#160;le_audio_interface.h']]], ['le_5faudio_5fsetgain',['le_audio_SetGain',['../le__audio_8h.html#ad62587dacf0cb087697a62fb9f41d938',1,'le_audio_SetGain(le_audio_StreamRef_t streamRef, uint32_t gain):&#160;le_audio.h'],['../le__audio__interface_8h.html#ad62587dacf0cb087697a62fb9f41d938',1,'le_audio_SetGain(le_audio_StreamRef_t streamRef, uint32_t gain):&#160;le_audio_interface.h']]], ['le_5faudio_5fstartclient',['le_audio_StartClient',['../le__audio__interface_8h.html#a9c67aa66fb3efe2461ab663ab23c76e1',1,'le_audio_interface.h']]], ['le_5faudio_5fstopclient',['le_audio_StopClient',['../le__audio__interface_8h.html#a951eb21fa0a03cd33ba10b92e50b6964',1,'le_audio_interface.h']]], ['le_5faudio_5funmute',['le_audio_Unmute',['../le__audio_8h.html#adad24547293481964039efe56bc14e2b',1,'le_audio_Unmute(le_audio_StreamRef_t streamRef):&#160;le_audio.h'],['../le__audio__interface_8h.html#adad24547293481964039efe56bc14e2b',1,'le_audio_Unmute(le_audio_StreamRef_t streamRef):&#160;le_audio_interface.h']]], ['le_5fcfg_5faddchangehandler',['le_cfg_AddChangeHandler',['../le__cfg__interface_8h.html#aa9a19e022625fc2c4a2a39e95ac60936',1,'le_cfg_interface.h']]], ['le_5fcfg_5fcanceltxn',['le_cfg_CancelTxn',['../le__cfg__interface_8h.html#af5f10497ed85d2e647b41ca460228483',1,'le_cfg_interface.h']]], ['le_5fcfg_5fcommittxn',['le_cfg_CommitTxn',['../le__cfg__interface_8h.html#a9825af4d2e007d82f4385ee444a348ef',1,'le_cfg_interface.h']]], ['le_5fcfg_5fcreatereadtxn',['le_cfg_CreateReadTxn',['../le__cfg__interface_8h.html#aa766bff3a3ddbd2769b903fc56f6d9d2',1,'le_cfg_interface.h']]], ['le_5fcfg_5fcreatewritetxn',['le_cfg_CreateWriteTxn',['../le__cfg__interface_8h.html#a9c817e5edf0df97034fdc432ce8d0f18',1,'le_cfg_interface.h']]], ['le_5fcfg_5fdeletenode',['le_cfg_DeleteNode',['../le__cfg__interface_8h.html#a30e8684f89c8e05ca489bc897ab378b9',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetbool',['le_cfg_GetBool',['../le__cfg__interface_8h.html#aa3898fcb0d62b03c9a238d36b42d7a63',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetfloat',['le_cfg_GetFloat',['../le__cfg__interface_8h.html#aeb213c2fbf840931ec8c1427ef6b317e',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetint',['le_cfg_GetInt',['../le__cfg__interface_8h.html#ada4b5ea73868f3d00701d7e76c2e6f38',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetnodename',['le_cfg_GetNodeName',['../le__cfg__interface_8h.html#a02c84283bc9c62a490e9c7cf3f3d5598',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetnodetype',['le_cfg_GetNodeType',['../le__cfg__interface_8h.html#a31df1f796da5a18a74de1110c549d6f8',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetpath',['le_cfg_GetPath',['../le__cfg__interface_8h.html#ab0c67c75671a9d003fa639b5f2ada51f',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgetstring',['le_cfg_GetString',['../le__cfg__interface_8h.html#aabb24e6c90309be03ce5a285d5849658',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgotofirstchild',['le_cfg_GoToFirstChild',['../le__cfg__interface_8h.html#abb7ab8d52ca9bf5e0977341e18740079',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgotonextsibling',['le_cfg_GoToNextSibling',['../le__cfg__interface_8h.html#aafcdb4bf55c14d960b7d16bb05af4bbe',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgotonode',['le_cfg_GoToNode',['../le__cfg__interface_8h.html#a3a8519b471bc6f4a5fea3716636dc607',1,'le_cfg_interface.h']]], ['le_5fcfg_5fgotoparent',['le_cfg_GoToParent',['../le__cfg__interface_8h.html#ad7d7debfc7c78b3a8b3908fcbc1a5966',1,'le_cfg_interface.h']]], ['le_5fcfg_5fisempty',['le_cfg_IsEmpty',['../le__cfg__interface_8h.html#a46db89aea45bb59128fba40bde081833',1,'le_cfg_interface.h']]], ['le_5fcfg_5fnodeexists',['le_cfg_NodeExists',['../le__cfg__interface_8h.html#a33d4fbe741e6a6ff5377f60e8754d1e4',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquickdeletenode',['le_cfg_QuickDeleteNode',['../le__cfg__interface_8h.html#a95f44c1e0d16eb48475465af63300a75',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquickgetbool',['le_cfg_QuickGetBool',['../le__cfg__interface_8h.html#a256c22a1fbe25c69a96af37d388c6805',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquickgetfloat',['le_cfg_QuickGetFloat',['../le__cfg__interface_8h.html#acf4ccdd3b7b18b971768db755b8273fc',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquickgetint',['le_cfg_QuickGetInt',['../le__cfg__interface_8h.html#a4503bb519a439f3de35d762668947c45',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquickgetstring',['le_cfg_QuickGetString',['../le__cfg__interface_8h.html#a049b354def8c343930816fd79903e483',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquicksetbool',['le_cfg_QuickSetBool',['../le__cfg__interface_8h.html#ad8915472ac5e82a8d3942ae8203264f2',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquicksetempty',['le_cfg_QuickSetEmpty',['../le__cfg__interface_8h.html#ae8fd42cad37a0a5d3ad8072b9571cc97',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquicksetfloat',['le_cfg_QuickSetFloat',['../le__cfg__interface_8h.html#aea4e34e0d4384f3cf0bb1c3bd27d4133',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquicksetint',['le_cfg_QuickSetInt',['../le__cfg__interface_8h.html#aca19ad4032442eb97171769e434d3a60',1,'le_cfg_interface.h']]], ['le_5fcfg_5fquicksetstring',['le_cfg_QuickSetString',['../le__cfg__interface_8h.html#aebf43c4763e9e9d9b305200ace67fdac',1,'le_cfg_interface.h']]], ['le_5fcfg_5fremovechangehandler',['le_cfg_RemoveChangeHandler',['../le__cfg__interface_8h.html#a17fa5e63dd1f5a2b7b66c92a76f8c98a',1,'le_cfg_interface.h']]], ['le_5fcfg_5fsetbool',['le_cfg_SetBool',['../le__cfg__interface_8h.html#a1b760f2ef78e9c12dc207a5cbe333c99',1,'le_cfg_interface.h']]], ['le_5fcfg_5fsetempty',['le_cfg_SetEmpty',['../le__cfg__interface_8h.html#a008c17822f0af91639b1fbb257be48ea',1,'le_cfg_interface.h']]], ['le_5fcfg_5fsetfloat',['le_cfg_SetFloat',['../le__cfg__interface_8h.html#aab1e755f81ef2e4bcbc6d57ea558a7a5',1,'le_cfg_interface.h']]], ['le_5fcfg_5fsetint',['le_cfg_SetInt',['../le__cfg__interface_8h.html#a46cb4c6dd1068cb07128ca637667bb77',1,'le_cfg_interface.h']]], ['le_5fcfg_5fsetnodename',['le_cfg_SetNodeName',['../le__cfg__interface_8h.html#a8802d20de7b178e51191c20e74fb495b',1,'le_cfg_interface.h']]], ['le_5fcfg_5fsetstring',['le_cfg_SetString',['../le__cfg__interface_8h.html#a741ade500cc7b10070e45065740d6980',1,'le_cfg_interface.h']]], ['le_5fcfg_5fstartclient',['le_cfg_StartClient',['../le__cfg__interface_8h.html#a5228a4832c56fbec5a6448db814d6a49',1,'le_cfg_interface.h']]], ['le_5fcfg_5fstopclient',['le_cfg_StopClient',['../le__cfg__interface_8h.html#a04d4fcfe495fe8ff73e7b1bfe9a034a0',1,'le_cfg_interface.h']]], ['le_5fclk_5fadd',['le_clk_Add',['../le__clock_8h.html#a6f4bda0268cd9349b6eb81ae350575fc',1,'le_clock.h']]], ['le_5fclk_5fconverttolocaltimestring',['le_clk_ConvertToLocalTimeString',['../le__clock_8h.html#a62c3e4ca5b0862938aea139f30846884',1,'le_clock.h']]], ['le_5fclk_5fconverttoutcstring',['le_clk_ConvertToUTCString',['../le__clock_8h.html#ae06285727609683956c22f6af2937f64',1,'le_clock.h']]], ['le_5fclk_5fgetabsolutetime',['le_clk_GetAbsoluteTime',['../le__clock_8h.html#a33197dbd676a37b8c4d5de8f93edc1ee',1,'le_clock.h']]], ['le_5fclk_5fgetlocaldatetimestring',['le_clk_GetLocalDateTimeString',['../le__clock_8h.html#a6f37c2a2171eac23ddc306de1fd55f5c',1,'le_clock.h']]], ['le_5fclk_5fgetrelativetime',['le_clk_GetRelativeTime',['../le__clock_8h.html#a298619d8c1d8f107cb03b8600f09a42b',1,'le_clock.h']]], ['le_5fclk_5fgetutcdatetimestring',['le_clk_GetUTCDateTimeString',['../le__clock_8h.html#a5392b8eb7d45ce86c0842a0a69975059',1,'le_clock.h']]], ['le_5fclk_5fgreaterthan',['le_clk_GreaterThan',['../le__clock_8h.html#ac4a550ee8aa5fad9c81a33024946660a',1,'le_clock.h']]], ['le_5fclk_5fmultiply',['le_clk_Multiply',['../le__clock_8h.html#a77961175ee422b1418a18eece5192c9c',1,'le_clock.h']]], ['le_5fclk_5fsub',['le_clk_Sub',['../le__clock_8h.html#ac5b5ec6f462d598f4e5aa081224725ac',1,'le_clock.h']]], ['le_5fdata_5faddconnectionstatehandler',['le_data_AddConnectionStateHandler',['../le__data__interface_8h.html#aebd3fc58774ed3f5a11f70d2317837dd',1,'le_data_interface.h']]], ['le_5fdata_5frelease',['le_data_Release',['../le__data__interface_8h.html#a1dc7cd8faed6b1ee02ea947cf02b8ee7',1,'le_data_interface.h']]], ['le_5fdata_5fremoveconnectionstatehandler',['le_data_RemoveConnectionStateHandler',['../le__data__interface_8h.html#a241d8832c1d002555ade70d6009d1d7d',1,'le_data_interface.h']]], ['le_5fdata_5frequest',['le_data_Request',['../le__data__interface_8h.html#afb9db0acdd98620cb0cd303bee8a817c',1,'le_data_interface.h']]], ['le_5fdata_5fstartclient',['le_data_StartClient',['../le__data__interface_8h.html#a8bcbeba470256d523b9c31dd40385d2d',1,'le_data_interface.h']]], ['le_5fdata_5fstopclient',['le_data_StopClient',['../le__data__interface_8h.html#a1d78b2842c54cf96f643329ca3ccd351',1,'le_data_interface.h']]], ['le_5fdir_5fmake',['le_dir_Make',['../le__dir_8h.html#a7ac7d25b67f2e47127084677626d5344',1,'le_dir.h']]], ['le_5fdir_5fmakepath',['le_dir_MakePath',['../le__dir_8h.html#a41fc915e2a21ea91dabe335f1316df74',1,'le_dir.h']]], ['le_5fdir_5fremoverecursive',['le_dir_RemoveRecursive',['../le__dir_8h.html#a9eca51d0e3031f9dee7b875a62c8b1e0',1,'le_dir.h']]], ['le_5fdls_5faddafter',['le_dls_AddAfter',['../le__doubly_linked_list_8h.html#ad93394ff686d2fe93f5f4ce73c7034cd',1,'le_doublyLinkedList.h']]], ['le_5fdls_5faddbefore',['le_dls_AddBefore',['../le__doubly_linked_list_8h.html#a6b68837b42fc2c68885db0857e7c71bf',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fisempty',['le_dls_IsEmpty',['../le__doubly_linked_list_8h.html#ab6068e41fca76311c0eeab36d9e23504',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fisinlist',['le_dls_IsInList',['../le__doubly_linked_list_8h.html#a13dd41bc5ca2c0b787bca4f57486f600',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fislistcorrupted',['le_dls_IsListCorrupted',['../le__doubly_linked_list_8h.html#a38538339f5eeb2f0c7205fc45a2a3f55',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fnumlinks',['le_dls_NumLinks',['../le__doubly_linked_list_8h.html#a207e3dc720d0121f2e62eb639aea8d24',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fpeek',['le_dls_Peek',['../le__doubly_linked_list_8h.html#ab0a2a83f476727f6aa875e98b213f05c',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fpeeknext',['le_dls_PeekNext',['../le__doubly_linked_list_8h.html#a3a1a15d3922ec53770f0fde3c8eef9f1',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fpeekprev',['le_dls_PeekPrev',['../le__doubly_linked_list_8h.html#ad43e69f235920323d725115cb166de34',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fpeektail',['le_dls_PeekTail',['../le__doubly_linked_list_8h.html#a366bc41775b9dfe265e79a9ffecd0a86',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fpop',['le_dls_Pop',['../le__doubly_linked_list_8h.html#a4bd942822ffc97004f46f9d062f62270',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fpoptail',['le_dls_PopTail',['../le__doubly_linked_list_8h.html#a31d98b6cfe8de4e618c07bb06e983e81',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fqueue',['le_dls_Queue',['../le__doubly_linked_list_8h.html#a264df63b847a9c485df0bf9050ac5deb',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fremove',['le_dls_Remove',['../le__doubly_linked_list_8h.html#ac5e1d4687e04c4e44359ce697ea9eeb2',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fstack',['le_dls_Stack',['../le__doubly_linked_list_8h.html#a90f9072a55ef0cb573bbdad91e34d368',1,'le_doublyLinkedList.h']]], ['le_5fdls_5fswap',['le_dls_Swap',['../le__doubly_linked_list_8h.html#ad317fec42c2474b8bef3654c89f3d239',1,'le_doublyLinkedList.h']]], ['le_5fecall_5faddstatechangehandler',['le_ecall_AddStateChangeHandler',['../ecall__interface_8h.html#a453b64579f2884f1d26981bca38a201c',1,'ecall_interface.h']]], ['le_5fecall_5fcreate',['le_ecall_Create',['../ecall__interface_8h.html#a70b992c3a20ca7511d0d9e6f1ffceebd',1,'ecall_interface.h']]], ['le_5fecall_5fdelete',['le_ecall_Delete',['../ecall__interface_8h.html#a431cc846cbded25ef3190b640acaadf3',1,'ecall_interface.h']]], ['le_5fecall_5fend',['le_ecall_End',['../ecall__interface_8h.html#a13afc62c93d1f17fe418e0fd3fc48e67',1,'ecall_interface.h']]], ['le_5fecall_5fgetstate',['le_ecall_GetState',['../ecall__interface_8h.html#aa44d0a365e520d554eee6c01de528a5d',1,'ecall_interface.h']]], ['le_5fecall_5fimportmsd',['le_ecall_ImportMsd',['../ecall__interface_8h.html#a6b1de45779bcba1a77ec07699b85fe00',1,'ecall_interface.h']]], ['le_5fecall_5fremovestatechangehandler',['le_ecall_RemoveStateChangeHandler',['../ecall__interface_8h.html#a6be1fd10666da25882a2c6f78c82664d',1,'ecall_interface.h']]], ['le_5fecall_5fsetmsdpassengerscount',['le_ecall_SetMsdPassengersCount',['../ecall__interface_8h.html#a06bab97aba545a35e8e9a205fe38af80',1,'ecall_interface.h']]], ['le_5fecall_5fsetmsdposition',['le_ecall_SetMsdPosition',['../ecall__interface_8h.html#ae1fa825e2f0271115e1dee8bc0b8cc92',1,'ecall_interface.h']]], ['le_5fecall_5fstartautomatic',['le_ecall_StartAutomatic',['../ecall__interface_8h.html#a53db04dbfbfef979fe39258fe9590948',1,'ecall_interface.h']]], ['le_5fecall_5fstartclient',['le_ecall_StartClient',['../ecall__interface_8h.html#a82ce4d8277dce9a93f1137fd724d88cd',1,'ecall_interface.h']]], ['le_5fecall_5fstartmanual',['le_ecall_StartManual',['../ecall__interface_8h.html#ae6ba5383e23b192f3d9fc18f9ce16b9a',1,'ecall_interface.h']]], ['le_5fecall_5fstarttest',['le_ecall_StartTest',['../ecall__interface_8h.html#a3384144824dafe7859cc601263903ed9',1,'ecall_interface.h']]], ['le_5fecall_5fstopclient',['le_ecall_StopClient',['../ecall__interface_8h.html#a35b561c3e36f208563a098d0ecf5c067',1,'ecall_interface.h']]], ['le_5fevent_5faddhandler',['le_event_AddHandler',['../le__event_loop_8h.html#ae65a65b4111618f47d7e6d57a48289e5',1,'le_eventLoop.h']]], ['le_5fevent_5faddlayeredhandler',['le_event_AddLayeredHandler',['../le__event_loop_8h.html#a8b906d38935f64953482f42c745e1c18',1,'le_eventLoop.h']]], ['le_5fevent_5fclearfdhandler',['le_event_ClearFdHandler',['../le__event_loop_8h.html#a6a44474e915f91f20c8bd950d50d8e92',1,'le_eventLoop.h']]], ['le_5fevent_5fcreatefdmonitor',['le_event_CreateFdMonitor',['../le__event_loop_8h.html#a02259f592867e8282bea379d4822a3d0',1,'le_eventLoop.h']]], ['le_5fevent_5fcreateid',['le_event_CreateId',['../le__event_loop_8h.html#a41a96eb3affb07184b519164cf54e213',1,'le_eventLoop.h']]], ['le_5fevent_5fcreateidwithrefcounting',['le_event_CreateIdWithRefCounting',['../le__event_loop_8h.html#a31bef8276ad0e911fd84fb710d58ca2b',1,'le_eventLoop.h']]], ['le_5fevent_5fdeletefdmonitor',['le_event_DeleteFdMonitor',['../le__event_loop_8h.html#a6ff974923aed7be0e3a39477e24d9df5',1,'le_eventLoop.h']]], ['le_5fevent_5fgetcontextptr',['le_event_GetContextPtr',['../le__event_loop_8h.html#a1c73916295cc9e17af07e02756aa86c9',1,'le_eventLoop.h']]], ['le_5fevent_5fgetfd',['le_event_GetFd',['../le__event_loop_8h.html#a12ce7f92f4bc6f5167d5a6ef86d7d0b1',1,'le_eventLoop.h']]], ['le_5fevent_5fqueuefunction',['le_event_QueueFunction',['../le__event_loop_8h.html#a6dcc88f96060c5bc107a81a978132f38',1,'le_eventLoop.h']]], ['le_5fevent_5fqueuefunctiontothread',['le_event_QueueFunctionToThread',['../le__event_loop_8h.html#a228da2d1f53ffa74517f108b0dcfa4d9',1,'le_eventLoop.h']]], ['le_5fevent_5fremovehandler',['le_event_RemoveHandler',['../le__event_loop_8h.html#ae31a85d4acbef72451b5411a613eea58',1,'le_eventLoop.h']]], ['le_5fevent_5freport',['le_event_Report',['../le__event_loop_8h.html#ae3ffe6990b70fb572b4eef06739b4f54',1,'le_eventLoop.h']]], ['le_5fevent_5freportwithrefcounting',['le_event_ReportWithRefCounting',['../le__event_loop_8h.html#af0277165493b512216fabb6086ec7d9c',1,'le_eventLoop.h']]], ['le_5fevent_5frunloop',['le_event_RunLoop',['../le__event_loop_8h.html#ae313b457994371c658be9fe0494a01ff',1,'le_eventLoop.h']]], ['le_5fevent_5fserviceloop',['le_event_ServiceLoop',['../le__event_loop_8h.html#a096222e98f6a0d92a79722018a752b58',1,'le_eventLoop.h']]], ['le_5fevent_5fsetcontextptr',['le_event_SetContextPtr',['../le__event_loop_8h.html#ae0c4307a9715794c720e525032aa0bfd',1,'le_eventLoop.h']]], ['le_5fevent_5fsetfdhandler',['le_event_SetFdHandler',['../le__event_loop_8h.html#ae31e605db307b38ffd4acbf4fe3440a6',1,'le_eventLoop.h']]], ['le_5fevent_5fsetfdhandlercontextptr',['le_event_SetFdHandlerContextPtr',['../le__event_loop_8h.html#a08b61606f569d7827d6c5bb7249084c4',1,'le_eventLoop.h']]], ['le_5fflock_5fclose',['le_flock_Close',['../le__file_lock_8h.html#a457a07dbf8967757322f531d5beb10b6',1,'le_fileLock.h']]], ['le_5fflock_5fclosestream',['le_flock_CloseStream',['../le__file_lock_8h.html#a8cd7aad1d732c6719097daf0359bf32f',1,'le_fileLock.h']]], ['le_5fflock_5fcreate',['le_flock_Create',['../le__file_lock_8h.html#a8fdca3e28190ef85e4457ebf009410b5',1,'le_fileLock.h']]], ['le_5fflock_5fcreatestream',['le_flock_CreateStream',['../le__file_lock_8h.html#a6444d5e3d885a7c346cba6993534020b',1,'le_fileLock.h']]], ['le_5fflock_5fopen',['le_flock_Open',['../le__file_lock_8h.html#aac3e11a6f7f363d29b8dbb1eb6c2c287',1,'le_fileLock.h']]], ['le_5fflock_5fopenstream',['le_flock_OpenStream',['../le__file_lock_8h.html#ae9a845ef8afe7cb7c4767573a974e5a0',1,'le_fileLock.h']]], ['le_5fflock_5ftrycreate',['le_flock_TryCreate',['../le__file_lock_8h.html#a4f7b134b467adb749401f2ef2ccd92d2',1,'le_fileLock.h']]], ['le_5fflock_5ftrycreatestream',['le_flock_TryCreateStream',['../le__file_lock_8h.html#aa1c3c10f1f72a5541f31855b5c2eed98',1,'le_fileLock.h']]], ['le_5fflock_5ftryopen',['le_flock_TryOpen',['../le__file_lock_8h.html#add7b73f75a8e7956a397081987458590',1,'le_fileLock.h']]], ['le_5fflock_5ftryopenstream',['le_flock_TryOpenStream',['../le__file_lock_8h.html#aa4712b501c620401a3f269c5cb34d91a',1,'le_fileLock.h']]], ['le_5fhashmap_5fcontainskey',['le_hashmap_ContainsKey',['../le__hashmap_8h.html#af42bc33eaed4e6183edfbded3203beb4',1,'le_hashmap.h']]], ['le_5fhashmap_5fcountcollisions',['le_hashmap_CountCollisions',['../le__hashmap_8h.html#ad31a0f34a74f765998467fa30096e46b',1,'le_hashmap.h']]], ['le_5fhashmap_5fcreate',['le_hashmap_Create',['../le__hashmap_8h.html#ade79896a5b2ceec82c570fe21f7efe3a',1,'le_hashmap.h']]], ['le_5fhashmap_5fenabletrace',['le_hashmap_EnableTrace',['../le__hashmap_8h.html#a10b30e794df1c866fe39c40c7949eb29',1,'le_hashmap.h']]], ['le_5fhashmap_5fequalsstring',['le_hashmap_EqualsString',['../le__hashmap_8h.html#a63d2b6c0689ece50ce979557029b8483',1,'le_hashmap.h']]], ['le_5fhashmap_5fequalsuint32',['le_hashmap_EqualsUInt32',['../le__hashmap_8h.html#ab3e3edfdbd30d06729486060a75a77c7',1,'le_hashmap.h']]], ['le_5fhashmap_5fequalsvoidpointer',['le_hashmap_EqualsVoidPointer',['../le__hashmap_8h.html#a8ecdbbdb5cc0773f0f9946e6e4dec89c',1,'le_hashmap.h']]], ['le_5fhashmap_5fforeach',['le_hashmap_ForEach',['../le__hashmap_8h.html#a2fc335fffcf59a677ac2ac4e5733cdda',1,'le_hashmap.h']]], ['le_5fhashmap_5fget',['le_hashmap_Get',['../le__hashmap_8h.html#a4322a312a2e4b00112022c2cb04eb416',1,'le_hashmap.h']]], ['le_5fhashmap_5fgetfirstnode',['le_hashmap_GetFirstNode',['../le__hashmap_8h.html#aeec5d4c2a49b8d0304efdfd469a1b2a4',1,'le_hashmap.h']]], ['le_5fhashmap_5fgetiterator',['le_hashmap_GetIterator',['../le__hashmap_8h.html#a8fb1d3a3d4c4b1b52a45205ac11a12c1',1,'le_hashmap.h']]], ['le_5fhashmap_5fgetkey',['le_hashmap_GetKey',['../le__hashmap_8h.html#a8c983aea3bfa393419b4ea26cfe35f42',1,'le_hashmap.h']]], ['le_5fhashmap_5fgetnodeafter',['le_hashmap_GetNodeAfter',['../le__hashmap_8h.html#a6a30f4e7da8135ef0274b24a86b7fcb7',1,'le_hashmap.h']]], ['le_5fhashmap_5fgetvalue',['le_hashmap_GetValue',['../le__hashmap_8h.html#aefd09b502200c3260a047cb12097e8ad',1,'le_hashmap.h']]], ['le_5fhashmap_5fhashstring',['le_hashmap_HashString',['../le__hashmap_8h.html#a3ff75de814b38d4c4283379acb406b65',1,'le_hashmap.h']]], ['le_5fhashmap_5fhashuint32',['le_hashmap_HashUInt32',['../le__hashmap_8h.html#a1bcf5d26bec7e15b6ec30fec4701ce03',1,'le_hashmap.h']]], ['le_5fhashmap_5fhashvoidpointer',['le_hashmap_HashVoidPointer',['../le__hashmap_8h.html#a2c9fc51c9f65c44f6c78cdaf101ab0e4',1,'le_hashmap.h']]], ['le_5fhashmap_5fisempty',['le_hashmap_isEmpty',['../le__hashmap_8h.html#a5530fc9656f5e49f891541900bc21f34',1,'le_hashmap.h']]], ['le_5fhashmap_5fmaketraceable',['le_hashmap_MakeTraceable',['../le__hashmap_8h.html#a853082500b05e57d899606cfc0e34fab',1,'le_hashmap.h']]], ['le_5fhashmap_5fnextnode',['le_hashmap_NextNode',['../le__hashmap_8h.html#a601b7d3e5d92e91e4090d726e5b190ca',1,'le_hashmap.h']]], ['le_5fhashmap_5fprevnode',['le_hashmap_PrevNode',['../le__hashmap_8h.html#aad5cdb7a6d36d28699b255814c0d639d',1,'le_hashmap.h']]], ['le_5fhashmap_5fput',['le_hashmap_Put',['../le__hashmap_8h.html#a68759fb8291c487a507eae6d92710fc7',1,'le_hashmap.h']]], ['le_5fhashmap_5fremove',['le_hashmap_Remove',['../le__hashmap_8h.html#a64eab4c096da5b66aa54c70ec5d5a776',1,'le_hashmap.h']]], ['le_5fhashmap_5fremoveall',['le_hashmap_RemoveAll',['../le__hashmap_8h.html#a27e3af23871a2f9e8adffb748111aab2',1,'le_hashmap.h']]], ['le_5fhashmap_5fsize',['le_hashmap_Size',['../le__hashmap_8h.html#a481e3fa6b0fe8319074140a2cb2ae1cc',1,'le_hashmap.h']]], ['le_5fhex_5fbinarytostring',['le_hex_BinaryToString',['../le__hex_8h.html#a2482e5240d47b176e41369fc5a654551',1,'le_hex.h']]], ['le_5fhex_5fstringtobinary',['le_hex_StringToBinary',['../le__hex_8h.html#a2ad2c35d567e8fc3fc962a58272b093d',1,'le_hex.h']]], ['le_5finfo_5fgetimei',['le_info_GetImei',['../info__interface_8h.html#a82950824965105fd9041fe5ed7239d79',1,'le_info_GetImei(char *imei, size_t imeiNumElements):&#160;info_interface.h'],['../le__info_8h.html#a71cf1bb18746d74bc02e45bebab2c746',1,'le_info_GetImei(char *imeiPtr, size_t len):&#160;le_info.h']]], ['le_5finfo_5fstartclient',['le_info_StartClient',['../info__interface_8h.html#a1f70e63ffe9e8da44d765e250a8a1936',1,'info_interface.h']]], ['le_5finfo_5fstopclient',['le_info_StopClient',['../info__interface_8h.html#a7452ad4dcdf5ad02c5f54227295ecc39',1,'info_interface.h']]], ['le_5flog_5fdisabletrace',['le_log_DisableTrace',['../le__log_8h.html#a15495177d8e9bf1fe4603cbc6bade8fc',1,'le_log.h']]], ['le_5flog_5fenabletrace',['le_log_EnableTrace',['../le__log_8h.html#a7dfe7c6d02a68b473d94d83ae71ff2b3',1,'le_log.h']]], ['le_5flog_5fgettraceref',['le_log_GetTraceRef',['../le__log_8h.html#a6d99d8147bcdcd1ed3848c9fdb72afe5',1,'le_log.h']]], ['le_5flog_5fistraceenabled',['le_log_IsTraceEnabled',['../le__log_8h.html#a9b0f9fed08a2bc5d6563540e4b3be490',1,'le_log.h']]], ['le_5flog_5fsetfilterlevel',['le_log_SetFilterLevel',['../le__log_8h.html#a06856e82ef8dc28a964d84db1aeee517',1,'le_log.h']]], ['le_5fmcc_5fcall_5fanswer',['le_mcc_call_Answer',['../le__mcc_8h.html#ac52db9513af1486e7ee5020e3128fb0d',1,'le_mcc_call_Answer(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#ac52db9513af1486e7ee5020e3128fb0d',1,'le_mcc_call_Answer(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fdelete',['le_mcc_call_Delete',['../le__mcc_8h.html#a91b1ccae151f59126317ae89cd5e10e0',1,'le_mcc_call_Delete(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#a91b1ccae151f59126317ae89cd5e10e0',1,'le_mcc_call_Delete(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fgetremotetel',['le_mcc_call_GetRemoteTel',['../le__mcc_8h.html#a491f336e36008f821564d16acc7e0daf',1,'le_mcc_call_GetRemoteTel(le_mcc_call_Ref_t callRef, char *telPtr, size_t len):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#aa3c2e51df85fd4ff0a9f88f70a6a71e3',1,'le_mcc_call_GetRemoteTel(le_mcc_call_Ref_t callRef, char *telPtr, size_t telPtrNumElements):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fgetrxaudiostream',['le_mcc_call_GetRxAudioStream',['../le__mcc_8h.html#a90c35114bdea1206c5df756cb9b5fb07',1,'le_mcc_call_GetRxAudioStream(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#a90c35114bdea1206c5df756cb9b5fb07',1,'le_mcc_call_GetRxAudioStream(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fgetterminationreason',['le_mcc_call_GetTerminationReason',['../le__mcc_8h.html#a9bd56258bf4350afdb2602bdb6f61c07',1,'le_mcc_call_GetTerminationReason(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#a9bd56258bf4350afdb2602bdb6f61c07',1,'le_mcc_call_GetTerminationReason(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fgettxaudiostream',['le_mcc_call_GetTxAudioStream',['../le__mcc_8h.html#a62a8f95c3e5f0db0384b77a85ec77d1c',1,'le_mcc_call_GetTxAudioStream(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#a62a8f95c3e5f0db0384b77a85ec77d1c',1,'le_mcc_call_GetTxAudioStream(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fhangup',['le_mcc_call_HangUp',['../le__mcc_8h.html#a0f5df7e46bdd63f4b91071bf8495ad9c',1,'le_mcc_call_HangUp(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#a0f5df7e46bdd63f4b91071bf8495ad9c',1,'le_mcc_call_HangUp(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fisconnected',['le_mcc_call_IsConnected',['../le__mcc_8h.html#aa71f1765ffcb50e3b8b39172f14d7a77',1,'le_mcc_call_IsConnected(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#aa71f1765ffcb50e3b8b39172f14d7a77',1,'le_mcc_call_IsConnected(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fstart',['le_mcc_call_Start',['../le__mcc_8h.html#aba77900f0bbe1e66d3d486a068bcc85c',1,'le_mcc_call_Start(le_mcc_call_Ref_t callRef):&#160;le_mcc.h'],['../mcc__call__interface_8h.html#aba77900f0bbe1e66d3d486a068bcc85c',1,'le_mcc_call_Start(le_mcc_call_Ref_t callRef):&#160;mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fstartclient',['le_mcc_call_StartClient',['../mcc__call__interface_8h.html#a2a179f71d4433ce63479e2d466c77adf',1,'mcc_call_interface.h']]], ['le_5fmcc_5fcall_5fstopclient',['le_mcc_call_StopClient',['../mcc__call__interface_8h.html#aa7638a4130d8a2c3b61fefc59259ff2d',1,'mcc_call_interface.h']]], ['le_5fmcc_5fprofile_5faddcalleventhandler',['le_mcc_profile_AddCallEventHandler',['../le__mcc_8h.html#ae8d9e27ae0112eaafaf907266e60b111',1,'le_mcc_profile_AddCallEventHandler(le_mcc_profile_Ref_t profileRef, le_mcc_profile_CallEventHandlerFunc_t handlerFuncPtr, void *contextPtr):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#a79250ea1f4c14b9bc9c4419f61bc331f',1,'le_mcc_profile_AddCallEventHandler(le_mcc_profile_Ref_t profileRef, le_mcc_profile_CallEventHandlerFunc_t handlerPtr, void *contextPtr):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5faddstatechangehandler',['le_mcc_profile_AddStateChangeHandler',['../le__mcc_8h.html#ad895a612fcc83b2b9010193c79cf4949',1,'le_mcc_profile_AddStateChangeHandler(le_mcc_profile_Ref_t profileRef, le_mcc_profile_StateChangeHandlerFunc_t handlerFuncPtr, void *contextPtr):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#af12300668007cf37b3121596d26a2c00',1,'le_mcc_profile_AddStateChangeHandler(le_mcc_profile_Ref_t profileRef, le_mcc_profile_StateChangeHandlerFunc_t handlerPtr, void *contextPtr):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fcreatecall',['le_mcc_profile_CreateCall',['../le__mcc_8h.html#a4a8a49c514d5d60fbda3276251406ac7',1,'le_mcc_profile_CreateCall(le_mcc_profile_Ref_t profileRef, const char *destinationPtr):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#a4a8a49c514d5d60fbda3276251406ac7',1,'le_mcc_profile_CreateCall(le_mcc_profile_Ref_t profileRef, const char *destinationPtr):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fgetbyname',['le_mcc_profile_GetByName',['../le__mcc_8h.html#abd7c8a9b67b14aac0e4a32cc5e9f34a9',1,'le_mcc_profile_GetByName(const char *profileNamePtr):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#abd7c8a9b67b14aac0e4a32cc5e9f34a9',1,'le_mcc_profile_GetByName(const char *profileNamePtr):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fgetstate',['le_mcc_profile_GetState',['../le__mcc_8h.html#a339996086ebf3c6c5242b3ce0414b926',1,'le_mcc_profile_GetState(le_mcc_profile_Ref_t profileRef):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#a339996086ebf3c6c5242b3ce0414b926',1,'le_mcc_profile_GetState(le_mcc_profile_Ref_t profileRef):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5frelease',['le_mcc_profile_Release',['../le__mcc_8h.html#a72e387c98e50d084c09a7e0a83af6341',1,'le_mcc_profile_Release(le_mcc_profile_Ref_t profileRef):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#a72e387c98e50d084c09a7e0a83af6341',1,'le_mcc_profile_Release(le_mcc_profile_Ref_t profileRef):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fremovecalleventhandler',['le_mcc_profile_RemoveCallEventHandler',['../le__mcc_8h.html#a81d1aa35b7e1c0783698021fda046da7',1,'le_mcc_profile_RemoveCallEventHandler(le_mcc_profile_CallEventHandlerRef_t handlerRef):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#a1d7581d0d52f2501d320cd415ae3a2d8',1,'le_mcc_profile_RemoveCallEventHandler(le_mcc_profile_CallEventHandlerRef_t addHandlerRef):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fremovestatechangehandler',['le_mcc_profile_RemoveStateChangeHandler',['../le__mcc_8h.html#aa373b926ca96415b1a8e7448b4c20763',1,'le_mcc_profile_RemoveStateChangeHandler(le_mcc_profile_StateChangeHandlerRef_t handlerRef):&#160;le_mcc.h'],['../mcc__profile__interface_8h.html#ab9b988a5cfa6c293d33a972818202733',1,'le_mcc_profile_RemoveStateChangeHandler(le_mcc_profile_StateChangeHandlerRef_t addHandlerRef):&#160;mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fstartclient',['le_mcc_profile_StartClient',['../mcc__profile__interface_8h.html#aa834268aaa4c749d3266c1ca766b5d80',1,'mcc_profile_interface.h']]], ['le_5fmcc_5fprofile_5fstopclient',['le_mcc_profile_StopClient',['../mcc__profile__interface_8h.html#ad5b8ea5931c9641bb230bf4ff8f27048',1,'mcc_profile_interface.h']]], ['le_5fmdc_5faddsessionstatehandler',['le_mdc_AddSessionStateHandler',['../le__mdc_8h.html#a3a98e19c2fe3bd3516e16c8aadf06a50',1,'le_mdc_AddSessionStateHandler(le_mdc_Profile_Ref_t profileRef, le_mdc_SessionStateHandlerFunc_t handler, void *contextPtr):&#160;le_mdc.h'],['../mdc__interface_8h.html#a68c83cea1c67af1d179df23d7028ca54',1,'le_mdc_AddSessionStateHandler(le_mdc_Profile_Ref_t profileRef, le_mdc_SessionStateHandlerFunc_t handlerPtr, void *contextPtr):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetaccesspointname',['le_mdc_GetAccessPointName',['../le__mdc_8h.html#ad481bd262813ad6f6d7d39ab2b0f714b',1,'le_mdc_GetAccessPointName(le_mdc_Profile_Ref_t profileRef, char *apnNameStr, size_t apnNameStrSize):&#160;le_mdc.h'],['../mdc__interface_8h.html#ab2ed8eece45a47ce2fe23a84d87cfa9c',1,'le_mdc_GetAccessPointName(le_mdc_Profile_Ref_t profileRef, char *apnNameStr, size_t apnNameStrNumElements):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetbytescounters',['le_mdc_GetBytesCounters',['../le__mdc_8h.html#ac3e85060f94bf1cd02c544f31608d977',1,'le_mdc_GetBytesCounters(uint64_t *rxBytes, uint64_t *txBytes):&#160;le_mdc.h'],['../mdc__interface_8h.html#aaad833c105f7d0ae77f18195d6739080',1,'le_mdc_GetBytesCounters(uint64_t *rxBytesPtr, uint64_t *txBytesPtr):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetdatabearertechnology',['le_mdc_GetDataBearerTechnology',['../le__mdc_8h.html#a8bb712721b3dda168f3bc12228bf79e4',1,'le_mdc_GetDataBearerTechnology(le_mdc_Profile_Ref_t profileRef, le_mdc_dataBearerTechnology_t *dataBearerTechnologyPtr):&#160;le_mdc.h'],['../mdc__interface_8h.html#a7474f8ff84fbab5cde4d49277e259155',1,'le_mdc_GetDataBearerTechnology(le_mdc_Profile_Ref_t profileRef, le_mdc_dataBearerTechnology_t *dataBearerTechnologyPtrPtr):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetdnsaddresses',['le_mdc_GetDNSAddresses',['../le__mdc_8h.html#a0a1e04effb88288fdd9478d6f74b5734',1,'le_mdc_GetDNSAddresses(le_mdc_Profile_Ref_t profileRef, char *dns1AddrStr, size_t dns1AddrStrSize, char *dns2AddrStr, size_t dns2AddrStrSize):&#160;le_mdc.h'],['../mdc__interface_8h.html#a63ba3cb5391701764357a8b737b50019',1,'le_mdc_GetDNSAddresses(le_mdc_Profile_Ref_t profileRef, char *dns1AddrStr, size_t dns1AddrStrNumElements, char *dns2AddrStr, size_t dns2AddrStrNumElements):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetgatewayaddress',['le_mdc_GetGatewayAddress',['../le__mdc_8h.html#ada3d08016267318d2b334cf5b5fff1b8',1,'le_mdc_GetGatewayAddress(le_mdc_Profile_Ref_t profileRef, char *gatewayAddrStr, size_t gatewayAddrStrSize):&#160;le_mdc.h'],['../mdc__interface_8h.html#abb505ff8417b50e6562a10e343328f5b',1,'le_mdc_GetGatewayAddress(le_mdc_Profile_Ref_t profileRef, char *gatewayAddr, size_t gatewayAddrNumElements):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetinterfacename',['le_mdc_GetInterfaceName',['../le__mdc_8h.html#aa4058861975bc869f3bb63ab1ffe9a16',1,'le_mdc_GetInterfaceName(le_mdc_Profile_Ref_t profileRef, char *interfaceNameStr, size_t interfaceNameStrSize):&#160;le_mdc.h'],['../mdc__interface_8h.html#a9d2dc2cf724134737dd655ae7b4bdfd7',1,'le_mdc_GetInterfaceName(le_mdc_Profile_Ref_t profileRef, char *interfaceName, size_t interfaceNameNumElements):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetipaddress',['le_mdc_GetIPAddress',['../le__mdc_8h.html#a56de95bee34e58639b9e3c3dc45dbecb',1,'le_mdc_GetIPAddress(le_mdc_Profile_Ref_t profileRef, char *ipAddrStr, size_t ipAddrStrSize):&#160;le_mdc.h'],['../mdc__interface_8h.html#a49bfa40e6e332d35e1f2373981101c7e',1,'le_mdc_GetIPAddress(le_mdc_Profile_Ref_t profileRef, char *ipAddr, size_t ipAddrNumElements):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetprofilename',['le_mdc_GetProfileName',['../le__mdc_8h.html#ae82509091d6e4f3f476120cf90594b8e',1,'le_mdc_GetProfileName(le_mdc_Profile_Ref_t profileRef, char *nameStr, size_t nameStrSize):&#160;le_mdc.h'],['../mdc__interface_8h.html#abd8824a18e0c0307dee65bbc383cb8c0',1,'le_mdc_GetProfileName(le_mdc_Profile_Ref_t profileRef, char *name, size_t nameNumElements):&#160;mdc_interface.h']]], ['le_5fmdc_5fgetsessionstate',['le_mdc_GetSessionState',['../le__mdc_8h.html#a0e99ea550357ec6f712bfb8a9913dc1e',1,'le_mdc_GetSessionState(le_mdc_Profile_Ref_t profileRef, bool *isConnectedPtr):&#160;le_mdc.h'],['../mdc__interface_8h.html#a0e99ea550357ec6f712bfb8a9913dc1e',1,'le_mdc_GetSessionState(le_mdc_Profile_Ref_t profileRef, bool *isConnectedPtr):&#160;mdc_interface.h']]], ['le_5fmdc_5fisipv4',['le_mdc_IsIPV4',['../le__mdc_8h.html#a90f9b98adc367436614e29f934ce1c3b',1,'le_mdc_IsIPV4(le_mdc_Profile_Ref_t profileRef):&#160;le_mdc.h'],['../mdc__interface_8h.html#a90f9b98adc367436614e29f934ce1c3b',1,'le_mdc_IsIPV4(le_mdc_Profile_Ref_t profileRef):&#160;mdc_interface.h']]], ['le_5fmdc_5fisipv6',['le_mdc_IsIPV6',['../le__mdc_8h.html#a1db6fc9bdcea2f679814ad69965fe33c',1,'le_mdc_IsIPV6(le_mdc_Profile_Ref_t profileRef):&#160;le_mdc.h'],['../mdc__interface_8h.html#a1db6fc9bdcea2f679814ad69965fe33c',1,'le_mdc_IsIPV6(le_mdc_Profile_Ref_t profileRef):&#160;mdc_interface.h']]], ['le_5fmdc_5floadprofile',['le_mdc_LoadProfile',['../le__mdc_8h.html#ae360d030f93ecab6cdcbf61effed24cd',1,'le_mdc_LoadProfile(const char *nameStr):&#160;le_mdc.h'],['../mdc__interface_8h.html#aaf1a5096e60a30e32de138665dc03d2e',1,'le_mdc_LoadProfile(const char *name):&#160;mdc_interface.h']]], ['le_5fmdc_5fremovesessionstatehandler',['le_mdc_RemoveSessionStateHandler',['../le__mdc_8h.html#af223a193b73ce6f870947557f69136dc',1,'le_mdc_RemoveSessionStateHandler(le_mdc_SessionStateHandlerRef_t handlerRef):&#160;le_mdc.h'],['../mdc__interface_8h.html#a3b89962f4383f42a357f5a5fcc14fdff',1,'le_mdc_RemoveSessionStateHandler(le_mdc_SessionStateHandlerRef_t addHandlerRef):&#160;mdc_interface.h']]], ['le_5fmdc_5fresetbytescounter',['le_mdc_ResetBytesCounter',['../le__mdc_8h.html#a63636b2779d2ee6a6520ebfb2d26666c',1,'le_mdc_ResetBytesCounter(void):&#160;le_mdc.h'],['../mdc__interface_8h.html#a63636b2779d2ee6a6520ebfb2d26666c',1,'le_mdc_ResetBytesCounter(void):&#160;mdc_interface.h']]], ['le_5fmdc_5fstartclient',['le_mdc_StartClient',['../mdc__interface_8h.html#a15636117e097415566ef63194705970e',1,'mdc_interface.h']]], ['le_5fmdc_5fstartsession',['le_mdc_StartSession',['../le__mdc_8h.html#a4611f8c0a26a9c2b8c6d8bb6ce39ce7d',1,'le_mdc_StartSession(le_mdc_Profile_Ref_t profileRef):&#160;le_mdc.h'],['../mdc__interface_8h.html#a4611f8c0a26a9c2b8c6d8bb6ce39ce7d',1,'le_mdc_StartSession(le_mdc_Profile_Ref_t profileRef):&#160;mdc_interface.h']]], ['le_5fmdc_5fstopclient',['le_mdc_StopClient',['../mdc__interface_8h.html#ae9f096bb21f13bc98b5f4d6bbd48d340',1,'mdc_interface.h']]], ['le_5fmdc_5fstopsession',['le_mdc_StopSession',['../le__mdc_8h.html#a3306a2efe863079f6bde881db39476bc',1,'le_mdc_StopSession(le_mdc_Profile_Ref_t profileRef):&#160;le_mdc.h'],['../mdc__interface_8h.html#a3306a2efe863079f6bde881db39476bc',1,'le_mdc_StopSession(le_mdc_Profile_Ref_t profileRef):&#160;mdc_interface.h']]], ['le_5fmem_5faddref',['le_mem_AddRef',['../le__mem_8h.html#a92e869f92a344d61fb44922f99fe679b',1,'le_mem.h']]], ['le_5fmem_5fassertalloc',['le_mem_AssertAlloc',['../le__mem_8h.html#a2993bf7a9705d119c96cf80cd64a56bb',1,'le_mem.h']]], ['le_5fmem_5fcreatepool',['le_mem_CreatePool',['../le__mem_8h.html#afc7288e04f1afff41a83a4da974726ab',1,'le_mem.h']]], ['le_5fmem_5fcreatesubpool',['le_mem_CreateSubPool',['../le__mem_8h.html#a7b3fdd3bcbd5ac24b3a00374188a32da',1,'le_mem.h']]], ['le_5fmem_5fdeletesubpool',['le_mem_DeleteSubPool',['../le__mem_8h.html#aa1d51a37f572c2d891cdfb625ea19f27',1,'le_mem.h']]], ['le_5fmem_5fexpandpool',['le_mem_ExpandPool',['../le__mem_8h.html#a79a4321ffa0345f267eaf3b7d3d3528a',1,'le_mem.h']]], ['le_5fmem_5ffindpool',['le_mem_FindPool',['../le__mem_8h.html#a2a3a1245814aca76d56aa978505a0268',1,'le_mem.h']]], ['le_5fmem_5fforcealloc',['le_mem_ForceAlloc',['../le__mem_8h.html#af7c289c73d4182835a26a9099f3db359',1,'le_mem.h']]], ['le_5fmem_5fgetobjectsize',['le_mem_GetObjectSize',['../le__mem_8h.html#a0f6fbc0c886486a1e19fc43143991c66',1,'le_mem.h']]], ['le_5fmem_5fgetstats',['le_mem_GetStats',['../le__mem_8h.html#ab7b41431c57c8c7b5c4ff1501fd5b772',1,'le_mem.h']]], ['le_5fmem_5fgettotalnumobjs',['le_mem_GetTotalNumObjs',['../le__mem_8h.html#a4f7a6ac940b2f468a6012283d95a0f6d',1,'le_mem.h']]], ['le_5fmem_5frelease',['le_mem_Release',['../le__mem_8h.html#a6d8e3fe430bcb81efe97b57ce30ef2de',1,'le_mem.h']]], ['le_5fmem_5fresetstats',['le_mem_ResetStats',['../le__mem_8h.html#a35b7e757356764c39f0a7ede2aa242ae',1,'le_mem.h']]], ['le_5fmem_5fsetdestructor',['le_mem_SetDestructor',['../le__mem_8h.html#a055007b38ce04bcb823e08034fd11b85',1,'le_mem.h']]], ['le_5fmem_5fsetnumobjstoforce',['le_mem_SetNumObjsToForce',['../le__mem_8h.html#a267485862100d8cdfefae2c328fb8b91',1,'le_mem.h']]], ['le_5fmem_5ftryalloc',['le_mem_TryAlloc',['../le__mem_8h.html#a742e4f9d621ca27493733ca781bbe187',1,'le_mem.h']]], ['le_5fmrc_5faddnetregstatehandler',['le_mrc_AddNetRegStateHandler',['../le__mrc_8h.html#ace1cd9a07ba4048b68911097bae579d4',1,'le_mrc_AddNetRegStateHandler(le_mrc_NetRegStateHandlerFunc_t handlerFuncPtr, void *contextPtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#aa1925a88d9aa51fc868dd21a6b3611c6',1,'le_mrc_AddNetRegStateHandler(le_mrc_NetRegStateHandlerFunc_t handlerPtr, void *contextPtr):&#160;mrc_interface.h']]], ['le_5fmrc_5faddratchangehandler',['le_mrc_AddRatChangeHandler',['../le__mrc_8h.html#a53a0900eb65f2ee3b30abc5ea5bdb1ec',1,'le_mrc_AddRatChangeHandler(le_mrc_RatChangeHandlerFunc_t handlerFuncPtr, void *contextPtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#aedd9c526588a8298322525cfba6f875d',1,'le_mrc_AddRatChangeHandler(le_mrc_RatChangeHandlerFunc_t handlerPtr, void *contextPtr):&#160;mrc_interface.h']]], ['le_5fmrc_5fdeletecellularnetworkscan',['le_mrc_DeleteCellularNetworkScan',['../le__mrc_8h.html#aabbed28955eab0ed5c942a2a037ed6cf',1,'le_mrc_DeleteCellularNetworkScan(le_mrc_ScanInformation_ListRef_t scanInformationListRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#aabbed28955eab0ed5c942a2a037ed6cf',1,'le_mrc_DeleteCellularNetworkScan(le_mrc_ScanInformation_ListRef_t scanInformationListRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fdeleteneighborcellsinfo',['le_mrc_DeleteNeighborCellsInfo',['../le__mrc_8h.html#a2a36594f06217845847860058b6fe5f2',1,'le_mrc_DeleteNeighborCellsInfo(le_mrc_NeighborCells_Ref_t ngbrCellsRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a2a36594f06217845847860058b6fe5f2',1,'le_mrc_DeleteNeighborCellsInfo(le_mrc_NeighborCells_Ref_t ngbrCellsRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetcellularnetworkmccmnc',['le_mrc_GetCellularNetworkMccMnc',['../le__mrc_8h.html#a54c3ddcd6c877b48c612aee65a82b5fd',1,'le_mrc_GetCellularNetworkMccMnc(le_mrc_ScanInformation_Ref_t scanInformationRef, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize):&#160;le_mrc.h'],['../mrc__interface_8h.html#a70d046f604befbde8520e072e9a726e4',1,'le_mrc_GetCellularNetworkMccMnc(le_mrc_ScanInformation_Ref_t scanInformationRef, char *mccPtr, size_t mccPtrNumElements, char *mncPtr, size_t mncPtrNumElements):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetcellularnetworkname',['le_mrc_GetCellularNetworkName',['../le__mrc_8h.html#a2a52836260653cc51f95b592d0ad1b5f',1,'le_mrc_GetCellularNetworkName(le_mrc_ScanInformation_Ref_t scanInformationRef, char *namePtr, size_t nameSize):&#160;le_mrc.h'],['../mrc__interface_8h.html#a207dd411e963addfa5721b5a2a88c980',1,'le_mrc_GetCellularNetworkName(le_mrc_ScanInformation_Ref_t scanInformationRef, char *namePtr, size_t namePtrNumElements):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetfirstcellularnetworkscan',['le_mrc_GetFirstCellularNetworkScan',['../le__mrc_8h.html#a0852cae99a555d7cf84fa037ca10cb99',1,'le_mrc_GetFirstCellularNetworkScan(le_mrc_ScanInformation_ListRef_t scanInformationListRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a0852cae99a555d7cf84fa037ca10cb99',1,'le_mrc_GetFirstCellularNetworkScan(le_mrc_ScanInformation_ListRef_t scanInformationListRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetfirstneighborcellinfo',['le_mrc_GetFirstNeighborCellInfo',['../le__mrc_8h.html#a16e3171e05b85cf0b60fb6966041af8b',1,'le_mrc_GetFirstNeighborCellInfo(le_mrc_NeighborCells_Ref_t ngbrCellsRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a16e3171e05b85cf0b60fb6966041af8b',1,'le_mrc_GetFirstNeighborCellInfo(le_mrc_NeighborCells_Ref_t ngbrCellsRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgethomenetworkname',['le_mrc_GetHomeNetworkName',['../le__mrc_8h.html#adb0f8482f975f23c574594f7e6c1c4df',1,'le_mrc_GetHomeNetworkName(char *nameStr, size_t nameStrSize):&#160;le_mrc.h'],['../mrc__interface_8h.html#aa7adeff4838e18d678233f255a9cf6fe',1,'le_mrc_GetHomeNetworkName(char *nameStr, size_t nameStrNumElements):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetneighborcellid',['le_mrc_GetNeighborCellId',['../le__mrc_8h.html#a0895ede4d936937cc2a004acdaaf35cc',1,'le_mrc_GetNeighborCellId(le_mrc_CellInfo_Ref_t ngbrCellInfoRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a0895ede4d936937cc2a004acdaaf35cc',1,'le_mrc_GetNeighborCellId(le_mrc_CellInfo_Ref_t ngbrCellInfoRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetneighborcelllocareacode',['le_mrc_GetNeighborCellLocAreaCode',['../le__mrc_8h.html#ad33d1cd899974ced0ee7d6b8c1981128',1,'le_mrc_GetNeighborCellLocAreaCode(le_mrc_CellInfo_Ref_t ngbrCellInfoRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#ad33d1cd899974ced0ee7d6b8c1981128',1,'le_mrc_GetNeighborCellLocAreaCode(le_mrc_CellInfo_Ref_t ngbrCellInfoRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetneighborcellrxlevel',['le_mrc_GetNeighborCellRxLevel',['../le__mrc_8h.html#a9eae22ceb2df40d7e1e57a9ec617b2f5',1,'le_mrc_GetNeighborCellRxLevel(le_mrc_CellInfo_Ref_t ngbrCellInfoRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a9eae22ceb2df40d7e1e57a9ec617b2f5',1,'le_mrc_GetNeighborCellRxLevel(le_mrc_CellInfo_Ref_t ngbrCellInfoRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetneighborcellsinfo',['le_mrc_GetNeighborCellsInfo',['../le__mrc_8h.html#ae6278ae1817f8cbb9ec425f85b756ff9',1,'le_mrc_GetNeighborCellsInfo(void):&#160;le_mrc.h'],['../mrc__interface_8h.html#ae6278ae1817f8cbb9ec425f85b756ff9',1,'le_mrc_GetNeighborCellsInfo(void):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetnetregstate',['le_mrc_GetNetRegState',['../le__mrc_8h.html#a4f11e27862fef384c0023f5b538e543d',1,'le_mrc_GetNetRegState(le_mrc_NetRegState_t *statePtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#a4f11e27862fef384c0023f5b538e543d',1,'le_mrc_GetNetRegState(le_mrc_NetRegState_t *statePtr):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetnextcellularnetworkscan',['le_mrc_GetNextCellularNetworkScan',['../le__mrc_8h.html#a75b4a316e87b15ac7558043a5e2080f9',1,'le_mrc_GetNextCellularNetworkScan(le_mrc_ScanInformation_ListRef_t scanInformationListRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a75b4a316e87b15ac7558043a5e2080f9',1,'le_mrc_GetNextCellularNetworkScan(le_mrc_ScanInformation_ListRef_t scanInformationListRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetnextneighborcellinfo',['le_mrc_GetNextNeighborCellInfo',['../le__mrc_8h.html#a71f62bb1260e5b1f6382f048e5bbbfdb',1,'le_mrc_GetNextNeighborCellInfo(le_mrc_NeighborCells_Ref_t ngbrCellsRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a71f62bb1260e5b1f6382f048e5bbbfdb',1,'le_mrc_GetNextNeighborCellInfo(le_mrc_NeighborCells_Ref_t ngbrCellsRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetradioaccesstechinuse',['le_mrc_GetRadioAccessTechInUse',['../le__mrc_8h.html#a3ad9533c467cec0902d5d165bb32d67b',1,'le_mrc_GetRadioAccessTechInUse(le_mrc_Rat_t *ratPtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#a3ad9533c467cec0902d5d165bb32d67b',1,'le_mrc_GetRadioAccessTechInUse(le_mrc_Rat_t *ratPtr):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetradiopower',['le_mrc_GetRadioPower',['../le__mrc_8h.html#aac51332c6c84e460746eb1ad45c064d6',1,'le_mrc_GetRadioPower(le_onoff_t *powerPtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#aac51332c6c84e460746eb1ad45c064d6',1,'le_mrc_GetRadioPower(le_onoff_t *powerPtr):&#160;mrc_interface.h']]], ['le_5fmrc_5fgetsignalqual',['le_mrc_GetSignalQual',['../le__mrc_8h.html#a717aa0f4e4dc9a83b6adc2f26f3f0258',1,'le_mrc_GetSignalQual(uint32_t *qualityPtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#a717aa0f4e4dc9a83b6adc2f26f3f0258',1,'le_mrc_GetSignalQual(uint32_t *qualityPtr):&#160;mrc_interface.h']]], ['le_5fmrc_5fiscellularnetworkavailable',['le_mrc_IsCellularNetworkAvailable',['../le__mrc_8h.html#a68f43831a24c0876f3369f8f04fecc3c',1,'le_mrc_IsCellularNetworkAvailable(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a68f43831a24c0876f3369f8f04fecc3c',1,'le_mrc_IsCellularNetworkAvailable(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fiscellularnetworkforbidden',['le_mrc_IsCellularNetworkForbidden',['../le__mrc_8h.html#a83c48b76855849170377097f0518e348',1,'le_mrc_IsCellularNetworkForbidden(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a83c48b76855849170377097f0518e348',1,'le_mrc_IsCellularNetworkForbidden(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fiscellularnetworkhome',['le_mrc_IsCellularNetworkHome',['../le__mrc_8h.html#a6bd66ede48ce256daa45318fe721194f',1,'le_mrc_IsCellularNetworkHome(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a6bd66ede48ce256daa45318fe721194f',1,'le_mrc_IsCellularNetworkHome(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fiscellularnetworkinuse',['le_mrc_IsCellularNetworkInUse',['../le__mrc_8h.html#aee8a43ae54b3598fccdcfb8f4b12ad57',1,'le_mrc_IsCellularNetworkInUse(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#aee8a43ae54b3598fccdcfb8f4b12ad57',1,'le_mrc_IsCellularNetworkInUse(le_mrc_ScanInformation_Ref_t scanInformationRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fiscellularnetworkratavailable',['le_mrc_IsCellularNetworkRatAvailable',['../le__mrc_8h.html#a7dd469abba42286dbe675e0dc23b4460',1,'le_mrc_IsCellularNetworkRatAvailable(le_mrc_ScanInformation_Ref_t scanInformationRef, le_mrc_Rat_t rat):&#160;le_mrc.h'],['../mrc__interface_8h.html#a7dd469abba42286dbe675e0dc23b4460',1,'le_mrc_IsCellularNetworkRatAvailable(le_mrc_ScanInformation_Ref_t scanInformationRef, le_mrc_Rat_t rat):&#160;mrc_interface.h']]], ['le_5fmrc_5fperformcellularnetworkscan',['le_mrc_PerformCellularNetworkScan',['../le__mrc_8h.html#aeeca2f873b7830d9b069dce692e99abe',1,'le_mrc_PerformCellularNetworkScan(le_mrc_Rat_t ratMask):&#160;le_mrc.h'],['../mrc__interface_8h.html#aeeca2f873b7830d9b069dce692e99abe',1,'le_mrc_PerformCellularNetworkScan(le_mrc_Rat_t ratMask):&#160;mrc_interface.h']]], ['le_5fmrc_5fregistercellularnetwork',['le_mrc_RegisterCellularNetwork',['../le__mrc_8h.html#ad62cca6ea4e0825231ab382f981540ff',1,'le_mrc_RegisterCellularNetwork(const char *mccPtr, const char *mncPtr):&#160;le_mrc.h'],['../mrc__interface_8h.html#a578262185e6c0514e4ad5ba584c360ca',1,'le_mrc_RegisterCellularNetwork(const char *mcc, const char *mnc):&#160;mrc_interface.h']]], ['le_5fmrc_5fremovenetregstatehandler',['le_mrc_RemoveNetRegStateHandler',['../le__mrc_8h.html#ac48c2d083b4b1fe59dffbba1d75e426e',1,'le_mrc_RemoveNetRegStateHandler(le_mrc_NetRegStateHandlerRef_t handlerRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#a3033ecbc5b32c7847a794ee1d81922bd',1,'le_mrc_RemoveNetRegStateHandler(le_mrc_NetRegStateHandlerRef_t addHandlerRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fremoveratchangehandler',['le_mrc_RemoveRatChangeHandler',['../le__mrc_8h.html#a818abae622b5d2cb3cfec53b15f7023e',1,'le_mrc_RemoveRatChangeHandler(le_mrc_RatChangeHandlerRef_t handlerRef):&#160;le_mrc.h'],['../mrc__interface_8h.html#aed4f1730c99a1a9204a198e3df3cf6f5',1,'le_mrc_RemoveRatChangeHandler(le_mrc_RatChangeHandlerRef_t addHandlerRef):&#160;mrc_interface.h']]], ['le_5fmrc_5fsetradiopower',['le_mrc_SetRadioPower',['../le__mrc_8h.html#a78bd27d92337e2122320f41bcaa5480f',1,'le_mrc_SetRadioPower(le_onoff_t power):&#160;le_mrc.h'],['../mrc__interface_8h.html#a78bd27d92337e2122320f41bcaa5480f',1,'le_mrc_SetRadioPower(le_onoff_t power):&#160;mrc_interface.h']]], ['le_5fmrc_5fstartclient',['le_mrc_StartClient',['../mrc__interface_8h.html#a58b30068eb3ea66472b9fa94ac4a52eb',1,'mrc_interface.h']]], ['le_5fmrc_5fstopclient',['le_mrc_StopClient',['../mrc__interface_8h.html#a59af0a3ab2d9e3e091d59fa54b8056ab',1,'mrc_interface.h']]], ['le_5fmsg_5faddref',['le_msg_AddRef',['../le__messaging_8h.html#a93be4a4e628d079f9f53db30f2e78b28',1,'le_messaging.h']]], ['le_5fmsg_5fadvertiseservice',['le_msg_AdvertiseService',['../le__messaging_8h.html#ad3ff11d1962840f879d9c8fe7054de0c',1,'le_messaging.h']]], ['le_5fmsg_5fclosesession',['le_msg_CloseSession',['../le__messaging_8h.html#a1af0671de74160d99be5bfe212c39369',1,'le_messaging.h']]], ['le_5fmsg_5fcreatemsg',['le_msg_CreateMsg',['../le__messaging_8h.html#a8293a69f256b98cbce5b9990ea3520f3',1,'le_messaging.h']]], ['le_5fmsg_5fcreateservice',['le_msg_CreateService',['../le__messaging_8h.html#a752a4f957bf3284912348650e7c6ef42',1,'le_messaging.h']]], ['le_5fmsg_5fcreatesession',['le_msg_CreateSession',['../le__messaging_8h.html#ade2f7b8d6c862ad7ce0180b7337afb09',1,'le_messaging.h']]], ['le_5fmsg_5fdeleteservice',['le_msg_DeleteService',['../le__messaging_8h.html#a2efe99bdd7dcea84ea820a8cb4a8a9a4',1,'le_messaging.h']]], ['le_5fmsg_5fdeletesession',['le_msg_DeleteSession',['../le__messaging_8h.html#a8d950c4b07741177d2c0927c31e3e29f',1,'le_messaging.h']]], ['le_5fmsg_5fgetclientprocessid',['le_msg_GetClientProcessId',['../le__messaging_8h.html#a4fe4cb3d7a13f0b999aeb20eb5107f8b',1,'le_messaging.h']]], ['le_5fmsg_5fgetclientusercreds',['le_msg_GetClientUserCreds',['../le__messaging_8h.html#ae17fcad4c9bc442dfb2403a50b5143a4',1,'le_messaging.h']]], ['le_5fmsg_5fgetclientuserid',['le_msg_GetClientUserId',['../le__messaging_8h.html#a8c04f9cad0a768b4922a9987df84b65f',1,'le_messaging.h']]], ['le_5fmsg_5fgetfd',['le_msg_GetFd',['../le__messaging_8h.html#a1eff9dd7f93de58f5678ad3d6e0b734d',1,'le_messaging.h']]], ['le_5fmsg_5fgetmaxpayloadsize',['le_msg_GetMaxPayloadSize',['../le__messaging_8h.html#ac12a43d9266aa931762e54ab0026693f',1,'le_messaging.h']]], ['le_5fmsg_5fgetpayloadptr',['le_msg_GetPayloadPtr',['../le__messaging_8h.html#a32d1c7ffd913db8546f6f1bd5cce58c4',1,'le_messaging.h']]], ['le_5fmsg_5fgetprotocolidstr',['le_msg_GetProtocolIdStr',['../le__messaging_8h.html#a10a7c8b66a6baadb290c8d0e3c72f066',1,'le_messaging.h']]], ['le_5fmsg_5fgetprotocolmaxmsgsize',['le_msg_GetProtocolMaxMsgSize',['../le__messaging_8h.html#a42196218a35f314966901c4cd22fbb07',1,'le_messaging.h']]], ['le_5fmsg_5fgetprotocolref',['le_msg_GetProtocolRef',['../le__messaging_8h.html#adcd1ff1a6906433aaa6d7038125c4473',1,'le_messaging.h']]], ['le_5fmsg_5fgetservicecontextptr',['le_msg_GetServiceContextPtr',['../le__messaging_8h.html#afdbe07163b20ad9246bc8419e7c034e3',1,'le_messaging.h']]], ['le_5fmsg_5fgetservicename',['le_msg_GetServiceName',['../le__messaging_8h.html#a8c412727a194160a77f0ccffcffb63ec',1,'le_messaging.h']]], ['le_5fmsg_5fgetserviceprotocol',['le_msg_GetServiceProtocol',['../le__messaging_8h.html#a3061557d93ed6e1e25748666462a5ddf',1,'le_messaging.h']]], ['le_5fmsg_5fgetservicerxmsg',['le_msg_GetServiceRxMsg',['../le__messaging_8h.html#a2007f56df1f818119e3188a1a2a902d6',1,'le_messaging.h']]], ['le_5fmsg_5fgetsession',['le_msg_GetSession',['../le__messaging_8h.html#a253088f1b852575b60d7732ca7afc79b',1,'le_messaging.h']]], ['le_5fmsg_5fgetsessioncontextptr',['le_msg_GetSessionContextPtr',['../le__messaging_8h.html#aa6af290efb4f6f28a0438811859506b2',1,'le_messaging.h']]], ['le_5fmsg_5fgetsessionprotocol',['le_msg_GetSessionProtocol',['../le__messaging_8h.html#a729fb1891da6ec1255debd04e2a0efdb',1,'le_messaging.h']]], ['le_5fmsg_5fgetsessionservice',['le_msg_GetSessionService',['../le__messaging_8h.html#a804520537ab7ddefaae6b6005bb087ad',1,'le_messaging.h']]], ['le_5fmsg_5fhideservice',['le_msg_HideService',['../le__messaging_8h.html#a38cc9dec16a758c5262d8bb5c7a2e57f',1,'le_messaging.h']]], ['le_5fmsg_5fneedsresponse',['le_msg_NeedsResponse',['../le__messaging_8h.html#a8b0824781c030b9ed6f8be48e4d20419',1,'le_messaging.h']]], ['le_5fmsg_5fopensession',['le_msg_OpenSession',['../le__messaging_8h.html#a574d37960a07c4fc2bde310408619cff',1,'le_messaging.h']]], ['le_5fmsg_5fopensessionsync',['le_msg_OpenSessionSync',['../le__messaging_8h.html#a726e115ceb7d6470217a159c71ee1f8b',1,'le_messaging.h']]], ['le_5fmsg_5freleasemsg',['le_msg_ReleaseMsg',['../le__messaging_8h.html#afc508c24d0b6933e8fbc4e0410d50271',1,'le_messaging.h']]], ['le_5fmsg_5frequestresponse',['le_msg_RequestResponse',['../le__messaging_8h.html#a5440ae06a89b60ed04e9de5601496608',1,'le_messaging.h']]], ['le_5fmsg_5frequestsyncresponse',['le_msg_RequestSyncResponse',['../le__messaging_8h.html#aa3cf113b26b154697ccef270dafe8798',1,'le_messaging.h']]], ['le_5fmsg_5frespond',['le_msg_Respond',['../le__messaging_8h.html#ac4545833ad2da9bb4cc5d18125f7d9f2',1,'le_messaging.h']]], ['le_5fmsg_5fsend',['le_msg_Send',['../le__messaging_8h.html#a073de097d281475c44a445b927fbb929',1,'le_messaging.h']]], ['le_5fmsg_5fsetfd',['le_msg_SetFd',['../le__messaging_8h.html#a43459773ce8a9febf0f2e66681e40e91',1,'le_messaging.h']]], ['le_5fmsg_5fsetserviceclosehandler',['le_msg_SetServiceCloseHandler',['../le__messaging_8h.html#ab0242ce98c7ba7a5f4aa0537bb5bd223',1,'le_messaging.h']]], ['le_5fmsg_5fsetservicecontextptr',['le_msg_SetServiceContextPtr',['../le__messaging_8h.html#a9233d283c260a1983c594b4a9061374a',1,'le_messaging.h']]], ['le_5fmsg_5fsetserviceopenhandler',['le_msg_SetServiceOpenHandler',['../le__messaging_8h.html#a6a1bd585b91fe512b5432c786d1956b2',1,'le_messaging.h']]], ['le_5fmsg_5fsetservicerecvhandler',['le_msg_SetServiceRecvHandler',['../le__messaging_8h.html#a21c2e57ad1ffbbdfedd3987c468e3130',1,'le_messaging.h']]], ['le_5fmsg_5fsetsessionclosehandler',['le_msg_SetSessionCloseHandler',['../le__messaging_8h.html#a981b1b0714abba85efc19293ac6d2744',1,'le_messaging.h']]], ['le_5fmsg_5fsetsessioncontextptr',['le_msg_SetSessionContextPtr',['../le__messaging_8h.html#a2d2c311bf66a28d99cc21dc5264d7432',1,'le_messaging.h']]], ['le_5fmsg_5fsetsessionrecvhandler',['le_msg_SetSessionRecvHandler',['../le__messaging_8h.html#ac726cc93219d326e1b10a7d13a0f4f65',1,'le_messaging.h']]], ['le_5fmutex_5fcreatenonrecursive',['le_mutex_CreateNonRecursive',['../le__mutex_8h.html#a602e2c18e646db7af0d68bb5fb103207',1,'le_mutex.h']]], ['le_5fmutex_5fcreaterecursive',['le_mutex_CreateRecursive',['../le__mutex_8h.html#ac7dd2b69f4b905d56df969c9085a570b',1,'le_mutex.h']]], ['le_5fmutex_5fcreatetraceablenonrecursive',['le_mutex_CreateTraceableNonRecursive',['../le__mutex_8h.html#abe16eb57e75131afe47d06c0530d5ee9',1,'le_mutex.h']]], ['le_5fmutex_5fcreatetraceablerecursive',['le_mutex_CreateTraceableRecursive',['../le__mutex_8h.html#a17bcd94aaf2c29e10cd90f949b1e13a7',1,'le_mutex.h']]], ['le_5fmutex_5fdelete',['le_mutex_Delete',['../le__mutex_8h.html#a38571fa1d9c15d5f30ea9c480d8810c6',1,'le_mutex.h']]], ['le_5fmutex_5flock',['le_mutex_Lock',['../le__mutex_8h.html#ad5b7d94710f420cd945229648e7a80e7',1,'le_mutex.h']]], ['le_5fmutex_5ftrylock',['le_mutex_TryLock',['../le__mutex_8h.html#a43864999f70f0a825cf8ca87f9a2ee2c',1,'le_mutex.h']]], ['le_5fmutex_5funlock',['le_mutex_Unlock',['../le__mutex_8h.html#aae68b71222e20c55ff3bf2d7b52e3009',1,'le_mutex.h']]], ['le_5fpath_5fconcat',['le_path_Concat',['../le__path_8h.html#a5f0eb2e4882a70c5767cd325b8c5db23',1,'le_path.h']]], ['le_5fpath_5fgetbasenameptr',['le_path_GetBasenamePtr',['../le__path_8h.html#aa58d208512dd5b9b2dc0ea6d5c963c25',1,'le_path.h']]], ['le_5fpath_5fgetdir',['le_path_GetDir',['../le__path_8h.html#a0b0ff4c06db44de9bf4f40b9f5388785',1,'le_path.h']]], ['le_5fpathiter_5fappend',['le_pathIter_Append',['../le__path_iter_8h.html#ae6aa59696c54d2523009037cc78f9725',1,'le_pathIter.h']]], ['le_5fpathiter_5fclone',['le_pathIter_Clone',['../le__path_iter_8h.html#a50349a6c2afa4415d65a6efd443894d3',1,'le_pathIter.h']]], ['le_5fpathiter_5fcreate',['le_pathIter_Create',['../le__path_iter_8h.html#a73fac1b657b752b17395c66fb1ae324b',1,'le_pathIter.h']]], ['le_5fpathiter_5fcreateforunix',['le_pathIter_CreateForUnix',['../le__path_iter_8h.html#a35a38b307f9fdc0de82552e96a5a2d1d',1,'le_pathIter.h']]], ['le_5fpathiter_5fdelete',['le_pathIter_Delete',['../le__path_iter_8h.html#a6b57267a2c0db0210aab96c66459f9a1',1,'le_pathIter.h']]], ['le_5fpathiter_5fgetcurrentnode',['le_pathIter_GetCurrentNode',['../le__path_iter_8h.html#ab00916d853b3a869748b0195cc2a8f11',1,'le_pathIter.h']]], ['le_5fpathiter_5fgetcurrentspecifier',['le_pathIter_GetCurrentSpecifier',['../le__path_iter_8h.html#ac12ea9bbe193fd9239abd10a4b07feba',1,'le_pathIter.h']]], ['le_5fpathiter_5fgetparentspecifier',['le_pathIter_GetParentSpecifier',['../le__path_iter_8h.html#af1707a310401be209aeada07f6d0f43f',1,'le_pathIter.h']]], ['le_5fpathiter_5fgetpath',['le_pathIter_GetPath',['../le__path_iter_8h.html#a4a1c39584a779518395b41f957765283',1,'le_pathIter.h']]], ['le_5fpathiter_5fgetseparator',['le_pathIter_GetSeparator',['../le__path_iter_8h.html#a586cd64de7f1a6797da3a17896946ee5',1,'le_pathIter.h']]], ['le_5fpathiter_5fgotoend',['le_pathIter_GoToEnd',['../le__path_iter_8h.html#ab1c0b90132171b3f3cf5cfb614329b13',1,'le_pathIter.h']]], ['le_5fpathiter_5fgotonext',['le_pathIter_GoToNext',['../le__path_iter_8h.html#ad83a619dcc34ecf03da1859b3da2f57f',1,'le_pathIter.h']]], ['le_5fpathiter_5fgotoprev',['le_pathIter_GoToPrev',['../le__path_iter_8h.html#a92a740759fe5c3b0a18e39dd8c73466b',1,'le_pathIter.h']]], ['le_5fpathiter_5fgotostart',['le_pathIter_GoToStart',['../le__path_iter_8h.html#af4352480ab3c9ffb09e740f2899d504e',1,'le_pathIter.h']]], ['le_5fpathiter_5fisabsolute',['le_pathIter_IsAbsolute',['../le__path_iter_8h.html#a657f779873a2220f463f705298c1399f',1,'le_pathIter.h']]], ['le_5fpathiter_5fisempty',['le_pathIter_IsEmpty',['../le__path_iter_8h.html#ab4ceddae696158d04fdbc1802614c5d6',1,'le_pathIter.h']]], ['le_5fpathiter_5ftruncate',['le_pathIter_Truncate',['../le__path_iter_8h.html#a04be1341536a3e330a815171e7cdbf7a',1,'le_pathIter.h']]], ['le_5fpos_5faddmovementhandler',['le_pos_AddMovementHandler',['../le__pos_8h.html#a17e99072772110c1609c53247d663ed3',1,'le_pos_AddMovementHandler(uint32_t horizontalMagnitude, uint32_t verticalMagnitude, le_pos_MovementHandlerFunc_t handlerPtr, void *contextPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#a17e99072772110c1609c53247d663ed3',1,'le_pos_AddMovementHandler(uint32_t horizontalMagnitude, uint32_t verticalMagnitude, le_pos_MovementHandlerFunc_t handlerPtr, void *contextPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fget2dlocation',['le_pos_Get2DLocation',['../le__pos_8h.html#a0aefc90df207f2e20286ea1be88e70d4',1,'le_pos_Get2DLocation(int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#a0aefc90df207f2e20286ea1be88e70d4',1,'le_pos_Get2DLocation(int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fget3dlocation',['le_pos_Get3DLocation',['../le__pos_8h.html#ad2e96a853c9e3d4daa351494ff2070ba',1,'le_pos_Get3DLocation(int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr, int32_t *altitudePtr, int32_t *vAccuracyPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#ad2e96a853c9e3d4daa351494ff2070ba',1,'le_pos_Get3DLocation(int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr, int32_t *altitudePtr, int32_t *vAccuracyPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fgetdirection',['le_pos_GetDirection',['../le__pos_8h.html#a2b5b4e4ce66c4f1653d6f0982bbd5feb',1,'le_pos_GetDirection(int32_t *directionPtr, int32_t *directionAccuracyPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#a2b5b4e4ce66c4f1653d6f0982bbd5feb',1,'le_pos_GetDirection(int32_t *directionPtr, int32_t *directionAccuracyPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fgetheading',['le_pos_GetHeading',['../le__pos_8h.html#ae06eaad71c152ade96d9b3f2e87a2053',1,'le_pos_GetHeading(int32_t *headingPtr, int32_t *headingAccuracyPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#ae06eaad71c152ade96d9b3f2e87a2053',1,'le_pos_GetHeading(int32_t *headingPtr, int32_t *headingAccuracyPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fgetmotion',['le_pos_GetMotion',['../le__pos_8h.html#a69a6e91e202212307928c5f4c77c6dee',1,'le_pos_GetMotion(uint32_t *hSpeedPtr, int32_t *hSpeedAccuracyPtr, int32_t *vSpeedPtr, int32_t *vSpeedAccuracyPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#a5b483fdcd812f4da7bdda284e9bb18b6',1,'le_pos_GetMotion(uint32_t *hSpeedPtrPtr, int32_t *hSpeedAccuracyPtrPtr, int32_t *vSpeedPtrPtr, int32_t *vSpeedAccuracyPtrPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fgetxtravalidity',['le_pos_GetXtraValidity',['../le__pos_8h.html#a210513dbbbef30c7fde8ab8f55691aef',1,'le_pos_GetXtraValidity(le_clk_Time_t *startTimePtr, le_clk_Time_t *stopTimePtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#a7ca6d67a5da10c85adf2538667263475',1,'le_pos_GetXtraValidity(le_clk_Time_t *startTimePtrPtr, le_clk_Time_t *stopTimePtrPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5floadxtra',['le_pos_LoadXtra',['../le__pos_8h.html#adbcfa164dc42afdf21e2ab0632dfdc01',1,'le_pos_LoadXtra(const char *xtraFilePathPtr):&#160;le_pos.h'],['../le__pos__interface_8h.html#adbcfa164dc42afdf21e2ab0632dfdc01',1,'le_pos_LoadXtra(const char *xtraFilePathPtr):&#160;le_pos_interface.h']]], ['le_5fpos_5fremovemovementhandler',['le_pos_RemoveMovementHandler',['../le__pos_8h.html#a7a6eb5f22a18be345deba506378450d6',1,'le_pos_RemoveMovementHandler(le_pos_MovementHandlerRef_t handlerRef):&#160;le_pos.h'],['../le__pos__interface_8h.html#a3c1b616489fc29fc578e58c6b570f14b',1,'le_pos_RemoveMovementHandler(le_pos_MovementHandlerRef_t addHandlerRef):&#160;le_pos_interface.h']]], ['le_5fpos_5fsample_5fget2dlocation',['le_pos_sample_Get2DLocation',['../le__pos_8h.html#ae7b3b16601465b663b468f12c63ea485',1,'le_pos_sample_Get2DLocation(le_pos_SampleRef_t positionSampleRef, int32_t *latitudePtr, int32_t *longitudePtr, int32_t *horizontalAccuracyPtr):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#ae7b3b16601465b663b468f12c63ea485',1,'le_pos_sample_Get2DLocation(le_pos_SampleRef_t positionSampleRef, int32_t *latitudePtr, int32_t *longitudePtr, int32_t *horizontalAccuracyPtr):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fgetaltitude',['le_pos_sample_GetAltitude',['../le__pos_8h.html#ac6c6868fdc51ce14492adfcd0d7274c0',1,'le_pos_sample_GetAltitude(le_pos_SampleRef_t positionSampleRef, int32_t *altitudePtr, int32_t *altitudeAccuracyPtr):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#ac6c6868fdc51ce14492adfcd0d7274c0',1,'le_pos_sample_GetAltitude(le_pos_SampleRef_t positionSampleRef, int32_t *altitudePtr, int32_t *altitudeAccuracyPtr):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fgetdirection',['le_pos_sample_GetDirection',['../le__pos_8h.html#ae42d09bb5146b52dd1f628a93611bc31',1,'le_pos_sample_GetDirection(le_pos_SampleRef_t positionSampleRef, int32_t *directionPtr, int32_t *directionAccuracyPtr):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#ae42d09bb5146b52dd1f628a93611bc31',1,'le_pos_sample_GetDirection(le_pos_SampleRef_t positionSampleRef, int32_t *directionPtr, int32_t *directionAccuracyPtr):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fgetheading',['le_pos_sample_GetHeading',['../le__pos_8h.html#a181f453d46f8b5440d91f2af1b4ebbfb',1,'le_pos_sample_GetHeading(le_pos_SampleRef_t positionSampleRef, int32_t *headingPtr, int32_t *headingAccuracyPtr):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#a181f453d46f8b5440d91f2af1b4ebbfb',1,'le_pos_sample_GetHeading(le_pos_SampleRef_t positionSampleRef, int32_t *headingPtr, int32_t *headingAccuracyPtr):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fgethorizontalspeed',['le_pos_sample_GetHorizontalSpeed',['../le__pos_8h.html#a29308a180145fa52e28fb65a4e13c11c',1,'le_pos_sample_GetHorizontalSpeed(le_pos_SampleRef_t positionSampleRef, uint32_t *hSpeedPtr, int32_t *hSpeedAccuracyPtr):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#a0bb7a30675f1dd7891b22c7753d7caec',1,'le_pos_sample_GetHorizontalSpeed(le_pos_SampleRef_t positionSampleRef, uint32_t *hspeedPtr, int32_t *hspeedAccuracyPtr):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fgetverticalspeed',['le_pos_sample_GetVerticalSpeed',['../le__pos_8h.html#aa55097a3a8936023ad2e1b6bc0af50b2',1,'le_pos_sample_GetVerticalSpeed(le_pos_SampleRef_t positionSampleRef, int32_t *vSpeedPtr, int32_t *vSpeedAccuracyPtr):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#a18162e15ad9a61696312745ec0bec1fd',1,'le_pos_sample_GetVerticalSpeed(le_pos_SampleRef_t positionSampleRef, int32_t *vspeedPtr, int32_t *vspeedAccuracyPtr):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5frelease',['le_pos_sample_Release',['../le__pos_8h.html#af2999e2e4f7eca899b2af1125547e3ea',1,'le_pos_sample_Release(le_pos_SampleRef_t positionSampleRef):&#160;le_pos.h'],['../le__pos__sample__interface_8h.html#af2999e2e4f7eca899b2af1125547e3ea',1,'le_pos_sample_Release(le_pos_SampleRef_t positionSampleRef):&#160;le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fstartclient',['le_pos_sample_StartClient',['../le__pos__sample__interface_8h.html#a2a8aa643c099df549fa91c6873338e96',1,'le_pos_sample_interface.h']]], ['le_5fpos_5fsample_5fstopclient',['le_pos_sample_StopClient',['../le__pos__sample__interface_8h.html#adad8eb9a23932e98d823f7b831631ac5',1,'le_pos_sample_interface.h']]], ['le_5fpos_5fstartclient',['le_pos_StartClient',['../le__pos__interface_8h.html#af37a3aa2b8c8cccd0cedb2013f7dd73a',1,'le_pos_interface.h']]], ['le_5fpos_5fstopclient',['le_pos_StopClient',['../le__pos__interface_8h.html#a310e17f67107316c8cb9aa321cda5fdd',1,'le_pos_interface.h']]], ['le_5fref_5fcreatemap',['le_ref_CreateMap',['../le__safe_ref_8h.html#a85faf3c75723a1af0e1adf720d9c9dca',1,'le_safeRef.h']]], ['le_5fref_5fcreateref',['le_ref_CreateRef',['../le__safe_ref_8h.html#a458597757cbce48e03413b49f52ec240',1,'le_safeRef.h']]], ['le_5fref_5fdeleteref',['le_ref_DeleteRef',['../le__safe_ref_8h.html#a438e18b8ace1d4dda3ca5144a27bd424',1,'le_safeRef.h']]], ['le_5fref_5fgetiterator',['le_ref_GetIterator',['../le__safe_ref_8h.html#ab7d9ebce866a3ad49a967e2eb8def2cc',1,'le_safeRef.h']]], ['le_5fref_5fgetsaferef',['le_ref_GetSafeRef',['../le__safe_ref_8h.html#a4028caac51066ef1e2a9988b0f84ab1e',1,'le_safeRef.h']]], ['le_5fref_5fgetvalue',['le_ref_GetValue',['../le__safe_ref_8h.html#a9c9273a94a0596516585240908853506',1,'le_safeRef.h']]], ['le_5fref_5flookup',['le_ref_Lookup',['../le__safe_ref_8h.html#a488dddfd579f4a20f39be392c4d7d2e0',1,'le_safeRef.h']]], ['le_5fref_5fnextnode',['le_ref_NextNode',['../le__safe_ref_8h.html#ac6304fc29d2ce7c82f5ca3b210931783',1,'le_safeRef.h']]], ['le_5fremotemgmt_5faddwakeupindichandler',['le_remoteMgmt_AddWakeUpIndicHandler',['../le__remote_mgmt_8h.html#aeff9f266b5841bb8c25707b3cecb9b64',1,'le_remoteMgmt.h']]], ['le_5fremotemgmt_5fcleardonotdisturbsign',['le_remoteMgmt_ClearDoNotDisturbSign',['../le__remote_mgmt_8h.html#a3ed93d6bb5ced5df0c126e3513842719',1,'le_remoteMgmt.h']]], ['le_5fremotemgmt_5fremovewakeupindichandler',['le_remoteMgmt_RemoveWakeUpIndicHandler',['../le__remote_mgmt_8h.html#a3cbbfd03c0c0cb5aaf47a42fac113be5',1,'le_remoteMgmt.h']]], ['le_5fremotemgmt_5fsetdonotdisturbsign',['le_remoteMgmt_SetDoNotDisturbSign',['../le__remote_mgmt_8h.html#a4f3a837945686c8963a8e8164b3a7aea',1,'le_remoteMgmt.h']]], ['le_5fsem_5fcreate',['le_sem_Create',['../le__semaphore_8h.html#add9fab5440abcff5a8bc3b8bd1126d99',1,'le_semaphore.h']]], ['le_5fsem_5fcreatetraceable',['le_sem_CreateTraceable',['../le__semaphore_8h.html#a27f805b9351bb5bb4a5fd6db6cbff982',1,'le_semaphore.h']]], ['le_5fsem_5fdelete',['le_sem_Delete',['../le__semaphore_8h.html#a96361b126f59934354ca17bf8b74b8f6',1,'le_semaphore.h']]], ['le_5fsem_5ffindsemaphore',['le_sem_FindSemaphore',['../le__semaphore_8h.html#a8932403a6f1425e42d4d3e2e61bafc4f',1,'le_semaphore.h']]], ['le_5fsem_5fgetvalue',['le_sem_GetValue',['../le__semaphore_8h.html#ac4858ccb0ba748ca463bb29807b75c05',1,'le_semaphore.h']]], ['le_5fsem_5fpost',['le_sem_Post',['../le__semaphore_8h.html#abb859411cc58fbcc576c986ef52083b2',1,'le_semaphore.h']]], ['le_5fsem_5ftrywait',['le_sem_TryWait',['../le__semaphore_8h.html#a6a6c435042dd37a3c78ebbab6ec72689',1,'le_semaphore.h']]], ['le_5fsem_5fwait',['le_sem_Wait',['../le__semaphore_8h.html#aecdf87fe330dd008771b7530edbb1f2b',1,'le_semaphore.h']]], ['le_5fsem_5fwaitwithtimeout',['le_sem_WaitWithTimeOut',['../le__semaphore_8h.html#a14475f0c2f5483427279d39220f55eaa',1,'le_semaphore.h']]], ['le_5fsig_5fdeleteall',['le_sig_DeleteAll',['../le__signals_8h.html#ae921df0e028ec66f4920cf3ed655d398',1,'le_signals.h']]], ['le_5fsig_5fseteventhandler',['le_sig_SetEventHandler',['../le__signals_8h.html#a421910132f193dae70e8309dc86a86c4',1,'le_signals.h']]], ['le_5fsim_5faddnewstatehandler',['le_sim_AddNewStateHandler',['../le__sim_8h.html#a4965e5346ff67093f41f858341cbaf41',1,'le_sim_AddNewStateHandler(le_sim_NewStateHandlerFunc_t handlerFuncPtr, void *contextPtr):&#160;le_sim.h'],['../sim__interface_8h.html#a8e296a7cd35edd99cb1dc21232e280dd',1,'le_sim_AddNewStateHandler(le_sim_NewStateHandlerFunc_t handlerPtr, void *contextPtr):&#160;sim_interface.h']]], ['le_5fsim_5fchangepin',['le_sim_ChangePIN',['../le__sim_8h.html#ae344afecde57adf76afdaa9ecc9547a7',1,'le_sim_ChangePIN(le_sim_Ref_t simRef, const char *oldpinPtr, const char *newpinPtr):&#160;le_sim.h'],['../sim__interface_8h.html#a12a4cb132d59cbadbff64df17c057d30',1,'le_sim_ChangePIN(le_sim_Ref_t simRef, const char *oldpin, const char *newpin):&#160;sim_interface.h']]], ['le_5fsim_5fcountslots',['le_sim_CountSlots',['../le__sim_8h.html#a106e220e84b5aec759b036a171eaed8e',1,'le_sim_CountSlots(void):&#160;le_sim.h'],['../sim__interface_8h.html#a106e220e84b5aec759b036a171eaed8e',1,'le_sim_CountSlots(void):&#160;sim_interface.h']]], ['le_5fsim_5fcreate',['le_sim_Create',['../le__sim_8h.html#ad853288e065e5bb8463b71c929d947fd',1,'le_sim_Create(uint32_t cardNum):&#160;le_sim.h'],['../sim__interface_8h.html#ad853288e065e5bb8463b71c929d947fd',1,'le_sim_Create(uint32_t cardNum):&#160;sim_interface.h']]], ['le_5fsim_5fdelete',['le_sim_Delete',['../le__sim_8h.html#a55d30a893f5784907edd9564f84f3124',1,'le_sim_Delete(le_sim_Ref_t simRef):&#160;le_sim.h'],['../sim__interface_8h.html#a55d30a893f5784907edd9564f84f3124',1,'le_sim_Delete(le_sim_Ref_t simRef):&#160;sim_interface.h']]], ['le_5fsim_5fenterpin',['le_sim_EnterPIN',['../le__sim_8h.html#af4e4828f4181c8b695074b5806797172',1,'le_sim_EnterPIN(le_sim_Ref_t simRef, const char *pinPtr):&#160;le_sim.h'],['../sim__interface_8h.html#ada32d1326d6bb43825625deca9c451a3',1,'le_sim_EnterPIN(le_sim_Ref_t simRef, const char *pin):&#160;sim_interface.h']]], ['le_5fsim_5fgeticcid',['le_sim_GetICCID',['../le__sim_8h.html#acef5700d445ccc47de83197b68a212fa',1,'le_sim_GetICCID(le_sim_Ref_t simRef, char *iccidPtr, size_t iccidLen):&#160;le_sim.h'],['../sim__interface_8h.html#a0f1f00bfe9aefb272578d159b10a3f11',1,'le_sim_GetICCID(le_sim_Ref_t simRef, char *iccid, size_t iccidNumElements):&#160;sim_interface.h']]], ['le_5fsim_5fgetimsi',['le_sim_GetIMSI',['../le__sim_8h.html#acaeb7a5d24d3e87596f484d8495e20ac',1,'le_sim_GetIMSI(le_sim_Ref_t simRef, char *imsiPtr, size_t imsiLen):&#160;le_sim.h'],['../sim__interface_8h.html#a2ccc9de4f6d6ed25d852bb078f11a5c7',1,'le_sim_GetIMSI(le_sim_Ref_t simRef, char *imsi, size_t imsiNumElements):&#160;sim_interface.h']]], ['le_5fsim_5fgetremainingpintries',['le_sim_GetRemainingPINTries',['../le__sim_8h.html#ab06e750ac70edcc31ddd0a10ee48197c',1,'le_sim_GetRemainingPINTries(le_sim_Ref_t simRef):&#160;le_sim.h'],['../sim__interface_8h.html#ab06e750ac70edcc31ddd0a10ee48197c',1,'le_sim_GetRemainingPINTries(le_sim_Ref_t simRef):&#160;sim_interface.h']]], ['le_5fsim_5fgetselectedcard',['le_sim_GetSelectedCard',['../le__sim_8h.html#af61ce2885fb5b0cc60b857abe98dac56',1,'le_sim_GetSelectedCard(void):&#160;le_sim.h'],['../sim__interface_8h.html#af61ce2885fb5b0cc60b857abe98dac56',1,'le_sim_GetSelectedCard(void):&#160;sim_interface.h']]], ['le_5fsim_5fgetslotnumber',['le_sim_GetSlotNumber',['../le__sim_8h.html#ac7ad43d5b65ea51229d82e53dbff3864',1,'le_sim_GetSlotNumber(le_sim_Ref_t simRef):&#160;le_sim.h'],['../sim__interface_8h.html#ac7ad43d5b65ea51229d82e53dbff3864',1,'le_sim_GetSlotNumber(le_sim_Ref_t simRef):&#160;sim_interface.h']]], ['le_5fsim_5fgetstate',['le_sim_GetState',['../le__sim_8h.html#af7546b1e1f0e9689996fd399d0597f5c',1,'le_sim_GetState(le_sim_Ref_t simRef):&#160;le_sim.h'],['../sim__interface_8h.html#af7546b1e1f0e9689996fd399d0597f5c',1,'le_sim_GetState(le_sim_Ref_t simRef):&#160;sim_interface.h']]], ['le_5fsim_5fgetsubscriberphonenumber',['le_sim_GetSubscriberPhoneNumber',['../le__sim_8h.html#a6bfacd0e20000925a532d157538c6cb8',1,'le_sim_GetSubscriberPhoneNumber(le_sim_Ref_t simRef, char *phoneNumberStr, size_t phoneNumberStrSize):&#160;le_sim.h'],['../sim__interface_8h.html#a3069866e25aa5999e523748ba0428c77',1,'le_sim_GetSubscriberPhoneNumber(le_sim_Ref_t simRef, char *phoneNumberStr, size_t phoneNumberStrNumElements):&#160;sim_interface.h']]], ['le_5fsim_5fispresent',['le_sim_IsPresent',['../le__sim_8h.html#abf0f3927a8eb4c576cfe19b2331acd89',1,'le_sim_IsPresent(le_sim_Ref_t simRef):&#160;le_sim.h'],['../sim__interface_8h.html#abf0f3927a8eb4c576cfe19b2331acd89',1,'le_sim_IsPresent(le_sim_Ref_t simRef):&#160;sim_interface.h']]], ['le_5fsim_5fisready',['le_sim_IsReady',['../le__sim_8h.html#a18fcea4abbaf79d0e22c0cc29293ee5a',1,'le_sim_IsReady(le_sim_Ref_t simRef):&#160;le_sim.h'],['../sim__interface_8h.html#a18fcea4abbaf79d0e22c0cc29293ee5a',1,'le_sim_IsReady(le_sim_Ref_t simRef):&#160;sim_interface.h']]], ['le_5fsim_5flock',['le_sim_Lock',['../le__sim_8h.html#a8b2e681142e99eb71bc7587597dbd34d',1,'le_sim_Lock(le_sim_Ref_t simRef, const char *pinPtr):&#160;le_sim.h'],['../sim__interface_8h.html#a028cf420a1453e7360f059e64402c197',1,'le_sim_Lock(le_sim_Ref_t simRef, const char *pin):&#160;sim_interface.h']]], ['le_5fsim_5fremovenewstatehandler',['le_sim_RemoveNewStateHandler',['../le__sim_8h.html#a0286578e9aa46ba864df1878263b9f84',1,'le_sim_RemoveNewStateHandler(le_sim_NewStateHandlerRef_t handlerRef):&#160;le_sim.h'],['../sim__interface_8h.html#a8e3a4e2e978cf4931a39317ee5e9f762',1,'le_sim_RemoveNewStateHandler(le_sim_NewStateHandlerRef_t addHandlerRef):&#160;sim_interface.h']]], ['le_5fsim_5fstartclient',['le_sim_StartClient',['../sim__interface_8h.html#a2cbe74a5bea163889082eb5e578606d0',1,'sim_interface.h']]], ['le_5fsim_5fstopclient',['le_sim_StopClient',['../sim__interface_8h.html#ae7fc0246c6aaf8d4baa3a5ebe700f3fc',1,'sim_interface.h']]], ['le_5fsim_5funblock',['le_sim_Unblock',['../le__sim_8h.html#a860afd729cf750bc6526559eb097d542',1,'le_sim_Unblock(le_sim_Ref_t simRef, const char *pukPtr, const char *newpinPtr):&#160;le_sim.h'],['../sim__interface_8h.html#a9d49c069735bef00d513f18be10323bf',1,'le_sim_Unblock(le_sim_Ref_t simRef, const char *puk, const char *newpin):&#160;sim_interface.h']]], ['le_5fsim_5funlock',['le_sim_Unlock',['../le__sim_8h.html#aa84bb7139a46932a85a9b055d2d77372',1,'le_sim_Unlock(le_sim_Ref_t simRef, const char *pinPtr):&#160;le_sim.h'],['../sim__interface_8h.html#a536c71c08e6b1b5d6c717ae6a6f21dfb',1,'le_sim_Unlock(le_sim_Ref_t simRef, const char *pin):&#160;sim_interface.h']]], ['le_5fsls_5faddafter',['le_sls_AddAfter',['../le__singly_linked_list_8h.html#a69f5c789a64d372bb61b173c4418b14b',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fisempty',['le_sls_IsEmpty',['../le__singly_linked_list_8h.html#a8f59b1a42d967d018e301f7b7f2d55ae',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fisinlist',['le_sls_IsInList',['../le__singly_linked_list_8h.html#a253a443ee79c169462f64551b40f2dd7',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fislistcorrupted',['le_sls_IsListCorrupted',['../le__singly_linked_list_8h.html#a871361a091418784f524090d5515a98f',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fnumlinks',['le_sls_NumLinks',['../le__singly_linked_list_8h.html#a33feea925d3a247531c4796aba93f6fa',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fpeek',['le_sls_Peek',['../le__singly_linked_list_8h.html#a63e301829d4a513c97dbda3943efa791',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fpeeknext',['le_sls_PeekNext',['../le__singly_linked_list_8h.html#aed118352d62f4df6301040bc1cd26431',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fpop',['le_sls_Pop',['../le__singly_linked_list_8h.html#a85f5132147870e260b3b142665ec587e',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fqueue',['le_sls_Queue',['../le__singly_linked_list_8h.html#afb5e8ffc3fb5c0d86eb47d0885a6f546',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fremoveafter',['le_sls_RemoveAfter',['../le__singly_linked_list_8h.html#afe3717aca964a13cdc8e9bf234dea6fc',1,'le_singlyLinkedList.h']]], ['le_5fsls_5fstack',['le_sls_Stack',['../le__singly_linked_list_8h.html#aca4266a87d4c5e3dca130cd5d48b99af',1,'le_singlyLinkedList.h']]], ['le_5fsms_5fmsg_5faddrxmessagehandler',['le_sms_msg_AddRxMessageHandler',['../le__sms_8h.html#a9c2bcb812602f52b3adcf80ff2d6d354',1,'le_sms_msg_AddRxMessageHandler(le_sms_msg_RxMessageHandlerFunc_t handlerFuncPtr, void *contextPtr):&#160;le_sms.h'],['../sms__interface_8h.html#a09010777e9b920ff50e901c5fdc5e7dd',1,'le_sms_msg_AddRxMessageHandler(le_sms_msg_RxMessageHandlerFunc_t handlerPtr, void *contextPtr):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fcreate',['le_sms_msg_Create',['../le__sms_8h.html#a56f5c913912acfd28d1fdc7c996e0295',1,'le_sms_msg_Create(void):&#160;le_sms.h'],['../sms__interface_8h.html#a56f5c913912acfd28d1fdc7c996e0295',1,'le_sms_msg_Create(void):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fcreaterxmsglist',['le_sms_msg_CreateRxMsgList',['../le__sms_8h.html#a7ceb32b464883ba2c9573f5fb7b29113',1,'le_sms_msg_CreateRxMsgList(void):&#160;le_sms.h'],['../sms__interface_8h.html#a7ceb32b464883ba2c9573f5fb7b29113',1,'le_sms_msg_CreateRxMsgList(void):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fdelete',['le_sms_msg_Delete',['../le__sms_8h.html#ad8412741c747ec366c3df403029c3b95',1,'le_sms_msg_Delete(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#ad8412741c747ec366c3df403029c3b95',1,'le_sms_msg_Delete(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fdeletefromstorage',['le_sms_msg_DeleteFromStorage',['../le__sms_8h.html#adee6a8ba0f060ae12e0b3d951a07dd01',1,'le_sms_msg_DeleteFromStorage(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#adee6a8ba0f060ae12e0b3d951a07dd01',1,'le_sms_msg_DeleteFromStorage(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fdeletelist',['le_sms_msg_DeleteList',['../le__sms_8h.html#ae811a178b7f1b42d0d417ab21259435c',1,'le_sms_msg_DeleteList(le_sms_msg_ListRef_t msgListRef):&#160;le_sms.h'],['../sms__interface_8h.html#ae811a178b7f1b42d0d417ab21259435c',1,'le_sms_msg_DeleteList(le_sms_msg_ListRef_t msgListRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetbinary',['le_sms_msg_GetBinary',['../le__sms_8h.html#aa2ef747e0d4b4a825ad9795f74cb094e',1,'le_sms_msg_GetBinary(le_sms_msg_Ref_t msgRef, uint8_t *binPtr, size_t *lenPtr):&#160;le_sms.h'],['../sms__interface_8h.html#a28f8127bc599f65c4006131243265e4e',1,'le_sms_msg_GetBinary(le_sms_msg_Ref_t msgRef, uint8_t *binPtr, size_t *binNumElementsPtr):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetfirst',['le_sms_msg_GetFirst',['../le__sms_8h.html#a7b00a9995304275e4a307483db831aae',1,'le_sms_msg_GetFirst(le_sms_msg_ListRef_t msgListRef):&#160;le_sms.h'],['../sms__interface_8h.html#a7b00a9995304275e4a307483db831aae',1,'le_sms_msg_GetFirst(le_sms_msg_ListRef_t msgListRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetformat',['le_sms_msg_GetFormat',['../le__sms_8h.html#a17d6b6939cd107f57b7f95e2b4699d0b',1,'le_sms_msg_GetFormat(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#a17d6b6939cd107f57b7f95e2b4699d0b',1,'le_sms_msg_GetFormat(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetnext',['le_sms_msg_GetNext',['../le__sms_8h.html#a5b6abace280b50c402b5716052b665a9',1,'le_sms_msg_GetNext(le_sms_msg_ListRef_t msgListRef):&#160;le_sms.h'],['../sms__interface_8h.html#a5b6abace280b50c402b5716052b665a9',1,'le_sms_msg_GetNext(le_sms_msg_ListRef_t msgListRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetpdu',['le_sms_msg_GetPDU',['../le__sms_8h.html#a1c5363ab2e9814af2720164fcd483f2f',1,'le_sms_msg_GetPDU(le_sms_msg_Ref_t msgRef, uint8_t *pduPtr, size_t *lenPtr):&#160;le_sms.h'],['../sms__interface_8h.html#a85a77bd7394febabb059aa868b9d600c',1,'le_sms_msg_GetPDU(le_sms_msg_Ref_t msgRef, uint8_t *pduPtr, size_t *pduNumElementsPtr):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetpdulen',['le_sms_msg_GetPDULen',['../le__sms_8h.html#a32762ec20cb037e123bb19303d6d4212',1,'le_sms_msg_GetPDULen(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#a32762ec20cb037e123bb19303d6d4212',1,'le_sms_msg_GetPDULen(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetsendertel',['le_sms_msg_GetSenderTel',['../le__sms_8h.html#a6556a1da7f176836c68ba0b66f8a94d7',1,'le_sms_msg_GetSenderTel(le_sms_msg_Ref_t msgRef, char *telPtr, size_t len):&#160;le_sms.h'],['../sms__interface_8h.html#ac4399d82d05069b5780eb184371497ee',1,'le_sms_msg_GetSenderTel(le_sms_msg_Ref_t msgRef, char *tel, size_t telNumElements):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetstatus',['le_sms_msg_GetStatus',['../le__sms_8h.html#a6fed5c39592ddf0b1a9cdf4d749e77ae',1,'le_sms_msg_GetStatus(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#a6fed5c39592ddf0b1a9cdf4d749e77ae',1,'le_sms_msg_GetStatus(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgettext',['le_sms_msg_GetText',['../le__sms_8h.html#a1b1215728797edfc926bf1348311060c',1,'le_sms_msg_GetText(le_sms_msg_Ref_t msgRef, char *textPtr, size_t len):&#160;le_sms.h'],['../sms__interface_8h.html#aca3b65a120a4d83a3298ec7eeb42327e',1,'le_sms_msg_GetText(le_sms_msg_Ref_t msgRef, char *text, size_t textNumElements):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgettimestamp',['le_sms_msg_GetTimeStamp',['../le__sms_8h.html#ae67c6ba33603fc1766e7fbd7f02731e9',1,'le_sms_msg_GetTimeStamp(le_sms_msg_Ref_t msgRef, char *timestampPtr, size_t len):&#160;le_sms.h'],['../sms__interface_8h.html#a0b694927cfbcbcd9b36895599dc2d682',1,'le_sms_msg_GetTimeStamp(le_sms_msg_Ref_t msgRef, char *timestamp, size_t timestampNumElements):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fgetuserdatalen',['le_sms_msg_GetUserdataLen',['../le__sms_8h.html#a55622fddf87b35405d1e48c0e90cb592',1,'le_sms_msg_GetUserdataLen(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#a55622fddf87b35405d1e48c0e90cb592',1,'le_sms_msg_GetUserdataLen(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fmarkread',['le_sms_msg_MarkRead',['../le__sms_8h.html#a60f3ae08f75d9792b73ec77e855ce2e8',1,'le_sms_msg_MarkRead(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#a60f3ae08f75d9792b73ec77e855ce2e8',1,'le_sms_msg_MarkRead(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fmarkunread',['le_sms_msg_MarkUnread',['../le__sms_8h.html#a1211b0b7c4eaeaf0935dc70f9efd1e20',1,'le_sms_msg_MarkUnread(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#a1211b0b7c4eaeaf0935dc70f9efd1e20',1,'le_sms_msg_MarkUnread(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fremoverxmessagehandler',['le_sms_msg_RemoveRxMessageHandler',['../le__sms_8h.html#af69c0fa7d191157207e677c67bab4a35',1,'le_sms_msg_RemoveRxMessageHandler(le_sms_msg_RxMessageHandlerRef_t handlerRef):&#160;le_sms.h'],['../sms__interface_8h.html#aa6a23c731fc1c5ac426e03f4493a6bdc',1,'le_sms_msg_RemoveRxMessageHandler(le_sms_msg_RxMessageHandlerRef_t addHandlerRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fsend',['le_sms_msg_Send',['../le__sms_8h.html#afc8256b53cd7e528f7e0736b2e6e3faa',1,'le_sms_msg_Send(le_sms_msg_Ref_t msgRef):&#160;le_sms.h'],['../sms__interface_8h.html#afc8256b53cd7e528f7e0736b2e6e3faa',1,'le_sms_msg_Send(le_sms_msg_Ref_t msgRef):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fsetbinary',['le_sms_msg_SetBinary',['../le__sms_8h.html#ac3ba825778c49e0b6966134833c6160a',1,'le_sms_msg_SetBinary(le_sms_msg_Ref_t msg, const uint8_t *binPtr, size_t len):&#160;le_sms.h'],['../sms__interface_8h.html#a3cac8ea6334ec7843261a85f9b54e3fc',1,'le_sms_msg_SetBinary(le_sms_msg_Ref_t msgRef, const uint8_t *binPtr, size_t binNumElements):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fsetdestination',['le_sms_msg_SetDestination',['../le__sms_8h.html#afee6b2eb05e5c56a82837bd3f8d43371',1,'le_sms_msg_SetDestination(le_sms_msg_Ref_t msgRef, const char *destPtr):&#160;le_sms.h'],['../sms__interface_8h.html#a690f7e4d78afd8d3f6c2c6e045949a33',1,'le_sms_msg_SetDestination(le_sms_msg_Ref_t msgRef, const char *dest):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fsetpdu',['le_sms_msg_SetPDU',['../le__sms_8h.html#af748aa957c534332f510a8ddc470f81b',1,'le_sms_msg_SetPDU(le_sms_msg_Ref_t msgRef, const uint8_t *pduPtr, size_t len):&#160;le_sms.h'],['../sms__interface_8h.html#a6f68f9cb1b42e3965acb5f2827b2fd60',1,'le_sms_msg_SetPDU(le_sms_msg_Ref_t msgRef, const uint8_t *pduPtr, size_t pduNumElements):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fsettext',['le_sms_msg_SetText',['../le__sms_8h.html#abe60284e9c441636527dfb9da448eb04',1,'le_sms_msg_SetText(le_sms_msg_Ref_t msgRef, const char *textPtr):&#160;le_sms.h'],['../sms__interface_8h.html#a5e994cd0b3b89a0f8d00bc241e87e1f2',1,'le_sms_msg_SetText(le_sms_msg_Ref_t msgRef, const char *text):&#160;sms_interface.h']]], ['le_5fsms_5fmsg_5fstartclient',['le_sms_msg_StartClient',['../sms__interface_8h.html#a0bb1da2ff579935a07c71bbd306c565b',1,'sms_interface.h']]], ['le_5fsms_5fmsg_5fstopclient',['le_sms_msg_StopClient',['../sms__interface_8h.html#aa0ee22d031267b0d4be3ea1652065b31',1,'sms_interface.h']]], ['le_5fthread_5faddchilddestructor',['le_thread_AddChildDestructor',['../le__thread_8h.html#a671dbe2927a3b2a13c5150476398f34f',1,'le_thread.h']]], ['le_5fthread_5fadddestructor',['le_thread_AddDestructor',['../le__thread_8h.html#aa85ee32cc06f219f3c619104f4d97932',1,'le_thread.h']]], ['le_5fthread_5fcancel',['le_thread_Cancel',['../le__thread_8h.html#a0f1c1b98f354a96e6e31e55a71b58f6a',1,'le_thread.h']]], ['le_5fthread_5fcreate',['le_thread_Create',['../le__thread_8h.html#a87e02a46f92e9e3e11ed28a2b265872f',1,'le_thread.h']]], ['le_5fthread_5fexit',['le_thread_Exit',['../le__thread_8h.html#a6b8e349107ae6628ed8807588f044faa',1,'le_thread.h']]], ['le_5fthread_5fgetcurrent',['le_thread_GetCurrent',['../le__thread_8h.html#a90a9d67db26f816fd1e1032d74a24fcd',1,'le_thread.h']]], ['le_5fthread_5fgetmyname',['le_thread_GetMyName',['../le__thread_8h.html#a41c366f881ee31d38de011adb44af12b',1,'le_thread.h']]], ['le_5fthread_5fgetname',['le_thread_GetName',['../le__thread_8h.html#ab4834a35f1afc1f353fc3c808a5ab6a2',1,'le_thread.h']]], ['le_5fthread_5fjoin',['le_thread_Join',['../le__thread_8h.html#adf7f24fec4859ca12a52b16ce43fd9b8',1,'le_thread.h']]], ['le_5fthread_5fsetjoinable',['le_thread_SetJoinable',['../le__thread_8h.html#a8959f09f66f365916a6a4fbdaf36cf65',1,'le_thread.h']]], ['le_5fthread_5fsetpriority',['le_thread_SetPriority',['../le__thread_8h.html#a95257a2f60cacdadc787647453b77356',1,'le_thread.h']]], ['le_5fthread_5fsetstacksize',['le_thread_SetStackSize',['../le__thread_8h.html#a91d0476fe2ddd834c39b194164a665b7',1,'le_thread.h']]], ['le_5fthread_5fstart',['le_thread_Start',['../le__thread_8h.html#a38df3877ee5ab9fac17b2fc0be46c27e',1,'le_thread.h']]], ['le_5ftimer_5fcreate',['le_timer_Create',['../le__timer_8h.html#aee41169a210378b369f440cf99146522',1,'le_timer.h']]], ['le_5ftimer_5fdelete',['le_timer_Delete',['../le__timer_8h.html#ae103f6736bf855e77e5e59bbad1e27a7',1,'le_timer.h']]], ['le_5ftimer_5fgetcontextptr',['le_timer_GetContextPtr',['../le__timer_8h.html#aa0432dbabb32b546c0c0e6ced5ba9d3d',1,'le_timer.h']]], ['le_5ftimer_5fgetexpirycount',['le_timer_GetExpiryCount',['../le__timer_8h.html#a554cff1d11525bb60115291248f3ff53',1,'le_timer.h']]], ['le_5ftimer_5fisrunning',['le_timer_IsRunning',['../le__timer_8h.html#ab33b8568fd394d38274b778130111f70',1,'le_timer.h']]], ['le_5ftimer_5frestart',['le_timer_Restart',['../le__timer_8h.html#ab6b83d6302095a46b6046160c0a479bb',1,'le_timer.h']]], ['le_5ftimer_5fsetcontextptr',['le_timer_SetContextPtr',['../le__timer_8h.html#af6900bdb4653ff95f7f7be918b9e482d',1,'le_timer.h']]], ['le_5ftimer_5fsethandler',['le_timer_SetHandler',['../le__timer_8h.html#abbf8d4c3c78d7bf5801b94071adcb6c6',1,'le_timer.h']]], ['le_5ftimer_5fsetinterval',['le_timer_SetInterval',['../le__timer_8h.html#a0a103d5cef5e83fc9088859d527bbd43',1,'le_timer.h']]], ['le_5ftimer_5fsetrepeat',['le_timer_SetRepeat',['../le__timer_8h.html#a292b0a7d6dc0796a36a54fd04c6a7eeb',1,'le_timer.h']]], ['le_5ftimer_5fstart',['le_timer_Start',['../le__timer_8h.html#ada2ce7f8cb1e76ed959e323ae94bbfc0',1,'le_timer.h']]], ['le_5ftimer_5fstop',['le_timer_Stop',['../le__timer_8h.html#af310daa378bd6ca39373a47e073f2243',1,'le_timer.h']]], ['le_5futf8_5fappend',['le_utf8_Append',['../le__utf8_8h.html#ade7dfb60b18574dc62c49b86c025579b',1,'le_utf8.h']]], ['le_5futf8_5fcopy',['le_utf8_Copy',['../le__utf8_8h.html#aa5ae72c01396c106fdf3b4741ead7477',1,'le_utf8.h']]], ['le_5futf8_5fcopyuptosubstr',['le_utf8_CopyUpToSubStr',['../le__utf8_8h.html#a6a8d87c8096a43244f6c77598bd1fb82',1,'le_utf8.h']]], ['le_5futf8_5fisformatcorrect',['le_utf8_IsFormatCorrect',['../le__utf8_8h.html#acffd959e1c6dcf9841217c1c0f6d09e5',1,'le_utf8.h']]], ['le_5futf8_5fnumbytes',['le_utf8_NumBytes',['../le__utf8_8h.html#a2541a26cade8cef93db889194a430008',1,'le_utf8.h']]], ['le_5futf8_5fnumchars',['le_utf8_NumChars',['../le__utf8_8h.html#af8f61f1aa523b03d02d6a89cb61449e2',1,'le_utf8.h']]] ];
legatoproject/legato-docs
14_04_1/search/functions_6c.js
JavaScript
mpl-2.0
98,371
/*global sinon, assert, suite, setup, teardown, test */ suite('test-utils', function() { 'use strict'; var utils = window['test-utils']; setup(function() { this.sinon = sinon.sandbox.create(); this.dom = document.createElement('div'); document.body.appendChild(this.dom); }); teardown(function() { this.sinon.restore(); }); test('accessibility', function(done) { var accessibility = utils.accessibility; assert.ok(accessibility); assert.ok(accessibility.check); accessibility.check(this.dom).then(done, done); }); test('afterNext', function(done) { var obj = { test: function() { assert.ok(true, 'obj.test is called'); return true; } }; utils.afterNext(obj, 'test') .then(result => assert.ok(result)) .then(done, done); setTimeout(() => obj.test(), 1); }); test('touch', function(done) { var type = 'touchstart', x = 1, y = 2; this.dom.addEventListener('touchstart', event => { assert.equal(event.type, type); assert.ok(event.timeStamp); assert.isTrue(event.bubbles); assert.isTrue(event.cancelable); assert.equal(event.touches.length, 1); var touch = event.touches[0]; assert.equal(touch.pageX, x); assert.equal(touch.pageY, y); done(); }); utils.touch(this.dom, type, x, y); }); });
yzen/test-utils
test/test.js
JavaScript
mpl-2.0
1,376
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package tools.proxy.saml; /** * * @author JL06436S */ public interface Runnable { void run(String[] args) throws Exception; }
jlamandecap/saml-assertion-tools
proxy-saml/src/main/java/tools/proxy/saml/Runnable.java
Java
mpl-2.0
341
let _ = function (type, props, children) { let elem = null; if (type === "text") { return document.createTextNode(props); } else { elem = document.createElement(type); } for (let n in props) { if (n === "style") { for (let x in props.style) { elem.style[x] = props.style[x]; } } else if (n === "className") { elem.className = props[n]; } else if (n === "event") { for (let x in props.event) { elem.addEventListener(x, props.event[x]); } } else { elem.setAttribute(n, props[n]); } } if (children) { for (let i = 0; i < children.length; i++) { if (children[i] != null) elem.appendChild(children[i]); } } return elem; }; let isChrome = /chrome/i.test(navigator.userAgent); let _t = function (s) { return chrome.i18n.getMessage(s) }; let firefoxVer = 0; if (!isChrome) { firefoxVer = (navigator.userAgent.match(/Firefox\/(\d+)/) || [, 0])[1]; } function readStorage(name, cb) { if (!isChrome && firefoxVer < 53) //ff52-无sync chrome.storage.local.get(name, cb) else chrome.storage.sync.get(name, cb) } function saveStorage(save) { if (!isChrome && firefoxVer < 53) chrome.storage.local.set(save); else chrome.storage.sync.set(save); } function getCookie(name) { let cookies = {}; document.cookie.split('; ').forEach(function (i) { let [key, ...val] = i.split('='); cookies[key] = val.join('='); }); return cookies[name] || ''; }
esterTion/Youku-HTML5-Player
src/dom_gen.js
JavaScript
mpl-2.0
1,715
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2008-2015 MonetDB B.V. */ #ifndef _SEEN_PROPERTIES_H #define _SEEN_PROPERTIES_H 1 #include "utils.h" #define MEROPROPFILE ".merovingian_properties" confkeyval *getDefaultProps(void); int writeProps(confkeyval *ckv, const char *path); void writePropsBuf(confkeyval *ckv, char **buf); int readProps(confkeyval *ckv, const char *path); int readAllProps(confkeyval *ckv, const char *path); void readPropsBuf(confkeyval *ckv, char *buf); char *setProp(char *path, char *key, char *val); #endif /* vim:set ts=4 sw=4 noexpandtab: */
zyzyis/monetdb
tools/merovingian/utils/properties.h
C
mpl-2.0
755
package minejava.reg.io; import minejava.reg.lang.IndexOutOfBoundsException; import minejava.reg.lang.Math; import minejava.reg.lang.NullPointerException; import minejava.reg.lang.System; public class ByteArrayInputStream extends InputStream{ protected byte buf[]; protected int pos; protected int mark = 0; protected int count; public ByteArrayInputStream(byte buf[]){ this.buf = buf; this.pos = 0; this.count = buf.length; } public ByteArrayInputStream(byte buf[], int offset, int length){ this.buf = buf; this.pos = offset; this.count = Math.min(offset + length, buf.length); this.mark = offset; } public synchronized int read(){ return (pos < count) ? (buf[pos++] & 0xff) : -1; } public synchronized int read(byte b[], int off, int len){ if (b == null){ throw new NullPointerException(); }else if (off < 0 || len < 0 || len > b.length - off){ throw new IndexOutOfBoundsException(); } if (pos >= count){ return -1; } int avail = count - pos; if (len > avail){ len = avail; } if (len <= 0){ return 0; } System.arraycopy(buf, pos, b, off, len); pos += len; return len; } public synchronized long skip(long n){ long k = count - pos; if (n < k){ k = n < 0 ? 0 : n; } pos += k; return k; } public synchronized int available(){ return count - pos; } public boolean markSupported(){ return true; } public void mark(int readAheadLimit){ mark = pos; } public synchronized void reset(){ pos = mark; } public void close() throws IOException{ } }
cFerg/MineJava
src/main/java/minejava/reg/io/ByteArrayInputStream.java
Java
mpl-2.0
1,865
/******************************************************************************* * Poor Man's CMS (pmcms) - A very basic CMS generating static html pages. * http://poormans.sourceforge.net * Copyright (C) 2004-2013 by Thilo Schwarz * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * http://www.gnu.org/licenses/lgpl.html * * - Mozilla Public License Version 1.1 or later (the "MPL") * http://www.mozilla.org/MPL/MPL-1.1.html * * == END LICENSE == ******************************************************************************/ package de.thischwa.pmcms.conf; import java.util.Properties; import org.springframework.stereotype.Component; import de.thischwa.pmcms.tool.PropertiesTool; @Component public class PropertiesManager { private Properties props; private Properties defaultSiteProps; private Properties siteProps; public void setProperties(final Properties props) { defaultSiteProps = PropertiesTool.getProperties(props, "pmcms.site"); siteProps = new Properties(defaultSiteProps); this.props = props; } public void setSiteProperties(final Properties siteProps) { this.siteProps = new Properties(defaultSiteProps); this.siteProps.putAll(siteProps); } public String getProperty(final String key) { return props.getProperty(key); } public String getSiteProperty(final String key) { return (siteProps.containsKey(key)) ? siteProps.getProperty(key) : defaultSiteProps.getProperty(key); } public Properties getVelocityProperties() { return PropertiesTool.getProperties(props, "velocity", true); } Properties getAllProperties() { return props; } }
th-schwarz/pmcms
src/main/java/de/thischwa/pmcms/conf/PropertiesManager.java
Java
mpl-2.0
1,751
/* ***** BEGIN LICENCE BLOCK ***** * Version: MPL 2.0 * * This Source Code Form is subject to the terms of the Mozilla Public License, * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at http://mozilla.org/MPL/2.0/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Celtx Script Manager. * * The Initial Developer of the Original Code is 4067479 Canada Inc. * t/a CELTX. * * Portions created by Celtx are Copyright (C) 4067479 Canada Inc. All * Rights Reserved. * * Contributor(s): * ***** END LICENCE BLOCK ***** */ @media screen { span.camera, span.lights, span.electrics, span.opticalfx, span.music, span.sound, span.soundfx, span.cgi, span.construction, span.painting, span.set, span.setdressing, span.specialfx, span.hair, span.makeup, span.props, span.wardrobe, span.weapons, span.equip, span.mechfx, span.stunts, span.animals, span.equip, span.greenery, span.handler, span.livestock, span.misc, span.vehicles, span.actor, span.cast, span.crew, span.extras, span.addlabour, span.location, span.prodnotes, span.security { color: inherit !important; } }
tmhorne/celtx
celtx/base/resources/content/editors/breakdownhide.css
CSS
mpl-2.0
1,340
MODULE PhotovoltaicThermalCollectors ! Module containing the routines dealing with the photovoltaic thermal collectors ! MODULE INFORMATION: ! AUTHOR Brent. Griffith ! DATE WRITTEN June-August 2008 ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS MODULE: ! collect models related to PVT or hybrid, photovoltaic - thermal solar collectors ! METHODOLOGY EMPLOYED: ! The approach is to have one PVT structure that works with different models. ! the PVT modle reuses photovoltaic modeling in Photovoltaics.f90 for electricity generation. ! the electric load center and "generator" is all accessed thru PV objects and models. ! this module is for the thermal portion of PVT. ! the first model is a "simple" or "ideal" model useful for sizing, early design, or policy analyses ! Simple PV/T model just converts incoming solar to electricity and temperature rise of a working fluid. ! REFERENCES: ! OTHER NOTES: ! na ! USE STATEMENTS: USE DataPrecisionGlobals USE DataGlobals USE DataSurfaces, ONLY: Surface, TotSurfaces, SurfSunlitArea, SurfSunlitFrac, SurfaceClass_Detached_F, SurfaceClass_Detached_B, & SurfaceClass_Shading USE DataPhotovoltaics USE DataInterfaces IMPLICIT NONE ! Enforce explicit typing of all variables PRIVATE ! Everything private unless explicitly made public ! MODULE PARAMETER DEFINITIONS: INTEGER, PARAMETER :: SimplePVTmodel = 1001 INTEGER, PARAMETER :: LayerByLayerPVTmodel = 1002 INTEGER, PARAMETER :: ScheduledThermEffic = 15 ! mode for thermal efficiency is to use schedule INTEGER, PARAMETER :: FixedThermEffic = 16 ! mode for thermal efficiency is to use fixed value INTEGER, PARAMETER :: LiquidWorkingFluid = 1 INTEGER, PARAMETER :: AirWorkingFluid = 2 INTEGER, PARAMETER , PUBLIC :: CalledFromPlantLoopEquipMgr = 101 INTEGER, PARAMETER , PUBLIC :: CalledFromOutsideAirSystem = 102 REAL(r64), PARAMETER :: SimplePVTWaterSizeFactor = 1.905d-5 ! [ m3/s/m2 ] average of collectors in SolarCollectors.idf ! DERIVED TYPE DEFINITIONS: TYPE SimplePVTModelStruct CHARACTER(len=MaxNameLength) :: Name = '' ! REAL(r64) :: ThermalActiveFract = 0.0D0 ! fraction of surface area with active thermal collection INTEGER :: ThermEfficMode = 0 ! setting for how therm effic is determined REAL(r64) :: ThermEffic = 0.0D0 ! fixed or current Therm efficiency INTEGER :: ThermEffSchedNum = 0 ! pointer to schedule for therm effic (if any) REAL(r64) :: SurfEmissivity = 0.0D0 ! surface emittance in long wave IR REAL(r64) :: LastCollectorTemp = 0.0D0 ! store previous temperature REAL(r64) :: CollectorTemp = 0.0D0 ! average solar collector temp. END TYPE SimplePVTModelStruct TYPE PVTReportStruct REAL(r64) :: ThermEfficiency = 0.0D0 ! Thermal efficiency of solar energy conversion REAL(r64) :: ThermPower = 0.0D0 ! Heat gain or loss to collector fluid (W) REAL(r64) :: ThermHeatGain = 0.0D0 ! Heat gain to collector fluid (W) REAL(r64) :: ThermHeatLoss = 0.0D0 ! Heat loss from collector fluid (W) REAL(r64) :: ThermEnergy = 0.0D0 ! Energy gained (or lost) to collector fluid (J) REAL(r64) :: MdotWorkFluid = 0.0D0 ! working fluid mass flow rate (kg/s) REAL(r64) :: TinletWorkFluid = 0.0D0 ! working fluid inlet temp (C) REAL(r64) :: ToutletWorkFluid = 0.0D0 ! working fluid outlet temp (C) REAL(r64) :: BypassStatus = 0.0D0 ! 0 = no bypass, 1=full bypass END TYPE PVTReportStruct TYPE PVTCollectorStruct ! input CHARACTER(len=MaxNameLength) :: Name = '' ! Name of PVT collector INTEGER :: TypeNum ! Plant Side Connection: 'TypeOf_Num' assigned in DataPlant !DSU INTEGER :: WLoopNum = 0 ! Water plant loop index number !DSU INTEGER :: WLoopSideNum = 0 ! Water plant loop side index !DSU INTEGER :: WLoopBranchNum = 0 ! Water plant loop branch index !DSU INTEGER :: WLoopCompNum = 0 ! Water plant loop component index !DSU LOGICAL :: EnvrnInit = .TRUE. ! manage begin environmen inits LOGICAL :: SizingInit = .TRUE. ! manage when sizing is complete CHARACTER(len=MaxNameLength) :: PVTModelName = '' ! Name of PVT performance object INTEGER :: PVTModelType = 0 ! model type indicator, only simple avail now INTEGER :: SurfNum = 0 ! surface index CHARACTER(len=MaxNameLength) :: PVname = '' ! named Generator:Photovoltaic object INTEGER :: PVNum = 0 ! PV index LOGICAL :: PVfound = .FALSE. ! init, need to delay get input until PV gotten ! INTEGER :: PlantLoopNum = 0 ! needed for sizing and control ! INTEGER :: PlantLoopSide = 0 ! needed for sizing, demand vs. supply sided Type(SimplePVTModelStruct) :: Simple ! performance data structure. INTEGER :: WorkingFluidType = 0 ! INTEGER :: PlantInletNodeNum = 0 ! INTEGER :: PlantOutletNodeNum = 0 INTEGER :: HVACInletNodeNum = 0 INTEGER :: HVACOutletNodeNum = 0 REAL(r64) :: DesignVolFlowRate = 0.0D0 REAL(r64) :: MaxMassFlowRate = 0.0D0 REAL(r64) :: MassFlowRate = 0.0D0 !DSU REAL(r64) :: AreaCol = 0.0D0 LOGICAL :: BypassDamperOff = .TRUE. LOGICAL :: CoolingUseful = .FALSE. LOGICAL :: HeatingUseful = .FALSE. TYPE(PVTReportStruct) :: Report END TYPE PVTCollectorStruct ! MODULE VARIABLE DECLARATIONS: TYPE (PVTCollectorStruct), ALLOCATABLE, DIMENSION(:) :: PVT LOGICAL, ALLOCATABLE, DIMENSION(:) :: CheckEquipName INTEGER :: NumPVT =0 ! count of all types of PVT in input file INTEGER :: NumSimplePVTPerform=0 ! count of simple PVT performance objects in input file ! SUBROUTINE SPECIFICATIONS FOR MODULE: ! Driver/Manager Routines PUBLIC SimPVTcollectors !main entry point, called from non-zone equipment manager PRIVATE GetPVTcollectorsInput ! PRIVATE InitPVTcollectors PRIVATE SizePVT PRIVATE ControlPVTcollector PRIVATE CalcPVTcollectors PRIVATE UpdatePVTcollectors ! Utility routines for module ! these would be public such as: PUBLIC GetPVTThermalPowerProduction !PUBLIC GetPVTIncidentSolarForInternalPVLayer !PUBLIC GetPVTCellTemp CONTAINS SUBROUTINE SimPVTcollectors(PVTNum, FirstHVACIteration, CalledFrom, PVTName, InitLoopEquip ) ! SUBROUTINE INFORMATION: ! AUTHOR <author> ! DATE WRITTEN <date_written> ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! <description> ! METHODOLOGY EMPLOYED: ! <description> ! REFERENCES: ! na ! USE STATEMENTS: USE InputProcessor, ONLY:FindItemInList USE General, ONLY: TrimSigDigits IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(INOUT) :: PVTnum ! index to PVT array. LOGICAL, INTENT(IN) :: FirstHVACIteration INTEGER, INTENT(IN) :: CalledFrom CHARACTER(len=*), OPTIONAL, INTENT (IN) :: PVTName LOGICAL, OPTIONAL, INTENT(IN) :: InitLoopEquip ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS: ! na ! DERIVED TYPE DEFINITIONS: ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: LOGICAL,SAVE :: GetInputFlag = .true. ! First time, input is "gotten" IF (GetInputFlag) THEN CALL GetPVTcollectorsInput GetInputFlag=.false. ENDIF IF (PRESENT(PVTName)) THEN IF ( PVTNum == 0) THEN PVTnum = FindItemInList(PVTName,PVT%Name,NumPVT) IF (PVTnum == 0) THEN CALL ShowFatalError('SimPVTcollectors: Unit not found='//TRIM(PVTName)) ENDIF ELSE IF (PVTnum > NumPVT .OR. PVTnum < 1 ) THEN CALL ShowFatalError('SimPVTcollectors: Invalid PVT index passed = '// & TRIM(TrimSigDigits(PVTnum))// & ', Number of PVT units='//TRIM(TrimSigDigits(NumPVT))// & ', Entered Unit name='//TRIM(PVTName)) ENDIF IF (CheckEquipName(PVTnum)) THEN IF (PVTName /= PVT(PVTnum)%Name) THEN CALL ShowFatalError('SimPVTcollectors: Invalid PVT index passed = '// & TRIM(TrimSigDigits(PVTnum))// & ', Unit name='//TRIM(PVTName)// & ', stored name for that index='//TRIM(PVT(PVTnum)%Name)) ENDIF CheckEquipName(PVTnum)=.false. ENDIF ENDIF ELSE IF (PVTnum > NumPVT .OR. PVTnum < 1 ) THEN CALL ShowFatalError('SimPVTcollectors: Invalid PVT index passed = '// & TRIM(TrimSigDigits(PVTnum))// & ', Number of PVT units='//TRIM(TrimSigDigits(NumPVT))// & ', Entered Unit name='//TRIM(PVTName)) ENDIF ENDIF ! compName present IF (PRESENT(InitLoopEquip)) THEN IF (InitLoopEquip) THEN CALL InitPVTcollectors( PVTnum, FirstHVACIteration ) RETURN ENDIF ENDIF !check where called from and what type of collector this is, return if not right for calling order for speed IF ((PVT(PVTnum)%WorkingFluidType == AirWorkingFluid) .AND. (CalledFrom == CalledFromPlantLoopEquipMgr) ) RETURN IF ((PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid) .AND. (CalledFrom == CalledFromOutsideAirSystem) ) RETURN CALL InitPVTcollectors( PVTnum, FirstHVACIteration ) CALL ControlPVTcollector( PVTnum ) CALL CalcPVTcollectors( PVTnum ) CALL UpdatePVTcollectors( PVTnum ) RETURN END SUBROUTINE SimPVTcollectors SUBROUTINE GetPVTcollectorsInput ! SUBROUTINE INFORMATION: ! AUTHOR B. Griffith ! DATE WRITTEN June 2008 ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! Get input for PVT objects ! METHODOLOGY EMPLOYED: ! usual E+ methods ! REFERENCES: ! na ! USE STATEMENTS: USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem , FindItemInList, SameString, & VerifyName USE DataIPShortCuts USE DataHeatBalance USE DataLoopNode USE DataEnvironment, ONLY: StdRhoAir USE NodeInputManager, ONLY: GetOnlySingleNode USE BranchNodeConnections, ONLY: TestCompSet USE ScheduleManager, ONLY: GetScheduleIndex USE DataInterfaces, ONLY: SetupOutputVariable USE DataSizing , ONLY: Autosize USE General, ONLY: RoundSigDigits USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow USE ReportSizingManager, ONLY: ReportSizingOutput USE DataPlant !DSU IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: ! na ! SUBROUTINE PARAMETER DEFINITIONS: CHARACTER(len=*), PARAMETER :: Blank = ' ' ! INTERFACE BLOCK SPECIFICATIONS: ! na ! DERIVED TYPE DEFINITIONS: ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: Item ! Item to be "gotten" INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call INTEGER :: IOStatus ! Used in GetObjectItem LOGICAL :: ErrorsFound=.false. ! Set to true if errors in input, fatal at end of routine INTEGER :: SurfNum ! local use only TYPE (SimplePVTModelStruct), ALLOCATABLE, DIMENSION(:) :: tmpSimplePVTperf INTEGER :: ThisParamObj ! LOGICAL :: IsNotOK ! Flag to verify name LOGICAL :: IsBlank ! Flag for blank name ! first load the performance object info into temporary structure cCurrentModuleObject = 'SolarCollectorPerformance:PhotovoltaicThermal:Simple' NumSimplePVTPerform = GetNumObjectsFound(cCurrentModuleObject) IF (NumSimplePVTPerform > 0) Then Allocate(tmpSimplePVTperf(NumSimplePVTPerform)) DO Item=1, NumSimplePVTPerform CALL GetObjectItem(cCurrentModuleObject,Item,cAlphaArgs,NumAlphas, & rNumericArgs,NumNumbers,IOStatus, AlphaBlank=lAlphaFieldBlanks, & AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames) IsNotOK=.false. IsBlank=.false. CALL VerifyName(cAlphaArgs(1),tmpSimplePVTperf%Name,Item-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Names') IF (IsNotOK) THEN ErrorsFound=.true. IF (IsBlank) THEN CALL ShowSevereError('Invalid '//TRIM(cCurrentModuleObject)//', Name cannot be blank') ENDIF CYCLE ENDIF tmpSimplePVTperf(Item)%Name = TRIM(cAlphaArgs(1)) If (SameString(cAlphaArgs(2), 'Fixed')) Then tmpSimplePVTperf(Item)%ThermEfficMode = FixedThermEffic ELSEIF (SameString(cAlphaArgs(2), 'Scheduled')) Then tmpSimplePVTperf(Item)%ThermEfficMode = ScheduledThermEffic ELSE CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) ErrorsFound=.true. ENDIF tmpSimplePVTperf(Item)%ThermalActiveFract = rNumericArgs(1) tmpSimplePVTperf(Item)%ThermEffic = rNumericArgs(2) tmpSimplePVTperf(Item)%ThermEffSchedNum = GetScheduleIndex(cAlphaArgs(3)) IF ( (tmpSimplePVTperf(Item)%ThermEffSchedNum == 0) & .AND. (tmpSimplePVTperf(Item)%ThermEfficMode == ScheduledThermEffic) ) THEN CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) ErrorsFound=.true. ENDIF tmpSimplePVTperf(Item)%SurfEmissivity = rNumericArgs(3) ENDDO ENDIF !NumSimplePVTPerform > 0 ! now get main PVT objects cCurrentModuleObject = 'SolarCollector:FlatPlate:PhotovoltaicThermal' NumPVT = GetNumObjectsFound(cCurrentModuleObject) ALLOCATE(PVT(NumPVT)) ALLOCATE(CheckEquipName(NumPVT)) CheckEquipName=.true. DO Item=1, NumPVT CALL GetObjectItem(cCurrentModuleObject,Item,cAlphaArgs,NumAlphas, & rNumericArgs,NumNumbers,IOStatus, AlphaBlank=lAlphaFieldBlanks, & AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames) !check name IsNotOK = .FALSE. IsBlank = .FALSE. CALL VerifyName(cAlphaArgs(1), PVT%Name, Item -1, IsNotOK, IsBlank, & TRIM(cCurrentModuleObject) ) If (IsNotOK) Then ErrorsFound = .true. IF (IsBlank) THEN CALL ShowSevereError('Invalid '//TRIM(cCurrentModuleObject)//', Name cannot be blank') ENDIF CYCLE ENDIF PVT(Item)%Name = cAlphaArgs(1) PVT(Item)%TypeNum = TypeOf_PVTSolarCollectorFlatPlate !DSU, assigned in DataPlant PVT(Item)%SurfNum = FindItemInList(cAlphaArgs(2),Surface%Name,TotSurfaces) ! check surface IF (PVT(Item)%SurfNum == 0) THEN IF (lAlphaFieldBlanks(2)) THEN CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError('Surface name cannot be blank.') ELSE CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError('Surface was not found.') ENDIF ErrorsFound=.true. ELSE ! ! Found one -- make sure has right parameters for PVT SurfNum = PVT(Item)%SurfNum IF (.NOT. Surface(PVT(Item)%SurfNum)%ExtSolar) THEN CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError('Surface must be exposed to solar.' ) ErrorsFound=.true. END IF ! check surface orientation, warn if upside down IF (( Surface(SurfNum)%Tilt < -95.0D0 ) .OR. (Surface(SurfNum)%Tilt > 95.0D0)) THEN CALL ShowWarningError('Suspected input problem with '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError( 'Surface used for solar collector faces down') CALL ShowContinueError('Surface tilt angle (degrees from ground outward normal) = ' & //TRIM(RoundSigDigits(Surface(SurfNum)%Tilt,2) ) ) ENDIF ENDIF ! check surface If (lAlphaFieldBlanks(3)) Then CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError(TRIM(cAlphaFieldNames(3))//', name cannot be blank.') ErrorsFound=.true. ELSE PVT(Item)%PVTModelName = cAlphaArgs(3) ThisParamObj = FindItemInList( PVT(Item)%PVTModelName, tmpSimplePVTperf%Name, NumSimplePVTPerform) IF (ThisParamObj > 0) THEN PVT(Item)%Simple = tmpSimplePVTperf(ThisParamObj) ! entire structure assigned ! do one-time setups on input data PVT(Item)%AreaCol = Surface(PVT(Item)%SurfNum)%Area * PVT(Item)%Simple%ThermalActiveFract PVT(Item)%PVTModelType = SimplePVTmodel ELSE CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError(TRIM(cAlphaFieldNames(3))//', was not found.') ErrorsFound=.true. ENDIF ENDIF ! IF (ALLOCATED(PVarray)) THEN ! then PV input gotten... but don't expect this to be true. PVT(Item)%PVnum = FindItemInList( cAlphaArgs(4) ,PVarray%name, NumPVs) ! check PV IF (PVT(Item)%PVnum == 0) THEN CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(cAlphaArgs(4)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) ErrorsFound=.true. ELSE PVT(Item)%PVname = TRIM(cAlphaArgs(4)) PVT(Item)%PVfound = .TRUE. endif ELSE ! no PV or not yet gotten. PVT(Item)%PVname = TRIM(cAlphaArgs(4)) PVT(Item)%PVfound = .FALSE. ENDIF IF (SameString(cAlphaArgs(5), 'Water' )) THEN PVT(Item)%WorkingFluidType = LiquidWorkingFluid ELSEIF (SameString (cAlphaArgs(5), 'Air' )) THEN PVT(Item)%WorkingFluidType = AirWorkingFluid ELSE IF (lAlphaFieldBlanks(5)) THEN CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(cAlphaArgs(5)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) CALL ShowContinueError(TRIM(cAlphaFieldNames(5))//' field cannot be blank.') ELSE CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(cAlphaArgs(5)) ) CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) ) ENDIF ErrorsFound=.true. ENDIF IF (PVT(Item)%WorkingFluidType == LiquidWorkingFluid) THEN PVT(Item)%PlantInletNodeNum = & GetOnlySingleNode(cAlphaArgs(6),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), & NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsNotParent ) PVT(Item)%PlantOutletNodeNum = & GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), & NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsNotParent ) CALL TestCompSet(TRIM(cCurrentModuleObject), cAlphaArgs(1), cAlphaArgs(6), cAlphaArgs(7), 'Water Nodes') PVT(Item)%WLoopSideNum = DemandSupply_No ENDIF IF (PVT(Item)%WorkingFluidType == AirWorkingFluid) THEN PVT(Item)%HVACInletNodeNum = & GetOnlySingleNode(cAlphaArgs(8), ErrorsFound, TRIM(cCurrentModuleObject), cAlphaArgs(1), & NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent) PVT(Item)%HVACOutletNodeNum = & GetOnlySingleNode(cAlphaArgs(9), ErrorsFound, TRIM(cCurrentModuleObject), cAlphaArgs(1), & NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent) CALL TestCompSet( TRIM(cCurrentModuleObject), cAlphaArgs(1), cAlphaArgs(8), cAlphaArgs(9), 'Air Nodes' ) ENDIF PVT(Item)%DesignVolFlowRate = rNumericArgs(1) PVT(Item)%SizingInit = .TRUE. IF (PVT(Item)%DesignVolFlowRate /= Autosize) THEN IF (PVT(Item)%WorkingFluidType == LiquidWorkingFluid) Then CALL RegisterPlantCompDesignFlow( PVT(Item)%PlantInletNodeNum, PVT(Item)%DesignVolFlowRate ) ELSEIF(PVT(Item)%WorkingFluidType == AirWorkingFluid) Then PVT(Item)%MaxMassFlowRate = PVT(Item)%DesignVolFlowRate * StdRhoAir ENDIF PVT(Item)%SizingInit = .FALSE. ENDIF ENDDO DO Item=1, NumPVT ! electrical production reporting under generator:photovoltaic.... ! only thermal side reported here, CALL SetupOutputVariable('Generator Produced Thermal Rate [W]', & PVT(Item)%Report%ThermPower, 'System', 'Average', PVT(Item)%name ) IF (PVT(Item)%WorkingFluidType == LiquidWorkingFluid) THEN CALL SetupOutputVariable('Generator Produced Thermal Energy [J]', & PVT(Item)%Report%ThermEnergy, 'System', 'Sum', PVT(Item)%name , & ResourceTypeKey='SolarWater', EndUseKey='HeatProduced', GroupKey='Plant') ELSEIF (PVT(Item)%WorkingFluidType == AirWorkingFluid) THEN CALL SetupOutputVariable('Generator Produced Thermal Energy [J]', & PVT(Item)%Report%ThermEnergy, 'System', 'Sum', PVT(Item)%name , & ResourceTypeKey='SolarAir', EndUseKey='HeatProduced', GroupKey='System') CALL SetupOutputVariable('Generator PVT Fluid Bypass Status []', & PVT(Item)%Report%BypassStatus, 'System', 'Average', PVT(Item)%name ) ENDIF CALL SetupOutputVariable('Generator PVT Fluid Inlet Temperature [C]', & PVT(Item)%Report%TinletWorkFluid, 'System', 'Average', PVT(Item)%name ) CALL SetupOutputVariable('Generator PVT Fluid Outlet Temperature [C]', & PVT(Item)%Report%ToutletWorkFluid, 'System', 'Average', PVT(Item)%name ) CALL SetupOutputVariable('Generator PVT Fluid Mass Flow Rate [kg/s]', & PVT(Item)%Report%MdotWorkFluid, 'System', 'Average', PVT(Item)%name ) ENDDO IF (ErrorsFound) THEN CALL ShowFatalError('Errors found in processing input for photovoltaic thermal collectors') ENDIF IF (ALLOCATED(tmpSimplePVTperf)) DEALLOCATE(tmpSimplePVTperf) RETURN END SUBROUTINE GetPVTcollectorsInput SUBROUTINE InitPVTcollectors(PVTnum, FirstHVACIteration) ! SUBROUTINE INFORMATION: ! AUTHOR B. Griffith ! DATE WRITTEN June 2008 ! MODIFIED B. Griffith, May 2009, EMS setpoint check ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! init for PVT ! METHODOLOGY EMPLOYED: ! <description> ! REFERENCES: ! na ! USE STATEMENTS: USE DataGlobals, ONLY: SysSizingCalc, InitConvTemp, AnyEnergyManagementSystemInModel USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow USE DataLoopNode, ONLY: Node, SensedNodeFlagValue USE FluidProperties, ONLY: GetDensityGlycol USE InputProcessor, ONLY: FindItemInList USE DataHVACGlobals, ONLY: DoSetPointTest, SetPointErrorFlag USE DataHeatBalance, ONLY: QRadSWOutIncident USE General, ONLY: RoundSigDigits USE EMSManager, ONLY: iTemperatureSetpoint, CheckIfNodeSetpointManagedByEMS USE DataPlant, ONLY: ScanPlantLoopsForObject, PlantLoop USE PlantUtilities, ONLY: SetComponentFlowRate , InitComponentNodes IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(IN) :: PVTnum LOGICAL, INTENT(IN) :: FirstHVACIteration ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS ! na ! DERIVED TYPE DEFINITIONS ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: InletNode INTEGER :: OutletNode INTEGER :: PVTindex INTEGER :: SurfNum LOGICAL :: ErrorsFound = .FALSE. LOGICAL,SAVE :: MySetPointCheckFlag = .TRUE. LOGICAL, SAVE :: MyOneTimeFlag = .TRUE. ! one time flag LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: SetLoopIndexFlag ! get loop number flag LOGICAL :: errFlag REAL(r64) :: rho ! local fluid density kg/s ! FLOW: ! Do the one time initializations IF (MyOneTimeFlag) THEN ALLOCATE(SetLoopIndexFlag(NumPVT)) SetLoopIndexFlag = .TRUE. MyOneTimeFlag = .FALSE. END IF IF(SetLoopIndexFlag(PVTnum))THEN IF(ALLOCATED(PlantLoop) .AND. (PVT(PVTnum)%PlantInletNodeNum >0 ) )THEN errFlag=.false. CALL ScanPlantLoopsForObject(PVT(PVTnum)%Name, & PVT(PVTnum)%TypeNum, & PVT(PVTnum)%WLoopNum, & PVT(PVTnum)%WLoopSideNum, & PVT(PVTnum)%WLoopBranchNum, & PVT(PVTnum)%WLoopCompNum, & errFlag=errFlag) IF (errFlag) THEN CALL ShowFatalError('InitPVTcollectors: Program terminated for previous conditions.') ENDIF SetLoopIndexFlag(PVTnum) = .FALSE. ENDIF ENDIF ! finish set up of PV, becaues PV get-input follows PVT's get input. IF (.NOT. PVT(PVTnum)%PVfound) Then IF (ALLOCATED(PVarray)) THEN PVT(PVTnum)%PVnum = FindItemInList( PVT(PVTnum)%PVname ,PVarray%name, NumPVs) IF (PVT(PVTnum)%PVnum == 0) THEN CALL ShowSevereError('Invalid name for photovoltaic generator = '//TRIM(PVT(PVTnum)%PVname) ) CALL ShowContinueError('Entered in flat plate photovoltaic-thermal collector = '//TRIM(PVT(PVTnum)%Name) ) ErrorsFound=.TRUE. ELSE PVT(PVTnum)%PVfound = .TRUE. ENDIF ELSE IF ((.NOT. BeginEnvrnFlag) .AND. (.NOT. FirstHVACIteration)) THEN CALL ShowSevereError('Photovoltaic generators are missing for Photovoltaic Thermal modeling' ) CALL ShowContinueError('Needed for flat plate photovoltaic-thermal collector = '//TRIM(PVT(PVTnum)%Name) ) ErrorsFound=.true. ENDIF ENDIF ENDIF IF ( .NOT. SysSizingCalc .AND. MySetPointCheckFlag .AND. DoSetPointTest) THEN DO PVTindex = 1, NumPVT IF (PVT(PVTindex)%WorkingFluidType == AirWorkingFluid) THEN IF (Node(PVT(PVTindex)%HVACOutletNodeNum)%TempSetPoint == SensedNodeFlagValue) THEN IF (.NOT. AnyEnergyManagementSystemInModel) THEN CALL ShowSevereError( 'Missing temperature setpoint for PVT outlet node ') CALL ShowContinueError('Add a setpoint manager to outlet node of PVT named ' & //Trim(PVT(PVTindex)%Name) ) SetPointErrorFlag = .TRUE. ELSE ! need call to EMS to check node CALL CheckIfNodeSetpointManagedByEMS(PVT(PVTindex)%HVACOutletNodeNum,iTemperatureSetpoint, SetPointErrorFlag) IF (SetPointErrorFlag) THEN CALL ShowSevereError( 'Missing temperature setpoint for PVT outlet node ') CALL ShowContinueError('Add a setpoint manager to outlet node of PVT named ' & //Trim(PVT(PVTindex)%Name) ) CALL ShowContinueError(' or use an EMS actuator to establish a setpoint at the outlet node of PVT') ENDIF ENDIF ENDIF ENDIF ENDDO MySetPointCheckFlag = .FALSE. END IF !Size design flow rate IF ( .NOT. SysSizingCalc .AND. PVT(PVTnum)%SizingInit) THEN CALL SizePVT(PVTnum) ENDIF SELECT CASE (PVT(PVTnum)%WorkingFluidType) CASE (LiquidWorkingFluid) InletNode = PVT(PVTnum)%PlantInletNodeNum OutletNode = PVT(PVTnum)%PlantOutletNodeNum CASE (AirWorkingFluid) InletNode = PVT(PVTnum)%HVACInletNodeNum OutletNode = PVT(PVTnum)%HVACOutletNodeNum END SELECT IF (BeginEnvrnFlag .AND. PVT(PVTnum)%EnvrnInit ) THEN PVT(PVTnum)%MassFlowRate = 0.d0 PVT(PVTnum)%BypassDamperOff = .TRUE. PVT(PVTnum)%CoolingUseful = .FALSE. PVT(PVTnum)%HeatingUseful = .FALSE. PVT(PVTnum)%Simple%LastCollectorTemp = 0.d0 PVT(PVTnum)%Simple%CollectorTemp = 0.d0 PVT(PVTnum)%Report%ThermEfficiency = 0.d0 PVT(PVTnum)%Report%ThermPower = 0.d0 PVT(PVTnum)%Report%ThermHeatGain = 0.d0 PVT(PVTnum)%Report%ThermHeatLoss = 0.d0 PVT(PVTnum)%Report%ThermEnergy = 0.d0 PVT(PVTnum)%Report%MdotWorkFluid = 0.d0 PVT(PVTnum)%Report%TinletWorkFluid = 0.d0 PVT(PVTnum)%Report%ToutletWorkFluid = 0.d0 PVT(PVTnum)%Report%BypassStatus = 0.d0 SELECT CASE (PVT(PVTnum)% WorkingFluidType) CASE (LiquidWorkingFluid) rho = GetDensityGlycol(PlantLoop(PVT(PVTnum)%WLoopNum)%FluidName, & 60.d0, & PlantLoop(PVT(PVTnum)%WLoopNum)%FluidIndex, & 'InitPVTcollectors') PVT(PVTnum)%MaxMassFlowRate = PVT(PVTnum)%DesignVolFlowRate * rho CALL InitComponentNodes(0.d0, PVT(PVTnum)%MaxMassFlowRate, & InletNode, OutletNode, & PVT(PVTnum)%WLoopNum, & PVT(PVTnum)%WLoopSideNum, & PVT(PVTnum)%WLoopBranchNum, & PVT(PVTnum)%WLoopCompNum ) PVT(PVTnum)%Simple%LastCollectorTemp = 23.0D0 CASE (AirWorkingFluid) PVT(PVTnum)%Simple%LastCollectorTemp = 23.0D0 END SELECT PVT(PVTnum)%EnvrnInit = .FALSE. ENDIF IF (.NOT. BeginEnvrnFlag) PVT(PVTnum)%EnvrnInit = .TRUE. SELECT CASE (PVT(PVTnum)% WorkingFluidType) CASE (LiquidWorkingFluid) ! heating only right now, so control flow requests based on incident solar SurfNum = PVT(PVTnum)%SurfNum IF (QRadSWOutIncident(SurfNum) > MinIrradiance) THEN !IF (FirstHVACIteration) THEN PVT(PVTnum)%MassFlowRate = PVT(PVTnum)%MaxMassFlowRate !DSU !ENDIF ELSE !IF (FirstHVACIteration) THEN PVT(PVTnum)%MassFlowRate = 0.0D0 !DSU !ENDIF ENDIF ! Should we declare a mass flow rate variable in the data structure instead of using node(outlet)%massflowrate ? DSU CALL SetComponentFlowRate( PVT(PVTnum)%MassFlowRate,InletNode,OutletNode, & !DSU PVT(PVTnum)%WLoopNum,PVT(PVTnum)%WLoopSideNum , & PVT(PVTnum)%WLoopBranchNum , PVT(PVTnum)%WLoopCompNum) !DSU CASE (AirWorkingFluid) PVT(PVTnum)%MassFlowRate = Node(InletNode)%MassFlowRate END SELECT RETURN END SUBROUTINE InitPVTcollectors SUBROUTINE SizePVT(PVTnum) ! SUBROUTINE INFORMATION: ! AUTHOR Brent Griffith ! DATE WRITTEN August 2008 ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! This subroutine is for sizing PVT flow rates that ! have not been specified in the input. ! METHODOLOGY EMPLOYED: ! Obtains hot water flow rate from the plant sizing array. ! REFERENCES: ! na ! USE STATEMENTS: USE DataSizing USE DataPlant, ONLY: PlantLoop, SupplySide, DemandSide USE DataInterfaces, ONLY: ShowFatalError, ShowSevereError, ShowContinueError, SetupOutputVariable USE DataHVACGlobals, ONLY: SmallWaterVolFlow, SmallAirVolFlow, Main, Cooling, Heating, Other USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow USE ReportSizingManager, ONLY: ReportSizingOutput USE OutputReportPredefined USE DataAirSystems, ONLY: PrimaryAirSystem USE DataAirLoop, ONLY: AirLoopControlInfo USE DataEnvironment , ONLY: StdRhoAir USE DataLoopNode , ONLY: Node IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(IN) :: PVTnum ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS ! na ! DERIVED TYPE DEFINITIONS ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: PltSizNum ! Plant Sizing index corresponding to CurLoopNum LOGICAL :: ErrorsFound ! If errors detected in input !unused1208 CHARACTER(len=MaxNameLength) :: equipName ! Name of boiler object REAL(r64) :: DesVolFlow REAL(r64) :: DesMassFlow PltSizNum = 0 ErrorsFound = .FALSE. IF (PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid) THEN IF ( .NOT. ALLOCATED(PlantSizData)) RETURN If ( .NOT. ALLOCATED(PlantLoop ) ) RETURN IF (PVT(PVTnum)%WLoopNum > 0) THEN PltSizNum = PlantLoop(PVT(PVTnum)%WLoopNum)%PlantSizNum END IF IF (PVT(PVTnum)%DesignVolFlowRate == AutoSize) THEN IF (PVT(PVTnum)%WLoopSideNum == SupplySide) Then IF (PltSizNum > 0) THEN IF (PlantSizData(PltSizNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN DesVolFlow = PlantSizData(PltSizNum)%DesVolFlowRate ELSE DesVolFlow = 0.0d0 END IF PVT(PVTnum)%DesignVolFlowRate = DesVolFlow ELSE CALL ShowSevereError('Autosizing of PVT solar collector design flow rate requires a Sizing:Plant object') CALL ShowContinueError('Occurs in PVT object='//TRIM(PVT(PVTnum)%Name)) ErrorsFound = .TRUE. END IF ELSEIF (PVT(PVTnum)%WLoopSideNum == DemandSide) THEN PVT(PVTnum)%DesignVolFlowRate = PVT(PVTnum)%AreaCol * SimplePVTWaterSizeFactor ENDIF CALL ReportSizingOutput('SolarCollector:FlatPlate:PhotovoltaicThermal', PVT(PVTnum)%Name, & 'Design Flow Rate [m3/s]', & PVT(PVTnum)%DesignVolFlowRate) CALL RegisterPlantCompDesignFlow( PVT(PVTnum)%PlantInletNodeNum, PVT(PVTnum)%DesignVolFlowRate ) PVT(PVTnum)%SizingInit = .FALSE. END IF ENDIF !plant component IF (PVT(PVTnum)%WorkingFluidType == AirWorkingFluid) THEN IF (PVT(PVTnum)%DesignVolFlowRate == AutoSize) THEN IF (CurSysNum > 0) THEN CALL CheckSysSizing('SolarCollector:FlatPlate:PhotovoltaicThermal', PVT(PVTnum)%Name) IF (CurOASysNum > 0) THEN DesVolFlow = FinalSysSizing(CurSysNum)%DesOutAirVolFlow ELSE SELECT CASE(CurDuctType) CASE(Main) DesVolFlow = FinalSysSizing(CurSysNum)%SysAirMinFlowRat*FinalSysSizing(CurSysNum)%DesMainVolFlow CASE(Cooling) DesVolFlow = FinalSysSizing(CurSysNum)%SysAirMinFlowRat*FinalSysSizing(CurSysNum)%DesCoolVolFlow CASE(Heating) DesVolFlow = FinalSysSizing(CurSysNum)%DesHeatVolFlow CASE(Other) DesVolFlow = FinalSysSizing(CurSysNum)%DesMainVolFlow CASE DEFAULT DesVolFlow = FinalSysSizing(CurSysNum)%DesMainVolFlow END SELECT END IF DesMassFlow = StdRhoAir *DesVolFlow PVT(PVTnum)%DesignVolFlowRate = DesVolFlow PVT(PVTnum)%MaxMassFlowRate = DesMassFlow CALL ReportSizingOutput('SolarCollector:FlatPlate:PhotovoltaicThermal', PVT(PVTnum)%Name, & 'Design Flow Rate [m3/s]', & PVT(PVTnum)%DesignVolFlowRate) PVT(PVTnum)%SizingInit = .FALSE. ELSE IF (CurZoneEqNum > 0) THEN ! PVT is not currently for zone equipment, should not come here. ENDIF ENDIF ENDIF IF (ErrorsFound) THEN CALL ShowFatalError('Preceding sizing errors cause program termination') END IF RETURN END SUBROUTINE SizePVT SUBROUTINE ControlPVTcollector(PVTnum) ! SUBROUTINE INFORMATION: ! AUTHOR Brent Griffith ! DATE WRITTEN August 2008 ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! make control decisions for PVT collector ! METHODOLOGY EMPLOYED: ! decide if PVT should be in cooling or heat mode and if it should be bypassed or not ! REFERENCES: ! na ! USE STATEMENTS: USE DataLoopNode , ONLY: Node USE DataHeatBalance, ONLY: QRadSWOutIncident USE DataPlant , ONLY: PlantReport IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(IN) :: PVTnum ! ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS: ! na ! DERIVED TYPE DEFINITIONS: ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: SurfNum = 0 ! INTEGER :: PlantLoopNum = 0 ! REAL(r64) :: mdot = 0.0D0 SurfNum = PVT(PVTnum)%SurfNum IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN IF (PVT(PVTnum)%PVTModelType == SimplePVTmodel) THEN IF (QRadSWOutIncident(SurfNum) > MinIrradiance) then ! is heating wanted? ! Outlet node is required to have a setpoint. IF ( Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint & > Node(PVT(PVTnum)%HVACInletNodeNum)%Temp ) THEN PVT(PVTnum)%HeatingUseful = .TRUE. PVT(PVTnum)%CoolingUseful = .FALSE. PVT(PVTnum)%BypassDamperOff = .TRUE. ELSE PVT(PVTnum)%HeatingUseful = .FALSE. PVT(PVTnum)%CoolingUseful = .TRUE. PVT(PVTnum)%BypassDamperOff = .FALSE. ENDIF ELSE ! is cooling wanted? IF (Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint & < Node(PVT(PVTnum)%HVACInletNodeNum)%Temp ) THEN PVT(PVTnum)%CoolingUseful = .TRUE. PVT(PVTnum)%HeatingUseful = .FALSE. PVT(PVTnum)%BypassDamperOff = .TRUE. ELSE PVT(PVTnum)%CoolingUseful = .FALSE. PVT(PVTnum)%HeatingUseful = .TRUE. PVT(PVTnum)%BypassDamperOff = .FALSE. ENDIF ENDIF ENDIF ELSEIF ( PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid ) THEN !PlantLoopNum = PVT(PVTNum)%PlantLoopNum ! mdot = Node(PVT(PVTNum)%PlantInletNodeNum)%MassFlowRate !If (.NOT. Allocated(PlantReport)) RETURN ! this can happen early before plant is setup IF (PVT(PVTnum)%PVTModelType == SimplePVTmodel) THEN IF (QRadSWOutIncident(SurfNum) > MinIrradiance) THEN ! is heating wanted? ! IF (mdot > 0.0D0) THEN ! If (PlantReport(PlantLoopNum)%HeatingDemand > 0.0) THEN PVT(PVTnum)%HeatingUseful = .TRUE. ! PVT(PVTnum)%CoolingUseful = .FALSE. PVT(PVTnum)%BypassDamperOff = .TRUE. ! ELSE ! PVT(PVTnum)%HeatingUseful = .FALSE. ! PVT(PVTnum)%CoolingUseful = .TRUE. ! PVT(PVTnum)%BypassDamperOff = .FALSE. ! ENDIF ELSE ! is cooling wanted? ! IF (mdot > 0.0D0) THEN ! If (PlantReport(PlantLoopNum)%CoolingDemand > 0.0) THEN ! PVT(PVTnum)%CoolingUseful = .TRUE. ! PVT(PVTnum)%HeatingUseful = .FALSE. ! PVT(PVTnum)%BypassDamperOff = .TRUE. ! ELSE PVT(PVTnum)%CoolingUseful = .FALSE. ! PVT(PVTnum)%HeatingUseful = .TRUE. PVT(PVTnum)%BypassDamperOff = .FALSE. ! ENDIF ENDIF ENDIF ENDIF RETURN END SUBROUTINE ControlPVTcollector SUBROUTINE CalcPVTcollectors(PVTnum) ! SUBROUTINE INFORMATION: ! AUTHOR Brent Griffith ! DATE WRITTEN August 2008 ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! Calculate PVT collector thermal ! METHODOLOGY EMPLOYED: ! Current model is "simple" fixed efficiency and simple night sky balance for cooling ! REFERENCES: ! na ! USE STATEMENTS: USE DataHeatBalance, ONLY: VerySmooth, QRadSWOutIncident USE Psychrometrics , ONLY: CPHW, PsyCpAirFnWTdb, PsyTwbFnTdbWPb, PsyTdpFnTdbTwbPb USE DataGlobals, ONLY: SecInHour USE DataHVACGlobals, ONLY: TimeStepSys USE DataLoopNode , ONLY: Node USE ScheduleManager, ONLY: GetCurrentScheduleValue USE DataEnvironment, ONLY: OutDryBulbTemp, SkyTemp, OutBaroPress USE ConvectionCoefficients, ONLY: InitExteriorConvectionCoeff IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(IN) :: PVTnum ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS: ! na ! DERIVED TYPE DEFINITIONS: ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: InletNode = 0 INTEGER :: OutletNode = 0 REAL(r64) :: Eff = 0.0D0 INTEGER :: SurfNum = 0 INTEGER :: RoughSurf = 0 REAL(r64) :: HcExt = 0.0D0 REAL(r64) :: HrSky = 0.0D0 REAL(r64) :: HrGround = 0.0D0 REAL(r64) :: HrAir = 0.0D0 REAL(r64) :: Tcollector = 0.0D0 REAL(r64) :: mdot = 0.0D0 REAL(r64) :: Tinlet = 0.0D0 REAL(r64) :: Winlet = 0.0D0 REAL(r64) :: CpInlet = 0.0D0 REAL(r64) :: PotentialOutletTemp = 0.0D0 REAL(r64) :: BypassFraction = 0.0D0 REAL(r64) :: PotentialHeatGain = 0.0D0 REAL(r64) :: WetBulbInlet = 0.0D0 REAL(r64) :: DewPointInlet = 0.0D0 ! flow SurfNum = PVT(PVTnum)%SurfNum RoughSurf = VerySmooth SELECT CASE (PVT(PVTnum)% WorkingFluidType) CASE (LiquidWorkingFluid) InletNode = PVT(PVTnum)%PlantInletNodeNum OutletNode = PVT(PVTnum)%PlantOutletNodeNum CASE (AirWorkingFluid) InletNode = PVT(PVTnum)%HVACInletNodeNum OutletNode = PVT(PVTnum)%HVACOutletNodeNum END SELECT mdot = PVT(PVTnum)%MassFlowRate Tinlet = Node(InletNode)%Temp IF (PVT(PVTnum)%PVTModelType == SimplePVTmodel) THEN IF (PVT(PVTnum)%HeatingUseful .AND. PVT(PVTnum)%BypassDamperOff .AND. (mdot > 0.0D0)) THEN SELECT CASE (PVT(PVTnum)%Simple%ThermEfficMode) CASE (FixedThermEffic) Eff = PVT(PVTnum)%Simple%ThermEffic CASE (ScheduledThermEffic) Eff = GetCurrentScheduleValue(PVT(PVTnum)%Simple%ThermEffSchedNum) PVT(PVTnum)%Simple%ThermEffic = Eff END SELECT PotentialHeatGain = QRadSWOutIncident(SurfNum) * Eff * PVT(PVTnum)%AreaCol IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN Winlet = Node(InletNode)%HumRat CpInlet = PsyCpAirFnWTdb(Winlet,Tinlet, 'CalcPVTcollectors') IF (mdot*CpInlet > 0.0D0) THEN PotentialOutletTemp = Tinlet + PotentialHeatGain /(mdot * CpInlet) ELSE PotentialOutletTemp = Tinlet ENDIF !now compare heating potential to setpoint and figure bypass fraction If (PotentialOutletTemp > Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint) Then ! need to modulate If (Tinlet /= PotentialOutletTemp) Then BypassFraction = (Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint - PotentialOutletTemp) & /(Tinlet - PotentialOutletTemp) ELSE BypassFraction = 0.0D0 ENDIF BypassFraction = MAX(0.0D0, BypassFraction) PotentialOutletTemp = Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint PotentialHeatGain = mdot * PsyCpAirFnWTdb(Winlet,Tinlet, 'CalcPVTcollectors') & *(PotentialOutletTemp - Tinlet) ELSE BypassFraction = 0.0D0 ENDIF ELSEIf ( PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid ) THEN CpInlet = CPHW(Tinlet) IF (mdot * CpInlet /= 0.0D0) THEN ! protect divide by zero PotentialOutletTemp = Tinlet + PotentialHeatGain/(mdot * CpInlet) ELSE PotentialOutletTemp = Tinlet ENDIF BypassFraction = 0.0D0 ENDIF PVT(PVTnum)%Report%ThermEfficiency = Eff PVT(PVTnum)%Report%ThermHeatGain = PotentialHeatGain PVT(PVTnum)%Report%ThermPower = PVT(PVTnum)%Report%ThermHeatGain PVT(PVTnum)%Report%ThermEnergy = PVT(PVTnum)%Report%ThermPower * TimeStepSys * SecInHour PVT(PVTnum)%Report%ThermHeatLoss = 0.0D0 PVT(PVTnum)%Report%TinletWorkFluid = Tinlet PVT(PVTnum)%Report%MdotWorkFluid = mdot PVT(PVTnum)%Report%ToutletWorkFluid = PotentialOutletTemp PVT(PVTnum)%Report%BypassStatus = BypassFraction ELSEIF (PVT(PVTnum)%CoolingUseful .AND. PVT(PVTnum)%BypassDamperOff .AND. (mdot > 0.0D0 ) ) THEN !calculate cooling using energy balance CALL InitExteriorConvectionCoeff(SurfNum,0.0D0,RoughSurf,PVT(PVTnum)%Simple%SurfEmissivity, & PVT(PVTnum)%Simple%LastCollectorTemp, & HcExt,HrSky,HrGround,HrAir) IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN Winlet = Node(InletNode)%HumRat CpInlet = PsyCpAirFnWTdb(Winlet,Tinlet, 'CalcPVTcollectors') WetBulbInlet = PsyTwbFnTdbWPb(Tinlet, Winlet, OutBaroPress, 'CalcPVTcollectors') DewPointInlet = PsyTdpFnTdbTwbPb(Tinlet, WetBulbInlet, OutBaroPress, 'CalcPVTcollectors') ELSEIf ( PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid ) THEN CpInlet = CPHW(Tinlet) ENDIF Tcollector = ( 2.0D0 * mdot * CpInlet * Tinlet & + PVT(PVTnum)%AreaCol *( & HrGround * OutDryBulbTemp & + HrSky * SkyTemp & + HrAir * Surface(SurfNum)%OutDryBulbTemp & + HcExt * Surface(SurfNum)%OutDryBulbTemp) ) & / (2.0D0 * mdot * CpInlet + PVT(PVTnum)%AreaCol *(HrGround + HrSky + HrAir + HcExt) ) PotentialOutletTemp = 2.0D0 * Tcollector - Tinlet PVT(PVTnum)%Report%ToutletWorkFluid =PotentialOutletTemp ! trap for air not being cooled below its wetbulb. IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN IF (PotentialOutletTemp < DewPointInlet) THEN ! water removal would be needed.. not going to allow that for now. limit cooling to dew point and model bypass IF (Tinlet /= PotentialOutletTemp) THEN BypassFraction = (DewPointInlet - PotentialOutletTemp) & /(Tinlet - PotentialOutletTemp) ELSE BypassFraction = 0.0D0 ENDIF BypassFraction = MAX(0.0D0, BypassFraction) PotentialOutletTemp = DewPointInlet ENDIF ENDIF PVT(PVTnum)%Report%MdotWorkFluid = mdot PVT(PVTnum)%Report%TinletWorkFluid = Tinlet PVT(PVTnum)%Report%ToutletWorkFluid = PotentialOutletTemp PVT(PVTnum)%Report%ThermHeatLoss = mdot * CpInlet *(Tinlet - PVT(PVTnum)%Report%ToutletWorkFluid) PVT(PVTnum)%Report%ThermHeatGain = 0.0D0 PVT(PVTnum)%Report%ThermPower = -1.0D0 * PVT(PVTnum)%Report%ThermHeatLoss PVT(PVTnum)%Report%ThermEnergy = PVT(PVTnum)%Report%ThermPower * TimeStepSys * SecInHour PVT(PVTnum)%Report%ThermEfficiency = 0.0D0 PVT(PVTnum)%Simple%LastCollectorTemp = Tcollector PVT(PVTnum)%Report%BypassStatus = 0.0D0 ELSEIF (.NOT. PVT(PVTnum)%BypassDamperOff) THEN ! bypassed, zero things out PVT(PVTnum)%Report%TinletWorkFluid = Tinlet PVT(PVTnum)%Report%ToutletWorkFluid = Tinlet PVT(PVTnum)%Report%ThermHeatLoss = 0.0D0 PVT(PVTnum)%Report%ThermHeatGain = 0.0D0 PVT(PVTnum)%Report%ThermPower = 0.0D0 PVT(PVTnum)%Report%ThermEfficiency = 0.0D0 PVT(PVTnum)%Report%ThermEnergy = 0.0D0 PVT(PVTnum)%Report%BypassStatus = 1.0D0 PVT(PVTnum)%Report%MdotWorkFluid = mdot ELSE PVT(PVTnum)%Report%TinletWorkFluid = Tinlet PVT(PVTnum)%Report%ToutletWorkFluid = Tinlet PVT(PVTnum)%Report%ThermHeatLoss = 0.0D0 PVT(PVTnum)%Report%ThermHeatGain = 0.0D0 PVT(PVTnum)%Report%ThermPower = 0.0D0 PVT(PVTnum)%Report%ThermEfficiency = 0.0D0 PVT(PVTnum)%Report%ThermEnergy = 0.0D0 PVT(PVTnum)%Report%BypassStatus = 1.0D0 PVT(PVTnum)%Report%MdotWorkFluid = mdot ENDIF ENDIF RETURN END SUBROUTINE CalcPVTcollectors SUBROUTINE UpdatePVTcollectors(PVTnum) ! SUBROUTINE INFORMATION: ! AUTHOR Brent Griffith ! DATE WRITTEN August 2008 ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! <description> ! METHODOLOGY EMPLOYED: ! <description> ! REFERENCES: ! na ! USE STATEMENTS: USE DataLoopNode, ONLY: Node USE Psychrometrics, ONLY: PsyHFnTdbW USE PlantUtilities, ONLY: SafeCopyPlantNode IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(IN) :: PVTNum ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS: ! na ! DERIVED TYPE DEFINITIONS: ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: InletNode INTEGER :: OutletNode SELECT CASE (PVT(PVTnum)% WorkingFluidType) CASE (LiquidWorkingFluid) InletNode = PVT(PVTnum)%PlantInletNodeNum OutletNode = PVT(PVTnum)%PlantOutletNodeNum CALL SafeCopyPlantNode(InletNode, OutletNode) Node(OutletNode)%Temp = PVT(PVTnum)%Report%ToutletWorkFluid CASE (AirWorkingFluid) InletNode = PVT(PVTnum)%HVACInletNodeNum OutletNode = PVT(PVTnum)%HVACOutletNodeNum ! Set the outlet nodes for properties that just pass through & not used Node(OutletNode)%Quality = Node(InletNode)%Quality Node(OutletNode)%Press = Node(InletNode)%Press Node(OutletNode)%MassFlowRate = Node(InletNode)%MassFlowRate Node(OutletNode)%MassFlowRateMin = Node(InletNode)%MassFlowRateMin Node(OutletNode)%MassFlowRateMax = Node(InletNode)%MassFlowRateMax Node(OutletNode)%MassFlowRateMinAvail = Node(InletNode)%MassFlowRateMinAvail Node(OutletNode)%MassFlowRateMaxAvail = Node(InletNode)%MassFlowRateMaxAvail ! Set outlet node variables that are possibly changed Node(OutletNode)%Temp = PVT(PVTnum)%Report%ToutletWorkFluid Node(OutletNode)%HumRat = Node(InletNode)%HumRat ! assumes dewpoint bound on cooling .... Node(OutletNode)%Enthalpy = PsyHFnTdbW( PVT(PVTnum)%Report%ToutletWorkFluid , & Node(OutletNode)%HumRat ) END SELECT RETURN END SUBROUTINE UpdatePVTcollectors SUBROUTINE GetPVTThermalPowerProduction(PVindex, ThermalPower, ThermalEnergy) ! SUBROUTINE INFORMATION: ! AUTHOR <author> ! DATE WRITTEN <date_written> ! MODIFIED na ! RE-ENGINEERED na ! PURPOSE OF THIS SUBROUTINE: ! <description> ! METHODOLOGY EMPLOYED: ! <description> ! REFERENCES: ! na ! USE STATEMENTS: ! na IMPLICIT NONE ! Enforce explicit typing of all variables in this routine ! SUBROUTINE ARGUMENT DEFINITIONS: INTEGER, INTENT(IN) :: PVindex ! index of PV generator (not PVT collector) REAL(r64), INTENT(OUT) :: ThermalPower REAL(r64), INTENT(OUT) :: ThermalEnergy ! SUBROUTINE PARAMETER DEFINITIONS: ! na ! INTERFACE BLOCK SPECIFICATIONS: ! na ! DERIVED TYPE DEFINITIONS: ! na ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: INTEGER :: PVTnum = 0 INTEGER :: Loop = 0 ! first find PVT index that is associated with this PV generator DO loop = 1, NumPVT IF (.not. PVT(loop)%PVfound) CYCLE IF (PVT(loop)%PVnum == PVindex) THEN ! we found it PVTnum = loop ENDIF ENDDO IF (PVTnum > 0) THEN ThermalPower = PVT(PVTnum)%report%ThermPower ThermalEnergy = PVT(PVTnum)%report%ThermEnergy ELSE ThermalPower = 0.0D0 ThermalEnergy = 0.0D0 ENDIF RETURN END SUBROUTINE GetPVTThermalPowerProduction !===================== Utility/Other routines for module. ! Insert as appropriate ! NOTICE ! ! Copyright © 1996-2013 The Board of Trustees of the University of Illinois ! and The Regents of the University of California through Ernest Orlando Lawrence ! Berkeley National Laboratory. All rights reserved. ! ! Portions of the EnergyPlus software package have been developed and copyrighted ! by other individuals, companies and institutions. These portions have been ! incorporated into the EnergyPlus software package under license. For a complete ! list of contributors, see "Notice" located in EnergyPlus.f90. ! ! NOTICE: The U.S. Government is granted for itself and others acting on its ! behalf a paid-up, nonexclusive, irrevocable, worldwide license in this data to ! reproduce, prepare derivative works, and perform publicly and display publicly. ! Beginning five (5) years after permission to assert copyright is granted, ! subject to two possible five year renewals, the U.S. Government is granted for ! itself and others acting on its behalf a paid-up, non-exclusive, irrevocable ! worldwide license in this data to reproduce, prepare derivative works, ! distribute copies to the public, perform publicly and display publicly, and to ! permit others to do so. ! ! TRADEMARKS: EnergyPlus is a trademark of the US Department of Energy. ! END MODULE PhotovoltaicThermalCollectors
nrgsim/EnergyPlus-Fortran
PhotovoltaicThermalCollectors.f90
FORTRAN
mpl-2.0
56,029
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // DevOps API // // Use the DevOps APIs to create a DevOps project to group the pipelines, add reference to target deployment environments, add artifacts to deploy, and create deployment pipelines needed to deploy your software. // package devops import ( "encoding/json" "github.com/oracle/oci-go-sdk/v46/common" ) // AutomatedDeployStageRollbackPolicy Specifies the automated rollback policy for a stage on failure. type AutomatedDeployStageRollbackPolicy struct { } func (m AutomatedDeployStageRollbackPolicy) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m AutomatedDeployStageRollbackPolicy) MarshalJSON() (buff []byte, e error) { type MarshalTypeAutomatedDeployStageRollbackPolicy AutomatedDeployStageRollbackPolicy s := struct { DiscriminatorParam string `json:"policyType"` MarshalTypeAutomatedDeployStageRollbackPolicy }{ "AUTOMATED_STAGE_ROLLBACK_POLICY", (MarshalTypeAutomatedDeployStageRollbackPolicy)(m), } return json.Marshal(&s) }
oracle/terraform-provider-baremetal
vendor/github.com/oracle/oci-go-sdk/v46/devops/automated_deploy_stage_rollback_policy.go
GO
mpl-2.0
1,395
// Localization module.exports = function localizationInitializer() { var i18n = require('../extensions/i18n-namespace') , i18nConfiguration = { defaultLocale : 'en', locales:['en', 'fr'], directory: __dirname + '/../../app/locales/', updateFiles: false, cookie: 'lang' }; // lambda for hogan-express this.set('lambdas', { "localizeLambda": function(text, hogan, context){ return text; } }); switch (this.env) { case 'production': break; case 'staging' : break; case 'development' : i18nConfiguration.updateFiles = true; break; } i18n.configure(i18nConfiguration); };
alloplastic/Choreo
config/initializers/02_localization.js
JavaScript
mpl-2.0
639
package main import "github.com/hashicorp/packer/packer/plugin" import "github.com/jetbrains-infra/packer-builder-vsphere/iso" func main() { server, err := plugin.Server() if err != nil { panic(err) } err = server.RegisterBuilder(new(iso.Builder)) if err != nil { panic(err) } server.Serve() }
jetbrains-infra/packer-builder-vsphere
cmd/iso/main.go
GO
mpl-2.0
307
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `Binary` trait in crate `std`."> <meta name="keywords" content="rust, rustlang, rust-lang, Binary"> <title>std::fmt::Binary - Rust</title> <link rel="stylesheet" type="text/css" href="../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>fmt</a></p><script>window.sidebarCurrent = {name: 'Binary', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content trait"> <h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>std</a>::<wbr><a href='index.html'>fmt</a>::<wbr><a class='trait' href=''>Binary</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-42038' class='srclink' href='../../core/fmt/trait.Binary.html?gotosrc=42038' title='goto source code'>[src]</a></span></h1> <pre class='rust trait'>pub trait Binary { fn <a href='#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, &amp;mut <a class='struct' href='../../std/fmt/struct.Formatter.html' title='std::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='../../std/result/enum.Result.html' title='std::result::Result'>Result</a>&lt;<a class='primitive' href='../primitive.tuple.html'>()</a>,&nbsp;<a class='struct' href='../../std/fmt/struct.Error.html' title='std::fmt::Error'>Error</a>&gt;; }</pre><div class='docblock'><p>Format trait for the <code>b</code> character.</p> <p>The <code>Binary</code> trait should format its output as a number in binary.</p> <p>The alternate flag, <code>#</code>, adds a <code>0b</code> in front of the output.</p> <p>For more information on formatters, see <a href="../../std/fmt/index.html">the module-level documentation</a>.</p> <h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1> <p>Basic usage with <code>i32</code>:</p> <span class='rusttest'>fn main() { let x = 42; // 42 is &#39;101010&#39; in binary assert_eq!(format!(&quot;{:b}&quot;, x), &quot;101010&quot;); assert_eq!(format!(&quot;{:#b}&quot;, x), &quot;0b101010&quot;); }</span><pre class='rust rust-example-rendered'> <span class='kw'>let</span> <span class='ident'>x</span> <span class='op'>=</span> <span class='number'>42</span>; <span class='comment'>// 42 is &#39;101010&#39; in binary</span> <span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='macro'>format</span><span class='macro'>!</span>(<span class='string'>&quot;{:b}&quot;</span>, <span class='ident'>x</span>), <span class='string'>&quot;101010&quot;</span>); <span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='macro'>format</span><span class='macro'>!</span>(<span class='string'>&quot;{:#b}&quot;</span>, <span class='ident'>x</span>), <span class='string'>&quot;0b101010&quot;</span>);</pre> <p>Implementing <code>Binary</code> on a type:</p> <span class='rusttest'>fn main() { use std::fmt; struct Length(i32); impl fmt::Binary for Length { fn fmt(&amp;self, f: &amp;mut fmt::Formatter) -&gt; fmt::Result { let val = self.0; write!(f, &quot;{:b}&quot;, val) // delegate to i32&#39;s implementation } } let l = Length(107); println!(&quot;l as binary is: {:b}&quot;, l); }</span><pre class='rust rust-example-rendered'> <span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>fmt</span>; <span class='kw'>struct</span> <span class='ident'>Length</span>(<span class='ident'>i32</span>); <span class='kw'>impl</span> <span class='ident'>fmt</span>::<span class='ident'>Binary</span> <span class='kw'>for</span> <span class='ident'>Length</span> { <span class='kw'>fn</span> <span class='ident'>fmt</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>f</span>: <span class='kw-2'>&amp;</span><span class='kw-2'>mut</span> <span class='ident'>fmt</span>::<span class='ident'>Formatter</span>) <span class='op'>-&gt;</span> <span class='ident'>fmt</span>::<span class='prelude-ty'>Result</span> { <span class='kw'>let</span> <span class='ident'>val</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='number'>0</span>; <span class='macro'>write</span><span class='macro'>!</span>(<span class='ident'>f</span>, <span class='string'>&quot;{:b}&quot;</span>, <span class='ident'>val</span>) <span class='comment'>// delegate to i32&#39;s implementation</span> } } <span class='kw'>let</span> <span class='ident'>l</span> <span class='op'>=</span> <span class='ident'>Length</span>(<span class='number'>107</span>); <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;l as binary is: {:b}&quot;</span>, <span class='ident'>l</span>);</pre> </div> <h2 id='required-methods'>Required Methods</h2> <div class='methods'> <h3 id='tymethod.fmt' class='method stab '><code>fn <a href='#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, &amp;mut <a class='struct' href='../../std/fmt/struct.Formatter.html' title='std::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='../../std/result/enum.Result.html' title='std::result::Result'>Result</a>&lt;<a class='primitive' href='../primitive.tuple.html'>()</a>,&nbsp;<a class='struct' href='../../std/fmt/struct.Error.html' title='std::fmt::Error'>Error</a>&gt;</code></h3><div class='docblock'><p>Formats the value using the given formatter.</p> </div></div> <h2 id='implementors'>Implementors</h2> <ul class='item-list' id='implementors-list'> <li><code>impl&lt;T&gt; Binary for <a class='struct' href='../../std/num/struct.Wrapping.html' title='std::num::Wrapping'>Wrapping</a>&lt;T&gt; <span class='where'>where T: <a class='trait' href='../../std/fmt/trait.Binary.html' title='std::fmt::Binary'>Binary</a></span></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.isize.html'>isize</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.usize.html'>usize</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.i8.html'>i8</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.u8.html'>u8</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.i16.html'>i16</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.u16.html'>u16</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.i32.html'>i32</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.u32.html'>u32</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.i64.html'>i64</a></code></li> <li><code>impl Binary for <a class='primitive' href='../primitive.u64.html'>u64</a></code></li> <li><code>impl&lt;'a,&nbsp;T&gt; Binary for &amp;'a T <span class='where'>where T: <a class='trait' href='../../std/fmt/trait.Binary.html' title='std::fmt::Binary'>Binary</a> + ?<a class='trait' href='../../std/marker/trait.Sized.html' title='std::marker::Sized'>Sized</a></span></code></li> <li><code>impl&lt;'a,&nbsp;T&gt; Binary for &amp;'a mut T <span class='where'>where T: <a class='trait' href='../../std/fmt/trait.Binary.html' title='std::fmt::Binary'>Binary</a> + ?<a class='trait' href='../../std/marker/trait.Sized.html' title='std::marker::Sized'>Sized</a></span></code></li> </ul><script type="text/javascript" async src="../../implementors/core/fmt/trait.Binary.js"> </script></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "std"; window.playgroundUrl = "https://play.rust-lang.org/"; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script src="../../playpen.js"></script> <script defer src="../../search-index.js"></script> </body> </html>
servo/doc.servo.org
std/fmt/trait.Binary.html
HTML
mpl-2.0
10,996
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `PreferenceApplied` struct in crate `hyper`."> <meta name="keywords" content="rust, rustlang, rust-lang, PreferenceApplied"> <title>hyper::header::preference_applied::PreferenceApplied - Rust</title> <link rel="stylesheet" type="text/css" href="../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../../index.html'>hyper</a>::<wbr><a href='../index.html'>header</a>::<wbr><a href='index.html'>preference_applied</a></p><script>window.sidebarCurrent = {name: 'PreferenceApplied', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content struct"> <h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>hyper</a>::<wbr><a href='../index.html'>header</a>::<wbr><a href='index.html'>preference_applied</a>::<wbr><a class='struct' href=''>PreferenceApplied</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-4226' class='srclink' href='../../../src/hyper/header/common/preference_applied.rs.html#47' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct PreferenceApplied(pub <a class='struct' href='../../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='enum' href='../../../hyper/header/enum.Preference.html' title='hyper::header::Preference'>Preference</a>&gt;);</pre><div class='docblock'><p><code>Preference-Applied</code> header, defined in <a href="http://tools.ietf.org/html/rfc7240">RFC7240</a></p> <p>The <code>Preference-Applied</code> response header may be included within a response message as an indication as to which <code>Prefer</code> header tokens were honored by the server and applied to the processing of a request.</p> <h1 id='abnf' class='section-header'><a href='#abnf'>ABNF</a></h1> <pre><code class="language-plain">Preference-Applied = &quot;Preference-Applied&quot; &quot;:&quot; 1#applied-pref applied-pref = token [ BWS &quot;=&quot; BWS word ] </code></pre> <h1 id='example-values' class='section-header'><a href='#example-values'>Example values</a></h1> <ul> <li><code>respond-async</code></li> <li><code>return=minimal</code></li> <li><code>wait=30</code></li> </ul> <h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1> <pre class='rust rust-example-rendered'> <span class='kw'>use</span> <span class='ident'>hyper</span>::<span class='ident'>header</span>::{<span class='ident'>Headers</span>, <span class='ident'>PreferenceApplied</span>, <span class='ident'>Preference</span>}; <span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>headers</span> <span class='op'>=</span> <span class='ident'>Headers</span>::<span class='ident'>new</span>(); <span class='ident'>headers</span>.<span class='ident'>set</span>( <span class='ident'>PreferenceApplied</span>(<span class='macro'>vec</span><span class='macro'>!</span>[<span class='ident'>Preference</span>::<span class='ident'>RespondAsync</span>]) );</pre> <pre class='rust rust-example-rendered'> <span class='kw'>use</span> <span class='ident'>hyper</span>::<span class='ident'>header</span>::{<span class='ident'>Headers</span>, <span class='ident'>PreferenceApplied</span>, <span class='ident'>Preference</span>}; <span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>headers</span> <span class='op'>=</span> <span class='ident'>Headers</span>::<span class='ident'>new</span>(); <span class='ident'>headers</span>.<span class='ident'>set</span>( <span class='ident'>PreferenceApplied</span>(<span class='macro'>vec</span><span class='macro'>!</span>[ <span class='ident'>Preference</span>::<span class='ident'>RespondAsync</span>, <span class='ident'>Preference</span>::<span class='ident'>ReturnRepresentation</span>, <span class='ident'>Preference</span>::<span class='ident'>Wait</span>(<span class='number'>10u32</span>), <span class='ident'>Preference</span>::<span class='ident'>Extension</span>(<span class='string'>&quot;foo&quot;</span>.<span class='ident'>to_owned</span>(), <span class='string'>&quot;bar&quot;</span>.<span class='ident'>to_owned</span>(), <span class='macro'>vec</span><span class='macro'>!</span>[]), ]) );</pre> </div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../../"; window.currentCrate = "hyper"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script defer src="../../../search-index.js"></script> </body> </html>
servo/doc.servo.org
hyper/header/preference_applied/struct.PreferenceApplied.html
HTML
mpl-2.0
7,485
/* Copyright 2012 KeepSafe Software Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.keepsafe.switchboard; import android.content.Context; import android.content.SharedPreferences; import android.support.annotation.Nullable; /** * Application preferences for SwitchBoard. * @author Philipp Berner * */ public class Preferences { private static final String switchBoardSettings = "com.keepsafe.switchboard.settings"; private static final String CONFIG_JSON = "config-json"; private static final String OVERRIDE_PREFIX = "experiment.override."; /** * Gets the user config as a JSON string. * @param c Context * @return Config JSON */ @Nullable public static String getDynamicConfigJson(Context c) { final SharedPreferences prefs = c.getApplicationContext().getSharedPreferences(switchBoardSettings, Context.MODE_PRIVATE); return prefs.getString(CONFIG_JSON, null); } /** * Saves the user config as a JSON sting. * @param c Context * @param configJson Config JSON */ public static void setDynamicConfigJson(Context c, String configJson) { final SharedPreferences.Editor editor = c.getApplicationContext(). getSharedPreferences(switchBoardSettings, Context.MODE_PRIVATE).edit(); editor.putString(CONFIG_JSON, configJson); editor.apply(); } /** * Gets the override value for an experiment. * * @param c Context * @param experimentName Experiment name * @return Whether or not the experiment should be enabled, or null if there is no override. */ @Nullable public static Boolean getOverrideValue(Context c, String experimentName) { final SharedPreferences prefs = c.getApplicationContext(). getSharedPreferences(switchBoardSettings, Context.MODE_PRIVATE); final String key = OVERRIDE_PREFIX + experimentName; if (prefs.contains(key)) { // This will never fall back to the default value. return prefs.getBoolean(key, false); } // Default to returning null if no override was found. return null; } /** * Saves an override value for an experiment. * * @param c Context * @param experimentName Experiment name * @param isEnabled Whether or not to enable the experiment */ public static void setOverrideValue(Context c, String experimentName, boolean isEnabled) { final SharedPreferences.Editor editor = c.getApplicationContext(). getSharedPreferences(switchBoardSettings, Context.MODE_PRIVATE).edit(); editor.putBoolean(OVERRIDE_PREFIX + experimentName, isEnabled); editor.apply(); } /** * Clears the override value for an experiment. * * @param c Context * @param experimentName Experiment name */ public static void clearOverrideValue(Context c, String experimentName) { final SharedPreferences.Editor editor = c.getApplicationContext(). getSharedPreferences(switchBoardSettings, Context.MODE_PRIVATE).edit(); editor.remove(OVERRIDE_PREFIX + experimentName); editor.apply(); } }
Yukarumya/Yukarum-Redfoxes
mobile/android/thirdparty/com/keepsafe/switchboard/Preferences.java
Java
mpl-2.0
3,735
/** This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package myjava.gui.option; import java.awt.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.tree.*; import java.util.*; import exec.*; import myjava.gui.*; import myjava.gui.common.*; public class OptionDialog extends JDialog implements TreeSelectionListener, Resources { private CardLayout centerCardLayout = new CardLayout(); private JPanel centerPanel = new JPanel(centerCardLayout); private DefaultMutableTreeNode root = new DefaultMutableTreeNode("Options"); private JTree tree = new JTree(root); private Set<OptionTab> tabSet = OptionTab.getAllTabs(); private OptionDialog(Frame parent) { super(parent, "Preferences", true); //setup tree tree.setFont(f13); tree.addTreeSelectionListener(this); //add tabs for (OptionTab tab: tabSet) { String tabName = tab.getName(); root.add(new DefaultMutableTreeNode(tabName)); centerPanel.add(tabName, tab); } this.add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(tree), centerPanel), BorderLayout.CENTER); ((DefaultTreeModel)(tree.getModel())).reload(root); tree.expandPath(tree.getSelectionPath()); } @Override public void valueChanged(TreeSelectionEvent ev) { TreePath path = ev.getNewLeadSelectionPath(); String selected = (String)(((DefaultMutableTreeNode)(path.getLastPathComponent())).getUserObject()); if (selected != null) { if (!("Options").equals(selected)) { centerCardLayout.show(centerPanel, selected); } } } public static void showDialog(Frame parent) { SourceManager.loadConfig(); //restore toolbar to original location MyToolBar.getInstance().setUI(new StopFloatingToolBarUI()); MyToolBar.getInstance().updateUI(); MyCompileToolBar.getInstance().setUI(new StopFloatingToolBarUI()); MyCompileToolBar.getInstance().updateUI(); //build dialog OptionDialog dialog = new OptionDialog(parent); dialog.pack(); dialog.setLocationRelativeTo(parent); dialog.setVisible(true); /* * closed */ for (OptionTab tab: dialog.tabSet) { tab.onExit(); } SourceManager.saveConfig(); for (Tab tab: MainPanel.getAllTab()) { tab.update(); } } }
tony200910041/RefluxEdit
myjava/gui/option/OptionDialog.java
Java
mpl-2.0
2,355
<!DOCTYPE html> <html> <head> <title>Which Animal Are You?</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src = "JQuery.js"></script> <script type="text/javascript" src = "script.js"></script> <link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'> </head> <body style = "text-align:center; background-color:#222; color:#FFF;"> <h1>Thank You For Taking Our Quiz!</h1> <a href = "#"> Start Again!</a> </body> </html>
mattbspector/206Quiz
Finished.html
HTML
mpl-2.0
522
namespace uSync.Core.Serialization { public static class SyncOptionsExtensions { /// <summary> /// perform the removal of properties and items. /// </summary> public static bool DeleteItems(this SyncSerializerOptions options) => !options.GetSetting<bool>(uSyncConstants.DefaultSettings.NoRemove, uSyncConstants.DefaultSettings.NoRemove_Default); } }
KevinJump/uSync
uSync.Core/Serialization/SyncOptionsExtensions.cs
C#
mpl-2.0
411
using Alex.Blocks.Materials; namespace Alex.Blocks.Minecraft.Walls { public class CobblestoneWall : AbstractWall { public CobblestoneWall() : base() { Solid = true; Transparent = true; BlockMaterial = Material.Stone; } } }
kennyvv/Alex
src/Alex/Blocks/Minecraft/Walls/CobblestoneWall.cs
C#
mpl-2.0
243
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `MAP_FLUSH_EXPLICIT_BIT` constant in crate `gleam`."> <meta name="keywords" content="rust, rustlang, rust-lang, MAP_FLUSH_EXPLICIT_BIT"> <title>gleam::ffi::MAP_FLUSH_EXPLICIT_BIT - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>gleam</a>::<wbr><a href='index.html'>ffi</a></p><script>window.sidebarCurrent = {name: 'MAP_FLUSH_EXPLICIT_BIT', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>gleam</a>::<wbr><a href='index.html'>ffi</a>::<wbr><a class='constant' href=''>MAP_FLUSH_EXPLICIT_BIT</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-2270' class='srclink' href='../../src/gleam///home/servo/buildbot/slave/doc/build/target/debug/build/gleam-9662459d59abad25/out/gl_bindings.rs.html#167' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const MAP_FLUSH_EXPLICIT_BIT: <a class='type' href='../../gleam/gl/types/type.GLenum.html' title='gleam::gl::types::GLenum'>GLenum</a><code> = </code><code>0x0010</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "gleam"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
susaing/doc.servo.org
gleam/ffi/constant.MAP_FLUSH_EXPLICIT_BIT.html
HTML
mpl-2.0
4,119
/* * Copyright © 2013-2021, The SeedStack authors <http://seedstack.org> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.seedstack.coffig; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) public @interface SingleValue { }
seedstack/coffig
src/main/java/org/seedstack/coffig/SingleValue.java
Java
mpl-2.0
666
/* * Copyright (c) 2014 Universal Technical Resource Services, Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Windows.Forms; namespace ATMLCommonLibrary.forms { public partial class ATMLPleaseWait : Form { private static Dictionary<string, ATMLPleaseWait> _instances = new Dictionary<string, ATMLPleaseWait>(); public ATMLPleaseWait() { InitializeComponent(); } public static string Show(string message) { string key = Guid.NewGuid().ToString(); ATMLPleaseWait form = new ATMLPleaseWait(); form.lblMessage.Text = message; form.Show(); _instances.Add( key, form ); return key; } public static void Hide(string key) { if (_instances.ContainsKey(key)) { ATMLPleaseWait form = _instances[key]; form.Close(); _instances.Remove(key); } } } }
UtrsSoftware/ATMLWorkBench
ATMLLibraries/ATMLCommonLibrary/forms/ATMLPleaseWait.cs
C#
mpl-2.0
1,417
/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; // Tests changing viewport DPR const TEST_URL = "data:text/html;charset=utf-8,DPR list test"; const DEFAULT_DPPX = window.devicePixelRatio; const VIEWPORT_DPPX = DEFAULT_DPPX + 2; const Types = require("devtools/client/responsive.html/types"); const testDevice = { "name": "Fake Phone RDM Test", "width": 320, "height": 470, "pixelRatio": 5.5, "userAgent": "Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0", "touch": true, "firefoxOS": true, "os": "custom", "featured": true, }; // Add the new device to the list addDeviceForTest(testDevice); addRDMTask(TEST_URL, function* ({ ui, manager }) { yield waitStartup(ui); yield testDefaults(ui); yield testChangingDevice(ui); yield testResetWhenResizingViewport(ui); yield testChangingDPR(ui); }); function* waitStartup(ui) { let { store } = ui.toolWindow; // Wait until the viewport has been added and the device list has been loaded yield waitUntilState(store, state => state.viewports.length == 1 && state.devices.listState == Types.deviceListState.LOADED); } function* testDefaults(ui) { info("Test Defaults"); yield testDevicePixelRatio(ui, window.devicePixelRatio); testViewportDPRSelect(ui, {value: window.devicePixelRatio, disabled: false}); testViewportDeviceSelectLabel(ui, "no device selected"); } function* testChangingDevice(ui) { info("Test Changing Device"); let waitPixelRatioChange = onceDevicePixelRatioChange(ui); yield selectDevice(ui, testDevice.name); yield waitForViewportResizeTo(ui, testDevice.width, testDevice.height); yield waitPixelRatioChange; yield testDevicePixelRatio(ui, testDevice.pixelRatio); testViewportDPRSelect(ui, {value: testDevice.pixelRatio, disabled: true}); testViewportDeviceSelectLabel(ui, testDevice.name); } function* testResetWhenResizingViewport(ui) { info("Test reset when resizing the viewport"); let waitPixelRatioChange = onceDevicePixelRatioChange(ui); let deviceRemoved = once(ui, "device-removed"); yield testViewportResize(ui, ".viewport-vertical-resize-handle", [-10, -10], [testDevice.width, testDevice.height - 10], [0, -10], ui); yield deviceRemoved; yield waitPixelRatioChange; yield testDevicePixelRatio(ui, window.devicePixelRatio); testViewportDPRSelect(ui, {value: window.devicePixelRatio, disabled: false}); testViewportDeviceSelectLabel(ui, "no device selected"); } function* testChangingDPR(ui) { info("Test changing device pixel ratio"); let waitPixelRatioChange = onceDevicePixelRatioChange(ui); yield selectDPR(ui, VIEWPORT_DPPX); yield waitPixelRatioChange; yield testDevicePixelRatio(ui, VIEWPORT_DPPX); testViewportDPRSelect(ui, {value: VIEWPORT_DPPX, disabled: false}); testViewportDeviceSelectLabel(ui, "no device selected"); } function testViewportDPRSelect(ui, expected) { info("Test viewport's DPR Select"); let select = ui.toolWindow.document.querySelector("#global-dpr-selector > select"); is(select.value, expected.value, `DPR Select value should be: ${expected.value}`); is(select.disabled, expected.disabled, `DPR Select should be ${expected.disabled ? "disabled" : "enabled"}.`); } function* testDevicePixelRatio(ui, expected) { info("Test device pixel ratio"); let dppx = yield getViewportDevicePixelRatio(ui); is(dppx, expected, `devicePixelRatio should be: ${expected}`); } function* getViewportDevicePixelRatio(ui) { return yield ContentTask.spawn(ui.getViewportBrowser(), {}, function* () { return content.devicePixelRatio; }); } function onceDevicePixelRatioChange(ui) { return ContentTask.spawn(ui.getViewportBrowser(), {}, function* () { info(`Listening for a pixel ratio change (current: ${content.devicePixelRatio}dppx)`); let pixelRatio = content.devicePixelRatio; let mql = content.matchMedia(`(resolution: ${pixelRatio}dppx)`); return new Promise(resolve => { const onWindowCreated = () => { if (pixelRatio !== content.devicePixelRatio) { resolve(); } }; addEventListener("DOMWindowCreated", onWindowCreated, {once: true}); mql.addListener(function listener() { mql.removeListener(listener); removeEventListener("DOMWindowCreated", onWindowCreated, {once: true}); resolve(); }); }); }); }
Yukarumya/Yukarum-Redfoxes
devtools/client/responsive.html/test/browser/browser_dpr_change.js
JavaScript
mpl-2.0
4,425
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `fpos64_t` enum in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, fpos64_t"> <title>libc::fpos64_t - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'fpos64_t', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content enum"> <h1 class='fqn'><span class='in-band'>Enum <a href='index.html'>libc</a>::<wbr><a class='enum' href=''>fpos64_t</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1987' class='srclink' href='../src/libc/unix/notbsd/linux/mod.rs.html#20' title='goto source code'>[src]</a></span></h1> <pre class='rust enum'>pub enum fpos64_t {}</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
servo/doc.servo.org
libc/enum.fpos64_t.html
HTML
mpl-2.0
4,154
import React from 'react'; import PropTypes from 'prop-types'; import logo from '../img/ff-logo.png'; const DevHomework = props => ( <div className="homework"> <div className="container"> <img className="homework__logo" alt="Firefox Logo" src={logo} /> <h2 className="homework__title">{props.title}</h2> <div className="row"> <div className="homework__content">{props.children}</div> </div> </div> </div> ); DevHomework.PropTypes = { title: PropTypes.string.isRequired, }; export default DevHomework;
MozillaDevelopers/playground
src/components/layout/DevHomework.js
JavaScript
mpl-2.0
551
/******************************************************************************* * Copyright (c) 2014 Łukasz Szpakowski. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. ******************************************************************************/ package pl.luckboy.purfuncor.common import scala.util.parsing.input.Position import scalaz._ import scalaz.Scalaz._ trait Inferrer[-T, E, I] { def inferSimpleTermInfoS(simpleTerm: T)(env: E): (E, I) def unifyInfosS(info1: I, info2: I)(env: E): (E, I) def unifyArgInfosS(funArgInfo: I, argInfo: I)(env: E): (E, I) def argInfosFromInfoS(info: I, argCount: Int)(env: E): (E, Validation[I, Seq[I]]) def returnInfoFromInfoS(info: I, argCount: Int)(env: E): (E, I) def isNoInfo(info: I): Boolean def functionInfo(argCount: Int): I def concatErrors(info1: I, info2: I): I def unequalListLengthNoInfo: I def withPos(res: (E, I))(pos: Position): (E, I) } object Inferrer { def inferS[T, E, I](term: Term[T])(env: E)(implicit inferrer: Inferrer[T, E, I]): (E, I) = { val res = term match { case App(fun, args, _) => val (env2, funInfo) = inferS(fun)(env) inferTermInfosS(args.list)(env2) match { case (env3, Success(argInfos)) => appInfoS(funInfo, argInfos)(env3) case (env3, Failure(noInfo)) => (env3, noInfo) } case Simple(simpleTerm, _) => inferrer.inferSimpleTermInfoS(simpleTerm)(env) } inferrer.withPos(res)(term.pos) } def infer[T, E, I](term: Term[T])(implicit inferrer: Inferrer[T, E, I]) = State(inferS[T, E, I](term)) def appInfoS[T, E, I](funInfo: I, argInfos: Seq[I])(env: E)(implicit inferrer: Inferrer[T, E, I]) = { val (env2, funInfo2) = inferrer.unifyInfosS(funInfo, inferrer.functionInfo(argInfos.size))(env) val (env3, res) = inferrer.argInfosFromInfoS(funInfo2, argInfos.size)(env2) res match { case Success(funArgInfos) => unifyArgInfoListsS(funArgInfos.toList, argInfos.toList)(env3) match { case (env4, Success(_)) => inferrer.returnInfoFromInfoS(funInfo2, argInfos.size)(env4) case (env4, Failure(noInfo)) => (env4, noInfo) } case Failure(noInfo) => (env3, noInfo) } } def appInfo[T, E, I](funInfo: I, argInfos: Seq[I])(implicit inferrer: Inferrer[T, E, I]) = State(appInfoS[T, E, I](funInfo, argInfos)) def unifyArgInfoListsS[T, E, I](funArgInfos: List[I], argInfos: List[I])(env: E)(implicit inferrer: Inferrer[T, E, I]) = if(funArgInfos.size === argInfos.size) funArgInfos.zip(argInfos).foldLeft((env, Seq[I]().success[I])) { case ((newEnv, Success(unifiedInfos)), (funArgInfo, argInfo)) => val (newEnv2, unifiedInfo) = inferrer.unifyArgInfosS(funArgInfo, argInfo)(newEnv) (newEnv2, if(!inferrer.isNoInfo(unifiedInfo)) (unifiedInfos :+ unifiedInfo).success else unifiedInfo.failure) case ((newEnv, Failure(noInfo)), (funArgInfo, argInfo)) => val (newEnv2, unifiedInfo) = inferrer.unifyArgInfosS(funArgInfo, argInfo)(newEnv) (newEnv2, inferrer.concatErrors(noInfo, unifiedInfo).failure) } else (env, inferrer.unequalListLengthNoInfo.failure) def unifyArgInfoLists[T, E, I](infos1: List[I], infos2: List[I])(implicit inferrer: Inferrer[T, E, I]) = State(unifyArgInfoListsS[T, E, I](infos1, infos2)) def inferTermInfosS[T, E, I](terms: List[Term[T]])(env: E)(implicit inferrer: Inferrer[T, E, I]): (E, Validation[I, Seq[I]]) = terms.foldLeft((env, Seq[I]().success[I])) { case ((newEnv, Success(infos)), term) => val (newEnv2, info) = inferS(term)(newEnv) (newEnv2, if(!inferrer.isNoInfo(info)) (infos :+ info).success else info.failure) case ((newEnv, Failure(noInfo)), term) => val (newEnv2, info) = inferS(term)(newEnv) (newEnv, inferrer.concatErrors(noInfo, info).failure) } def inferTtermInfos[T, E, I](terms: List[Term[T]])(implicit inferrer: Inferrer[T, E, I]) = State(inferTermInfosS[T, E, I](terms)) }
luckboy/Purfuncor
src/main/scala/pl/luckboy/purfuncor/common/Inferrer.scala
Scala
mpl-2.0
4,250
 namespace Sparkle.Services.Networks.Tags.EntityWithTag { using Sparkle.Entities.Networks.Neutral; using System; using System.Collections.Generic; using System.Linq; public interface IEntityWithTagRepository { ////void Insert(IServiceFactory services, IEntityWithTag item); ////void Update(IServiceFactory services, IEntityWithTag item); void Add(IServiceFactory services, IEntityWithTag item); void Remove(IServiceFactory services, IEntityWithTag item); IList<Tag2Model> GetAllTagsForCategory(IServiceFactory services, int categoryId, int entityId); IList<Tag2Model> GetEntityTagsForCategory(IServiceFactory services, int categoryId, int entityId); IList<Tag2Model> GetUsedEntityTags(IServiceFactory services); IDictionary<int, int[]> GetEntitiesIdsByUsedTagsIds(IServiceFactory services, int[] tagIds); } public interface IEntityWithTag { int? TagId { get; set; } string TagName { get; set; } int TagCategoryId { get; set; } int NetworkId { get; set; } int? ActingUserId { get; set; } int EntityId { get; set; } } public enum EntityWithTagRepositoryType { Sql, ApplyRequest } }
SparkleNetworks/SparkleNetworks
src/Sparkle.Services/Networks/Tags/EntityWithTag/IEntityWithTagRepository.cs
C#
mpl-2.0
1,302
<?php declare(strict_types=1); use ParagonIE\ConstantTime\Hex; use ParagonIE\Halite\{ Alerts as CryptoException, EncryptionKeyPair, KeyFactory, SignatureKeyPair }; use ParagonIE\Halite\Asymmetric\{ Crypto as Asymmetric, SignatureSecretKey, SignaturePublicKey }; use ParagonIE\HiddenString\HiddenString; use PHPUnit\Framework\TestCase; final class KeyPairTest extends TestCase { /** * @throws TypeError * @throws CryptoException\InvalidKey * @throws CryptoException\InvalidSalt * @throws CryptoException\InvalidSignature * @throws CryptoException\InvalidType */ public function testDeriveSigningKey() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $keypair = KeyFactory::deriveSignatureKeyPair( new HiddenString('apple'), "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" ); $sign_secret = $keypair->getSecretKey(); $sign_public = $keypair->getPublicKey(); $this->assertTrue($sign_secret instanceof SignatureSecretKey); $this->assertTrue($sign_public instanceof SignaturePublicKey); // Can this be used? $message = 'This is a test message'; $signed = Asymmetric::sign( $message, $sign_secret ); $this->assertTrue( Asymmetric::verify( $message, $sign_public, $signed ) ); $this->assertSame( $sign_public->getRawKeyMaterial(), "\x9a\xce\x92\x8f\x6a\x27\x93\x8e\x87\xac\x9b\x97\xfb\xe2\x50\x6b" . "\x67\xd5\x8b\x68\xeb\x37\xc2\x2d\x31\xdb\xcf\x7e\x8d\xa0\xcb\x17", KeyFactory::INTERACTIVE ); } /** * @throws TypeError * @throws CryptoException\InvalidKey * @throws CryptoException\InvalidSalt * @throws CryptoException\InvalidSignature * @throws CryptoException\InvalidType */ public function testDeriveSigningKeyOldArgon2i() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $keypair = KeyFactory::deriveSignatureKeyPair( new HiddenString('apple'), "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", KeyFactory::INTERACTIVE, SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 ); $sign_secret = $keypair->getSecretKey(); $sign_public = $keypair->getPublicKey(); $this->assertTrue($sign_secret instanceof SignatureSecretKey); $this->assertTrue($sign_public instanceof SignaturePublicKey); // Can this be used? $message = 'This is a test message'; $signed = Asymmetric::sign( $message, $sign_secret ); $this->assertTrue( Asymmetric::verify( $message, $sign_public, $signed ) ); $this->assertSame( $sign_public->getRawKeyMaterial(), "\x88\x9c\xc0\x7a\x90\xb8\x98\xf4\x6b\x47\xfe\xcc\x91\x42\x58\x45". "\x41\xcf\x4b\x5c\x6a\x82\x2d\xdc\xc6\x8b\x87\xbc\x08\x2f\xfe\x95" ); } /** * @throws TypeError * @throws CryptoException\CannotPerformOperation * @throws CryptoException\InvalidKey */ public function testEncryptionKeyPair() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $boxKeypair = KeyFactory::generateEncryptionKeyPair(); $boxSecret = $boxKeypair->getSecretKey(); $boxPublic = $boxKeypair->getPublicKey(); $this->assertInstanceOf(\ParagonIE\Halite\Asymmetric\SecretKey::class, $boxSecret); $this->assertInstanceOf(\ParagonIE\Halite\Asymmetric\PublicKey::class, $boxPublic); $second = new EncryptionKeyPair( $boxPublic, $boxSecret ); $this->assertSame( Hex::encode($boxSecret->getRawKeyMaterial()), Hex::encode($second->getSecretKey()->getRawKeyMaterial()), 'Secret keys differ' ); $this->assertSame( Hex::encode($boxPublic->getRawKeyMaterial()), Hex::encode($second->getPublicKey()->getRawKeyMaterial()), 'Public keys differ' ); $third = new EncryptionKeyPair( $boxSecret, $boxPublic ); $this->assertSame( Hex::encode($boxSecret->getRawKeyMaterial()), Hex::encode($third->getSecretKey()->getRawKeyMaterial()), 'Secret keys differ' ); $this->assertSame( Hex::encode($boxPublic->getRawKeyMaterial()), Hex::encode($third->getPublicKey()->getRawKeyMaterial()), 'Public keys differ' ); $fourth = new EncryptionKeyPair( $boxSecret ); $this->assertSame( Hex::encode($boxSecret->getRawKeyMaterial()), Hex::encode($fourth->getSecretKey()->getRawKeyMaterial()), 'Secret keys differ' ); $this->assertSame( Hex::encode($boxPublic->getRawKeyMaterial()), Hex::encode($fourth->getPublicKey()->getRawKeyMaterial()), 'Public keys differ' ); try { new EncryptionKeyPair( $boxSecret, $boxPublic, $boxPublic ); $this->fail('More than two public keys was erroneously accepted'); } catch (\InvalidArgumentException $ex) { } try { new EncryptionKeyPair( $boxPublic ); $this->fail('Two public keys was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new EncryptionKeyPair( KeyFactory::generateEncryptionKey() ); $this->fail('Symmetric key was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new EncryptionKeyPair( $boxSecret, KeyFactory::generateEncryptionKey() ); $this->fail('Symmetric key was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new EncryptionKeyPair( $boxSecret, $boxSecret ); $this->fail('Two secret keys was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new EncryptionKeyPair( $boxPublic, $boxPublic ); $this->fail('Two public keys was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } } /** * @throws TypeError * @throws CryptoException\CannotPerformOperation * @throws CryptoException\InvalidKey */ public function testFileStorage() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $filename = tempnam(__DIR__.'/tmp/', 'key'); $key = KeyFactory::generateEncryptionKeyPair(); KeyFactory::save($key, $filename); $copy = KeyFactory::loadEncryptionKeyPair($filename); $this->assertSame( $key->getPublicKey()->getRawKeyMaterial(), $copy->getPublicKey()->getRawKeyMaterial() ); unlink($filename); } /** * @throws TypeError * @throws CryptoException\InvalidKey */ public function testMutation() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $sign_kp = KeyFactory::generateSignatureKeyPair(); $box_kp = $sign_kp->getEncryptionKeyPair(); $sign_sk = $sign_kp->getSecretKey(); $sign_pk = $sign_kp->getPublicKey(); $enc_sk = $sign_sk->getEncryptionSecretKey(); $enc_pk = $sign_pk->getEncryptionPublicKey(); $this->assertSame( Hex::encode($enc_pk->getRawKeyMaterial()), Hex::encode($enc_sk->derivePublicKey()->getRawKeyMaterial()) ); $this->assertSame( Hex::encode($enc_sk->getRawKeyMaterial()), Hex::encode($box_kp->getSecretKey()->getRawKeyMaterial()) ); } /** * @throws TypeError * @throws CryptoException\CannotPerformOperation * @throws CryptoException\InvalidKey */ public function testSignatureKeyPair() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $signKeypair = KeyFactory::generateSignatureKeyPair(); $signSecret = $signKeypair->getSecretKey(); $signPublic = $signKeypair->getPublicKey(); $this->assertInstanceOf(\ParagonIE\Halite\Asymmetric\SecretKey::class, $signSecret); $this->assertInstanceOf(\ParagonIE\Halite\Asymmetric\PublicKey::class, $signPublic); $second = new SignatureKeyPair( $signPublic, $signSecret ); $this->assertSame( Hex::encode($signSecret->getRawKeyMaterial()), Hex::encode($second->getSecretKey()->getRawKeyMaterial()), 'Secret keys differ' ); $this->assertSame( Hex::encode($signPublic->getRawKeyMaterial()), Hex::encode($second->getPublicKey()->getRawKeyMaterial()), 'Public keys differ' ); $third = new SignatureKeyPair( $signSecret, $signPublic ); $this->assertSame( Hex::encode($signSecret->getRawKeyMaterial()), Hex::encode($third->getSecretKey()->getRawKeyMaterial()), 'Secret keys differ' ); $this->assertSame( Hex::encode($signPublic->getRawKeyMaterial()), Hex::encode($third->getPublicKey()->getRawKeyMaterial()), 'Public keys differ' ); $fourth = new SignatureKeyPair( $signSecret ); $this->assertSame( Hex::encode($signSecret->getRawKeyMaterial()), Hex::encode($fourth->getSecretKey()->getRawKeyMaterial()), 'Secret keys differ' ); $this->assertSame( Hex::encode($signPublic->getRawKeyMaterial()), Hex::encode($fourth->getPublicKey()->getRawKeyMaterial()), 'Public keys differ' ); try { new SignatureKeyPair( $signSecret, $signPublic, $signPublic ); $this->fail('More than two public keys was erroneously accepted'); } catch (\InvalidArgumentException $ex) { } try { new SignatureKeyPair( $signPublic ); $this->fail('Two public keys was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new SignatureKeyPair( KeyFactory::generateAuthenticationKey() ); $this->fail('Symmetric key was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new SignatureKeyPair( $signSecret, KeyFactory::generateAuthenticationKey() ); $this->fail('Symmetric key was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new SignatureKeyPair( $signSecret, $signSecret ); $this->fail('Two secret keys was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } try { new SignatureKeyPair( $signPublic, $signPublic ); $this->fail('Two public keys was erroneously accepted'); } catch (\ParagonIE\Halite\Alerts\InvalidKey $ex) { } } /** * @throws TypeError * @throws CryptoException\InvalidKey */ public function testPublicDerivation() { if (!\extension_loaded('sodium')) { $this->markTestSkipped('Libsodium not installed'); } $enc_kp = KeyFactory::generateEncryptionKeyPair(); $enc_secret = $enc_kp->getSecretKey(); $enc_public = $enc_kp->getPublicKey(); $this->assertSame( $enc_secret->derivePublicKey()->getRawKeyMaterial(), $enc_public->getRawKeyMaterial() ); $sign_kp = KeyFactory::generateSignatureKeyPair(); $sign_secret = $sign_kp->getSecretKey(); $sign_public = $sign_kp->getPublicKey(); $this->assertSame( $sign_secret->derivePublicKey()->getRawKeyMaterial(), $sign_public->getRawKeyMaterial() ); } }
paragonie/halite
test/unit/KeyPairTest.php
PHP
mpl-2.0
13,263
<!doctype html> <html> <head> <title>CSS Decoration: My Inspirations</title> <meta name="author" content="Mozilla Leadership Network"> <meta name="title" content="CSS Decoration: My Inspirations"> <meta charset="utf-8"> <link rel="stylesheet" href="my-inspirations-style.css" type="text/css"> </head> <body> <header> <h1>CSS Decoration: My Inspirations</h1> <h2>Bring your inspirations to everyone's attention with drop shadows and other decorative CSS effects.</h2> <div id="license">Image credits<br> CC-BY <a href="https://teach.mozilla.org">Mozilla Leadership Network</a></div> </header> <main> <div class="wrapper"> <div class="hero" id="box1"><p class="blurb">Tree-puncher</p> </div> <div class="hero" id="box2"><p class="blurb">Unafraid to lead</p> </div> <div class="hero" id="box3"><p class="blurb">Rabble-rouser</p> </div> </div> </main> <footer> </footer> </body> </html>
chadsansing/curriculum-testing
intermediate-web-lit-one/my-inspirations.html
HTML
mpl-2.0
984
<!DOCTYPE html> <!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` --> <html> <head> <title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title> <meta charset='utf-8'> <meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information."> <link rel="author" title="Kristijan Burnik" href="burnik@chromium.org"> <link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade"> <meta name="assert" content="Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."> <meta name="referrer" content="no-referrer"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/security-features/resources/common.sub.js"></script> <script src="../../../../generic/test-case.sub.js"></script> </head> <body> <script> TestCase( { "expectation": "stripped-referrer", "origin": "same-http", "redirection": "swap-origin", "source_context_list": [], "source_scheme": "http", "subresource": "iframe-tag", "subresource_policy_deliveries": [ { "deliveryType": "attr", "key": "referrerPolicy", "value": "no-referrer-when-downgrade" } ] }, document.querySelector("meta[name=assert]").content, new SanityChecker() ).start(); </script> <div id="log"></div> </body> </html>
UK992/servo
tests/wpt/web-platform-tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/iframe-tag/same-http.swap-origin.http.html
HTML
mpl-2.0
1,768
/** * Copyright (c) 2020, RTE (http://www.rte-france.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package com.powsybl.iidm.network.impl.tck.util; import com.powsybl.iidm.network.tck.util.AbstractNodeBreakerTopologyTest; /** * @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> */ public class NodeBreakerTopologyTest extends AbstractNodeBreakerTopologyTest { }
powsybl/powsybl-core
iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/tck/util/NodeBreakerTopologyTest.java
Java
mpl-2.0
551
using L2dotNET.Models; namespace L2dotNET.Network.serverpackets { class TargetUnselected : GameserverPacket { private readonly int _id; private readonly int _x; private readonly int _y; private readonly int _z; public TargetUnselected(L2Object obj) { _id = obj.ObjectId; _x = obj.X; _y = obj.Y; _z = obj.Z; } public override void Write() { WriteByte(0x2a); WriteInt(_id); WriteInt(_x); WriteInt(_y); WriteInt(_z); } } }
Elfocrash/L2dotNET
src/L2dotNET/Network/serverpackets/TargetUnselected.cs
C#
mpl-2.0
625
@ECHO OFF cmdkey /delete:git:https//github.com CD PTNigeria git init git config --local user.name PTNigeria git config --local user.password iykesMan22 git config --local user.email PTNigeriaplc@gmail.com git remote add Local https://github.com/PTNigeria/CDN git remote set-url --add Local https://github.com/PTNigeria/CDN git pull Local master --allow-unrelated-histories git remote -v git add --all ./ git commit -m "PT NG Auto commits By Date:- %Date% %TIME%" ./ git push Local master PAUSE
PTNigeria/CDN
PTNigeria.bat
Batchfile
mpl-2.0
495
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Windows; namespace WPFExpander { /// <summary> /// App.xaml 的交互逻辑 /// </summary> public partial class App : Application { } }
liangsenzhi/WPF
1.1WPF Expander控件/WPFExpander/App.xaml.cs
C#
mpl-2.0
253
namespace Alex.Utils.Commands { public class TargetCommandProperty : CommandProperty { /// <inheritdoc /> public TargetCommandProperty(string name, bool required = true) : base(name, required, "target") { } } }
kennyvv/Alex
src/Alex/Utils/Commands/TargetCommandProperty.cs
C#
mpl-2.0
225
angular.module('moviematch.movieinput', []) .controller('MovieInputController', function($scope, $http, $location, Session, RequestFactory, $uibModalInstance) { $scope.movieTitle = ""; $scope.searchResults; $scope.movieChoices = []; $scope.error; // Get movies and assigns them to $scope.searchResults $scope.fetchSearchResults = function() { RequestFactory.omdbSearch($scope.movieTitle) .then(function(res){ var data = JSON.parse(res.data); $scope.searchResults = data.Search; }); }; // Adds and removes movies from $scope.movieChoices // Assigns error messages if > 5 movies chosen $scope.updateMovies = function(add, movie) { if (add && $scope.movieChoices.length < 5 ) { $scope.movieChoices.push(movie); } else if (!add) { $scope.movieChoices.splice(movie, 1); $scope.error = null; } else { $scope.error = "Already 5 movies!!"; } }; // Fired when user completes movie picks $scope.readyToVote = function($http) { // Make array of imdb_IDs from movie picks var movies = _.map($scope.movieChoices, function(movie) { return movie.imdbID; }) Session.getSession() .then(function(session) { var options = { session_id: session.id, movies: movies }; // send IMDB_ID of movies picks to server RequestFactory.addMovies(options) .then(function() { // send data back to '/loading' $uibModalInstance.close($scope.movieChoices); }); }); }; /** POP-UP SPECIFIC FUNCTIONS **/ $scope.ready = function() { $location.path('/loading') } $scope.cancel = function () { $uibModalInstance.dismiss('cancel'); }; /******************************/ // Watch for changes in searchbar for live search $scope.$watch('movieTitle', $scope.fetchSearchResults); }) .factory('RequestFactory', function($http) { // Makes request to omdb API and returns results in a promise var omdbSearch = function(movieTitle) { return $http({ method: 'GET', url: '/api/omdb/search/' + movieTitle }); }; // Makes request to movieDB API and returns results in a promise var movieDB = function() { return $http({ method: 'GET', url: '/api/movieDB/' }); }; // Makes request to add movies to database and returns nothing var addMovies = function(data) { return $http({ method: 'POST', url: '/api/moviesTODO', data: data }); }; return { omdbSearch: omdbSearch, movieDB: movieDB, addMovies: addMovies }; });
CantillatingZygote/rubiginouschanticleer
client/app/movieinput/movieinput.js
JavaScript
mpl-2.0
2,622
package com.servinglynk.hmis.warehouse.service.converter; import com.servinglynk.hmis.warehouse.core.model.Site; import com.servinglynk.hmis.warehouse.enums.SitePrincipalSiteEnum; import com.servinglynk.hmis.warehouse.enums.StateEnum; public class SiteConverter extends BaseConverter { public static com.servinglynk.hmis.warehouse.model.v2016.Site modelToEntity (Site model ,com.servinglynk.hmis.warehouse.model.v2016.Site entity) { if(entity==null) entity = new com.servinglynk.hmis.warehouse.model.v2016.Site(); if(model.getSiteId()!=null) entity.setId(model.getSiteId()); if(model.getAddress()!=null) entity.setAddress(model.getAddress()); if(model.getCity()!=null) entity.setCity(model.getCity()); if(model.getGeocode()!=null) entity.setGeocode(model.getGeocode()); if(model.getPrincipalsite()!=null) entity.setPrincipalSite(SitePrincipalSiteEnum.lookupEnum(model.getPrincipalsite().toString())); if(model.getState()!=null) entity.setState(StateEnum.valueOf(model.getState())); if(model.getZip()!=null) entity.setZip(model.getZip()); return entity; } public static Site entityToModel (com.servinglynk.hmis.warehouse.model.v2016.Site entity) { Site model = new Site(); if(entity.getId()!=null) model.setSiteId(entity.getId()); if(entity.getAddress()!=null) model.setAddress(entity.getAddress()); if(entity.getCity()!=null) model.setCity(entity.getCity()); if(entity.getGeocode()!=null) model.setGeocode(entity.getGeocode()); if(entity.getPrincipalSite()!=null) model.setPrincipalsite(Integer.parseInt(entity.getPrincipalSite().getValue())); if(entity.getState()!=null) model.setState(entity.getState().name()); if(entity.getZip()!=null) model.setZip(entity.getZip()); copyBeanProperties(entity, model); return model; } }
servinglynk/hmis-lynk-open-source
hmis-service-v2016/src/main/java/com/servinglynk/hmis/warehouse/service/converter/SiteConverter.java
Java
mpl-2.0
1,973
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>AT Commands - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="18.01.0" name="legato-version"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_API_Guides.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="buildAppsConcepts.html">Concepts</a><a class="link-selected" href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="sampleApps.html">Sample Apps</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">AT Commands </h1> </div> </div><div class="contents"> <div class="textblock"><dl class="section warning"><dt>Warning</dt><dd>Some AT commands may conflict with Legato APIs; using both may cause problems that can be difficult to diagnose. AT commands should be avoided whenever possible, and should only be used with great care.</dd></dl> <table class="doxtable"> <tr> <th>Service </th><th>Description </th><th align="center">multi-app safe </th></tr> <tr> <td><a class="el" href="c_atClient.html">AT Commands Client</a> </td><td>AT commands client </td><td align="center">x </td></tr> <tr> <td><a class="el" href="c_atServer.html">AT Commands Server</a> </td><td>AT commands server </td><td align="center">x </td></tr> </table> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
legatoproject/legato-docs
18_01/legatoAtServices.html
HTML
mpl-2.0
4,187
/* This file is part of the Geometry library. Copyright (C) 2011-2012 Benjamin Eikel <benjamin@eikel.org> Copyright (C) 2012 Claudius Jähn <claudius@uni-paderborn.de> Copyright (C) 2019 Sascha Brandt <sascha@brandt.graphics> This library is subject to the terms of the Mozilla Public License, v. 2.0. You should have received a copy of the MPL along with this library; see the file LICENSE. If not, you can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Tetrahedron.h" #include "Matrix3x3.h" #include "Vec3.h" #include "Vec4.h" #include <iostream> #include <random> #include <catch2/catch.hpp> #define REQUIRE_EQUAL(a,b) REQUIRE((a) == (b)) #define REQUIRE_DOUBLES_EQUAL(a,b,e) REQUIRE((((a) <= (b) + e) && ((b) <= (a) + e))) static Geometry::Vec3d getRandomPoint(std::default_random_engine & engine, std::uniform_real_distribution<float> & dist) { return Geometry::Vec3d(dist(engine), dist(engine), dist(engine)); } TEST_CASE("TetrahedronTest_testTetrahedronBarycentricCoordinates", "[TetrahedronTest]") { const Geometry::Vec3d a(0.0, 0.0, 0.0); const Geometry::Vec3d b(30.0, 0.0, 0.0); const Geometry::Vec3d c(0.0, 30.0, 0.0); const Geometry::Vec3d d(0.0, 0.0, 30.0); const Geometry::Tetrahedron<double> tetrahedron(a, b, c, d); // Check the vertices. REQUIRE_EQUAL(Geometry::Vec4d(1.0, 0.0, 0.0, 0.0), tetrahedron.calcBarycentricCoordinates(a).second); REQUIRE_EQUAL(Geometry::Vec4d(0.0, 1.0, 0.0, 0.0), tetrahedron.calcBarycentricCoordinates(b).second); REQUIRE_EQUAL(Geometry::Vec4d(0.0, 0.0, 1.0, 0.0), tetrahedron.calcBarycentricCoordinates(c).second); REQUIRE_EQUAL(Geometry::Vec4d(0.0, 0.0, 0.0, 1.0), tetrahedron.calcBarycentricCoordinates(d).second); // Check the middle of edges. REQUIRE_EQUAL(Geometry::Vec4d(0.5, 0.5, 0.0, 0.0), tetrahedron.calcBarycentricCoordinates(Geometry::Vec3d(15.0, 0.0, 0.0)).second); REQUIRE_EQUAL(Geometry::Vec4d(0.0, 0.5, 0.5, 0.0), tetrahedron.calcBarycentricCoordinates(Geometry::Vec3d(15.0, 15.0, 0.0)).second); REQUIRE_EQUAL(Geometry::Vec4d(0.5, 0.0, 0.5, 0.0), tetrahedron.calcBarycentricCoordinates(Geometry::Vec3d(0.0, 15.0, 0.0)).second); REQUIRE_EQUAL(Geometry::Vec4d(0.5, 0.0, 0.0, 0.5), tetrahedron.calcBarycentricCoordinates(Geometry::Vec3d(0.0, 0.0, 15.0)).second); std::default_random_engine engine; std::uniform_real_distribution<float> dist(-10, 10.0); const double delta = 1.0e-3; // pretty inaccurate.... for (int i = 0; i < 1000; ++i) { const Geometry::Tetrahedron<double> t(getRandomPoint(engine, dist), getRandomPoint(engine, dist), getRandomPoint(engine, dist), getRandomPoint(engine, dist)); if (t.calcVolume() < 10) continue; for (int j = 0; j < 100; ++j) { const Geometry::Vec3d point = getRandomPoint(engine, dist); const auto & coordinates = t.calcBarycentricCoordinates(point); if (!coordinates.first) { // degenerated break; } REQUIRE_DOUBLES_EQUAL(0.0, t.calcPointFromBarycentricCoordinates(coordinates.second).distance(point), delta); } } } TEST_CASE("TetrahedronTest_testTetrahedronDistance", "[TetrahedronTest]") { const Geometry::Vec3d a(0.0, 0.0, 0.0); const Geometry::Vec3d b(0.0, 30.0, 0.0); const Geometry::Vec3d c(0.0, 0.0, -30.0); const Geometry::Vec3d d(30.0, 0.0, 0.0); const Geometry::Tetrahedron<double> tetrahedron(a, b, c, d); const double delta = 1.0e-6; // Check the vertices. REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared(a), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared(b), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared(c), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared(d), delta); // Check the middle of edges. REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((a + b) * 0.5), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((a + c) * 0.5), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((a + d) * 0.5), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((b + c) * 0.5), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((b + d) * 0.5), delta); REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((c + d) * 0.5), delta); // Check the centroid. REQUIRE_DOUBLES_EQUAL(0.0, tetrahedron.distanceSquared((a + b + c + d) * 0.25), delta); // Test points left of the tetrahedron. REQUIRE_DOUBLES_EQUAL(200.0, tetrahedron.distanceSquared(Geometry::Vec3d(-10.0, -10.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(100.0, tetrahedron.distanceSquared(Geometry::Vec3d(-10.0, 0.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(100.0, tetrahedron.distanceSquared(Geometry::Vec3d(-10.0, 30.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(200.0, tetrahedron.distanceSquared(Geometry::Vec3d(-10.0, 40.0, 0.0)), delta); // Test points below the tetrahedron. REQUIRE_DOUBLES_EQUAL(800.0, tetrahedron.distanceSquared(Geometry::Vec3d(-20.0, -20.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(400.0, tetrahedron.distanceSquared(Geometry::Vec3d(0.0, -20.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(400.0, tetrahedron.distanceSquared(Geometry::Vec3d(30.0, -20.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(800.0, tetrahedron.distanceSquared(Geometry::Vec3d(50.0, -20.0, 0.0)), delta); // Test points top right of the tetrahedron. REQUIRE_DOUBLES_EQUAL(900.0, tetrahedron.distanceSquared(Geometry::Vec3d(60.0, 0.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(1800.0, tetrahedron.distanceSquared(Geometry::Vec3d(45.0, 45.0, 0.0)), delta); REQUIRE_DOUBLES_EQUAL(900.0, tetrahedron.distanceSquared(Geometry::Vec3d(0.0, 60.0, 0.0)), delta); } /** * Returns the volume of the given tetrahedron as alternative implementation. * \see http://en.wikipedia.org/wiki/Heron%27s_formula * @return The volume. */ static double calcTetrahedronVolume(const Geometry::Tetrahedron<double> & t) { const double U = (t.getVertexC() - t.getVertexD()).length<double>(); const double V = (t.getVertexB() - t.getVertexC()).length<double>(); const double W = (t.getVertexD() - t.getVertexB()).length<double>(); const double u = (t.getVertexB() - t.getVertexA()).length<double>(); const double v = (t.getVertexA() - t.getVertexD()).length<double>(); const double w = (t.getVertexC() - t.getVertexA()).length<double>(); const double X = (w - U + v) * (U + v + w); const double x = (U - v + w) * (v - w + U); const double Y = (u - V + w) * (V + w + u); const double y = (V - w + u) * (w - u + V); const double Z = (v - W + u) * (W + u + v); const double z = (W - u + v) * (u - v + W); const double a = sqrt(x * Y * Z); const double b = sqrt(y * Z * X); const double c = sqrt(z * X * Y); const double d = sqrt(x * y * z); return sqrtf((-a + b + c + d) * (a - b + c + d) * (a + b - c + d) * (a + b + c - d)) / (192.0 * u * v * w); } TEST_CASE("TetrahedronTest_testTetrahedronVolume", "[TetrahedronTest]") { const double delta = 0.2; { const Geometry::Vec3d a(0.0, 0.0, 0.0); const Geometry::Vec3d b(0.0, 30.0, 0.0); const Geometry::Vec3d c(0.0, 0.0, -30.0); for (double f = -100; f < 100; f += 1.73) { const Geometry::Tetrahedron<double> tetrahedron( (Geometry::Tetrahedron<double>(a, b, c, Geometry::Vec3d(f, 0.0, 0.0)))); REQUIRE_DOUBLES_EQUAL(tetrahedron.calcVolume(), calcTetrahedronVolume(tetrahedron), delta); } } { const Geometry::Vec3d a(0.0, 0.0, 0.0); const Geometry::Vec3d b(0.0, 30.0, 0.0); const Geometry::Vec3d c(0.0, 0.0, -30.0); const Geometry::Vec3d d(30.0, 0.0, 0.0); const Geometry::Tetrahedron<double> tetrahedron(a, b, c, d); const float referenceVolume = tetrahedron.calcVolume(); for (double f = -100; f < 100; f += 1.73) { Geometry::Matrix3x3d r = Geometry::Matrix3x3d::createRotation(Geometry::Angle::rad(f * 0.01), Geometry::Vec3d(1.0, 0.0, 0.0)); r.normOrthoLize(); r = Geometry::Matrix3x3d::createRotation(Geometry::Angle::rad(f * 0.017), Geometry::Vec3d(0.0, 1.0, 0.0)) * r; r.normOrthoLize(); r = Geometry::Matrix3x3d::createRotation(Geometry::Angle::rad(f * 0.027), Geometry::Vec3d(0.0, 0.0, 1.0)) * r; r.normOrthoLize(); const Geometry::Vec3d a2(r * a); const Geometry::Vec3d b2(r * b); const Geometry::Vec3d c2(r * c); const Geometry::Vec3d d2(r * d); REQUIRE_DOUBLES_EQUAL(referenceVolume, Geometry::Tetrahedron<double>(a2, b2, c2, d2).calcVolume(), delta); } } }
PADrend/Geometry
tests/TetrahedronTest.cpp
C++
mpl-2.0
8,337