text
stringlengths 2
99.9k
| meta
dict |
---|---|
/******************************************************************************
*
* package: Log4Qt
* file: factory.h
* created: September 2007
* author: Martin Heinrich
*
*
* Copyright 2007 Martin Heinrich
*
* 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.
*
******************************************************************************/
#ifndef LOG4QT_HELPERS_FACTORY_H
#define LOG4QT_HELPERS_FACTORY_H
/******************************************************************************
* Dependencies
******************************************************************************/
#include <QtCore/QHash>
#include <QtCore/QMutex>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
class QMetaProperty;
class QObject;
QT_END_NAMESPACE
/******************************************************************************
* Declarations
******************************************************************************/
namespace Log4Qt
{
class Appender;
class Filter;
class Layout;
/*!
* \brief The class Factory provides factories for Appender, Filter and
* Layout objects.
*
* The functions createAppender(), createFilter() and createLayout()
* allow to create objects by specifying their class names. By default
* all classes of the package are recognised with their Log4j and Log4Qt
* classanmes. For example an object of the class FileAppender can be
* craeted using "org.apache.log4j.FileAppender" or "Log4Qt::FileAppender".
* Additional classes can be registered using registerAppender(),
* registerFilter() and registerLayout().
*
* An QObject property can be set from a string value with
* setObjectProperty(). The function handles the required error checking
* and type conversion.
*
* \note All the functions declared in this class are thread-safe.
*
* \sa PropertyConfigurator
*/
class Factory
{
public:
/*!
* Prototype for an Appender factory function. The function creates
* an Appender object on the heap and returns a pointer to it.
*
* \sa registerAppender(), createAppender()
*/
typedef Appender *(*AppenderFactoryFunc)();
/*!
* Prototype for a Filter factory function. The function creates
* a Filter object on the heap and returns a pointer to it.
*
* \sa registerFilter(), createFilter()
*/
typedef Filter *(*FilterFactoryFunc)();
/*!
* Prototype for a Layout factory function. The function creates
* a Layout object on the heap and returns a pointer to it.
*
* \sa registerLayout(), createLayout()
*/
typedef Layout *(*LayoutFactoryFunc)();
private:
Factory();
Q_DISABLE_COPY(Factory)
public:
/*!
* Creates an object for the class \a rAppenderClassName on the heap
* and returns a pointer to it. If the class has no registered factory
* function a null pointer is returned.
*
* \sa registerAppender(), unregisterAppender(), registeredAppenders()
*/
static Appender *createAppender(const QString &rAppenderClassName);
/*!
* This is an overloaded member function, provided for convenience.
*/
static Appender *createAppender(const char *pAppenderClassName);
/*!
* Creates an object for the class \a rFilterClassName on the heap
* and returns a pointer to it. If the class has no registered factory
* function a null pointer is returned.
*
* \sa registerFilter(), unregisterFilter(), registeredFilters()
*/
static Filter *createFilter(const QString &rFilterClassName);
/*!
* This is an overloaded member function, provided for convenience.
*/
static Filter *createFilter(const char *pFilterClassName);
/*!
* Creates an object for the class \a rLayoutClassName on the heap
* and returns a pointer to it. If the class has no registered factory
* function a null pointer is returned.
*
* \sa registerLayout(), unregisterLayout(), registeredLayouts()
*/
static Layout *createLayout(const QString &rLayoutClassName);
/*!
* This is an overloaded member function, provided for convenience.
*/
static Layout *createLayout(const char *pLayoutClassName);
/*!
* Returns the Factory instance.
*/
static Factory *instance();
/*!
* Registers the Appender factory function \a pAppenderFactoryFunc
* for the class \a rAppenderClassName. If a registered factory
* function exists for the class, it is replaced with
* \a pAppenderFactoryFunc.
*
* \sa unregisterAppender(), registeredAppenders(), createAppender()
*/
static void registerAppender(const QString &rAppenderClassName,
AppenderFactoryFunc pAppenderFactoryFunc);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void registerAppender(const char *pAppenderClassName,
AppenderFactoryFunc pAppenderFactoryFunc);
/*!
* Registers the Filter factory function \a pFilterFactoryFunc
* for the class \a rFilterClassName. If a registered factory
* function exists for the class, it is replaced with
* \a pFilterFactoryFunc.
*
* \sa unregisterFilter(), registeredFilters(), createFilter()
*/
static void registerFilter(const QString &rFilterClassName,
FilterFactoryFunc pFilterFactoryFunc);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void registerFilter(const char *pFilterClassName,
FilterFactoryFunc pFilterFactoryFunc);
/*!
* Registers the Layout factory function \a pLayoutFactoryFunc
* for the class \a rLayoutClassName. If a registered factory
* function exists for the class, it is replaced with
* \a pLayoutFactoryFunc.
*
* \sa unregisterLayout(), registeredLayout(), createLayout()
*/
static void registerLayout(const QString &rLayoutClassName,
LayoutFactoryFunc pLayoutFactoryFunc);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void registerLayout(const char *pLayoutClassName,
LayoutFactoryFunc pLayoutFactoryFunc);
/*!
* Returns a list of the class names for registered Appender factory
* functions.
*
* \sa registerAppender(), unregisterAppender()
*/
static QStringList registeredAppenders();
/*!
* Returns a list of the class names for registered Filter factory
* functions.
*
* \sa registerFilter(), unregisterFilter()
*/
static QStringList registeredFilters();
/*!
* Returns a list of the class names for registered Layout factory
* functions.
*
* \sa registerLayout(), unregisterLayout()
*/
static QStringList registeredLayouts();
/*!
* Sets the property \a rProperty of the object \a pObject to the
* value \a rValue. The function will test that the property
* \a rProperty is writeable and of a type the function can convert to.
* The types bool, int, Level and QString are supported.
*
* \sa OptionConverter
*/
static void setObjectProperty(QObject *pObject,
const QString &rProperty,
const QString &rValue);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void setObjectProperty(QObject *pObject,
const char *pProperty,
const QString &rValue);
/*!
* Unregisters the Appender factory function for the class
* \a rAppenderClassName.
*
* \sa registerAppender(), registeredAppenders()
*/
static void unregisterAppender(const QString &rAppenderClassName);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void unregisterAppender(const char *pAppenderClassName);
/*!
* Unregisters the Filter factory function for the class
* \a rFilterClassName.
*
* \sa registerFilter(), registeredFilters()
*/
static void unregisterFilter(const QString &rFilterClassName);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void unregisterFilter(const char *pFilterClassName);
/*!
* Unregisters the Layout factory function for the class
* \a rLayoutClassName.
*
* \sa registerLayout(), registeredLayouts()
*/
static void unregisterLayout(const QString &rLayoutClassName);
/*!
* This is an overloaded member function, provided for convenience.
*/
static void unregisterLayout(const char *pLayoutClassName);
private:
Appender *doCreateAppender(const QString &rAppenderClassName);
Filter *doCreateFilter(const QString &rFilterClassName);
Layout *doCreateLayout(const QString &rLayoutClassName);
void doRegisterAppender(const QString &rAppenderClassName,
AppenderFactoryFunc pAppenderFactoryFunc);
void doRegisterFilter(const QString &rFilterClassName,
FilterFactoryFunc pFilterFactoryFunc);
void doRegisterLayout(const QString &rLayoutClassName,
LayoutFactoryFunc pLayoutFactoryFunc);
void doSetObjectProperty(QObject *pObject,
const QString &rProperty,
const QString &rValue);
void doUnregisterAppender(const QString &rAppenderClassName);
void doUnregisterFilter(const QString &rFilterClassName);
void doUnregisterLayout(const QString &rLayoutClassName);
void registerDefaultAppenders();
void registerDefaultFilters();
void registerDefaultLayouts();
bool validateObjectProperty(QMetaProperty &rMetaProperty,
const QString &rProperty,
QObject *pObject);
private:
mutable QMutex mObjectGuard;
QHash<QString, AppenderFactoryFunc> mAppenderRegistry;
QHash<QString, FilterFactoryFunc> mFilterRegistry;
QHash<QString, LayoutFactoryFunc> mLayoutRegistry;
};
/**************************************************************************
* Operators, Helper
**************************************************************************/
#ifndef QT_NO_DEBUG_STREAM
/*!
* \relates Factory
*
* Writes all object member variables to the given debug stream \a rDebug and
* returns the stream.
*
* <tt>
* %Factory(appenderfactories:("Log4Qt::DebugAppender", "Log4Qt::NullAppender",
* "Log4Qt::ConsoleAppender", "org.apache.log4j.varia.DebugAppender",
* "org.apache.log4j.FileAppender", "org.apache.log4j.RollingFileAppender",
* "org.apache.log4j.DailyRollingFileAppender",
* "org.apache.log4j.varia.ListAppender",
* "org.apache.log4j.varia.NullAppender",
* "Log4Qt::FileAppender", "org.apache.log4j.ConsoleAppender",
* "Log4Qt::DailyRollingFileAppender", "Log4Qt::ListAppender",
* "Log4Qt::RollingFileAppender") filterfactories:
* ("Log4Qt::DenyAllFilter", "Log4Qt::StringMatchFilter",
* "Log4Qt::LevelRangeFilter", "org.apache.log4j.varia.DenyAllFilter",
* "org.apache.log4j.varia.LevelRangeFilter",
* "org.apache.log4j.varia.StringMatchFilter", "Log4Qt::LevelMatchFilter",
* "org.apache.log4j.varia.LevelMatchFilter") layoutfactories:
* ("org.apache.log4j.SimpleLayout", "Log4Qt::PatternLayout",
* "Log4Qt::SimpleLayout", "org.apache.log4j.TTCCLayout",
* "Log4Qt::TTCCLayout", "org.apache.log4j.PatternLayout") )
* </tt>
* \sa QDebug, Factory::logManager()
*/
QDebug operator<<(QDebug debug,
const Factory &rFactory);
#endif // QT_NO_DEBUG_STREAM
/**************************************************************************
* Inline
**************************************************************************/
inline Appender *Factory::createAppender(const QString &rAppenderClassName)
{
return instance()->doCreateAppender(rAppenderClassName);
}
inline Appender *Factory::createAppender(const char *pAppenderClassName)
{
return instance()->doCreateAppender(QLatin1String(pAppenderClassName));
}
inline Filter *Factory::createFilter(const QString &rFilterClassName)
{
return instance()->doCreateFilter(rFilterClassName);
}
inline Filter *Factory::createFilter(const char *pFilterClassName)
{
return instance()->doCreateFilter(QLatin1String(pFilterClassName));
}
inline Layout *Factory::createLayout(const QString &rLayoutClassName)
{
return instance()->doCreateLayout(rLayoutClassName);
}
inline Layout *Factory::createLayout(const char *pLayoutClassName)
{
return instance()->doCreateLayout(QLatin1String(pLayoutClassName));
}
inline void Factory::registerAppender(const QString &rAppenderClassName,
AppenderFactoryFunc pAppenderFactoryFunc)
{
instance()->doRegisterAppender(rAppenderClassName, pAppenderFactoryFunc);
}
inline void Factory::registerAppender(const char *pAppenderClassName,
AppenderFactoryFunc pAppenderFactoryFunc)
{
instance()->doRegisterAppender(QLatin1String(pAppenderClassName), pAppenderFactoryFunc);
}
inline void Factory::registerFilter(const QString &rFilterClassName,
FilterFactoryFunc pFilterFactoryFunc)
{
instance()->doRegisterFilter(rFilterClassName, pFilterFactoryFunc);
}
inline void Factory::registerFilter(const char *pFilterClassName,
FilterFactoryFunc pFilterFactoryFunc)
{
instance()->doRegisterFilter(QLatin1String(pFilterClassName), pFilterFactoryFunc);
}
inline void Factory::registerLayout(const QString &rLayoutClassName,
LayoutFactoryFunc pLayoutFactoryFunc)
{
instance()->doRegisterLayout(rLayoutClassName, pLayoutFactoryFunc);
}
inline void Factory::registerLayout(const char *pLayoutClassName,
LayoutFactoryFunc pLayoutFactoryFunc)
{
instance()->doRegisterLayout(QLatin1String(pLayoutClassName), pLayoutFactoryFunc);
}
inline QStringList Factory::registeredAppenders()
{
QMutexLocker locker(&instance()->mObjectGuard);
return instance()->mAppenderRegistry.keys();
}
inline QStringList Factory::registeredFilters()
{
QMutexLocker locker(&instance()->mObjectGuard);
return instance()->mFilterRegistry.keys();
}
inline QStringList Factory::registeredLayouts()
{
QMutexLocker locker(&instance()->mObjectGuard);
return instance()->mLayoutRegistry.keys();
}
inline void Factory::setObjectProperty(QObject *pObject,
const QString &rProperty,
const QString &rValue)
{
instance()->doSetObjectProperty(pObject, rProperty, rValue);
}
inline void Factory::setObjectProperty(QObject *pObject,
const char *pProperty,
const QString &rValue)
{
instance()->doSetObjectProperty(pObject, QLatin1String(pProperty), rValue);
}
inline void Factory::unregisterAppender(const QString &rAppenderClassName)
{
instance()->doUnregisterAppender(rAppenderClassName);
}
inline void Factory::unregisterAppender(const char *pAppenderClassName)
{
instance()->doUnregisterAppender(QLatin1String(pAppenderClassName));
}
inline void Factory::unregisterFilter(const QString &rFilterClassName)
{
instance()->doUnregisterFilter(rFilterClassName);
}
inline void Factory::unregisterFilter(const char *pFilterClassName)
{
instance()->doUnregisterFilter(QLatin1String(pFilterClassName));
}
inline void Factory::unregisterLayout(const QString &rLayoutClassName)
{
instance()->doUnregisterLayout(rLayoutClassName);
}
inline void Factory::unregisterLayout(const char *pLayoutClassName)
{
instance()->doUnregisterLayout(QLatin1String(pLayoutClassName));
}
} // namespace Log4Qt
// Q_DECLARE_TYPEINFO(Log4Qt::Factory, Q_COMPLEX_TYPE); // use default
#endif // LOG4QT_HELPERS_FACTORY_H
| {
"pile_set_name": "Github"
} |
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2012, Digium, Inc.
*
* Russell Bryant <[email protected]>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*!
* \file
*
* \brief Security Event Reporting Helpers
*
* \author Russell Bryant <[email protected]>
*/
/*** MODULEINFO
<support_level>core</support_level>
***/
/*** DOCUMENTATION
<managerEvent language="en_US" name="FailedACL">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request violates an ACL check.</synopsis>
<syntax>
<parameter name="EventTV">
<para>The time the event was detected.</para>
</parameter>
<parameter name="Severity">
<para>A relative severity of the security event.</para>
<enumlist>
<enum name="Informational"/>
<enum name="Error"/>
</enumlist>
</parameter>
<parameter name="Service">
<para>The Asterisk service that raised the security event.</para>
</parameter>
<parameter name="EventVersion">
<para>The version of this event.</para>
</parameter>
<parameter name="AccountID">
<para>The Service account associated with the security event
notification.</para>
</parameter>
<parameter name="SessionID">
<para>A unique identifier for the session in the service
that raised the event.</para>
</parameter>
<parameter name="LocalAddress">
<para>The address of the Asterisk service that raised the
security event.</para>
</parameter>
<parameter name="RemoteAddress">
<para>The remote address of the entity that caused the
security event to be raised.</para>
</parameter>
<parameter name="Module" required="false">
<para>If available, the name of the module that raised the event.</para>
</parameter>
<parameter name="ACLName" required="false">
<para>If available, the name of the ACL that failed.</para>
</parameter>
<parameter name="SessionTV" required="false">
<para>The timestamp reported by the session.</para>
</parameter>
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="InvalidAccountID">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request fails an authentication check due to an invalid account ID.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="SessionLimit">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request fails due to exceeding the number of allowed concurrent sessions for that service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="MemoryLimit">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request fails due to an internal memory allocation failure.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="LoadAverageLimit">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request fails because a configured load average limit has been reached.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="RequestNotSupported">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request fails due to some aspect of the requested item not being supported by the service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<parameter name="RequestType">
<para>The type of request attempted.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="RequestNotAllowed">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request is not allowed by the service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='RequestNotSupported']/managerEventInstance/syntax/parameter[@name='RequestType'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
<parameter name="RequestParams" required="false">
<para>Parameters provided to the rejected request.</para>
</parameter>
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="AuthMethodNotAllowed">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request used an authentication method not allowed by the service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<parameter name="AuthMethod">
<para>The authentication method attempted.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="RequestBadFormat">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request is received with bad formatting.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='RequestNotSupported']/managerEventInstance/syntax/parameter[@name='RequestType'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
<parameter name="AccountID" required="false">
<para>The account ID associated with the rejected request.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='RequestNotAllowed']/managerEventInstance/syntax/parameter[@name='RequestParams'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="SuccessfulAuth">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request successfully authenticates with a service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<parameter name="UsingPassword">
<para>Whether or not the authentication attempt included a password.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="UnexpectedAddress">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request has a different source address then what is expected for a session already in progress with a service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<parameter name="ExpectedAddress">
<para>The address that the request was expected to use.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="ChallengeResponseFailed">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<parameter name="Challenge">
<para>The challenge that was sent.</para>
</parameter>
<parameter name="Response">
<para>The response that was received.</para>
</parameter>
<parameter name="ExpectedResponse">
<para>The expected response to the challenge.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="InvalidPassword">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request provides an invalid password during an authentication attempt.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
<parameter name="Challenge" required="false">
<para>The challenge that was sent.</para>
</parameter>
<parameter name="ReceivedChallenge" required="false">
<para>The challenge that was received.</para>
</parameter>
<parameter name="ReceivedHash" required="false">
<para>The hash that was received.</para>
</parameter>
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="ChallengeSent">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when an Asterisk service sends an authentication challenge to a request.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='ChallengeResponseFailed']/managerEventInstance/syntax/parameter[@name='Challenge'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="InvalidTransport">
<managerEventInstance class="EVENT_FLAG_SECURITY">
<synopsis>Raised when a request attempts to use a transport not allowed by the Asterisk service.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventTV'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Severity'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Service'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='EventVersion'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='AccountID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionID'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='LocalAddress'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
<parameter name="AttemptedTransport">
<para>The transport type that the request attempted to use.</para>
</parameter>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
</syntax>
</managerEventInstance>
</managerEvent>
***/
#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/strings.h"
#include "asterisk/network.h"
#include "asterisk/event.h"
#include "asterisk/security_events.h"
#include "asterisk/netsock2.h"
#include "asterisk/stasis.h"
#include "asterisk/json.h"
#include "asterisk/astobj2.h"
static const size_t SECURITY_EVENT_BUF_INIT_LEN = 256;
/*! \brief Security Topic */
static struct stasis_topic *security_topic;
struct stasis_topic *ast_security_topic(void)
{
return security_topic;
}
static int append_event_str_single(struct ast_str **str, struct ast_json *json,
const enum ast_event_ie_type ie_type)
{
const char *ie_type_key = ast_event_get_ie_type_name(ie_type);
struct ast_json *json_string = ast_json_object_get(json, ie_type_key);
if (!json_string) {
return 0;
}
if (ast_str_append(str, 0, "%s: %s\r\n", ie_type_key, S_OR(ast_json_string_get(json_string), "")) == -1) {
return -1;
}
return 0;
}
static int append_event_str_from_json(struct ast_str **str, struct ast_json *json,
const struct ast_security_event_ie_type *ies)
{
unsigned int i;
if (!ies) {
return 0;
}
for (i = 0; ies[i].ie_type != AST_EVENT_IE_END; i++) {
if (append_event_str_single(str, json, ies[i].ie_type)) {
return -1;
}
}
return 0;
}
static struct ast_manager_event_blob *security_event_to_ami_blob(struct ast_json *json)
{
RAII_VAR(struct ast_str *, str, NULL, ast_free);
struct ast_json *event_type_json;
enum ast_security_event_type event_type;
event_type_json = ast_json_object_get(json, "SecurityEvent");
event_type = ast_json_integer_get(event_type_json);
ast_assert((unsigned int)event_type < AST_SECURITY_EVENT_NUM_TYPES);
if (!(str = ast_str_create(SECURITY_EVENT_BUF_INIT_LEN))) {
return NULL;
}
if (append_event_str_from_json(&str, json,
ast_security_event_get_required_ies(event_type))) {
ast_log(AST_LOG_ERROR, "Failed to issue a security event to AMI: "
"error occurred when adding required event fields.\n");
return NULL;
}
if (append_event_str_from_json(&str, json,
ast_security_event_get_optional_ies(event_type))) {
ast_log(AST_LOG_ERROR, "Failed to issue a security event to AMI: "
"error occurred when adding optional event fields.\n");
return NULL;
}
return ast_manager_event_blob_create(EVENT_FLAG_SECURITY,
ast_security_event_get_name(event_type),
"%s",
ast_str_buffer(str));
}
static struct ast_manager_event_blob *security_event_to_ami(struct stasis_message *message)
{
struct ast_json_payload *payload = stasis_message_data(message);
if (stasis_message_type(message) != ast_security_event_type()) {
return NULL;
}
if (!payload) {
return NULL;
}
return security_event_to_ami_blob(payload->json);
}
/*! \brief Message type for security events */
STASIS_MESSAGE_TYPE_DEFN(ast_security_event_type,
.to_ami = security_event_to_ami,
);
static void security_stasis_cleanup(void)
{
ao2_cleanup(security_topic);
security_topic = NULL;
STASIS_MESSAGE_TYPE_CLEANUP(ast_security_event_type);
}
int ast_security_stasis_init(void)
{
ast_register_cleanup(security_stasis_cleanup);
security_topic = stasis_topic_create("security:all");
if (!security_topic) {
return -1;
}
if (STASIS_MESSAGE_TYPE_INIT(ast_security_event_type)) {
return -1;
}
return 0;
}
static const struct {
const char *name;
uint32_t version;
enum ast_security_event_severity severity;
#define MAX_SECURITY_IES 12
struct ast_security_event_ie_type required_ies[MAX_SECURITY_IES];
struct ast_security_event_ie_type optional_ies[MAX_SECURITY_IES];
#undef MAX_SECURITY_IES
} sec_events[AST_SECURITY_EVENT_NUM_TYPES] = {
#define SEC_EVT_FIELD(e, field) (offsetof(struct ast_security_event_##e, field))
[AST_SECURITY_EVENT_FAILED_ACL] = {
.name = "FailedACL",
.version = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_ACL_NAME, SEC_EVT_FIELD(failed_acl, acl_name) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_INVAL_ACCT_ID] = {
.name = "InvalidAccountID",
.version = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_SESSION_LIMIT] = {
.name = "SessionLimit",
.version = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_MEM_LIMIT] = {
.name = "MemoryLimit",
.version = AST_SECURITY_EVENT_MEM_LIMIT_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_LOAD_AVG] = {
.name = "LoadAverageLimit",
.version = AST_SECURITY_EVENT_LOAD_AVG_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_REQ_NO_SUPPORT] = {
.name = "RequestNotSupported",
.version = AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_REQUEST_TYPE, SEC_EVT_FIELD(req_no_support, request_type) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_REQ_NOT_ALLOWED] = {
.name = "RequestNotAllowed",
.version = AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_REQUEST_TYPE, SEC_EVT_FIELD(req_not_allowed, request_type) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_REQUEST_PARAMS, SEC_EVT_FIELD(req_not_allowed, request_params) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED] = {
.name = "AuthMethodNotAllowed",
.version = AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_AUTH_METHOD, SEC_EVT_FIELD(auth_method_not_allowed, auth_method) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_REQ_BAD_FORMAT] = {
.name = "RequestBadFormat",
.version = AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_REQUEST_TYPE, SEC_EVT_FIELD(req_bad_format, request_type) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_REQUEST_PARAMS, SEC_EVT_FIELD(req_bad_format, request_params) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_SUCCESSFUL_AUTH] = {
.name = "SuccessfulAuth",
.version = AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_INFO,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_USING_PASSWORD, SEC_EVT_FIELD(successful_auth, using_password) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_UNEXPECTED_ADDR] = {
.name = "UnexpectedAddress",
.version = AST_SECURITY_EVENT_UNEXPECTED_ADDR_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_EXPECTED_ADDR, SEC_EVT_FIELD(unexpected_addr, expected_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_CHAL_RESP_FAILED] = {
.name = "ChallengeResponseFailed",
.version = AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_CHALLENGE, SEC_EVT_FIELD(chal_resp_failed, challenge) },
{ AST_EVENT_IE_RESPONSE, SEC_EVT_FIELD(chal_resp_failed, response) },
{ AST_EVENT_IE_EXPECTED_RESPONSE, SEC_EVT_FIELD(chal_resp_failed, expected_response) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_INVAL_PASSWORD] = {
.name = "InvalidPassword",
.version = AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_CHALLENGE, SEC_EVT_FIELD(inval_password, challenge) },
{ AST_EVENT_IE_RECEIVED_CHALLENGE, SEC_EVT_FIELD(inval_password, received_challenge) },
{ AST_EVENT_IE_RECEIVED_HASH, SEC_EVT_FIELD(inval_password, received_hash) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_CHAL_SENT] = {
.name = "ChallengeSent",
.version = AST_SECURITY_EVENT_CHAL_SENT_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_INFO,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_CHALLENGE, SEC_EVT_FIELD(chal_sent, challenge) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
[AST_SECURITY_EVENT_INVAL_TRANSPORT] = {
.name = "InvalidTransport",
.version = AST_SECURITY_EVENT_INVAL_TRANSPORT_VERSION,
.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
.required_ies = {
{ AST_EVENT_IE_EVENT_TV, 0 },
{ AST_EVENT_IE_SEVERITY, 0 },
{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
{ AST_EVENT_IE_ATTEMPTED_TRANSPORT, SEC_EVT_FIELD(inval_transport, transport) },
{ AST_EVENT_IE_END, 0 }
},
.optional_ies = {
{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
{ AST_EVENT_IE_END, 0 }
},
},
#undef SEC_EVT_FIELD
};
static const struct {
enum ast_security_event_severity severity;
const char *str;
} severities[] = {
{ AST_SECURITY_EVENT_SEVERITY_INFO, "Informational" },
{ AST_SECURITY_EVENT_SEVERITY_ERROR, "Error" },
};
const char *ast_security_event_severity_get_name(
const enum ast_security_event_severity severity)
{
unsigned int i;
for (i = 0; i < ARRAY_LEN(severities); i++) {
if (severities[i].severity == severity) {
return severities[i].str;
}
}
return NULL;
}
static int check_event_type(const enum ast_security_event_type event_type)
{
if ((unsigned int)event_type >= AST_SECURITY_EVENT_NUM_TYPES) {
ast_log(LOG_ERROR, "Invalid security event type %u\n", event_type);
return -1;
}
return 0;
}
const char *ast_security_event_get_name(const enum ast_security_event_type event_type)
{
if (check_event_type(event_type)) {
return NULL;
}
return sec_events[event_type].name;
}
const struct ast_security_event_ie_type *ast_security_event_get_required_ies(
const enum ast_security_event_type event_type)
{
if (check_event_type(event_type)) {
return NULL;
}
return sec_events[event_type].required_ies;
}
const struct ast_security_event_ie_type *ast_security_event_get_optional_ies(
const enum ast_security_event_type event_type)
{
if (check_event_type(event_type)) {
return NULL;
}
return sec_events[event_type].optional_ies;
}
static int add_ip_json_object(struct ast_json *json, enum ast_event_ie_type ie_type,
const struct ast_security_event_ip_addr *addr)
{
struct ast_json *json_ip;
json_ip = ast_json_ipaddr(addr->addr, addr->transport);
if (!json_ip) {
return -1;
}
return ast_json_object_set(json, ast_event_get_ie_type_name(ie_type), json_ip);
}
enum ie_required {
NOT_REQUIRED,
REQUIRED
};
static int add_json_object(struct ast_json *json, const struct ast_security_event_common *sec,
const struct ast_security_event_ie_type *ie_type, enum ie_required req)
{
int res = 0;
switch (ie_type->ie_type) {
case AST_EVENT_IE_SERVICE:
case AST_EVENT_IE_ACCOUNT_ID:
case AST_EVENT_IE_SESSION_ID:
case AST_EVENT_IE_MODULE:
case AST_EVENT_IE_ACL_NAME:
case AST_EVENT_IE_REQUEST_TYPE:
case AST_EVENT_IE_REQUEST_PARAMS:
case AST_EVENT_IE_AUTH_METHOD:
case AST_EVENT_IE_CHALLENGE:
case AST_EVENT_IE_RESPONSE:
case AST_EVENT_IE_EXPECTED_RESPONSE:
case AST_EVENT_IE_RECEIVED_CHALLENGE:
case AST_EVENT_IE_RECEIVED_HASH:
case AST_EVENT_IE_ATTEMPTED_TRANSPORT:
{
const char *str;
struct ast_json *json_string;
str = *((const char **)(((const char *) sec) + ie_type->offset));
if (req && !str) {
ast_log(LOG_WARNING, "Required IE '%d' (%s) for security event "
"type '%u' (%s) not present\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type),
sec->event_type, ast_security_event_get_name(sec->event_type));
res = -1;
break;
}
if (!str) {
break;
}
json_string = ast_json_string_create(str);
if (!json_string) {
res = -1;
break;
}
res = ast_json_object_set(json, ast_event_get_ie_type_name(ie_type->ie_type), json_string);
break;
}
case AST_EVENT_IE_EVENT_VERSION:
case AST_EVENT_IE_USING_PASSWORD:
{
struct ast_json *json_string;
uint32_t val;
val = *((const uint32_t *)(((const char *) sec) + ie_type->offset));
json_string = ast_json_stringf("%u", val);
if (!json_string) {
res = -1;
break;
}
res = ast_json_object_set(json, ast_event_get_ie_type_name(ie_type->ie_type), json_string);
break;
}
case AST_EVENT_IE_LOCAL_ADDR:
case AST_EVENT_IE_REMOTE_ADDR:
case AST_EVENT_IE_EXPECTED_ADDR:
{
const struct ast_security_event_ip_addr *addr;
addr = (const struct ast_security_event_ip_addr *)(((const char *) sec) + ie_type->offset);
if (req && !addr->addr) {
ast_log(LOG_WARNING, "Required IE '%d' (%s) for security event "
"type '%u' (%s) not present\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type),
sec->event_type, ast_security_event_get_name(sec->event_type));
res = -1;
}
if (addr->addr) {
res = add_ip_json_object(json, ie_type->ie_type, addr);
}
break;
}
case AST_EVENT_IE_SESSION_TV:
{
const struct timeval *tval;
tval = *((const struct timeval **)(((const char *) sec) + ie_type->offset));
if (req && !tval) {
ast_log(LOG_WARNING, "Required IE '%d' (%s) for security event "
"type '%u' (%s) not present\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type),
sec->event_type, ast_security_event_get_name(sec->event_type));
res = -1;
}
if (tval) {
struct ast_json *json_tval = ast_json_timeval(*tval, NULL);
if (!json_tval) {
res = -1;
break;
}
res = ast_json_object_set(json, ast_event_get_ie_type_name(ie_type->ie_type), json_tval);
}
break;
}
case AST_EVENT_IE_EVENT_TV:
case AST_EVENT_IE_SEVERITY:
/* Added automatically, nothing to do here. */
break;
default:
ast_log(LOG_WARNING, "Unhandled IE type '%d' (%s), this security event "
"will be missing data.\n", ie_type->ie_type,
ast_event_get_ie_type_name(ie_type->ie_type));
break;
}
return res;
}
static struct ast_json *alloc_security_event_json_object(const struct ast_security_event_common *sec)
{
struct timeval tv = ast_tvnow();
const char *severity_str;
struct ast_json *json_temp;
RAII_VAR(struct ast_json *, json_object, ast_json_object_create(), ast_json_unref);
if (!json_object) {
return NULL;
}
/* NOTE: Every time ast_json_object_set is used, json_temp becomes a stale pointer since the reference is taken.
* This is true even if ast_json_object_set fails.
*/
json_temp = ast_json_integer_create(sec->event_type);
if (!json_temp || ast_json_object_set(json_object, "SecurityEvent", json_temp)) {
return NULL;
}
json_temp = ast_json_stringf("%u", sec->version);
if (!json_temp || ast_json_object_set(json_object, ast_event_get_ie_type_name(AST_EVENT_IE_EVENT_VERSION), json_temp)) {
return NULL;
}
/* AST_EVENT_IE_EVENT_TV */
json_temp = ast_json_timeval(tv, NULL);
if (!json_temp || ast_json_object_set(json_object, ast_event_get_ie_type_name(AST_EVENT_IE_EVENT_TV), json_temp)) {
return NULL;
}
/* AST_EVENT_IE_SERVICE */
json_temp = ast_json_string_create(sec->service);
if (!json_temp || ast_json_object_set(json_object, ast_event_get_ie_type_name(AST_EVENT_IE_SERVICE), json_temp)) {
return NULL;
}
/* AST_EVENT_IE_SEVERITY */
severity_str = S_OR(
ast_security_event_severity_get_name(sec_events[sec->event_type].severity),
"Unknown"
);
json_temp = ast_json_string_create(severity_str);
if (!json_temp || ast_json_object_set(json_object, ast_event_get_ie_type_name(AST_EVENT_IE_SEVERITY), json_temp)) {
return NULL;
}
return ast_json_ref(json_object);
}
static int handle_security_event(const struct ast_security_event_common *sec)
{
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
RAII_VAR(struct ast_json_payload *, json_payload, NULL, ao2_cleanup);
RAII_VAR(struct ast_json *, json_object, NULL, ast_json_unref);
const struct ast_security_event_ie_type *ies;
unsigned int i;
if (!ast_security_event_type()) {
return -1;
}
json_object = alloc_security_event_json_object(sec);
if (!json_object) {
return -1;
}
for (ies = ast_security_event_get_required_ies(sec->event_type), i = 0;
ies[i].ie_type != AST_EVENT_IE_END;
i++) {
if (add_json_object(json_object, sec, ies + i, REQUIRED)) {
goto return_error;
}
}
for (ies = ast_security_event_get_optional_ies(sec->event_type), i = 0;
ies[i].ie_type != AST_EVENT_IE_END;
i++) {
if (add_json_object(json_object, sec, ies + i, NOT_REQUIRED)) {
goto return_error;
}
}
/* The json blob is ready. Throw it in the payload and send it out over stasis. */
if (!(json_payload = ast_json_payload_create(json_object))) {
goto return_error;
}
msg = stasis_message_create(ast_security_event_type(), json_payload);
if (!msg) {
goto return_error;
}
stasis_publish(ast_security_topic(), msg);
return 0;
return_error:
return -1;
}
int ast_security_event_report(const struct ast_security_event_common *sec)
{
if ((unsigned int)sec->event_type >= AST_SECURITY_EVENT_NUM_TYPES) {
ast_log(LOG_ERROR, "Invalid security event type\n");
return -1;
}
if (!sec_events[sec->event_type].name) {
ast_log(LOG_WARNING, "Security event type %u not handled\n",
sec->event_type);
return -1;
}
if (sec->version != sec_events[sec->event_type].version) {
ast_log(LOG_WARNING, "Security event %u version mismatch\n",
sec->event_type);
return -1;
}
if (handle_security_event(sec)) {
ast_log(LOG_ERROR, "Failed to issue security event of type %s.\n",
ast_security_event_get_name(sec->event_type));
}
return 0;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
* The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Computer Systems
* Engineering Group at Lawrence Berkeley Laboratory.
* 4. Neither the name of the University nor of the Laboratory may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
*/
/*
* Utilities for message formatting used both by libpcap and rpcapd.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "ftmacros.h"
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <pcap/pcap.h>
#include "portability.h"
#include "fmtutils.h"
/*
* Generate an error message based on a format, arguments, and an
* errno, with a message for the errno after the formatted output.
*/
void
pcap_fmt_errmsg_for_errno(char *errbuf, size_t errbuflen, int errnum,
const char *fmt, ...)
{
va_list ap;
size_t msglen;
char *p;
size_t errbuflen_remaining;
va_start(ap, fmt);
pcap_vsnprintf(errbuf, errbuflen, fmt, ap);
va_end(ap);
msglen = strlen(errbuf);
/*
* Do we have enough space to append ": "?
* Including the terminating '\0', that's 3 bytes.
*/
if (msglen + 3 > errbuflen) {
/* No - just give them what we've produced. */
return;
}
p = errbuf + msglen;
errbuflen_remaining = errbuflen - msglen;
*p++ = ':';
*p++ = ' ';
*p = '\0';
msglen += 2;
errbuflen_remaining -= 2;
/*
* Now append the string for the error code.
*/
#if defined(HAVE_STRERROR_S)
/*
* We have a Windows-style strerror_s().
*/
errno_t err = strerror_s(p, errbuflen_remaining, errnum);
if (err != 0) {
/*
* It doesn't appear to be documented anywhere obvious
* what the error returns from strerror_s().
*/
pcap_snprintf(p, errbuflen_remaining, "Error %d", errnum);
}
#elif defined(HAVE_GNU_STRERROR_R)
/*
* We have a GNU-style strerror_r(), which is *not* guaranteed to
* do anything to the buffer handed to it, and which returns a
* pointer to the error string, which may or may not be in
* the buffer.
*
* It is, however, guaranteed to succeed.
*/
char strerror_buf[PCAP_ERRBUF_SIZE];
char *errstring = strerror_r(errnum, strerror_buf, PCAP_ERRBUF_SIZE);
pcap_snprintf(p, errbuflen_remaining, "%s", errstring);
#elif defined(HAVE_POSIX_STRERROR_R)
/*
* We have a POSIX-style strerror_r(), which is guaranteed to fill
* in the buffer, but is not guaranteed to succeed.
*/
int err = strerror_r(errnum, p, errbuflen_remaining);
if (err == EINVAL) {
/*
* UNIX 03 says this isn't guaranteed to produce a
* fallback error message.
*/
pcap_snprintf(p, errbuflen_remaining, "Unknown error: %d",
errnum);
} else if (err == ERANGE) {
/*
* UNIX 03 says this isn't guaranteed to produce a
* fallback error message.
*/
pcap_snprintf(p, errbuflen_remaining,
"Message for error %d is too long", errnum);
}
#else
/*
* We have neither strerror_s() nor strerror_r(), so we're
* stuck with using pcap_strerror().
*/
pcap_snprintf(p, errbuflen_remaining, "%s", pcap_strerror(errnum));
#endif
}
#ifdef _WIN32
/*
* Generate an error message based on a format, arguments, and a
* Win32 error, with a message for the Win32 error after the formatted output.
*/
void
pcap_fmt_errmsg_for_win32_err(char *errbuf, size_t errbuflen, DWORD errnum,
const char *fmt, ...)
{
va_list ap;
size_t msglen;
char *p;
size_t errbuflen_remaining;
DWORD retval;
char win32_errbuf[PCAP_ERRBUF_SIZE+1];
va_start(ap, fmt);
pcap_vsnprintf(errbuf, errbuflen, fmt, ap);
va_end(ap);
msglen = strlen(errbuf);
/*
* Do we have enough space to append ": "?
* Including the terminating '\0', that's 3 bytes.
*/
if (msglen + 3 > errbuflen) {
/* No - just give them what we've produced. */
return;
}
p = errbuf + msglen;
errbuflen_remaining = errbuflen - msglen;
*p++ = ':';
*p++ = ' ';
*p = '\0';
msglen += 2;
errbuflen_remaining -= 2;
/*
* Now append the string for the error code.
*
* XXX - what language ID to use?
*
* For UN*Xes, pcap_strerror() may or may not return localized
* strings.
*
* We currently don't have localized messages for libpcap, but
* we might want to do so. On the other hand, if most of these
* messages are going to be read by libpcap developers and
* perhaps by developers of libpcap-based applications, English
* might be a better choice, so the developer doesn't have to
* get the message translated if it's in a language they don't
* happen to understand.
*/
retval = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
NULL, errnum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
win32_errbuf, PCAP_ERRBUF_SIZE, NULL);
if (retval == 0) {
/*
* Failed.
*/
pcap_snprintf(p, errbuflen_remaining,
"Couldn't get error message for error (%lu)", errnum);
return;
}
pcap_snprintf(p, errbuflen_remaining, "%s (%lu)", win32_errbuf, errnum);
}
#endif
| {
"pile_set_name": "Github"
} |
dl {
padding-left: 0;
}
dt {
font-weight: bold;
margin-top: 10px;
}
dt:first-child {
margin-top: 0;
}
dd {
margin-left: 20px;
} | {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import * as React from 'react';
import { landmarksAssessmentInstanceDetailsColumnRenderer } from 'assessments/landmarks/landmarks-instance-details-column-renderer';
import { LandmarksAssessmentProperties } from '../../../../common/types/store-data/assessment-result-data';
import { AssessmentInstanceDetailsColumn } from '../../../../DetailsView/components/assessment-instance-details-column';
import { AssessmentInstanceRowData } from '../../../../DetailsView/components/assessment-instance-table';
import { LandmarkFormatter } from '../../../../injected/visualization/landmark-formatter';
describe('LandmarksInstanceDetailsColumnRendererTest', () => {
test('render', () => {
const item = {
instance: {
propertyBag: {
role: 'banner',
label: 'label',
},
},
} as AssessmentInstanceRowData<LandmarksAssessmentProperties>;
const expected = (
<AssessmentInstanceDetailsColumn
background={LandmarkFormatter.getStyleForLandmarkRole('banner').borderColor}
textContent={'banner: label'}
tooltipId={null}
customClassName="radio"
/>
);
expect(expected).toEqual(landmarksAssessmentInstanceDetailsColumnRenderer(item));
});
test('render: label is null', () => {
const item = {
instance: {
propertyBag: {
role: 'banner',
label: null,
},
},
} as AssessmentInstanceRowData<LandmarksAssessmentProperties>;
const expected = (
<AssessmentInstanceDetailsColumn
background={LandmarkFormatter.getStyleForLandmarkRole('banner').borderColor}
textContent={'banner'}
tooltipId={null}
customClassName="radio"
/>
);
expect(expected).toEqual(landmarksAssessmentInstanceDetailsColumnRenderer(item));
});
});
| {
"pile_set_name": "Github"
} |
#define HAVE_GETENV 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIBPAPER 1
#define HAVE_LIBPNG 1
#define HAVE_STDINT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_TIMEZONE 1
#define HAVE_TM_GMTOFF 1
#define HAVE_ZLIB 1
#define HAVE_ZLIB_COMPRESS2 1
#define VERSION "20200926"
#if defined(__gnu_linux__) && defined(__i386__)
#define _FILE_OFFSET_BITS 64
#endif
#define ZLIB_CONST 1
| {
"pile_set_name": "Github"
} |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
class ibex_icache_core_back_line_seq extends ibex_icache_core_base_seq;
`uvm_object_utils(ibex_icache_core_back_line_seq)
`uvm_object_new
bit req_phase = 0;
bit [31:0] last_branch;
protected virtual task run_req(ibex_icache_core_req_item req, ibex_icache_core_rsp_item rsp);
bit [31:0] min_addr, max_addr;
start_item(req);
// The allowed address range depends on the phase. In the first phase, we behave like the normal
// caching sequence: pick something somewhere near the base address. In the second phase, we go
// "back a bit" from the previous address.
if (!req_phase) begin
min_addr = base_addr;
max_addr = top_restricted_addr;
end else begin
min_addr = last_branch < 16 ? 0 : last_branch - 16;
max_addr = last_branch;
end
`DV_CHECK_RANDOMIZE_WITH_FATAL(
req,
// Lots of branches!
req.trans_type == ICacheCoreTransTypeBranch;
// Constrain branch targets
req.branch_addr inside {[min_addr:max_addr]};
// Ask for at most 5 insns in either phase (in the first phase, this means we have a chance
// of jumping back when the cache isn't ready yet).
num_insns <= 5;
// The cache should always be enabled and never invalidated (unless must_invalidate is true)
enable == 1'b1;
invalidate == must_invalidate;
)
finish_item(req);
get_response(rsp);
last_branch = req.branch_addr;
req_phase = !req_phase;
endtask
endclass : ibex_icache_core_back_line_seq
| {
"pile_set_name": "Github"
} |
{
"action": {
"environmental": {
"variety": [
"Power failure"
]
}
},
"actor": {
"external": {
"country": [
"Unknown"
],
"motive": [
"NA"
],
"region": [
"000000"
],
"variety": [
"Force majeure"
]
}
},
"asset": {
"assets": [
{
"variety": "S - Mail"
},
{
"variety": "S - Unknown"
},
{
"variety": "S - Web application"
}
],
"cloud": [
"Unknown"
],
"notes": "Following enumerations present before veris 1.3.3 removed: asset.governance.Personally owned."
},
"attribute": {
"availability": {
"variety": [
"Interruption"
]
}
},
"discovery_method": {
"unknown": true
},
"impact": {
"overall_rating": "Unknown"
},
"incident_id": "BF8CD58E-7F61-4DC8-B3C0-815D83CBA4F4",
"plus": {
"analysis_status": "First pass",
"analyst": "Spitler",
"created": "2014-03-07T19:38:00Z",
"github": "1320",
"master_id": "BF8CD58E-7F61-4DC8-B3C0-815D83CBA4F4",
"modified": "2014-03-07T19:38:00Z",
"timeline": {
"notification": {
"day": 6,
"month": 1,
"year": 2014
}
}
},
"reference": "http://www.theregister.co.uk/2014/01/06/fasthosts_weekend_outage/",
"schema_version": "1.3.4",
"security_incident": "Confirmed",
"source_id": "vcdb",
"summary": "Storm-realted outage affects UK hosting organization.",
"timeline": {
"incident": {
"day": 4,
"month": 1,
"year": 2014
}
},
"victim": {
"country": [
"GB"
],
"employee_count": "101 to 1000",
"industry": "518210",
"region": [
"150154"
],
"victim_id": "Fasthosts"
}
} | {
"pile_set_name": "Github"
} |
; 30
####
# ###
# .. #
# $$ #
##### ###
## # #
# #
#### ##$.##
# ##@## #
##.$## ####
# #
# # ##
### #####
# $$ #
# .. #
### #
####
| {
"pile_set_name": "Github"
} |
<template>
<div class="md-tabs">
<md-tab-bar
ref="tabBar"
:items="menus"
:value="currentName"
:has-ink="hasInk"
:ink-length="inkLength"
:immediate="immediate"
@change="$_handleTabClick"
/>
<div class="md-tabs-content">
<slot></slot>
</div>
</div>
</template>
<script>
import TabBar from '../tab-bar'
export default {
name: 'md-tabs',
components: {
[TabBar.name]: TabBar,
},
props: {
value: String,
hasInk: {
type: Boolean,
default: true,
},
inkLength: {
type: Number,
default: 80,
},
immediate: Boolean,
},
data() {
return {
currentName: this.value,
prevIndex: 0,
panes: [],
}
},
watch: {
value(val) {
if (val !== this.currentName) {
this.currentName = val
}
},
},
computed: {
menus() {
return this.panes.map(pane => {
return {
name: pane.name,
label: pane.label,
disabled: pane.disabled,
}
})
},
currentIndex() {
for (let i = 0, len = this.menus.length; i < len; i++) {
if (this.menus[i].name === this.currentName) {
return i
}
}
return 0
},
},
provide() {
return {
rootTabs: this,
}
},
mounted() {
if (!this.currentName && this.menus.length) {
this.currentName = this.menus[0].name
}
},
methods: {
// MARK: private events
$_handleTabClick(tab, index, prevIndex) {
this.currentName = tab.name
this.prevIndex = prevIndex
this.$emit('input', tab.name)
this.$emit('change', tab)
},
// MARK: private methods
$_addPane(pane) {
if (this.panes.indexOf(pane) === -1) {
this.panes.push(pane)
}
},
$_removePane(pane) {
const index = this.panes.indexOf(pane)
if (index >= 0) {
this.panes.splice(index, 1)
}
},
reflowTabBar() {
this.$refs.tabBar.reflow()
},
},
}
</script>
<style lang="stylus">
.md-tabs-content
position relative
width 100%
overflow hidden
</style>
| {
"pile_set_name": "Github"
} |
using System.Collections.Generic;
using System.Data;
using System.Data.SqlTypes;
using System.Xml;
using System.Xml.Linq;
namespace LinqToDB.DataProvider.SqlCe
{
using Common;
using Data;
using Mapping;
using SchemaProvider;
using SqlProvider;
using System.Threading;
using System.Threading.Tasks;
public class SqlCeDataProvider : DynamicDataProviderBase<SqlCeProviderAdapter>
{
public SqlCeDataProvider()
: this(ProviderName.SqlCe, new SqlCeMappingSchema())
{
}
protected SqlCeDataProvider(string name, MappingSchema mappingSchema)
: base(name, mappingSchema, SqlCeProviderAdapter.GetInstance())
{
SqlProviderFlags.IsSubQueryColumnSupported = false;
SqlProviderFlags.IsCountSubQuerySupported = false;
SqlProviderFlags.IsApplyJoinSupported = true;
SqlProviderFlags.IsInsertOrUpdateSupported = false;
SqlProviderFlags.IsCrossJoinSupported = true;
SqlProviderFlags.IsDistinctOrderBySupported = false;
SqlProviderFlags.IsOrderByAggregateFunctionsSupported = false;
SqlProviderFlags.IsDistinctSetOperationsSupported = false;
SqlProviderFlags.IsUpdateFromSupported = false;
SetCharFieldToType<char>("NChar", (r, i) => DataTools.GetChar(r, i));
SetCharField("NChar", (r,i) => r.GetString(i).TrimEnd(' '));
SetCharField("NVarChar", (r,i) => r.GetString(i).TrimEnd(' '));
_sqlOptimizer = new SqlCeSqlOptimizer(SqlProviderFlags);
}
#region Overrides
public override ISqlBuilder CreateSqlBuilder(MappingSchema mappingSchema)
{
return new SqlCeSqlBuilder(this, mappingSchema, GetSqlOptimizer(), SqlProviderFlags);
}
readonly ISqlOptimizer _sqlOptimizer;
public override ISqlOptimizer GetSqlOptimizer()
{
return _sqlOptimizer;
}
public override ISchemaProvider GetSchemaProvider()
{
return new SqlCeSchemaProvider();
}
public override void SetParameter(DataConnection dataConnection, IDbDataParameter parameter, string name, DbDataType dataType, object? value)
{
switch (dataType.DataType)
{
case DataType.Xml :
dataType = dataType.WithDataType(DataType.NVarChar);
if (value is SqlXml xml) value = xml.IsNull ? null : xml.Value;
else if (value is XDocument xdoc) value = xdoc.ToString();
else if (value is XmlDocument doc) value = doc.InnerXml;
break;
}
base.SetParameter(dataConnection, parameter, name, dataType, value);
}
protected override void SetParameterType(DataConnection dataConnection, IDbDataParameter parameter, DbDataType dataType)
{
SqlDbType? type = null;
switch (dataType.DataType)
{
case DataType.Text :
case DataType.NText : type = SqlDbType.NText; break;
case DataType.VarChar :
case DataType.NVarChar : type = SqlDbType.NVarChar; break;
case DataType.Timestamp : type = SqlDbType.Timestamp; break;
case DataType.Binary : type = SqlDbType.Binary; break;
case DataType.VarBinary : type = SqlDbType.VarBinary; break;
case DataType.Image : type = SqlDbType.Image; break;
}
if (type != null)
{
var param = TryGetProviderParameter(parameter, dataConnection.MappingSchema);
if (param != null)
{
Adapter.SetDbType(param, type.Value);
return;
}
}
switch (dataType.DataType)
{
case DataType.SByte : parameter.DbType = DbType.Int16; return;
case DataType.UInt16 : parameter.DbType = DbType.Int32; return;
case DataType.UInt32 : parameter.DbType = DbType.Int64; return;
case DataType.UInt64 : parameter.DbType = DbType.Decimal; return;
case DataType.VarNumeric : parameter.DbType = DbType.Decimal; return;
case DataType.Char : parameter.DbType = DbType.StringFixedLength; return;
case DataType.Date :
case DataType.DateTime2 : parameter.DbType = DbType.DateTime; return;
case DataType.Money : parameter.DbType = DbType.Currency; return;
case DataType.Text :
case DataType.VarChar :
case DataType.NText : parameter.DbType = DbType.String; return;
case DataType.Timestamp :
case DataType.Binary :
case DataType.Image : parameter.DbType = DbType.Binary; return;
}
base.SetParameterType(dataConnection, parameter, dataType);
}
#endregion
public override bool? IsDBNullAllowed(IDataReader reader, int idx)
{
return true;
}
#region BulkCopy
public override BulkCopyRowsCopied BulkCopy<T>(
ITable<T> table, BulkCopyOptions options, IEnumerable<T> source)
{
return new SqlCeBulkCopy().BulkCopy(
options.BulkCopyType == BulkCopyType.Default ? SqlCeTools.DefaultBulkCopyType : options.BulkCopyType,
table,
options,
source);
}
public override Task<BulkCopyRowsCopied> BulkCopyAsync<T>(
ITable<T> table, BulkCopyOptions options, IEnumerable<T> source, CancellationToken cancellationToken)
{
return new SqlCeBulkCopy().BulkCopyAsync(
options.BulkCopyType == BulkCopyType.Default ? SqlCeTools.DefaultBulkCopyType : options.BulkCopyType,
table,
options,
source,
cancellationToken);
}
#if !NETFRAMEWORK
public override Task<BulkCopyRowsCopied> BulkCopyAsync<T>(
ITable<T> table, BulkCopyOptions options, IAsyncEnumerable<T> source, CancellationToken cancellationToken)
{
return new SqlCeBulkCopy().BulkCopyAsync(
options.BulkCopyType == BulkCopyType.Default ? SqlCeTools.DefaultBulkCopyType : options.BulkCopyType,
table,
options,
source,
cancellationToken);
}
#endif
#endregion
}
}
| {
"pile_set_name": "Github"
} |
(function () {
var laroute = (function () {
var routes = {
absolute: $ABSOLUTE$,
rootUrl: Vars.public_url,
routes : $ROUTES$,
prefix: '$PREFIX$',
route : function (name, parameters, route) {
route = route || this.getByName(name);
if ( ! route ) {
return undefined;
}
return this.toRoute(route, parameters);
},
url: function (url, parameters) {
parameters = parameters || [];
var uri = url + '/' + parameters.join('/');
return this.getCorrectUrl(uri);
},
toRoute : function (route, parameters) {
var uri = this.replaceNamedParameters(route.uri, parameters);
var qs = this.getRouteQueryString(parameters);
if (this.absolute && this.isOtherHost(route)){
return "//" + route.host + "/" + uri + qs;
}
return this.getCorrectUrl(uri + qs);
},
isOtherHost: function (route){
return route.host && route.host != window.location.hostname;
},
replaceNamedParameters : function (uri, parameters) {
uri = uri.replace(/\{(.*?)\??\}/g, function(match, key) {
if (parameters.hasOwnProperty(key)) {
var value = parameters[key];
delete parameters[key];
return value;
} else {
return match;
}
});
// Strip out any optional parameters that were not given
uri = uri.replace(/\/\{.*?\?\}/g, '');
return uri;
},
getRouteQueryString : function (parameters) {
var qs = [];
for (var key in parameters) {
if (parameters.hasOwnProperty(key)) {
qs.push(key + '=' + parameters[key]);
}
}
if (qs.length < 1) {
return '';
}
return '?' + qs.join('&');
},
getByName : function (name) {
for (var key in this.routes) {
if (this.routes.hasOwnProperty(key) && this.routes[key].name === name) {
return this.routes[key];
}
}
},
getByAction : function(action) {
for (var key in this.routes) {
if (this.routes.hasOwnProperty(key) && this.routes[key].action === action) {
return this.routes[key];
}
}
},
getCorrectUrl: function (uri) {
var url = this.prefix + '/' + uri.replace(/^\/?/, '');
if ( ! this.absolute) {
return url;
}
return this.rootUrl.replace('/\/?$/', '') + url;
}
};
var getLinkAttributes = function(attributes) {
if ( ! attributes) {
return '';
}
var attrs = [];
for (var key in attributes) {
if (attributes.hasOwnProperty(key)) {
attrs.push(key + '="' + attributes[key] + '"');
}
}
return attrs.join(' ');
};
var getHtmlLink = function (url, title, attributes) {
title = title || url;
attributes = getLinkAttributes(attributes);
return '<a href="' + url + '" ' + attributes + '>' + title + '</a>';
};
return {
// Generate a url for a given controller action.
// $NAMESPACE$.action('HomeController@getIndex', [params = {}])
action : function (name, parameters) {
parameters = parameters || {};
return routes.route(name, parameters, routes.getByAction(name));
},
// Generate a url for a given named route.
// $NAMESPACE$.route('routeName', [params = {}])
route : function (route, parameters) {
parameters = parameters || {};
return routes.route(route, parameters);
},
// Add route: used by modules
add_routes : function (new_routes) {
new_routes = new_routes || [];
routes.routes = routes.routes.concat(new_routes);
},
// Generate a fully qualified URL to the given path.
// $NAMESPACE$.route('url', [params = {}])
url : function (route, parameters) {
parameters = parameters || {};
return routes.url(route, parameters);
},
// Generate a html link to the given url.
// $NAMESPACE$.link_to('foo/bar', [title = url], [attributes = {}])
link_to : function (url, title, attributes) {
url = this.url(url);
return getHtmlLink(url, title, attributes);
},
// Generate a html link to the given route.
// $NAMESPACE$.link_to_route('route.name', [title=url], [parameters = {}], [attributes = {}])
link_to_route : function (route, title, parameters, attributes) {
var url = this.route(route, parameters);
return getHtmlLink(url, title, attributes);
},
// Generate a html link to the given controller action.
// $NAMESPACE$.link_to_action('HomeController@getIndex', [title=url], [parameters = {}], [attributes = {}])
link_to_action : function(action, title, parameters, attributes) {
var url = this.action(action, parameters);
return getHtmlLink(url, title, attributes);
}
};
}).call(this);
/**
* Expose the class either via AMD, CommonJS or the global object
*/
if (typeof define === 'function' && define.amd) {
define(function () {
return laroute;
});
}
else if (typeof module === 'object' && module.exports){
module.exports = laroute;
}
else {
window.$NAMESPACE$ = laroute;
}
}).call(this);
| {
"pile_set_name": "Github"
} |
[[
"start",
["xml-pe.doctype.xml","<!"],
["xml-pe.doctype.xml","DOCTYPE"],
["text.whitespace.xml"," "],
["xml-pe.xml","html"],
["xml-pe.doctype.xml",">"]
],[
"start",
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.tag-close.xml",">"],
["text.xml","Cloud9 Rocks!"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start"
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","table"],
["text.tag-whitespace.xml"," "],
["entity.other.attribute-name.xml","class"],
["keyword.operator.attribute-equals.xml","="],
["string.attribute-value.xml","\"table\""],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.tag-close.xml",">"],
["text.xml","Name"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.tag-close.xml",">"],
["text.xml","Size"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["markup.list.meta.tag","<%"],
["text"," "],
["keyword","if"],
["text"," "],
["paren.lparen","("],
["keyword.operator","!"],
["identifier","isRoot"],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"],
["text"," "],
["markup.list.meta.tag","%>"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.anchor.tag-name.xml","a"],
["text.tag-whitespace.xml"," "],
["entity.other.attribute-name.xml","href"],
["keyword.operator.attribute-equals.xml","="],
["string.attribute-value.xml","\"..\""],
["meta.tag.punctuation.tag-close.xml",">"],
["text.xml",".."],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["markup.list.meta.tag","<%"],
["text"," "],
["paren.rparen","}"],
["text"," "],
["markup.list.meta.tag","%>"]
],[
"start",
["text.xml"," "],
["markup.list.meta.tag","<%"],
["text"," "],
["identifier","entries"],
["punctuation.operator","."],
["identifier","forEach"],
["paren.lparen","("],
["storage.type","function"],
["paren.lparen","("],
["identifier","entry"],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"],
["text"," "],
["markup.list.meta.tag","%>"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.tag-name.xml","span"],
["text.tag-whitespace.xml"," "],
["entity.other.attribute-name.xml","class"],
["keyword.operator.attribute-equals.xml","="],
["string.attribute-value.xml","\"glyphicon "],
["markup.list.meta.tag","<%="],
["text"," "],
["identifier","entry"],
["punctuation.operator","."],
["identifier","mime"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["string","'directory'"],
["text"," "],
["punctuation.operator","?"],
["text"," "],
["string","'folder'"],
["punctuation.operator",":"],
["text"," "],
["string","'file'"],
["markup.list.meta.tag","%>"],
["string.attribute-value.xml","\""],
["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.tag-name.xml","span"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.anchor.tag-name.xml","a"],
["text.tag-whitespace.xml"," "],
["entity.other.attribute-name.xml","href"],
["keyword.operator.attribute-equals.xml","="],
["string.attribute-value.xml","\""],
["markup.list.meta.tag","<%="],
["text"," "],
["identifier","entry"],
["punctuation.operator","."],
["identifier","name"],
["text"," "],
["markup.list.meta.tag","%>"],
["string.attribute-value.xml","\""],
["meta.tag.punctuation.tag-close.xml",">"],
["markup.list.meta.tag","<%="],
["text"," "],
["identifier","entry"],
["punctuation.operator","."],
["identifier","name"],
["text"," "],
["markup.list.meta.tag","%>"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"],
["markup.list.meta.tag","<%="],
["text"," "],
["identifier","entry"],
["punctuation.operator","."],
["identifier","size"],
["text"," "],
["markup.list.meta.tag","%>"],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "],
["markup.list.meta.tag","<%"],
["text"," "],
["paren.rparen","})"],
["text"," "],
["markup.list.meta.tag","%>"]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.table.tag-name.xml","table"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["text.xml"," "]
],[
"start",
["text.xml"," "],
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.tag-close.xml",">"]
],[
"start",
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.tag-close.xml",">"]
]] | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
/**
* Class defined for safe calls of getClassLoader methods of any kind (context/system/class
* classloader. This MUST be package private and defined in every package which
* uses such invocations.
* @author snajper
*/
class SecureLoader {
static ClassLoader getContextClassLoader() {
if (System.getSecurityManager() == null) {
return Thread.currentThread().getContextClassLoader();
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public java.lang.Object run() {
return Thread.currentThread().getContextClassLoader();
}
});
}
}
static ClassLoader getClassClassLoader(final Class c) {
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public java.lang.Object run() {
return c.getClassLoader();
}
});
}
}
static ClassLoader getSystemClassLoader() {
if (System.getSecurityManager() == null) {
return ClassLoader.getSystemClassLoader();
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public java.lang.Object run() {
return ClassLoader.getSystemClassLoader();
}
});
}
}
}
| {
"pile_set_name": "Github"
} |
package Haiku;
BEGIN {
use strict;
use vars qw|$VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK|;
require Exporter;
require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
$VERSION = '0.34';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@EXPORT = qw(
);
@EXPORT_OK = qw(
);
}
bootstrap Haiku;
1;
__END__
=head1 NAME
Haiku - Interfaces to some Haiku API Functions
=head1 DESCRIPTION
The Haiku module contains functions to access Haiku APIs.
=head2 Alphabetical Listing of Haiku Functions
=over
=item Haiku::debug_printf(FORMAT,...)
Similar to printf, but prints to system debug output.
=item Haiku::debugger(FORMAT,...)
Drops the program into the debugger. The printf like arguments define the
debugger message.
=item Haiku::ktrace_printf(FORMAT,...)
Similar to printf, but prints to a kernel tracing entry.
=back
=cut
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<!--
#######################################
- THE HEAD PART -
######################################
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>SLIDER REVOLUTION - The Responsive Slider Plugin</title>
<!-- get jQuery from the google apis -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
<!-- CSS STYLE-->
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<!-- THE PREVIEW STYLE SHEETS, NO NEED TO LOAD IN YOUR DOM -->
<link rel="stylesheet" type="text/css" href="css/noneed.css" media="screen" />
<!-- SLIDER REVOLUTION 4.x SCRIPTS -->
<script type="text/javascript" src="rs-plugin/js/jquery.themepunch.tools.min.js"></script>
<script type="text/javascript" src="rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
<!-- SLIDER REVOLUTION 4.x CSS SETTINGS -->
<link rel="stylesheet" type="text/css" href="css/extralayers.css" media="screen" />
<link rel="stylesheet" type="text/css" href="rs-plugin/css/settings.css" media="screen" />
<!-- GOOGLE FONTS -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700,800' rel='stylesheet' type='text/css'>
</head>
<!--
#######################################
- THE BODY PART -
######################################
-->
<body>
<!-- HEADER -->
<header class="header">
<section class="container">
<article class="logo-container"><a href="http://themes.themepunch.com/?theme=revolution_jq"><div class="logo"></div></a></article>
<div class="button-holder"><a href="http://codecanyon.net/item/slider-revolution-responsive-jquery-plugin/2580848" target="_blank" class="button"><strong>BUY NOW</strong></a></div>
<div style="clear:both"></div>
</section>
</header> <!-- END OF HEADER -->
<!-- START REVOLUTION SLIDER 4.5.0 fullwidth mode -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway:100,200,300,700,800,900' rel='stylesheet' type='text/css'>
<!--
#################################
- THEMEPUNCH BANNER -
#################################
-->
<div class="tp-banner-container">
<div class="tp-banner" >
<ul> <!-- SLIDE -->
<li data-transition="slidehorizontal" data-slotamount="1" data-masterspeed="1000" data-thumb="http://themepunch.com/revolution/wp-content/uploads/2014/05/video_woman_cover3-320x200.jpg" data-fstransition="fade" data-fsmasterspeed="1000" data-fsslotamount="7" data-saveperformance="off" data-title="Free on the Beach">
<!-- MAIN IMAGE -->
<img src="http://themepunch.com/revolution/wp-content/uploads/2014/05/video_woman_cover3.jpg" alt="video_woman_cover3" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat">
<!-- LAYERS -->
<!-- LAYER NR. 1 -->
<div class="tp-caption tp-fade fadeout fullscreenvideo"
data-x="0"
data-y="0"
data-speed="1000"
data-start="1100"
data-easing="Power4.easeOut"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1500"
data-endeasing="Power4.easeIn"
data-autoplay="true"
data-autoplayonlyfirsttime="false"
data-nextslideatend="true"
data-volume="mute" data-forceCover="1" data-aspectratio="16:9" data-forcerewind="on" style="z-index: 2;"><video class="" preload="none" width="100%" height="100%"
poster='http://themepunch.com/revolution/wp-content/uploads/2014/05/video_woman_cover2.jpg'>
<source src='http://themepunch.com/revolution/wp-content/uploads/2014/05/woman_sun.mp4' type='video/mp4' />
<source src='http://themepunch.com/revolution/wp-content/uploads/2014/05/woman_sun.webm' type='video/webm' />
</video>
</div>
<!-- LAYER NR. 2 -->
<div class="tp-caption black_thin_whitebg_30 customin ltl tp-resizeme"
data-x="730"
data-y="360"
data-customin="x:0;y:0;z:0;rotationX:90;rotationY:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
data-speed="1500"
data-start="2100"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 3; max-width: auto; max-height: auto; white-space: nowrap;">Ready to create Magnificent
</div>
<!-- LAYER NR. 3 -->
<div class="tp-caption black_heavy_60 customin ltl tp-resizeme"
data-x="739"
data-y="278"
data-customin="x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0;scaleY:0;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;"
data-speed="1500"
data-start="1100"
data-easing="Power4.easeOut"
data-splitin="chars"
data-splitout="none"
data-elementdelay="0.1"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;">HTML5
</div>
<!-- LAYER NR. 4 -->
<div class="tp-caption randomrotate ltl"
data-x="961"
data-y="291"
data-speed="1500"
data-start="1600"
data-easing="Power4.easeOut"
data-elementdelay="0.1"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 5;"><img src="http://themepunch.com/revolution/wp-content/uploads/2014/05/redbg.png" alt="">
</div>
<!-- LAYER NR. 5 -->
<div class="tp-caption light_heavy_34 customin ltl tp-resizeme"
data-x="970"
data-y="296"
data-customin="x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0;scaleY:0;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;"
data-speed="1500"
data-start="1800"
data-easing="Power4.easeOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 6; max-width: auto; max-height: auto; white-space: nowrap;">Video
</div>
<!-- LAYER NR. 6 -->
<div class="tp-caption black_thin_whitebg_30 customin ltl tp-resizeme"
data-x="730"
data-y="405"
data-customin="x:0;y:0;z:0;rotationX:90;rotationY:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
data-speed="1500"
data-start="2400"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 7; max-width: auto; max-height: auto; white-space: nowrap;">Video Sliders that will perfect
</div>
<!-- LAYER NR. 7 -->
<div class="tp-caption black_thin_whitebg_30 customin ltl tp-resizeme"
data-x="730"
data-y="450"
data-customin="x:0;y:0;z:0;rotationX:90;rotationY:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
data-speed="1500"
data-start="2700"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 8; max-width: auto; max-height: auto; white-space: nowrap;">your Website experience.
</div>
</li>
<!-- SLIDE -->
<li data-transition="slidehorizontal" data-slotamount="1" data-masterspeed="1000" data-thumb="http://themepunch.com/revolution/wp-content/uploads/2014/05/video_typing_cover-320x200.jpg" data-saveperformance="off" data-title="Quick Results">
<!-- MAIN IMAGE -->
<img src="http://themepunch.com/revolution/wp-content/uploads/2014/05/video_typing_cover.jpg" alt="video_typing_cover" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat">
<!-- LAYERS -->
<!-- LAYER NR. 1 -->
<div class="tp-caption tp-fade fadeout fullscreenvideo"
data-x="0"
data-y="0"
data-speed="1000"
data-start="1100"
data-easing="Power4.easeOut"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1500"
data-endeasing="Power4.easeIn"
data-autoplay="true"
data-autoplayonlyfirsttime="false"
data-nextslideatend="true"
data-volume="mute" data-forceCover="1" data-aspectratio="16:9" data-forcerewind="on" style="z-index: 2;"><video class="" preload="none" width="100%" height="100%"
poster='http://themepunch.com/revolution/wp-content/uploads/2014/05/video_typing_cover.jpg'>
<source src='http://themepunch.com/revolution/wp-content/uploads/2014/05/computer_typing.mp4' type='video/mp4' />
<source src='http://themepunch.com/revolution/wp-content/uploads/2014/05/computer_typing.webm' type='video/webm' />
</video>
</div>
<!-- LAYER NR. 2 -->
<div class="tp-caption black_thin_blackbg_30 customin ltl tp-resizeme"
data-x="700"
data-y="360"
data-customin="x:0;y:0;z:0;rotationX:90;rotationY:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
data-speed="1500"
data-start="2100"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 3; max-width: auto; max-height: auto; white-space: nowrap;">An intuitive visual interface
</div>
<!-- LAYER NR. 3 -->
<div class="tp-caption white_heavy_60 customin ltl tp-resizeme"
data-x="700"
data-y="278"
data-customin="x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0;scaleY:0;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;"
data-speed="1500"
data-start="1100"
data-easing="Power4.easeOut"
data-splitin="chars"
data-splitout="none"
data-elementdelay="0.1"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;">Quick
</div>
<!-- LAYER NR. 4 -->
<div class="tp-caption black_thin_blackbg_30 customin ltl tp-resizeme"
data-x="700"
data-y="405"
data-customin="x:0;y:0;z:0;rotationX:90;rotationY:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
data-speed="1500"
data-start="2400"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 5; max-width: auto; max-height: auto; white-space: nowrap;">Set up slides in minutes
</div>
<!-- LAYER NR. 5 -->
<div class="tp-caption black_thin_blackbg_30 customin ltl tp-resizeme"
data-x="700"
data-y="450"
data-customin="x:0;y:0;z:0;rotationX:90;rotationY:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;opacity:0;transformPerspective:200;transformOrigin:50% 0%;"
data-speed="1500"
data-start="2700"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 6; max-width: auto; max-height: auto; white-space: nowrap;">Safe precious time!
</div>
<!-- LAYER NR. 6 -->
<div class="tp-caption light_thin_60 customin ltl tp-resizeme"
data-x="880"
data-y="278"
data-customin="x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0;scaleY:0;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;"
data-speed="1500"
data-start="1800"
data-easing="Power4.easeOut"
data-splitin="chars"
data-splitout="none"
data-elementdelay="0.1"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 7; max-width: auto; max-height: auto; white-space: nowrap;">Results
</div>
</li>
<!-- SLIDE -->
<li data-transition="slidehorizontal" data-slotamount="1" data-masterspeed="1000" data-thumb="http://themepunch.com/revolution/wp-content/uploads/2014/05/video_space_cover-320x200.jpg" data-saveperformance="off" data-title="Infinite Possibilities">
<!-- MAIN IMAGE -->
<img src="http://themepunch.com/revolution/wp-content/uploads/2014/05/video_space_cover.jpg" alt="video_space_cover" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat">
<!-- LAYERS -->
<!-- LAYER NR. 1 -->
<div class="tp-caption tp-fade fadeout fullscreenvideo"
data-x="0"
data-y="0"
data-speed="1000"
data-start="1100"
data-easing="Power4.easeOut"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1500"
data-endeasing="Power4.easeIn"
data-autoplay="true"
data-autoplayonlyfirsttime="false"
data-nextslideatend="true"
data-volume="mute" data-forceCover="1" data-aspectratio="16:9" data-forcerewind="on" style="z-index: 2;"><video class="" preload="none" width="100%" height="100%"
poster='http://themepunch.com/revolution/wp-content/uploads/2014/05/video_space_cover.jpg'>
<source src='http://themepunch.com/revolution/wp-content/uploads/2014/05/among_the_stars.mp4' type='video/mp4' />
<source src='http://themepunch.com/revolution/wp-content/uploads/2014/05/among_the_stars.webm' type='video/webm' />
</video>
</div>
<!-- LAYER NR. 2 -->
<div class="tp-caption light_medium_30 lfr ltl tp-resizeme"
data-x="center" data-hoffset="185"
data-y="center" data-voffset="65"
data-speed="1000"
data-start="2900"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 3; max-width: auto; max-height: auto; white-space: nowrap;">was born
</div>
<!-- LAYER NR. 3 -->
<div class="tp-caption white_heavy_60 lfb ltl tp-resizeme"
data-x="center" data-hoffset="0"
data-y="center" data-voffset="-60"
data-speed="2000"
data-start="1100"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.1"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;">A long time ago...
</div>
<!-- LAYER NR. 4 -->
<div class="tp-caption randomrotate ltl"
data-x="center" data-hoffset="155"
data-y="center" data-voffset="9"
data-speed="1000"
data-start="2300"
data-easing="Power4.easeInOut"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 5;"><img src="http://themepunch.com/revolution/wp-content/uploads/2014/05/redbg_big.png" alt="" data-ww="220" data-hh="85">
</div>
<!-- LAYER NR. 5 -->
<div class="tp-caption light_thin_60 lfb ltl tp-resizeme"
data-x="center" data-hoffset="-110"
data-y="center" data-voffset="10"
data-speed="1500"
data-start="2000"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 6; max-width: auto; max-height: auto; white-space: nowrap;">Revolution
</div>
<!-- LAYER NR. 6 -->
<div class="tp-caption light_heavy_60 customin ltl tp-resizeme"
data-x="center" data-hoffset="150"
data-y="center" data-voffset="10"
data-customin="x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0;scaleY:0;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;"
data-speed="1000"
data-start="2600"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.01"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 7; max-width: auto; max-height: auto; white-space: nowrap;">Slider
</div>
<!-- LAYER NR. 7 -->
<div class="tp-caption black_thin_whitebg_30 lfb ltl tp-resizeme"
data-x="center" data-hoffset="0"
data-y="center" data-voffset="110"
data-speed="1500"
data-start="3200"
data-easing="Power4.easeInOut"
data-splitin="none"
data-splitout="none"
data-elementdelay="0.1"
data-endelementdelay="0.1"
data-endspeed="1000"
data-endeasing="Power4.easeIn"
style="z-index: 8; max-width: auto; max-height: auto; white-space: nowrap;">Now its the #1 Slider on CodeCanyon
</div>
</li>
</ul>
<div class="tp-bannertimer"></div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.tp-banner').show().revolution(
{
dottedOverlay:"none",
delay:9000,
startwidth:1170,
startheight:700,
hideThumbs:200,
thumbWidth:100,
thumbHeight:50,
thumbAmount:3,
navigationType:"none",
navigationArrows:"solo",
navigationStyle:"preview4",
touchenabled:"on",
onHoverStop:"on",
swipe_velocity: 0.7,
swipe_min_touches: 1,
swipe_max_touches: 1,
drag_block_vertical: false,
keyboardNavigation:"on",
navigationHAlign:"center",
navigationVAlign:"bottom",
navigationHOffset:0,
navigationVOffset:20,
soloArrowLeftHalign:"left",
soloArrowLeftValign:"center",
soloArrowLeftHOffset:20,
soloArrowLeftVOffset:0,
soloArrowRightHalign:"right",
soloArrowRightValign:"center",
soloArrowRightHOffset:20,
soloArrowRightVOffset:0,
shadow:0,
fullWidth:"off",
fullScreen:"on",
spinner:"spinner0",
stopLoop:"off",
stopAfterLoops:-1,
stopAtSlide:-1,
shuffle:"off",
forceFullWidth:"off",
fullScreenAlignForce:"off",
minFullScreenHeight:"400",
hideThumbsOnMobile:"off",
hideNavDelayOnMobile:1500,
hideBulletsOnMobile:"off",
hideArrowsOnMobile:"off",
hideThumbsUnderResolution:0,
hideSliderAtLimit:0,
hideCaptionAtLimit:0,
hideAllCaptionAtLilmit:0,
startWithSlide:0,
fullScreenOffsetContainer: ".header"
});
}); //ready
</script>
<!-- END REVOLUTION SLIDER -->
</div>
</div>
</body> | {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2019, Percona LLC.
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 copyright holder 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.
*/
// Package event aggregates MySQL log and Perfomance Schema events into query
// classes and calculates basic statistics for class metrics like max Query_time.
// Event aggregation into query classes is the foundation of MySQL log file and
// Performance Schema analysis.
//
// An event is a query like "SELECT col FROM t WHERE id = 1", some metrics like
// Query_time (slow log) or SUM_TIMER_WAIT (Performance Schema), and other
// metadata like default database, timestamp, etc. Events are grouped into query
// classes by fingerprinting the query (see percona.com/go-mysql/query/), then
// checksumming the fingerprint which yields a 16-character hexadecimal value
// called the class ID. As events are added to a class, metric values are saved.
// When there are no more events, the class is finalized to compute the statistics
// for all metrics.
//
// There are two types of classes: global and per-query. A global class contains
// all events added to it, regardless of fingerprint or class ID. This is used,
// for example, to aggregate all events in a log file. A per-query class contains
// events with the same fingerprint and class ID. This is only enforced by
// convention, so be careful not to mix events from different classes. This is
// used, for example, to aggregate unique queries in a log file, then sort the
// classes by some metric, like max Query_time, to find the slowest query
// relative to a global class for the same set of events.
package event
| {
"pile_set_name": "Github"
} |
package querier
import (
"context"
"fmt"
"github.com/go-kit/kit/log"
"github.com/oklog/ulid"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/cortexproject/cortex/pkg/ring"
"github.com/cortexproject/cortex/pkg/ring/client"
cortex_tsdb "github.com/cortexproject/cortex/pkg/storage/tsdb"
"github.com/cortexproject/cortex/pkg/storegateway"
"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/services"
"github.com/cortexproject/cortex/pkg/util/tls"
)
// BlocksStoreSet implementation used when the blocks are sharded and replicated across
// a set of store-gateway instances.
type blocksStoreReplicationSet struct {
services.Service
storesRing *ring.Ring
clientsPool *client.Pool
shardingStrategy string
limits BlocksStoreLimits
// Subservices manager.
subservices *services.Manager
subservicesWatcher *services.FailureWatcher
}
func newBlocksStoreReplicationSet(
storesRing *ring.Ring,
shardingStrategy string,
limits BlocksStoreLimits,
tlsCfg tls.ClientConfig,
logger log.Logger,
reg prometheus.Registerer,
) (*blocksStoreReplicationSet, error) {
s := &blocksStoreReplicationSet{
storesRing: storesRing,
clientsPool: newStoreGatewayClientPool(client.NewRingServiceDiscovery(storesRing), tlsCfg, logger, reg),
shardingStrategy: shardingStrategy,
limits: limits,
}
var err error
s.subservices, err = services.NewManager(s.storesRing, s.clientsPool)
if err != nil {
return nil, err
}
s.Service = services.NewBasicService(s.starting, s.running, s.stopping)
return s, nil
}
func (s *blocksStoreReplicationSet) starting(ctx context.Context) error {
s.subservicesWatcher.WatchManager(s.subservices)
if err := services.StartManagerAndAwaitHealthy(ctx, s.subservices); err != nil {
return errors.Wrap(err, "unable to start blocks store set subservices")
}
return nil
}
func (s *blocksStoreReplicationSet) running(ctx context.Context) error {
for {
select {
case <-ctx.Done():
return nil
case err := <-s.subservicesWatcher.Chan():
return errors.Wrap(err, "blocks store set subservice failed")
}
}
}
func (s *blocksStoreReplicationSet) stopping(_ error) error {
return services.StopManagerAndAwaitStopped(context.Background(), s.subservices)
}
func (s *blocksStoreReplicationSet) GetClientsFor(userID string, blockIDs []ulid.ULID, exclude map[ulid.ULID][]string) (map[BlocksStoreClient][]ulid.ULID, error) {
shards := map[string][]ulid.ULID{}
// If shuffle sharding is enabled, we should build a subring for the user,
// otherwise we just use the full ring.
var userRing ring.ReadRing
if s.shardingStrategy == storegateway.ShardingStrategyShuffle {
userRing = storegateway.GetShuffleShardingSubring(s.storesRing, userID, s.limits)
} else {
userRing = s.storesRing
}
// Find the replication set of each block we need to query.
for _, blockID := range blockIDs {
// Buffer internally used by the ring (give extra room for a JOINING + LEAVING instance).
// Do not reuse the same buffer across multiple Get() calls because we do retain the
// returned replication set.
buf := make([]ring.IngesterDesc, 0, userRing.ReplicationFactor()+2)
set, err := userRing.Get(cortex_tsdb.HashBlockID(blockID), ring.BlocksRead, buf)
if err != nil {
return nil, errors.Wrapf(err, "failed to get store-gateway replication set owning the block %s", blockID.String())
}
// Pick the first non excluded store-gateway instance.
addr := getFirstNonExcludedInstanceAddr(set, exclude[blockID])
if addr == "" {
return nil, fmt.Errorf("no store-gateway instance left after checking exclude for block %s", blockID.String())
}
shards[addr] = append(shards[addr], blockID)
}
clients := map[BlocksStoreClient][]ulid.ULID{}
// Get the client for each store-gateway.
for addr, blockIDs := range shards {
c, err := s.clientsPool.GetClientFor(addr)
if err != nil {
return nil, errors.Wrapf(err, "failed to get store-gateway client for %s", addr)
}
clients[c.(BlocksStoreClient)] = blockIDs
}
return clients, nil
}
func getFirstNonExcludedInstanceAddr(set ring.ReplicationSet, exclude []string) string {
for _, instance := range set.Ingesters {
if !util.StringsContain(exclude, instance.Addr) {
return instance.Addr
}
}
return ""
}
| {
"pile_set_name": "Github"
} |
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function Module(stdlib, foreign, heap) {
"use asm";
var MEM64 = new stdlib.Float64Array(heap);
function load(i) {
i = i|0;
return +MEM64[i >> 3];
}
function store(i, v) {
i = i|0;
v = +v;
MEM64[i >> 3] = v;
}
return { load: load, store: store };
}
var m = Module(this, {}, new ArrayBuffer(8));
m.store(0, 3.12);
for (var i = 1; i < 64; ++i) {
m.store(i * 8 * 32 * 1024, i);
}
assertEquals(3.12, m.load(0));
for (var i = 1; i < 64; ++i) {
assertEquals(NaN, m.load(i * 8 * 32 * 1024));
}
| {
"pile_set_name": "Github"
} |
// Copyright Peter Dimov 2001
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// *Preprocessed* version of the main "bind.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
namespace aux {
template<
typename T, typename U1, typename U2, typename U3, typename U4
, typename U5
>
struct resolve_bind_arg
{
typedef T type;
};
template<
typename T
, typename Arg
>
struct replace_unnamed_arg
{
typedef Arg next;
typedef T type;
};
template<
typename Arg
>
struct replace_unnamed_arg< arg< -1 >, Arg >
{
typedef typename Arg::next next;
typedef Arg type;
};
template<
int N, typename U1, typename U2, typename U3, typename U4, typename U5
>
struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
{
typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
};
} // namespace aux
template<
typename F
>
struct bind0
{
template<
typename U1, typename U2, typename U3, typename U4, typename U5
>
struct apply
{
private:
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
typedef typename r0::type a0;
typedef typename r0::next n1;
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
///
public:
typedef typename apply_wrap0<
f_
>::type type;
};
};
namespace aux {
template<
typename F, typename U1, typename U2, typename U3, typename U4
, typename U5
>
struct resolve_bind_arg<
bind0<F>, U1, U2, U3, U4, U5
>
{
typedef bind0<F> f_;
typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
};
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
template<
typename F, typename T1
>
struct bind1
{
template<
typename U1, typename U2, typename U3, typename U4, typename U5
>
struct apply
{
private:
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
typedef typename r0::type a0;
typedef typename r0::next n1;
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
///
typedef aux::replace_unnamed_arg< T1,n1 > r1;
typedef typename r1::type a1;
typedef typename r1::next n2;
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
///
public:
typedef typename apply_wrap1<
f_
, typename t1::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename U1, typename U2, typename U3
, typename U4, typename U5
>
struct resolve_bind_arg<
bind1< F,T1 >, U1, U2, U3, U4, U5
>
{
typedef bind1< F,T1 > f_;
typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
};
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
template<
typename F, typename T1, typename T2
>
struct bind2
{
template<
typename U1, typename U2, typename U3, typename U4, typename U5
>
struct apply
{
private:
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
typedef typename r0::type a0;
typedef typename r0::next n1;
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
///
typedef aux::replace_unnamed_arg< T1,n1 > r1;
typedef typename r1::type a1;
typedef typename r1::next n2;
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
///
typedef aux::replace_unnamed_arg< T2,n2 > r2;
typedef typename r2::type a2;
typedef typename r2::next n3;
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
///
public:
typedef typename apply_wrap2<
f_
, typename t1::type, typename t2::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename U1, typename U2
, typename U3, typename U4, typename U5
>
struct resolve_bind_arg<
bind2< F,T1,T2 >, U1, U2, U3, U4, U5
>
{
typedef bind2< F,T1,T2 > f_;
typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
};
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
template<
typename F, typename T1, typename T2, typename T3
>
struct bind3
{
template<
typename U1, typename U2, typename U3, typename U4, typename U5
>
struct apply
{
private:
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
typedef typename r0::type a0;
typedef typename r0::next n1;
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
///
typedef aux::replace_unnamed_arg< T1,n1 > r1;
typedef typename r1::type a1;
typedef typename r1::next n2;
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
///
typedef aux::replace_unnamed_arg< T2,n2 > r2;
typedef typename r2::type a2;
typedef typename r2::next n3;
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
///
typedef aux::replace_unnamed_arg< T3,n3 > r3;
typedef typename r3::type a3;
typedef typename r3::next n4;
typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
///
public:
typedef typename apply_wrap3<
f_
, typename t1::type, typename t2::type, typename t3::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename T3, typename U1
, typename U2, typename U3, typename U4, typename U5
>
struct resolve_bind_arg<
bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
>
{
typedef bind3< F,T1,T2,T3 > f_;
typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
};
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
template<
typename F, typename T1, typename T2, typename T3, typename T4
>
struct bind4
{
template<
typename U1, typename U2, typename U3, typename U4, typename U5
>
struct apply
{
private:
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
typedef typename r0::type a0;
typedef typename r0::next n1;
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
///
typedef aux::replace_unnamed_arg< T1,n1 > r1;
typedef typename r1::type a1;
typedef typename r1::next n2;
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
///
typedef aux::replace_unnamed_arg< T2,n2 > r2;
typedef typename r2::type a2;
typedef typename r2::next n3;
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
///
typedef aux::replace_unnamed_arg< T3,n3 > r3;
typedef typename r3::type a3;
typedef typename r3::next n4;
typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
///
typedef aux::replace_unnamed_arg< T4,n4 > r4;
typedef typename r4::type a4;
typedef typename r4::next n5;
typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
///
public:
typedef typename apply_wrap4<
f_
, typename t1::type, typename t2::type, typename t3::type
, typename t4::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename U1, typename U2, typename U3, typename U4, typename U5
>
struct resolve_bind_arg<
bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
>
{
typedef bind4< F,T1,T2,T3,T4 > f_;
typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
};
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct bind5
{
template<
typename U1, typename U2, typename U3, typename U4, typename U5
>
struct apply
{
private:
typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
typedef typename r0::type a0;
typedef typename r0::next n1;
typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
///
typedef aux::replace_unnamed_arg< T1,n1 > r1;
typedef typename r1::type a1;
typedef typename r1::next n2;
typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
///
typedef aux::replace_unnamed_arg< T2,n2 > r2;
typedef typename r2::type a2;
typedef typename r2::next n3;
typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
///
typedef aux::replace_unnamed_arg< T3,n3 > r3;
typedef typename r3::type a3;
typedef typename r3::next n4;
typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
///
typedef aux::replace_unnamed_arg< T4,n4 > r4;
typedef typename r4::type a4;
typedef typename r4::next n5;
typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
///
typedef aux::replace_unnamed_arg< T5,n5 > r5;
typedef typename r5::type a5;
typedef typename r5::next n6;
typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
///
public:
typedef typename apply_wrap5<
f_
, typename t1::type, typename t2::type, typename t3::type
, typename t4::type, typename t5::type
>::type type;
};
};
namespace aux {
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5, typename U1, typename U2, typename U3, typename U4
, typename U5
>
struct resolve_bind_arg<
bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
>
{
typedef bind5< F,T1,T2,T3,T4,T5 > f_;
typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
};
} // namespace aux
BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
}}
| {
"pile_set_name": "Github"
} |
/*
* Copyright © 2020 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
const protobuf = require('protobufjs');
const prepareProtobuffersStrings = () =>
protobuf.loadSync('./generators/lisk_codec/proto_files/strings.proto');
const { String } = prepareProtobuffersStrings();
const generateValidStringEncodings = () => {
const input = {
string: {
object: {
data: 'Checkout Lisk SDK!',
},
schema: {
$id: 'object7',
type: 'object',
properties: {
data: {
dataType: 'string',
fieldNumber: 1,
},
},
},
},
emptyString: {
object: {
data: '',
},
schema: {
$id: 'object8',
type: 'object',
properties: {
data: {
dataType: 'string',
fieldNumber: 1,
},
},
},
},
symbols: {
object: {
data: '€.ƒ.‰.Œ.£.©.®.µ.Æ.ü.ý.ø.Ç.¥.ß',
},
schema: {
$id: 'object8',
type: 'object',
properties: {
data: {
dataType: 'string',
fieldNumber: 1,
},
},
},
},
};
const stringEncoded = String.encode(input.string.object).finish();
const emptyStringEncoded = String.encode(input.emptyString.object).finish();
const symbolsStringEncoded = String.encode(input.symbols.object).finish();
return [
{
description: 'Encoding of string',
input: input.string,
output: { value: stringEncoded.toString('hex') },
},
{
description: 'Encoding of empty string',
input: input.emptyString,
output: { value: emptyStringEncoded.toString('hex') },
},
{
description: 'Encoding of some utf symbols string',
input: input.symbols,
output: { value: symbolsStringEncoded.toString('hex') },
},
];
};
module.exports = generateValidStringEncodings;
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2010 - 2013 ArkCORE <http://www.arkania.net/>
* Copyright (C) 2008 - 2013 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
Name: reload_commandscript
%Complete: 100
Comment: All reload related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "TicketMgr.h"
#include "MapManager.h"
#include "CreatureEventAIMgr.h"
#include "DisableMgr.h"
#include "LFGMgr.h"
#include "AuctionHouseMgr.h"
#include "CreatureTextMgr.h"
#include "SmartAI.h"
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
#include "Chat.h"
class reload_commandscript: public CommandScript
{
public:
reload_commandscript () :
CommandScript("reload_commandscript")
{
}
ChatCommand* GetCommands () const
{
static ChatCommand reloadAllCommandTable[] =
{
{ "achievement", SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand, "", NULL },
{ "area", SEC_ADMINISTRATOR, true, &HandleReloadAllAreaCommand, "", NULL },
{ "eventai", SEC_ADMINISTRATOR, true, &HandleReloadAllEventAICommand, "", NULL },
{ "gossips", SEC_ADMINISTRATOR, true, &HandleReloadAllGossipsCommand, "", NULL },
{ "item", SEC_ADMINISTRATOR, true, &HandleReloadAllItemCommand, "", NULL },
{ "locales", SEC_ADMINISTRATOR, true, &HandleReloadAllLocalesCommand, "", NULL },
{ "loot", SEC_ADMINISTRATOR, true, &HandleReloadAllLootCommand, "", NULL },
{ "npc", SEC_ADMINISTRATOR, true, &HandleReloadAllNpcCommand, "", NULL },
{ "quest", SEC_ADMINISTRATOR, true, &HandleReloadAllQuestCommand, "", NULL },
{ "scripts", SEC_ADMINISTRATOR, true, &HandleReloadAllScriptsCommand, "", NULL },
{ "spell", SEC_ADMINISTRATOR, true, &HandleReloadAllSpellCommand, "", NULL },
{ "", SEC_ADMINISTRATOR, true, &HandleReloadAllCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL } };
static ChatCommand reloadCommandTable[] =
{
{ "auctions", SEC_ADMINISTRATOR, true, &HandleReloadAuctionsCommand, "", NULL },
{ "access_requirement", SEC_ADMINISTRATOR, true, &HandleReloadAccessRequirementCommand, "", NULL },
{ "achievement_criteria_data", SEC_ADMINISTRATOR, true, &HandleReloadAchievementCriteriaDataCommand, "", NULL },
{ "achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadAchievementRewardCommand, "", NULL },
{ "all", SEC_ADMINISTRATOR, true, NULL, "", reloadAllCommandTable },
{ "areatrigger_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadQuestAreaTriggersCommand, "", NULL },
{ "areatrigger_tavern", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTavernCommand, "", NULL },
{ "areatrigger_teleport", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTeleportCommand, "", NULL },
{ "autobroadcast", SEC_ADMINISTRATOR, true, &HandleReloadAutobroadcastCommand, "", NULL },
{ "command", SEC_ADMINISTRATOR, true, &HandleReloadCommandCommand, "", NULL },
{ "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "", NULL },
{ "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL },
{ "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL },
{ "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL },
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &HandleReloadEventAISummonsCommand, "", NULL },
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL },
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
{ "linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL },
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL },
{ "creature_onkill_reward", SEC_ADMINISTRATOR, true, &HandleReloadOnKillRewardCommand, "", NULL },
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestRelationsCommand, "", NULL },
{ "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "", NULL },
{ "all_creature_template", SEC_ADMINISTRATOR, true, &HandleReloadAllCreatureTemplateCommand, "", NULL },
//{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "", NULL },
{ "disables", SEC_ADMINISTRATOR, true, &HandleReloadDisablesCommand, "", NULL },
{ "disenchant_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL },
{ "event_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventScriptsCommand, "", NULL },
{ "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "", NULL },
{ "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "", NULL },
{ "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "", NULL },
{ "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestInvRelationsCommand, "", NULL },
{ "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL },
{ "gameobject_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestRelationsCommand, "", NULL },
{ "gameobject_scripts", SEC_ADMINISTRATOR, true, &HandleReloadGameObjectScriptsCommand, "", NULL },
{ "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL },
{ "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL },
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL },
{ "gossip_scripts", SEC_ADMINISTRATOR, true, &HandleReloadGossipScriptsCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL },
{ "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL },
{ "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL },
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL },
{ "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL },
{ "locales_creature_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "", NULL },
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL },
{ "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL },
{ "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL },
{ "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "", NULL },
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "", NULL },
{ "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "", NULL },
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL },
{ "locales_quest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestCommand, "", NULL },
{ "mail_level_reward", SEC_ADMINISTRATOR, true, &HandleReloadMailLevelRewardCommand, "", NULL },
{ "mail_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMailCommand, "", NULL },
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMillingCommand, "", NULL },
{ "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &HandleReloadSpellClickSpellsCommand, "", NULL },
{ "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "", NULL },
{ "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "", NULL },
{ "page_text", SEC_ADMINISTRATOR, true, &HandleReloadPageTextsCommand, "", NULL },
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL },
{ "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL },
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL },
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestEndScriptsCommand, "", NULL },
{ "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL },
{ "quest_start_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestStartScriptsCommand, "", NULL },
{ "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL },
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL },
{ "reserved_name", SEC_ADMINISTRATOR, true, &HandleReloadReservedNameCommand, "", NULL },
{ "reputation_reward_rate", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL },
{ "reputation_spillover_template", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL },
{ "skill_discovery_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL },
{ "skill_extra_item_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL },
{ "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL },
{ "skinning_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesSkinningCommand, "", NULL },
{ "smart_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSmartScripts, "", NULL },
{ "spell_required", SEC_ADMINISTRATOR, true, &HandleReloadSpellRequiredCommand, "", NULL },
{ "spell_area", SEC_ADMINISTRATOR, true, &HandleReloadSpellAreaCommand, "", NULL },
{ "spell_bonus_data", SEC_ADMINISTRATOR, true, &HandleReloadSpellBonusesCommand, "", NULL },
{ "spell_group", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupsCommand, "", NULL },
{ "spell_learn_spell", SEC_ADMINISTRATOR, true, &HandleReloadSpellLearnSpellCommand, "", NULL },
{ "spell_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesSpellCommand, "", NULL },
{ "spell_linked_spell", SEC_ADMINISTRATOR, true, &HandleReloadSpellLinkedSpellCommand, "", NULL },
{ "spell_pet_auras", SEC_ADMINISTRATOR, true, &HandleReloadSpellPetAurasCommand, "", NULL },
{ "spell_proc_event", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcEventCommand, "", NULL },
{ "spell_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSpellScriptsCommand, "", NULL },
{ "spell_target_position", SEC_ADMINISTRATOR, true, &HandleReloadSpellTargetPositionCommand, "", NULL },
{ "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "", NULL },
{ "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL },
{ "arkcore_string", SEC_ADMINISTRATOR, true, &HandleReloadArkCoreStringCommand, "", NULL },
{ "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL } };
static ChatCommand commandTable[] =
{
{ "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
{ NULL, 0, false, NULL, "", NULL } };
return commandTable;
}
//reload commands
static bool HandleReloadGMTicketsCommand (ChatHandler* /*handler*/, const char* /*args*/)
{
sTicketMgr->LoadGMTickets();
return true;
}
static bool HandleReloadAllCommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadSkillFishingBaseLevelCommand(handler, "");
HandleReloadAllAchievementCommand(handler, "");
HandleReloadAllAreaCommand(handler, "");
HandleReloadAllEventAICommand(handler, "");
HandleReloadAllLootCommand(handler, "");
HandleReloadAllNpcCommand(handler, "");
HandleReloadAllQuestCommand(handler, "");
HandleReloadAllSpellCommand(handler, "");
HandleReloadAllItemCommand(handler, "");
HandleReloadAllGossipsCommand(handler, "");
HandleReloadAllLocalesCommand(handler, "");
HandleReloadAccessRequirementCommand(handler, "");
HandleReloadMailLevelRewardCommand(handler, "");
HandleReloadCommandCommand(handler, "");
HandleReloadReservedNameCommand(handler, "");
HandleReloadArkCoreStringCommand(handler, "");
HandleReloadGameTeleCommand(handler, "");
HandleReloadAutobroadcastCommand(handler, "");
return true;
}
static bool HandleReloadAllAchievementCommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadAchievementCriteriaDataCommand(handler, "");
HandleReloadAchievementRewardCommand(handler, "");
return true;
}
static bool HandleReloadAllAreaCommand (ChatHandler* handler, const char* /*args*/)
{
//HandleReloadQuestAreaTriggersCommand(handler, ""); -- reloaded in HandleReloadAllQuestCommand
HandleReloadAreaTriggerTeleportCommand(handler, "");
HandleReloadAreaTriggerTavernCommand(handler, "");
HandleReloadGameGraveyardZoneCommand(handler, "");
return true;
}
static bool HandleReloadAllLootCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables...");
LoadLootTables();
handler->SendGlobalGMSysMessage("DB tables `*_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadAllNpcCommand (ChatHandler* handler, const char* args)
{
if (*args != 'a') // will be reloaded from all_gossips
HandleReloadNpcTrainerCommand(handler, "a");
HandleReloadNpcVendorCommand(handler, "a");
HandleReloadPointsOfInterestCommand(handler, "a");
HandleReloadSpellClickSpellsCommand(handler, "a");
return true;
}
static bool HandleReloadAllQuestCommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadQuestAreaTriggersCommand(handler, "a");
HandleReloadQuestPOICommand(handler, "a");
HandleReloadQuestTemplateCommand(handler, "a");
sLog->outString("Re-Loading Quests Relations...");
sObjectMgr->LoadQuestRelations();
handler->SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded.");
return true;
}
static bool HandleReloadAllScriptsCommand (ChatHandler* handler, const char* /*args*/)
{
if (sWorld->IsScriptScheduled())
{
handler->PSendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
sLog->outString("Re-Loading Scripts...");
HandleReloadGameObjectScriptsCommand(handler, "a");
HandleReloadGossipScriptsCommand(handler, "a");
HandleReloadEventScriptsCommand(handler, "a");
HandleReloadQuestEndScriptsCommand(handler, "a");
HandleReloadQuestStartScriptsCommand(handler, "a");
HandleReloadSpellScriptsCommand(handler, "a");
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
HandleReloadDbScriptStringCommand(handler, "a");
HandleReloadWpScriptsCommand(handler, "a");
return true;
}
static bool HandleReloadAllEventAICommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadEventAITextsCommand(handler, "a");
HandleReloadEventAISummonsCommand(handler, "a");
HandleReloadEventAIScriptsCommand(handler, "a");
return true;
}
static bool HandleReloadAllSpellCommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadSkillDiscoveryTemplateCommand(handler, "a");
HandleReloadSkillExtraItemTemplateCommand(handler, "a");
HandleReloadSpellRequiredCommand(handler, "a");
HandleReloadSpellAreaCommand(handler, "a");
HandleReloadSpellGroupsCommand(handler, "a");
HandleReloadSpellLearnSpellCommand(handler, "a");
HandleReloadSpellLinkedSpellCommand(handler, "a");
HandleReloadSpellProcEventCommand(handler, "a");
HandleReloadSpellBonusesCommand(handler, "a");
HandleReloadSpellTargetPositionCommand(handler, "a");
HandleReloadSpellThreatsCommand(handler, "a");
HandleReloadSpellGroupStackRulesCommand(handler, "a");
HandleReloadSpellPetAurasCommand(handler, "a");
return true;
}
static bool HandleReloadAllGossipsCommand (ChatHandler* handler, const char* args)
{
HandleReloadGossipMenuCommand(handler, "a");
HandleReloadGossipMenuOptionCommand(handler, "a");
if (*args != 'a') // already reload from all_scripts
HandleReloadGossipScriptsCommand(handler, "a");
HandleReloadPointsOfInterestCommand(handler, "a");
return true;
}
static bool HandleReloadAllItemCommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadPageTextsCommand(handler, "a");
HandleReloadItemEnchantementsCommand(handler, "a");
return true;
}
static bool HandleReloadAllLocalesCommand (ChatHandler* handler, const char* /*args*/)
{
HandleReloadLocalesAchievementRewardCommand(handler, "a");
HandleReloadLocalesCreatureCommand(handler, "a");
HandleReloadLocalesCreatureTextCommand(handler, "a");
HandleReloadLocalesGameobjectCommand(handler, "a");
HandleReloadLocalesGossipMenuOptionCommand(handler, "a");
HandleReloadLocalesItemCommand(handler, "a");
HandleReloadLocalesNpcTextCommand(handler, "a");
HandleReloadLocalesPageTextCommand(handler, "a");
HandleReloadLocalesPointsOfInterestCommand(handler, "a");
HandleReloadLocalesQuestCommand(handler, "a");
return true;
}
static bool HandleReloadConfigCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading config settings...");
sWorld->LoadConfigSettings(true);
sMapMgr->InitializeVisibilityDistanceInfo();
handler->SendGlobalGMSysMessage("World config settings reloaded.");
return true;
}
static bool HandleReloadAccessRequirementCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Access Requirement definitions...");
sObjectMgr->LoadAccessRequirements();
handler->SendGlobalGMSysMessage("DB table `access_requirement` reloaded.");
return true;
}
static bool HandleReloadAchievementCriteriaDataCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Additional Achievement Criteria Data...");
sAchievementMgr->LoadAchievementCriteriaData();
handler->SendGlobalGMSysMessage("DB table `achievement_criteria_data` reloaded.");
return true;
}
static bool HandleReloadAchievementRewardCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Achievement Reward Data...");
sAchievementMgr->LoadRewards();
handler->SendGlobalGMSysMessage("DB table `achievement_reward` reloaded.");
return true;
}
static bool HandleReloadAreaTriggerTavernCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Tavern Area Triggers...");
sObjectMgr->LoadTavernAreaTriggers();
handler->SendGlobalGMSysMessage("DB table `areatrigger_tavern` reloaded.");
return true;
}
static bool HandleReloadAreaTriggerTeleportCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading AreaTrigger teleport definitions...");
sObjectMgr->LoadAreaTriggerTeleports();
handler->SendGlobalGMSysMessage("DB table `areatrigger_teleport` reloaded.");
return true;
}
static bool HandleReloadAutobroadcastCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Autobroadcast...");
sWorld->LoadAutobroadcasts();
handler->SendGlobalGMSysMessage("DB table `autobroadcast` reloaded.");
return true;
}
static bool HandleReloadCommandCommand (ChatHandler* handler, const char* /*args*/)
{
handler->SetLoadCommandTable(true);
handler->SendGlobalGMSysMessage("DB table `command` will be reloaded at next chat command use.");
return true;
}
static bool HandleReloadOnKillRewardCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading creature award reputation definitions...");
sObjectMgr->LoadRewardOnKill();
handler->SendGlobalGMSysMessage("DB table `creature_onkill_reward` reloaded.");
return true;
}
static bool HandleReloadCreatureTemplateCommand (ChatHandler* handler, const char* args)
{
if (!*args)
return false;
uint32 entry = (uint32) atoi((char*) args);
QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry);
if (!result)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
handler->SetSentErrorMessage(true);
return false;
}
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry);
if (!cInfo)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry);
handler->SetSentErrorMessage(true);
return false;
}
sLog->outString("Reloading creature template entry %u", entry);
Field *fields = result->Fetch();
const_cast<CreatureInfo*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->KillCredit[0] = fields[3].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->KillCredit[1] = fields[4].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->Modelid1 = fields[5].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->Modelid2 = fields[6].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->Modelid3 = fields[7].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->Modelid4 = fields[8].GetUInt32();
size_t len = 0;
if (const char* temp = fields[9].GetCString())
{
delete[] cInfo->Name;
len = strlen(temp) + 1;
const_cast<CreatureInfo*>(cInfo)->Name = new char[len];
strncpy(cInfo->Name, temp, len);
}
if (const char* temp = fields[10].GetCString())
{
delete[] cInfo->SubName;
len = strlen(temp) + 1;
const_cast<CreatureInfo*>(cInfo)->SubName = new char[len];
strncpy(cInfo->SubName, temp, len);
}
if (const char* temp = fields[11].GetCString())
{
delete[] cInfo->IconName;
len = strlen(temp) + 1;
const_cast<CreatureInfo*>(cInfo)->IconName = new char[len];
strncpy(cInfo->IconName, temp, len);
}
const_cast<CreatureInfo*>(cInfo)->GossipMenuId = fields[12].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->minlevel = fields[13].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->maxlevel = fields[14].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->expansion = fields[15].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->faction_A = fields[16].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->faction_H = fields[17].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->npcflag = fields[18].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->speed_walk = fields[19].GetFloat();
const_cast<CreatureInfo*>(cInfo)->speed_run = fields[20].GetFloat();
const_cast<CreatureInfo*>(cInfo)->scale = fields[21].GetFloat();
const_cast<CreatureInfo*>(cInfo)->rank = fields[22].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->mindmg = fields[23].GetFloat();
const_cast<CreatureInfo*>(cInfo)->maxdmg = fields[24].GetFloat();
const_cast<CreatureInfo*>(cInfo)->dmgschool = fields[25].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->attackpower = fields[26].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->dmg_multiplier = fields[27].GetFloat();
const_cast<CreatureInfo*>(cInfo)->baseattacktime = fields[28].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->rangeattacktime = fields[29].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->unit_class = fields[30].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->unit_flags = fields[31].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->dynamicflags = fields[32].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->family = fields[33].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->trainer_type = fields[34].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->trainer_spell = fields[35].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->trainer_class = fields[36].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->trainer_race = fields[37].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->minrangedmg = fields[38].GetFloat();
const_cast<CreatureInfo*>(cInfo)->maxrangedmg = fields[39].GetFloat();
const_cast<CreatureInfo*>(cInfo)->rangedattackpower = fields[40].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->type = fields[41].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->type_flags = fields[42].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->lootid = fields[43].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->pickpocketLootId = fields[44].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->SkinLootId = fields[45].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->resistance1 = fields[46].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->resistance2 = fields[47].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->resistance3 = fields[48].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->resistance4 = fields[49].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->resistance5 = fields[50].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->resistance6 = fields[51].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[0] = fields[52].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[1] = fields[53].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[2] = fields[54].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[3] = fields[55].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[4] = fields[56].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[5] = fields[57].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[6] = fields[58].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->spells[7] = fields[59].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->PetSpellDataId = fields[60].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->VehicleId = fields[61].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->mingold = fields[62].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->maxgold = fields[63].GetUInt32();
if (const char* temp = fields[64].GetCString())
{
delete[] cInfo->AIName;
len = strlen(temp) + 1;
const_cast<CreatureInfo*>(cInfo)->AIName = new char[len];
strncpy(const_cast<char*>(cInfo->AIName), temp, len);
}
const_cast<CreatureInfo*>(cInfo)->MovementType = fields[65].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->InhabitType = fields[66].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->ModHealth = fields[67].GetFloat();
const_cast<CreatureInfo*>(cInfo)->ModMana = fields[68].GetFloat();
const_cast<CreatureInfo*>(cInfo)->ModArmor = fields[69].GetFloat();
const_cast<CreatureInfo*>(cInfo)->RacialLeader = fields[70].GetBool();
const_cast<CreatureInfo*>(cInfo)->questItems[0] = fields[71].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->questItems[1] = fields[72].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->questItems[2] = fields[73].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->questItems[3] = fields[74].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->questItems[4] = fields[75].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->questItems[5] = fields[76].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->movementId = fields[77].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->RegenHealth = fields[78].GetBool();
const_cast<CreatureInfo*>(cInfo)->equipmentId = fields[79].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->flags_extra = fields[81].GetUInt32();
const_cast<CreatureInfo*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
handler->SendGlobalGMSysMessage("Creature template reloaded.");
return true;
}
static bool HandleReloadAllCreatureTemplateCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading Creature templates...");
sObjectMgr->LoadCreatureTemplates();
handler->SendGlobalGMSysMessage("DB table `creature_template` reloaded.");
return true;
}
static bool HandleReloadCreatureQuestRelationsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading Quests Relations... (`creature_questrelation`)");
sObjectMgr->LoadCreatureQuestRelations();
handler->SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded.");
return true;
}
static bool HandleReloadLinkedRespawnCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading Linked Respawns... (`linked_respawn`)");
sObjectMgr->LoadLinkedRespawn();
handler->SendGlobalGMSysMessage("DB table `linked_respawn` (creature linked respawns) reloaded.");
return true;
}
static bool HandleReloadCreatureQuestInvRelationsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading Quests Relations... (`creature_involvedrelation`)");
sObjectMgr->LoadCreatureInvolvedRelations();
handler->SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded.");
return true;
}
static bool HandleReloadGossipMenuCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `gossip_menu` Table!");
sObjectMgr->LoadGossipMenu();
handler->SendGlobalGMSysMessage("DB table `gossip_menu` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadGossipMenuOptionCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `gossip_menu_option` Table!");
sObjectMgr->LoadGossipMenuItems();
handler->SendGlobalGMSysMessage("DB table `gossip_menu_option` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadGOQuestRelationsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading Quests Relations... (`gameobject_questrelation`)");
sObjectMgr->LoadGameobjectQuestRelations();
handler->SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded.");
return true;
}
static bool HandleReloadGOQuestInvRelationsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading Quests Relations... (`gameobject_involvedrelation`)");
sObjectMgr->LoadGameobjectInvolvedRelations();
handler->SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded.");
return true;
}
static bool HandleReloadQuestAreaTriggersCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Quest Area Triggers...");
sObjectMgr->LoadQuestAreaTriggers();
handler->SendGlobalGMSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded.");
return true;
}
static bool HandleReloadQuestTemplateCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Quest Templates...");
sObjectMgr->LoadQuests();
handler->SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded.");
/// dependent also from `gameobject` but this table not reloaded anyway
sLog->outString("Re-Loading GameObjects for quests...");
sObjectMgr->LoadGameObjectForQuests();
handler->SendGlobalGMSysMessage("Data GameObjects for quests reloaded.");
return true;
}
static bool HandleReloadLootTemplatesCreatureCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`creature_loot_template`)");
LoadLootTemplates_Creature();
LootTemplates_Creature.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `creature_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesDisenchantCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`disenchant_loot_template`)");
LoadLootTemplates_Disenchant();
LootTemplates_Disenchant.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `disenchant_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesFishingCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`fishing_loot_template`)");
LoadLootTemplates_Fishing();
LootTemplates_Fishing.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `fishing_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesGameobjectCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`gameobject_loot_template`)");
LoadLootTemplates_Gameobject();
LootTemplates_Gameobject.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `gameobject_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesItemCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`item_loot_template`)");
LoadLootTemplates_Item();
LootTemplates_Item.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `item_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesMillingCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`milling_loot_template`)");
LoadLootTemplates_Milling();
LootTemplates_Milling.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `milling_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesPickpocketingCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`pickpocketing_loot_template`)");
LoadLootTemplates_Pickpocketing();
LootTemplates_Pickpocketing.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `pickpocketing_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesProspectingCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`prospecting_loot_template`)");
LoadLootTemplates_Prospecting();
LootTemplates_Prospecting.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `prospecting_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesMailCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`mail_loot_template`)");
LoadLootTemplates_Mail();
LootTemplates_Mail.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `mail_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesReferenceCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`reference_loot_template`)");
LoadLootTemplates_Reference();
handler->SendGlobalGMSysMessage("DB table `reference_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesSkinningCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`skinning_loot_template`)");
LoadLootTemplates_Skinning();
LootTemplates_Skinning.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `skinning_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadLootTemplatesSpellCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Loot Tables... (`spell_loot_template`)");
LoadLootTemplates_Spell();
LootTemplates_Spell.CheckLootRefs();
handler->SendGlobalGMSysMessage("DB table `spell_loot_template` reloaded.");
sConditionMgr->LoadConditions(true);
return true;
}
static bool HandleReloadArkCoreStringCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading arkcore_string Table!");
sObjectMgr->LoadArkCoreStrings();
handler->SendGlobalGMSysMessage("DB table `arkcore_string` reloaded.");
return true;
}
static bool HandleReloadNpcTrainerCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `npc_trainer` Table!");
sObjectMgr->LoadTrainerSpell();
handler->SendGlobalGMSysMessage("DB table `npc_trainer` reloaded.");
return true;
}
static bool HandleReloadNpcVendorCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `npc_vendor` Table!");
sObjectMgr->LoadVendors();
handler->SendGlobalGMSysMessage("DB table `npc_vendor` reloaded.");
return true;
}
static bool HandleReloadPointsOfInterestCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `points_of_interest` Table!");
sObjectMgr->LoadPointsOfInterest();
handler->SendGlobalGMSysMessage("DB table `points_of_interest` reloaded.");
return true;
}
static bool HandleReloadQuestPOICommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Quest POI ...");
sObjectMgr->LoadQuestPOI();
handler->SendGlobalGMSysMessage("DB Table `quest_poi` and `quest_poi_points` reloaded.");
return true;
}
static bool HandleReloadSpellClickSpellsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `npc_spellclick_spells` Table!");
sObjectMgr->LoadNPCSpellClickSpells();
handler->SendGlobalGMSysMessage("DB table `npc_spellclick_spells` reloaded.");
return true;
}
static bool HandleReloadReservedNameCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Loading ReservedNames... (`reserved_name`)");
sObjectMgr->LoadReservedPlayersNames();
handler->SendGlobalGMSysMessage("DB table `reserved_name` (player reserved names) reloaded.");
return true;
}
static bool HandleReloadReputationRewardRateCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `reputation_reward_rate` Table!");
sObjectMgr->LoadReputationRewardRate();
handler->SendGlobalSysMessage("DB table `reputation_reward_rate` reloaded.");
return true;
}
static bool HandleReloadReputationSpilloverTemplateCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading `reputation_spillover_template` Table!");
sObjectMgr->LoadReputationSpilloverTemplate();
handler->SendGlobalSysMessage("DB table `reputation_spillover_template` reloaded.");
return true;
}
static bool HandleReloadSkillDiscoveryTemplateCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
handler->SendGlobalGMSysMessage("DB table `skill_discovery_template` (recipes discovered at crafting) reloaded.");
return true;
}
static bool HandleReloadSkillExtraItemTemplateCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Skill Extra Item Table...");
LoadSkillExtraItemTable();
handler->SendGlobalGMSysMessage("DB table `skill_extra_item_template` (extra item creation when crafting) reloaded.");
return true;
}
static bool HandleReloadSkillFishingBaseLevelCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Skill Fishing base level requirements...");
sObjectMgr->LoadFishingBaseSkillLevel();
handler->SendGlobalGMSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded.");
return true;
}
static bool HandleReloadSpellAreaCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading SpellArea Data...");
sSpellMgr->LoadSpellAreas();
handler->SendGlobalGMSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded.");
return true;
}
static bool HandleReloadSpellRequiredCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Required Data... ");
sSpellMgr->LoadSpellRequired();
handler->SendGlobalGMSysMessage("DB table `spell_required` reloaded.");
return true;
}
static bool HandleReloadSpellGroupsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Groups...");
sSpellMgr->LoadSpellGroups();
handler->SendGlobalGMSysMessage("DB table `spell_group` (spell groups) reloaded.");
return true;
}
static bool HandleReloadSpellLearnSpellCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Learn Spells...");
sSpellMgr->LoadSpellLearnSpells();
handler->SendGlobalGMSysMessage("DB table `spell_learn_spell` reloaded.");
return true;
}
static bool HandleReloadSpellLinkedSpellCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Linked Spells...");
sSpellMgr->LoadSpellLinked();
handler->SendGlobalGMSysMessage("DB table `spell_linked_spell` reloaded.");
return true;
}
static bool HandleReloadSpellProcEventCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Proc Event conditions...");
sSpellMgr->LoadSpellProcEvents();
handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
return true;
}
static bool HandleReloadSpellBonusesCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Bonus Data...");
sSpellMgr->LoadSpellBonusess();
handler->SendGlobalGMSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
return true;
}
static bool HandleReloadSpellTargetPositionCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell target coordinates...");
sSpellMgr->LoadSpellTargetPositions();
handler->SendGlobalGMSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded.");
return true;
}
static bool HandleReloadSpellThreatsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Aggro Spells Definitions...");
sSpellMgr->LoadSpellThreats();
handler->SendGlobalGMSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded.");
return true;
}
static bool HandleReloadSpellGroupStackRulesCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell Group Stack Rules...");
sSpellMgr->LoadSpellGroupStackRules();
handler->SendGlobalGMSysMessage("DB table `spell_group_stack_rules` (spell stacking definitions) reloaded.");
return true;
}
static bool HandleReloadSpellPetAurasCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Spell pet auras...");
sSpellMgr->LoadSpellPetAuras();
handler->SendGlobalGMSysMessage("DB table `spell_pet_auras` reloaded.");
return true;
}
static bool HandleReloadPageTextsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Page Texts...");
sObjectMgr->LoadPageTexts();
handler->SendGlobalGMSysMessage("DB table `page_texts` reloaded.");
return true;
}
static bool HandleReloadItemEnchantementsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Item Random Enchantments Table...");
LoadRandomEnchantmentsTable();
handler->SendGlobalGMSysMessage("DB table `item_enchantment_template` reloaded.");
return true;
}
static bool HandleReloadItemSetNamesCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Item set names...");
LoadRandomEnchantmentsTable();
handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded.");
return true;
}
static bool HandleReloadGossipScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `gossip_scripts`...");
sObjectMgr->LoadGossipScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `gossip_scripts` reloaded.");
return true;
}
static bool HandleReloadGameObjectScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `gameobject_scripts`...");
sObjectMgr->LoadGameObjectScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded.");
return true;
}
static bool HandleReloadEventScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `event_scripts`...");
sObjectMgr->LoadEventScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `event_scripts` reloaded.");
return true;
}
static bool HandleReloadWpScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `waypoint_scripts`...");
sObjectMgr->LoadWaypointScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `waypoint_scripts` reloaded.");
return true;
}
static bool HandleReloadEventAITextsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Texts from `creature_ai_texts`...");
sEventAIMgr->LoadCreatureEventAI_Texts();
handler->SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded.");
return true;
}
static bool HandleReloadEventAISummonsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Summons from `creature_ai_summons`...");
sEventAIMgr->LoadCreatureEventAI_Summons();
handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded.");
return true;
}
static bool HandleReloadEventAIScriptsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Scripts from `creature_ai_scripts`...");
sEventAIMgr->LoadCreatureEventAI_Scripts();
handler->SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded.");
return true;
}
static bool HandleReloadQuestEndScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `quest_end_scripts`...");
sObjectMgr->LoadQuestEndScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded.");
return true;
}
static bool HandleReloadQuestStartScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `quest_start_scripts`...");
sObjectMgr->LoadQuestStartScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `quest_start_scripts` reloaded.");
return true;
}
static bool HandleReloadSpellScriptsCommand (ChatHandler* handler, const char* args)
{
if (sWorld->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outString("Re-Loading Scripts from `spell_scripts`...");
sObjectMgr->LoadSpellScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `spell_scripts` reloaded.");
return true;
}
static bool HandleReloadDbScriptStringCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Script strings from `db_script_string`...");
sObjectMgr->LoadDbScriptStrings();
handler->SendGlobalGMSysMessage("DB table `db_script_string` reloaded.");
return true;
}
static bool HandleReloadGameGraveyardZoneCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Graveyard-zone links...");
sObjectMgr->LoadGraveyardZones();
handler->SendGlobalGMSysMessage("DB table `game_graveyard_zone` reloaded.");
return true;
}
static bool HandleReloadGameTeleCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Game Tele coordinates...");
sObjectMgr->LoadGameTele();
handler->SendGlobalGMSysMessage("DB table `game_tele` reloaded.");
return true;
}
static bool HandleReloadDisablesCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading disables table...");
sDisableMgr->LoadDisables();
sLog->outString("Checking quest disables...");
sDisableMgr->CheckQuestDisables();
handler->SendGlobalGMSysMessage("DB table `disables` reloaded.");
return true;
}
static bool HandleReloadLocalesAchievementRewardCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Achievement Reward Data...");
sAchievementMgr->LoadRewardLocales();
handler->SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded.");
return true;
}
static bool HandleReloadLfgRewardsCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading lfg dungeon rewards...");
sLFGMgr->LoadRewards();
handler->SendGlobalGMSysMessage("DB table `lfg_dungeon_rewards` reloaded.");
return true;
}
static bool HandleReloadLocalesCreatureCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Creature ...");
sObjectMgr->LoadCreatureLocales();
handler->SendGlobalGMSysMessage("DB table `locales_creature` reloaded.");
return true;
}
static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Creature Texts...");
sCreatureTextMgr->LoadCreatureTextLocales();
handler->SendGlobalGMSysMessage("DB table `locales_creature_text` reloaded.");
return true;
}
static bool HandleReloadLocalesGameobjectCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Gameobject ... ");
sObjectMgr->LoadGameObjectLocales();
handler->SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded.");
return true;
}
static bool HandleReloadLocalesGossipMenuOptionCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Gossip Menu Option ... ");
sObjectMgr->LoadGossipMenuItemsLocales();
handler->SendGlobalGMSysMessage("DB table `locales_gossip_menu_option` reloaded.");
return true;
}
static bool HandleReloadLocalesItemCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Item ... ");
sObjectMgr->LoadItemLocales();
handler->SendGlobalGMSysMessage("DB table `locales_item` reloaded.");
return true;
}
static bool HandleReloadLocalesItemSetNameCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Item set name... ");
sObjectMgr->LoadItemSetNameLocales();
handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
return true;
}
static bool HandleReloadLocalesNpcTextCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales NPC Text ... ");
sObjectMgr->LoadNpcTextLocales();
handler->SendGlobalGMSysMessage("DB table `locales_npc_text` reloaded.");
return true;
}
static bool HandleReloadLocalesPageTextCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Page Text ... ");
sObjectMgr->LoadPageTextLocales();
handler->SendGlobalGMSysMessage("DB table `locales_page_text` reloaded.");
return true;
}
static bool HandleReloadLocalesPointsOfInterestCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Points Of Interest ... ");
sObjectMgr->LoadPointOfInterestLocales();
handler->SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded.");
return true;
}
static bool HandleReloadLocalesQuestCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Locales Quest ... ");
sObjectMgr->LoadQuestLocales();
handler->SendGlobalGMSysMessage("DB table `locales_quest` reloaded.");
return true;
}
static bool HandleReloadMailLevelRewardCommand (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Player level dependent mail rewards...");
sObjectMgr->LoadMailLevelRewards();
handler->SendGlobalGMSysMessage("DB table `mail_level_reward` reloaded.");
return true;
}
static bool HandleReloadAuctionsCommand (ChatHandler* handler, const char* /*args*/)
{
///- Reload dynamic data tables from the database
sLog->outString("Re-Loading Auctions...");
sAuctionMgr->LoadAuctionItems();
sAuctionMgr->LoadAuctions();
handler->SendGlobalGMSysMessage("Auctions reloaded.");
return true;
}
static bool HandleReloadConditions (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Conditions...");
sConditionMgr->LoadConditions(true);
handler->SendGlobalGMSysMessage("Conditions reloaded.");
return true;
}
static bool HandleReloadCreatureText (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Creature Texts...");
sCreatureTextMgr->LoadCreatureTexts();
handler->SendGlobalGMSysMessage("Creature Texts reloaded.");
return true;
}
static bool HandleReloadSmartScripts (ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Re-Loading Smart Scripts...");
sSmartScriptMgr->LoadSmartAIFromDB();
handler->SendGlobalGMSysMessage("Smart Scripts reloaded.");
return true;
}
};
void AddSC_reload_commandscript ()
{
new reload_commandscript();
}
| {
"pile_set_name": "Github"
} |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_MINIMAL_LOGGING_H_
#define TENSORFLOW_LITE_MINIMAL_LOGGING_H_
#include <cstdarg>
namespace tflite {
enum LogSeverity {
TFLITE_LOG_INFO = 0,
TFLITE_LOG_WARNING = 1,
TFLITE_LOG_ERROR = 2,
};
namespace logging_internal {
// Helper class for simple platform-specific console logging. Note that we
// explicitly avoid the convenience of ostream-style logging to minimize binary
// size impact.
class MinimalLogger {
public:
// Logging hook that takes variadic args.
static void Log(LogSeverity severity, const char* format, ...);
// Logging hook that takes a formatted va_list.
static void LogFormatted(LogSeverity severity, const char* format,
va_list args);
private:
static const char* GetSeverityName(LogSeverity severity);
};
} // namespace logging_internal
} // namespace tflite
// Convenience macro for basic internal logging in production builds.
// Note: This should never be used for debug-type logs, as it will *not* be
// stripped in release optimized builds. In general, prefer the error reporting
// APIs for developer-facing errors, and only use this for diagnostic output
// that should always be logged in user builds.
#define TFLITE_LOG_PROD(severity, format, ...) \
tflite::logging_internal::MinimalLogger::Log(severity, format, ##__VA_ARGS__);
// Convenience macro for logging a statement *once* for a given process lifetime
// in production builds.
#define TFLITE_LOG_PROD_ONCE(severity, format, ...) \
do { \
static const bool s_logged = [&] { \
TFLITE_LOG_PROD(severity, format, ##__VA_ARGS__) \
return true; \
}(); \
(void)s_logged; \
} while (false);
#ifndef NDEBUG
// In debug builds, always log.
#define TFLITE_LOG TFLITE_LOG_PROD
#define TFLITE_LOG_ONCE TFLITE_LOG_PROD_ONCE
#else
// In prod builds, never log, but ensure the code is well-formed and compiles.
#define TFLITE_LOG(severity, format, ...) \
while (false) { \
TFLITE_LOG_PROD(severity, format, ##__VA_ARGS__); \
}
#define TFLITE_LOG_ONCE TFLITE_LOG
#endif
#endif // TENSORFLOW_LITE_MINIMAL_LOGGING_H_
| {
"pile_set_name": "Github"
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>ssl::stream::next_layer</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="Asio">
<link rel="up" href="../ssl__stream.html" title="ssl::stream">
<link rel="prev" href="native_handle_type.html" title="ssl::stream::native_handle_type">
<link rel="next" href="next_layer/overload1.html" title="ssl::stream::next_layer (1 of 2 overloads)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../asio.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="native_handle_type.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../ssl__stream.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="next_layer/overload1.html"><img src="../../../next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="asio.reference.ssl__stream.next_layer"></a><a class="link" href="next_layer.html" title="ssl::stream::next_layer">ssl::stream::next_layer</a>
</h4></div></div></div>
<p>
<a class="indexterm" name="asio.indexterm.ssl__stream.next_layer"></a>
Get a reference
to the next layer.
</p>
<pre class="programlisting">const next_layer_type & <a class="link" href="next_layer/overload1.html" title="ssl::stream::next_layer (1 of 2 overloads)">next_layer</a>() const;
<span class="emphasis"><em>» <a class="link" href="next_layer/overload1.html" title="ssl::stream::next_layer (1 of 2 overloads)">more...</a></em></span>
next_layer_type & <a class="link" href="next_layer/overload2.html" title="ssl::stream::next_layer (2 of 2 overloads)">next_layer</a>();
<span class="emphasis"><em>» <a class="link" href="next_layer/overload2.html" title="ssl::stream::next_layer (2 of 2 overloads)">more...</a></em></span>
</pre>
</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 © 2003-2018 Christopher M. Kohlhoff<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="native_handle_type.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../ssl__stream.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="next_layer/overload1.html"><img src="../../../next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
# frozen_string_literal: true
# == Schema Information
#
# Table name: flashes
#
# id :bigint not null, primary key
# client_uuid :string not null
# data :json
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_flashes_on_client_uuid (client_uuid) UNIQUE
#
class Flash < ApplicationRecord
def self.store_data(client_uuid, hash)
return if client_uuid.blank?
flash = Flash.where(client_uuid: client_uuid).first_or_create
flash.update_column(:data, { type: hash.keys.first, message: hash.values.first })
end
def self.reset_data(client_uuid)
flash = Flash.find_by(client_uuid: client_uuid)
return if flash.nil?
flash.update_column(:data, {})
end
end
| {
"pile_set_name": "Github"
} |
namespace ClassLib067
{
public class Class007
{
public static string Property => "ClassLib067";
}
}
| {
"pile_set_name": "Github"
} |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="agency.tango.android.avatarview">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">
</application>
</manifest>
| {
"pile_set_name": "Github"
} |
/*
* SH4 emulation
*
* Copyright (c) 2005 Samuel Tardieu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CPU_SH4_H
#define _CPU_SH4_H
#include "config.h"
#include "qemu-common.h"
#define TARGET_LONG_BITS 32
#define TARGET_HAS_ICE 1
#define ELF_MACHINE EM_SH
/* CPU Subtypes */
#define SH_CPU_SH7750 (1 << 0)
#define SH_CPU_SH7750S (1 << 1)
#define SH_CPU_SH7750R (1 << 2)
#define SH_CPU_SH7751 (1 << 3)
#define SH_CPU_SH7751R (1 << 4)
#define SH_CPU_SH7785 (1 << 5)
#define SH_CPU_SH7750_ALL (SH_CPU_SH7750 | SH_CPU_SH7750S | SH_CPU_SH7750R)
#define SH_CPU_SH7751_ALL (SH_CPU_SH7751 | SH_CPU_SH7751R)
#define CPUState struct CPUSH4State
#include "cpu-defs.h"
#include "softfloat.h"
#define TARGET_PAGE_BITS 12 /* 4k XXXXX */
#define TARGET_PHYS_ADDR_SPACE_BITS 32
#define TARGET_VIRT_ADDR_SPACE_BITS 32
#define SR_MD (1 << 30)
#define SR_RB (1 << 29)
#define SR_BL (1 << 28)
#define SR_FD (1 << 15)
#define SR_M (1 << 9)
#define SR_Q (1 << 8)
#define SR_I3 (1 << 7)
#define SR_I2 (1 << 6)
#define SR_I1 (1 << 5)
#define SR_I0 (1 << 4)
#define SR_S (1 << 1)
#define SR_T (1 << 0)
#define FPSCR_MASK (0x003fffff)
#define FPSCR_FR (1 << 21)
#define FPSCR_SZ (1 << 20)
#define FPSCR_PR (1 << 19)
#define FPSCR_DN (1 << 18)
#define FPSCR_CAUSE_MASK (0x3f << 12)
#define FPSCR_CAUSE_SHIFT (12)
#define FPSCR_CAUSE_E (1 << 17)
#define FPSCR_CAUSE_V (1 << 16)
#define FPSCR_CAUSE_Z (1 << 15)
#define FPSCR_CAUSE_O (1 << 14)
#define FPSCR_CAUSE_U (1 << 13)
#define FPSCR_CAUSE_I (1 << 12)
#define FPSCR_ENABLE_MASK (0x1f << 7)
#define FPSCR_ENABLE_SHIFT (7)
#define FPSCR_ENABLE_V (1 << 11)
#define FPSCR_ENABLE_Z (1 << 10)
#define FPSCR_ENABLE_O (1 << 9)
#define FPSCR_ENABLE_U (1 << 8)
#define FPSCR_ENABLE_I (1 << 7)
#define FPSCR_FLAG_MASK (0x1f << 2)
#define FPSCR_FLAG_SHIFT (2)
#define FPSCR_FLAG_V (1 << 6)
#define FPSCR_FLAG_Z (1 << 5)
#define FPSCR_FLAG_O (1 << 4)
#define FPSCR_FLAG_U (1 << 3)
#define FPSCR_FLAG_I (1 << 2)
#define FPSCR_RM_MASK (0x03 << 0)
#define FPSCR_RM_NEAREST (0 << 0)
#define FPSCR_RM_ZERO (1 << 0)
#define DELAY_SLOT (1 << 0)
#define DELAY_SLOT_CONDITIONAL (1 << 1)
#define DELAY_SLOT_TRUE (1 << 2)
#define DELAY_SLOT_CLEARME (1 << 3)
/* The dynamic value of the DELAY_SLOT_TRUE flag determines whether the jump
* after the delay slot should be taken or not. It is calculated from SR_T.
*
* It is unclear if it is permitted to modify the SR_T flag in a delay slot.
* The use of DELAY_SLOT_TRUE flag makes us accept such SR_T modification.
*/
typedef struct tlb_t {
uint32_t vpn; /* virtual page number */
uint32_t ppn; /* physical page number */
uint32_t size; /* mapped page size in bytes */
uint8_t asid; /* address space identifier */
uint8_t v:1; /* validity */
uint8_t sz:2; /* page size */
uint8_t sh:1; /* share status */
uint8_t c:1; /* cacheability */
uint8_t pr:2; /* protection key */
uint8_t d:1; /* dirty */
uint8_t wt:1; /* write through */
uint8_t sa:3; /* space attribute (PCMCIA) */
uint8_t tc:1; /* timing control */
} tlb_t;
#define UTLB_SIZE 64
#define ITLB_SIZE 4
#define NB_MMU_MODES 2
enum sh_features {
SH_FEATURE_SH4A = 1,
SH_FEATURE_BCR3_AND_BCR4 = 2,
};
typedef struct memory_content {
uint32_t address;
uint32_t value;
struct memory_content *next;
} memory_content;
typedef struct CPUSH4State {
uint32_t flags; /* general execution flags */
uint32_t gregs[24]; /* general registers */
float32 fregs[32]; /* floating point registers */
uint32_t sr; /* status register */
uint32_t ssr; /* saved status register */
uint32_t spc; /* saved program counter */
uint32_t gbr; /* global base register */
uint32_t vbr; /* vector base register */
uint32_t sgr; /* saved global register 15 */
uint32_t dbr; /* debug base register */
uint32_t pc; /* program counter */
uint32_t delayed_pc; /* target of delayed jump */
uint32_t mach; /* multiply and accumulate high */
uint32_t macl; /* multiply and accumulate low */
uint32_t pr; /* procedure register */
uint32_t fpscr; /* floating point status/control register */
uint32_t fpul; /* floating point communication register */
/* float point status register */
float_status fp_status;
/* The features that we should emulate. See sh_features above. */
uint32_t features;
/* Those belong to the specific unit (SH7750) but are handled here */
uint32_t mmucr; /* MMU control register */
uint32_t pteh; /* page table entry high register */
uint32_t ptel; /* page table entry low register */
uint32_t ptea; /* page table entry assistance register */
uint32_t ttb; /* tranlation table base register */
uint32_t tea; /* TLB exception address register */
uint32_t tra; /* TRAPA exception register */
uint32_t expevt; /* exception event register */
uint32_t intevt; /* interrupt event register */
tlb_t itlb[ITLB_SIZE]; /* instruction translation table */
tlb_t utlb[UTLB_SIZE]; /* unified translation table */
uint32_t ldst;
CPU_COMMON
int id; /* CPU model */
uint32_t pvr; /* Processor Version Register */
uint32_t prr; /* Processor Revision Register */
uint32_t cvr; /* Cache Version Register */
void *intc_handle;
int intr_at_halt; /* SR_BL ignored during sleep */
memory_content *movcal_backup;
memory_content **movcal_backup_tail;
} CPUSH4State;
CPUSH4State *cpu_sh4_init(const char *cpu_model);
int cpu_sh4_exec(CPUSH4State * s);
int cpu_sh4_signal_handler(int host_signum, void *pinfo,
void *puc);
int cpu_sh4_handle_mmu_fault(CPUSH4State * env, target_ulong address, int rw,
int mmu_idx, int is_softmmu);
#define cpu_handle_mmu_fault cpu_sh4_handle_mmu_fault
void do_interrupt(CPUSH4State * env);
void sh4_cpu_list(FILE *f, fprintf_function cpu_fprintf);
#if !defined(CONFIG_USER_ONLY)
void cpu_sh4_invalidate_tlb(CPUSH4State *s);
uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s,
target_phys_addr_t addr);
void cpu_sh4_write_mmaped_itlb_addr(CPUSH4State *s, target_phys_addr_t addr,
uint32_t mem_value);
uint32_t cpu_sh4_read_mmaped_itlb_data(CPUSH4State *s,
target_phys_addr_t addr);
void cpu_sh4_write_mmaped_itlb_data(CPUSH4State *s, target_phys_addr_t addr,
uint32_t mem_value);
uint32_t cpu_sh4_read_mmaped_utlb_addr(CPUSH4State *s,
target_phys_addr_t addr);
void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr,
uint32_t mem_value);
uint32_t cpu_sh4_read_mmaped_utlb_data(CPUSH4State *s,
target_phys_addr_t addr);
void cpu_sh4_write_mmaped_utlb_data(CPUSH4State *s, target_phys_addr_t addr,
uint32_t mem_value);
#endif
int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr);
static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls)
{
env->gbr = newtls;
}
void cpu_load_tlb(CPUSH4State * env);
#include "softfloat.h"
#define cpu_init cpu_sh4_init
#define cpu_exec cpu_sh4_exec
#define cpu_gen_code cpu_sh4_gen_code
#define cpu_signal_handler cpu_sh4_signal_handler
#define cpu_list sh4_cpu_list
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _kernel
#define MMU_MODE1_SUFFIX _user
#define MMU_USER_IDX 1
static inline int cpu_mmu_index (CPUState *env)
{
return (env->sr & SR_MD) == 0 ? 1 : 0;
}
#if defined(CONFIG_USER_ONLY)
static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
{
if (newsp)
env->gregs[15] = newsp;
env->gregs[0] = 0;
}
#endif
#include "cpu-all.h"
/* Memory access type */
enum {
/* Privilege */
ACCESS_PRIV = 0x01,
/* Direction */
ACCESS_WRITE = 0x02,
/* Type of instruction */
ACCESS_CODE = 0x10,
ACCESS_INT = 0x20
};
/* MMU control register */
#define MMUCR 0x1F000010
#define MMUCR_AT (1<<0)
#define MMUCR_TI (1<<2)
#define MMUCR_SV (1<<8)
#define MMUCR_URC_BITS (6)
#define MMUCR_URC_OFFSET (10)
#define MMUCR_URC_SIZE (1 << MMUCR_URC_BITS)
#define MMUCR_URC_MASK (((MMUCR_URC_SIZE) - 1) << MMUCR_URC_OFFSET)
static inline int cpu_mmucr_urc (uint32_t mmucr)
{
return ((mmucr & MMUCR_URC_MASK) >> MMUCR_URC_OFFSET);
}
/* PTEH : Page Translation Entry High register */
#define PTEH_ASID_BITS (8)
#define PTEH_ASID_SIZE (1 << PTEH_ASID_BITS)
#define PTEH_ASID_MASK (PTEH_ASID_SIZE - 1)
#define cpu_pteh_asid(pteh) ((pteh) & PTEH_ASID_MASK)
#define PTEH_VPN_BITS (22)
#define PTEH_VPN_OFFSET (10)
#define PTEH_VPN_SIZE (1 << PTEH_VPN_BITS)
#define PTEH_VPN_MASK (((PTEH_VPN_SIZE) - 1) << PTEH_VPN_OFFSET)
static inline int cpu_pteh_vpn (uint32_t pteh)
{
return ((pteh & PTEH_VPN_MASK) >> PTEH_VPN_OFFSET);
}
/* PTEL : Page Translation Entry Low register */
#define PTEL_V (1 << 8)
#define cpu_ptel_v(ptel) (((ptel) & PTEL_V) >> 8)
#define PTEL_C (1 << 3)
#define cpu_ptel_c(ptel) (((ptel) & PTEL_C) >> 3)
#define PTEL_D (1 << 2)
#define cpu_ptel_d(ptel) (((ptel) & PTEL_D) >> 2)
#define PTEL_SH (1 << 1)
#define cpu_ptel_sh(ptel)(((ptel) & PTEL_SH) >> 1)
#define PTEL_WT (1 << 0)
#define cpu_ptel_wt(ptel) ((ptel) & PTEL_WT)
#define PTEL_SZ_HIGH_OFFSET (7)
#define PTEL_SZ_HIGH (1 << PTEL_SZ_HIGH_OFFSET)
#define PTEL_SZ_LOW_OFFSET (4)
#define PTEL_SZ_LOW (1 << PTEL_SZ_LOW_OFFSET)
static inline int cpu_ptel_sz (uint32_t ptel)
{
int sz;
sz = (ptel & PTEL_SZ_HIGH) >> PTEL_SZ_HIGH_OFFSET;
sz <<= 1;
sz |= (ptel & PTEL_SZ_LOW) >> PTEL_SZ_LOW_OFFSET;
return sz;
}
#define PTEL_PPN_BITS (19)
#define PTEL_PPN_OFFSET (10)
#define PTEL_PPN_SIZE (1 << PTEL_PPN_BITS)
#define PTEL_PPN_MASK (((PTEL_PPN_SIZE) - 1) << PTEL_PPN_OFFSET)
static inline int cpu_ptel_ppn (uint32_t ptel)
{
return ((ptel & PTEL_PPN_MASK) >> PTEL_PPN_OFFSET);
}
#define PTEL_PR_BITS (2)
#define PTEL_PR_OFFSET (5)
#define PTEL_PR_SIZE (1 << PTEL_PR_BITS)
#define PTEL_PR_MASK (((PTEL_PR_SIZE) - 1) << PTEL_PR_OFFSET)
static inline int cpu_ptel_pr (uint32_t ptel)
{
return ((ptel & PTEL_PR_MASK) >> PTEL_PR_OFFSET);
}
/* PTEA : Page Translation Entry Assistance register */
#define PTEA_SA_BITS (3)
#define PTEA_SA_SIZE (1 << PTEA_SA_BITS)
#define PTEA_SA_MASK (PTEA_SA_SIZE - 1)
#define cpu_ptea_sa(ptea) ((ptea) & PTEA_SA_MASK)
#define PTEA_TC (1 << 3)
#define cpu_ptea_tc(ptea) (((ptea) & PTEA_TC) >> 3)
#define TB_FLAG_PENDING_MOVCA (1 << 4)
static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target_ulong *cs_base, int *flags)
{
*pc = env->pc;
*cs_base = 0;
*flags = (env->flags & (DELAY_SLOT | DELAY_SLOT_CONDITIONAL
| DELAY_SLOT_TRUE | DELAY_SLOT_CLEARME)) /* Bits 0- 3 */
| (env->fpscr & (FPSCR_FR | FPSCR_SZ | FPSCR_PR)) /* Bits 19-21 */
| (env->sr & (SR_MD | SR_RB)) /* Bits 29-30 */
| (env->sr & SR_FD) /* Bit 15 */
| (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 4 */
}
#endif /* _CPU_SH4_H */
| {
"pile_set_name": "Github"
} |
/***************************************************************************/
/* */
/* gxvmort0.c */
/* */
/* TrueTypeGX/AAT mort table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
#include "gxvmort.h"
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_gxvmort
static const char* GXV_Mort_IndicScript_Msg[] =
{
"no change",
"Ax => xA",
"xD => Dx",
"AxD => DxA",
"ABx => xAB",
"ABx => xBA",
"xCD => CDx",
"xCD => DCx",
"AxCD => CDxA",
"AxCD => DCxA",
"ABxD => DxAB",
"ABxD => DxBA",
"ABxCD => CDxAB",
"ABxCD => CDxBA",
"ABxCD => DCxAB",
"ABxCD => DCxBA",
};
static void
gxv_mort_subtable_type0_entry_validate(
FT_Byte state,
FT_UShort flags,
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator gxvalid )
{
FT_UShort markFirst;
FT_UShort dontAdvance;
FT_UShort markLast;
FT_UShort reserved;
FT_UShort verb = 0;
FT_UNUSED( state );
FT_UNUSED( table );
FT_UNUSED( limit );
FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] ); /* for the non-debugging */
FT_UNUSED( glyphOffset_p ); /* case */
markFirst = (FT_UShort)( ( flags >> 15 ) & 1 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
markLast = (FT_UShort)( ( flags >> 13 ) & 1 );
reserved = (FT_UShort)( flags & 0x1FF0 );
verb = (FT_UShort)( flags & 0x000F );
GXV_TRACE(( " IndicScript MorphRule for glyphOffset 0x%04x",
glyphOffset_p->u ));
GXV_TRACE(( " markFirst=%01d", markFirst ));
GXV_TRACE(( " dontAdvance=%01d", dontAdvance ));
GXV_TRACE(( " markLast=%01d", markLast ));
GXV_TRACE(( " %02d", verb ));
GXV_TRACE(( " %s\n", GXV_Mort_IndicScript_Msg[verb] ));
if ( markFirst > 0 && markLast > 0 )
{
GXV_TRACE(( " [odd] a glyph is marked as the first and last"
" in Indic rearrangement\n" ));
GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
}
if ( markFirst > 0 && dontAdvance > 0 )
{
GXV_TRACE(( " [odd] the first glyph is marked as dontAdvance"
" in Indic rearrangement\n" ));
GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
}
if ( 0 < reserved )
{
GXV_TRACE(( " non-zero bits found in reserved range\n" ));
GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
}
else
GXV_TRACE(( "\n" ));
}
FT_LOCAL_DEF( void )
gxv_mort_subtable_type0_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator gxvalid )
{
FT_Bytes p = table;
GXV_NAME_ENTER(
"mort chain subtable type0 (Indic-Script Rearrangement)" );
GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
gxvalid->statetable.optdata = NULL;
gxvalid->statetable.optdata_load_func = NULL;
gxvalid->statetable.subtable_setup_func = NULL;
gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
gxvalid->statetable.entry_validate_func =
gxv_mort_subtable_type0_entry_validate;
gxv_StateTable_validate( p, limit, gxvalid );
GXV_EXIT;
}
/* END */
| {
"pile_set_name": "Github"
} |
// go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm,netbsd
package unix
const (
SYS_EXIT = 1 // { void|sys||exit(int rval); }
SYS_FORK = 2 // { int|sys||fork(void); }
SYS_READ = 3 // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }
SYS_WRITE = 4 // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }
SYS_OPEN = 5 // { int|sys||open(const char *path, int flags, ... mode_t mode); }
SYS_CLOSE = 6 // { int|sys||close(int fd); }
SYS_LINK = 9 // { int|sys||link(const char *path, const char *link); }
SYS_UNLINK = 10 // { int|sys||unlink(const char *path); }
SYS_CHDIR = 12 // { int|sys||chdir(const char *path); }
SYS_FCHDIR = 13 // { int|sys||fchdir(int fd); }
SYS_CHMOD = 15 // { int|sys||chmod(const char *path, mode_t mode); }
SYS_CHOWN = 16 // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }
SYS_BREAK = 17 // { int|sys||obreak(char *nsize); }
SYS_GETPID = 20 // { pid_t|sys||getpid_with_ppid(void); }
SYS_UNMOUNT = 22 // { int|sys||unmount(const char *path, int flags); }
SYS_SETUID = 23 // { int|sys||setuid(uid_t uid); }
SYS_GETUID = 24 // { uid_t|sys||getuid_with_euid(void); }
SYS_GETEUID = 25 // { uid_t|sys||geteuid(void); }
SYS_PTRACE = 26 // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }
SYS_RECVMSG = 27 // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }
SYS_SENDMSG = 28 // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }
SYS_RECVFROM = 29 // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }
SYS_ACCEPT = 30 // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }
SYS_GETPEERNAME = 31 // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }
SYS_GETSOCKNAME = 32 // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }
SYS_ACCESS = 33 // { int|sys||access(const char *path, int flags); }
SYS_CHFLAGS = 34 // { int|sys||chflags(const char *path, u_long flags); }
SYS_FCHFLAGS = 35 // { int|sys||fchflags(int fd, u_long flags); }
SYS_SYNC = 36 // { void|sys||sync(void); }
SYS_KILL = 37 // { int|sys||kill(pid_t pid, int signum); }
SYS_GETPPID = 39 // { pid_t|sys||getppid(void); }
SYS_DUP = 41 // { int|sys||dup(int fd); }
SYS_PIPE = 42 // { int|sys||pipe(void); }
SYS_GETEGID = 43 // { gid_t|sys||getegid(void); }
SYS_PROFIL = 44 // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }
SYS_KTRACE = 45 // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }
SYS_GETGID = 47 // { gid_t|sys||getgid_with_egid(void); }
SYS___GETLOGIN = 49 // { int|sys||__getlogin(char *namebuf, size_t namelen); }
SYS___SETLOGIN = 50 // { int|sys||__setlogin(const char *namebuf); }
SYS_ACCT = 51 // { int|sys||acct(const char *path); }
SYS_IOCTL = 54 // { int|sys||ioctl(int fd, u_long com, ... void *data); }
SYS_REVOKE = 56 // { int|sys||revoke(const char *path); }
SYS_SYMLINK = 57 // { int|sys||symlink(const char *path, const char *link); }
SYS_READLINK = 58 // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }
SYS_EXECVE = 59 // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }
SYS_UMASK = 60 // { mode_t|sys||umask(mode_t newmask); }
SYS_CHROOT = 61 // { int|sys||chroot(const char *path); }
SYS_VFORK = 66 // { int|sys||vfork(void); }
SYS_SBRK = 69 // { int|sys||sbrk(intptr_t incr); }
SYS_SSTK = 70 // { int|sys||sstk(int incr); }
SYS_VADVISE = 72 // { int|sys||ovadvise(int anom); }
SYS_MUNMAP = 73 // { int|sys||munmap(void *addr, size_t len); }
SYS_MPROTECT = 74 // { int|sys||mprotect(void *addr, size_t len, int prot); }
SYS_MADVISE = 75 // { int|sys||madvise(void *addr, size_t len, int behav); }
SYS_MINCORE = 78 // { int|sys||mincore(void *addr, size_t len, char *vec); }
SYS_GETGROUPS = 79 // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }
SYS_SETGROUPS = 80 // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }
SYS_GETPGRP = 81 // { int|sys||getpgrp(void); }
SYS_SETPGID = 82 // { int|sys||setpgid(pid_t pid, pid_t pgid); }
SYS_DUP2 = 90 // { int|sys||dup2(int from, int to); }
SYS_FCNTL = 92 // { int|sys||fcntl(int fd, int cmd, ... void *arg); }
SYS_FSYNC = 95 // { int|sys||fsync(int fd); }
SYS_SETPRIORITY = 96 // { int|sys||setpriority(int which, id_t who, int prio); }
SYS_CONNECT = 98 // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }
SYS_GETPRIORITY = 100 // { int|sys||getpriority(int which, id_t who); }
SYS_BIND = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }
SYS_SETSOCKOPT = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }
SYS_LISTEN = 106 // { int|sys||listen(int s, int backlog); }
SYS_GETSOCKOPT = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }
SYS_READV = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }
SYS_WRITEV = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }
SYS_FCHOWN = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }
SYS_FCHMOD = 124 // { int|sys||fchmod(int fd, mode_t mode); }
SYS_SETREUID = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }
SYS_SETREGID = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }
SYS_RENAME = 128 // { int|sys||rename(const char *from, const char *to); }
SYS_FLOCK = 131 // { int|sys||flock(int fd, int how); }
SYS_MKFIFO = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }
SYS_SENDTO = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }
SYS_SHUTDOWN = 134 // { int|sys||shutdown(int s, int how); }
SYS_SOCKETPAIR = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }
SYS_MKDIR = 136 // { int|sys||mkdir(const char *path, mode_t mode); }
SYS_RMDIR = 137 // { int|sys||rmdir(const char *path); }
SYS_SETSID = 147 // { int|sys||setsid(void); }
SYS_SYSARCH = 165 // { int|sys||sysarch(int op, void *parms); }
SYS_PREAD = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }
SYS_PWRITE = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }
SYS_NTP_ADJTIME = 176 // { int|sys||ntp_adjtime(struct timex *tp); }
SYS_SETGID = 181 // { int|sys||setgid(gid_t gid); }
SYS_SETEGID = 182 // { int|sys||setegid(gid_t egid); }
SYS_SETEUID = 183 // { int|sys||seteuid(uid_t euid); }
SYS_PATHCONF = 191 // { long|sys||pathconf(const char *path, int name); }
SYS_FPATHCONF = 192 // { long|sys||fpathconf(int fd, int name); }
SYS_GETRLIMIT = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }
SYS_SETRLIMIT = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }
SYS_MMAP = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }
SYS_LSEEK = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }
SYS_TRUNCATE = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }
SYS_FTRUNCATE = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }
SYS___SYSCTL = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }
SYS_MLOCK = 203 // { int|sys||mlock(const void *addr, size_t len); }
SYS_MUNLOCK = 204 // { int|sys||munlock(const void *addr, size_t len); }
SYS_UNDELETE = 205 // { int|sys||undelete(const char *path); }
SYS_GETPGID = 207 // { pid_t|sys||getpgid(pid_t pid); }
SYS_REBOOT = 208 // { int|sys||reboot(int opt, char *bootstr); }
SYS_POLL = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }
SYS_SEMGET = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }
SYS_SEMOP = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }
SYS_SEMCONFIG = 223 // { int|sys||semconfig(int flag); }
SYS_MSGGET = 225 // { int|sys||msgget(key_t key, int msgflg); }
SYS_MSGSND = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }
SYS_MSGRCV = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }
SYS_SHMAT = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }
SYS_SHMDT = 230 // { int|sys||shmdt(const void *shmaddr); }
SYS_SHMGET = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }
SYS_TIMER_CREATE = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }
SYS_TIMER_DELETE = 236 // { int|sys||timer_delete(timer_t timerid); }
SYS_TIMER_GETOVERRUN = 239 // { int|sys||timer_getoverrun(timer_t timerid); }
SYS_FDATASYNC = 241 // { int|sys||fdatasync(int fd); }
SYS_MLOCKALL = 242 // { int|sys||mlockall(int flags); }
SYS_MUNLOCKALL = 243 // { int|sys||munlockall(void); }
SYS_SIGQUEUEINFO = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }
SYS_MODCTL = 246 // { int|sys||modctl(int cmd, void *arg); }
SYS___POSIX_RENAME = 270 // { int|sys||__posix_rename(const char *from, const char *to); }
SYS_SWAPCTL = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }
SYS_MINHERIT = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }
SYS_LCHMOD = 274 // { int|sys||lchmod(const char *path, mode_t mode); }
SYS_LCHOWN = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }
SYS_MSYNC = 277 // { int|sys|13|msync(void *addr, size_t len, int flags); }
SYS___POSIX_CHOWN = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }
SYS___POSIX_FCHOWN = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }
SYS___POSIX_LCHOWN = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }
SYS_GETSID = 286 // { pid_t|sys||getsid(pid_t pid); }
SYS___CLONE = 287 // { pid_t|sys||__clone(int flags, void *stack); }
SYS_FKTRACE = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }
SYS_PREADV = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }
SYS_PWRITEV = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }
SYS___GETCWD = 296 // { int|sys||__getcwd(char *bufp, size_t length); }
SYS_FCHROOT = 297 // { int|sys||fchroot(int fd); }
SYS_LCHFLAGS = 304 // { int|sys||lchflags(const char *path, u_long flags); }
SYS_ISSETUGID = 305 // { int|sys||issetugid(void); }
SYS_UTRACE = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }
SYS_GETCONTEXT = 307 // { int|sys||getcontext(struct __ucontext *ucp); }
SYS_SETCONTEXT = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }
SYS__LWP_CREATE = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }
SYS__LWP_EXIT = 310 // { int|sys||_lwp_exit(void); }
SYS__LWP_SELF = 311 // { lwpid_t|sys||_lwp_self(void); }
SYS__LWP_WAIT = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }
SYS__LWP_SUSPEND = 313 // { int|sys||_lwp_suspend(lwpid_t target); }
SYS__LWP_CONTINUE = 314 // { int|sys||_lwp_continue(lwpid_t target); }
SYS__LWP_WAKEUP = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }
SYS__LWP_GETPRIVATE = 316 // { void *|sys||_lwp_getprivate(void); }
SYS__LWP_SETPRIVATE = 317 // { void|sys||_lwp_setprivate(void *ptr); }
SYS__LWP_KILL = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }
SYS__LWP_DETACH = 319 // { int|sys||_lwp_detach(lwpid_t target); }
SYS__LWP_UNPARK = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }
SYS__LWP_UNPARK_ALL = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }
SYS__LWP_SETNAME = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }
SYS__LWP_GETNAME = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }
SYS__LWP_CTL = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }
SYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }
SYS_PMC_GET_INFO = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }
SYS_PMC_CONTROL = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }
SYS_RASCTL = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }
SYS_KQUEUE = 344 // { int|sys||kqueue(void); }
SYS__SCHED_SETPARAM = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }
SYS__SCHED_GETPARAM = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }
SYS__SCHED_SETAFFINITY = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }
SYS__SCHED_GETAFFINITY = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }
SYS_SCHED_YIELD = 350 // { int|sys||sched_yield(void); }
SYS_FSYNC_RANGE = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }
SYS_UUIDGEN = 355 // { int|sys||uuidgen(struct uuid *store, int count); }
SYS_GETVFSSTAT = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }
SYS_STATVFS1 = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }
SYS_FSTATVFS1 = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }
SYS_EXTATTRCTL = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }
SYS_EXTATTR_SET_FILE = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }
SYS_EXTATTR_GET_FILE = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_FILE = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }
SYS_EXTATTR_SET_FD = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }
SYS_EXTATTR_GET_FD = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_FD = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }
SYS_EXTATTR_SET_LINK = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }
SYS_EXTATTR_GET_LINK = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_LINK = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }
SYS_EXTATTR_LIST_FD = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }
SYS_EXTATTR_LIST_FILE = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }
SYS_EXTATTR_LIST_LINK = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }
SYS_SETXATTR = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }
SYS_LSETXATTR = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }
SYS_FSETXATTR = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }
SYS_GETXATTR = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }
SYS_LGETXATTR = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }
SYS_FGETXATTR = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }
SYS_LISTXATTR = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }
SYS_LLISTXATTR = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }
SYS_FLISTXATTR = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }
SYS_REMOVEXATTR = 384 // { int|sys||removexattr(const char *path, const char *name); }
SYS_LREMOVEXATTR = 385 // { int|sys||lremovexattr(const char *path, const char *name); }
SYS_FREMOVEXATTR = 386 // { int|sys||fremovexattr(int fd, const char *name); }
SYS_GETDENTS = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }
SYS_SOCKET = 394 // { int|sys|30|socket(int domain, int type, int protocol); }
SYS_GETFH = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }
SYS_MOUNT = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }
SYS_MREMAP = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }
SYS_PSET_CREATE = 412 // { int|sys||pset_create(psetid_t *psid); }
SYS_PSET_DESTROY = 413 // { int|sys||pset_destroy(psetid_t psid); }
SYS_PSET_ASSIGN = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }
SYS__PSET_BIND = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }
SYS_POSIX_FADVISE = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }
SYS_SELECT = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }
SYS_GETTIMEOFDAY = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }
SYS_SETTIMEOFDAY = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }
SYS_UTIMES = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }
SYS_ADJTIME = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }
SYS_FUTIMES = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }
SYS_LUTIMES = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }
SYS_SETITIMER = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }
SYS_GETITIMER = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }
SYS_CLOCK_GETTIME = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }
SYS_CLOCK_SETTIME = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }
SYS_CLOCK_GETRES = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }
SYS_NANOSLEEP = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }
SYS___SIGTIMEDWAIT = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }
SYS__LWP_PARK = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }
SYS_KEVENT = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }
SYS_PSELECT = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }
SYS_POLLTS = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }
SYS_STAT = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }
SYS_FSTAT = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }
SYS_LSTAT = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }
SYS___SEMCTL = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }
SYS_SHMCTL = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }
SYS_MSGCTL = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }
SYS_GETRUSAGE = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }
SYS_TIMER_SETTIME = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }
SYS_TIMER_GETTIME = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }
SYS_NTP_GETTIME = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }
SYS_WAIT4 = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }
SYS_MKNOD = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }
SYS_FHSTAT = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }
SYS_PIPE2 = 453 // { int|sys||pipe2(int *fildes, int flags); }
SYS_DUP3 = 454 // { int|sys||dup3(int from, int to, int flags); }
SYS_KQUEUE1 = 455 // { int|sys||kqueue1(int flags); }
SYS_PACCEPT = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }
SYS_LINKAT = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }
SYS_RENAMEAT = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }
SYS_MKFIFOAT = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }
SYS_MKNODAT = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }
SYS_MKDIRAT = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }
SYS_FACCESSAT = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }
SYS_FCHMODAT = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }
SYS_FCHOWNAT = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }
SYS_FEXECVE = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }
SYS_FSTATAT = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }
SYS_UTIMENSAT = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }
SYS_OPENAT = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }
SYS_READLINKAT = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }
SYS_SYMLINKAT = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }
SYS_UNLINKAT = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }
SYS_FUTIMENS = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }
SYS___QUOTACTL = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }
SYS_POSIX_SPAWN = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }
SYS_RECVMMSG = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }
SYS_SENDMMSG = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }
)
| {
"pile_set_name": "Github"
} |
/*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2012 The ZAP Development Team
*
* 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.zaproxy.zap.extension.httpsessions;
import java.awt.CardLayout;
import java.awt.EventQueue;
import java.awt.GridBagConstraints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.renderer.DefaultTableRenderer;
import org.jdesktop.swingx.renderer.IconValues;
import org.jdesktop.swingx.renderer.MappedValue;
import org.jdesktop.swingx.renderer.StringValues;
import org.parosproxy.paros.Constant;
import org.parosproxy.paros.control.Control;
import org.parosproxy.paros.extension.AbstractPanel;
import org.parosproxy.paros.model.SiteNode;
import org.parosproxy.paros.view.View;
import org.zaproxy.zap.utils.DisplayUtils;
import org.zaproxy.zap.utils.SortedComboBoxModel;
import org.zaproxy.zap.utils.TableExportButton;
import org.zaproxy.zap.view.ScanPanel;
import org.zaproxy.zap.view.table.decorator.AbstractTableCellItemIconHighlighter;
/**
* The HttpSessionsPanel used as a display panel for the {@link ExtensionHttpSessions}, allowing the
* user to view and control the http sessions.
*/
public class HttpSessionsPanel extends AbstractPanel {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The Constant PANEL_NAME. */
public static final String PANEL_NAME = "httpsessions";
/** The extension. */
private ExtensionHttpSessions extension = null;
private JPanel panelCommand = null;
private JToolBar panelToolbar = null;
private JScrollPane jScrollPane = null;
private JComboBox<String> siteSelect = null;
private JButton newSessionButton = null;
private JXTable sessionsTable = null;
private TableExportButton<JXTable> exportButton = null;
private JButton optionsButton = null;
/** The current site. */
private String currentSite = null;
/** The site model. */
private SortedComboBoxModel<String> siteModel = new SortedComboBoxModel<>();
/** The sessions model. */
private HttpSessionsTableModel sessionsModel = new HttpSessionsTableModel(null);
/**
* Instantiates a new http session panel.
*
* @param extensionHttpSession the extension http session
*/
public HttpSessionsPanel(ExtensionHttpSessions extensionHttpSession) {
super();
this.extension = extensionHttpSession;
initialize();
}
/** This method initializes this panel. */
private void initialize() {
this.setLayout(new CardLayout());
this.setSize(474, 251);
this.setName(Constant.messages.getString("httpsessions.panel.title"));
this.setIcon(
new ImageIcon(
HttpSessionsPanel.class.getResource("/resource/icon/16/session.png")));
this.setDefaultAccelerator(
extension
.getView()
.getMenuShortcutKeyStroke(
KeyEvent.VK_H,
KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
false));
this.setMnemonic(Constant.messages.getChar("httpsessions.panel.mnemonic"));
this.add(getPanelCommand(), getPanelCommand().getName());
}
/**
* This method initializes the main panel.
*
* @return javax.swing.JPanel
*/
private javax.swing.JPanel getPanelCommand() {
if (panelCommand == null) {
panelCommand = new javax.swing.JPanel();
panelCommand.setLayout(new java.awt.GridBagLayout());
panelCommand.setName(Constant.messages.getString("httpsessions.panel.title"));
// Add the two components: toolbar and work pane
GridBagConstraints toolbarGridBag = new GridBagConstraints();
GridBagConstraints workPaneGridBag = new GridBagConstraints();
toolbarGridBag.gridx = 0;
toolbarGridBag.gridy = 0;
toolbarGridBag.weightx = 1.0d;
toolbarGridBag.insets = new java.awt.Insets(2, 2, 2, 2);
toolbarGridBag.anchor = java.awt.GridBagConstraints.NORTHWEST;
toolbarGridBag.fill = java.awt.GridBagConstraints.HORIZONTAL;
workPaneGridBag.gridx = 0;
workPaneGridBag.gridy = 1;
workPaneGridBag.weightx = 1.0;
workPaneGridBag.weighty = 1.0;
workPaneGridBag.insets = new java.awt.Insets(0, 0, 0, 0);
workPaneGridBag.anchor = java.awt.GridBagConstraints.NORTHWEST;
workPaneGridBag.fill = java.awt.GridBagConstraints.BOTH;
panelCommand.add(this.getPanelToolbar(), toolbarGridBag);
panelCommand.add(getWorkPane(), workPaneGridBag);
}
return panelCommand;
}
private TableExportButton<JXTable> getExportButton() {
if (exportButton == null) {
exportButton = new TableExportButton<>(getHttpSessionsTable());
}
return exportButton;
}
/**
* Gets the options button.
*
* @return the options button
*/
private JButton getOptionsButton() {
if (optionsButton == null) {
optionsButton = new JButton();
optionsButton.setToolTipText(
Constant.messages.getString("httpsessions.toolbar.options.button"));
optionsButton.setIcon(
DisplayUtils.getScaledIcon(
new ImageIcon(
ScanPanel.class.getResource("/resource/icon/16/041.png"))));
optionsButton.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Control.getSingleton()
.getMenuToolsControl()
.options(
Constant.messages.getString(
"httpsessions.options.title"));
}
});
}
return optionsButton;
}
/**
* Gets the new session button.
*
* @return the new session button
*/
private JButton getNewSessionButton() {
if (newSessionButton == null) {
newSessionButton = new JButton();
newSessionButton.setText(
Constant.messages.getString("httpsessions.toolbar.newsession.label"));
newSessionButton.setIcon(
DisplayUtils.getScaledIcon(
new ImageIcon(
HttpSessionsPanel.class.getResource(
"/resource/icon/16/103.png"))));
newSessionButton.setToolTipText(
Constant.messages.getString("httpsessions.toolbar.newsession.tooltip"));
newSessionButton.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
HttpSessionsSite site = getCurrentHttpSessionSite();
if (site != null) {
site.createEmptySession();
}
}
});
}
return newSessionButton;
}
/**
* Gets the panel's toolbar.
*
* @return the panel toolbar
*/
private javax.swing.JToolBar getPanelToolbar() {
if (panelToolbar == null) {
// Initialize the toolbar
panelToolbar = new javax.swing.JToolBar();
panelToolbar.setLayout(new java.awt.GridBagLayout());
panelToolbar.setEnabled(true);
panelToolbar.setFloatable(false);
panelToolbar.setRollover(true);
panelToolbar.setPreferredSize(new java.awt.Dimension(800, 30));
panelToolbar.setName("HttpSessionToolbar");
// Add elements
GridBagConstraints labelGridBag = new GridBagConstraints();
GridBagConstraints siteSelectGridBag = new GridBagConstraints();
GridBagConstraints newSessionGridBag = new GridBagConstraints();
GridBagConstraints emptyGridBag = new GridBagConstraints();
GridBagConstraints optionsGridBag = new GridBagConstraints();
GridBagConstraints exportButtonGbc = new GridBagConstraints();
labelGridBag.gridx = 0;
labelGridBag.gridy = 0;
labelGridBag.insets = new java.awt.Insets(0, 0, 0, 0);
labelGridBag.anchor = java.awt.GridBagConstraints.WEST;
siteSelectGridBag.gridx = 1;
siteSelectGridBag.gridy = 0;
siteSelectGridBag.insets = new java.awt.Insets(0, 0, 0, 0);
siteSelectGridBag.anchor = java.awt.GridBagConstraints.WEST;
newSessionGridBag.gridx = 2;
newSessionGridBag.gridy = 0;
newSessionGridBag.insets = new java.awt.Insets(0, 0, 0, 0);
newSessionGridBag.anchor = java.awt.GridBagConstraints.WEST;
exportButtonGbc.gridx = 3;
exportButtonGbc.gridy = 0;
exportButtonGbc.insets = new java.awt.Insets(0, 0, 0, 0);
exportButtonGbc.anchor = java.awt.GridBagConstraints.WEST;
emptyGridBag.gridx = 4;
emptyGridBag.gridy = 0;
emptyGridBag.weightx = 1.0;
emptyGridBag.weighty = 1.0;
emptyGridBag.insets = new java.awt.Insets(0, 0, 0, 0);
emptyGridBag.anchor = java.awt.GridBagConstraints.WEST;
emptyGridBag.fill = java.awt.GridBagConstraints.HORIZONTAL;
optionsGridBag.gridx = 5;
optionsGridBag.gridy = 0;
optionsGridBag.insets = new java.awt.Insets(0, 0, 0, 0);
optionsGridBag.anchor = java.awt.GridBagConstraints.EAST;
JLabel label =
new JLabel(Constant.messages.getString("httpsessions.toolbar.site.label"));
panelToolbar.add(label, labelGridBag);
panelToolbar.add(getSiteSelect(), siteSelectGridBag);
panelToolbar.add(getNewSessionButton(), newSessionGridBag);
panelToolbar.add(getExportButton(), exportButtonGbc);
panelToolbar.add(getOptionsButton(), optionsGridBag);
// Add an empty JLabel to fill the space
panelToolbar.add(new JLabel(), emptyGridBag);
}
return panelToolbar;
}
/**
* Gets the work pane where data is shown.
*
* @return the work pane
*/
private JScrollPane getWorkPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
jScrollPane.setViewportView(getHttpSessionsTable());
}
return jScrollPane;
}
/** Sets the sessions table column sizes. */
private void setSessionsTableColumnSizes() {
sessionsTable.getColumnModel().getColumn(0).setMinWidth(60);
sessionsTable.getColumnModel().getColumn(0).setPreferredWidth(60); // active
sessionsTable.getColumnModel().getColumn(1).setMinWidth(120);
sessionsTable.getColumnModel().getColumn(1).setPreferredWidth(200); // name
sessionsTable.getColumnModel().getColumn(3).setMinWidth(100);
sessionsTable.getColumnModel().getColumn(3).setPreferredWidth(150); // matched
}
/**
* Gets the http sessions table.
*
* @return the http sessions table
*/
private JXTable getHttpSessionsTable() {
if (sessionsTable == null) {
sessionsTable = new JXTable(sessionsModel);
sessionsTable.setColumnSelectionAllowed(false);
sessionsTable.setCellSelectionEnabled(false);
sessionsTable.setRowSelectionAllowed(true);
sessionsTable.setAutoCreateRowSorter(true);
sessionsTable.setColumnControlVisible(true);
sessionsTable.setAutoCreateColumnsFromModel(false);
sessionsTable
.getColumnExt(0)
.setCellRenderer(
new DefaultTableRenderer(
new MappedValue(StringValues.EMPTY, IconValues.NONE),
JLabel.CENTER));
sessionsTable.getColumnExt(0).setHighlighters(new ActiveSessionIconHighlighter(0));
this.setSessionsTableColumnSizes();
sessionsTable.setName(PANEL_NAME);
sessionsTable.setDoubleBuffered(true);
sessionsTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
sessionsTable.addMouseListener(
new java.awt.event.MouseAdapter() {
@Override
public void mousePressed(java.awt.event.MouseEvent e) {
showPopupMenuIfTriggered(e);
}
@Override
public void mouseReleased(java.awt.event.MouseEvent e) {
showPopupMenuIfTriggered(e);
}
private void showPopupMenuIfTriggered(java.awt.event.MouseEvent e) {
if (e.isPopupTrigger()) {
// Select table item
int row = sessionsTable.rowAtPoint(e.getPoint());
if (row < 0
|| !sessionsTable
.getSelectionModel()
.isSelectedIndex(row)) {
sessionsTable.getSelectionModel().clearSelection();
if (row >= 0) {
sessionsTable
.getSelectionModel()
.setSelectionInterval(row, row);
}
}
View.getSingleton()
.getPopupMenu()
.show(e.getComponent(), e.getX(), e.getY());
}
}
});
}
return sessionsTable;
}
/**
* Gets the site select ComboBox.
*
* @return the site select
*/
private JComboBox<String> getSiteSelect() {
if (siteSelect == null) {
siteSelect = new JComboBox<>(siteModel);
siteSelect.addItem(Constant.messages.getString("httpsessions.toolbar.site.select"));
siteSelect.setSelectedIndex(0);
// Add the item listener for when the site is selected
siteSelect.addItemListener(
new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (ItemEvent.SELECTED == e.getStateChange()) {
if (siteSelect.getSelectedIndex() > 0) {
siteSelected((String) e.getItem());
} // If the user selects the first option (empty one), force the
// selection to
// the first valid site
else if (siteModel.getSize() > 1) {
siteModel.setSelectedItem(siteModel.getElementAt(1));
}
}
}
});
}
return siteSelect;
}
/**
* Adds a new site to the "Http Sessions" tab.
*
* <p>The method must be called in the EDT, failing to do so might result in thread interference
* or memory consistency errors.
*
* @param site the site
* @see #addSiteAsynchronously(String)
* @see EventQueue
*/
public void addSite(String site) {
if (siteModel.getIndexOf(site) < 0) {
siteModel.addElement(site);
if (currentSite == null) {
// First site added, automatically select it
siteModel.setSelectedItem(site);
}
}
}
/**
* Adds a new site, asynchronously, to the "Http Sessions" tab.
*
* <p>The call to this method will return immediately and the site will be added in the EDT (by
* calling the method {@code EventQueue#invokeLater(Runnable)}) after all pending events have
* been processed.
*
* @param site the site
* @see #addSite(String)
* @see EventQueue#invokeLater(Runnable)
*/
public void addSiteAsynchronously(final String site) {
EventQueue.invokeLater(
new Runnable() {
@Override
public void run() {
addSite(site);
}
});
}
/**
* A new Site was selected.
*
* @param site the site
*/
private void siteSelected(String site) {
if (!site.equals(currentSite)) {
this.sessionsModel = extension.getHttpSessionsSite(site).getModel();
this.getHttpSessionsTable().setModel(this.sessionsModel);
this.setSessionsTableColumnSizes();
currentSite = site;
}
}
/**
* Node selected.
*
* @param node the node
*/
public void nodeSelected(SiteNode node) {
if (node != null) {
siteModel.setSelectedItem(ScanPanel.cleanSiteName(node, true));
}
}
/** Reset the panel. */
public void reset() {
currentSite = null;
siteModel.removeAllElements();
siteModel.addElement(Constant.messages.getString("httpsessions.toolbar.site.select"));
sessionsModel = new HttpSessionsTableModel(null);
getHttpSessionsTable().setModel(sessionsModel);
}
/**
* Gets the current http session site.
*
* @return the current http session site, or null if no HttpSessionSite is selected
*/
public HttpSessionsSite getCurrentHttpSessionSite() {
if (currentSite == null) {
return null;
}
return extension.getHttpSessionsSite(currentSite);
}
/**
* Gets the currently selected site.
*
* @return the current site
*/
public String getCurrentSite() {
return currentSite;
}
/**
* Gets the selected http session.
*
* @return the selected session, or null if nothing is selected
*/
public HttpSession getSelectedSession() {
final int selectedRow = this.sessionsTable.getSelectedRow();
if (selectedRow == -1) {
// No row selected
return null;
}
final int rowIndex = sessionsTable.convertRowIndexToModel(selectedRow);
return this.sessionsModel.getHttpSessionAt(rowIndex);
}
/**
* A {@link org.jdesktop.swingx.decorator.Highlighter Highlighter} for a column that indicates,
* using an icon, whether or not a session is active.
*
* <p>The expected type/class of the cell value is {@code Boolean}.
*/
private static class ActiveSessionIconHighlighter extends AbstractTableCellItemIconHighlighter {
/** The icon that indicates that a session is active. */
private static final ImageIcon ACTIVE_ICON =
new ImageIcon(HttpSessionsPanel.class.getResource("/resource/icon/16/102.png"));
public ActiveSessionIconHighlighter(int columnIndex) {
super(columnIndex);
}
@Override
protected Icon getIcon(final Object cellItem) {
return ACTIVE_ICON;
}
@Override
protected boolean isHighlighted(final Object cellItem) {
return (Boolean) cellItem;
}
}
}
| {
"pile_set_name": "Github"
} |
Color Picker
============
> A simple color picker plugin written in pure JavaScript, for modern browsers.
Has support for touch events. Touchy… touchy…
[Demo and Documentation](https://tovic.github.io/color-picker) | {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `TCP_FASTOPEN` constant in crate `libc`.">
<meta name="keywords" content="rust, rustlang, rust-lang, TCP_FASTOPEN">
<title>libc::TCP_FASTOPEN - Rust</title>
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
<link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a>
<p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'TCP_FASTOPEN', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='constant' href=''>TCP_FASTOPEN</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-2033' class='srclink' href='../src/libc/unix/notbsd/linux/other/mod.rs.html#181' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const TCP_FASTOPEN: <a class='type' href='../libc/type.c_int.html' title='libc::c_int'>c_int</a><code> = </code><code>23</code></pre><div class='stability'><em class='stab unstable'>Unstable (<code>libc</code>)<p>: use <code>libc</code> from crates.io</p>
</em></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "libc";
window.playgroundUrl = "";
</script>
<script src="../jquery.js"></script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html> | {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_defer.h"
#include "xfs_da_format.h"
#include "xfs_da_btree.h"
#include "xfs_attr_sf.h"
#include "xfs_inode.h"
#include "xfs_trans.h"
#include "xfs_bmap.h"
#include "xfs_bmap_btree.h"
#include "xfs_attr.h"
#include "xfs_attr_leaf.h"
#include "xfs_attr_remote.h"
#include "xfs_quota.h"
#include "xfs_trans_space.h"
#include "xfs_trace.h"
/*
* xfs_attr.c
*
* Provide the external interfaces to manage attribute lists.
*/
/*========================================================================
* Function prototypes for the kernel.
*========================================================================*/
/*
* Internal routines when attribute list fits inside the inode.
*/
STATIC int xfs_attr_shortform_addname(xfs_da_args_t *args);
/*
* Internal routines when attribute list is one block.
*/
STATIC int xfs_attr_leaf_get(xfs_da_args_t *args);
STATIC int xfs_attr_leaf_addname(xfs_da_args_t *args);
STATIC int xfs_attr_leaf_removename(xfs_da_args_t *args);
/*
* Internal routines when attribute list is more than one block.
*/
STATIC int xfs_attr_node_get(xfs_da_args_t *args);
STATIC int xfs_attr_node_addname(xfs_da_args_t *args);
STATIC int xfs_attr_node_removename(xfs_da_args_t *args);
STATIC int xfs_attr_fillstate(xfs_da_state_t *state);
STATIC int xfs_attr_refillstate(xfs_da_state_t *state);
int
xfs_inode_hasattr(
struct xfs_inode *ip)
{
if (!XFS_IFORK_Q(ip) ||
(ip->i_afp->if_format == XFS_DINODE_FMT_EXTENTS &&
ip->i_afp->if_nextents == 0))
return 0;
return 1;
}
/*========================================================================
* Overall external interface routines.
*========================================================================*/
/*
* Retrieve an extended attribute and its value. Must have ilock.
* Returns 0 on successful retrieval, otherwise an error.
*/
int
xfs_attr_get_ilocked(
struct xfs_da_args *args)
{
ASSERT(xfs_isilocked(args->dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
if (!xfs_inode_hasattr(args->dp))
return -ENOATTR;
if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL)
return xfs_attr_shortform_getvalue(args);
if (xfs_bmap_one_block(args->dp, XFS_ATTR_FORK))
return xfs_attr_leaf_get(args);
return xfs_attr_node_get(args);
}
/*
* Retrieve an extended attribute by name, and its value if requested.
*
* If args->valuelen is zero, then the caller does not want the value, just an
* indication whether the attribute exists and the size of the value if it
* exists. The size is returned in args.valuelen.
*
* If args->value is NULL but args->valuelen is non-zero, allocate the buffer
* for the value after existence of the attribute has been determined. The
* caller always has to free args->value if it is set, no matter if this
* function was successful or not.
*
* If the attribute is found, but exceeds the size limit set by the caller in
* args->valuelen, return -ERANGE with the size of the attribute that was found
* in args->valuelen.
*/
int
xfs_attr_get(
struct xfs_da_args *args)
{
uint lock_mode;
int error;
XFS_STATS_INC(args->dp->i_mount, xs_attr_get);
if (XFS_FORCED_SHUTDOWN(args->dp->i_mount))
return -EIO;
args->geo = args->dp->i_mount->m_attr_geo;
args->whichfork = XFS_ATTR_FORK;
args->hashval = xfs_da_hashname(args->name, args->namelen);
/* Entirely possible to look up a name which doesn't exist */
args->op_flags = XFS_DA_OP_OKNOENT;
lock_mode = xfs_ilock_attr_map_shared(args->dp);
error = xfs_attr_get_ilocked(args);
xfs_iunlock(args->dp, lock_mode);
return error;
}
/*
* Calculate how many blocks we need for the new attribute,
*/
STATIC int
xfs_attr_calc_size(
struct xfs_da_args *args,
int *local)
{
struct xfs_mount *mp = args->dp->i_mount;
int size;
int nblks;
/*
* Determine space new attribute will use, and if it would be
* "local" or "remote" (note: local != inline).
*/
size = xfs_attr_leaf_newentsize(args, local);
nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK);
if (*local) {
if (size > (args->geo->blksize / 2)) {
/* Double split possible */
nblks *= 2;
}
} else {
/*
* Out of line attribute, cannot double split, but
* make room for the attribute value itself.
*/
uint dblocks = xfs_attr3_rmt_blocks(mp, args->valuelen);
nblks += dblocks;
nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK);
}
return nblks;
}
STATIC int
xfs_attr_try_sf_addname(
struct xfs_inode *dp,
struct xfs_da_args *args)
{
struct xfs_mount *mp = dp->i_mount;
int error, error2;
error = xfs_attr_shortform_addname(args);
if (error == -ENOSPC)
return error;
/*
* Commit the shortform mods, and we're done.
* NOTE: this is also the error path (EEXIST, etc).
*/
if (!error && !(args->op_flags & XFS_DA_OP_NOTIME))
xfs_trans_ichgtime(args->trans, dp, XFS_ICHGTIME_CHG);
if (mp->m_flags & XFS_MOUNT_WSYNC)
xfs_trans_set_sync(args->trans);
error2 = xfs_trans_commit(args->trans);
args->trans = NULL;
return error ? error : error2;
}
/*
* Set the attribute specified in @args.
*/
int
xfs_attr_set_args(
struct xfs_da_args *args)
{
struct xfs_inode *dp = args->dp;
struct xfs_buf *leaf_bp = NULL;
int error;
/*
* If the attribute list is non-existent or a shortform list,
* upgrade it to a single-leaf-block attribute list.
*/
if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL ||
(dp->i_afp->if_format == XFS_DINODE_FMT_EXTENTS &&
dp->i_afp->if_nextents == 0)) {
/*
* Build initial attribute list (if required).
*/
if (dp->i_afp->if_format == XFS_DINODE_FMT_EXTENTS)
xfs_attr_shortform_create(args);
/*
* Try to add the attr to the attribute list in the inode.
*/
error = xfs_attr_try_sf_addname(dp, args);
if (error != -ENOSPC)
return error;
/*
* It won't fit in the shortform, transform to a leaf block.
* GROT: another possible req'mt for a double-split btree op.
*/
error = xfs_attr_shortform_to_leaf(args, &leaf_bp);
if (error)
return error;
/*
* Prevent the leaf buffer from being unlocked so that a
* concurrent AIL push cannot grab the half-baked leaf
* buffer and run into problems with the write verifier.
* Once we're done rolling the transaction we can release
* the hold and add the attr to the leaf.
*/
xfs_trans_bhold(args->trans, leaf_bp);
error = xfs_defer_finish(&args->trans);
xfs_trans_bhold_release(args->trans, leaf_bp);
if (error) {
xfs_trans_brelse(args->trans, leaf_bp);
return error;
}
}
if (xfs_bmap_one_block(dp, XFS_ATTR_FORK))
error = xfs_attr_leaf_addname(args);
else
error = xfs_attr_node_addname(args);
return error;
}
/*
* Remove the attribute specified in @args.
*/
int
xfs_attr_remove_args(
struct xfs_da_args *args)
{
struct xfs_inode *dp = args->dp;
int error;
if (!xfs_inode_hasattr(dp)) {
error = -ENOATTR;
} else if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
ASSERT(dp->i_afp->if_flags & XFS_IFINLINE);
error = xfs_attr_shortform_remove(args);
} else if (xfs_bmap_one_block(dp, XFS_ATTR_FORK)) {
error = xfs_attr_leaf_removename(args);
} else {
error = xfs_attr_node_removename(args);
}
return error;
}
/*
* Note: If args->value is NULL the attribute will be removed, just like the
* Linux ->setattr API.
*/
int
xfs_attr_set(
struct xfs_da_args *args)
{
struct xfs_inode *dp = args->dp;
struct xfs_mount *mp = dp->i_mount;
struct xfs_trans_res tres;
bool rsvd = (args->attr_filter & XFS_ATTR_ROOT);
int error, local;
unsigned int total;
if (XFS_FORCED_SHUTDOWN(dp->i_mount))
return -EIO;
error = xfs_qm_dqattach(dp);
if (error)
return error;
args->geo = mp->m_attr_geo;
args->whichfork = XFS_ATTR_FORK;
args->hashval = xfs_da_hashname(args->name, args->namelen);
/*
* We have no control over the attribute names that userspace passes us
* to remove, so we have to allow the name lookup prior to attribute
* removal to fail as well.
*/
args->op_flags = XFS_DA_OP_OKNOENT;
if (args->value) {
XFS_STATS_INC(mp, xs_attr_set);
args->op_flags |= XFS_DA_OP_ADDNAME;
args->total = xfs_attr_calc_size(args, &local);
/*
* If the inode doesn't have an attribute fork, add one.
* (inode must not be locked when we call this routine)
*/
if (XFS_IFORK_Q(dp) == 0) {
int sf_size = sizeof(struct xfs_attr_sf_hdr) +
XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen,
args->valuelen);
error = xfs_bmap_add_attrfork(dp, sf_size, rsvd);
if (error)
return error;
}
tres.tr_logres = M_RES(mp)->tr_attrsetm.tr_logres +
M_RES(mp)->tr_attrsetrt.tr_logres *
args->total;
tres.tr_logcount = XFS_ATTRSET_LOG_COUNT;
tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
total = args->total;
} else {
XFS_STATS_INC(mp, xs_attr_remove);
tres = M_RES(mp)->tr_attrrm;
total = XFS_ATTRRM_SPACE_RES(mp);
}
/*
* Root fork attributes can use reserved data blocks for this
* operation if necessary
*/
error = xfs_trans_alloc(mp, &tres, total, 0,
rsvd ? XFS_TRANS_RESERVE : 0, &args->trans);
if (error)
return error;
xfs_ilock(dp, XFS_ILOCK_EXCL);
xfs_trans_ijoin(args->trans, dp, 0);
if (args->value) {
unsigned int quota_flags = XFS_QMOPT_RES_REGBLKS;
if (rsvd)
quota_flags |= XFS_QMOPT_FORCE_RES;
error = xfs_trans_reserve_quota_nblks(args->trans, dp,
args->total, 0, quota_flags);
if (error)
goto out_trans_cancel;
error = xfs_attr_set_args(args);
if (error)
goto out_trans_cancel;
/* shortform attribute has already been committed */
if (!args->trans)
goto out_unlock;
} else {
error = xfs_attr_remove_args(args);
if (error)
goto out_trans_cancel;
}
/*
* If this is a synchronous mount, make sure that the
* transaction goes to disk before returning to the user.
*/
if (mp->m_flags & XFS_MOUNT_WSYNC)
xfs_trans_set_sync(args->trans);
if (!(args->op_flags & XFS_DA_OP_NOTIME))
xfs_trans_ichgtime(args->trans, dp, XFS_ICHGTIME_CHG);
/*
* Commit the last in the sequence of transactions.
*/
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE);
error = xfs_trans_commit(args->trans);
out_unlock:
xfs_iunlock(dp, XFS_ILOCK_EXCL);
return error;
out_trans_cancel:
if (args->trans)
xfs_trans_cancel(args->trans);
goto out_unlock;
}
/*========================================================================
* External routines when attribute list is inside the inode
*========================================================================*/
/*
* Add a name to the shortform attribute list structure
* This is the external routine.
*/
STATIC int
xfs_attr_shortform_addname(xfs_da_args_t *args)
{
int newsize, forkoff, retval;
trace_xfs_attr_sf_addname(args);
retval = xfs_attr_shortform_lookup(args);
if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
return retval;
if (retval == -EEXIST) {
if (args->attr_flags & XATTR_CREATE)
return retval;
retval = xfs_attr_shortform_remove(args);
if (retval)
return retval;
/*
* Since we have removed the old attr, clear ATTR_REPLACE so
* that the leaf format add routine won't trip over the attr
* not being around.
*/
args->attr_flags &= ~XATTR_REPLACE;
}
if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX ||
args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX)
return -ENOSPC;
newsize = XFS_ATTR_SF_TOTSIZE(args->dp);
newsize += XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen);
forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize);
if (!forkoff)
return -ENOSPC;
xfs_attr_shortform_add(args, forkoff);
return 0;
}
/*========================================================================
* External routines when attribute list is one block
*========================================================================*/
/*
* Add a name to the leaf attribute list structure
*
* This leaf block cannot have a "remote" value, we only call this routine
* if bmap_one_block() says there is only one block (ie: no remote blks).
*/
STATIC int
xfs_attr_leaf_addname(
struct xfs_da_args *args)
{
struct xfs_inode *dp;
struct xfs_buf *bp;
int retval, error, forkoff;
trace_xfs_attr_leaf_addname(args);
/*
* Read the (only) block in the attribute list in.
*/
dp = args->dp;
args->blkno = 0;
error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp);
if (error)
return error;
/*
* Look up the given attribute in the leaf block. Figure out if
* the given flags produce an error or call for an atomic rename.
*/
retval = xfs_attr3_leaf_lookup_int(bp, args);
if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
goto out_brelse;
if (retval == -EEXIST) {
if (args->attr_flags & XATTR_CREATE)
goto out_brelse;
trace_xfs_attr_leaf_replace(args);
/* save the attribute state for later removal*/
args->op_flags |= XFS_DA_OP_RENAME; /* an atomic rename */
args->blkno2 = args->blkno; /* set 2nd entry info*/
args->index2 = args->index;
args->rmtblkno2 = args->rmtblkno;
args->rmtblkcnt2 = args->rmtblkcnt;
args->rmtvaluelen2 = args->rmtvaluelen;
/*
* clear the remote attr state now that it is saved so that the
* values reflect the state of the attribute we are about to
* add, not the attribute we just found and will remove later.
*/
args->rmtblkno = 0;
args->rmtblkcnt = 0;
args->rmtvaluelen = 0;
}
/*
* Add the attribute to the leaf block, transitioning to a Btree
* if required.
*/
retval = xfs_attr3_leaf_add(bp, args);
if (retval == -ENOSPC) {
/*
* Promote the attribute list to the Btree format, then
* Commit that transaction so that the node_addname() call
* can manage its own transactions.
*/
error = xfs_attr3_leaf_to_node(args);
if (error)
return error;
error = xfs_defer_finish(&args->trans);
if (error)
return error;
/*
* Commit the current trans (including the inode) and start
* a new one.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
return error;
/*
* Fob the whole rest of the problem off on the Btree code.
*/
error = xfs_attr_node_addname(args);
return error;
}
/*
* Commit the transaction that added the attr name so that
* later routines can manage their own transactions.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
return error;
/*
* If there was an out-of-line value, allocate the blocks we
* identified for its storage and copy the value. This is done
* after we create the attribute so that we don't overflow the
* maximum size of a transaction and/or hit a deadlock.
*/
if (args->rmtblkno > 0) {
error = xfs_attr_rmtval_set(args);
if (error)
return error;
}
/*
* If this is an atomic rename operation, we must "flip" the
* incomplete flags on the "new" and "old" attribute/value pairs
* so that one disappears and one appears atomically. Then we
* must remove the "old" attribute/value pair.
*/
if (args->op_flags & XFS_DA_OP_RENAME) {
/*
* In a separate transaction, set the incomplete flag on the
* "old" attr and clear the incomplete flag on the "new" attr.
*/
error = xfs_attr3_leaf_flipflags(args);
if (error)
return error;
/*
* Dismantle the "old" attribute/value pair by removing
* a "remote" value (if it exists).
*/
args->index = args->index2;
args->blkno = args->blkno2;
args->rmtblkno = args->rmtblkno2;
args->rmtblkcnt = args->rmtblkcnt2;
args->rmtvaluelen = args->rmtvaluelen2;
if (args->rmtblkno) {
error = xfs_attr_rmtval_remove(args);
if (error)
return error;
}
/*
* Read in the block containing the "old" attr, then
* remove the "old" attr from that block (neat, huh!)
*/
error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno,
&bp);
if (error)
return error;
xfs_attr3_leaf_remove(bp, args);
/*
* If the result is small enough, shrink it all into the inode.
*/
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */
if (error)
return error;
error = xfs_defer_finish(&args->trans);
if (error)
return error;
}
/*
* Commit the remove and start the next trans in series.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
} else if (args->rmtblkno > 0) {
/*
* Added a "remote" value, just clear the incomplete flag.
*/
error = xfs_attr3_leaf_clearflag(args);
}
return error;
out_brelse:
xfs_trans_brelse(args->trans, bp);
return retval;
}
/*
* Remove a name from the leaf attribute list structure
*
* This leaf block cannot have a "remote" value, we only call this routine
* if bmap_one_block() says there is only one block (ie: no remote blks).
*/
STATIC int
xfs_attr_leaf_removename(
struct xfs_da_args *args)
{
struct xfs_inode *dp;
struct xfs_buf *bp;
int error, forkoff;
trace_xfs_attr_leaf_removename(args);
/*
* Remove the attribute.
*/
dp = args->dp;
args->blkno = 0;
error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp);
if (error)
return error;
error = xfs_attr3_leaf_lookup_int(bp, args);
if (error == -ENOATTR) {
xfs_trans_brelse(args->trans, bp);
return error;
}
xfs_attr3_leaf_remove(bp, args);
/*
* If the result is small enough, shrink it all into the inode.
*/
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */
if (error)
return error;
error = xfs_defer_finish(&args->trans);
if (error)
return error;
}
return 0;
}
/*
* Look up a name in a leaf attribute list structure.
*
* This leaf block cannot have a "remote" value, we only call this routine
* if bmap_one_block() says there is only one block (ie: no remote blks).
*
* Returns 0 on successful retrieval, otherwise an error.
*/
STATIC int
xfs_attr_leaf_get(xfs_da_args_t *args)
{
struct xfs_buf *bp;
int error;
trace_xfs_attr_leaf_get(args);
args->blkno = 0;
error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp);
if (error)
return error;
error = xfs_attr3_leaf_lookup_int(bp, args);
if (error != -EEXIST) {
xfs_trans_brelse(args->trans, bp);
return error;
}
error = xfs_attr3_leaf_getvalue(bp, args);
xfs_trans_brelse(args->trans, bp);
return error;
}
/*========================================================================
* External routines when attribute list size > geo->blksize
*========================================================================*/
/*
* Add a name to a Btree-format attribute list.
*
* This will involve walking down the Btree, and may involve splitting
* leaf nodes and even splitting intermediate nodes up to and including
* the root node (a special case of an intermediate node).
*
* "Remote" attribute values confuse the issue and atomic rename operations
* add a whole extra layer of confusion on top of that.
*/
STATIC int
xfs_attr_node_addname(
struct xfs_da_args *args)
{
struct xfs_da_state *state;
struct xfs_da_state_blk *blk;
struct xfs_inode *dp;
struct xfs_mount *mp;
int retval, error;
trace_xfs_attr_node_addname(args);
/*
* Fill in bucket of arguments/results/context to carry around.
*/
dp = args->dp;
mp = dp->i_mount;
restart:
state = xfs_da_state_alloc();
state->args = args;
state->mp = mp;
/*
* Search to see if name already exists, and get back a pointer
* to where it should go.
*/
error = xfs_da3_node_lookup_int(state, &retval);
if (error)
goto out;
blk = &state->path.blk[ state->path.active-1 ];
ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
goto out;
if (retval == -EEXIST) {
if (args->attr_flags & XATTR_CREATE)
goto out;
trace_xfs_attr_node_replace(args);
/* save the attribute state for later removal*/
args->op_flags |= XFS_DA_OP_RENAME; /* atomic rename op */
args->blkno2 = args->blkno; /* set 2nd entry info*/
args->index2 = args->index;
args->rmtblkno2 = args->rmtblkno;
args->rmtblkcnt2 = args->rmtblkcnt;
args->rmtvaluelen2 = args->rmtvaluelen;
/*
* clear the remote attr state now that it is saved so that the
* values reflect the state of the attribute we are about to
* add, not the attribute we just found and will remove later.
*/
args->rmtblkno = 0;
args->rmtblkcnt = 0;
args->rmtvaluelen = 0;
}
retval = xfs_attr3_leaf_add(blk->bp, state->args);
if (retval == -ENOSPC) {
if (state->path.active == 1) {
/*
* Its really a single leaf node, but it had
* out-of-line values so it looked like it *might*
* have been a b-tree.
*/
xfs_da_state_free(state);
state = NULL;
error = xfs_attr3_leaf_to_node(args);
if (error)
goto out;
error = xfs_defer_finish(&args->trans);
if (error)
goto out;
/*
* Commit the node conversion and start the next
* trans in the chain.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;
goto restart;
}
/*
* Split as many Btree elements as required.
* This code tracks the new and old attr's location
* in the index/blkno/rmtblkno/rmtblkcnt fields and
* in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields.
*/
error = xfs_da3_split(state);
if (error)
goto out;
error = xfs_defer_finish(&args->trans);
if (error)
goto out;
} else {
/*
* Addition succeeded, update Btree hashvals.
*/
xfs_da3_fixhashpath(state, &state->path);
}
/*
* Kill the state structure, we're done with it and need to
* allow the buffers to come back later.
*/
xfs_da_state_free(state);
state = NULL;
/*
* Commit the leaf addition or btree split and start the next
* trans in the chain.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;
/*
* If there was an out-of-line value, allocate the blocks we
* identified for its storage and copy the value. This is done
* after we create the attribute so that we don't overflow the
* maximum size of a transaction and/or hit a deadlock.
*/
if (args->rmtblkno > 0) {
error = xfs_attr_rmtval_set(args);
if (error)
return error;
}
/*
* If this is an atomic rename operation, we must "flip" the
* incomplete flags on the "new" and "old" attribute/value pairs
* so that one disappears and one appears atomically. Then we
* must remove the "old" attribute/value pair.
*/
if (args->op_flags & XFS_DA_OP_RENAME) {
/*
* In a separate transaction, set the incomplete flag on the
* "old" attr and clear the incomplete flag on the "new" attr.
*/
error = xfs_attr3_leaf_flipflags(args);
if (error)
goto out;
/*
* Dismantle the "old" attribute/value pair by removing
* a "remote" value (if it exists).
*/
args->index = args->index2;
args->blkno = args->blkno2;
args->rmtblkno = args->rmtblkno2;
args->rmtblkcnt = args->rmtblkcnt2;
args->rmtvaluelen = args->rmtvaluelen2;
if (args->rmtblkno) {
error = xfs_attr_rmtval_remove(args);
if (error)
return error;
}
/*
* Re-find the "old" attribute entry after any split ops.
* The INCOMPLETE flag means that we will find the "old"
* attr, not the "new" one.
*/
args->attr_filter |= XFS_ATTR_INCOMPLETE;
state = xfs_da_state_alloc();
state->args = args;
state->mp = mp;
state->inleaf = 0;
error = xfs_da3_node_lookup_int(state, &retval);
if (error)
goto out;
/*
* Remove the name and update the hashvals in the tree.
*/
blk = &state->path.blk[ state->path.active-1 ];
ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
error = xfs_attr3_leaf_remove(blk->bp, args);
xfs_da3_fixhashpath(state, &state->path);
/*
* Check to see if the tree needs to be collapsed.
*/
if (retval && (state->path.active > 1)) {
error = xfs_da3_join(state);
if (error)
goto out;
error = xfs_defer_finish(&args->trans);
if (error)
goto out;
}
/*
* Commit and start the next trans in the chain.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;
} else if (args->rmtblkno > 0) {
/*
* Added a "remote" value, just clear the incomplete flag.
*/
error = xfs_attr3_leaf_clearflag(args);
if (error)
goto out;
}
retval = error = 0;
out:
if (state)
xfs_da_state_free(state);
if (error)
return error;
return retval;
}
/*
* Remove a name from a B-tree attribute list.
*
* This will involve walking down the Btree, and may involve joining
* leaf nodes and even joining intermediate nodes up to and including
* the root node (a special case of an intermediate node).
*/
STATIC int
xfs_attr_node_removename(
struct xfs_da_args *args)
{
struct xfs_da_state *state;
struct xfs_da_state_blk *blk;
struct xfs_inode *dp;
struct xfs_buf *bp;
int retval, error, forkoff;
trace_xfs_attr_node_removename(args);
/*
* Tie a string around our finger to remind us where we are.
*/
dp = args->dp;
state = xfs_da_state_alloc();
state->args = args;
state->mp = dp->i_mount;
/*
* Search to see if name exists, and get back a pointer to it.
*/
error = xfs_da3_node_lookup_int(state, &retval);
if (error || (retval != -EEXIST)) {
if (error == 0)
error = retval;
goto out;
}
/*
* If there is an out-of-line value, de-allocate the blocks.
* This is done before we remove the attribute so that we don't
* overflow the maximum size of a transaction and/or hit a deadlock.
*/
blk = &state->path.blk[ state->path.active-1 ];
ASSERT(blk->bp != NULL);
ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
if (args->rmtblkno > 0) {
/*
* Fill in disk block numbers in the state structure
* so that we can get the buffers back after we commit
* several transactions in the following calls.
*/
error = xfs_attr_fillstate(state);
if (error)
goto out;
/*
* Mark the attribute as INCOMPLETE, then bunmapi() the
* remote value.
*/
error = xfs_attr3_leaf_setflag(args);
if (error)
goto out;
error = xfs_attr_rmtval_remove(args);
if (error)
goto out;
/*
* Refill the state structure with buffers, the prior calls
* released our buffers.
*/
error = xfs_attr_refillstate(state);
if (error)
goto out;
}
/*
* Remove the name and update the hashvals in the tree.
*/
blk = &state->path.blk[ state->path.active-1 ];
ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
retval = xfs_attr3_leaf_remove(blk->bp, args);
xfs_da3_fixhashpath(state, &state->path);
/*
* Check to see if the tree needs to be collapsed.
*/
if (retval && (state->path.active > 1)) {
error = xfs_da3_join(state);
if (error)
goto out;
error = xfs_defer_finish(&args->trans);
if (error)
goto out;
/*
* Commit the Btree join operation and start a new trans.
*/
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;
}
/*
* If the result is small enough, push it all into the inode.
*/
if (xfs_bmap_one_block(dp, XFS_ATTR_FORK)) {
/*
* Have to get rid of the copy of this dabuf in the state.
*/
ASSERT(state->path.active == 1);
ASSERT(state->path.blk[0].bp);
state->path.blk[0].bp = NULL;
error = xfs_attr3_leaf_read(args->trans, args->dp, 0, &bp);
if (error)
goto out;
if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */
if (error)
goto out;
error = xfs_defer_finish(&args->trans);
if (error)
goto out;
} else
xfs_trans_brelse(args->trans, bp);
}
error = 0;
out:
xfs_da_state_free(state);
return error;
}
/*
* Fill in the disk block numbers in the state structure for the buffers
* that are attached to the state structure.
* This is done so that we can quickly reattach ourselves to those buffers
* after some set of transaction commits have released these buffers.
*/
STATIC int
xfs_attr_fillstate(xfs_da_state_t *state)
{
xfs_da_state_path_t *path;
xfs_da_state_blk_t *blk;
int level;
trace_xfs_attr_fillstate(state->args);
/*
* Roll down the "path" in the state structure, storing the on-disk
* block number for those buffers in the "path".
*/
path = &state->path;
ASSERT((path->active >= 0) && (path->active < XFS_DA_NODE_MAXDEPTH));
for (blk = path->blk, level = 0; level < path->active; blk++, level++) {
if (blk->bp) {
blk->disk_blkno = XFS_BUF_ADDR(blk->bp);
blk->bp = NULL;
} else {
blk->disk_blkno = 0;
}
}
/*
* Roll down the "altpath" in the state structure, storing the on-disk
* block number for those buffers in the "altpath".
*/
path = &state->altpath;
ASSERT((path->active >= 0) && (path->active < XFS_DA_NODE_MAXDEPTH));
for (blk = path->blk, level = 0; level < path->active; blk++, level++) {
if (blk->bp) {
blk->disk_blkno = XFS_BUF_ADDR(blk->bp);
blk->bp = NULL;
} else {
blk->disk_blkno = 0;
}
}
return 0;
}
/*
* Reattach the buffers to the state structure based on the disk block
* numbers stored in the state structure.
* This is done after some set of transaction commits have released those
* buffers from our grip.
*/
STATIC int
xfs_attr_refillstate(xfs_da_state_t *state)
{
xfs_da_state_path_t *path;
xfs_da_state_blk_t *blk;
int level, error;
trace_xfs_attr_refillstate(state->args);
/*
* Roll down the "path" in the state structure, storing the on-disk
* block number for those buffers in the "path".
*/
path = &state->path;
ASSERT((path->active >= 0) && (path->active < XFS_DA_NODE_MAXDEPTH));
for (blk = path->blk, level = 0; level < path->active; blk++, level++) {
if (blk->disk_blkno) {
error = xfs_da3_node_read_mapped(state->args->trans,
state->args->dp, blk->disk_blkno,
&blk->bp, XFS_ATTR_FORK);
if (error)
return error;
} else {
blk->bp = NULL;
}
}
/*
* Roll down the "altpath" in the state structure, storing the on-disk
* block number for those buffers in the "altpath".
*/
path = &state->altpath;
ASSERT((path->active >= 0) && (path->active < XFS_DA_NODE_MAXDEPTH));
for (blk = path->blk, level = 0; level < path->active; blk++, level++) {
if (blk->disk_blkno) {
error = xfs_da3_node_read_mapped(state->args->trans,
state->args->dp, blk->disk_blkno,
&blk->bp, XFS_ATTR_FORK);
if (error)
return error;
} else {
blk->bp = NULL;
}
}
return 0;
}
/*
* Retrieve the attribute data from a node attribute list.
*
* This routine gets called for any attribute fork that has more than one
* block, ie: both true Btree attr lists and for single-leaf-blocks with
* "remote" values taking up more blocks.
*
* Returns 0 on successful retrieval, otherwise an error.
*/
STATIC int
xfs_attr_node_get(xfs_da_args_t *args)
{
xfs_da_state_t *state;
xfs_da_state_blk_t *blk;
int error, retval;
int i;
trace_xfs_attr_node_get(args);
state = xfs_da_state_alloc();
state->args = args;
state->mp = args->dp->i_mount;
/*
* Search to see if name exists, and get back a pointer to it.
*/
error = xfs_da3_node_lookup_int(state, &retval);
if (error) {
retval = error;
goto out_release;
}
if (retval != -EEXIST)
goto out_release;
/*
* Get the value, local or "remote"
*/
blk = &state->path.blk[state->path.active - 1];
retval = xfs_attr3_leaf_getvalue(blk->bp, args);
/*
* If not in a transaction, we have to release all the buffers.
*/
out_release:
for (i = 0; i < state->path.active; i++) {
xfs_trans_brelse(args->trans, state->path.blk[i].bp);
state->path.blk[i].bp = NULL;
}
xfs_da_state_free(state);
return retval;
}
/* Returns true if the attribute entry name is valid. */
bool
xfs_attr_namecheck(
const void *name,
size_t length)
{
/*
* MAXNAMELEN includes the trailing null, but (name/length) leave it
* out, so use >= for the length check.
*/
if (length >= MAXNAMELEN)
return false;
/* There shouldn't be any nulls here */
return !memchr(name, 0, length);
}
| {
"pile_set_name": "Github"
} |
{% set name = "cansnper" %}
{% set version = "1.0.10" %}
package:
name: {{ name|lower }}
version: {{ version }}
build:
number: 1
script: python -m pip install --no-deps --ignore-installed .
noarch: python
source:
url: https://github.com/adrlar/CanSNPer/archive/{{ version }}.tar.gz
sha256: a7a14315fa6ad55e143e90a6b918c389f63ef48b8abac59a62ac85d2c4e3bbb1
requirements:
host:
- python <3
- pip
run:
- python <3
- ete2
- numpy
- pyqt 4.*
- progressivemauve # [not osx]
test:
commands:
- CanSNPer --help
about:
home: https://github.com/adrlar/CanSNPer/
license: GPLv3
license_file: LICENSE
summary: 'A hierarchical genotype classifier of clonal pathogens.'
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>OCP Certificate Expiry Report</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700" rel="stylesheet" />
<style type="text/css">
body {
font-family: 'Source Sans Pro', sans-serif;
margin-left: 50px;
margin-right: 50px;
margin-bottom: 20px;
padding-top: 70px;
}
table {
border-collapse: collapse;
margin-bottom: 20px;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 5px;
}
.cert-kind {
margin-top: 5px;
margin-bottom: 5px;
}
footer {
font-size: small;
text-align: center;
}
tr.odd {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">OCP Certificate Expiry Report</a>
</div>
<div class="collapse navbar-collapse">
<p class="navbar-text navbar-right">
<button>
<a href="https://docs.openshift.com/container-platform/latest/install_config/redeploying_certificates.html"
target="_blank"
class="navbar-link">
<i class="glyphicon glyphicon-book"></i> Redeploying Certificates
</a>
</button>
<button>
<a href="https://github.com/openshift/openshift-ansible/tree/master/roles/openshift_certificate_expiry"
target="_blank"
class="navbar-link">
<i class="glyphicon glyphicon-book"></i> Expiry Role Documentation
</a>
</button>
</p>
</div>
</div>
</nav>
<h1>m01.example.com</h1>
<p>
Checked 12 total certificates. Expired/Warning/OK: 0/10/2. Warning window: 1500 days
</p>
<ul>
<li><b>Expirations checked at:</b> 2017-01-17 10:36:25.230920</li>
<li><b>Warn after date:</b> 2021-02-25 10:36:25.230920</li>
</ul>
<table border="1" width="100%">
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">ocp_certs</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">CN:172.30.0.1, DNS:kubernetes, DNS:kubernetes.default, DNS:kubernetes.default.svc, DNS:kubernetes.default.svc.cluster.local, DNS:m01.example.com, DNS:openshift, DNS:openshift.default, DNS:openshift.default.svc, DNS:openshift.default.svc.cluster.local, DNS:172.30.0.1, DNS:192.168.124.148, IP Address:172.30.0.1, IP Address:192.168.124.148</td>
<td><code>int(4)/hex(0x4)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:00:02</td>
<td>/etc/origin/master/master.server.crt</td>
</tr>
<tr class="even">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">CN:192.168.124.148, DNS:m01.example.com, DNS:192.168.124.148, IP Address:192.168.124.148</td>
<td><code>int(12)/hex(0xc)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:03:29</td>
<td>/etc/origin/node/server.crt</td>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-ok"></i></td>
<td style="width:33%">CN:openshift-signer@1483981200</td>
<td><code>int(1)/hex(0x1)</code></td>
<td>ok</td>
<td>1817</td>
<td>2022-01-08 17:00:01</td>
<td>/etc/origin/master/ca.crt</td>
</tr>
<tr class="even">
<td style="text-align:center"><i class="glyphicon glyphicon-ok"></i></td>
<td style="width:33%">CN:openshift-signer@1483981200</td>
<td><code>int(1)/hex(0x1)</code></td>
<td>ok</td>
<td>1817</td>
<td>2022-01-08 17:00:01</td>
<td>/etc/origin/node/ca.crt</td>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">etcd</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">CN:172.30.0.1, DNS:kubernetes, DNS:kubernetes.default, DNS:kubernetes.default.svc, DNS:kubernetes.default.svc.cluster.local, DNS:m01.example.com, DNS:openshift, DNS:openshift.default, DNS:openshift.default.svc, DNS:openshift.default.svc.cluster.local, DNS:172.30.0.1, DNS:192.168.124.148, IP Address:172.30.0.1, IP Address:192.168.124.148</td>
<td><code>int(7)/hex(0x7)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:00:03</td>
<td>/etc/origin/master/etcd.server.crt</td>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">kubeconfigs</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">O:system:nodes, CN:system:node:m01.example.com</td>
<td><code>int(11)/hex(0xb)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:03:28</td>
<td>/etc/origin/node/system:node:m01.example.com.kubeconfig</td>
</tr>
<tr class="even">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">O:system:cluster-admins, CN:system:admin</td>
<td><code>int(8)/hex(0x8)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:00:03</td>
<td>/etc/origin/master/admin.kubeconfig</td>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">O:system:masters, CN:system:openshift-master</td>
<td><code>int(3)/hex(0x3)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:00:02</td>
<td>/etc/origin/master/openshift-master.kubeconfig</td>
</tr>
<tr class="even">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">O:system:routers, CN:system:openshift-router</td>
<td><code>int(9)/hex(0x9)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:00:03</td>
<td>/etc/origin/master/openshift-router.kubeconfig</td>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">O:system:registries, CN:system:openshift-registry</td>
<td><code>int(10)/hex(0xa)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:00:03</td>
<td>/etc/origin/master/openshift-registry.kubeconfig</td>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">router</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">CN:router.default.svc, DNS:router.default.svc, DNS:router.default.svc.cluster.local</td>
<td><code>int(5050662940948454653)/hex(0x46178f2f6b765cfd)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:05:46</td>
<td>/api/v1/namespaces/default/secrets/router-certs</td>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">registry</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">CN:172.30.242.251, DNS:docker-registry-default.router.default.svc.cluster.local, DNS:docker-registry.default.svc.cluster.local, DNS:172.30.242.251, IP Address:172.30.242.251</td>
<td><code>int(13)/hex(0xd)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:05:54</td>
<td>/api/v1/namespaces/default/secrets/registry-certificates</td>
</tr>
</table>
<hr />
<h1>n01.example.com</h1>
<p>
Checked 3 total certificates. Expired/Warning/OK: 0/2/1. Warning window: 1500 days
</p>
<ul>
<li><b>Expirations checked at:</b> 2017-01-17 10:36:25.217103</li>
<li><b>Warn after date:</b> 2021-02-25 10:36:25.217103</li>
</ul>
<table border="1" width="100%">
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">ocp_certs</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">CN:192.168.124.11, DNS:n01.example.com, DNS:192.168.124.11, IP Address:192.168.124.11</td>
<td><code>int(12)/hex(0xc)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:03:29</td>
<td>/etc/origin/node/server.crt</td>
</tr>
<tr class="even">
<td style="text-align:center"><i class="glyphicon glyphicon-ok"></i></td>
<td style="width:33%">CN:openshift-signer@1483981200</td>
<td><code>int(1)/hex(0x1)</code></td>
<td>ok</td>
<td>1817</td>
<td>2022-01-08 17:00:01</td>
<td>/etc/origin/node/ca.crt</td>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">etcd</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">kubeconfigs</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr class="odd">
<td style="text-align:center"><i class="glyphicon glyphicon-alert"></i></td>
<td style="width:33%">O:system:nodes, CN:system:node:n01.example.com</td>
<td><code>int(11)/hex(0xb)</code></td>
<td>warning</td>
<td>722</td>
<td>2019-01-09 17:03:28</td>
<td>/etc/origin/node/system:node:n01.example.com.kubeconfig</td>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">router</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
<tr>
<th colspan="7" style="text-align:center"><h2 class="cert-kind">registry</h2></th>
</tr>
<tr>
<th> </th>
<th style="width:33%">Certificate Common/Alt Name(s)</th>
<td>Serial</th>
<th>Health</th>
<th>Days Remaining</th>
<th>Expiration Date</th>
<th>Path</th>
</tr>
</table>
<hr />
<footer>
<p>
Expiration report generated by
the <a href="https://github.com/openshift/openshift-ansible"
target="_blank">openshift-ansible</a>
<a href="https://github.com/openshift/openshift-ansible/tree/master/roles/openshift_certificate_expiry"
target="_blank">certificate expiry</a> role.
</p>
<p>
Status icons from bootstrap/glyphicon
</p>
</footer>
</body>
</html>
| {
"pile_set_name": "Github"
} |
-----------
# PersistentVolumeList v1
Group | Version | Kind
------------ | ---------- | -----------
Core | v1 | PersistentVolumeList
PersistentVolumeList is a list of PersistentVolume items.
Field | Description
------------ | -----------
items <br /> *[PersistentVolume](#persistentvolume-v1) array* | List of persistent volumes. More info: http://kubernetes.io/docs/user-guide/persistent-volumes
metadata <br /> *[ListMeta](#listmeta-unversioned)* | Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
| {
"pile_set_name": "Github"
} |
//logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad: function () {
this.setData({
logs: (qq.getStorageSync('logs') || []).map(log => {
return util.formatTime(new Date(log))
})
})
}
})
| {
"pile_set_name": "Github"
} |
(module DIP08 (layer F.Cu) (tedit 200000)
(descr "DUAL IN LINE PACKAGE")
(tags "DUAL IN LINE PACKAGE")
(attr virtual)
(fp_text reference >NAME (at -5.715 0 90) (layer F.SilkS)
(effects (font (size 0.6096 0.6096) (thickness 0.127)))
)
(fp_text value >VALUE (at 5.842 0 90) (layer F.SilkS)
(effects (font (size 0.6096 0.6096) (thickness 0.127)))
)
(fp_line (start 5.08 -2.54) (end -5.08 -2.54) (layer F.SilkS) (width 0.2032))
(fp_line (start -5.08 2.54) (end 5.08 2.54) (layer F.SilkS) (width 0.2032))
(fp_line (start 5.08 -2.54) (end 5.08 2.54) (layer F.SilkS) (width 0.2032))
(fp_line (start -5.08 -2.54) (end -5.08 -1.016) (layer F.SilkS) (width 0.2032))
(fp_line (start -5.08 2.54) (end -5.08 1.016) (layer F.SilkS) (width 0.2032))
(fp_line (start -6.18998 3.175) (end -6.17728 3.06832) (layer F.SilkS) (width 0.127))
(fp_line (start -6.17728 3.06832) (end -6.14172 2.96672) (layer F.SilkS) (width 0.127))
(fp_line (start -6.14172 2.96672) (end -6.08584 2.87782) (layer F.SilkS) (width 0.127))
(fp_line (start -6.08584 2.87782) (end -6.00964 2.80162) (layer F.SilkS) (width 0.127))
(fp_line (start -6.00964 2.80162) (end -5.92074 2.74574) (layer F.SilkS) (width 0.127))
(fp_line (start -5.92074 2.74574) (end -5.81914 2.71018) (layer F.SilkS) (width 0.127))
(fp_line (start -5.81914 2.71018) (end -5.715 2.69748) (layer F.SilkS) (width 0.127))
(fp_line (start -5.715 2.69748) (end -5.60832 2.71018) (layer F.SilkS) (width 0.127))
(fp_line (start -5.60832 2.71018) (end -5.50672 2.74574) (layer F.SilkS) (width 0.127))
(fp_line (start -5.50672 2.74574) (end -5.41782 2.80162) (layer F.SilkS) (width 0.127))
(fp_line (start -5.41782 2.80162) (end -5.34162 2.87782) (layer F.SilkS) (width 0.127))
(fp_line (start -5.34162 2.87782) (end -5.28574 2.96672) (layer F.SilkS) (width 0.127))
(fp_line (start -5.28574 2.96672) (end -5.25018 3.06832) (layer F.SilkS) (width 0.127))
(fp_line (start -5.25018 3.06832) (end -5.23748 3.175) (layer F.SilkS) (width 0.127))
(fp_line (start -5.23748 3.175) (end -5.25018 3.27914) (layer F.SilkS) (width 0.127))
(fp_line (start -5.25018 3.27914) (end -5.28574 3.38074) (layer F.SilkS) (width 0.127))
(fp_line (start -5.28574 3.38074) (end -5.34162 3.46964) (layer F.SilkS) (width 0.127))
(fp_line (start -5.34162 3.46964) (end -5.41782 3.54584) (layer F.SilkS) (width 0.127))
(fp_line (start -5.41782 3.54584) (end -5.50672 3.60172) (layer F.SilkS) (width 0.127))
(fp_line (start -5.50672 3.60172) (end -5.60832 3.63728) (layer F.SilkS) (width 0.127))
(fp_line (start -5.60832 3.63728) (end -5.715 3.64998) (layer F.SilkS) (width 0.127))
(fp_line (start -5.715 3.64998) (end -5.81914 3.63728) (layer F.SilkS) (width 0.127))
(fp_line (start -5.81914 3.63728) (end -5.92074 3.60172) (layer F.SilkS) (width 0.127))
(fp_line (start -5.92074 3.60172) (end -6.00964 3.54584) (layer F.SilkS) (width 0.127))
(fp_line (start -6.00964 3.54584) (end -6.08584 3.46964) (layer F.SilkS) (width 0.127))
(fp_line (start -6.08584 3.46964) (end -6.14172 3.38074) (layer F.SilkS) (width 0.127))
(fp_line (start -6.14172 3.38074) (end -6.17728 3.27914) (layer F.SilkS) (width 0.127))
(fp_line (start -6.17728 3.27914) (end -6.18998 3.175) (layer F.SilkS) (width 0.127))
(fp_arc (start -5.08 0) (end -5.08 -1.016) (angle 180) (layer F.SilkS) (width 0.2032))
(pad 1 thru_hole circle (at -3.81 3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 2 thru_hole circle (at -1.27 3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 3 thru_hole circle (at 1.27 3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 4 thru_hole circle (at 3.81 3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 5 thru_hole circle (at 3.81 -3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 6 thru_hole circle (at 1.27 -3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 7 thru_hole circle (at -1.27 -3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
(pad 8 thru_hole circle (at -3.81 -3.81) (size 1.6256 1.6256) (drill 0.8128) (layers *.Cu *.Mask)
(solder_mask_margin 0.1016))
)
| {
"pile_set_name": "Github"
} |
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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.
*/
#define _BSD_SOURCE
#include <stdarg.h>
#include <stdlib.h>
#include <sys/time.h>
#include "jerry-core/include/jerryscript-port.h"
#include "mbed-hal/us_ticker_api.h"
/**
* Provide log message implementation for the engine.
*/
void
jerry_port_log (jerry_log_level_t level, /**< log level */
const char *format, /**< format string */
...) /**< parameters */
{
(void) level; /* ignore log level */
va_list args;
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
} /* jerry_port_log */
/**
* Implementation of jerry_port_fatal.
*/
void
jerry_port_fatal (jerry_fatal_code_t code) /**< fatal code enum item */
{
exit (code);
} /* jerry_port_fatal */
/**
* Implementation of jerry_port_get_time_zone.
*
* @return true - if success
*/
bool
jerry_port_get_time_zone (jerry_time_zone_t *tz_p) /**< timezone pointer */
{
tz_p->offset = 0;
tz_p->daylight_saving_time = 0;
return true;
} /* jerry_port_get_time_zone */
/**
* Implementation of jerry_port_get_current_time.
*
* @return current timer's counter value in milliseconds
*/
double
jerry_port_get_current_time (void)
{
/* Note: if the target has its own RTC, this value should be extended by the
* RTC's one. */
return (double) us_ticker_read () / 1000;
} /* jerry_port_get_current_time */
| {
"pile_set_name": "Github"
} |
import bokeh.plotting
import pandas as pd
import numpy as np
import warnings
import time
# Local imorts
from . import exchange, helpers
class backtest():
"""An object representing a backtesting simulation."""
def __init__(self, data):
"""Initate the backtest.
:param data: An HLOCV+ pandas dataframe with a datetime index
:type data: pandas.DataFrame
:return: A bactesting simulation
:rtype: backtest
"""
if not isinstance(data, pd.DataFrame):
raise ValueError("Data must be a pandas dataframe")
missing = set(['high', 'low', 'open', 'close', 'volume'])-set(data.columns)
if len(missing) > 0:
msg = "Missing {0} column(s), dataframe must be HLOCV+".format(list(missing))
warnings.warn(msg)
self.data = data
def start(self, initial_capital, logic):
"""Start backtest.
:param initial_capital: Starting capital to fund account
:type initial_capital: float
:param logic: A function that will be applied to each lookback period of the data
:type logic: function
:return: A bactesting simulation
:rtype: backtest
"""
self.tracker = []
self.account = exchange.account(initial_capital)
# Enter backtest ---------------------------------------------
for index, today in self.data.iterrows():
date = today['date']
equity = self.account.total_value(today['close'])
# Handle stop loss
for p in self.account.positions:
if p.type == "long":
if p.stop_hit(today['low']):
self.account.close_position(p, 1.0, today['low'])
if p.type == "short":
if p.stop_hit(today['high']):
self.account.close_position(p, 1.0, today['high'])
self.account.purge_positions()
# Update account variables
self.account.date = date
self.account.equity.append(equity)
# Equity tracking
self.tracker.append({'date': date,
'benchmark_equity' : today['close'],
'strategy_equity' : equity})
# Execute trading logic
lookback = self.data[0:index+1]
logic(self.account, lookback)
# Cleanup empty positions
self.account.purge_positions()
# ------------------------------------------------------------
# For pyfolio
df = pd.DataFrame(self.tracker)
df['benchmark_return'] = (df.benchmark_equity-df.benchmark_equity.shift(1))/df.benchmark_equity.shift(1)
df['strategy_return'] = (df.strategy_equity-df.strategy_equity.shift(1))/df.strategy_equity.shift(1)
df.index = df['date']
del df['date']
return df
def results(self):
"""Print results"""
print("-------------- Results ----------------\n")
being_price = self.data.iloc[0]['open']
final_price = self.data.iloc[-1]['close']
pc = helpers.percent_change(being_price, final_price)
print("Buy and Hold : {0}%".format(round(pc*100, 2)))
print("Net Profit : {0}".format(round(helpers.profit(self.account.initial_capital, pc), 2)))
pc = helpers.percent_change(self.account.initial_capital, self.account.total_value(final_price))
print("Strategy : {0}%".format(round(pc*100, 2)))
print("Net Profit : {0}".format(round(helpers.profit(self.account.initial_capital, pc), 2)))
longs = len([t for t in self.account.opened_trades if t.type == 'long'])
sells = len([t for t in self.account.closed_trades if t.type == 'long'])
shorts = len([t for t in self.account.opened_trades if t.type == 'short'])
covers = len([t for t in self.account.closed_trades if t.type == 'short'])
print("Longs : {0}".format(longs))
print("Sells : {0}".format(sells))
print("Shorts : {0}".format(shorts))
print("Covers : {0}".format(covers))
print("--------------------")
print("Total Trades : {0}".format(longs + sells + shorts + covers))
print("\n---------------------------------------")
def chart(self, show_trades=False, title="Equity Curve"):
"""Chart results.
:param show_trades: Show trades on plot
:type show_trades: bool
:param title: Plot title
:type title: str
"""
bokeh.plotting.output_file("chart.html", title=title)
p = bokeh.plotting.figure(x_axis_type="datetime", plot_width=1000, plot_height=400, title=title)
p.grid.grid_line_alpha = 0.3
p.xaxis.axis_label = 'Date'
p.yaxis.axis_label = 'Equity'
shares = self.account.initial_capital/self.data.iloc[0]['open']
base_equity = [price*shares for price in self.data['open']]
p.line(self.data['date'], base_equity, color='#CAD8DE', legend='Buy and Hold')
p.line(self.data['date'], self.account.equity, color='#49516F', legend='Strategy')
p.legend.location = "top_left"
if show_trades:
for trade in self.account.opened_trades:
try:
x = time.mktime(trade.date.timetuple())*1000
y = self.account.equity[np.where(self.data['date'] == trade.date.strftime("%Y-%m-%d"))[0][0]]
if trade.type == 'long': p.circle(x, y, size=6, color='green', alpha=0.5)
elif trade.type == 'short': p.circle(x, y, size=6, color='red', alpha=0.5)
except:
pass
for trade in self.account.closed_trades:
try:
x = time.mktime(trade.date.timetuple())*1000
y = self.account.equity[np.where(self.data['date'] == trade.date.strftime("%Y-%m-%d"))[0][0]]
if trade.type == 'long': p.circle(x, y, size=6, color='blue', alpha=0.5)
elif trade.type == 'short': p.circle(x, y, size=6, color='orange', alpha=0.5)
except:
pass
bokeh.plotting.show(p)
| {
"pile_set_name": "Github"
} |
[net]
batch=2
channels=3
height=4
width=5
# Upsample is a nearest neighbor resize
[upsample]
stride=2
| {
"pile_set_name": "Github"
} |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.Ml.Projects.Predict
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <[email protected]>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Performs prediction on the data in the request. Cloud ML Engine
-- implements a custom \`predict\` verb on top of an HTTP POST method.
--
-- For details of the request and response format, see the **guide to the
-- [predict request format](\/ml-engine\/docs\/v1\/predict-request)**.
--
-- /See:/ <https://cloud.google.com/ml/ Cloud Machine Learning Engine Reference> for @ml.projects.predict@.
module Network.Google.Resource.Ml.Projects.Predict
(
-- * REST Resource
ProjectsPredictResource
-- * Creating a Request
, projectsPredict
, ProjectsPredict
-- * Request Lenses
, ppXgafv
, ppUploadProtocol
, ppAccessToken
, ppUploadType
, ppPayload
, ppName
, ppCallback
) where
import Network.Google.MachineLearning.Types
import Network.Google.Prelude
-- | A resource alias for @ml.projects.predict@ method which the
-- 'ProjectsPredict' request conforms to.
type ProjectsPredictResource =
"v1" :>
CaptureMode "name" "predict" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] GoogleCloudMlV1__PredictRequest :>
Post '[JSON] GoogleAPI__HTTPBody
-- | Performs prediction on the data in the request. Cloud ML Engine
-- implements a custom \`predict\` verb on top of an HTTP POST method.
--
-- For details of the request and response format, see the **guide to the
-- [predict request format](\/ml-engine\/docs\/v1\/predict-request)**.
--
-- /See:/ 'projectsPredict' smart constructor.
data ProjectsPredict =
ProjectsPredict'
{ _ppXgafv :: !(Maybe Xgafv)
, _ppUploadProtocol :: !(Maybe Text)
, _ppAccessToken :: !(Maybe Text)
, _ppUploadType :: !(Maybe Text)
, _ppPayload :: !GoogleCloudMlV1__PredictRequest
, _ppName :: !Text
, _ppCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'ProjectsPredict' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ppXgafv'
--
-- * 'ppUploadProtocol'
--
-- * 'ppAccessToken'
--
-- * 'ppUploadType'
--
-- * 'ppPayload'
--
-- * 'ppName'
--
-- * 'ppCallback'
projectsPredict
:: GoogleCloudMlV1__PredictRequest -- ^ 'ppPayload'
-> Text -- ^ 'ppName'
-> ProjectsPredict
projectsPredict pPpPayload_ pPpName_ =
ProjectsPredict'
{ _ppXgafv = Nothing
, _ppUploadProtocol = Nothing
, _ppAccessToken = Nothing
, _ppUploadType = Nothing
, _ppPayload = pPpPayload_
, _ppName = pPpName_
, _ppCallback = Nothing
}
-- | V1 error format.
ppXgafv :: Lens' ProjectsPredict (Maybe Xgafv)
ppXgafv = lens _ppXgafv (\ s a -> s{_ppXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ppUploadProtocol :: Lens' ProjectsPredict (Maybe Text)
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
-- | OAuth access token.
ppAccessToken :: Lens' ProjectsPredict (Maybe Text)
ppAccessToken
= lens _ppAccessToken
(\ s a -> s{_ppAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
ppUploadType :: Lens' ProjectsPredict (Maybe Text)
ppUploadType
= lens _ppUploadType (\ s a -> s{_ppUploadType = a})
-- | Multipart request metadata.
ppPayload :: Lens' ProjectsPredict GoogleCloudMlV1__PredictRequest
ppPayload
= lens _ppPayload (\ s a -> s{_ppPayload = a})
-- | Required. The resource name of a model or a version. Authorization:
-- requires the \`predict\` permission on the specified resource.
ppName :: Lens' ProjectsPredict Text
ppName = lens _ppName (\ s a -> s{_ppName = a})
-- | JSONP
ppCallback :: Lens' ProjectsPredict (Maybe Text)
ppCallback
= lens _ppCallback (\ s a -> s{_ppCallback = a})
instance GoogleRequest ProjectsPredict where
type Rs ProjectsPredict = GoogleAPI__HTTPBody
type Scopes ProjectsPredict =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsPredict'{..}
= go _ppName _ppXgafv _ppUploadProtocol
_ppAccessToken
_ppUploadType
_ppCallback
(Just AltJSON)
_ppPayload
machineLearningService
where go
= buildClient
(Proxy :: Proxy ProjectsPredictResource)
mempty
| {
"pile_set_name": "Github"
} |
<style type="text/css">
.test{
margin: 20px 20px 20px 20px;
}
.test Button{
margin-bottom: 10px;
}
</style>
<template>
<div class="test">
<Button type="warning" @click="click()">test</Button>
<Button type="warning" @click="click2()">测试</Button>
<Input v-model="value" type="textarea" :rows="4" placeholder="Enter something..."></Input>
</div>
</template>
<script>
export default {
data(){
return {
value: null
}
},
methods: {
click(){
this.$store.dispatch('userLogin',{"user_name":"test1","user_password":"123","router":this.$router});
this.$router.push({ path: 'base' })
},
click2(){
this.axios({
/*headers: {'Authorization': 'bearer '+this.$store.state.users.currentUser.UserToken},*/
method: 'post',
url: '/test',
data: {
"test": "123456"
}
}).then(function(response){
/*console.log(response);*/
this.value = response.data;
}.bind(this)).catch(function(error){
console.log(error);
});
}
}
};
</script> | {
"pile_set_name": "Github"
} |
--TEST--
Bug #20539 (PHP CLI Segmentation Fault)
--SKIPIF--
<?php if (!extension_loaded("session")) die("skip session extension not available"); ?>
<?php unlink(__DIR__. '/sess_' .session_id()); ?>
--INI--
session.auto_start=1
session.save_handler=files
session.save_path=./tests/basic/
--FILE--
<?php
print "good :)\n";
$filename = __DIR__ . '/sess_' . session_id();
var_dump(file_exists($filename));
@unlink($filename);
?>
--EXPECT--
good :)
bool(true)
| {
"pile_set_name": "Github"
} |
/*
* $Id: Rups.java 4031 2009-07-23 11:09:59Z blowagie $
*
* Copyright 2007 Bruno Lowagie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.lowagie.rups;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import com.lowagie.rups.controller.RupsController;
/**
* iText RUPS is a tool that allows you to inspect the internal structure
* of a PDF file.
*/
public class Rups {
// main method
/**
* Main method. Starts the RUPS application.
* @param args no arguments needed
*/
public static void main(String[] args) {
startApplication();
}
// methods
/**
* Initializes the main components of the Rups application.
*/
public static void startApplication() {
// creates a JFrame
JFrame frame = new JFrame();
// defines the size and location
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize((int)(screen.getWidth() * .90), (int)(screen.getHeight() * .90));
frame.setLocation((int)(screen.getWidth() * .05), (int)(screen.getHeight() * .05));
frame.setResizable(true);
// title bar
frame.setTitle("iText RUPS");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// the content
RupsController controller = new RupsController(frame.getSize());
frame.setJMenuBar(controller.getMenuBar());
frame.getContentPane().add(controller.getMasterComponent(), java.awt.BorderLayout.CENTER);
frame.setVisible(true);
}
// other member variables
/** Serial Version UID. */
private static final long serialVersionUID = 4386633640535735848L;
} | {
"pile_set_name": "Github"
} |
--TEST--
"macro" tag
--TEMPLATE--
{% block foo %}
{%- from _self import input as linput %}
{% block bar %}
{{- linput('username') }}
{% endblock %}
{% endblock %}
{% macro input(name) -%}
<input name="{{ name }}">
{% endmacro %}
--DATA--
return []
--EXCEPTION--
Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 6.
| {
"pile_set_name": "Github"
} |
gcr.io/google_containers/etcd:2.0.9.1
| {
"pile_set_name": "Github"
} |
# Parameters for supervisor, a process manager that can be used to run the factorization.
supervisor:
remote_conf: supervisord.conf
port: 9001
# username and password to access the supervisor http server at <server-ip>:<supervisord_port>
username: '{{ custom.username }}'
password: '{{ custom.password }}'
# supervisor will send crash reports to this address (check your junk mail)
email: '{{ custom.email }}'
commands:
post_sieve: '{{ faasdir_remote }}/factor/post_sieve.sh'
post_linalg: '{{ faasdir_remote }}/factor/post_linalg.sh'
post_factor: '{{ faasdir_remote }}/factor/post_factor.sh'
cado:
name: faas100
N: 1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139
rlim: 919083
alim: 751334
lpbr: 24
lpba: 24
tasks:
mpi: "2x1"
polyselect:
threads: 2
degree: 4
P: 10000
admax: 250e3
incr: 60
nq: 1000
sieve:
threads: 2
mfbr: 47
mfba: 48
rlambda: 2.06
alambda: 2.1
ncurves0: 11
ncurves1: 13
qrange: 2500
I: 11
msieve:
target_density: 70
filter:
purge:
keep: 160
maxlevel: 20
ratio: 1.1
merge:
forbw: 3
| {
"pile_set_name": "Github"
} |
#ifndef _TOOLS_INCLUDE_LINUX_PROC_FS_H
#define _TOOLS_INCLUDE_LINUX_PROC_FS_H
#endif /* _TOOLS_INCLUDE_LINUX_PROC_FS_H */
| {
"pile_set_name": "Github"
} |
using System;
using System.Runtime.Serialization;
namespace Adaptive.ReactiveTrader.EventStore.Domain
{
[DataContract]
public class AggregateDeletedException : AggregateExceptionBase
{
public AggregateDeletedException(object id, Type type) : base(id, type)
{
}
public AggregateDeletedException(object id, Type type, string message) : base(id, type, message)
{
}
public AggregateDeletedException(object id, Type type, string message, Exception innerException) : base(id, type, message, innerException)
{
}
}
} | {
"pile_set_name": "Github"
} |
/*
* URL Cache Tests
*
* Copyright 2008 Robert Shearman for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wininet.h"
#include "winineti.h"
#include "shlobj.h"
#include "wine/test.h"
static const char test_url[] = "http://urlcachetest.winehq.org/index.html";
static const WCHAR test_urlW[] = {'h','t','t','p',':','/','/','u','r','l','c','a','c','h','e','t','e','s','t','.',
'w','i','n','e','h','q','.','o','r','g','/','i','n','d','e','x','.','h','t','m','l',0};
static const char test_url1[] = "Visited: user@http://urlcachetest.winehq.org/index.html";
static const char test_hash_collisions1[] = "Visited: http://winehq.org/doc0.html";
static const char test_hash_collisions2[] = "Visited: http://winehq.org/doc75651909.html";
static BOOL (WINAPI *pDeleteUrlCacheEntryA)(LPCSTR);
static BOOL (WINAPI *pUnlockUrlCacheEntryFileA)(LPCSTR,DWORD);
static char filenameA[MAX_PATH + 1];
static char filenameA1[MAX_PATH + 1];
static BOOL old_ie = FALSE;
static BOOL ie10_cache = FALSE;
static void check_cache_entry_infoA(const char *returnedfrom, INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo)
{
ok(lpCacheEntryInfo->dwStructSize == sizeof(*lpCacheEntryInfo), "%s: dwStructSize was %d\n", returnedfrom, lpCacheEntryInfo->dwStructSize);
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_url), "%s: lpszSourceUrlName should be %s instead of %s\n", returnedfrom, test_url, lpCacheEntryInfo->lpszSourceUrlName);
ok(!strcmp(lpCacheEntryInfo->lpszLocalFileName, filenameA), "%s: lpszLocalFileName should be %s instead of %s\n", returnedfrom, filenameA, lpCacheEntryInfo->lpszLocalFileName);
ok(!strcmp(lpCacheEntryInfo->lpszFileExtension, "html"), "%s: lpszFileExtension should be html instead of %s\n", returnedfrom, lpCacheEntryInfo->lpszFileExtension);
}
static void test_find_url_cache_entriesA(void)
{
BOOL ret;
HANDLE hEnumHandle;
BOOL found = FALSE;
DWORD cbCacheEntryInfo;
DWORD cbCacheEntryInfoSaved;
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo;
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
hEnumHandle = FindFirstUrlCacheEntryA(NULL, NULL, &cbCacheEntryInfo);
ok(!hEnumHandle, "FindFirstUrlCacheEntry should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "FindFirstUrlCacheEntry should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo * sizeof(char));
cbCacheEntryInfoSaved = cbCacheEntryInfo;
hEnumHandle = FindFirstUrlCacheEntryA(NULL, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(hEnumHandle != NULL, "FindFirstUrlCacheEntry failed with error %d\n", GetLastError());
while (TRUE)
{
if (!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_url))
{
found = TRUE;
ret = TRUE;
break;
}
SetLastError(0xdeadbeef);
cbCacheEntryInfo = cbCacheEntryInfoSaved;
ret = FindNextUrlCacheEntryA(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo);
if (!ret)
{
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
lpCacheEntryInfo = HeapReAlloc(GetProcessHeap(), 0, lpCacheEntryInfo, cbCacheEntryInfo);
cbCacheEntryInfoSaved = cbCacheEntryInfo;
ret = FindNextUrlCacheEntryA(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo);
}
}
if (!ret)
break;
}
ok(ret, "FindNextUrlCacheEntry failed with error %d\n", GetLastError());
ok(found, "Committed url cache entry not found during enumeration\n");
ret = FindCloseUrlCache(hEnumHandle);
ok(ret, "FindCloseUrlCache failed with error %d\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
}
static void test_GetUrlCacheEntryInfoExA(void)
{
BOOL ret;
DWORD cbCacheEntryInfo, cbRedirectUrl;
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(NULL, NULL, NULL, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with NULL URL and NULL args should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"GetUrlCacheEntryInfoEx with NULL URL and NULL args should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
cbCacheEntryInfo = sizeof(INTERNET_CACHE_ENTRY_INFOA);
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA("", NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetUrlCacheEntryInfoEx should have set last error to ERROR_FILE_NOT_FOUND instead of %d\n", GetLastError());
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0);
ok(ret, "GetUrlCacheEntryInfoEx with NULL args failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
ok(ret == ie10_cache, "GetUrlCacheEntryInfoEx returned %x\n", ret);
if (!ret) ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetUrlCacheEntryInfoEx should have set last error to ERROR_FILE_NOT_FOUND instead of %d\n", GetLastError());
/* Unicode version of function seems to ignore 0x200 flag */
ret = GetUrlCacheEntryInfoExW(test_urlW, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
ok(ret || broken(old_ie && !ret), "GetUrlCacheEntryInfoExW failed with error %d\n", GetLastError());
ret = GetUrlCacheEntryInfoExA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(ret, "GetUrlCacheEntryInfoEx failed with error %d\n", GetLastError());
if (ret) check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo);
lpCacheEntryInfo->CacheEntryType |= 0x10000000; /* INSTALLED_CACHE_ENTRY */
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, CACHE_ENTRY_ATTRIBUTE_FC);
ok(ret, "SetUrlCacheEntryInfoA failed with error %d\n", GetLastError());
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
ok(ret, "GetUrlCacheEntryInfoEx failed with error %d\n", GetLastError());
cbCacheEntryInfo = 100000;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
/* Querying the redirect URL fails with ERROR_INVALID_PARAMETER */
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, &cbRedirectUrl, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, &cbRedirectUrl, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
static void test_RetrieveUrlCacheEntryA(void)
{
BOOL ret;
DWORD cbCacheEntryInfo;
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(NULL, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
if (0)
{
/* Crashes on Win9x, NT4 and W2K */
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, NULL, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
}
SetLastError(0xdeadbeef);
cbCacheEntryInfo = 100000;
ret = RetrieveUrlCacheEntryFileA(NULL, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
}
static void test_IsUrlCacheEntryExpiredA(void)
{
static const char uncached_url[] =
"What's the airspeed velocity of an unladen swallow?";
BOOL ret;
FILETIME ft;
DWORD size;
INTERNET_CACHE_ENTRY_INFOA *info;
ULARGE_INTEGER exp_time;
/* The function returns TRUE when the output time is NULL or the tested URL
* is NULL.
*/
ret = IsUrlCacheEntryExpiredA(NULL, 0, NULL);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
ret = IsUrlCacheEntryExpiredA(NULL, 0, &ft);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
ok(ft.dwLowDateTime == 0xdeadbeef && ft.dwHighDateTime == 0xbaadf00d,
"expected time to be unchanged, got (%u,%u)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
ret = IsUrlCacheEntryExpiredA(test_url, 0, NULL);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
/* The return value should indicate whether the URL is expired,
* and the filetime indicates the last modified time, but a cache entry
* with a zero expire time is "not expired".
*/
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
ok(!ret, "expected FALSE\n");
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Same behavior with bogus flags. */
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
ret = IsUrlCacheEntryExpiredA(test_url, 0xffffffff, &ft);
ok(!ret, "expected FALSE\n");
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Set the expire time to a point in the past.. */
ret = GetUrlCacheEntryInfoA(test_url, NULL, &size);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
info = HeapAlloc(GetProcessHeap(), 0, size);
ret = GetUrlCacheEntryInfoA(test_url, info, &size);
ok(ret, "GetUrlCacheEntryInfo failed: %d\n", GetLastError());
GetSystemTimeAsFileTime(&info->ExpireTime);
exp_time.u.LowPart = info->ExpireTime.dwLowDateTime;
exp_time.u.HighPart = info->ExpireTime.dwHighDateTime;
exp_time.QuadPart -= 10 * 60 * (ULONGLONG)10000000;
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_EXPTIME_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
/* and the entry should be expired. */
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
ok(ret, "expected TRUE\n");
/* The modified time returned is 0. */
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Set the expire time to a point in the future.. */
exp_time.QuadPart += 20 * 60 * (ULONGLONG)10000000;
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_EXPTIME_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
/* and the entry should no longer be expired. */
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
ok(!ret, "expected FALSE\n");
/* The modified time returned is still 0. */
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Set the modified time... */
GetSystemTimeAsFileTime(&info->LastModifiedTime);
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_MODTIME_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
/* and the entry should still be unexpired.. */
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
ok(!ret, "expected FALSE\n");
/* but the modified time returned is the last modified time just set. */
ok(ft.dwLowDateTime == info->LastModifiedTime.dwLowDateTime &&
ft.dwHighDateTime == info->LastModifiedTime.dwHighDateTime,
"expected time (%u,%u), got (%u,%u)\n",
info->LastModifiedTime.dwLowDateTime,
info->LastModifiedTime.dwHighDateTime,
ft.dwLowDateTime, ft.dwHighDateTime);
HeapFree(GetProcessHeap(), 0, info);
/* An uncached URL is implicitly expired, but with unknown time. */
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
ret = IsUrlCacheEntryExpiredA(uncached_url, 0, &ft);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
}
static void _check_file_exists(LONG l, LPCSTR filename)
{
HANDLE file;
file = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ok_(__FILE__,l)(file != INVALID_HANDLE_VALUE,
"expected file to exist, CreateFile failed with error %d\n",
GetLastError());
CloseHandle(file);
}
#define check_file_exists(f) _check_file_exists(__LINE__, f)
static void _check_file_not_exists(LONG l, LPCSTR filename)
{
HANDLE file;
file = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ok_(__FILE__,l)(file == INVALID_HANDLE_VALUE,
"expected file not to exist\n");
if (file != INVALID_HANDLE_VALUE)
CloseHandle(file);
}
#define check_file_not_exists(f) _check_file_not_exists(__LINE__, f)
static void create_and_write_file(LPCSTR filename, void *data, DWORD len)
{
HANDLE file;
DWORD written;
BOOL ret;
file = CreateFileA(filename, GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed with error %d\n", GetLastError());
ret = WriteFile(file, data, len, &written, NULL);
ok(ret, "WriteFile failed with error %d\n", GetLastError());
CloseHandle(file);
}
static void test_urlcacheA(void)
{
static char long_url[300] = "http://www.winehq.org/";
static char ok_header[] = "HTTP/1.0 200 OK\r\n\r\n";
BOOL ret;
HANDLE hFile;
BYTE zero_byte = 0;
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo;
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo2;
DWORD cbCacheEntryInfo;
static const FILETIME filetime_zero;
FILETIME now;
int len;
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA1);
DeleteFileA(filenameA1);
ok(lstrcmpiA(filenameA, filenameA1), "expected a different file name\n");
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_url1, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"GetUrlCacheEntryInfo should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url1, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(!memcmp(&lpCacheEntryInfo->ExpireTime, &filetime_zero, sizeof(FILETIME)),
"expected zero ExpireTime\n");
ok(!memcmp(&lpCacheEntryInfo->LastModifiedTime, &filetime_zero, sizeof(FILETIME)),
"expected zero LastModifiedTime\n");
ok(lpCacheEntryInfo->CacheEntryType == (NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY) ||
broken(lpCacheEntryInfo->CacheEntryType == NORMAL_CACHE_ENTRY /* NT4/W2k */),
"expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08x\n",
lpCacheEntryInfo->CacheEntryType);
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n",
U(*lpCacheEntryInfo).dwExemptDelta);
/* Make sure there is a notable change in timestamps */
Sleep(1000);
/* A subsequent commit with a different time/type doesn't change most of the entry */
GetSystemTimeAsFileTime(&now);
ret = CommitUrlCacheEntryA(test_url1, NULL, now, now, NORMAL_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), NULL, NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_url1, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo2 = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url1, lpCacheEntryInfo2, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
/* but it does change the time.. */
ok(memcmp(&lpCacheEntryInfo2->ExpireTime, &filetime_zero, sizeof(FILETIME)),
"expected positive ExpireTime\n");
ok(memcmp(&lpCacheEntryInfo2->LastModifiedTime, &filetime_zero, sizeof(FILETIME)),
"expected positive LastModifiedTime\n");
ok(lpCacheEntryInfo2->CacheEntryType == (NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY) ||
broken(lpCacheEntryInfo2->CacheEntryType == NORMAL_CACHE_ENTRY /* NT4/W2k */),
"expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08x\n",
lpCacheEntryInfo2->CacheEntryType);
/* and set the headers. */
ok(lpCacheEntryInfo2->dwHeaderInfoSize == 19,
"expected headers size 19, got %d\n",
lpCacheEntryInfo2->dwHeaderInfoSize);
/* Hit rate gets incremented by 1 */
ok((lpCacheEntryInfo->dwHitRate + 1) == lpCacheEntryInfo2->dwHitRate,
"HitRate not incremented by one on commit\n");
/* Last access time should be updated */
ok(!(lpCacheEntryInfo->LastAccessTime.dwHighDateTime == lpCacheEntryInfo2->LastAccessTime.dwHighDateTime &&
lpCacheEntryInfo->LastAccessTime.dwLowDateTime == lpCacheEntryInfo2->LastAccessTime.dwLowDateTime),
"Last accessed time was not updated by commit\n");
/* File extension should be unset */
ok(lpCacheEntryInfo2->lpszFileExtension == NULL,
"Fileextension isn't unset: %s\n",
lpCacheEntryInfo2->lpszFileExtension);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo2);
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"RetrieveUrlCacheEntryFile should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = RetrieveUrlCacheEntryFileA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, 0);
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
if (ret) check_cache_entry_infoA("RetrieveUrlCacheEntryFile", lpCacheEntryInfo);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url1, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_DATA instead of %d\n", GetLastError());
if (pUnlockUrlCacheEntryFileA)
{
ret = pUnlockUrlCacheEntryFileA(test_url, 0);
ok(ret, "UnlockUrlCacheEntryFileA failed with error %d\n", GetLastError());
}
/* test Find*UrlCacheEntry functions */
test_find_url_cache_entriesA();
test_GetUrlCacheEntryInfoExA();
test_RetrieveUrlCacheEntryA();
test_IsUrlCacheEntryExpiredA();
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ret = pDeleteUrlCacheEntryA(test_url1);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
}
SetLastError(0xdeadbeef);
ret = DeleteFileA(filenameA);
ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "local file should no longer exist\n");
/* Creating two entries with the same URL */
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(lstrcmpiA(filenameA, filenameA1), "expected a different file name\n");
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
create_and_write_file(filenameA1, &zero_byte, sizeof(zero_byte));
check_file_exists(filenameA);
check_file_exists(filenameA1);
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero,
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA);
check_file_exists(filenameA1);
ret = CommitUrlCacheEntryA(test_url, filenameA1, filetime_zero,
filetime_zero, COOKIE_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
/* By committing the same URL a second time, the prior entry is
* overwritten...
*/
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
/* with the previous entry type retained.. */
ok(lpCacheEntryInfo->CacheEntryType & NORMAL_CACHE_ENTRY,
"expected cache entry type NORMAL_CACHE_ENTRY, got %d (0x%08x)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
/* and the headers overwritten.. */
ok(!lpCacheEntryInfo->dwHeaderInfoSize, "expected headers size 0, got %d\n",
lpCacheEntryInfo->dwHeaderInfoSize);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
/* and the previous filename shouldn't exist. */
check_file_not_exists(filenameA);
check_file_exists(filenameA1);
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
check_file_not_exists(filenameA);
check_file_not_exists(filenameA1);
/* Just in case, clean up files */
DeleteFileA(filenameA1);
DeleteFileA(filenameA);
}
/* Check whether a retrieved cache entry can be deleted before it's
* unlocked:
*/
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = RetrieveUrlCacheEntryFileA(test_url, lpCacheEntryInfo,
&cbCacheEntryInfo, 0);
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_SHARING_VIOLATION,
"Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError());
check_file_exists(filenameA);
}
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
memset(lpCacheEntryInfo, 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(lpCacheEntryInfo->CacheEntryType & 0x400000,
"CacheEntryType hasn't PENDING_DELETE_CACHE_ENTRY set, (flags %08x)\n",
lpCacheEntryInfo->CacheEntryType);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pUnlockUrlCacheEntryFileA)
{
check_file_exists(filenameA);
ret = pUnlockUrlCacheEntryFileA(test_url, 0);
ok(ret, "UnlockUrlCacheEntryFileA failed: %d\n", GetLastError());
/* By unlocking the already-deleted cache entry, the file associated
* with it is deleted..
*/
check_file_not_exists(filenameA);
/* (just in case, delete file) */
DeleteFileA(filenameA);
}
if (pDeleteUrlCacheEntryA)
{
/* and a subsequent deletion should fail. */
ret = pDeleteUrlCacheEntryA(test_url);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
}
/* Test whether preventing a file from being deleted causes
* DeleteUrlCacheEntryA to fail.
*/
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
check_file_exists(filenameA);
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero,
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA);
hFile = CreateFileA(filenameA, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA failed: %d\n",
GetLastError());
if (pDeleteUrlCacheEntryA)
{
/* DeleteUrlCacheEntryA should succeed.. */
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
}
CloseHandle(hFile);
if (pDeleteUrlCacheEntryA)
{
/* and a subsequent deletion should fail.. */
ret = pDeleteUrlCacheEntryA(test_url);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
}
/* and the file should be untouched. */
check_file_exists(filenameA);
DeleteFileA(filenameA);
/* Try creating a sticky entry. Unlike non-sticky entries, the filename
* must have been set already.
*/
SetLastError(0xdeadbeef);
ret = CommitUrlCacheEntryA(test_url, NULL, filetime_zero, filetime_zero,
STICKY_CACHE_ENTRY, (LPBYTE)ok_header, strlen(ok_header), "html",
NULL);
ok(ret == ie10_cache, "CommitUrlCacheEntryA returned %x\n", ret);
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
SetLastError(0xdeadbeef);
ret = CommitUrlCacheEntryA(test_url, NULL, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret == ie10_cache, "CommitUrlCacheEntryA returned %x\n", ret);
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
ok(U(*lpCacheEntryInfo).dwExemptDelta == 86400,
"expected dwExemptDelta 86400, got %d\n",
U(*lpCacheEntryInfo).dwExemptDelta);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
/* When explicitly deleting the cache entry, the file is also deleted */
check_file_not_exists(filenameA);
}
/* Test once again, setting the exempt delta via SetUrlCacheEntryInfo */
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
ok(U(*lpCacheEntryInfo).dwExemptDelta == 86400,
"expected dwExemptDelta 86400, got %d\n",
U(*lpCacheEntryInfo).dwExemptDelta);
U(*lpCacheEntryInfo).dwExemptDelta = 0;
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo,
CACHE_ENTRY_EXEMPT_DELTA_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n",
U(*lpCacheEntryInfo).dwExemptDelta);
/* See whether a sticky cache entry has the flag cleared once the exempt
* delta is meaningless.
*/
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
/* Recommit of Url entry keeps dwExemptDelta */
U(*lpCacheEntryInfo).dwExemptDelta = 8600;
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo,
CACHE_ENTRY_EXEMPT_DELTA_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
create_and_write_file(filenameA1, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url, filenameA1, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(U(*lpCacheEntryInfo).dwExemptDelta == 8600 || (ie10_cache && U(*lpCacheEntryInfo).dwExemptDelta == 86400),
"expected dwExemptDelta 8600, got %d\n", U(*lpCacheEntryInfo).dwExemptDelta);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
check_file_not_exists(filenameA);
}
/* Test if files with identical hash keys are handled correctly */
ret = CommitUrlCacheEntryA(test_hash_collisions1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ret = CommitUrlCacheEntryA(test_hash_collisions2, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_hash_collisions1, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_hash_collisions1, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions1),
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_hash_collisions2, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_hash_collisions2, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions2),
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA) {
ret = pDeleteUrlCacheEntryA(test_hash_collisions1);
ok(ret, "DeleteUrlCacheEntry failed: %d\n", GetLastError());
ret = pDeleteUrlCacheEntryA(test_hash_collisions2);
ok(ret, "DeleteUrlCacheEntry failed: %d\n", GetLastError());
}
len = strlen(long_url);
memset(long_url+len, 'a', sizeof(long_url)-len);
long_url[sizeof(long_url)-1] = 0;
ret = CreateUrlCacheEntryA(long_url, 0, NULL, filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
ret = CreateUrlCacheEntryA(long_url, 0, "extension", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
long_url[250] = 0;
ret = CreateUrlCacheEntryA(long_url, 0, NULL, filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
ret = CreateUrlCacheEntryA(long_url, 0, "extension", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
}
static void test_urlcacheW(void)
{
static struct test_data
{
DWORD err;
WCHAR url[128];
char encoded_url[128];
WCHAR extension[32];
WCHAR header_info[128];
}urls[] = {
{
0, {'h','t','t','p',':','/','/','T','.','p','l','/','t',0},
"http://T.pl/t", {0}, {0}
},
{
0, {'w','w','w','.','T','.','p','l','/','t',0},
"www.T.pl/t", {0}, {0}
},
{
0, {'h','t','t','p',':','/','/','w','w','w','.','t','e','s','t',0x15b,0x107,
'.','o','r','g','/','t','e','s','t','.','h','t','m','l',0},
"http://www.xn--test-ota71c.org/test.html", {'t','x','t',0}, {0}
},
{
0, {'w','w','w','.','T','e','s','t',0x15b,0x107,'.','o','r','g',
'/','t','e','s','t','.','h','t','m','l',0},
"www.Test\xc5\x9b\xc4\x87.org/test.html", {'a',0x106,'a',0}, {'b',0x106,'b',0}
},
{
0, {'H','t','t','p','s',':','/','/',0x15b,0x15b,0x107,'/','t',0x107,'/',
't','e','s','t','?','a','=','%','2','0',0x106,0},
"Https://xn--4da1oa/t\xc4\x87/test?a=%20\xc4\x86", {'a',0x15b,'a',0}, {'b',0x15b,'b',0}
},
{
12005, {'h','t','t','p','s',':','/','/','/','/',0x107,'.','o','r','g','/','t','e','s','t',0},
"", {0}, {0}
},
{
0, {'C','o','o','k','i','e',':',' ','u','s','e','r','@','h','t','t','p',
':','/','/','t',0x15b,0x107,'.','o','r','g','/',0},
"Cookie: user@http://t\xc5\x9b\xc4\x87.org/", {0}, {0}
}
};
static const FILETIME filetime_zero;
WCHAR bufW[MAX_PATH];
DWORD i;
BOOL ret;
if(old_ie) {
win_skip("urlcache unicode functions\n");
return;
}
if(ie10_cache) {
if(!MultiByteToWideChar(CP_ACP, 0, urls[6].encoded_url, -1,
urls[6].url, ARRAY_SIZE(urls[6].url)))
urls[6].url[0] = 0;
trace("converted url in test 6: %s\n", wine_dbgstr_w(urls[6].url));
}
for(i=0; i<ARRAY_SIZE(urls); i++) {
INTERNET_CACHE_ENTRY_INFOA *entry_infoA;
INTERNET_CACHE_ENTRY_INFOW *entry_infoW;
DWORD size;
if(!urls[i].url[0]) {
win_skip("No UTF16 version of url (%d)\n", i);
continue;
}
SetLastError(0xdeadbeef);
ret = CreateUrlCacheEntryW(urls[i].url, 0, NULL, bufW, 0);
if(urls[i].err != 0) {
ok(!ret, "%d) CreateUrlCacheEntryW succeeded\n", i);
ok(urls[i].err == GetLastError(), "%d) GetLastError() = %d\n", i, GetLastError());
continue;
}
ok(ret, "%d) CreateUrlCacheEntryW failed: %d\n", i, GetLastError());
/* dwHeaderSize is ignored, pass 0 to prove it */
ret = CommitUrlCacheEntryW(urls[i].url, bufW, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY, urls[i].header_info, 0, urls[i].extension, NULL);
ok(ret, "%d) CommitUrlCacheEntryW failed: %d\n", i, GetLastError());
SetLastError(0xdeadbeef);
size = 0;
ret = GetUrlCacheEntryInfoW(urls[i].url, NULL, &size);
ok(!ret && GetLastError()==ERROR_INSUFFICIENT_BUFFER,
"%d) GetLastError() = %d\n", i, GetLastError());
entry_infoW = HeapAlloc(GetProcessHeap(), 0, size);
ret = GetUrlCacheEntryInfoW(urls[i].url, entry_infoW, &size);
ok(ret, "%d) GetUrlCacheEntryInfoW failed: %d\n", i, GetLastError());
ret = GetUrlCacheEntryInfoA(urls[i].encoded_url, NULL, &size);
ok(!ret && GetLastError()==ERROR_INSUFFICIENT_BUFFER,
"%d) GetLastError() = %d\n", i, GetLastError());
if(!ret && GetLastError()!=ERROR_INSUFFICIENT_BUFFER) {
win_skip("ANSI version of url is incorrect\n");
continue;
}
entry_infoA = HeapAlloc(GetProcessHeap(), 0, size);
ret = GetUrlCacheEntryInfoA(urls[i].encoded_url, entry_infoA, &size);
ok(ret, "%d) GetUrlCacheEntryInfoA failed: %d\n", i, GetLastError());
ok(entry_infoW->dwStructSize == entry_infoA->dwStructSize,
"%d) entry_infoW->dwStructSize = %d, expected %d\n",
i, entry_infoW->dwStructSize, entry_infoA->dwStructSize);
ok(!lstrcmpW(urls[i].url, entry_infoW->lpszSourceUrlName),
"%d) entry_infoW->lpszSourceUrlName = %s\n",
i, wine_dbgstr_w(entry_infoW->lpszSourceUrlName));
ok(!lstrcmpA(urls[i].encoded_url, entry_infoA->lpszSourceUrlName),
"%d) entry_infoA->lpszSourceUrlName = %s\n",
i, entry_infoA->lpszSourceUrlName);
ok(entry_infoW->CacheEntryType == entry_infoA->CacheEntryType,
"%d) entry_infoW->CacheEntryType = %x, expected %x\n",
i, entry_infoW->CacheEntryType, entry_infoA->CacheEntryType);
ok(entry_infoW->dwUseCount == entry_infoA->dwUseCount,
"%d) entry_infoW->dwUseCount = %d, expected %d\n",
i, entry_infoW->dwUseCount, entry_infoA->dwUseCount);
ok(entry_infoW->dwHitRate == entry_infoA->dwHitRate,
"%d) entry_infoW->dwHitRate = %d, expected %d\n",
i, entry_infoW->dwHitRate, entry_infoA->dwHitRate);
ok(entry_infoW->dwSizeLow == entry_infoA->dwSizeLow,
"%d) entry_infoW->dwSizeLow = %d, expected %d\n",
i, entry_infoW->dwSizeLow, entry_infoA->dwSizeLow);
ok(entry_infoW->dwSizeHigh == entry_infoA->dwSizeHigh,
"%d) entry_infoW->dwSizeHigh = %d, expected %d\n",
i, entry_infoW->dwSizeHigh, entry_infoA->dwSizeHigh);
ok(!memcmp(&entry_infoW->LastModifiedTime, &entry_infoA->LastModifiedTime, sizeof(FILETIME)),
"%d) entry_infoW->LastModifiedTime is incorrect\n", i);
ok(!memcmp(&entry_infoW->ExpireTime, &entry_infoA->ExpireTime, sizeof(FILETIME)),
"%d) entry_infoW->ExpireTime is incorrect\n", i);
ok(!memcmp(&entry_infoW->LastAccessTime, &entry_infoA->LastAccessTime, sizeof(FILETIME)),
"%d) entry_infoW->LastAccessTime is incorrect\n", i);
ok(!memcmp(&entry_infoW->LastSyncTime, &entry_infoA->LastSyncTime, sizeof(FILETIME)),
"%d) entry_infoW->LastSyncTime is incorrect\n", i);
MultiByteToWideChar(CP_ACP, 0, entry_infoA->lpszLocalFileName, -1, bufW, MAX_PATH);
ok(!lstrcmpW(entry_infoW->lpszLocalFileName, bufW),
"%d) entry_infoW->lpszLocalFileName = %s, expected %s\n",
i, wine_dbgstr_w(entry_infoW->lpszLocalFileName), wine_dbgstr_w(bufW));
if(!urls[i].header_info[0]) {
ok(!entry_infoW->lpHeaderInfo, "entry_infoW->lpHeaderInfo != NULL\n");
}else {
ok(!lstrcmpW((WCHAR*)entry_infoW->lpHeaderInfo, urls[i].header_info),
"%d) entry_infoW->lpHeaderInfo = %s\n",
i, wine_dbgstr_w((WCHAR*)entry_infoW->lpHeaderInfo));
}
if(!urls[i].extension[0]) {
ok(!entry_infoW->lpszFileExtension || (ie10_cache && !entry_infoW->lpszFileExtension[0]),
"%d) entry_infoW->lpszFileExtension = %s\n",
i, wine_dbgstr_w(entry_infoW->lpszFileExtension));
}else {
MultiByteToWideChar(CP_ACP, 0, entry_infoA->lpszFileExtension, -1, bufW, MAX_PATH);
ok(!lstrcmpW(entry_infoW->lpszFileExtension, bufW) ||
(ie10_cache && !lstrcmpW(entry_infoW->lpszFileExtension, urls[i].extension)),
"%d) entry_infoW->lpszFileExtension = %s, expected %s\n",
i, wine_dbgstr_w(entry_infoW->lpszFileExtension), wine_dbgstr_w(bufW));
}
HeapFree(GetProcessHeap(), 0, entry_infoW);
HeapFree(GetProcessHeap(), 0, entry_infoA);
if(pDeleteUrlCacheEntryA) {
ret = pDeleteUrlCacheEntryA(urls[i].encoded_url);
ok(ret, "%d) DeleteUrlCacheEntryW failed: %d\n", i, GetLastError());
}
}
}
static void test_FindCloseUrlCache(void)
{
BOOL r;
DWORD err;
SetLastError(0xdeadbeef);
r = FindCloseUrlCache(NULL);
err = GetLastError();
ok(0 == r, "expected 0, got %d\n", r);
ok(ERROR_INVALID_HANDLE == err, "expected %d, got %d\n", ERROR_INVALID_HANDLE, err);
}
static void test_GetDiskInfoA(void)
{
BOOL ret;
DWORD error, cluster_size;
DWORDLONG free, total;
char path[MAX_PATH], *p;
GetSystemDirectoryA(path, MAX_PATH);
if ((p = strchr(path, '\\'))) *++p = 0;
ret = GetDiskInfoA(path, &cluster_size, &free, &total);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ret = GetDiskInfoA(path, &cluster_size, &free, NULL);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ret = GetDiskInfoA(path, &cluster_size, NULL, NULL);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ret = GetDiskInfoA(path, NULL, NULL, NULL);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
SetLastError(0xdeadbeef);
strcpy(p, "\\non\\existing\\path");
ret = GetDiskInfoA(path, NULL, NULL, NULL);
error = GetLastError();
ok(!ret ||
broken(old_ie && ret), /* < IE7 */
"GetDiskInfoA succeeded\n");
ok(error == ERROR_PATH_NOT_FOUND ||
broken(old_ie && error == 0xdeadbeef), /* < IE7 */
"got %u expected ERROR_PATH_NOT_FOUND\n", error);
SetLastError(0xdeadbeef);
ret = GetDiskInfoA(NULL, NULL, NULL, NULL);
error = GetLastError();
ok(!ret, "GetDiskInfoA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error);
}
static BOOL cache_entry_exists(const char *url)
{
static char buf[10000];
DWORD size = sizeof(buf);
BOOL ret;
ret = GetUrlCacheEntryInfoA(url, (void*)buf, &size);
ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, "GetUrlCacheEntryInfoA returned %x (%u)\n", ret, GetLastError());
return ret;
}
static void test_trailing_slash(void)
{
char filename[MAX_PATH];
BYTE zero_byte = 0;
BOOL ret;
static const FILETIME filetime_zero;
static char url_with_slash[] = "http://testing.cache.com/";
ret = CreateUrlCacheEntryA(url_with_slash, 0, "html", filename, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
create_and_write_file(filename, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA("Visited: http://testing.cache.com/", NULL, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(cache_entry_exists("Visited: http://testing.cache.com/"), "cache entry does not exist\n");
ok(!cache_entry_exists("Visited: http://testing.cache.com"), "cache entry exists\n");
ret = DeleteUrlCacheEntryA("Visited: http://testing.cache.com/");
ok(ret, "DeleteCacheEntryA failed\n");
DeleteFileA(filename);
}
static void get_cache_path(DWORD flags, char path[MAX_PATH], char path_win8[MAX_PATH])
{
BOOL ret;
int folder = -1;
const char *suffix = "";
const char *suffix_win8 = "";
switch (flags)
{
case 0:
case CACHE_CONFIG_CONTENT_PATHS_FC:
folder = CSIDL_INTERNET_CACHE;
suffix = "\\Content.IE5\\";
suffix_win8 = "\\IE\\";
break;
case CACHE_CONFIG_COOKIES_PATHS_FC:
folder = CSIDL_COOKIES;
suffix = "\\";
suffix_win8 = "\\";
break;
case CACHE_CONFIG_HISTORY_PATHS_FC:
folder = CSIDL_HISTORY;
suffix = "\\History.IE5\\";
suffix_win8 = "\\History.IE5\\";
break;
default:
ok(0, "unexpected flags %#x\n", flags);
break;
}
ret = SHGetSpecialFolderPathA(0, path, folder, FALSE);
ok(ret, "SHGetSpecialFolderPath error %u\n", GetLastError());
strcpy(path_win8, path);
strcat(path_win8, suffix_win8);
strcat(path, suffix);
}
static void test_GetUrlCacheConfigInfo(void)
{
INTERNET_CACHE_CONFIG_INFOA info;
struct
{
INTERNET_CACHE_CONFIG_INFOA *info;
DWORD dwStructSize;
DWORD flags;
BOOL ret;
DWORD error;
} td[] =
{
#if 0 /* crashes under Vista */
{ NULL, 0, 0, FALSE, ERROR_INVALID_PARAMETER },
#endif
{ &info, 0, 0, TRUE },
{ &info, sizeof(info) - 1, 0, TRUE },
{ &info, sizeof(info) + 1, 0, TRUE },
{ &info, 0, CACHE_CONFIG_CONTENT_PATHS_FC, TRUE },
{ &info, sizeof(info), CACHE_CONFIG_CONTENT_PATHS_FC, TRUE },
{ &info, 0, CACHE_CONFIG_COOKIES_PATHS_FC, TRUE },
{ &info, sizeof(info), CACHE_CONFIG_COOKIES_PATHS_FC, TRUE },
{ &info, 0, CACHE_CONFIG_HISTORY_PATHS_FC, TRUE },
{ &info, sizeof(info), CACHE_CONFIG_HISTORY_PATHS_FC, TRUE },
};
int i;
BOOL ret;
for (i = 0; i < ARRAY_SIZE(td); i++)
{
if (td[i].info)
{
memset(&info, 0, sizeof(*td[i].info));
info.dwStructSize = td[i].dwStructSize;
}
SetLastError(0xdeadbeef);
ret = GetUrlCacheConfigInfoA(td[i].info, NULL, td[i].flags);
ok(ret == td[i].ret, "%d: expected %d, got %d\n", i, td[i].ret, ret);
if (!ret)
ok(GetLastError() == td[i].error, "%d: expected %u, got %u\n", i, td[i].error, GetLastError());
else
{
char path[MAX_PATH], path_win8[MAX_PATH];
get_cache_path(td[i].flags, path, path_win8);
ok(info.dwStructSize == td[i].dwStructSize, "got %u\n", info.dwStructSize);
ok(!lstrcmpA(info.CachePath, path) || !lstrcmpA(info.CachePath, path_win8),
"%d: expected %s or %s, got %s\n", i, path, path_win8, info.CachePath);
}
}
}
START_TEST(urlcache)
{
HMODULE hdll;
hdll = GetModuleHandleA("wininet.dll");
if(!GetProcAddress(hdll, "InternetGetCookieExW")) {
win_skip("Too old IE (older than 6.0)\n");
return;
}
if(!GetProcAddress(hdll, "InternetGetSecurityInfoByURL")) /* < IE7 */
old_ie = TRUE;
if(GetProcAddress(hdll, "CreateUrlCacheEntryExW")) {
trace("Running tests on IE10 or newer\n");
ie10_cache = TRUE;
}
pDeleteUrlCacheEntryA = (void*)GetProcAddress(hdll, "DeleteUrlCacheEntryA");
pUnlockUrlCacheEntryFileA = (void*)GetProcAddress(hdll, "UnlockUrlCacheEntryFileA");
test_urlcacheA();
test_urlcacheW();
test_FindCloseUrlCache();
test_GetDiskInfoA();
test_trailing_slash();
test_GetUrlCacheConfigInfo();
}
| {
"pile_set_name": "Github"
} |
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<!-- Standard Head Part -->
<head>
<title>NUnit - Ignore</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-US">
<link rel="stylesheet" type="text/css" href="nunit.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<!-- End Standard Head Part -->
<body>
<!-- Standard Header for NUnit.org -->
<div id="header">
<a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
<div id="nav">
<a href="http://www.nunit.org">NUnit</a>
<a class="active" href="index.html">Documentation</a>
</div>
</div>
<!-- End of Header -->
<div id="content">
<script language="JavaScript" src="codeFuncs.js" ></script> <!-- Do it this way for IE -->
<h3>IgnoreAttribute (NUnit 2.0)</h3>
<p>The ignore attribute is an attribute to not run a test or test fixture for a
period of time. The person marks either a Test or a TestFixture with the Ignore
Attribute. The running program sees the attribute and does not run the test or
tests. The progress bar will turn yellow if a test is not run and the test will
be mentioned in the reports that it was not run.</p>
<p>This feature should be used to temporarily not run a test or fixture. This is a
better mechanism than commenting out the test or renaming methods, since the
tests will be compiled with the rest of the code and there is an indication at
run time that a test is not being run. This insures that tests will not be
forgotten.</p>
<h4>Test Fixture Syntax</h4>
<div class="code">
<div class="langFilter">
<a href="javascript:Show('DD1')" onmouseover="Show('DD1')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
<div id="DD1" class="dropdown" style="display: none;" onclick="Hide('DD1')">
<a href="javascript:ShowCS()">C#</a><br>
<a href="javascript:ShowVB()">VB</a><br>
<a href="javascript:ShowMC()">C++</a><br>
<a href="javascript:ShowJS()">J#</a><br>
</div>
</div>
<pre class="cs">namespace NUnit.Tests
{
using System;
using NUnit.Framework;
[TestFixture]
[Ignore("Ignore a fixture")]
public class SuccessTests
{
// ...
}
}
</pre>
<pre class="vb">Imports System
Imports Nunit.Framework
Namespace Nunit.Tests
<TestFixture(), Ignore("Ignore a fixture")>
Public Class SuccessTests
' ...
End Class
End Namespace
</pre>
<pre class="mc">#using <Nunit.Framework.dll>
using namespace System;
using namespace NUnit::Framework;
namespace NUnitTests
{
[TestFixture]
[Ignore("Ignore a fixture")]
public __gc class SuccessTests
{
// ...
};
}
#include "cppsample.h"
namespace NUnitTests {
// ...
}
</pre>
<pre class="js">package NUnit.Tests;
import System.*;
import NUnit.Framework.TestFixture;
/** @attribute NUnit.Framework.TestFixture() */
/** @attribute NUnit.Framework.Ignore("Ignore a fixture") */
public class SuccessTests
{
// ...
}
</pre>
</div>
<h4>Test Syntax</h4>
<div class="code">
<div class="langFilter">
<a href="javascript:Show('DD2')" onmouseover="Show('DD2')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
<div id="DD2" class="dropdown" style="display: none;" onclick="Hide('DD2')">
<a href="javascript:ShowCS()">C#</a><br>
<a href="javascript:ShowVB()">VB</a><br>
<a href="javascript:ShowMC()">C++</a><br>
<a href="javascript:ShowJS()">J#</a><br>
</div>
</div>
<pre class="cs">namespace NUnit.Tests
{
using System;
using NUnit.Framework;
[TestFixture]
public class SuccessTests
{
[Test]
[Ignore("Ignore a test")]
public void IgnoredTest()
{ /* ... */ }
}
</pre>
<pre class="vb">Imports System
Imports Nunit.Framework
Namespace Nunit.Tests
<TestFixture()>
Public Class SuccessTests
<Test(), Ignore("Ignore a test")> Public Sub Ignored()
' ...
End Sub
End Class
End Namespace
</pre>
<pre class="mc">#using <Nunit.Framework.dll>
using namespace System;
using namespace NUnit::Framework;
namespace NUnitTests
{
[TestFixture]
public __gc class SuccessTests
{
[Test][Ignore("Ignore a test")] void IgnoredTest();
};
}
#include "cppsample.h"
namespace NUnitTests {
// ...
}
</pre>
<pre class="js">package NUnit.Tests;
import System.*;
import NUnit.Framework.TestFixture;
/** @attribute NUnit.Framework.TestFixture() */
public class SuccessTests
{
/** @attribute NUnit.Framework.Test() */
/** @attribute NUnit.Framework.Ignore("ignored test") */
public void IgnoredTest()
{ /* ... */ }
}
</pre>
</div>
</div>
<!-- Submenu -->
<div id="subnav">
<ul>
<li><a href="index.html">NUnit 2.5.7</a></li>
<ul>
<li><a href="getStarted.html">Getting Started</a></li>
<li><a href="assertions.html">Assertions</a></li>
<li><a href="constraintModel.html">Constraints</a></li>
<li><a href="attributes.html">Attributes</a></li>
<ul>
<li><a href="category.html">Category</a></li>
<li><a href="combinatorial.html">Combinatorial</a></li>
<li><a href="culture.html">Culture</a></li>
<li><a href="datapoint.html">Datapoint(s)</a></li>
<li><a href="description.html">Description</a></li>
<li><a href="exception.html">Exception</a></li>
<li><a href="explicit.html">Explicit</a></li>
<li id="current"><a href="ignore.html">Ignore</a></li>
<li><a href="maxtime.html">Maxtime</a></li>
<li><a href="pairwise.html">Pairwise</a></li>
<li><a href="platform.html">Platform</a></li>
<li><a href="property.html">Property</a></li>
<li><a href="random.html">Random</a></li>
<li><a href="range.html">Range</a></li>
<li><a href="repeat.html">Repeat</a></li>
<li><a href="requiredAddin.html">RequiredAddin</a></li>
<li><a href="requiresMTA.html">Requires MTA</a></li>
<li><a href="requiresSTA.html">Requires STA</a></li>
<li><a href="requiresThread.html">Requires Thread</a></li>
<li><a href="sequential.html">Sequential</a></li>
<li><a href="setCulture.html">SetCulture</a></li>
<li><a href="setup.html">Setup</a></li>
<li><a href="setupFixture.html">SetupFixture</a></li>
<li><a href="suite.html">Suite</a></li>
<li><a href="teardown.html">Teardown</a></li>
<li><a href="test.html">Test</a></li>
<li><a href="testCase.html">TestCase</a></li>
<li><a href="testCaseSource.html">TestCaseSource</a></li>
<li><a href="testFixture.html">TestFixture</a></li>
<li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
<li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
<li><a href="theory.html">Theory</a></li>
<li><a href="timeout.html">Timeout</a></li>
<li><a href="values.html">Values</a></li>
<li><a href="valueSource.html">ValueSource</a></li>
</ul>
<li><a href="runningTests.html">Running Tests</a></li>
<li><a href="extensibility.html">Extensibility</a></li>
<li><a href="releaseNotes.html">Release Notes</a></li>
<li><a href="samples.html">Samples</a></li>
<li><a href="license.html">License</a></li>
</ul>
</ul>
</div>
<!-- End of Submenu -->
<!-- Standard Footer for NUnit.org -->
<div id="footer">
Copyright © 2009 Charlie Poole. All Rights Reserved.
</div>
<!-- End of Footer -->
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
This file is part of Darling.
Copyright (C) 2017 Lubos Dolezel
Darling 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.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#import <QuickLook/QLPreview.h>
@implementation QLPreview
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
return [NSMethodSignature signatureWithObjCTypes: "v@:"];
}
- (void)forwardInvocation:(NSInvocation *)anInvocation {
NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]);
}
@end
| {
"pile_set_name": "Github"
} |
package com.tigergraph.connector.hadoop;
import java.io.*;
import java.util.*;
import java.text.DecimalFormat;
import java.net.*;
import java.nio.charset.StandardCharsets;
public class HadoopTGWriter
{
private TGHadoopConfig tghadoop_config = null;
private String url;
private StringBuffer StrBuf = null;
private long msg_count = 0;
private boolean force_flush;
/**
* Constructor for objects of class HadoopTGWriter.
* @param TGHadoopConfig
*/
public HadoopTGWriter(TGHadoopConfig tghadoop_config) throws Exception
{
this.tghadoop_config = tghadoop_config;
this.url = tghadoop_config.tg_url + "/ddl/" +
tghadoop_config.tg_graph +
"?tag=" + tghadoop_config.tg_loadjob +
"&sep=" + tghadoop_config.tg_separator_url +
"&eol=" + tghadoop_config.tg_eol_url;
this.StrBuf = new StringBuffer();
this.force_flush = false;
System.out.println(this.url);
}
public void BatchPost(String data_string) throws Exception
{
try
{
if (data_string.length() > 0) {
this.StrBuf.append(data_string+this.tghadoop_config.tg_eol_ascii);
msg_count++;
}
if (msg_count == this.tghadoop_config.tg_batch_size ||
force_flush == true) {
String urlParameters = StrBuf.toString();
byte[] postData = urlParameters.getBytes( StandardCharsets.UTF_8 );
int postDataLength = postData.length;
URL obj = new URL(url);
HttpURLConnection conn = (HttpURLConnection) obj.openConnection();
conn.setDoOutput( true );
conn.setInstanceFollowRedirects( false );
conn.setRequestMethod( "POST" );
conn.setRequestProperty( "Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty( "charset", "utf-8");
conn.setRequestProperty( "Content-Length", Integer.toString( postDataLength ));
conn.setUseCaches( false );
try( DataOutputStream wr = new DataOutputStream( conn.getOutputStream())) {
wr.write( postData );
}
InputStreamReader InStrmR = new InputStreamReader(conn.getInputStream());
// /* Debug: check the return */
// Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
// for (int c; (c = in.read()) >= 0;)
// System.out.print((char)c);
// System.out.println();
conn.disconnect();
/** Reset for next round */
this.msg_count = 0;
this.StrBuf.setLength(0);
}
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
/**
* make sure all the buffered data are sent
*/
public void close() throws Exception
{
this.force_flush = true;
BatchPost("");
}
}
| {
"pile_set_name": "Github"
} |
package live
//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// DescribeLiveDomainTranscodeData invokes the live.DescribeLiveDomainTranscodeData API synchronously
func (client *Client) DescribeLiveDomainTranscodeData(request *DescribeLiveDomainTranscodeDataRequest) (response *DescribeLiveDomainTranscodeDataResponse, err error) {
response = CreateDescribeLiveDomainTranscodeDataResponse()
err = client.DoAction(request, response)
return
}
// DescribeLiveDomainTranscodeDataWithChan invokes the live.DescribeLiveDomainTranscodeData API asynchronously
func (client *Client) DescribeLiveDomainTranscodeDataWithChan(request *DescribeLiveDomainTranscodeDataRequest) (<-chan *DescribeLiveDomainTranscodeDataResponse, <-chan error) {
responseChan := make(chan *DescribeLiveDomainTranscodeDataResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.DescribeLiveDomainTranscodeData(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// DescribeLiveDomainTranscodeDataWithCallback invokes the live.DescribeLiveDomainTranscodeData API asynchronously
func (client *Client) DescribeLiveDomainTranscodeDataWithCallback(request *DescribeLiveDomainTranscodeDataRequest, callback func(response *DescribeLiveDomainTranscodeDataResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *DescribeLiveDomainTranscodeDataResponse
var err error
defer close(result)
response, err = client.DescribeLiveDomainTranscodeData(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// DescribeLiveDomainTranscodeDataRequest is the request struct for api DescribeLiveDomainTranscodeData
type DescribeLiveDomainTranscodeDataRequest struct {
*requests.RpcRequest
StartTime string `position:"Query" name:"StartTime"`
DomainName string `position:"Query" name:"DomainName"`
EndTime string `position:"Query" name:"EndTime"`
OwnerId requests.Integer `position:"Query" name:"OwnerId"`
}
// DescribeLiveDomainTranscodeDataResponse is the response struct for api DescribeLiveDomainTranscodeData
type DescribeLiveDomainTranscodeDataResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
TranscodeDataInfos TranscodeDataInfos `json:"TranscodeDataInfos" xml:"TranscodeDataInfos"`
}
// CreateDescribeLiveDomainTranscodeDataRequest creates a request to invoke DescribeLiveDomainTranscodeData API
func CreateDescribeLiveDomainTranscodeDataRequest() (request *DescribeLiveDomainTranscodeDataRequest) {
request = &DescribeLiveDomainTranscodeDataRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("live", "2016-11-01", "DescribeLiveDomainTranscodeData", "live", "openAPI")
request.Method = requests.POST
return
}
// CreateDescribeLiveDomainTranscodeDataResponse creates a response to parse from DescribeLiveDomainTranscodeData response
func CreateDescribeLiveDomainTranscodeDataResponse() (response *DescribeLiveDomainTranscodeDataResponse) {
response = &DescribeLiveDomainTranscodeDataResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/perl
=head1 NAME
pfconfig-tenant-scoped
=cut
=head1 DESCRIPTION
unit test for pfconfig-tenant-scoped
=cut
use strict;
use warnings;
#
use lib '/usr/local/pf/lib';
BEGIN {
#include test libs
use lib qw(/usr/local/pf/t);
#Module for overriding configuration paths
use setup_test_config;
}
use Test::More tests => 16;
use Test::NoWarnings;
use pf::constants qw($TRUE $FALSE);
use_ok("pf::ssl");
my $ss_test_cert = <<EOF;
-----BEGIN CERTIFICATE-----
MIIDtzCCAp+gAwIBAgIJAI/Np4F2VCuoMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNV
BAYTAk1YMRIwEAYDVQQIDAlDdWNhcmFjaGExGzAZBgNVBAcMElZpbGxhIGRlIGxv
cyBUYWNvczEVMBMGA1UECgwMWmFtbWl0b2NvcnBvMRswGQYDVQQDDBJwZi56YW1t
aXRvY29ycG8ubXgwHhcNMTkwMjA1MTg0ODEzWhcNMjkwMjAyMTg0ODEzWjByMQsw
CQYDVQQGEwJNWDESMBAGA1UECAwJQ3VjYXJhY2hhMRswGQYDVQQHDBJWaWxsYSBk
ZSBsb3MgVGFjb3MxFTATBgNVBAoMDFphbW1pdG9jb3JwbzEbMBkGA1UEAwwScGYu
emFtbWl0b2NvcnBvLm14MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
uC2v1nHDcnv75xD18rqlEGIZqr/oU5rZhLPKqHZe7icnucKu7D6e8A8L91uRZemd
OU9OF8ZjyoD1Fto8fK3jBKHgYldozOdC90xJwo+OZlQppTqFBacW1bCEUVx1B6nE
44JU96H9nJapK5tHBRz7zVm6iQM8ceQ+Tzqz57THwrykuRiagpne51xVTNneTSle
7inIUHX26wrGAIPgEN/0bDdqkJJTrvaqGrDw6q3edofSr9QJahMQ95qRyNrH7k/7
/7xyho8+oaWgTzq2fZov5OPhtHPC0cq5dWe4Y9fHK6caOvQj+FwBU/EIYdHv8jxM
LQWQ++OiT9Lnu8egw3u+dQIDAQABo1AwTjAdBgNVHQ4EFgQUJKrp5BqOrZpxxS7V
J/1Lh5pBHewwHwYDVR0jBBgwFoAUJKrp5BqOrZpxxS7VJ/1Lh5pBHewwDAYDVR0T
BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAACHXyeGrCg6tiOCQAbOvY1cNZQj1
6AksrRFB004H0S1970oXs9TaTdY8ZvYDOKlOIJVouAYcisjnWxtqbZnmesGm5jQN
9dhQ48pchh3ofuUSnbNY7WEVH2XwZgNBL+NHZCZqbdJ/7KsB/Npa43WSwBmQ8mnO
JH7ycUQKIT1v3ujQ2vXTn4HuUsip9v9zPgE3PRODNpdg9MlpagsckzflKDPSFOfa
j11hLTQ8XuUWCW/yGttu1sNYSyfgAoEaXBVEgW6nzqXQg4FIzWj40Hhhdb6Iy7/R
vQv8nn9VQxP/hBUa6c9FQpUYXq/hP+Oc9IKuyTYpJUYMsYYQIJ2DCn7brg==
-----END CERTIFICATE-----
EOF
my $ss_test_key = <<EOF;
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC4La/WccNye/vn
EPXyuqUQYhmqv+hTmtmEs8qodl7uJye5wq7sPp7wDwv3W5Fl6Z05T04XxmPKgPUW
2jx8reMEoeBiV2jM50L3TEnCj45mVCmlOoUFpxbVsIRRXHUHqcTjglT3of2clqkr
m0cFHPvNWbqJAzxx5D5POrPntMfCvKS5GJqCmd7nXFVM2d5NKV7uKchQdfbrCsYA
g+AQ3/RsN2qQklOu9qoasPDqrd52h9Kv1AlqExD3mpHI2sfuT/v/vHKGjz6hpaBP
OrZ9mi/k4+G0c8LRyrl1Z7hj18crpxo69CP4XAFT8Qhh0e/yPEwtBZD746JP0ue7
x6DDe751AgMBAAECggEAVHjPzwD6bUWkMUQ8KYmlLzBvKTs/aSj6Xry/VCiGPaBD
vhUmeT/3UY71JAwhUaal76UJ4imhlz0yK7sIRv7RwkwkR7ZjYKcotZeNtOh2nUQ4
nYmLfR43gOamqVJIcq1QmjAqnDD1yp3nFRLwrc2vR23B+hk73dibI2d/H+RwQkXO
ehZ7fu01mFyT4HOJiFm0Dc2LsbB+d1aq2wj7qM1lBiL6S9ik7pl7dFEA/TM7+3kn
8BsC/RRKIOp1G2j7n9rPLCh8LLtrHGHsC5yC/adgc7fa739pCUSeDAjAyXgyJz8T
8EKzvaQuQiBAp9Bw+Gx+lmSJHSAan26Wy76KiU0IgQKBgQD1GE1FB4oTOZ6Tmsns
KdAvXs5xzdmn9dcoDnKWFaVhv1RnwV6wGd9Ok4RbYcL9/xKdnIR+IHtRgdnOa2jd
xEvRq8SrtvAG6W7IXknQPFYlOS8ZKV7yMfyyLaMTOkRqQBCkwu0NztRPurKboTbC
Lm1F8dMCSym8/Yg2cl0xKQkZUQKBgQDAX4elOHzkalH7bmAOPqSXNudtempurRI2
UJsr0QKeXU4di5qVke+8kigyAUak/u85mH1Jkg93vNjHz9wceYJO9ZY9FTmp8xLz
JeTnDdrXJsFZRHTdFk+6qDTShXbaCa0EumtzBvgiYFjJUCg6e1FS5Hx4kP+8en+D
H114jCBJ5QKBgHukL87D9+as6Y9ixbxqd4h+Fj0Y8FUn0st1Rl7qOozt/UF+Lis+
UgWMq3eCAOErXRO/kqMh9bPvgpX8X2GIlgsG0OcjGUETX3ya/DedSIPsrhLOaQRb
LTQhi6O2gC7tdLf5UabmkPpLn7CdCke5Lgzb6mu8ySh66c01skeLgPiRAoGBAKbA
J+xnkprMLlQr0MeINVN+HA0h17AoBWlfZaINgp+TcWra4BxWa+ChMIZn5LyQ3vyl
2bQ0D4RTBfXtj3Z/PR0EdD5ub5WJRhvN9STzNYbZ6S9fz4z1EhdSRrdVSTimunsm
vIzwtZXWvh+Cg9xtmIip1dsMlSDjbjRSs8sSa8qhAoGAX+r7dmv5JvcPaLgJGFne
fWnRlqvNhdQQru6q85ZeQvkqYRZ4Sczx6x8rQXsEHKwpE0ZWAcq6qX2Zajzix9Lm
7rqw+7OW4mcArFJERmPGqIhTiwdp+jZ7p66xZbdBe9UzyklJLVaz2HBNjmuIS2AF
8ujPnPuSPIyt9NXAdSdwi9c=
-----END PRIVATE KEY-----
EOF
my $ss_test_key2 = <<EOF;
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAuqrAPqRddzS/0LWuzxpZzEybCu13JMhjZodO35iCEnYa/Wc1
6abeakEw43K/xtw/S3oc1s/osoHUNAXlZrhw1PKIKkwu/EAjswRKI4fBcvHduXwy
BCdIzqk9AOAAmfnUd1ozmdYZ2zB/vVQQbh211Wgn2miR6XcEEdKSHTgaKhdmJ4p8
g8Q6uUN0Ak4geaE3P4vPfamrSDwcivRrUfZkTEXy2RyEnsxWENWKl/3dH0p/1r2x
Fh1TvOoeWAm0aOJAE6NYb+XoZyApEf+ibj84NsySLPu210oZKRf6khu5A3PW7zz+
iWwuwX+fW9dLfqaPbXlrnR2S9xzxsgMgBjpYNwIDAQABAoIBAGbChR53AXUUNtxA
iEE+slyDd36mh0Zagk35AvSYUlKzbdw+KzG7SQmZZb5wdx6UNMvqJ2IiBmnuitEw
xb6snoC8GzWdxufar0xneiDhJR+QAo2Pz0D2F2CdThXjOrGJFOu3Xly7vnQp2Mhz
NLBJ7sXSls3nbxvlBvqAvysSrWSpllrFes2i6/V31St21lZ395Nf+y5vQjHvODl6
3rWe/avLSVHfMHWuDCiH+xqmeCXERNBGziOQd/tRtF9Vr7zlkTPyc9LZEE9Eheng
yOHSjfkTiQO3v6Tt3B3TpXdavReFyEsNckzUo3Wj8Wa3aKTh0SIQXEkbhn/bvR4N
O4qEEZECgYEA+AEpfcwQBLADYwpyRgybFBzPRp9iklboF56AnzLW/LPpI0fABl3m
U4zPmE4ZdFl0AydBAWY+NOxymVQzX0sL/UMX19HJ/Bq3ek24sAQoceFnScmcCrdB
spcgwlmGDpWixmbaqwmLtP/tsEO13NhUvl6UzQcdQ0AKMSbsJr1Lob0CgYEAwK9b
LfP9xLND/ifBRiTi9M4hSkfqerpIm7BbnR2tYZYrlj2AEaA0bt0PPpPY1moZ6BjO
AB8kgXX0tGvcPiLsJL8QQEdHgtM41bguWQOzk+n0mhC+2+5v5+Y439f3tiKU2fmM
eryqne2f57llke147aBfma3xjhdNz2ObSKU47wMCgYEAg+L6Ua/HhPallnHju2TQ
w61efUwde31EB+t+syqyMcjrXpu1fq1I432qmHBQERPRIiwp4bihtDtZ5jhk6XRb
d9/KOjeSlsMOd7gFU3WinI0mBJN2rCwwf+zmuvQo2nCxE5l3CCYXabYAjRA1ErDo
wCRENZRm93CC+wib5S4dnnECgYAdxjsRs8U/8u+Lw3rjKuoDKCMOxmQeSNDVdgAC
HEbhcIIVujUjBB12ECS957y3DTgpnEOg0y8h7ic9BfnHhD/3QaryM9GCDr+Wjtpi
mObT8XABqprDg2m5bOLW/BlkBJ35vM0PXj4DH2f5N7XRQd/Q4FpFdhKAgWtdo6eo
JxfQHwKBgQCi+9I8LkyT8hIOyzvJbe2Jb4P9sp/TSubossXB1PfBt/RroCIulf6c
sQpGiwTln9zsYaL1V8VWHD9xVJVaX0VQw6efke96FaMFq8xT+uXUnBow1HUn2RKs
IlP4belLPpWJwT55VwI6Ihk+IaV+dOTZJhkA7/XkHncRXUNiS32qCA==
-----END RSA PRIVATE KEY-----
EOF
my $rsa = pf::ssl::rsa_from_string($ss_test_key);
is(ref($rsa), "Crypt::OpenSSL::RSA", "rsa_from_string returns a Crypt::OpenSSL::RSA");
my $rsa_bad_cert = pf::ssl::rsa_from_string($ss_test_key2);
is(ref($rsa), "Crypt::OpenSSL::RSA", "rsa_from_string returns a Crypt::OpenSSL::RSA");
my $x509 = pf::ssl::x509_from_string($ss_test_cert);
is(ref($x509), "Crypt::OpenSSL::X509", "x509_from_string returns a Crypt::OpenSSL::X509");
is($x509->subject, "C=MX, ST=Cucaracha, L=Villa de los Tacos, O=Zammitocorpo, CN=pf.zammitocorpo.mx", "certificate has the right subject");
is(pf::ssl::validate_cert_key_match($x509, $rsa), $TRUE, "Cert/key that are matching should match");
{
my ($res, $msg) = pf::ssl::validate_cert_key_match($x509, $rsa_bad_cert);
is($res, $FALSE, "Cert/key that aren't matching shouldn't match");
}
{
my ($res, $inter) = pf::ssl::fetch_all_intermediates($x509);
is(scalar(@$inter), 0, "Self-signed cert shouldn't yield any intermediates");
($res, undef) = pf::ssl::verify_chain($x509, $inter);
is($res, $TRUE, "Self-signed certificate should be a valid chain");
}
my $packetfence_org_cert = <<EOF;
-----BEGIN CERTIFICATE-----
MIIGVzCCBT+gAwIBAgISA3hObDhC0sjQ6D3btc+eq772MA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTAxMTkwOTU1MDlaFw0x
OTA0MTkwOTU1MDlaMBoxGDAWBgNVBAMTD3BhY2tldGZlbmNlLm9yZzCCAiIwDQYJ
KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL82/5rsndzRbZEm3WoDECplQEEKlGRB
l2a5UAsTTq0OcGQ6cwHLYD+FLFgu51wwYuWPjT/bhRiskY/l5oBK0gubLA/6+fOf
rqtnzD5TIhPFjP0COBj0l1O/ZwmPuaw8FjTgHUTwUTQY7hbIZxCMaCGWxOo/Y4CV
zqbN8MYKZMFwzblPTOSFsyl3p/5hFdSCn9iUefCRmzc2/r31mJtiaEBuIwOBEboH
0Ybc5IA8ehOkq047thyQMynkjx01s63iY5sDCtTPKcZPoTbJPONMoSztvil4lVah
rWCseudetkHIcBeNL3U/Fo8rq0RyIAdkTS2OwAevrp+g+S6VHwDil5LL/9uQKC1g
y4KRwTrKtLcwO0+oXpBtF21EO1IEQRuU6NxReO5BftZF7IV7SguqTfe6fV8hUT+B
VsU2kFU1XkzFPgUHjwdtO/uTdbPVpbM9oLqh9rSPY5wl/4dPBOedTnQ/wsoyOT0w
qiroHnjjWtLL+JvPWR7oMRDXqOs5+uwraXjwXM8PI8T7v1YaahHZhnxmF042h6M/
Or6at/7iWENXm7RNNyF1u0lBINgY9mUd9IdPzj6sOvRkGB9w7lvv3JR2U26fIFgl
ggnbAMSNDij6VlwFbPusrz+pVfwiyRbYnnw2T4MhXTcEhZaXjIhg4WHihtZGIZJ5
XpGaUwxoiHnxAgMBAAGjggJlMIICYTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw
FAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFCUL
EObYpNFaRg5mFqYUBYIBjKeKMB8GA1UdIwQYMBaAFKhKamMEfd265tE5t6ZFZe/z
qOyhMG8GCCsGAQUFBwEBBGMwYTAuBggrBgEFBQcwAYYiaHR0cDovL29jc3AuaW50
LXgzLmxldHNlbmNyeXB0Lm9yZzAvBggrBgEFBQcwAoYjaHR0cDovL2NlcnQuaW50
LXgzLmxldHNlbmNyeXB0Lm9yZy8wGgYDVR0RBBMwEYIPcGFja2V0ZmVuY2Uub3Jn
MEwGA1UdIARFMEMwCAYGZ4EMAQIBMDcGCysGAQQBgt8TAQEBMCgwJgYIKwYBBQUH
AgEWGmh0dHA6Ly9jcHMubGV0c2VuY3J5cHQub3JnMIIBBQYKKwYBBAHWeQIEAgSB
9gSB8wDxAHYA4mlLribo6UAJ6IYbtjuD1D7n/nSI+6SPKJMBnd3x2/4AAAFoZcAI
VQAABAMARzBFAiATLYjWgASyQG9Z91lp0VXOuKRggtRtI3MExp2KXUftIgIhAM/Y
bBQyI7YxFuvRAwwlWsN6PkguACuNbwIwCwHgy/noAHcAY/Lbzeg7zCzPC3KEJ1dr
M6SNYXePvXWmOLHHaFRL2I0AAAFoZcAGaQAABAMASDBGAiEA+SVkISEdAv+B3x5y
uCYfnntpLk2HWm9bBn/K/Rcv7PwCIQCMVl8lkvEO1TW+zRars2oMM5tBxCKodwT5
VOJAuagVODANBgkqhkiG9w0BAQsFAAOCAQEAILgClshZb3WOajEAompucIlwaNKS
zo+DXRORIv1gZjqJqbglQhsf1WMM2x8iaCkF6ZC80U12NWe+ihmYKKKoan1aVL9t
HQGec0pjijF4EyXmP5tJj3x8vVzxOqWqmW1x6vaG9LxRQ6vEEqvqLVwZGerfAoFU
X5YdOmKJH1HA9R/w6Ok5jOTBGvxN36VPw0YlBzE3ry6Fg79oscLeusNiGQrn7lwS
xhCotd4ONf45lQeS2ZRP7sk8upAJ001ZRVCYeFrmcikN+M7qTzvzcOK5VKjb6GYZ
qKGW2Exn2hIuVy0bl7qHsX4++PJ3bsyET9tJ7EuXR+n89DM4lkfhCEiZsg==
-----END CERTIFICATE-----
EOF
$x509 = pf::ssl::x509_from_string($packetfence_org_cert);
is(ref($x509), "Crypt::OpenSSL::X509", "x509_from_string returns a Crypt::OpenSSL::X509");
is($x509->subject, "CN=packetfence.org", "certificate has the right subject");
{
my ($res, $inter) = pf::ssl::fetch_all_intermediates($x509);
is(scalar(@$inter), 1, "right amount of intermediates was found");
is($inter->[0]->subject(), "C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3", "right intermediate subject was found");
($res, undef) = pf::ssl::verify_chain($x509, $inter);
is($res, $TRUE, "certificate with a valid chain should be a valid chain");
($res, undef) = pf::ssl::verify_chain($x509, []);
is($res, $FALSE, "certificate with a missing chain shouldn't be a valid chain");
}
=head1 AUTHOR
Inverse inc. <[email protected]>
=head1 COPYRIGHT
Copyright (C) 2005-2020 Inverse inc.
=head1 LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
=cut
1;
| {
"pile_set_name": "Github"
} |
/*
* Thrifty
*
* Copyright (c) Microsoft Corporation
*
* 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
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
* WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE,
* FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
package com.microsoft.thrifty.testing;
public enum ServerTransport {
/**
* A standard blocking socket transport, i.e. TServerTransport.
*/
BLOCKING,
/**
* A framed, non-blocking server socket,i.e. TNonblockingServerTransport.
*/
NON_BLOCKING
}
| {
"pile_set_name": "Github"
} |
Additional IP Rights Grant (Patents)
"This implementation" means the copyrightable works distributed by
Google as part of the Go project.
Google hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section)
patent license to make, have made, use, offer to sell, sell, import,
transfer and otherwise run, modify and propagate the contents of this
implementation of Go, where such license applies only to those patent
claims, both currently owned or controlled by Google and acquired in
the future, licensable by Google that are necessarily infringed by this
implementation of Go. This grant does not include claims that would be
infringed only as a consequence of further modification of this
implementation. If you or your agent or exclusive licensee institute or
order or agree to the institution of patent litigation against any
entity (including a cross-claim or counterclaim in a lawsuit) alleging
that this implementation of Go or any code incorporated within this
implementation of Go constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any patent
rights granted to you under this License for this implementation of Go
shall terminate as of the date such litigation is filed.
| {
"pile_set_name": "Github"
} |
package model
| {
"pile_set_name": "Github"
} |
eta = 0.01;
sigma = 0.5;
n = 2;
A = 0; while (rank(A) < n) A = randn(n,n); end, A = A'*A; % generate rand pos def A
%A = eye(n);
[w1,w2] = ndgrid(linspace(-5,5,20),linspace(-5,5,20));
Y = reshape( sum([w1(:),w2(:)]'.*(A*[w1(:),w2(:)]'),1) , size(w1));
surf(w1,w2,Y);
colormap gray;
w = 4*ones(n,1);
% run reinforce
for i=1:1000
z = sigma*randn(n,1); % Gaussian noise
wn = w - eta*[(w+z)'*A*(w+z) - w'*A*w]*z;
y = w'*A*w; yn = wn'*A*wn;
line([w(1),wn(1)],[w(2),wn(2)],[y,yn]+1,'LineWidth',3,'Color',[1 0 0]);
w = wn;
end
| {
"pile_set_name": "Github"
} |
kx.tjuci.edu.cn
yytjjp.tjuci.edu.cn
hqc.tjuci.edu.cn
twt.tjuci.edu.cn
down.tjuci.edu.cn
wsus.tjuci.edu.cn
jwc.tjuci.edu.cn
lianzheng.tjuci.edu.cn
ztb.tjuci.edu.cn
mail.tjuci.edu.cn
tw.tjuci.edu.cn
ltlx.tjuci.edu.cn
ysx.tjuci.edu.cn
tmx.tjuci.edu.cn
jglxjp.tjuci.edu.cn
jsjjc.tjuci.edu.cn
ky.tjuci.edu.cn
jsjwhk.tjuci.edu.cn
crx.tjuci.edu.cn
lab.tjuci.edu.cn
glx.tjuci.edu.cn
rnx.tjuci.edu.cn
news.tjuci.edu.cn
tyjp.tjuci.edu.cn
cjxg.tjuci.edu.cn
xxgk.tjuci.edu.cn
qljp.tjuci.edu.cn
jcb.tjuci.edu.cn
rsc.tjuci.edu.cn
dcxy.tjuci.edu.cn
dj.tjuci.edu.cn
ghjz.tjuci.edu.cn
tyb.tjuci.edu.cn
my.tjuci.edu.cn
lib.tjuci.edu.cn
cljpk.tjuci.edu.cn
cm.tjuci.edu.cn
gcjg.tjuci.edu.cn
jjc.tjuci.edu.cn
yuanban.tjuci.edu.cn
en.tjuci.edu.cn
master.tjuci.edu.cn
zj.tjuci.edu.cn
wyx.tjuci.edu.cn
clx.tjuci.edu.cn
kyc.tjuci.edu.cn
cjy.tjuci.edu.cn
gwl.tjuci.edu.cn
baoxiu.tjuci.edu.cn
rnxjp.tjuci.edu.cn
recruit.tjuci.edu.cn
www.tjuci.edu.cn
eme.tjuci.edu.cn
center.tjuci.edu.cn
szgcx.tjuci.edu.cn
cwc.tjuci.edu.cn
wsb.tjuci.edu.cn
yjs.tjuci.edu.cn
killvirus.tjuci.edu.cn
keyan.tjuci.edu.cn
grgc.tjuci.edu.cn
tx.tjuci.edu.cn
glxjp.tjuci.edu.cn
sjjp.tjuci.edu.cn
jwcn.tjuci.edu.cn
bwc.tjuci.edu.cn
ei.tjuci.edu.cn
oa.tjuci.edu.cn
freshman.tjuci.edu.cn
hx.tjuci.edu.cn
xcb.tjuci.edu.cn
gh.tjuci.edu.cn
gcrlx.tjuci.edu.cn
skb.tjuci.edu.cn
| {
"pile_set_name": "Github"
} |
// mksyscall_solaris.pl -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build solaris,amd64
package unix
import (
"syscall"
"unsafe"
)
//go:cgo_import_dynamic libc_pipe pipe "libc.so"
//go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so"
//go:cgo_import_dynamic libc_getcwd getcwd "libc.so"
//go:cgo_import_dynamic libc_getgroups getgroups "libc.so"
//go:cgo_import_dynamic libc_setgroups setgroups "libc.so"
//go:cgo_import_dynamic libc_wait4 wait4 "libc.so"
//go:cgo_import_dynamic libc_gethostname gethostname "libc.so"
//go:cgo_import_dynamic libc_utimes utimes "libc.so"
//go:cgo_import_dynamic libc_utimensat utimensat "libc.so"
//go:cgo_import_dynamic libc_fcntl fcntl "libc.so"
//go:cgo_import_dynamic libc_futimesat futimesat "libc.so"
//go:cgo_import_dynamic libc_accept accept "libsocket.so"
//go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so"
//go:cgo_import_dynamic libc___xnet_sendmsg __xnet_sendmsg "libsocket.so"
//go:cgo_import_dynamic libc_acct acct "libc.so"
//go:cgo_import_dynamic libc___makedev __makedev "libc.so"
//go:cgo_import_dynamic libc___major __major "libc.so"
//go:cgo_import_dynamic libc___minor __minor "libc.so"
//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
//go:cgo_import_dynamic libc_poll poll "libc.so"
//go:cgo_import_dynamic libc_access access "libc.so"
//go:cgo_import_dynamic libc_adjtime adjtime "libc.so"
//go:cgo_import_dynamic libc_chdir chdir "libc.so"
//go:cgo_import_dynamic libc_chmod chmod "libc.so"
//go:cgo_import_dynamic libc_chown chown "libc.so"
//go:cgo_import_dynamic libc_chroot chroot "libc.so"
//go:cgo_import_dynamic libc_close close "libc.so"
//go:cgo_import_dynamic libc_creat creat "libc.so"
//go:cgo_import_dynamic libc_dup dup "libc.so"
//go:cgo_import_dynamic libc_dup2 dup2 "libc.so"
//go:cgo_import_dynamic libc_exit exit "libc.so"
//go:cgo_import_dynamic libc_fchdir fchdir "libc.so"
//go:cgo_import_dynamic libc_fchmod fchmod "libc.so"
//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so"
//go:cgo_import_dynamic libc_fchown fchown "libc.so"
//go:cgo_import_dynamic libc_fchownat fchownat "libc.so"
//go:cgo_import_dynamic libc_fdatasync fdatasync "libc.so"
//go:cgo_import_dynamic libc_flock flock "libc.so"
//go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so"
//go:cgo_import_dynamic libc_fstat fstat "libc.so"
//go:cgo_import_dynamic libc_fstatvfs fstatvfs "libc.so"
//go:cgo_import_dynamic libc_getdents getdents "libc.so"
//go:cgo_import_dynamic libc_getgid getgid "libc.so"
//go:cgo_import_dynamic libc_getpid getpid "libc.so"
//go:cgo_import_dynamic libc_getpgid getpgid "libc.so"
//go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so"
//go:cgo_import_dynamic libc_geteuid geteuid "libc.so"
//go:cgo_import_dynamic libc_getegid getegid "libc.so"
//go:cgo_import_dynamic libc_getppid getppid "libc.so"
//go:cgo_import_dynamic libc_getpriority getpriority "libc.so"
//go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so"
//go:cgo_import_dynamic libc_getrusage getrusage "libc.so"
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so"
//go:cgo_import_dynamic libc_getuid getuid "libc.so"
//go:cgo_import_dynamic libc_kill kill "libc.so"
//go:cgo_import_dynamic libc_lchown lchown "libc.so"
//go:cgo_import_dynamic libc_link link "libc.so"
//go:cgo_import_dynamic libc___xnet_llisten __xnet_llisten "libsocket.so"
//go:cgo_import_dynamic libc_lstat lstat "libc.so"
//go:cgo_import_dynamic libc_madvise madvise "libc.so"
//go:cgo_import_dynamic libc_mkdir mkdir "libc.so"
//go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so"
//go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so"
//go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so"
//go:cgo_import_dynamic libc_mknod mknod "libc.so"
//go:cgo_import_dynamic libc_mknodat mknodat "libc.so"
//go:cgo_import_dynamic libc_mlock mlock "libc.so"
//go:cgo_import_dynamic libc_mlockall mlockall "libc.so"
//go:cgo_import_dynamic libc_mprotect mprotect "libc.so"
//go:cgo_import_dynamic libc_msync msync "libc.so"
//go:cgo_import_dynamic libc_munlock munlock "libc.so"
//go:cgo_import_dynamic libc_munlockall munlockall "libc.so"
//go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so"
//go:cgo_import_dynamic libc_open open "libc.so"
//go:cgo_import_dynamic libc_openat openat "libc.so"
//go:cgo_import_dynamic libc_pathconf pathconf "libc.so"
//go:cgo_import_dynamic libc_pause pause "libc.so"
//go:cgo_import_dynamic libc_pread pread "libc.so"
//go:cgo_import_dynamic libc_pwrite pwrite "libc.so"
//go:cgo_import_dynamic libc_read read "libc.so"
//go:cgo_import_dynamic libc_readlink readlink "libc.so"
//go:cgo_import_dynamic libc_rename rename "libc.so"
//go:cgo_import_dynamic libc_renameat renameat "libc.so"
//go:cgo_import_dynamic libc_rmdir rmdir "libc.so"
//go:cgo_import_dynamic libc_lseek lseek "libc.so"
//go:cgo_import_dynamic libc_select select "libc.so"
//go:cgo_import_dynamic libc_setegid setegid "libc.so"
//go:cgo_import_dynamic libc_seteuid seteuid "libc.so"
//go:cgo_import_dynamic libc_setgid setgid "libc.so"
//go:cgo_import_dynamic libc_sethostname sethostname "libc.so"
//go:cgo_import_dynamic libc_setpgid setpgid "libc.so"
//go:cgo_import_dynamic libc_setpriority setpriority "libc.so"
//go:cgo_import_dynamic libc_setregid setregid "libc.so"
//go:cgo_import_dynamic libc_setreuid setreuid "libc.so"
//go:cgo_import_dynamic libc_setrlimit setrlimit "libc.so"
//go:cgo_import_dynamic libc_setsid setsid "libc.so"
//go:cgo_import_dynamic libc_setuid setuid "libc.so"
//go:cgo_import_dynamic libc_shutdown shutdown "libsocket.so"
//go:cgo_import_dynamic libc_stat stat "libc.so"
//go:cgo_import_dynamic libc_statvfs statvfs "libc.so"
//go:cgo_import_dynamic libc_symlink symlink "libc.so"
//go:cgo_import_dynamic libc_sync sync "libc.so"
//go:cgo_import_dynamic libc_times times "libc.so"
//go:cgo_import_dynamic libc_truncate truncate "libc.so"
//go:cgo_import_dynamic libc_fsync fsync "libc.so"
//go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so"
//go:cgo_import_dynamic libc_umask umask "libc.so"
//go:cgo_import_dynamic libc_uname uname "libc.so"
//go:cgo_import_dynamic libc_umount umount "libc.so"
//go:cgo_import_dynamic libc_unlink unlink "libc.so"
//go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so"
//go:cgo_import_dynamic libc_ustat ustat "libc.so"
//go:cgo_import_dynamic libc_utime utime "libc.so"
//go:cgo_import_dynamic libc___xnet_bind __xnet_bind "libsocket.so"
//go:cgo_import_dynamic libc___xnet_connect __xnet_connect "libsocket.so"
//go:cgo_import_dynamic libc_mmap mmap "libc.so"
//go:cgo_import_dynamic libc_munmap munmap "libc.so"
//go:cgo_import_dynamic libc___xnet_sendto __xnet_sendto "libsocket.so"
//go:cgo_import_dynamic libc___xnet_socket __xnet_socket "libsocket.so"
//go:cgo_import_dynamic libc___xnet_socketpair __xnet_socketpair "libsocket.so"
//go:cgo_import_dynamic libc_write write "libc.so"
//go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so"
//go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so"
//go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so"
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
//go:linkname procpipe libc_pipe
//go:linkname procgetsockname libc_getsockname
//go:linkname procGetcwd libc_getcwd
//go:linkname procgetgroups libc_getgroups
//go:linkname procsetgroups libc_setgroups
//go:linkname procwait4 libc_wait4
//go:linkname procgethostname libc_gethostname
//go:linkname procutimes libc_utimes
//go:linkname procutimensat libc_utimensat
//go:linkname procfcntl libc_fcntl
//go:linkname procfutimesat libc_futimesat
//go:linkname procaccept libc_accept
//go:linkname proc__xnet_recvmsg libc___xnet_recvmsg
//go:linkname proc__xnet_sendmsg libc___xnet_sendmsg
//go:linkname procacct libc_acct
//go:linkname proc__makedev libc___makedev
//go:linkname proc__major libc___major
//go:linkname proc__minor libc___minor
//go:linkname procioctl libc_ioctl
//go:linkname procpoll libc_poll
//go:linkname procAccess libc_access
//go:linkname procAdjtime libc_adjtime
//go:linkname procChdir libc_chdir
//go:linkname procChmod libc_chmod
//go:linkname procChown libc_chown
//go:linkname procChroot libc_chroot
//go:linkname procClose libc_close
//go:linkname procCreat libc_creat
//go:linkname procDup libc_dup
//go:linkname procDup2 libc_dup2
//go:linkname procExit libc_exit
//go:linkname procFchdir libc_fchdir
//go:linkname procFchmod libc_fchmod
//go:linkname procFchmodat libc_fchmodat
//go:linkname procFchown libc_fchown
//go:linkname procFchownat libc_fchownat
//go:linkname procFdatasync libc_fdatasync
//go:linkname procFlock libc_flock
//go:linkname procFpathconf libc_fpathconf
//go:linkname procFstat libc_fstat
//go:linkname procFstatvfs libc_fstatvfs
//go:linkname procGetdents libc_getdents
//go:linkname procGetgid libc_getgid
//go:linkname procGetpid libc_getpid
//go:linkname procGetpgid libc_getpgid
//go:linkname procGetpgrp libc_getpgrp
//go:linkname procGeteuid libc_geteuid
//go:linkname procGetegid libc_getegid
//go:linkname procGetppid libc_getppid
//go:linkname procGetpriority libc_getpriority
//go:linkname procGetrlimit libc_getrlimit
//go:linkname procGetrusage libc_getrusage
//go:linkname procGettimeofday libc_gettimeofday
//go:linkname procGetuid libc_getuid
//go:linkname procKill libc_kill
//go:linkname procLchown libc_lchown
//go:linkname procLink libc_link
//go:linkname proc__xnet_llisten libc___xnet_llisten
//go:linkname procLstat libc_lstat
//go:linkname procMadvise libc_madvise
//go:linkname procMkdir libc_mkdir
//go:linkname procMkdirat libc_mkdirat
//go:linkname procMkfifo libc_mkfifo
//go:linkname procMkfifoat libc_mkfifoat
//go:linkname procMknod libc_mknod
//go:linkname procMknodat libc_mknodat
//go:linkname procMlock libc_mlock
//go:linkname procMlockall libc_mlockall
//go:linkname procMprotect libc_mprotect
//go:linkname procMsync libc_msync
//go:linkname procMunlock libc_munlock
//go:linkname procMunlockall libc_munlockall
//go:linkname procNanosleep libc_nanosleep
//go:linkname procOpen libc_open
//go:linkname procOpenat libc_openat
//go:linkname procPathconf libc_pathconf
//go:linkname procPause libc_pause
//go:linkname procPread libc_pread
//go:linkname procPwrite libc_pwrite
//go:linkname procread libc_read
//go:linkname procReadlink libc_readlink
//go:linkname procRename libc_rename
//go:linkname procRenameat libc_renameat
//go:linkname procRmdir libc_rmdir
//go:linkname proclseek libc_lseek
//go:linkname procSelect libc_select
//go:linkname procSetegid libc_setegid
//go:linkname procSeteuid libc_seteuid
//go:linkname procSetgid libc_setgid
//go:linkname procSethostname libc_sethostname
//go:linkname procSetpgid libc_setpgid
//go:linkname procSetpriority libc_setpriority
//go:linkname procSetregid libc_setregid
//go:linkname procSetreuid libc_setreuid
//go:linkname procSetrlimit libc_setrlimit
//go:linkname procSetsid libc_setsid
//go:linkname procSetuid libc_setuid
//go:linkname procshutdown libc_shutdown
//go:linkname procStat libc_stat
//go:linkname procStatvfs libc_statvfs
//go:linkname procSymlink libc_symlink
//go:linkname procSync libc_sync
//go:linkname procTimes libc_times
//go:linkname procTruncate libc_truncate
//go:linkname procFsync libc_fsync
//go:linkname procFtruncate libc_ftruncate
//go:linkname procUmask libc_umask
//go:linkname procUname libc_uname
//go:linkname procumount libc_umount
//go:linkname procUnlink libc_unlink
//go:linkname procUnlinkat libc_unlinkat
//go:linkname procUstat libc_ustat
//go:linkname procUtime libc_utime
//go:linkname proc__xnet_bind libc___xnet_bind
//go:linkname proc__xnet_connect libc___xnet_connect
//go:linkname procmmap libc_mmap
//go:linkname procmunmap libc_munmap
//go:linkname proc__xnet_sendto libc___xnet_sendto
//go:linkname proc__xnet_socket libc___xnet_socket
//go:linkname proc__xnet_socketpair libc___xnet_socketpair
//go:linkname procwrite libc_write
//go:linkname proc__xnet_getsockopt libc___xnet_getsockopt
//go:linkname procgetpeername libc_getpeername
//go:linkname procsetsockopt libc_setsockopt
//go:linkname procrecvfrom libc_recvfrom
var (
procpipe,
procgetsockname,
procGetcwd,
procgetgroups,
procsetgroups,
procwait4,
procgethostname,
procutimes,
procutimensat,
procfcntl,
procfutimesat,
procaccept,
proc__xnet_recvmsg,
proc__xnet_sendmsg,
procacct,
proc__makedev,
proc__major,
proc__minor,
procioctl,
procpoll,
procAccess,
procAdjtime,
procChdir,
procChmod,
procChown,
procChroot,
procClose,
procCreat,
procDup,
procDup2,
procExit,
procFchdir,
procFchmod,
procFchmodat,
procFchown,
procFchownat,
procFdatasync,
procFlock,
procFpathconf,
procFstat,
procFstatvfs,
procGetdents,
procGetgid,
procGetpid,
procGetpgid,
procGetpgrp,
procGeteuid,
procGetegid,
procGetppid,
procGetpriority,
procGetrlimit,
procGetrusage,
procGettimeofday,
procGetuid,
procKill,
procLchown,
procLink,
proc__xnet_llisten,
procLstat,
procMadvise,
procMkdir,
procMkdirat,
procMkfifo,
procMkfifoat,
procMknod,
procMknodat,
procMlock,
procMlockall,
procMprotect,
procMsync,
procMunlock,
procMunlockall,
procNanosleep,
procOpen,
procOpenat,
procPathconf,
procPause,
procPread,
procPwrite,
procread,
procReadlink,
procRename,
procRenameat,
procRmdir,
proclseek,
procSelect,
procSetegid,
procSeteuid,
procSetgid,
procSethostname,
procSetpgid,
procSetpriority,
procSetregid,
procSetreuid,
procSetrlimit,
procSetsid,
procSetuid,
procshutdown,
procStat,
procStatvfs,
procSymlink,
procSync,
procTimes,
procTruncate,
procFsync,
procFtruncate,
procUmask,
procUname,
procumount,
procUnlink,
procUnlinkat,
procUstat,
procUtime,
proc__xnet_bind,
proc__xnet_connect,
procmmap,
procmunmap,
proc__xnet_sendto,
proc__xnet_socket,
proc__xnet_socketpair,
procwrite,
proc__xnet_getsockopt,
procgetpeername,
procsetsockopt,
procrecvfrom syscallFunc
)
func pipe(p *[2]_C_int) (n int, err error) {
r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe)), 1, uintptr(unsafe.Pointer(p)), 0, 0, 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Getcwd(buf []byte) (n int, err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwait4)), 4, uintptr(pid), uintptr(unsafe.Pointer(statusp)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int32(r0)
if e1 != 0 {
err = e1
}
return
}
func gethostname(buf []byte) (n int, err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func utimes(path string, times *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
if e1 != 0 {
err = e1
}
return
}
func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
val = int(r0)
if e1 != 0 {
err = e1
}
return
}
func futimesat(fildes int, path *byte, times *[2]Timeval) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = e1
}
return
}
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func acct(path *byte) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func __makedev(version int, major uint, minor uint) (val uint64) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__makedev)), 3, uintptr(version), uintptr(major), uintptr(minor), 0, 0, 0)
val = uint64(r0)
return
}
func __major(version int, dev uint64) (val uint) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__major)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0)
val = uint(r0)
return
}
func __minor(version int, dev uint64) (val uint) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__minor)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0)
val = uint(r0)
return
}
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpoll)), 3, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Access(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Chdir(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Chmod(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Chown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Chroot(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Close(fd int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Creat(path string, mode uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Dup(fd int) (nfd int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0)
nfd = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Dup2(oldfd int, newfd int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Exit(code int) {
sysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0)
return
}
func Fchdir(fd int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
if e1 != 0 {
err = e1
}
return
}
func Fdatasync(fd int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Flock(fd int, how int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFlock)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)
val = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatvfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Getgid() (gid int) {
r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0)
gid = int(r0)
return
}
func Getpid() (pid int) {
r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0)
pid = int(r0)
return
}
func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0)
pgid = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Getpgrp() (pgid int, err error) {
r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0)
pgid = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Geteuid() (euid int) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0)
euid = int(r0)
return
}
func Getegid() (egid int) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0)
egid = int(r0)
return
}
func Getppid() (ppid int) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0)
ppid = int(r0)
return
}
func Getpriority(which int, who int) (n int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Getuid() (uid int) {
r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0)
uid = int(r0)
return
}
func Kill(pid int, signum syscall.Signal) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Link(path string, link string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(link)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Listen(s int, backlog int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Lstat(path string, stat *Stat_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Madvise(b []byte, advice int) (err error) {
var _p0 *byte
if len(b) > 0 {
_p0 = &b[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMadvise)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(advice), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mkdir(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mkfifo(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mkfifoat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mknod(path string, mode uint32, dev int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mlock(b []byte) (err error) {
var _p0 *byte
if len(b) > 0 {
_p0 = &b[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mlockall(flags int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Mprotect(b []byte, prot int) (err error) {
var _p0 *byte
if len(b) > 0 {
_p0 = &b[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMprotect)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(prot), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Msync(b []byte, flags int) (err error) {
var _p0 *byte
if len(b) > 0 {
_p0 = &b[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMsync)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(flags), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Munlock(b []byte) (err error) {
var _p0 *byte
if len(b) > 0 {
_p0 = &b[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Munlockall() (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Open(path string, mode int, perm uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
fd = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Pathconf(path string, name int) (val int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0)
val = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Pause() (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 *byte
if len(p) > 0 {
_p0 = &p[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 *byte
if len(p) > 0 {
_p0 = &p[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func read(fd int, p []byte) (n int, err error) {
var _p0 *byte
if len(p) > 0 {
_p0 = &p[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Readlink(path string, buf []byte) (n int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
if len(buf) > 0 {
_p1 = &buf[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Rename(from string, to string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(from)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(to)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Rmdir(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)
newoffset = int64(r0)
if e1 != 0 {
err = e1
}
return
}
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSelect)), 5, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
if e1 != 0 {
err = e1
}
return
}
func Setegid(egid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Seteuid(euid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setgid(gid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Sethostname(p []byte) (err error) {
var _p0 *byte
if len(p) > 0 {
_p0 = &p[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Setsid() (pid int, err error) {
r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = e1
}
return
}
func Setuid(uid int) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Shutdown(s int, how int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Stat(path string, stat *Stat_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Statvfs(path string, vfsstat *Statvfs_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStatvfs)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Symlink(path string, link string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(link)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Sync() (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0)
ticks = uintptr(r0)
if e1 != 0 {
err = e1
}
return
}
func Truncate(path string, length int64) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Fsync(fd int) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Umask(mask int) (oldmask int) {
r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0)
oldmask = int(r0)
return
}
func Uname(buf *Utsname) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Unmount(target string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(target)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Unlink(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Unlinkat(dirfd int, path string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func Utime(path string, buf *Utimbuf) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0)
if e1 != 0 {
err = e1
}
return
}
func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
}
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = e1
}
return
}
func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = e1
}
return
}
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = e1
}
return
}
func write(fd int, p []byte) (n int, err error) {
var _p0 *byte
if len(p) > 0 {
_p0 = &p[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = e1
}
return
}
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
if e1 != 0 {
err = e1
}
return
}
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = e1
}
return
}
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 *byte
if len(p) > 0 {
_p0 = &p[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
| {
"pile_set_name": "Github"
} |
//
// impl/io_context.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef NET_TS_IMPL_IO_CONTEXT_HPP
#define NET_TS_IMPL_IO_CONTEXT_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <experimental/__net_ts/detail/completion_handler.hpp>
#include <experimental/__net_ts/detail/executor_op.hpp>
#include <experimental/__net_ts/detail/fenced_block.hpp>
#include <experimental/__net_ts/detail/handler_type_requirements.hpp>
#include <experimental/__net_ts/detail/recycling_allocator.hpp>
#include <experimental/__net_ts/detail/service_registry.hpp>
#include <experimental/__net_ts/detail/throw_error.hpp>
#include <experimental/__net_ts/detail/type_traits.hpp>
#include <experimental/__net_ts/detail/push_options.hpp>
namespace std {
namespace experimental {
namespace net {
inline namespace v1 {
template <typename Service>
inline Service& use_service(io_context& ioc)
{
// Check that Service meets the necessary type requirements.
(void)static_cast<execution_context::service*>(static_cast<Service*>(0));
(void)static_cast<const execution_context::id*>(&Service::id);
return ioc.service_registry_->template use_service<Service>(ioc);
}
template <>
inline detail::io_context_impl& use_service<detail::io_context_impl>(
io_context& ioc)
{
return ioc.impl_;
}
} // inline namespace v1
} // namespace net
} // namespace experimental
} // namespace std
#include <experimental/__net_ts/detail/pop_options.hpp>
#if defined(NET_TS_HAS_IOCP)
# include <experimental/__net_ts/detail/win_iocp_io_context.hpp>
#else
# include <experimental/__net_ts/detail/scheduler.hpp>
#endif
#include <experimental/__net_ts/detail/push_options.hpp>
namespace std {
namespace experimental {
namespace net {
inline namespace v1 {
inline io_context::executor_type
io_context::get_executor() NET_TS_NOEXCEPT
{
return executor_type(*this);
}
#if defined(NET_TS_HAS_CHRONO)
template <typename Rep, typename Period>
std::size_t io_context::run_for(
const chrono::duration<Rep, Period>& rel_time)
{
return this->run_until(chrono::steady_clock::now() + rel_time);
}
template <typename Clock, typename Duration>
std::size_t io_context::run_until(
const chrono::time_point<Clock, Duration>& abs_time)
{
std::size_t n = 0;
while (this->run_one_until(abs_time))
if (n != (std::numeric_limits<std::size_t>::max)())
++n;
return n;
}
template <typename Rep, typename Period>
std::size_t io_context::run_one_for(
const chrono::duration<Rep, Period>& rel_time)
{
return this->run_one_until(chrono::steady_clock::now() + rel_time);
}
template <typename Clock, typename Duration>
std::size_t io_context::run_one_until(
const chrono::time_point<Clock, Duration>& abs_time)
{
typename Clock::time_point now = Clock::now();
while (now < abs_time)
{
typename Clock::duration rel_time = abs_time - now;
if (rel_time > chrono::seconds(1))
rel_time = chrono::seconds(1);
std::error_code ec;
std::size_t s = impl_.wait_one(
static_cast<long>(chrono::duration_cast<
chrono::microseconds>(rel_time).count()), ec);
std::experimental::net::v1::detail::throw_error(ec);
if (s || impl_.stopped())
return s;
now = Clock::now();
}
return 0;
}
#endif // defined(NET_TS_HAS_CHRONO)
inline io_context&
io_context::executor_type::context() const NET_TS_NOEXCEPT
{
return io_context_;
}
inline void
io_context::executor_type::on_work_started() const NET_TS_NOEXCEPT
{
io_context_.impl_.work_started();
}
inline void
io_context::executor_type::on_work_finished() const NET_TS_NOEXCEPT
{
io_context_.impl_.work_finished();
}
template <typename Function, typename Allocator>
void io_context::executor_type::dispatch(
NET_TS_MOVE_ARG(Function) f, const Allocator& a) const
{
typedef typename decay<Function>::type function_type;
// Invoke immediately if we are already inside the thread pool.
if (io_context_.impl_.can_dispatch())
{
// Make a local, non-const copy of the function.
function_type tmp(NET_TS_MOVE_CAST(Function)(f));
detail::fenced_block b(detail::fenced_block::full);
networking_ts_handler_invoke_helpers::invoke(tmp, tmp);
return;
}
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, Allocator, detail::operation> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
p.p = new (p.v) op(NET_TS_MOVE_CAST(Function)(f), a);
NET_TS_HANDLER_CREATION((this->context(), *p.p,
"io_context", &this->context(), 0, "dispatch"));
io_context_.impl_.post_immediate_completion(p.p, false);
p.v = p.p = 0;
}
template <typename Function, typename Allocator>
void io_context::executor_type::post(
NET_TS_MOVE_ARG(Function) f, const Allocator& a) const
{
typedef typename decay<Function>::type function_type;
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, Allocator, detail::operation> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
p.p = new (p.v) op(NET_TS_MOVE_CAST(Function)(f), a);
NET_TS_HANDLER_CREATION((this->context(), *p.p,
"io_context", &this->context(), 0, "post"));
io_context_.impl_.post_immediate_completion(p.p, false);
p.v = p.p = 0;
}
template <typename Function, typename Allocator>
void io_context::executor_type::defer(
NET_TS_MOVE_ARG(Function) f, const Allocator& a) const
{
typedef typename decay<Function>::type function_type;
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, Allocator, detail::operation> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
p.p = new (p.v) op(NET_TS_MOVE_CAST(Function)(f), a);
NET_TS_HANDLER_CREATION((this->context(), *p.p,
"io_context", &this->context(), 0, "defer"));
io_context_.impl_.post_immediate_completion(p.p, true);
p.v = p.p = 0;
}
inline bool
io_context::executor_type::running_in_this_thread() const NET_TS_NOEXCEPT
{
return io_context_.impl_.can_dispatch();
}
inline std::experimental::net::v1::io_context& io_context::service::get_io_context()
{
return static_cast<std::experimental::net::v1::io_context&>(context());
}
} // inline namespace v1
} // namespace net
} // namespace experimental
} // namespace std
#include <experimental/__net_ts/detail/pop_options.hpp>
#endif // NET_TS_IMPL_IO_CONTEXT_HPP
| {
"pile_set_name": "Github"
} |
// Copyright 2016 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.
'use strict';
navigator.serviceWorker.register('empty_service_worker.js')
.then(() => navigator.serviceWorker.ready)
.then(registration => registration.sync.register('foo'))
.then(() => parent.postMessage('registration succeeded', '*'),
() => parent.postMessage('registration failed', '*'));
| {
"pile_set_name": "Github"
} |
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "flannel-server",
"namespace": "kube-system",
"labels": {
"app": "flannel-server",
"version": "v0.1"
}
},
"spec": {
"volumes": [
{
"name": "varlog",
"hostPath": {
"path": "/var/log"
}
},
{
"name": "etcdstorage",
"hostPath": {
"path": "/var/etcd-flannel"
}
},
{
"name": "networkconfig",
"hostPath": {
"path": "/etc/kubernetes/network.json"
}
}
],
"containers": [
{
"name": "flannel-server-helper",
"image": "gcr.io/google_containers/flannel-server-helper:0.1",
"args": [
"--network-config=/etc/kubernetes/network.json",
"--etcd-prefix=/kubernetes.io/network",
"--etcd-server=http://127.0.0.1:{{ etcd_port }}"
],
"volumeMounts": [
{
"name": "networkconfig",
"mountPath": "/etc/kubernetes/network.json"
}
],
"imagePullPolicy": "Always"
},
{
"name": "flannel-container",
"image": "quay.io/coreos/flannel:0.5.5",
"command": [
"/bin/sh",
"-c",
"/opt/bin/flanneld -listen 0.0.0.0:10253 -etcd-endpoints http://127.0.0.1:{{ etcd_port }} -etcd-prefix /kubernetes.io/network 1>>/var/log/flannel_server.log 2>&1"
],
"ports": [
{
"hostPort": 10253,
"containerPort": 10253
}
],
"resources": {
"requests": {
"cpu": {{ cpulimit }}
}
},
"volumeMounts": [
{
"name": "varlog",
"mountPath": "/var/log"
}
]
},
{
"name": "etcd-container",
"image": "gcr.io/google_containers/etcd:2.2.1",
"command": [
"/bin/sh",
"-c",
"/usr/local/bin/etcd --listen-peer-urls http://127.0.0.1:{{ etcd_peer_port }} --addr 127.0.0.1:{{ etcd_port }} --bind-addr 127.0.0.1:{{ etcd_port }} --data-dir /var/etcd-flannel/data 1>>/var/log/etcd_flannel.log 2>&1"
],
"livenessProbe": {
"httpGet": {
"host": "127.0.0.1",
"port": {{ etcd_port }},
"path": "/health"
},
"initialDelaySeconds": 15,
"timeoutSeconds": 15
},
"resources": {
"requests": {
"cpu": {{ cpulimit }}
}
},
"volumeMounts": [
{
"name": "varlog",
"mountPath": "/var/log"
},
{
"name": "etcdstorage",
"mountPath": "/var/etcd-flannel"
}
]
}
],
"hostNetwork": true
}
}
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.isis.persistence.jdo.datanucleus5.metamodel.facets.object.persistencecapable;
import javax.jdo.annotations.IdentityType;
import org.apache.isis.core.metamodel.facets.object.entity.EntityFacet;
/**
* Corresponds to annotating the class with the {@link javax.jdo.annotations.PersistenceCapable} annotation.
*/
public interface JdoPersistenceCapableFacet extends EntityFacet {
IdentityType getIdentityType();
/**
* Corresponds to {@link javax.jdo.annotations.PersistenceCapable#schema()}, or null if not specified.
*/
String getSchema();
/**
* Corresponds to {@link javax.jdo.annotations.PersistenceCapable#table()}, or to the
* class' {@link Class#getSimpleName() simple name} if no table specified.
*/
String getTable();
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Mon Apr 02 19:24:20 PDT 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AsyncByteArrayFeeder (aalto-xml 1.1.0 API)</title>
<meta name="date" content="2018-04-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AsyncByteArrayFeeder (aalto-xml 1.1.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AsyncByteArrayFeeder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../com/fasterxml/aalto/AsyncByteBufferFeeder.html" title="interface in com.fasterxml.aalto"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/fasterxml/aalto/AsyncByteArrayFeeder.html" target="_top">Frames</a></li>
<li><a href="AsyncByteArrayFeeder.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.fasterxml.aalto</div>
<h2 title="Interface AsyncByteArrayFeeder" class="title">Interface AsyncByteArrayFeeder</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html" title="interface in com.fasterxml.aalto">AsyncInputFeeder</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../com/fasterxml/aalto/async/AsyncByteArrayScanner.html" title="class in com.fasterxml.aalto.async">AsyncByteArrayScanner</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">AsyncByteArrayFeeder</span>
extends <a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html" title="interface in com.fasterxml.aalto">AsyncInputFeeder</a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/fasterxml/aalto/AsyncByteArrayFeeder.html#feedInput(byte[],%20int,%20int)">feedInput</a></strong>(byte[] data,
int offset,
int len)</code>
<div class="block">Method that can be called to feed more data, if (and only if)
<a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html#needMoreInput()"><code>AsyncInputFeeder.needMoreInput()</code></a> returns true.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_com.fasterxml.aalto.AsyncInputFeeder">
<!-- -->
</a>
<h3>Methods inherited from interface com.fasterxml.aalto.<a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html" title="interface in com.fasterxml.aalto">AsyncInputFeeder</a></h3>
<code><a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html#endOfInput()">endOfInput</a>, <a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html#needMoreInput()">needMoreInput</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="feedInput(byte[], int, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>feedInput</h4>
<pre>void feedInput(byte[] data,
int offset,
int len)
throws <a href="http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLStreamException.html?is-external=true" title="class or interface in javax.xml.stream">XMLStreamException</a></pre>
<div class="block">Method that can be called to feed more data, if (and only if)
<a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html#needMoreInput()"><code>AsyncInputFeeder.needMoreInput()</code></a> returns true.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - Byte array that containts data to feed: caller must ensure data remains
stable until it is fully processed (which is true when <a href="../../../com/fasterxml/aalto/AsyncInputFeeder.html#needMoreInput()"><code>AsyncInputFeeder.needMoreInput()</code></a>
returns true)</dd><dd><code>offset</code> - Offset within array where input data to process starts</dd><dd><code>len</code> - Length of input data within array to process.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLStreamException.html?is-external=true" title="class or interface in javax.xml.stream">XMLStreamException</a></code> - if the state is such that this method should not be called
(has not yet consumed existing input data, or has been marked as closed)</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AsyncByteArrayFeeder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../com/fasterxml/aalto/AsyncByteBufferFeeder.html" title="interface in com.fasterxml.aalto"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/fasterxml/aalto/AsyncByteArrayFeeder.html" target="_top">Frames</a></li>
<li><a href="AsyncByteArrayFeeder.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2018 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2015 Hippo Seven
~
~ 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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false">
<android.support.v7.widget.CardView
android:id="@+id/swipable"
style="@style/CardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardBackgroundColor="?attr/colorPure">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/keyline_margin_horizontal"
android:paddingRight="@dimen/keyline_margin_horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<include
layout="@layout/item_feed_include"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
| {
"pile_set_name": "Github"
} |
summary: Test the store workflow
systems:
# core20 is not on the Staging Store.
- ubuntu-18.04*
manual: true
environment:
SNAP: dump-hello
SNAP_STORE_MACAROON: "$(HOST: echo ${SNAP_STORE_MACAROON})"
SNAP_STORE_DASHBOARD_ROOT_URL: https://dashboard.staging.snapcraft.io/
UBUNTU_STORE_API_ROOT_URL: https://dashboard.staging.snapcraft.io/dev/api/
UBUNTU_STORE_SEARCH_ROOT_URL: https://api.staging.snapcraft.io/
UBUNTU_STORE_UPLOAD_ROOT_URL: https://upload.apps.staging.ubuntu.com/
UBUNTU_SSO_API_ROOT_URL: https://login.staging.ubuntu.com/api/v2/
prepare: |
# Install the review tools to make sure we do not break anything
# assumed in there.
# TODO: requires running inside $HOME.
# snap install review-tools
#shellcheck source=tests/spread/tools/snapcraft-yaml.sh
. "$TOOLS_DIR/snapcraft-yaml.sh"
# Do not change the test-snapcraft- prefix. Ensure that you
# notify the store team if you need to use a different value when
# working with the production store.
name="test-snapcraft-$(shuf -i 1-1000000000 -n 1)"
set_base "../snaps/$SNAP/snap/snapcraft.yaml"
set_name "../snaps/$SNAP/snap/snapcraft.yaml" "${name}"
set_grade "../snaps/$SNAP/snap/snapcraft.yaml" stable
# Build what we have and verify the snap runs as expected.
cd "../snaps/$SNAP"
snapcraft
restore: |
cd "../snaps/$SNAP"
snapcraft clean
rm -f ./*.snap
#shellcheck source=tests/spread/tools/snapcraft-yaml.sh
. "$TOOLS_DIR/snapcraft-yaml.sh"
restore_yaml "snap/snapcraft.yaml"
execute: |
# Get information about our snap.
cd "../snaps/$SNAP"
snap_file=$(ls ./*.snap)
snap_name=$(grep "name: " snap/snapcraft.yaml | sed -e "s/name: \(.*$\)/\1/")
# Login
echo "${SNAP_STORE_MACAROON}" | snapcraft login --with -
# Register
snapcraft register --yes "${snap_name}"
# Take a look at registered snaps.
snapcraft list
# Push and Release
snapcraft upload "${snap_file}" --release edge
# Show revisions
snapcraft list-revisions "${snap_name}"
# Release
snapcraft release "${snap_name}" 1 edge
# Progressive Release
snapcraft release --experimental-progressive-releases --progressive 50 "${snap_name}" 1 candidate
# List tracks
snapcraft list-tracks "${snap_name}"
| {
"pile_set_name": "Github"
} |
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
9D29BADA196C85A600A166C4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D29BAD9196C85A600A166C4 /* AppDelegate.swift */; };
9D29BADC196C85A600A166C4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D29BADB196C85A600A166C4 /* ViewController.swift */; };
9D29BADF196C85A600A166C4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D29BADD196C85A600A166C4 /* Main.storyboard */; };
9D29BAE1196C85A600A166C4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9D29BAE0196C85A600A166C4 /* Images.xcassets */; };
9D29BAED196C85A600A166C4 /* Detecting_Screen_Edge_Pan_GesturesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D29BAEC196C85A600A166C4 /* Detecting_Screen_Edge_Pan_GesturesTests.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
9D29BAE7196C85A600A166C4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9D29BACC196C85A600A166C4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9D29BAD3196C85A600A166C4;
remoteInfo = "Detecting Screen Edge Pan Gestures";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
9D29BAD4196C85A600A166C4 /* Detecting Screen Edge Pan Gestures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Detecting Screen Edge Pan Gestures.app"; sourceTree = BUILT_PRODUCTS_DIR; };
9D29BAD8196C85A600A166C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9D29BAD9196C85A600A166C4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9D29BADB196C85A600A166C4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
9D29BADE196C85A600A166C4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
9D29BAE0196C85A600A166C4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
9D29BAE6196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Detecting Screen Edge Pan GesturesTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
9D29BAEB196C85A600A166C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9D29BAEC196C85A600A166C4 /* Detecting_Screen_Edge_Pan_GesturesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Detecting_Screen_Edge_Pan_GesturesTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
9D29BAD1196C85A600A166C4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9D29BAE3196C85A600A166C4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9D29BACB196C85A600A166C4 = {
isa = PBXGroup;
children = (
9D29BAD6196C85A600A166C4 /* Detecting Screen Edge Pan Gestures */,
9D29BAE9196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests */,
9D29BAD5196C85A600A166C4 /* Products */,
);
sourceTree = "<group>";
};
9D29BAD5196C85A600A166C4 /* Products */ = {
isa = PBXGroup;
children = (
9D29BAD4196C85A600A166C4 /* Detecting Screen Edge Pan Gestures.app */,
9D29BAE6196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
9D29BAD6196C85A600A166C4 /* Detecting Screen Edge Pan Gestures */ = {
isa = PBXGroup;
children = (
9D29BAD9196C85A600A166C4 /* AppDelegate.swift */,
9D29BADB196C85A600A166C4 /* ViewController.swift */,
9D29BADD196C85A600A166C4 /* Main.storyboard */,
9D29BAE0196C85A600A166C4 /* Images.xcassets */,
9D29BAD7196C85A600A166C4 /* Supporting Files */,
);
path = "Detecting Screen Edge Pan Gestures";
sourceTree = "<group>";
};
9D29BAD7196C85A600A166C4 /* Supporting Files */ = {
isa = PBXGroup;
children = (
9D29BAD8196C85A600A166C4 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
9D29BAE9196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests */ = {
isa = PBXGroup;
children = (
9D29BAEC196C85A600A166C4 /* Detecting_Screen_Edge_Pan_GesturesTests.swift */,
9D29BAEA196C85A600A166C4 /* Supporting Files */,
);
path = "Detecting Screen Edge Pan GesturesTests";
sourceTree = "<group>";
};
9D29BAEA196C85A600A166C4 /* Supporting Files */ = {
isa = PBXGroup;
children = (
9D29BAEB196C85A600A166C4 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
9D29BAD3196C85A600A166C4 /* Detecting Screen Edge Pan Gestures */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9D29BAF0196C85A600A166C4 /* Build configuration list for PBXNativeTarget "Detecting Screen Edge Pan Gestures" */;
buildPhases = (
9D29BAD0196C85A600A166C4 /* Sources */,
9D29BAD1196C85A600A166C4 /* Frameworks */,
9D29BAD2196C85A600A166C4 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Detecting Screen Edge Pan Gestures";
productName = "Detecting Screen Edge Pan Gestures";
productReference = 9D29BAD4196C85A600A166C4 /* Detecting Screen Edge Pan Gestures.app */;
productType = "com.apple.product-type.application";
};
9D29BAE5196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9D29BAF3196C85A600A166C4 /* Build configuration list for PBXNativeTarget "Detecting Screen Edge Pan GesturesTests" */;
buildPhases = (
9D29BAE2196C85A600A166C4 /* Sources */,
9D29BAE3196C85A600A166C4 /* Frameworks */,
9D29BAE4196C85A600A166C4 /* Resources */,
);
buildRules = (
);
dependencies = (
9D29BAE8196C85A600A166C4 /* PBXTargetDependency */,
);
name = "Detecting Screen Edge Pan GesturesTests";
productName = "Detecting Screen Edge Pan GesturesTests";
productReference = 9D29BAE6196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
9D29BACC196C85A600A166C4 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Pixolity Ltd.";
TargetAttributes = {
9D29BAD3196C85A600A166C4 = {
CreatedOnToolsVersion = 6.0;
};
9D29BAE5196C85A600A166C4 = {
CreatedOnToolsVersion = 6.0;
TestTargetID = 9D29BAD3196C85A600A166C4;
};
};
};
buildConfigurationList = 9D29BACF196C85A600A166C4 /* Build configuration list for PBXProject "Detecting Screen Edge Pan Gestures" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 9D29BACB196C85A600A166C4;
productRefGroup = 9D29BAD5196C85A600A166C4 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
9D29BAD3196C85A600A166C4 /* Detecting Screen Edge Pan Gestures */,
9D29BAE5196C85A600A166C4 /* Detecting Screen Edge Pan GesturesTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
9D29BAD2196C85A600A166C4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9D29BADF196C85A600A166C4 /* Main.storyboard in Resources */,
9D29BAE1196C85A600A166C4 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9D29BAE4196C85A600A166C4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
9D29BAD0196C85A600A166C4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9D29BADC196C85A600A166C4 /* ViewController.swift in Sources */,
9D29BADA196C85A600A166C4 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9D29BAE2196C85A600A166C4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9D29BAED196C85A600A166C4 /* Detecting_Screen_Edge_Pan_GesturesTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
9D29BAE8196C85A600A166C4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9D29BAD3196C85A600A166C4 /* Detecting Screen Edge Pan Gestures */;
targetProxy = 9D29BAE7196C85A600A166C4 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
9D29BADD196C85A600A166C4 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
9D29BADE196C85A600A166C4 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
9D29BAEE196C85A600A166C4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
9D29BAEF196C85A600A166C4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
9D29BAF1196C85A600A166C4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
INFOPLIST_FILE = "Detecting Screen Edge Pan Gestures/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
9D29BAF2196C85A600A166C4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
INFOPLIST_FILE = "Detecting Screen Edge Pan Gestures/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
9D29BAF4196C85A600A166C4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Detecting Screen Edge Pan Gestures.app/Detecting Screen Edge Pan Gestures";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "Detecting Screen Edge Pan GesturesTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
};
name = Debug;
};
9D29BAF5196C85A600A166C4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Detecting Screen Edge Pan Gestures.app/Detecting Screen Edge Pan Gestures";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
INFOPLIST_FILE = "Detecting Screen Edge Pan GesturesTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
9D29BACF196C85A600A166C4 /* Build configuration list for PBXProject "Detecting Screen Edge Pan Gestures" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9D29BAEE196C85A600A166C4 /* Debug */,
9D29BAEF196C85A600A166C4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9D29BAF0196C85A600A166C4 /* Build configuration list for PBXNativeTarget "Detecting Screen Edge Pan Gestures" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9D29BAF1196C85A600A166C4 /* Debug */,
9D29BAF2196C85A600A166C4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9D29BAF3196C85A600A166C4 /* Build configuration list for PBXNativeTarget "Detecting Screen Edge Pan GesturesTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9D29BAF4196C85A600A166C4 /* Debug */,
9D29BAF5196C85A600A166C4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 9D29BACC196C85A600A166C4 /* Project object */;
}
| {
"pile_set_name": "Github"
} |
require('../../modules/es6.date.to-string')
var $toString = Date.prototype.toString;
module.exports = function toString(it){
return $toString.call(it);
}; | {
"pile_set_name": "Github"
} |
package com.ripple.core.coretypes.hash;
import com.ripple.core.coretypes.hash.prefixes.HashPrefix;
import com.ripple.core.coretypes.hash.prefixes.Prefix;
import com.ripple.core.fields.Field;
import com.ripple.core.fields.Hash256Field;
import com.ripple.core.fields.Type;
import com.ripple.core.serialized.BytesSink;
import java.math.BigInteger;
import java.util.TreeMap;
public class Hash256 extends Hash<Hash256> {
public static final BigInteger bookBaseSize = new BigInteger("10000000000000000", 16);
public int divergenceDepth(Hash256 other) {
return divergenceDepth(0, other);
}
public int divergenceDepth(int i, Hash256 other) {
for (; i < 64; i++) {
if (nibblet(i) != other.nibblet(i)) {
break;
}
}
return i;
}
public static class Hash256Map<Value> extends TreeMap<Hash256, Value> {
public Hash256Map(Hash256Map<Value> cache) {
super(cache);
}
public Hash256Map() {
}
}
public static final Hash256 ZERO_256 = new Hash256(new byte[32]);
@Override
public Object toJSON() {
return translate.toJSON(this);
}
@Override
public byte[] toBytes() {
return translate.toBytes(this);
}
@Override
public String toHex() {
return translate.toHex(this);
}
@Override
public void toBytesSink(BytesSink to) {
translate.toBytesSink(this, to);
}
@Override
public Type type() {
return Type.Hash256;
}
public boolean isZero() {
return this == Hash256.ZERO_256 || equals(Hash256.ZERO_256);
}
public boolean isNonZero() {
return !isZero();
}
public static Hash256 fromHex(String s) {
return translate.fromHex(s);
}
public Hash256(byte[] bytes) {
super(bytes, 32);
}
public static Hash256 signingHash(byte[] blob) {
return prefixedHalfSha512(HashPrefix.txSign, blob);
}
public static Hash256 prefixedHalfSha512(Prefix prefix, byte[] blob) {
HalfSha512 messageDigest = HalfSha512.prefixed256(prefix);
messageDigest.update(blob);
return messageDigest.finish();
}
public int nibblet(int depth) {
int byte_ix = depth > 0 ? depth / 2 : 0;
int b = super.hash[byte_ix];
if (depth % 2 == 0) {
b = (b & 0xF0) >> 4;
} else {
b = b & 0x0F;
}
return b;
}
public static class Translator extends HashTranslator<Hash256> {
@Override
public Hash256 newInstance(byte[] b) {
return new Hash256(b);
}
@Override
public int byteWidth() {
return 32;
}
}
public static Translator translate = new Translator();
public static Hash256Field hash256Field(final Field f) {
return new Hash256Field(){ @Override public Field getField() {return f;}};
}
static public Hash256Field LedgerHash = hash256Field(Field.LedgerHash);
static public Hash256Field ParentHash = hash256Field(Field.ParentHash);
static public Hash256Field TransactionHash = hash256Field(Field.TransactionHash);
static public Hash256Field AccountHash = hash256Field(Field.AccountHash);
static public Hash256Field PreviousTxnID = hash256Field(Field.PreviousTxnID);
static public Hash256Field AccountTxnID = hash256Field(Field.AccountTxnID);
static public Hash256Field LedgerIndex = hash256Field(Field.LedgerIndex);
static public Hash256Field WalletLocator = hash256Field(Field.WalletLocator);
static public Hash256Field RootIndex = hash256Field(Field.RootIndex);
static public Hash256Field BookDirectory = hash256Field(Field.BookDirectory);
static public Hash256Field InvoiceID = hash256Field(Field.InvoiceID);
static public Hash256Field Nickname = hash256Field(Field.Nickname);
static public Hash256Field Amendment = hash256Field(Field.Amendment);
static public Hash256Field TicketID = hash256Field(Field.TicketID);
static public Hash256Field hash = hash256Field(Field.hash);
static public Hash256Field index = hash256Field(Field.index);
}
| {
"pile_set_name": "Github"
} |
User-agent: *
Disallow:
| {
"pile_set_name": "Github"
} |
package pflag
import (
"fmt"
"strconv"
"strings"
)
// -- uintSlice Value
type uintSliceValue struct {
value *[]uint
changed bool
}
func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue {
uisv := new(uintSliceValue)
uisv.value = p
*uisv.value = val
return uisv
}
func (s *uintSliceValue) Set(val string) error {
ss := strings.Split(val, ",")
out := make([]uint, len(ss))
for i, d := range ss {
u, err := strconv.ParseUint(d, 10, 0)
if err != nil {
return err
}
out[i] = uint(u)
}
if !s.changed {
*s.value = out
} else {
*s.value = append(*s.value, out...)
}
s.changed = true
return nil
}
func (s *uintSliceValue) Type() string {
return "uintSlice"
}
func (s *uintSliceValue) String() string {
out := make([]string, len(*s.value))
for i, d := range *s.value {
out[i] = fmt.Sprintf("%d", d)
}
return "[" + strings.Join(out, ",") + "]"
}
func uintSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]")
// Empty string would cause a slice with one (empty) entry
if len(val) == 0 {
return []uint{}, nil
}
ss := strings.Split(val, ",")
out := make([]uint, len(ss))
for i, d := range ss {
u, err := strconv.ParseUint(d, 10, 0)
if err != nil {
return nil, err
}
out[i] = uint(u)
}
return out, nil
}
// GetUintSlice returns the []uint value of a flag with the given name.
func (f *FlagSet) GetUintSlice(name string) ([]uint, error) {
val, err := f.getFlagType(name, "uintSlice", uintSliceConv)
if err != nil {
return []uint{}, err
}
return val.([]uint), nil
}
// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string.
// The argument p points to a []uint variable in which to store the value of the flag.
func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) {
f.VarP(newUintSliceValue(value, p), name, "", usage)
}
// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
f.VarP(newUintSliceValue(value, p), name, shorthand, usage)
}
// UintSliceVar defines a uint[] flag with specified name, default value, and usage string.
// The argument p points to a uint[] variable in which to store the value of the flag.
func UintSliceVar(p *[]uint, name string, value []uint, usage string) {
CommandLine.VarP(newUintSliceValue(value, p), name, "", usage)
}
// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage)
}
// UintSlice defines a []uint flag with specified name, default value, and usage string.
// The return value is the address of a []uint variable that stores the value of the flag.
func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint {
p := []uint{}
f.UintSliceVarP(&p, name, "", value, usage)
return &p
}
// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
p := []uint{}
f.UintSliceVarP(&p, name, shorthand, value, usage)
return &p
}
// UintSlice defines a []uint flag with specified name, default value, and usage string.
// The return value is the address of a []uint variable that stores the value of the flag.
func UintSlice(name string, value []uint, usage string) *[]uint {
return CommandLine.UintSliceP(name, "", value, usage)
}
// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
return CommandLine.UintSliceP(name, shorthand, value, usage)
}
| {
"pile_set_name": "Github"
} |
============
Robot Plugin
============
This optional plugin enables Avocado to work with tests originally
written using the `Robot Framework <http://robotframework.org/>`_ API.
To install the Robot plugin from pip, use::
$ sudo pip install avocado-framework-plugin-robot
After installed, you can list/run Robot tests the same way you do with
other types of tests.
To list the tests, execute::
$ avocado list ~/path/to/robot/tests/test.robot
Directories are also accepted. To run the tests, execute::
$ avocado run ~/path/to/robot/tests/test.robot
| {
"pile_set_name": "Github"
} |
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/Message.framework/Message
*/
#import <Message/MFMailDelivery.h>
@class MFSMTPConnection;
@interface MFSMTPDelivery : MFMailDelivery {
MFSMTPConnection *_connection; // 52 = 0x34
}
- (void)dealloc; // 0x39949
- (Class)deliveryClass; // 0x39041
- (void)_openConnection; // 0x398bd
- (id)newMessageWriter; // 0x39779
- (int)deliverMessageData:(id)data toRecipients:(id)recipients; // 0x3905d
@end
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../libc/constant.ALT_DIGITS.html">
</head>
<body>
<p>Redirecting to <a href="../../../../libc/constant.ALT_DIGITS.html">../../../../libc/constant.ALT_DIGITS.html</a>...</p>
<script>location.replace("../../../../libc/constant.ALT_DIGITS.html" + location.search + location.hash);</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
# Capturing Thumbnails from Video Files
===============
How to capture thumbnails from video files
Source: [iOS 8 Swift Programming Cookbook - Chapter 12.4](http://goo.gl/pvRtI8)
| {
"pile_set_name": "Github"
} |
from unittest import TestCase
import pandas as pd
from pytz import UTC
from .test_trading_calendar import ExchangeCalendarTestBase
from trading_calendars.exchange_calendar_xosl import XOSLExchangeCalendar
class XOSLCalendarTestCase(ExchangeCalendarTestBase, TestCase):
answer_key_filename = 'xosl'
calendar_class = XOSLExchangeCalendar
# The XOSL is open from 9:00 am to 4:30 pm.
MAX_SESSION_HOURS = 7.5
def test_all_holidays(self):
all_sessions = self.calendar.all_sessions
expected_holidays = [
pd.Timestamp('2018-01-01', tz=UTC), # New Year's Day
pd.Timestamp('2018-03-29', tz=UTC), # Maundy Thursday
pd.Timestamp('2018-03-30', tz=UTC), # Good Friday
pd.Timestamp('2018-04-02', tz=UTC), # Easter Monday
pd.Timestamp('2018-05-01', tz=UTC), # Labour Day
pd.Timestamp('2018-05-10', tz=UTC), # Ascension Day
pd.Timestamp('2018-05-17', tz=UTC), # Constitution Day
pd.Timestamp('2018-05-21', tz=UTC), # Whit Monday
pd.Timestamp('2018-12-24', tz=UTC), # Christmas Eve
pd.Timestamp('2018-12-25', tz=UTC), # Christmas Day
pd.Timestamp('2018-12-26', tz=UTC), # Boxing Day
pd.Timestamp('2018-12-31', tz=UTC), # New Year's Eve
]
for session_label in expected_holidays:
self.assertNotIn(session_label, all_sessions)
def test_holidays_fall_on_weekend(self):
all_sessions = self.calendar.all_sessions
# Holidays falling on a weekend should not be made up during the week.
expected_sessions = [
# In 2010, Labour Day fell on a Saturday, so the market should be
# open on both the prior Friday and the following Monday.
pd.Timestamp('2010-04-30', tz=UTC),
pd.Timestamp('2010-05-03', tz=UTC),
# In 2015, Constitution Day fell on a Sunday, so the market should
# be open on both the prior Friday and the following Monday.
pd.Timestamp('2015-05-15', tz=UTC),
pd.Timestamp('2015-05-18', tz=UTC),
# In 2010, Christmas fell on a Saturday, meaning Boxing Day fell on
# a Sunday. The market should thus be open on the following Monday.
pd.Timestamp('2010-12-27', tz=UTC),
# In 2017, New Year's Day fell on a Sunday, so the market should be
# open on both the prior Friday and the following Monday.
pd.Timestamp('2016-12-30', tz=UTC),
pd.Timestamp('2017-01-02', tz=UTC),
]
for session_label in expected_sessions:
self.assertIn(session_label, all_sessions)
def test_early_closes(self):
# Starting in 2011, Holy Wednesday should be a half day.
self.assertEqual(
self.calendar.session_close(pd.Timestamp('2010-03-31', tz=UTC)),
pd.Timestamp('2010-03-31 16:20', tz='Europe/Oslo'),
)
self.assertEqual(
self.calendar.session_close(pd.Timestamp('2011-04-20', tz=UTC)),
pd.Timestamp('2011-04-20 13:00', tz='Europe/Oslo'),
)
| {
"pile_set_name": "Github"
} |
(((1_438:0.450004,2_203:0.546961):0.110409,((1_759:0.260367,2_3:0.263064):0.172764,(0_591:0.343596,3_526:0.409899):0.044640):0.376154):0.143857,0_174:0.467184,3_28:0.519080);
| {
"pile_set_name": "Github"
} |
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import PageObject from 'ember-cli-page-object';
import errorFormatterComponent from '../../pages/components/error-formatter';
import { AdapterError } from 'ember-data/adapters/errors';
import FriendlyError from 'code-corps-ember/utils/friendly-error';
let page = PageObject.create(errorFormatterComponent);
moduleForComponent('error-formatter', 'Integration | Component | error formatter', {
integration: true,
beforeEach() {
page.setContext(this);
},
afterEach() {
page.removeContext();
}
});
const mockStripeError = {
error: {
type: 'card_error',
code: 'invalid_expiry_year',
message: "Your card's expiration year is invalid.",
param: 'exp_year'
}
};
test('it formats adapter error properly', function(assert) {
assert.expect(3);
let adapterError = new AdapterError([
{ id: 'INTERNAL_SERVER_ERROR', title: 'First', detail: 'error' },
{ id: 'INTERNAL_SERVER_ERROR', title: 'Second', detail: 'error' }
]);
this.set('error', adapterError);
this.render(hbs`{{error-formatter error=error}}`);
assert.equal(page.errors.length, 2, 'Each error message is rendered');
assert.equal(page.errors.objectAt(0).text, 'First: error', 'First message is rendered');
assert.equal(page.errors.objectAt(1).text, 'Second: error', 'Second message is rendered');
});
test('it formats friendly errors properly', function(assert) {
assert.expect(2);
let friendlyError = new FriendlyError('A friendly error');
this.set('error', friendlyError);
this.render(hbs`{{error-formatter error=error}}`);
assert.equal(page.errors.length, 1, 'Error message is rendered');
assert.equal(page.errors.objectAt(0).text, 'A friendly error', 'Message text is rendered');
});
test('it formats stripe card error properly', function(assert) {
assert.expect(1);
this.set('error', mockStripeError);
this.render(hbs`{{error-formatter error=error}}`);
assert.equal(page.errors.objectAt(0).text, mockStripeError.error.message, 'Message is rendered');
});
test('it displays a default message if the error structure is not supported', function(assert) {
assert.expect(2);
this.set('error', {});
this.render(hbs`{{error-formatter error=error}}`);
assert.equal(page.errors.length, 1, 'Each error message is rendered');
assert.equal(page.errors.objectAt(0).text, 'An unexpected error has occured', 'Default message is rendered');
});
| {
"pile_set_name": "Github"
} |
+00 0
+00 0 D
+01 3600
+02 7200
+02 7200 D
+03 10800
+0330 12600
+04 14400
+0430 16200
+0430 16200 D
+05 18000
+0530 19800
+0545 20700
+06 21600
+0630 23400
+07 25200
+08 28800
+0845 31500
+09 32400
+10 36000
+1030 37800
+11 39600
+11 39600 D
+12 43200
+1245 45900
+13 46800
+13 46800 D
+1345 49500 D
+14 50400
+14 50400 D
-00 0
-01 -3600
-02 -7200
-02 -7200 D
-03 -10800
-03 -10800 D
-04 -14400
-05 -18000
-05 -18000 D
-06 -21600
-07 -25200
-08 -28800
-09 -32400
-0930 -34200
-10 -36000
-11 -39600
-12 -43200
ACDT 37800 D
ACST 34200
ADT -10800 D
AEDT 39600 D
AEST 36000
AKDT -28800 D
AKST -32400
AST -14400
AWST 28800
BST 3600 D
CAT 7200
CDT -14400 D
CDT -18000 D
CEST 7200 D
CET 3600
CST -18000
CST -21600
CST 28800
ChST 36000
EAT 10800
EDT -14400 D
EEST 10800 D
EET 7200
EST -18000
GMT 0
HDT -32400 D
HKT 28800
HST -36000
IDT 10800 D
IST 19800
IST 3600 D
IST 7200
JST 32400
KST 30600
KST 32400
MDT -21600 D
MEST 7200 D
MET 3600
MSK 10800
MST -25200
NDT -9000 D
NST -12600
NZDT 46800 D
NZST 43200
PDT -25200 D
PKT 18000
PST -28800
SAST 7200
SST -39600
UCT 0
UTC 0
WAT 3600
WEST 3600 D
WET 0
WIB 25200
WIT 32400
WITA 28800
| {
"pile_set_name": "Github"
} |
import { BREAKPOINT_SIZES, IS_MOBILE_USER_AGENT } from '../constants';
export const getBreakpointFor = windowWidth => {
return 'xl';
};
export const isMobile = breakpoint => {
if (!breakpoint) {
breakpoint = getBreakpointFor(window.innerWidth);
}
return breakpoint === 'xs' || breakpoint === 'sm' || IS_MOBILE_USER_AGENT;
};
export const isDesktop = breakpoint => !isMobile(breakpoint);
export const isLargeScreen = breakpoint => {
if (!breakpoint) {
breakpoint = getBreakpointFor(window.innerWidth);
}
return breakpoint === 'lg' || breakpoint === 'xl';
};
export const getApproximateWindowHeight = () => {
// Many mobile browsers like Safari do this irritating thing where the window
// height changes depending on whether the "menu" at the bottom is shown or
// not.
//
// Sometimes, you want things based on window height, but you DON'T want them
// jumping around when the user scrolls and that menu shows/hides.
//
// For mobile, though, the window size is almost as large as the screen;
// you can't (yet) have a Safari window open at an arbitrary size.
// So we can just use the screen size for mobile user-agents, to get a static
// approximation of the window size.
//
// WARNING: This always returns a value slightly larger than the available
// window space, so don't use it for things where precision is important.
if (IS_MOBILE_USER_AGENT) {
// I don't know how widely available `window.screen` is, so fall back to
// just using innerHeight
return (window.screen && window.screen.height) || window.innerHeight;
}
// On desktop, we can simply use window.innerHeight. Easy-peasy.
return window.innerHeight;
};
| {
"pile_set_name": "Github"
} |
/**
*
* Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
**/
package lucee.runtime;
import lucee.runtime.type.Objects;
import lucee.runtime.type.scope.Variables;
public interface ComponentScope extends Variables, Objects {
/**
* Returns the value of component.
*
* @return value component
*/
public Component getComponent();
} | {
"pile_set_name": "Github"
} |
// Copyright (C) 2012 von Karman Institute for Fluid Dynamics, Belgium
//
// This software is distributed under the terms of the
// GNU Lesser General Public License version 3 (LGPLv3).
// See doc/lgpl.txt and doc/gpl.txt for the license text.
#ifndef COOLFluiD_Framework_Namespace_hh
#define COOLFluiD_Framework_Namespace_hh
//////////////////////////////////////////////////////////////////////////////
#include "Config/ConfigObject.hh"
#include "Framework/Framework.hh"
//////////////////////////////////////////////////////////////////////////////
namespace COOLFluiD {
namespace Framework {
//////////////////////////////////////////////////////////////////////////////
/// This class describes the names of the singletons that ar activated when
/// this Namespace is entered, thus specifying a sound context for the
/// methods to operate.
/// @author Tiago Quintino
class Framework_API Namespace : public Config::ConfigObject {
public:
/// Defines the Config Option's of this class
/// @param options a OptionList where to add the Option's
static void defineConfigOptions(Config::OptionList& options);
/// Default constructor without arguments
Namespace(const std::string& name);
/// Destructor
~Namespace();
/// Sets the MeshData name associated to this Namespace
/// @param theValue name of MeshData
void setMeshDataName(const std::string& theValue);
/// Gets the MeshData name associated to this Namespace
/// @return name of MeshData
std::string getMeshDataName() const;
/// Sets the PhysicalModel name associated to this Namespace
/// @param theValue name of PhysicalModel
void setPhysicalModelName(const std::string& theValue);
/// Gets the PhysicalModel name associated to this Namespace
/// @return name of PhysicalModel
std::string getPhysicalModelName() const;
/// Sets the type of the PhysicalModel associated to this Namespace
/// @param theValue type of the PhysicalModel
void setPhysicalModelType(const std::string& theValue);
/// Gets the type of the PhysicalModel associated to this Namespace
/// @return name of PhysicalModel
std::string getPhysicalModelType() const;
/// Sets the SubSystemStatus name associated to this Namespace
/// @param theValue name of SubSystemStatus
void setSubSystemStatusName(const std::string& theValue);
/// Gets the SubSystemStatus name associated to this Namespace
/// @return name of SubSystemStatus
std::string getSubSystemStatusName() const;
/// @return the flag indicating if this namespace has to be used for coupling
bool isForCoupling() const {return m_isForCoupling;}
private: // member data
/// MeshData to be activated by this Namespace
std::string m_MeshDataName;
/// Name PhysicalModel to be activated by this Namespace
std::string m_PhysicalModelName;
/// Type of the PhysicalModel to be activated by this Namespace
std::string m_PhysicalModelType;
/// SubSystemStatus to be activated by this Namespace
std::string m_SubSystemStatusName;
/// flag indicating that the namespace has to be used for coupling purposes
bool m_isForCoupling;
}; // end of class Namespace
//////////////////////////////////////////////////////////////////////////////
} // namespace COOLFluiD
} // namespace Framework
//////////////////////////////////////////////////////////////////////////////
// #include "Namespace.ci"
//////////////////////////////////////////////////////////////////////////////
#endif // COOLFluiD_Framework_Namespace_hh
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2012 - 2020 Splice Machine, Inc.
*
* This file is part of Splice Machine.
* Splice Machine is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either
* version 3, or (at your option) any later version.
* Splice Machine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License along with Splice Machine.
* If not, see <http://www.gnu.org/licenses/>.
*/
package com.splicemachine.orc.stream;
import com.splicemachine.orc.checkpoint.LongStreamCheckpoint;
import com.splicemachine.orc.checkpoint.RowGroupDictionaryLengthStreamCheckpoint;
import java.io.IOException;
public class RowGroupDictionaryLengthStream
extends LongStreamV1
{
private int entryCount = -1;
public RowGroupDictionaryLengthStream(OrcInputStream input, boolean signed)
{
super(input, signed);
}
public int getEntryCount()
{
return entryCount;
}
@Override
public Class<RowGroupDictionaryLengthStreamCheckpoint> getCheckpointType()
{
return RowGroupDictionaryLengthStreamCheckpoint.class;
}
@Override
public void seekToCheckpoint(LongStreamCheckpoint checkpoint)
throws IOException
{
super.seekToCheckpoint(checkpoint);
RowGroupDictionaryLengthStreamCheckpoint rowGroupDictionaryLengthStreamCheckpoint = (RowGroupDictionaryLengthStreamCheckpoint) checkpoint;
entryCount = rowGroupDictionaryLengthStreamCheckpoint.getRowGroupDictionarySize();
}
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 1811e84a50fce2d499508e560897172a
timeCreated: 1464866754
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
package example
import scalikejdbc._
object SetupJdbc {
def apply(driver: String, host: String, user: String, password: String): Unit = {
Class.forName(driver)
ConnectionPool.singleton(host, user, password)
}
}
| {
"pile_set_name": "Github"
} |
/**
* borderBottomRightRadius mixin
*/
var borderBottomRightRadius = function borderBottomRightRadius(value) {
value = value || '0';
var numRegex = /\d/gi;
var numWithoutValue = /(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;
if (/^[^, ]*,/.test(value)) {
value = value.replace(/(?:,)(?![^(]*\))/g, '');
}
if (numRegex.test(value)) {
value = value.replace(numWithoutValue, function(match) {
return (match == 0) && match || match + 'px';
});
}
return value;
};
/**
* Syntax property for moz is non-standard
*/
borderBottomRightRadius.result = {
moz: {
property: 'border-radius-bottomright',
}
};
/**
* For which browsers is this mixin specified
*/
borderBottomRightRadius.vendors = ['webkit', 'moz'];
/**
* Append CSS
*/
borderBottomRightRadius.appendCSS = {
all: 'background-clip: padding-box',
webkit: '-webkit-background-clip: padding-box',
moz: '-moz-background-clip: padding'
};
/**
* Export mixin
*/
module.exports = borderBottomRightRadius;
| {
"pile_set_name": "Github"
} |
// MIT License - Copyright (c) Callum McGing
// This file is subject to the terms and conditions defined in
// LICENSE, which is part of this source code package
using System;
using System.Runtime.InteropServices;
namespace LibreLancer.ImUI
{
static class Gtk3
{
public const string LIB="libgtk-3.so.0";
public const string LIB_GLIB = "libgobject-2.0.so.0";
[DllImport(LIB)]
public static extern bool gtk_init_check(IntPtr argc, IntPtr argv);
public const int GTK_FILE_CHOOSER_ACTION_OPEN = 0;
public const int GTK_FILE_CHOOSER_ACTION_SAVE = 1;
public const int GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER = 2;
public const int GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER = 3;
public const int GTK_RESPONSE_CANCEL = -6;
public const int GTK_RESPONSE_ACCEPT = -3;
[DllImport(LIB)]
public static extern IntPtr gtk_file_chooser_dialog_new(
[MarshalAs(UnmanagedType.LPStr)]string title,
IntPtr parent,
int action,
IntPtr ignore);
[DllImport(LIB)]
public static extern int gtk_dialog_run(IntPtr dialog);
[DllImport(LIB)]
public static extern bool gtk_events_pending();
[DllImport(LIB)]
public static extern void gtk_main_iteration();
[DllImport(LIB)]
public static extern void gtk_widget_destroy(IntPtr widget);
[DllImport(LIB)]
public static extern void gtk_widget_show(IntPtr widget);
[DllImport(LIB)]
public static extern void gtk_dialog_add_button(IntPtr dialog, [MarshalAs(UnmanagedType.LPStr)]string button_text, int response_id);
[DllImport(LIB)]
public static extern IntPtr gtk_file_chooser_get_filename(IntPtr chooser);
[DllImport(LIB)]
public static extern void gtk_window_set_keep_above(IntPtr window, bool value);
[DllImport(LIB)]
public static extern void gtk_window_present(IntPtr window);
[DllImport(LIB_GLIB)]
public static extern void g_signal_connect_data(IntPtr instance, string detailed_signal,
IntPtr c_handler, IntPtr data, IntPtr destroy_data,
int connect_flags);
[DllImport(LIB)]
static extern IntPtr gtk_file_filter_new();
[DllImport(LIB)]
static extern void gtk_file_filter_set_name(IntPtr filter, string str);
[DllImport(LIB)]
static extern void gtk_file_filter_add_pattern(IntPtr filter, string pattern);
[DllImport(LIB)]
static extern void gtk_file_chooser_add_filter(IntPtr chooser, IntPtr filter);
static IntPtr ptr;
static Delegate del;
static int response;
static bool running;
public static int gtk_dialog_run_HACK(IntPtr dlg)
{
if(del == null) {
del = (Action<IntPtr,int,IntPtr>)run_response_handler;
ptr = Marshal.GetFunctionPointerForDelegate(del);
}
gtk_widget_show(dlg);
g_signal_connect_data(dlg, "response", ptr, IntPtr.Zero, IntPtr.Zero, 0);
const int DO_ITERATIONS = 4;
int iterations = 0;
running = true;
response = 0;
while (running)
{
//BIG HACK to stop Gtk filechooser from appearing below
if (iterations == (DO_ITERATIONS -1)) {
gtk_window_set_keep_above(dlg, true);
iterations++;
} else if (iterations == DO_ITERATIONS) {
gtk_window_set_keep_above(dlg, false);
iterations++;
}
else if (iterations < DO_ITERATIONS)
iterations++;
while (gtk_events_pending())
gtk_main_iteration();
System.Threading.Thread.Sleep(0);
}
return response;
}
static void run_response_handler(IntPtr dialog, int response_id, IntPtr data)
{
response = response_id;
running = false;
}
static void SetFilters(IntPtr dlg, FileDialogFilters filters)
{
if (filters == null) return;
foreach (var managed in filters.Filters)
{
var f = gtk_file_filter_new();
gtk_file_filter_set_name(f, managed.Name);
foreach (var ext in managed.Extensions)
gtk_file_filter_add_pattern(f, ext.Contains(".") ? ext : "*." + ext);
gtk_file_chooser_add_filter(dlg, f);
}
//Add wildcards
var wc = gtk_file_filter_new();
gtk_file_filter_set_name(wc, "*.*");
gtk_file_filter_add_pattern(wc, "*");
gtk_file_chooser_add_filter(dlg, wc);
}
//Logic
public static string GtkOpen(FileDialogFilters filters)
{
if (!gtk_init_check(IntPtr.Zero, IntPtr.Zero))
{
throw new Exception();
}
var dlg = gtk_file_chooser_dialog_new("Open File", IntPtr.Zero,
GTK_FILE_CHOOSER_ACTION_OPEN,
IntPtr.Zero);
gtk_dialog_add_button(dlg, "_Cancel", GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(dlg, "_Accept", GTK_RESPONSE_ACCEPT);
SetFilters(dlg, filters);
string result = null;
if (gtk_dialog_run_HACK(dlg) == GTK_RESPONSE_ACCEPT)
result = UnsafeHelpers.PtrToStringUTF8(gtk_file_chooser_get_filename(dlg));
WaitCleanup();
gtk_widget_destroy(dlg);
WaitCleanup();
return result;
}
public static string GtkFolder()
{
if (!gtk_init_check(IntPtr.Zero, IntPtr.Zero))
throw new Exception();
var dlg = gtk_file_chooser_dialog_new("Open Directory", IntPtr.Zero,
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
IntPtr.Zero);
gtk_dialog_add_button(dlg, "_Cancel", GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(dlg, "_Accept", GTK_RESPONSE_ACCEPT);
string result = null;
if (gtk_dialog_run_HACK(dlg) == GTK_RESPONSE_ACCEPT)
result = UnsafeHelpers.PtrToStringUTF8(gtk_file_chooser_get_filename(dlg));
WaitCleanup();
gtk_widget_destroy(dlg);
WaitCleanup();
return result;
}
public static string GtkSave(FileDialogFilters filters)
{
if (!gtk_init_check(IntPtr.Zero, IntPtr.Zero))
{
throw new Exception();
}
var dlg = gtk_file_chooser_dialog_new("Save File", IntPtr.Zero,
GTK_FILE_CHOOSER_ACTION_SAVE,
IntPtr.Zero);
gtk_dialog_add_button(dlg, "_Cancel", GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(dlg, "_Accept", GTK_RESPONSE_ACCEPT);
SetFilters(dlg, filters);
string result = null;
if (gtk_dialog_run_HACK(dlg) == GTK_RESPONSE_ACCEPT)
result = UnsafeHelpers.PtrToStringUTF8(gtk_file_chooser_get_filename(dlg));
WaitCleanup();
gtk_widget_destroy(dlg);
WaitCleanup();
return result;
}
static void WaitCleanup()
{
while (gtk_events_pending())
gtk_main_iteration();
}
}
}
| {
"pile_set_name": "Github"
} |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2018_07_01.models import *
from .v2019_02_01.models import *
from .v2019_07_01.models import *
from .v2019_11_01.models import *
| {
"pile_set_name": "Github"
} |
/*
Copyright 2014 Alex Dyachenko
This file is part of the MPIR Library.
The MPIR 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 3 of the License, or (at
your option) any later version.
The MPIR 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 MPIR Library. If not, see http://www.gnu.org/licenses/.
*/
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MPIR.Tests.HugeFloatTests
{
/// <summary>
/// tests in this class verify that the correct precision is used when calculating floating point numbers
/// </summary>
[TestClass]
public class Precision
{
[ClassInitialize]
public static void Setup(TestContext context)
{
HugeFloat.DefaultPrecision = 128;
}
[ClassCleanup]
public static void Cleanup()
{
HugeFloat.DefaultPrecision = 64;
}
#region Expression arithmetic
[TestMethod]
public void ExpressionsCalculatedToDestinationPrecision()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(3))
using (var c = new HugeFloat(5))
using (var d = new HugeFloat(a / b + c))
{
Assert.AreEqual("0.5333333333333333333333333333333333333332@1", d.ToString());
d.Reallocate(256);
d.Value = a / b + c;
Assert.AreEqual("0.533333333333333333333333333333333333333333333333333333333333333333333333333333@1", d.ToString());
}
}
[TestMethod]
public void ExpressionsCalculatedToSpecificPrecisionForEquals()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(3))
using (var c = HugeFloat.Allocate(256))
using (var d = HugeFloat.Allocate(256))
{
c.SetTo("12345234589234059823475029384572323452034958723049823408955");
Assert.IsTrue(c.Equals(c + a / b, 128));
Assert.IsFalse(c.Equals(c + a / b, 256));
d.SetTo("12345234589234059823475029384572323452034958723049823408955.333333333333333333333333333333333");
Assert.IsTrue(d.Equals(c + a / b, 256));
Assert.IsTrue(d.Equals(c + a / b, 128));
}
}
[TestMethod]
public void ExpressionHashCodeCalculatedToDefaultPrecision()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("12345234589234059823475029384572323"))
{
ShiftLeftBy62(c);
var cHash = c.GetHashCode();
var expr = a / b + c;
Assert.AreEqual(cHash, expr.GetHashCode());
HugeFloat.DefaultPrecision = 256;
Assert.AreEqual(cHash, c.GetHashCode());
Assert.AreNotEqual(cHash, expr.GetHashCode());
HugeFloat.DefaultPrecision = 128;
}
}
private static void ShiftLeftBy62(HugeFloat c)
{
#if WIN64
c.Value *= 0x4000000000000000L;
#else
c.Value *= 0x80000000;
c.Value *= 0x80000000;
#endif
}
[TestMethod]
public void CompareToCalculatedToDefaultPrecision()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("12345234589234059823475029384572323"))
using (var d = HugeFloat.Allocate(256))
{
ShiftLeftBy62(c);
d.Value = c;
var expr = a / b + c;
Assert.AreEqual(0, c.CompareTo(expr)); //to precision of c
Assert.AreEqual(0, expr.CompareTo(c)); //to precision of c
Assert.IsFalse(expr > c); //to precision of c
Assert.IsTrue(c == expr); //to precision of c
Assert.AreEqual(0, (c + 0).CompareTo(expr)); //to default precision
Assert.AreEqual(0, expr.CompareTo(c + 0)); //to default precision
Assert.IsFalse(expr > c + 0); //to default precision
Assert.IsTrue(c + 0 == expr); //to default precision
HugeFloat.DefaultPrecision = 256;
Assert.AreEqual(0, c.CompareTo(expr)); //to precision of c
Assert.AreEqual(0, expr.CompareTo(c)); //to precision of c
Assert.IsTrue(c == expr); //to precision of c
Assert.IsFalse(expr > c); //to precision of c
Assert.AreEqual(-1, d.CompareTo(expr)); //to precision of d
Assert.AreEqual(1, expr.CompareTo(d)); //to precision of d
Assert.IsFalse(d == expr); //to precision of d
Assert.IsTrue(expr > d); //to precision of d
Assert.AreEqual(-1, (c * 1).CompareTo(expr)); //to default precision
Assert.AreEqual(1, expr.CompareTo(c + 0)); //to default precision
Assert.IsFalse(c + 0 == expr); //to default precision
Assert.IsTrue(expr > c + 0); //to default precision
HugeFloat.DefaultPrecision = 128;
}
}
[TestMethod]
public void CompareToPrimitiveCalculatedToDefaultPrecision()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("12345234589234059823475029384572323"))
using (var d = HugeFloat.Allocate(256))
{
ShiftLeftBy62(c);
d.Value = c;
var expr = a / b + c - c;
Assert.AreEqual(0, Math.Sign(expr.CompareTo(Platform.Si(0, 0))));
Assert.AreEqual(0, Math.Sign(expr.CompareTo(Platform.Ui(0, 0))));
Assert.AreEqual(0, Math.Sign(expr.CompareTo(0.0)));
HugeFloat.DefaultPrecision = 256;
Assert.AreEqual(1, Math.Sign(expr.CompareTo(Platform.Si(0, 0))));
Assert.AreEqual(1, Math.Sign(expr.CompareTo(Platform.Ui(0, 0))));
Assert.AreEqual(1, Math.Sign(expr.CompareTo(0.0)));
HugeFloat.DefaultPrecision = 128;
}
}
[TestMethod]
public void EqualsToPrimitiveCalculatedToDefaultPrecision()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("12345234589234059823475029384572323"))
using (var d = HugeFloat.Allocate(256))
{
ShiftLeftBy62(c);
d.Value = c;
var expr = a / b + c - c;
Assert.IsTrue(expr.Equals(Platform.Si(0, 0)));
Assert.IsTrue(expr.Equals(Platform.Ui(0, 0)));
Assert.IsTrue(expr.Equals(0.0));
HugeFloat.DefaultPrecision = 256;
Assert.IsFalse(expr.Equals(Platform.Si(0, 0)));
Assert.IsFalse(expr.Equals(Platform.Ui(0, 0)));
Assert.IsFalse(expr.Equals(0.0));
HugeFloat.DefaultPrecision = 128;
}
}
[TestMethod]
public void SignCalculatedToDefaultPrecision()
{
using (var a = new HugeFloat(1))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("12345234589234059823475029384572323"))
using (var d = HugeFloat.Allocate(256))
{
ShiftLeftBy62(c);
var expr = (a / b + c) - c;
d.Value = expr;
Assert.AreEqual(0, expr.Sign());
Assert.AreEqual(1, d.Sign());
HugeFloat.DefaultPrecision = 256;
Assert.AreEqual(1, expr.Sign());
Assert.AreEqual(1, d.Sign());
d.Precision = 128;
Assert.AreEqual(1, d.Sign());
d.Value = expr;
Assert.AreEqual(0, d.Sign());
HugeFloat.DefaultPrecision = 128;
}
}
[TestMethod]
public void HugeIntSetToPerformedToDefaultPrecision()
{
using (var a = new HugeFloat(14))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("1234523458923405982347445029384572323"))
using (var d = new HugeInt())
{
ShiftLeftBy62(c);
ShiftLeftBy62(c);
var expr = a / b + c - c;
d.SetTo(expr);
Assert.IsTrue(d == 0);
HugeFloat.DefaultPrecision = 256;
d.SetTo(expr);
Assert.IsTrue(d == 1);
HugeFloat.DefaultPrecision = 128;
}
}
[TestMethod]
public void HugeRationalSetToPerformedToDefaultPrecision()
{
using (var a = new HugeFloat(14))
using (var b = new HugeFloat(13))
using (var c = new HugeFloat("1234523458923405982347445029384572323"))
using (var d = new HugeRational())
{
ShiftLeftBy62(c);
ShiftLeftBy62(c);
var expr = a / b + c - c;
d.SetTo(expr);
Assert.IsTrue(d == 0);
HugeFloat.DefaultPrecision = 256;
d.SetTo(expr);
Assert.IsTrue(d > 1);
Assert.IsTrue(d < 2);
HugeFloat.DefaultPrecision = 128;
}
}
#endregion
}
}
| {
"pile_set_name": "Github"
} |
<code_set_name> JIS_X0201
<comment_char> %
<escape_char> /
% version: 1.0
% alias X0201
CHARMAP
<U0000> /x00 NULL (NUL)
<U0001> /x01 START OF HEADING (SOH)
<U0002> /x02 START OF TEXT (STX)
<U0003> /x03 END OF TEXT (ETX)
<U0004> /x04 END OF TRANSMISSION (EOT)
<U0005> /x05 ENQUIRY (ENQ)
<U0006> /x06 ACKNOWLEDGE (ACK)
<U0007> /x07 BELL (BEL)
<U0008> /x08 BACKSPACE (BS)
<U0009> /x09 CHARACTER TABULATION (HT)
<U000A> /x0a LINE FEED (LF)
<U000B> /x0b LINE TABULATION (VT)
<U000C> /x0c FORM FEED (FF)
<U000D> /x0d CARRIAGE RETURN (CR)
<U000E> /x0e SHIFT OUT (SO)
<U000F> /x0f SHIFT IN (SI)
<U0010> /x10 DATALINK ESCAPE (DLE)
<U0011> /x11 DEVICE CONTROL ONE (DC1)
<U0012> /x12 DEVICE CONTROL TWO (DC2)
<U0013> /x13 DEVICE CONTROL THREE (DC3)
<U0014> /x14 DEVICE CONTROL FOUR (DC4)
<U0015> /x15 NEGATIVE ACKNOWLEDGE (NAK)
<U0016> /x16 SYNCHRONOUS IDLE (SYN)
<U0017> /x17 END OF TRANSMISSION BLOCK (ETB)
<U0018> /x18 CANCEL (CAN)
<U0019> /x19 END OF MEDIUM (EM)
<U001A> /x1a SUBSTITUTE (SUB)
<U001B> /x1b ESCAPE (ESC)
<U001C> /x1c FILE SEPARATOR (IS4)
<U001D> /x1d GROUP SEPARATOR (IS3)
<U001E> /x1e RECORD SEPARATOR (IS2)
<U001F> /x1f UNIT SEPARATOR (IS1)
<U0020> /x20 SPACE
<U0021> /x21 EXCLAMATION MARK
<U0022> /x22 QUOTATION MARK
<U0023> /x23 NUMBER SIGN
<U0024> /x24 DOLLAR SIGN
<U0025> /x25 PERCENT SIGN
<U0026> /x26 AMPERSAND
<U0027> /x27 APOSTROPHE
<U0028> /x28 LEFT PARENTHESIS
<U0029> /x29 RIGHT PARENTHESIS
<U002A> /x2a ASTERISK
<U002B> /x2b PLUS SIGN
<U002C> /x2c COMMA
<U002D> /x2d HYPHEN-MINUS
<U002E> /x2e FULL STOP
<U002F> /x2f SOLIDUS
<U0030> /x30 DIGIT ZERO
<U0031> /x31 DIGIT ONE
<U0032> /x32 DIGIT TWO
<U0033> /x33 DIGIT THREE
<U0034> /x34 DIGIT FOUR
<U0035> /x35 DIGIT FIVE
<U0036> /x36 DIGIT SIX
<U0037> /x37 DIGIT SEVEN
<U0038> /x38 DIGIT EIGHT
<U0039> /x39 DIGIT NINE
<U003A> /x3a COLON
<U003B> /x3b SEMICOLON
<U003C> /x3c LESS-THAN SIGN
<U003D> /x3d EQUALS SIGN
<U003E> /x3e GREATER-THAN SIGN
<U003F> /x3f QUESTION MARK
<U0040> /x40 COMMERCIAL AT
<U0041> /x41 LATIN CAPITAL LETTER A
<U0042> /x42 LATIN CAPITAL LETTER B
<U0043> /x43 LATIN CAPITAL LETTER C
<U0044> /x44 LATIN CAPITAL LETTER D
<U0045> /x45 LATIN CAPITAL LETTER E
<U0046> /x46 LATIN CAPITAL LETTER F
<U0047> /x47 LATIN CAPITAL LETTER G
<U0048> /x48 LATIN CAPITAL LETTER H
<U0049> /x49 LATIN CAPITAL LETTER I
<U004A> /x4a LATIN CAPITAL LETTER J
<U004B> /x4b LATIN CAPITAL LETTER K
<U004C> /x4c LATIN CAPITAL LETTER L
<U004D> /x4d LATIN CAPITAL LETTER M
<U004E> /x4e LATIN CAPITAL LETTER N
<U004F> /x4f LATIN CAPITAL LETTER O
<U0050> /x50 LATIN CAPITAL LETTER P
<U0051> /x51 LATIN CAPITAL LETTER Q
<U0052> /x52 LATIN CAPITAL LETTER R
<U0053> /x53 LATIN CAPITAL LETTER S
<U0054> /x54 LATIN CAPITAL LETTER T
<U0055> /x55 LATIN CAPITAL LETTER U
<U0056> /x56 LATIN CAPITAL LETTER V
<U0057> /x57 LATIN CAPITAL LETTER W
<U0058> /x58 LATIN CAPITAL LETTER X
<U0059> /x59 LATIN CAPITAL LETTER Y
<U005A> /x5a LATIN CAPITAL LETTER Z
<U005B> /x5b LEFT SQUARE BRACKET
<U00A5> /x5c YEN SIGN
<U005D> /x5d RIGHT SQUARE BRACKET
<U005E> /x5e CIRCUMFLEX ACCENT
<U005F> /x5f LOW LINE
<U0060> /x60 GRAVE ACCENT
<U0061> /x61 LATIN SMALL LETTER A
<U0062> /x62 LATIN SMALL LETTER B
<U0063> /x63 LATIN SMALL LETTER C
<U0064> /x64 LATIN SMALL LETTER D
<U0065> /x65 LATIN SMALL LETTER E
<U0066> /x66 LATIN SMALL LETTER F
<U0067> /x67 LATIN SMALL LETTER G
<U0068> /x68 LATIN SMALL LETTER H
<U0069> /x69 LATIN SMALL LETTER I
<U006A> /x6a LATIN SMALL LETTER J
<U006B> /x6b LATIN SMALL LETTER K
<U006C> /x6c LATIN SMALL LETTER L
<U006D> /x6d LATIN SMALL LETTER M
<U006E> /x6e LATIN SMALL LETTER N
<U006F> /x6f LATIN SMALL LETTER O
<U0070> /x70 LATIN SMALL LETTER P
<U0071> /x71 LATIN SMALL LETTER Q
<U0072> /x72 LATIN SMALL LETTER R
<U0073> /x73 LATIN SMALL LETTER S
<U0074> /x74 LATIN SMALL LETTER T
<U0075> /x75 LATIN SMALL LETTER U
<U0076> /x76 LATIN SMALL LETTER V
<U0077> /x77 LATIN SMALL LETTER W
<U0078> /x78 LATIN SMALL LETTER X
<U0079> /x79 LATIN SMALL LETTER Y
<U007A> /x7a LATIN SMALL LETTER Z
<U007B> /x7b LEFT CURLY BRACKET
<U007C> /x7c VERTICAL LINE
<U007D> /x7d RIGHT CURLY BRACKET
<U203E> /x7e OVERLINE
<U007F> /x7f DELETE (DEL)
<U0080> /x80 PADDING CHARACTER (PAD)
<U0081> /x81 HIGH OCTET PRESET (HOP)
<U0082> /x82 BREAK PERMITTED HERE (BPH)
<U0083> /x83 NO BREAK HERE (NBH)
<U0084> /x84 INDEX (IND)
<U0085> /x85 NEXT LINE (NEL)
<U0086> /x86 START OF SELECTED AREA (SSA)
<U0087> /x87 END OF SELECTED AREA (ESA)
<U0088> /x88 CHARACTER TABULATION SET (HTS)
<U0089> /x89 CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
<U008A> /x8a LINE TABULATION SET (VTS)
<U008B> /x8b PARTIAL LINE FORWARD (PLD)
<U008C> /x8c PARTIAL LINE BACKWARD (PLU)
<U008D> /x8d REVERSE LINE FEED (RI)
<U008E> /x8e SINGLE-SHIFT TWO (SS2)
<U008F> /x8f SINGLE-SHIFT THREE (SS3)
<U0090> /x90 DEVICE CONTROL STRING (DCS)
<U0091> /x91 PRIVATE USE ONE (PU1)
<U0092> /x92 PRIVATE USE TWO (PU2)
<U0093> /x93 SET TRANSMIT STATE (STS)
<U0094> /x94 CANCEL CHARACTER (CCH)
<U0095> /x95 MESSAGE WAITING (MW)
<U0096> /x96 START OF GUARDED AREA (SPA)
<U0097> /x97 END OF GUARDED AREA (EPA)
<U0098> /x98 START OF STRING (SOS)
<U0099> /x99 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
<U009A> /x9a SINGLE CHARACTER INTRODUCER (SCI)
<U009B> /x9b CONTROL SEQUENCE INTRODUCER (CSI)
<U009C> /x9c STRING TERMINATOR (ST)
<U009D> /x9d OPERATING SYSTEM COMMAND (OSC)
<U009E> /x9e PRIVACY MESSAGE (PM)
<U009F> /x9f APPLICATION PROGRAM COMMAND (APC)
<U3002> /xa1 IDEOGRAPHIC FULL STOP
<U300C> /xa2 LEFT CORNER BRACKET
<U300D> /xa3 RIGHT CORNER BRACKET
<U3001> /xa4 IDEOGRAPHIC COMMA
<U30FB> /xa5 KATAKANA MIDDLE DOT
<U30F2> /xa6 KATAKANA LETTER WO
<U30A1> /xa7 KATAKANA LETTER SMALL A
<U30A3> /xa8 KATAKANA LETTER SMALL I
<U30A5> /xa9 KATAKANA LETTER SMALL U
<U30A7> /xaa KATAKANA LETTER SMALL E
<U30A9> /xab KATAKANA LETTER SMALL O
<U30E3> /xac KATAKANA LETTER SMALL YA
<U30E5> /xad KATAKANA LETTER SMALL YU
<U30E7> /xae KATAKANA LETTER SMALL YO
<U30C3> /xaf KATAKANA LETTER SMALL TU
<U30FC> /xb0 KATAKANA-HIRAGANA PROLONGED SOUND MARK
<U30A2> /xb1 KATAKANA LETTER A
<U30A4> /xb2 KATAKANA LETTER I
<U30A6> /xb3 KATAKANA LETTER U
<U30A8> /xb4 KATAKANA LETTER E
<U30AA> /xb5 KATAKANA LETTER O
<U30AB> /xb6 KATAKANA LETTER KA
<U30AD> /xb7 KATAKANA LETTER KI
<U30AF> /xb8 KATAKANA LETTER KU
<U30B1> /xb9 KATAKANA LETTER KE
<U30B3> /xba KATAKANA LETTER KO
<U30B5> /xbb KATAKANA LETTER SA
<U30B7> /xbc KATAKANA LETTER SI
<U30B9> /xbd KATAKANA LETTER SU
<U30BB> /xbe KATAKANA LETTER SE
<U30BD> /xbf KATAKANA LETTER SO
<U30BF> /xc0 KATAKANA LETTER TA
<U30C1> /xc1 KATAKANA LETTER TI
<U30C4> /xc2 KATAKANA LETTER TU
<U30C6> /xc3 KATAKANA LETTER TE
<U30C8> /xc4 KATAKANA LETTER TO
<U30CA> /xc5 KATAKANA LETTER NA
<U30CB> /xc6 KATAKANA LETTER NI
<U30CC> /xc7 KATAKANA LETTER NU
<U30CD> /xc8 KATAKANA LETTER NE
<U30CE> /xc9 KATAKANA LETTER NO
<U30CF> /xca KATAKANA LETTER HA
<U30D2> /xcb KATAKANA LETTER HI
<U30D5> /xcc KATAKANA LETTER HU
<U30D8> /xcd KATAKANA LETTER HE
<U30DB> /xce KATAKANA LETTER HO
<U30DE> /xcf KATAKANA LETTER MA
<U30DF> /xd0 KATAKANA LETTER MI
<U30E0> /xd1 KATAKANA LETTER MU
<U30E1> /xd2 KATAKANA LETTER ME
<U30E2> /xd3 KATAKANA LETTER MO
<U30E4> /xd4 KATAKANA LETTER YA
<U30E6> /xd5 KATAKANA LETTER YU
<U30E8> /xd6 KATAKANA LETTER YO
<U30E9> /xd7 KATAKANA LETTER RA
<U30EA> /xd8 KATAKANA LETTER RI
<U30EB> /xd9 KATAKANA LETTER RU
<U30EC> /xda KATAKANA LETTER RE
<U30ED> /xdb KATAKANA LETTER RO
<U30EF> /xdc KATAKANA LETTER WA
<U30F3> /xdd KATAKANA LETTER N
<U309B> /xde KATAKANA-HIRAGANA VOICED SOUND MARK
<U309C> /xdf KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
END CHARMAP
| {
"pile_set_name": "Github"
} |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9d1de2691495b304e9843ac3335b626d, type: 3}
m_Name: body part damage_synth_l_leg_10
m_EditorClassIdentifier:
Variance:
- Frames:
- sprite: {fileID: 21300000, guid: e706f828866bf2143ab6622aef768004, type: 3}
secondDelay: 0
- Frames:
- sprite: {fileID: 21300002, guid: e706f828866bf2143ab6622aef768004, type: 3}
secondDelay: 0
- Frames:
- sprite: {fileID: 21300004, guid: e706f828866bf2143ab6622aef768004, type: 3}
secondDelay: 0
- Frames:
- sprite: {fileID: 21300006, guid: e706f828866bf2143ab6622aef768004, type: 3}
secondDelay: 0
IsPalette: 0
setID: 9805
| {
"pile_set_name": "Github"
} |
package net.glowstone.generator.objects.trees;
import net.glowstone.util.BlockStateDelegate;
import org.bukkit.Location;
import java.util.Random;
public class TallBirchTree extends BirchTree {
public TallBirchTree(Random random, Location location, BlockStateDelegate delegate) {
super(random, location, delegate);
setHeight(height + random.nextInt(7));
}
}
| {
"pile_set_name": "Github"
} |
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.http import urlencode
from horizon import exceptions
from horizon import tables
from openstack_dashboard import api
from ..users.tables import UsersTable
LOG = logging.getLogger(__name__)
class ViewMembersLink(tables.LinkAction):
name = "users"
verbose_name = _("Modify Users")
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
def get_link_url(self, project):
step = 'update_members'
base_url = reverse(self.url, args=[project.id])
param = urlencode({"step": step})
return "?".join([base_url, param])
class UsageLink(tables.LinkAction):
name = "usage"
verbose_name = _("View Usage")
url = "horizon:admin:projects:usage"
classes = ("btn-stats",)
class CreateProject(tables.LinkAction):
name = "create"
verbose_name = _("Create Project")
url = "horizon:admin:projects:create"
classes = ("btn-launch", "ajax-modal",)
def allowed(self, request, project):
return api.keystone.keystone_can_edit_project()
class UpdateProject(tables.LinkAction):
name = "update"
verbose_name = _("Edit Project")
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
def allowed(self, request, project):
return api.keystone.keystone_can_edit_project()
class ModifyQuotas(tables.LinkAction):
name = "quotas"
verbose_name = "Modify Quotas"
url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit")
def get_link_url(self, project):
step = 'update_quotas'
base_url = reverse(self.url, args=[project.id])
param = urlencode({"step": step})
return "?".join([base_url, param])
class DeleteTenantsAction(tables.DeleteAction):
data_type_singular = _("Project")
data_type_plural = _("Projects")
def allowed(self, request, project):
return api.keystone.keystone_can_edit_project()
def delete(self, request, obj_id):
api.keystone.tenant_delete(request, obj_id)
class TenantFilterAction(tables.FilterAction):
def filter(self, table, tenants, filter_string):
""" Really naive case-insensitive search. """
# FIXME(gabriel): This should be smarter. Written for demo purposes.
q = filter_string.lower()
def comp(tenant):
if q in tenant.name.lower():
return True
return False
return filter(comp, tenants)
class TenantsTable(tables.DataTable):
name = tables.Column('name', verbose_name=_('Name'))
description = tables.Column(lambda obj: getattr(obj, 'description', None),
verbose_name=_('Description'))
id = tables.Column('id', verbose_name=_('Project ID'))
enabled = tables.Column('enabled', verbose_name=_('Enabled'), status=True)
class Meta:
name = "tenants"
verbose_name = _("Projects")
row_actions = (ViewMembersLink, UpdateProject, UsageLink,
ModifyQuotas, DeleteTenantsAction)
table_actions = (TenantFilterAction, CreateProject,
DeleteTenantsAction)
class RemoveUserAction(tables.BatchAction):
name = "remove_user"
action_present = _("Remove")
action_past = _("Removed")
data_type_singular = _("User")
data_type_plural = _("Users")
classes = ('btn-danger',)
def action(self, request, user_id):
tenant_id = self.table.kwargs['tenant_id']
api.keystone.remove_tenant_user(request, tenant_id, user_id)
class ProjectUserRolesColumn(tables.Column):
def get_raw_data(self, user):
request = self.table.request
try:
roles = api.keystone.roles_for_user(request,
user.id,
self.table.kwargs["tenant_id"])
except:
roles = []
exceptions.handle(request,
_("Unable to retrieve role information."))
return ", ".join([role.name for role in roles])
class TenantUsersTable(UsersTable):
roles = ProjectUserRolesColumn("roles", verbose_name=_("Roles"))
class Meta:
name = "tenant_users"
verbose_name = _("Users For Project")
table_actions = (RemoveUserAction,)
row_actions = (RemoveUserAction,)
columns = ("name", "email", "id", "roles", "enabled")
class AddUserAction(tables.LinkAction):
name = "add_user"
verbose_name = _("Add To Project")
url = "horizon:admin:projects:add_user"
classes = ('ajax-modal',)
def get_link_url(self, user):
tenant_id = self.table.kwargs['tenant_id']
return reverse(self.url, args=(tenant_id, user.id))
class AddUsersTable(UsersTable):
class Meta:
name = "add_users"
verbose_name = _("Add New Users")
table_actions = ()
row_actions = (AddUserAction,)
columns = ("name", "email", "id", "enabled")
| {
"pile_set_name": "Github"
} |
#!/bin/bash
RESTSDK_VERSION="v2.10.6"
DEFAULT_LIB_DIRECTORY_PATH="."
libDir=${1:-$DEFAULT_LIB_DIRECTORY_PATH}
install_cpprestsdk(){
restsdkDir="$libDir/cpprestsdk"
restsdkBuildDir="$restsdkDir/build.release"
if [ -d "$restsdkDir" ]; then
rm -rf "$restsdkDir"
fi
git clone https://github.com/Microsoft/cpprestsdk.git "$restsdkDir"
(cd $restsdkDir && git checkout tags/$RESTSDK_VERSION -b $RESTSDK_VERSION)
mkdir "$restsdkBuildDir"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
export CXX=g++-4.9
fi
(cd "$restsdkBuildDir" && cmake ../Release -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF)
(cd "$restsdkBuildDir" && make)
}
mkdir -p "$libDir"
install_cpprestsdk
| {
"pile_set_name": "Github"
} |
A
* **advertisal network: rakip ağ**
* **AI: artificial intelligence**
* **accuracy: doğruluk**
* **accuracy score: doğruluk puanı**
* action: eylem
* activation: etkilenim
* **activation function: etkilenim fonksiyonu**
* active: etkin
* **active learning: aktif öğrenme**
* acyclic: çevrimsiz
* adaptation: uyarlama
* additive: eklemeli
* **adversarial: çekişmeli**
* aerodynamics: hava devinim bilimi
* agent: etmen
* agglomerative: birleştirmeli
* algorithm: algoritma
* alignment: hizalama
* allele: eş gen
* analysis: çözümleme
* analytical: çözümsel
* analyzer: çözümleyici
* ancestor: ata
* anchor: çapa
* **anchor box: çapa kutusu**
* and: ve
* anneal: tavlamak
* **annotation: not**
* approximate: yaklaşık
* approximation: yaklaşıklama
* arc: ayrıt
* articulator: eklemleyici
* **artificial: yapay**
* **artificial intelligence: yapay zeka**
* **artificial neural networks: yapay sinir ağları**
* association: ilişkilendirme
* **assertion: iddia**
* attribute: öznitelik
* **attribute based: öznitelik tabanlı**
* **attribute based classifiers: öznitelik tabanlı sınıflayıcı**
* **auditory: işitsel**
* augmented: genişletilmiş
* **augmented reality: artırılmış gerçeklik**
* authentication: kimlik doğrulama
* autoassociator: özilişkilendirici
* **autoencoder: otokodlayıcı**
* automaton: özdevinir
* **autonomous vehicle: otonom araç**
* **axial: eksen**
* axiom: belit
B
* backup: geriye taşıma
* **backbone: omurga**
* **backpropogation: geri yayılım**
* **back propogation: geri yayılım**
* backward: geriye doğru
* **backward propagation: geriye doğru yayılım**
* bag of words: sözcük torbası
* bandit: kollu kumar makinesi
* base: taban
* basis: taban
* basket: sepet
* batch: toptan
* bayesian: bayesçi
* **beam: ışın**
* **beam search: ışın araması**
* belief: inanç
* benchmark: denek
* **best first search: en iyi ilk arama**
* bias: yanlılık
* bias unit: ek girdi
* **big data: büyük veri**
* bin: kutucuk
* binary: ikili
* **binary classification: ikili sınıflandırma**
* **binary cross: ikili capraz**
* **binary cross entropy: ikili capraz entropi**
* binding: değer atama
* binomial: binom
* **block chain: blok zinciri**
* biometrics: biyometri
* blocking: bölükleme
* boolean: mantıksal
* **boosting: yükseltmek**
* bootstrap: rastgele örnekleme
* **boundary: sınır**
* **bounding box: sınırlayıcı kutu**
* branch and bound: dallan ve sınırla
* breadth-first: genişlik öncelikli
* **buffer: tampon**
* bump: tümsek
C
* canonical: asal
* capacity: sığım
* **capsule: kapsül**
* **category: kategori**
* **categorical: kategorik**
* cascade: ardışık
* case-based: örnek tabanlı
* causal: nedensel
* cause: neden
* **cell: hücre**
* central: limit theorem merkezi limit kuramı
* chain: zincir
* **challenge: meydan okuma**
* **channel: kanal**
* chapter: bölüm
* characterize: betimlemek
* **chatbot: sohbot**
* chi-square: ki kare
* city-block distance: şehir içi uzaklık
* class: sınıf
* **classification: sınıflandırma**
* classifier: sınıflandırıcı
* clique: hizip
* cluster: öbek
* **coarse grain: iri taneli**
* code: gizyazı
* codebook: vector gizyazı yöneyi
* **cofinite: sonlu tamamlayıcı**
* **cohort: topluluk**
* **collaborative filtering: işbirlikçi süzme**
* column: sütun
* **color channel: renk kanalı**
* **concatanate: bağlamak**
* **condition: durum**
* combination: birleşim
* competitive: yarışmacı
* complement: tümleyen
* **complex: karmaşık**
* complexity: karmaşıklık
* component: bileşen
* compression: sıkıştırma
* computation: hesaplama
* **computer vision: bilgisayarlı görü**
* **CNN: convolutional neural networks**
* concave: içbükey
* condensed: seyrek
* conditional: independence koşullu bağımsızlık
* confidence: güven+
* confusion matrix: hata dizeyi
* **confusion: karışıklık**
* conjugate: eşlenik
* connected graph: bağlı çizge
* connection: bağlantı
* connectivity: bağlantısallık
* **consequence: netice**
* constant: sabit
* contingency table: olumsallık çizelgesi
* contour: çevrit
* contrast: zıtlık
* **conversational: konuşma**
* **conversational dialogue: konuşma diyaloğu**
* convex: dışbükey
* convolution: evrişim
* **convolutional neural networks: evrişimli sinir ağları**
* cooperative: işbirlikçi
* coordinates: eksen değerleri
* **coronal: koronal**
* **corporate: toplu**
* correction: düzeltme
* correlation: ilinti
* cost: bedel
* **cost function: maliyet fonksiyonu**
* count: sayım
* coupled: bağlı
* covariance: eşdeğişinti
* cover: kapsamak
* credit: assignment sorumluluk atama
* criterion: ölçüt
* criterion: kıstas
* critic: eleştirmen
* cross-entropy: çapraz düzensizlik
* **cross entropy: çapraz düzensizlik**
* cross-validation: çapraz geçerleme
* **cross validation: çapraz geçerleme**
* **cross fold validation: çapraz katman doğrulama**
* cumulative distribution: birikimli dağılım
* curse of dimensionality: çok boyutluluğun laneti
* curvature: eğrilik
* curve: eğri
* cycle: çevrim
D
* **data augmentation: veri artırma**
* **data mining: veri madenciliği**
* **data warehouse: veri ambarı**
* **data science: veri bilimi**
* dataset: veri kümesi
* decay: sönüm
* decision: karar
* decode: gizçözmek
* decoder: gizçözer
* decomposition: ayrışım
* decremental: azalımlı
* **def: python fonksiyon tanımı**
* dendrogram: ağaç çizit
* **dense: yoğun**
* **dense layer: yoğun katman**
* **deep learning: derin öğrenme**
* **deep learning Türkiye: derin öğrenme Türkiye**
* **deep: derin**
* **deep neural network: derin sinir ağı**
* **deep neural networks: derin sinir ağları**
* density: yoğunluk
* **depth: derinlik**
* depth-first: derinlik öncelikli
* descendant: soyundan gelen
* description: betimleme
* **desicion tree: karar ağacı**
* **decision boundary: karar sınırı**
* design: tasarım
* detail: ayrıntı
* detection: sezim
* deterministic: gerekirci
* deviation: sapma
* diagnosis: tanı
* diagnostic: tanısal
* diagonal: köşegen
* diagram: çizem
* dichotomizer: ikili ayırıcı
* diffusion: yayınım
* dilemma: ikilem
* dimension: boyut
* **dimension space: boyut uzayı**
* **dimensional: boyutlu**
* directed: yönlü
* discontinuity: süreksizlik
* discount: indirim
* discrete: kesikli
* discretization: kesiklileştirme
* discriminant: ayırtaç
* **dismiss: reddet**
* **disparity: eşitsizlik**
* distance: uzaklık
* distributed: dağıtık
* distribution: dağılım
* divergence: ıraksama
* diversity: çeşitlilik
* divisive: bölmeli
* document: belge
* dot product: iç çarpım
* doubt: kuşku
* **dropout: seyreltme**
* dual: eşlek
* dummy variable: yapay değişken
* dynamic: devingen
* **dynamic routing: dinamik yönlendirme**
E
* edge: ayrıt
* edit: distance düzeltme uzaklığı
* efficient: etkili
* eigenvector: özyöney
* element: öğe
* eligibility: uygunluk
* eliminate: elemek
* embedding: gömme
* emission: yayım
* empirical: gözlemsel
* encode: gizyazmak
* encoder: gizyazar
* ensemble: küme yada topluluk
* **ensemble model: topluluk modeli**
* **ensemble methods: topluluk metotları**
* entropy: düzensizlik
* environment: ortam
* episode: serüven
* epoch: dönem
* equation: denklem
* error: hata
* error bar: hata çubuğu
* et al: ve ötekiler
* euclidean distance: öklid uzaklığı
* evaluation: değerlendirme
* **evaluation metric: değerlendirme metriği**
* **evaluation metrics: değerlendirme metrikleri**
* evidence: kanıt
* exact: kesin
* example: örnek
* exercise: alıştırma
* exhaustive: kapsayan
* expansion: açılım
* expectation-maximization: beklenti büyütme
* experiment: deney
* expert: uzman
* explaining away: örtbas etmek
* **exploding: patlamak**
* **exploding gradient: patlayan gradyan**
* **explicit regression: açık regresyon**
* **experiment: deney**
* expression: bildirim
* extraction: çıkarım
* extrapolation: dışdeğerleme
F
* **facial recognition: yüz tanıma**
* factor: çarpan veya etken
* factorial: etkensel
* feature: öznitelik
* **feature extraction: özellik çıkarma**
* **feature map: özellik haritası**
* **feature representation: öznitelik temsili**
* **feature selection: öznitelik çıkarımı**
* **feature space: özellik uzayı**
* **feedback: geri bildirim**
* feedforward: ileriye doğru
* figure: şekil
* filter: süzgeç
* **filtering: süzme**
* **fine grained: ince taneli**
* **fine tune: ince ayar**
* finite horizon: sonlu serüven
* fit: oturtma yada uydurma
* **flatten: düzleştirmek**
* flexible: esnek
* floating: kayan
* fold: kat
* forward: ileriye doğru
* **forward propagation: ileriye doğru yayılım**
* **forward pass: doğrudan geçiş**
* **framework: çatı**
* **frame: çerçeve**
* frontal: cepheden
* **full precision: tam hassasiyet**
* function: işlev
* fusion: kaynaştırma
* fuzzy: bulanık
* **fully: tamamen**
G
* **GAN: Generative Adversarial Network**
* **gated recurrent unit: geçitli tekrarlayan ünite**
* generalization: genelleme
* **generated: oluşturulan**
* generative: üretici
* **Generative adversarial: çekişmeli üretici **
* **Generative Adversarial Networks: çekişmeli üretici ağlar**
* **generative learning: üretici öğrenme**
* **generative model: üretici model**
* generic: genel
* geodesic: yerölçümsel
* **global optimum: mutlak en iyi**
* gradient: eğim
* **gradient boosting: gradyan artırma**
* **gradient descent: gradyan inişi**
* **gradient ascent: gradyan çıkışı**
* graph: çizge
* graphical: çizgesel
* greedy: açgözlü
* **ground truth: gerçek referans değer**
* group: öbek
* **GPU: graphic process unit**
H
* **half precision: yarım hassasiyet**
* **handcrafted: el yapımı**
* hard: keskin
* hash table: anahtarlı çizelge
* **heuristic: sezgisel**
* **heuristic search techniques: sezgisel arama teknikleri**
* heuristics: sezgi
* hidden: saklı
* **hidden layer: saklı katman**
* hierarchical: ağaç yapılı
* higher-order: üst düzey
* hinge loss: menteşe yitimi
* hint: ipucu
* histogram: çubuk,çizit
* hybrid: karma
* hyper: üstün
* **hyper parameter: üst değişken**
* **hyperparameter: üst değişken**
* hypothesis: denence
I
* identical: özdeş
* **identity matrix: kimlik matrisi**
* if-then: eğer-ise
* iid: bağımsız ve özdeşçe dağılmış
* ill-posed: kötü konumlanmış
* **image captioning: resim yazısı**
* **image recognition: resim tanıma**
* **imbalanced: dengesiz**
* **implement: uygulamak**
* impurity: katışıklık
* imputation: yükleme
* **inception: basşlangıç**
* incremental: artımlı
* independence: bağımsızlık
* index: dizin
* indicator: gösterge
* induction: kural oluşturma
* inductive bias: model varsayımı
* inference: çıkarsama
* infinite horizon: sonsuz serüven
* influence: etki
* information: bilgi
* inhibition: ketleme
* initial: ilk
* **initialization: başlatma**
* **initializer: başlatıcı**
* inner product: iç çarpım
* input: girdi
* **input feature map: girdi özelliği haritası**
* instance: örnek
* instantiate: somutlaşmak
* **intelligence: zeka**
* interaction: etkileşim
* **intercept: kesişim**
* internal: iç
* interpolate: ara değerlemek
* interpretability: yorumlanabilirlik
* interval: aralık
* invariance: değişmezlik
* isometric: eşölçümsel
* isoprobability: eşolasılık
* item: öğe
* iteration: yineleme
J
* jobshop: sipariş
* joint: birleşik
* **joint space: birleşik alan**
* jump: sıçrama
* junction: kavşak
K
* k fold: k kat
* kernel: çekirdek
* kernelization: çekirdekleme
* k-means: k merkezli
* k-nearest neighbor: en yakın k komşu
* knowledge: bilgi
L
* **label: etiket**
* **landmark: karakteristik nokta**
* **landmarks: karakteristik noktalar**
* **landmark detection: karakteristik nokta saptama**
* latent: saklı
* lateral: yanal
* **latent variable: gizli değişken**
* lattice: kafes
* layer: katman
* leader cluster: önder öbekleme
* leaf: yaprak
* **leaky: sızan**
* **learning rate: öğrenme oranı**
* **least squared error: en küçük kare hatası**
* leave-one-out: birini dışarıda bırak
* level: düzey
* lift of an association rule: etki ilişkilendirme kuralı
* likelihood: olabilirlik
* linear: doğrusal
* **linear regression: doğrusal bağıntı**
* link: bağ
* loading: yükleme
* local: yerel
* **local minimum: yerel minimum**
* **localization: yerini saptama**
* logistic: s biçimli
* **logistic regression: yapısal bağıntı**
* logit: ters s
* **long short term memory: uzun-kısa vadeli bellek**
* **LTSM: long short term memory**
* loop: döngü
* loss: yitim
* **loss function: yitim fonksiyonu**
M
* **machine vision: makine görüsü**
* majority: çoğunluk
* **malign: kötücül**
* **manual: elle yapılan**
* map: harita
* mapping: eşleme
* margin: kenar payı
* marginalize: tümleştirme
* matching: eşleştirme
* matrix: dizey
* maximization: büyütme
* maximum a posteriori map: en büyük sonsal ebs
* maximum likelihood ml: en büyük olabilirlik ebo
* max-product: büyütme çarpma
* mean: ortalama
* **mean average precision: ortalama hassasiyet**
* measure: ölçüt
* mechanism: düzenek
* **machine learning: makine öğrenmesi**
* **ML: Machine Learning**
* meiosis: eşeyli bölünme
* membership: üyelik
* memory: bellek
* message: ileti
* methodology: yöntembilim
* metric: ölçev
* minimization: küçültme
* missing: eksik
* mixture: karışım
* modality: kip
* mode of a density: tepe dağılımı
* model: model
* moralization: ahlaklıla¸stırma
* **multi layer perceptron: çok katmanlı algılayıcı**
* **multi layer: çok katmanlı**
* **multiclass: çok sınıflı***
* **multi class: çok sınıflı**
* **MLP: multi layer perceptron**
* **multi task: çoklu görev**
* **multi task learning: çoklu görev öğrenmesi**
* **music information retrieval: müzik bilgisi alımı**
* multinomial distribution: katlıterimli dağılım
* multiple: çoklu
* multistage: çok aşamalı
* multivariate: çok değişkenli
* mutually: exclusive ayrık
N
* naive: saf
* **natural language processing: doğal dil işleme**
* **nearest neighbour: en yakın komşu**
* **nearest neighbours: en yakın komşular**
* negative: eksi
* network: ağ
* **neural: sinir**
* **neural networks: sinir ağları**
* neuron: sinir hücresi
* node: düğüm
* noise: gürültü
* **nominal: göstermelik**
* nonlinear: doğrusal olmayan
* nonnegative: eksi olmayan
* nonparametric: dağılımdan bağımsız
* norm: büyüklük
* normal: normal
* normalization: normalleştirme
* np-complete: çokterimli zamanda bulunamaz
* nuisance factor: zararlı etken
* null hypothesis: sıfır denencesi
* numeric: sayısal
* **numerical computation: sayısal hesaplama**
O
* oblique: yatık
* **object detection: nesne tanıma**
* observable: gözlenebilir
* observation: gözlem
* occam’s razor: occam’ın usturası
* occluded: örtülü
* offline: çevrimdışı
* off-policy: politikasız
* omnivariate: tüm değişkenli
* one-sided: tek yanlı
* online: çevrimiçi
* on-policy: politikalı
* **open source: açık kaynak**
* optimal: en iyi
* **optimizer: iyileştirici**
* optimization: iyileme
* or: veya
* order of a polynomial: çokterimlinin derecesi
* order statistics: sıra istatistikleri
* **ordinal: sıra**
* origin of axes: eksenlerin sıfır noktası
* **orthogonal: dikey**
* oscillate: salınım
* outcome: sonuç
* outlier: aykırı
* **overfit: aşırı**
* overfitting: aşırı öğrenme
* overtraining: aşırı eğitme
P
* **padding: dolgulama**
* paired: eşli
* pairing: eşleme
* pairwise: ikili
* **paper: akademik alanda makale için kullanılır**
* parallel: koşut
* parametric: dağılıma bağlı
* **parent: ebeveyn**
* parent node: ebeveyn düğüm
* parity: eşlik
* partial: kısmi, kısmen
* **Part-Of-Speech: konuşmanın bölümü**
* passive: edilgen
* path: yol
* pattern: örüntü
* **pattern recognition: örüntü tanıma**
* pedigree: soy
* **penalty: ceza**
* perceptron: algılayıcı
* **perception: algı**
* **parsing: ayrıştırma**
* **personal assistant: kişisel asistan**
* performance: başarım
* **peritumoral: timör çevresi**
* **perplexity: karışıklık**
* phone: sesbirimcik
* phoneme: sesbirim
* phylogenetic tree: soy ağacı
* piecewise: parçalı
* pixel: imge noktası
* **placeholder: yer turucu**
* plasticity: yoğrukluk
* plate: tabaka
* plot: çizim
* plurality: çoğulluk
* policy: politika
* **pooling: örnekleme**
* polychotomizer: çoklu ayırıcı
* polyhedron: çokyüzlü
* polynomial: çokterimli
* polytree: çoklu ağaç
* positive: artı
* positive definite: kesin artı
* positive semidefinite: yarı kesin artı
* posterior: sonsal olasılık
* posthoc: artçı
* postpruning: geç budama
* potential function: gerilim işlevi
* power: üst
* power function: güç işlevi
* precision: kesinlik
* predicate: belirtim
* **predictor: bağımsız değişken**
* prediction: öngörü
* predictive: öngörücü
* **predictive learning: öngörü öğrenme**
* prepruning: erken budama
* **pretrain: ön eğitim**
* primal: asal
* principal: temel
* principle: ilke
* prior: önsel
* probabilistic: olasılıksal
* probability: olasılık
* probably: olası
* procedure: yordam
* projection: izdüşüm
* propagation: yayılım
* propositional rule: önermeli kural
* prototype: asıl örnek
* **proxy: vekil**
* pruning: budama
* pseudocode: örnek program
* purity: saflık
* pursuit: izleme
Q
* quadratic: karesel, ikinci dereceden
* quantization: nicemleme
* query: sorgu
R
* radial: dairesel
* **radial basis function: dairesel tabanlı fonksiyon**
* random: rastgele
* random: rastsal
* **random forest: rastgele değişken**
* **random initialization: rastgele başlatma**
* randomization: rastsalla¸stırma
* range: açıklık
* rank of a matrix: dizeyin kertesi
* rank test: sıra sınaması
* **rate: oran**
* real-time: gerçek zamanlı
* reasoning: akıl yürütme
* recall: duyarlılık
* receiver: alıcı
* **receptive: anlayışlı**
* receptive field: algı alanı
* reciprocal: ters
* recognition: tanıma
* reconstruction: geri çatma
* **rectified linear: doğrultulmuş doğrusal**
* **rectified linear unit: doğrultulmuş doğrusal ünite**
* **RELU: rectified linear unit**
* recurrent: özyineli
* **recurrent neural networks: özyineli sinir ağları**
* recursive: özçağrılı
* redundancy: fazlalık
* reference: dayanak
* references: kaynaklar
* region: alan
* regression: bağlanım
* regressogram: bağlanım çiziti
* regularization: düzenlileştirme
* reinforcement: pekiştirme
* reject: ret
* relative: görece
* relevance: ilgililik
* **remote sensing: uzaktan algılama**
* replication: çoğaltma
* repository: veri tabanı
* **repository pattern: depo örüntüsü**
* representation: gösterim
* **resampling: yeniden örnekleme**
* **research: araştırma**
* residual: artık
* response: tepki
* retrieval: erişim
* reverse engineering: tersine mühendislik
* reward: ödül
* ridge: sırt
* risk: risk
* robust: gürbüz
* **routing-by-agreement: anlaşarak yönlendirme**
* row: satır
* rule: kural
* running: akan
S
* sample: örneklemek veya örneklem
* **sampled: örneklenmiş**
* scalar: sayıl
* scale: ölçek
* scatter: saçılım
* scene: görüntü
* schedule: zaman çizelgesi
* **scrapping: hurdaya ayırmak**
* scree: kayşat
* search: arama
* section: bölüm
* segmentation: bölütleme
* selection: seçim
* **self: öz**
* self-organizing: özörgütlemeli
* **semantic: anlamsal**
* **semantics: anlambilim**
* **semantic segmantation: anlamsal bölümleme**
* semiparametric: dağılıma yarı bağlı
* sensitivity: duyarlılık
* **sentiment: duygusallık**
* sensor: alıcı
* sequence: dizi
* sequential: sırayla
* set: küme
* shaded: gölgeli
* **shallow: sığ**
* share: paylaşmak
* shatter: tuz buz etmek
* short term: kısa soluklu
* sigmoid: işlevi
* sign: işaret
* **signal to noise: gürülti sinyali**
* significance: anlamlılık
* simulation: benzetim
* simultaneous: eş zamanlı
* **single layer neural networks: tek katmanlı algılayıcılar**
* singly connected: tekli bağlı
* singular: tekil
* **skew: eğri**
* **skip connection: bağlantıyı atla**
* slack variable: artık değişken
* smooth: düzleştirme
* smoother: düzleştirici
* soft: eşiksiz
* softmax function: eşiksiz en büyük işlevi
* sort: sıralamak
* **source code: kaynak kod**
* spam: istenmeyen elektronik posta
* span: kapsamak
* sparse: seyrek
* spatial: uzamsal
* specific: özgül
* specificity: özgüllük
* spectral: izgesel
* spectrum: izge
* spline: eğri
* split: bölme
* spread: yayılım
* stable: kararlı
* **stack: yığın**
* **stacked: yığılmış**
* **state of art: güncel olan en iyi durum**
* **standardize: belirli bir forma getirmek**
* **standardization: tek tip yapma**
* stacking: yığma
* **stratified: kat kat olmuş**
* **strided convolution: kademeli evrişim**
* stepsize: adım büyüklüğü
* stimulation: dürtü
* stochastic: rastgele
* **stochastic gradient descent: rasgele gradyan inişi**
* strategy: yordam
* stratification: katmanla¸stırma
* stress: gerilim
* string: dizi
* **stride: adım kaydırma**
* structure: yapı
* stump: ağaççık
* subgraph: alt çizge
* subset: altküme
* subspace: altuzay
* sum-product: toplam çarpım
* **supervised learning: gözetimli öğrenme**
* supervised: gözetimli
* **super resolution: süper çözünürlük**
* support: destek
* **support vector machines: destek vektör makinası**
* surface: yüzey
* switching: geçişli
* **syntax: yazım biçimi**
* symbol: simge
* symmetric: bakı¸sımlı
* symptom: belirti
* synchronization: eşzamanlama
* system: dizge
* **squashing function: sıkıştırma fonksiyonu**
* **SVM: Support vector machine**
T
* table: çizelge
* tangent: teğet
* **task: görev**
* template: şablon
* temporal: zamansal
* term: terim
* terminal: uç
* test: sınama
* **text classification: metin sınıflandırma**
* theory: kuram
* threshold: eşik
* time delay: zaman gecikmeli
* time series: zaman dizisi
* **timeout: zaman aşımı**
* **token: jeton**
* **toggle: geçiş**
* topographic: yerbetimsel
* topological: ilingesel
* **tutorial: eğitim dokümanları**
* **tuning: ayarlama**
* trace: iz
* trade-off: ödünleşim
* **train: eğitim**
* **train set: eğitim seti**
* trajectory: gezinge
* transcribe: çevriyazmak
* **transfer learning: öğrenme aktarması**
* **transform: dönüşüm**
* transition: geçiş
* transpose: devrik
* traveling salesman: gezgin satıcı
* trellis: kafes
* **trending: gidişli**
* two-sided: iki yanlı
U
* unbiased: yansız
* **unbalanced: dengesiz**
* unconstrained: kısıtlanmamış
* underfitting: eksik öğrenme
* unfold: açılmış
* uniform distribution: tekdüze dağılım
* univariate: tek değişkenli
* unobservable: gözlenemeyen
* unsupervised: gözetimsiz
* **unsupervised learning: gözetimsiz öğrenme**
* **up sampling: sık örnekleme**
* utility: fayda
V
* validation: geçerleme
* **validation set: doğrulama seti**
* **validation loss: doğrulama kaybı**
* **vanishing gradient: kaybolan eğim**
* **vanishing: yok olmak**
* variance: değişinti
* variational: değişimsel
* **varius: çeşitli**
* vector: yöney
* version: sürüm
* vigilance: tetiklik
* virtual: sanal
* voting: oylama
* **vulnerability: güvenlik açığı**
W
* weight: ağırlık
* **weight decay: kilo kaybı**
* winner-take-all: kazanan hepsini alır
* **word embedding: kelime gömme**
* wrapper: dürümcü
X
* xor: dışlamalı veya
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>HelloWorld</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app> | {
"pile_set_name": "Github"
} |