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
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.arrow.gandiva.evaluator; import java.util.ArrayList; import java.util.List; import org.apache.arrow.gandiva.exceptions.EvaluatorClosedException; import org.apache.arrow.gandiva.exceptions.GandivaException; import org.apache.arrow.gandiva.exceptions.UnsupportedTypeException; import org.apache.arrow.gandiva.expression.ArrowTypeHelper; import org.apache.arrow.gandiva.expression.ExpressionTree; import org.apache.arrow.gandiva.ipc.GandivaTypes; import org.apache.arrow.gandiva.ipc.GandivaTypes.SelectionVectorType; import org.apache.arrow.memory.ArrowBuf; import org.apache.arrow.vector.BaseVariableWidthVector; import org.apache.arrow.vector.FixedWidthVector; import org.apache.arrow.vector.ValueVector; import org.apache.arrow.vector.VariableWidthVector; import org.apache.arrow.vector.ipc.message.ArrowBuffer; import org.apache.arrow.vector.ipc.message.ArrowRecordBatch; import org.apache.arrow.vector.types.pojo.Schema; /** * This class provides a mechanism to evaluate a set of expressions against a RecordBatch. * Follow these steps to use this class: * 1) Use the static method make() to create an instance of this class that evaluates a * set of expressions * 2) Invoke the method evaluate() to evaluate these expressions against a RecordBatch * 3) Invoke close() to release resources */ public class Projector { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Projector.class); private JniWrapper wrapper; private final long moduleId; private final Schema schema; private final int numExprs; private boolean closed; private Projector(JniWrapper wrapper, long moduleId, Schema schema, int numExprs) { this.wrapper = wrapper; this.moduleId = moduleId; this.schema = schema; this.numExprs = numExprs; this.closed = false; } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ public static Projector make(Schema schema, List<ExpressionTree> exprs) throws GandivaException { return make(schema, exprs, SelectionVectorType.SV_NONE, JniLoader.getDefaultConfiguration()); } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * @param configOptions ConfigOptions parameter * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ public static Projector make(Schema schema, List<ExpressionTree> exprs, ConfigurationBuilder.ConfigOptions configOptions) throws GandivaException { return make(schema, exprs, SelectionVectorType.SV_NONE, JniLoader.getConfiguration(configOptions)); } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * @param optimize Flag to choose if the generated llvm code is to be optimized * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ @Deprecated public static Projector make(Schema schema, List<ExpressionTree> exprs, boolean optimize) throws GandivaException { return make(schema, exprs, SelectionVectorType.SV_NONE, JniLoader.getConfiguration((new ConfigurationBuilder.ConfigOptions()).withOptimize(optimize))); } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * @param selectionVectorType type of selection vector * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ public static Projector make(Schema schema, List<ExpressionTree> exprs, SelectionVectorType selectionVectorType) throws GandivaException { return make(schema, exprs, selectionVectorType, JniLoader.getDefaultConfiguration()); } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * @param selectionVectorType type of selection vector * @param configOptions ConfigOptions parameter * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ public static Projector make(Schema schema, List<ExpressionTree> exprs, SelectionVectorType selectionVectorType, ConfigurationBuilder.ConfigOptions configOptions) throws GandivaException { return make(schema, exprs, selectionVectorType, JniLoader.getConfiguration(configOptions)); } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * @param selectionVectorType type of selection vector * @param optimize Flag to choose if the generated llvm code is to be optimized * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ @Deprecated public static Projector make(Schema schema, List<ExpressionTree> exprs, SelectionVectorType selectionVectorType, boolean optimize) throws GandivaException { return make(schema, exprs, selectionVectorType, JniLoader.getConfiguration((new ConfigurationBuilder.ConfigOptions()).withOptimize(optimize))); } /** * Invoke this function to generate LLVM code to evaluate the list of project expressions. * Invoke Projector::Evaluate() against a RecordBatch to evaluate the record batch * against these projections. * * @param schema Table schema. The field names in the schema should match the fields used * to create the TreeNodes * @param exprs List of expressions to be evaluated against data * @param selectionVectorType type of selection vector * @param configurationId Custom configuration created through config builder. * * @return A native evaluator object that can be used to invoke these projections on a RecordBatch */ public static Projector make(Schema schema, List<ExpressionTree> exprs, SelectionVectorType selectionVectorType, long configurationId) throws GandivaException { // serialize the schema and the list of expressions as a protobuf GandivaTypes.ExpressionList.Builder builder = GandivaTypes.ExpressionList.newBuilder(); for (ExpressionTree expr : exprs) { builder.addExprs(expr.toProtobuf()); } // Invoke the JNI layer to create the LLVM module representing the expressions GandivaTypes.Schema schemaBuf = ArrowTypeHelper.arrowSchemaToProtobuf(schema); JniWrapper wrapper = JniLoader.getInstance().getWrapper(); long moduleId = wrapper.buildProjector(schemaBuf.toByteArray(), builder.build().toByteArray(), selectionVectorType.getNumber(), configurationId); logger.debug("Created module for the projector with id {}", moduleId); return new Projector(wrapper, moduleId, schema, exprs.size()); } /** * Invoke this function to evaluate a set of expressions against a recordBatch. * * @param recordBatch Record batch including the data * @param outColumns Result of applying the project on the data */ public void evaluate(ArrowRecordBatch recordBatch, List<ValueVector> outColumns) throws GandivaException { evaluate(recordBatch.getLength(), recordBatch.getBuffers(), recordBatch.getBuffersLayout(), SelectionVectorType.SV_NONE.getNumber(), recordBatch.getLength(), 0, 0, outColumns); } /** * Invoke this function to evaluate a set of expressions against a set of arrow buffers. * (this is an optimised version that skips taking references). * * @param numRows number of rows. * @param buffers List of input arrow buffers * @param outColumns Result of applying the project on the data */ public void evaluate(int numRows, List<ArrowBuf> buffers, List<ValueVector> outColumns) throws GandivaException { List<ArrowBuffer> buffersLayout = new ArrayList<>(); long offset = 0; for (ArrowBuf arrowBuf : buffers) { long size = arrowBuf.readableBytes(); buffersLayout.add(new ArrowBuffer(offset, size)); offset += size; } evaluate(numRows, buffers, buffersLayout, SelectionVectorType.SV_NONE.getNumber(), numRows, 0, 0, outColumns); } /** * Invoke this function to evaluate a set of expressions against a {@link ArrowRecordBatch}. * * @param recordBatch The data to evaluate against. * @param selectionVector Selection vector which stores the selected rows. * @param outColumns Result of applying the project on the data */ public void evaluate(ArrowRecordBatch recordBatch, SelectionVector selectionVector, List<ValueVector> outColumns) throws GandivaException { evaluate(recordBatch.getLength(), recordBatch.getBuffers(), recordBatch.getBuffersLayout(), selectionVector.getType().getNumber(), selectionVector.getRecordCount(), selectionVector.getBuffer().memoryAddress(), selectionVector.getBuffer().capacity(), outColumns); } /** * Invoke this function to evaluate a set of expressions against a set of arrow buffers * on the selected positions. * (this is an optimised version that skips taking references). * * @param numRows number of rows. * @param buffers List of input arrow buffers * @param selectionVector Selection vector which stores the selected rows. * @param outColumns Result of applying the project on the data */ public void evaluate(int numRows, List<ArrowBuf> buffers, SelectionVector selectionVector, List<ValueVector> outColumns) throws GandivaException { List<ArrowBuffer> buffersLayout = new ArrayList<>(); long offset = 0; for (ArrowBuf arrowBuf : buffers) { long size = arrowBuf.readableBytes(); buffersLayout.add(new ArrowBuffer(offset, size)); offset += size; } evaluate(numRows, buffers, buffersLayout, selectionVector.getType().getNumber(), selectionVector.getRecordCount(), selectionVector.getBuffer().memoryAddress(), selectionVector.getBuffer().capacity(), outColumns); } private void evaluate(int numRows, List<ArrowBuf> buffers, List<ArrowBuffer> buffersLayout, int selectionVectorType, int selectionVectorRecordCount, long selectionVectorAddr, long selectionVectorSize, List<ValueVector> outColumns) throws GandivaException { if (this.closed) { throw new EvaluatorClosedException(); } if (numExprs != outColumns.size()) { logger.info("Expected " + numExprs + " columns, got " + outColumns.size()); throw new GandivaException("Incorrect number of columns for the output vector"); } long[] bufAddrs = new long[buffers.size()]; long[] bufSizes = new long[buffers.size()]; int idx = 0; for (ArrowBuf buf : buffers) { bufAddrs[idx++] = buf.memoryAddress(); } idx = 0; for (ArrowBuffer bufLayout : buffersLayout) { bufSizes[idx++] = bufLayout.getSize(); } boolean hasVariableWidthColumns = false; BaseVariableWidthVector[] resizableVectors = new BaseVariableWidthVector[outColumns.size()]; long[] outAddrs = new long[3 * outColumns.size()]; long[] outSizes = new long[3 * outColumns.size()]; idx = 0; int outColumnIdx = 0; for (ValueVector valueVector : outColumns) { boolean isFixedWith = valueVector instanceof FixedWidthVector; boolean isVarWidth = valueVector instanceof VariableWidthVector; if (!isFixedWith && !isVarWidth) { throw new UnsupportedTypeException( "Unsupported value vector type " + valueVector.getField().getFieldType()); } outAddrs[idx] = valueVector.getValidityBuffer().memoryAddress(); outSizes[idx++] = valueVector.getValidityBuffer().capacity(); if (isVarWidth) { outAddrs[idx] = valueVector.getOffsetBuffer().memoryAddress(); outSizes[idx++] = valueVector.getOffsetBuffer().capacity(); hasVariableWidthColumns = true; // save vector to allow for resizing. resizableVectors[outColumnIdx] = (BaseVariableWidthVector) valueVector; } outAddrs[idx] = valueVector.getDataBuffer().memoryAddress(); outSizes[idx++] = valueVector.getDataBuffer().capacity(); valueVector.setValueCount(selectionVectorRecordCount); outColumnIdx++; } wrapper.evaluateProjector( hasVariableWidthColumns ? new VectorExpander(resizableVectors) : null, this.moduleId, numRows, bufAddrs, bufSizes, selectionVectorType, selectionVectorRecordCount, selectionVectorAddr, selectionVectorSize, outAddrs, outSizes); } /** * Closes the LLVM module representing this evaluator. */ public void close() throws GandivaException { if (this.closed) { return; } wrapper.closeProjector(this.moduleId); this.closed = true; } }
cpcloud/arrow
java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java
Java
apache-2.0
15,856
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.wordpress.api.model; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; /** * A named status for the object. */ @JacksonXmlRootElement(localName = "publishableStatus") public enum PublishableStatus { // @formatter:off publish, future, draft, pending, @JsonProperty("private") private_, trash, @JsonProperty("auto-draft") auto_draft, inherit, any; // @formatter:on /*** * @param arg * @return * @see <a href= "https://stackoverflow.com/questions/33357594/java-enum-case-insensitive-jersey-query-param-binding">Java: Enum case insensitive Jersey Query Param Binding</a> */ public static PublishableStatus fromString(String arg) { arg = "".concat(arg).toLowerCase(); if (!arg.isEmpty() && arg.startsWith("private")) { return private_; } if (!arg.isEmpty() && arg.startsWith("auto")) { return auto_draft; } return valueOf(arg); } }
davidkarlsen/camel
components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/api/model/PublishableStatus.java
Java
apache-2.0
1,877
/* * MemTuple * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "postgres.h" #include "access/memtup.h" #include "access/tupmacs.h" #include "access/transam.h" #include "access/tuptoaster.h" #include "catalog/pg_type.h" #include "cdb/cdbvars.h" #include "utils/debugbreak.h" #define MAX_ATTR_COUNT_STATIC_ALLOC 20 /* Memory tuple format: * 4 byte _mt_len, * highest bit always 1. (if 0, means it is a heaptuple). * bit 2-29th is memtuple length, in bytes. It is always 8 * bytes aligned. * bit 30 is unused. * bit 31 is set if the memtuple is longer than 64K. * bit 32 is if has null. * * Followed by optional 4 byte for Oid (depends on if mtbind_has_oid) * * Followed by optional null bitmaps. * * Align to bind.column_align, either 4 or 8. * * Non-Null attribute: * Fixed len Attributes. * The attributes are not in logical order. First we put 8 bytes * aligned native or native_ptr types. The 4 bytes aligned natives * then 2 bytes aligned and varlena, then 1 bytes aligned natives. * Varlena occupy 2bytes in the fixed len area. * * Varlena attributes. * * The end is again padded to 8 bytes aligned. * * Null attributes only occupy one bit in the nullbit map. The non null * attributes is located from the binding offset/len. If there is null attr, * we use the null_saves in the binding to figure out how many columns that is * physically precedes the attribute is null and how much space we have saved, * then we use off minus saved bytes to find the attribute. */ static inline int compute_null_bitmap_extra_size(TupleDesc tupdesc, int col_align) { int nbytes = (tupdesc->natts + 7) >> 3; int avail_bytes = (tupdesc->tdhasoid || col_align == 4) ? 0 : 4; Assert(col_align == 4 || col_align == 8); if (nbytes <= avail_bytes) return 0; return TYPEALIGN(col_align, (nbytes - avail_bytes)); } void destroy_memtuple_binding(MemTupleBinding *pbind) { Assert(pbind); if(pbind->bind.null_saves) pfree(pbind->bind.null_saves); if(pbind->bind.null_saves_aligned) pfree(pbind->bind.null_saves_aligned); if(pbind->bind.bindings) pfree(pbind->bind.bindings); if(pbind->large_bind.null_saves) pfree(pbind->large_bind.null_saves); if(pbind->large_bind.null_saves_aligned) pfree(pbind->large_bind.null_saves_aligned); if(pbind->large_bind.bindings) pfree(pbind->large_bind.bindings); pfree(pbind); } /* * Manage the space saved by not storing nulls. * Attr are rearranged in the order of 8 bytes aligned, then 4, * then 2, then 1. A bit in the null bitmap is set for each * null attribute. For all possible combinations of 4 null bit, * we index into a short[16] array to get how many space is saved * by the nulls. */ /* Compute how much space to store the null save entries. * The null save entries are stored in the binding, not per tuple. */ static inline uint32 compute_null_save_entries(int i) { return ((i+7)/8) * 32; } /* Add null save space into the entries */ static inline void add_null_save(short *null_save, int i, short sz) { short* first = null_save + ((i/4) * 16); unsigned int bit = 1 << (i%4); for(i=0; i<16; ++i) { if( (i & bit) != 0) first[i] += sz; } } /* * Sets the binding length according to the following binding's alignment. * Adds the aligned length into the array holding the space saved from null attributes. * Returns true if the binding length is aligned to the following binding's alignment. */ static inline bool add_null_save_aligned(MemTupleAttrBinding *bind, short *null_save_aligned, int i, char next_attr_align) { Assert(bind); Assert(bind->len > 0); Assert(null_save_aligned); Assert(i >= 0); bind->len_aligned = att_align(bind->len, next_attr_align); add_null_save(null_save_aligned, i, bind->len_aligned); return (bind->len == bind->len_aligned); } /* Compute how much bytes are saved by one byte in the null bit map */ static inline short compute_null_save_b(short *null_saves, unsigned char b) { unsigned int blow = (b & 0xF); unsigned int bhigh = (b >> 4); return null_saves[blow] + null_saves[16+bhigh]; } /* compute the null saved bytes by the whole null bit map, by the attribute * physically precedes the one. */ static inline int compute_null_save(short *null_saves, unsigned char *nullbitmaps, int nbyte, unsigned char nbit) { int ret = 0; int curr_byte = 0; while(curr_byte < nbyte) { ret += compute_null_save_b(null_saves, nullbitmaps[curr_byte]); null_saves += 32; ++curr_byte; } ret += compute_null_save_b(null_saves, (nullbitmaps[nbyte] & (nbit-1))); return ret; } #undef MEMTUPLE_INLINE_CHARTYPE /* Determine if an attr should be treated as offset_len in memtuple */ static inline bool att_bind_as_varoffset(Form_pg_attribute attr) { #ifdef MEMTUPLE_INLINE_CHARTYPE return (attr->attlen < 0 /* Varlen type */ && ( attr->atttypid != BPCHAROID /* Any varlen type except char(N) */ || attr->atttypmod <= 4 /* char(0)? ever happend? */ || attr->atttypmod >= 127 /* char(N) that cannot be shorted */ ) ); #else /* * XXX * As optimization, one want to make some char(X) type inline, which * will save 2 bytes. However, postgres tupdesc is totally messed up * the lenght of a (var)char(N) type (in typmod). It just get randomly * set to the right thing or -1. It is really stupid, but it just * took too much effort to fix everywhere. * * It is a shame. Disable this for now. */ return attr->attlen < 0; #endif } /* Create columns binding, depends on islarge, using 2 or 4 bytes for offset_len */ static void create_col_bind(MemTupleBindingCols *colbind, bool islarge, TupleDesc tupdesc, int col_align) { int i = 0; int physical_col = 0; int pass = 0; uint32 cur_offset = (tupdesc->tdhasoid || col_align == 8) ? 8 : 4; uint32 null_save_entries = compute_null_save_entries(tupdesc->natts); /* alloc null save entries. Zero it */ colbind->null_saves = (short *) palloc0(sizeof(short) * null_save_entries); colbind->null_saves_aligned = (short *) palloc0(sizeof(short) * null_save_entries); colbind->has_null_saves_alignment_mismatch = false; colbind->has_dropped_attr_alignment_mismatch = false; /* alloc bindings, no need to zero because we will fill them out */ colbind->bindings = (MemTupleAttrBinding *) palloc(sizeof(MemTupleAttrBinding) * tupdesc->natts); /* * The length of each binding is determined according to the alignment * of the physically following binding. Use this pointer to keep track * of the previously processed binding. */ MemTupleAttrBinding *previous_bind = NULL; /* * First pass, do 8 bytes aligned, native type. * Sencond pass, do 4 bytes aligned, native type. * Third pass, do 2 bytes aligned, native type. * Finall, do 1 bytes aligned native type. * * depends on islarge, varlena types are either handled in the * second pass (is large, varoffset using 4 bytes), or in the * third pass (not large, varoffset using 2 bytes). */ for(pass =0; pass < 4; ++pass) { for(i=0; i<tupdesc->natts; ++i) { Form_pg_attribute attr = tupdesc->attrs[i]; MemTupleAttrBinding *bind = &colbind->bindings[i]; if(pass == 0 && attr->attlen > 0 && attr->attalign == 'd') { bind->offset = att_align(cur_offset, attr->attalign); bind->len = attr->attlen; add_null_save(colbind->null_saves, physical_col, attr->attlen); if (physical_col) { /* Set the aligned length of the previous binding according to current alignment. */ if (add_null_save_aligned(previous_bind, colbind->null_saves_aligned, physical_col - 1, 'd')) { colbind->has_null_saves_alignment_mismatch = true; if (attr->attisdropped) { colbind->has_dropped_attr_alignment_mismatch = true; } } } bind->flag = attr->attbyval ? MTB_ByVal_Native : MTB_ByVal_Ptr; bind->null_byte = physical_col >> 3; bind->null_mask = 1 << (physical_col-(bind->null_byte << 3)); physical_col += 1; cur_offset = bind->offset + bind->len; previous_bind = bind; } else if (pass == 1 &&( (attr->attlen > 0 && attr->attalign == 'i') || ( islarge && att_bind_as_varoffset(attr)) ) ) { bind->offset = att_align(cur_offset, 'i'); bind->len = attr->attlen > 0 ? attr->attlen : 4; add_null_save(colbind->null_saves, physical_col, bind->len); if (physical_col) { /* Set the aligned length of the previous binding according to current alignment. */ if (add_null_save_aligned(previous_bind, colbind->null_saves_aligned, physical_col - 1, 'i')) { colbind->has_null_saves_alignment_mismatch = true; if (attr->attisdropped) { colbind->has_dropped_attr_alignment_mismatch = true; } } } if(attr->attlen > 0) bind->flag = attr->attbyval ? MTB_ByVal_Native : MTB_ByVal_Ptr; else if(attr->attlen == -1) bind->flag = MTB_ByRef; else { Assert(attr->attlen == -2); bind->flag = MTB_ByRef_CStr; } bind->null_byte = physical_col >> 3; bind->null_mask = 1 << (physical_col-(bind->null_byte << 3)); physical_col += 1; cur_offset = bind->offset + bind->len; previous_bind = bind; } else if (pass == 2 && ( (attr->attlen > 0 && attr->attalign == 's') || ( !islarge && att_bind_as_varoffset(attr)) ) ) { bind->offset = att_align(cur_offset, 's'); bind->len = attr->attlen > 0 ? attr->attlen : 2; add_null_save(colbind->null_saves, physical_col, bind->len); if (physical_col) { /* Set the aligned length of the previous binding according to current alignment. */ if (add_null_save_aligned(previous_bind, colbind->null_saves_aligned, physical_col - 1, 's')) { colbind->has_null_saves_alignment_mismatch = true; if (attr->attisdropped) { colbind->has_dropped_attr_alignment_mismatch = true; } } } if(attr->attlen > 0) bind->flag = attr->attbyval ? MTB_ByVal_Native : MTB_ByVal_Ptr; else if(attr->attlen == -1) bind->flag = MTB_ByRef; else { Assert(attr->attlen == -2); bind->flag = MTB_ByRef_CStr; } bind->null_byte = physical_col >> 3; bind->null_mask = 1 << (physical_col-(bind->null_byte << 3)); physical_col += 1; cur_offset = bind->offset + bind->len; previous_bind = bind; } else if (pass == 3 && ( (attr->attlen > 0 && attr->attalign == 'c') || (attr->attlen < 0 && !att_bind_as_varoffset(attr)) ) ) { bind->offset = att_align(cur_offset, 'c'); #ifdef MEMTUPLE_INLINE_CHARTYPE /* Inline CHAR(N) disabled. See att_bind_as_varoffset */ bind->len = attr->attlen > 0 ? attr->attlen : (attr->atttypmod - 3); #else bind->len = attr->attlen; #endif add_null_save(colbind->null_saves, physical_col, 1); if (physical_col) { /* Set the aligned length of the previous binding according to current alignment. */ if (add_null_save_aligned(previous_bind, colbind->null_saves_aligned, physical_col - 1, 'c')) { colbind->has_null_saves_alignment_mismatch = true; if (attr->attisdropped) { colbind->has_dropped_attr_alignment_mismatch = true; } } } if(attr->attlen > 0 && attr->attbyval) bind->flag = MTB_ByVal_Native; else bind->flag = MTB_ByVal_Ptr; bind->null_byte = physical_col >> 3; bind->null_mask = 1 << (physical_col-(bind->null_byte << 3)); physical_col += 1; cur_offset = bind->offset + bind->len; previous_bind = bind; } } } if (physical_col) { /* No extra alignment required for the last binding */ add_null_save_aligned(previous_bind, colbind->null_saves_aligned, physical_col - 1, 'c'); } if (!colbind->has_null_saves_alignment_mismatch) { pfree(colbind->null_saves); colbind->null_saves = NULL; } #ifdef USE_DEBUG_ASSERT for(i=0; i<tupdesc->natts; ++i) { MemTupleAttrBinding *bind = &colbind->bindings[i]; Assert(bind->offset[i] != 0); } #endif if(tupdesc->natts != 0) colbind->var_start = cur_offset; else colbind->var_start = 8; Assert(tupdesc->natts == physical_col); } /* Create a memtuple binding from the tupdesc. Note we store * a ref to the tupdesc in the binding, so we assumed the life * span of the tupdesc is no shorter than the binding. */ MemTupleBinding *create_memtuple_binding(TupleDesc tupdesc) { MemTupleBinding *pbind = (MemTupleBinding *) palloc(sizeof(MemTupleBinding)); int i = 0; pbind->tupdesc = tupdesc; pbind->column_align = 4; for(i=0; i<tupdesc->natts; ++i) { Form_pg_attribute attr = tupdesc->attrs[i]; if(attr->attlen > 0 && attr->attalign == 'd') pbind->column_align = 8; } pbind->null_bitmap_extra_size = compute_null_bitmap_extra_size(tupdesc, pbind->column_align); create_col_bind(&pbind->bind, false, tupdesc, pbind->column_align); create_col_bind(&pbind->large_bind, true, tupdesc, pbind->column_align); return pbind; } static uint32 compute_memtuple_size_using_bind( Datum *values, bool *isnull, bool hasnull, int nullbit_extra, uint32 *nullsaves, MemTupleBindingCols *colbind, TupleDesc tupdesc, bool use_null_saves_aligned) { uint32 data_length = colbind->var_start; int i; *nullsaves = 0; if(hasnull) { data_length += nullbit_extra; for(i=0; i<tupdesc->natts; ++i) { if(isnull[i]) { MemTupleAttrBinding *bind = &colbind->bindings[i]; int len = 0; Assert(bind->len >= 0); Assert(bind->len_aligned >= 0); Assert(bind->len_aligned >= bind->len); if (use_null_saves_aligned) { len = bind->len_aligned; } else { len = bind->len; } *nullsaves += len; data_length -= len; } } } for(i=0; i<tupdesc->natts; ++i) { MemTupleAttrBinding *bind = &colbind->bindings[i]; Form_pg_attribute attr = tupdesc->attrs[i]; if(isnull[i] || bind->flag == MTB_ByVal_Native || bind->flag == MTB_ByVal_Ptr) continue; /* Varlen stuff */ /* We plan to convert to short varlena even if it is not currently */ if(bind->flag == MTB_ByRef && value_type_could_short(values[i], attr->atttypid)) { data_length += VARSIZE_ANY_EXHDR_D(values[i]) + VARHDRSZ_SHORT; } else { data_length = att_align(data_length, attr->attalign); data_length = att_addlength(data_length, attr->attlen, values[i]); } } return MEMTUP_ALIGN(data_length); } /* Compute the memtuple size. * nullsave is an output param */ uint32 compute_memtuple_size(MemTupleBinding *pbind, Datum *values, bool *isnull, bool hasnull, uint32 *nullsaves, bool use_null_saves_aligned) { uint32 ret_len = 0; ret_len = compute_memtuple_size_using_bind(values, isnull, hasnull, pbind->null_bitmap_extra_size, nullsaves, &pbind->bind, pbind->tupdesc, use_null_saves_aligned); if(ret_len <= MEMTUPLE_LEN_FITSHORT) return ret_len; ret_len = compute_memtuple_size_using_bind(values, isnull, hasnull, pbind->null_bitmap_extra_size, nullsaves, &pbind->large_bind, pbind->tupdesc, use_null_saves_aligned); Assert(ret_len > MEMTUPLE_LEN_FITSHORT); return ret_len; } static inline char* memtuple_get_attr_ptr(char *start, MemTupleAttrBinding *bind, short *null_saves, unsigned char *nullp) { int ns = 0; if(nullp) ns = compute_null_save(null_saves, nullp, bind->null_byte, bind->null_mask); return start + bind->offset - ns; } static inline char* memtuple_get_attr_data_ptr(char *start, MemTupleAttrBinding *bind, short *null_saves, unsigned char* nullp) { if(bind->flag == MTB_ByVal_Native || bind->flag == MTB_ByVal_Ptr) return memtuple_get_attr_ptr(start, bind, null_saves, nullp); if(bind->len == 2) return start + (*(uint16 *) memtuple_get_attr_ptr(start, bind, null_saves, nullp)); Assert(bind->len == 4); return start + (*(uint32 *) memtuple_get_attr_ptr(start, bind, null_saves, nullp)); } static inline unsigned char *memtuple_get_nullp(MemTuple mtup, MemTupleBinding *pbind) { return mtup->PRIVATE_mt_bits + (mtbind_has_oid(pbind) ? sizeof(Oid) : 0); } static inline int memtuple_get_nullp_len(MemTuple mtup __attribute__((unused)), MemTupleBinding *pbind) { return (pbind->tupdesc->natts + 7) >> 3; } /* form a memtuple from values and isnull, to a prespecified buffer */ static MemTuple memtuple_form_to_align( MemTupleBinding *pbind, Datum *values, bool *isnull, MemTuple mtup, uint32 *destlen, bool inline_toast, bool use_null_saves_aligned) { bool hasnull = false; bool hasext = false; int i; uint32 len; unsigned char *nullp = NULL; char *start; char *varlen_start; uint32 null_save_len; MemTupleBindingCols *colbind; Datum *old_values = NULL; /* * Check for nulls and embedded tuples; expand any toasted attributes in * embedded tuples. This preserves the invariant that toasting can only * go one level deep. * * We can skip calling toast_flatten_tuple_attribute() if the attribute * couldn't possibly be of composite type. All composite datums are * varlena and have alignment 'd'; furthermore they aren't arrays. Also, * if an attribute is already toasted, it must have been sent to disk * already and so cannot contain toasted attributes. */ for(i=0; i<pbind->tupdesc->natts; ++i) { Form_pg_attribute attr = pbind->tupdesc->attrs[i]; #ifdef CHK_TYPE_SANE check_type_sanity(attr, values[i], isnull[i]); #endif /* treat dropped attibutes as null */ if (attr->attisdropped) { isnull[i] = true; } if(isnull[i]) { hasnull = true; continue; } if (attr->attlen == -1 && attr->attalign == 'd' && attr->attndims == 0 && !VARATT_IS_EXTENDED_D(values[i])) { if (old_values == NULL) old_values = (Datum *)palloc0(pbind->tupdesc->natts * sizeof(Datum)); old_values[i] = values[i]; values[i] = toast_flatten_tuple_attribute(values[i], attr->atttypid, attr->atttypmod); if (values[i] == old_values[i]) old_values[i] = 0; } if (attr->attlen == -1 && VARATT_IS_EXTERNAL_D(values[i])) { if(inline_toast) { if (old_values == NULL) old_values = (Datum *)palloc0(pbind->tupdesc->natts * sizeof(Datum)); old_values[i] = values[i]; values[i] = PointerGetDatum(heap_tuple_fetch_attr(DatumGetPointer(values[i]))); if (old_values[i] == values[i]) old_values[i] = 0; } else hasext = true; } } /* compute needed length */ len = compute_memtuple_size(pbind, values, isnull, hasnull, &null_save_len, use_null_saves_aligned); colbind = (len <= MEMTUPLE_LEN_FITSHORT) ? &pbind->bind : &pbind->large_bind; if(!destlen) { Assert(!mtup); mtup = (MemTuple) palloc(len); } else if(*destlen < len) { *destlen = len; /* * Set values to their old values if we have changed their values * during de-toasting, and release the space allocated during * de-toasting. */ if (old_values != NULL) { for(i=0; i<pbind->tupdesc->natts; ++i) { if (DatumGetPointer(old_values[i]) != NULL) { Assert(DatumGetPointer(values[i]) != NULL); pfree(DatumGetPointer(values[i])); values[i] = old_values[i]; } } pfree(old_values); } return NULL; } else { *destlen = len; Assert(mtup); } /* Set mtlen, this set the lead bit, len, and clears hasnull bit * because the len returned from compute size is always max aligned */ Assert(len == MEMTUP_ALIGN(len)); memtuple_set_mtlen(mtup, pbind, (len | MEMTUP_LEAD_BIT)); if(len > MEMTUPLE_LEN_FITSHORT) memtuple_set_islarge(mtup, pbind); if(hasext) memtuple_set_hasext(mtup, pbind); /* Clear Oid */ if(mtbind_has_oid(pbind)) MemTupleSetOid(mtup, pbind, InvalidOid); if(hasnull) nullp = memtuple_get_nullp(mtup, pbind); start = (char *) mtup; varlen_start = ((char *) mtup) + colbind->var_start - null_save_len; if(hasnull) { memtuple_set_hasnull(mtup, pbind); /* if null bitmap is more than 4 bytes, add needed space */ start += pbind->null_bitmap_extra_size; varlen_start += pbind->null_bitmap_extra_size; /* clear null bitmap. */ memset(nullp, 0, memtuple_get_nullp_len(mtup, pbind)); } /* It is very important to setup the null bitmap first before we * really put the values into place. Where is the value in the * memtuple is determined by space saved from nulls, so the bitmap * is used in the next loop. * NOTE: We cannot set the bitmap in the next loop (even at very * beginning of next loop), because physical col order is different * from logical. */ for(i=0; i<pbind->tupdesc->natts; ++i) { if(isnull[i]) { MemTupleAttrBinding *bind = &(colbind->bindings[i]); Assert(hasnull); nullp[bind->null_byte] |= bind->null_mask; } } /* Null bitmap is set up correctly, we can put in values now */ for(i=0; i<pbind->tupdesc->natts; ++i) { Form_pg_attribute attr = pbind->tupdesc->attrs[i]; MemTupleAttrBinding *bind = &(colbind->bindings[i]); uint32 attr_len; if(isnull[i]) continue; Assert(bind->offset != 0); short *null_saves = NULL; if (use_null_saves_aligned) { null_saves = colbind->null_saves_aligned; } else { null_saves = colbind->null_saves; } Assert(null_saves); /* Not null */ switch(bind->flag) { case MTB_ByVal_Native: store_att_byval(memtuple_get_attr_ptr(start, bind, null_saves, nullp), values[i], bind->len ); break; case MTB_ByVal_Ptr: if(attr->atttypid != BPCHAROID) memcpy(memtuple_get_attr_ptr(start, bind, null_saves, nullp), DatumGetPointer(values[i]), bind->len ); else { if(VARATT_IS_SHORT(DatumGetPointer(values[i]))) { attr_len = VARSIZE_SHORT(DatumGetPointer(values[i])); Assert(attr_len <= bind->len); memcpy(memtuple_get_attr_ptr(start, bind, null_saves, nullp), DatumGetPointer(values[i]), attr_len ); } else { char *p = memtuple_get_attr_ptr(start, bind, null_saves, nullp); Assert(VARATT_COULD_SHORT_D(values[i])); attr_len = VARSIZE_D(values[i]) - VARHDRSZ + VARHDRSZ_SHORT; Assert(attr_len <= bind->len); *p = VARSIZE_TO_SHORT_D(values[i]); memcpy(p+1, VARDATA_D(values[i]), attr_len-1); } } break; case MTB_ByRef: if(VARATT_IS_EXTERNAL_D(values[i])) { varlen_start = (char *) att_align((long) varlen_start, attr->attalign); attr_len = VARSIZE_EXTERNAL(DatumGetPointer(values[i])); Assert((varlen_start - (char *) mtup) + attr_len <= len); memcpy(varlen_start, DatumGetPointer(values[i]), attr_len); } else if(VARATT_IS_SHORT_D(values[i])) { attr_len = VARSIZE_SHORT(DatumGetPointer(values[i])); Assert((varlen_start - (char *) mtup) + attr_len <= len); memcpy(varlen_start, DatumGetPointer(values[i]), attr_len); } else if(value_type_could_short(values[i], attr->atttypid)) { attr_len = VARSIZE_D(values[i]) - VARHDRSZ + VARHDRSZ_SHORT; *varlen_start = VARSIZE_TO_SHORT_D(values[i]); Assert((varlen_start - (char *) mtup) + attr_len <= len); memcpy(varlen_start+1, VARDATA_D(values[i]), attr_len-1); } else { /* Must be 4 byte header aligned varlena */ varlen_start = (char *) att_align((long) varlen_start, attr->attalign); attr_len = VARSIZE(DatumGetPointer(values[i])); Assert((varlen_start - (char *) mtup) + attr_len <= len); memcpy(varlen_start, DatumGetPointer(values[i]), attr_len); } if(bind->len == 2) *(uint16 *) memtuple_get_attr_ptr(start, bind, null_saves, nullp) = (uint16) (varlen_start - start); else { Assert(bind->len == 4); *(uint32 *) memtuple_get_attr_ptr(start, bind, null_saves, nullp) = (uint32) (varlen_start - start); } varlen_start += attr_len; break; case MTB_ByRef_CStr: varlen_start = (char *) att_align((long) varlen_start, attr->attalign); attr_len = strlen(DatumGetCString(values[i])) + 1; Assert((varlen_start - (char *) mtup) + attr_len <= len); memcpy(varlen_start, DatumGetPointer(values[i]), attr_len); if(bind->len == 2) *(uint16 *) memtuple_get_attr_ptr(start, bind, null_saves, nullp) = (uint16) (varlen_start - start); else { Assert(bind->len == 4); *(uint32 *) memtuple_get_attr_ptr(start, bind, null_saves, nullp) = (uint32) (varlen_start - start); } varlen_start += attr_len; break; default: Assert(!"Not valid binding type"); break; } } Assert((varlen_start - (char *) mtup) <= len); /* * Set values to their old values if we have changed their values * during de-toasting, and release the space allocated during * de-toasting. */ if (old_values != NULL) { for(i=0; i<pbind->tupdesc->natts; ++i) { if (DatumGetPointer(old_values[i]) != NULL) { Assert(DatumGetPointer(values[i]) != NULL); pfree(DatumGetPointer(values[i])); values[i] = old_values[i]; } } pfree(old_values); } return mtup; } /* form a memtuple from values and isnull, to a prespecified buffer */ MemTuple memtuple_form_to( MemTupleBinding *pbind, Datum *values, bool *isnull, MemTuple mtup, uint32 *destlen, bool inline_toast) { return memtuple_form_to_align(pbind, values, isnull, mtup, destlen, inline_toast, true /* aligned */); } bool memtuple_attisnull(MemTuple mtup, MemTupleBinding *pbind, int attnum) { MemTupleBindingCols *colbind = memtuple_get_islarge(mtup, pbind) ? &pbind->large_bind : &pbind->bind; Assert(mtup && pbind && pbind->tupdesc); Assert(attnum > 0); /* * This used to be an Assert. However, we follow the logic of * heap_attisnull() and treat attnums > lastatt as NULL. This * is currently used in ALTER ADD COLUMN NOT NULL. * * Unfortunately this also means that the caller needs to be * extra careful passing in the correct attnum argument. */ if (attnum > (int) pbind->tupdesc->natts) return true; /* * is there a NULL value in any of the attributes? */ if(!memtuple_get_hasnull(mtup, pbind)) return false; return (mtup->PRIVATE_mt_bits[colbind->bindings[attnum-1].null_byte] & colbind->bindings[attnum-1].null_mask); } static Datum memtuple_getattr_by_alignment(MemTuple mtup, MemTupleBinding *pbind, int attnum, bool *isnull, bool use_null_saves_aligned) { bool hasnull = memtuple_get_hasnull(mtup, pbind); unsigned char *nullp = hasnull ? memtuple_get_nullp(mtup, pbind) : NULL; char *start = (char *) mtup + (hasnull ? pbind->null_bitmap_extra_size : 0); Datum ret; MemTupleBindingCols *colbind = memtuple_get_islarge(mtup, pbind) ? &pbind->large_bind : &pbind->bind; MemTupleAttrBinding *attrbind; Assert(mtup && pbind && pbind->tupdesc); Assert(attnum > 0 && attnum <= pbind->tupdesc->natts); if(isnull) *isnull = false; /* input attnum is 1 based. Make it 0 based */ --attnum; attrbind = &(colbind->bindings[attnum]); /* null check */ if(hasnull && (nullp[attrbind->null_byte] & attrbind->null_mask)) { if(isnull) *isnull = true; return 0; } short *null_saves = (use_null_saves_aligned ? colbind->null_saves_aligned : colbind->null_saves); Assert(null_saves); ret = fetchatt(pbind->tupdesc->attrs[attnum], memtuple_get_attr_data_ptr(start, attrbind, null_saves, nullp)); return ret; } Datum memtuple_getattr(MemTuple mtup, MemTupleBinding *pbind, int attnum, bool *isnull) { return memtuple_getattr_by_alignment(mtup, pbind, attnum, isnull, true /* aligned */); } MemTuple memtuple_copy_to(MemTuple mtup, MemTupleBinding *pbind, MemTuple dest, uint32 *destlen) { uint32 len = memtuple_get_size(mtup, pbind); if(!destlen) dest = (MemTuple) palloc(len); else { if(*destlen < len) { *destlen = len; return NULL; } *destlen = len; } memcpy((char *) dest, (char *) mtup, len); return dest; } static void memtuple_get_values(MemTuple mtup, MemTupleBinding *pbind, Datum *datum, bool *isnull, bool use_null_saves_aligned) { int i; for(i=0; i<pbind->tupdesc->natts; ++i) datum[i] = memtuple_getattr_by_alignment(mtup, pbind, i+1, &isnull[i], use_null_saves_aligned); } void memtuple_deform(MemTuple mtup, MemTupleBinding *pbind, Datum *datum, bool *isnull) { memtuple_get_values(mtup, pbind, datum, isnull, true /* aligned */); } /* * Get the Oid assigned to this tuple (when WITH OIDS is used). * * Note that similarly to HeapTupleGetOid this function will * sometimes get called when no oid is assigned, in which case * we return InvalidOid. It is possible to make the check earlier * and avoid this call but for simplicity and compatibility with * the HeapTuple interface we keep it the same. */ Oid MemTupleGetOid(MemTuple mtup, MemTupleBinding *pbind) { Assert(pbind); if(!mtbind_has_oid(pbind)) return InvalidOid; return ((Oid *) mtup)[1]; } void MemTupleSetOid(MemTuple mtup, MemTupleBinding *pbind __attribute__((unused)), Oid oid) { Assert(pbind && mtbind_has_oid(pbind)); ((Oid *) mtup)[1] = oid; } bool MemTupleHasExternal(MemTuple mtup, MemTupleBinding *pbind) { MemTupleBindingCols *colbind = memtuple_get_islarge(mtup, pbind) ? &pbind->large_bind : &pbind->bind; int i; for(i=0; i<pbind->tupdesc->natts; ++i) { MemTupleAttrBinding *attrbind = &(colbind->bindings[i]); if(attrbind->flag == MTB_ByRef) { bool isnull; Datum d = memtuple_getattr(mtup, pbind, i+1, &isnull); if(!isnull) { if(VARATT_IS_EXTERNAL_D(d)) return true; } } } return false; } /* * Check if a memtuple has null attributes with bindings that can possibly be misaligned. * * MPP-7372: This is an issue only for memtuples stored in AO tables before applying * the fix that enforces the proper alignment of the binding length. */ bool memtuple_has_misaligned_attribute(MemTuple mtup, MemTupleBinding *pbind) { Assert(mtup); Assert(pbind); /* Check if the memtuple has an attribute with mismatching alignment and length */ if (!(pbind->bind.has_null_saves_alignment_mismatch)) { return false; } /* * Check if the memtuple has a dropped attribute with mismatching alignment and length. * Dropped attributes are treated as null. */ if (pbind->bind.has_dropped_attr_alignment_mismatch) { return true; } /* Check if the memtuple has no null values */ if (!(memtuple_get_hasnull(mtup, pbind))) { return false; } unsigned char *nullp = memtuple_get_nullp(mtup, pbind); int attr_idx = 0; /* * Check if an attribute with mismatching alignment and length is null. */ for (attr_idx = 0; attr_idx < pbind->tupdesc->natts; attr_idx++) { MemTupleAttrBinding *bind = &pbind->bind.bindings[attr_idx]; if (bind->len != bind->len_aligned && (nullp[bind->null_byte] & bind->null_mask)) { return true; } } return false; } /* * Create a clone of a memtuple with complementary binding alignment. * * If use_null_saves_aligned is true, we assume that the memtuple was * created using null_saves, where the binding length is not aligned to the * following binding's alignment. In this case, we create an "upgraded" clone * using null_saves_aligned, which uses properly aligned binding length. The * opposite happens when use_null_saves_aligned is false, i.e. we create a * "downgraded" clone using the possibly misaligned bindings. */ MemTuple memtuple_aligned_clone(MemTuple mtup, MemTupleBinding *pbind, bool use_null_saves_aligned) { Assert(memtuple_has_misaligned_attribute(mtup, pbind)); MemTuple newtuple = NULL; const int attr_count = pbind->tupdesc->natts; const bool use_dynamic_alloc = (attr_count > MAX_ATTR_COUNT_STATIC_ALLOC); Datum values_static_alloc[MAX_ATTR_COUNT_STATIC_ALLOC]; bool is_null_static_alloc[MAX_ATTR_COUNT_STATIC_ALLOC]; Datum *values = values_static_alloc; bool *isnull = is_null_static_alloc; if (use_dynamic_alloc) { values = (Datum *) palloc(attr_count * sizeof(Datum)); isnull = (bool *) palloc(attr_count * sizeof(bool)); } Assert(values); Assert(isnull); /* get attribute values using complementary alignment */ memtuple_get_values(mtup, pbind, values, isnull, !use_null_saves_aligned); /* create the new memtuple using target alignment */ newtuple = memtuple_form_to_align(pbind, values, isnull, NULL, NULL, false, use_null_saves_aligned); if (use_dynamic_alloc) { pfree(values); pfree(isnull); } return newtuple; }
lavjain/incubator-hawq
src/backend/access/common/memtuple.c
C
apache-2.0
33,072
package v1 // This file contains methods that can be used by the go-restful package to generate Swagger // documentation for the object types found in 'types.go' This file is automatically generated // by hack/update-generated-swagger-descriptions.sh and should be run after a full build of OpenShift. // ==== DO NOT EDIT THIS FILE MANUALLY ==== var map_ActiveDirectoryConfig = map[string]string{ "": "ActiveDirectoryConfig holds the necessary configuration options to define how an LDAP group sync interacts with an LDAP server using the Active Directory schema", "usersQuery": "AllUsersQuery holds the template for an LDAP query that returns user entries.", "userNameAttributes": "UserNameAttributes defines which attributes on an LDAP user entry will be interpreted as its OpenShift user name.", "groupMembershipAttributes": "GroupMembershipAttributes defines which attributes on an LDAP user entry will be interpreted as the groups it is a member of", } func (ActiveDirectoryConfig) SwaggerDoc() map[string]string { return map_ActiveDirectoryConfig } var map_AdmissionConfig = map[string]string{ "": "AdmissionConfig holds the necessary configuration options for admission", "pluginConfig": "PluginConfig allows specifying a configuration file per admission control plugin", "pluginOrderOverride": "PluginOrderOverride is a list of admission control plugin names that will be installed on the master. Order is significant. If empty, a default list of plugins is used.", } func (AdmissionConfig) SwaggerDoc() map[string]string { return map_AdmissionConfig } var map_AdmissionPluginConfig = map[string]string{ "": "AdmissionPluginConfig holds the necessary configuration options for admission plugins", "location": "Location is the path to a configuration file that contains the plugin's configuration", "configuration": "Configuration is an embedded configuration object to be used as the plugin's configuration. If present, it will be used instead of the path to the configuration file.", } func (AdmissionPluginConfig) SwaggerDoc() map[string]string { return map_AdmissionPluginConfig } var map_AllowAllPasswordIdentityProvider = map[string]string{ "": "AllowAllPasswordIdentityProvider provides identities for users authenticating using non-empty passwords", } func (AllowAllPasswordIdentityProvider) SwaggerDoc() map[string]string { return map_AllowAllPasswordIdentityProvider } var map_AssetConfig = map[string]string{ "": "AssetConfig holds the necessary configuration options for serving assets", "servingInfo": "ServingInfo is the HTTP serving information for these assets", "publicURL": "PublicURL is where you can find the asset server (TODO do we really need this?)", "logoutURL": "LogoutURL is an optional, absolute URL to redirect web browsers to after logging out of the web console. If not specified, the built-in logout page is shown.", "masterPublicURL": "MasterPublicURL is how the web console can access the OpenShift v1 server", "loggingPublicURL": "LoggingPublicURL is the public endpoint for logging (optional)", "metricsPublicURL": "MetricsPublicURL is the public endpoint for metrics (optional)", "extensionScripts": "ExtensionScripts are file paths on the asset server files to load as scripts when the Web Console loads", "extensionProperties": "ExtensionProperties are key(string) and value(string) pairs that will be injected into the console under the global variable OPENSHIFT_EXTENSION_PROPERTIES", "extensionStylesheets": "ExtensionStylesheets are file paths on the asset server files to load as stylesheets when the Web Console loads", "extensions": "Extensions are files to serve from the asset server filesystem under a subcontext", "extensionDevelopment": "ExtensionDevelopment when true tells the asset server to reload extension scripts and stylesheets for every request rather than only at startup. It lets you develop extensions without having to restart the server for every change.", } func (AssetConfig) SwaggerDoc() map[string]string { return map_AssetConfig } var map_AssetExtensionsConfig = map[string]string{ "": "AssetExtensionsConfig holds the necessary configuration options for asset extensions", "name": "SubContext is the path under /<context>/extensions/ to serve files from SourceDirectory", "sourceDirectory": "SourceDirectory is a directory on the asset server to serve files under Name in the Web Console. It may have nested folders.", "html5Mode": "HTML5Mode determines whether to redirect to the root index.html when a file is not found. This is needed for apps that use the HTML5 history API like AngularJS apps with HTML5 mode enabled. If HTML5Mode is true, also rewrite the base element in index.html with the Web Console's context root. Defaults to false.", } func (AssetExtensionsConfig) SwaggerDoc() map[string]string { return map_AssetExtensionsConfig } var map_AuditConfig = map[string]string{ "": "AuditConfig holds configuration for the audit capabilities", "enabled": "If this flag is set, basic audit log will be printed in the logs. The logs contains, method, user and a requested URL.", } func (AuditConfig) SwaggerDoc() map[string]string { return map_AuditConfig } var map_AugmentedActiveDirectoryConfig = map[string]string{ "": "AugmentedActiveDirectoryConfig holds the necessary configuration options to define how an LDAP group sync interacts with an LDAP server using the augmented Active Directory schema", "usersQuery": "AllUsersQuery holds the template for an LDAP query that returns user entries.", "userNameAttributes": "UserNameAttributes defines which attributes on an LDAP user entry will be interpreted as its OpenShift user name.", "groupMembershipAttributes": "GroupMembershipAttributes defines which attributes on an LDAP user entry will be interpreted as the groups it is a member of", "groupsQuery": "AllGroupsQuery holds the template for an LDAP query that returns group entries.", "groupUIDAttribute": "GroupUIDAttributes defines which attribute on an LDAP group entry will be interpreted as its unique identifier. (ldapGroupUID)", "groupNameAttributes": "GroupNameAttributes defines which attributes on an LDAP group entry will be interpreted as its name to use for an OpenShift group", } func (AugmentedActiveDirectoryConfig) SwaggerDoc() map[string]string { return map_AugmentedActiveDirectoryConfig } var map_BasicAuthPasswordIdentityProvider = map[string]string{ "": "BasicAuthPasswordIdentityProvider provides identities for users authenticating using HTTP basic auth credentials", } func (BasicAuthPasswordIdentityProvider) SwaggerDoc() map[string]string { return map_BasicAuthPasswordIdentityProvider } var map_CertInfo = map[string]string{ "": "CertInfo relates a certificate with a private key", "certFile": "CertFile is a file containing a PEM-encoded certificate", "keyFile": "KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile", } func (CertInfo) SwaggerDoc() map[string]string { return map_CertInfo } var map_ClientConnectionOverrides = map[string]string{ "": "ClientConnectionOverrides are a set of overrides to the default client connection settings.", "acceptContentTypes": "AcceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the default value of 'application/json'. This field will control all connections to the server used by a particular client.", "contentType": "ContentType is the content type used when sending data to the server from this client.", "qps": "QPS controls the number of queries per second allowed for this connection.", "burst": "Burst allows extra queries to accumulate when a client is exceeding its rate.", } func (ClientConnectionOverrides) SwaggerDoc() map[string]string { return map_ClientConnectionOverrides } var map_ControllerConfig = map[string]string{ "": "ControllerConfig holds configuration values for controllers", "serviceServingCert": "ServiceServingCert holds configuration for service serving cert signer which creates cert/key pairs for pods fulfilling a service to serve with.", } func (ControllerConfig) SwaggerDoc() map[string]string { return map_ControllerConfig } var map_DNSConfig = map[string]string{ "": "DNSConfig holds the necessary configuration options for DNS", "bindAddress": "BindAddress is the ip:port to serve DNS on", "bindNetwork": "BindNetwork is the type of network to bind to - defaults to \"tcp4\", accepts \"tcp\", \"tcp4\", and \"tcp6\"", "allowRecursiveQueries": "AllowRecursiveQueries allows the DNS server on the master to answer queries recursively. Note that open resolvers can be used for DNS amplification attacks and the master DNS should not be made accessible to public networks.", } func (DNSConfig) SwaggerDoc() map[string]string { return map_DNSConfig } var map_DefaultAdmissionConfig = map[string]string{ "": "DefaultAdmissionConfig can be used to enable or disable various admission plugins. When this type is present as the `configuration` object under `pluginConfig` and *if* the admission plugin supports it, this will cause an \"off by default\" admission plugin to be enabled", "disable": "Disable turns off an admission plugin that is enabled by default.", } func (DefaultAdmissionConfig) SwaggerDoc() map[string]string { return map_DefaultAdmissionConfig } var map_DenyAllPasswordIdentityProvider = map[string]string{ "": "DenyAllPasswordIdentityProvider provides no identities for users", } func (DenyAllPasswordIdentityProvider) SwaggerDoc() map[string]string { return map_DenyAllPasswordIdentityProvider } var map_DockerConfig = map[string]string{ "": "DockerConfig holds Docker related configuration options.", "execHandlerName": "ExecHandlerName is the name of the handler to use for executing commands in Docker containers.", } func (DockerConfig) SwaggerDoc() map[string]string { return map_DockerConfig } var map_EtcdConfig = map[string]string{ "": "EtcdConfig holds the necessary configuration options for connecting with an etcd database", "servingInfo": "ServingInfo describes how to start serving the etcd master", "address": "Address is the advertised host:port for client connections to etcd", "peerServingInfo": "PeerServingInfo describes how to start serving the etcd peer", "peerAddress": "PeerAddress is the advertised host:port for peer connections to etcd", "storageDirectory": "StorageDir is the path to the etcd storage directory", } func (EtcdConfig) SwaggerDoc() map[string]string { return map_EtcdConfig } var map_EtcdConnectionInfo = map[string]string{ "": "EtcdConnectionInfo holds information necessary for connecting to an etcd server", "urls": "URLs are the URLs for etcd", "ca": "CA is a file containing trusted roots for the etcd server certificates", } func (EtcdConnectionInfo) SwaggerDoc() map[string]string { return map_EtcdConnectionInfo } var map_EtcdStorageConfig = map[string]string{ "": "EtcdStorageConfig holds the necessary configuration options for the etcd storage underlying OpenShift and Kubernetes", "kubernetesStorageVersion": "KubernetesStorageVersion is the API version that Kube resources in etcd should be serialized to. This value should *not* be advanced until all clients in the cluster that read from etcd have code that allows them to read the new version.", "kubernetesStoragePrefix": "KubernetesStoragePrefix is the path within etcd that the Kubernetes resources will be rooted under. This value, if changed, will mean existing objects in etcd will no longer be located. The default value is 'kubernetes.io'.", "openShiftStorageVersion": "OpenShiftStorageVersion is the API version that OS resources in etcd should be serialized to. This value should *not* be advanced until all clients in the cluster that read from etcd have code that allows them to read the new version.", "openShiftStoragePrefix": "OpenShiftStoragePrefix is the path within etcd that the OpenShift resources will be rooted under. This value, if changed, will mean existing objects in etcd will no longer be located. The default value is 'openshift.io'.", } func (EtcdStorageConfig) SwaggerDoc() map[string]string { return map_EtcdStorageConfig } var map_GitHubIdentityProvider = map[string]string{ "": "GitHubIdentityProvider provides identities for users authenticating using GitHub credentials", "clientID": "ClientID is the oauth client ID", "clientSecret": "ClientSecret is the oauth client secret", "organizations": "Organizations optionally restricts which organizations are allowed to log in", } func (GitHubIdentityProvider) SwaggerDoc() map[string]string { return map_GitHubIdentityProvider } var map_GitLabIdentityProvider = map[string]string{ "": "GitLabIdentityProvider provides identities for users authenticating using GitLab credentials", "ca": "CA is the optional trusted certificate authority bundle to use when making requests to the server If empty, the default system roots are used", "url": "URL is the oauth server base URL", "clientID": "ClientID is the oauth client ID", "clientSecret": "ClientSecret is the oauth client secret", } func (GitLabIdentityProvider) SwaggerDoc() map[string]string { return map_GitLabIdentityProvider } var map_GoogleIdentityProvider = map[string]string{ "": "GoogleIdentityProvider provides identities for users authenticating using Google credentials", "clientID": "ClientID is the oauth client ID", "clientSecret": "ClientSecret is the oauth client secret", "hostedDomain": "HostedDomain is the optional Google App domain (e.g. \"mycompany.com\") to restrict logins to", } func (GoogleIdentityProvider) SwaggerDoc() map[string]string { return map_GoogleIdentityProvider } var map_GrantConfig = map[string]string{ "": "GrantConfig holds the necessary configuration options for grant handlers", "method": "Method determines the default strategy to use when an OAuth client requests a grant. This method will be used only if the specific OAuth client doesn't provide a strategy of their own. Valid grant handling methods are:\n - auto: always approves grant requests, useful for trusted clients\n - prompt: prompts the end user for approval of grant requests, useful for third-party clients\n - deny: always denies grant requests, useful for black-listed clients", "serviceAccountMethod": "ServiceAccountMethod is used for determining client authorization for service account oauth client. It must be either: deny, prompt", } func (GrantConfig) SwaggerDoc() map[string]string { return map_GrantConfig } var map_HTPasswdPasswordIdentityProvider = map[string]string{ "": "HTPasswdPasswordIdentityProvider provides identities for users authenticating using htpasswd credentials", "file": "File is a reference to your htpasswd file", } func (HTPasswdPasswordIdentityProvider) SwaggerDoc() map[string]string { return map_HTPasswdPasswordIdentityProvider } var map_HTTPServingInfo = map[string]string{ "": "HTTPServingInfo holds configuration for serving HTTP", "maxRequestsInFlight": "MaxRequestsInFlight is the number of concurrent requests allowed to the server. If zero, no limit.", "requestTimeoutSeconds": "RequestTimeoutSeconds is the number of seconds before requests are timed out. The default is 60 minutes, if -1 there is no limit on requests.", } func (HTTPServingInfo) SwaggerDoc() map[string]string { return map_HTTPServingInfo } var map_IdentityProvider = map[string]string{ "": "IdentityProvider provides identities for users authenticating using credentials", "name": "Name is used to qualify the identities returned by this provider", "challenge": "UseAsChallenger indicates whether to issue WWW-Authenticate challenges for this provider", "login": "UseAsLogin indicates whether to use this identity provider for unauthenticated browsers to login against", "mappingMethod": "MappingMethod determines how identities from this provider are mapped to users", "provider": "Provider contains the information about how to set up a specific identity provider", } func (IdentityProvider) SwaggerDoc() map[string]string { return map_IdentityProvider } var map_ImageConfig = map[string]string{ "": "ImageConfig holds the necessary configuration options for building image names for system components", "format": "Format is the format of the name to be built for the system component", "latest": "Latest determines if the latest tag will be pulled from the registry", } func (ImageConfig) SwaggerDoc() map[string]string { return map_ImageConfig } var map_ImagePolicyConfig = map[string]string{ "": "ImagePolicyConfig holds the necessary configuration options for limits and behavior for importing images", "maxImagesBulkImportedPerRepository": "MaxImagesBulkImportedPerRepository controls the number of images that are imported when a user does a bulk import of a Docker repository. This number defaults to 5 to prevent users from importing large numbers of images accidentally. Set -1 for no limit.", "disableScheduledImport": "DisableScheduledImport allows scheduled background import of images to be disabled.", "scheduledImageImportMinimumIntervalSeconds": "ScheduledImageImportMinimumIntervalSeconds is the minimum number of seconds that can elapse between when image streams scheduled for background import are checked against the upstream repository. The default value is 15 minutes.", "maxScheduledImageImportsPerMinute": "MaxScheduledImageImportsPerMinute is the maximum number of scheduled image streams that will be imported in the background per minute. The default value is 60. Set to -1 for unlimited.", } func (ImagePolicyConfig) SwaggerDoc() map[string]string { return map_ImagePolicyConfig } var map_JenkinsPipelineConfig = map[string]string{ "": "JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy", "autoProvisionEnabled": "AutoProvisionEnabled determines whether a Jenkins server will be spawned from the provided template when the first build config in the project with type JenkinsPipeline is created. When not specified this option defaults to false.", "templateNamespace": "TemplateNamespace contains the namespace name where the Jenkins template is stored", "templateName": "TemplateName is the name of the default Jenkins template", "serviceName": "ServiceName is the name of the Jenkins service OpenShift uses to detect whether a Jenkins pipeline handler has already been installed in a project. This value *must* match a service name in the provided template.", "parameters": "Parameters specifies a set of optional parameters to the Jenkins template.", } func (JenkinsPipelineConfig) SwaggerDoc() map[string]string { return map_JenkinsPipelineConfig } var map_KeystonePasswordIdentityProvider = map[string]string{ "": "KeystonePasswordIdentityProvider provides identities for users authenticating using keystone password credentials", "domainName": "Domain Name is required for keystone v3", } func (KeystonePasswordIdentityProvider) SwaggerDoc() map[string]string { return map_KeystonePasswordIdentityProvider } var map_KubeletConnectionInfo = map[string]string{ "": "KubeletConnectionInfo holds information necessary for connecting to a kubelet", "port": "Port is the port to connect to kubelets on", "ca": "CA is the CA for verifying TLS connections to kubelets", } func (KubeletConnectionInfo) SwaggerDoc() map[string]string { return map_KubeletConnectionInfo } var map_KubernetesMasterConfig = map[string]string{ "": "KubernetesMasterConfig holds the necessary configuration options for the Kubernetes master", "apiLevels": "APILevels is a list of API levels that should be enabled on startup: v1 as examples", "disabledAPIGroupVersions": "DisabledAPIGroupVersions is a map of groups to the versions (or *) that should be disabled.", "masterIP": "MasterIP is the public IP address of kubernetes stuff. If empty, the first result from net.InterfaceAddrs will be used.", "masterCount": "MasterCount is the number of expected masters that should be running. This value defaults to 1 and may be set to a positive integer, or if set to -1, indicates this is part of a cluster.", "servicesSubnet": "ServicesSubnet is the subnet to use for assigning service IPs", "servicesNodePortRange": "ServicesNodePortRange is the range to use for assigning service public ports on a host.", "staticNodeNames": "StaticNodeNames is the list of nodes that are statically known", "schedulerConfigFile": "SchedulerConfigFile points to a file that describes how to set up the scheduler. If empty, you get the default scheduling rules.", "podEvictionTimeout": "PodEvictionTimeout controls grace period for deleting pods on failed nodes. It takes valid time duration string. If empty, you get the default pod eviction timeout.", "proxyClientInfo": "ProxyClientInfo specifies the client cert/key to use when proxying to pods", "admissionConfig": "AdmissionConfig contains admission control plugin configuration.", "apiServerArguments": "APIServerArguments are key value pairs that will be passed directly to the Kube apiserver that match the apiservers's command line arguments. These are not migrated, but if you reference a value that does not exist the server will not start. These values may override other settings in KubernetesMasterConfig which may cause invalid configurations.", "controllerArguments": "ControllerArguments are key value pairs that will be passed directly to the Kube controller manager that match the controller manager's command line arguments. These are not migrated, but if you reference a value that does not exist the server will not start. These values may override other settings in KubernetesMasterConfig which may cause invalid configurations.", "schedulerArguments": "SchedulerArguments are key value pairs that will be passed directly to the Kube scheduler that match the scheduler's command line arguments. These are not migrated, but if you reference a value that does not exist the server will not start. These values may override other settings in KubernetesMasterConfig which may cause invalid configurations.", } func (KubernetesMasterConfig) SwaggerDoc() map[string]string { return map_KubernetesMasterConfig } var map_LDAPAttributeMapping = map[string]string{ "": "LDAPAttributeMapping maps LDAP attributes to OpenShift identity fields", "id": "ID is the list of attributes whose values should be used as the user ID. Required. LDAP standard identity attribute is \"dn\"", "preferredUsername": "PreferredUsername is the list of attributes whose values should be used as the preferred username. LDAP standard login attribute is \"uid\"", "name": "Name is the list of attributes whose values should be used as the display name. Optional. If unspecified, no display name is set for the identity LDAP standard display name attribute is \"cn\"", "email": "Email is the list of attributes whose values should be used as the email address. Optional. If unspecified, no email is set for the identity", } func (LDAPAttributeMapping) SwaggerDoc() map[string]string { return map_LDAPAttributeMapping } var map_LDAPPasswordIdentityProvider = map[string]string{ "": "LDAPPasswordIdentityProvider provides identities for users authenticating using LDAP credentials", "url": "URL is an RFC 2255 URL which specifies the LDAP search parameters to use. The syntax of the URL is\n ldap://host:port/basedn?attribute?scope?filter", "bindDN": "BindDN is an optional DN to bind with during the search phase.", "bindPassword": "BindPassword is an optional password to bind with during the search phase.", "insecure": "Insecure, if true, indicates the connection should not use TLS. Cannot be set to true with a URL scheme of \"ldaps://\" If false, \"ldaps://\" URLs connect using TLS, and \"ldap://\" URLs are upgraded to a TLS connection using StartTLS as specified in https://tools.ietf.org/html/rfc2830", "ca": "CA is the optional trusted certificate authority bundle to use when making requests to the server If empty, the default system roots are used", "attributes": "Attributes maps LDAP attributes to identities", } func (LDAPPasswordIdentityProvider) SwaggerDoc() map[string]string { return map_LDAPPasswordIdentityProvider } var map_LDAPQuery = map[string]string{ "": "LDAPQuery holds the options necessary to build an LDAP query", "baseDN": "The DN of the branch of the directory where all searches should start from", "scope": "The (optional) scope of the search. Can be: base: only the base object, one: all object on the base level, sub: the entire subtree Defaults to the entire subtree if not set", "derefAliases": "The (optional) behavior of the search with regards to alisases. Can be: never: never dereference aliases, search: only dereference in searching, base: only dereference in finding the base object, always: always dereference Defaults to always dereferencing if not set", "timeout": "TimeLimit holds the limit of time in seconds that any request to the server can remain outstanding before the wait for a response is given up. If this is 0, no client-side limit is imposed", "filter": "Filter is a valid LDAP search filter that retrieves all relevant entries from the LDAP server with the base DN", "pageSize": "PageSize is the maximum preferred page size, measured in LDAP entries. A page size of 0 means no paging will be done.", } func (LDAPQuery) SwaggerDoc() map[string]string { return map_LDAPQuery } var map_LDAPSyncConfig = map[string]string{ "": "LDAPSyncConfig holds the necessary configuration options to define an LDAP group sync", "url": "Host is the scheme, host and port of the LDAP server to connect to: scheme://host:port", "bindDN": "BindDN is an optional DN to bind to the LDAP server with", "bindPassword": "BindPassword is an optional password to bind with during the search phase.", "insecure": "Insecure, if true, indicates the connection should not use TLS. Cannot be set to true with a URL scheme of \"ldaps://\" If false, \"ldaps://\" URLs connect using TLS, and \"ldap://\" URLs are upgraded to a TLS connection using StartTLS as specified in https://tools.ietf.org/html/rfc2830", "ca": "CA is the optional trusted certificate authority bundle to use when making requests to the server If empty, the default system roots are used", "groupUIDNameMapping": "LDAPGroupUIDToOpenShiftGroupNameMapping is an optional direct mapping of LDAP group UIDs to OpenShift Group names", "rfc2307": "RFC2307Config holds the configuration for extracting data from an LDAP server set up in a fashion similar to RFC2307: first-class group and user entries, with group membership determined by a multi-valued attribute on the group entry listing its members", "activeDirectory": "ActiveDirectoryConfig holds the configuration for extracting data from an LDAP server set up in a fashion similar to that used in Active Directory: first-class user entries, with group membership determined by a multi-valued attribute on members listing groups they are a member of", "augmentedActiveDirectory": "AugmentedActiveDirectoryConfig holds the configuration for extracting data from an LDAP server set up in a fashion similar to that used in Active Directory as described above, with one addition: first-class group entries exist and are used to hold metadata but not group membership", } func (LDAPSyncConfig) SwaggerDoc() map[string]string { return map_LDAPSyncConfig } var map_LocalQuota = map[string]string{ "": "LocalQuota contains options for controlling local volume quota on the node.", "perFSGroup": "FSGroup can be specified to enable a quota on local storage use per unique FSGroup ID. At present this is only implemented for emptyDir volumes, and if the underlying volumeDirectory is on an XFS filesystem.", } func (LocalQuota) SwaggerDoc() map[string]string { return map_LocalQuota } var map_MasterClients = map[string]string{ "": "MasterClients holds references to `.kubeconfig` files that qualify master clients for OpenShift and Kubernetes", "openshiftLoopbackKubeConfig": "OpenShiftLoopbackKubeConfig is a .kubeconfig filename for system components to loopback to this master", "externalKubernetesKubeConfig": "ExternalKubernetesKubeConfig is a .kubeconfig filename for proxying to Kubernetes", "openshiftLoopbackClientConnectionOverrides": "OpenShiftLoopbackClientConnectionOverrides specifies client overrides for system components to loop back to this master.", "externalKubernetesClientConnectionOverrides": "ExternalKubernetesClientConnectionOverrides specifies client overrides for proxying to Kubernetes.", } func (MasterClients) SwaggerDoc() map[string]string { return map_MasterClients } var map_MasterConfig = map[string]string{ "": "MasterConfig holds the necessary configuration options for the OpenShift master", "servingInfo": "ServingInfo describes how to start serving", "corsAllowedOrigins": "CORSAllowedOrigins", "apiLevels": "APILevels is a list of API levels that should be enabled on startup: v1 as examples", "masterPublicURL": "MasterPublicURL is how clients can access the OpenShift API server", "controllers": "Controllers is a list of the controllers that should be started. If set to \"none\", no controllers will start automatically. The default value is \"*\" which will start all controllers. When using \"*\", you may exclude controllers by prepending a \"-\" in front of their name. No other values are recognized at this time.", "pauseControllers": "PauseControllers instructs the master to not automatically start controllers, but instead to wait until a notification to the server is received before launching them.", "controllerLeaseTTL": "ControllerLeaseTTL enables controller election, instructing the master to attempt to acquire a lease before controllers start and renewing it within a number of seconds defined by this value. Setting this value non-negative forces pauseControllers=true. This value defaults off (0, or omitted) and controller election can be disabled with -1.", "admissionConfig": "AdmissionConfig contains admission control plugin configuration.", "controllerConfig": "ControllerConfig holds configuration values for controllers", "disabledFeatures": "DisabledFeatures is a list of features that should not be started. We omitempty here because its very unlikely that anyone will want to manually disable features and we don't want to encourage it.", "etcdStorageConfig": "EtcdStorageConfig contains information about how API resources are stored in Etcd. These values are only relevant when etcd is the backing store for the cluster.", "etcdClientInfo": "EtcdClientInfo contains information about how to connect to etcd", "kubeletClientInfo": "KubeletClientInfo contains information about how to connect to kubelets", "kubernetesMasterConfig": "KubernetesMasterConfig, if present start the kubernetes master in this process", "etcdConfig": "EtcdConfig, if present start etcd in this process", "oauthConfig": "OAuthConfig, if present start the /oauth endpoint in this process", "assetConfig": "AssetConfig, if present start the asset server in this process", "dnsConfig": "DNSConfig, if present start the DNS server in this process", "serviceAccountConfig": "ServiceAccountConfig holds options related to service accounts", "masterClients": "MasterClients holds all the client connection information for controllers and other system components", "imageConfig": "ImageConfig holds options that describe how to build image names for system components", "imagePolicyConfig": "ImagePolicyConfig controls limits and behavior for importing images", "policyConfig": "PolicyConfig holds information about where to locate critical pieces of bootstrapping policy", "projectConfig": "ProjectConfig holds information about project creation and defaults", "routingConfig": "RoutingConfig holds information about routing and route generation", "networkConfig": "NetworkConfig to be passed to the compiled in network plugin", "volumeConfig": "MasterVolumeConfig contains options for configuring volume plugins in the master node.", "jenkinsPipelineConfig": "JenkinsPipelineConfig holds information about the default Jenkins template used for JenkinsPipeline build strategy.", "auditConfig": "AuditConfig holds information related to auditing capabilities.", } func (MasterConfig) SwaggerDoc() map[string]string { return map_MasterConfig } var map_MasterNetworkConfig = map[string]string{ "": "MasterNetworkConfig to be passed to the compiled in network plugin", "networkPluginName": "NetworkPluginName is the name of the network plugin to use", "clusterNetworkCIDR": "ClusterNetworkCIDR is the CIDR string to specify the global overlay network's L3 space", "hostSubnetLength": "HostSubnetLength is the number of bits to allocate to each host's subnet e.g. 8 would mean a /24 network on the host", "serviceNetworkCIDR": "ServiceNetwork is the CIDR string to specify the service networks", "externalIPNetworkCIDRs": "ExternalIPNetworkCIDRs controls what values are acceptable for the service external IP field. If empty, no externalIP may be set. It may contain a list of CIDRs which are checked for access. If a CIDR is prefixed with !, IPs in that CIDR will be rejected. Rejections will be applied first, then the IP checked against one of the allowed CIDRs. You should ensure this range does not overlap with your nodes, pods, or service CIDRs for security reasons.", "ingressIPNetworkCIDR": "IngressIPNetworkCIDR controls the range to assign ingress ips from for services of type LoadBalancer on bare metal. If empty, ingress ips will not be assigned. It may contain a single CIDR that will be allocated from. For security reasons, you should ensure that this range does not overlap with the CIDRs reserved for external ips, nodes, pods, or services.", } func (MasterNetworkConfig) SwaggerDoc() map[string]string { return map_MasterNetworkConfig } var map_MasterVolumeConfig = map[string]string{ "": "MasterVolumeConfig contains options for configuring volume plugins in the master node.", "dynamicProvisioningEnabled": "DynamicProvisioningEnabled is a boolean that toggles dynamic provisioning off when false, defaults to true", } func (MasterVolumeConfig) SwaggerDoc() map[string]string { return map_MasterVolumeConfig } var map_NamedCertificate = map[string]string{ "": "NamedCertificate specifies a certificate/key, and the names it should be served for", "names": "Names is a list of DNS names this certificate should be used to secure A name can be a normal DNS name, or can contain leading wildcard segments.", } func (NamedCertificate) SwaggerDoc() map[string]string { return map_NamedCertificate } var map_NodeAuthConfig = map[string]string{ "": "NodeAuthConfig holds authn/authz configuration options", "authenticationCacheTTL": "AuthenticationCacheTTL indicates how long an authentication result should be cached. It takes a valid time duration string (e.g. \"5m\"). If empty, you get the default timeout. If zero (e.g. \"0m\"), caching is disabled", "authenticationCacheSize": "AuthenticationCacheSize indicates how many authentication results should be cached. If 0, the default cache size is used.", "authorizationCacheTTL": "AuthorizationCacheTTL indicates how long an authorization result should be cached. It takes a valid time duration string (e.g. \"5m\"). If empty, you get the default timeout. If zero (e.g. \"0m\"), caching is disabled", "authorizationCacheSize": "AuthorizationCacheSize indicates how many authorization results should be cached. If 0, the default cache size is used.", } func (NodeAuthConfig) SwaggerDoc() map[string]string { return map_NodeAuthConfig } var map_NodeConfig = map[string]string{ "": "NodeConfig is the fully specified config starting an OpenShift node", "nodeName": "NodeName is the value used to identify this particular node in the cluster. If possible, this should be your fully qualified hostname. If you're describing a set of static nodes to the master, this value must match one of the values in the list", "nodeIP": "Node may have multiple IPs, specify the IP to use for pod traffic routing If not specified, network parse/lookup on the nodeName is performed and the first non-loopback address is used", "servingInfo": "ServingInfo describes how to start serving", "masterKubeConfig": "MasterKubeConfig is a filename for the .kubeconfig file that describes how to connect this node to the master", "masterClientConnectionOverrides": "MasterClientConnectionOverrides provides overrides to the client connection used to connect to the master.", "dnsDomain": "DNSDomain holds the domain suffix", "dnsIP": "DNSIP holds the IP", "networkPluginName": "Deprecated and maintained for backward compatibility, use NetworkConfig.NetworkPluginName instead", "networkConfig": "NetworkConfig provides network options for the node", "volumeDirectory": "VolumeDirectory is the directory that volumes will be stored under", "imageConfig": "ImageConfig holds options that describe how to build image names for system components", "allowDisabledDocker": "AllowDisabledDocker if true, the Kubelet will ignore errors from Docker. This means that a node can start on a machine that doesn't have docker started.", "podManifestConfig": "PodManifestConfig holds the configuration for enabling the Kubelet to create pods based from a manifest file(s) placed locally on the node", "authConfig": "AuthConfig holds authn/authz configuration options", "dockerConfig": "DockerConfig holds Docker related configuration options.", "kubeletArguments": "KubeletArguments are key value pairs that will be passed directly to the Kubelet that match the Kubelet's command line arguments. These are not migrated or validated, so if you use them they may become invalid. These values override other settings in NodeConfig which may cause invalid configurations.", "proxyArguments": "ProxyArguments are key value pairs that will be passed directly to the Proxy that match the Proxy's command line arguments. These are not migrated or validated, so if you use them they may become invalid. These values override other settings in NodeConfig which may cause invalid configurations.", "iptablesSyncPeriod": "IPTablesSyncPeriod is how often iptable rules are refreshed", "enableUnidling": "EnableUnidling controls whether or not the hybrid unidling proxy will be set up", "volumeConfig": "VolumeConfig contains options for configuring volumes on the node.", } func (NodeConfig) SwaggerDoc() map[string]string { return map_NodeConfig } var map_NodeNetworkConfig = map[string]string{ "": "NodeNetworkConfig provides network options for the node", "networkPluginName": "NetworkPluginName is a string specifying the networking plugin", "mtu": "Maximum transmission unit for the network packets", } func (NodeNetworkConfig) SwaggerDoc() map[string]string { return map_NodeNetworkConfig } var map_NodeVolumeConfig = map[string]string{ "": "NodeVolumeConfig contains options for configuring volumes on the node.", "localQuota": "LocalQuota contains options for controlling local volume quota on the node.", } func (NodeVolumeConfig) SwaggerDoc() map[string]string { return map_NodeVolumeConfig } var map_OAuthConfig = map[string]string{ "": "OAuthConfig holds the necessary configuration options for OAuth authentication", "masterCA": "MasterCA is the CA for verifying the TLS connection back to the MasterURL.", "masterURL": "MasterURL is used for making server-to-server calls to exchange authorization codes for access tokens", "masterPublicURL": "MasterPublicURL is used for building valid client redirect URLs for external access", "assetPublicURL": "AssetPublicURL is used for building valid client redirect URLs for external access", "alwaysShowProviderSelection": "AlwaysShowProviderSelection will force the provider selection page to render even when there is only a single provider.", "identityProviders": "IdentityProviders is an ordered list of ways for a user to identify themselves", "grantConfig": "GrantConfig describes how to handle grants", "sessionConfig": "SessionConfig hold information about configuring sessions.", "tokenConfig": "TokenConfig contains options for authorization and access tokens", "templates": "Templates allow you to customize pages like the login page.", } func (OAuthConfig) SwaggerDoc() map[string]string { return map_OAuthConfig } var map_OAuthTemplates = map[string]string{ "": "OAuthTemplates allow for customization of pages like the login page", "login": "Login is a path to a file containing a go template used to render the login page. If unspecified, the default login page is used.", "providerSelection": "ProviderSelection is a path to a file containing a go template used to render the provider selection page. If unspecified, the default provider selection page is used.", "error": "Error is a path to a file containing a go template used to render error pages during the authentication or grant flow If unspecified, the default error page is used.", } func (OAuthTemplates) SwaggerDoc() map[string]string { return map_OAuthTemplates } var map_OpenIDClaims = map[string]string{ "": "OpenIDClaims contains a list of OpenID claims to use when authenticating with an OpenID identity provider", "id": "ID is the list of claims whose values should be used as the user ID. Required. OpenID standard identity claim is \"sub\"", "preferredUsername": "PreferredUsername is the list of claims whose values should be used as the preferred username. If unspecified, the preferred username is determined from the value of the id claim", "name": "Name is the list of claims whose values should be used as the display name. Optional. If unspecified, no display name is set for the identity", "email": "Email is the list of claims whose values should be used as the email address. Optional. If unspecified, no email is set for the identity", } func (OpenIDClaims) SwaggerDoc() map[string]string { return map_OpenIDClaims } var map_OpenIDIdentityProvider = map[string]string{ "": "OpenIDIdentityProvider provides identities for users authenticating using OpenID credentials", "ca": "CA is the optional trusted certificate authority bundle to use when making requests to the server If empty, the default system roots are used", "clientID": "ClientID is the oauth client ID", "clientSecret": "ClientSecret is the oauth client secret", "extraScopes": "ExtraScopes are any scopes to request in addition to the standard \"openid\" scope.", "extraAuthorizeParameters": "ExtraAuthorizeParameters are any custom parameters to add to the authorize request.", "urls": "URLs to use to authenticate", "claims": "Claims mappings", } func (OpenIDIdentityProvider) SwaggerDoc() map[string]string { return map_OpenIDIdentityProvider } var map_OpenIDURLs = map[string]string{ "": "OpenIDURLs are URLs to use when authenticating with an OpenID identity provider", "authorize": "Authorize is the oauth authorization URL", "token": "Token is the oauth token granting URL", "userInfo": "UserInfo is the optional userinfo URL. If present, a granted access_token is used to request claims If empty, a granted id_token is parsed for claims", } func (OpenIDURLs) SwaggerDoc() map[string]string { return map_OpenIDURLs } var map_PodManifestConfig = map[string]string{ "": "PodManifestConfig holds the necessary configuration options for using pod manifests", "path": "Path specifies the path for the pod manifest file or directory If its a directory, its expected to contain on or more manifest files This is used by the Kubelet to create pods on the node", "fileCheckIntervalSeconds": "FileCheckIntervalSeconds is the interval in seconds for checking the manifest file(s) for new data The interval needs to be a positive value", } func (PodManifestConfig) SwaggerDoc() map[string]string { return map_PodManifestConfig } var map_PolicyConfig = map[string]string{ "": "\n holds the necessary configuration options for", "bootstrapPolicyFile": "BootstrapPolicyFile points to a template that contains roles and rolebindings that will be created if no policy object exists in the master namespace", "openshiftSharedResourcesNamespace": "OpenShiftSharedResourcesNamespace is the namespace where shared OpenShift resources live (like shared templates)", "openshiftInfrastructureNamespace": "OpenShiftInfrastructureNamespace is the namespace where OpenShift infrastructure resources live (like controller service accounts)", "userAgentMatchingConfig": "UserAgentMatchingConfig controls how API calls from *voluntarily* identifying clients will be handled. THIS DOES NOT DEFEND AGAINST MALICIOUS CLIENTS!", } func (PolicyConfig) SwaggerDoc() map[string]string { return map_PolicyConfig } var map_ProjectConfig = map[string]string{ "": "\n holds the necessary configuration options for", "defaultNodeSelector": "DefaultNodeSelector holds default project node label selector", "projectRequestMessage": "ProjectRequestMessage is the string presented to a user if they are unable to request a project via the projectrequest api endpoint", "projectRequestTemplate": "ProjectRequestTemplate is the template to use for creating projects in response to projectrequest. It is in the format namespace/template and it is optional. If it is not specified, a default template is used.", "securityAllocator": "SecurityAllocator controls the automatic allocation of UIDs and MCS labels to a project. If nil, allocation is disabled.", } func (ProjectConfig) SwaggerDoc() map[string]string { return map_ProjectConfig } var map_RFC2307Config = map[string]string{ "": "RFC2307Config holds the necessary configuration options to define how an LDAP group sync interacts with an LDAP server using the RFC2307 schema", "groupsQuery": "AllGroupsQuery holds the template for an LDAP query that returns group entries.", "groupUIDAttribute": "GroupUIDAttributes defines which attribute on an LDAP group entry will be interpreted as its unique identifier. (ldapGroupUID)", "groupNameAttributes": "GroupNameAttributes defines which attributes on an LDAP group entry will be interpreted as its name to use for an OpenShift group", "groupMembershipAttributes": "GroupMembershipAttributes defines which attributes on an LDAP group entry will be interpreted as its members. The values contained in those attributes must be queryable by your UserUIDAttribute", "usersQuery": "AllUsersQuery holds the template for an LDAP query that returns user entries.", "userUIDAttribute": "UserUIDAttribute defines which attribute on an LDAP user entry will be interpreted as its unique identifier. It must correspond to values that will be found from the GroupMembershipAttributes", "userNameAttributes": "UserNameAttributes defines which attributes on an LDAP user entry will be used, in order, as its OpenShift user name. The first attribute with a non-empty value is used. This should match your PreferredUsername setting for your LDAPPasswordIdentityProvider", "tolerateMemberNotFoundErrors": "TolerateMemberNotFoundErrors determines the behavior of the LDAP sync job when missing user entries are encountered. If 'true', an LDAP query for users that doesn't find any will be tolerated and an only and error will be logged. If 'false', the LDAP sync job will fail if a query for users doesn't find any. The default value is 'false'. Misconfigured LDAP sync jobs with this flag set to 'true' can cause group membership to be removed, so it is recommended to use this flag with caution.", "tolerateMemberOutOfScopeErrors": "TolerateMemberOutOfScopeErrors determines the behavior of the LDAP sync job when out-of-scope user entries are encountered. If 'true', an LDAP query for a user that falls outside of the base DN given for the all user query will be tolerated and only an error will be logged. If 'false', the LDAP sync job will fail if a user query would search outside of the base DN specified by the all user query. Misconfigured LDAP sync jobs with this flag set to 'true' can result in groups missing users, so it is recommended to use this flag with caution.", } func (RFC2307Config) SwaggerDoc() map[string]string { return map_RFC2307Config } var map_RemoteConnectionInfo = map[string]string{ "": "RemoteConnectionInfo holds information necessary for establishing a remote connection", "url": "URL is the remote URL to connect to", "ca": "CA is the CA for verifying TLS connections", } func (RemoteConnectionInfo) SwaggerDoc() map[string]string { return map_RemoteConnectionInfo } var map_RequestHeaderIdentityProvider = map[string]string{ "": "RequestHeaderIdentityProvider provides identities for users authenticating using request header credentials", "loginURL": "LoginURL is a URL to redirect unauthenticated /authorize requests to Unauthenticated requests from OAuth clients which expect interactive logins will be redirected here ${url} is replaced with the current URL, escaped to be safe in a query parameter\n https://www.example.com/sso-login?then=${url}\n${query} is replaced with the current query string\n https://www.example.com/auth-proxy/oauth/authorize?${query}", "challengeURL": "ChallengeURL is a URL to redirect unauthenticated /authorize requests to Unauthenticated requests from OAuth clients which expect WWW-Authenticate challenges will be redirected here ${url} is replaced with the current URL, escaped to be safe in a query parameter\n https://www.example.com/sso-login?then=${url}\n${query} is replaced with the current query string\n https://www.example.com/auth-proxy/oauth/authorize?${query}", "clientCA": "ClientCA is a file with the trusted signer certs. If empty, no request verification is done, and any direct request to the OAuth server can impersonate any identity from this provider, merely by setting a request header.", "clientCommonNames": "ClientCommonNames is an optional list of common names to require a match from. If empty, any client certificate validated against the clientCA bundle is considered authoritative.", "headers": "Headers is the set of headers to check for identity information", "preferredUsernameHeaders": "PreferredUsernameHeaders is the set of headers to check for the preferred username", "nameHeaders": "NameHeaders is the set of headers to check for the display name", "emailHeaders": "EmailHeaders is the set of headers to check for the email address", } func (RequestHeaderIdentityProvider) SwaggerDoc() map[string]string { return map_RequestHeaderIdentityProvider } var map_RoutingConfig = map[string]string{ "": "RoutingConfig holds the necessary configuration options for routing to subdomains", "subdomain": "Subdomain is the suffix appended to $service.$namespace. to form the default route hostname DEPRECATED: This field is being replaced by routers setting their own defaults. This is the \"default\" route.", } func (RoutingConfig) SwaggerDoc() map[string]string { return map_RoutingConfig } var map_SecurityAllocator = map[string]string{ "": "SecurityAllocator controls the automatic allocation of UIDs and MCS labels to a project. If nil, allocation is disabled.", "uidAllocatorRange": "UIDAllocatorRange defines the total set of Unix user IDs (UIDs) that will be allocated to projects automatically, and the size of the block each namespace gets. For example, 1000-1999/10 will allocate ten UIDs per namespace, and will be able to allocate up to 100 blocks before running out of space. The default is to allocate from 1 billion to 2 billion in 10k blocks (which is the expected size of the ranges Docker images will use once user namespaces are started).", "mcsAllocatorRange": "MCSAllocatorRange defines the range of MCS categories that will be assigned to namespaces. The format is \"<prefix>/<numberOfLabels>[,<maxCategory>]\". The default is \"s0/2\" and will allocate from c0 -> c1023, which means a total of 535k labels are available (1024 choose 2 ~ 535k). If this value is changed after startup, new projects may receive labels that are already allocated to other projects. Prefix may be any valid SELinux set of terms (including user, role, and type), although leaving them as the default will allow the server to set them automatically.\n\nExamples: * s0:/2 - Allocate labels from s0:c0,c0 to s0:c511,c511 * s0:/2,512 - Allocate labels from s0:c0,c0,c0 to s0:c511,c511,511", "mcsLabelsPerProject": "MCSLabelsPerProject defines the number of labels that should be reserved per project. The default is 5 to match the default UID and MCS ranges (100k namespaces, 535k/5 labels).", } func (SecurityAllocator) SwaggerDoc() map[string]string { return map_SecurityAllocator } var map_ServiceAccountConfig = map[string]string{ "": "ServiceAccountConfig holds the necessary configuration options for a service account", "managedNames": "ManagedNames is a list of service account names that will be auto-created in every namespace. If no names are specified, the ServiceAccountsController will not be started.", "limitSecretReferences": "LimitSecretReferences controls whether or not to allow a service account to reference any secret in a namespace without explicitly referencing them", "privateKeyFile": "PrivateKeyFile is a file containing a PEM-encoded private RSA key, used to sign service account tokens. If no private key is specified, the service account TokensController will not be started.", "publicKeyFiles": "PublicKeyFiles is a list of files, each containing a PEM-encoded public RSA key. (If any file contains a private key, the public portion of the key is used) The list of public keys is used to verify presented service account tokens. Each key is tried in order until the list is exhausted or verification succeeds. If no keys are specified, no service account authentication will be available.", "masterCA": "MasterCA is the CA for verifying the TLS connection back to the master. The service account controller will automatically inject the contents of this file into pods so they can verify connections to the master.", } func (ServiceAccountConfig) SwaggerDoc() map[string]string { return map_ServiceAccountConfig } var map_ServiceServingCert = map[string]string{ "": "ServiceServingCert holds configuration for service serving cert signer which creates cert/key pairs for pods fulfilling a service to serve with.", "signer": "Signer holds the signing information used to automatically sign serving certificates. If this value is nil, then certs are not signed automatically.", } func (ServiceServingCert) SwaggerDoc() map[string]string { return map_ServiceServingCert } var map_ServingInfo = map[string]string{ "": "ServingInfo holds information about serving web pages", "bindAddress": "BindAddress is the ip:port to serve on", "bindNetwork": "BindNetwork is the type of network to bind to - defaults to \"tcp4\", accepts \"tcp\", \"tcp4\", and \"tcp6\"", "clientCA": "ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates", "namedCertificates": "NamedCertificates is a list of certificates to use to secure requests to specific hostnames", } func (ServingInfo) SwaggerDoc() map[string]string { return map_ServingInfo } var map_SessionConfig = map[string]string{ "": "SessionConfig specifies options for cookie-based sessions. Used by AuthRequestHandlerSession", "sessionSecretsFile": "SessionSecretsFile is a reference to a file containing a serialized SessionSecrets object If no file is specified, a random signing and encryption key are generated at each server start", "sessionMaxAgeSeconds": "SessionMaxAgeSeconds specifies how long created sessions last. Used by AuthRequestHandlerSession", "sessionName": "SessionName is the cookie name used to store the session", } func (SessionConfig) SwaggerDoc() map[string]string { return map_SessionConfig } var map_SessionSecret = map[string]string{ "": "SessionSecret is a secret used to authenticate/decrypt cookie-based sessions", "authentication": "Authentication is used to authenticate sessions using HMAC. Recommended to use a secret with 32 or 64 bytes.", "encryption": "Encryption is used to encrypt sessions. Must be 16, 24, or 32 characters long, to select AES-128, AES-", } func (SessionSecret) SwaggerDoc() map[string]string { return map_SessionSecret } var map_SessionSecrets = map[string]string{ "": "SessionSecrets list the secrets to use to sign/encrypt and authenticate/decrypt created sessions.", "secrets": "Secrets is a list of secrets New sessions are signed and encrypted using the first secret. Existing sessions are decrypted/authenticated by each secret until one succeeds. This allows rotating secrets.", } func (SessionSecrets) SwaggerDoc() map[string]string { return map_SessionSecrets } var map_StringSource = map[string]string{ "": "StringSource allows specifying a string inline, or externally via env var or file. When it contains only a string value, it marshals to a simple JSON string.", } func (StringSource) SwaggerDoc() map[string]string { return map_StringSource } var map_StringSourceSpec = map[string]string{ "": "StringSourceSpec specifies a string value, or external location", "value": "Value specifies the cleartext value, or an encrypted value if keyFile is specified.", "env": "Env specifies an envvar containing the cleartext value, or an encrypted value if the keyFile is specified.", "file": "File references a file containing the cleartext value, or an encrypted value if a keyFile is specified.", "keyFile": "KeyFile references a file containing the key to use to decrypt the value.", } func (StringSourceSpec) SwaggerDoc() map[string]string { return map_StringSourceSpec } var map_TokenConfig = map[string]string{ "": "TokenConfig holds the necessary configuration options for authorization and access tokens", "authorizeTokenMaxAgeSeconds": "AuthorizeTokenMaxAgeSeconds defines the maximum age of authorize tokens", "accessTokenMaxAgeSeconds": "AccessTokenMaxAgeSeconds defines the maximum age of access tokens", } func (TokenConfig) SwaggerDoc() map[string]string { return map_TokenConfig } var map_UserAgentDenyRule = map[string]string{ "": "UserAgentDenyRule adds a rejection message that can be used to help a user figure out how to get an approved client", "rejectionMessage": "RejectionMessage is the message shown when rejecting a client. If it is not a set, the default message is used.", } func (UserAgentDenyRule) SwaggerDoc() map[string]string { return map_UserAgentDenyRule } var map_UserAgentMatchRule = map[string]string{ "": "UserAgentMatchRule describes how to match a given request based on User-Agent and HTTPVerb", "regex": "UserAgentRegex is a regex that is checked against the User-Agent. Known variants of oc clients 1. oc accessing kube resources: oc/v1.2.0 (linux/amd64) kubernetes/bc4550d 2. oc accessing openshift resources: oc/v1.1.3 (linux/amd64) openshift/b348c2f 3. openshift kubectl accessing kube resources: openshift/v1.2.0 (linux/amd64) kubernetes/bc4550d 4. openshit kubectl accessing openshift resources: openshift/v1.1.3 (linux/amd64) openshift/b348c2f 5. oadm accessing kube resources: oadm/v1.2.0 (linux/amd64) kubernetes/bc4550d 6. oadm accessing openshift resources: oadm/v1.1.3 (linux/amd64) openshift/b348c2f 7. openshift cli accessing kube resources: openshift/v1.2.0 (linux/amd64) kubernetes/bc4550d 8. openshift cli accessing openshift resources: openshift/v1.1.3 (linux/amd64) openshift/b348c2f", "httpVerbs": "HTTPVerbs specifies which HTTP verbs should be matched. An empty list means \"match all verbs\".", } func (UserAgentMatchRule) SwaggerDoc() map[string]string { return map_UserAgentMatchRule } var map_UserAgentMatchingConfig = map[string]string{ "": "UserAgentMatchingConfig controls how API calls from *voluntarily* identifying clients will be handled. THIS DOES NOT DEFEND AGAINST MALICIOUS CLIENTS!", "requiredClients": "If this list is non-empty, then a User-Agent must match one of the UserAgentRegexes to be allowed", "deniedClients": "If this list is non-empty, then a User-Agent must not match any of the UserAgentRegexes", "defaultRejectionMessage": "DefaultRejectionMessage is the message shown when rejecting a client. If it is not a set, a generic message is given.", } func (UserAgentMatchingConfig) SwaggerDoc() map[string]string { return map_UserAgentMatchingConfig }
jprukner/origin
pkg/cmd/server/api/v1/swagger_doc.go
GO
apache-2.0
63,169
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.beam.sdk.nexmark.model; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Serializable; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.CoderException; import org.apache.beam.sdk.coders.CustomCoder; import org.apache.beam.sdk.coders.VarLongCoder; import org.apache.beam.sdk.nexmark.NexmarkUtils; /** * Result of Query6. */ public class SellerPrice implements KnownSize, Serializable { private static final Coder<Long> LONG_CODER = VarLongCoder.of(); public static final Coder<SellerPrice> CODER = new CustomCoder<SellerPrice>() { @Override public void encode(SellerPrice value, OutputStream outStream) throws CoderException, IOException { LONG_CODER.encode(value.seller, outStream); LONG_CODER.encode(value.price, outStream); } @Override public SellerPrice decode( InputStream inStream) throws CoderException, IOException { long seller = LONG_CODER.decode(inStream); long price = LONG_CODER.decode(inStream); return new SellerPrice(seller, price); } @Override public void verifyDeterministic() throws NonDeterministicException {} }; @JsonProperty public final long seller; /** Price in cents. */ @JsonProperty private final long price; // For Avro only. @SuppressWarnings("unused") private SellerPrice() { seller = 0; price = 0; } public SellerPrice(long seller, long price) { this.seller = seller; this.price = price; } @Override public long sizeInBytes() { return 8 + 8; } @Override public String toString() { try { return NexmarkUtils.MAPPER.writeValueAsString(this); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } }
shakamunyi/beam
sdks/java/nexmark/src/main/java/org/apache/beam/sdk/nexmark/model/SellerPrice.java
Java
apache-2.0
2,739
/***************************************************************************//** * \file cy_crypto_core_mem_v2.h * \version 2.30.1 * * \brief * This file provides the headers for the string management API * in the Crypto driver. * ******************************************************************************** * Copyright 2016-2019 Cypress Semiconductor Corporation * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ #if !defined(CY_CRYPTO_CORE_MEM_V2_H) #define CY_CRYPTO_CORE_MEM_V2_H #include "cy_crypto_common.h" #if defined(CY_IP_MXCRYPTO) #if defined(__cplusplus) extern "C" { #endif void Cy_Crypto_Core_V2_MemCpy(CRYPTO_Type *base, void* dst, void const *src, uint16_t size); void Cy_Crypto_Core_V2_MemSet(CRYPTO_Type *base, void* dst, uint8_t data, uint16_t size); uint32_t Cy_Crypto_Core_V2_MemCmp(CRYPTO_Type *base, void const *src0, void const *src1, uint16_t size); void Cy_Crypto_Core_V2_MemXor(CRYPTO_Type *base, void* dst, void const *src0, void const *src1, uint16_t size); #if defined(__cplusplus) } #endif #endif /* CY_IP_MXCRYPTO */ #endif /* #if !defined(CY_CRYPTO_CORE_MEM_V2_H) */ /* [] END OF FILE */
kjbracey-arm/mbed
targets/TARGET_Cypress/TARGET_PSOC6/psoc6pdl/drivers/include/cy_crypto_core_mem_v2.h
C
apache-2.0
1,876
/* * Copyright 2012-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.android; import com.android.ddmlib.Client; import com.android.ddmlib.FileListingService; import com.android.ddmlib.IDevice; import com.android.ddmlib.IShellOutputReceiver; import com.android.ddmlib.InstallException; import com.android.ddmlib.RawImage; import com.android.ddmlib.ScreenRecorderOptions; import com.android.ddmlib.SyncService; import com.android.ddmlib.log.LogReceiver; import com.android.sdklib.AndroidVersion; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; /** Basic implementation of IDevice for mocking purposes. */ public class TestDevice implements IDevice { private boolean isEmulator; private String name; private String serialNumber; private DeviceState state; private Map<String, String> properties; public static TestDevice createEmulator(String serial) { TestDevice device = new TestDevice(); device.setIsEmulator(true); device.setSerialNumber(serial); device.setName("emulator-" + serial); device.setState(IDevice.DeviceState.ONLINE); return device; } public static TestDevice createRealDevice(String serial) { TestDevice device = new TestDevice(); device.setIsEmulator(false); device.setSerialNumber(serial); device.setName("device-" + serial); device.setState(IDevice.DeviceState.ONLINE); return device; } public TestDevice() { properties = new HashMap<>(); } public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } @Override public String getSerialNumber() { return serialNumber; } @Override public String getAvdName() { if (isEmulator()) { return name; } else { return null; } } public void setName(String name) { this.name = name; } @Override public String getName() { return name; } public void setIsEmulator(boolean isEmulator) { this.isEmulator = isEmulator; } @Override public boolean isEmulator() { return isEmulator; } public void setState(IDevice.DeviceState state) { this.state = state; } @Override public IDevice.DeviceState getState() { return state; } @Override public boolean isOnline() { return state == IDevice.DeviceState.ONLINE; } @Override public boolean isOffline() { return state == IDevice.DeviceState.OFFLINE; } @Override public boolean isBootLoader() { return state == IDevice.DeviceState.BOOTLOADER; } @Override public Map<String, String> getProperties() { return Collections.unmodifiableMap(properties); } @Override public int getPropertyCount() { return properties.size(); } @Override public String getProperty(String s) { return properties.get(s); } @Override public boolean arePropertiesSet() { return true; } @Override public String getPropertySync(String s) { throw new UnsupportedOperationException(); } @Override public String getPropertyCacheOrSync(String s) { throw new UnsupportedOperationException(); } @Override public boolean supportsFeature(IDevice.Feature feature) { throw new UnsupportedOperationException(); } @Override public boolean supportsFeature(IDevice.HardwareFeature feature) { return false; } @Override public String getMountPoint(String s) { throw new UnsupportedOperationException(); } @Override public boolean hasClients() { throw new UnsupportedOperationException(); } @Override public Client[] getClients() { throw new UnsupportedOperationException(); } @Override public Client getClient(String s) { throw new UnsupportedOperationException(); } @Override public String getClientName(int i) { throw new UnsupportedOperationException(); } @Override public SyncService getSyncService() { throw new UnsupportedOperationException(); } @Override public FileListingService getFileListingService() { throw new UnsupportedOperationException(); } @Override public RawImage getScreenshot() { throw new UnsupportedOperationException(); } @Override public RawImage getScreenshot(long timeout, TimeUnit unit) { return null; } @Override public void startScreenRecorder( String remoteFilePath, ScreenRecorderOptions options, IShellOutputReceiver receiver) { throw new UnsupportedOperationException(); } @Override public void executeShellCommand(String s, IShellOutputReceiver iShellOutputReceiver) { throw new UnsupportedOperationException(); } @Deprecated @Override public void executeShellCommand(String s, IShellOutputReceiver iShellOutputReceiver, int i) { throw new UnsupportedOperationException(); } @Override public void executeShellCommand( String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, TimeUnit maxTimeUnits) { throw new UnsupportedOperationException(); } @Override public Future<String> getSystemProperty(String name) { return null; } @Override public void runEventLogService(LogReceiver logReceiver) { throw new UnsupportedOperationException(); } @Override public void runLogService(String s, LogReceiver logReceiver) { throw new UnsupportedOperationException(); } @Override public void createForward(int i, int i1) { throw new UnsupportedOperationException(); } @Override public void createForward( int i, String s, IDevice.DeviceUnixSocketNamespace deviceUnixSocketNamespace) { throw new UnsupportedOperationException(); } @Override public void removeForward(int i, int i1) { throw new UnsupportedOperationException(); } @Override public void removeForward( int i, String s, IDevice.DeviceUnixSocketNamespace deviceUnixSocketNamespace) { throw new UnsupportedOperationException(); } @Override public void pushFile(String s, String s1) { throw new UnsupportedOperationException(); } @Override public void pullFile(String s, String s1) { throw new UnsupportedOperationException(); } @Override public void installPackage(String s, boolean b, String... strings) throws InstallException { throw new UnsupportedOperationException(); } @Override public void installPackages( List<File> apks, boolean reinstall, List<String> installOptions, long timeout, TimeUnit timeoutUnit) {} @Override public String syncPackageToDevice(String s) { throw new UnsupportedOperationException(); } @Override public void installRemotePackage(String s, boolean b, String... strings) { throw new UnsupportedOperationException(); } @Override public void removeRemotePackage(String s) { throw new UnsupportedOperationException(); } @Override public String uninstallPackage(String s) { throw new UnsupportedOperationException(); } @Override public void reboot(String s) { throw new UnsupportedOperationException(); } @Override public boolean root() { return false; } @Override public boolean isRoot() { return false; } @Override public Integer getBatteryLevel() { throw new UnsupportedOperationException(); } @Override public Integer getBatteryLevel(long l) { throw new UnsupportedOperationException(); } @Override public Future<Integer> getBattery() { return null; } @Override public Future<Integer> getBattery(long freshnessTime, TimeUnit timeUnit) { return null; } @Override public List<String> getAbis() { return null; } @Override public int getDensity() { return 0; } @Override public String getLanguage() { return null; } @Override public String getRegion() { return null; } @Override public AndroidVersion getVersion() { return null; } }
LegNeato/buck
test/com/facebook/buck/android/TestDevice.java
Java
apache-2.0
8,561
// RootFolder.cpp #include "StdAfx.h" #include "resource.h" #include "RootFolder.h" #include "Common/StringConvert.h" #include "../../PropID.h" #include "Windows/Defs.h" #include "Windows/PropVariant.h" #ifdef _WIN32 #include "FSDrives.h" #include "PhysDriveFolder.h" #include "NetFolder.h" #endif #include "SysIconUtils.h" #include "LangUtils.h" using namespace NWindows; static const STATPROPSTG kProperties[] = { { NULL, kpidName, VT_BSTR} }; // static const wchar_t *kMyComputerTitle = L"Computer"; // static const wchar_t *kMyNetworkTitle = L"Network"; #ifdef _WIN32 UString RootFolder_GetName_Computer(int &iconIndex) { iconIndex = GetIconIndexForCSIDL(CSIDL_DRIVES); return LangString(IDS_COMPUTER, 0x03020300); } UString RootFolder_GetName_Network(int &iconIndex) { iconIndex = GetIconIndexForCSIDL(CSIDL_NETWORK); return LangString(IDS_NETWORK, 0x03020301); } UString RootFolder_GetName_Documents(int &iconIndex) { iconIndex = GetIconIndexForCSIDL(CSIDL_PERSONAL); return LangString(IDS_DOCUMENTS, 0x03020302); ; } const int ROOT_INDEX_COMPUTER = 0; const int ROOT_INDEX_DOCUMENTS = 1; const int ROOT_INDEX_NETWORK = 2; void CRootFolder::Init() { _names[ROOT_INDEX_COMPUTER] = RootFolder_GetName_Computer(_iconIndices[ROOT_INDEX_COMPUTER]); _names[ROOT_INDEX_DOCUMENTS] = RootFolder_GetName_Documents(_iconIndices[ROOT_INDEX_DOCUMENTS]); _names[ROOT_INDEX_NETWORK] = RootFolder_GetName_Network(_iconIndices[ROOT_INDEX_NETWORK]); } #else void CRootFolder::Init() { } #endif STDMETHODIMP CRootFolder::LoadItems() { Init(); return S_OK; } STDMETHODIMP CRootFolder::GetNumberOfItems(UInt32 *numItems) { #ifdef _WIN32 *numItems = kNumRootFolderItems; #else *numItems = 1; // only "/" ! #endif return S_OK; } STDMETHODIMP CRootFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value) { NCOM::CPropVariant prop; switch(propID) { case kpidIsDir: prop = true; break; #ifdef _WIN32 case kpidName: prop = _names[itemIndex]; break; #else case kpidName: prop = L"/"; break; #endif } prop.Detach(value); return S_OK; } #ifdef _WIN32 UString GetMyDocsPath() { UString us; WCHAR s[MAX_PATH + 1]; if (SHGetSpecialFolderPathW(0, s, CSIDL_PERSONAL, FALSE)) us = s; #ifndef _UNICODE else { CHAR s2[MAX_PATH + 1]; if (SHGetSpecialFolderPathA(0, s2, CSIDL_PERSONAL, FALSE)) us = GetUnicodeString(s2); } #endif if (us.Length() > 0 && us[us.Length() - 1] != L'\\') us += L'\\'; return us; } #endif STDMETHODIMP CRootFolder::BindToFolder(UInt32 index, IFolderFolder **resultFolder) { #ifdef _WIN32 if (index == ROOT_INDEX_COMPUTER) { CFSDrives *fsDrivesSpec = new CFSDrives; CMyComPtr<IFolderFolder> subFolder = fsDrivesSpec; fsDrivesSpec->Init(); *resultFolder = subFolder.Detach(); } else if (index == ROOT_INDEX_NETWORK) { CNetFolder *netFolderSpec = new CNetFolder; CMyComPtr<IFolderFolder> subFolder = netFolderSpec; netFolderSpec->Init(0, 0, _names[ROOT_INDEX_NETWORK] + L'\\'); *resultFolder = subFolder.Detach(); } else if (index == ROOT_INDEX_DOCUMENTS) { UString s = GetMyDocsPath(); if (!s.IsEmpty()) { NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder; CMyComPtr<IFolderFolder> subFolder = fsFolderSpec; RINOK(fsFolderSpec->Init(s, NULL)); *resultFolder = subFolder.Detach(); } } else return E_INVALIDARG; return S_OK; #else return E_INVALIDARG; #endif } static bool AreEqualNames(const UString &name1, const UString &name2) { return (name1 == name2 || name1 == (name2 + UString(WCHAR_PATH_SEPARATOR))); } STDMETHODIMP CRootFolder::BindToFolder(const wchar_t *name, IFolderFolder **resultFolder) { *resultFolder = 0; UString name2 = name; name2.Trim(); if (name2.IsEmpty()) { CRootFolder *rootFolderSpec = new CRootFolder; CMyComPtr<IFolderFolder> rootFolder = rootFolderSpec; rootFolderSpec->Init(); *resultFolder = rootFolder.Detach(); return S_OK; } #ifdef _WIN32 for (int i = 0; i < kNumRootFolderItems; i++) if (AreEqualNames(name2, _names[i])) return BindToFolder((UInt32)i, resultFolder); if (AreEqualNames(name2, L"My Documents") || AreEqualNames(name2, L"Documents")) return BindToFolder((UInt32)ROOT_INDEX_DOCUMENTS, resultFolder); if (AreEqualNames(name2, L"My Computer") || AreEqualNames(name2, L"Computer")) return BindToFolder((UInt32)ROOT_INDEX_COMPUTER, resultFolder); #endif if (name2 == UString(WCHAR_PATH_SEPARATOR)) { CMyComPtr<IFolderFolder> subFolder = this; *resultFolder = subFolder.Detach(); return S_OK; } if (name2.Length () < 2) return E_INVALIDARG; CMyComPtr<IFolderFolder> subFolder; #ifdef _WIN32 if (name2.Left(4) == L"\\\\.\\") { CPhysDriveFolder *folderSpec = new CPhysDriveFolder; subFolder = folderSpec; RINOK(folderSpec->Init(name2.Mid(4, 2))); } else #endif { if (name2[name2.Length () - 1] != WCHAR_PATH_SEPARATOR) name2 += WCHAR_PATH_SEPARATOR; NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder; subFolder = fsFolderSpec; if (fsFolderSpec->Init(name2, 0) != S_OK) { #ifdef _WIN32 if (name2[0] == WCHAR_PATH_SEPARATOR) { CNetFolder *netFolderSpec = new CNetFolder; subFolder = netFolderSpec; netFolderSpec->Init(name2); } else #endif return E_INVALIDARG; } } *resultFolder = subFolder.Detach(); return S_OK; } STDMETHODIMP CRootFolder::BindToParentFolder(IFolderFolder **resultFolder) { *resultFolder = 0; return S_OK; } STDMETHODIMP CRootFolder::GetNumberOfProperties(UInt32 *numProperties) { *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); return S_OK; } STDMETHODIMP CRootFolder::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) { if (index >= sizeof(kProperties) / sizeof(kProperties[0])) return E_INVALIDARG; const STATPROPSTG &prop = kProperties[index]; *propID = prop.propid; *varType = prop.vt; *name = 0; return S_OK; } STDMETHODIMP CRootFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value) { NWindows::NCOM::CPropVariant prop; switch(propID) { case kpidType: prop = L"RootFolder"; break; case kpidPath: prop = L""; break; } prop.Detach(value); return S_OK; } STDMETHODIMP CRootFolder::GetSystemIconIndex(UInt32 index, INT32 *iconIndex) { #ifdef _WIN32 *iconIndex = _iconIndices[index]; #else *iconIndex = -1; // FIXME - folder icon ? #endif return S_OK; }
Nathaniel1990/Amendroid7z
jni/CPP/7zip/UI/FileManager/RootFolder.cpp
C++
apache-2.0
6,589
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.model.internal.core; import org.gradle.model.internal.type.ModelType; import java.util.List; public abstract class ModelViews { public static <T> ModelView<T> assertType(ModelView<?> untypedView, ModelType<T> type) { if (type.isAssignableFrom(untypedView.getType())) { @SuppressWarnings("unchecked") ModelView<T> view = (ModelView<T>) untypedView; return view; } else { // TODO better exception type throw new IllegalArgumentException("Model view of type " + untypedView.getType() + " requested as " + type); } } public static <T> ModelView<T> assertType(ModelView<?> untypedView, Class<T> type) { return assertType(untypedView, ModelType.of(type)); } public static <T> ModelView<T> assertType(ModelView<?> untypedView, ModelReference<T> reference) { return assertType(untypedView, reference.getType()); } public static <T> T getInstance(ModelView<?> untypedView, ModelReference<T> reference) { return assertType(untypedView, reference.getType()).getInstance(); } public static <T> T getInstance(ModelView<?> untypedView, ModelType<T> type) { return assertType(untypedView, type).getInstance(); } public static <T> T getInstance(ModelView<?> untypedView, Class<T> type) { return assertType(untypedView, ModelType.of(type)).getInstance(); } public static <T> T getInstance(List<? extends ModelView<?>> views, int index, ModelType<T> type) { return getInstance(views.get(index), type); } public static <T> T getInstance(List<? extends ModelView<?>> views, int index, Class<T> type) { return getInstance(views.get(index), type); } }
gstevey/gradle
subprojects/model-core/src/main/java/org/gradle/model/internal/core/ModelViews.java
Java
apache-2.0
2,369
/* * Copyright 2016-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.onosproject.yangutils.parser.impl.listeners; import java.io.IOException; import java.util.ListIterator; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.onosproject.yangutils.datamodel.YangContainer; import org.onosproject.yangutils.datamodel.YangDataTypes; import org.onosproject.yangutils.datamodel.YangLeaf; import org.onosproject.yangutils.datamodel.YangList; import org.onosproject.yangutils.datamodel.YangModule; import org.onosproject.yangutils.datamodel.YangNode; import org.onosproject.yangutils.datamodel.YangNodeType; import org.onosproject.yangutils.datamodel.YangStatusType; import org.onosproject.yangutils.parser.exceptions.ParserException; import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; /** * Test cases for testing container listener. */ public class ContainerListenerTest { @Rule public ExpectedException thrown = ExpectedException.none(); private final YangUtilsParserManager manager = new YangUtilsParserManager(); /** * Checks container statement as sub-statement of module. */ @Test public void processModuleSubStatementContainer() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementContainer.yang"); assertThat((node instanceof YangModule), is(true)); // Check whether the node type is set properly to module. assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE)); // Check whether the module name is set correctly. YangModule yangNode = (YangModule) node; assertThat(yangNode.getName(), is("Test")); // Check whether the container is child of module YangContainer yangContainer = (YangContainer) yangNode.getChild(); assertThat(yangContainer.getName(), is("valid")); } /** * Checks if container identifier in module is duplicate. */ @Test(expected = ParserException.class) public void processModuleDuplicateContainer() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ModuleDuplicateContainer.yang"); } /** * Checks if container identifier in container is duplicate. */ @Test(expected = ParserException.class) public void processContainerDuplicateContainer() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ContainerDuplicateContainer.yang"); } /** * Checks if container identifier in list is duplicate. */ @Test(expected = ParserException.class) public void processListDuplicateContainer() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ListDuplicateContainer.yang"); } /** * Checks if container identifier collides with list at same level. */ @Test(expected = ParserException.class) public void processDuplicateContainerAndList() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/DuplicateContainerAndList.yang"); } /** * Checks container statement as sub-statement of container. */ @Test public void processContainerSubStatementContainer() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementContainer.yang"); assertThat((node instanceof YangModule), is(true)); // Check whether the node type is set properly to module. assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE)); // Check whether the module name is set correctly. YangModule yangNode = (YangModule) node; assertThat(yangNode.getName(), is("Test")); // Check whether the container is child of module YangContainer yangContainer = (YangContainer) yangNode.getChild(); assertThat(yangContainer.getName(), is("ospf")); // Check whether the container is child of container YangContainer yangContainer1 = (YangContainer) yangContainer.getChild(); assertThat(yangContainer1.getName(), is("valid")); } /** * Checks container statement as sub-statement of list. */ @Test public void processListSubStatementContainer() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ListSubStatementContainer.yang"); assertThat((node instanceof YangModule), is(true)); // Check whether the node type is set properly to module. assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE)); // Check whether the module name is set correctly. YangModule yangNode = (YangModule) node; assertThat(yangNode.getName(), is("Test")); // Check whether the list is child of module YangList yangList1 = (YangList) yangNode.getChild(); assertThat(yangList1.getName(), is("ospf")); ListIterator<String> keyList = yangList1.getKeyList().listIterator(); assertThat(keyList.next(), is("process-id")); // Check whether the list is child of list YangContainer yangContainer = (YangContainer) yangList1.getChild(); assertThat(yangContainer.getName(), is("interface")); } /** * Checks container with all its sub-statements. */ @Test public void processContainerSubStatements() throws IOException, ParserException { YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatements.yang"); assertThat((node instanceof YangModule), is(true)); // Check whether the node type is set properly to module. assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE)); // Check whether the module name is set correctly. YangModule yangNode = (YangModule) node; assertThat(yangNode.getName(), is("Test")); // Check whether the container is child of module YangContainer yangContainer = (YangContainer) yangNode.getChild(); // Check whether container properties as set correctly. assertThat(yangContainer.getName(), is("ospf")); assertThat(yangContainer.isConfig(), is(true)); assertThat(yangContainer.getPresence(), is("\"ospf logs\"")); assertThat(yangContainer.getDescription(), is("\"container description\"")); assertThat(yangContainer.getStatus(), is(YangStatusType.CURRENT)); assertThat(yangContainer.getReference(), is("\"container reference\"")); // Check whether leaf properties as set correctly. ListIterator<YangLeaf> leafIterator = yangContainer.getListOfLeaf().listIterator(); YangLeaf leafInfo = leafIterator.next(); assertThat(leafInfo.getName(), is("invalid-interval")); assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16")); assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16)); assertThat(leafInfo.getUnits(), is("\"seconds\"")); assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT)); assertThat(leafInfo.getReference(), is("\"RFC 6020\"")); } /** * Checks cardinality of sub-statements of container. */ @Test public void processContainerSubStatementCardinality() throws IOException, ParserException { thrown.expect(ParserException.class); thrown.expectMessage("YANG file error: \"reference\" is defined more than once in \"container valid\"."); YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementCardinality.yang"); } /** * Checks container as root node. */ @Test public void processContainerRootNode() throws IOException, ParserException { thrown.expect(ParserException.class); thrown.expectMessage("no viable alternative at input 'container'"); YangNode node = manager.getDataModel("src/test/resources/ContainerRootNode.yang"); } /** * Checks invalid identifier for container statement. */ @Test public void processContainerInvalidIdentifier() throws IOException, ParserException { thrown.expect(ParserException.class); thrown.expectMessage("YANG file error : container name 1valid is not valid."); YangNode node = manager.getDataModel("src/test/resources/ContainerInvalidIdentifier.yang"); } }
Phaneendra-Huawei/demo
utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListenerTest.java
Java
apache-2.0
9,156
--- layout: "docs_api" version: "1.0.0-rc.5" versionHref: "/docs" path: "api/controller/ionicModal/" title: "ionicModal" header_sub_title: "Controller in module ionic" doc: "ionicModal" docType: "controller" --- <div class="improve-docs"> <a href='http://github.com/driftyco/ionic/tree/master/js/angular/service/modal.js#L80'> View Source </a> &nbsp; <a href='http://github.com/driftyco/ionic/edit/master/js/angular/service/modal.js#L80'> Improve this doc </a> </div> <h1 class="api-title"> ionicModal </h1> Instantiated by the <a href="/docs/api/service/$ionicModal/"><code>$ionicModal</code></a> service. Be sure to call [remove()](#remove) when you are done with each modal to clean it up and avoid memory leaks. Note: a modal will broadcast 'modal.shown', 'modal.hidden', and 'modal.removed' events from its originating scope, passing in itself as an event argument. Note: both modal.removed and modal.hidden are called when the modal is removed. ## Methods <div id="initialize"></div> <h2> <code>initialize(options)</code> </h2> Creates a new modal controller instance. <table class="table" style="margin:0;"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> options </td> <td> <code>object</code> </td> <td> <p>An options object with the following properties:</p> <ul> <li><code>{object=}</code> <code>scope</code> The scope to be a child of. Default: creates a child of $rootScope.</li> <li><code>{string=}</code> <code>animation</code> The animation to show &amp; hide with. Default: &#39;slide-in-up&#39;</li> <li><code>{boolean=}</code> <code>focusFirstInput</code> Whether to autofocus the first input of the modal when shown. Will only show the keyboard on iOS, to force the keyboard to show on Android, please use the <a href="https://github.com/driftyco/ionic-plugin-keyboard#keyboardshow">Ionic keyboard plugin</a>. Default: false.</li> <li><code>{boolean=}</code> <code>backdropClickToClose</code> Whether to close the modal on clicking the backdrop. Default: true.</li> <li><code>{boolean=}</code> <code>hardwareBackButtonClose</code> Whether the modal can be closed using the hardware back button on Android and similar devices. Default: true.</li> </ul> </td> </tr> </tbody> </table> <div id="show"></div> <h2> <code>show()</code> </h2> Show this modal instance. * Returns: <code>promise</code> A promise which is resolved when the modal is finished animating in. <div id="hide"></div> <h2> <code>hide()</code> </h2> Hide this modal instance. * Returns: <code>promise</code> A promise which is resolved when the modal is finished animating out. <div id="remove"></div> <h2> <code>remove()</code> </h2> Remove this modal instance from the DOM and clean up. * Returns: <code>promise</code> A promise which is resolved when the modal is finished animating out. <div id="isShown"></div> <h2> <code>isShown()</code> </h2> * Returns: boolean Whether this modal is currently shown.
philmerrell/ionic-site
docs/1.0.0-rc.5/api/controller/ionicModal/index.md
Markdown
apache-2.0
3,233
/* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package status implements errors returned by gRPC. These errors are // serialized and transmitted on the wire between server and client, and allow // for additional data to be transmitted via the Details field in the status // proto. gRPC service handlers should return an error created by this // package, and gRPC clients should expect a corresponding error to be // returned from the RPC call. // // This package upholds the invariants that a non-nil error may not // contain an OK code, and an OK code must result in a nil error. package status import ( "context" "errors" "fmt" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" spb "google.golang.org/genproto/googleapis/rpc/status" "google.golang.org/grpc/codes" "google.golang.org/grpc/internal" ) func init() { internal.StatusRawProto = statusRawProto } func statusRawProto(s *Status) *spb.Status { return s.s } // statusError is an alias of a status proto. It implements error and Status, // and a nil statusError should never be returned by this package. type statusError spb.Status func (se *statusError) Error() string { p := (*spb.Status)(se) return fmt.Sprintf("rpc error: code = %s desc = %s", codes.Code(p.GetCode()), p.GetMessage()) } func (se *statusError) GRPCStatus() *Status { return &Status{s: (*spb.Status)(se)} } // Status represents an RPC status code, message, and details. It is immutable // and should be created with New, Newf, or FromProto. type Status struct { s *spb.Status } // Code returns the status code contained in s. func (s *Status) Code() codes.Code { if s == nil || s.s == nil { return codes.OK } return codes.Code(s.s.Code) } // Message returns the message contained in s. func (s *Status) Message() string { if s == nil || s.s == nil { return "" } return s.s.Message } // Proto returns s's status as an spb.Status proto message. func (s *Status) Proto() *spb.Status { if s == nil { return nil } return proto.Clone(s.s).(*spb.Status) } // Err returns an immutable error representing s; returns nil if s.Code() is // OK. func (s *Status) Err() error { if s.Code() == codes.OK { return nil } return (*statusError)(s.s) } // New returns a Status representing c and msg. func New(c codes.Code, msg string) *Status { return &Status{s: &spb.Status{Code: int32(c), Message: msg}} } // Newf returns New(c, fmt.Sprintf(format, a...)). func Newf(c codes.Code, format string, a ...interface{}) *Status { return New(c, fmt.Sprintf(format, a...)) } // Error returns an error representing c and msg. If c is OK, returns nil. func Error(c codes.Code, msg string) error { return New(c, msg).Err() } // Errorf returns Error(c, fmt.Sprintf(format, a...)). func Errorf(c codes.Code, format string, a ...interface{}) error { return Error(c, fmt.Sprintf(format, a...)) } // ErrorProto returns an error representing s. If s.Code is OK, returns nil. func ErrorProto(s *spb.Status) error { return FromProto(s).Err() } // FromProto returns a Status representing s. func FromProto(s *spb.Status) *Status { return &Status{s: proto.Clone(s).(*spb.Status)} } // FromError returns a Status representing err if it was produced from this // package or has a method `GRPCStatus() *Status`. Otherwise, ok is false and a // Status is returned with codes.Unknown and the original error message. func FromError(err error) (s *Status, ok bool) { if err == nil { return &Status{s: &spb.Status{Code: int32(codes.OK)}}, true } if se, ok := err.(interface { GRPCStatus() *Status }); ok { return se.GRPCStatus(), true } return New(codes.Unknown, err.Error()), false } // Convert is a convenience function which removes the need to handle the // boolean return value from FromError. func Convert(err error) *Status { s, _ := FromError(err) return s } // WithDetails returns a new status with the provided details messages appended to the status. // If any errors are encountered, it returns nil and the first error encountered. func (s *Status) WithDetails(details ...proto.Message) (*Status, error) { if s.Code() == codes.OK { return nil, errors.New("no error details for status with code OK") } // s.Code() != OK implies that s.Proto() != nil. p := s.Proto() for _, detail := range details { any, err := ptypes.MarshalAny(detail) if err != nil { return nil, err } p.Details = append(p.Details, any) } return &Status{s: p}, nil } // Details returns a slice of details messages attached to the status. // If a detail cannot be decoded, the error is returned in place of the detail. func (s *Status) Details() []interface{} { if s == nil || s.s == nil { return nil } details := make([]interface{}, 0, len(s.s.Details)) for _, any := range s.s.Details { detail := &ptypes.DynamicAny{} if err := ptypes.UnmarshalAny(any, detail); err != nil { details = append(details, err) continue } details = append(details, detail.Message) } return details } // Code returns the Code of the error if it is a Status error, codes.OK if err // is nil, or codes.Unknown otherwise. func Code(err error) codes.Code { // Don't use FromError to avoid allocation of OK status. if err == nil { return codes.OK } if se, ok := err.(interface { GRPCStatus() *Status }); ok { return se.GRPCStatus().Code() } return codes.Unknown } // FromContextError converts a context error into a Status. It returns a // Status with codes.OK if err is nil, or a Status with codes.Unknown if err is // non-nil and not a context error. func FromContextError(err error) *Status { switch err { case nil: return New(codes.OK, "") case context.DeadlineExceeded: return New(codes.DeadlineExceeded, err.Error()) case context.Canceled: return New(codes.Canceled, err.Error()) default: return New(codes.Unknown, err.Error()) } }
lovoo/drone-gcloud-helm
vendor/google.golang.org/grpc/status/status.go
GO
apache-2.0
6,405
#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import unittest import amulet class TestDeploy(unittest.TestCase): """ Deployment and smoke test for Apache Bigtop Mahout. """ @classmethod def setUpClass(cls): cls.d = amulet.Deployment(series='xenial') cls.d.add('mahout') cls.d.add('client', charm='hadoop-client') cls.d.add('namenode', charm='hadoop-namenode') cls.d.add('resourcemanager', charm='hadoop-resourcemanager') cls.d.add('slave', charm='hadoop-slave') cls.d.add('plugin', charm='hadoop-plugin') cls.d.relate('plugin:hadoop-plugin', 'client:hadoop') cls.d.relate('plugin:namenode', 'namenode:namenode') cls.d.relate('plugin:resourcemanager', 'resourcemanager:resourcemanager') cls.d.relate('slave:namenode', 'namenode:datanode') cls.d.relate('slave:resourcemanager', 'resourcemanager:nodemanager') cls.d.relate('namenode:namenode', 'resourcemanager:namenode') cls.d.relate('mahout:mahout', 'client:mahout') cls.d.setup(timeout=3600) cls.d.sentry.wait_for_messages({"mahout": "ready"}, timeout=3600) cls.mahout = cls.d.sentry['mahout'][0] def test_mahout(self): """ Validate Mahout by running the smoke-test action. """ uuid = self.mahout.run_action('smoke-test') result = self.d.action_fetch(uuid, full_output=True) # action status=completed on success if (result['status'] != "completed"): self.fail('Mahout smoke-test failed: %s' % result) if __name__ == '__main__': unittest.main()
welikecloud/bigtop
bigtop-packages/src/charm/mahout/layer-mahout/tests/01-mahout-test.py
Python
apache-2.0
2,393
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>for_ Statement</title> <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0"> <link rel="up" href="../statement.html" title="Statement"> <link rel="prev" href="___do_while_____statement.html" title="do_while_ Statement"> <link rel="next" href="try__catch__statement.html" title="try_ catch_ Statement"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="___do_while_____statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="try__catch__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="phoenix.modules.statement.for_statement"></a><a class="link" href="for_statement.html" title="for_ Statement">for_ Statement</a> </h4></div></div></div> <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">statement</span><span class="special">/</span><span class="keyword">for</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> </pre> <p> The syntax is: </p> <pre class="programlisting"><span class="identifier">for_</span><span class="special">(</span><span class="identifier">init_statement</span><span class="special">,</span> <span class="identifier">conditional_expression</span><span class="special">,</span> <span class="identifier">step_statement</span><span class="special">)</span> <span class="special">[</span> <span class="identifier">sequenced_statements</span> <span class="special">]</span> </pre> <p> It is again very similar to the C++ for statement. Take note that the init_statement, conditional_expression and step_statement are separated by the comma instead of the semi-colon and each must be present (i.e. <code class="computeroutput"><span class="identifier">for_</span><span class="special">(,,)</span></code> is invalid). This is a case where the <a class="link" href="../core/nothing.html" title="Nothing"><code class="computeroutput"><span class="identifier">nothing</span></code></a> actor can be useful. </p> <p> Example: This code prints each element N times where N is the element's value. A newline terminates the printout of each value. </p> <pre class="programlisting"><span class="keyword">int</span> <span class="identifier">iii</span><span class="special">;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">c</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">c</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="special">(</span> <span class="identifier">for_</span><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">iii</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">ref</span><span class="special">(</span><span class="identifier">iii</span><span class="special">)</span> <span class="special">&lt;</span> <span class="identifier">arg1</span><span class="special">,</span> <span class="special">++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">iii</span><span class="special">))</span> <span class="special">[</span> <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">arg1</span> <span class="special">&lt;&lt;</span> <span class="string">", "</span> <span class="special">],</span> <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">val</span><span class="special">(</span><span class="string">"\n"</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span> </pre> <p> As before, all these are lazily evaluated. The result of such statements are in fact expressions that are passed on to STL's for_each function. In the viewpoint of <code class="computeroutput"><span class="identifier">for_each</span></code>, what was passed is just a functor, no more, no less. </p> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="___do_while_____statement.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../statement.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="try__catch__statement.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
NixaSoftware/CVis
venv/bin/libs/phoenix/doc/html/phoenix/modules/statement/for_statement.html
HTML
apache-2.0
6,896
#include "serializer/buf_ptr.hpp" #include <algorithm> #include "math.hpp" buf_ptr_t buf_ptr_t::alloc_uninitialized(block_size_t size) { guarantee(size.ser_value() != 0); const size_t count = compute_aligned_block_size(size); buf_ptr_t ret; ret.block_size_ = size; ret.ser_buffer_ = scoped_device_block_aligned_ptr_t<ser_buffer_t>(count); return ret; } buf_ptr_t buf_ptr_t::alloc_zeroed(block_size_t size) { buf_ptr_t ret = alloc_uninitialized(size); char *buf = reinterpret_cast<char *>(ret.ser_buffer()); memset(buf, 0, compute_aligned_block_size(size)); return ret; } scoped_device_block_aligned_ptr_t<ser_buffer_t> help_allocate_copy(const ser_buffer_t *copyee, size_t amount_to_copy, size_t reserved_size) { rassert(amount_to_copy <= reserved_size); auto buf = scoped_device_block_aligned_ptr_t<ser_buffer_t>(reserved_size); memcpy(buf.get(), copyee, amount_to_copy); memset(reinterpret_cast<char *>(buf.get()) + amount_to_copy, 0, reserved_size - amount_to_copy); return buf; } buf_ptr_t buf_ptr_t::alloc_copy(const buf_ptr_t &copyee) { guarantee(copyee.has()); return buf_ptr_t(copyee.block_size(), help_allocate_copy(copyee.ser_buffer_.get(), copyee.block_size().ser_value(), copyee.aligned_block_size())); } void buf_ptr_t::resize_fill_zero(block_size_t new_size) { guarantee(new_size.ser_value() != 0); guarantee(ser_buffer_.has()); uint16_t old_reserved = compute_aligned_block_size(block_size_); uint16_t new_reserved = compute_aligned_block_size(new_size); if (old_reserved == new_reserved) { if (new_size.ser_value() < block_size_.ser_value()) { // Set the newly unused part of the block to zero. memset(reinterpret_cast<char *>(ser_buffer_.get()) + new_size.ser_value(), 0, block_size_.ser_value() - new_size.ser_value()); } } else { // We actually need to reallocate. scoped_device_block_aligned_ptr_t<ser_buffer_t> buf = help_allocate_copy(ser_buffer_.get(), std::min(block_size_.ser_value(), new_size.ser_value()), new_reserved); ser_buffer_ = std::move(buf); } block_size_ = new_size; } void buf_ptr_t::fill_padding_zero() const { guarantee(has()); char *p = reinterpret_cast<char *>(ser_buffer()); uint16_t ser_block_size = block_size().ser_value(); uint16_t aligned = aligned_block_size(); memset(p + ser_block_size, 0, aligned - ser_block_size); } #ifndef NDEBUG void buf_ptr_t::assert_padding_zero() const { guarantee(has()); char *p = reinterpret_cast<char *>(ser_buffer()); uint16_t ser_block_size = block_size().ser_value(); uint16_t aligned = aligned_block_size(); for (uint16_t i = ser_block_size; i < aligned; ++i) { rassert(p[i] == 0); } } #endif
JackieXie168/rethinkdb
src/serializer/buf_ptr.cc
C++
apache-2.0
3,100
/*global define*/ define([ './Cartesian2', './defaultValue', './defined', './defineProperties', './DeveloperError', './Ellipsoid', './GeographicProjection', './Math', './Rectangle' ], function( Cartesian2, defaultValue, defined, defineProperties, DeveloperError, Ellipsoid, GeographicProjection, CesiumMath, Rectangle) { 'use strict'; /** * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where * longitude and latitude are directly mapped to X and Y. This projection is commonly * known as geographic, equirectangular, equidistant cylindrical, or plate carrée. * * @alias GeographicTilingScheme * @constructor * * @param {Object} [options] Object with the following properties: * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to * the WGS84 ellipsoid. * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme. * @param {Number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of * the tile tree. * @param {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of * the tile tree. */ function GeographicTilingScheme(options) { options = defaultValue(options, {}); this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE); this._projection = new GeographicProjection(this._ellipsoid); this._numberOfLevelZeroTilesX = defaultValue(options.numberOfLevelZeroTilesX, 2); this._numberOfLevelZeroTilesY = defaultValue(options.numberOfLevelZeroTilesY, 1); } defineProperties(GeographicTilingScheme.prototype, { /** * Gets the ellipsoid that is tiled by this tiling scheme. * @memberof GeographicTilingScheme.prototype * @type {Ellipsoid} */ ellipsoid : { get : function() { return this._ellipsoid; } }, /** * Gets the rectangle, in radians, covered by this tiling scheme. * @memberof GeographicTilingScheme.prototype * @type {Rectangle} */ rectangle : { get : function() { return this._rectangle; } }, /** * Gets the map projection used by this tiling scheme. * @memberof GeographicTilingScheme.prototype * @type {MapProjection} */ projection : { get : function() { return this._projection; } } }); /** * Gets the total number of tiles in the X direction at a specified level-of-detail. * * @param {Number} level The level-of-detail. * @returns {Number} The number of tiles in the X direction at the given level. */ GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function(level) { return this._numberOfLevelZeroTilesX << level; }; /** * Gets the total number of tiles in the Y direction at a specified level-of-detail. * * @param {Number} level The level-of-detail. * @returns {Number} The number of tiles in the Y direction at the given level. */ GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function(level) { return this._numberOfLevelZeroTilesY << level; }; /** * Transforms an rectangle specified in geodetic radians to the native coordinate system * of this tiling scheme. * * @param {Rectangle} rectangle The rectangle to transform. * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance * should be created. * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result' * is undefined. */ GeographicTilingScheme.prototype.rectangleToNativeRectangle = function(rectangle, result) { //>>includeStart('debug', pragmas.debug); if (!defined(rectangle)) { throw new DeveloperError('rectangle is required.'); } //>>includeEnd('debug'); var west = CesiumMath.toDegrees(rectangle.west); var south = CesiumMath.toDegrees(rectangle.south); var east = CesiumMath.toDegrees(rectangle.east); var north = CesiumMath.toDegrees(rectangle.north); if (!defined(result)) { return new Rectangle(west, south, east, north); } result.west = west; result.south = south; result.east = east; result.north = north; return result; }; /** * Converts tile x, y coordinates and level to an rectangle expressed in the native coordinates * of the tiling scheme. * * @param {Number} x The integer x coordinate of the tile. * @param {Number} y The integer y coordinate of the tile. * @param {Number} level The tile level-of-detail. Zero is the least detailed. * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance * should be created. * @returns {Rectangle} The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ GeographicTilingScheme.prototype.tileXYToNativeRectangle = function(x, y, level, result) { var rectangleRadians = this.tileXYToRectangle(x, y, level, result); rectangleRadians.west = CesiumMath.toDegrees(rectangleRadians.west); rectangleRadians.south = CesiumMath.toDegrees(rectangleRadians.south); rectangleRadians.east = CesiumMath.toDegrees(rectangleRadians.east); rectangleRadians.north = CesiumMath.toDegrees(rectangleRadians.north); return rectangleRadians; }; /** * Converts tile x, y coordinates and level to a cartographic rectangle in radians. * * @param {Number} x The integer x coordinate of the tile. * @param {Number} y The integer y coordinate of the tile. * @param {Number} level The tile level-of-detail. Zero is the least detailed. * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance * should be created. * @returns {Rectangle} The specified 'result', or a new object containing the rectangle * if 'result' is undefined. */ GeographicTilingScheme.prototype.tileXYToRectangle = function(x, y, level, result) { var rectangle = this._rectangle; var xTiles = this.getNumberOfXTilesAtLevel(level); var yTiles = this.getNumberOfYTilesAtLevel(level); var xTileWidth = rectangle.width / xTiles; var west = x * xTileWidth + rectangle.west; var east = (x + 1) * xTileWidth + rectangle.west; var yTileHeight = rectangle.height / yTiles; var north = rectangle.north - y * yTileHeight; var south = rectangle.north - (y + 1) * yTileHeight; if (!defined(result)) { result = new Rectangle(west, south, east, north); } result.west = west; result.south = south; result.east = east; result.north = north; return result; }; /** * Calculates the tile x, y coordinates of the tile containing * a given cartographic position. * * @param {Cartographic} position The position. * @param {Number} level The tile level-of-detail. Zero is the least detailed. * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance * should be created. * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates * if 'result' is undefined. */ GeographicTilingScheme.prototype.positionToTileXY = function(position, level, result) { var rectangle = this._rectangle; if (!Rectangle.contains(rectangle, position)) { // outside the bounds of the tiling scheme return undefined; } var xTiles = this.getNumberOfXTilesAtLevel(level); var yTiles = this.getNumberOfYTilesAtLevel(level); var xTileWidth = rectangle.width / xTiles; var yTileHeight = rectangle.height / yTiles; var longitude = position.longitude; if (rectangle.east < rectangle.west) { longitude += CesiumMath.TWO_PI; } var xTileCoordinate = (longitude - rectangle.west) / xTileWidth | 0; if (xTileCoordinate >= xTiles) { xTileCoordinate = xTiles - 1; } var yTileCoordinate = (rectangle.north - position.latitude) / yTileHeight | 0; if (yTileCoordinate >= yTiles) { yTileCoordinate = yTiles - 1; } if (!defined(result)) { return new Cartesian2(xTileCoordinate, yTileCoordinate); } result.x = xTileCoordinate; result.y = yTileCoordinate; return result; }; return GeographicTilingScheme; });
ceos-seo/Data_Cube_v2
ui/django_site_v2/data_cube_ui/static/assets/js/Cesium-1.23/Source/Core/GeographicTilingScheme.js
JavaScript
apache-2.0
9,369
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.parser.xml; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.nio.file.Files; import java.util.List; import org.apache.camel.parser.XmlRouteParser; import org.apache.camel.parser.model.CamelNodeDetails; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; public class XmlWithPrefixParseTreeTest { private static final Logger LOG = LoggerFactory.getLogger(XmlWithPrefixParseTreeTest.class); @TempDir File tempDir; @Test void testXmlTree() throws Exception { InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/mycamel-withNamespacePrefix.xml"); String fqn = "src/test/resources/org/apache/camel/camel/parser/xml/mycamel-withNamespacePrefix.xml"; String baseDir = "src/test/resources"; List<CamelNodeDetails> list = XmlRouteParser.parseXmlRouteTree(is, baseDir, fqn); assertEquals(1, list.size()); CamelNodeDetails details = list.get(0); assertEquals("src/test/resources/org/apache/camel/camel/parser/xml/mycamel-withNamespacePrefix.xml", details.getFileName()); assertEquals("myRoute", details.getRouteId()); assertNull(details.getMethodName()); assertNull(details.getClassName()); String tree = details.dump(0); LOG.info("\n" + tree); assertTrue(tree.contains("34\tfrom")); assertTrue(tree.contains("36\t transform")); assertTrue(tree.contains("39\t to")); } @Test void testXmlTreeWithEmptyRoute() throws Exception { String textTotest = "<camel:camelContext id=\"camel\" xmlns=\"http://camel.apache.org/schema/spring\" xmlns:camel=\"http://camel.apache.org/schema/spring\">\r\n" + " <camel:route id=\"a route\">\r\n" + " </camel:route>\r\n" + "</camel:camelContext>\n"; File camelFile = new File(tempDir, "testXmlTreeWithEmptyRoute-withNamespacePrefix.xml"); Files.copy(new ByteArrayInputStream(textTotest.getBytes()), camelFile.toPath()); List<CamelNodeDetails> list = XmlRouteParser.parseXmlRouteTree(new ByteArrayInputStream(textTotest.getBytes()), "", camelFile.getAbsolutePath()); assertEquals(0, list.size()); } }
nikhilvibhav/camel
catalog/camel-route-parser/src/test/java/org/apache/camel/parser/xml/XmlWithPrefixParseTreeTest.java
Java
apache-2.0
3,458
/* * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.wso2.carbon.dataservices.core.description.query; import com.hp.hpl.jena.query.*; import com.hp.hpl.jena.rdf.model.Model; import org.wso2.carbon.dataservices.core.DataServiceFault; import org.wso2.carbon.dataservices.core.description.config.RDFConfig; import org.wso2.carbon.dataservices.core.description.event.EventTrigger; import org.wso2.carbon.dataservices.core.engine.*; import javax.xml.stream.XMLStreamWriter; import java.io.IOException; import java.util.List; import java.util.Map; /** * This class represents a SPARQL data services query over a single RDF file */ public class RdfFileQuery extends SparqlQueryBase { private RDFConfig config; public RdfFileQuery(DataService dataService, String queryId, String configId, String query, List<QueryParam> queryParams, Result result, EventTrigger inputEventTrigger, EventTrigger outputEventTrigger, Map<String, String> advancedProperties, String inputNamespace) throws DataServiceFault { super(dataService, queryId, configId, query, queryParams, result, inputEventTrigger, outputEventTrigger, advancedProperties, inputNamespace); try { this.config = (RDFConfig) this.getDataService().getConfig( this.getConfigId()); } catch (ClassCastException e) { throw new DataServiceFault(e, "Configuration is not a RDF config:" + this.getConfigId()); } } public RDFConfig getConfig() { return config; } @Override public QueryExecution getQueryExecution() throws IOException, DataServiceFault { return QueryExecutionFactory.create(this.getQuery(), this.config.createRDFModel()); } public Object processPreQuery(InternalParamCollection params, int queryLevel) throws DataServiceFault { try { ResultSet results; QuerySolutionMap queryMap = new QuerySolutionMap(); Model model = this.getModelForValidation(); /* process the query params */ for (InternalParam param : params.getParams()) { /* set parameters to the query map */ queryMap.add(param.getName(), convertTypeLiteral(model, param)); } QueryExecution qe = this.getQueryExecution(); qe.setInitialBinding(queryMap) ; /* execute query as a select query */ results = qe.execSelect(); return results; } catch (Exception e) { throw new DataServiceFault(e, "Error in 'SparqlQueryBase.processQuery'"); } } @Override public void processPostQuery(Object result, XMLStreamWriter xmlWriter, InternalParamCollection params, int queryLevel) throws DataServiceFault { ResultSet results = (ResultSet) result; DataEntry dataEntry; while (results != null && results.hasNext()) { dataEntry = this.getDataEntryFromRS(results); this.writeResultEntry(xmlWriter, dataEntry, params, queryLevel); } } }
maheshika/carbon-data
components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/core/description/query/RdfFileQuery.java
Java
apache-2.0
3,616
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.jstorm.ui.model; import com.alibaba.jstorm.metric.MetricType; import com.fasterxml.jackson.annotation.JsonIgnore; /** * @author Jark (wuchong.wc@alibaba-inc.com) */ public class UIUserDefinedMetric { protected String metricName; protected String componentName; protected String componentType; protected String type; protected String value; public UIUserDefinedMetric(String metricName, String componentName) { this.metricName = metricName; this.componentName = componentName; } public String getMetricName() { return metricName; } public void setMetricName(String metricName) { this.metricName = metricName; } public String getComponentName() { return componentName; } public void setComponentName(String componentName) { this.componentName = componentName; } @JsonIgnore public String getComponentType() { return componentType; } public void setComponentType(String componentType) { this.componentType = componentType; } public String getType() { return type; } public void setType(int type) { MetricType metricType = MetricType.parse(type); switch (metricType) { case COUNTER: this.type = "Counter"; case GAUGE: this.type = "Gauge"; case METER: this.type = "Meter"; case HISTOGRAM: this.type = "Histogram"; } } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
lindzh/jstorm
jstorm-ui/src/main/java/com/alibaba/jstorm/ui/model/UIUserDefinedMetric.java
Java
apache-2.0
2,492
/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2020-7-1 NU-LL first version */ #include "board.h" void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; /** Configure the main internal regulator output voltage */ HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1; RCC_OscInitStruct.PLL.PLLN = 8; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } /** Initializes the peripherals clocks */ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_USART2 |RCC_PERIPHCLK_ADC; PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK1; PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1; PeriphClkInit.AdcClockSelection = RCC_ADCCLKSOURCE_SYSCLK; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } }
nongxiaoming/rt-thread
bsp/stm32/stm32g070-st-nucleo/board/board.c
C
apache-2.0
2,138
// Copyright 2012 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package main // This file contains the model construction by reflection. import ( "bytes" "encoding/gob" "flag" "io" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "text/template" "code.google.com/p/gomock/mockgen/model" ) var ( progOnly = flag.Bool("prog_only", false, "(reflect mode) Only generate the reflection program; write it to stdout.") execOnly = flag.String("exec_only", "", "(reflect mode) If set, execute this reflection program.") ) func Reflect(importPath string, symbols []string) (*model.Package, error) { // TODO: sanity check arguments progPath := *execOnly if *execOnly == "" { // We use TempDir instead of TempFile so we can control the filename. tmpDir, err := ioutil.TempDir("", "gomock_reflect_") if err != nil { return nil, err } defer func() { os.RemoveAll(tmpDir) }() const progSource = "prog.go" var progBinary = "prog.bin" if runtime.GOOS == "windows" { // Windows won't execute a program unless it has a ".exe" suffix. progBinary += ".exe" } // Generate program. var program bytes.Buffer data := reflectData{ ImportPath: importPath, Symbols: symbols, } if err := reflectProgram.Execute(&program, &data); err != nil { return nil, err } if *progOnly { io.Copy(os.Stdout, &program) os.Exit(0) } if err := ioutil.WriteFile(filepath.Join(tmpDir, progSource), program.Bytes(), 0600); err != nil { return nil, err } // Build the program. cmd := exec.Command("go", "build", "-o", progBinary, progSource) cmd.Dir = tmpDir cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { return nil, err } progPath = filepath.Join(tmpDir, progBinary) } // Run it. cmd := exec.Command(progPath) var stdout bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { return nil, err } // Process output. var pkg model.Package if err := gob.NewDecoder(&stdout).Decode(&pkg); err != nil { return nil, err } return &pkg, nil } type reflectData struct { ImportPath string Symbols []string } // This program reflects on an interface value, and prints the // gob encoding of a model.Package to standard output. // JSON doesn't work because of the model.Type interface. var reflectProgram = template.Must(template.New("program").Parse(` package main import ( "encoding/gob" "fmt" "os" "path" "reflect" "code.google.com/p/gomock/mockgen/model" pkg_ {{printf "%q" .ImportPath}} ) func main() { its := []struct{ sym string typ reflect.Type }{ {{range .Symbols}} { {{printf "%q" .}}, reflect.TypeOf((*pkg_.{{.}})(nil)).Elem()}, {{end}} } pkg := &model.Package{ // NOTE: This behaves contrary to documented behaviour if the // package name is not the final component of the import path. // The reflect package doesn't expose the package name, though. Name: path.Base({{printf "%q" .ImportPath}}), } for _, it := range its { intf, err := model.InterfaceFromInterfaceType(it.typ) if err != nil { fmt.Fprintf(os.Stderr, "Reflection: %v\n", err) os.Exit(1) } intf.Name = it.sym pkg.Interfaces = append(pkg.Interfaces, intf) } if err := gob.NewEncoder(os.Stdout).Encode(pkg); err != nil { fmt.Fprintf(os.Stderr, "gob encode: %v\n", err) os.Exit(1) } } `))
mbinge/gomock
mockgen/reflect.go
GO
apache-2.0
3,894
package org.zstack.simulator.storage.primary.nfs; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.zstack.core.thread.AsyncThread; import org.zstack.header.exception.CloudRuntimeException; import org.zstack.header.rest.RESTFacade; import org.zstack.kvm.KVMAgentCommands.AgentResponse; import org.zstack.storage.primary.nfs.NfsPrimaryStorageKVMBackend; import org.zstack.storage.primary.nfs.NfsPrimaryStorageKVMBackendCommands.*; import org.zstack.storage.primary.nfs.NfsPrimaryToSftpBackupKVMBackend; import org.zstack.simulator.AsyncRESTReplyer; import org.zstack.simulator.kvm.VolumeSnapshotKvmSimulator; import org.zstack.utils.Utils; import org.zstack.utils.data.SizeUnit; import org.zstack.utils.gson.JSONObjectUtil; import org.zstack.utils.logging.CLogger; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; @Controller public class NfsPrimaryStorageSimulator { CLogger logger = Utils.getLogger(NfsPrimaryStorageSimulator.class); @Autowired private RESTFacade restf; @Autowired private NfsPrimaryStorageSimulatorConfig config; @Autowired private VolumeSnapshotKvmSimulator volumeSnapshotKvmSimulator; private AsyncRESTReplyer replyer = new AsyncRESTReplyer(); class Capacity { long total; long avail; } private void reply(HttpEntity<String> entity, NfsPrimaryStorageAgentResponse rsp) { replyer.reply(entity, rsp); } private Map<String, Capacity> capacityMap = new HashMap<String, Capacity>(); private void setCapacity(NfsPrimaryStorageAgentCommand cmd, NfsPrimaryStorageAgentResponse rsp) { rsp.setTotalCapacity(config.totalCapacity); rsp.setAvailableCapacity(config.availableCapacity); } @AsyncThread private void doGetCapacity(HttpEntity<String> entity) { GetCapacityCmd cmd = JSONObjectUtil.toObject(entity.getBody(), GetCapacityCmd.class); GetCapacityResponse rsp = new GetCapacityResponse(); setCapacity(cmd, rsp); reply(entity, rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.UNMOUNT_PRIMARY_STORAGE_PATH, method=RequestMethod.POST) public @ResponseBody String nfsUnmount(@RequestBody String body) { if (config.unmountException) { throw new CloudRuntimeException("unmount exception on purpose"); } UnmountCmd cmd = JSONObjectUtil.toObject(body, UnmountCmd.class); AgentResponse rsp = new AgentResponse(); if (config.unmountSuccess) { rsp.setSuccess(true); config.unmountCmds.add(cmd); logger.debug(String.format("Unmount %s", cmd.getMountPath())); } else { rsp.setSuccess(false); rsp.setError("Fail umount on purpose"); } return JSONObjectUtil.toJsonString(rsp); } @AsyncThread private void doCreateRootVolumeFromTemplate(HttpEntity<String> entity) throws InterruptedException { CreateRootVolumeFromTemplateCmd cmd = JSONObjectUtil.toObject(entity.getBody(), CreateRootVolumeFromTemplateCmd.class); CreateRootVolumeFromTemplateResponse rsp = new CreateRootVolumeFromTemplateResponse(); if (!config.createRootVolumeFromTemplateSuccess) { rsp.setSuccess(false); rsp.setError("Fail create on purpose"); } else { logger.debug(String.format("Created root volume from cached template %s to %s", cmd.getTemplatePathInCache(), cmd.getInstallUrl())); } reply(entity, rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.MOUNT_PRIMARY_STORAGE_PATH, method=RequestMethod.POST) public @ResponseBody String nfsMount(@RequestBody String body) { if (config.mountException) { throw new CloudRuntimeException("mount exception on purpose"); } MountCmd cmd = JSONObjectUtil.toObject(body, MountCmd.class); MountAgentResponse rsp = new MountAgentResponse(); if (config.mountSuccess) { Capacity cap = new Capacity(); cap.total = config.totalCapacity; cap.avail = config.availableCapacity; capacityMap.put(cmd.getUuid(), cap); rsp.setTotalCapacity(cap.total); rsp.setAvailableCapacity(cap.avail); config.mountCmds.add(cmd); logger.debug(String.format("mount %s to %s", cmd.getUrl(), cmd.getMountPath())); } else { rsp.setSuccess(false); rsp.setError("Fail mount on purpose"); } return JSONObjectUtil.toJsonString(rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.SYNC_GET_CAPACITY_PATH, method=RequestMethod.POST) private @ResponseBody String syncGetCapacity(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); GetCapacityCmd cmd = JSONObjectUtil.toObject(entity.getBody(), GetCapacityCmd.class); GetCapacityResponse rsp = new GetCapacityResponse(); setCapacity(cmd, rsp); return JSONObjectUtil.toJsonString(rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.GET_CAPACITY_PATH, method=RequestMethod.POST) private @ResponseBody String getCapacity(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); doGetCapacity(entity); return null; } @RequestMapping(value=NfsPrimaryToSftpBackupKVMBackend.CREATE_VOLUME_FROM_TEMPLATE_PATH, method=RequestMethod.POST) private @ResponseBody String createRootVolumeFromTemplate(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); if (config.createRootVolumeFromTemplateException) { throw new CloudRuntimeException("Fail download on purpose"); } else { doCreateRootVolumeFromTemplate(entity); } return null; } @RequestMapping(value=NfsPrimaryToSftpBackupKVMBackend.DOWNLOAD_FROM_SFTP_PATH, method=RequestMethod.POST) private @ResponseBody String downloadFromSftp(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); downloadFromSftp(entity); return null; } @RequestMapping(value=NfsPrimaryStorageKVMBackend.DELETE_PATH, method=RequestMethod.POST) private @ResponseBody String delete(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); DeleteCmd cmd = JSONObjectUtil.toObject(entity.getBody(), DeleteCmd.class); DeleteResponse rsp = new DeleteResponse(); if (!config.deleteSuccess) { rsp.setError("on purpose"); rsp.setSuccess(false); } else { // we don't know if this is deleting snapshot // volumeSnapshotKvmSimulator will ignore the call if it's not volumeSnapshotKvmSimulator.delete(cmd.getInstallPath()); config.deleteCmds.add(cmd); } reply(entity, rsp); return null; } @RequestMapping(value=NfsPrimaryStorageKVMBackend.MOVE_BITS_PATH, method=RequestMethod.POST) private @ResponseBody String move(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); move(entity); return null; } @AsyncThread private void move(HttpEntity<String> entity) { MoveBitsCmd cmd = JSONObjectUtil.toObject(entity.getBody(), MoveBitsCmd.class); MoveBitsRsp rsp = new MoveBitsRsp(); if (!config.moveBitsSuccess) { rsp.setError("on purpose"); rsp.setSuccess(false); } else { config.moveBitsCmds.add(cmd); } reply(entity, rsp); } @AsyncThread private void downloadFromSftp(HttpEntity<String> entity) { DownloadBitsFromSftpBackupStorageCmd cmd = JSONObjectUtil.toObject(entity.getBody(), DownloadBitsFromSftpBackupStorageCmd.class); DownloadBitsFromSftpBackupStorageResponse rsp = new DownloadBitsFromSftpBackupStorageResponse(); if (!config.downloadFromSftpSuccess) { rsp.setError("on purpose"); rsp.setSuccess(false); } else { logger.debug(entity.getBody()); config.downloadFromSftpCmds.add(cmd); } reply(entity, rsp); } @RequestMapping(value=NfsPrimaryToSftpBackupKVMBackend.UPLOAD_TO_SFTP_PATH, method=RequestMethod.POST) private @ResponseBody String copyToSftp(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); copyToSftp(entity); return null; } @AsyncThread private void copyToSftp(HttpEntity<String> entity) { UploadToSftpCmd cmd = JSONObjectUtil.toObject(entity.getBody(), UploadToSftpCmd.class); UploadToSftpResponse rsp = new UploadToSftpResponse(); if (!config.uploadToSftp || cmd.getPrimaryStorageInstallPath().equals(config.backupSnapshotFailurePrimaryStorageInstallPath)) { rsp.setError("no purpose"); rsp.setSuccess(false); } else { config.uploadToSftpCmds.add(cmd); } reply(entity, rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.OFFLINE_SNAPSHOT_MERGE, method=RequestMethod.POST) private @ResponseBody String offlineMergeSnapshot(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); OfflineMergeSnapshotCmd cmd = JSONObjectUtil.toObject(entity.getBody(), OfflineMergeSnapshotCmd.class); OfflineMergeSnapshotRsp rsp = new OfflineMergeSnapshotRsp(); if (!config.offlineMergeSnapshotSuccess) { rsp.setError("on purpose"); rsp.setSuccess(false); } else { volumeSnapshotKvmSimulator.merge(cmd.getSrcPath(), cmd.getDestPath(), cmd.isFullRebase()); config.offlineMergeSnapshotCmds.add(cmd); } reply(entity, rsp); return null; } @RequestMapping(value=NfsPrimaryStorageKVMBackend.CHECK_BITS_PATH, method=RequestMethod.POST) private @ResponseBody String checkBits(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); checkBits(entity); return null; } @AsyncThread private void checkBits(HttpEntity<String> entity) { CheckIsBitsExistingCmd cmd = JSONObjectUtil.toObject(entity.getBody(), CheckIsBitsExistingCmd.class); CheckIsBitsExistingRsp rsp = new CheckIsBitsExistingRsp(); if (config.checkImageSuccess) { rsp.setExisting(config.imageCache.contains(cmd.getInstallPath())); } else { rsp.setError("on purpose"); rsp.setSuccess(false); } reply(entity, rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.CREATE_EMPTY_VOLUME_PATH, method=RequestMethod.POST) private @ResponseBody String createEmptyVolume(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); doCreateEmptyVolume(entity); return null; } @RequestMapping(value=NfsPrimaryStorageKVMBackend.CREATE_TEMPLATE_FROM_VOLUME_PATH, method=RequestMethod.POST) private @ResponseBody String createTemplateFromRootVolume(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); doCreateTemplateFromRootVolume(entity); return null; } @RequestMapping(value=NfsPrimaryStorageKVMBackend.REVERT_VOLUME_FROM_SNAPSHOT_PATH, method=RequestMethod.POST) private @ResponseBody String revertVolumeFromSnapshot(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); RevertVolumeFromSnapshotCmd cmd = JSONObjectUtil.toObject(entity.getBody(), RevertVolumeFromSnapshotCmd.class); RevertVolumeFromSnapshotResponse rsp = new RevertVolumeFromSnapshotResponse(); if (config.revertVolumeFromSnapshotSuccess) { config.revertVolumeFromSnapshotCmds.add(cmd); rsp = volumeSnapshotKvmSimulator.revert(cmd); } else { rsp.setError("on purpose"); rsp.setSuccess(false); } reply(entity, rsp); return null; } @RequestMapping(value=NfsPrimaryStorageKVMBackend.REBASE_MERGE_SNAPSHOT_PATH, method=RequestMethod.POST) private @ResponseBody String rebaseAndMergeSnapshot(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); rebaseAndMergeSnapshot(entity); return null; } @AsyncThread private void rebaseAndMergeSnapshot(HttpEntity<String> entity) { RebaseAndMergeSnapshotsCmd cmd = JSONObjectUtil.toObject(entity.getBody(), RebaseAndMergeSnapshotsCmd.class); RebaseAndMergeSnapshotsResponse rsp = new RebaseAndMergeSnapshotsResponse(); if (!config.rebaseAndMergeSnapshotSuccess) { rsp.setError("on purpose"); rsp.setSuccess(false); } else { rsp.setSize(SizeUnit.MEGABYTE.toByte(500)); config.rebaseAndMergeSnapshotsCmds.add(cmd); } reply(entity, rsp); } @RequestMapping(value=NfsPrimaryStorageKVMBackend.MERGE_SNAPSHOT_PATH, method=RequestMethod.POST) private @ResponseBody String mergeSnapshot(HttpServletRequest req) throws InterruptedException { HttpEntity<String> entity = restf.httpServletRequestToHttpEntity(req); mergeSnapshot(entity); return null; } @AsyncThread private void mergeSnapshot(HttpEntity<String> entity) { MergeSnapshotCmd cmd = JSONObjectUtil.toObject(entity.getBody(), MergeSnapshotCmd.class); MergeSnapshotResponse rsp = new MergeSnapshotResponse(); if (!config.mergeSnapshotSuccess) { rsp.setError("on purpose"); rsp.setSuccess(false); } else { rsp.setSize(SizeUnit.MEGABYTE.toByte(500)); config.mergeSnapshotCmds.add(cmd); } reply(entity, rsp); } @AsyncThread private void doCreateTemplateFromRootVolume(HttpEntity<String> entity) { CreateTemplateFromVolumeCmd cmd = JSONObjectUtil.toObject(entity.getBody(), CreateTemplateFromVolumeCmd.class); CreateTemplateFromVolumeRsp rsp = new CreateTemplateFromVolumeRsp(); if (!config.createTemplateFromRootVolumeSuccess) { rsp.setSuccess(false); rsp.setError("Fail create template on purpose"); } else { logger.debug(String.format("successfully create template from volume, %s", entity.getBody())); } reply(entity, rsp); } @AsyncThread private void doCreateEmptyVolume(HttpEntity<String> entity) { CreateEmptyVolumeCmd cmd = JSONObjectUtil.toObject(entity.getBody(), CreateEmptyVolumeCmd.class); CreateEmptyVolumeResponse rsp = new CreateEmptyVolumeResponse(); if (!config.createEmptyVolumeSuccess) { rsp.setError("failed on purpose"); rsp.setSuccess(false); } else { logger.debug(String.format("create empty volume[uuid:%s, path:%s, size:%s]", cmd.getUuid(), cmd.getInstallUrl(), cmd.getSize())); } reply(entity, rsp); } }
fishky/zstack
simulator/simulatorImpl/src/main/java/org/zstack/simulator/storage/primary/nfs/NfsPrimaryStorageSimulator.java
Java
apache-2.0
16,116
/** * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.math.linearalgebra; import org.apache.commons.lang.Validate; import com.opengamma.analytics.math.matrix.DoubleMatrix1D; import com.opengamma.analytics.math.matrix.DoubleMatrix2D; import com.opengamma.analytics.math.matrix.MatrixAlgebra; import com.opengamma.analytics.math.matrix.OGMatrixAlgebra; /** * Results of the OpenGamma implementation of Cholesky decomposition. */ public class CholeskyDecompositionOpenGammaResult implements CholeskyDecompositionResult { private static final MatrixAlgebra ALGEBRA = new OGMatrixAlgebra(); /** * The array that store the data. */ private final double[][] _lArray; /** * The matrix L, result of the decomposition. */ private final DoubleMatrix2D _l; /** * The matrix L^T, result of the decomposition. */ private final DoubleMatrix2D _lT; /** * The determinant of the original matrix A = L L^T. */ private double _determinant; /** * Constructor. * @param lArray The matrix L as an array of doubles. */ public CholeskyDecompositionOpenGammaResult(final double[][] lArray) { _lArray = lArray; _l = new DoubleMatrix2D(_lArray); _lT = ALGEBRA.getTranspose(_l); _determinant = 1.0; for (int loopdiag = 0; loopdiag < _lArray.length; ++loopdiag) { _determinant *= _lArray[loopdiag][loopdiag] * _lArray[loopdiag][loopdiag]; } } @Override public DoubleMatrix1D solve(DoubleMatrix1D b) { return new DoubleMatrix1D(b.getData()); } @Override public double[] solve(double[] b) { int dim = b.length; Validate.isTrue(dim == _lArray.length, "b array of incorrect size"); final double[] x = new double[dim]; System.arraycopy(b, 0, x, 0, dim); // L y = b (y stored in x array) for (int looprow = 0; looprow < dim; looprow++) { x[looprow] /= _lArray[looprow][looprow]; for (int j = looprow + 1; j < dim; j++) { x[j] -= x[looprow] * _lArray[j][looprow]; } } // L^T x = y for (int looprow = dim - 1; looprow >= -0; looprow--) { x[looprow] /= _lArray[looprow][looprow]; for (int j = 0; j < looprow; j++) { x[j] -= x[looprow] * _lArray[looprow][j]; } } return x; } @Override public DoubleMatrix2D solve(DoubleMatrix2D b) { int nbRow = b.getNumberOfRows(); int nbCol = b.getNumberOfColumns(); Validate.isTrue(nbRow == _lArray.length, "b array of incorrect size"); double[][] bArray = b.getData(); final double[][] x = new double[nbRow][nbCol]; for (int looprow = 0; looprow < nbRow; looprow++) { System.arraycopy(bArray[looprow], 0, x[looprow], 0, nbCol); } // L Y = B (Y stored in x array) for (int loopcol = 0; loopcol < nbCol; loopcol++) { for (int looprow = 0; looprow < nbRow; looprow++) { x[looprow][loopcol] /= _lArray[looprow][looprow]; for (int j = looprow + 1; j < nbRow; j++) { x[j][loopcol] -= x[looprow][loopcol] * _lArray[j][looprow]; } } } // L^T X = Y for (int loopcol = 0; loopcol < nbCol; loopcol++) { for (int looprow = nbRow - 1; looprow >= -0; looprow--) { x[looprow][loopcol] /= _lArray[looprow][looprow]; for (int j = 0; j < looprow; j++) { x[j][loopcol] -= x[looprow][loopcol] * _lArray[looprow][j]; } } } return new DoubleMatrix2D(x); } @Override public DoubleMatrix2D getL() { return _l; } @Override public DoubleMatrix2D getLT() { return _lT; } @Override public double getDeterminant() { return _determinant; } }
charles-cooper/idylfin
src/com/opengamma/analytics/math/linearalgebra/CholeskyDecompositionOpenGammaResult.java
Java
apache-2.0
3,730
/** * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ecl2.php * * 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.kuali.rice.krad.labs.transactional; import org.junit.Test; /** * Tests lookup security for an authorized user (dev1). * * @author Kuali Rice Team (rice.collab@kuali.org) */ public class LabsLookupSecurityTravelAuthorizationDocumentAuthorizedAft extends LabsLookupSecurityTravelAuthorizationDocumentBase { @Override public String getUserName() { return "dev1"; } @Test public void testTransactionalLookupSecurityAuthorizedBookmark() throws Exception { testTransactionalLookupSecurity(); passed(); } @Test public void testTransactionalLookupSecurityAuthorizedNav() throws Exception { testTransactionalLookupSecurity(); passed(); } @Test public void testTransactionalLookupSecurityAddDataDictionaryConversionFieldAuthorizedBookmark() throws Exception { testTransactionalLookupSecurityAddDataDictionaryConversionField(); passed(); } @Test public void testTransactionalLookupSecurityAddDataDictionaryConversionFieldAuthorizedNav() throws Exception { testTransactionalLookupSecurityAddDataDictionaryConversionField(); passed(); } @Test public void testTransactionalLookupSecurityAddUifConversionFieldAuthorizedBookmark() throws Exception { testTransactionalLookupSecurityAddUifConversionField(); passed(); } @Test public void testTransactionalLookupSecurityAddUifConversionFieldAuthorizedNav() throws Exception { testTransactionalLookupSecurityAddUifConversionField(); passed(); } @Test public void testTransactionalLookupSecurityAddHiddenConversionFieldAuthorizedBookmark() throws Exception { testTransactionalLookupSecurityAddHiddenConversionField(); passed(); } @Test public void testTransactionalLookupSecurityAddHiddenConversionFieldAuthorizedNav() throws Exception { testTransactionalLookupSecurityAddHiddenConversionField(); passed(); } }
ricepanda/rice-git3
rice-framework/krad-sampleapp/web/src/it/java/org/kuali/rice/krad/labs/transactional/LabsLookupSecurityTravelAuthorizationDocumentAuthorizedAft.java
Java
apache-2.0
2,634
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Unit Tests for nova.cert.rpcapi """ from nova.cert import rpcapi as cert_rpcapi from nova import context from nova import flags from nova.openstack.common import rpc from nova import test FLAGS = flags.FLAGS class CertRpcAPITestCase(test.TestCase): def setUp(self): super(CertRpcAPITestCase, self).setUp() def tearDown(self): super(CertRpcAPITestCase, self).tearDown() def _test_cert_api(self, method, **kwargs): ctxt = context.RequestContext('fake_user', 'fake_project') rpcapi = cert_rpcapi.CertAPI() expected_retval = 'foo' expected_msg = rpcapi.make_msg(method, **kwargs) expected_msg['version'] = rpcapi.BASE_RPC_API_VERSION self.call_ctxt = None self.call_topic = None self.call_msg = None self.call_timeout = None def _fake_call(_ctxt, _topic, _msg, _timeout): self.call_ctxt = _ctxt self.call_topic = _topic self.call_msg = _msg self.call_timeout = _timeout return expected_retval self.stubs.Set(rpc, 'call', _fake_call) retval = getattr(rpcapi, method)(ctxt, **kwargs) self.assertEqual(retval, expected_retval) self.assertEqual(self.call_ctxt, ctxt) self.assertEqual(self.call_topic, FLAGS.cert_topic) self.assertEqual(self.call_msg, expected_msg) self.assertEqual(self.call_timeout, None) def test_revoke_certs_by_user(self): self._test_cert_api('revoke_certs_by_user', user_id='fake_user_id') def test_revoke_certs_by_project(self): self._test_cert_api('revoke_certs_by_project', project_id='fake_project_id') def test_revoke_certs_by_user_and_project(self): self._test_cert_api('revoke_certs_by_user_and_project', user_id='fake_user_id', project_id='fake_project_id') def test_generate_x509_cert(self): self._test_cert_api('generate_x509_cert', user_id='fake_user_id', project_id='fake_project_id') def test_fetch_ca(self): self._test_cert_api('fetch_ca', project_id='fake_project_id') def test_fetch_crl(self): self._test_cert_api('fetch_crl', project_id='fake_project_id') def test_decrypt_text(self): self._test_cert_api('decrypt_text', project_id='fake_project_id', text='blah')
tylertian/Openstack
openstack F/nova/nova/tests/cert/test_rpcapi.py
Python
apache-2.0
3,147
package liquibase.integration.ant; import liquibase.resource.ClassLoaderResourceAccessor; import liquibase.resource.CompositeResourceAccessor; import liquibase.resource.ResourceAccessor; import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Path; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Enumeration; /** * An implementation of FileOpener that is specific to how Ant works. */ public class AntResourceAccessor extends CompositeResourceAccessor { public AntResourceAccessor(final Project project, final Path classpath) { super(new ClassLoaderResourceAccessor( AccessController.doPrivileged(new PrivilegedAction<AntClassLoader>() { @Override public AntClassLoader run() { return new AntClassLoader(project, classpath); } })), new ClassLoaderResourceAccessor( AccessController.doPrivileged(new PrivilegedAction<AntClassLoader>() { @Override public AntClassLoader run() { return new AntClassLoader(project, new Path(project, ".")); } })) ); } }
OculusVR/shanghai-liquibase
liquibase-core/src/main/java/liquibase/integration/ant/AntResourceAccessor.java
Java
apache-2.0
1,460
# -*- coding: utf-8 -*- # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Implementation of Unix-like rm command for cloud storage providers.""" from __future__ import absolute_import import time from gslib.cloud_api import BucketNotFoundException from gslib.cloud_api import NotEmptyException from gslib.cloud_api import NotFoundException from gslib.cloud_api import ServiceException from gslib.command import Command from gslib.command import DecrementFailureCount from gslib.command_argument import CommandArgument from gslib.cs_api_map import ApiSelector from gslib.exception import CommandException from gslib.exception import NO_URLS_MATCHED_GENERIC from gslib.exception import NO_URLS_MATCHED_TARGET from gslib.name_expansion import NameExpansionIterator from gslib.name_expansion import SeekAheadNameExpansionIterator from gslib.parallelism_framework_util import PutToQueueWithTimeout from gslib.storage_url import StorageUrlFromString from gslib.thread_message import MetadataMessage from gslib.translation_helper import PreconditionsFromHeaders from gslib.util import GetCloudApiInstance from gslib.util import NO_MAX from gslib.util import Retry from gslib.util import StdinIterator _SYNOPSIS = """ gsutil rm [-f] [-r] url... gsutil rm [-f] [-r] -I """ _DETAILED_HELP_TEXT = (""" <B>SYNOPSIS</B> """ + _SYNOPSIS + """ <B>DESCRIPTION</B> The gsutil rm command removes objects. For example, the command: gsutil rm gs://bucket/subdir/* will remove all objects in gs://bucket/subdir, but not in any of its sub-directories. In contrast: gsutil rm gs://bucket/subdir/** will remove all objects under gs://bucket/subdir or any of its subdirectories. You can also use the -r option to specify recursive object deletion. Thus, for example, either of the following two commands will remove gs://bucket/subdir and all objects and subdirectories under it: gsutil rm gs://bucket/subdir** gsutil rm -r gs://bucket/subdir The -r option will also delete all object versions in the subdirectory for versioning-enabled buckets, whereas the ** command will only delete the live version of each object in the subdirectory. Running gsutil rm -r on a bucket will delete all versions of all objects in the bucket, and then delete the bucket: gsutil rm -r gs://bucket If you want to delete all objects in the bucket, but not the bucket itself, this command will work: gsutil rm gs://bucket/** If you have a large number of objects to remove you might want to use the gsutil -m option, to perform parallel (multi-threaded/multi-processing) removes: gsutil -m rm -r gs://my_bucket/subdir You can pass a list of URLs (one per line) to remove on stdin instead of as command line arguments by using the -I option. This allows you to use gsutil in a pipeline to remove objects identified by a program, such as: some_program | gsutil -m rm -I The contents of stdin can name cloud URLs and wildcards of cloud URLs. Note that gsutil rm will refuse to remove files from the local file system. For example this will fail: gsutil rm *.txt WARNING: Object removal cannot be undone. Google Cloud Storage is designed to give developers a high amount of flexibility and control over their data, and Google maintains strict controls over the processing and purging of deleted data. To protect yourself from mistakes, you can configure object versioning on your bucket(s). See 'gsutil help versions' for details. <B>DATA RESTORATION FROM ACCIDENTAL DELETION OR OVERWRITES</B> Google Cloud Storage does not provide support for restoring data lost or overwritten due to customer errors. If you have concerns that your application software (or your users) may at some point erroneously delete or overwrite data, you can protect yourself from that risk by enabling Object Versioning (see "gsutil help versioning"). Doing so increases storage costs, which can be partially mitigated by configuring Lifecycle Management to delete older object versions (see "gsutil help lifecycle"). <B>OPTIONS</B> -f Continues silently (without printing error messages) despite errors when removing multiple objects. If some of the objects could not be removed, gsutil's exit status will be non-zero even if this flag is set. Execution will still halt if an inaccessible bucket is encountered. This option is implicitly set when running "gsutil -m rm ...". -I Causes gsutil to read the list of objects to remove from stdin. This allows you to run a program that generates the list of objects to remove. -R, -r The -R and -r options are synonymous. Causes bucket or bucket subdirectory contents (all objects and subdirectories that it contains) to be removed recursively. If used with a bucket-only URL (like gs://bucket), after deleting objects and subdirectories gsutil will delete the bucket. This option implies the -a option and will delete all object versions. -a Delete all versions of an object. """) def _RemoveExceptionHandler(cls, e): """Simple exception handler to allow post-completion status.""" if not cls.continue_on_error: cls.logger.error(str(e)) # TODO: Use shared state to track missing bucket names when we get a # BucketNotFoundException. Then improve bucket removal logic and exception # messages. if isinstance(e, BucketNotFoundException): cls.bucket_not_found_count += 1 cls.logger.error(str(e)) else: if _ExceptionMatchesBucketToDelete(cls.bucket_strings_to_delete, e): DecrementFailureCount() else: cls.op_failure_count += 1 # pylint: disable=unused-argument def _RemoveFoldersExceptionHandler(cls, e): """When removing folders, we don't mind if none exist.""" if ((isinstance(e, CommandException) and NO_URLS_MATCHED_GENERIC in e.reason) or isinstance(e, NotFoundException)): DecrementFailureCount() else: raise e def _RemoveFuncWrapper(cls, name_expansion_result, thread_state=None): cls.RemoveFunc(name_expansion_result, thread_state=thread_state) def _ExceptionMatchesBucketToDelete(bucket_strings_to_delete, e): """Returns True if the exception matches a bucket slated for deletion. A recursive delete call on an empty bucket will raise an exception when listing its objects, but if we plan to delete the bucket that shouldn't result in a user-visible error. Args: bucket_strings_to_delete: Buckets slated for recursive deletion. e: Exception to check. Returns: True if the exception was a no-URLs-matched exception and it matched one of bucket_strings_to_delete, None otherwise. """ if bucket_strings_to_delete: msg = NO_URLS_MATCHED_TARGET % '' if msg in str(e): parts = str(e).split(msg) return len(parts) == 2 and parts[1] in bucket_strings_to_delete class RmCommand(Command): """Implementation of gsutil rm command.""" # Command specification. See base class for documentation. command_spec = Command.CreateCommandSpec( 'rm', command_name_aliases=['del', 'delete', 'remove'], usage_synopsis=_SYNOPSIS, min_args=0, max_args=NO_MAX, supported_sub_args='afIrR', file_url_ok=False, provider_url_ok=False, urls_start_arg=0, gs_api_support=[ApiSelector.XML, ApiSelector.JSON], gs_default_api=ApiSelector.JSON, argparse_arguments=[ CommandArgument.MakeZeroOrMoreCloudURLsArgument() ] ) # Help specification. See help_provider.py for documentation. help_spec = Command.HelpSpec( help_name='rm', help_name_aliases=['del', 'delete', 'remove'], help_type='command_help', help_one_line_summary='Remove objects', help_text=_DETAILED_HELP_TEXT, subcommand_help_text={}, ) def RunCommand(self): """Command entry point for the rm command.""" # self.recursion_requested is initialized in command.py (so it can be # checked in parent class for all commands). self.continue_on_error = self.parallel_operations self.read_args_from_stdin = False self.all_versions = False if self.sub_opts: for o, unused_a in self.sub_opts: if o == '-a': self.all_versions = True elif o == '-f': self.continue_on_error = True elif o == '-I': self.read_args_from_stdin = True elif o == '-r' or o == '-R': self.recursion_requested = True self.all_versions = True if self.read_args_from_stdin: if self.args: raise CommandException('No arguments allowed with the -I flag.') url_strs = StdinIterator() else: if not self.args: raise CommandException('The rm command (without -I) expects at ' 'least one URL.') url_strs = self.args # Tracks number of object deletes that failed. self.op_failure_count = 0 # Tracks if any buckets were missing. self.bucket_not_found_count = 0 # Tracks buckets that are slated for recursive deletion. bucket_urls_to_delete = [] self.bucket_strings_to_delete = [] if self.recursion_requested: bucket_fields = ['id'] for url_str in url_strs: url = StorageUrlFromString(url_str) if url.IsBucket() or url.IsProvider(): for blr in self.WildcardIterator(url_str).IterBuckets( bucket_fields=bucket_fields): bucket_urls_to_delete.append(blr.storage_url) self.bucket_strings_to_delete.append(url_str) self.preconditions = PreconditionsFromHeaders(self.headers or {}) try: # Expand wildcards, dirs, buckets, and bucket subdirs in URLs. name_expansion_iterator = NameExpansionIterator( self.command_name, self.debug, self.logger, self.gsutil_api, url_strs, self.recursion_requested, project_id=self.project_id, all_versions=self.all_versions, continue_on_error=self.continue_on_error or self.parallel_operations) seek_ahead_iterator = None # Cannot seek ahead with stdin args, since we can only iterate them # once without buffering in memory. if not self.read_args_from_stdin: seek_ahead_iterator = SeekAheadNameExpansionIterator( self.command_name, self.debug, self.GetSeekAheadGsutilApi(), url_strs, self.recursion_requested, all_versions=self.all_versions, project_id=self.project_id) # Perform remove requests in parallel (-m) mode, if requested, using # configured number of parallel processes and threads. Otherwise, # perform requests with sequential function calls in current process. self.Apply(_RemoveFuncWrapper, name_expansion_iterator, _RemoveExceptionHandler, fail_on_error=(not self.continue_on_error), shared_attrs=['op_failure_count', 'bucket_not_found_count'], seek_ahead_iterator=seek_ahead_iterator) # Assuming the bucket has versioning enabled, url's that don't map to # objects should throw an error even with all_versions, since the prior # round of deletes only sends objects to a history table. # This assumption that rm -a is only called for versioned buckets should be # corrected, but the fix is non-trivial. except CommandException as e: # Don't raise if there are buckets to delete -- it's valid to say: # gsutil rm -r gs://some_bucket # if the bucket is empty. if _ExceptionMatchesBucketToDelete(self.bucket_strings_to_delete, e): DecrementFailureCount() else: raise except ServiceException, e: if not self.continue_on_error: raise if self.bucket_not_found_count: raise CommandException('Encountered non-existent bucket during listing') if self.op_failure_count and not self.continue_on_error: raise CommandException('Some files could not be removed.') # If this was a gsutil rm -r command covering any bucket subdirs, # remove any dir_$folder$ objects (which are created by various web UI # tools to simulate folders). if self.recursion_requested: folder_object_wildcards = [] for url_str in url_strs: url = StorageUrlFromString(url_str) if url.IsObject(): folder_object_wildcards.append('%s**_$folder$' % url_str) if folder_object_wildcards: self.continue_on_error = True try: name_expansion_iterator = NameExpansionIterator( self.command_name, self.debug, self.logger, self.gsutil_api, folder_object_wildcards, self.recursion_requested, project_id=self.project_id, all_versions=self.all_versions) # When we're removing folder objects, always continue on error self.Apply(_RemoveFuncWrapper, name_expansion_iterator, _RemoveFoldersExceptionHandler, fail_on_error=False) except CommandException as e: # Ignore exception from name expansion due to an absent folder file. if not e.reason.startswith(NO_URLS_MATCHED_GENERIC): raise # Now that all data has been deleted, delete any bucket URLs. for url in bucket_urls_to_delete: self.logger.info('Removing %s...', url) @Retry(NotEmptyException, tries=3, timeout_secs=1) def BucketDeleteWithRetry(): self.gsutil_api.DeleteBucket(url.bucket_name, provider=url.scheme) BucketDeleteWithRetry() if self.op_failure_count: plural_str = 's' if self.op_failure_count else '' raise CommandException('%d file%s/object%s could not be removed.' % ( self.op_failure_count, plural_str, plural_str)) return 0 def RemoveFunc(self, name_expansion_result, thread_state=None): gsutil_api = GetCloudApiInstance(self, thread_state=thread_state) exp_src_url = name_expansion_result.expanded_storage_url self.logger.info('Removing %s...', exp_src_url) gsutil_api.DeleteObject( exp_src_url.bucket_name, exp_src_url.object_name, preconditions=self.preconditions, generation=exp_src_url.generation, provider=exp_src_url.scheme) PutToQueueWithTimeout(gsutil_api.status_queue, MetadataMessage(message_time=time.time()))
fishjord/gsutil
gslib/commands/rm.py
Python
apache-2.0
15,054
#!/usr/bin/env python ''' Interact with Trello API as a CLI or Sopel IRC bot module ''' import argparse from datetime import date from email.mime.text import MIMEText import json import os import re import smtplib import sys # sopel is only for IRC bot installation. Not required for CLI try: import sopel.module # pylint: disable=import-error except ImportError: pass try: from urllib import urlencode from urllib2 import HTTPError, Request, urlopen except ImportError: from urllib.error import HTTPError from urllib.parse import urlencode from urllib.request import Request, urlopen # constants DEFAULT_LIST = "Active" DEFAULT_SNOWFLAKE_LIST = "Snowflakes" DEFAULT_RESOLVED_LIST = "Resolved" BASE_URL = "https://api.trello.com/1" EMAIL_SERVER = 'smtp.redhat.com' EMAIL_FROM = 'trello-srebot1@redhat.com' EMAIL_REPLYTO = 'noreply@redhat.com' class Trello(object): """Trello object""" def __init__(self): """Set object params""" self.args = None self.api_key = os.environ.get("trello_consumer_key", None) self.oauth_token = os.environ.get("trello_oauth_token", None) self.board_id = os.environ.get("trello_board_id", None) self.board_id_long = os.environ.get("trello_board_id_long", None) self.email_addresses = os.environ.get("trello_report_email_addresses", None) @staticmethod def parse_args(): """Parse CLI arguments""" parser = argparse.ArgumentParser( description='Create, comment, move Trello cards, also reporting.') subparsers = parser.add_subparsers(help='sub-command help') parser_get = subparsers.add_parser('get', help="""Get board information: card list, user list or card details""") parser_get.add_argument( 'card', nargs='?', metavar='CARD_URL', help='Card short URL to get details for') parser_get.add_argument( '--list', '-l', metavar='TRELLO_LIST', default=DEFAULT_LIST, help='List to display cards from, e.g. "Resolved" or "Snowflakes"') parser_get.add_argument( '--users', '-u', action='store_true', help='Display board users') parser_get.set_defaults(action='get') parser_create = subparsers.add_parser('create', help='Create a new card') parser_create.set_defaults(action='create') parser_create.add_argument( 'title', metavar='TITLE', help='Card title') parser_update = subparsers.add_parser('update', help='Update an existing card') parser_update.set_defaults(action='update') parser_update.add_argument( 'card', metavar='CARD', help='Existing card URL') parser_update.add_argument( '--comment', '-c', help='Add a comment') parser_update.add_argument( '--move', '-m', metavar='LIST_NAME', help='Move card to another list, e.g. "Resolved" or "Snowflakes"') parser_update.add_argument( '--assign', '-a', metavar='USER', help='Attach Trello user to card') parser_update.add_argument( '--unassign', '-u', metavar='USER', help='Remove Trello user from card') parser_report = subparsers.add_parser('report', help="Generate reports") parser_report.set_defaults(action='report') parser_report.add_argument( '--email', '-e', metavar='ADDRESS[,ADDRESS]', help="""Comma-separated (no spaces) list of email addresses to send report to. Overrides env var 'trello_report_email_addresses'""") parser_report.add_argument( '--move', '-m', action='store_true', help='Move cards to end-of-week list') return parser.parse_args() def create(self, title=None): """Create card""" if not title: title = self.args.title card = self.trello_create(title) return card['shortUrl'] def update(self): """Update card""" if self.trello_update(self.card_id(self.args.card)): print("Updated") else: sys.exit("No updates applied") def get(self): """Get card details or list of cards""" cards = None if self.args.card: return json.dumps(self.trello_get(self.card_id()), indent=4) cards = self.trello_get() results = '' for card in cards: members = '' if self.args.users: results += '{} {}\n'.format(str(card['username']), str(card['fullName'])) else: for member in card['idMembers']: if member: members += str(self.member_username(member)) + ' ' results += '{} {} ({})\n'.format(str(card['shortUrl']), str(card['name']), members) return results def report(self, email=None, move=False): """Generate reports""" payload = self.report_payload() print(payload) _env_email = os.environ.get("trello_report_email_addresses", None) if _env_email: email = _env_email if self.args: if self.args.email: email = self.args.email if self.args.move: move = self.args.move week_number = date.today().isocalendar()[1] if email: subj = "OpenShift SRE Report for Week #{} (ending {})".format( week_number, date.today().strftime("%d-%m-%Y")) _board_url = "https://trello.com/b/{}".format( os.environ.get("trello_board_id", None)) payload = "For more information visit the SRE 24x7 board {}\n\n{}".format( _board_url, payload) self.email_report(email, subj, payload) print("Report emailed to {}".format(email)) if move: list_name = "Week #{}".format(week_number) if self.move_cards(to_list=list_name): print("Cards moved to list '{}'".format(list_name)) def report_payload(self): """Return report payload :return: formatted report""" data = "" resolved_cards = self.get_list_cards(DEFAULT_RESOLVED_LIST) data += "{}: {}\n".format(DEFAULT_LIST, len(self.get_list_cards(DEFAULT_LIST))) data += "{}: {}\n".format(DEFAULT_SNOWFLAKE_LIST, len(self.get_list_cards(DEFAULT_SNOWFLAKE_LIST))) data += "{}: {}\n".format(DEFAULT_RESOLVED_LIST, len(resolved_cards)) data += "\n---\nResolved issues:\n---\n" for card in resolved_cards: data += "{} {}\n".format(card['shortUrl'], card['name']) return data def move_cards(self, to_list, from_list=None): """Move cards from one list to another :param to_list (required): name of list to move cards to :param from_list (optional, use default): name of list to move card from :return: None""" params = {} if not to_list: print("Cannot move: no destination list provided") return False if not from_list: from_list = DEFAULT_RESOLVED_LIST to_list_id = self.create_list(to_list) path = "/lists/" + self.get_list_id(from_list) + "/moveAllCards" params['idBoard'] = self.board_id_long params['idList'] = to_list_id return self.make_request(path, 'POST', params) def create_list(self, name=None): """Create new list :param name: name of list :return: list ID""" params = {} params['name'] = name params['idBoard'] = self.board_id_long params['pos'] = "bottom" newlist = self.make_request('/lists', 'POST', params) return newlist['id'] @staticmethod def email_report(email, subj, body): """Email report :param email: email address :param subj: email subject :param body: email body :return: None""" msg = MIMEText(body) msg['Subject'] = subj msg['From'] = EMAIL_FROM msg['To'] = email msg['Reply-to'] = EMAIL_REPLYTO smtpcxn = smtplib.SMTP(host=EMAIL_SERVER, port='25') smtpcxn.sendmail(email, email, msg.as_string()) smtpcxn.quit() def get_list_cards(self, trello_list=DEFAULT_LIST): """Return card total for given list :param trello_list: list name :return: cards array""" path = "/lists/%s/cards" % self.get_list_id(trello_list) return self.make_request(path) def trello_update(self, card_id, **kwargs): """Call trello update API :param card_id: card ID :return: success boolean""" params = {} path = None updated = False # handle being called via CLI or bot if self.args: if self.args.comment: kwargs['comment'] = self.args.comment if self.args.move: kwargs['move'] = self.args.move if self.args.assign: kwargs['assign'] = self.args.assign if self.args.unassign: kwargs['unassign'] = self.args.unassign # Since the trello API is different calls/methods for different data # we call multiple times if 'comment' in kwargs: params['text'] = kwargs['comment'] path = '/cards/' + card_id + '/actions/comments' updated = self.make_request(path, "POST", params) if 'resolve' in kwargs: params['idList'] = self.get_list_id(DEFAULT_RESOLVED_LIST) path = '/cards/' + card_id updated = self.make_request(path, "PUT", params) if 'move' in kwargs: params['idList'] = self.get_list_id(kwargs['move']) path = '/cards/' + card_id updated = self.make_request(path, "PUT", params) if 'assign' in kwargs: params['value'] = self.member_id(kwargs['assign']) path = '/cards/' + card_id + '/idMembers' updated = self.make_request(path, "POST", params) if 'unassign' in kwargs: path = '/cards/' + card_id + '/idMembers/' + self.member_id(kwargs['unassign']) updated = self.make_request(path, "DELETE", params) return updated def trello_create(self, title): """Call trello create API :param title: name/title of card :return: card""" params = {} params['idList'] = self.get_list_id() params['name'] = title path = '/cards' return self.make_request(path, "POST", params) def member_username(self, memberid): """Get member username from member ID""" member = self.make_request('/members/' + memberid) return member['username'] def member_id(self, username): """Get member id from username""" members = self.make_request('/boards/' + self.board_id + '/members/') for member in members: if username == member['username']: return member['id'] def card_id(self, url=None): """Return parsed card ID from URL example: https://trello.com/c/PZlOHgGm returns: PZlOHgGm :param url: trello short URL :return: trello card ID""" if not url: url = self.args.card parsed_uri = url.split("/") return parsed_uri[-1] def get_list_id(self, list_id=None): """Return the list ID :param list_id: list ID if not default :return: list_id""" default = DEFAULT_LIST if list_id: default = list_id path = '/boards/' + self.board_id + '/lists/' lists = self.make_request(path) # match board name regardless of case pattern = re.compile(default, re.I) for board_list in lists: if re.match(pattern, board_list['name']): return board_list['id'] sys.exit("List '%s' not found" % list_id) def trello_get(self, card_id=None): """Get trello cards :param card_id: trello card ID :return: trello json""" path = None if card_id: path = '/cards/' + card_id elif self.args.users: path = '/boards/' + self.board_id + '/members' else: path = '/lists/' + self.get_list_id(self.args.list) + '/cards' results = self.make_request(path) return results def make_request(self, path, method="GET", params=None): """Trello API call :param path: trello API path :param method: rest call method :param params: API params :return: trello json""" if not params: params = {} params['key'] = self.api_key params['token'] = self.oauth_token url = BASE_URL + path data = None if method == "GET": url += '?' + urlencode(params) elif method in ['DELETE', 'POST', 'PUT']: data = urlencode(params).encode('utf-8') request = Request(url) if method in ['DELETE', 'PUT']: request.get_method = lambda: method try: if data: response = urlopen(request, data=data) else: response = urlopen(request) except HTTPError as err: print(err) print(err.read()) result = None else: result = json.loads(response.read().decode('utf-8')) return result def get_trello_id(ircnick): """Return trello ID for a given IRC nick""" key = 'IRCNICK_' + ircnick try: return os.environ[key] except KeyError: print("%s, you need to map your IRC nick with Trello username" % ircnick) return None @sopel.module.commands('issue') def issue(bot, trigger): """Record a new issue in Trello, e.g. '.issue Some issue text'""" trellobot = Trello() card = trellobot.trello_create(trigger.group(2)) bot.say(card['shortUrl']) if not trellobot.trello_update(trellobot.card_id(card['shortUrl']), assign=get_trello_id(trigger.nick)): bot.reply( "you need to map your IRC nick with Trello username." + "See https://github.com/openshift/openshift-ansible-ops/tree/prod/playbooks/adhoc/ircbot") @sopel.module.commands('comment') def comment(bot, trigger): """Add comment to a trello card, e.g. '.comment <trelloShortUrl> My comment'""" trellobot = Trello() msg = trigger.group(2).partition(' ') trellobot.trello_update(trellobot.card_id(msg[0]), comment=msg[2]) bot.say('Comment added') @sopel.module.commands('resolve', 'resolved') def resolve(bot, trigger): """Resolve a trello card, e.g. '.resolve <trelloShortUrl>'""" trellobot = Trello() if trellobot.trello_update(trellobot.card_id(trigger.group(2)), resolve=True): card = trellobot.trello_get(trellobot.card_id(trigger.group(2))) bot.say('Resolved {}: {}'.format(trigger.group(2), card['name'])) else: bot.say('Could not resolve %s' % trigger.group(2)) def main(): """ main() function :return: """ trello = Trello() trello.args = Trello.parse_args() if trello.args.action is 'create': print(trello.create()) elif trello.args.action is 'get': print(trello.get()) elif trello.args.action is 'update': trello.update() elif trello.args.action is 'report': trello.report() if __name__ == "__main__": main()
appuio/ansible-role-openshift-zabbix-monitoring
vendor/openshift-tools/openshift_tools/ircbot/trello/trello.py
Python
apache-2.0
16,279
package epic.trees /* Copyright 2012 David Hall Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * Removes unaries chains A -> B -> ... -> C, replacing them with A -> C and modifying the tree * to know about the unaries * * * @author dlwh */ object UnaryChainCollapser { def collapseUnaryChains(tree: BinarizedTree[AnnotatedLabel], keepChains: Boolean = true): BinarizedTree[AnnotatedLabel] = { def transform(t: BinarizedTree[AnnotatedLabel],parentWasUnary:Boolean):BinarizedTree[AnnotatedLabel] = t match { case UnaryTree(l,c, _chain, span) => val (chain,cn) = stripChain(c) UnaryTree(l,transform(cn,true), if(keepChains) _chain ++ chain.toIndexedSeq else IndexedSeq.empty, t.span) case BinaryTree(l,lchild,rchild, span) => if(parentWasUnary) BinaryTree(l,transform(lchild,false),transform(rchild,false), t.span) else UnaryTree(l,BinaryTree(l,transform(lchild,false),transform(rchild,false), t.span), IndexedSeq.empty, t.span) case NullaryTree(l, span) => if(parentWasUnary) NullaryTree(l, t.span) else UnaryTree(l,NullaryTree(l, t.span), IndexedSeq.empty, t.span) case t => t } transform(tree,true) } private def stripChain(t: BinarizedTree[AnnotatedLabel]):(List[String],BinarizedTree[AnnotatedLabel]) = t match { case UnaryTree(l, c, _, span) => val (chain,tn) = stripChain(c) (l.label :: chain, tn) case _ => (List.empty,t) } }
maxim-rabinovich/epic
src/main/scala/epic/trees/UnaryChainCollapser.scala
Scala
apache-2.0
1,948
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.iec60870; import java.util.Arrays; import java.util.Objects; import org.eclipse.neoscada.protocol.iec60870.asdu.types.ASDUAddress; import org.eclipse.neoscada.protocol.iec60870.asdu.types.InformationObjectAddress; public class ObjectAddress { int[] address; private ObjectAddress(final int[] address) { this.address = address; } public ObjectAddress(final int a1, final int a2, final int a3, final int a4, final int a5) { this.address = new int[] {a1, a2, a3, a4, a5}; } @Override public String toString() { return String.format("%02d-%02d-%02d-%02d-%02d", this.address[0], this.address[1], this.address[2], this.address[3], this.address[4]); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(this.address); return result; } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ObjectAddress other = (ObjectAddress)obj; if (!Arrays.equals(this.address, other.address)) { return false; } return true; } public static ObjectAddress valueOf(final ASDUAddress asduAddress, final InformationObjectAddress address) { Objects.requireNonNull(asduAddress); Objects.requireNonNull(address); final int[] a = asduAddress.toArray(); final int[] b = address.toArray(); return new ObjectAddress(a[0], a[1], b[0], b[1], b[2]); } public static ObjectAddress valueOf(final String address) { if (address == null || address.isEmpty()) { return null; } final String[] toks = address.split("-"); if (toks.length != 5) { throw new IllegalArgumentException("Invalid address. Must have 5 octets."); } final int[] a = new int[toks.length]; for (int i = 0; i < toks.length; i++) { final int v; try { v = Integer.parseInt(toks[i]); } catch (final NumberFormatException e) { throw new IllegalArgumentException("Address segment must be numeric", e); } if (v < 0 || v > 255) { throw new IllegalArgumentException(String.format("Address segment must be an octet, between 0 and 255 (is %s)", v)); } a[i] = v; } return new ObjectAddress(a); } public ASDUAddress getASDUAddress() { return ASDUAddress.fromArray(new int[] {this.address[0], this.address[1]}); } public InformationObjectAddress getInformationObjectAddress() { return InformationObjectAddress.fromArray(new int[] {this.address[2], this.address[3], this.address[4]}); } }
DariusX/camel
components/camel-iec60870/src/main/java/org/apache/camel/component/iec60870/ObjectAddress.java
Java
apache-2.0
3,804
/* * Copyright 2000-2016 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.vaadin.server.communication; import java.io.Serializable; import com.vaadin.ui.UI; /** * Represents a bidirectional ("push") connection between a single UI and its * client-side. A single {@code PushConnection} instance is bound to a UI as * long as push is enabled in that UI, even if the actual connection is * momentarily dropped either due to a network failure or as a normal part of * the transport mechanism. * <p> * This interface is an internal API, only meant to be used by the framework. * * @author Vaadin Ltd * @since 7.1 */ public interface PushConnection extends Serializable { /** * Pushes pending state changes and client RPC calls to the client. Can be * called even if {@link #isConnected()} is false; the push will be deferred * until a connection is available. It is NOT safe to invoke this method if * not holding the session lock. * <p> * This is internal API; please use {@link UI#push()} instead. */ public void push(); /** * Closes the connection. Cannot be called if {@link #isConnected()} is * false. */ public void disconnect(); /** * Returns whether this connection is currently open. */ public boolean isConnected(); }
Darsstar/framework
server/src/main/java/com/vaadin/server/communication/PushConnection.java
Java
apache-2.0
1,860
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.spark.sql.sources import java.io.File import java.nio.charset.StandardCharsets import java.nio.file.{Files, Paths} import org.scalatest.BeforeAndAfter import org.apache.spark.sql.{AnalysisException, DataFrame, SaveMode} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSQLContext import org.apache.spark.sql.types._ import org.apache.spark.util.Utils class SaveLoadSuite extends DataSourceTest with SharedSQLContext with BeforeAndAfter { import testImplicits._ protected override lazy val sql = spark.sql _ private var originalDefaultSource: String = null private var path: File = null private var df: DataFrame = null override def beforeAll(): Unit = { super.beforeAll() originalDefaultSource = spark.sessionState.conf.defaultDataSourceName path = Utils.createTempDir() path.delete() val ds = (1 to 10).map(i => s"""{"a":$i, "b":"str${i}"}""").toDS() df = spark.read.json(ds) df.createOrReplaceTempView("jsonTable") } override def afterAll(): Unit = { try { spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, originalDefaultSource) } finally { super.afterAll() } } after { Utils.deleteRecursively(path) } def checkLoad(expectedDF: DataFrame = df, tbl: String = "jsonTable"): Unit = { spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, "org.apache.spark.sql.json") checkAnswer(spark.read.load(path.toString), expectedDF.collect()) // Test if we can pick up the data source name passed in load. spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, "not a source name") checkAnswer(spark.read.format("json").load(path.toString), expectedDF.collect()) checkAnswer(spark.read.format("json").load(path.toString), expectedDF.collect()) val schema = StructType(StructField("b", StringType, true) :: Nil) checkAnswer( spark.read.format("json").schema(schema).load(path.toString), sql(s"SELECT b FROM $tbl").collect()) } test("save with path and load") { spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, "org.apache.spark.sql.json") df.write.save(path.toString) checkLoad() } test("save with string mode and path, and load") { spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, "org.apache.spark.sql.json") path.createNewFile() df.write.mode("overwrite").save(path.toString) checkLoad() } test("save with path and datasource, and load") { spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, "not a source name") df.write.json(path.toString) checkLoad() } test("save with data source and options, and load") { spark.conf.set(SQLConf.DEFAULT_DATA_SOURCE_NAME.key, "not a source name") df.write.mode(SaveMode.ErrorIfExists).json(path.toString) checkLoad() } test("save and save again") { df.write.json(path.toString) val message = intercept[AnalysisException] { df.write.json(path.toString) }.getMessage assert( message.contains("already exists"), "We should complain that the path already exists.") if (path.exists()) Utils.deleteRecursively(path) df.write.json(path.toString) checkLoad() df.write.mode(SaveMode.Overwrite).json(path.toString) checkLoad() // verify the append mode df.write.mode(SaveMode.Append).json(path.toString) val df2 = df.union(df) df2.createOrReplaceTempView("jsonTable2") checkLoad(df2, "jsonTable2") } test("SPARK-23459: Improve error message when specified unknown column in partition columns") { withTempDir { dir => val path = dir.getCanonicalPath val unknown = "unknownColumn" val df = Seq(1L -> "a").toDF("i", "j") val schemaCatalog = df.schema.catalogString val e = intercept[AnalysisException] { df.write .format("parquet") .partitionBy(unknown) .save(path) }.getMessage assert(e.contains(s"Partition column `$unknown` not found in schema $schemaCatalog")) } } test("skip empty files in non bucketed read") { withTempDir { dir => val path = dir.getCanonicalPath Files.write(Paths.get(path, "empty"), Array.empty[Byte]) Files.write(Paths.get(path, "notEmpty"), "a".getBytes(StandardCharsets.UTF_8)) val readback = spark.read.option("wholetext", true).text(path) assert(readback.rdd.getNumPartitions === 1) } } }
Aegeaner/spark
sql/core/src/test/scala/org/apache/spark/sql/sources/SaveLoadSuite.scala
Scala
apache-2.0
5,245
# # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb') describe Ohai::System, "Solaris2.X cpu plugin" do before(:each) do @plugin = get_plugin("solaris2/cpu") allow(@plugin).to receive(:collect_os).and_return("solaris2") end describe "on x86 processors" do before(:each) do kstatinfo_output = <<-END cpu_info:0:cpu_info0:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:0:cpu_info0:cache_id 1 cpu_info:0:cpu_info0:chip_id 1 cpu_info:0:cpu_info0:class misc cpu_info:0:cpu_info0:clock_MHz 1933 cpu_info:0:cpu_info0:clog_id 0 cpu_info:0:cpu_info0:core_id 8 cpu_info:0:cpu_info0:cpu_type i386 cpu_info:0:cpu_info0:crtime 300.455409162 cpu_info:0:cpu_info0:current_clock_Hz 2925945978 cpu_info:0:cpu_info0:current_cstate 0 cpu_info:0:cpu_info0:family 12 cpu_info:0:cpu_info0:fpu_type i387 compatible cpu_info:0:cpu_info0:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:0:cpu_info0:model 93 cpu_info:0:cpu_info0:ncore_per_chip 4 cpu_info:0:cpu_info0:ncpu_per_chip 8 cpu_info:0:cpu_info0:pg_id 1 cpu_info:0:cpu_info0:pkg_core_id 0 cpu_info:0:cpu_info0:snaptime 12444687.9690404 cpu_info:0:cpu_info0:state off-line cpu_info:0:cpu_info0:state_begin 1427142581 cpu_info:0:cpu_info0:stepping 9 cpu_info:0:cpu_info0:supported_frequencies_Hz 2925945978 cpu_info:0:cpu_info0:supported_max_cstates 1 cpu_info:0:cpu_info0:vendor_id CrazyTown cpu_info:1:cpu_info1:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:1:cpu_info1:cache_id 0 cpu_info:1:cpu_info1:chip_id 0 cpu_info:1:cpu_info1:class misc cpu_info:1:cpu_info1:clock_MHz 2926 cpu_info:1:cpu_info1:clog_id 0 cpu_info:1:cpu_info1:core_id 0 cpu_info:1:cpu_info1:cpu_type i386 cpu_info:1:cpu_info1:crtime 308.198046165 cpu_info:1:cpu_info1:current_clock_Hz 2925945978 cpu_info:1:cpu_info1:current_cstate 1 cpu_info:1:cpu_info1:family 6 cpu_info:1:cpu_info1:fpu_type i387 compatible cpu_info:1:cpu_info1:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:1:cpu_info1:model 26 cpu_info:1:cpu_info1:ncore_per_chip 4 cpu_info:1:cpu_info1:ncpu_per_chip 8 cpu_info:1:cpu_info1:pg_id 4 cpu_info:1:cpu_info1:pkg_core_id 0 cpu_info:1:cpu_info1:snaptime 12444687.9693359 cpu_info:1:cpu_info1:state on-line cpu_info:1:cpu_info1:state_begin 1427142588 cpu_info:1:cpu_info1:stepping 5 cpu_info:1:cpu_info1:supported_frequencies_Hz 2925945978 cpu_info:1:cpu_info1:supported_max_cstates 1 cpu_info:1:cpu_info1:vendor_id GenuineIntel cpu_info:2:cpu_info2:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:2:cpu_info2:cache_id 1 cpu_info:2:cpu_info2:chip_id 1 cpu_info:2:cpu_info2:class misc cpu_info:2:cpu_info2:clock_MHz 1933 cpu_info:2:cpu_info2:clog_id 2 cpu_info:2:cpu_info2:core_id 9 cpu_info:2:cpu_info2:cpu_type i386 cpu_info:2:cpu_info2:crtime 308.280117986 cpu_info:2:cpu_info2:current_clock_Hz 2925945978 cpu_info:2:cpu_info2:current_cstate 0 cpu_info:2:cpu_info2:family 12 cpu_info:2:cpu_info2:fpu_type i387 compatible cpu_info:2:cpu_info2:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:2:cpu_info2:model 93 cpu_info:2:cpu_info2:ncore_per_chip 4 cpu_info:2:cpu_info2:ncpu_per_chip 8 cpu_info:2:cpu_info2:pg_id 7 cpu_info:2:cpu_info2:pkg_core_id 1 cpu_info:2:cpu_info2:snaptime 12444687.9695684 cpu_info:2:cpu_info2:state off-line cpu_info:2:cpu_info2:state_begin 1427142588 cpu_info:2:cpu_info2:stepping 9 cpu_info:2:cpu_info2:supported_frequencies_Hz 2925945978 cpu_info:2:cpu_info2:supported_max_cstates 1 cpu_info:2:cpu_info2:vendor_id CrazyTown cpu_info:3:cpu_info3:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:3:cpu_info3:cache_id 0 cpu_info:3:cpu_info3:chip_id 0 cpu_info:3:cpu_info3:class misc cpu_info:3:cpu_info3:clock_MHz 2926 cpu_info:3:cpu_info3:clog_id 2 cpu_info:3:cpu_info3:core_id 1 cpu_info:3:cpu_info3:cpu_type i386 cpu_info:3:cpu_info3:crtime 308.310124315 cpu_info:3:cpu_info3:current_clock_Hz 2925945978 cpu_info:3:cpu_info3:current_cstate 1 cpu_info:3:cpu_info3:family 6 cpu_info:3:cpu_info3:fpu_type i387 compatible cpu_info:3:cpu_info3:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:3:cpu_info3:model 26 cpu_info:3:cpu_info3:ncore_per_chip 4 cpu_info:3:cpu_info3:ncpu_per_chip 8 cpu_info:3:cpu_info3:pg_id 8 cpu_info:3:cpu_info3:pkg_core_id 1 cpu_info:3:cpu_info3:snaptime 12444687.9698122 cpu_info:3:cpu_info3:state on-line cpu_info:3:cpu_info3:state_begin 1427142588 cpu_info:3:cpu_info3:stepping 5 cpu_info:3:cpu_info3:supported_frequencies_Hz 2925945978 cpu_info:3:cpu_info3:supported_max_cstates 1 cpu_info:3:cpu_info3:vendor_id GenuineIntel cpu_info:4:cpu_info4:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:4:cpu_info4:cache_id 1 cpu_info:4:cpu_info4:chip_id 1 cpu_info:4:cpu_info4:class misc cpu_info:4:cpu_info4:clock_MHz 1933 cpu_info:4:cpu_info4:clog_id 4 cpu_info:4:cpu_info4:core_id 10 cpu_info:4:cpu_info4:cpu_type i386 cpu_info:4:cpu_info4:crtime 308.340112555 cpu_info:4:cpu_info4:current_clock_Hz 2925945978 cpu_info:4:cpu_info4:current_cstate 0 cpu_info:4:cpu_info4:family 12 cpu_info:4:cpu_info4:fpu_type i387 compatible cpu_info:4:cpu_info4:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:4:cpu_info4:model 93 cpu_info:4:cpu_info4:ncore_per_chip 4 cpu_info:4:cpu_info4:ncpu_per_chip 8 cpu_info:4:cpu_info4:pg_id 9 cpu_info:4:cpu_info4:pkg_core_id 2 cpu_info:4:cpu_info4:snaptime 12444687.9700613 cpu_info:4:cpu_info4:state off-line cpu_info:4:cpu_info4:state_begin 1427142588 cpu_info:4:cpu_info4:stepping 9 cpu_info:4:cpu_info4:supported_frequencies_Hz 2925945978 cpu_info:4:cpu_info4:supported_max_cstates 1 cpu_info:4:cpu_info4:vendor_id CrazyTown cpu_info:5:cpu_info5:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:5:cpu_info5:cache_id 0 cpu_info:5:cpu_info5:chip_id 0 cpu_info:5:cpu_info5:class misc cpu_info:5:cpu_info5:clock_MHz 2926 cpu_info:5:cpu_info5:clog_id 4 cpu_info:5:cpu_info5:core_id 2 cpu_info:5:cpu_info5:cpu_type i386 cpu_info:5:cpu_info5:crtime 308.370191347 cpu_info:5:cpu_info5:current_clock_Hz 2925945978 cpu_info:5:cpu_info5:current_cstate 1 cpu_info:5:cpu_info5:family 6 cpu_info:5:cpu_info5:fpu_type i387 compatible cpu_info:5:cpu_info5:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:5:cpu_info5:model 26 cpu_info:5:cpu_info5:ncore_per_chip 4 cpu_info:5:cpu_info5:ncpu_per_chip 8 cpu_info:5:cpu_info5:pg_id 10 cpu_info:5:cpu_info5:pkg_core_id 2 cpu_info:5:cpu_info5:snaptime 12444687.9702885 cpu_info:5:cpu_info5:state on-line cpu_info:5:cpu_info5:state_begin 1427142589 cpu_info:5:cpu_info5:stepping 5 cpu_info:5:cpu_info5:supported_frequencies_Hz 2925945978 cpu_info:5:cpu_info5:supported_max_cstates 1 cpu_info:5:cpu_info5:vendor_id GenuineIntel cpu_info:6:cpu_info6:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:6:cpu_info6:cache_id 1 cpu_info:6:cpu_info6:chip_id 1 cpu_info:6:cpu_info6:class misc cpu_info:6:cpu_info6:clock_MHz 1933 cpu_info:6:cpu_info6:clog_id 6 cpu_info:6:cpu_info6:core_id 11 cpu_info:6:cpu_info6:cpu_type i386 cpu_info:6:cpu_info6:crtime 308.400119134 cpu_info:6:cpu_info6:current_clock_Hz 2925945978 cpu_info:6:cpu_info6:current_cstate 1 cpu_info:6:cpu_info6:family 12 cpu_info:6:cpu_info6:fpu_type i387 compatible cpu_info:6:cpu_info6:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:6:cpu_info6:model 93 cpu_info:6:cpu_info6:ncore_per_chip 4 cpu_info:6:cpu_info6:ncpu_per_chip 8 cpu_info:6:cpu_info6:pg_id 11 cpu_info:6:cpu_info6:pkg_core_id 3 cpu_info:6:cpu_info6:snaptime 12444687.9705136 cpu_info:6:cpu_info6:state off-line cpu_info:6:cpu_info6:state_begin 1427142589 cpu_info:6:cpu_info6:stepping 9 cpu_info:6:cpu_info6:supported_frequencies_Hz 2925945978 cpu_info:6:cpu_info6:supported_max_cstates 1 cpu_info:6:cpu_info6:vendor_id CrazyTown cpu_info:7:cpu_info7:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:7:cpu_info7:cache_id 0 cpu_info:7:cpu_info7:chip_id 0 cpu_info:7:cpu_info7:class misc cpu_info:7:cpu_info7:clock_MHz 2926 cpu_info:7:cpu_info7:clog_id 6 cpu_info:7:cpu_info7:core_id 3 cpu_info:7:cpu_info7:cpu_type i386 cpu_info:7:cpu_info7:crtime 308.430139185 cpu_info:7:cpu_info7:current_clock_Hz 2925945978 cpu_info:7:cpu_info7:current_cstate 1 cpu_info:7:cpu_info7:family 6 cpu_info:7:cpu_info7:fpu_type i387 compatible cpu_info:7:cpu_info7:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:7:cpu_info7:model 26 cpu_info:7:cpu_info7:ncore_per_chip 4 cpu_info:7:cpu_info7:ncpu_per_chip 8 cpu_info:7:cpu_info7:pg_id 12 cpu_info:7:cpu_info7:pkg_core_id 3 cpu_info:7:cpu_info7:snaptime 12444687.9707517 cpu_info:7:cpu_info7:state on-line cpu_info:7:cpu_info7:state_begin 1427142589 cpu_info:7:cpu_info7:stepping 5 cpu_info:7:cpu_info7:supported_frequencies_Hz 2925945978 cpu_info:7:cpu_info7:supported_max_cstates 1 cpu_info:7:cpu_info7:vendor_id GenuineIntel cpu_info:8:cpu_info8:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:8:cpu_info8:cache_id 1 cpu_info:8:cpu_info8:chip_id 1 cpu_info:8:cpu_info8:class misc cpu_info:8:cpu_info8:clock_MHz 1933 cpu_info:8:cpu_info8:clog_id 1 cpu_info:8:cpu_info8:core_id 8 cpu_info:8:cpu_info8:cpu_type i386 cpu_info:8:cpu_info8:crtime 308.460126522 cpu_info:8:cpu_info8:current_clock_Hz 2925945978 cpu_info:8:cpu_info8:current_cstate 1 cpu_info:8:cpu_info8:family 12 cpu_info:8:cpu_info8:fpu_type i387 compatible cpu_info:8:cpu_info8:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:8:cpu_info8:model 93 cpu_info:8:cpu_info8:ncore_per_chip 4 cpu_info:8:cpu_info8:ncpu_per_chip 8 cpu_info:8:cpu_info8:pg_id 1 cpu_info:8:cpu_info8:pkg_core_id 0 cpu_info:8:cpu_info8:snaptime 12444687.9709846 cpu_info:8:cpu_info8:state off-line cpu_info:8:cpu_info8:state_begin 1427142589 cpu_info:8:cpu_info8:stepping 9 cpu_info:8:cpu_info8:supported_frequencies_Hz 2925945978 cpu_info:8:cpu_info8:supported_max_cstates 1 cpu_info:8:cpu_info8:vendor_id CrazyTown cpu_info:9:cpu_info9:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:9:cpu_info9:cache_id 0 cpu_info:9:cpu_info9:chip_id 0 cpu_info:9:cpu_info9:class misc cpu_info:9:cpu_info9:clock_MHz 2926 cpu_info:9:cpu_info9:clog_id 1 cpu_info:9:cpu_info9:core_id 0 cpu_info:9:cpu_info9:cpu_type i386 cpu_info:9:cpu_info9:crtime 308.490165484 cpu_info:9:cpu_info9:current_clock_Hz 2925945978 cpu_info:9:cpu_info9:current_cstate 1 cpu_info:9:cpu_info9:family 6 cpu_info:9:cpu_info9:fpu_type i387 compatible cpu_info:9:cpu_info9:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:9:cpu_info9:model 26 cpu_info:9:cpu_info9:ncore_per_chip 4 cpu_info:9:cpu_info9:ncpu_per_chip 8 cpu_info:9:cpu_info9:pg_id 4 cpu_info:9:cpu_info9:pkg_core_id 0 cpu_info:9:cpu_info9:snaptime 12444687.9712051 cpu_info:9:cpu_info9:state on-line cpu_info:9:cpu_info9:state_begin 1427142589 cpu_info:9:cpu_info9:stepping 5 cpu_info:9:cpu_info9:supported_frequencies_Hz 2925945978 cpu_info:9:cpu_info9:supported_max_cstates 1 cpu_info:9:cpu_info9:vendor_id GenuineIntel cpu_info:10:cpu_info10:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:10:cpu_info10:cache_id 1 cpu_info:10:cpu_info10:chip_id 1 cpu_info:10:cpu_info10:class misc cpu_info:10:cpu_info10:clock_MHz 1933 cpu_info:10:cpu_info10:clog_id 3 cpu_info:10:cpu_info10:core_id 9 cpu_info:10:cpu_info10:cpu_type i386 cpu_info:10:cpu_info10:crtime 308.520151852 cpu_info:10:cpu_info10:current_clock_Hz 2925945978 cpu_info:10:cpu_info10:current_cstate 1 cpu_info:10:cpu_info10:family 12 cpu_info:10:cpu_info10:fpu_type i387 compatible cpu_info:10:cpu_info10:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:10:cpu_info10:model 93 cpu_info:10:cpu_info10:ncore_per_chip 4 cpu_info:10:cpu_info10:ncpu_per_chip 8 cpu_info:10:cpu_info10:pg_id 7 cpu_info:10:cpu_info10:pkg_core_id 1 cpu_info:10:cpu_info10:snaptime 12444687.9714381 cpu_info:10:cpu_info10:state off-line cpu_info:10:cpu_info10:state_begin 1427142589 cpu_info:10:cpu_info10:stepping 9 cpu_info:10:cpu_info10:supported_frequencies_Hz 2925945978 cpu_info:10:cpu_info10:supported_max_cstates 1 cpu_info:10:cpu_info10:vendor_id CrazyTown cpu_info:11:cpu_info11:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:11:cpu_info11:cache_id 0 cpu_info:11:cpu_info11:chip_id 0 cpu_info:11:cpu_info11:class misc cpu_info:11:cpu_info11:clock_MHz 2926 cpu_info:11:cpu_info11:clog_id 3 cpu_info:11:cpu_info11:core_id 1 cpu_info:11:cpu_info11:cpu_type i386 cpu_info:11:cpu_info11:crtime 308.550150882 cpu_info:11:cpu_info11:current_clock_Hz 2925945978 cpu_info:11:cpu_info11:current_cstate 1 cpu_info:11:cpu_info11:family 6 cpu_info:11:cpu_info11:fpu_type i387 compatible cpu_info:11:cpu_info11:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:11:cpu_info11:model 26 cpu_info:11:cpu_info11:ncore_per_chip 4 cpu_info:11:cpu_info11:ncpu_per_chip 8 cpu_info:11:cpu_info11:pg_id 8 cpu_info:11:cpu_info11:pkg_core_id 1 cpu_info:11:cpu_info11:snaptime 12444687.9716655 cpu_info:11:cpu_info11:state on-line cpu_info:11:cpu_info11:state_begin 1427142589 cpu_info:11:cpu_info11:stepping 5 cpu_info:11:cpu_info11:supported_frequencies_Hz 2925945978 cpu_info:11:cpu_info11:supported_max_cstates 1 cpu_info:11:cpu_info11:vendor_id GenuineIntel cpu_info:12:cpu_info12:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:12:cpu_info12:cache_id 1 cpu_info:12:cpu_info12:chip_id 1 cpu_info:12:cpu_info12:class misc cpu_info:12:cpu_info12:clock_MHz 1933 cpu_info:12:cpu_info12:clog_id 5 cpu_info:12:cpu_info12:core_id 10 cpu_info:12:cpu_info12:cpu_type i386 cpu_info:12:cpu_info12:crtime 308.580146834 cpu_info:12:cpu_info12:current_clock_Hz 2925945978 cpu_info:12:cpu_info12:current_cstate 1 cpu_info:12:cpu_info12:family 12 cpu_info:12:cpu_info12:fpu_type i387 compatible cpu_info:12:cpu_info12:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:12:cpu_info12:model 93 cpu_info:12:cpu_info12:ncore_per_chip 4 cpu_info:12:cpu_info12:ncpu_per_chip 8 cpu_info:12:cpu_info12:pg_id 9 cpu_info:12:cpu_info12:pkg_core_id 2 cpu_info:12:cpu_info12:snaptime 12444687.9718927 cpu_info:12:cpu_info12:state off-line cpu_info:12:cpu_info12:state_begin 1427142589 cpu_info:12:cpu_info12:stepping 9 cpu_info:12:cpu_info12:supported_frequencies_Hz 2925945978 cpu_info:12:cpu_info12:supported_max_cstates 1 cpu_info:12:cpu_info12:vendor_id CrazyTown cpu_info:13:cpu_info13:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:13:cpu_info13:cache_id 0 cpu_info:13:cpu_info13:chip_id 0 cpu_info:13:cpu_info13:class misc cpu_info:13:cpu_info13:clock_MHz 2926 cpu_info:13:cpu_info13:clog_id 5 cpu_info:13:cpu_info13:core_id 2 cpu_info:13:cpu_info13:cpu_type i386 cpu_info:13:cpu_info13:crtime 308.610149804 cpu_info:13:cpu_info13:current_clock_Hz 2925945978 cpu_info:13:cpu_info13:current_cstate 1 cpu_info:13:cpu_info13:family 6 cpu_info:13:cpu_info13:fpu_type i387 compatible cpu_info:13:cpu_info13:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:13:cpu_info13:model 26 cpu_info:13:cpu_info13:ncore_per_chip 4 cpu_info:13:cpu_info13:ncpu_per_chip 8 cpu_info:13:cpu_info13:pg_id 10 cpu_info:13:cpu_info13:pkg_core_id 2 cpu_info:13:cpu_info13:snaptime 12444687.9721356 cpu_info:13:cpu_info13:state on-line cpu_info:13:cpu_info13:state_begin 1427142589 cpu_info:13:cpu_info13:stepping 5 cpu_info:13:cpu_info13:supported_frequencies_Hz 2925945978 cpu_info:13:cpu_info13:supported_max_cstates 1 cpu_info:13:cpu_info13:vendor_id GenuineIntel cpu_info:14:cpu_info14:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz cpu_info:14:cpu_info14:cache_id 1 cpu_info:14:cpu_info14:chip_id 1 cpu_info:14:cpu_info14:class misc cpu_info:14:cpu_info14:clock_MHz 1933 cpu_info:14:cpu_info14:clog_id 7 cpu_info:14:cpu_info14:core_id 11 cpu_info:14:cpu_info14:cpu_type i386 cpu_info:14:cpu_info14:crtime 308.640144708 cpu_info:14:cpu_info14:current_clock_Hz 2925945978 cpu_info:14:cpu_info14:current_cstate 1 cpu_info:14:cpu_info14:family 12 cpu_info:14:cpu_info14:fpu_type i387 compatible cpu_info:14:cpu_info14:implementation x86 (chipid 0x1 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:14:cpu_info14:model 93 cpu_info:14:cpu_info14:ncore_per_chip 4 cpu_info:14:cpu_info14:ncpu_per_chip 8 cpu_info:14:cpu_info14:pg_id 11 cpu_info:14:cpu_info14:pkg_core_id 3 cpu_info:14:cpu_info14:snaptime 12444687.9723752 cpu_info:14:cpu_info14:state off-line cpu_info:14:cpu_info14:state_begin 1427142589 cpu_info:14:cpu_info14:stepping 9 cpu_info:14:cpu_info14:supported_frequencies_Hz 2925945978 cpu_info:14:cpu_info14:supported_max_cstates 1 cpu_info:14:cpu_info14:vendor_id CrazyTown cpu_info:15:cpu_info15:brand Intel(r) Xeon(r) CPU X5570 @ 2.93GHz cpu_info:15:cpu_info15:cache_id 0 cpu_info:15:cpu_info15:chip_id 0 cpu_info:15:cpu_info15:class misc cpu_info:15:cpu_info15:clock_MHz 2926 cpu_info:15:cpu_info15:clog_id 7 cpu_info:15:cpu_info15:core_id 3 cpu_info:15:cpu_info15:cpu_type i386 cpu_info:15:cpu_info15:crtime 308.670163124 cpu_info:15:cpu_info15:current_clock_Hz 2925945978 cpu_info:15:cpu_info15:current_cstate 1 cpu_info:15:cpu_info15:family 6 cpu_info:15:cpu_info15:fpu_type i387 compatible cpu_info:15:cpu_info15:implementation x86 (chipid 0x0 GenuineIntel family 6 model 26 step 5 clock 2926 MHz) cpu_info:15:cpu_info15:model 26 cpu_info:15:cpu_info15:ncore_per_chip 4 cpu_info:15:cpu_info15:ncpu_per_chip 8 cpu_info:15:cpu_info15:pg_id 12 cpu_info:15:cpu_info15:pkg_core_id 3 cpu_info:15:cpu_info15:snaptime 12444687.9726021 cpu_info:15:cpu_info15:state on-line cpu_info:15:cpu_info15:state_begin 1427142589 cpu_info:15:cpu_info15:stepping 5 cpu_info:15:cpu_info15:supported_frequencies_Hz 2925945978 cpu_info:15:cpu_info15:supported_max_cstates 1 cpu_info:15:cpu_info15:vendor_id GenuineIntel END allow(@plugin).to receive(:shell_out).with("kstat -p cpu_info").and_return(mock_shell_out(0, kstatinfo_output, "")) @plugin.run end it "should get the total virtual processor count" do expect(@plugin["cpu"]["total"]).to eql(16) end it "should get the total processor count" do expect(@plugin["cpu"]["real"]).to eql(2) end it "should get the number of threads per core" do expect(@plugin["cpu"]["corethreads"]).to eql (2) end it "should get the total number of online cores" do expect(@plugin["cpu"]["cpustates"]["on-line"]).to eql (8) end it "should get the total number of offline cores" do expect(@plugin["cpu"]["cpustates"]["off-line"]).to eql (8) end describe "per-cpu information" do it "should include processor vendor_ids" do # CPU Socket 0 expect(@plugin["cpu"]["15"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["13"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["11"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["9"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["7"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["5"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["3"]["vendor_id"]).to eql("GenuineIntel") expect(@plugin["cpu"]["1"]["vendor_id"]).to eql("GenuineIntel") # CPU Socket 1 expect(@plugin["cpu"]["14"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["12"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["10"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["8"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["6"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["4"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["2"]["vendor_id"]).to eql("CrazyTown") expect(@plugin["cpu"]["0"]["vendor_id"]).to eql("CrazyTown") end it "should include processor families" do expect(@plugin["cpu"]["15"]["family"]).to eql("6") expect(@plugin["cpu"]["13"]["family"]).to eql("6") expect(@plugin["cpu"]["11"]["family"]).to eql("6") expect(@plugin["cpu"]["9"]["family"]).to eql("6") expect(@plugin["cpu"]["7"]["family"]).to eql("6") expect(@plugin["cpu"]["5"]["family"]).to eql("6") expect(@plugin["cpu"]["3"]["family"]).to eql("6") expect(@plugin["cpu"]["1"]["family"]).to eql("6") expect(@plugin["cpu"]["14"]["family"]).to eql("12") expect(@plugin["cpu"]["12"]["family"]).to eql("12") expect(@plugin["cpu"]["10"]["family"]).to eql("12") expect(@plugin["cpu"]["8"]["family"]).to eql("12") expect(@plugin["cpu"]["6"]["family"]).to eql("12") expect(@plugin["cpu"]["4"]["family"]).to eql("12") expect(@plugin["cpu"]["2"]["family"]).to eql("12") expect(@plugin["cpu"]["0"]["family"]).to eql("12") end it "should include processor models" do expect(@plugin["cpu"]["15"]["model"]).to eql("26") expect(@plugin["cpu"]["13"]["model"]).to eql("26") expect(@plugin["cpu"]["11"]["model"]).to eql("26") expect(@plugin["cpu"]["9"]["model"]).to eql("26") expect(@plugin["cpu"]["7"]["model"]).to eql("26") expect(@plugin["cpu"]["5"]["model"]).to eql("26") expect(@plugin["cpu"]["3"]["model"]).to eql("26") expect(@plugin["cpu"]["1"]["model"]).to eql("26") expect(@plugin["cpu"]["14"]["model"]).to eql("93") expect(@plugin["cpu"]["12"]["model"]).to eql("93") expect(@plugin["cpu"]["10"]["model"]).to eql("93") expect(@plugin["cpu"]["8"]["model"]).to eql("93") expect(@plugin["cpu"]["6"]["model"]).to eql("93") expect(@plugin["cpu"]["4"]["model"]).to eql("93") expect(@plugin["cpu"]["2"]["model"]).to eql("93") expect(@plugin["cpu"]["0"]["model"]).to eql("93") end it "should includ processor architecture" do expect(@plugin["cpu"]["15"]["arch"]).to eql("i386") expect(@plugin["cpu"]["13"]["arch"]).to eql("i386") expect(@plugin["cpu"]["11"]["arch"]).to eql("i386") expect(@plugin["cpu"]["9"]["arch"]).to eql("i386") expect(@plugin["cpu"]["7"]["arch"]).to eql("i386") expect(@plugin["cpu"]["5"]["arch"]).to eql("i386") expect(@plugin["cpu"]["3"]["arch"]).to eql("i386") expect(@plugin["cpu"]["1"]["arch"]).to eql("i386") expect(@plugin["cpu"]["14"]["arch"]).to eql("i386") expect(@plugin["cpu"]["12"]["arch"]).to eql("i386") expect(@plugin["cpu"]["10"]["arch"]).to eql("i386") expect(@plugin["cpu"]["8"]["arch"]).to eql("i386") expect(@plugin["cpu"]["6"]["arch"]).to eql("i386") expect(@plugin["cpu"]["4"]["arch"]).to eql("i386") expect(@plugin["cpu"]["2"]["arch"]).to eql("i386") expect(@plugin["cpu"]["0"]["arch"]).to eql("i386") end it "should include processor stepping" do expect(@plugin["cpu"]["15"]["stepping"]).to eql("5") expect(@plugin["cpu"]["13"]["stepping"]).to eql("5") expect(@plugin["cpu"]["11"]["stepping"]).to eql("5") expect(@plugin["cpu"]["9"]["stepping"]).to eql("5") expect(@plugin["cpu"]["7"]["stepping"]).to eql("5") expect(@plugin["cpu"]["5"]["stepping"]).to eql("5") expect(@plugin["cpu"]["3"]["stepping"]).to eql("5") expect(@plugin["cpu"]["1"]["stepping"]).to eql("5") expect(@plugin["cpu"]["14"]["stepping"]).to eql("9") expect(@plugin["cpu"]["12"]["stepping"]).to eql("9") expect(@plugin["cpu"]["10"]["stepping"]).to eql("9") expect(@plugin["cpu"]["8"]["stepping"]).to eql("9") expect(@plugin["cpu"]["6"]["stepping"]).to eql("9") expect(@plugin["cpu"]["4"]["stepping"]).to eql("9") expect(@plugin["cpu"]["2"]["stepping"]).to eql("9") expect(@plugin["cpu"]["0"]["stepping"]).to eql("9") end it "should include processor model names" do expect(@plugin["cpu"]["15"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["13"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["11"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["9"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["7"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["5"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["3"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["1"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz") expect(@plugin["cpu"]["14"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["12"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["10"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["8"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["6"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["4"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["2"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") expect(@plugin["cpu"]["0"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz") end it "should include processor speed in MHz" do expect(@plugin["cpu"]["15"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["13"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["11"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["9"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["7"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["5"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["3"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["1"]["mhz"]).to eql("2926") expect(@plugin["cpu"]["14"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["12"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["10"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["8"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["6"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["4"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["2"]["mhz"]).to eql("1933") expect(@plugin["cpu"]["0"]["mhz"]).to eql("1933") end it "should include processor state" do expect(@plugin["cpu"]["15"]["state"]).to eql("on-line") expect(@plugin["cpu"]["13"]["state"]).to eql("on-line") expect(@plugin["cpu"]["11"]["state"]).to eql("on-line") expect(@plugin["cpu"]["9"]["state"]).to eql("on-line") expect(@plugin["cpu"]["7"]["state"]).to eql("on-line") expect(@plugin["cpu"]["5"]["state"]).to eql("on-line") expect(@plugin["cpu"]["3"]["state"]).to eql("on-line") expect(@plugin["cpu"]["1"]["state"]).to eql("on-line") expect(@plugin["cpu"]["14"]["state"]).to eql("off-line") expect(@plugin["cpu"]["12"]["state"]).to eql("off-line") expect(@plugin["cpu"]["10"]["state"]).to eql("off-line") expect(@plugin["cpu"]["8"]["state"]).to eql("off-line") expect(@plugin["cpu"]["6"]["state"]).to eql("off-line") expect(@plugin["cpu"]["4"]["state"]).to eql("off-line") expect(@plugin["cpu"]["2"]["state"]).to eql("off-line") expect(@plugin["cpu"]["0"]["state"]).to eql("off-line") end end end describe "on sparc processors" do before(:each) do kstatinfo_output = <<-END cpu_info:0:cpu_info0:brand SPARC-T3 cpu_info:0:cpu_info0:chip_id 0 cpu_info:0:cpu_info0:class misc cpu_info:0:cpu_info0:clock_MHz 1649 cpu_info:0:cpu_info0:core_id 1026 cpu_info:0:cpu_info0:cpu_fru hc:///component= cpu_info:0:cpu_info0:cpu_type sparcv9 cpu_info:0:cpu_info0:crtime 182.755017565 cpu_info:0:cpu_info0:current_clock_Hz 1648762500 cpu_info:0:cpu_info0:device_ID 0 cpu_info:0:cpu_info0:fpu_type sparcv9 cpu_info:0:cpu_info0:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:0:cpu_info0:pg_id 1 cpu_info:0:cpu_info0:snaptime 9305222.45903973 cpu_info:0:cpu_info0:state on-line cpu_info:0:cpu_info0:state_begin 1430258900 cpu_info:0:cpu_info0:supported_frequencies_Hz 1648762500 cpu_info:1:cpu_info1:brand SPARC-T3 cpu_info:1:cpu_info1:chip_id 0 cpu_info:1:cpu_info1:class misc cpu_info:1:cpu_info1:clock_MHz 1649 cpu_info:1:cpu_info1:core_id 1026 cpu_info:1:cpu_info1:cpu_fru hc:///component= cpu_info:1:cpu_info1:cpu_type sparcv9 cpu_info:1:cpu_info1:crtime 185.891012056 cpu_info:1:cpu_info1:current_clock_Hz 1648762500 cpu_info:1:cpu_info1:device_ID 1 cpu_info:1:cpu_info1:fpu_type sparcv9 cpu_info:1:cpu_info1:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:1:cpu_info1:pg_id 1 cpu_info:1:cpu_info1:snaptime 9305222.46043854 cpu_info:1:cpu_info1:state on-line cpu_info:1:cpu_info1:state_begin 1430258903 cpu_info:1:cpu_info1:supported_frequencies_Hz 1648762500 cpu_info:2:cpu_info2:brand SPARC-T3 cpu_info:2:cpu_info2:chip_id 0 cpu_info:2:cpu_info2:class misc cpu_info:2:cpu_info2:clock_MHz 1649 cpu_info:2:cpu_info2:core_id 1026 cpu_info:2:cpu_info2:cpu_fru hc:///component= cpu_info:2:cpu_info2:cpu_type sparcv9 cpu_info:2:cpu_info2:crtime 185.89327726 cpu_info:2:cpu_info2:current_clock_Hz 1648762500 cpu_info:2:cpu_info2:device_ID 2 cpu_info:2:cpu_info2:fpu_type sparcv9 cpu_info:2:cpu_info2:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:2:cpu_info2:pg_id 1 cpu_info:2:cpu_info2:snaptime 9305222.46159979 cpu_info:2:cpu_info2:state on-line cpu_info:2:cpu_info2:state_begin 1430258903 cpu_info:2:cpu_info2:supported_frequencies_Hz 1648762500 cpu_info:3:cpu_info3:brand SPARC-T3 cpu_info:3:cpu_info3:chip_id 0 cpu_info:3:cpu_info3:class misc cpu_info:3:cpu_info3:clock_MHz 1649 cpu_info:3:cpu_info3:core_id 1026 cpu_info:3:cpu_info3:cpu_fru hc:///component= cpu_info:3:cpu_info3:cpu_type sparcv9 cpu_info:3:cpu_info3:crtime 185.895286738 cpu_info:3:cpu_info3:current_clock_Hz 1648762500 cpu_info:3:cpu_info3:device_ID 3 cpu_info:3:cpu_info3:fpu_type sparcv9 cpu_info:3:cpu_info3:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:3:cpu_info3:pg_id 1 cpu_info:3:cpu_info3:snaptime 9305222.46276104 cpu_info:3:cpu_info3:state on-line cpu_info:3:cpu_info3:state_begin 1430258903 cpu_info:3:cpu_info3:supported_frequencies_Hz 1648762500 cpu_info:4:cpu_info4:brand SPARC-T3 cpu_info:4:cpu_info4:chip_id 0 cpu_info:4:cpu_info4:class misc cpu_info:4:cpu_info4:clock_MHz 1649 cpu_info:4:cpu_info4:core_id 1026 cpu_info:4:cpu_info4:cpu_fru hc:///component= cpu_info:4:cpu_info4:cpu_type sparcv9 cpu_info:4:cpu_info4:crtime 185.897635787 cpu_info:4:cpu_info4:current_clock_Hz 1648762500 cpu_info:4:cpu_info4:device_ID 4 cpu_info:4:cpu_info4:fpu_type sparcv9 cpu_info:4:cpu_info4:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:4:cpu_info4:pg_id 4 cpu_info:4:cpu_info4:snaptime 9305222.46392368 cpu_info:4:cpu_info4:state on-line cpu_info:4:cpu_info4:state_begin 1430258903 cpu_info:4:cpu_info4:supported_frequencies_Hz 1648762500 cpu_info:5:cpu_info5:brand SPARC-T3 cpu_info:5:cpu_info5:chip_id 0 cpu_info:5:cpu_info5:class misc cpu_info:5:cpu_info5:clock_MHz 1649 cpu_info:5:cpu_info5:core_id 1026 cpu_info:5:cpu_info5:cpu_fru hc:///component= cpu_info:5:cpu_info5:cpu_type sparcv9 cpu_info:5:cpu_info5:crtime 185.899706751 cpu_info:5:cpu_info5:current_clock_Hz 1648762500 cpu_info:5:cpu_info5:device_ID 5 cpu_info:5:cpu_info5:fpu_type sparcv9 cpu_info:5:cpu_info5:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:5:cpu_info5:pg_id 4 cpu_info:5:cpu_info5:snaptime 9305222.4651017 cpu_info:5:cpu_info5:state on-line cpu_info:5:cpu_info5:state_begin 1430258903 cpu_info:5:cpu_info5:supported_frequencies_Hz 1648762500 cpu_info:6:cpu_info6:brand SPARC-T3 cpu_info:6:cpu_info6:chip_id 0 cpu_info:6:cpu_info6:class misc cpu_info:6:cpu_info6:clock_MHz 1649 cpu_info:6:cpu_info6:core_id 1026 cpu_info:6:cpu_info6:cpu_fru hc:///component= cpu_info:6:cpu_info6:cpu_type sparcv9 cpu_info:6:cpu_info6:crtime 185.901703653 cpu_info:6:cpu_info6:current_clock_Hz 1648762500 cpu_info:6:cpu_info6:device_ID 6 cpu_info:6:cpu_info6:fpu_type sparcv9 cpu_info:6:cpu_info6:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:6:cpu_info6:pg_id 4 cpu_info:6:cpu_info6:snaptime 9305222.46627134 cpu_info:6:cpu_info6:state on-line cpu_info:6:cpu_info6:state_begin 1430258903 cpu_info:6:cpu_info6:supported_frequencies_Hz 1648762500 cpu_info:7:cpu_info7:brand SPARC-T3 cpu_info:7:cpu_info7:chip_id 0 cpu_info:7:cpu_info7:class misc cpu_info:7:cpu_info7:clock_MHz 1649 cpu_info:7:cpu_info7:core_id 1026 cpu_info:7:cpu_info7:cpu_fru hc:///component= cpu_info:7:cpu_info7:cpu_type sparcv9 cpu_info:7:cpu_info7:crtime 185.903769027 cpu_info:7:cpu_info7:current_clock_Hz 1648762500 cpu_info:7:cpu_info7:device_ID 7 cpu_info:7:cpu_info7:fpu_type sparcv9 cpu_info:7:cpu_info7:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:7:cpu_info7:pg_id 4 cpu_info:7:cpu_info7:snaptime 9305222.46743538 cpu_info:7:cpu_info7:state on-line cpu_info:7:cpu_info7:state_begin 1430258903 cpu_info:7:cpu_info7:supported_frequencies_Hz 1648762500 cpu_info:8:cpu_info8:brand SPARC-T3 cpu_info:8:cpu_info8:chip_id 0 cpu_info:8:cpu_info8:class misc cpu_info:8:cpu_info8:clock_MHz 1649 cpu_info:8:cpu_info8:core_id 1033 cpu_info:8:cpu_info8:cpu_fru hc:///component= cpu_info:8:cpu_info8:cpu_type sparcv9 cpu_info:8:cpu_info8:crtime 185.905770121 cpu_info:8:cpu_info8:current_clock_Hz 1648762500 cpu_info:8:cpu_info8:device_ID 8 cpu_info:8:cpu_info8:fpu_type sparcv9 cpu_info:8:cpu_info8:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:8:cpu_info8:pg_id 5 cpu_info:8:cpu_info8:snaptime 9305222.46859244 cpu_info:8:cpu_info8:state on-line cpu_info:8:cpu_info8:state_begin 1430258903 cpu_info:8:cpu_info8:supported_frequencies_Hz 1648762500 cpu_info:9:cpu_info9:brand SPARC-T3 cpu_info:9:cpu_info9:chip_id 0 cpu_info:9:cpu_info9:class misc cpu_info:9:cpu_info9:clock_MHz 1649 cpu_info:9:cpu_info9:core_id 1033 cpu_info:9:cpu_info9:cpu_fru hc:///component= cpu_info:9:cpu_info9:cpu_type sparcv9 cpu_info:9:cpu_info9:crtime 185.907807547 cpu_info:9:cpu_info9:current_clock_Hz 1648762500 cpu_info:9:cpu_info9:device_ID 9 cpu_info:9:cpu_info9:fpu_type sparcv9 cpu_info:9:cpu_info9:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:9:cpu_info9:pg_id 5 cpu_info:9:cpu_info9:snaptime 9305222.46975928 cpu_info:9:cpu_info9:state on-line cpu_info:9:cpu_info9:state_begin 1430258903 cpu_info:9:cpu_info9:supported_frequencies_Hz 1648762500 cpu_info:10:cpu_info10:brand SPARC-T3 cpu_info:10:cpu_info10:chip_id 0 cpu_info:10:cpu_info10:class misc cpu_info:10:cpu_info10:clock_MHz 1649 cpu_info:10:cpu_info10:core_id 1033 cpu_info:10:cpu_info10:cpu_fru hc:///component= cpu_info:10:cpu_info10:cpu_type sparcv9 cpu_info:10:cpu_info10:crtime 185.909912049 cpu_info:10:cpu_info10:current_clock_Hz 1648762500 cpu_info:10:cpu_info10:device_ID 10 cpu_info:10:cpu_info10:fpu_type sparcv9 cpu_info:10:cpu_info10:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:10:cpu_info10:pg_id 5 cpu_info:10:cpu_info10:snaptime 9305222.47092053 cpu_info:10:cpu_info10:state on-line cpu_info:10:cpu_info10:state_begin 1430258903 cpu_info:10:cpu_info10:supported_frequencies_Hz 1648762500 cpu_info:11:cpu_info11:brand SPARC-T3 cpu_info:11:cpu_info11:chip_id 0 cpu_info:11:cpu_info11:class misc cpu_info:11:cpu_info11:clock_MHz 1649 cpu_info:11:cpu_info11:core_id 1033 cpu_info:11:cpu_info11:cpu_fru hc:///component= cpu_info:11:cpu_info11:cpu_type sparcv9 cpu_info:11:cpu_info11:crtime 185.912115767 cpu_info:11:cpu_info11:current_clock_Hz 1648762500 cpu_info:11:cpu_info11:device_ID 11 cpu_info:11:cpu_info11:fpu_type sparcv9 cpu_info:11:cpu_info11:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:11:cpu_info11:pg_id 5 cpu_info:11:cpu_info11:snaptime 9305222.47210972 cpu_info:11:cpu_info11:state on-line cpu_info:11:cpu_info11:state_begin 1430258903 cpu_info:11:cpu_info11:supported_frequencies_Hz 1648762500 cpu_info:12:cpu_info12:brand SPARC-T3 cpu_info:12:cpu_info12:chip_id 0 cpu_info:12:cpu_info12:class misc cpu_info:12:cpu_info12:clock_MHz 1649 cpu_info:12:cpu_info12:core_id 1033 cpu_info:12:cpu_info12:cpu_fru hc:///component= cpu_info:12:cpu_info12:cpu_type sparcv9 cpu_info:12:cpu_info12:crtime 185.914137822 cpu_info:12:cpu_info12:current_clock_Hz 1648762500 cpu_info:12:cpu_info12:device_ID 12 cpu_info:12:cpu_info12:fpu_type sparcv9 cpu_info:12:cpu_info12:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:12:cpu_info12:pg_id 7 cpu_info:12:cpu_info12:snaptime 9305222.47335901 cpu_info:12:cpu_info12:state on-line cpu_info:12:cpu_info12:state_begin 1430258903 cpu_info:12:cpu_info12:supported_frequencies_Hz 1648762500 cpu_info:13:cpu_info13:brand SPARC-T3 cpu_info:13:cpu_info13:chip_id 0 cpu_info:13:cpu_info13:class misc cpu_info:13:cpu_info13:clock_MHz 1649 cpu_info:13:cpu_info13:core_id 1033 cpu_info:13:cpu_info13:cpu_fru hc:///component= cpu_info:13:cpu_info13:cpu_type sparcv9 cpu_info:13:cpu_info13:crtime 185.916718841 cpu_info:13:cpu_info13:current_clock_Hz 1648762500 cpu_info:13:cpu_info13:device_ID 13 cpu_info:13:cpu_info13:fpu_type sparcv9 cpu_info:13:cpu_info13:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:13:cpu_info13:pg_id 7 cpu_info:13:cpu_info13:snaptime 9305222.47452166 cpu_info:13:cpu_info13:state on-line cpu_info:13:cpu_info13:state_begin 1430258903 cpu_info:13:cpu_info13:supported_frequencies_Hz 1648762500 cpu_info:14:cpu_info14:brand SPARC-T3 cpu_info:14:cpu_info14:chip_id 0 cpu_info:14:cpu_info14:class misc cpu_info:14:cpu_info14:clock_MHz 1649 cpu_info:14:cpu_info14:core_id 1033 cpu_info:14:cpu_info14:cpu_fru hc:///component= cpu_info:14:cpu_info14:cpu_type sparcv9 cpu_info:14:cpu_info14:crtime 185.918743691 cpu_info:14:cpu_info14:current_clock_Hz 1648762500 cpu_info:14:cpu_info14:device_ID 14 cpu_info:14:cpu_info14:fpu_type sparcv9 cpu_info:14:cpu_info14:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:14:cpu_info14:pg_id 7 cpu_info:14:cpu_info14:snaptime 9305222.4756871 cpu_info:14:cpu_info14:state on-line cpu_info:14:cpu_info14:state_begin 1430258903 cpu_info:14:cpu_info14:supported_frequencies_Hz 1648762500 cpu_info:15:cpu_info15:brand SPARC-T3 cpu_info:15:cpu_info15:chip_id 0 cpu_info:15:cpu_info15:class misc cpu_info:15:cpu_info15:clock_MHz 1649 cpu_info:15:cpu_info15:core_id 1033 cpu_info:15:cpu_info15:cpu_fru hc:///component= cpu_info:15:cpu_info15:cpu_type sparcv9 cpu_info:15:cpu_info15:crtime 185.920867756 cpu_info:15:cpu_info15:current_clock_Hz 1648762500 cpu_info:15:cpu_info15:device_ID 15 cpu_info:15:cpu_info15:fpu_type sparcv9 cpu_info:15:cpu_info15:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:15:cpu_info15:pg_id 7 cpu_info:15:cpu_info15:snaptime 9305222.47686092 cpu_info:15:cpu_info15:state on-line cpu_info:15:cpu_info15:state_begin 1430258903 cpu_info:15:cpu_info15:supported_frequencies_Hz 1648762500 cpu_info:16:cpu_info16:brand SPARC-T3 cpu_info:16:cpu_info16:chip_id 0 cpu_info:16:cpu_info16:class misc cpu_info:16:cpu_info16:clock_MHz 1649 cpu_info:16:cpu_info16:core_id 1040 cpu_info:16:cpu_info16:cpu_fru hc:///component= cpu_info:16:cpu_info16:cpu_type sparcv9 cpu_info:16:cpu_info16:crtime 185.923040731 cpu_info:16:cpu_info16:current_clock_Hz 1648762500 cpu_info:16:cpu_info16:device_ID 16 cpu_info:16:cpu_info16:fpu_type sparcv9 cpu_info:16:cpu_info16:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:16:cpu_info16:pg_id 8 cpu_info:16:cpu_info16:snaptime 9305222.47804034 cpu_info:16:cpu_info16:state on-line cpu_info:16:cpu_info16:state_begin 1430258903 cpu_info:16:cpu_info16:supported_frequencies_Hz 1648762500 cpu_info:17:cpu_info17:brand SPARC-T3 cpu_info:17:cpu_info17:chip_id 0 cpu_info:17:cpu_info17:class misc cpu_info:17:cpu_info17:clock_MHz 1649 cpu_info:17:cpu_info17:core_id 1040 cpu_info:17:cpu_info17:cpu_fru hc:///component= cpu_info:17:cpu_info17:cpu_type sparcv9 cpu_info:17:cpu_info17:crtime 185.925129862 cpu_info:17:cpu_info17:current_clock_Hz 1648762500 cpu_info:17:cpu_info17:device_ID 17 cpu_info:17:cpu_info17:fpu_type sparcv9 cpu_info:17:cpu_info17:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:17:cpu_info17:pg_id 8 cpu_info:17:cpu_info17:snaptime 9305222.4791974 cpu_info:17:cpu_info17:state on-line cpu_info:17:cpu_info17:state_begin 1430258903 cpu_info:17:cpu_info17:supported_frequencies_Hz 1648762500 cpu_info:18:cpu_info18:brand SPARC-T3 cpu_info:18:cpu_info18:chip_id 0 cpu_info:18:cpu_info18:class misc cpu_info:18:cpu_info18:clock_MHz 1649 cpu_info:18:cpu_info18:core_id 1040 cpu_info:18:cpu_info18:cpu_fru hc:///component= cpu_info:18:cpu_info18:cpu_type sparcv9 cpu_info:18:cpu_info18:crtime 185.927358733 cpu_info:18:cpu_info18:current_clock_Hz 1648762500 cpu_info:18:cpu_info18:device_ID 18 cpu_info:18:cpu_info18:fpu_type sparcv9 cpu_info:18:cpu_info18:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:18:cpu_info18:pg_id 8 cpu_info:18:cpu_info18:snaptime 9305222.48035585 cpu_info:18:cpu_info18:state on-line cpu_info:18:cpu_info18:state_begin 1430258903 cpu_info:18:cpu_info18:supported_frequencies_Hz 1648762500 cpu_info:19:cpu_info19:brand SPARC-T3 cpu_info:19:cpu_info19:chip_id 0 cpu_info:19:cpu_info19:class misc cpu_info:19:cpu_info19:clock_MHz 1649 cpu_info:19:cpu_info19:core_id 1040 cpu_info:19:cpu_info19:cpu_fru hc:///component= cpu_info:19:cpu_info19:cpu_type sparcv9 cpu_info:19:cpu_info19:crtime 185.929506555 cpu_info:19:cpu_info19:current_clock_Hz 1648762500 cpu_info:19:cpu_info19:device_ID 19 cpu_info:19:cpu_info19:fpu_type sparcv9 cpu_info:19:cpu_info19:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:19:cpu_info19:pg_id 8 cpu_info:19:cpu_info19:snaptime 9305222.4815143 cpu_info:19:cpu_info19:state on-line cpu_info:19:cpu_info19:state_begin 1430258903 cpu_info:19:cpu_info19:supported_frequencies_Hz 1648762500 cpu_info:20:cpu_info20:brand SPARC-T3 cpu_info:20:cpu_info20:chip_id 0 cpu_info:20:cpu_info20:class misc cpu_info:20:cpu_info20:clock_MHz 1649 cpu_info:20:cpu_info20:core_id 1040 cpu_info:20:cpu_info20:cpu_fru hc:///component= cpu_info:20:cpu_info20:cpu_type sparcv9 cpu_info:20:cpu_info20:crtime 185.931632019 cpu_info:20:cpu_info20:current_clock_Hz 1648762500 cpu_info:20:cpu_info20:device_ID 20 cpu_info:20:cpu_info20:fpu_type sparcv9 cpu_info:20:cpu_info20:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:20:cpu_info20:pg_id 10 cpu_info:20:cpu_info20:snaptime 9305222.48268953 cpu_info:20:cpu_info20:state on-line cpu_info:20:cpu_info20:state_begin 1430258903 cpu_info:20:cpu_info20:supported_frequencies_Hz 1648762500 cpu_info:21:cpu_info21:brand SPARC-T3 cpu_info:21:cpu_info21:chip_id 0 cpu_info:21:cpu_info21:class misc cpu_info:21:cpu_info21:clock_MHz 1649 cpu_info:21:cpu_info21:core_id 1040 cpu_info:21:cpu_info21:cpu_fru hc:///component= cpu_info:21:cpu_info21:cpu_type sparcv9 cpu_info:21:cpu_info21:crtime 185.933775649 cpu_info:21:cpu_info21:current_clock_Hz 1648762500 cpu_info:21:cpu_info21:device_ID 21 cpu_info:21:cpu_info21:fpu_type sparcv9 cpu_info:21:cpu_info21:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:21:cpu_info21:pg_id 10 cpu_info:21:cpu_info21:snaptime 9305222.48385497 cpu_info:21:cpu_info21:state on-line cpu_info:21:cpu_info21:state_begin 1430258903 cpu_info:21:cpu_info21:supported_frequencies_Hz 1648762500 cpu_info:22:cpu_info22:brand SPARC-T3 cpu_info:22:cpu_info22:chip_id 0 cpu_info:22:cpu_info22:class misc cpu_info:22:cpu_info22:clock_MHz 1649 cpu_info:22:cpu_info22:core_id 1040 cpu_info:22:cpu_info22:cpu_fru hc:///component= cpu_info:22:cpu_info22:cpu_type sparcv9 cpu_info:22:cpu_info22:crtime 185.935894125 cpu_info:22:cpu_info22:current_clock_Hz 1648762500 cpu_info:22:cpu_info22:device_ID 22 cpu_info:22:cpu_info22:fpu_type sparcv9 cpu_info:22:cpu_info22:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:22:cpu_info22:pg_id 10 cpu_info:22:cpu_info22:snaptime 9305222.48501202 cpu_info:22:cpu_info22:state on-line cpu_info:22:cpu_info22:state_begin 1430258903 cpu_info:22:cpu_info22:supported_frequencies_Hz 1648762500 cpu_info:23:cpu_info23:brand SPARC-T3 cpu_info:23:cpu_info23:chip_id 0 cpu_info:23:cpu_info23:class misc cpu_info:23:cpu_info23:clock_MHz 1649 cpu_info:23:cpu_info23:core_id 1040 cpu_info:23:cpu_info23:cpu_fru hc:///component= cpu_info:23:cpu_info23:cpu_type sparcv9 cpu_info:23:cpu_info23:crtime 185.938371736 cpu_info:23:cpu_info23:current_clock_Hz 1648762500 cpu_info:23:cpu_info23:device_ID 23 cpu_info:23:cpu_info23:fpu_type sparcv9 cpu_info:23:cpu_info23:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:23:cpu_info23:pg_id 10 cpu_info:23:cpu_info23:snaptime 9305222.4862152 cpu_info:23:cpu_info23:state on-line cpu_info:23:cpu_info23:state_begin 1430258903 cpu_info:23:cpu_info23:supported_frequencies_Hz 1648762500 cpu_info:24:cpu_info24:brand SPARC-T3 cpu_info:24:cpu_info24:chip_id 0 cpu_info:24:cpu_info24:class misc cpu_info:24:cpu_info24:clock_MHz 1649 cpu_info:24:cpu_info24:core_id 1047 cpu_info:24:cpu_info24:cpu_fru hc:///component= cpu_info:24:cpu_info24:cpu_type sparcv9 cpu_info:24:cpu_info24:crtime 185.94063135 cpu_info:24:cpu_info24:current_clock_Hz 1648762500 cpu_info:24:cpu_info24:device_ID 24 cpu_info:24:cpu_info24:fpu_type sparcv9 cpu_info:24:cpu_info24:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:24:cpu_info24:pg_id 11 cpu_info:24:cpu_info24:snaptime 9305222.48737505 cpu_info:24:cpu_info24:state on-line cpu_info:24:cpu_info24:state_begin 1430258903 cpu_info:24:cpu_info24:supported_frequencies_Hz 1648762500 cpu_info:25:cpu_info25:brand SPARC-T3 cpu_info:25:cpu_info25:chip_id 0 cpu_info:25:cpu_info25:class misc cpu_info:25:cpu_info25:clock_MHz 1649 cpu_info:25:cpu_info25:core_id 1047 cpu_info:25:cpu_info25:cpu_fru hc:///component= cpu_info:25:cpu_info25:cpu_type sparcv9 cpu_info:25:cpu_info25:crtime 185.942830876 cpu_info:25:cpu_info25:current_clock_Hz 1648762500 cpu_info:25:cpu_info25:device_ID 25 cpu_info:25:cpu_info25:fpu_type sparcv9 cpu_info:25:cpu_info25:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:25:cpu_info25:pg_id 11 cpu_info:25:cpu_info25:snaptime 9305222.48852791 cpu_info:25:cpu_info25:state on-line cpu_info:25:cpu_info25:state_begin 1430258903 cpu_info:25:cpu_info25:supported_frequencies_Hz 1648762500 cpu_info:26:cpu_info26:brand SPARC-T3 cpu_info:26:cpu_info26:chip_id 0 cpu_info:26:cpu_info26:class misc cpu_info:26:cpu_info26:clock_MHz 1649 cpu_info:26:cpu_info26:core_id 1047 cpu_info:26:cpu_info26:cpu_fru hc:///component= cpu_info:26:cpu_info26:cpu_type sparcv9 cpu_info:26:cpu_info26:crtime 185.945192502 cpu_info:26:cpu_info26:current_clock_Hz 1648762500 cpu_info:26:cpu_info26:device_ID 26 cpu_info:26:cpu_info26:fpu_type sparcv9 cpu_info:26:cpu_info26:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:26:cpu_info26:pg_id 11 cpu_info:26:cpu_info26:snaptime 9305222.48970872 cpu_info:26:cpu_info26:state on-line cpu_info:26:cpu_info26:state_begin 1430258903 cpu_info:26:cpu_info26:supported_frequencies_Hz 1648762500 cpu_info:27:cpu_info27:brand SPARC-T3 cpu_info:27:cpu_info27:chip_id 0 cpu_info:27:cpu_info27:class misc cpu_info:27:cpu_info27:clock_MHz 1649 cpu_info:27:cpu_info27:core_id 1047 cpu_info:27:cpu_info27:cpu_fru hc:///component= cpu_info:27:cpu_info27:cpu_type sparcv9 cpu_info:27:cpu_info27:crtime 185.947281633 cpu_info:27:cpu_info27:current_clock_Hz 1648762500 cpu_info:27:cpu_info27:device_ID 27 cpu_info:27:cpu_info27:fpu_type sparcv9 cpu_info:27:cpu_info27:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:27:cpu_info27:pg_id 11 cpu_info:27:cpu_info27:snaptime 9305222.49087556 cpu_info:27:cpu_info27:state on-line cpu_info:27:cpu_info27:state_begin 1430258903 cpu_info:27:cpu_info27:supported_frequencies_Hz 1648762500 cpu_info:28:cpu_info28:brand SPARC-T3 cpu_info:28:cpu_info28:chip_id 0 cpu_info:28:cpu_info28:class misc cpu_info:28:cpu_info28:clock_MHz 1649 cpu_info:28:cpu_info28:core_id 1047 cpu_info:28:cpu_info28:cpu_fru hc:///component= cpu_info:28:cpu_info28:cpu_type sparcv9 cpu_info:28:cpu_info28:crtime 185.949373558 cpu_info:28:cpu_info28:current_clock_Hz 1648762500 cpu_info:28:cpu_info28:device_ID 28 cpu_info:28:cpu_info28:fpu_type sparcv9 cpu_info:28:cpu_info28:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:28:cpu_info28:pg_id 13 cpu_info:28:cpu_info28:snaptime 9305222.49203402 cpu_info:28:cpu_info28:state on-line cpu_info:28:cpu_info28:state_begin 1430258903 cpu_info:28:cpu_info28:supported_frequencies_Hz 1648762500 cpu_info:29:cpu_info29:brand SPARC-T3 cpu_info:29:cpu_info29:chip_id 0 cpu_info:29:cpu_info29:class misc cpu_info:29:cpu_info29:clock_MHz 1649 cpu_info:29:cpu_info29:core_id 1047 cpu_info:29:cpu_info29:cpu_fru hc:///component= cpu_info:29:cpu_info29:cpu_type sparcv9 cpu_info:29:cpu_info29:crtime 185.951693261 cpu_info:29:cpu_info29:current_clock_Hz 1648762500 cpu_info:29:cpu_info29:device_ID 29 cpu_info:29:cpu_info29:fpu_type sparcv9 cpu_info:29:cpu_info29:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:29:cpu_info29:pg_id 13 cpu_info:29:cpu_info29:snaptime 9305222.49319247 cpu_info:29:cpu_info29:state on-line cpu_info:29:cpu_info29:state_begin 1430258903 cpu_info:29:cpu_info29:supported_frequencies_Hz 1648762500 cpu_info:30:cpu_info30:brand SPARC-T3 cpu_info:30:cpu_info30:chip_id 0 cpu_info:30:cpu_info30:class misc cpu_info:30:cpu_info30:clock_MHz 1649 cpu_info:30:cpu_info30:core_id 1047 cpu_info:30:cpu_info30:cpu_fru hc:///component= cpu_info:30:cpu_info30:cpu_type sparcv9 cpu_info:30:cpu_info30:crtime 185.956749097 cpu_info:30:cpu_info30:current_clock_Hz 1648762500 cpu_info:30:cpu_info30:device_ID 30 cpu_info:30:cpu_info30:fpu_type sparcv9 cpu_info:30:cpu_info30:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:30:cpu_info30:pg_id 13 cpu_info:30:cpu_info30:snaptime 9305222.49447669 cpu_info:30:cpu_info30:state on-line cpu_info:30:cpu_info30:state_begin 1430258903 cpu_info:30:cpu_info30:supported_frequencies_Hz 1648762500 cpu_info:31:cpu_info31:brand SPARC-T3 cpu_info:31:cpu_info31:chip_id 0 cpu_info:31:cpu_info31:class misc cpu_info:31:cpu_info31:clock_MHz 1649 cpu_info:31:cpu_info31:core_id 1047 cpu_info:31:cpu_info31:cpu_fru hc:///component= cpu_info:31:cpu_info31:cpu_type sparcv9 cpu_info:31:cpu_info31:crtime 185.958863381 cpu_info:31:cpu_info31:current_clock_Hz 1648762500 cpu_info:31:cpu_info31:device_ID 31 cpu_info:31:cpu_info31:fpu_type sparcv9 cpu_info:31:cpu_info31:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:31:cpu_info31:pg_id 13 cpu_info:31:cpu_info31:snaptime 9305222.49563934 cpu_info:31:cpu_info31:state on-line cpu_info:31:cpu_info31:state_begin 1430258903 cpu_info:31:cpu_info31:supported_frequencies_Hz 1648762500 cpu_info:32:cpu_info32:brand SPARC-T3 cpu_info:32:cpu_info32:chip_id 0 cpu_info:32:cpu_info32:class misc cpu_info:32:cpu_info32:clock_MHz 1649 cpu_info:32:cpu_info32:core_id 1054 cpu_info:32:cpu_info32:cpu_fru hc:///component= cpu_info:32:cpu_info32:cpu_type sparcv9 cpu_info:32:cpu_info32:crtime 185.961092252 cpu_info:32:cpu_info32:current_clock_Hz 1648762500 cpu_info:32:cpu_info32:device_ID 32 cpu_info:32:cpu_info32:fpu_type sparcv9 cpu_info:32:cpu_info32:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:32:cpu_info32:pg_id 14 cpu_info:32:cpu_info32:snaptime 9305222.4967978 cpu_info:32:cpu_info32:state on-line cpu_info:32:cpu_info32:state_begin 1430258903 cpu_info:32:cpu_info32:supported_frequencies_Hz 1648762500 cpu_info:33:cpu_info33:brand SPARC-T3 cpu_info:33:cpu_info33:chip_id 0 cpu_info:33:cpu_info33:class misc cpu_info:33:cpu_info33:clock_MHz 1649 cpu_info:33:cpu_info33:core_id 1054 cpu_info:33:cpu_info33:cpu_fru hc:///component= cpu_info:33:cpu_info33:cpu_type sparcv9 cpu_info:33:cpu_info33:crtime 185.96330156 cpu_info:33:cpu_info33:current_clock_Hz 1648762500 cpu_info:33:cpu_info33:device_ID 33 cpu_info:33:cpu_info33:fpu_type sparcv9 cpu_info:33:cpu_info33:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:33:cpu_info33:pg_id 14 cpu_info:33:cpu_info33:snaptime 9305222.49796044 cpu_info:33:cpu_info33:state on-line cpu_info:33:cpu_info33:state_begin 1430258903 cpu_info:33:cpu_info33:supported_frequencies_Hz 1648762500 cpu_info:34:cpu_info34:brand SPARC-T3 cpu_info:34:cpu_info34:chip_id 0 cpu_info:34:cpu_info34:class misc cpu_info:34:cpu_info34:clock_MHz 1649 cpu_info:34:cpu_info34:core_id 1054 cpu_info:34:cpu_info34:cpu_fru hc:///component= cpu_info:34:cpu_info34:cpu_type sparcv9 cpu_info:34:cpu_info34:crtime 185.965719082 cpu_info:34:cpu_info34:current_clock_Hz 1648762500 cpu_info:34:cpu_info34:device_ID 34 cpu_info:34:cpu_info34:fpu_type sparcv9 cpu_info:34:cpu_info34:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:34:cpu_info34:pg_id 14 cpu_info:34:cpu_info34:snaptime 9305222.49915942 cpu_info:34:cpu_info34:state on-line cpu_info:34:cpu_info34:state_begin 1430258903 cpu_info:34:cpu_info34:supported_frequencies_Hz 1648762500 cpu_info:35:cpu_info35:brand SPARC-T3 cpu_info:35:cpu_info35:chip_id 0 cpu_info:35:cpu_info35:class misc cpu_info:35:cpu_info35:clock_MHz 1649 cpu_info:35:cpu_info35:core_id 1054 cpu_info:35:cpu_info35:cpu_fru hc:///component= cpu_info:35:cpu_info35:cpu_type sparcv9 cpu_info:35:cpu_info35:crtime 185.967967518 cpu_info:35:cpu_info35:current_clock_Hz 1648762500 cpu_info:35:cpu_info35:device_ID 35 cpu_info:35:cpu_info35:fpu_type sparcv9 cpu_info:35:cpu_info35:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:35:cpu_info35:pg_id 14 cpu_info:35:cpu_info35:snaptime 9305222.50033744 cpu_info:35:cpu_info35:state on-line cpu_info:35:cpu_info35:state_begin 1430258903 cpu_info:35:cpu_info35:supported_frequencies_Hz 1648762500 cpu_info:36:cpu_info36:brand SPARC-T3 cpu_info:36:cpu_info36:chip_id 0 cpu_info:36:cpu_info36:class misc cpu_info:36:cpu_info36:clock_MHz 1649 cpu_info:36:cpu_info36:core_id 1054 cpu_info:36:cpu_info36:cpu_fru hc:///component= cpu_info:36:cpu_info36:cpu_type sparcv9 cpu_info:36:cpu_info36:crtime 185.970185211 cpu_info:36:cpu_info36:current_clock_Hz 1648762500 cpu_info:36:cpu_info36:device_ID 36 cpu_info:36:cpu_info36:fpu_type sparcv9 cpu_info:36:cpu_info36:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:36:cpu_info36:pg_id 16 cpu_info:36:cpu_info36:snaptime 9305222.5014931 cpu_info:36:cpu_info36:state on-line cpu_info:36:cpu_info36:state_begin 1430258903 cpu_info:36:cpu_info36:supported_frequencies_Hz 1648762500 cpu_info:37:cpu_info37:brand SPARC-T3 cpu_info:37:cpu_info37:chip_id 0 cpu_info:37:cpu_info37:class misc cpu_info:37:cpu_info37:clock_MHz 1649 cpu_info:37:cpu_info37:core_id 1054 cpu_info:37:cpu_info37:cpu_fru hc:///component= cpu_info:37:cpu_info37:cpu_type sparcv9 cpu_info:37:cpu_info37:crtime 185.972471376 cpu_info:37:cpu_info37:current_clock_Hz 1648762500 cpu_info:37:cpu_info37:device_ID 37 cpu_info:37:cpu_info37:fpu_type sparcv9 cpu_info:37:cpu_info37:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:37:cpu_info37:pg_id 16 cpu_info:37:cpu_info37:snaptime 9305222.50265574 cpu_info:37:cpu_info37:state on-line cpu_info:37:cpu_info37:state_begin 1430258903 cpu_info:37:cpu_info37:supported_frequencies_Hz 1648762500 cpu_info:38:cpu_info38:brand SPARC-T3 cpu_info:38:cpu_info38:chip_id 0 cpu_info:38:cpu_info38:class misc cpu_info:38:cpu_info38:clock_MHz 1649 cpu_info:38:cpu_info38:core_id 1054 cpu_info:38:cpu_info38:cpu_fru hc:///component= cpu_info:38:cpu_info38:cpu_type sparcv9 cpu_info:38:cpu_info38:crtime 185.974700248 cpu_info:38:cpu_info38:current_clock_Hz 1648762500 cpu_info:38:cpu_info38:device_ID 38 cpu_info:38:cpu_info38:fpu_type sparcv9 cpu_info:38:cpu_info38:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:38:cpu_info38:pg_id 16 cpu_info:38:cpu_info38:snaptime 9305222.50383516 cpu_info:38:cpu_info38:state on-line cpu_info:38:cpu_info38:state_begin 1430258903 cpu_info:38:cpu_info38:supported_frequencies_Hz 1648762500 cpu_info:39:cpu_info39:brand SPARC-T3 cpu_info:39:cpu_info39:chip_id 0 cpu_info:39:cpu_info39:class misc cpu_info:39:cpu_info39:clock_MHz 1649 cpu_info:39:cpu_info39:core_id 1054 cpu_info:39:cpu_info39:cpu_fru hc:///component= cpu_info:39:cpu_info39:cpu_type sparcv9 cpu_info:39:cpu_info39:crtime 185.976951478 cpu_info:39:cpu_info39:current_clock_Hz 1648762500 cpu_info:39:cpu_info39:device_ID 39 cpu_info:39:cpu_info39:fpu_type sparcv9 cpu_info:39:cpu_info39:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:39:cpu_info39:pg_id 16 cpu_info:39:cpu_info39:snaptime 9305222.50499082 cpu_info:39:cpu_info39:state on-line cpu_info:39:cpu_info39:state_begin 1430258903 cpu_info:39:cpu_info39:supported_frequencies_Hz 1648762500 cpu_info:40:cpu_info40:brand SPARC-T3 cpu_info:40:cpu_info40:chip_id 0 cpu_info:40:cpu_info40:class misc cpu_info:40:cpu_info40:clock_MHz 1649 cpu_info:40:cpu_info40:core_id 1061 cpu_info:40:cpu_info40:cpu_fru hc:///component= cpu_info:40:cpu_info40:cpu_type sparcv9 cpu_info:40:cpu_info40:crtime 185.979307514 cpu_info:40:cpu_info40:current_clock_Hz 1648762500 cpu_info:40:cpu_info40:device_ID 40 cpu_info:40:cpu_info40:fpu_type sparcv9 cpu_info:40:cpu_info40:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:40:cpu_info40:pg_id 17 cpu_info:40:cpu_info40:snaptime 9305222.50614788 cpu_info:40:cpu_info40:state on-line cpu_info:40:cpu_info40:state_begin 1430258903 cpu_info:40:cpu_info40:supported_frequencies_Hz 1648762500 cpu_info:41:cpu_info41:brand SPARC-T3 cpu_info:41:cpu_info41:chip_id 0 cpu_info:41:cpu_info41:class misc cpu_info:41:cpu_info41:clock_MHz 1649 cpu_info:41:cpu_info41:core_id 1061 cpu_info:41:cpu_info41:cpu_fru hc:///component= cpu_info:41:cpu_info41:cpu_type sparcv9 cpu_info:41:cpu_info41:crtime 185.981589487 cpu_info:41:cpu_info41:current_clock_Hz 1648762500 cpu_info:41:cpu_info41:device_ID 41 cpu_info:41:cpu_info41:fpu_type sparcv9 cpu_info:41:cpu_info41:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:41:cpu_info41:pg_id 17 cpu_info:41:cpu_info41:snaptime 9305222.50731052 cpu_info:41:cpu_info41:state on-line cpu_info:41:cpu_info41:state_begin 1430258903 cpu_info:41:cpu_info41:supported_frequencies_Hz 1648762500 cpu_info:42:cpu_info42:brand SPARC-T3 cpu_info:42:cpu_info42:chip_id 0 cpu_info:42:cpu_info42:class misc cpu_info:42:cpu_info42:clock_MHz 1649 cpu_info:42:cpu_info42:core_id 1061 cpu_info:42:cpu_info42:cpu_fru hc:///component= cpu_info:42:cpu_info42:cpu_type sparcv9 cpu_info:42:cpu_info42:crtime 185.983932946 cpu_info:42:cpu_info42:current_clock_Hz 1648762500 cpu_info:42:cpu_info42:device_ID 42 cpu_info:42:cpu_info42:fpu_type sparcv9 cpu_info:42:cpu_info42:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:42:cpu_info42:pg_id 17 cpu_info:42:cpu_info42:snaptime 9305222.50847177 cpu_info:42:cpu_info42:state on-line cpu_info:42:cpu_info42:state_begin 1430258903 cpu_info:42:cpu_info42:supported_frequencies_Hz 1648762500 cpu_info:43:cpu_info43:brand SPARC-T3 cpu_info:43:cpu_info43:chip_id 0 cpu_info:43:cpu_info43:class misc cpu_info:43:cpu_info43:clock_MHz 1649 cpu_info:43:cpu_info43:core_id 1061 cpu_info:43:cpu_info43:cpu_fru hc:///component= cpu_info:43:cpu_info43:cpu_type sparcv9 cpu_info:43:cpu_info43:crtime 185.986174395 cpu_info:43:cpu_info43:current_clock_Hz 1648762500 cpu_info:43:cpu_info43:device_ID 43 cpu_info:43:cpu_info43:fpu_type sparcv9 cpu_info:43:cpu_info43:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:43:cpu_info43:pg_id 17 cpu_info:43:cpu_info43:snaptime 9305222.50965119 cpu_info:43:cpu_info43:state on-line cpu_info:43:cpu_info43:state_begin 1430258903 cpu_info:43:cpu_info43:supported_frequencies_Hz 1648762500 cpu_info:44:cpu_info44:brand SPARC-T3 cpu_info:44:cpu_info44:chip_id 0 cpu_info:44:cpu_info44:class misc cpu_info:44:cpu_info44:clock_MHz 1649 cpu_info:44:cpu_info44:core_id 1061 cpu_info:44:cpu_info44:cpu_fru hc:///component= cpu_info:44:cpu_info44:cpu_type sparcv9 cpu_info:44:cpu_info44:crtime 185.988461958 cpu_info:44:cpu_info44:current_clock_Hz 1648762500 cpu_info:44:cpu_info44:device_ID 44 cpu_info:44:cpu_info44:fpu_type sparcv9 cpu_info:44:cpu_info44:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:44:cpu_info44:pg_id 19 cpu_info:44:cpu_info44:snaptime 9305222.51080685 cpu_info:44:cpu_info44:state on-line cpu_info:44:cpu_info44:state_begin 1430258903 cpu_info:44:cpu_info44:supported_frequencies_Hz 1648762500 cpu_info:45:cpu_info45:brand SPARC-T3 cpu_info:45:cpu_info45:chip_id 0 cpu_info:45:cpu_info45:class misc cpu_info:45:cpu_info45:clock_MHz 1649 cpu_info:45:cpu_info45:core_id 1061 cpu_info:45:cpu_info45:cpu_fru hc:///component= cpu_info:45:cpu_info45:cpu_type sparcv9 cpu_info:45:cpu_info45:crtime 185.990886467 cpu_info:45:cpu_info45:current_clock_Hz 1648762500 cpu_info:45:cpu_info45:device_ID 45 cpu_info:45:cpu_info45:fpu_type sparcv9 cpu_info:45:cpu_info45:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:45:cpu_info45:pg_id 19 cpu_info:45:cpu_info45:snaptime 9305222.5119667 cpu_info:45:cpu_info45:state on-line cpu_info:45:cpu_info45:state_begin 1430258903 cpu_info:45:cpu_info45:supported_frequencies_Hz 1648762500 cpu_info:46:cpu_info46:brand SPARC-T3 cpu_info:46:cpu_info46:chip_id 0 cpu_info:46:cpu_info46:class misc cpu_info:46:cpu_info46:clock_MHz 1649 cpu_info:46:cpu_info46:core_id 1061 cpu_info:46:cpu_info46:cpu_fru hc:///component= cpu_info:46:cpu_info46:cpu_type sparcv9 cpu_info:46:cpu_info46:crtime 185.993407398 cpu_info:46:cpu_info46:current_clock_Hz 1648762500 cpu_info:46:cpu_info46:device_ID 46 cpu_info:46:cpu_info46:fpu_type sparcv9 cpu_info:46:cpu_info46:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:46:cpu_info46:pg_id 19 cpu_info:46:cpu_info46:snaptime 9305222.51316568 cpu_info:46:cpu_info46:state on-line cpu_info:46:cpu_info46:state_begin 1430258903 cpu_info:46:cpu_info46:supported_frequencies_Hz 1648762500 cpu_info:47:cpu_info47:brand SPARC-T3 cpu_info:47:cpu_info47:chip_id 0 cpu_info:47:cpu_info47:class misc cpu_info:47:cpu_info47:clock_MHz 1649 cpu_info:47:cpu_info47:core_id 1061 cpu_info:47:cpu_info47:cpu_fru hc:///component= cpu_info:47:cpu_info47:cpu_type sparcv9 cpu_info:47:cpu_info47:crtime 185.995799767 cpu_info:47:cpu_info47:current_clock_Hz 1648762500 cpu_info:47:cpu_info47:device_ID 47 cpu_info:47:cpu_info47:fpu_type sparcv9 cpu_info:47:cpu_info47:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:47:cpu_info47:pg_id 19 cpu_info:47:cpu_info47:snaptime 9305222.51431994 cpu_info:47:cpu_info47:state on-line cpu_info:47:cpu_info47:state_begin 1430258903 cpu_info:47:cpu_info47:supported_frequencies_Hz 1648762500 cpu_info:48:cpu_info48:brand SPARC-T3 cpu_info:48:cpu_info48:chip_id 0 cpu_info:48:cpu_info48:class misc cpu_info:48:cpu_info48:clock_MHz 1649 cpu_info:48:cpu_info48:core_id 1068 cpu_info:48:cpu_info48:cpu_fru hc:///component= cpu_info:48:cpu_info48:cpu_type sparcv9 cpu_info:48:cpu_info48:crtime 185.998159995 cpu_info:48:cpu_info48:current_clock_Hz 1648762500 cpu_info:48:cpu_info48:device_ID 48 cpu_info:48:cpu_info48:fpu_type sparcv9 cpu_info:48:cpu_info48:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:48:cpu_info48:pg_id 20 cpu_info:48:cpu_info48:snaptime 9305222.51549656 cpu_info:48:cpu_info48:state on-line cpu_info:48:cpu_info48:state_begin 1430258903 cpu_info:48:cpu_info48:supported_frequencies_Hz 1648762500 cpu_info:49:cpu_info49:brand SPARC-T3 cpu_info:49:cpu_info49:chip_id 0 cpu_info:49:cpu_info49:class misc cpu_info:49:cpu_info49:clock_MHz 1649 cpu_info:49:cpu_info49:core_id 1068 cpu_info:49:cpu_info49:cpu_fru hc:///component= cpu_info:49:cpu_info49:cpu_type sparcv9 cpu_info:49:cpu_info49:crtime 186.000578915 cpu_info:49:cpu_info49:current_clock_Hz 1648762500 cpu_info:49:cpu_info49:device_ID 49 cpu_info:49:cpu_info49:fpu_type sparcv9 cpu_info:49:cpu_info49:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:49:cpu_info49:pg_id 20 cpu_info:49:cpu_info49:snaptime 9305222.51664943 cpu_info:49:cpu_info49:state on-line cpu_info:49:cpu_info49:state_begin 1430258903 cpu_info:49:cpu_info49:supported_frequencies_Hz 1648762500 cpu_info:50:cpu_info50:brand SPARC-T3 cpu_info:50:cpu_info50:chip_id 0 cpu_info:50:cpu_info50:class misc cpu_info:50:cpu_info50:clock_MHz 1649 cpu_info:50:cpu_info50:core_id 1068 cpu_info:50:cpu_info50:cpu_fru hc:///component= cpu_info:50:cpu_info50:cpu_type sparcv9 cpu_info:50:cpu_info50:crtime 186.002997835 cpu_info:50:cpu_info50:current_clock_Hz 1648762500 cpu_info:50:cpu_info50:device_ID 50 cpu_info:50:cpu_info50:fpu_type sparcv9 cpu_info:50:cpu_info50:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:50:cpu_info50:pg_id 20 cpu_info:50:cpu_info50:snaptime 9305222.51780229 cpu_info:50:cpu_info50:state on-line cpu_info:50:cpu_info50:state_begin 1430258903 cpu_info:50:cpu_info50:supported_frequencies_Hz 1648762500 cpu_info:51:cpu_info51:brand SPARC-T3 cpu_info:51:cpu_info51:chip_id 0 cpu_info:51:cpu_info51:class misc cpu_info:51:cpu_info51:clock_MHz 1649 cpu_info:51:cpu_info51:core_id 1068 cpu_info:51:cpu_info51:cpu_fru hc:///component= cpu_info:51:cpu_info51:cpu_type sparcv9 cpu_info:51:cpu_info51:crtime 186.005381819 cpu_info:51:cpu_info51:current_clock_Hz 1648762500 cpu_info:51:cpu_info51:device_ID 51 cpu_info:51:cpu_info51:fpu_type sparcv9 cpu_info:51:cpu_info51:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:51:cpu_info51:pg_id 20 cpu_info:51:cpu_info51:snaptime 9305222.51896214 cpu_info:51:cpu_info51:state on-line cpu_info:51:cpu_info51:state_begin 1430258903 cpu_info:51:cpu_info51:supported_frequencies_Hz 1648762500 cpu_info:52:cpu_info52:brand SPARC-T3 cpu_info:52:cpu_info52:chip_id 0 cpu_info:52:cpu_info52:class misc cpu_info:52:cpu_info52:clock_MHz 1649 cpu_info:52:cpu_info52:core_id 1068 cpu_info:52:cpu_info52:cpu_fru hc:///component= cpu_info:52:cpu_info52:cpu_type sparcv9 cpu_info:52:cpu_info52:crtime 186.007718292 cpu_info:52:cpu_info52:current_clock_Hz 1648762500 cpu_info:52:cpu_info52:device_ID 52 cpu_info:52:cpu_info52:fpu_type sparcv9 cpu_info:52:cpu_info52:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:52:cpu_info52:pg_id 22 cpu_info:52:cpu_info52:snaptime 9305222.5201206 cpu_info:52:cpu_info52:state on-line cpu_info:52:cpu_info52:state_begin 1430258903 cpu_info:52:cpu_info52:supported_frequencies_Hz 1648762500 cpu_info:53:cpu_info53:brand SPARC-T3 cpu_info:53:cpu_info53:chip_id 0 cpu_info:53:cpu_info53:class misc cpu_info:53:cpu_info53:clock_MHz 1649 cpu_info:53:cpu_info53:core_id 1068 cpu_info:53:cpu_info53:cpu_fru hc:///component= cpu_info:53:cpu_info53:cpu_type sparcv9 cpu_info:53:cpu_info53:crtime 186.010135814 cpu_info:53:cpu_info53:current_clock_Hz 1648762500 cpu_info:53:cpu_info53:device_ID 53 cpu_info:53:cpu_info53:fpu_type sparcv9 cpu_info:53:cpu_info53:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:53:cpu_info53:pg_id 22 cpu_info:53:cpu_info53:snaptime 9305222.52128464 cpu_info:53:cpu_info53:state on-line cpu_info:53:cpu_info53:state_begin 1430258903 cpu_info:53:cpu_info53:supported_frequencies_Hz 1648762500 cpu_info:54:cpu_info54:brand SPARC-T3 cpu_info:54:cpu_info54:chip_id 0 cpu_info:54:cpu_info54:class misc cpu_info:54:cpu_info54:clock_MHz 1649 cpu_info:54:cpu_info54:core_id 1068 cpu_info:54:cpu_info54:cpu_fru hc:///component= cpu_info:54:cpu_info54:cpu_type sparcv9 cpu_info:54:cpu_info54:crtime 186.012468094 cpu_info:54:cpu_info54:current_clock_Hz 1648762500 cpu_info:54:cpu_info54:device_ID 54 cpu_info:54:cpu_info54:fpu_type sparcv9 cpu_info:54:cpu_info54:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:54:cpu_info54:pg_id 22 cpu_info:54:cpu_info54:snaptime 9305222.52246266 cpu_info:54:cpu_info54:state on-line cpu_info:54:cpu_info54:state_begin 1430258903 cpu_info:54:cpu_info54:supported_frequencies_Hz 1648762500 cpu_info:55:cpu_info55:brand SPARC-T3 cpu_info:55:cpu_info55:chip_id 0 cpu_info:55:cpu_info55:class misc cpu_info:55:cpu_info55:clock_MHz 1649 cpu_info:55:cpu_info55:core_id 1068 cpu_info:55:cpu_info55:cpu_fru hc:///component= cpu_info:55:cpu_info55:cpu_type sparcv9 cpu_info:55:cpu_info55:crtime 186.015075664 cpu_info:55:cpu_info55:current_clock_Hz 1648762500 cpu_info:55:cpu_info55:device_ID 55 cpu_info:55:cpu_info55:fpu_type sparcv9 cpu_info:55:cpu_info55:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:55:cpu_info55:pg_id 22 cpu_info:55:cpu_info55:snaptime 9305222.52361692 cpu_info:55:cpu_info55:state on-line cpu_info:55:cpu_info55:state_begin 1430258903 cpu_info:55:cpu_info55:supported_frequencies_Hz 1648762500 cpu_info:56:cpu_info56:brand SPARC-T3 cpu_info:56:cpu_info56:chip_id 0 cpu_info:56:cpu_info56:class misc cpu_info:56:cpu_info56:clock_MHz 1649 cpu_info:56:cpu_info56:core_id 1075 cpu_info:56:cpu_info56:cpu_fru hc:///component= cpu_info:56:cpu_info56:cpu_type sparcv9 cpu_info:56:cpu_info56:crtime 186.01747502 cpu_info:56:cpu_info56:current_clock_Hz 1648762500 cpu_info:56:cpu_info56:device_ID 56 cpu_info:56:cpu_info56:fpu_type sparcv9 cpu_info:56:cpu_info56:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:56:cpu_info56:pg_id 23 cpu_info:56:cpu_info56:snaptime 9305222.52477957 cpu_info:56:cpu_info56:state on-line cpu_info:56:cpu_info56:state_begin 1430258903 cpu_info:56:cpu_info56:supported_frequencies_Hz 1648762500 cpu_info:57:cpu_info57:brand SPARC-T3 cpu_info:57:cpu_info57:chip_id 0 cpu_info:57:cpu_info57:class misc cpu_info:57:cpu_info57:clock_MHz 1649 cpu_info:57:cpu_info57:core_id 1075 cpu_info:57:cpu_info57:cpu_fru hc:///component= cpu_info:57:cpu_info57:cpu_type sparcv9 cpu_info:57:cpu_info57:crtime 186.019972195 cpu_info:57:cpu_info57:current_clock_Hz 1648762500 cpu_info:57:cpu_info57:device_ID 57 cpu_info:57:cpu_info57:fpu_type sparcv9 cpu_info:57:cpu_info57:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:57:cpu_info57:pg_id 23 cpu_info:57:cpu_info57:snaptime 9305222.52599671 cpu_info:57:cpu_info57:state on-line cpu_info:57:cpu_info57:state_begin 1430258903 cpu_info:57:cpu_info57:supported_frequencies_Hz 1648762500 cpu_info:58:cpu_info58:brand SPARC-T3 cpu_info:58:cpu_info58:chip_id 0 cpu_info:58:cpu_info58:class misc cpu_info:58:cpu_info58:clock_MHz 1649 cpu_info:58:cpu_info58:core_id 1075 cpu_info:58:cpu_info58:cpu_fru hc:///component= cpu_info:58:cpu_info58:cpu_type sparcv9 cpu_info:58:cpu_info58:crtime 186.022502907 cpu_info:58:cpu_info58:current_clock_Hz 1648762500 cpu_info:58:cpu_info58:device_ID 58 cpu_info:58:cpu_info58:fpu_type sparcv9 cpu_info:58:cpu_info58:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:58:cpu_info58:pg_id 23 cpu_info:58:cpu_info58:snaptime 9305222.52714958 cpu_info:58:cpu_info58:state on-line cpu_info:58:cpu_info58:state_begin 1430258903 cpu_info:58:cpu_info58:supported_frequencies_Hz 1648762500 cpu_info:59:cpu_info59:brand SPARC-T3 cpu_info:59:cpu_info59:chip_id 0 cpu_info:59:cpu_info59:class misc cpu_info:59:cpu_info59:clock_MHz 1649 cpu_info:59:cpu_info59:core_id 1075 cpu_info:59:cpu_info59:cpu_fru hc:///component= cpu_info:59:cpu_info59:cpu_type sparcv9 cpu_info:59:cpu_info59:crtime 186.024843572 cpu_info:59:cpu_info59:current_clock_Hz 1648762500 cpu_info:59:cpu_info59:device_ID 59 cpu_info:59:cpu_info59:fpu_type sparcv9 cpu_info:59:cpu_info59:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:59:cpu_info59:pg_id 23 cpu_info:59:cpu_info59:snaptime 9305222.52831362 cpu_info:59:cpu_info59:state on-line cpu_info:59:cpu_info59:state_begin 1430258903 cpu_info:59:cpu_info59:supported_frequencies_Hz 1648762500 cpu_info:60:cpu_info60:brand SPARC-T3 cpu_info:60:cpu_info60:chip_id 0 cpu_info:60:cpu_info60:class misc cpu_info:60:cpu_info60:clock_MHz 1649 cpu_info:60:cpu_info60:core_id 1075 cpu_info:60:cpu_info60:cpu_fru hc:///component= cpu_info:60:cpu_info60:cpu_type sparcv9 cpu_info:60:cpu_info60:crtime 186.027181442 cpu_info:60:cpu_info60:current_clock_Hz 1648762500 cpu_info:60:cpu_info60:device_ID 60 cpu_info:60:cpu_info60:fpu_type sparcv9 cpu_info:60:cpu_info60:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:60:cpu_info60:pg_id 25 cpu_info:60:cpu_info60:snaptime 9305222.52947487 cpu_info:60:cpu_info60:state on-line cpu_info:60:cpu_info60:state_begin 1430258903 cpu_info:60:cpu_info60:supported_frequencies_Hz 1648762500 cpu_info:61:cpu_info61:brand SPARC-T3 cpu_info:61:cpu_info61:chip_id 0 cpu_info:61:cpu_info61:class misc cpu_info:61:cpu_info61:clock_MHz 1649 cpu_info:61:cpu_info61:core_id 1075 cpu_info:61:cpu_info61:cpu_fru hc:///component= cpu_info:61:cpu_info61:cpu_type sparcv9 cpu_info:61:cpu_info61:crtime 186.029607348 cpu_info:61:cpu_info61:current_clock_Hz 1648762500 cpu_info:61:cpu_info61:device_ID 61 cpu_info:61:cpu_info61:fpu_type sparcv9 cpu_info:61:cpu_info61:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:61:cpu_info61:pg_id 25 cpu_info:61:cpu_info61:snaptime 9305222.53065289 cpu_info:61:cpu_info61:state on-line cpu_info:61:cpu_info61:state_begin 1430258903 cpu_info:61:cpu_info61:supported_frequencies_Hz 1648762500 cpu_info:62:cpu_info62:brand SPARC-T3 cpu_info:62:cpu_info62:chip_id 0 cpu_info:62:cpu_info62:class misc cpu_info:62:cpu_info62:clock_MHz 1649 cpu_info:62:cpu_info62:core_id 1075 cpu_info:62:cpu_info62:cpu_fru hc:///component= cpu_info:62:cpu_info62:cpu_type sparcv9 cpu_info:62:cpu_info62:crtime 186.032326712 cpu_info:62:cpu_info62:current_clock_Hz 1648762500 cpu_info:62:cpu_info62:device_ID 62 cpu_info:62:cpu_info62:fpu_type sparcv9 cpu_info:62:cpu_info62:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:62:cpu_info62:pg_id 25 cpu_info:62:cpu_info62:snaptime 9305222.53182811 cpu_info:62:cpu_info62:state on-line cpu_info:62:cpu_info62:state_begin 1430258903 cpu_info:62:cpu_info62:supported_frequencies_Hz 1648762500 cpu_info:63:cpu_info63:brand SPARC-T3 cpu_info:63:cpu_info63:chip_id 0 cpu_info:63:cpu_info63:class misc cpu_info:63:cpu_info63:clock_MHz 1649 cpu_info:63:cpu_info63:core_id 1075 cpu_info:63:cpu_info63:cpu_fru hc:///component= cpu_info:63:cpu_info63:cpu_type sparcv9 cpu_info:63:cpu_info63:crtime 186.034794541 cpu_info:63:cpu_info63:current_clock_Hz 1648762500 cpu_info:63:cpu_info63:device_ID 63 cpu_info:63:cpu_info63:fpu_type sparcv9 cpu_info:63:cpu_info63:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:63:cpu_info63:pg_id 25 cpu_info:63:cpu_info63:snaptime 9305222.53301871 cpu_info:63:cpu_info63:state on-line cpu_info:63:cpu_info63:state_begin 1430258903 cpu_info:63:cpu_info63:supported_frequencies_Hz 1648762500 cpu_info:64:cpu_info64:brand SPARC-T3 cpu_info:64:cpu_info64:chip_id 0 cpu_info:64:cpu_info64:class misc cpu_info:64:cpu_info64:clock_MHz 1649 cpu_info:64:cpu_info64:core_id 1082 cpu_info:64:cpu_info64:cpu_fru hc:///component= cpu_info:64:cpu_info64:cpu_type sparcv9 cpu_info:64:cpu_info64:crtime 186.037253985 cpu_info:64:cpu_info64:current_clock_Hz 1648762500 cpu_info:64:cpu_info64:device_ID 64 cpu_info:64:cpu_info64:fpu_type sparcv9 cpu_info:64:cpu_info64:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:64:cpu_info64:pg_id 26 cpu_info:64:cpu_info64:snaptime 9305222.53418415 cpu_info:64:cpu_info64:state on-line cpu_info:64:cpu_info64:state_begin 1430258903 cpu_info:64:cpu_info64:supported_frequencies_Hz 1648762500 cpu_info:65:cpu_info65:brand SPARC-T3 cpu_info:65:cpu_info65:chip_id 0 cpu_info:65:cpu_info65:class misc cpu_info:65:cpu_info65:clock_MHz 1649 cpu_info:65:cpu_info65:core_id 1082 cpu_info:65:cpu_info65:cpu_fru hc:///component= cpu_info:65:cpu_info65:cpu_type sparcv9 cpu_info:65:cpu_info65:crtime 186.039909068 cpu_info:65:cpu_info65:current_clock_Hz 1648762500 cpu_info:65:cpu_info65:device_ID 65 cpu_info:65:cpu_info65:fpu_type sparcv9 cpu_info:65:cpu_info65:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:65:cpu_info65:pg_id 26 cpu_info:65:cpu_info65:snaptime 9305222.53533841 cpu_info:65:cpu_info65:state on-line cpu_info:65:cpu_info65:state_begin 1430258903 cpu_info:65:cpu_info65:supported_frequencies_Hz 1648762500 cpu_info:66:cpu_info66:brand SPARC-T3 cpu_info:66:cpu_info66:chip_id 0 cpu_info:66:cpu_info66:class misc cpu_info:66:cpu_info66:clock_MHz 1649 cpu_info:66:cpu_info66:core_id 1082 cpu_info:66:cpu_info66:cpu_fru hc:///component= cpu_info:66:cpu_info66:cpu_type sparcv9 cpu_info:66:cpu_info66:crtime 186.042333577 cpu_info:66:cpu_info66:current_clock_Hz 1648762500 cpu_info:66:cpu_info66:device_ID 66 cpu_info:66:cpu_info66:fpu_type sparcv9 cpu_info:66:cpu_info66:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:66:cpu_info66:pg_id 26 cpu_info:66:cpu_info66:snaptime 9305222.53649127 cpu_info:66:cpu_info66:state on-line cpu_info:66:cpu_info66:state_begin 1430258903 cpu_info:66:cpu_info66:supported_frequencies_Hz 1648762500 cpu_info:67:cpu_info67:brand SPARC-T3 cpu_info:67:cpu_info67:chip_id 0 cpu_info:67:cpu_info67:class misc cpu_info:67:cpu_info67:clock_MHz 1649 cpu_info:67:cpu_info67:core_id 1082 cpu_info:67:cpu_info67:cpu_fru hc:///component= cpu_info:67:cpu_info67:cpu_type sparcv9 cpu_info:67:cpu_info67:crtime 186.044874071 cpu_info:67:cpu_info67:current_clock_Hz 1648762500 cpu_info:67:cpu_info67:device_ID 67 cpu_info:67:cpu_info67:fpu_type sparcv9 cpu_info:67:cpu_info67:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:67:cpu_info67:pg_id 26 cpu_info:67:cpu_info67:snaptime 9305222.53778388 cpu_info:67:cpu_info67:state on-line cpu_info:67:cpu_info67:state_begin 1430258903 cpu_info:67:cpu_info67:supported_frequencies_Hz 1648762500 cpu_info:68:cpu_info68:brand SPARC-T3 cpu_info:68:cpu_info68:chip_id 0 cpu_info:68:cpu_info68:class misc cpu_info:68:cpu_info68:clock_MHz 1649 cpu_info:68:cpu_info68:core_id 1082 cpu_info:68:cpu_info68:cpu_fru hc:///component= cpu_info:68:cpu_info68:cpu_type sparcv9 cpu_info:68:cpu_info68:crtime 186.047410374 cpu_info:68:cpu_info68:current_clock_Hz 1648762500 cpu_info:68:cpu_info68:device_ID 68 cpu_info:68:cpu_info68:fpu_type sparcv9 cpu_info:68:cpu_info68:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:68:cpu_info68:pg_id 28 cpu_info:68:cpu_info68:snaptime 9305222.53897727 cpu_info:68:cpu_info68:state on-line cpu_info:68:cpu_info68:state_begin 1430258903 cpu_info:68:cpu_info68:supported_frequencies_Hz 1648762500 cpu_info:69:cpu_info69:brand SPARC-T3 cpu_info:69:cpu_info69:chip_id 0 cpu_info:69:cpu_info69:class misc cpu_info:69:cpu_info69:clock_MHz 1649 cpu_info:69:cpu_info69:core_id 1082 cpu_info:69:cpu_info69:cpu_fru hc:///component= cpu_info:69:cpu_info69:cpu_type sparcv9 cpu_info:69:cpu_info69:crtime 186.049833485 cpu_info:69:cpu_info69:current_clock_Hz 1648762500 cpu_info:69:cpu_info69:device_ID 69 cpu_info:69:cpu_info69:fpu_type sparcv9 cpu_info:69:cpu_info69:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:69:cpu_info69:pg_id 28 cpu_info:69:cpu_info69:snaptime 9305222.54013852 cpu_info:69:cpu_info69:state on-line cpu_info:69:cpu_info69:state_begin 1430258903 cpu_info:69:cpu_info69:supported_frequencies_Hz 1648762500 cpu_info:70:cpu_info70:brand SPARC-T3 cpu_info:70:cpu_info70:chip_id 0 cpu_info:70:cpu_info70:class misc cpu_info:70:cpu_info70:clock_MHz 1649 cpu_info:70:cpu_info70:core_id 1082 cpu_info:70:cpu_info70:cpu_fru hc:///component= cpu_info:70:cpu_info70:cpu_type sparcv9 cpu_info:70:cpu_info70:crtime 186.052309698 cpu_info:70:cpu_info70:current_clock_Hz 1648762500 cpu_info:70:cpu_info70:device_ID 70 cpu_info:70:cpu_info70:fpu_type sparcv9 cpu_info:70:cpu_info70:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:70:cpu_info70:pg_id 28 cpu_info:70:cpu_info70:snaptime 9305222.54131234 cpu_info:70:cpu_info70:state on-line cpu_info:70:cpu_info70:state_begin 1430258903 cpu_info:70:cpu_info70:supported_frequencies_Hz 1648762500 cpu_info:71:cpu_info71:brand SPARC-T3 cpu_info:71:cpu_info71:chip_id 0 cpu_info:71:cpu_info71:class misc cpu_info:71:cpu_info71:clock_MHz 1649 cpu_info:71:cpu_info71:core_id 1082 cpu_info:71:cpu_info71:cpu_fru hc:///component= cpu_info:71:cpu_info71:cpu_type sparcv9 cpu_info:71:cpu_info71:crtime 186.054795694 cpu_info:71:cpu_info71:current_clock_Hz 1648762500 cpu_info:71:cpu_info71:device_ID 71 cpu_info:71:cpu_info71:fpu_type sparcv9 cpu_info:71:cpu_info71:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:71:cpu_info71:pg_id 28 cpu_info:71:cpu_info71:snaptime 9305222.54247779 cpu_info:71:cpu_info71:state on-line cpu_info:71:cpu_info71:state_begin 1430258903 cpu_info:71:cpu_info71:supported_frequencies_Hz 1648762500 cpu_info:72:cpu_info72:brand SPARC-T3 cpu_info:72:cpu_info72:chip_id 0 cpu_info:72:cpu_info72:class misc cpu_info:72:cpu_info72:clock_MHz 1649 cpu_info:72:cpu_info72:core_id 1089 cpu_info:72:cpu_info72:cpu_fru hc:///component= cpu_info:72:cpu_info72:cpu_type sparcv9 cpu_info:72:cpu_info72:crtime 186.059253437 cpu_info:72:cpu_info72:current_clock_Hz 1648762500 cpu_info:72:cpu_info72:device_ID 72 cpu_info:72:cpu_info72:fpu_type sparcv9 cpu_info:72:cpu_info72:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:72:cpu_info72:pg_id 29 cpu_info:72:cpu_info72:snaptime 9305222.54363624 cpu_info:72:cpu_info72:state on-line cpu_info:72:cpu_info72:state_begin 1430258903 cpu_info:72:cpu_info72:supported_frequencies_Hz 1648762500 cpu_info:73:cpu_info73:brand SPARC-T3 cpu_info:73:cpu_info73:chip_id 0 cpu_info:73:cpu_info73:class misc cpu_info:73:cpu_info73:clock_MHz 1649 cpu_info:73:cpu_info73:core_id 1089 cpu_info:73:cpu_info73:cpu_fru hc:///component= cpu_info:73:cpu_info73:cpu_type sparcv9 cpu_info:73:cpu_info73:crtime 186.062956578 cpu_info:73:cpu_info73:current_clock_Hz 1648762500 cpu_info:73:cpu_info73:device_ID 73 cpu_info:73:cpu_info73:fpu_type sparcv9 cpu_info:73:cpu_info73:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:73:cpu_info73:pg_id 29 cpu_info:73:cpu_info73:snaptime 9305222.54479609 cpu_info:73:cpu_info73:state on-line cpu_info:73:cpu_info73:state_begin 1430258903 cpu_info:73:cpu_info73:supported_frequencies_Hz 1648762500 cpu_info:74:cpu_info74:brand SPARC-T3 cpu_info:74:cpu_info74:chip_id 0 cpu_info:74:cpu_info74:class misc cpu_info:74:cpu_info74:clock_MHz 1649 cpu_info:74:cpu_info74:core_id 1089 cpu_info:74:cpu_info74:cpu_fru hc:///component= cpu_info:74:cpu_info74:cpu_type sparcv9 cpu_info:74:cpu_info74:crtime 186.066589848 cpu_info:74:cpu_info74:current_clock_Hz 1648762500 cpu_info:74:cpu_info74:device_ID 74 cpu_info:74:cpu_info74:fpu_type sparcv9 cpu_info:74:cpu_info74:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:74:cpu_info74:pg_id 29 cpu_info:74:cpu_info74:snaptime 9305222.54595315 cpu_info:74:cpu_info74:state on-line cpu_info:74:cpu_info74:state_begin 1430258903 cpu_info:74:cpu_info74:supported_frequencies_Hz 1648762500 cpu_info:75:cpu_info75:brand SPARC-T3 cpu_info:75:cpu_info75:chip_id 0 cpu_info:75:cpu_info75:class misc cpu_info:75:cpu_info75:clock_MHz 1649 cpu_info:75:cpu_info75:core_id 1089 cpu_info:75:cpu_info75:cpu_fru hc:///component= cpu_info:75:cpu_info75:cpu_type sparcv9 cpu_info:75:cpu_info75:crtime 186.070164428 cpu_info:75:cpu_info75:current_clock_Hz 1648762500 cpu_info:75:cpu_info75:device_ID 75 cpu_info:75:cpu_info75:fpu_type sparcv9 cpu_info:75:cpu_info75:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:75:cpu_info75:pg_id 29 cpu_info:75:cpu_info75:snaptime 9305222.54710601 cpu_info:75:cpu_info75:state on-line cpu_info:75:cpu_info75:state_begin 1430258903 cpu_info:75:cpu_info75:supported_frequencies_Hz 1648762500 cpu_info:76:cpu_info76:brand SPARC-T3 cpu_info:76:cpu_info76:chip_id 0 cpu_info:76:cpu_info76:class misc cpu_info:76:cpu_info76:clock_MHz 1649 cpu_info:76:cpu_info76:core_id 1089 cpu_info:76:cpu_info76:cpu_fru hc:///component= cpu_info:76:cpu_info76:cpu_type sparcv9 cpu_info:76:cpu_info76:crtime 186.074604005 cpu_info:76:cpu_info76:current_clock_Hz 1648762500 cpu_info:76:cpu_info76:device_ID 76 cpu_info:76:cpu_info76:fpu_type sparcv9 cpu_info:76:cpu_info76:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:76:cpu_info76:pg_id 31 cpu_info:76:cpu_info76:snaptime 9305222.54828683 cpu_info:76:cpu_info76:state on-line cpu_info:76:cpu_info76:state_begin 1430258903 cpu_info:76:cpu_info76:supported_frequencies_Hz 1648762500 cpu_info:77:cpu_info77:brand SPARC-T3 cpu_info:77:cpu_info77:chip_id 0 cpu_info:77:cpu_info77:class misc cpu_info:77:cpu_info77:clock_MHz 1649 cpu_info:77:cpu_info77:core_id 1089 cpu_info:77:cpu_info77:cpu_fru hc:///component= cpu_info:77:cpu_info77:cpu_type sparcv9 cpu_info:77:cpu_info77:crtime 186.078156225 cpu_info:77:cpu_info77:current_clock_Hz 1648762500 cpu_info:77:cpu_info77:device_ID 77 cpu_info:77:cpu_info77:fpu_type sparcv9 cpu_info:77:cpu_info77:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:77:cpu_info77:pg_id 31 cpu_info:77:cpu_info77:snaptime 9305222.54944528 cpu_info:77:cpu_info77:state on-line cpu_info:77:cpu_info77:state_begin 1430258903 cpu_info:77:cpu_info77:supported_frequencies_Hz 1648762500 cpu_info:78:cpu_info78:brand SPARC-T3 cpu_info:78:cpu_info78:chip_id 0 cpu_info:78:cpu_info78:class misc cpu_info:78:cpu_info78:clock_MHz 1649 cpu_info:78:cpu_info78:core_id 1089 cpu_info:78:cpu_info78:cpu_fru hc:///component= cpu_info:78:cpu_info78:cpu_type sparcv9 cpu_info:78:cpu_info78:crtime 186.081686087 cpu_info:78:cpu_info78:current_clock_Hz 1648762500 cpu_info:78:cpu_info78:device_ID 78 cpu_info:78:cpu_info78:fpu_type sparcv9 cpu_info:78:cpu_info78:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:78:cpu_info78:pg_id 31 cpu_info:78:cpu_info78:snaptime 9305222.55061491 cpu_info:78:cpu_info78:state on-line cpu_info:78:cpu_info78:state_begin 1430258903 cpu_info:78:cpu_info78:supported_frequencies_Hz 1648762500 cpu_info:79:cpu_info79:brand SPARC-T3 cpu_info:79:cpu_info79:chip_id 0 cpu_info:79:cpu_info79:class misc cpu_info:79:cpu_info79:clock_MHz 1649 cpu_info:79:cpu_info79:core_id 1089 cpu_info:79:cpu_info79:cpu_fru hc:///component= cpu_info:79:cpu_info79:cpu_type sparcv9 cpu_info:79:cpu_info79:crtime 186.08618715 cpu_info:79:cpu_info79:current_clock_Hz 1648762500 cpu_info:79:cpu_info79:device_ID 79 cpu_info:79:cpu_info79:fpu_type sparcv9 cpu_info:79:cpu_info79:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:79:cpu_info79:pg_id 31 cpu_info:79:cpu_info79:snaptime 9305222.55181809 cpu_info:79:cpu_info79:state on-line cpu_info:79:cpu_info79:state_begin 1430258903 cpu_info:79:cpu_info79:supported_frequencies_Hz 1648762500 cpu_info:80:cpu_info80:brand SPARC-T3 cpu_info:80:cpu_info80:chip_id 0 cpu_info:80:cpu_info80:class misc cpu_info:80:cpu_info80:clock_MHz 1649 cpu_info:80:cpu_info80:core_id 1096 cpu_info:80:cpu_info80:cpu_fru hc:///component= cpu_info:80:cpu_info80:cpu_type sparcv9 cpu_info:80:cpu_info80:crtime 186.089729589 cpu_info:80:cpu_info80:current_clock_Hz 1648762500 cpu_info:80:cpu_info80:device_ID 80 cpu_info:80:cpu_info80:fpu_type sparcv9 cpu_info:80:cpu_info80:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:80:cpu_info80:pg_id 32 cpu_info:80:cpu_info80:snaptime 9305222.5529989 cpu_info:80:cpu_info80:state on-line cpu_info:80:cpu_info80:state_begin 1430258903 cpu_info:80:cpu_info80:supported_frequencies_Hz 1648762500 cpu_info:81:cpu_info81:brand SPARC-T3 cpu_info:81:cpu_info81:chip_id 0 cpu_info:81:cpu_info81:class misc cpu_info:81:cpu_info81:clock_MHz 1649 cpu_info:81:cpu_info81:core_id 1096 cpu_info:81:cpu_info81:cpu_fru hc:///component= cpu_info:81:cpu_info81:cpu_type sparcv9 cpu_info:81:cpu_info81:crtime 186.093385218 cpu_info:81:cpu_info81:current_clock_Hz 1648762500 cpu_info:81:cpu_info81:device_ID 81 cpu_info:81:cpu_info81:fpu_type sparcv9 cpu_info:81:cpu_info81:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:81:cpu_info81:pg_id 32 cpu_info:81:cpu_info81:snaptime 9305222.55415735 cpu_info:81:cpu_info81:state on-line cpu_info:81:cpu_info81:state_begin 1430258903 cpu_info:81:cpu_info81:supported_frequencies_Hz 1648762500 cpu_info:82:cpu_info82:brand SPARC-T3 cpu_info:82:cpu_info82:chip_id 0 cpu_info:82:cpu_info82:class misc cpu_info:82:cpu_info82:clock_MHz 1649 cpu_info:82:cpu_info82:core_id 1096 cpu_info:82:cpu_info82:cpu_fru hc:///component= cpu_info:82:cpu_info82:cpu_type sparcv9 cpu_info:82:cpu_info82:crtime 186.096857787 cpu_info:82:cpu_info82:current_clock_Hz 1648762500 cpu_info:82:cpu_info82:device_ID 82 cpu_info:82:cpu_info82:fpu_type sparcv9 cpu_info:82:cpu_info82:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:82:cpu_info82:pg_id 32 cpu_info:82:cpu_info82:snaptime 9305222.55531301 cpu_info:82:cpu_info82:state on-line cpu_info:82:cpu_info82:state_begin 1430258903 cpu_info:82:cpu_info82:supported_frequencies_Hz 1648762500 cpu_info:83:cpu_info83:brand SPARC-T3 cpu_info:83:cpu_info83:chip_id 0 cpu_info:83:cpu_info83:class misc cpu_info:83:cpu_info83:clock_MHz 1649 cpu_info:83:cpu_info83:core_id 1096 cpu_info:83:cpu_info83:cpu_fru hc:///component= cpu_info:83:cpu_info83:cpu_type sparcv9 cpu_info:83:cpu_info83:crtime 186.10044075 cpu_info:83:cpu_info83:current_clock_Hz 1648762500 cpu_info:83:cpu_info83:device_ID 83 cpu_info:83:cpu_info83:fpu_type sparcv9 cpu_info:83:cpu_info83:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:83:cpu_info83:pg_id 32 cpu_info:83:cpu_info83:snaptime 9305222.55646867 cpu_info:83:cpu_info83:state on-line cpu_info:83:cpu_info83:state_begin 1430258903 cpu_info:83:cpu_info83:supported_frequencies_Hz 1648762500 cpu_info:84:cpu_info84:brand SPARC-T3 cpu_info:84:cpu_info84:chip_id 0 cpu_info:84:cpu_info84:class misc cpu_info:84:cpu_info84:clock_MHz 1649 cpu_info:84:cpu_info84:core_id 1096 cpu_info:84:cpu_info84:cpu_fru hc:///component= cpu_info:84:cpu_info84:cpu_type sparcv9 cpu_info:84:cpu_info84:crtime 186.103991574 cpu_info:84:cpu_info84:current_clock_Hz 1648762500 cpu_info:84:cpu_info84:device_ID 84 cpu_info:84:cpu_info84:fpu_type sparcv9 cpu_info:84:cpu_info84:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:84:cpu_info84:pg_id 34 cpu_info:84:cpu_info84:snaptime 9305222.55762992 cpu_info:84:cpu_info84:state on-line cpu_info:84:cpu_info84:state_begin 1430258903 cpu_info:84:cpu_info84:supported_frequencies_Hz 1648762500 cpu_info:85:cpu_info85:brand SPARC-T3 cpu_info:85:cpu_info85:chip_id 0 cpu_info:85:cpu_info85:class misc cpu_info:85:cpu_info85:clock_MHz 1649 cpu_info:85:cpu_info85:core_id 1096 cpu_info:85:cpu_info85:cpu_fru hc:///component= cpu_info:85:cpu_info85:cpu_type sparcv9 cpu_info:85:cpu_info85:crtime 186.107497679 cpu_info:85:cpu_info85:current_clock_Hz 1648762500 cpu_info:85:cpu_info85:device_ID 85 cpu_info:85:cpu_info85:fpu_type sparcv9 cpu_info:85:cpu_info85:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:85:cpu_info85:pg_id 34 cpu_info:85:cpu_info85:snaptime 9305222.55880235 cpu_info:85:cpu_info85:state on-line cpu_info:85:cpu_info85:state_begin 1430258903 cpu_info:85:cpu_info85:supported_frequencies_Hz 1648762500 cpu_info:86:cpu_info86:brand SPARC-T3 cpu_info:86:cpu_info86:chip_id 0 cpu_info:86:cpu_info86:class misc cpu_info:86:cpu_info86:clock_MHz 1649 cpu_info:86:cpu_info86:core_id 1096 cpu_info:86:cpu_info86:cpu_fru hc:///component= cpu_info:86:cpu_info86:cpu_type sparcv9 cpu_info:86:cpu_info86:crtime 186.112561899 cpu_info:86:cpu_info86:current_clock_Hz 1648762500 cpu_info:86:cpu_info86:device_ID 86 cpu_info:86:cpu_info86:fpu_type sparcv9 cpu_info:86:cpu_info86:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:86:cpu_info86:pg_id 34 cpu_info:86:cpu_info86:snaptime 9305222.55995382 cpu_info:86:cpu_info86:state on-line cpu_info:86:cpu_info86:state_begin 1430258903 cpu_info:86:cpu_info86:supported_frequencies_Hz 1648762500 cpu_info:87:cpu_info87:brand SPARC-T3 cpu_info:87:cpu_info87:chip_id 0 cpu_info:87:cpu_info87:class misc cpu_info:87:cpu_info87:clock_MHz 1649 cpu_info:87:cpu_info87:core_id 1096 cpu_info:87:cpu_info87:cpu_fru hc:///component= cpu_info:87:cpu_info87:cpu_type sparcv9 cpu_info:87:cpu_info87:crtime 186.116544523 cpu_info:87:cpu_info87:current_clock_Hz 1648762500 cpu_info:87:cpu_info87:device_ID 87 cpu_info:87:cpu_info87:fpu_type sparcv9 cpu_info:87:cpu_info87:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:87:cpu_info87:pg_id 34 cpu_info:87:cpu_info87:snaptime 9305222.56116537 cpu_info:87:cpu_info87:state on-line cpu_info:87:cpu_info87:state_begin 1430258903 cpu_info:87:cpu_info87:supported_frequencies_Hz 1648762500 cpu_info:88:cpu_info88:brand SPARC-T3 cpu_info:88:cpu_info88:chip_id 0 cpu_info:88:cpu_info88:class misc cpu_info:88:cpu_info88:clock_MHz 1649 cpu_info:88:cpu_info88:core_id 1103 cpu_info:88:cpu_info88:cpu_fru hc:///component= cpu_info:88:cpu_info88:cpu_type sparcv9 cpu_info:88:cpu_info88:crtime 186.120367841 cpu_info:88:cpu_info88:current_clock_Hz 1648762500 cpu_info:88:cpu_info88:device_ID 88 cpu_info:88:cpu_info88:fpu_type sparcv9 cpu_info:88:cpu_info88:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:88:cpu_info88:pg_id 35 cpu_info:88:cpu_info88:snaptime 9305222.56231964 cpu_info:88:cpu_info88:state on-line cpu_info:88:cpu_info88:state_begin 1430258903 cpu_info:88:cpu_info88:supported_frequencies_Hz 1648762500 cpu_info:89:cpu_info89:brand SPARC-T3 cpu_info:89:cpu_info89:chip_id 0 cpu_info:89:cpu_info89:class misc cpu_info:89:cpu_info89:clock_MHz 1649 cpu_info:89:cpu_info89:core_id 1103 cpu_info:89:cpu_info89:cpu_fru hc:///component= cpu_info:89:cpu_info89:cpu_type sparcv9 cpu_info:89:cpu_info89:crtime 186.124051418 cpu_info:89:cpu_info89:current_clock_Hz 1648762500 cpu_info:89:cpu_info89:device_ID 89 cpu_info:89:cpu_info89:fpu_type sparcv9 cpu_info:89:cpu_info89:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:89:cpu_info89:pg_id 35 cpu_info:89:cpu_info89:snaptime 9305222.56348368 cpu_info:89:cpu_info89:state on-line cpu_info:89:cpu_info89:state_begin 1430258903 cpu_info:89:cpu_info89:supported_frequencies_Hz 1648762500 cpu_info:90:cpu_info90:brand SPARC-T3 cpu_info:90:cpu_info90:chip_id 0 cpu_info:90:cpu_info90:class misc cpu_info:90:cpu_info90:clock_MHz 1649 cpu_info:90:cpu_info90:core_id 1103 cpu_info:90:cpu_info90:cpu_fru hc:///component= cpu_info:90:cpu_info90:cpu_type sparcv9 cpu_info:90:cpu_info90:crtime 186.127595254 cpu_info:90:cpu_info90:current_clock_Hz 1648762500 cpu_info:90:cpu_info90:device_ID 90 cpu_info:90:cpu_info90:fpu_type sparcv9 cpu_info:90:cpu_info90:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:90:cpu_info90:pg_id 35 cpu_info:90:cpu_info90:snaptime 9305222.56470222 cpu_info:90:cpu_info90:state on-line cpu_info:90:cpu_info90:state_begin 1430258903 cpu_info:90:cpu_info90:supported_frequencies_Hz 1648762500 cpu_info:91:cpu_info91:brand SPARC-T3 cpu_info:91:cpu_info91:chip_id 0 cpu_info:91:cpu_info91:class misc cpu_info:91:cpu_info91:clock_MHz 1649 cpu_info:91:cpu_info91:core_id 1103 cpu_info:91:cpu_info91:cpu_fru hc:///component= cpu_info:91:cpu_info91:cpu_type sparcv9 cpu_info:91:cpu_info91:crtime 186.131172628 cpu_info:91:cpu_info91:current_clock_Hz 1648762500 cpu_info:91:cpu_info91:device_ID 91 cpu_info:91:cpu_info91:fpu_type sparcv9 cpu_info:91:cpu_info91:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:91:cpu_info91:pg_id 35 cpu_info:91:cpu_info91:snaptime 9305222.56585928 cpu_info:91:cpu_info91:state on-line cpu_info:91:cpu_info91:state_begin 1430258903 cpu_info:91:cpu_info91:supported_frequencies_Hz 1648762500 cpu_info:92:cpu_info92:brand SPARC-T3 cpu_info:92:cpu_info92:chip_id 0 cpu_info:92:cpu_info92:class misc cpu_info:92:cpu_info92:clock_MHz 1649 cpu_info:92:cpu_info92:core_id 1103 cpu_info:92:cpu_info92:cpu_fru hc:///component= cpu_info:92:cpu_info92:cpu_type sparcv9 cpu_info:92:cpu_info92:crtime 186.135181802 cpu_info:92:cpu_info92:current_clock_Hz 1648762500 cpu_info:92:cpu_info92:device_ID 92 cpu_info:92:cpu_info92:fpu_type sparcv9 cpu_info:92:cpu_info92:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:92:cpu_info92:pg_id 37 cpu_info:92:cpu_info92:snaptime 9305222.56701773 cpu_info:92:cpu_info92:state on-line cpu_info:92:cpu_info92:state_begin 1430258903 cpu_info:92:cpu_info92:supported_frequencies_Hz 1648762500 cpu_info:93:cpu_info93:brand SPARC-T3 cpu_info:93:cpu_info93:chip_id 0 cpu_info:93:cpu_info93:class misc cpu_info:93:cpu_info93:clock_MHz 1649 cpu_info:93:cpu_info93:core_id 1103 cpu_info:93:cpu_info93:cpu_fru hc:///component= cpu_info:93:cpu_info93:cpu_type sparcv9 cpu_info:93:cpu_info93:crtime 186.146467299 cpu_info:93:cpu_info93:current_clock_Hz 1648762500 cpu_info:93:cpu_info93:device_ID 93 cpu_info:93:cpu_info93:fpu_type sparcv9 cpu_info:93:cpu_info93:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:93:cpu_info93:pg_id 37 cpu_info:93:cpu_info93:snaptime 9305222.568172 cpu_info:93:cpu_info93:state on-line cpu_info:93:cpu_info93:state_begin 1430258903 cpu_info:93:cpu_info93:supported_frequencies_Hz 1648762500 cpu_info:94:cpu_info94:brand SPARC-T3 cpu_info:94:cpu_info94:chip_id 0 cpu_info:94:cpu_info94:class misc cpu_info:94:cpu_info94:clock_MHz 1649 cpu_info:94:cpu_info94:core_id 1103 cpu_info:94:cpu_info94:cpu_fru hc:///component= cpu_info:94:cpu_info94:cpu_type sparcv9 cpu_info:94:cpu_info94:crtime 186.150243105 cpu_info:94:cpu_info94:current_clock_Hz 1648762500 cpu_info:94:cpu_info94:device_ID 94 cpu_info:94:cpu_info94:fpu_type sparcv9 cpu_info:94:cpu_info94:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:94:cpu_info94:pg_id 37 cpu_info:94:cpu_info94:snaptime 9305222.56933883 cpu_info:94:cpu_info94:state on-line cpu_info:94:cpu_info94:state_begin 1430258903 cpu_info:94:cpu_info94:supported_frequencies_Hz 1648762500 cpu_info:95:cpu_info95:brand SPARC-T3 cpu_info:95:cpu_info95:chip_id 0 cpu_info:95:cpu_info95:class misc cpu_info:95:cpu_info95:clock_MHz 1649 cpu_info:95:cpu_info95:core_id 1103 cpu_info:95:cpu_info95:cpu_fru hc:///component= cpu_info:95:cpu_info95:cpu_type sparcv9 cpu_info:95:cpu_info95:crtime 186.154034283 cpu_info:95:cpu_info95:current_clock_Hz 1648762500 cpu_info:95:cpu_info95:device_ID 95 cpu_info:95:cpu_info95:fpu_type sparcv9 cpu_info:95:cpu_info95:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:95:cpu_info95:pg_id 37 cpu_info:95:cpu_info95:snaptime 9305222.5705462 cpu_info:95:cpu_info95:state on-line cpu_info:95:cpu_info95:state_begin 1430258903 cpu_info:95:cpu_info95:supported_frequencies_Hz 1648762500 cpu_info:96:cpu_info96:brand SPARC-T3 cpu_info:96:cpu_info96:chip_id 0 cpu_info:96:cpu_info96:class misc cpu_info:96:cpu_info96:clock_MHz 1649 cpu_info:96:cpu_info96:core_id 1110 cpu_info:96:cpu_info96:cpu_fru hc:///component= cpu_info:96:cpu_info96:cpu_type sparcv9 cpu_info:96:cpu_info96:crtime 186.157794718 cpu_info:96:cpu_info96:current_clock_Hz 1648762500 cpu_info:96:cpu_info96:device_ID 96 cpu_info:96:cpu_info96:fpu_type sparcv9 cpu_info:96:cpu_info96:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:96:cpu_info96:pg_id 38 cpu_info:96:cpu_info96:snaptime 9305222.57170186 cpu_info:96:cpu_info96:state on-line cpu_info:96:cpu_info96:state_begin 1430258903 cpu_info:96:cpu_info96:supported_frequencies_Hz 1648762500 cpu_info:97:cpu_info97:brand SPARC-T3 cpu_info:97:cpu_info97:chip_id 0 cpu_info:97:cpu_info97:class misc cpu_info:97:cpu_info97:clock_MHz 1649 cpu_info:97:cpu_info97:core_id 1110 cpu_info:97:cpu_info97:cpu_fru hc:///component= cpu_info:97:cpu_info97:cpu_type sparcv9 cpu_info:97:cpu_info97:crtime 186.162034466 cpu_info:97:cpu_info97:current_clock_Hz 1648762500 cpu_info:97:cpu_info97:device_ID 97 cpu_info:97:cpu_info97:fpu_type sparcv9 cpu_info:97:cpu_info97:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:97:cpu_info97:pg_id 38 cpu_info:97:cpu_info97:snaptime 9305222.57285752 cpu_info:97:cpu_info97:state on-line cpu_info:97:cpu_info97:state_begin 1430258903 cpu_info:97:cpu_info97:supported_frequencies_Hz 1648762500 cpu_info:98:cpu_info98:brand SPARC-T3 cpu_info:98:cpu_info98:chip_id 0 cpu_info:98:cpu_info98:class misc cpu_info:98:cpu_info98:clock_MHz 1649 cpu_info:98:cpu_info98:core_id 1110 cpu_info:98:cpu_info98:cpu_fru hc:///component= cpu_info:98:cpu_info98:cpu_type sparcv9 cpu_info:98:cpu_info98:crtime 186.165764158 cpu_info:98:cpu_info98:current_clock_Hz 1648762500 cpu_info:98:cpu_info98:device_ID 98 cpu_info:98:cpu_info98:fpu_type sparcv9 cpu_info:98:cpu_info98:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:98:cpu_info98:pg_id 38 cpu_info:98:cpu_info98:snaptime 9305222.57402436 cpu_info:98:cpu_info98:state on-line cpu_info:98:cpu_info98:state_begin 1430258903 cpu_info:98:cpu_info98:supported_frequencies_Hz 1648762500 cpu_info:99:cpu_info99:brand SPARC-T3 cpu_info:99:cpu_info99:chip_id 0 cpu_info:99:cpu_info99:class misc cpu_info:99:cpu_info99:clock_MHz 1649 cpu_info:99:cpu_info99:core_id 1110 cpu_info:99:cpu_info99:cpu_fru hc:///component= cpu_info:99:cpu_info99:cpu_type sparcv9 cpu_info:99:cpu_info99:crtime 186.169446338 cpu_info:99:cpu_info99:current_clock_Hz 1648762500 cpu_info:99:cpu_info99:device_ID 99 cpu_info:99:cpu_info99:fpu_type sparcv9 cpu_info:99:cpu_info99:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:99:cpu_info99:pg_id 38 cpu_info:99:cpu_info99:snaptime 9305222.5751856 cpu_info:99:cpu_info99:state on-line cpu_info:99:cpu_info99:state_begin 1430258903 cpu_info:99:cpu_info99:supported_frequencies_Hz 1648762500 cpu_info:100:cpu_info100:brand SPARC-T3 cpu_info:100:cpu_info100:chip_id 0 cpu_info:100:cpu_info100:class misc cpu_info:100:cpu_info100:clock_MHz 1649 cpu_info:100:cpu_info100:core_id 1110 cpu_info:100:cpu_info100:cpu_fru hc:///component= cpu_info:100:cpu_info100:cpu_type sparcv9 cpu_info:100:cpu_info100:crtime 186.17328363 cpu_info:100:cpu_info100:current_clock_Hz 1648762500 cpu_info:100:cpu_info100:device_ID 100 cpu_info:100:cpu_info100:fpu_type sparcv9 cpu_info:100:cpu_info100:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:100:cpu_info100:pg_id 40 cpu_info:100:cpu_info100:snaptime 9305222.57636642 cpu_info:100:cpu_info100:state on-line cpu_info:100:cpu_info100:state_begin 1430258903 cpu_info:100:cpu_info100:supported_frequencies_Hz 1648762500 cpu_info:101:cpu_info101:brand SPARC-T3 cpu_info:101:cpu_info101:chip_id 0 cpu_info:101:cpu_info101:class misc cpu_info:101:cpu_info101:clock_MHz 1649 cpu_info:101:cpu_info101:core_id 1110 cpu_info:101:cpu_info101:cpu_fru hc:///component= cpu_info:101:cpu_info101:cpu_type sparcv9 cpu_info:101:cpu_info101:crtime 186.17700913 cpu_info:101:cpu_info101:current_clock_Hz 1648762500 cpu_info:101:cpu_info101:device_ID 101 cpu_info:101:cpu_info101:fpu_type sparcv9 cpu_info:101:cpu_info101:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:101:cpu_info101:pg_id 40 cpu_info:101:cpu_info101:snaptime 9305222.57756819 cpu_info:101:cpu_info101:state on-line cpu_info:101:cpu_info101:state_begin 1430258903 cpu_info:101:cpu_info101:supported_frequencies_Hz 1648762500 cpu_info:102:cpu_info102:brand SPARC-T3 cpu_info:102:cpu_info102:chip_id 0 cpu_info:102:cpu_info102:class misc cpu_info:102:cpu_info102:clock_MHz 1649 cpu_info:102:cpu_info102:core_id 1110 cpu_info:102:cpu_info102:cpu_fru hc:///component= cpu_info:102:cpu_info102:cpu_type sparcv9 cpu_info:102:cpu_info102:crtime 186.181111931 cpu_info:102:cpu_info102:current_clock_Hz 1648762500 cpu_info:102:cpu_info102:device_ID 102 cpu_info:102:cpu_info102:fpu_type sparcv9 cpu_info:102:cpu_info102:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:102:cpu_info102:pg_id 40 cpu_info:102:cpu_info102:snaptime 9305222.57872385 cpu_info:102:cpu_info102:state on-line cpu_info:102:cpu_info102:state_begin 1430258903 cpu_info:102:cpu_info102:supported_frequencies_Hz 1648762500 cpu_info:103:cpu_info103:brand SPARC-T3 cpu_info:103:cpu_info103:chip_id 0 cpu_info:103:cpu_info103:class misc cpu_info:103:cpu_info103:clock_MHz 1649 cpu_info:103:cpu_info103:core_id 1110 cpu_info:103:cpu_info103:cpu_fru hc:///component= cpu_info:103:cpu_info103:cpu_type sparcv9 cpu_info:103:cpu_info103:crtime 186.184992543 cpu_info:103:cpu_info103:current_clock_Hz 1648762500 cpu_info:103:cpu_info103:device_ID 103 cpu_info:103:cpu_info103:fpu_type sparcv9 cpu_info:103:cpu_info103:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:103:cpu_info103:pg_id 40 cpu_info:103:cpu_info103:snaptime 9305222.57987811 cpu_info:103:cpu_info103:state on-line cpu_info:103:cpu_info103:state_begin 1430258903 cpu_info:103:cpu_info103:supported_frequencies_Hz 1648762500 cpu_info:104:cpu_info104:brand SPARC-T3 cpu_info:104:cpu_info104:chip_id 0 cpu_info:104:cpu_info104:class misc cpu_info:104:cpu_info104:clock_MHz 1649 cpu_info:104:cpu_info104:core_id 1117 cpu_info:104:cpu_info104:cpu_fru hc:///component= cpu_info:104:cpu_info104:cpu_type sparcv9 cpu_info:104:cpu_info104:crtime 186.188854989 cpu_info:104:cpu_info104:current_clock_Hz 1648762500 cpu_info:104:cpu_info104:device_ID 104 cpu_info:104:cpu_info104:fpu_type sparcv9 cpu_info:104:cpu_info104:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:104:cpu_info104:pg_id 41 cpu_info:104:cpu_info104:snaptime 9305222.58126295 cpu_info:104:cpu_info104:state on-line cpu_info:104:cpu_info104:state_begin 1430258903 cpu_info:104:cpu_info104:supported_frequencies_Hz 1648762500 cpu_info:105:cpu_info105:brand SPARC-T3 cpu_info:105:cpu_info105:chip_id 0 cpu_info:105:cpu_info105:class misc cpu_info:105:cpu_info105:clock_MHz 1649 cpu_info:105:cpu_info105:core_id 1117 cpu_info:105:cpu_info105:cpu_fru hc:///component= cpu_info:105:cpu_info105:cpu_type sparcv9 cpu_info:105:cpu_info105:crtime 186.192766344 cpu_info:105:cpu_info105:current_clock_Hz 1648762500 cpu_info:105:cpu_info105:device_ID 105 cpu_info:105:cpu_info105:fpu_type sparcv9 cpu_info:105:cpu_info105:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:105:cpu_info105:pg_id 41 cpu_info:105:cpu_info105:snaptime 9305222.5824228 cpu_info:105:cpu_info105:state on-line cpu_info:105:cpu_info105:state_begin 1430258903 cpu_info:105:cpu_info105:supported_frequencies_Hz 1648762500 cpu_info:106:cpu_info106:brand SPARC-T3 cpu_info:106:cpu_info106:chip_id 0 cpu_info:106:cpu_info106:class misc cpu_info:106:cpu_info106:clock_MHz 1649 cpu_info:106:cpu_info106:core_id 1117 cpu_info:106:cpu_info106:cpu_fru hc:///component= cpu_info:106:cpu_info106:cpu_type sparcv9 cpu_info:106:cpu_info106:crtime 186.197053603 cpu_info:106:cpu_info106:current_clock_Hz 1648762500 cpu_info:106:cpu_info106:device_ID 106 cpu_info:106:cpu_info106:fpu_type sparcv9 cpu_info:106:cpu_info106:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:106:cpu_info106:pg_id 41 cpu_info:106:cpu_info106:snaptime 9305222.58358125 cpu_info:106:cpu_info106:state on-line cpu_info:106:cpu_info106:state_begin 1430258903 cpu_info:106:cpu_info106:supported_frequencies_Hz 1648762500 cpu_info:107:cpu_info107:brand SPARC-T3 cpu_info:107:cpu_info107:chip_id 0 cpu_info:107:cpu_info107:class misc cpu_info:107:cpu_info107:clock_MHz 1649 cpu_info:107:cpu_info107:core_id 1117 cpu_info:107:cpu_info107:cpu_fru hc:///component= cpu_info:107:cpu_info107:cpu_type sparcv9 cpu_info:107:cpu_info107:crtime 186.200927229 cpu_info:107:cpu_info107:current_clock_Hz 1648762500 cpu_info:107:cpu_info107:device_ID 107 cpu_info:107:cpu_info107:fpu_type sparcv9 cpu_info:107:cpu_info107:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:107:cpu_info107:pg_id 41 cpu_info:107:cpu_info107:snaptime 9305222.5847467 cpu_info:107:cpu_info107:state on-line cpu_info:107:cpu_info107:state_begin 1430258903 cpu_info:107:cpu_info107:supported_frequencies_Hz 1648762500 cpu_info:108:cpu_info108:brand SPARC-T3 cpu_info:108:cpu_info108:chip_id 0 cpu_info:108:cpu_info108:class misc cpu_info:108:cpu_info108:clock_MHz 1649 cpu_info:108:cpu_info108:core_id 1117 cpu_info:108:cpu_info108:cpu_fru hc:///component= cpu_info:108:cpu_info108:cpu_type sparcv9 cpu_info:108:cpu_info108:crtime 186.204772906 cpu_info:108:cpu_info108:current_clock_Hz 1648762500 cpu_info:108:cpu_info108:device_ID 108 cpu_info:108:cpu_info108:fpu_type sparcv9 cpu_info:108:cpu_info108:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:108:cpu_info108:pg_id 43 cpu_info:108:cpu_info108:snaptime 9305222.58591214 cpu_info:108:cpu_info108:state on-line cpu_info:108:cpu_info108:state_begin 1430258903 cpu_info:108:cpu_info108:supported_frequencies_Hz 1648762500 cpu_info:109:cpu_info109:brand SPARC-T3 cpu_info:109:cpu_info109:chip_id 0 cpu_info:109:cpu_info109:class misc cpu_info:109:cpu_info109:clock_MHz 1649 cpu_info:109:cpu_info109:core_id 1117 cpu_info:109:cpu_info109:cpu_fru hc:///component= cpu_info:109:cpu_info109:cpu_type sparcv9 cpu_info:109:cpu_info109:crtime 186.208800246 cpu_info:109:cpu_info109:current_clock_Hz 1648762500 cpu_info:109:cpu_info109:device_ID 109 cpu_info:109:cpu_info109:fpu_type sparcv9 cpu_info:109:cpu_info109:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:109:cpu_info109:pg_id 43 cpu_info:109:cpu_info109:snaptime 9305222.58709854 cpu_info:109:cpu_info109:state on-line cpu_info:109:cpu_info109:state_begin 1430258903 cpu_info:109:cpu_info109:supported_frequencies_Hz 1648762500 cpu_info:110:cpu_info110:brand SPARC-T3 cpu_info:110:cpu_info110:chip_id 0 cpu_info:110:cpu_info110:class misc cpu_info:110:cpu_info110:clock_MHz 1649 cpu_info:110:cpu_info110:core_id 1117 cpu_info:110:cpu_info110:cpu_fru hc:///component= cpu_info:110:cpu_info110:cpu_type sparcv9 cpu_info:110:cpu_info110:crtime 186.21284715 cpu_info:110:cpu_info110:current_clock_Hz 1648762500 cpu_info:110:cpu_info110:device_ID 110 cpu_info:110:cpu_info110:fpu_type sparcv9 cpu_info:110:cpu_info110:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:110:cpu_info110:pg_id 43 cpu_info:110:cpu_info110:snaptime 9305222.5882556 cpu_info:110:cpu_info110:state on-line cpu_info:110:cpu_info110:state_begin 1430258903 cpu_info:110:cpu_info110:supported_frequencies_Hz 1648762500 cpu_info:111:cpu_info111:brand SPARC-T3 cpu_info:111:cpu_info111:chip_id 0 cpu_info:111:cpu_info111:class misc cpu_info:111:cpu_info111:clock_MHz 1649 cpu_info:111:cpu_info111:core_id 1117 cpu_info:111:cpu_info111:cpu_fru hc:///component= cpu_info:111:cpu_info111:cpu_type sparcv9 cpu_info:111:cpu_info111:crtime 186.216681648 cpu_info:111:cpu_info111:current_clock_Hz 1648762500 cpu_info:111:cpu_info111:device_ID 111 cpu_info:111:cpu_info111:fpu_type sparcv9 cpu_info:111:cpu_info111:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:111:cpu_info111:pg_id 43 cpu_info:111:cpu_info111:snaptime 9305222.58941964 cpu_info:111:cpu_info111:state on-line cpu_info:111:cpu_info111:state_begin 1430258903 cpu_info:111:cpu_info111:supported_frequencies_Hz 1648762500 cpu_info:112:cpu_info112:brand SPARC-T3 cpu_info:112:cpu_info112:chip_id 0 cpu_info:112:cpu_info112:class misc cpu_info:112:cpu_info112:clock_MHz 1649 cpu_info:112:cpu_info112:core_id 1124 cpu_info:112:cpu_info112:cpu_fru hc:///component= cpu_info:112:cpu_info112:cpu_type sparcv9 cpu_info:112:cpu_info112:crtime 186.220644707 cpu_info:112:cpu_info112:current_clock_Hz 1648762500 cpu_info:112:cpu_info112:device_ID 112 cpu_info:112:cpu_info112:fpu_type sparcv9 cpu_info:112:cpu_info112:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:112:cpu_info112:pg_id 44 cpu_info:112:cpu_info112:snaptime 9305222.59064377 cpu_info:112:cpu_info112:state on-line cpu_info:112:cpu_info112:state_begin 1430258903 cpu_info:112:cpu_info112:supported_frequencies_Hz 1648762500 cpu_info:113:cpu_info113:brand SPARC-T3 cpu_info:113:cpu_info113:chip_id 0 cpu_info:113:cpu_info113:class misc cpu_info:113:cpu_info113:clock_MHz 1649 cpu_info:113:cpu_info113:core_id 1124 cpu_info:113:cpu_info113:cpu_fru hc:///component= cpu_info:113:cpu_info113:cpu_type sparcv9 cpu_info:113:cpu_info113:crtime 186.224940351 cpu_info:113:cpu_info113:current_clock_Hz 1648762500 cpu_info:113:cpu_info113:device_ID 113 cpu_info:113:cpu_info113:fpu_type sparcv9 cpu_info:113:cpu_info113:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:113:cpu_info113:pg_id 44 cpu_info:113:cpu_info113:snaptime 9305222.591819 cpu_info:113:cpu_info113:state on-line cpu_info:113:cpu_info113:state_begin 1430258903 cpu_info:113:cpu_info113:supported_frequencies_Hz 1648762500 cpu_info:114:cpu_info114:brand SPARC-T3 cpu_info:114:cpu_info114:chip_id 0 cpu_info:114:cpu_info114:class misc cpu_info:114:cpu_info114:clock_MHz 1649 cpu_info:114:cpu_info114:core_id 1124 cpu_info:114:cpu_info114:cpu_fru hc:///component= cpu_info:114:cpu_info114:cpu_type sparcv9 cpu_info:114:cpu_info114:crtime 186.228844719 cpu_info:114:cpu_info114:current_clock_Hz 1648762500 cpu_info:114:cpu_info114:device_ID 114 cpu_info:114:cpu_info114:fpu_type sparcv9 cpu_info:114:cpu_info114:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:114:cpu_info114:pg_id 44 cpu_info:114:cpu_info114:snaptime 9305222.59298444 cpu_info:114:cpu_info114:state on-line cpu_info:114:cpu_info114:state_begin 1430258903 cpu_info:114:cpu_info114:supported_frequencies_Hz 1648762500 cpu_info:115:cpu_info115:brand SPARC-T3 cpu_info:115:cpu_info115:chip_id 0 cpu_info:115:cpu_info115:class misc cpu_info:115:cpu_info115:clock_MHz 1649 cpu_info:115:cpu_info115:core_id 1124 cpu_info:115:cpu_info115:cpu_fru hc:///component= cpu_info:115:cpu_info115:cpu_type sparcv9 cpu_info:115:cpu_info115:crtime 186.232733716 cpu_info:115:cpu_info115:current_clock_Hz 1648762500 cpu_info:115:cpu_info115:device_ID 115 cpu_info:115:cpu_info115:fpu_type sparcv9 cpu_info:115:cpu_info115:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:115:cpu_info115:pg_id 44 cpu_info:115:cpu_info115:snaptime 9305222.5941387 cpu_info:115:cpu_info115:state on-line cpu_info:115:cpu_info115:state_begin 1430258903 cpu_info:115:cpu_info115:supported_frequencies_Hz 1648762500 cpu_info:116:cpu_info116:brand SPARC-T3 cpu_info:116:cpu_info116:chip_id 0 cpu_info:116:cpu_info116:class misc cpu_info:116:cpu_info116:clock_MHz 1649 cpu_info:116:cpu_info116:core_id 1124 cpu_info:116:cpu_info116:cpu_fru hc:///component= cpu_info:116:cpu_info116:cpu_type sparcv9 cpu_info:116:cpu_info116:crtime 186.236670225 cpu_info:116:cpu_info116:current_clock_Hz 1648762500 cpu_info:116:cpu_info116:device_ID 116 cpu_info:116:cpu_info116:fpu_type sparcv9 cpu_info:116:cpu_info116:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:116:cpu_info116:pg_id 46 cpu_info:116:cpu_info116:snaptime 9305222.59529995 cpu_info:116:cpu_info116:state on-line cpu_info:116:cpu_info116:state_begin 1430258903 cpu_info:116:cpu_info116:supported_frequencies_Hz 1648762500 cpu_info:117:cpu_info117:brand SPARC-T3 cpu_info:117:cpu_info117:chip_id 0 cpu_info:117:cpu_info117:class misc cpu_info:117:cpu_info117:clock_MHz 1649 cpu_info:117:cpu_info117:core_id 1124 cpu_info:117:cpu_info117:cpu_fru hc:///component= cpu_info:117:cpu_info117:cpu_type sparcv9 cpu_info:117:cpu_info117:crtime 186.240778616 cpu_info:117:cpu_info117:current_clock_Hz 1648762500 cpu_info:117:cpu_info117:device_ID 117 cpu_info:117:cpu_info117:fpu_type sparcv9 cpu_info:117:cpu_info117:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:117:cpu_info117:pg_id 46 cpu_info:117:cpu_info117:snaptime 9305222.59648495 cpu_info:117:cpu_info117:state on-line cpu_info:117:cpu_info117:state_begin 1430258903 cpu_info:117:cpu_info117:supported_frequencies_Hz 1648762500 cpu_info:118:cpu_info118:brand SPARC-T3 cpu_info:118:cpu_info118:chip_id 0 cpu_info:118:cpu_info118:class misc cpu_info:118:cpu_info118:clock_MHz 1649 cpu_info:118:cpu_info118:core_id 1124 cpu_info:118:cpu_info118:cpu_fru hc:///component= cpu_info:118:cpu_info118:cpu_type sparcv9 cpu_info:118:cpu_info118:crtime 186.244717919 cpu_info:118:cpu_info118:current_clock_Hz 1648762500 cpu_info:118:cpu_info118:device_ID 118 cpu_info:118:cpu_info118:fpu_type sparcv9 cpu_info:118:cpu_info118:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:118:cpu_info118:pg_id 46 cpu_info:118:cpu_info118:snaptime 9305222.5976476 cpu_info:118:cpu_info118:state on-line cpu_info:118:cpu_info118:state_begin 1430258903 cpu_info:118:cpu_info118:supported_frequencies_Hz 1648762500 cpu_info:119:cpu_info119:brand SPARC-T3 cpu_info:119:cpu_info119:chip_id 0 cpu_info:119:cpu_info119:class misc cpu_info:119:cpu_info119:clock_MHz 1649 cpu_info:119:cpu_info119:core_id 1124 cpu_info:119:cpu_info119:cpu_fru hc:///component= cpu_info:119:cpu_info119:cpu_type sparcv9 cpu_info:119:cpu_info119:crtime 186.248661415 cpu_info:119:cpu_info119:current_clock_Hz 1648762500 cpu_info:119:cpu_info119:device_ID 119 cpu_info:119:cpu_info119:fpu_type sparcv9 cpu_info:119:cpu_info119:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:119:cpu_info119:pg_id 46 cpu_info:119:cpu_info119:snaptime 9305222.59881723 cpu_info:119:cpu_info119:state on-line cpu_info:119:cpu_info119:state_begin 1430258903 cpu_info:119:cpu_info119:supported_frequencies_Hz 1648762500 cpu_info:120:cpu_info120:brand SPARC-T3 cpu_info:120:cpu_info120:chip_id 0 cpu_info:120:cpu_info120:class misc cpu_info:120:cpu_info120:clock_MHz 1649 cpu_info:120:cpu_info120:core_id 1131 cpu_info:120:cpu_info120:cpu_fru hc:///component= cpu_info:120:cpu_info120:cpu_type sparcv9 cpu_info:120:cpu_info120:crtime 186.252660808 cpu_info:120:cpu_info120:current_clock_Hz 1648762500 cpu_info:120:cpu_info120:device_ID 120 cpu_info:120:cpu_info120:fpu_type sparcv9 cpu_info:120:cpu_info120:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:120:cpu_info120:pg_id 47 cpu_info:120:cpu_info120:snaptime 9305222.59998826 cpu_info:120:cpu_info120:state on-line cpu_info:120:cpu_info120:state_begin 1430258903 cpu_info:120:cpu_info120:supported_frequencies_Hz 1648762500 cpu_info:121:cpu_info121:brand SPARC-T3 cpu_info:121:cpu_info121:chip_id 0 cpu_info:121:cpu_info121:class misc cpu_info:121:cpu_info121:clock_MHz 1649 cpu_info:121:cpu_info121:core_id 1131 cpu_info:121:cpu_info121:cpu_fru hc:///component= cpu_info:121:cpu_info121:cpu_type sparcv9 cpu_info:121:cpu_info121:crtime 186.257104577 cpu_info:121:cpu_info121:current_clock_Hz 1648762500 cpu_info:121:cpu_info121:device_ID 121 cpu_info:121:cpu_info121:fpu_type sparcv9 cpu_info:121:cpu_info121:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:121:cpu_info121:pg_id 47 cpu_info:121:cpu_info121:snaptime 9305222.60114672 cpu_info:121:cpu_info121:state on-line cpu_info:121:cpu_info121:state_begin 1430258903 cpu_info:121:cpu_info121:supported_frequencies_Hz 1648762500 cpu_info:122:cpu_info122:brand SPARC-T3 cpu_info:122:cpu_info122:chip_id 0 cpu_info:122:cpu_info122:class misc cpu_info:122:cpu_info122:clock_MHz 1649 cpu_info:122:cpu_info122:core_id 1131 cpu_info:122:cpu_info122:cpu_fru hc:///component= cpu_info:122:cpu_info122:cpu_type sparcv9 cpu_info:122:cpu_info122:crtime 186.260994971 cpu_info:122:cpu_info122:current_clock_Hz 1648762500 cpu_info:122:cpu_info122:device_ID 122 cpu_info:122:cpu_info122:fpu_type sparcv9 cpu_info:122:cpu_info122:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:122:cpu_info122:pg_id 47 cpu_info:122:cpu_info122:snaptime 9305222.60230238 cpu_info:122:cpu_info122:state on-line cpu_info:122:cpu_info122:state_begin 1430258903 cpu_info:122:cpu_info122:supported_frequencies_Hz 1648762500 cpu_info:123:cpu_info123:brand SPARC-T3 cpu_info:123:cpu_info123:chip_id 0 cpu_info:123:cpu_info123:class misc cpu_info:123:cpu_info123:clock_MHz 1649 cpu_info:123:cpu_info123:core_id 1131 cpu_info:123:cpu_info123:cpu_fru hc:///component= cpu_info:123:cpu_info123:cpu_type sparcv9 cpu_info:123:cpu_info123:crtime 186.264900737 cpu_info:123:cpu_info123:current_clock_Hz 1648762500 cpu_info:123:cpu_info123:device_ID 123 cpu_info:123:cpu_info123:fpu_type sparcv9 cpu_info:123:cpu_info123:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:123:cpu_info123:pg_id 47 cpu_info:123:cpu_info123:snaptime 9305222.60351952 cpu_info:123:cpu_info123:state on-line cpu_info:123:cpu_info123:state_begin 1430258903 cpu_info:123:cpu_info123:supported_frequencies_Hz 1648762500 cpu_info:124:cpu_info124:brand SPARC-T4 cpu_info:124:cpu_info124:chip_id 0 cpu_info:124:cpu_info124:class misc cpu_info:124:cpu_info124:clock_MHz 1649 cpu_info:124:cpu_info124:core_id 1131 cpu_info:124:cpu_info124:cpu_fru hc:///component= cpu_info:124:cpu_info124:cpu_type sparcv9 cpu_info:124:cpu_info124:crtime 186.268767375 cpu_info:124:cpu_info124:current_clock_Hz 1648762500 cpu_info:124:cpu_info124:device_ID 124 cpu_info:124:cpu_info124:fpu_type sparcv9 cpu_info:124:cpu_info124:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:124:cpu_info124:pg_id 49 cpu_info:124:cpu_info124:snaptime 9305222.60468497 cpu_info:124:cpu_info124:state off-line cpu_info:124:cpu_info124:state_begin 1430258903 cpu_info:124:cpu_info124:supported_frequencies_Hz 1648762500 cpu_info:125:cpu_info125:brand SPARC-T4 cpu_info:125:cpu_info125:chip_id 0 cpu_info:125:cpu_info125:class misc cpu_info:125:cpu_info125:clock_MHz 1649 cpu_info:125:cpu_info125:core_id 1131 cpu_info:125:cpu_info125:cpu_fru hc:///component= cpu_info:125:cpu_info125:cpu_type sparcv9 cpu_info:125:cpu_info125:crtime 186.272702486 cpu_info:125:cpu_info125:current_clock_Hz 1648762500 cpu_info:125:cpu_info125:device_ID 125 cpu_info:125:cpu_info125:fpu_type sparcv9 cpu_info:125:cpu_info125:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:125:cpu_info125:pg_id 49 cpu_info:125:cpu_info125:snaptime 9305222.60585879 cpu_info:125:cpu_info125:state off-line cpu_info:125:cpu_info125:state_begin 1430258903 cpu_info:125:cpu_info125:supported_frequencies_Hz 1648762500 cpu_info:126:cpu_info126:brand SPARC-T4 cpu_info:126:cpu_info126:chip_id 0 cpu_info:126:cpu_info126:class misc cpu_info:126:cpu_info126:clock_MHz 1649 cpu_info:126:cpu_info126:core_id 1131 cpu_info:126:cpu_info126:cpu_fru hc:///component= cpu_info:126:cpu_info126:cpu_type sparcv9 cpu_info:126:cpu_info126:crtime 186.27663061 cpu_info:126:cpu_info126:current_clock_Hz 1648762500 cpu_info:126:cpu_info126:device_ID 126 cpu_info:126:cpu_info126:fpu_type sparcv9 cpu_info:126:cpu_info126:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:126:cpu_info126:pg_id 49 cpu_info:126:cpu_info126:snaptime 9305222.60703821 cpu_info:126:cpu_info126:state off-line cpu_info:126:cpu_info126:state_begin 1430258903 cpu_info:126:cpu_info126:supported_frequencies_Hz 1648762500 cpu_info:127:cpu_info127:brand SPARC-T4 cpu_info:127:cpu_info127:chip_id 0 cpu_info:127:cpu_info127:class misc cpu_info:127:cpu_info127:clock_MHz 1649 cpu_info:127:cpu_info127:core_id 1131 cpu_info:127:cpu_info127:cpu_fru hc:///component= cpu_info:127:cpu_info127:cpu_type sparcv9 cpu_info:127:cpu_info127:crtime 186.281711599 cpu_info:127:cpu_info127:current_clock_Hz 1648762500 cpu_info:127:cpu_info127:device_ID 127 cpu_info:127:cpu_info127:fpu_type sparcv9 cpu_info:127:cpu_info127:implementation SPARC-T3 (chipid 0, clock 1649 MHz) cpu_info:127:cpu_info127:pg_id 49 cpu_info:127:cpu_info127:snaptime 9305222.60819247 cpu_info:127:cpu_info127:state off-line cpu_info:127:cpu_info127:state_begin 1430258903 cpu_info:127:cpu_info127:supported_frequencies_Hz 1648762500 END allow(@plugin).to receive(:shell_out).with("kstat -p cpu_info").and_return(mock_shell_out(0, kstatinfo_output, "")) @plugin.run end it "should get the total virtual processor count" do expect(@plugin["cpu"]["total"]).to eql(128) end it "should get the total processor count" do expect(@plugin["cpu"]["real"]).to eql(1) end it "should get the total core count" do expect(@plugin["cpu"]["cores"]).to eql(16) end it "should get the number of threads per core" do expect(@plugin["cpu"]["corethreads"]).to eql(8) end it "should get the total number of online cores" do expect(@plugin["cpu"]["cpustates"]["on-line"]).to eql(124) end it "should get the total number of offline cores" do expect(@plugin["cpu"]["cpustates"]["off-line"]).to eql(4) end describe "per-cpu information" do it "should include processor model names" do expect(@plugin["cpu"]["0"]["model_name"]).to eql("SPARC-T3") expect(@plugin["cpu"]["1"]["model_name"]).to eql("SPARC-T3") expect(@plugin["cpu"]["2"]["model_name"]).to eql("SPARC-T3") expect(@plugin["cpu"]["3"]["model_name"]).to eql("SPARC-T3") expect(@plugin["cpu"]["124"]["model_name"]).to eql("SPARC-T4") expect(@plugin["cpu"]["125"]["model_name"]).to eql("SPARC-T4") expect(@plugin["cpu"]["126"]["model_name"]).to eql("SPARC-T4") expect(@plugin["cpu"]["127"]["model_name"]).to eql("SPARC-T4") end it "should include processor sockets" do expect(@plugin["cpu"]["0"]["socket"]).to eql("0") expect(@plugin["cpu"]["1"]["socket"]).to eql("0") expect(@plugin["cpu"]["2"]["socket"]).to eql("0") expect(@plugin["cpu"]["3"]["socket"]).to eql("0") expect(@plugin["cpu"]["124"]["socket"]).to eql("0") expect(@plugin["cpu"]["125"]["socket"]).to eql("0") expect(@plugin["cpu"]["126"]["socket"]).to eql("0") expect(@plugin["cpu"]["127"]["socket"]).to eql("0") end it "should include processor MHz" do expect(@plugin["cpu"]["0"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["1"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["2"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["3"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["124"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["125"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["126"]["mhz"]).to eql("1649") expect(@plugin["cpu"]["127"]["mhz"]).to eql("1649") end it "should include processor core IDs" do expect(@plugin["cpu"]["0"]["core_id"]).to eql("1026") expect(@plugin["cpu"]["8"]["core_id"]).to eql("1033") expect(@plugin["cpu"]["16"]["core_id"]).to eql("1040") expect(@plugin["cpu"]["24"]["core_id"]).to eql("1047") expect(@plugin["cpu"]["32"]["core_id"]).to eql("1054") expect(@plugin["cpu"]["40"]["core_id"]).to eql("1061") expect(@plugin["cpu"]["48"]["core_id"]).to eql("1068") expect(@plugin["cpu"]["56"]["core_id"]).to eql("1075") expect(@plugin["cpu"]["64"]["core_id"]).to eql("1082") expect(@plugin["cpu"]["72"]["core_id"]).to eql("1089") expect(@plugin["cpu"]["80"]["core_id"]).to eql("1096") expect(@plugin["cpu"]["88"]["core_id"]).to eql("1103") expect(@plugin["cpu"]["96"]["core_id"]).to eql("1110") expect(@plugin["cpu"]["104"]["core_id"]).to eql("1117") expect(@plugin["cpu"]["112"]["core_id"]).to eql("1124") expect(@plugin["cpu"]["120"]["core_id"]).to eql("1131") end it "should include processor architecture" do expect(@plugin["cpu"]["0"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["1"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["2"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["3"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["124"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["125"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["126"]["arch"]).to eql("sparcv9") expect(@plugin["cpu"]["127"]["arch"]).to eql("sparcv9") end it "should include processor FPU type" do expect(@plugin["cpu"]["0"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["1"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["2"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["3"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["124"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["125"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["126"]["fpu_type"]).to eql("sparcv9") expect(@plugin["cpu"]["127"]["fpu_type"]).to eql("sparcv9") end it "should include processor state" do expect(@plugin["cpu"]["0"]["state"]).to eql("on-line") expect(@plugin["cpu"]["1"]["state"]).to eql("on-line") expect(@plugin["cpu"]["2"]["state"]).to eql("on-line") expect(@plugin["cpu"]["3"]["state"]).to eql("on-line") expect(@plugin["cpu"]["124"]["state"]).to eql("off-line") expect(@plugin["cpu"]["125"]["state"]).to eql("off-line") expect(@plugin["cpu"]["126"]["state"]).to eql("off-line") expect(@plugin["cpu"]["127"]["state"]).to eql("off-line") end end end end
sh9189/ohai
spec/unit/plugins/solaris2/cpu_spec.rb
Ruby
apache-2.0
129,894
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css"> <title>M-File Help: plot2</title> </head> <body> <table border="0" cellspacing="0" width="100%"> <tr class="subheader"> <td class="headertitle">M-File Help: plot2</td> <td class="subheader-left"><a href="matlab:open plot2">View code for plot2</a></td> </tr> </table> <h1>plot2</h1><p><span class="helptopic">Plot trajectories</span></p><p> <span style="color:red">plot2</span>(<strong>p</strong>) plots a line with coordinates taken from successive rows of <strong>p</strong>. <strong>p</strong> can be Nx2 or Nx3. </p> <p> If <strong>p</strong> has three dimensions, ie. Nx2xM or Nx3xM then the M trajectories are overlaid in the one plot. </p> <p> <span style="color:red">plot2</span>(<strong>p</strong>, <strong>ls</strong>) as above but the line style arguments <strong>ls</strong> are passed to plot. </p> <h2>See also</h2> <p> <a href="plot.html">plot</a></p> <hr> <table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table> <p class="copy">&copy; 1990-2014 Peter Corke.</p> </body></html>
sgabello1/calibration
vision/info/html/plot2.html
HTML
bsd-2-clause
1,278
// FIXME add some error checking // FIXME check order of async callbacks /** * @see http://mapbox.com/developers/api/ */ goog.provide('ol.source.TileJSON'); goog.provide('ol.tilejson'); goog.require('goog.asserts'); goog.require('goog.net.Jsonp'); goog.require('ol.Attribution'); goog.require('ol.TileRange'); goog.require('ol.TileUrlFunction'); goog.require('ol.extent'); goog.require('ol.proj'); goog.require('ol.source.State'); goog.require('ol.source.TileImage'); /** * @classdesc * Layer source for tile data in TileJSON format. * * @constructor * @extends {ol.source.TileImage} * @param {olx.source.TileJSONOptions} options TileJSON options. * @api stable */ ol.source.TileJSON = function(options) { goog.base(this, { attributions: options.attributions, crossOrigin: options.crossOrigin, projection: ol.proj.get('EPSG:3857'), state: ol.source.State.LOADING, tileLoadFunction: options.tileLoadFunction, wrapX: goog.isDef(options.wrapX) ? options.wrapX : true }); var request = new goog.net.Jsonp(options.url); request.send(undefined, goog.bind(this.handleTileJSONResponse, this)); }; goog.inherits(ol.source.TileJSON, ol.source.TileImage); /** * @protected * @param {TileJSON} tileJSON Tile JSON. */ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) { var epsg4326Projection = ol.proj.get('EPSG:4326'); var sourceProjection = this.getProjection(); var extent; if (goog.isDef(tileJSON.bounds)) { var transform = ol.proj.getTransformFromProjections( epsg4326Projection, sourceProjection); extent = ol.extent.applyTransform(tileJSON.bounds, transform); } if (goog.isDef(tileJSON.scheme)) { goog.asserts.assert(tileJSON.scheme == 'xyz', 'tileJSON-scheme is "xyz"'); } var minZoom = tileJSON.minzoom || 0; var maxZoom = tileJSON.maxzoom || 22; var tileGrid = ol.tilegrid.createXYZ({ extent: ol.tilegrid.extentFromProjection(sourceProjection), maxZoom: maxZoom, minZoom: minZoom }); this.tileGrid = tileGrid; this.tileUrlFunction = ol.TileUrlFunction.createFromTemplates(tileJSON.tiles); if (goog.isDef(tileJSON.attribution) && goog.isNull(this.getAttributions())) { var attributionExtent = goog.isDef(extent) ? extent : epsg4326Projection.getExtent(); /** @type {Object.<string, Array.<ol.TileRange>>} */ var tileRanges = {}; var z, zKey; for (z = minZoom; z <= maxZoom; ++z) { zKey = z.toString(); tileRanges[zKey] = [tileGrid.getTileRangeForExtentAndZ(attributionExtent, z)]; } this.setAttributions([ new ol.Attribution({ html: tileJSON.attribution, tileRanges: tileRanges }) ]); } this.setState(ol.source.State.READY); };
das-peter/ol3
src/ol/source/tilejsonsource.js
JavaScript
bsd-2-clause
2,771
#pragma once #include "Event.h" #include "TaskQueue.h" #include "PlotWindowOpenedBitmapType.h" #include "ChannelOpenedLineType.h" #include "ChannelOpenedText.h" #include "GridAlg.h" class PlotWindowOpenedLineType : public PlotWindowOpenedBitmapType { public: PlotWindowOpenedLineType(std::shared_ptr<ProcessOpened>); virtual std::shared_ptr<BaseProperty> CreatePropertyPage(); public: struct MaxValueEvent { double Max; double Min; }; SoraDbgPlot::Event::Event<MaxValueEvent> EventMaxValueChanged; void SetMaxValue(double maxValue); void SetMinValue(double maxValue); void UpdatePropertyMaxMin(double max, double min); void UpdatePropertyAutoScale(bool bAutoScale); void UpdatePropertyDataRange(size_t dataCount); virtual std::shared_ptr<SoraDbgPlot::Task::TaskSimple> TaskUpdate(); private: struct UpdateOperation { UpdateOperation() { param = std::make_shared<DrawLineParam>(); dataSize = std::make_shared<size_t>(0); bmp = 0; } ~UpdateOperation() { if (bmp) delete bmp; } Bitmap * bmp; std::vector<std::shared_ptr<ChannelOpened> > _vecChUpdate; std::vector<std::shared_ptr<ChannelOpenedLineType> > _vecChLineType; std::vector<std::shared_ptr<ChannelOpenedText> > _vecChText; std::shared_ptr<DrawLineParam> param; std::shared_ptr<size_t> dataSize; bool _applyAutoScale; }; std::shared_ptr<UpdateOperation> _operationUpdate; protected: double _maxValue; double _minValue; double _maxValueAfterAutoScale; double _minValueAfterAutoScale; protected: void DrawGrid(Graphics * g, const CRect &clientRect, double dispMax, double dispMin); virtual HRESULT AppendXmlProperty(IXMLDOMDocument *pDom, IXMLDOMElement *pParent); virtual HRESULT LoadXmlElement(MSXML2::IXMLDOMNodePtr pElement); virtual void OnCoordinateChanged(); virtual bool IsRangeSettingEnabled(); private: GridSolutionSolver gridSolutionSolver; void DrawGridLine(Graphics * g, double resolution, double yData, const CRect & clientRect, double dispMax, double dispMin); Gdiplus::REAL GetClientY(double y, const CRect & clientRect, double dispMax, double dispMin); };
khldragon/Sora
DebugTool/source/DbgPlotViewer/PlotWindowOpenedLineType.h
C
bsd-2-clause
2,115
/* * Copyright (c) 2016, Zolertia <http://www.zolertia.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is part of the Contiki operating system. * */ /** * \addtogroup zoul-examples * @{ * * \defgroup zoul-ac-dimmer-test Krida Electronics AC light dimmer test example * * Demonstrates the use of an AC dimmer with zero-crossing, connected to the * ADC1 and ADC2 pins (PA5 and PA4 respectively), powered over the D+5.1 pin * * @{ * * \file * A quick program to test an AC dimmer * \author * Antonio Lignan <alinan@zolertia.com> */ /*---------------------------------------------------------------------------*/ #include <stdio.h> #include "contiki.h" #include "dev/ac-dimmer.h" #include "lib/sensors.h" /*---------------------------------------------------------------------------*/ PROCESS(remote_ac_dimmer_process, "AC light dimmer test"); AUTOSTART_PROCESSES(&remote_ac_dimmer_process); /*---------------------------------------------------------------------------*/ static uint8_t dimming; static struct etimer et; /*---------------------------------------------------------------------------*/ PROCESS_THREAD(remote_ac_dimmer_process, ev, data) { PROCESS_BEGIN(); dimming = 0; SENSORS_ACTIVATE(ac_dimmer); printf("AC dimmer: min %u%% max %u%%\n", DIMMER_DEFAULT_MIN_DIMM_VALUE, DIMMER_DEFAULT_MAX_DIMM_VALUE); /* Set the lamp to 10% and wait a few seconds */ ac_dimmer.value(DIMMER_DEFAULT_MIN_DIMM_VALUE); etimer_set(&et, CLOCK_SECOND * 5); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); /* Upon testing for duty cycles lower than 10% there was noise (probably from * the triac), causing the driver to skip a beat, and from time to time made * the test lamp blink. This is easily reproducible by setting the dimmer to * 5% and using a logic analyzer on the SYNC and GATE pins. The noise was * picked-up also by the non-connected test probes of the logic analyser. * Nevertheless the difference between 10% and 2% bright-wise is almost * negligible */ while(1) { dimming += DIMMER_DEFAULT_MIN_DIMM_VALUE; if(dimming > DIMMER_DEFAULT_MAX_DIMM_VALUE) { dimming = DIMMER_DEFAULT_MIN_DIMM_VALUE; } ac_dimmer.value(dimming); printf("AC dimmer: light is now --> %u\n", ac_dimmer.status(SENSORS_ACTIVE)); etimer_set(&et, CLOCK_SECOND); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); } PROCESS_END(); } /*---------------------------------------------------------------------------*/ /** * @} * @} */
MohamedSeliem/contiki
examples/zolertia/zoul/test-ac-dimmer.c
C
bsd-3-clause
4,053
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import google.cloud.proto.logging.v2.logging_metrics_pb2 as google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2 import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 class MetricsServiceV2Stub(object): """Service for configuring logs-based metrics. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.ListLogMetrics = channel.unary_unary( '/google.logging.v2.MetricsServiceV2/ListLogMetrics', request_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.ListLogMetricsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.ListLogMetricsResponse.FromString, ) self.GetLogMetric = channel.unary_unary( '/google.logging.v2.MetricsServiceV2/GetLogMetric', request_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.GetLogMetricRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.FromString, ) self.CreateLogMetric = channel.unary_unary( '/google.logging.v2.MetricsServiceV2/CreateLogMetric', request_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.CreateLogMetricRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.FromString, ) self.UpdateLogMetric = channel.unary_unary( '/google.logging.v2.MetricsServiceV2/UpdateLogMetric', request_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.UpdateLogMetricRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.FromString, ) self.DeleteLogMetric = channel.unary_unary( '/google.logging.v2.MetricsServiceV2/DeleteLogMetric', request_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.DeleteLogMetricRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) class MetricsServiceV2Servicer(object): """Service for configuring logs-based metrics. """ def ListLogMetrics(self, request, context): """Lists logs-based metrics. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetLogMetric(self, request, context): """Gets a logs-based metric. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CreateLogMetric(self, request, context): """Creates a logs-based metric. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def UpdateLogMetric(self, request, context): """Creates or updates a logs-based metric. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DeleteLogMetric(self, request, context): """Deletes a logs-based metric. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_MetricsServiceV2Servicer_to_server(servicer, server): rpc_method_handlers = { 'ListLogMetrics': grpc.unary_unary_rpc_method_handler( servicer.ListLogMetrics, request_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.ListLogMetricsRequest.FromString, response_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.ListLogMetricsResponse.SerializeToString, ), 'GetLogMetric': grpc.unary_unary_rpc_method_handler( servicer.GetLogMetric, request_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.GetLogMetricRequest.FromString, response_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.SerializeToString, ), 'CreateLogMetric': grpc.unary_unary_rpc_method_handler( servicer.CreateLogMetric, request_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.CreateLogMetricRequest.FromString, response_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.SerializeToString, ), 'UpdateLogMetric': grpc.unary_unary_rpc_method_handler( servicer.UpdateLogMetric, request_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.UpdateLogMetricRequest.FromString, response_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.SerializeToString, ), 'DeleteLogMetric': grpc.unary_unary_rpc_method_handler( servicer.DeleteLogMetric, request_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.DeleteLogMetricRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'google.logging.v2.MetricsServiceV2', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
eoogbe/api-client-staging
generated/python/proto-google-cloud-logging-v2/google/cloud/proto/logging/v2/logging_metrics_pb2_grpc.py
Python
bsd-3-clause
5,957
#if 0 // // Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.16384 // // /// // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // Sampler sampler NA NA 0 1 // TextureF texture float4 3d 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float // SV_RENDERTARGETARRAYINDEX 0 x 1 RTINDEX uint // TEXCOORD 0 xyz 2 NONE float xyz // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_TARGET 0 xyzw 0 TARGET float xyzw // ps_4_0 dcl_sampler s0, mode_default dcl_resource_texture3d (float,float,float,float) t0 dcl_input_ps linear v2.xyz dcl_output o0.xyzw dcl_temps 1 sample r0.xyzw, v2.xyzx, t0.xyzw, s0 mov o0.xyz, r0.xxxx mov o0.w, l(1.000000) ret // Approximately 4 instruction slots used #endif const BYTE g_PS_PassthroughLum3D[] = { 68, 88, 66, 67, 139, 183, 126, 70, 59, 171, 117, 78, 58, 168, 253, 206, 241, 67, 236, 117, 1, 0, 0, 0, 176, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0, 0, 0, 100, 1, 0, 0, 152, 1, 0, 0, 52, 2, 0, 0, 82, 68, 69, 70, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, 109, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 100, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 83, 97, 109, 112, 108, 101, 114, 0, 84, 101, 120, 116, 117, 114, 101, 70, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 57, 46, 51, 48, 46, 57, 50, 48, 48, 46, 49, 54, 51, 56, 52, 0, 73, 83, 71, 78, 128, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 7, 7, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 83, 86, 95, 82, 69, 78, 68, 69, 82, 84, 65, 82, 71, 69, 84, 65, 82, 82, 65, 89, 73, 78, 68, 69, 88, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, 72, 68, 82, 148, 0, 0, 0, 64, 0, 0, 0, 37, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 40, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 114, 16, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, 70, 18, 16, 0, 2, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 114, 32, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
MIPS/external-chromium_org-third_party-angle
src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughlum3d11ps.h
C
bsd-3-clause
5,392
/* * Copyright (c) 2013 Chun-Ying Huang * * This file is part of GamingAnywhere (GA). * * GA is free software; you can redistribute it and/or modify it * under the terms of the 3-clause BSD License as published by the * Free Software Foundation: http://directory.fsf.org/wiki/License:BSD_3Clause * * GA 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. * * You should have received a copy of the 3-clause BSD License along with GA; * if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package org.gaminganywhere.gaclient.util; import org.gaminganywhere.gaclient.util.Pad.PartitionEventListener; import android.content.Context; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class GAControllerBasic extends GAController implements OnClickListener, PartitionEventListener { private Button buttonEsc = null; private Pad padLeft = null; public GAControllerBasic(Context context) { super(context); } public static String getName() { return "Basic"; } public static String getDescription() { return "Mouse buttons"; } @Override public void onDimensionChange(int width, int height) { int keyBtnWidth = width/13; int keyBtnHeight = height/9; int padSize = height*2/5; // must be called first! super.onDimensionChange(width, height); // button ESC buttonEsc = null; buttonEsc = new Button(getContext()); buttonEsc.setTextSize(10); buttonEsc.setText("ESC"); buttonEsc.setOnClickListener(this); placeView(buttonEsc, width-keyBtnWidth/5-keyBtnWidth, keyBtnHeight/3, keyBtnWidth, keyBtnHeight); // padLeft = null; padLeft = new Pad(getContext()); padLeft.setAlpha((float) 0.5); padLeft.setOnTouchListener(this); padLeft.setPartition(2); padLeft.setPartitionEventListener(this); placeView(padLeft, width/30, height-padSize-height/30, padSize, padSize); } @Override public boolean onTouch(View v, MotionEvent evt) { int count = evt.getPointerCount(); if(count==1 && v == padLeft) { if(((Pad) v).onTouch(evt)); return true; } // must be called last return super.onTouch(v, evt); } private int mouseButton = -1; private void emulateMouseButtons(int action, int part) { switch(action) { case MotionEvent.ACTION_DOWN: //case MotionEvent.ACTION_POINTER_DOWN: if(part == 0 || part == 2) mouseButton = SDL2.Button.LEFT; else mouseButton = SDL2.Button.RIGHT; this.sendMouseKey(true, mouseButton, getMouseX(), getMouseY()); break; case MotionEvent.ACTION_UP: //case MotionEvent.ACTION_POINTER_UP: if(mouseButton != -1) { sendMouseKey(false, mouseButton, getMouseX(), getMouseY()); mouseButton = -1; } break; } } @Override public void onPartitionEvent(View v, int action, int part) { if(v == padLeft) { emulateMouseButtons(action, part); return; } } @Override public void onClick(View v) { if(v == buttonEsc) { sendKeyEvent(true, SDL2.Scancode.ESCAPE, 0x1b, 0, 0); sendKeyEvent(false, SDL2.Scancode.ESCAPE, 0x1b, 0, 0); } } }
yunyu-Mr/gaminganywhere
ga/android/src/org/gaminganywhere/gaclient/util/GAControllerBasic.java
Java
bsd-3-clause
3,268
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build cgo // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows #include "libcgo.h" // Releases the cgo traceback context. void _cgo_release_context(uintptr_t ctxt) { void (*pfn)(struct context_arg*); pfn = _cgo_get_context_function(); if (ctxt != 0 && pfn != nil) { struct context_arg arg; arg.Context = ctxt; (*pfn)(&arg); } }
adamluo159/go
src/runtime/cgo/gcc_context.c
C
bsd-3-clause
526
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements runtime support for signal handling. // // Most synchronization primitives are not available from // the signal handler (it cannot block, allocate memory, or use locks) // so the handler communicates with a processing goroutine // via struct sig, below. // // sigsend is called by the signal handler to queue a new signal. // signal_recv is called by the Go program to receive a newly queued signal. // Synchronization between sigsend and signal_recv is based on the sig.state // variable. It can be in 3 states: sigIdle, sigReceiving and sigSending. // sigReceiving means that signal_recv is blocked on sig.Note and there are no // new pending signals. // sigSending means that sig.mask *may* contain new pending signals, // signal_recv can't be blocked in this state. // sigIdle means that there are no new pending signals and signal_recv is not blocked. // Transitions between states are done atomically with CAS. // When signal_recv is unblocked, it resets sig.Note and rechecks sig.mask. // If several sigsends and signal_recv execute concurrently, it can lead to // unnecessary rechecks of sig.mask, but it cannot lead to missed signals // nor deadlocks. // +build !plan9 package runtime import ( "runtime/internal/atomic" "unsafe" ) var sig struct { note note mask [(_NSIG + 31) / 32]uint32 wanted [(_NSIG + 31) / 32]uint32 recv [(_NSIG + 31) / 32]uint32 state uint32 inuse bool } const ( sigIdle = iota sigReceiving sigSending ) // Called from sighandler to send a signal back out of the signal handling thread. // Reports whether the signal was sent. If not, the caller typically crashes the program. func sigsend(s uint32) bool { bit := uint32(1) << uint(s&31) if !sig.inuse || s >= uint32(32*len(sig.wanted)) || sig.wanted[s/32]&bit == 0 { return false } // Add signal to outgoing queue. for { mask := sig.mask[s/32] if mask&bit != 0 { return true // signal already in queue } if atomic.Cas(&sig.mask[s/32], mask, mask|bit) { break } } // Notify receiver that queue has new bit. Send: for { switch atomic.Load(&sig.state) { default: throw("sigsend: inconsistent state") case sigIdle: if atomic.Cas(&sig.state, sigIdle, sigSending) { break Send } case sigSending: // notification already pending break Send case sigReceiving: if atomic.Cas(&sig.state, sigReceiving, sigIdle) { notewakeup(&sig.note) break Send } } } return true } // Called to receive the next queued signal. // Must only be called from a single goroutine at a time. //go:linkname signal_recv os/signal.signal_recv func signal_recv() uint32 { for { // Serve any signals from local copy. for i := uint32(0); i < _NSIG; i++ { if sig.recv[i/32]&(1<<(i&31)) != 0 { sig.recv[i/32] &^= 1 << (i & 31) return i } } // Wait for updates to be available from signal sender. Receive: for { switch atomic.Load(&sig.state) { default: throw("signal_recv: inconsistent state") case sigIdle: if atomic.Cas(&sig.state, sigIdle, sigReceiving) { notetsleepg(&sig.note, -1) noteclear(&sig.note) break Receive } case sigSending: if atomic.Cas(&sig.state, sigSending, sigIdle) { break Receive } } } // Incorporate updates from sender into local copy. for i := range sig.mask { sig.recv[i] = atomic.Xchg(&sig.mask[i], 0) } } } // Must only be called from a single goroutine at a time. //go:linkname signal_enable os/signal.signal_enable func signal_enable(s uint32) { if !sig.inuse { // The first call to signal_enable is for us // to use for initialization. It does not pass // signal information in m. sig.inuse = true // enable reception of signals; cannot disable noteclear(&sig.note) return } if s >= uint32(len(sig.wanted)*32) { return } sig.wanted[s/32] |= 1 << (s & 31) sigenable(s) } // Must only be called from a single goroutine at a time. //go:linkname signal_disable os/signal.signal_disable func signal_disable(s uint32) { if s >= uint32(len(sig.wanted)*32) { return } sig.wanted[s/32] &^= 1 << (s & 31) sigdisable(s) } // Must only be called from a single goroutine at a time. //go:linkname signal_ignore os/signal.signal_ignore func signal_ignore(s uint32) { if s >= uint32(len(sig.wanted)*32) { return } sig.wanted[s/32] &^= 1 << (s & 31) sigignore(s) } // This runs on a foreign stack, without an m or a g. No stack split. //go:nosplit //go:norace func badsignal(sig uintptr) { cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig)) } func badsignalgo(sig uintptr) { if !sigsend(uint32(sig)) { // A foreign thread received the signal sig, and the // Go code does not want to handle it. raisebadsignal(int32(sig)) } }
deft-code/go
src/runtime/sigqueue.go
GO
bsd-3-clause
4,964
using System.Collections; using System.Collections.Generic; using System.Linq; using WebsitePanel.EnterpriseServer; using WebsitePanel.WebDavPortal.WebConfigSections; namespace WebsitePanel.WebDav.Core.Config.Entities { public class OfficeOnlineCollection : AbstractConfigCollection, IReadOnlyCollection<OfficeOnlineElement> { private readonly IList<OfficeOnlineElement> _officeExtensions; public OfficeOnlineCollection() { NewFilePath = ConfigSection.OfficeOnline.CobaltNewFilePath; CobaltFileTtl = ConfigSection.OfficeOnline.CobaltFileTtl; _officeExtensions = ConfigSection.OfficeOnline.Cast<OfficeOnlineElement>().ToList(); } public bool IsEnabled { get { return GetWebdavSystemSettigns().GetValueOrDefault(EnterpriseServer.SystemSettings.WEBDAV_OWA_ENABLED_KEY, false); } } public string Url { get { return GetWebdavSystemSettigns().GetValueOrDefault(EnterpriseServer.SystemSettings.WEBDAV_OWA_URL, string.Empty); } } private SystemSettings GetWebdavSystemSettigns() { return WspContext.Services.Organizations.GetWebDavSystemSettings() ?? new SystemSettings(); } public string NewFilePath { get; private set; } public int CobaltFileTtl { get; private set; } public IEnumerator<OfficeOnlineElement> GetEnumerator() { return _officeExtensions.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public int Count { get { return _officeExtensions.Count; } } public bool Contains(string extension) { return _officeExtensions.Any(x=>x.Extension == extension); } } }
simonegli8/Websitepanel
WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/OfficeOnlineCollection.cs
C#
bsd-3-clause
1,991
// Copyright (c) 2015, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // - Neither the name of the Outercurve Foundation nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Collections.Generic; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; using WebsitePanel.Portal.Code.Framework; namespace WebsitePanel.Portal.UserControls.ScheduleTaskView { public partial class BackupDatabase : EmptyView { private static readonly string BackupFolderParameter = "BACKUP_FOLDER"; private static readonly string DatabaseNameParameter = "DATABASE_NAME"; private static readonly string DatabaseGroupParameter = "DATABASE_GROUP"; private static readonly string BackupNameParameter = "BACKUP_NAME"; private static readonly string ZipBackupParameter = "ZIP_BACKUP"; protected void Page_Load(object sender, EventArgs e) { } /// <summary> /// Sets scheduler task parameters on view. /// </summary> /// <param name="parameters">Parameters list to be set on view.</param> public override void SetParameters(ScheduleTaskParameterInfo[] parameters) { base.SetParameters(parameters); this.SetParameter(this.ddlDatabaseType, DatabaseGroupParameter); this.SetParameter(this.txtDatabaseName, DatabaseNameParameter); this.SetParameter(this.txtBackupFolder, BackupFolderParameter); this.SetParameter(this.txtBackupName, BackupNameParameter); this.SetParameter(this.ddlZipBackup, ZipBackupParameter); } /// <summary> /// Gets scheduler task parameters from view. /// </summary> /// <returns>Parameters list filled from view.</returns> public override ScheduleTaskParameterInfo[] GetParameters() { ScheduleTaskParameterInfo databaseGroup = this.GetParameter(this.ddlDatabaseType, DatabaseGroupParameter); ScheduleTaskParameterInfo databaseName = this.GetParameter(this.txtDatabaseName, DatabaseNameParameter); ScheduleTaskParameterInfo backupFolder = this.GetParameter(this.txtBackupFolder, BackupFolderParameter); ScheduleTaskParameterInfo backupName = this.GetParameter(this.txtBackupName, BackupNameParameter); ScheduleTaskParameterInfo zipBackup = this.GetParameter(this.ddlZipBackup, ZipBackupParameter); return new ScheduleTaskParameterInfo[5] { databaseGroup, databaseName, backupFolder, backupName, zipBackup}; } } }
simonegli8/Websitepanel
WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/BackupDatabase.ascx.cs
C#
bsd-3-clause
4,108
extern "C" { #include <linux/errno.h> #include <linux/xxhash.h> } #include <gtest/gtest.h> #include <array> #include <iostream> #include <memory> #include <string> #define XXH_STATIC_LINKING_ONLY #include <xxhash.h> using namespace std; namespace { const std::array<std::string, 11> kTestInputs = { "", "0", "01234", "0123456789abcde", "0123456789abcdef", "0123456789abcdef0", "0123456789abcdef0123", "0123456789abcdef0123456789abcde", "0123456789abcdef0123456789abcdef", "0123456789abcdef0123456789abcdef0", "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", }; bool testXXH32(const void *input, const size_t length, uint32_t seed) { return XXH32(input, length, seed) == xxh32(input, length, seed); } bool testXXH64(const void *input, const size_t length, uint32_t seed) { return XXH64(input, length, seed) == xxh64(input, length, seed); } class XXH32State { struct xxh32_state kernelState; XXH32_state_t state; public: explicit XXH32State(const uint32_t seed) { reset(seed); } XXH32State(XXH32State const& other) noexcept { xxh32_copy_state(&kernelState, &other.kernelState); XXH32_copyState(&state, &other.state); } XXH32State& operator=(XXH32State const& other) noexcept { xxh32_copy_state(&kernelState, &other.kernelState); XXH32_copyState(&state, &other.state); return *this; } void reset(const uint32_t seed) { xxh32_reset(&kernelState, seed); EXPECT_EQ(0, XXH32_reset(&state, seed)); } void update(const void *input, const size_t length) { EXPECT_EQ(0, xxh32_update(&kernelState, input, length)); EXPECT_EQ(0, (int)XXH32_update(&state, input, length)); } bool testDigest() const { return xxh32_digest(&kernelState) == XXH32_digest(&state); } }; class XXH64State { struct xxh64_state kernelState; XXH64_state_t state; public: explicit XXH64State(const uint64_t seed) { reset(seed); } XXH64State(XXH64State const& other) noexcept { xxh64_copy_state(&kernelState, &other.kernelState); XXH64_copyState(&state, &other.state); } XXH64State& operator=(XXH64State const& other) noexcept { xxh64_copy_state(&kernelState, &other.kernelState); XXH64_copyState(&state, &other.state); return *this; } void reset(const uint64_t seed) { xxh64_reset(&kernelState, seed); EXPECT_EQ(0, XXH64_reset(&state, seed)); } void update(const void *input, const size_t length) { EXPECT_EQ(0, xxh64_update(&kernelState, input, length)); EXPECT_EQ(0, (int)XXH64_update(&state, input, length)); } bool testDigest() const { return xxh64_digest(&kernelState) == XXH64_digest(&state); } }; } TEST(Simple, Null) { EXPECT_TRUE(testXXH32(NULL, 0, 0)); EXPECT_TRUE(testXXH64(NULL, 0, 0)); } TEST(Stream, Null) { struct xxh32_state state32; xxh32_reset(&state32, 0); EXPECT_EQ(-EINVAL, xxh32_update(&state32, NULL, 0)); struct xxh64_state state64; xxh64_reset(&state64, 0); EXPECT_EQ(-EINVAL, xxh64_update(&state64, NULL, 0)); } TEST(Simple, TestInputs) { for (uint32_t seed = 0; seed < 100000; seed = (seed + 1) * 3) { for (auto const input : kTestInputs) { EXPECT_TRUE(testXXH32(input.data(), input.size(), seed)); EXPECT_TRUE(testXXH64(input.data(), input.size(), (uint64_t)seed)); } } } TEST(Stream, TestInputs) { for (uint32_t seed = 0; seed < 100000; seed = (seed + 1) * 3) { for (auto const input : kTestInputs) { XXH32State s32(seed); XXH64State s64(seed); s32.update(input.data(), input.size()); s64.update(input.data(), input.size()); EXPECT_TRUE(s32.testDigest()); EXPECT_TRUE(s64.testDigest()); } } } TEST(Stream, MultipleTestInputs) { for (uint32_t seed = 0; seed < 100000; seed = (seed + 1) * 3) { XXH32State s32(seed); XXH64State s64(seed); for (auto const input : kTestInputs) { s32.update(input.data(), input.size()); s64.update(input.data(), input.size()); } EXPECT_TRUE(s32.testDigest()); EXPECT_TRUE(s64.testDigest()); } } TEST(Stream, CopyState) { for (uint32_t seed = 0; seed < 100000; seed = (seed + 1) * 3) { XXH32State s32(seed); XXH64State s64(seed); for (auto const input : kTestInputs) { auto t32(s32); t32.update(input.data(), input.size()); s32 = t32; auto t64(s64); t64.update(input.data(), input.size()); s64 = t64; } EXPECT_TRUE(s32.testDigest()); EXPECT_TRUE(s64.testDigest()); } }
mururu/zstd-erlang
priv/zstd/contrib/linux-kernel/test/XXHashUserlandTest.cpp
C++
bsd-3-clause
4,474
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @package Zend_XmlRpc * @subpackage Server * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_XmlRpc_Value */ require_once 'Zend/XmlRpc/Value.php'; /** * Zend_XmlRpc_Exception */ require_once 'Zend/XmlRpc/Exception.php'; /** * XMLRPC Faults * * Container for XMLRPC faults, containing both a code and a message; * additionally, has methods for determining if an XML response is an XMLRPC * fault, as well as generating the XML for an XMLRPC fault response. * * To allow method chaining, you may only use the {@link getInstance()} factory * to instantiate a Zend_XmlRpc_Server_Fault. * * @category Zend * @package Zend_XmlRpc * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Fault { /** * Fault code * @var int */ protected $_code; /** * Fault character encoding * @var string */ protected $_encoding = 'UTF-8'; /** * Fault message * @var string */ protected $_message; /** * Internal fault codes => messages * @var array */ protected $_internal = array( 404 => 'Unknown Error', // 610 - 619 reflection errors 610 => 'Invalid method class', 611 => 'Unable to attach function or callback; not callable', 612 => 'Unable to load array; not an array', 613 => 'One or more method records are corrupt or otherwise unusable', // 620 - 629 dispatch errors 620 => 'Method does not exist', 621 => 'Error instantiating class to invoke method', 622 => 'Method missing implementation', 623 => 'Calling parameters do not match signature', // 630 - 639 request errors 630 => 'Unable to read request', 631 => 'Failed to parse request', 632 => 'Invalid request, no method passed; request must contain a \'methodName\' tag', 633 => 'Param must contain a value', 634 => 'Invalid method name', 635 => 'Invalid XML provided to request', 636 => 'Error creating xmlrpc value', // 640 - 649 system.* errors 640 => 'Method does not exist', // 650 - 659 response errors 650 => 'Invalid XML provided for response', 651 => 'Failed to parse response', 652 => 'Invalid response', 653 => 'Invalid XMLRPC value in response', ); /** * Constructor * * @return Zend_XmlRpc_Fault */ public function __construct($code = 404, $message = '') { $this->setCode($code); $code = $this->getCode(); if (empty($message) && isset($this->_internal[$code])) { $message = $this->_internal[$code]; } elseif (empty($message)) { $message = 'Unknown error'; } $this->setMessage($message); } /** * Set the fault code * * @param int $code * @return Zend_XmlRpc_Fault */ public function setCode($code) { $this->_code = (int) $code; return $this; } /** * Return fault code * * @return int */ public function getCode() { return $this->_code; } /** * Retrieve fault message * * @param string * @return Zend_XmlRpc_Fault */ public function setMessage($message) { $this->_message = (string) $message; return $this; } /** * Retrieve fault message * * @return string */ public function getMessage() { return $this->_message; } /** * Set encoding to use in fault response * * @param string $encoding * @return Zend_XmlRpc_Fault */ public function setEncoding($encoding) { $this->_encoding = $encoding; return $this; } /** * Retrieve current fault encoding * * @return string */ public function getEncoding() { return $this->_encoding; } /** * Load an XMLRPC fault from XML * * @param string $fault * @return boolean Returns true if successfully loaded fault response, false * if response was not a fault response * @throws Zend_XmlRpc_Exception if no or faulty XML provided, or if fault * response does not contain either code or message */ public function loadXml($fault) { if (!is_string($fault)) { throw new Zend_XmlRpc_Exception('Invalid XML provided to fault'); } try { $xml = @new SimpleXMLElement($fault); } catch (Exception $e) { // Not valid XML throw new Zend_XmlRpc_Exception('Failed to parse XML fault: ' . $e->getMessage(), 500); } // Check for fault if (!$xml->fault) { // Not a fault return false; } if (!$xml->fault->value->struct) { // not a proper fault throw new Zend_XmlRpc_Exception('Invalid fault structure', 500); } $structXml = $xml->fault->value->asXML(); $structXml = preg_replace('/<\?xml version=.*?\?>/i', '', $structXml); $struct = Zend_XmlRpc_Value::getXmlRpcValue(trim($structXml), Zend_XmlRpc_Value::XML_STRING); $struct = $struct->getValue(); if (isset($struct['faultCode'])) { $code = $struct['faultCode']; } if (isset($struct['faultString'])) { $message = $struct['faultString']; } if (empty($code) && empty($message)) { throw new Zend_XmlRpc_Exception('Fault code and string required'); } if (empty($code)) { $code = '404'; } if (empty($message)) { if (isset($this->_internal[$code])) { $message = $this->_internal[$code]; } else { $message = 'Unknown Error'; } } $this->setCode($code); $this->setMessage($message); return true; } /** * Determine if an XML response is an XMLRPC fault * * @param string $xml * @return boolean */ public static function isFault($xml) { $fault = new self(); try { $isFault = $fault->loadXml($xml); } catch (Zend_XmlRpc_Exception $e) { $isFault = false; } return $isFault; } /** * Serialize fault to XML * * @return string */ public function saveXML() { // Create fault value $faultStruct = array( 'faultCode' => $this->getCode(), 'faultString' => $this->getMessage() ); $value = Zend_XmlRpc_Value::getXmlRpcValue($faultStruct); $valueDOM = new DOMDocument('1.0', $this->getEncoding()); $valueDOM->loadXML($value->saveXML()); // Build response XML $dom = new DOMDocument('1.0', $this->getEncoding()); $r = $dom->appendChild($dom->createElement('methodResponse')); $f = $r->appendChild($dom->createElement('fault')); $f->appendChild($dom->importNode($valueDOM->documentElement, 1)); return $dom->saveXML(); } /** * Return XML fault response * * @return string */ public function __toString() { return $this->saveXML(); } }
raspi/zfcomicengine
library/Zend/XmlRpc/Fault.php
PHP
bsd-3-clause
8,035
/* * OpenSeadragon - Rect * * Copyright (C) 2009 CodePlex Foundation * Copyright (C) 2010-2013 OpenSeadragon contributors * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of CodePlex Foundation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function( $ ){ /** * @class Rect * @classdesc A Rectangle really represents a 2x2 matrix where each row represents a * 2 dimensional vector component, the first is (x,y) and the second is * (width, height). The latter component implies the equation of a simple * plane. * * @memberof OpenSeadragon * @param {Number} x The vector component 'x'. * @param {Number} y The vector component 'y'. * @param {Number} width The vector component 'height'. * @param {Number} height The vector component 'width'. */ $.Rect = function( x, y, width, height ) { /** * The vector component 'x'. * @member {Number} x * @memberof OpenSeadragon.Rect# */ this.x = typeof ( x ) == "number" ? x : 0; /** * The vector component 'y'. * @member {Number} y * @memberof OpenSeadragon.Rect# */ this.y = typeof ( y ) == "number" ? y : 0; /** * The vector component 'width'. * @member {Number} width * @memberof OpenSeadragon.Rect# */ this.width = typeof ( width ) == "number" ? width : 0; /** * The vector component 'height'. * @member {Number} height * @memberof OpenSeadragon.Rect# */ this.height = typeof ( height ) == "number" ? height : 0; }; $.Rect.prototype = /** @lends OpenSeadragon.Rect.prototype */{ /** * @function * @returns {OpenSeadragon.Rect} a duplicate of this Rect */ clone: function() { return new $.Rect(this.x, this.y, this.width, this.height); }, /** * The aspect ratio is simply the ratio of width to height. * @function * @returns {Number} The ratio of width to height. */ getAspectRatio: function() { return this.width / this.height; }, /** * Provides the coordinates of the upper-left corner of the rectangle as a * point. * @function * @returns {OpenSeadragon.Point} The coordinate of the upper-left corner of * the rectangle. */ getTopLeft: function() { return new $.Point( this.x, this.y ); }, /** * Provides the coordinates of the bottom-right corner of the rectangle as a * point. * @function * @returns {OpenSeadragon.Point} The coordinate of the bottom-right corner of * the rectangle. */ getBottomRight: function() { return new $.Point( this.x + this.width, this.y + this.height ); }, /** * Provides the coordinates of the top-right corner of the rectangle as a * point. * @function * @returns {OpenSeadragon.Point} The coordinate of the top-right corner of * the rectangle. */ getTopRight: function() { return new $.Point( this.x + this.width, this.y ); }, /** * Provides the coordinates of the bottom-left corner of the rectangle as a * point. * @function * @returns {OpenSeadragon.Point} The coordinate of the bottom-left corner of * the rectangle. */ getBottomLeft: function() { return new $.Point( this.x, this.y + this.height ); }, /** * Computes the center of the rectangle. * @function * @returns {OpenSeadragon.Point} The center of the rectangle as represented * as represented by a 2-dimensional vector (x,y) */ getCenter: function() { return new $.Point( this.x + this.width / 2.0, this.y + this.height / 2.0 ); }, /** * Returns the width and height component as a vector OpenSeadragon.Point * @function * @returns {OpenSeadragon.Point} The 2 dimensional vector representing the * the width and height of the rectangle. */ getSize: function() { return new $.Point( this.width, this.height ); }, /** * Determines if two Rectangles have equivalent components. * @function * @param {OpenSeadragon.Rect} rectangle The Rectangle to compare to. * @return {Boolean} 'true' if all components are equal, otherwise 'false'. */ equals: function( other ) { return ( other instanceof $.Rect ) && ( this.x === other.x ) && ( this.y === other.y ) && ( this.width === other.width ) && ( this.height === other.height ); }, /** * Multiply all dimensions in this Rect by a factor and return a new Rect. * @function * @param {Number} factor The factor to multiply vector components. * @returns {OpenSeadragon.Rect} A new rect representing the multiplication * of the vector components by the factor */ times: function( factor ) { return new OpenSeadragon.Rect( this.x * factor, this.y * factor, this.width * factor, this.height * factor ); }, /** * Returns the smallest rectangle that will contain this and the given rectangle. * @param {OpenSeadragon.Rect} rect * @return {OpenSeadragon.Rect} The new rectangle. */ // ---------- union: function(rect) { var left = Math.min(this.x, rect.x); var top = Math.min(this.y, rect.y); var right = Math.max(this.x + this.width, rect.x + rect.width); var bottom = Math.max(this.y + this.height, rect.y + rect.height); return new OpenSeadragon.Rect(left, top, right - left, bottom - top); }, /** * Rotates a rectangle around a point. Currently only 90, 180, and 270 * degrees are supported. * @function * @param {Number} degrees The angle in degrees to rotate. * @param {OpenSeadragon.Point} pivot The point about which to rotate. * Defaults to the center of the rectangle. * @return {OpenSeadragon.Rect} */ rotate: function( degrees, pivot ) { // TODO support arbitrary rotation var width = this.width, height = this.height, newTopLeft; degrees = ( degrees + 360 ) % 360; if (degrees % 90 !== 0) { throw new Error('Currently only 0, 90, 180, and 270 degrees are supported.'); } if( degrees === 0 ){ return new $.Rect( this.x, this.y, this.width, this.height ); } pivot = pivot || this.getCenter(); switch ( degrees ) { case 90: newTopLeft = this.getBottomLeft(); width = this.height; height = this.width; break; case 180: newTopLeft = this.getBottomRight(); break; case 270: newTopLeft = this.getTopRight(); width = this.height; height = this.width; break; default: newTopLeft = this.getTopLeft(); break; } newTopLeft = newTopLeft.rotate(degrees, pivot); return new $.Rect(newTopLeft.x, newTopLeft.y, width, height); }, /** * Provides a string representation of the rectangle which is useful for * debugging. * @function * @returns {String} A string representation of the rectangle. */ toString: function() { return "[" + (Math.round(this.x*100) / 100) + "," + (Math.round(this.y*100) / 100) + "," + (Math.round(this.width*100) / 100) + "x" + (Math.round(this.height*100) / 100) + "]"; } }; }( OpenSeadragon ));
ricochet2200/openseadragon
src/rectangle.js
JavaScript
bsd-3-clause
9,255
// +build OMIT package main import ( "bytes" "fmt" "io" "os" ) var ( _ = bytes.Buffer{} _ = os.Stdout ) // WriteCounter tracks the total number of bytes written. type WriteCounter struct { io.ReadWriter count int } func (w *WriteCounter) Write(b []byte) (int, error) { w.count += len(b) return w.ReadWriter.Write(b) } // MAIN OMIT func main() { buf := &bytes.Buffer{} w := &WriteCounter{ReadWriter: buf} fmt.Fprintf(w, "Hello, gophers!\n") fmt.Printf("Printed %v bytes", w.count) }
muzining/net
x/talks/2014/go4java/writecounter.go
GO
bsd-3-clause
503
''' Test idlelib.debugger. Coverage: 19% ''' from idlelib import debugger from test.support import requires requires('gui') import unittest from tkinter import Tk class NameSpaceTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.root = Tk() cls.root.withdraw() @classmethod def tearDownClass(cls): cls.root.destroy() del cls.root def test_init(self): debugger.NamespaceViewer(self.root, 'Test') if __name__ == '__main__': unittest.main(verbosity=2)
yotchang4s/cafebabepy
src/main/python/idlelib/idle_test/test_debugger.py
Python
bsd-3-clause
533
// Copyright (c) 2015, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // - Neither the name of the Outercurve Foundation nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { public partial class Statistics { protected WebsitePanel.Portal.UserControls.SpaceServiceItems itemsList; } }
simonegli8/Websitepanel
WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Statistics.ascx.designer.cs
C#
bsd-3-clause
2,246
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ #define ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ #include "ash/ash_export.h" #include "base/basictypes.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/slide_animation.h" namespace ash { namespace internal { // Delegate is notified any time the background changes. class ASH_EXPORT BackgroundAnimatorDelegate { public: virtual void UpdateBackground(int alpha) = 0; protected: virtual ~BackgroundAnimatorDelegate() {} }; // BackgroundAnimator is used by the launcher and system tray to animate the // background (alpha). class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate { public: // How the background can be changed. enum ChangeType { CHANGE_ANIMATE, CHANGE_IMMEDIATE }; BackgroundAnimator(BackgroundAnimatorDelegate* delegate, int min_alpha, int max_alpha); virtual ~BackgroundAnimator(); // Sets whether a background is rendered. Initial value is false. If |type| // is |CHANGE_IMMEDIATE| and an animation is not in progress this notifies // the delegate immediately (synchronously from this method). void SetPaintsBackground(bool value, ChangeType type); bool paints_background() const { return paints_background_; } // Current alpha. int alpha() const { return alpha_; } // ui::AnimationDelegate overrides: virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; private: BackgroundAnimatorDelegate* delegate_; const int min_alpha_; const int max_alpha_; ui::SlideAnimation animation_; // Whether the background is painted. bool paints_background_; // Current alpha value of the background. int alpha_; DISALLOW_COPY_AND_ASSIGN(BackgroundAnimator); }; } // namespace internal } // namespace ash #endif // ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_
zcbenz/cefode-chromium
ash/launcher/background_animator.h
C
bsd-3-clause
2,047
#!/usr/bin/env python '''Test RGBA load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk). You should see the rgba.png image on a checkboard background. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_load import sys if sys.platform == 'linux2': from pyglet.image.codecs.gdkpixbuf2 import GdkPixbuf2ImageDecoder as dclass elif sys.platform in ('win32', 'cygwin'): from pyglet.image.codecs.gdiplus import GDIPlusDecoder as dclass elif sys.platform == 'darwin': from pyglet import options as pyglet_options if pyglet_options['darwin_cocoa']: from pyglet.image.codecs.quartz import QuartzImageDecoder as dclass else: from pyglet.image.codecs.quicktime import QuickTimeImageDecoder as dclass class TEST_PLATFORM_RGBA_LOAD(base_load.TestLoad): texture_file = 'rgba.png' decoder = dclass() if __name__ == '__main__': unittest.main()
mpasternak/pyglet-fix-issue-518-522
tests/image/PLATFORM_RGBA_LOAD.py
Python
bsd-3-clause
963
// Copyright (c) 2015, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // - Neither the name of the Outercurve Foundation nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Collections.Generic; using System.Text; namespace WebsitePanel.Providers.HostedSolution { [Serializable] public class ExchangeMailboxPlanRetentionPolicyTag { int planTagID; [LogProperty] public int PlanTagID { get { return planTagID; } set { planTagID = value; } } int tagID; [LogProperty] public int TagID { get { return tagID; } set { tagID = value; } } int mailboxPlanId; public int MailboxPlanId { get { return mailboxPlanId; } set { mailboxPlanId = value; } } string mailboxPlan; [LogProperty] public string MailboxPlan { get { return mailboxPlan; } set { mailboxPlan = value; } } string tagName; [LogProperty] public string TagName { get { return tagName; } set { tagName = value; } } } }
titan68/Websitepanel
WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlanRetentionPolicyTag.cs
C#
bsd-3-clause
2,784
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_SHELL_BROWSER_SHELL_CONTENT_INDEX_PROVIDER_H_ #define CONTENT_SHELL_BROWSER_SHELL_CONTENT_INDEX_PROVIDER_H_ #include <map> #include <string> #include <vector> #include "base/memory/weak_ptr.h" #include "content/public/browser/content_index_provider.h" #include "ui/gfx/geometry/size.h" #include "url/origin.h" namespace content { // When using ShellContentIndexProvider, IDs need to be globally unique, // instead of per Service Worker. class ShellContentIndexProvider : public ContentIndexProvider { public: ShellContentIndexProvider(); ShellContentIndexProvider(const ShellContentIndexProvider&) = delete; ShellContentIndexProvider& operator=(const ShellContentIndexProvider&) = delete; ~ShellContentIndexProvider() override; // ContentIndexProvider implementation. std::vector<gfx::Size> GetIconSizes( blink::mojom::ContentCategory category) override; void OnContentAdded(ContentIndexEntry entry) override; void OnContentDeleted(int64_t service_worker_registration_id, const url::Origin& origin, const std::string& description_id) override; // Returns the Service Worker Registration ID and the origin of the Content // Index entry registered with |id|. If |id| does not exist, invalid values // are returned, which would cause DB tasks to fail. std::pair<int64_t, url::Origin> GetRegistrationDataFromId( const std::string& id); void set_icon_sizes(std::vector<gfx::Size> icon_sizes) { icon_sizes_ = std::move(icon_sizes); } private: // Map from |description_id| to <|service_worker_registration_id|, |origin|>. std::map<std::string, std::pair<int64_t, url::Origin>> entries_; std::vector<gfx::Size> icon_sizes_; }; } // namespace content #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_INDEX_PROVIDER_H_
chromium/chromium
content/shell/browser/shell_content_index_provider.h
C
bsd-3-clause
2,009
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Routing; namespace Orchard.UI.Navigation { public static class NavigationHelper { /// <summary> /// Populates the menu shapes. /// </summary> /// <param name="shapeFactory">The shape factory.</param> /// <param name="parentShape">The menu parent shape.</param> /// <param name="menu">The menu shape.</param> /// <param name="menuItems">The current level to populate.</param> public static void PopulateMenu(dynamic shapeFactory, dynamic parentShape, dynamic menu, IEnumerable<MenuItem> menuItems) { foreach (MenuItem menuItem in menuItems) { dynamic menuItemShape = BuildMenuItemShape(shapeFactory, parentShape, menu, menuItem); if (menuItem.Items != null && menuItem.Items.Any()) { PopulateMenu(shapeFactory, menuItemShape, menu, menuItem.Items); } parentShape.Add(menuItemShape, menuItem.Position); } } /// <summary> /// Populates the local menu starting from the first non local task parent. /// </summary> /// <param name="shapeFactory">The shape factory.</param> /// <param name="parentShape">The menu parent shape.</param> /// <param name="menu">The menu shape.</param> /// <param name="selectedPath">The selection path.</param> public static void PopulateLocalMenu(dynamic shapeFactory, dynamic parentShape, dynamic menu, Stack<MenuItem> selectedPath) { MenuItem parentMenuItem = FindParentLocalTask(selectedPath); // find childs tabs and expand them if (parentMenuItem != null && parentMenuItem.Items != null && parentMenuItem.Items.Any()) { PopulateLocalMenu(shapeFactory, parentShape, menu, parentMenuItem.Items); } } /// <summary> /// Populates the local menu shapes. /// </summary> /// <param name="shapeFactory">The shape factory.</param> /// <param name="parentShape">The menu parent shape.</param> /// <param name="menu">The menu shape.</param> /// <param name="menuItems">The current level to populate.</param> public static void PopulateLocalMenu(dynamic shapeFactory, dynamic parentShape, dynamic menu, IEnumerable<MenuItem> menuItems) { foreach (MenuItem menuItem in menuItems) { dynamic menuItemShape = BuildLocalMenuItemShape(shapeFactory, parentShape, menu, menuItem); if (menuItem.Items != null && menuItem.Items.Any()) { PopulateLocalMenu(shapeFactory, menuItemShape, menu, menuItem.Items); } parentShape.Add(menuItemShape, menuItem.Position); } } /// <summary> /// Identifies the currently selected path, starting from the selected node. /// </summary> /// <param name="menuItems">All the menuitems in the navigation menu.</param> /// <param name="currentRequest">The currently executed request if any</param> /// <param name="currentRouteData">The current route data.</param> /// <returns>A stack with the selection path being the last node the currently selected one.</returns> public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, HttpRequestBase currentRequest, RouteData currentRouteData) { return SetSelectedPath(menuItems, currentRequest, currentRouteData.Values); } /// <summary> /// Identifies the currently selected path, starting from the selected node. /// </summary> /// <param name="menuItems">All the menuitems in the navigation menu.</param> /// <param name="currentRequest">The currently executed request if any</param> /// <param name="currentRouteData">The current route data.</param> /// <returns>A stack with the selection path being the last node the currently selected one.</returns> public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, HttpRequestBase currentRequest, RouteValueDictionary currentRouteData) { if (menuItems == null) return null; foreach (MenuItem menuItem in menuItems) { Stack<MenuItem> selectedPath = SetSelectedPath(menuItem.Items, currentRequest, currentRouteData); if (selectedPath != null) { menuItem.Selected = true; selectedPath.Push(menuItem); return selectedPath; } bool match = false; // if the menu item doesn't have route values, compare urls if (currentRequest != null && menuItem.RouteValues == null) { string requestUrl = currentRequest.Path.Replace(currentRequest.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant(); string modelUrl = menuItem.Href.Replace(currentRequest.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant(); if (requestUrl == modelUrl || (!string.IsNullOrEmpty(modelUrl) && requestUrl.StartsWith(modelUrl + "/"))) { match = true; } } else { if (RouteMatches(menuItem.RouteValues, currentRouteData)) { match = true; } } if (match) { menuItem.Selected = true; selectedPath = new Stack<MenuItem>(); selectedPath.Push(menuItem); return selectedPath; } } return null; } /// <summary> /// Find the first level in the selection path, starting from the bottom, that is not a local task. /// </summary> /// <param name="selectedPath">The selection path stack. The bottom node is the currently selected one.</param> /// <returns>The first node, starting from the bottom, that is not a local task. Otherwise, null.</returns> public static MenuItem FindParentLocalTask(Stack<MenuItem> selectedPath) { if (selectedPath != null) { MenuItem parentMenuItem = selectedPath.Pop(); if (parentMenuItem != null) { while (selectedPath.Count > 0) { MenuItem currentMenuItem = selectedPath.Pop(); if (currentMenuItem.LocalNav) { return parentMenuItem; } parentMenuItem = currentMenuItem; } } } return null; } /// <summary> /// Determines if a menu item corresponds to a given route. /// </summary> /// <param name="itemValues">The menu item.</param> /// <param name="requestValues">The route data.</param> /// <returns>True if the menu item's action corresponds to the route data; false otherwise.</returns> public static bool RouteMatches(RouteValueDictionary itemValues, RouteValueDictionary requestValues) { if (itemValues == null && requestValues == null) { return true; } if (itemValues == null || requestValues == null) { return false; } if (itemValues.Keys.Any(key => requestValues.ContainsKey(key) == false)) { return false; } return itemValues.Keys.All(key => string.Equals(Convert.ToString(itemValues[key]), Convert.ToString(requestValues[key]), StringComparison.OrdinalIgnoreCase)); } /// <summary> /// Builds a menu item shape. /// </summary> /// <param name="shapeFactory">The shape factory.</param> /// <param name="parentShape">The parent shape.</param> /// <param name="menu">The menu shape.</param> /// <param name="menuItem">The menu item to build the shape for.</param> /// <returns>The menu item shape.</returns> public static dynamic BuildMenuItemShape(dynamic shapeFactory, dynamic parentShape, dynamic menu, MenuItem menuItem) { var menuItemShape = shapeFactory.MenuItem() .Text(menuItem.Text) .IdHint(menuItem.IdHint) .Href(menuItem.Href) .LinkToFirstChild(menuItem.LinkToFirstChild) .LocalNav(menuItem.LocalNav) .Selected(menuItem.Selected) .RouteValues(menuItem.RouteValues) .Item(menuItem) .Menu(menu) .Parent(parentShape) .Content(menuItem.Content); foreach (var className in menuItem.Classes) menuItemShape.Classes.Add(className); return menuItemShape; } /// <summary> /// Builds a local menu item shape. /// </summary> /// <param name="shapeFactory">The shape factory.</param> /// <param name="parentShape">The parent shape.</param> /// <param name="menu">The menu shape.</param> /// <param name="menuItem">The menu item to build the shape for.</param> /// <returns>The menu item shape.</returns> public static dynamic BuildLocalMenuItemShape(dynamic shapeFactory, dynamic parentShape, dynamic menu, MenuItem menuItem) { var menuItemShape = shapeFactory.LocalMenuItem() .Text(menuItem.Text) .IdHint(menuItem.IdHint) .Href(menuItem.Href) .LinkToFirstChild(menuItem.LinkToFirstChild) .LocalNav(menuItem.LocalNav) .Selected(menuItem.Selected) .RouteValues(menuItem.RouteValues) .Item(menuItem) .Menu(menu) .Parent(parentShape); foreach (var className in menuItem.Classes) menuItemShape.Classes.Add(className); return menuItemShape; } } }
AEdmunds/beautiful-springtime
src/Orchard/UI/Navigation/NavigationHelper.cs
C#
bsd-3-clause
10,472
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GIOError</title> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="index.html" title="GIO Reference Manual"> <link rel="up" href="file_ops.html" title="File Operations"> <link rel="prev" href="GFileEnumerator.html" title="GFileEnumerator"> <link rel="next" href="GMountOperation.html" title="GMountOperation"> <meta name="generator" content="GTK-Doc V1.14 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> <tr valign="middle"> <td><a accesskey="p" href="GFileEnumerator.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> <td><a accesskey="u" href="file_ops.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> <th width="100%" align="center">GIO Reference Manual</th> <td><a accesskey="n" href="GMountOperation.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> </tr> <tr><td colspan="5" class="shortcuts"> <a href="#gio-GIOError.synopsis" class="shortcut">Top</a>  |  <a href="#gio-GIOError.description" class="shortcut">Description</a> </td></tr> </table> <div class="refentry" title="GIOError"> <a name="gio-GIOError"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="gio-GIOError.top_of_page"></a>GIOError</span></h2> <p>GIOError — Error helper functions</p> </td> <td valign="top" align="right"></td> </tr></table></div> <div class="refsynopsisdiv" title="Synopsis"> <a name="gio-GIOError.synopsis"></a><h2>Synopsis</h2> <pre class="synopsis"> #include &lt;gio/gio.h&gt; #define <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR">G_IO_ERROR</a> enum <a class="link" href="gio-GIOError.html#GIOErrorEnum" title="enum GIOErrorEnum">GIOErrorEnum</a>; <a class="link" href="gio-GIOError.html#GIOErrorEnum" title="enum GIOErrorEnum"><span class="returnvalue">GIOErrorEnum</span></a> <a class="link" href="gio-GIOError.html#g-io-error-from-errno" title="g_io_error_from_errno ()">g_io_error_from_errno</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> err_no</code></em>); </pre> </div> <div class="refsect1" title="Description"> <a name="gio-GIOError.description"></a><h2>Description</h2> <p> Contains helper functions for reporting errors to the user. </p> </div> <div class="refsect1" title="Details"> <a name="gio-GIOError.details"></a><h2>Details</h2> <div class="refsect2" title="G_IO_ERROR"> <a name="G-IO-ERROR:CAPS"></a><h3>G_IO_ERROR</h3> <pre class="programlisting">#define G_IO_ERROR g_io_error_quark() </pre> <p> Error domain for GIO. Errors in this domain will be from the <a class="link" href="gio-GIOError.html#GIOErrorEnum" title="enum GIOErrorEnum"><span class="type">GIOErrorEnum</span></a> enumeration. See <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for more information on error domains. </p> </div> <hr> <div class="refsect2" title="enum GIOErrorEnum"> <a name="GIOErrorEnum"></a><h3>enum GIOErrorEnum</h3> <pre class="programlisting">typedef enum { G_IO_ERROR_FAILED, G_IO_ERROR_NOT_FOUND, G_IO_ERROR_EXISTS, G_IO_ERROR_IS_DIRECTORY, G_IO_ERROR_NOT_DIRECTORY, G_IO_ERROR_NOT_EMPTY, G_IO_ERROR_NOT_REGULAR_FILE, G_IO_ERROR_NOT_SYMBOLIC_LINK, G_IO_ERROR_NOT_MOUNTABLE_FILE, G_IO_ERROR_FILENAME_TOO_LONG, G_IO_ERROR_INVALID_FILENAME, G_IO_ERROR_TOO_MANY_LINKS, G_IO_ERROR_NO_SPACE, G_IO_ERROR_INVALID_ARGUMENT, G_IO_ERROR_PERMISSION_DENIED, G_IO_ERROR_NOT_SUPPORTED, G_IO_ERROR_NOT_MOUNTED, G_IO_ERROR_ALREADY_MOUNTED, G_IO_ERROR_CLOSED, G_IO_ERROR_CANCELLED, G_IO_ERROR_PENDING, G_IO_ERROR_READ_ONLY, G_IO_ERROR_CANT_CREATE_BACKUP, G_IO_ERROR_WRONG_ETAG, G_IO_ERROR_TIMED_OUT, G_IO_ERROR_WOULD_RECURSE, G_IO_ERROR_BUSY, G_IO_ERROR_WOULD_BLOCK, G_IO_ERROR_HOST_NOT_FOUND, G_IO_ERROR_WOULD_MERGE, G_IO_ERROR_FAILED_HANDLED, G_IO_ERROR_TOO_MANY_OPEN_FILES, G_IO_ERROR_NOT_INITIALIZED, G_IO_ERROR_ADDRESS_IN_USE, G_IO_ERROR_PARTIAL_INPUT, G_IO_ERROR_INVALID_DATA } GIOErrorEnum; </pre> <p> Error codes returned by GIO functions. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><a name="G-IO-ERROR-FAILED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_FAILED</code></span></p></td> <td>Generic error condition for when any operation fails. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_FOUND</code></span></p></td> <td>File not found error. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-EXISTS:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_EXISTS</code></span></p></td> <td>File already exists error. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-IS-DIRECTORY:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></span></p></td> <td>File is a directory error. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-DIRECTORY:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_DIRECTORY</code></span></p></td> <td>File is not a directory. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-EMPTY:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_EMPTY</code></span></p></td> <td>File is a directory that isn't empty. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-REGULAR-FILE:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_REGULAR_FILE</code></span></p></td> <td>File is not a regular file. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-SYMBOLIC-LINK:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_SYMBOLIC_LINK</code></span></p></td> <td>File is not a symbolic link. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-MOUNTABLE-FILE:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_MOUNTABLE_FILE</code></span></p></td> <td>File cannot be mounted. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-FILENAME-TOO-LONG:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_FILENAME_TOO_LONG</code></span></p></td> <td>Filename is too many characters. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-INVALID-FILENAME:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_INVALID_FILENAME</code></span></p></td> <td>Filename is invalid or contains invalid characters. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-TOO-MANY-LINKS:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_TOO_MANY_LINKS</code></span></p></td> <td>File contains too many symbolic links. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NO-SPACE:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NO_SPACE</code></span></p></td> <td>No space left on drive. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-INVALID-ARGUMENT:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></span></p></td> <td>Invalid argument. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-PERMISSION-DENIED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_PERMISSION_DENIED</code></span></p></td> <td>Permission denied. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-SUPPORTED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></span></p></td> <td>Operation not supported for the current backend. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-MOUNTED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_MOUNTED</code></span></p></td> <td>File isn't mounted. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-ALREADY-MOUNTED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_ALREADY_MOUNTED</code></span></p></td> <td>File is already mounted. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-CLOSED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_CLOSED</code></span></p></td> <td>File was closed. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-CANCELLED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_CANCELLED</code></span></p></td> <td>Operation was cancelled. See <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-PENDING:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_PENDING</code></span></p></td> <td>Operations are still pending. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-READ-ONLY:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_READ_ONLY</code></span></p></td> <td>File is read only. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-CANT-CREATE-BACKUP:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_CANT_CREATE_BACKUP</code></span></p></td> <td>Backup couldn't be created. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-WRONG-ETAG:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_WRONG_ETAG</code></span></p></td> <td>File's Entity Tag was incorrect. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-TIMED-OUT:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_TIMED_OUT</code></span></p></td> <td>Operation timed out. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-WOULD-RECURSE:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_WOULD_RECURSE</code></span></p></td> <td>Operation would be recursive. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-BUSY:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_BUSY</code></span></p></td> <td>File is busy. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-WOULD-BLOCK:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></span></p></td> <td>Operation would block. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-HOST-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_HOST_NOT_FOUND</code></span></p></td> <td>Host couldn't be found (remote operations). </td> </tr> <tr> <td><p><a name="G-IO-ERROR-WOULD-MERGE:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_WOULD_MERGE</code></span></p></td> <td>Operation would merge files. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-FAILED-HANDLED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_FAILED_HANDLED</code></span></p></td> <td>Operation failed and a helper program has already interacted with the user. Do not display any error dialog. </td> </tr> <tr> <td><p><a name="G-IO-ERROR-TOO-MANY-OPEN-FILES:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_TOO_MANY_OPEN_FILES</code></span></p></td> <td>The current process has too many files open and can't open any more. Duplicate descriptors do count toward this limit. Since 2.20 </td> </tr> <tr> <td><p><a name="G-IO-ERROR-NOT-INITIALIZED:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_NOT_INITIALIZED</code></span></p></td> <td>The object has not been initialized. Since 2.22 </td> </tr> <tr> <td><p><a name="G-IO-ERROR-ADDRESS-IN-USE:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_ADDRESS_IN_USE</code></span></p></td> <td>The requested address is already in use. Since 2.22 </td> </tr> <tr> <td><p><a name="G-IO-ERROR-PARTIAL-INPUT:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_PARTIAL_INPUT</code></span></p></td> <td>Need more input to finish operation. Since 2.24 </td> </tr> <tr> <td><p><a name="G-IO-ERROR-INVALID-DATA:CAPS"></a><span class="term"><code class="literal">G_IO_ERROR_INVALID_DATA</code></span></p></td> <td>There input data was invalid. Since 2.24 </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" title="g_io_error_from_errno ()"> <a name="g-io-error-from-errno"></a><h3>g_io_error_from_errno ()</h3> <pre class="programlisting"><a class="link" href="gio-GIOError.html#GIOErrorEnum" title="enum GIOErrorEnum"><span class="returnvalue">GIOErrorEnum</span></a> g_io_error_from_errno (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> err_no</code></em>);</pre> <p> Converts errno.h error codes into GIO error codes. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>err_no</code></em> :</span></p></td> <td>Error number as defined in errno.h. </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> <a class="link" href="gio-GIOError.html#GIOErrorEnum" title="enum GIOErrorEnum"><span class="type">GIOErrorEnum</span></a> value for the given errno.h error number. </td> </tr> </tbody> </table></div> </div> </div> </div> <div class="footer"> <hr> Generated by GTK-Doc V1.14</div> </body> </html>
bamos/parsec-benchmark
pkgs/libs/glib/src/docs/reference/gio/html/gio-GIOError.html
HTML
bsd-3-clause
13,257
Ext.define("Ext.menu.Separator",{extend:"Ext.menu.Item",alias:"widget.menuseparator",canActivate:false,focusable:false,hideOnClick:false,plain:true,separatorCls:Ext.baseCSSPrefix+"menu-item-separator",text:"&#160;",beforeRender:function(a,c){var b=this;b.callParent();b.addCls(b.separatorCls)}});
AdenKejawen/erp
web/assets/extjs/src/menu/Separator.js
JavaScript
mit
296
/* * Altera SoCFPGA SDRAM configuration * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __SOCFPGA_SDRAM_CONFIG_H__ #define __SOCFPGA_SDRAM_CONFIG_H__ /* SDRAM configuration */ #define CONFIG_HPS_SDR_CTRLCFG_CPORTRDWR_CPORTRDWR 0x5A56A #define CONFIG_HPS_SDR_CTRLCFG_CPORTRMAP_CPORTRMAP 0xB00088 #define CONFIG_HPS_SDR_CTRLCFG_CPORTWIDTH_CPORTWIDTH 0x44555 #define CONFIG_HPS_SDR_CTRLCFG_CPORTWMAP_CPORTWMAP 0x2C011000 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_ADDRORDER 0 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_DQSTRKEN 0 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_ECCCORREN 0 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_ECCEN 0 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_MEMBL 8 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_MEMTYPE 2 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_NODMPINS 0 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_REORDEREN 1 #define CONFIG_HPS_SDR_CTRLCFG_CTRLCFG_STARVELIMIT 10 #define CONFIG_HPS_SDR_CTRLCFG_CTRLWIDTH_CTRLWIDTH 2 #define CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_BANKBITS 3 #define CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_COLBITS 10 #define CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_CSBITS 1 #define CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_ROWBITS 15 #define CONFIG_HPS_SDR_CTRLCFG_DRAMDEVWIDTH_DEVWIDTH 8 #define CONFIG_HPS_SDR_CTRLCFG_DRAMIFWIDTH_IFWIDTH 32 #define CONFIG_HPS_SDR_CTRLCFG_DRAMINTR_INTREN 0 #define CONFIG_HPS_SDR_CTRLCFG_DRAMODT_READ 0 #define CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE 1 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING1_AL 0 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING1_TCL 6 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING1_TCWL 6 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING1_TFAW 16 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING1_TRFC 140 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING1_TRRD 5 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING2_IF_TRCD 6 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING2_IF_TREFI 1560 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING2_IF_TRP 6 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING2_IF_TWR 6 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING2_IF_TWTR 4 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TCCD 4 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TMRD 4 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRAS 14 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRC 20 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP 5 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT 3 #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT 512 #define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 0 #define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 0 #define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP 0 #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC 0 #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE 0 #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST 0x0 #define CONFIG_HPS_SDR_CTRLCFG_LOWPWREQ_SELFRFSHMASK 3 #define CONFIG_HPS_SDR_CTRLCFG_LOWPWRTIMING_AUTOPDCYCLES 0 #define CONFIG_HPS_SDR_CTRLCFG_LOWPWRTIMING_CLKDISABLECYCLES 8 #define CONFIG_HPS_SDR_CTRLCFG_MPPACING_0_THRESHOLD1_31_0 0x20820820 #define CONFIG_HPS_SDR_CTRLCFG_MPPACING_1_THRESHOLD1_59_32 0x8208208 #define CONFIG_HPS_SDR_CTRLCFG_MPPACING_1_THRESHOLD2_3_0 0 #define CONFIG_HPS_SDR_CTRLCFG_MPPACING_2_THRESHOLD2_35_4 0x41041041 #define CONFIG_HPS_SDR_CTRLCFG_MPPACING_3_THRESHOLD2_59_36 0x410410 #define CONFIG_HPS_SDR_CTRLCFG_MPPRIORITY_USERPRIORITY 0x3FFD1088 #define CONFIG_HPS_SDR_CTRLCFG_MPTHRESHOLDRST_0_THRESHOLDRSTCYCLES_31_0 0x01010101 #define CONFIG_HPS_SDR_CTRLCFG_MPTHRESHOLDRST_1_THRESHOLDRSTCYCLES_63_32 0x01010101 #define CONFIG_HPS_SDR_CTRLCFG_MPTHRESHOLDRST_2_THRESHOLDRSTCYCLES_79_64 0x0101 #define CONFIG_HPS_SDR_CTRLCFG_MPWIEIGHT_0_STATICWEIGHT_31_0 0x21084210 #define CONFIG_HPS_SDR_CTRLCFG_MPWIEIGHT_1_STATICWEIGHT_49_32 0x1EF84 #define CONFIG_HPS_SDR_CTRLCFG_MPWIEIGHT_1_SUMOFWEIGHT_13_0 0x2020 #define CONFIG_HPS_SDR_CTRLCFG_MPWIEIGHT_2_SUMOFWEIGHT_45_14 0x0 #define CONFIG_HPS_SDR_CTRLCFG_MPWIEIGHT_3_SUMOFWEIGHT_63_46 0xF800 #define CONFIG_HPS_SDR_CTRLCFG_PHYCTRL_PHYCTRL_0 0x200 #define CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN 0 #define CONFIG_HPS_SDR_CTRLCFG_RFIFOCMAP_RFIFOCMAP 0x760210 #define CONFIG_HPS_SDR_CTRLCFG_STATICCFG_MEMBL 2 #define CONFIG_HPS_SDR_CTRLCFG_STATICCFG_USEECCASDATA 0 #define CONFIG_HPS_SDR_CTRLCFG_WFIFOCMAP_WFIFOCMAP 0x980543 /* Sequencer auto configuration */ #define RW_MGR_ACTIVATE_0_AND_1 0x0D #define RW_MGR_ACTIVATE_0_AND_1_WAIT1 0x0E #define RW_MGR_ACTIVATE_0_AND_1_WAIT2 0x10 #define RW_MGR_ACTIVATE_1 0x0F #define RW_MGR_CLEAR_DQS_ENABLE 0x49 #define RW_MGR_GUARANTEED_READ 0x4C #define RW_MGR_GUARANTEED_READ_CONT 0x54 #define RW_MGR_GUARANTEED_WRITE 0x18 #define RW_MGR_GUARANTEED_WRITE_WAIT0 0x1B #define RW_MGR_GUARANTEED_WRITE_WAIT1 0x1F #define RW_MGR_GUARANTEED_WRITE_WAIT2 0x19 #define RW_MGR_GUARANTEED_WRITE_WAIT3 0x1D #define RW_MGR_IDLE 0x00 #define RW_MGR_IDLE_LOOP1 0x7B #define RW_MGR_IDLE_LOOP2 0x7A #define RW_MGR_INIT_RESET_0_CKE_0 0x6F #define RW_MGR_INIT_RESET_1_CKE_0 0x74 #define RW_MGR_LFSR_WR_RD_BANK_0 0x22 #define RW_MGR_LFSR_WR_RD_BANK_0_DATA 0x25 #define RW_MGR_LFSR_WR_RD_BANK_0_DQS 0x24 #define RW_MGR_LFSR_WR_RD_BANK_0_NOP 0x23 #define RW_MGR_LFSR_WR_RD_BANK_0_WAIT 0x32 #define RW_MGR_LFSR_WR_RD_BANK_0_WL_1 0x21 #define RW_MGR_LFSR_WR_RD_DM_BANK_0 0x36 #define RW_MGR_LFSR_WR_RD_DM_BANK_0_DATA 0x39 #define RW_MGR_LFSR_WR_RD_DM_BANK_0_DQS 0x38 #define RW_MGR_LFSR_WR_RD_DM_BANK_0_NOP 0x37 #define RW_MGR_LFSR_WR_RD_DM_BANK_0_WAIT 0x46 #define RW_MGR_LFSR_WR_RD_DM_BANK_0_WL_1 0x35 #define RW_MGR_MRS0_DLL_RESET 0x02 #define RW_MGR_MRS0_DLL_RESET_MIRR 0x08 #define RW_MGR_MRS0_USER 0x07 #define RW_MGR_MRS0_USER_MIRR 0x0C #define RW_MGR_MRS1 0x03 #define RW_MGR_MRS1_MIRR 0x09 #define RW_MGR_MRS2 0x04 #define RW_MGR_MRS2_MIRR 0x0A #define RW_MGR_MRS3 0x05 #define RW_MGR_MRS3_MIRR 0x0B #define RW_MGR_PRECHARGE_ALL 0x12 #define RW_MGR_READ_B2B 0x59 #define RW_MGR_READ_B2B_WAIT1 0x61 #define RW_MGR_READ_B2B_WAIT2 0x6B #define RW_MGR_REFRESH_ALL 0x14 #define RW_MGR_RETURN 0x01 #define RW_MGR_SGLE_READ 0x7D #define RW_MGR_ZQCL 0x06 /* Sequencer defines configuration */ #define AFI_RATE_RATIO 1 #define CALIB_LFIFO_OFFSET 7 #define CALIB_VFIFO_OFFSET 5 #define ENABLE_SUPER_QUICK_CALIBRATION 0 #define IO_DELAY_PER_DCHAIN_TAP 25 #define IO_DELAY_PER_DQS_EN_DCHAIN_TAP 25 #define IO_DELAY_PER_OPA_TAP 312 #define IO_DLL_CHAIN_LENGTH 8 #define IO_DQDQS_OUT_PHASE_MAX 0 #define IO_DQS_EN_DELAY_MAX 31 #define IO_DQS_EN_DELAY_OFFSET 0 #define IO_DQS_EN_PHASE_MAX 7 #define IO_DQS_IN_DELAY_MAX 31 #define IO_DQS_IN_RESERVE 4 #define IO_DQS_OUT_RESERVE 4 #define IO_IO_IN_DELAY_MAX 31 #define IO_IO_OUT1_DELAY_MAX 31 #define IO_IO_OUT2_DELAY_MAX 0 #define IO_SHIFT_DQS_EN_WHEN_SHIFT_DQS 0 #define MAX_LATENCY_COUNT_WIDTH 5 #define READ_VALID_FIFO_SIZE 16 #define REG_FILE_INIT_SEQ_SIGNATURE 0x55550496 #define RW_MGR_MEM_ADDRESS_MIRRORING 0 #define RW_MGR_MEM_DATA_MASK_WIDTH 4 #define RW_MGR_MEM_DATA_WIDTH 32 #define RW_MGR_MEM_DQ_PER_READ_DQS 8 #define RW_MGR_MEM_DQ_PER_WRITE_DQS 8 #define RW_MGR_MEM_IF_READ_DQS_WIDTH 4 #define RW_MGR_MEM_IF_WRITE_DQS_WIDTH 4 #define RW_MGR_MEM_NUMBER_OF_CS_PER_DIMM 1 #define RW_MGR_MEM_NUMBER_OF_RANKS 1 #define RW_MGR_MEM_VIRTUAL_GROUPS_PER_READ_DQS 1 #define RW_MGR_MEM_VIRTUAL_GROUPS_PER_WRITE_DQS 1 #define RW_MGR_TRUE_MEM_DATA_MASK_WIDTH 4 #define TINIT_CNTR0_VAL 99 #define TINIT_CNTR1_VAL 32 #define TINIT_CNTR2_VAL 32 #define TRESET_CNTR0_VAL 99 #define TRESET_CNTR1_VAL 99 #define TRESET_CNTR2_VAL 10 /* Sequencer ac_rom_init configuration */ const u32 ac_rom_init[] = { 0x20700000, 0x20780000, 0x10080421, 0x10080520, 0x10090044, 0x100a0008, 0x100b0000, 0x10380400, 0x10080441, 0x100804c0, 0x100a0024, 0x10090010, 0x100b0000, 0x30780000, 0x38780000, 0x30780000, 0x10680000, 0x106b0000, 0x10280400, 0x10480000, 0x1c980000, 0x1c9b0000, 0x1c980008, 0x1c9b0008, 0x38f80000, 0x3cf80000, 0x38780000, 0x18180000, 0x18980000, 0x13580000, 0x135b0000, 0x13580008, 0x135b0008, 0x33780000, 0x10580008, 0x10780000 }; /* Sequencer inst_rom_init configuration */ const u32 inst_rom_init[] = { 0x80000, 0x80680, 0x8180, 0x8200, 0x8280, 0x8300, 0x8380, 0x8100, 0x8480, 0x8500, 0x8580, 0x8600, 0x8400, 0x800, 0x8680, 0x880, 0xa680, 0x80680, 0x900, 0x80680, 0x980, 0xa680, 0x8680, 0x80680, 0xb68, 0xcce8, 0xae8, 0x8ce8, 0xb88, 0xec88, 0xa08, 0xac88, 0x80680, 0xce00, 0xcd80, 0xe700, 0xc00, 0x20ce0, 0x20ce0, 0x20ce0, 0x20ce0, 0xd00, 0x680, 0x680, 0x680, 0x680, 0x60e80, 0x61080, 0x61080, 0x61080, 0xa680, 0x8680, 0x80680, 0xce00, 0xcd80, 0xe700, 0xc00, 0x30ce0, 0x30ce0, 0x30ce0, 0x30ce0, 0xd00, 0x680, 0x680, 0x680, 0x680, 0x70e80, 0x71080, 0x71080, 0x71080, 0xa680, 0x8680, 0x80680, 0x1158, 0x6d8, 0x80680, 0x1168, 0x7e8, 0x7e8, 0x87e8, 0x40fe8, 0x410e8, 0x410e8, 0x410e8, 0x1168, 0x7e8, 0x7e8, 0xa7e8, 0x80680, 0x40e88, 0x41088, 0x41088, 0x41088, 0x40f68, 0x410e8, 0x410e8, 0x410e8, 0xa680, 0x40fe8, 0x410e8, 0x410e8, 0x410e8, 0x41008, 0x41088, 0x41088, 0x41088, 0x1100, 0xc680, 0x8680, 0xe680, 0x80680, 0x0, 0x8000, 0xa000, 0xc000, 0x80000, 0x80, 0x8080, 0xa080, 0xc080, 0x80080, 0x9180, 0x8680, 0xa680, 0x80680, 0x40f08, 0x80680 }; #endif /* __SOCFPGA_SDRAM_CONFIG_H__ */
guileschool/beagleboard
u-boot/board/aries/mcvevk/qts/sdram_config.h
C
mit
9,257
require "vagrant/util/retryable" module VagrantPlugins module GuestLinux module Cap class NFS extend Vagrant::Util::Retryable def self.nfs_client_installed(machine) machine.communicate.test("test -x /sbin/mount.nfs") end def self.mount_nfs_folder(machine, ip, folders) comm = machine.communicate folders.each do |name, opts| # Mount each folder separately so we can retry. commands = ["set -e"] # Shellescape the paths in case they do not have special characters. guest_path = Shellwords.escape(opts[:guestpath]) host_path = Shellwords.escape(opts[:hostpath]) # Build the list of mount options. mount_opts = [] mount_opts << "vers=#{opts[:nfs_version]}" if opts[:nfs_version] mount_opts << "udp" if opts[:nfs_udp] if opts[:mount_options] mount_opts = mount_opts + opts[:mount_options].dup end mount_opts = mount_opts.join(",") # Make the directory on the guest. commands << "mkdir -p #{guest_path}" # Perform the mount operation. commands << "mount -o #{mount_opts} #{ip}:#{host_path} #{guest_path}" # Emit a mount event commands << <<-EOH.gsub(/^ {14}/, '') if command -v /sbin/init && /sbin/init --version | grep upstart; then /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path} fi EOH # Run the command, raising a specific error. retryable(on: Vagrant::Errors::NFSMountFailed, tries: 3, sleep: 5) do machine.communicate.sudo(commands.join("\n"), error_class: Vagrant::Errors::NFSMountFailed, ) end end end end end end end
kamazee/vagrant
plugins/guests/linux/cap/nfs.rb
Ruby
mit
1,925
package goja import ( "math" ) func (r *Runtime) math_abs(call FunctionCall) Value { return floatToValue(math.Abs(call.Argument(0).ToFloat())) } func (r *Runtime) math_acos(call FunctionCall) Value { return floatToValue(math.Acos(call.Argument(0).ToFloat())) } func (r *Runtime) math_asin(call FunctionCall) Value { return floatToValue(math.Asin(call.Argument(0).ToFloat())) } func (r *Runtime) math_atan(call FunctionCall) Value { return floatToValue(math.Atan(call.Argument(0).ToFloat())) } func (r *Runtime) math_atan2(call FunctionCall) Value { y := call.Argument(0).ToFloat() x := call.Argument(1).ToFloat() return floatToValue(math.Atan2(y, x)) } func (r *Runtime) math_ceil(call FunctionCall) Value { return floatToValue(math.Ceil(call.Argument(0).ToFloat())) } func (r *Runtime) math_cos(call FunctionCall) Value { return floatToValue(math.Cos(call.Argument(0).ToFloat())) } func (r *Runtime) math_exp(call FunctionCall) Value { return floatToValue(math.Exp(call.Argument(0).ToFloat())) } func (r *Runtime) math_floor(call FunctionCall) Value { return floatToValue(math.Floor(call.Argument(0).ToFloat())) } func (r *Runtime) math_log(call FunctionCall) Value { return floatToValue(math.Log(call.Argument(0).ToFloat())) } func (r *Runtime) math_max(call FunctionCall) Value { if len(call.Arguments) == 0 { return _negativeInf } result := call.Arguments[0].ToFloat() if math.IsNaN(result) { return _NaN } for _, arg := range call.Arguments[1:] { f := arg.ToFloat() if math.IsNaN(f) { return _NaN } result = math.Max(result, f) } return floatToValue(result) } func (r *Runtime) math_min(call FunctionCall) Value { if len(call.Arguments) == 0 { return _positiveInf } result := call.Arguments[0].ToFloat() if math.IsNaN(result) { return _NaN } for _, arg := range call.Arguments[1:] { f := arg.ToFloat() if math.IsNaN(f) { return _NaN } result = math.Min(result, f) } return floatToValue(result) } func (r *Runtime) math_pow(call FunctionCall) Value { x := call.Argument(0) y := call.Argument(1) if x, ok := x.assertInt(); ok { if y, ok := y.assertInt(); ok && y >= 0 && y < 64 { if y == 0 { return intToValue(1) } if x == 0 { return intToValue(0) } ip := ipow(x, y) if ip != 0 { return intToValue(ip) } } } return floatToValue(math.Pow(x.ToFloat(), y.ToFloat())) } func (r *Runtime) math_random(call FunctionCall) Value { return floatToValue(r.rand()) } func (r *Runtime) math_round(call FunctionCall) Value { f := call.Argument(0).ToFloat() if math.IsNaN(f) { return _NaN } if f == 0 && math.Signbit(f) { return _negativeZero } t := math.Trunc(f) if f >= 0 { if f-t >= 0.5 { return floatToValue(t + 1) } } else { if t-f > 0.5 { return floatToValue(t - 1) } } return floatToValue(t) } func (r *Runtime) math_sin(call FunctionCall) Value { return floatToValue(math.Sin(call.Argument(0).ToFloat())) } func (r *Runtime) math_sqrt(call FunctionCall) Value { return floatToValue(math.Sqrt(call.Argument(0).ToFloat())) } func (r *Runtime) math_tan(call FunctionCall) Value { return floatToValue(math.Tan(call.Argument(0).ToFloat())) } func (r *Runtime) createMath(val *Object) objectImpl { m := &baseObject{ class: "Math", val: val, extensible: true, prototype: r.global.ObjectPrototype, } m.init() m._putProp("E", valueFloat(math.E), false, false, false) m._putProp("LN10", valueFloat(math.Ln10), false, false, false) m._putProp("LN2", valueFloat(math.Ln2), false, false, false) m._putProp("LOG2E", valueFloat(math.Log2E), false, false, false) m._putProp("LOG10E", valueFloat(math.Log10E), false, false, false) m._putProp("PI", valueFloat(math.Pi), false, false, false) m._putProp("SQRT1_2", valueFloat(sqrt1_2), false, false, false) m._putProp("SQRT2", valueFloat(math.Sqrt2), false, false, false) m._putProp("abs", r.newNativeFunc(r.math_abs, nil, "abs", nil, 1), true, false, true) m._putProp("acos", r.newNativeFunc(r.math_acos, nil, "acos", nil, 1), true, false, true) m._putProp("asin", r.newNativeFunc(r.math_asin, nil, "asin", nil, 1), true, false, true) m._putProp("atan", r.newNativeFunc(r.math_atan, nil, "atan", nil, 1), true, false, true) m._putProp("atan2", r.newNativeFunc(r.math_atan2, nil, "atan2", nil, 2), true, false, true) m._putProp("ceil", r.newNativeFunc(r.math_ceil, nil, "ceil", nil, 1), true, false, true) m._putProp("cos", r.newNativeFunc(r.math_cos, nil, "cos", nil, 1), true, false, true) m._putProp("exp", r.newNativeFunc(r.math_exp, nil, "exp", nil, 1), true, false, true) m._putProp("floor", r.newNativeFunc(r.math_floor, nil, "floor", nil, 1), true, false, true) m._putProp("log", r.newNativeFunc(r.math_log, nil, "log", nil, 1), true, false, true) m._putProp("max", r.newNativeFunc(r.math_max, nil, "max", nil, 2), true, false, true) m._putProp("min", r.newNativeFunc(r.math_min, nil, "min", nil, 2), true, false, true) m._putProp("pow", r.newNativeFunc(r.math_pow, nil, "pow", nil, 2), true, false, true) m._putProp("random", r.newNativeFunc(r.math_random, nil, "random", nil, 0), true, false, true) m._putProp("round", r.newNativeFunc(r.math_round, nil, "round", nil, 1), true, false, true) m._putProp("sin", r.newNativeFunc(r.math_sin, nil, "sin", nil, 1), true, false, true) m._putProp("sqrt", r.newNativeFunc(r.math_sqrt, nil, "sqrt", nil, 1), true, false, true) m._putProp("tan", r.newNativeFunc(r.math_tan, nil, "tan", nil, 1), true, false, true) return m } func (r *Runtime) initMath() { r.addToGlobal("Math", r.newLazyObject(r.createMath)) }
HeavyHorst/remco
vendor/github.com/dop251/goja/builtin_math.go
GO
mit
5,602
<?php /** * LICENSE: The MIT License (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * https://github.com/azure/azure-storage-php/LICENSE * * 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. * * PHP version 5 * * @category Microsoft * @package MicrosoftAzure\Storage\Blob\Models * @author Azure Storage PHP SDK <dmsh@microsoft.com> * @copyright 2016 Microsoft Corporation * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ namespace MicrosoftAzure\Storage\Blob\Models; /** * Holds container ACL * * @category Microsoft * @package MicrosoftAzure\Storage\Blob\Models * @author Azure Storage PHP SDK <dmsh@microsoft.com> * @copyright 2016 Microsoft Corporation * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ class GetContainerACLResult { private $_containerACL; private $_lastModified; private $_etag; /** * Parses the given array into signed identifiers * * @param string $publicAccess container public access * @param string $etag container etag * @param \DateTime $lastModified last modification date * @param array $parsed parsed response into array * representation * * @internal * * @return self */ public static function create( $publicAccess, $etag, \DateTime $lastModified, array $parsed = null ) { $result = new GetContainerAclResult(); $result->setETag($etag); $result->setLastModified($lastModified); $acl = ContainerAcl::create($publicAccess, $parsed); $result->setContainerAcl($acl); return $result; } /** * Gets container ACL * * @return ContainerACL */ public function getContainerAcl() { return $this->_containerACL; } /** * Sets container ACL * * @param ContainerACL $containerACL value. * * @return void */ protected function setContainerAcl(ContainerACL $containerACL) { $this->_containerACL = $containerACL; } /** * Gets container lastModified. * * @return \DateTime. */ public function getLastModified() { return $this->_lastModified; } /** * Sets container lastModified. * * @param \DateTime $lastModified value. * * @return void */ protected function setLastModified(\DateTime $lastModified) { $this->_lastModified = $lastModified; } /** * Gets container etag. * * @return string */ public function getETag() { return $this->_etag; } /** * Sets container etag. * * @param string $etag value. * * @return void */ protected function setETag($etag) { $this->_etag = $etag; } }
deploycode/hds-hablemosdesalud-app
web/plugins/ckfinder/core/connector/php/vendor/microsoft/azure-storage/src/Blob/Models/GetContainerACLResult.php
PHP
mit
3,349
'use strict'; /* globals getInputCompileHelper: false */ describe('ngModel', function() { describe('NgModelController', function() { /* global NgModelController: false */ var ctrl, scope, ngModelAccessor, element, parentFormCtrl; beforeEach(inject(function($rootScope, $controller) { var attrs = {name: 'testAlias', ngModel: 'value'}; parentFormCtrl = { $$setPending: jasmine.createSpy('$$setPending'), $setValidity: jasmine.createSpy('$setValidity'), $setDirty: jasmine.createSpy('$setDirty'), $$clearControlValidity: noop }; element = jqLite('<form><input></form>'); scope = $rootScope; ngModelAccessor = jasmine.createSpy('ngModel accessor'); ctrl = $controller(NgModelController, { $scope: scope, $element: element.find('input'), $attrs: attrs }); //Assign the mocked parentFormCtrl to the model controller ctrl.$$parentForm = parentFormCtrl; })); afterEach(function() { dealoc(element); }); it('should init the properties', function() { expect(ctrl.$untouched).toBe(true); expect(ctrl.$touched).toBe(false); expect(ctrl.$dirty).toBe(false); expect(ctrl.$pristine).toBe(true); expect(ctrl.$valid).toBe(true); expect(ctrl.$invalid).toBe(false); expect(ctrl.$viewValue).toBeDefined(); expect(ctrl.$modelValue).toBeDefined(); expect(ctrl.$formatters).toEqual([]); expect(ctrl.$parsers).toEqual([]); expect(ctrl.$name).toBe('testAlias'); }); describe('setValidity', function() { function expectOneError() { expect(ctrl.$error).toEqual({someError: true}); expect(ctrl.$$success).toEqual({}); expect(ctrl.$pending).toBeUndefined(); } function expectOneSuccess() { expect(ctrl.$error).toEqual({}); expect(ctrl.$$success).toEqual({someError: true}); expect(ctrl.$pending).toBeUndefined(); } function expectOnePending() { expect(ctrl.$error).toEqual({}); expect(ctrl.$$success).toEqual({}); expect(ctrl.$pending).toEqual({someError: true}); } function expectCleared() { expect(ctrl.$error).toEqual({}); expect(ctrl.$$success).toEqual({}); expect(ctrl.$pending).toBeUndefined(); } it('should propagate validity to the parent form', function() { expect(parentFormCtrl.$setValidity).not.toHaveBeenCalled(); ctrl.$setValidity('ERROR', false); expect(parentFormCtrl.$setValidity).toHaveBeenCalledOnceWith('ERROR', false, ctrl); }); it('should transition from states correctly', function() { expectCleared(); ctrl.$setValidity('someError', false); expectOneError(); ctrl.$setValidity('someError', undefined); expectOnePending(); ctrl.$setValidity('someError', true); expectOneSuccess(); ctrl.$setValidity('someError', null); expectCleared(); }); it('should set valid/invalid with multiple errors', function() { ctrl.$setValidity('first', false); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); ctrl.$setValidity('second', false); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); ctrl.$setValidity('third', undefined); expect(ctrl.$valid).toBe(undefined); expect(ctrl.$invalid).toBe(undefined); ctrl.$setValidity('third', null); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); ctrl.$setValidity('second', true); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); ctrl.$setValidity('first', true); expect(ctrl.$valid).toBe(true); expect(ctrl.$invalid).toBe(false); }); }); describe('setPristine', function() { it('should set control to its pristine state', function() { ctrl.$setViewValue('edit'); expect(ctrl.$dirty).toBe(true); expect(ctrl.$pristine).toBe(false); ctrl.$setPristine(); expect(ctrl.$dirty).toBe(false); expect(ctrl.$pristine).toBe(true); }); }); describe('setDirty', function() { it('should set control to its dirty state', function() { expect(ctrl.$pristine).toBe(true); expect(ctrl.$dirty).toBe(false); ctrl.$setDirty(); expect(ctrl.$pristine).toBe(false); expect(ctrl.$dirty).toBe(true); }); it('should set parent form to its dirty state', function() { ctrl.$setDirty(); expect(parentFormCtrl.$setDirty).toHaveBeenCalled(); }); }); describe('setUntouched', function() { it('should set control to its untouched state', function() { ctrl.$setTouched(); ctrl.$setUntouched(); expect(ctrl.$touched).toBe(false); expect(ctrl.$untouched).toBe(true); }); }); describe('setTouched', function() { it('should set control to its touched state', function() { ctrl.$setUntouched(); ctrl.$setTouched(); expect(ctrl.$touched).toBe(true); expect(ctrl.$untouched).toBe(false); }); }); describe('view -> model', function() { it('should set the value to $viewValue', function() { ctrl.$setViewValue('some-val'); expect(ctrl.$viewValue).toBe('some-val'); }); it('should pipeline all registered parsers and set result to $modelValue', function() { var log = []; ctrl.$parsers.push(function(value) { log.push(value); return value + '-a'; }); ctrl.$parsers.push(function(value) { log.push(value); return value + '-b'; }); ctrl.$setViewValue('init'); expect(log).toEqual(['init', 'init-a']); expect(ctrl.$modelValue).toBe('init-a-b'); }); it('should fire viewChangeListeners when the value changes in the view (even if invalid)', function() { var spy = jasmine.createSpy('viewChangeListener'); ctrl.$viewChangeListeners.push(spy); ctrl.$setViewValue('val'); expect(spy).toHaveBeenCalledOnce(); spy.reset(); // invalid ctrl.$parsers.push(function() {return undefined;}); ctrl.$setViewValue('val2'); expect(spy).toHaveBeenCalledOnce(); }); it('should reset the model when the view is invalid', function() { ctrl.$setViewValue('aaaa'); expect(ctrl.$modelValue).toBe('aaaa'); // add a validator that will make any input invalid ctrl.$parsers.push(function() {return undefined;}); expect(ctrl.$modelValue).toBe('aaaa'); ctrl.$setViewValue('bbbb'); expect(ctrl.$modelValue).toBeUndefined(); }); it('should not reset the model when the view is invalid due to an external validator', function() { ctrl.$setViewValue('aaaa'); expect(ctrl.$modelValue).toBe('aaaa'); ctrl.$setValidity('someExternalError', false); ctrl.$setViewValue('bbbb'); expect(ctrl.$modelValue).toBe('bbbb'); }); it('should not reset the view when the view is invalid', function() { // this test fails when the view changes the model and // then the model listener in ngModel picks up the change and // tries to update the view again. // add a validator that will make any input invalid ctrl.$parsers.push(function() {return undefined;}); spyOn(ctrl, '$render'); // first digest ctrl.$setViewValue('bbbb'); expect(ctrl.$modelValue).toBeUndefined(); expect(ctrl.$viewValue).toBe('bbbb'); expect(ctrl.$render).not.toHaveBeenCalled(); expect(scope.value).toBeUndefined(); // further digests scope.$apply('value = "aaa"'); expect(ctrl.$viewValue).toBe('aaa'); ctrl.$render.reset(); ctrl.$setViewValue('cccc'); expect(ctrl.$modelValue).toBeUndefined(); expect(ctrl.$viewValue).toBe('cccc'); expect(ctrl.$render).not.toHaveBeenCalled(); expect(scope.value).toBeUndefined(); }); it('should call parentForm.$setDirty only when pristine', function() { ctrl.$setViewValue(''); expect(ctrl.$pristine).toBe(false); expect(ctrl.$dirty).toBe(true); expect(parentFormCtrl.$setDirty).toHaveBeenCalledOnce(); parentFormCtrl.$setDirty.reset(); ctrl.$setViewValue(''); expect(ctrl.$pristine).toBe(false); expect(ctrl.$dirty).toBe(true); expect(parentFormCtrl.$setDirty).not.toHaveBeenCalled(); }); it('should remove all other errors when any parser returns undefined', function() { var a, b, val = function(val, x) { return x ? val : x; }; ctrl.$parsers.push(function(v) { return val(v, a); }); ctrl.$parsers.push(function(v) { return val(v, b); }); ctrl.$validators.high = function(value) { return !isDefined(value) || value > 5; }; ctrl.$validators.even = function(value) { return !isDefined(value) || value % 2 === 0; }; a = b = true; ctrl.$setViewValue('3'); expect(ctrl.$error).toEqual({ high: true, even: true }); ctrl.$setViewValue('10'); expect(ctrl.$error).toEqual({}); a = undefined; ctrl.$setViewValue('12'); expect(ctrl.$error).toEqual({ parse: true }); a = true; b = undefined; ctrl.$setViewValue('14'); expect(ctrl.$error).toEqual({ parse: true }); a = undefined; b = undefined; ctrl.$setViewValue('16'); expect(ctrl.$error).toEqual({ parse: true }); a = b = false; //not undefined ctrl.$setViewValue('2'); expect(ctrl.$error).toEqual({ high: true }); }); it('should not remove external validators when a parser failed', function() { ctrl.$parsers.push(function(v) { return undefined; }); ctrl.$setValidity('externalError', false); ctrl.$setViewValue('someValue'); expect(ctrl.$error).toEqual({ externalError: true, parse: true }); }); it('should remove all non-parse-related CSS classes from the form when a parser fails', inject(function($compile, $rootScope) { var element = $compile('<form name="myForm">' + '<input name="myControl" ng-model="value" >' + '</form>')($rootScope); var inputElm = element.find('input'); var ctrl = $rootScope.myForm.myControl; var parserIsFailing = false; ctrl.$parsers.push(function(value) { return parserIsFailing ? undefined : value; }); ctrl.$validators.alwaysFail = function() { return false; }; ctrl.$setViewValue('123'); scope.$digest(); expect(element).toHaveClass('ng-valid-parse'); expect(element).not.toHaveClass('ng-invalid-parse'); expect(element).toHaveClass('ng-invalid-always-fail'); parserIsFailing = true; ctrl.$setViewValue('12345'); scope.$digest(); expect(element).not.toHaveClass('ng-valid-parse'); expect(element).toHaveClass('ng-invalid-parse'); expect(element).not.toHaveClass('ng-invalid-always-fail'); dealoc(element); })); it('should set the ng-invalid-parse and ng-valid-parse CSS class when parsers fail and pass', function() { var pass = true; ctrl.$parsers.push(function(v) { return pass ? v : undefined; }); var input = element.find('input'); ctrl.$setViewValue('1'); expect(input).toHaveClass('ng-valid-parse'); expect(input).not.toHaveClass('ng-invalid-parse'); pass = undefined; ctrl.$setViewValue('2'); expect(input).not.toHaveClass('ng-valid-parse'); expect(input).toHaveClass('ng-invalid-parse'); }); it('should update the model after all async validators resolve', inject(function($q) { var defer; ctrl.$asyncValidators.promiseValidator = function(value) { defer = $q.defer(); return defer.promise; }; // set view value on first digest ctrl.$setViewValue('b'); expect(ctrl.$modelValue).toBeUndefined(); expect(scope.value).toBeUndefined(); defer.resolve(); scope.$digest(); expect(ctrl.$modelValue).toBe('b'); expect(scope.value).toBe('b'); // set view value on further digests ctrl.$setViewValue('c'); expect(ctrl.$modelValue).toBe('b'); expect(scope.value).toBe('b'); defer.resolve(); scope.$digest(); expect(ctrl.$modelValue).toBe('c'); expect(scope.value).toBe('c'); })); }); describe('model -> view', function() { it('should set the value to $modelValue', function() { scope.$apply('value = 10'); expect(ctrl.$modelValue).toBe(10); }); it('should pipeline all registered formatters in reversed order and set result to $viewValue', function() { var log = []; ctrl.$formatters.unshift(function(value) { log.push(value); return value + 2; }); ctrl.$formatters.unshift(function(value) { log.push(value); return value + ''; }); scope.$apply('value = 3'); expect(log).toEqual([3, 5]); expect(ctrl.$viewValue).toBe('5'); }); it('should $render only if value changed', function() { spyOn(ctrl, '$render'); scope.$apply('value = 3'); expect(ctrl.$render).toHaveBeenCalledOnce(); ctrl.$render.reset(); ctrl.$formatters.push(function() {return 3;}); scope.$apply('value = 5'); expect(ctrl.$render).not.toHaveBeenCalled(); }); it('should clear the view even if invalid', function() { spyOn(ctrl, '$render'); ctrl.$formatters.push(function() {return undefined;}); scope.$apply('value = 5'); expect(ctrl.$render).toHaveBeenCalledOnce(); }); it('should render immediately even if there are async validators', inject(function($q) { spyOn(ctrl, '$render'); ctrl.$asyncValidators.someValidator = function() { return $q.defer().promise; }; scope.$apply('value = 5'); expect(ctrl.$viewValue).toBe(5); expect(ctrl.$render).toHaveBeenCalledOnce(); })); it('should not rerender nor validate in case view value is not changed', function() { ctrl.$formatters.push(function(value) { return 'nochange'; }); spyOn(ctrl, '$render'); ctrl.$validators.spyValidator = jasmine.createSpy('spyValidator'); scope.$apply('value = "first"'); scope.$apply('value = "second"'); expect(ctrl.$validators.spyValidator).toHaveBeenCalledOnce(); expect(ctrl.$render).toHaveBeenCalledOnce(); }); it('should always format the viewValue as a string for a blank input type when the value is present', inject(function($compile, $rootScope, $sniffer) { var form = $compile('<form name="form"><input name="field" ng-model="val" /></form>')($rootScope); $rootScope.val = 123; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe('123'); $rootScope.val = null; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe(null); dealoc(form); })); it('should always format the viewValue as a string for a `text` input type when the value is present', inject(function($compile, $rootScope, $sniffer) { var form = $compile('<form name="form"><input type="text" name="field" ng-model="val" /></form>')($rootScope); $rootScope.val = 123; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe('123'); $rootScope.val = null; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe(null); dealoc(form); })); it('should always format the viewValue as a string for an `email` input type when the value is present', inject(function($compile, $rootScope, $sniffer) { var form = $compile('<form name="form"><input type="email" name="field" ng-model="val" /></form>')($rootScope); $rootScope.val = 123; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe('123'); $rootScope.val = null; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe(null); dealoc(form); })); it('should always format the viewValue as a string for a `url` input type when the value is present', inject(function($compile, $rootScope, $sniffer) { var form = $compile('<form name="form"><input type="url" name="field" ng-model="val" /></form>')($rootScope); $rootScope.val = 123; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe('123'); $rootScope.val = null; $rootScope.$digest(); expect($rootScope.form.field.$viewValue).toBe(null); dealoc(form); })); it('should set NaN as the $modelValue when an asyncValidator is present', inject(function($q) { ctrl.$asyncValidators.test = function() { return $q(function(resolve, reject) { resolve(); }); }; scope.$apply('value = 10'); expect(ctrl.$modelValue).toBe(10); expect(function() { scope.$apply(function() { scope.value = NaN; }); }).not.toThrow(); expect(ctrl.$modelValue).toBeNaN(); })); }); describe('validation', function() { describe('$validate', function() { it('should perform validations when $validate() is called', function() { scope.$apply('value = ""'); var validatorResult = false; ctrl.$validators.someValidator = function(value) { return validatorResult; }; ctrl.$validate(); expect(ctrl.$valid).toBe(false); validatorResult = true; ctrl.$validate(); expect(ctrl.$valid).toBe(true); }); it('should pass the last parsed modelValue to the validators', function() { ctrl.$parsers.push(function(modelValue) { return modelValue + 'def'; }); ctrl.$setViewValue('abc'); ctrl.$validators.test = function(modelValue, viewValue) { return true; }; spyOn(ctrl.$validators, 'test'); ctrl.$validate(); expect(ctrl.$validators.test).toHaveBeenCalledWith('abcdef', 'abc'); }); it('should set the model to undefined when it becomes invalid', function() { var valid = true; ctrl.$validators.test = function(modelValue, viewValue) { return valid; }; scope.$apply('value = "abc"'); expect(scope.value).toBe('abc'); valid = false; ctrl.$validate(); expect(scope.value).toBeUndefined(); }); it('should update the model when it becomes valid', function() { var valid = true; ctrl.$validators.test = function(modelValue, viewValue) { return valid; }; scope.$apply('value = "abc"'); expect(scope.value).toBe('abc'); valid = false; ctrl.$validate(); expect(scope.value).toBeUndefined(); valid = true; ctrl.$validate(); expect(scope.value).toBe('abc'); }); it('should not update the model when it is valid, but there is a parse error', function() { ctrl.$parsers.push(function(modelValue) { return undefined; }); ctrl.$setViewValue('abc'); expect(ctrl.$error.parse).toBe(true); expect(scope.value).toBeUndefined(); ctrl.$validators.test = function(modelValue, viewValue) { return true; }; ctrl.$validate(); expect(ctrl.$error).toEqual({parse: true}); expect(scope.value).toBeUndefined(); }); it('should not set an invalid model to undefined when validity is the same', function() { ctrl.$validators.test = function() { return false; }; scope.$apply('value = "invalid"'); expect(ctrl.$valid).toBe(false); expect(scope.value).toBe('invalid'); ctrl.$validate(); expect(ctrl.$valid).toBe(false); expect(scope.value).toBe('invalid'); }); it('should not change a model that has a formatter', function() { ctrl.$validators.test = function() { return true; }; ctrl.$formatters.push(function(modelValue) { return 'xyz'; }); scope.$apply('value = "abc"'); expect(ctrl.$viewValue).toBe('xyz'); ctrl.$validate(); expect(scope.value).toBe('abc'); }); it('should not change a model that has a parser', function() { ctrl.$validators.test = function() { return true; }; ctrl.$parsers.push(function(modelValue) { return 'xyz'; }); scope.$apply('value = "abc"'); ctrl.$validate(); expect(scope.value).toBe('abc'); }); }); describe('view -> model update', function() { it('should always perform validations using the parsed model value', function() { var captures; ctrl.$validators.raw = function() { captures = arguments; return captures[0]; }; ctrl.$parsers.push(function(value) { return value.toUpperCase(); }); ctrl.$setViewValue('my-value'); expect(captures).toEqual(['MY-VALUE', 'my-value']); }); it('should always perform validations using the formatted view value', function() { var captures; ctrl.$validators.raw = function() { captures = arguments; return captures[0]; }; ctrl.$formatters.push(function(value) { return value + '...'; }); scope.$apply('value = "matias"'); expect(captures).toEqual(['matias', 'matias...']); }); it('should only perform validations if the view value is different', function() { var count = 0; ctrl.$validators.countMe = function() { count++; }; ctrl.$setViewValue('my-value'); expect(count).toBe(1); ctrl.$setViewValue('my-value'); expect(count).toBe(1); ctrl.$setViewValue('your-value'); expect(count).toBe(2); }); }); it('should perform validations twice each time the model value changes within a digest', function() { var count = 0; ctrl.$validators.number = function(value) { count++; return (/^\d+$/).test(value); }; scope.$apply('value = ""'); expect(count).toBe(1); scope.$apply('value = 1'); expect(count).toBe(2); scope.$apply('value = 1'); expect(count).toBe(2); scope.$apply('value = ""'); expect(count).toBe(3); }); it('should only validate to true if all validations are true', function() { var curry = function(v) { return function() { return v; }; }; ctrl.$modelValue = undefined; ctrl.$validators.a = curry(true); ctrl.$validators.b = curry(true); ctrl.$validators.c = curry(false); ctrl.$validate(); expect(ctrl.$valid).toBe(false); ctrl.$validators.c = curry(true); ctrl.$validate(); expect(ctrl.$valid).toBe(true); }); it('should register invalid validations on the $error object', function() { var curry = function(v) { return function() { return v; }; }; ctrl.$modelValue = undefined; ctrl.$validators.unique = curry(false); ctrl.$validators.tooLong = curry(false); ctrl.$validators.notNumeric = curry(true); ctrl.$validate(); expect(ctrl.$error.unique).toBe(true); expect(ctrl.$error.tooLong).toBe(true); expect(ctrl.$error.notNumeric).not.toBe(true); }); it('should render a validator asynchronously when a promise is returned', inject(function($q) { var defer; ctrl.$asyncValidators.promiseValidator = function(value) { defer = $q.defer(); return defer.promise; }; scope.$apply('value = ""'); expect(ctrl.$valid).toBeUndefined(); expect(ctrl.$invalid).toBeUndefined(); expect(ctrl.$pending.promiseValidator).toBe(true); defer.resolve(); scope.$digest(); expect(ctrl.$valid).toBe(true); expect(ctrl.$invalid).toBe(false); expect(ctrl.$pending).toBeUndefined(); scope.$apply('value = "123"'); defer.reject(); scope.$digest(); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); expect(ctrl.$pending).toBeUndefined(); })); it('should throw an error when a promise is not returned for an asynchronous validator', inject(function($q) { ctrl.$asyncValidators.async = function(value) { return true; }; expect(function() { scope.$apply('value = "123"'); }).toThrowMinErr("ngModel", "nopromise", "Expected asynchronous validator to return a promise but got 'true' instead."); })); it('should only run the async validators once all the sync validators have passed', inject(function($q) { var stages = {}; stages.sync = { status1: false, status2: false, count: 0 }; ctrl.$validators.syncValidator1 = function(modelValue, viewValue) { stages.sync.count++; return stages.sync.status1; }; ctrl.$validators.syncValidator2 = function(modelValue, viewValue) { stages.sync.count++; return stages.sync.status2; }; stages.async = { defer: null, count: 0 }; ctrl.$asyncValidators.asyncValidator = function(modelValue, viewValue) { stages.async.defer = $q.defer(); stages.async.count++; return stages.async.defer.promise; }; scope.$apply('value = "123"'); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); expect(stages.sync.count).toBe(2); expect(stages.async.count).toBe(0); stages.sync.status1 = true; scope.$apply('value = "456"'); expect(stages.sync.count).toBe(4); expect(stages.async.count).toBe(0); stages.sync.status2 = true; scope.$apply('value = "789"'); expect(stages.sync.count).toBe(6); expect(stages.async.count).toBe(1); stages.async.defer.resolve(); scope.$apply(); expect(ctrl.$valid).toBe(true); expect(ctrl.$invalid).toBe(false); })); it('should ignore expired async validation promises once delivered', inject(function($q) { var defer, oldDefer, newDefer; ctrl.$asyncValidators.async = function(value) { defer = $q.defer(); return defer.promise; }; scope.$apply('value = ""'); oldDefer = defer; scope.$apply('value = "123"'); newDefer = defer; newDefer.reject(); scope.$digest(); oldDefer.resolve(); scope.$digest(); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); expect(ctrl.$pending).toBeUndefined(); })); it('should clear and ignore all pending promises when the model value changes', inject(function($q) { ctrl.$validators.sync = function(value) { return true; }; var defers = []; ctrl.$asyncValidators.async = function(value) { var defer = $q.defer(); defers.push(defer); return defer.promise; }; scope.$apply('value = "123"'); expect(ctrl.$pending).toEqual({async: true}); expect(ctrl.$valid).toBe(undefined); expect(ctrl.$invalid).toBe(undefined); expect(defers.length).toBe(1); expect(isObject(ctrl.$pending)).toBe(true); scope.$apply('value = "456"'); expect(ctrl.$pending).toEqual({async: true}); expect(ctrl.$valid).toBe(undefined); expect(ctrl.$invalid).toBe(undefined); expect(defers.length).toBe(2); expect(isObject(ctrl.$pending)).toBe(true); defers[1].resolve(); scope.$digest(); expect(ctrl.$valid).toBe(true); expect(ctrl.$invalid).toBe(false); expect(isObject(ctrl.$pending)).toBe(false); })); it('should clear and ignore all pending promises when a parser fails', inject(function($q) { var failParser = false; ctrl.$parsers.push(function(value) { return failParser ? undefined : value; }); var defer; ctrl.$asyncValidators.async = function(value) { defer = $q.defer(); return defer.promise; }; ctrl.$setViewValue('x..y..z'); expect(ctrl.$valid).toBe(undefined); expect(ctrl.$invalid).toBe(undefined); failParser = true; ctrl.$setViewValue('1..2..3'); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); expect(isObject(ctrl.$pending)).toBe(false); defer.resolve(); scope.$digest(); expect(ctrl.$valid).toBe(false); expect(ctrl.$invalid).toBe(true); expect(isObject(ctrl.$pending)).toBe(false); })); it('should clear all errors from async validators if a parser fails', inject(function($q) { var failParser = false; ctrl.$parsers.push(function(value) { return failParser ? undefined : value; }); ctrl.$asyncValidators.async = function(value) { return $q.reject(); }; ctrl.$setViewValue('x..y..z'); expect(ctrl.$error).toEqual({async: true}); failParser = true; ctrl.$setViewValue('1..2..3'); expect(ctrl.$error).toEqual({parse: true}); })); it('should clear all errors from async validators if a sync validator fails', inject(function($q) { var failValidator = false; ctrl.$validators.sync = function(value) { return !failValidator; }; ctrl.$asyncValidators.async = function(value) { return $q.reject(); }; ctrl.$setViewValue('x..y..z'); expect(ctrl.$error).toEqual({async: true}); failValidator = true; ctrl.$setViewValue('1..2..3'); expect(ctrl.$error).toEqual({sync: true}); })); it('should be possible to extend Object prototype and still be able to do form validation', inject(function($compile, $rootScope) { Object.prototype.someThing = function() {}; var element = $compile('<form name="myForm">' + '<input type="text" name="username" ng-model="username" minlength="10" required />' + '</form>')($rootScope); var inputElm = element.find('input'); var formCtrl = $rootScope.myForm; var usernameCtrl = formCtrl.username; $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(true); expect(formCtrl.$invalid).toBe(true); usernameCtrl.$setViewValue('valid-username'); $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(false); expect(formCtrl.$invalid).toBe(false); delete Object.prototype.someThing; dealoc(element); })); it('should re-evaluate the form validity state once the asynchronous promise has been delivered', inject(function($compile, $rootScope, $q) { var element = $compile('<form name="myForm">' + '<input type="text" name="username" ng-model="username" minlength="10" required />' + '<input type="number" name="age" ng-model="age" min="10" required />' + '</form>')($rootScope); var inputElm = element.find('input'); var formCtrl = $rootScope.myForm; var usernameCtrl = formCtrl.username; var ageCtrl = formCtrl.age; var usernameDefer; usernameCtrl.$asyncValidators.usernameAvailability = function() { usernameDefer = $q.defer(); return usernameDefer.promise; }; $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(true); expect(formCtrl.$invalid).toBe(true); usernameCtrl.$setViewValue('valid-username'); $rootScope.$digest(); expect(formCtrl.$pending.usernameAvailability).toBeTruthy(); expect(usernameCtrl.$invalid).toBe(undefined); expect(formCtrl.$invalid).toBe(undefined); usernameDefer.resolve(); $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(false); expect(formCtrl.$invalid).toBe(true); ageCtrl.$setViewValue(22); $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(false); expect(ageCtrl.$invalid).toBe(false); expect(formCtrl.$invalid).toBe(false); usernameCtrl.$setViewValue('valid'); $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(true); expect(ageCtrl.$invalid).toBe(false); expect(formCtrl.$invalid).toBe(true); usernameCtrl.$setViewValue('another-valid-username'); $rootScope.$digest(); usernameDefer.resolve(); $rootScope.$digest(); expect(usernameCtrl.$invalid).toBe(false); expect(formCtrl.$invalid).toBe(false); expect(formCtrl.$pending).toBeFalsy(); expect(ageCtrl.$invalid).toBe(false); dealoc(element); })); it('should always use the most recent $viewValue for validation', function() { ctrl.$parsers.push(function(value) { if (value && value.substr(-1) === 'b') { value = 'a'; ctrl.$setViewValue(value); ctrl.$render(); } return value; }); ctrl.$validators.mock = function(modelValue) { return true; }; spyOn(ctrl.$validators, 'mock').andCallThrough(); ctrl.$setViewValue('ab'); expect(ctrl.$validators.mock).toHaveBeenCalledWith('a', 'a'); expect(ctrl.$validators.mock.calls.length).toEqual(2); }); it('should validate even if the modelValue did not change', function() { ctrl.$parsers.push(function(value) { if (value && value.substr(-1) === 'b') { value = 'a'; } return value; }); ctrl.$validators.mock = function(modelValue) { return true; }; spyOn(ctrl.$validators, 'mock').andCallThrough(); ctrl.$setViewValue('a'); expect(ctrl.$validators.mock).toHaveBeenCalledWith('a', 'a'); expect(ctrl.$validators.mock.calls.length).toEqual(1); ctrl.$setViewValue('ab'); expect(ctrl.$validators.mock).toHaveBeenCalledWith('a', 'ab'); expect(ctrl.$validators.mock.calls.length).toEqual(2); }); it('should validate correctly when $parser name equals $validator key', function() { ctrl.$validators.parserOrValidator = function(value) { switch (value) { case 'allInvalid': case 'parseValid-validatorsInvalid': case 'stillParseValid-validatorsInvalid': return false; default: return true; } }; ctrl.$validators.validator = function(value) { switch (value) { case 'allInvalid': case 'parseValid-validatorsInvalid': case 'stillParseValid-validatorsInvalid': return false; default: return true; } }; ctrl.$$parserName = 'parserOrValidator'; ctrl.$parsers.push(function(value) { switch (value) { case 'allInvalid': case 'stillAllInvalid': case 'parseInvalid-validatorsValid': case 'stillParseInvalid-validatorsValid': return undefined; default: return value; } }); //Parser and validators are invalid scope.$apply('value = "allInvalid"'); expect(scope.value).toBe('allInvalid'); expect(ctrl.$error).toEqual({parserOrValidator: true, validator: true}); ctrl.$validate(); expect(scope.value).toEqual('allInvalid'); expect(ctrl.$error).toEqual({parserOrValidator: true, validator: true}); ctrl.$setViewValue('stillAllInvalid'); expect(scope.value).toBeUndefined(); expect(ctrl.$error).toEqual({parserOrValidator: true}); ctrl.$validate(); expect(scope.value).toBeUndefined(); expect(ctrl.$error).toEqual({parserOrValidator: true}); //Parser is valid, validators are invalid scope.$apply('value = "parseValid-validatorsInvalid"'); expect(scope.value).toBe('parseValid-validatorsInvalid'); expect(ctrl.$error).toEqual({parserOrValidator: true, validator: true}); ctrl.$validate(); expect(scope.value).toBe('parseValid-validatorsInvalid'); expect(ctrl.$error).toEqual({parserOrValidator: true, validator: true}); ctrl.$setViewValue('stillParseValid-validatorsInvalid'); expect(scope.value).toBeUndefined(); expect(ctrl.$error).toEqual({parserOrValidator: true, validator: true}); ctrl.$validate(); expect(scope.value).toBeUndefined(); expect(ctrl.$error).toEqual({parserOrValidator: true, validator: true}); //Parser is invalid, validators are valid scope.$apply('value = "parseInvalid-validatorsValid"'); expect(scope.value).toBe('parseInvalid-validatorsValid'); expect(ctrl.$error).toEqual({}); ctrl.$validate(); expect(scope.value).toBe('parseInvalid-validatorsValid'); expect(ctrl.$error).toEqual({}); ctrl.$setViewValue('stillParseInvalid-validatorsValid'); expect(scope.value).toBeUndefined(); expect(ctrl.$error).toEqual({parserOrValidator: true}); ctrl.$validate(); expect(scope.value).toBeUndefined(); expect(ctrl.$error).toEqual({parserOrValidator: true}); }); }); }); describe('CSS classes', function() { var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i; it('should set ng-empty or ng-not-empty when the view value changes', inject(function($compile, $rootScope, $sniffer) { var element = $compile('<input ng-model="value" />')($rootScope); $rootScope.$digest(); expect(element).toBeEmpty(); $rootScope.value = 'XXX'; $rootScope.$digest(); expect(element).toBeNotEmpty(); element.val(''); browserTrigger(element, $sniffer.hasEvent('input') ? 'input' : 'change'); expect(element).toBeEmpty(); element.val('YYY'); browserTrigger(element, $sniffer.hasEvent('input') ? 'input' : 'change'); expect(element).toBeNotEmpty(); })); it('should set css classes (ng-valid, ng-invalid, ng-pristine, ng-dirty, ng-untouched, ng-touched)', inject(function($compile, $rootScope, $sniffer) { var element = $compile('<input type="email" ng-model="value" />')($rootScope); $rootScope.$digest(); expect(element).toBeValid(); expect(element).toBePristine(); expect(element).toBeUntouched(); expect(element.hasClass('ng-valid-email')).toBe(true); expect(element.hasClass('ng-invalid-email')).toBe(false); $rootScope.$apply("value = 'invalid-email'"); expect(element).toBeInvalid(); expect(element).toBePristine(); expect(element.hasClass('ng-valid-email')).toBe(false); expect(element.hasClass('ng-invalid-email')).toBe(true); element.val('invalid-again'); browserTrigger(element, ($sniffer.hasEvent('input')) ? 'input' : 'change'); expect(element).toBeInvalid(); expect(element).toBeDirty(); expect(element.hasClass('ng-valid-email')).toBe(false); expect(element.hasClass('ng-invalid-email')).toBe(true); element.val('vojta@google.com'); browserTrigger(element, $sniffer.hasEvent('input') ? 'input' : 'change'); expect(element).toBeValid(); expect(element).toBeDirty(); expect(element.hasClass('ng-valid-email')).toBe(true); expect(element.hasClass('ng-invalid-email')).toBe(false); browserTrigger(element, 'blur'); expect(element).toBeTouched(); dealoc(element); })); it('should set invalid classes on init', inject(function($compile, $rootScope) { var element = $compile('<input type="email" ng-model="value" required />')($rootScope); $rootScope.$digest(); expect(element).toBeInvalid(); expect(element).toHaveClass('ng-invalid-required'); dealoc(element); })); }); describe('custom formatter and parser that are added by a directive in post linking', function() { var inputElm, scope; beforeEach(module(function($compileProvider) { $compileProvider.directive('customFormat', function() { return { require: 'ngModel', link: function(scope, element, attrs, ngModelCtrl) { ngModelCtrl.$formatters.push(function(value) { return value.part; }); ngModelCtrl.$parsers.push(function(value) { return {part: value}; }); } }; }); })); afterEach(function() { dealoc(inputElm); }); function createInput(type) { inject(function($compile, $rootScope) { scope = $rootScope; inputElm = $compile('<input type="' + type + '" ng-model="val" custom-format/>')($rootScope); }); } it('should use them after the builtin ones for text inputs', function() { createInput('text'); scope.$apply('val = {part: "a"}'); expect(inputElm.val()).toBe('a'); inputElm.val('b'); browserTrigger(inputElm, 'change'); expect(scope.val).toEqual({part: 'b'}); }); it('should use them after the builtin ones for number inputs', function() { createInput('number'); scope.$apply('val = {part: 1}'); expect(inputElm.val()).toBe('1'); inputElm.val('2'); browserTrigger(inputElm, 'change'); expect(scope.val).toEqual({part: 2}); }); it('should use them after the builtin ones for date inputs', function() { createInput('date'); scope.$apply(function() { scope.val = {part: new Date(2000, 10, 8)}; }); expect(inputElm.val()).toBe('2000-11-08'); inputElm.val('2001-12-09'); browserTrigger(inputElm, 'change'); expect(scope.val).toEqual({part: new Date(2001, 11, 9)}); }); }); describe('$touched', function() { it('should set the control touched state on "blur" event', inject(function($compile, $rootScope) { var element = $compile('<form name="myForm">' + '<input name="myControl" ng-model="value" >' + '</form>')($rootScope); var inputElm = element.find('input'); var control = $rootScope.myForm.myControl; expect(control.$touched).toBe(false); expect(control.$untouched).toBe(true); browserTrigger(inputElm, 'blur'); expect(control.$touched).toBe(true); expect(control.$untouched).toBe(false); dealoc(element); })); it('should not cause a digest on "blur" event if control is already touched', inject(function($compile, $rootScope) { var element = $compile('<form name="myForm">' + '<input name="myControl" ng-model="value" >' + '</form>')($rootScope); var inputElm = element.find('input'); var control = $rootScope.myForm.myControl; control.$setTouched(); spyOn($rootScope, '$apply'); browserTrigger(inputElm, 'blur'); expect($rootScope.$apply).not.toHaveBeenCalled(); dealoc(element); })); it('should digest asynchronously on "blur" event if a apply is already in progress', inject(function($compile, $rootScope) { var element = $compile('<form name="myForm">' + '<input name="myControl" ng-model="value" >' + '</form>')($rootScope); var inputElm = element.find('input'); var control = $rootScope.myForm.myControl; $rootScope.$apply(function() { expect(control.$touched).toBe(false); expect(control.$untouched).toBe(true); browserTrigger(inputElm, 'blur'); expect(control.$touched).toBe(false); expect(control.$untouched).toBe(true); }); expect(control.$touched).toBe(true); expect(control.$untouched).toBe(false); dealoc(element); })); }); describe('nested in a form', function() { it('should register/deregister a nested ngModel with parent form when entering or leaving DOM', inject(function($compile, $rootScope) { var element = $compile('<form name="myForm">' + '<input ng-if="inputPresent" name="myControl" ng-model="value" required >' + '</form>')($rootScope); var isFormValid; $rootScope.inputPresent = false; $rootScope.$watch('myForm.$valid', function(value) { isFormValid = value; }); $rootScope.$apply(); expect($rootScope.myForm.$valid).toBe(true); expect(isFormValid).toBe(true); expect($rootScope.myForm.myControl).toBeUndefined(); $rootScope.inputPresent = true; $rootScope.$apply(); expect($rootScope.myForm.$valid).toBe(false); expect(isFormValid).toBe(false); expect($rootScope.myForm.myControl).toBeDefined(); $rootScope.inputPresent = false; $rootScope.$apply(); expect($rootScope.myForm.$valid).toBe(true); expect(isFormValid).toBe(true); expect($rootScope.myForm.myControl).toBeUndefined(); dealoc(element); })); it('should register/deregister a nested ngModel with parent form when entering or leaving DOM with animations', function() { // ngAnimate performs the dom manipulation after digest, and since the form validity can be affected by a form // control going away we must ensure that the deregistration happens during the digest while we are still doing // dirty checking. module('ngAnimate'); inject(function($compile, $rootScope) { var element = $compile('<form name="myForm">' + '<input ng-if="inputPresent" name="myControl" ng-model="value" required >' + '</form>')($rootScope); var isFormValid; $rootScope.inputPresent = false; // this watch ensure that the form validity gets updated during digest (so that we can observe it) $rootScope.$watch('myForm.$valid', function(value) { isFormValid = value; }); $rootScope.$apply(); expect($rootScope.myForm.$valid).toBe(true); expect(isFormValid).toBe(true); expect($rootScope.myForm.myControl).toBeUndefined(); $rootScope.inputPresent = true; $rootScope.$apply(); expect($rootScope.myForm.$valid).toBe(false); expect(isFormValid).toBe(false); expect($rootScope.myForm.myControl).toBeDefined(); $rootScope.inputPresent = false; $rootScope.$apply(); expect($rootScope.myForm.$valid).toBe(true); expect(isFormValid).toBe(true); expect($rootScope.myForm.myControl).toBeUndefined(); dealoc(element); }); }); it('should keep previously defined watches consistent when changes in validity are made', inject(function($compile, $rootScope) { var isFormValid; $rootScope.$watch('myForm.$valid', function(value) { isFormValid = value; }); var element = $compile('<form name="myForm">' + '<input name="myControl" ng-model="value" required >' + '</form>')($rootScope); $rootScope.$apply(); expect(isFormValid).toBe(false); expect($rootScope.myForm.$valid).toBe(false); $rootScope.value='value'; $rootScope.$apply(); expect(isFormValid).toBe(true); expect($rootScope.myForm.$valid).toBe(true); dealoc(element); })); }); describe('animations', function() { function findElementAnimations(element, queue) { var node = element[0]; var animations = []; for (var i = 0; i < queue.length; i++) { var animation = queue[i]; if (animation.element[0] == node) { animations.push(animation); } } return animations; } function assertValidAnimation(animation, event, classNameA, classNameB) { expect(animation.event).toBe(event); expect(animation.args[1]).toBe(classNameA); if (classNameB) expect(animation.args[2]).toBe(classNameB); } var doc, input, scope, model; beforeEach(module('ngAnimateMock')); beforeEach(inject(function($rootScope, $compile, $rootElement, $animate) { scope = $rootScope.$new(); doc = jqLite('<form name="myForm">' + ' <input type="text" ng-model="input" name="myInput" />' + '</form>'); $rootElement.append(doc); $compile(doc)(scope); $animate.queue = []; input = doc.find('input'); model = scope.myForm.myInput; })); afterEach(function() { dealoc(input); }); it('should trigger an animation when invalid', inject(function($animate) { model.$setValidity('required', false); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'removeClass', 'ng-valid'); assertValidAnimation(animations[1], 'addClass', 'ng-invalid'); assertValidAnimation(animations[2], 'addClass', 'ng-invalid-required'); })); it('should trigger an animation when valid', inject(function($animate) { model.$setValidity('required', false); $animate.queue = []; model.$setValidity('required', true); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'addClass', 'ng-valid'); assertValidAnimation(animations[1], 'removeClass', 'ng-invalid'); assertValidAnimation(animations[2], 'addClass', 'ng-valid-required'); assertValidAnimation(animations[3], 'removeClass', 'ng-invalid-required'); })); it('should trigger an animation when dirty', inject(function($animate) { model.$setViewValue('some dirty value'); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'removeClass', 'ng-empty'); assertValidAnimation(animations[1], 'addClass', 'ng-not-empty'); assertValidAnimation(animations[2], 'removeClass', 'ng-pristine'); assertValidAnimation(animations[3], 'addClass', 'ng-dirty'); })); it('should trigger an animation when pristine', inject(function($animate) { model.$setPristine(); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'removeClass', 'ng-dirty'); assertValidAnimation(animations[1], 'addClass', 'ng-pristine'); })); it('should trigger an animation when untouched', inject(function($animate) { model.$setUntouched(); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'setClass', 'ng-untouched'); expect(animations[0].args[2]).toBe('ng-touched'); })); it('should trigger an animation when touched', inject(function($animate) { model.$setTouched(); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'setClass', 'ng-touched', 'ng-untouched'); expect(animations[0].args[2]).toBe('ng-untouched'); })); it('should trigger custom errors as addClass/removeClass when invalid/valid', inject(function($animate) { model.$setValidity('custom-error', false); var animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'removeClass', 'ng-valid'); assertValidAnimation(animations[1], 'addClass', 'ng-invalid'); assertValidAnimation(animations[2], 'addClass', 'ng-invalid-custom-error'); $animate.queue = []; model.$setValidity('custom-error', true); animations = findElementAnimations(input, $animate.queue); assertValidAnimation(animations[0], 'addClass', 'ng-valid'); assertValidAnimation(animations[1], 'removeClass', 'ng-invalid'); assertValidAnimation(animations[2], 'addClass', 'ng-valid-custom-error'); assertValidAnimation(animations[3], 'removeClass', 'ng-invalid-custom-error'); })); }); }); describe('ngModelOptions attributes', function() { var helper, $rootScope, $compile, $timeout, $q; beforeEach(function() { helper = getInputCompileHelper(this); }); afterEach(function() { helper.dealoc(); }); beforeEach(inject(function(_$compile_, _$rootScope_, _$timeout_, _$q_) { $compile = _$compile_; $rootScope = _$rootScope_; $timeout = _$timeout_; $q = _$q_; })); it('should allow overriding the model update trigger event on text inputs', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur\' }"' + '/>'); helper.changeInputValueTo('a'); expect($rootScope.name).toBeUndefined(); browserTrigger(inputElm, 'blur'); expect($rootScope.name).toEqual('a'); }); it('should not dirty the input if nothing was changed before updateOn trigger', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur\' }"' + '/>'); browserTrigger(inputElm, 'blur'); expect($rootScope.form.alias.$pristine).toBeTruthy(); }); it('should allow overriding the model update trigger event on text areas', function() { var inputElm = helper.compileInput( '<textarea ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur\' }"' + '/>'); helper.changeInputValueTo('a'); expect($rootScope.name).toBeUndefined(); browserTrigger(inputElm, 'blur'); expect($rootScope.name).toEqual('a'); }); it('should bind the element to a list of events', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur mousemove\' }"' + '/>'); helper.changeInputValueTo('a'); expect($rootScope.name).toBeUndefined(); browserTrigger(inputElm, 'blur'); expect($rootScope.name).toEqual('a'); helper.changeInputValueTo('b'); expect($rootScope.name).toEqual('a'); browserTrigger(inputElm, 'mousemove'); expect($rootScope.name).toEqual('b'); }); it('should allow keeping the default update behavior on text inputs', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'default\' }"' + '/>'); helper.changeInputValueTo('a'); expect($rootScope.name).toEqual('a'); }); it('should allow sharing options between multiple inputs', function() { $rootScope.options = {updateOn: 'default'}; var inputElm = helper.compileInput( '<input type="text" ng-model="name1" name="alias1" ' + 'ng-model-options="options"' + '/>' + '<input type="text" ng-model="name2" name="alias2" ' + 'ng-model-options="options"' + '/>'); helper.changeGivenInputTo(inputElm.eq(0), 'a'); helper.changeGivenInputTo(inputElm.eq(1), 'b'); expect($rootScope.name1).toEqual('a'); expect($rootScope.name2).toEqual('b'); }); it('should hold a copy of the options object', function() { $rootScope.options = {updateOn: 'default'}; var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="options"' + '/>'); expect($rootScope.options).toEqual({updateOn: 'default'}); expect($rootScope.form.alias.$options).not.toBe($rootScope.options); }); it('should allow overriding the model update trigger event on checkboxes', function() { var inputElm = helper.compileInput( '<input type="checkbox" ng-model="checkbox" ' + 'ng-model-options="{ updateOn: \'blur\' }"' + '/>'); browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(undefined); browserTrigger(inputElm, 'blur'); expect($rootScope.checkbox).toBe(true); browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(true); }); it('should allow keeping the default update behavior on checkboxes', function() { var inputElm = helper.compileInput( '<input type="checkbox" ng-model="checkbox" ' + 'ng-model-options="{ updateOn: \'blur default\' }"' + '/>'); browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(true); browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(false); }); it('should allow overriding the model update trigger event on radio buttons', function() { var inputElm = helper.compileInput( '<input type="radio" ng-model="color" value="white" ' + 'ng-model-options="{ updateOn: \'blur\'}"' + '/>' + '<input type="radio" ng-model="color" value="red" ' + 'ng-model-options="{ updateOn: \'blur\'}"' + '/>' + '<input type="radio" ng-model="color" value="blue" ' + 'ng-model-options="{ updateOn: \'blur\'}"' + '/>'); $rootScope.$apply("color = 'white'"); browserTrigger(inputElm[2], 'click'); expect($rootScope.color).toBe('white'); browserTrigger(inputElm[2], 'blur'); expect($rootScope.color).toBe('blue'); }); it('should allow keeping the default update behavior on radio buttons', function() { var inputElm = helper.compileInput( '<input type="radio" ng-model="color" value="white" ' + 'ng-model-options="{ updateOn: \'blur default\' }"' + '/>' + '<input type="radio" ng-model="color" value="red" ' + 'ng-model-options="{ updateOn: \'blur default\' }"' + '/>' + '<input type="radio" ng-model="color" value="blue" ' + 'ng-model-options="{ updateOn: \'blur default\' }"' + '/>'); $rootScope.$apply("color = 'white'"); browserTrigger(inputElm[2], 'click'); expect($rootScope.color).toBe('blue'); }); it('should trigger only after timeout in text inputs', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ debounce: 10000 }"' + '/>'); helper.changeInputValueTo('a'); helper.changeInputValueTo('b'); helper.changeInputValueTo('c'); expect($rootScope.name).toEqual(undefined); $timeout.flush(2000); expect($rootScope.name).toEqual(undefined); $timeout.flush(9000); expect($rootScope.name).toEqual('c'); }); it('should trigger only after timeout in checkboxes', function() { var inputElm = helper.compileInput( '<input type="checkbox" ng-model="checkbox" ' + 'ng-model-options="{ debounce: 10000 }"' + '/>'); browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(2000); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(9000); expect($rootScope.checkbox).toBe(true); }); it('should trigger only after timeout in radio buttons', function() { var inputElm = helper.compileInput( '<input type="radio" ng-model="color" value="white" />' + '<input type="radio" ng-model="color" value="red" ' + 'ng-model-options="{ debounce: 20000 }"' + '/>' + '<input type="radio" ng-model="color" value="blue" ' + 'ng-model-options="{ debounce: 30000 }"' + '/>'); browserTrigger(inputElm[0], 'click'); expect($rootScope.color).toBe('white'); browserTrigger(inputElm[1], 'click'); expect($rootScope.color).toBe('white'); $timeout.flush(12000); expect($rootScope.color).toBe('white'); $timeout.flush(10000); expect($rootScope.color).toBe('red'); }); it('should not trigger digest while debouncing', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ debounce: 10000 }"' + '/>'); var watchSpy = jasmine.createSpy('watchSpy'); $rootScope.$watch(watchSpy); helper.changeInputValueTo('a'); expect(watchSpy).not.toHaveBeenCalled(); $timeout.flush(10000); expect(watchSpy).toHaveBeenCalled(); }); it('should allow selecting different debounce timeouts for each event', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{' + 'updateOn: \'default blur\', ' + 'debounce: { default: 10000, blur: 5000 }' + '}"' + '/>'); helper.changeInputValueTo('a'); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(6000); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(4000); expect($rootScope.name).toEqual('a'); helper.changeInputValueTo('b'); browserTrigger(inputElm, 'blur'); $timeout.flush(4000); expect($rootScope.name).toEqual('a'); $timeout.flush(2000); expect($rootScope.name).toEqual('b'); }); it('should allow selecting different debounce timeouts for each event on checkboxes', function() { var inputElm = helper.compileInput('<input type="checkbox" ng-model="checkbox" ' + 'ng-model-options="{ ' + 'updateOn: \'default blur\', debounce: { default: 10000, blur: 5000 } }"' + '/>'); inputElm[0].checked = false; browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(8000); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(3000); expect($rootScope.checkbox).toBe(true); inputElm[0].checked = true; browserTrigger(inputElm, 'click'); browserTrigger(inputElm, 'blur'); $timeout.flush(3000); expect($rootScope.checkbox).toBe(true); $timeout.flush(3000); expect($rootScope.checkbox).toBe(false); }); it('should allow selecting 0 for non-default debounce timeouts for each event on checkboxes', function() { var inputElm = helper.compileInput('<input type="checkbox" ng-model="checkbox" ' + 'ng-model-options="{ ' + 'updateOn: \'default blur\', debounce: { default: 10000, blur: 0 } }"' + '/>'); inputElm[0].checked = false; browserTrigger(inputElm, 'click'); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(8000); expect($rootScope.checkbox).toBe(undefined); $timeout.flush(3000); expect($rootScope.checkbox).toBe(true); inputElm[0].checked = true; browserTrigger(inputElm, 'click'); browserTrigger(inputElm, 'blur'); $timeout.flush(0); expect($rootScope.checkbox).toBe(false); }); it('should inherit model update settings from ancestor elements', function() { var doc = $compile( '<form name="test" ' + 'ng-model-options="{ debounce: 10000, updateOn: \'blur\' }" >' + '<input type="text" ng-model="name" name="alias" />' + '</form>')($rootScope); $rootScope.$digest(); var inputElm = doc.find('input').eq(0); helper.changeGivenInputTo(inputElm, 'a'); expect($rootScope.name).toEqual(undefined); browserTrigger(inputElm, 'blur'); expect($rootScope.name).toBe(undefined); $timeout.flush(2000); expect($rootScope.name).toBe(undefined); $timeout.flush(9000); expect($rootScope.name).toEqual('a'); dealoc(doc); }); it('should flush debounced events when calling $commitViewValue directly', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ debounce: 1000 }" />'); helper.changeInputValueTo('a'); expect($rootScope.name).toEqual(undefined); $rootScope.form.alias.$commitViewValue(); expect($rootScope.name).toEqual('a'); }); it('should cancel debounced events when calling $commitViewValue', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ debounce: 1000 }"/>'); helper.changeInputValueTo('a'); $rootScope.form.alias.$commitViewValue(); expect($rootScope.name).toEqual('a'); $rootScope.form.alias.$setPristine(); $timeout.flush(1000); expect($rootScope.form.alias.$pristine).toBeTruthy(); }); it('should reset input val if rollbackViewValue called during pending update', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur\' }" />'); helper.changeInputValueTo('a'); expect(inputElm.val()).toBe('a'); $rootScope.form.alias.$rollbackViewValue(); expect(inputElm.val()).toBe(''); browserTrigger(inputElm, 'blur'); expect(inputElm.val()).toBe(''); }); it('should allow canceling pending updates', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur\' }" />'); helper.changeInputValueTo('a'); expect($rootScope.name).toEqual(undefined); $rootScope.form.alias.$rollbackViewValue(); expect($rootScope.name).toEqual(undefined); browserTrigger(inputElm, 'blur'); expect($rootScope.name).toEqual(undefined); }); it('should allow canceling debounced updates', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ debounce: 10000 }" />'); helper.changeInputValueTo('a'); expect($rootScope.name).toEqual(undefined); $timeout.flush(2000); $rootScope.form.alias.$rollbackViewValue(); expect($rootScope.name).toEqual(undefined); $timeout.flush(10000); expect($rootScope.name).toEqual(undefined); }); it('should handle model updates correctly even if rollbackViewValue is not invoked', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ updateOn: \'blur\' }" />'); helper.changeInputValueTo('a'); $rootScope.$apply("name = 'b'"); browserTrigger(inputElm, 'blur'); expect($rootScope.name).toBe('b'); }); it('should reset input val if rollbackViewValue called during debounce', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" name="alias" ' + 'ng-model-options="{ debounce: 2000 }" />'); helper.changeInputValueTo('a'); expect(inputElm.val()).toBe('a'); $rootScope.form.alias.$rollbackViewValue(); expect(inputElm.val()).toBe(''); $timeout.flush(3000); expect(inputElm.val()).toBe(''); }); it('should not try to invoke a model if getterSetter is false', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" ' + 'ng-model-options="{ getterSetter: false }" />'); var spy = $rootScope.name = jasmine.createSpy('setterSpy'); helper.changeInputValueTo('a'); expect(spy).not.toHaveBeenCalled(); expect(inputElm.val()).toBe('a'); }); it('should not try to invoke a model if getterSetter is not set', function() { var inputElm = helper.compileInput('<input type="text" ng-model="name" />'); var spy = $rootScope.name = jasmine.createSpy('setterSpy'); helper.changeInputValueTo('a'); expect(spy).not.toHaveBeenCalled(); expect(inputElm.val()).toBe('a'); }); it('should try to invoke a function model if getterSetter is true', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" ' + 'ng-model-options="{ getterSetter: true }" />'); var spy = $rootScope.name = jasmine.createSpy('setterSpy').andCallFake(function() { return 'b'; }); $rootScope.$apply(); expect(inputElm.val()).toBe('b'); helper.changeInputValueTo('a'); expect(inputElm.val()).toBe('b'); expect(spy).toHaveBeenCalledWith('a'); expect($rootScope.name).toBe(spy); }); it('should assign to non-function models if getterSetter is true', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="name" ' + 'ng-model-options="{ getterSetter: true }" />'); $rootScope.name = 'c'; helper.changeInputValueTo('d'); expect(inputElm.val()).toBe('d'); expect($rootScope.name).toBe('d'); }); it('should fail on non-assignable model binding if getterSetter is false', function() { expect(function() { var inputElm = helper.compileInput('<input type="text" ng-model="accessor(user, \'name\')" />'); }).toThrowMinErr('ngModel', 'nonassign', 'Expression \'accessor(user, \'name\')\' is non-assignable.'); }); it('should not fail on non-assignable model binding if getterSetter is true', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="accessor(user, \'name\')" ' + 'ng-model-options="{ getterSetter: true }" />'); }); it('should invoke a model in the correct context if getterSetter is true', function() { var inputElm = helper.compileInput( '<input type="text" ng-model="someService.getterSetter" ' + 'ng-model-options="{ getterSetter: true }" />'); $rootScope.someService = { value: 'a', getterSetter: function(newValue) { this.value = newValue || this.value; return this.value; } }; spyOn($rootScope.someService, 'getterSetter').andCallThrough(); $rootScope.$apply(); expect(inputElm.val()).toBe('a'); expect($rootScope.someService.getterSetter).toHaveBeenCalledWith(); expect($rootScope.someService.value).toBe('a'); helper.changeInputValueTo('b'); expect($rootScope.someService.getterSetter).toHaveBeenCalledWith('b'); expect($rootScope.someService.value).toBe('b'); $rootScope.someService.value = 'c'; $rootScope.$apply(); expect(inputElm.val()).toBe('c'); expect($rootScope.someService.getterSetter).toHaveBeenCalledWith(); }); it('should assign invalid values to the scope if allowInvalid is true', function() { var inputElm = helper.compileInput('<input type="text" name="input" ng-model="value" maxlength="1" ' + 'ng-model-options="{allowInvalid: true}" />'); helper.changeInputValueTo('12345'); expect($rootScope.value).toBe('12345'); expect(inputElm).toBeInvalid(); }); it('should not assign not parsable values to the scope if allowInvalid is true', function() { var inputElm = helper.compileInput('<input type="number" name="input" ng-model="value" ' + 'ng-model-options="{allowInvalid: true}" />', { valid: false, badInput: true }); helper.changeInputValueTo('abcd'); expect($rootScope.value).toBeUndefined(); expect(inputElm).toBeInvalid(); }); it('should update the scope before async validators execute if allowInvalid is true', function() { var inputElm = helper.compileInput('<input type="text" name="input" ng-model="value" ' + 'ng-model-options="{allowInvalid: true}" />'); var defer; $rootScope.form.input.$asyncValidators.promiseValidator = function(value) { defer = $q.defer(); return defer.promise; }; helper.changeInputValueTo('12345'); expect($rootScope.value).toBe('12345'); expect($rootScope.form.input.$pending.promiseValidator).toBe(true); defer.reject(); $rootScope.$digest(); expect($rootScope.value).toBe('12345'); expect(inputElm).toBeInvalid(); }); it('should update the view before async validators execute if allowInvalid is true', function() { var inputElm = helper.compileInput('<input type="text" name="input" ng-model="value" ' + 'ng-model-options="{allowInvalid: true}" />'); var defer; $rootScope.form.input.$asyncValidators.promiseValidator = function(value) { defer = $q.defer(); return defer.promise; }; $rootScope.$apply('value = \'12345\''); expect(inputElm.val()).toBe('12345'); expect($rootScope.form.input.$pending.promiseValidator).toBe(true); defer.reject(); $rootScope.$digest(); expect(inputElm.val()).toBe('12345'); expect(inputElm).toBeInvalid(); }); it('should not call ng-change listeners twice if the model did not change with allowInvalid', function() { var inputElm = helper.compileInput('<input type="text" name="input" ng-model="value" ' + 'ng-model-options="{allowInvalid: true}" ng-change="changed()" />'); $rootScope.changed = jasmine.createSpy('changed'); $rootScope.form.input.$parsers.push(function(value) { return 'modelValue'; }); helper.changeInputValueTo('input1'); expect($rootScope.value).toBe('modelValue'); expect($rootScope.changed).toHaveBeenCalledOnce(); helper.changeInputValueTo('input2'); expect($rootScope.value).toBe('modelValue'); expect($rootScope.changed).toHaveBeenCalledOnce(); }); });
m-amr/angular.js
test/ng/directive/ngModelSpec.js
JavaScript
mit
75,252
module("Director.js", { setup: function() { window.location.hash = ""; shared = {}; }, teardown: function() { window.location.hash = ""; shared = {}; } }); var shared; function createTest(name, config, use, test) { if (typeof use === 'function') { test = use; use = undefined; } asyncTest(name, function() { setTimeout(function() { var router = new Router(config), context; if (use !== undefined) { router.configure(use); } router.init(); test.call(context = { router: router, navigate: function(url, callback) { window.location.hash = url; setTimeout(function() { callback.call(context); }, 14); }, finish: function() { router.destroy(); start(); } }); }, 14); }); };
lukemorton/director
test/browser/helpers/api.js
JavaScript
mit
878
<?php return [ /* |-------------------------------------------------------------------------- | Validation Language Lines |-------------------------------------------------------------------------- | | The following language lines contain the default error messages used by | the validator class. Some of these rules have multiple versions such | such as the size rules. Feel free to tweak each of these messages. | */ "accepted" => ":attribute deve essere accettato.", "active_url" => ":attribute non è un URL valido.", "after" => ":attribute deve essere una data maggiore di :date.", "alpha" => ":attribute può contenere solo lettere.", "alpha_dash" => ":attribute può contenere solo lettere, numeri e trattini.", "alpha_num" => ":attribute può contenere solo lettere e numeri.", "array" => ":attribute deve essere un array.", "before" => ":attribute deve essere una data minore di :date.", "between" => [ "numeric" => ":attribute deve essere compreso tra :min e :max.", "file" => ":attribute deve essere compreso tra :min e :max kilobytes.", "string" => ":attribute deve essere compreso tra :min e :max caratteri.", "array" => ":attribute deve avere tra :min e :max elementi.", ], "confirmed" => "La conferma :attribute non corrisponde.", "date" => ":attribute non è una data valida.", "date_format" => ":attribute non corrisponde al formato :format.", "different" => ":attribute e :other devono essere diversi.", "digits" => ":attribute deve essere di :digits cifre.", "digits_between" => ":attribute deve essere tra :min e :max cifre.", "email" => "Il formato di :attribute non è valido.", "exists" => "Il valore di :attribute non è valido.", "image" => ":attribute deve essere un'immagine.", "in" => "Il valore di :attribute non è valido.", "integer" => ":attribute deve essere un numero interno.", "ip" => ":attribute deve essere un indirizzo IP valido.", "max" => [ "numeric" => ":attribute non può essere maggiore di :max.", "file" => ":attribute non può essere maggiore di :max kilobytes.", "string" => ":attribute non può essere maggiore di :max caratteri.", "array" => ":attribute non può avere più di :max elementi.", ], "mimes" => ":attribute deve essere un file di tipo: :values.", "extensions" => ":attribute deve avere un estensione: :values.", "min" => [ "numeric" => ":attribute deve essere almeno :min.", "file" => ":attribute deve essere almeno :min kilobytes.", "string" => ":attribute deve essere almeno :min caratteri.", "array" => ":attribute deve avere almeno :min elementi.", ], "not_in" => "Il valore di :attribute non è valido.", "numeric" => ":attribute deve essere un numero.", "regex" => "Il formato di :attribute non è valido.", "required" => "Il campo :attribute è obbligatorio.", "required_if" => "Il campo :attribute è obbligatorio quando :other è :value.", "required_with" => "Il campo :attribute è obbligatorio quando :values è presente.", "required_without" => "Il campo :attribute è obbligatorio quando :values non è presente.", "same" => ":attribute e :other devono corrispondere.", "size" => [ "numeric" => ":attribute deve essere :size.", "file" => ":attribute deve essere :size kilobytes.", "string" => ":attribute deve essere :size caratteri.", "array" => ":attribute deve contenere :size elementi.", ], "unique" => ":attribute è già presente.", "url" => "Il formato di :attribute non è valido.", /* |-------------------------------------------------------------------------- | Custom Validation Language Lines |-------------------------------------------------------------------------- | | Here you may specify custom validation messages for attributes using the | convention "attribute.rule" to name the lines. This makes it quick to | specify a specific custom language line for a given attribute rule. | */ 'custom' => [], /* |-------------------------------------------------------------------------- | Custom Validation Attributes |-------------------------------------------------------------------------- | | The following language lines are used to swap attribute place-holders | with something more reader friendly such as E-Mail Address instead | of "email". This simply helps us make messages a little cleaner. | */ 'attributes' => [], ];
c57fr/c57
modules/system/lang/it/validation.php
PHP
mit
4,997
import * as React from 'react'; import { SxProps } from '@material-ui/system'; import { InternalStandardProps as StandardProps } from '..'; import { FormLabelProps } from '../FormLabel'; import { Theme } from '../styles'; export interface InputLabelProps extends StandardProps<FormLabelProps> { /** * The content of the component. */ children?: React.ReactNode; /** * Override or extend the styles applied to the component. */ classes?: { /** Styles applied to the root element. */ root?: string; /** Pseudo-class applied to the root element if `focused={true}`. */ focused?: string; /** Pseudo-class applied to the root element if `disabled={true}`. */ disabled?: string; /** Pseudo-class applied to the root element if `error={true}`. */ error?: string; /** Pseudo-class applied to the root element if `required={true}`. */ required?: string; /** Pseudo-class applied to the asterisk element. */ asterisk?: string; /** Styles applied to the root element if the component is a descendant of `FormControl`. */ formControl?: string; /** Styles applied to the root element if `size="small"`. */ sizeSmall?: string; /** Styles applied to the input element if `shrink={true}`. */ shrink?: string; /** Styles applied to the input element unless `disableAnimation={true}`. */ animated?: string; /** Styles applied to the root element if `variant="filled"`. */ filled?: string; /** Styles applied to the root element if `variant="outlined"`. */ outlined?: string; }; color?: FormLabelProps['color']; /** * If `true`, the transition animation is disabled. * @default false */ disableAnimation?: boolean; /** * If `true`, the component is disabled. */ disabled?: boolean; /** * If `true`, the label is displayed in an error state. */ error?: boolean; /** * If `true`, the `input` of this label is focused. */ focused?: boolean; /** * If `dense`, will adjust vertical spacing. This is normally obtained via context from * FormControl. */ margin?: 'dense'; /** * if `true`, the label will indicate that the `input` is required. */ required?: boolean; /** * If `true`, the label is shrunk. */ shrink?: boolean; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps<Theme>; /** * The variant to use. */ variant?: 'standard' | 'outlined' | 'filled'; } export type InputLabelClassKey = keyof NonNullable<InputLabelProps['classes']>; /** * * Demos: * * - [Text Fields](https://material-ui.com/components/text-fields/) * * API: * * - [InputLabel API](https://material-ui.com/api/input-label/) * - inherits [FormLabel API](https://material-ui.com/api/form-label/) */ export default function InputLabel(props: InputLabelProps): JSX.Element;
callemall/material-ui
packages/material-ui/src/InputLabel/InputLabel.d.ts
TypeScript
mit
2,907
<!DOCTYPE html> <title>Canvas tests - 2d.path.clip.winding.*</title> <link rel="stylesheet" href="../frame.css"> <p><a href="index.html">[index]</a> <h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.winding.*</h1> <p> <iframe width="200" height="220" src="framed.2d.path.clip.winding.1.html">(iframe fallback)</iframe><!-- --><iframe width="200" height="220" src="framed.2d.path.clip.winding.2.html">(iframe fallback)</iframe><!-- -->
corbanbrook/webgl-2d
test/philip.html5.org/tests/index.2d.path.clip.winding.html
HTML
mit
500
import * as React from 'react'; import { IconBaseProps } from 'react-icon-base'; export default class MdNfc extends React.Component<IconBaseProps, any> { }
smrq/DefinitelyTyped
types/react-icons/md/nfc.d.ts
TypeScript
mit
156
({"he":"עברית","hello":"שלום","yi":"Yiddish","en-us-texas":"English (Texas)","es":"Spanish","de":"German","pl":"Polish","hello_dojo":"${hello}, ${dojo}!","fa":"Farsi","pt":"Portugese","zh-tw":"Chinese (Traditional)","sw":"Kiswahili","ar":"Arabic","en-us-new_york-brooklyn":"English (Brooklynese)","ru":"Russian","fr":"French","th":"Thai","it":"Italian","cs":"Czech","hi":"Hindi","en-us-hawaii":"English (US-Hawaii)","file_not_found":"The file you requested, ${0}, is not found.","en-au":"English (Australia)","el":"Greek","ko":"Korean","tr":"Turkish","en":"English","ja":"Japanese","zh-cn":"Chinese (Simplified)","dojo":"Dojo"})
Goldcap/TAHealth
web/js/dojo/dojo/tests/nls/he/salutations.js
JavaScript
mit
637
<html> <head> <link rel="stylesheet" href="../assets/javascripts/combine/combine.css"> <script src="../assets/javascripts/combine/combine.js"></script> <!-- <script src="http://code.jquery.com/jquery-1.8.2.js"></script> <script src="http://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['controls', 'charteditor']}]}"></script> <script src="http://jquery-csv.googlecode.com/git/src/jquery.csv.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> --> <script> $(function() { google.load("visualization", "1", {packages:["corechart"]}); var csv = $('#textInput').val(); var dt = google.visualization.arrayToDataTable($.csv.toArrays(csv, {onParseValue: $.csv.hooks.castToScalar})); function sortCaseInsensitive(dt, column) { for (var row = 0; row < dt.getNumberOfRows(); row++) { var s = dt.getValue(row, column); dt.setValue(row, column, s.toUpperCase()); dt.setFormattedValue(row, column, s); } dt.sort(column); } function AddToOverall(dt) { if (overallDt == null) { overallDt = dt.clone(); } else { var col1 = []; for (var i = 1; i < overallDt.getNumberOfColumns(); i++) col1.push(i); overallDt = google.visualization.data.join(overallDt, dt, 'full', [[0, 0]], col1, [1]); } var newCol = overallDt.getNumberOfColumns() - 1; overallDt.setColumnLabel(newCol, type + ' ' + overallDt.getColumnLabel(newCol)) var formatter1 = new google.visualization.NumberFormat({ fractionDigits: 0 }); formatter1.format(overallDt, newCol); for (var row = 0; row < overallDt.getNumberOfRows(); row++) { if (overallDt.getValue(row, newCol) == null) { overallDt.setValue(row, newCol, Number.POSITIVE_INFINITY); overallDt.setFormattedValue(row, newCol, ""); } } } function createSortEvent(type, dt, chart) { return function(e) { if (e.column == 0 || e.column == 1) { var t = dt.clone(); drawBarChart(type, t, chart, [{column: e.column, desc: !e.ascending }]); } } } addSection("0. Overall"); var overallDiv = document.createElement("div"); overallDiv.className = "tablechart"; $("#main").append(overallDiv); // Per type sections var types = dt.getDistinctValues(0); var overallDt; for (var i in types) { var type = types[i]; addSection(type); var view = new google.visualization.DataView(dt); view.setRows(view.getFilteredRows([{column: 0, value: type}])); if (type.search("Code size") != -1) { var sizedt = google.visualization.data.group( view, [1], [{"column": 7, "aggregation": google.visualization.data.sum, 'type': 'number' }] ); AddToOverall(sizedt); sortCaseInsensitive(sizedt, 0); addSubsection(sizedt.getColumnLabel(1)); var sizeTable = drawTable(type, sizedt.clone(), false); var sizeChart = drawBarChart(type, sizedt.clone()); google.visualization.events.addListener(sizeTable, 'sort', createSortEvent(type, sizedt, sizeChart)); } else { addSubsection("Time"); var timedt = google.visualization.data.group( view, [1], [{"column": 3, "aggregation": google.visualization.data.sum, 'type': 'number' }] ); AddToOverall(timedt); sortCaseInsensitive(timedt, 0); var timeTable = drawTable(type, timedt.clone(), true); var timeChart = drawBarChart(type, timedt.clone()); google.visualization.events.addListener(timeTable, 'sort', createSortEvent(type, timedt, timeChart)); // Per JSON drawPivotBarChart( type + " per JSON", pivotTable(google.visualization.data.group( view, [2, 1], [{"column": 3, "aggregation": google.visualization.data.sum, 'type': 'number' }] )), dt.getColumnLabel(3) ); // Only show memory of Parse if (type.search("Parse") != -1) { for (var column = 4; column <= 6; column++) { var memorydt = google.visualization.data.group( view, [1], [{"column": column, "aggregation": google.visualization.data.sum, 'type': 'number' }] ); AddToOverall(memorydt); sortCaseInsensitive(memorydt, 0); addSubsection(memorydt.getColumnLabel(1)); var memoryTable = drawTable(type, memorydt.clone(), false); var memoryChart = drawBarChart(type, memorydt.clone()); google.visualization.events.addListener(memoryTable, 'sort', createSortEvent(type, memorydt, memoryChart)); } } } } var overallTable = new google.visualization.Table(overallDiv); sortCaseInsensitive(overallDt, 0); overallTable.draw(overallDt); $(".chart").each(function() { var chart = $(this); var d = $("#downloadDD").clone().css("display", ""); $('li a', d).each(function() { $(this).click(function() { var svg = chart[0].getElementsByTagName('svg')[0].parentNode.innerHTML; svg=sanitize(svg); $('#imageFilename').val($("#title").html() + "_" + chart.data("filename")); $('#imageGetFormTYPE').val($(this).attr('dltype')); $('#imageGetFormSVG').val(svg); $('#imageGetForm').submit(); }); }); $(this).after(d); }); // Add configurations var thisConfig = "performance_Corei7-6820HQ@2.70GHz_mac64_clang9.0"; var configurations = ["conformance","performance_Corei7-6820HQ@2.70GHz_mac64_clang9.0"]; for (var i in configurations) { var c = configurations[i]; $("#benchmark").append($("<li>", {class : (c == thisConfig ? "active" : "")}).append($("<a>", {href: c + ".html"}).append(c))); } }); function pivotTable(src) { var dst = new google.visualization.DataTable(); // Add columns var key = src.getDistinctValues(1); var keyColumnMap = {}; dst.addColumn(src.getColumnType(0), src.getColumnLabel(0)); for (var k in key) keyColumnMap[key[k]] = dst.addColumn(src.getColumnType(2), key[k]); // Add rows var pivot = src.getDistinctValues(0); var pivotRowMap = {}; for (var p in pivot) dst.setValue(pivotRowMap[[pivot[p]]] = dst.addRow(), 0, pivot[p]); // Fill cells for (var row = 0; row < src.getNumberOfRows(); row++) dst.setValue( pivotRowMap[src.getValue(row, 0)], keyColumnMap[src.getValue(row, 1)], src.getValue(row, 2)); return dst; } function addSection(name) { $("#main").append( $("<a>", {"name": name}), $("<h2>", {style: "padding-top: 70px; margin-top: -70px;"}).append(name) ); $("#section").append($("<li>").append($("<a>", {href: "#" + name}).append(name))); } function addSubsection(name) { $("#main").append( $("<h3>", {style: "padding-top: 70px; margin-top: -70px;"}).append(name) ); } function drawTable(type, data, isSpeedup) { if (isSpeedup) data.addColumn('number', 'Speedup'); else data.addColumn('number', 'Ratio'); //data.sort([{ column: 1, desc: true }]); var formatter1 = new google.visualization.NumberFormat({ fractionDigits: 0 }); formatter1.format(data, 1); var div = document.createElement("div"); div.className = "tablechart"; $("#main").append(div); var table = new google.visualization.Table(div); redrawTable(0); table.setSelection([{ row: 0, column: null}]); function redrawTable(selectedRow) { var s = table.getSortInfo(); // Compute relative time using the first row as basis var basis = data.getValue(selectedRow, 1); for (var rowIndex = 0; rowIndex < data.getNumberOfRows(); rowIndex++) data.setValue(rowIndex, 2, isSpeedup ? basis / data.getValue(rowIndex, 1) : data.getValue(rowIndex, 1) / basis); var formatter = new google.visualization.NumberFormat({suffix: 'x'}); formatter.format(data, 2); // Apply formatter to second column table.draw(data, s != null ? {sortColumn: s.column, sortAscending: s.ascending} : null); } google.visualization.events.addListener(table, 'select', function() { var selection = table.getSelection(); if (selection.length > 0) { var item = selection[0]; if (item.row != null) redrawTable(item.row); } }); return table; } function drawBarChart(type, data, chart, sortOptions) { // Using same colors as in series var colors = ["#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac","#b77322","#16d620","#b91383","#f4359e","#9c5935","#a9c413","#2a778d","#668d1c","#bea413","#0c5922","#743411","#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac","#b77322","#16d620","#b91383","#f4359e","#9c5935","#a9c413","#2a778d","#668d1c","#bea413","#0c5922","#743411"]; var h = data.getNumberOfRows() * 12; var options = { title: type, chartArea: {left: '20%', width: '70%', height: h }, width: 800, height: h + 100, fontSize: 10, bar: {groupWidth: "80%"}, hAxis: { title: data.getColumnLabel(1) }, legend: { position: "none" }, }; data.addColumn({ type: "string", role: "style" }); data.addColumn({ type: "number", role: "annotation" }); for (var rowIndex = 0; rowIndex < data.getNumberOfRows(); rowIndex++) { data.setValue(rowIndex, 2, colors[rowIndex]); data.setValue(rowIndex, 3, data.getValue(rowIndex, 1)); } if (sortOptions != null) data.sort(sortOptions); // sort after assigning colors var formatter1 = new google.visualization.NumberFormat({ fractionDigits: 0 }); formatter1.format(data, 3); if (chart == null) { var div = document.createElement("div"); div.className = "chart"; $(div).data("filename", type + "_" + data.getColumnLabel(1)); $("#main").append(div); chart = new google.visualization.BarChart(div); } chart.draw(data, options); return chart; } function drawPivotBarChart(type, data, title) { var h = (data.getNumberOfColumns() + 1) * data.getNumberOfRows() * 5; var options = { title: type, chartArea: {left: '10%', width: '70%', 'height': h}, width: 800, height: h + 100, fontSize: 10, hAxis: { "title": title }, legend: { textStyle: {fontSize: 8}}, bar : { groupWidth: "95%" } }; var div = document.createElement("div"); div.className = "chart"; $(div).data("filename", type + "_" + title); $("#main").append(div); var chart = new google.visualization.BarChart(div); chart.draw(data, options); } // http://jsfiddle.net/P6XXM/ function sanitize(svg) { svg = svg .replace(/\<svg/,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1"') .replace(/zIndex="[^"]+"/g, '') .replace(/isShadow="[^"]+"/g, '') .replace(/symbolName="[^"]+"/g, '') .replace(/jQuery[0-9]+="[^"]+"/g, '') .replace(/isTracker="[^"]+"/g, '') .replace(/url\([^#]+#/g, 'url(#') .replace('<svg xmlns:xlink="http://www.w3.org/1999/xlink" ', '<svg ') .replace(/ href=/g, ' xlink:href=') /*.replace(/preserveAspectRatio="none">/g, 'preserveAspectRatio="none"/>')*/ /* This fails in IE < 8 .replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight return s2 +'.'+ s3[0]; })*/ // IE specific .replace(/id=([^" >]+)/g, 'id="$1"') .replace(/class=([^" ]+)/g, 'class="$1"') .replace(/ transform /g, ' ') .replace(/:(path|rect)/g, '$1') .replace(/<img ([^>]*)>/gi, '<image $1 />') .replace(/<\/image>/g, '') // remove closing tags for images as they'll never have any content .replace(/<image ([^>]*)([^\/])>/gi, '<image $1$2 />') // closes image tags for firefox .replace(/width=(\d+)/g, 'width="$1"') .replace(/height=(\d+)/g, 'height="$1"') .replace(/hc-svg-href="/g, 'xlink:href="') .replace(/style="([^"]+)"/g, function (s) { return s.toLowerCase(); }); // IE9 beta bugs with innerHTML. Test again with final IE9. svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1') .replace(/&quot;/g, "'"); if (svg.match(/ xmlns="/g).length == 2) { svg = svg.replace(/xmlns="[^"]+"/, ''); } return svg; } </script> <style type="text/css"> @media (min-width: 800px) { /* .container { max-width: 800px; }*/ } textarea { font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; } .tablechart { /* width: 500px; */ margin: auto; padding-top: 20px; padding-bottom: 20px; } .chart { padding-top: 20px; padding-bottom: 20px; } body { padding-top: 70px; } </style> </head> <body> <div class="container"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="https://github.com/miloyip/nativejson-benchmark"><span class="glyphicon glyphicon-home"></span> nativejson-benchmark</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Benchmark <span class="caret"></span></a> <ul class="dropdown-menu" role="menu" id="benchmark"> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Section <span class="caret"></span></a> <ul class="dropdown-menu" role="menu" id="section"> </ul> </li> </ul> <p class="navbar-text navbar-right">Developed by <a href="https://github.com/miloyip" class="navbar-link">Milo Yip</a></p> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div class="page-header"> <h1 id="title">performance_Corei7-6820HQ@2.70GHz_mac64_clang9.0</h1> </div> <div id="main"></div> <h2>Source CSV</h2> <textarea id="textInput" class="form-control" rows="5" readonly> Type,Library,Filename,Time (ms),Memory (byte),MemoryPeak (byte),AllocCount,FileSize (byte) 1. Parse,ArduinoJson (C++),canada.json,618.536000,11320704,11320704,17,0 1. Parse,ArduinoJson (C++),citm_catalog.json,2.399000,4869504,4869504,15,0 1. Parse,ArduinoJson (C++),twitter.json,2.074000,1715584,1715584,13,0 2. Stringify,ArduinoJson (C++),canada.json,59.555000,2252832,5398560,19,0 2. Stringify,ArduinoJson (C++),citm_catalog.json,11.880000,524320,1568800,17,0 2. Stringify,ArduinoJson (C++),twitter.json,10.699000,524320,1568800,17,0 3. Prettify,ArduinoJson (C++),canada.json,145.175000,5599264,14606368,20,0 3. Prettify,ArduinoJson (C++),citm_catalog.json,31.197000,2252832,3825696,18,0 3. Prettify,ArduinoJson (C++),twitter.json,17.890000,1052704,2097184,17,0 4. Statistics,ArduinoJson (C++),canada.json,46.319000,0,0,0,0 4. Statistics,ArduinoJson (C++),citm_catalog.json,0.925000,0,0,0,0 4. Statistics,ArduinoJson (C++),twitter.json,0.534000,0,0,0,0 7. Code size,ArduinoJson (C++),jsonstat,0,0,0,0,23080 1. Parse,ccan/json (C),canada.json,52.740000,10699872,10699872,167193,0 1. Parse,ccan/json (C),citm_catalog.json,6.937000,3337056,3337056,68345,0 1. Parse,ccan/json (C),twitter.json,4.682000,1800400,1800400,43523,0 2. Stringify,ccan/json (C),canada.json,65.015000,2101264,2101264,19,0 2. Stringify,ccan/json (C),citm_catalog.json,4.821000,528400,528400,17,0 2. Stringify,ccan/json (C),twitter.json,1.944000,528400,528400,17,0 3. Prettify,ccan/json (C),canada.json,84.528000,9007120,9007120,21,0 3. Prettify,ccan/json (C),citm_catalog.json,8.776000,2101264,2101264,19,0 3. Prettify,ccan/json (C),twitter.json,3.111000,1052688,1052688,18,0 4. Statistics,ccan/json (C),canada.json,0.718000,0,0,0,0 4. Statistics,ccan/json (C),citm_catalog.json,0.223000,0,0,0,0 4. Statistics,ccan/json (C),twitter.json,0.129000,0,0,0,0 7. Code size,ccan/json (C),jsonstat,0,0,0,0,31028 1. Parse,cJSON (C),canada.json,55.773000,10699680,10699680,167192,0 1. Parse,cJSON (C),citm_catalog.json,6.803000,2869872,2869872,64383,0 1. Parse,cJSON (C),twitter.json,3.445000,1424800,1424800,32014,0 2. Stringify,cJSON (C),canada.json,143.348000,4202512,4202512,12,0 2. Stringify,cJSON (C),citm_catalog.json,7.760000,528400,528400,9,0 2. Stringify,cJSON (C),twitter.json,2.258000,532496,532496,9,0 3. Prettify,cJSON (C),canada.json,145.916000,4210704,4210704,12,0 3. Prettify,cJSON (C),citm_catalog.json,8.388000,1052688,1052688,10,0 3. Prettify,cJSON (C),twitter.json,2.549000,1060880,1060880,10,0 4. Statistics,cJSON (C),canada.json,1.402000,0,0,0,0 4. Statistics,cJSON (C),citm_catalog.json,0.331000,0,0,0,0 4. Statistics,cJSON (C),twitter.json,0.186000,0,0,0,0 7. Code size,cJSON (C),jsonstat,0,0,0,0,33460 1. Parse,Configuru (C++11),canada.json,63.886000,12743744,12802928,170253,0 1. Parse,Configuru (C++11),citm_catalog.json,18.379000,4899360,4899456,54236,0 1. Parse,Configuru (C++11),twitter.json,6.702000,2119216,2119312,20388,0 2. Stringify,Configuru (C++11),canada.json,157.750000,5599264,7172192,22,0 2. Stringify,Configuru (C++11),citm_catalog.json,4.997000,786464,1179888,10951,0 2. Stringify,Configuru (C++11),twitter.json,1.933000,786464,1180400,1280,0 3. Prettify,Configuru (C++11),canada.json,162.613000,5599264,7172192,22,0 3. Prettify,Configuru (C++11),citm_catalog.json,9.308000,1572896,2359536,10952,0 3. Prettify,Configuru (C++11),twitter.json,3.839000,786464,1180400,1280,0 4. Statistics,Configuru (C++11),canada.json,0.898000,0,0,0,0 4. Statistics,Configuru (C++11),citm_catalog.json,0.361000,0,0,0,0 4. Statistics,Configuru (C++11),twitter.json,0.146000,0,0,0,0 7. Code size,Configuru (C++11),jsonstat,0,0,0,0,132952 1. Parse,facil.io (C),canada.json,55.550000,6972608,6972864,224819,0 1. Parse,facil.io (C),citm_catalog.json,9.659000,5619248,5619504,84022,0 1. Parse,facil.io (C),twitter.json,4.309000,2943056,2943312,28832,0 2. Stringify,facil.io (C),canada.json,32.656000,1572928,1573440,259,0 2. Stringify,facil.io (C),citm_catalog.json,3.913000,503872,504384,127,0 2. Stringify,facil.io (C),twitter.json,1.874000,471104,471616,119,0 3. Prettify,facil.io (C),canada.json,37.947000,3821632,3822144,937,0 3. Prettify,facil.io (C),citm_catalog.json,4.791000,1040448,1040960,258,0 3. Prettify,facil.io (C),twitter.json,2.314000,786496,787008,167,0 4. Statistics,facil.io (C),canada.json,2.698000,0,256,1,0 4. Statistics,facil.io (C),citm_catalog.json,1.071000,0,256,1,0 4. Statistics,facil.io (C),twitter.json,0.316000,0,256,1,0 7. Code size,facil.io (C),jsonstat,0,0,0,0,90952 1. Parse,mikeando/FastJson (C++),canada.json,12.171000,10511104,14333216,22,0 1. Parse,mikeando/FastJson (C++),citm_catalog.json,4.337000,2744512,4473568,22,0 1. Parse,mikeando/FastJson (C++),twitter.json,2.467000,1571520,2613024,24,0 2. Stringify,mikeando/FastJson (C++),canada.json,67.379000,3821600,3821600,2,0 2. Stringify,mikeando/FastJson (C++),citm_catalog.json,5.506000,610336,610336,2,0 2. Stringify,mikeando/FastJson (C++),twitter.json,2.183000,610336,610336,2,0 4. Statistics,mikeando/FastJson (C++),canada.json,0.555000,0,0,0,0 4. Statistics,mikeando/FastJson (C++),citm_catalog.json,0.153000,0,0,0,0 4. Statistics,mikeando/FastJson (C++),twitter.json,0.074000,0,0,0,0 7. Code size,mikeando/FastJson (C++),jsonstat,0,0,0,0,62788 1. Parse,gason (C++11),canada.json,3.282000,6508576,6508576,658,0 1. Parse,gason (C++11),citm_catalog.json,1.890000,2547744,2547744,202,0 1. Parse,gason (C++11),twitter.json,1.002000,1372192,1372192,83,0 2. Stringify,gason (C++11),canada.json,35.405000,1863712,3592224,18,0 2. Stringify,gason (C++11),citm_catalog.json,9.805000,610336,1650720,17,0 2. Stringify,gason (C++11),twitter.json,4.977000,507936,1548320,17,0 3. Prettify,gason (C++11),canada.json,75.360000,7319584,19902496,222273,0 3. Prettify,gason (C++11),citm_catalog.json,15.519000,1863712,5685280,34759,0 3. Prettify,gason (C++11),twitter.json,5.909000,770080,1810464,1920,0 4. Statistics,gason (C++11),canada.json,0.530000,0,0,0,0 4. Statistics,gason (C++11),citm_catalog.json,0.248000,0,0,0,0 4. Statistics,gason (C++11),twitter.json,0.165000,0,0,0,0 7. Code size,gason (C++11),jsonstat,0,0,0,0,20984 1. Parse,Jansson (C),canada.json,84.188000,10463696,10463744,224392,0 1. Parse,Jansson (C),citm_catalog.json,25.051000,5699968,5700048,111230,0 1. Parse,Jansson (C),twitter.json,12.200000,2000288,2000848,43822,0 2. Stringify,Jansson (C),canada.json,67.597000,3821584,10510352,21,0 2. Stringify,Jansson (C),citm_catalog.json,3.837000,507920,1118224,18,0 2. Stringify,Jansson (C),twitter.json,2.158000,507920,1118224,18,0 3. Prettify,Jansson (C),canada.json,77.692000,8273936,20856848,22,0 3. Prettify,Jansson (C),citm_catalog.json,4.787000,1728528,5550096,20,0 3. Prettify,Jansson (C),twitter.json,2.444000,770064,2498576,19,0 4. Statistics,Jansson (C),canada.json,0.977000,0,0,0,0 4. Statistics,Jansson (C),citm_catalog.json,0.579000,0,0,0,0 4. Statistics,Jansson (C),twitter.json,0.256000,0,0,0,0 7. Code size,Jansson (C),jsonstat,0,0,0,0,69792 1. Parse,JeayeSON (C++14),canada.json,116.537000,5699888,20503344,386911,0 1. Parse,JeayeSON (C++14),citm_catalog.json,40.635000,2879872,10368032,187912,0 1. Parse,JeayeSON (C++14),twitter.json,21.666000,1554944,5434784,94228,0 2. Stringify,JeayeSON (C++14),canada.json,40.925000,1044512,2773024,18,0 2. Stringify,JeayeSON (C++14),citm_catalog.json,6.869000,507936,1294368,342,0 2. Stringify,JeayeSON (C++14),twitter.json,4.006000,507936,1294368,3862,0 4. Statistics,JeayeSON (C++14),canada.json,0.552000,0,0,0,0 4. Statistics,JeayeSON (C++14),citm_catalog.json,0.211000,0,0,0,0 4. Statistics,JeayeSON (C++14),twitter.json,0.095000,0,0,0,0 7. Code size,JeayeSON (C++14),jsonstat,0,0,0,0,69552 1. Parse,jsmn (C),canada.json,385.405000,6074400,6074400,3,0 1. Parse,jsmn (C),citm_catalog.json,13.665000,2773024,2773024,3,0 1. Parse,jsmn (C),twitter.json,4.125000,1277984,1277984,3,0 4. Statistics,jsmn (C),canada.json,0.343000,0,0,0,0 4. Statistics,jsmn (C),citm_catalog.json,0.143000,0,0,0,0 4. Statistics,jsmn (C),twitter.json,0.058000,0,0,0,0 7. Code size,jsmn (C),jsonstat,0,0,0,0,16468 1. Parse,JsonBox (C++),canada.json,286.790000,6610480,13030320,754123,0 1. Parse,JsonBox (C++),citm_catalog.json,68.961000,3232384,7213696,242074,0 1. Parse,JsonBox (C++),twitter.json,30.454000,1636960,3703088,75748,0 2. Stringify,JsonBox (C++),canada.json,164.134000,2252832,6074400,19,0 2. Stringify,JsonBox (C++),citm_catalog.json,32.528000,507936,1294368,673,0 2. Stringify,JsonBox (C++),twitter.json,23.410000,507936,1294368,9688,0 3. Prettify,JsonBox (C++),canada.json,150.326000,3924000,10215456,20,0 3. Prettify,JsonBox (C++),citm_catalog.json,28.979000,1044512,2773024,674,0 3. Prettify,JsonBox (C++),twitter.json,21.733000,610336,1396768,9688,0 4. Statistics,JsonBox (C++),canada.json,0.530000,0,0,0,0 4. Statistics,JsonBox (C++),citm_catalog.json,0.207000,0,0,0,0 4. Statistics,JsonBox (C++),twitter.json,0.106000,0,0,0,0 7. Code size,JsonBox (C++),jsonstat,0,0,0,0,112244 1. Parse,jsoncons (C++),canada.json,85.807000,4560272,7584432,230921,0 1. Parse,jsoncons (C++),citm_catalog.json,8.300000,1959424,3729744,34809,0 1. Parse,jsoncons (C++),twitter.json,3.436000,1053312,1865888,8741,0 2. Stringify,jsoncons (C++),canada.json,79.588000,2252832,6074400,25,0 2. Stringify,jsoncons (C++),citm_catalog.json,1.731000,610336,1396768,23,0 2. Stringify,jsoncons (C++),twitter.json,1.659000,507936,1311520,24,0 3. Prettify,jsoncons (C++),canada.json,78.670000,2252832,6074400,25,0 3. Prettify,jsoncons (C++),citm_catalog.json,1.671000,610336,1396768,23,0 3. Prettify,jsoncons (C++),twitter.json,1.658000,507936,1311520,24,0 4. Statistics,jsoncons (C++),canada.json,1.779000,0,0,0,0 4. Statistics,jsoncons (C++),citm_catalog.json,0.709000,0,64,324,0 4. Statistics,jsoncons (C++),twitter.json,0.525000,0,464,1901,0 7. Code size,jsoncons (C++),jsonstat,0,0,0,0,147712 1. Parse,JsonCpp (C++),canada.json,99.696000,17842912,17848464,223282,0 1. Parse,JsonCpp (C++),citm_catalog.json,15.448000,4767504,4773056,111998,0 1. Parse,JsonCpp (C++),twitter.json,10.137000,1949984,1955536,50991,0 2. Stringify,JsonCpp (C++),canada.json,98.378000,2252832,6075376,46,0 2. Stringify,JsonCpp (C++),citm_catalog.json,8.218000,507936,1295968,12220,0 2. Stringify,JsonCpp (C++),twitter.json,5.512000,507936,1297360,7750,0 4. Statistics,JsonCpp (C++),canada.json,3.235000,0,0,0,0 4. Statistics,JsonCpp (C++),citm_catalog.json,0.440000,0,64,324,0 4. Statistics,JsonCpp (C++),twitter.json,0.467000,0,464,1901,0 7. Code size,JsonCpp (C++),jsonstat,0,0,0,0,256192 1. Parse,json-c (C),canada.json,123.788000,33627856,33629008,390651,0 1. Parse,json-c (C),citm_catalog.json,20.726000,13055024,13056208,131793,0 1. Parse,json-c (C),twitter.json,8.664000,3088720,3090352,49446,0 2. Stringify,json-c (C),canada.json,18.557000,10113056,10113056,21,0 2. Stringify,json-c (C),citm_catalog.json,11.450000,1032224,1032224,18,0 2. Stringify,json-c (C),twitter.json,4.931000,1032224,1032224,18,0 3. Prettify,json-c (C),canada.json,34.793000,14680096,14680096,22,0 3. Prettify,json-c (C),citm_catalog.json,16.049000,5181472,5181472,20,0 3. Prettify,json-c (C),twitter.json,6.151000,2027552,2027552,19,0 4. Statistics,json-c (C),canada.json,3.011000,0,0,0,0 4. Statistics,json-c (C),citm_catalog.json,0.999000,0,0,0,0 4. Statistics,json-c (C),twitter.json,0.207000,0,0,0,0 7. Code size,json-c (C),jsonstat,0,0,0,0,57528 1. Parse,JSON Spirit (C++),canada.json,93.198000,7861680,12238704,435425,0 1. Parse,JSON Spirit (C++),citm_catalog.json,73.888000,2540208,6850992,283137,0 1. Parse,JSON Spirit (C++),twitter.json,20.397000,1193264,3192864,60284,0 2. Stringify,JSON Spirit (C++),canada.json,82.760000,2252832,6176800,19,0 2. Stringify,JSON Spirit (C++),citm_catalog.json,8.711000,507936,1294368,348,0 2. Stringify,JSON Spirit (C++),twitter.json,7.552000,770080,1556512,6927,0 3. Prettify,JSON Spirit (C++),canada.json,124.079000,8388640,20971552,21,0 3. Prettify,JSON Spirit (C++),citm_catalog.json,18.942000,2252832,6176800,350,0 3. Prettify,JSON Spirit (C++),twitter.json,9.893000,1257504,2986016,6928,0 4. Statistics,JSON Spirit (C++),canada.json,0.860000,0,0,0,0 4. Statistics,JSON Spirit (C++),citm_catalog.json,0.242000,0,0,0,0 4. Statistics,JSON Spirit (C++),twitter.json,0.108000,0,0,0,0 7. Code size,JSON Spirit (C++),jsonstat,0,0,0,0,254920 1. Parse,hjiang/JSON++ (C++),canada.json,190.658000,8733840,14910608,337434,0 1. Parse,hjiang/JSON++ (C++),citm_catalog.json,40.974000,3891024,7872336,92754,0 1. Parse,hjiang/JSON++ (C++),twitter.json,16.168000,1880592,3437072,42564,0 2. Stringify,hjiang/JSON++ (C++),canada.json,226.357000,3981344,14254112,499228,0 2. Stringify,hjiang/JSON++ (C++),citm_catalog.json,38.767000,1024032,4579360,102930,0 2. Stringify,hjiang/JSON++ (C++),twitter.json,17.788000,770080,2580896,42914,0 4. Statistics,hjiang/JSON++ (C++),canada.json,0.659000,0,0,0,0 4. Statistics,hjiang/JSON++ (C++),citm_catalog.json,0.259000,0,0,0,0 4. Statistics,hjiang/JSON++ (C++),twitter.json,0.131000,0,0,0,0 7. Code size,hjiang/JSON++ (C++),jsonstat,0,0,0,0,98772 1. Parse,juson (C),canada.json,53.023000,8506224,8506224,115044,0 1. Parse,juson (C),citm_catalog.json,4.234000,3369760,3369760,6050,0 1. Parse,juson (C),twitter.json,1.234000,1522224,1522224,1104,0 4. Statistics,juson (C),canada.json,0.679000,0,0,0,0 4. Statistics,juson (C),citm_catalog.json,0.229000,0,0,0,0 4. Statistics,juson (C),twitter.json,0.138000,0,0,0,0 7. Code size,juson (C),jsonstat,0,0,0,0,25692 1. Parse,JVar (C++),canada.json,83.535000,4484288,4484288,56050,0 1. Parse,JVar (C++),citm_catalog.json,22.416000,2600944,2600944,22037,0 1. Parse,JVar (C++),twitter.json,9.514000,477840,477904,6117,0 2. Stringify,JVar (C++),canada.json,50.338000,1044512,1044512,2,0 2. Stringify,JVar (C++),citm_catalog.json,7.718000,503840,503840,2,0 2. Stringify,JVar (C++),twitter.json,2.905000,466976,466976,2,0 4. Statistics,JVar (C++),canada.json,1.068000,0,0,0,0 4. Statistics,JVar (C++),citm_catalog.json,0.341000,0,0,0,0 4. Statistics,JVar (C++),twitter.json,0.162000,0,0,0,0 7. Code size,JVar (C++),jsonstat,0,0,0,0,86320 1. Parse,Jzon (C++),canada.json,99.243000,17910992,22449408,282601,0 1. Parse,Jzon (C++),citm_catalog.json,36.652000,3855088,8389456,69806,0 1. Parse,Jzon (C++),twitter.json,17.494000,1858544,3749648,35993,0 2. Stringify,Jzon (C++),canada.json,14.471000,2252832,5398560,19,0 2. Stringify,Jzon (C++),citm_catalog.json,6.534000,933920,1867808,665,0 2. Stringify,Jzon (C++),twitter.json,5.175000,933920,1867808,4466,0 3. Prettify,Jzon (C++),canada.json,47.936000,8273952,20856864,222273,0 3. Prettify,Jzon (C++),citm_catalog.json,12.701000,2252832,5398560,44092,0 3. Prettify,Jzon (C++),twitter.json,5.918000,933920,3186720,6536,0 4. Statistics,Jzon (C++),canada.json,1.098000,0,0,0,0 4. Statistics,Jzon (C++),citm_catalog.json,0.320000,0,64,324,0 4. Statistics,Jzon (C++),twitter.json,0.367000,0,464,1901,0 7. Code size,Jzon (C++),jsonstat,0,0,0,0,114596 1. Parse,Nlohmann (C++11),canada.json,60.344000,5293488,5293488,170254,0 1. Parse,Nlohmann (C++11),citm_catalog.json,9.613000,3045808,3045808,55293,0 1. Parse,Nlohmann (C++11),twitter.json,6.666000,1558576,1558576,28498,0 2. Stringify,Nlohmann (C++11),canada.json,75.094000,2252832,5398560,19,0 2. Stringify,Nlohmann (C++11),citm_catalog.json,5.599000,933920,1867808,342,0 2. Stringify,Nlohmann (C++11),twitter.json,3.819000,466976,1400864,3821,0 3. Prettify,Nlohmann (C++11),canada.json,106.883000,8273952,20856864,222273,0 3. Prettify,Nlohmann (C++11),citm_catalog.json,10.019000,2252832,5398592,35084,0 3. Prettify,Nlohmann (C++11),twitter.json,4.396000,933920,1867808,5724,0 4. Statistics,Nlohmann (C++11),canada.json,0.984000,0,0,0,0 4. Statistics,Nlohmann (C++11),citm_catalog.json,0.501000,0,64,325,0 4. Statistics,Nlohmann (C++11),twitter.json,0.822000,0,464,3804,0 7. Code size,Nlohmann (C++11),jsonstat,0,0,0,0,47196 1. Parse,Parson (C),canada.json,72.431000,5816816,5878880,336060,0 1. Parse,Parson (C),citm_catalog.json,19.247000,2276704,2277024,185585,0 1. Parse,Parson (C),twitter.json,9.306000,1050976,1051456,72477,0 2. Stringify,Parson (C),canada.json,91.045000,2252816,2252816,2,0 2. Stringify,Parson (C),citm_catalog.json,18.576000,933904,933904,2,0 2. Stringify,Parson (C),twitter.json,12.362000,933904,933904,2,0 3. Prettify,Parson (C),canada.json,92.302000,2252816,2252816,2,0 3. Prettify,Parson (C),citm_catalog.json,18.720000,933904,933904,2,0 3. Prettify,Parson (C),twitter.json,12.328000,933904,933904,2,0 4. Statistics,Parson (C),canada.json,1.129000,0,0,0,0 4. Statistics,Parson (C),citm_catalog.json,0.919000,0,0,0,0 4. Statistics,Parson (C),twitter.json,1.065000,0,0,0,0 7. Code size,Parson (C),jsonstat,0,0,0,0,43932 1. Parse,PicoJSON (C++),canada.json,110.972000,5151952,5404112,435407,0 1. Parse,PicoJSON (C++),citm_catalog.json,34.944000,3003056,3003088,211748,0 1. Parse,PicoJSON (C++),twitter.json,13.649000,1584624,2069600,67548,0 2. Stringify,PicoJSON (C++),canada.json,76.280000,3145760,5398560,18,0 2. Stringify,PicoJSON (C++),citm_catalog.json,6.067000,933920,1327136,16,0 2. Stringify,PicoJSON (C++),twitter.json,3.425000,933920,1327136,16,0 4. Statistics,PicoJSON (C++),canada.json,0.570000,0,0,0,0 4. Statistics,PicoJSON (C++),citm_catalog.json,0.220000,0,0,0,0 4. Statistics,PicoJSON (C++),twitter.json,0.108000,0,0,0,0 7. Code size,PicoJSON (C++),jsonstat,0,0,0,0,30896 6. SaxStatistics,pjson (C),canada.json,3.614000,0,256,1,0 6. SaxStatistics,pjson (C),citm_catalog.json,2.394000,0,256,1,0 6. SaxStatistics,pjson (C),twitter.json,1.199000,0,1536,3,0 7. Code size,pjson (C),jsonstat,0,0,0,0,15696 1. Parse,Qajson4c (C),canada.json,45.133000,3145760,3145760,7,0 1. Parse,Qajson4c (C),citm_catalog.json,5.451000,1097760,1097760,6,0 1. Parse,Qajson4c (C),twitter.json,2.948000,933920,933920,5,0 2. Stringify,Qajson4c (C),canada.json,25.983000,2252816,2252816,2,0 2. Stringify,Qajson4c (C),citm_catalog.json,2.146000,2252816,2252816,2,0 2. Stringify,Qajson4c (C),twitter.json,1.152000,933904,933904,2,0 4. Statistics,Qajson4c (C),canada.json,1.042000,0,0,0,0 4. Statistics,Qajson4c (C),citm_catalog.json,0.391000,0,0,0,0 4. Statistics,Qajson4c (C),twitter.json,0.208000,0,0,0,0 7. Code size,Qajson4c (C),jsonstat,0,0,0,0,42916 1. Parse,RapidJSON_AutoUTF (C++),canada.json,7.646000,2954432,3347920,61,0 1. Parse,RapidJSON_AutoUTF (C++),citm_catalog.json,6.069000,1123008,1131472,29,0 1. Parse,RapidJSON_AutoUTF (C++),twitter.json,4.141000,792768,798992,25,0 2. Stringify,RapidJSON_AutoUTF (C++),canada.json,17.769000,2875472,2876000,28,0 2. Stringify,RapidJSON_AutoUTF (C++),citm_catalog.json,2.315000,569424,569952,24,0 2. Stringify,RapidJSON_AutoUTF (C++),twitter.json,2.194000,569424,569952,24,0 3. Prettify,RapidJSON_AutoUTF (C++),canada.json,40.312000,9699408,9699936,31,0 3. Prettify,RapidJSON_AutoUTF (C++),citm_catalog.json,7.149000,1917008,1917536,27,0 3. Prettify,RapidJSON_AutoUTF (C++),twitter.json,3.461000,852048,852576,25,0 4. Statistics,RapidJSON_AutoUTF (C++),canada.json,0.576000,0,0,0,0 4. Statistics,RapidJSON_AutoUTF (C++),citm_catalog.json,0.181000,0,0,0,0 4. Statistics,RapidJSON_AutoUTF (C++),twitter.json,0.068000,0,0,0,0 5. Sax Round-trip,RapidJSON_AutoUTF (C++),canada.json,25.402000,64,2876272,30,0 5. Sax Round-trip,RapidJSON_AutoUTF (C++),citm_catalog.json,8.012000,64,570224,26,0 5. Sax Round-trip,RapidJSON_AutoUTF (C++),twitter.json,5.981000,64,570544,28,0 6. SaxStatistics,RapidJSON_AutoUTF (C++),canada.json,6.552000,0,272,2,0 6. SaxStatistics,RapidJSON_AutoUTF (C++),citm_catalog.json,5.586000,0,272,2,0 6. SaxStatistics,RapidJSON_AutoUTF (C++),twitter.json,3.840000,0,592,4,0 7. Code size,RapidJSON_AutoUTF (C++),jsonstat,0,0,0,0,38992 1. Parse,RapidJSON_FullPrec (C++),canada.json,12.636000,2958528,3257808,61,0 1. Parse,RapidJSON_FullPrec (C++),citm_catalog.json,2.403000,1123008,1131472,29,0 1. Parse,RapidJSON_FullPrec (C++),twitter.json,1.563000,792768,798992,25,0 2. Stringify,RapidJSON_FullPrec (C++),canada.json,11.564000,2875472,2876000,28,0 2. Stringify,RapidJSON_FullPrec (C++),citm_catalog.json,1.307000,569424,569952,24,0 2. Stringify,RapidJSON_FullPrec (C++),twitter.json,0.902000,688208,688736,21,0 3. Prettify,RapidJSON_FullPrec (C++),canada.json,15.770000,9699408,9699936,31,0 3. Prettify,RapidJSON_FullPrec (C++),citm_catalog.json,2.140000,1917008,1917536,27,0 3. Prettify,RapidJSON_FullPrec (C++),twitter.json,1.183000,1093712,1094240,22,0 4. Statistics,RapidJSON_FullPrec (C++),canada.json,0.576000,0,0,0,0 4. Statistics,RapidJSON_FullPrec (C++),citm_catalog.json,0.181000,0,0,0,0 4. Statistics,RapidJSON_FullPrec (C++),twitter.json,0.068000,0,0,0,0 5. Sax Round-trip,RapidJSON_FullPrec (C++),canada.json,23.460000,2875472,2876272,30,0 5. Sax Round-trip,RapidJSON_FullPrec (C++),citm_catalog.json,3.289000,569424,570224,26,0 5. Sax Round-trip,RapidJSON_FullPrec (C++),twitter.json,2.283000,688208,689328,25,0 6. SaxStatistics,RapidJSON_FullPrec (C++),canada.json,11.073000,0,272,2,0 6. SaxStatistics,RapidJSON_FullPrec (C++),citm_catalog.json,2.035000,0,272,2,0 6. SaxStatistics,RapidJSON_FullPrec (C++),twitter.json,1.291000,0,592,4,0 7. Code size,RapidJSON_FullPrec (C++),jsonstat,0,0,0,0,31916 1. Parse,RapidJSON_Insitu (C++),canada.json,4.989000,5285056,5584064,60,0 1. Parse,RapidJSON_Insitu (C++),citm_catalog.json,1.808000,3309760,3317952,27,0 1. Parse,RapidJSON_Insitu (C++),twitter.json,1.190000,1097408,1103040,17,0 2. Stringify,RapidJSON_Insitu (C++),canada.json,11.400000,2875472,2876000,28,0 2. Stringify,RapidJSON_Insitu (C++),citm_catalog.json,1.223000,569424,569952,24,0 2. Stringify,RapidJSON_Insitu (C++),twitter.json,1.026000,688208,688736,21,0 3. Prettify,RapidJSON_Insitu (C++),canada.json,15.672000,9699408,9699936,31,0 3. Prettify,RapidJSON_Insitu (C++),citm_catalog.json,2.215000,1917008,1917536,27,0 3. Prettify,RapidJSON_Insitu (C++),twitter.json,1.372000,1093712,1094240,22,0 4. Statistics,RapidJSON_Insitu (C++),canada.json,0.594000,0,0,0,0 4. Statistics,RapidJSON_Insitu (C++),citm_catalog.json,0.183000,0,0,0,0 4. Statistics,RapidJSON_Insitu (C++),twitter.json,0.088000,0,0,0,0 5. Sax Round-trip,RapidJSON_Insitu (C++),canada.json,15.596000,2875472,5128848,30,0 5. Sax Round-trip,RapidJSON_Insitu (C++),citm_catalog.json,2.783000,569424,2822800,26,0 5. Sax Round-trip,RapidJSON_Insitu (C++),twitter.json,2.100000,1278032,1913488,23,0 6. SaxStatistics,RapidJSON_Insitu (C++),canada.json,3.753000,0,2252848,2,0 6. SaxStatistics,RapidJSON_Insitu (C++),citm_catalog.json,1.648000,0,2252848,2,0 6. SaxStatistics,RapidJSON_Insitu (C++),twitter.json,1.111000,0,634928,2,0 7. Code size,RapidJSON_Insitu (C++),jsonstat,0,0,0,0,31916 1. Parse,RapidJSON_Iterative (C++),canada.json,5.605000,2929856,3229136,61,0 1. Parse,RapidJSON_Iterative (C++),citm_catalog.json,2.406000,1123008,1131472,29,0 1. Parse,RapidJSON_Iterative (C++),twitter.json,1.647000,792768,798992,25,0 2. Stringify,RapidJSON_Iterative (C++),canada.json,11.272000,2875472,2876000,28,0 2. Stringify,RapidJSON_Iterative (C++),citm_catalog.json,1.335000,569424,569952,24,0 2. Stringify,RapidJSON_Iterative (C++),twitter.json,0.913000,688208,688736,21,0 3. Prettify,RapidJSON_Iterative (C++),canada.json,15.681000,9699408,9699936,31,0 3. Prettify,RapidJSON_Iterative (C++),citm_catalog.json,2.090000,1917008,1917536,27,0 3. Prettify,RapidJSON_Iterative (C++),twitter.json,1.132000,1093712,1094240,22,0 4. Statistics,RapidJSON_Iterative (C++),canada.json,0.576000,0,0,0,0 4. Statistics,RapidJSON_Iterative (C++),citm_catalog.json,0.175000,0,0,0,0 4. Statistics,RapidJSON_Iterative (C++),twitter.json,0.066000,0,0,0,0 5. Sax Round-trip,RapidJSON_Iterative (C++),canada.json,16.513000,2875472,2876272,30,0 5. Sax Round-trip,RapidJSON_Iterative (C++),citm_catalog.json,3.315000,569424,570224,26,0 5. Sax Round-trip,RapidJSON_Iterative (C++),twitter.json,2.423000,688208,689328,25,0 6. SaxStatistics,RapidJSON_Iterative (C++),canada.json,4.239000,0,272,2,0 6. SaxStatistics,RapidJSON_Iterative (C++),citm_catalog.json,1.968000,0,272,2,0 6. SaxStatistics,RapidJSON_Iterative (C++),twitter.json,1.376000,0,592,4,0 7. Code size,RapidJSON_Iterative (C++),jsonstat,0,0,0,0,31916 1. Parse,RapidJSON (C++),canada.json,5.260000,2892992,3192272,61,0 1. Parse,RapidJSON (C++),citm_catalog.json,2.074000,1123008,1131472,29,0 1. Parse,RapidJSON (C++),twitter.json,1.515000,792768,798992,25,0 2. Stringify,RapidJSON (C++),canada.json,11.517000,2875472,2876000,28,0 2. Stringify,RapidJSON (C++),citm_catalog.json,1.399000,569424,569952,24,0 2. Stringify,RapidJSON (C++),twitter.json,0.884000,688208,688736,21,0 3. Prettify,RapidJSON (C++),canada.json,15.700000,9699408,9699936,31,0 3. Prettify,RapidJSON (C++),citm_catalog.json,2.183000,1917008,1917536,27,0 3. Prettify,RapidJSON (C++),twitter.json,1.205000,1093712,1094240,22,0 4. Statistics,RapidJSON (C++),canada.json,0.576000,0,0,0,0 4. Statistics,RapidJSON (C++),citm_catalog.json,0.181000,0,0,0,0 4. Statistics,RapidJSON (C++),twitter.json,0.068000,0,0,0,0 5. Sax Round-trip,RapidJSON (C++),canada.json,15.283000,2875472,2876272,30,0 5. Sax Round-trip,RapidJSON (C++),citm_catalog.json,2.923000,569424,570224,26,0 5. Sax Round-trip,RapidJSON (C++),twitter.json,2.197000,688208,689328,25,0 6. SaxStatistics,RapidJSON (C++),canada.json,3.641000,0,272,2,0 6. SaxStatistics,RapidJSON (C++),citm_catalog.json,1.715000,0,272,2,0 6. SaxStatistics,RapidJSON (C++),twitter.json,1.260000,0,592,4,0 7. Code size,RapidJSON (C++),jsonstat,0,0,0,0,31916 1. Parse,sajson (C++),canada.json,7.002000,10526848,12755072,20,0 1. Parse,sajson (C++),citm_catalog.json,1.904000,2965632,3825792,14,0 1. Parse,sajson (C++),twitter.json,0.855000,1376384,1642624,12,0 4. Statistics,sajson (C++),canada.json,0.758000,0,0,0,0 4. Statistics,sajson (C++),citm_catalog.json,0.240000,0,0,0,0 4. Statistics,sajson (C++),twitter.json,0.089000,0,0,0,0 7. Code size,sajson (C++),jsonstat,0,0,0,0,39908 1. Parse,Sheredom json.h (C),canada.json,9.888000,12840976,12840976,2,0 1. Parse,Sheredom json.h (C),citm_catalog.json,5.719000,3825680,3825680,2,0 1. Parse,Sheredom json.h (C),twitter.json,2.630000,1916944,1916944,2,0 2. Stringify,Sheredom json.h (C),canada.json,35.404000,2252816,2252816,2,0 2. Stringify,Sheredom json.h (C),citm_catalog.json,5.391000,524304,524304,2,0 2. Stringify,Sheredom json.h (C),twitter.json,2.306000,524304,524304,2,0 3. Prettify,Sheredom json.h (C),canada.json,39.118000,8273936,8273936,2,0 3. Prettify,Sheredom json.h (C),citm_catalog.json,6.200000,1916944,1916944,2,0 3. Prettify,Sheredom json.h (C),twitter.json,2.503000,851984,851984,2,0 4. Statistics,Sheredom json.h (C),canada.json,0.646000,0,0,0,0 4. Statistics,Sheredom json.h (C),citm_catalog.json,0.175000,0,0,0,0 4. Statistics,Sheredom json.h (C),twitter.json,0.076000,0,0,0,0 7. Code size,Sheredom json.h (C),jsonstat,0,0,0,0,29644 1. Parse,SimpleJSON (C++),canada.json,37.393000,5817456,15581872,393512,0 1. Parse,SimpleJSON (C++),citm_catalog.json,31.156000,4226096,12501440,213739,0 1. Parse,SimpleJSON (C++),twitter.json,20.304000,2636016,6462640,111912,0 2. Stringify,SimpleJSON (C++),canada.json,179.026000,3825680,22540544,393342,0 2. Stringify,SimpleJSON (C++),citm_catalog.json,29.086000,1048592,6447120,102242,0 2. Stringify,SimpleJSON (C++),twitter.json,14.129000,1916944,7814160,43987,0 4. Statistics,SimpleJSON (C++),canada.json,0.584000,0,0,0,0 4. Statistics,SimpleJSON (C++),citm_catalog.json,0.280000,0,0,0,0 4. Statistics,SimpleJSON (C++),twitter.json,0.142000,0,0,0,0 7. Code size,SimpleJSON (C++),jsonstat,0,0,0,0,54888 1. Parse,strdup (C),canada.json,0.264000,2252832,2252832,2,0 1. Parse,strdup (C),citm_catalog.json,0.061000,1916960,1916960,2,0 1. Parse,strdup (C),twitter.json,0.022000,852000,852000,2,0 2. Stringify,strdup (C),canada.json,0.088000,3825680,3825680,2,0 2. Stringify,strdup (C),citm_catalog.json,0.065000,2097168,2097168,2,0 2. Stringify,strdup (C),twitter.json,0.024000,1048592,1048592,2,0 7. Code size,strdup (C),jsonstat,0,0,0,0,16308 1. Parse,taocpp/json & Nlohmann (C++11),canada.json,77.372000,4556560,9529632,506550,0 1. Parse,taocpp/json & Nlohmann (C++11),citm_catalog.json,33.686000,2983152,5754192,199137,0 1. Parse,taocpp/json & Nlohmann (C++11),twitter.json,19.468000,1558560,3115152,94298,0 2. Stringify,taocpp/json & Nlohmann (C++11),canada.json,21.796000,2097184,5922848,19,0 2. Stringify,taocpp/json & Nlohmann (C++11),citm_catalog.json,4.876000,524320,1376288,18,0 2. Stringify,taocpp/json & Nlohmann (C++11),twitter.json,2.586000,524320,1376288,1920,0 3. Prettify,taocpp/json & Nlohmann (C++11),canada.json,37.538000,8273952,20856912,22,0 3. Prettify,taocpp/json & Nlohmann (C++11),citm_catalog.json,7.042000,1916960,5742672,21,0 3. Prettify,taocpp/json & Nlohmann (C++11),twitter.json,3.153000,1048608,1900624,1921,0 4. Statistics,taocpp/json & Nlohmann (C++11),canada.json,1.034000,0,0,0,0 4. Statistics,taocpp/json & Nlohmann (C++11),citm_catalog.json,0.459000,0,64,325,0 4. Statistics,taocpp/json & Nlohmann (C++11),twitter.json,0.814000,0,464,3804,0 7. Code size,taocpp/json & Nlohmann (C++11),jsonstat,0,0,0,0,110248 1. Parse,taocpp/json (C++11),canada.json,23.186000,6523920,6583664,114208,0 1. Parse,taocpp/json (C++11),citm_catalog.json,8.506000,3005952,3006304,32852,0 1. Parse,taocpp/json (C++11),twitter.json,4.933000,1602592,1603296,18080,0 2. Stringify,taocpp/json (C++11),canada.json,21.180000,2097184,5922848,19,0 2. Stringify,taocpp/json (C++11),citm_catalog.json,4.425000,524320,1376288,17,0 2. Stringify,taocpp/json (C++11),twitter.json,2.163000,524320,1376288,17,0 3. Prettify,taocpp/json (C++11),canada.json,36.941000,8273952,20856912,22,0 3. Prettify,taocpp/json (C++11),citm_catalog.json,6.833000,1916960,5742672,20,0 3. Prettify,taocpp/json (C++11),twitter.json,2.731000,1048608,1900576,18,0 4. Statistics,taocpp/json (C++11),canada.json,0.527000,0,0,0,0 4. Statistics,taocpp/json (C++11),citm_catalog.json,0.218000,0,0,0,0 4. Statistics,taocpp/json (C++11),twitter.json,0.121000,0,0,0,0 5. Sax Round-trip,taocpp/json (C++11),canada.json,30.612000,2097184,5922848,19,0 5. Sax Round-trip,taocpp/json (C++11),citm_catalog.json,8.443000,524320,1376288,342,0 5. Sax Round-trip,taocpp/json (C++11),twitter.json,5.215000,524320,1376288,4266,0 6. SaxStatistics,taocpp/json (C++11),canada.json,9.170000,0,0,0,0 6. SaxStatistics,taocpp/json (C++11),citm_catalog.json,3.829000,0,64,325,0 6. SaxStatistics,taocpp/json (C++11),twitter.json,3.162000,0,1056,4249,0 7. Code size,taocpp/json (C++11),jsonstat,0,0,0,0,99056 1. Parse,tunnuz/JSON++ (C++),canada.json,231.571000,19608544,45543120,833845,0 1. Parse,tunnuz/JSON++ (C++),citm_catalog.json,85.928000,6065024,16144192,356191,0 1. Parse,tunnuz/JSON++ (C++),twitter.json,41.115000,2674704,7188576,163534,0 2. Stringify,tunnuz/JSON++ (C++),canada.json,228.133000,2719776,104869264,391870,0 2. Stringify,tunnuz/JSON++ (C++),citm_catalog.json,49.466000,933920,14552528,165982,0 2. Stringify,tunnuz/JSON++ (C++),twitter.json,22.011000,921632,6701296,77541,0 4. Statistics,tunnuz/JSON++ (C++),canada.json,126.470000,0,101313872,391851,0 4. Statistics,tunnuz/JSON++ (C++),citm_catalog.json,33.928000,0,11749536,165964,0 4. Statistics,tunnuz/JSON++ (C++),twitter.json,17.470000,0,5440992,77524,0 7. Code size,tunnuz/JSON++ (C++),jsonstat,0,0,0,0,73412 1. Parse,udp/json-parser (C),canada.json,29.845000,12047840,12047840,223233,0 1. Parse,udp/json-parser (C),citm_catalog.json,12.343000,3420464,3420464,51205,0 1. Parse,udp/json-parser (C),twitter.json,4.881000,1726752,1726752,20237,0 2. Stringify,udp/json-parser (C),canada.json,48.668000,1916944,1916944,2,0 2. Stringify,udp/json-parser (C),citm_catalog.json,1.440000,593936,593936,2,0 2. Stringify,udp/json-parser (C),twitter.json,1.455000,593936,593936,2,0 3. Prettify,udp/json-parser (C),canada.json,49.598000,7958544,7958544,2,0 3. Prettify,udp/json-parser (C),citm_catalog.json,1.717000,2097168,2097168,2,0 3. Prettify,udp/json-parser (C),twitter.json,1.592000,917520,917520,2,0 4. Statistics,udp/json-parser (C),canada.json,0.841000,0,0,0,0 4. Statistics,udp/json-parser (C),citm_catalog.json,0.192000,0,0,0,0 4. Statistics,udp/json-parser (C),twitter.json,0.075000,0,0,0,0 7. Code size,udp/json-parser (C),jsonstat,0,0,0,0,35520 1. Parse,ujson4c (C),canada.json,5.494000,13074464,22081568,11,0 1. Parse,ujson4c (C),citm_catalog.json,2.909000,5115936,13074464,10,0 1. Parse,ujson4c (C),twitter.json,1.471000,5115936,7643168,10,0 4. Statistics,ujson4c (C),canada.json,1.316000,0,0,0,0 4. Statistics,ujson4c (C),citm_catalog.json,0.457000,0,0,0,0 4. Statistics,ujson4c (C),twitter.json,0.183000,0,0,0,0 7. Code size,ujson4c (C),jsonstat,0,0,0,0,31492 1. Parse,ujson (C++),canada.json,28.427000,9349184,9351776,170254,0 1. Parse,ujson (C++),citm_catalog.json,10.724000,3165056,3165632,63520,0 1. Parse,ujson (C++),twitter.json,4.549000,1609344,1609712,13992,0 2. Stringify,ujson (C++),canada.json,19.701000,2097184,4014112,17,0 2. Stringify,ujson (C++),citm_catalog.json,3.964000,593952,856096,15,0 2. Stringify,ujson (C++),twitter.json,1.952000,917536,1511456,15,0 3. Prettify,ujson (C++),canada.json,23.402000,9007136,16965664,19,0 3. Prettify,ujson (C++),citm_catalog.json,5.036000,2097184,4014112,17,0 3. Prettify,ujson (C++),twitter.json,2.251000,917536,1511456,15,0 4. Statistics,ujson (C++),canada.json,1.439000,0,0,0,0 4. Statistics,ujson (C++),citm_catalog.json,0.569000,0,0,0,0 4. Statistics,ujson (C++),twitter.json,0.328000,0,0,0,0 7. Code size,ujson (C++),jsonstat,0,0,0,0,127120 1. Parse,Vinenthz/libjson (C),canada.json,76.176000,4916160,4945104,334389,0 1. Parse,Vinenthz/libjson (C),citm_catalog.json,21.462000,2372400,2401344,153901,0 1. Parse,Vinenthz/libjson (C),twitter.json,9.681000,1305728,1334672,72620,0 2. Stringify,Vinenthz/libjson (C),canada.json,65.772000,4194336,4194336,13,0 2. Stringify,Vinenthz/libjson (C),citm_catalog.json,4.761000,524320,524320,10,0 2. Stringify,Vinenthz/libjson (C),twitter.json,3.749000,524320,524320,10,0 3. Prettify,Vinenthz/libjson (C),canada.json,65.203000,4194336,4194336,13,0 3. Prettify,Vinenthz/libjson (C),citm_catalog.json,4.794000,524320,524320,10,0 3. Prettify,Vinenthz/libjson (C),twitter.json,3.608000,524320,524320,10,0 4. Statistics,Vinenthz/libjson (C),canada.json,0.532000,0,0,0,0 4. Statistics,Vinenthz/libjson (C),citm_catalog.json,0.242000,0,0,0,0 4. Statistics,Vinenthz/libjson (C),twitter.json,0.103000,0,0,0,0 5. Sax Round-trip,Vinenthz/libjson (C),canada.json,13.603000,4194336,4198688,15,0 5. Sax Round-trip,Vinenthz/libjson (C),citm_catalog.json,10.629000,524320,528672,12,0 5. Sax Round-trip,Vinenthz/libjson (C),twitter.json,6.081000,524320,528672,12,0 6. SaxStatistics,Vinenthz/libjson (C),canada.json,11.321000,0,4352,2,0 6. SaxStatistics,Vinenthz/libjson (C),citm_catalog.json,7.691000,0,4352,2,0 6. SaxStatistics,Vinenthz/libjson (C),twitter.json,2.990000,0,4352,2,0 7. Code size,Vinenthz/libjson (C),jsonstat,0,0,0,0,26624 1. Parse,YAJL (C),canada.json,83.378000,12893040,12895472,501567,0 1. Parse,YAJL (C),citm_catalog.json,20.820000,3031456,3035936,189685,0 1. Parse,YAJL (C),twitter.json,9.264000,1459072,1463552,77047,0 2. Stringify,YAJL (C),canada.json,76.780000,4198976,4198976,15,0 2. Stringify,YAJL (C),citm_catalog.json,4.261000,528960,528960,12,0 2. Stringify,YAJL (C),twitter.json,1.996000,528960,528960,12,0 3. Prettify,YAJL (C),canada.json,96.738000,16781888,16781888,17,0 3. Prettify,YAJL (C),citm_catalog.json,8.794000,2101824,2101824,14,0 3. Prettify,YAJL (C),twitter.json,3.234000,1053248,1053248,13,0 4. Statistics,YAJL (C),canada.json,0.992000,0,0,0,0 4. Statistics,YAJL (C),citm_catalog.json,0.244000,0,0,0,0 4. Statistics,YAJL (C),twitter.json,0.124000,0,0,0,0 5. Sax Round-trip,YAJL (C),canada.json,121.040000,4198976,4203456,22,0 5. Sax Round-trip,YAJL (C),citm_catalog.json,9.258000,528960,533440,19,0 5. Sax Round-trip,YAJL (C),twitter.json,3.537000,528960,533440,19,0 6. SaxStatistics,YAJL (C),canada.json,42.618000,0,4480,7,0 6. SaxStatistics,YAJL (C),citm_catalog.json,5.003000,0,4480,7,0 6. SaxStatistics,YAJL (C),twitter.json,1.706000,0,4480,7,0 7. Code size,YAJL (C),jsonstat,0,0,0,0,45352 </textarea> </div> <div class="row" id="downloadDD" style="display: none"> <div class="btn-group pull-right" > <button class="btn dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-picture"></span></button> <ul class="dropdown-menu"> <li><a tabindex="-1" href="#" dltype="image/jpeg">JPEG</a></li> <li><a tabindex="-1" href="#" dltype="image/png">PNG</a></li> <li><a tabindex="-1" href="#" dltype="application/pdf">PDF</a></li> <li><a tabindex="-1" href="#" dltype="image/svg+xml">SVG</a></li> </ul> </div> </div> <form method="post" action="http://export.highcharts.com/" id="imageGetForm"> <input type="hidden" name="filename" id="imageFilename" value="" /> <input type="hidden" name="type" id="imageGetFormTYPE" value="" /> <input type="hidden" name="width" value="1600" /> <input type="hidden" name="svg" value="" id="imageGetFormSVG" /> </form> </div> </body> </html>
boazsegev/facil.io
docs/_SOURCE/0.7.x/json_performance.html
HTML
mit
51,780
using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Abp.Authorization; using Abp.Domain.Uow; using Abp.MultiTenancy; using Abp.Zero.Configuration; using Abp.Zero.SampleApp.MultiTenancy; using Abp.Zero.SampleApp.Roles; using Shouldly; using Xunit; namespace Abp.Zero.SampleApp.Tests.Roles { public class RoleManager_Tests : SampleAppTestBase { private readonly TenantManager _tenantManager; private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IRoleManagementConfig _roleManagementConfig; public RoleManager_Tests() { _tenantManager = Resolve<TenantManager>(); _unitOfWorkManager = Resolve<IUnitOfWorkManager>(); _roleManagementConfig = Resolve<IRoleManagementConfig>(); } [Fact] public async Task Should_Create_And_Retrieve_Role() { await CreateRole("Role1"); var role1Retrieved = await RoleManager.FindByNameAsync("Role1"); role1Retrieved.ShouldNotBe(null); role1Retrieved.Name.ShouldBe("Role1"); } [Fact] public async Task Should_Not_Create_For_Duplicate_Name_Or_DisplayName() { //Create a role and check await CreateRole("Role1", "Role One"); (await RoleManager.FindByNameAsync("Role1")).ShouldNotBe(null); //Create with same name (await RoleManager.CreateAsync(new Role(null, "Role1", "Role Uno"))).Succeeded.ShouldBe(false); (await RoleManager.CreateAsync(new Role(null, "Role2", "Role One"))).Succeeded.ShouldBe(false); } [Fact] public async Task PermissionTests() { var role1 = await CreateRole("Role1"); (await RoleManager.IsGrantedAsync(role1.Id, PermissionManager.GetPermission("Permission1"))).ShouldBe(false); (await RoleManager.IsGrantedAsync(role1.Id, PermissionManager.GetPermission("Permission3"))).ShouldBe(false); await GrantPermissionAsync(role1, "Permission1"); await ProhibitPermissionAsync(role1, "Permission1"); await ProhibitPermissionAsync(role1, "Permission3"); await GrantPermissionAsync(role1, "Permission3"); await GrantPermissionAsync(role1, "Permission1"); await ProhibitPermissionAsync(role1, "Permission3"); var grantedPermissions = await RoleManager.GetGrantedPermissionsAsync(role1); grantedPermissions.Count.ShouldBe(1); grantedPermissions.ShouldContain(p => p.Name == "Permission1"); var newPermissionList = new List<Permission> { PermissionManager.GetPermission("Permission1"), PermissionManager.GetPermission("Permission2"), PermissionManager.GetPermission("Permission3") }; await RoleManager.SetGrantedPermissionsAsync(role1, newPermissionList); grantedPermissions = await RoleManager.GetGrantedPermissionsAsync(role1); grantedPermissions.Count.ShouldBe(3); grantedPermissions.ShouldContain(p => p.Name == "Permission1"); grantedPermissions.ShouldContain(p => p.Name == "Permission2"); grantedPermissions.ShouldContain(p => p.Name == "Permission3"); } [Fact] public async Task PermissionWithFeatureDependencyTests() { _roleManagementConfig.StaticRoles.Add( new StaticRoleDefinition( "admin", MultiTenancySides.Tenant) ); Tenant tenant; Role adminRole; using (var uow = _unitOfWorkManager.Begin()) { tenant = new Tenant("Tenant1", "Tenant1"); await _tenantManager.CreateAsync(tenant); await _unitOfWorkManager.Current.SaveChangesAsync(); using (_unitOfWorkManager.Current.SetTenantId(tenant.Id)) { AbpSession.TenantId = tenant.Id; await RoleManager.CreateStaticRoles(tenant.Id); await _unitOfWorkManager.Current.SaveChangesAsync(); adminRole = RoleManager.Roles.Single(r => r.Name == "admin"); await RoleManager.GrantAllPermissionsAsync(adminRole); } await uow.CompleteAsync(); } using (var uow = _unitOfWorkManager.Begin()) { using (_unitOfWorkManager.Current.SetTenantId(tenant.Id)) { AbpSession.TenantId = tenant.Id; (await RoleManager.IsGrantedAsync(adminRole.Id, "PermissionWithFeatureDependency")).ShouldBe(false); (await RoleManager.IsGrantedAsync(adminRole.Id, "Permission1")).ShouldBe(true); (await RoleManager.IsGrantedAsync(adminRole.Id, "Permission2")).ShouldBe(true); (await RoleManager.IsGrantedAsync(adminRole.Id, "Permission3")).ShouldBe(true); (await RoleManager.IsGrantedAsync(adminRole.Id, "Permission4")).ShouldBe(true); var grantedPermissions = await RoleManager.GetGrantedPermissionsAsync(adminRole); grantedPermissions.Count.ShouldBe(6); grantedPermissions.ShouldContain(p => p.Name == "Permission1"); grantedPermissions.ShouldContain(p => p.Name == "Permission2"); grantedPermissions.ShouldContain(p => p.Name == "Permission3"); grantedPermissions.ShouldContain(p => p.Name == "Permission4"); } await uow.CompleteAsync(); } } } }
zclmoon/aspnetboilerplate
test/Abp.Zero.SampleApp.Tests/Roles/RoleManager_Tests.cs
C#
mit
5,931
pre.sh_sourceCode { background-color: #ffff80; color: #2C7B34; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_keyword { color: #1d45d6; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_type { color: #ed0f55; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_string { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_regexp { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_specialchar { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_comment { color: #24c815; font-weight: normal; font-style: italic; } pre.sh_sourceCode .sh_number { color: #e11a70; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_preproc { color: #1583b1; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_symbol { color: #fa4700; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_function { color: #1d45d6; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_cbracket { color: #fa4700; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_url { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_date { color: #1d45d6; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_time { color: #1d45d6; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_file { color: #1d45d6; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_ip { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_name { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_variable { color: #26aae7; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_oldfile { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_newfile { color: #ca4be3; font-weight: normal; font-style: normal; } pre.sh_sourceCode .sh_difflines { color: #1d45d6; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_selector { color: #26aae7; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_property { color: #1d45d6; font-weight: bold; font-style: normal; } pre.sh_sourceCode .sh_value { color: #ca4be3; font-weight: normal; font-style: normal; }
djgguyon/share-price
web/css/shjs/sh_easter.css
CSS
mit
2,581
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. #if FullNetFx || NETCOREAPP2_0 using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using Xunit; namespace Microsoft.Azure.Services.AppAuthentication.Unit.Tests { public class AzureServiceTokenProviderExceptionTests { [Fact] public void SerializableTest() { var exception = new AzureServiceTokenProviderException("connectionString", "resource", "authority", "message"); // serialize MemoryStream stream = new MemoryStream(); IFormatter formatter = new BinaryFormatter(); formatter.Serialize(stream, exception); // deserialize stream.Seek(0, SeekOrigin.Begin); var exceptionDeserialized = (AzureServiceTokenProviderException)formatter.Deserialize(stream); // simple comparison Assert.Equal(exception.Message, exceptionDeserialized.Message); } } } #endif
brjohnstmsft/azure-sdk-for-net
sdk/mgmtcommon/AppAuthentication/Azure.Services.AppAuthentication.Unit.Tests/AzureServiceTokenProviderExceptionTests.cs
C#
mit
1,136
// @flow // $ExpectError: No negative tests here const skipNegativeTest: string = true; var inquirer = require('inquirer'); var directionsPrompt = { type: 'list', name: 'direction', message: 'Which direction would you like to go?', choices: ['Forward', 'Right', 'Left', 'Back'] }; function main() { console.log('You find youself in a small room, there is a door in front of you.'); exitHouse(); } function exitHouse() { inquirer.prompt(directionsPrompt).then(function (answers) { if (answers.direction === 'Forward') { console.log('You find yourself in a forest'); console.log('There is a wolf in front of you; a friendly looking dwarf to the right and an impasse to the left.'); encounter1(); } else { console.log('You cannot go that way. Try again'); exitHouse(); } }); } function encounter1() { inquirer.prompt(directionsPrompt).then(function (answers) { var direction = answers.direction; if (direction === 'Forward') { console.log('You attempt to fight the wolf'); console.log('Theres a stick and some stones lying around you could use as a weapon'); encounter2b(); } else if (direction === 'Right') { console.log('You befriend the dwarf'); console.log('He helps you kill the wolf. You can now move forward'); encounter2a(); } else { console.log('You cannot go that way'); encounter1(); } }); } function encounter2a() { inquirer.prompt(directionsPrompt).then(function (answers) { var direction = answers.direction; if (direction === 'Forward') { var output = 'You find a painted wooden sign that says:'; output += ' \n'; output += ' ____ _____ ____ _____ \n'; output += '(_ _)( _ )( _ \\( _ ) \n'; output += ' )( )(_)( )(_) ))(_)( \n'; output += ' (__) (_____)(____/(_____) \n'; console.log(output); } else { console.log('You cannot go that way'); encounter2a(); } }); } function encounter2b() { inquirer.prompt({ type: 'list', name: 'weapon', message: 'Pick one', choices: [ 'Use the stick', 'Grab a large rock', 'Try and make a run for it', 'Attack the wolf unarmed' ] }).then(function () { console.log('The wolf mauls you. You die. The end.'); }); } main();
orlandoc01/flow-typed
definitions/npm/inquirer_v2.x.x/test_hierarchical_v2.x.x.js
JavaScript
mit
2,347
// Type definitions for iScroll Lite 4.1 // Project: http://cubiq.org/iscroll-4 // Definitions by: Boris Yankov <https://github.com/borisyankov/> // Definitions: https://github.com/borisyankov/DefinitelyTyped interface iScrollEvent { (e: Event): void; } interface iScrollOptions { hScroll?: boolean; vScroll?: boolean; x?: number; y?: number; bounce?: boolean; bounceLock?: boolean; momentum?: boolean; lockDirection?: boolean; useTransform?: boolean; useTransition?: boolean; // Events onRefresh?: iScrollEvent; onBeforeScrollStart?: iScrollEvent; onScrollStart?: iScrollEvent; onBeforeScrollMove?: iScrollEvent; onScrollMove?: iScrollEvent; onBeforeScrollEnd?: iScrollEvent; onScrollEnd?: iScrollEvent; onTouchEnd?: iScrollEvent; onDestroy?: iScrollEvent; } declare class iScroll { constructor (element: string); constructor (element: string, options: iScrollOptions); destroy(): void; refresh(): void; scrollTo(x: number, y: number, time: number, relative: boolean): void; scrollToElement(element: string, time: number): void; disable(): void; enalbe(): void; stop(): void; }
A11oW/DefinitelyTyped
iscroll/iscroll-lite.d.ts
TypeScript
mit
1,251
using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using OpenOrderFramework.Configuration; using OpenOrderFramework.Models; using RestSharp; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; namespace OpenOrderFramework.Controllers { [Authorize] public class CheckoutController : Controller { ApplicationDbContext storeDB = new ApplicationDbContext(); AppConfigurations appConfig = new AppConfigurations(); public List<String> CreditCardTypes { get { return appConfig.CreditCardType;} } // // GET: /Checkout/AddressAndPayment public ActionResult AddressAndPayment() { ViewBag.CreditCardTypes = CreditCardTypes; var previousOrder = storeDB.Orders.FirstOrDefault(x => x.Username == User.Identity.Name); if (previousOrder != null) return View(previousOrder); else return View(); } // // POST: /Checkout/AddressAndPayment [HttpPost] public async Task<ActionResult> AddressAndPayment(FormCollection values) { ViewBag.CreditCardTypes = CreditCardTypes; string result = values[9]; var order = new Order(); TryUpdateModel(order); order.CreditCard = result; try { order.Username = User.Identity.Name; order.Email = User.Identity.Name; order.OrderDate = DateTime.Now; var currentUserId = User.Identity.GetUserId(); if (order.SaveInfo && !order.Username.Equals("guest@guest.com")) { var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext())); var store = new UserStore<ApplicationUser>(new ApplicationDbContext()); var ctx = store.Context; var currentUser = manager.FindById(User.Identity.GetUserId()); currentUser.Address = order.Address; currentUser.City = order.City; currentUser.Country = order.Country; currentUser.State = order.State; currentUser.Phone = order.Phone; currentUser.PostalCode = order.PostalCode; currentUser.FirstName = order.FirstName; //Save this back //http://stackoverflow.com/questions/20444022/updating-user-data-asp-net-identity //var result = await UserManager.UpdateAsync(currentUser); await ctx.SaveChangesAsync(); await storeDB.SaveChangesAsync(); } //Save Order storeDB.Orders.Add(order); await storeDB.SaveChangesAsync(); //Process the order var cart = ShoppingCart.GetCart(this.HttpContext); order = cart.CreateOrder(order); CheckoutController.SendOrderMessage(order.FirstName, "New Order: " + order.OrderId,order.ToString(order), appConfig.OrderEmail); return RedirectToAction("Complete", new { id = order.OrderId }); } catch { //Invalid - redisplay with errors return View(order); } } // // GET: /Checkout/Complete public ActionResult Complete(int id) { // Validate customer owns this order bool isValid = storeDB.Orders.Any( o => o.OrderId == id && o.Username == User.Identity.Name); if (isValid) { return View(id); } else { return View("Error"); } } private static RestResponse SendOrderMessage(String toName, String subject, String body, String destination) { RestClient client = new RestClient(); //fix this we have this up top too AppConfigurations appConfig = new AppConfigurations(); client.BaseUrl = "https://api.mailgun.net/v2"; client.Authenticator = new HttpBasicAuthenticator("api", appConfig.EmailApiKey); RestRequest request = new RestRequest(); request.AddParameter("domain", appConfig.DomainForApiKey, ParameterType.UrlSegment); request.Resource = "{domain}/messages"; request.AddParameter("from", appConfig.FromName + " <" + appConfig.FromEmail + ">"); request.AddParameter("to", toName + " <" + destination + ">"); request.AddParameter("subject", subject); request.AddParameter("html", body); request.Method = Method.POST; IRestResponse executor = client.Execute(request); return executor as RestResponse; } } }
BITS-CO-ID/bits-shop
OpenOrderFramework/Controllers/CheckoutController.cs
C#
mit
5,400
{% extends "layout.html" %} {% block head %} {% include "includes/head.html" %} <script> var commitmentListSource = 'provider'; var employerOrNot = JSON.parse(localStorage.getItem('commitments.isEmployer')); var deletedUser = JSON.parse(localStorage.getItem('commitments.deletedUserAlert')); </script> <script src="/public/javascripts/das/list-commitment-1.6.js"></script> <script src="/public/javascripts/das/jquery.highlight-5.js"></script> {% endblock %} {% block page_title %} Apprenticeships {% endblock %} {% block content %} <style> .people-nav a { {% include "includes/nav-on-state-css.html" %} } .highlight { font-weight:700; } </style> <script> $(document).ready(function() { var changeStuff = function() { if (employerOrNot=='yes') { document.getElementById("commitmentsName").textContent = " Hackney Skills & Training Ltd"; document.getElementById("providerName").textContent = "Provider:" ; $(notesStuff).addClass("rj-dont-display"); $(addReference).addClass("rj-dont-display"); $(ULNTable).addClass("rj-dont-display"); $(removeMe).addClass("rj-dont-display") } else { $(notesStuff).removeClass("rj-dont-display"); $(addReference).removeClass("rj-dont-display"); }; }; var changeUnknown = function() { $('td').highlight('unknown'); $('td').highlight('null'); $('td').highlight('----'); }; var showDeletedUserAlert = function() { if (deletedUser=='yes') { localStorage.setItem("commitments.deletedUserAlert", JSON.stringify("nope")); $(deletedUserAlertMessage).removeClass("rj-dont-display"); } } changeStuff(); changeUnknown(); showDeletedUserAlert() }); var goToDelete = function() { window.location.href='../provider-interface/cohort-deletion-are-you-sure'; } </script> <main id="content" role="main"> {% include "includes/phase_banner_beta.html" %} <div class="breadcrumbs"> <ol role="breadcrumbs"> <li><a href="/{% include "includes/sprint-link.html" %}/balance">Home</a></li> <li><a href="/{% include "includes/sprint-link.html" %}/contracts/providers">Apprentices</a></li> <li><a href="/{% include "includes/sprint-link.html" %}/contracts/provider-in-progress">Start an apprentice</a></li> <li id="removeWithNav">98HGS3F</li> </ol> </div> <!--h1 class="heading-large">Levy account</h1--> <!--h2 class="bold-medium">Acme Ltd Levy Account</h2--> <div style= "" id="deletedUserAlertMessage" class="panel panel-border-wide alert-default-green-thing rj-dont-display "> <i class="fa fa-check "style="padding-right:5px"></i> Apprentice David Jenkins was deleted </div> <div class="grid-row"> <div class="column-two-thirds"> <h1 class="heading-xlarge" id="commitmentsHeader">Review your cohort</h1> </div> </div> <div class="grid-row"> <div class="column-third" style="" > <div style="background-color:#2E358B; min-height:160px" > <h2 id="numberOfApprentices" class="bold-xxlarge" style=" color:#fff; margin: 0px 0 0px 15px; padding-top:25px">25</h2> <h2 class="heading-medium" style="color: #fff; margin: 0px 0 0px 15px;">Apprentices</h2> </div> </div> <div class="column-third" style="" > <div style="background-color:#912B88; min-height:160px" > <h2 id="numberOfApprentices" class="bold-xxlarge" style=" color:#fff; margin: 0px 0 0px 15px; padding-top:25px">10</h2> <h2 class="heading-medium" style="color: #fff; margin: 0px 0 0px 15px;">Incomplete records</h2> </div> </div> <div class="column-third" style="" > <div style="background-color:#D53880; min-height:160px" > <h2 id="totalCostOfApprentices" class="bold-xlarge" style=" color:#fff; margin: 0px 0 0px 15px; padding-top:27px">£29,002</h2> <h2 class="heading-medium" style="color: #fff; margin: 28px 0 0px 15px;">Total cost</h2> </div> <!--div style="margin-top:10px"><a href="/{% include "includes/sprint-link.html" %}/contracts/confirmation/payment-plans">View the payment schedule</a></div--> </div> </div> <div style="margin-top:35px"></div> <div class="grid-row" style="padding-bottom:15px"> <div class="column-half" > <div class="" > <!--h2 class="heading-medium" id="commitmentsName" style="margin: 0 0 5px 0">Acme Coventry Ltd</h2--> <div id=""><h2 id="providerName" class="heading-small" style="display:inline-block; margin:0;">Employer:&nbsp</h2 ><p id="commitmentsName" style="display:inline; margin:0;">Acme Coventry Ltd</p></div> <div id="addReference"><h2 class="heading-small" style="display:inline-block; margin:0;">Reference:&nbsp</h2 ><p style="display:inline; margin:0;">98HGS3F</p></div> </div> </div> <div class="column-half" id="notesStuff"> <div id="removeMe" style="padding-bottom:15px"> <div><h2 class="heading-small" style="display:inline-block; margin:0;">Note:&nbsp</h2 ><p style=" margin:0;">There is space here for a note to be added.</p></div> </div> </div> </div> <!-- ----------- This is the default where there aren't any groups or cohorts added ------------ --> <div style="" class="rj-no-apprenticeships" id="no-apprenticeships"> <h2 class="heading-medium"><span style="font-weight:700" id=""> 0 Apprentices</span></h2> <hr style="margin:0 0 18px 0" /> <div class="commit-bar"> <!--form class="" style="display:inline-block; float:left;" action="/{% include "includes/sprint-link.html" %}/contracts/provider-in-progress/do-next"> <div style="display:inline-block;"><input class="button" style="display:inline; margin:0 0 0 10px" type="submit" id="send-to-employer" value="Finish editing"></div> </form> <form class="" style="display:inline-block; float:right;" action="/{% include "includes/sprint-link.html" %}/contracts/provider-interface/add-apprenticeship"> <input type="hidden" name="source" value="provider" /> <div style="display:inline-block;"><input style="display:inline" class="button-grey-secondary button " type="submit" id="bulk-upload" value="Add an apprentice"></div> </form> <form class="" style="display:inline-block" action="/{% include "includes/sprint-link.html" %}/contracts/provider-in-progress/bulk-upload-provider"> <input type="hidden" name="source" value="provider" /> <div style="display:inline-block;"><input style="display:inline; margin:0 0 0 10px" class="button-grey-secondary button " type="submit" id="bulk-upload" value="Bulk upload apprentices"></div> </form> <form class="" style="display:inline-block; float:right;" action="/{% include "includes/sprint-link.html" %}/contracts/provider-in-progress/do-next"> <div style="display:inline-block;"><input class="button" style="display:inline; margin:0 0 0 10px" type="submit" id="send-to-employer" value="Finish editing"></div> </form--> <h2 class="heading-medium">USERS WILL NEVER SEE THIS PAGE IN THIS STATE</h2> <a href="/{% include "includes/sprint-link.html" %}/contracts/new-contract/bulk-or-single">ADD SOME APPRENTICES TO FIX THIS PAGE</a> </div> <hr style="margin:16px 0 15px 0" /> </div> <!-- -------------- This is shows when one apprenticeship has been added ---------- --> <div style="" class="rj-has-apprenticeships" id="apprenticeships"> <hr style="margin:0 0 20px 0" /> <div class="commit-bar"> <form class="" style="display:inline-block; float:left;" action="/{% include "includes/sprint-link.html" %}/contracts/provider-in-progress/do-next"> <div style="display:inline-block;"><input class="button" style="display:inline; " type="submit" id="send-to-employer" value="Save and continue"></div> </form> <form class="" style="display:inline-block;" action="/{% include "includes/sprint-link.html" %}/contracts/new-contract/bulk-or-single"> <input type="hidden" name="source" value="provider" /> <div style="display:inline-block;"><input style="display:inline; margin:0 0 0 10px; " class="button-grey-secondary button " type="submit" id="bulk-upload" value="Add more apprentices"></div> </form> <div style="clear:both"></div> </div> <hr style="margin:16px 0 15px 0" /> <div style="clear:both"></div> <h2 class ="heading-medium" style="margin-bottom:0px" id="apprenticeReplaceMe"></h2> <p style="margin:0">Level: 4</p> <p style="margin:0 0 15px 0">Training code: 3246</p> <div class="fullWidthGreyAlert panel panel-border-wide"> <h2 class="heading-medium" style="padding-top:20px; margin-bottom:10px" >2 Mechatronics Engineer apprenticeships above funding band maximum </h2> <p style="margin:0">The costs are above the £2,000 <a href="">maximum value of the funding band</a> for this apprenticeship. You'll need to pay the difference directly to the training provider - this can't be funded from your account.</p> </div> <table class="" id=""> <thead> <tr> <th scope="col" class="" >Name</th> <!--th scope="col" class="">Family<br />name</th--> <th id="ULNTable" scope="col" class="">ULN</th> <th id="" scope="col" class="">Date of birth</th> <th scope="col" class="">Training dates</th> <!--th scope="col" class="">Endpoint Assessor</th--> <th scope="col" class="">Cost</th> <th scope="col" class=""></th> </tr> </thead> <tbody> <tr> <td>Taylor Jones</td> <td class="">10 May 1999</td> <td class=" ">11/2018 to 11/2020 </td> <td class="errorBoxBlack">£2,200</td> </td> </tbody> </table> <div style="margin-top:20px"></div> <div class="fullWidthGreyAlert panel panel-border-wide"> <h2 class="heading-medium" style="padding-top:20px; margin-bottom:10px" >4 Mechatronics Engineer apprenticeships above funding band maximum </h2> <p style="margin:0">The costs are above the £2,000 <a href="">maximum value of the funding band</a> for this apprenticeship. You'll need to pay the difference directly to the training provider - this can't be funded from your account.</p> </div> <div style="margin-top:20px"></div> <table class="" id=""> <thead> <tr> <th scope="col" class="" >Name</th> <!--th scope="col" class="">Family<br />name</th--> <th id="ULNTable" scope="col" class="">ULN</th> <th id="" scope="col" class="">Date of birth</th> <th scope="col" class="">Training dates</th> <!--th scope="col" class="">Endpoint Assessor</th--> <th scope="col" class="">Cost</th> <!--th scope="col" class=""></th> </tr--> </thead> <tbody> <tr> <td class=""><a href="/{% include "includes/sprint-link.html" %}/ontracts/provider-interface/add-apprenticeship-static">Edit</a></td> </tr> <tr> <td>Jeff Willis</td> <td class="">21 April 2000</td> <td class=" ">11/2018 to 11/2020 </td> <td class="errorBoxBlack">£2,600</td> <!--/td--> <td class=""><a href="/{% include "includes/sprint-link.html" %}/ontracts/provider-interface/add-apprenticeship-static">Edit</a></td> </tr> </tbody> </table> </div> <!--div id="addApprenticesEmptyState" class="emptyState"> <div class="emptyStateAlert"> <div class="emptyStateCopy"> <p>You haven't added any apprentices yet. Use the options on this page to add apprentices.</p> </div> </div> </div--> <div id="bottomToolBarLotsofApprentices"> <!--div style="margin-top: 50px"></div--> <!--hr style="margin:0 0 18px 0" /--> <div class="commit-bar"> <div style="margin-top:50px"></div> <form class="" style="display:inline-block; float:left;" action="/{% include "includes/sprint-link.html" %}/contracts/provider-in-progress/do-next"> <div style="display:inline-block;"><input class="button" style="display:inline; " type="submit" id="send-to-employer" value="Save and continue"></div> </form> <form class="" style="display:inline-block;" action="/{% include "includes/sprint-link.html" %}/contracts/new-contract/bulk-or-single"> <input type="hidden" name="source" value="provider" /> <div style="display:inline-block;"><input style="display:inline; margin:0 0 0 10px; " class="button-grey-secondary button " type="submit" id="bulk-upload" value="Add more apprentices"></div> </form> </div> <!--hr style="margin:20px 0 15px 0" /--> </div> <div style="margin-top:20px;display:inline-block; float:right"><input class="button delete-button" onclick="goToDelete()" type="button" id="deleteButton" value="Delete this cohort"></div> </main> {% endblock %}
SkillsFundingAgency/das-alpha-ui
app/views/programmeTen/contracts/provider-in-progress/provider-list-funding-cap-limit copy.html
HTML
mit
14,565
<?php /** * Do not edit this file. Edit the config files found in the config/ dir instead. * This file is required in the root directory so WordPress can find it. * WP is hardcoded to look in its own directory or one directory up for wp-config.php. */ require_once dirname(__DIR__) . '/vendor/autoload.php'; require_once dirname(__DIR__) . '/config/application.php'; require_once ABSPATH . 'wp-settings.php';
OurWorldInData/owid-grapher
wordpress/web/wp-config.php
PHP
mit
413
/** * Module dependencies. */ var express = require('../../'); var cookie-parser = require('cookie-parser'); var app = module.exports = express(); // pass a secret to cookieParser() for signed cookies app.use(cookieParser('manny is cool')); // add req.session cookie support app.use(cookieSession()); // do something with the session app.use(count); // custom middleware function count(req, res) { req.session.count = req.session.count || 0; var n = req.session.count++; res.send('viewed ' + n + ' times\n'); } /* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); }
NickHeiner/express
examples/cookie-sessions/index.js
JavaScript
mit
644
.angularjs-datetime-picker { color: #333; font: normal 14px sans-serif; border: 1px solid #ddd; display: inline-block; background: #fff; } .angularjs-datetime-picker > .adp-month { text-align: center; line-height: 22px; padding: 10px; background: #fcfcfc; text-transform: uppercase; font-weight: bold; border-bottom: 1px solid #ddd; position: relative; } .angularjs-datetime-picker > .adp-month > button { color: #555; font: normal 14px sans-serif; outline: none; position: absolute; background: transparent; border: none; cursor: pointer; } .angularjs-datetime-picker > .adp-month > button:hover { color: #333; } .angularjs-datetime-picker > .adp-month > button.adp-prev { left: 10px; } .angularjs-datetime-picker > .adp-month > button.adp-next { right: 10px; } .angularjs-datetime-picker > .adp-days { width: 210px; /* 30 x 7 */ margin: 10px; text-align: center; } .angularjs-datetime-picker > .adp-days > .adp-day-of-week, .angularjs-datetime-picker > .adp-days > .adp-day { box-sizing: border-box; -moz-box-sizing: border-box; border: 1px solid transparent; width: 30px; line-height: 28px; float: left; } .angularjs-datetime-picker > .adp-days > .adp-day-of-week { font-weight: bold; } .angularjs-datetime-picker > .adp-days > .adp-day:not(.selectable) { opacity: 0.15; cursor: default; } .angularjs-datetime-picker > .adp-days > .adp-day.selectable { cursor: pointer; } .angularjs-datetime-picker > .adp-days > .adp-day.selected { background: #e0e0e0; } .angularjs-datetime-picker > .adp-days > .adp-day.selectable:hover { background: #eee; } .angularjs-datetime-picker > .adp-days:after { content: ''; display: block; clear: left; height: 0; } .angularjs-datetime-picker input[type=range] { width: 150px; }
kalyandechiraju/book-my-room
webapp/css/angularjs-datetime-picker.css
CSS
mit
1,801
/***************************************************************************** * * Author: Kerri Shotts <kerrishotts@gmail.com> * http://www.photokandy.com/books/mastering-phonegap * * MIT LICENSED * * Copyright (c) 2016 Kerri Shotts (photoKandy Studios LLC) * Portions Copyright various third parties where noted. * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following * conditions: * The above copyright notice and this permission notice shall be included in all copies * or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * *****************************************************************************/ /* @flow */ "use strict"; /*globals cordova*/ import Emitter from "yasmf-emitter"; // private properties -- we need some symbols let _selectors = Symbol(); let _useSmoothScrolling = Symbol(); let _smoothScrollDuration = Symbol(); let _showElementUnderKeyboard = Symbol(); /** * given a selector string, return matching elements in an Array * @param {string} selectorString * @return Array<Node> */ function getScrollContainers(selectorString/*: string*/)/*: Array<Node>*/ { return Array.from(document.querySelectorAll(selectorString)); } /** * Given an element, returns an array representing the start and end of * the current selection. * @param {Node} focusedElement * @return Array<number> */ function getElementSelection(focusedElement/*: Node*/)/*: Array<number>*/ { return [focusedElement.selectionStart, focusedElement.selectionEnd]; } /** * Given an element and a tuple representing the start and end of the selection, * set the selection on the element. * @param {Node} focusedElement * @param {number} selectionStart the start of the selection * @param {number} selectionEnd the end of the selection */ function setElementSelection(focusedElement/*: Node*/, [selectionStart/*: number*/, selectionEnd/*: number*/] = [0, 0])/*: void*/ { focusedElement.selectionStart = selectionStart; focusedElement.selectionEnd = selectionEnd; } function showElementUnderKeyboard(keyboardHeight/*: number*/) { let e = document.createElement("div"); e.className = "sk-element-under-keyboard"; e.style.position = "absolute"; e.style.bottom = "0"; e.style.left = "0"; e.style.right = "0"; e.style.zIndex = "9999999999999"; e.style.height = `${keyboardHeight}px`; document.body.appendChild(e); } function hideElementUnderKeyboard()/*: void*/ { let els = Array.from(document.querySelectorAll(".sk-element-under-keyboard")); els.forEach((el) => document.body.removeChild(el)); } /** * Saves the element's current text selection, then resets it to 0. After a tick, it * restores the element's saved text selection. * This is to fix iOS's buggy behavior regarding cursor positioning after the scrolling * of an element. * * @param {Node} focusedElement */ function handleTextSelection(focusedElement/*: Node*/)/*: void*/ { setTimeout(() => { // save the selection let selection = getElementSelection(focusedElement); // reset the selection to 0,0 setElementSelection(focusedElement); // after a short delay, restore the selection setTimeout(() => setElementSelection(focusedElement, selection), 33); }, 0); } /** * Provides methods for avoiding the soft keyboard. This tries to be automatic, * but you will need to supply scrollable selectors. */ export default class SoftKeyboard extends Emitter { /** * Construct an instance of the SoftKeyboard * * @return SoftKeyboard */ constructor(options) { super(options); } /** * Initialize a SoftKeyboard. Will be called automatically during construction * @param {Array<string>} [selectors] defaults to an empty array * @param {boolean} [useSmoothScrolling] defaults to true * @param {number} [smoothScrollDuration] defaults to 100 * @param {boolean} [showElementUnderKeyboard] defaults to false */ init({selectors=[], useSmoothScrolling = true, smoothScrollDuration = 100, showElementUnderKeyboard = false} = {}) { // selectors: Array, useSmoothScrolling: boolean, smoothScrollDuration: number if (typeof cordova !== "undefined") { if (cordova.plugins && cordova.plugins.Keyboard) { cordova.plugins.Keyboard.disableScroll(true); window.addEventListener("native.keyboardshow", this.keyboardShown.bind(this)); window.addEventListener("native.keyboardhide", this.keyboardHidden.bind(this)); } } this[_selectors] = new Set(); selectors.forEach(sel => this.addSelector(sel)); this[_useSmoothScrolling] = useSmoothScrolling; this[_smoothScrollDuration] = smoothScrollDuration; this[_showElementUnderKeyboard] = showElementUnderKeyboard; } /** * Adds a selector * @param {string} selector A CSS selector that identifies a scrolling container * @return {SoftKeyboard} */ addSelector(selector/*: string*/)/*: SoftKeyboard*/ { this[_selectors].add(selector); return this; } /** * Removes a selector * @param {string} selector A CSS selector that identifies a scrolling container * @return {SoftKeyboard} */ removeSelector(selector/*: string*/)/*: SoftKeyboard*/ { this[_selectors].delete(selector); return this; } get selectors()/*: Array*/ { return Array.from(this[_selectors]); } get selectorString()/*: string*/ { return this.selectors.join(", "); } get useSmoothScrolling()/*: boolean*/ { return this[_useSmoothScrolling]; } set useSmoothScrolling(b/*: boolean*/)/*: void*/ { this[_useSmoothScrolling] = b; } get smoothScrollDuration()/*: number*/ { return this[_smoothScrollDuration]; } set smoothScrollDuration(d/*: number*/)/*: void*/ { this[_smoothScrollDuration] = d; } get showElementUnderKeyboard()/*: boolean*/ { return this[_showElementUnderKeyboard]; } set showElementUnderKeyboard(b/*: boolean*/)/*: void*/ { this[_showElementUnderKeyboard] = b; } /** * Shows the keyboard, if possible */ showKeyboard(force/*: boolean*/ = false)/*: void*/ { if (typeof cordova !== "undefined") { if (cordova.plugins && cordova.plugins.Keyboard) { cordova.plugins.Keyboard.show(); return; } } if (force) { this.keyboardShown({keyboardHeight: 240}); } } /** * Hide the keyboard, if possible */ hideKeyboard(force/*: boolean*/ = false)/*: void*/ { if (typeof cordova !== "undefined") { if (cordova.plugins && cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hide(); return; } } if (force) { this.keyboardHidden({}); } } /** * Triggered when the soft keyboard is displayed * @param {{keyboardHeight: number}} e the event triggered from the keyboard plugin */ keyboardShown(e)/*: void*/ { this.emit("keyboardShown", e); this.emit("willResize", e); console.log ("keyboard shown", e.keyboardHeight); setTimeout(() => { let screenHeight = window.innerHeight; //(document.body.clientWidth === window.screen.height ? window.screen.width : window.screen.height); let scrollContainers = getScrollContainers(this.selectorString); let keyboardHeight = 0; //e.keyboardHeight; if (this.showElementUnderKeyboard) { showElementUnderKeyboard(keyboardHeight); } // for each scroll container in the DOM, we need to calculate the // the height it should be to fit in the reduced view scrollContainers.forEach((sc) => { let scTop = sc.getBoundingClientRect().top; // now that we know the top of the scroll container, the height of the // the screen, and the height of the keyboard, we can calculate the // appropriate max-height for the container. let maxHeight = "" + (screenHeight - keyboardHeight - scTop); console.log("New height", maxHeight); if (maxHeight > 100) { sc.style.maxHeight = maxHeight + "px"; } }); this.emit("didResize", e); // changing the height isn't sufficient: we need to scroll any focused // element into view. setTimeout(() => { let focusedElement = document.querySelector(":focus"); if (focusedElement) { if (!this.useSmoothScrolling || !window.requestAnimationFrame) { // scroll the element into view, but only if we have to if (focusedElement.scrollIntoViewIfNeeded) { focusedElement.scrollIntoViewIfNeeded(); } else { // aim for the bottom of the viewport focusedElement.scrollIntoView(false); } // iOS doesn't always position the cursor correctly after // a scroll operation. Clear the selection so that iOS is // forced to recompute where the cursor should appear. handleTextSelection(focusedElement); } else { // to scroll the element smoothly into view, things become a little // more difficult. let fElTop = focusedElement.getBoundingClientRect().top, sc = focusedElement, scTop, scBottom, selectorString = this.selectorString; // find the containing scroll container if we can while (sc && !sc.matches(selectorString)) { sc = sc.parentElement; } if (sc) { scTop = sc.getBoundingClientRect().top; scBottom = sc.getBoundingClientRect().bottom; if (fElTop < scTop || fElTop > (((scBottom - scTop) / 2) + scTop)) { // the element isn't above the keyboard (or is too far above), // scroll it into view smoothly let targetTop = ((scBottom - scTop) / 2) + scTop, deltaTop = fElTop - targetTop, origScrollTop = sc.scrollTop, startTimestamp = null; // animate our scroll let scrollStep; window.requestAnimationFrame(scrollStep = (timestamp) => { if (!startTimestamp) { startTimestamp = timestamp; } var progressDelta = timestamp - startTimestamp, pct = progressDelta / this.smoothScrollDuration; sc.scrollTop = origScrollTop + (deltaTop * pct); if (progressDelta < this.smoothScrollDuration) { window.requestAnimationFrame(scrollStep); } else { // set the scroll to the final desired position, just in case // we didn't actually get there (or overshot) sc.scrollTop = origScrollTop + deltaTop; handleTextSelection(focusedElement); } }); } } } } }, 0); }, 0); } /** * Triggered when the soft keyboard is hidden * @param {*} e */ keyboardHidden(e)/*: void*/ { setTimeout(() => { this.emit("keyboardHidden", e); this.emit("willResize", e); let scrollContainers = getScrollContainers(this.selectorString); scrollContainers.forEach(el => el.style.maxHeight = ""); hideElementUnderKeyboard(); this.emit("didResize", e); }, 0); } } export function createSoftKeyboard(...args) { return new SoftKeyboard(...args); }
kerrishotts/Mastering-PhoneGap-Code-Package
logology/src/www/js/lib/SoftKeyboard.js
JavaScript
mit
13,763
import { ElementRef, Input, Component, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Calendar } from '@fullcalendar/core'; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FullCalendar = /** @class */ (function () { function FullCalendar(el) { this.el = el; } FullCalendar.prototype.ngOnInit = function () { this.config = { theme: true }; if (this.options) { for (var prop in this.options) { this.config[prop] = this.options[prop]; } } }; FullCalendar.prototype.ngAfterViewChecked = function () { if (!this.initialized && this.el.nativeElement.offsetParent) { this.initialize(); } }; Object.defineProperty(FullCalendar.prototype, "events", { get: function () { return this._events; }, set: function (value) { this._events = value; if (this._events && this.calendar) { this.calendar.removeAllEventSources(); this.calendar.addEventSource(this._events); } }, enumerable: true, configurable: true }); Object.defineProperty(FullCalendar.prototype, "options", { get: function () { return this._options; }, set: function (value) { this._options = value; if (this._options && this.calendar) { for (var prop in this._options) { var optionValue = this._options[prop]; this.config[prop] = optionValue; this.calendar.setOption(prop, optionValue); } } }, enumerable: true, configurable: true }); FullCalendar.prototype.initialize = function () { this.calendar = new Calendar(this.el.nativeElement.children[0], this.config); this.calendar.render(); this.initialized = true; if (this.events) { this.calendar.removeAllEventSources(); this.calendar.addEventSource(this.events); } }; FullCalendar.prototype.getCalendar = function () { return this.calendar; }; FullCalendar.prototype.ngOnDestroy = function () { if (this.calendar) { this.calendar.destroy(); this.initialized = false; this.calendar = null; } }; FullCalendar.ctorParameters = function () { return [ { type: ElementRef } ]; }; __decorate([ Input() ], FullCalendar.prototype, "style", void 0); __decorate([ Input() ], FullCalendar.prototype, "styleClass", void 0); __decorate([ Input() ], FullCalendar.prototype, "events", null); __decorate([ Input() ], FullCalendar.prototype, "options", null); FullCalendar = __decorate([ Component({ selector: 'p-fullCalendar', template: '<div [ngStyle]="style" [class]="styleClass"></div>' }) ], FullCalendar); return FullCalendar; }()); var FullCalendarModule = /** @class */ (function () { function FullCalendarModule() { } FullCalendarModule = __decorate([ NgModule({ imports: [CommonModule], exports: [FullCalendar], declarations: [FullCalendar] }) ], FullCalendarModule); return FullCalendarModule; }()); /** * Generated bundle index. Do not edit. */ export { FullCalendar, FullCalendarModule }; //# sourceMappingURL=primeng-fullcalendar.js.map
cdnjs/cdnjs
ajax/libs/primeng/9.0.3/fesm5/primeng-fullcalendar.js
JavaScript
mit
4,135
## Summary of Changes in version 4.10 ## Thanks to a full cast of contributors of bug fixes and new features. A full summary of commits between 4.9 and 4.10 is on [github](https://github.com/junit-team/junit4/compare/r4.9...r4.10) ### junit-dep has correct contents ### junit-dep-4.9.jar incorrectly contained hamcrest classes, which could lead to version conflicts in projects that depend on hamcrest directly. This is fixed in 4.10 [@dsaff, closing gh-309] ### RuleChain ### The RuleChain rule allows ordering of TestRules: ```java public static class UseRuleChain { @Rule public TestRule chain= RuleChain .outerRule(new LoggingRule("outer rule") .around(new LoggingRule("middle rule") .around(new LoggingRule("inner rule"); @Test public void example() { assertTrue(true); } } ``` writes the log starting outer rule starting middle rule starting inner rule finished inner rule finished middle rule finished outer rule ### TemporaryFolder ### - `TemporaryFolder#newFolder(String... folderNames)` creates recursively deep temporary folders [@rodolfoliviero, closing gh-283] - `TemporaryFolder#newFile()` creates a randomly named new file, and `#newFolder()` creates a randomly named new folder [@Daniel Rothmaler, closing gh-299] ### Theories ### The `Theories` runner does not anticipate theory parameters that have generic types, as reported by github#64. Fixing this won't happen until `Theories` is moved to junit-contrib. In anticipation of this, 4.9.1 adds some of the necessary machinery to the runner classes, and deprecates a method that only the `Theories` runner uses, `FrameworkMethod`#producesType(). The Common Public License that JUnit is released under is now included in the source repository. Thanks to `@pholser` for identifying a potential resolution for github#64 and initiating work on it. ### Bug fixes ### - Built-in Rules implementations - TemporaryFolder should not create files in the current working directory if applying the rule fails [@orfjackal, fixing gh-278] - TestWatcher and TestWatchman should not call failed for AssumptionViolatedExceptions [@stefanbirkner, fixing gh-296] - Javadoc bugs - Assert documentation [@stefanbirkner, fixing gh-134] - ClassRule [@stefanbirkner, fixing gh-254] - Parameterized [@stefanbirkner, fixing gh-89] - Parameterized, again [@orfjackal, fixing gh-285] - Miscellaneous - Useless code in RunAfters [@stefanbirkner, fixing gh-289] - Parameterized test classes should be able to have `@Category` annotations [@dsaff, fixing gh-291] - Error count should be initialized in junit.tests.framework.TestListenerTest [@stefanbirkner, fixing gh-225] - AssertionFailedError constructor shouldn't call super with null message [@stefanbirkner, fixing gh-318] - Clearer error message for non-static inner test classes [@stefanbirkner, fixing gh-42] ### Minor changes ### - Description, Result and Failure are Serializable [@ephox-rob, closing gh-101] - FailOnTimeout is reusable, allowing for retrying Rules [@stefanbirkner, closing gh-265] - New `ErrorCollector.checkThat` overload, that allows you to specify a reason [@drothmaler, closing gh-300]
junit-team/junit
doc/ReleaseNotes4.10.md
Markdown
epl-1.0
3,276
/**********************************************/ /* */ /* Font file generated by cpi2fnt */ /* */ /**********************************************/ static unsigned char font_8x8[] = { /* 0 0x00 '^@' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 1 0x01 '^A' */ 0x7e, /* 01111110 */ 0x81, /* 10000001 */ 0xa5, /* 10100101 */ 0x81, /* 10000001 */ 0xbd, /* 10111101 */ 0x99, /* 10011001 */ 0x81, /* 10000001 */ 0x7e, /* 01111110 */ /* 2 0x02 '^B' */ 0x7e, /* 01111110 */ 0xff, /* 11111111 */ 0xdb, /* 11011011 */ 0xff, /* 11111111 */ 0xc3, /* 11000011 */ 0xe7, /* 11100111 */ 0xff, /* 11111111 */ 0x7e, /* 01111110 */ /* 3 0x03 '^C' */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0x10, /* 00010000 */ 0x00, /* 00000000 */ /* 4 0x04 '^D' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0x10, /* 00010000 */ 0x00, /* 00000000 */ /* 5 0x05 '^E' */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ /* 6 0x06 '^F' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ /* 7 0x07 '^G' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 8 0x08 '^H' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xe7, /* 11100111 */ 0xc3, /* 11000011 */ 0xc3, /* 11000011 */ 0xe7, /* 11100111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* 9 0x09 '^I' */ 0x00, /* 00000000 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x42, /* 01000010 */ 0x42, /* 01000010 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 10 0x0a '^J' */ 0xff, /* 11111111 */ 0xc3, /* 11000011 */ 0x99, /* 10011001 */ 0xbd, /* 10111101 */ 0xbd, /* 10111101 */ 0x99, /* 10011001 */ 0xc3, /* 11000011 */ 0xff, /* 11111111 */ /* 11 0x0b '^K' */ 0x0f, /* 00001111 */ 0x07, /* 00000111 */ 0x0f, /* 00001111 */ 0x7d, /* 01111101 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x78, /* 01111000 */ /* 12 0x0c '^L' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ /* 13 0x0d '^M' */ 0x3f, /* 00111111 */ 0x33, /* 00110011 */ 0x3f, /* 00111111 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x70, /* 01110000 */ 0xf0, /* 11110000 */ 0xe0, /* 11100000 */ /* 14 0x0e '^N' */ 0x7f, /* 01111111 */ 0x63, /* 01100011 */ 0x7f, /* 01111111 */ 0x63, /* 01100011 */ 0x63, /* 01100011 */ 0x67, /* 01100111 */ 0xe6, /* 11100110 */ 0xc0, /* 11000000 */ /* 15 0x0f '^O' */ 0x18, /* 00011000 */ 0xdb, /* 11011011 */ 0x3c, /* 00111100 */ 0xe7, /* 11100111 */ 0xe7, /* 11100111 */ 0x3c, /* 00111100 */ 0xdb, /* 11011011 */ 0x18, /* 00011000 */ /* 16 0x10 '^P' */ 0x80, /* 10000000 */ 0xe0, /* 11100000 */ 0xf8, /* 11111000 */ 0xfe, /* 11111110 */ 0xf8, /* 11111000 */ 0xe0, /* 11100000 */ 0x80, /* 10000000 */ 0x00, /* 00000000 */ /* 17 0x11 '^Q' */ 0x02, /* 00000010 */ 0x0e, /* 00001110 */ 0x3e, /* 00111110 */ 0xfe, /* 11111110 */ 0x3e, /* 00111110 */ 0x0e, /* 00001110 */ 0x02, /* 00000010 */ 0x00, /* 00000000 */ /* 18 0x12 '^R' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ /* 19 0x13 '^S' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* 20 0x14 '^T' */ 0x7f, /* 01111111 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7b, /* 01111011 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x00, /* 00000000 */ /* 21 0x15 '^U' */ 0x3e, /* 00111110 */ 0x61, /* 01100001 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x86, /* 10000110 */ 0x7c, /* 01111100 */ /* 22 0x16 '^V' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 23 0x17 '^W' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ /* 24 0x18 '^X' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 25 0x19 '^Y' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 26 0x1a '^Z' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0xfe, /* 11111110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 27 0x1b '^[' */ 0x00, /* 00000000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xfe, /* 11111110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 28 0x1c '^\' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 29 0x1d '^]' */ 0x00, /* 00000000 */ 0x24, /* 00100100 */ 0x66, /* 01100110 */ 0xff, /* 11111111 */ 0x66, /* 01100110 */ 0x24, /* 00100100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 30 0x1e '^^' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 31 0x1f '^_' */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 32 0x20 ' ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 33 0x21 '!' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 34 0x22 '"' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x24, /* 00100100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 35 0x23 '#' */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* 36 0x24 '$' */ 0x18, /* 00011000 */ 0x3e, /* 00111110 */ 0x60, /* 01100000 */ 0x3c, /* 00111100 */ 0x06, /* 00000110 */ 0x7c, /* 01111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 37 0x25 '%' */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xcc, /* 11001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x66, /* 01100110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 38 0x26 '&' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 39 0x27 ''' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 40 0x28 '(' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ /* 41 0x29 ')' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ /* 42 0x2a '*' */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0xff, /* 11111111 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 43 0x2b '+' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 44 0x2c ',' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ /* 45 0x2d '-' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 46 0x2e '.' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 47 0x2f '/' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ 0x80, /* 10000000 */ 0x00, /* 00000000 */ /* 48 0x30 '0' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* 49 0x31 '1' */ 0x18, /* 00011000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 50 0x32 '2' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x06, /* 00000110 */ 0x1c, /* 00011100 */ 0x30, /* 00110000 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 51 0x33 '3' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x06, /* 00000110 */ 0x3c, /* 00111100 */ 0x06, /* 00000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 52 0x34 '4' */ 0x1c, /* 00011100 */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ 0xcc, /* 11001100 */ 0xfe, /* 11111110 */ 0x0c, /* 00001100 */ 0x1e, /* 00011110 */ 0x00, /* 00000000 */ /* 53 0x35 '5' */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xfc, /* 11111100 */ 0x06, /* 00000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 54 0x36 '6' */ 0x38, /* 00111000 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ 0xfc, /* 11111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 55 0x37 '7' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ /* 56 0x38 '8' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 57 0x39 '9' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* 58 0x3a ':' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 59 0x3b ';' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ /* 60 0x3c '<' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ /* 61 0x3d '=' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 62 0x3e '>' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0x00, /* 00000000 */ /* 63 0x3f '?' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 64 0x40 '@' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xde, /* 11011110 */ 0xde, /* 11011110 */ 0xde, /* 11011110 */ 0xc0, /* 11000000 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* 65 0x41 'A' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 66 0x42 'B' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* 67 0x43 'C' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 68 0x44 'D' */ 0xf8, /* 11111000 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ /* 69 0x45 'E' */ 0xfe, /* 11111110 */ 0x62, /* 01100010 */ 0x68, /* 01101000 */ 0x78, /* 01111000 */ 0x68, /* 01101000 */ 0x62, /* 01100010 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 70 0x46 'F' */ 0xfe, /* 11111110 */ 0x62, /* 01100010 */ 0x68, /* 01101000 */ 0x78, /* 01111000 */ 0x68, /* 01101000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* 71 0x47 'G' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xce, /* 11001110 */ 0x66, /* 01100110 */ 0x3a, /* 00111010 */ 0x00, /* 00000000 */ /* 72 0x48 'H' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 73 0x49 'I' */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 74 0x4a 'J' */ 0x1e, /* 00011110 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* 75 0x4b 'K' */ 0xe6, /* 11100110 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0x78, /* 01111000 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* 76 0x4c 'L' */ 0xf0, /* 11110000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0x62, /* 01100010 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 77 0x4d 'M' */ 0xc6, /* 11000110 */ 0xee, /* 11101110 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 78 0x4e 'N' */ 0xc6, /* 11000110 */ 0xe6, /* 11100110 */ 0xf6, /* 11110110 */ 0xde, /* 11011110 */ 0xce, /* 11001110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 79 0x4f 'O' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 80 0x50 'P' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* 81 0x51 'Q' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xce, /* 11001110 */ 0x7c, /* 01111100 */ 0x0e, /* 00001110 */ /* 82 0x52 'R' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* 83 0x53 'S' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 84 0x54 'T' */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x5a, /* 01011010 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 85 0x55 'U' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 86 0x56 'V' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* 87 0x57 'W' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* 88 0x58 'X' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 89 0x59 'Y' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 90 0x5a 'Z' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x8c, /* 10001100 */ 0x18, /* 00011000 */ 0x32, /* 00110010 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 91 0x5b '[' */ 0x3c, /* 00111100 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 92 0x5c '\' */ 0xc0, /* 11000000 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x06, /* 00000110 */ 0x02, /* 00000010 */ 0x00, /* 00000000 */ /* 93 0x5d ']' */ 0x3c, /* 00111100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 94 0x5e '^' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 95 0x5f '_' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ /* 96 0x60 '`' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 97 0x61 'a' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 98 0x62 'b' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x7c, /* 01111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ /* 99 0x63 'c' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 100 0x64 'd' */ 0x1c, /* 00011100 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 101 0x65 'e' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 102 0x66 'f' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x60, /* 01100000 */ 0xf8, /* 11111000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* 103 0x67 'g' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0xf8, /* 11111000 */ /* 104 0x68 'h' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x6c, /* 01101100 */ 0x76, /* 01110110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* 105 0x69 'i' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 106 0x6a 'j' */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ /* 107 0x6b 'k' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0x78, /* 01111000 */ 0x6c, /* 01101100 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* 108 0x6c 'l' */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 109 0x6d 'm' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xec, /* 11101100 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0x00, /* 00000000 */ /* 110 0x6e 'n' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* 111 0x6f 'o' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 112 0x70 'p' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ /* 113 0x71 'q' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0x1e, /* 00011110 */ /* 114 0x72 'r' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x76, /* 01110110 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* 115 0x73 's' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* 116 0x74 't' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0xfc, /* 11111100 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x36, /* 00110110 */ 0x1c, /* 00011100 */ 0x00, /* 00000000 */ /* 117 0x75 'u' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 118 0x76 'v' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* 119 0x77 'w' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* 120 0x78 'x' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 121 0x79 'y' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ /* 122 0x7a 'z' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x4c, /* 01001100 */ 0x18, /* 00011000 */ 0x32, /* 00110010 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 123 0x7b '{' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x70, /* 01110000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x0e, /* 00001110 */ 0x00, /* 00000000 */ /* 124 0x7c '|' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 125 0x7d '}' */ 0x70, /* 01110000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* 126 0x7e '~' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 127 0x7f '' */ 0x00, /* 00000000 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 128 0x80 '€' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0x78, /* 01111000 */ /* 129 0x81 '' */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 130 0x82 '‚' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 131 0x83 'ƒ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 132 0x84 '„' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 133 0x85 '…' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 134 0x86 '†' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 135 0x87 '‡' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x7e, /* 01111110 */ 0x0c, /* 00001100 */ 0x38, /* 00111000 */ /* 136 0x88 'ˆ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 137 0x89 '‰' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 138 0x8a 'Š' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 139 0x8b '‹' */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 140 0x8c 'Œ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 141 0x8d '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 142 0x8e 'Ž' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 143 0x8f '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 144 0x90 '' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xf8, /* 11111000 */ 0xc0, /* 11000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 145 0x91 '‘' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0xd8, /* 11011000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 146 0x92 '’' */ 0x3e, /* 00111110 */ 0x6c, /* 01101100 */ 0xcc, /* 11001100 */ 0xfe, /* 11111110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xce, /* 11001110 */ 0x00, /* 00000000 */ /* 147 0x93 '“' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 148 0x94 '”' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 149 0x95 '•' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 150 0x96 '–' */ 0x78, /* 01111000 */ 0x84, /* 10000100 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 151 0x97 '—' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 152 0x98 '˜' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ /* 153 0x99 '™' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* 154 0x9a 'š' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 155 0x9b '›' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 156 0x9c 'œ' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x64, /* 01100100 */ 0xf0, /* 11110000 */ 0x60, /* 01100000 */ 0x66, /* 01100110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* 157 0x9d '' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 158 0x9e 'ž' */ 0xf8, /* 11111000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xfa, /* 11111010 */ 0xc6, /* 11000110 */ 0xcf, /* 11001111 */ 0xc6, /* 11000110 */ 0xc7, /* 11000111 */ /* 159 0x9f 'Ÿ' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* 160 0xa0 ' ' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 161 0xa1 '¡' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 162 0xa2 '¢' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* 163 0xa3 '£' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 164 0xa4 '¤' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* 165 0xa5 '¥' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0xe6, /* 11100110 */ 0xf6, /* 11110110 */ 0xde, /* 11011110 */ 0xce, /* 11001110 */ 0x00, /* 00000000 */ /* 166 0xa6 '¦' */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x3e, /* 00111110 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 167 0xa7 '§' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 168 0xa8 '¨' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x63, /* 01100011 */ 0x3e, /* 00111110 */ 0x00, /* 00000000 */ /* 169 0xa9 '©' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 170 0xaa 'ª' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 171 0xab '«' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ 0x6c, /* 01101100 */ 0x7e, /* 01111110 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x0f, /* 00001111 */ /* 172 0xac '¬' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ 0x6c, /* 01101100 */ 0x7a, /* 01111010 */ 0x36, /* 00110110 */ 0x6a, /* 01101010 */ 0xdf, /* 11011111 */ 0x06, /* 00000110 */ /* 173 0xad '­' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 174 0xae '®' */ 0x00, /* 00000000 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x66, /* 01100110 */ 0x33, /* 00110011 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 175 0xaf '¯' */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0x66, /* 01100110 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 176 0xb0 '°' */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ /* 177 0xb1 '±' */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ /* 178 0xb2 '²' */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ /* 179 0xb3 '³' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 180 0xb4 '´' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 181 0xb5 'µ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 182 0xb6 '¶' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 183 0xb7 '·' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 184 0xb8 '¸' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 185 0xb9 '¹' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x06, /* 00000110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 186 0xba 'º' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 187 0xbb '»' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x06, /* 00000110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 188 0xbc '¼' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x06, /* 00000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 189 0xbd '½' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 190 0xbe '¾' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 191 0xbf '¿' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 192 0xc0 'À' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 193 0xc1 'Á' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 194 0xc2 'Â' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 195 0xc3 'Ã' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 196 0xc4 'Ä' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 197 0xc5 'Å' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 198 0xc6 'Æ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 199 0xc7 'Ç' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 200 0xc8 'È' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x30, /* 00110000 */ 0x3f, /* 00111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 201 0xc9 'É' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3f, /* 00111111 */ 0x30, /* 00110000 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 202 0xca 'Ê' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf7, /* 11110111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 203 0xcb 'Ë' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xf7, /* 11110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 204 0xcc 'Ì' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x30, /* 00110000 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 205 0xcd 'Í' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 206 0xce 'Î' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf7, /* 11110111 */ 0x00, /* 00000000 */ 0xf7, /* 11110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 207 0xcf 'Ï' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 208 0xd0 'Ð' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 209 0xd1 'Ñ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 210 0xd2 'Ò' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 211 0xd3 'Ó' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x3f, /* 00111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 212 0xd4 'Ô' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 213 0xd5 'Õ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 214 0xd6 'Ö' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3f, /* 00111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 215 0xd7 '×' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xff, /* 11111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* 216 0xd8 'Ø' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 217 0xd9 'Ù' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 218 0xda 'Ú' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 219 0xdb 'Û' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* 220 0xdc 'Ü' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* 221 0xdd 'Ý' */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ /* 222 0xde 'Þ' */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ /* 223 0xdf 'ß' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 224 0xe0 'à' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0xc8, /* 11001000 */ 0xdc, /* 11011100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* 225 0xe1 'á' */ 0x78, /* 01111000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xd8, /* 11011000 */ 0xcc, /* 11001100 */ 0xc6, /* 11000110 */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ /* 226 0xe2 'â' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x00, /* 00000000 */ /* 227 0xe3 'ã' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* 228 0xe4 'ä' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* 229 0xe5 'å' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* 230 0xe6 'æ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0xc0, /* 11000000 */ /* 231 0xe7 'ç' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* 232 0xe8 'è' */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ /* 233 0xe9 'é' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* 234 0xea 'ê' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0xee, /* 11101110 */ 0x00, /* 00000000 */ /* 235 0xeb 'ë' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x3e, /* 00111110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* 236 0xec 'ì' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 237 0xed 'í' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x7e, /* 01111110 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7e, /* 01111110 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ /* 238 0xee 'î' */ 0x1e, /* 00011110 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0x7e, /* 01111110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x1e, /* 00011110 */ 0x00, /* 00000000 */ /* 239 0xef 'ï' */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* 240 0xf0 'ð' */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 241 0xf1 'ñ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 242 0xf2 'ò' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 243 0xf3 'ó' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* 244 0xf4 'ô' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* 245 0xf5 'õ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ /* 246 0xf6 'ö' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 247 0xf7 '÷' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 248 0xf8 'ø' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 249 0xf9 'ù' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 250 0xfa 'ú' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 251 0xfb 'û' */ 0x0f, /* 00001111 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0xec, /* 11101100 */ 0x6c, /* 01101100 */ 0x3c, /* 00111100 */ 0x1c, /* 00011100 */ /* 252 0xfc 'ü' */ 0x6c, /* 01101100 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 253 0xfd 'ý' */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 254 0xfe 'þ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 255 0xff 'ÿ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ };
atmark-techno/atmark-dist
user/camserv/include/font_8x8.h
C
gpl-2.0
50,640
/** @module Discourse */ var get = Ember.get, set = Ember.set; var popstateFired = false; var supportsHistoryState = window.history && 'state' in window.history; // Thanks: https://gist.github.com/kares/956897 var re = /([^&=]+)=?([^&]*)/g; var decode = function(str) { return decodeURIComponent(str.replace(/\+/g, ' ')); }; $.parseParams = function(query) { var params = {}, e; if (query) { if (query.substr(0, 1) === '?') { query = query.substr(1); } while (e = re.exec(query)) { var k = decode(e[1]); var v = decode(e[2]); if (params[k] !== undefined) { if (!$.isArray(params[k])) { params[k] = [params[k]]; } params[k].push(v); } else { params[k] = v; } } } return params; }; /** `Ember.DiscourseLocation` implements the location API using the browser's `history.pushState` API. @class DiscourseLocation @namespace Discourse @extends Ember.Object */ Ember.DiscourseLocation = Ember.Object.extend({ init: function() { set(this, 'location', get(this, 'location') || window.location); this.initState(); }, /** @private Used to set state on first call to setURL @method initState */ initState: function() { var location = this.get('location'); if (location && location.search) { this.set('queryParams', $.parseParams(location.search)); } set(this, 'history', get(this, 'history') || window.history); this.replaceState(this.formatURL(this.getURL())); }, /** Will be pre-pended to path upon state change @property rootURL @default '/' */ rootURL: '/', /** @private Returns the current `location.pathname` without rootURL @method getURL */ getURL: function() { var rootURL = (Discourse.BaseUri === undefined ? "/" : Discourse.BaseUri), url = get(this, 'location').pathname; rootURL = rootURL.replace(/\/$/, ''); url = url.replace(rootURL, ''); return url; }, /** @private Uses `history.pushState` to update the url without a page reload. @method setURL @param path {String} */ setURL: function(path) { var state = this.getState(); path = this.formatURL(path); if (state && state.path !== path) { this.pushState(path); } }, /** @private Uses `history.replaceState` to update the url without a page reload or history modification. @method replaceURL @param path {String} */ replaceURL: function(path) { var state = this.getState(); path = this.formatURL(path); if (state && state.path !== path) { this.replaceState(path); } }, /** @private Get the current `history.state` Polyfill checks for native browser support and falls back to retrieving from a private _historyState variable @method getState */ getState: function() { return supportsHistoryState ? get(this, 'history').state : this._historyState; }, /** @private Pushes a new state @method pushState @param path {String} */ pushState: function(path) { var state = { path: path }; // store state if browser doesn't support `history.state` if (!supportsHistoryState) { this._historyState = state; } else { get(this, 'history').pushState(state, null, path); } // used for webkit workaround this._previousURL = this.getURL(); }, /** @private Replaces the current state @method replaceState @param path {String} */ replaceState: function(path) { var state = { path: path }; // store state if browser doesn't support `history.state` if (!supportsHistoryState) { this._historyState = state; } else { get(this, 'history').replaceState(state, null, path); } // used for webkit workaround this._previousURL = this.getURL(); }, queryParamsString: function() { var params = this.get('queryParams'); if (Em.isEmpty(params) || Em.isEmpty(Object.keys(params))) { return ""; } else { return "?" + decodeURIComponent($.param(params, true)); } }.property('queryParams'), // When our query params change, update the URL queryParamsStringChanged: function() { var loc = this; Em.run.next(function () { loc.replaceState(loc.formatURL(loc.getURL())); }); }.observes('queryParamsString'), /** @private Register a callback to be invoked whenever the browser history changes, including using forward and back buttons. @method onUpdateURL @param callback {Function} */ onUpdateURL: function(callback) { var guid = Ember.guidFor(this), self = this; Ember.$(window).on('popstate.ember-location-'+guid, function(e) { // Ignore initial page load popstate event in Chrome if (!popstateFired) { popstateFired = true; if (self.getURL() === self._previousURL) { return; } } callback(self.getURL()); }); }, /** @private Used when using `{{action}}` helper. The url is always appended to the rootURL. @method formatURL @param url {String} */ formatURL: function(url) { var rootURL = get(this, 'rootURL'); if (url !== '') { rootURL = rootURL.replace(/\/$/, ''); } return rootURL + url + this.get('queryParamsString'); }, willDestroy: function() { var guid = Ember.guidFor(this); Ember.$(window).off('popstate.ember-location-'+guid); } }); Ember.Location.registerImplementation('discourse_location', Ember.DiscourseLocation);
tomash/discoursebp
app/assets/javascripts/discourse/routes/discourse_location.js
JavaScript
gpl-2.0
5,680
CKEditor 4 Changelog ==================== ## CKEditor 4.3 Beta New Features: * [#9764](http://dev.ckeditor.com/ticket/9764): Widget System. * [Widget plugin](http://ckeditor.com/addon/widget) introducing the [Widget API](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget). * New [`editor.enterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-enterMode) and [`editor.shiftEnterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-shiftEnterMode) properties &ndash; normalized versions of [`config.enterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode) and [`config.shiftEnterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-shiftEnterMode). * Dynamic editor settings. Starting from CKEditor 4.3 Beta, *Enter* mode values and [content filter](http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter) instances may be changed dynamically (for example when the caret was placed in an element in which editor features should be adjusted). When you are implementing a new editor feature, you should base its behavior on [dynamic](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-activeEnterMode) or [static](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-enterMode) *Enter* mode values depending on whether this feature works in selection context or globally on editor content. * Dynamic *Enter* mode values &ndash; [`editor.setActiveEnterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setActiveEnterMode) method, [`editor.activeEnterModeChange`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-activeEnterModeChange) event, and two properties: [`editor.activeEnterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-activeEnterMode) and [`editor.activeShiftEnterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-activeShiftEnterMode). * Dynamic content filter instances &ndash; [`editor.setActiveFilter`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setActiveFilter) method, [`editor.activeFilterChange`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-activeFilterChange) event, and [`editor.activeFilter`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-activeFilter) property. * "Fake" selection was introduced. It makes it possible to virtually select any element when the real selection remains hidden. See the [`selection.fake`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.selection-method-fake) method. * Default [`htmlParser.filter`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.filter) rules are not applied to non-editable elements (elements with `contenteditable` attribute set to `false` and their descendants) anymore. To add a rule which will be applied to all elements you need to pass an additional argument to the [`filter.addRules`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.filter-method-addRules) method. * Dozens of new methods were introduced &ndash; most interesting ones: * [`document.find`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.document-method-find), * [`document.findOne`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.document-method-findOne), * [`editable.insertElementIntoRange`](http://docs.ckeditor.com/#!/api/CKEDITOR.editable-method-insertElementIntoRange), * [`range.moveToClosestEditablePosition`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-moveToClosestEditablePosition), * New methods for [`htmlParser.node`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.node) and [`htmlParser.element`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.element). * [#10659](http://dev.ckeditor.com/ticket/10659): New [Enhanced Image](http://ckeditor.com/addon/image2) plugin that introduces a widget with integrated image captions, an option to center images, and dynamic "click and drag" resizing. * [#10664](http://dev.ckeditor.com/ticket/10664): New [Mathematical Formulas](http://ckeditor.com/addon/mathjax) plugin that introduces the MathJax widget. * [#7987](https://dev.ckeditor.com/ticket/7987): New [Language](http://ckeditor.com/addon/language) plugin that implements Language toolbar button to support [WCAG 3.1.2 Language of Parts](http://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html). * [#10708](http://dev.ckeditor.com/ticket/10708): New [smileys](http://ckeditor.com/addon/smiley). ## CKEditor 4.2.1 Fixed Issues: * [#10301](http://dev.ckeditor.com/ticket/10301): [IE9-10] Undo fails after 3+ consecutive paste actions with a JavaScript error. * [#10689](http://dev.ckeditor.com/ticket/10689): Save toolbar button saves only the first editor instance. * [#10368](http://dev.ckeditor.com/ticket/10368): Move language reading direction definition (`dir`) from main language file to core. * [#9330](http://dev.ckeditor.com/ticket/9330): Fixed pasting anchors from MS Word. * [#8103](http://dev.ckeditor.com/ticket/8103): Fixed pasting nested lists from MS Word. * [#9958](http://dev.ckeditor.com/ticket/9958): [IE9] Pressing the "OK" button will trigger the `onbeforeunload` event in the popup dialog. * [#10662](http://dev.ckeditor.com/ticket/10662): Fixed styles from the Styles drop-down list not registering to the ACF in case when the [Shared Spaces plugin](http://ckeditor.com/addon/sharedspace) is used. * [#9654](http://dev.ckeditor.com/ticket/9654): Problems with Internet Explorer 10 Quirks Mode. * [#9816](http://dev.ckeditor.com/ticket/9816): Floating toolbar does not reposition vertically in several cases. * [#10646](http://dev.ckeditor.com/ticket/10646): Removing a selected sublist or nested table with *Backspace/Delete* removes the parent element. * [#10623](http://dev.ckeditor.com/ticket/10623): [WebKit] Page is scrolled when opening a drop-down list. * [#10004](http://dev.ckeditor.com/ticket/10004): [ChromeVox] Button names are not announced. * [#10731](http://dev.ckeditor.com/ticket/10731): [WebSpellChecker](http://ckeditor.com/addon/wsc) plugin breaks cloning of editor configuration. * It is now possible to set per instance [WebSpellChecker](http://ckeditor.com/addon/wsc) plugin configuration instead of setting the configuration globally. ## CKEditor 4.2 **Important Notes:** * Dropped compatibility support for Internet Explorer 7 and Firefox 3.6. * Both the Basic and the Standard distribution packages will not contain the new [Indent Block](http://ckeditor.com/addon/indentblock) plugin. Because of this the [Advanced Content Filter](http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter) might remove block indentations from existing contents. If you want to prevent this, either [add an appropriate ACF rule to your filter](http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules) or create a custom build based on the Basic/Standard package and add the Indent Block plugin in [CKBuilder](http://ckeditor.com/builder). New Features: * [#10027](http://dev.ckeditor.com/ticket/10027): Separated list and block indentation into two plugins: [Indent List](http://ckeditor.com/addon/indentlist) and [Indent Block](http://ckeditor.com/addon/indentblock). * [#8244](http://dev.ckeditor.com/ticket/8244): Use *(Shift+)Tab* to indent and outdent lists. * [#10281](http://dev.ckeditor.com/ticket/10281): The [jQuery Adapter](http://docs.ckeditor.com/#!/guide/dev_jquery) is now available. Several jQuery-related issues fixed: [#8261](http://dev.ckeditor.com/ticket/8261), [#9077](http://dev.ckeditor.com/ticket/9077), [#8710](http://dev.ckeditor.com/ticket/8710), [#8530](http://dev.ckeditor.com/ticket/8530), [#9019](http://dev.ckeditor.com/ticket/9019), [#6181](http://dev.ckeditor.com/ticket/6181), [#7876](http://dev.ckeditor.com/ticket/7876), [#6906](http://dev.ckeditor.com/ticket/6906). * [#10042](http://dev.ckeditor.com/ticket/10042): Introduced [`config.title`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-title) setting to change the human-readable title of the editor. * [#9794](http://dev.ckeditor.com/ticket/9794): Added [`editor.onChange`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-change) event. * [#9923](http://dev.ckeditor.com/ticket/9923): HiDPI support in the editor UI. HiDPI icons for [Moono skin](http://ckeditor.com/addon/moono) added. * [#8031](http://dev.ckeditor.com/ticket/8031): Handle `required` attributes on `<textarea>` elements &mdash; introduced [`editor.required`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-required) event. * [#10280](http://dev.ckeditor.com/ticket/10280): Ability to replace `<textarea>` elements with the inline editor. Fixed Issues: * [#10599](http://dev.ckeditor.com/ticket/10599): [Indent](http://ckeditor.com/addon/indent) plugin is no longer required by the [List](http://ckeditor.com/addon/list) plugin. * [#10370](http://dev.ckeditor.com/ticket/10370): Inconsistency in data events between framed and inline editors. * [#10438](http://dev.ckeditor.com/ticket/10438): [FF, IE] No selection is done on an editable element on executing [`editor.setData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setData). ## CKEditor 4.1.3 New Features: * Added new translation: Indonesian. Fixed Issues: * [#10644](http://dev.ckeditor.com/ticket/10644): Fixed a critical bug when pasting plain text in Blink-based browsers. * [#5189](http://dev.ckeditor.com/ticket/5189): [Find/Replace](http://ckeditor.com/addon/find) dialog window: rename "Cancel" button to "Close". * [#10562](http://dev.ckeditor.com/ticket/10562): [Housekeeping] Unified CSS gradient filter formats in the [Moono](http://ckeditor.com/addon/moono) skin. * [#10537](http://dev.ckeditor.com/ticket/10537): Advanced Content Filter should register a default rule for [`config.shiftEnterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-shiftEnterMode). * [#10610](http://dev.ckeditor.com/ticket/10610): [`CKEDITOR.dialog.addIframe()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dialog-static-method-addIframe) incorrectly sets the iframe size in dialog windows. ## CKEditor 4.1.2 New Features: * Added new translation: Sinhala. Fixed Issues: * [#10339](http://dev.ckeditor.com/ticket/10339): Fixed: Error thrown when inserted data was totally stripped out after filtering and processing. * [#10298](http://dev.ckeditor.com/ticket/10298): Fixed: Data processor breaks attributes containing protected parts. * [#10367](http://dev.ckeditor.com/ticket/10367): Fixed: [`editable.insertText()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editable-method-insertText) loses characters when `RegExp` replace controls are being inserted. * [#10165](http://dev.ckeditor.com/ticket/10165): [IE] Access denied error when `document.domain` has been altered. * [#9761](http://dev.ckeditor.com/ticket/9761): Update the *Backspace* key state in [`keystrokeHandler.blockedKeystrokes`](http://docs.ckeditor.com/#!/api/CKEDITOR.keystrokeHandler-property-blockedKeystrokes) when calling [`editor.setReadOnly()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly). * [#6504](http://dev.ckeditor.com/ticket/6504): Fixed: Race condition while loading several [`config.customConfig`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-customConfig) files. * [#10146](http://dev.ckeditor.com/ticket/10146): [Firefox] Empty lines are being removed while [`config.enterMode`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode) is [`CKEDITOR.ENTER_BR`](http://docs.ckeditor.com/#!/api/CKEDITOR-property-ENTER_BR). * [#10360](http://dev.ckeditor.com/ticket/10360): Fixed: ARIA `role="application"` should not be used for dialog windows. * [#10361](http://dev.ckeditor.com/ticket/10361): Fixed: ARIA `role="application"` should not be used for floating panels. * [#10510](http://dev.ckeditor.com/ticket/10510): Introduced unique voice labels to differentiate between different editor instances. * [#9945](http://dev.ckeditor.com/ticket/9945): [iOS] Scrolling not possible on iPad. * [#10389](http://dev.ckeditor.com/ticket/10389): Fixed: Invalid HTML in the "Text and Table" template. * [WebSpellChecker](http://ckeditor.com/addon/wsc) plugin user interface was changed to match CKEditor 4 style. ## CKEditor 4.1.1 New Features: * Added new translation: Albanian. Fixed Issues: * [#10172](http://dev.ckeditor.com/ticket/10172): Pressing *Delete* or *Backspace* in an empty table cell moves the cursor to the next/previous cell. * [#10219](http://dev.ckeditor.com/ticket/10219): Error thrown when destroying an editor instance in parallel with a `mouseup` event. * [#10265](http://dev.ckeditor.com/ticket/10265): Wrong loop type in the [File Browser](http://ckeditor.com/addon/filebrowser) plugin. * [#10249](http://dev.ckeditor.com/ticket/10249): Wrong undo/redo states at start. * [#10268](http://dev.ckeditor.com/ticket/10268): [Show Blocks](http://ckeditor.com/addon/showblocks) does not recover after switching to Source view. * [#9995](http://dev.ckeditor.com/ticket/9995): HTML code in the `<textarea>` should not be modified by the [`htmlDataProcessor`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlDataProcessor). * [#10320](http://dev.ckeditor.com/ticket/10320): [Justify](http://ckeditor.com/addon/justify) plugin should add elements to Advanced Content Filter based on current [Enter mode](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode). * [#10260](http://dev.ckeditor.com/ticket/10260): Fixed: Advanced Content Filter blocks [`tabSpaces`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-tabSpaces). Unified `data-cke-*` attributes filtering. * [#10315](http://dev.ckeditor.com/ticket/10315): [WebKit] [Undo manager](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.undo.UndoManager) should not record snapshots after a filling character was added/removed. * [#10291](http://dev.ckeditor.com/ticket/10291): [WebKit] Space after a filling character should be secured. * [#10330](http://dev.ckeditor.com/ticket/10330): [WebKit] The filling character is not removed on `keydown` in specific cases. * [#10285](http://dev.ckeditor.com/ticket/10285): Fixed: Styled text pasted from MS Word causes an infinite loop. * [#10131](http://dev.ckeditor.com/ticket/10131): Fixed: [`undoManager.update()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.undo.UndoManager-method-update) does not refresh the command state. * [#10337](http://dev.ckeditor.com/ticket/10337): Fixed: Unable to remove `<s>` using [Remove Format](http://ckeditor.com/addon/removeformat). ## CKEditor 4.1 Fixed Issues: * [#10192](http://dev.ckeditor.com/ticket/10192): Closing lists with the *Enter* key does not work with [Advanced Content Filter](http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter) in several cases. * [#10191](http://dev.ckeditor.com/ticket/10191): Fixed allowed content rules unification, so the [`filter.allowedContent`](http://docs.ckeditor.com/#!/api/CKEDITOR.filter-property-allowedContent) property always contains rules in the same format. * [#10224](http://dev.ckeditor.com/ticket/10224): Advanced Content Filter does not remove non-empty `<a>` elements anymore. * Minor issues in plugin integration with Advanced Content Filter: * [#10166](http://dev.ckeditor.com/ticket/10166): Added transformation from the `align` attribute to `float` style to preserve backward compatibility after the introduction of Advanced Content Filter. * [#10195](http://dev.ckeditor.com/ticket/10195): [Image](http://ckeditor.com/addon/image) plugin no longer registers rules for links to Advanced Content Filter. * [#10213](http://dev.ckeditor.com/ticket/10213): [Justify](http://ckeditor.com/addon/justify) plugin is now correctly registering rules to Advanced Content Filter when [`config.justifyClasses`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-justifyClasses) is defined. ## CKEditor 4.1 RC New Features: * [#9829](http://dev.ckeditor.com/ticket/9829): Advanced Content Filter - data and features activation based on editor configuration. Brand new data filtering system that works in 2 modes: * Based on loaded features (toolbar items, plugins) - the data will be filtered according to what the editor in its current configuration can handle. * Based on [`config.allowedContent`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent) rules - the data will be filtered and the editor features (toolbar items, commands, keystrokes) will be enabled if they are allowed. See the `datafiltering.html` sample, [guides](http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter) and [`CKEDITOR.filter` API documentation](http://docs.ckeditor.com/#!/api/CKEDITOR.filter). * [#9387](http://dev.ckeditor.com/ticket/9387): Reintroduced [Shared Spaces](http://ckeditor.com/addon/sharedspace) - the ability to display toolbar and bottom editor space in selected locations and to share them by different editor instances. * [#9907](http://dev.ckeditor.com/ticket/9907): Added the [`contentPreview`](http://docs.ckeditor.com/#!/api/CKEDITOR-event-contentPreview) event for preview data manipulation. * [#9713](http://dev.ckeditor.com/ticket/9713): Introduced the [Source Dialog](http://ckeditor.com/addon/sourcedialog) plugin that brings raw HTML editing for inline editor instances. * Included in [#9829](http://dev.ckeditor.com/ticket/9829): Introduced new events, [`toHtml`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-toHtml) and [`toDataFormat`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-toDataFormat), allowing for better integration with data processing. * [#9981](http://dev.ckeditor.com/ticket/9981): Added ability to filter [`htmlParser.fragment`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.fragment), [`htmlParser.element`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.element) etc. by many [`htmlParser.filter`](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.filter)s before writing structure to an HTML string. * Included in [#10103](http://dev.ckeditor.com/ticket/10103): * Introduced the [`editor.status`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-status) property to make it easier to check the current status of the editor. * Default [`command`](http://docs.ckeditor.com/#!/api/CKEDITOR.command) state is now [`CKEDITOR.TRISTATE_DISABLE`](http://docs.ckeditor.com/#!/api/CKEDITOR-property-TRISTATE_DISABLED). It will be activated on [`editor.instanceReady`](http://docs.ckeditor.com/#!/api/CKEDITOR-event-instanceReady) or immediately after being added if the editor is already initialized. * [#9796](http://dev.ckeditor.com/ticket/9796): Introduced `<s>` as a default tag for strikethrough, which replaces obsolete `<strike>` in HTML5. ## CKEditor 4.0.3 Fixed Issues: * [#10196](http://dev.ckeditor.com/ticket/10196): Fixed context menus not opening with keyboard shortcuts when [Autogrow](http://ckeditor.com/addon/autogrow) is enabled. * [#10212](http://dev.ckeditor.com/ticket/10212): [IE7-10] Undo command throws errors after multiple switches between Source and WYSIWYG view. * [#10219](http://dev.ckeditor.com/ticket/10219): [Inline editor] Error thrown after calling [`editor.destroy()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-destroy). ## CKEditor 4.0.2 Fixed Issues: * [#9779](http://dev.ckeditor.com/ticket/9779): Fixed overriding [`CKEDITOR.getUrl()`](http://docs.ckeditor.com/#!/api/CKEDITOR-method-getUrl) with `CKEDITOR_GETURL`. * [#9772](http://dev.ckeditor.com/ticket/9772): Custom buttons in the dialog window footer have different look and size ([Moono](http://ckeditor.com/addon/moono), [Kama](http://ckeditor.com/addon/kama) skins). * [#9029](http://dev.ckeditor.com/ticket/9029): Custom styles added with the [`stylesSet.add()`](http://docs.ckeditor.com/#!/api/CKEDITOR.stylesSet-method-add) are displayed in the wrong order. * [#9887](http://dev.ckeditor.com/ticket/9887): Disable [Magic Line](http://ckeditor.com/addon/magicline) when [`editor.readOnly`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-readOnly) is set. * [#9882](http://dev.ckeditor.com/ticket/9882): Fixed empty document title on [`editor.getData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData) if set via the Document Properties dialog window. * [#9773](http://dev.ckeditor.com/ticket/9773): Fixed rendering problems with selection fields in the Kama skin. * [#9851](http://dev.ckeditor.com/ticket/9851): The [`selectionChange`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-selectionChange) event is not fired when mouse selection ended outside editable. * [#9903](http://dev.ckeditor.com/ticket/9903): [Inline editor] Bad positioning of floating space with page horizontal scroll. * [#9872](http://dev.ckeditor.com/ticket/9872): [`editor.checkDirty()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-checkDirty) returns `true` when called onload. Removed the obsolete `editor.mayBeDirty` flag. * [#9893](http://dev.ckeditor.com/ticket/9893): [IE] Fixed broken toolbar when editing mixed direction content in Quirks mode. * [#9845](http://dev.ckeditor.com/ticket/9845): Fixed TAB navigation in the [Link](http://ckeditor.com/addon/link) dialog window when the Anchor option is used and no anchors are available. * [#9883](http://dev.ckeditor.com/ticket/9883): Maximizing was making the entire page editable with [divarea](http://ckeditor.com/addon/divarea)-based editors. * [#9940](http://dev.ckeditor.com/ticket/9940): [Firefox] Navigating back to a page with the editor was making the entire page editable. * [#9966](http://dev.ckeditor.com/ticket/9966): Fixed: Unable to type square brackets with French keyboard layout. Changed [Magic Line](http://ckeditor.com/addon/magicline) keystrokes. * [#9507](http://dev.ckeditor.com/ticket/9507): [Firefox] Selection is moved before editable position when the editor is focused for the first time. * [#9947](http://dev.ckeditor.com/ticket/9947): [WebKit] Editor overflows parent container in some edge cases. * [#10105](http://dev.ckeditor.com/ticket/10105): Fixed: Broken [sourcearea](http://ckeditor.com/addon/sourcearea) view when an RTL language is set. * [#10123](http://dev.ckeditor.com/ticket/10123): [WebKit] Fixed: Several dialog windows have broken layout since the latest WebKit release. * [#10152](http://dev.ckeditor.com/ticket/10152): Fixed: Invalid ARIA property used on menu items. ## CKEditor 4.0.1.1 Fixed Issues: * Security update: Added protection against XSS attack and possible path disclosure in the PHP sample. ## CKEditor 4.0.1 Fixed Issues: * [#9655](http://dev.ckeditor.com/ticket/9655): Support for IE Quirks Mode in the new [Moono skin](http://ckeditor.com/addon/moono). * Accessibility issues (mainly in inline editor): [#9364](http://dev.ckeditor.com/ticket/9364), [#9368](http://dev.ckeditor.com/ticket/9368), [#9369](http://dev.ckeditor.com/ticket/9369), [#9370](http://dev.ckeditor.com/ticket/9370), [#9541](http://dev.ckeditor.com/ticket/9541), [#9543](http://dev.ckeditor.com/ticket/9543), [#9841](http://dev.ckeditor.com/ticket/9841), [#9844](http://dev.ckeditor.com/ticket/9844). * [Magic Line](http://ckeditor.com/addon/magicline) plugin: * [#9481](http://dev.ckeditor.com/ticket/9481): Added accessibility support for Magic Line. * [#9509](http://dev.ckeditor.com/ticket/9509): Added Magic Line support for forms. * [#9573](http://dev.ckeditor.com/ticket/9573): Magic Line does not disappear on `mouseout` in a specific case. * [#9754](http://dev.ckeditor.com/ticket/9754): [WebKit] Cutting & pasting simple unformatted text generates an inline wrapper in WebKit browsers. * [#9456](http://dev.ckeditor.com/ticket/9456): [Chrome] Properly paste bullet list style from MS Word. * [#9699](http://dev.ckeditor.com/ticket/9699), [#9758](http://dev.ckeditor.com/ticket/9758): Improved selection locking when selecting by dragging. * Context menu: * [#9712](http://dev.ckeditor.com/ticket/9712): Opening the context menu destroys editor focus. * [#9366](http://dev.ckeditor.com/ticket/9366): Context menu should be displayed over the floating toolbar. * [#9706](http://dev.ckeditor.com/ticket/9706): Context menu generates a JavaScript error in inline mode when the editor is attached to a header element. * [#9800](http://dev.ckeditor.com/ticket/9800): Hide float panel when resizing the window. * [#9721](http://dev.ckeditor.com/ticket/9721): Padding in content of div-based editor puts the editing area under the bottom UI space. * [#9528](http://dev.ckeditor.com/ticket/9528): Host page `box-sizing` style should not influence the editor UI elements. * [#9503](http://dev.ckeditor.com/ticket/9503): [Form Elements](http://ckeditor.com/addon/forms) plugin adds context menu listeners only on supported input types. Added support for `tel`, `email`, `search` and `url` input types. * [#9769](http://dev.ckeditor.com/ticket/9769): Improved floating toolbar positioning in a narrow window. * [#9875](http://dev.ckeditor.com/ticket/9875): Table dialog window does not populate width correctly. * [#8675](http://dev.ckeditor.com/ticket/8675): Deleting cells in a nested table removes the outer table cell. * [#9815](http://dev.ckeditor.com/ticket/9815): Cannot edit dialog window fields in an editor initialized in the jQuery UI modal dialog. * [#8888](http://dev.ckeditor.com/ticket/8888): CKEditor dialog windows do not show completely in a small window. * [#9360](http://dev.ckeditor.com/ticket/9360): [Inline editor] Blocks shown for a `<div>` element stay permanently even after the user exits editing the `<div>`. * [#9531](http://dev.ckeditor.com/ticket/9531): [Firefox & Inline editor] Toolbar is lost when closing the Format drop-down list by clicking its button. * [#9553](http://dev.ckeditor.com/ticket/9553): Table width incorrectly set when the `border-width` style is specified. * [#9594](http://dev.ckeditor.com/ticket/9594): Cannot tab past CKEditor when it is in read-only mode. * [#9658](http://dev.ckeditor.com/ticket/9658): [IE9] Justify not working on selected images. * [#9686](http://dev.ckeditor.com/ticket/9686): Added missing contents styles for `<pre>` elements. * [#9709](http://dev.ckeditor.com/ticket/9709): [Paste from Word](http://ckeditor.com/addon/pastefromword) should not depend on configuration from other styles. * [#9726](http://dev.ckeditor.com/ticket/9726): Removed [Color Dialog](http://ckeditor.com/addon/colordialog) plugin dependency from [Table Tools](http://ckeditor.com/addon/tabletools). * [#9765](http://dev.ckeditor.com/ticket/9765): Toolbar Collapse command documented incorrectly in the [Accessibility Instructions](http://ckeditor.com/addon/a11yhelp) dialog window. * [#9771](http://dev.ckeditor.com/ticket/9771): [WebKit & Opera] Fixed scrolling issues when pasting. * [#9787](http://dev.ckeditor.com/ticket/9787): [IE9] `onChange` is not fired for checkboxes in dialogs. * [#9842](http://dev.ckeditor.com/ticket/9842): [Firefox 17] When opening a toolbar menu for the first time and pressing the *Down Arrow* key, focus goes to the next toolbar button instead of the menu options. * [#9847](http://dev.ckeditor.com/ticket/9847): [Elements Path](http://ckeditor.com/addon/elementspath) should not be initialized in the inline editor. * [#9853](http://dev.ckeditor.com/ticket/9853): [`editor.addRemoveFormatFilter()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-addRemoveFormatFilter) is exposed before it really works. * [#8893](http://dev.ckeditor.com/ticket/8893): Value of the [`pasteFromWordCleanupFile`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-pasteFromWordCleanupFile) configuration option is now taken from the instance configuration. * [#9693](http://dev.ckeditor.com/ticket/9693): Removed "Live Preview" checkbox from UI color picker. ## CKEditor 4.0 The first stable release of the new CKEditor 4 code line. The CKEditor JavaScript API has been kept compatible with CKEditor 4, whenever possible. The list of relevant changes can be found in the [API Changes page of the CKEditor 4 documentation][1]. [1]: http://docs.ckeditor.com/#!/guide/dev_api_changes "API Changes"
johnnywo/wohngesund-v2
sites/all/libraries/ckeditor/CHANGES.md
Markdown
gpl-2.0
28,266
/* $Id$ */ /* * Copyright (C) 2009-2011 Teluu Inc. (http://www.teluu.com) * * 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 */ #ifndef __PJ_SSL_SOCK_H__ #define __PJ_SSL_SOCK_H__ /** * @file ssl_sock.h * @brief Secure socket */ #include <pj/ioqueue.h> #include <pj/sock.h> #include <pj/sock_qos.h> PJ_BEGIN_DECL /** * @defgroup PJ_SSL_SOCK Secure socket I/O * @brief Secure socket provides security on socket operation using standard * security protocols such as SSL and TLS. * @ingroup PJ_IO * @{ * * Secure socket wraps normal socket and applies security features, i.e: * privacy and data integrity, on the socket traffic, using standard security * protocols such as SSL and TLS. * * Secure socket employs active socket operations, which is similar to (and * described more detail) in \ref PJ_ACTIVESOCK. */ /** * This opaque structure describes the secure socket. */ typedef struct pj_ssl_sock_t pj_ssl_sock_t; /** * Opaque declaration of endpoint certificate or credentials. This may contains * certificate, private key, and trusted Certificate Authorities list. */ typedef struct pj_ssl_cert_t pj_ssl_cert_t; typedef enum pj_ssl_cert_verify_flag_t { /** * No error in verification. */ PJ_SSL_CERT_ESUCCESS = 0, /** * The issuer certificate cannot be found. */ PJ_SSL_CERT_EISSUER_NOT_FOUND = (1 << 0), /** * The certificate is untrusted. */ PJ_SSL_CERT_EUNTRUSTED = (1 << 1), /** * The certificate has expired or not yet valid. */ PJ_SSL_CERT_EVALIDITY_PERIOD = (1 << 2), /** * One or more fields of the certificate cannot be decoded due to * invalid format. */ PJ_SSL_CERT_EINVALID_FORMAT = (1 << 3), /** * The certificate cannot be used for the specified purpose. */ PJ_SSL_CERT_EINVALID_PURPOSE = (1 << 4), /** * The issuer info in the certificate does not match to the (candidate) * issuer certificate, e.g: issuer name not match to subject name * of (candidate) issuer certificate. */ PJ_SSL_CERT_EISSUER_MISMATCH = (1 << 5), /** * The CRL certificate cannot be found or cannot be read properly. */ PJ_SSL_CERT_ECRL_FAILURE = (1 << 6), /** * The certificate has been revoked. */ PJ_SSL_CERT_EREVOKED = (1 << 7), /** * The certificate chain length is too long. */ PJ_SSL_CERT_ECHAIN_TOO_LONG = (1 << 8), /** * The server identity does not match to any identities specified in * the certificate, e.g: subjectAltName extension, subject common name. * This flag will only be set by application as SSL socket does not * perform server identity verification. */ PJ_SSL_CERT_EIDENTITY_NOT_MATCH = (1 << 30), /** * Unknown verification error. */ PJ_SSL_CERT_EUNKNOWN = (1 << 31) } pj_ssl_cert_verify_flag_t; typedef enum pj_ssl_cert_name_type { PJ_SSL_CERT_NAME_UNKNOWN = 0, PJ_SSL_CERT_NAME_RFC822, PJ_SSL_CERT_NAME_DNS, PJ_SSL_CERT_NAME_URI, PJ_SSL_CERT_NAME_IP } pj_ssl_cert_name_type; /** * Describe structure of certificate info. */ typedef struct pj_ssl_cert_info { unsigned version; /**< Certificate version */ pj_uint8_t serial_no[20]; /**< Serial number, array of octets, first index is MSB */ struct { pj_str_t cn; /**< Common name */ pj_str_t info; /**< One line subject, fields are separated by slash, e.g: "CN=sample.org/OU=HRD" */ } subject; /**< Subject */ struct { pj_str_t cn; /**< Common name */ pj_str_t info; /**< One line subject, fields are separated by slash.*/ } issuer; /**< Issuer */ struct { pj_time_val start; /**< Validity start */ pj_time_val end; /**< Validity end */ pj_bool_t gmt; /**< Flag if validity date/time use GMT */ } validity; /**< Validity */ struct { unsigned cnt; /**< # of entry */ struct { pj_ssl_cert_name_type type; /**< Name type */ pj_str_t name; /**< The name */ } *entry; /**< Subject alt name entry */ } subj_alt_name; /**< Subject alternative name extension */ } pj_ssl_cert_info; /** * Create credential from files. TLS server application can provide multiple * certificates (RSA, ECC, and DSA) by supplying certificate name with "_rsa" * suffix, e.g: "pjsip_rsa.pem", the library will automatically check for * other certificates with "_ecc" and "_dsa" suffix. * * @param CA_file The file of trusted CA list. * @param cert_file The file of certificate. * @param privkey_file The file of private key. * @param privkey_pass The password of private key, if any. * @param p_cert Pointer to credential instance to be created. * * @return PJ_SUCCESS when successful. */ PJ_DECL(pj_status_t) pj_ssl_cert_load_from_files(pj_pool_t *pool, const pj_str_t *CA_file, const pj_str_t *cert_file, const pj_str_t *privkey_file, const pj_str_t *privkey_pass, pj_ssl_cert_t **p_cert); /** * Create credential from files. TLS server application can provide multiple * certificates (RSA, ECC, and DSA) by supplying certificate name with "_rsa" * suffix, e.g: "pjsip_rsa.pem", the library will automatically check for * other certificates with "_ecc" and "_dsa" suffix. * * This is the same as pj_ssl_cert_load_from_files() but also * accepts an additional param CA_path to load CA certificates from * a directory. * * @param CA_file The file of trusted CA list. * @param CA_path The path to a directory of trusted CA list. * @param cert_file The file of certificate. * @param privkey_file The file of private key. * @param privkey_pass The password of private key, if any. * @param p_cert Pointer to credential instance to be created. * * @return PJ_SUCCESS when successful. */ PJ_DECL(pj_status_t) pj_ssl_cert_load_from_files2( pj_pool_t *pool, const pj_str_t *CA_file, const pj_str_t *CA_path, const pj_str_t *cert_file, const pj_str_t *privkey_file, const pj_str_t *privkey_pass, pj_ssl_cert_t **p_cert); /** * Dump SSL certificate info. * * @param ci The certificate info. * @param indent String for left indentation. * @param buf The buffer where certificate info will be printed on. * @param buf_size The buffer size. * * @return The length of the dump result, or -1 when buffer size * is not sufficient. */ PJ_DECL(pj_ssize_t) pj_ssl_cert_info_dump(const pj_ssl_cert_info *ci, const char *indent, char *buf, pj_size_t buf_size); /** * Get SSL certificate verification error messages from verification status. * * @param verify_status The SSL certificate verification status. * @param error_strings Array of strings to receive the verification error * messages. * @param count On input it specifies maximum error messages should be * retrieved. On output it specifies the number of error * messages retrieved. * * @return PJ_SUCCESS when successful. */ PJ_DECL(pj_status_t) pj_ssl_cert_get_verify_status_strings( pj_uint32_t verify_status, const char *error_strings[], unsigned *count); /** * Cipher suites enumeration. */ typedef enum pj_ssl_cipher { /* Unsupported cipher */ PJ_TLS_UNKNOWN_CIPHER = -1, /* NULL */ PJ_TLS_NULL_WITH_NULL_NULL = 0x00000000, /* TLS/SSLv3 */ PJ_TLS_RSA_WITH_NULL_MD5 = 0x00000001, PJ_TLS_RSA_WITH_NULL_SHA = 0x00000002, PJ_TLS_RSA_WITH_NULL_SHA256 = 0x0000003B, PJ_TLS_RSA_WITH_RC4_128_MD5 = 0x00000004, PJ_TLS_RSA_WITH_RC4_128_SHA = 0x00000005, PJ_TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x0000000A, PJ_TLS_RSA_WITH_AES_128_CBC_SHA = 0x0000002F, PJ_TLS_RSA_WITH_AES_256_CBC_SHA = 0x00000035, PJ_TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003C, PJ_TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x0000003D, PJ_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x0000000D, PJ_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000010, PJ_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x00000013, PJ_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000016, PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x00000030, PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x00000031, PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x00000032, PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x00000033, PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x00000036, PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x00000037, PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x00000038, PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x00000039, PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x0000003E, PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003F, PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x00000040, PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x00000067, PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x00000068, PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x00000069, PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x0000006A, PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x0000006B, PJ_TLS_DH_anon_WITH_RC4_128_MD5 = 0x00000018, PJ_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x0000001B, PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x00000034, PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x0000003A, PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x0000006C, PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x0000006D, /* TLS (deprecated) */ PJ_TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x00000003, PJ_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x00000006, PJ_TLS_RSA_WITH_IDEA_CBC_SHA = 0x00000007, PJ_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000008, PJ_TLS_RSA_WITH_DES_CBC_SHA = 0x00000009, PJ_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0000000B, PJ_TLS_DH_DSS_WITH_DES_CBC_SHA = 0x0000000C, PJ_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0000000E, PJ_TLS_DH_RSA_WITH_DES_CBC_SHA = 0x0000000F, PJ_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x00000011, PJ_TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x00000012, PJ_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000014, PJ_TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x00000015, PJ_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x00000017, PJ_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x00000019, PJ_TLS_DH_anon_WITH_DES_CBC_SHA = 0x0000001A, /* SSLv3 */ PJ_SSL_FORTEZZA_KEA_WITH_NULL_SHA = 0x0000001C, PJ_SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 0x0000001D, PJ_SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 0x0000001E, /* SSLv2 */ PJ_SSL_CK_RC4_128_WITH_MD5 = 0x00010080, PJ_SSL_CK_RC4_128_EXPORT40_WITH_MD5 = 0x00020080, PJ_SSL_CK_RC2_128_CBC_WITH_MD5 = 0x00030080, PJ_SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = 0x00040080, PJ_SSL_CK_IDEA_128_CBC_WITH_MD5 = 0x00050080, PJ_SSL_CK_DES_64_CBC_WITH_MD5 = 0x00060040, PJ_SSL_CK_DES_192_EDE3_CBC_WITH_MD5 = 0x000700C0 } pj_ssl_cipher; /** * Get cipher list supported by SSL/TLS backend. * * @param ciphers The ciphers buffer to receive cipher list. * @param cipher_num Maximum number of ciphers to be received. * * @return PJ_SUCCESS when successful. */ PJ_DECL(pj_status_t) pj_ssl_cipher_get_availables(pj_ssl_cipher ciphers[], unsigned *cipher_num); /** * Check if the specified cipher is supported by SSL/TLS backend. * * @param cipher The cipher. * * @return PJ_TRUE when supported. */ PJ_DECL(pj_bool_t) pj_ssl_cipher_is_supported(pj_ssl_cipher cipher); /** * Get cipher name string. * * @param cipher The cipher. * * @return The cipher name or NULL if cipher is not recognized/ * supported. */ PJ_DECL(const char*) pj_ssl_cipher_name(pj_ssl_cipher cipher); /** * Get cipher ID from cipher name string. Note that on different backends * (e.g. OpenSSL or Symbian implementation), cipher names may not be * equivalent for the same cipher ID. * * @param cipher_name The cipher name string. * * @return The cipher ID or PJ_TLS_UNKNOWN_CIPHER if the cipher * name string is not recognized/supported. */ PJ_DECL(pj_ssl_cipher) pj_ssl_cipher_id(const char *cipher_name); /** * This structure contains the callbacks to be called by the secure socket. */ typedef struct pj_ssl_sock_cb { /** * This callback is called when a data arrives as the result of * pj_ssl_sock_start_read(). * * @param ssock The secure socket. * @param data The buffer containing the new data, if any. If * the status argument is non-PJ_SUCCESS, this * argument may be NULL. * @param size The length of data in the buffer. * @param status The status of the read operation. This may contain * non-PJ_SUCCESS for example when the TCP connection * has been closed. In this case, the buffer may * contain left over data from previous callback which * the application may want to process. * @param remainder If application wishes to leave some data in the * buffer (common for TCP applications), it should * move the remainder data to the front part of the * buffer and set the remainder length here. The value * of this parameter will be ignored for datagram * sockets. * * @return PJ_TRUE if further read is desired, and PJ_FALSE * when application no longer wants to receive data. * Application may destroy the secure socket in the * callback and return PJ_FALSE here. */ pj_bool_t (*on_data_read)(pj_ssl_sock_t *ssock, void *data, pj_size_t size, pj_status_t status, pj_size_t *remainder); /** * This callback is called when a packet arrives as the result of * pj_ssl_sock_start_recvfrom(). * * @param ssock The secure socket. * @param data The buffer containing the packet, if any. If * the status argument is non-PJ_SUCCESS, this * argument will be set to NULL. * @param size The length of packet in the buffer. If * the status argument is non-PJ_SUCCESS, this * argument will be set to zero. * @param src_addr Source address of the packet. * @param addr_len Length of the source address. * @param status This contains * * @return PJ_TRUE if further read is desired, and PJ_FALSE * when application no longer wants to receive data. * Application may destroy the secure socket in the * callback and return PJ_FALSE here. */ pj_bool_t (*on_data_recvfrom)(pj_ssl_sock_t *ssock, void *data, pj_size_t size, const pj_sockaddr_t *src_addr, int addr_len, pj_status_t status); /** * This callback is called when data has been sent. * * @param ssock The secure socket. * @param send_key Key associated with the send operation. * @param sent If value is positive non-zero it indicates the * number of data sent. When the value is negative, * it contains the error code which can be retrieved * by negating the value (i.e. status=-sent). * * @return Application may destroy the secure socket in the * callback and return PJ_FALSE here. */ pj_bool_t (*on_data_sent)(pj_ssl_sock_t *ssock, pj_ioqueue_op_key_t *send_key, pj_ssize_t sent); /** * This callback is called when new connection arrives as the result * of pj_ssl_sock_start_accept(). * * @param ssock The secure socket. * @param newsock The new incoming secure socket. * @param src_addr The source address of the connection. * @param addr_len Length of the source address. * * @return PJ_TRUE if further accept() is desired, and PJ_FALSE * when application no longer wants to accept incoming * connection. Application may destroy the secure socket * in the callback and return PJ_FALSE here. */ pj_bool_t (*on_accept_complete)(pj_ssl_sock_t *ssock, pj_ssl_sock_t *newsock, const pj_sockaddr_t *src_addr, int src_addr_len); /** * This callback is called when pending connect operation has been * completed. * * @param ssock The secure socket. * @param status The connection result. If connection has been * successfully established, the status will contain * PJ_SUCCESS. * * @return Application may destroy the secure socket in the * callback and return PJ_FALSE here. */ pj_bool_t (*on_connect_complete)(pj_ssl_sock_t *ssock, pj_status_t status); } pj_ssl_sock_cb; /** * Enumeration of secure socket protocol types. * This can be combined using bitwise OR operation. */ typedef enum pj_ssl_sock_proto { /** * Default protocol of backend. */ PJ_SSL_SOCK_PROTO_DEFAULT = 0, /** * SSLv2.0 protocol. */ PJ_SSL_SOCK_PROTO_SSL2 = (1 << 0), /** * SSLv3.0 protocol. */ PJ_SSL_SOCK_PROTO_SSL3 = (1 << 1), /** * TLSv1.0 protocol. */ PJ_SSL_SOCK_PROTO_TLS1 = (1 << 2), /** * TLSv1.1 protocol. */ PJ_SSL_SOCK_PROTO_TLS1_1 = (1 << 3), /** * TLSv1.2 protocol. */ PJ_SSL_SOCK_PROTO_TLS1_2 = (1 << 4), /** * Certain backend implementation e.g:OpenSSL, has feature to enable all * protocol. */ PJ_SSL_SOCK_PROTO_SSL23 = (1 << 16) - 1, /** * DTLSv1.0 protocol. */ PJ_SSL_SOCK_PROTO_DTLS1 = (1 << 16), } pj_ssl_sock_proto; /** * Definition of secure socket info structure. */ typedef struct pj_ssl_sock_info { /** * Describes whether secure socket connection is established, i.e: TLS/SSL * handshaking has been done successfully. */ pj_bool_t established; /** * Describes secure socket protocol being used, see #pj_ssl_sock_proto. * Use bitwise OR operation to combine the protocol type. */ pj_uint32_t proto; /** * Describes cipher suite being used, this will only be set when connection * is established. */ pj_ssl_cipher cipher; /** * Describes local address. */ pj_sockaddr local_addr; /** * Describes remote address. */ pj_sockaddr remote_addr; /** * Describes active local certificate info. */ pj_ssl_cert_info *local_cert_info; /** * Describes active remote certificate info. */ pj_ssl_cert_info *remote_cert_info; /** * Status of peer certificate verification. */ pj_uint32_t verify_status; /** * Last native error returned by the backend. */ unsigned long last_native_err; /** * Group lock assigned to the ioqueue key. */ pj_grp_lock_t *grp_lock; } pj_ssl_sock_info; /** * Definition of secure socket creation parameters. */ typedef struct pj_ssl_sock_param { /** * Optional group lock to be assigned to the ioqueue key. * * Note that when a secure socket listener is configured with a group * lock, any new secure socket of an accepted incoming connection * will have its own group lock created automatically by the library, * this group lock can be queried via pj_ssl_sock_get_info() in the info * field pj_ssl_sock_info::grp_lock. */ pj_grp_lock_t *grp_lock; /** * Specifies socket address family, either pj_AF_INET() and pj_AF_INET6(). * * Default is pj_AF_INET(). */ int sock_af; /** * Specify socket type, either pj_SOCK_DGRAM() or pj_SOCK_STREAM(). * * Default is pj_SOCK_STREAM(). */ int sock_type; /** * Specify the ioqueue to use. Secure socket uses the ioqueue to perform * active socket operations, see \ref PJ_ACTIVESOCK for more detail. */ pj_ioqueue_t *ioqueue; /** * Specify the timer heap to use. Secure socket uses the timer to provide * auto cancelation on asynchronous operation when it takes longer time * than specified timeout period, e.g: security negotiation timeout. */ pj_timer_heap_t *timer_heap; /** * Specify secure socket callbacks, see #pj_ssl_sock_cb. */ pj_ssl_sock_cb cb; /** * Specify secure socket user data. */ void *user_data; /** * Specify security protocol to use, see #pj_ssl_sock_proto. Use bitwise OR * operation to combine the protocol type. * * Default is PJ_SSL_SOCK_PROTO_DEFAULT. */ pj_uint32_t proto; /** * Number of concurrent asynchronous operations that is to be supported * by the secure socket. This value only affects socket receive and * accept operations -- the secure socket will issue one or more * asynchronous read and accept operations based on the value of this * field. Setting this field to more than one will allow more than one * incoming data or incoming connections to be processed simultaneously * on multiprocessor systems, when the ioqueue is polled by more than * one threads. * * The default value is 1. */ unsigned async_cnt; /** * The ioqueue concurrency to be forced on the socket when it is * registered to the ioqueue. See #pj_ioqueue_set_concurrency() for more * info about ioqueue concurrency. * * When this value is -1, the concurrency setting will not be forced for * this socket, and the socket will inherit the concurrency setting of * the ioqueue. When this value is zero, the secure socket will disable * concurrency for the socket. When this value is +1, the secure socket * will enable concurrency for the socket. * * The default value is -1. */ int concurrency; /** * If this option is specified, the secure socket will make sure that * asynchronous send operation with stream oriented socket will only * call the callback after all data has been sent. This means that the * secure socket will automatically resend the remaining data until * all data has been sent. * * Please note that when this option is specified, it is possible that * error is reported after partial data has been sent. Also setting * this will disable the ioqueue concurrency for the socket. * * Default value is 1. */ pj_bool_t whole_data; /** * Specify buffer size for sending operation. Buffering sending data * is used for allowing application to perform multiple outstanding * send operations. Whenever application specifies this setting too * small, sending operation may return PJ_ENOMEM. * * Default value is 8192 bytes. */ pj_size_t send_buffer_size; /** * Specify buffer size for receiving encrypted (and perhaps compressed) * data on underlying socket. This setting is unused on Symbian, since * SSL/TLS Symbian backend, CSecureSocket, can use application buffer * directly. * * Default value is 1500. */ pj_size_t read_buffer_size; /** * Number of ciphers contained in the specified cipher preference. * If this is set to zero, then the cipher list used will be determined * by the backend default (for OpenSSL backend, setting * PJ_SSL_SOCK_OSSL_CIPHERS will be used). */ unsigned ciphers_num; /** * Ciphers and order preference. If empty, then default cipher list and * its default order of the backend will be used. */ pj_ssl_cipher *ciphers; /** * Security negotiation timeout. If this is set to zero (both sec and * msec), the negotiation doesn't have a timeout. * * Default value is zero. */ pj_time_val timeout; /** * Specify whether endpoint should verify peer certificate. * * Default value is PJ_FALSE. */ pj_bool_t verify_peer; /** * When secure socket is acting as server (handles incoming connection), * it will require the client to provide certificate. * * Default value is PJ_FALSE. */ pj_bool_t require_client_cert; /** * Server name indication. When secure socket is acting as client * (perform outgoing connection) and the server may host multiple * 'virtual' servers at a single underlying network address, setting * this will allow client to tell the server a name of the server * it is contacting. * * Default value is zero/not-set. */ pj_str_t server_name; /** * Specify if SO_REUSEADDR should be used for listening socket. This * option will only be used with accept() operation. * * Default is PJ_FALSE. */ pj_bool_t reuse_addr; /** * QoS traffic type to be set on this transport. When application wants * to apply QoS tagging to the transport, it's preferable to set this * field rather than \a qos_param fields since this is more portable. * * Default value is PJ_QOS_TYPE_BEST_EFFORT. */ pj_qos_type qos_type; /** * Set the low level QoS parameters to the transport. This is a lower * level operation than setting the \a qos_type field and may not be * supported on all platforms. * * By default all settings in this structure are disabled. */ pj_qos_params qos_params; /** * Specify if the transport should ignore any errors when setting the QoS * traffic type/parameters. * * Default: PJ_TRUE */ pj_bool_t qos_ignore_error; /** * Specify options to be set on the transport. * * By default there is no options. * */ pj_sockopt_params sockopt_params; /** * Specify if the transport should ignore any errors when setting the * sockopt parameters. * * Default: PJ_TRUE * */ pj_bool_t sockopt_ignore_error; } pj_ssl_sock_param; /** * Initialize the secure socket parameters for its creation with * the default values. * * @param param The parameter to be initialized. */ PJ_DECL(void) pj_ssl_sock_param_default(pj_ssl_sock_param *param); /** * Create secure socket instance. * * @param pool The pool for allocating secure socket instance. * @param param The secure socket parameter, see #pj_ssl_sock_param. * @param p_ssock Pointer to secure socket instance to be created. * * @return PJ_SUCCESS when successful. */ PJ_DECL(pj_status_t) pj_ssl_sock_create(pj_pool_t *pool, const pj_ssl_sock_param *param, pj_ssl_sock_t **p_ssock); /** * Set secure socket certificate or credentials. Credentials may include * certificate, private key and trusted Certification Authorities list. * Normally, server socket must provide certificate (and private key). * Socket client may also need to provide certificate in case requested * by the server. * * @param ssock The secure socket instance. * @param pool The pool. * @param cert The endpoint certificate/credentials, see * #pj_ssl_cert_t. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_set_certificate( pj_ssl_sock_t *ssock, pj_pool_t *pool, const pj_ssl_cert_t *cert); /** * Close and destroy the secure socket. * * @param ssock The secure socket. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock); /** * Associate arbitrary data with the secure socket. Application may * inspect this data in the callbacks and associate it with higher * level processing. * * @param ssock The secure socket. * @param user_data The user data to be associated with the secure * socket. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_set_user_data(pj_ssl_sock_t *ssock, void *user_data); /** * Retrieve the user data previously associated with this secure * socket. * * @param ssock The secure socket. * * @return The user data. */ PJ_DECL(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock); /** * Retrieve the local address and port used by specified secure socket. * * @param ssock The secure socket. * @param info The info buffer to be set, see #pj_ssl_sock_info. * * @return PJ_SUCCESS on successful. */ PJ_DECL(pj_status_t) pj_ssl_sock_get_info(pj_ssl_sock_t *ssock, pj_ssl_sock_info *info); /** * Starts read operation on this secure socket. This function will create * \a async_cnt number of buffers (the \a async_cnt parameter was given * in \a pj_ssl_sock_create() function) where each buffer is \a buff_size * long. The buffers are allocated from the specified \a pool. Once the * buffers are created, it then issues \a async_cnt number of asynchronous * \a recv() operations to the socket and returns back to caller. Incoming * data on the socket will be reported back to application via the * \a on_data_read() callback. * * Application only needs to call this function once to initiate read * operations. Further read operations will be done automatically by the * secure socket when \a on_data_read() callback returns non-zero. * * @param ssock The secure socket. * @param pool Pool used to allocate buffers for incoming data. * @param buff_size The size of each buffer, in bytes. * @param flags Flags to be given to pj_ioqueue_recv(). * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_start_read(pj_ssl_sock_t *ssock, pj_pool_t *pool, unsigned buff_size, pj_uint32_t flags); /** * Same as #pj_ssl_sock_start_read(), except that the application * supplies the buffers for the read operation so that the acive socket * does not have to allocate the buffers. * * @param ssock The secure socket. * @param pool Pool used to allocate buffers for incoming data. * @param buff_size The size of each buffer, in bytes. * @param readbuf Array of packet buffers, each has buff_size size. * @param flags Flags to be given to pj_ioqueue_recv(). * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_start_read2(pj_ssl_sock_t *ssock, pj_pool_t *pool, unsigned buff_size, void *readbuf[], pj_uint32_t flags); /** * Same as pj_ssl_sock_start_read(), except that this function is used * only for datagram sockets, and it will trigger \a on_data_recvfrom() * callback instead. * * @param ssock The secure socket. * @param pool Pool used to allocate buffers for incoming data. * @param buff_size The size of each buffer, in bytes. * @param flags Flags to be given to pj_ioqueue_recvfrom(). * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_start_recvfrom(pj_ssl_sock_t *ssock, pj_pool_t *pool, unsigned buff_size, pj_uint32_t flags); /** * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() * operation takes the buffer from the argument rather than creating * new ones. * * @param ssock The secure socket. * @param pool Pool used to allocate buffers for incoming data. * @param buff_size The size of each buffer, in bytes. * @param readbuf Array of packet buffers, each has buff_size size. * @param flags Flags to be given to pj_ioqueue_recvfrom(). * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_start_recvfrom2(pj_ssl_sock_t *ssock, pj_pool_t *pool, unsigned buff_size, void *readbuf[], pj_uint32_t flags); /** * Send data using the socket. * * @param ssock The secure socket. * @param send_key The operation key to send the data, which is useful * if application wants to submit multiple pending * send operations and want to track which exact data * has been sent in the \a on_data_sent() callback. * @param data The data to be sent. This data must remain valid * until the data has been sent. * @param size The size of the data. * @param flags Flags to be given to pj_ioqueue_send(). * * @return PJ_SUCCESS if data has been sent immediately, or * PJ_EPENDING if data cannot be sent immediately or * PJ_ENOMEM when sending buffer could not handle all * queued data, see \a send_buffer_size. The callback * \a on_data_sent() will be called when data is actually * sent. Any other return value indicates error condition. */ PJ_DECL(pj_status_t) pj_ssl_sock_send(pj_ssl_sock_t *ssock, pj_ioqueue_op_key_t *send_key, const void *data, pj_ssize_t *size, unsigned flags); /** * Send datagram using the socket. * * @param ssock The secure socket. * @param send_key The operation key to send the data, which is useful * if application wants to submit multiple pending * send operations and want to track which exact data * has been sent in the \a on_data_sent() callback. * @param data The data to be sent. This data must remain valid * until the data has been sent. * @param size The size of the data. * @param flags Flags to be given to pj_ioqueue_send(). * @param addr The destination address. * @param addr_len Length of buffer containing destination address. * * @return PJ_SUCCESS if data has been sent immediately, or * PJ_EPENDING if data cannot be sent immediately. In * this case the \a on_data_sent() callback will be * called when data is actually sent. Any other return * value indicates error condition. */ PJ_DECL(pj_status_t) pj_ssl_sock_sendto(pj_ssl_sock_t *ssock, pj_ioqueue_op_key_t *send_key, const void *data, pj_ssize_t *size, unsigned flags, const pj_sockaddr_t *addr, int addr_len); /** * Starts asynchronous socket accept() operations on this secure socket. * This function will issue \a async_cnt number of asynchronous \a accept() * operations to the socket and returns back to caller. Incoming * connection on the socket will be reported back to application via the * \a on_accept_complete() callback. * * Application only needs to call this function once to initiate accept() * operations. Further accept() operations will be done automatically by * the secure socket when \a on_accept_complete() callback returns non-zero. * * @param ssock The secure socket. * @param pool Pool used to allocate some internal data for the * operation. * @param localaddr Local address to bind on. * @param addr_len Length of buffer containing local address. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_start_accept(pj_ssl_sock_t *ssock, pj_pool_t *pool, const pj_sockaddr_t *local_addr, int addr_len); /** * Starts asynchronous socket connect() operation and SSL/TLS handshaking * for this socket. Once the connection is done (either successfully or not), * the \a on_connect_complete() callback will be called. * * @param ssock The secure socket. * @param pool The pool to allocate some internal data for the * operation. * @param localaddr Local address. * @param remaddr Remote address. * @param addr_len Length of buffer containing above addresses. * * @return PJ_SUCCESS if connection can be established immediately * or PJ_EPENDING if connection cannot be established * immediately. In this case the \a on_connect_complete() * callback will be called when connection is complete. * Any other return value indicates error condition. */ PJ_DECL(pj_status_t) pj_ssl_sock_start_connect(pj_ssl_sock_t *ssock, pj_pool_t *pool, const pj_sockaddr_t *localaddr, const pj_sockaddr_t *remaddr, int addr_len); /** * Starts SSL/TLS renegotiation over an already established SSL connection * for this socket. This operation is performed transparently, no callback * will be called once the renegotiation completed successfully. However, * when the renegotiation fails, the connection will be closed and callback * \a on_data_read() will be invoked with non-PJ_SUCCESS status code. * * @param ssock The secure socket. * * @return PJ_SUCCESS if renegotiation is completed immediately, * or PJ_EPENDING if renegotiation has been started and * waiting for completion, or the appropriate error code * on failure. */ PJ_DECL(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock); /** * @} */ PJ_END_DECL #endif /* __PJ_SSL_SOCK_H__ */
xiejianying/pjsip
pjlib/include/pj/ssl_sock.h
C
gpl-2.0
38,046
/* */ #ifndef __ASMARM_SMP_PLAT_H #define __ASMARM_SMP_PLAT_H #include <asm/cputype.h> /* */ static inline bool is_smp(void) { #ifndef CONFIG_SMP return false; #elif defined(CONFIG_SMP_ON_UP) extern unsigned int smp_on_up; return !!smp_on_up; #else return true; #endif } /* */ static inline int tlb_ops_need_broadcast(void) { if (!is_smp()) return 0; return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2; } #if !defined(CONFIG_SMP) || __LINUX_ARM_ARCH__ >= 7 #define cache_ops_need_broadcast() 0 #else static inline int cache_ops_need_broadcast(void) { if (!is_smp()) return 0; return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1; } #endif /* */ extern int __cpu_logical_map[]; #define cpu_logical_map(cpu) __cpu_logical_map[cpu] #endif
holyangel/LGE_G3
arch/arm/include/asm/smp_plat.h
C
gpl-2.0
978
<?php /** * @file * Default simple view template to all the fields as a row. * * - $view: The view in use. * - $fields: an array of $field objects. Each one contains: * - $field->content: The output of the field. * - $field->raw: The raw data for the field, if it exists. This is NOT output safe. * - $field->class: The safe class id to use. * - $field->handler: The Views field handler object controlling this field. Do not use * var_export to dump this object, as it can't handle the recursion. * - $field->inline: Whether or not the field should be inline. * - $field->inline_html: either div or span based on the above flag. * - $field->wrapper_prefix: A complete wrapper containing the inline_html to use. * - $field->wrapper_suffix: The closing tag for the wrapper. * - $field->separator: an optional separator that may appear before a field. * - $field->label: The wrap label text to use. * - $field->label_html: The full HTML of the label to use including * configured element type. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */ ?> <div class='oa-list oa-news clearfix'> <?php if (!empty($field_user_picture)): ?> <div class='pull-right'> <?php print $field_user_picture; ?> </div> <?php endif; ?> <div class='oa-news-header'> <?php print $title; ?> <?php if (!empty($timestamp)): ?> <span class='pull-right'> &nbsp;<?php print $timestamp; ?> </span> <?php endif; ?> <div class='oa-news-posted'> <?php print t('Posted by ') . $name . t(' on ') . $created; ?> <?php if (!empty($edit_node)): ?> <span> &nbsp;<?php print $edit_node; ?> </span> <?php endif; ?> </div> </div> <div class='oa-news-body'> <?php if (!empty($field_oa_media)): ?> <div class='oa-news-image pull-left'> <?php print $field_oa_media; ?> </div> <?php elseif (!empty($field_featured_image)): ?> <div class='oa-news-image pull-left'> <?php print $field_featured_image; ?> </div> <?php endif; ?> <?php if (!empty($body_summary)): ?> <div class='oa-news-body'> <?php print $body_summary; ?> </div> <?php endif; ?> <?php if (!empty($term_node_tid)): ?> <div class='oa-news-tags'> <?php print t('Categories: ') . $term_node_tid; ?> </div> <?php endif; ?> </div> </div>
SoloGabbo/demo
profiles/openatrium/modules/contrib/oa_core/modules/oa_news/templates/views-view-fields--open-atrium-news--oa-recent-news.tpl.php
PHP
gpl-2.0
2,455
/* * Linux cfg80211 driver - Android related functions * * $Copyright Open Broadcom Corporation$ * * $Id: wl_android.c 505064 2014-09-26 09:40:28Z $ */ #include <linux/module.h> #include <linux/netdevice.h> #include <net/netlink.h> #ifdef CONFIG_COMPAT #include <linux/compat.h> #endif #include <wl_android.h> #include <wldev_common.h> #include <wlioctl.h> #include <bcmutils.h> #include <linux_osl.h> #include <dhd_dbg.h> #include <dngl_stats.h> #include <dhd.h> #include <proto/bcmip.h> #ifdef PNO_SUPPORT #include <dhd_pno.h> #endif #ifdef BCMSDIO #include <bcmsdbus.h> #endif #ifdef WL_CFG80211 #include <wl_cfg80211.h> #endif #ifdef WL_NAN #include <wl_cfgnan.h> #endif /* WL_NAN */ /* * Android private command strings, PLEASE define new private commands here * so they can be updated easily in the future (if needed) */ #define CMD_START "START" #define CMD_STOP "STOP" #define CMD_SCAN_ACTIVE "SCAN-ACTIVE" #define CMD_SCAN_PASSIVE "SCAN-PASSIVE" #define CMD_RSSI "RSSI" #define CMD_LINKSPEED "LINKSPEED" #ifdef PKT_FILTER_SUPPORT #define CMD_RXFILTER_START "RXFILTER-START" #define CMD_RXFILTER_STOP "RXFILTER-STOP" #define CMD_RXFILTER_ADD "RXFILTER-ADD" #define CMD_RXFILTER_REMOVE "RXFILTER-REMOVE" #if defined(CUSTOM_PLATFORM_NV_TEGRA) #define CMD_PKT_FILTER_MODE "PKT_FILTER_MODE" #define CMD_PKT_FILTER_PORTS "PKT_FILTER_PORTS" #endif /* defined(CUSTOM_PLATFORM_NV_TEGRA) */ #endif /* PKT_FILTER_SUPPORT */ #define CMD_BTCOEXSCAN_START "BTCOEXSCAN-START" #define CMD_BTCOEXSCAN_STOP "BTCOEXSCAN-STOP" #define CMD_BTCOEXMODE "BTCOEXMODE" #define CMD_SETSUSPENDOPT "SETSUSPENDOPT" #define CMD_SETSUSPENDMODE "SETSUSPENDMODE" #define CMD_P2P_DEV_ADDR "P2P_DEV_ADDR" #define CMD_SETFWPATH "SETFWPATH" #define CMD_SETBAND "SETBAND" #define CMD_GETBAND "GETBAND" #define CMD_COUNTRY "COUNTRY" #define CMD_P2P_SET_NOA "P2P_SET_NOA" #if !defined WL_ENABLE_P2P_IF #define CMD_P2P_GET_NOA "P2P_GET_NOA" #endif /* WL_ENABLE_P2P_IF */ #define CMD_P2P_SD_OFFLOAD "P2P_SD_" #define CMD_P2P_SET_PS "P2P_SET_PS" #define CMD_SET_AP_WPS_P2P_IE "SET_AP_WPS_P2P_IE" #define CMD_SETROAMMODE "SETROAMMODE" #define CMD_SETIBSSBEACONOUIDATA "SETIBSSBEACONOUIDATA" #define CMD_MIRACAST "MIRACAST" #define CMD_NAN "NAN_" #if defined(WL_SUPPORT_AUTO_CHANNEL) #define CMD_GET_BEST_CHANNELS "GET_BEST_CHANNELS" #endif /* WL_SUPPORT_AUTO_CHANNEL */ #if defined(CUSTOM_PLATFORM_NV_TEGRA) #define CMD_SETMIRACAST "SETMIRACAST" #define CMD_ASSOCRESPIE "ASSOCRESPIE" #define CMD_RXRATESTATS "RXRATESTATS" #endif /* defined(CUSTOM_PLATFORM_NV_TEGRA) */ #define CMD_KEEP_ALIVE "KEEPALIVE" /* CCX Private Commands */ #ifdef BCMCCX #define CMD_GETCCKM_RN "get cckm_rn" #define CMD_SETCCKM_KRK "set cckm_krk" #define CMD_GET_ASSOC_RES_IES "get assoc_res_ies" #endif #ifdef PNO_SUPPORT #define CMD_PNOSSIDCLR_SET "PNOSSIDCLR" #define CMD_PNOSETUP_SET "PNOSETUP " #define CMD_PNOENABLE_SET "PNOFORCE" #define CMD_PNODEBUG_SET "PNODEBUG" #define CMD_WLS_BATCHING "WLS_BATCHING" #endif /* PNO_SUPPORT */ #define CMD_OKC_SET_PMK "SET_PMK" #define CMD_OKC_ENABLE "OKC_ENABLE" #define CMD_HAPD_MAC_FILTER "HAPD_MAC_FILTER" #ifdef WLFBT #define CMD_GET_FTKEY "GET_FTKEY" #endif #ifdef WLAIBSS #define CMD_SETIBSSTXFAILEVENT "SETIBSSTXFAILEVENT" #define CMD_GET_IBSS_PEER_INFO "GETIBSSPEERINFO" #define CMD_GET_IBSS_PEER_INFO_ALL "GETIBSSPEERINFOALL" #define CMD_SETIBSSROUTETABLE "SETIBSSROUTETABLE" #define CMD_SETIBSSAMPDU "SETIBSSAMPDU" #define CMD_SETIBSSANTENNAMODE "SETIBSSANTENNAMODE" #endif /* WLAIBSS */ #define CMD_ROAM_OFFLOAD "SETROAMOFFLOAD" #define CMD_ROAM_OFFLOAD_APLIST "SETROAMOFFLAPLIST" #define CMD_GET_LINK_STATUS "GETLINKSTATUS" #ifdef P2PRESP_WFDIE_SRC #define CMD_P2P_SET_WFDIE_RESP "P2P_SET_WFDIE_RESP" #define CMD_P2P_GET_WFDIE_RESP "P2P_GET_WFDIE_RESP" #endif /* P2PRESP_WFDIE_SRC */ /* related with CMD_GET_LINK_STATUS */ #define WL_ANDROID_LINK_VHT 0x01 #define WL_ANDROID_LINK_MIMO 0x02 #define WL_ANDROID_LINK_AP_VHT_SUPPORT 0x04 #define WL_ANDROID_LINK_AP_MIMO_SUPPORT 0x08 /* miracast related definition */ #define MIRACAST_MODE_OFF 0 #define MIRACAST_MODE_SOURCE 1 #define MIRACAST_MODE_SINK 2 #ifndef MIRACAST_AMPDU_SIZE #define MIRACAST_AMPDU_SIZE 8 #endif #ifndef MIRACAST_MCHAN_ALGO #define MIRACAST_MCHAN_ALGO 1 #endif #ifndef MIRACAST_MCHAN_BW #define MIRACAST_MCHAN_BW 25 #endif #ifdef CONNECTION_STATISTICS #define CMD_GET_CONNECTION_STATS "GET_CONNECTION_STATS" struct connection_stats { u32 txframe; u32 txbyte; u32 txerror; u32 rxframe; u32 rxbyte; u32 txfail; u32 txretry; u32 txretrie; u32 txrts; u32 txnocts; u32 txexptime; u32 txrate; u8 chan_idle; }; #endif /* CONNECTION_STATISTICS */ static LIST_HEAD(miracast_resume_list); static u8 miracast_cur_mode; struct io_cfg { s8 *iovar; s32 param; u32 ioctl; void *arg; u32 len; struct list_head list; }; typedef struct _android_wifi_priv_cmd { char *buf; int used_len; int total_len; } android_wifi_priv_cmd; #ifdef CONFIG_COMPAT typedef struct _compat_android_wifi_priv_cmd { compat_caddr_t buf; int used_len; int total_len; } compat_android_wifi_priv_cmd; #endif /* CONFIG_COMPAT */ #if defined(BCMFW_ROAM_ENABLE) #define CMD_SET_ROAMPREF "SET_ROAMPREF" #define MAX_NUM_SUITES 10 #define WIDTH_AKM_SUITE 8 #define JOIN_PREF_RSSI_LEN 0x02 #define JOIN_PREF_RSSI_SIZE 4 /* RSSI pref header size in bytes */ #define JOIN_PREF_WPA_HDR_SIZE 4 /* WPA pref header size in bytes */ #define JOIN_PREF_WPA_TUPLE_SIZE 12 /* Tuple size in bytes */ #define JOIN_PREF_MAX_WPA_TUPLES 16 #define MAX_BUF_SIZE (JOIN_PREF_RSSI_SIZE + JOIN_PREF_WPA_HDR_SIZE + \ (JOIN_PREF_WPA_TUPLE_SIZE * JOIN_PREF_MAX_WPA_TUPLES)) #endif /* BCMFW_ROAM_ENABLE */ #ifdef WL_GENL static s32 wl_genl_handle_msg(struct sk_buff *skb, struct genl_info *info); static int wl_genl_init(void); static int wl_genl_deinit(void); extern struct net init_net; /* attribute policy: defines which attribute has which type (e.g int, char * etc) * possible values defined in net/netlink.h */ static struct nla_policy wl_genl_policy[BCM_GENL_ATTR_MAX + 1] = { [BCM_GENL_ATTR_STRING] = { .type = NLA_NUL_STRING }, [BCM_GENL_ATTR_MSG] = { .type = NLA_BINARY }, }; #define WL_GENL_VER 1 /* family definition */ static struct genl_family wl_genl_family = { .id = GENL_ID_GENERATE, /* Genetlink would generate the ID */ .hdrsize = 0, .name = "bcm-genl", /* Netlink I/F for Android */ .version = WL_GENL_VER, /* Version Number */ .maxattr = BCM_GENL_ATTR_MAX, }; /* commands: mapping between the command enumeration and the actual function */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) struct genl_ops wl_genl_ops[] = { { .cmd = BCM_GENL_CMD_MSG, .flags = 0, .policy = wl_genl_policy, .doit = wl_genl_handle_msg, .dumpit = NULL, }, }; #else struct genl_ops wl_genl_ops = { .cmd = BCM_GENL_CMD_MSG, .flags = 0, .policy = wl_genl_policy, .doit = wl_genl_handle_msg, .dumpit = NULL, }; #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) static struct genl_multicast_group wl_genl_mcast[] = { { .name = "bcm-genl-mcast", }, }; #else static struct genl_multicast_group wl_genl_mcast = { .id = GENL_ID_GENERATE, /* Genetlink would generate the ID */ .name = "bcm-genl-mcast", }; #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) */ #endif /* WL_GENL */ /** * Extern function declarations (TODO: move them to dhd_linux.h) */ int dhd_net_bus_devreset(struct net_device *dev, uint8 flag); int dhd_dev_init_ioctl(struct net_device *dev); #ifdef WL_CFG80211 int wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr); int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, dhd_pub_t *dhd, char *command); #else int wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr) { return 0; } int wl_cfg80211_set_p2p_noa(struct net_device *net, char* buf, int len) { return 0; } int wl_cfg80211_get_p2p_noa(struct net_device *net, char* buf, int len) { return 0; } int wl_cfg80211_set_p2p_ps(struct net_device *net, char* buf, int len) { return 0; } #endif /* WK_CFG80211 */ #ifdef ENABLE_4335BT_WAR extern int bcm_bt_lock(int cookie); extern void bcm_bt_unlock(int cookie); static int lock_cookie_wifi = 'W' | 'i'<<8 | 'F'<<16 | 'i'<<24; /* cookie is "WiFi" */ #endif /* ENABLE_4335BT_WAR */ extern bool ap_fw_loaded; #if defined(CUSTOMER_HW2) extern char iface_name[IFNAMSIZ]; #endif /** * Local (static) functions and variables */ /* Initialize g_wifi_on to 1 so dhd_bus_start will be called for the first * time (only) in dhd_open, subsequential wifi on will be handled by * wl_android_wifi_on */ static int g_wifi_on = TRUE; /** * Local (static) function definitions */ static int wl_android_get_link_speed(struct net_device *net, char *command, int total_len) { int link_speed; int bytes_written; int error; error = wldev_get_link_speed(net, &link_speed); if (error) return -1; /* Convert Kbps to Android Mbps */ link_speed = link_speed / 1000; bytes_written = snprintf(command, total_len, "LinkSpeed %d", link_speed); DHD_INFO(("%s: command result is %s\n", __FUNCTION__, command)); return bytes_written; } static int wl_android_get_rssi(struct net_device *net, char *command, int total_len) { wlc_ssid_t ssid = {0}; int rssi; int bytes_written = 0; int error; error = wldev_get_rssi(net, &rssi); if (error) return -1; error = wldev_get_ssid(net, &ssid); if (error) return -1; if ((ssid.SSID_len == 0) || (ssid.SSID_len > DOT11_MAX_SSID_LEN)) { DHD_ERROR(("%s: wldev_get_ssid failed\n", __FUNCTION__)); } else { memcpy(command, ssid.SSID, ssid.SSID_len); bytes_written = ssid.SSID_len; } bytes_written += snprintf(&command[bytes_written], total_len, " rssi %d", rssi); DHD_INFO(("%s: command result is %s (%d)\n", __FUNCTION__, command, bytes_written)); return bytes_written; } static int wl_android_set_suspendopt(struct net_device *dev, char *command, int total_len) { int suspend_flag; int ret_now; int ret = 0; suspend_flag = *(command + strlen(CMD_SETSUSPENDOPT) + 1) - '0'; if (suspend_flag != 0) suspend_flag = 1; ret_now = net_os_set_suspend_disable(dev, suspend_flag); if (ret_now != suspend_flag) { if (!(ret = net_os_set_suspend(dev, ret_now, 1))) DHD_INFO(("%s: Suspend Flag %d -> %d\n", __FUNCTION__, ret_now, suspend_flag)); else DHD_ERROR(("%s: failed %d\n", __FUNCTION__, ret)); } return ret; } static int wl_android_set_suspendmode(struct net_device *dev, char *command, int total_len) { int ret = 0; #if !defined(CONFIG_HAS_EARLYSUSPEND) || !defined(DHD_USE_EARLYSUSPEND) int suspend_flag; suspend_flag = *(command + strlen(CMD_SETSUSPENDMODE) + 1) - '0'; if (suspend_flag != 0) suspend_flag = 1; if (!(ret = net_os_set_suspend(dev, suspend_flag, 0))) DHD_INFO(("%s: Suspend Mode %d\n", __FUNCTION__, suspend_flag)); else DHD_ERROR(("%s: failed %d\n", __FUNCTION__, ret)); #endif return ret; } static int wl_android_get_band(struct net_device *dev, char *command, int total_len) { uint band; int bytes_written; int error; error = wldev_get_band(dev, &band); if (error) return -1; bytes_written = snprintf(command, total_len, "Band %d", band); return bytes_written; } #ifdef PNO_SUPPORT #define PNO_PARAM_SIZE 50 #define VALUE_SIZE 50 #define LIMIT_STR_FMT ("%50s %50s") static int wls_parse_batching_cmd(struct net_device *dev, char *command, int total_len) { int err = BCME_OK; uint i, tokens; char *pos, *pos2, *token, *token2, *delim; char param[PNO_PARAM_SIZE], value[VALUE_SIZE]; struct dhd_pno_batch_params batch_params; DHD_PNO(("%s: command=%s, len=%d\n", __FUNCTION__, command, total_len)); if (total_len < strlen(CMD_WLS_BATCHING)) { DHD_ERROR(("%s argument=%d less min size\n", __FUNCTION__, total_len)); err = BCME_ERROR; goto exit; } pos = command + strlen(CMD_WLS_BATCHING) + 1; memset(&batch_params, 0, sizeof(struct dhd_pno_batch_params)); if (!strncmp(pos, PNO_BATCHING_SET, strlen(PNO_BATCHING_SET))) { pos += strlen(PNO_BATCHING_SET) + 1; while ((token = strsep(&pos, PNO_PARAMS_DELIMETER)) != NULL) { memset(param, 0, sizeof(param)); memset(value, 0, sizeof(value)); if (token == NULL || !*token) break; if (*token == '\0') continue; delim = strchr(token, PNO_PARAM_VALUE_DELLIMETER); if (delim != NULL) *delim = ' '; tokens = sscanf(token, LIMIT_STR_FMT, param, value); if (!strncmp(param, PNO_PARAM_SCANFREQ, strlen(PNO_PARAM_SCANFREQ))) { batch_params.scan_fr = simple_strtol(value, NULL, 0); DHD_PNO(("scan_freq : %d\n", batch_params.scan_fr)); } else if (!strncmp(param, PNO_PARAM_BESTN, strlen(PNO_PARAM_BESTN))) { batch_params.bestn = simple_strtol(value, NULL, 0); DHD_PNO(("bestn : %d\n", batch_params.bestn)); } else if (!strncmp(param, PNO_PARAM_MSCAN, strlen(PNO_PARAM_MSCAN))) { batch_params.mscan = simple_strtol(value, NULL, 0); DHD_PNO(("mscan : %d\n", batch_params.mscan)); } else if (!strncmp(param, PNO_PARAM_CHANNEL, strlen(PNO_PARAM_CHANNEL))) { i = 0; pos2 = value; tokens = sscanf(value, "<%s>", value); if (tokens != 1) { err = BCME_ERROR; DHD_ERROR(("%s : invalid format for channel" " <> params\n", __FUNCTION__)); goto exit; } while ((token2 = strsep(&pos2, PNO_PARAM_CHANNEL_DELIMETER)) != NULL) { if (token2 == NULL || !*token2) break; if (*token2 == '\0') continue; if (*token2 == 'A' || *token2 == 'B') { batch_params.band = (*token2 == 'A')? WLC_BAND_5G : WLC_BAND_2G; DHD_PNO(("band : %s\n", (*token2 == 'A')? "A" : "B")); } else { batch_params.chan_list[i++] = simple_strtol(token2, NULL, 0); batch_params.nchan++; DHD_PNO(("channel :%d\n", batch_params.chan_list[i-1])); } } } else if (!strncmp(param, PNO_PARAM_RTT, strlen(PNO_PARAM_RTT))) { batch_params.rtt = simple_strtol(value, NULL, 0); DHD_PNO(("rtt : %d\n", batch_params.rtt)); } else { DHD_ERROR(("%s : unknown param: %s\n", __FUNCTION__, param)); err = BCME_ERROR; goto exit; } } err = dhd_dev_pno_set_for_batch(dev, &batch_params); if (err < 0) { DHD_ERROR(("failed to configure batch scan\n")); } else { memset(command, 0, total_len); err = sprintf(command, "%d", err); } } else if (!strncmp(pos, PNO_BATCHING_GET, strlen(PNO_BATCHING_GET))) { err = dhd_dev_pno_get_for_batch(dev, command, total_len); if (err < 0) { DHD_ERROR(("failed to getting batching results\n")); } else { err = strlen(command); } } else if (!strncmp(pos, PNO_BATCHING_STOP, strlen(PNO_BATCHING_STOP))) { err = dhd_dev_pno_stop_for_batch(dev); if (err < 0) { DHD_ERROR(("failed to stop batching scan\n")); } else { memset(command, 0, total_len); err = sprintf(command, "OK"); } } else { DHD_ERROR(("%s : unknown command\n", __FUNCTION__)); err = BCME_ERROR; goto exit; } exit: return err; } #ifndef WL_SCHED_SCAN static int wl_android_set_pno_setup(struct net_device *dev, char *command, int total_len) { wlc_ssid_t ssids_local[MAX_PFN_LIST_COUNT]; int res = -1; int nssid = 0; cmd_tlv_t *cmd_tlv_temp; char *str_ptr; int tlv_size_left; int pno_time = 0; int pno_repeat = 0; int pno_freq_expo_max = 0; #ifdef PNO_SET_DEBUG int i; char pno_in_example[] = { 'P', 'N', 'O', 'S', 'E', 'T', 'U', 'P', ' ', 'S', '1', '2', '0', 'S', 0x05, 'd', 'l', 'i', 'n', 'k', 'S', 0x04, 'G', 'O', 'O', 'G', 'T', '0', 'B', 'R', '2', 'M', '2', 0x00 }; #endif /* PNO_SET_DEBUG */ DHD_PNO(("%s: command=%s, len=%d\n", __FUNCTION__, command, total_len)); if (total_len < (strlen(CMD_PNOSETUP_SET) + sizeof(cmd_tlv_t))) { DHD_ERROR(("%s argument=%d less min size\n", __FUNCTION__, total_len)); goto exit_proc; } #ifdef PNO_SET_DEBUG memcpy(command, pno_in_example, sizeof(pno_in_example)); total_len = sizeof(pno_in_example); #endif str_ptr = command + strlen(CMD_PNOSETUP_SET); tlv_size_left = total_len - strlen(CMD_PNOSETUP_SET); cmd_tlv_temp = (cmd_tlv_t *)str_ptr; memset(ssids_local, 0, sizeof(ssids_local)); if ((cmd_tlv_temp->prefix == PNO_TLV_PREFIX) && (cmd_tlv_temp->version == PNO_TLV_VERSION) && (cmd_tlv_temp->subtype == PNO_TLV_SUBTYPE_LEGACY_PNO)) { str_ptr += sizeof(cmd_tlv_t); tlv_size_left -= sizeof(cmd_tlv_t); if ((nssid = wl_iw_parse_ssid_list_tlv(&str_ptr, ssids_local, MAX_PFN_LIST_COUNT, &tlv_size_left)) <= 0) { DHD_ERROR(("SSID is not presented or corrupted ret=%d\n", nssid)); goto exit_proc; } else { if ((str_ptr[0] != PNO_TLV_TYPE_TIME) || (tlv_size_left <= 1)) { DHD_ERROR(("%s scan duration corrupted field size %d\n", __FUNCTION__, tlv_size_left)); goto exit_proc; } str_ptr++; pno_time = simple_strtoul(str_ptr, &str_ptr, 16); DHD_PNO(("%s: pno_time=%d\n", __FUNCTION__, pno_time)); if (str_ptr[0] != 0) { if ((str_ptr[0] != PNO_TLV_FREQ_REPEAT)) { DHD_ERROR(("%s pno repeat : corrupted field\n", __FUNCTION__)); goto exit_proc; } str_ptr++; pno_repeat = simple_strtoul(str_ptr, &str_ptr, 16); DHD_PNO(("%s :got pno_repeat=%d\n", __FUNCTION__, pno_repeat)); if (str_ptr[0] != PNO_TLV_FREQ_EXPO_MAX) { DHD_ERROR(("%s FREQ_EXPO_MAX corrupted field size\n", __FUNCTION__)); goto exit_proc; } str_ptr++; pno_freq_expo_max = simple_strtoul(str_ptr, &str_ptr, 16); DHD_PNO(("%s: pno_freq_expo_max=%d\n", __FUNCTION__, pno_freq_expo_max)); } } } else { DHD_ERROR(("%s get wrong TLV command\n", __FUNCTION__)); goto exit_proc; } res = dhd_dev_pno_set_for_ssid(dev, ssids_local, nssid, pno_time, pno_repeat, pno_freq_expo_max, NULL, 0); exit_proc: return res; } #endif /* !WL_SCHED_SCAN */ #endif /* PNO_SUPPORT */ static int wl_android_get_p2p_dev_addr(struct net_device *ndev, char *command, int total_len) { int ret; int bytes_written = 0; ret = wl_cfg80211_get_p2p_dev_addr(ndev, (struct ether_addr*)command); if (ret) return 0; bytes_written = sizeof(struct ether_addr); return bytes_written; } #ifdef BCMCCX static int wl_android_get_cckm_rn(struct net_device *dev, char *command) { int error, rn; WL_TRACE(("%s:wl_android_get_cckm_rn\n", dev->name)); error = wldev_iovar_getint(dev, "cckm_rn", &rn); if (unlikely(error)) { WL_ERR(("wl_android_get_cckm_rn error (%d)\n", error)); return -1; } memcpy(command, &rn, sizeof(int)); return sizeof(int); } static int wl_android_set_cckm_krk(struct net_device *dev, char *command) { int error; unsigned char key[16]; static char iovar_buf[WLC_IOCTL_MEDLEN]; WL_TRACE(("%s: wl_iw_set_cckm_krk\n", dev->name)); memset(iovar_buf, 0, sizeof(iovar_buf)); memcpy(key, command+strlen("set cckm_krk")+1, 16); error = wldev_iovar_setbuf(dev, "cckm_krk", key, sizeof(key), iovar_buf, WLC_IOCTL_MEDLEN, NULL); if (unlikely(error)) { WL_ERR((" cckm_krk set error (%d)\n", error)); return -1; } return 0; } static int wl_android_get_assoc_res_ies(struct net_device *dev, char *command) { int error; u8 buf[WL_ASSOC_INFO_MAX]; wl_assoc_info_t assoc_info; u32 resp_ies_len = 0; int bytes_written = 0; WL_TRACE(("%s: wl_iw_get_assoc_res_ies\n", dev->name)); error = wldev_iovar_getbuf(dev, "assoc_info", NULL, 0, buf, WL_ASSOC_INFO_MAX, NULL); if (unlikely(error)) { WL_ERR(("could not get assoc info (%d)\n", error)); return -1; } memcpy(&assoc_info, buf, sizeof(wl_assoc_info_t)); assoc_info.req_len = htod32(assoc_info.req_len); assoc_info.resp_len = htod32(assoc_info.resp_len); assoc_info.flags = htod32(assoc_info.flags); if (assoc_info.resp_len) { resp_ies_len = assoc_info.resp_len - sizeof(struct dot11_assoc_resp); } /* first 4 bytes are ie len */ memcpy(command, &resp_ies_len, sizeof(u32)); bytes_written = sizeof(u32); /* get the association resp IE's if there are any */ if (resp_ies_len) { error = wldev_iovar_getbuf(dev, "assoc_resp_ies", NULL, 0, buf, WL_ASSOC_INFO_MAX, NULL); if (unlikely(error)) { WL_ERR(("could not get assoc resp_ies (%d)\n", error)); return -1; } memcpy(command+sizeof(u32), buf, resp_ies_len); bytes_written += resp_ies_len; } return bytes_written; } #endif /* BCMCCX */ int wl_android_set_ap_mac_list(struct net_device *dev, int macmode, struct maclist *maclist) { int i, j, match; int ret = 0; char mac_buf[MAX_NUM_OF_ASSOCLIST * sizeof(struct ether_addr) + sizeof(uint)] = {0}; struct maclist *assoc_maclist = (struct maclist *)mac_buf; /* set filtering mode */ if ((ret = wldev_ioctl(dev, WLC_SET_MACMODE, &macmode, sizeof(macmode), true)) != 0) { DHD_ERROR(("%s : WLC_SET_MACMODE error=%d\n", __FUNCTION__, ret)); return ret; } if (macmode != MACLIST_MODE_DISABLED) { /* set the MAC filter list */ if ((ret = wldev_ioctl(dev, WLC_SET_MACLIST, maclist, sizeof(int) + sizeof(struct ether_addr) * maclist->count, true)) != 0) { DHD_ERROR(("%s : WLC_SET_MACLIST error=%d\n", __FUNCTION__, ret)); return ret; } /* get the current list of associated STAs */ assoc_maclist->count = MAX_NUM_OF_ASSOCLIST; if ((ret = wldev_ioctl(dev, WLC_GET_ASSOCLIST, assoc_maclist, sizeof(mac_buf), false)) != 0) { DHD_ERROR(("%s : WLC_GET_ASSOCLIST error=%d\n", __FUNCTION__, ret)); return ret; } /* do we have any STA associated? */ if (assoc_maclist->count) { /* iterate each associated STA */ for (i = 0; i < assoc_maclist->count; i++) { match = 0; /* compare with each entry */ for (j = 0; j < maclist->count; j++) { DHD_INFO(("%s : associated="MACDBG " list="MACDBG "\n", __FUNCTION__, MAC2STRDBG(assoc_maclist->ea[i].octet), MAC2STRDBG(maclist->ea[j].octet))); if (memcmp(assoc_maclist->ea[i].octet, maclist->ea[j].octet, ETHER_ADDR_LEN) == 0) { match = 1; break; } } /* do conditional deauth */ /* "if not in the allow list" or "if in the deny list" */ if ((macmode == MACLIST_MODE_ALLOW && !match) || (macmode == MACLIST_MODE_DENY && match)) { scb_val_t scbval; scbval.val = htod32(1); memcpy(&scbval.ea, &assoc_maclist->ea[i], ETHER_ADDR_LEN); if ((ret = wldev_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON, &scbval, sizeof(scb_val_t), true)) != 0) DHD_ERROR(("%s WLC_SCB_DEAUTHENTICATE error=%d\n", __FUNCTION__, ret)); } } } } return ret; } /* * HAPD_MAC_FILTER mac_mode mac_cnt mac_addr1 mac_addr2 * */ static int wl_android_set_mac_address_filter(struct net_device *dev, const char* str) { int i; int ret = 0; int macnum = 0; int macmode = MACLIST_MODE_DISABLED; struct maclist *list; char eabuf[ETHER_ADDR_STR_LEN]; /* string should look like below (macmode/macnum/maclist) */ /* 1 2 00:11:22:33:44:55 00:11:22:33:44:ff */ /* get the MAC filter mode */ macmode = bcm_atoi(strsep((char**)&str, " ")); if (macmode < MACLIST_MODE_DISABLED || macmode > MACLIST_MODE_ALLOW) { DHD_ERROR(("%s : invalid macmode %d\n", __FUNCTION__, macmode)); return -1; } macnum = bcm_atoi(strsep((char**)&str, " ")); if (macnum < 0 || macnum > MAX_NUM_MAC_FILT) { DHD_ERROR(("%s : invalid number of MAC address entries %d\n", __FUNCTION__, macnum)); return -1; } /* allocate memory for the MAC list */ list = (struct maclist*)kmalloc(sizeof(int) + sizeof(struct ether_addr) * macnum, GFP_KERNEL); if (!list) { DHD_ERROR(("%s : failed to allocate memory\n", __FUNCTION__)); return -1; } /* prepare the MAC list */ list->count = htod32(macnum); bzero((char *)eabuf, ETHER_ADDR_STR_LEN); for (i = 0; i < list->count; i++) { strncpy(eabuf, strsep((char**)&str, " "), ETHER_ADDR_STR_LEN - 1); if (!(ret = bcm_ether_atoe(eabuf, &list->ea[i]))) { DHD_ERROR(("%s : mac parsing err index=%d, addr=%s\n", __FUNCTION__, i, eabuf)); list->count--; break; } DHD_INFO(("%s : %d/%d MACADDR=%s", __FUNCTION__, i, list->count, eabuf)); } /* set the list */ if ((ret = wl_android_set_ap_mac_list(dev, macmode, list)) != 0) DHD_ERROR(("%s : Setting MAC list failed error=%d\n", __FUNCTION__, ret)); kfree(list); return 0; } /** * Global function definitions (declared in wl_android.h) */ int wl_android_wifi_on(struct net_device *dev) { int ret = 0; #ifdef CONFIG_MACH_UNIVERSAL5433 int retry; /* Do not retry old revision Helsinki Prime */ if (!check_rev()) { retry = 1; } else { retry = POWERUP_MAX_RETRY; } #else int retry = POWERUP_MAX_RETRY; #endif /* CONFIG_MACH_UNIVERSAL5433 */ DHD_ERROR(("%s in\n", __FUNCTION__)); if (!dev) { DHD_ERROR(("%s: dev is null\n", __FUNCTION__)); return -EINVAL; } dhd_net_if_lock(dev); if (!g_wifi_on) { do { dhd_net_wifi_platform_set_power(dev, TRUE, WIFI_TURNON_DELAY); #ifdef BCMSDIO ret = dhd_net_bus_resume(dev, 0); #endif /* BCMSDIO */ #ifdef BCMPCIE ret = dhd_net_bus_devreset(dev, FALSE); #endif /* BCMPCIE */ if (ret == 0) break; DHD_ERROR(("\nfailed to power up wifi chip, retry again (%d left) **\n\n", retry)); #ifdef BCMPCIE dhd_net_bus_devreset(dev, TRUE); #endif /* BCMPCIE */ dhd_net_wifi_platform_set_power(dev, FALSE, WIFI_TURNOFF_DELAY); } while (retry-- > 0); if (ret != 0) { DHD_ERROR(("\nfailed to power up wifi chip, max retry reached **\n\n")); goto exit; } #ifdef BCMSDIO ret = dhd_net_bus_devreset(dev, FALSE); dhd_net_bus_resume(dev, 1); #endif /* BCMSDIO */ #ifndef BCMPCIE if (!ret) { if (dhd_dev_init_ioctl(dev) < 0) ret = -EFAULT; } #endif /* !BCMPCIE */ g_wifi_on = TRUE; } exit: dhd_net_if_unlock(dev); return ret; } int wl_android_wifi_off(struct net_device *dev) { int ret = 0; DHD_ERROR(("%s in\n", __FUNCTION__)); if (!dev) { DHD_TRACE(("%s: dev is null\n", __FUNCTION__)); return -EINVAL; } dhd_net_if_lock(dev); if (g_wifi_on) { #if defined(BCMSDIO) || defined(BCMPCIE) ret = dhd_net_bus_devreset(dev, TRUE); #ifdef BCMSDIO dhd_net_bus_suspend(dev); #endif /* BCMSDIO */ #endif /* BCMSDIO || BCMPCIE */ dhd_net_wifi_platform_set_power(dev, FALSE, WIFI_TURNOFF_DELAY); g_wifi_on = FALSE; } dhd_net_if_unlock(dev); return ret; } static int wl_android_set_fwpath(struct net_device *net, char *command, int total_len) { if ((strlen(command) - strlen(CMD_SETFWPATH)) > MOD_PARAM_PATHLEN) return -1; return dhd_net_set_fw_path(net, command + strlen(CMD_SETFWPATH) + 1); } #ifdef CONNECTION_STATISTICS static int wl_chanim_stats(struct net_device *dev, u8 *chan_idle) { int err; wl_chanim_stats_t *list; /* Parameter _and_ returned buffer of chanim_stats. */ wl_chanim_stats_t param; u8 result[WLC_IOCTL_SMLEN]; chanim_stats_t *stats; memset(&param, 0, sizeof(param)); memset(result, 0, sizeof(result)); param.buflen = htod32(sizeof(wl_chanim_stats_t)); param.count = htod32(WL_CHANIM_COUNT_ONE); if ((err = wldev_iovar_getbuf(dev, "chanim_stats", (char*)&param, sizeof(wl_chanim_stats_t), (char*)result, sizeof(result), 0)) < 0) { WL_ERR(("Failed to get chanim results %d \n", err)); return err; } list = (wl_chanim_stats_t*)result; list->buflen = dtoh32(list->buflen); list->version = dtoh32(list->version); list->count = dtoh32(list->count); if (list->buflen == 0) { list->version = 0; list->count = 0; } else if (list->version != WL_CHANIM_STATS_VERSION) { WL_ERR(("Sorry, firmware has wl_chanim_stats version %d " "but driver supports only version %d.\n", list->version, WL_CHANIM_STATS_VERSION)); list->buflen = 0; list->count = 0; } stats = list->stats; stats->glitchcnt = dtoh32(stats->glitchcnt); stats->badplcp = dtoh32(stats->badplcp); stats->chanspec = dtoh16(stats->chanspec); stats->timestamp = dtoh32(stats->timestamp); stats->chan_idle = dtoh32(stats->chan_idle); WL_INFORM(("chanspec: 0x%4x glitch: %d badplcp: %d idle: %d timestamp: %d\n", stats->chanspec, stats->glitchcnt, stats->badplcp, stats->chan_idle, stats->timestamp)); *chan_idle = stats->chan_idle; return (err); } static int wl_android_get_connection_stats(struct net_device *dev, char *command, int total_len) { wl_cnt_t* cnt = NULL; int link_speed = 0; struct connection_stats *output; unsigned int bufsize = 0; int bytes_written = 0; int ret = 0; WL_INFORM(("%s: enter Get Connection Stats\n", __FUNCTION__)); if (total_len <= 0) { WL_ERR(("%s: invalid buffer size %d\n", __FUNCTION__, total_len)); goto error; } bufsize = total_len; if (bufsize < sizeof(struct connection_stats)) { WL_ERR(("%s: not enough buffer size, provided=%u, requires=%u\n", __FUNCTION__, bufsize, sizeof(struct connection_stats))); goto error; } if ((cnt = kmalloc(sizeof(*cnt), GFP_KERNEL)) == NULL) { WL_ERR(("kmalloc failed\n")); return -1; } memset(cnt, 0, sizeof(*cnt)); ret = wldev_iovar_getbuf(dev, "counters", NULL, 0, (char *)cnt, sizeof(wl_cnt_t), NULL); if (ret) { WL_ERR(("%s: wldev_iovar_getbuf() failed, ret=%d\n", __FUNCTION__, ret)); goto error; } if (dtoh16(cnt->version) > WL_CNT_T_VERSION) { WL_ERR(("%s: incorrect version of wl_cnt_t, expected=%u got=%u\n", __FUNCTION__, WL_CNT_T_VERSION, cnt->version)); goto error; } /* link_speed is in kbps */ ret = wldev_get_link_speed(dev, &link_speed); if (ret || link_speed < 0) { WL_ERR(("%s: wldev_get_link_speed() failed, ret=%d, speed=%d\n", __FUNCTION__, ret, link_speed)); goto error; } output = (struct connection_stats *)command; output->txframe = dtoh32(cnt->txframe); output->txbyte = dtoh32(cnt->txbyte); output->txerror = dtoh32(cnt->txerror); output->rxframe = dtoh32(cnt->rxframe); output->rxbyte = dtoh32(cnt->rxbyte); output->txfail = dtoh32(cnt->txfail); output->txretry = dtoh32(cnt->txretry); output->txretrie = dtoh32(cnt->txretrie); output->txrts = dtoh32(cnt->txrts); output->txnocts = dtoh32(cnt->txnocts); output->txexptime = dtoh32(cnt->txexptime); output->txrate = link_speed; /* Channel idle ratio. */ if (wl_chanim_stats(dev, &(output->chan_idle)) < 0) { output->chan_idle = 0; }; kfree(cnt); bytes_written = sizeof(struct connection_stats); return bytes_written; error: if (cnt) { kfree(cnt); } return -1; } #endif /* CONNECTION_STATISTICS */ static int wl_android_set_pmk(struct net_device *dev, char *command, int total_len) { uchar pmk[33]; int error = 0; char smbuf[WLC_IOCTL_SMLEN]; #ifdef OKC_DEBUG int i = 0; #endif bzero(pmk, sizeof(pmk)); memcpy((char *)pmk, command + strlen("SET_PMK "), 32); error = wldev_iovar_setbuf(dev, "okc_info_pmk", pmk, 32, smbuf, sizeof(smbuf), NULL); if (error) { DHD_ERROR(("Failed to set PMK for OKC, error = %d\n", error)); } #ifdef OKC_DEBUG DHD_ERROR(("PMK is ")); for (i = 0; i < 32; i++) DHD_ERROR(("%02X ", pmk[i])); DHD_ERROR(("\n")); #endif return error; } static int wl_android_okc_enable(struct net_device *dev, char *command, int total_len) { int error = 0; char okc_enable = 0; okc_enable = command[strlen(CMD_OKC_ENABLE) + 1] - '0'; error = wldev_iovar_setint(dev, "okc_enable", okc_enable); if (error) { DHD_ERROR(("Failed to %s OKC, error = %d\n", okc_enable ? "enable" : "disable", error)); } wldev_iovar_setint(dev, "ccx_enable", 0); return error; } int wl_android_set_roam_mode(struct net_device *dev, char *command, int total_len) { int error = 0; int mode = 0; if (sscanf(command, "%*s %d", &mode) != 1) { DHD_ERROR(("%s: Failed to get Parameter\n", __FUNCTION__)); return -1; } error = wldev_iovar_setint(dev, "roam_off", mode); if (error) { DHD_ERROR(("%s: Failed to set roaming Mode %d, error = %d\n", __FUNCTION__, mode, error)); return -1; } else DHD_ERROR(("%s: succeeded to set roaming Mode %d, error = %d\n", __FUNCTION__, mode, error)); return 0; } int wl_android_set_ibss_beacon_ouidata(struct net_device *dev, char *command, int total_len) { char ie_buf[VNDR_IE_MAX_LEN]; char *ioctl_buf = NULL; char hex[] = "XX"; char *pcmd = NULL; int ielen = 0, datalen = 0, idx = 0, tot_len = 0; vndr_ie_setbuf_t *vndr_ie = NULL; s32 iecount; uint32 pktflag; u16 kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL; s32 err = BCME_OK; /* Check the VSIE (Vendor Specific IE) which was added. * If exist then send IOVAR to delete it */ if (wl_cfg80211_ibss_vsie_delete(dev) != BCME_OK) { return -EINVAL; } pcmd = command + strlen(CMD_SETIBSSBEACONOUIDATA) + 1; for (idx = 0; idx < DOT11_OUI_LEN; idx++) { hex[0] = *pcmd++; hex[1] = *pcmd++; ie_buf[idx] = (uint8)simple_strtoul(hex, NULL, 16); } pcmd++; while ((*pcmd != '\0') && (idx < VNDR_IE_MAX_LEN)) { hex[0] = *pcmd++; hex[1] = *pcmd++; ie_buf[idx++] = (uint8)simple_strtoul(hex, NULL, 16); datalen++; } tot_len = sizeof(vndr_ie_setbuf_t) + (datalen - 1); vndr_ie = (vndr_ie_setbuf_t *) kzalloc(tot_len, kflags); if (!vndr_ie) { WL_ERR(("IE memory alloc failed\n")); return -ENOMEM; } /* Copy the vndr_ie SET command ("add"/"del") to the buffer */ strncpy(vndr_ie->cmd, "add", VNDR_IE_CMD_LEN - 1); vndr_ie->cmd[VNDR_IE_CMD_LEN - 1] = '\0'; /* Set the IE count - the buffer contains only 1 IE */ iecount = htod32(1); memcpy((void *)&vndr_ie->vndr_ie_buffer.iecount, &iecount, sizeof(s32)); /* Set packet flag to indicate that BEACON's will contain this IE */ pktflag = htod32(VNDR_IE_BEACON_FLAG | VNDR_IE_PRBRSP_FLAG); memcpy((void *)&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].pktflag, &pktflag, sizeof(u32)); /* Set the IE ID */ vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.id = (uchar) DOT11_MNG_PROPR_ID; memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.oui, &ie_buf, DOT11_OUI_LEN); memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.data, &ie_buf[DOT11_OUI_LEN], datalen); ielen = DOT11_OUI_LEN + datalen; vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.len = (uchar) ielen; ioctl_buf = kmalloc(WLC_IOCTL_MEDLEN, GFP_KERNEL); if (!ioctl_buf) { WL_ERR(("ioctl memory alloc failed\n")); if (vndr_ie) { kfree(vndr_ie); } return -ENOMEM; } memset(ioctl_buf, 0, WLC_IOCTL_MEDLEN); /* init the buffer */ err = wldev_iovar_setbuf(dev, "ie", vndr_ie, tot_len, ioctl_buf, WLC_IOCTL_MEDLEN, NULL); if (err != BCME_OK) { err = -EINVAL; if (vndr_ie) { kfree(vndr_ie); } } else { /* do NOT free 'vndr_ie' for the next process */ wl_cfg80211_ibss_vsie_set_buffer(vndr_ie, tot_len); } if (ioctl_buf) { kfree(ioctl_buf); } return err; } #if defined(BCMFW_ROAM_ENABLE) static int wl_android_set_roampref(struct net_device *dev, char *command, int total_len) { int error = 0; char smbuf[WLC_IOCTL_SMLEN]; uint8 buf[MAX_BUF_SIZE]; uint8 *pref = buf; char *pcmd; int num_ucipher_suites = 0; int num_akm_suites = 0; wpa_suite_t ucipher_suites[MAX_NUM_SUITES]; wpa_suite_t akm_suites[MAX_NUM_SUITES]; int num_tuples = 0; int total_bytes = 0; int total_len_left; int i, j; char hex[] = "XX"; pcmd = command + strlen(CMD_SET_ROAMPREF) + 1; total_len_left = total_len - strlen(CMD_SET_ROAMPREF) + 1; num_akm_suites = simple_strtoul(pcmd, NULL, 16); /* Increment for number of AKM suites field + space */ pcmd += 3; total_len_left -= 3; /* check to make sure pcmd does not overrun */ if (total_len_left < (num_akm_suites * WIDTH_AKM_SUITE)) return -1; memset(buf, 0, sizeof(buf)); memset(akm_suites, 0, sizeof(akm_suites)); memset(ucipher_suites, 0, sizeof(ucipher_suites)); /* Save the AKM suites passed in the command */ for (i = 0; i < num_akm_suites; i++) { /* Store the MSB first, as required by join_pref */ for (j = 0; j < 4; j++) { hex[0] = *pcmd++; hex[1] = *pcmd++; buf[j] = (uint8)simple_strtoul(hex, NULL, 16); } memcpy((uint8 *)&akm_suites[i], buf, sizeof(uint32)); } total_len_left -= (num_akm_suites * WIDTH_AKM_SUITE); num_ucipher_suites = simple_strtoul(pcmd, NULL, 16); /* Increment for number of cipher suites field + space */ pcmd += 3; total_len_left -= 3; if (total_len_left < (num_ucipher_suites * WIDTH_AKM_SUITE)) return -1; /* Save the cipher suites passed in the command */ for (i = 0; i < num_ucipher_suites; i++) { /* Store the MSB first, as required by join_pref */ for (j = 0; j < 4; j++) { hex[0] = *pcmd++; hex[1] = *pcmd++; buf[j] = (uint8)simple_strtoul(hex, NULL, 16); } memcpy((uint8 *)&ucipher_suites[i], buf, sizeof(uint32)); } /* Join preference for RSSI * Type : 1 byte (0x01) * Length : 1 byte (0x02) * Value : 2 bytes (reserved) */ *pref++ = WL_JOIN_PREF_RSSI; *pref++ = JOIN_PREF_RSSI_LEN; *pref++ = 0; *pref++ = 0; /* Join preference for WPA * Type : 1 byte (0x02) * Length : 1 byte (not used) * Value : (variable length) * reserved: 1 byte * count : 1 byte (no of tuples) * Tuple1 : 12 bytes * akm[4] * ucipher[4] * mcipher[4] * Tuple2 : 12 bytes * Tuplen : 12 bytes */ num_tuples = num_akm_suites * num_ucipher_suites; if (num_tuples != 0) { if (num_tuples <= JOIN_PREF_MAX_WPA_TUPLES) { *pref++ = WL_JOIN_PREF_WPA; *pref++ = 0; *pref++ = 0; *pref++ = (uint8)num_tuples; total_bytes = JOIN_PREF_RSSI_SIZE + JOIN_PREF_WPA_HDR_SIZE + (JOIN_PREF_WPA_TUPLE_SIZE * num_tuples); } else { DHD_ERROR(("%s: Too many wpa configs for join_pref \n", __FUNCTION__)); return -1; } } else { /* No WPA config, configure only RSSI preference */ total_bytes = JOIN_PREF_RSSI_SIZE; } /* akm-ucipher-mcipher tuples in the format required for join_pref */ for (i = 0; i < num_ucipher_suites; i++) { for (j = 0; j < num_akm_suites; j++) { memcpy(pref, (uint8 *)&akm_suites[j], WPA_SUITE_LEN); pref += WPA_SUITE_LEN; memcpy(pref, (uint8 *)&ucipher_suites[i], WPA_SUITE_LEN); pref += WPA_SUITE_LEN; /* Set to 0 to match any available multicast cipher */ memset(pref, 0, WPA_SUITE_LEN); pref += WPA_SUITE_LEN; } } prhex("join pref", (uint8 *)buf, total_bytes); error = wldev_iovar_setbuf(dev, "join_pref", buf, total_bytes, smbuf, sizeof(smbuf), NULL); if (error) { DHD_ERROR(("Failed to set join_pref, error = %d\n", error)); } return error; } #endif /* defined(BCMFW_ROAM_ENABLE */ static int wl_android_iolist_add(struct net_device *dev, struct list_head *head, struct io_cfg *config) { struct io_cfg *resume_cfg; s32 ret; resume_cfg = kzalloc(sizeof(struct io_cfg), GFP_KERNEL); if (!resume_cfg) return -ENOMEM; if (config->iovar) { ret = wldev_iovar_getint(dev, config->iovar, &resume_cfg->param); if (ret) { DHD_ERROR(("%s: Failed to get current %s value\n", __FUNCTION__, config->iovar)); goto error; } ret = wldev_iovar_setint(dev, config->iovar, config->param); if (ret) { DHD_ERROR(("%s: Failed to set %s to %d\n", __FUNCTION__, config->iovar, config->param)); goto error; } resume_cfg->iovar = config->iovar; } else { resume_cfg->arg = kzalloc(config->len, GFP_KERNEL); if (!resume_cfg->arg) { ret = -ENOMEM; goto error; } ret = wldev_ioctl(dev, config->ioctl, resume_cfg->arg, config->len, false); if (ret) { DHD_ERROR(("%s: Failed to get ioctl %d\n", __FUNCTION__, config->ioctl)); goto error; } ret = wldev_ioctl(dev, config->ioctl + 1, config->arg, config->len, true); if (ret) { DHD_ERROR(("%s: Failed to set %s to %d\n", __FUNCTION__, config->iovar, config->param)); goto error; } if (config->ioctl + 1 == WLC_SET_PM) wl_cfg80211_update_power_mode(dev); resume_cfg->ioctl = config->ioctl; resume_cfg->len = config->len; } list_add(&resume_cfg->list, head); return 0; error: kfree(resume_cfg->arg); kfree(resume_cfg); return ret; } static void wl_android_iolist_resume(struct net_device *dev, struct list_head *head) { struct io_cfg *config; struct list_head *cur, *q; s32 ret = 0; list_for_each_safe(cur, q, head) { config = list_entry(cur, struct io_cfg, list); if (config->iovar) { if (!ret) ret = wldev_iovar_setint(dev, config->iovar, config->param); } else { if (!ret) ret = wldev_ioctl(dev, config->ioctl + 1, config->arg, config->len, true); if (config->ioctl + 1 == WLC_SET_PM) wl_cfg80211_update_power_mode(dev); kfree(config->arg); } list_del(cur); kfree(config); } } static int wl_android_set_miracast(struct net_device *dev, char *command, int total_len) { int mode, val; int ret = 0; struct io_cfg config; if (sscanf(command, "%*s %d", &mode) != 1) { DHD_ERROR(("%s: Failed to get Parameter\n", __FUNCTION__)); return -1; } DHD_INFO(("%s: enter miracast mode %d\n", __FUNCTION__, mode)); if (miracast_cur_mode == mode) return 0; wl_android_iolist_resume(dev, &miracast_resume_list); miracast_cur_mode = MIRACAST_MODE_OFF; switch (mode) { case MIRACAST_MODE_SOURCE: /* setting mchan_algo to platform specific value */ config.iovar = "mchan_algo"; ret = wldev_ioctl(dev, WLC_GET_BCNPRD, &val, sizeof(int), false); if (!ret && val > 100) { config.param = 0; DHD_ERROR(("%s: Connected station's beacon interval: " "%d and set mchan_algo to %d \n", __FUNCTION__, val, config.param)); } else { config.param = MIRACAST_MCHAN_ALGO; } ret = wl_android_iolist_add(dev, &miracast_resume_list, &config); if (ret) goto resume; /* setting mchan_bw to platform specific value */ config.iovar = "mchan_bw"; config.param = MIRACAST_MCHAN_BW; ret = wl_android_iolist_add(dev, &miracast_resume_list, &config); if (ret) goto resume; /* setting apmdu to platform specific value */ config.iovar = "ampdu_mpdu"; config.param = MIRACAST_AMPDU_SIZE; ret = wl_android_iolist_add(dev, &miracast_resume_list, &config); if (ret) goto resume; /* FALLTROUGH */ /* Source mode shares most configurations with sink mode. * Fall through here to avoid code duplication */ case MIRACAST_MODE_SINK: /* disable internal roaming */ config.iovar = "roam_off"; config.param = 1; ret = wl_android_iolist_add(dev, &miracast_resume_list, &config); if (ret) goto resume; /* tunr off pm */ val = 0; config.iovar = NULL; config.ioctl = WLC_GET_PM; config.arg = &val; config.len = sizeof(int); ret = wl_android_iolist_add(dev, &miracast_resume_list, &config); if (ret) goto resume; break; case MIRACAST_MODE_OFF: default: break; } miracast_cur_mode = mode; return 0; resume: DHD_ERROR(("%s: turnoff miracast mode because of err%d\n", __FUNCTION__, ret)); wl_android_iolist_resume(dev, &miracast_resume_list); return ret; } #define NETLINK_OXYGEN 30 #define AIBSS_BEACON_TIMEOUT 10 static struct sock *nl_sk = NULL; static void wl_netlink_recv(struct sk_buff *skb) { WL_ERR(("netlink_recv called\n")); } static int wl_netlink_init(void) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) struct netlink_kernel_cfg cfg = { .input = wl_netlink_recv, }; #endif if (nl_sk != NULL) { WL_ERR(("nl_sk already exist\n")); return BCME_ERROR; } #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)) nl_sk = netlink_kernel_create(&init_net, NETLINK_OXYGEN, 0, wl_netlink_recv, NULL, THIS_MODULE); #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)) nl_sk = netlink_kernel_create(&init_net, NETLINK_OXYGEN, THIS_MODULE, &cfg); #else nl_sk = netlink_kernel_create(&init_net, NETLINK_OXYGEN, &cfg); #endif if (nl_sk == NULL) { WL_ERR(("nl_sk is not ready\n")); return BCME_ERROR; } return BCME_OK; } static void wl_netlink_deinit(void) { if (nl_sk) { netlink_kernel_release(nl_sk); nl_sk = NULL; } } s32 wl_netlink_send_msg(int pid, int type, int seq, void *data, size_t size) { struct sk_buff *skb = NULL; struct nlmsghdr *nlh = NULL; int ret = -1; if (nl_sk == NULL) { WL_ERR(("nl_sk was not initialized\n")); goto nlmsg_failure; } skb = alloc_skb(NLMSG_SPACE(size), GFP_ATOMIC); if (skb == NULL) { WL_ERR(("failed to allocate memory\n")); goto nlmsg_failure; } nlh = nlmsg_put(skb, 0, 0, 0, size, 0); if (nlh == NULL) { WL_ERR(("failed to build nlmsg, skb_tailroom:%d, nlmsg_total_size:%d\n", skb_tailroom(skb), nlmsg_total_size(size))); dev_kfree_skb(skb); goto nlmsg_failure; } memcpy(nlmsg_data(nlh), data, size); nlh->nlmsg_seq = seq; nlh->nlmsg_type = type; /* netlink_unicast() takes ownership of the skb and frees it itself. */ ret = netlink_unicast(nl_sk, skb, pid, 0); WL_DBG(("netlink_unicast() pid=%d, ret=%d\n", pid, ret)); nlmsg_failure: return ret; } #ifdef WLAIBSS static int wl_android_set_ibss_txfail_event(struct net_device *dev, char *command, int total_len) { int err = 0; int retry = 0; int pid = 0; aibss_txfail_config_t txfail_config = {0, 0, 0, 0}; char smbuf[WLC_IOCTL_SMLEN]; if (sscanf(command, CMD_SETIBSSTXFAILEVENT " %d %d", &retry, &pid) <= 0) { WL_ERR(("Failed to get Parameter from : %s\n", command)); return -1; } /* set pid, and if the event was happened, let's send a notification through netlink */ wl_cfg80211_set_txfail_pid(pid); /* If retry value is 0, it disables the functionality for TX Fail. */ if (retry > 0) { txfail_config.max_tx_retry = retry; txfail_config.bcn_timeout = 0; /* 0 : disable tx fail from beacon */ } txfail_config.version = AIBSS_TXFAIL_CONFIG_VER_0; txfail_config.len = sizeof(txfail_config); err = wldev_iovar_setbuf(dev, "aibss_txfail_config", (void *) &txfail_config, sizeof(aibss_txfail_config_t), smbuf, WLC_IOCTL_SMLEN, NULL); WL_DBG(("retry=%d, pid=%d, err=%d\n", retry, pid, err)); return ((err == 0)?total_len:err); } static int wl_android_get_ibss_peer_info(struct net_device *dev, char *command, int total_len, bool bAll) { int error; int bytes_written = 0; void *buf = NULL; bss_peer_list_info_t peer_list_info; bss_peer_info_t *peer_info; int i; bool found = false; struct ether_addr mac_ea; WL_DBG(("get ibss peer info(%s)\n", bAll?"true":"false")); if (!bAll) { if (sscanf (command, "GETIBSSPEERINFO %02x:%02x:%02x:%02x:%02x:%02x", (unsigned int *)&mac_ea.octet[0], (unsigned int *)&mac_ea.octet[1], (unsigned int *)&mac_ea.octet[2], (unsigned int *)&mac_ea.octet[3], (unsigned int *)&mac_ea.octet[4], (unsigned int *)&mac_ea.octet[5]) != 6) { WL_DBG(("invalid MAC address\n")); return -1; } } if ((buf = kmalloc(WLC_IOCTL_MAXLEN, GFP_KERNEL)) == NULL) { WL_ERR(("kmalloc failed\n")); return -1; } error = wldev_iovar_getbuf(dev, "bss_peer_info", NULL, 0, buf, WLC_IOCTL_MAXLEN, NULL); if (unlikely(error)) { WL_ERR(("could not get ibss peer info (%d)\n", error)); kfree(buf); return -1; } memcpy(&peer_list_info, buf, sizeof(peer_list_info)); peer_list_info.version = htod16(peer_list_info.version); peer_list_info.bss_peer_info_len = htod16(peer_list_info.bss_peer_info_len); peer_list_info.count = htod32(peer_list_info.count); WL_DBG(("ver:%d, len:%d, count:%d\n", peer_list_info.version, peer_list_info.bss_peer_info_len, peer_list_info.count)); if (peer_list_info.count > 0) { if (bAll) bytes_written += sprintf(&command[bytes_written], "%u ", peer_list_info.count); peer_info = (bss_peer_info_t *) ((void *)buf + BSS_PEER_LIST_INFO_FIXED_LEN); for (i = 0; i < peer_list_info.count; i++) { WL_DBG(("index:%d rssi:%d, tx:%u, rx:%u\n", i, peer_info->rssi, peer_info->tx_rate, peer_info->rx_rate)); if (!bAll && memcmp(&mac_ea, &peer_info->ea, sizeof(struct ether_addr)) == 0) { found = true; } if (bAll || found) { bytes_written += sprintf(&command[bytes_written], MACF, ETHER_TO_MACF(peer_info->ea)); bytes_written += sprintf(&command[bytes_written], " %u %d ", peer_info->tx_rate/1000, peer_info->rssi); } if (found) break; peer_info = (bss_peer_info_t *)((void *)peer_info+sizeof(bss_peer_info_t)); } } else { WL_ERR(("could not get ibss peer info : no item\n")); } bytes_written += sprintf(&command[bytes_written], "%s", "\0"); WL_DBG(("command(%u):%s\n", total_len, command)); WL_DBG(("bytes_written:%d\n", bytes_written)); kfree(buf); return bytes_written; } int wl_android_set_ibss_routetable(struct net_device *dev, char *command, int total_len) { char *pcmd = command; char *str = NULL; ibss_route_tbl_t *route_tbl = NULL; char *ioctl_buf = NULL; u16 kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL; s32 err = BCME_OK; uint32 route_tbl_len; uint32 entries; char *endptr; uint32 i = 0; struct ipv4_addr dipaddr; struct ether_addr ea; route_tbl_len = sizeof(ibss_route_tbl_t) + (MAX_IBSS_ROUTE_TBL_ENTRY - 1) * sizeof(ibss_route_entry_t); route_tbl = (ibss_route_tbl_t *)kzalloc(route_tbl_len, kflags); if (!route_tbl) { WL_ERR(("Route TBL alloc failed\n")); return -ENOMEM; } ioctl_buf = kzalloc(WLC_IOCTL_MEDLEN, GFP_KERNEL); if (!ioctl_buf) { WL_ERR(("ioctl memory alloc failed\n")); if (route_tbl) { kfree(route_tbl); } return -ENOMEM; } memset(ioctl_buf, 0, WLC_IOCTL_MEDLEN); /* drop command */ str = bcmstrtok(&pcmd, " ", NULL); /* get count */ str = bcmstrtok(&pcmd, " ", NULL); if (!str) { WL_ERR(("Invalid number parameter %s\n", str)); err = -EINVAL; goto exit; } entries = bcm_strtoul(str, &endptr, 0); if (*endptr != '\0') { WL_ERR(("Invalid number parameter %s\n", str)); err = -EINVAL; goto exit; } WL_INFORM(("Routing table count:%d\n", entries)); route_tbl->num_entry = entries; for (i = 0; i < entries; i++) { str = bcmstrtok(&pcmd, " ", NULL); if (!str || !bcm_atoipv4(str, &dipaddr)) { WL_ERR(("Invalid ip string %s\n", str)); err = -EINVAL; goto exit; } str = bcmstrtok(&pcmd, " ", NULL); if (!str || !bcm_ether_atoe(str, &ea)) { WL_ERR(("Invalid ethernet string %s\n", str)); err = -EINVAL; goto exit; } bcopy(&dipaddr, &route_tbl->route_entry[i].ipv4_addr, IPV4_ADDR_LEN); bcopy(&ea, &route_tbl->route_entry[i].nexthop, ETHER_ADDR_LEN); } route_tbl_len = sizeof(ibss_route_tbl_t) + ((!entries?0:(entries - 1)) * sizeof(ibss_route_entry_t)); err = wldev_iovar_setbuf(dev, "ibss_route_tbl", route_tbl, route_tbl_len, ioctl_buf, WLC_IOCTL_MEDLEN, NULL); if (err != BCME_OK) { WL_ERR(("Fail to set iovar %d\n", err)); err = -EINVAL; } exit: if (route_tbl) kfree(route_tbl); if (ioctl_buf) kfree(ioctl_buf); return err; } int wl_android_set_ibss_ampdu(struct net_device *dev, char *command, int total_len) { char *pcmd = command; char *str = NULL, *endptr = NULL; struct ampdu_aggr aggr; char smbuf[WLC_IOCTL_SMLEN]; int idx; int err = 0; int wme_AC2PRIO[AC_COUNT][2] = { {PRIO_8021D_VO, PRIO_8021D_NC}, /* AC_VO - 3 */ {PRIO_8021D_CL, PRIO_8021D_VI}, /* AC_VI - 2 */ {PRIO_8021D_BK, PRIO_8021D_NONE}, /* AC_BK - 1 */ {PRIO_8021D_BE, PRIO_8021D_EE}}; /* AC_BE - 0 */ WL_DBG(("set ibss ampdu:%s\n", command)); memset(&aggr, 0, sizeof(aggr)); /* Cofigure all priorities */ aggr.conf_TID_bmap = NBITMASK(NUMPRIO); /* acquire parameters */ /* drop command */ str = bcmstrtok(&pcmd, " ", NULL); for (idx = 0; idx < AC_COUNT; idx++) { bool on; str = bcmstrtok(&pcmd, " ", NULL); if (!str) { WL_ERR(("Invalid parameter : %s\n", pcmd)); return -EINVAL; } on = bcm_strtoul(str, &endptr, 0) ? TRUE : FALSE; if (*endptr != '\0') { WL_ERR(("Invalid number format %s\n", str)); return -EINVAL; } if (on) { setbit(&aggr.enab_TID_bmap, wme_AC2PRIO[idx][0]); setbit(&aggr.enab_TID_bmap, wme_AC2PRIO[idx][1]); } } err = wldev_iovar_setbuf(dev, "ampdu_txaggr", (void *)&aggr, sizeof(aggr), smbuf, WLC_IOCTL_SMLEN, NULL); return ((err == 0) ? total_len : err); } int wl_android_set_ibss_antenna(struct net_device *dev, char *command, int total_len) { char *pcmd = command; char *str = NULL; int txchain, rxchain; int err = 0; WL_DBG(("set ibss antenna:%s\n", command)); /* acquire parameters */ /* drop command */ str = bcmstrtok(&pcmd, " ", NULL); /* TX chain */ str = bcmstrtok(&pcmd, " ", NULL); if (!str) { WL_ERR(("Invalid parameter : %s\n", pcmd)); return -EINVAL; } txchain = bcm_atoi(str); /* RX chain */ str = bcmstrtok(&pcmd, " ", NULL); if (!str) { WL_ERR(("Invalid parameter : %s\n", pcmd)); return -EINVAL; } rxchain = bcm_atoi(str); err = wldev_iovar_setint(dev, "txchain", txchain); if (err != 0) return err; err = wldev_iovar_setint(dev, "rxchain", rxchain); return ((err == 0)?total_len:err); } #endif /* WLAIBSS */ int wl_keep_alive_set(struct net_device *dev, char* extra, int total_len) { char buf[256]; const char *str; wl_mkeep_alive_pkt_t mkeep_alive_pkt; wl_mkeep_alive_pkt_t *mkeep_alive_pktp; int buf_len; int str_len; int res = -1; uint period_msec = 0; if (extra == NULL) { DHD_ERROR(("%s: extra is NULL\n", __FUNCTION__)); return -1; } if (sscanf(extra, "%d", &period_msec) != 1) { DHD_ERROR(("%s: sscanf error. check period_msec value\n", __FUNCTION__)); return -EINVAL; } DHD_ERROR(("%s: period_msec is %d\n", __FUNCTION__, period_msec)); memset(&mkeep_alive_pkt, 0, sizeof(wl_mkeep_alive_pkt_t)); str = "mkeep_alive"; str_len = strlen(str); strncpy(buf, str, str_len); buf[ str_len ] = '\0'; mkeep_alive_pktp = (wl_mkeep_alive_pkt_t *) (buf + str_len + 1); mkeep_alive_pkt.period_msec = period_msec; buf_len = str_len + 1; mkeep_alive_pkt.version = htod16(WL_MKEEP_ALIVE_VERSION); mkeep_alive_pkt.length = htod16(WL_MKEEP_ALIVE_FIXED_LEN); /* Setup keep alive zero for null packet generation */ mkeep_alive_pkt.keep_alive_id = 0; mkeep_alive_pkt.len_bytes = 0; buf_len += WL_MKEEP_ALIVE_FIXED_LEN; /* Keep-alive attributes are set in local variable (mkeep_alive_pkt), and * then memcpy'ed into buffer (mkeep_alive_pktp) since there is no * guarantee that the buffer is properly aligned. */ memcpy((char *)mkeep_alive_pktp, &mkeep_alive_pkt, WL_MKEEP_ALIVE_FIXED_LEN); if ((res = wldev_ioctl(dev, WLC_SET_VAR, buf, buf_len, TRUE)) < 0) { DHD_ERROR(("%s:keep_alive set failed. res[%d]\n", __FUNCTION__, res)); } else { DHD_ERROR(("%s:keep_alive set ok. res[%d]\n", __FUNCTION__, res)); } return res; } static const char * get_string_by_separator(char *result, int result_len, const char *src, char separator) { char *end = result + result_len - 1; while ((result != end) && (*src != separator) && (*src)) { *result++ = *src++; } *result = 0; if (*src == separator) ++src; return src; } int wl_android_set_roam_offload_bssid_list(struct net_device *dev, const char *cmd) { char sbuf[32]; int i, cnt, size, err, ioctl_buf_len; roamoffl_bssid_list_t *bssid_list; const char *str = cmd; char *ioctl_buf; str = get_string_by_separator(sbuf, 32, str, ','); cnt = bcm_atoi(sbuf); cnt = MIN(cnt, MAX_ROAMOFFL_BSSID_NUM); size = sizeof(int) + sizeof(struct ether_addr) * cnt; WL_ERR(("ROAM OFFLOAD BSSID LIST %d BSSIDs, size %d\n", cnt, size)); bssid_list = kmalloc(size, GFP_KERNEL); if (bssid_list == NULL) { WL_ERR(("%s: memory alloc for bssid list(%d) failed\n", __FUNCTION__, size)); return -ENOMEM; } ioctl_buf_len = size + 64; ioctl_buf = kmalloc(ioctl_buf_len, GFP_KERNEL); if (ioctl_buf == NULL) { WL_ERR(("%s: memory alloc for ioctl_buf(%d) failed\n", __FUNCTION__, ioctl_buf_len)); kfree(bssid_list); return -ENOMEM; } for (i = 0; i < cnt; i++) { str = get_string_by_separator(sbuf, 32, str, ','); if (bcm_ether_atoe(sbuf, &bssid_list->bssid[i]) == 0) { DHD_ERROR(("%s: Invalid station MAC Address!!!\n", __FUNCTION__)); kfree(bssid_list); kfree(ioctl_buf); return -1; } } bssid_list->cnt = cnt; err = wldev_iovar_setbuf(dev, "roamoffl_bssid_list", bssid_list, size, ioctl_buf, ioctl_buf_len, NULL); kfree(bssid_list); kfree(ioctl_buf); return err; } #ifdef P2PRESP_WFDIE_SRC static int wl_android_get_wfdie_resp(struct net_device *dev, char *command, int total_len) { int error = 0; int bytes_written = 0; int only_resp_wfdsrc = 0; error = wldev_iovar_getint(dev, "p2p_only_resp_wfdsrc", &only_resp_wfdsrc); if (error) { DHD_ERROR(("%s: Failed to get the mode for only_resp_wfdsrc, error = %d\n", __FUNCTION__, error)); return -1; } bytes_written = snprintf(command, total_len, "%s %d", CMD_P2P_GET_WFDIE_RESP, only_resp_wfdsrc); return bytes_written; } static int wl_android_set_wfdie_resp(struct net_device *dev, int only_resp_wfdsrc) { int error = 0; error = wldev_iovar_setint(dev, "p2p_only_resp_wfdsrc", only_resp_wfdsrc); if (error) { DHD_ERROR(("%s: Failed to set only_resp_wfdsrc %d, error = %d\n", __FUNCTION__, only_resp_wfdsrc, error)); return -1; } return 0; } #endif /* P2PRESP_WFDIE_SRC */ static int wl_android_get_link_status(struct net_device *dev, char *command, int total_len) { int bytes_written, error, result = 0, single_stream, stf = -1, i, nss = 0, mcs_map; uint32 rspec; uint encode, rate, txexp; struct wl_bss_info *bi; int datalen = sizeof(uint32) + sizeof(wl_bss_info_t); char buf[datalen]; /* get BSS information */ *(u32 *) buf = htod32(datalen); error = wldev_ioctl(dev, WLC_GET_BSS_INFO, (void *)buf, datalen, false); if (unlikely(error)) { WL_ERR(("Could not get bss info %d\n", error)); return -1; } bi = (struct wl_bss_info *) (buf + sizeof(uint32)); for (i = 0; i < ETHER_ADDR_LEN; i++) { if (bi->BSSID.octet[i] > 0) { break; } } if (i == ETHER_ADDR_LEN) { WL_DBG(("No BSSID\n")); return -1; } /* check VHT capability at beacon */ if (bi->vht_cap) { if (CHSPEC_IS5G(bi->chanspec)) { result |= WL_ANDROID_LINK_AP_VHT_SUPPORT; } } /* get a rspec (radio spectrum) rate */ error = wldev_iovar_getint(dev, "nrate", &rspec); if (unlikely(error) || rspec == 0) { WL_ERR(("get link status error (%d)\n", error)); return -1; } encode = (rspec & WL_RSPEC_ENCODING_MASK); rate = (rspec & WL_RSPEC_RATE_MASK); txexp = (rspec & WL_RSPEC_TXEXP_MASK) >> WL_RSPEC_TXEXP_SHIFT; switch (encode) { case WL_RSPEC_ENCODE_HT: /* check Rx MCS Map for HT */ for (i = 0; i < MAX_STREAMS_SUPPORTED; i++) { int8 bitmap = 0xFF; if (i == MAX_STREAMS_SUPPORTED-1) { bitmap = 0x7F; } if (bi->basic_mcs[i] & bitmap) { nss++; } } break; case WL_RSPEC_ENCODE_VHT: /* check Rx MCS Map for VHT */ for (i = 1; i <= VHT_CAP_MCS_MAP_NSS_MAX; i++) { mcs_map = VHT_MCS_MAP_GET_MCS_PER_SS(i, dtoh16(bi->vht_rxmcsmap)); if (mcs_map != VHT_CAP_MCS_MAP_NONE) { nss++; } } break; } /* check MIMO capability with nss in beacon */ if (nss > 1) { result |= WL_ANDROID_LINK_AP_MIMO_SUPPORT; } single_stream = (encode == WL_RSPEC_ENCODE_RATE) || ((encode == WL_RSPEC_ENCODE_HT) && rate < 8) || ((encode == WL_RSPEC_ENCODE_VHT) && ((rspec & WL_RSPEC_VHT_NSS_MASK) >> WL_RSPEC_VHT_NSS_SHIFT) == 1); if (txexp == 0) { if ((rspec & WL_RSPEC_STBC) && single_stream) { stf = OLD_NRATE_STF_STBC; } else { stf = (single_stream) ? OLD_NRATE_STF_SISO : OLD_NRATE_STF_SDM; } } else if (txexp == 1 && single_stream) { stf = OLD_NRATE_STF_CDD; } /* check 11ac (VHT) */ if (encode == WL_RSPEC_ENCODE_VHT) { if (CHSPEC_IS5G(bi->chanspec)) { result |= WL_ANDROID_LINK_VHT; } } /* check MIMO */ if (result & WL_ANDROID_LINK_AP_MIMO_SUPPORT) { switch (stf) { case OLD_NRATE_STF_SISO: break; case OLD_NRATE_STF_CDD: case OLD_NRATE_STF_STBC: result |= WL_ANDROID_LINK_MIMO; break; case OLD_NRATE_STF_SDM: if (!single_stream) { result |= WL_ANDROID_LINK_MIMO; } break; } } WL_DBG(("%s:result=%d, stf=%d, single_stream=%d, mcs map=%d\n", __FUNCTION__, result, stf, single_stream, nss)); bytes_written = sprintf(command, "%s %d", CMD_GET_LINK_STATUS, result); return bytes_written; } int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) { #define PRIVATE_COMMAND_MAX_LEN 8192 int ret = 0; char *command = NULL; int bytes_written = 0; android_wifi_priv_cmd priv_cmd; net_os_wake_lock(net); if (!ifr->ifr_data) { ret = -EINVAL; goto exit; } #ifdef CONFIG_COMPAT if (is_compat_task()) { compat_android_wifi_priv_cmd compat_priv_cmd; if (copy_from_user(&compat_priv_cmd, ifr->ifr_data, sizeof(compat_android_wifi_priv_cmd))) { ret = -EFAULT; goto exit; } priv_cmd.buf = compat_ptr(compat_priv_cmd.buf); priv_cmd.used_len = compat_priv_cmd.used_len; priv_cmd.total_len = compat_priv_cmd.total_len; } else #endif /* CONFIG_COMPAT */ { if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) { ret = -EFAULT; goto exit; } } if ((priv_cmd.total_len > PRIVATE_COMMAND_MAX_LEN) || (priv_cmd.total_len < 0)) { DHD_ERROR(("%s: too long priavte command\n", __FUNCTION__)); ret = -EINVAL; goto exit; } command = kmalloc((priv_cmd.total_len + 1), GFP_KERNEL); if (!command) { DHD_ERROR(("%s: failed to allocate memory\n", __FUNCTION__)); ret = -ENOMEM; goto exit; } if (copy_from_user(command, priv_cmd.buf, priv_cmd.total_len)) { ret = -EFAULT; goto exit; } command[priv_cmd.total_len] = '\0'; DHD_INFO(("%s: Android private cmd \"%s\" on %s\n", __FUNCTION__, command, ifr->ifr_name)); if (strnicmp(command, CMD_START, strlen(CMD_START)) == 0) { DHD_INFO(("%s, Received regular START command\n", __FUNCTION__)); bytes_written = wl_android_wifi_on(net); } else if (strnicmp(command, CMD_SETFWPATH, strlen(CMD_SETFWPATH)) == 0) { bytes_written = wl_android_set_fwpath(net, command, priv_cmd.total_len); } if (!g_wifi_on) { DHD_ERROR(("%s: Ignore private cmd \"%s\" - iface %s is down\n", __FUNCTION__, command, ifr->ifr_name)); ret = 0; goto exit; } if (strnicmp(command, CMD_STOP, strlen(CMD_STOP)) == 0) { bytes_written = wl_android_wifi_off(net); } else if (strnicmp(command, CMD_SCAN_ACTIVE, strlen(CMD_SCAN_ACTIVE)) == 0) { /* TBD: SCAN-ACTIVE */ } else if (strnicmp(command, CMD_SCAN_PASSIVE, strlen(CMD_SCAN_PASSIVE)) == 0) { /* TBD: SCAN-PASSIVE */ } else if (strnicmp(command, CMD_RSSI, strlen(CMD_RSSI)) == 0) { bytes_written = wl_android_get_rssi(net, command, priv_cmd.total_len); } else if (strnicmp(command, CMD_LINKSPEED, strlen(CMD_LINKSPEED)) == 0) { bytes_written = wl_android_get_link_speed(net, command, priv_cmd.total_len); } #ifdef PKT_FILTER_SUPPORT else if (strnicmp(command, CMD_RXFILTER_START, strlen(CMD_RXFILTER_START)) == 0) { bytes_written = net_os_enable_packet_filter(net, 1); } else if (strnicmp(command, CMD_RXFILTER_STOP, strlen(CMD_RXFILTER_STOP)) == 0) { bytes_written = net_os_enable_packet_filter(net, 0); } else if (strnicmp(command, CMD_RXFILTER_ADD, strlen(CMD_RXFILTER_ADD)) == 0) { int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0'; bytes_written = net_os_rxfilter_add_remove(net, TRUE, filter_num); } else if (strnicmp(command, CMD_RXFILTER_REMOVE, strlen(CMD_RXFILTER_REMOVE)) == 0) { int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0'; bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num); } #if defined(CUSTOM_PLATFORM_NV_TEGRA) else if (strnicmp(command, CMD_PKT_FILTER_MODE, strlen(CMD_PKT_FILTER_MODE)) == 0) { dhd_set_packet_filter_mode(net, &command[strlen(CMD_PKT_FILTER_MODE) + 1]); } else if (strnicmp(command, CMD_PKT_FILTER_PORTS, strlen(CMD_PKT_FILTER_PORTS)) == 0) { bytes_written = dhd_set_packet_filter_ports(net, &command[strlen(CMD_PKT_FILTER_PORTS) + 1]); ret = bytes_written; } #endif /* defined(CUSTOM_PLATFORM_NV_TEGRA) */ #endif /* PKT_FILTER_SUPPORT */ else if (strnicmp(command, CMD_BTCOEXSCAN_START, strlen(CMD_BTCOEXSCAN_START)) == 0) { /* TBD: BTCOEXSCAN-START */ } else if (strnicmp(command, CMD_BTCOEXSCAN_STOP, strlen(CMD_BTCOEXSCAN_STOP)) == 0) { /* TBD: BTCOEXSCAN-STOP */ } else if (strnicmp(command, CMD_BTCOEXMODE, strlen(CMD_BTCOEXMODE)) == 0) { #ifdef WL_CFG80211 void *dhdp = wl_cfg80211_get_dhdp(); bytes_written = wl_cfg80211_set_btcoex_dhcp(net, dhdp, command); #else #ifdef PKT_FILTER_SUPPORT uint mode = *(command + strlen(CMD_BTCOEXMODE) + 1) - '0'; if (mode == 1) net_os_enable_packet_filter(net, 0); /* DHCP starts */ else net_os_enable_packet_filter(net, 1); /* DHCP ends */ #endif /* PKT_FILTER_SUPPORT */ #endif /* WL_CFG80211 */ } else if (strnicmp(command, CMD_SETSUSPENDOPT, strlen(CMD_SETSUSPENDOPT)) == 0) { bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len); } else if (strnicmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) { bytes_written = wl_android_set_suspendmode(net, command, priv_cmd.total_len); } else if (strnicmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) { uint band = *(command + strlen(CMD_SETBAND) + 1) - '0'; #ifdef WL_HOST_BAND_MGMT s32 ret = 0; if ((ret = wl_cfg80211_set_band(net, band)) < 0) { if (ret == BCME_UNSUPPORTED) { /* If roam_var is unsupported, fallback to the original method */ WL_ERR(("WL_HOST_BAND_MGMT defined, " "but roam_band iovar unsupported in the firmware\n")); } else { bytes_written = -1; goto exit; } } if ((band == WLC_BAND_AUTO) || (ret == BCME_UNSUPPORTED)) bytes_written = wldev_set_band(net, band); #else bytes_written = wldev_set_band(net, band); #endif /* WL_HOST_BAND_MGMT */ } else if (strnicmp(command, CMD_GETBAND, strlen(CMD_GETBAND)) == 0) { bytes_written = wl_android_get_band(net, command, priv_cmd.total_len); } #ifdef WL_CFG80211 /* CUSTOMER_SET_COUNTRY feature is define for only GGSM model */ else if (strnicmp(command, CMD_COUNTRY, strlen(CMD_COUNTRY)) == 0) { char *country_code = command + strlen(CMD_COUNTRY) + 1; #ifdef CUSTOMER_HW5 /* Customer_hw5 want to keep connections */ bytes_written = wldev_set_country(net, country_code, true, false); #else bytes_written = wldev_set_country(net, country_code, true, true); #endif } #endif /* WL_CFG80211 */ #ifdef PNO_SUPPORT else if (strnicmp(command, CMD_PNOSSIDCLR_SET, strlen(CMD_PNOSSIDCLR_SET)) == 0) { bytes_written = dhd_dev_pno_stop_for_ssid(net); } #ifndef WL_SCHED_SCAN else if (strnicmp(command, CMD_PNOSETUP_SET, strlen(CMD_PNOSETUP_SET)) == 0) { bytes_written = wl_android_set_pno_setup(net, command, priv_cmd.total_len); } #endif /* !WL_SCHED_SCAN */ else if (strnicmp(command, CMD_PNOENABLE_SET, strlen(CMD_PNOENABLE_SET)) == 0) { int enable = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0'; bytes_written = (enable)? 0 : dhd_dev_pno_stop_for_ssid(net); } else if (strnicmp(command, CMD_WLS_BATCHING, strlen(CMD_WLS_BATCHING)) == 0) { bytes_written = wls_parse_batching_cmd(net, command, priv_cmd.total_len); } #endif /* PNO_SUPPORT */ else if (strnicmp(command, CMD_P2P_DEV_ADDR, strlen(CMD_P2P_DEV_ADDR)) == 0) { bytes_written = wl_android_get_p2p_dev_addr(net, command, priv_cmd.total_len); } else if (strnicmp(command, CMD_P2P_SET_NOA, strlen(CMD_P2P_SET_NOA)) == 0) { int skip = strlen(CMD_P2P_SET_NOA) + 1; bytes_written = wl_cfg80211_set_p2p_noa(net, command + skip, priv_cmd.total_len - skip); } #ifdef WL_SDO else if (strnicmp(command, CMD_P2P_SD_OFFLOAD, strlen(CMD_P2P_SD_OFFLOAD)) == 0) { u8 *buf = command; u8 *cmd_id = NULL; int len; cmd_id = strsep((char **)&buf, " "); /* if buf == NULL, means no arg */ if (buf == NULL) len = 0; else len = strlen(buf); bytes_written = wl_cfg80211_sd_offload(net, cmd_id, buf, len); } #endif /* WL_SDO */ #ifdef WL_NAN else if (strnicmp(command, CMD_NAN, strlen(CMD_NAN)) == 0) { bytes_written = wl_cfg80211_nan_cmd_handler(net, command, priv_cmd.total_len); } #endif /* WL_NAN */ #if !defined WL_ENABLE_P2P_IF else if (strnicmp(command, CMD_P2P_GET_NOA, strlen(CMD_P2P_GET_NOA)) == 0) { bytes_written = wl_cfg80211_get_p2p_noa(net, command, priv_cmd.total_len); } #endif /* WL_ENABLE_P2P_IF */ else if (strnicmp(command, CMD_P2P_SET_PS, strlen(CMD_P2P_SET_PS)) == 0) { int skip = strlen(CMD_P2P_SET_PS) + 1; bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip); } #ifdef WL_CFG80211 else if (strnicmp(command, CMD_SET_AP_WPS_P2P_IE, strlen(CMD_SET_AP_WPS_P2P_IE)) == 0) { int skip = strlen(CMD_SET_AP_WPS_P2P_IE) + 3; bytes_written = wl_cfg80211_set_wps_p2p_ie(net, command + skip, priv_cmd.total_len - skip, *(command + skip - 2) - '0'); } #ifdef WLFBT else if (strnicmp(command, CMD_GET_FTKEY, strlen(CMD_GET_FTKEY)) == 0) { wl_cfg80211_get_fbt_key(command); bytes_written = FBT_KEYLEN; } #endif /* WLFBT */ #endif /* WL_CFG80211 */ else if (strnicmp(command, CMD_OKC_SET_PMK, strlen(CMD_OKC_SET_PMK)) == 0) bytes_written = wl_android_set_pmk(net, command, priv_cmd.total_len); else if (strnicmp(command, CMD_OKC_ENABLE, strlen(CMD_OKC_ENABLE)) == 0) bytes_written = wl_android_okc_enable(net, command, priv_cmd.total_len); #ifdef BCMCCX else if (strnicmp(command, CMD_GETCCKM_RN, strlen(CMD_GETCCKM_RN)) == 0) { bytes_written = wl_android_get_cckm_rn(net, command); } else if (strnicmp(command, CMD_SETCCKM_KRK, strlen(CMD_SETCCKM_KRK)) == 0) { bytes_written = wl_android_set_cckm_krk(net, command); } else if (strnicmp(command, CMD_GET_ASSOC_RES_IES, strlen(CMD_GET_ASSOC_RES_IES)) == 0) { bytes_written = wl_android_get_assoc_res_ies(net, command); } #endif /* BCMCCX */ #if defined(WL_SUPPORT_AUTO_CHANNEL) else if (strnicmp(command, CMD_GET_BEST_CHANNELS, strlen(CMD_GET_BEST_CHANNELS)) == 0) { bytes_written = wl_cfg80211_get_best_channels(net, command, priv_cmd.total_len); } #endif /* WL_SUPPORT_AUTO_CHANNEL */ else if (strnicmp(command, CMD_HAPD_MAC_FILTER, strlen(CMD_HAPD_MAC_FILTER)) == 0) { int skip = strlen(CMD_HAPD_MAC_FILTER) + 1; wl_android_set_mac_address_filter(net, (const char*)command+skip); } else if (strnicmp(command, CMD_SETROAMMODE, strlen(CMD_SETROAMMODE)) == 0) bytes_written = wl_android_set_roam_mode(net, command, priv_cmd.total_len); #if defined(BCMFW_ROAM_ENABLE) else if (strnicmp(command, CMD_SET_ROAMPREF, strlen(CMD_SET_ROAMPREF)) == 0) { bytes_written = wl_android_set_roampref(net, command, priv_cmd.total_len); } #endif /* BCMFW_ROAM_ENABLE */ else if (strnicmp(command, CMD_MIRACAST, strlen(CMD_MIRACAST)) == 0) bytes_written = wl_android_set_miracast(net, command, priv_cmd.total_len); #if defined(CUSTOM_PLATFORM_NV_TEGRA) else if (strnicmp(command, CMD_SETMIRACAST, strlen(CMD_SETMIRACAST)) == 0) bytes_written = wldev_miracast_tuning(net, command, priv_cmd.total_len); else if (strnicmp(command, CMD_ASSOCRESPIE, strlen(CMD_ASSOCRESPIE)) == 0) bytes_written = wldev_get_assoc_resp_ie(net, command, priv_cmd.total_len); else if (strnicmp(command, CMD_RXRATESTATS, strlen(CMD_RXRATESTATS)) == 0) bytes_written = wldev_get_rx_rate_stats(net, command, priv_cmd.total_len); #endif /* defined(CUSTOM_PLATFORM_NV_TEGRA) */ else if (strnicmp(command, CMD_SETIBSSBEACONOUIDATA, strlen(CMD_SETIBSSBEACONOUIDATA)) == 0) bytes_written = wl_android_set_ibss_beacon_ouidata(net, command, priv_cmd.total_len); #ifdef WLAIBSS else if (strnicmp(command, CMD_SETIBSSTXFAILEVENT, strlen(CMD_SETIBSSTXFAILEVENT)) == 0) bytes_written = wl_android_set_ibss_txfail_event(net, command, priv_cmd.total_len); else if (strnicmp(command, CMD_GET_IBSS_PEER_INFO_ALL, strlen(CMD_GET_IBSS_PEER_INFO_ALL)) == 0) bytes_written = wl_android_get_ibss_peer_info(net, command, priv_cmd.total_len, TRUE); else if (strnicmp(command, CMD_GET_IBSS_PEER_INFO, strlen(CMD_GET_IBSS_PEER_INFO)) == 0) bytes_written = wl_android_get_ibss_peer_info(net, command, priv_cmd.total_len, FALSE); else if (strnicmp(command, CMD_SETIBSSROUTETABLE, strlen(CMD_SETIBSSROUTETABLE)) == 0) bytes_written = wl_android_set_ibss_routetable(net, command, priv_cmd.total_len); else if (strnicmp(command, CMD_SETIBSSAMPDU, strlen(CMD_SETIBSSAMPDU)) == 0) bytes_written = wl_android_set_ibss_ampdu(net, command, priv_cmd.total_len); else if (strnicmp(command, CMD_SETIBSSANTENNAMODE, strlen(CMD_SETIBSSANTENNAMODE)) == 0) bytes_written = wl_android_set_ibss_antenna(net, command, priv_cmd.total_len); #endif /* WLAIBSS */ else if (strnicmp(command, CMD_KEEP_ALIVE, strlen(CMD_KEEP_ALIVE)) == 0) { int skip = strlen(CMD_KEEP_ALIVE) + 1; bytes_written = wl_keep_alive_set(net, command + skip, priv_cmd.total_len - skip); } else if (strnicmp(command, CMD_ROAM_OFFLOAD, strlen(CMD_ROAM_OFFLOAD)) == 0) { int enable = *(command + strlen(CMD_ROAM_OFFLOAD) + 1) - '0'; bytes_written = wl_cfg80211_enable_roam_offload(net, enable); } else if (strnicmp(command, CMD_ROAM_OFFLOAD_APLIST, strlen(CMD_ROAM_OFFLOAD_APLIST)) == 0) { bytes_written = wl_android_set_roam_offload_bssid_list(net, command + strlen(CMD_ROAM_OFFLOAD_APLIST) + 1); } #ifdef P2PRESP_WFDIE_SRC else if (strnicmp(command, CMD_P2P_SET_WFDIE_RESP, strlen(CMD_P2P_SET_WFDIE_RESP)) == 0) { int mode = *(command + strlen(CMD_P2P_SET_WFDIE_RESP) + 1) - '0'; bytes_written = wl_android_set_wfdie_resp(net, mode); } else if (strnicmp(command, CMD_P2P_GET_WFDIE_RESP, strlen(CMD_P2P_GET_WFDIE_RESP)) == 0) { bytes_written = wl_android_get_wfdie_resp(net, command, priv_cmd.total_len); } #endif /* P2PRESP_WFDIE_SRC */ else if (strnicmp(command, CMD_GET_LINK_STATUS, strlen(CMD_GET_LINK_STATUS)) == 0) { bytes_written = wl_android_get_link_status(net, command, priv_cmd.total_len); } #ifdef CONNECTION_STATISTICS else if (strnicmp(command, CMD_GET_CONNECTION_STATS, strlen(CMD_GET_CONNECTION_STATS)) == 0) { bytes_written = wl_android_get_connection_stats(net, command, priv_cmd.total_len); } #endif else { DHD_ERROR(("Unknown PRIVATE command %s - ignored\n", command)); snprintf(command, 3, "OK"); bytes_written = strlen("OK"); } if (bytes_written >= 0) { if ((bytes_written == 0) && (priv_cmd.total_len > 0)) command[0] = '\0'; if (bytes_written >= priv_cmd.total_len) { DHD_ERROR(("%s: bytes_written = %d\n", __FUNCTION__, bytes_written)); bytes_written = priv_cmd.total_len; } else { bytes_written++; } priv_cmd.used_len = bytes_written; if (copy_to_user(priv_cmd.buf, command, bytes_written)) { DHD_ERROR(("%s: failed to copy data to user buffer\n", __FUNCTION__)); ret = -EFAULT; } } else { ret = bytes_written; } exit: net_os_wake_unlock(net); if (command) { kfree(command); } return ret; } int wl_android_init(void) { int ret = 0; #ifdef ENABLE_INSMOD_NO_FW_LOAD dhd_download_fw_on_driverload = FALSE; #endif /* ENABLE_INSMOD_NO_FW_LOAD */ #if defined(CUSTOMER_HW2) if (!iface_name[0]) { memset(iface_name, 0, IFNAMSIZ); bcm_strncpy_s(iface_name, IFNAMSIZ, "wlan", IFNAMSIZ); } #endif #ifdef WL_GENL wl_genl_init(); #endif wl_netlink_init(); return ret; } int wl_android_exit(void) { int ret = 0; struct io_cfg *cur, *q; #ifdef WL_GENL wl_genl_deinit(); #endif /* WL_GENL */ wl_netlink_deinit(); list_for_each_entry_safe(cur, q, &miracast_resume_list, list) { list_del(&cur->list); kfree(cur); } return ret; } void wl_android_post_init(void) { #ifdef ENABLE_4335BT_WAR bcm_bt_unlock(lock_cookie_wifi); printk("%s: btlock released\n", __FUNCTION__); #endif /* ENABLE_4335BT_WAR */ if (!dhd_download_fw_on_driverload) g_wifi_on = FALSE; } #ifdef WL_GENL /* Generic Netlink Initializaiton */ static int wl_genl_init(void) { int ret; WL_DBG(("GEN Netlink Init\n\n")); #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)) /* register new family */ ret = genl_register_family(&wl_genl_family); if (ret != 0) goto failure; /* register functions (commands) of the new family */ ret = genl_register_ops(&wl_genl_family, &wl_genl_ops); if (ret != 0) { WL_ERR(("register ops failed: %i\n", ret)); genl_unregister_family(&wl_genl_family); goto failure; } ret = genl_register_mc_group(&wl_genl_family, &wl_genl_mcast); #else ret = genl_register_family_with_ops_groups(&wl_genl_family, wl_genl_ops, wl_genl_mcast); #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) */ if (ret != 0) { WL_ERR(("register mc_group failed: %i\n", ret)); #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)) genl_unregister_ops(&wl_genl_family, &wl_genl_ops); #endif genl_unregister_family(&wl_genl_family); goto failure; } return 0; failure: WL_ERR(("Registering Netlink failed!!\n")); return -1; } /* Generic netlink deinit */ static int wl_genl_deinit(void) { #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)) if (genl_unregister_ops(&wl_genl_family, &wl_genl_ops) < 0) WL_ERR(("Unregister wl_genl_ops failed\n")); #endif if (genl_unregister_family(&wl_genl_family) < 0) WL_ERR(("Unregister wl_genl_ops failed\n")); return 0; } s32 wl_event_to_bcm_event(u16 event_type) { u16 event = -1; switch (event_type) { case WLC_E_SERVICE_FOUND: event = BCM_E_SVC_FOUND; break; case WLC_E_P2PO_ADD_DEVICE: event = BCM_E_DEV_FOUND; break; case WLC_E_P2PO_DEL_DEVICE: event = BCM_E_DEV_LOST; break; /* Above events are supported from BCM Supp ver 47 Onwards */ #ifdef BT_WIFI_HANDOVER case WLC_E_BT_WIFI_HANDOVER_REQ: event = BCM_E_DEV_BT_WIFI_HO_REQ; break; #endif /* BT_WIFI_HANDOVER */ default: WL_ERR(("Event not supported\n")); } return event; } s32 wl_genl_send_msg( struct net_device *ndev, u32 event_type, u8 *buf, u16 len, u8 *subhdr, u16 subhdr_len) { int ret = 0; struct sk_buff *skb = NULL; void *msg; u32 attr_type = 0; bcm_event_hdr_t *hdr = NULL; int mcast = 1; /* By default sent as mutlicast type */ int pid = 0; u8 *ptr = NULL, *p = NULL; u32 tot_len = sizeof(bcm_event_hdr_t) + subhdr_len + len; u16 kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL; WL_DBG(("Enter \n")); /* Decide between STRING event and Data event */ if (event_type == 0) attr_type = BCM_GENL_ATTR_STRING; else attr_type = BCM_GENL_ATTR_MSG; skb = genlmsg_new(NLMSG_GOODSIZE, kflags); if (skb == NULL) { ret = -ENOMEM; goto out; } msg = genlmsg_put(skb, 0, 0, &wl_genl_family, 0, BCM_GENL_CMD_MSG); if (msg == NULL) { ret = -ENOMEM; goto out; } if (attr_type == BCM_GENL_ATTR_STRING) { /* Add a BCM_GENL_MSG attribute. Since it is specified as a string. * make sure it is null terminated */ if (subhdr || subhdr_len) { WL_ERR(("No sub hdr support for the ATTR STRING type \n")); ret = -EINVAL; goto out; } ret = nla_put_string(skb, BCM_GENL_ATTR_STRING, buf); if (ret != 0) { WL_ERR(("nla_put_string failed\n")); goto out; } } else { /* ATTR_MSG */ /* Create a single buffer for all */ p = ptr = kzalloc(tot_len, kflags); if (!ptr) { ret = -ENOMEM; WL_ERR(("ENOMEM!!\n")); goto out; } /* Include the bcm event header */ hdr = (bcm_event_hdr_t *)ptr; hdr->event_type = wl_event_to_bcm_event(event_type); hdr->len = len + subhdr_len; ptr += sizeof(bcm_event_hdr_t); /* Copy subhdr (if any) */ if (subhdr && subhdr_len) { memcpy(ptr, subhdr, subhdr_len); ptr += subhdr_len; } /* Copy the data */ if (buf && len) { memcpy(ptr, buf, len); } ret = nla_put(skb, BCM_GENL_ATTR_MSG, tot_len, p); if (ret != 0) { WL_ERR(("nla_put_string failed\n")); goto out; } } if (mcast) { int err = 0; /* finalize the message */ genlmsg_end(skb, msg); /* NETLINK_CB(skb).dst_group = 1; */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) if ((err = genlmsg_multicast(skb, 0, wl_genl_mcast.id, GFP_ATOMIC)) < 0) #else if ((err = genlmsg_multicast(&wl_genl_family, skb, 0, 0, GFP_ATOMIC)) < 0) #endif WL_ERR(("genlmsg_multicast for attr(%d) failed. Error:%d \n", attr_type, err)); else WL_DBG(("Multicast msg sent successfully. attr_type:%d len:%d \n", attr_type, tot_len)); } else { NETLINK_CB(skb).dst_group = 0; /* Not in multicast group */ /* finalize the message */ genlmsg_end(skb, msg); /* send the message back */ if (genlmsg_unicast(&init_net, skb, pid) < 0) WL_ERR(("genlmsg_unicast failed\n")); } out: if (p) kfree(p); if (ret) nlmsg_free(skb); return ret; } static s32 wl_genl_handle_msg( struct sk_buff *skb, struct genl_info *info) { struct nlattr *na; u8 *data = NULL; WL_DBG(("Enter \n")); if (info == NULL) { return -EINVAL; } na = info->attrs[BCM_GENL_ATTR_MSG]; if (!na) { WL_ERR(("nlattribute NULL\n")); return -EINVAL; } data = (char *)nla_data(na); if (!data) { WL_ERR(("Invalid data\n")); return -EINVAL; } else { /* Handle the data */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)) || defined(WL_COMPAT_WIRELESS) WL_DBG(("%s: Data received from pid (%d) \n", __func__, info->snd_pid)); #else WL_DBG(("%s: Data received from pid (%d) \n", __func__, info->snd_portid)); #endif /* (LINUX_VERSION < VERSION(3, 7, 0) || WL_COMPAT_WIRELESS */ } return 0; } #endif /* WL_GENL */
shakalaca/ASUS_ZenFone_ZE500CL
linux/kernel/drivers/net/wireless/bcm4343s/src/wl_android.c
C
gpl-2.0
80,538
/* Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. The GNU C 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. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <errno.h> #include <endian.h> #include <unistd.h> #include <sysdep-cancel.h> #include <sys/syscall.h> #include <kernel-features.h> #ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ # ifdef __NR_pread # error "__NR_pread and __NR_pread64 both defined???" # endif # define __NR_pread __NR_pread64 #endif static ssize_t #ifdef NO_CANCELLATION inline __attribute ((always_inline)) #endif do_pread (int fd, void *buf, size_t count, off_t offset) { ssize_t result; assert (sizeof (offset) == 4); result = INLINE_SYSCALL (pread, 5, fd, buf, count, __LONG_LONG_PAIR (offset >> 31, offset)); return result; } ssize_t __libc_pread (fd, buf, count, offset) int fd; void *buf; size_t count; off_t offset; { if (SINGLE_THREAD_P) return do_pread (fd, buf, count, offset); int oldtype = LIBC_CANCEL_ASYNC (); ssize_t result = do_pread (fd, buf, count, offset); LIBC_CANCEL_RESET (oldtype); return result; } strong_alias (__libc_pread, __pread) weak_alias (__libc_pread, pread)
SanDisk-Open-Source/SSD_Dashboard
uefi/userspace/glibc/sysdeps/unix/sysv/linux/pread.c
C
gpl-2.0
1,923
/* BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 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; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. */ #ifdef CONFIG_BT_MGMT #include "hci_mgmt.h" #elif defined(CONFIG_BT_TIZEN) #include "tizen/hci.h" #else #ifndef __HCI_H #define __HCI_H #define HCI_MAX_ACL_SIZE 1024 #define HCI_MAX_SCO_SIZE 255 #define HCI_MAX_EVENT_SIZE 260 #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) /* HCI dev events */ #define HCI_DEV_REG 1 #define HCI_DEV_UNREG 2 #define HCI_DEV_UP 3 #define HCI_DEV_DOWN 4 #define HCI_DEV_SUSPEND 5 #define HCI_DEV_RESUME 6 #ifdef CONFIG_BT_BCM4330 #define HCI_DEV_WRITE 7 #endif /* HCI notify events */ #define HCI_NOTIFY_CONN_ADD 1 #define HCI_NOTIFY_CONN_DEL 2 #define HCI_NOTIFY_VOICE_SETTING 3 /* HCI bus types */ #define HCI_VIRTUAL 0 #define HCI_USB 1 #define HCI_PCCARD 2 #define HCI_UART 3 #define HCI_RS232 4 #define HCI_PCI 5 #define HCI_SDIO 6 #define HCI_SMD 7 /* HCI controller types */ #define HCI_BREDR 0x00 #define HCI_AMP 0x01 /* HCI device quirks */ enum { HCI_QUIRK_NO_RESET, HCI_QUIRK_RAW_DEVICE, HCI_QUIRK_FIXUP_BUFFER_SIZE }; /* HCI device flags */ enum { HCI_UP, HCI_INIT, HCI_RUNNING, HCI_PSCAN, HCI_ISCAN, HCI_AUTH, HCI_ENCRYPT, HCI_INQUIRY, HCI_RAW, HCI_SETUP, HCI_AUTO_OFF, HCI_MGMT, HCI_PAIRABLE, HCI_SERVICE_CACHE, HCI_LINK_KEYS, HCI_DEBUG_KEYS, HCI_UNREGISTER, HCI_RESET, }; /* HCI ioctl defines */ #define HCIDEVUP _IOW('H', 201, int) #define HCIDEVDOWN _IOW('H', 202, int) #define HCIDEVRESET _IOW('H', 203, int) #define HCIDEVRESTAT _IOW('H', 204, int) #define HCIGETDEVLIST _IOR('H', 210, int) #define HCIGETDEVINFO _IOR('H', 211, int) #define HCIGETCONNLIST _IOR('H', 212, int) #define HCIGETCONNINFO _IOR('H', 213, int) #define HCIGETAUTHINFO _IOR('H', 215, int) #define HCISETRAW _IOW('H', 220, int) #define HCISETSCAN _IOW('H', 221, int) #define HCISETAUTH _IOW('H', 222, int) #define HCISETENCRYPT _IOW('H', 223, int) #define HCISETPTYPE _IOW('H', 224, int) #define HCISETLINKPOL _IOW('H', 225, int) #define HCISETLINKMODE _IOW('H', 226, int) #define HCISETACLMTU _IOW('H', 227, int) #define HCISETSCOMTU _IOW('H', 228, int) #define HCIBLOCKADDR _IOW('H', 230, int) #define HCIUNBLOCKADDR _IOW('H', 231, int) #define HCIINQUIRY _IOR('H', 240, int) /* HCI timeouts */ #define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */ #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ /* HCI data types */ #define HCI_COMMAND_PKT 0x01 #define HCI_ACLDATA_PKT 0x02 #define HCI_SCODATA_PKT 0x03 #define HCI_EVENT_PKT 0x04 #define HCI_VENDOR_PKT 0xff /* HCI packet types */ #define HCI_DM1 0x0008 #define HCI_DM3 0x0400 #define HCI_DM5 0x4000 #define HCI_DH1 0x0010 #define HCI_DH3 0x0800 #define HCI_DH5 0x8000 #define HCI_HV1 0x0020 #define HCI_HV2 0x0040 #define HCI_HV3 0x0080 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) /* eSCO packet types */ #define ESCO_HV1 0x0001 #define ESCO_HV2 0x0002 #define ESCO_HV3 0x0004 #define ESCO_EV3 0x0008 #define ESCO_EV4 0x0010 #define ESCO_EV5 0x0020 #define ESCO_2EV3 0x0040 #define ESCO_3EV3 0x0080 #define ESCO_2EV5 0x0100 #define ESCO_3EV5 0x0200 #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) /* SS_BLUETOOTH(is80.hwang) 2012.03.02 */ /* change applied EDR ESCO packet */ #ifdef CONFIG_BT_CSR8811 #define ALL_ESCO_MASK (SCO_ESCO_MASK | ESCO_EV3 | ESCO_EV4 | ESCO_EV5 | \ ESCO_2EV3 /*EDR_ESCO_MASK*/) #else #define ALL_ESCO_MASK (SCO_ESCO_MASK | ESCO_EV3 | ESCO_EV4 | ESCO_EV5 | \ EDR_ESCO_MASK) #endif /* SS_BLUEZ_BT(is80.hwang) End */ /* ACL flags */ #define ACL_START_NO_FLUSH 0x00 #define ACL_CONT 0x01 #define ACL_START 0x02 #define ACL_ACTIVE_BCAST 0x04 #define ACL_PICO_BCAST 0x08 /* Baseband links */ #define SCO_LINK 0x00 #define ACL_LINK 0x01 #define ESCO_LINK 0x02 /* Low Energy links do not have defined link type. Use invented one */ #define LE_LINK 0x80 /* LMP features */ #define LMP_3SLOT 0x01 #define LMP_5SLOT 0x02 #define LMP_ENCRYPT 0x04 #define LMP_SOFFSET 0x08 #define LMP_TACCURACY 0x10 #define LMP_RSWITCH 0x20 #define LMP_HOLD 0x40 #define LMP_SNIFF 0x80 #define LMP_PARK 0x01 #define LMP_RSSI 0x02 #define LMP_QUALITY 0x04 #define LMP_SCO 0x08 #define LMP_HV2 0x10 #define LMP_HV3 0x20 #define LMP_ULAW 0x40 #define LMP_ALAW 0x80 #define LMP_CVSD 0x01 #define LMP_PSCHEME 0x02 #define LMP_PCONTROL 0x04 #define LMP_RSSI_INQ 0x40 #define LMP_ESCO 0x80 #define LMP_EV4 0x01 #define LMP_EV5 0x02 #define LMP_LE 0x40 #define LMP_SNIFF_SUBR 0x02 #define LMP_PAUSE_ENC 0x04 #define LMP_EDR_ESCO_2M 0x20 #define LMP_EDR_ESCO_3M 0x40 #define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_INQ 0x01 #define LMP_SIMUL_LE_BR 0x02 #define LMP_SIMPLE_PAIR 0x08 #define LMP_NO_FLUSH 0x40 #define LMP_LSTO 0x01 #define LMP_INQ_TX_PWR 0x02 #define LMP_EXTFEATURES 0x80 /* Extended LMP features */ #define LMP_HOST_LE 0x02 /* Connection modes */ #define HCI_CM_ACTIVE 0x0000 #define HCI_CM_HOLD 0x0001 #define HCI_CM_SNIFF 0x0002 #define HCI_CM_PARK 0x0003 /* Link policies */ #define HCI_LP_RSWITCH 0x0001 #define HCI_LP_HOLD 0x0002 #define HCI_LP_SNIFF 0x0004 #define HCI_LP_PARK 0x0008 /* Link modes */ #define HCI_LM_ACCEPT 0x8000 #define HCI_LM_MASTER 0x0001 #define HCI_LM_AUTH 0x0002 #define HCI_LM_ENCRYPT 0x0004 #define HCI_LM_TRUSTED 0x0008 #define HCI_LM_RELIABLE 0x0010 #define HCI_LM_SECURE 0x0020 /* Authentication types */ #define HCI_AT_NO_BONDING 0x00 #define HCI_AT_NO_BONDING_MITM 0x01 #define HCI_AT_DEDICATED_BONDING 0x02 #define HCI_AT_DEDICATED_BONDING_MITM 0x03 #define HCI_AT_GENERAL_BONDING 0x04 #define HCI_AT_GENERAL_BONDING_MITM 0x05 /* Link Key types */ #define HCI_LK_COMBINATION 0x00 #define HCI_LK_LOCAL_UNIT 0x01 #define HCI_LK_REMOTE_UNIT 0x02 #define HCI_LK_DEBUG_COMBINATION 0x03 #define HCI_LK_UNAUTH_COMBINATION 0x04 #define HCI_LK_AUTH_COMBINATION 0x05 #define HCI_LK_CHANGED_COMBINATION 0x06 /* The spec doesn't define types for SMP keys */ #define HCI_LK_SMP_LTK 0x81 #define HCI_LK_SMP_IRK 0x82 #define HCI_LK_SMP_CSRK 0x83 /* ----- HCI Commands ---- */ #define HCI_OP_NOP 0x0000 #define HCI_OP_INQUIRY 0x0401 struct hci_cp_inquiry { __u8 lap[3]; __u8 length; __u8 num_rsp; } __packed; #define HCI_OP_INQUIRY_CANCEL 0x0402 #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 #define HCI_OP_CREATE_CONN 0x0405 struct hci_cp_create_conn { bdaddr_t bdaddr; __le16 pkt_type; __u8 pscan_rep_mode; __u8 pscan_mode; __le16 clock_offset; __u8 role_switch; } __packed; #define HCI_OP_DISCONNECT 0x0406 struct hci_cp_disconnect { __le16 handle; __u8 reason; } __packed; #define HCI_OP_ADD_SCO 0x0407 struct hci_cp_add_sco { __le16 handle; __le16 pkt_type; } __packed; #define HCI_OP_CREATE_CONN_CANCEL 0x0408 struct hci_cp_create_conn_cancel { bdaddr_t bdaddr; } __packed; #define HCI_OP_ACCEPT_CONN_REQ 0x0409 struct hci_cp_accept_conn_req { bdaddr_t bdaddr; __u8 role; } __packed; #define HCI_OP_REJECT_CONN_REQ 0x040a struct hci_cp_reject_conn_req { bdaddr_t bdaddr; __u8 reason; } __packed; #define HCI_OP_LINK_KEY_REPLY 0x040b struct hci_cp_link_key_reply { bdaddr_t bdaddr; __u8 link_key[16]; } __packed; #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c struct hci_cp_link_key_neg_reply { bdaddr_t bdaddr; } __packed; #define HCI_OP_PIN_CODE_REPLY 0x040d struct hci_cp_pin_code_reply { bdaddr_t bdaddr; __u8 pin_len; __u8 pin_code[16]; } __packed; struct hci_rp_pin_code_reply { __u8 status; bdaddr_t bdaddr; } __packed; #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e struct hci_cp_pin_code_neg_reply { bdaddr_t bdaddr; } __packed; struct hci_rp_pin_code_neg_reply { __u8 status; bdaddr_t bdaddr; } __packed; #define HCI_OP_CHANGE_CONN_PTYPE 0x040f struct hci_cp_change_conn_ptype { __le16 handle; __le16 pkt_type; } __packed; #define HCI_OP_AUTH_REQUESTED 0x0411 struct hci_cp_auth_requested { __le16 handle; } __packed; #define HCI_OP_SET_CONN_ENCRYPT 0x0413 struct hci_cp_set_conn_encrypt { __le16 handle; __u8 encrypt; } __packed; #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 struct hci_cp_change_conn_link_key { __le16 handle; } __packed; #define HCI_OP_REMOTE_NAME_REQ 0x0419 struct hci_cp_remote_name_req { bdaddr_t bdaddr; __u8 pscan_rep_mode; __u8 pscan_mode; __le16 clock_offset; } __packed; #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a struct hci_cp_remote_name_req_cancel { bdaddr_t bdaddr; } __packed; #define HCI_OP_READ_REMOTE_FEATURES 0x041b struct hci_cp_read_remote_features { __le16 handle; } __packed; #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c struct hci_cp_read_remote_ext_features { __le16 handle; __u8 page; } __packed; #define HCI_OP_READ_REMOTE_VERSION 0x041d struct hci_cp_read_remote_version { __le16 handle; } __packed; #define HCI_OP_SETUP_SYNC_CONN 0x0428 struct hci_cp_setup_sync_conn { __le16 handle; __le32 tx_bandwidth; __le32 rx_bandwidth; __le16 max_latency; __le16 voice_setting; __u8 retrans_effort; __le16 pkt_type; } __packed; #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 struct hci_cp_accept_sync_conn_req { bdaddr_t bdaddr; __le32 tx_bandwidth; __le32 rx_bandwidth; __le16 max_latency; __le16 content_format; __u8 retrans_effort; __le16 pkt_type; } __packed; #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a struct hci_cp_reject_sync_conn_req { bdaddr_t bdaddr; __u8 reason; } __packed; #define HCI_OP_IO_CAPABILITY_REPLY 0x042b struct hci_cp_io_capability_reply { bdaddr_t bdaddr; __u8 capability; __u8 oob_data; __u8 authentication; } __packed; #define HCI_OP_USER_CONFIRM_REPLY 0x042c struct hci_cp_user_confirm_reply { bdaddr_t bdaddr; } __packed; struct hci_rp_user_confirm_reply { __u8 status; bdaddr_t bdaddr; } __packed; #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 struct hci_cp_remote_oob_data_reply { bdaddr_t bdaddr; __u8 hash[16]; __u8 randomizer[16]; } __packed; #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 struct hci_cp_remote_oob_data_neg_reply { bdaddr_t bdaddr; } __packed; #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 struct hci_cp_io_capability_neg_reply { bdaddr_t bdaddr; __u8 reason; } __packed; #define HCI_OP_SNIFF_MODE 0x0803 struct hci_cp_sniff_mode { __le16 handle; __le16 max_interval; __le16 min_interval; __le16 attempt; __le16 timeout; } __packed; #define HCI_OP_EXIT_SNIFF_MODE 0x0804 struct hci_cp_exit_sniff_mode { __le16 handle; } __packed; #define HCI_OP_ROLE_DISCOVERY 0x0809 struct hci_cp_role_discovery { __le16 handle; } __packed; struct hci_rp_role_discovery { __u8 status; __le16 handle; __u8 role; } __packed; #define HCI_OP_SWITCH_ROLE 0x080b struct hci_cp_switch_role { bdaddr_t bdaddr; __u8 role; } __packed; #define HCI_OP_READ_LINK_POLICY 0x080c struct hci_cp_read_link_policy { __le16 handle; } __packed; struct hci_rp_read_link_policy { __u8 status; __le16 handle; __le16 policy; } __packed; #define HCI_OP_WRITE_LINK_POLICY 0x080d struct hci_cp_write_link_policy { __le16 handle; __le16 policy; } __packed; struct hci_rp_write_link_policy { __u8 status; __le16 handle; } __packed; #define HCI_OP_READ_DEF_LINK_POLICY 0x080e struct hci_rp_read_def_link_policy { __u8 status; __le16 policy; } __packed; #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f struct hci_cp_write_def_link_policy { __le16 policy; } __packed; #define HCI_OP_SNIFF_SUBRATE 0x0811 struct hci_cp_sniff_subrate { __le16 handle; __le16 max_latency; __le16 min_remote_timeout; __le16 min_local_timeout; } __packed; #define HCI_OP_SET_EVENT_MASK 0x0c01 struct hci_cp_set_event_mask { __u8 mask[8]; } __packed; #define HCI_OP_RESET 0x0c03 #define HCI_OP_SET_EVENT_FLT 0x0c05 struct hci_cp_set_event_flt { __u8 flt_type; __u8 cond_type; __u8 condition[0]; } __packed; /* Filter types */ #define HCI_FLT_CLEAR_ALL 0x00 #define HCI_FLT_INQ_RESULT 0x01 #define HCI_FLT_CONN_SETUP 0x02 /* CONN_SETUP Condition types */ #define HCI_CONN_SETUP_ALLOW_ALL 0x00 #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 /* CONN_SETUP Conditions */ #define HCI_CONN_SETUP_AUTO_OFF 0x01 #define HCI_CONN_SETUP_AUTO_ON 0x02 #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 struct hci_cp_delete_stored_link_key { bdaddr_t bdaddr; __u8 delete_all; } __packed; #define HCI_MAX_NAME_LENGTH 248 #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 struct hci_cp_write_local_name { __u8 name[HCI_MAX_NAME_LENGTH]; } __packed; #define HCI_OP_READ_LOCAL_NAME 0x0c14 struct hci_rp_read_local_name { __u8 status; __u8 name[HCI_MAX_NAME_LENGTH]; } __packed; #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a #define SCAN_DISABLED 0x00 #define SCAN_INQUIRY 0x01 #define SCAN_PAGE 0x02 #define HCI_OP_READ_AUTH_ENABLE 0x0c1f #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 #define AUTH_DISABLED 0x00 #define AUTH_ENABLED 0x01 #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 #define ENCRYPT_DISABLED 0x00 #define ENCRYPT_P2P 0x01 #define ENCRYPT_BOTH 0x02 #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 struct hci_rp_read_class_of_dev { __u8 status; __u8 dev_class[3]; } __packed; #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 struct hci_cp_write_class_of_dev { __u8 dev_class[3]; } __packed; #define HCI_OP_READ_VOICE_SETTING 0x0c25 struct hci_rp_read_voice_setting { __u8 status; __le16 voice_setting; } __packed; #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 struct hci_cp_write_voice_setting { __le16 voice_setting; } __packed; #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 struct hci_cp_host_buffer_size { __le16 acl_mtu; __u8 sco_mtu; __le16 acl_max_pkt; __le16 sco_max_pkt; } __packed; #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 #define HCI_MAX_EIR_LENGTH 240 #define HCI_OP_WRITE_EIR 0x0c52 struct hci_cp_write_eir { uint8_t fec; uint8_t data[HCI_MAX_EIR_LENGTH]; } __packed; #define HCI_OP_READ_SSP_MODE 0x0c55 struct hci_rp_read_ssp_mode { __u8 status; __u8 mode; } __packed; #define HCI_OP_WRITE_SSP_MODE 0x0c56 struct hci_cp_write_ssp_mode { __u8 mode; } __packed; #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 struct hci_rp_read_local_oob_data { __u8 status; __u8 hash[16]; __u8 randomizer[16]; } __packed; #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d struct hci_cp_write_le_host_supported { __u8 le; __u8 simul; } __packed; #define HCI_OP_READ_LOCAL_VERSION 0x1001 struct hci_rp_read_local_version { __u8 status; __u8 hci_ver; __le16 hci_rev; __u8 lmp_ver; __le16 manufacturer; __le16 lmp_subver; } __packed; #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 struct hci_rp_read_local_commands { __u8 status; __u8 commands[64]; } __packed; #define HCI_OP_READ_LOCAL_FEATURES 0x1003 struct hci_rp_read_local_features { __u8 status; __u8 features[8]; } __packed; #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 struct hci_cp_read_local_ext_features { __u8 page; } __packed; struct hci_rp_read_local_ext_features { __u8 status; __u8 page; __u8 max_page; __u8 features[8]; } __packed; #define HCI_OP_READ_BUFFER_SIZE 0x1005 struct hci_rp_read_buffer_size { __u8 status; __le16 acl_mtu; __u8 sco_mtu; __le16 acl_max_pkt; __le16 sco_max_pkt; } __packed; #define HCI_OP_READ_BD_ADDR 0x1009 struct hci_rp_read_bd_addr { __u8 status; bdaddr_t bdaddr; } __packed; #define HCI_OP_LE_SET_EVENT_MASK 0x2001 struct hci_cp_le_set_event_mask { __u8 mask[8]; } __packed; #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 struct hci_rp_le_read_buffer_size { __u8 status; __le16 le_mtu; __u8 le_max_pkt; } __packed; #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c struct hci_cp_le_set_scan_enable { __u8 enable; __u8 filter_dup; } __packed; #define HCI_OP_LE_CREATE_CONN 0x200d struct hci_cp_le_create_conn { __le16 scan_interval; __le16 scan_window; __u8 filter_policy; __u8 peer_addr_type; bdaddr_t peer_addr; __u8 own_address_type; __le16 conn_interval_min; __le16 conn_interval_max; __le16 conn_latency; __le16 supervision_timeout; __le16 min_ce_len; __le16 max_ce_len; } __packed; #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e #define HCI_OP_LE_CONN_UPDATE 0x2013 struct hci_cp_le_conn_update { __le16 handle; __le16 conn_interval_min; __le16 conn_interval_max; __le16 conn_latency; __le16 supervision_timeout; __le16 min_ce_len; __le16 max_ce_len; } __packed; #define HCI_OP_LE_START_ENC 0x2019 struct hci_cp_le_start_enc { __le16 handle; __u8 rand[8]; __le16 ediv; __u8 ltk[16]; } __packed; #define HCI_OP_LE_LTK_REPLY 0x201a struct hci_cp_le_ltk_reply { __le16 handle; __u8 ltk[16]; } __packed; struct hci_rp_le_ltk_reply { __u8 status; __le16 handle; } __packed; #define HCI_OP_LE_LTK_NEG_REPLY 0x201b struct hci_cp_le_ltk_neg_reply { __le16 handle; } __packed; struct hci_rp_le_ltk_neg_reply { __u8 status; __le16 handle; } __packed; /* ---- HCI Events ---- */ #define HCI_EV_INQUIRY_COMPLETE 0x01 #define HCI_EV_INQUIRY_RESULT 0x02 struct inquiry_info { bdaddr_t bdaddr; __u8 pscan_rep_mode; __u8 pscan_period_mode; __u8 pscan_mode; __u8 dev_class[3]; __le16 clock_offset; } __packed; #define HCI_EV_CONN_COMPLETE 0x03 struct hci_ev_conn_complete { __u8 status; __le16 handle; bdaddr_t bdaddr; __u8 link_type; __u8 encr_mode; } __packed; #define HCI_EV_CONN_REQUEST 0x04 struct hci_ev_conn_request { bdaddr_t bdaddr; __u8 dev_class[3]; __u8 link_type; } __packed; #define HCI_EV_DISCONN_COMPLETE 0x05 struct hci_ev_disconn_complete { __u8 status; __le16 handle; __u8 reason; } __packed; #define HCI_EV_AUTH_COMPLETE 0x06 struct hci_ev_auth_complete { __u8 status; __le16 handle; } __packed; #define HCI_EV_REMOTE_NAME 0x07 struct hci_ev_remote_name { __u8 status; bdaddr_t bdaddr; __u8 name[HCI_MAX_NAME_LENGTH]; } __packed; #define HCI_EV_ENCRYPT_CHANGE 0x08 struct hci_ev_encrypt_change { __u8 status; __le16 handle; __u8 encrypt; } __packed; #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 struct hci_ev_change_link_key_complete { __u8 status; __le16 handle; } __packed; #define HCI_EV_REMOTE_FEATURES 0x0b struct hci_ev_remote_features { __u8 status; __le16 handle; __u8 features[8]; } __packed; #define HCI_EV_REMOTE_VERSION 0x0c struct hci_ev_remote_version { __u8 status; __le16 handle; __u8 lmp_ver; __le16 manufacturer; __le16 lmp_subver; } __packed; #define HCI_EV_QOS_SETUP_COMPLETE 0x0d struct hci_qos { __u8 service_type; __u32 token_rate; __u32 peak_bandwidth; __u32 latency; __u32 delay_variation; } __packed; struct hci_ev_qos_setup_complete { __u8 status; __le16 handle; struct hci_qos qos; } __packed; #define HCI_EV_CMD_COMPLETE 0x0e struct hci_ev_cmd_complete { __u8 ncmd; __le16 opcode; } __packed; #define HCI_EV_CMD_STATUS 0x0f struct hci_ev_cmd_status { __u8 status; __u8 ncmd; __le16 opcode; } __packed; #define HCI_EV_ROLE_CHANGE 0x12 struct hci_ev_role_change { __u8 status; bdaddr_t bdaddr; __u8 role; } __packed; #define HCI_EV_NUM_COMP_PKTS 0x13 struct hci_ev_num_comp_pkts { __u8 num_hndl; /* variable length part */ } __packed; #define HCI_EV_MODE_CHANGE 0x14 struct hci_ev_mode_change { __u8 status; __le16 handle; __u8 mode; __le16 interval; } __packed; #define HCI_EV_PIN_CODE_REQ 0x16 struct hci_ev_pin_code_req { bdaddr_t bdaddr; } __packed; #define HCI_EV_LINK_KEY_REQ 0x17 struct hci_ev_link_key_req { bdaddr_t bdaddr; } __packed; #define HCI_EV_LINK_KEY_NOTIFY 0x18 struct hci_ev_link_key_notify { bdaddr_t bdaddr; __u8 link_key[16]; __u8 key_type; } __packed; #define HCI_EV_CLOCK_OFFSET 0x1c struct hci_ev_clock_offset { __u8 status; __le16 handle; __le16 clock_offset; } __packed; #define HCI_EV_PKT_TYPE_CHANGE 0x1d struct hci_ev_pkt_type_change { __u8 status; __le16 handle; __le16 pkt_type; } __packed; #define HCI_EV_PSCAN_REP_MODE 0x20 struct hci_ev_pscan_rep_mode { bdaddr_t bdaddr; __u8 pscan_rep_mode; } __packed; #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 struct inquiry_info_with_rssi { bdaddr_t bdaddr; __u8 pscan_rep_mode; __u8 pscan_period_mode; __u8 dev_class[3]; __le16 clock_offset; __s8 rssi; } __packed; struct inquiry_info_with_rssi_and_pscan_mode { bdaddr_t bdaddr; __u8 pscan_rep_mode; __u8 pscan_period_mode; __u8 pscan_mode; __u8 dev_class[3]; __le16 clock_offset; __s8 rssi; } __packed; #define HCI_EV_REMOTE_EXT_FEATURES 0x23 struct hci_ev_remote_ext_features { __u8 status; __le16 handle; __u8 page; __u8 max_page; __u8 features[8]; } __packed; #define HCI_EV_SYNC_CONN_COMPLETE 0x2c struct hci_ev_sync_conn_complete { __u8 status; __le16 handle; bdaddr_t bdaddr; __u8 link_type; __u8 tx_interval; __u8 retrans_window; __le16 rx_pkt_len; __le16 tx_pkt_len; __u8 air_mode; } __packed; #define HCI_EV_SYNC_CONN_CHANGED 0x2d struct hci_ev_sync_conn_changed { __u8 status; __le16 handle; __u8 tx_interval; __u8 retrans_window; __le16 rx_pkt_len; __le16 tx_pkt_len; } __packed; #define HCI_EV_SNIFF_SUBRATE 0x2e struct hci_ev_sniff_subrate { __u8 status; __le16 handle; __le16 max_tx_latency; __le16 max_rx_latency; __le16 max_remote_timeout; __le16 max_local_timeout; } __packed; #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f struct extended_inquiry_info { bdaddr_t bdaddr; __u8 pscan_rep_mode; __u8 pscan_period_mode; __u8 dev_class[3]; __le16 clock_offset; __s8 rssi; __u8 data[240]; } __packed; #define HCI_EV_IO_CAPA_REQUEST 0x31 struct hci_ev_io_capa_request { bdaddr_t bdaddr; } __packed; #define HCI_EV_IO_CAPA_REPLY 0x32 struct hci_ev_io_capa_reply { bdaddr_t bdaddr; __u8 capability; __u8 oob_data; __u8 authentication; } __packed; #define HCI_EV_USER_CONFIRM_REQUEST 0x33 struct hci_ev_user_confirm_req { bdaddr_t bdaddr; __le32 passkey; } __packed; #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 struct hci_ev_remote_oob_data_request { bdaddr_t bdaddr; } __packed; #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 struct hci_ev_simple_pair_complete { __u8 status; bdaddr_t bdaddr; } __packed; #define HCI_EV_REMOTE_HOST_FEATURES 0x3d struct hci_ev_remote_host_features { bdaddr_t bdaddr; __u8 features[8]; } __packed; #define HCI_EV_LE_META 0x3e struct hci_ev_le_meta { __u8 subevent; } __packed; /* Low energy meta events */ #define HCI_EV_LE_CONN_COMPLETE 0x01 struct hci_ev_le_conn_complete { __u8 status; __le16 handle; __u8 role; __u8 bdaddr_type; bdaddr_t bdaddr; __le16 interval; __le16 latency; __le16 supervision_timeout; __u8 clk_accurancy; } __packed; #define HCI_EV_LE_LTK_REQ 0x05 struct hci_ev_le_ltk_req { __le16 handle; __u8 random[8]; __le16 ediv; } __packed; /* Advertising report event types */ #define ADV_IND 0x00 #define ADV_DIRECT_IND 0x01 #define ADV_SCAN_IND 0x02 #define ADV_NONCONN_IND 0x03 #define ADV_SCAN_RSP 0x04 #define ADDR_LE_DEV_PUBLIC 0x00 #define ADDR_LE_DEV_RANDOM 0x01 #define HCI_EV_LE_ADVERTISING_REPORT 0x02 struct hci_ev_le_advertising_info { __u8 evt_type; __u8 bdaddr_type; bdaddr_t bdaddr; __u8 length; __u8 data[0]; } __packed; /* Internal events generated by Bluetooth stack */ #define HCI_EV_STACK_INTERNAL 0xfd struct hci_ev_stack_internal { __u16 type; __u8 data[0]; } __packed; #define HCI_EV_SI_DEVICE 0x01 struct hci_ev_si_device { __u16 event; __u16 dev_id; } __packed; #define HCI_EV_SI_SECURITY 0x02 struct hci_ev_si_security { __u16 event; __u16 proto; __u16 subproto; __u8 incoming; } __packed; /* ---- HCI Packet structures ---- */ #define HCI_COMMAND_HDR_SIZE 3 #define HCI_EVENT_HDR_SIZE 2 #define HCI_ACL_HDR_SIZE 4 #define HCI_SCO_HDR_SIZE 3 struct hci_command_hdr { __le16 opcode; /* OCF & OGF */ __u8 plen; } __packed; struct hci_event_hdr { __u8 evt; __u8 plen; } __packed; struct hci_acl_hdr { __le16 handle; /* Handle & Flags(PB, BC) */ __le16 dlen; } __packed; struct hci_sco_hdr { __le16 handle; __u8 dlen; } __packed; #include <linux/skbuff.h> static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) { return (struct hci_event_hdr *) skb->data; } static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) { return (struct hci_acl_hdr *) skb->data; } static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) { return (struct hci_sco_hdr *) skb->data; } /* Command opcode pack/unpack */ #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) #define hci_opcode_ogf(op) (op >> 10) #define hci_opcode_ocf(op) (op & 0x03ff) /* ACL handle and flags pack/unpack */ #define hci_handle_pack(h, f) (__u16) ((h & 0x0fff)|(f << 12)) #define hci_handle(h) (h & 0x0fff) #define hci_flags(h) (h >> 12) /* ---- HCI Sockets ---- */ /* Socket options */ #define HCI_DATA_DIR 1 #define HCI_FILTER 2 #define HCI_TIME_STAMP 3 /* CMSG flags */ #define HCI_CMSG_DIR 0x0001 #define HCI_CMSG_TSTAMP 0x0002 struct sockaddr_hci { sa_family_t hci_family; unsigned short hci_dev; unsigned short hci_channel; }; #define HCI_DEV_NONE 0xffff #define HCI_CHANNEL_RAW 0 #define HCI_CHANNEL_CONTROL 1 struct hci_filter { unsigned long type_mask; unsigned long event_mask[2]; __le16 opcode; }; struct hci_ufilter { __u32 type_mask; __u32 event_mask[2]; __le16 opcode; }; #define HCI_FLT_TYPE_BITS 31 #define HCI_FLT_EVENT_BITS 63 #define HCI_FLT_OGF_BITS 63 #define HCI_FLT_OCF_BITS 127 /* ---- HCI Ioctl requests structures ---- */ struct hci_dev_stats { __u32 err_rx; __u32 err_tx; __u32 cmd_tx; __u32 evt_rx; __u32 acl_tx; __u32 acl_rx; __u32 sco_tx; __u32 sco_rx; __u32 byte_rx; __u32 byte_tx; }; struct hci_dev_info { __u16 dev_id; char name[8]; bdaddr_t bdaddr; __u32 flags; __u8 type; __u8 features[8]; __u32 pkt_type; __u32 link_policy; __u32 link_mode; __u16 acl_mtu; __u16 acl_pkts; __u16 sco_mtu; __u16 sco_pkts; struct hci_dev_stats stat; }; struct hci_conn_info { __u16 handle; bdaddr_t bdaddr; __u8 type; __u8 out; __u16 state; __u32 link_mode; __u32 mtu; __u32 cnt; __u32 pkts; }; struct hci_dev_req { __u16 dev_id; __u32 dev_opt; }; struct hci_dev_list_req { __u16 dev_num; struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ }; struct hci_conn_list_req { __u16 dev_id; __u16 conn_num; struct hci_conn_info conn_info[0]; }; struct hci_conn_info_req { bdaddr_t bdaddr; __u8 type; struct hci_conn_info conn_info[0]; }; struct hci_auth_info_req { bdaddr_t bdaddr; __u8 type; }; struct hci_inquiry_req { __u16 dev_id; __u16 flags; __u8 lap[3]; __u8 length; __u8 num_rsp; }; #define IREQ_CACHE_FLUSH 0x0001 #endif /* __HCI_H */ #endif /* BT_MGMT */
FireLord1/android_kernel_samsung_logan2g
include/net/bluetooth/hci.h
C
gpl-2.0
29,981
/* This file is part of Cyclos (www.cyclos.org). A project of the Social Trade Organisation (www.socialtrade.org). Cyclos 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. Cyclos 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 Cyclos; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package nl.strohalm.cyclos.dao.accounts.transactions; import java.util.List; import nl.strohalm.cyclos.dao.BaseDAO; import nl.strohalm.cyclos.dao.InsertableDAO; import nl.strohalm.cyclos.entities.accounts.transactions.TransferAuthorization; import nl.strohalm.cyclos.entities.accounts.transactions.TransferAuthorizationQuery; /** * Data access interface for transfer authorizations * @author luis */ public interface TransferAuthorizationDAO extends BaseDAO<TransferAuthorization>, InsertableDAO<TransferAuthorization> { /** * Search for authorizations */ List<TransferAuthorization> search(TransferAuthorizationQuery query); }
robertoandrade/cyclos
src/nl/strohalm/cyclos/dao/accounts/transactions/TransferAuthorizationDAO.java
Java
gpl-2.0
1,481
/**************************************************************************** ** ** This file is part of the Qt Extended Opensource Package. ** ** Copyright (C) 2009 Trolltech ASA. ** ** Contact: Qt Extended Information (info@qtextended.org) ** ** This file may be used under the terms of the GNU General Public License ** version 2.0 as published by the Free Software Foundation and appearing ** in the file LICENSE.GPL included in the packaging of this file. ** ** Please review the following information to ensure GNU General Public ** Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html. ** ** ****************************************************************************/ #include "qcollectivenamespace.h" namespace QCollective { static const QString tag("qcollective"); /*! Returns the protocol identifier value used in QCollective addresses. \sa decodeUri */ QString protocolIdentifier() { return tag; } /*! Given the service name of QCollective interface \a provider, and an \a identity within that provider, return a URI representation suitable for passing between applications. This is typically in the form of "<protocol-ID>:<provider>/<identity>". If either parameter is empty, an empty URI will be returned. \sa decodeUri, protocolIdentifier */ QString encodeUri(const QString& provider, const QString& identity) { if (provider.isEmpty() || identity.isEmpty()) return QString(); return QString("%1:%2/%3").arg(tag).arg(provider).arg(identity); } /*! Given an encoded \a uri, decode the URI into a QCollective interface name (\a provider) and an \a identity. This URI should be formatted in the manner of URIs returned by \l encodeUri. Returns true if successful (the URI appeared to be a QCollective URI) or false otherwise. \sa encodeUri */ bool decodeUri(const QString& uri, QString& provider, QString& identity) { static const int tagLength = tag.length() + 1; // We need at least one char for each of provider and identity, plus a delimiter if (uri.length() >= (tagLength + 3)) { if (uri.startsWith(tag + ':')) { int slashidx = uri.indexOf('/', tagLength); if (slashidx != -1 && uri.length() > (slashidx + 1)) { provider = uri.mid(tagLength, (slashidx - tagLength)); identity = uri.mid(slashidx + 1); return true; } } } return false; } } // namespace QCollective
tsuibin/qtextended
src/libraries/qtopiacollective/qcollectivenamespace.cpp
C++
gpl-2.0
2,534
/* Copyright (C) 2009 - 2015 by Mark de Wever <koraq@xs4all.nl> Part of the Battle for Wesnoth Project http://www.wesnoth.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. See the COPYING file for more details. */ #define GETTEXT_DOMAIN "wesnoth-lib" #include "gui/dialogs/campaign_selection.hpp" #include "game_preferences.hpp" #include "gui/auxiliary/find_widget.tpp" #include "gui/dialogs/helper.hpp" #include "gui/dialogs/campaign_settings.hpp" #include "gui/widgets/button.hpp" #include "gui/widgets/image.hpp" #ifdef GUI2_EXPERIMENTAL_LISTBOX #include "gui/widgets/list.hpp" #else #include "gui/widgets/listbox.hpp" #endif #include "gui/widgets/multi_page.hpp" #include "gui/widgets/scroll_label.hpp" #include "gui/widgets/settings.hpp" #include "gui/widgets/tree_view.hpp" #include "gui/widgets/tree_view_node.hpp" #include "gui/widgets/toggle_button.hpp" #include "gui/widgets/window.hpp" #include "utils/foreach.tpp" #include "serialization/string_utils.hpp" #include <boost/bind.hpp> namespace gui2 { /*WIKI * @page = GUIWindowDefinitionWML * @order = 2_campaign_selection * * == Campaign selection == * * This shows the dialog which allows the user to choose which campaign to * play. * * @begin{table}{dialog_widgets} * * campaign_list & & listbox & m & * A listbox that contains all available campaigns. $ * * -icon & & image & o & * The icon for the campaign. $ * * -name & & control & o & * The name of the campaign. $ * * -victory & & image & o & * The icon to show when the user finished the campaign. The engine * determines whether or not the user has finished the campaign and * sets the visible flag for the widget accordingly. $ * * campaign_details & & multi_page & m & * A multi page widget that shows more details for the selected * campaign. $ * * -image & & image & o & * The image for the campaign. $ * * -description & & control & o & * The description of the campaign. $ * * @end{table} */ REGISTER_DIALOG(campaign_selection) void tcampaign_selection::campaign_selected(twindow& window) { if(new_widgets || true) { ttree_view& tree = find_widget<ttree_view>(&window, "campaign_tree", false); if(tree.empty()) { return; } assert(tree.selected_item()); const unsigned choice = lexical_cast<unsigned>(tree.selected_item()->id()); tmulti_page& multi_page = find_widget<tmulti_page>(&window, "campaign_details", false); multi_page.select_page(choice); engine_.set_current_level(choice); } else { const int selected_row = find_widget<tlistbox>(&window, "campaign_list", false) .get_selected_row(); tmulti_page& multi_page = find_widget<tmulti_page>(&window, "campaign_details", false); multi_page.select_page(selected_row); engine_.set_current_level(selected_row); } } void tcampaign_selection::show_settings(CVideo& video) { tcampaign_settings settings_dlg(engine_); settings_dlg.show(video); } void tcampaign_selection::pre_show(CVideo& video, twindow& window) { if(new_widgets || true) { /***** Setup campaign tree. *****/ ttree_view& tree = find_widget<ttree_view>(&window, "campaign_tree", false); tree.set_selection_change_callback( boost::bind(&tcampaign_selection::campaign_selected, this, boost::ref(window))); window.keyboard_capture(&tree); string_map tree_group_field; std::map<std::string, string_map> tree_group_item; /***** Setup campaign details. *****/ tmulti_page& multi_page = find_widget<tmulti_page>(&window, "campaign_details", false); unsigned id = 0; FOREACH(const AUTO & level, engine_.get_levels_by_type_unfiltered(ng::level::TYPE::SP_CAMPAIGN)) { const config& campaign = level->data(); /*** Add tree item ***/ tree_group_field["label"] = campaign["icon"]; tree_group_item["icon"] = tree_group_field; tree_group_field["label"] = campaign["name"]; tree_group_item["name"] = tree_group_field; tree_group_field["label"] = campaign["completed"].to_bool() ? "misc/laurel.png" : "misc/blank-hex.png"; tree_group_item["victory"] = tree_group_field; tree.add_node("campaign", tree_group_item).set_id(lexical_cast<std::string>(id++)); /*** Add detail item ***/ string_map detail_item; std::map<std::string, string_map> detail_page; detail_item["label"] = campaign["description"]; detail_item["use_markup"] = "true"; detail_page.insert(std::make_pair("description", detail_item)); detail_item["label"] = campaign["image"]; detail_page.insert(std::make_pair("image", detail_item)); multi_page.add_page(detail_page); } if (!engine_.get_const_extras_by_type(ng::create_engine::MOD).empty()) { tree_group_field["label"] = "Modifications"; tree_group_item["tree_view_node_label"] = tree_group_field; //tree_group_item["tree_view_node_label"] = tree_group_field; ttree_view_node& mods_node = tree.add_node("campaign_group", tree_group_item); std::vector<std::string> enabled = engine_.active_mods(); id = 0; tree_group_item.clear(); FOREACH(const AUTO& mod, engine_.get_const_extras_by_type(ng::create_engine::MOD)) { bool active = std::find(enabled.begin(), enabled.end(), mod->id) != enabled.end(); /*** Add tree item ***/ tree_group_field["label"] = mod->name; tree_group_item["checkb"] = tree_group_field; ttree_view_node & node = mods_node.add_child("modification", tree_group_item); ttoggle_button* checkbox = dynamic_cast<ttoggle_button*>(node.find("checkb", true)); VALIDATE(checkbox, missing_widget("checkb")); checkbox->set_value(active); checkbox->set_label(mod->name); checkbox->set_callback_state_change(boost::bind(&tcampaign_selection::mod_toggled, this, id, _1)); ++id; } } } else { /***** Hide the tree view. *****/ if(ttree_view* tree = find_widget<ttree_view>(&window, "campaign_tree", false, false)) { tree->set_visible(twidget::tvisible::invisible); } /***** Setup campaign list. *****/ tlistbox& list = find_widget<tlistbox>(&window, "campaign_list", false); #ifdef GUI2_EXPERIMENTAL_LISTBOX connect_signal_notify_modified( list, boost::bind(&tcampaign_selection::campaign_selected, this, boost::ref(window))); #else list.set_callback_value_change( dialog_callback<tcampaign_selection, &tcampaign_selection::campaign_selected>); #endif window.keyboard_capture(&list); /***** Setup campaign details. *****/ tmulti_page& multi_page = find_widget<tmulti_page>(&window, "campaign_details", false); FOREACH(const AUTO & level, engine_.get_levels_by_type_unfiltered(ng::level::TYPE::SP_CAMPAIGN)) { const config& campaign = level->data(); /*** Add list item ***/ string_map list_item; std::map<std::string, string_map> list_item_item; list_item["label"] = campaign["icon"]; list_item_item.insert(std::make_pair("icon", list_item)); list_item["label"] = campaign["name"]; list_item_item.insert(std::make_pair("name", list_item)); list.add_row(list_item_item); tgrid* grid = list.get_row_grid(list.get_item_count() - 1); assert(grid); twidget* widget = grid->find("victory", false); if(widget && !campaign["completed"].to_bool()) { widget->set_visible(twidget::tvisible::hidden); } /*** Add detail item ***/ string_map detail_item; std::map<std::string, string_map> detail_page; detail_item["label"] = campaign["description"]; detail_item["use_markup"] = "true"; detail_page.insert(std::make_pair("description", detail_item)); detail_item["label"] = campaign["image"]; detail_page.insert(std::make_pair("image", detail_item)); multi_page.add_page(detail_page); } } campaign_selected(window); /***** Setup advanced settings button *****/ tbutton* advanced_settings_button = find_widget<tbutton>(&window, "advanced_settings", false, false); if(advanced_settings_button) { advanced_settings_button->connect_click_handler( boost::bind(&tcampaign_selection::show_settings, this, boost::ref(video))); } } void tcampaign_selection::post_show(twindow& window) { if(new_widgets || true) { ttree_view& tree = find_widget<ttree_view>(&window, "campaign_tree", false); if(tree.empty()) { return; } assert(tree.selected_item()); choice_ = lexical_cast<unsigned>(tree.selected_item()->id()); deterministic_ = find_widget<ttoggle_button>(&window, "checkbox_deterministic", false).get_value_bool(); preferences::set_modifications(engine_.active_mods(), false); } else { choice_ = find_widget<tlistbox>(&window, "campaign_list", false) .get_selected_row(); deterministic_ = find_widget<ttoggle_button>(&window, "checkbox_deterministic", false).get_value_bool(); } } void tcampaign_selection::mod_toggled(int id, twidget &) { engine_.set_current_mod_index(id); engine_.toggle_current_mod(); } } // namespace gui2
drunklurker/wesnoth
src/gui/dialogs/campaign_selection.cpp
C++
gpl-2.0
9,328
/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C 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. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _UTMP_H #define _UTMP_H 1 #include <features.h> #include <sys/types.h> __BEGIN_DECLS /* Get system dependent values and data structures. */ #include <bits/utmp.h> /* Compatibility names for the strings of the canonical file names. */ #define UTMP_FILE _PATH_UTMP #define UTMP_FILENAME _PATH_UTMP #define WTMP_FILE _PATH_WTMP #define WTMP_FILENAME _PATH_WTMP #ifdef __UCLIBC_HAS_LIBUTIL__ /* Make FD be the controlling terminal, stdin, stdout, and stderr; then close FD. Returns 0 on success, nonzero on error. */ extern int login_tty (int __fd) __THROW; /* Write the given entry into utmp and wtmp. */ extern void login (__const struct utmp *__entry) __THROW; /* Write the utmp entry to say the user on UT_LINE has logged out. */ extern int logout (__const char *__ut_line) __THROW; /* Append to wtmp an entry for the current time and the given info. */ extern void logwtmp (__const char *__ut_line, __const char *__ut_name, __const char *__ut_host) __THROW; #endif /* Append entry UTMP to the wtmp-like file WTMP_FILE. */ extern void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp) __THROW; libc_hidden_proto(updwtmp) /* Change name of the utmp file to be examined. */ extern int utmpname (__const char *__file) __THROW; libc_hidden_proto(utmpname) /* Read next entry from a utmp-like file. */ extern struct utmp *getutent (void) __THROW; libc_hidden_proto(getutent) /* Reset the input stream to the beginning of the file. */ extern void setutent (void) __THROW; libc_hidden_proto(setutent) /* Close the current open file. */ extern void endutent (void) __THROW; libc_hidden_proto(endutent) /* Search forward from the current point in the utmp file until the next entry with a ut_type matching ID->ut_type. */ extern struct utmp *getutid (__const struct utmp *__id) __THROW; libc_hidden_proto(getutid) /* Search forward from the current point in the utmp file until the next entry with a ut_line matching LINE->ut_line. */ extern struct utmp *getutline (__const struct utmp *__line) __THROW; libc_hidden_proto(getutline) /* Write out entry pointed to by UTMP_PTR into the utmp file. */ extern struct utmp *pututline (__const struct utmp *__utmp_ptr) __THROW; libc_hidden_proto(pututline) #if 0 /* def __USE_MISC */ /* Reentrant versions of the file for handling utmp files. */ extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW; extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer, struct utmp **__result) __THROW; extern int getutline_r (__const struct utmp *__line, struct utmp *__buffer, struct utmp **__result) __THROW; #endif /* Use misc. */ __END_DECLS #endif /* utmp.h */
Bytewerk/uClinux-ipcam
uClibc/include/utmp.h
C
gpl-2.0
3,604
/* * Copyright (c) 2005, 2016, 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.xml.internal.stream.events; import com.sun.org.apache.xerces.internal.impl.PropertyManager; import java.util.List; import javax.xml.stream.util.XMLEventAllocator; import javax.xml.stream.*; import javax.xml.stream.events.*; import javax.xml.XMLConstants; import javax.xml.namespace.QName; import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper; import com.sun.org.apache.xerces.internal.util.NamespaceSupport; import javax.xml.stream.util.XMLEventConsumer; /** * Implementation of XMLEvent Allocator. * * @author Neeraj bajaj, k venugopal */ public class XMLEventAllocatorImpl implements XMLEventAllocator { /** * Creates a new instance of XMLEventAllocator */ public XMLEventAllocatorImpl() { } public XMLEvent allocate(XMLStreamReader xMLStreamReader) throws XMLStreamException { if (xMLStreamReader == null) { throw new XMLStreamException("Reader cannot be null"); } // allocate is not supposed to change the state of the reader so we shouldn't be calling next. // return getNextEvent(xMLStreamReader); return getXMLEvent(xMLStreamReader); } public void allocate(XMLStreamReader xMLStreamReader, XMLEventConsumer xMLEventConsumer) throws XMLStreamException { XMLEvent currentEvent = getXMLEvent(xMLStreamReader); if (currentEvent != null) { xMLEventConsumer.add(currentEvent); } return; } public javax.xml.stream.util.XMLEventAllocator newInstance() { return new XMLEventAllocatorImpl(); } //REVISIT: shouldn't we be using XMLEventFactory to create events. XMLEvent getXMLEvent(XMLStreamReader streamReader) { XMLEvent event = null; //returns the current event int eventType = streamReader.getEventType(); switch (eventType) { case XMLEvent.START_ELEMENT: { StartElementEvent startElementEvent = new StartElementEvent(getQName(streamReader)); fillAttributes(startElementEvent, streamReader); //we might have different XMLStreamReader so check every time for //the namespace aware property. we should be setting namespace //related values only when isNamespaceAware is 'true' if (((Boolean) streamReader.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE))) { fillNamespaceAttributes(startElementEvent, streamReader); setNamespaceContext(startElementEvent, streamReader); } startElementEvent.setLocation(streamReader.getLocation()); event = startElementEvent; break; } case XMLEvent.END_ELEMENT: { EndElementEvent endElementEvent = new EndElementEvent(getQName(streamReader)); endElementEvent.setLocation(streamReader.getLocation()); if (((Boolean) streamReader.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE))) { fillNamespaceAttributes(endElementEvent, streamReader); } event = endElementEvent; break; } case XMLEvent.PROCESSING_INSTRUCTION: { ProcessingInstructionEvent piEvent = new ProcessingInstructionEvent( streamReader.getPITarget(), streamReader.getPIData()); piEvent.setLocation(streamReader.getLocation()); event = piEvent; break; } case XMLEvent.CHARACTERS: { CharacterEvent cDataEvent = new CharacterEvent(streamReader.getText()); cDataEvent.setLocation(streamReader.getLocation()); event = cDataEvent; break; } case XMLEvent.COMMENT: { CommentEvent commentEvent = new CommentEvent(streamReader.getText()); commentEvent.setLocation(streamReader.getLocation()); event = commentEvent; break; } case XMLEvent.START_DOCUMENT: { StartDocumentEvent sdEvent = new StartDocumentEvent(); sdEvent.setVersion(streamReader.getVersion()); sdEvent.setEncoding(streamReader.getEncoding()); if (streamReader.getCharacterEncodingScheme() != null) { sdEvent.setDeclaredEncoding(true); } else { sdEvent.setDeclaredEncoding(false); } sdEvent.setStandalone(streamReader.isStandalone()); sdEvent.setLocation(streamReader.getLocation()); event = sdEvent; break; } case XMLEvent.END_DOCUMENT: { EndDocumentEvent endDocumentEvent = new EndDocumentEvent(); endDocumentEvent.setLocation(streamReader.getLocation()); event = endDocumentEvent; break; } case XMLEvent.ENTITY_REFERENCE: { EntityReferenceEvent entityEvent = new EntityReferenceEvent(streamReader.getLocalName(), new EntityDeclarationImpl(streamReader.getLocalName(), streamReader.getText())); entityEvent.setLocation(streamReader.getLocation()); event = entityEvent; break; } case XMLEvent.ATTRIBUTE: { event = null; break; } case XMLEvent.DTD: { DTDEvent dtdEvent = new DTDEvent(streamReader.getText()); dtdEvent.setLocation(streamReader.getLocation()); @SuppressWarnings("unchecked") List<EntityDeclaration> entities = (List<EntityDeclaration>) streamReader.getProperty(PropertyManager.STAX_ENTITIES); if (entities != null && entities.size() != 0) { dtdEvent.setEntities(entities); } @SuppressWarnings("unchecked") List<NotationDeclaration> notations = (List<NotationDeclaration>) streamReader.getProperty(PropertyManager.STAX_NOTATIONS); if (notations != null && !notations.isEmpty()) { dtdEvent.setNotations(notations); } event = dtdEvent; break; } case XMLEvent.CDATA: { CharacterEvent cDataEvent = new CharacterEvent(streamReader.getText(), true); cDataEvent.setLocation(streamReader.getLocation()); event = cDataEvent; break; } case XMLEvent.SPACE: { CharacterEvent spaceEvent = new CharacterEvent(streamReader.getText(), false, true); spaceEvent.setLocation(streamReader.getLocation()); event = spaceEvent; break; } } return event; } //this function is not used.. protected XMLEvent getNextEvent(XMLStreamReader streamReader) throws XMLStreamException { //advance the reader to next event. streamReader.next(); return getXMLEvent(streamReader); } protected void fillAttributes(StartElementEvent event, XMLStreamReader xmlr) { int len = xmlr.getAttributeCount(); QName qname = null; AttributeImpl attr = null; NamespaceImpl nattr = null; for (int i = 0; i < len; i++) { qname = xmlr.getAttributeName(i); //this method doesn't include namespace declarations //so we can be sure that there wont be any namespace declaration as part of this function call //we can avoid this check - nb. /** * prefix = qname.getPrefix(); localpart = qname.getLocalPart(); if * (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE) ) { attr = new * NamespaceImpl(localpart,xmlr.getAttributeValue(i)); }else if * (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)){ attr = new * NamespaceImpl(xmlr.getAttributeValue(i)); }else{ attr = new * AttributeImpl(); attr.setName(qname); } * */ attr = new AttributeImpl(); attr.setName(qname); attr.setAttributeType(xmlr.getAttributeType(i)); attr.setSpecified(xmlr.isAttributeSpecified(i)); attr.setValue(xmlr.getAttributeValue(i)); event.addAttribute(attr); } } protected void fillNamespaceAttributes(StartElementEvent event, XMLStreamReader xmlr) { int count = xmlr.getNamespaceCount(); String uri = null; String prefix = null; NamespaceImpl attr = null; for (int i = 0; i < count; i++) { uri = xmlr.getNamespaceURI(i); prefix = xmlr.getNamespacePrefix(i); if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } attr = new NamespaceImpl(prefix, uri); event.addNamespaceAttribute(attr); } } protected void fillNamespaceAttributes(EndElementEvent event, XMLStreamReader xmlr) { int count = xmlr.getNamespaceCount(); String uri = null; String prefix = null; NamespaceImpl attr = null; for (int i = 0; i < count; i++) { uri = xmlr.getNamespaceURI(i); prefix = xmlr.getNamespacePrefix(i); if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } attr = new NamespaceImpl(prefix, uri); event.addNamespace(attr); } } //Revisit : Creating a new Namespacecontext for now. //see if we can do better job. private void setNamespaceContext(StartElementEvent event, XMLStreamReader xmlr) { NamespaceContextWrapper contextWrapper = (NamespaceContextWrapper) xmlr.getNamespaceContext(); NamespaceSupport ns = new NamespaceSupport(contextWrapper.getNamespaceContext()); event.setNamespaceContext(new NamespaceContextWrapper(ns)); } private QName getQName(XMLStreamReader xmlr) { return new QName(xmlr.getNamespaceURI(), xmlr.getLocalName(), xmlr.getPrefix()); } }
md-5/jdk10
src/java.xml/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
Java
gpl-2.0
11,632
/* * Copyright (c) 2014 Google, Inc. * * Licensed under the terms of the GNU GPL License version 2 * * Selftests for execveat(2). */ #define _GNU_SOURCE /* to get O_PATH, AT_EMPTY_PATH */ #include <sys/sendfile.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static char longpath[2 * PATH_MAX] = ""; static char *envp[] = { "IN_TEST=yes", NULL, NULL }; static char *argv[] = { "execveat", "99", NULL }; static int execveat_(int fd, const char *path, char **argv, char **envp, int flags) { #ifdef __NR_execveat return syscall(__NR_execveat, fd, path, argv, envp, flags); #else errno = -ENOSYS; return -1; #endif } #define check_execveat_fail(fd, path, flags, errno) \ _check_execveat_fail(fd, path, flags, errno, #errno) static int _check_execveat_fail(int fd, const char *path, int flags, int expected_errno, const char *errno_str) { int rc; errno = 0; printf("Check failure of execveat(%d, '%s', %d) with %s... ", fd, path?:"(null)", flags, errno_str); rc = execveat_(fd, path, argv, envp, flags); if (rc > 0) { printf("[FAIL] (unexpected success from execveat(2))\n"); return 1; } if (errno != expected_errno) { printf("[FAIL] (expected errno %d (%s) not %d (%s)\n", expected_errno, strerror(expected_errno), errno, strerror(errno)); return 1; } printf("[OK]\n"); return 0; } static int check_execveat_invoked_rc(int fd, const char *path, int flags, int expected_rc) { int status; int rc; pid_t child; int pathlen = path ? strlen(path) : 0; if (pathlen > 40) printf("Check success of execveat(%d, '%.20s...%s', %d)... ", fd, path, (path + pathlen - 20), flags); else printf("Check success of execveat(%d, '%s', %d)... ", fd, path?:"(null)", flags); child = fork(); if (child < 0) { printf("[FAIL] (fork() failed)\n"); return 1; } if (child == 0) { /* Child: do execveat(). */ rc = execveat_(fd, path, argv, envp, flags); printf("[FAIL]: execveat() failed, rc=%d errno=%d (%s)\n", rc, errno, strerror(errno)); exit(1); /* should not reach here */ } /* Parent: wait for & check child's exit status. */ rc = waitpid(child, &status, 0); if (rc != child) { printf("[FAIL] (waitpid(%d,...) returned %d)\n", child, rc); return 1; } if (!WIFEXITED(status)) { printf("[FAIL] (child %d did not exit cleanly, status=%08x)\n", child, status); return 1; } if (WEXITSTATUS(status) != expected_rc) { printf("[FAIL] (child %d exited with %d not %d)\n", child, WEXITSTATUS(status), expected_rc); return 1; } printf("[OK]\n"); return 0; } static int check_execveat(int fd, const char *path, int flags) { return check_execveat_invoked_rc(fd, path, flags, 99); } static char *concat(const char *left, const char *right) { char *result = malloc(strlen(left) + strlen(right) + 1); strcpy(result, left); strcat(result, right); return result; } static int open_or_die(const char *filename, int flags) { int fd = open(filename, flags); if (fd < 0) { printf("Failed to open '%s'; " "check prerequisites are available\n", filename); exit(1); } return fd; } static void exe_cp(const char *src, const char *dest) { int in_fd = open_or_die(src, O_RDONLY); int out_fd = open(dest, O_RDWR|O_CREAT|O_TRUNC, 0755); struct stat info; fstat(in_fd, &info); sendfile(out_fd, in_fd, NULL, info.st_size); close(in_fd); close(out_fd); } #define XX_DIR_LEN 200 static int check_execveat_pathmax(int dot_dfd, const char *src, int is_script) { int fail = 0; int ii, count, len; char longname[XX_DIR_LEN + 1]; int fd; if (*longpath == '\0') { /* Create a filename close to PATH_MAX in length */ memset(longname, 'x', XX_DIR_LEN - 1); longname[XX_DIR_LEN - 1] = '/'; longname[XX_DIR_LEN] = '\0'; count = (PATH_MAX - 3) / XX_DIR_LEN; for (ii = 0; ii < count; ii++) { strcat(longpath, longname); mkdir(longpath, 0755); } len = (PATH_MAX - 3) - (count * XX_DIR_LEN); if (len <= 0) len = 1; memset(longname, 'y', len); longname[len] = '\0'; strcat(longpath, longname); } exe_cp(src, longpath); /* * Execute as a pre-opened file descriptor, which works whether this is * a script or not (because the interpreter sees a filename like * "/dev/fd/20"). */ fd = open(longpath, O_RDONLY); if (fd > 0) { printf("Invoke copy of '%s' via filename of length %zu:\n", src, strlen(longpath)); fail += check_execveat(fd, "", AT_EMPTY_PATH); } else { printf("Failed to open length %zu filename, errno=%d (%s)\n", strlen(longpath), errno, strerror(errno)); fail++; } /* * Execute as a long pathname relative to ".". If this is a script, * the interpreter will launch but fail to open the script because its * name ("/dev/fd/5/xxx....") is bigger than PATH_MAX. */ if (is_script) fail += check_execveat_invoked_rc(dot_dfd, longpath, 0, 127); else fail += check_execveat(dot_dfd, longpath, 0); return fail; } static int run_tests(void) { int fail = 0; char *fullname = realpath("execveat", NULL); char *fullname_script = realpath("script", NULL); char *fullname_symlink = concat(fullname, ".symlink"); int subdir_dfd = open_or_die("subdir", O_DIRECTORY|O_RDONLY); int subdir_dfd_ephemeral = open_or_die("subdir.ephemeral", O_DIRECTORY|O_RDONLY); int dot_dfd = open_or_die(".", O_DIRECTORY|O_RDONLY); int dot_dfd_path = open_or_die(".", O_DIRECTORY|O_RDONLY|O_PATH); int dot_dfd_cloexec = open_or_die(".", O_DIRECTORY|O_RDONLY|O_CLOEXEC); int fd = open_or_die("execveat", O_RDONLY); int fd_path = open_or_die("execveat", O_RDONLY|O_PATH); int fd_symlink = open_or_die("execveat.symlink", O_RDONLY); int fd_denatured = open_or_die("execveat.denatured", O_RDONLY); int fd_denatured_path = open_or_die("execveat.denatured", O_RDONLY|O_PATH); int fd_script = open_or_die("script", O_RDONLY); int fd_ephemeral = open_or_die("execveat.ephemeral", O_RDONLY); int fd_ephemeral_path = open_or_die("execveat.path.ephemeral", O_RDONLY|O_PATH); int fd_script_ephemeral = open_or_die("script.ephemeral", O_RDONLY); int fd_cloexec = open_or_die("execveat", O_RDONLY|O_CLOEXEC); int fd_script_cloexec = open_or_die("script", O_RDONLY|O_CLOEXEC); /* Change file position to confirm it doesn't affect anything */ lseek(fd, 10, SEEK_SET); /* Normal executable file: */ /* dfd + path */ fail += check_execveat(subdir_dfd, "../execveat", 0); fail += check_execveat(dot_dfd, "execveat", 0); fail += check_execveat(dot_dfd_path, "execveat", 0); /* absolute path */ fail += check_execveat(AT_FDCWD, fullname, 0); /* absolute path with nonsense dfd */ fail += check_execveat(99, fullname, 0); /* fd + no path */ fail += check_execveat(fd, "", AT_EMPTY_PATH); /* O_CLOEXEC fd + no path */ fail += check_execveat(fd_cloexec, "", AT_EMPTY_PATH); /* O_PATH fd */ fail += check_execveat(fd_path, "", AT_EMPTY_PATH); /* Mess with executable file that's already open: */ /* fd + no path to a file that's been renamed */ rename("execveat.ephemeral", "execveat.moved"); fail += check_execveat(fd_ephemeral, "", AT_EMPTY_PATH); /* fd + no path to a file that's been deleted */ unlink("execveat.moved"); /* remove the file now fd open */ fail += check_execveat(fd_ephemeral, "", AT_EMPTY_PATH); /* Mess with executable file that's already open with O_PATH */ /* fd + no path to a file that's been deleted */ unlink("execveat.path.ephemeral"); fail += check_execveat(fd_ephemeral_path, "", AT_EMPTY_PATH); /* Invalid argument failures */ fail += check_execveat_fail(fd, "", 0, ENOENT); fail += check_execveat_fail(fd, NULL, AT_EMPTY_PATH, EFAULT); /* Symlink to executable file: */ /* dfd + path */ fail += check_execveat(dot_dfd, "execveat.symlink", 0); fail += check_execveat(dot_dfd_path, "execveat.symlink", 0); /* absolute path */ fail += check_execveat(AT_FDCWD, fullname_symlink, 0); /* fd + no path, even with AT_SYMLINK_NOFOLLOW (already followed) */ fail += check_execveat(fd_symlink, "", AT_EMPTY_PATH); fail += check_execveat(fd_symlink, "", AT_EMPTY_PATH|AT_SYMLINK_NOFOLLOW); /* Symlink fails when AT_SYMLINK_NOFOLLOW set: */ /* dfd + path */ fail += check_execveat_fail(dot_dfd, "execveat.symlink", AT_SYMLINK_NOFOLLOW, ELOOP); fail += check_execveat_fail(dot_dfd_path, "execveat.symlink", AT_SYMLINK_NOFOLLOW, ELOOP); /* absolute path */ fail += check_execveat_fail(AT_FDCWD, fullname_symlink, AT_SYMLINK_NOFOLLOW, ELOOP); /* Shell script wrapping executable file: */ /* dfd + path */ fail += check_execveat(subdir_dfd, "../script", 0); fail += check_execveat(dot_dfd, "script", 0); fail += check_execveat(dot_dfd_path, "script", 0); /* absolute path */ fail += check_execveat(AT_FDCWD, fullname_script, 0); /* fd + no path */ fail += check_execveat(fd_script, "", AT_EMPTY_PATH); fail += check_execveat(fd_script, "", AT_EMPTY_PATH|AT_SYMLINK_NOFOLLOW); /* O_CLOEXEC fd fails for a script (as script file inaccessible) */ fail += check_execveat_fail(fd_script_cloexec, "", AT_EMPTY_PATH, ENOENT); fail += check_execveat_fail(dot_dfd_cloexec, "script", 0, ENOENT); /* Mess with script file that's already open: */ /* fd + no path to a file that's been renamed */ rename("script.ephemeral", "script.moved"); fail += check_execveat(fd_script_ephemeral, "", AT_EMPTY_PATH); /* fd + no path to a file that's been deleted */ unlink("script.moved"); /* remove the file while fd open */ fail += check_execveat(fd_script_ephemeral, "", AT_EMPTY_PATH); /* Rename a subdirectory in the path: */ rename("subdir.ephemeral", "subdir.moved"); fail += check_execveat(subdir_dfd_ephemeral, "../script", 0); fail += check_execveat(subdir_dfd_ephemeral, "script", 0); /* Remove the subdir and its contents */ unlink("subdir.moved/script"); unlink("subdir.moved"); /* Shell loads via deleted subdir OK because name starts with .. */ fail += check_execveat(subdir_dfd_ephemeral, "../script", 0); fail += check_execveat_fail(subdir_dfd_ephemeral, "script", 0, ENOENT); /* Flag values other than AT_SYMLINK_NOFOLLOW => EINVAL */ fail += check_execveat_fail(dot_dfd, "execveat", 0xFFFF, EINVAL); /* Invalid path => ENOENT */ fail += check_execveat_fail(dot_dfd, "no-such-file", 0, ENOENT); fail += check_execveat_fail(dot_dfd_path, "no-such-file", 0, ENOENT); fail += check_execveat_fail(AT_FDCWD, "no-such-file", 0, ENOENT); /* Attempt to execute directory => EACCES */ fail += check_execveat_fail(dot_dfd, "", AT_EMPTY_PATH, EACCES); /* Attempt to execute non-executable => EACCES */ fail += check_execveat_fail(dot_dfd, "Makefile", 0, EACCES); fail += check_execveat_fail(fd_denatured, "", AT_EMPTY_PATH, EACCES); fail += check_execveat_fail(fd_denatured_path, "", AT_EMPTY_PATH, EACCES); /* Attempt to execute nonsense FD => EBADF */ fail += check_execveat_fail(99, "", AT_EMPTY_PATH, EBADF); fail += check_execveat_fail(99, "execveat", 0, EBADF); /* Attempt to execute relative to non-directory => ENOTDIR */ fail += check_execveat_fail(fd, "execveat", 0, ENOTDIR); fail += check_execveat_pathmax(dot_dfd, "execveat", 0); fail += check_execveat_pathmax(dot_dfd, "script", 1); return fail; } static void prerequisites(void) { int fd; const char *script = "#!/bin/sh\nexit $*\n"; /* Create ephemeral copies of files */ exe_cp("execveat", "execveat.ephemeral"); exe_cp("execveat", "execveat.path.ephemeral"); exe_cp("script", "script.ephemeral"); mkdir("subdir.ephemeral", 0755); fd = open("subdir.ephemeral/script", O_RDWR|O_CREAT|O_TRUNC, 0755); write(fd, script, strlen(script)); close(fd); } int main(int argc, char **argv) { int ii; int rc; const char *verbose = getenv("VERBOSE"); if (argc >= 2) { /* If we are invoked with an argument, don't run tests. */ const char *in_test = getenv("IN_TEST"); if (verbose) { printf(" invoked with:"); for (ii = 0; ii < argc; ii++) printf(" [%d]='%s'", ii, argv[ii]); printf("\n"); } /* Check expected environment transferred. */ if (!in_test || strcmp(in_test, "yes") != 0) { printf("[FAIL] (no IN_TEST=yes in env)\n"); return 1; } /* Use the final argument as an exit code. */ rc = atoi(argv[argc - 1]); fflush(stdout); } else { prerequisites(); if (verbose) envp[1] = "VERBOSE=1"; rc = run_tests(); if (rc > 0) printf("%d tests failed\n", rc); } return rc; }
longman88/qspinlock-v14
tools/testing/selftests/exec/execveat.c
C
gpl-2.0
12,569
--[[ Luci statistics - processes plugin diagram definition (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: processes.lua 8044 2011-12-05 14:09:24Z jow $ ]]-- module("luci.statistics.rrdtool.definitions.processes", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) return { { title = "%H: Processes", vlabel = "Processes/s", data = { instances = { ps_state = { "sleeping", "running", "paging", "blocked", "stopped", "zombies" } }, options = { ps_state_sleeping = { color = "0000ff" }, ps_state_running = { color = "008000" }, ps_state_paging = { color = "ffff00" }, ps_state_blocked = { color = "ff5000" }, ps_state_stopped = { color = "555555" }, ps_state_zombies = { color = "ff0000" } } } }, { title = "%H: CPU time used by %pi", vlabel = "Jiffies", data = { sources = { ps_cputime = { "syst", "user" } }, options = { ps_cputime__user = { color = "0000ff", overlay = true }, ps_cputime__syst = { color = "ff0000", overlay = true } } } }, { title = "%H: Threads and processes belonging to %pi", vlabel = "Count", detail = true, data = { sources = { ps_count = { "threads", "processes" } }, options = { ps_count__threads = { color = "00ff00" }, ps_count__processes = { color = "0000bb" } } } }, { title = "%H: Page faults in %pi", vlabel = "Pagefaults", detail = true, data = { sources = { ps_pagefaults = { "minflt", "majflt" } }, options = { ps_pagefaults__minflt = { color = "ff0000" }, ps_pagefaults__majflt = { color = "ff5500" } } } }, { title = "%H: Virtual memory size of %pi", vlabel = "Bytes", detail = true, number_format = "%5.1lf%sB", data = { types = { "ps_rss" }, options = { ps_rss = { color = "0000ff" } } } } } end
Victek/wrt1900ac-aa
veriksystems/luci-0.11/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/processes.lua
Lua
gpl-2.0
2,234
<?php /** * Login form * * @author WooThemes * @package WooCommerce/Templates * @version 2.1.0 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( is_user_logged_in() ) return; ?> <form method="post" class="login" <?php if ( $hidden ) echo 'style="display:none;"'; ?>> <?php do_action( 'woocommerce_login_form_start' ); ?> <?php if ( $message ) echo wpautop( wptexturize( $message ) ); ?> <div class="form-group"> <label for="username"><?php _e( 'Username or email', 'woocommerce' ); ?> <span class="required">*</span></label> <input type="text" class="input-text form-control" name="username" id="username" /> </div> <div class="form-group"> <label for="password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label> <input class="input-text form-control" type="password" name="password" id="password" /> </div> <div class="clear"></div> <?php do_action( 'woocommerce_login_form' ); ?> <div class="checkbox"> <label for="rememberme" class="inline"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?> </label> </div> <?php wp_nonce_field( 'woocommerce-login' ); ?> <input type="submit" class="btn btn-primary" name="login" value="<?php _e( 'Login', 'woocommerce' ); ?>" /> <input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ) ?>" /> <p class="lost_password"> <a href="<?php echo esc_url( wc_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'woocommerce' ); ?></a> </p> <div class="clear"></div> <?php do_action( 'woocommerce_login_form_end' ); ?> </form>
ntngiri/Wordpress-dhaba
wp-content/themes/themeSite1/woocommerce/global/form-login.php
PHP
gpl-2.0
1,667
/* Copyright (C) 2008-2017 Free Software Foundation, Inc. Contributed by Richard Henderson <rth@redhat.com>. This file is part of the GNU Transactional Memory Library (libitm). Libitm 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. Libitm 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "libitm_i.h" namespace GTM HIDDEN { // This function needs to be noinline because we need to prevent that it gets // inlined into another function that calls further functions. This could // break our assumption that we only call memcpy and thus only need to // additionally protect the memcpy stack (see the hack in mask_stack_bottom()). // Even if that isn't an issue because those other calls don't happen during // copying, we still need mask_stack_bottom() to be called "close" to the // memcpy in terms of stack frames, so just ensure that for now using the // noinline. void __attribute__((noinline)) gtm_undolog::rollback (gtm_thread* tx, size_t until_size) { size_t i, n = undolog.size(); void *top = mask_stack_top(tx); void *bot = mask_stack_bottom(tx); if (n > 0) { for (i = n; i-- > until_size; ) { void *ptr = (void *) undolog[i--]; size_t len = undolog[i]; size_t words = (len + sizeof(gtm_word) - 1) / sizeof(gtm_word); i -= words; // Filter out any updates that overlap the libitm stack. We don't // bother filtering out just the overlapping bytes because we don't // merge writes and thus any overlapping write is either bogus or // would restore data on stack frames that are not in use anymore. // FIXME The memcpy can/will end up as another call but we // calculated BOT based on the current function. Can we inline or // reimplement this without too much trouble due to unaligned calls // and still have good performance, so that we can remove the hack // in mask_stack_bottom()? if (likely(ptr > top || (uint8_t*)ptr + len <= bot)) __builtin_memcpy (ptr, &undolog[i], len); } undolog.set_size(until_size); } } void ITM_REGPARM GTM_LB (const void *ptr, size_t len) { gtm_thread *tx = gtm_thr(); tx->undolog.log(ptr, len); } } // namespace GTM using namespace GTM; /* ??? Use configure to determine if aliases are supported. Or convince the compiler to not just tail call this, but actually generate the same_body_alias itself. */ void ITM_REGPARM _ITM_LB (const void *ptr, size_t len) { GTM_LB (ptr, len); } #define ITM_LOG_DEF(T) \ void ITM_REGPARM _ITM_L##T (const _ITM_TYPE_##T *ptr) \ { GTM_LB (ptr, sizeof (*ptr)); } ITM_LOG_DEF(U1) ITM_LOG_DEF(U2) ITM_LOG_DEF(U4) ITM_LOG_DEF(U8) ITM_LOG_DEF(F) ITM_LOG_DEF(D) ITM_LOG_DEF(E) ITM_LOG_DEF(CF) ITM_LOG_DEF(CD) ITM_LOG_DEF(CE)
mickael-guene/gcc
libitm/local.cc
C++
gpl-2.0
3,638