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
/** * Copyright (c) 2012 Tobias Boehm. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Tobias Boehm - initial API and implementation. */ package org.eclipselabs.recommenders.test.codesearch.rcp.dsl; import static org.junit.Assert.assertEquals; import org.eclipselabs.recommenders.codesearch.rcp.dslQL2.ui.contentassist.QL2ProposalProvider; import org.junit.Test; public class ProposalProviderTest { @Test public void testMethodNameConversionWithReturnType() { String expected = "htmlremoveY()"; String actual = QL2ProposalProvider .getRawMethodNameWithBrackets("org.test.SomeType.htmlremoveY()Ljava.lang.String;"); assertEquals(expected, actual); } @Test public void testMethodNameConversionSimple() { String expected = "htmlremoveY()"; String actual = QL2ProposalProvider.getRawMethodNameWithBrackets("org.test.SomeType.htmlremoveY()V;"); assertEquals(expected, actual); } @Test public void testMethodNameConversionParameter() { String expected = "doX()"; String actual = QL2ProposalProvider.getRawMethodNameWithBrackets("org.test.SomeType.doX(Lorg.test.SomeType;)V"); assertEquals(expected, actual); } }
tobiasb/CodeFinder
tests/org.eclipselabs.recommenders.tests.codesearch.rcp/src/org/eclipselabs/recommenders/test/codesearch/rcp/dsl/ProposalProviderTest.java
Java
epl-1.0
1,467
package org.apache.wicket.markup; import org.apache.wicket.*; public final class MarkupNotFoundException extends WicketRuntimeException{ private static final long serialVersionUID=1L; public MarkupNotFoundException(final String message){ super(message); } public MarkupNotFoundException(final String message,final Throwable cause){ super(message,cause); } }
windup/windup-sample-apps
test-files/src_example/org/apache/wicket/markup/MarkupNotFoundException.java
Java
epl-1.0
396
/* * Copyright 2012 PRODYNA AG * * Licensed under the Eclipse Public License (EPL), Version 1.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.opensource.org/licenses/eclipse-1.0.php or * http://www.nabucco.org/License.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.nabucco.testautomation.engine.visitor.script; import org.nabucco.testautomation.engine.base.context.TestContext; import org.nabucco.testautomation.engine.base.util.TestResultHelper; import org.nabucco.testautomation.engine.exception.BreakLoopException; import org.nabucco.testautomation.engine.exception.TestScriptException; import org.nabucco.testautomation.engine.sub.TestScriptEngine; import org.nabucco.testautomation.result.facade.datatype.TestScriptResult; import org.nabucco.testautomation.script.facade.datatype.dictionary.BreakLoop; import org.nabucco.testautomation.script.facade.datatype.dictionary.Condition; import org.nabucco.testautomation.script.facade.datatype.dictionary.base.TestScriptElement; import org.nabucco.testautomation.script.facade.datatype.dictionary.base.TestScriptElementContainer; import org.nabucco.testautomation.script.facade.datatype.dictionary.base.TestScriptElementType; import org.nabucco.testautomation.script.facade.datatype.dictionary.type.OperatorType; /** * BreakLoopVisitor * * @author Steffen Schmidt, PRODYNA AG * */ public class BreakLoopVisitor extends AbstractTestScriptVisitor<TestScriptResult> { /** * Constructs a new BreakConditionVisitor instance using the given {@link TestContext} and {@link TestScriptEngine}. * * @param context the context * @param testScriptEngine the TestScriptEngine */ protected BreakLoopVisitor(TestContext context, TestScriptEngine engine) { super(context, engine); } /** * Visits the given {@link BreakCondition}. After visiting all children, the result will be set. * * @param condition the BreakCondition to be visited * @throws BreakLoopException thrown, if the break condition is true */ public void visit(BreakLoop breakLoopElement, TestScriptResult argument) throws TestScriptException { getContext().setCurrentTestScriptElement(breakLoopElement); for (TestScriptElementContainer container : breakLoopElement.getTestScriptElementList()) { TestScriptElement element = container.getElement(); if (element.getType() == TestScriptElementType.CONDITION) { boolean breakLoop = visit((Condition) element); if (breakLoop) { throw new BreakLoopException(); } } } } /** * Visits an instance of a {@link Condition}. * * @param condition the Condition instance */ public boolean visit(Condition condition) throws TestScriptException { if (condition.getOperator() == null || condition.getOperator() == OperatorType.NONE) { ConditionVisitor visitor = new ConditionVisitor(getContext(), getTestScriptEngine()); visitor.visit(condition, TestResultHelper.createTestScriptResult()); return visitor.getResult(); } else if (condition.getOperator() == OperatorType.AND) { for (TestScriptElementContainer container : condition.getTestScriptElementList()) { TestScriptElement element = container.getElement(); if (element.getType() == TestScriptElementType.CONDITION) { ConditionVisitor visitor = new ConditionVisitor(getContext(), getTestScriptEngine()); visitor.visit(condition, TestResultHelper.createTestScriptResult()); if (!visitor.getResult()) { return false; } } } return true; } else if (condition.getOperator() == OperatorType.OR) { for (TestScriptElementContainer container : condition.getTestScriptElementList()) { TestScriptElement element = container.getElement(); if (element.getType() == TestScriptElementType.CONDITION) { ConditionVisitor visitor = new ConditionVisitor(getContext(), getTestScriptEngine()); visitor.visit(condition, TestResultHelper.createTestScriptResult()); if (visitor.getResult()) { return true; } } } return false; } else { return false; } } }
NABUCCO/org.nabucco.testautomation.engine
org.nabucco.testautomation.engine/src/main/org/nabucco/testautomation/engine/visitor/script/BreakLoopVisitor.java
Java
epl-1.0
4,979
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="copyright" content="(C) Copyright 2010" /> <meta name="DC.rights.owner" content="(C) Copyright 2010" /> <meta name="DC.Type" content="cxxStruct" /> <meta name="DC.Title" content="THssPckgData" /> <meta name="DC.Format" content="XHTML" /> <meta name="DC.Identifier" content="GUID-F1742405-6EB8-3F91-ACFE-17201E9A86AC" /> <title> THssPckgData </title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api" /> <link rel="stylesheet" type="text/css" href="cxxref.css" /> </head> <body class="cxxref" id="GUID-F1742405-6EB8-3F91-ACFE-17201E9A86AC"> <a name="GUID-F1742405-6EB8-3F91-ACFE-17201E9A86AC"> <!-- --> </a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Application Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"> <a href="index.html" title="Symbian^3 Application Developer Library"> Symbian^3 Application Developer Library </a> &gt; </div> <h1 class="topictitle1"> THssPckgData Struct Reference </h1> <table class="signature"> <tr> <td> struct THssPckgData </td> </tr> </table> <div class="section"> <div> <p> HSS package data for notifications. </p> </div> </div> <div class="section member-index"> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Public Attributes </th> </tr> </thead> <tbody> <tr> <td align="right" valign="top"> <a href="GUID-78E993D5-A845-32B4-B41A-947ABEF16AA0.html"> TBuf8 </a> &lt; <a href="GUID-F3D62DCD-1DC5-3E58-9308-8D7CFF4B6D77.html"> KHssMaxNotificationLength </a> &gt; </td> <td> <a href="#GUID-5FD1C8BE-9AD3-302D-8A24-5D63D722BEA5"> data </a> </td> </tr> </tbody> </table> </div> <h1 class="pageHeading topictitle1"> Member Data Documentation </h1> <div class="nested1" id="GUID-5FD1C8BE-9AD3-302D-8A24-5D63D722BEA5"> <a name="GUID-5FD1C8BE-9AD3-302D-8A24-5D63D722BEA5"> <!-- --> </a> <h2 class="topictitle2"> TBuf8&lt; KHssMaxNotificationLength &gt; data </h2> <table class="signature"> <tr> <td> <a href="GUID-78E993D5-A845-32B4-B41A-947ABEF16AA0.html"> TBuf8 </a> &lt; <a href="GUID-F3D62DCD-1DC5-3E58-9308-8D7CFF4B6D77.html"> KHssMaxNotificationLength </a> &gt; </td> <td> data </td> </tr> </table> <div class="section"> </div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
sdk/GUID-F1742405-6EB8-3F91-ACFE-17201E9A86AC.html
HTML
epl-1.0
4,147
FROM clojure:alpine RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY project.clj /usr/src/app/ RUN lein deps COPY . /usr/src/app RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app-standalone.jar CMD ["java", "-cp", "app-standalone.jar", "micro_nrepl.core"]
athos/nrepl-revolver
docker/Dockerfile
Dockerfile
epl-1.0
292
.level, .strength, .uk-panel-title { font-family: "Ledger"; color: #270b00; } .strength { font-size: 48px; } .card { background-color: #e7daa7; border-color: #270b00; border-style: solid; border-width: medium; } .level-progress { height: 35px; } .editable { cursor: pointer; }
gsnewmark/munchkin-toolbox
resources/css/munchkin-toolbox.css
CSS
epl-1.0
300
/* J_LZ_COPYRIGHT_BEGIN ******************************************************* * Copyright 2008 Laszlo Systems, Inc. All Rights Reserved. * * Use is subject to license terms. * * J_LZ_COPYRIGHT_END *********************************************************/ package org.openlaszlo.test.netsize; import java.net.*; import java.io.*; import java.text.NumberFormat; import java.util.*; public abstract class Sizer { long totalBytes = 0; Sizer parent; List children = new ArrayList(); String name; long prevsize; public Sizer(Sizer parent, String name, long prevsize) { this.parent = parent; this.name = name; this.prevsize = prevsize; if (parent != null) { this.parent.children.add(this); } } void addSize(long n) { totalBytes += n; if (parent != null) { parent.addSize(n); } } public void connect() throws IOException { for (Iterator iter = children.iterator(); iter.hasNext(); ) { Sizer child = (Sizer)iter.next(); child.connect(); } } void report(String prefix) { String pctstr = ""; if (prevsize > 0) { NumberFormat format = NumberFormat.getPercentInstance(); double pct = (double)totalBytes / prevsize; pctstr = " (" + format.format(pct) + ")"; } System.out.println(prefix + name + ": " + totalBytes + pctstr); for (Iterator iter = children.iterator(); iter.hasNext(); ) { Sizer child = (Sizer)iter.next(); child.report(prefix + " "); } } void report() { report(""); } void generatePropertiesFile(BufferedWriter bw) throws IOException { generateProps(bw); for (Iterator iter = children.iterator(); iter.hasNext(); ) { Sizer child = (Sizer)iter.next(); child.generatePropertiesFile(bw); } } public abstract void generateProps(BufferedWriter bw) throws IOException; }
mcarlson/openlaszlo
WEB-INF/lps/server/src/org/openlaszlo/test/netsize/Sizer.java
Java
epl-1.0
2,141
/* // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. // Copyright (C) 2004-2005 TONBELLER AG // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ package mondrian.rolap; import java.util.List; import mondrian.olap.Evaluator; import mondrian.rolap.sql.TupleConstraint; import mondrian.rolap.sql.MemberChildrenConstraint; import mondrian.rolap.sql.SqlQuery; import mondrian.rolap.aggmatcher.AggStar; /** * TupleConstaint which restricts the result of a tuple sqlQuery to a * set of parents. All parents must belong to the same level. * * @author av * @since Nov 10, 2005 * @version $Id: //open/mondrian-release/3.1/src/main/mondrian/rolap/DescendantsConstraint.java#2 $ */ class DescendantsConstraint implements TupleConstraint { List<RolapMember> parentMembers; MemberChildrenConstraint mcc; /** * Creates a DescendantsConstraint. * * @param parentMembers list of parents all from the same level * @param mcc the constraint that would return the children for each single * parent */ public DescendantsConstraint( List<RolapMember> parentMembers, MemberChildrenConstraint mcc) { this.parentMembers = parentMembers; this.mcc = mcc; } public void addConstraint( SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar) { mcc.addMemberConstraint(sqlQuery, baseCube, aggStar, parentMembers); } public void addLevelConstraint( SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar, RolapLevel level) { mcc.addLevelConstraint(sqlQuery, baseCube, aggStar, level); } public MemberChildrenConstraint getMemberChildrenConstraint( RolapMember parent) { return mcc; } /** * {@inheritDoc} * * <p>This implementation returns null, because descendants is not cached. */ public Object getCacheKey() { return null; } public Evaluator getEvaluator() { return null; } } // End DescendantsConstraint.java
Twixer/mondrian-3.1.5
src/main/mondrian/rolap/DescendantsConstraint.java
Java
epl-1.0
2,228
/******************************************************************************* * Copyright (c) 2012 Firestar Software, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Firestar Software, Inc. - initial API and implementation * * Author: * Sally Conway * *******************************************************************************/ package org.openhealthtools.mdht.mdmi.editor.map.tools; import java.text.MessageFormat; import java.util.Collection; import java.util.Enumeration; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import org.openhealthtools.mdht.mdmi.editor.map.tree.ComplexDataTypeNode; import org.openhealthtools.mdht.mdmi.editor.map.tree.DataTypeNode; import org.openhealthtools.mdht.mdmi.editor.map.tree.EnumeratedDataTypeNode; import org.openhealthtools.mdht.mdmi.editor.map.tree.MdmiModelTree; import org.openhealthtools.mdht.mdmi.model.DTComplex; import org.openhealthtools.mdht.mdmi.model.DTSEnumerated; import org.openhealthtools.mdht.mdmi.model.Field; import org.openhealthtools.mdht.mdmi.model.MdmiDatatype; /** A Tree view of a datatype, and all sub-types */ public class DatatypeTree extends ModelTree { /** Create the tree for this datatype */ public DatatypeTree(MdmiDatatype datatype) { super(datatype); } /** Create a tree showing all datatypes in the message group */ public DatatypeTree(Collection<MdmiDatatype> datatypes) { super(datatypes); } @SuppressWarnings("rawtypes") @Override protected DefaultMutableTreeNode createRootNode(Object model) { DefaultMutableTreeNode root = null; if (model instanceof MdmiDatatype) { // create the tree with the Datatype as the root root = createDataTypeNode((MdmiDatatype) model, null); } else if (model instanceof Collection) { // create the tree with a special root node root = new DefaultMutableTreeNode(s_res.getString("ViewDatatypeTree.datatypes")); // add each datatype for (Object object : (Collection) model) { if (object instanceof MdmiDatatype) { MdmiDatatype datatype = (MdmiDatatype) object; DefaultMutableTreeNode node = createDataTypeNode(datatype, null); MdmiModelTree.addSorted(root, node); } } } return root; } /** Create the appropriate DataTypeNode based on the data type */ public static DataTypeNode createDataTypeNode(MdmiDatatype dataType, String fieldName) { if (dataType instanceof DTComplex) { return new ComplexDatatypeTreeNode((DTComplex) dataType, fieldName); } else if (dataType instanceof DTSEnumerated) { return new EnumeratedDatatypeTreeNode((DTSEnumerated) dataType, fieldName); } return new DatatypeTreeNode(dataType, fieldName); } /** Format a field and datatype as "fieldName : DataType" */ public static String formatFieldName(MdmiDatatype datatype, String fieldName) { if (fieldName != null) { // fieldName : DataType return MessageFormat.format( s_res.getString("ViewDatatypeTree.fieldFormat"), fieldName, datatype.getTypeName()); } return datatype.getTypeName(); } /** Expand all complex datatypes (not enumerated types) within this node (and its children) */ public void expandAllComplexTypes(DefaultMutableTreeNode node) { for (Enumeration<?> en = node.depthFirstEnumeration(); en != null && en.hasMoreElements();) { DefaultMutableTreeNode child = (DefaultMutableTreeNode) en.nextElement(); // don't expand enumerated types if (!(child.getUserObject() instanceof DTSEnumerated)) { expandPath(new TreePath(child.getPath())); } } } /////////////////////////////////////////////////////////// // Tree Nodes /////////////////////////////////////////////////////////// /** Tree Node interface for different kinds of Data Types */ public static interface IDatatypeField extends TreeNode { public String getFieldName(); public MdmiDatatype getDatatype(); } public static class DatatypeTreeNode extends DataTypeNode implements IDatatypeField { private String m_fieldName; public DatatypeTreeNode(MdmiDatatype datatype, String fieldName) { super(datatype); m_fieldName = fieldName; } @Override public String toString() { return formatFieldName(getDatatype(), m_fieldName); } @Override public MdmiDatatype getDatatype() { return (MdmiDatatype) getUserObject(); } @Override public String getFieldName() { return m_fieldName; } } public static class ComplexDatatypeTreeNode extends ComplexDataTypeNode implements IDatatypeField { private String m_fieldName; public ComplexDatatypeTreeNode(DTComplex datatype, String fieldName) { super(datatype); m_fieldName = fieldName; // remove default children, and load our own removeAllChildren(); loadChildren(datatype); } private void loadChildren(DTComplex complexType) { for (Field field : complexType.getFields()) { if (field.getDatatype() == null) { continue; } DefaultMutableTreeNode childNode = createDataTypeNode(field.getDatatype(), field.getName()); if (childNode == null) { continue; } // add in given order add(childNode); } } @Override public String toString() { return formatFieldName(getDatatype(), m_fieldName); } @Override public MdmiDatatype getDatatype() { return (MdmiDatatype) getUserObject(); } @Override public String getFieldName() { return m_fieldName; } } public static class EnumeratedDatatypeTreeNode extends EnumeratedDataTypeNode implements IDatatypeField { private String m_fieldName; public EnumeratedDatatypeTreeNode(DTSEnumerated datatype, String fieldName) { super(datatype); m_fieldName = fieldName; } @Override public String toString() { return formatFieldName(getDatatype(), m_fieldName); } @Override public MdmiDatatype getDatatype() { return (MdmiDatatype) getUserObject(); } @Override public String getFieldName() { return m_fieldName; } } }
MDMI/mdmimapeditor
org.mdmi.editor/src/org/openhealthtools/mdht/mdmi/editor/map/tools/DatatypeTree.java
Java
epl-1.0
6,379
require "rjava" # Copyright (c) 2000, 2008 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation module Org::Eclipse::Swt::Graphics module PatternImports #:nodoc: class_module.module_eval { include ::Java::Lang include ::Org::Eclipse::Swt::Graphics include ::Org::Eclipse::Swt include ::Org::Eclipse::Swt::Internal::Cocoa } end # Instances of this class represent patterns to use while drawing. Patterns # can be specified either as bitmaps or gradients. # <p> # Application code must explicitly invoke the <code>Pattern.dispose()</code> # method to release the operating system resources managed by each instance # when those instances are no longer required. # </p> # <p> # This class requires the operating system's advanced graphics subsystem # which may not be available on some platforms. # </p> # # @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> # @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a> # @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> # # @since 3.1 class Pattern < PatternImports.const_get :Resource include_class_members PatternImports attr_accessor :color alias_method :attr_color, :color undef_method :color alias_method :attr_color=, :color= undef_method :color= attr_accessor :gradient alias_method :attr_gradient, :gradient undef_method :gradient alias_method :attr_gradient=, :gradient= undef_method :gradient= attr_accessor :pt1 alias_method :attr_pt1, :pt1 undef_method :pt1 alias_method :attr_pt1=, :pt1= undef_method :pt1= attr_accessor :pt2 alias_method :attr_pt2, :pt2 undef_method :pt2 alias_method :attr_pt2=, :pt2= undef_method :pt2= attr_accessor :image alias_method :attr_image, :image undef_method :image alias_method :attr_image=, :image= undef_method :image= # double attr_accessor :color1 alias_method :attr_color1, :color1 undef_method :color1 alias_method :attr_color1=, :color1= undef_method :color1= attr_accessor :color2 alias_method :attr_color2, :color2 undef_method :color2 alias_method :attr_color2=, :color2= undef_method :color2= attr_accessor :alpha1 alias_method :attr_alpha1, :alpha1 undef_method :alpha1 alias_method :attr_alpha1=, :alpha1= undef_method :alpha1= attr_accessor :alpha2 alias_method :attr_alpha2, :alpha2 undef_method :alpha2 alias_method :attr_alpha2=, :alpha2= undef_method :alpha2= typesig { [Device, Image] } # Constructs a new Pattern given an image. Drawing with the resulting # pattern will cause the image to be tiled over the resulting area. # <p> # This operation requires the operating system's advanced # graphics subsystem which may not be available on some # platforms. # </p> # # @param device the device on which to allocate the pattern # @param image the image that the pattern will draw # # @exception IllegalArgumentException <ul> # <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, or the image is null</li> # <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> # </ul> # @exception SWTException <ul> # <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> # </ul> # @exception SWTError <ul> # <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> # </ul> # # @see #dispose() def initialize(device, image) @color = nil @gradient = nil @pt1 = nil @pt2 = nil @image = nil @color1 = nil @color2 = nil @alpha1 = 0 @alpha2 = 0 super(device) if ((image).nil?) SWT.error(SWT::ERROR_NULL_ARGUMENT) end if (image.is_disposed) SWT.error(SWT::ERROR_INVALID_ARGUMENT) end pool = nil if (!NSThread.is_main_thread) pool = NSAutoreleasePool.new.alloc.init end begin @image = image @color = NSColor.color_with_pattern_image(image.attr_handle) @color.retain init ensure if (!(pool).nil?) pool.release end end end typesig { [Device, ::Java::Float, ::Java::Float, ::Java::Float, ::Java::Float, Color, Color] } # Constructs a new Pattern that represents a linear, two color # gradient. Drawing with the pattern will cause the resulting area to be # tiled with the gradient specified by the arguments. # <p> # This operation requires the operating system's advanced # graphics subsystem which may not be available on some # platforms. # </p> # # @param device the device on which to allocate the pattern # @param x1 the x coordinate of the starting corner of the gradient # @param y1 the y coordinate of the starting corner of the gradient # @param x2 the x coordinate of the ending corner of the gradient # @param y2 the y coordinate of the ending corner of the gradient # @param color1 the starting color of the gradient # @param color2 the ending color of the gradient # # @exception IllegalArgumentException <ul> # <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, # or if either color1 or color2 is null</li> # <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li> # </ul> # @exception SWTException <ul> # <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> # </ul> # @exception SWTError <ul> # <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> # </ul> # # @see #dispose() def initialize(device, x1, y1, x2, y2, color1, color2) initialize__pattern(device, x1, y1, x2, y2, color1, 0xff, color2, 0xff) end typesig { [Device, ::Java::Float, ::Java::Float, ::Java::Float, ::Java::Float, Color, ::Java::Int, Color, ::Java::Int] } # Constructs a new Pattern that represents a linear, two color # gradient. Drawing with the pattern will cause the resulting area to be # tiled with the gradient specified by the arguments. # <p> # This operation requires the operating system's advanced # graphics subsystem which may not be available on some # platforms. # </p> # # @param device the device on which to allocate the pattern # @param x1 the x coordinate of the starting corner of the gradient # @param y1 the y coordinate of the starting corner of the gradient # @param x2 the x coordinate of the ending corner of the gradient # @param y2 the y coordinate of the ending corner of the gradient # @param color1 the starting color of the gradient # @param alpha1 the starting alpha value of the gradient # @param color2 the ending color of the gradient # @param alpha2 the ending alpha value of the gradient # # @exception IllegalArgumentException <ul> # <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, # or if either color1 or color2 is null</li> # <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li> # </ul> # @exception SWTException <ul> # <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> # </ul> # @exception SWTError <ul> # <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> # </ul> # # @see #dispose() # # @since 3.2 def initialize(device, x1, y1, x2, y2, color1, alpha1, color2, alpha2) @color = nil @gradient = nil @pt1 = nil @pt2 = nil @image = nil @color1 = nil @color2 = nil @alpha1 = 0 @alpha2 = 0 super(device) if ((color1).nil?) SWT.error(SWT::ERROR_NULL_ARGUMENT) end if (color1.is_disposed) SWT.error(SWT::ERROR_INVALID_ARGUMENT) end if ((color2).nil?) SWT.error(SWT::ERROR_NULL_ARGUMENT) end if (color2.is_disposed) SWT.error(SWT::ERROR_INVALID_ARGUMENT) end pool = nil if (!NSThread.is_main_thread) pool = NSAutoreleasePool.new.alloc.init end begin @pt1 = NSPoint.new @pt2 = NSPoint.new @pt1.attr_x = x1 @pt1.attr_y = y1 @pt2.attr_x = x2 @pt2.attr_y = y2 @color1 = color1.attr_handle @color2 = color2.attr_handle @alpha1 = alpha1 @alpha2 = alpha2 start = NSColor.color_with_device_red(color1.attr_handle[0], color1.attr_handle[1], color1.attr_handle[2], alpha1 / 255) end_ = NSColor.color_with_device_red(color2.attr_handle[0], color2.attr_handle[1], color2.attr_handle[2], alpha2 / 255) @gradient = (NSGradient.new.alloc).init_with_starting_color(start, end_) init ensure if (!(pool).nil?) pool.release end end end typesig { [] } def destroy if (!(@color).nil?) @color.release end @color = nil if (!(@gradient).nil?) @gradient.release end @gradient = nil @image = nil @color1 = @color2 = nil end typesig { [] } # Returns <code>true</code> if the Pattern has been disposed, # and <code>false</code> otherwise. # <p> # This method gets the dispose state for the Pattern. # When a Pattern has been disposed, it is an error to # invoke any other method using the Pattern. # # @return <code>true</code> when the Pattern is disposed, and <code>false</code> otherwise def is_disposed return (self.attr_device).nil? end typesig { [] } # Returns a string containing a concise, human-readable # description of the receiver. # # @return a string representation of the receiver def to_s if (is_disposed) return "Pattern {*DISPOSED*}" end return "Pattern {" + RJava.cast_to_string((!(@color).nil? ? @color.attr_id : @gradient.attr_id)) + "}" end private alias_method :initialize__pattern, :initialize end end
neelance/swt4ruby
swt4ruby/lib/darwin-x86_32/org/eclipse/swt/graphics/Pattern.rb
Ruby
epl-1.0
10,645
/* * Copyright 2012 PRODYNA AG * * Licensed under the Eclipse Public License (EPL), Version 1.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.opensource.org/licenses/eclipse-1.0.php or * http://www.nabucco.org/License.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.nabucco.testautomation.script.facade.datatype.comparator; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.nabucco.testautomation.script.facade.datatype.code.SubEngineActionCode; /** * SubEngineActionSorter * Sorts SubEngineActionCodes by name * * @author Steffen Schmidt, PRODYNA AG */ public class SubEngineActionSorter implements Comparator<SubEngineActionCode> { public void sort(List<SubEngineActionCode> actionList) { Collections.sort(actionList, this); } @Override public int compare(SubEngineActionCode o1, SubEngineActionCode o2) { if (o1 != null && o2 != null && o1.getName() != null && o2.getName() != null) { return o1.getName().getValue().compareTo(o2.getName().getValue()); } return 0; } }
NABUCCO/org.nabucco.testautomation.script
org.nabucco.testautomation.script.facade.datatype/src/main/man/org/nabucco/testautomation/script/facade/datatype/comparator/SubEngineActionSorter.java
Java
epl-1.0
1,453
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 23 08:30:01 PST 2011 --> <TITLE> Uses of Class spine.datamodel.functions.BufferedRawDataSpineSetupFunction </TITLE> <META NAME="date" CONTENT="2011-12-23"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class spine.datamodel.functions.BufferedRawDataSpineSetupFunction"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../spine/datamodel/functions/BufferedRawDataSpineSetupFunction.html" title="class in spine.datamodel.functions"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?spine/datamodel/functions/\class-useBufferedRawDataSpineSetupFunction.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="BufferedRawDataSpineSetupFunction.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>spine.datamodel.functions.BufferedRawDataSpineSetupFunction</B></H2> </CENTER> No usage of spine.datamodel.functions.BufferedRawDataSpineSetupFunction <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../spine/datamodel/functions/BufferedRawDataSpineSetupFunction.html" title="class in spine.datamodel.functions"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?spine/datamodel/functions/\class-useBufferedRawDataSpineSetupFunction.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="BufferedRawDataSpineSetupFunction.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
t2health/BSPAN---Bluetooth-Sensor-Processing-for-Android
AndroidSpineServer/doc/spine/datamodel/functions/class-use/BufferedRawDataSpineSetupFunction.html
HTML
epl-1.0
6,227
package markdowikitext.commonmark.refspec.cases; import markdowikitext.commonmark.refspec.RefSpecCase; public class SetextHeaders05 extends RefSpecCase { public SetextHeaders05() { super(createInput(), createOutput()); } public static String createInput() { StringBuilder sb = new StringBuilder(); sb.append("Foo"); sb.append(BR); sb.append(" ---- "); return sb.toString(); } public static String createOutput() { StringBuilder sb = new StringBuilder(); sb.append("<h2>Foo</h2>"); return sb.toString(); } }
jmini/markdowikitext
markdowikitext.commonmark/src/markdowikitext/commonmark/refspec/cases/SetextHeaders05.java
Java
epl-1.0
566
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_37) on Wed Jan 23 11:08:00 EST 2013 --> <TITLE> Uses of Class cc.mallet.grmm.learning.MultiSegmentationEvaluatorACRF (Mallet 2 API) </TITLE> <META NAME="date" CONTENT="2013-01-23"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class cc.mallet.grmm.learning.MultiSegmentationEvaluatorACRF (Mallet 2 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../cc/mallet/grmm/learning/MultiSegmentationEvaluatorACRF.html" title="class in cc.mallet.grmm.learning"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?cc/mallet/grmm/learning//class-useMultiSegmentationEvaluatorACRF.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MultiSegmentationEvaluatorACRF.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>cc.mallet.grmm.learning.MultiSegmentationEvaluatorACRF</B></H2> </CENTER> No usage of cc.mallet.grmm.learning.MultiSegmentationEvaluatorACRF <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../cc/mallet/grmm/learning/MultiSegmentationEvaluatorACRF.html" title="class in cc.mallet.grmm.learning"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?cc/mallet/grmm/learning//class-useMultiSegmentationEvaluatorACRF.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MultiSegmentationEvaluatorACRF.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
burrsettles/mallet
doc/api/cc/mallet/grmm/learning/class-use/MultiSegmentationEvaluatorACRF.html
HTML
epl-1.0
6,094
package article.editor.scanners; import org.eclipse.jface.text.TextAttribute; import org.eclipse.jface.text.rules.IRule; import org.eclipse.jface.text.rules.IToken; import org.eclipse.jface.text.rules.MultiLineRule; import org.eclipse.jface.text.rules.RuleBasedScanner; import org.eclipse.jface.text.rules.Token; import org.eclipse.jface.text.rules.WhitespaceRule; import article.editor.ColorManager; import article.editor.IXMLColorConstants; import article.editor.XMLWhitespaceDetector; public class XMLScanner extends RuleBasedScanner { public XMLScanner(ColorManager manager) { IToken procInstr = new Token( new TextAttribute( manager.getColor(IXMLColorConstants.PROC_INSTR))); IToken docType = new Token( new TextAttribute( manager.getColor(IXMLColorConstants.DOCTYPE))); IRule[] rules = new IRule[3]; //Add rule for processing instructions and doctype rules[0] = new MultiLineRule("<?", "?>", procInstr); rules[1] = new MultiLineRule("<!DOCTYPE", ">", docType); // Add generic whitespace rule. rules[2] = new WhitespaceRule(new XMLWhitespaceDetector()); setRules(rules); } }
UNIT-Research-Development/PlayGround
article-jfacetext/src/article/editor/scanners/XMLScanner.java
Java
epl-1.0
1,132
package net.trajano.openidconnect.provider.sample; import java.io.StringReader; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import javax.ejb.Lock; import javax.ejb.LockType; import javax.ejb.Singleton; import javax.ejb.Startup; import javax.json.Json; import javax.json.JsonObject; import net.trajano.openidconnect.provider.spi.Consent; import net.trajano.openidconnect.provider.spi.TokenStorage; import net.trajano.openidconnect.token.IdToken; import net.trajano.openidconnect.token.IdTokenResponse; /** * An implementation of {@link TokenStorage} as a set of {@link ConcurrentMap}s. * Normally a real implementation would use JCache based backend with expiration * otherwise there would be memory issues. * * @author Archimedes */ @Singleton @Startup public class MapTokenStorage implements TokenStorage { private static final int ONE_HOUR = 120; private final ConcurrentMap<String, String> accessTokenToClaims = new ConcurrentHashMap<>(); private final ConcurrentMap<String, IdTokenResponse> accessTokenToTokenResponse = new ConcurrentHashMap<>(); private final ConcurrentMap<String, IdTokenResponse> codeToTokenResponse = new ConcurrentHashMap<>(); private final ConcurrentMap<Consent, IdTokenResponse> consentToTokenResponse = new ConcurrentHashMap<>(); private final ConcurrentMap<String, IdTokenResponse> refreshTokenToTokenResponse = new ConcurrentHashMap<>(); private final Set<String> usedCodes = new HashSet<>(); @Override public IdTokenResponse getByAccessToken(final String accessToken) { return accessTokenToTokenResponse.get(accessToken); } @Override public IdTokenResponse getByCode(final String code) { return codeToTokenResponse.get(code); } @Override public IdTokenResponse getByConsent(final Consent consent) { return consentToTokenResponse.get(consent); } @Override public JsonObject getClaimsByAccessToken(final String accessToken) { return Json.createReader(new StringReader(accessTokenToClaims.get(accessToken))) .readObject(); } @Override public int getDefaultExpiration() { return ONE_HOUR; } @Override public int getExpiration(final int desiredExpiration) { return desiredExpiration; } @Override public boolean isCodeUsed(final String code) { return usedCodes.contains(code); } @Override public void markCodeAsUsed(final String code) { usedCodes.add(code); } @Override @Lock(LockType.WRITE) public IdTokenResponse removeMappingForAccessToken(final String accessToken) { accessTokenToClaims.remove(accessToken); return accessTokenToTokenResponse.remove(accessToken); } @Override @Lock(LockType.WRITE) public IdTokenResponse removeMappingForCode(final String code) { return codeToTokenResponse.remove(code); } @Override @Lock(LockType.WRITE) public IdTokenResponse removeMappingForConsent(final Consent consent) { return consentToTokenResponse.remove(consent); } @Override @Lock(LockType.WRITE) public IdTokenResponse removeMappingForRefreshToken(final String refreshToken) { return refreshTokenToTokenResponse.remove(refreshToken); } @Lock(LockType.WRITE) @Override public void store(final IdToken idToken, final IdTokenResponse idTokenResponse, final JsonObject claims) { accessTokenToTokenResponse.put(idTokenResponse.getAccessToken(), idTokenResponse); accessTokenToClaims.put(idTokenResponse.getAccessToken(), claims.toString()); refreshTokenToTokenResponse.put(idTokenResponse.getRefreshToken(), idTokenResponse); consentToTokenResponse.put(new Consent(idToken, idTokenResponse), idTokenResponse); } @Lock(LockType.WRITE) @Override public void store(final IdToken idToken, final IdTokenResponse idTokenResponse, final String code, final JsonObject claims) { // TODO create a proper class for claims rather than using a JsonObject. store(idToken, idTokenResponse, claims); codeToTokenResponse.put(code, idTokenResponse); } }
trajano/openid-connect
openid-connect-provider-sample/src/main/java/net/trajano/openidconnect/provider/sample/MapTokenStorage.java
Java
epl-1.0
4,333
body { font-family: Arial; background-color: #dfebfa !important; background-image: -webkit-linear-gradient(top, #f2f7fe 0%, #b7c9d9 50%, #dfebfa 100%) !important; background: -moz-linear-gradient(top, #f2f7fe 0%, #b7c9d9 50%, #dfebfa 100%) !important; } button { border-radius: 2px; border: 0px none; padding: 6px 12px; color: #FFF; background: linear-gradient(to bottom, #0081C7 0%, #004986 100%) repeat scroll 0% 0% transparent; font-size:12px; } th { color: #0D3155; } label { display: block; margin: 5px; color: #333; } fieldset { border: 1px solid #0066AD; margin-bottom: 8px; border-radius: 2px; background: rgba(255,255,255,0.35); } legend { color: #0066AD; } .column{ float:left; } input[type=text]{ margin: 3px; } label.display{ font-weight: bold; } /*tabpanel*/ .ui-widget { font-family: Arial; font-size: 1em; } .ui-widget-content { border: 0px solid #0066AD; background: rgba(255,255,255,0); color: #222222; } .ui-widget-header { border: 1px solid rgba(255,255,255,0); background: rgba(255,255,255,0); color: #222222; font-weight: bold; } .ui-tabs .ui-tabs-nav { margin: 0px 0px 0px -1px; padding: 0; position: absolute; z-index: 2; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em -1px 0; border-bottom: 0px solid red; padding: 0; white-space: nowrap; height: 36px; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #217CB5; background: #e6e6e6; font-weight: normal; color: #555555; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #0066AD; background: #D1DFE9; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited{ color: #0066AD; text-decoration: none; } .ui-tabs .ui-tabs-panel { display: block; padding: 1em 1.4em; border: 1px solid #0066AD; background: #D1DFE9; border-radius: 2px; position: relative; z-index: 1; top:39px; } .ui-tabs .ui-tabs-panel fieldset { border: 1px solid #fff; margin-bottom: 8px; border-radius: 2px; background: rgba(255,255,255,0.35); } /*table*/ .event { width:99%; border-collapse:collapse; margin: 10px 8px 15px 5px; } .event th{ padding:8px; border:#fff 1px solid; color: #0066AD; font-weight: normal; } .event td { padding:8px; border:#fff 1px solid; color: #333; } .event tr:nth-child(even) { background: #A4D1FF; } .event tr:nth-child(odd) { background: #EAF4FF; } .ui-widget button { font-family: Arial; font-size: 14px; } textarea, input[type=text], input[type="password"], input[type="search"] { box-shadow: inset 0px 1px 1px 0px rgba(0,0,0,0.75); color: #12263A; background-color: rgba(255,255,255,0.15); border: none; border-bottom: 1px solid rgba(45,160,255,.08); border-radius: 2px; height:28px; border-width: 1px; } input[type=text]:focus, input[type="password"]:focus, input[type="search"]:focus { border: 1px solid #0076B6; color: #12263A; } input[readonly="readonly"]:focus,textarea[readonly="readonly"]:focus { border: 1px solid #0076B6; color: #12263A; background-color: rgba(255,255,255,0.15); } input:focus, textarea:focus, keygen:focus, select:focus { outline-offset: -2px; } input[type=text]:hover, input[type="password"]:hover, input[type="search"]:hover { border: 1px solid #0076B6; color: #12263A; }
aedelmann/vorto
example-generators/org.eclipse.vorto.codegen.examples.webdevice/resources/css/webdevice.css
CSS
epl-1.0
3,476
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="copyright" content="(C) Copyright 2010" /> <meta name="DC.rights.owner" content="(C) Copyright 2010" /> <meta name="DC.Type" content="cxxClass" /> <meta name="DC.Title" content="MContactStorageObserver" /> <meta name="DC.Format" content="XHTML" /> <meta name="DC.Identifier" content="GUID-267B4FB3-D987-3056-B7D5-B1A5825F4C07" /> <title> MContactStorageObserver </title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api" /> <link rel="stylesheet" type="text/css" href="cxxref.css" /> </head> <body class="cxxref" id="GUID-267B4FB3-D987-3056-B7D5-B1A5825F4C07"> <a name="GUID-267B4FB3-D987-3056-B7D5-B1A5825F4C07"> <!-- --> </a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Application Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2518338 id2518347 id2518392 id2518473 id2505981 id2505986 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"> <a href="index.html" title="Symbian^3 Application Developer Library"> Symbian^3 Application Developer Library </a> &gt; </div> <h1 class="topictitle1"> MContactStorageObserver Class Reference </h1> <table class="signature"> <tr> <td> class MContactStorageObserver </td> </tr> </table> <div class="section"> <div> <p> Mixin used to observe low disk events </p> </div> </div> <div class="section member-index"> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Public Member Functions </th> </tr> </thead> <tbody> <tr> <td align="right" class="code"> void </td> <td> <a href="#GUID-EBBBBEAD-104F-3611-8853-C3DB4ADCA236"> HandleDiskSpaceEvent </a> ( <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> ) </td> </tr> </tbody> </table> </div> <h1 class="pageHeading topictitle1"> Member Functions Documentation </h1> <div class="nested1" id="GUID-EBBBBEAD-104F-3611-8853-C3DB4ADCA236"> <a name="GUID-EBBBBEAD-104F-3611-8853-C3DB4ADCA236"> <!-- --> </a> <h2 class="topictitle2"> HandleDiskSpaceEvent(TInt) </h2> <table class="signature"> <tr> <td> void </td> <td> HandleDiskSpaceEvent </td> <td> ( </td> <td> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> </td> <td> aDrive </td> <td> ) </td> <td> [pure virtual] </td> </tr> </table> <div class="section"> </div> <div class="section parameters"> <h3 class="sectiontitle"> Parameters </h3> <table border="0" class="parameters"> <tr> <td class="parameter"> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> aDrive </td> <td> </td> </tr> </table> </div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
sdk/GUID-267B4FB3-D987-3056-B7D5-B1A5825F4C07.html
HTML
epl-1.0
4,615
/******************************************************************************* * Copyright (c) 2020, 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package com.ibm.ws.wssecurity.fat.cxf.x509token; import static componenttest.annotation.SkipForRepeat.EE9_FEATURES; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; import java.util.Set; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import com.ibm.websphere.simplicity.ShrinkHelper; import com.ibm.websphere.simplicity.config.ServerConfiguration; import com.ibm.websphere.simplicity.log.Log; import com.ibm.ws.wssecurity.fat.utils.common.SharedTools; import com.meterware.httpunit.GetMethodWebRequest; import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; import componenttest.annotation.AllowedFFDC; import componenttest.annotation.ExpectedFFDC; import componenttest.annotation.Server; import componenttest.annotation.SkipForRepeat; import componenttest.custom.junit.runner.FATRunner; import componenttest.custom.junit.runner.Mode; import componenttest.custom.junit.runner.Mode.TestMode; import componenttest.rules.repeater.EE8FeatureReplacementAction; import componenttest.rules.repeater.EmptyAction; import componenttest.topology.impl.LibertyFileManager; import componenttest.topology.impl.LibertyServer; @SkipForRepeat({ EE9_FEATURES }) @Mode(TestMode.FULL) @RunWith(FATRunner.class) public class CxfX509OverRideTests { static final private String serverName = "com.ibm.ws.wssecurity_fat.x509_1"; @Server(serverName) public static LibertyServer server; static private final Class<?> thisClass = CxfX509OverRideTests.class; private static String portNumber = ""; private static String portNumberSecure = ""; private static String x509ClientUrl = ""; static String hostName = "localhost"; final static String badUsernameToken = "The security token could not be authenticated or authorized"; final static String msgExpires = "The message has expired"; final static String badHttpsToken = "HttpsToken could not be asserted"; final static String badHttpsClientCert = "Could not send Message."; /** * Sets up any configuration required for running the OAuth tests. * Currently, it just starts the server, which should start the applications * in dropins. */ @BeforeClass public static void setUp() throws Exception { String thisMethod = "setup"; ServerConfiguration config = server.getServerConfiguration(); Set<String> features = config.getFeatureManager().getFeatures(); if (features.contains("usr:wsseccbh-1.0")) { server.copyFileToLibertyInstallRoot("usr/extension/lib/", "bundles/com.ibm.ws.wssecurity.example.cbh.jar"); server.copyFileToLibertyInstallRoot("usr/extension/lib/features/", "features/wsseccbh-1.0.mf"); } if (features.contains("usr:wsseccbh-2.0")) { server.copyFileToLibertyInstallRoot("usr/extension/lib/", "bundles/com.ibm.ws.wssecurity.example.cbhwss4j.jar"); server.copyFileToLibertyInstallRoot("usr/extension/lib/features/", "features/wsseccbh-2.0.mf"); copyServerXml(System.getProperty("user.dir") + File.separator + server.getPathToAutoFVTNamedServer() + "server_wss4j.xml"); } ShrinkHelper.defaultDropinApp(server, "x509client", "com.ibm.ws.wssecurity.fat.x509client", "test.wssecfvt.basicplcy", "test.wssecfvt.basicplcy.types"); ShrinkHelper.defaultDropinApp(server, "x509token", "basicplcy.wssecfvt.test"); server.startServer();// check CWWKS0008I: The security service is ready. SharedTools.waitForMessageInLog(server, "CWWKS0008I"); portNumber = "" + server.getHttpDefaultPort(); portNumberSecure = "" + server.getHttpDefaultSecurePort(); server.waitForStringInLog("port " + portNumber); server.waitForStringInLog("port " + portNumberSecure); // check message.log // CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now lis....Port 8010 assertNotNull("defaultHttpendpoint may not started at :" + portNumber, server.waitForStringInLog("CWWKO0219I.*" + portNumber)); // CWWKO0219I: TCP Channel defaultHttpEndpoint-ssl has been started and is now lis....Port 8020 assertNotNull("defaultHttpEndpoint SSL port may not be started at:" + portNumberSecure, server.waitForStringInLog("CWWKO0219I.*" + portNumberSecure)); if (features.contains("jaxws-2.2")) { x509ClientUrl = "http://localhost:" + portNumber + "/x509client/CxfX509SvcClient"; } if (features.contains("jaxws-2.3")) { x509ClientUrl = "http://localhost:" + portNumber + "/x509client/CxfX509SvcClientWss4j"; } Log.info(thisClass, thisMethod, "****portNumber is(2):" + portNumber); Log.info(thisClass, thisMethod, "****portNumberSecure is(2):" + portNumberSecure); return; } // // The server.xml in this server did not have the appropriate settings. // This test asks the cxf service client to set the properties to // overwrite them. // @Test @AllowedFFDC(value = { "java.net.MalformedURLException" }, repeatAction = { EE8FeatureReplacementAction.ID }) public void testCxfX509Service() throws Exception { String thisMethod = "testCxfX509Service"; try { testRoutine( thisMethod, //String thisMethod, "positive", // testMode: positive, positive-1, negative, negative-1.... portNumber, //String portNumber, "", //String portNumberSecure "FVTVersionBAXService", //String strServiceName, "UrnX509Token" //String strServicePort ); } catch (Exception e) { throw e; } return; } // // This test that the cxf service client can set the properties to overwrite the server.xml // with "negative", the cxf service won't set the x509 properties. And the test ought to throw exception // @Test @SkipForRepeat(SkipForRepeat.EE8_FEATURES) @AllowedFFDC(value = { "org.apache.ws.security.WSSecurityException" }, repeatAction = { EmptyAction.ID }) public void testCxfX50NegativeServiceEE7Only() throws Exception { String thisMethod = "testCxfX509Service"; try { testRoutine( thisMethod, //String thisMethod, "negative", // testMode: positive, positive-1, negative, negative-1.... portNumber, //String portNumber, "", //String portNumberSecure "FVTVersionBAXService", //String strServiceName, "UrnX509Token" //String strServicePort ); } catch (Exception e) { throw e; } return; } @Test @SkipForRepeat(SkipForRepeat.NO_MODIFICATION) @ExpectedFFDC(value = { "org.apache.wss4j.common.ext.WSSecurityException" }, repeatAction = { EE8FeatureReplacementAction.ID }) public void testCxfX50NegativeServiceEE8Only() throws Exception { String thisMethod = "testCxfX509Service"; try { testRoutine( thisMethod, //String thisMethod, "negative", // testMode: positive, positive-1, negative, negative-1.... portNumber, //String portNumber, "", //String portNumberSecure "FVTVersionBAXService", //String strServiceName, "UrnX509Token" //String strServicePort ); } catch (Exception e) { throw e; } return; } /** * TestDescription: * * This test invokes a simple jax-ws cxf web service. * */ protected void testRoutine( String thisMethod, String testMode, // Positive, positive-1, negative or negative-1... etc String portNumber, String portNumberSecure, String strServiceName, String strServicePort) throws Exception { try { WebRequest request = null; WebResponse response = null; // Create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); // Invoke the service client - servlet Log.info(thisClass, thisMethod, "Invoking: " + x509ClientUrl); request = new GetMethodWebRequest(x509ClientUrl); request.setParameter("serverName", serverName); request.setParameter("thisMethod", thisMethod); request.setParameter("testMode", testMode); request.setParameter("httpDefaultPort", portNumber); request.setParameter("httpSecureDefaultPort", portNumberSecure); request.setParameter("serviceName", strServiceName); request.setParameter("servicePort", strServicePort); // Invoke the client response = wc.getResponse(request); // Read the response page from client jsp String respReceived = response.getText(); Log.info(thisClass, thisMethod, "'" + respReceived + "'"); assertTrue("Failed to get back the expected text. But :" + respReceived, respReceived.contains("<p>pass:true:")); assertTrue("Hmm... Strange! wrong testMethod back. But :" + respReceived, respReceived.contains(">m:" + thisMethod + "<")); } catch (Exception e) { Log.info(thisClass, thisMethod, "Exception occurred:"); System.err.println("Exception: " + e); throw e; } return; } @AfterClass public static void tearDown() throws Exception { try { printMethodName("tearDown"); if (server != null && server.isStarted()) { server.stopServer(); } } catch (Exception e) { e.printStackTrace(System.out); } server.deleteFileFromLibertyInstallRoot("usr/extension/lib/bundles/com.ibm.ws.wssecurity.example.cbh.jar"); server.deleteFileFromLibertyInstallRoot("usr/extension/lib/features/wsseccbh-1.0.mf"); server.deleteFileFromLibertyInstallRoot("usr/extension/lib/bundles/com.ibm.ws.wssecurity.example.cbhwss4j.jar"); server.deleteFileFromLibertyInstallRoot("usr/extension/lib/features/wsseccbh-2.0.mf"); } private static void printMethodName(String strMethod) { Log.info(thisClass, strMethod, "*****************************" + strMethod); System.err.println("*****************************" + strMethod); } public static void copyServerXml(String copyFromFile) throws Exception { try { String serverFileLoc = (new File(server.getServerConfigurationPath().replace('\\', '/'))).getParent(); Log.info(thisClass, "copyServerXml", "Copying: " + copyFromFile + " to " + serverFileLoc); LibertyFileManager.copyFileIntoLiberty(server.getMachine(), serverFileLoc, "server.xml", copyFromFile); } catch (Exception ex) { ex.printStackTrace(System.out); } } }
kgibm/open-liberty
dev/com.ibm.ws.wssecurity_fat.wsscxf.1/fat/src/com/ibm/ws/wssecurity/fat/cxf/x509token/CxfX509OverRideTests.java
Java
epl-1.0
12,264
<!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"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>TB9.2 Example Applications: CCSSyncApplication Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> <link type="text/css" rel="stylesheet" href="../css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="../css/sdl.css" media="screen"/> <!--[if IE]> <link href="../css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> </head> <body class="kernelguide"> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Product Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <!-- Generated by Doxygen 1.6.2 --> <div class="contents"> <h1>CCSSyncApplication Class Reference</h1><!-- doxytag: class="CCSSyncApplication" --> <p><a href="class_c_c_s_sync_application-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">TUid&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_c_s_sync_application.html#a457ac451350be21c3cfa8c5893a604f7">AppDllUid</a> () const </td></tr> <tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">CApaDocument *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_c_s_sync_application.html#aea99d8e729c40640985ca1294a7bd822">CreateDocumentL</a> ()</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p><a class="el" href="class_c_c_s_sync_application.html">CCSSyncApplication</a> An instance of <a class="el" href="class_c_c_s_sync_application.html">CCSSyncApplication</a> is the application part of the AVKON application framework for the CSSync example application. </p> <p>Definition at line <a class="el" href="../cssyncapplication_8h_source.html#l00033">33</a> of file <a class="el" href="../cssyncapplication_8h_source.html">cssyncapplication.h</a>.</p> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a457ac451350be21c3cfa8c5893a604f7"></a><!-- doxytag: member="CCSSyncApplication::AppDllUid" ref="a457ac451350be21c3cfa8c5893a604f7" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">TUid CCSSyncApplication::AppDllUid </td> <td>(</td> <td class="paramname"></td> <td>&nbsp;)&nbsp;</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>From CAknApplication, AppDllUid. Returns the application DLL UID value. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>the UID of this Application/Dll. </dd></dl> <p>Definition at line <a class="el" href="../cssyncapplication_8cpp_source.html#l00038">38</a> of file <a class="el" href="../cssyncapplication_8cpp_source.html">cssyncapplication.cpp</a>.</p> </div> </div> <a class="anchor" id="aea99d8e729c40640985ca1294a7bd822"></a><!-- doxytag: member="CCSSyncApplication::CreateDocumentL" ref="aea99d8e729c40640985ca1294a7bd822" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">CApaDocument * CCSSyncApplication::CreateDocumentL </td> <td>(</td> <td class="paramname"></td> <td>&nbsp;)&nbsp;</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>From CAknApplication, CreateDocumentL. Creates a CApaDocument object and return a pointer to it. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the created document. </dd></dl> <p>Definition at line <a class="el" href="../cssyncapplication_8cpp_source.html#l00028">28</a> of file <a class="el" href="../cssyncapplication_8cpp_source.html">cssyncapplication.cpp</a>.</p> </div> </div> </div> <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp; <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/guid-6013a680-57f9-415b-8851-c4fa63356636/class_c_c_s_sync_application.html
HTML
epl-1.0
5,290
package rltoys.math.vector.testing; import java.util.Iterator; import java.util.Random; import org.junit.Assert; import org.junit.Test; import rltoys.math.vector.MutableVector; import rltoys.math.vector.RealVector; import rltoys.math.vector.VectorEntry; import rltoys.math.vector.implementations.BVector; import rltoys.math.vector.implementations.PVector; import rltoys.math.vector.implementations.SVector; import rltoys.math.vector.implementations.Vectors; public class SVectorTest extends VectorTest { private final Random random = new Random(0); @Test public void testIteratorRemove() { MutableVector v = a.copyAsMutable(); Iterator<VectorEntry> iterator = v.iterator(); iterator.next(); iterator.remove(); iterator.next(); iterator = v.iterator(); iterator.next(); iterator.remove(); VectorsTestsUtils.assertEquals(newVector(0.0, 0.0, 0.0, 0.0, 3.0), v); } @Test public void testActiveIndexes() { Assert.assertArrayEquals(new int[] { 1, 2, 4 }, ((SVector) a).activeIndexes()); Assert.assertArrayEquals(new int[] { 0, 1, 4 }, ((SVector) b).activeIndexes()); } @Test public void addBVector() { SVector v = new SVector(10); BVector b = BVector.toBVector(10, new int[] { 1, 2, 3 }); v.addToSelf(b); Assert.assertEquals(b.nonZeroElements(), v.nonZeroElements()); Assert.assertTrue(Vectors.equals(b, v)); } @Override protected RealVector newVector(RealVector v) { return newSVector(v); } @Override protected RealVector newVector(double... d) { return newSVector(d); } @Override protected RealVector newVector(int s) { return new SVector(s); } @Test public void addRandomVectors() { int size = 10; int active = 4; for (int i = 0; i < 10000; i++) { SVector a = createRandomSVector(active, size); SVector b = createRandomSVector(active, size); testVectorOperation(a, b); testVectorOperation(a, new PVector(b.accessData())); testVectorOperation(a, createRandomBVector(active, size)); } } private void testVectorOperation(SVector a, RealVector b) { PVector pa = new PVector(a.accessData()); PVector pb = new PVector(b.accessData()); VectorsTestsUtils.assertEquals(pa, a); VectorsTestsUtils.assertEquals(pb, b); VectorsTestsUtils.assertEquals(pa.add(pb), a.add(b)); VectorsTestsUtils.assertEquals(pa.subtract(pb), a.subtract(b)); VectorsTestsUtils.assertEquals(pa.ebeMultiply(pb), a.ebeMultiply(b)); float factor = random.nextFloat(); VectorsTestsUtils.assertEquals(pa.addToSelf(factor, pb), a.add(b.mapMultiply(factor))); } private BVector createRandomBVector(int maxActive, int size) { BVector result = new BVector(size); int nbActive = random.nextInt(maxActive); for (int i = 0; i < nbActive; i++) result.setOn(random.nextInt(size)); return result; } private SVector createRandomSVector(int maxActive, int size) { SVector result = new SVector(size); int nbActive = random.nextInt(maxActive); for (int i = 0; i < nbActive; i++) result.setEntry(random.nextInt(size), random.nextDouble() * 2 - 1); return result; } }
amw8/rlpark
rlpark.plugin.rltoys/jvsrctests/rltoys/math/vector/testing/SVectorTest.java
Java
epl-1.0
3,182
package com.dim.brandsort; import android.content.Context; import android.graphics.Bitmap; import android.os.Handler; import android.support.v4.view.MotionEventCompat; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import java.util.List; /** * 拖拽排序 + 增删 * Created by dim on 2018/11/23. */ public class ViewTuijianBrandAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements OnItemMoveListener { // 我的品牌 标题部分 public static final int TYPE_MY_BRAND_HEADER = 0; // 我的品牌 public static final int TYPE_MY = 1; // 其他品牌 标题部分 public static final int TYPE_OTHER_BRAND_HEADER = 2; // 其他品牌 public static final int TYPE_OTHER = 3; // 我的品牌之前的header数量 即标题部分 为 1 private static final int COUNT_PRE_MY_HEADER = 1; // 其他品牌之前的header数量 即标题部分 为 COUNT_PRE_MY_HEADER + 1 private static final int COUNT_PRE_OTHER_HEADER = COUNT_PRE_MY_HEADER + 1; private static final long ANIM_TIME = 360L; // touch 点击开始时间 private long startTime; // touch 间隔时间 用于分辨是否是 "点击" private static final long SPACE_TIME = 100; private Context mContext; private LayoutInflater mInflater; private ItemTouchHelper mItemTouchHelper; private List<MDiyBrandItem> mMyBrandItems, mOtherBrandItems; // 我的品牌点击事件 private OnMyBrandItemClickListener mBrandItemClickListener; public ViewTuijianBrandAdapter(Context context, ItemTouchHelper helper, List<MDiyBrandItem> mMyBrandItems, List<MDiyBrandItem> mOtherBrandItems) { this.mInflater = LayoutInflater.from(context); this.mContext = context; this.mItemTouchHelper = helper; this.mMyBrandItems = mMyBrandItems; this.mOtherBrandItems = mOtherBrandItems; } @Override public int getItemViewType(int position) { if (position == 0) { // 我的品牌 标题部分 return TYPE_MY_BRAND_HEADER; } else if (position == mMyBrandItems.size() + 1) { // 其他品牌 标题部分 return TYPE_OTHER_BRAND_HEADER; } else if (position > 0 && position < mMyBrandItems.size() + 1) { return TYPE_MY; } else { return TYPE_OTHER; } } /** * 排序。sort大的排在前面 * * @param currentPos * @return */ private int getPosFromMyToOther(int currentPos) { int currentSortId = mMyBrandItems.get(currentPos).getSort(); for (int i = 0; i < mOtherBrandItems.size(); i++) { if (currentSortId > mOtherBrandItems.get(i).getSort()) { return i; } } return mOtherBrandItems.size(); } @Override public RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent, int viewType) { final View view; switch (viewType) { case TYPE_MY_BRAND_HEADER: view = mInflater.inflate(R.layout.view_diy_pinpai_head, parent, false); MyBrandHeaderViewHolder holder = new MyBrandHeaderViewHolder(view); return holder; case TYPE_MY: view = mInflater.inflate(R.layout.view_tuijian_brand_adapter_item, parent, false); final MyViewHolder myHolder = new MyViewHolder(view); myHolder.bandView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { int currentPiosition = myHolder.getAdapterPosition(); RecyclerView recyclerView = ((RecyclerView) parent); int targetViewPos = getPosFromMyToOther(currentPiosition - 1); View targetView = recyclerView.getLayoutManager().findViewByPosition(mMyBrandItems.size() + targetViewPos + COUNT_PRE_OTHER_HEADER); View currentView = recyclerView.getLayoutManager().findViewByPosition(currentPiosition); // 如果targetView不在屏幕内,则indexOfChild为-1 此时不需要添加动画,因为此时notifyItemMoved自带一个向目标移动的动画 // 如果在屏幕内,则添加一个位移动画 if (recyclerView.indexOfChild(targetView) >= 0) { int targetX, targetY; RecyclerView.LayoutManager manager = recyclerView.getLayoutManager(); GridLayoutManager gridLayoutManager = ((GridLayoutManager) manager); int spanCount = gridLayoutManager.getSpanCount(); targetX = targetView.getLeft(); targetY = targetView.getTop(); // 如果当前是myBrand的最后一个,移除后没有了已选的 if (mMyBrandItems.size() == 1) { targetY -= targetView.getHeight(); } // 如果当前位置是myBrand可见的最后一个 // 并且 当前位置不在grid的第一个位置 // 并且 目标位置不在grid的第一个位置 // 则 需要延迟250秒 notifyItemMove , 这是因为这种情况 , 并不触发ItemAnimator , 会直接刷新界面 // 导致我们的位移动画刚开始,就已经notify完毕,引起不同步问题 if (currentPiosition == gridLayoutManager.findLastVisibleItemPosition() && (currentPiosition - COUNT_PRE_MY_HEADER) % spanCount != 0 && (targetViewPos - mMyBrandItems.size() - COUNT_PRE_OTHER_HEADER) % spanCount != 0) { moveMyToOtherDelay(myHolder, targetViewPos); } else { moveMyToOther(myHolder, targetViewPos); } startAnimation(recyclerView, currentView, targetX, targetY); } else { // 需要移动到其他品牌的最后一个 if (targetViewPos == mOtherBrandItems.size() && mOtherBrandItems.size() > 0) { int targetX, targetY; RecyclerView.LayoutManager manager = recyclerView.getLayoutManager(); GridLayoutManager gridLayoutManager = ((GridLayoutManager) manager); int spanCount = gridLayoutManager.getSpanCount(); View preTargetView; // 移动后 新的一个item在新的一行第一个 if (mOtherBrandItems.size() % spanCount == 0) { preTargetView = recyclerView.getLayoutManager().findViewByPosition(mMyBrandItems.size() + targetViewPos + COUNT_PRE_OTHER_HEADER - spanCount); targetX = preTargetView.getLeft(); targetY = preTargetView.getTop() + preTargetView.getHeight(); } else { preTargetView = recyclerView.getLayoutManager().findViewByPosition(mMyBrandItems.size() + targetViewPos + COUNT_PRE_OTHER_HEADER - 1); targetX = preTargetView.getLeft() + preTargetView.getWidth(); targetY = preTargetView.getTop(); } // 如果当前是myBrand的最后一个,移除后没有了已选的 if (mMyBrandItems.size() == 1) { targetY -= preTargetView.getHeight(); } // 如果当前位置是myBrand可见的最后一个 // 并且 当前位置不在grid的第一个位置 // 并且 目标位置不在grid的第一个位置 // 则 需要延迟250秒 notifyItemMove , 这是因为这种情况 , 并不触发ItemAnimator , 会直接刷新界面 // 导致我们的位移动画刚开始,就已经notify完毕,引起不同步问题 if (currentPiosition == gridLayoutManager.findLastVisibleItemPosition() && (currentPiosition - COUNT_PRE_MY_HEADER) % spanCount != 0 && (targetViewPos - mMyBrandItems.size() - COUNT_PRE_OTHER_HEADER) % spanCount != 0) { moveMyToOtherDelay(myHolder, targetViewPos); } else { moveMyToOther(myHolder, targetViewPos); } startAnimation(recyclerView, currentView, targetX, targetY); } else { moveMyToOther(myHolder, targetViewPos); if (mBrandItemClickListener != null) { mBrandItemClickListener.onItemClick(v, currentPiosition - COUNT_PRE_MY_HEADER); } } } } }); myHolder.bandView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(final View v) { mItemTouchHelper.startDrag(myHolder); return true; } }); myHolder.bandView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { switch (MotionEventCompat.getActionMasked(event)) { case MotionEvent.ACTION_DOWN: startTime = System.currentTimeMillis(); break; case MotionEvent.ACTION_MOVE: if (System.currentTimeMillis() - startTime > SPACE_TIME) { mItemTouchHelper.startDrag(myHolder); } break; case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: startTime = 0; break; } return false; } }); return myHolder; case TYPE_OTHER_BRAND_HEADER: view = mInflater.inflate(R.layout.view_diy_pinpai_head, parent, false); OtherBrandHeaderViewHolder otherholder = new OtherBrandHeaderViewHolder(view); return otherholder; case TYPE_OTHER: view = mInflater.inflate(R.layout.view_tuijian_brand_adapter_item, parent, false); final OtherViewHolder otherHolder = new OtherViewHolder(view); otherHolder.bandView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mMyBrandItems.size() >= 3) { Toast.makeText(mContext, "已满3个推荐品牌,请取消任意一个品牌再进行切换", Toast.LENGTH_SHORT).show(); return; } RecyclerView recyclerView = ((RecyclerView) parent); RecyclerView.LayoutManager manager = recyclerView.getLayoutManager(); int currentPiosition = otherHolder.getAdapterPosition(); // 如果RecyclerView滑动到底部,移动的目标位置的y轴 - height View currentView = manager.findViewByPosition(currentPiosition); // 目标位置的前一个item 即当前MyBrand的最后一个 View preTargetView = manager.findViewByPosition(mMyBrandItems.size() - 1 + COUNT_PRE_MY_HEADER); // 如果targetView不在屏幕内,则为-1 此时不需要添加动画,因为此时notifyItemMoved自带一个向目标移动的动画 // 如果在屏幕内,则添加一个位移动画 if (recyclerView.indexOfChild(preTargetView) >= 0) { int targetX = preTargetView.getLeft(); int targetY = preTargetView.getTop(); int targetPosition = mMyBrandItems.size() - 1 + COUNT_PRE_OTHER_HEADER; GridLayoutManager gridLayoutManager = ((GridLayoutManager) manager); int spanCount = gridLayoutManager.getSpanCount(); // target 在最后一行第一个 if ((targetPosition - COUNT_PRE_MY_HEADER) % spanCount == 0) { View targetView = manager.findViewByPosition(targetPosition); targetX = targetView.getLeft(); targetY = targetView.getTop(); } else { targetX += preTargetView.getWidth(); // 最后一个item可见 if (gridLayoutManager.findLastVisibleItemPosition() == getItemCount() - 1) { // 最后的item在最后一行第一个位置 if ((getItemCount() - 1 - mMyBrandItems.size() - COUNT_PRE_OTHER_HEADER) % spanCount == 0) { // RecyclerView实际高度 > 屏幕高度 && RecyclerView实际高度 < 屏幕高度 + item.height int firstVisiblePostion = gridLayoutManager.findFirstVisibleItemPosition(); if (firstVisiblePostion == 0) { // FirstCompletelyVisibleItemPosition == 0 即 内容不满一屏幕 , targetY值不需要变化 // // FirstCompletelyVisibleItemPosition != 0 即 内容满一屏幕 并且 可滑动 , targetY值 + firstItem.getTop if (gridLayoutManager.findFirstCompletelyVisibleItemPosition() != 0) { int offset = (-recyclerView.getChildAt(0).getTop()) - recyclerView.getPaddingTop(); targetY += offset; } } else { // 在这种情况下 并且 RecyclerView高度变化时(即可见第一个item的 position != 0), // 移动后, targetY值 + 一个item的高度 targetY += preTargetView.getHeight(); } } } else { System.out.println("current--No"); } } // 如果当前位置是otherBrand可见的最后一个 // 并且 当前位置不在grid的第一个位置 // 并且 目标位置不在grid的第一个位置 // 则 需要延迟250秒 notifyItemMove , 这是因为这种情况 , 并不触发ItemAnimator , 会直接刷新界面 // 导致我们的位移动画刚开始,就已经notify完毕,引起不同步问题 if (currentPiosition == gridLayoutManager.findLastVisibleItemPosition() && (currentPiosition - mMyBrandItems.size() - COUNT_PRE_OTHER_HEADER) % spanCount != 0 && (targetPosition - COUNT_PRE_MY_HEADER) % spanCount != 0) { // moveOtherToMyWithDelay(otherHolder); moveOtherToMy(otherHolder); } else { moveOtherToMy(otherHolder); } startAnimation(recyclerView, currentView, targetX, targetY); } else { moveOtherToMy(otherHolder); } } }); return otherHolder; } return null; } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder instanceof MyViewHolder) { MyViewHolder myHolder = (MyViewHolder) holder; myHolder.bandView.init(mContext, mMyBrandItems.get(position - COUNT_PRE_MY_HEADER), ViewBrandType.DELETE); } else if (holder instanceof OtherViewHolder) { ((OtherViewHolder) holder).bandView.init(mContext, mOtherBrandItems.get(position - mMyBrandItems.size() - COUNT_PRE_OTHER_HEADER), ViewBrandType.ADD); } else if (holder instanceof MyBrandHeaderViewHolder) { MyBrandHeaderViewHolder headerHolder = (MyBrandHeaderViewHolder) holder; headerHolder.name.setText("已推荐到封面"); } else if (holder instanceof OtherBrandHeaderViewHolder) { OtherBrandHeaderViewHolder oheaderHolder = (OtherBrandHeaderViewHolder) holder; oheaderHolder.name.setText("其他品牌(" + mOtherBrandItems.size() + ")"); } } @Override public int getItemCount() { // 我的品牌 标题 + 我的品牌.size + 其他品牌 标题 + 其他品牌.size return mMyBrandItems.size() + mOtherBrandItems.size() + COUNT_PRE_OTHER_HEADER; } /** * 开始增删动画 */ private void startAnimation(RecyclerView recyclerView, final View currentView, float targetX, float targetY) { final ViewGroup viewGroup = (ViewGroup) recyclerView.getParent(); final ImageView mirrorView = addMirrorView(viewGroup, recyclerView, currentView); Animation animation = getTranslateAnimator( targetX - currentView.getLeft(), targetY - currentView.getTop()); currentView.setVisibility(View.INVISIBLE); mirrorView.startAnimation(animation); animation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { viewGroup.removeView(mirrorView); if (currentView.getVisibility() == View.INVISIBLE) { currentView.setVisibility(View.VISIBLE); } } @Override public void onAnimationRepeat(Animation animation) { } }); } /** * 我的品牌 移动到 其他品牌 * * @param myHolder */ private void moveMyToOther(MyViewHolder myHolder, int toPos) { int position = myHolder.getAdapterPosition(); int startPosition = position - COUNT_PRE_MY_HEADER; if (startPosition > mMyBrandItems.size() - 1) { return; } MDiyBrandItem item = mMyBrandItems.get(startPosition); mMyBrandItems.remove(startPosition); mOtherBrandItems.add(toPos, item); notifyItemMoved(position, mMyBrandItems.size() + toPos + COUNT_PRE_OTHER_HEADER); notifyItemChanged(mMyBrandItems.size() + COUNT_PRE_MY_HEADER); } /** * 我的品牌 移动到 其他品牌 伴随延迟 * * @param myHolder */ private void moveMyToOtherDelay(MyViewHolder myHolder, int toPos) { int position = myHolder.getAdapterPosition(); int startPosition = position - COUNT_PRE_MY_HEADER; if (startPosition > mMyBrandItems.size() - 1) { return; } delayHandler.postDelayed(new Runnable() { @Override public void run() { moveMyToOther(myHolder, toPos); } }, ANIM_TIME); } /** * 其他品牌 移动到 我的品牌 * * @param otherHolder */ private void moveOtherToMy(OtherViewHolder otherHolder) { int position = processItemRemoveAdd(otherHolder); if (position == -1) { return; } notifyItemMoved(position, mMyBrandItems.size() - 1 + COUNT_PRE_MY_HEADER); notifyItemChanged(mMyBrandItems.size() + COUNT_PRE_MY_HEADER); } /** * 其他品牌 移动到 我的品牌 伴随延迟 * * @param otherHolder */ private void moveOtherToMyWithDelay(OtherViewHolder otherHolder) { final int position = processItemRemoveAdd(otherHolder); if (position == -1) { return; } delayHandler.postDelayed(new Runnable() { @Override public void run() { notifyItemMoved(position, mMyBrandItems.size() - 1 + COUNT_PRE_MY_HEADER); } }, ANIM_TIME); } private Handler delayHandler = new Handler(); private int processItemRemoveAdd(OtherViewHolder otherHolder) { int position = otherHolder.getAdapterPosition(); int startPosition = position - mMyBrandItems.size() - COUNT_PRE_OTHER_HEADER; if (startPosition > mOtherBrandItems.size() - 1) { return -1; } MDiyBrandItem item = mOtherBrandItems.get(startPosition); mOtherBrandItems.remove(startPosition); mMyBrandItems.add(item); return position; } /** * 添加需要移动的 镜像View */ private ImageView addMirrorView(ViewGroup parent, RecyclerView recyclerView, View view) { /** * 我们要获取cache首先要通过setDrawingCacheEnable方法开启cache,然后再调用getDrawingCache方法就可以获得view的cache图片了。 buildDrawingCache方法可以不用调用,因为调用getDrawingCache方法时,若果cache没有建立,系统会自动调用buildDrawingCache方法生成cache。 若想更新cache, 必须要调用destoryDrawingCache方法把旧的cache销毁,才能建立新的。 当调用setDrawingCacheEnabled方法设置为false, 系统也会自动把原来的cache销毁。 */ view.destroyDrawingCache(); view.setDrawingCacheEnabled(true); final ImageView mirrorView = new ImageView(recyclerView.getContext()); Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache()); mirrorView.setImageBitmap(bitmap); view.setDrawingCacheEnabled(false); int[] locations = new int[2]; view.getLocationOnScreen(locations); int[] parenLocations = new int[2]; recyclerView.getLocationOnScreen(parenLocations); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(bitmap.getWidth(), bitmap.getHeight()); params.setMargins(locations[0], locations[1] - parenLocations[1], 0, 0); parent.addView(mirrorView, params); return mirrorView; } @Override public void onItemMove(int fromPosition, int toPosition) { MDiyBrandItem item = mMyBrandItems.get(fromPosition - COUNT_PRE_MY_HEADER); mMyBrandItems.remove(fromPosition - COUNT_PRE_MY_HEADER); mMyBrandItems.add(toPosition - COUNT_PRE_MY_HEADER, item); notifyItemMoved(fromPosition, toPosition); } /** * 获取位移动画 */ private TranslateAnimation getTranslateAnimator(float targetX, float targetY) { TranslateAnimation translateAnimation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, targetX, Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, targetY); // RecyclerView默认移动动画250ms 这里设置360ms 是为了防止在位移动画结束后 remove(view)过早 导致闪烁 translateAnimation.setDuration(ANIM_TIME); translateAnimation.setFillAfter(true); return translateAnimation; } public interface OnMyBrandItemClickListener { void onItemClick(View v, int position); } public void setOnMyBrandItemClickListener(OnMyBrandItemClickListener listener) { this.mBrandItemClickListener = listener; } /** * 我的品牌 */ class MyViewHolder extends RecyclerView.ViewHolder { private ViewBrandViewItem bandView; public MyViewHolder(View itemView) { super(itemView); bandView = (ViewBrandViewItem) itemView.findViewById(R.id.view_brandview_adapter_item_view); } } /** * 其他品牌 */ class OtherViewHolder extends RecyclerView.ViewHolder { private ViewBrandViewItem bandView; public OtherViewHolder(View itemView) { super(itemView); bandView = (ViewBrandViewItem) itemView.findViewById(R.id.view_brandview_adapter_item_view); } } /** * 我的品牌 标题部分 */ class MyBrandHeaderViewHolder extends RecyclerView.ViewHolder { private TextView name; public MyBrandHeaderViewHolder(View itemView) { super(itemView); name = (TextView) itemView.findViewById(R.id.view_diy_pinpai_name); } } /** * 其他品牌 标题部分 */ class OtherBrandHeaderViewHolder extends RecyclerView.ViewHolder { private TextView name; public OtherBrandHeaderViewHolder(View itemView) { super(itemView); name = (TextView) itemView.findViewById(R.id.view_diy_pinpai_name); } } }
dim1989/zhangzhoujun.github.io
BrandSort/app/src/main/java/com/dim/brandsort/ViewTuijianBrandAdapter.java
Java
epl-1.0
26,872
package net.unit8.bouncr.component; import enkan.component.ComponentLifecycle; import enkan.component.SystemComponent; import enkan.middleware.session.KeyValueStore; import net.unit8.bouncr.component.config.KvsSettings; /** * @author kawasima */ public class StoreProvider extends SystemComponent<StoreProvider> { private KeyValueStore bouncrTokenStore; private KeyValueStore authorizationCodeStore; private KeyValueStore accessTokenStore; private KeyValueStore oidcSessionStore; @Override protected ComponentLifecycle lifecycle() { return new ComponentLifecycle<StoreProvider>() { @Override public void start(StoreProvider provider) { BouncrConfiguration config = getDependency(BouncrConfiguration.class); KvsSettings settings = config.getKeyValueStoreSettings(); provider.bouncrTokenStore = settings .getBouncrTokenStoreFactory() .apply(getAllDependencies()); provider.authorizationCodeStore = settings .getAuthorizationCodeStoreFactory() .apply(getAllDependencies()); provider.accessTokenStore = settings .getAccessTokenStoreFactory() .apply(getAllDependencies()); provider.oidcSessionStore = settings .getOidcSessionStoreFactory() .apply(getAllDependencies()); } @Override public void stop(StoreProvider provider) { provider.bouncrTokenStore = null; } }; } public KeyValueStore getStore(StoreType storeType) { switch(storeType) { case BOUNCR_TOKEN: return bouncrTokenStore; case AUTHORIZATION_CODE: return authorizationCodeStore; case ACCESS_TOKEN: return accessTokenStore; case OIDC_SESSION: return oidcSessionStore; default: throw new IllegalArgumentException(storeType + " is unknown"); } } public enum StoreType { BOUNCR_TOKEN, AUTHORIZATION_CODE, ACCESS_TOKEN, OIDC_SESSION } }
kawasima/bouncr
bouncr-components/src/main/java/net/unit8/bouncr/component/StoreProvider.java
Java
epl-1.0
2,242
package org.mwc.debrief.dis.diagnostics; import org.mwc.debrief.dis.providers.network.IDISNetworkPrefs; public class TestNetPrefs implements IDISNetworkPrefs { final static String IP = "127.0.0.1"; static final int PORT = 2000; @Override public String getIPAddress() { return IP; } @Override public int getPort() { return PORT; } }
debrief/debrief
org.mwc.debrief.dis/src/org/mwc/debrief/dis/diagnostics/TestNetPrefs.java
Java
epl-1.0
348
# # Copyright (c) 2010-2013 NEC Corporation # All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v1.0 which accompanies this # distribution, and is available at http://www.eclipse.org/legal/epl-v10.html # ## ## Makefile that drives the production of PFC system libraries. ## include ../build/config.mk IPCXX_SUBDIRS = libpfcxx_ipcsrv libpfcxx_ipcclnt IPC_SUBDIRS = libpfc_ipc libpfc_ipcsrv libpfc_ipcclnt $(IPCXX_SUBDIRS) SUBDIRS = libpfc libpfc_util libpfc_cmd libpfc_ctrl SUBDIRS += libpfcxx $(IPC_SUBDIRS) LIBPFC_DEPS = libpfc_util libpfc_ipcsrv libpfc_ipcclnt ifdef JAVA_CONFIG_MK SUBDIRS += libpfc_jni endif # JAVA_CONFIG_MK include $(BLDDIR)/subdirs.mk # Export header files. export-header: $(EXPORT_HEADER_DIR) ifdef EXPORT_HEADER_DIR HEAD_CPP = $(CXX) HEAD_CPPFLAGS = -x c++ -E $(CC_MODE) $(CXX_CPPFLAGS) $(CPPFLAGS) HEAD_PREFIX = pfc pfcxx HEAD_SRCDIR = $(SRCROOT)/include $(OBJS_INCLUDE) HEAD_FLAGS = -c $(HEAD_CPP) $(HEAD_PREFIX:%=-p%) $(HEAD_CPPFLAGS:%=-C%) HEAD_FLAGS += $(HEAD_SRCDIR:%=-s %) HEAD_HEADERS = $(SUBDIRS:%=%/HEADERS) $(EXPORT_HEADER_DIR): FRC $(HEADEXPORT) -o $@ $(HEAD_FLAGS) $(HEAD_HEADERS) endif # !EXPORT_HEADER_DIR # Directory build dependencies. libpfc: $(LIBPFC_DEPS) libpfc_cmd: libpfc_util libpfc_ipc: libpfc_util libpfc_ipcsrv: libpfc_ipc libpfc_ipcclnt: libpfc_ipc libpfcxx: libpfc $(IPCXX_SUBDIRS) libpfcxx_ipcsrv: libpfc_ipcsrv libpfcxx_ipcclnt: libpfc_ipcclnt ifdef JAVA_CONFIG_MK libpfc_jni: libpfc_util endif # JAVA_CONFIG_MK
opendaylight/vtn
coordinator/core/libs/Makefile
Makefile
epl-1.0
1,580
/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ package com.prowidesoftware.swift.model.field; import java.io.Serializable; import java.util.List; import java.util.ArrayList; import java.util.Calendar; import org.apache.commons.lang.StringUtils; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; /** * Field 69D<br /><br /> * * validation pattern: :4!c//&lt;DATE4&gt;&lt;TIME2&gt;/4!c<br /> * parser pattern: :S//&lt;DATE4&gt;&lt;TIME2&gt;/S<br /> * components pattern: SDTS<br /> * * <h1>Components Data types</h1> * <ul> * <li>component1: <code>String</code></li> * <li>component2: <code>Calendar</code></li> * <li>component3: <code>Calendar</code></li> * <li>component4: <code>String</code></li> * </ul> * * <em>NOTE: this source code has been generated from template</em> * * @author www.prowidesoftware.com * */ @SuppressWarnings("unused") public class Field69D extends Field implements Serializable , DateContainer, GenericField { private static final long serialVersionUID = 1L; /** * Constant with the field name 69D */ public static final String NAME = "69D"; /** * same as NAME, intended to be clear when using static imports */ public static final String F_69D = "69D"; public static final String PARSER_PATTERN =":S//<DATE4><TIME2>/S"; public static final String COMPONENTS_PATTERN = "SDTS"; /** * Create a Tag with this field name and the given value. * Shorthand for <code>new Tag(NAME, value)</code> * @see #NAME * @since 7.5 */ public static Tag tag(final String value) { return new Tag(NAME, value); } /** * Create a Tag with this field name and an empty string as value * Shorthand for <code>new Tag(NAME, "")</code> * @see #NAME * @since 7.5 */ public static Tag emptyTag() { return new Tag(NAME, ""); } /** * Default constructor */ public Field69D() { super(4); } /** * Creates the field parsing the parameter value into fields' components * @param value */ public Field69D(String value) { this(); setComponent1(SwiftParseUtils.getTokenFirst(value, ":", "//")); String toparse = SwiftParseUtils.getTokenSecondLast(value, "//"); String toparse2 = SwiftParseUtils.getTokenFirst(toparse, "/"); setComponent4(SwiftParseUtils.getTokenSecondLast(toparse, "/")); if (toparse2 != null) { if (toparse2.length() >= 8) { setComponent2(org.apache.commons.lang.StringUtils.substring(toparse2, 0, 8)); } if (toparse2.length() > 8) { setComponent3(org.apache.commons.lang.StringUtils.substring(toparse2, 8)); } } } /** * Serializes the fields' components into the single string value (SWIFT format) */ @Override public String getValue() { final StringBuilder result = new StringBuilder(); result.append(":"); result.append(StringUtils.trimToEmpty(getComponent1())); result.append("//"); result.append(StringUtils.trimToEmpty(getComponent2())); result.append(StringUtils.trimToEmpty(getComponent3())); result.append("/"); result.append(StringUtils.trimToEmpty(getComponent4())); return result.toString(); } /** * Get the component1 * @return the component1 */ public String getComponent1() { return getComponent(1); } /** * Same as getComponent(1) */ @Deprecated public java.lang.String getComponent1AsString() { return getComponent(1); } /** * Get the Qualifier (component1). * @return the Qualifier from component1 */ public String getQualifier() { return getComponent(1); } /** * Set the component1. * @param component1 the component1 to set */ public Field69D setComponent1(String component1) { setComponent(1, component1); return this; } /** * Set the Qualifier (component1). * @param component1 the Qualifier to set */ public Field69D setQualifier(String component1) { setComponent(1, component1); return this; } /** * Get the component2 * @return the component2 */ public String getComponent2() { return getComponent(2); } /** * Get the component2 as Calendar * @return the component2 converted to Calendar or <code>null</code> if cannot be converted */ public java.util.Calendar getComponent2AsCalendar() { return SwiftFormatUtils.getDate4(getComponent(2)); } /** * Get the Date (component2). * @return the Date from component2 */ public String getDate() { return getComponent(2); } /** * Get the Date (component2) as Calendar * @return the Date from component2 converted to Calendar or <code>null</code> if cannot be converted */ public java.util.Calendar getDateAsCalendar() { return SwiftFormatUtils.getDate4(getComponent(2)); } /** * Set the component2. * @param component2 the component2 to set */ public Field69D setComponent2(String component2) { setComponent(2, component2); return this; } /** * Set the component2. * @param component2 the Calendar with the component2 content to set */ public Field69D setComponent2(java.util.Calendar component2) { setComponent(2, SwiftFormatUtils.getDate4(component2)); return this; } /** * Set the Date (component2). * @param component2 the Date to set */ public Field69D setDate(String component2) { setComponent(2, component2); return this; } /** * Set the Date (component2) as Calendar * @param component2 Calendar with the Date content to set */ public Field69D setDate(java.util.Calendar component2) { setComponent(2, SwiftFormatUtils.getDate4(component2)); return this; } /** * Get the component3 * @return the component3 */ public String getComponent3() { return getComponent(3); } /** * Get the component3 as Calendar * @return the component3 converted to Calendar or <code>null</code> if cannot be converted */ public java.util.Calendar getComponent3AsCalendar() { return SwiftFormatUtils.getTime2(getComponent(3)); } /** * Get the Time (component3). * @return the Time from component3 */ public String getTime() { return getComponent(3); } /** * Get the Time (component3) as Calendar * @return the Time from component3 converted to Calendar or <code>null</code> if cannot be converted */ public java.util.Calendar getTimeAsCalendar() { return SwiftFormatUtils.getTime2(getComponent(3)); } /** * Set the component3. * @param component3 the component3 to set */ public Field69D setComponent3(String component3) { setComponent(3, component3); return this; } /** * Set the component3. * @param component3 the Calendar with the component3 content to set */ public Field69D setComponent3(java.util.Calendar component3) { setComponent(3, SwiftFormatUtils.getTime2(component3)); return this; } /** * Set the Time (component3). * @param component3 the Time to set */ public Field69D setTime(String component3) { setComponent(3, component3); return this; } /** * Set the Time (component3) as Calendar * @param component3 Calendar with the Time content to set */ public Field69D setTime(java.util.Calendar component3) { setComponent(3, SwiftFormatUtils.getTime2(component3)); return this; } /** * Get the component4 * @return the component4 */ public String getComponent4() { return getComponent(4); } /** * Same as getComponent(4) */ @Deprecated public java.lang.String getComponent4AsString() { return getComponent(4); } /** * Set the component4. * @param component4 the component4 to set */ public Field69D setComponent4(String component4) { setComponent(4, component4); return this; } public List<Calendar> dates() { List<Calendar> result = new java.util.ArrayList<Calendar>(); result.add(SwiftFormatUtils.getDate4(getComponent(2))); result.add(SwiftFormatUtils.getTime2(getComponent(3))); return result; } /** * Given a component number it returns true if the component is optional, * regardless of the field being mandatory in a particular message.<br /> * Being the field's value conformed by a composition of one or several * internal component values, the field may be present in a message with * a proper value but with some of its internal components not set. * * @param component component number, first component of a field is referenced as 1 * @return true if the component is optional for this field, false otherwise */ @Override public boolean isOptional(int component) { return false; } /** * Returns true if the field is a GENERIC FIELD as specified by the standard. * * @return true if the field is generic, false otherwise */ @Override public boolean isGeneric() { return true; } /** * Returns the issuer code (or Data Source Scheme or DSS). * The DSS is only present in some generic fields, when present, is equals to component two. * * @return DSS component value or <code>null</code> if the DSS is not set or not available for this field. */ public String getDSS() { return null; } /** * Checks if the issuer code (or Data Source Scheme or DSS) is present. * * @see #getDSS() * @return true if DSS is present, false otherwise. */ public boolean isDSSPresent() { return getDSS() != null; } /** * Gets the conditional qualifier.<br /> * The conditional qualifier is the the component following the DSS of generic fields, being component 2 or 3 depending on the field structure definition. * * @return for generic fields returns the value of the conditional qualifier or <code>null</code> if not set or not applicable for this kind of field. */ public String getConditionalQualifier() { return getComponent(2); } public String componentsPattern() { return COMPONENTS_PATTERN; } public String parserPattern() { return PARSER_PATTERN; } /** * @deprecated use constant Field69D */ @Override public String getName() { return NAME; } /** * Get the first occurrence form the tag list or null if not found. * @returns null if not found o block is null or empty * @param block may be null or empty */ public static Field69D get(final SwiftTagListBlock block) { if (block == null || block.isEmpty()) { return null; } return (Field69D) block.getFieldByName(NAME); } /** * Get the first instance of Field69D in the given message. * @param msg may be empty or null * @returns null if not found or msg is empty or null * @see */ public static Field69D get(final SwiftMessage msg) { if (msg == null || msg.getBlock4()==null || msg.getBlock4().isEmpty()) return null; return get(msg.getBlock4()); } /** * Get a list of all occurrences of the field Field69D in the given message * an empty list is returned if none found. * @param msg may be empty or null in which case an empty list is returned * @see */ public static java.util.List<Field69D> getAll(final SwiftMessage msg) { if (msg == null || msg.getBlock4()==null || msg.getBlock4().isEmpty()) return null; return getAll(msg.getBlock4()); } /** * Get a list of all occurrences of the field Field69D from the given block * an empty list is returned if none found. * * @param block may be empty or null in which case an empty list is returned */ public static java.util.List<Field69D> getAll(final SwiftTagListBlock block) { if (block == null || block.isEmpty()) { return null; } final Field[] arr = block.getFieldsByName(NAME); if (arr != null && arr.length>0) { final java.util.ArrayList<Field69D> result = new java.util.ArrayList<Field69D>(arr.length); for (final Field f : arr) { result.add((Field69D) f); } return result; } return java.util.Collections.emptyList(); } }
hellonico/wife
src/com/prowidesoftware/swift/model/field/Field69D.java
Java
epl-1.0
12,321
<!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"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>TB9.2 Example Applications: examples/PIPS/opencproducerconsumerex/sis/backup_registration.xml Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> <link type="text/css" rel="stylesheet" href="../css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="../css/sdl.css" media="screen"/> <!--[if IE]> <link href="../css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> </head> <body class="kernelguide"> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Product Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <!-- Generated by Doxygen 1.6.2 --> <h1>examples/PIPS/opencproducerconsumerex/sis/backup_registration.xml</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> standalone=<span class="stringliteral">&quot;yes&quot;</span>?&gt; <a name="l00002"></a>00002 &lt;backup_registration&gt; <a name="l00003"></a>00003 &lt;system_backup/&gt; <a name="l00004"></a>00004 &lt;restore requires_reboot = <span class="stringliteral">&quot;no&quot;</span>/&gt; <a name="l00005"></a>00005 &lt;/backup_registration&gt; </pre></div> <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp; <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/guid-6013a680-57f9-415b-8851-c4fa63356636/_p_i_p_s_2opencproducerconsumerex_2sis_2backup__registration_8xml_source.html
HTML
epl-1.0
2,632
package name.abuchen.portfolio.datatransfer.pdf; import java.io.IOException; import name.abuchen.portfolio.datatransfer.pdf.PDFParser.Block; import name.abuchen.portfolio.datatransfer.pdf.PDFParser.DocumentType; import name.abuchen.portfolio.datatransfer.pdf.PDFParser.Transaction; import name.abuchen.portfolio.model.AccountTransaction; import name.abuchen.portfolio.model.BuySellEntry; import name.abuchen.portfolio.model.Client; import name.abuchen.portfolio.model.PortfolioTransaction; import name.abuchen.portfolio.model.Transaction.Unit; import name.abuchen.portfolio.money.Money; @SuppressWarnings("nls") public class OnvistaPDFExtractor extends AbstractPDFExtractor { public OnvistaPDFExtractor(Client client) throws IOException { super(client); addBankIdentifier(""); //$NON-NLS-1$ addBuyTransaction(); addSellTransaction(); addChangeTransaction(); addPayingTransaction(); addDividendTransaction(); addBackOfProfitsTransaction(); addTransferInTransaction(); } private void addBuyTransaction() { DocumentType type = new DocumentType("Wir haben für Sie gekauft"); this.addDocumentTyp(type); Block block = new Block("Wir haben für Sie gekauft(.*)"); type.addBlock(block); Transaction<BuySellEntry> pdfTransaction = new Transaction<BuySellEntry>(); pdfTransaction.subject(() -> { BuySellEntry entry = new BuySellEntry(); entry.setType(PortfolioTransaction.Type.BUY); return entry; }); block.set(pdfTransaction); pdfTransaction.section("name", "isin") // .find("Gattungsbezeichnung ISIN") // .match("(?<name>.*) (?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares") // .find("Nominal Kurs") // .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?)(.*)") // .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } }) .section("date", "amount", "currency") // .find("Wert(\\s+)Konto-Nr. Betrag zu Ihren Lasten(\\s*)$") // 14.01.2015 172305047 EUR 59,55 // Wert Konto-Nr. Betrag zu Ihren Lasten // 01.06.2011 172305047 EUR 6,40 .match("(?<date>\\d+.\\d+.\\d{4}+) (\\d{6,12}) (?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)$") .assign((t, v) -> { t.setDate(asDate(v.get("date"))); t.setAmount(asAmount(v.get("amount"))); t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }) .wrap(t -> new BuySellEntryItem(t)); addFeesSections(pdfTransaction); } private void addSellTransaction() { DocumentType type = new DocumentType("Wir haben für Sie verkauft"); this.addDocumentTyp(type); Block block = new Block("Wir haben für Sie verkauft(.*)"); type.addBlock(block); Transaction<BuySellEntry> pdfTransaction = new Transaction<BuySellEntry>(); pdfTransaction.subject(() -> { BuySellEntry entry = new BuySellEntry(); entry.setType(PortfolioTransaction.Type.SELL); return entry; }); block.set(pdfTransaction); pdfTransaction.section("name", "isin") // .find("Gattungsbezeichnung ISIN") // .match("(?<name>.*) (?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares").find("Nominal Kurs") .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?)(.*)") // .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } }) .section("date", "amount", "currency") .find("Wert(\\s+)Konto-Nr. Betrag zu Ihren Gunsten(\\s*)$") // 12.04.2011 172305047 EUR 21,45 .match("(?<date>\\d+.\\d+.\\d{4}+) (\\d{6,12}) (?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)") .assign((t, v) -> { t.setDate(asDate(v.get("date"))); t.setAmount(asAmount(v.get("amount"))); t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }) .wrap(t -> new BuySellEntryItem(t)); addTaxesSectionsBuySell(pdfTransaction); addFeesSections(pdfTransaction); } private void addChangeTransaction() { DocumentType type = new DocumentType("Bestätigung"); this.addDocumentTyp(type); Block block = new Block("Bestätigung(.*)"); type.addBlock(block); Transaction<BuySellEntry> pdfTransaction = new Transaction<BuySellEntry>(); pdfTransaction.subject(() -> { BuySellEntry entry = new BuySellEntry(); entry.setType(PortfolioTransaction.Type.BUY); return entry; }); block.set(pdfTransaction); pdfTransaction.section("name", "isin") // .find("Gattungsbezeichnung ISIN") // .match("(?<name>.*) (?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares") // .find("Nominal Kurs") .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?)(.*)") // .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } }) .section("date", "amount", "currency") // .find("Wert(\\s+)Konto-Nr. Betrag zu Ihren Lasten(\\s*)$") // 14.01.2015 172305047 EUR 59,55 // Wert Konto-Nr. Betrag zu Ihren Lasten // 01.06.2011 172305047 EUR 6,40 .match("(?<date>\\d+.\\d+.\\d{4}+) (\\d{6,12}) (?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)$") .assign((t, v) -> { t.setDate(asDate(v.get("date"))); t.setAmount(asAmount(v.get("amount"))); t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }).wrap(t -> new BuySellEntryItem(t)); addFeesSections(pdfTransaction); } private void addPayingTransaction() { DocumentType type = new DocumentType("Gutschriftsanzeige"); this.addDocumentTyp(type); Block block = new Block("Gutschriftsanzeige(.*)"); type.addBlock(block); Transaction<BuySellEntry> pdfTransaction = new Transaction<BuySellEntry>(); pdfTransaction.subject(() -> { BuySellEntry entry = new BuySellEntry(); entry.setType(PortfolioTransaction.Type.SELL); return entry; }); block.set(pdfTransaction); pdfTransaction.section("name", "isin") // .find("Gattungsbezeichnung (.*) ISIN") // .match("(?<name>.*) (.*) (?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares") // .find("Nominal Einlösung(.*)$") // .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?)(.*)$") .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } }) .section("date", "amount", "currency") // .find("Wert(\\s+)Konto-Nr. Betrag zu Ihren Gunsten$") // 17.11.2014 172305047 EUR 51,85 .match("(?<date>\\d+.\\d+.\\d{4}+) (\\d{6,12}) (?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)") .assign((t, v) -> { t.setDate(asDate(v.get("date"))); t.setAmount(asAmount(v.get("amount"))); t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }) .wrap(t -> new BuySellEntryItem(t)); addTaxesSectionsBuySell(pdfTransaction); } private void addDividendTransaction() { DocumentType type = new DocumentType("Erträgnisgutschrift"); this.addDocumentTyp(type); // Erträgnisgutschrift allein ist nicht gut hier, da es schon in der // Kopfzeile steht.. Block block = new Block("Dividendengutschrift.*|Kupongutschrift.*|Erträgnisgutschrift.*(\\d+.\\d+.\\d{4})"); type.addBlock(block); Transaction<AccountTransaction> pdfTransaction = new Transaction<AccountTransaction>(); pdfTransaction.subject(() -> { AccountTransaction transaction = new AccountTransaction(); transaction.setType(AccountTransaction.Type.DIVIDENDS); return transaction; }); block.set(pdfTransaction); pdfTransaction .section("name", "isin") // .find("Gattungsbezeichnung(.*) ISIN") // Commerzbank AG Inhaber-Aktien o.N. DE000CBK1001 // 5,5% TUI AG Wandelanl.v.2009(2014) 17.11.2014 // 17.11.2010 DE000TUAG117 .match("(?<name>.*?) (\\d+.\\d+.\\d{4} ){0,2}(?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares", "date", "amount", "currency") // .find("Nominal (Ex-Tag )?Zahltag (.*etrag pro // .*)?(Zinssatz.*)?") // STK 25,000 17.05.2013 17.05.2013 EUR 0,700000 // Leistungen aus dem steuerlichen Einlagenkonto (§27 // KStG) EUR 17,50 .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?) (\\d+.\\d+.\\d{4}+) (?<date>\\d+.\\d+.\\d{4}+)?(.*)") .match("(?<date>\\d+.\\d+.\\d{4}+)?(\\d{6,12})?(.{7,58} )?(?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)") .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } t.setDate(asDate(v.get("date"))); t.setAmount(asAmount(v.get("amount"))); t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }) .wrap(t -> new TransactionItem(t)); addTaxesSectionsAccount(pdfTransaction); // optional: Reinvestierung in: block = new Block("Reinvestierung.*"); type.addBlock(block); block.set(new Transaction<BuySellEntry>() .subject(() -> { BuySellEntry entry = new BuySellEntry(); entry.setType(PortfolioTransaction.Type.BUY); return entry; }) .section("date") .match("(^\\w{3}+) (\\d{1,3}(\\.\\d{3})*(,\\d{3})?) (\\d+.\\d+.\\d{4}+) (?<date>\\d+.\\d+.\\d{4}+)?(.*)") .assign((t, v) -> t.setDate(asDate(v.get("date")))) .section("name", "isin") // .find("Die Dividende wurde wie folgt in neue Aktien reinvestiert:") .find("Gattungsbezeichnung ISIN") // .match("(?<name>.*) (?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares", "amount", "currency") // .find("Nominal Reinvestierungspreis") // STK 25,000 EUR 0,700000 .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?) (?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(.*)") .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }) .wrap(t -> new BuySellEntryItem(t))); } private void addBackOfProfitsTransaction() { DocumentType type = new DocumentType("Ertragsthesaurierung"); this.addDocumentTyp(type); Block block = new Block("Ertragsthesaurierung(.*)"); type.addBlock(block); Transaction<AccountTransaction> pdfTransaction = new Transaction<AccountTransaction>(); pdfTransaction.subject(() -> { AccountTransaction transaction = new AccountTransaction(); transaction.setType(AccountTransaction.Type.DIVIDENDS); return transaction; }); block.set(pdfTransaction); pdfTransaction.section("name", "isin") // .find("Gattungsbezeichnung(.*) ISIN") // Commerzbank AG Inhaber-Aktien o.N. DE000CBK1001 // 5,5% TUI AG Wandelanl.v.2009(2014) 17.11.2014 // 17.11.2010 DE000TUAG117 .match("(?<name>.*?) (\\d+.\\d+.\\d{4} ){0,2}(?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares", "date") .find("Nominal (Ex-Tag )?Zahltag (.*etrag pro .*)?(Zinssatz.*)?") // STK 28,000 02.03.2015 04.03.2015 EUR 0,088340 .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?) (\\d+.\\d+.\\d{4}+) (?<date>\\d+.\\d+.\\d{4}+)(.*)") .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } t.setDate(asDate(v.get("date"))); }) .section("amount", "currency") .match("Steuerpflichtiger Betrag (.*) (?<currency>\\w{3}+) (?<amount>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)") .assign((t, v) -> { t.setAmount(asAmount(v.get("amount"))); t.setCurrencyCode(asCurrencyCode(v.get("currency"))); }).wrap(t -> new TransactionItem(t)); addTaxesSectionsAccount(pdfTransaction); } private void addTransferInTransaction() { DocumentType type = new DocumentType("Wir erhielten zu Gunsten Ihres Depots"); this.addDocumentTyp(type); Block block = new Block("Wir erhielten zu Gunsten Ihres Depots(.*)"); type.addBlock(block); Transaction<BuySellEntry> pdfTransaction = new Transaction<BuySellEntry>(); pdfTransaction.subject(() -> { BuySellEntry entry = new BuySellEntry(); entry.setType(PortfolioTransaction.Type.TRANSFER_IN); return entry; }); block.set(pdfTransaction); pdfTransaction.section("name", "isin") // .find("Gattungsbezeichnung ISIN") // .match("(?<name>.*) (?<isin>[^ ]\\S*)$") // .assign((t, v) -> { t.setSecurity(getOrCreateSecurity(v)); }) .section("notation", "shares", "date") // .find("Nominal Schlusstag Wert") // STK 28,000 02.12.2011 02.12.2011 .match("(?<notation>^\\w{3}+) (?<shares>\\d{1,3}(\\.\\d{3})*(,\\d{3})?) (\\d+.\\d+.\\d{4}+) (?<date>\\d+.\\d+.\\d{4}+)(.*)") .assign((t, v) -> { String notation = v.get("notation"); if (notation != null && !notation.equalsIgnoreCase("STK")) { // Prozent-Notierung, Workaround.. t.setShares((asShares(v.get("shares")) / 100)); } else { t.setShares(asShares(v.get("shares"))); } t.setDate(asDate(v.get("date"))); t.setCurrencyCode(asCurrencyCode( t.getPortfolioTransaction().getSecurity().getCurrencyCode())); }) .wrap(t -> new BuySellEntryItem(t)); addFeesSections(pdfTransaction); } private void addTaxesSectionsAccount(Transaction<AccountTransaction> pdfTransaction) { pdfTransaction.section("tax").optional() .match("^Kapitalertragsteuer (?<currency>\\w{3}+) (?<tax>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> { t.addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax"))))); }).section("soli").optional() .match("^Solidaritätszuschlag (?<currency>\\w{3}+) (?<soli>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> { t.addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("soli"))))); }).section("kirchenst").optional() .match("^Kirchensteuer (?<currency>\\w{3}+) (?<kirchenst>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> { t.addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("kirchenst"))))); }); } private void addTaxesSectionsBuySell(Transaction<BuySellEntry> pdfTransaction) { pdfTransaction.section("tax").optional() // Kapitalertragsteuer EUR 4,22- .match("^Kapitalertragsteuer (?<currency>\\w{3}+) (?<tax>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> { t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax"))))); }).section("soli").optional() .match("^Solidaritätszuschlag (?<currency>\\w{3}+) (?<soli>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> { t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("soli"))))); }).section("kirchenst").optional() .match("^Kirchensteuer (?<currency>\\w{3}+) (?<kirchenst>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> { t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("kirchenst"))))); }); } private void addFeesSections(Transaction<BuySellEntry> pdfTransaction) { pdfTransaction.section("brokerage").optional() .match("(^.*)(Orderprovision) (\\w{3}+) (?<brokerage>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> t.getPortfolioTransaction() .addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("brokerage")))))) .section("stockfees").optional() .match("(^.*) (B\\Drsengeb\\Dhr) (\\w{3}+) (?<stockfees>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> t.getPortfolioTransaction() .addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("stockfees")))))) .section("agent").optional() .match("(^.*)(Maklercourtage)(\\s+)(\\w{3}+) (?<agent>\\d{1,3}(\\.\\d{3})*(,\\d{2})?)(-)") .assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("agent")))))); } @Override public String getLabel() { return "Onvista"; //$NON-NLS-1$ } }
simpsus/portfolio
name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/OnvistaPDFExtractor.java
Java
epl-1.0
25,346
/* * ICommandHistory.java * * Copyright 2005-2006 Stefan Reichert. * All Rights Reserved. * * This software is the proprietary information of Stefan Reichert. * Use is subject to license terms. * */ package net.sf.wickedshell.facade.history; import java.util.ArrayList; import java.util.List; import net.sf.wickedshell.domain.DomainPlugin; import net.sf.wickedshell.domain.command.ICommandDescriptor; import net.sf.wickedshell.util.ShellLogger; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; /** * Represents the history of the commands executed * * @author Stefan Reichert * @since 17.10.2006 */ public interface ICommandHistory { /** * Adds a command to the history. * * @param command * The command which was executed * @param shellId * The id of the shell which executed the command */ void addCommand(String command, String shellId); /** * Clears the history. * * @param shellId * The id of the shell which history should be cleared */ void clear(String shellId); /** * Gets the command at the given index executed in the given shell. * * @param index * The index of the executed command * @param shellId * The id of the shell which executed the command * @return the command at the given index executed in the given shell */ String getCommand(int index, String shellId); /** * Returns the size of the history for the given shell, that means the count * of entries. * * @param shellId * The id of the shell of which the size is requested * @return the size of the history as <code>int</code> */ int getSize(String shellId); /** * Internal implementation of the <code>IShellFacade</code>. * * @author Stefan Reichert * @since 18.10.2006 */ class Factory { /** * Gets the <code>ICommandHistory</code> */ public static ICommandHistory createInstance() { return new CommandHistory(); } } /** * Internal implementation for <code>ICommandHistory</code>. * * @author Stefan Reichert * @since 17.10.2006 */ class CommandHistory implements ICommandHistory { /** The <code>Reader</code> of the shell. */ private final ShellLogger shellLogger = new ShellLogger(CommandHistory.class); /** * Constructor for ShellFacade. */ private CommandHistory() { super(); // private constructor to avoid instantiation } /** * @see net.sf.wickedshell.facade.history.ICommandHistory#addCommand(java.lang.String, * java.lang.String) */ @SuppressWarnings("unchecked") public void addCommand(String command, String shellId) { try { List commandHistory = DomainPlugin.getDefault().getCommandHistory(); ICommandDescriptor newCommandDescriptor = ICommandDescriptor.Factory.newInstance(command, shellId); if(commandHistory.isEmpty() || !newCommandDescriptor.equals(commandHistory.get(0))) { // Only add the command if it does not equal the last one to // avoid repeatings commandHistory.add(0, newCommandDescriptor); } } catch (Exception exception) { shellLogger.error(exception.getMessage(), exception); } } /** * @see net.sf.wickedshell.facade.history.ICommandHistory#clear() */ public void clear(final String shellId) { try { List<ICommandDescriptor> commandHistory = DomainPlugin.getDefault().getCommandHistory(); CollectionUtils.filter(commandHistory, new Predicate() { /** * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object) */ public boolean evaluate(Object object) { ICommandDescriptor commandDescriptor = (ICommandDescriptor) object; return !commandDescriptor.getShellDescriptorId().equals(shellId); } }); } catch (Exception exception) { shellLogger.error(exception.getMessage(), exception); } } /** * @see net.sf.wickedshell.facade.history.ICommandHistory#getCommand(int, * java.lang.String) */ public String getCommand(int index, final String shellId) { List<ICommandDescriptor> commandHistory = new ArrayList<ICommandDescriptor>(); try { CollectionUtils.select(DomainPlugin.getDefault().getCommandHistory(), new Predicate() { /** * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object) */ public boolean evaluate(Object object) { ICommandDescriptor commandDescriptor = (ICommandDescriptor) object; return commandDescriptor.getShellDescriptorId().equals(shellId); } }, commandHistory); } catch (Exception exception) { shellLogger.error(exception.getMessage(), exception); } ICommandDescriptor commandDescriptor = commandHistory.get(index); return commandDescriptor.getCommand(); } /** * @see net.sf.wickedshell.facade.history.ICommandHistory#getSize(java.lang.String) */ public int getSize(final String shellId) { List<ICommandDescriptor> commandHistory = new ArrayList<ICommandDescriptor>(); try { CollectionUtils.select(DomainPlugin.getDefault().getCommandHistory(), new Predicate() { /** * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object) */ public boolean evaluate(Object object) { ICommandDescriptor commandDescriptor = (ICommandDescriptor) object; return commandDescriptor.getShellDescriptorId().equals(shellId); } }, commandHistory); } catch (Exception exception) { shellLogger.error(exception.getMessage(), exception); } return commandHistory.size(); } } }
stefanreichert/wickedshell
net.sf.wickedshell/src/net/sf/wickedshell/facade/history/ICommandHistory.java
Java
epl-1.0
5,623
/* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.netconf.confignetconfconnector.osgi; import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.management.MBeanServer; import java.lang.management.ManagementFactory; public class NetconfOperationServiceFactoryImpl implements NetconfOperationServiceFactory { public static final int ATTEMPT_TIMEOUT_MS = 1000; private static final int SILENT_ATTEMPTS = 30; private final YangStoreService yangStoreService; private final ConfigRegistryJMXClient jmxClient; private static final Logger logger = LoggerFactory.getLogger(NetconfOperationServiceFactoryImpl.class); public NetconfOperationServiceFactoryImpl(YangStoreService yangStoreService) { this(yangStoreService, ManagementFactory.getPlatformMBeanServer()); } public NetconfOperationServiceFactoryImpl(YangStoreService yangStoreService, MBeanServer mBeanServer) { this.yangStoreService = yangStoreService; ConfigRegistryJMXClient configRegistryJMXClient; int i = 0; // Config registry might not be present yet, but will be eventually while(true) { try { configRegistryJMXClient = new ConfigRegistryJMXClient(mBeanServer); break; } catch (IllegalStateException e) { ++i; if (i > SILENT_ATTEMPTS) { logger.info("JMX client not created after {} attempts, still trying", i, e); } else { logger.debug("JMX client could not be created, reattempting, try {}", i, e); } try { Thread.sleep(ATTEMPT_TIMEOUT_MS); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); throw new RuntimeException("Interrupted while reattempting connection", e1); } } } jmxClient = configRegistryJMXClient; if (i > SILENT_ATTEMPTS) { logger.info("Created JMX client after {} attempts", i); } else { logger.debug("Created JMX client after {} attempts", i); } } @Override public NetconfOperationServiceImpl createService(long netconfSessionId, String netconfSessionIdForReporting) { try { return new NetconfOperationServiceImpl(yangStoreService, jmxClient, netconfSessionIdForReporting); } catch (YangStoreException e) { throw new IllegalStateException(e); } } }
yuyf10/opendaylight-controller
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceFactoryImpl.java
Java
epl-1.0
3,011
/** * Copyright (c) 2015 Bosch Software Innovations GmbH and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.eclipse.hawkbit.ui.common.filterlayout; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import com.vaadin.ui.Alignment; import com.vaadin.ui.VerticalLayout; /** * Parent class for filter button layout. */ public abstract class AbstractFilterLayout extends VerticalLayout { private static final long serialVersionUID = 9190616426688385851L; private final AbstractFilterHeader filterHeader; private final AbstractFilterButtons filterButtons; protected AbstractFilterLayout(final AbstractFilterHeader filterHeader, final AbstractFilterButtons filterButtons) { this.filterHeader = filterHeader; this.filterButtons = filterButtons; buildLayout(); } private void buildLayout() { setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS); setStyleName("filter-btns-main-layout"); setHeight(100.0F, Unit.PERCENTAGE); setSpacing(false); setMargin(false); addComponents(filterHeader, filterButtons); setComponentAlignment(filterHeader, Alignment.TOP_CENTER); setComponentAlignment(filterButtons, Alignment.TOP_CENTER); setExpandRatio(filterButtons, 1.0F); } protected void restoreState() { if (onLoadIsTypeFilterIsClosed()) { setVisible(false); } } protected AbstractFilterButtons getFilterButtons() { return filterButtons; } protected AbstractFilterHeader getFilterHeader() { return filterHeader; } /** * On load, software module type filter is cloaed. * * @return true if filter is cleaned before. */ public abstract Boolean onLoadIsTypeFilterIsClosed(); }
stormc/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java
Java
epl-1.0
2,029
package edu.ncsu.csc.itrust.action; import java.util.Calendar; import java.util.List; import edu.ncsu.csc.itrust.beans.PersonnelBean; import edu.ncsu.csc.itrust.beans.ReportRequestBean; import edu.ncsu.csc.itrust.dao.DAOFactory; import edu.ncsu.csc.itrust.dao.mysql.PersonnelDAO; import edu.ncsu.csc.itrust.dao.mysql.ReportRequestDAO; import edu.ncsu.csc.itrust.dao.mysql.TransactionDAO; import edu.ncsu.csc.itrust.enums.TransactionType; import edu.ncsu.csc.itrust.exception.iTrustException; /** * Action class for ViewMyReports.jsp. Allows the user to see all their reports */ public class ViewMyReportRequestsAction { private long loggedInMID; private ReportRequestDAO reportRequestDAO; private PersonnelDAO personnelDAO; private TransactionDAO transDAO; //private DAOFactory factory; /** * Set up * * @param factory The DAOFactory used to create the DAOs used in this action. * @param loggedInMID The MID of the person viewing their report requests. */ public ViewMyReportRequestsAction(DAOFactory factory, long loggedInMID) { this.loggedInMID = loggedInMID; this.reportRequestDAO = factory.getReportRequestDAO(); this.personnelDAO = factory.getPersonnelDAO(); this.transDAO = factory.getTransactionDAO(); //this.factory = factory; } /** * Returns all the reports for the currently logged in HCP * * @return list of all reports for the logged in HCP * @throws iTrustException */ public List<ReportRequestBean> getAllReportRequestsForRequester() throws iTrustException { return reportRequestDAO.getAllReportRequestsForRequester(loggedInMID); } // /** // * Returns a list of *all* reports // * // * @return list of all reports // * @throws iTrustException // */ // public List<ReportRequestBean> getAllReportRequests() throws iTrustException { // return reportRequestDAO.getAllReportRequests(); // } /** * Adds a report request to the list * * @param patientMID ID of the patient that the report request is for * @return * @throws iTrustException */ public long addReportRequest(long patientMID) throws iTrustException { long id = reportRequestDAO .addReportRequest(loggedInMID, patientMID, Calendar.getInstance().getTime()); transDAO.logTransaction(TransactionType.COMPREHENSIVE_REPORT_REQUEST, loggedInMID, patientMID, "Added comprehensive report request"); return id; } // /** // * Approves a report request from the list. E-mail is sent when the request is approved. // * // * @param ID id of the request // * @throws iTrustException // */ // public void approveReportRequest(long ID) throws iTrustException { // ReportRequestBean rr = reportRequestDAO.getReportRequest(ID); // reportRequestDAO.approveReportRequest(ID, loggedInMID, Calendar.getInstance().getTime()); // transDAO.logTransaction(TransactionType.COMPREHENSIVE_REPORT_REQUEST, loggedInMID, // rr.getPatientMID(), "Approved comprehensive report request"); // new EmailUtil(factory).sendEmail(makeEmailApp(loggedInMID, rr.getRequesterMID(), rr.getPatientMID())); // // } // /** // * // * Sends e-mail regarding the approved request. // * // * @param adminID admin who approved the request // * @param hcpID HCP the request is for // * @param pid ID of the patient the report is about // * @return the sent e-mail // * @throws DBException // */ // private Email makeEmailApp(long adminID, long hcpID, long pid) throws DBException { // // PatientBean p = new PatientDAO(factory).getPatient(pid); // // Email email = new Email(); // email.setFrom("no-reply@itrust.com"); // email.setToList(Arrays.asList(p.getEmail())); // email.setSubject("A Report has been generated in iTrust"); // email // .setBody(String // .format( // "Dear %s, \n The iTrust Health Care Provider (%s) submitted a request to view your full medical records. The iTrust administrator (%s) approved a one-time viewing of this report. You will be notified when the HCP chooses to view it.", // p.getFullName(), hcpID, adminID)); // return email; // } // /** // * Rejects a request from the list. // * // * @param ID id of the rejected request // * @param comment why the request was rejected // * @throws iTrustException // */ // public void rejectReportRequest(long ID, String comment) throws iTrustException { // reportRequestDAO.rejectReportRequest(ID, loggedInMID, Calendar.getInstance().getTime(), comment); // transDAO.logTransaction(TransactionType.COMPREHENSIVE_REPORT_REQUEST, loggedInMID, 0L, // "Rejected comprehensive report request"); // } /** * Returns the requested report * * @param ID id of the requested report * @return the requested report * @throws iTrustException */ public ReportRequestBean getReportRequest(int ID) throws iTrustException { return reportRequestDAO.getReportRequest(ID); } /** * Sets the viewed status of the report. If the report is "viewed" the HCP must request a new one to see it again. * * @param ID id of the report * @throws iTrustException */ public void setViewed(int ID) throws iTrustException { // ReportRequestBean rr = reportRequestDAO.getReportRequest(ID); reportRequestDAO.setViewed(ID, Calendar.getInstance().getTime()); transDAO.logTransaction(TransactionType.COMPREHENSIVE_REPORT_REQUEST, loggedInMID, 0L, "Viewed comprehensive report"); //new EmailUtil(factory).sendEmail(makeEmailView(rr.getApproverMID(), rr.getRequesterMID(), rr // .getPatientMID())); } // /** // * // * Sends e-mail regarding the request to the patient. // * // * @param adminID admin who approved the request // * @param hcpID HCP the request is for // * @param pid ID of the patient the report is about // * @return the sent e-mail // * @throws DBException // */ // private Email makeEmailView(long adminID, long hcpID, long pid) throws DBException { // // PatientBean p = new PatientDAO(factory).getPatient(pid); // // Email email = new Email(); // email.setFrom("no-reply@itrust.com"); // email.setToList(Arrays.asList(p.getEmail())); // email.setSubject("A Report has been generated in iTrust"); // email // .setBody(String // .format( // "Dear %s, \n The iTrust Health Care Provider (%s) has chosen to view your full medical report, which was approved by an iTrust administrator (%s). This report was only viewable one time and is no longer available.", // p.getFullName(), hcpID, adminID)); // return email; // } /** * Gets the status of the request * * @param id id of the request * @return the request's status * @throws iTrustException */ public String getLongStatus(long id) throws iTrustException { StringBuilder s = new StringBuilder(); ReportRequestBean r = reportRequestDAO.getReportRequest(id); if (r.getStatus().equals(ReportRequestBean.Requested)) { PersonnelBean p = personnelDAO.getPersonnel(r.getRequesterMID()); s.append(String.format("Request was requested on %s by %s", r.getRequestedDateString(), p .getFullName())); } // if (r.getStatus().equals(ReportRequestBean.Approved)) { // PersonnelBean p = personnelDAO.getPersonnel(r.getRequesterMID()); // PersonnelBean p2 = personnelDAO.getPersonnel(r.getApproverMID()); // s.append(String.format("Request was requested on %s by %s ", r.getRequestedDateString(), p // .getFullName())); // s.append(String.format("and approved on %s by %s", r.getApprovedDateString(), p2.getFullName())); // } // if (r.getStatus().equals(ReportRequestBean.Rejected)) { // PersonnelBean p = personnelDAO.getPersonnel(r.getRequesterMID()); // PersonnelBean p2 = personnelDAO.getPersonnel(r.getApproverMID()); // s.append(String.format("Request was requested on %s by %s ", r.getRequestedDateString(), p // .getFullName())); // s.append(String.format("and rejected on %s by %s", r.getApprovedDateString(), p2.getFullName())); // } if (r.getStatus().equals(ReportRequestBean.Viewed)) { PersonnelBean p = personnelDAO.getPersonnel(r.getRequesterMID()); // PersonnelBean p2 = personnelDAO.getPersonnel(r.getApproverMID()); String fullName = "Unknown"; if(p != null){ fullName = p.getFullName(); s.append(String.format("Request was requested on %s by %s, ", r.getRequestedDateString(), p .getFullName())); } // s.append(String.format("approved on %s by %s, ", r.getApprovedDateString(), fullName)); s.append("");// removed "<br />" because it caused unit test to fail and seems to have no // purpose s.append(String.format("and viewed on %s by %s", r.getViewedDateString(), fullName)); } return s.toString(); } }
ModelWriter/Demonstrations
eu.modelwriter.datasets.traceability/CoEST Datasets/iTrust-NASA (!)/itrust_v10_code/iTrust/src/edu/ncsu/csc/itrust/action/ViewMyReportRequestsAction.java
Java
epl-1.0
8,580
# Introduction to website This is a simple website made in Clojure on immutant, see Readme for more info on how to setup the project
ProBeeEU/probee-website
doc/intro.md
Markdown
epl-1.0
134
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>Uses of Class org.apache.poi.xwpf.usermodel.XWPFSDTContentCell (POI API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.xwpf.usermodel.XWPFSDTContentCell (POI API Documentation)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/poi/xwpf/usermodel/XWPFSDTContentCell.html" title="class in org.apache.poi.xwpf.usermodel">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/poi/xwpf/usermodel/class-use/XWPFSDTContentCell.html" target="_top">Frames</a></li> <li><a href="XWPFSDTContentCell.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.poi.xwpf.usermodel.XWPFSDTContentCell" class="title">Uses of Class<br>org.apache.poi.xwpf.usermodel.XWPFSDTContentCell</h2> </div> <div class="classUseContainer">No usage of org.apache.poi.xwpf.usermodel.XWPFSDTContentCell</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/poi/xwpf/usermodel/XWPFSDTContentCell.html" title="class in org.apache.poi.xwpf.usermodel">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/poi/xwpf/usermodel/class-use/XWPFSDTContentCell.html" target="_top">Frames</a></li> <li><a href="XWPFSDTContentCell.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright 2016 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
tommylsh/test20170719
Desktop/tool/poi-bin-3.15-20160924/poi-3.15/docs/apidocs/org/apache/poi/xwpf/usermodel/class-use/XWPFSDTContentCell.html
HTML
epl-1.0
4,389
/** * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Eclipse Public License (EPL). * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ package org.python.pydev.editor.codecompletion; import java.io.IOException; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.python.pydev.core.IGrammarVersionProvider; import org.python.pydev.core.IIndentPrefs; import org.python.pydev.core.MisconfigurationException; import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.core.log.Log; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.autoedit.DefaultIndentPrefs; import org.python.pydev.editor.codefolding.PySourceViewer; import org.python.pydev.parser.jython.SimpleNode; import org.python.pydev.parser.jython.ast.FunctionDef; import org.python.pydev.parser.jython.ast.NameTok; import org.python.pydev.parser.jython.ast.Pass; import org.python.pydev.parser.jython.ast.stmtType; import org.python.pydev.parser.jython.ast.factory.AdapterPrefs; import org.python.pydev.parser.jython.ast.factory.PyAstFactory; import org.python.pydev.parser.prettyprinterv2.MakeAstValidForPrettyPrintingVisitor; import org.python.pydev.parser.prettyprinterv2.PrettyPrinterPrefsV2; import org.python.pydev.parser.prettyprinterv2.PrettyPrinterV2; /** * @author fabioz * */ public class OverrideMethodCompletionProposal extends AbstractPyCompletionProposalExtension2 { private final FunctionDef functionDef; private final String parentClassName; private String currentClassName; public OverrideMethodCompletionProposal(int replacementOffset, int replacementLength, int cursorPosition, Image image, FunctionDef functionDef, String parentClassName, String currentClassName) { super("", replacementOffset, replacementLength, cursorPosition, IPyCompletionProposal.PRIORITY_CREATE); this.fImage = image; this.functionDef = functionDef; this.fDisplayString = ((NameTok) functionDef.name).id + " (Override method in " + parentClassName + ")"; this.parentClassName = parentClassName; this.currentClassName = currentClassName; } /* (non-Javadoc) * @see org.python.pydev.editor.codecompletion.PyCompletionProposal#apply(org.eclipse.jface.text.IDocument) */ @Override public void apply(IDocument document) { } /* (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer, char, int, int) */ public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) { IDocument document = viewer.getDocument(); int finalOffset = applyOnDocument(viewer, document, trigger, stateMask, offset); if (finalOffset >= 0) { try { PySelection ps = new PySelection(document, finalOffset); int firstCharPosition = PySelection.getFirstCharPosition(ps.getLine()); int lineOffset = ps.getLineOffset(); int location = lineOffset + firstCharPosition; int len = finalOffset - location; fCursorPosition = location; fReplacementLength = len; } catch (Exception e) { Log.log(e); } } } public int applyOnDocument(ITextViewer viewer, IDocument document, char trigger, int stateMask, int offset) { IGrammarVersionProvider versionProvider = null; PyEdit edit = null; if (viewer instanceof PySourceViewer) { PySourceViewer pySourceViewer = (PySourceViewer) viewer; versionProvider = edit = pySourceViewer.getEdit(); } else { versionProvider = new IGrammarVersionProvider() { public int getGrammarVersion() throws MisconfigurationException { return IGrammarVersionProvider.LATEST_GRAMMAR_VERSION; } }; } String delimiter = PySelection.getDelimiter(document); PyAstFactory factory = new PyAstFactory(new AdapterPrefs(delimiter, versionProvider)); stmtType overrideBody = factory.createOverrideBody(this.functionDef, parentClassName, currentClassName); //Note that the copy won't have a parent. FunctionDef functionDef = this.functionDef.createCopy(false); functionDef.body = new stmtType[] { overrideBody != null ? overrideBody : new Pass() }; try { MakeAstValidForPrettyPrintingVisitor.makeValid(functionDef); } catch (Exception e) { Log.log(e); } String printed = printAst(edit, functionDef, delimiter); PySelection ps = new PySelection(document, offset); try { String lineContentsToCursor = ps.getLineContentsToCursor(); int defIndex = lineContentsToCursor.indexOf("def"); int defOffset = ps.getLineOffset() + defIndex; printed = StringUtils.indentTo(printed, lineContentsToCursor.substring(0, defIndex), false); printed = StringUtils.rightTrim(printed); this.fLen += offset - defOffset; document.replace(defOffset, this.fLen, printed); return defOffset + printed.length(); } catch (BadLocationException x) { // ignore } return -1; } public static String printAst(PyEdit edit, SimpleNode astToPrint, String lineDelimiter) { String str = null; if (astToPrint != null) { IIndentPrefs indentPrefs; if (edit != null) { indentPrefs = edit.getIndentPrefs(); } else { indentPrefs = DefaultIndentPrefs.get(); } PrettyPrinterPrefsV2 prefsV2 = PrettyPrinterV2.createDefaultPrefs(edit, indentPrefs, lineDelimiter); PrettyPrinterV2 prettyPrinterV2 = new PrettyPrinterV2(prefsV2); try { str = prettyPrinterV2.print(astToPrint); } catch (IOException e) { Log.log(e); } } return str; } /* (non-Javadoc) * @see org.python.pydev.editor.codecompletion.AbstractPyCompletionProposalExtension2#getTriggerCharacters() */ @Override public char[] getTriggerCharacters() { return null; } @Override public Point getSelection(IDocument document) { return new Point(fCursorPosition, fReplacementLength); } }
smkr/pyclipse
plugins/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/OverrideMethodCompletionProposal.java
Java
epl-1.0
6,813
/*===========================================================================*/ /* This file is part of a Mixed Integer Bilevel Solver */ /* developed using the BiCePS Linear Integer Solver (BLIS). */ /* */ /* Authors: Scott DeNegre, Lehigh University */ /* Ted Ralphs, Lehigh University */ /* */ /* Copyright (C) 2007-2015 Lehigh University, Scott DeNegre, and Ted Ralphs. */ /* All Rights Reserved. */ /* */ /* This software is licensed under the Eclipse Public License. Please see */ /* accompanying file for terms. */ /*===========================================================================*/ #include <iostream> #include "CoinError.hpp" #include "OsiSolverInterface.hpp" #include "OsiClpSolverInterface.hpp" #include "MibSModel.h" #if COIN_HAS_MPI #include "AlpsKnowledgeBrokerMPI.h" #else #include "AlpsKnowledgeBrokerSerial.h" #endif //############################################################################# //############################################################################# int main(int argc, char* argv[]) { try{ /** Set up lp solver **/ OsiClpSolverInterface lpSolver; lpSolver.getModelPtr()->setDualBound(1.0e10); lpSolver.messageHandler()->setLogLevel(0); /** Create MibS model **/ MibSModel model; model.setSolver(&lpSolver); #ifdef COIN_HAS_MPI AlpsKnowledgeBrokerMPI broker(argc, argv, model); #else AlpsKnowledgeBrokerSerial broker(argc, argv, model); #endif broker.search(&model); broker.printBestSolution(); } catch(CoinError& er) { std::cerr << "ERROR:" << er.message() << std::endl << " from function " << er.methodName() << std::endl << " from class " << er.className() << std::endl; } catch(...) { std::cerr << "Something went wrong!" << std::endl; } return 0; }
elspeth0/MibS
src/MibSMain.cpp
C++
epl-1.0
2,275
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Middleware LLC. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA * */ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import junit.framework.Test; import org.hibernate.junit.functional.FunctionalTestClassTestSuite; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest; /** * @author Gail Badner */ public class EntityWithNonInverseManyToManyTest extends AbstractEntityWithManyToManyTest { public EntityWithNonInverseManyToManyTest(String str) { super(str); } public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariation.hbm.xml" }; } public static Test suite() { return new FunctionalTestClassTestSuite( EntityWithNonInverseManyToManyTest.class ); } }
ControlSystemStudio/cs-studio
thirdparty/plugins/org.csstudio.platform.libs.hibernate/project/testsuite/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyTest.java
Java
epl-1.0
1,803
/* * Copyright 2012 PRODYNA AG * * Licensed under the Eclipse Public License (EPL), Version 1.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.opensource.org/licenses/eclipse-1.0.php or * http://www.nabucco.org/License.html * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package org.nabucco.business.organization.facade.message.search; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.nabucco.framework.base.facade.datatype.property.NabuccoProperty; import org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyContainer; import org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyDescriptor; import org.nabucco.framework.base.facade.datatype.property.PropertyCache; import org.nabucco.framework.base.facade.message.ServiceMessage; import org.nabucco.framework.base.facade.message.ServiceMessageSupport; /** * OrganizationMasterSearchRq<p/>Search message for OrganizationMaster<p/> * * @version 1.0 * @author Dominic Trumpfheller, PRODYNA AG, 2010-11-30 */ public class OrganizationMasterSearchRq extends ServiceMessageSupport implements ServiceMessage { private static final long serialVersionUID = 1L; /** Constructs a new OrganizationMasterSearchRq instance. */ public OrganizationMasterSearchRq() { super(); this.initDefaults(); } /** InitDefaults. */ private void initDefaults() { } /** * CreatePropertyContainer. * * @return the NabuccoPropertyContainer. */ protected static NabuccoPropertyContainer createPropertyContainer() { Map<String, NabuccoPropertyDescriptor> propertyMap = new HashMap<String, NabuccoPropertyDescriptor>(); return new NabuccoPropertyContainer(propertyMap); } /** Init. */ public void init() { this.initDefaults(); } @Override public Set<NabuccoProperty> getProperties() { Set<NabuccoProperty> properties = super.getProperties(); return properties; } @Override public ServiceMessage cloneObject() { return this; } /** * Getter for the PropertyDescriptor. * * @param propertyName the String. * @return the NabuccoPropertyDescriptor. */ public static NabuccoPropertyDescriptor getPropertyDescriptor(String propertyName) { return PropertyCache.getInstance().retrieve(OrganizationMasterSearchRq.class).getProperty(propertyName); } /** * Getter for the PropertyDescriptorList. * * @return the List<NabuccoPropertyDescriptor>. */ public static List<NabuccoPropertyDescriptor> getPropertyDescriptorList() { return PropertyCache.getInstance().retrieve(OrganizationMasterSearchRq.class).getAllProperties(); } }
NABUCCO/org.nabucco.business.organization
org.nabucco.business.organization.facade.message/src/main/gen/org/nabucco/business/organization/facade/message/search/OrganizationMasterSearchRq.java
Java
epl-1.0
3,247
/******************************************************************************* * Copyright (c) 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package io.openliberty.checkpoint.internal.criu; import io.openliberty.checkpoint.internal.CheckpointImpl; public class DeployCheckpoint { public static void checkpoint() { CheckpointImpl.deployCheckpoint(); } }
OpenLiberty/open-liberty
dev/io.openliberty.checkpoint/src/io/openliberty/checkpoint/internal/criu/DeployCheckpoint.java
Java
epl-1.0
765
// Copyright (c) 1996-01 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. // File: FigEdgeNote.java // Classes: FigEdgeNote // Original Author: Andreas Rueckert <a_rueckert@gmx.net> // $Id: FigEdgeNote.java,v 1.2 2002/09/22 10:28:20 kataka Exp $ package org.argouml.uml.diagram.static_structure.ui; import java.awt.*; import java.awt.event.*; import java.util.*; import java.beans.*; import javax.swing.*; import org.tigris.gef.base.*; import org.tigris.gef.graph.GraphModel; import org.tigris.gef.presentation.*; import org.argouml.kernel.*; import org.argouml.ui.*; import org.argouml.cognitive.*; import org.argouml.uml.*; import org.argouml.uml.generator.*; import org.argouml.uml.diagram.ui.*; /** * Class to display a UML note connection to a * annotated model element. */ public class FigEdgeNote extends FigEdgeModelElement implements VetoableChangeListener, DelayedVChangeListener, MouseListener, KeyListener, PropertyChangeListener { //////////////////////////////////////////////////////////////// // constants //////////////////////////////////////////////////////////////// // constructors /** * Construct a new note connection. Use the same layout as for * other edges. */ public FigEdgeNote() { setBetweenNearestPoints(true); ((FigPoly)_fig).setRectilinear(false); setDashed(true); } /** * Constructs a new figedgenote from some object to another object. The * objects must have a representation on the given layer. * @param lay * @param fromNode * @param toNode */ public FigEdgeNote(Object fromNode, Object toNode) { this(); Layer lay = ProjectBrowser.TheInstance.getActiveDiagram().getLayer(); setLayer(lay); Fig destFig = lay.presentationFor(toNode); Fig sourceFig = lay.presentationFor(fromNode); if (destFig == null || sourceFig == null) throw new IllegalStateException("No destfig or sourcefig while creating FigEdgeNode"); setDestFigNode((FigNode)destFig); setDestPortFig(destFig); setSourceFigNode((FigNode)sourceFig); setSourcePortFig(sourceFig); computeRoute(); } //////////////////////////////////////////////////////////////// // accessors public void setFig(Fig f) { super.setFig(f); _fig.setDashed(true); } protected boolean canEdit(Fig f) { return false; } } /* end class FigEdgeNote */
argocasegeo/argocasegeo
src/org/argouml/uml/diagram/static_structure/ui/FigEdgeNote.java
Java
epl-1.0
4,013
<!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"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>TB9.2 Example Applications: Class List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> <link type="text/css" rel="stylesheet" href="../css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="../css/sdl.css" media="screen"/> <!--[if IE]> <link href="../css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> </head> <body class="kernelguide"> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Product Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <!-- Generated by Doxygen 1.6.2 --> <div class="contents"> <h1>Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table> <tr><td class="indexkey"><a class="el" href="class_c_active_bubble_sorter.html">CActiveBubbleSorter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_active_timer.html">CActiveTimer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_adder.html">CAdder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_animation_application.html">CAnimationApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_animation_app_ui.html">CAnimationAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_animation_app_view.html">CAnimationAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_animation_document.html">CAnimationDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_answer_incoming_call.html">CAnswerIncomingCall</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_bubble_sort_application.html">CAOLabBubbleSortApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_bubble_sort_app_ui.html">CAOLabBubbleSortAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_bubble_sort_container.html">CAOLabBubbleSortContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_bubble_sort_document.html">CAOLabBubbleSortDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_text_flash_application.html">CAOLabTextFlashApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_text_flash_app_ui.html">CAOLabTextFlashAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_text_flash_container.html">CAOLabTextFlashContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_a_o_lab_text_flash_document.html">CAOLabTextFlashDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_apa_recognizer_ex.html">CApaRecognizerEx</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_appholder_application.html">CAppholderApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_appholder_app_ui.html">CAppholderAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_appholder_document.html">CAppholderDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_array_property_watch.html">CArrayPropertyWatch</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_async_waiter.html">CAsyncWaiter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_audio_stream_app.html">CAudioStreamApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_audio_stream_app_ui.html">CAudioStreamAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_audio_stream_document.html">CAudioStreamDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_audio_stream_engine.html">CAudioStreamEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_audio_stream_view.html">CAudioStreamView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_base_menu_async.html">CBaseMenuAsync</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_base_menu_sync.html">CBaseMenuSync</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_basic_anim_mover.html">CBasicAnimMover</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_battery_info.html">CBatteryInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_b_i_o_example_parser.html">CBIOExampleParser</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bio_message.html">CBioMessage</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bio_parser.html">CBioParser</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bit_depth1_encoder.html">CBitDepth1Encoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bit_depth2_encoder.html">CBitDepth2Encoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bit_depth4_encoder.html">CBitDepth4Encoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bit_depth8_color_type2_encoder.html">CBitDepth8ColorType2Encoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bit_depth8_encoder.html">CBitDepth8Encoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bitmap_control.html">CBitmapControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bluetooth_p_m_p_example_app.html">CBluetoothPMPExampleApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bluetooth_p_m_p_example_app_ui.html">CBluetoothPMPExampleAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bluetooth_p_m_p_example_document.html">CBluetoothPMPExampleDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bluetooth_p_m_p_example_engine.html">CBluetoothPMPExampleEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bluetooth_p_m_p_example_r_t_e_container.html">CBluetoothPMPExampleRTEContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_bluetooth_refresh_timer.html">CBluetoothRefreshTimer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_book_db.html">CBookDb</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_b_t_discoverer.html">CBTDiscoverer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calculation_interface_definition.html">CCalculationInterfaceDefinition</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_app.html">CCalendarAPIexampleApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_app_ui.html">CCalendarAPIexampleAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_document.html">CCalendarAPIexampleDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_engine.html">CCalendarAPIexampleEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_entries_container.html">CCalendarAPIexampleEntriesContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_entries_view.html">CCalendarAPIexampleEntriesView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_entry_container.html">CCalendarAPIexampleEntryContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_entry_item_list.html">CCalendarAPIexampleEntryItemList</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_entry_view.html">CCalendarAPIexampleEntryView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_search_container.html">CCalendarAPIexampleSearchContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_calendar_a_p_iexample_search_view.html">CCalendarAPIexampleSearchView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_cal_helper_entry.html">CCalHelperEntry</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_call_barring_status.html">CCallBarringStatus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_call_forwarding_status.html">CCallForwardingStatus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_call_info.html">CCallInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_call_status.html">CCallStatus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_call_waiting_status.html">CCallWaitingStatus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_camera_wrapper_example_application.html">CCameraWrapperExampleApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_camera_wrapper_example_app_ui.html">CCameraWrapperExampleAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_camera_wrapper_example_app_view.html">CCameraWrapperExampleAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_camera_wrapper_example_document.html">CCameraWrapperExampleDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_cent_rep_example.html">CCentRepExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_change_notifier.html">CChangeNotifier</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_circular_buffer_example.html">CCircularBufferExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_class_a.html">CClassA</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_class_a_b_c.html">CClassABC</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_class_p.html">CClassP</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_class_r.html">CClassR</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_client.html">CClient</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_client_application.html">CClientApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_client_app_ui.html">CClientAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_client_app_view.html">CClientAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_client_document.html">CClientDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_client_engine.html">CClientEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_collector.html">CCollector</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_connector.html">CConnector</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_console_control.html">CConsoleControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_consumer.html">CConsumer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_contacts_model_app.html">CContactsModelApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_contacts_model_app_ui.html">CContactsModelAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_contacts_model_container.html">CContactsModelContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_contacts_model_document.html">CContactsModelDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_control_framework_application.html">CControlFrameworkApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_control_framework_app_ui.html">CControlFrameworkAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_control_framework_document.html">CControlFrameworkDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_control_framework_view.html">CControlFrameworkView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_count_serv_server.html">CCountServServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_count_serv_session.html">CCountServSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_async_application.html">CCSAsyncApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_async_app_ui.html">CCSAsyncAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_async_app_view.html">CCSAsyncAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_async_document.html">CCSAsyncDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_async_request_handler.html">CCSAsyncRequestHandler</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_sync_application.html">CCSSyncApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_sync_app_ui.html">CCSSyncAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_sync_app_view.html">CCSSyncAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_c_s_sync_document.html">CCSSyncDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_current_network_info.html">CCurrentNetworkInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_current_network_name.html">CCurrentNetworkName</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_database.html">CDatabase</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_d_b_m_s_application.html">CDBMSApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_d_b_m_s_app_ui.html">CDBMSAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_d_b_m_s_app_view.html">CDBMSAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_d_b_m_s_document.html">CDBMSDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_d_b_m_s_editor_view.html">CDBMSEditorView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_d_b_m_s_listbox_view.html">CDBMSListboxView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_delay_server_shut_down.html">CDelayServerShutDown</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_descriptor_examples.html">CDescriptorExamples</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_descriptor_ex_app.html">CDescriptorExApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_descriptor_ex_app_ui.html">CDescriptorExAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_descriptor_ex_container.html">CDescriptorExContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_descriptor_ex_document.html">CDescriptorExDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_descriptor_lab.html">CDescriptorLab</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_destructable_font.html">CDestructableFont</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_device_discoverer.html">CDeviceDiscoverer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_device_list_container.html">CDeviceListContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_dial_call.html">CDialCall</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_draw_control.html">CDrawControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_dummy_answer.html">CDummyAnswer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_dummy_observer.html">CDummyObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_dynamic_caps.html">CDynamicCaps</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_echo_application.html">CEchoApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_echo_app_ui.html">CEchoAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_echo_document.html">CEchoDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_echo_engine.html">CEchoEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_echo_read.html">CEchoRead</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_echo_write.html">CEchoWrite</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_e_com_calculator_application.html">CEComCalculatorApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_e_com_calculator_app_ui.html">CEComCalculatorAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_e_com_calculator_app_view.html">CEComCalculatorAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_e_com_calculator_document.html">CEComCalculatorDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_edit_remote_operation.html">CEditRemoteOperation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_encoder_selection_dialog.html">CEncoderSelectionDialog</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_event_handler.html">CEventHandler</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_alarm_server.html">CExampleAlarmServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_app.html">CExampleApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_application.html">CExampleApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_app_ui.html">CExampleAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_app_view.html">CExampleAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_delimiter_modifier.html">CExampleDelimiterModifier</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_document.html">CExampleDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_inet_prot_util.html">CExampleInetProtUtil</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_interface.html">CExampleInterface</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_resolver.html">CExampleResolver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_shell_application.html">CExampleShellApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_shell_app_ui.html">CExampleShellAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_shell_container.html">CExampleShellContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_shell_document.html">CExampleShellDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_example_versit.html">CExampleVersit</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_ezlib_example.html">CEzlibExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_fbs_control.html">CFbsControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_feat_mngr_example.html">CFeatMngrExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_feature_checker.html">CFeatureChecker</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_file_forwarder.html">CFileForwarder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_flight_mode_info.html">CFlightModeInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_font_control.html">CFontControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_french_messenger.html">CFrenchMessenger</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_general.html">CGeneral</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_german_messenger.html">CGermanMessenger</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_get_indicator.html">CGetIndicator</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_get_lock_info.html">CGetLockInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_global_control.html">CGlobalControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_graphic_example_control.html">CGraphicExampleControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_handler_application.html">CHandlerApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_handler_app_ui.html">CHandlerAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_handler_app_view.html">CHandlerAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_handler_document.html">CHandlerDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hangup.html">CHangup</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hash_table_example.html">CHashTableExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hello_control.html">CHelloControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hello_world_basic_application.html">CHelloWorldBasicApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hello_world_basic_app_ui.html">CHelloWorldBasicAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hello_world_basic_app_view.html">CHelloWorldBasicAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hello_world_basic_document.html">CHelloWorldBasicDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hello_world_query_dialog.html">CHelloWorldQueryDialog</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_hold.html">CHold</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_identity_service_status.html">CIdentityServiceStatus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_image_converter_app.html">CImageConverterApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_image_converter_app_ui.html">CImageConverterAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_image_converter_container.html">CImageConverterContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_image_converter_document.html">CImageConverterDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_image_converter_engine.html">CImageConverterEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_implementation_class_multiply.html">CImplementationClassMultiply</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_implementation_class_one.html">CImplementationClassOne</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_implementation_class_plus.html">CImplementationClassPlus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_implementation_class_two.html">CImplementationClassTwo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_internet_email_app.html">CInternetEmailApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_internet_email_app_ui.html">CInternetEmailAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_internet_email_container.html">CInternetEmailContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_internet_email_document.html">CInternetEmailDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_internet_email_engine.html">CInternetEmailEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_int_property_watch.html">CIntPropertyWatch</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_inverter.html">CInverter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_i_s_v_a_p_i_async.html">CISVAPIAsync</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_i_s_v_a_p_i_base.html">CISVAPIBase</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_i_s_v_a_p_i_sync.html">CISVAPISync</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_key_reader.html">CKeyReader</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_line_status.html">CLineStatus</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_listbox_refresh_timer.html">CListboxRefreshTimer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_listbox_view.html">CListboxView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_listener.html">CListener</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_locale_settings.html">CLocaleSettings</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_localization_application.html">CLocalizationApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_localization_app_ui.html">CLocalizationAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_localization_app_view.html">CLocalizationAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_localization_document.html">CLocalizationDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_log_view.html">CLogView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_long_number.html">CLongNumber</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_main_class.html">CMainClass</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_main_menu.html">CMainMenu</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_main_test_step.html">CMainTestStep</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_markable_list_container.html">CMarkableListContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_mess_async_waiter.html">CMessAsyncWaiter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_messenger.html">CMessenger</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_minimal_session.html">CMinimalSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_m_f_ex_descriptor.html">CMMFExDescriptor</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_m_f_ex_pcm8_pcm16_codec.html">CMMFExPcm8Pcm16Codec</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_m_f_raw_format_read.html">CMMFRawFormatRead</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_m_f_raw_format_write.html">CMMFRawFormatWrite</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_m_f_record_test.html">CMMFRecordTest</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_msg_q_active.html">CMsgQActive</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_msv_comp_operation.html">CMsvCompOperation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_msv_op_wait.html">CMsvOpWait</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_t_m_txt_settings.html">CMTMTxtSettings</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_t_p_example_data_provider.html">CMTPExampleDataProvider</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_t_p_example_dp_request_processor.html">CMTPExampleDpRequestProcessor</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_t_p_example_dp_vendor_defined_op1.html">CMTPExampleDpVendorDefinedOp1</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_t_p_example_dp_vendor_defined_op2.html">CMTPExampleDpVendorDefinedOp2</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_m_t_p_request_unknown.html">CMTPRequestUnknown</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_multiple_resource_file_reader.html">CMultipleResourceFileReader</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_my_server.html">CMyServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_my_session.html">CMySession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_my_string_reverse.html">CMyStringReverse</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_network_reg_info.html">CNetworkRegInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_number_store.html">CNumberStore</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_operator_name.html">COperatorName</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_pdr_example.html">CPdrExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_pdr_print.html">CPdrPrint</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_phone_id.html">CPhoneId</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_picture_control.html">CPictureControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_plug_in.html">CPlugIn&lt; T &gt;</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_png_decoder.html">CPngDecoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_png_encoder.html">CPngEncoder</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_png_read_codec.html">CPngReadCodec</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_png_read_sub_codec.html">CPngReadSubCodec</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_png_write_codec.html">CPngWriteCodec</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_png_write_sub_codec.html">CPngWriteSubCodec</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_process_server.html">CProcessServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_process_server_session.html">CProcessServerSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_producer.html">CProducer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_queue.html">CQueue</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_r_buf_example.html">CRBufExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_r_connection.html">CRConnection</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_res_data.html">CResData</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_res_data_array.html">CResDataArray</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_response.html">CResponse</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_resume.html">CResume</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_rich_control.html">CRichControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_rich_text_editor_r_t_e.html">CRichTextEditorRTE</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_rtp_file_sender.html">CRtpFileSender</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_rtp_file_streamer.html">CRtpFileStreamer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_client_server_lab_app.html">CS60ClientServerLabApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_client_serv_lab_app_ui.html">CS60ClientServLabAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_client_serv_lab_container.html">CS60ClientServLabContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_client_serv_lab_document.html">CS60ClientServLabDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_memory_lab_application.html">CS60MemoryLabApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_memory_lab_app_ui.html">CS60MemoryLabAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_memory_lab_container.html">CS60MemoryLabContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_memory_lab_document.html">CS60MemoryLabDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_resource_lab_app.html">CS60ResourceLabApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_resource_lab_app_ui.html">CS60ResourceLabAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_resource_lab_container.html">CS60ResourceLabContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s60_resource_lab_document.html">CS60ResourceLabDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_searchsort_example.html">CSearchsortExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_secure_server.html">CSecureServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_secure_server_session.html">CSecureServerSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_secure_server_sub_session.html">CSecureServerSubSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_semaphore_example.html">CSemaphoreExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_send_as2_example.html">CSendAs2Example</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_send_d_t_m_f.html">CSendDTMF</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_serv_app_server.html">CServAppServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_serv_app_session.html">CServAppSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_service_advertiser.html">CServiceAdvertiser</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_service_discoverer.html">CServiceDiscoverer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_setter.html">CSetter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_shared_intermediator.html">CSharedIntermediator</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_show_info_dialog.html">CShowInfoDialog</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_shutdown.html">CShutdown</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_signal_info.html">CSignalInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_smiley_picture.html">CSmileyPicture</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_smp_example.html">CSmpExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_sms_engine.html">CSmsEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s_m_s_example_app.html">CSMSExampleApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s_m_s_example_app_ui.html">CSMSExampleAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s_m_s_example_document.html">CSMSExampleDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s_m_s_example_mtms_engine.html">CSMSExampleMtmsEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s_m_s_example_parser.html">CSMSExampleParser</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_s_m_s_example_r_t_e_container.html">CSMSExampleRTEContainer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_sprite_anim_mover.html">CSpriteAnimMover</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_sql_example.html">CSqlExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_style_control.html">CStyleControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_subscriber_id.html">CSubscriberId</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_subtractor.html">CSubtractor</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_swap.html">CSwap</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_sys_state_manager_example.html">CSysStateManagerExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_app.html">CTaskManagerApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_app_ui.html">CTaskManagerAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_app_view.html">CTaskManagerAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_conn_form.html">CTaskManagerConnForm</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_document.html">CTaskManagerDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_engine.html">CTaskManagerEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_engine_reader.html">CTaskManagerEngineReader</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_manager_engine_writer.html">CTaskManagerEngineWriter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_task_schedule.html">CTaskSchedule</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_t_char_example.html">CTCharExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_te___process_client_server_test_suite.html">CTe_ProcessClientServerTestSuite</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_te___process_client_server_test_suite_step_base.html">CTe_ProcessClientServerTestSuiteStepBase</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_te___thread_client_server_test_suite.html">CTe_ThreadClientServerTestSuite</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_te___thread_client_server_test_suite_step_base.html">CTe_ThreadClientServerTestSuiteStepBase</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_test_app_application.html">CTestAppApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_test_app_app_ui.html">CTestAppAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_test_app_app_view.html">CTestAppAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_test_app_document.html">CTestAppDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_text_mtm_client.html">CTextMtmClient</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_text_mtm_ui.html">CTextMtmUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_text_server_mtm.html">CTextServerMtm</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_animation.html">CThreadAnimation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_a_o_application.html">CThreadAOApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_a_o_app_ui.html">CThreadAOAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_a_o_document.html">CThreadAODocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_a_o_engine.html">CThreadAOEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_application.html">CThreadApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_app_ui.html">CThreadAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_app_view.html">CThreadAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_document.html">CThreadDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_engine.html">CThreadEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_listener.html">CThreadListener</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_server.html">CThreadServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_thread_server_session.html">CThreadServerSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_time_out_timer.html">CTimeOutTimer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_timer_entry.html">CTimerEntry</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_time_server.html">CTimeServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_time_server_session.html">CTimeServerSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_transparent_application.html">CTransparentApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_transparent_app_ui.html">CTransparentAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_transparent_document.html">CTransparentDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_transparent_util.html">CTransparentUtil</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_active_oper.html">CTxtActiveOper</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_copy_from_local_op.html">CTxtCopyFromLocalOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_copy_move_base.html">CTxtCopyMoveBase</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_copy_to_local_op.html">CTxtCopyToLocalOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_copy_within_service_op.html">CTxtCopyWithinServiceOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_delete_op.html">CTxtDeleteOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_move_from_local_op.html">CTxtMoveFromLocalOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_move_to_local_op.html">CTxtMoveToLocalOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_move_within_service_op.html">CTxtMoveWithinServiceOp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_mtm_create_operation.html">CTxtMtmCreateOperation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_mtm_editor_operation.html">CTxtMtmEditorOperation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_mtm_edit_remote_operation.html">CTxtMtmEditRemoteOperation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_mtm_forward_operation.html">CTxtMtmForwardOperation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_refresh_m_box.html">CTxtRefreshMBox</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_viewer_application.html">CTxtViewerApplication</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_viewer_app_server.html">CTxtViewerAppServer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_viewer_app_ui.html">CTxtViewerAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_viewer_app_view.html">CTxtViewerAppView</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_viewer_document.html">CTxtViewerDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_txt_viewer_service_session.html">CTxtViewerServiceSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_t_z_localizer_app.html">CTZLocalizerApp</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_t_z_localizer_app_ui.html">CTZLocalizerAppUi</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_t_z_localizer_dialog.html">CTZLocalizerDialog</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_t_z_localizer_document.html">CTZLocalizerDocument</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_t_z_localizer_engine.html">CTZLocalizerEngine</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_user_interface.html">CUserInterface</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_view_control.html">CViewControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_waiter.html">CWaiter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_xml_example.html">CXmlExample</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_c_zoom_control.html">CZoomControl</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_d_driver1.html">DDriver1</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_d_driver1_channel.html">DDriver1Channel</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_d_driver1_factory.html">DDriver1Factory</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdraw__dash__pattern.html">draw_dash_pattern</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="uniondraw__image_type__tag.html">draw_imageType_tag</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdraw__jpegstr__tag.html">draw_jpegstr_tag</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdraw__jpegstrhdr__tag.html">draw_jpegstrhdr_tag</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__area__text.html">drawfile_area_text</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__declare__fonts__state.html">drawfile_declare_fonts_state</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__diagram.html">drawfile_diagram</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__font__def.html">drawfile_font_def</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__font__table.html">drawfile_font_table</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__group.html">drawfile_group</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__info.html">drawfile_info</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__jpeg.html">drawfile_jpeg</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__object.html">drawfile_object</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__options.html">drawfile_options</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__path.html">drawfile_path</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__path__style.html">drawfile_path_style</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__path__with__pattern.html">drawfile_path_with_pattern</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__sprite.html">drawfile_sprite</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__tagged.html">drawfile_tagged</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__text.html">drawfile_text</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__text__area.html">drawfile_text_area</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__text__column.html">drawfile_text_column</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__text__column__list.html">drawfile_text_column_list</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__text__style.html">drawfile_text_style</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__trfm__sprite.html">drawfile_trfm_sprite</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structdrawfile__trfm__text.html">drawfile_trfm_text</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="interfacefor.html">for</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="interfacefor.html">for</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_active_console_notify.html">MActiveConsoleNotify</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_active_timer_notify.html">MActiveTimerNotify</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_async_time_observer.html">MAsyncTimeObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_bubble_sort_notify.html">MBubbleSortNotify</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_calendar_engine_commands_interface.html">MCalendarEngineCommandsInterface</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_calender_engine_observer_u_i.html">MCalenderEngineObserverUI</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_camera_engine_observer.html">MCameraEngineObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_client_observer.html">MClientObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_connector_observer.html">MConnectorObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_converter_controller.html">MConverterController</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_device_disco_observer.html">MDeviceDiscoObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_engine_notifier.html">MEngineNotifier</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_exec_async.html">MExecAsync</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_exec_controller.html">MExecController</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_exec_sync.html">MExecSync</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_file_streamer_observer.html">MFileStreamerObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_graphics_example_observer.html">MGraphicsExampleObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_internet_email_engine_observer.html">MInternetEmailEngineObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_listener_observer.html">MListenerObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_m_t_p_example_dp_request_processor.html">MMTPExampleDpRequestProcessor</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_result_viewer.html">MResultViewer</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_service_disco_observer.html">MServiceDiscoObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_msg_editor_service_resolver.html">MsgEditorServiceResolver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_msg_q_info.html">MsgQInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_msg_q_info_list.html">MsgQInfoList</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_sms_engine_observer.html">MSmsEngineObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_s_m_s_example_mtms_engine_observer.html">MSMSExampleMtmsEngineObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_msv_ui_editor_utilities.html">MsvUiEditorUtilities</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_timeout_notifier.html">MTimeoutNotifier</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_time_out_notify.html">MTimeOutNotify</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_t_p_example_dp_processor.html">MTPExampleDpProcessor</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_transaction_observer.html">MTransactionObserver</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_m_u_i_notify.html">MUINotify</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="structos__trfm.html">os_trfm</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_produced_item.html">ProducedItem</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_ptr_read_util.html">PtrReadUtil</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_ptr_write_util.html">PtrWriteUtil</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_driver1.html">RDriver1</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_my_session.html">RMySession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_process_client.html">RProcessClient</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_secure_session.html">RSecureSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_secure_sub_session.html">RSecureSubSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_serv_app_service.html">RServAppService</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_thread_client.html">RThreadClient</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_time_server_session.html">RTimeServerSession</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_txt_viewer_service.html">RTxtViewerService</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_stack.html">Stack</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_bluetooth_info.html">TBluetoothInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_d_driver1_1_1_t_caps.html">DDriver1::TCaps</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_driver1_1_1_t_caps.html">RDriver1::TCaps</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_r_driver1_1_1_t_config.html">RDriver1::TConfig</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_t_device_data.html">TDeviceData</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_digit.html">TDigit</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_editor_parameters.html">TEditorParameters</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_example_index.html">TExampleIndex</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_c_example_interface_1_1_t_example_interface_init_params.html">CExampleInterface::TExampleInterfaceInitParams</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_example_shell_model.html">TExampleShellModel</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_file_copy_progress_monitor.html">TFileCopyProgressMonitor</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_thread_param.html">ThreadParam</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_iap.html">TIap</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_interface_client.html">TInterfaceClient</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_letter.html">TLetter</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_m_m_f_ex_descriptor_params.html">TMMFExDescriptorParams</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_m_t_m_txt_settings.html">TMTMTxtSettings</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_t_m_t_p_request_processor_entry.html">TMTPRequestProcessorEntry</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_my_class.html">TMyClass</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_png_image_information.html">TPngImageInformation</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_t_query_table.html">TQueryTable</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_request.html">TRequest</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="struct_t_result_summary.html">TResultSummary</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_task_manager_conn_info.html">TTaskManagerConnInfo</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_text_mtm_editor_params.html">TTextMtmEditorParams</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_timer_entry.html">TTimerEntry</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_truncate_overflow.html">TTruncateOverflow</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_txt_mtm_create_op_progress.html">TTxtMtmCreateOpProgress</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_txt_mtm_editor_op_progress.html">TTxtMtmEditorOpProgress</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_txt_mtm_forward_op_progress.html">TTxtMtmForwardOpProgress</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_t_txt_progress.html">TTxtProgress</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_txt_utils.html">TxtUtils</a></td><td class="indexvalue"></td></tr> <tr><td class="indexkey"><a class="el" href="class_viewer_starter.html">ViewerStarter</a></td><td class="indexvalue"></td></tr> </table> </div> <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp; <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/guid-6013a680-57f9-415b-8851-c4fa63356636/annotated.html
HTML
epl-1.0
71,846
<!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"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>TB9.2 Example Applications: examples/ForumNokia/ImageConverter/src/ImageConverterApp.cpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> <link type="text/css" rel="stylesheet" href="../css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="../css/sdl.css" media="screen"/> <!--[if IE]> <link href="../css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> </head> <body class="kernelguide"> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Product Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <!-- Generated by Doxygen 1.6.2 --> <h1>examples/ForumNokia/ImageConverter/src/ImageConverterApp.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright © 2008 Nokia Corporation.</span> <a name="l00003"></a>00003 <span class="comment"> */</span> <a name="l00004"></a>00004 <a name="l00005"></a>00005 <a name="l00006"></a>00006 <span class="comment">// INCLUDE FILES</span> <a name="l00007"></a>00007 <span class="preprocessor">#include &lt;eikstart.h&gt;</span> <a name="l00008"></a>00008 <span class="preprocessor">#include &quot;ImageConverterApp.h&quot;</span> <a name="l00009"></a>00009 <span class="preprocessor">#include &quot;ImageConverterDocument.h&quot;</span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="comment">// ================= MEMBER FUNCTIONS =======================</span> <a name="l00012"></a>00012 <a name="l00013"></a>00013 <span class="comment">// ---------------------------------------------------------</span> <a name="l00014"></a>00014 <span class="comment">// CImageConverterApp::AppDllUid()</span> <a name="l00015"></a>00015 <span class="comment">// Returns application UID</span> <a name="l00016"></a>00016 <span class="comment">// ---------------------------------------------------------</span> <a name="l00017"></a>00017 <span class="comment">//</span> <a name="l00018"></a>00018 TUid CImageConverterApp::AppDllUid()<span class="keyword"> const</span> <a name="l00019"></a>00019 <span class="keyword"> </span>{ <a name="l00020"></a>00020 <span class="keywordflow">return</span> KUidImageConverter; <a name="l00021"></a>00021 } <a name="l00022"></a>00022 <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="comment">// ---------------------------------------------------------</span> <a name="l00025"></a>00025 <span class="comment">// CImageConverterApp::CreateDocumentL()</span> <a name="l00026"></a>00026 <span class="comment">// Creates CImageConverterDocument object</span> <a name="l00027"></a>00027 <span class="comment">// ---------------------------------------------------------</span> <a name="l00028"></a>00028 <span class="comment">//</span> <a name="l00029"></a>00029 CApaDocument* CImageConverterApp::CreateDocumentL() <a name="l00030"></a>00030 { <a name="l00031"></a>00031 <span class="keywordflow">return</span> <a class="code" href="class_c_image_converter_document.html#af1c3a344e6bf8ff65d829275e2a5cad6">CImageConverterDocument::NewL</a>( *<span class="keyword">this</span> ); <a name="l00032"></a>00032 } <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="comment">// ================= OTHER EXPORTED FUNCTIONS ==============</span> <a name="l00035"></a>00035 <span class="comment">//</span> <a name="l00036"></a>00036 <span class="comment">// ---------------------------------------------------------</span> <a name="l00037"></a>00037 <span class="comment">// NewApplication() </span> <a name="l00038"></a>00038 <span class="comment">// Constructs CImageConverterApp</span> <a name="l00039"></a>00039 <span class="comment">// Returns: created application object</span> <a name="l00040"></a>00040 <span class="comment">// ---------------------------------------------------------</span> <a name="l00041"></a>00041 <span class="comment">//</span> <a name="l00042"></a>00042 EXPORT_C CApaApplication* NewApplication() <a name="l00043"></a>00043 { <a name="l00044"></a>00044 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="class_c_image_converter_app.html">CImageConverterApp</a>; <a name="l00045"></a>00045 } <a name="l00046"></a>00046 <a name="l00047"></a>00047 <a name="l00048"></a>00048 <span class="comment">// -----------------------------------------------------------------------------</span> <a name="l00049"></a>00049 <span class="comment">// Entry point function for Symbian Apps, separate function for</span> <a name="l00050"></a>00050 <span class="comment">// S60 3rd Ed and 1st/2nd Ed</span> <a name="l00051"></a>00051 <span class="comment">// -----------------------------------------------------------------------------</span> <a name="l00052"></a>00052 GLDEF_C TInt E32Main() <a name="l00053"></a>00053 { <a name="l00054"></a>00054 <span class="keywordflow">return</span> EikStart::RunApplication( NewApplication ); <a name="l00055"></a>00055 } <a name="l00056"></a>00056 <span class="comment">// End of File </span> <a name="l00057"></a>00057 </pre></div> <hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp; <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
sdk/guid-6013a680-57f9-415b-8851-c4fa63356636/_image_converter_app_8cpp_source.html
HTML
epl-1.0
6,626
/** * Copyright (c) 2014 Laboratoire de Genie Informatique et Ingenierie de Production - Ecole des Mines d'Ales * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Francois Pfister (ISOE-LGI2P) - initial API and implementation */ package org.isoe.diagraph.workbench.api; /** * * @author pfister * */ public interface Refreshable { void refreshTree(); }
francoispfister/diagraph
org.isoe.diagraph.workbench.api/src/org/isoe/diagraph/workbench/api/Refreshable.java
Java
epl-1.0
588
package com.study.doubanbook_for_android.activity; import java.util.ArrayList; import java.util.List; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.PopupWindow; import android.widget.RatingBar; import android.widget.TextView; import com.study.doubanbook_for_android.R; import com.study.doubanbook_for_android.api.NetUtils; import com.study.doubanbook_for_android.model.BookItem; public class BookDetailActivity extends BaseActivity { ImageView bookImg; TextView authorSumary_tv; TextView bookSumary; BookItem bookItem = null; TextView title; TextView author; TextView price; TextView publisher; TextView grade; Button comment; private String bookid; private Button collect_btn; private Button wish; private Button reading; private Button done; private PopupWindow popwindow; private LinearLayout bookDetail; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a_book_detail); findViews(); initDatas(); initWidgets(); initListners(); initPopWindow(); } @SuppressWarnings("deprecation") private void initPopWindow() { LayoutInflater factory = LayoutInflater.from(this); View view = factory.inflate(R.layout.a_collect_detail, null); popwindow = new PopupWindow(view, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT); final EditText tag_et = (EditText) view.findViewById(R.id.tag_et); final RatingBar ratingBar_rb = (RatingBar) view .findViewById(R.id.ratingBar_rb); final EditText comment_et = (EditText) view .findViewById(R.id.comment_et); Button cancle_btn = (Button) view.findViewById(R.id.cancle_btn); Button ok_btn = (Button) view.findViewById(R.id.ok_btn); ok_btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { int k = ratingBar_rb.getRight(); String s = getText(tag_et); String ss = getText(comment_et); System.out.println(k + " ," + s + " ," + ss); // dissmissPop(); // collectBook(k, s, ss); } }); cancle_btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dissmissPop(); } }); /* 点其他地方可消失 */ popwindow.setFocusable(true); popwindow.setBackgroundDrawable(new BitmapDrawable()); } protected void collectBook(int k, String s, String ss) { // TODO Auto-generated method stub } private void dissmissPop() { if (popwindow.isShowing()) popwindow.dismiss(); } private void showPop() { if (popwindow != null) { popwindow.showAtLocation(bookDetail, Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0); } } @Override void findViews() { super.findViews(); bookDetail = (LinearLayout) findViewById(R.id.bookDetail_lyt); bookImg = (ImageView) findViewById(R.id.bookImg_iv); authorSumary_tv = (TextView) findViewById(R.id.authorSumary_tv); bookSumary = (TextView) findViewById(R.id.bookSumary_tv); title = (TextView) findViewById(R.id.bookName_tv); author = (TextView) findViewById(R.id.bookAuthor_tv); price = (TextView) findViewById(R.id.bookPrice_tv); publisher = (TextView) findViewById(R.id.bookPublisher_tv); grade = (TextView) findViewById(R.id.bookGrade_tv); comment = (Button) findViewById(R.id.comment_btn); collect_btn = (Button) findViewById(R.id.collect_btn); wish = (Button) findViewById(R.id.wish_btn); reading = (Button) findViewById(R.id.reading_btn); done = (Button) findViewById(R.id.done_btn); } @Override void initDatas() { super.initDatas(); bookItem = (BookItem) getIntent().getSerializableExtra("bookItem"); if (bookItem == null) { logD("TTT", "BOOKITEM IS NULL"); } bookid = String.valueOf(bookItem.getId()); } @Override void initWidgets() { super.initWidgets(); imageDownloader.download(bookItem.getImages().getMedium(), bookImg, null); authorSumary_tv.setText("作者简介:" + bookItem.getAuthor_intro()); bookSumary.setText("图书简介:" + bookItem.getSummary()); title.setText(bookItem.getTitle()); price.setText(bookItem.getPrice()); publisher .setText(bookItem.getPublisher() + " " + bookItem.getPubdate()); if (bookItem.getRating() != null) grade.setText(bookItem.getRating().getAverage() + "分 " + bookItem.getRating().getNumRaters() + "人已评论"); StringBuffer stringBuffer = new StringBuffer(); for (String s : bookItem.getAuthor()) { stringBuffer.append(s); stringBuffer.append(" "); } author.setText(stringBuffer.toString()); if (bookItem.getCurrent_user_collection() == null) { resetTextColor(wish, reading, done); wish.setTextColor(Color.GRAY); } else { String status = bookItem.getCurrent_user_collection().getStatus(); // 想读:wish 在读:reading 或 doing 读过:read 或 done) if (status.equals("wish")) { resetTextColor(wish, reading, done); } else if (status.equals("reading") || status.equals("doing")) { resetTextColor(reading, wish, done); } else if (status.equals("done") || status.equals("read")) { resetTextColor(done, wish, reading); } } } // 将其他两个文字颜色为灰色 void resetTextColor(Button btn1, Button btn2, Button btn3) { btn1.setTextColor(Color.BLACK); btn2.setTextColor(Color.GRAY); btn3.setTextColor(Color.GRAY); } @Override void initListners() { super.initListners(); // 显示评论 comment.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(context, BookNoteListActivity.class); intent.putExtra("bookid", bookid); startActivity(intent); } }); wish.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // 想读:wish 在读:reading 或 doing 读过:read 或 done) resetTextColor(wish, reading, done); showPop(); } }); } }
wugian/doubanbooks
src/com/study/doubanbook_for_android/activity/BookDetailActivity.java
Java
epl-1.0
6,301
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="copyright" content="(C) Copyright 2010"/> <meta name="DC.rights.owner" content="(C) Copyright 2010"/> <meta name="DC.Type" content="cxxStruct"/> <meta name="DC.Title" content="TCollationMethod"/> <meta name="DC.Format" content="XHTML"/> <meta name="DC.Identifier" content="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC"/> <title>TCollationMethod</title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api"/><link rel="stylesheet" type="text/css" href="cxxref.css"/></head> <body class="cxxref" id="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC"><a name="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC"><!-- --></a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()">Collapse all</a> <a id="index" href="index.html">Symbian^3 Product Developer Library</a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1">&#160;</div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2437088 id2437096 id2578593 id2557087 id2441463 id2441468 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"><a href="index.html" title="Symbian^3 Product Developer Library">Symbian^3 Product Developer Library</a> &gt;</div> <h1 class="topictitle1">TCollationMethod Struct Reference</h1> <table class="signature"><tr><td>struct TCollationMethod</td></tr></table><div class="section"><div> <p>Defines a collation method.</p> <p>Collation means sorting pieces of text. It needs to take into account characters, accents and case; spaces and punctuation are usually ignored. It differs from ordinary methods of sorting in that it is locale-dependent - different languages use different ordering methods. Additionally, multiple collation methods may exist within the same locale.</p> <p>A collation method provides the collation keys and other data needed to customise collation; the <a href="GUID-677B3729-EDED-341B-BE83-59F4386CCCA4.html#GUID-677B3729-EDED-341B-BE83-59F4386CCCA4">Mem</a> and <a href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.html#GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23">TDesC16</a> collation functions (e.g. <a href="GUID-677B3729-EDED-341B-BE83-59F4386CCCA4.html#GUID-481D7C3D-2C23-3FA2-9D43-14563F332B14">Mem::CompareC()</a>) perform the collation. Note that these functions use the standard collation method for the current locale - you only need to specify an object of class <a href="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html#GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC">TCollationMethod</a> to customise this collation scheme. Collation methods can be retrieved using member functions of the <a href="GUID-677B3729-EDED-341B-BE83-59F4386CCCA4.html#GUID-677B3729-EDED-341B-BE83-59F4386CCCA4">Mem</a> class. Each one has a unique identifier.</p> <p>A collation method specifies a main table of collation keys, and optionally an overriding table that contains keys for which the values in the main table are overridden. A collation key table (<a href="GUID-1361E47E-57B3-3229-BD43-3E77DAE33093.html#GUID-1361E47E-57B3-3229-BD43-3E77DAE33093">TCollationKeyTable</a>) is the set of collation keys: primary (basic character identity), secondary (accents and diacritics) and tertiary (case). The quaternary key is the Unicode character values themselves.</p> <p>The simplest way to customise a collation method is to create a local copy of the standard collation method and change it. For example, you could use the standard method, but not ignore punctuation and spaces:</p> <div class="p"> <pre class="codeblock">TCollationMethod m = *Mem::CollationMethodByIndex(0); // get the standard method m.iFlags |= TCollationMethod::EIgnoreNone; // dont ignore punctuation and spaces</pre> </div> </div></div> <div class="section member-index"><table border="0" class="member-index"><thead><tr><th colspan="2">Public Member Enumerations</th></tr></thead><tbody><tr><td align="right" valign="top">enum</td><td><a href="#GUID-BFDEDF5B-D930-3669-BCBF-E01A7089CC89">anonymous</a> { <br/><a href="#GUID-986F15DE-AD67-311A-83B0-A147F4DFD28F">EIgnoreNone</a> = 1, <a href="#GUID-1C28B8A2-5B41-312D-BE29-07D0F427A79C">ESwapCase</a> = 2, <a href="#GUID-6FED17E0-16DB-3803-96F2-1988C4B819D7">EAccentsBackwards</a> = 4, <a href="#GUID-1661B4BB-2F26-36A5-BE92-9969A446C67B">ESwapKana</a> = 8, <a href="#GUID-FE26AE46-83A2-3BA8-9B30-78C81F1340FD">EFoldCase</a> = 16, <a href="#GUID-FF9FB4F2-2A18-3FE4-8472-D4DD4072C130">EMatchingTable</a> = 32, <a href="#GUID-1FA2E2B5-08F5-3606-8C64-2A2DB62D44B4">EIgnoreCombining</a> = 64<br/> }</td></tr></tbody></table><table border="0" class="member-index"><thead><tr><th colspan="2">Public Attributes</th></tr></thead><tbody><tr><td align="right" valign="top"> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a> </td><td><a href="#GUID-93D23E9C-1CED-3706-8AE4-45E26894BA82">iFlags</a></td></tr><tr class="bg"><td align="right" valign="top"> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a> </td><td><a href="#GUID-6A053CB7-1DAE-350E-A25F-B69BA1FE95E8">iId</a></td></tr><tr><td align="right" valign="top">const <a href="GUID-1361E47E-57B3-3229-BD43-3E77DAE33093.html">TCollationKeyTable</a> *</td><td><a href="#GUID-AFE4A43C-8C54-3E32-97EA-1FC68D2CCC65">iMainTable</a></td></tr><tr class="bg"><td align="right" valign="top">const <a href="GUID-1361E47E-57B3-3229-BD43-3E77DAE33093.html">TCollationKeyTable</a> *</td><td><a href="#GUID-474F8CFE-1CB9-3F53-8427-096244AF084C">iOverrideTable</a></td></tr></tbody></table></div><h1 class="pageHeading topictitle1">Member Enumerations Documentation</h1><div class="nested1" id="GUID-BFDEDF5B-D930-3669-BCBF-E01A7089CC89"><a name="GUID-BFDEDF5B-D930-3669-BCBF-E01A7089CC89"><!-- --></a> <h2 class="topictitle2">Enum anonymous</h2> <div class="section"></div> <div class="section enumerators"><h3 class="sectiontitle">Enumerators</h3><table border="0" class="enumerators"><tr><td valign="top">EIgnoreNone = 1</td><td> <p>Don't ignore any keys (punctuation, etc. is normally ignored). </p> </td></tr><tr class="bg"><td valign="top">ESwapCase = 2</td><td> <p>Reverse the normal order for characters differing only in case </p> </td></tr><tr><td valign="top">EAccentsBackwards = 4</td><td> <p>Compare secondary keys which represent accents in reverse order (from right to left); this is needed for French when comparing words that differ only in accents. </p> </td></tr><tr class="bg"><td valign="top">ESwapKana = 8</td><td> <p>Reverse the normal order for characters differing only in whether they are katakana or hiragana. </p> </td></tr><tr><td valign="top">EFoldCase = 16</td><td> <p>Fold all characters to lower case before extracting keys; needed for comparison of filenames, for which case is ignored but other tertiary (level-2) distinctions are not. </p> </td></tr><tr class="bg"><td valign="top">EMatchingTable = 32</td><td> <p>Flag to indicate a collation method for matching purpose This flag is only needed if we wish to specify a particular collation method to be used for matching purpose. </p> </td></tr><tr><td valign="top">EIgnoreCombining = 64</td><td> <p>Ignore the check for adjacent combining characters. A combining character effectively changes the character it combines with to something else and so a match doesn't occur. Setting this flag will allow character matching regardless of any combining characters. </p> </td></tr></table></div> </div> <h1 class="pageHeading topictitle1">Member Data Documentation</h1><div class="nested1" id="GUID-93D23E9C-1CED-3706-8AE4-45E26894BA82"><a name="GUID-93D23E9C-1CED-3706-8AE4-45E26894BA82"><!-- --></a> <h2 class="topictitle2"> TUint iFlags</h2> <table class="signature"><tr><td> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a> </td><td>iFlags</td></tr></table><div class="section"><div> <p>Flags.</p> <p> <a href="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html#GUID-986F15DE-AD67-311A-83B0-A147F4DFD28F">TCollationMethod::EIgnoreNone</a> <a href="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html#GUID-1C28B8A2-5B41-312D-BE29-07D0F427A79C">TCollationMethod::ESwapCase</a> <a href="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html#GUID-6FED17E0-16DB-3803-96F2-1988C4B819D7">TCollationMethod::EAccentsBackwards</a> <a href="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html#GUID-1661B4BB-2F26-36A5-BE92-9969A446C67B">TCollationMethod::ESwapKana</a> <a href="GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html#GUID-FE26AE46-83A2-3BA8-9B30-78C81F1340FD">TCollationMethod::EFoldCase</a> </p> </div></div> </div> <div class="nested1" id="GUID-6A053CB7-1DAE-350E-A25F-B69BA1FE95E8"><a name="GUID-6A053CB7-1DAE-350E-A25F-B69BA1FE95E8"><!-- --></a> <h2 class="topictitle2"> TUint iId</h2> <table class="signature"><tr><td> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a> </td><td>iId</td></tr></table><div class="section"><div> <p>The UID of this collation method. </p> </div></div> </div> <div class="nested1" id="GUID-AFE4A43C-8C54-3E32-97EA-1FC68D2CCC65"><a name="GUID-AFE4A43C-8C54-3E32-97EA-1FC68D2CCC65"><!-- --></a> <h2 class="topictitle2">const TCollationKeyTable * iMainTable</h2> <table class="signature"><tr><td>const <a href="GUID-1361E47E-57B3-3229-BD43-3E77DAE33093.html">TCollationKeyTable</a> *</td><td>iMainTable</td></tr></table><div class="section"><div> <p>The main collation key table; if NULL, use the standard table. </p> </div></div> </div> <div class="nested1" id="GUID-474F8CFE-1CB9-3F53-8427-096244AF084C"><a name="GUID-474F8CFE-1CB9-3F53-8427-096244AF084C"><!-- --></a> <h2 class="topictitle2">const TCollationKeyTable * iOverrideTable</h2> <table class="signature"><tr><td>const <a href="GUID-1361E47E-57B3-3229-BD43-3E77DAE33093.html">TCollationKeyTable</a> *</td><td>iOverrideTable</td></tr></table><div class="section"><div> <p>If non-NULL, tailoring for collation keys. </p> </div></div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/GUID-78C4965C-BFCD-3E7E-8F46-2EE3D1BAF6EC.html
HTML
epl-1.0
11,241
/******************************************************************************* * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation from Oracle TopLink ******************************************************************************/ package org.eclipse.persistence.testing.models.inheritance; import java.io.StringWriter; /** * <b>Purpose</b>: Larger scale projects within the Employee Demo * <p><b>Description</b>: LargeProject is a concrete subclass of Project. It is instantiated for Projects with type = 'L'. The additional * information (budget, & milestoneVersion) are mapped from the LPROJECT table. * @see Project */ /** * Subclass of base project designed to test cyclical relationships with inheritance. */ public class BudgettedProject extends BaseProject { private String title; private Integer budget; public Integer getBudget() { return budget; } public String getTitle() { return title; } public void setBudget(Integer budget) { this.budget = budget; } public void setTitle(String thing) { this.title = thing; } public String toString() { StringWriter writer = new StringWriter(); writer.write("Large Project: "); writer.write(getName()); writer.write(" "); writer.write(" " + getBudget()); writer.write(" "); return writer.toString(); } }
bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs
foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/models/inheritance/BudgettedProject.java
Java
epl-1.0
1,998
/* * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta; import com.google.common.annotations.Beta; import com.google.common.collect.ImmutableList; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.model.api.YangStmtMapping; import org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference; import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement; import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.EnumEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.EnumStatement; import org.opendaylight.yangtools.yang.model.ri.stmt.DeclaredStatementDecorators; import org.opendaylight.yangtools.yang.model.ri.stmt.DeclaredStatements; import org.opendaylight.yangtools.yang.model.ri.stmt.EffectiveStatements; import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration; import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport; import org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtx; import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current; import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext; import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator; @Beta public final class EnumStatementSupport extends AbstractStatementSupport<String, EnumStatement, EnumEffectiveStatement> { private static final SubstatementValidator RFC6020_VALIDATOR = SubstatementValidator.builder(YangStmtMapping.ENUM) .addOptional(YangStmtMapping.DESCRIPTION) .addOptional(YangStmtMapping.REFERENCE) .addOptional(YangStmtMapping.STATUS) .addOptional(YangStmtMapping.VALUE) .build(); private static final SubstatementValidator RFC7950_VALIDATOR = SubstatementValidator.builder(YangStmtMapping.ENUM) .addOptional(YangStmtMapping.DESCRIPTION) .addAny(YangStmtMapping.IF_FEATURE) .addOptional(YangStmtMapping.REFERENCE) .addOptional(YangStmtMapping.STATUS) .addOptional(YangStmtMapping.VALUE) .build(); private EnumStatementSupport(final YangParserConfiguration config, final SubstatementValidator validator) { super(YangStmtMapping.ENUM, StatementPolicy.contextIndependent(), config, validator); } public static @NonNull EnumStatementSupport rfc6020Instance(final YangParserConfiguration config) { return new EnumStatementSupport(config, RFC6020_VALIDATOR); } public static @NonNull EnumStatementSupport rfc7950Instance(final YangParserConfiguration config) { return new EnumStatementSupport(config, RFC7950_VALIDATOR); } @Override public String parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) { // FIXME: Checks for real value return value; } @Override protected EnumStatement createDeclared(final BoundStmtCtx<String> ctx, final ImmutableList<DeclaredStatement<?>> substatements) { return DeclaredStatements.createEnum(ctx.getRawArgument(), ctx.getArgument(), substatements); } @Override protected EnumStatement attachDeclarationReference(final EnumStatement stmt, final DeclarationReference reference) { return DeclaredStatementDecorators.decorateEnum(stmt, reference); } @Override protected EnumEffectiveStatement createEffective(final Current<String, EnumStatement> stmt, final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) { return EffectiveStatements.createEnum(stmt.declared(), substatements); } }
opendaylight/yangtools
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/meta/EnumStatementSupport.java
Java
epl-1.0
4,022
class Controller extends Phaser.Scene { constructor () { super(); } resize (width, height) { if (width === undefined) { width = this.game.config.width; } if (height === undefined) { height = this.game.config.height; } this.cameras.resize(width, height); } }
boniatillo-com/PhaserEditor
source/v2/phasereditor/phasereditor.resources.phaser.examples/phaser3-examples/public/src/paths/path editor/Controller.js
JavaScript
epl-1.0
318
package io.renren.modules.crawler.ydzx.common.entity; import java.util.List; public class NewsJson { /** * 返回状态: 正常:success */ public String status; /** * 返回状态: 正常:0 */ public int code; /*** * 文章列表 */ private List<Result> result; /** * 作者信息 */ private Channel_media channel_media; public int fresh_count; /** * 空值信息 */ public String reason; public int disable_op; /*** * 多少人订阅: 5388人订阅 */ public String bookcount; /*** * m391627 */ public String channel_id; /*** * m391627 */ public String fromId; /*** * 作者名称:杨澜 */ public String channel_name; /*** * 作者类型: media */ public String channel_type; /*** * 作者标题: 资深传媒人士,阳光媒体集团董事局主席 */ public String channel_summary; /*** * 作者头像:路径 */ public String channel_image; public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public List<Result> getResult() { return result; } public void setResult(List<Result> result) { this.result = result; } public Channel_media getChannel_media() { return channel_media; } public void setChannel_media(Channel_media channel_media) { this.channel_media = channel_media; } public int getFresh_count() { return fresh_count; } public void setFresh_count(int fresh_count) { this.fresh_count = fresh_count; } public int getDisable_op() { return disable_op; } public void setDisable_op(int disable_op) { this.disable_op = disable_op; } public String getBookcount() { return bookcount; } public void setBookcount(String bookcount) { this.bookcount = bookcount; } public String getChannel_id() { return channel_id; } public void setChannel_id(String channel_id) { this.channel_id = channel_id; } public String getFromId() { return fromId; } public void setFromId(String fromId) { this.fromId = fromId; } public String getChannel_name() { return channel_name; } public void setChannel_name(String channel_name) { this.channel_name = channel_name; } public String getChannel_type() { return channel_type; } public void setChannel_type(String channel_type) { this.channel_type = channel_type; } public String getChannel_summary() { return channel_summary; } public void setChannel_summary(String channel_summary) { this.channel_summary = channel_summary; } public String getChannel_image() { return channel_image; } public void setChannel_image(String channel_image) { this.channel_image = channel_image; } @Override public String toString() { return "Athor [status=" + status + ", code=" + code + ", result=" + result + ", channel_media=" + channel_media + ", fresh_count=" + fresh_count + ", disable_op=" + disable_op + ", bookcount=" + bookcount + ", channel_id=" + channel_id + ", fromId=" + fromId + ", channel_name=" + channel_name + ", channel_type=" + channel_type + ", channel_summary=" + channel_summary + ", channel_image=" + channel_image + "]"; } }
LittleNoobLol/renren-crawler
renren-crawler/src/main/java/io/renren/modules/crawler/ydzx/common/entity/NewsJson.java
Java
epl-1.0
3,553
% This file was created by matplotlib2tikz v0.5.4. \begin{tikzpicture} \definecolor{color1}{rgb}{0.105882352941176,0.619607843137255,0.466666666666667} \definecolor{color0}{rgb}{0.917647058823529,0.917647058823529,0.949019607843137} \definecolor{color3}{rgb}{0.589542483660131,0.416993464052288,0.470588235294118} \definecolor{color2}{rgb}{0.719492502883506,0.416147635524798,0.0888119953863898} \definecolor{color5}{rgb}{0.488581314878893,0.654440599769319,0.0982698961937716} \definecolor{color4}{rgb}{0.686735870818916,0.297270280661284,0.61999231064975} \begin{groupplot}[group style={group size=2 by 1}] \nextgroupplot[ xlabel={Simulated Time (mins)}, ylabel={Weighted Trust Value}, xmin=0, xmax=60, ymin=0, ymax=1, ytick={0,0.2,0.4,0.6,0.8,1}, yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$}, tick align=outside, xmajorgrids, x grid style={white!50.196078431372548!black}, ymajorgrids, y grid style={white!50.196078431372548!black}, axis line style={white!50.196078431372548!black}, axis background/.style={fill=color0}, legend style={draw=none, fill=color0}, legend cell align={left}, legend entries={{Alfa},{Bravo},{Charlie},{Delta},{Foxtrot}} ] \addplot [color1, opacity=1.0] table {% 0 0.000287380403550065 1 0.326387593731868 2 0.321425163631941 3 0.354314990971143 4 0.239848088396123 5 0.160855283156045 6 0.17422857194628 7 0.126424545172781 8 0.089145563576996 9 0.101107696030186 10 0.3406360247874 11 0.248389332691187 12 0.193772897306102 13 0.138254266847926 14 0.100262688266555 15 0.350119014060857 16 0.370942849293502 17 0.280634657339399 18 0.200420455571172 19 0.174429683714121 20 0.155540592928426 21 0.111942339405945 22 0.0826945960651967 23 0.0637083650938006 24 0.051978056217123 25 0.0406511890369834 26 0.0319635742052475 27 0.0249406926634782 28 0.0234616498300539 29 0.0476754148576678 30 0.0411235027511283 31 0.0295476497064364 32 0.03921629281071 33 0.0825358408356647 34 0.086932304830765 35 0.0627747385213402 36 0.0495008220391141 37 0.0636238410625801 38 0.0460644585401737 39 0.0389576670394378 40 0.0476848679960413 41 0.034061904360102 42 0.0293706240748387 43 0.0511069094360524 44 0.0382456185029095 45 0.0459515876117468 46 0.0403278138420355 47 0.0515726571088468 48 0.285326627664038 49 0.205222014030666 50 0.186357196338723 51 0.134750194788239 52 0.0981148208889101 53 0.211856964718621 54 0.205582608073587 55 0.148982085940847 56 0.108518951997536 57 0.0788669327392444 58 0.0565416871767761 }; \addplot [color2, opacity=0.6] table {% 0 0.87851705261409 1 0.378611493458582 2 0.327037652159222 3 0.560071085460247 4 0.708311644139141 5 0.596519850741184 6 0.708352151386782 7 0.764891778341042 8 0.793561893911386 9 0.815441274715635 10 0.868583753854609 11 0.639335720208417 12 0.461988019259305 13 0.36500022676054 14 0.269260747224814 15 0.214369614428089 16 0.402866396020215 17 0.324067933925403 18 0.510800318132612 19 0.366943505240555 20 0.262978235776292 21 0.200534980952929 22 0.421454286008578 23 0.303927109779229 24 0.371977899653522 25 0.549062085765721 26 0.677632085302302 27 0.747497389380772 28 0.81961949823557 29 0.871076801976269 30 0.900251916856771 31 0.717356366766488 32 0.515967397953423 33 0.466804256382257 34 0.555721118337443 35 0.681271585211123 36 0.725204183143856 37 0.564605755936288 38 0.522546542731462 39 0.624300549519293 40 0.533683353761688 41 0.45382625707317 42 0.32629660557568 43 0.474257087518772 44 0.519841730635934 45 0.596366209867347 46 0.706917484234414 47 0.750068703792788 48 0.562426325560025 49 0.658045008976124 50 0.755091969231168 51 0.58227002630231 52 0.425132582317374 53 0.32503358081368 54 0.508980019891925 55 0.490478915965387 56 0.468416346315862 57 0.618143328926715 58 0.666757403073265 }; \addplot [color3, opacity=0.6] table {% 0 0.0849002570352941 1 0.077981296895345 2 0.0576285149214374 3 0.077718244026945 4 0.333857579629439 5 0.333857579629439 6 0.240675679823687 7 0.305190063188127 8 0.214973071624169 9 0.248705498895075 10 0.204466117176489 11 0.443935939539545 12 0.382697144405185 13 0.512718837307929 14 0.502229977018244 15 0.645180428337312 16 0.72599303042481 17 0.732779646847582 18 0.803692308242426 19 0.859887188062175 20 0.832625285463401 21 0.846829108174225 22 0.604712850104335 23 0.697183875934516 24 0.554444641288825 25 0.476901941116526 26 0.542033640273369 27 0.653469614561074 28 0.588597109520189 29 0.609165425920513 30 0.514114694842294 31 0.457647702856781 32 0.33539959370692 33 0.335041232297067 34 0.452048042334495 35 0.403992742397685 36 0.553596380894503 37 0.667389269717398 38 0.504588168879244 39 0.364051580043538 40 0.288417267555128 41 0.434692621967037 42 0.596182333523194 43 0.691647497878104 44 0.73144584963065 45 0.523820543627135 46 0.501737606331857 47 0.387101777492042 48 0.282664087163541 49 0.485965023687618 50 0.544005421869904 51 0.604794496319142 52 0.712428306911649 53 0.740580161254697 54 0.697988006739958 55 0.501012483116281 56 0.636882989489737 57 0.726733460056179 58 0.760770360894366 }; \addplot [color4, opacity=0.6] table {% 0 0.978575928195755 1 0.854972029668023 2 0.918251055676137 3 0.698803515343226 4 0.465124807607643 5 0.535865757724217 6 0.618740488998261 7 0.530158244085928 8 0.670945457112304 9 0.529187235363201 10 0.442669633768852 11 0.327314152408785 12 0.260722495273765 13 0.300402598555203 14 0.385509892275867 15 0.276153916069672 16 0.468114632610927 17 0.441850193992578 18 0.377240188258253 19 0.369333254379762 20 0.440790753982993 21 0.365067543716616 22 0.351396112851195 23 0.466645166480938 24 0.601458739570484 25 0.514506220427477 26 0.584577370853226 27 0.488348914547721 28 0.351443227892767 29 0.338025200488833 30 0.244925654195242 31 0.459312305476889 32 0.562559670308418 33 0.673109098458995 34 0.698193518046818 35 0.740812022619467 36 0.751249460065915 37 0.807541479164453 38 0.807847749063895 39 0.734287089959524 40 0.791220558320322 41 0.834885869016485 42 0.750080017837484 43 0.812781260926535 44 0.788835153077916 45 0.845893737630272 46 0.887301902082977 47 0.636312060758187 48 0.47372063695724 49 0.36323688253004 50 0.471977660621174 51 0.353543075902793 52 0.441183621758115 53 0.520239563765353 54 0.415311909843621 55 0.42904012141303 56 0.481588574769427 57 0.499837728538274 58 0.567522476541473 }; \addplot [color5, opacity=0.6] table {% 0 0.980940268581942 1 0.56045062102646 2 0.310897617106721 3 0.364387413387423 4 0.433370315666115 5 0.619286557013165 6 0.720876073251552 7 0.519008987975352 8 0.460679300358054 9 0.601628183117727 10 0.485514061539208 11 0.625255226079566 12 0.733369984473378 13 0.593472544841659 14 0.656430784663743 15 0.61704602470042 16 0.455547704691794 17 0.424764322416305 18 0.567079279439627 19 0.494381291220794 20 0.49416185587289 21 0.636625154416035 22 0.52050250261427 23 0.650144835335697 24 0.732122631688028 25 0.731570918565966 26 0.796257210957572 27 0.837096603259634 28 0.601184689268649 29 0.448048946353131 30 0.548671120690777 31 0.632577816384773 32 0.727797680730091 33 0.574917225952699 34 0.573885458088869 35 0.508306821906787 36 0.594093277721832 37 0.553807285448974 38 0.648830899021851 39 0.704620976717944 40 0.617949209376683 41 0.689103180597973 42 0.727675949705174 43 0.748177861407362 44 0.777433231228887 45 0.567407106898159 46 0.416411955095757 47 0.545075962929913 48 0.670026203350457 49 0.509882275543993 50 0.372127981610986 51 0.550896714518336 52 0.451733256143119 53 0.447034204737128 54 0.595728044779907 55 0.707947085538704 56 0.615494561228711 57 0.585718313614319 58 0.633072648031693 }; \path [draw=white, fill opacity=0] (axis cs:0,1) --(axis cs:60,1); \path [draw=white, fill opacity=0] (axis cs:1,0) --(axis cs:1,1); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:60,0); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:0,1); \nextgroupplot[ xmin=0.5, xmax=5.5, ymin=0, ymax=1, xtick={1,2,3,4,5}, xticklabels={Alfa,Bravo,Charlie,Delta,Foxtrot}, ytick={0,0.2,0.4,0.6,0.8,1}, yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$}, tick align=outside, xmajorgrids, x grid style={white!50.196078431372548!black}, ymajorgrids, y grid style={white!50.196078431372548!black}, axis line style={white!50.196078431372548!black}, axis background/.style={fill=color0}, legend style={draw=none, fill=color0}, legend cell align={left}, legend entries={{Alfa},{Bravo},{Charlie},{Delta},{Foxtrot}} ] \addplot [color1, opacity=1] table {% 0.75 0.0468699366989207 1.25 0.0468699366989207 1.25 0.190065046822412 0.75 0.190065046822412 0.75 0.0468699366989207 }; \addplot [blue, opacity=1, dashed] table {% 1 0.0468699366989207 1 0.000287380403550065 }; \addplot [blue, opacity=1, dashed] table {% 1 0.190065046822412 1 0.370942849293502 }; \addplot [black] table {% 0.875 0.000287380403550065 1.125 0.000287380403550065 }; \addplot [black] table {% 0.875 0.370942849293502 1.125 0.370942849293502 }; \addplot [red, opacity=1] table {% 0.75 0.089145563576996 1.25 0.089145563576996 }; \addplot [blue, opacity=0.8] table {% 0.75 0.12754512546824 1.25 0.12754512546824 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color2, opacity=1] table {% 1.75 0.423293434162976 2.25 0.423293434162976 2.25 0.707614564186777 1.75 0.707614564186777 1.75 0.423293434162976 }; \addplot [blue, opacity=1, dashed] table {% 2 0.423293434162976 2 0.200534980952929 }; \addplot [blue, opacity=1, dashed] table {% 2 0.707614564186777 2 0.900251916856771 }; \addplot [black] table {% 1.875 0.200534980952929 2.125 0.200534980952929 }; \addplot [black] table {% 1.875 0.900251916856771 2.125 0.900251916856771 }; \addplot [red, opacity=1] table {% 1.75 0.555721118337443 2.25 0.555721118337443 }; \addplot [blue, opacity=0.8] table {% 1.75 0.557226357584493 2.25 0.557226357584493 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color3, opacity=1] table {% 2.75 0.349725586875229 3.25 0.349725586875229 3.25 0.660429442139236 2.75 0.660429442139236 2.75 0.349725586875229 }; \addplot [blue, opacity=1, dashed] table {% 3 0.349725586875229 3 0.0576285149214374 }; \addplot [blue, opacity=1, dashed] table {% 3 0.660429442139236 3 0.859887188062175 }; \addplot [black] table {% 2.875 0.0576285149214374 3.125 0.0576285149214374 }; \addplot [black] table {% 2.875 0.859887188062175 3.125 0.859887188062175 }; \addplot [red, opacity=1] table {% 2.75 0.512718837307929 3.25 0.512718837307929 }; \addplot [blue, opacity=0.8] table {% 2.75 0.502233416929928 3.25 0.502233416929928 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color4, opacity=1] table {% 3.75 0.422176015628326 4.25 0.422176015628326 4.25 0.716545302651375 3.75 0.716545302651375 3.75 0.422176015628326 }; \addplot [blue, opacity=1, dashed] table {% 4 0.422176015628326 4 0.244925654195242 }; \addplot [blue, opacity=1, dashed] table {% 4 0.716545302651375 4 0.978575928195755 }; \addplot [black] table {% 3.875 0.244925654195242 4.125 0.244925654195242 }; \addplot [black] table {% 3.875 0.978575928195755 4.125 0.978575928195755 }; \addplot [red, opacity=1] table {% 3.75 0.514506220427477 4.25 0.514506220427477 }; \addplot [blue, opacity=0.8] table {% 3.75 0.555873654031033 4.25 0.555873654031033 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color5, opacity=1] table {% 4.75 0.50909454872539 5.25 0.50909454872539 5.25 0.6632284940071 4.75 0.6632284940071 4.75 0.50909454872539 }; \addplot [blue, opacity=1, dashed] table {% 5 0.50909454872539 5 0.310897617106721 }; \addplot [blue, opacity=1, dashed] table {% 5 0.6632284940071 5 0.837096603259634 }; \addplot [black] table {% 4.875 0.310897617106721 5.125 0.310897617106721 }; \addplot [black] table {% 4.875 0.837096603259634 5.125 0.837096603259634 }; \addplot [red, opacity=1] table {% 4.75 0.594093277721832 5.25 0.594093277721832 }; \addplot [blue, opacity=0.8] table {% 4.75 0.592686546082792 5.25 0.592686546082792 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 5 0.980940268581942 }; \path [draw=white, fill opacity=0] (axis cs:0.5,1) --(axis cs:5.5,1); \path [draw=white, fill opacity=0] (axis cs:1,0) --(axis cs:1,1); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0.5,0) --(axis cs:5.5,0); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:0,1); \end{groupplot} \end{tikzpicture}
andrewbolster/thesis
Figures/best_adelay_arxp_rxthroughput_indd_inhd_only_feats_signed_run_time_Shadow.tex
TeX
epl-1.0
12,500
package com.odcgroup.page.transformmodel.snippet; import org.w3c.dom.Element; import com.odcgroup.page.model.Snippet; import com.odcgroup.page.model.Widget; import com.odcgroup.page.model.snippets.ISnippetFactory; import com.odcgroup.page.model.snippets.SnippetUtil; import com.odcgroup.page.transformmodel.WidgetTransformerContext; /** * * @author pkk * */ public class SnippetTransformer { private Widget widget; /** * */ public SnippetTransformer() { } /** * @param context * @param snippet * @param functionElement * @param widget * @param autocomplete */ public void transform(WidgetTransformerContext context, Snippet snippet, Element functionElement, Widget widget, boolean autocomplete) { if (snippet == null) { return; } this.widget = widget; ISnippetFactory factory = getSnippetFactory(); if (snippet.getTypeName().equals(ISnippetFactory.FILTERSET_SNIPPETTYPE)) { // transform filterset FilterSetSnippetTransformer transformer = new FilterSetSnippetTransformer(functionElement); transformer.transform(context, factory.adaptFilterSetSnippet(snippet), widget); } else if (snippet.getTypeName().equals(ISnippetFactory.QUERY_SNIPPETTYPE)) { // transform query QuerySnippetTransformer transformer = new QuerySnippetTransformer(functionElement); transformer.transform(context, factory.adaptQuerySnippet(snippet), autocomplete); } } /** * @return */ public Widget getWidget() { return this.widget; } /** * @return factory */ private ISnippetFactory getSnippetFactory() { return SnippetUtil.getSnippetFactory(); } }
debabratahazra/DS
designstudio/components/page/core/com.odcgroup.page.transformmodel/src/main/java/com/odcgroup/page/transformmodel/snippet/SnippetTransformer.java
Java
epl-1.0
1,617
/************************************************************************* *** FORTE Library Element *** *** This file was generated using the 4DIAC FORTE Export Filter V1.0.x! *** *** Name: F_USINT_TO_STRING *** Description: convert USINT to STRING *** Version: *** 0.0: 2012-01-18/4DIAC-IDE - 4DIAC-Consortium - null *************************************************************************/ #ifndef _F_USINT_TO_STRING_H_ #define _F_USINT_TO_STRING_H_ #include <funcbloc.h> #include <forte_usint.h> #include <forte_string.h> class FORTE_F_USINT_TO_STRING: public CFunctionBlock{ DECLARE_FIRMWARE_FB(FORTE_F_USINT_TO_STRING) private: static const CStringDictionary::TStringId scm_anDataInputNames[]; static const CStringDictionary::TStringId scm_anDataInputTypeIds[]; CIEC_USINT &IN() { return *static_cast<CIEC_USINT*>(getDI(0)); }; static const CStringDictionary::TStringId scm_anDataOutputNames[]; static const CStringDictionary::TStringId scm_anDataOutputTypeIds[]; CIEC_STRING &OUT() { return *static_cast<CIEC_STRING*>(getDO(0)); }; static const TEventID scm_nEventREQID = 0; static const TForteInt16 scm_anEIWithIndexes[]; static const TDataIOID scm_anEIWith[]; static const CStringDictionary::TStringId scm_anEventInputNames[]; static const TEventID scm_nEventCNFID = 0; static const TForteInt16 scm_anEOWithIndexes[]; static const TDataIOID scm_anEOWith[]; static const CStringDictionary::TStringId scm_anEventOutputNames[]; static const SFBInterfaceSpec scm_stFBInterfaceSpec; FORTE_FB_DATA_ARRAY(1, 1, 1, 0); void executeEvent(int pa_nEIID); public: FUNCTION_BLOCK_CTOR(FORTE_F_USINT_TO_STRING){ }; virtual ~FORTE_F_USINT_TO_STRING(){}; }; #endif //close the ifdef sequence from the beginning of the file
EstebanQuerol/Black_FORTE
src/modules/IEC61131-3/Conversion/USINT/F_USINT_TO_STRING.h
C
epl-1.0
1,842
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="copyright" content="(C) Copyright 2010" /> <meta name="DC.rights.owner" content="(C) Copyright 2010" /> <meta name="DC.Type" content="cxxClass" /> <meta name="DC.Title" content="CImsPolicy" /> <meta name="DC.Format" content="XHTML" /> <meta name="DC.Identifier" content="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF" /> <title> CImsPolicy </title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api" /> <link rel="stylesheet" type="text/css" href="cxxref.css" /> </head> <body class="cxxref" id="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF"> <a name="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF"> <!-- --> </a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()"> Collapse all </a> <a id="index" href="index.html"> Symbian^3 Application Developer Library </a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1"> &#160; </div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2518338 id2518347 id2858858 id2544002 id2544571 id2544602 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"> <a href="index.html" title="Symbian^3 Application Developer Library"> Symbian^3 Application Developer Library </a> &gt; </div> <h1 class="topictitle1"> CImsPolicy Class Reference </h1> <table class="signature"> <tr> <td> class CImsPolicy : public CExtensionBase </td> </tr> </table> <div class="section"> <div> <p> This is the IMS policy extension. The IMS policy can be extended by adding the CSubConIMSExtensionParamSet object at the client side </p> </div> </div> <div class="section derivation"> <h2 class="sectiontitle"> Inherits from </h2> <ul class="derivation derivation-root"> <li class="derivation-depth-0 "> CImsPolicy <ul class="derivation"> <li class="derivation-depth-1 "> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase </a> <ul class="derivation"> <li class="derivation-depth-2 "> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase </a> </li> </ul> </li> </ul> </li> </ul> </div> <div class="section member-index"> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Public Member Functions </th> </tr> </thead> <tbody> <tr> <td align="right" class="code"> </td> <td> <a href="#GUID-C5FF0861-B425-386F-B550-F0C68A32BFE4"> ~CImsPolicy </a> () </td> </tr> <tr class="bg"> <td align="right" class="code"> IMPORT_C <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> </td> <td> <a href="#GUID-D2E19589-AF33-3D1C-82C0-5E636A6F7295"> Copy </a> (const <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase </a> &amp;) </td> </tr> <tr> <td align="right" class="code"> IMPORT_C <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase </a> * </td> <td> <a href="#GUID-AE7378D7-C3DD-326E-8603-EBB714D08711"> CreateL </a> () </td> </tr> <tr class="bg"> <td align="right" class="code"> IMPORT_C <a href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.html"> TDesC8 </a> &amp; </td> <td> <a href="#GUID-293C7870-9E10-3109-AC5E-6005ED7C4770"> Data </a> () </td> </tr> <tr> <td align="right" class="code"> IMPORT_C void </td> <td> <a href="#GUID-FD02646B-A207-3CBC-BCE0-9C6E189E74BF"> GetImsParameter </a> ( <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> &amp;) </td> </tr> <tr class="bg"> <td align="right" class="code"> IMPORT_C <a href="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF.html"> CImsPolicy </a> * </td> <td> <a href="#GUID-775A24DB-3F61-37CE-B4D6-5A2C9C708F0A"> NewL </a> () </td> </tr> <tr> <td align="right" class="code"> IMPORT_C <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> </td> <td> <a href="#GUID-8AF8E000-51DF-31B1-90B4-70A0D2607E5A"> ParseMessage </a> (const <a href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.html"> TDesC8 </a> &amp;) </td> </tr> <tr class="bg"> <td align="right" class="code"> IMPORT_C void </td> <td> <a href="#GUID-1642A3E8-86E7-3F69-9216-E45C8A8519DB"> SetImsParameter </a> (const <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> &amp;) </td> </tr> </tbody> </table> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Protected Member Functions </th> </tr> </thead> <tbody> <tr> <td align="right" class="code"> </td> <td> <a href="#GUID-063B4126-78B7-3444-9E0F-1243BEBE8596"> CImsPolicy </a> () </td> </tr> <tr class="bg"> <td align="right" class="code"> void </td> <td> <a href="#GUID-1830FA49-FFFC-39D7-B953-7A0E746BA810"> ConstructL </a> () </td> </tr> </tbody> </table> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Inherited Functions </th> </tr> </thead> <tbody> <tr> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::CBase() </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::Delete(CBase *) </a> </td> </tr> <tr> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::Extension_(TUint,TAny *&amp;,TAny *) </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::operator new(TUint) </a> </td> </tr> <tr> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::operator new(TUint,TAny *) </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::operator new(TUint,TLeave) </a> </td> </tr> <tr> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::operator new(TUint,TLeave,TUint) </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::operator new(TUint,TUint) </a> </td> </tr> <tr> <td> </td> <td> <a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html"> CBase::~CBase() </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase::CExtensionBase() </a> </td> </tr> <tr> <td> </td> <td> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase::Type()const </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase::~CExtensionBase() </a> </td> </tr> </tbody> </table> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Private Attributes </th> </tr> </thead> <tbody> <tr> <td align="right" valign="top"> <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> </td> <td> <a href="#GUID-4B16092C-F19B-375E-A78A-98091FFCDFCF"> iIms </a> </td> </tr> </tbody> </table> <table border="0" class="member-index"> <thead> <tr> <th colspan="2"> Inherited Attributes </th> </tr> </thead> <tbody> <tr> <td> </td> <td> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase::iData </a> </td> </tr> <tr class="bg"> <td> </td> <td> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase::iLink </a> </td> </tr> <tr> <td> </td> <td> <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase::iType </a> </td> </tr> </tbody> </table> </div> <h1 class="pageHeading topictitle1"> Constructor &amp; Destructor Documentation </h1> <div class="nested1" id="GUID-063B4126-78B7-3444-9E0F-1243BEBE8596"> <a name="GUID-063B4126-78B7-3444-9E0F-1243BEBE8596"> <!-- --> </a> <h2 class="topictitle2"> CImsPolicy() </h2> <table class="signature"> <tr> <td> CImsPolicy </td> <td> ( </td> <td> ) </td> <td> [protected] </td> </tr> </table> <div class="section"> </div> </div> <div class="nested1" id="GUID-C5FF0861-B425-386F-B550-F0C68A32BFE4"> <a name="GUID-C5FF0861-B425-386F-B550-F0C68A32BFE4"> <!-- --> </a> <h2 class="topictitle2"> ~CImsPolicy() </h2> <table class="signature"> <tr> <td> IMPORT_C </td> <td> ~CImsPolicy </td> <td> ( </td> <td> ) </td> <td> </td> </tr> </table> <div class="section"> <div> <p> Destructor. </p> </div> </div> </div> <h1 class="pageHeading topictitle1"> Member Functions Documentation </h1> <div class="nested1" id="GUID-1830FA49-FFFC-39D7-B953-7A0E746BA810"> <a name="GUID-1830FA49-FFFC-39D7-B953-7A0E746BA810"> <!-- --> </a> <h2 class="topictitle2"> ConstructL() </h2> <table class="signature"> <tr> <td> void </td> <td> ConstructL </td> <td> ( </td> <td> ) </td> <td> [protected] </td> </tr> </table> <div class="section"> </div> </div> <div class="nested1" id="GUID-D2E19589-AF33-3D1C-82C0-5E636A6F7295"> <a name="GUID-D2E19589-AF33-3D1C-82C0-5E636A6F7295"> <!-- --> </a> <h2 class="topictitle2"> Copy(const CExtensionBase &amp;) </h2> <table class="signature"> <tr> <td> IMPORT_C <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> </td> <td> Copy </td> <td> ( </td> <td> const <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase </a> &amp; </td> <td> aExtension </td> <td> ) </td> <td> [virtual] </td> </tr> </table> <div class="section"> <div> <p> Copies the parameters from aExtension object to this object. aExtension must be a <a href="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF.html#GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF"> CImsPolicy </a> object. If some other extension is given as a parameter, KErrArgument is returned. </p> <p> </p> </div> </div> <div class="section parameters"> <h3 class="sectiontitle"> Parameters </h3> <table border="0" class="parameters"> <tr> <td class="parameter"> const <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase </a> &amp; aExtension </td> <td> A CImsPolicy object that is copied into this object. </td> </tr> </table> </div> </div> <div class="nested1" id="GUID-AE7378D7-C3DD-326E-8603-EBB714D08711"> <a name="GUID-AE7378D7-C3DD-326E-8603-EBB714D08711"> <!-- --> </a> <h2 class="topictitle2"> CreateL() </h2> <table class="signature"> <tr> <td> IMPORT_C <a href="GUID-1737BA2F-AA92-3207-9FE9-B14DA99A4F51.html"> CExtensionBase </a> * </td> <td> CreateL </td> <td> ( </td> <td> ) </td> <td> [virtual] </td> </tr> </table> <div class="section"> <div> <p> Creates a <a href="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF.html#GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF"> CImsPolicy </a> object. This is used by ipscpr. </p> <div class="p"> <dl class="exception"> <dt class="dlterm"> Exceptions </dt> <dd> <table cellpadding="4" cellspacing="0" summary="" border="0" class="simpletableborder"> <tr> <td valign="top"> Leaves </td> <td valign="top"> <p> if no memory is available. </p> </td> </tr> </table> </dd> </dl> </div> </div> </div> </div> <div class="nested1" id="GUID-293C7870-9E10-3109-AC5E-6005ED7C4770"> <a name="GUID-293C7870-9E10-3109-AC5E-6005ED7C4770"> <!-- --> </a> <h2 class="topictitle2"> Data() </h2> <table class="signature"> <tr> <td> IMPORT_C <a href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.html"> TDesC8 </a> &amp; </td> <td> Data </td> <td> ( </td> <td> ) </td> <td> [virtual] </td> </tr> </table> <div class="section"> <div> <p> Returns IMS policy extension in a descriptor. This is used by ipscpr. </p> <p> </p> </div> </div> </div> <div class="nested1" id="GUID-FD02646B-A207-3CBC-BCE0-9C6E189E74BF"> <a name="GUID-FD02646B-A207-3CBC-BCE0-9C6E189E74BF"> <!-- --> </a> <h2 class="topictitle2"> GetImsParameter(TImsParameter &amp;) </h2> <table class="signature"> <tr> <td> IMPORT_C void </td> <td> GetImsParameter </td> <td> ( </td> <td> <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> &amp; </td> <td> aIms </td> <td> ) </td> <td> const </td> </tr> </table> <div class="section"> <div> <p> Gets the IMS QoS parameter set. </p> <p> </p> </div> </div> <div class="section parameters"> <h3 class="sectiontitle"> Parameters </h3> <table border="0" class="parameters"> <tr> <td class="parameter"> <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> &amp; aIms </td> <td> IMS QoS parameter set will be copied to aIms. </td> </tr> </table> </div> </div> <div class="nested1" id="GUID-775A24DB-3F61-37CE-B4D6-5A2C9C708F0A"> <a name="GUID-775A24DB-3F61-37CE-B4D6-5A2C9C708F0A"> <!-- --> </a> <h2 class="topictitle2"> NewL() </h2> <table class="signature"> <tr> <td> IMPORT_C <a href="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF.html"> CImsPolicy </a> * </td> <td> NewL </td> <td> ( </td> <td> ) </td> <td> [static] </td> </tr> </table> <div class="section"> <div> <p> Two phase constructor. Creates a <a href="GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF.html#GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF"> CImsPolicy </a> object. </p> <div class="p"> <dl class="exception"> <dt class="dlterm"> Exceptions </dt> <dd> <table cellpadding="4" cellspacing="0" summary="" border="0" class="simpletableborder"> <tr> <td valign="top"> Leaves </td> <td valign="top"> <p> if no memory is available. </p> </td> </tr> </table> </dd> </dl> </div> </div> </div> </div> <div class="nested1" id="GUID-8AF8E000-51DF-31B1-90B4-70A0D2607E5A"> <a name="GUID-8AF8E000-51DF-31B1-90B4-70A0D2607E5A"> <!-- --> </a> <h2 class="topictitle2"> ParseMessage(const TDesC8 &amp;) </h2> <table class="signature"> <tr> <td> IMPORT_C <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html"> TInt </a> </td> <td> ParseMessage </td> <td> ( </td> <td> const <a href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.html"> TDesC8 </a> &amp; </td> <td> aData </td> <td> ) </td> <td> [virtual] </td> </tr> </table> <div class="section"> <div> <p> Parses a IMS policy extension given in a descriptor. This is used by ipscpr. </p> <p> </p> </div> </div> <div class="section parameters"> <h3 class="sectiontitle"> Parameters </h3> <table border="0" class="parameters"> <tr> <td class="parameter"> const <a href="GUID-FB97E0A3-352A-316F-97C6-69E4741A8120.html"> TDesC8 </a> &amp; aData </td> <td> </td> </tr> </table> </div> </div> <div class="nested1" id="GUID-1642A3E8-86E7-3F69-9216-E45C8A8519DB"> <a name="GUID-1642A3E8-86E7-3F69-9216-E45C8A8519DB"> <!-- --> </a> <h2 class="topictitle2"> SetImsParameter(const TImsParameter &amp;) </h2> <table class="signature"> <tr> <td> IMPORT_C void </td> <td> SetImsParameter </td> <td> ( </td> <td> const <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> &amp; </td> <td> aIms </td> <td> ) </td> <td> </td> </tr> </table> <div class="section"> <div> <p> Sets the IMS QoS parameter set. </p> <p> </p> </div> </div> <div class="section parameters"> <h3 class="sectiontitle"> Parameters </h3> <table border="0" class="parameters"> <tr> <td class="parameter"> const <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> &amp; aIms </td> <td> contains the Ims QoS parameter. </td> </tr> </table> </div> </div> <h1 class="pageHeading topictitle1"> Member Data Documentation </h1> <div class="nested1" id="GUID-4B16092C-F19B-375E-A78A-98091FFCDFCF"> <a name="GUID-4B16092C-F19B-375E-A78A-98091FFCDFCF"> <!-- --> </a> <h2 class="topictitle2"> TImsParameter iIms </h2> <table class="signature"> <tr> <td> <a href="GUID-AE114288-9E34-35FC-9EB0-050AAF23EA6F.html"> TImsParameter </a> </td> <td> iIms </td> <td> [private] </td> </tr> </table> <div class="section"> </div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
sdk/GUID-AA2FC7CF-4157-347F-818D-A4DB62A2A9AF.html
HTML
epl-1.0
23,107
<?php /******************************************************************************* * Copyright (c) 2011, 2014 IBM Corporation and Others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ use_helper("Javascript"); use_javascript('/opCommunityTopicPlugin/js/moment.min.js', 'last'); ?> <script id="form_event_category_option_tmpl" type="text/x-jquery-tmpl"> <option value="${name}">${title}</option> </script> <script type="text/javascript"> $(document).ready(function(){ var __support_date_input = ("date" == $("<input type='date'/>")[0].type); var __support_time_input = ("time" == $("<input type='time'/>")[0].type); var __today = moment(new Date()).startOf("day"); function overrideDateField(src, trg, olistener){ src.appendTo(trg.parent().wrapInner("<span style='display:none;'/>")) .change(function(){ if(moment($(this).val(), "YYYY-MM-DD")){ var picker_id = "datepick_error" + olistener["day"].attr(name); $("#" + picker_id).remove(); if(0 > moment($(this).val(), "YYYY-MM-DD").diff(__today)){ $(this).before('<div id="datepick_error' + olistener["day"].attr(name) + '" class="error"><ul class="error_list"><li>日付は本日以後にして下さい。</li></ul></div>'); }else{ var dtelems = $(this).val().split("-"); olistener["year"].val(1 * dtelems[0]); olistener["month"].val(1 * dtelems[1]); olistener["day"].val(1 * dtelems[2]); } } }); var oy = olistener["year"].val(); var om = olistener["month"].val(); var od = olistener["day"].val(); if(oy && om && od){ src.val(moment([oy, om, od].join("-"), "YYYY-MM-DD").format("YYYY-MM-DD")); } } if(__support_date_input && 0 == $("#formCommunityEvent #op_date_input").length){ overrideDateField( $("<input id='op_date_input' type='date'/>"), $("#formCommunityEvent form [name^='community_event[open_date]']"), { "year":$("#formCommunityEvent form [name='community_event[open_date][year]']"), "month":$("#formCommunityEvent form [name='community_event[open_date][month]']"), "day":$("#formCommunityEvent form [name='community_event[open_date][day]']") }); } if(__support_date_input && 0 == $("#formCommunityEvent #dl_date_input").length){ overrideDateField( $("<input id='dl_date_input' type='date'/>"), $("#formCommunityEvent form [name^='community_event[application_deadline]']"), {"year": $("#formCommunityEvent form [name='community_event[application_deadline][year]']"), "month": $("#formCommunityEvent form [name='community_event[application_deadline][month]']"), "day": $("#formCommunityEvent form [name='community_event[application_deadline][day]']") } ); } if(0 == $("#formCommunityEvent #time_container").length){ var _f_date_comm = $("#formCommunityEvent form [name='community_event[open_date_comment]']"); var _time_container = $("<span id='time_container'><input style='width:6em;' type='time' id='time_start'/> - <input style='width:6em;' type='time' id='time_end'/></span>").appendTo(_f_date_comm.parent().wrapInner("<span style='display:none;'/>")); _time_container.find("#time_start").val(_f_date_comm.val().split("-")[0]) .click(function(){ _f_date_comm.val([$(this).val(), _f_date_comm.val().split("-")[1] || ""].join("-")); }) .change(function(){ _f_date_comm.val([$(this).val(), _f_date_comm.val().split("-")[1] || ""].join("-")) }); _time_container.find("#time_end").val(_f_date_comm.val().split("-")[1]) .click(function(){ _f_date_comm.val([_f_date_comm.val().split("-")[0], $(this).val()].join("-")); }) .change(function(){ _f_date_comm.val([_f_date_comm.val().split("-")[0], $(this).val()].join("-")); }); } var __options = <?php echo htmlspecialchars_decode(!empty($optionsjson) ? $optionsjson : "null"); ?>; if(0 == $("#formCommunityEvent #category_select").length && __options){ var sel = $("<select id='category_select'/>") .appendTo( $("#formCommunityEvent form [name='community_event[area]']") .parent() .wrapInner("<span style='display:none;'/>") ).append($("#form_event_category_option_tmpl").tmpl(__options)) .change(function(){ $("#formCommunityEvent form [name='community_event[area]']").val($(this).val()); }); var orgval = $("#community_event_area").val(); if(orgval){ sel.val(orgval); }else{ $("#community_event_area").val(sel.val()); } } $("#formCommunityEvent label[for='community_event_area']").html("予約区分 <strong>*</strong>"); }); </script>
kentarou-fukuda/CFEL
opMICGadgetsPlugin/apps/pc_frontend/modules/dslevent/templates/__eventFormFix.php
PHP
epl-1.0
4,938
/* * Sonatype Nexus (TM) Open Source Version * Copyright (c) 2008-present Sonatype, Inc. * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. * * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. * * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the * Eclipse Foundation. All other trademarks are the property of their respective owners. */ package org.sonatype.nexus.proxy.item.uid; import org.sonatype.nexus.proxy.item.RepositoryItemUid; import org.sonatype.nexus.util.SystemPropertiesHelper; /** * Attribute yielding "false" for real repository content, and "true" for all the "item attributes", that is actually * not holding data serving the basic purpose of this given repository. * <em>This attribute must not be configurable, as it drives interal storage logic and may introduce endless loops!</em> * * @author cstamas * @since 2.0 */ public class IsItemAttributeMetacontentAttribute implements Attribute<Boolean> { public Boolean getValueFor(RepositoryItemUid subject) { if (subject.getPath() != null) { return subject.getPath().startsWith("/.nexus/attributes"); } return false; } }
scmod/nexus-public
components/nexus-core/src/main/java/org/sonatype/nexus/proxy/item/uid/IsItemAttributeMetacontentAttribute.java
Java
epl-1.0
1,567
/******************************************************************************* * Copyright (c) 2017 Red Hat, Inc and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.reddeer.swt.api; /** * API for progress bar manipulation. * * @author Jiri Peterka * @author rhopp * */ public interface ProgressBar extends Control<org.eclipse.swt.widgets.ProgressBar> { /** * Gets state of the progress bar. * * @return current state (SWT.NORMAL, SWT.ERROR, SWT.PAUSED) */ int getState(); }
djelinek/reddeer
plugins/org.eclipse.reddeer.swt/src/org/eclipse/reddeer/swt/api/ProgressBar.java
Java
epl-1.0
878
/* Common Public License Version 0.5 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. */ /* (C) COPYRIGHT International Business Machines Corp. 2001,2002 */ // File: mech_rsa.c // // Mechanisms for RSA // // Routines contained within: #include <pthread.h> #include <stdio.h> #include <string.h> // for memcmp() et al #include <stdlib.h> #include "pkcs11types.h" #include "defs.h" #include "host_defs.h" #include "h_extern.h" #include "tok_spec_struct.h" CK_RV rsa_get_key_info(OBJECT *key_obj, CK_ULONG *mod_bytes, CK_OBJECT_CLASS *keyclass) { CK_RV rc; CK_ATTRIBUTE *attr; rc = template_attribute_find(key_obj->template, CKA_MODULUS, &attr); if (rc == FALSE) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } else *mod_bytes = attr->ulValueLen; rc = template_attribute_find(key_obj->template, CKA_CLASS, &attr); if (rc == FALSE) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } else *keyclass = *(CK_OBJECT_CLASS *)attr->pValue; return CKR_OK; } /* * Format an encryption block according to PKCS #1: RSA Encryption, Version * 1.5. */ CK_RV rsa_format_block( CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * out_data, CK_ULONG out_data_len, CK_ULONG type ) { CK_ULONG padding_len, i; CK_RV rc; if (!in_data || !in_data_len || !out_data || !out_data_len) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); rc = CKR_FUNCTION_FAILED; return rc; } if (out_data_len < (in_data_len + 11)) { OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); rc = CKR_BUFFER_TOO_SMALL; return rc; } /* * The padding string PS shall consist of k-3-||D|| octets. */ padding_len = out_data_len - 3 - in_data_len; /* * For block types 01 and 02, the padding string is at least eight octets * long, which is a security condition for public-key operations that * prevents an attacker from recoving data by trying all possible * encryption blocks. */ if ((type == 1 || type == 2) && ((padding_len) < 8)) { OCK_LOG_ERR(ERR_DATA_LEN_RANGE); rc = CKR_DATA_LEN_RANGE; return rc; } /* * The leading 00 octet. */ out_data[0] = (CK_BYTE)0; /* * The block type. */ out_data[1] = (CK_BYTE)type; switch (type) { /* * For block type 00, the octets shall have value 00. * EB = 00 || 00 || 00 * i || D * Where D must begin with a nonzero octet. */ case 0: if (in_data[0] == (CK_BYTE)0) { OCK_LOG_ERR(ERR_DATA_INVALID); rc = CKR_DATA_INVALID; return rc; } for (i = 2; i < (padding_len + 2); i++) out_data[i] = (CK_BYTE)0; break; /* * For block type 01, they shall have value FF. * EB = 00 || 01 || FF * i || 00 || D */ case 1: for (i = 2; i < (padding_len + 2); i++) out_data[i] = (CK_BYTE)0xff; break; /* * For block type 02, they shall be pseudorandomly generated and * nonzero. * EB = 00 || 02 || ?? * i || 00 || D * Where ?? is nonzero. */ case 2: for (i = 2; i < (padding_len + 2); i++) { rc = rng_generate(&out_data[i], 1); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_RNG); return rc; } if (out_data[i] == (CK_BYTE)0) { /* avoid zeros by explicitly making them all 0xff - * won't hurt entropy that bad, and it's better than * looping over rng_generate */ out_data[i] = (CK_BYTE)0xff; } } break; default: OCK_LOG_ERR(ERR_DATA_INVALID); rc = CKR_DATA_INVALID; return rc; } out_data[i] = (CK_BYTE)0; i++; memcpy(&out_data[i], in_data, in_data_len); rc = CKR_OK; return rc; } /* * Parse an encryption block according to PKCS #1: RSA Encryption, Version * 1.5. */ CK_RV rsa_parse_block( CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * out_data, CK_ULONG * out_data_len, CK_ULONG type ) { CK_ULONG i; CK_RV rc; if (!in_data || !out_data || !out_data_len) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); rc = CKR_FUNCTION_FAILED; return rc; } if (in_data_len <= 11) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); rc = CKR_FUNCTION_FAILED; return rc; } /* * Check for the leading 00 octet. */ if (in_data[0] != (CK_BYTE)0) { OCK_LOG_ERR(ERR_ENCRYPTED_DATA_INVALID); rc = CKR_ENCRYPTED_DATA_INVALID; return rc; } /* * Check the block type. */ if (in_data[1] != (CK_BYTE)type) { OCK_LOG_ERR(ERR_ENCRYPTED_DATA_INVALID); rc = CKR_ENCRYPTED_DATA_INVALID; return rc; } /* * The block type shall be a single octet indicating the structure of the * encryption block. It shall have value 00, 01, or 02. For a private-key * operation, the block type shall be 00 or 01. For a public-key * operation, it shall be 02. * * For block type 00, the octets shall have value 00; for block type 01, * they shall have value FF; and for block type 02, they shall be * pseudorandomly generated and nonzero. * * For block type 00, the data must begin with a nonzero octet or have * known length so that the encryption block can be parsed unambiguously. * For block types 01 and 02, the encryption block can be parsed * unambiguously since the padding string contains no octets with value 00 * and the padding string is separated from the data by an octet with * value 00. */ switch (type) { /* * For block type 00, the octets shall have value 00. * EB = 00 || 00 || 00 * i || D * Where D must begin with a nonzero octet. */ case 0: for (i = 2; i <= (in_data_len - 2); i++) { if (in_data[i] != (CK_BYTE)0) break; } break; /* * For block type 01, they shall have value FF. * EB = 00 || 01 || FF * i || 00 || D */ case 1: for (i = 2; i <= (in_data_len - 2); i++) { if (in_data[i] != (CK_BYTE)0xff) { if (in_data[i] == (CK_BYTE)0) { i++; break; } OCK_LOG_ERR(ERR_ENCRYPTED_DATA_INVALID); rc = CKR_ENCRYPTED_DATA_INVALID; return rc; } } break; /* * For block type 02, they shall be pseudorandomly generated and * nonzero. * EB = 00 || 02 || ?? * i || 00 || D * Where ?? is nonzero. */ case 2: for (i = 2; i <= (in_data_len - 2); i++) { if (in_data[i] == (CK_BYTE)0) { i++; break; } } break; default: OCK_LOG_ERR(ERR_ENCRYPTED_DATA_INVALID); rc = CKR_ENCRYPTED_DATA_INVALID; return rc; } /* * For block types 01 and 02, the padding string is at least eight octets * long, which is a security condition for public-key operations that * prevents an attacker from recoving data by trying all possible * encryption blocks. */ if ((type == 1 || type == 2) && ((i - 3) < 8)) { OCK_LOG_ERR(ERR_ENCRYPTED_DATA_INVALID); rc = CKR_ENCRYPTED_DATA_INVALID; return rc; } if (in_data_len <= i) { OCK_LOG_ERR(ERR_ENCRYPTED_DATA_INVALID); rc = CKR_ENCRYPTED_DATA_INVALID; return rc; } if (*out_data_len < (in_data_len - i)) { OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); rc = CKR_BUFFER_TOO_SMALL; return rc; } memcpy(out_data, &in_data[i], in_data_len - i); *out_data_len = in_data_len - i; rc = CKR_OK; return rc; } // // CK_RV rsa_pkcs_encrypt( SESSION *sess, CK_BBOOL length_only, ENCR_DECR_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (in_data_len > (modulus_bytes - 11)){ OCK_LOG_ERR(ERR_DATA_LEN_RANGE); return CKR_DATA_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes; return CKR_OK; } if (*out_data_len < modulus_bytes) { *out_data_len = modulus_bytes; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } // this had better be a public key if (keyclass != CKO_PUBLIC_KEY){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } if( token_specific.t_rsa_encrypt == NULL ) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_encrypt(in_data, in_data_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_ENCRYPT); return rc; } // // CK_RV rsa_pkcs_decrypt( SESSION *sess, CK_BBOOL length_only, ENCR_DECR_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (in_data_len != modulus_bytes){ OCK_LOG_ERR(ERR_ENCRYPTED_DATA_LEN_RANGE); return CKR_ENCRYPTED_DATA_LEN_RANGE; } if (length_only == TRUE) { // this is not exact but it's the upper bound; otherwise we'll need // to do the RSA operation just to get the required length // *out_data_len = modulus_bytes - 11; return CKR_OK; } if (*out_data_len < (modulus_bytes - 11)) { *out_data_len = modulus_bytes - 11; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } // this had better be a private key if (keyclass != CKO_PRIVATE_KEY){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if( token_specific.t_rsa_decrypt == NULL ) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_decrypt(in_data, in_data_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) { if (rc == CKR_DATA_LEN_RANGE) { OCK_LOG_ERR(ERR_ENCRYPTED_DATA_LEN_RANGE); return CKR_ENCRYPTED_DATA_LEN_RANGE; } OCK_LOG_ERR(ERR_RSA_DECRYPT); } return rc; } // // CK_RV rsa_pkcs_sign( SESSION *sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; if (!sess || !ctx || !out_data_len){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (in_data_len > (modulus_bytes - 11)){ OCK_LOG_ERR(ERR_DATA_LEN_RANGE); return CKR_DATA_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes; return CKR_OK; } if (*out_data_len < modulus_bytes) { *out_data_len = modulus_bytes; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } // this had better be a private key // if (keyclass != CKO_PRIVATE_KEY){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if(token_specific.t_rsa_sign == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_sign(in_data, in_data_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_SIGN); return rc; } // // CK_RV rsa_pkcs_verify( SESSION * sess, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * signature, CK_ULONG sig_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (sig_len != modulus_bytes){ OCK_LOG_ERR(ERR_SIGNATURE_LEN_RANGE); return CKR_SIGNATURE_LEN_RANGE; } // verifying is a public key operation // if (keyclass != CKO_PUBLIC_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_verify == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_verify(in_data, in_data_len, signature, sig_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_VERIFY); return rc; } // // CK_RV rsa_pkcs_verify_recover( SESSION * sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * signature, CK_ULONG sig_len, CK_BYTE * out_data, CK_ULONG * out_data_len ) { OBJECT *key_obj = NULL; CK_OBJECT_CLASS keyclass; CK_ULONG modulus_bytes; CK_RV rc; if (!sess || !ctx || !out_data_len){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (sig_len != modulus_bytes){ OCK_LOG_ERR(ERR_SIGNATURE_LEN_RANGE); return CKR_SIGNATURE_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes - 11; return CKR_OK; } /* this had better be a public key */ if (keyclass != CKO_PUBLIC_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_verify_recover == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_verify_recover(signature, sig_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_VERIFY_RECOVER); return rc; } // // CK_RV rsa_x509_encrypt( SESSION *sess, CK_BBOOL length_only, ENCR_DECR_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len ) { OBJECT *key_obj = NULL; CK_OBJECT_CLASS keyclass; CK_ULONG modulus_bytes; CK_RV rc; rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // CKM_RSA_X_509 requires input data length to be no bigger than the modulus // if (in_data_len > modulus_bytes){ OCK_LOG_ERR(ERR_DATA_LEN_RANGE); return CKR_DATA_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes; return CKR_OK; } if (*out_data_len < modulus_bytes) { *out_data_len = modulus_bytes; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } /* this had better be a public key */ if (keyclass != CKO_PUBLIC_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_x509_encrypt == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_x509_encrypt(in_data, in_data_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_X509_ENCRYPT); return rc; } // // CK_RV rsa_x509_decrypt( SESSION *sess, CK_BBOOL length_only, ENCR_DECR_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (in_data_len != modulus_bytes){ OCK_LOG_ERR(ERR_ENCRYPTED_DATA_LEN_RANGE); return CKR_ENCRYPTED_DATA_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes; return CKR_OK; } // Although X.509 prepads with zeros, we don't strip it after // decryption (PKCS #11 specifies that X.509 decryption is supposed // to produce K bytes of cleartext where K is the modulus length) // if (*out_data_len < modulus_bytes) { *out_data_len = modulus_bytes; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } /* this had better be a private key */ if (keyclass != CKO_PRIVATE_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_x509_encrypt == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_x509_decrypt(in_data, in_data_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_X509_DECRYPT); // ckm_rsa_operation is used for all RSA operations so we need to adjust // the return code accordingly // if (rc == CKR_DATA_LEN_RANGE){ OCK_LOG_ERR(ERR_ENCRYPTED_DATA_LEN_RANGE); return CKR_ENCRYPTED_DATA_LEN_RANGE; } return rc; } // // CK_RV rsa_x509_sign( SESSION *sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; if (!sess || !ctx || !out_data_len){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (in_data_len > modulus_bytes){ OCK_LOG_ERR(ERR_DATA_LEN_RANGE); return CKR_DATA_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes; return CKR_OK; } if (*out_data_len < modulus_bytes) { *out_data_len = modulus_bytes; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } /* this had better be a private key */ if (keyclass != CKO_PRIVATE_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_x509_sign == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_x509_sign(in_data, in_data_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_X509_SIGN); return rc; } // // CK_RV rsa_x509_verify( SESSION * sess, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * signature, CK_ULONG sig_len ) { OBJECT *key_obj = NULL; CK_OBJECT_CLASS keyclass; CK_ULONG modulus_bytes; CK_RV rc; rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (sig_len != modulus_bytes){ OCK_LOG_ERR(ERR_SIGNATURE_LEN_RANGE); return CKR_SIGNATURE_LEN_RANGE; } /* this had better be a public key */ if (keyclass != CKO_PUBLIC_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_x509_verify == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } // verify is a public key operation --> encrypt // rc = token_specific.t_rsa_x509_verify(in_data, in_data_len, signature, sig_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_X509_VERIFY); return rc; } // // CK_RV rsa_x509_verify_recover( SESSION * sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * signature, CK_ULONG sig_len, CK_BYTE * out_data, CK_ULONG * out_data_len ) { OBJECT *key_obj = NULL; CK_ULONG modulus_bytes; CK_OBJECT_CLASS keyclass; CK_RV rc; if (!sess || !ctx || !out_data_len){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } rc = object_mgr_find_in_map1( ctx->key, &key_obj ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_OBJMGR_FIND_MAP); return rc; } rc = rsa_get_key_info(key_obj, &modulus_bytes, &keyclass); if (rc != CKR_OK) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } // check input data length restrictions // if (sig_len != modulus_bytes){ OCK_LOG_ERR(ERR_SIGNATURE_LEN_RANGE); return CKR_SIGNATURE_LEN_RANGE; } if (length_only == TRUE) { *out_data_len = modulus_bytes; return CKR_OK; } // we perform no stripping of prepended zero bytes here // if (*out_data_len < modulus_bytes) { *out_data_len = modulus_bytes; OCK_LOG_ERR(ERR_BUFFER_TOO_SMALL); return CKR_BUFFER_TOO_SMALL; } /* this had better be a public key */ if (keyclass != CKO_PUBLIC_KEY) { OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } /* check for token specific call first */ if (token_specific.t_rsa_x509_verify_recover == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } // verify is a public key operation --> encrypt // rc = token_specific.t_rsa_x509_verify_recover(signature, sig_len, out_data, out_data_len, key_obj); if (rc != CKR_OK) OCK_LOG_ERR(ERR_RSA_X509_VERIFY_RECOVER); return rc; } // // CK_RV rsa_hash_pkcs_sign( SESSION * sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * signature, CK_ULONG * sig_len ) { CK_BYTE * ber_data = NULL; CK_BYTE * octet_str = NULL; CK_BYTE * oid = NULL; CK_BYTE * tmp = NULL; CK_ULONG buf1[16]; // 64 bytes is more than enough CK_BYTE hash[SHA5_HASH_SIZE]; // must be large enough for the largest hash DIGEST_CONTEXT digest_ctx; SIGN_VERIFY_CONTEXT sign_ctx; CK_MECHANISM digest_mech; CK_MECHANISM sign_mech; CK_ULONG ber_data_len, hash_len, octet_str_len, oid_len; CK_RV rc; if (!sess || !ctx || !in_data){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } memset( &digest_ctx, 0x0, sizeof(digest_ctx) ); memset( &sign_ctx, 0x0, sizeof(sign_ctx) ); if (ctx->mech.mechanism == CKM_MD2_RSA_PKCS) { digest_mech.mechanism = CKM_MD2; oid = ber_AlgMd2; oid_len = ber_AlgMd2Len; } else if (ctx->mech.mechanism == CKM_MD5_RSA_PKCS) { digest_mech.mechanism = CKM_MD5; oid = ber_AlgMd5; oid_len = ber_AlgMd5Len; } else if (ctx->mech.mechanism == CKM_SHA256_RSA_PKCS) { digest_mech.mechanism = CKM_SHA256; oid = ber_AlgSha256; oid_len = ber_AlgSha256Len; } else if (ctx->mech.mechanism == CKM_SHA384_RSA_PKCS) { digest_mech.mechanism = CKM_SHA384; oid = ber_AlgSha384; oid_len = ber_AlgSha384Len; } else if (ctx->mech.mechanism == CKM_SHA512_RSA_PKCS) { digest_mech.mechanism = CKM_SHA512; oid = ber_AlgSha512; oid_len = ber_AlgSha512Len; } else { digest_mech.mechanism = CKM_SHA_1; oid = ber_AlgSha1; oid_len = ber_AlgSha1Len; } digest_mech.ulParameterLen = 0; digest_mech.pParameter = NULL; rc = digest_mgr_init( sess, &digest_ctx, &digest_mech ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_INIT); return rc; } hash_len = sizeof(hash); rc = digest_mgr_digest( sess, length_only, &digest_ctx, in_data, in_data_len, hash, &hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST); return rc; } // build the BER-encodings rc = ber_encode_OCTET_STRING( FALSE, &octet_str, &octet_str_len, hash, hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_OCTET); goto error; } tmp = (CK_BYTE *)buf1; memcpy( tmp, oid, oid_len ); memcpy( tmp + oid_len, octet_str, octet_str_len); rc = ber_encode_SEQUENCE( FALSE, &ber_data, &ber_data_len, tmp, (oid_len + octet_str_len) ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_SEQ); goto error; } // sign the BER-encoded data block sign_mech.mechanism = CKM_RSA_PKCS; sign_mech.ulParameterLen = 0; sign_mech.pParameter = NULL; rc = sign_mgr_init( sess, &sign_ctx, &sign_mech, FALSE, ctx->key ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_SIGN_INIT); goto error; } rc = sign_mgr_sign( sess, length_only, &sign_ctx, ber_data, ber_data_len, signature, sig_len ); if (rc != CKR_OK) OCK_LOG_ERR(ERR_SIGN); error: if (octet_str) free( octet_str ); if (ber_data) free( ber_data ); sign_mgr_cleanup( &sign_ctx ); return rc; } // // CK_RV rsa_hash_pkcs_sign_update( SESSION * sess, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len ) { RSA_DIGEST_CONTEXT * context = NULL; CK_MECHANISM digest_mech; CK_RV rc; if (!sess || !ctx || !in_data){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } context = (RSA_DIGEST_CONTEXT *)ctx->context; if (context->flag == FALSE) { if (ctx->mech.mechanism == CKM_MD2_RSA_PKCS) digest_mech.mechanism = CKM_MD2; else if (ctx->mech.mechanism == CKM_MD5_RSA_PKCS) digest_mech.mechanism = CKM_MD5; else if (ctx->mech.mechanism == CKM_SHA256_RSA_PKCS) digest_mech.mechanism = CKM_SHA256; else if (ctx->mech.mechanism == CKM_SHA384_RSA_PKCS) digest_mech.mechanism = CKM_SHA384; else if (ctx->mech.mechanism == CKM_SHA512_RSA_PKCS) digest_mech.mechanism = CKM_SHA512; else digest_mech.mechanism = CKM_SHA_1; digest_mech.ulParameterLen = 0; digest_mech.pParameter = NULL; rc = digest_mgr_init( sess, &context->hash_context, &digest_mech ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_INIT); return rc; } context->flag = TRUE; } rc = digest_mgr_digest_update( sess, &context->hash_context, in_data, in_data_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_UPDATE); return rc; } return CKR_OK; } // // CK_RV rsa_hash_pkcs_verify( SESSION * sess, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * signature, CK_ULONG sig_len ) { CK_BYTE * ber_data = NULL; CK_BYTE * octet_str = NULL; CK_BYTE * oid = NULL; CK_BYTE * tmp = NULL; CK_ULONG buf1[16]; // 64 bytes is more than enough CK_BYTE hash[SHA5_HASH_SIZE]; DIGEST_CONTEXT digest_ctx; SIGN_VERIFY_CONTEXT verify_ctx; CK_MECHANISM digest_mech; CK_MECHANISM verify_mech; CK_ULONG ber_data_len, hash_len, octet_str_len, oid_len; CK_RV rc; if (!sess || !ctx || !in_data){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } memset( &digest_ctx, 0x0, sizeof(digest_ctx) ); memset( &verify_ctx, 0x0, sizeof(verify_ctx) ); if (ctx->mech.mechanism == CKM_MD2_RSA_PKCS) { digest_mech.mechanism = CKM_MD2; oid = ber_AlgMd2; oid_len = ber_AlgMd2Len; } else if (ctx->mech.mechanism == CKM_MD5_RSA_PKCS) { digest_mech.mechanism = CKM_MD5; oid = ber_AlgMd5; oid_len = ber_AlgMd5Len; } else if (ctx->mech.mechanism == CKM_SHA256_RSA_PKCS) { digest_mech.mechanism = CKM_SHA256; oid = ber_AlgSha256; oid_len = ber_AlgSha256Len; } else if (ctx->mech.mechanism == CKM_SHA384_RSA_PKCS) { digest_mech.mechanism = CKM_SHA384; oid = ber_AlgSha384; oid_len = ber_AlgSha384Len; } else if (ctx->mech.mechanism == CKM_SHA512_RSA_PKCS) { digest_mech.mechanism = CKM_SHA512; oid = ber_AlgSha512; oid_len = ber_AlgSha512Len; } else { digest_mech.mechanism = CKM_SHA_1; oid = ber_AlgSha1; oid_len = ber_AlgSha1Len; } digest_mech.ulParameterLen = 0; digest_mech.pParameter = NULL; rc = digest_mgr_init( sess, &digest_ctx, &digest_mech ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_INIT); return rc; } hash_len = sizeof(hash); rc = digest_mgr_digest( sess, FALSE, &digest_ctx, in_data, in_data_len, hash, &hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST); return rc; } // Build the BER encoding // rc = ber_encode_OCTET_STRING( FALSE, &octet_str, &octet_str_len, hash, hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_OCTET); goto done; } tmp = (CK_BYTE *)buf1; memcpy( tmp, oid, oid_len ); memcpy( tmp + oid_len, octet_str, octet_str_len ); rc = ber_encode_SEQUENCE( FALSE, &ber_data, &ber_data_len, tmp, (oid_len + octet_str_len) ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_SEQ); goto done; } // Verify the Signed BER-encoded Data block // verify_mech.mechanism = CKM_RSA_PKCS; verify_mech.ulParameterLen = 0; verify_mech.pParameter = NULL; rc = verify_mgr_init( sess, &verify_ctx, &verify_mech, FALSE, ctx->key ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_VERIFY_INIT); goto done; } rc = verify_mgr_verify( sess, &verify_ctx, ber_data, ber_data_len, signature, sig_len ); if (rc != CKR_OK) OCK_LOG_ERR(ERR_VERIFY); done: if (octet_str) free( octet_str ); if (ber_data) free( ber_data ); sign_mgr_cleanup( &verify_ctx ); return rc; } // // CK_RV rsa_hash_pkcs_verify_update( SESSION * sess, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len ) { RSA_DIGEST_CONTEXT * context = NULL; CK_MECHANISM digest_mech; CK_RV rc; if (!sess || !ctx || !in_data){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } context = (RSA_DIGEST_CONTEXT *)ctx->context; if (context->flag == FALSE) { if (ctx->mech.mechanism == CKM_MD2_RSA_PKCS) digest_mech.mechanism = CKM_MD2; else if (ctx->mech.mechanism == CKM_MD5_RSA_PKCS) digest_mech.mechanism = CKM_MD5; else if (ctx->mech.mechanism == CKM_SHA256_RSA_PKCS) digest_mech.mechanism = CKM_SHA256; else if (ctx->mech.mechanism == CKM_SHA384_RSA_PKCS) digest_mech.mechanism = CKM_SHA384; else if (ctx->mech.mechanism == CKM_SHA512_RSA_PKCS) digest_mech.mechanism = CKM_SHA512; else digest_mech.mechanism = CKM_SHA_1; digest_mech.ulParameterLen = 0; digest_mech.pParameter = NULL; rc = digest_mgr_init( sess, &context->hash_context, &digest_mech ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_INIT); return rc; } context->flag = TRUE; } rc = digest_mgr_digest_update( sess, &context->hash_context, in_data, in_data_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_UPDATE); return rc; } return CKR_OK; } // // CK_RV rsa_hash_pkcs_sign_final( SESSION * sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * signature, CK_ULONG * sig_len ) { CK_BYTE * ber_data = NULL; CK_BYTE * octet_str = NULL; CK_BYTE * oid = NULL; CK_BYTE * tmp = NULL; CK_ULONG buf1[16]; // 64 bytes is more than enough CK_BYTE hash[SHA5_HASH_SIZE]; RSA_DIGEST_CONTEXT * context = NULL; CK_ULONG ber_data_len, hash_len, octet_str_len, oid_len; CK_MECHANISM sign_mech; SIGN_VERIFY_CONTEXT sign_ctx; CK_RV rc; if (!sess || !ctx || !sig_len){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } if (ctx->mech.mechanism == CKM_MD2_RSA_PKCS) { oid = ber_AlgMd2; oid_len = ber_AlgMd2Len; } else if (ctx->mech.mechanism == CKM_MD5_RSA_PKCS) { oid = ber_AlgMd5; oid_len = ber_AlgMd5Len; } else if (ctx->mech.mechanism == CKM_SHA256_RSA_PKCS) { oid = ber_AlgSha256; oid_len = ber_AlgSha256Len; } else if (ctx->mech.mechanism == CKM_SHA384_RSA_PKCS) { oid = ber_AlgSha384; oid_len = ber_AlgSha384Len; } else if (ctx->mech.mechanism == CKM_SHA512_RSA_PKCS) { oid = ber_AlgSha512; oid_len = ber_AlgSha512Len; } else { oid = ber_AlgSha1; oid_len = ber_AlgSha1Len; } memset( &sign_ctx, 0x0, sizeof(sign_ctx)); context = (RSA_DIGEST_CONTEXT *)ctx->context; hash_len = sizeof(hash); rc = digest_mgr_digest_final( sess, length_only, &context->hash_context, hash, &hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_FINAL); return rc; } // Build the BER Encoded Data block // rc = ber_encode_OCTET_STRING( FALSE, &octet_str, &octet_str_len, hash, hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_OCTET); return rc; } tmp = (CK_BYTE *)buf1; memcpy( tmp, oid, oid_len ); memcpy( tmp + oid_len, octet_str, octet_str_len ); rc = ber_encode_SEQUENCE( FALSE, &ber_data, &ber_data_len, tmp, (oid_len + octet_str_len) ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_SEQ); goto done; } // sign the BER-encoded data block // sign_mech.mechanism = CKM_RSA_PKCS; sign_mech.ulParameterLen = 0; sign_mech.pParameter = NULL; rc = sign_mgr_init( sess, &sign_ctx, &sign_mech, FALSE, ctx->key ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_SIGN_INIT); goto done; } //rc = sign_mgr_sign( sess, length_only, &sign_ctx, hash, hash_len, signature, sig_len ); rc = sign_mgr_sign( sess, length_only, &sign_ctx, ber_data, ber_data_len, signature, sig_len ); if (rc != CKR_OK) OCK_LOG_ERR(ERR_SIGN); if (length_only == TRUE || rc == CKR_BUFFER_TOO_SMALL) { sign_mgr_cleanup( &sign_ctx ); return rc; } done: if (octet_str) free( octet_str ); if (ber_data) free( ber_data ); sign_mgr_cleanup( &sign_ctx ); return rc; } // // CK_RV rsa_hash_pkcs_verify_final( SESSION * sess, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * signature, CK_ULONG sig_len ) { CK_BYTE * ber_data = NULL; CK_BYTE * octet_str = NULL; CK_BYTE * oid = NULL; CK_BYTE * tmp = NULL; CK_ULONG buf1[16]; // 64 bytes is more than enough CK_BYTE hash[SHA5_HASH_SIZE]; RSA_DIGEST_CONTEXT * context = NULL; CK_ULONG ber_data_len, hash_len, octet_str_len, oid_len; CK_MECHANISM verify_mech; SIGN_VERIFY_CONTEXT verify_ctx; CK_RV rc; if (!sess || !ctx || !signature){ OCK_LOG_ERR(ERR_FUNCTION_FAILED); return CKR_FUNCTION_FAILED; } if (ctx->mech.mechanism == CKM_MD2_RSA_PKCS) { oid = ber_AlgMd2; oid_len = ber_AlgMd2Len; } else if (ctx->mech.mechanism == CKM_MD5_RSA_PKCS) { oid = ber_AlgMd5; oid_len = ber_AlgMd5Len; } else if (ctx->mech.mechanism == CKM_SHA256_RSA_PKCS) { oid = ber_AlgSha256; oid_len = ber_AlgSha256Len; } else if (ctx->mech.mechanism == CKM_SHA384_RSA_PKCS) { oid = ber_AlgSha384; oid_len = ber_AlgSha384Len; } else if (ctx->mech.mechanism == CKM_SHA512_RSA_PKCS) { oid = ber_AlgSha512; oid_len = ber_AlgSha512Len; } else { oid = ber_AlgSha1; oid_len = ber_AlgSha1Len; } memset( &verify_ctx, 0x0, sizeof(verify_ctx)); context = (RSA_DIGEST_CONTEXT *)ctx->context; hash_len = sizeof(hash); rc = digest_mgr_digest_final( sess, FALSE, &context->hash_context, hash, &hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_DIGEST_FINAL); return rc; } // Build the BER encoding // rc = ber_encode_OCTET_STRING( FALSE, &octet_str, &octet_str_len, hash, hash_len ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_OCTET); goto done; } tmp = (CK_BYTE *)buf1; memcpy( tmp, oid, oid_len ); memcpy( tmp + oid_len, octet_str, octet_str_len ); rc = ber_encode_SEQUENCE( FALSE, &ber_data, &ber_data_len, tmp, (oid_len + octet_str_len) ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_ENCODE_SEQ); goto done; } // verify the signed BER-encoded data block // verify_mech.mechanism = CKM_RSA_PKCS; verify_mech.ulParameterLen = 0; verify_mech.pParameter = NULL; rc = verify_mgr_init( sess, &verify_ctx, &verify_mech, FALSE, ctx->key ); if (rc != CKR_OK){ OCK_LOG_ERR(ERR_VERIFY_INIT); goto done; } rc = verify_mgr_verify( sess, &verify_ctx, ber_data, ber_data_len, signature, sig_len ); if (rc != CKR_OK) OCK_LOG_ERR(ERR_VERIFY); done: if (octet_str) free( octet_str ); if (ber_data) free( ber_data ); verify_mgr_cleanup( &verify_ctx ); return rc; } // // mechanisms // // // CK_RV ckm_rsa_key_pair_gen( TEMPLATE * publ_tmpl, TEMPLATE * priv_tmpl ) { CK_RV rc; /* check for token specific call first */ if (token_specific.t_rsa_generate_keypair == NULL) { OCK_LOG_ERR(ERR_MECHANISM_INVALID); return CKR_MECHANISM_INVALID; } rc = token_specific.t_rsa_generate_keypair(publ_tmpl, priv_tmpl); if (rc != CKR_OK) OCK_LOG_ERR(ERR_KEYGEN); return rc; }
joylatten/opencryptoki
usr/lib/pkcs11/common/mech_rsa.c
C
epl-1.0
58,530
/** Generated from platform:/resource/hu.bme.mit.massif.simulink.incquery/src/hu/bme/mit/massif/models/simulink/validation/simulinkValidation.vql */ package hu.bme.mit.massif.models.simulink.validation; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Arrays; import org.eclipse.viatra.addon.validation.core.api.Severity; import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; import org.eclipse.viatra.query.runtime.api.IPatternMatch; import org.eclipse.viatra.query.runtime.api.IQuerySpecification; import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; import hu.bme.mit.massif.models.simulink.validation.ClashingChildNames; public class ClashingChildNamesConstraint0 implements IConstraintSpecification { private ClashingChildNames querySpecification; public ClashingChildNamesConstraint0() { querySpecification = ClashingChildNames.instance(); } @Override public String getMessageFormat() { return "Child $child$ has a sibling in $parent$ with the same name!"; } @Override public Map<String,Object> getKeyObjects(IPatternMatch signature) { Map<String,Object> map = new HashMap<>(); map.put("child",signature.get("child")); return map; } @Override public List<String> getKeyNames() { List<String> keyNames = Arrays.asList( "child" ); return keyNames; } @Override public List<String> getPropertyNames() { List<String> propertyNames = Arrays.asList( "parent" ); return propertyNames; } @Override public Set<List<String>> getSymmetricPropertyNames() { Set<List<String>> symmetricPropertyNamesSet = new HashSet<>(); return symmetricPropertyNamesSet; } @Override public Set<List<String>> getSymmetricKeyNames() { Set<List<String>> symmetricKeyNamesSet = new HashSet<>(); return symmetricKeyNamesSet; } @Override public Severity getSeverity() { return Severity.ERROR; } @Override public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification() { return querySpecification; } }
FTSRG/massif
plugins/hu.bme.mit.massif.simulink.incquery.validation/src-gen/hu/bme/mit/massif/models/simulink/validation/ClashingChildNamesConstraint0.java
Java
epl-1.0
2,320
package com.forgeessentials.core.misc; import net.minecraft.command.CommandException; import com.forgeessentials.api.UserIdent; public class TranslatedCommandException extends CommandException { public TranslatedCommandException(String message) { super(Translator.translate(message)); } public TranslatedCommandException(String message, Object... args) { super(Translator.translate(message), args); } public static class PlayerNotFoundException extends TranslatedCommandException { public PlayerNotFoundException(String playerName) { super("Player %s not found", playerName); } public PlayerNotFoundException(UserIdent ident) { super("Player %s not found", ident.getUsernameOrUuid()); } } public static class InvalidSyntaxException extends TranslatedCommandException { public InvalidSyntaxException() { super("Invalid Syntax"); } public InvalidSyntaxException(String correctSyntax) { super("Invalid Syntax. Instead use %s", correctSyntax); } } }
aschmois/ForgeEssentialsMain
src/main/java/com/forgeessentials/core/misc/TranslatedCommandException.java
Java
epl-1.0
1,172
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_55) on Thu Jun 12 19:18:36 EDT 2014 --> <title>com.runescape.revised.actor.entity.item</title> <meta name="date" content="2014-06-12"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="com.runescape.revised.actor.entity.item"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../com/runescape/revised/actor/entity/character/update/impl/package-summary.html">Prev Package</a></li> <li><a href="../../../../../../com/runescape/revised/actor/entity/item/ground/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/runescape/revised/actor/entity/item/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Package" class="title">Package&nbsp;com.runescape.revised.actor.entity.item</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Interface</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../../com/runescape/revised/actor/entity/item/Depositable.html" title="interface in com.runescape.revised.actor.entity.item">Depositable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../../com/runescape/revised/actor/entity/item/Pickable.html" title="interface in com.runescape.revised.actor.entity.item">Pickable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../../com/runescape/revised/actor/entity/item/Wieldable.html" title="interface in com.runescape.revised.actor.entity.item">Wieldable</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../../com/runescape/revised/actor/entity/item/AbstractItem.html" title="class in com.runescape.revised.actor.entity.item">AbstractItem</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../../com/runescape/revised/actor/entity/item/ItemSystem.html" title="class in com.runescape.revised.actor.entity.item">ItemSystem</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../com/runescape/revised/actor/entity/character/update/impl/package-summary.html">Prev Package</a></li> <li><a href="../../../../../../com/runescape/revised/actor/entity/item/ground/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/runescape/revised/actor/entity/item/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
RodriguesJ/Atem
doc/com/runescape/revised/actor/entity/item/package-summary.html
HTML
epl-1.0
6,324
package de.ptb.epics.eve.editor.dialogs.monitoroptions; import java.util.List; import java.util.ArrayList; import org.apache.log4j.Logger; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.window.ToolTip; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.TableColumn; import de.ptb.epics.eve.data.measuringstation.Detector; import de.ptb.epics.eve.data.measuringstation.DetectorChannel; import de.ptb.epics.eve.data.measuringstation.Motor; import de.ptb.epics.eve.data.measuringstation.MotorAxis; import de.ptb.epics.eve.data.measuringstation.Option; import de.ptb.epics.eve.data.measuringstation.AbstractDevice; import de.ptb.epics.eve.data.measuringstation.IMeasuringStation; import de.ptb.epics.eve.data.scandescription.ScanDescription; import de.ptb.epics.eve.editor.Activator; /** * * @author Hartmut Scherr * @since 1.14 */ public class MonitorOptionsDialog extends Dialog { private static final Logger LOGGER = Logger.getLogger(MonitorOptionsDialog.class.getName()); private ScanDescription scanDescription; private IMeasuringStation measuringStation; // tree viewer containing the device definition private TreeViewer treeViewer; private TreeViewerSelectionChangedListener treeViewerSelectionChangedListener; private static final int TREEVIEWER_SASH_WEIGHT = 1; // table viewer showing options of selected devices private TableViewer optionsTable; private TableViewerContentProvider optionsTableContentProvider; private static final int TABLEVIEWER_SASH_WEIGHT = 2; // List of abstract devices currently selected in tree viewer // (where options are extracted from and shown in table) private List<AbstractDevice> tableDevices; private SelectState selectState; private Image ascending; private Image descending; // sorting private OptionsTableOptionNameColumnSelectionListener optionsTableOptionNameColumnSelectionListener; private OptionsTableDeviceNameColumnSelectionListener optionsTableDeviceNameColumnSelectionListener; private OptionColumnComparator optionsTableViewerComparator; private DeviceColumnComparator deviceTableViewerComparator; private int optionsTableSortState; // 0 no sort, 1 asc, 2 desc private int deviceTableSortState; // 0 no sort, 1 asc, 2 desc /** * Constructor. * * @param shell the shell * @param scanDescription the scan description */ public MonitorOptionsDialog(final Shell shell, final ScanDescription scanDescription) { super(shell); this.scanDescription = scanDescription; this.selectState = SelectState.NONE; } /** * {@inheritDoc} */ protected Control createDialogArea(final Composite parent) { Composite area = (Composite) super.createDialogArea(parent); SashForm sashForm = new SashForm(area, SWT.HORIZONTAL | SWT.SMOOTH); GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true); sashForm.setLayoutData(gridData); measuringStation = Activator.getDefault().getDeviceDefinition(); this.tableDevices = new ArrayList<AbstractDevice>(); Composite treeComposite = new Composite(sashForm, SWT.NONE); treeComposite.setLayout(new FillLayout()); this.createTreeViewer(treeComposite); Composite tableComposite = new Composite(sashForm, SWT.NONE); tableComposite.setLayout(new FillLayout()); this.createTableViewer(tableComposite); sashForm.setWeights(new int[] { MonitorOptionsDialog.TREEVIEWER_SASH_WEIGHT, MonitorOptionsDialog.TABLEVIEWER_SASH_WEIGHT }); return area; } /** * {@inheritDoc} */ @Override protected Point getInitialSize() { return new Point(800, 600); } /** * {@inheritDoc} */ @Override protected void createButtonsForButtonBar(Composite parent) { Button closeButton = createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true); closeButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setReturnCode(Window.OK); close(); } } ); } private void createTreeViewer(Composite parent) { treeViewer = new TreeViewer(parent); treeViewer.setContentProvider(new TreeViewerContentProvider()); treeViewer.setLabelProvider(new TreeViewerLabelProvider()); treeViewer.setAutoExpandLevel(1); treeViewer.setInput(measuringStation); } private void createTableViewer(Composite parent) { this.optionsTable = new TableViewer(parent); this.optionsTable.getTable().setHeaderVisible(true); this.optionsTable.getTable().setLinesVisible(true); this.optionsTableContentProvider = new TableViewerContentProvider(); this.optionsTable.setContentProvider(optionsTableContentProvider); createColumns(parent, optionsTable); this.optionsTable.setInput(this.tableDevices); // for sorting ascending = de.ptb.epics.eve.util.ui.Activator.getDefault() .getImageRegistry().get("SORT_ASCENDING"); descending = de.ptb.epics.eve.util.ui.Activator.getDefault() .getImageRegistry().get("SORT_DESCENDING"); optionsTableSortState = 0; deviceTableSortState = 0; optionsTableViewerComparator = new OptionColumnComparator(); deviceTableViewerComparator = new DeviceColumnComparator(); this.treeViewerSelectionChangedListener = new TreeViewerSelectionChangedListener(); treeViewer.addSelectionChangedListener( treeViewerSelectionChangedListener); } /* * helper for createPartControl */ private void createColumns(final Composite parent, final TableViewer viewer) { ColumnViewerToolTipSupport.enableFor(optionsTable, ToolTip.NO_RECREATE); final TableViewerColumn selColumn = new TableViewerColumn(viewer, SWT.NONE); selColumn.getColumn().setWidth(25); selColumn.setLabelProvider(new ColumnLabelProvider() { @Override public String getText(Object element) { return ""; } @Override public Image getImage(Object element) { Option o = (Option) element; if (scanDescription.getMonitors().contains(o)) { return Activator.getDefault().getImageRegistry() .get("CHECKED"); } else { return Activator.getDefault().getImageRegistry() .get("UNCHECKED"); } } }); selColumn.getColumn().setAlignment(SWT.CENTER); selColumn.setEditingSupport(new SelColumnEditingSupport( viewer, scanDescription)); selColumn.getColumn().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { List<Option> allOptions = new ArrayList<>(); for (AbstractDevice device : tableDevices) { for (Option o : device.getOptions()) { allOptions.add(o); } } switch (selectState) { case ALL: scanDescription.removeMonitors(allOptions); break; case NONE: scanDescription.addMonitors(allOptions); break; } selectState = SelectState.values()[(selectState.ordinal() + 1) % 2]; LOGGER.debug("Select State: " + selectState.toString()); viewer.refresh(); } }); final TableViewerColumn optionViewerColumn = new TableViewerColumn(viewer, SWT.NONE); final TableColumn optionColumn = optionViewerColumn.getColumn(); optionColumn.setText("Option"); optionColumn.setWidth(120); optionColumn.setResizable(true); optionViewerColumn.setLabelProvider(new ColumnLabelProvider(){ @Override public String getText(Object element) { return ((Option)element).getName(); } }); optionsTableOptionNameColumnSelectionListener = new OptionsTableOptionNameColumnSelectionListener(); optionColumn.addSelectionListener( optionsTableOptionNameColumnSelectionListener); final TableViewerColumn deviceViewerColumn = new TableViewerColumn(viewer, SWT.NONE); final TableColumn deviceColumn = deviceViewerColumn.getColumn(); deviceColumn.setText("Device"); deviceColumn.setWidth(120); deviceColumn.setResizable(true); deviceViewerColumn.setLabelProvider(new ColumnLabelProvider() { @Override public String getText(Object element) { return ((Option)element).getParent().getName(); } }); optionsTableDeviceNameColumnSelectionListener = new OptionsTableDeviceNameColumnSelectionListener(); deviceColumn.addSelectionListener( optionsTableDeviceNameColumnSelectionListener); } /** * <code>TreeViewerSelectionListener</code>. * * @author Hartmut Scherr * @since 1.14 */ private class TreeViewerSelectionChangedListener implements ISelectionChangedListener { @Override public void selectionChanged(SelectionChangedEvent event) { // clear previous selected devices tableDevices.clear(); ISelection selection = event.getSelection(); if (!(selection instanceof IStructuredSelection)) { return; } for (Object o : ((IStructuredSelection)selection).toList()) { // selections can be classes or abstract devices if (o instanceof AbstractDevice) { AbstractDevice device = (AbstractDevice)o; if (device instanceof Motor) { for (MotorAxis axis : ((Motor)device).getAxes()) { if (axis.getClassName().isEmpty() && !tableDevices.contains(axis)) { tableDevices.add(axis); } } } else if (device instanceof Detector) { for (DetectorChannel channel : ((Detector) device) .getChannels()) { if (channel.getClassName().isEmpty() && !tableDevices.contains(channel)) { tableDevices.add(channel); } } } if (!tableDevices.contains(device)) { tableDevices.add(device); } } else if (o instanceof String) { for (AbstractDevice device : measuringStation .getDeviceList((String) o)) { if (device instanceof Motor) { for (MotorAxis axis : ((Motor)device).getAxes()) { if (axis.getClassName().isEmpty() && !tableDevices.contains(axis)) { tableDevices.add(axis); } } } else if (device instanceof Detector) { for (DetectorChannel channel : ((Detector) device) .getChannels()) { if (channel.getClassName().isEmpty() && !tableDevices.contains(channel)) { tableDevices.add(channel); } } } if (!tableDevices.contains(device)) { tableDevices.add(device); } } } } optionsTable.setInput(tableDevices); selectState = SelectState.NONE; } } /** * * @author Hartmut Scherr * @since 1.16 */ class OptionsTableOptionNameColumnSelectionListener implements SelectionListener { // TODO: extract common functionality to remove redundant code, see #1795 /** * {@inheritDoc} */ @Override public void widgetDefaultSelected(SelectionEvent e) { } /** * {@inheritDoc} */ @Override public void widgetSelected(SelectionEvent e) { LOGGER.debug("option name column clicked"); LOGGER.debug("old option table sort state: " + optionsTableSortState); switch(optionsTableSortState) { case 0: // was no sorting -> now ascending optionsTableViewerComparator.setDirection( OptionColumnComparator.ASCENDING); optionsTable.setComparator(optionsTableViewerComparator); optionsTable.getTable().getColumn(1). setImage(ascending); break; case 1: // was ascending -> now descending optionsTableViewerComparator.setDirection( OptionColumnComparator.DESCENDING); optionsTable.setComparator(optionsTableViewerComparator); optionsTable.refresh(); optionsTable.getTable().getColumn(1). setImage(descending); break; case 2: // was descending -> now no sorting optionsTable.setComparator(null); optionsTable.getTable().getColumn(1).setImage(null); break; } // no sorting of device name column optionsTable.getTable().getColumn(2).setImage(null); deviceTableSortState = 0; // set is {0,1,2} // if it becomes 3 it has to be 0 again // but before the state has to be increased to the new state optionsTableSortState = ++optionsTableSortState % 3; LOGGER.debug("new options table sort state: " + optionsTableSortState); } } /** * * @author Hartmut Scherr * @since 1.16 */ class OptionsTableDeviceNameColumnSelectionListener implements SelectionListener { // TODO: extract common functionality to remove redundant code, see #1795 /** * {@inheritDoc} */ @Override public void widgetDefaultSelected(SelectionEvent e) { } /** * {@inheritDoc} */ @Override public void widgetSelected(SelectionEvent e) { LOGGER.debug("device name column clicked"); LOGGER.debug("old device table sort state: " + deviceTableSortState); switch(deviceTableSortState) { case 0: // was no sorting -> now ascending deviceTableViewerComparator.setDirection( OptionColumnComparator.ASCENDING); optionsTable.setComparator(deviceTableViewerComparator); optionsTable.getTable().getColumn(2).setImage(ascending); break; case 1: // was ascending -> now descending deviceTableViewerComparator.setDirection( OptionColumnComparator.DESCENDING); optionsTable.setComparator(deviceTableViewerComparator); optionsTable.refresh(); optionsTable.getTable().getColumn(2).setImage(descending); break; case 2: // was descending -> now no sorting optionsTable.setComparator(null); optionsTable.getTable().getColumn(2).setImage(null); break; } // no sorting of option name column optionsTable.getTable().getColumn(1).setImage(null); optionsTableSortState = 0; // set is {0,1,2} // if it becomes 3 it has to be 0 again // but before the state has to be increased to the new state deviceTableSortState = ++deviceTableSortState % 3; LOGGER.debug("new device table sort state: " + deviceTableSortState); } } }
eveCSS/eveCSS
bundles/de.ptb.epics.eve.editor/src/de/ptb/epics/eve/editor/dialogs/monitoroptions/MonitorOptionsDialog.java
Java
epl-1.0
14,825
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="copyright" content="(C) Copyright 2010"/> <meta name="DC.rights.owner" content="(C) Copyright 2010"/> <meta name="DC.Type" content="cxxFile"/> <meta name="DC.Title" content="es_sock.h"/> <meta name="DC.Format" content="XHTML"/> <meta name="DC.Identifier" content="GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97"/> <title>es_sock.h</title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api"/><link rel="stylesheet" type="text/css" href="cxxref.css"/></head> <body class="cxxref" id="GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97"><a name="GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97"><!-- --></a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()">Collapse all</a> <a id="index" href="index.html">Symbian^3 Product Developer Library</a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1">&#160;</div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2437088 id2437096 id2578593 id2611716 id2446904 id2446909 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"><a href="index.html" title="Symbian^3 Product Developer Library">Symbian^3 Product Developer Library</a> &gt;</div> <h1 class="topictitle1">es_sock.h File Reference</h1> <div class="nested1" id="GUID-E9A68C9E-64C4-34A5-894A-3D447DA3360C"><a name="GUID-E9A68C9E-64C4-34A5-894A-3D447DA3360C"><!-- --></a> <h2 class="topictitle2">const TLitC8&lt; sizeof("ESock_Main")&gt; SOCKET_SERVER_MAIN_MODULE_NAME</h2> <table class="signature"><tr><td>const <a href="GUID-A188447C-9DAA-3963-B6F2-893910450FC7.html">TLitC8</a>&lt; sizeof("ESock_Main")&gt;</td><td>SOCKET_SERVER_MAIN_MODULE_NAME</td><td>[static]</td></tr></table><div class="section"><div> <p>Canonical names for the core ESOCKSVR modules </p> </div></div> </div> <div class="nested1" id="GUID-BE0F498E-7478-36E7-A45B-ED68F8B93217"><a name="GUID-BE0F498E-7478-36E7-A45B-ED68F8B93217"><!-- --></a> <h2 class="topictitle2">const TLitC8&lt; sizeof("ESock_IP")&gt; SOCKET_SERVER_IP_MODULE_NAME</h2> <table class="signature"><tr><td>const <a href="GUID-A188447C-9DAA-3963-B6F2-893910450FC7.html">TLitC8</a>&lt; sizeof("ESock_IP")&gt;</td><td>SOCKET_SERVER_IP_MODULE_NAME</td><td>[static]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-41FE4278-FC4C-36F6-B791-4C8F71AC6B86"><a name="GUID-41FE4278-FC4C-36F6-B791-4C8F71AC6B86"><!-- --></a> <h2 class="topictitle2">const TLitC8&lt; sizeof("ESock_Bt")&gt; SOCKET_SERVER_BT_MODULE_NAME</h2> <table class="signature"><tr><td>const <a href="GUID-A188447C-9DAA-3963-B6F2-893910450FC7.html">TLitC8</a>&lt; sizeof("ESock_Bt")&gt;</td><td>SOCKET_SERVER_BT_MODULE_NAME</td><td>[static]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-53B1CA29-FD3A-3BE9-B3DF-638D44D476B3"><a name="GUID-53B1CA29-FD3A-3BE9-B3DF-638D44D476B3"><!-- --></a> <h2 class="topictitle2">const TLitC8&lt; sizeof("ESock_Ir")&gt; SOCKET_SERVER_IR_MODULE_NAME</h2> <table class="signature"><tr><td>const <a href="GUID-A188447C-9DAA-3963-B6F2-893910450FC7.html">TLitC8</a>&lt; sizeof("ESock_Ir")&gt;</td><td>SOCKET_SERVER_IR_MODULE_NAME</td><td>[static]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-86292138-8842-34A4-988E-BA2A1856875C"><a name="GUID-86292138-8842-34A4-988E-BA2A1856875C"><!-- --></a> <h2 class="topictitle2">const TLitC8&lt; sizeof("ESock_SmsWap")&gt; SOCKET_SERVER_SMSWAP_MODULE_NAME</h2> <table class="signature"><tr><td>const <a href="GUID-A188447C-9DAA-3963-B6F2-893910450FC7.html">TLitC8</a>&lt; sizeof("ESock_SmsWap")&gt;</td><td>SOCKET_SERVER_SMSWAP_MODULE_NAME</td><td>[static]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-D6B6C68E-2630-368D-8BAB-9A3F1ADF1813"><a name="GUID-D6B6C68E-2630-368D-8BAB-9A3F1ADF1813"><!-- --></a> <h2 class="topictitle2">const TUint KConnectionUp</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KConnectionUp</td></tr></table><div class="section"><div> <p>Progress Notification to inform clients Connection is up This event has the same numerical values as KLinkLayerOpen which is deprecated </p> </div></div> </div> <div class="nested1" id="GUID-A3A45CF0-0A03-3191-9E5F-B135AD59AD1C"><a name="GUID-A3A45CF0-0A03-3191-9E5F-B135AD59AD1C"><!-- --></a> <h2 class="topictitle2">const TUint KConnectionDown</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KConnectionDown</td></tr></table><div class="section"><div> <p>Progress Notification to inform clients Connection is up This event has the same numerical values as KLinkLayerClosed which is deprecated</p> </div></div> </div> <div class="nested1" id="GUID-12F57170-F2C1-3935-A783-5951EB727B34"><a name="GUID-12F57170-F2C1-3935-A783-5951EB727B34"><!-- --></a> <h2 class="topictitle2">const TUint KESockDefaultMessageSlots</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KESockDefaultMessageSlots</td></tr></table><div class="section"><div> <p>Default number of message slots. </p> </div></div> </div> <div class="nested1" id="GUID-121FB009-1FD2-3645-81E4-283A9870ADBE"><a name="GUID-121FB009-1FD2-3645-81E4-283A9870ADBE"><!-- --></a> <h2 class="topictitle2">const TUint KMaxSubConnectionEventSize</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KMaxSubConnectionEventSize</td></tr></table><div class="section"><div> <p>Size of Maximum SubConnection event</p> <div class="p"> <div class="note"><span class="notetitle">Note:</span> <p>If you allocate this on the heap, remember to delete through the pointer to the buffer and not any pointers to the events held inside it if you change this value, you will alter the function signature and break the .def file </p> </div> </div> </div></div> </div> <div class="nested1" id="GUID-1B59F156-D937-3ED2-A7F8-FA81DEECC463"><a name="GUID-1B59F156-D937-3ED2-A7F8-FA81DEECC463"><!-- --></a> <h2 class="topictitle2">Typedef TSubConnectionUniqueId</h2> <table class="signature"><tr><td>typedef <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a> </td><td>TSubConnectionUniqueId</td></tr></table><div class="section"><div> <p>SubConnection Unique Id</p> <p>THIS API IS TO BE DEPRECATED</p> </div></div> </div> <div class="nested1" id="GUID-31A877AE-A85F-3C3B-B1DF-BBFB51D31BF2"><a name="GUID-31A877AE-A85F-3C3B-B1DF-BBFB51D31BF2"><!-- --></a> <h2 class="topictitle2">Typedef TSubConnectionNotificationBuf</h2> <table class="signature"><tr><td>typedef <a href="GUID-78E993D5-A845-32B4-B41A-947ABEF16AA0.html">TBuf8</a>&lt; <a href="GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97.html">KMaxSubConnectionEventSize</a> &gt;</td><td>TSubConnectionNotificationBuf</td></tr></table><div class="section"><div> <p>Buffer for notification of any change in the state of SubConnection.</p> <p>THIS API IS TO BE DEPRECATED</p> </div></div> </div> <div class="nested1" id="GUID-8B8ECC52-3F56-336D-84BD-2A0D2B334987"><a name="GUID-8B8ECC52-3F56-336D-84BD-2A0D2B334987"><!-- --></a> <h2 class="topictitle2">const TUint KUseEmbeddedUniqueId</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KUseEmbeddedUniqueId</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-9EA7A992-7ABD-3A91-9F95-497940FC4114"><a name="GUID-9EA7A992-7ABD-3A91-9F95-497940FC4114"><!-- --></a> <h2 class="topictitle2">const TUint KConnProgressDefault</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KConnProgressDefault</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-D8F0728B-D4D7-36C3-A858-0D5155841C46"><a name="GUID-D8F0728B-D4D7-36C3-A858-0D5155841C46"><!-- --></a> <h2 class="topictitle2">Typedef TNifProgressBuf</h2> <table class="signature"><tr><td>typedef <a href="GUID-C7A094BD-846F-3ED2-8CCE-C0743DB3712A.html">TPckgBuf</a>&lt; <a href="GUID-883CEFF1-146E-30FF-9AD7-E13D0E9C6183.html">TNifProgress</a> &gt;</td><td>TNifProgressBuf</td></tr></table><div class="section"><div> <p>Buffer for Network Interface Progress</p> </div></div> </div> <div class="nested1" id="GUID-FF1125B1-AA29-3C60-86AE-EFBF39D10F4F"><a name="GUID-FF1125B1-AA29-3C60-86AE-EFBF39D10F4F"><!-- --></a> <h2 class="topictitle2">const TUint KMaxSockAddrSize</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KMaxSockAddrSize</td></tr></table><div class="section"><div> <p>Maximum sockets address size. </p> </div></div> </div> <div class="nested1" id="GUID-FA144C49-FCEB-3780-B47A-A47B558C2B5C"><a name="GUID-FA144C49-FCEB-3780-B47A-A47B558C2B5C"><!-- --></a> <h2 class="topictitle2">const TUint KAFUnspec</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KAFUnspec</td></tr></table><div class="section"><div> <p>Default (unspecified) protocol module. </p> </div></div> </div> <div class="nested1" id="GUID-3B8B65C4-FF08-368B-B8FC-999E2DD1D0E5"><a name="GUID-3B8B65C4-FF08-368B-B8FC-999E2DD1D0E5"><!-- --></a> <h2 class="topictitle2">const TUint KSockStream</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockStream</td></tr></table><div class="section"><div> <p>Stream socket. </p> </div></div> </div> <div class="nested1" id="GUID-070AE44E-CCE6-3408-B488-FF42E068C866"><a name="GUID-070AE44E-CCE6-3408-B488-FF42E068C866"><!-- --></a> <h2 class="topictitle2">const TUint KSockDatagram</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockDatagram</td></tr></table><div class="section"><div> <p>Datagram socket. </p> </div></div> </div> <div class="nested1" id="GUID-5FD8D042-78D3-3432-BC8A-7A9D13A4FD38"><a name="GUID-5FD8D042-78D3-3432-BC8A-7A9D13A4FD38"><!-- --></a> <h2 class="topictitle2">const TUint KSockSeqPacket</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockSeqPacket</td></tr></table><div class="section"><div> <p>Datagrams with sequence numbers. </p> </div></div> </div> <div class="nested1" id="GUID-A8849204-8A62-3671-A52F-B46DB175A0AA"><a name="GUID-A8849204-8A62-3671-A52F-B46DB175A0AA"><!-- --></a> <h2 class="topictitle2">const TUint KSockRaw</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockRaw</td></tr></table><div class="section"><div> <p>Raw socket. </p> </div></div> </div> <div class="nested1" id="GUID-4C74E306-B7B2-31F0-B29A-31031A6E7481"><a name="GUID-4C74E306-B7B2-31F0-B29A-31031A6E7481"><!-- --></a> <h2 class="topictitle2">const TInt KSOLSocket</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KSOLSocket</td></tr></table><div class="section"><div> <p>Generic socket options/commands. </p> </div></div> </div> <div class="nested1" id="GUID-AA9F1762-E985-328C-B3BA-C00AFFDAF7B9"><a name="GUID-AA9F1762-E985-328C-B3BA-C00AFFDAF7B9"><!-- --></a> <h2 class="topictitle2">const TInt KLevelUnspecified</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KLevelUnspecified</td></tr></table><div class="section"><div> <p>Unspecified level. </p> </div></div> </div> <div class="nested1" id="GUID-380B15AD-EDD7-34DA-AD6F-75E45B8015DB"><a name="GUID-380B15AD-EDD7-34DA-AD6F-75E45B8015DB"><!-- --></a> <h2 class="topictitle2">const TUint KSODebug</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSODebug</td></tr></table><div class="section"><div> <p>Debugging enabled or disabled . Values are:</p> <p>(TInt)0. Disabled</p> <p>(TInt)1. Enabled </p> </div></div> </div> <div class="nested1" id="GUID-AC2E51C0-C76B-3E40-9F69-B3BD5DBB9A3C"><a name="GUID-AC2E51C0-C76B-3E40-9F69-B3BD5DBB9A3C"><!-- --></a> <h2 class="topictitle2">const TUint KSORecvBuf</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSORecvBuf</td></tr></table><div class="section"><div> <p>Socket receive buffer size. Values are:</p> <p>KSocketBufSizeUndefined</p> <p>1 to KMaxTUint: explicit buffer size, supplied as a TPckgBuf&lt;TUint&gt; </p> </div></div> </div> <div class="nested1" id="GUID-A6DF4F8A-8EF8-34ED-ABE8-5185AE89C172"><a name="GUID-A6DF4F8A-8EF8-34ED-ABE8-5185AE89C172"><!-- --></a> <h2 class="topictitle2">const TUint KSOSendBuf</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOSendBuf</td></tr></table><div class="section"><div> <p>Socket send buffer size. Values are:</p> <p>KSocketBufSizeUndefined</p> <p>1 to KMaxTUint: explicit buffer size, supplied as a TPckgBuf&lt;TUint&gt; </p> </div></div> </div> <div class="nested1" id="GUID-0502748E-D1E4-3165-BADD-09417D87F881"><a name="GUID-0502748E-D1E4-3165-BADD-09417D87F881"><!-- --></a> <h2 class="topictitle2">const TUint KSONonBlockingIO</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSONonBlockingIO</td></tr></table><div class="section"><div> <p>Socket nonblocking mode. To set, no option values are required. For getting, values are:</p> <p>(TInt)0. Disabled</p> <p>(TInt)1. Enabled </p> </div></div> </div> <div class="nested1" id="GUID-B978C024-5F66-3641-B0DF-FA72BC21A184"><a name="GUID-B978C024-5F66-3641-B0DF-FA72BC21A184"><!-- --></a> <h2 class="topictitle2">const TUint KSOBlockingIO</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOBlockingIO</td></tr></table><div class="section"><div> <p>Socket blocking mode. To set, no values are required. For getting, values are:</p> <p>(TInt)0. Disabled</p> <p>(TInt)1. Enabled </p> </div></div> </div> <div class="nested1" id="GUID-F3C3572B-F3A5-3143-8176-DEB5A84A427A"><a name="GUID-F3C3572B-F3A5-3143-8176-DEB5A84A427A"><!-- --></a> <h2 class="topictitle2">const TUint KSOSelectPoll</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOSelectPoll</td></tr></table><div class="section"><div> <p>Getting only: gets a bitmask of flags describing the read/write/exception status of the socket. Value is a TInt containing a bitmask of socket status (KSockSelectExcept etc.) constants. </p> </div></div> </div> <div class="nested1" id="GUID-97BAB654-0AEC-3533-97B1-2889AEDC7BA2"><a name="GUID-97BAB654-0AEC-3533-97B1-2889AEDC7BA2"><!-- --></a> <h2 class="topictitle2">const TUint KSOReadBytesPending</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOReadBytesPending</td></tr></table><div class="section"><div> <p>Getting only: retrieve the number of bytes currently available for reading. Value is a TInt. </p> </div></div> </div> <div class="nested1" id="GUID-3F91D3E1-5262-38D9-9A14-5998D0552FB0"><a name="GUID-3F91D3E1-5262-38D9-9A14-5998D0552FB0"><!-- --></a> <h2 class="topictitle2">const TUint KSOUrgentDataOffset</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOUrgentDataOffset</td></tr></table><div class="section"><div> <p>Getting only: retrieve the urgent data offset (only for stream protocols that support urgent data). Value is a TInt. </p> </div></div> </div> <div class="nested1" id="GUID-7D75E079-E338-372E-9675-3194417895D3"><a name="GUID-7D75E079-E338-372E-9675-3194417895D3"><!-- --></a> <h2 class="topictitle2">const TUint KSOSelectLastError</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOSelectLastError</td></tr></table><div class="section"><div> <p>Getting only: retrieves the last error. Errors are normally reported by the called method and behaviour is protocol dependent. KSOSelectLastError does not return such errors. Value is a TInt. </p> </div></div> </div> <div class="nested1" id="GUID-629E07AF-A607-3BA8-B6D0-ED05175083E6"><a name="GUID-629E07AF-A607-3BA8-B6D0-ED05175083E6"><!-- --></a> <h2 class="topictitle2">const TUint KSOEnableTransfer</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSOEnableTransfer</td></tr></table><div class="section"><div> <p>Setting only. Enables socket to be transferred to the process with given capabilities. The capabilities set should be supplied as TPckgBuf&lt;TSecurityPolicy&gt;. Each <a href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.html#GUID-6B0CAF7B-0086-3AF8-8706-9BDFA7FBD82A">RSocket::Transfer()</a> call must be enabled by setting this option. </p> </div></div> </div> <div class="nested1" id="GUID-C372F82F-3582-3090-8C6C-73642E4F20D6"><a name="GUID-C372F82F-3582-3090-8C6C-73642E4F20D6"><!-- --></a> <h2 class="topictitle2">const TUint KSODisableTransfer</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSODisableTransfer</td></tr></table><div class="section"><div> <p>Setting only. Disables a socket's possibility to be transferred. No option required. </p> </div></div> </div> <div class="nested1" id="GUID-789674D4-5B9F-3504-A13D-D9CB9E90BB61"><a name="GUID-789674D4-5B9F-3504-A13D-D9CB9E90BB61"><!-- --></a> <h2 class="topictitle2">const TInt KSocketBufSizeUndefined</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KSocketBufSizeUndefined</td></tr></table><div class="section"><div> <p>Use default buffer size. </p> </div></div> </div> <div class="nested1" id="GUID-516A8819-CB56-3016-9BC1-5AC19D027D31"><a name="GUID-516A8819-CB56-3016-9BC1-5AC19D027D31"><!-- --></a> <h2 class="topictitle2">const TInt KSocketDefaultBufferSize</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KSocketDefaultBufferSize</td></tr></table><div class="section"><div> <p>Default buffer size. </p> </div></div> </div> <div class="nested1" id="GUID-42E9D1E4-4354-3B03-A35D-8BB56020AC45"><a name="GUID-42E9D1E4-4354-3B03-A35D-8BB56020AC45"><!-- --></a> <h2 class="topictitle2">const TUint KSocketInternalOptionBit</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSocketInternalOptionBit</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-4443A721-B676-3566-8FD0-2AA71D8BFB79"><a name="GUID-4443A721-B676-3566-8FD0-2AA71D8BFB79"><!-- --></a> <h2 class="topictitle2">const TUint KIOctlSelect</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KIOctlSelect</td></tr></table><div class="section"><div> <p>The aDesc parameter of <a href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.html#GUID-2B45E677-8594-3A1E-A003-01E04C91A30D">RSocket::Ioctl()</a> specifies a TUint containing a bitmask of Socket status constants. The completion status will be the subset of those conditions which is now true for the socket.</p> <p>Used through <a href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.html#GUID-2B45E677-8594-3A1E-A003-01E04C91A30D">RSocket::Ioctl()</a>, with aLevel set to KSOLSocket.</p> <p> <a href="GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97.html#GUID-F3C3572B-F3A5-3143-8176-DEB5A84A427A">KSOSelectPoll</a> parameter to <a href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.html#GUID-41FD432E-DC9E-3AEA-9202-560272B6A353">RSocket::GetOpt()</a>, which allows the current select state of the socket to be read synchronously, and <a href="GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97.html#GUID-7D75E079-E338-372E-9675-3194417895D3">KSOSelectLastError</a>, which returns the error code. </p> </div></div> </div> <div class="nested1" id="GUID-C930B293-B823-3A29-A187-B7F44E03B3CB"><a name="GUID-C930B293-B823-3A29-A187-B7F44E03B3CB"><!-- --></a> <h2 class="topictitle2">const TUint KSockSelectRead</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockSelectRead</td></tr></table><div class="section"><div> <p>Data is available to be read; for listening sockets, a connect is pending. </p> </div></div> </div> <div class="nested1" id="GUID-8F320B16-EC0B-399D-AFE6-BB51B42D3673"><a name="GUID-8F320B16-EC0B-399D-AFE6-BB51B42D3673"><!-- --></a> <h2 class="topictitle2">const TUint KSockSelectWrite</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockSelectWrite</td></tr></table><div class="section"><div> <p>Writing to the socket is not currently blocked by flow-control. </p> </div></div> </div> <div class="nested1" id="GUID-7E5CA941-F27F-3E2A-9087-91288FDD0E4C"><a name="GUID-7E5CA941-F27F-3E2A-9087-91288FDD0E4C"><!-- --></a> <h2 class="topictitle2">const TUint KSockSelectExcept</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockSelectExcept</td></tr></table><div class="section"><div> <p>An error has occurred. </p> </div></div> </div> <div class="nested1" id="GUID-C4EA4395-A77D-31FA-B9F0-DC3E1B5A31B7"><a name="GUID-C4EA4395-A77D-31FA-B9F0-DC3E1B5A31B7"><!-- --></a> <h2 class="topictitle2">const TUint KSockSelectReadContinuation</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockSelectReadContinuation</td></tr></table><div class="section"><div> <p>Include tail of prior read datagram as available data (ie indicates next read will be with read continuation) </p> </div></div> </div> <div class="nested1" id="GUID-0D60E4B7-0E4B-37EB-AA58-906E70C5D473"><a name="GUID-0D60E4B7-0E4B-37EB-AA58-906E70C5D473"><!-- --></a> <h2 class="topictitle2">const TUint KSockWriteUrgent</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockWriteUrgent</td></tr></table><div class="section"><div> <p>The data to be sent is urgent and is given a higher priority than ordinary data in the send queue. KSockWriteUrgent may only be provided as a flag to Send() if the protocol's information flag is marked with KSIUrgentData, otherwise Send() will return with KErrNotSupported. AKA: Out of band or unit data. </p> </div></div> </div> <div class="nested1" id="GUID-0294D795-47F7-3517-A71C-6E3522D6864D"><a name="GUID-0294D795-47F7-3517-A71C-6E3522D6864D"><!-- --></a> <h2 class="topictitle2">const TUint KSocketInternalWriteBit</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSocketInternalWriteBit</td></tr></table><div class="section"><div> <p>Must not be set for client requests. </p> </div></div> </div> <div class="nested1" id="GUID-2638300F-9317-3367-897A-029356F11809"><a name="GUID-2638300F-9317-3367-897A-029356F11809"><!-- --></a> <h2 class="topictitle2">const TUint KSockWriteSystemMask</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockWriteSystemMask</td></tr></table><div class="section"><div> <p>The top 8 bits are reserved for system purposes; protocols must not define these bits. </p> </div></div> </div> <div class="nested1" id="GUID-E32F8D84-BB44-385D-AFF2-7AAB191AC43A"><a name="GUID-E32F8D84-BB44-385D-AFF2-7AAB191AC43A"><!-- --></a> <h2 class="topictitle2">const TUint KSockReadPeek</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockReadPeek</td></tr></table><div class="section"><div> <p>Read data without consuming it, data remains in the receive queue. KSockReadPeek may only be provided as a flag to Recv() if the protocol's information flag is marked with KSIPeekData, otherwise Recv() will return with KErrNotSupported. </p> </div></div> </div> <div class="nested1" id="GUID-7A51E18B-AE51-3A61-9BB9-A5A33FE905B7"><a name="GUID-7A51E18B-AE51-3A61-9BB9-A5A33FE905B7"><!-- --></a> <h2 class="topictitle2">const TUint KSocketInternalReadBit</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSocketInternalReadBit</td></tr></table><div class="section"><div> <p>Must not be set for client requests. </p> </div></div> </div> <div class="nested1" id="GUID-B96D8EFA-D8C2-39A3-911D-A0368FF7D187"><a name="GUID-B96D8EFA-D8C2-39A3-911D-A0368FF7D187"><!-- --></a> <h2 class="topictitle2">const TUint KSockReadContinuation</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSockReadContinuation</td></tr></table><div class="section"><div> <p>Read from datagram in a stream-like fashion (not discarding tails). </p> </div></div> </div> <div class="nested1" id="GUID-82BC1761-8A07-301B-AD1B-1586115BB9B6"><a name="GUID-82BC1761-8A07-301B-AD1B-1586115BB9B6"><!-- --></a> <h2 class="topictitle2">const TUint KSIConnectionLess</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIConnectionLess</td></tr></table><div class="section"><div> <p>The protocol is connectionless. </p> </div></div> </div> <div class="nested1" id="GUID-AAB01DB3-316D-3157-B162-F0BBBECD47B3"><a name="GUID-AAB01DB3-316D-3157-B162-F0BBBECD47B3"><!-- --></a> <h2 class="topictitle2">const TUint KSIReliable</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIReliable</td></tr></table><div class="section"><div> <p>The protocol is reliable. </p> </div></div> </div> <div class="nested1" id="GUID-84FE76DF-36E3-3E12-BE86-24159DC6DEBE"><a name="GUID-84FE76DF-36E3-3E12-BE86-24159DC6DEBE"><!-- --></a> <h2 class="topictitle2">const TUint KSIInOrder</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIInOrder</td></tr></table><div class="section"><div> <p>The protocol guarantees in-order delivery. </p> </div></div> </div> <div class="nested1" id="GUID-A0A222DE-96F3-3A33-9593-0AE92A0D8662"><a name="GUID-A0A222DE-96F3-3A33-9593-0AE92A0D8662"><!-- --></a> <h2 class="topictitle2">const TUint KSIMessageBased</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIMessageBased</td></tr></table><div class="section"><div> <p>The protocol is message based. </p> </div></div> </div> <div class="nested1" id="GUID-B92C2874-0F47-32C1-94BF-B571A2111714"><a name="GUID-B92C2874-0F47-32C1-94BF-B571A2111714"><!-- --></a> <h2 class="topictitle2">const TUint KSIDatagram</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIDatagram</td></tr></table><div class="section"><div> <p>The same as message based. </p> </div></div> </div> <div class="nested1" id="GUID-771E66A2-7FAD-33D0-91C6-B4E750F19FD3"><a name="GUID-771E66A2-7FAD-33D0-91C6-B4E750F19FD3"><!-- --></a> <h2 class="topictitle2">const TUint KSIStreamBased</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIStreamBased</td></tr></table><div class="section"><div> <p>The protocol is stream based. </p> </div></div> </div> <div class="nested1" id="GUID-35FD5638-8966-3CF2-B032-43E4016D82FA"><a name="GUID-35FD5638-8966-3CF2-B032-43E4016D82FA"><!-- --></a> <h2 class="topictitle2">const TUint KSIPseudoStream</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIPseudoStream</td></tr></table><div class="section"><div> <p>The protocol supports a stream like interface but maintains datagram boundaries. </p> </div></div> </div> <div class="nested1" id="GUID-1139E118-C1E6-3AE1-AD13-2648B85B4CB8"><a name="GUID-1139E118-C1E6-3AE1-AD13-2648B85B4CB8"><!-- --></a> <h2 class="topictitle2">const TUint KSIUrgentData</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIUrgentData</td></tr></table><div class="section"><div> <p>The protocol offers an expedited data service. </p> </div></div> </div> <div class="nested1" id="GUID-57363441-2E66-3A00-9577-3034BA262A66"><a name="GUID-57363441-2E66-3A00-9577-3034BA262A66"><!-- --></a> <h2 class="topictitle2">const TUint KSIConnectData</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIConnectData</td></tr></table><div class="section"><div> <p>The protocol can send user data on a connection request. </p> </div></div> </div> <div class="nested1" id="GUID-20A6B3CF-CCC1-337C-9D47-22DF43AFEBD5"><a name="GUID-20A6B3CF-CCC1-337C-9D47-22DF43AFEBD5"><!-- --></a> <h2 class="topictitle2">const TUint KSIDisconnectData</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIDisconnectData</td></tr></table><div class="section"><div> <p>The protocol can send user data on a disconnect request. </p> </div></div> </div> <div class="nested1" id="GUID-32435E48-213E-346A-B70D-9ED3E04B2593"><a name="GUID-32435E48-213E-346A-B70D-9ED3E04B2593"><!-- --></a> <h2 class="topictitle2">const TUint KSIBroadcast</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIBroadcast</td></tr></table><div class="section"><div> <p>The protocol supports broadcast addresses. </p> </div></div> </div> <div class="nested1" id="GUID-B7C730F6-C587-303B-A7CE-2C967E3A0682"><a name="GUID-B7C730F6-C587-303B-A7CE-2C967E3A0682"><!-- --></a> <h2 class="topictitle2">const TUint KSIMultiPoint</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIMultiPoint</td></tr></table><div class="section"><div> <p>The protocol supports point to multi-point connections. </p> </div></div> </div> <div class="nested1" id="GUID-1960CC8E-453C-3D92-9844-E5D89E537131"><a name="GUID-1960CC8E-453C-3D92-9844-E5D89E537131"><!-- --></a> <h2 class="topictitle2">const TUint KSIQOS</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIQOS</td></tr></table><div class="section"><div> <p>The protocol supports a quality of service metric. </p> </div></div> </div> <div class="nested1" id="GUID-5B5EAA5B-AE06-35DC-938F-CD62E836EEEA"><a name="GUID-5B5EAA5B-AE06-35DC-938F-CD62E836EEEA"><!-- --></a> <h2 class="topictitle2">const TUint KSIWriteOnly</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIWriteOnly</td></tr></table><div class="section"><div> <p>The protocol is write only. </p> </div></div> </div> <div class="nested1" id="GUID-BC4EB103-D0ED-3952-9A0B-F83CFF486FE6"><a name="GUID-BC4EB103-D0ED-3952-9A0B-F83CFF486FE6"><!-- --></a> <h2 class="topictitle2">const TUint KSIReadOnly</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIReadOnly</td></tr></table><div class="section"><div> <p>The protocol is read only. </p> </div></div> </div> <div class="nested1" id="GUID-69F91C8F-C478-35B3-A071-F6BEDEF807E6"><a name="GUID-69F91C8F-C478-35B3-A071-F6BEDEF807E6"><!-- --></a> <h2 class="topictitle2">const TUint KSIGracefulClose</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIGracefulClose</td></tr></table><div class="section"><div> <p>The protocol supports graceful close. </p> </div></div> </div> <div class="nested1" id="GUID-D5C0BD8A-8652-3EB2-9BC4-26242E975F73"><a name="GUID-D5C0BD8A-8652-3EB2-9BC4-26242E975F73"><!-- --></a> <h2 class="topictitle2">const TUint KSICanReconnect</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSICanReconnect</td></tr></table><div class="section"><div> <p>The same socket can be reconnected if it disconnects (for whatever reason). </p> </div></div> </div> <div class="nested1" id="GUID-E69C6E58-2589-3742-8532-76B70CE61614"><a name="GUID-E69C6E58-2589-3742-8532-76B70CE61614"><!-- --></a> <h2 class="topictitle2">const TUint KSIPeekData</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIPeekData</td></tr></table><div class="section"><div> <p>Protocol supports peeking (looking at the data without removing it from the protocol). </p> </div></div> </div> <div class="nested1" id="GUID-40ABBD61-466B-3B13-A9AA-610156CAF446"><a name="GUID-40ABBD61-466B-3B13-A9AA-610156CAF446"><!-- --></a> <h2 class="topictitle2">const TUint KSIRequiresOwnerInfo</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIRequiresOwnerInfo</td></tr></table><div class="section"><div> <p>Protocol is to be informed of the identity of the client (i.e. process ID, thread ID and UID) of each SAP (i.e. Socket Service Provider) created. Note that this value has no meaningful interpretation on the client side. <a href="GUID-27D94004-48E6-3BE1-A21A-3A5A98FCC8F1.html#GUID-7E3FB10A-1A14-3E90-9792-18B131DFF63D">KSoOwnerInfo</a> and <a href="GUID-90DEA8D5-DC05-317A-807D-D031D4DEED3D.html#GUID-90DEA8D5-DC05-317A-807D-D031D4DEED3D">TSoOwnerInfo</a> </p> </div></div> </div> <div class="nested1" id="GUID-15E44F15-3A0B-33B2-8697-878152735323"><a name="GUID-15E44F15-3A0B-33B2-8697-878152735323"><!-- --></a> <h2 class="topictitle2">const TUint KSIReserved</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSIReserved</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-17446884-4D06-3AD1-BF75-FA5855421904"><a name="GUID-17446884-4D06-3AD1-BF75-FA5855421904"><!-- --></a> <h2 class="topictitle2">const TUint KNSNameResolution</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSNameResolution</td></tr></table><div class="section"><div> <p>Protocol supports resolving human readable entity names into network addresses (like DNS). </p> </div></div> </div> <div class="nested1" id="GUID-2C161811-0CD9-3FFD-BBD0-EB9C4BEF35F4"><a name="GUID-2C161811-0CD9-3FFD-BBD0-EB9C4BEF35F4"><!-- --></a> <h2 class="topictitle2">const TUint KNSHierarchicalNaming</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSHierarchicalNaming</td></tr></table><div class="section"><div> <p>Network naming is hierarchical. </p> </div></div> </div> <div class="nested1" id="GUID-B41166C1-2D37-313D-BAFD-ACB076157245"><a name="GUID-B41166C1-2D37-313D-BAFD-ACB076157245"><!-- --></a> <h2 class="topictitle2">const TUint KNSHeirarchicalNaming</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSHeirarchicalNaming</td></tr></table><div class="section"><div> <p>Use KNSHierarchicalNaming instead. </p> </div></div> </div> <div class="nested1" id="GUID-73BC3EA7-64BA-3310-A926-D05EEB18F6CB"><a name="GUID-73BC3EA7-64BA-3310-A926-D05EEB18F6CB"><!-- --></a> <h2 class="topictitle2">const TUint KNSRemoteDiscovery</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSRemoteDiscovery</td></tr></table><div class="section"><div> <p>Addressing is dynamic and should be attempted every time before connecting (like IrDA). </p> </div></div> </div> <div class="nested1" id="GUID-89EECE29-50A8-348D-969A-557C496363D8"><a name="GUID-89EECE29-50A8-348D-969A-557C496363D8"><!-- --></a> <h2 class="topictitle2">const TUint KNSServiceResolution</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSServiceResolution</td></tr></table><div class="section"><div> <p>Protocol supports service name to port number resolution. (For example, you can look up TCP to get port 48.) </p> </div></div> </div> <div class="nested1" id="GUID-FF746114-B844-363A-AEEA-7B21EDB7E1DD"><a name="GUID-FF746114-B844-363A-AEEA-7B21EDB7E1DD"><!-- --></a> <h2 class="topictitle2">const TUint KNSNameRegistration</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSNameRegistration</td></tr></table><div class="section"><div> <p>Protocol supports additions to the name database. </p> </div></div> </div> <div class="nested1" id="GUID-5965E50C-DFCE-391E-95D1-37BB4567F1F2"><a name="GUID-5965E50C-DFCE-391E-95D1-37BB4567F1F2"><!-- --></a> <h2 class="topictitle2">const TUint KNSServiceRegistration</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSServiceRegistration</td></tr></table><div class="section"><div> <p>Protocol supports additions to the service database. </p> </div></div> </div> <div class="nested1" id="GUID-15033BBF-AAE2-308E-85FE-92706141E175"><a name="GUID-15033BBF-AAE2-308E-85FE-92706141E175"><!-- --></a> <h2 class="topictitle2">const TUint KNSDynamicAddressing</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSDynamicAddressing</td></tr></table><div class="section"><div> <p>Addressing is dynamic - i.e. name to address mapping may change (like IrDA which randomly chooses machine addresses.) </p> </div></div> </div> <div class="nested1" id="GUID-963CE4E6-9757-31FD-87EC-7B48798720D6"><a name="GUID-963CE4E6-9757-31FD-87EC-7B48798720D6"><!-- --></a> <h2 class="topictitle2">const TUint KNSInfoDatabase</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSInfoDatabase</td></tr></table><div class="section"><div> <p>Protocol has another database which is defined by the protocol. </p> </div></div> </div> <div class="nested1" id="GUID-48DE2351-8635-3951-A0E0-A4D4BB64C40C"><a name="GUID-48DE2351-8635-3951-A0E0-A4D4BB64C40C"><!-- --></a> <h2 class="topictitle2">const TUint KNSRequiresConnectionStartup</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSRequiresConnectionStartup</td></tr></table><div class="section"><div> <p>Protocol may request Socket Server to startup a connection on its behalf (via the KErrCompletion error code) Note that this value has no meaningful interpretation on the client side. </p> </div></div> </div> <div class="nested1" id="GUID-CA899659-5446-3573-BCC2-A7B7486C3137"><a name="GUID-CA899659-5446-3573-BCC2-A7B7486C3137"><!-- --></a> <h2 class="topictitle2">const TUint KNSReserved</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KNSReserved</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-C560C7C3-13E9-323A-A845-8C20D11456D5"><a name="GUID-C560C7C3-13E9-323A-A845-8C20D11456D5"><!-- --></a> <h2 class="topictitle2">const TUint KSocketNoSecurity</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSocketNoSecurity</td></tr></table><div class="section"><div> <p>No security </p> </div></div> </div> <div class="nested1" id="GUID-371441E4-5425-3DC5-B6BA-34629F7336D1"><a name="GUID-371441E4-5425-3DC5-B6BA-34629F7336D1"><!-- --></a> <h2 class="topictitle2">const TUint KSecureSockets</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KSecureSockets</td></tr></table><div class="section"><div> <p>Secure Sockets Layer.</p> <p>CSecureSocket </p> </div></div> </div> <div class="nested1" id="GUID-522AE76A-AF46-3673-8913-9E79F5DED631"><a name="GUID-522AE76A-AF46-3673-8913-9E79F5DED631"><!-- --></a> <h2 class="topictitle2">const TInt KSocketMessageSizeIsStream</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KSocketMessageSizeIsStream</td></tr></table><div class="section"><div> <p>Reads and writes can be of any size: the data is treated as a stream. </p> </div></div> </div> <div class="nested1" id="GUID-AECD1E4E-25DD-33D0-88D7-2602CC9428B4"><a name="GUID-AECD1E4E-25DD-33D0-88D7-2602CC9428B4"><!-- --></a> <h2 class="topictitle2">const TInt KSocketMessageSizeUndefined</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KSocketMessageSizeUndefined</td></tr></table><div class="section"><div> <p>Depends on lower layer or is dynamic. </p> </div></div> </div> <div class="nested1" id="GUID-9F760687-4F31-36CB-8B7F-288CFC4F423D"><a name="GUID-9F760687-4F31-36CB-8B7F-288CFC4F423D"><!-- --></a> <h2 class="topictitle2">const TInt KSocketMessageSizeNoLimit</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KSocketMessageSizeNoLimit</td></tr></table><div class="section"><div> <p>Data is packet-oriented but packets can be of any size (i.e. the remote end must specify a Read of the same size as your Write, but there is no limit on this size.) </p> </div></div> </div> <div class="nested1" id="GUID-F15812FD-9F1B-3FB7-B688-6C93370CEA45"><a name="GUID-F15812FD-9F1B-3FB7-B688-6C93370CEA45"><!-- --></a> <h2 class="topictitle2">const TUint KUndefinedSockType</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KUndefinedSockType</td></tr></table><div class="section"><div> <p>Undefined socket type. </p> </div></div> </div> <div class="nested1" id="GUID-006272C4-ADE0-355D-BE03-5B47DE123356"><a name="GUID-006272C4-ADE0-355D-BE03-5B47DE123356"><!-- --></a> <h2 class="topictitle2">const TUint KUndefinedProtocol</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KUndefinedProtocol</td></tr></table><div class="section"><div> <p>Undefined socket type. Undefined Protocol </p> </div></div> </div> <div class="nested1" id="GUID-E03C01FB-0BC6-3BAA-ACDB-B86A177475B4"><a name="GUID-E03C01FB-0BC6-3BAA-ACDB-B86A177475B4"><!-- --></a> <h2 class="topictitle2">const TUint KUndefinedAddressFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KUndefinedAddressFamily</td></tr></table><div class="section"><div> <p>Undefined address family </p> </div></div> </div> <div class="nested1" id="GUID-B6DCC636-F638-3EB5-B45B-01BB3BC39039"><a name="GUID-B6DCC636-F638-3EB5-B45B-01BB3BC39039"><!-- --></a> <h2 class="topictitle2">Typedef TProtocolName</h2> <table class="signature"><tr><td>typedef <a href="GUID-0B9C8884-6BFF-35E2-AA6F-E4057B85AFCF.html">TBuf</a>&lt; 0x20 &gt;</td><td>TProtocolName</td></tr></table><div class="section"><div> <p>Contains the name of a protocol in structure <a href="GUID-0FB20F20-67EE-3948-B9F6-E1D679AC3D0F.html#GUID-0FB20F20-67EE-3948-B9F6-E1D679AC3D0F">TProtocolDesc</a>. </p> </div></div> </div> <div class="nested1" id="GUID-EEFA4DF7-6AD1-3D89-B903-671F062D4BA3"><a name="GUID-EEFA4DF7-6AD1-3D89-B903-671F062D4BA3"><!-- --></a> <h2 class="topictitle2">Typedef TServiceName</h2> <table class="signature"><tr><td>typedef <a href="GUID-0B9C8884-6BFF-35E2-AA6F-E4057B85AFCF.html">TBuf</a>&lt; 0x20 &gt;</td><td>TServiceName</td></tr></table><div class="section"><div> <p>Defines a descriptor to hold a service name string. </p> </div></div> </div> <div class="nested1" id="GUID-4CF02002-FB24-376F-A84E-B26296539386"><a name="GUID-4CF02002-FB24-376F-A84E-B26296539386"><!-- --></a> <h2 class="topictitle2">Typedef THostName</h2> <table class="signature"><tr><td>typedef <a href="GUID-0B9C8884-6BFF-35E2-AA6F-E4057B85AFCF.html">TBuf</a>&lt; 0x100 &gt;</td><td>THostName</td></tr></table><div class="section"><div> <p>Defines a descriptor to hold a host name string. </p> </div></div> </div> <div class="nested1" id="GUID-4BFA8DC9-4CD7-3E25-9144-3236B01B74DD"><a name="GUID-4BFA8DC9-4CD7-3E25-9144-3236B01B74DD"><!-- --></a> <h2 class="topictitle2">const TInt KErrWouldBlock</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KErrWouldBlock</td></tr></table><div class="section"><div> <p>This error is returned from operations on non-blocking sockets that cannot be completed immediately, for example receive when no data is queued for reading. It is a non-fatal error, and the operation should be retried later. </p> </div></div> </div> <div class="nested1" id="GUID-E963F21F-53FA-33B9-8EFB-97FEB14503B8"><a name="GUID-E963F21F-53FA-33B9-8EFB-97FEB14503B8"><!-- --></a> <h2 class="topictitle2">const TInt KErrConnectionTerminated</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KErrConnectionTerminated</td></tr></table><div class="section"><div> <p>socket errors</p> <p>The value -17210 is taken from the range allocated for Esock (beginning at -17200) A gap has been left between the currently existing vals and this one.</p> </div></div> </div> <div class="nested1" id="GUID-9D558402-B415-3EDA-9A8F-9849122A581F"><a name="GUID-9D558402-B415-3EDA-9A8F-9849122A581F"><!-- --></a> <h2 class="topictitle2">const TInt KErrCannotFindProtocol</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KErrCannotFindProtocol</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-41C04494-150B-3F47-A402-266B23AC4C4E"><a name="GUID-41C04494-150B-3F47-A402-266B23AC4C4E"><!-- --></a> <h2 class="topictitle2">const TInt KErrTierNotFound</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KErrTierNotFound</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-BBB640DA-83D6-3EED-8A90-37BB21F7DEC1"><a name="GUID-BBB640DA-83D6-3EED-8A90-37BB21F7DEC1"><!-- --></a> <h2 class="topictitle2">const TInt KErrConnectionContention</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KErrConnectionContention</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-CF7E3B2D-2975-3206-8356-6DEEB6431BA3"><a name="GUID-CF7E3B2D-2975-3206-8356-6DEEB6431BA3"><!-- --></a> <h2 class="topictitle2">const TInt KErrProtocolNotReady</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KErrProtocolNotReady</td></tr></table><div class="section"><div> <p>The protocol requested for the socket was recognised but was not able to be used. This can happen with protocols that require specific settings to have been prepared prior to the socket being opened.</p> </div></div> </div> <div class="nested1" id="GUID-C46072A3-8C13-3B02-B3A2-782BA2AB0F54"><a name="GUID-C46072A3-8C13-3B02-B3A2-782BA2AB0F54"><!-- --></a> <h2 class="topictitle2">Typedef TSockXfrLength</h2> <table class="signature"><tr><td>typedef <a href="GUID-C7A094BD-846F-3ED2-8CCE-C0743DB3712A.html">TPckgBuf</a>&lt; <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a> &gt;</td><td>TSockXfrLength</td></tr></table><div class="section"><div> <p>Used in <a href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.html#GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0">RSocket</a> read and write calls to pass the length of data read and written. </p> </div></div> </div> <div class="nested1" id="GUID-C625E339-6726-3FB9-8F8A-F4DB0CAC15FF"><a name="GUID-C625E339-6726-3FB9-8F8A-F4DB0CAC15FF"><!-- --></a> <h2 class="topictitle2">Typedef TNameEntry</h2> <table class="signature"><tr><td>typedef <a href="GUID-C7A094BD-846F-3ED2-8CCE-C0743DB3712A.html">TPckgBuf</a>&lt; <a href="GUID-567CF5B5-464F-37B7-A91E-6A672C39BA44.html">TNameRecord</a> &gt;</td><td>TNameEntry</td></tr></table><div class="section"><div> <p>Packages the <a href="GUID-567CF5B5-464F-37B7-A91E-6A672C39BA44.html#GUID-567CF5B5-464F-37B7-A91E-6A672C39BA44">TNameRecord</a> class so that it can be passed between a client and the socket server. </p> </div></div> </div> <div class="nested1" id="GUID-A96CFB63-178C-390C-9363-076D8AAC3A19"><a name="GUID-A96CFB63-178C-390C-9363-076D8AAC3A19"><!-- --></a> <h2 class="topictitle2">Typedef TPortNum</h2> <table class="signature"><tr><td>typedef <a href="GUID-C7A094BD-846F-3ED2-8CCE-C0743DB3712A.html">TPckgBuf</a>&lt; <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a> &gt;</td><td>TPortNum</td></tr></table><div class="section"><div> <p>Port number on service</p> </div></div> </div> <div class="nested1" id="GUID-38ACB980-1CB8-3246-99BA-18CD9E92325B"><a name="GUID-38ACB980-1CB8-3246-99BA-18CD9E92325B"><!-- --></a> <h2 class="topictitle2">const TUint KConnectionTypeDefault</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint</a></td><td>KConnectionTypeDefault</td></tr></table><div class="section"><div> <p>Default connection type </p> </div></div> </div> <div class="nested1" id="GUID-07FEB946-830B-3860-944E-44051698DF3B"><a name="GUID-07FEB946-830B-3860-944E-44051698DF3B"><!-- --></a> <h2 class="topictitle2">const TInt32 KSubConnParamsInterfaceUid</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt32</a></td><td>KSubConnParamsInterfaceUid</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-4CDA196A-120E-32F9-B28D-ADA3D338C5CE"><a name="GUID-4CDA196A-120E-32F9-B28D-ADA3D338C5CE"><!-- --></a> <h2 class="topictitle2">const TInt32 KSubConnEventInterfaceUid</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt32</a></td><td>KSubConnEventInterfaceUid</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-A4B5EAD2-D269-32B1-ABB4-CF2084906560"><a name="GUID-A4B5EAD2-D269-32B1-ABB4-CF2084906560"><!-- --></a> <h2 class="topictitle2">const TInt32 KSubConnGenericParamsImplUid</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt32</a></td><td>KSubConnGenericParamsImplUid</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-1A802E88-B65D-3317-B1B7-602C6D190C0D"><a name="GUID-1A802E88-B65D-3317-B1B7-602C6D190C0D"><!-- --></a> <h2 class="topictitle2">const TInt32 KSubConnGenericEventsImplUid</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt32</a></td><td>KSubConnGenericEventsImplUid</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-2D8B7361-CEE1-36DC-9382-21CF438D4634"><a name="GUID-2D8B7361-CEE1-36DC-9382-21CF438D4634"><!-- --></a> <h2 class="topictitle2">const TUint32 KSubConGlobalFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint32</a></td><td>KSubConGlobalFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-022ECBFB-911A-330B-B197-3BDAE6493981"><a name="GUID-022ECBFB-911A-330B-B197-3BDAE6493981"><!-- --></a> <h2 class="topictitle2">const TUint32 KSubConQoSFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint32</a></td><td>KSubConQoSFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-B2567E44-BD9B-39B3-BB97-385124CFD973"><a name="GUID-B2567E44-BD9B-39B3-BB97-385124CFD973"><!-- --></a> <h2 class="topictitle2">const TUint32 KSubConAuthorisationFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint32</a></td><td>KSubConAuthorisationFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-497DE60D-066A-3194-AC14-FE41AFD749C8"><a name="GUID-497DE60D-066A-3194-AC14-FE41AFD749C8"><!-- --></a> <h2 class="topictitle2">const TUint32 KSubConnCallDescrParamsFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint32</a></td><td>KSubConnCallDescrParamsFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-EF965635-F843-3A0E-A7D2-FF003E338EA9"><a name="GUID-EF965635-F843-3A0E-A7D2-FF003E338EA9"><!-- --></a> <h2 class="topictitle2">const TUint32 KSubConnContextDescrParamsFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint32</a></td><td>KSubConnContextDescrParamsFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-A714DEB6-5131-3CFA-896B-935692D2BC4D"><a name="GUID-A714DEB6-5131-3CFA-896B-935692D2BC4D"><!-- --></a> <h2 class="topictitle2">const TUint32 KSubConIPAddressInfoFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint32</a></td><td>KSubConIPAddressInfoFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-F1B6487F-EAE4-327C-81E1-93306BF4B75A"><a name="GUID-F1B6487F-EAE4-327C-81E1-93306BF4B75A"><!-- --></a> <h2 class="topictitle2">const TInt32 KProtocolExtensionFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt32</a></td><td>KProtocolExtensionFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-89FBAC37-C887-3B4C-A7CB-D82B7EC82F55"><a name="GUID-89FBAC37-C887-3B4C-A7CB-D82B7EC82F55"><!-- --></a> <h2 class="topictitle2">const TInt32 KFlowParametersFamily</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt32</a></td><td>KFlowParametersFamily</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-AE9A9CD5-02CA-322F-8552-768F715AC870"><a name="GUID-AE9A9CD5-02CA-322F-8552-768F715AC870"><!-- --></a> <h2 class="topictitle2">const TInt KNotificationEventMaxSize</h2> <table class="signature"><tr><td>const <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TInt</a></td><td>KNotificationEventMaxSize</td></tr></table><div class="section"></div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/GUID-51E6EBC3-D654-3274-9CD0-91EF3B224C97.html
HTML
epl-1.0
57,796
/* ========================================== * JGraphT : a free Java graph-theory library * ========================================== * * Project Info: http://jgrapht.sourceforge.net/ * Project Creator: Barak Naveh (http://sourceforge.net/users/barak_naveh) * * (C) Copyright 2003-2009, by Barak Naveh and Contributors. * * This program and the accompanying materials are dual-licensed under * either * * (a) the terms of the GNU Lesser General Public License version 2.1 * as published by the Free Software Foundation, or (at your option) any * later version. * * or (per the licensee's choosing) * * (b) the terms of the Eclipse Public License v1.0 as published by * the Eclipse Foundation. */ /* ------------------------- * TestEdge.java * ------------------------- * (C) Copyright 2003-2016, by Christoph Zauner and Contributors * * Original Author: Christoph Zauner * * $Id$ * * Changes * ------- * */ package org.jgrapht.graph; import org.jgrapht.graph.DefaultEdge; /** * {@link org.jgrapht.graph.DefaultEdge} does not implement hashCode() or * equals(). Therefore comparing two graphs does not work as expected out of the * box. * * @author Christoph Zauner */ public class TestEdge extends DefaultEdge { private static final long serialVersionUID = 1L; public TestEdge() { super(); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode()); result = prime * result + ((getTarget() == null) ? 0 : getTarget().hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TestEdge other = (TestEdge) obj; if (getSource() == null) { if (other.getSource() != null) return false; } else if (!getSource().equals(other.getSource())) return false; if (getTarget() == null) { if (other.getTarget() != null) return false; } else if (!getTarget().equals(other.getTarget())) return false; return true; } } //End TestEdge.java
arcanefoam/jgrapht
jgrapht-core/src/test/java/org/jgrapht/graph/TestEdge.java
Java
epl-1.0
2,403
/******************************************************************************* * Copyright (c) 2017-2019 DocDoku. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * DocDoku - initial API and implementation *******************************************************************************/ package org.polarsys.eplmp.server.indexer; import io.searchbox.client.JestClient; import io.searchbox.client.JestResult; import io.searchbox.core.*; import io.searchbox.indices.CreateIndex; import io.searchbox.indices.IndicesExists; import io.searchbox.indices.template.PutTemplate; import io.searchbox.params.SearchType; import org.apache.commons.io.IOUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.polarsys.eplmp.core.exceptions.IndexerNotAvailableException; import org.polarsys.eplmp.core.exceptions.IndexerRequestException; import org.polarsys.eplmp.server.indexer.config.IndexerConfig; import org.polarsys.eplmp.server.indexer.util.IndexerMapping; import org.polarsys.eplmp.server.indexer.util.IndicesUtils; import javax.annotation.PostConstruct; import javax.ejb.Singleton; import javax.inject.Inject; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.logging.Level; import java.util.logging.Logger; /** * Class responsible for indexes and templates creation * * @author Morgan Guimard */ @Singleton(name = "IndexManagerBean") public class IndexManagerBean { @Inject private IndexerConfig config; @Inject private IndicesUtils indicesUtils; @Inject private JestClient esClient; private static final Logger LOGGER = Logger.getLogger(IndexManagerBean.class.getName()); public IndexManagerBean() { } @PostConstruct public void init(){ try { initTemplate(IndexerMapping.EPLMP_COMMON, IndexerMapping.COMMON_TEMPLATE); initTemplate(IndexerMapping.EPLMP_DOCUMENTS, IndexerMapping.DOCUMENT_TEMPLATE); initTemplate(IndexerMapping.EPLMP_PARTS, IndexerMapping.PART_TEMPLATE); } catch (IndexerNotAvailableException | IndexerRequestException e) { LOGGER.log(Level.WARNING, "Error while creating templates", e); } } /** * Create documents and parts indexes * * @param workspaceId * @throws IndexerRequestException * @throws IndexerNotAvailableException */ public void createIndices(String workspaceId) throws IndexerRequestException, IndexerNotAvailableException { createIndex(indicesUtils.getIndexName(workspaceId, IndexerMapping.INDEX_DOCUMENTS)); createIndex(indicesUtils.getIndexName(workspaceId, IndexerMapping.INDEX_PARTS)); } /** * Delete documents and parts indexes * * @param workspaceId * @throws IndexerNotAvailableException * @throws IndexerRequestException */ public void deleteIndices(String workspaceId) throws IndexerNotAvailableException, IndexerRequestException { deleteIndex(indicesUtils.getIndexName(workspaceId, IndexerMapping.INDEX_DOCUMENTS)); deleteIndex(indicesUtils.getIndexName(workspaceId, IndexerMapping.INDEX_PARTS)); } /** * Removes an entry from elasticsearch * * @param indexName * @param id * @throws IndexerNotAvailableException * @throws IndexerRequestException */ public void executeRemove(String indexName, String id) throws IndexerNotAvailableException, IndexerRequestException { Delete deleteRequest = new Delete.Builder(id) .index(indexName) .type(IndexerMapping.TYPE) .build(); DocumentResult result; try { result = esClient.execute(deleteRequest); if (!result.isSucceeded()) { LOGGER.log(Level.WARNING, "Cannot delete document " + id + " in index " + indexName + ": " + result.getErrorMessage()); throw new IndexerRequestException(result.getErrorMessage()); } } catch (IOException e) { throw new IndexerNotAvailableException(); } } /** * Execute a search query * * @param indexName * @param query * @param from * @param size * @return * @throws IndexerNotAvailableException * @throws IndexerRequestException */ public SearchResult executeSearch(String indexName, QueryBuilder query, int from, int size) throws IndexerNotAvailableException, IndexerRequestException { try { LOGGER.log(Level.INFO, "ElasticSearchQuery:\n" + query.toString()); SearchResult searchResult = esClient.execute(new Search.Builder( new SearchSourceBuilder() .query(query) .from(from) .size(size) .toString()) .addIndex(indexName) .addType(IndexerMapping.TYPE) .setSearchType(SearchType.QUERY_THEN_FETCH) .build() ); if (!searchResult.isSucceeded()) { String reason = searchResult.getErrorMessage(); LOGGER.log(Level.SEVERE, reason); throw new IndexerRequestException(reason); } return searchResult; } catch (IOException e) { LOGGER.log(Level.WARNING, "Search request failed: " + e.getMessage()); throw new IndexerNotAvailableException(); } } /** * Sends an bulk query * * @param bulk * @return * @throws IndexerNotAvailableException * @throws IndexerRequestException */ public BulkResult sendBulk(Bulk.Builder bulk) throws IndexerNotAvailableException, IndexerRequestException { try { return esClient.execute(bulk.build()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to send bulk request \n " + e.getMessage()); LOGGER.log(Level.WARNING, "Search request failed: " + e.getMessage()); throw new IndexerNotAvailableException(); } } /** * Executes an update request * * @param update * @return * @throws IndexerNotAvailableException * @throws IndexerRequestException */ public DocumentResult executeUpdate(Update.Builder update) throws IndexerNotAvailableException, IndexerRequestException { try { return esClient.execute(update.build()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to send bulk request \n " + e.getMessage()); LOGGER.log(Level.WARNING, "Search request failed: " + e.getMessage()); throw new IndexerNotAvailableException(); } } /** * Know if an index exists or not * * @param workspaceId * @return * @throws IndexerNotAvailableException */ public boolean indicesExist(String workspaceId) throws IndexerNotAvailableException { return indexExists(indicesUtils.getIndexName(workspaceId, IndexerMapping.INDEX_DOCUMENTS)) || indexExists(indicesUtils.getIndexName(workspaceId, IndexerMapping.INDEX_PARTS)); } private boolean indexExists(String indexName) throws IndexerNotAvailableException { IndicesExists indicesExistsRequest = new IndicesExists.Builder(indexName).build(); try { JestResult execute = esClient.execute(indicesExistsRequest); return execute.isSucceeded(); } catch (IOException e) { throw new IndexerNotAvailableException(); } } private void initTemplate(String name, String resourcePath) throws IndexerNotAvailableException, IndexerRequestException { try(InputStream inputStream = getClass().getResourceAsStream(resourcePath)){ byte[] bytes = IOUtils.toByteArray(inputStream); String source = new String(bytes, StandardCharsets.UTF_8); JestResult result; try { result = esClient.execute(new PutTemplate.Builder(name, source).build()); } catch (IOException e) { throw new IndexerNotAvailableException(); } if (!result.isSucceeded()) { LOGGER.log(Level.WARNING, "Cannot create template " + name +": " + result.getErrorMessage()); }else{ LOGGER.log(Level.INFO, "Template " + name + " created"); } } catch (IOException e) { throw new IndexerRequestException(e.getMessage()); } } private void createIndex(String indexName) throws IndexerNotAvailableException, IndexerRequestException { Settings settings = Settings.builder().build(); JestResult result; try { result = esClient.execute(new CreateIndex.Builder(indexName).settings(settings.toString()).build()); } catch (IOException e) { throw new IndexerNotAvailableException(); } if (!result.isSucceeded()) { LOGGER.log(Level.WARNING, "Cannot create index" + indexName + ": " + result.getErrorMessage()); throw new IndexerRequestException(result.getErrorMessage()); } } private void deleteIndex(String indexName) throws IndexerNotAvailableException, IndexerRequestException { if(!indexExists(indexName)){ LOGGER.log(Level.FINE, "Index " + indexName + " cannot be deleted as it does not exists"); return; } try { DocumentResult result = esClient.execute(new Delete.Builder(indexName).build()); if (!result.isSucceeded()) { LOGGER.log(Level.WARNING, "Cannot delete index [" + indexName + "] : " + result.getErrorMessage()); throw new IndexerRequestException(result.getErrorMessage()); } } catch (IOException e) { throw new IndexerNotAvailableException(); } } }
polarsys/eplmp
eplmp-server/eplmp-server-ejb/src/main/java/org/polarsys/eplmp/server/indexer/IndexManagerBean.java
Java
epl-1.0
10,455
#include<vector> using namespace std; class Solution { public: void sortColors(vector<int>& nums) { int left_ptr = 0; int right_ptr = nums.size() - 1; int next = 0; while(next <= right_ptr) { if (nums[next] == 0) { int tmp = nums[next]; nums[next] = nums[left_ptr]; nums[left_ptr] = tmp; left_ptr += 1; } else if (nums[next] == 2) { int tmp = nums[next]; nums[next] = nums[right_ptr]; nums[right_ptr] = tmp; right_ptr--; next--; } next += 1; } } }; int main() { Solution s; return 0; }
zhiyu-he/algorithm-trip
growth/oj/leet_code/algorithms/75-sort-colors.cpp
C++
gpl-2.0
743
/* * RetroDeLuxe Engine for MSX * * Copyright (C) 2020 Enric Martin Geijo (retrodeluxemsx@gmail.com) * * RDLEngine 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, version 2. * * 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/>. * */ #ifndef _BLIT_H_ #define _BLIT_H_ /** * Defines a BlitSet */ typedef struct BlitSet BlitSet; /** * Contents of a BlitSet */ struct BlitSet { /** * BlitSet width in pixels */ uint16_t w; /** * BlitSet height in pixels */ uint8_t h; /** * Pointer to the BlitSet bitmap data */ uint8_t *bitmap; /** * page of the BlitSet once allocated into VRAM */ uint8_t page; /** * x Position of the BlitSet once allocated into VRAM */ uint16_t xpos; /** * y Position of the BlitSet once allocated into VRAM */ uint16_t ypos; /** * True if the BlitSet is allocated in VRAM */ bool allocated; /** * True if the BlitSet data is not compressed */ bool raw; /** * Animation frame width in pixels */ uint8_t frame_w; /** * Animation frame height in pixels */ uint8_t frame_h; /** * Number of animation frames per state (regular) */ uint8_t frames; /** * Number of animation states within the set */ uint8_t states; }; /** * Defines a BlitObject */ typedef struct BlitObject BlitObject; /** * Contens of a BlitObject */ struct BlitObject { /** * Screen X position in pixel coordinates */ uint16_t x; /** * Screen Y position in pixel coordinates */ uint16_t y; /** * Previous screen X position in pixel coordinates */ uint16_t prev_x; /** * Previous screen Y position in pixel coordinates */ uint16_t prev_y; /** * mask X position in pixel coordinates */ uint16_t mask_x; /** * mask Y position in pixel coordinates */ uint16_t mask_y; /** * mask page */ uint8_t mask_page; /** * Current animation state */ uint8_t state; /** * Current animation frame */ uint8_t frame; /** * Animation counter */ uint8_t anim_ctr; /** * Current animation state for composite objects */ uint8_t state2; /** * Current animation frame for composite objects */ uint8_t frame2; /** * X offset of blitset2 */ int8_t offsetx2; /** * y offset of blitset2 */ int8_t offsety2; /** * BlitSet data */ BlitSet *blitset; /** * BlitSet data */ BlitSet *blitset2; }; /** * Initialize a Static BlitSet * * :param TS: a BlitSet object * :param DATA: name of data asset */ #define INIT_BLIT_SET(TS, DATA, W, H) \ (TS).w = DATA##_bitmap_w; \ (TS).h = DATA##_bitmap_h; \ (TS).bitmap = DATA##_bitmap; \ (TS).allocated = false; \ (TS).frame_w = W; \ (TS).frame_h = H; \ (TS).raw = false; /** * Initialize a Dynamic BlitSet * * :param TS: a BlitSet object * :param DATA: name of data asset * :param W: frame width of the blitset in pixels * :param H: frame heigth of the blitset in pixels * :param F: number of frames per state * :param S: number of states */ #define INIT_DYNAMIC_BLIT_SET(TS, DATA, W, H, F, S) \ (TS).w = DATA##_bitmap_w; \ (TS).h = DATA##_bitmap_h; \ (TS).bitmap = DATA##_bitmap; \ (TS).allocated = false; \ (TS).frame_w = W; \ (TS).frame_h = H; \ (TS).frames = F; \ (TS).states = S; \ (TS).raw = false; extern void blit_init(); extern rle_result blit_set_valloc(BlitSet *blitset); extern void blit_set_vfree(BlitSet *blitset); extern void blit_set_to_vram(BlitSet *blitset, uint8_t page, uint16_t xpos, uint16_t ypos) __nonbanked; extern void blit_object_show(BlitObject *blitobject) __nonbanked; extern void blit_object_hide(BlitObject *blitobject) __nonbanked; extern void blit_object_update(BlitObject *blitobject) __nonbanked; extern void blit_map_tilebuffer(uint8_t *buffer, BlitSet *bs, uint8_t page) __nonbanked; #endif /* _BLIT_H_ */
retrodeluxe/rlengine-msx1
engine/include/blit.h
C
gpl-2.0
5,201
<?php /** * @package Joomla.Site * @subpackage com_content * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); $lang = JFactory::getLanguage(); $class = ' class="first"'; ?> <?php if (count($this->children[$this->category->id]) > 0) : ?> <?php foreach ($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->getNumItems(true) || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) : $class = ' class="last"'; endif; ?> <div<?php echo $class; ?>> <?php $class = ''; ?> <?php if ($lang->isRTL()) : ?> <h3 class="page-header item-title"> <?php if ( $this->params->get('show_cat_num_articles', 1)) : ?> <span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::tooltipText('COM_CONTENT_NUM_ITEMS'); ?>"> <?php echo $child->getNumItems(true); ?> </span> <?php endif; ?> <a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> <?php if (count($child->getChildren()) > 0) : ?> <a href="#category-<?php echo $child->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a> <?php endif;?> </h3> <?php else : ?> <h3 class="page-header item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> <?php if ( $this->params->get('show_cat_num_articles', 1)) : ?> <span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::tooltipText('COM_CONTENT_NUM_ITEMS'); ?>"> <?php echo $child->getNumItems(true); ?> </span> <?php endif; ?> <?php if (count($child->getChildren()) > 0) : ?> <a href="#category-<?php echo $child->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a> <?php endif;?> <?php endif;?> </h3> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_content.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if (count($child->getChildren()) > 0) :?> <div class="collapse fade" id="category-<?php echo $child->id;?>"> <?php $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; if ($this->maxLevel != 0) : echo $this->loadTemplate('children'); endif; $this->category = $child->getParent(); $this->maxLevel++; ?> </div> <?php endif; ?> <div class="children_test"></div> </div> <?php endif; ?> <?php endforeach; ?> <?php endif; ?>
6finger/ci
templates/protostar/html/com_content/category/default_children.php
PHP
gpl-2.0
3,056
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'SystemStats' db.create_table('core_systemstats', ( ('date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), ('revision', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), ('stats', self.gf('pykeg.core.jsonfield.JSONField')(default='{}')), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['core.KegbotSite'])), )) db.send_create_signal('core', ['SystemStats']) def backwards(self, orm): # Deleting model 'SystemStats' db.delete_table('core_systemstats') models = { 'auth.group': { 'Meta': {'object_name': 'Group'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, 'auth.permission': { 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, 'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, 'beerdb.beerimage': { 'Meta': {'object_name': 'BeerImage'}, 'added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'edited': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}), 'num_views': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'original_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), 'revision': ('django.db.models.fields.IntegerField', [], {'default': '0'}) }, 'beerdb.beerstyle': { 'Meta': {'object_name': 'BeerStyle'}, 'added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'edited': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'revision': ('django.db.models.fields.IntegerField', [], {'default': '0'}) }, 'beerdb.beertype': { 'Meta': {'object_name': 'BeerType'}, 'abv': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), 'added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'brewer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['beerdb.Brewer']"}), 'calories_oz': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), 'carbs_oz': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), 'edited': ('django.db.models.fields.DateTimeField', [], {}), 'edition': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}), 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'beers'", 'null': 'True', 'to': "orm['beerdb.BeerImage']"}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'original_gravity': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), 'revision': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'specific_gravity': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), 'style': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['beerdb.BeerStyle']"}) }, 'beerdb.brewer': { 'Meta': {'object_name': 'Brewer'}, 'added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'country': ('pykeg.core.fields.CountryField', [], {'default': "'USA'", 'max_length': '3'}), 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}), 'edited': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.CharField', [], {'max_length': '36', 'primary_key': 'True'}), 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'brewers'", 'null': 'True', 'to': "orm['beerdb.BeerImage']"}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'origin_city': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'null': 'True', 'blank': 'True'}), 'origin_state': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'null': 'True', 'blank': 'True'}), 'production': ('django.db.models.fields.CharField', [], {'default': "'commercial'", 'max_length': '128'}), 'revision': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'null': 'True', 'blank': 'True'}) }, 'contenttypes.contenttype': { 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, 'core.authenticationtoken': { 'Meta': {'unique_together': "(('site', 'seqn', 'auth_device', 'token_value'),)", 'object_name': 'AuthenticationToken'}, 'auth_device': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), 'expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'pin': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tokens'", 'to': "orm['core.KegbotSite']"}), 'token_value': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) }, 'core.bac': { 'Meta': {'object_name': 'BAC'}, 'bac': ('django.db.models.fields.FloatField', [], {}), 'drink': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Drink']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'rectime': ('django.db.models.fields.DateTimeField', [], {}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) }, 'core.config': { 'Meta': {'object_name': 'Config'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'configs'", 'to': "orm['core.KegbotSite']"}), 'value': ('django.db.models.fields.TextField', [], {}) }, 'core.drink': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'Drink'}, 'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}), 'duration': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), 'endtime': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'keg': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'drinks'", 'null': 'True', 'to': "orm['core.Keg']"}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'session': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'drinks'", 'null': 'True', 'to': "orm['core.DrinkingSession']"}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'drinks'", 'to': "orm['core.KegbotSite']"}), 'starttime': ('django.db.models.fields.DateTimeField', [], {}), 'status': ('django.db.models.fields.CharField', [], {'default': "'valid'", 'max_length': '128'}), 'ticks': ('django.db.models.fields.PositiveIntegerField', [], {}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'drinks'", 'null': 'True', 'to': "orm['auth.User']"}), 'volume_ml': ('django.db.models.fields.FloatField', [], {}) }, 'core.drinkingsession': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'DrinkingSession'}, 'endtime': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessions'", 'to': "orm['core.KegbotSite']"}), 'slug': ('autoslug.fields.AutoSlugField', [], {'unique_with': '()', 'max_length': '50', 'blank': 'True', 'null': 'True', 'populate_from': 'None', 'db_index': 'True'}), 'starttime': ('django.db.models.fields.DateTimeField', [], {}), 'volume_ml': ('django.db.models.fields.FloatField', [], {'default': '0'}) }, 'core.keg': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'Keg'}, 'description': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}), 'enddate': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'origcost': ('django.db.models.fields.FloatField', [], {'default': '0', 'null': 'True', 'blank': 'True'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'kegs'", 'to': "orm['core.KegbotSite']"}), 'size': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegSize']"}), 'startdate': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'status': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['beerdb.BeerType']"}) }, 'core.kegbotsite': { 'Meta': {'object_name': 'KegbotSite'}, 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}) }, 'core.kegsessionchunk': { 'Meta': {'unique_together': "(('session', 'keg'),)", 'object_name': 'KegSessionChunk'}, 'endtime': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'keg': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'keg_session_chunks'", 'null': 'True', 'to': "orm['core.Keg']"}), 'session': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'keg_chunks'", 'to': "orm['core.DrinkingSession']"}), 'starttime': ('django.db.models.fields.DateTimeField', [], {}), 'volume_ml': ('django.db.models.fields.FloatField', [], {'default': '0'}) }, 'core.kegsize': { 'Meta': {'object_name': 'KegSize'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'volume_ml': ('django.db.models.fields.FloatField', [], {}) }, 'core.kegstats': { 'Meta': {'object_name': 'KegStats'}, 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'keg': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stats'", 'unique': 'True', 'to': "orm['core.Keg']"}), 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegbotSite']"}), 'stats': ('pykeg.core.jsonfield.JSONField', [], {'default': "'{}'"}) }, 'core.kegtap': { 'Meta': {'object_name': 'KegTap'}, 'current_keg': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Keg']", 'null': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'max_tick_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '100'}), 'meter_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'ml_per_tick': ('django.db.models.fields.FloatField', [], {'default': '0.45454545454545453'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegbotSite']"}), 'temperature_sensor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.ThermoSensor']", 'null': 'True', 'blank': 'True'}) }, 'core.relaylog': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'RelayLog'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'relaylogs'", 'to': "orm['core.KegbotSite']"}), 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'time': ('django.db.models.fields.DateTimeField', [], {}) }, 'core.sessionchunk': { 'Meta': {'unique_together': "(('session', 'user', 'keg'),)", 'object_name': 'SessionChunk'}, 'endtime': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'keg': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'session_chunks'", 'null': 'True', 'to': "orm['core.Keg']"}), 'session': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'chunks'", 'to': "orm['core.DrinkingSession']"}), 'starttime': ('django.db.models.fields.DateTimeField', [], {}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'session_chunks'", 'null': 'True', 'to': "orm['auth.User']"}), 'volume_ml': ('django.db.models.fields.FloatField', [], {'default': '0'}) }, 'core.sessionstats': { 'Meta': {'object_name': 'SessionStats'}, 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'session': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stats'", 'unique': 'True', 'to': "orm['core.DrinkingSession']"}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegbotSite']"}), 'stats': ('pykeg.core.jsonfield.JSONField', [], {'default': "'{}'"}) }, 'core.systemevent': { 'Meta': {'object_name': 'SystemEvent'}, 'drink': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'events'", 'null': 'True', 'to': "orm['core.Drink']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'keg': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'events'", 'null': 'True', 'to': "orm['core.Keg']"}), 'kind': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'session': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'events'", 'null': 'True', 'to': "orm['core.DrinkingSession']"}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegbotSite']"}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'events'", 'null': 'True', 'to': "orm['auth.User']"}), 'when': ('django.db.models.fields.DateTimeField', [], {}) }, 'core.systemstats': { 'Meta': {'object_name': 'SystemStats'}, 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegbotSite']"}), 'stats': ('pykeg.core.jsonfield.JSONField', [], {'default': "'{}'"}) }, 'core.thermolog': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'Thermolog'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'sensor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.ThermoSensor']"}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'thermologs'", 'to': "orm['core.KegbotSite']"}), 'temp': ('django.db.models.fields.FloatField', [], {}), 'time': ('django.db.models.fields.DateTimeField', [], {}) }, 'core.thermosensor': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'ThermoSensor'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'nice_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '256'}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'thermosensors'", 'to': "orm['core.KegbotSite']"}) }, 'core.thermosummarylog': { 'Meta': {'unique_together': "(('site', 'seqn'),)", 'object_name': 'ThermoSummaryLog'}, 'date': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'max_temp': ('django.db.models.fields.FloatField', [], {}), 'mean_temp': ('django.db.models.fields.FloatField', [], {}), 'min_temp': ('django.db.models.fields.FloatField', [], {}), 'num_readings': ('django.db.models.fields.PositiveIntegerField', [], {}), 'period': ('django.db.models.fields.CharField', [], {'default': "'daily'", 'max_length': '64'}), 'sensor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.ThermoSensor']"}), 'seqn': ('django.db.models.fields.PositiveIntegerField', [], {}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'thermosummarylogs'", 'to': "orm['core.KegbotSite']"}) }, 'core.userpicture': { 'Meta': {'object_name': 'UserPicture'}, 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) }, 'core.userprofile': { 'Meta': {'object_name': 'UserProfile'}, 'gender': ('django.db.models.fields.CharField', [], {'max_length': '8'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'mugshot': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.UserPicture']", 'null': 'True', 'blank': 'True'}), 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}), 'weight': ('django.db.models.fields.FloatField', [], {}) }, 'core.usersessionchunk': { 'Meta': {'unique_together': "(('session', 'user'),)", 'object_name': 'UserSessionChunk'}, 'endtime': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'session': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_chunks'", 'to': "orm['core.DrinkingSession']"}), 'starttime': ('django.db.models.fields.DateTimeField', [], {}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'user_session_chunks'", 'null': 'True', 'to': "orm['auth.User']"}), 'volume_ml': ('django.db.models.fields.FloatField', [], {'default': '0'}) }, 'core.userstats': { 'Meta': {'object_name': 'UserStats'}, 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.KegbotSite']"}), 'stats': ('pykeg.core.jsonfield.JSONField', [], {'default': "'{}'"}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stats'", 'unique': 'True', 'to': "orm['auth.User']"}) } } complete_apps = ['core']
Alwnikrotikz/kegbot
pykeg/src/pykeg/core/migrations/0047_add_system_stats.py
Python
gpl-2.0
26,712
/* Returning to this after a mont or two, it was incredibly hard to work out * Let's see: a certain site undergoes changes of base. Each change can be seen as a jump, and we don't know how many * jumps there will per site. Normally the number of positions coming from the jumps would be one more than * the number of jumps, but in this cas,e the final position is actually known, because cute off the sites development * after a fixed time. This means that the number of positions and the number of changes (i.e. bases adopted) is the same */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <sys/time.h> #define BUF 8 #define GBUF 8 #define WBUF 8 unsigned mconsump=0; /* memory consumption: global for memory accounting */ typedef unsigned char boole; typedef enum /* simple enum to hold our four bases */ { A, C, G, T } base; typedef struct /* our definition of a site is a struct */ { int currp; /* curr num of jumps: also uses as index to posarr[], i.e. gives the size of posarr */ int jbf; /* buffer allow for jumps */ float mxdisp; /* current maximum displacement */ float *posarr; /* the array of position values: to be a cumulative */ base *brec; /* the array of past and current bases: one less than total of posarr */ base latestb; /* the next base */ char starsymb; /* the starting symbol (character) */ char endsymb; /* the end symb */ } sitedef;/* our definition of a site is a struct */ void usage(void) { printf("Usage. Pls supply 3 or 4 arguments:\n"); printf("\t1) name of text file with matrix.\n"); printf("\t2) number of sites.\n"); printf("\t3) branch length limit, i.e. duration of simulation: 0.1 is small, 10 big, 1000 very big.\n"); printf("\t4) (optional, if not supplied, a random seed will be generated) specified random number seed.\n"); } typedef struct /* wseq_t */ { size_t *wln; size_t wsbuf; size_t quan; size_t lbuf; /* a buffer for the number of lines */ size_t numl; /* number of lines, i.e. rows */ size_t *wpla; /* words per line array: the number of words on each line */ } wseq_t; wseq_t *create_wseq_t(size_t initsz) { wseq_t *words=malloc(sizeof(wseq_t)); words->wsbuf = initsz; words->quan = initsz; words->wln=calloc(words->wsbuf, sizeof(size_t)); words->lbuf=WBUF; words->numl=0; words->wpla=calloc(words->lbuf, sizeof(size_t)); return words; } void free_wseq(wseq_t *wa) { free(wa->wln); free(wa->wpla); free(wa); } float *processinpf(char *fname, int *m, int *n) { /* In order to make no assumptions, the file is treated as lines containing the same amount of words each, * except for lines starting with #, which are ignored (i.e. comments). These words are checked to make sure they contain only floating number-type * characters [0123456789+-.] only, one string variable is icontinually written over and copied into a growing floating point array each time */ /* declarations */ FILE *fp=fopen(fname,"r"); int i; size_t couc /*count chars per line */, couw=0 /* count words */, oldcouw = 0; int c; boole inword=0; wseq_t *wa=create_wseq_t(GBUF); size_t bwbuf=WBUF; char *bufword=calloc(bwbuf, sizeof(char)); /* this is the string we'll keep overwriting. */ float *mat=malloc(GBUF*sizeof(float)); while( (c=fgetc(fp)) != EOF) { /* take care of */ if( (c== '\n') | (c == ' ') | (c == '\t') | (c=='#')) { if( inword==1) { /* we end a word */ wa->wln[couw]=couc; bufword[couc++]='\0'; bufword = realloc(bufword, couc*sizeof(char)); /* normalize */ mat[couw]=atof(bufword); couc=0; couw++; } if(c=='#') { while( (c=fgetc(fp)) != '\n') ; continue; } else if(c=='\n') { if(wa->numl == wa->lbuf-1) { wa->lbuf += WBUF; wa->wpla=realloc(wa->wpla, wa->lbuf*sizeof(size_t)); memset(wa->wpla+(wa->lbuf-WBUF), 0, WBUF*sizeof(size_t)); } wa->wpla[wa->numl] = couw-oldcouw; oldcouw=couw; wa->numl++; } inword=0; } else if( (inword==0) && ((c == 0x2B) | (c == 0x2D) | (c == 0x2E) | ((c >= 0x30) && (c <= 0x39))) ) { /* deal with first character of new word, + and - also allowed */ if(couw == wa->wsbuf-1) { wa->wsbuf += GBUF; wa->wln=realloc(wa->wln, wa->wsbuf*sizeof(size_t)); mat=realloc(mat, wa->wsbuf*sizeof(float)); for(i=wa->wsbuf-GBUF;i<wa->wsbuf;++i) wa->wln[i]=0; } couc=0; bwbuf=WBUF; bufword=realloc(bufword, bwbuf*sizeof(char)); /* don't bother with memset, it's not necessary */ bufword[couc++]=c; /* no need to check here, it's the first character */ inword=1; } else if( (c == 0x2E) | ((c >= 0x30) && (c <= 0x39)) ) { if(couc == bwbuf-1) { /* the -1 so that we can always add and extra (say 0) when we want */ bwbuf += WBUF; bufword = realloc(bufword, bwbuf*sizeof(char)); } bufword[couc++]=c; } else { printf("Error. Non-float character detected. This program is only for reading floats\n"); free_wseq(wa); exit(EXIT_FAILURE); } } /* end of big for statement */ fclose(fp); free(bufword); /* normalization stage */ wa->quan=couw; wa->wln = realloc(wa->wln, wa->quan*sizeof(size_t)); /* normalize */ mat = realloc(mat, wa->quan*sizeof(float)); /* normalize */ wa->wpla= realloc(wa->wpla, wa->numl*sizeof(size_t)); *m= wa->numl; int k=wa->wpla[0]; for(i=1;i<wa->numl;++i) if(k != wa->wpla[i]) printf("Warning: Numcols is not uniform at %i words per line on all lines. This file has one with %zu.\n", k, wa->wpla[i]); *n= k; free_wseq(wa); return mat; } sitedef *crea_sd(int numsites) { int i; sitedef *sitearr=malloc(sizeof(sitedef) * numsites); mconsump += (sizeof(sitedef) * numsites); for(i=0;i<numsites;++i) { sitearr[i].mxdisp=0.0; sitearr[i].currp=0; sitearr[i].jbf=BUF; sitearr[i].posarr=calloc(sizeof(float), sitearr[i].jbf); sitearr[i].brec=calloc(sizeof(base), sitearr[i].jbf); } return sitearr; } int *memind(int n) /* return an n x n-1 matrix of indices which exclude the diags */ { /* build our excluding-diag-index array first */ int i, j, k, m, l=0; int *excind = calloc(n*(n-1), sizeof(int)); for(i=0;i<n;++i) for(j=0;j<n;++j) { k=n*i+j; m=k%n; if(k!=i*n+i) excind[l++] = m; } /* excind is built */ return excind; } base getnextrbase(float *nsf, int n, int *excind, base sta) /* get our next random base */ { int i; base retbase; float r= (float)rand()/RAND_MAX * nsf[n-1]; /* multiplied by final entry in nsf .... therefore stretched, so to speak */ for(i=0;i<n-1;++i) if(r<nsf[i+1]) { /* shouldn't this be if(r<nsf[sta*(n-1)+i+1])? nipe just one row */ retbase = (base) excind[sta*(n-1) + i]; break; } return retbase; } float *mat2cum(float *arr, int n, int *excind) { int i, j; /* note cumulative array will calculate second values onward */ float *cumarr; cumarr=calloc(n*n, sizeof(float)); for(i=0;i<n;++i) for(j=1;j<n;++j) cumarr[n*i+j] = cumarr[n*i+j-1] + (arr[i*n+excind[i*(n-1) +j-1]] / -arr[i*n + i]); return cumarr; } void summarysites(sitedef *sitearr, int numsites, int nstates, char *idstrng) { int i; int *nucrec=calloc(sizeof(int), nstates); for(i=0;i<numsites;++i) switch(sitearr[i].endsymb) { case 'A': nucrec[0]++; break; case 'C': nucrec[1]++; break; case 'G': nucrec[2]++; break; case 'T': nucrec[3]++; break; } float avgnj=.0; for(i=0;i<numsites;++i) { avgnj+=sitearr[i].currp-1; /* why -1? the first currp is not a change, it's the initial state */ #ifdef DBG int j; printf("site:%3d pos) ", i); for(j=0;j<sitearr[i].currp;++j) printf("%.4f ", sitearr[i].posarr[j]); printf("\n"); #endif } avgnj /=numsites; printf("%s.. avg #jumps %.2f:\n", idstrng, avgnj); for(i=0;i<nstates;++i) printf("%6i ",nucrec[i]); printf("\n"); for(i=0;i<nstates;++i) printf("%3.4f ",(float)nucrec[i]/numsites); printf("\n"); free(nucrec); } void sitesubproc(sitedef* sites, float *ar, int nstates, int numsites, char symb, float lenc, int rsee) { int i; /* what's the starting symbol? All sites given the same one */ for(i=0;i<numsites;++i) { switch (symb) { case 'A': sites[i].latestb=A; /* */ sites[i].starsymb='A'; /* */ break; case 'C': sites[i].latestb=C; /* */ sites[i].starsymb='C'; /* */ break; case 'G': sites[i].latestb=G; /* */ sites[i].starsymb='G'; /* */ break; case 'T': sites[i].latestb=T; /* */ sites[i].starsymb='T'; /* */ break; } } int *excind=memind(nstates); /* a matrix of indices will be 4 rows by 3 columns */ float *nsf = mat2cum(ar, nstates, excind); /* an array to hold the off diagonal entries, divided by the diagonal entry, all made negative */ float ura; /* variable to hold one uniform random variable 0-1 */ srand(rsee); base currba; for(i=0;i<numsites;++i) { sites[i].brec[0] = sites[i].latestb; while(1) { ura= (float)rand()/RAND_MAX; currba = sites[i].latestb; sites[i].posarr[sites[i].currp + 1] = sites[i].posarr[sites[i].currp] + (-1.0/-ar[4*currba+currba])*log1p(-ura); sites[i].brec[sites[i].currp + 1] = getnextrbase(nsf + 4*currba, 4, excind, currba); /* note: just a single row of nsf is "sent up" */ sites[i].latestb = sites[i].brec[sites[i].currp + 1]; sites[i].mxdisp = sites[i].posarr[sites[i].currp + 1]; sites[i].currp++; /* check posarr buf sz */ if(sites[i].currp==sites[i].jbf-1) { sites[i].jbf += BUF; sites[i].posarr=realloc(sites[i].posarr, sites[i].jbf * sizeof(float)); memset(sites[i].posarr+sites[i].jbf-BUF, 0, BUF*sizeof(float)); sites[i].brec=realloc(sites[i].brec, sites[i].jbf * sizeof(base)); memset(sites[i].brec+sites[i].jbf-BUF, 0, BUF*sizeof(base)); } /* breaking out when condition met */ if(sites[i].mxdisp >= lenc) break; /* this site has now crossed finishing line, go to next site*/ } /* rationalise posarr array size here */ sites[i].posarr=realloc(sites[i].posarr, sites[i].currp * sizeof(float)); mconsump += sites[i].currp * sizeof(float); sites[i].brec=realloc(sites[i].brec, sites[i].currp * sizeof(base)); mconsump += sites[i].currp * sizeof(base); /* FInd out at what symbol site finished at */ switch(sites[i].brec[sites[i].currp-1]) { case 0: sites[i].endsymb='A'; break; case 1: sites[i].endsymb='C'; break; case 2: sites[i].endsymb='G'; break; case 3: sites[i].endsymb='T'; break; } } free(nsf); free(excind); } int main(int argc, char *argv[]) { int i, nstates, ncols, rsee; float lenc; /* argument accounting */ if((argc!=5) & (argc!=4)) { usage(); exit(EXIT_FAILURE); } else if (argc==4) { /* no seed given, use a random one */ struct timeval tnow; gettimeofday(&tnow, NULL); rsee=(int)((tnow.tv_usec/100000.0 - tnow.tv_usec/100000)*RAND_MAX); } else rsee=atoi(argv[4]); lenc=atof(argv[3]); printf("rsee=%d\n", rsee); float *mat=processinpf(argv[1], &nstates, &ncols); if(nstates!=ncols) { printf("Error: only square matrices accepted.\n"); exit(EXIT_FAILURE); } #ifdef DBG int j; for(i=0;i<nstates;++i) { for(j=0;j<nstates;++j) printf("%f ", mat[i*nstates+j]); printf("\n"); } #endif int numsites=atoi(argv[2]); sitedef *sitearr=crea_sd(numsites); sitesubproc(sitearr, mat, nstates, numsites, 'G', lenc, rsee); summarysites(sitearr, numsites, nstates, "Final dist: ex() = -1/-rate log1p(-ura)"); for(i=0;i<numsites;++i) { free(sitearr[i].posarr); free(sitearr[i].brec); } free(sitearr); free(mat); printf("mconsump= %u.\n", mconsump); return 0; }
rafalcode/ratemats
ratematn.c
C
gpl-2.0
13,313
 using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using Rhino.Mocks; using RC = Rhino.Mocks.Constraints; namespace ScrewTurn.Wiki.Plugins.SqlCommon.Tests { [TestFixture] public class SqlIndexTests { [Test] public void Constructor_NullConnector() { Assert.Throws<ArgumentNullException>(() => { new SqlIndex(null); }); } [Test] public void TotalDocuments_TotalWords_TotalOccurrences() { MockRepository mocks = new MockRepository(); IIndexConnector conn = mocks.StrictMock<IIndexConnector>(); Expect.Call(conn.GetCount(IndexElementType.Documents)).Return(12); Expect.Call(conn.GetCount(IndexElementType.Words)).Return(567); Expect.Call(conn.GetCount(IndexElementType.Occurrences)).Return(3456); mocks.ReplayAll(); SqlIndex index = new SqlIndex(conn); Assert.AreEqual(12, index.TotalDocuments, "Wrong document count"); Assert.AreEqual(567, index.TotalWords, "Wrong word count"); Assert.AreEqual(3456, index.TotalOccurrences, "Wrong occurence count"); mocks.VerifyAll(); } [Test] public void Clear() { MockRepository mocks = new MockRepository(); IIndexConnector conn = mocks.StrictMock<IIndexConnector>(); string dummyState = "state"; conn.ClearIndex(dummyState); LastCall.On(conn); mocks.ReplayAll(); SqlIndex index = new SqlIndex(conn); index.Clear(dummyState); mocks.VerifyAll(); } [Test] public void StoreDocument() { MockRepository mocks = new MockRepository(); IIndexConnector conn = mocks.StrictMock<IIndexConnector>(); ScrewTurn.Wiki.SearchEngine.IDocument doc = mocks.StrictMock<ScrewTurn.Wiki.SearchEngine.IDocument>(); string dummyState = "state"; string content = "This is some test content."; string title = "My Document"; Expect.Call(doc.Title).Return(title).Repeat.AtLeastOnce(); Expect.Call(doc.Tokenize(content)).Return(ScrewTurn.Wiki.SearchEngine.Tools.Tokenize(content, ScrewTurn.Wiki.SearchEngine.WordLocation.Content)); Expect.Call(doc.Tokenize(title)).Return(ScrewTurn.Wiki.SearchEngine.Tools.Tokenize(title, ScrewTurn.Wiki.SearchEngine.WordLocation.Title)); Predicate<ScrewTurn.Wiki.SearchEngine.WordInfo[]> contentPredicate = (array) => { return array.Length == 5 && array[0].Text == "this" && array[1].Text == "is" && array[2].Text == "some" && array[3].Text == "test" && array[4].Text == "content"; }; Predicate<ScrewTurn.Wiki.SearchEngine.WordInfo[]> titlePredicate = (array) => { return array.Length == 2 && array[0].Text == "my" && array[1].Text == "document"; }; Predicate<ScrewTurn.Wiki.SearchEngine.WordInfo[]> keywordsPredicate = (array) => { return array.Length == 1 && array[0].Text == "test"; }; conn.DeleteDataForDocument(doc, dummyState); LastCall.On(conn); Expect.Call(conn.SaveDataForDocument(null, null, null, null, null)).IgnoreArguments() .Constraints(RC.Is.Same(doc), RC.Is.Matching(contentPredicate), RC.Is.Matching(titlePredicate), RC.Is.Matching(keywordsPredicate), RC.Is.Same(dummyState)) .Return(8); mocks.ReplayAll(); SqlIndex index = new SqlIndex(conn); Assert.AreEqual(8, index.StoreDocument(doc, new string[] { "test" }, content, dummyState), "Wrong occurrence count"); mocks.VerifyAll(); } [Test] public void Search() { // Basic integration test: search algorithms are already extensively tested with InMemoryIndexBase MockRepository mocks = new MockRepository(); IIndexConnector conn = mocks.StrictMock<IIndexConnector>(); ScrewTurn.Wiki.SearchEngine.IWordFetcher fetcher = mocks.StrictMock<ScrewTurn.Wiki.SearchEngine.IWordFetcher>(); ScrewTurn.Wiki.SearchEngine.Word dummy = null; Expect.Call(fetcher.TryGetWord("test", out dummy)).Return(false); Expect.Call(fetcher.TryGetWord("query", out dummy)).Return(false); fetcher.Dispose(); LastCall.On(fetcher); Expect.Call(conn.GetWordFetcher()).Return(fetcher); mocks.ReplayAll(); SqlIndex index = new SqlIndex(conn); Assert.AreEqual(0, index.Search(new ScrewTurn.Wiki.SearchEngine.SearchParameters("test query")).Count, "Wrong search result count"); mocks.VerifyAll(); } } }
mono/ScrewTurnWiki
SqlProvidersCommon-Tests/SqlIndexTests.cs
C#
gpl-2.0
4,406
/* This file was generated by SableCC (http://www.sablecc.org/). */ package se.sics.kola.node; import se.sics.kola.analysis.*; @SuppressWarnings("nls") public final class AIfThenStatement extends PIfThenStatement { private PExpression _cond_; private PStatement _then_; public AIfThenStatement() { // Constructor } public AIfThenStatement( @SuppressWarnings("hiding") PExpression _cond_, @SuppressWarnings("hiding") PStatement _then_) { // Constructor setCond(_cond_); setThen(_then_); } @Override public Object clone() { return new AIfThenStatement( cloneNode(this._cond_), cloneNode(this._then_)); } @Override public void apply(Switch sw) { ((Analysis) sw).caseAIfThenStatement(this); } public PExpression getCond() { return this._cond_; } public void setCond(PExpression node) { if(this._cond_ != null) { this._cond_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._cond_ = node; } public PStatement getThen() { return this._then_; } public void setThen(PStatement node) { if(this._then_ != null) { this._then_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._then_ = node; } @Override public String toString() { return "" + toString(this._cond_) + toString(this._then_); } @Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._cond_ == child) { this._cond_ = null; return; } if(this._then_ == child) { this._then_ = null; return; } throw new RuntimeException("Not a child."); } @Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._cond_ == oldChild) { setCond((PExpression) newChild); return; } if(this._then_ == oldChild) { setThen((PStatement) newChild); return; } throw new RuntimeException("Not a child."); } }
kompics/kola
src/main/java/se/sics/kola/node/AIfThenStatement.java
Java
gpl-2.0
2,710
<?php require_once('wfUtils.php'); class wfIssues { private $db = false; //Properties that are serialized on sleep: private $updateCalled = false; private $issuesTable = ''; private $newIssues = array(); public $totalIssues = 0; public $totalCriticalIssues = 0; public $totalWarningIssues = 0; public function __sleep(){ //Same order here as vars above return array('updateCalled', 'issuesTable', 'newIssues', 'totalIssues', 'totalCriticalIssues', 'totalWarningIssues'); } public function __construct(){ global $wpdb; $this->issuesTable = $wpdb->base_prefix . 'wfIssues'; } public function __wakeup(){ $this->db = new wfDB(); } public function addIssue($type, $severity, $ignoreP, /* some piece of data used for md5 for permanent ignores */ $ignoreC, /* some piece of data used for md5 for ignoring until something changes */ $shortMsg, $longMsg, $templateData ){ $ignoreP = md5($ignoreP); $ignoreC = md5($ignoreC); $rec = $this->getDB()->querySingleRec("select status, ignoreP, ignoreC from " . $this->issuesTable . " where (ignoreP='%s' OR ignoreC='%s')", $ignoreP, $ignoreC); if($rec){ if($rec['status'] == 'new' && ($rec['ignoreC'] == $ignoreC || $rec['ignoreP'] == $ignoreP)){ return false; } if($rec['status'] == 'ignoreC' && $rec['ignoreC'] == $ignoreC){ return false; } if($rec['status'] == 'ignoreP' && $rec['ignoreP'] == $ignoreP){ return false; } } if($severity == 1){ $this->totalCriticalIssues++; } else if($severity == 2){ $this->totalWarningIssues++; } $this->totalIssues++; $this->newIssues[] = array( 'type' => $type, 'severity' => $severity, 'ignoreP' => $ignoreP, 'ignoreC' => $ignoreC, 'shortMsg' => $shortMsg, 'longMsg' => $longMsg, 'tmplData' => $templateData ); $this->getDB()->queryWrite("insert into " . $this->issuesTable . " (time, status, type, severity, ignoreP, ignoreC, shortMsg, longMsg, data) values (unix_timestamp(), '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s')", 'new', $type, $severity, $ignoreP, $ignoreC, $shortMsg, $longMsg, serialize($templateData) ); return true; } public function deleteIgnored(){ $this->getDB()->queryWrite("delete from " . $this->issuesTable . " where status='ignoreP' or status='ignoreC'"); } public function deleteNew(){ $this->getDB()->queryWrite("delete from " . $this->issuesTable . " where status='new'"); } public function ignoreAllNew(){ $this->getDB()->queryWrite("update " . $this->issuesTable . " set status='ignoreC' where status='new'"); } public function emailNewIssues(){ $level = wfConfig::getAlertLevel(); $emails = wfConfig::getAlertEmails(); $shortSiteURL = preg_replace('/^https?:\/\//i', '', site_url()); $subject = "[Wordfence Alert] Problems found on $shortSiteURL"; if(sizeof($emails) < 1){ return; } if($level < 1){ return; } if($level == 2 && $this->totalCriticalIssues < 1 && $this->totalWarningIssues < 1){ return; } if($level == 1 && $this->totalCriticalIssues < 1){ return; } $emailedIssues = wfConfig::get_ser('emailedIssuesList', array()); if(! is_array($emailedIssues)){ $emailedIssues = array(); } $finalIssues = array(); foreach($this->newIssues as $newIssue){ $alreadyEmailed = false; foreach($emailedIssues as $emailedIssue){ if($newIssue['ignoreP'] == $emailedIssue['ignoreP'] || $newIssue['ignoreC'] == $emailedIssue['ignoreC']){ $alreadyEmailed = true; break; } } if(! $alreadyEmailed){ $finalIssues[] = $newIssue; } } if(sizeof($finalIssues) < 1){ return; } $totalWarningIssues = 0; $totalCriticalIssues = 0; foreach($finalIssues as $i){ $emailedIssues[] = array( 'ignoreC' => $i['ignoreC'], 'ignoreP' => $i['ignoreP'] ); if($i['severity'] == 1){ $totalCriticalIssues++; } else if($i['severity'] == 2){ $totalWarningIssues++; } } wfConfig::set_ser('emailedIssuesList', $emailedIssues); if($level == 2 && $totalCriticalIssues < 1 && $totalWarningIssues < 1){ return; } if($level == 1 && $totalCriticalIssues < 1){ return; } $content = wfUtils::tmpl('email_newIssues.php', array( 'isPaid' => wfConfig::get('isPaid'), 'issues' => $finalIssues, 'totalCriticalIssues' => $totalCriticalIssues, 'totalWarningIssues' => $totalWarningIssues, 'level' => $level )); wp_mail(implode(',', $emails), $subject, $content); } public function deleteIssue($id){ $this->getDB()->queryWrite("delete from " . $this->issuesTable . " where id=%d", $id); } public function updateIssue($id, $status){ //ignoreC, ignoreP, delete or new $currentStatus = $this->getDB()->querySingle("select status from " . $this->issuesTable . " where id=%d", $id); if($status == 'delete'){ $this->getDB()->queryWrite("delete from " . $this->issuesTable . " where id=%d", $id); } else if($status == 'ignoreC' || $status == 'ignoreP' || $status == 'new'){ $this->getDB()->queryWrite("update " . $this->issuesTable . " set status='%s' where id=%d", $status, $id); } } public function getIssueByID($id){ $rec = $this->getDB()->querySingleRec("select * from " . $this->issuesTable . " where id=%d", $id); $rec['data'] = unserialize($rec['data']); return $rec; } public function getIssues(){ $issues = wfConfig::get('wf_issues', array()); $ret = array( 'new' => array(), 'ignored' => array() ); $q1 = $this->getDB()->querySelect("select * from " . $this->issuesTable . " order by time desc"); foreach($q1 as $i){ $i['data'] = unserialize($i['data']); $i['timeAgo'] = wfUtils::makeTimeAgo(time() - $i['time']); if($i['status'] == 'new'){ $ret['new'][] = $i; } else if($i['status'] == 'ignoreP' || $i['status'] == 'ignoreC'){ $ret['ignored'][] = $i; } else { error_log("Issue has bad status: " . $i['status']); continue; } } foreach($ret as $status => &$issueList){ for($i = 0; $i < sizeof($issueList); $i++){ if($issueList[$i]['type'] == 'file'){ $localFile = ABSPATH . '/' . preg_replace('/^[\.\/]+/', '', $issueList[$i]['data']['file']); if(file_exists($localFile)){ $issueList[$i]['data']['fileExists'] = true; } else { $issueList[$i]['data']['fileExists'] = ''; } } $issueList[$i]['issueIDX'] = $i; } } return $ret; //array of lists of issues by status } public function updateSummaryItem($key, $val){ $arr = wfConfig::get_ser('wf_summaryItems', array()); $arr[$key] = $val; $arr['lastUpdate'] = time(); wfConfig::set_ser('wf_summaryItems', $arr); } public function getSummaryItem($key){ $arr = wfConfig::get_ser('wf_summaryItems', array()); if(array_key_exists($key, $arr)){ return $arr[$key]; } else { return ''; } } public function summaryUpdateRequired(){ $last = $this->getSummaryItem('lastUpdate'); if( (! $last) || (time() - $last > (86400 * 7))){ return true; } return false; } public function getSummaryItems(){ if(! $this->updateCalled){ $this->updateCalled = true; $this->updateSummaryItems(); } $arr = wfConfig::get_ser('wf_summaryItems', array()); //$arr['scanTimeAgo'] = wfUtils::makeTimeAgo(sprintf('%.0f', time() - $arr['scanTime'])); $arr['scanRunning'] = wfUtils::isScanRunning() ? '1' : '0'; $arr['scheduledScansEnabled'] = wfConfig::get('scheduledScansEnabled'); $secsToGo = wp_next_scheduled('wordfence_scheduled_scan') - time(); if($secsToGo < 1){ $nextRun = 'now'; } else { $nextRun = wfUtils::makeTimeAgo($secsToGo) . ' from now'; } $arr['nextRun'] = $nextRun; $arr['totalCritical'] = $this->getDB()->querySingle("select count(*) as cnt from " . $this->issuesTable . " where status='new' and severity=1"); $arr['totalWarning'] = $this->getDB()->querySingle("select count(*) as cnt from " . $this->issuesTable . " where status='new' and severity=2"); return $arr; } private function updateSummaryItems(){ global $wpdb; $dat = array(); $users = $wpdb->get_col("SELECT $wpdb->users.ID FROM $wpdb->users"); $dat['totalUsers'] = sizeof($users); $res1 = $wpdb->get_col("SELECT count(*) as cnt FROM $wpdb->posts where post_type='page' and post_status NOT IN ('auto-draft')"); $dat['totalPages'] = $res1['0']; $res1 = $wpdb->get_col("SELECT count(*) as cnt FROM $wpdb->posts where post_type='post' and post_status NOT IN ('auto-draft')"); $dat['totalPosts'] = $res1['0']; $res1 = $wpdb->get_col("SELECT count(*) as cnt FROM $wpdb->comments"); $dat['totalComments'] = $res1['0']; $res1 = $wpdb->get_col("SELECT count(*) as cnt FROM $wpdb->term_taxonomy where taxonomy='category'"); $dat['totalCategories'] = $res1['0']; $res1 = $wpdb->get_col("show tables"); $dat['totalTables'] = sizeof($res1); $totalRows = 0; foreach($res1 as $table){ $res2 = $wpdb->get_col("select count(*) from $table"); if(isset($res2[0]) ){ $totalRows += $res2[0]; } } $dat['totalRows'] = $totalRows; $arr = wfConfig::get_ser('wf_summaryItems', array()); foreach($dat as $key => $val){ $arr[$key] = $val; } wfConfig::set_ser('wf_summaryItems', $arr); } public function setScanTimeNow(){ $this->updateSummaryItem('scanTime', microtime(true)); } public function getScanTime(){ return $this->getSummaryItem('scanTime'); } private function getDB(){ if(! $this->db){ $this->db = new wfDB(); } return $this->db; } } ?>
tuyenln/hanoiled
wp-content/plugins/wordfence/lib/wfIssues.php
PHP
gpl-2.0
9,586
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing authors: Axel Kohlmeyer (Temple U) Rolf Isele-Holder (RWTH Aachen University) ------------------------------------------------------------------------- */ #include "omp_compat.h" #include "pppm_disp_omp.h" #include <mpi.h> #include <cstring> #include <cmath> #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" #include "force.h" #include "math_const.h" #include "timer.h" #if defined(_OPENMP) #include <omp.h> #endif #include "suffix.h" using namespace LAMMPS_NS; using namespace MathConst; #ifdef FFT_SINGLE #define ZEROF 0.0f #define ONEF 1.0f #else #define ZEROF 0.0 #define ONEF 1.0 #endif #define OFFSET 16384 /* ---------------------------------------------------------------------- */ PPPMDispOMP::PPPMDispOMP(LAMMPS *lmp) : PPPMDisp(lmp), ThrOMP(lmp, THR_KSPACE) { triclinic_support = 0; suffix_flag |= Suffix::OMP; } /* ---------------------------------------------------------------------- */ PPPMDispOMP::~PPPMDispOMP() { #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) const int tid = omp_get_thread_num(); #else const int tid = 0; #endif if (function[0]) { ThrData * thr = fix->get_thr(tid); thr->init_pppm(-order,memory); } if (function[1] + function[2]) { ThrData * thr = fix->get_thr(tid); thr->init_pppm_disp(-order_6,memory); } } } /* ---------------------------------------------------------------------- allocate memory that depends on # of K-vectors and order ------------------------------------------------------------------------- */ void PPPMDispOMP::allocate() { PPPMDisp::allocate(); #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) const int tid = omp_get_thread_num(); #else const int tid = 0; #endif if (function[0]) { ThrData *thr = fix->get_thr(tid); thr->init_pppm(order,memory); } if (function[1] + function[2]) { ThrData * thr = fix->get_thr(tid); thr->init_pppm_disp(order_6,memory); } } } /* ---------------------------------------------------------------------- Compute the modified (hockney-eastwood) coulomb green function ------------------------------------------------------------------------- */ void PPPMDispOMP::compute_gf() { #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { double *prd; if (triclinic == 0) prd = domain->prd; else prd = domain->prd_lamda; double xprd = prd[0]; double yprd = prd[1]; double zprd = prd[2]; double zprd_slab = zprd*slab_volfactor; double unitkx = (2.0*MY_PI/xprd); double unitky = (2.0*MY_PI/yprd); double unitkz = (2.0*MY_PI/zprd_slab); int tid,nn,nnfrom,nnto,k,l,m; int kper,lper,mper; double snx,sny,snz,snx2,sny2,snz2; double sqk; double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double numerator,denominator; const int nnx = nxhi_fft-nxlo_fft+1; const int nny = nyhi_fft-nylo_fft+1; loop_setup_thr(nnfrom, nnto, tid, nfft, comm->nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); for (m = nzlo_fft; m <= nzhi_fft; m++) { mper = m - nz_pppm*(2*m/nz_pppm); qz = unitkz*mper; snz = sin(0.5*qz*zprd_slab/nz_pppm); snz2 = snz*snz; sz = exp(-0.25*pow(qz/g_ewald,2.0)); wz = 1.0; argz = 0.5*qz*zprd_slab/nz_pppm; if (argz != 0.0) wz = pow(sin(argz)/argz,order); wz *= wz; for (l = nylo_fft; l <= nyhi_fft; l++) { lper = l - ny_pppm*(2*l/ny_pppm); qy = unitky*lper; sny = sin(0.5*qy*yprd/ny_pppm); sny2 = sny*sny; sy = exp(-0.25*pow(qy/g_ewald,2.0)); wy = 1.0; argy = 0.5*qy*yprd/ny_pppm; if (argy != 0.0) wy = pow(sin(argy)/argy,order); wy *= wy; for (k = nxlo_fft; k <= nxhi_fft; k++) { /* only compute the part designated to this thread */ nn = k-nxlo_fft + nnx*(l-nylo_fft + nny*(m-nzlo_fft)); if ((nn < nnfrom) || (nn >=nnto)) continue; kper = k - nx_pppm*(2*k/nx_pppm); qx = unitkx*kper; snx = sin(0.5*qx*xprd/nx_pppm); snx2 = snx*snx; sx = exp(-0.25*pow(qx/g_ewald,2.0)); wx = 1.0; argx = 0.5*qx*xprd/nx_pppm; if (argx != 0.0) wx = pow(sin(argx)/argx,order); wx *= wx; sqk = pow(qx,2.0) + pow(qy,2.0) + pow(qz,2.0); if (sqk != 0.0) { numerator = 4.0*MY_PI/sqk; denominator = gf_denom(snx2,sny2,snz2, gf_b, order); greensfn[nn] = numerator*sx*sy*sz*wx*wy*wz/denominator; } else greensfn[nn] = 0.0; } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- Compyute the modified (hockney-eastwood) dispersion green function ------------------------------------------------------------------------- */ void PPPMDispOMP::compute_gf_6() { #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { double *prd; int k,l,m,nn; // volume-dependent factors // adjust z dimension for 2d slab PPPM // z dimension for 3d PPPM is zprd since slab_volfactor = 1.0 if (triclinic == 0) prd = domain->prd; else prd = domain->prd_lamda; double xprd = prd[0]; double yprd = prd[1]; double zprd = prd[2]; double zprd_slab = zprd*slab_volfactor; double unitkx = (2.0*MY_PI/xprd); double unitky = (2.0*MY_PI/yprd); double unitkz = (2.0*MY_PI/zprd_slab); int kper,lper,mper; double sqk; double snx,sny,snz,snx2,sny2,snz2; double argx,argy,argz,wx,wy,wz,sx,sy,sz; double qx,qy,qz; double rtsqk, term; double numerator,denominator; double inv2ew = 2*g_ewald_6; inv2ew = 1/inv2ew; double rtpi = sqrt(MY_PI); int nnfrom, nnto, tid; numerator = -MY_PI*rtpi*g_ewald_6*g_ewald_6*g_ewald_6/(3.0); const int nnx = nxhi_fft_6-nxlo_fft_6+1; const int nny = nyhi_fft_6-nylo_fft_6+1; loop_setup_thr(nnfrom, nnto, tid, nfft_6, comm->nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); for (m = nzlo_fft_6; m <= nzhi_fft_6; m++) { mper = m - nz_pppm_6*(2*m/nz_pppm_6); qz = unitkz*mper; snz = sin(0.5*unitkz*mper*zprd_slab/nz_pppm_6); snz2 = snz*snz; sz = exp(-qz*qz*inv2ew*inv2ew); wz = 1.0; argz = 0.5*qz*zprd_slab/nz_pppm_6; if (argz != 0.0) wz = pow(sin(argz)/argz,order_6); wz *= wz; for (l = nylo_fft_6; l <= nyhi_fft_6; l++) { lper = l - ny_pppm_6*(2*l/ny_pppm_6); qy = unitky*lper; sny = sin(0.5*unitky*lper*yprd/ny_pppm_6); sny2 = sny*sny; sy = exp(-qy*qy*inv2ew*inv2ew); wy = 1.0; argy = 0.5*qy*yprd/ny_pppm_6; if (argy != 0.0) wy = pow(sin(argy)/argy,order_6); wy *= wy; for (k = nxlo_fft_6; k <= nxhi_fft_6; k++) { /* only compute the part designated to this thread */ nn = k-nxlo_fft_6 + nnx*(l-nylo_fft_6 + nny*(m-nzlo_fft_6)); if ((nn < nnfrom) || (nn >=nnto)) continue; kper = k - nx_pppm_6*(2*k/nx_pppm_6); qx = unitkx*kper; snx = sin(0.5*unitkx*kper*xprd/nx_pppm_6); snx2 = snx*snx; sx = exp(-qx*qx*inv2ew*inv2ew); wx = 1.0; argx = 0.5*qx*xprd/nx_pppm_6; if (argx != 0.0) wx = pow(sin(argx)/argx,order_6); wx *= wx; sqk = pow(qx,2.0) + pow(qy,2.0) + pow(qz,2.0); if (sqk != 0.0) { denominator = gf_denom(snx2,sny2,snz2, gf_b_6, order_6); rtsqk = sqrt(sqk); term = (1-2*sqk*inv2ew*inv2ew)*sx*sy*sz + 2*sqk*rtsqk*inv2ew*inv2ew*inv2ew*rtpi*erfc(rtsqk*inv2ew); greensfn_6[nn] = numerator*term*wx*wy*wz/denominator; } else greensfn_6[nn] = 0.0; } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- run the regular toplevel compute method from plain PPPPM which will have individual methods replaced by our threaded versions and then call the obligatory force reduction. ------------------------------------------------------------------------- */ void PPPMDispOMP::compute(int eflag, int vflag) { PPPMDisp::compute(eflag,vflag); #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag,vflag) #endif { #if defined(_OPENMP) const int tid = omp_get_thread_num(); #else const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); reduce_thr(this, eflag, vflag, thr); } // end of omp parallel region } /* ---------------------------------------------------------------------- find center grid pt for each of my particles check that full stencil for the particle will fit in my 3d brick store central grid pt indices in part2grid array ------------------------------------------------------------------------- */ void PPPMDispOMP::particle_map(double dxinv, double dyinv, double dzinv, double sft, int ** part2grid, int nup, int nlw, int nxlo_o, int nylo_o, int nzlo_o, int nxhi_o, int nyhi_o, int nzhi_o) { const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; int3_t * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; const int nlocal = atom->nlocal; const double delxinv = dxinv; const double delyinv = dyinv; const double delzinv = dzinv; const double shift = sft; const int nupper = nup; const int nlower = nlw; const int nxlo_out = nxlo_o; const int nylo_out = nylo_o; const int nzlo_out = nzlo_o; const int nxhi_out = nxhi_o; const int nyhi_out = nyhi_o; const int nzhi_out = nzhi_o; if (!std::isfinite(boxlo[0]) || !std::isfinite(boxlo[1]) || !std::isfinite(boxlo[2])) error->one(FLERR,"Non-numeric box dimensions. Simulation unstable."); int flag = 0; #if defined(_OPENMP) #pragma omp parallel for LMP_DEFAULT_NONE reduction(+:flag) schedule(static) #endif for (int i = 0; i < nlocal; i++) { // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // current particle coord can be outside global and local box // add/subtract OFFSET to avoid int(-0.75) = 0 when want it to be -1 const int nx = static_cast<int> ((x[i].x-boxlox)*delxinv+shift) - OFFSET; const int ny = static_cast<int> ((x[i].y-boxloy)*delyinv+shift) - OFFSET; const int nz = static_cast<int> ((x[i].z-boxloz)*delzinv+shift) - OFFSET; p2g[i].a = nx; p2g[i].b = ny; p2g[i].t = nz; // check that entire stencil around nx,ny,nz will fit in my 3d brick if (nx+nlower < nxlo_out || nx+nupper > nxhi_out || ny+nlower < nylo_out || ny+nupper > nyhi_out || nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++; } int flag_all; MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world); if (flag_all) error->all(FLERR,"Out of range atoms - cannot compute PPPM"); } /* ---------------------------------------------------------------------- create discretized "density" on section of global grid due to my particles density(x,y,z) = charge "density" at grid points of my 3d brick (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts) in global grid ------------------------------------------------------------------------- */ void PPPMDispOMP::make_rho_c() { // clear 3d density array FFT_SCALAR * _noalias const d = &(density_brick[nzlo_out][nylo_out][nxlo_out]); memset(d,0,ngrid*sizeof(FFT_SCALAR)); // no local atoms => nothing else to do const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out - nxlo_out + 1; const int iy = nyhi_out - nylo_out + 1; #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { const double * _noalias const q = atom->q; const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; // determine range of grid points handled by this thread int i,jfrom,jto,tid; loop_setup_thr(jfrom,jto,tid,ngrid,comm->nthreads); // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d()); // loop over my charges, add their contribution to nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; const int ny = p2g[i].b; const int nz = p2g[i].t; // pre-screen whether this atom will ever come within // reach of the data segement this thread is updating. if ( ((nz+nlower-nzlo_out)*ix*iy >= jto) || ((nz+nupper-nzlo_out+1)*ix*iy < jfrom) ) continue; const FFT_SCALAR dx = nx+shiftone - (x[i].x-boxlox)*delxinv; const FFT_SCALAR dy = ny+shiftone - (x[i].y-boxloy)*delyinv; const FFT_SCALAR dz = nz+shiftone - (x[i].z-boxloz)*delzinv; compute_rho1d_thr(r1d,dx,dy,dz,order,rho_coeff); const FFT_SCALAR z0 = delvolinv * q[i]; for (int n = nlower; n <= nupper; ++n) { const int jn = (nz+n-nzlo_out)*ix*iy; const FFT_SCALAR y0 = z0*r1d[2][n]; for (int m = nlower; m <= nupper; ++m) { const int jm = jn+(ny+m-nylo_out)*ix; const FFT_SCALAR x0 = y0*r1d[1][m]; for (int l = nlower; l <= nupper; ++l) { const int jl = jm+nx+l-nxlo_out; // make sure each thread only updates // "his" elements of the density grid if (jl >= jto) break; if (jl < jfrom) continue; d[jl] += x0*r1d[0][l]; } } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- same as above for dispersion interaction with geometric mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::make_rho_g() { // clear 3d density array FFT_SCALAR * _noalias const d = &(density_brick_g[nzlo_out_6][nylo_out_6][nxlo_out_6]); memset(d,0,ngrid_6*sizeof(FFT_SCALAR)); // no local atoms => nothing else to do const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out_6 - nxlo_out_6 + 1; const int iy = nyhi_out_6 - nylo_out_6 + 1; #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; const int3_t * _noalias const p2g = (int3_t *) part2grid_6[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; // determine range of grid points handled by this thread int i,jfrom,jto,tid; loop_setup_thr(jfrom,jto,tid,ngrid_6,comm->nthreads); // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); // loop over my charges, add their contribution to nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; const int ny = p2g[i].b; const int nz = p2g[i].t; // pre-screen whether this atom will ever come within // reach of the data segement this thread is updating. if ( ((nz+nlower_6-nzlo_out_6)*ix*iy >= jto) || ((nz+nupper_6-nzlo_out_6+1)*ix*iy < jfrom) ) continue; const FFT_SCALAR dx = nx+shiftone_6 - (x[i].x-boxlox)*delxinv_6; const FFT_SCALAR dy = ny+shiftone_6 - (x[i].y-boxloy)*delyinv_6; const FFT_SCALAR dz = nz+shiftone_6 - (x[i].z-boxloz)*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz,order_6,rho_coeff_6); const int type = atom->type[i]; const double lj = B[type]; const FFT_SCALAR z0 = delvolinv_6 * lj; for (int n = nlower_6; n <= nupper_6; ++n) { const int jn = (nz+n-nzlo_out_6)*ix*iy; const FFT_SCALAR y0 = z0*r1d[2][n]; for (int m = nlower_6; m <= nupper_6; ++m) { const int jm = jn+(ny+m-nylo_out_6)*ix; const FFT_SCALAR x0 = y0*r1d[1][m]; for (int l = nlower_6; l <= nupper_6; ++l) { const int jl = jm+nx+l-nxlo_out_6; // make sure each thread only updates // "his" elements of the density grid if (jl >= jto) break; if (jl < jfrom) continue; d[jl] += x0*r1d[0][l]; } } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- same as above for dispersion interaction with arithmetic mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::make_rho_a() { // clear 3d density array FFT_SCALAR * _noalias const d0 = &(density_brick_a0[nzlo_out_6][nylo_out_6][nxlo_out_6]); FFT_SCALAR * _noalias const d1 = &(density_brick_a1[nzlo_out_6][nylo_out_6][nxlo_out_6]); FFT_SCALAR * _noalias const d2 = &(density_brick_a2[nzlo_out_6][nylo_out_6][nxlo_out_6]); FFT_SCALAR * _noalias const d3 = &(density_brick_a3[nzlo_out_6][nylo_out_6][nxlo_out_6]); FFT_SCALAR * _noalias const d4 = &(density_brick_a4[nzlo_out_6][nylo_out_6][nxlo_out_6]); FFT_SCALAR * _noalias const d5 = &(density_brick_a5[nzlo_out_6][nylo_out_6][nxlo_out_6]); FFT_SCALAR * _noalias const d6 = &(density_brick_a6[nzlo_out_6][nylo_out_6][nxlo_out_6]); memset(d0,0,ngrid_6*sizeof(FFT_SCALAR)); memset(d1,0,ngrid_6*sizeof(FFT_SCALAR)); memset(d2,0,ngrid_6*sizeof(FFT_SCALAR)); memset(d3,0,ngrid_6*sizeof(FFT_SCALAR)); memset(d4,0,ngrid_6*sizeof(FFT_SCALAR)); memset(d5,0,ngrid_6*sizeof(FFT_SCALAR)); memset(d6,0,ngrid_6*sizeof(FFT_SCALAR)); // no local atoms => nothing else to do const int nlocal = atom->nlocal; if (nlocal == 0) return; const int ix = nxhi_out_6 - nxlo_out_6 + 1; const int iy = nyhi_out_6 - nylo_out_6 + 1; #if defined(_OPENMP) #pragma omp parallel LMP_DEFAULT_NONE #endif { const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; const int3_t * _noalias const p2g = (int3_t *) part2grid_6[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; // determine range of grid points handled by this thread int i,jfrom,jto,tid; loop_setup_thr(jfrom,jto,tid,ngrid_6,comm->nthreads); // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); // loop over my charges, add their contribution to nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // loop over all local atoms for all threads for (i = 0; i < nlocal; i++) { const int nx = p2g[i].a; const int ny = p2g[i].b; const int nz = p2g[i].t; // pre-screen whether this atom will ever come within // reach of the data segement this thread is updating. if ( ((nz+nlower_6-nzlo_out_6)*ix*iy >= jto) || ((nz+nupper_6-nzlo_out_6+1)*ix*iy < jfrom) ) continue; const FFT_SCALAR dx = nx+shiftone_6 - (x[i].x-boxlox)*delxinv_6; const FFT_SCALAR dy = ny+shiftone_6 - (x[i].y-boxloy)*delyinv_6; const FFT_SCALAR dz = nz+shiftone_6 - (x[i].z-boxloz)*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz,order_6,rho_coeff_6); const int type = atom->type[i]; const double lj0 = B[7*type]; const double lj1 = B[7*type+1]; const double lj2 = B[7*type+2]; const double lj3 = B[7*type+3]; const double lj4 = B[7*type+4]; const double lj5 = B[7*type+5]; const double lj6 = B[7*type+6]; const FFT_SCALAR z0 = delvolinv_6; for (int n = nlower_6; n <= nupper_6; ++n) { const int jn = (nz+n-nzlo_out_6)*ix*iy; const FFT_SCALAR y0 = z0*r1d[2][n]; for (int m = nlower_6; m <= nupper_6; ++m) { const int jm = jn+(ny+m-nylo_out_6)*ix; const FFT_SCALAR x0 = y0*r1d[1][m]; for (int l = nlower_6; l <= nupper_6; ++l) { const int jl = jm+nx+l-nxlo_out_6; // make sure each thread only updates // "his" elements of the density grid if (jl >= jto) break; if (jl < jfrom) continue; const double w = x0*r1d[0][l]; d0[jl] += w*lj0; d1[jl] += w*lj1; d2[jl] += w*lj2; d3[jl] += w*lj3; d4[jl] += w*lj4; d5[jl] += w*lj5; d6[jl] += w*lj6; } } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get electric field & force on my particles for ik scheme ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_c_ik() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate electric field from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle const double * const q = atom->q; const double * const * const x = atom->x; const double qqrd2e = force->qqrd2e; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); double * const * const f = thr->get_f(); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR ekx,eky,ekz; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid[i][0]; ny = part2grid[i][1]; nz = part2grid[i][2]; dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv; dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv; dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv; compute_rho1d_thr(r1d,dx,dy,dz, order, rho_coeff); ekx = eky = ekz = ZEROF; for (n = nlower; n <= nupper; n++) { mz = n+nz; z0 = r1d[2][n]; for (m = nlower; m <= nupper; m++) { my = m+ny; y0 = z0*r1d[1][m]; for (l = nlower; l <= nupper; l++) { mx = l+nx; x0 = y0*r1d[0][l]; ekx -= x0*vdx_brick[mz][my][mx]; eky -= x0*vdy_brick[mz][my][mx]; ekz -= x0*vdz_brick[mz][my][mx]; } } } // convert E-field to force const double qfactor = qqrd2e*scale*q[i]; f[i][0] += qfactor*ekx; f[i][1] += qfactor*eky; f[i][2] += qfactor*ekz; } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get electric field & force on my particles for ad scheme ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_c_ad() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate electric field from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle const double * const q = atom->q; const double * const * const x = atom->x; const double qqrd2e = force->qqrd2e; //const double * const sf_c = sf_coeff; double *prd; if (triclinic == 0) prd = domain->prd; else prd = domain->prd_lamda; double xprd = prd[0]; double yprd = prd[1]; double zprd = prd[2]; double zprd_slab = zprd*slab_volfactor; const double hx_inv = nx_pppm/xprd; const double hy_inv = ny_pppm/yprd; const double hz_inv = nz_pppm/zprd_slab; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); double * const * const f = thr->get_f(); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d()); FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz; FFT_SCALAR ekx,eky,ekz; double sf = 0.0; double s1,s2,s3; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid[i][0]; ny = part2grid[i][1]; nz = part2grid[i][2]; dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv; dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv; dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv; compute_rho1d_thr(r1d,dx,dy,dz, order, rho_coeff); compute_drho1d_thr(dr1d,dx,dy,dz, order, drho_coeff); ekx = eky = ekz = ZEROF; for (n = nlower; n <= nupper; n++) { mz = n+nz; for (m = nlower; m <= nupper; m++) { my = m+ny; for (l = nlower; l <= nupper; l++) { mx = l+nx; ekx += dr1d[0][l]*r1d[1][m]*r1d[2][n]*u_brick[mz][my][mx]; eky += r1d[0][l]*dr1d[1][m]*r1d[2][n]*u_brick[mz][my][mx]; ekz += r1d[0][l]*r1d[1][m]*dr1d[2][n]*u_brick[mz][my][mx]; } } } ekx *= hx_inv; eky *= hy_inv; ekz *= hz_inv; // convert E-field to force const double qfactor = qqrd2e*scale; s1 = x[i][0]*hx_inv; s2 = x[i][1]*hy_inv; s3 = x[i][2]*hz_inv; sf = sf_coeff[0]*sin(2*MY_PI*s1); sf += sf_coeff[1]*sin(4*MY_PI*s1); sf *= 2*q[i]*q[i]; f[i][0] += qfactor*(ekx*q[i] - sf); sf = sf_coeff[2]*sin(2*MY_PI*s2); sf += sf_coeff[3]*sin(4*MY_PI*s2); sf *= 2*q[i]*q[i]; f[i][1] += qfactor*(eky*q[i] - sf); sf = sf_coeff[4]*sin(2*MY_PI*s3); sf += sf_coeff[5]*sin(4*MY_PI*s3); sf *= 2*q[i]*q[i]; if (slabflag != 2) f[i][2] += qfactor*(ekz*q[i] - sf); } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get per-atom energy/virial ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_c_peratom() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt const double * const q = atom->q; const double * const * const x = atom->x; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR u,v0,v1,v2,v3,v4,v5; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid[i][0]; ny = part2grid[i][1]; nz = part2grid[i][2]; dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv; dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv; dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv; compute_rho1d_thr(r1d,dx,dy,dz, order, rho_coeff); u = v0 = v1 = v2 = v3 = v4 = v5 = ZEROF; for (n = nlower; n <= nupper; n++) { mz = n+nz; z0 = r1d[2][n]; for (m = nlower; m <= nupper; m++) { my = m+ny; y0 = z0*r1d[1][m]; for (l = nlower; l <= nupper; l++) { mx = l+nx; x0 = y0*r1d[0][l]; if (eflag_atom) u += x0*u_brick[mz][my][mx]; if (vflag_atom) { v0 += x0*v0_brick[mz][my][mx]; v1 += x0*v1_brick[mz][my][mx]; v2 += x0*v2_brick[mz][my][mx]; v3 += x0*v3_brick[mz][my][mx]; v4 += x0*v4_brick[mz][my][mx]; v5 += x0*v5_brick[mz][my][mx]; } } } } const double qfactor = 0.5*force->qqrd2e * scale * q[i]; if (eflag_atom) eatom[i] += u*qfactor; if (vflag_atom) { vatom[i][0] += v0*qfactor; vatom[i][1] += v1*qfactor; vatom[i][2] += v2*qfactor; vatom[i][3] += v3*qfactor; vatom[i][4] += v4*qfactor; vatom[i][5] += v5*qfactor; } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get dispersion field & force on my particles for ik scheme and geometric mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_g_ik() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate electric field from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle const double * const * const x = atom->x; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); double * const * const f = thr->get_f(); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR ekx,eky,ekz; int type; double lj; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid_6[i][0]; ny = part2grid_6[i][1]; nz = part2grid_6[i][2]; dx = nx+shiftone_6 - (x[i][0]-boxlo[0])*delxinv_6; dy = ny+shiftone_6 - (x[i][1]-boxlo[1])*delyinv_6; dz = nz+shiftone_6 - (x[i][2]-boxlo[2])*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz, order_6, rho_coeff_6); ekx = eky = ekz = ZEROF; for (n = nlower_6; n <= nupper_6; n++) { mz = n+nz; z0 = r1d[2][n]; for (m = nlower_6; m <= nupper_6; m++) { my = m+ny; y0 = z0*r1d[1][m]; for (l = nlower_6; l <= nupper_6; l++) { mx = l+nx; x0 = y0*r1d[0][l]; ekx -= x0*vdx_brick_g[mz][my][mx]; eky -= x0*vdy_brick_g[mz][my][mx]; ekz -= x0*vdz_brick_g[mz][my][mx]; } } } // convert E-field to force type = atom->type[i]; lj = B[type]; f[i][0] += lj*ekx; f[i][1] += lj*eky; f[i][2] += lj*ekz; } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get dispersion field & force on my particles for ad scheme and geometric mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_g_ad() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate electric field from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle const double * const * const x = atom->x; double *prd; if (triclinic == 0) prd = domain->prd; else prd = domain->prd_lamda; double xprd = prd[0]; double yprd = prd[1]; double zprd = prd[2]; double zprd_slab = zprd*slab_volfactor; const double hx_inv = nx_pppm_6/xprd; const double hy_inv = ny_pppm_6/yprd; const double hz_inv = nz_pppm_6/zprd_slab; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); double * const * const f = thr->get_f(); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d_6()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz; FFT_SCALAR ekx,eky,ekz; int type; double lj; double sf = 0.0; double s1,s2,s3; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid_6[i][0]; ny = part2grid_6[i][1]; nz = part2grid_6[i][2]; dx = nx+shiftone_6 - (x[i][0]-boxlo[0])*delxinv_6; dy = ny+shiftone_6 - (x[i][1]-boxlo[1])*delyinv_6; dz = nz+shiftone_6 - (x[i][2]-boxlo[2])*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz, order_6, rho_coeff_6); compute_drho1d_thr(dr1d,dx,dy,dz, order_6, drho_coeff_6); ekx = eky = ekz = ZEROF; for (n = nlower_6; n <= nupper_6; n++) { mz = n+nz; for (m = nlower_6; m <= nupper_6; m++) { my = m+ny; for (l = nlower_6; l <= nupper_6; l++) { mx = l+nx; ekx += dr1d[0][l]*r1d[1][m]*r1d[2][n]*u_brick_g[mz][my][mx]; eky += r1d[0][l]*dr1d[1][m]*r1d[2][n]*u_brick_g[mz][my][mx]; ekz += r1d[0][l]*r1d[1][m]*dr1d[2][n]*u_brick_g[mz][my][mx]; } } } ekx *= hx_inv; eky *= hy_inv; ekz *= hz_inv; // convert E-field to force type = atom->type[i]; lj = B[type]; s1 = x[i][0]*hx_inv; s2 = x[i][1]*hy_inv; s3 = x[i][2]*hz_inv; sf = sf_coeff_6[0]*sin(2*MY_PI*s1); sf += sf_coeff_6[1]*sin(4*MY_PI*s1); sf *= 2*lj*lj; f[i][0] += ekx*lj - sf; sf = sf_coeff_6[2]*sin(2*MY_PI*s2); sf += sf_coeff_6[3]*sin(4*MY_PI*s2); sf *= 2*lj*lj; f[i][1] += eky*lj - sf; sf = sf_coeff_6[4]*sin(2*MY_PI*s3); sf += sf_coeff_6[5]*sin(4*MY_PI*s3); sf *= 2*lj*lj; if (slabflag != 2) f[i][2] += ekz*lj - sf; } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get per-atom energy/virial for dispersion interaction and geometric mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_g_peratom() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt const double * const * const x = atom->x; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR u,v0,v1,v2,v3,v4,v5; int type; double lj; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid_6[i][0]; ny = part2grid_6[i][1]; nz = part2grid_6[i][2]; dx = nx+shiftone_6 - (x[i][0]-boxlo[0])*delxinv_6; dy = ny+shiftone_6 - (x[i][1]-boxlo[1])*delyinv_6; dz = nz+shiftone_6 - (x[i][2]-boxlo[2])*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz, order_6, rho_coeff_6); u = v0 = v1 = v2 = v3 = v4 = v5 = ZEROF; for (n = nlower_6; n <= nupper_6; n++) { mz = n+nz; z0 = r1d[2][n]; for (m = nlower_6; m <= nupper_6; m++) { my = m+ny; y0 = z0*r1d[1][m]; for (l = nlower_6; l <= nupper_6; l++) { mx = l+nx; x0 = y0*r1d[0][l]; if (eflag_atom) u += x0*u_brick_g[mz][my][mx]; if (vflag_atom) { v0 += x0*v0_brick_g[mz][my][mx]; v1 += x0*v1_brick_g[mz][my][mx]; v2 += x0*v2_brick_g[mz][my][mx]; v3 += x0*v3_brick_g[mz][my][mx]; v4 += x0*v4_brick_g[mz][my][mx]; v5 += x0*v5_brick_g[mz][my][mx]; } } } } type = atom->type[i]; lj = B[type]*0.5; if (eflag_atom) eatom[i] += u*lj; if (vflag_atom) { vatom[i][0] += v0*lj; vatom[i][1] += v1*lj; vatom[i][2] += v2*lj; vatom[i][3] += v3*lj; vatom[i][4] += v4*lj; vatom[i][5] += v5*lj; } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get dispersion field & force on my particles for ik scheme and arithmetic mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_a_ik() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate electric field from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle const double * const * const x = atom->x; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); double * const * const f = thr->get_f(); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR ekx0, eky0, ekz0, ekx1, eky1, ekz1, ekx2, eky2, ekz2; FFT_SCALAR ekx3, eky3, ekz3, ekx4, eky4, ekz4, ekx5, eky5, ekz5; FFT_SCALAR ekx6, eky6, ekz6; int type; double lj0,lj1,lj2,lj3,lj4,lj5,lj6; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid_6[i][0]; ny = part2grid_6[i][1]; nz = part2grid_6[i][2]; dx = nx+shiftone_6 - (x[i][0]-boxlo[0])*delxinv_6; dy = ny+shiftone_6 - (x[i][1]-boxlo[1])*delyinv_6; dz = nz+shiftone_6 - (x[i][2]-boxlo[2])*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz, order_6, rho_coeff_6); ekx0 = eky0 = ekz0 = ZEROF; ekx1 = eky1 = ekz1 = ZEROF; ekx2 = eky2 = ekz2 = ZEROF; ekx3 = eky3 = ekz3 = ZEROF; ekx4 = eky4 = ekz4 = ZEROF; ekx5 = eky5 = ekz5 = ZEROF; ekx6 = eky6 = ekz6 = ZEROF; for (n = nlower_6; n <= nupper_6; n++) { mz = n+nz; z0 = r1d[2][n]; for (m = nlower_6; m <= nupper_6; m++) { my = m+ny; y0 = z0*r1d[1][m]; for (l = nlower_6; l <= nupper_6; l++) { mx = l+nx; x0 = y0*r1d[0][l]; ekx0 -= x0*vdx_brick_a0[mz][my][mx]; eky0 -= x0*vdy_brick_a0[mz][my][mx]; ekz0 -= x0*vdz_brick_a0[mz][my][mx]; ekx1 -= x0*vdx_brick_a1[mz][my][mx]; eky1 -= x0*vdy_brick_a1[mz][my][mx]; ekz1 -= x0*vdz_brick_a1[mz][my][mx]; ekx2 -= x0*vdx_brick_a2[mz][my][mx]; eky2 -= x0*vdy_brick_a2[mz][my][mx]; ekz2 -= x0*vdz_brick_a2[mz][my][mx]; ekx3 -= x0*vdx_brick_a3[mz][my][mx]; eky3 -= x0*vdy_brick_a3[mz][my][mx]; ekz3 -= x0*vdz_brick_a3[mz][my][mx]; ekx4 -= x0*vdx_brick_a4[mz][my][mx]; eky4 -= x0*vdy_brick_a4[mz][my][mx]; ekz4 -= x0*vdz_brick_a4[mz][my][mx]; ekx5 -= x0*vdx_brick_a5[mz][my][mx]; eky5 -= x0*vdy_brick_a5[mz][my][mx]; ekz5 -= x0*vdz_brick_a5[mz][my][mx]; ekx6 -= x0*vdx_brick_a6[mz][my][mx]; eky6 -= x0*vdy_brick_a6[mz][my][mx]; ekz6 -= x0*vdz_brick_a6[mz][my][mx]; } } } // convert D-field to force type = atom->type[i]; lj0 = B[7*type+6]; lj1 = B[7*type+5]; lj2 = B[7*type+4]; lj3 = B[7*type+3]; lj4 = B[7*type+2]; lj5 = B[7*type+1]; lj6 = B[7*type]; f[i][0] += lj0*ekx0 + lj1*ekx1 + lj2*ekx2 + lj3*ekx3 + lj4*ekx4 + lj5*ekx5 + lj6*ekx6; f[i][1] += lj0*eky0 + lj1*eky1 + lj2*eky2 + lj3*eky3 + lj4*eky4 + lj5*eky5 + lj6*eky6; f[i][2] += lj0*ekz0 + lj1*ekz1 + lj2*ekz2 + lj3*ekz3 + lj4*ekz4 + lj5*ekz5 + lj6*ekz6; } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get dispersion field & force on my particles for ad scheme and arithmetic mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_a_ad() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate electric field from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle const double * const * const x = atom->x; double *prd; if (triclinic == 0) prd = domain->prd; else prd = domain->prd_lamda; double xprd = prd[0]; double yprd = prd[1]; double zprd = prd[2]; double zprd_slab = zprd*slab_volfactor; const double hx_inv = nx_pppm_6/xprd; const double hy_inv = ny_pppm_6/yprd; const double hz_inv = nz_pppm_6/zprd_slab; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); double * const * const f = thr->get_f(); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d_6()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR ekx0, eky0, ekz0, ekx1, eky1, ekz1, ekx2, eky2, ekz2; FFT_SCALAR ekx3, eky3, ekz3, ekx4, eky4, ekz4, ekx5, eky5, ekz5; FFT_SCALAR ekx6, eky6, ekz6; int type; double lj0,lj1,lj2,lj3,lj4,lj5,lj6; double sf = 0.0; double s1,s2,s3; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid_6[i][0]; ny = part2grid_6[i][1]; nz = part2grid_6[i][2]; dx = nx+shiftone_6 - (x[i][0]-boxlo[0])*delxinv_6; dy = ny+shiftone_6 - (x[i][1]-boxlo[1])*delyinv_6; dz = nz+shiftone_6 - (x[i][2]-boxlo[2])*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz, order_6, rho_coeff_6); compute_drho1d_thr(dr1d,dx,dy,dz, order_6, drho_coeff_6); ekx0 = eky0 = ekz0 = ZEROF; ekx1 = eky1 = ekz1 = ZEROF; ekx2 = eky2 = ekz2 = ZEROF; ekx3 = eky3 = ekz3 = ZEROF; ekx4 = eky4 = ekz4 = ZEROF; ekx5 = eky5 = ekz5 = ZEROF; ekx6 = eky6 = ekz6 = ZEROF; for (n = nlower_6; n <= nupper_6; n++) { mz = n+nz; for (m = nlower_6; m <= nupper_6; m++) { my = m+ny; for (l = nlower_6; l <= nupper_6; l++) { mx = l+nx; x0 = dr1d[0][l]*r1d[1][m]*r1d[2][n]; y0 = r1d[0][l]*dr1d[1][m]*r1d[2][n]; z0 = r1d[0][l]*r1d[1][m]*dr1d[2][n]; ekx0 += x0*u_brick_a0[mz][my][mx]; eky0 += y0*u_brick_a0[mz][my][mx]; ekz0 += z0*u_brick_a0[mz][my][mx]; ekx1 += x0*u_brick_a1[mz][my][mx]; eky1 += y0*u_brick_a1[mz][my][mx]; ekz1 += z0*u_brick_a1[mz][my][mx]; ekx2 += x0*u_brick_a2[mz][my][mx]; eky2 += y0*u_brick_a2[mz][my][mx]; ekz2 += z0*u_brick_a2[mz][my][mx]; ekx3 += x0*u_brick_a3[mz][my][mx]; eky3 += y0*u_brick_a3[mz][my][mx]; ekz3 += z0*u_brick_a3[mz][my][mx]; ekx4 += x0*u_brick_a4[mz][my][mx]; eky4 += y0*u_brick_a4[mz][my][mx]; ekz4 += z0*u_brick_a4[mz][my][mx]; ekx5 += x0*u_brick_a5[mz][my][mx]; eky5 += y0*u_brick_a5[mz][my][mx]; ekz5 += z0*u_brick_a5[mz][my][mx]; ekx6 += x0*u_brick_a6[mz][my][mx]; eky6 += y0*u_brick_a6[mz][my][mx]; ekz6 += z0*u_brick_a6[mz][my][mx]; } } } ekx0 *= hx_inv; eky0 *= hy_inv; ekz0 *= hz_inv; ekx1 *= hx_inv; eky1 *= hy_inv; ekz1 *= hz_inv; ekx2 *= hx_inv; eky2 *= hy_inv; ekz2 *= hz_inv; ekx3 *= hx_inv; eky3 *= hy_inv; ekz3 *= hz_inv; ekx4 *= hx_inv; eky4 *= hy_inv; ekz4 *= hz_inv; ekx5 *= hx_inv; eky5 *= hy_inv; ekz5 *= hz_inv; ekx6 *= hx_inv; eky6 *= hy_inv; ekz6 *= hz_inv; // convert D-field to force type = atom->type[i]; lj0 = B[7*type+6]; lj1 = B[7*type+5]; lj2 = B[7*type+4]; lj3 = B[7*type+3]; lj4 = B[7*type+2]; lj5 = B[7*type+1]; lj6 = B[7*type]; s1 = x[i][0]*hx_inv; s2 = x[i][1]*hy_inv; s3 = x[i][2]*hz_inv; sf = sf_coeff_6[0]*sin(2*MY_PI*s1); sf += sf_coeff_6[1]*sin(4*MY_PI*s1); sf *= 4*lj0*lj6 + 4*lj1*lj5 + 4*lj2*lj4 + 2*lj3*lj3; f[i][0] += lj0*ekx0 + lj1*ekx1 + lj2*ekx2 + lj3*ekx3 + lj4*ekx4 + lj5*ekx5 + lj6*ekx6 - sf; sf = sf_coeff_6[2]*sin(2*MY_PI*s2); sf += sf_coeff_6[3]*sin(4*MY_PI*s2); sf *= 4*lj0*lj6 + 4*lj1*lj5 + 4*lj2*lj4 + 2*lj3*lj3; f[i][1] += lj0*eky0 + lj1*eky1 + lj2*eky2 + lj3*eky3 + lj4*eky4 + lj5*eky5 + lj6*eky6 - sf; sf = sf_coeff_6[4]*sin(2*MY_PI*s3); sf += sf_coeff_6[5]*sin(4*MY_PI*s3); sf *= 4*lj0*lj6 + 4*lj1*lj5 + 4*lj2*lj4 + 2*lj3*lj3; if (slabflag != 2) f[i][2] += lj0*ekz0 + lj1*ekz1 + lj2*ekz2 + lj3*ekz3 + lj4*ekz4 + lj5*ekz5 + lj6*ekz6 - sf; } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- interpolate from grid to get per-atom energy/virial for dispersion interaction and arithmetic mixing rule ------------------------------------------------------------------------- */ void PPPMDispOMP::fieldforce_a_peratom() { const int nlocal = atom->nlocal; // no local atoms => nothing to do if (nlocal == 0) return; // loop over my charges, interpolate from nearby grid points // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt const double * const * const x = atom->x; #if defined(_OPENMP) const int nthreads = comm->nthreads; #pragma omp parallel LMP_DEFAULT_NONE #endif { #if defined(_OPENMP) // each thread works on a fixed chunk of atoms. const int tid = omp_get_thread_num(); const int inum = nlocal; const int idelta = 1 + inum/nthreads; const int ifrom = tid*idelta; const int ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else const int ifrom = 0; const int ito = nlocal; const int tid = 0; #endif ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); int l,m,n,nx,ny,nz,mx,my,mz; FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR u0,v00,v10,v20,v30,v40,v50; FFT_SCALAR u1,v01,v11,v21,v31,v41,v51; FFT_SCALAR u2,v02,v12,v22,v32,v42,v52; FFT_SCALAR u3,v03,v13,v23,v33,v43,v53; FFT_SCALAR u4,v04,v14,v24,v34,v44,v54; FFT_SCALAR u5,v05,v15,v25,v35,v45,v55; FFT_SCALAR u6,v06,v16,v26,v36,v46,v56; int type; double lj0,lj1,lj2,lj3,lj4,lj5,lj6; // this if protects against having more threads than local atoms if (ifrom < nlocal) { for (int i = ifrom; i < ito; i++) { nx = part2grid_6[i][0]; ny = part2grid_6[i][1]; nz = part2grid_6[i][2]; dx = nx+shiftone_6 - (x[i][0]-boxlo[0])*delxinv_6; dy = ny+shiftone_6 - (x[i][1]-boxlo[1])*delyinv_6; dz = nz+shiftone_6 - (x[i][2]-boxlo[2])*delzinv_6; compute_rho1d_thr(r1d,dx,dy,dz, order_6, rho_coeff_6); u0 = v00 = v10 = v20 = v30 = v40 = v50 = ZEROF; u1 = v01 = v11 = v21 = v31 = v41 = v51 = ZEROF; u2 = v02 = v12 = v22 = v32 = v42 = v52 = ZEROF; u3 = v03 = v13 = v23 = v33 = v43 = v53 = ZEROF; u4 = v04 = v14 = v24 = v34 = v44 = v54 = ZEROF; u5 = v05 = v15 = v25 = v35 = v45 = v55 = ZEROF; u6 = v06 = v16 = v26 = v36 = v46 = v56 = ZEROF; for (n = nlower_6; n <= nupper_6; n++) { mz = n+nz; z0 = r1d[2][n]; for (m = nlower_6; m <= nupper_6; m++) { my = m+ny; y0 = z0*r1d[1][m]; for (l = nlower_6; l <= nupper_6; l++) { mx = l+nx; x0 = y0*r1d[0][l]; if (eflag_atom) { u0 += x0*u_brick_a0[mz][my][mx]; u1 += x0*u_brick_a1[mz][my][mx]; u2 += x0*u_brick_a2[mz][my][mx]; u3 += x0*u_brick_a3[mz][my][mx]; u4 += x0*u_brick_a4[mz][my][mx]; u5 += x0*u_brick_a5[mz][my][mx]; u6 += x0*u_brick_a6[mz][my][mx]; } if (vflag_atom) { v00 += x0*v0_brick_a0[mz][my][mx]; v10 += x0*v1_brick_a0[mz][my][mx]; v20 += x0*v2_brick_a0[mz][my][mx]; v30 += x0*v3_brick_a0[mz][my][mx]; v40 += x0*v4_brick_a0[mz][my][mx]; v50 += x0*v5_brick_a0[mz][my][mx]; v01 += x0*v0_brick_a1[mz][my][mx]; v11 += x0*v1_brick_a1[mz][my][mx]; v21 += x0*v2_brick_a1[mz][my][mx]; v31 += x0*v3_brick_a1[mz][my][mx]; v41 += x0*v4_brick_a1[mz][my][mx]; v51 += x0*v5_brick_a1[mz][my][mx]; v02 += x0*v0_brick_a2[mz][my][mx]; v12 += x0*v1_brick_a2[mz][my][mx]; v22 += x0*v2_brick_a2[mz][my][mx]; v32 += x0*v3_brick_a2[mz][my][mx]; v42 += x0*v4_brick_a2[mz][my][mx]; v52 += x0*v5_brick_a2[mz][my][mx]; v03 += x0*v0_brick_a3[mz][my][mx]; v13 += x0*v1_brick_a3[mz][my][mx]; v23 += x0*v2_brick_a3[mz][my][mx]; v33 += x0*v3_brick_a3[mz][my][mx]; v43 += x0*v4_brick_a3[mz][my][mx]; v53 += x0*v5_brick_a3[mz][my][mx]; v04 += x0*v0_brick_a4[mz][my][mx]; v14 += x0*v1_brick_a4[mz][my][mx]; v24 += x0*v2_brick_a4[mz][my][mx]; v34 += x0*v3_brick_a4[mz][my][mx]; v44 += x0*v4_brick_a4[mz][my][mx]; v54 += x0*v5_brick_a4[mz][my][mx]; v05 += x0*v0_brick_a5[mz][my][mx]; v15 += x0*v1_brick_a5[mz][my][mx]; v25 += x0*v2_brick_a5[mz][my][mx]; v35 += x0*v3_brick_a5[mz][my][mx]; v45 += x0*v4_brick_a5[mz][my][mx]; v55 += x0*v5_brick_a5[mz][my][mx]; v06 += x0*v0_brick_a6[mz][my][mx]; v16 += x0*v1_brick_a6[mz][my][mx]; v26 += x0*v2_brick_a6[mz][my][mx]; v36 += x0*v3_brick_a6[mz][my][mx]; v46 += x0*v4_brick_a6[mz][my][mx]; v56 += x0*v5_brick_a6[mz][my][mx]; } } } } // convert D-field to force type = atom->type[i]; lj0 = B[7*type+6]*0.5; lj1 = B[7*type+5]*0.5; lj2 = B[7*type+4]*0.5; lj3 = B[7*type+3]*0.5; lj4 = B[7*type+2]*0.5; lj5 = B[7*type+1]*0.5; lj6 = B[7*type]*0.5; if (eflag_atom) eatom[i] += u0*lj0 + u1*lj1 + u2*lj2 + u3*lj3 + u4*lj4 + u5*lj5 + u6*lj6; if (vflag_atom) { vatom[i][0] += v00*lj0 + v01*lj1 + v02*lj2 + v03*lj3 + v04*lj4 + v05*lj5 + v06*lj6; vatom[i][1] += v10*lj0 + v11*lj1 + v12*lj2 + v13*lj3 + v14*lj4 + v15*lj5 + v16*lj6; vatom[i][2] += v20*lj0 + v21*lj1 + v22*lj2 + v23*lj3 + v24*lj4 + v25*lj5 + v26*lj6; vatom[i][3] += v30*lj0 + v31*lj1 + v32*lj2 + v33*lj3 + v34*lj4 + v35*lj5 + v36*lj6; vatom[i][4] += v40*lj0 + v41*lj1 + v42*lj2 + v43*lj3 + v44*lj4 + v45*lj5 + v46*lj6; vatom[i][5] += v50*lj0 + v51*lj1 + v52*lj2 + v53*lj3 + v54*lj4 + v55*lj5 + v56*lj6; } } } thr->timer(Timer::KSPACE); } // end of parallel region } /* ---------------------------------------------------------------------- charge assignment into rho1d dx,dy,dz = distance of particle from "lower left" grid point ------------------------------------------------------------------------- */ void PPPMDispOMP::compute_rho1d_thr(FFT_SCALAR * const * const r1d, const FFT_SCALAR &dx, const FFT_SCALAR &dy, const FFT_SCALAR &dz, const int ord, FFT_SCALAR * const * const rho_c) { int k,l; FFT_SCALAR r1,r2,r3; for (k = (1-ord)/2; k <= ord/2; k++) { r1 = r2 = r3 = ZEROF; for (l = ord-1; l >= 0; l--) { r1 = rho_c[l][k] + r1*dx; r2 = rho_c[l][k] + r2*dy; r3 = rho_c[l][k] + r3*dz; } r1d[0][k] = r1; r1d[1][k] = r2; r1d[2][k] = r3; } } /* ---------------------------------------------------------------------- charge assignment into drho1d dx,dy,dz = distance of particle from "lower left" grid point ------------------------------------------------------------------------- */ void PPPMDispOMP::compute_drho1d_thr(FFT_SCALAR * const * const dr1d, const FFT_SCALAR &dx, const FFT_SCALAR &dy, const FFT_SCALAR &dz, const int ord, FFT_SCALAR * const * const drho_c) { int k,l; FFT_SCALAR r1,r2,r3; for (k = (1-ord)/2; k <= ord/2; k++) { r1 = r2 = r3 = ZEROF; for (l = ord-2; l >= 0; l--) { r1 = drho_c[l][k] + r1*dx; r2 = drho_c[l][k] + r2*dy; r3 = drho_c[l][k] + r3*dz; } dr1d[0][k] = r1; dr1d[1][k] = r2; dr1d[2][k] = r3; } }
pastewka/lammps
src/USER-OMP/pppm_disp_omp.cpp
C++
gpl-2.0
60,903
# Sailboat-MDX Autonomous Sailboat
JP895/Sailboat-MDX
README.md
Markdown
gpl-2.0
35
<?php /** * The template for displaying Advice Category pages * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Skillcrush_Starter * @since Skillcrush Starter 1.0 */ get_header(); ?> <div class="container wrap"> <?php if ( have_posts() ) : ?> <header class="top-head-title"> <?php printf( __( 'Posts categorized as <span>%s</span>', 'skillcrushstarter' ), single_cat_title( '', false ) ); ?> </header><!-- .category-header --> <div class="main-content"> <?php // Show an optional term description. $term_description = term_description(); if ( ! empty( $term_description ) ) : printf( '<div class="taxonomy-description">%s</div>', $term_description ); endif; ?> </header><!-- .category-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <!-- next / prev here --> <?php else: ?> <article> <h4>No posts found!</h4> </article> <?php endif; ?> </div><!-- main-content --> <?php get_sidebar(); ?> </div><!-- container wrap --> <?php get_footer();
druid726/wordpress
wp-content/themes/skillcrushstarter/category-career.php
PHP
gpl-2.0
1,183
#ifndef __SERVER_SHARE_RS2GS_REGISTER_H__ #define __SERVER_SHARE_RS2GS_REGISTER_H__ #include "NDServerShare.h" #include "protocol/NDCmdProtocolS2S.h" class NDRS2GS_Register_Req : public NDProtocol { public: NDUint16 m_nRoomServerID; NDSocketAddress m_netAddress; public: NDRS2GS_Register_Req() : NDProtocol( CMDP_NDRS2GS_Register_Req ) { clear(); } ~NDRS2GS_Register_Req() {} NDBool serialize(NDOStream& stream) { NDOSTREAM_WRITE( stream, &m_unProtocolID, sizeof(m_unProtocolID) ) NDOSTREAM_WRITE( stream, &m_nRoomServerID, sizeof(m_nRoomServerID) ) NDOSTREAM_WRITE( stream, &m_netAddress, sizeof(m_netAddress) ) return NDTrue; } NDBool deserialize(NDIStream& stream) { NDISTREAM_READ( stream, &m_nRoomServerID, sizeof(m_nRoomServerID) ) NDISTREAM_READ( stream, &m_netAddress, sizeof(m_netAddress) ) return NDTrue; } NDUint16 getSize() const { return sizeof(m_unProtocolID) + sizeof(m_nRoomServerID) + sizeof(m_netAddress); } void clear() { m_nRoomServerID = 0; m_netAddress.clear(); } }; class NDRS2GS_Register_Res : public NDProtocol { public: NDUint32 m_nErrorCode; public: NDRS2GS_Register_Res() : NDProtocol( CMDP_NDRS2GS_Register_Res ) { clear(); } ~NDRS2GS_Register_Res() {} NDBool serialize(NDOStream& stream) { NDOSTREAM_WRITE( stream, &m_unProtocolID, sizeof(m_unProtocolID) ) NDOSTREAM_WRITE( stream, &m_nErrorCode, sizeof(m_nErrorCode) ) return NDTrue; } NDBool deserialize(NDIStream& stream) { NDISTREAM_READ( stream, &m_nErrorCode, sizeof(m_nErrorCode) ) return NDTrue; } NDUint16 getSize() const { return sizeof(m_unProtocolID) + sizeof(m_nErrorCode); } void clear() { m_nErrorCode = 0; } }; #endif
quire7/NDServerEngine
NDServerShare/include/protocol/NDRoomToNDGame/NDRS2GS_Register.h
C
gpl-2.0
1,707
/* * I/O -- I/O handling for multiple fds * * Copyright (C) 2009 Martin Wolters et al. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to * the Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301, USA * */ #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <sys/poll.h> #include <time.h> #include "io.h" LIST_HEAD(iolist); LIST_HEAD(timerlist); unsigned long iocnt = 0; int io_initialized = 0; int io_init(void) { if (io_initialized) return 0; if (atexit(io_clear)) return -1; io_initialized = 1; return 0; } iod_t *io_getentry(int d) { iod_t *iod; if (list_empty(&iolist)) return NULL; list_for_each_entry(iod, &iolist, elm) if (iod->d == d && !iod->remove) return iod; return NULL; } int io_register(int d) { iod_t *iod; int flags; if (io_getentry(d)) return 0; if (io_init()) return -1; iod = calloc(1, sizeof(iod_t)); if (!iod) return -1; flags = fcntl(d, F_GETFL); if (flags == -1) { free(iod); return -1; } if (fcntl(d, F_SETFL, flags | O_NONBLOCK) < 0) { free(iod); return -1; } iod->d = d; list_add(&iod->elm, &iolist); ++iocnt; return 0; } int io_unregister(int d) { iod_t *iod; iod = io_getentry(d); if (!iod) return -1; iod->remove = 1; --iocnt; return 0; } int io_close(int *d) { int rv = 0; if (*d != -1) { rv = io_unregister(*d); (void)close(*d); *d = -1; } return rv; } int io_wantread(int d, int (*func)(void *)) { iod_t *iod; iod = io_getentry(d); if (!iod) return -1; iod->can_read = func; return 0; } int io_wantwrite(int d, int (*func)(void *)) { iod_t *iod; iod = io_getentry(d); if (!iod) return -1; iod->can_write = func; return 0; } int io_setptr(int d, void *ptr) { iod_t *iod; iod = io_getentry(d); if (!iod) return -1; iod->ptr = ptr; return 0; } int io_settimer(void (*func)(unsigned long)) { iot_t *iot; if (!func) return -1; if (io_init()) return -1; iot = calloc(1, sizeof(iot_t)); if (!iot) return -1; iot->func = func; list_add(&iot->elm, &timerlist); return 0; } int io_unsettimer(void (*func)(unsigned long)) { iot_t *iot; list_for_each_entry(iot, &timerlist, elm) { if (iot->func == func) { iot->remove = 1; return 0; } } return -1; } void io_clear(void) { iot_t *iot; iod_t *iod; while(!list_empty(&timerlist)) { iot = list_entry(timerlist.next, iot_t, elm); list_del(&iot->elm); free(iot); } while(!list_empty(&iolist)) { iod = list_entry(iolist.next, iod_t, elm); list_del(&iod->elm); free(iod); } } int io_loop(int msec) { struct pollfd *fds; iod_t *iod, *niod; unsigned long n, cnt; iot_t *iot, *niot; if (list_empty(&iolist)) { if (msec > 0) usleep(msec * 1000); return 0; } cnt = iocnt; fds = malloc(cnt * sizeof(struct pollfd)); if (!fds) { if (msec > 0) usleep(msec * 1000); return -1; } n = 0; list_for_each_entry_safe(iod, niod, &iolist, elm) { if (iod->remove) { list_del(&iod->elm); free(iod); } else { fds[n].fd = iod->d; fds[n].events = 0; if (iod->can_read) fds[n].events |= POLLIN; if (iod->can_write) fds[n].events |= POLLOUT; if (++n == cnt) break; } } list_for_each_entry_safe(iot, niot, &timerlist, elm) { if (iot->remove) { list_del(&iot->elm); free(iot); } } if (poll(fds, n, msec) == -1) { free(fds); if (msec > 0) usleep(msec * 1000); return -1; } n = 0; list_for_each_entry(iod, &iolist, elm) { if (fds[n].fd != iod->d) continue; if (!iod->remove && iod->can_write && fds[n].revents & POLLOUT) iod->can_write(iod->ptr); if (!iod->remove && iod->can_read && fds[n].revents & POLLIN) iod->can_read(iod->ptr); if(++n == cnt) break; } free(fds); n = time(NULL); list_for_each_entry(iot, &timerlist, elm) { if (!iot->remove) iot->func(n); } return 0; }
SirDzstic/boskop-ng
src/io.c
C
gpl-2.0
4,934
package app import ( "errors" "net/http" "strings" "github.com/h2object/h2object/httpext" ) func acl_filter(ctx *context, c *ext.Controller, filters []filter) { if done := do_authentic(ctx, c); done { ctx.Info("request (%s) (%s) done by acl", c.Request.MethodToLower(), c.Request.URI()) return } filters[0](ctx, c, filters[1:]) } func do_authentic(ctx *context, ctrl *ext.Controller) bool { r := ctrl.Request required := false switch r.MethodToLower() { case "get": switch r.Suffix() { case "page": fallthrough case "click": fallthrough case "system": required = true } if r.URI() == "/stats" { required = true } case "put": required = true if ctx.storage_full() { ctrl.JsonError(http.StatusForbidden, errors.New("application storage reach max limit.")) return true } case "delete": required = true } token := r.Param("token") if token == "" { authorization := r.Header.Get("Authorization") if strings.HasPrefix(authorization, "H2OBJECT ") { token = authorization[len("H2OBJECT "):] } } if required { if token != ctx.signature { ctrl.JsonError(http.StatusUnauthorized, errors.New("require administrator right")) return true } } return false }
h2object/h2object
app/acl.go
GO
gpl-2.0
1,236
/* Copyright (C) 2000 The PARI group. This file is part of the PARI/GP package. PARI/GP 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. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /*******************************************************************/ /** **/ /** LIBRARY ROUTINES FOR PARI CALCULATOR **/ /** **/ /*******************************************************************/ #ifdef _WIN32 # include "../systems/mingw/pwinver.h" # include <windows.h> # include "../systems/mingw/mingw.h" # include <process.h> #endif #ifdef __EMSCRIPTEN__ #include "../systems/emscripten/emscripten.h" #endif #include "pari.h" #include "paripriv.h" /********************************************************************/ /** **/ /** STRINGS **/ /** **/ /********************************************************************/ void pari_skip_space(char **s) { char *t = *s; while (isspace((int)*t)) t++; *s = t; } void pari_skip_alpha(char **s) { char *t = *s; while (isalpha((int)*t)) t++; *s = t; } /*******************************************************************/ /** **/ /** BUFFERS **/ /** **/ /*******************************************************************/ static Buffer **bufstack; static pari_stack s_bufstack; void pari_init_buffers(void) { pari_stack_init(&s_bufstack, sizeof(Buffer*), (void**)&bufstack); } void pop_buffer(void) { if (s_bufstack.n) delete_buffer( bufstack[ --s_bufstack.n ] ); } /* kill all buffers until B is met or nothing is left */ void kill_buffers_upto(Buffer *B) { while (s_bufstack.n) { if (bufstack[ s_bufstack.n-1 ] == B) break; pop_buffer(); } } void kill_buffers_upto_including(Buffer *B) { while (s_bufstack.n) { if (bufstack[ s_bufstack.n-1 ] == B) { pop_buffer(); break; } pop_buffer(); } } static int disable_exception_handler = 0; #define BLOCK_EH_START \ { \ int block=disable_exception_handler;\ disable_exception_handler = 1; #define BLOCK_EH_END \ disable_exception_handler = block;\ } /* numerr < 0: from SIGINT */ int gp_handle_exception(long numerr) { if (disable_exception_handler) disable_exception_handler = 0; else if (GP_DATA->breakloop && cb_pari_break_loop && cb_pari_break_loop(numerr)) return 1; return 0; } /********************************************************************/ /** **/ /** HELP **/ /** **/ /********************************************************************/ void pari_hit_return(void) { int c; if (GP_DATA->flags & (gpd_EMACS|gpd_TEXMACS)) return; BLOCK_EH_START pari_puts("/*-- (type RETURN to continue) --*/"); pari_flush(); /* if called from a readline callback, may be in a funny TTY mode */ do c = fgetc(stdin); while (c >= 0 && c != '\n' && c != '\r'); pari_putc('\n'); BLOCK_EH_END } static int has_ext_help(void) { return (GP_DATA->help && *GP_DATA->help); } static int compare_str(char **s1, char **s2) { return strcmp(*s1, *s2); } /* Print all elements of list in columns, pausing every nbli lines * if nbli is non-zero. * list is a NULL terminated list of function names */ void print_fun_list(char **list, long nbli) { long i=0, j=0, maxlen=0, nbcol,len, w = term_width(); char **l; while (list[i]) i++; qsort (list, i, sizeof(char *), (QSCOMP)compare_str); for (l=list; *l; l++) { len = strlen(*l); if (len > maxlen) maxlen=len; } maxlen++; nbcol= w / maxlen; if (nbcol * maxlen == w) nbcol--; if (!nbcol) nbcol = 1; pari_putc('\n'); i=0; for (l=list; *l; l++) { pari_puts(*l); i++; if (i >= nbcol) { i=0; pari_putc('\n'); if (nbli && j++ > nbli) { j = 0; pari_hit_return(); } continue; } len = maxlen - strlen(*l); while (len--) pari_putc(' '); } if (i) pari_putc('\n'); } static const long MAX_SECTION = 14; static void commands(long n) { long i; entree *ep; char **t_L; pari_stack s_L; pari_stack_init(&s_L, sizeof(*t_L), (void**)&t_L); for (i = 0; i < functions_tblsz; i++) for (ep = functions_hash[i]; ep; ep = ep->next) { long m; switch (EpVALENCE(ep)) { case EpVAR: if (typ((GEN)ep->value) == t_CLOSURE) break; /* fall through */ case EpNEW: continue; } m = ep->menu; if (m == n || (n < 0 && m && m <= MAX_SECTION)) pari_stack_pushp(&s_L, (void*)ep->name); } pari_stack_pushp(&s_L, NULL); print_fun_list(t_L, term_height()-4); pari_stack_delete(&s_L); } void pari_center(const char *s) { pari_sp av = avma; long i, l = strlen(s), pad = term_width() - l; char *buf, *u; if (pad<0) pad=0; else pad >>= 1; u = buf = stack_malloc(l + pad + 2); for (i=0; i<pad; i++) *u++ = ' '; while (*s) *u++ = *s++; *u++ = '\n'; *u = 0; pari_puts(buf); avma = av; } static void community(void) { print_text("The PARI/GP distribution includes a reference manual, a \ tutorial, a reference card and quite a few examples. They have been installed \ in the directory "); pari_puts(" "); pari_puts(pari_datadir); pari_puts("\nYou can also download them from http://pari.math.u-bordeaux.fr/.\ \n\nThree mailing lists are devoted to PARI:\n\ - pari-announce (moderated) to announce major version changes.\n\ - pari-dev for everything related to the development of PARI, including\n\ suggestions, technical questions, bug reports and patch submissions.\n\ - pari-users for everything else!\n\ To subscribe, send an empty message to\n\ <pari_list_name>-request@pari.math.u-bordeaux.fr\n\ with a Subject: field containing the word 'subscribe'.\n\n"); print_text("An archive is kept at the WWW site mentioned above. You can also \ reach the authors at pari@math.u-bordeaux.fr (answer not guaranteed)."); } static void gentypes(void) { pari_puts("List of the PARI types:\n\ t_INT : long integers [ cod1 ] [ cod2 ] [ man_1 ] ... [ man_k ]\n\ t_REAL : long real numbers [ cod1 ] [ cod2 ] [ man_1 ] ... [ man_k ]\n\ t_INTMOD : integermods [ code ] [ mod ] [ integer ]\n\ t_FRAC : irred. rationals [ code ] [ num. ] [ den. ]\n\ t_FFELT : finite field elt. [ code ] [ cod2 ] [ elt ] [ mod ] [ p ]\n\ t_COMPLEX: complex numbers [ code ] [ real ] [ imag ]\n\ t_PADIC : p-adic numbers [ cod1 ] [ cod2 ] [ p ] [ p^r ] [ int ]\n\ t_QUAD : quadratic numbers [ cod1 ] [ mod ] [ real ] [ imag ]\n\ t_POLMOD : poly mod [ code ] [ mod ] [ polynomial ]\n\ -------------------------------------------------------------\n\ t_POL : polynomials [ cod1 ] [ cod2 ] [ man_1 ] ... [ man_k ]\n\ t_SER : power series [ cod1 ] [ cod2 ] [ man_1 ] ... [ man_k ]\n\ t_RFRAC : irred. rat. func. [ code ] [ num. ] [ den. ]\n\ t_QFR : real qfb [ code ] [ a ] [ b ] [ c ] [ del ]\n\ t_QFI : imaginary qfb [ code ] [ a ] [ b ] [ c ]\n\ t_VEC : row vector [ code ] [ x_1 ] ... [ x_k ]\n\ t_COL : column vector [ code ] [ x_1 ] ... [ x_k ]\n\ t_MAT : matrix [ code ] [ col_1 ] ... [ col_k ]\n\ t_LIST : list [ cod1 ] [ cod2 ][ vec ]\n\ t_STR : string [ code ] [ man_1 ] ... [ man_k ]\n\ t_VECSMALL: vec. small ints [ code ] [ x_1 ] ... [ x_k ]\n\ t_CLOSURE: functions [ code ] [ arity ] [ code ] [ operand ] [ data ] [ text ]\n\ t_ERROR : error context [ code ] [ errnum ] [ dat_1 ] ... [ dat_k ]\n\ t_INFINITY: a*infinity [ code ] [ a ]\n\ \n"); } static void menu_commands(void) { ulong i; const char *s[] = { "user-defined functions (aliases, installed and user functions)", "Standard monadic or dyadic OPERATORS", "CONVERSIONS and similar elementary functions", "TRANSCENDENTAL functions", "NUMBER THEORETICAL functions", "ELLIPTIC CURVES", "L-FUNCTIONS", /* "MODULAR FORMS", */ "MODULAR SYMBOLS", "General NUMBER FIELDS", "Associative and central simple ALGEBRAS", "POLYNOMIALS and power series", "Vectors, matrices, LINEAR ALGEBRA and sets", "SUMS, products, integrals and similar functions", "GRAPHIC functions", "PROGRAMMING under GP", "The PARI community" }; pari_puts("Help topics: for a list of relevant subtopics, type ?n for n in\n"); for (i = 0; i < numberof(s); i++) pari_printf(" %2lu: %s\n", i, s[i]); pari_puts("Also:\n\ ? functionname (short on-line help)\n\ ?\\ (keyboard shortcuts)\n\ ?. (member functions)\n"); if (has_ext_help()) pari_puts("\ Extended help (if available):\n\ ?? (opens the full user's manual in a dvi previewer)\n\ ?? tutorial / refcard / libpari (tutorial/reference card/libpari manual)\n\ ?? refcard-ell (or -lfun/-mf/-nf: specialized reference card)\n\ ?? keyword (long help text about \"keyword\" from the user's manual)\n\ ??? keyword (a propos: list of related functions)."); } static void slash_commands(void) { pari_puts("# : enable/disable timer\n\ ## : print time for last result\n\ \\\\ : comment up to end of line\n\ \\a {n} : print result in raw format (readable by PARI)\n\ \\B {n} : print result in beautified format\n\ \\c : list all commands (same effect as ?*)\n\ \\d : print all defaults\n\ \\e {n} : enable/disable echo (set echo=n)\n\ \\g {n} : set debugging level\n\ \\gf{n} : set file debugging level\n\ \\gm{n} : set memory debugging level\n\ \\h {m-n}: hashtable information\n\ \\l {f} : enable/disable logfile (set logfile=f)\n\ \\m {n} : print result in prettymatrix format\n\ \\o {n} : set output method (0=raw, 1=prettymatrix, 2=prettyprint, 3=2-dim)\n\ \\p {n} : change real precision\n\ \\pb{n} : change real bit precision\n\ \\ps{n} : change series precision\n\ \\q : quit completely this GP session\n\ \\r {f} : read in a file\n\ \\s : print stack information\n\ \\t : print the list of PARI types\n\ \\u : print the list of user-defined functions\n\ \\um : print the list of user-defined member functions\n\ \\v : print current version of GP\n\ \\w {nf} : write to a file\n\ \\x {n} : print complete inner structure of result\n\ \\y {n} : disable/enable automatic simplification (set simplify=n)\n\ \n\ {f}=optional filename. {n}=optional integer\n"); } static void member_commands(void) { pari_puts("\ Member functions, followed by relevant objects\n\n\ a1-a6, b2-b8, c4-c6 : coeff. of the curve. ell\n\ area : area ell\n\ bid : big ideal bid, bnr\n\ bnf : big number field bnf,bnr\n\ clgp : class group bid, bnf,bnr\n\ cyc : cyclic decomposition (SNF) bid, clgp,ell, bnf,bnr\n\ diff, codiff: different and codifferent nf,bnf,bnr\n\ disc : discriminant ell,nf,bnf,bnr,rnf\n\ e, f : inertia/residue degree prid\n\ fu : fundamental units bnf,bnr\n\ gen : generators bid,prid,clgp,ell, bnf,bnr, gal\n\ group: group ell, ,rnf,gal\n\ index: index nf,bnf,bnr\n\ j : j-invariant ell\n"); /* split: some compilers can't handle long constant strings */ pari_puts("\ mod : modulus bid, bnr, gal\n\ nf : number field nf,bnf,bnr,rnf\n\ no : number of elements bid, clgp,ell, bnf,bnr\n\ omega, eta: [w1,w2] and [eta1, eta2] ell\n\ orders: relative orders of generators gal\n\ p : rational prime prid, ell, rnf,gal\n\ pol : defining polynomial nf,bnf,bnr, gal\n\ polabs: defining polynomial over Q rnf\n\ reg : regulator bnf,bnr\n\ roots: roots ell,nf,bnf,bnr, gal\n\ sign,r1,r2 : signature nf,bnf,bnr\n\ t2 : t2 matrix nf,bnf,bnr\n\ tate : Tate's [u^2, u, q, [a,b], L, Ei] ell\n\ tu : torsion unit and its order bnf,bnr\n\ zk : integral basis nf,bnf,bnr,rnf\n\ zkst : structure of (Z_K/m)* bid, bnr\n"); } #define QUOTE "_QUOTE" #define DOUBQUOTE "_DOUBQUOTE" #define BACKQUOTE "_BACKQUOTE" static char * _cat(char *s, const char *t) { *s = 0; strcat(s,t); return s + strlen(t); } static char * filter_quotes(const char *s) { int i, l = strlen(s); int quote = 0; int backquote = 0; int doubquote = 0; char *str, *t; for (i=0; i < l; i++) switch(s[i]) { case '\'': quote++; break; case '`' : backquote++; break; case '"' : doubquote++; } str = (char*)pari_malloc(l + quote * (strlen(QUOTE)-1) + doubquote * (strlen(DOUBQUOTE)-1) + backquote * (strlen(BACKQUOTE)-1) + 1); t = str; for (i=0; i < l; i++) switch(s[i]) { case '\'': t = _cat(t, QUOTE); break; case '`' : t = _cat(t, BACKQUOTE); break; case '"' : t = _cat(t, DOUBQUOTE); break; default: *t++ = s[i]; } *t = 0; return str; } static int nl_read(char *s) { size_t l = strlen(s); return s[l-1] == '\n'; } /* query external help program for s. num < 0 [keyword] or chapter number */ static void external_help(const char *s, int num) { long nbli = term_height()-3, li = 0; char buf[256], *str; const char *opt = "", *ar = "", *cdir = ""; char *t, *help = GP_DATA->help; pariFILE *z; FILE *f; #ifdef __EMSCRIPTEN__ pari_emscripten_help(s); #endif if (!has_ext_help()) pari_err(e_MISC,"no external help program"); t = filter_quotes(s); if (num < 0) opt = "-k"; else if (t[strlen(t)-1] != '@') ar = stack_sprintf("@%d",num); #ifdef _WIN32 if (*help=='@') { const char *basedir = win32_basedir(); help++; cdir = stack_sprintf("%c:& cd %s & ", *basedir, basedir); } #endif str=stack_sprintf("%s%s -fromgp %s %c%s%s%c",cdir,help,opt, SHELL_Q,t,ar,SHELL_Q); z = try_pipe(str,0); f = z->file; pari_free(t); while (fgets(buf, numberof(buf), f)) { if (!strncmp("ugly_kludge_done",buf,16)) break; pari_puts(buf); if (nl_read(buf) && ++li > nbli) { pari_hit_return(); li = 0; } } pari_fclose(z); } const char ** gphelp_keyword_list(void) { static const char *L[]={ "operator", "libpari", "member", "integer", "real", "readline", "refcard", "refcard-nf", "refcard-ell", "refcard-mf", "refcard-lfun", "tutorial", "nf", "bnf", "bnr", "ell", "rnf", "bid", "modulus", "prototype", "Lmath", "Ldata", "Linit", NULL}; return L; } static int ok_external_help(char **s) { const char **L; long n; if (!**s) return 1; if (!isalpha((int)**s)) return 3; /* operator or section number */ if (!strncmp(*s,"t_",2)) { *s += 2; return 2; } /* type name */ L = gphelp_keyword_list(); for (n=0; L[n]; n++) if (!strcmp(*s,L[n])) return 3; return 0; } static void cut_trailing_garbage(char *s) { char c; while ( (c = *s++) ) { if (c == '\\' && ! *s++) return; /* gobble next char, return if none. */ if (!is_keyword_char(c) && c != '@') { s[-1] = 0; return; } } } static void digit_help(char *s, long flag) { long n = atoi(s); if (n < 0 || n > MAX_SECTION+4) pari_err(e_SYNTAX,"no such section in help: ?",s,s); if (n == MAX_SECTION+1) community(); else if (flag & h_LONG) external_help(s,3); else commands(n); return; } static void simple_help(const char *s1, const char *s2) { pari_printf("%s: %s\n", s1, s2); } static void default_help(char *s, long flag) { if (flag & h_LONG) external_help(stack_strcat("se:def,",s),3); else simple_help(s,"default"); } static void help(const char *s0, int flag) { const long long_help = flag & h_LONG; long n; entree *ep; char *s = get_sep(s0); if (isdigit((int)*s)) { digit_help(s,flag); return; } if (flag & h_APROPOS) { external_help(s,-1); return; } /* Get meaningful answer on '\ps 5' (e.g. from <F1>) */ if (*s == '\\') { char *t = s+1; pari_skip_alpha(&t); *t = '\0'; } if (isalpha((int)*s)) { if (!strncmp(s, "default", 7)) { /* special-case ?default(dft_name), e.g. default(log) */ char *t = s+7; pari_skip_space(&t); if (*t == '(') { t++; pari_skip_space(&t); cut_trailing_garbage(t); if (pari_is_default(t)) { default_help(t,flag); return; } } } if (!strncmp(s, "refcard-", 8)) cut_trailing_garbage(s+8); else cut_trailing_garbage(s); } if (long_help && (n = ok_external_help(&s))) { external_help(s,n); return; } switch (*s) { case '*' : commands(-1); return; case '\0': menu_commands(); return; case '\\': slash_commands(); return; case '.' : member_commands(); return; } ep = is_entry(s); if (!ep) { if (pari_is_default(s)) default_help(s,flag); else if (long_help) external_help(s,3); else if (!cb_pari_whatnow || !cb_pari_whatnow(pariOut, s,1)) simple_help(s,"unknown identifier"); return; } if (EpVALENCE(ep) == EpALIAS) { pari_printf("%s is aliased to:\n\n",s); ep = do_alias(ep); } switch(EpVALENCE(ep)) { case EpVAR: if (!ep->help) { if (typ((GEN)ep->value)!=t_CLOSURE) simple_help(s, "user defined variable"); else { GEN str = closure_get_text((GEN)ep->value); if (typ(str) == t_VEC) pari_printf("%s =\n %Ps\n", ep->name, ep->value); } return; } break; case EpINSTALL: if (!ep->help) { simple_help(s, "installed function"); return; } break; case EpNEW: if (!ep->help) { simple_help(s, "new identifier"); return; }; break; default: /* built-in function */ if (!ep->help) pari_err_BUG("gp_help (no help found)"); /*paranoia*/ if (long_help) { external_help(ep->name,3); return; } } print_text(ep->help); } void gp_help(const char *s, long flag) { pari_sp av = avma; if ((flag & h_RL) == 0) { if (*s == '?') { flag |= h_LONG; s++; } if (*s == '?') { flag |= h_APROPOS; s++; } } term_color(c_HELP); help(s,flag); term_color(c_NONE); if ((flag & h_RL) == 0) pari_putc('\n'); avma = av; } /********************************************************************/ /** **/ /** GP HEADER **/ /** **/ /********************************************************************/ static char * what_readline(void) { #ifdef READLINE const char *v = READLINE; char *s = stack_malloc(3 + strlen(v) + 8); (void)sprintf(s, "v%s %s", v, GP_DATA->use_readline? "enabled": "disabled"); return s; #else return (char*)"not compiled in"; #endif } static char * what_cc(void) { char *s; #ifdef GCC_VERSION # ifdef __cplusplus # define Format "(C++) %s" # else # define Format "%s" # endif s = stack_malloc(6 + strlen(GCC_VERSION) + 1); (void)sprintf(s, Format, GCC_VERSION); #else # ifdef _MSC_VER s = stack_malloc(32); (void)sprintf(s, "MSVC-%i", _MSC_VER); # else s = NULL; # endif #endif return s; } static void convert_time(char *s, long delay) { if (delay >= 3600000) { sprintf(s, "%ldh, ", delay / 3600000); s+=strlen(s); delay %= 3600000; } if (delay >= 60000) { sprintf(s, "%ldmin, ", delay / 60000); s+=strlen(s); delay %= 60000; } if (delay >= 1000) { sprintf(s, "%ld,", delay / 1000); s+=strlen(s); delay %= 1000; if (delay < 100) { sprintf(s, "%s", (delay<10)? "00": "0"); s+=strlen(s); } } sprintf(s, "%ld ms", delay); s+=strlen(s); } /* Format a time of 'delay' ms */ const char * gp_format_time(long delay) { static char buf[64]; char *s = buf; term_get_color(s, c_TIME); convert_time(s + strlen(s), delay); s+=strlen(s); term_get_color(s, c_NONE); s+=strlen(s); s[0] = '.'; s[1] = '\n'; s[2] = 0; return buf; } /********************************************************************/ /* */ /* GPRC */ /* */ /********************************************************************/ /* LOCATE GPRC */ static void err_gprc(const char *s, char *t, char *u) { err_printf("\n"); pari_err(e_SYNTAX,s,t,u); } /* return $HOME or the closest we can find */ static const char * get_home(int *free_it) { char *drv, *pth = os_getenv("HOME"); if (pth) return pth; if ((drv = os_getenv("HOMEDRIVE")) && (pth = os_getenv("HOMEPATH"))) { /* looks like WinNT */ char *buf = (char*)pari_malloc(strlen(pth) + strlen(drv) + 1); sprintf(buf, "%s%s",drv,pth); *free_it = 1; return buf; } pth = pari_get_homedir(""); return pth? pth: "."; } static FILE * gprc_chk(const char *s) { FILE *f = fopen(s, "r"); if (f && !(GP_DATA->flags & gpd_QUIET)) err_printf("Reading GPRC: %s ...", s); return f; } /* Look for [._]gprc: $GPRC, then in $HOME, ., /etc, pari_datadir */ static FILE * gprc_get(void) { FILE *f = NULL; const char *gprc = os_getenv("GPRC"); if (gprc) f = gprc_chk(gprc); if (!f) { int free_it = 0; const char *home = get_home(&free_it); char *str, *s, c; long l; l = strlen(home); c = home[l-1]; /* + "/gprc.txt" + \0*/ str = strcpy((char*)pari_malloc(l+10), home); if (free_it) pari_free((void*)home); s = str + l; if (c != '/' && c != '\\') *s++ = '/'; #ifndef _WIN32 strcpy(s, ".gprc"); #else strcpy(s, "gprc.txt"); #endif f = gprc_chk(str); /* in $HOME */ if (!f) f = gprc_chk(s); /* in . */ #ifndef _WIN32 if (!f) f = gprc_chk("/etc/gprc"); #else if (!f) /* in basedir */ { const char *basedir = win32_basedir(); char *t = (char *) pari_malloc(strlen(basedir)+strlen(s)+2); sprintf(t, "%s/%s", basedir, s); f = gprc_chk(t); free(t); } #endif pari_free(str); } return f; } /* PREPROCESSOR */ static ulong read_uint(char **s) { long v = atol(*s); if (!isdigit((int)**s)) err_gprc("not an integer", *s, *s); while (isdigit((int)**s)) (*s)++; return v; } static ulong read_dot_uint(char **s) { if (**s != '.') return 0; (*s)++; return read_uint(s); } /* read a.b.c */ static long read_version(char **s) { long a, b, c; a = read_uint(s); b = read_dot_uint(s); c = read_dot_uint(s); return PARI_VERSION(a,b,c); } static int get_preproc_value(char **s) { if (!strncmp(*s,"EMACS",5)) { *s += 5; return GP_DATA->flags & (gpd_EMACS|gpd_TEXMACS); } if (!strncmp(*s,"READL",5)) { *s += 5; return GP_DATA->use_readline; } if (!strncmp(*s,"VERSION",7)) { int less = 0, orequal = 0; long d; *s += 7; switch(**s) { case '<': (*s)++; less = 1; break; case '>': (*s)++; less = 0; break; default: return -1; } if (**s == '=') { (*s)++; orequal = 1; } d = paricfg_version_code - read_version(s); if (!d) return orequal; return less? (d < 0): (d > 0); } if (!strncmp(*s,"BITS_IN_LONG",12)) { *s += 12; if ((*s)[0] == '=' && (*s)[1] == '=') { *s += 2; return BITS_IN_LONG == read_uint(s); } } return -1; } /* PARSE GPRC */ /* 1) replace next separator by '\0' (t must be writable) * 2) return the next expression ("" if none) * see get_sep() */ static char * next_expr(char *t) { int outer = 1; char *s = t; for(;;) { char c; switch ((c = *s++)) { case '"': if (outer || (s >= t+2 && s[-2] != '\\')) outer = !outer; break; case '\0': return (char*)""; default: if (outer && c == ';') { s[-1] = 0; return s; } } } } Buffer * filtered_buffer(filtre_t *F) { Buffer *b = new_buffer(); init_filtre(F, b); pari_stack_pushp(&s_bufstack, (void*)b); return b; } /* parse src of the form s=t (or s="t"), set *ps to s, and *pt to t. * modifies src (replaces = by \0) */ void parse_key_val(char *src, char **ps, char **pt) { char *s_end, *t; t = src; while (*t && *t != '=') t++; if (*t != '=') err_gprc("missing '='",t,src); s_end = t; t++; if (*t == '"') (void)pari_translate_string(t, t, src); *s_end = 0; *ps = src; *pt = t; } void gp_initrc(pari_stack *p_A) { FILE *file = gprc_get(); Buffer *b; filtre_t F; VOLATILE long c = 0; jmp_buf *env; pari_stack s_env; if (!file) return; b = filtered_buffer(&F); pari_stack_init(&s_env, sizeof(*env), (void**)&env); (void)pari_stack_new(&s_env); for(;;) { char *nexts, *s, *t; if (setjmp(env[s_env.n-1])) err_printf("...skipping line %ld.\n", c); c++; if (!get_line_from_file(NULL,&F,file)) break; s = b->buf; if (*s == '#') { /* preprocessor directive */ int z, NOT = 0; s++; if (strncmp(s,"if",2)) err_gprc("unknown directive",s,b->buf); s += 2; if (!strncmp(s,"not",3)) { NOT = !NOT; s += 3; } if (*s == '!') { NOT = !NOT; s++; } t = s; z = get_preproc_value(&s); if (z < 0) err_gprc("unknown preprocessor variable",t,b->buf); if (NOT) z = !z; if (!*s) { /* make sure at least an expr follows the directive */ if (!get_line_from_file(NULL,&F,file)) break; s = b->buf; } if (!z) continue; /* dump current line */ } /* parse line */ for ( ; *s; s = nexts) { nexts = next_expr(s); if (!strncmp(s,"read",4) && (s[4] == ' ' || s[4] == '\t' || s[4] == '"')) { /* read file */ s += 4; t = (char*)pari_malloc(strlen(s) + 1); if (*s == '"') (void)pari_translate_string(s, t, s-4); else strcpy(t,s); pari_stack_pushp(p_A,t); } else { /* set default */ parse_key_val(s, &s,&t); (void)setdefault(s,t,d_INITRC); } } } pari_stack_delete(&s_env); pop_buffer(); if (!(GP_DATA->flags & gpd_QUIET)) err_printf("Done.\n\n"); fclose(file); } void gp_load_gprc(void) { pari_stack sA; char **A; long i; pari_stack_init(&sA,sizeof(*A),(void**)&A); gp_initrc(&sA); for (i = 0; i < sA.n; pari_free(A[i]),i++) { pari_CATCH(CATCH_ALL) { err_printf("... skipping file '%s'\n", A[i]); } pari_TRY { gp_read_file(A[i]); } pari_ENDCATCH; } pari_stack_delete(&sA); } /********************************************************************/ /* */ /* PROMPTS */ /* */ /********************************************************************/ /* if prompt is coloured, tell readline to ignore the ANSI escape sequences */ /* s must be able to store 14 chars (including final \0) */ #ifdef READLINE static void readline_prompt_color(char *s, int c) { #ifdef _WIN32 (void)s; (void)c; #else *s++ = '\001'; /*RL_PROMPT_START_IGNORE*/ term_get_color(s, c); s += strlen(s); *s++ = '\002'; /*RL_PROMPT_END_IGNORE*/ *s = 0; #endif } #endif /* s must be able to store 14 chars (including final \0) */ static void brace_color(char *s, int c, int force) { if (disable_color || (gp_colors[c] == c_NONE && !force)) return; #ifdef READLINE if (GP_DATA->use_readline) readline_prompt_color(s, c); else #endif term_get_color(s, c); } /* strlen(prompt) + 28 chars */ static const char * color_prompt(const char *prompt) { long n = strlen(prompt); char *t = stack_malloc(n + 28), *s = t; *s = 0; /* escape sequences bug readline, so use special bracing (if available) */ brace_color(s, c_PROMPT, 0); s += strlen(s); strncpy(s, prompt, n); s += n; *s = 0; brace_color(s, c_INPUT, 1); return t; } const char * gp_format_prompt(const char *prompt) { if (GP_DATA->flags & gpd_TEST) return prompt; else { char b[256]; /* longer is truncated */ strftime_expand(prompt, b, sizeof(b)); return color_prompt(b); } } /********************************************************************/ /* */ /* GP MAIN LOOP */ /* */ /********************************************************************/ static int is_interactive(void) { return cb_pari_is_interactive? cb_pari_is_interactive(): 0; } static const char esc = (0x1f & '['); /* C-[ = escape */ static char * strip_prompt(const char *s) { long l = strlen(s); char *t, *t0 = stack_malloc(l+1); t = t0; for (; *s; s++) { /* RL_PROMPT_START_IGNORE / RL_PROMPT_END_IGNORE */ if (*s == 1 || *s == 2) continue; if (*s == esc) /* skip ANSI color escape sequence */ { while (*++s != 'm') if (!*s) goto end; continue; } *t = *s; t++; } end: *t = 0; return t0; } static void update_logfile(const char *prompt, const char *s) { pari_sp av; const char *p; if (!pari_logfile) return; av = avma; p = strip_prompt(prompt); /* raw prompt */ switch (logstyle) { case logstyle_TeX: fprintf(pari_logfile, "\\PARIpromptSTART|%s\\PARIpromptEND|%s\\PARIinputEND|%%\n", p, s); break; case logstyle_plain: fprintf(pari_logfile,"%s%s\n",p, s); break; case logstyle_color: fprintf(pari_logfile,"%s%s%s%s%s\n",term_get_color(NULL,c_PROMPT), p, term_get_color(NULL,c_INPUT), s, term_get_color(NULL,c_NONE)); break; } avma = av; } void gp_echo_and_log(const char *prompt, const char *s) { if (!is_interactive()) { if (!GP_DATA->echo) return; /* not pari_puts(): would duplicate in logfile */ fputs(prompt, pari_outfile); fputs(s, pari_outfile); fputc('\n', pari_outfile); pari_set_last_newline(1); } update_logfile(prompt, s); pari_flush(); } /* prompt = NULL --> from gprc. Return 1 if new input, and 0 if EOF */ int get_line_from_file(const char *prompt, filtre_t *F, FILE *file) { char *s; input_method IM; IM.file = (void*)file; if (file==stdin && cb_pari_fgets_interactive) IM.fgets = (fgets_t)cb_pari_fgets_interactive; else IM.fgets = (fgets_t)&fgets; IM.getline = &file_input; IM.free = 0; if (! input_loop(F,&IM)) { if (file==stdin && cb_pari_start_output) cb_pari_start_output(); return 0; } s = F->buf->buf; /* don't log if from gprc or empty input */ if (*s && prompt) gp_echo_and_log(prompt, s); return 1; } /* return 0 if no line could be read (EOF). If PROMPT = NULL, expand and * color default prompt; otherwise, use PROMPT as-is. */ int gp_read_line(filtre_t *F, const char *PROMPT) { static const char *DFT_PROMPT = "? "; Buffer *b = (Buffer*)F->buf; const char *p; int res, interactive; if (b->len > 100000) fix_buffer(b, 100000); interactive = is_interactive(); if (interactive || pari_logfile || GP_DATA->echo) { p = PROMPT; if (!p) { p = F->in_comment? GP_DATA->prompt_comment: GP_DATA->prompt; p = gp_format_prompt(p); } } else p = DFT_PROMPT; if (interactive) { BLOCK_EH_START if (cb_pari_get_line_interactive) res = cb_pari_get_line_interactive(p, GP_DATA->prompt_cont, F); else { pari_puts(p); pari_flush(); res = get_line_from_file(p, F, pari_infile); } BLOCK_EH_END } else { /* in case UI fakes non-interactivity, e.g. TeXmacs */ if (cb_pari_start_output && cb_pari_get_line_interactive) res = cb_pari_get_line_interactive(p, GP_DATA->prompt_cont, F); else res = get_line_from_file(p, F, pari_infile); } if (!disable_color && p != DFT_PROMPT && (gp_colors[c_PROMPT] != c_NONE || gp_colors[c_INPUT] != c_NONE)) { term_color(c_NONE); pari_flush(); } return res; } /********************************************************************/ /* */ /* EXCEPTION HANDLER */ /* */ /********************************************************************/ static THREAD pari_timer ti_alarm; #if defined(_WIN32) || defined(SIGALRM) static void gp_alarm_fun(void) { char buf[64]; if (cb_pari_start_output) cb_pari_start_output(); convert_time(buf, timer_get(&ti_alarm)); pari_err(e_ALARM, buf); } #endif /* SIGALRM */ void gp_sigint_fun(void) { char buf[64]; #if defined(_WIN32) if (win32alrm) { win32alrm = 0; gp_alarm_fun(); return;} #endif if (cb_pari_start_output) cb_pari_start_output(); convert_time(buf, timer_get(GP_DATA->T)); pari_sigint(buf); } #ifdef SIGALRM void gp_alarm_handler(int sig) { #ifndef HAS_SIGACTION /*SYSV reset the signal handler in the handler*/ (void)os_signal(sig,gp_alarm_handler); #endif if (PARI_SIGINT_block) PARI_SIGINT_pending=sig; else gp_alarm_fun(); return; } #endif /* SIGALRM */ /********************************************************************/ /* */ /* GP-SPECIFIC ROUTINES */ /* */ /********************************************************************/ void gp_allocatemem(GEN z) { ulong newsize; if (!z) newsize = 0; else { if (typ(z) != t_INT) pari_err_TYPE("allocatemem",z); newsize = itou(z); if (signe(z) < 0) pari_err_DOMAIN("allocatemem","size","<",gen_0,z); } if (pari_mainstack->vsize) paristack_resize(newsize); else paristack_newrsize(newsize); } GEN gp_input(void) { filtre_t F; Buffer *b = filtered_buffer(&F); GEN x; while (! get_line_from_file("",&F,pari_infile)) if (popinfile()) { err_printf("no input ???"); cb_pari_quit(1); } x = readseq(b->buf); pop_buffer(); return x; } static GEN closure_alarmer(GEN C, long s) { struct pari_evalstate state; VOLATILE GEN x; if (!s) { pari_alarm(0); return closure_evalgen(C); } evalstate_save(&state); #if !defined(HAS_ALARM) && !defined(_WIN32) pari_err(e_ARCH,"alarm"); #endif pari_CATCH(CATCH_ALL) /* We need to stop the timer after any error */ { GEN E = pari_err_last(); if (err_get_num(E) != e_ALARM) { pari_alarm(0); pari_err(0, E); } x = evalstate_restore_err(&state); } pari_TRY { pari_alarm(s); x = closure_evalgen(C); pari_alarm(0); } pari_ENDCATCH; return x; } void pari_alarm(long s) { if (s < 0) pari_err_DOMAIN("alarm","delay","<",gen_0,stoi(s)); if (s) timer_start(&ti_alarm); #ifdef _WIN32 win32_alarm(s); #elif defined(HAS_ALARM) alarm(s); #else if (s) pari_err(e_ARCH,"alarm"); #endif } GEN gp_alarm(long s, GEN code) { if (!code) { pari_alarm(s); return gnil; } return closure_alarmer(code,s); } /*******************************************************************/ /** **/ /** EXTERNAL PRETTYPRINTER **/ /** **/ /*******************************************************************/ /* Wait for prettinprinter to finish, to prevent new prompt from overwriting * the output. Fill the output buffer, wait until it is read. * Better than sleep(2): give possibility to print */ static void prettyp_wait(FILE *out) { const char *s = " \n"; long i = 2000; fputs("\n\n", out); fflush(out); /* start translation */ while (--i) fputs(s, out); fputs("\n", out); fflush(out); } /* initialise external prettyprinter (tex2mail) */ static int prettyp_init(void) { gp_pp *pp = GP_DATA->pp; if (!pp->cmd) return 0; if (pp->file || (pp->file = try_pipe(pp->cmd, mf_OUT))) return 1; pari_warn(warner,"broken prettyprinter: '%s'",pp->cmd); pari_free(pp->cmd); pp->cmd = NULL; sd_output("1", d_SILENT); return 0; } /* n = history number. if n = 0 no history */ int tex2mail_output(GEN z, long n) { pariout_t T = *(GP_DATA->fmt); /* copy */ FILE *log = pari_logfile, *out; if (!prettyp_init()) return 0; out = GP_DATA->pp->file->file; /* Emit first: there may be lines before the prompt */ if (n) term_color(c_OUTPUT); pari_flush(); T.prettyp = f_TEX; /* history number */ if (n) { pari_sp av = avma; const char *c_hist = term_get_color(NULL, c_HIST); const char *c_out = term_get_color(NULL, c_OUTPUT); if (!(GP_DATA->flags & gpd_QUIET)) { if (*c_hist || *c_out) fprintf(out, "\\LITERALnoLENGTH{%s}\\%%%ld =\\LITERALnoLENGTH{%s} ", c_hist, n, c_out); else fprintf(out, "\\%%%ld = ", n); } if (log) { switch (logstyle) { case logstyle_plain: fprintf(log, "%%%ld = ", n); break; case logstyle_color: fprintf(log, "%s%%%ld = %s", c_hist, n, c_out); break; case logstyle_TeX: fprintf(log, "\\PARIout{%ld}", n); break; } } avma = av; } /* output */ fputGEN_pariout(z, &T, out); /* flush and restore, output to logfile */ prettyp_wait(out); if (log) { if (logstyle == logstyle_TeX) { T.TeXstyle |= TEXSTYLE_BREAK; fputGEN_pariout(z, &T, log); fputc('%', log); } else { T.prettyp = f_RAW; fputGEN_pariout(z, &T, log); } fputc('\n', log); fflush(log); } if (n) term_color(c_NONE); pari_flush(); return 1; } /*******************************************************************/ /** **/ /** GP-SPECIFIC DEFAULTS **/ /** **/ /*******************************************************************/ static long atocolor(const char *s) { long l = atol(s); if (l < 0) l = 0; if (l > 255) l = 255; return l; } GEN sd_graphcolormap(const char *v, long flag) { char *p, *q; long i, j, l, a, s, *lp; if (v) { char *t = gp_filter(v); if (*t != '[' || t[strlen(t)-1] != ']') pari_err(e_SYNTAX, "incorrect value for graphcolormap", t, t); for (s = 0, p = t+1, l = 2, a=0; *p; p++) if (*p == '[') { a++; while (*++p != ']') if (!*p || *p == '[') pari_err(e_SYNTAX, "incorrect value for graphcolormap", p, t); } else if (*p == '"') { s += sizeof(long)+1; while (*p && *++p != '"') s++; if (!*p) pari_err(e_SYNTAX, "incorrect value for graphcolormap", p, t); s = (s+sizeof(long)-1) & ~(sizeof(long)-1); } else if (*p == ',') l++; if (l < 4) pari_err(e_MISC, "too few colors (< 4) in graphcolormap"); if (GP_DATA->colormap) pari_free(GP_DATA->colormap); GP_DATA->colormap = (GEN)pari_malloc((l+4*a)*sizeof(long) + s); GP_DATA->colormap[0] = evaltyp(t_VEC)|evallg(l); for (p = t+1, i = 1, lp = GP_DATA->colormap+l; i < l; p++) switch(*p) { case '"': gel(GP_DATA->colormap, i) = lp; q = ++p; while (*q != '"') q++; *q = 0; j = 1 + nchar2nlong(q-p+1); lp[0] = evaltyp(t_STR)|evallg(j); strncpy(GSTR(lp), p, q-p+1); lp += j; p = q; break; case '[': { const char *ap[3]; gel(GP_DATA->colormap, i) = lp; lp[0] = evaltyp(t_VECSMALL)|_evallg(4); for (ap[0] = ++p, j=0; *p && *p != ']'; p++) if (*p == ',' && j<2) { *p++ = 0; ap[++j] = p; } while (j<2) ap[++j] = "0"; if (j>2 || *p != ']') { char buf[100]; sprintf(buf, "incorrect value for graphcolormap[%ld]: ", i); pari_err(e_SYNTAX, buf, p, t); } *p = '\0'; lp[1] = atocolor(ap[0]); lp[2] = atocolor(ap[1]); lp[3] = atocolor(ap[2]); lp += 4; break; } case ',': case ']': i++; break; default: pari_err(e_SYNTAX, "incorrect value for graphcolormap", p, t); } pari_free(t); } if (flag == d_RETURN || flag == d_ACKNOWLEDGE) { GEN cols = cgetg(lg(GP_DATA->colormap), t_VEC); long i; for (i = 1; i < lg(cols); i++) { GEN c = gel(GP_DATA->colormap, i); if (typ(c) == t_STR) gel(cols, i) = gcopy(c); else gel(cols, i) = vecsmall_to_vec(c); } if (flag == d_RETURN) return cols; pari_printf(" graphcolormap = %Ps\n", cols); } return gnil; } GEN sd_graphcolors(const char *v, long flag) { long i, l; char *p; if (v) { char *t = gp_filter(v); for (p = t+1, l=2; *p != ']'; p++) if (*p == ',') l++; else if (*p < '0' || *p > '9') pari_err(e_SYNTAX, "incorrect value for graphcolors", p, t); if (*++p) pari_err(e_SYNTAX, "incorrect value for graphcolors", p, t); if (GP_DATA->graphcolors) pari_free(GP_DATA->graphcolors); GP_DATA->graphcolors = cgetalloc(t_VECSMALL, l); for (p = t+1, i=0; *p; p++) { long n = 0; while (*p >= '0' && *p <= '9') { n *= 10; n += *p-'0'; p++; } GP_DATA->graphcolors[++i] = n; } pari_free(t); } switch(flag) { case d_RETURN: return vecsmall_to_vec(GP_DATA->graphcolors); case d_ACKNOWLEDGE: pari_printf(" graphcolors = %Ps\n", vecsmall_to_vec(GP_DATA->graphcolors)); } return gnil; } GEN sd_help(const char *v, long flag) { const char *str; if (v) { if (GP_DATA->secure) pari_err(e_MISC,"[secure mode]: can't modify 'help' default (to %s)",v); if (GP_DATA->help) pari_free((void*)GP_DATA->help); #ifndef _WIN32 GP_DATA->help = path_expand(v); #else GP_DATA->help = pari_strdup(v); #endif } str = GP_DATA->help? GP_DATA->help: "none"; if (flag == d_RETURN) return strtoGENstr(str); if (flag == d_ACKNOWLEDGE) pari_printf(" help = \"%s\"\n", str); return gnil; } static GEN sd_prompt_set(const char *v, long flag, const char *how, char **p) { if (v) { if (*p) free(*p); *p = pari_strdup(v); } if (flag == d_RETURN) return strtoGENstr(*p); if (flag == d_ACKNOWLEDGE) pari_printf(" prompt%s = \"%s\"\n", how, *p); return gnil; } GEN sd_prompt(const char *v, long flag) { return sd_prompt_set(v, flag, "", &(GP_DATA->prompt)); } GEN sd_prompt_cont(const char *v, long flag) { return sd_prompt_set(v, flag, "_cont", &(GP_DATA->prompt_cont)); } GEN sd_breakloop(const char *v, long flag) { return sd_toggle(v,flag,"breakloop", &(GP_DATA->breakloop)); } GEN sd_echo(const char *v, long flag) { return sd_toggle(v,flag,"echo", &(GP_DATA->echo)); } GEN sd_timer(const char *v, long flag) { return sd_toggle(v,flag,"timer", &(GP_DATA->chrono)); } GEN sd_recover(const char *v, long flag) { return sd_toggle(v,flag,"recover", &(GP_DATA->recover)); } GEN sd_psfile(const char *v, long flag) { return sd_string(v, flag, "psfile", &current_psfile); } GEN sd_lines(const char *v, long flag) { return sd_ulong(v,flag,"lines",&(GP_DATA->lim_lines), 0,LONG_MAX,NULL); } GEN sd_linewrap(const char *v, long flag) { ulong old = GP_DATA->linewrap, n = GP_DATA->linewrap; GEN z = sd_ulong(v,flag,"linewrap",&n, 0,LONG_MAX,NULL); if (old) { if (!n) resetout(1); } else { if (n) init_linewrap(n); } GP_DATA->linewrap = n; return z; } /* readline-specific defaults */ GEN sd_readline(const char *v, long flag) { const char *msg[] = { "(bits 0x2/0x4 control matched-insert/arg-complete)", NULL}; ulong state = GP_DATA->readline_state; GEN res = sd_ulong(v,flag,"readline", &GP_DATA->readline_state, 0, 7, msg); if (state != GP_DATA->readline_state) (void)sd_toggle(GP_DATA->readline_state? "1": "0", d_SILENT, "readline", &(GP_DATA->use_readline)); return res; } GEN sd_histfile(const char *v, long flag) { char *old = GP_DATA->histfile; GEN r = sd_string(v, flag, "histfile", &GP_DATA->histfile); if (v && !*v) { free(GP_DATA->histfile); GP_DATA->histfile = NULL; } else if (GP_DATA->histfile != old && (!old || strcmp(old,GP_DATA->histfile))) { if (cb_pari_init_histfile) cb_pari_init_histfile(); } return r; } /********************************************************************/ /** **/ /** METACOMMANDS **/ /** **/ /********************************************************************/ void pari_print_version(void) { pari_sp av = avma; char *buf, *ver = what_cc(); const char *date = paricfg_compiledate; pari_center(paricfg_version); pari_center(paricfg_buildinfo); buf = stack_malloc(strlen(date) + 32 + (ver? strlen(ver): 0)); if (ver) (void)sprintf(buf, "compiled: %s, %s", date, ver); else (void)sprintf(buf, "compiled: %s", date); pari_center(buf); sprintf(buf, "threading engine: %s",paricfg_mt_engine); pari_center(buf); ver = what_readline(); buf = stack_malloc(strlen(ver) + 64); (void)sprintf(buf, "(readline %s, extended help%s enabled)", ver, has_ext_help()? "": " not"); pari_center(buf); avma = av; } static int cmp_epname(void *E, GEN e, GEN f) { (void)E; return strcmp(((entree*)e)->name, ((entree*)f)->name); } static void print_all_user_fun(int member) { pari_sp av = avma; long iL = 0, lL = 1024; GEN L = cgetg(lL+1, t_VECSMALL); entree *ep; int i; for (i = 0; i < functions_tblsz; i++) for (ep = functions_hash[i]; ep; ep = ep->next) { const char *f; int is_member; if (EpVALENCE(ep) != EpVAR || typ((GEN)ep->value)!=t_CLOSURE) continue; f = ep->name; is_member = (f[0] == '_' && f[1] == '.'); if (member != is_member) continue; if (iL >= lL) { GEN oL = L; long j; lL *= 2; L = cgetg(lL+1, t_VECSMALL); for (j = 1; j <= iL; j++) gel(L,j) = gel(oL,j); } L[++iL] = (long)ep; } if (iL) { setlg(L, iL+1); gen_sort_inplace(L, NULL, &cmp_epname, NULL); for (i = 1; i <= iL; i++) { ep = (entree*)L[i]; pari_printf("%s =\n %Ps\n\n", ep->name, ep->value); } } avma = av; } static void escape(const char *tch, int ismain) { const char *s = tch; char c; switch ((c = *s++)) { case 'w': case 'x': case 'a': case 'b': case 'B': case 'm': { /* history things */ long d; GEN x; if (c != 'w' && c != 'x') d = get_int(s,0); else { d = atol(s); if (*s == '-') s++; while (isdigit((int)*s)) s++; } x = pari_get_hist(d); switch (c) { case 'B': /* prettyprinter */ if (tex2mail_output(x,0)) break; case 'b': /* fall through */ case 'm': matbrute(x, GP_DATA->fmt->format, -1); break; case 'a': brute(x, GP_DATA->fmt->format, -1); break; case 'x': dbgGEN(x, get_int(s, -1)); break; case 'w': s = get_sep(s); if (!*s) s = current_logfile; write0(s, mkvec(x)); return; } pari_putc('\n'); return; } case 'c': commands(-1); break; case 'd': (void)setdefault(NULL,NULL,d_SILENT); break; case 'e': s = get_sep(s); if (!*s) s = (GP_DATA->echo)? "0": "1"; (void)sd_echo(s,d_ACKNOWLEDGE); break; case 'g': switch (*s) { case 'm': s++; (void)sd_debugmem(*s? s: NULL,d_ACKNOWLEDGE); break; case 'f': s++; (void)sd_debugfiles(*s? s: NULL,d_ACKNOWLEDGE); break; default : (void)sd_debug(*s? s: NULL,d_ACKNOWLEDGE); break; } break; case 'h': print_functions_hash(s); break; case 'l': s = get_sep(s); if (*s) { (void)sd_logfile(s,d_ACKNOWLEDGE); if (pari_logfile) break; } (void)sd_log(pari_logfile?"0":"1",d_ACKNOWLEDGE); break; case 'o': (void)sd_output(*s? s: NULL,d_ACKNOWLEDGE); break; case 'p': switch (*s) { case 's': s++; (void)sd_seriesprecision(*s? s: NULL,d_ACKNOWLEDGE); break; case 'b' : s++; (void)sd_realbitprecision(*s? s: NULL,d_ACKNOWLEDGE); break; default : (void)sd_realprecision(*s? s: NULL,d_ACKNOWLEDGE); break; } break; case 'q': cb_pari_quit(0); break; case 'r': s = get_sep(s); if (!ismain) { (void)gp_read_file(s); break; } switchin(s); if (file_is_binary(pari_infile)) { int vector; GEN x = readbin(s,pari_infile, &vector); popinfile(); if (!x) pari_err_FILE("input file",s); if (vector) /* many BIN_GEN */ { long i, l = lg(x); pari_warn(warner,"setting %ld history entries", l-1); for (i=1; i<l; i++) pari_add_hist(gel(x,i), 0); } } break; case 's': dbg_pari_heap(); break; case 't': gentypes(); break; case 'u': print_all_user_fun((*s == 'm')? 1: 0); break; case 'v': pari_print_version(); break; case 'y': s = get_sep(s); if (!*s) s = (GP_DATA->simplify)? "0": "1"; (void)sd_simplify(s,d_ACKNOWLEDGE); break; default: pari_err(e_SYNTAX,"unexpected character", tch,tch-1); } } static int chron(const char *s) { if (*s) { /* if "#" or "##" timer metacommand. Otherwise let the parser get it */ const char *t; if (*s == '#') s++; if (*s) return 0; t = gp_format_time(pari_get_histtime(0)); pari_printf(" *** last result computed in %s", t); } else { GP_DATA->chrono ^= 1; (void)sd_timer(NULL,d_ACKNOWLEDGE); } return 1; } /* return 0: can't interpret *buf as a metacommand * 1: did interpret *buf as a metacommand or empty command */ int gp_meta(const char *buf, int ismain) { switch(*buf++) { case '?': gp_help(buf, h_REGULAR); break; case '#': return chron(buf); case '\\': escape(buf, ismain); break; case '\0': break; default: return 0; } return 1; }
jpflori/pari
src/language/gplib.c
C
gpl-2.0
51,878
cmd_sound/pci/emu10k1/built-in.o := rm -f sound/pci/emu10k1/built-in.o; /home/rittik/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-ar rcsD sound/pci/emu10k1/built-in.o
RittikBhowmik/Project-Crater-Kernel-GT-i9152
sound/pci/emu10k1/.built-in.o.cmd
Batchfile
gpl-2.0
184
/* ************************************************************************* * Ralink Tech Inc. * 5F., No.36, Taiyuan St., Jhubei City, * Hsinchu County 302, * Taiwan, R.O.C. * * (c) Copyright 2002-2007, Ralink Technology, Inc. * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * ************************************************************************* Module Name: sync.c Abstract: Revision History: Who When What -------- ---------- ---------------------------------------------- John Chang 2004-09-01 modified for rt2561/2661 Jan Lee 2006-08-01 modified for rt2860 for 802.11n */ #include "rt_config.h" #define ADHOC_ENTRY_BEACON_LOST_TIME (2*OS_HZ) // 2 sec /* ========================================================================== Description: The sync state machine, Parameters: Sm - pointer to the state machine Note: the state machine looks like the following ========================================================================== */ VOID SyncStateMachineInit( IN PRTMP_ADAPTER pAd, IN STATE_MACHINE *Sm, OUT STATE_MACHINE_FUNC Trans[]) { StateMachineInit(Sm, Trans, MAX_SYNC_STATE, MAX_SYNC_MSG, (STATE_MACHINE_FUNC)Drop, SYNC_IDLE, SYNC_MACHINE_BASE); // column 1 StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)MlmeScanReqAction); StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_JOIN_REQ, (STATE_MACHINE_FUNC)MlmeJoinReqAction); StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_START_REQ, (STATE_MACHINE_FUNC)MlmeStartReqAction); StateMachineSetAction(Sm, SYNC_IDLE, MT2_PEER_BEACON, (STATE_MACHINE_FUNC)PeerBeacon); StateMachineSetAction(Sm, SYNC_IDLE, MT2_PEER_PROBE_REQ, (STATE_MACHINE_FUNC)PeerProbeReqAction); //column 2 StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenScan); StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_JOIN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenJoin); StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_START_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenStart); StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_PEER_BEACON, (STATE_MACHINE_FUNC)PeerBeaconAtJoinAction); StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_BEACON_TIMEOUT, (STATE_MACHINE_FUNC)BeaconTimeoutAtJoinAction); StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_PEER_PROBE_RSP, (STATE_MACHINE_FUNC)PeerBeaconAtScanAction); // column 3 StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenScan); StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_JOIN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenJoin); StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_START_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenStart); StateMachineSetAction(Sm, SCAN_LISTEN, MT2_PEER_BEACON, (STATE_MACHINE_FUNC)PeerBeaconAtScanAction); StateMachineSetAction(Sm, SCAN_LISTEN, MT2_PEER_PROBE_RSP, (STATE_MACHINE_FUNC)PeerBeaconAtScanAction); StateMachineSetAction(Sm, SCAN_LISTEN, MT2_SCAN_TIMEOUT, (STATE_MACHINE_FUNC)ScanTimeoutAction); // resume scanning for fast-roaming StateMachineSetAction(Sm, SCAN_PENDING, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)MlmeScanReqAction); // timer init RTMPInitTimer(pAd, &pAd->MlmeAux.BeaconTimer, GET_TIMER_FUNCTION(BeaconTimeout), pAd, FALSE); RTMPInitTimer(pAd, &pAd->MlmeAux.ScanTimer, GET_TIMER_FUNCTION(ScanTimeout), pAd, FALSE); } /* ========================================================================== Description: Beacon timeout handler, executed in timer thread IRQL = DISPATCH_LEVEL ========================================================================== */ VOID BeaconTimeout( IN PVOID SystemSpecific1, IN PVOID FunctionContext, IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext; DBGPRINT(RT_DEBUG_TRACE,("SYNC - BeaconTimeout\n")); // Do nothing if the driver is starting halt state. // This might happen when timer already been fired before cancel timer with mlmehalt if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) return; #ifdef DOT11_N_SUPPORT if ((pAd->CommonCfg.BBPCurrentBW == BW_40) ) { UCHAR BBPValue = 0; AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue &= (~0x18); BBPValue |= 0x10; RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - End of SCAN, restore to 40MHz channel %d, Total BSS[%02d]\n",pAd->CommonCfg.CentralChannel, pAd->ScanTab.BssNr)); } #endif // DOT11_N_SUPPORT // MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_BEACON_TIMEOUT, 0, NULL, 0); RTMP_MLME_HANDLER(pAd); } /* ========================================================================== Description: Scan timeout handler, executed in timer thread IRQL = DISPATCH_LEVEL ========================================================================== */ VOID ScanTimeout( IN PVOID SystemSpecific1, IN PVOID FunctionContext, IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext; // Do nothing if the driver is starting halt state. // This might happen when timer already been fired before cancel timer with mlmehalt if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) return; if (MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_SCAN_TIMEOUT, 0, NULL, 0)) { RTMP_MLME_HANDLER(pAd); } else { // To prevent SyncMachine.CurrState is SCAN_LISTEN forever. pAd->MlmeAux.Channel = 0; ScanNextChannel(pAd); RTMPSendWirelessEvent(pAd, IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG, NULL, BSS0, 0); } } /* ========================================================================== Description: MLME SCAN req state machine procedure ========================================================================== */ VOID MlmeScanReqAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType, BBPValue = 0; BOOLEAN TimerCancelled; ULONG Now; USHORT Status; // Check the total scan tries for one single OID command // If this is the CCX 2.0 Case, skip that! if ( !RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP)) { DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeScanReqAction before Startup\n")); return; } #ifdef PCIE_PS_SUPPORT if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) && (IDLE_ON(pAd)) && (pAd->StaCfg.bRadio == TRUE) && (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))) { if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE) { AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02); AsicCheckCommanOk(pAd, PowerWakeCID); RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF); DBGPRINT(RT_DEBUG_TRACE, ("PSM - Issue Wake up command \n")); } else { RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE); } } #endif // PCIE_PS_SUPPORT // // first check the parameter sanity if (MlmeScanReqSanity(pAd, Elem->Msg, Elem->MsgLen, &BssType, (PCHAR)Ssid, &SsidLen, &ScanType)) { // Check for channel load and noise hist request // Suspend MSDU only at scan request, not the last two mentioned // Suspend MSDU transmission here RTMPSuspendMsduTransmission(pAd); // // To prevent data lost. // Send an NULL data with turned PSM bit on to current associated AP before SCAN progress. // And should send an NULL data with turned PSM bit off to AP, when scan progress done // if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) && (INFRA_ON(pAd))) { RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) ? TRUE:FALSE)); DBGPRINT(RT_DEBUG_TRACE, ("MlmeScanReqAction -- Send PSM Data frame for off channel RM, SCAN_IN_PROGRESS=%d!\n", RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))); OS_WAIT(20); } RTMPSendWirelessEvent(pAd, IW_SCANNING_EVENT_FLAG, NULL, BSS0, 0); NdisGetSystemUpTime(&Now); pAd->StaCfg.LastScanTime = Now; // reset all the timers RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled); RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled); // record desired BSS parameters pAd->MlmeAux.BssType = BssType; pAd->MlmeAux.ScanType = ScanType; pAd->MlmeAux.SsidLen = SsidLen; NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID); NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen); /* Scanning was pending (for fast scanning) */ if ((pAd->StaCfg.bImprovedScan) && (pAd->Mlme.SyncMachine.CurrState == SCAN_PENDING)) { pAd->MlmeAux.Channel = pAd->StaCfg.LastScanChannel; } else { if (pAd->StaCfg.bFastConnect && (pAd->CommonCfg.Channel != 0) && !pAd->StaCfg.bNotFirstScan) { pAd->MlmeAux.Channel = pAd->CommonCfg.Channel; } else // start from the first channel pAd->MlmeAux.Channel = FirstChannel(pAd); } // Let BBP register at 20MHz to do scan RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue &= (~0x18); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n")); #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 // Before scan, reset trigger event table. TriEventInit(pAd); #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT // ScanNextChannel(pAd); pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN; } else { DBGPRINT_ERR(("SYNC - MlmeScanReqAction() sanity check fail\n")); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_INVALID_FORMAT; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status, 0); } } /* ========================================================================== Description: MLME JOIN req state machine procedure ========================================================================== */ VOID MlmeJoinReqAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR BBPValue = 0; BSS_ENTRY *pBss; BOOLEAN TimerCancelled; HEADER_802_11 Hdr80211; NDIS_STATUS NStatus; ULONG FrameLen = 0; PUCHAR pOutBuffer = NULL; PUCHAR pSupRate = NULL; UCHAR SupRateLen; PUCHAR pExtRate = NULL; UCHAR ExtRateLen; UCHAR ASupRate[] = {0x8C, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6C}; UCHAR ASupRateLen = sizeof(ASupRate)/sizeof(UCHAR); MLME_JOIN_REQ_STRUCT *pInfo = (MLME_JOIN_REQ_STRUCT *)(Elem->Msg); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeJoinReqAction(BSS #%ld)\n", pInfo->BssIdx)); #ifdef PCIE_PS_SUPPORT if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) && (IDLE_ON(pAd)) && (pAd->StaCfg.bRadio == TRUE) && (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))) { RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE); } #endif // PCIE_PS_SUPPORT // // reset all the timers RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled); RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled); pBss = &pAd->MlmeAux.SsidBssTab.BssEntry[pInfo->BssIdx]; // record the desired SSID & BSSID we're waiting for COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pBss->Bssid); // If AP's SSID is not hidden, it is OK for updating ssid to MlmeAux again. if (pBss->Hidden == 0) { RTMPZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID); NdisMoveMemory(pAd->MlmeAux.Ssid, pBss->Ssid, pBss->SsidLen); pAd->MlmeAux.SsidLen = pBss->SsidLen; } pAd->MlmeAux.BssType = pBss->BssType; pAd->MlmeAux.Channel = pBss->Channel; pAd->MlmeAux.CentralChannel = pBss->CentralChannel; #ifdef EXT_BUILD_CHANNEL_LIST // Country IE of the AP will be evaluated and will be used. if ((pAd->StaCfg.IEEE80211dClientMode != Rt802_11_D_None) && (pBss->bHasCountryIE == TRUE)) { NdisMoveMemory(&pAd->CommonCfg.CountryCode[0], &pBss->CountryString[0], 2); if (pBss->CountryString[2] == 'I') pAd->CommonCfg.Geography = IDOR; else if (pBss->CountryString[2] == 'O') pAd->CommonCfg.Geography = ODOR; else pAd->CommonCfg.Geography = BOTH; BuildChannelListEx(pAd); } #endif // EXT_BUILD_CHANNEL_LIST // // Let BBP register at 20MHz to do scan RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue &= (~0x18); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); pAd->CommonCfg.BBPCurrentBW = BW_20; DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n")); // switch channel and waiting for beacon timer AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, FALSE); AsicLockChannel(pAd, pAd->MlmeAux.Channel); RTMPSetTimer(&pAd->MlmeAux.BeaconTimer, JOIN_TIMEOUT); do { if (((pAd->CommonCfg.bIEEE80211H == 1) && (pAd->MlmeAux.Channel > 14) && RadarChannelCheck(pAd, pAd->MlmeAux.Channel)) #ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier || (pAd->CommonCfg.CarrierDetect.Enable == TRUE) #endif // CARRIER_DETECTION_SUPPORT // ) { // // We can't send any Probe request frame to meet 802.11h. // if (pBss->Hidden == 0) break; } // // send probe request // NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); if (NStatus == NDIS_STATUS_SUCCESS) { if (pAd->MlmeAux.Channel <= 14) { pSupRate = pAd->CommonCfg.SupRate; SupRateLen = pAd->CommonCfg.SupRateLen; pExtRate = pAd->CommonCfg.ExtRate; ExtRateLen = pAd->CommonCfg.ExtRateLen; } else { // // Overwrite Support Rate, CCK rate are not allowed // pSupRate = ASupRate; SupRateLen = ASupRateLen; ExtRateLen = 0; } if (pAd->MlmeAux.BssType == BSS_INFRA) MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, pAd->MlmeAux.Bssid, pAd->MlmeAux.Bssid); else MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, BROADCAST_ADDR, BROADCAST_ADDR); MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(HEADER_802_11), &Hdr80211, 1, &SsidIe, 1, &pAd->MlmeAux.SsidLen, pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid, 1, &SupRateIe, 1, &SupRateLen, SupRateLen, pSupRate, END_OF_ARGS); if (ExtRateLen) { ULONG Tmp; MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp, 1, &ExtRateIe, 1, &ExtRateLen, ExtRateLen, pExtRate, END_OF_ARGS); FrameLen += Tmp; } #ifdef WPA_SUPPLICANT_SUPPORT if ((pAd->OpMode == OPMODE_STA) && (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) && (pAd->StaCfg.WpsProbeReqIeLen != 0)) { ULONG WpsTmpLen = 0; MakeOutgoingFrame(pOutBuffer + FrameLen, &WpsTmpLen, pAd->StaCfg.WpsProbeReqIeLen, pAd->StaCfg.pWpsProbeReqIe, END_OF_ARGS); FrameLen += WpsTmpLen; } #endif // WPA_SUPPLICANT_SUPPORT // MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen); MlmeFreeMemory(pAd, pOutBuffer); } } while (FALSE); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - Switch to ch %d, Wait BEACON from %02x:%02x:%02x:%02x:%02x:%02x\n", pBss->Channel, pBss->Bssid[0], pBss->Bssid[1], pBss->Bssid[2], pBss->Bssid[3], pBss->Bssid[4], pBss->Bssid[5])); pAd->Mlme.SyncMachine.CurrState = JOIN_WAIT_BEACON; } /* ========================================================================== Description: MLME START Request state machine procedure, starting an IBSS ========================================================================== */ VOID MlmeStartReqAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen; BOOLEAN TimerCancelled; // New for WPA security suites UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5 NDIS_802_11_VARIABLE_IEs *pVIE = NULL; LARGE_INTEGER TimeStamp; BOOLEAN Privacy; USHORT Status; // Init Variable IE structure pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE; pVIE->Length = 0; TimeStamp.u.LowPart = 0; TimeStamp.u.HighPart = 0; if ((MlmeStartReqSanity(pAd, Elem->Msg, Elem->MsgLen, (PCHAR)Ssid, &SsidLen)) && (CHAN_PropertyCheck(pAd, pAd->MlmeAux.Channel, CHANNEL_NO_IBSS) == FALSE)) { // reset all the timers RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled); RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled); // // Start a new IBSS. All IBSS parameters are decided now.... // DBGPRINT(RT_DEBUG_TRACE, ("MlmeStartReqAction - Start a new IBSS. All IBSS parameters are decided now.... \n")); pAd->MlmeAux.BssType = BSS_ADHOC; NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen); pAd->MlmeAux.SsidLen = SsidLen; // generate a radom number as BSSID MacAddrRandomBssid(pAd, pAd->MlmeAux.Bssid); DBGPRINT(RT_DEBUG_TRACE, ("MlmeStartReqAction - generate a radom number as BSSID \n")); Privacy = (pAd->StaCfg.WepStatus == Ndis802_11Encryption1Enabled) || (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) || (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled); pAd->MlmeAux.CapabilityInfo = CAP_GENERATE(0,1,Privacy, (pAd->CommonCfg.TxPreamble == Rt802_11PreambleShort), 1, 0); pAd->MlmeAux.BeaconPeriod = pAd->CommonCfg.BeaconPeriod; pAd->MlmeAux.AtimWin = pAd->StaCfg.AtimWin; pAd->MlmeAux.Channel = pAd->CommonCfg.Channel; pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel; pAd->MlmeAux.CentralChannel = pAd->CommonCfg.CentralChannel; pAd->MlmeAux.SupRateLen= pAd->CommonCfg.SupRateLen; NdisMoveMemory(pAd->MlmeAux.SupRate, pAd->CommonCfg.SupRate, MAX_LEN_OF_SUPPORTED_RATES); RTMPCheckRates(pAd, pAd->MlmeAux.SupRate, &pAd->MlmeAux.SupRateLen); pAd->MlmeAux.ExtRateLen = pAd->CommonCfg.ExtRateLen; NdisMoveMemory(pAd->MlmeAux.ExtRate, pAd->CommonCfg.ExtRate, MAX_LEN_OF_SUPPORTED_RATES); RTMPCheckRates(pAd, pAd->MlmeAux.ExtRate, &pAd->MlmeAux.ExtRateLen); #ifdef DOT11_N_SUPPORT if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) && (pAd->StaCfg.bAdhocN == TRUE)) { RTMPUpdateHTIE(&pAd->CommonCfg.DesiredHtPhy, &pAd->StaCfg.DesiredHtPhyInfo.MCSSet[0], &pAd->MlmeAux.HtCapability, &pAd->MlmeAux.AddHtInfo); pAd->MlmeAux.HtCapabilityLen = sizeof(HT_CAPABILITY_IE); // Not turn pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE here. DBGPRINT(RT_DEBUG_TRACE, ("SYNC -pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE\n")); } else #endif // DOT11_N_SUPPORT // { pAd->MlmeAux.HtCapabilityLen = 0; pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE; NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], 16); } // temporarily not support QOS in IBSS NdisZeroMemory(&pAd->MlmeAux.APEdcaParm, sizeof(EDCA_PARM)); NdisZeroMemory(&pAd->MlmeAux.APQbssLoad, sizeof(QBSS_LOAD_PARM)); NdisZeroMemory(&pAd->MlmeAux.APQosCapability, sizeof(QOS_CAPABILITY_PARM)); AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, FALSE); AsicLockChannel(pAd, pAd->MlmeAux.Channel); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeStartReqAction(ch= %d,sup rates= %d, ext rates=%d)\n", pAd->MlmeAux.Channel, pAd->MlmeAux.SupRateLen, pAd->MlmeAux.ExtRateLen)); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_SUCCESS; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_START_CONF, 2, &Status, 0); } else { DBGPRINT_ERR(("SYNC - MlmeStartReqAction() sanity check fail.\n")); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_INVALID_FORMAT; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_START_CONF, 2, &Status, 0); } } /* ========================================================================== Description: peer sends beacon back when scanning ========================================================================== */ VOID PeerBeaconAtScanAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; UCHAR Ssid[MAX_LEN_OF_SSID], BssType, Channel = 0, NewChannel, SsidLen, DtimCount, DtimPeriod, BcastFlag, MessageToMe; CF_PARM CfParm; USHORT BeaconPeriod, AtimWin, CapabilityInfo; PFRAME_802_11 pFrame; LARGE_INTEGER TimeStamp; UCHAR Erp; UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; UCHAR SupRateLen, ExtRateLen; USHORT LenVIE; UCHAR CkipFlag; UCHAR AironetCellPowerLimit; EDCA_PARM EdcaParm; QBSS_LOAD_PARM QbssLoad; QOS_CAPABILITY_PARM QosCapability; ULONG RalinkIe; UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5 NDIS_802_11_VARIABLE_IEs *pVIE = NULL; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0; UCHAR AddHtInfoLen; UCHAR NewExtChannelOffset = 0xff; EXT_CAP_INFO_ELEMENT ExtCapInfo; NdisZeroMemory(Ssid, MAX_LEN_OF_SSID); pFrame = (PFRAME_802_11) Elem->Msg; // Init Variable IE structure pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE; pVIE->Length = 0; #ifdef DOT11_N_SUPPORT RTMPZeroMemory(&HtCapability, sizeof(HtCapability)); RTMPZeroMemory(&AddHtInfo, sizeof(ADD_HT_INFO_IE)); #endif // DOT11_N_SUPPORT // NdisZeroMemory(&QbssLoad, sizeof(QBSS_LOAD_PARM)); /* woody */ if (PeerBeaconAndProbeRspSanity(pAd, Elem->Msg, Elem->MsgLen, Elem->Channel, Addr2, Bssid, (PCHAR)Ssid, &SsidLen, &BssType, &BeaconPeriod, &Channel, &NewChannel, &TimeStamp, &CfParm, &AtimWin, &CapabilityInfo, &Erp, &DtimCount, &DtimPeriod, &BcastFlag, &MessageToMe, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &CkipFlag, &AironetCellPowerLimit, &EdcaParm, &QbssLoad, &QosCapability, &RalinkIe, &HtCapabilityLen, #ifdef CONFIG_STA_SUPPORT &PreNHtCapabilityLen, #endif // CONFIG_STA_SUPPORT // &HtCapability, &ExtCapInfo, &AddHtInfoLen, &AddHtInfo, &NewExtChannelOffset, &LenVIE, pVIE)) { ULONG Idx = 0; CHAR Rssi = 0; Idx = BssTableSearch(&pAd->ScanTab, Bssid, Channel); if (Idx != BSS_NOT_FOUND) Rssi = pAd->ScanTab.BssEntry[Idx].Rssi; Rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2)); #ifdef DOT11_N_SUPPORT if ((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0)) HtCapabilityLen = SIZE_HT_CAP_IE; #endif // DOT11_N_SUPPORT // Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (PCHAR)Ssid, SsidLen, BssType, BeaconPeriod, &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability, &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag, &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE); #ifdef DOT11_N_SUPPORT // TODO: Check for things need to do when enable "DOT11V_WNM_SUPPORT" #ifdef DOT11N_DRAFT3 // Check if this scan channel is the effeced channel if (INFRA_ON(pAd) && (pAd->CommonCfg.bBssCoexEnable == TRUE) && ((Channel > 0) && (Channel <= 14))) { int chListIdx; /* First we find the channel list idx by the channel number */ for (chListIdx = 0; chListIdx < pAd->ChannelListNum; chListIdx++) { if (Channel == pAd->ChannelList[chListIdx].Channel) break; } if (chListIdx < pAd->ChannelListNum) { /* If this channel is effected channel for the 20/40 coex operation. Check the related IEs. */ if (pAd->ChannelList[chListIdx].bEffectedChannel == TRUE) { UCHAR RegClass; OVERLAP_BSS_SCAN_IE BssScan; // Read Beacon's Reg Class IE if any. PeerBeaconAndProbeRspSanity2(pAd, Elem->Msg, Elem->MsgLen, &BssScan, &RegClass); TriEventTableSetEntry(pAd, &pAd->CommonCfg.TriggerEventTab, Bssid, &HtCapability, HtCapabilityLen, RegClass, Channel); } } } #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT // if (Idx != BSS_NOT_FOUND) { PBSS_ENTRY pBssEntry = &pAd->ScanTab.BssEntry[Idx]; NdisMoveMemory(pBssEntry->PTSF, &Elem->Msg[24], 4); NdisMoveMemory(&pBssEntry->TTSF[0], &Elem->TimeStamp.u.LowPart, 4); NdisMoveMemory(&pBssEntry->TTSF[4], &Elem->TimeStamp.u.LowPart, 4); pBssEntry->MinSNR = Elem->Signal % 10; if (pBssEntry->MinSNR == 0) pBssEntry->MinSNR = -5; NdisMoveMemory(pBssEntry->MacAddr, Addr2, MAC_ADDR_LEN); if ((pFrame->Hdr.FC.SubType == SUBTYPE_PROBE_RSP) && (LenVIE != 0)) { pBssEntry->VarIeFromProbeRspLen = 0; if (pBssEntry->pVarIeFromProbRsp) { pBssEntry->VarIeFromProbeRspLen = LenVIE; RTMPZeroMemory(pBssEntry->pVarIeFromProbRsp, MAX_VIE_LEN); RTMPMoveMemory(pBssEntry->pVarIeFromProbRsp, pVIE, LenVIE); } } } #ifdef LINUX #ifdef RT_CFG80211_SUPPORT RT_CFG80211_SCANNING_INFORM(pAd, Idx, Elem->Channel, (UCHAR *)pFrame, Elem->MsgLen, Rssi, MEM_ALLOC_FLAG); #endif // RT_CFG80211_SUPPORT // #endif // LINUX // } // sanity check fail, ignored } /* ========================================================================== Description: When waiting joining the (I)BSS, beacon received from external ========================================================================== */ VOID PeerBeaconAtJoinAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, BssType, Channel, MessageToMe, DtimCount, DtimPeriod, BcastFlag, NewChannel; LARGE_INTEGER TimeStamp; USHORT BeaconPeriod, AtimWin, CapabilityInfo; CF_PARM Cf; BOOLEAN TimerCancelled; UCHAR Erp; UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; UCHAR SupRateLen, ExtRateLen; UCHAR CkipFlag; USHORT LenVIE; UCHAR AironetCellPowerLimit; EDCA_PARM EdcaParm; QBSS_LOAD_PARM QbssLoad; QOS_CAPABILITY_PARM QosCapability; USHORT Status; UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5 NDIS_802_11_VARIABLE_IEs *pVIE = NULL; ULONG RalinkIe; ULONG Idx = 0; CHAR Rssi = 0; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0; UCHAR AddHtInfoLen; UCHAR NewExtChannelOffset = 0xff; #ifdef DOT11_N_SUPPORT UCHAR CentralChannel; BOOLEAN bAllowNrate = FALSE; #endif // DOT11_N_SUPPORT // EXT_CAP_INFO_ELEMENT ExtCapInfo; // Init Variable IE structure pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE; pVIE->Length = 0; RTMPZeroMemory(&HtCapability, sizeof(HtCapability)); RTMPZeroMemory(&AddHtInfo, sizeof(ADD_HT_INFO_IE)); EdcaParm.bValid = FALSE; if (PeerBeaconAndProbeRspSanity(pAd, Elem->Msg, Elem->MsgLen, Elem->Channel, Addr2, Bssid, (PCHAR)Ssid, &SsidLen, &BssType, &BeaconPeriod, &Channel, &NewChannel, &TimeStamp, &Cf, &AtimWin, &CapabilityInfo, &Erp, &DtimCount, &DtimPeriod, &BcastFlag, &MessageToMe, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &CkipFlag, &AironetCellPowerLimit, &EdcaParm, &QbssLoad, &QosCapability, &RalinkIe, &HtCapabilityLen, &PreNHtCapabilityLen, &HtCapability, &ExtCapInfo, &AddHtInfoLen, &AddHtInfo, &NewExtChannelOffset, &LenVIE, pVIE)) { // Disqualify 11b only adhoc when we are in 11g only adhoc mode if ((BssType == BSS_ADHOC) && (pAd->CommonCfg.PhyMode == PHY_11G) && ((SupRateLen+ExtRateLen)< 12)) return; // BEACON from desired BSS/IBSS found. We should be able to decide most // BSS parameters here. // Q. But what happen if this JOIN doesn't conclude a successful ASSOCIATEION? // Do we need to receover back all parameters belonging to previous BSS? // A. Should be not. There's no back-door recover to previous AP. It still need // a new JOIN-AUTH-ASSOC sequence. if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Bssid)) { DBGPRINT(RT_DEBUG_TRACE, ("SYNC - receive desired BEACON at JoinWaitBeacon... Channel = %d\n", Channel)); RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled); // Update RSSI to prevent No signal display when cards first initialized pAd->StaCfg.RssiSample.LastRssi0 = ConvertToRssi(pAd, Elem->Rssi0, RSSI_0); pAd->StaCfg.RssiSample.LastRssi1 = ConvertToRssi(pAd, Elem->Rssi1, RSSI_1); pAd->StaCfg.RssiSample.LastRssi2 = ConvertToRssi(pAd, Elem->Rssi2, RSSI_2); pAd->StaCfg.RssiSample.AvgRssi0 = pAd->StaCfg.RssiSample.LastRssi0; pAd->StaCfg.RssiSample.AvgRssi0X8 = pAd->StaCfg.RssiSample.AvgRssi0 << 3; pAd->StaCfg.RssiSample.AvgRssi1 = pAd->StaCfg.RssiSample.LastRssi1; pAd->StaCfg.RssiSample.AvgRssi1X8 = pAd->StaCfg.RssiSample.AvgRssi1 << 3; pAd->StaCfg.RssiSample.AvgRssi2 = pAd->StaCfg.RssiSample.LastRssi2; pAd->StaCfg.RssiSample.AvgRssi2X8 = pAd->StaCfg.RssiSample.AvgRssi2 << 3; // // We need to check if SSID only set to any, then we can record the current SSID. // Otherwise will cause hidden SSID association failed. // if (pAd->MlmeAux.SsidLen == 0) { NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen); pAd->MlmeAux.SsidLen = SsidLen; } else { Idx = BssSsidTableSearch(&pAd->ScanTab, Bssid, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, Channel); if (Idx == BSS_NOT_FOUND) { Rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2)); Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (CHAR *) Ssid, SsidLen, BssType, BeaconPeriod, &Cf, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability, &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag, &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE); if (Idx != BSS_NOT_FOUND) { NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4); NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4); NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4); CapabilityInfo = pAd->ScanTab.BssEntry[Idx].CapabilityInfo; pAd->ScanTab.BssEntry[Idx].MinSNR = Elem->Signal % 10; if (pAd->ScanTab.BssEntry[Idx].MinSNR == 0) pAd->ScanTab.BssEntry[Idx].MinSNR = -5; NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].MacAddr, Addr2, MAC_ADDR_LEN); } } else { // Check if AP privacy is different Staion, if yes, // start a new scan and ignore the frame // (often happen during AP change privacy at short time) if ((((pAd->StaCfg.WepStatus != Ndis802_11WEPDisabled) << 4) ^ CapabilityInfo) & 0x0010) { MLME_SCAN_REQ_STRUCT ScanReq; DBGPRINT(RT_DEBUG_TRACE, ("%s:AP privacy %d is differenct from STA privacy%d\n", __FUNCTION__, (CapabilityInfo & 0x0010) >> 4 ,pAd->StaCfg.WepStatus != Ndis802_11WEPDisabled)); ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq, 0); pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN; NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime); return; } // // Multiple SSID case, used correct CapabilityInfo // CapabilityInfo = pAd->ScanTab.BssEntry[Idx].CapabilityInfo; } } /*NdisMoveMemory(pAd->MlmeAux.Bssid, Bssid, MAC_ADDR_LEN);*/ pAd->MlmeAux.CapabilityInfo = CapabilityInfo & SUPPORTED_CAPABILITY_INFO; pAd->MlmeAux.BssType = BssType; pAd->MlmeAux.BeaconPeriod = BeaconPeriod; pAd->MlmeAux.Channel = Channel; pAd->MlmeAux.AtimWin = AtimWin; pAd->MlmeAux.CfpPeriod = Cf.CfpPeriod; pAd->MlmeAux.CfpMaxDuration = Cf.CfpMaxDuration; pAd->MlmeAux.APRalinkIe = RalinkIe; // Copy AP's supported rate to MlmeAux for creating assoication request // Also filter out not supported rate pAd->MlmeAux.SupRateLen = SupRateLen; NdisMoveMemory(pAd->MlmeAux.SupRate, SupRate, SupRateLen); RTMPCheckRates(pAd, pAd->MlmeAux.SupRate, &pAd->MlmeAux.SupRateLen); pAd->MlmeAux.ExtRateLen = ExtRateLen; NdisMoveMemory(pAd->MlmeAux.ExtRate, ExtRate, ExtRateLen); RTMPCheckRates(pAd, pAd->MlmeAux.ExtRate, &pAd->MlmeAux.ExtRateLen); NdisZeroMemory(pAd->StaActive.SupportedPhyInfo.MCSSet, 16); /* Get the ext capability info element */ NdisMoveMemory(&pAd->MlmeAux.ExtCapInfo, &ExtCapInfo,sizeof(ExtCapInfo)); #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 DBGPRINT(RT_DEBUG_TRACE, ("MlmeAux.ExtCapInfo=%d\n", pAd->MlmeAux.ExtCapInfo.BssCoexistMgmtSupport)); if (pAd->CommonCfg.bBssCoexEnable == TRUE) pAd->CommonCfg.ExtCapIE.BssCoexistMgmtSupport = 1; #endif // DOT11N_DRAFT3 // if (((pAd->StaCfg.WepStatus != Ndis802_11WEPEnabled) && (pAd->StaCfg.WepStatus != Ndis802_11Encryption2Enabled)) || (pAd->CommonCfg.HT_DisallowTKIP == FALSE)) { if ((pAd->StaCfg.BssType == BSS_INFRA) || ((pAd->StaCfg.BssType == BSS_ADHOC) && (pAd->StaCfg.bAdhocN == TRUE))) bAllowNrate = TRUE; } pAd->MlmeAux.NewExtChannelOffset = NewExtChannelOffset; pAd->MlmeAux.HtCapabilityLen = HtCapabilityLen; RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE); // filter out un-supported ht rates if (((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0)) && (pAd->StaCfg.DesiredHtPhyInfo.bHtEnable) && ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) && bAllowNrate)) { RTMPMoveMemory(&pAd->MlmeAux.AddHtInfo, &AddHtInfo, SIZE_ADD_HT_INFO_IE); // StaActive.SupportedHtPhy.MCSSet stores Peer AP's 11n Rx capability NdisMoveMemory(pAd->StaActive.SupportedPhyInfo.MCSSet, HtCapability.MCSSet, 16); pAd->MlmeAux.NewExtChannelOffset = NewExtChannelOffset; pAd->MlmeAux.HtCapabilityLen = SIZE_HT_CAP_IE; pAd->StaActive.SupportedPhyInfo.bHtEnable = TRUE; if (PreNHtCapabilityLen > 0) pAd->StaActive.SupportedPhyInfo.bPreNHt = TRUE; RTMPCheckHt(pAd, BSSID_WCID, &HtCapability, &AddHtInfo); // Copy AP Parameter to StaActive. This is also in LinkUp. DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAtJoinAction! (MpduDensity=%d, MaxRAmpduFactor=%d, BW=%d)\n", pAd->StaActive.SupportedHtPhy.MpduDensity, pAd->StaActive.SupportedHtPhy.MaxRAmpduFactor, HtCapability.HtCapInfo.ChannelWidth)); if (AddHtInfoLen > 0) { CentralChannel = AddHtInfo.ControlChan; // Check again the Bandwidth capability of this AP. if ((AddHtInfo.ControlChan > 2)&& (AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW) && (HtCapability.HtCapInfo.ChannelWidth == BW_40)) { CentralChannel = AddHtInfo.ControlChan - 2; } else if ((AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE) && (HtCapability.HtCapInfo.ChannelWidth == BW_40)) { CentralChannel = AddHtInfo.ControlChan + 2; } // Check Error . if (pAd->MlmeAux.CentralChannel != CentralChannel) DBGPRINT(RT_DEBUG_ERROR, ("PeerBeaconAtJoinAction HT===>Beacon Central Channel = %d, Control Channel = %d. Mlmeaux CentralChannel = %d\n", CentralChannel, AddHtInfo.ControlChan, pAd->MlmeAux.CentralChannel)); DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAtJoinAction HT===>Central Channel = %d, Control Channel = %d, .\n", CentralChannel, AddHtInfo.ControlChan)); } } else #endif // DOT11_N_SUPPORT // { // To prevent error, let legacy AP must have same CentralChannel and Channel. if ((HtCapabilityLen == 0) && (PreNHtCapabilityLen == 0)) pAd->MlmeAux.CentralChannel = pAd->MlmeAux.Channel; pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE; pAd->MlmeAux.NewExtChannelOffset = 0xff; RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE); pAd->MlmeAux.HtCapabilityLen = 0; RTMPZeroMemory(&pAd->MlmeAux.AddHtInfo, SIZE_ADD_HT_INFO_IE); } RTMPUpdateMlmeRate(pAd); // copy QOS related information if ((pAd->CommonCfg.bWmmCapable) #ifdef DOT11_N_SUPPORT || (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) #endif // DOT11_N_SUPPORT // ) { NdisMoveMemory(&pAd->MlmeAux.APEdcaParm, &EdcaParm, sizeof(EDCA_PARM)); NdisMoveMemory(&pAd->MlmeAux.APQbssLoad, &QbssLoad, sizeof(QBSS_LOAD_PARM)); NdisMoveMemory(&pAd->MlmeAux.APQosCapability, &QosCapability, sizeof(QOS_CAPABILITY_PARM)); } else { NdisZeroMemory(&pAd->MlmeAux.APEdcaParm, sizeof(EDCA_PARM)); NdisZeroMemory(&pAd->MlmeAux.APQbssLoad, sizeof(QBSS_LOAD_PARM)); NdisZeroMemory(&pAd->MlmeAux.APQosCapability, sizeof(QOS_CAPABILITY_PARM)); } DBGPRINT(RT_DEBUG_TRACE, ("SYNC - after JOIN, SupRateLen=%d, ExtRateLen=%d\n", pAd->MlmeAux.SupRateLen, pAd->MlmeAux.ExtRateLen)); if (AironetCellPowerLimit != 0xFF) { //We need to change our TxPower for CCX 2.0 AP Control of Client Transmit Power ChangeToCellPowerLimit(pAd, AironetCellPowerLimit); } else //Used the default TX Power Percentage. pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault; if (pAd->StaCfg.BssType == BSS_INFRA) { /* Ad-hoc call this function in LinkUp */ InitChannelRelatedValue(pAd); } pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_SUCCESS; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF, 2, &Status, 0); #ifdef LINUX #ifdef RT_CFG80211_SUPPORT RT_CFG80211_SCANNING_INFORM(pAd, Idx, Elem->Channel, Elem->Msg, Elem->MsgLen, Rssi, MEM_ALLOC_FLAG); #endif // RT_CFG80211_SUPPORT // #endif // LINUX // } // not to me BEACON, ignored } // sanity check fail, ignore this frame } /* ========================================================================== Description: receive BEACON from peer IRQL = DISPATCH_LEVEL ========================================================================== */ VOID PeerBeacon( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; CHAR Ssid[MAX_LEN_OF_SSID]; CF_PARM CfParm; UCHAR SsidLen, MessageToMe=0, BssType, Channel, NewChannel, index=0; UCHAR DtimCount=0, DtimPeriod=0, BcastFlag=0; USHORT CapabilityInfo, AtimWin, BeaconPeriod; LARGE_INTEGER TimeStamp; USHORT TbttNumToNextWakeUp; UCHAR Erp; UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; UCHAR SupRateLen, ExtRateLen; UCHAR CkipFlag; USHORT LenVIE; UCHAR AironetCellPowerLimit; EDCA_PARM EdcaParm; QBSS_LOAD_PARM QbssLoad; QOS_CAPABILITY_PARM QosCapability; ULONG RalinkIe; // New for WPA security suites UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5 NDIS_802_11_VARIABLE_IEs *pVIE = NULL; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE UCHAR HtCapabilityLen, PreNHtCapabilityLen; UCHAR AddHtInfoLen; UCHAR NewExtChannelOffset = 0xff; EXT_CAP_INFO_ELEMENT ExtCapInfo; #ifdef RALINK_ATE if (ATE_ON(pAd)) { return; } #endif // RALINK_ATE // if (!(INFRA_ON(pAd) || ADHOC_ON(pAd) )) return; // Init Variable IE structure pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE; pVIE->Length = 0; RTMPZeroMemory(&HtCapability, sizeof(HtCapability)); RTMPZeroMemory(&AddHtInfo, sizeof(ADD_HT_INFO_IE)); RTMPZeroMemory(&ExtCapInfo, sizeof(ExtCapInfo)); if (PeerBeaconAndProbeRspSanity(pAd, Elem->Msg, Elem->MsgLen, Elem->Channel, Addr2, Bssid, Ssid, &SsidLen, &BssType, &BeaconPeriod, &Channel, &NewChannel, &TimeStamp, &CfParm, &AtimWin, &CapabilityInfo, &Erp, &DtimCount, &DtimPeriod, &BcastFlag, &MessageToMe, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &CkipFlag, &AironetCellPowerLimit, &EdcaParm, &QbssLoad, &QosCapability, &RalinkIe, &HtCapabilityLen, #ifdef CONFIG_STA_SUPPORT &PreNHtCapabilityLen, #endif // CONFIG_STA_SUPPORT // &HtCapability, &ExtCapInfo, &AddHtInfoLen, &AddHtInfo, &NewExtChannelOffset, &LenVIE, pVIE)) { BOOLEAN is_my_bssid, is_my_ssid; ULONG Bssidx, Now; BSS_ENTRY *pBss; CHAR RealRssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2)); is_my_bssid = MAC_ADDR_EQUAL(Bssid, pAd->CommonCfg.Bssid)? TRUE : FALSE; is_my_ssid = SSID_EQUAL(Ssid, SsidLen, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen)? TRUE:FALSE; // ignore BEACON not for my SSID //if (( (SsidLen > 0) && !is_my_ssid) || (! is_my_bssid)) if ((! is_my_ssid) && (! is_my_bssid)) return; // It means STA waits disassoc completely from this AP, ignores this beacon. if (pAd->Mlme.CntlMachine.CurrState == CNTL_WAIT_DISASSOC) return; #ifdef DOT11_N_SUPPORT // Copy Control channel for this BSSID. if (AddHtInfoLen != 0) Channel = AddHtInfo.ControlChan; if ((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0)) HtCapabilityLen = SIZE_HT_CAP_IE; #endif // DOT11_N_SUPPORT // // // Housekeeping "SsidBssTab" table for later-on ROAMing usage. // Bssidx = BssTableSearchWithSSID(&pAd->MlmeAux.SsidBssTab, Bssid, Ssid, SsidLen, Channel); if (Bssidx == BSS_NOT_FOUND) { // discover new AP of this network, create BSS entry Bssidx = BssTableSetEntry(pAd, &pAd->MlmeAux.SsidBssTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod, &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability, &AddHtInfo,HtCapabilityLen,AddHtInfoLen,NewExtChannelOffset, Channel, RealRssi, TimeStamp, CkipFlag, &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE); if (Bssidx == BSS_NOT_FOUND) ; else { PBSS_ENTRY pBssEntry = &pAd->MlmeAux.SsidBssTab.BssEntry[Bssidx]; NdisMoveMemory(&pBssEntry->PTSF[0], &Elem->Msg[24], 4); NdisMoveMemory(&pBssEntry->TTSF[0], &Elem->TimeStamp.u.LowPart, 4); NdisMoveMemory(&pBssEntry->TTSF[4], &Elem->TimeStamp.u.LowPart, 4); pBssEntry->Rssi = RealRssi; NdisMoveMemory(pBssEntry->MacAddr, Addr2, MAC_ADDR_LEN); } } /* Update ScanTab */ Bssidx = BssTableSearch(&pAd->ScanTab, Bssid, Channel); if (Bssidx == BSS_NOT_FOUND) { // discover new AP of this network, create BSS entry Bssidx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod, &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability, &AddHtInfo,HtCapabilityLen,AddHtInfoLen,NewExtChannelOffset, Channel, RealRssi, TimeStamp, CkipFlag, &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE); if (Bssidx == BSS_NOT_FOUND) // return if BSS table full return; NdisMoveMemory(pAd->ScanTab.BssEntry[Bssidx].PTSF, &Elem->Msg[24], 4); NdisMoveMemory(&pAd->ScanTab.BssEntry[Bssidx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4); NdisMoveMemory(&pAd->ScanTab.BssEntry[Bssidx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4); pAd->ScanTab.BssEntry[Bssidx].MinSNR = Elem->Signal % 10; if (pAd->ScanTab.BssEntry[Bssidx].MinSNR == 0) pAd->ScanTab.BssEntry[Bssidx].MinSNR = -5; NdisMoveMemory(pAd->ScanTab.BssEntry[Bssidx].MacAddr, Addr2, MAC_ADDR_LEN); } if ((pAd->CommonCfg.bIEEE80211H == 1) && (NewChannel != 0) && (Channel != NewChannel)) { // Switching to channel 1 can prevent from rescanning the current channel immediately (by auto reconnection). // In addition, clear the MLME queue and the scan table to discard the RX packets and previous scanning results. AsicSwitchChannel(pAd, 1, FALSE); AsicLockChannel(pAd, 1); LinkDown(pAd, FALSE); MlmeQueueInit(&pAd->Mlme.Queue); BssTableInit(&pAd->ScanTab); RTMPusecDelay(1000000); // use delay to prevent STA do reassoc // channel sanity check for (index = 0 ; index < pAd->ChannelListNum; index++) { if (pAd->ChannelList[index].Channel == NewChannel) { pAd->ScanTab.BssEntry[Bssidx].Channel = NewChannel; pAd->CommonCfg.Channel = NewChannel; AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.Channel); DBGPRINT(RT_DEBUG_TRACE, ("PeerBeacon - STA receive channel switch announcement IE (New Channel =%d)\n", NewChannel)); break; } } if (index >= pAd->ChannelListNum) { DBGPRINT_ERR(("PeerBeacon(can not find New Channel=%d in ChannelList[%d]\n", pAd->CommonCfg.Channel, pAd->ChannelListNum)); } } if ((((pAd->StaCfg.WepStatus != Ndis802_11WEPDisabled) << 4) ^ CapabilityInfo) & 0x0010) { DBGPRINT(RT_DEBUG_TRACE, ("%s:AP privacy:%x is differenct from STA privacy:%x\n", __FUNCTION__, (CapabilityInfo & 0x0010) >> 4 , pAd->StaCfg.WepStatus != Ndis802_11WEPDisabled)); if (INFRA_ON(pAd)) { LinkDown(pAd,FALSE); BssTableInit(&pAd->ScanTab); } return; } // if the ssid matched & bssid unmatched, we should select the bssid with large value. // This might happened when two STA start at the same time if ((! is_my_bssid) && ADHOC_ON(pAd)) { INT i; // Add the safeguard against the mismatch of adhoc wep status if ((pAd->StaCfg.WepStatus != pAd->ScanTab.BssEntry[Bssidx].WepStatus) || (pAd->StaCfg.AuthMode != pAd->ScanTab.BssEntry[Bssidx].AuthMode)) { return; } // collapse into the ADHOC network which has bigger BSSID value. for (i = 0; i < 6; i++) { if (Bssid[i] > pAd->CommonCfg.Bssid[i]) { DBGPRINT(RT_DEBUG_TRACE, ("SYNC - merge to the IBSS with bigger BSSID=%02x:%02x:%02x:%02x:%02x:%02x\n", Bssid[0], Bssid[1], Bssid[2], Bssid[3], Bssid[4], Bssid[5])); AsicDisableSync(pAd); COPY_MAC_ADDR(pAd->CommonCfg.Bssid, Bssid); AsicSetBssid(pAd, pAd->CommonCfg.Bssid); MakeIbssBeacon(pAd); // re-build BEACON frame AsicEnableIbssSync(pAd); // copy BEACON frame to on-chip memory is_my_bssid = TRUE; break; } else if (Bssid[i] < pAd->CommonCfg.Bssid[i]) break; } } NdisGetSystemUpTime(&Now); pBss = &pAd->ScanTab.BssEntry[Bssidx]; pBss->Rssi = RealRssi; // lastest RSSI pBss->LastBeaconRxTime = Now; // last RX timestamp // // BEACON from my BSSID - either IBSS or INFRA network // if (is_my_bssid) { RXWI_STRUC RxWI; #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 OVERLAP_BSS_SCAN_IE BssScan; UCHAR RegClass; BOOLEAN brc; // Read Beacon's Reg Class IE if any. brc = PeerBeaconAndProbeRspSanity2(pAd, Elem->Msg, Elem->MsgLen, &BssScan, &RegClass); if (brc == TRUE) { UpdateBssScanParm(pAd, BssScan); pAd->StaCfg.RegClass = RegClass; } #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT // pAd->StaCfg.DtimCount = DtimCount; pAd->StaCfg.DtimPeriod = DtimPeriod; pAd->StaCfg.LastBeaconRxTime = Now; RxWI.RSSI0 = Elem->Rssi0; RxWI.RSSI1 = Elem->Rssi1; RxWI.RSSI2 = Elem->Rssi2; RxWI.PHYMODE = 0; //Prevent SNR calculate error Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, &RxWI); #ifdef LINUX #ifdef RT_CFG80211_SUPPORT // CFG80211_BeaconCountryRegionParse(pAd, pVIE, LenVIE); #endif // RT_CFG80211_SUPPORT // #endif // LINUX // if (AironetCellPowerLimit != 0xFF) { // // We get the Cisco (ccx) "TxPower Limit" required // Changed to appropriate TxPower Limit for Ciso Compatible Extensions // ChangeToCellPowerLimit(pAd, AironetCellPowerLimit); } else { // // AironetCellPowerLimit equal to 0xFF means the Cisco (ccx) "TxPower Limit" not exist. // Used the default TX Power Percentage, that set from UI. // pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault; } if (ADHOC_ON(pAd) && (CAP_IS_IBSS_ON(CapabilityInfo))) { UCHAR MaxSupportedRateIn500Kbps = 0; UCHAR idx; MAC_TABLE_ENTRY *pEntry; // supported rates array may not be sorted. sort it and find the maximum rate for (idx=0; idx<SupRateLen; idx++) { if (MaxSupportedRateIn500Kbps < (SupRate[idx] & 0x7f)) MaxSupportedRateIn500Kbps = SupRate[idx] & 0x7f; } for (idx=0; idx<ExtRateLen; idx++) { if (MaxSupportedRateIn500Kbps < (ExtRate[idx] & 0x7f)) MaxSupportedRateIn500Kbps = ExtRate[idx] & 0x7f; } // look up the existing table pEntry = MacTableLookup(pAd, Addr2); // Ad-hoc mode is using MAC address as BA session. So we need to continuously find newly joined adhoc station by receiving beacon. // To prevent always check this, we use wcid == RESERVED_WCID to recognize it as newly joined adhoc station. if ((ADHOC_ON(pAd) && (Elem->Wcid == RESERVED_WCID)) || (pEntry && RTMP_TIME_AFTER(Now, pEntry->LastBeaconRxTime + ADHOC_ENTRY_BEACON_LOST_TIME))) { if (pEntry == NULL) // Another adhoc joining, add to our MAC table. pEntry = MacTableInsertEntry(pAd, Addr2, BSS0, FALSE); if (StaAddMacTableEntry(pAd, pEntry, MaxSupportedRateIn500Kbps, &HtCapability, HtCapabilityLen, &AddHtInfo, AddHtInfoLen, CapabilityInfo) == FALSE) { DBGPRINT(RT_DEBUG_TRACE, ("ADHOC - Add Entry failed.\n")); return; } pEntry->LastBeaconRxTime = 0; if (pEntry && (Elem->Wcid == RESERVED_WCID)) { idx = pAd->StaCfg.DefaultKeyId; RTMP_SET_WCID_SEC_INFO(pAd, BSS0, idx, pAd->SharedKey[BSS0][idx].CipherAlg, pEntry->Aid, SHAREDKEYTABLE); } } if (pEntry && IS_ENTRY_CLIENT(pEntry)) pEntry->LastBeaconRxTime = Now; // At least another peer in this IBSS, declare MediaState as CONNECTED if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) { OPSTATUS_SET_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED); RTMP_IndicateMediaState(pAd, NdisMediaStateConnected); pAd->ExtraInfo = GENERAL_LINK_UP; DBGPRINT(RT_DEBUG_TRACE, ("ADHOC fOP_STATUS_MEDIA_STATE_CONNECTED.\n")); } } if (INFRA_ON(pAd)) { BOOLEAN bUseShortSlot, bUseBGProtection; // decide to use/change to - // 1. long slot (20 us) or short slot (9 us) time // 2. turn on/off RTS/CTS and/or CTS-to-self protection // 3. short preamble //bUseShortSlot = pAd->CommonCfg.bUseShortSlotTime && CAP_IS_SHORT_SLOT(CapabilityInfo); bUseShortSlot = CAP_IS_SHORT_SLOT(CapabilityInfo); if (bUseShortSlot != OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED)) AsicSetSlotTime(pAd, bUseShortSlot); bUseBGProtection = (pAd->CommonCfg.UseBGProtection == 1) || // always use ((pAd->CommonCfg.UseBGProtection == 0) && ERP_IS_USE_PROTECTION(Erp)); if (pAd->CommonCfg.Channel > 14) // always no BG protection in A-band. falsely happened when switching A/G band to a dual-band AP bUseBGProtection = FALSE; if (bUseBGProtection != OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED)) { if (bUseBGProtection) { OPSTATUS_SET_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED); AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, (OFDMSETPROTECT|CCKSETPROTECT|ALLN_SETPROTECT),FALSE,(pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1)); } else { OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED); AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, (OFDMSETPROTECT|CCKSETPROTECT|ALLN_SETPROTECT),TRUE,(pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1)); } DBGPRINT(RT_DEBUG_WARN, ("SYNC - AP changed B/G protection to %d\n", bUseBGProtection)); } #ifdef DOT11_N_SUPPORT // check Ht protection mode. and adhere to the Non-GF device indication by AP. if ((AddHtInfoLen != 0) && ((AddHtInfo.AddHtInfo2.OperaionMode != pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode) || (AddHtInfo.AddHtInfo2.NonGfPresent != pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent))) { pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent = AddHtInfo.AddHtInfo2.NonGfPresent; pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode = AddHtInfo.AddHtInfo2.OperaionMode; if (pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1) { AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, TRUE); } else AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, FALSE); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - AP changed N OperaionMode to %d\n", pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode)); } #endif // DOT11_N_SUPPORT // if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED) && ERP_IS_USE_BARKER_PREAMBLE(Erp)) { MlmeSetTxPreamble(pAd, Rt802_11PreambleLong); DBGPRINT(RT_DEBUG_TRACE, ("SYNC - AP forced to use LONG preamble\n")); } if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) && (EdcaParm.bValid == TRUE) && (EdcaParm.EdcaUpdateCount != pAd->CommonCfg.APEdcaParm.EdcaUpdateCount)) { DBGPRINT(RT_DEBUG_TRACE, ("SYNC - AP change EDCA parameters(from %d to %d)\n", pAd->CommonCfg.APEdcaParm.EdcaUpdateCount, EdcaParm.EdcaUpdateCount)); AsicSetEdcaParm(pAd, &EdcaParm); } // copy QOS related information NdisMoveMemory(&pAd->CommonCfg.APQbssLoad, &QbssLoad, sizeof(QBSS_LOAD_PARM)); NdisMoveMemory(&pAd->CommonCfg.APQosCapability, &QosCapability, sizeof(QOS_CAPABILITY_PARM)); #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 // 2009: PF#1: 20/40 Coexistence in 2.4 GHz Band // When AP changes "STA Channel Width" and "Secondary Channel Offset" fields of HT Operation Element in the Beacon to 0 if ((AddHtInfoLen != 0) && INFRA_ON(pAd)) { BOOLEAN bChangeBW = FALSE; // // 1) HT Information // 2) Secondary Channel Offset Element // // 40 -> 20 case if (pAd->CommonCfg.BBPCurrentBW == BW_40) { if (((AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_NONE) && (AddHtInfo.AddHtInfo.RecomWidth == 0)) ||(NewExtChannelOffset==0x0) ) { bChangeBW = TRUE; pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel; pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.BW = 0; DBGPRINT(RT_DEBUG_TRACE, ("FallBack from 40MHz to 20MHz(CtrlCh=%d, CentralCh=%d)\n", pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel)); CntlChannelWidth(pAd, pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel, BW_20, 0); } } // // 20 -> 40 case // 1.) Supported Channel Width Set Field of the HT Capabilities element of both STAs is set to a non-zero // 2.) Secondary Channel Offset field is SCA or SCB // 3.) 40MHzRegulatoryClass is TRUE (not implement it) // else if (((pAd->CommonCfg.BBPCurrentBW == BW_20) ||(NewExtChannelOffset!=0x0)) && (pAd->CommonCfg.DesiredHtPhy.ChannelWidth != BW_20) ) { if ((AddHtInfo.AddHtInfo.ExtChanOffset != EXTCHA_NONE) && (HtCapabilityLen>0) && (HtCapability.HtCapInfo.ChannelWidth == 1)) { if ((AddHtInfo.ControlChan > 2)&& (AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW)) { pAd->CommonCfg.CentralChannel = AddHtInfo.ControlChan - 2; bChangeBW = TRUE; } else if ((AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE)) { pAd->CommonCfg.CentralChannel = AddHtInfo.ControlChan + 2; bChangeBW = TRUE; } if (bChangeBW) { pAd->CommonCfg.Channel = AddHtInfo.ControlChan; DBGPRINT(RT_DEBUG_TRACE, ("FallBack from 20MHz to 40MHz(CtrlCh=%d, CentralCh=%d)\n", pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel)); CntlChannelWidth(pAd, pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel, BW_40, AddHtInfo.AddHtInfo.ExtChanOffset); pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.BW = 1; } } } if (bChangeBW) { pAd->CommonCfg.BSSCoexist2040.word = 0; TriEventInit(pAd); BuildEffectedChannelList(pAd); } } #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT // } // only INFRASTRUCTURE mode support power-saving feature if ((INFRA_ON(pAd) && (pAd->StaCfg.Psm == PWR_SAVE)) || (pAd->CommonCfg.bAPSDForcePowerSave)) { UCHAR FreeNumber; // 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL // 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE // 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE // 4. Psm change to PWR_SAVE, but AP not been informed yet, we better stay AWAKE // 5. otherwise, put PHY back to sleep to save battery. if (MessageToMe) { #ifdef PCIE_PS_SUPPORT if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) { // Restore to correct BBP R3 value if (pAd->Antenna.field.RxPath > 1) RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); // Turn clk to 80Mhz. } #endif // PCIE_PS_SUPPORT // if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable && pAd->CommonCfg.bAPSDAC_BE && pAd->CommonCfg.bAPSDAC_BK && pAd->CommonCfg.bAPSDAC_VI && pAd->CommonCfg.bAPSDAC_VO) { pAd->CommonCfg.bNeedSendTriggerFrame = TRUE; } else { if (pAd->StaCfg.WindowsBatteryPowerMode == Ndis802_11PowerModeFast_PSP) { /* wake up and send a NULL frame with PM = 0 to the AP */ RTMP_SET_PSM_BIT(pAd, PWR_ACTIVE); RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) ? TRUE:FALSE)); } else { /* use PS-Poll to get any buffered packet */ RTMP_PS_POLL_ENQUEUE(pAd); } } } else if (BcastFlag && (DtimCount == 0) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM)) { #ifdef PCIE_PS_SUPPORT if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) { if (pAd->Antenna.field.RxPath > 1) RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); } #endif // PCIE_PS_SUPPORT // } else if ((pAd->TxSwQueue[QID_AC_BK].Number != 0) || (pAd->TxSwQueue[QID_AC_BE].Number != 0) || (pAd->TxSwQueue[QID_AC_VI].Number != 0) || (pAd->TxSwQueue[QID_AC_VO].Number != 0) || (RTMPFreeTXDRequest(pAd, QID_AC_BK, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) || (RTMPFreeTXDRequest(pAd, QID_AC_BE, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) || (RTMPFreeTXDRequest(pAd, QID_AC_VI, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) || (RTMPFreeTXDRequest(pAd, QID_AC_VO, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) || (RTMPFreeTXDRequest(pAd, QID_MGMT, MGMT_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS)) { // TODO: consider scheduled HCCA. might not be proper to use traditional DTIM-based power-saving scheme // can we cheat here (i.e. just check MGMT & AC_BE) for better performance? #ifdef PCIE_PS_SUPPORT if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) { if (pAd->Antenna.field.RxPath > 1) RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); } #endif // PCIE_PS_SUPPORT // } else { if ((pAd->CommonCfg.bACMAPSDTr[QID_AC_VO]) || (pAd->CommonCfg.bACMAPSDTr[QID_AC_VI]) || (pAd->CommonCfg.bACMAPSDTr[QID_AC_BK]) || (pAd->CommonCfg.bACMAPSDTr[QID_AC_BE])) { /* WMM Spec v1.0 3.6.2.4, The WMM STA shall remain awake until it receives a QoS Data or Null frame addressed to it, with the EOSP subfield in QoS Control field set to 1. So we can not sleep here or we will suffer a case: PS Management Frame --> Trigger frame --> Beacon (TIM=0) (Beacon is closer to Trig frame) --> Station goes to sleep --> AP delivery queued UAPSD packets --> Station can NOT receive the reply Maybe we need a timeout timer to avoid that we do NOT receive the EOSP frame. We can not use More Data to check if SP is ended due to MaxSPLength. */ } else { USHORT NextDtim = DtimCount; if (NextDtim == 0) NextDtim = DtimPeriod; TbttNumToNextWakeUp = pAd->StaCfg.DefaultListenCount; if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM) && (TbttNumToNextWakeUp > NextDtim)) TbttNumToNextWakeUp = NextDtim; if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { // Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode. pAd->ThisTbttNumToNextWakeUp = TbttNumToNextWakeUp; AsicSleepThenAutoWakeup(pAd, pAd->ThisTbttNumToNextWakeUp); } } } } } // not my BSSID, ignore it } // sanity check fail, ignore this frame } /* ========================================================================== Description: Receive PROBE REQ from remote peer when operating in IBSS mode ========================================================================== */ VOID PeerProbeReqAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { UCHAR Addr2[MAC_ADDR_LEN]; CHAR Ssid[MAX_LEN_OF_SSID]; UCHAR SsidLen; #ifdef DOT11_N_SUPPORT UCHAR HtLen, AddHtLen, NewExtLen; #endif // DOT11_N_SUPPORT // HEADER_802_11 ProbeRspHdr; NDIS_STATUS NStatus; PUCHAR pOutBuffer = NULL; ULONG FrameLen = 0; LARGE_INTEGER FakeTimestamp; UCHAR DsLen = 1, IbssLen = 2; UCHAR LocalErpIe[3] = {IE_ERP, 1, 0}; BOOLEAN Privacy; USHORT CapabilityInfo; if (! ADHOC_ON(pAd)) return; if (PeerProbeReqSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, Ssid, &SsidLen, NULL)) { if ((SsidLen == 0) || SSID_EQUAL(Ssid, SsidLen, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen)) { // allocate and send out ProbeRsp frame NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if (NStatus != NDIS_STATUS_SUCCESS) return; //pAd->StaCfg.AtimWin = 0; // ?????? MgtMacHeaderInit(pAd, &ProbeRspHdr, SUBTYPE_PROBE_RSP, 0, Addr2, pAd->CommonCfg.Bssid); Privacy = (pAd->StaCfg.WepStatus == Ndis802_11Encryption1Enabled) || (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) || (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled); CapabilityInfo = CAP_GENERATE(0, 1, Privacy, (pAd->CommonCfg.TxPreamble == Rt802_11PreambleShort), 0, 0); MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(HEADER_802_11), &ProbeRspHdr, TIMESTAMP_LEN, &FakeTimestamp, 2, &pAd->CommonCfg.BeaconPeriod, 2, &CapabilityInfo, 1, &SsidIe, 1, &pAd->CommonCfg.SsidLen, pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid, 1, &SupRateIe, 1, &pAd->StaActive.SupRateLen, pAd->StaActive.SupRateLen, pAd->StaActive.SupRate, 1, &DsIe, 1, &DsLen, 1, &pAd->CommonCfg.Channel, 1, &IbssIe, 1, &IbssLen, 2, &pAd->StaActive.AtimWin, END_OF_ARGS); if (pAd->StaActive.ExtRateLen) { ULONG tmp; MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, 3, LocalErpIe, 1, &ExtRateIe, 1, &pAd->StaActive.ExtRateLen, pAd->StaActive.ExtRateLen, &pAd->StaActive.ExtRate, END_OF_ARGS); FrameLen += tmp; } // Modify by Eddy, support WPA2PSK in Adhoc mode if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) ) { ULONG tmp; UCHAR RSNIe = IE_WPA; MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, 1, &RSNIe, 1, &pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE, END_OF_ARGS); FrameLen += tmp; } #ifdef DOT11_N_SUPPORT if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) { ULONG TmpLen; USHORT epigram_ie_len; UCHAR BROADCOM[4] = {0x0, 0x90, 0x4c, 0x33}; HtLen = sizeof(pAd->CommonCfg.HtCapability); AddHtLen = sizeof(pAd->CommonCfg.AddHTInfo); NewExtLen = 1; //New extension channel offset IE is included in Beacon, Probe Rsp or channel Switch Announcement Frame if (pAd->bBroadComHT == TRUE) { epigram_ie_len = pAd->MlmeAux.HtCapabilityLen + 4; MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 1, &WpaIe, 1, &epigram_ie_len, 4, &BROADCOM[0], pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability, END_OF_ARGS); } else { MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 1, &HtCapIe, 1, &HtLen, sizeof(HT_CAPABILITY_IE), &pAd->CommonCfg.HtCapability, 1, &AddHtInfoIe, 1, &AddHtLen, sizeof(ADD_HT_INFO_IE), &pAd->CommonCfg.AddHTInfo, 1, &NewExtChanIe, 1, &NewExtLen, sizeof(NEW_EXT_CHAN_IE), &pAd->CommonCfg.NewExtChanOffset, END_OF_ARGS); } FrameLen += TmpLen; } #endif // DOT11_N_SUPPORT // MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen); MlmeFreeMemory(pAd, pOutBuffer); } } } VOID BeaconTimeoutAtJoinAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { USHORT Status; DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BeaconTimeoutAtJoinAction\n")); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_REJ_TIMEOUT; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF, 2, &Status, 0); } /* ========================================================================== Description: Scan timeout procedure. basically add channel index by 1 and rescan ========================================================================== */ VOID ScanTimeoutAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { #ifdef RTMP_MAC_USB // // To prevent data lost. // Send an NULL data with turned PSM bit on to current associated AP when SCAN in the channel where // associated AP located. // if ((pAd->CommonCfg.Channel == pAd->MlmeAux.Channel) && (pAd->MlmeAux.ScanType == SCAN_ACTIVE) && (INFRA_ON(pAd)) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) ) { RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) ? TRUE:FALSE)); } #endif // RTMP_MAC_USB // if (pAd->StaCfg.bFastConnect && !pAd->StaCfg.bNotFirstScan) { pAd->MlmeAux.Channel = 0; pAd->StaCfg.bNotFirstScan = TRUE; } else pAd->MlmeAux.Channel = NextChannel(pAd, pAd->MlmeAux.Channel); // Only one channel scanned for CISCO beacon request if ((pAd->MlmeAux.ScanType == SCAN_CISCO_ACTIVE) || (pAd->MlmeAux.ScanType == SCAN_CISCO_PASSIVE) || (pAd->MlmeAux.ScanType == SCAN_CISCO_NOISE) || (pAd->MlmeAux.ScanType == SCAN_CISCO_CHANNEL_LOAD)) pAd->MlmeAux.Channel = 0; // this routine will stop if pAd->MlmeAux.Channel == 0 ScanNextChannel(pAd); } /* ========================================================================== Description: ========================================================================== */ VOID InvalidStateWhenScan( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { USHORT Status; DBGPRINT(RT_DEBUG_TRACE, ("AYNC - InvalidStateWhenScan(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState)); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_STATE_MACHINE_REJECT; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status, 0); } /* ========================================================================== Description: ========================================================================== */ VOID InvalidStateWhenJoin( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { USHORT Status; DBGPRINT(RT_DEBUG_TRACE, ("InvalidStateWhenJoin(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState)); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_STATE_MACHINE_REJECT; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF, 2, &Status, 0); } /* ========================================================================== Description: ========================================================================== */ VOID InvalidStateWhenStart( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { USHORT Status; DBGPRINT(RT_DEBUG_TRACE, ("InvalidStateWhenStart(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState)); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_STATE_MACHINE_REJECT; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_START_CONF, 2, &Status, 0); } /* ========================================================================== Description: IRQL = DISPATCH_LEVEL ========================================================================== */ VOID EnqueuePsPoll( IN PRTMP_ADAPTER pAd) { #ifdef RALINK_ATE if (ATE_ON(pAd)) { return; } #endif // RALINK_ATE // if (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeLegacy_PSP) pAd->PsPollFrame.FC.PwrMgmt = PWR_SAVE; MiniportMMRequest(pAd, 0, (PUCHAR)&pAd->PsPollFrame, sizeof(PSPOLL_FRAME)); } /* ========================================================================== Description: ========================================================================== */ VOID EnqueueProbeRequest( IN PRTMP_ADAPTER pAd) { NDIS_STATUS NState; PUCHAR pOutBuffer; ULONG FrameLen = 0; HEADER_802_11 Hdr80211; DBGPRINT(RT_DEBUG_TRACE, ("force out a ProbeRequest ...\n")); NState = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if (NState == NDIS_STATUS_SUCCESS) { MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, BROADCAST_ADDR, BROADCAST_ADDR); // this ProbeRequest explicitly specify SSID to reduce unwanted ProbeResponse MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(HEADER_802_11), &Hdr80211, 1, &SsidIe, 1, &pAd->CommonCfg.SsidLen, pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid, 1, &SupRateIe, 1, &pAd->StaActive.SupRateLen, pAd->StaActive.SupRateLen, pAd->StaActive.SupRate, END_OF_ARGS); MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen); MlmeFreeMemory(pAd, pOutBuffer); } } #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 VOID BuildEffectedChannelList( IN PRTMP_ADAPTER pAd) { UCHAR EChannel[11]; UCHAR i, j, k; UCHAR UpperChannel = 0, LowerChannel = 0; RTMPZeroMemory(EChannel, 11); DBGPRINT(RT_DEBUG_TRACE, ("BuildEffectedChannelList:CtrlCh=%d,CentCh=%d,AuxCtrlCh=%d,AuxExtCh=%d\n", pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel, pAd->MlmeAux.AddHtInfo.ControlChan, pAd->MlmeAux.AddHtInfo.AddHtInfo.ExtChanOffset)); // 802.11n D4 11.14.3.3: If no secondary channel has been selected, all channels in the frequency band shall be scanned. //if (pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.BW == BW_20) { for (k = 0;k < pAd->ChannelListNum;k++) { if (pAd->ChannelList[k].Channel <=14 ) pAd->ChannelList[k].bEffectedChannel = TRUE; } return; } i = 0; // Find upper and lower channel according to 40MHz current operation. if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel) { UpperChannel = pAd->CommonCfg.Channel; LowerChannel = pAd->CommonCfg.CentralChannel-2; } else if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel) { UpperChannel = pAd->CommonCfg.CentralChannel+2; LowerChannel = pAd->CommonCfg.Channel; } else { DBGPRINT(RT_DEBUG_TRACE, ("LinkUP 20MHz . No Effected Channel \n")); // Now operating in 20MHz, doesn't find 40MHz effected channels return; } DeleteEffectedChannelList(pAd); DBGPRINT(RT_DEBUG_TRACE, ("BuildEffectedChannelList!LowerChannel ~ UpperChannel; %d ~ %d \n", LowerChannel, UpperChannel)); // Find all channels that are below lower channel.. if (LowerChannel > 1) { EChannel[0] = LowerChannel - 1; i = 1; if (LowerChannel > 2) { EChannel[1] = LowerChannel - 2; i = 2; if (LowerChannel > 3) { EChannel[2] = LowerChannel - 3; i = 3; } } } // Find all channels that are between lower channel and upper channel. for (k = LowerChannel;k <= UpperChannel;k++) { EChannel[i] = k; i++; } // Find all channels that are above upper channel.. if (UpperChannel < 14) { EChannel[i] = UpperChannel + 1; i++; if (UpperChannel < 13) { EChannel[i] = UpperChannel + 2; i++; if (UpperChannel < 12) { EChannel[i] = UpperChannel + 3; i++; } } } // Total i channels are effected channels. // Now find corresponding channel in ChannelList array. Then set its bEffectedChannel= TRUE for (j = 0;j < i;j++) { for (k = 0;k < pAd->ChannelListNum;k++) { if (pAd->ChannelList[k].Channel == EChannel[j]) { pAd->ChannelList[k].bEffectedChannel = TRUE; DBGPRINT(RT_DEBUG_TRACE,(" EffectedChannel[%d]( =%d)\n", k, EChannel[j])); break; } } } } VOID DeleteEffectedChannelList( IN PRTMP_ADAPTER pAd) { UCHAR i; // Clear all bEffectedChannel in ChannelList array. //for (i = 0; i < (pAd->ChannelListNum - 1); i++) for (i = 0; i < pAd->ChannelListNum; i++) { pAd->ChannelList[i].bEffectedChannel = FALSE; } } /* ======================================================================== Routine Description: Control Primary&Central Channel, ChannelWidth and Second Channel Offset Arguments: pAd Pointer to our adapter PrimaryChannel Primary Channel CentralChannel Central Channel ChannelWidth BW_20 or BW_40 SecondaryChannelOffset EXTCHA_NONE, EXTCHA_ABOVE and EXTCHA_BELOW Return Value: None Note: ======================================================================== */ VOID CntlChannelWidth( IN PRTMP_ADAPTER pAd, IN UCHAR PrimaryChannel, IN UCHAR CentralChannel, IN UCHAR ChannelWidth, IN UCHAR SecondaryChannelOffset) { UCHAR Value = 0; UINT32 Data = 0; DBGPRINT(RT_DEBUG_TRACE, ("%s: PrimaryChannel[%d] \n",__FUNCTION__,PrimaryChannel)); DBGPRINT(RT_DEBUG_TRACE, ("%s: CentralChannel[%d] \n",__FUNCTION__,CentralChannel)); DBGPRINT(RT_DEBUG_TRACE, ("%s: ChannelWidth[%d] \n",__FUNCTION__,ChannelWidth)); DBGPRINT(RT_DEBUG_TRACE, ("%s: SecondaryChannelOffset[%d] \n",__FUNCTION__,SecondaryChannelOffset)); #ifdef DOT11_N_SUPPORT // Change to AP channel if (ChannelWidth == BW_40) { if(SecondaryChannelOffset == EXTCHA_ABOVE) { // Must using 40MHz. pAd->CommonCfg.BBPCurrentBW = BW_40; AsicSwitchChannel(pAd, CentralChannel, FALSE); AsicLockChannel(pAd, CentralChannel); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value); Value &= (~0x18); Value |= 0x10; RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value); // RX : control channel at lower RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); Value &= (~0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); Data &= 0xfffffffe; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data); if (pAd->MACVersion == 0x28600100) { RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16); DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); } DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel )); } else if (SecondaryChannelOffset == EXTCHA_BELOW) { // Must using 40MHz. pAd->CommonCfg.BBPCurrentBW = BW_40; AsicSwitchChannel(pAd, CentralChannel, FALSE); AsicLockChannel(pAd, CentralChannel); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value); Value &= (~0x18); Value |= 0x10; RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value); RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); Data |= 0x1; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); Value |= (0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); if (pAd->MACVersion == 0x28600100) { RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16); DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); } DBGPRINT(RT_DEBUG_TRACE, ("!!! 40MHz Upper !!! Control Channel at UpperCentral = %d \n", CentralChannel)); } } else #endif // DOT11_N_SUPPORT // { pAd->CommonCfg.BBPCurrentBW = BW_20; AsicSwitchChannel(pAd, PrimaryChannel, FALSE); AsicLockChannel(pAd, PrimaryChannel); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value); Value &= (~0x18); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value); RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); Data &= 0xfffffffe; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); Value &= (~0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); if (pAd->MACVersion == 0x28600100) { RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11); DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); } DBGPRINT(RT_DEBUG_TRACE, ("!!! 20MHz !!! \n" )); } RTMPSetAGCInitValue(pAd, pAd->CommonCfg.BBPCurrentBW); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &pAd->BbpTuning.R66CurrentValue); } #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT //
KlemensWinter/ecafe_kernel
drivers/net/wireless/rt3070sta/sta/sync.c
C
gpl-2.0
80,839
/* qv4l2: a control panel controlling v4l2 devices. * * Copyright (C) 2006 Hans Verkuil <hverkuil@xs4all.nl> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QV4L2_H #define QV4L2_H #include <QMainWindow> #include <QTabWidget> #include <QSignalMapper> #include <QLabel> #include <QGridLayout> #include <QSocketNotifier> #include <QImage> #include <QFileDialog> #include <map> #include <vector> #include "v4l2-api.h" #include "raw2sliced.h" class QComboBox; class QSpinBox; class GeneralTab; class VbiTab; class QCloseEvent; class CaptureWin; typedef std::vector<unsigned> ClassIDVec; typedef std::map<unsigned, ClassIDVec> ClassMap; typedef std::map<unsigned, struct v4l2_queryctrl> CtrlMap; typedef std::map<unsigned, QWidget *> WidgetMap; enum { CTRL_UPDATE_ON_CHANGE = 0x10, CTRL_DEFAULTS, CTRL_REFRESH, CTRL_UPDATE }; enum CapMethod { methodRead, methodMmap, methodUser }; struct buffer { void *start; size_t length; }; #define CTRL_FLAG_DISABLED (V4L2_CTRL_FLAG_READ_ONLY | \ V4L2_CTRL_FLAG_INACTIVE | \ V4L2_CTRL_FLAG_GRABBED) class ApplicationWindow: public QMainWindow, public v4l2 { Q_OBJECT public: ApplicationWindow(); virtual ~ApplicationWindow(); private slots: void closeDevice(); void closeCaptureWin(); public: void setDevice(const QString &device, bool rawOpen); // capturing private: CaptureWin *m_capture; bool startCapture(unsigned buffer_size); void stopCapture(); void startOutput(unsigned buffer_size); void stopOutput(); struct buffer *m_buffers; struct v4l2_format m_capSrcFormat; struct v4l2_format m_capDestFormat; unsigned char *m_frameData; unsigned m_nbuffers; struct v4lconvert_data *m_convertData; bool m_mustConvert; CapMethod m_capMethod; bool m_makeSnapshot; private slots: void capStart(bool); void capFrame(); void ctrlEvent(); void snapshot(); void capVbiFrame(); void saveRaw(bool); // gui private slots: void opendev(); void openrawdev(); void ctrlAction(int); void openRawFile(const QString &s); void rejectedRawFile(); void about(); public: virtual void error(const QString &text); void error(int err); void errorCtrl(unsigned id, int err); void errorCtrl(unsigned id, int err, long long v); void errorCtrl(unsigned id, int err, const QString &v); void info(const QString &info); virtual void closeEvent(QCloseEvent *event); private: void addWidget(QGridLayout *grid, QWidget *w, Qt::Alignment align = Qt::AlignLeft); void addLabel(QGridLayout *grid, const QString &text, Qt::Alignment align = Qt::AlignRight) { addWidget(grid, new QLabel(text, parentWidget()), align); } void addTabs(); void finishGrid(QGridLayout *grid, unsigned ctrl_class); void addCtrl(QGridLayout *grid, const struct v4l2_queryctrl &qctrl); void updateCtrl(unsigned id); void refresh(unsigned ctrl_class); void refresh(); void makeSnapshot(unsigned char *buf, unsigned size); void setDefaults(unsigned ctrl_class); int getVal(unsigned id); long long getVal64(unsigned id); QString getString(unsigned id); void setVal(unsigned id, int v); void setVal64(unsigned id, long long v); void setString(unsigned id, const QString &v); QString getCtrlFlags(unsigned flags); void setWhat(QWidget *w, unsigned id, const QString &v); void setWhat(QWidget *w, unsigned id, long long v); void updateVideoInput(); void updateVideoOutput(); void updateAudioInput(); void updateAudioOutput(); void updateStandard(); void updateFreq(); void updateFreqChannel(); GeneralTab *m_genTab; VbiTab *m_vbiTab; QAction *m_capStartAct; QAction *m_snapshotAct; QAction *m_saveRawAct; QAction *m_showFramesAct; QString m_filename; QSignalMapper *m_sigMapper; QTabWidget *m_tabs; QSocketNotifier *m_capNotifier; QSocketNotifier *m_ctrlNotifier; QImage *m_capImage; int m_row, m_col, m_cols; CtrlMap m_ctrlMap; WidgetMap m_widgetMap; ClassMap m_classMap; bool m_haveExtendedUserCtrls; bool m_showFrames; int m_vbiSize; unsigned m_vbiWidth; unsigned m_vbiHeight; struct vbi_handle m_vbiHandle; unsigned m_frame; unsigned m_lastFrame; unsigned m_fps; struct timeval m_tv; QFile m_saveRaw; }; extern ApplicationWindow *g_mw; class SaveDialog : public QFileDialog { Q_OBJECT public: SaveDialog(QWidget *parent, const QString &caption) : QFileDialog(parent, caption), m_buf(NULL) {} virtual ~SaveDialog() {} bool setBuffer(unsigned char *buf, unsigned size); public slots: void selected(const QString &s); private: unsigned char *m_buf; unsigned m_size; }; #endif
Distrotech/v4l-utils
utils/qv4l2/qv4l2.h
C
gpl-2.0
5,184
<?php /** * Background OptionType * * @author SpyroSol * @category UI * @package Spyropress */ function spyropress_ui_background($item, $id, $value, $is_widget = false, $is_builder = false) { ob_start(); // defaults $style = ''; $defaults = array( 'background-color' => '', 'background-image' => '', 'background-repeat' => '', 'background-attachment' => '', 'background-position' => '', 'background-pattern' => '' ); $value = wp_parse_args( $value, $defaults ); // collecting colorpicker attributes $atts = array(); $atts['class'] = 'field'; $atts['type'] = 'text'; $atts['id'] = esc_attr( $id . '-colorpicker' ); $atts['name'] = esc_attr( $item['name'] . '[background-color]' ); if( $value['background-color'] ) $atts['value'] = esc_attr( $value['background-color'] ); $style = ''; if( $value['background-color'] ) $style = ' style="background:' . $value['background-color'] . ';border-color:' . $value['background-color'] . '"'; // collecting upload attributes $upload_attrs = array(); $upload_attrs['class'] = 'field upload' . ( ( $value != '' ) ? ' has-file' : '' ); $upload_attrs['type'] = 'text'; $upload_attrs['id'] = esc_attr( $id ); $upload_attrs['name'] = esc_attr( $item['name'] . '[background-image]' ); if( $value['background-image'] ) $upload_attrs['value'] = esc_attr( $value['background-image'] ); ?> <div <?php echo build_section_class( 'section-background', $item ); ?>> <?php build_heading( $item, $is_widget ); ?> <?php build_description( $item ); ?> <?php build_section_reset(); ?> <div class="controls"> <div class="color-picker pb10 clearfix"> <?php printf( '<input%s />', spyropress_build_atts( $atts ) ); printf( '<div class="color-box"><div%s></div></div>', $style ); ?> </div> <div class="pb10 row-fluid"> <div class="span6"> <select name="<?php echo $item['name']; ?>[background-repeat]" class="chosen" data-placeholder="<?php esc_attr_e( 'Background Repeat', 'spyropress' ); ?>"> <?php foreach ( spyropress_panel_background_repeat() as $key => $repeat ) render_option(esc_attr( $key ), esc_html( $repeat ), array( $value['background-repeat'] )); ?> </select> </div> <div class="span6"> <select name="<?php echo $item['name']; ?>[background-attachment]" class="chosen" data-placeholder="<?php esc_attr_e( 'Background Attachment', 'spyropress' ); ?>"> <?php foreach ( spyropress_panel_background_attachment() as $key => $attachment ) render_option(esc_attr( $key ), esc_html( $attachment ), array( $value['background-attachment'] )); ?> </select> </div> </div> <div class="pb10"> <select name="<?php echo $item['name']; ?>[background-position]" class="chosen" data-placeholder="<?php esc_attr_e( 'Background Position', 'spyropress' ); ?>"> <?php foreach ( spyropress_panel_background_position() as $key => $position ) { render_option(esc_attr( $key ), esc_html( $position ), array( $value['background-position'] )); } ?> </select> </div> <div class="uploader pb10 clearfix"> <?php printf( '<input%s />', spyropress_build_atts( $upload_attrs ) ); printf( '<input class="upload_button button-secondary" type="button" value="'.__( 'Upload', 'spyropress' ).'" id="upload_%s" />', $id); if ( is_array( @getimagesize( $value['background-image'] ) ) ) { ?> <div class="screenshot" id="<?php echo $id; ?>_image"> <?php if ( $value['background-image'] != '' ) { $remove = '<a href="javascript:(void);" class="remove-media">Remove</a>'; $image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value['background-image'] ); if ( $image ) { echo '<img src="'.$value['background-image'].'" alt="" />'.$remove.''; } else { $parts = explode( "/", $value['background-image'] ); for( $i = 0; $i < sizeof($parts); ++$i ) { $title = $parts[$i]; } echo '<div class="no_image"><a href="'.$value['background-image'].'">'.$title.'</a>'.$remove.'</div>'; } } ?> </div> <?php } ?> </div> <?php if ( isset( $item['use_pattern'] ) && $item['use_pattern'] && isset( $item['patterns'] ) ) { ?> <div class="section-radio-img section-pattern"> <h3 class="heading"><?php _e( 'Background Patterns', 'spyropress' ); ?></h3> <ul id="bg_patterns"> <?php foreach ( $item['patterns'] as $path => $label ) { printf(' <li><label class="radio-img%6$s" for="%1$s"> <input type="radio" id="%1$s" name="%3$s[background-pattern]" value="%2$s" %5$s /> <img src="%4$s"> </label></li>', $item['name'].'_'.$label, $path, $item['name'], $path, checked( $value['background-pattern'], $path, false ), ($value['background-pattern'] == $path) ? ' selected': '' ); } ?> </ul> <div class="clear"></div> </div> <?php } ?> </div> </div> <?php $ui_content = ob_get_clean(); $js = "panelUi.bind_colorpicker( '{$id}-colorpicker' );"; if($is_widget) { if(!$is_builder) add_jquery_ready($js); else $ui_content .= sprintf( '<script type="text/javascript">%2$s//<![CDATA[%2$s %1$s %2$s//]]>%2$s</script>', $js, "\n" ); return $ui_content; } else { echo $ui_content; add_jquery_ready($js); } } function spyropress_widget_background( $item, $id, $value, $is_builder = false ) { return spyropress_ui_background( $item, $id, $value, true, $is_builder ); } /** * Background Repeat */ function spyropress_panel_background_repeat() { return array( '' => '', 'no-repeat' => __( 'No Repeat', 'spyropress' ), 'repeat' => __( 'Repeat All', 'spyropress' ), 'repeat-x' => __( 'Repeat Horizontally', 'spyropress' ), 'repeat-y' => __( 'Repeat Vertically', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } /** * Background Attachment */ function spyropress_panel_background_attachment() { return array( '' => '', 'fixed' => __( 'Fixed', 'spyropress' ), 'scroll' => __( 'Scroll', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } /** * Background Position */ function spyropress_panel_background_position() { return array( '' => '', 'left top' => __( 'Left Top', 'spyropress' ), 'left center' => __( 'Left Center', 'spyropress' ), 'left bottom' => __( 'Left Bottom', 'spyropress' ), 'center top' => __( 'Center Top', 'spyropress' ), 'center center' => __( 'Center Center', 'spyropress' ), 'center bottom' => __( 'Center Bottom', 'spyropress' ), 'right top' => __( 'Right Top', 'spyropress' ), 'right center' => __( 'Right Center', 'spyropress' ), 'right bottom' => __( 'Right Bottom', 'spyropress' ) ); } ?>
jamesshannonwd/meesha
wp-content/themes/cutting-edge/framework/admin/ui/background.php
PHP
gpl-2.0
8,549
/* * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.prism.j2d; import com.sun.javafx.geom.Rectangle; import com.sun.prism.PresentableState; import com.sun.prism.PrinterGraphics; public final class PrismPrintGraphics extends J2DPrismGraphics implements PrinterGraphics { static class PrintResourceFactory extends J2DResourceFactory { PrintResourceFactory() { super(null); } @Override J2DPrismGraphics createJ2DPrismGraphics(J2DPresentable target, java.awt.Graphics2D g2d) { J2DPrismGraphics pg = new PrismPrintGraphics(target, g2d); Rectangle cr = new Rectangle(0, 0, target.getContentWidth(), target.getContentHeight()); pg.setClipRect(cr); return pg; } } static class PagePresentable extends J2DPresentable { private int width; private int height; static J2DResourceFactory factory = new PrintResourceFactory(); PagePresentable(int width, int height) { super(null, factory); this.width = width; this.height = height; } @Override public java.awt.image.BufferedImage createBuffer(int w, int h) { throw new UnsupportedOperationException("cannot create new buffers for image"); } @Override public boolean lockResources(PresentableState pState) { return false; } public boolean prepare(Rectangle dirtyregion) { throw new UnsupportedOperationException("Cannot prepare an image"); } public boolean present() { throw new UnsupportedOperationException("Cannot present on image"); } public int getContentWidth() { return width; } public int getContentHeight() { return height; } private boolean opaque; public void setOpaque(boolean opaque) { this.opaque = opaque; } public boolean isOpaque() { return opaque; } } // The FX code thinks it can call setTransform() without // doing harm. Need to intercept all such calls and convert // them into a concatenation on the original/default transform. protected void setTransformG2D(java.awt.geom.AffineTransform tx) { g2d.setTransform(origTx2D); g2d.transform(tx); } // Because super() has to the first call, I need this function // to be called by the super-class constructor. This is all // just to have the by-product effect of grabbing the tx early. // I could make the caller of the constructor pass it, but it // really shouldn't have to be responsible for the necessity private java.awt.geom.AffineTransform origTx2D; protected void captureTransform(java.awt.Graphics2D g2d) { origTx2D = g2d.getTransform(); } public PrismPrintGraphics(java.awt.Graphics2D g2d, int width, int height) { super(new PagePresentable(width, height), g2d); setClipRect(new Rectangle(0,0,width,height)); } PrismPrintGraphics(J2DPresentable target, java.awt.Graphics2D g2d) { super(target, g2d); } }
lostdj/Jaklin-OpenJFX
modules/graphics/src/main/java/com/sun/prism/j2d/PrismPrintGraphics.java
Java
gpl-2.0
4,468
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\QuickTime; use PHPExiftool\Driver\AbstractTag; class LocationNote extends AbstractTag { protected $Id = 'location.note'; protected $Name = 'LocationNote'; protected $FullName = 'QuickTime::Keys'; protected $GroupName = 'QuickTime'; protected $g0 = 'QuickTime'; protected $g1 = 'QuickTime'; protected $g2 = 'Other'; protected $Type = '?'; protected $Writable = false; protected $Description = 'Location Note'; protected $local_g2 = 'Location'; }
Droces/casabio
vendor/phpexiftool/phpexiftool/lib/PHPExiftool/Driver/Tag/QuickTime/LocationNote.php
PHP
gpl-2.0
767
# Copyright (C) 2008-2014 Zentyal S.L. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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 use strict; use warnings; package EBox::Logs::Model::SelectLog; use base 'EBox::Model::DataTable'; use TryCatch::Lite; use EBox::Global; use EBox::Gettext; use EBox::Types::Link; sub new { my $class = shift; my %parms = @_; my $self = $class->SUPER::new(@_); bless($self, $class); return $self; } # Method: ids # # Override <EBox::Model::DataTable::ids> as we don't need to # store these rows. Actually, the rows returned by this model # are built in runtime. All their elements are read only so # there is no need to store anything. # # We simply create an id array using an integer for every # row. # # This id will be used to build the row in runtime in # <EBox::Model::SelectLog::row) sub ids { my ($self) = @_; my @ids; my $logs = EBox::Global->modInstance('logs'); my @mods = @{ $logs->getLogsModules() }; my $idx = 0; foreach my $mod (@mods) { foreach my $urlGroup (@{ $mod->reportUrls }) { push (@ids, $idx); $idx++; } } return \@ids; } # Method: row # # Override <EBox::Model::DataTable::row> as we don't need to # store these rows. Actually, the rows returned by this model # are built in runtime. All their elements are read only so # there is no need to store anything. # # Use one of the id returned by <EBox::Model::SelectLog::ids> # to build and return the requested row sub row { my ($self, $id) = @_; my $logs = EBox::Global->modInstance('logs'); my @mods = @{ $logs->getLogsModules() }; my $idx = 0; my $rowValues; foreach my $mod (@mods) { foreach my $urlGroup (@{ $mod->reportUrls }) { if ($idx == $id) { my $row = $self->_setValueRow(%{$urlGroup}); $row->setId($id); $row->setReadOnly(1); return $row; } $idx++; } } return undef; } sub logRows { my ($self) = @_; } # Function: filterDomain # # This is a callback used to filter the output of the field domain. # It basically translates the log domain # # Parameters: # # instancedType- an object derivated of <EBox::Types::Abastract> # # Return: # # string - translation sub filterDomain { my ($instancedType) = @_; my $logs = EBox::Global->modInstance('logs'); my $table = $logs->getTableInfo($instancedType->value()); my $translation = $table->{'name'}; if ($translation) { return $translation; } else { return $instancedType->value(); } } sub _table { my @tableHead = ( new EBox::Types::Text( 'fieldName' => 'domain', 'printableName' => __('Domain'), 'size' => '12', 'unique' => 0, 'editable' => 0, 'filter' => \&filterDomain ), new EBox::Types::Link( fieldName => 'raw', printableName => __('Full report'), editable => 0, optional => 1, ), new EBox::Types::Link( fieldName => 'summary', printableName => __('Summarized report'), editable => 0, optional => 1, ), ); my $dataTable = { 'tableName' => 'SelectLog', 'printableTableName' => __('Query Logs'), 'defaultController' => '/Logs/Controller/SelectLog', 'defaultActions' => [ 'editField', 'changeView' ], 'tableDescription' => \@tableHead, 'class' => 'dataTable', 'order' => 0, 'rowUnique' => 0, 'printableRowName' => __('logs'), 'messages' => { add => undef, }, }; return $dataTable; } 1;
claudm/zentyal
main/core/src/EBox/Logs/Model/SelectLog.pm
Perl
gpl-2.0
4,794
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing author: Paul Crozier, Aidan Thompson (SNL) ------------------------------------------------------------------------- */ #include "fix_gcmc.h" #include "angle.h" #include "atom.h" #include "atom_vec.h" #include "bond.h" #include "comm.h" #include "compute.h" #include "dihedral.h" #include "domain.h" #include "error.h" #include "fix.h" #include "force.h" #include "group.h" #include "improper.h" #include "kspace.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" #include "modify.h" #include "molecule.h" #include "neighbor.h" #include "pair.h" #include "random_park.h" #include "region.h" #include "update.h" #include <cmath> #include <cstring> using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; // large energy value used to signal overlap #define MAXENERGYSIGNAL 1.0e100 // this must be lower than MAXENERGYSIGNAL // by a large amount, so that it is still // less than total energy when negative // energy contributions are added to MAXENERGYSIGNAL #define MAXENERGYTEST 1.0e50 enum{EXCHATOM,EXCHMOL}; // exchmode enum{MOVEATOM,MOVEMOL}; // movemode /* ---------------------------------------------------------------------- */ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), idregion(nullptr), full_flag(0), ngroups(0), groupstrings(nullptr), ngrouptypes(0), grouptypestrings(nullptr), grouptypebits(nullptr), grouptypes(nullptr), local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), random_equal(nullptr), random_unequal(nullptr), fixrigid(nullptr), fixshake(nullptr), idrigid(nullptr), idshake(nullptr) { if (narg < 11) error->all(FLERR,"Illegal fix gcmc command"); if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Fix gcmc does not (yet) work with atom_style template"); dynamic_group_allow = 1; vector_flag = 1; size_vector = 8; global_freq = 1; extvector = 0; restart_global = 1; time_depend = 1; // required args nevery = utils::inumeric(FLERR,arg[3],false,lmp); nexchanges = utils::inumeric(FLERR,arg[4],false,lmp); nmcmoves = utils::inumeric(FLERR,arg[5],false,lmp); ngcmc_type = utils::inumeric(FLERR,arg[6],false,lmp); seed = utils::inumeric(FLERR,arg[7],false,lmp); reservoir_temperature = utils::numeric(FLERR,arg[8],false,lmp); chemical_potential = utils::numeric(FLERR,arg[9],false,lmp); displace = utils::numeric(FLERR,arg[10],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix gcmc command"); if (nexchanges < 0) error->all(FLERR,"Illegal fix gcmc command"); if (nmcmoves < 0) error->all(FLERR,"Illegal fix gcmc command"); if (seed <= 0) error->all(FLERR,"Illegal fix gcmc command"); if (reservoir_temperature < 0.0) error->all(FLERR,"Illegal fix gcmc command"); if (displace < 0.0) error->all(FLERR,"Illegal fix gcmc command"); // read options from end of input line options(narg-11,&arg[11]); // random number generator, same for all procs random_equal = new RanPark(lmp,seed); // random number generator, not the same for all procs random_unequal = new RanPark(lmp,seed); // error checks on region and its extent being inside simulation box region_xlo = region_xhi = region_ylo = region_yhi = region_zlo = region_zhi = 0.0; if (regionflag) { if (domain->regions[iregion]->bboxflag == 0) error->all(FLERR,"Fix gcmc region does not support a bounding box"); if (domain->regions[iregion]->dynamic_check()) error->all(FLERR,"Fix gcmc region cannot be dynamic"); region_xlo = domain->regions[iregion]->extent_xlo; region_xhi = domain->regions[iregion]->extent_xhi; region_ylo = domain->regions[iregion]->extent_ylo; region_yhi = domain->regions[iregion]->extent_yhi; region_zlo = domain->regions[iregion]->extent_zlo; region_zhi = domain->regions[iregion]->extent_zhi; if (region_xlo < domain->boxlo[0] || region_xhi > domain->boxhi[0] || region_ylo < domain->boxlo[1] || region_yhi > domain->boxhi[1] || region_zlo < domain->boxlo[2] || region_zhi > domain->boxhi[2]) error->all(FLERR,"Fix gcmc region extends outside simulation box"); // estimate region volume using MC trials double coord[3]; int inside = 0; int attempts = 10000000; for (int i = 0; i < attempts; i++) { coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); if (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) != 0) inside++; } double max_region_volume = (region_xhi - region_xlo)* (region_yhi - region_ylo)*(region_zhi - region_zlo); region_volume = max_region_volume*static_cast<double> (inside)/ static_cast<double> (attempts); } // error check and further setup for exchmode = EXCHMOL if (exchmode == EXCHMOL) { if (onemols[imol]->xflag == 0) error->all(FLERR,"Fix gcmc molecule must have coordinates"); if (onemols[imol]->typeflag == 0) error->all(FLERR,"Fix gcmc molecule must have atom types"); if (ngcmc_type != 0) error->all(FLERR,"Atom type must be zero in fix gcmc mol command"); if (onemols[imol]->qflag == 1 && atom->q == nullptr) error->all(FLERR,"Fix gcmc molecule has charges, but atom style does not"); if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix gcmc molecule template ID must be same " "as atom_style template ID"); onemols[imol]->check_attributes(0); } if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix gcmc atom has charge, but atom style does not"); if (rigidflag && exchmode == EXCHATOM) error->all(FLERR,"Cannot use fix gcmc rigid and not molecule"); if (shakeflag && exchmode == EXCHATOM) error->all(FLERR,"Cannot use fix gcmc shake and not molecule"); if (rigidflag && shakeflag) error->all(FLERR,"Cannot use fix gcmc rigid and shake"); if (rigidflag && (nmcmoves > 0)) error->all(FLERR,"Cannot use fix gcmc rigid with MC moves"); if (shakeflag && (nmcmoves > 0)) error->all(FLERR,"Cannot use fix gcmc shake with MC moves"); // setup of array of coordinates for molecule insertion // also used by rotation moves for any molecule if (exchmode == EXCHATOM) natoms_per_molecule = 1; else natoms_per_molecule = onemols[imol]->natoms; nmaxmolatoms = natoms_per_molecule; grow_molecule_arrays(nmaxmolatoms); // compute the number of MC cycles that occur nevery timesteps ncycles = nexchanges + nmcmoves; // set up reneighboring force_reneighbor = 1; next_reneighbor = update->ntimestep + 1; // zero out counters ntranslation_attempts = 0.0; ntranslation_successes = 0.0; nrotation_attempts = 0.0; nrotation_successes = 0.0; ndeletion_attempts = 0.0; ndeletion_successes = 0.0; ninsertion_attempts = 0.0; ninsertion_successes = 0.0; gcmc_nmax = 0; local_gas_list = nullptr; } /* ---------------------------------------------------------------------- parse optional parameters at end of input line ------------------------------------------------------------------------- */ void FixGCMC::options(int narg, char **arg) { if (narg < 0) error->all(FLERR,"Illegal fix gcmc command"); // defaults exchmode = EXCHATOM; movemode = MOVEATOM; patomtrans = 0.0; pmoltrans = 0.0; pmolrotate = 0.0; pmctot = 0.0; max_rotation_angle = 10*MY_PI/180; regionflag = 0; iregion = -1; region_volume = 0; max_region_attempts = 1000; molecule_group = 0; molecule_group_bit = 0; molecule_group_inversebit = 0; exclusion_group = 0; exclusion_group_bit = 0; pressure_flag = false; pressure = 0.0; fugacity_coeff = 1.0; rigidflag = 0; shakeflag = 0; charge = 0.0; charge_flag = false; full_flag = false; ngroups = 0; int ngroupsmax = 0; groupstrings = nullptr; ngrouptypes = 0; int ngrouptypesmax = 0; grouptypestrings = nullptr; grouptypes = nullptr; grouptypebits = nullptr; energy_intra = 0.0; tfac_insert = 1.0; overlap_cutoffsq = 0.0; overlap_flag = 0; min_ngas = -1; max_ngas = INT_MAX; int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"mol") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); imol = atom->find_molecule(arg[iarg+1]); if (imol == -1) error->all(FLERR,"Molecule template ID for fix gcmc does not exist"); if (atom->molecules[imol]->nset > 1 && comm->me == 0) error->warning(FLERR,"Molecule template for " "fix gcmc has multiple molecules"); exchmode = EXCHMOL; onemols = atom->molecules; nmol = onemols[imol]->nset; iarg += 2; } else if (strcmp(arg[iarg],"mcmoves") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix gcmc command"); patomtrans = utils::numeric(FLERR,arg[iarg+1],false,lmp); pmoltrans = utils::numeric(FLERR,arg[iarg+2],false,lmp); pmolrotate = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (patomtrans < 0 || pmoltrans < 0 || pmolrotate < 0) error->all(FLERR,"Illegal fix gcmc command"); pmctot = patomtrans + pmoltrans + pmolrotate; if (pmctot <= 0) error->all(FLERR,"Illegal fix gcmc command"); iarg += 4; } else if (strcmp(arg[iarg],"region") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) error->all(FLERR,"Region ID for fix gcmc does not exist"); idregion = utils::strdup(arg[iarg+1]); regionflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"maxangle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); max_rotation_angle = utils::numeric(FLERR,arg[iarg+1],false,lmp); max_rotation_angle *= MY_PI/180; iarg += 2; } else if (strcmp(arg[iarg],"pressure") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); pressure = utils::numeric(FLERR,arg[iarg+1],false,lmp); pressure_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"fugacity_coeff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); fugacity_coeff = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); charge = utils::numeric(FLERR,arg[iarg+1],false,lmp); charge_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"rigid") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); delete [] idrigid; idrigid = utils::strdup(arg[iarg+1]); rigidflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"shake") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); delete [] idshake; idshake = utils::strdup(arg[iarg+1]); shakeflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"full_energy") == 0) { full_flag = true; iarg += 1; } else if (strcmp(arg[iarg],"group") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); if (ngroups >= ngroupsmax) { ngroupsmax = ngroups+1; groupstrings = (char **) memory->srealloc(groupstrings, ngroupsmax*sizeof(char *), "fix_gcmc:groupstrings"); } groupstrings[ngroups] = utils::strdup(arg[iarg+1]); ngroups++; iarg += 2; } else if (strcmp(arg[iarg],"grouptype") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix gcmc command"); if (ngrouptypes >= ngrouptypesmax) { ngrouptypesmax = ngrouptypes+1; grouptypes = (int*) memory->srealloc(grouptypes,ngrouptypesmax*sizeof(int), "fix_gcmc:grouptypes"); grouptypestrings = (char**) memory->srealloc(grouptypestrings, ngrouptypesmax*sizeof(char *), "fix_gcmc:grouptypestrings"); } grouptypes[ngrouptypes] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); grouptypestrings[ngrouptypes] = utils::strdup(arg[iarg+2]); ngrouptypes++; iarg += 3; } else if (strcmp(arg[iarg],"intra_energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tfac_insert") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); tfac_insert = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overlap_cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); double rtmp = utils::numeric(FLERR,arg[iarg+1],false,lmp); overlap_cutoffsq = rtmp*rtmp; overlap_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"min") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); min_ngas = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); max_ngas = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal fix gcmc command"); } } /* ---------------------------------------------------------------------- */ FixGCMC::~FixGCMC() { if (regionflag) delete [] idregion; delete random_equal; delete random_unequal; memory->destroy(local_gas_list); memory->destroy(molcoords); memory->destroy(molq); memory->destroy(molimage); delete [] idrigid; delete [] idshake; if (ngroups > 0) { for (int igroup = 0; igroup < ngroups; igroup++) delete [] groupstrings[igroup]; memory->sfree(groupstrings); } if (ngrouptypes > 0) { memory->destroy(grouptypes); memory->destroy(grouptypebits); for (int igroup = 0; igroup < ngrouptypes; igroup++) delete [] grouptypestrings[igroup]; memory->sfree(grouptypestrings); } if (full_flag && group) { int igroupall = group->find("all"); neighbor->exclusion_group_group_delete(exclusion_group,igroupall); } } /* ---------------------------------------------------------------------- */ int FixGCMC::setmask() { int mask = 0; mask |= PRE_EXCHANGE; return mask; } /* ---------------------------------------------------------------------- */ void FixGCMC::init() { triclinic = domain->triclinic; // set probabilities for MC moves if (pmctot == 0.0) if (exchmode == EXCHATOM) { movemode = MOVEATOM; patomtrans = 1.0; pmoltrans = 0.0; pmolrotate = 0.0; } else { movemode = MOVEMOL; patomtrans = 0.0; pmoltrans = 0.5; pmolrotate = 0.5; } else { if (pmoltrans == 0.0 && pmolrotate == 0.0) movemode = MOVEATOM; else movemode = MOVEMOL; patomtrans /= pmctot; pmoltrans /= pmctot; pmolrotate /= pmctot; } // decide whether to switch to the full_energy option if (!full_flag) { if ((force->kspace) || (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("^hybrid",0)) || (force->pair_match("^eam",0)) || (force->pair->tail_flag)) { full_flag = true; if (comm->me == 0) error->warning(FLERR,"Fix gcmc using full_energy option"); } } if (full_flag) c_pe = modify->compute[modify->find_compute("thermo_pe")]; int *type = atom->type; if (exchmode == EXCHATOM) { if (ngcmc_type <= 0 || ngcmc_type > atom->ntypes) error->all(FLERR,"Invalid atom type in fix gcmc command"); } // if atoms are exchanged, warn if any deletable atom has a mol ID if ((exchmode == EXCHATOM) && atom->molecule_flag) { tagint *molecule = atom->molecule; int flag = 0; for (int i = 0; i < atom->nlocal; i++) if (type[i] == ngcmc_type) if (molecule[i]) flag = 1; int flagall; MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall && comm->me == 0) error->all(FLERR, "Fix gcmc cannot exchange individual atoms belonging to a molecule"); } // if molecules are exchanged or moved, check for unset mol IDs if (exchmode == EXCHMOL || movemode == MOVEMOL) { tagint *molecule = atom->molecule; int *mask = atom->mask; int flag = 0; for (int i = 0; i < atom->nlocal; i++) if (mask[i] == groupbit) if (molecule[i] == 0) flag = 1; int flagall; MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall && comm->me == 0) error->all(FLERR, "All mol IDs should be set for fix gcmc group atoms"); } if (exchmode == EXCHMOL || movemode == MOVEMOL) if (atom->molecule_flag == 0 || !atom->tag_enable || (atom->map_style == Atom::MAP_NONE)) error->all(FLERR, "Fix gcmc molecule command requires that " "atoms have molecule attributes"); // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix gcmc rigid fix does not exist"); fixrigid = modify->fix[ifix]; int tmp; if (&onemols[imol] != (Molecule **) fixrigid->extract("onemol",tmp)) error->all(FLERR, "Fix gcmc and fix rigid/small not using " "same molecule template ID"); } // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix gcmc shake fix does not exist"); fixshake = modify->fix[ifix]; int tmp; if (&onemols[imol] != (Molecule **) fixshake->extract("onemol",tmp)) error->all(FLERR,"Fix gcmc and fix shake not using " "same molecule template ID"); } if (domain->dimension == 2) error->all(FLERR,"Cannot use fix gcmc in a 2d simulation"); // create a new group for interaction exclusions // used for attempted atom or molecule deletions // skip if already exists from previous init() if (full_flag && !exclusion_group_bit) { // create unique group name for atoms to be excluded auto group_id = std::string("FixGCMC:gcmc_exclusion_group:") + id; group->assign(group_id + " subtract all all"); exclusion_group = group->find(group_id); if (exclusion_group == -1) error->all(FLERR,"Could not find fix gcmc exclusion group ID"); exclusion_group_bit = group->bitmask[exclusion_group]; // neighbor list exclusion setup // turn off interactions between group all and the exclusion group neighbor->modify_params(fmt::format("exclude group {} all",group_id)); } // create a new group for temporary use with selected molecules if (exchmode == EXCHMOL || movemode == MOVEMOL) { // create unique group name for atoms to be rotated auto group_id = std::string("FixGCMC:rotation_gas_atoms:") + id; group->assign(group_id + " molecule -1"); molecule_group = group->find(group_id); if (molecule_group == -1) error->all(FLERR,"Could not find fix gcmc rotation group ID"); molecule_group_bit = group->bitmask[molecule_group]; molecule_group_inversebit = molecule_group_bit ^ ~0; } // get all of the needed molecule data if exchanging // or moving molecules, otherwise just get the gas mass if (exchmode == EXCHMOL || movemode == MOVEMOL) { onemols[imol]->compute_mass(); onemols[imol]->compute_com(); gas_mass = onemols[imol]->masstotal; for (int i = 0; i < onemols[imol]->natoms; i++) { onemols[imol]->x[i][0] -= onemols[imol]->com[0]; onemols[imol]->x[i][1] -= onemols[imol]->com[1]; onemols[imol]->x[i][2] -= onemols[imol]->com[2]; } onemols[imol]->com[0] = 0; onemols[imol]->com[1] = 0; onemols[imol]->com[2] = 0; } else gas_mass = atom->mass[ngcmc_type]; if (gas_mass <= 0.0) error->all(FLERR,"Illegal fix gcmc gas mass <= 0"); // check that no deletable atoms are in atom->firstgroup // deleting such an atom would not leave firstgroup atoms first if (atom->firstgroup >= 0) { int *mask = atom->mask; int firstgroupbit = group->bitmask[atom->firstgroup]; int flag = 0; for (int i = 0; i < atom->nlocal; i++) if ((mask[i] == groupbit) && (mask[i] && firstgroupbit)) flag = 1; int flagall; MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall) error->all(FLERR,"Cannot do GCMC on atoms in atom_modify first group"); } // compute beta, lambda, sigma, and the zz factor // For LJ units, lambda=1 beta = 1.0/(force->boltz*reservoir_temperature); if (strcmp(update->unit_style,"lj") == 0) zz = exp(beta*chemical_potential); else { double lambda = sqrt(force->hplanck*force->hplanck/ (2.0*MY_PI*gas_mass*force->mvv2e* force->boltz*reservoir_temperature)); zz = exp(beta*chemical_potential)/(pow(lambda,3.0)); } sigma = sqrt(force->boltz*reservoir_temperature*tfac_insert/gas_mass/force->mvv2e); if (pressure_flag) zz = pressure*fugacity_coeff*beta/force->nktv2p; imagezero = ((imageint) IMGMAX << IMG2BITS) | ((imageint) IMGMAX << IMGBITS) | IMGMAX; // warning if group id is "all" if ((comm->me == 0) && (groupbit & 1)) error->warning(FLERR, "Fix gcmc is being applied " "to the default group all"); // construct group bitmask for all new atoms // aggregated over all group keywords groupbitall = 1 | groupbit; for (int igroup = 0; igroup < ngroups; igroup++) { int jgroup = group->find(groupstrings[igroup]); if (jgroup == -1) error->all(FLERR,"Could not find specified fix gcmc group ID"); groupbitall |= group->bitmask[jgroup]; } // construct group type bitmasks // not aggregated over all group keywords if (ngrouptypes > 0) { memory->create(grouptypebits,ngrouptypes,"fix_gcmc:grouptypebits"); for (int igroup = 0; igroup < ngrouptypes; igroup++) { int jgroup = group->find(grouptypestrings[igroup]); if (jgroup == -1) error->all(FLERR,"Could not find specified fix gcmc group ID"); grouptypebits[igroup] = group->bitmask[jgroup]; } } // Current implementation is broken using // full_flag on molecules on more than one processor. // Print error if this is the current mode if (full_flag && (exchmode == EXCHMOL || movemode == MOVEMOL) && comm->nprocs > 1) error->all(FLERR,"fix gcmc does currently not support full_energy option with molecules on more than 1 MPI process."); } /* ---------------------------------------------------------------------- attempt Monte Carlo translations, rotations, insertions, and deletions done before exchange, borders, reneighbor so that ghost atoms and neighbor lists will be correct ------------------------------------------------------------------------- */ void FixGCMC::pre_exchange() { // just return if should not be called on this timestep if (next_reneighbor != update->ntimestep) return; xlo = domain->boxlo[0]; xhi = domain->boxhi[0]; ylo = domain->boxlo[1]; yhi = domain->boxhi[1]; zlo = domain->boxlo[2]; zhi = domain->boxhi[2]; if (triclinic) { sublo = domain->sublo_lamda; subhi = domain->subhi_lamda; } else { sublo = domain->sublo; subhi = domain->subhi; } if (regionflag) volume = region_volume; else volume = domain->xprd * domain->yprd * domain->zprd; if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); comm->exchange(); atom->nghost = 0; comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); if (full_flag) { energy_stored = energy_full(); if (overlap_flag && energy_stored > MAXENERGYTEST) error->warning(FLERR,"Energy of old configuration in " "fix gcmc is > MAXENERGYTEST."); for (int i = 0; i < ncycles; i++) { int ixm = static_cast<int>(random_equal->uniform()*ncycles) + 1; if (ixm <= nmcmoves) { double xmcmove = random_equal->uniform(); if (xmcmove < patomtrans) attempt_atomic_translation_full(); else if (xmcmove < patomtrans+pmoltrans) attempt_molecule_translation_full(); else attempt_molecule_rotation_full(); } else { double xgcmc = random_equal->uniform(); if (exchmode == EXCHATOM) { if (xgcmc < 0.5) attempt_atomic_deletion_full(); else attempt_atomic_insertion_full(); } else { if (xgcmc < 0.5) attempt_molecule_deletion_full(); else attempt_molecule_insertion_full(); } } } if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); comm->exchange(); atom->nghost = 0; comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); } else { for (int i = 0; i < ncycles; i++) { int ixm = static_cast<int>(random_equal->uniform()*ncycles) + 1; if (ixm <= nmcmoves) { double xmcmove = random_equal->uniform(); if (xmcmove < patomtrans) attempt_atomic_translation(); else if (xmcmove < patomtrans+pmoltrans) attempt_molecule_translation(); else attempt_molecule_rotation(); } else { double xgcmc = random_equal->uniform(); if (exchmode == EXCHATOM) { if (xgcmc < 0.5) attempt_atomic_deletion(); else attempt_atomic_insertion(); } else { if (xgcmc < 0.5) attempt_molecule_deletion(); else attempt_molecule_insertion(); } } } } next_reneighbor = update->ntimestep + nevery; } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_atomic_translation() { ntranslation_attempts += 1.0; if (ngas == 0) return; int i = pick_random_gas_atom(); int success = 0; if (i >= 0) { double **x = atom->x; double energy_before = energy(i,ngcmc_type,-1,x[i]); if (overlap_flag && energy_before > MAXENERGYTEST) error->warning(FLERR,"Energy of old configuration in " "fix gcmc is > MAXENERGYTEST."); double rsq = 1.1; double rx,ry,rz; rx = ry = rz = 0.0; double coord[3]; while (rsq > 1.0) { rx = 2*random_unequal->uniform() - 1.0; ry = 2*random_unequal->uniform() - 1.0; rz = 2*random_unequal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } coord[0] = x[i][0] + displace*rx; coord[1] = x[i][1] + displace*ry; coord[2] = x[i][2] + displace*rz; if (regionflag) { while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) { rsq = 1.1; while (rsq > 1.0) { rx = 2*random_unequal->uniform() - 1.0; ry = 2*random_unequal->uniform() - 1.0; rz = 2*random_unequal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } coord[0] = x[i][0] + displace*rx; coord[1] = x[i][1] + displace*ry; coord[2] = x[i][2] + displace*rz; } } if (!domain->inside_nonperiodic(coord)) error->one(FLERR,"Fix gcmc put atom outside box"); double energy_after = energy(i,ngcmc_type,-1,coord); if (energy_after < MAXENERGYTEST && random_unequal->uniform() < exp(beta*(energy_before - energy_after))) { x[i][0] = coord[0]; x[i][1] = coord[1]; x[i][2] = coord[2]; success = 1; } } int success_all = 0; MPI_Allreduce(&success,&success_all,1,MPI_INT,MPI_MAX,world); if (success_all) { if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); comm->exchange(); atom->nghost = 0; comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ntranslation_successes += 1.0; } } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_atomic_deletion() { ndeletion_attempts += 1.0; if (ngas == 0 || ngas <= min_ngas) return; int i = pick_random_gas_atom(); int success = 0; if (i >= 0) { double deletion_energy = energy(i,ngcmc_type,-1,atom->x[i]); if (random_unequal->uniform() < ngas*exp(beta*deletion_energy)/(zz*volume)) { atom->avec->copy(atom->nlocal-1,i,1); atom->nlocal--; success = 1; } } int success_all = 0; MPI_Allreduce(&success,&success_all,1,MPI_INT,MPI_MAX,world); if (success_all) { atom->natoms--; if (atom->tag_enable) { if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ndeletion_successes += 1.0; } } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_atomic_insertion() { double lamda[3]; ninsertion_attempts += 1.0; if (ngas >= max_ngas) return; // pick coordinates for insertion point double coord[3]; if (regionflag) { int region_attempt = 0; coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) { coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); region_attempt++; if (region_attempt >= max_region_attempts) return; } if (triclinic) domain->x2lamda(coord,lamda); } else { if (triclinic == 0) { coord[0] = xlo + random_equal->uniform() * (xhi-xlo); coord[1] = ylo + random_equal->uniform() * (yhi-ylo); coord[2] = zlo + random_equal->uniform() * (zhi-zlo); } else { lamda[0] = random_equal->uniform(); lamda[1] = random_equal->uniform(); lamda[2] = random_equal->uniform(); // wasteful, but necessary if (lamda[0] == 1.0) lamda[0] = 0.0; if (lamda[1] == 1.0) lamda[1] = 0.0; if (lamda[2] == 1.0) lamda[2] = 0.0; domain->lamda2x(lamda,coord); } } int proc_flag = 0; if (triclinic == 0) { domain->remap(coord); if (!domain->inside(coord)) error->one(FLERR,"Fix gcmc put atom outside box"); if (coord[0] >= sublo[0] && coord[0] < subhi[0] && coord[1] >= sublo[1] && coord[1] < subhi[1] && coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1; } else { if (lamda[0] >= sublo[0] && lamda[0] < subhi[0] && lamda[1] >= sublo[1] && lamda[1] < subhi[1] && lamda[2] >= sublo[2] && lamda[2] < subhi[2]) proc_flag = 1; } int success = 0; if (proc_flag) { int ii = -1; if (charge_flag) { ii = atom->nlocal + atom->nghost; if (ii >= atom->nmax) atom->avec->grow(0); atom->q[ii] = charge; } double insertion_energy = energy(ii,ngcmc_type,-1,coord); if (insertion_energy < MAXENERGYTEST && random_unequal->uniform() < zz*volume*exp(-beta*insertion_energy)/(ngas+1)) { atom->avec->create_atom(ngcmc_type,coord); int m = atom->nlocal - 1; // add to groups // optionally add to type-based groups atom->mask[m] = groupbitall; for (int igroup = 0; igroup < ngrouptypes; igroup++) { if (ngcmc_type == grouptypes[igroup]) atom->mask[m] |= grouptypebits[igroup]; } atom->v[m][0] = random_unequal->gaussian()*sigma; atom->v[m][1] = random_unequal->gaussian()*sigma; atom->v[m][2] = random_unequal->gaussian()*sigma; modify->create_attribute(m); success = 1; } } int success_all = 0; MPI_Allreduce(&success,&success_all,1,MPI_INT,MPI_MAX,world); if (success_all) { atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ninsertion_successes += 1.0; } } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_translation() { ntranslation_attempts += 1.0; if (ngas == 0) return; tagint translation_molecule = pick_random_gas_molecule(); if (translation_molecule == -1) return; double energy_before_sum = molecule_energy(translation_molecule); if (overlap_flag && energy_before_sum > MAXENERGYTEST) error->warning(FLERR,"Energy of old configuration in " "fix gcmc is > MAXENERGYTEST."); double **x = atom->x; double rx,ry,rz; double com_displace[3],coord[3]; double rsq = 1.1; while (rsq > 1.0) { rx = 2*random_equal->uniform() - 1.0; ry = 2*random_equal->uniform() - 1.0; rz = 2*random_equal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } com_displace[0] = displace*rx; com_displace[1] = displace*ry; com_displace[2] = displace*rz; if (regionflag) { int *mask = atom->mask; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == translation_molecule) { mask[i] |= molecule_group_bit; } else { mask[i] &= molecule_group_inversebit; } } double com[3]; com[0] = com[1] = com[2] = 0.0; group->xcm(molecule_group,gas_mass,com); coord[0] = com[0] + displace*rx; coord[1] = com[1] + displace*ry; coord[2] = com[2] + displace*rz; while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) { rsq = 1.1; while (rsq > 1.0) { rx = 2*random_equal->uniform() - 1.0; ry = 2*random_equal->uniform() - 1.0; rz = 2*random_equal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } coord[0] = com[0] + displace*rx; coord[1] = com[1] + displace*ry; coord[2] = com[2] + displace*rz; } com_displace[0] = displace*rx; com_displace[1] = displace*ry; com_displace[2] = displace*rz; } double energy_after = 0.0; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == translation_molecule) { coord[0] = x[i][0] + com_displace[0]; coord[1] = x[i][1] + com_displace[1]; coord[2] = x[i][2] + com_displace[2]; if (!domain->inside_nonperiodic(coord)) error->one(FLERR,"Fix gcmc put atom outside box"); energy_after += energy(i,atom->type[i],translation_molecule,coord); } } double energy_after_sum = 0.0; MPI_Allreduce(&energy_after,&energy_after_sum,1,MPI_DOUBLE,MPI_SUM,world); if (energy_after_sum < MAXENERGYTEST && random_equal->uniform() < exp(beta*(energy_before_sum - energy_after_sum))) { for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == translation_molecule) { x[i][0] += com_displace[0]; x[i][1] += com_displace[1]; x[i][2] += com_displace[2]; } } if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); comm->exchange(); atom->nghost = 0; comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ntranslation_successes += 1.0; } } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_rotation() { nrotation_attempts += 1.0; if (ngas == 0) return; tagint rotation_molecule = pick_random_gas_molecule(); if (rotation_molecule == -1) return; double energy_before_sum = molecule_energy(rotation_molecule); if (overlap_flag && energy_before_sum > MAXENERGYTEST) error->warning(FLERR,"Energy of old configuration in " "fix gcmc is > MAXENERGYTEST."); int *mask = atom->mask; int nmolcoords = 0; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == rotation_molecule) { mask[i] |= molecule_group_bit; nmolcoords++; } else { mask[i] &= molecule_group_inversebit; } } if (nmolcoords > nmaxmolatoms) grow_molecule_arrays(nmolcoords); double com[3]; com[0] = com[1] = com[2] = 0.0; group->xcm(molecule_group,gas_mass,com); // generate point in unit cube // then restrict to unit sphere double r[3],rotmat[3][3],quat[4]; double rsq = 1.1; while (rsq > 1.0) { r[0] = 2.0*random_equal->uniform() - 1.0; r[1] = 2.0*random_equal->uniform() - 1.0; r[2] = 2.0*random_equal->uniform() - 1.0; rsq = MathExtra::dot3(r, r); } double theta = random_equal->uniform() * max_rotation_angle; MathExtra::norm3(r); MathExtra::axisangle_to_quat(r,theta,quat); MathExtra::quat_to_mat(quat,rotmat); double **x = atom->x; imageint *image = atom->image; double energy_after = 0.0; int n = 0; for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & molecule_group_bit) { double xtmp[3]; domain->unmap(x[i],image[i],xtmp); xtmp[0] -= com[0]; xtmp[1] -= com[1]; xtmp[2] -= com[2]; MathExtra::matvec(rotmat,xtmp,molcoords[n]); molcoords[n][0] += com[0]; molcoords[n][1] += com[1]; molcoords[n][2] += com[2]; xtmp[0] = molcoords[n][0]; xtmp[1] = molcoords[n][1]; xtmp[2] = molcoords[n][2]; domain->remap(xtmp); if (!domain->inside(xtmp)) error->one(FLERR,"Fix gcmc put atom outside box"); energy_after += energy(i,atom->type[i],rotation_molecule,xtmp); n++; } } double energy_after_sum = 0.0; MPI_Allreduce(&energy_after,&energy_after_sum,1,MPI_DOUBLE,MPI_SUM,world); if (energy_after_sum < MAXENERGYTEST && random_equal->uniform() < exp(beta*(energy_before_sum - energy_after_sum))) { int n = 0; for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & molecule_group_bit) { image[i] = imagezero; x[i][0] = molcoords[n][0]; x[i][1] = molcoords[n][1]; x[i][2] = molcoords[n][2]; domain->remap(x[i],image[i]); n++; } } if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); comm->exchange(); atom->nghost = 0; comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); nrotation_successes += 1.0; } } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_deletion() { ndeletion_attempts += 1.0; if (ngas == 0 || ngas <= min_ngas) return; // work-around to avoid n=0 problem with fix rigid/nvt/small if (ngas == natoms_per_molecule) return; tagint deletion_molecule = pick_random_gas_molecule(); if (deletion_molecule == -1) return; double deletion_energy_sum = molecule_energy(deletion_molecule); if (random_equal->uniform() < ngas*exp(beta*deletion_energy_sum)/(zz*volume*natoms_per_molecule)) { int i = 0; while (i < atom->nlocal) { if (atom->molecule[i] == deletion_molecule) { atom->avec->copy(atom->nlocal-1,i,1); atom->nlocal--; } else i++; } atom->natoms -= natoms_per_molecule; if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ndeletion_successes += 1.0; } } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_insertion() { double lamda[3]; ninsertion_attempts += 1.0; if (ngas >= max_ngas) return; double com_coord[3]; if (regionflag) { int region_attempt = 0; com_coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); com_coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); com_coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); while (domain->regions[iregion]->match(com_coord[0],com_coord[1], com_coord[2]) == 0) { com_coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); com_coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); com_coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); region_attempt++; if (region_attempt >= max_region_attempts) return; } if (triclinic) domain->x2lamda(com_coord,lamda); } else { if (triclinic == 0) { com_coord[0] = xlo + random_equal->uniform() * (xhi-xlo); com_coord[1] = ylo + random_equal->uniform() * (yhi-ylo); com_coord[2] = zlo + random_equal->uniform() * (zhi-zlo); } else { lamda[0] = random_equal->uniform(); lamda[1] = random_equal->uniform(); lamda[2] = random_equal->uniform(); // wasteful, but necessary if (lamda[0] == 1.0) lamda[0] = 0.0; if (lamda[1] == 1.0) lamda[1] = 0.0; if (lamda[2] == 1.0) lamda[2] = 0.0; domain->lamda2x(lamda,com_coord); } } // generate point in unit cube // then restrict to unit sphere double r[3],rotmat[3][3],quat[4]; double rsq = 1.1; while (rsq > 1.0) { r[0] = 2.0*random_equal->uniform() - 1.0; r[1] = 2.0*random_equal->uniform() - 1.0; r[2] = 2.0*random_equal->uniform() - 1.0; rsq = MathExtra::dot3(r, r); } double theta = random_equal->uniform() * MY_2PI; MathExtra::norm3(r); MathExtra::axisangle_to_quat(r,theta,quat); MathExtra::quat_to_mat(quat,rotmat); double insertion_energy = 0.0; bool *procflag = new bool[natoms_per_molecule]; for (int i = 0; i < natoms_per_molecule; i++) { MathExtra::matvec(rotmat,onemols[imol]->x[i],molcoords[i]); molcoords[i][0] += com_coord[0]; molcoords[i][1] += com_coord[1]; molcoords[i][2] += com_coord[2]; // use temporary variable for remapped position // so unmapped position is preserved in molcoords double xtmp[3]; xtmp[0] = molcoords[i][0]; xtmp[1] = molcoords[i][1]; xtmp[2] = molcoords[i][2]; domain->remap(xtmp); if (!domain->inside(xtmp)) error->one(FLERR,"Fix gcmc put atom outside box"); procflag[i] = false; if (triclinic == 0) { if (xtmp[0] >= sublo[0] && xtmp[0] < subhi[0] && xtmp[1] >= sublo[1] && xtmp[1] < subhi[1] && xtmp[2] >= sublo[2] && xtmp[2] < subhi[2]) procflag[i] = true; } else { domain->x2lamda(xtmp,lamda); if (lamda[0] >= sublo[0] && lamda[0] < subhi[0] && lamda[1] >= sublo[1] && lamda[1] < subhi[1] && lamda[2] >= sublo[2] && lamda[2] < subhi[2]) procflag[i] = true; } if (procflag[i]) { int ii = -1; if (onemols[imol]->qflag == 1) { ii = atom->nlocal + atom->nghost; if (ii >= atom->nmax) atom->avec->grow(0); atom->q[ii] = onemols[imol]->q[i]; } insertion_energy += energy(ii,onemols[imol]->type[i],-1,xtmp); } } double insertion_energy_sum = 0.0; MPI_Allreduce(&insertion_energy,&insertion_energy_sum,1, MPI_DOUBLE,MPI_SUM,world); if (insertion_energy_sum < MAXENERGYTEST && random_equal->uniform() < zz*volume*natoms_per_molecule* exp(-beta*insertion_energy_sum)/(ngas + natoms_per_molecule)) { tagint maxmol = 0; for (int i = 0; i < atom->nlocal; i++) maxmol = MAX(maxmol,atom->molecule[i]); tagint maxmol_all; MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); maxmol_all++; if (maxmol_all >= MAXTAGINT) error->all(FLERR,"Fix gcmc ran out of available molecule IDs"); tagint maxtag = 0; for (int i = 0; i < atom->nlocal; i++) maxtag = MAX(maxtag,atom->tag[i]); tagint maxtag_all; MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world); int nlocalprev = atom->nlocal; double vnew[3]; vnew[0] = random_equal->gaussian()*sigma; vnew[1] = random_equal->gaussian()*sigma; vnew[2] = random_equal->gaussian()*sigma; for (int i = 0; i < natoms_per_molecule; i++) { if (procflag[i]) { atom->avec->create_atom(onemols[imol]->type[i],molcoords[i]); int m = atom->nlocal - 1; // add to groups // optionally add to type-based groups atom->mask[m] = groupbitall; for (int igroup = 0; igroup < ngrouptypes; igroup++) { if (ngcmc_type == grouptypes[igroup]) atom->mask[m] |= grouptypebits[igroup]; } atom->image[m] = imagezero; domain->remap(atom->x[m],atom->image[m]); atom->molecule[m] = maxmol_all; if (maxtag_all+i+1 >= MAXTAGINT) error->all(FLERR,"Fix gcmc ran out of available atom IDs"); atom->tag[m] = maxtag_all + i + 1; atom->v[m][0] = vnew[0]; atom->v[m][1] = vnew[1]; atom->v[m][2] = vnew[2]; atom->add_molecule_atom(onemols[imol],i,m,maxtag_all); modify->create_attribute(m); } } // FixRigidSmall::set_molecule stores rigid body attributes // FixShake::set_molecule stores shake info for molecule for (int submol = 0; submol < nmol; ++submol) { if (rigidflag) fixrigid->set_molecule(nlocalprev,maxtag_all,submol,com_coord,vnew,quat); else if (shakeflag) fixshake->set_molecule(nlocalprev,maxtag_all,submol,com_coord,vnew,quat); } atom->natoms += natoms_per_molecule; if (atom->natoms < 0) error->all(FLERR,"Too many total atoms"); atom->nbonds += onemols[imol]->nbonds; atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ninsertion_successes += 1.0; } delete[] procflag; } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_atomic_translation_full() { ntranslation_attempts += 1.0; if (ngas == 0) return; double energy_before = energy_stored; int i = pick_random_gas_atom(); double **x = atom->x; double xtmp[3]; xtmp[0] = xtmp[1] = xtmp[2] = 0.0; tagint tmptag = -1; if (i >= 0) { double rsq = 1.1; double rx,ry,rz; rx = ry = rz = 0.0; double coord[3]; while (rsq > 1.0) { rx = 2*random_unequal->uniform() - 1.0; ry = 2*random_unequal->uniform() - 1.0; rz = 2*random_unequal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } coord[0] = x[i][0] + displace*rx; coord[1] = x[i][1] + displace*ry; coord[2] = x[i][2] + displace*rz; if (regionflag) { while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) { rsq = 1.1; while (rsq > 1.0) { rx = 2*random_unequal->uniform() - 1.0; ry = 2*random_unequal->uniform() - 1.0; rz = 2*random_unequal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } coord[0] = x[i][0] + displace*rx; coord[1] = x[i][1] + displace*ry; coord[2] = x[i][2] + displace*rz; } } if (!domain->inside_nonperiodic(coord)) error->one(FLERR,"Fix gcmc put atom outside box"); xtmp[0] = x[i][0]; xtmp[1] = x[i][1]; xtmp[2] = x[i][2]; x[i][0] = coord[0]; x[i][1] = coord[1]; x[i][2] = coord[2]; tmptag = atom->tag[i]; } double energy_after = energy_full(); if (energy_after < MAXENERGYTEST && random_equal->uniform() < exp(beta*(energy_before - energy_after))) { energy_stored = energy_after; ntranslation_successes += 1.0; } else { tagint tmptag_all; MPI_Allreduce(&tmptag,&tmptag_all,1,MPI_LMP_TAGINT,MPI_MAX,world); double xtmp_all[3]; MPI_Allreduce(&xtmp,&xtmp_all,3,MPI_DOUBLE,MPI_SUM,world); for (int i = 0; i < atom->nlocal; i++) { if (tmptag_all == atom->tag[i]) { x[i][0] = xtmp_all[0]; x[i][1] = xtmp_all[1]; x[i][2] = xtmp_all[2]; } } energy_stored = energy_before; } update_gas_atoms_list(); } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_atomic_deletion_full() { double q_tmp; const int q_flag = atom->q_flag; ndeletion_attempts += 1.0; if (ngas == 0 || ngas <= min_ngas) return; double energy_before = energy_stored; const int i = pick_random_gas_atom(); int tmpmask; if (i >= 0) { tmpmask = atom->mask[i]; atom->mask[i] = exclusion_group_bit; if (q_flag) { q_tmp = atom->q[i]; atom->q[i] = 0.0; } } if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); double energy_after = energy_full(); if (random_equal->uniform() < ngas*exp(beta*(energy_before - energy_after))/(zz*volume)) { if (i >= 0) { atom->avec->copy(atom->nlocal-1,i,1); atom->nlocal--; } atom->natoms--; if (atom->map_style != Atom::MAP_NONE) atom->map_init(); ndeletion_successes += 1.0; energy_stored = energy_after; } else { if (i >= 0) { atom->mask[i] = tmpmask; if (q_flag) atom->q[i] = q_tmp; } if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); energy_stored = energy_before; } update_gas_atoms_list(); } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_atomic_insertion_full() { double lamda[3]; ninsertion_attempts += 1.0; if (ngas >= max_ngas) return; double energy_before = energy_stored; double coord[3]; if (regionflag) { int region_attempt = 0; coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) { coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); region_attempt++; if (region_attempt >= max_region_attempts) return; } if (triclinic) domain->x2lamda(coord,lamda); } else { if (triclinic == 0) { coord[0] = xlo + random_equal->uniform() * (xhi-xlo); coord[1] = ylo + random_equal->uniform() * (yhi-ylo); coord[2] = zlo + random_equal->uniform() * (zhi-zlo); } else { lamda[0] = random_equal->uniform(); lamda[1] = random_equal->uniform(); lamda[2] = random_equal->uniform(); // wasteful, but necessary if (lamda[0] == 1.0) lamda[0] = 0.0; if (lamda[1] == 1.0) lamda[1] = 0.0; if (lamda[2] == 1.0) lamda[2] = 0.0; domain->lamda2x(lamda,coord); } } int proc_flag = 0; if (triclinic == 0) { domain->remap(coord); if (!domain->inside(coord)) error->one(FLERR,"Fix gcmc put atom outside box"); if (coord[0] >= sublo[0] && coord[0] < subhi[0] && coord[1] >= sublo[1] && coord[1] < subhi[1] && coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1; } else { if (lamda[0] >= sublo[0] && lamda[0] < subhi[0] && lamda[1] >= sublo[1] && lamda[1] < subhi[1] && lamda[2] >= sublo[2] && lamda[2] < subhi[2]) proc_flag = 1; } if (proc_flag) { atom->avec->create_atom(ngcmc_type,coord); int m = atom->nlocal - 1; // add to groups // optionally add to type-based groups atom->mask[m] = groupbitall; for (int igroup = 0; igroup < ngrouptypes; igroup++) { if (ngcmc_type == grouptypes[igroup]) atom->mask[m] |= grouptypebits[igroup]; } atom->v[m][0] = random_unequal->gaussian()*sigma; atom->v[m][1] = random_unequal->gaussian()*sigma; atom->v[m][2] = random_unequal->gaussian()*sigma; if (charge_flag) atom->q[m] = charge; modify->create_attribute(m); } atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); double energy_after = energy_full(); if (energy_after < MAXENERGYTEST && random_equal->uniform() < zz*volume*exp(beta*(energy_before - energy_after))/(ngas+1)) { ninsertion_successes += 1.0; energy_stored = energy_after; } else { atom->natoms--; if (proc_flag) atom->nlocal--; if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); energy_stored = energy_before; } update_gas_atoms_list(); } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_translation_full() { ntranslation_attempts += 1.0; if (ngas == 0) return; tagint translation_molecule = pick_random_gas_molecule(); if (translation_molecule == -1) return; double energy_before = energy_stored; double **x = atom->x; double rx,ry,rz; double com_displace[3],coord[3]; double rsq = 1.1; while (rsq > 1.0) { rx = 2*random_equal->uniform() - 1.0; ry = 2*random_equal->uniform() - 1.0; rz = 2*random_equal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } com_displace[0] = displace*rx; com_displace[1] = displace*ry; com_displace[2] = displace*rz; if (regionflag) { int *mask = atom->mask; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == translation_molecule) { mask[i] |= molecule_group_bit; } else { mask[i] &= molecule_group_inversebit; } } double com[3]; com[0] = com[1] = com[2] = 0.0; group->xcm(molecule_group,gas_mass,com); coord[0] = com[0] + displace*rx; coord[1] = com[1] + displace*ry; coord[2] = com[2] + displace*rz; while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) { rsq = 1.1; while (rsq > 1.0) { rx = 2*random_equal->uniform() - 1.0; ry = 2*random_equal->uniform() - 1.0; rz = 2*random_equal->uniform() - 1.0; rsq = rx*rx + ry*ry + rz*rz; } coord[0] = com[0] + displace*rx; coord[1] = com[1] + displace*ry; coord[2] = com[2] + displace*rz; } com_displace[0] = displace*rx; com_displace[1] = displace*ry; com_displace[2] = displace*rz; } for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == translation_molecule) { x[i][0] += com_displace[0]; x[i][1] += com_displace[1]; x[i][2] += com_displace[2]; if (!domain->inside_nonperiodic(x[i])) error->one(FLERR,"Fix gcmc put atom outside box"); } } double energy_after = energy_full(); if (energy_after < MAXENERGYTEST && random_equal->uniform() < exp(beta*(energy_before - energy_after))) { ntranslation_successes += 1.0; energy_stored = energy_after; } else { energy_stored = energy_before; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == translation_molecule) { x[i][0] -= com_displace[0]; x[i][1] -= com_displace[1]; x[i][2] -= com_displace[2]; } } } update_gas_atoms_list(); } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_rotation_full() { nrotation_attempts += 1.0; if (ngas == 0) return; tagint rotation_molecule = pick_random_gas_molecule(); if (rotation_molecule == -1) return; double energy_before = energy_stored; int *mask = atom->mask; int nmolcoords = 0; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == rotation_molecule) { mask[i] |= molecule_group_bit; nmolcoords++; } else { mask[i] &= molecule_group_inversebit; } } if (nmolcoords > nmaxmolatoms) grow_molecule_arrays(nmolcoords); double com[3]; com[0] = com[1] = com[2] = 0.0; group->xcm(molecule_group,gas_mass,com); // generate point in unit cube // then restrict to unit sphere double r[3],rotmat[3][3],quat[4]; double rsq = 1.1; while (rsq > 1.0) { r[0] = 2.0*random_equal->uniform() - 1.0; r[1] = 2.0*random_equal->uniform() - 1.0; r[2] = 2.0*random_equal->uniform() - 1.0; rsq = MathExtra::dot3(r, r); } double theta = random_equal->uniform() * max_rotation_angle; MathExtra::norm3(r); MathExtra::axisangle_to_quat(r,theta,quat); MathExtra::quat_to_mat(quat,rotmat); double **x = atom->x; imageint *image = atom->image; int n = 0; for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & molecule_group_bit) { molcoords[n][0] = x[i][0]; molcoords[n][1] = x[i][1]; molcoords[n][2] = x[i][2]; molimage[n] = image[i]; double xtmp[3]; domain->unmap(x[i],image[i],xtmp); xtmp[0] -= com[0]; xtmp[1] -= com[1]; xtmp[2] -= com[2]; MathExtra::matvec(rotmat,xtmp,x[i]); x[i][0] += com[0]; x[i][1] += com[1]; x[i][2] += com[2]; image[i] = imagezero; domain->remap(x[i],image[i]); if (!domain->inside(x[i])) error->one(FLERR,"Fix gcmc put atom outside box"); n++; } } double energy_after = energy_full(); if (energy_after < MAXENERGYTEST && random_equal->uniform() < exp(beta*(energy_before - energy_after))) { nrotation_successes += 1.0; energy_stored = energy_after; } else { energy_stored = energy_before; int n = 0; for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & molecule_group_bit) { x[i][0] = molcoords[n][0]; x[i][1] = molcoords[n][1]; x[i][2] = molcoords[n][2]; image[i] = molimage[n]; n++; } } } update_gas_atoms_list(); } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_deletion_full() { ndeletion_attempts += 1.0; if (ngas == 0 || ngas <= min_ngas) return; // work-around to avoid n=0 problem with fix rigid/nvt/small if (ngas == natoms_per_molecule) return; tagint deletion_molecule = pick_random_gas_molecule(); if (deletion_molecule == -1) return; double energy_before = energy_stored; // check nmolq, grow arrays if necessary int nmolq = 0; for (int i = 0; i < atom->nlocal; i++) if (atom->molecule[i] == deletion_molecule) if (atom->q_flag) nmolq++; if (nmolq > nmaxmolatoms) grow_molecule_arrays(nmolq); int m = 0; int *tmpmask = new int[atom->nlocal]; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == deletion_molecule) { tmpmask[i] = atom->mask[i]; atom->mask[i] = exclusion_group_bit; toggle_intramolecular(i); if (atom->q_flag) { molq[m] = atom->q[i]; m++; atom->q[i] = 0.0; } } } if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); double energy_after = energy_full(); // energy_before corrected by energy_intra double deltaphi = ngas*exp(beta*((energy_before - energy_intra) - energy_after))/(zz*volume*natoms_per_molecule); if (random_equal->uniform() < deltaphi) { int i = 0; while (i < atom->nlocal) { if (atom->molecule[i] == deletion_molecule) { atom->avec->copy(atom->nlocal-1,i,1); atom->nlocal--; } else i++; } atom->natoms -= natoms_per_molecule; if (atom->map_style != Atom::MAP_NONE) atom->map_init(); ndeletion_successes += 1.0; energy_stored = energy_after; } else { energy_stored = energy_before; int m = 0; for (int i = 0; i < atom->nlocal; i++) { if (atom->molecule[i] == deletion_molecule) { atom->mask[i] = tmpmask[i]; toggle_intramolecular(i); if (atom->q_flag) { atom->q[i] = molq[m]; m++; } } } if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); } update_gas_atoms_list(); delete[] tmpmask; } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::attempt_molecule_insertion_full() { double lamda[3]; ninsertion_attempts += 1.0; if (ngas >= max_ngas) return; double energy_before = energy_stored; tagint maxmol = 0; for (int i = 0; i < atom->nlocal; i++) maxmol = MAX(maxmol,atom->molecule[i]); tagint maxmol_all; MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); maxmol_all++; if (maxmol_all >= MAXTAGINT) error->all(FLERR,"Fix gcmc ran out of available molecule IDs"); int insertion_molecule = maxmol_all; tagint maxtag = 0; for (int i = 0; i < atom->nlocal; i++) maxtag = MAX(maxtag,atom->tag[i]); tagint maxtag_all; MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world); int nlocalprev = atom->nlocal; double com_coord[3]; if (regionflag) { int region_attempt = 0; com_coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); com_coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); com_coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); while (domain->regions[iregion]->match(com_coord[0],com_coord[1], com_coord[2]) == 0) { com_coord[0] = region_xlo + random_equal->uniform() * (region_xhi-region_xlo); com_coord[1] = region_ylo + random_equal->uniform() * (region_yhi-region_ylo); com_coord[2] = region_zlo + random_equal->uniform() * (region_zhi-region_zlo); region_attempt++; if (region_attempt >= max_region_attempts) return; } if (triclinic) domain->x2lamda(com_coord,lamda); } else { if (triclinic == 0) { com_coord[0] = xlo + random_equal->uniform() * (xhi-xlo); com_coord[1] = ylo + random_equal->uniform() * (yhi-ylo); com_coord[2] = zlo + random_equal->uniform() * (zhi-zlo); } else { lamda[0] = random_equal->uniform(); lamda[1] = random_equal->uniform(); lamda[2] = random_equal->uniform(); // wasteful, but necessary if (lamda[0] == 1.0) lamda[0] = 0.0; if (lamda[1] == 1.0) lamda[1] = 0.0; if (lamda[2] == 1.0) lamda[2] = 0.0; domain->lamda2x(lamda,com_coord); } } // generate point in unit cube // then restrict to unit sphere double r[3],rotmat[3][3],quat[4]; double rsq = 1.1; while (rsq > 1.0) { r[0] = 2.0*random_equal->uniform() - 1.0; r[1] = 2.0*random_equal->uniform() - 1.0; r[2] = 2.0*random_equal->uniform() - 1.0; rsq = MathExtra::dot3(r, r); } double theta = random_equal->uniform() * MY_2PI; MathExtra::norm3(r); MathExtra::axisangle_to_quat(r,theta,quat); MathExtra::quat_to_mat(quat,rotmat); double vnew[3]; vnew[0] = random_equal->gaussian()*sigma; vnew[1] = random_equal->gaussian()*sigma; vnew[2] = random_equal->gaussian()*sigma; for (int i = 0; i < natoms_per_molecule; i++) { double xtmp[3]; MathExtra::matvec(rotmat,onemols[imol]->x[i],xtmp); xtmp[0] += com_coord[0]; xtmp[1] += com_coord[1]; xtmp[2] += com_coord[2]; // need to adjust image flags in remap() imageint imagetmp = imagezero; domain->remap(xtmp,imagetmp); if (!domain->inside(xtmp)) error->one(FLERR,"Fix gcmc put atom outside box"); int proc_flag = 0; if (triclinic == 0) { if (xtmp[0] >= sublo[0] && xtmp[0] < subhi[0] && xtmp[1] >= sublo[1] && xtmp[1] < subhi[1] && xtmp[2] >= sublo[2] && xtmp[2] < subhi[2]) proc_flag = 1; } else { domain->x2lamda(xtmp,lamda); if (lamda[0] >= sublo[0] && lamda[0] < subhi[0] && lamda[1] >= sublo[1] && lamda[1] < subhi[1] && lamda[2] >= sublo[2] && lamda[2] < subhi[2]) proc_flag = 1; } if (proc_flag) { atom->avec->create_atom(onemols[imol]->type[i],xtmp); int m = atom->nlocal - 1; // add to groups // optionally add to type-based groups atom->mask[m] = groupbitall; for (int igroup = 0; igroup < ngrouptypes; igroup++) { if (ngcmc_type == grouptypes[igroup]) atom->mask[m] |= grouptypebits[igroup]; } atom->image[m] = imagetmp; atom->molecule[m] = insertion_molecule; if (maxtag_all+i+1 >= MAXTAGINT) error->all(FLERR,"Fix gcmc ran out of available atom IDs"); atom->tag[m] = maxtag_all + i + 1; atom->v[m][0] = vnew[0]; atom->v[m][1] = vnew[1]; atom->v[m][2] = vnew[2]; atom->add_molecule_atom(onemols[imol],i,m,maxtag_all); modify->create_attribute(m); } } // FixRigidSmall::set_molecule stores rigid body attributes // FixShake::set_molecule stores shake info for molecule for (int submol = 0; submol < nmol; ++submol) { if (rigidflag) fixrigid->set_molecule(nlocalprev,maxtag_all,submol,com_coord,vnew,quat); else if (shakeflag) fixshake->set_molecule(nlocalprev,maxtag_all,submol,com_coord,vnew,quat); } atom->natoms += natoms_per_molecule; if (atom->natoms < 0) error->all(FLERR,"Too many total atoms"); atom->nbonds += onemols[imol]->nbonds; atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); double energy_after = energy_full(); // energy_after corrected by energy_intra double deltaphi = zz*volume*natoms_per_molecule* exp(beta*(energy_before - (energy_after - energy_intra)))/(ngas + natoms_per_molecule); if (energy_after < MAXENERGYTEST && random_equal->uniform() < deltaphi) { ninsertion_successes += 1.0; energy_stored = energy_after; } else { atom->nbonds -= onemols[imol]->nbonds; atom->nangles -= onemols[imol]->nangles; atom->ndihedrals -= onemols[imol]->ndihedrals; atom->nimpropers -= onemols[imol]->nimpropers; atom->natoms -= natoms_per_molecule; energy_stored = energy_before; int i = 0; while (i < atom->nlocal) { if (atom->molecule[i] == insertion_molecule) { atom->avec->copy(atom->nlocal-1,i,1); atom->nlocal--; } else i++; } if (force->kspace) force->kspace->qsum_qsq(); if (force->pair->tail_flag) force->pair->reinit(); } update_gas_atoms_list(); } /* ---------------------------------------------------------------------- compute particle's interaction energy with the rest of the system ------------------------------------------------------------------------- */ double FixGCMC::energy(int i, int itype, tagint imolecule, double *coord) { double delx,dely,delz,rsq; double **x = atom->x; int *type = atom->type; tagint *molecule = atom->molecule; int nall = atom->nlocal + atom->nghost; pair = force->pair; cutsq = force->pair->cutsq; double fpair = 0.0; double factor_coul = 1.0; double factor_lj = 1.0; double total_energy = 0.0; for (int j = 0; j < nall; j++) { if (i == j) continue; if (exchmode == EXCHMOL || movemode == MOVEMOL) if (imolecule == molecule[j]) continue; delx = coord[0] - x[j][0]; dely = coord[1] - x[j][1]; delz = coord[2] - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; int jtype = type[j]; // if overlap check requested, if overlap, // return signal value for energy if (overlap_flag && rsq < overlap_cutoffsq) return MAXENERGYSIGNAL; if (rsq < cutsq[itype][jtype]) total_energy += pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair); } return total_energy; } /* ---------------------------------------------------------------------- compute the energy of the given gas molecule in its current position sum across all procs that own atoms of the given molecule ------------------------------------------------------------------------- */ double FixGCMC::molecule_energy(tagint gas_molecule_id) { double mol_energy = 0.0; for (int i = 0; i < atom->nlocal; i++) if (atom->molecule[i] == gas_molecule_id) { mol_energy += energy(i,atom->type[i],gas_molecule_id,atom->x[i]); } double mol_energy_sum = 0.0; MPI_Allreduce(&mol_energy,&mol_energy_sum,1,MPI_DOUBLE,MPI_SUM,world); return mol_energy_sum; } /* ---------------------------------------------------------------------- compute system potential energy ------------------------------------------------------------------------- */ double FixGCMC::energy_full() { int imolecule; if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); comm->exchange(); atom->nghost = 0; comm->borders(); if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); if (modify->n_pre_neighbor) modify->pre_neighbor(); neighbor->build(1); int eflag = 1; int vflag = 0; // if overlap check requested, if overlap, // return signal value for energy if (overlap_flag) { int overlaptestall; int overlaptest = 0; double delx,dely,delz,rsq; double **x = atom->x; tagint *molecule = atom->molecule; int nall = atom->nlocal + atom->nghost; for (int i = 0; i < atom->nlocal; i++) { if (exchmode == EXCHMOL || movemode == MOVEMOL) imolecule = molecule[i]; for (int j = i+1; j < nall; j++) { if (exchmode == EXCHMOL || movemode == MOVEMOL) if (imolecule == molecule[j]) continue; delx = x[i][0] - x[j][0]; dely = x[i][1] - x[j][1]; delz = x[i][2] - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq < overlap_cutoffsq) { overlaptest = 1; break; } } if (overlaptest) break; } MPI_Allreduce(&overlaptest, &overlaptestall, 1, MPI_INT, MPI_MAX, world); if (overlaptestall) return MAXENERGYSIGNAL; } // clear forces so they don't accumulate over multiple // calls within fix gcmc timestep, e.g. for fix shake size_t nbytes = sizeof(double) * (atom->nlocal + atom->nghost); if (nbytes) memset(&atom->f[0][0],0,3*nbytes); if (modify->n_pre_force) modify->pre_force(vflag); if (force->pair) force->pair->compute(eflag,vflag); if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); if (force->improper) force->improper->compute(eflag,vflag); } if (force->kspace) force->kspace->compute(eflag,vflag); // unlike Verlet, not performing a reverse_comm() or forces here // b/c GCMC does not care about forces // don't think it will mess up energy due to any post_force() fixes // but Modify::pre_reverse() is needed for USER-INTEL if (modify->n_pre_reverse) modify->pre_reverse(eflag,vflag); if (modify->n_post_force) modify->post_force(vflag); if (modify->n_end_of_step) modify->end_of_step(); // NOTE: all fixes with energy_global_flag set and which // operate at pre_force() or post_force() or end_of_step() // and which user has enabled via fix_modify energy yes, // will contribute to total MC energy via pe->compute_scalar() update->eflag_global = update->ntimestep; double total_energy = c_pe->compute_scalar(); return total_energy; } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ int FixGCMC::pick_random_gas_atom() { int i = -1; int iwhichglobal = static_cast<int> (ngas*random_equal->uniform()); if ((iwhichglobal >= ngas_before) && (iwhichglobal < ngas_before + ngas_local)) { int iwhichlocal = iwhichglobal - ngas_before; i = local_gas_list[iwhichlocal]; } return i; } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ tagint FixGCMC::pick_random_gas_molecule() { int iwhichglobal = static_cast<int> (ngas*random_equal->uniform()); tagint gas_molecule_id = 0; if ((iwhichglobal >= ngas_before) && (iwhichglobal < ngas_before + ngas_local)) { int iwhichlocal = iwhichglobal - ngas_before; int i = local_gas_list[iwhichlocal]; gas_molecule_id = atom->molecule[i]; } tagint gas_molecule_id_all = 0; MPI_Allreduce(&gas_molecule_id,&gas_molecule_id_all,1, MPI_LMP_TAGINT,MPI_MAX,world); return gas_molecule_id_all; } /* ---------------------------------------------------------------------- ------------------------------------------------------------------------- */ void FixGCMC::toggle_intramolecular(int i) { if (atom->avec->bonds_allow) for (int m = 0; m < atom->num_bond[i]; m++) atom->bond_type[i][m] = -atom->bond_type[i][m]; if (atom->avec->angles_allow) for (int m = 0; m < atom->num_angle[i]; m++) atom->angle_type[i][m] = -atom->angle_type[i][m]; if (atom->avec->dihedrals_allow) for (int m = 0; m < atom->num_dihedral[i]; m++) atom->dihedral_type[i][m] = -atom->dihedral_type[i][m]; if (atom->avec->impropers_allow) for (int m = 0; m < atom->num_improper[i]; m++) atom->improper_type[i][m] = -atom->improper_type[i][m]; } /* ---------------------------------------------------------------------- update the list of gas atoms ------------------------------------------------------------------------- */ void FixGCMC::update_gas_atoms_list() { int nlocal = atom->nlocal; int *mask = atom->mask; tagint *molecule = atom->molecule; double **x = atom->x; if (atom->nmax > gcmc_nmax) { memory->sfree(local_gas_list); gcmc_nmax = atom->nmax; local_gas_list = (int *) memory->smalloc(gcmc_nmax*sizeof(int), "GCMC:local_gas_list"); } ngas_local = 0; if (regionflag) { if (exchmode == EXCHMOL || movemode == MOVEMOL) { tagint maxmol = 0; for (int i = 0; i < nlocal; i++) maxmol = MAX(maxmol,molecule[i]); tagint maxmol_all; MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); double *comx = new double[maxmol_all]; double *comy = new double[maxmol_all]; double *comz = new double[maxmol_all]; for (int imolecule = 0; imolecule < maxmol_all; imolecule++) { for (int i = 0; i < nlocal; i++) { if (molecule[i] == imolecule) { mask[i] |= molecule_group_bit; } else { mask[i] &= molecule_group_inversebit; } } double com[3]; com[0] = com[1] = com[2] = 0.0; group->xcm(molecule_group,gas_mass,com); // remap unwrapped com into periodic box domain->remap(com); comx[imolecule] = com[0]; comy[imolecule] = com[1]; comz[imolecule] = com[2]; } for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (domain->regions[iregion]->match(comx[molecule[i]], comy[molecule[i]],comz[molecule[i]]) == 1) { local_gas_list[ngas_local] = i; ngas_local++; } } } delete[] comx; delete[] comy; delete[] comz; } else { for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]) == 1) { local_gas_list[ngas_local] = i; ngas_local++; } } } } } else { for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { local_gas_list[ngas_local] = i; ngas_local++; } } } MPI_Allreduce(&ngas_local,&ngas,1,MPI_INT,MPI_SUM,world); MPI_Scan(&ngas_local,&ngas_before,1,MPI_INT,MPI_SUM,world); ngas_before -= ngas_local; } /* ---------------------------------------------------------------------- return acceptance ratios ------------------------------------------------------------------------- */ double FixGCMC::compute_vector(int n) { if (n == 0) return ntranslation_attempts; if (n == 1) return ntranslation_successes; if (n == 2) return ninsertion_attempts; if (n == 3) return ninsertion_successes; if (n == 4) return ndeletion_attempts; if (n == 5) return ndeletion_successes; if (n == 6) return nrotation_attempts; if (n == 7) return nrotation_successes; return 0.0; } /* ---------------------------------------------------------------------- memory usage of local atom-based arrays ------------------------------------------------------------------------- */ double FixGCMC::memory_usage() { double bytes = (double)gcmc_nmax * sizeof(int); return bytes; } /* ---------------------------------------------------------------------- pack entire state of Fix into one write ------------------------------------------------------------------------- */ void FixGCMC::write_restart(FILE *fp) { int n = 0; double list[12]; list[n++] = random_equal->state(); list[n++] = random_unequal->state(); list[n++] = ubuf(next_reneighbor).d; list[n++] = ntranslation_attempts; list[n++] = ntranslation_successes; list[n++] = nrotation_attempts; list[n++] = nrotation_successes; list[n++] = ndeletion_attempts; list[n++] = ndeletion_successes; list[n++] = ninsertion_attempts; list[n++] = ninsertion_successes; list[n++] = ubuf(update->ntimestep).d; if (comm->me == 0) { int size = n * sizeof(double); fwrite(&size,sizeof(int),1,fp); fwrite(list,sizeof(double),n,fp); } } /* ---------------------------------------------------------------------- use state info from restart file to restart the Fix ------------------------------------------------------------------------- */ void FixGCMC::restart(char *buf) { int n = 0; double *list = (double *) buf; seed = static_cast<int> (list[n++]); random_equal->reset(seed); seed = static_cast<int> (list[n++]); random_unequal->reset(seed); next_reneighbor = (bigint) ubuf(list[n++]).i; ntranslation_attempts = list[n++]; ntranslation_successes = list[n++]; nrotation_attempts = list[n++]; nrotation_successes = list[n++]; ndeletion_attempts = list[n++]; ndeletion_successes = list[n++]; ninsertion_attempts = list[n++]; ninsertion_successes = list[n++]; bigint ntimestep_restart = (bigint) ubuf(list[n++]).i; if (ntimestep_restart != update->ntimestep) error->all(FLERR,"Must not reset timestep when restarting fix gcmc"); } void FixGCMC::grow_molecule_arrays(int nmolatoms) { nmaxmolatoms = nmolatoms; molcoords = memory->grow(molcoords,nmaxmolatoms,3,"gcmc:molcoords"); molq = memory->grow(molq,nmaxmolatoms,"gcmc:molq"); molimage = memory->grow(molimage,nmaxmolatoms,"gcmc:molimage"); }
rbberger/lammps
src/MC/fix_gcmc.cpp
C++
gpl-2.0
81,755
<?php /** Admin Page Framework v3.5.12 by Michael Uno Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> <http://en.michaeluno.jp/admin-page-framework> Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> */ abstract class AdminPageFramework_PageLoadInfo_Base { function __construct($oProp, $oMsg) { if ($oProp->bIsAdminAjax || !$oProp->bIsAdmin) { return; } if (defined('WP_DEBUG') && WP_DEBUG) { $this->oProp = $oProp; $this->oMsg = $oMsg; $this->_nInitialMemoryUsage = memory_get_usage(); add_action('in_admin_footer', array($this, '_replyToSetPageLoadInfoInFooter'), 999); } } public function _replyToSetPageLoadInfoInFooter() { } static private $_bLoadedPageLoadInfo = false; public function _replyToGetPageLoadInfo($sFooterHTML) { if (self::$_bLoadedPageLoadInfo) { return; } self::$_bLoadedPageLoadInfo = true; $_nSeconds = timer_stop(0); $_nQueryCount = get_num_queries(); $_nMemoryUsage = round($this->_convertBytesToHR(memory_get_usage()), 2); $_nMemoryPeakUsage = round($this->_convertBytesToHR(memory_get_peak_usage()), 2); $_nMemoryLimit = round($this->_convertBytesToHR($this->_convertToNumber(WP_MEMORY_LIMIT)), 2); $_sInitialMemoryUsage = round($this->_convertBytesToHR($this->_nInitialMemoryUsage), 2); return $sFooterHTML . "<div id='admin-page-framework-page-load-stats'>" . "<ul>" . "<li>" . sprintf($this->oMsg->get('queries_in_seconds'), $_nQueryCount, $_nSeconds) . "</li>" . "<li>" . sprintf($this->oMsg->get('out_of_x_memory_used'), $_nMemoryUsage, $_nMemoryLimit, round(($_nMemoryUsage / $_nMemoryLimit), 2) * 100 . '%') . "</li>" . "<li>" . sprintf($this->oMsg->get('peak_memory_usage'), $_nMemoryPeakUsage) . "</li>" . "<li>" . sprintf($this->oMsg->get('initial_memory_usage'), $_sInitialMemoryUsage) . "</li>" . "</ul>" . "</div>"; } private function _convertToNumber($nSize) { $_nReturn = substr($nSize, 0, -1); switch (strtoupper(substr($nSize, -1))) { case 'P': $_nReturn*= 1024; case 'T': $_nReturn*= 1024; case 'G': $_nReturn*= 1024; case 'M': $_nReturn*= 1024; case 'K': $_nReturn*= 1024; } return $_nReturn; } private function _convertBytesToHR($nBytes) { $_aUnits = array(0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB'); $_nLog = log($nBytes, 1024); $_iPower = ( int )$_nLog; $_iSize = pow(1024, $_nLog - $_iPower); return $_iSize . $_aUnits[$_iPower]; } }
FullPeace/fullpeace-media-to-post
library/admin-page-framework/factory/AdminPageFramework_Factory/view/AdminPageFramework_PageLoadInfo_Base.php
PHP
gpl-2.0
2,834
/** * * FENIX (Food security and Early warning Network and Information Exchange) * * Copyright (c) 2011, by FAO of UN under the EC-FAO Food Security Information for Action Programme * * 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 org.fao.fenix.wds.core.constant; /** * @author <a href="mailto:guido.barbaglia@fao.org">Guido Barbaglia</a> * @author <a href="mailto:guido.barbaglia@gmail.com">Guido Barbaglia</a> * */ public enum SELECT { SELECTS, SELECT, AGGREGATION, COLUMN, ALIAS; }
FENIX-Platform/wds
src/main/java/org/fao/fenix/wds/core/constant/SELECT.java
Java
gpl-2.0
1,111
/* * The filenames of the animation pictures. Also see anim.h * * Copyright (c) 2000 Michael Pearson <alcaron@senet.com.au> * * This file is licensed under the GNU General Public License. See the file * "COPYING" for more details. */ /* * Every image is in .png format, and is suffixed by .frameno.png * eg, "foo" would have files to the tune of "foo.0.png" up to "foo.99.png". * 'animations' which are only still images should not be named simply * "foo.png", rather "foo.0.png". */ char *animlocations[] = { "block.default", /* ANIM_BLOCK_DEFAULT */ "block.strong.1", /* ANIM_BLOCK_STRONG_1 */ "block.strong.1.die", /* ANIM_BLOCK_STRONG_1_DIE */ "block.strong.2", /* ANIM_BLOCK_STRONG_2 */ "block.strong.2.die", /* ANIM_BLOCK_STRONG_2_DIE */ "block.strong.3", /* ANIM_BLOCK_STRONG_3 */ "block.strong.3.die", /* ANIM_BLOCK_STRONG_3_DIE */ "block.invincible", /* ANIM_BLOCK_INVINCIBLE */ "block.default.die", /* ANIM_BLOCK_DEFAULT_DIE */ "ball.default", /* ANIM_BALL_DEFAULT */ "bat.default", /* ANIM_BAT_DEFAULT */ "powerup.score500", /* ANIM_POWERUP_SCORE500 */ "bat.laser", /* ANIM_BAT_LASER */ "laser", /* ANIM_LASER */ "powerup.laser", /* ANIM_POWERUP_LASER */ "powerup.newlife", /* ANIM_POWERUP_NEWLIFE */ "powerup.newball", /* ANIM_POWERUP_NEWBALL */ "powerup.nextlevel", /* ANIM_POWERUP_NEXTLEVEL */ "powerup.slow", /* ANIM_POWERUP_SLOW */ "powerup.widebat", /* ANIM_POWERUP_WIDEBAT */ "bat.wide", /* ANIM_BAT_WIDE */ "block.explode", /* ANIM_BLOCK_EXPLODE */ "block.explode.die", /* ANIM_BLOCK_EXPLODE_DIE */ NULL };
mipearson/gnome-breakout
src/animloc.h
C
gpl-2.0
1,818
/* Icaro Cloud Simulator (ICLOS). Copyright (C) 2015 DISIT Lab http://www.disit.org - University of Florence This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.cloudsimulator.viewer; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.el.ValueExpression; import javax.enterprise.context.ConversationScoped; import javax.faces.component.UIComponent; import javax.faces.component.html.HtmlPanelGroup; import javax.inject.Inject; import javax.inject.Named; import org.cloudsimulator.controller.BusinessConfigurationController; import org.cloudsimulator.domain.ontology.IcaroApplication; import org.cloudsimulator.domain.ontology.IcaroService; import org.cloudsimulator.domain.ontology.IcaroTenant; import org.cloudsimulator.domain.ontology.MonitorInfo; import org.cloudsimulator.domain.ontology.SLAction; import org.cloudsimulator.domain.ontology.SLAgreement; import org.cloudsimulator.domain.ontology.SLMetric; import org.cloudsimulator.domain.ontology.SLObjective; import org.cloudsimulator.domain.ontology.User; import org.cloudsimulator.viewer.compositecomponent.CCUtility; @Named("businessConfigurationViewer") @ConversationScoped public class BusinessConfigurationViewer implements Serializable { private static final long serialVersionUID = 2736989737825705221L; @Inject private BusinessConfigurationController businessConfigurationController; private boolean buttonCreateXML; private String entityToAddMessage; private transient HtmlPanelGroup panelBusinessConfigurationBody; private transient List<HtmlPanelGroup> icaroApplicationPanelBodyList; private transient List<HtmlPanelGroup> icaroTenantPanelBodyList; private transient List<HtmlPanelGroup> slAgreementPanelBodyList; private transient List<HtmlPanelGroup> creatorPanelBodyList; private transient List<List<HtmlPanelGroup>> icaroServicePanelBodyList; private transient List<List<HtmlPanelGroup>> slAgreementIcaroApplicationPanelBodyList; private transient List<List<HtmlPanelGroup>> slAgreementIcaroTenantPanelBodyList; private transient List<List<HtmlPanelGroup>> slObjectiveSlAgreementPanelBodyList; private transient List<List<List<HtmlPanelGroup>>> slObjectiveSlAgreementIAPanelBodyList; private transient List<List<List<HtmlPanelGroup>>> slObjectiveSlAgreementITPanelBodyList; private int indexIcaroApplication; private int countIcaroApplication; private int indexIcaroTenant; private int countIcaroTenant; private int indexSlAgreement; private int countSlAgreement; private int indexCreator; private int countCreator; private List<Integer> indexIAIcaroServiceList; private List<Integer> countIAIcaroServiceList; private List<Integer> indexIASlAgreementList; private List<Integer> countIASlAgreementList; private List<Integer> indexIACreatorList; private List<Integer> countIACreatorList; private List<Integer> indexITMonitorInfoList; private List<Integer> indexITSlAgreementList; private List<Integer> countITSlAgreementList; private List<Integer> indexSASlObjectiveList; private List<Integer> countSASlObjectiveList; private List<List<Integer>> indexIAISMonitorInfoList; private List<List<Integer>> indexIAISTcpPortList; private List<List<Integer>> indexIAISUdpPortList; private List<List<Integer>> indexIASASlObjectiveList; private List<List<Integer>> countIASASlObjectiveList; private List<List<Integer>> indexITSASlObjectiveList; private List<List<Integer>> countITSASlObjectiveList; private List<List<Integer>> indexSASOSlActionList; private List<List<Integer>> countSASOSlActionList; private List<List<Integer>> indexSASOSlMetricList; private List<List<Integer>> countSASOSlMetricList; private List<List<List<Integer>>> indexIASASOSlActionList; private List<List<List<Integer>>> countIASASOSlActionList; private List<List<List<Integer>>> indexIASASOSlMetricList; private List<List<List<Integer>>> countIASASOSlMetricList; private List<List<List<Integer>>> indexITSASOSlActionList; private List<List<List<Integer>>> countITSASOSlActionList; private List<List<List<Integer>>> indexITSASOSlMetricList; private List<List<List<Integer>>> countITSASOSlMetricList; public BusinessConfigurationViewer() { super(); initReset(); } private void initReset() { this.icaroApplicationPanelBodyList = new ArrayList<HtmlPanelGroup>(); this.icaroTenantPanelBodyList = new ArrayList<HtmlPanelGroup>(); this.slAgreementPanelBodyList = new ArrayList<HtmlPanelGroup>(); this.creatorPanelBodyList = new ArrayList<HtmlPanelGroup>(); this.slObjectiveSlAgreementPanelBodyList = new ArrayList<List<HtmlPanelGroup>>(); this.icaroServicePanelBodyList = new ArrayList<List<HtmlPanelGroup>>(); this.slAgreementIcaroApplicationPanelBodyList = new ArrayList<List<HtmlPanelGroup>>(); this.slObjectiveSlAgreementIAPanelBodyList = new ArrayList<List<List<HtmlPanelGroup>>>(); this.slAgreementIcaroTenantPanelBodyList = new ArrayList<List<HtmlPanelGroup>>(); this.slObjectiveSlAgreementITPanelBodyList = new ArrayList<List<List<HtmlPanelGroup>>>(); this.indexIAIcaroServiceList = new ArrayList<Integer>(); this.countIAIcaroServiceList = new ArrayList<Integer>(); this.indexIASlAgreementList = new ArrayList<Integer>(); this.countIASlAgreementList = new ArrayList<Integer>(); this.indexIACreatorList = new ArrayList<Integer>(); this.countIACreatorList = new ArrayList<Integer>(); this.indexITMonitorInfoList = new ArrayList<Integer>(); this.indexITSlAgreementList = new ArrayList<Integer>(); this.countITSlAgreementList = new ArrayList<Integer>(); this.indexSASlObjectiveList = new ArrayList<Integer>(); this.countSASlObjectiveList = new ArrayList<Integer>(); this.indexIAISMonitorInfoList = new ArrayList<List<Integer>>(); this.indexIAISTcpPortList = new ArrayList<List<Integer>>(); this.indexIAISUdpPortList = new ArrayList<List<Integer>>(); this.indexSASOSlActionList = new ArrayList<List<Integer>>(); this.countSASOSlActionList = new ArrayList<List<Integer>>(); this.indexSASOSlMetricList = new ArrayList<List<Integer>>(); this.countSASOSlMetricList = new ArrayList<List<Integer>>(); this.indexIASASlObjectiveList = new ArrayList<List<Integer>>(); this.countIASASlObjectiveList = new ArrayList<List<Integer>>(); this.indexITSASlObjectiveList = new ArrayList<List<Integer>>(); this.countITSASlObjectiveList = new ArrayList<List<Integer>>(); this.indexIASASOSlActionList = new ArrayList<List<List<Integer>>>(); this.countIASASOSlActionList = new ArrayList<List<List<Integer>>>(); this.indexIASASOSlMetricList = new ArrayList<List<List<Integer>>>(); this.countIASASOSlMetricList = new ArrayList<List<List<Integer>>>(); this.indexITSASOSlActionList = new ArrayList<List<List<Integer>>>(); this.countITSASOSlActionList = new ArrayList<List<List<Integer>>>(); this.indexITSASOSlMetricList = new ArrayList<List<List<Integer>>>(); this.countITSASOSlMetricList = new ArrayList<List<List<Integer>>>(); indexIcaroApplication = 0; countIcaroApplication = 0; indexIcaroTenant = 0; countIcaroTenant = 0; indexSlAgreement = 0; countSlAgreement = 0; indexCreator = 0; countCreator = 0; controlForButtonCreateXML(); } @SuppressWarnings({ "el-syntax", "el-unresolved" }) public void addInputNumberTcpPortIcaroService( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexTcpPort = this.indexIAISTcpPortList.get( indexPanelGParent).get(indexPanelParent); this.icaroServicePanelBodyList.get(indexPanelGParent).set( indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGParent) .getIcaroServiceList().get(indexPanelParent) .getUsesTcpPortList().add(indexTcpPort, 0); Map<String, ValueExpression> mapValueExpression = new HashMap<String, ValueExpression>(); final String idCC = "ccInputNumberTcpPort" + indexTcpPort; mapValueExpression.put( "preAddon", CCUtility.createValueExpression("#" + (indexTcpPort + 1) + " TCPPort", String.class)); mapValueExpression.put("placeholder", CCUtility .createValueExpression( "Insert number of TCP port used by icaro service", String.class)); mapValueExpression.put("value", CCUtility.createValueExpression( "#{businessConfigurationController.businessConfiguration.icaroApplicationList[" + indexPanelGParent + "].icaroServiceList[" + indexPanelParent + "].usesTcpPortList[" + indexTcpPort + "]}", Object.class)); mapValueExpression.put("converterId", CCUtility.createValueExpression( "DigitsOnlyConverter", String.class)); mapValueExpression.put("converterMessage", CCUtility .createValueExpression("You can only insert digit.", String.class)); mapValueExpression.put("minimumValue", CCUtility.createValueExpression("0", Long.class)); mapValueExpression.put("maximumValue", CCUtility.createValueExpression("65535", Long.class)); CCUtility.includeCompositeComponent(htmlPanelParent, "inputComponent", "inputNumberBS.xhtml", idCC, mapValueExpression); this.indexIAISTcpPortList.get(indexPanelGParent).set(indexPanelParent, indexTcpPort + 1); } @SuppressWarnings({ "el-syntax", "el-unresolved" }) public void addInputNumberUdpPortIcaroService( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexUdpPort = this.indexIAISUdpPortList.get( indexPanelGParent).get(indexPanelParent); this.icaroServicePanelBodyList.get(indexPanelGParent).set( indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGParent) .getIcaroServiceList().get(indexPanelParent) .getUsesUdpPortList().add(indexUdpPort, 0); Map<String, ValueExpression> mapValueExpression = new HashMap<String, ValueExpression>(); final String idCC = "ccInputNumberUdpPort" + indexUdpPort; mapValueExpression.put( "preAddon", CCUtility.createValueExpression("#" + (indexUdpPort + 1) + " UDPPort", String.class)); mapValueExpression.put("placeholder", CCUtility .createValueExpression( "Insert number of UDP port used by icaro service", String.class)); mapValueExpression.put("value", CCUtility.createValueExpression( "#{businessConfigurationController.businessConfiguration.icaroApplicationList[" + indexPanelGParent + "].icaroServiceList[" + indexPanelParent + "].usesUdpPortList[" + indexUdpPort + "]}", Object.class)); mapValueExpression.put("converterId", CCUtility.createValueExpression( "DigitsOnlyConverter", String.class)); mapValueExpression.put("converterMessage", CCUtility .createValueExpression("You can only insert digit.", String.class)); mapValueExpression.put("minimumValue", CCUtility.createValueExpression("0", Long.class)); mapValueExpression.put("maximumValue", CCUtility.createValueExpression("65535", Long.class)); CCUtility.includeCompositeComponent(htmlPanelParent, "inputComponent", "inputNumberBS.xhtml", idCC, mapValueExpression); this.indexIAISUdpPortList.get(indexPanelGParent).set(indexPanelParent, indexUdpPort + 1); } public void addPanelCreator() { if (countCreator == 0) { this.creatorPanelBodyList.add(indexCreator, new HtmlPanelGroup()); this.businessConfigurationController.getBusinessConfiguration() .getCreatorList().add(indexCreator, new User()); CCUtility.setFirstPanel(indexCreator, panelBusinessConfigurationBody, "creator", "businessConfiguration"); this.indexCreator++; this.countCreator++; controlForButtonCreateXML(); } } public void addPanelCreatorIcaroApplication( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelParent) { if (this.countIACreatorList.get(indexPanelParent) == 0) { final Integer indexCreatorLocal = this.indexIACreatorList .get(indexPanelParent); this.icaroApplicationPanelBodyList.set(indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelParent) .getCreatorList().add(indexCreatorLocal, new User()); CCUtility.setSecondPanel(indexCreatorLocal, indexPanelParent, htmlPanelParent, "creator", "icaroApplication", "businessConfiguration"); this.indexIACreatorList .set(indexPanelParent, indexCreatorLocal + 1); this.countIACreatorList.set(indexPanelParent, this.countIACreatorList.get(indexPanelParent) + 1); controlForButtonCreateXML(); } } public void addPanelIcaroApplication() { this.icaroApplicationPanelBodyList.add(indexIcaroApplication, new HtmlPanelGroup()); this.icaroServicePanelBodyList.add(indexIcaroApplication, new ArrayList<HtmlPanelGroup>()); this.slAgreementIcaroApplicationPanelBodyList.add( indexIcaroApplication, new ArrayList<HtmlPanelGroup>()); this.slObjectiveSlAgreementIAPanelBodyList.add(indexIcaroApplication, new ArrayList<List<HtmlPanelGroup>>()); this.indexIAIcaroServiceList.add(indexIcaroApplication, 0); this.countIAIcaroServiceList.add(indexIcaroApplication, 0); this.indexIASlAgreementList.add(indexIcaroApplication, 0); this.countIASlAgreementList.add(indexIcaroApplication, 0); this.indexIACreatorList.add(indexIcaroApplication, 0); this.countIACreatorList.add(indexIcaroApplication, 0); this.indexIAISMonitorInfoList.add(indexIcaroApplication, new ArrayList<Integer>()); this.indexIAISTcpPortList.add(indexIcaroApplication, new ArrayList<Integer>()); this.indexIAISUdpPortList.add(indexIcaroApplication, new ArrayList<Integer>()); this.indexIASASlObjectiveList.add(indexIcaroApplication, new ArrayList<Integer>()); this.countIASASlObjectiveList.add(indexIcaroApplication, new ArrayList<Integer>()); this.indexIASASOSlActionList.add(indexIcaroApplication, new ArrayList<List<Integer>>()); this.countIASASOSlActionList.add(indexIcaroApplication, new ArrayList<List<Integer>>()); this.indexIASASOSlMetricList.add(indexIcaroApplication, new ArrayList<List<Integer>>()); this.countIASASOSlMetricList.add(indexIcaroApplication, new ArrayList<List<Integer>>()); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList() .add(indexIcaroApplication, new IcaroApplication()); CCUtility.setFirstPanel(indexIcaroApplication, panelBusinessConfigurationBody, "icaroApplication", "businessConfiguration"); this.indexIcaroApplication++; this.countIcaroApplication++; controlForButtonCreateXML(); } public void addPanelIcaroServiceIcaroApplication( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelParent) { final Integer indexIcaroService = this.indexIAIcaroServiceList .get(indexPanelParent); this.icaroApplicationPanelBodyList.set(indexPanelParent, htmlPanelParent); this.icaroServicePanelBodyList.get(indexPanelParent).add( indexIcaroService, new HtmlPanelGroup()); this.indexIAISMonitorInfoList.get(indexPanelParent).add( indexIcaroService, 0); this.indexIAISTcpPortList.get(indexPanelParent).add(indexIcaroService, 0); this.indexIAISUdpPortList.get(indexPanelParent).add(indexIcaroService, 0); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelParent) .getIcaroServiceList() .add(indexIcaroService, new IcaroService()); CCUtility.setSecondPanel(indexIcaroService, indexPanelParent, htmlPanelParent, "icaroService", "icaroApplication", "businessConfiguration"); this.indexIAIcaroServiceList.set(indexPanelParent, indexIcaroService + 1); this.countIAIcaroServiceList.set(indexPanelParent, this.countIAIcaroServiceList.get(indexPanelParent) + 1); controlForButtonCreateXML(); } public void addPanelIcaroTenant() { this.icaroTenantPanelBodyList.add(indexIcaroTenant, new HtmlPanelGroup()); this.slAgreementIcaroTenantPanelBodyList.add(indexIcaroTenant, new ArrayList<HtmlPanelGroup>()); this.slObjectiveSlAgreementITPanelBodyList.add(indexIcaroTenant, new ArrayList<List<HtmlPanelGroup>>()); this.indexITMonitorInfoList.add(indexIcaroTenant, 0); this.indexITSlAgreementList.add(indexIcaroTenant, 0); this.countITSlAgreementList.add(indexIcaroTenant, 0); this.indexITSASlObjectiveList.add(indexIcaroTenant, new ArrayList<Integer>()); this.countITSASlObjectiveList.add(indexIcaroTenant, new ArrayList<Integer>()); this.indexITSASOSlActionList.add(indexIcaroTenant, new ArrayList<List<Integer>>()); this.countITSASOSlActionList.add(indexIcaroTenant, new ArrayList<List<Integer>>()); this.indexITSASOSlMetricList.add(indexIcaroTenant, new ArrayList<List<Integer>>()); this.countITSASOSlMetricList.add(indexIcaroTenant, new ArrayList<List<Integer>>()); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().add(indexIcaroTenant, new IcaroTenant()); CCUtility.setFirstPanel(indexIcaroTenant, panelBusinessConfigurationBody, "icaroTenant", "businessConfiguration"); this.indexIcaroTenant++; this.countIcaroTenant++; } public void addPanelMonitorInfoIcaroServiceIA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexMonitorInfo = this.indexIAISMonitorInfoList.get( indexPanelGParent).get(indexPanelParent); this.icaroServicePanelBodyList.get(indexPanelGParent).set( indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGParent) .getIcaroServiceList().get(indexPanelParent) .getMonitorInfoList().add(indexMonitorInfo, new MonitorInfo()); CCUtility.setThirdPanel(indexMonitorInfo, indexPanelParent, indexPanelGParent, htmlPanelParent, "monitorInfo", "icaroService", "icaroApplication", "businessConfiguration", "ia"); this.indexIAISMonitorInfoList.get(indexPanelGParent).set( indexPanelParent, indexMonitorInfo + 1); } public void addPanelMonitorInfoIcaroTenant( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelParent) { final Integer indexMonitorInfo = this.indexITMonitorInfoList .get(indexPanelParent); this.icaroTenantPanelBodyList.set(indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelParent) .getMonitorInfoList().add(indexMonitorInfo, new MonitorInfo()); CCUtility.setSecondPanel(indexMonitorInfo, indexPanelParent, htmlPanelParent, "monitorInfo", "icaroTenant", "businessConfiguration"); this.indexITMonitorInfoList.set(indexPanelParent, indexMonitorInfo + 1); } public void addPanelSlActionSlObjectiveSA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlAction = this.indexSASOSlActionList.get( indexPanelGParent).get(indexPanelParent); this.slObjectiveSlAgreementPanelBodyList.get(indexPanelGParent).set( indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent).getSlActionList() .add(indexSlAction, new SLAction()); CCUtility.setThirdPanel(indexSlAction, indexPanelParent, indexPanelGParent, htmlPanelParent, "slAction", "slObjective", "slAgreement", "businessConfiguration", "sa"); this.indexSASOSlActionList.get(indexPanelGParent).set(indexPanelParent, indexSlAction + 1); this.countSASOSlActionList.get(indexPanelGParent).set( indexPanelParent, this.countSASOSlActionList.get(indexPanelGParent).get( indexPanelParent) + 1); controlForButtonCreateXML(); } @SuppressWarnings({ "el-syntax", "el-unresolved" }) public void addPanelSlActionSlObjectiveIASA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlAction = this.indexIASASOSlActionList .get(indexPanelGGParent).get(indexPanelGParent) .get(indexPanelParent); this.slObjectiveSlAgreementIAPanelBodyList.get(indexPanelGGParent) .get(indexPanelGParent).set(indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent).getSlActionList() .add(indexSlAction, new SLAction()); CCUtility.setForthPanel(indexSlAction, indexPanelParent, indexPanelGParent, indexPanelGGParent, htmlPanelParent, "slAction", "slObjective", "slAgreement", "icaroApplication", "businessConfiguration", "iasa"); this.indexIASASOSlActionList.get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, indexSlAction + 1); this.countIASASOSlActionList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countIASASOSlActionList.get(indexPanelGGParent) .get(indexPanelGParent).get(indexPanelParent) + 1); controlForButtonCreateXML(); } @SuppressWarnings({ "el-syntax", "el-unresolved" }) public void addPanelSlActionSlObjectiveITSA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlAction = this.indexITSASOSlActionList .get(indexPanelGGParent).get(indexPanelGParent) .get(indexPanelParent); this.slObjectiveSlAgreementITPanelBodyList.get(indexPanelGGParent) .get(indexPanelGParent).set(indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent).getSlActionList() .add(indexSlAction, new SLAction()); CCUtility.setForthPanel(indexSlAction, indexPanelParent, indexPanelGParent, indexPanelGGParent, htmlPanelParent, "slAction", "slObjective", "slAgreement", "icaroTenant", "businessConfiguration", "itsa"); this.indexITSASOSlActionList.get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, indexSlAction + 1); this.countITSASOSlActionList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countITSASOSlActionList.get(indexPanelGGParent) .get(indexPanelGParent).get(indexPanelParent) + 1); controlForButtonCreateXML(); } public void addPanelSlAgreement() { if (countSlAgreement == 0) { this.slAgreementPanelBodyList.add(indexSlAgreement, new HtmlPanelGroup()); this.slObjectiveSlAgreementPanelBodyList.add(indexSlAgreement, new ArrayList<HtmlPanelGroup>()); this.indexSASlObjectiveList.add(indexSlAgreement, 0); this.countSASlObjectiveList.add(indexSlAgreement, 0); this.indexSASOSlActionList.add(indexSlAgreement, new ArrayList<Integer>()); this.countSASOSlActionList.add(indexSlAgreement, new ArrayList<Integer>()); this.indexSASOSlMetricList.add(indexSlAgreement, new ArrayList<Integer>()); this.countSASOSlMetricList.add(indexSlAgreement, new ArrayList<Integer>()); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList() .add(indexSlAgreement, new SLAgreement()); CCUtility.setFirstPanel(indexSlAgreement, panelBusinessConfigurationBody, "slAgreement", "businessConfiguration"); this.indexSlAgreement++; this.countSlAgreement++; controlForButtonCreateXML(); } } public void addPanelSlAgreementIcaroApplication( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelParent) { if (this.countIASlAgreementList.get(indexPanelParent) == 0) { final Integer indexIASlAgreement = this.indexIASlAgreementList .get(indexPanelParent); this.icaroApplicationPanelBodyList.set(indexPanelParent, htmlPanelParent); this.slAgreementIcaroApplicationPanelBodyList.get(indexPanelParent) .add(indexIASlAgreement, new HtmlPanelGroup()); this.slObjectiveSlAgreementIAPanelBodyList.get(indexPanelParent) .add(indexIASlAgreement, new ArrayList<HtmlPanelGroup>()); this.indexIASASlObjectiveList.get(indexPanelParent).add( indexIASlAgreement, 0); this.countIASASlObjectiveList.get(indexPanelParent).add( indexIASlAgreement, 0); this.indexIASASOSlActionList.get(indexPanelParent).add( indexIASlAgreement, new ArrayList<Integer>()); this.countIASASOSlActionList.get(indexPanelParent).add( indexIASlAgreement, new ArrayList<Integer>()); this.indexIASASOSlMetricList.get(indexPanelParent).add( indexIASlAgreement, new ArrayList<Integer>()); this.countIASASOSlMetricList.get(indexPanelParent).add( indexIASlAgreement, new ArrayList<Integer>()); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelParent) .getSlAgreementList() .add(indexIASlAgreement, new SLAgreement()); CCUtility.setSecondPanel(indexIASlAgreement, indexPanelParent, htmlPanelParent, "slAgreement", "icaroApplication", "businessConfiguration"); this.indexIASlAgreementList.set(indexPanelParent, indexIASlAgreement + 1); this.countIASlAgreementList.set(indexPanelParent, this.countIASlAgreementList.get(indexPanelParent) + 1); controlForButtonCreateXML(); } } public void addPanelSlAgreementIcaroTenant( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelParent) { if (this.countITSlAgreementList.get(indexPanelParent) == 0) { final Integer indexITSlAgreement = this.indexITSlAgreementList .get(indexPanelParent); this.icaroTenantPanelBodyList .set(indexPanelParent, htmlPanelParent); this.slAgreementIcaroTenantPanelBodyList.get(indexPanelParent).add( indexITSlAgreement, new HtmlPanelGroup()); this.slObjectiveSlAgreementITPanelBodyList.get(indexPanelParent) .add(indexITSlAgreement, new ArrayList<HtmlPanelGroup>()); this.indexITSASlObjectiveList.get(indexPanelParent).add( indexITSlAgreement, 0); this.countITSASlObjectiveList.get(indexPanelParent).add( indexITSlAgreement, 0); this.indexITSASOSlActionList.get(indexPanelParent).add( indexITSlAgreement, new ArrayList<Integer>()); this.countITSASOSlActionList.get(indexPanelParent).add( indexITSlAgreement, new ArrayList<Integer>()); this.indexITSASOSlMetricList.get(indexPanelParent).add( indexITSlAgreement, new ArrayList<Integer>()); this.countITSASOSlMetricList.get(indexPanelParent).add( indexITSlAgreement, new ArrayList<Integer>()); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelParent) .getSlAgreementList() .add(indexITSlAgreement, new SLAgreement()); CCUtility.setSecondPanel(indexITSlAgreement, indexPanelParent, htmlPanelParent, "slAgreement", "icaroTenant", "businessConfiguration"); this.indexITSlAgreementList.set(indexPanelParent, indexITSlAgreement + 1); this.countITSlAgreementList.set(indexPanelParent, this.countITSlAgreementList.get(indexPanelParent) + 1); controlForButtonCreateXML(); } } public void addPanelSlMetricSlObjectiveSA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlMetric = this.indexSASOSlMetricList.get( indexPanelGParent).get(indexPanelParent); this.slObjectiveSlAgreementPanelBodyList.get(indexPanelGParent).set( indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent).getSlMetricList() .add(indexSlMetric, new SLMetric()); CCUtility.setThirdPanel(indexSlMetric, indexPanelParent, indexPanelGParent, htmlPanelParent, "slMetric", "slObjective", "slAgreement", "businessConfiguration", "sa"); this.indexSASOSlMetricList.get(indexPanelGParent).set(indexPanelParent, indexSlMetric + 1); this.countSASOSlMetricList.get(indexPanelGParent).set( indexPanelParent, this.countSASOSlMetricList.get(indexPanelGParent).get( indexPanelParent) + 1); controlForButtonCreateXML(); } public void addPanelSlMetricSlObjectiveIASA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlMetric = this.indexIASASOSlMetricList .get(indexPanelGGParent).get(indexPanelGParent) .get(indexPanelParent); this.slObjectiveSlAgreementIAPanelBodyList.get(indexPanelGGParent) .get(indexPanelGParent).set(indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent).getSlMetricList() .add(indexSlMetric, new SLMetric()); CCUtility.setForthPanel(indexSlMetric, indexPanelParent, indexPanelGParent, indexPanelGGParent, htmlPanelParent, "slMetric", "slObjective", "slAgreement", "icaroApplication", "businessConfiguration", "iasa"); this.indexIASASOSlMetricList.get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, indexSlMetric + 1); this.countIASASOSlMetricList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countIASASOSlMetricList.get(indexPanelGGParent) .get(indexPanelGParent).get(indexPanelParent) + 1); controlForButtonCreateXML(); } public void addPanelSlMetricSlObjectiveITSA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlMetric = this.indexITSASOSlMetricList .get(indexPanelGGParent).get(indexPanelGParent) .get(indexPanelParent); this.slObjectiveSlAgreementITPanelBodyList.get(indexPanelGGParent) .get(indexPanelGParent).set(indexPanelParent, htmlPanelParent); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent).getSlMetricList() .add(indexSlMetric, new SLMetric()); CCUtility.setForthPanel(indexSlMetric, indexPanelParent, indexPanelGParent, indexPanelGGParent, htmlPanelParent, "slMetric", "slObjective", "slAgreement", "icaroTenant", "businessConfiguration", "itsa"); this.indexITSASOSlMetricList.get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, indexSlMetric + 1); this.countITSASOSlMetricList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countITSASOSlMetricList.get(indexPanelGGParent) .get(indexPanelGParent).get(indexPanelParent) + 1); controlForButtonCreateXML(); } public void addPanelSlObjectiveSlAgreement( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelParent) { final Integer indexSlObjective = this.indexSASlObjectiveList .get(indexPanelParent); this.slAgreementPanelBodyList.set(indexPanelParent, htmlPanelParent); this.slObjectiveSlAgreementPanelBodyList.get(indexPanelParent).add( indexSlObjective, htmlPanelParent); this.indexSASOSlActionList.get(indexPanelParent).add(indexSlObjective, 0); this.countSASOSlActionList.get(indexPanelParent).add(indexSlObjective, 0); this.indexSASOSlMetricList.get(indexPanelParent).add(indexSlObjective, 0); this.countSASOSlMetricList.get(indexPanelParent).add(indexSlObjective, 0); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().get(indexPanelParent) .getSlObjectiveList().add(indexSlObjective, new SLObjective()); CCUtility.setSecondPanel(indexSlObjective, indexPanelParent, htmlPanelParent, "slObjective", "slAgreement", "businessConfiguration"); this.indexSASlObjectiveList.set(indexPanelParent, indexSlObjective + 1); this.countSASlObjectiveList.set(indexPanelParent, this.countSASlObjectiveList.get(indexPanelParent) + 1); controlForButtonCreateXML(); } @SuppressWarnings({ "el-syntax", "el-unresolved" }) public void addPanelSlObjectiveSlAgreementIA( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlObjective = this.indexIASASlObjectiveList.get( indexPanelGParent).get(indexPanelParent); this.slAgreementIcaroApplicationPanelBodyList.get(indexPanelGParent) .set(indexPanelParent, htmlPanelParent); this.slObjectiveSlAgreementIAPanelBodyList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, htmlPanelParent); this.indexIASASOSlActionList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.countIASASOSlActionList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.indexIASASOSlMetricList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.countIASASOSlMetricList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGParent) .getSlAgreementList().get(indexPanelParent) .getSlObjectiveList().add(indexSlObjective, new SLObjective()); CCUtility.setThirdPanel(indexSlObjective, indexPanelParent, indexPanelGParent, htmlPanelParent, "slObjective", "slAgreement", "icaroApplication", "businessConfiguration", "ia"); this.indexIASASlObjectiveList.get(indexPanelGParent).set( indexPanelParent, indexSlObjective + 1); this.countIASASlObjectiveList.get(indexPanelGParent).set( indexPanelParent, this.countIASASlObjectiveList.get(indexPanelGParent).get( indexPanelParent) + 1); controlForButtonCreateXML(); } @SuppressWarnings({ "el-syntax", "el-unresolved" }) public void addPanelSlObjectiveSlAgreementIT( final HtmlPanelGroup htmlPanelParent, final Integer indexPanelGParent, final Integer indexPanelParent) { final Integer indexSlObjective = this.indexITSASlObjectiveList.get( indexPanelGParent).get(indexPanelParent); this.slAgreementIcaroTenantPanelBodyList.get(indexPanelGParent).set( indexPanelParent, htmlPanelParent); this.slObjectiveSlAgreementITPanelBodyList.get(indexPanelGParent) .get(indexPanelParent) .add(indexSlObjective, new HtmlPanelGroup()); this.indexITSASOSlActionList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.countITSASOSlActionList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.indexITSASOSlMetricList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.countITSASOSlMetricList.get(indexPanelGParent) .get(indexPanelParent).add(indexSlObjective, 0); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelGParent) .getSlAgreementList().get(indexPanelParent) .getSlObjectiveList().add(indexSlObjective, new SLObjective()); CCUtility.setThirdPanel(indexSlObjective, indexPanelParent, indexPanelGParent, htmlPanelParent, "slObjective", "slAgreement", "icaroTenant", "businessConfiguration", "it"); this.indexITSASlObjectiveList.get(indexPanelGParent).set( indexPanelParent, indexSlObjective + 1); this.countITSASlObjectiveList.get(indexPanelGParent).set( indexPanelParent, this.countITSASlObjectiveList.get(indexPanelGParent).get( indexPanelParent) + 1); controlForButtonCreateXML(); } public String businessConfigurationViewClear() { panelBusinessConfigurationBody.getChildren().clear(); initReset(); return "businessConfiguration"; } private void controlForButtonCreateXML() { this.buttonCreateXML = false; this.entityToAddMessage = ""; if (this.countIcaroApplication >= 1) { for (int i = 0; i < this.countIAIcaroServiceList.size(); i++) { if (this.countIAIcaroServiceList.get(i) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroApplicationList().get(i) != null) { this.entityToAddMessage = "Add to each icaroApplication at least one icaroService. "; return; } } for (int i = 0; i < this.countIACreatorList.size(); i++) { if (this.countIACreatorList.get(i) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroApplicationList().get(i) != null) { this.entityToAddMessage = "Add to each icaroApplication at least one creator. "; return; } } for (int i = 0; i < this.countIASlAgreementList.size(); i++) { if (this.countIASlAgreementList.get(i) >= 1) { for (List<Integer> countSASlObjectiveListLocal : this.countIASASlObjectiveList) { for (int j = 0; j < countSASlObjectiveListLocal.size(); j++) { if (countSASlObjectiveListLocal.get(j) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroApplicationList() .get(this.countIASASlObjectiveList .indexOf(countSASlObjectiveListLocal)) .getSlAgreementList().get(j) != null) { this.entityToAddMessage = "Add to each icaroApplication's slAgreement at least one SLObjective. "; return; } else { for (List<List<Integer>> countSASOSlMetricListLocal : this.countIASASOSlMetricList) { for (List<Integer> countSOSlMetricList : countSASOSlMetricListLocal) { for (int k = 0; k < countSOSlMetricList .size(); k++) { if (countSOSlMetricList.get(k) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroApplicationList() .get(this.countIASASOSlMetricList .indexOf(countSASOSlMetricListLocal)) .getSlAgreementList() .get(countSASOSlMetricListLocal .indexOf(countSOSlMetricList)) .getSlObjectiveList() .get(k) != null) { this.entityToAddMessage = "Add to each icaroApplication's SLObjective at least one SLMetric. "; return; } } } for (List<List<Integer>> countSASOSlActionListLocal : this.countIASASOSlActionList) { for (List<Integer> countSOSlActionList : countSASOSlActionListLocal) { for (int k = 0; k < countSOSlActionList .size(); k++) { if (countSOSlActionList.get(k) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroApplicationList() .get(this.countIASASOSlActionList .indexOf(countSASOSlActionListLocal)) .getSlAgreementList() .get(countSASOSlActionListLocal .indexOf(countSOSlActionList)) .getSlObjectiveList() .get(k) != null) { this.entityToAddMessage = "Add to each icaroApplication's SLObjective at least one SLAction. "; return; } } } } } } } } } } } else { this.entityToAddMessage += "Add at least one icaroApplication to BusinessConfiguration"; return; } if (this.countIcaroTenant >= 1) { for (int i = 0; i < this.countITSlAgreementList.size(); i++) { if (this.countITSlAgreementList.get(i) >= 1) { for (List<Integer> countSASlObjectiveListLocal : this.countITSASlObjectiveList) { for (int j = 0; j < countSASlObjectiveListLocal.size(); j++) { if (countSASlObjectiveListLocal.get(j) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroTenantList() .get(this.countITSASlObjectiveList .indexOf(countSASlObjectiveListLocal)) .getSlAgreementList().get(j) != null) { this.entityToAddMessage = "Add to each icaroTenant's slAgreement at least one SLObjective. "; return; } else { for (List<List<Integer>> countSASOSlMetricListLocal : this.countITSASOSlMetricList) { for (List<Integer> countSOSlMetricList : countSASOSlMetricListLocal) { for (int k = 0; k < countSOSlMetricList .size(); k++) { if (countSOSlMetricList.get(k) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroTenantList() .get(this.countITSASOSlMetricList .indexOf(countSASOSlMetricListLocal)) .getSlAgreementList() .get(countSASOSlMetricListLocal .indexOf(countSOSlMetricList)) .getSlObjectiveList() .get(k) != null) { this.entityToAddMessage = "Add to each icaroTenant's SLObjective at least one SLMetric. "; return; } } } for (List<List<Integer>> countSASOSlActionListLocal : this.countITSASOSlActionList) { for (List<Integer> countSOSlActionList : countSASOSlActionListLocal) { for (int k = 0; k < countSOSlActionList .size(); k++) { if (countSOSlActionList.get(k) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getIcaroTenantList() .get(this.countITSASOSlActionList .indexOf(countSASOSlActionListLocal)) .getSlAgreementList() .get(countSASOSlActionListLocal .indexOf(countSOSlActionList)) .getSlObjectiveList() .get(k) != null) { this.entityToAddMessage = "Add to each icaroTenant's SLObjective at least one SLAction. "; return; } } } } } } } } } } } if (this.countSlAgreement >= 1) { for (int i = 0; i < this.countSASlObjectiveList.size(); i++) { if (this.countSASlObjectiveList.get(i) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getSlAgreementList().get(i) != null) { this.entityToAddMessage = "Add to each businessConfiguration's slAgreement at least one SLObjective. "; return; } else { for (List<Integer> countSOSlMetricList : this.countSASOSlMetricList) { for (int j = 0; j < countSOSlMetricList.size(); j++) { if (countSOSlMetricList.get(j) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getSlAgreementList() .get(countSASOSlMetricList .indexOf(countSOSlMetricList)) .getSlObjectiveList().get(j) != null) { this.entityToAddMessage = "Add to each businessConfiguration's SLObjective at least one SLMetric. "; return; } } } for (List<Integer> countSOSlActionList : this.countSASOSlActionList) { for (int j = 0; j < countSOSlActionList.size(); j++) { if (countSOSlActionList.get(j) < 1 && this.businessConfigurationController .getBusinessConfiguration() .getSlAgreementList() .get(countSASOSlActionList .indexOf(countSOSlActionList)) .getSlObjectiveList().get(j) != null) { this.entityToAddMessage = "Add to each businessConfiguration's SLObjective at least one SLAction. "; return; } } } } } } if (this.countCreator < 1) { this.entityToAddMessage += "Add one creator to BusinessConfiguration"; return; } this.buttonCreateXML = true; } public int getCountCreator() { return countCreator; } public List<Integer> getCountIACreatorList() { return countIACreatorList; } public List<Integer> getCountIASlAgreementList() { return countIASlAgreementList; } public List<Integer> getCountITSlAgreementList() { return countITSlAgreementList; } public int getCountSlAgreement() { return countSlAgreement; } public String getEntityToAddMessage() { return entityToAddMessage; } public HtmlPanelGroup getPanelBusinessConfigurationBody() { return panelBusinessConfigurationBody; } public List<List<HtmlPanelGroup>> getPanelIAIcaroServiceBodyList() { return icaroServicePanelBodyList; } public List<List<List<HtmlPanelGroup>>> getPanelIASASlObjectiveBodyList() { return slObjectiveSlAgreementIAPanelBodyList; } public List<List<HtmlPanelGroup>> getPanelIASlAgreementBodyList() { return slAgreementIcaroApplicationPanelBodyList; } public List<HtmlPanelGroup> getPanelIcaroApplicationBodyList() { return icaroApplicationPanelBodyList; } public List<HtmlPanelGroup> getPanelIcaroTenantBodyList() { return icaroTenantPanelBodyList; } public List<List<List<HtmlPanelGroup>>> getPanelITSASlObjectiveBodyList() { return slObjectiveSlAgreementITPanelBodyList; } public List<List<HtmlPanelGroup>> getPanelITSlAgreementBodyList() { return slAgreementIcaroTenantPanelBodyList; } public List<List<HtmlPanelGroup>> getPanelSASlObjectiveBodyList() { return slObjectiveSlAgreementPanelBodyList; } public List<HtmlPanelGroup> getPanelSlAgreementBodyList() { return slAgreementPanelBodyList; } public boolean isButtonCreateXML() { return buttonCreateXML; } public void removePanelCreator(final String idPanelToRemove, final Integer indexPanelToRemove) { UIComponent uiPanelToRemove = panelBusinessConfigurationBody .findComponent(idPanelToRemove); panelBusinessConfigurationBody.getChildren().remove(uiPanelToRemove); this.creatorPanelBodyList.set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getCreatorList().set(indexPanelToRemove, null); this.countCreator--; controlForButtonCreateXML(); } public void removePanelCreatorIcaroApplication(final String idPanelParent, final String panelToRemove, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.icaroApplicationPanelBodyList) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelParent) .getCreatorList().set(indexPanelToRemove, null); this.countIACreatorList.set(indexPanelParent, this.countIACreatorList.get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelIcaroApplication(final String idPanelToRemove, final Integer indexPanelToRemove) { UIComponent uiPanelToRemove = panelBusinessConfigurationBody .findComponent(idPanelToRemove); panelBusinessConfigurationBody.getChildren().remove(uiPanelToRemove); for (HtmlPanelGroup panelIcaroServiceBody : this.icaroServicePanelBodyList .get(indexPanelToRemove)) { if (panelIcaroServiceBody != null) { this.removePanelIcaroServiceIcaroApplication(idPanelToRemove, panelIcaroServiceBody.getId(), indexPanelToRemove, this.icaroServicePanelBodyList.get(indexPanelToRemove) .indexOf(panelIcaroServiceBody)); } } for (HtmlPanelGroup panelSlAgreementBody : this.slAgreementIcaroApplicationPanelBodyList .get(indexPanelToRemove)) { if (panelSlAgreementBody != null) { this.removePanelSlAgreementIcaroApplication(idPanelToRemove, panelSlAgreementBody.getId(), indexPanelToRemove, this.slAgreementIcaroApplicationPanelBodyList.get(indexPanelToRemove) .indexOf(panelSlAgreementBody)); } } this.icaroApplicationPanelBodyList.set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().set(indexPanelToRemove, null); this.indexIAIcaroServiceList.set(indexPanelToRemove, null); this.indexIASlAgreementList.set(indexPanelToRemove, null); this.countIcaroApplication--; controlForButtonCreateXML(); } public void removePanelIcaroTenant(final String idPanelToRemove, final Integer indexPanelToRemove) { UIComponent uiPanelToRemove = panelBusinessConfigurationBody .findComponent(idPanelToRemove); panelBusinessConfigurationBody.getChildren().remove(uiPanelToRemove); for (HtmlPanelGroup panelSlAgreementBody : this.slAgreementIcaroTenantPanelBodyList .get(indexPanelToRemove)) { if (panelSlAgreementBody != null) { this.removePanelSlAgreementIcaroTenant(idPanelToRemove, panelSlAgreementBody.getId(), indexPanelToRemove, this.slAgreementIcaroTenantPanelBodyList.get(indexPanelToRemove) .indexOf(panelSlAgreementBody)); } } this.icaroTenantPanelBodyList.set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().set(indexPanelToRemove, null); this.indexITMonitorInfoList.set(indexPanelToRemove, null); this.indexITSlAgreementList.set(indexPanelToRemove, null); } public void removePanelIcaroServiceIcaroApplication( final String idPanelParent, final String panelToRemove, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.icaroApplicationPanelBodyList) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.icaroServicePanelBodyList.get(indexPanelParent).set( indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelParent) .getIcaroServiceList().set(indexPanelToRemove, null); this.indexIAISMonitorInfoList.get(indexPanelParent).set( indexPanelToRemove, null); this.indexIAISTcpPortList.get(indexPanelParent).set( indexPanelToRemove, null); this.indexIAISUdpPortList.get(indexPanelParent).set( indexPanelToRemove, null); } } this.countIAIcaroServiceList.set(indexPanelParent, this.countIAIcaroServiceList.get(indexPanelParent) - 1); controlForButtonCreateXML(); } public void removePanelMonitorInfoIcaroServiceIA( final String idPanelParent, final String panelToRemove, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.icaroServicePanelBodyList .get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGParent) .getIcaroServiceList().get(indexPanelParent) .getMonitorInfoList().set(indexPanelToRemove, null); } } } public void removePanelMonitorInfoIcaroTenant(final String idPanelParent, final String panelToRemove, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.icaroTenantPanelBodyList) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelParent) .getMonitorInfoList().set(indexPanelToRemove, null); } } } public void removePanelSlActionSlObjectiveSA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slObjectiveSlAgreementPanelBodyList .get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent) .getSlActionList().set(indexPanelToRemove, null); this.countSASOSlActionList.get(indexPanelGParent).set( indexPanelParent, this.countSASOSlActionList.get(indexPanelGParent).get( indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlActionSlObjectiveIASA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slObjectiveSlAgreementIAPanelBodyList .get(indexPanelGGParent).get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent) .getSlActionList().set(indexPanelToRemove, null); this.countIASASOSlActionList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countIASASOSlActionList .get(indexPanelGGParent) .get(indexPanelGParent) .get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlActionSlObjectiveITSA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slObjectiveSlAgreementITPanelBodyList .get(indexPanelGGParent).get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent) .getSlActionList().set(indexPanelToRemove, null); this.countITSASOSlActionList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countITSASOSlActionList .get(indexPanelGGParent) .get(indexPanelGParent) .get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlAgreement(final String idPanelToRemove, final Integer indexPanelToRemove) { UIComponent uiPanelToRemove = panelBusinessConfigurationBody .findComponent(idPanelToRemove); panelBusinessConfigurationBody.getChildren().remove(uiPanelToRemove); for (HtmlPanelGroup panelSlObjectiveBody : this.slObjectiveSlAgreementPanelBodyList.get(indexPanelToRemove)) { if (panelSlObjectiveBody != null) { this.removePanelSlObjectiveSlAgreement(idPanelToRemove, panelSlObjectiveBody.getId(), indexPanelToRemove, this.slObjectiveSlAgreementPanelBodyList.get(indexPanelToRemove) .indexOf(panelSlObjectiveBody)); } } this.slAgreementPanelBodyList.set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().set(indexPanelToRemove, null); this.indexSASlObjectiveList.set(indexPanelToRemove, null); this.countSlAgreement--; controlForButtonCreateXML(); } public void removePanelSlAgreementIcaroApplication( final String idPanelParent, final String panelToRemove, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.icaroApplicationPanelBodyList) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.slAgreementIcaroApplicationPanelBodyList.get( indexPanelParent).set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelParent) .getSlAgreementList().set(indexPanelToRemove, null); this.indexIASASlObjectiveList.get(indexPanelParent).set( indexPanelToRemove, null); this.countIASlAgreementList.set(indexPanelParent, this.countIASlAgreementList.get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlAgreementIcaroTenant(final String idPanelParent, final String panelToRemove, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.icaroTenantPanelBodyList) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.slAgreementIcaroTenantPanelBodyList.get(indexPanelParent) .set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelParent) .getSlAgreementList().set(indexPanelToRemove, null); this.indexITSASlObjectiveList.get(indexPanelParent).set( indexPanelToRemove, null); this.countITSlAgreementList.set(indexPanelParent, this.countITSlAgreementList.get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlMetricSlObjectiveSA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slObjectiveSlAgreementPanelBodyList .get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent) .getSlMetricList().set(indexPanelToRemove, null); this.countSASOSlMetricList.get(indexPanelGParent).set( indexPanelParent, this.countSASOSlMetricList.get(indexPanelGParent).get( indexPanelParent) + 1); } } controlForButtonCreateXML(); } public void removePanelSlMetricSlObjectiveIASA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slObjectiveSlAgreementIAPanelBodyList .get(indexPanelGGParent).get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent) .getSlMetricList().set(indexPanelToRemove, null); this.countIASASOSlMetricList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countIASASOSlMetricList .get(indexPanelGGParent) .get(indexPanelGParent) .get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlMetricSlObjectiveITSA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGGParent, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slObjectiveSlAgreementITPanelBodyList .get(indexPanelGGParent).get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelGGParent) .getSlAgreementList().get(indexPanelGParent) .getSlObjectiveList().get(indexPanelParent) .getSlMetricList().set(indexPanelToRemove, null); this.countITSASOSlMetricList .get(indexPanelGGParent) .get(indexPanelGParent) .set(indexPanelParent, this.countITSASOSlMetricList .get(indexPanelGGParent) .get(indexPanelGParent) .get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlObjectiveSlAgreement(final String idPanelParent, final String panelToRemove, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slAgreementPanelBodyList) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.slObjectiveSlAgreementPanelBodyList.get(indexPanelParent) .set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getSlAgreementList().get(indexPanelParent) .getSlObjectiveList().set(indexPanelToRemove, null); this.indexSASOSlActionList.get(indexPanelParent).set( indexPanelToRemove, null); this.indexSASOSlMetricList.get(indexPanelParent).set( indexPanelToRemove, null); this.countSASlObjectiveList.set(indexPanelParent, this.countSASlObjectiveList.get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlObjectiveSlAgreementIA(final String idPanelParent, final String panelToRemove, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slAgreementIcaroApplicationPanelBodyList .get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.slObjectiveSlAgreementIAPanelBodyList .get(indexPanelGParent).get(indexPanelParent) .set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroApplicationList().get(indexPanelGParent) .getSlAgreementList().get(indexPanelParent) .getSlObjectiveList().set(indexPanelToRemove, null); this.indexIASASOSlActionList.get(indexPanelGParent) .get(indexPanelParent).set(indexPanelToRemove, null); this.indexIASASOSlMetricList.get(indexPanelGParent) .get(indexPanelParent).set(indexPanelToRemove, null); this.countIASASlObjectiveList.get(indexPanelGParent).set( indexPanelParent, this.countIASASlObjectiveList.get(indexPanelGParent) .get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void removePanelSlObjectiveSlAgreementIT(final String idPanelParent, final String panelToRemove, final Integer indexPanelGParent, final Integer indexPanelParent, final Integer indexPanelToRemove) { for (HtmlPanelGroup panelParentContainer : this.slAgreementIcaroTenantPanelBodyList .get(indexPanelGParent)) { if (panelParentContainer != null && panelParentContainer.getId().equals(idPanelParent)) { panelParentContainer.getChildren().remove( panelParentContainer.findComponent(panelToRemove)); this.slObjectiveSlAgreementITPanelBodyList .get(indexPanelGParent).get(indexPanelParent) .set(indexPanelToRemove, null); this.businessConfigurationController.getBusinessConfiguration() .getIcaroTenantList().get(indexPanelGParent) .getSlAgreementList().get(indexPanelParent) .getSlObjectiveList().set(indexPanelToRemove, null); this.indexITSASOSlActionList.get(indexPanelGParent) .get(indexPanelParent).set(indexPanelToRemove, null); this.indexITSASOSlMetricList.get(indexPanelGParent) .get(indexPanelParent).set(indexPanelToRemove, null); this.countITSASlObjectiveList.get(indexPanelGParent).set( indexPanelParent, this.countITSASlObjectiveList.get(indexPanelGParent) .get(indexPanelParent) - 1); } } controlForButtonCreateXML(); } public void setButtonCreateXML(final boolean buttonCreateXML) { this.buttonCreateXML = buttonCreateXML; } public void setPanelBusinessConfigurationBody( final HtmlPanelGroup panelBusinessConfigurationBody) { this.panelBusinessConfigurationBody = panelBusinessConfigurationBody; } public void setPanelIAIcaroServiceBodyList( final List<List<HtmlPanelGroup>> panelIAIcaroServiceBodyList) { this.icaroServicePanelBodyList = panelIAIcaroServiceBodyList; } public void setPanelIASASlObjectiveBodyList( final List<List<List<HtmlPanelGroup>>> panelIASASlObjectiveBodyList) { this.slObjectiveSlAgreementIAPanelBodyList = panelIASASlObjectiveBodyList; } public void setPanelIASlAgreementBodyList( final List<List<HtmlPanelGroup>> panelIASlAgreementBodyList) { this.slAgreementIcaroApplicationPanelBodyList = panelIASlAgreementBodyList; } public void setPanelIcaroApplicationBodyList( final List<HtmlPanelGroup> panelIcaroApplicationBodyList) { this.icaroApplicationPanelBodyList = panelIcaroApplicationBodyList; } public void setPanelIcaroTenantBodyList( final List<HtmlPanelGroup> panelIcaroTenantBodyList) { this.icaroTenantPanelBodyList = panelIcaroTenantBodyList; } public void setPanelITSASlObjectiveBodyList( final List<List<List<HtmlPanelGroup>>> panelITSASlObjectiveBodyList) { this.slObjectiveSlAgreementITPanelBodyList = panelITSASlObjectiveBodyList; } public void setPanelITSlAgreementBodyList( final List<List<HtmlPanelGroup>> panelITSlAgreementBodyList) { this.slAgreementIcaroTenantPanelBodyList = panelITSlAgreementBodyList; } public void setPanelSASlObjectiveBodyList( final List<List<HtmlPanelGroup>> panelSASlObjectiveBodyList) { this.slObjectiveSlAgreementPanelBodyList = panelSASlObjectiveBodyList; } public void setPanelSlAgreementBodyList( final List<HtmlPanelGroup> panelSlAgreementBodyList) { this.slAgreementPanelBodyList = panelSlAgreementBodyList; } }
disit/iclos
src/org/cloudsimulator/viewer/BusinessConfigurationViewer.java
Java
gpl-2.0
85,689
/* * Minimal debug/trace/assert driver definitions for * Broadcom 802.11 Networking Adapter. * * Copyright (C) 1999-2011, Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2 (the "GPL"), * available at http://www.broadcom.com/licenses/GPLv2.php, with the * following added to such license: * * As a special exception, the copyright holders of this software give you * permission to link this software with independent modules, and to copy and * distribute the resulting executable under terms of your choice, provided that * you also meet, for each linked independent module, the terms and conditions of * the license of that module. An independent module is a module which is not * derived from this software. The special exception does not apply to any * modifications of the software. * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * * $Id: wl_dbg.h,v 1.115.6.3 2010-12-15 21:42:23 Exp $ */ #ifndef _wl_dbg_h_ #define _wl_dbg_h_ extern uint32 wl_msg_level; extern uint32 wl_msg_level2; #define WL_PRINT(args) printf args #define WL_NONE(args) #define WL_ERROR(args) #define WL_TRACE(args) printf args extern uint32 wl_msg_level; extern uint32 wl_msg_level2; #endif
devil1437/GalaxyNexusKernel
drivers/net/wireless/bcmdhd/wl_dbg.h
C
gpl-2.0
1,594
#from .engine import CheckVersion, CreateVersion from .versioner import DBVersioner, DBVersionCommander
sim1234/Versioning
py_versioning/db/__init__.py
Python
gpl-2.0
103
/* FreeRTOS V9.0.1 - Copyright (C) 2017 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS 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. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* Standard includes. */ #include <string.h> /* Scheduler includes. */ #include "FreeRTOS.h" #include "task.h" #include "semphr.h" /* uip includes. */ #include "uip.h" #include "uip_arp.h" #include "httpd.h" #include "timer.h" #include "clock-arch.h" #include "timer.h" /* Demo includes. */ #include "FEC.h" #include "partest.h" /*-----------------------------------------------------------*/ /* Shortcut to the header within the Rx buffer. */ #define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ]) /*-----------------------------------------------------------*/ /* * Port functions required by the uIP stack. */ clock_time_t clock_time( void ); /*-----------------------------------------------------------*/ /* The semaphore used by the ISR to wake the uIP task. */ extern SemaphoreHandle_t xFECSemaphore; /*-----------------------------------------------------------*/ clock_time_t clock_time( void ) { return xTaskGetTickCount(); } void vuIP_Task( void *pvParameters ) { portBASE_TYPE i; uip_ipaddr_t xIPAddr; struct timer periodic_timer, arp_timer; extern void ( vEMAC_ISR )( void ); /* Just to get rid of the compiler warning. */ ( void ) pvParameters; /* Enable/Reset the Ethernet Controller */ /* Create the semaphore used by the ISR to wake this task. */ vSemaphoreCreateBinary( xFECSemaphore ); /* Initialise the uIP stack. */ timer_set( &periodic_timer, configTICK_RATE_HZ / 2 ); timer_set( &arp_timer, configTICK_RATE_HZ * 10 ); uip_init(); uip_ipaddr( xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 ); uip_sethostaddr( xIPAddr ); uip_ipaddr( xIPAddr, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 ); uip_setnetmask( xIPAddr ); httpd_init(); vInitFEC(); for( ;; ) { /* Is there received data ready to be processed? */ uip_len = ( unsigned short ) ulFECRx(); if( ( uip_len > 0 ) && ( uip_buf != NULL ) ) { /* Standard uIP loop taken from the uIP manual. */ if( xHeader->type == htons( UIP_ETHTYPE_IP ) ) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if( uip_len > 0 ) { uip_arp_out(); vFECTx(); } } else if( xHeader->type == htons( UIP_ETHTYPE_ARP ) ) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if( uip_len > 0 ) { vFECTx(); } } } else { if( ( timer_expired( &periodic_timer ) ) && ( uip_buf != NULL ) ) { timer_reset( &periodic_timer ); for( i = 0; i < UIP_CONNS; i++ ) { uip_periodic( i ); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if( uip_len > 0 ) { uip_arp_out(); vFECTx(); } } /* Call the ARP timer function every 10 seconds. */ if( timer_expired( &arp_timer ) ) { timer_reset( &arp_timer ); uip_arp_timer(); } } else { /* We did not receive a packet, and there was no periodic processing to perform. Block for a fixed period. If a packet is received during this period we will be woken by the ISR giving us the Semaphore. */ xSemaphoreTake( xFECSemaphore, configTICK_RATE_HZ / 2 ); } } } } /*-----------------------------------------------------------*/ void vApplicationProcessFormInput( char *pcInputString, portBASE_TYPE xInputLength ) { char *c; /* Just to get rid of the compiler warning - other ports/demos use the parameter. */ ( void ) xInputLength; /* Process the form input sent by the IO page of the served HTML. */ c = strstr( pcInputString, "?" ); if( c ) { /* Turn LED's on or off in accordance with the check box status. */ if( strstr( c, "LED3=1" ) != NULL ) { /* Turn LED 3 on. */ vParTestSetLED( 3, 1 ); } else { /* Turn LED 3 off. */ vParTestSetLED( 3, 0 ); } } }
robbie-cao/FreeRTOS
FreeRTOS/Demo/ColdFire_MCF51CN128_CodeWarrior/Sources/httpd/uIP_Task.c
C
gpl-2.0
8,232
<?php /* * This file is part of Double Choco Latte. * Copyright (C) 1999-2004 Free Software Foundation * * Double Choco Latte is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * Double Choco Latte 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. * * Select License Info from the Help menu to view the terms and conditions of this license. */ $GLOBALS['phpgw_baseline']['dcl_product_build_sccs'] = array( 'fd' => array( 'product_build_id' => array('type' => 'int', 'precision' => 4, 'nullable' => false), 'sccs_xref_id' => array('type' => 'int', 'precision' => 4, 'nullable' => false) ), 'pk' => array('product_build_id', 'sccs_xref_id'), 'fk' => array(), 'ix' => array(), 'uc' => array() ); ?>
gnuedcl/dcl
dcl/schema/schema.dcl_product_build_sccs.php
PHP
gpl-2.0
1,297
package pl.noname.stacjabenzynowa.persistance; import java.io.Serializable; import java.math.BigDecimal; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table(name="refueling_types") public class RefuelingType implements Serializable { private static final long serialVersionUID = -8927404522577960299L; @Id @Column(name="REFTk_1_Id", columnDefinition="serial") @GeneratedValue(strategy=GenerationType.AUTO) private Integer id; @Column(name="REFT_Name", length=50, unique=false, nullable=false) private String name; @Column(name="REFT_Cost", precision=5, scale=2, unique=false, nullable=false) private BigDecimal cost; @Column(name="REFT_LoyalityPoints", nullable=false) private Integer loyalityPoints; @OneToMany(targetEntity=pl.noname.stacjabenzynowa.persistance.Refueling.class, mappedBy="refuelingType") private Set<Refueling> refueling; /* ----------------------------------------------------------- */ public RefuelingType(String name, BigDecimal cost, Integer loyalityPoints) { this.name = name; this.cost = cost; this.loyalityPoints = loyalityPoints; } public RefuelingType() {} /* ----------------------------------------------------------- */ public Integer getId() { return id; } public Integer getLoyalityPoints() { return loyalityPoints; } public void setLoyalityPoints(Integer loyalityPoints) { this.loyalityPoints = loyalityPoints; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public BigDecimal getCost() { return cost; } public void setCost(BigDecimal cost) { this.cost = cost; } public Set<Refueling> getRefueling() { return refueling; } public void setRefueling(Set<Refueling> refueling) { this.refueling = refueling; } }
deallas/Gas-station
src/main/java/pl/noname/stacjabenzynowa/persistance/RefuelingType.java
Java
gpl-2.0
2,073
package top.ningg.spring.config; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Created by guoning on 15/9/20. */ // 注解的保留时间: 运行时 @Retention(value = RetentionPolicy.RUNTIME) // 使用注解的目标类型: 方法 @Target(value = ElementType.METHOD) // 定义注解 public @interface NeedTest { // 定义属性 boolean value() default true; }
ningg/SpringLearn
src/main/java/top/ningg/spring/config/NeedTest.java
Java
gpl-2.0
496
/** * @created on : 28-jul-2017, 10:48:09 * @see * @since * @version * @author Raul Vela Salas */ package java_ejemplo_numerosuerte; import java.util.Calendar; import java.util.Scanner; public class T3__20_NumeroDeLaSuerte { private static int dia; private static int mes; private static int anio; private static int totalFecha; public static int dia() { Scanner sc = new Scanner(System.in); System.out.println("• Introduce un día : "); dia = sc.nextInt(); do { if (dia <= 0 || dia > 31) { System.out.println("♦ Dia incorrecto : " + dia + " -> Vuelve a intro otro numero"); } else { return dia; } System.out.println("♦ Introduce un día correcto : "); dia = sc.nextInt(); } while (dia <= 0 || dia > 31); return dia; } public static int mes() { Scanner sc = new Scanner(System.in); System.out.println("• Introduce un mes : "); mes = sc.nextInt(); do { if (mes <= 0 || mes > 12) { System.out.println("♦ Mes incorrecto : " + mes + " -> Vuelve a intro otro numero"); } else { return mes; } System.out.println("♦ Introduce un mes correcto : "); mes = sc.nextInt(); } while (mes <= 0 || mes > 12); return mes; } public static int anios() { Scanner sc = new Scanner(System.in); System.out.println("• Introduce un anio : "); anio = sc.nextInt(); do { if (anio < 1917 || anio > anioActual()) { System.out.println("♦ Anio incorrecto : " + anio + " -> Vuelve a intro otro numero"); } else { return anio; } System.out.println("♦ Introduce un anio correcto : "); anio = sc.nextInt(); } while (anio <= 1900 || anio > anioActual()); return anio; } public static int dividirFechaTotal() { // int fecha = totalFecha; int primeraCifra = 1599; int restoPrimeraCifra = primeraCifra; int segundaCifra = restoPrimeraCifra; int restosegundaCifra = segundaCifra; int terceraCifra = restosegundaCifra; int restoTerceraCifra = terceraCifra; int cuartaCifra = restoTerceraCifra; int restoCuartaCifra = cuartaCifra; primeraCifra = primeraCifra / 1000; System.out.println("- Primera cifra : " + primeraCifra); restoPrimeraCifra %= 1000; System.out.println("Resto Primera cifra : " + restoPrimeraCifra); segundaCifra = restoPrimeraCifra / 100; System.out.println("- Segunda cifra : " + segundaCifra); restosegundaCifra %= 100; System.out.println("Resto Segunda cifra: " + restosegundaCifra); restoTerceraCifra = restosegundaCifra / 10; System.out.println("- Tercera cifra : " + restoTerceraCifra); restoTerceraCifra %= 10; System.out.println("Resto Tercera cifra : " + restoTerceraCifra); restoCuartaCifra = restoTerceraCifra / 1; System.out.println("- Cuarta cifra : " + restoCuartaCifra); restoCuartaCifra %= 10; System.out.println("Resto Cuarta cifra : " + restoCuartaCifra); return 0; } public static int anioActual() { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); return year; } public static int totalFecha() { totalFecha = dia + mes + anio; return totalFecha; } // 3 metodos // public int public static void main(String[] args) { System.out.println("dia : " + dia()); System.out.println("mes : " + mes()); System.out.println("anio : " + anios()); System.out.println("------------------"); System.out.println("Dia introducido : " + dia); System.out.println("Mes introducido : " + mes); System.out.println("Anio introducido : " + anio); System.out.println("------------------------"); System.out.println("Division : " + dividirFechaTotal()); } }
NoTengoNombre/Java_ActualizarConocimientos
Java_Ejemplos/src/java_ejemplo_numerosuerte/T3__20_NumeroDeLaSuerte.java
Java
gpl-2.0
4,215
<?php class NbcController extends ApplicationController { /** * Inicializa el Controlador Login * */ public function initialize() { $this->setTemplateAfter("adminiziolite"); } /** * Index por defecto del Controlador * */ public function indexAction(){ } /** * Aqui sale el formulario de Iniciar Sesión * */ public function not_found($controller, $action){ $this->set_response('view'); Flash::error("No esta definida la accion $action, redireccionando"); return $this->redirect('administrador'); } /** * Esta accion es ejecutada por application/before_filter en caso * de que el usuario trate de entrar a una accion a la cual * no tiene permiso * */ public function no_accesoAction(){ $this->set_response('view'); Flash::error("No esta definida la accion $action, redireccionando"); return $this->redirect('administrador'); } /**** agregarAction vista en la cual se mostrara el formulario para agregar clientes ***/ public function agregarAction(){ } public function addAction(){ $this->setResponse('view'); $sw=0; $ies = new TblNbc(); //if($ies->count("Cod_NBC = '".$_REQUEST['codigo_nbc']."' ")>0){ $sw=1; Flash::error("Codigo ya Existe.."); } if($sw==0){ $id = $_REQUEST['codigo_nbc']; if($id==''){ $id=0; } $ies->setCodNBC($id); $ies->setDescripcionNBC($_REQUEST['nombre_nbc']); if($ies->save()){ Flash::success(strtoupper(Router::getController())." Guardada Satisfactoriamente"); echo "<script>quitar_mensajes();</script>"; }else{ Flash::error("Error: No se pudo Guardar el registro..."); foreach($ies->getMessages() as $message){ Flash::error($message->getMessage()); } } } } /* * Vista trae formulario de modificacion */ public function modificarAction($id){ //$this->setResponse("ajax"); if( isset($id) ){ $codigo_nbc = $id; $ies = $this->TblNbc->findFirst(" Cod_NBC = '$codigo_nbc' "); Tag::displayTo("codigo_nbc",$ies->getCodNBC()); Tag::displayTo("nombre_nbc",$ies->getDescripcionNBC()); }else{ Flash::error("Parametro Incorrecto Volver a Buscar Ies para modificar."); } } /* * modifica datos de las ies */ public function updateAction(){ $this->setResponse('view'); $sw=0; $ies = new TblNbc(); //if($ies->count("Cod_NBC = '".$_REQUEST['codigo_nbc']."' ")>0){ $sw=1; Flash::error("Codigo ya Existe.."); } $ies->setCodNBC($_REQUEST['codigo_nbc']); $ies->setDescripcionNBC($_REQUEST['nombre_nbc']); if($sw==0){ if($ies->save()){ Flash::success(strtoupper(Router::getController())." Modificado Satisfactoriamente"); echo "<script>quitar_mensajes();</script>"; }else{ Flash::error("Error: No se pudo Guardar el registro..."); foreach($ies->getMessages() as $message){ Flash::error($message->getMessage()); } } } } /* * Vista trae formulario de modificacion */ public function eliminarAction($id){ //$this->setResponse("ajax"); if( isset($id) ){ $codigo_nbc = $id; $ies = $this->TblNbc->findFirst(" Cod_NBC = '$codigo_nbc' "); Tag::displayTo("codigo_nbc",$ies->getCodNBC()); Tag::displayTo("nombre_nbc",$ies->getDescripcionNBC()); }else{ Flash::error("Parametro Incorrecto Volver a Buscar ".strtoupper(Router::getController())." para modificar."); } } public function deleteAction(){ $this->setResponse('view'); $ies = new TblNbc(); try{ if($ies->delete(" Cod_NBC = '".$_REQUEST["codigo_nbc"]."' ")){ Flash::success(strtoupper(Router::getController())." Eliminada Satisfactoriamente"); echo "<script>quitar_mensajes();</script>"; }else{ Flash::error("Error: No se pudo Eliminar ."); foreach($ies->getMessages() as $message){ Flash::error("Error Eliminando Ies ".$message->getMessage()); } } }catch(DbContraintViolationException $e){ Flash::error($e->getMessage()); //Flash::error("NO SE PUEDE BORRAR PRODUCTO"); }catch(DbException $e){ //Flash::error($e->getMessage()); Flash::error("NO SE PUEDE BORRAR ESTE REGISTRO: viola restriccion de llave foranea"); }catch(TransactionFailed $e){ Flash::error($e->getMessage()); //print_r($e); //cierre cacth try } } public function find_buscarAction(){ $this->setResponse("ajax"); } public function find_detalle_buscarAction(){ $this->setResponse("ajax"); } public function buscarAction(){ //$this->setResponse("ajax"); } public function detalle_buscarAction(){ //$this->setResponse("ajax"); } public function onException($e){ if($e instanceof DispatcherException){ if($e->getCode()==Dispatcher::NOT_FOUND_ACTION){ Flash::notice("Lo sentimos la página no existe"); Router::routeTo("controller: home", "action: error"); } if($e->getCode()==Dispatcher::NOT_FOUND_CONTROLLER){ Flash::notice("Lo sentimos la Controlador no existe"); Router::routeTo("controller: home", "action: error"); } if($e->getCode()==Dispatcher::NOT_FOUND_FILE_CONTROLLER){ Flash::notice("Lo sentimos la Archivo no existe"); Router::routeTo("controller: home", "action: error"); } if($e->getCode()==Dispatcher::NOT_FOUND_INIT_ACTION){ Flash::notice("Lo sentimos la Init no existe"); Router::routeTo("controller: home", "action: error"); } if($e->getCode()==Dispacher::INVALID_METHOD_CALLBACK){ Flash::notice("Lo sentimos la Metodo no existe"); Router::routeTo("controller: home", "action: error"); } if($e->getCode()==Dispatcher::INVALID_ACTION_VALUE_PARAMETER){ Flash::notice("Lo sentimos la parametros no existe"); Router::routeTo("controller: home", "action: error"); } } else { //Se relanza la excepción throw $e; Router::routeTo("controller: home", "action: error"); } } public function notFoundAction($actionName=''){ $logger = new Logger("File", "notFoundReports.txt"); $logger->log("No se encontró la acción $actionName"); } } ?>
softdesignermonteria/proyecto
apps/default/controllers/nbc_controller.php
PHP
gpl-2.0
6,427
/* * Copyright (c) 2008 Marco Merli <yohji@marcomerli.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef NUMBER_H_ #define NUMBER_H_ #include <iostream> class Number { int integerNumber; long longNumber; float floatNumber; double doubleNumber; public: Number(); Number( int ); Number( long ); Number( float ); Number( double ); void logger(); }; #endif /*NUMBER_H_*/
yohji/cpplab
src/lib/Number.h
C
gpl-2.0
1,083